@useinsider/guido 1.0.3-beta.cd0d7f3 → 1.0.3-beta.ce3ed00

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 (163) hide show
  1. package/README.md +0 -3
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +73 -79
  4. package/dist/components/organisms/header/RightSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/RightSlot.vue2.js +22 -23
  6. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
  7. package/dist/composables/useActionsApi.js +1 -1
  8. package/dist/composables/useGuidoActions.js +9 -19
  9. package/dist/composables/useHtmlCompiler.js +13 -15
  10. package/dist/composables/useHtmlValidator.js +35 -36
  11. package/dist/composables/useStripo.js +36 -38
  12. package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
  13. package/dist/enums/defaults.js +1 -2
  14. package/dist/enums/onboarding.js +3 -7
  15. package/dist/enums/unsubscribe.js +25 -27
  16. package/dist/extensions/Blocks/Items/block.js +42 -38
  17. package/dist/extensions/Blocks/Items/controls/button/link.js +17 -25
  18. package/dist/extensions/Blocks/Items/controls/cardComposition.js +57 -151
  19. package/dist/extensions/Blocks/Items/controls/image/link.js +20 -28
  20. package/dist/extensions/Blocks/Items/controls/name/trimming.js +22 -29
  21. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +18 -25
  22. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +8 -18
  23. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +30 -37
  24. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +14 -37
  25. package/dist/extensions/Blocks/Items/controls/settingsControl.js +118 -148
  26. package/dist/extensions/Blocks/Items/enums/productEnums.js +5 -96
  27. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +7 -20
  28. package/dist/extensions/Blocks/Items/extension.js +4 -4
  29. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +8 -6
  30. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +12 -7
  31. package/dist/extensions/Blocks/Items/settingsPanel.js +45 -71
  32. package/dist/extensions/Blocks/Items/store/items-block.js +1 -5
  33. package/dist/extensions/Blocks/Items/template.js +63 -149
  34. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  35. package/dist/extensions/Blocks/common-control.js +125 -164
  36. package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
  37. package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
  38. package/dist/guido.css +1 -1
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +2 -12
  40. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +12 -13
  41. package/dist/node_modules/lodash-es/keysIn.js +3 -3
  42. package/dist/package.json.js +1 -1
  43. package/dist/src/@types/generic.d.ts +6 -27
  44. package/dist/src/components/Guido.vue.d.ts +2 -3
  45. package/dist/src/composables/useGuidoActions.d.ts +0 -9
  46. package/dist/src/enums/onboarding.d.ts +0 -4
  47. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -1
  48. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +7 -20
  49. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -1
  50. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +1 -5
  51. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -3
  52. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -18
  53. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -14
  54. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +1 -3
  55. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  56. package/dist/src/extensions/Blocks/common-control.d.ts +2 -25
  57. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
  58. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
  59. package/dist/src/stores/config.d.ts +2 -3
  60. package/dist/src/stores/dynamic-content.d.ts +3 -3
  61. package/dist/src/stores/editor.d.ts +1 -1
  62. package/dist/src/stores/onboarding.d.ts +1 -335
  63. package/dist/src/stores/preview.d.ts +1 -1
  64. package/dist/src/stores/recommendation.d.ts +1 -1
  65. package/dist/src/stores/save-as-template.d.ts +1 -1
  66. package/dist/src/stores/toaster.d.ts +1 -1
  67. package/dist/src/stores/unsubscribe.d.ts +1 -1
  68. package/dist/src/stores/version-history.d.ts +1 -1
  69. package/dist/src/utils/genericUtil.d.ts +0 -1
  70. package/dist/stores/config.js +5 -5
  71. package/dist/stores/dynamic-content.js +2 -2
  72. package/dist/stores/editor.js +1 -1
  73. package/dist/stores/onboarding.js +36 -44
  74. package/dist/stores/preview.js +1 -1
  75. package/dist/stores/recommendation.js +3 -3
  76. package/dist/stores/save-as-template.js +2 -2
  77. package/dist/stores/toaster.js +1 -1
  78. package/dist/stores/unsubscribe.js +1 -1
  79. package/dist/stores/version-history.js +4 -4
  80. package/dist/utils/genericUtil.js +6 -17
  81. package/package.json +3 -3
  82. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +0 -21
  83. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +0 -99
  84. package/dist/config/compiler/itemsCompilerRules.js +0 -14
  85. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +0 -17
  86. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +0 -28
  87. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +0 -67
  88. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +0 -44
  89. package/dist/node_modules/lodash-es/_DataView.js +0 -6
  90. package/dist/node_modules/lodash-es/_Promise.js +0 -6
  91. package/dist/node_modules/lodash-es/_Set.js +0 -6
  92. package/dist/node_modules/lodash-es/_SetCache.js +0 -13
  93. package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
  94. package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
  95. package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
  96. package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
  97. package/dist/node_modules/lodash-es/_arraySome.js +0 -9
  98. package/dist/node_modules/lodash-es/_baseEach.js +0 -6
  99. package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
  100. package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
  101. package/dist/node_modules/lodash-es/_baseGet.js +0 -11
  102. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  103. package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
  104. package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
  105. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
  106. package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
  107. package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
  108. package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
  109. package/dist/node_modules/lodash-es/_baseMap.js +0 -11
  110. package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
  111. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  112. package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
  113. package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  114. package/dist/node_modules/lodash-es/_baseRange.js +0 -9
  115. package/dist/node_modules/lodash-es/_baseToString.js +0 -18
  116. package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
  117. package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
  118. package/dist/node_modules/lodash-es/_castPath.js +0 -10
  119. package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
  120. package/dist/node_modules/lodash-es/_createRange.js +0 -11
  121. package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
  122. package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
  123. package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
  124. package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
  125. package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
  126. package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
  127. package/dist/node_modules/lodash-es/_getTag.js +0 -28
  128. package/dist/node_modules/lodash-es/_hasPath.js +0 -19
  129. package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
  130. package/dist/node_modules/lodash-es/_isKey.js +0 -12
  131. package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
  132. package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
  133. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  134. package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
  135. package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
  136. package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
  137. package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
  138. package/dist/node_modules/lodash-es/_setToArray.js +0 -9
  139. package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
  140. package/dist/node_modules/lodash-es/_toKey.js +0 -10
  141. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
  142. package/dist/node_modules/lodash-es/flatMap.js +0 -8
  143. package/dist/node_modules/lodash-es/get.js +0 -8
  144. package/dist/node_modules/lodash-es/hasIn.js +0 -8
  145. package/dist/node_modules/lodash-es/isSymbol.js +0 -9
  146. package/dist/node_modules/lodash-es/keys.js +0 -9
  147. package/dist/node_modules/lodash-es/map.js +0 -11
  148. package/dist/node_modules/lodash-es/property.js +0 -10
  149. package/dist/node_modules/lodash-es/range.js +0 -5
  150. package/dist/node_modules/lodash-es/stubArray.js +0 -6
  151. package/dist/node_modules/lodash-es/toFinite.js +0 -14
  152. package/dist/node_modules/lodash-es/toNumber.js +0 -22
  153. package/dist/node_modules/lodash-es/toString.js +0 -7
  154. package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +0 -2
  155. package/dist/src/config/compiler/itemsCompilerRules.d.ts +0 -2
  156. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +0 -23
  157. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +0 -32
  158. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +0 -44
  159. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +0 -8
  160. package/dist/src/utils/environmentUtil.d.ts +0 -5
  161. package/dist/src/utils/pairProductVariables.d.ts +0 -7
  162. package/dist/utils/environmentUtil.js +0 -4
  163. package/dist/utils/pairProductVariables.js +0 -136
