@useinsider/guido 1.0.3-beta.5361682 → 1.0.3-beta.538b804

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 (86) hide show
  1. package/README.md +0 -32
  2. package/dist/composables/useActionsApi.js +1 -1
  3. package/dist/composables/useHtmlValidator.js +36 -35
  4. package/dist/enums/unsubscribe.js +27 -26
  5. package/dist/extensions/Blocks/Items/block.js +26 -26
  6. package/dist/extensions/Blocks/Items/controls/name/trimming.js +1 -1
  7. package/dist/extensions/Blocks/Items/controls/settingsControl.js +48 -36
  8. package/dist/extensions/Blocks/Items/enums/productEnums.js +62 -4
  9. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +57 -57
  10. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +54 -55
  11. package/dist/extensions/Blocks/Items/template.js +79 -82
  12. package/dist/extensions/Blocks/Unsubscribe/block.js +27 -27
  13. package/dist/node_modules/lodash-es/_DataView.js +6 -0
  14. package/dist/node_modules/lodash-es/_Promise.js +6 -0
  15. package/dist/node_modules/lodash-es/_Set.js +6 -0
  16. package/dist/node_modules/lodash-es/_SetCache.js +13 -0
  17. package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
  18. package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
  19. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +13 -12
  20. package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
  21. package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
  22. package/dist/node_modules/lodash-es/_arraySome.js +9 -0
  23. package/dist/node_modules/lodash-es/_baseEach.js +6 -0
  24. package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
  25. package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
  26. package/dist/node_modules/lodash-es/_baseGet.js +11 -0
  27. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  28. package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
  29. package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
  30. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
  31. package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
  32. package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
  33. package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
  34. package/dist/node_modules/lodash-es/_baseMap.js +11 -0
  35. package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
  36. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  37. package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
  38. package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  39. package/dist/node_modules/lodash-es/_baseRange.js +9 -0
  40. package/dist/node_modules/lodash-es/_baseToString.js +18 -0
  41. package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
  42. package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
  43. package/dist/node_modules/lodash-es/_castPath.js +10 -0
  44. package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
  45. package/dist/node_modules/lodash-es/_createRange.js +11 -0
  46. package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
  47. package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
  48. package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
  49. package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
  50. package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
  51. package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
  52. package/dist/node_modules/lodash-es/_getTag.js +28 -0
  53. package/dist/node_modules/lodash-es/_hasPath.js +19 -0
  54. package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
  55. package/dist/node_modules/lodash-es/_isKey.js +12 -0
  56. package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
  57. package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
  58. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  59. package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
  60. package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
  61. package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
  62. package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
  63. package/dist/node_modules/lodash-es/_setToArray.js +9 -0
  64. package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
  65. package/dist/node_modules/lodash-es/_toKey.js +10 -0
  66. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
  67. package/dist/node_modules/lodash-es/flatMap.js +8 -0
  68. package/dist/node_modules/lodash-es/get.js +8 -0
  69. package/dist/node_modules/lodash-es/hasIn.js +8 -0
  70. package/dist/node_modules/lodash-es/isSymbol.js +9 -0
  71. package/dist/node_modules/lodash-es/keys.js +9 -0
  72. package/dist/node_modules/lodash-es/keysIn.js +3 -3
  73. package/dist/node_modules/lodash-es/map.js +11 -0
  74. package/dist/node_modules/lodash-es/property.js +10 -0
  75. package/dist/node_modules/lodash-es/range.js +5 -0
  76. package/dist/node_modules/lodash-es/stubArray.js +6 -0
  77. package/dist/node_modules/lodash-es/toFinite.js +14 -0
  78. package/dist/node_modules/lodash-es/toNumber.js +22 -0
  79. package/dist/node_modules/lodash-es/toString.js +7 -0
  80. package/dist/src/extensions/Blocks/Items/block.d.ts +14 -0
  81. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +4 -0
  82. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +2 -0
  83. package/dist/src/extensions/Blocks/Items/template.d.ts +9 -1
  84. package/dist/src/utils/environmentUtil.d.ts +5 -0
  85. package/dist/utils/environmentUtil.js +4 -0
  86. package/package.json +2 -9
