@adlfe/campaign-management-library 2.13.2 → 2.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (18) hide show
  1. package/bundles/adlfe-campaign-management-library.umd.js +58 -60
  2. package/bundles/adlfe-campaign-management-library.umd.js.map +1 -1
  3. package/bundles/adlfe-campaign-management-library.umd.min.js +1 -1
  4. package/bundles/adlfe-campaign-management-library.umd.min.js.map +1 -1
  5. package/esm2015/lib/campaign-management/models/general-information-wa-req.model.js +15 -27
  6. package/esm2015/lib/campaign-management/modules/new-campaign/components/general-information-wa/general-information-wa.component.js +41 -32
  7. package/esm2015/lib/campaign-management/modules/new-campaign/general-information/general-information.component.js +1 -2
  8. package/esm2015/lib/campaign-management/modules/new-campaign/new-number-bases/new-number-bases.component.js +5 -3
  9. package/esm5/lib/campaign-management/models/general-information-wa-req.model.js +15 -27
  10. package/esm5/lib/campaign-management/modules/new-campaign/components/general-information-wa/general-information-wa.component.js +41 -32
  11. package/esm5/lib/campaign-management/modules/new-campaign/general-information/general-information.component.js +1 -2
  12. package/esm5/lib/campaign-management/modules/new-campaign/new-number-bases/new-number-bases.component.js +5 -3
  13. package/fesm2015/adlfe-campaign-management-library.js +58 -60
  14. package/fesm2015/adlfe-campaign-management-library.js.map +1 -1
  15. package/fesm5/adlfe-campaign-management-library.js +58 -60
  16. package/fesm5/adlfe-campaign-management-library.js.map +1 -1
  17. package/lib/campaign-management/models/general-information-wa-req.model.d.ts +0 -5
  18. package/package.json +1 -1
