kwikid-forms 0.6.21 → 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.
@@ -847,6 +847,7 @@
847
847
  others: {
848
848
  isFrontCamera: false,
849
849
  isWatermark: false,
850
+ isWatermarkForImageUpload: false,
850
851
  flipHorizontal: false,
851
852
  mask: {
852
853
  shape: ""
@@ -3442,7 +3443,6 @@
3442
3443
  case 8:
3443
3444
  value = convertFormFieldValueToKwikUIFormat(field, value);
3444
3445
  validators = new FormValidation().getFormFieldValidators(field);
3445
- console.log("FORMKEYYYY", field);
3446
3446
  formGroup.addControl(field.key, new i3.FormControl({ value: value, disabled: field.disabled }, { validators: validators }));
3447
3447
  _b.label = 9;
3448
3448
  case 9:
@@ -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;
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 =
@@ -4494,13 +4494,19 @@
4494
4494
  if (response) {
4495
4495
  this.resetCamera();
4496
4496
  var image = response === null || response === void 0 ? void 0 : response.image_url;
4497
- this.mediaFiles[this.apiCallResponse.key] = kwikidToolkit.getObjectDeepCopy([
4498
- image
4499
- ]);
4500
- this.formGroup.controls[this.apiCallResponse.key].setValue(kwikidToolkit.getObjectDeepCopy([image]), {
4497
+ this.formData[field_1.key] = kwikidToolkit.getObjectDeepCopy([image]);
4498
+ this.mediaFiles[field_1.key] = kwikidToolkit.getObjectDeepCopy([image]);
4499
+ this.formGroup.controls[field_1.key].patchValue(kwikidToolkit.getObjectDeepCopy([image]), {
4500
+ emitEvent: false,
4501
+ onlySelf: false
4502
+ });
4503
+ this.formGroup.patchValue((_p = {},
4504
+ _p[field_1.key] = kwikidToolkit.getObjectDeepCopy([image]),
4505
+ _p), { emitEvent: false });
4506
+ this.formGroup.controls[field_1.key].updateValueAndValidity({
4501
4507
  emitEvent: false
4502
4508
  });
4503
- this.formGroup.controls[this.apiCallResponse.key].updateValueAndValidity({
4509
+ this.formGroup.updateValueAndValidity({
4504
4510
  emitEvent: false
4505
4511
  });
4506
4512
  this.getUnsavedDataState.emit(true);
@@ -4516,11 +4522,11 @@
4516
4522
  ALL_FORMS_DATA: this.allFormsData
4517
4523
  }, this.takeAction.bind(this));
4518
4524
  (function () { return __awaiter(_this, void 0, void 0, function () {
4519
- return __generator(this, function (_k) {
4520
- switch (_k.label) {
4525
+ return __generator(this, function (_o) {
4526
+ switch (_o.label) {
4521
4527
  case 0: return [4 /*yield*/, validations_1.validate(field_1.validation)];
4522
4528
  case 1:
4523
- _k.sent();
4529
+ _o.sent();
4524
4530
  return [2 /*return*/];
4525
4531
  }
4526
4532
  });
@@ -4543,13 +4549,19 @@
4543
4549
  if (response) {
4544
4550
  this.resetCamera();
4545
4551
  var video = response === null || response === void 0 ? void 0 : response.video_url;
4546
- this.mediaFiles[this.apiCallResponse.key] = kwikidToolkit.getObjectDeepCopy([
4547
- video
4548
- ]);
4549
- this.formGroup.controls[this.apiCallResponse.key].setValue(kwikidToolkit.getObjectDeepCopy([video]), {
4552
+ this.formData[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]);
4553
+ this.mediaFiles[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]);
4554
+ this.formGroup.controls[field_1.key].patchValue(kwikidToolkit.getObjectDeepCopy([video]), {
4555
+ emitEvent: false,
4556
+ onlySelf: false
4557
+ });
4558
+ this.formGroup.patchValue((_q = {},
4559
+ _q[field_1.key] = kwikidToolkit.getObjectDeepCopy([video]),
4560
+ _q), { emitEvent: false });
4561
+ this.formGroup.controls[field_1.key].updateValueAndValidity({
4550
4562
  emitEvent: false
4551
4563
  });
4552
- this.formGroup.controls[this.apiCallResponse.key].updateValueAndValidity({
4564
+ this.formGroup.updateValueAndValidity({
4553
4565
  emitEvent: false
4554
4566
  });
4555
4567
  this.getUnsavedDataState.emit(true);
@@ -4565,11 +4577,11 @@
4565
4577
  ALL_FORMS_DATA: this.allFormsData
4566
4578
  }, this.takeAction.bind(this));
4567
4579
  (function () { return __awaiter(_this, void 0, void 0, function () {
4568
- return __generator(this, function (_k) {
4569
- switch (_k.label) {
4580
+ return __generator(this, function (_o) {
4581
+ switch (_o.label) {
4570
4582
  case 0: return [4 /*yield*/, validations_2.validate(field_1.validation)];
4571
4583
  case 1:
4572
- _k.sent();
4584
+ _o.sent();
4573
4585
  return [2 /*return*/];
4574
4586
  }
4575
4587
  });
@@ -4621,11 +4633,11 @@
4621
4633
  ALL_FORMS_DATA: this.allFormsData
4622
4634
  }, this.takeAction.bind(this));
4623
4635
  (function () { return __awaiter(_this, void 0, void 0, function () {
4624
- return __generator(this, function (_k) {
4625
- switch (_k.label) {
4636
+ return __generator(this, function (_o) {
4637
+ switch (_o.label) {
4626
4638
  case 0: return [4 /*yield*/, validations_3.validate(field_2.validation)];
4627
4639
  case 1:
4628
- _k.sent();
4640
+ _o.sent();
4629
4641
  return [2 /*return*/];
4630
4642
  }
4631
4643
  });
@@ -4640,11 +4652,11 @@
4640
4652
  if (verifyChange("formConfig")) {
4641
4653
  this.formConfig = changes.formConfig.currentValue;
4642
4654
  (function () { return __awaiter(_this, void 0, void 0, function () {
4643
- return __generator(this, function (_k) {
4644
- switch (_k.label) {
4655
+ return __generator(this, function (_o) {
4656
+ switch (_o.label) {
4645
4657
  case 0: return [4 /*yield*/, this.initFormConfig(this.formConfig)];
4646
4658
  case 1:
4647
- _k.sent();
4659
+ _o.sent();
4648
4660
  return [2 /*return*/];
4649
4661
  }
4650
4662
  });
@@ -4661,11 +4673,11 @@
4661
4673
  };
4662
4674
  KwikIDFormViewComponent.prototype.initFormConfig = function (formConfig) {
4663
4675
  return __awaiter(this, void 0, void 0, function () {
4664
- var _k, _l, preTask, task, e_1_1, _m, _loop_1, this_1, _o, _p, field, _q, _r, field, validations, e_2_1;
4665
- 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;
4666
4678
  var _this = this;
4667
- return __generator(this, function (_v) {
4668
- switch (_v.label) {
4679
+ return __generator(this, function (_y) {
4680
+ switch (_y.label) {
4669
4681
  case 0:
4670
4682
  formConfig = new Converter().convertFormConfig(formConfig);
4671
4683
  formConfig = new Converter().updateFormConfigProperties(formConfig);
@@ -4674,14 +4686,14 @@
4674
4686
  this.setFormDataFromAllFormsData();
4675
4687
  if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
4676
4688
  kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "pre"))) return [3 /*break*/, 10];
4677
- _v.label = 1;
4689
+ _y.label = 1;
4678
4690
  case 1:
4679
- _v.trys.push([1, 7, 8, 9]);
4680
- _k = __values(this.formConfig.tasks.pre), _l = _k.next();
4681
- _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;
4682
4694
  case 2:
4683
- if (!!_l.done) return [3 /*break*/, 6];
4684
- preTask = _l.value;
4695
+ if (!!_p.done) return [3 /*break*/, 6];
4696
+ preTask = _p.value;
4685
4697
  task = new Tasks(preTask, {
4686
4698
  FORM_CONFIG: this.formConfig,
4687
4699
  FORM_FIELDS: this.formFields,
@@ -4699,7 +4711,7 @@
4699
4711
  }
4700
4712
  return [4 /*yield*/, task.execute()];
4701
4713
  case 3:
4702
- _v.sent();
4714
+ _y.sent();
4703
4715
  // Wait for ngOnChanges to be called before continuing to the next task
4704
4716
  return [4 /*yield*/, new Promise(function (resolve) {
4705
4717
  var intervalId = setInterval(function () {
@@ -4711,36 +4723,36 @@
4711
4723
  })];
4712
4724
  case 4:
4713
4725
  // Wait for ngOnChanges to be called before continuing to the next task
4714
- _v.sent();
4726
+ _y.sent();
4715
4727
  if (this.stopTaskExecution) {
4716
4728
  return [3 /*break*/, 6];
4717
4729
  }
4718
- _v.label = 5;
4730
+ _y.label = 5;
4719
4731
  case 5:
4720
- _l = _k.next();
4732
+ _p = _o.next();
4721
4733
  return [3 /*break*/, 2];
4722
4734
  case 6: return [3 /*break*/, 9];
4723
4735
  case 7:
4724
- e_1_1 = _v.sent();
4736
+ e_1_1 = _y.sent();
4725
4737
  e_1 = { error: e_1_1 };
4726
4738
  return [3 /*break*/, 9];
4727
4739
  case 8:
4728
4740
  try {
4729
- if (_l && !_l.done && (_s = _k.return)) _s.call(_k);
4741
+ if (_p && !_p.done && (_v = _o.return)) _v.call(_o);
4730
4742
  }
4731
4743
  finally { if (e_1) throw e_1.error; }
4732
4744
  return [7 /*endfinally*/];
4733
4745
  case 9:
4734
4746
  this.formData = kwikidToolkit.mergeObjects(this.formData, this.popupFormData);
4735
- _v.label = 10;
4747
+ _y.label = 10;
4736
4748
  case 10:
4737
4749
  if (this.stopTaskExecution) {
4738
4750
  return [2 /*return*/, false];
4739
4751
  }
4740
- _m = this;
4752
+ _q = this;
4741
4753
  return [4 /*yield*/, this.formViewService.createFormGroup(this.formFields, this.formData, this.previousFormData, this.allFormsData, this.takeAction.bind(this))];
4742
4754
  case 11:
4743
- _m.formGroup = _v.sent();
4755
+ _q.formGroup = _y.sent();
4744
4756
  /**
4745
4757
  * For some reason if their a field of type 'IMAGE' then
4746
4758
  * formData is adding a 'undefined' key with last image's value from the array.
@@ -4750,10 +4762,10 @@
4750
4762
  delete this.formData["undefined"];
4751
4763
  }
4752
4764
  _loop_1 = function (field) {
4753
- var _w, _x;
4765
+ var _z, _0;
4754
4766
  if (field.isFormElement) {
4755
- this_1.previousFormData = Object.assign(Object.assign({}, this_1.previousFormData), (_w = {}, _w[field.key] = convertFormFieldValueToStandardFormat(field, this_1.formGroup.controls[field.key].value), _w));
4756
- 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));
4757
4769
  if (field.type === EFieldType.FILE) {
4758
4770
  this_1.files[field.key] = this_1.formGroup.controls[field.key].value;
4759
4771
  }
@@ -4767,11 +4779,11 @@
4767
4779
  }
4768
4780
  this_1.formGroup.controls[field.key].valueChanges
4769
4781
  .pipe(operators.pairwise())
4770
- .subscribe(function (_k) {
4771
- var _l, _m;
4772
- var _o = __read(_k, 2), previousValue = _o[0], currentValue = _o[1];
4773
- _this.previousFormData = Object.assign(Object.assign({}, _this.previousFormData), (_l = {}, _l[field.key] = convertFormFieldValueToStandardFormat(field, previousValue), _l));
4774
- _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));
4775
4787
  if (field.type === EFieldType.FILE) {
4776
4788
  _this.files[field.key] = currentValue;
4777
4789
  }
@@ -4788,26 +4800,26 @@
4788
4800
  };
4789
4801
  this_1 = this;
4790
4802
  try {
4791
- for (_o = __values(this.formFields), _p = _o.next(); !_p.done; _p = _o.next()) {
4792
- field = _p.value;
4803
+ for (_r = __values(this.formFields), _s = _r.next(); !_s.done; _s = _r.next()) {
4804
+ field = _s.value;
4793
4805
  _loop_1(field);
4794
4806
  }
4795
4807
  }
4796
4808
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
4797
4809
  finally {
4798
4810
  try {
4799
- if (_p && !_p.done && (_t = _o.return)) _t.call(_o);
4811
+ if (_s && !_s.done && (_w = _r.return)) _w.call(_r);
4800
4812
  }
4801
4813
  finally { if (e_3) throw e_3.error; }
4802
4814
  }
4803
- _v.label = 12;
4815
+ _y.label = 12;
4804
4816
  case 12:
4805
- _v.trys.push([12, 18, 19, 20]);
4806
- _q = __values(this.formFields), _r = _q.next();
4807
- _v.label = 13;
4817
+ _y.trys.push([12, 18, 19, 20]);
4818
+ _t = __values(this.formFields), _u = _t.next();
4819
+ _y.label = 13;
4808
4820
  case 13:
4809
- if (!!_r.done) return [3 /*break*/, 17];
4810
- field = _r.value;
4821
+ if (!!_u.done) return [3 /*break*/, 17];
4822
+ field = _u.value;
4811
4823
  if (!field.isFormElement) return [3 /*break*/, 16];
4812
4824
  if (!kwikidToolkit.checkObjectKeyExists(field, "validation")) return [3 /*break*/, 15];
4813
4825
  if (!field.validation.triggers.includes("ON_INIT")) return [3 /*break*/, 15];
@@ -4821,8 +4833,8 @@
4821
4833
  }, this.takeAction.bind(this));
4822
4834
  return [4 /*yield*/, validations.validate(field.validation)];
4823
4835
  case 14:
4824
- _v.sent();
4825
- _v.label = 15;
4836
+ _y.sent();
4837
+ _y.label = 15;
4826
4838
  case 15:
4827
4839
  if (kwikidToolkit.checkObjectKeyExists(field, "connectedElements")) {
4828
4840
  this.handleConnectedElements({
@@ -4830,18 +4842,18 @@
4830
4842
  value: this.formGroup.controls[field.key].value
4831
4843
  }, "ON_INIT");
4832
4844
  }
4833
- _v.label = 16;
4845
+ _y.label = 16;
4834
4846
  case 16:
4835
- _r = _q.next();
4847
+ _u = _t.next();
4836
4848
  return [3 /*break*/, 13];
4837
4849
  case 17: return [3 /*break*/, 20];
4838
4850
  case 18:
4839
- e_2_1 = _v.sent();
4851
+ e_2_1 = _y.sent();
4840
4852
  e_2 = { error: e_2_1 };
4841
4853
  return [3 /*break*/, 20];
4842
4854
  case 19:
4843
4855
  try {
4844
- if (_r && !_r.done && (_u = _q.return)) _u.call(_q);
4856
+ if (_u && !_u.done && (_x = _t.return)) _x.call(_t);
4845
4857
  }
4846
4858
  finally { if (e_2) throw e_2.error; }
4847
4859
  return [7 /*endfinally*/];
@@ -4879,10 +4891,10 @@
4879
4891
  };
4880
4892
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroupActions = function (childFieldGroupConfig, parentField) {
4881
4893
  return __awaiter(this, void 0, void 0, function () {
4882
- var rulesMapping, _k, _l, action, conditionSuccess, actions, e_4_1;
4883
- var e_4, _m;
4884
- return __generator(this, function (_o) {
4885
- 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) {
4886
4898
  case 0:
4887
4899
  if (!kwikidToolkit.checkObjectKeyExists(childFieldGroupConfig, "rules")) return [3 /*break*/, 8];
4888
4900
  rulesMapping = new kwikidToolkit.Rule(childFieldGroupConfig.rules, {
@@ -4892,14 +4904,14 @@
4892
4904
  PREVIOUS_FORM_DATA: this.previousFormData,
4893
4905
  ALL_FORMS_DATA: this.allFormsData
4894
4906
  }).mapping();
4895
- _o.label = 1;
4907
+ _r.label = 1;
4896
4908
  case 1:
4897
- _o.trys.push([1, 6, 7, 8]);
4898
- _k = __values(childFieldGroupConfig.actions), _l = _k.next();
4899
- _o.label = 2;
4909
+ _r.trys.push([1, 6, 7, 8]);
4910
+ _o = __values(childFieldGroupConfig.actions), _p = _o.next();
4911
+ _r.label = 2;
4900
4912
  case 2:
4901
- if (!!_l.done) return [3 /*break*/, 5];
4902
- action = _l.value;
4913
+ if (!!_p.done) return [3 /*break*/, 5];
4914
+ action = _p.value;
4903
4915
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
4904
4916
  if (!conditionSuccess) return [3 /*break*/, 4];
4905
4917
  actions = new kwikidToolkit.Action(action, rulesMapping, {
@@ -4912,19 +4924,19 @@
4912
4924
  }, this.takeActionOnFieldGroup.bind(this));
4913
4925
  return [4 /*yield*/, actions.execute()];
4914
4926
  case 3:
4915
- _o.sent();
4916
- _o.label = 4;
4927
+ _r.sent();
4928
+ _r.label = 4;
4917
4929
  case 4:
4918
- _l = _k.next();
4930
+ _p = _o.next();
4919
4931
  return [3 /*break*/, 2];
4920
4932
  case 5: return [3 /*break*/, 8];
4921
4933
  case 6:
4922
- e_4_1 = _o.sent();
4934
+ e_4_1 = _r.sent();
4923
4935
  e_4 = { error: e_4_1 };
4924
4936
  return [3 /*break*/, 8];
4925
4937
  case 7:
4926
4938
  try {
4927
- if (_l && !_l.done && (_m = _k.return)) _m.call(_k);
4939
+ if (_p && !_p.done && (_q = _o.return)) _q.call(_o);
4928
4940
  }
4929
4941
  finally { if (e_4) throw e_4.error; }
4930
4942
  return [7 /*endfinally*/];
@@ -4935,15 +4947,15 @@
4935
4947
  };
4936
4948
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldGroup = function (currentField, connectedFieldGroupConfig, eventType) {
4937
4949
  return __awaiter(this, void 0, void 0, function () {
4938
- return __generator(this, function (_k) {
4939
- switch (_k.label) {
4950
+ return __generator(this, function (_o) {
4951
+ switch (_o.label) {
4940
4952
  case 0:
4941
4953
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldGroupConfig, "triggers")) return [3 /*break*/, 2];
4942
4954
  if (!connectedFieldGroupConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
4943
4955
  return [4 /*yield*/, this.handleConnectedElementFieldGroupActions(connectedFieldGroupConfig, currentField)];
4944
4956
  case 1:
4945
- _k.sent();
4946
- _k.label = 2;
4957
+ _o.sent();
4958
+ _o.label = 2;
4947
4959
  case 2: return [2 /*return*/];
4948
4960
  }
4949
4961
  });
@@ -4951,10 +4963,10 @@
4951
4963
  };
4952
4964
  KwikIDFormViewComponent.prototype.handleConnectedElementFieldActions = function (connectedFieldConfig, connectedField) {
4953
4965
  return __awaiter(this, void 0, void 0, function () {
4954
- var rulesMapping, _k, _l, action, conditionSuccess, actions, e_5_1;
4955
- var e_5, _m;
4956
- return __generator(this, function (_o) {
4957
- 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) {
4958
4970
  case 0:
4959
4971
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "rules")) return [3 /*break*/, 8];
4960
4972
  rulesMapping = new kwikidToolkit.Rule(connectedFieldConfig.rules, {
@@ -4964,14 +4976,14 @@
4964
4976
  PREVIOUS_FORM_DATA: this.previousFormData,
4965
4977
  ALL_FORMS_DATA: this.allFormsData
4966
4978
  }).mapping();
4967
- _o.label = 1;
4979
+ _r.label = 1;
4968
4980
  case 1:
4969
- _o.trys.push([1, 6, 7, 8]);
4970
- _k = __values(connectedFieldConfig.actions), _l = _k.next();
4971
- _o.label = 2;
4981
+ _r.trys.push([1, 6, 7, 8]);
4982
+ _o = __values(connectedFieldConfig.actions), _p = _o.next();
4983
+ _r.label = 2;
4972
4984
  case 2:
4973
- if (!!_l.done) return [3 /*break*/, 5];
4974
- action = _l.value;
4985
+ if (!!_p.done) return [3 /*break*/, 5];
4986
+ action = _p.value;
4975
4987
  conditionSuccess = new kwikidToolkit.Condition(action.condition, rulesMapping).evaluate();
4976
4988
  if (!conditionSuccess) return [3 /*break*/, 4];
4977
4989
  actions = new kwikidToolkit.Action(action, rulesMapping, {
@@ -4984,19 +4996,19 @@
4984
4996
  }, this.takeAction.bind(this));
4985
4997
  return [4 /*yield*/, actions.execute()];
4986
4998
  case 3:
4987
- _o.sent();
4988
- _o.label = 4;
4999
+ _r.sent();
5000
+ _r.label = 4;
4989
5001
  case 4:
4990
- _l = _k.next();
5002
+ _p = _o.next();
4991
5003
  return [3 /*break*/, 2];
4992
5004
  case 5: return [3 /*break*/, 8];
4993
5005
  case 6:
4994
- e_5_1 = _o.sent();
5006
+ e_5_1 = _r.sent();
4995
5007
  e_5 = { error: e_5_1 };
4996
5008
  return [3 /*break*/, 8];
4997
5009
  case 7:
4998
5010
  try {
4999
- if (_l && !_l.done && (_m = _k.return)) _m.call(_k);
5011
+ if (_p && !_p.done && (_q = _o.return)) _q.call(_o);
5000
5012
  }
5001
5013
  finally { if (e_5) throw e_5.error; }
5002
5014
  return [7 /*endfinally*/];
@@ -5008,16 +5020,16 @@
5008
5020
  KwikIDFormViewComponent.prototype.handleConnectedElementFields = function (currentField, connectedFieldConfig, eventType, nested) {
5009
5021
  return __awaiter(this, void 0, void 0, function () {
5010
5022
  var connectedField;
5011
- return __generator(this, function (_k) {
5012
- switch (_k.label) {
5023
+ return __generator(this, function (_o) {
5024
+ switch (_o.label) {
5013
5025
  case 0:
5014
5026
  connectedField = getFormFieldByKey(this.formFields, connectedFieldConfig["key"]);
5015
5027
  if (!kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "triggers")) return [3 /*break*/, 2];
5016
5028
  if (!connectedFieldConfig.triggers.includes(eventType)) return [3 /*break*/, 2];
5017
5029
  return [4 /*yield*/, this.handleConnectedElementFieldActions(connectedFieldConfig, connectedField)];
5018
5030
  case 1:
5019
- connectedField = _k.sent();
5020
- _k.label = 2;
5031
+ connectedField = _o.sent();
5032
+ _o.label = 2;
5021
5033
  case 2:
5022
5034
  if (kwikidToolkit.checkObjectKeyExists(connectedFieldConfig, "handleNestedFields")) {
5023
5035
  if (connectedFieldConfig.handleNestedFields) {
@@ -5032,67 +5044,67 @@
5032
5044
  KwikIDFormViewComponent.prototype.handleConnectedElements = function (e, eventType) {
5033
5045
  return __awaiter(this, void 0, void 0, function () {
5034
5046
  var currentField, connectedFieldGroups, connectedFieldGroups_1, connectedFieldGroups_1_1, connectedFieldGroupConfig, e_6_1, connectedFields, connectedFields_1, connectedFields_1_1, connectedFieldConfig, e_7_1;
5035
- var e_6, _k, e_7, _l;
5036
- return __generator(this, function (_m) {
5037
- switch (_m.label) {
5047
+ var e_6, _o, e_7, _p;
5048
+ return __generator(this, function (_q) {
5049
+ switch (_q.label) {
5038
5050
  case 0:
5039
5051
  currentField = getFormFieldByKey(this.formFields, e.key);
5040
5052
  if (!(currentField !== undefined)) return [3 /*break*/, 17];
5041
5053
  if (!kwikidToolkit.checkObjectKeyExists(currentField, "connectedElements")) return [3 /*break*/, 16];
5042
5054
  if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFieldGroups")) return [3 /*break*/, 8];
5043
5055
  connectedFieldGroups = currentField.connectedElements.connectedFieldGroups;
5044
- _m.label = 1;
5056
+ _q.label = 1;
5045
5057
  case 1:
5046
- _m.trys.push([1, 6, 7, 8]);
5058
+ _q.trys.push([1, 6, 7, 8]);
5047
5059
  connectedFieldGroups_1 = __values(connectedFieldGroups), connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
5048
- _m.label = 2;
5060
+ _q.label = 2;
5049
5061
  case 2:
5050
5062
  if (!!connectedFieldGroups_1_1.done) return [3 /*break*/, 5];
5051
5063
  connectedFieldGroupConfig = connectedFieldGroups_1_1.value;
5052
5064
  return [4 /*yield*/, this.handleConnectedElementFieldGroup(currentField, connectedFieldGroupConfig, eventType)];
5053
5065
  case 3:
5054
- _m.sent();
5055
- _m.label = 4;
5066
+ _q.sent();
5067
+ _q.label = 4;
5056
5068
  case 4:
5057
5069
  connectedFieldGroups_1_1 = connectedFieldGroups_1.next();
5058
5070
  return [3 /*break*/, 2];
5059
5071
  case 5: return [3 /*break*/, 8];
5060
5072
  case 6:
5061
- e_6_1 = _m.sent();
5073
+ e_6_1 = _q.sent();
5062
5074
  e_6 = { error: e_6_1 };
5063
5075
  return [3 /*break*/, 8];
5064
5076
  case 7:
5065
5077
  try {
5066
- 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);
5067
5079
  }
5068
5080
  finally { if (e_6) throw e_6.error; }
5069
5081
  return [7 /*endfinally*/];
5070
5082
  case 8:
5071
5083
  if (!kwikidToolkit.checkObjectKeyExists(currentField.connectedElements, "connectedFields")) return [3 /*break*/, 16];
5072
5084
  connectedFields = currentField.connectedElements.connectedFields;
5073
- _m.label = 9;
5085
+ _q.label = 9;
5074
5086
  case 9:
5075
- _m.trys.push([9, 14, 15, 16]);
5087
+ _q.trys.push([9, 14, 15, 16]);
5076
5088
  connectedFields_1 = __values(connectedFields), connectedFields_1_1 = connectedFields_1.next();
5077
- _m.label = 10;
5089
+ _q.label = 10;
5078
5090
  case 10:
5079
5091
  if (!!connectedFields_1_1.done) return [3 /*break*/, 13];
5080
5092
  connectedFieldConfig = connectedFields_1_1.value;
5081
5093
  return [4 /*yield*/, this.handleConnectedElementFields(currentField, connectedFieldConfig, eventType, eventType)];
5082
5094
  case 11:
5083
- currentField = _m.sent();
5084
- _m.label = 12;
5095
+ currentField = _q.sent();
5096
+ _q.label = 12;
5085
5097
  case 12:
5086
5098
  connectedFields_1_1 = connectedFields_1.next();
5087
5099
  return [3 /*break*/, 10];
5088
5100
  case 13: return [3 /*break*/, 16];
5089
5101
  case 14:
5090
- e_7_1 = _m.sent();
5102
+ e_7_1 = _q.sent();
5091
5103
  e_7 = { error: e_7_1 };
5092
5104
  return [3 /*break*/, 16];
5093
5105
  case 15:
5094
5106
  try {
5095
- 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);
5096
5108
  }
5097
5109
  finally { if (e_7) throw e_7.error; }
5098
5110
  return [7 /*endfinally*/];
@@ -5104,23 +5116,23 @@
5104
5116
  });
5105
5117
  };
5106
5118
  KwikIDFormViewComponent.prototype.handleRemovedFile = function (e) {
5107
- var _k;
5119
+ var _o;
5108
5120
  this.showApiLoader();
5109
5121
  if (this.formGroup["controls"][e.key].enabled) {
5110
5122
  this.files[e.key] = e.files;
5111
5123
  this.formData[e.key] = filterDuplicatesFiles(this.files[e.key]);
5112
- this.formGroup.patchValue((_k = {},
5113
- _k[e.key] = this.formData[e.key],
5114
- _k), { emitEvent: false });
5124
+ this.formGroup.patchValue((_o = {},
5125
+ _o[e.key] = this.formData[e.key],
5126
+ _o), { emitEvent: false });
5115
5127
  }
5116
5128
  this.hideApiLoader();
5117
5129
  };
5118
5130
  KwikIDFormViewComponent.prototype.handleGetKeyValueFile = function (e) {
5119
5131
  return __awaiter(this, void 0, void 0, function () {
5120
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;
5121
- var e_8, _k, e_9, _l;
5122
- return __generator(this, function (_m) {
5123
- switch (_m.label) {
5133
+ var e_8, _o, e_9, _p;
5134
+ return __generator(this, function (_q) {
5135
+ switch (_q.label) {
5124
5136
  case 0:
5125
5137
  this.showApiLoader();
5126
5138
  field = getFormFieldByKey(this.formFields, e.key);
@@ -5128,41 +5140,41 @@
5128
5140
  if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
5129
5141
  kwikidToolkit.checkObjectKeyExists(field.properties, "uploadFileToServer") &&
5130
5142
  field.properties.uploadFileToServer)) return [3 /*break*/, 9];
5131
- _m.label = 1;
5143
+ _q.label = 1;
5132
5144
  case 1:
5133
- _m.trys.push([1, 6, 7, 8]);
5145
+ _q.trys.push([1, 6, 7, 8]);
5134
5146
  values_1 = __values(values), values_1_1 = values_1.next();
5135
- _m.label = 2;
5147
+ _q.label = 2;
5136
5148
  case 2:
5137
5149
  if (!!values_1_1.done) return [3 /*break*/, 5];
5138
5150
  value = values_1_1.value;
5139
5151
  return [4 /*yield*/, this.uploadFile(field, value)];
5140
5152
  case 3:
5141
- _m.sent();
5142
- _m.label = 4;
5153
+ _q.sent();
5154
+ _q.label = 4;
5143
5155
  case 4:
5144
5156
  values_1_1 = values_1.next();
5145
5157
  return [3 /*break*/, 2];
5146
5158
  case 5: return [3 /*break*/, 8];
5147
5159
  case 6:
5148
- e_8_1 = _m.sent();
5160
+ e_8_1 = _q.sent();
5149
5161
  e_8 = { error: e_8_1 };
5150
5162
  return [3 /*break*/, 8];
5151
5163
  case 7:
5152
5164
  try {
5153
- 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);
5154
5166
  }
5155
5167
  finally { if (e_8) throw e_8.error; }
5156
5168
  return [7 /*endfinally*/];
5157
5169
  case 8: return [3 /*break*/, 18];
5158
5170
  case 9:
5159
5171
  _loop_2 = function (value) {
5160
- var updatedFile, _o;
5161
- return __generator(this, function (_p) {
5162
- switch (_p.label) {
5172
+ var updatedFile, _r;
5173
+ return __generator(this, function (_s) {
5174
+ switch (_s.label) {
5163
5175
  case 0:
5164
5176
  this_2.updateFiles(value, "LOADING", e.key);
5165
- _o = kwikidToolkit.getObjectDeepCopy;
5177
+ _r = kwikidToolkit.getObjectDeepCopy;
5166
5178
  return [4 /*yield*/, new Promise(function (resolve) {
5167
5179
  setTimeout(function () {
5168
5180
  resolve({
@@ -5176,42 +5188,42 @@
5176
5188
  }, 300); // 1000 ms = 1 sec
5177
5189
  })];
5178
5190
  case 1:
5179
- updatedFile = _o.apply(void 0, [_p.sent()]);
5191
+ updatedFile = _r.apply(void 0, [_s.sent()]);
5180
5192
  this_2.updateFiles(updatedFile, "NORMAL", e.key);
5181
5193
  return [2 /*return*/];
5182
5194
  }
5183
5195
  });
5184
5196
  };
5185
5197
  this_2 = this;
5186
- _m.label = 10;
5198
+ _q.label = 10;
5187
5199
  case 10:
5188
- _m.trys.push([10, 15, 16, 17]);
5200
+ _q.trys.push([10, 15, 16, 17]);
5189
5201
  values_2 = __values(values), values_2_1 = values_2.next();
5190
- _m.label = 11;
5202
+ _q.label = 11;
5191
5203
  case 11:
5192
5204
  if (!!values_2_1.done) return [3 /*break*/, 14];
5193
5205
  value = values_2_1.value;
5194
5206
  return [5 /*yield**/, _loop_2(value)];
5195
5207
  case 12:
5196
- _m.sent();
5197
- _m.label = 13;
5208
+ _q.sent();
5209
+ _q.label = 13;
5198
5210
  case 13:
5199
5211
  values_2_1 = values_2.next();
5200
5212
  return [3 /*break*/, 11];
5201
5213
  case 14: return [3 /*break*/, 17];
5202
5214
  case 15:
5203
- e_9_1 = _m.sent();
5215
+ e_9_1 = _q.sent();
5204
5216
  e_9 = { error: e_9_1 };
5205
5217
  return [3 /*break*/, 17];
5206
5218
  case 16:
5207
5219
  try {
5208
- 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);
5209
5221
  }
5210
5222
  finally { if (e_9) throw e_9.error; }
5211
5223
  return [7 /*endfinally*/];
5212
5224
  case 17:
5213
5225
  this.hideApiLoader();
5214
- _m.label = 18;
5226
+ _q.label = 18;
5215
5227
  case 18: return [2 /*return*/];
5216
5228
  }
5217
5229
  });
@@ -5219,31 +5231,31 @@
5219
5231
  };
5220
5232
  /** Methods for Camera related fields like 'CAPTURE' or 'RECORD' */
5221
5233
  KwikIDFormViewComponent.prototype.handleOnClickGetRemovedMediaFile = function (e) {
5222
- var _k;
5234
+ var _o;
5223
5235
  this.showApiLoader();
5224
5236
  if (this.formGroup["controls"][e.key].enabled) {
5225
5237
  this.resetCamera();
5226
5238
  this.mediaFiles[e.key] = e.mediaFiles;
5227
5239
  this.formData[e.key] = filterDuplicatesMediaFiles(this.mediaFiles[e.key]);
5228
- this.formGroup.patchValue((_k = {},
5229
- _k[e.key] = this.formData[e.key],
5230
- _k), { emitEvent: false });
5240
+ this.formGroup.patchValue((_o = {},
5241
+ _o[e.key] = this.formData[e.key],
5242
+ _o), { emitEvent: false });
5231
5243
  }
5232
5244
  this.hideApiLoader();
5233
5245
  };
5234
5246
  KwikIDFormViewComponent.prototype.handleOnClickInputCamera = function (e, field) {
5235
- var _a, _b, _c, _d;
5247
+ var _a, _b, _c, _d, _e, _f;
5236
5248
  return __awaiter(this, void 0, void 0, function () {
5237
- var fieldKey, fieldcameraConfig, _k, cameraHelper, _l, _m;
5238
- return __generator(this, function (_o) {
5239
- switch (_o.label) {
5249
+ var fieldKey, fieldcameraConfig, _o, cameraHelper, _p, _q;
5250
+ return __generator(this, function (_r) {
5251
+ switch (_r.label) {
5240
5252
  case 0:
5241
5253
  fieldKey = field.key;
5242
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 : {};
5243
5255
  this.cameraType = (field === null || field === void 0 ? void 0 : field.type.toUpperCase()) || "";
5244
5256
  this.cameraFieldKey = fieldKey;
5245
- _k = this.cameraType;
5246
- switch (_k) {
5257
+ _o = this.cameraType;
5258
+ switch (_o) {
5247
5259
  case "CAPTURE": return [3 /*break*/, 1];
5248
5260
  case "RECORD": return [3 /*break*/, 5];
5249
5261
  }
@@ -5253,18 +5265,19 @@
5253
5265
  FIELD_PROPERTIES.capture.cameraConfig,
5254
5266
  fieldcameraConfig
5255
5267
  ]);
5256
- if (!((_d = (_c = this.cameraConfig) === null || _c === void 0 ? void 0 : _c.others) === null || _d === void 0 ? void 0 : _d.isWatermark)) return [3 /*break*/, 3];
5268
+ if (!(((_d = (_c = this.cameraConfig) === null || _c === void 0 ? void 0 : _c.others) === null || _d === void 0 ? void 0 : _d.isWatermark) ||
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];
5257
5270
  cameraHelper = new CameraHelper(field, this.formFields, this.allFormsData, this.formData, this.previousFormData);
5258
- _l = this;
5259
- _m = {};
5271
+ _p = this;
5272
+ _q = {};
5260
5273
  return [4 /*yield*/, cameraHelper.getCameraWatermarkData()];
5261
5274
  case 2:
5262
- _l.cameraData = (_m.watermark = _o.sent(),
5263
- _m);
5275
+ _p.cameraData = (_q.watermark = _r.sent(),
5276
+ _q);
5264
5277
  return [3 /*break*/, 4];
5265
5278
  case 3:
5266
5279
  this.cameraData = undefined;
5267
- _o.label = 4;
5280
+ _r.label = 4;
5268
5281
  case 4: return [3 /*break*/, 7];
5269
5282
  case 5:
5270
5283
  this.cameraConfig = kwikidToolkit.mergeObjectsDeep([
@@ -5290,9 +5303,10 @@
5290
5303
  KwikIDFormViewComponent.prototype.setCameraMedia = function (media) {
5291
5304
  return __awaiter(this, void 0, void 0, function () {
5292
5305
  var field, validations_4;
5306
+ var _o;
5293
5307
  var _this = this;
5294
- return __generator(this, function (_k) {
5295
- switch (_k.label) {
5308
+ return __generator(this, function (_p) {
5309
+ switch (_p.label) {
5296
5310
  case 0:
5297
5311
  field = getFormFieldByKey(this.formFields, this.cameraFieldKey);
5298
5312
  if (!(kwikidToolkit.checkObjectKeyExists(field, "properties") &&
@@ -5300,17 +5314,25 @@
5300
5314
  field.properties.uploadFileToServer)) return [3 /*break*/, 2];
5301
5315
  return [4 /*yield*/, this.uploadFile(field, media)];
5302
5316
  case 1:
5303
- _k.sent();
5317
+ _p.sent();
5304
5318
  return [3 /*break*/, 3];
5305
5319
  case 2:
5306
5320
  this.resetCamera();
5321
+ this.formData[field.key] = kwikidToolkit.getObjectDeepCopy([media]);
5307
5322
  this.mediaFiles[field.key] = kwikidToolkit.getObjectDeepCopy([media]);
5308
- this.formGroup.controls[field.key].setValue(kwikidToolkit.getObjectDeepCopy([media]), {
5309
- emitEvent: false
5323
+ this.formGroup.controls[field.key].patchValue(kwikidToolkit.getObjectDeepCopy([media]), {
5324
+ emitEvent: false,
5325
+ onlySelf: false
5310
5326
  });
5327
+ this.formGroup.patchValue((_o = {},
5328
+ _o[field.key] = kwikidToolkit.getObjectDeepCopy([media]),
5329
+ _o), { emitEvent: false });
5311
5330
  this.formGroup.controls[field.key].updateValueAndValidity({
5312
5331
  emitEvent: false
5313
5332
  });
5333
+ this.formGroup.updateValueAndValidity({
5334
+ emitEvent: false
5335
+ });
5314
5336
  this.getUnsavedDataState.emit(true);
5315
5337
  if (field.isFormElement &&
5316
5338
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
@@ -5324,11 +5346,11 @@
5324
5346
  ALL_FORMS_DATA: this.allFormsData
5325
5347
  }, this.takeAction.bind(this));
5326
5348
  (function () { return __awaiter(_this, void 0, void 0, function () {
5327
- return __generator(this, function (_k) {
5328
- switch (_k.label) {
5349
+ return __generator(this, function (_o) {
5350
+ switch (_o.label) {
5329
5351
  case 0: return [4 /*yield*/, validations_4.validate(field.validation)];
5330
5352
  case 1:
5331
- _k.sent();
5353
+ _o.sent();
5332
5354
  return [2 /*return*/];
5333
5355
  }
5334
5356
  });
@@ -5341,7 +5363,7 @@
5341
5363
  value: this.formGroup.controls[field.key].value
5342
5364
  }, "ON_CHANGE");
5343
5365
  }
5344
- _k.label = 3;
5366
+ _p.label = 3;
5345
5367
  case 3: return [2 /*return*/];
5346
5368
  }
5347
5369
  });
@@ -5436,7 +5458,7 @@
5436
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.
5437
5459
  */
5438
5460
  KwikIDFormViewComponent.prototype.updateFiles = function (file, state, key) {
5439
- var _k;
5461
+ var _o;
5440
5462
  var _this = this;
5441
5463
  var _a;
5442
5464
  var fileWithState = kwikidToolkit.mergeObjects(file, { state: state });
@@ -5464,9 +5486,9 @@
5464
5486
  emitEvent: false,
5465
5487
  onlySelf: false
5466
5488
  });
5467
- this.formGroup.patchValue((_k = {},
5468
- _k[key] = normalFiles,
5469
- _k), { emitEvent: false });
5489
+ this.formGroup.patchValue((_o = {},
5490
+ _o[key] = normalFiles,
5491
+ _o), { emitEvent: false });
5470
5492
  this.getUnsavedDataState.emit(true);
5471
5493
  if (field.isFormElement &&
5472
5494
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
@@ -5480,11 +5502,11 @@
5480
5502
  ALL_FORMS_DATA: this.allFormsData
5481
5503
  }, this.takeAction.bind(this));
5482
5504
  (function () { return __awaiter(_this, void 0, void 0, function () {
5483
- return __generator(this, function (_k) {
5484
- switch (_k.label) {
5505
+ return __generator(this, function (_o) {
5506
+ switch (_o.label) {
5485
5507
  case 0: return [4 /*yield*/, validations_5.validate(field.validation)];
5486
5508
  case 1:
5487
- _k.sent();
5509
+ _o.sent();
5488
5510
  return [2 /*return*/];
5489
5511
  }
5490
5512
  });
@@ -5503,7 +5525,7 @@
5503
5525
  */
5504
5526
  KwikIDFormViewComponent.prototype.uploadFile = function (field, file) {
5505
5527
  return __awaiter(this, void 0, void 0, function () {
5506
- return __generator(this, function (_k) {
5528
+ return __generator(this, function (_o) {
5507
5529
  switch (field.type) {
5508
5530
  case EFieldType.FILE:
5509
5531
  this.updateFiles(file, "LOADING", field.key);
@@ -5564,11 +5586,11 @@
5564
5586
  });
5565
5587
  };
5566
5588
  KwikIDFormViewComponent.prototype.handleOnClickFormFieldButton = function (field) {
5567
- var e_10, _k;
5589
+ var e_10, _o;
5568
5590
  var formData = this.formGroup.getRawValue();
5569
5591
  try {
5570
- for (var _l = __values(this.formFields), _m = _l.next(); !_m.done; _m = _l.next()) {
5571
- 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;
5572
5594
  if (field_3.isFormElement) {
5573
5595
  if (field_3.hidden) {
5574
5596
  delete formData[field_3.key];
@@ -5582,22 +5604,22 @@
5582
5604
  catch (e_10_1) { e_10 = { error: e_10_1 }; }
5583
5605
  finally {
5584
5606
  try {
5585
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
5607
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
5586
5608
  }
5587
5609
  finally { if (e_10) throw e_10.error; }
5588
5610
  }
5589
5611
  var extendedFormData = this.formFields.reduce(function (result, field, index) {
5590
- var _k;
5612
+ var _o;
5591
5613
  if (field.isFormElement && !field.hidden) {
5592
- var fieldData = (_k = {},
5593
- _k[field.key] = {
5614
+ var fieldData = (_o = {},
5615
+ _o[field.key] = {
5594
5616
  key: field.key,
5595
5617
  label: field.label,
5596
5618
  value: kwikidToolkit.isEmptyValue(formData[field.key]) ? "" : formData[field.key],
5597
5619
  type: field.type,
5598
5620
  index: index
5599
5621
  },
5600
- _k);
5622
+ _o);
5601
5623
  result[field.key] = fieldData[field.key];
5602
5624
  }
5603
5625
  return result;
@@ -5610,11 +5632,11 @@
5610
5632
  };
5611
5633
  // DOM Event Handlers
5612
5634
  KwikIDFormViewComponent.prototype.handleGetKeyValue = function (e) {
5613
- var _k;
5635
+ var _o;
5614
5636
  var _this = this;
5615
- this.formGroup.patchValue((_k = {},
5616
- _k[e.key] = e.value,
5617
- _k), { emitEvent: false });
5637
+ this.formGroup.patchValue((_o = {},
5638
+ _o[e.key] = e.value,
5639
+ _o), { emitEvent: false });
5618
5640
  var field = getFormFieldByKey(this.formFields, e.key);
5619
5641
  this.formData[e.key] = convertFormFieldValueToStandardFormat(field, e.value);
5620
5642
  this.getUnsavedDataState.emit(true);
@@ -5630,11 +5652,11 @@
5630
5652
  ALL_FORMS_DATA: this.allFormsData
5631
5653
  }, this.takeAction.bind(this));
5632
5654
  (function () { return __awaiter(_this, void 0, void 0, function () {
5633
- return __generator(this, function (_k) {
5634
- switch (_k.label) {
5655
+ return __generator(this, function (_o) {
5656
+ switch (_o.label) {
5635
5657
  case 0: return [4 /*yield*/, validations_6.validate(field.validation)];
5636
5658
  case 1:
5637
- _k.sent();
5659
+ _o.sent();
5638
5660
  return [2 /*return*/];
5639
5661
  }
5640
5662
  });
@@ -5653,27 +5675,27 @@
5653
5675
  return __awaiter(this, void 0, void 0, function () {
5654
5676
  var resetFormFields, BYPASS_RESET_CONFIRM, CONFIRM_RESET;
5655
5677
  var _this = this;
5656
- return __generator(this, function (_k) {
5678
+ return __generator(this, function (_o) {
5657
5679
  resetFormFields = function () { return __awaiter(_this, void 0, void 0, function () {
5658
- var _k, _l, f, _m, _o, action, resetField, actions, e_11_1, e_12_1;
5659
- var e_12, _p, e_11, _q;
5660
- return __generator(this, function (_r) {
5661
- 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) {
5662
5684
  case 0:
5663
- _r.trys.push([0, 11, 12, 13]);
5664
- _k = __values(field.reset.fields), _l = _k.next();
5665
- _r.label = 1;
5685
+ _u.trys.push([0, 11, 12, 13]);
5686
+ _o = __values(field.reset.fields), _p = _o.next();
5687
+ _u.label = 1;
5666
5688
  case 1:
5667
- if (!!_l.done) return [3 /*break*/, 10];
5668
- f = _l.value;
5669
- _r.label = 2;
5689
+ if (!!_p.done) return [3 /*break*/, 10];
5690
+ f = _p.value;
5691
+ _u.label = 2;
5670
5692
  case 2:
5671
- _r.trys.push([2, 7, 8, 9]);
5672
- _m = (e_11 = void 0, __values(f.actions)), _o = _m.next();
5673
- _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;
5674
5696
  case 3:
5675
- if (!!_o.done) return [3 /*break*/, 6];
5676
- action = _o.value;
5697
+ if (!!_r.done) return [3 /*break*/, 6];
5698
+ action = _r.value;
5677
5699
  resetField = getFormFieldByKey(this.formFields, action.props.fieldKey);
5678
5700
  actions = new kwikidToolkit.Action(action, {}, {
5679
5701
  FIELD_CONFIG: resetField,
@@ -5685,33 +5707,33 @@
5685
5707
  }, this.takeAction.bind(this));
5686
5708
  return [4 /*yield*/, actions.execute()];
5687
5709
  case 4:
5688
- _r.sent();
5689
- _r.label = 5;
5710
+ _u.sent();
5711
+ _u.label = 5;
5690
5712
  case 5:
5691
- _o = _m.next();
5713
+ _r = _q.next();
5692
5714
  return [3 /*break*/, 3];
5693
5715
  case 6: return [3 /*break*/, 9];
5694
5716
  case 7:
5695
- e_11_1 = _r.sent();
5717
+ e_11_1 = _u.sent();
5696
5718
  e_11 = { error: e_11_1 };
5697
5719
  return [3 /*break*/, 9];
5698
5720
  case 8:
5699
5721
  try {
5700
- if (_o && !_o.done && (_q = _m.return)) _q.call(_m);
5722
+ if (_r && !_r.done && (_t = _q.return)) _t.call(_q);
5701
5723
  }
5702
5724
  finally { if (e_11) throw e_11.error; }
5703
5725
  return [7 /*endfinally*/];
5704
5726
  case 9:
5705
- _l = _k.next();
5727
+ _p = _o.next();
5706
5728
  return [3 /*break*/, 1];
5707
5729
  case 10: return [3 /*break*/, 13];
5708
5730
  case 11:
5709
- e_12_1 = _r.sent();
5731
+ e_12_1 = _u.sent();
5710
5732
  e_12 = { error: e_12_1 };
5711
5733
  return [3 /*break*/, 13];
5712
5734
  case 12:
5713
5735
  try {
5714
- if (_l && !_l.done && (_p = _k.return)) _p.call(_k);
5736
+ if (_p && !_p.done && (_s = _o.return)) _s.call(_o);
5715
5737
  }
5716
5738
  finally { if (e_12) throw e_12.error; }
5717
5739
  return [7 /*endfinally*/];
@@ -5736,9 +5758,9 @@
5736
5758
  KwikIDFormViewComponent.prototype.handleFieldApiCall = function (field, api) {
5737
5759
  return __awaiter(this, void 0, void 0, function () {
5738
5760
  var apis;
5739
- var _k, _l;
5740
- return __generator(this, function (_m) {
5741
- switch (_m.label) {
5761
+ var _o, _p;
5762
+ return __generator(this, function (_q) {
5763
+ switch (_q.label) {
5742
5764
  case 0: return [4 /*yield*/, this.executeApiCall(api, {
5743
5765
  FIELD_CONFIG: field,
5744
5766
  API_CONFIG: api,
@@ -5749,13 +5771,13 @@
5749
5771
  ALL_FORMS_DATA: this.allFormsData
5750
5772
  })];
5751
5773
  case 1:
5752
- api = _m.sent();
5774
+ api = _q.sent();
5753
5775
  if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 3];
5754
5776
  if (kwikidToolkit.checkObjectKeyExists(field.api, "request")) {
5755
- this.formData = Object.assign(Object.assign({}, this.formData), (_k = {}, _k[field.key] = api.response.value, _k));
5756
- this.formGroup.patchValue((_l = {},
5757
- _l[field.key] = api.response.value,
5758
- _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 });
5759
5781
  }
5760
5782
  apis = new Apis({
5761
5783
  FIELD_CONFIG: field,
@@ -5769,14 +5791,14 @@
5769
5791
  }, this.takeAction.bind(this));
5770
5792
  return [4 /*yield*/, apis.validateResponse()];
5771
5793
  case 2:
5772
- api = _m.sent();
5794
+ api = _q.sent();
5773
5795
  return [3 /*break*/, 4];
5774
5796
  case 3:
5775
5797
  setTimeout(function () {
5776
5798
  field["api"]["status"]["value"] = EApiStatusType.FAILED;
5777
5799
  field["showLoader"] = false;
5778
5800
  }, 500);
5779
- _m.label = 4;
5801
+ _q.label = 4;
5780
5802
  case 4: return [2 /*return*/, { field: field, api: api }];
5781
5803
  }
5782
5804
  });
@@ -5785,8 +5807,8 @@
5785
5807
  KwikIDFormViewComponent.prototype.handleApiCall = function (api) {
5786
5808
  return __awaiter(this, void 0, void 0, function () {
5787
5809
  var apis;
5788
- return __generator(this, function (_k) {
5789
- switch (_k.label) {
5810
+ return __generator(this, function (_o) {
5811
+ switch (_o.label) {
5790
5812
  case 0: return [4 /*yield*/, this.executeApiCall(api, {
5791
5813
  FORM_CONFIG: this.formConfig,
5792
5814
  API_CONFIG: api,
@@ -5797,7 +5819,7 @@
5797
5819
  ALL_FORMS_DATA: this.allFormsData
5798
5820
  })];
5799
5821
  case 1:
5800
- api = _k.sent();
5822
+ api = _o.sent();
5801
5823
  apis = new Apis({
5802
5824
  FORM_CONFIG: this.formConfig,
5803
5825
  API_CONFIG: api,
@@ -5810,38 +5832,38 @@
5810
5832
  if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 3];
5811
5833
  return [4 /*yield*/, apis.validateResponse()];
5812
5834
  case 2:
5813
- api = _k.sent();
5814
- _k.label = 3;
5835
+ api = _o.sent();
5836
+ _o.label = 3;
5815
5837
  case 3: return [2 /*return*/, { api: api }];
5816
5838
  }
5817
5839
  });
5818
5840
  });
5819
5841
  };
5820
5842
  KwikIDFormViewComponent.prototype.executeApiCall = function (api, object) {
5821
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5843
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
5822
5844
  return __awaiter(this, void 0, void 0, function () {
5823
- var apis, apiCallResponse, apiCallResponseStatusCode, url, method, headers, body, response, err_1, response, err_2;
5824
- return __generator(this, function (_k) {
5825
- 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) {
5826
5848
  case 0:
5827
5849
  apis = new Apis(object, this.takeAction.bind(this));
5828
5850
  return [4 /*yield*/, apis.setUrl()];
5829
5851
  case 1:
5830
- api = _k.sent();
5852
+ api = _o.sent();
5831
5853
  return [4 /*yield*/, apis.setRequestHeaders()];
5832
5854
  case 2:
5833
- api = _k.sent();
5855
+ api = _o.sent();
5834
5856
  return [4 /*yield*/, apis.validateRequestHeaders()];
5835
5857
  case 3:
5836
- api = _k.sent();
5858
+ api = _o.sent();
5837
5859
  return [4 /*yield*/, apis.setRequestBody()];
5838
5860
  case 4:
5839
- api = _k.sent();
5861
+ api = _o.sent();
5840
5862
  return [4 /*yield*/, apis.validateRequestBody()];
5841
5863
  case 5:
5842
- api = _k.sent();
5864
+ api = _o.sent();
5843
5865
  apiCallResponse = {};
5844
- if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 18];
5866
+ if (!this.isValidRequestHeadersAndBody(api)) return [3 /*break*/, 22];
5845
5867
  if (!(api.request.url.hasOwnProperty("type") &&
5846
5868
  api.request.url.type === EApiRequestUrlType.MOCK)) return [3 /*break*/, 7];
5847
5869
  return [4 /*yield*/, new Promise(function (resolve) {
@@ -5850,53 +5872,69 @@
5850
5872
  }, 1000); // 1000 ms = 1 sec
5851
5873
  })];
5852
5874
  case 6:
5853
- apiCallResponse = _k.sent();
5875
+ apiCallResponse = _o.sent();
5854
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
5855
- return [3 /*break*/, 17];
5877
+ return [3 /*break*/, 21];
5856
5878
  case 7:
5857
5879
  url = api.request.url.value;
5858
5880
  method = (_d = (_c = api.request) === null || _c === void 0 ? void 0 : _c.method) !== null && _d !== void 0 ? _d : "POST";
5859
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) || {}));
5860
- 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;
5861
5882
  if (!(method === "GET")) return [3 /*break*/, 13];
5862
- _k.label = 8;
5883
+ _o.label = 8;
5863
5884
  case 8:
5864
- _k.trys.push([8, 11, , 12]);
5885
+ _o.trys.push([8, 11, , 12]);
5865
5886
  return [4 /*yield*/, fetch(url, {
5866
5887
  method: method,
5867
5888
  headers: Object.assign({}, headers)
5868
5889
  })];
5869
5890
  case 9:
5870
- response = _k.sent();
5891
+ response = _o.sent();
5871
5892
  return [4 /*yield*/, response.json()];
5872
5893
  case 10:
5873
- apiCallResponse = _k.sent();
5894
+ apiCallResponse = _o.sent();
5874
5895
  apiCallResponseStatusCode = response.status;
5875
5896
  return [3 /*break*/, 12];
5876
5897
  case 11:
5877
- err_1 = _k.sent();
5898
+ err_1 = _o.sent();
5878
5899
  apiCallResponse = {};
5879
5900
  return [3 /*break*/, 12];
5880
- case 12: return [3 /*break*/, 17];
5901
+ case 12: return [3 /*break*/, 21];
5881
5902
  case 13:
5882
- _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]);
5883
5911
  return [4 /*yield*/, fetch(url, {
5884
5912
  method: method,
5885
5913
  headers: Object.assign({}, headers),
5886
- body: JSON.stringify(body)
5914
+ body: body
5887
5915
  })];
5888
- case 14:
5889
- response = _k.sent();
5890
- return [4 /*yield*/, response.json()];
5891
5916
  case 15:
5892
- apiCallResponse = _k.sent();
5893
- apiCallResponseStatusCode = response.status;
5894
- 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()];
5895
5921
  case 16:
5896
- 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();
5897
5935
  apiCallResponse = {};
5898
- return [3 /*break*/, 17];
5899
- case 17:
5936
+ return [3 /*break*/, 21];
5937
+ case 21:
5900
5938
  api.response = kwikidToolkit.setValueToObjectPath(api.response, "value", apiCallResponse);
5901
5939
  api.response = kwikidToolkit.setValueToObjectPath(api.response, "status", apiCallResponseStatusCode);
5902
5940
  this.getLogs.emit({
@@ -5907,8 +5945,8 @@
5907
5945
  response: api.response
5908
5946
  }
5909
5947
  });
5910
- _k.label = 18;
5911
- case 18: return [2 /*return*/, api];
5948
+ _o.label = 22;
5949
+ case 22: return [2 /*return*/, api];
5912
5950
  }
5913
5951
  });
5914
5952
  });
@@ -5945,8 +5983,8 @@
5945
5983
  KwikIDFormViewComponent.prototype.handleOnClickApiCall = function (e) {
5946
5984
  return __awaiter(this, void 0, void 0, function () {
5947
5985
  var field, apis;
5948
- return __generator(this, function (_k) {
5949
- switch (_k.label) {
5986
+ return __generator(this, function (_o) {
5987
+ switch (_o.label) {
5950
5988
  case 0:
5951
5989
  field = getFormFieldByKey(this.formFields, e.key);
5952
5990
  if (!(field.type === EFieldType.API)) return [3 /*break*/, 5];
@@ -5957,7 +5995,7 @@
5957
5995
  if (!kwikidToolkit.checkObjectKeyExists(field.api, "request")) return [3 /*break*/, 2];
5958
5996
  return [4 /*yield*/, this.handleFieldApiCall(field, field.api)];
5959
5997
  case 1:
5960
- _k.sent();
5998
+ _o.sent();
5961
5999
  return [3 /*break*/, 4];
5962
6000
  case 2:
5963
6001
  apis = new Apis({
@@ -5971,11 +6009,11 @@
5971
6009
  }, this.takeAction.bind(this));
5972
6010
  return [4 /*yield*/, apis.callNextApi(field.api.entrypoint)];
5973
6011
  case 3:
5974
- _k.sent();
5975
- _k.label = 4;
6012
+ _o.sent();
6013
+ _o.label = 4;
5976
6014
  case 4:
5977
6015
  this.hideApiLoader();
5978
- _k.label = 5;
6016
+ _o.label = 5;
5979
6017
  case 5: return [2 /*return*/];
5980
6018
  }
5981
6019
  });
@@ -6020,11 +6058,11 @@
6020
6058
  };
6021
6059
  KwikIDFormViewComponent.prototype.handleOnClickSaveForm = function (e) {
6022
6060
  return __awaiter(this, void 0, void 0, function () {
6023
- 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;
6024
- 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;
6025
6063
  var _this = this;
6026
- return __generator(this, function (_v) {
6027
- switch (_v.label) {
6064
+ return __generator(this, function (_y) {
6065
+ switch (_y.label) {
6028
6066
  case 0:
6029
6067
  controls = new FormValidation().getFormFieldsInvalidControls(this.formGroup);
6030
6068
  firstFieldWithError = "";
@@ -6040,7 +6078,7 @@
6040
6078
  catch (e_15_1) { e_15 = { error: e_15_1 }; }
6041
6079
  finally {
6042
6080
  try {
6043
- 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);
6044
6082
  }
6045
6083
  finally { if (e_15) throw e_15.error; }
6046
6084
  }
@@ -6051,14 +6089,14 @@
6051
6089
  }, 3000);
6052
6090
  return [2 /*return*/];
6053
6091
  }
6054
- _v.label = 1;
6092
+ _y.label = 1;
6055
6093
  case 1:
6056
- _v.trys.push([1, 6, 7, 8]);
6057
- _k = __values(this.formFields), _l = _k.next();
6058
- _v.label = 2;
6094
+ _y.trys.push([1, 6, 7, 8]);
6095
+ _o = __values(this.formFields), _p = _o.next();
6096
+ _y.label = 2;
6059
6097
  case 2:
6060
- if (!!_l.done) return [3 /*break*/, 5];
6061
- field = _l.value;
6098
+ if (!!_p.done) return [3 /*break*/, 5];
6099
+ field = _p.value;
6062
6100
  if (!(field.isFormElement &&
6063
6101
  !field.hidden &&
6064
6102
  kwikidToolkit.checkObjectKeyExists(field, "validation") &&
@@ -6073,7 +6111,7 @@
6073
6111
  }, this.takeAction.bind(this));
6074
6112
  return [4 /*yield*/, validations.validate(field.validation)];
6075
6113
  case 3:
6076
- _v.sent();
6114
+ _y.sent();
6077
6115
  if (!field.validation.is_valid) {
6078
6116
  this.toggleErrorNotification(true);
6079
6117
  setTimeout(function () {
@@ -6081,26 +6119,26 @@
6081
6119
  }, 3000);
6082
6120
  return [2 /*return*/];
6083
6121
  }
6084
- _v.label = 4;
6122
+ _y.label = 4;
6085
6123
  case 4:
6086
- _l = _k.next();
6124
+ _p = _o.next();
6087
6125
  return [3 /*break*/, 2];
6088
6126
  case 5: return [3 /*break*/, 8];
6089
6127
  case 6:
6090
- e_13_1 = _v.sent();
6128
+ e_13_1 = _y.sent();
6091
6129
  e_13 = { error: e_13_1 };
6092
6130
  return [3 /*break*/, 8];
6093
6131
  case 7:
6094
6132
  try {
6095
- if (_l && !_l.done && (_s = _k.return)) _s.call(_k);
6133
+ if (_p && !_p.done && (_v = _o.return)) _v.call(_o);
6096
6134
  }
6097
6135
  finally { if (e_13) throw e_13.error; }
6098
6136
  return [7 /*endfinally*/];
6099
6137
  case 8:
6100
6138
  formData = this.formGroup.getRawValue();
6101
6139
  try {
6102
- for (_m = __values(this.formFields), _o = _m.next(); !_o.done; _o = _m.next()) {
6103
- field = _o.value;
6140
+ for (_q = __values(this.formFields), _r = _q.next(); !_r.done; _r = _q.next()) {
6141
+ field = _r.value;
6104
6142
  if (field.isFormElement) {
6105
6143
  if (field.hidden) {
6106
6144
  delete formData[field.key];
@@ -6114,22 +6152,22 @@
6114
6152
  catch (e_16_1) { e_16 = { error: e_16_1 }; }
6115
6153
  finally {
6116
6154
  try {
6117
- if (_o && !_o.done && (_t = _m.return)) _t.call(_m);
6155
+ if (_r && !_r.done && (_w = _q.return)) _w.call(_q);
6118
6156
  }
6119
6157
  finally { if (e_16) throw e_16.error; }
6120
6158
  }
6121
6159
  extendedFormData = this.formFields.reduce(function (result, field, index) {
6122
- var _k;
6160
+ var _o;
6123
6161
  if (field.isFormElement && !field.hidden) {
6124
- var fieldData = (_k = {},
6125
- _k[field.key] = {
6162
+ var fieldData = (_o = {},
6163
+ _o[field.key] = {
6126
6164
  key: field.key,
6127
6165
  label: field.label,
6128
6166
  value: kwikidToolkit.isEmptyValue(formData[field.key]) ? "" : formData[field.key],
6129
6167
  type: field.type,
6130
6168
  index: index
6131
6169
  },
6132
- _k);
6170
+ _o);
6133
6171
  result[field.key] = fieldData[field.key];
6134
6172
  }
6135
6173
  return result;
@@ -6141,14 +6179,14 @@
6141
6179
  });
6142
6180
  if (!(kwikidToolkit.checkObjectKeyExists(this.formConfig, "tasks") &&
6143
6181
  kwikidToolkit.checkObjectKeyExists(this.formConfig.tasks, "post"))) return [3 /*break*/, 18];
6144
- _v.label = 9;
6182
+ _y.label = 9;
6145
6183
  case 9:
6146
- _v.trys.push([9, 15, 16, 17]);
6147
- _p = __values(this.formConfig.tasks.post), _q = _p.next();
6148
- _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;
6149
6187
  case 10:
6150
- if (!!_q.done) return [3 /*break*/, 14];
6151
- postTask = _q.value;
6188
+ if (!!_t.done) return [3 /*break*/, 14];
6189
+ postTask = _t.value;
6152
6190
  task = new Tasks(postTask, {
6153
6191
  FORM_CONFIG: this.formConfig,
6154
6192
  FORM_FIELDS: this.formFields,
@@ -6166,7 +6204,7 @@
6166
6204
  }
6167
6205
  return [4 /*yield*/, task.execute()];
6168
6206
  case 11:
6169
- _v.sent();
6207
+ _y.sent();
6170
6208
  // Wait for ngOnChanges to be called before continuing to the next task
6171
6209
  return [4 /*yield*/, new Promise(function (resolve) {
6172
6210
  var intervalId = setInterval(function () {
@@ -6178,22 +6216,22 @@
6178
6216
  })];
6179
6217
  case 12:
6180
6218
  // Wait for ngOnChanges to be called before continuing to the next task
6181
- _v.sent();
6219
+ _y.sent();
6182
6220
  if (this.stopTaskExecution) {
6183
6221
  return [3 /*break*/, 14];
6184
6222
  }
6185
- _v.label = 13;
6223
+ _y.label = 13;
6186
6224
  case 13:
6187
- _q = _p.next();
6225
+ _t = _s.next();
6188
6226
  return [3 /*break*/, 10];
6189
6227
  case 14: return [3 /*break*/, 17];
6190
6228
  case 15:
6191
- e_14_1 = _v.sent();
6229
+ e_14_1 = _y.sent();
6192
6230
  e_14 = { error: e_14_1 };
6193
6231
  return [3 /*break*/, 17];
6194
6232
  case 16:
6195
6233
  try {
6196
- if (_q && !_q.done && (_u = _p.return)) _u.call(_p);
6234
+ if (_t && !_t.done && (_x = _s.return)) _x.call(_s);
6197
6235
  }
6198
6236
  finally { if (e_14) throw e_14.error; }
6199
6237
  return [7 /*endfinally*/];
@@ -6215,7 +6253,7 @@
6215
6253
  data: kwikidToolkit.mergeObjects(formData, this.popupFormData, this.taskData),
6216
6254
  extendedData: extendedFormData
6217
6255
  });
6218
- _v.label = 19;
6256
+ _y.label = 19;
6219
6257
  case 19: return [2 /*return*/];
6220
6258
  }
6221
6259
  });
@@ -6234,17 +6272,17 @@
6234
6272
  this.formGroup.updateValueAndValidity();
6235
6273
  };
6236
6274
  KwikIDFormViewComponent.prototype.fieldGroupHide = function (fieldGroup) {
6237
- var e_17, _k;
6275
+ var e_17, _o;
6238
6276
  try {
6239
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6240
- 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;
6241
6279
  this.fieldHide(fieldKey);
6242
6280
  }
6243
6281
  }
6244
6282
  catch (e_17_1) { e_17 = { error: e_17_1 }; }
6245
6283
  finally {
6246
6284
  try {
6247
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6285
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6248
6286
  }
6249
6287
  finally { if (e_17) throw e_17.error; }
6250
6288
  }
@@ -6258,17 +6296,17 @@
6258
6296
  this.formGroup.updateValueAndValidity();
6259
6297
  };
6260
6298
  KwikIDFormViewComponent.prototype.fieldGroupShow = function (fieldGroup) {
6261
- var e_18, _k;
6299
+ var e_18, _o;
6262
6300
  try {
6263
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6264
- 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;
6265
6303
  this.fieldShow(fieldKey);
6266
6304
  }
6267
6305
  }
6268
6306
  catch (e_18_1) { e_18 = { error: e_18_1 }; }
6269
6307
  finally {
6270
6308
  try {
6271
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6309
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6272
6310
  }
6273
6311
  finally { if (e_18) throw e_18.error; }
6274
6312
  }
@@ -6292,17 +6330,17 @@
6292
6330
  }
6293
6331
  };
6294
6332
  KwikIDFormViewComponent.prototype.fieldGroupDisable = function (fieldGroup) {
6295
- var e_19, _k;
6333
+ var e_19, _o;
6296
6334
  try {
6297
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6298
- 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;
6299
6337
  this.fieldDisable(fieldKey);
6300
6338
  }
6301
6339
  }
6302
6340
  catch (e_19_1) { e_19 = { error: e_19_1 }; }
6303
6341
  finally {
6304
6342
  try {
6305
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6343
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6306
6344
  }
6307
6345
  finally { if (e_19) throw e_19.error; }
6308
6346
  }
@@ -6326,23 +6364,23 @@
6326
6364
  }
6327
6365
  };
6328
6366
  KwikIDFormViewComponent.prototype.fieldGroupEnable = function (fieldGroup) {
6329
- var e_20, _k;
6367
+ var e_20, _o;
6330
6368
  try {
6331
- for (var _l = __values(this.fieldGroups[fieldGroup]), _m = _l.next(); !_m.done; _m = _l.next()) {
6332
- 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;
6333
6371
  this.fieldEnable(fieldKey);
6334
6372
  }
6335
6373
  }
6336
6374
  catch (e_20_1) { e_20 = { error: e_20_1 }; }
6337
6375
  finally {
6338
6376
  try {
6339
- if (_m && !_m.done && (_k = _l.return)) _k.call(_l);
6377
+ if (_q && !_q.done && (_o = _p.return)) _o.call(_p);
6340
6378
  }
6341
6379
  finally { if (e_20) throw e_20.error; }
6342
6380
  }
6343
6381
  };
6344
6382
  KwikIDFormViewComponent.prototype.fieldReset = function (fieldKey) {
6345
- var _k;
6383
+ var _o;
6346
6384
  // Find the field and its index in the formFields array
6347
6385
  var field = getFormFieldByKey(this.formFields, fieldKey);
6348
6386
  var fieldIndex = getFormFieldIndexByKey(this.formFields, fieldKey);
@@ -6353,9 +6391,9 @@
6353
6391
  emitEvent: false,
6354
6392
  onlySelf: true
6355
6393
  });
6356
- this.formGroup.patchValue((_k = {},
6357
- _k[field.key] = resetValue,
6358
- _k), { emitEvent: false });
6394
+ this.formGroup.patchValue((_o = {},
6395
+ _o[field.key] = resetValue,
6396
+ _o), { emitEvent: false });
6359
6397
  this.formGroup.controls[field.key].updateValueAndValidity({
6360
6398
  emitEvent: true
6361
6399
  });
@@ -6423,13 +6461,13 @@
6423
6461
  KwikIDFormViewComponent.prototype.setValue = function (action, object) {
6424
6462
  return __awaiter(this, void 0, void 0, function () {
6425
6463
  var source, sourceValue;
6426
- return __generator(this, function (_k) {
6427
- switch (_k.label) {
6464
+ return __generator(this, function (_o) {
6465
+ switch (_o.label) {
6428
6466
  case 0:
6429
6467
  source = new kwikidToolkit.Source(object);
6430
6468
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
6431
6469
  case 1:
6432
- sourceValue = _k.sent();
6470
+ sourceValue = _o.sent();
6433
6471
  source.setValueToSource(action.props.value.destination, sourceValue);
6434
6472
  object.FIELD_CONFIG = source.object.FIELD_CONFIG;
6435
6473
  this.formData = source.object.FORM_DATA;
@@ -6444,13 +6482,13 @@
6444
6482
  KwikIDFormViewComponent.prototype.setFieldDefaultValue = function (action, object) {
6445
6483
  return __awaiter(this, void 0, void 0, function () {
6446
6484
  var source, sourceValue;
6447
- return __generator(this, function (_k) {
6448
- switch (_k.label) {
6485
+ return __generator(this, function (_o) {
6486
+ switch (_o.label) {
6449
6487
  case 0:
6450
6488
  source = new kwikidToolkit.Source(object);
6451
6489
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
6452
6490
  case 1:
6453
- sourceValue = _k.sent();
6491
+ sourceValue = _o.sent();
6454
6492
  source.setValueToSource({
6455
6493
  key: kwikidToolkit.ESourceKey.OBJECT,
6456
6494
  props: {
@@ -6482,7 +6520,7 @@
6482
6520
  KwikIDFormViewComponent.prototype.setApiStatus = function (action, object) {
6483
6521
  return __awaiter(this, void 0, void 0, function () {
6484
6522
  var source, sourceValue;
6485
- return __generator(this, function (_k) {
6523
+ return __generator(this, function (_o) {
6486
6524
  source = new kwikidToolkit.Source(object);
6487
6525
  sourceValue = action.props.status;
6488
6526
  source.setValueToSource({
@@ -6502,13 +6540,13 @@
6502
6540
  KwikIDFormViewComponent.prototype.setApiHeaderValue = function (action, object) {
6503
6541
  return __awaiter(this, void 0, void 0, function () {
6504
6542
  var source, sourceValue;
6505
- return __generator(this, function (_k) {
6506
- switch (_k.label) {
6543
+ return __generator(this, function (_o) {
6544
+ switch (_o.label) {
6507
6545
  case 0:
6508
6546
  source = new kwikidToolkit.Source(object);
6509
6547
  return [4 /*yield*/, source.getValueFromSource(action.props.source)];
6510
6548
  case 1:
6511
- sourceValue = _k.sent();
6549
+ sourceValue = _o.sent();
6512
6550
  source.setValueToSource({
6513
6551
  key: kwikidToolkit.ESourceKey.OBJECT,
6514
6552
  props: {
@@ -6527,7 +6565,7 @@
6527
6565
  KwikIDFormViewComponent.prototype.setApiHeaderValidity = function (action, object) {
6528
6566
  return __awaiter(this, void 0, void 0, function () {
6529
6567
  var source, sourceValue;
6530
- return __generator(this, function (_k) {
6568
+ return __generator(this, function (_o) {
6531
6569
  source = new kwikidToolkit.Source(object);
6532
6570
  sourceValue = action.props.valid;
6533
6571
  source.setValueToSource({
@@ -6547,13 +6585,13 @@
6547
6585
  KwikIDFormViewComponent.prototype.setApiBodyValue = function (action, object) {
6548
6586
  return __awaiter(this, void 0, void 0, function () {
6549
6587
  var source, sourceValue;
6550
- return __generator(this, function (_k) {
6551
- switch (_k.label) {
6588
+ return __generator(this, function (_o) {
6589
+ switch (_o.label) {
6552
6590
  case 0:
6553
6591
  source = new kwikidToolkit.Source(object);
6554
6592
  return [4 /*yield*/, source.getValueFromSource(action.props.source)];
6555
6593
  case 1:
6556
- sourceValue = _k.sent();
6594
+ sourceValue = _o.sent();
6557
6595
  source.setValueToSource({
6558
6596
  key: kwikidToolkit.ESourceKey.OBJECT,
6559
6597
  props: {
@@ -6572,7 +6610,7 @@
6572
6610
  KwikIDFormViewComponent.prototype.setApiBodyValidity = function (action, object) {
6573
6611
  return __awaiter(this, void 0, void 0, function () {
6574
6612
  var source, sourceValue;
6575
- return __generator(this, function (_k) {
6613
+ return __generator(this, function (_o) {
6576
6614
  source = new kwikidToolkit.Source(object);
6577
6615
  sourceValue = action.props.valid;
6578
6616
  source.setValueToSource({
@@ -6592,7 +6630,7 @@
6592
6630
  KwikIDFormViewComponent.prototype.setFieldValidity = function (action, object) {
6593
6631
  return __awaiter(this, void 0, void 0, function () {
6594
6632
  var source, sourceValue;
6595
- return __generator(this, function (_k) {
6633
+ return __generator(this, function (_o) {
6596
6634
  source = new kwikidToolkit.Source(object);
6597
6635
  sourceValue = action.props.valid;
6598
6636
  source.setValueToSource({
@@ -6612,18 +6650,18 @@
6612
6650
  KwikIDFormViewComponent.prototype.setDropdownOptions = function (action, object) {
6613
6651
  return __awaiter(this, void 0, void 0, function () {
6614
6652
  var source, sourceValue, appendToPath, appendToPathStr, optionsPath;
6615
- return __generator(this, function (_k) {
6616
- switch (_k.label) {
6653
+ return __generator(this, function (_o) {
6654
+ switch (_o.label) {
6617
6655
  case 0:
6618
6656
  source = new kwikidToolkit.Source(object);
6619
6657
  return [4 /*yield*/, source.getValueFromSource(action.props.value.source)];
6620
6658
  case 1:
6621
- sourceValue = _k.sent();
6659
+ sourceValue = _o.sent();
6622
6660
  if (!kwikidToolkit.checkObjectKeyExists(action.props, "options")) return [3 /*break*/, 4];
6623
6661
  if (!kwikidToolkit.checkObjectKeyExists(action.props.options, "appendToPath")) return [3 /*break*/, 3];
6624
6662
  return [4 /*yield*/, source.getValueFromSource(action.props.options.appendToPath.source)];
6625
6663
  case 2:
6626
- appendToPath = _k.sent();
6664
+ appendToPath = _o.sent();
6627
6665
  if (kwikidToolkit.isNotEmptyValue(appendToPath)) {
6628
6666
  appendToPathStr = kwikidToolkit.replaceString(appendToPath.match("" + action.props.options.appendToPath.filterSourceValue)[0], "[^a-zA-Z0-9_]", "_");
6629
6667
  optionsPath = "" + action.props.options.path + appendToPathStr;
@@ -6632,7 +6670,7 @@
6632
6670
  return [3 /*break*/, 4];
6633
6671
  case 3:
6634
6672
  sourceValue = kwikidToolkit.getObjectValueFromPath(sourceValue, action.props.options.path);
6635
- _k.label = 4;
6673
+ _o.label = 4;
6636
6674
  case 4:
6637
6675
  source.setValueToSource(action.props.value.destination, sourceValue);
6638
6676
  object.FIELD_CONFIG = source.object.FIELD_CONFIG;
@@ -6647,19 +6685,19 @@
6647
6685
  KwikIDFormViewComponent.prototype.apiCall = function (action, object) {
6648
6686
  return __awaiter(this, void 0, void 0, function () {
6649
6687
  var apiConfig, response;
6650
- var _k;
6651
- return __generator(this, function (_l) {
6652
- switch (_l.label) {
6688
+ var _o;
6689
+ return __generator(this, function (_p) {
6690
+ switch (_p.label) {
6653
6691
  case 0:
6654
6692
  apiConfig = this.formConfig.apis[action.props.formApiKey];
6655
6693
  return [4 /*yield*/, this.handleApiCall(apiConfig)];
6656
6694
  case 1:
6657
- response = _l.sent();
6695
+ response = _p.sent();
6658
6696
  apiConfig = response.api;
6659
6697
  this.formConfig = kwikidToolkit.setValueToObjectPath(this.formConfig, "apis." + action.props.formApiKey, apiConfig);
6660
- this.formData = kwikidToolkit.mergeObjects(this.formData, (_k = {},
6661
- _k[action.props.formApiKey] = apiConfig.response.value,
6662
- _k));
6698
+ this.formData = kwikidToolkit.mergeObjects(this.formData, (_o = {},
6699
+ _o[action.props.formApiKey] = apiConfig.response.value,
6700
+ _o));
6663
6701
  return [2 /*return*/, apiConfig];
6664
6702
  }
6665
6703
  });
@@ -6668,13 +6706,13 @@
6668
6706
  KwikIDFormViewComponent.prototype.fieldApiCall = function (action, object) {
6669
6707
  return __awaiter(this, void 0, void 0, function () {
6670
6708
  var apiConfig;
6671
- return __generator(this, function (_k) {
6672
- switch (_k.label) {
6709
+ return __generator(this, function (_o) {
6710
+ switch (_o.label) {
6673
6711
  case 0:
6674
6712
  this.showApiLoader();
6675
6713
  return [4 /*yield*/, this.apiCall(action, object)];
6676
6714
  case 1:
6677
- apiConfig = _k.sent();
6715
+ apiConfig = _o.sent();
6678
6716
  this.hideApiLoader();
6679
6717
  return [2 /*return*/];
6680
6718
  }
@@ -6684,8 +6722,8 @@
6684
6722
  KwikIDFormViewComponent.prototype.fieldMultipleApiCalls = function (action, object) {
6685
6723
  return __awaiter(this, void 0, void 0, function () {
6686
6724
  var entrypointApiKey, field, endpoints, nextApiIndex, apiConfig, response;
6687
- return __generator(this, function (_k) {
6688
- switch (_k.label) {
6725
+ return __generator(this, function (_o) {
6726
+ switch (_o.label) {
6689
6727
  case 0:
6690
6728
  entrypointApiKey = action.props.apiKey;
6691
6729
  field = getFormFieldByKey(this.formFields, action.props.fieldKey);
@@ -6694,7 +6732,7 @@
6694
6732
  apiConfig = endpoints[nextApiIndex];
6695
6733
  return [4 /*yield*/, this.handleFieldApiCall(field, apiConfig)];
6696
6734
  case 1:
6697
- response = _k.sent();
6735
+ response = _o.sent();
6698
6736
  field = response.field;
6699
6737
  field.api.endpoints[nextApiIndex] = response.api;
6700
6738
  return [2 /*return*/];
@@ -6705,15 +6743,15 @@
6705
6743
  KwikIDFormViewComponent.prototype.fieldMultipleApiCallsEnd = function (action, object) {
6706
6744
  return __awaiter(this, void 0, void 0, function () {
6707
6745
  var field, multipleApiCallResponses;
6708
- var _k;
6709
- return __generator(this, function (_l) {
6746
+ var _o;
6747
+ return __generator(this, function (_p) {
6710
6748
  field = getFormFieldByKey(this.formFields, action.props.fieldKey);
6711
6749
  multipleApiCallResponses = {};
6712
6750
  field.api.endpoints.map(function (api) {
6713
6751
  if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
6714
6752
  multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
6715
6753
  });
6716
- 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));
6717
6755
  this.patchFormGroup(this.formData);
6718
6756
  return [2 /*return*/];
6719
6757
  });
@@ -6722,17 +6760,17 @@
6722
6760
  KwikIDFormViewComponent.prototype.taskApiCall = function (action, object) {
6723
6761
  return __awaiter(this, void 0, void 0, function () {
6724
6762
  var apiConfig;
6725
- var _k;
6726
- return __generator(this, function (_l) {
6727
- switch (_l.label) {
6763
+ var _o;
6764
+ return __generator(this, function (_p) {
6765
+ switch (_p.label) {
6728
6766
  case 0:
6729
6767
  this.showApiLoader();
6730
6768
  return [4 /*yield*/, this.apiCall(action, object)];
6731
6769
  case 1:
6732
- apiConfig = _l.sent();
6733
- this.taskData = kwikidToolkit.mergeObjects(this.taskData, (_k = {},
6734
- _k[action.props.formApiKey] = apiConfig.response.value,
6735
- _k));
6770
+ apiConfig = _p.sent();
6771
+ this.taskData = kwikidToolkit.mergeObjects(this.taskData, (_o = {},
6772
+ _o[action.props.formApiKey] = apiConfig.response.value,
6773
+ _o));
6736
6774
  this.waitingForChanges = false;
6737
6775
  this.hideApiLoader();
6738
6776
  return [2 /*return*/];
@@ -6743,8 +6781,8 @@
6743
6781
  KwikIDFormViewComponent.prototype.taskMultipleApiCalls = function (action, object) {
6744
6782
  return __awaiter(this, void 0, void 0, function () {
6745
6783
  var multipleApiConfig, entrypointApiKey_1, endpoints, nextApiIndex, apiConfig, response, apis;
6746
- return __generator(this, function (_k) {
6747
- switch (_k.label) {
6784
+ return __generator(this, function (_o) {
6785
+ switch (_o.label) {
6748
6786
  case 0:
6749
6787
  this.showApiLoader();
6750
6788
  multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
@@ -6755,7 +6793,7 @@
6755
6793
  apiConfig = endpoints[nextApiIndex];
6756
6794
  return [4 /*yield*/, this.handleApiCall(apiConfig)];
6757
6795
  case 1:
6758
- response = _k.sent();
6796
+ response = _o.sent();
6759
6797
  multipleApiConfig.endpoints[nextApiIndex] = response.api;
6760
6798
  this.formConfig = kwikidToolkit.setValueToObjectPath(this.formConfig, "apis." + action.props.formApiKey, multipleApiConfig);
6761
6799
  this.hideApiLoader();
@@ -6772,8 +6810,8 @@
6772
6810
  }, this.takeAction.bind(this));
6773
6811
  return [4 /*yield*/, apis.callNextApi(multipleApiConfig.entrypoint)];
6774
6812
  case 3:
6775
- _k.sent();
6776
- _k.label = 4;
6813
+ _o.sent();
6814
+ _o.label = 4;
6777
6815
  case 4: return [2 /*return*/];
6778
6816
  }
6779
6817
  });
@@ -6782,15 +6820,15 @@
6782
6820
  KwikIDFormViewComponent.prototype.taskMultipleApiCallsEnd = function (action, object) {
6783
6821
  return __awaiter(this, void 0, void 0, function () {
6784
6822
  var multipleApiConfig, multipleApiCallResponses;
6785
- var _k;
6786
- return __generator(this, function (_l) {
6823
+ var _o;
6824
+ return __generator(this, function (_p) {
6787
6825
  multipleApiConfig = this.formConfig.apis[action.props.formApiKey];
6788
6826
  multipleApiCallResponses = {};
6789
6827
  multipleApiConfig.endpoints.map(function (api) {
6790
6828
  if (kwikidToolkit.checkObjectKeyExists(api.response, "value"))
6791
6829
  multipleApiCallResponses = kwikidToolkit.setValueToObjectPath(multipleApiCallResponses, "" + api.apiKey, api.response.value);
6792
6830
  });
6793
- 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));
6794
6832
  this.waitingForChanges = false;
6795
6833
  this.hideApiLoader();
6796
6834
  return [2 /*return*/];
@@ -6972,7 +7010,7 @@
6972
7010
  };
6973
7011
  KwikIDFormViewComponent.prototype.takeActionOnFieldGroup = function (action, object) {
6974
7012
  return __awaiter(this, void 0, void 0, function () {
6975
- return __generator(this, function (_k) {
7013
+ return __generator(this, function (_o) {
6976
7014
  switch (action.key) {
6977
7015
  case EActionKey.FIELD_GROUP_HIDE:
6978
7016
  this.fieldGroupHide(action.props.groupKey);
@@ -6996,12 +7034,12 @@
6996
7034
  KwikIDFormViewComponent.prototype.takeAction = function (action, object) {
6997
7035
  var _a, _b, _c, _d, _e, _f;
6998
7036
  return __awaiter(this, void 0, void 0, function () {
6999
- var _k, fieldErrorShow_Source, fieldErrorShowSourceValue, fieldErrorHide_Source, fieldErrorHideSourceValue, redirectToUrl_Source, redirectToUrlSourceValue, previewErrorShow_Source, previewErrorShowSourceValue;
7000
- return __generator(this, function (_l) {
7001
- 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) {
7002
7040
  case 0:
7003
- _k = action.key;
7004
- switch (_k) {
7041
+ _o = action.key;
7042
+ switch (_o) {
7005
7043
  case EActionKey.FIELD_HIDE: return [3 /*break*/, 1];
7006
7044
  case EActionKey.FIELD_SHOW: return [3 /*break*/, 2];
7007
7045
  case EActionKey.FIELD_DISABLE: return [3 /*break*/, 3];
@@ -7062,7 +7100,7 @@
7062
7100
  fieldErrorShow_Source = new kwikidToolkit.Source(object);
7063
7101
  return [4 /*yield*/, fieldErrorShow_Source.getValueFromSource(action.props.message.source)];
7064
7102
  case 7:
7065
- fieldErrorShowSourceValue = _l.sent();
7103
+ fieldErrorShowSourceValue = _p.sent();
7066
7104
  if (typeof fieldErrorShowSourceValue == "string" ||
7067
7105
  typeof fieldErrorShowSourceValue == "number") {
7068
7106
  fieldErrorShowSourceValue = String(fieldErrorShowSourceValue);
@@ -7071,7 +7109,7 @@
7071
7109
  fieldErrorShowSourceValue = "";
7072
7110
  }
7073
7111
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldErrorShowSourceValue);
7074
- _l.label = 8;
7112
+ _p.label = 8;
7075
7113
  case 8:
7076
7114
  action.props.message.message = updateLanguage(action.props.message.message, getLanguage());
7077
7115
  this.fieldErrorShow(action.props.fieldKey, action.props.message);
@@ -7081,7 +7119,7 @@
7081
7119
  fieldErrorHide_Source = new kwikidToolkit.Source(object);
7082
7120
  return [4 /*yield*/, fieldErrorHide_Source.getValueFromSource(action.props.message.source)];
7083
7121
  case 10:
7084
- fieldErrorHideSourceValue = _l.sent();
7122
+ fieldErrorHideSourceValue = _p.sent();
7085
7123
  if (typeof fieldErrorHideSourceValue == "string" ||
7086
7124
  typeof fieldErrorHideSourceValue == "number") {
7087
7125
  fieldErrorHideSourceValue = String(fieldErrorHideSourceValue);
@@ -7090,7 +7128,7 @@
7090
7128
  fieldErrorHideSourceValue = "";
7091
7129
  }
7092
7130
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", fieldErrorHideSourceValue);
7093
- _l.label = 11;
7131
+ _p.label = 11;
7094
7132
  case 11:
7095
7133
  this.fieldErrorHide(action.props.fieldKey, action.props.message);
7096
7134
  return [3 /*break*/, 63];
@@ -7102,81 +7140,81 @@
7102
7140
  return [3 /*break*/, 63];
7103
7141
  case 14: return [4 /*yield*/, this.setValue(action, object)];
7104
7142
  case 15:
7105
- _l.sent();
7143
+ _p.sent();
7106
7144
  return [3 /*break*/, 63];
7107
7145
  case 16: return [4 /*yield*/, this.setFieldDefaultValue(action, object)];
7108
7146
  case 17:
7109
- _l.sent();
7147
+ _p.sent();
7110
7148
  return [3 /*break*/, 63];
7111
7149
  case 18: return [4 /*yield*/, this.setApiStatus(action, object)];
7112
7150
  case 19:
7113
- _l.sent();
7151
+ _p.sent();
7114
7152
  return [3 /*break*/, 63];
7115
7153
  case 20: return [4 /*yield*/, this.setApiHeaderValue(action, object)];
7116
7154
  case 21:
7117
- _l.sent();
7155
+ _p.sent();
7118
7156
  return [3 /*break*/, 63];
7119
7157
  case 22: return [4 /*yield*/, this.setApiHeaderValidity(action, object)];
7120
7158
  case 23:
7121
- _l.sent();
7159
+ _p.sent();
7122
7160
  return [3 /*break*/, 63];
7123
7161
  case 24: return [4 /*yield*/, this.setApiBodyValue(action, object)];
7124
7162
  case 25:
7125
- _l.sent();
7163
+ _p.sent();
7126
7164
  return [3 /*break*/, 63];
7127
7165
  case 26: return [4 /*yield*/, this.setApiBodyValidity(action, object)];
7128
7166
  case 27:
7129
- _l.sent();
7167
+ _p.sent();
7130
7168
  return [3 /*break*/, 63];
7131
7169
  case 28: return [4 /*yield*/, this.setDropdownOptions(action, object)];
7132
7170
  case 29:
7133
- _l.sent();
7171
+ _p.sent();
7134
7172
  return [3 /*break*/, 63];
7135
7173
  case 30: return [4 /*yield*/, this.setFieldValidity(action, object)];
7136
7174
  case 31:
7137
- _l.sent();
7175
+ _p.sent();
7138
7176
  return [3 /*break*/, 63];
7139
7177
  case 32:
7140
7178
  this.handleConnectedElements({ key: action.props.fieldKey }, "ON_ACTION");
7141
7179
  return [3 /*break*/, 63];
7142
7180
  case 33: return [4 /*yield*/, this.fieldApiCall(action, object)];
7143
7181
  case 34:
7144
- _l.sent();
7182
+ _p.sent();
7145
7183
  return [3 /*break*/, 63];
7146
7184
  case 35: return [4 /*yield*/, this.fieldMultipleApiCalls(action, object)];
7147
7185
  case 36:
7148
- _l.sent();
7186
+ _p.sent();
7149
7187
  return [3 /*break*/, 63];
7150
7188
  case 37: return [4 /*yield*/, this.fieldMultipleApiCallsEnd(action, object)];
7151
7189
  case 38:
7152
- _l.sent();
7190
+ _p.sent();
7153
7191
  return [3 /*break*/, 63];
7154
7192
  case 39: return [4 /*yield*/, this.taskApiCall(action, object)];
7155
7193
  case 40:
7156
- _l.sent();
7194
+ _p.sent();
7157
7195
  return [3 /*break*/, 63];
7158
7196
  case 41: return [4 /*yield*/, this.taskMultipleApiCalls(action, object)];
7159
7197
  case 42:
7160
- _l.sent();
7198
+ _p.sent();
7161
7199
  return [3 /*break*/, 63];
7162
7200
  case 43: return [4 /*yield*/, this.taskMultipleApiCallsEnd(action, object)];
7163
7201
  case 44:
7164
- _l.sent();
7202
+ _p.sent();
7165
7203
  return [3 /*break*/, 63];
7166
7204
  case 45:
7167
7205
  if (!kwikidToolkit.checkObjectKeyExists(action.props.url, "source")) return [3 /*break*/, 47];
7168
7206
  redirectToUrl_Source = new kwikidToolkit.Source(object);
7169
7207
  return [4 /*yield*/, redirectToUrl_Source.getValueFromSource(action.props.url.source)];
7170
7208
  case 46:
7171
- redirectToUrlSourceValue = _l.sent();
7209
+ redirectToUrlSourceValue = _p.sent();
7172
7210
  if (kwikidToolkit.isEmptyString(redirectToUrlSourceValue)) {
7173
7211
  redirectToUrlSourceValue = "";
7174
7212
  }
7175
7213
  action = kwikidToolkit.setValueToObjectPath(action, "props.url.url", redirectToUrlSourceValue);
7176
- _l.label = 47;
7214
+ _p.label = 47;
7177
7215
  case 47:
7178
7216
  this.redirectToUrl(action);
7179
- _l.label = 48;
7217
+ _p.label = 48;
7180
7218
  case 48:
7181
7219
  this.showPreview(action.props);
7182
7220
  return [3 /*break*/, 63];
@@ -7185,7 +7223,7 @@
7185
7223
  previewErrorShow_Source = new kwikidToolkit.Source(object);
7186
7224
  return [4 /*yield*/, previewErrorShow_Source.getValueFromSource(action.props.message.source)];
7187
7225
  case 50:
7188
- previewErrorShowSourceValue = _l.sent();
7226
+ previewErrorShowSourceValue = _p.sent();
7189
7227
  if (typeof previewErrorShowSourceValue == "string" ||
7190
7228
  typeof previewErrorShowSourceValue == "number") {
7191
7229
  previewErrorShowSourceValue = String(previewErrorShowSourceValue);
@@ -7194,7 +7232,7 @@
7194
7232
  previewErrorShowSourceValue = "";
7195
7233
  }
7196
7234
  action = kwikidToolkit.setValueToObjectPath(action, "props.message.message", previewErrorShowSourceValue);
7197
- _l.label = 51;
7235
+ _p.label = 51;
7198
7236
  case 51:
7199
7237
  this.showErrorPreview(action.props);
7200
7238
  return [3 /*break*/, 63];