@@ -1,60 +1,60 @@
1
- const t = `<td align="center" class="ins-product-td items-block items-block-v2">
2
- <table class="es-left ins-product-wrapper" cellspacing="0" cellpadding="0" align="left" width="100%">
3
- {-{-CONFIG_BLOCK-}-}
4
- <tbody>
5
- <tr>
6
- <td class="es-p20b es-p10r es-p10l es-m-p20b es-p10t" width="100%" align="center">
7
- <table class="ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
8
- <tr style="vertical-align: top">
9
- <td colspan="2" width="100%" align="center" data-slot-1>
10
- <table width="100%">
11
- <tbody>
12
- {-{-PRODUCT_IMAGE-}-}
13
- </tbody>
14
- </table>
15
- </td>
16
- </tr>
17
- {-{-PRODUCT_NAME-}-}
18
- <tr>
19
- <td width="50%" style=" width: 50%;display: block;float: left;" class="product-price-class">
20
- <table width="100%">
21
- <tbody>
22
- {-{-PRODUCT_PRICE-}-}
23
- </tbody>
24
- </table>
25
- </td>
26
- <td width="50%" style=" width: 50%;display: block;float: left;"
27
- class="product-original-price-class">
28
- <table width="100%">
29
- <tbody>
30
- {-{-PRODUCT_ORIGINAL_PRICE-}-}
31
- </tbody>
32
- </table>
33
- </td>
34
- </tr>
35
- <tr>
36
- <td width="100%">
37
- <table width="100%">
38
- <tbody>
39
- {-{-PRODUCT_QUANTITY-}-}
40
- </tbody>
41
- </table>
42
- </td>
43
- </tr>
44
- <tr>
45
- <td width="100%">
46
- <table width="100%">
47
- <tbody>
48
- {-{-PRODUCT_BUTTON-}-}
49
- </tbody>
50
- </table>
51
- </td>
52
- </tr>
53
- </table>
54
- </td>
55
- </tr>
56
- </tbody>
57
- </table>
1
+ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
2
+ <table class="es-left ins-product-wrapper" cellspacing="0" cellpadding="0" align="left" width="100%">
3
+ {-{-CONFIG_BLOCK-}-}
4
+ <tbody>
5
+ <tr>
6
+ <td class="es-p20b es-p10r es-p10l es-m-p20b es-p10t" width="100%" align="center">
7
+ <table class="ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
8
+ <tr style="vertical-align: top">
9
+ <td colspan="2" width="100%" align="center" data-slot-1>
10
+ <table width="100%">
11
+ <tbody>
12
+ {-{-PRODUCT_IMAGE-}-}
13
+ </tbody>
14
+ </table>
15
+ </td>
16
+ </tr>
17
+ {-{-PRODUCT_NAME-}-}
18
+ <tr>
19
+ <td width="50%" style=" width: 50%;display: block;float: left;" class="product-price-class">
20
+ <table width="100%">
21
+ <tbody>
22
+ {-{-PRODUCT_PRICE-}-}
23
+ </tbody>
24
+ </table>
25
+ </td>
26
+ <td width="50%" style=" width: 50%;display: block;float: left;"
27
+ class="product-original-price-class">
28
+ <table width="100%">
29
+ <tbody>
30
+ {-{-PRODUCT_ORIGINAL_PRICE-}-}
31
+ </tbody>
32
+ </table>
33
+ </td>
34
+ </tr>
35
+ <tr>
36
+ <td width="100%">
37
+ <table width="100%">
38
+ <tbody>
39
+ {-{-PRODUCT_QUANTITY-}-}
40
+ </tbody>
41
+ </table>
42
+ </td>
43
+ </tr>
44
+ <tr>
45
+ <td width="100%">
46
+ <table width="100%">
47
+ <tbody>
48
+ {-{-PRODUCT_BUTTON-}-}
49
+ </tbody>
50
+ </table>
51
+ </td>
52
+ </tr>
53
+ </table>
54
+ </td>
55
+ </tr>
56
+ </tbody>
57
+ </table>
58
58
  </td>
59
59
  `;
