ublo-lib 1.6.4 → 1.6.6

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 (164) hide show
  1. package/es/common/components/admin-links/admin-links.js +0 -5
  2. package/es/common/components/analytics.js +0 -8
  3. package/es/common/components/carousel-zone.js +0 -2
  4. package/es/common/components/carousel.js +0 -31
  5. package/es/common/components/cart-preview/api.js +0 -1
  6. package/es/common/components/cart-preview/cart-pill.js +0 -2
  7. package/es/common/components/cart-preview/cart-preview.js +0 -9
  8. package/es/common/components/cart-preview/utils.js +0 -1
  9. package/es/common/components/cookie-consent/cookie-consent.js +0 -8
  10. package/es/common/components/cookie-consent/messages.js +0 -1
  11. package/es/common/components/custom-contact-form/attachment.js +4 -21
  12. package/es/common/components/custom-contact-form/custom-contact-form.js +2 -13
  13. package/es/common/components/custom-contact-form/field.js +12 -30
  14. package/es/common/components/custom-contact-form/icons.js +8 -6
  15. package/es/common/components/custom-contact-form/messages.js +0 -1
  16. package/es/common/components/custom-contact-form/utils.js +10 -14
  17. package/es/common/components/date-picker/calendar.js +0 -15
  18. package/es/common/components/date-picker/date-item.js +0 -20
  19. package/es/common/components/date-picker/date-picker.js +0 -9
  20. package/es/common/components/date-picker/helper.js +0 -2
  21. package/es/common/components/date-picker/messages.js +0 -1
  22. package/es/common/components/date-picker/modes.js +0 -4
  23. package/es/common/components/date-picker/month.js +0 -2
  24. package/es/common/components/date-picker/utils.js +0 -11
  25. package/es/common/components/editable-map/edit-form.js +2 -8
  26. package/es/common/components/editable-map/editable-map.js +0 -4
  27. package/es/common/components/editable-map/helper.js +0 -2
  28. package/es/common/components/editable-map/icon-picker.js +1 -7
  29. package/es/common/components/editable-map/icons/esf.js +38 -21
  30. package/es/common/components/editable-map/icons/lavovelo.js +78 -3
  31. package/es/common/components/editable-map/index.js +0 -4
  32. package/es/common/components/editable-map/map-events.js +0 -7
  33. package/es/common/components/editable-map/markers.js +3 -8
  34. package/es/common/components/editable-map/popup-data.js +0 -2
  35. package/es/common/components/error-404/error-404.js +0 -2
  36. package/es/common/components/error-404/messages.js +0 -3
  37. package/es/common/components/faq.js +0 -5
  38. package/es/common/components/gesco-contact-form/api.js +2 -1
  39. package/es/common/components/gesco-contact-form/gesco-contact-form.js +8 -21
  40. package/es/common/components/gesco-contact-form/messages.js +0 -1
  41. package/es/common/components/gesco-contact-form/validation.js +0 -2
  42. package/es/common/components/info-buttons.js +0 -15
  43. package/es/common/components/packages-selector/index.js +0 -4
  44. package/es/common/components/plausible/hooks/use-plausible.js +0 -3
  45. package/es/common/components/plausible/plausible.js +0 -2
  46. package/es/common/components/plausible/services/callback.js +0 -6
  47. package/es/common/components/plausible/services/load.js +0 -1
  48. package/es/common/components/plausible/services/send-goal.js +0 -2
  49. package/es/common/components/popup.js +4 -7
  50. package/es/common/components/scroll-spy.js +2 -3
  51. package/es/common/components/scrolling-carousel/scrolling-carousel.js +8 -9
  52. package/es/common/components/scrolling-carousel/scrolling-carousel.module.css +7 -1
  53. package/es/common/components/search-bar/hooks/use-constant.js +0 -4
  54. package/es/common/components/search-bar/hooks/use-debounced-search.js +2 -1
  55. package/es/common/components/search-bar/icons.js +4 -4
  56. package/es/common/components/search-bar/search-bar.js +0 -16
  57. package/es/common/components/tabbed-zones.js +0 -4
  58. package/es/common/components/unsupported-browser.js +0 -8
  59. package/es/common/components/video-player/controls.js +0 -6
  60. package/es/common/components/video-player/icons.js +12 -8
  61. package/es/common/components/video-player/utils.js +0 -3
  62. package/es/common/components/video-player/video-player.js +0 -7
  63. package/es/common/hooks/use-faq.js +0 -3
  64. package/es/common/hooks/use-in-view.js +0 -10
  65. package/es/common/hooks/use-injected-cms-markup.js +0 -4
  66. package/es/common/hooks/use-packages.js +0 -6
  67. package/es/common/hooks/use-scroll-direction.js +0 -7
  68. package/es/common/hooks/use-stay.js +0 -5
  69. package/es/common/hooks/use-sticky.js +0 -2
  70. package/es/common/hooks/use-tunnel.js +0 -6
  71. package/es/common/hooks/use-window-sizes.js +0 -5
  72. package/es/common/hooks/use-youtube-popup.js +0 -4
  73. package/es/common/hooks/use-zone-sync.js +0 -7
  74. package/es/common/utils/cookies.js +0 -2
  75. package/es/common/utils/events.js +0 -4
  76. package/es/common/utils/fetcher.js +2 -5
  77. package/es/esf/components/booking-form/booking-form.js +2 -7
  78. package/es/esf/components/booking-form/field.js +4 -11
  79. package/es/esf/components/booking-form/hooks/use-custom-fields.js +0 -2
  80. package/es/esf/components/booking-form/hooks/use-stay.js +0 -3
  81. package/es/esf/components/booking-form/lesson.js +0 -4
  82. package/es/esf/components/booking-form/lessons.js +4 -7
  83. package/es/esf/components/booking-form/messages.js +0 -1
  84. package/es/esf/components/booking-form/personal-data.js +2 -6
  85. package/es/esf/components/booking-form/progress-bar.js +0 -2
  86. package/es/esf/components/booking-form/steps.js +0 -2
  87. package/es/esf/components/booking-form/summary.js +4 -11
  88. package/es/esf/components/booking-form/utils.js +4 -8
  89. package/es/esf/components/covid-link/index.js +5 -8
  90. package/es/esf/components/covid-link/mask-icon.js +0 -2
  91. package/es/esf/components/covid-link/vax-pass-icon.js +0 -2
  92. package/es/esf/components/cp-form.js +1 -3
  93. package/es/esf/components/instructor-suggestions/fetcher.js +0 -1
  94. package/es/esf/components/instructor-suggestions/icons.js +36 -36
  95. package/es/esf/components/instructor-suggestions/instructor-suggestions.js +0 -8
  96. package/es/esf/components/instructor-suggestions/loader.js +0 -2
  97. package/es/esf/components/instructors-book/container.js +4 -4
  98. package/es/esf/components/instructors-book/details.js +2 -5
  99. package/es/esf/components/instructors-book/icons.js +36 -36
  100. package/es/esf/components/instructors-book/inner.js +4 -4
  101. package/es/esf/components/instructors-book/instructors-book.js +6 -19
  102. package/es/esf/components/instructors-book/link.js +4 -4
  103. package/es/esf/components/instructors-book/list-utils.js +0 -3
  104. package/es/esf/components/instructors-book/list.js +0 -6
  105. package/es/esf/components/instructors-book/loader.js +0 -2
  106. package/es/esf/components/instructors-book/messages.js +0 -2
  107. package/es/esf/components/levels.js +0 -22
  108. package/es/esf/components/loyal-customers/api.js +0 -2
  109. package/es/esf/components/loyal-customers/components/bin-icon.js +0 -2
  110. package/es/esf/components/loyal-customers/components/customer-form.js +4 -9
  111. package/es/esf/components/loyal-customers/components/field.js +4 -15
  112. package/es/esf/components/loyal-customers/components/row.js +0 -4
  113. package/es/esf/components/loyal-customers/components/rows.js +0 -3
  114. package/es/esf/components/loyal-customers/components/stay.js +0 -2
  115. package/es/esf/components/loyal-customers/components/student-form.js +4 -8
  116. package/es/esf/components/loyal-customers/components/voucher.js +0 -2
  117. package/es/esf/components/loyal-customers/content.js +0 -2
  118. package/es/esf/components/loyal-customers/hooks/use-stored-rows.js +0 -2
  119. package/es/esf/components/loyal-customers/loyal-customers.js +0 -9
  120. package/es/esf/components/magic-box/booking.js +0 -5
  121. package/es/esf/components/magic-box/filter.js +2 -5
  122. package/es/esf/components/magic-box/filters.js +0 -2
  123. package/es/esf/components/magic-box/magic-box.js +2 -5
  124. package/es/esf/components/magic-box/messages.js +0 -1
  125. package/es/esf/components/period-picker/controls.js +0 -5
  126. package/es/esf/components/period-picker/date-display.js +0 -3
  127. package/es/esf/components/period-picker/days.js +0 -6
  128. package/es/esf/components/period-picker/extended-stay-picker.js +0 -4
  129. package/es/esf/components/period-picker/period-picker.js +0 -12
  130. package/es/esf/components/period-picker/popup.js +0 -2
  131. package/es/esf/components/period-picker/services/dates.js +0 -12
  132. package/es/esf/components/period-picker/services/sections.js +0 -3
  133. package/es/esf/components/period-picker/title.js +0 -4
  134. package/es/esf/components/period-picker/warning.js +0 -5
  135. package/es/esf/components/period-picker/weeks.js +0 -4
  136. package/es/esf/components/reviews.js +0 -3
  137. package/es/esf/components/village-maps/icons.js +12 -8
  138. package/es/esf/components/village-maps/index.js +2 -13
  139. package/es/esf/components/village-maps/messages.js +0 -2
  140. package/es/esf/components/village-maps/utils.js +1 -4
  141. package/es/esf/components/week-picker/index.js +0 -20
  142. package/es/esf/components/week-picker/messages.js +0 -2
  143. package/es/esf/components/week-picker/utils.js +0 -6
  144. package/es/esf/components/week-picker/week.js +0 -2
  145. package/es/esf/components/week-picker-2/index.js +0 -23
  146. package/es/esf/components/week-picker-2/messages.js +0 -2
  147. package/es/esf/components/week-picker-2/utils.js +0 -6
  148. package/es/esf/components/week-picker-2/week.js +0 -2
  149. package/es/esf/hooks/use-affiliation.js +0 -4
  150. package/es/esf/hooks/use-booking-links.js +0 -7
  151. package/es/esf/hooks/use-reviews.js +0 -3
  152. package/es/esf/hooks/use-season-products.js +0 -12
  153. package/es/lbm/components/msem-linker/actions.js +0 -5
  154. package/es/lbm/components/msem-linker/dropdown.js +0 -21
  155. package/es/lbm/components/msem-linker/editor/editor.js +0 -9
  156. package/es/lbm/components/msem-linker/editor/lodging.js +22 -35
  157. package/es/lbm/components/msem-linker/editor/ski-pass.js +12 -30
  158. package/es/lbm/components/msem-linker/hooks/use-widgets.js +6 -10
  159. package/es/lbm/components/msem-linker/loader.js +0 -2
  160. package/es/lbm/components/msem-linker/msem-linker.js +0 -6
  161. package/es/lbm/components/msem-linker/msem-logo.js +0 -2
  162. package/es/lbm/components/msem-linker/services/ui.js +3 -12
  163. package/es/lbm/components/msem-linker/services/url-params.js +0 -5
  164. package/package.json +3 -1