@@ -1,23 +1,21 @@
1
- var _ = Object.defineProperty;
2
- var I = (r, e, t) => e in r ? _(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var P = (r, e, t) => I(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { ModificationDescription as F, UIElementType as m, UEAttr as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as h } from "../../../common-control.js";
6
- import { ItemsBlockControlId as l, ItemsBlockId as A } from "../../enums/controlEnums.js";
7
- import { productPairs as T } from "../../enums/productEnums.js";
8
- import { useItemsBlockStore as u } from "../../store/items-block.js";
9
- import { syncFormattedPriceFromAttributes as g } from "../../utils/syncAttributesFromConfigBlock.js";
10
- import { updateConfigBlockAttributes as D } from "../../utils/updateAttributes.js";
11
- const f = l.PRICE_FORMATTED_PRICE, n = {
1
+ var I = Object.defineProperty;
2
+ var p = (r, t, e) => t in r ? I(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var P = (r, t, e) => p(r, typeof t != "symbol" ? t + "" : t, e);
4
+ import { ModificationDescription as F, UIElementType as T, UEAttr as C } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as A } from "../../../common-control.js";
6
+ import { ItemsBlockControlId as l, ItemsBlockId as g } from "../../enums/controlEnums.js";
7
+ import { productPairs as m } from "../../enums/productEnums.js";
8
+ import { useItemsBlockStore as h } from "../../store/items-block.js";
9
+ const D = l.PRICE_FORMATTED_PRICE, a = {
12
10
  FORMATTED_PRICE: "formattedPrice"
13
11
  };
14
- class y extends h {
12
+ class U extends A {
15
13
  constructor() {
16
14
  super(...arguments);
17
- P(this, "store", u());
15
+ P(this, "store", h());
18
16
  }
19
17
  getId() {
20
- return f;
18
+ return D;
21
19
  }
22
20
  getTemplate() {
23
21
  return `
@@ -27,50 +25,45 @@ class y extends h {
27
25
  `;
28
26
  }
29
27
  onRender() {
30
- this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(n.FORMATTED_PRICE, (t) => {
31
- this._onFormattedPriceChange(t);
28
+ this.api.updateValues({ [a.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(a.FORMATTED_PRICE, (e) => {
29
+ this._onFormattedPriceChange(e);
32
30
  });
33
31
  }
34
- onTemplateNodeUpdated(t) {
35
- super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
36
- () => g(this.currentNode),
37
- () => {
38
- this.api.updateValues({ [n.FORMATTED_PRICE]: this.store.formattedPrice });
39
- }
40
- );
32
+ onTemplateNodeUpdated(e) {
33
+ this.currentNode = e;
41
34
  }
42
- _onFormattedPriceChange(t) {
43
- if (console.debug("Formatted price changed to: ", t), this.store.setFormattedPrice(t), D(this.currentNode, this.api), !this.currentNode)
35
+ _onFormattedPriceChange(e) {
36
+ if (console.debug("Formatted price changed to: ", e), this.store.setFormattedPrice(e), !this.currentNode)
44
37
  return;
45
- const { itemsType: s } = this.store, i = T.PAIRS_FOR_EXTENSION.price[s], o = T.PAIRS_FOR_EXTENSION.originalPrice[s], [c, a] = t ? [i.DEFAULT_PRICE, i.DEFAULT_PRICE_FORMATTED] : [i.DEFAULT_PRICE_FORMATTED, i.DEFAULT_PRICE], [p, R] = t ? [o.DEFAULT_PRICE, o.DEFAULT_PRICE_FORMATTED] : [o.DEFAULT_PRICE_FORMATTED, o.DEFAULT_PRICE];
38
+ const { itemsType: n } = this.store, i = m.PAIRS_FOR_EXTENSION.price[n], o = m.PAIRS_FOR_EXTENSION.originalPrice[n], [c, s] = e ? [i.DEFAULT_PRICE, i.DEFAULT_PRICE_FORMATTED] : [i.DEFAULT_PRICE_FORMATTED, i.DEFAULT_PRICE], [_, R] = e ? [o.DEFAULT_PRICE, o.DEFAULT_PRICE_FORMATTED] : [o.DEFAULT_PRICE_FORMATTED, o.DEFAULT_PRICE];
46
39
  this._updatePriceBlock(
47
40
  this.currentNode,
48
41
  c,
49
- a,
42
+ s,
50
43
  "price"
51
44
  );
52
- const d = this.currentNode.closest(".items-block"), E = d == null ? void 0 : d.querySelector(`[esd-extension-block-id="${A.ORIGINAL_PRICE}"]`);
53
- E && this._updatePriceBlock(E, p, R, "original price");
45
+ const d = this.currentNode.closest(".items-block"), E = d == null ? void 0 : d.querySelector(`[esd-extension-block-id="${g.ORIGINAL_PRICE}"]`);
46
+ E && this._updatePriceBlock(E, _, R, "original price");
54
47
  }
55
- _updatePriceBlock(t, s, i, o) {
56
- const c = t.getInnerHTML().replace(s, i), a = `Updated ${o} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
57
- this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(c).apply(new F(a));
48
+ _updatePriceBlock(e, n, i, o) {
49
+ const c = e.getInnerHTML().replace(n, i), s = `Updated ${o} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
50
+ this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(c).apply(new F(s));
58
51
  }
59
52
  _getFormattedPrice() {
60
53
  return `
61
54
  <div class="container">
62
55
  <div class="display-flex align-items-center justify-content-between">
63
- <${m.LABEL}
56
+ <${T.LABEL}
64
57
  ${C.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
65
58
  >
66
- </${m.LABEL}>
67
- ${this._GuToggle(n.FORMATTED_PRICE)}
59
+ </${T.LABEL}>
60
+ ${this._GuToggle(a.FORMATTED_PRICE)}
68
61
  </div>
69
62
  </div>
70
63
  `;
71
64
  }
72
65
  }
73
66
  export {
74
- f as CONTROL_BLOCK_ID,
75
- y as PriceFormattedPriceControl
67
+ D as CONTROL_BLOCK_ID,
68
+ U as PriceFormattedPriceControl
76
69
  };
@@ -1,61 +1,38 @@
1
- var d = Object.defineProperty;
2
- var a = (i, e, t) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var o = (i, e, t) => a(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { UIElementType as n, UEAttr as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as u } from "../../../common-control.js";
6
- import { ItemsBlockControlId as r } from "../../enums/controlEnums.js";
7
- import { useItemsBlockStore as D } from "../../store/items-block.js";
8
- import { syncHideDiscountFromAttributes as p } from "../../utils/syncAttributesFromConfigBlock.js";
9
- import { updateConfigBlockAttributes as I } from "../../utils/updateAttributes.js";
10
- const l = r.PRICE_HIDE_DISCOUNT, s = {
1
+ import { UIElementType as e, UEAttr as i } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as o } from "../../../common-control.js";
3
+ import { ItemsBlockControlId as t } from "../../enums/controlEnums.js";
4
+ const s = t.PRICE_HIDE_DISCOUNT, n = {
11
5
  HIDE_DISCOUNT: "hideDiscount"
12
6
  };
13
- class N extends u {
14
- constructor() {
15
- super(...arguments);
16
- o(this, "store", D());
17
- }
7
+ class I extends o {
18
8
  getId() {
19
- return l;
9
+ return s;
20
10
  }
21
11
  getTemplate() {
22
12
  return `
23
- <div class="${r.PRICE_HIDE_DISCOUNT}">
13
+ <div class="${t.PRICE_HIDE_DISCOUNT}">
24
14
  ${this._getHideDiscount()}
25
15
  </div>
26
16
  `;
27
17
  }
28
18
  onRender() {
29
- this.api.updateValues({ [s.HIDE_DISCOUNT]: this.store.hideDiscount }), this.api.onValueChanged(s.HIDE_DISCOUNT, (t) => {
30
- this._onHideDiscountChange(t);
31
- });
32
- }
33
- onTemplateNodeUpdated(t) {
34
- super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
35
- () => p(this.currentNode),
36
- () => {
37
- this.api.updateValues({ [s.HIDE_DISCOUNT]: this.store.hideDiscount });
38
- }
39
- );
40
- }
41
- _onHideDiscountChange(t) {
42
- this.store.setHideDiscount(t), I(this.currentNode, this.api), this.api.updateValues({ [s.HIDE_DISCOUNT]: t });
19
+ return Promise.resolve();
43
20
  }
44
21
  _getHideDiscount() {
45
22
  return `
46
23
  <div class="container">
47
24
  <div class="display-flex align-items-center justify-content-between">
48
- <${n.LABEL}
49
- ${c.LABEL.text}="${this.api.translate("Hide if same as discounted ")}"
25
+ <${e.LABEL}
26
+ ${i.LABEL.text}="${this.api.translate("Hide if same as discounted ")}"
50
27
  >
51
- </${n.LABEL}>
52
- ${this._GuToggle(s.HIDE_DISCOUNT)}
28
+ </${e.LABEL}>
29
+ ${this._GuToggle(n.HIDE_DISCOUNT)}
53
30
  </div>
54
31
  </div>
55
32
  `;
56
33
  }
57
34
  }
58
35
  export {
59
- l as CONTROL_BLOCK_ID,
60
- N as PriceHideDiscountControl
36
+ s as CONTROL_BLOCK_ID,
37
+ I as PriceHideDiscountControl
61
38
  };
@@ -1,28 +1,27 @@
1
- var A = Object.defineProperty;
2
- var M = (T, u, e) => u in T ? A(T, u, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[u] = e;
3
- var b = (T, u, e) => M(T, typeof u != "symbol" ? u + "" : u, e);
4
- import { UEAttr as C, ModificationDescription as d } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as P } from "../../common-control.js";
6
- import { ItemsBlockId as m } from "../enums/controlEnums.js";
7
- import { productPairs as p } from "../enums/productEnums.js";
8
- import { ItemTypeOptions as R, OrientationOptions as D, ItemInCartOptions as y, SETTINGS_ENUMS as S } from "../enums/settingsEnums.js";
1
+ var P = Object.defineProperty;
2
+ var f = (I, p, e) => p in I ? P(I, p, { enumerable: !0, configurable: !0, writable: !0, value: e }) : I[p] = e;
3
+ var O = (I, p, e) => f(I, typeof p != "symbol" ? p + "" : p, e);
4
+ import { UEAttr as C, ModificationDescription as m } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as M } from "../../common-control.js";
6
+ import { ItemsBlockId as a } from "../enums/controlEnums.js";
7
+ import { productPairs as d } from "../enums/productEnums.js";
8
+ import { ItemTypeOptions as R, OrientationOptions as A, ItemInCartOptions as S, SETTINGS_ENUMS as N } from "../enums/settingsEnums.js";
9
9
  import x from "../layouts/horizontal.html.js";
10
- import L from "../layouts/vertical.html.js";
11
- import { useItemsBlockStore as H } from "../store/items-block.js";
12
- import { getDefaultTemplate as U } from "../template.js";
13
- import { updateConfigBlockAttributes as f } from "../utils/updateAttributes.js";
14
- const $ = "ui-elements-items-block", s = {
10
+ import b from "../layouts/vertical.html.js";
11
+ import { useItemsBlockStore as D } from "../store/items-block.js";
12
+ import { getDefaultTemplate as L } from "../template.js";
13
+ const H = "ui-elements-items-block", o = {
15
14
  ITEMS_TYPE: "itemsType",
16
15
  ORIENTATION: "orientation",
17
16
  ITEM_IDS: "itemIds"
18
17
  };
19
- class W extends P {
18
+ class v extends M {
20
19
  constructor() {
21
20
  super(...arguments);
22
- b(this, "store", H());
21
+ O(this, "store", D());
23
22
  }
24
23
  getId() {
25
- return $;
24
+ return H;
26
25
  }
27
26
  getTemplate() {
28
27
  return `
@@ -35,16 +34,16 @@ class W extends P {
35
34
  }
36
35
  onRender() {
37
36
  this.api.updateValues({
38
- [s.ORIENTATION]: this.store.orientation,
39
- [s.ITEMS_TYPE]: this.store.itemsType,
40
- [s.ITEM_IDS]: this.store.itemIds
37
+ [o.ORIENTATION]: this.store.orientation,
38
+ [o.ITEMS_TYPE]: this.store.itemsType,
39
+ [o.ITEM_IDS]: this.store.itemIds
41
40
  }), this._listenToFormUpdates();
42
41
  }
43
42
  onTemplateNodeUpdated(e) {
44
43
  this.currentNode = e, this.api.updateValues({
45
- [s.ORIENTATION]: this.store.orientation,
46
- [s.ITEMS_TYPE]: this.store.itemsType,
47
- [s.ITEM_IDS]: this.store.itemIds
44
+ [o.ORIENTATION]: this.store.orientation,
45
+ [o.ITEMS_TYPE]: this.store.itemsType,
46
+ [o.ITEM_IDS]: this.store.itemIds
48
47
  }), this._initializeSelectItems();
49
48
  }
50
49
  onDestroy() {
@@ -56,7 +55,7 @@ class W extends P {
56
55
  ${this._GuOneColumn([
57
56
  this._GuLabel({ text: "Item Type" }),
58
57
  this._GuSelect({
59
- name: s.ITEMS_TYPE,
58
+ name: o.ITEMS_TYPE,
60
59
  className: "es-100",
61
60
  placeholder: "Select Item Type",
62
61
  options: R
@@ -69,8 +68,8 @@ class W extends P {
69
68
  ${this._GuTwoColumns([
70
69
  this._GuLabel({ text: "Orientation" }),
71
70
  this._GuRadioButton({
72
- name: s.ORIENTATION,
73
- buttons: D
71
+ name: o.ORIENTATION,
72
+ buttons: A
74
73
  })
75
74
  ])}
76
75
  `;
@@ -80,7 +79,7 @@ class W extends P {
80
79
  ${this._GuTwoColumns([
81
80
  this._GuLabel({ text: "Item in Cart" }),
82
81
  this._GuSelect({
83
- name: s.ITEM_IDS,
82
+ name: o.ITEM_IDS,
84
83
  className: "es-100",
85
84
  placeholder: "Select Item In Cart",
86
85
  options: []
@@ -89,173 +88,144 @@ class W extends P {
89
88
  `;
90
89
  }
91
90
  _onOrientationChange(e) {
92
- console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.api.updateValues({ [s.ORIENTATION]: e }), f(this.currentNode, this.api), this._reOrderTemplate(), this._recalculateTrimming();
91
+ console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.api.updateValues({ [o.ORIENTATION]: e }), this._reOrderTemplate(), this._recalculateTrimming();
93
92
  }
94
- _onItemsTypeChange(e, i) {
95
- const { itemIds: t } = this.store, r = S.ITEMS_TYPE[e], n = y[i].findIndex((a) => a.value === t), o = y[e][n];
96
- r && (this.store.setItemsType(r), this.store.setItemIds(o.value), f(this.currentNode, this.api), this._updateDataTypeAttributes(r), this._initializeSelectItems(), this._reFillTemplate());
93
+ _onItemsTypeChange(e, t) {
94
+ const { itemIds: i } = this.store, r = N.ITEMS_TYPE[e], n = S[t].findIndex((c) => c.value === i), s = S[e][n];
95
+ r && (this.store.setItemsType(r), this.store.setItemIds(s.value), this._initializeSelectItems(), this._reFillTemplate());
97
96
  }
98
97
  _onItemIdsChange(e) {
99
- console.debug("Item ids changed to: ", e), this.store.setItemIds(e), this.api.updateValues({ [s.ITEM_IDS]: e }), f(this.currentNode, this.api), this._updateDataNumberAttributes(e), this._reFillTemplate();
98
+ console.debug("Item ids changed to: ", e), this.store.setItemIds(e), this.api.updateValues({ [o.ITEM_IDS]: e }), this._reFillTemplate();
100
99
  }
101
100
  _initializeSelectItems() {
102
101
  this.api.setUIEAttribute(
103
- s.ITEMS_TYPE,
102
+ o.ITEMS_TYPE,
104
103
  C.SELECTPICKER.items,
105
104
  R
106
105
  );
107
- const { itemsType: e, itemIds: i } = this.store;
106
+ const { itemsType: e, itemIds: t } = this.store;
108
107
  this.api.updateValues({
109
- [s.ITEMS_TYPE]: e
108
+ [o.ITEMS_TYPE]: e
110
109
  });
111
- const t = y[e];
110
+ const i = S[e];
112
111
  this.api.setUIEAttribute(
113
- s.ITEM_IDS,
112
+ o.ITEM_IDS,
114
113
  C.SELECTPICKER.items,
115
- t
114
+ i
116
115
  ), this.api.updateValues({
117
- [s.ITEM_IDS]: i
116
+ [o.ITEM_IDS]: t
118
117
  });
119
118
  }
120
119
  _listenToFormUpdates() {
121
120
  this.api.onValueChanged(
122
- s.ITEMS_TYPE,
123
- (e, i) => this._onItemsTypeChange(e, i)
121
+ o.ITEMS_TYPE,
122
+ (e, t) => this._onItemsTypeChange(e, t)
124
123
  ), this.api.onValueChanged(
125
- s.ORIENTATION,
124
+ o.ORIENTATION,
126
125
  (e) => this._onOrientationChange(e)
127
126
  ), this.api.onValueChanged(
128
- s.ITEM_IDS,
127
+ o.ITEM_IDS,
129
128
  (e) => this._onItemIdsChange(e)
130
129
  );
131
130
  }
132
131
  _renderTemplate() {
133
132
  const {
134
133
  orientation: e,
135
- itemsType: i,
136
- itemIds: t,
134
+ itemsType: t,
135
+ itemIds: i,
137
136
  currencySymbol: r,
138
137
  currencyLocation: n,
139
- formattedPrice: o
138
+ formattedPrice: s
140
139
  } = this.store;
141
- this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(U({
140
+ this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(L({
142
141
  orientation: e,
143
- itemsType: i,
144
- itemId: t,
142
+ itemsType: t,
143
+ itemId: i,
145
144
  currencySymbol: r,
146
145
  currencyLocation: n,
147
- formattedPrice: o
148
- })).apply(new d("Updated template"));
146
+ formattedPrice: s
147
+ })).apply(new m("Updated template"));
149
148
  }
150
149
  _getTemplateData() {
151
- const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r = y[e].findIndex((o) => o.value === i), n = r > -1 ? r : 0;
150
+ const { itemsType: e, itemIds: t, formattedPrice: i } = this.store, r = S[e].findIndex((s) => s.value === t), n = r > -1 ? r : 0;
152
151
  return {
153
- imageSrc: p.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
154
- name: p.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
155
- price: t ? p.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE_FORMATTED : p.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE,
156
- originalPrice: t ? p.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE_FORMATTED : p.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE,
157
- quantity: p.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT,
158
- button: p.PAIRS_FOR_EXTENSION.button[e].DEFAULT_LABEL
152
+ imageSrc: d.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
153
+ name: d.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
154
+ price: i ? d.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE_FORMATTED : d.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE,
155
+ originalPrice: i ? d.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE_FORMATTED : d.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE,
156
+ quantity: d.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT,
157
+ button: d.PAIRS_FOR_EXTENSION.button[e].DEFAULT_LABEL
159
158
  };
160
159
  }
161
160
  _updateImageSrc(e) {
162
- var t;
163
- const i = (t = this.currentNode) == null ? void 0 : t.querySelector(`[esd-extension-block-id="${m.IMAGE}"] img`);
164
- i && this.api.getDocumentModifier().modifyHtml(i).setAttribute("src", e).apply(new d("Updated image src"));
161
+ var i;
162
+ const t = (i = this.currentNode) == null ? void 0 : i.querySelector(`[esd-extension-block-id="${a.IMAGE}"] img`);
163
+ t && this.api.getDocumentModifier().modifyHtml(t).setAttribute("src", e).apply(new m("Updated image src"));
165
164
  }
166
165
  _updateName(e) {
167
166
  var n;
168
- const i = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${m.NAME}"]`);
169
- if (!i)
167
+ const t = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${a.NAME}"]`);
168
+ if (!t)
170
169
  return;
171
- const t = i.getInnerText().trim();
172
- let r = i.getInnerHTML();
173
- r = r.replace(t, e), this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(r).apply(new d("Updated name"));
170
+ const i = t.getInnerText().trim();
171
+ let r = t.getInnerHTML();
172
+ r = r.replace(i, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(r).apply(new m("Updated name"));
174
173
  }
175
174
  _updatePrice(e) {
176
175
  var g;
177
- const i = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${m.PRICE}"]`);
178
- if (!i)
179
- return;
180
- const t = this._getParagraphFromBlock(i);
176
+ const t = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${a.PRICE}"]`);
181
177
  if (!t)
182
178
  return;
183
- const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol: o, currencyLocation: a } = this.store, l = (o == null ? void 0 : o.trim()) || "", c = this._removeCurrencySymbol(n, l), I = this._replacePriceNumber(c, e), h = this._buildPriceContent(I, l, a), _ = r.replace(n, h);
184
- this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(_).apply(new d("Updated price"));
179
+ const i = this._getParagraphFromBlock(t);
180
+ if (!i)
181
+ return;
182
+ const r = i.getInnerHTML() || "", n = i.getInnerText() || "", { currencySymbol: s, currencyLocation: c } = this.store, l = (s == null ? void 0 : s.trim()) || "", u = this._removeCurrencySymbol(n, l), T = this._replacePriceNumber(u, e), h = this._buildPriceContent(T, l, c), _ = r.replace(n, h);
183
+ this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(_).apply(new m("Updated price"));
185
184
  }
186
185
  _updateOriginalPrice(e) {
187
- var E;
188
- const i = (E = this.currentNode) == null ? void 0 : E.querySelector(
189
- `[esd-extension-block-id="${m.ORIGINAL_PRICE}"]`
186
+ var y;
187
+ const t = (y = this.currentNode) == null ? void 0 : y.querySelector(
188
+ `[esd-extension-block-id="${a.ORIGINAL_PRICE}"]`
190
189
  );
191
- if (!i)
192
- return;
193
- const t = this._getParagraphFromBlock(i);
194
190
  if (!t)
195
191
  return;
196
- const r = t.querySelector("s");
192
+ const i = this._getParagraphFromBlock(t);
193
+ if (!i)
194
+ return;
195
+ const r = i.querySelector("s");
197
196
  if (!r)
198
197
  return;
199
- const n = r.getInnerHTML() || "", o = r.getInnerText() || "", { currencySymbol: a, currencyLocation: l } = this.store, c = (a == null ? void 0 : a.trim()) || "", I = this._removeCurrencySymbol(o, c), h = this._replacePriceNumber(I, e), _ = this._buildPriceContent(h, c, l), N = `<s>${n.replace(o, _)}</s>`;
200
- this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(N).apply(new d("Updated original price"));
198
+ const n = r.getInnerHTML() || "", s = r.getInnerText() || "", { currencySymbol: c, currencyLocation: l } = this.store, u = (c == null ? void 0 : c.trim()) || "", T = this._removeCurrencySymbol(s, u), h = this._replacePriceNumber(T, e), _ = this._buildPriceContent(h, u, l), E = `<s>${n.replace(s, _)}</s>`;
199
+ this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(E).apply(new m("Updated original price"));
201
200
  }
202
201
  _updateQuantity(e) {
203
- var a;
204
- const i = this.store.itemsType !== S.ITEMS_TYPE.BROWSED_ITEMS, t = (a = this.currentNode) == null ? void 0 : a.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`);
202
+ var n;
203
+ const t = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${a.QUANTITY}"]`);
205
204
  if (!t)
206
205
  return;
207
- const r = t.getStyle("display") === "none", n = t.getInnerText().trim();
208
- let o = t.getInnerHTML();
209
- o = o.replace(n, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(o).setStyle("display", i && !r ? "table-cell" : "none").apply(new d("Updated quantity"));
206
+ const i = t.getInnerText().trim();
207
+ let r = t.getInnerHTML();
208
+ r = r.replace(i, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(r).apply(new m("Updated quantity"));
210
209
  }
211
210
  _updateButton(e) {
212
211
  var n;
213
- const i = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`);
214
- if (!i)
212
+ const t = (n = this.currentNode) == null ? void 0 : n.querySelector(`[esd-extension-block-id="${a.BUTTON}"]`);
213
+ if (!t)
215
214
  return;
216
- const t = i.getInnerText().trim();
217
- let r = i.getInnerHTML();
218
- r = r.replace(t, e), this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(r).apply(new d("Updated button"));
215
+ const i = t.getInnerText().trim();
216
+ let r = t.getInnerHTML();
217
+ r = r.replace(i, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(r).apply(new m("Updated button"));
219
218
  }
220
219
  _reOrderTemplate() {
221
- var I, h, _, g, N, E, O;
222
- const e = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${m.IMAGE}"]`), i = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${m.NAME}"]`), t = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${m.PRICE}"]`), r = (g = this.currentNode) == null ? void 0 : g.querySelector(
223
- `[esd-extension-block-id="${m.ORIGINAL_PRICE}"]`
224
- ), n = (N = this.currentNode) == null ? void 0 : N.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`), o = (E = this.currentNode) == null ? void 0 : E.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`), a = (O = this.currentNode) == null ? void 0 : O.querySelector("esd-config-block");
225
- if (!e || !i || !t || !r || !n || !o || !a)
226
- return;
227
- const { orientation: l } = this.store;
228
- let c = l === S.ORIENTATION.VERTICAL ? L : x;
229
- c = c.replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", i.getOuterHTML()).replace("{-{-PRODUCT_PRICE-}-}", t.getOuterHTML()).replace("{-{-PRODUCT_ORIGINAL_PRICE-}-}", r.getOuterHTML()).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", o.getOuterHTML()).replace("{-{-CONFIG_BLOCK-}-}", a.getOuterHTML()), c = c.trim().replace('<td align="center" class="ins-product-td items-block">', "").slice(0, -5), this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(c).apply(new d("Reordered template"));
230
- }
231
- _updateDataTypeAttributes(e) {
232
- if (!this.currentNode)
233
- return;
234
- const i = this.currentNode.closest(".ins-product-td"), t = this.api.getDocumentModifier();
235
- i && t.modifyHtml(i).setAttribute("data-type", e), this.currentNode.querySelectorAll("[data-type]").forEach((n) => {
236
- const o = n;
237
- t.modifyHtml(o).setAttribute("data-type", e);
238
- }), t.apply(new d("Updated data-type attribute"));
239
- }
240
- _updateDataNumberAttributes(e) {
241
- if (!this.currentNode)
220
+ var u, T, h, _, g, E;
221
+ const e = (u = this.currentNode) == null ? void 0 : u.querySelector(`[esd-extension-block-id="${a.IMAGE}"]`), t = (T = this.currentNode) == null ? void 0 : T.querySelector(`[esd-extension-block-id="${a.NAME}"]`), i = (h = this.currentNode) == null ? void 0 : h.querySelector(`[esd-extension-block-id="${a.PRICE}"]`), r = (_ = this.currentNode) == null ? void 0 : _.querySelector(
222
+ `[esd-extension-block-id="${a.ORIGINAL_PRICE}"]`
223
+ ), n = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${a.QUANTITY}"]`), s = (E = this.currentNode) == null ? void 0 : E.querySelector(`[esd-extension-block-id="${a.BUTTON}"]`);
224
+ if (!e || !t || !i || !r || !n || !s)
242
225
  return;
243
- const { itemsType: i } = this.store, t = y[i].findIndex((l) => l.value === e);
244
- let r = "1";
245
- if (t >= 0)
246
- r = String(t + 1);
247
- else if (e) {
248
- const l = e.match(/\((\d+)\)/);
249
- if (l) {
250
- const [, c] = l;
251
- r = c;
252
- }
253
- }
254
- const n = this.currentNode.closest(".ins-product-td"), o = this.api.getDocumentModifier();
255
- n && o.modifyHtml(n).setAttribute("data-number", r), this.currentNode.querySelectorAll("[data-number]").forEach((l) => {
256
- const c = l;
257
- o.modifyHtml(c).setAttribute("data-number", r);
258
- }), o.apply(new d("Updated data-number attribute"));
226
+ const { orientation: c } = this.store;
227
+ let l = c === N.ORIENTATION.VERTICAL ? b : x;
228
+ l = l.replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", t.getOuterHTML()).replace("{-{-PRODUCT_PRICE-}-}", i.getOuterHTML()).replace("{-{-PRODUCT_ORIGINAL_PRICE-}-}", r.getOuterHTML()).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", s.getOuterHTML()), l = l.trim().replace('<td align="center" class="ins-product-td items-block">', "").slice(0, -5), this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(l).apply(new m("Reordered template"));
259
229
  }
260
230
  _reFillTemplate() {
261
231
  const e = this._getTemplateData();
@@ -265,14 +235,14 @@ class W extends P {
265
235
  var r;
266
236
  if (!this.store.nameTrimming || !this.currentNode)
267
237
  return;
268
- const e = (r = this.currentNode) == null ? void 0 : r.querySelector(`[esd-extension-block-id="${m.NAME}"]`);
238
+ const e = (r = this.currentNode) == null ? void 0 : r.querySelector(`[esd-extension-block-id="${a.NAME}"]`);
269
239
  if (!e)
270
240
  return;
271
- const i = e.querySelector("p");
272
- if (!i)
241
+ const t = e.querySelector("p");
242
+ if (!t)
273
243
  return;
274
- const t = this.store.orientation === S.ORIENTATION.VERTICAL;
275
- this.api.getDocumentModifier().modifyHtml(i).setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis").setStyle("max-width", t ? "130px" : "100%").apply(new d("Recalculated trimming after orientation change"));
244
+ const i = this.store.orientation === N.ORIENTATION.VERTICAL;
245
+ this.api.getDocumentModifier().modifyHtml(t).setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis").setStyle("max-width", i ? "130px" : "100%").apply(new m("Recalculated trimming after orientation change"));
276
246
  }
277
247
  _getParagraphFromBlock(e) {
278
248
  return e.querySelector("p");
@@ -280,30 +250,30 @@ class W extends P {
280
250
  _escapeRegex(e) {
281
251
  return e.replace(/[-\\^$*+?().|[\]{}]/g, "\\$&");
282
252
  }
283
- _removeCurrencySymbol(e, i) {
284
- const t = e || "";
285
- let r = t;
286
- if (i) {
287
- const n = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
288
- r = t.replace(n, "").trim();
253
+ _removeCurrencySymbol(e, t) {
254
+ const i = e || "";
255
+ let r = i;
256
+ if (t) {
257
+ const n = new RegExp(`\\s*${this._escapeRegex(t)}\\s*`);
258
+ r = i.replace(n, "").trim();
289
259
  } else {
290
- const n = t.match(/([^0-9.,\s]+)/);
260
+ const n = i.match(/([^0-9.,\s]+)/);
291
261
  if (n && n[1]) {
292
- const o = n[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(o)}\\s*`);
293
- r = t.replace(a, "").trim();
262
+ const s = n[1].trim(), c = new RegExp(`\\s*${this._escapeRegex(s)}\\s*`);
263
+ r = i.replace(c, "").trim();
294
264
  }
295
265
  }
296
266
  return r;
297
267
  }
298
- _replacePriceNumber(e, i) {
299
- const t = /([0-9][0-9,.]*)/;
300
- return e.replace(t, i).trim();
268
+ _replacePriceNumber(e, t) {
269
+ const i = /([0-9][0-9,.]*)/;
270
+ return e.replace(i, t).trim();
301
271
  }
302
- _buildPriceContent(e, i, t) {
303
- return i ? t === "1" ? `${e}&nbsp;${i}&nbsp;` : `${i}&nbsp;${e}` : e;
272
+ _buildPriceContent(e, t, i) {
273
+ return t ? i === "1" ? `${e}&nbsp;${t}&nbsp;` : `${t}&nbsp;${e}` : e;
304
274
  }
305
275
  }
306
276
  export {
307
- $ as CONTROL_BLOCK_ID,
308
- W as ItemsBlockControl
277
+ H as CONTROL_BLOCK_ID,
278
+ v as ItemsBlockControl
309
279
  };