60
60
  export {
@@ -1,59 +1,58 @@
1
- const t = `<td align="center" class="ins-product-td items-block items-block-v2">
2
- <table class="es-left ins-product-wrapper ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
3
- {-{-CONFIG_BLOCK-}-}
4
- <tbody>
5
- <tr>
6
- <td style="padding: 16px 9px;">
7
- <table class="es-left esdev-disable-select" cellspacing="0" cellpadding="0" align="left"
8
- width="100%">
9
- <tbody>
10
- <tr>
11
- <td class="product-image-class" data-slot-1>
12
- {-{-PRODUCT_IMAGE-}-}
13
- </td>
14
- <td class="product-name-class" data-slot-2 width="130px">
15
- <table width="130">
16
- <tbody>
17
- {-{-PRODUCT_NAME-}-}
18
- </tbody>
19
- </table>
20
- </td>
21
- <td class="product-quantity-class" data-slot-3>
22
- <table width="100%">
23
- <tbody>
24
- {-{-PRODUCT_QUANTITY-}-}
25
- </tbody>
26
- </table>
27
- </td>
28
- <td class="product-price-class" data-slot-4>
1
+ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
2
+ <table class="es-left ins-product-wrapper ins-product-cart" width="100%" cellspacing="0" cellpadding="0">
3
+ {-{-CONFIG_BLOCK-}-}
4
+ <tbody>
5
+ <tr>
6
+ <td style="padding: 16px 9px;">
7
+ <table class="es-left esdev-disable-select" cellspacing="0" cellpadding="0" align="left" width="100%">
8
+ <tbody>
9
+ <tr>
10
+ <td class="product-image-class" data-slot-1>
11
+ {-{-PRODUCT_IMAGE-}-}
12
+ </td>
13
+ <td class="product-name-class" data-slot-2 width="130px">
14
+ <table width="130">
15
+ <tbody>
16
+ {-{-PRODUCT_NAME-}-}
17
+ </tbody>
18
+ </table>
19
+ </td>
20
+ <td class="product-quantity-class" data-slot-3>
21
+ <table width="100%">
22
+ <tbody>
23
+ {-{-PRODUCT_QUANTITY-}-}
24
+ </tbody>
25
+ </table>
26
+ </td>
27
+ <td class="product-price-class" data-slot-4>
29
28
 
30
- <table width="100%">
31
- <tbody>
32
- {-{-PRODUCT_PRICE-}-}
33
- </tbody>
34
- </table>
35
- </td>
36
- <td class="product-original-price-class" data-slot-5>
37
- <table width="100%">
38
- <tbody>
39
- {-{-PRODUCT_ORIGINAL_PRICE-}-}
40
- </tbody>
41
- </table>
42
- </td>
43
- <td class="product-button-class" data-slot-6>
44
- <table width="100%">
45
- <tbody>
46
- {-{-PRODUCT_BUTTON-}-}
47
- </tbody>
48
- </table>
49
- </td>
50
- </tr>
51
- </tbody>
52
- </table>
53
- </td>
54
- </tr>
55
- </tbody>
56
- </table>
29
+ <table width="100%">
30
+ <tbody>
31
+ {-{-PRODUCT_PRICE-}-}
32
+ </tbody>
33
+ </table>
34
+ </td>
35
+ <td class="product-original-price-class" data-slot-5>
36
+ <table width="100%">
37
+ <tbody>
38
+ {-{-PRODUCT_ORIGINAL_PRICE-}-}
39
+ </tbody>
40
+ </table>
41
+ </td>
42
+ <td class="product-button-class" data-slot-6>
43
+ <table width="100%">
44
+ <tbody>
45
+ {-{-PRODUCT_BUTTON-}-}
46
+ </tbody>
47
+ </table>
48
+ </td>
49
+ </tr>
50
+ </tbody>
51
+ </table>
52
+ </td>
53
+ </tr>
54
+ </tbody>
55
+ </table>
57
56
  </td>
58
57
  `;
59
58
  export {
@@ -1,61 +1,58 @@
1
- import { BlockType as l, BlockAttr as I } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { ItemsBlockId as T } from "./enums/controlEnums.js";
3
- import { productPairs as c } from "./enums/productEnums.js";
4
- import { ItemInCartOptions as N, SETTINGS_ENUMS as O } from "./enums/settingsEnums.js";
5
- import P from "./layouts/horizontal.html.js";
6
- import S from "./layouts/vertical.html.js";
7
- const B = `text-decoration:none;
8
- font-family:-apple-system,
9
- BlinkMacSystemFont,
10
- 'Segoe UI',
11
- Roboto,
12
- Helvetica,
13
- Arial,
14
- sans-serif,
15
- 'Apple Color Emoji',
16
- 'Segoe UI Emoji',
17
- 'Segoe UI Symbol'
18
- `;
19
- let [R] = c.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [C] = c.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [_] = c.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [$] = c.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [u] = c.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
20
- const f = (a, t) => `
1
+ import { BlockType as l, BlockAttr as _ } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { ItemsBlockId as d } from "./enums/controlEnums.js";
3
+ import { productPairs as i, templateFirstLine as N } from "./enums/productEnums.js";
4
+ import { ItemInCartOptions as P, SETTINGS_ENUMS as O } from "./enums/settingsEnums.js";
5
+ import f from "./layouts/horizontal.html.js";
6
+ import B from "./layouts/vertical.html.js";
7
+ let [R] = i.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [C] = i.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [I] = i.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [$] = i.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [u] = i.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
8
+ const g = (a, t) => `
21
9
  <${l.BLOCK_IMAGE}
22
- ${I.BLOCK_IMAGE.src}="${R}"
23
- ${I.BLOCK_IMAGE.alt}="Product Image"
24
- ${I.BLOCK_IMAGE.href}="#!"
25
- ${I.BLOCK_IMAGE.width}="70"
26
- esd-extension-block-id="${T.IMAGE}"
10
+ ${_.BLOCK_IMAGE.src}="${R}"
11
+ ${_.BLOCK_IMAGE.alt}="Product Image"
12
+ ${_.BLOCK_IMAGE.href}="#!"
13
+ ${_.BLOCK_IMAGE.width}="70"
14
+ esd-extension-block-id="${d.IMAGE}"
27
15
  data-slot-1
28
16
  product-attr="imageSrc"
29
17
  data-type="${a}"
30
18
  data-number="${t}"
31
19
  />
32
- `, g = (a) => `
20
+ `, F = (a) => `
33
21
  <${l.BLOCK_TEXT}
34
22
  width="100%"
35
23
  align="center"
36
24
  class="es-p10"
37
25
  data-type="${a}"
38
- esd-extension-block-id="${T.NAME}"
26
+ esd-extension-block-id="${d.NAME}"
39
27
  >
40
- <a
41
- href="#!"
42
- style="${B}"
43
- product-attr="name"
44
- data-slot-2
45
- width="100%">
46
- ${C}
47
- </a>
28
+ <p contenteditable="false">
29
+ <a
30
+ href="#!"
31
+ style="
32
+ text-decoration:none;
33
+ font-size: inherit;
34
+ font-weight: inherit;
35
+ line-height: inherit;
36
+ font-family: inherit;
37
+ color: inherit;
38
+ "
39
+ product-attr="name"
40
+ data-slot-2
41
+ width="100%">
42
+ ${C}
43
+ </a>
44
+ </p>
48
45
  </${l.BLOCK_TEXT}>
49
- `, F = (a, t, o, e, i) => {
50
- let n = _;
46
+ `, S = (a, t, n, e, c) => {
47
+ let o = I;
51
48
  if (e && e.trim()) {
52
- const d = `&nbsp;${e.trim()}&nbsp;`;
53
- n = (i || "0") === "1" ? `${_}${d}` : `${d}${_}`;
49
+ const T = `&nbsp;${e.trim()}&nbsp;`;
50
+ o = (c || "0") === "1" ? `${I}${T}` : `${T}${I}`;
54
51
  }
55
- const r = i === "1" ? "after" : "before", s = `data-formated="${o ? "true" : "false"}"`, E = `data-curency="${r}"`;
52
+ const r = c === "1" ? "after" : "before", E = `data-formated="${n ? "true" : "false"}"`, s = `data-curency="${r}"`;
56
53
  return `
57
54
  <${l.BLOCK_TEXT}
58
- esd-extension-block-id="${T.PRICE}"
55
+ esd-extension-block-id="${d.PRICE}"
59
56
  class="items-block-price"
60
57
  width="100%"
61
58
  align="center"
@@ -66,25 +63,25 @@ const f = (a, t) => `
66
63
  data-slot-4
67
64
  data-type="${a}"
68
65
  data-number="${t}"
69
- ${s}
70
66
  ${E}
67
+ ${s}
71
68
  ${e ? `data-currency_symbol="${e}"` : ""}
72
69
  >
73
- ${n}
70
+ ${o}
74
71
  </p>
75
72
  </${l.BLOCK_TEXT}>
76
73
  `;
77
- }, b = (a, t, o, e, i) => {
78
- let n = $;
74
+ }, L = (a, t, n, e, c) => {
75
+ let o = $;
79
76
  if (e && e.trim()) {
80
- const d = `&nbsp;${e.trim()}&nbsp;`;
81
- n = (i || "0") === "1" ? `${$}${d}` : `${d}${$}`;
77
+ const T = `&nbsp;${e.trim()}&nbsp;`;
78
+ o = (c || "0") === "1" ? `${$}${T}` : `${T}${$}`;
82
79
  }
83
- const r = i === "1" ? "after" : "before", s = `data-formated="${o ? "true" : "false"}"`, E = `data-curency="${r}"`;
80
+ const r = c === "1" ? "after" : "before", E = `data-formated="${n ? "true" : "false"}"`, s = `data-curency="${r}"`;
84
81
  return `
85
82
  <${l.BLOCK_TEXT}
86
83
  class="items-block-price"
87
- esd-extension-block-id="${T.ORIGINAL_PRICE}"
84
+ esd-extension-block-id="${d.ORIGINAL_PRICE}"
88
85
  width="100%"
89
86
  align="center"
90
87
  >
@@ -95,20 +92,20 @@ const f = (a, t) => `
95
92
  style="color: #cc0000"
96
93
  data-type="${a}"
97
94
  data-number="${t}"
98
- ${s}
99
95
  ${E}
96
+ ${s}
100
97
  ${e ? `data-currency_symbol="${e}"` : ""}
101
98
  >
102
- <s>${n}</s>
99
+ <s>${o}</s>
103
100
  </p>
104
101
  </${l.BLOCK_TEXT}>
105
102
  `;
106
- }, U = () => `
103
+ }, b = () => `
107
104
  <${l.BLOCK_TEXT}
108
105
  width="100%"
109
106
  align="center"
110
107
  class="es-p10"
111
- esd-extension-block-id="${T.QUANTITY}"
108
+ esd-extension-block-id="${d.QUANTITY}"
112
109
  >
113
110
  <p
114
111
  product-attr="quantity"
@@ -118,73 +115,73 @@ const f = (a, t) => `
118
115
  ${u}
119
116
  </p>
120
117
  </${l.BLOCK_TEXT}>
121
- `, L = (a, t) => `
118
+ `, h = (a, t) => `
122
119
  <${l.BLOCK_BUTTON}
123
120
  width="100%"
124
121
  class="ins-button"
125
122
  name="buy-button"
126
123
  caption="Buy"
127
124
  align="center"
128
- esd-extension-block-id="${T.BUTTON}"
125
+ esd-extension-block-id="${d.BUTTON}"
129
126
  product-attr="button"
130
127
  data-slot-6
131
128
  data-type="${a}"
132
129
  data-number="${t}"
133
130
  >Buy
134
131
  </${l.BLOCK_BUTTON}>
135
- `, m = () => `
132
+ `, U = () => `
136
133
  <esd-config-block style="display: none;"></esd-config-block>
137
- `, p = (a, t, o, e, i, n, r, s) => {
138
- const A = `${`data-type="${t}" data-number="${o}"`} data-orientation="${e}"`;
134
+ `, p = (a, t, n, e, c, o, r, E) => {
135
+ const A = `${`data-type="${t}" data-number="${n}"`} data-orientation="${e}"`;
139
136
  return a.replace(
140
137
  /<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
141
138
  `<td$1 ${A}>`
142
- ).replace("{-{-PRODUCT_IMAGE-}-}", f(t, o)).replace("{-{-PRODUCT_NAME-}-}", g(t)).replace(
139
+ ).replace("{-{-TEMPLATE_FIRST_LINE-}-}", N).replace("{-{-PRODUCT_IMAGE-}-}", g(t, n)).replace("{-{-PRODUCT_NAME-}-}", F(t)).replace(
143
140
  "{-{-PRODUCT_PRICE-}-}",
144
- F(t, o, i, n, r)
141
+ S(t, n, c, o, r)
145
142
  ).replace(
146
143
  "{-{-PRODUCT_ORIGINAL_PRICE-}-}",
147
- b(
144
+ L(
148
145
  t,
149
- o,
150
- i,
151
146
  n,
147
+ c,
148
+ o,
152
149
  r
153
150
  )
154
- ).replace("{-{-PRODUCT_QUANTITY-}-}", U()).replace("{-{-PRODUCT_BUTTON-}-}", L(t, o)).replace("{-{-CONFIG_BLOCK-}-}", m());
151
+ ).replace("{-{-PRODUCT_QUANTITY-}-}", b()).replace("{-{-PRODUCT_BUTTON-}-}", h(t, n)).replace("{-{-CONFIG_BLOCK-}-}", U());
155
152
  };
156
153
  function x({
157
154
  orientation: a,
158
155
  itemsType: t = O.ITEMS_TYPE.CART_ITEMS,
159
- itemId: o,
156
+ itemId: n,
160
157
  currencySymbol: e,
161
- currencyLocation: i,
162
- formattedPrice: n = !0
158
+ currencyLocation: c,
159
+ formattedPrice: o = !0
163
160
  }) {
164
- const r = N[t].findIndex((E) => E.value === o);
165
- let s = "1";
161
+ const r = P[t].findIndex((s) => s.value === n);
162
+ let E = "1";
166
163
  if (r >= 0)
167
- s = String(r + 1);
168
- else if (o) {
169
- const E = o.match(/\((\d+)\)/);
170
- E && ([s] = E);
164
+ E = String(r + 1);
165
+ else if (n) {
166
+ const s = n.match(/\((\d+)\)/);
167
+ s && s[1] && ([, E] = s);
171
168
  }
172
- return R = c.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[r >= 0 ? r : 0], C = c.PAIRS_FOR_EXTENSION.name[t].DEFAULT[r >= 0 ? r : 0], _ = n ? c.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : c.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, $ = n ? c.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : c.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, u = c.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, a === O.ORIENTATION.VERTICAL ? p(
173
- S,
169
+ return R = i.PAIRS_FOR_EXTENSION.imageSrc[t].DEFAULT[r >= 0 ? r : 0], C = i.PAIRS_FOR_EXTENSION.name[t].DEFAULT[r >= 0 ? r : 0], I = o ? i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.price[t].DEFAULT_PRICE, $ = o ? i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE_FORMATTED : i.PAIRS_FOR_EXTENSION.originalPrice[t].DEFAULT_PRICE, u = i.PAIRS_FOR_EXTENSION.quantity[t].DEFAULT, a === O.ORIENTATION.VERTICAL ? p(
170
+ B,
174
171
  t,
175
- s,
172
+ E,
176
173
  a,
177
- n,
174
+ o,
178
175
  e,
179
- i
176
+ c
180
177
  ) : p(
181
- P,
178
+ f,
182
179
  t,
183
- s,
180
+ E,
184
181
  a,
185
- n,
182
+ o,
186
183
  e,
187
- i
184
+ c
188
185
  );
189
186
  }
190
187
  export {
@@ -1,17 +1,17 @@
1
1
  var _ = Object.defineProperty;
2
- var d = (n, i, e) => i in n ? _(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
3
- var u = (n, i, e) => d(n, typeof i != "symbol" ? i + "" : i, e);
2
+ var S = (n, i, e) => i in n ? _(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
3
+ var u = (n, i, e) => S(n, typeof i != "symbol" ? i + "" : i, e);
4
4
  import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
5
5
  import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
6
- import { Block as S, BlockCompositionType as h, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- import { getDefaultTemplate as L } from "./template.js";
6
+ import { Block as d, BlockCompositionType as L, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
+ import { getDefaultTemplate as h } from "./template.js";
8
8
  import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
9
9
  import { parsePageList as m } from "./utils/utils.js";
10
- const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', B = ".unsubscribe-block-v2", f = "{{ins-unsubscribe-link}}", C = {
10
+ const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', T = ".unsubscribe-block-v2", f = "{{ins-unsubscribe-link}}", B = {
11
11
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
12
12
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
13
13
  };
14
- class D extends S {
14
+ class D extends d {
15
15
  constructor() {
16
16
  super();
17
17
  u(this, "selectEventListener", null);
@@ -25,7 +25,7 @@ class D extends S {
25
25
  return "unsubscribe-icon";
26
26
  }
27
27
  getBlockCompositionType() {
28
- return h.BLOCK;
28
+ return L.BLOCK;
29
29
  }
30
30
  getName() {
31
31
  return this.api.translate("Unsubscribe Block");
@@ -34,10 +34,10 @@ class D extends S {
34
34
  return this.api.translate("Unsubscribe Block Description");
35
35
  }
36
36
  getTemplate() {
37
- return L();
37
+ return h();
38
38
  }
39
39
  onCreated(e) {
40
- "getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
40
+ "getOuterHTML" in e && !e.getOuterHTML() || "getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
41
41
  }
42
42
  onSelect(e) {
43
43
  this.currentNode = e, this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener();
@@ -50,8 +50,8 @@ class D extends S {
50
50
  }
51
51
  _setupSelectEventListener() {
52
52
  this._removeSelectEventListener(), this.selectEventListener = (e) => {
53
- const r = e, { collectionType: t, selectedPages: s } = r.detail;
54
- this._updateBlock(t, s.join(","));
53
+ const s = e, { collectionType: t, selectedPages: r } = s.detail;
54
+ this._updateBlock(t, r.join(","));
55
55
  }, document.addEventListener(a.SELECT, this.selectEventListener);
56
56
  }
57
57
  _removeSelectEventListener() {
@@ -71,17 +71,17 @@ class D extends S {
71
71
  _removeEventListeners() {
72
72
  this._removeSelectEventListener(), this._removeCancelEventListener();
73
73
  }
74
- _updateBlock(e, r) {
74
+ _updateBlock(e, s) {
75
75
  if (!this.currentNode || !("querySelector" in this.currentNode))
76
76
  return;
77
77
  const t = this.currentNode.querySelector(g);
78
78
  if (!t)
79
79
  return;
80
- const s = this._getMergeTag(e);
81
- this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", s).apply(new b(`Updated unsubscribe link to ${s}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, r).apply(new b("Updated unsubscribe block metadata"));
80
+ const r = this._getMergeTag(e);
81
+ this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", r).apply(new b(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, s).apply(new b("Updated unsubscribe block metadata"));
82
82
  }
83
83
  _getMergeTag(e) {
84
- return C[e] ?? f;
84
+ return B[e] ?? f;
85
85
  }
86
86
  _openDrawer() {
87
87
  try {
@@ -93,11 +93,11 @@ class D extends S {
93
93
  }
94
94
  _checkExistingBlocks() {
95
95
  const e = c();
96
- e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(B).forEach((t) => {
96
+ e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(T).forEach((t) => {
97
97
  if ("getAttribute" in t) {
98
- const s = t.getAttribute(o.PAGE_TYPE);
99
- if (s) {
100
- const l = Number(s);
98
+ const r = t.getAttribute(o.PAGE_TYPE);
99
+ if (r) {
100
+ const l = Number(r);
101
101
  l === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : l === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
102
102
  }
103
103
  }
@@ -106,11 +106,11 @@ class D extends S {
106
106
  _loadBlockState(e) {
107
107
  if (!("getAttribute" in e))
108
108
  return;
109
- const r = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
110
- if (!r || !t)
109
+ const s = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
110
+ if (!s || !t)
111
111
  return;
112
- const s = c(), l = Number(r), p = m(t);
113
- s.setCollectionWithoutAutoSelection(l), s.loadSelectedTemplates(p);
112
+ const r = c(), l = Number(s), p = m(t);
113
+ r.setCollectionWithoutAutoSelection(l), r.loadSelectedTemplates(p);
114
114
  }
115
115
  _resetStoreState() {
116
116
  c().$reset();
@@ -118,11 +118,11 @@ class D extends S {
118
118
  _removeBlockTemplatesFromStore(e) {
119
119
  if (!("getAttribute" in e))
120
120
  return;
121
- const r = e.getAttribute(o.PAGE_LIST);
122
- if (!r)
121
+ const s = e.getAttribute(o.PAGE_LIST);
122
+ if (!s)
123
123
  return;
124
- const t = c(), s = m(r);
125
- t.removeUnsubscribePages(s);
124
+ const t = c(), r = m(s);
125
+ t.removeUnsubscribePages(r);
126
126
  }
127
127
  }
128
128
  export {
@@ -0,0 +1,6 @@
1
+ import t from "./_getNative.js";
2
+ import a from "./_root.js";
3
+ var e = t(a, "DataView");
4
+ export {
5
+ e as default
6
+ };
@@ -0,0 +1,6 @@
1
+ import o from "./_getNative.js";
2
+ import r from "./_root.js";
3
+ var m = o(r, "Promise");
4
+ export {
5
+ m as default
6
+ };
@@ -0,0 +1,6 @@
1
+ import t from "./_getNative.js";
2
+ import o from "./_root.js";
3
+ var a = t(o, "Set");
4
+ export {
5
+ a as default
6
+ };