@@ -5,7 +5,6 @@ import styles from "./admin-links.module.css";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  import { Fragment as _Fragment } from "react/jsx-runtime";
8
-
9
8
  const ToggleIcon = () => {
10
9
  return _jsx("svg", {
11
10
  viewBox: "0 0 24 24",
@@ -17,7 +16,6 @@ const ToggleIcon = () => {
17
16
  })
18
17
  });
19
18
  };
20
-
21
19
  const AdminLinks = ({
22
20
  customLinks
23
21
  }) => {
@@ -79,11 +77,9 @@ const AdminLinks = ({
79
77
  } = link;
80
78
  const isHrefValid = typeof onClick === "string" && onClick !== "";
81
79
  const isFunction = typeof onClick === "function";
82
-
83
80
  if (!isHrefValid && !isFunction) {
84
81
  return null;
85
82
  }
86
-
87
83
  const Tag = isHrefValid ? "a" : "button";
88
84
  const anchorProps = {
89
85
  href: onClick,
@@ -103,5 +99,4 @@ const AdminLinks = ({
103
99
  })
104
100
  });
105
101
  };
106
-
107
102
  export default AdminLinks;
@@ -1,13 +1,11 @@
1
1
  import { useEffect } from "react";
2
2
  import { useUbloContext } from "ublo/with-ublo";