@@ -2507,7 +2507,7 @@ var GeneralInformationWAReqModel = /** @class */ (function () {
2507
2507
  function GeneralInformationWAReqModel() {
2508
2508
  }
2509
2509
  GeneralInformationWAReqModel.prototype.clone = function (source) {
2510
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
2510
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
2511
2511
  if (((_a = source) === null || _a === void 0 ? void 0 : _a.media) === 'IMAGE' ||
2512
2512
  ((_b = source) === null || _b === void 0 ? void 0 : _b.media) === 'VIDEO' ||
2513
2513
  ((_c = source) === null || _c === void 0 ? void 0 : _c.media) === 'DOCUMENT') {
@@ -2544,12 +2544,6 @@ var GeneralInformationWAReqModel = /** @class */ (function () {
2544
2544
  fileName: source.fileName,
2545
2545
  };
2546
2546
  }
2547
- if (source.buttonParams && Array.isArray(source.buttonParams)) {
2548
- this.buttonParams = source.buttonParams.map(function (btn) { return ({
2549
- label: btn.label,
2550
- payload: btn.payload ? btn.payload : btn.label,
2551
- }); });
2552
- }
2553
2547
  if (source.template) {
2554
2548
  this.template = {
2555
2549
  id: source.template.ID,
@@ -2559,19 +2553,15 @@ var GeneralInformationWAReqModel = /** @class */ (function () {
2559
2553
  header: (_g = (_f = source.paramHeader) === null || _f === void 0 ? void 0 : _f.map(function (t) { return t.name; }), (_g !== null && _g !== void 0 ? _g : [])),
2560
2554
  data: ((_h = source.variables) === null || _h === void 0 ? void 0 : _h.length) ? source.variables.map(function (v) { return v.paramName; })
2561
2555
  : (_k = (_j = source.paramBody) === null || _j === void 0 ? void 0 : _j.map(function (t) { return t.name; }), (_k !== null && _k !== void 0 ? _k : [])),
2562
- button: (_l = source.paramButton) === null || _l === void 0 ? void 0 : _l.reduce(function (result, each) {
2563
- var _a;
2564
- result.push((_a = each.name.map(function (t) { return t.name; }), (_a !== null && _a !== void 0 ? _a : [])));
2565
- return result;
2566
- }, []),
2567
- buttonParams: source.buttonParams
2568
- ? source.buttonParams.map(function (btn) {
2569
- return {
2570
- label: btn.label,
2571
- payload: btn.payload ? btn.payload : btn.label,
2572
- };
2573
- })
2574
- : [],
2556
+ button: source.buttonParams && source.buttonParams.length > 0
2557
+ ? source.buttonParams.map(function (btn) { return [
2558
+ btn.payload ? btn.payload : btn.label,
2559
+ ]; })
2560
+ : (_m = (_l = source.paramButton) === null || _l === void 0 ? void 0 : _l.reduce(function (result, each) {
2561
+ var _a;
2562
+ result.push((_a = each.name.map(function (t) { return t.name; }), (_a !== null && _a !== void 0 ? _a : [])));
2563
+ return result;
2564
+ }, []), (_m !== null && _m !== void 0 ? _m : [])),
2575
2565
  };
2576
2566
  if (source.template.category === 'AUTHENTICATION')
2577
2567
  this.template = {
@@ -2580,7 +2570,6 @@ var GeneralInformationWAReqModel = /** @class */ (function () {
2580
2570
  header: null,
2581
2571
  data: [source.otpValue],
2582
2572
  button: [[source.otpValue]],
2583
- buttonParams: [],
2584
2573
  };
2585
2574
  if (source.template.ID)
2586
2575
  this.template.id = source.template.ID;
@@ -2588,9 +2577,9 @@ var GeneralInformationWAReqModel = /** @class */ (function () {
2588
2577
  if (this.type === 'utility') {
2589
2578
  this.type = 'template';
2590
2579
  this.category = 'utility';
2591
- var mappedVariables = ((_o = (_m = source) === null || _m === void 0 ? void 0 : _m.variables) === null || _o === void 0 ? void 0 : _o.length) ? source.variables.map(function (v) { return v.paramName; })
2580
+ var mappedVariables = ((_p = (_o = source) === null || _o === void 0 ? void 0 : _o.variables) === null || _p === void 0 ? void 0 : _p.length) ? source.variables.map(function (v) { return v.paramName; })
2592
2581
  : [];
2593
- if ((_p = source) === null || _p === void 0 ? void 0 : _p.isUseExistingTemplate) {
2582
+ if ((_q = source) === null || _q === void 0 ? void 0 : _q.isUseExistingTemplate) {
2594
2583
  this.template = __assign(__assign({}, source.template), { data: mappedVariables.length > 0 ? mappedVariables : source.template.data || [] });
2595
2584
  }
2596
2585
  else {
@@ -2600,13 +2589,12 @@ var GeneralInformationWAReqModel = /** @class */ (function () {
2600
2589
  header: null,
2601
2590
  button: null,
2602
2591
  data: mappedVariables,
2603
- buttonParams: [],
2604
2592
  };
2605
2593
  }
2606
2594
  this.isNeedSave = source.isNeedSave;
2607
2595
  this.ttlSeconds = source.ttl;
2608
- if ((_q = source) === null || _q === void 0 ? void 0 : _q.isUseExistingTemplate) {
2609
- this.text = ((_r = source) === null || _r === void 0 ? void 0 : _r.text) || ((_u = (_t = (_s = source) === null || _s === void 0 ? void 0 : _s.template) === null || _t === void 0 ? void 0 : _t.body) === null || _u === void 0 ? void 0 : _u.text);
2596
+ if ((_r = source) === null || _r === void 0 ? void 0 : _r.isUseExistingTemplate) {
2597
+ this.text = ((_s = source) === null || _s === void 0 ? void 0 : _s.text) || ((_v = (_u = (_t = source) === null || _t === void 0 ? void 0 : _t.template) === null || _u === void 0 ? void 0 : _u.body) === null || _v === void 0 ? void 0 : _v.text);
2610
2598
  }
2611
2599
  }
2612
2600
  return this;
@@ -4217,6 +4205,7 @@ var GeneralInformationWAComponent = /** @class */ (function () {
4217
4205
  ((_c = formValues) === null || _c === void 0 ? void 0 : _c.medium) !== 'WA') {
4218
4206
  return;
4219
4207
  }
4208
+ console.log(formValues, 'formValues');
4220
4209
  (_d = this.getControl('channel')) === null || _d === void 0 ? void 0 : _d.setValue((_e = formValues) === null || _e === void 0 ? void 0 : _e.channel);
4221
4210
  (_f = this.getControl('media')) === null || _f === void 0 ? void 0 : _f.setValue((_g = formValues) === null || _g === void 0 ? void 0 : _g.media);
4222
4211
  (_h = this.getControl('from')) === null || _h === void 0 ? void 0 : _h.setValue((_j = formValues) === null || _j === void 0 ? void 0 : _j.from);
@@ -4397,6 +4386,7 @@ var GeneralInformationWAComponent = /** @class */ (function () {
4397
4386
  this.initParam('pageNo', this.pageNoTemplateOption, 'number'),
4398
4387
  this.initParam('rowPerPage', 20, 'number'),
4399
4388
  this.initParam('platform', 'WA', 'string'),
4389
+ this.initParam('templateType', 'all', 'string'),
4400
4390
  this.initParam('filter', filter, 'string'),
4401
4391
  this.initParam('status', 'APPROVED', 'string'),
4402
4392
  this.initParam('clientId', (_c = (_b = (_a = this.getControl('from')) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.clientId, (_c !== null && _c !== void 0 ? _c : '')), 'string'),
@@ -4599,7 +4589,8 @@ var GeneralInformationWAComponent = /** @class */ (function () {
4599
4589
  };
4600
4590
  Object.defineProperty(GeneralInformationWAComponent.prototype, "buttonParamsControls", {
4601
4591
  get: function () {
4602
- return this.form.get('buttonParams').controls;
4592
+ var control = this.form.get('buttonParams');
4593
+ return control ? control.controls : [];
4603
4594
  },
4604
4595
  enumerable: true,
4605
4596
  configurable: true
@@ -4614,66 +4605,72 @@ var GeneralInformationWAComponent = /** @class */ (function () {
4614
4605
  });
4615
4606
  GeneralInformationWAComponent.prototype.updateTemplate = function (template) {
4616
4607
  var _this = this;
4617
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34;
4608
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35;
4618
4609
  this.isShowParameter = false;
4619
4610
  if (!template)
4620
4611
  return;
4612
+ var formStorage = (_b = (_a = this.getCampaignStorage) === null || _a === void 0 ? void 0 : _a.generalInformation) === null || _b === void 0 ? void 0 : _b.form;
4613
+ var savedButtonParams = ((_c = formStorage) === null || _c === void 0 ? void 0 : _c.buttonParams) || [];
4621
4614
  var buttonParamsArray = this.form.get('buttonParams');
4622
4615
  buttonParamsArray.clear();
4623
4616
  if (template && template.buttons && template.buttons.length > 0) {
4624
4617
  var quickReplyButtons = template.buttons.filter(function (btn) { return btn.type === 'QUICK_REPLY'; });
4625
- quickReplyButtons.forEach(function (btn) {
4618
+ quickReplyButtons.forEach(function (btn, index) {
4619
+ var _a;
4620
+ var existingPayload = ((_a = savedButtonParams[index]) === null || _a === void 0 ? void 0 : _a.payload) || '';
4626
4621
  buttonParamsArray.push(new FormGroup({
4627
4622
  label: new FormControl(btn.text),
4628
- payload: new FormControl('', [Validators$1.maxLength(256)]),
4623
+ payload: new FormControl({
4624
+ value: existingPayload,
4625
+ disabled: _this.isReadOnlyMode,
4626
+ }, [Validators$1.maxLength(256)]),
4629
4627
  }));
4630
4628
  });
4631
4629
  }
4632
4630
  this.isHaveTemplateParam =
4633
- (_c = (_b = (_a = template.header) === null || _a === void 0 ? void 0 : _a.examples) === null || _b === void 0 ? void 0 : _b.length, (_c !== null && _c !== void 0 ? _c : 0)) > 0 ||
4634
- (_f = (_e = (_d = template.body) === null || _d === void 0 ? void 0 : _d.examples) === null || _e === void 0 ? void 0 : _e.length, (_f !== null && _f !== void 0 ? _f : 0)) > 0 ||
4635
- (_h = (_g = template.buttons) === null || _g === void 0 ? void 0 : _g.length, (_h !== null && _h !== void 0 ? _h : 0)) > 0;
4636
- if (['image', 'video', 'document'].includes((_l = (_k = (_j = template) === null || _j === void 0 ? void 0 : _j.header) === null || _k === void 0 ? void 0 : _k.type) === null || _l === void 0 ? void 0 : _l.toLowerCase())) {
4637
- (_m = this.getControl('fileName')) === null || _m === void 0 ? void 0 : _m.setValue((_t = (_q = (_p = (_o = this.getCampaignStorage) === null || _o === void 0 ? void 0 : _o.generalInformation) === null || _p === void 0 ? void 0 : _p.form.fileName, (_q !== null && _q !== void 0 ? _q : (_s = (_r = this.getCampaignStorage) === null || _r === void 0 ? void 0 : _r.generalInformation) === null || _s === void 0 ? void 0 : _s.form.targetURL)), (_t !== null && _t !== void 0 ? _t : template.header.url)));
4638
- (_u = this.getControl('targetURL')) === null || _u === void 0 ? void 0 : _u.setValue((_x = (_w = (_v = this.getCampaignStorage) === null || _v === void 0 ? void 0 : _v.generalInformation) === null || _w === void 0 ? void 0 : _w.form.targetURL, (_x !== null && _x !== void 0 ? _x : template.header.url)));
4639
- this.fileTypeChange((_0 = (_z = (_y = template) === null || _y === void 0 ? void 0 : _y.header) === null || _z === void 0 ? void 0 : _z.type) === null || _0 === void 0 ? void 0 : _0.toLowerCase());
4640
- }
4641
- (_2 = (_1 = template.header.examples) === null || _1 === void 0 ? void 0 : _1.length, (_2 !== null && _2 !== void 0 ? _2 : 0)) > 0
4642
- ? (_3 = this.getControl('paramHeader')) === null || _3 === void 0 ? void 0 : _3.setValidators(Validators$1.required) : (_4 = this.getControl('paramHeader')) === null || _4 === void 0 ? void 0 : _4.clearValidators();
4643
- (_6 = (_5 = template.body.examples) === null || _5 === void 0 ? void 0 : _5.length, (_6 !== null && _6 !== void 0 ? _6 : 0)) > 0
4644
- ? (_7 = this.getControl('paramBody')) === null || _7 === void 0 ? void 0 : _7.setValidators(Validators$1.required) : (_8 = this.getControl('paramBody')) === null || _8 === void 0 ? void 0 : _8.clearValidators();
4645
- (_10 = (_9 = template.buttons) === null || _9 === void 0 ? void 0 : _9.length, (_10 !== null && _10 !== void 0 ? _10 : 0)) > 0
4646
- ? (_11 = this.getControl('paramButton')) === null || _11 === void 0 ? void 0 : _11.setValidators(Validators$1.required) : (_12 = this.getControl('paramButton')) === null || _12 === void 0 ? void 0 : _12.clearValidators();
4631
+ (_f = (_e = (_d = template.header) === null || _d === void 0 ? void 0 : _d.examples) === null || _e === void 0 ? void 0 : _e.length, (_f !== null && _f !== void 0 ? _f : 0)) > 0 ||
4632
+ (_j = (_h = (_g = template.body) === null || _g === void 0 ? void 0 : _g.examples) === null || _h === void 0 ? void 0 : _h.length, (_j !== null && _j !== void 0 ? _j : 0)) > 0 ||
4633
+ (_l = (_k = template.buttons) === null || _k === void 0 ? void 0 : _k.length, (_l !== null && _l !== void 0 ? _l : 0)) > 0;
4634
+ if (['image', 'video', 'document'].includes((_p = (_o = (_m = template) === null || _m === void 0 ? void 0 : _m.header) === null || _o === void 0 ? void 0 : _o.type) === null || _p === void 0 ? void 0 : _p.toLowerCase())) {
4635
+ (_q = this.getControl('fileName')) === null || _q === void 0 ? void 0 : _q.setValue((_w = (_t = (_s = (_r = this.getCampaignStorage) === null || _r === void 0 ? void 0 : _r.generalInformation) === null || _s === void 0 ? void 0 : _s.form.fileName, (_t !== null && _t !== void 0 ? _t : (_v = (_u = this.getCampaignStorage) === null || _u === void 0 ? void 0 : _u.generalInformation) === null || _v === void 0 ? void 0 : _v.form.targetURL)), (_w !== null && _w !== void 0 ? _w : template.header.url)));
4636
+ (_x = this.getControl('targetURL')) === null || _x === void 0 ? void 0 : _x.setValue((_0 = (_z = (_y = this.getCampaignStorage) === null || _y === void 0 ? void 0 : _y.generalInformation) === null || _z === void 0 ? void 0 : _z.form.targetURL, (_0 !== null && _0 !== void 0 ? _0 : template.header.url)));
4637
+ this.fileTypeChange((_3 = (_2 = (_1 = template) === null || _1 === void 0 ? void 0 : _1.header) === null || _2 === void 0 ? void 0 : _2.type) === null || _3 === void 0 ? void 0 : _3.toLowerCase());
4638
+ }
4639
+ (_5 = (_4 = template.header.examples) === null || _4 === void 0 ? void 0 : _4.length, (_5 !== null && _5 !== void 0 ? _5 : 0)) > 0
4640
+ ? (_6 = this.getControl('paramHeader')) === null || _6 === void 0 ? void 0 : _6.setValidators(Validators$1.required) : (_7 = this.getControl('paramHeader')) === null || _7 === void 0 ? void 0 : _7.clearValidators();
4641
+ (_9 = (_8 = template.body.examples) === null || _8 === void 0 ? void 0 : _8.length, (_9 !== null && _9 !== void 0 ? _9 : 0)) > 0
4642
+ ? (_10 = this.getControl('paramBody')) === null || _10 === void 0 ? void 0 : _10.setValidators(Validators$1.required) : (_11 = this.getControl('paramBody')) === null || _11 === void 0 ? void 0 : _11.clearValidators();
4643
+ (_13 = (_12 = template.buttons) === null || _12 === void 0 ? void 0 : _12.length, (_13 !== null && _13 !== void 0 ? _13 : 0)) > 0
4644
+ ? (_14 = this.getControl('paramButton')) === null || _14 === void 0 ? void 0 : _14.setValidators(Validators$1.required) : (_15 = this.getControl('paramButton')) === null || _15 === void 0 ? void 0 : _15.clearValidators();
4647
4645
  this.form.get('paramHeader').controls = [];
4648
4646
  this.form.get('paramHeader').reset();
4649
- (_13 = this.getControl('paramHeader')) === null || _13 === void 0 ? void 0 : _13.updateValueAndValidity();
4647
+ (_16 = this.getControl('paramHeader')) === null || _16 === void 0 ? void 0 : _16.updateValueAndValidity();
4650
4648
  this.form.get('paramBody').controls = [];
4651
4649
  this.form.get('paramBody').reset();
4652
- (_14 = this.getControl('paramBody')) === null || _14 === void 0 ? void 0 : _14.updateValueAndValidity();
4650
+ (_17 = this.getControl('paramBody')) === null || _17 === void 0 ? void 0 : _17.updateValueAndValidity();
4653
4651
  this.form.get('paramButton').controls = [];
4654
4652
  this.form.get('paramButton').reset();
4655
- (_15 = this.getControl('paramButton')) === null || _15 === void 0 ? void 0 : _15.updateValueAndValidity();
4656
- (_16 = this.getControl('otpValue')) === null || _16 === void 0 ? void 0 : _16.setValue('');
4657
- (_17 = this.getControl('otpValue')) === null || _17 === void 0 ? void 0 : _17.clearValidators();
4658
- (_18 = this.getControl('otpValue')) === null || _18 === void 0 ? void 0 : _18.updateValueAndValidity();
4659
- var formStorage = (_20 = (_19 = this.getCampaignStorage) === null || _19 === void 0 ? void 0 : _19.generalInformation) === null || _20 === void 0 ? void 0 : _20.form;
4653
+ (_18 = this.getControl('paramButton')) === null || _18 === void 0 ? void 0 : _18.updateValueAndValidity();
4654
+ (_19 = this.getControl('otpValue')) === null || _19 === void 0 ? void 0 : _19.setValue('');
4655
+ (_20 = this.getControl('otpValue')) === null || _20 === void 0 ? void 0 : _20.clearValidators();
4656
+ (_21 = this.getControl('otpValue')) === null || _21 === void 0 ? void 0 : _21.updateValueAndValidity();
4660
4657
  if (template.category === 'AUTHENTICATION') {
4661
- (_21 = this.getControl('otpValue')) === null || _21 === void 0 ? void 0 : _21.setValue((_29 = (_23 = (_22 = formStorage) === null || _22 === void 0 ? void 0 : _22.otpValue, (_23 !== null && _23 !== void 0 ? _23 : (_28 = __spread((_27 = (_26 = (_25 = (_24 = formStorage) === null || _24 === void 0 ? void 0 : _24.template) === null || _25 === void 0 ? void 0 : _25.body) === null || _26 === void 0 ? void 0 : _26.examples, (_27 !== null && _27 !== void 0 ? _27 : [])))) === null || _28 === void 0 ? void 0 : _28.pop())), (_29 !== null && _29 !== void 0 ? _29 : '')));
4662
- (_30 = this.getControl('otpValue')) === null || _30 === void 0 ? void 0 : _30.setValidators(Validators$1.required);
4663
- (_31 = this.getControl('otpValue')) === null || _31 === void 0 ? void 0 : _31.updateValueAndValidity();
4658
+ (_22 = this.getControl('otpValue')) === null || _22 === void 0 ? void 0 : _22.setValue((_30 = (_24 = (_23 = formStorage) === null || _23 === void 0 ? void 0 : _23.otpValue, (_24 !== null && _24 !== void 0 ? _24 : (_29 = __spread((_28 = (_27 = (_26 = (_25 = formStorage) === null || _25 === void 0 ? void 0 : _25.template) === null || _26 === void 0 ? void 0 : _26.body) === null || _27 === void 0 ? void 0 : _27.examples, (_28 !== null && _28 !== void 0 ? _28 : [])))) === null || _29 === void 0 ? void 0 : _29.pop())), (_30 !== null && _30 !== void 0 ? _30 : '')));
4659
+ (_31 = this.getControl('otpValue')) === null || _31 === void 0 ? void 0 : _31.setValidators(Validators$1.required);
4660
+ (_32 = this.getControl('otpValue')) === null || _32 === void 0 ? void 0 : _32.updateValueAndValidity();
4664
4661
  }
4665
- (_32 = template.header.examples) === null || _32 === void 0 ? void 0 : _32.forEach(function (each, index) {
4662
+ (_33 = template.header.examples) === null || _33 === void 0 ? void 0 : _33.forEach(function (each, index) {
4666
4663
  var _a, _b, _c, _d, _e, _f, _g;
4667
4664
  _this.addParamHeader((_g = (_d = (_c = (_b = (_a = formStorage) === null || _a === void 0 ? void 0 : _a.paramHeader) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.name, (_d !== null && _d !== void 0 ? _d : (_f = (_e = formStorage) === null || _e === void 0 ? void 0 : _e.paramHeader) === null || _f === void 0 ? void 0 : _f[index])), (_g !== null && _g !== void 0 ? _g : '')));
4668
4665
  });
4669
- (_33 = template.body.examples) === null || _33 === void 0 ? void 0 : _33.forEach(function (each, index) {
4666
+ (_34 = template.body.examples) === null || _34 === void 0 ? void 0 : _34.forEach(function (each, index) {
4670
4667
  var _a, _b, _c, _d, _e, _f, _g;
4671
4668
  var paramValue = (_g = (_d = (_c = (_b = (_a = formStorage) === null || _a === void 0 ? void 0 : _a.paramBody) === null || _b === void 0 ? void 0 : _b[index]) === null || _c === void 0 ? void 0 : _c.name, (_d !== null && _d !== void 0 ? _d : (_f = (_e = formStorage) === null || _e === void 0 ? void 0 : _e.paramBody) === null || _f === void 0 ? void 0 : _f[index])), (_g !== null && _g !== void 0 ? _g : ''));
4672
4669
  if (['$UnsubscribeAccount'].includes(each))
4673
4670
  paramValue = each;
4674
4671
  _this.addParamBody(paramValue);
4675
4672
  });
4676
- (_34 = template.buttons) === null || _34 === void 0 ? void 0 : _34.forEach(function (each, index) {
4673
+ (_35 = template.buttons) === null || _35 === void 0 ? void 0 : _35.forEach(function (each, index) {
4677
4674
  var _a, _b, _c, _d;
4678
4675
  _this.addParamButton();
4679
4676
  var button = _this.getButton;
@@ -5369,7 +5366,6 @@ var GeneralInformationComponent = /** @class */ (function () {
5369
5366
  this.form.disable();
5370
5367
  };
5371
5368
  GeneralInformationComponent.prototype.updateGeneralInformationForm = function (form) {
5372
- console.log(form, 'form');
5373
5369
  this.generalInformationForm = form;
5374
5370
  this.isShowMore = false;
5375
5371
  this.generalInformation.emit({
@@ -5736,13 +5732,15 @@ var NewNumberBasesComponent = /** @class */ (function () {
5736
5732
  var isNeedSave = (_c = genInfoForm) === null || _c === void 0 ? void 0 : _c.isNeedSave;
5737
5733
  var parameterList = [
5738
5734
  this.initParam('platform', ((_e = (_d = genInfoForm) === null || _d === void 0 ? void 0 : _d.template) === null || _e === void 0 ? void 0 : _e.platform) || 'WA', 'string'),
5735
+ this.initParam('templateName', (_g = (_f = genInfoForm) === null || _f === void 0 ? void 0 : _f.template) === null || _g === void 0 ? void 0 : _g.name, 'string'),
5736
+ this.initParam('templateLang', (_j = (_h = genInfoForm) === null || _h === void 0 ? void 0 : _h.template) === null || _j === void 0 ? void 0 : _j.lang, 'string'),
5739
5737
  ];
5740
5738
  if (isNeedSave) {
5741
5739
  // SKENARIO 1: USE EXISTING / TEMPLATE SUDAH DISAVE
5742
- parameterList.push(this.initParam('templateName', (_g = (_f = genInfoForm) === null || _f === void 0 ? void 0 : _f.template) === null || _g === void 0 ? void 0 : _g.name, 'string'), this.initParam('templateLang', (_j = (_h = genInfoForm) === null || _h === void 0 ? void 0 : _h.template) === null || _j === void 0 ? void 0 : _j.lang, 'string'), this.initParam('category', (_l = (_k = this.categorySelected) === null || _k === void 0 ? void 0 : _k.map(function (t) { return t.id; }).join(), (_l !== null && _l !== void 0 ? _l : '')), 'string'));
5740
+ parameterList.push(this.initParam('category', (_l = (_k = this.categorySelected) === null || _k === void 0 ? void 0 : _k.map(function (t) { return t.id; }).join(), (_l !== null && _l !== void 0 ? _l : '')), 'string'));
5743
5741
  }
5744
5742
  else {
5745
- // SKENARIO 2: CREATE NEW (Belum disave, butuh text & examples)
5743
+ // SKENARIO 2: CREATE NEW (Auto-generated dll)
5746
5744
  var safeBodyText = encodeURIComponent(((_m = genInfoForm) === null || _m === void 0 ? void 0 : _m.text) || '');
5747
5745
  parameterList.push(this.initParam('bodyText', safeBodyText, 'string'));
5748
5746
  var variables = (_o = genInfoForm) === null || _o === void 0 ? void 0 : _o.variables;