kwikid-forms 0.6.22 → 0.6.23

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.
@@ -4408,11 +4408,11 @@
4408
4408
  (function () { return __awaiter(_this, void 0, void 0, function () {
4409
4409
  var res;
4410
4410
  var _this = this;
4411
- return __generator(this, function (_k) {
4412
- switch (_k.label) {
4411
+ return __generator(this, function (_o) {
4412
+ switch (_o.label) {
4413
4413
  case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
4414
4414
  case 1:
4415
- res = _k.sent();
4415
+ res = _o.sent();
4416
4416
  if (res) {
4417
4417
  this.loading = false;
4418
4418
  this.cameraRecordingTimerSubcription = this.cameraRecordService
@@ -4435,7 +4435,7 @@
4435
4435
  };
4436
4436
  KwikIDFormViewComponent.prototype.ngAfterViewInit = function () { };
4437
4437
  KwikIDFormViewComponent.prototype.ngOnChanges = function (changes) {
4438
- var _k, _l, _m;
4438
+ var _o, _p, _q;
4439
4439
  var _this = this;
4440
4440
  var _a, _b, _c, _d;
4441
4441
  var verifyChange = function (key) {
@@ -4457,9 +4457,9 @@
4457
4457
  ? changes.popupFormCallback.currentValue.popupFormData["data"]
4458
4458
  : changes.popupFormCallback.currentValue.popupFormData;
4459
4459
  var popupFormConfig = changes.popupFormCallback.currentValue.popupFormConfig;
4460
- this.popupFormData = kwikidToolkit.mergeObjects(this.popupFormData, (_k = {},
4461
- _k[popupFormConfig.key] = popupFormData,
4462
- _k));
4460
+ this.popupFormData = kwikidToolkit.mergeObjects(this.popupFormData, (_o = {},
4461
+ _o[popupFormConfig.key] = popupFormData,
4462
+ _o));
4463
4463
  this.formData = kwikidToolkit.mergeObjects(this.formData, this.popupFormData);
4464
4464
  if (kwikidToolkit.checkObjectKeyExists(changes.popupFormCallback.currentValue, "stopTaskExecution")) {
4465
4465
  this.stopTaskExecution =
@@ -4500,9 +4500,9 @@
4500
4500
  emitEvent: false,
4501
4501
  onlySelf: false
4502
4502
  });
4503
- this.formGroup.patchValue((_l = {},
4504
- _l[field_1.key] = kwikidToolkit.getObjectDeepCopy([image]),
4505
- _l), { emitEvent: false });
4503
+ this.formGroup.patchValue((_p = {},
4504
+ _p[field_1.key] = kwikidToolkit.getObjectDeepCopy([image]),
4505
+ _p), { emitEvent: false });
4506
4506
  this.formGroup.controls[field_1.key].updateValueAndValidity({
4507
4507
  emitEvent: false
4508
4508
  });
@@ -4522,11 +4522,11 @@
4522
4522
  ALL_FORMS_DATA: this.allFormsData
4523
4523
  }, this.takeAction.bind(this));
4524
4524
  (function () { return __awaiter(_this, void 0, void 0, function () {
4525
- return __generator(this, function (_k) {
4526
- switch (_k.label) {
4525
+ return __generator(this, function (_o) {
4526
+ switch (_o.label) {
4527
4527
  case 0: return [4 /*yield*/, validations_1.validate(field_1.validation)];
4528
4528
  case 1:
4529
- _k.sent();
4529
+ _o.sent();
4530
4530
  return [2 /*return*/];
4531
4531
  }
4532
4532
  });
@@ -4555,9 +4555,9 @@
4555
4555
  emitEvent: false,
4556
4556
  onlySelf: false
4557
4557
  });
4558
- this.formGroup.patchValue((_m = {},
4559
- _m[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]),
4560
- _m), { emitEvent: false });
4558
+ this.formGroup.patchValue((_q = {},
4559
+ _q[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]),
4560
+ _q), { emitEvent: false });
4561
4561
  this.formGroup.controls[field_1.key].updateValueAndValidity({
4562
4562
  emitEvent: false
4563
4563
  });
@@ -4577,11 +4577,11 @@
4577
4577
  ALL_FORMS_DATA: this.allFormsData
4578
4578
  }, this.takeAction.bind(this));
4579
4579
  (function () { return __awaiter(_this, void 0, void 0, function () {
4580
- return __generator(this, function (_k) {
4581
- switch (_k.label) {
4580
+ return __generator(this, function (_o) {
4581
+ switch (_o.label) {
4582
4582
  case 0: return [4 /*yield*/, validations_2.validate(field_1.validation)];
4583
4583
  case 1:
4584
- _k.sent();
4584
+ _o.sent();
4585
4585
  return [2 /*return*/];
4586
4586
  }
4587
4587
  });
@@ -4633,11 +4633,11 @@
4633
4633
  ALL_FORMS_DATA: this.allFormsData
4634
4634
  }, this.takeAction.bind(this));
4635
4635
  (function () { return __awaiter(_this, void 0, void 0, function () {
4636
- return __generator(this, function (_k) {
4637
- switch (_k.label) {
4636
+ return __generator(this, function (_o) {
4637
+ switch (_o.label) {
4638
4638
  case 0: return [4 /*yield*/, validations_3.validate(field_2.validation)];
4639
4639
  case 1:
4640
- _k.sent();
4640
+ _o.sent();
4641
4641
  return [2 /*return*/];
4642
4642
  }
4643
4643
  });
@@ -4652,11 +4652,11 @@
4652
4652
  if (verifyChange("formConfig")) {
4653
4653
  this.formConfig = changes.formConfig.currentValue;
4654
4654
  (function () { return __awaiter(_this, void 0, void 0, function () {
4655
- return __generator(this, function (_k) {
4656
- switch (_k.label) {
4655
+ return __generator(this, function (_o) {
4656
+ switch (_o.label) {
4657
4657
  case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
4658
4658
  case 1:
4659
- _k.sent();
4659
+ _o.sent();
4660
4660
  return [2 /*return*/];
4661
4661
  }
4662
4662
  });
@@ -4673,11 +4673,11 @@
4673
4673
  };
4674
4674
  KwikIDFormViewComponent.prototype.initFormConfig = function (formConfig) {
4675
4675
  return __awaiter(this, void 0, void 0, function () {
4676
- var _k, _l, preTask, task, e_1_1, _m, _loop_1, this_1, _o, _p, field, _q, _r, field, validations, e_2_1;
4677
- var e_1, _s, e_3, _t, e_2, _u;
4676
+ var _o, _p, preTask, task, e_1_1, _q, _loop_1, this_1, _r, _s, field, _t, _u, field, validations, e_2_1;
4677
+ var e_1, _v, e_3, _w, e_2, _x;
4678
4678
  var _this = this;
4679
- return __generator(this, function (_v) {
4680
- switch (_v.label) {
4679
+ return __generator(this, function (_y) {
4680
+ switch (_y.label) {
4681
4681
  case 0:
4682
4682
  formConfig = new Converter().convertFormConfig(formConfig);
4683
4683
  formConfig = new Converter().updateFormConfigProperties(formConfig);
@@ -4686,14 +4686,14 @@
4686
4686
  this.setFormDataFromAllFormsData();
4687
4687
  if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
4688
4688
  kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "pre"))) return [3 /*break*/, 10];
4689
- _v.label = 1;
4689
+ _y.label = 1;
4690
4690
  case 1:
4691
- _v.trys.push([1, 7, 8, 9]);
4692
- _k = __values(this.formConfig.tasks.pre), _l = _k.next();
4693
- _v.label = 2;
4691
+ _y.trys.push([1, 7, 8, 9]);
4692
+ _o = __values(this.formConfig.tasks.pre), _p = _o.next();
4693
+ _y.label = 2;
4694
4694
  case 2:
4695
- if (!!_l.done) return [3 /*break*/, 6];
4696
- preTask = _l.value;
4695
+ if (!!_p.done) return [3 /*break*/, 6];
4696
+ preTask = _p.value;
4697
4697
  task = new Tasks(preTask, {
4698
4698
  FORM_CONFIG: this.formConfig,
4699
4699
  FORM_FIELDS: this.formFields,
@@ -4711,7 +4711,7 @@
4711
4711
  }
4712
4712
  return [4 /*yield*/, task.execute()];
4713
4713
  case 3:
4714
- _v.sent();
4714
+ _y.sent();
4715
4715
  // Wait for ngOnChanges to be called before continuing to the next task
4716
4716
  return [4 /*yield*/, new Promise(function (resolve) {
4717
4717
  var intervalId = setInterval(function () {
@@ -4723,36 +4723,36 @@
4723
4723
  })];
4724
4724
  case 4:
4725
4725
  // Wait for ngOnChanges to be called before continuing to the next task
4726
- _v.sent();
4726
+ _y.sent();
4727
4727
  if (this.stopTaskExecution) {
4728
4728
  return [3 /*break*/, 6];
4729
4729
  }
4730
- _v.label = 5;
4730
+ _y.label = 5;
4731
4731
  case 5:
4732
- _l = _k.next();
4732
+ _p = _o.next();
4733
4733
  return [3 /*break*/, 2];
4734
4734
  case 6: return [3 /*break*/, 9];
4735
4735
  case 7:
4736
- e_1_1 = _v.sent();
4736
+ e_1_1 = _y.sent();
4737
4737
  e_1 = { error: e_1_1 };
4738
4738
  return [3 /*break*/, 9];
4739
4739
  case 8:
4740
4740
  try {
4741
- if (_l && !_l.done && (_s = _k.return)) _s.call(_k);
4741
+ if (_p && !_p.done && (_v = _o.return)) _v.call(_o);
4742
4742
  }
4743
4743
  finally { if (e_1) throw e_1.error; }
4744
4744
  return [7 /*endfinally*/];
4745
4745
  case 9:
4746
4746
  this.formData = kwikidToolkit.mergeObjects(this.formData, this.popupFormData);
4747
- _v.label = 10;
4747
+ _y.label = 10;
4748
4748
  case 10:
4749
4749
  if (this.stopTaskExecution) {
4750
4750
  return [2 /*return*/, false];
4751
4751
  }
4752
- _m = this;
4752
+ _q = this;
4753
4753
  return [4 /*yield*/, this.formViewService.createFormGroup(this.formFields, this.formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this))];
4754
4754
  case 11:
4755
- _m.formGroup = _v.sent();
4755
+ _q.formGroup = _y.sent();
4756
4756
  /**
4757
4757
  * For some reason if their a field of type 'IMAGE' then
4758
4758
  * formData is adding a 'undefined' key with last image's value from the array.
@@ -4762,10 +4762,10 @@
4762
4762
  delete this.formData["undefined"];
4763
4763
  }
4764
4764
  _loop_1 = function (field) {
4765
- var _w, _x;
4765
+ var _z, _0;
4766
4766
  if (field.isFormElement) {
4767
- this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_w = {}, _w[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _w));
4768
- this_1.formData = Object.assign(Object.assign({}, this_1.formData), (_x = {}, _x[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _x));
4767
+ this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_z = {}, _z[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _z));
4768
+ this_1.formData = Object.assign(Object.assign({}, this_1.formData), (_0 = {}, _0[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _0));
4769
4769
  if (field.type === EFieldType.FILE) {
4770
4770
  this_1.files[field.key] = this_1.formGroup.controls[field.key].value;
4771
4771
  }
@@ -4779,11 +4779,11 @@
4779
4779
  }
4780
4780
  this_1.formGroup.controls[field.key].valueChanges
4781
4781
  .pipe(operators.pairwise())
4782
- .subscribe(function (_k) {
4783
- var _l, _m;
4784
- var _o = __read(_k, 2), previousValue = _o[0], currentValue = _o[1];
4785
- _this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_l = {}, _l[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _l));
4786
- _this.formData = Object.assign(Object.assign({}, _this.formData), (_m = {}, _m[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _m));
4782
+ .subscribe(function (_o) {
4783
+ var _p, _q;
4784
+ var _r = __read(_o, 2), previousValue = _r[0], currentValue = _r[1];
4785
+ _this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_p = {}, _p[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _p));
4786
+ _this.formData = Object.assign(Object.assign({}, _this.formData), (_q = {}, _q[field.key] = convertFormFieldValueToStandardFormat(field, currentValue), _q));
4787
4787
  if (field.type === EFieldType.FILE) {
4788
4788
  _this.files[field.key] = currentValue;
4789
4789
  }
@@ -4800,26 +4800,26 @@
4800
4800
  };
4801
4801
  this_1 = this;
4802
4802
  try {
4803
- for (_o = __values(this.formFields), _p = _o.next(); !_p.done; _p = _o.next()) {
4804
- field = _p.value;
4803
+ for (_r = __values(this.formFields), _s = _r.next(); !_s.done; _s = _r.next()) {
4804
+ field = _s.value;
4805
4805
  _loop_1(field);
4806
4806
  }
4807
4807
  }
4808
4808
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
4809
4809
  finally {
4810
4810
  try {
4811
- if (_p && !_p.done && (_t = _o.return)) _t.call(_o);
4811
+ if (_s && !_s.done && (_w = _r.return)) _w.call(_r);
4812
4812
  }
4813
4813
  finally { if (e_3) throw e_3.error; }
4814
4814
  }
4815
- _v.label = 12;
4815
+ _y.label = 12;
4816
4816
  case 12:
4817
- _v.trys.push([12, 18, 19, 20]);
4818
- _q = __values(this.formFields), _r = _q.next();
4819
- _v.label = 13;
4817
+ _y.trys.push([12, 18, 19, 20]);
4818
+ _t = __values(this.formFields), _u = _t.next();
4819
+ _y.label = 13;
4820
4820
  case 13:
4821
- if (!!_r.done) return [3 /*break*/, 17];
4822
- field = _r.value;
4821
+ if (!!_u.done) return [3 /*break*/, 17];
4822
+ field = _u.value;
4823
4823
  if (!field.isFormElement) return [3 /*break*/, 16];
4824
4824
  if (!kwikidToolkit.checkObjectKeyExists(field, "validation")) return [3 /*break*/, 15];
4825
4825
  if (!field.validation.triggers.includes("ON_INIT")) return [3 /*break*/, 15];
@@ -4833,8 +4833,8 @@
4833
4833
  }, this.takeAction.bind(this));
4834
4834
  return [4 /*yield*/, validations.validate(field.validation)];
4835
4835
  case 14:
4836
- _v.sent();
4837
- _v.label = 15;
4836
+ _y.sent();
4837
+ _y.label = 15;
4838
4838
  case 15:
4839
4839
  if (kwikidToolkit.checkObjectKeyExists(field, "connectedElements")) {
4840
4840
  this.handleConnectedElements({
@@ -4842,18 +4842,18 @@
4842
4842
  value: this.formGroup.controls[field.key].value
4843
4843
  }, "ON_INIT");
4844
4844
  }
4845
- _v.label = 16;
4845
+ _y.label = 16;
4846
4846
  case 16:
4847
- _r = _q.next();
4847
+ _u = _t.next();
4848
4848
  return [3 /*break*/, 13];
4849
4849
  case 17: return [3 /*break*/, 20];
4850
4850
  case 18:
4851
- e_2_1 = _v.sent();
4851
+ e_2_1 = _y.sent();
4852
4852
  e_2 = { error: e_2_1 };
4853
4853
  return [3 /*break*/, 20];
4854
4854
  case 19:
4855
4855
  try {
4856
- if (_r && !_r.done && (_u = _q.return)) _u.call(_q);
4856
+ if (_u && !_u.done && (_x = _t.return)) _x.call(_t);
4857
4857
  }
4858
4858
  finally { if (e_2) throw e_2.error; }
4859
4859
  return [7 /*endfinally*/];
@@ -4891,10 +4891,10 @@
4891
4891
  };
4892
4892
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroupActions = function (childFieldGroupConfig, parentField) {
4893
4893
  return __awaiter(this, void 0, void 0, function () {
4894
- var rulesMapping, _k, _l, action, conditionSuccess, actions, e_4_1;
4895
- var e_4, _m;
4896
- return __generator(this, function (_o) {
4897
- switch (_o.label) {
4894
+ var rulesMapping, _o, _p, action, conditionSuccess, actions, e_4_1;
4895
+ var e_4, _q;
4896
+ return __generator(this, function (_r) {
4897
+ switch (_r.label) {
4898
4898
  case 0:
4899
4899
  if (!kwikidToolkit.checkObjectKeyExists(childFieldGroupConfig, "rules")) return [3 /*break*/, 8];
4900
4900
  rulesMapping = new kwikidToolkit.Rule(childFieldGroupConfig.rules, {
@@ -4904,14 +4904,14 @@
4904
4904
  PREVIOUS_FORM_DATA: this.previousFormData,
4905
4905
  ALL_FORMS_DATA: this.allFormsData
4906
4906
  }).mapping();
4907
- _o.label = 1;
4907
+ _r.label = 1;
4908
4908
  case 1:
4909
- _o.trys.push([1, 6, 7, 8]);
4910
- _k = __values(childFieldGroupConfig.actions), _l = _k.next();
4911
- _o.label = 2;
4909
+ _r.trys.push([1, 6, 7, 8]);
4910
+ _o = __values(childFieldGroupConfig.actions), _p = _o.next();
4911
+ _r.label = 2;
4912
4912
  case 2:
4913
- if (!!_l.done) return [3 /*break*/, 5];
4914
- action = _l.value;
4913
+ if (!!_p.done) return [3 /*break*/, 5];
4914
+ action = _p.value;
4915
4915
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
4916
4916
  if (!conditionSuccess) return [3 /*break*/, 4];
4917
4917
  actions = new kwikidToolkit.Action(action, rulesMapping, {
@@ -4924,19 +4924,19 @@
4924
4924
  }, this.takeActionOnFieldGroup.bind(this));
4925
4925
  return [4 /*yield*/, actions.execute()];
4926
4926
  case 3:
4927
- _o.sent();
4928
- _o.label = 4;
4927
+ _r.sent();
4928
+ _r.label = 4;
4929
4929
  case 4:
4930
- _l = _k.next();
4930
+ _p = _o.next();
4931
4931
  return [3 /*break*/, 2];
4932
4932
  case 5: return [3 /*break*/, 8];
4933
4933
  case 6:
4934
- e_4_1 = _o.sent();
4934
+ e_4_1 = _r.sent();
4935
4935
  e_4 = { error: e_4_1 };
4936
4936
  return [3 /*break*/, 8];
4937
4937
  case 7:
4938
4938
  try {
4939
- if (_l && !_l.done && (_m = _k.return)) _m.call(_k);
4939
+ if (_p && !_p.done && (_q = _o.return)) _q.call(_o);
4940
4940
  }
4941
4941
  finally { if (e_4) throw e_4.error; }
4942
4942
  return [7 /*endfinally*/];
@@ -4947,15 +4947,15 @@
4947
4947
  };
4948
4948
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroup = function (currentField, connectedFieldGroupConfig, eventType) {
4949
4949
  return __awaiter(this, void 0, void 0, function () {
4950
- return __generator(this, function (_k) {
4951
- switch (_k.label) {
4950
+ return __generator(this, function (_o) {
4951
+ switch (_o.label) {
4952
4952
  case 0:
4953
4953
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers")) return [3 /*break*/, 2];
4954
4954
  if (!connectedFieldGroupConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
4955
4955
  return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
4956
4956
  case 1:
4957
- _k.sent();
4958
- _k.label = 2;
4957
+ _o.sent();
4958
+ _o.label = 2;
4959
4959
  case 2: return [2 /*return*/];
4960
4960
  }
4961
4961
  });
@@ -4963,10 +4963,10 @@
4963
4963
  };
4964
4964
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldActions = function (connectedFieldConfig, connectedField) {
4965
4965
  return __awaiter(this, void 0, void 0, function () {
4966
- var rulesMapping, _k, _l, action, conditionSuccess, actions, e_5_1;
4967
- var e_5, _m;
4968
- return __generator(this, function (_o) {
4969
- switch (_o.label) {
4966
+ var rulesMapping, _o, _p, action, conditionSuccess, actions, e_5_1;
4967
+ var e_5, _q;
4968
+ return __generator(this, function (_r) {
4969
+ switch (_r.label) {
4970
4970
  case 0:
4971
4971
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "rules")) return [3 /*break*/, 8];
4972
4972
  rulesMapping = new kwikidToolkit.Rule(connectedFieldConfig.rules, {
@@ -4976,14 +4976,14 @@
4976
4976
  PREVIOUS_FORM_DATA: this.previousFormData,
4977
4977
  ALL_FORMS_DATA: this.allFormsData
4978
4978
  }).mapping();
4979
- _o.label = 1;
4979
+ _r.label = 1;
4980
4980
  case 1:
4981
- _o.trys.push([1, 6, 7, 8]);
4982
- _k = __values(connectedFieldConfig.actions), _l = _k.next();
4983
- _o.label = 2;
4981
+ _r.trys.push([1, 6, 7, 8]);
4982
+ _o = __values(connectedFieldConfig.actions), _p = _o.next();
4983
+ _r.label = 2;
4984
4984
  case 2:
4985
- if (!!_l.done) return [3 /*break*/, 5];
4986
- action = _l.value;
4985
+ if (!!_p.done) return [3 /*break*/, 5];
4986
+ action = _p.value;
4987
4987
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
4988
4988
  if (!conditionSuccess) return [3 /*break*/, 4];
4989
4989
  actions = new kwikidToolkit.Action(action, rulesMapping, {
@@ -4996,19 +4996,19 @@
4996
4996
  }, this.takeAction.bind(this));
4997
4997
  return [4 /*yield*/, actions.execute()];
4998
4998
  case 3:
4999
- _o.sent();
5000
- _o.label = 4;
4999
+ _r.sent();
5000
+ _r.label = 4;
5001
5001
  case 4:
5002
- _l = _k.next();
5002
+ _p = _o.next();
5003
5003
  return [3 /*break*/, 2];
5004
5004
  case 5: return [3 /*break*/, 8];
5005
5005
  case 6:
5006
- e_5_1 = _o.sent();
5006
+ e_5_1 = _r.sent();
5007
5007
  e_5 = { error: e_5_1 };
5008
5008
  return [3 /*break*/, 8];
5009
5009
  case 7:
5010
5010
  try {
5011
- if (_l && !_l.done && (_m = _k.return)) _m.call(_k);
5011
+ if (_p && !_p.done && (_q = _o.return)) _q.call(_o);
5012
5012
  }
5013
5013
  finally { if (e_5) throw e_5.error; }
5014
5014
  return [7 /*endfinally*/];
@@ -5020,16 +5020,16 @@
5020
5020
  KwikIDFormViewComponent.prototype.handleConnectedElementFields = function (currentField, connectedFieldConfig, eventType, nested) {
5021
5021
  return __awaiter(this, void 0, void 0, function () {
5022
5022
  var connectedField;
5023
- return __generator(this, function (_k) {
5024
- switch (_k.label) {
5023
+ return __generator(this, function (_o) {
5024
+ switch (_o.label) {
5025
5025
  case 0:
5026
5026
  connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig["key"]);
5027
5027
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers")) return [3 /*break*/, 2];
5028
5028
  if (!connectedFieldConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
5029
5029
  return [4 /*yield*/, this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField)];
5030
5030
  case 1:
5031
- connectedField = _k.sent();
5032
- _k.label = 2;
5031
+ connectedField = _o.sent();
5032
+ _o.label = 2;
5033
5033
  case 2:
5034
5034
  if (kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "handleNestedFields")) {
5035
5035
  if (connectedFieldConfig.handleNestedFields) {
@@ -5044,67 +5044,67 @@
5044
5044
  KwikIDFormViewComponent.prototype.handleConnectedElements = function (e, eventType) {
5045
5045
  return __awaiter(this, void 0, void 0, function () {
5046
5046
  var currentField, connectedFieldGroups, connectedFieldGroups_1, connectedFieldGroups_1_1, connectedFieldGroupConfig, e_6_1, connectedFields, connectedFields_1, connectedFields_1_1, connectedFieldConfig, e_7_1;
5047
- var e_6, _k, e_7, _l;
5048
- return __generator(this, function (_m) {
5049
- switch (_m.label) {
5047
+ var e_6, _o, e_7, _p;
5048
+ return __generator(this, function (_q) {
5049
+ switch (_q.label) {
5050
5050
  case 0:
5051
5051
  currentField = getFormFieldByKey(this.formFields, e.key);
5052
5052
  if (!(currentField !== undefined)) return [3 /*break*/, 17];
5053
5053
  if (!kwikidToolkit.checkObjectKeyExists(currentField, "connectedElements")) return [3 /*break*/, 16];
5054
5054
  if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFieldGroups")) return [3 /*break*/, 8];
5055
5055
  connectedFieldGroups = currentField.connectedElements.connectedFieldGroups;
5056
- _m.label = 1;
5056
+ _q.label = 1;
5057
5057
  case 1:
5058
- _m.trys.push([1, 6, 7, 8]);
5058
+ _q.trys.push([1, 6, 7, 8]);
5059
5059
  connectedFieldGroups_1 = __values(connectedFieldGroups), connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
5060
- _m.label = 2;
5060
+ _q.label = 2;
5061
5061
  case 2:
5062
5062
  if (!!connectedFieldGroups_1_1.done) return [3 /*break*/, 5];
5063
5063
  connectedFieldGroupConfig = connectedFieldGroups_1_1.value;
5064
5064
  return [4 /*yield*/, this.handleConnectedElementFieldGroup(currentField, connectedFieldGroupConfig, eventType)];
5065
5065
  case 3:
5066
- _m.sent();
5067
- _m.label = 4;
5066
+ _q.sent();
5067
+ _q.label = 4;
5068
5068
  case 4:
5069
5069
  connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
5070
5070
  return [3 /*break*/, 2];
5071
5071
  case 5: return [3 /*break*/, 8];
5072
5072
  case 6:
5073
- e_6_1 = _m.sent();
5073
+ e_6_1 = _q.sent();
5074
5074
  e_6 = { error: e_6_1 };
5075
5075
  return [3 /*break*/, 8];
5076
5076
  case 7:
5077
5077
  try {
5078
- if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (_k = connectedFieldGroups_1.return)) _k.call(connectedFieldGroups_1);
5078
+ if (connectedFieldGroups_1_1 && !connectedFieldGroups_1_1.done && (_o = connectedFieldGroups_1.return)) _o.call(connectedFieldGroups_1);
5079
5079
  }
5080
5080
  finally { if (e_6) throw e_6.error; }
5081
5081
  return [7 /*endfinally*/];
5082
5082
  case 8:
5083
5083
  if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFields")) return [3 /*break*/, 16];
5084
5084
  connectedFields = currentField.connectedElements.connectedFields;
5085
- _m.label = 9;
5085
+ _q.label = 9;
5086
5086
  case 9:
5087
- _m.trys.push([9, 14, 15, 16]);
5087
+ _q.trys.push([9, 14, 15, 16]);
5088
5088
  connectedFields_1 = __values(connectedFields), connectedFields_1_1 = connectedFields_1.next();
5089
- _m.label = 10;
5089
+ _q.label = 10;
5090
5090
  case 10:
5091
5091
  if (!!connectedFields_1_1.done) return [3 /*break*/, 13];
5092
5092
  connectedFieldConfig = connectedFields_1_1.value;
5093
5093
  return [4 /*yield*/, this.handleConnectedElementFields(currentField, connectedFieldConfig, eventType, eventType)];
5094
5094
  case 11:
5095
- currentField = _m.sent();
5096
- _m.label = 12;
5095
+ currentField = _q.sent();
5096
+ _q.label = 12;
5097
5097
  case 12:
5098
5098
  connectedFields_1_1 = connectedFields_1.next();
5099
5099
  return [3 /*break*/, 10];
5100
5100
  case 13: return [3 /*break*/, 16];
5101
5101
  case 14:
5102
- e_7_1 = _m.sent();
5102
+ e_7_1 = _q.sent();
5103
5103
  e_7 = { error: e_7_1 };
5104
5104
  return [3 /*break*/, 16];
5105
5105
  case 15:
5106
5106
  try {
5107
- if (connectedFields_1_1 && !connectedFields_1_1.done && (_l = connectedFields_1.return)) _l.call(connectedFields_1);
5107
+ if (connectedFields_1_1 && !connectedFields_1_1.done && (_p = connectedFields_1.return)) _p.call(connectedFields_1);
5108
5108
  }
5109
5109
  finally { if (e_7) throw e_7.error; }
5110
5110
  return [7 /*endfinally*/];
@@ -5116,23 +5116,23 @@
5116
5116
  });
5117
5117
  };
5118
5118
  KwikIDFormViewComponent.prototype.handleRemovedFile = function (e) {
5119
- var _k;
5119
+ var _o;
5120
5120
  this.showApiLoader();
5121
5121
  if (this.formGroup["controls"][e.key].enabled) {
5122
5122
  this.files[e.key] = e.files;
5123
5123
  this.formData[e.key] = filterDuplicatesFiles(this.files[e.key]);
5124
- this.formGroup.patchValue((_k = {},
5125
- _k[e.key] = this.formData[e.key],
5126
- _k), { emitEvent: false });
5124
+ this.formGroup.patchValue((_o = {},
5125
+ _o[e.key] = this.formData[e.key],
5126
+ _o), { emitEvent: false });
5127
5127
  }
5128
5128
  this.hideApiLoader();
5129
5129
  };
5130
5130
  KwikIDFormViewComponent.prototype.handleGetKeyValueFile = function (e) {
5131
5131
  return __awaiter(this, void 0, void 0, function () {
5132
5132
  var field, values, values_1, values_1_1, value, e_8_1, _loop_2, this_2, values_2, values_2_1, value, e_9_1;
5133
- var e_8, _k, e_9, _l;
5134
- return __generator(this, function (_m) {
5135
- switch (_m.label) {
5133
+ var e_8, _o, e_9, _p;
5134
+ return __generator(this, function (_q) {
5135
+ switch (_q.label) {
5136
5136
  case 0:
5137
5137
  this.showApiLoader();
5138
5138
  field = getFormFieldByKey(this.formFields, e.key);
@@ -5140,41 +5140,41 @@
5140
5140
  if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
5141
5141
  kwikidToolkit.checkObjectKeyExists(field.properties, "uploadFileToServer") &&
5142
5142
  field.properties.uploadFileToServer)) return [3 /*break*/, 9];
5143
- _m.label = 1;
5143
+ _q.label = 1;
5144
5144
  case 1:
5145
- _m.trys.push([1, 6, 7, 8]);
5145
+ _q.trys.push([1, 6, 7, 8]);
5146
5146
  values_1 = __values(values), values_1_1 = values_1.next();
5147
- _m.label = 2;
5147
+ _q.label = 2;
5148
5148
  case 2:
5149
5149
  if (!!values_1_1.done) return [3 /*break*/, 5];
5150
5150
  value = values_1_1.value;
5151
5151
  return [4 /*yield*/, this.uploadFile(field, value)];
5152
5152
  case 3:
5153
- _m.sent();
5154
- _m.label = 4;
5153
+ _q.sent();
5154
+ _q.label = 4;
5155
5155
  case 4:
5156
5156
  values_1_1 = values_1.next();
5157
5157
  return [3 /*break*/, 2];
5158
5158
  case 5: return [3 /*break*/, 8];
5159
5159
  case 6:
5160
- e_8_1 = _m.sent();
5160
+ e_8_1 = _q.sent();
5161
5161
  e_8 = { error: e_8_1 };
5162
5162
  return [3 /*break*/, 8];
5163
5163
  case 7:
5164
5164
  try {
5165
- if (values_1_1 && !values_1_1.done && (_k = values_1.return)) _k.call(values_1);
5165
+ if (values_1_1 && !values_1_1.done && (_o = values_1.return)) _o.call(values_1);
5166
5166
  }
5167
5167
  finally { if (e_8) throw e_8.error; }
5168
5168
  return [7 /*endfinally*/];
5169
5169
  case 8: return [3 /*break*/, 18];
5170
5170
  case 9:
5171
5171
  _loop_2 = function (value) {
5172
- var updatedFile, _o;
5173
- return __generator(this, function (_p) {
5174
- switch (_p.label) {
5172
+ var updatedFile, _r;
5173
+ return __generator(this, function (_s) {
5174
+ switch (_s.label) {
5175
5175
  case 0:
5176
5176
  this_2.updateFiles(value, "LOADING", e.key);
5177
- _o = kwikidToolkit.getObjectDeepCopy;
5177
+ _r = kwikidToolkit.getObjectDeepCopy;
5178
5178
  return [4 /*yield*/, new Promise(function (resolve) {
5179
5179
  setTimeout(function () {
5180
5180
  resolve({
@@ -5188,42 +5188,42 @@
5188
5188
  }, 300); // 1000 ms = 1 sec
5189
5189
  })];
5190
5190
  case 1:
5191
- updatedFile = _o.apply(void 0, [_p.sent()]);
5191
+ updatedFile = _r.apply(void 0, [_s.sent()]);
5192
5192
  this_2.updateFiles(updatedFile, "NORMAL", e.key);
5193
5193
  return [2 /*return*/];
5194
5194
  }
5195
5195
  });
5196
5196
  };
5197
5197
  this_2 = this;
5198
- _m.label = 10;
5198
+ _q.label = 10;
5199
5199
  case 10:
5200
- _m.trys.push([10, 15, 16, 17]);
5200
+ _q.trys.push([10, 15, 16, 17]);
5201
5201
  values_2 = __values(values), values_2_1 = values_2.next();
5202
- _m.label = 11;
5202
+ _q.label = 11;
5203
5203
  case 11:
5204
5204
  if (!!values_2_1.done) return [3 /*break*/, 14];
5205
5205
  value = values_2_1.value;
5206
5206
  return [5 /*yield**/, _loop_2(value)];
5207
5207
  case 12:
5208
- _m.sent();
5209
- _m.label = 13;
5208
+ _q.sent();
5209
+ _q.label = 13;
5210
5210
  case 13:
5211
5211
  values_2_1 = values_2.next();
5212
5212
  return [3 /*break*/, 11];
5213
5213
  case 14: return [3 /*break*/, 17];
5214
5214
  case 15:
5215
- e_9_1 = _m.sent();
5215
+ e_9_1 = _q.sent();
5216
5216
  e_9 = { error: e_9_1 };
5217
5217
  return [3 /*break*/, 17];
5218
5218
  case 16:
5219
5219
  try {
5220
- if (values_2_1 && !values_2_1.done && (_l = values_2.return)) _l.call(values_2);
5220
+ if (values_2_1 && !values_2_1.done && (_p = values_2.return)) _p.call(values_2);
5221
5221
  }
5222
5222
  finally { if (e_9) throw e_9.error; }
5223
5223
  return [7 /*endfinally*/];
5224
5224
  case 17:
5225
5225
  this.hideApiLoader();
5226
- _m.label = 18;
5226
+ _q.label = 18;
5227
5227
  case 18: return [2 /*return*/];
5228
5228
  }
5229
5229
  });
@@ -5231,31 +5231,31 @@
5231
5231
  };
5232
5232
  /** Methods for Camera related fields like 'CAPTURE' or 'RECORD' */
5233
5233
  KwikIDFormViewComponent.prototype.handleOnClickGetRemovedMediaFile = function (e) {
5234
- var _k;
5234
+ var _o;
5235
5235
  this.showApiLoader();
5236
5236
  if (this.formGroup["controls"][e.key].enabled) {
5237
5237
  this.resetCamera();
5238
5238
  this.mediaFiles[e.key] = e.mediaFiles;
5239
5239
  this.formData[e.key] = filterDuplicatesMediaFiles(this.mediaFiles[e.key]);
5240
- this.formGroup.patchValue((_k = {},
5241
- _k[e.key] = this.formData[e.key],
5242
- _k), { emitEvent: false });
5240
+ this.formGroup.patchValue((_o = {},
5241
+ _o[e.key] = this.formData[e.key],
5242
+ _o), { emitEvent: false });
5243
5243
  }
5244
5244
  this.hideApiLoader();
5245
5245
  };
5246
5246
  KwikIDFormViewComponent.prototype.handleOnClickInputCamera = function (e, field) {
5247
5247
  var _a, _b, _c, _d, _e, _f;
5248
5248
  return __awaiter(this, void 0, void 0, function () {
5249
- var fieldKey, fieldcameraConfig, _k, cameraHelper, _l, _m;
5250
- return __generator(this, function (_o) {
5251
- switch (_o.label) {
5249
+ var fieldKey, fieldcameraConfig, _o, cameraHelper, _p, _q;
5250
+ return __generator(this, function (_r) {
5251
+ switch (_r.label) {
5252
5252
  case 0:
5253
5253
  fieldKey = field.key;
5254
5254
  fieldcameraConfig = (_b = (_a = field === null || field === void 0 ? void 0 : field.properties) === null || _a === void 0 ? void 0 : _a.cameraConfig) !== null && _b !== void 0 ? _b : {};
5255
5255
  this.cameraType = (field === null || field === void 0 ? void 0 : field.type.toUpperCase()) || "";
5256
5256
  this.cameraFieldKey = fieldKey;
5257
- _k = this.cameraType;
5258
- switch (_k) {
5257
+ _o = this.cameraType;
5258
+ switch (_o) {
5259
5259
  case "CAPTURE": return [3 /*break*/, 1];
5260
5260
  case "RECORD": return [3 /*break*/, 5];
5261
5261
  }
@@ -5268,16 +5268,16 @@
5268
5268
  if (!(((_d = (_c = this.cameraConfig) === null || _c === void 0 ? void 0 : _c.others) === null || _d === void 0 ? void 0 : _d.isWatermark) ||
5269
5269
  ((_f = (_e = this.cameraConfig) === null || _e === void 0 ? void 0 : _e.others) === null || _f === void 0 ? void 0 : _f.isWatermarkForImageUpload))) return [3 /*break*/, 3];
5270
5270
  cameraHelper = new CameraHelper(field, this.formFields, this.allFormsData, this.formData, this.previousFormData);
5271
- _l = this;
5272
- _m = {};
5271
+ _p = this;
5272
+ _q = {};
5273
5273
  return [4 /*yield*/, cameraHelper.getCameraWatermarkData()];
5274
5274
  case 2:
5275
- _l.cameraData = (_m.watermark = _o.sent(),
5276
- _m);
5275
+ _p.cameraData = (_q.watermark = _r.sent(),
5276
+ _q);
5277
5277
  return [3 /*break*/, 4];
5278
5278
  case 3:
5279
5279
  this.cameraData = undefined;
5280
- _o.label = 4;
5280
+ _r.label = 4;
5281
5281
  case 4: return [3 /*break*/, 7];
5282
5282
  case 5:
5283
5283
  this.cameraConfig = kwikidToolkit.mergeObjectsDeep([
@@ -5303,10 +5303,10 @@
5303
5303
  KwikIDFormViewComponent.prototype.setCameraMedia = function (media) {
5304
5304
  return __awaiter(this, void 0, void 0, function () {
5305
5305
  var field, validations_4;
5306
- var _k;
5306
+ var _o;
5307
5307
  var _this = this;
5308
- return __generator(this, function (_l) {
5309
- switch (_l.label) {
5308
+ return __generator(this, function (_p) {
5309
+ switch (_p.label) {
5310
5310
  case 0:
5311
5311
  field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
5312
5312
  if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
@@ -5314,7 +5314,7 @@
5314
5314
  field.properties.uploadFileToServer)) return [3 /*break*/, 2];
5315
5315
  return [4 /*yield*/, this.uploadFile(field, media)];
5316
5316
  case 1:
5317
- _l.sent();
5317
+ _p.sent();
5318
5318
  return [3 /*break*/, 3];
5319
5319
  case 2:
5320
5320
  this.resetCamera();
@@ -5324,9 +5324,9 @@
5324
5324
  emitEvent: false,
5325
5325
  onlySelf: false
5326
5326
  });
5327
- this.formGroup.patchValue((_k = {},
5328
- _k[field.key] = kwikidToolkit.getObjectDeepCopy([media]),
5329
- _k), { emitEvent: false });
5327
+ this.formGroup.patchValue((_o = {},
5328
+ _o[field.key] = kwikidToolkit.getObjectDeepCopy([media]),
5329
+ _o), { emitEvent: false });
5330
5330
  this.formGroup.controls[field.key].updateValueAndValidity({
5331
5331
  emitEvent: false
5332
5332
  });
@@ -5346,11 +5346,11 @@
5346
5346
  ALL_FORMS_DATA: this.allFormsData
5347
5347
  }, this.takeAction.bind(this));
5348
5348
  (function () { return __awaiter(_this, void 0, void 0, function () {
5349
- return __generator(this, function (_k) {
5350
- switch (_k.label) {
5349
+ return __generator(this, function (_o) {
5350
+ switch (_o.label) {
5351
5351
  case 0: return [4 /*yield*/, validations_4.validate(field.validation)];
5352
5352
  case 1:
5353
- _k.sent();
5353
+ _o.sent();
5354
5354
  return [2 /*return*/];
5355
5355
  }
5356
5356
  });
@@ -5363,7 +5363,7 @@
5363
5363
  value: this.formGroup.controls[field.key].value
5364
5364
  }, "ON_CHANGE");
5365
5365
  }
5366
- _l.label = 3;
5366
+ _p.label = 3;
5367
5367
  case 3: return [2 /*return*/];
5368
5368
  }
5369
5369
  });
@@ -5458,7 +5458,7 @@
5458
5458
  * This method is used to update the files array with the new file and it's state and response from the api of uploading the file.
5459
5459
  */
5460
5460
  KwikIDFormViewComponent.prototype.updateFiles = function (file, state, key) {
5461
- var _k;
5461
+ var _o;
5462
5462
  var _this = this;
5463
5463
  var _a;
5464
5464
  var fileWithState = kwikidToolkit.mergeObjects(file, { state: state });
@@ -5486,9 +5486,9 @@
5486
5486
  emitEvent: false,
5487
5487
  onlySelf: false
5488
5488
  });
5489
- this.formGroup.patchValue((_k = {},
5490
- _k[key] = normalFiles,
5491
- _k), { emitEvent: false });
5489
+ this.formGroup.patchValue((_o = {},
5490
+ _o[key] = normalFiles,
5491
+ _o), { emitEvent: false });
5492
5492
  this.getUnsavedDataState.emit(true);
5493
5493
  if (field.isFormElement &&
5494
5494
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
@@ -5502,11 +5502,11 @@
5502
5502
  ALL_FORMS_DATA: this.allFormsData
5503
5503
  }, this.takeAction.bind(this));
5504
5504
  (function () { return __awaiter(_this, void 0, void 0, function () {
5505
- return __generator(this, function (_k) {
5506
- switch (_k.label) {
5505
+ return __generator(this, function (_o) {
5506
+ switch (_o.label) {
5507
5507
  case 0: return [4 /*yield*/, validations_5.validate(field.validation)];
5508
5508
  case 1:
5509
- _k.sent();
5509
+ _o.sent();
5510
5510
  return [2 /*return*/];
5511
5511
  }
5512
5512
  });
@@ -5525,7 +5525,7 @@
5525
5525
  */
5526
5526
  KwikIDFormViewComponent.prototype.uploadFile = function (field, file) {
5527
5527
  return __awaiter(this, void 0, void 0, function () {
5528
- return __generator(this, function (_k) {
5528
+ return __generator(this, function (_o) {
5529
5529
  switch (field.type) {
5530
5530
  case EFieldType.FILE:
5531
5531
  this.updateFiles(file, "LOADING", field.key);
@@ -5586,11 +5586,11 @@
5586
5586
  });
5587
5587
  };
5588
5588
  KwikIDFormViewComponent.prototype.handleOnClickFormFieldButton = function (field) {
5589
- var e_10, _k;
5589
+ var e_10, _o;
5590
5590
  var formData = this.formGroup.getRawValue();
5591
5591
  try {
5592
- for (var _l = __values(this.formFields), _m = _l.next(); !_m.done; _m = _l.next()) {
5593
- var field_3 = _m.value;
5592
+ for (var _p = __values(this.formFields), _q = _p.next(); !_q.done; _q = _p.next()) {
5593
+ var field_3 = _q.value;
5594
5594
  if (field_3.isFormElement) {
5595
5595
  if (field_3.hidden) {
5596
5596
  delete formData[field_3.key];
@@ -5604,22 +5604,22 @@
5604
5604
  catch (e_10_1) { e_10 = { error: e_10_1 }; }
5605
5605
  finally {
5606
5606
  try {
5607
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
5607
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
5608
5608
  }
5609
5609
  finally { if (e_10) throw e_10.error; }
5610
5610
  }
5611
5611
  var extendedFormData = this.formFields.reduce(function (result, field, index) {
5612
- var _k;
5612
+ var _o;
5613
5613
  if (field.isFormElement && !field.hidden) {
5614
- var fieldData = (_k = {},
5615
- _k[field.key] = {
5614
+ var fieldData = (_o = {},
5615
+ _o[field.key] = {
5616
5616
  key: field.key,
5617
5617
  label: field.label,
5618
5618
  value: kwikidToolkit.isEmptyValue(formData[field.key]) ? "" : formData[field.key],
5619
5619
  type: field.type,
5620
5620
  index: index
5621
5621
  },
5622
- _k);
5622
+ _o);
5623
5623
  result[field.key] = fieldData[field.key];
5624
5624
  }
5625
5625
  return result;
@@ -5632,11 +5632,11 @@
5632
5632
  };
5633
5633
  // DOM Event Handlers
5634
5634
  KwikIDFormViewComponent.prototype.handleGetKeyValue = function (e) {
5635
- var _k;
5635
+ var _o;
5636
5636
  var _this = this;
5637
- this.formGroup.patchValue((_k = {},
5638
- _k[e.key] = e.value,
5639
- _k), { emitEvent: false });
5637
+ this.formGroup.patchValue((_o = {},
5638
+ _o[e.key] = e.value,
5639
+ _o), { emitEvent: false });
5640
5640
  var field = getFormFieldByKey(this.formFields, e.key);
5641
5641
  this.formData[e.key] = convertFormFieldValueToStandardFormat(field, e.value);
5642
5642
  this.getUnsavedDataState.emit(true);
@@ -5652,11 +5652,11 @@
5652
5652
  ALL_FORMS_DATA: this.allFormsData
5653
5653
  }, this.takeAction.bind(this));
5654
5654
  (function () { return __awaiter(_this, void 0, void 0, function () {
5655
- return __generator(this, function (_k) {
5656
- switch (_k.label) {
5655
+ return __generator(this, function (_o) {
5656
+ switch (_o.label) {
5657
5657
  case 0: return [4 /*yield*/, validations_6.validate(field.validation)];
5658
5658
  case 1:
5659
- _k.sent();
5659
+ _o.sent();
5660
5660
  return [2 /*return*/];
5661
5661
  }
5662
5662
  });
@@ -5675,27 +5675,27 @@
5675
5675
  return __awaiter(this, void 0, void 0, function () {
5676
5676
  var resetFormFields, BYPASS_RESET_CONFIRM, CONFIRM_RESET;
5677
5677
  var _this = this;
5678
- return __generator(this, function (_k) {
5678
+ return __generator(this, function (_o) {
5679
5679
  resetFormFields = function () { return __awaiter(_this, void 0, void 0, function () {
5680
- var _k, _l, f, _m, _o, action, resetField, actions, e_11_1, e_12_1;
5681
- var e_12, _p, e_11, _q;
5682
- return __generator(this, function (_r) {
5683
- switch (_r.label) {
5680
+ var _o, _p, f, _q, _r, action, resetField, actions, e_11_1, e_12_1;
5681
+ var e_12, _s, e_11, _t;
5682
+ return __generator(this, function (_u) {
5683
+ switch (_u.label) {
5684
5684
  case 0:
5685
- _r.trys.push([0, 11, 12, 13]);
5686
- _k = __values(field.reset.fields), _l = _k.next();
5687
- _r.label = 1;
5685
+ _u.trys.push([0, 11, 12, 13]);
5686
+ _o = __values(field.reset.fields), _p = _o.next();
5687
+ _u.label = 1;
5688
5688
  case 1:
5689
- if (!!_l.done) return [3 /*break*/, 10];
5690
- f = _l.value;
5691
- _r.label = 2;
5689
+ if (!!_p.done) return [3 /*break*/, 10];
5690
+ f = _p.value;
5691
+ _u.label = 2;
5692
5692
  case 2:
5693
- _r.trys.push([2, 7, 8, 9]);
5694
- _m = (e_11 = void 0, __values(f.actions)), _o = _m.next();
5695
- _r.label = 3;
5693
+ _u.trys.push([2, 7, 8, 9]);
5694
+ _q = (e_11 = void 0, __values(f.actions)), _r = _q.next();
5695
+ _u.label = 3;
5696
5696
  case 3:
5697
- if (!!_o.done) return [3 /*break*/, 6];
5698
- action = _o.value;
5697
+ if (!!_r.done) return [3 /*break*/, 6];
5698
+ action = _r.value;
5699
5699
  resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
5700
5700
  actions = new kwikidToolkit.Action(action, {}, {
5701
5701
  FIELD_CONFIG: resetField,
@@ -5707,33 +5707,33 @@
5707
5707
  }, this.takeAction.bind(this));
5708
5708
  return [4 /*yield*/, actions.execute()];
5709
5709
  case 4:
5710
- _r.sent();
5711
- _r.label = 5;
5710
+ _u.sent();
5711
+ _u.label = 5;
5712
5712
  case 5:
5713
- _o = _m.next();
5713
+ _r = _q.next();
5714
5714
  return [3 /*break*/, 3];
5715
5715
  case 6: return [3 /*break*/, 9];
5716
5716
  case 7:
5717
- e_11_1 = _r.sent();
5717
+ e_11_1 = _u.sent();
5718
5718
  e_11 = { error: e_11_1 };
5719
5719
  return [3 /*break*/, 9];
5720
5720
  case 8:
5721
5721
  try {
5722
- if (_o && !_o.done && (_q = _m.return)) _q.call(_m);
5722
+ if (_r && !_r.done && (_t = _q.return)) _t.call(_q);
5723
5723
  }
5724
5724
  finally { if (e_11) throw e_11.error; }
5725
5725
  return [7 /*endfinally*/];
5726
5726
  case 9:
5727
- _l = _k.next();
5727
+ _p = _o.next();
5728
5728
  return [3 /*break*/, 1];
5729
5729
  case 10: return [3 /*break*/, 13];
5730
5730
  case 11:
5731
- e_12_1 = _r.sent();
5731
+ e_12_1 = _u.sent();
5732
5732
  e_12 = { error: e_12_1 };
5733
5733
  return [3 /*break*/, 13];
5734
5734
  case 12:
5735
5735
  try {
5736
- if (_l && !_l.done && (_p = _k.return)) _p.call(_k);
5736
+ if (_p && !_p.done && (_s = _o.return)) _s.call(_o);
5737
5737
  }
5738
5738
  finally { if (e_12) throw e_12.error; }
5739
5739
  return [7 /*endfinally*/];
@@ -5758,9 +5758,9 @@
5758
5758
  KwikIDFormViewComponent.prototype.handleFieldApiCall = function (field, api) {
5759
5759
  return __awaiter(this, void 0, void 0, function () {
5760
5760
  var apis;
5761
- var _k, _l;
5762
- return __generator(this, function (_m) {
5763
- switch (_m.label) {
5761
+ var _o, _p;
5762
+ return __generator(this, function (_q) {
5763
+ switch (_q.label) {
5764
5764
  case 0: return [4 /*yield*/, this.executeApiCall(api, {
5765
5765
  FIELD_CONFIG: field,
5766
5766
  API_CONFIG: api,
@@ -5771,13 +5771,13 @@
5771
5771
  ALL_FORMS_DATA: this.allFormsData
5772
5772
  })];
5773
5773
  case 1:
5774
- api = _m.sent();
5774
+ api = _q.sent();
5775
5775
  if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 3];
5776
5776
  if (kwikidToolkit.checkObjectKeyExists(field.api, "request")) {
5777
- this.formData = Object.assign(Object.assign({}, this.formData), (_k = {}, _k[field.key] = api.response.value, _k));
5778
- this.formGroup.patchValue((_l = {},
5779
- _l[field.key] = api.response.value,
5780
- _l), { emitEvent: false });
5777
+ this.formData = Object.assign(Object.assign({}, this.formData), (_o = {}, _o[field.key] = api.response.value, _o));
5778
+ this.formGroup.patchValue((_p = {},
5779
+ _p[field.key] = api.response.value,
5780
+ _p), { emitEvent: false });
5781
5781
  }
5782
5782
  apis = new Apis({
5783
5783
  FIELD_CONFIG: field,
@@ -5791,14 +5791,14 @@
5791
5791
  }, this.takeAction.bind(this));
5792
5792
  return [4 /*yield*/, apis.validateResponse()];
5793
5793
  case 2:
5794
- api = _m.sent();
5794
+ api = _q.sent();
5795
5795
  return [3 /*break*/, 4];
5796
5796
  case 3:
5797
5797
  setTimeout(function () {
5798
5798
  field["api"]["status"]["value"] = EApiStatusType.FAILED;
5799
5799
  field["showLoader"] = false;
5800
5800
  }, 500);
5801
- _m.label = 4;
5801
+ _q.label = 4;
5802
5802
  case 4: return [2 /*return*/, { field: field, api: api }];
5803
5803
  }
5804
5804
  });
@@ -5807,8 +5807,8 @@
5807
5807
  KwikIDFormViewComponent.prototype.handleApiCall = function (api) {
5808
5808
  return __awaiter(this, void 0, void 0, function () {
5809
5809
  var apis;
5810
- return __generator(this, function (_k) {
5811
- switch (_k.label) {
5810
+ return __generator(this, function (_o) {
5811
+ switch (_o.label) {
5812
5812
  case 0: return [4 /*yield*/, this.executeApiCall(api, {
5813
5813
  FORM_CONFIG: this.formConfig,
5814
5814
  API_CONFIG: api,
@@ -5819,7 +5819,7 @@
5819
5819
  ALL_FORMS_DATA: this.allFormsData
5820
5820
  })];
5821
5821
  case 1:
5822
- api = _k.sent();
5822
+ api = _o.sent();
5823
5823
  apis = new Apis({
5824
5824
  FORM_CONFIG: this.formConfig,
5825
5825
  API_CONFIG: api,
@@ -5832,38 +5832,38 @@
5832
5832
  if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 3];
5833
5833
  return [4 /*yield*/, apis.validateResponse()];
5834
5834
  case 2:
5835
- api = _k.sent();
5836
- _k.label = 3;
5835
+ api = _o.sent();
5836
+ _o.label = 3;
5837
5837
  case 3: return [2 /*return*/, { api: api }];
5838
5838
  }
5839
5839
  });
5840
5840
  });
5841
5841
  };
5842
5842
  KwikIDFormViewComponent.prototype.executeApiCall = function (api, object) {
5843
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5843
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
5844
5844
  return __awaiter(this, void 0, void 0, function () {
5845
- var apis, apiCallResponse, apiCallResponseStatusCode, url, method, headers, body, response, err_1, response, err_2;
5846
- return __generator(this, function (_k) {
5847
- switch (_k.label) {
5845
+ var apis, apiCallResponse, apiCallResponseStatusCode, url, method, headers, response, err_1, body, isSecure, response, isSecure_1, encryptedResponse, decryptedResponse, err_2;
5846
+ return __generator(this, function (_o) {
5847
+ switch (_o.label) {
5848
5848
  case 0:
5849
5849
  apis = new Apis(object, this.takeAction.bind(this));
5850
5850
  return [4 /*yield*/, apis.setUrl()];
5851
5851
  case 1:
5852
- api = _k.sent();
5852
+ api = _o.sent();
5853
5853
  return [4 /*yield*/, apis.setRequestHeaders()];
5854
5854
  case 2:
5855
- api = _k.sent();
5855
+ api = _o.sent();
5856
5856
  return [4 /*yield*/, apis.validateRequestHeaders()];
5857
5857
  case 3:
5858
- api = _k.sent();
5858
+ api = _o.sent();
5859
5859
  return [4 /*yield*/, apis.setRequestBody()];
5860
5860
  case 4:
5861
- api = _k.sent();
5861
+ api = _o.sent();
5862
5862
  return [4 /*yield*/, apis.validateRequestBody()];
5863
5863
  case 5:
5864
- api = _k.sent();
5864
+ api = _o.sent();
5865
5865
  apiCallResponse = {};
5866
- if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 18];
5866
+ if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 22];
5867
5867
  if (!(api.request.url.hasOwnProperty("type") &&
5868
5868
  api.request.url.type === EApiRequestUrlType.MOCK)) return [3 /*break*/, 7];
5869
5869
  return [4 /*yield*/, new Promise(function (resolve) {
@@ -5872,53 +5872,69 @@
5872
5872
  }, 1000); // 1000 ms = 1 sec
5873
5873
  })];
5874
5874
  case 6:
5875
- apiCallResponse = _k.sent();
5875
+ apiCallResponse = _o.sent();
5876
5876
  apiCallResponseStatusCode = (_b = (_a = api.request.url.props) === null || _a === void 0 ? void 0 : _a.statusCode) !== null && _b !== void 0 ? _b : 200; // Default Status Code for Mocked APIs
5877
- return [3 /*break*/, 17];
5877
+ return [3 /*break*/, 21];
5878
5878
  case 7:
5879
5879
  url = api.request.url.value;
5880
5880
  method = (_d = (_c = api.request) === null || _c === void 0 ? void 0 : _c.method) !== null && _d !== void 0 ? _d : "POST";
5881
5881
  headers = Object.assign({ "Content-Type": "application/json" }, (((_f = (_e = api.request) === null || _e === void 0 ? void 0 : _e.headers) === null || _f === void 0 ? void 0 : _f.value) || {}));
5882
- body = (_j = (_h = (_g = api.request) === null || _g === void 0 ? void 0 : _g.body) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : null;
5883
5882
  if (!(method === "GET")) return [3 /*break*/, 13];
5884
- _k.label = 8;
5883
+ _o.label = 8;
5885
5884
  case 8:
5886
- _k.trys.push([8, 11, , 12]);
5885
+ _o.trys.push([8, 11, , 12]);
5887
5886
  return [4 /*yield*/, fetch(url, {
5888
5887
  method: method,
5889
5888
  headers: Object.assign({}, headers)
5890
5889
  })];
5891
5890
  case 9:
5892
- response = _k.sent();
5891
+ response = _o.sent();
5893
5892
  return [4 /*yield*/, response.json()];
5894
5893
  case 10:
5895
- apiCallResponse = _k.sent();
5894
+ apiCallResponse = _o.sent();
5896
5895
  apiCallResponseStatusCode = response.status;
5897
5896
  return [3 /*break*/, 12];
5898
5897
  case 11:
5899
- err_1 = _k.sent();
5898
+ err_1 = _o.sent();
5900
5899
  apiCallResponse = {};
5901
5900
  return [3 /*break*/, 12];
5902
- case 12: return [3 /*break*/, 17];
5901
+ case 12: return [3 /*break*/, 21];
5903
5902
  case 13:
5904
- _k.trys.push([13, 16, , 17]);
5903
+ body = JSON.stringify((_j = (_h = (_g = api === null || api === void 0 ? void 0 : api.request) === null || _g === void 0 ? void 0 : _g.body) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : {});
5904
+ isSecure = (_l = (_k = api === null || api === void 0 ? void 0 : api.request) === null || _k === void 0 ? void 0 : _k.body) === null || _l === void 0 ? void 0 : _l.isSecure;
5905
+ if (isSecure) {
5906
+ body = kwikidToolkit.encryptWithAES(body);
5907
+ }
5908
+ _o.label = 14;
5909
+ case 14:
5910
+ _o.trys.push([14, 20, , 21]);
5905
5911
  return [4 /*yield*/, fetch(url, {
5906
5912
  method: method,
5907
5913
  headers: Object.assign({}, headers),
5908
- body: JSON.stringify(body)
5914
+ body: body
5909
5915
  })];
5910
- case 14:
5911
- response = _k.sent();
5912
- return [4 /*yield*/, response.json()];
5913
5916
  case 15:
5914
- apiCallResponse = _k.sent();
5915
- apiCallResponseStatusCode = response.status;
5916
- return [3 /*break*/, 17];
5917
+ response = _o.sent();
5918
+ isSecure_1 = (_m = api === null || api === void 0 ? void 0 : api.response) === null || _m === void 0 ? void 0 : _m.isSecure;
5919
+ if (!isSecure_1) return [3 /*break*/, 17];
5920
+ return [4 /*yield*/, response.text()];
5917
5921
  case 16:
5918
- err_2 = _k.sent();
5922
+ encryptedResponse = _o.sent();
5923
+ decryptedResponse = kwikidToolkit.decryptWithAES(encryptedResponse);
5924
+ apiCallResponse = JSON.parse(decryptedResponse);
5925
+ return [3 /*break*/, 19];
5926
+ case 17: return [4 /*yield*/, response.json()];
5927
+ case 18:
5928
+ apiCallResponse = _o.sent();
5929
+ _o.label = 19;
5930
+ case 19:
5931
+ apiCallResponseStatusCode = response.status;
5932
+ return [3 /*break*/, 21];
5933
+ case 20:
5934
+ err_2 = _o.sent();
5919
5935
  apiCallResponse = {};
5920
- return [3 /*break*/, 17];
5921
- case 17:
5936
+ return [3 /*break*/, 21];
5937
+ case 21:
5922
5938
  api.response = kwikidToolkit.setValueToObjectPath(api.response, "value", apiCallResponse);
5923
5939
  api.response = kwikidToolkit.setValueToObjectPath(api.response, "status", apiCallResponseStatusCode);
5924
5940
  this.getLogs.emit({
@@ -5929,8 +5945,8 @@
5929
5945
  response: api.response
5930
5946
  }
5931
5947
  });
5932
- _k.label = 18;
5933
- case 18: return [2 /*return*/, api];
5948
+ _o.label = 22;
5949
+ case 22: return [2 /*return*/, api];
5934
5950
  }
5935
5951
  });
5936
5952
  });
@@ -5967,8 +5983,8 @@
5967
5983
  KwikIDFormViewComponent.prototype.handleOnClickApiCall = function (e) {
5968
5984
  return __awaiter(this, void 0, void 0, function () {
5969
5985
  var field, apis;
5970
- return __generator(this, function (_k) {
5971
- switch (_k.label) {
5986
+ return __generator(this, function (_o) {
5987
+ switch (_o.label) {
5972
5988
  case 0:
5973
5989
  field = getFormFieldByKey(this.formFields, e.key);
5974
5990
  if (!(field.type === EFieldType.API)) return [3 /*break*/, 5];
@@ -5979,7 +5995,7 @@
5979
5995
  if (!kwikidToolkit.checkObjectKeyExists(field.api, "request")) return [3 /*break*/, 2];
5980
5996
  return [4 /*yield*/, this.handleFieldApiCall(field, field.api)];
5981
5997
  case 1:
5982
- _k.sent();
5998
+ _o.sent();
5983
5999
  return [3 /*break*/, 4];
5984
6000
  case 2:
5985
6001
  apis = new Apis({
@@ -5993,11 +6009,11 @@
5993
6009
  }, this.takeAction.bind(this));
5994
6010
  return [4 /*yield*/, apis.callNextApi(field.api.entrypoint)];
5995
6011
  case 3:
5996
- _k.sent();
5997
- _k.label = 4;
6012
+ _o.sent();
6013
+ _o.label = 4;
5998
6014
  case 4:
5999
6015
  this.hideApiLoader();
6000
- _k.label = 5;
6016
+ _o.label = 5;
6001
6017
  case 5: return [2 /*return*/];
6002
6018
  }
6003
6019
  });
@@ -6042,11 +6058,11 @@
6042
6058
  };
6043
6059
  KwikIDFormViewComponent.prototype.handleOnClickSaveForm = function (e) {
6044
6060
  return __awaiter(this, void 0, void 0, function () {
6045
- var controls, firstFieldWithError, controls_1, controls_1_1, control, _k, _l, field, validations, e_13_1, formData, _m, _o, field, extendedFormData, _p, _q, postTask, task, e_14_1;
6046
- var e_15, _r, e_13, _s, e_16, _t, e_14, _u;
6061
+ var controls, firstFieldWithError, controls_1, controls_1_1, control, _o, _p, field, validations, e_13_1, formData, _q, _r, field, extendedFormData, _s, _t, postTask, task, e_14_1;
6062
+ var e_15, _u, e_13, _v, e_16, _w, e_14, _x;
6047
6063
  var _this = this;
6048
- return __generator(this, function (_v) {
6049
- switch (_v.label) {
6064
+ return __generator(this, function (_y) {
6065
+ switch (_y.label) {
6050
6066
  case 0:
6051
6067
  controls = new FormValidation().getFormFieldsInvalidControls(this.formGroup);
6052
6068
  firstFieldWithError = "";
@@ -6062,7 +6078,7 @@
6062
6078
  catch (e_15_1) { e_15 = { error: e_15_1 }; }
6063
6079
  finally {
6064
6080
  try {
6065
- if (controls_1_1 && !controls_1_1.done && (_r = controls_1.return)) _r.call(controls_1);
6081
+ if (controls_1_1 && !controls_1_1.done && (_u = controls_1.return)) _u.call(controls_1);
6066
6082
  }
6067
6083
  finally { if (e_15) throw e_15.error; }
6068
6084
  }
@@ -6073,14 +6089,14 @@
6073
6089
  }, 3000);
6074
6090
  return [2 /*return*/];
6075
6091
  }
6076
- _v.label = 1;
6092
+ _y.label = 1;
6077
6093
  case 1:
6078
- _v.trys.push([1, 6, 7, 8]);
6079
- _k = __values(this.formFields), _l = _k.next();
6080
- _v.label = 2;
6094
+ _y.trys.push([1, 6, 7, 8]);
6095
+ _o = __values(this.formFields), _p = _o.next();
6096
+ _y.label = 2;
6081
6097
  case 2:
6082
- if (!!_l.done) return [3 /*break*/, 5];
6083
- field = _l.value;
6098
+ if (!!_p.done) return [3 /*break*/, 5];
6099
+ field = _p.value;
6084
6100
  if (!(field.isFormElement &&
6085
6101
  !field.hidden &&
6086
6102
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
@@ -6095,7 +6111,7 @@
6095
6111
  }, this.takeAction.bind(this));
6096
6112
  return [4 /*yield*/, validations.validate(field.validation)];
6097
6113
  case 3:
6098
- _v.sent();
6114
+ _y.sent();
6099
6115
  if (!field.validation.is_valid) {
6100
6116
  this.toggleErrorNotification(true);
6101
6117
  setTimeout(function () {
@@ -6103,26 +6119,26 @@
6103
6119
  }, 3000);
6104
6120
  return [2 /*return*/];
6105
6121
  }
6106
- _v.label = 4;
6122
+ _y.label = 4;
6107
6123
  case 4:
6108
- _l = _k.next();
6124
+ _p = _o.next();
6109
6125
  return [3 /*break*/, 2];
6110
6126
  case 5: return [3 /*break*/, 8];
6111
6127
  case 6:
6112
- e_13_1 = _v.sent();
6128
+ e_13_1 = _y.sent();
6113
6129
  e_13 = { error: e_13_1 };
6114
6130
  return [3 /*break*/, 8];
6115
6131
  case 7:
6116
6132
  try {
6117
- if (_l && !_l.done && (_s = _k.return)) _s.call(_k);
6133
+ if (_p && !_p.done && (_v = _o.return)) _v.call(_o);
6118
6134
  }
6119
6135
  finally { if (e_13) throw e_13.error; }
6120
6136
  return [7 /*endfinally*/];
6121
6137
  case 8:
6122
6138
  formData = this.formGroup.getRawValue();
6123
6139
  try {
6124
- for (_m = __values(this.formFields), _o = _m.next(); !_o.done; _o = _m.next()) {
6125
- field = _o.value;
6140
+ for (_q = __values(this.formFields), _r = _q.next(); !_r.done; _r = _q.next()) {
6141
+ field = _r.value;
6126
6142
  if (field.isFormElement) {
6127
6143
  if (field.hidden) {
6128
6144
  delete formData[field.key];
@@ -6136,22 +6152,22 @@
6136
6152
  catch (e_16_1) { e_16 = { error: e_16_1 }; }
6137
6153
  finally {
6138
6154
  try {
6139
- if (_o && !_o.done && (_t = _m.return)) _t.call(_m);
6155
+ if (_r && !_r.done && (_w = _q.return)) _w.call(_q);
6140
6156
  }
6141
6157
  finally { if (e_16) throw e_16.error; }
6142
6158
  }
6143
6159
  extendedFormData = this.formFields.reduce(function (result, field, index) {
6144
- var _k;
6160
+ var _o;
6145
6161
  if (field.isFormElement && !field.hidden) {
6146
- var fieldData = (_k = {},
6147
- _k[field.key] = {
6162
+ var fieldData = (_o = {},
6163
+ _o[field.key] = {
6148
6164
  key: field.key,
6149
6165
  label: field.label,
6150
6166
  value: kwikidToolkit.isEmptyValue(formData[field.key]) ? "" : formData[field.key],
6151
6167
  type: field.type,
6152
6168
  index: index
6153
6169
  },
6154
- _k);
6170
+ _o);
6155
6171
  result[field.key] = fieldData[field.key];
6156
6172
  }
6157
6173
  return result;
@@ -6163,14 +6179,14 @@
6163
6179
  });
6164
6180
  if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
6165
6181
  kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "post"))) return [3 /*break*/, 18];
6166
- _v.label = 9;
6182
+ _y.label = 9;
6167
6183
  case 9:
6168
- _v.trys.push([9, 15, 16, 17]);
6169
- _p = __values(this.formConfig.tasks.post), _q = _p.next();
6170
- _v.label = 10;
6184
+ _y.trys.push([9, 15, 16, 17]);
6185
+ _s = __values(this.formConfig.tasks.post), _t = _s.next();
6186
+ _y.label = 10;
6171
6187
  case 10:
6172
- if (!!_q.done) return [3 /*break*/, 14];
6173
- postTask = _q.value;
6188
+ if (!!_t.done) return [3 /*break*/, 14];
6189
+ postTask = _t.value;
6174
6190
  task = new Tasks(postTask, {
6175
6191
  FORM_CONFIG: this.formConfig,
6176
6192
  FORM_FIELDS: this.formFields,
@@ -6188,7 +6204,7 @@
6188
6204
  }
6189
6205
  return [4 /*yield*/, task.execute()];
6190
6206
  case 11:
6191
- _v.sent();
6207
+ _y.sent();
6192
6208
  // Wait for ngOnChanges to be called before continuing to the next task
6193
6209
  return [4 /*yield*/, new Promise(function (resolve) {
6194
6210
  var intervalId = setInterval(function () {
@@ -6200,22 +6216,22 @@
6200
6216
  })];
6201
6217
  case 12:
6202
6218
  // Wait for ngOnChanges to be called before continuing to the next task
6203
- _v.sent();
6219
+ _y.sent();
6204
6220
  if (this.stopTaskExecution) {
6205
6221
  return [3 /*break*/, 14];
6206
6222
  }
6207
- _v.label = 13;
6223
+ _y.label = 13;
6208
6224
  case 13:
6209
- _q = _p.next();
6225
+ _t = _s.next();
6210
6226
  return [3 /*break*/, 10];
6211
6227
  case 14: return [3 /*break*/, 17];
6212
6228
  case 15:
6213
- e_14_1 = _v.sent();
6229
+ e_14_1 = _y.sent();
6214
6230
  e_14 = { error: e_14_1 };
6215
6231
  return [3 /*break*/, 17];
6216
6232
  case 16:
6217
6233
  try {
6218
- if (_q && !_q.done && (_u = _p.return)) _u.call(_p);
6234
+ if (_t && !_t.done && (_x = _s.return)) _x.call(_s);
6219
6235
  }
6220
6236
  finally { if (e_14) throw e_14.error; }
6221
6237
  return [7 /*endfinally*/];
@@ -6237,7 +6253,7 @@
6237
6253
  data: kwikidToolkit.mergeObjects(formData, this.popupFormData, this.taskData),
6238
6254
  extendedData: extendedFormData
6239
6255
  });
6240
- _v.label = 19;
6256
+ _y.label = 19;
6241
6257
  case 19: return [2 /*return*/];
6242
6258
  }
6243
6259
  });
@@ -6256,17 +6272,17 @@
6256
6272
  this.formGroup.updateValueAndValidity();
6257
6273
  };
6258
6274
  KwikIDFormViewComponent.prototype.fieldGroupHide = function (fieldGroup) {
6259
- var e_17, _k;
6275
+ var e_17, _o;
6260
6276
  try {
6261
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6262
- var fieldKey = _m.value;
6277
+ for (var _p = __values(this.fieldGroups[fieldGroup]), _q = _p.next(); !_q.done; _q = _p.next()) {
6278
+ var fieldKey = _q.value;
6263
6279
  this.fieldHide(fieldKey);
6264
6280
  }
6265
6281
  }
6266
6282
  catch (e_17_1) { e_17 = { error: e_17_1 }; }
6267
6283
  finally {
6268
6284
  try {
6269
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6285
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6270
6286
  }
6271
6287
  finally { if (e_17) throw e_17.error; }
6272
6288
  }
@@ -6280,17 +6296,17 @@
6280
6296
  this.formGroup.updateValueAndValidity();
6281
6297
  };
6282
6298
  KwikIDFormViewComponent.prototype.fieldGroupShow = function (fieldGroup) {
6283
- var e_18, _k;
6299
+ var e_18, _o;
6284
6300
  try {
6285
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6286
- var fieldKey = _m.value;
6301
+ for (var _p = __values(this.fieldGroups[fieldGroup]), _q = _p.next(); !_q.done; _q = _p.next()) {
6302
+ var fieldKey = _q.value;
6287
6303
  this.fieldShow(fieldKey);
6288
6304
  }
6289
6305
  }
6290
6306
  catch (e_18_1) { e_18 = { error: e_18_1 }; }
6291
6307
  finally {
6292
6308
  try {
6293
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6309
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6294
6310
  }
6295
6311
  finally { if (e_18) throw e_18.error; }
6296
6312
  }
@@ -6314,17 +6330,17 @@
6314
6330
  }
6315
6331
  };
6316
6332
  KwikIDFormViewComponent.prototype.fieldGroupDisable = function (fieldGroup) {
6317
- var e_19, _k;
6333
+ var e_19, _o;
6318
6334
  try {
6319
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6320
- var fieldKey = _m.value;
6335
+ for (var _p = __values(this.fieldGroups[fieldGroup]), _q = _p.next(); !_q.done; _q = _p.next()) {
6336
+ var fieldKey = _q.value;
6321
6337
  this.fieldDisable(fieldKey);
6322
6338
  }
6323
6339
  }
6324
6340
  catch (e_19_1) { e_19 = { error: e_19_1 }; }
6325
6341
  finally {
6326
6342
  try {
6327
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6343
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6328
6344
  }
6329
6345
  finally { if (e_19) throw e_19.error; }
6330
6346
  }
@@ -6348,23 +6364,23 @@
6348
6364
  }
6349
6365
  };
6350
6366
  KwikIDFormViewComponent.prototype.fieldGroupEnable = function (fieldGroup) {
6351
- var e_20, _k;
6367
+ var e_20, _o;
6352
6368
  try {
6353
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6354
- var fieldKey = _m.value;
6369
+ for (var _p = __values(this.fieldGroups[fieldGroup]), _q = _p.next(); !_q.done; _q = _p.next()) {
6370
+ var fieldKey = _q.value;
6355
6371
  this.fieldEnable(fieldKey);
6356
6372
  }
6357
6373
  }
6358
6374
  catch (e_20_1) { e_20 = { error: e_20_1 }; }
6359
6375
  finally {
6360
6376
  try {
6361
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6377
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6362
6378
  }
6363
6379
  finally { if (e_20) throw e_20.error; }
6364
6380
  }
6365
6381
  };
6366
6382
  KwikIDFormViewComponent.prototype.fieldReset = function (fieldKey) {
6367
- var _k;
6383
+ var _o;
6368
6384
  // Find the field and its index in the formFields array
6369
6385
  var field = getFormFieldByKey(this.formFields, fieldKey);
6370
6386
  var fieldIndex = getFormFieldIndexByKey(this.formFields, fieldKey);
@@ -6375,9 +6391,9 @@
6375
6391
  emitEvent: false,
6376
6392
  onlySelf: true
6377
6393
  });
6378
- this.formGroup.patchValue((_k = {},
6379
- _k[field.key] = resetValue,
6380
- _k), { emitEvent: false });
6394
+ this.formGroup.patchValue((_o = {},
6395
+ _o[field.key] = resetValue,
6396
+ _o), { emitEvent: false });
6381
6397
  this.formGroup.controls[field.key].updateValueAndValidity({
6382
6398
  emitEvent: true
6383
6399
  });
@@ -6445,13 +6461,13 @@
6445
6461
  KwikIDFormViewComponent.prototype.setValue = function (action, object) {
6446
6462
  return __awaiter(this, void 0, void 0, function () {
6447
6463
  var source, sourceValue;
6448
- return __generator(this, function (_k) {
6449
- switch (_k.label) {
6464
+ return __generator(this, function (_o) {
6465
+ switch (_o.label) {
6450
6466
  case 0:
6451
6467
  source = new kwikidToolkit.Source(object);
6452
6468
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
6453
6469
  case 1:
6454
- sourceValue = _k.sent();
6470
+ sourceValue = _o.sent();
6455
6471
  source.setValueToSource(action.props.value.destination, sourceValue);
6456
6472
  object.FIELD_CONFIG = source.object.FIELD_CONFIG;
6457
6473
  this.formData = source.object.FORM_DATA;
@@ -6466,13 +6482,13 @@
6466
6482
  KwikIDFormViewComponent.prototype.setFieldDefaultValue = function (action, object) {
6467
6483
  return __awaiter(this, void 0, void 0, function () {
6468
6484
  var source, sourceValue;
6469
- return __generator(this, function (_k) {
6470
- switch (_k.label) {
6485
+ return __generator(this, function (_o) {
6486
+ switch (_o.label) {
6471
6487
  case 0:
6472
6488
  source = new kwikidToolkit.Source(object);
6473
6489
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
6474
6490
  case 1:
6475
- sourceValue = _k.sent();
6491
+ sourceValue = _o.sent();
6476
6492
  source.setValueToSource({
6477
6493
  key: kwikidToolkit.ESourceKey.OBJECT,
6478
6494
  props: {
@@ -6504,7 +6520,7 @@
6504
6520
  KwikIDFormViewComponent.prototype.setApiStatus = function (action, object) {
6505
6521
  return __awaiter(this, void 0, void 0, function () {
6506
6522
  var source, sourceValue;
6507
- return __generator(this, function (_k) {
6523
+ return __generator(this, function (_o) {
6508
6524
  source = new kwikidToolkit.Source(object);
6509
6525
  sourceValue = action.props.status;
6510
6526
  source.setValueToSource({
@@ -6524,13 +6540,13 @@
6524
6540
  KwikIDFormViewComponent.prototype.setApiHeaderValue = function (action, object) {
6525
6541
  return __awaiter(this, void 0, void 0, function () {
6526
6542
  var source, sourceValue;
6527
- return __generator(this, function (_k) {
6528
- switch (_k.label) {
6543
+ return __generator(this, function (_o) {
6544
+ switch (_o.label) {
6529
6545
  case 0:
6530
6546
  source = new kwikidToolkit.Source(object);
6531
6547
  return [4 /*yield*/, source.getValueFromSource(action.props.source)];
6532
6548
  case 1:
6533
- sourceValue = _k.sent();
6549
+ sourceValue = _o.sent();
6534
6550
  source.setValueToSource({
6535
6551
  key: kwikidToolkit.ESourceKey.OBJECT,
6536
6552
  props: {
@@ -6549,7 +6565,7 @@
6549
6565
  KwikIDFormViewComponent.prototype.setApiHeaderValidity = function (action, object) {
6550
6566
  return __awaiter(this, void 0, void 0, function () {
6551
6567
  var source, sourceValue;
6552
- return __generator(this, function (_k) {
6568
+ return __generator(this, function (_o) {
6553
6569
  source = new kwikidToolkit.Source(object);
6554
6570
  sourceValue = action.props.valid;
6555
6571
  source.setValueToSource({
@@ -6569,13 +6585,13 @@
6569
6585
  KwikIDFormViewComponent.prototype.setApiBodyValue = function (action, object) {
6570
6586
  return __awaiter(this, void 0, void 0, function () {
6571
6587
  var source, sourceValue;
6572
- return __generator(this, function (_k) {
6573
- switch (_k.label) {
6588
+ return __generator(this, function (_o) {
6589
+ switch (_o.label) {
6574
6590
  case 0:
6575
6591
  source = new kwikidToolkit.Source(object);
6576
6592
  return [4 /*yield*/, source.getValueFromSource(action.props.source)];
6577
6593
  case 1:
6578
- sourceValue = _k.sent();
6594
+ sourceValue = _o.sent();
6579
6595
  source.setValueToSource({
6580
6596
  key: kwikidToolkit.ESourceKey.OBJECT,
6581
6597
  props: {
@@ -6594,7 +6610,7 @@
6594
6610
  KwikIDFormViewComponent.prototype.setApiBodyValidity = function (action, object) {
6595
6611
  return __awaiter(this, void 0, void 0, function () {
6596
6612
  var source, sourceValue;
6597
- return __generator(this, function (_k) {
6613
+ return __generator(this, function (_o) {
6598
6614
  source = new kwikidToolkit.Source(object);
6599
6615
  sourceValue = action.props.valid;
6600
6616
  source.setValueToSource({
@@ -6614,7 +6630,7 @@
6614
6630
  KwikIDFormViewComponent.prototype.setFieldValidity = function (action, object) {
6615
6631
  return __awaiter(this, void 0, void 0, function () {
6616
6632
  var source, sourceValue;
6617
- return __generator(this, function (_k) {
6633
+ return __generator(this, function (_o) {
6618
6634
  source = new kwikidToolkit.Source(object);
6619
6635
  sourceValue = action.props.valid;
6620
6636
  source.setValueToSource({
@@ -6634,18 +6650,18 @@
6634
6650
  KwikIDFormViewComponent.prototype.setDropdownOptions = function (action, object) {
6635
6651
  return __awaiter(this, void 0, void 0, function () {
6636
6652
  var source, sourceValue, appendToPath, appendToPathStr, optionsPath;
6637
- return __generator(this, function (_k) {
6638
- switch (_k.label) {
6653
+ return __generator(this, function (_o) {
6654
+ switch (_o.label) {
6639
6655
  case 0:
6640
6656
  source = new kwikidToolkit.Source(object);
6641
6657
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
6642
6658
  case 1:
6643
- sourceValue = _k.sent();
6659
+ sourceValue = _o.sent();
6644
6660
  if (!kwikidToolkit.checkObjectKeyExists(action.props, "options")) return [3 /*break*/, 4];
6645
6661
  if (!kwikidToolkit.checkObjectKeyExists(action.props.options, "appendToPath")) return [3 /*break*/, 3];
6646
6662
  return [4 /*yield*/, source.getValueFromSource(action.props.options.appendToPath.source)];
6647
6663
  case 2:
6648
- appendToPath = _k.sent();
6664
+ appendToPath = _o.sent();
6649
6665
  if (kwikidToolkit.isNotEmptyValue(appendToPath)) {
6650
6666
  appendToPathStr = kwikidToolkit.replaceString(appendToPath.match("" + action.props.options.appendToPath.filterSourceValue)[0], "[^a-zA-Z0-9_]", "_");
6651
6667
  optionsPath = "" + action.props.options.path + appendToPathStr;
@@ -6654,7 +6670,7 @@
6654
6670
  return [3 /*break*/, 4];
6655
6671
  case 3:
6656
6672
  sourceValue = kwikidToolkit.getObjectValueFromPath(sourceValue, action.props.options.path);
6657
- _k.label = 4;
6673
+ _o.label = 4;
6658
6674
  case 4:
6659
6675
  source.setValueToSource(action.props.value.destination, sourceValue);
6660
6676
  object.FIELD_CONFIG = source.object.FIELD_CONFIG;
@@ -6669,19 +6685,19 @@
6669
6685
  KwikIDFormViewComponent.prototype.apiCall = function (action, object) {
6670
6686
  return __awaiter(this, void 0, void 0, function () {
6671
6687
  var apiConfig, response;
6672
- var _k;
6673
- return __generator(this, function (_l) {
6674
- switch (_l.label) {
6688
+ var _o;
6689
+ return __generator(this, function (_p) {
6690
+ switch (_p.label) {
6675
6691
  case 0:
6676
6692
  apiConfig = this.formConfig.apis[action.props.formApiKey];
6677
6693
  return [4 /*yield*/, this.handleApiCall(apiConfig)];
6678
6694
  case 1:
6679
- response = _l.sent();
6695
+ response = _p.sent();
6680
6696
  apiConfig = response.api;
6681
6697
  this.formConfig = kwikidToolkit.setValueToObjectPath(this.formConfig, "apis." + action.props.formApiKey, apiConfig);
6682
- this.formData = kwikidToolkit.mergeObjects(this.formData, (_k = {},
6683
- _k[action.props.formApiKey] = apiConfig.response.value,
6684
- _k));
6698
+ this.formData = kwikidToolkit.mergeObjects(this.formData, (_o = {},
6699
+ _o[action.props.formApiKey] = apiConfig.response.value,
6700
+ _o));
6685
6701
  return [2 /*return*/, apiConfig];
6686
6702
  }
6687
6703
  });
@@ -6690,13 +6706,13 @@
6690
6706
  KwikIDFormViewComponent.prototype.fieldApiCall = function (action, object) {
6691
6707
  return __awaiter(this, void 0, void 0, function () {
6692
6708
  var apiConfig;
6693
- return __generator(this, function (_k) {
6694
- switch (_k.label) {
6709
+ return __generator(this, function (_o) {
6710
+ switch (_o.label) {
6695
6711
  case 0:
6696
6712
  this.showApiLoader();
6697
6713
  return [4 /*yield*/, this.apiCall(action, object)];
6698
6714
  case 1:
6699
- apiConfig = _k.sent();
6715
+ apiConfig = _o.sent();
6700
6716
  this.hideApiLoader();
6701
6717
  return [2 /*return*/];
6702
6718
  }
@@ -6706,8 +6722,8 @@
6706
6722
  KwikIDFormViewComponent.prototype.fieldMultipleApiCalls = function (action, object) {
6707
6723
  return __awaiter(this, void 0, void 0, function () {
6708
6724
  var entrypointApiKey, field, endpoints, nextApiIndex, apiConfig, response;
6709
- return __generator(this, function (_k) {
6710
- switch (_k.label) {
6725
+ return __generator(this, function (_o) {
6726
+ switch (_o.label) {
6711
6727
  case 0:
6712
6728
  entrypointApiKey = action.props.apiKey;
6713
6729
  field = getFormFieldByKey(this.formFields, action.props.fieldKey);
@@ -6716,7 +6732,7 @@
6716
6732
  apiConfig = endpoints[nextApiIndex];
6717
6733
  return [4 /*yield*/, this.handleFieldApiCall(field, apiConfig)];
6718
6734
  case 1:
6719
- response = _k.sent();
6735
+ response = _o.sent();
6720
6736
  field = response.field;
6721
6737
  field.api.endpoints[nextApiIndex] = response.api;
6722
6738
  return [2 /*return*/];
@@ -6727,15 +6743,15 @@
6727
6743
  KwikIDFormViewComponent.prototype.fieldMultipleApiCallsEnd = function (action, object) {
6728
6744
  return __awaiter(this, void 0, void 0, function () {
6729
6745
  var field, multipleApiCallResponses;
6730
- var _k;
6731
- return __generator(this, function (_l) {
6746
+ var _o;
6747
+ return __generator(this, function (_p) {
6732
6748
  field = getFormFieldByKey(this.formFields, action.props.fieldKey);
6733
6749
  multipleApiCallResponses = {};
6734
6750
  field.api.endpoints.map(function (api) {
6735
6751
  if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
6736
6752
  multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
6737
6753
  });
6738
- this.formData = Object.assign(Object.assign({}, this.formData), (_k = {}, _k[field.key] = multipleApiCallResponses, _k));
6754
+ this.formData = Object.assign(Object.assign({}, this.formData), (_o = {}, _o[field.key] = multipleApiCallResponses, _o));
6739
6755
  this.patchFormGroup(this.formData);
6740
6756
  return [2 /*return*/];
6741
6757
  });
@@ -6744,17 +6760,17 @@
6744
6760
  KwikIDFormViewComponent.prototype.taskApiCall = function (action, object) {
6745
6761
  return __awaiter(this, void 0, void 0, function () {
6746
6762
  var apiConfig;
6747
- var _k;
6748
- return __generator(this, function (_l) {
6749
- switch (_l.label) {
6763
+ var _o;
6764
+ return __generator(this, function (_p) {
6765
+ switch (_p.label) {
6750
6766
  case 0:
6751
6767
  this.showApiLoader();
6752
6768
  return [4 /*yield*/, this.apiCall(action, object)];
6753
6769
  case 1:
6754
- apiConfig = _l.sent();
6755
- this.taskData = kwikidToolkit.mergeObjects(this.taskData, (_k = {},
6756
- _k[action.props.formApiKey] = apiConfig.response.value,
6757
- _k));
6770
+ apiConfig = _p.sent();
6771
+ this.taskData = kwikidToolkit.mergeObjects(this.taskData, (_o = {},
6772
+ _o[action.props.formApiKey] = apiConfig.response.value,
6773
+ _o));
6758
6774
  this.waitingForChanges = false;
6759
6775
  this.hideApiLoader();
6760
6776
  return [2 /*return*/];
@@ -6765,8 +6781,8 @@
6765
6781
  KwikIDFormViewComponent.prototype.taskMultipleApiCalls = function (action, object) {
6766
6782
  return __awaiter(this, void 0, void 0, function () {
6767
6783
  var multipleApiConfig, entrypointApiKey_1, endpoints, nextApiIndex, apiConfig, response, apis;
6768
- return __generator(this, function (_k) {
6769
- switch (_k.label) {
6784
+ return __generator(this, function (_o) {
6785
+ switch (_o.label) {
6770
6786
  case 0:
6771
6787
  this.showApiLoader();
6772
6788
  multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
@@ -6777,7 +6793,7 @@
6777
6793
  apiConfig = endpoints[nextApiIndex];
6778
6794
  return [4 /*yield*/, this.handleApiCall(apiConfig)];
6779
6795
  case 1:
6780
- response = _k.sent();
6796
+ response = _o.sent();
6781
6797
  multipleApiConfig.endpoints[nextApiIndex] = response.api;
6782
6798
  this.formConfig = kwikidToolkit.setValueToObjectPath(this.formConfig, "apis." + action.props.formApiKey, multipleApiConfig);
6783
6799
  this.hideApiLoader();
@@ -6794,8 +6810,8 @@
6794
6810
  }, this.takeAction.bind(this));
6795
6811
  return [4 /*yield*/, apis.callNextApi(multipleApiConfig.entrypoint)];
6796
6812
  case 3:
6797
- _k.sent();
6798
- _k.label = 4;
6813
+ _o.sent();
6814
+ _o.label = 4;
6799
6815
  case 4: return [2 /*return*/];
6800
6816
  }
6801
6817
  });
@@ -6804,15 +6820,15 @@
6804
6820
  KwikIDFormViewComponent.prototype.taskMultipleApiCallsEnd = function (action, object) {
6805
6821
  return __awaiter(this, void 0, void 0, function () {
6806
6822
  var multipleApiConfig, multipleApiCallResponses;
6807
- var _k;
6808
- return __generator(this, function (_l) {
6823
+ var _o;
6824
+ return __generator(this, function (_p) {
6809
6825
  multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
6810
6826
  multipleApiCallResponses = {};
6811
6827
  multipleApiConfig.endpoints.map(function (api) {
6812
6828
  if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
6813
6829
  multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
6814
6830
  });
6815
- this.taskData = Object.assign(Object.assign({}, this.taskData), (_k = {}, _k[action.props.formApiKey] = multipleApiCallResponses, _k));
6831
+ this.taskData = Object.assign(Object.assign({}, this.taskData), (_o = {}, _o[action.props.formApiKey] = multipleApiCallResponses, _o));
6816
6832
  this.waitingForChanges = false;
6817
6833
  this.hideApiLoader();
6818
6834
  return [2 /*return*/];
@@ -6994,7 +7010,7 @@
6994
7010
  };
6995
7011
  KwikIDFormViewComponent.prototype.takeActionOnFieldGroup = function (action, object) {
6996
7012
  return __awaiter(this, void 0, void 0, function () {
6997
- return __generator(this, function (_k) {
7013
+ return __generator(this, function (_o) {
6998
7014
  switch (action.key) {
6999
7015
  case EActionKey.FIELD_GROUP_HIDE:
7000
7016
  this.fieldGroupHide(action.props.groupKey);
@@ -7018,12 +7034,12 @@
7018
7034
  KwikIDFormViewComponent.prototype.takeAction = function (action, object) {
7019
7035
  var _a, _b, _c, _d, _e, _f;
7020
7036
  return __awaiter(this, void 0, void 0, function () {
7021
- var _k, fieldErrorShow_Source, fieldErrorShowSourceValue, fieldErrorHide_Source, fieldErrorHideSourceValue, redirectToUrl_Source, redirectToUrlSourceValue, previewErrorShow_Source, previewErrorShowSourceValue;
7022
- return __generator(this, function (_l) {
7023
- switch (_l.label) {
7037
+ var _o, fieldErrorShow_Source, fieldErrorShowSourceValue, fieldErrorHide_Source, fieldErrorHideSourceValue, redirectToUrl_Source, redirectToUrlSourceValue, previewErrorShow_Source, previewErrorShowSourceValue;
7038
+ return __generator(this, function (_p) {
7039
+ switch (_p.label) {
7024
7040
  case 0:
7025
- _k = action.key;
7026
- switch (_k) {
7041
+ _o = action.key;
7042
+ switch (_o) {
7027
7043
  case EActionKey.FIELD_HIDE: return [3 /*break*/, 1];
7028
7044
  case EActionKey.FIELD_SHOW: return [3 /*break*/, 2];
7029
7045
  case EActionKey.FIELD_DISABLE: return [3 /*break*/, 3];
@@ -7084,7 +7100,7 @@
7084
7100
  fieldErrorShow_Source = new kwikidToolkit.Source(object);
7085
7101
  return [4 /*yield*/, fieldErrorShow_Source.getValueFromSource(action.props.message.source)];
7086
7102
  case 7:
7087
- fieldErrorShowSourceValue = _l.sent();
7103
+ fieldErrorShowSourceValue = _p.sent();
7088
7104
  if (typeof fieldErrorShowSourceValue == "string" ||
7089
7105
  typeof fieldErrorShowSourceValue == "number") {
7090
7106
  fieldErrorShowSourceValue = String(fieldErrorShowSourceValue);
@@ -7093,7 +7109,7 @@
7093
7109
  fieldErrorShowSourceValue = "";
7094
7110
  }
7095
7111
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldErrorShowSourceValue);
7096
- _l.label = 8;
7112
+ _p.label = 8;
7097
7113
  case 8:
7098
7114
  action.props.message.message = updateLanguage(action.props.message.message, getLanguage());
7099
7115
  this.fieldErrorShow(action.props.fieldKey, action.props.message);
@@ -7103,7 +7119,7 @@
7103
7119
  fieldErrorHide_Source = new kwikidToolkit.Source(object);
7104
7120
  return [4 /*yield*/, fieldErrorHide_Source.getValueFromSource(action.props.message.source)];
7105
7121
  case 10:
7106
- fieldErrorHideSourceValue = _l.sent();
7122
+ fieldErrorHideSourceValue = _p.sent();
7107
7123
  if (typeof fieldErrorHideSourceValue == "string" ||
7108
7124
  typeof fieldErrorHideSourceValue == "number") {
7109
7125
  fieldErrorHideSourceValue = String(fieldErrorHideSourceValue);
@@ -7112,7 +7128,7 @@
7112
7128
  fieldErrorHideSourceValue = "";
7113
7129
  }
7114
7130
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldErrorHideSourceValue);
7115
- _l.label = 11;
7131
+ _p.label = 11;
7116
7132
  case 11:
7117
7133
  this.fieldErrorHide(action.props.fieldKey, action.props.message);
7118
7134
  return [3 /*break*/, 63];
@@ -7124,81 +7140,81 @@
7124
7140
  return [3 /*break*/, 63];
7125
7141
  case 14: return [4 /*yield*/, this.setValue(action, object)];
7126
7142
  case 15:
7127
- _l.sent();
7143
+ _p.sent();
7128
7144
  return [3 /*break*/, 63];
7129
7145
  case 16: return [4 /*yield*/, this.setFieldDefaultValue(action, object)];
7130
7146
  case 17:
7131
- _l.sent();
7147
+ _p.sent();
7132
7148
  return [3 /*break*/, 63];
7133
7149
  case 18: return [4 /*yield*/, this.setApiStatus(action, object)];
7134
7150
  case 19:
7135
- _l.sent();
7151
+ _p.sent();
7136
7152
  return [3 /*break*/, 63];
7137
7153
  case 20: return [4 /*yield*/, this.setApiHeaderValue(action, object)];
7138
7154
  case 21:
7139
- _l.sent();
7155
+ _p.sent();
7140
7156
  return [3 /*break*/, 63];
7141
7157
  case 22: return [4 /*yield*/, this.setApiHeaderValidity(action, object)];
7142
7158
  case 23:
7143
- _l.sent();
7159
+ _p.sent();
7144
7160
  return [3 /*break*/, 63];
7145
7161
  case 24: return [4 /*yield*/, this.setApiBodyValue(action, object)];
7146
7162
  case 25:
7147
- _l.sent();
7163
+ _p.sent();
7148
7164
  return [3 /*break*/, 63];
7149
7165
  case 26: return [4 /*yield*/, this.setApiBodyValidity(action, object)];
7150
7166
  case 27:
7151
- _l.sent();
7167
+ _p.sent();
7152
7168
  return [3 /*break*/, 63];
7153
7169
  case 28: return [4 /*yield*/, this.setDropdownOptions(action, object)];
7154
7170
  case 29:
7155
- _l.sent();
7171
+ _p.sent();
7156
7172
  return [3 /*break*/, 63];
7157
7173
  case 30: return [4 /*yield*/, this.setFieldValidity(action, object)];
7158
7174
  case 31:
7159
- _l.sent();
7175
+ _p.sent();
7160
7176
  return [3 /*break*/, 63];
7161
7177
  case 32:
7162
7178
  this.handleConnectedElements({ key: action.props.fieldKey }, "ON_ACTION");
7163
7179
  return [3 /*break*/, 63];
7164
7180
  case 33: return [4 /*yield*/, this.fieldApiCall(action, object)];
7165
7181
  case 34:
7166
- _l.sent();
7182
+ _p.sent();
7167
7183
  return [3 /*break*/, 63];
7168
7184
  case 35: return [4 /*yield*/, this.fieldMultipleApiCalls(action, object)];
7169
7185
  case 36:
7170
- _l.sent();
7186
+ _p.sent();
7171
7187
  return [3 /*break*/, 63];
7172
7188
  case 37: return [4 /*yield*/, this.fieldMultipleApiCallsEnd(action, object)];
7173
7189
  case 38:
7174
- _l.sent();
7190
+ _p.sent();
7175
7191
  return [3 /*break*/, 63];
7176
7192
  case 39: return [4 /*yield*/, this.taskApiCall(action, object)];
7177
7193
  case 40:
7178
- _l.sent();
7194
+ _p.sent();
7179
7195
  return [3 /*break*/, 63];
7180
7196
  case 41: return [4 /*yield*/, this.taskMultipleApiCalls(action, object)];
7181
7197
  case 42:
7182
- _l.sent();
7198
+ _p.sent();
7183
7199
  return [3 /*break*/, 63];
7184
7200
  case 43: return [4 /*yield*/, this.taskMultipleApiCallsEnd(action, object)];
7185
7201
  case 44:
7186
- _l.sent();
7202
+ _p.sent();
7187
7203
  return [3 /*break*/, 63];
7188
7204
  case 45:
7189
7205
  if (!kwikidToolkit.checkObjectKeyExists(action.props.url, "source")) return [3 /*break*/, 47];
7190
7206
  redirectToUrl_Source = new kwikidToolkit.Source(object);
7191
7207
  return [4 /*yield*/, redirectToUrl_Source.getValueFromSource(action.props.url.source)];
7192
7208
  case 46:
7193
- redirectToUrlSourceValue = _l.sent();
7209
+ redirectToUrlSourceValue = _p.sent();
7194
7210
  if (kwikidToolkit.isEmptyString(redirectToUrlSourceValue)) {
7195
7211
  redirectToUrlSourceValue = "";
7196
7212
  }
7197
7213
  action = kwikidToolkit.setValueToObjectPath(action, "props.url.url", redirectToUrlSourceValue);
7198
- _l.label = 47;
7214
+ _p.label = 47;
7199
7215
  case 47:
7200
7216
  this.redirectToUrl(action);
7201
- _l.label = 48;
7217
+ _p.label = 48;
7202
7218
  case 48:
7203
7219
  this.showPreview(action.props);
7204
7220
  return [3 /*break*/, 63];
@@ -7207,7 +7223,7 @@
7207
7223
  previewErrorShow_Source = new kwikidToolkit.Source(object);
7208
7224
  return [4 /*yield*/, previewErrorShow_Source.getValueFromSource(action.props.message.source)];
7209
7225
  case 50:
7210
- previewErrorShowSourceValue = _l.sent();
7226
+ previewErrorShowSourceValue = _p.sent();
7211
7227
  if (typeof previewErrorShowSourceValue == "string" ||
7212
7228
  typeof previewErrorShowSourceValue == "number") {
7213
7229
  previewErrorShowSourceValue = String(previewErrorShowSourceValue);
@@ -7216,7 +7232,7 @@
7216
7232
  previewErrorShowSourceValue = "";
7217
7233
  }
7218
7234
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", previewErrorShowSourceValue);
7219
- _l.label = 51;
7235
+ _p.label = 51;
7220
7236
  case 51:
7221
7237
  this.showErrorPreview(action.props);
7222
7238
  return [3 /*break*/, 63];