3
-
4
3
  const loadGTag = id => new Promise(resolve => {
5
4
  const script = document.createElement("script");
6
5
  script.src = `https://www.googletagmanager.com/gtag/js?id=${id}`;
7
6
  script.onload = resolve;
8
7
  document.body.appendChild(script);
9
8
  });
10
-
11
9
  const Analytics = ({
12
10
  consent,
13
11
  gaAccountOverride
@@ -23,24 +21,18 @@ const Analytics = ({
23
21
  const startGTag = async () => {
24
22
  await loadGTag(gaId);
25
23
  window.dataLayer = window.dataLayer || [];
26
-
27
24
  function gtag() {
28
25
  window.dataLayer.push(arguments);
29
26
  }
30
-
31
27
  gtag("js", new Date());
32
28
  gtag("config", gaId);
33
29
  };
34
-
35
30
  const allowAnalytics = consent && gaId;
36
-
37
31
  if (allowAnalytics) {
38
32
  startGTag();
39
33
  }
40
-
41
34
  window[`ga-disable-${gaId}`] = !allowAnalytics;
42
35
  }, [consent, gaId]);
43
36
  return null;
44
37
  };
45
-
46
38
  export default Analytics;
@@ -2,7 +2,6 @@ import * as React from "react";
2
2
  import Zone from "ublo/zone";
3
3
  import { useUbloContext } from "ublo/with-ublo";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
-
6
5
  const CarouselZone = ({
7
6
  id,
8
7
  options = {},
@@ -57,5 +56,4 @@ const CarouselZone = ({
57
56
  })
58
57
  });
59
58
  };
60
-
61
59
  export default CarouselZone;
@@ -5,21 +5,16 @@ import * as Icons from "dt-design-system/es/icons";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  const UNDRAGGABLE_TAGS = "img, a, button";
8
-
9
8
  const euclideanModulo = (a, b) => {
10
9
  const m = a % b;
11
10
  return m < 0 ? b < 0 ? m - b : m + b : m;
12
11
  };
13
-
14
12
  const preventDrag = element => element.setAttribute("draggable", false);
15
-
16
13
  const enableDrag = element => element.removeAttribute("draggable");
17
-
18
14
  const show = section => {
19
15
  const propertiesToRemove = ["opacity", "pointer-events", "touch-action"];
20
16
  propertiesToRemove.forEach(property => section.style.removeProperty(property));
21
17
  };
22
-
23
18
  function useInterval(callback, delay, current, dragging) {
24
19
  const savedCallback = React.useRef();
25
20
  React.useEffect(() => {
@@ -29,14 +24,12 @@ function useInterval(callback, delay, current, dragging) {
29
24
  function tick() {
30
25
  savedCallback.current();
31
26
  }
32
-
33
27
  if (!dragging && delay !== null && delay !== 0) {
34
28
  const interval = setInterval(tick, delay);
35
29
  return () => clearInterval(interval);
36
30
  }
37
31
  }, [current, delay, dragging]);
38
32
  }
39
-
40
33
  const Dots = ({
41
34
  count,
42
35
  current,
@@ -50,7 +43,6 @@ const Dots = ({
50
43
  e.stopPropagation();
51
44
  setCurrent(i);
52
45
  };
53
-
54
46
  const classes = classnames("carousel__dot", {
55
47
  "carousel__dot--current": i === current
56
48
  });
@@ -62,7 +54,6 @@ const Dots = ({
62
54
  })
63
55
  });
64
56
  };
65
-
66
57
  const Thumbnails = ({
67
58
  carouselRef,
68
59
  count,
@@ -72,10 +63,8 @@ const Thumbnails = ({
72
63
  const [thumbnails, setThumbnails] = React.useState([]);
73
64
  React.useEffect(() => {
74
65
  const carousel = carouselRef.current;
75
-
76
66
  if (carousel) {
77
67
  const sections = carousel.querySelectorAll("section[data-class]");
78
-
79
68
  if (sections.length) {
80
69
  const images = Array.from(sections).reduce((acc, section) => {
81
70
  const image = section.querySelector("img");
@@ -94,7 +83,6 @@ const Thumbnails = ({
94
83
  e.stopPropagation();
95
84
  setCurrent(i);
96
85
  };
97
-
98
86
  const classes = classnames("carousel__thumbnail", {
99
87
  "carousel__thumbnail--current": i === current
100
88
  });
@@ -107,7 +95,6 @@ const Thumbnails = ({
107
95
  })
108
96
  });
109
97
  };
110
-
111
98
  const Carousel = ({
112
99
  delay = 4000,
113
100
  fade = false,
@@ -138,7 +125,6 @@ const Carousel = ({
138
125
  e?.stopPropagation();
139
126
  setCurrent(euclideanModulo(current - 1, count));
140
127
  }, [current, count]);
141
-
142
128
  const onTouchStart = e => {
143
129
  if (fade) return;
144
130
  const {
@@ -146,7 +132,6 @@ const Carousel = ({
146
132
  } = e;
147
133
  const mousedown = type === "mousedown";
148
134
  const cancel = !draggingAllowed && mousedown;
149
-
150
135
  if (cancel || touchStartPosition || !mousedown && !e.targetTouches?.length) {
151
136
  const carousel = carouselRef.current;
152
137
  const inner = carousel.firstElementChild;
@@ -156,7 +141,6 @@ const Carousel = ({
156
141
  setTouchStartPosition(undefined);
157
142
  return;
158
143
  }
159
-
160
144
  const {
161
145
  clientX: startX,
162
146
  clientY: startY
@@ -166,7 +150,6 @@ const Carousel = ({
166
150
  startY
167
151
  });
168
152
  };
169
-
170
153
  const onTouchMove = e => {
171
154
  if (fade) return;
172
155
  const {
@@ -174,12 +157,10 @@ const Carousel = ({
174
157
  } = e;
175
158
  const mousemove = type === "mousemove";
176
159
  const cancel = !draggingAllowed && mousemove;
177
-
178
160
  if (!touchStartPosition || cancel || !mousemove && !e.targetTouches?.length) {
179
161
  setTouchStartPosition(undefined);
180
162
  return;
181
163
  }
182
-
183
164
  const {
184
165
  startX
185
166
  } = touchStartPosition;
@@ -197,7 +178,6 @@ const Carousel = ({
197
178
  });
198
179
  setDragging(deltaX);
199
180
  };
200
-
201
181
  const onTouchEnd = e => {
202
182
  if (fade) return;
203
183
  const {
@@ -208,14 +188,12 @@ const Carousel = ({
208
188
  setDragging(undefined);
209
189
  const carousel = carouselRef.current;
210
190
  const inner = carousel.firstElementChild;
211
-
212
191
  if (!touchStartPosition || cancel || !mouseup && !e.changedTouches?.length) {
213
192
  inner.style.transform = `translateX(${-current * 100}%)`;
214
193
  inner.style.removeProperty("transition");
215
194
  setTouchStartPosition(undefined);
216
195
  return;
217
196
  }
218
-
219
197
  inner.style.transform = `translateX(${-current * 100}%)`;
220
198
  inner.style.removeProperty("transition");
221
199
  const {
@@ -228,19 +206,16 @@ const Carousel = ({
228
206
  } = mouseup ? e : e.changedTouches[0];
229
207
  const deltaX = Math.abs(startX - endX);
230
208
  const deltaY = Math.abs(startY - endY);
231
-
232
209
  if (deltaX < 80 && deltaX < deltaY) {
233
210
  inner.style.transform = `translateX(${-current * 100}%)`;
234
211
  inner.style.removeProperty("transition");
235
212
  setTouchStartPosition(undefined);
236
213
  return;
237
214
  }
238
-
239
215
  if (startX < endX && current > 0) prev();
240
216
  if (startX > endX && current < count - 1) next();
241
217
  setTouchStartPosition(undefined);
242
218
  };
243
-
244
219
  const updateSectionCount = React.useCallback(() => {
245
220
  const carousel = carouselRef.current;
246
221
  const sections = carousel.querySelectorAll("section");
@@ -248,7 +223,6 @@ const Carousel = ({
248
223
  }, []);
249
224
  React.useEffect(() => {
250
225
  const zone = carouselRef.current?.querySelector(".cms");
251
-
252
226
  if (zone) {
253
227
  zone.addEventListener("ubloSectionCreated", updateSectionCount);
254
228
  return () => zone.removeEventListener("ubloSectionCreated", updateSectionCount);
@@ -260,7 +234,6 @@ const Carousel = ({
260
234
  const sections = Array.from(carousel.querySelectorAll("section"));
261
235
  const undraggableElements = Array.from(carousel.querySelectorAll(UNDRAGGABLE_TAGS));
262
236
  setCount(sections.length);
263
-
264
237
  if (!editing) {
265
238
  sections.forEach((section, index) => {
266
239
  const anchors = Array.from(section.querySelectorAll("a"));
@@ -270,11 +243,9 @@ const Carousel = ({
270
243
  });
271
244
  undraggableElements.forEach(preventDrag);
272
245
  }
273
-
274
246
  if (!fade || editing) {
275
247
  sections.forEach((section, index) => {
276
248
  show(section);
277
-
278
249
  if (!editing && current === index) {
279
250
  section.setAttribute("data-current", "");
280
251
  } else {
@@ -309,7 +280,6 @@ const Carousel = ({
309
280
  const carousel = carouselRef.current;
310
281
  const inner = carousel.firstElementChild;
311
282
  const undraggableElements = Array.from(inner.querySelectorAll(UNDRAGGABLE_TAGS));
312
-
313
283
  if (dragging) {
314
284
  undraggableElements.forEach(element => element.addEventListener("click", onUndraggableElementClick));
315
285
  } else {
@@ -362,5 +332,4 @@ const Carousel = ({
362
332
  })]
363
333
  });
364
334
  };
365
-
366
335
  export default React.memo(Carousel);
@@ -7,7 +7,6 @@ export const fetchCart = async (cartId, lang, resort) => {
7
7
  resort
8
8
  };
9
9
  const endpoint = `${api}/esfplus/cart`;
10
-
11
10
  try {
12
11
  const res = await fetch(endpoint, {
13
12
  method: "POST",
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
2
  import css from "./cart-pill.module.css";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
-
5
4
  const CartPill = ({
6
5
  count
7
6
  }) => {
@@ -11,5 +10,4 @@ const CartPill = ({
11
10
  children: count
12
11
  });
13
12
  };
14
-
15
13
  export default CartPill;
@@ -9,7 +9,6 @@ import css from "./cart-preview.module.css";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
11
  import { Fragment as _Fragment } from "react/jsx-runtime";
12
-
13
12
  const CartPreview = ({
14
13
  visible
15
14
  }) => {
@@ -24,18 +23,14 @@ const CartPreview = ({
24
23
  const [cart, setCart] = React.useState();
25
24
  React.useEffect(() => {
26
25
  const cartId = window.sessionStorage.cartId;
27
-
28
26
  const getCart = async () => {
29
27
  const response = await API.fetchCart(cartId, lang, resort);
30
28
  const nbInscriptions = Utils.countInscriptions(response);
31
-
32
29
  if (response && response.cart) {
33
30
  setCart(response);
34
31
  }
35
-
36
32
  setCount(nbInscriptions);
37
33
  };
38
-
39
34
  if (resort && cartId) {
40
35
  getCart();
41
36
  }
@@ -46,11 +41,8 @@ const CartPreview = ({
46
41
  price
47
42
  } = cart.cart;
48
43
  const orders = Utils.getOrders(bareOrders);
49
-
50
44
  const preventClick = e => e.preventDefault();
51
-
52
45
  const stopPropagation = e => e.stopPropagation();
53
-
54
46
  const classes = classnames(css.preview, {
55
47
  [css.previewVisible]: visible
56
48
  });
@@ -113,5 +105,4 @@ const CartPreview = ({
113
105
  })]
114
106
  });
115
107
  };
116
-
117
108
  export default CartPreview;
@@ -8,7 +8,6 @@ export const countInscriptions = cart => {
8
8
  if (!cart || !cart.cart || !cart.cart.orders) {
9
9
  return 0;
10
10
  }
11
-
12
11
  const {
13
12
  orders
14
13
  } = cart.cart;
@@ -8,7 +8,6 @@ import css from "./cookie-consent.module.css";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
10
  const COOKIE_STORAGE = "cookie_allowed";
11
-
12
11
  const CookieConsent = ({
13
12
  lang,
14
13
  consent,
@@ -19,15 +18,12 @@ const CookieConsent = ({
19
18
  } = useUbloContext();
20
19
  const [mounted, setMounted] = React.useState(false);
21
20
  const isEnabled = config.gaAccount;
22
-
23
21
  const cookieAllowed = value => () => {
24
22
  updateConsent(value);
25
23
  };
26
-
27
24
  React.useEffect(() => {
28
25
  if (!mounted) {
29
26
  setMounted(true);
30
-
31
27
  if (!isEnabled) {
32
28
  updateConsent(true);
33
29
  }
@@ -79,10 +75,8 @@ const CookieConsent = ({
79
75
  })
80
76
  }), document.body);
81
77
  };
82
-
83
78
  export const useCookieConsent = () => {
84
79
  const [consent, setConsent] = React.useState(null);
85
-
86
80
  const updateConsent = value => {
87
81
  try {
88
82
  if (value === null || value === undefined) {
@@ -90,13 +84,11 @@ export const useCookieConsent = () => {
90
84
  } else {
91
85
  localStorage.setItem(COOKIE_STORAGE, value);
92
86
  }
93
-
94
87
  setConsent(value);
95
88
  } catch (e) {
96
89
  console.error(e);
97
90
  }
98
91
  };
99
-
100
92
  React.useEffect(() => {
101
93
  try {
102
94
  const stored = localStorage.getItem(COOKIE_STORAGE);
@@ -26,6 +26,5 @@ const messages = {
26
26
  };
27
27
  export const get = (lang, message) => {
28
28
  const _lang = messages[lang] === undefined ? "en" : lang;
29
-
30
29
  return messages[_lang][message];
31
30
  };
@@ -6,12 +6,10 @@ import styles from "./attachment.module.css";
6
6
  import { convertToFileList } from "./utils";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
-
10
9
  const getFormatName = format => {
11
10
  const splittedName = format.split("/");
12
11
  return splittedName[splittedName.length - 1];
13
12
  };
14
-
15
13
  const Item = ({
16
14
  item,
17
15
  removeItem
@@ -19,13 +17,11 @@ const Item = ({
19
17
  const {
20
18
  name
21
19
  } = item;
22
-
23
20
  const onRemoveClick = e => {
24
21
  e.stopPropagation();
25
22
  e.preventDefault();
26
23
  removeItem(name);
27
24
  };
28
-
29
25
  return _jsxs("div", {
30
26
  className: styles.item,
31
27
  onClick: undefined,
@@ -43,7 +39,6 @@ const Item = ({
43
39
  })]
44
40
  });
45
41
  };
46
-
47
42
  const Attachment = ({
48
43
  lang,
49
44
  name,
@@ -66,30 +61,24 @@ const Attachment = ({
66
61
  const formatedAuthorizedFormats = splittedFormats?.map((format, i) => `${i > 0 ? "," : ""} ${getFormatName(format)}`);
67
62
  const handleDrop = React.useCallback(files => {
68
63
  const authorizedSelectionFormats = files.every(file => splittedFormats.includes(file.type));
69
-
70
64
  if (!authorizedSelectionFormats) {
71
65
  return {
72
66
  error: Messages.get(lang, "attachmentFormatError")
73
67
  };
74
68
  }
75
-
76
69
  const authorizedSelectionFileNumber = files.length > 0 && files.length <= attachmentMaxFiles - items.length;
77
-
78
70
  if (!authorizedSelectionFileNumber) {
79
71
  return {
80
72
  error: Messages.get(lang, "attachmentNumberError")
81
73
  };
82
74
  }
83
-
84
75
  const maxSizeinOctet = attachmentMaxSize * 1000000;
85
76
  const authorizedSelectionFileSize = files.every(file => file.size < maxSizeinOctet);
86
-
87
77
  if (!authorizedSelectionFileSize) {
88
78
  return {
89
79
  error: Messages.get(lang, "attachmentSizeError")
90
80
  };
91
81
  }
92
-
93
82
  return {
94
83
  success: true
95
84
  };
@@ -100,12 +89,12 @@ const Attachment = ({
100
89
  success,
101
90
  error
102
91
  } = handleDrop(files);
103
-
104
92
  if (success) {
105
93
  setData(data => {
106
94
  const currentFiles = data.attachment.value;
107
95
  const newFiles = convertToFileList([...currentFiles, ...files]);
108
- return { ...data,
96
+ return {
97
+ ...data,
109
98
  attachment: {
110
99
  value: newFiles,
111
100
  valid: true
@@ -117,21 +106,19 @@ const Attachment = ({
117
106
  setTimeout(() => setError(undefined), 5000);
118
107
  }
119
108
  }, [handleDrop, setData]);
120
-
121
109
  const removeItem = name => {
122
110
  const newItems = convertToFileList(Array.from(items).filter(item => item.name !== name));
123
- setData(data => ({ ...data,
111
+ setData(data => ({
112
+ ...data,
124
113
  attachment: {
125
114
  value: newItems,
126
115
  valid: true
127
116
  }
128
117
  }));
129
118
  };
130
-
131
119
  const onDragIn = React.useCallback(e => {
132
120
  e.preventDefault();
133
121
  e.stopPropagation();
134
-
135
122
  if (e.dataTransfer.items) {
136
123
  setError(undefined);
137
124
  setDragging(e.dataTransfer.items.length > 0);
@@ -149,15 +136,12 @@ const Attachment = ({
149
136
  e.dataTransfer.clearData();
150
137
  setDragging(false);
151
138
  }, [onChange]);
152
-
153
139
  const onDragOver = e => {
154
140
  e.preventDefault();
155
141
  e.stopPropagation();
156
142
  };
157
-
158
143
  React.useEffect(() => {
159
144
  const container = ref.current;
160
-
161
145
  if (container) {
162
146
  container.addEventListener("dragenter", onDragIn);
163
147
  container.addEventListener("dragleave", onDragOut);
@@ -225,5 +209,4 @@ const Attachment = ({
225
209
  })]
226
210
  });
227
211
  };
228
-
229
212
  export default Attachment;
@@ -11,14 +11,13 @@ import styles from "./custom-contact-form.module.css";
11
11
  import { getInitialFormState, getSettings, send } from "./utils";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
-
15
14
  const CustomContactFormWithSnackbar = props => {
16
15
  return _jsx(SnackbarProvider, {
17
- children: _jsx(CustomContactForm, { ...props
16
+ children: _jsx(CustomContactForm, {
17
+ ...props
18
18
  })
19
19
  });
20
20
  };
21
-
22
21
  const CustomContactForm = ({
23
22
  kind,
24
23
  title,
@@ -43,7 +42,6 @@ const CustomContactForm = ({
43
42
  } = config;
44
43
  const snackbar = useSnackbar();
45
44
  const isFormValid = Object.keys(data).every(key => data[key].valid);
46
-
47
45
  const sendForm = async () => {
48
46
  setSending(true);
49
47
  const sendFunction = customSend || send;
@@ -57,7 +55,6 @@ const CustomContactForm = ({
57
55
  subjectPrefix: subject?.prefix,
58
56
  subjectSuffix: subject?.suffix
59
57
  });
60
-
61
58
  if (error) {
62
59
  snackbar.show({
63
60
  type: "error",
@@ -71,7 +68,6 @@ const CustomContactForm = ({
71
68
  setData(getInitialFormState(fields));
72
69
  resetForm();
73
70
  }
74
-
75
71
  setSending(false);
76
72
  onSubmit?.({
77
73
  data,
@@ -79,16 +75,13 @@ const CustomContactForm = ({
79
75
  error
80
76
  });
81
77
  };
82
-
83
78
  const resetForm = () => {
84
79
  presets?.setter?.(undefined);
85
80
  setData(getInitialFormState(fields));
86
81
  };
87
-
88
82
  const blurForm = () => {
89
83
  document.activeElement.blur();
90
84
  };
91
-
92
85
  React.useEffect(() => {
93
86
  if (!ready && !settings) {
94
87
  const init = async () => {
@@ -96,7 +89,6 @@ const CustomContactForm = ({
96
89
  setSettings(formSettings);
97
90
  setReady(true);
98
91
  };
99
-
100
92
  init();
101
93
  }
102
94
  }, [ready, settings, site]);
@@ -109,14 +101,12 @@ const CustomContactForm = ({
109
101
  });
110
102
  const showSendingOverlay = !!settings?.attachmentAllowed && sending;
111
103
  if (!ready) return null;
112
-
113
104
  if (ready && !settings) {
114
105
  return _jsx("div", {
115
106
  className: styles.root,
116
107
  children: Messages.get(lang, "NO_SETTINGS_FOUND")
117
108
  });
118
109
  }
119
-
120
110
  const formKey = presets ? JSON.stringify(presets.values) : undefined;
121
111
  return _jsxs("div", {
122
112
  className: classes,
@@ -159,5 +149,4 @@ const CustomContactForm = ({
159
149
  })]
160
150
  });
161
151
  };
162
-
163
152
  export default React.memo(CustomContactFormWithSnackbar);