@cntrl-site/components 1.0.101 → 1.0.103

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 (132) hide show
  1. package/README.md +25 -1
  2. package/dist/Burger-C6jI6C1c.js +661 -0
  3. package/dist/Burger-EMSn7TPB.mjs +1807 -0
  4. package/dist/ClickGallerie-D7g093HX.js +36 -0
  5. package/dist/ClickGallerie-QSOQjSdv.mjs +271 -0
  6. package/dist/Components/Burger/BurgerComponent.d.ts +0 -1
  7. package/dist/Components/ClickGallerie/ClickGallerie.d.ts +1 -0
  8. package/dist/Components/ClickGallerie/ClickGallerieComponent.d.ts +0 -1
  9. package/dist/Components/FAQ/FAQComponent.d.ts +0 -1
  10. package/dist/Components/Form/FormComponent.d.ts +0 -1
  11. package/dist/Components/Grid/GridComponent.d.ts +0 -1
  12. package/dist/Components/Helix/HelixComponent.d.ts +0 -1
  13. package/dist/Components/Hive/HiveComponent.d.ts +0 -1
  14. package/dist/Components/LightboxJournal/LightboxJournalComponent.d.ts +0 -1
  15. package/dist/Components/LightboxStrip/LightboxStripComponent.d.ts +0 -1
  16. package/dist/Components/List/ListComponent.d.ts +0 -1
  17. package/dist/Components/Marquee/MarqueeComponent.d.ts +0 -1
  18. package/dist/Components/MarqueeText/MarqueeTextComponent.d.ts +0 -1
  19. package/dist/Components/Mercury/MercuryComponent.d.ts +0 -1
  20. package/dist/Components/OnelinerForm/OnelinerFormComponent.d.ts +0 -1
  21. package/dist/Components/Pretext/PretextComponent.d.ts +0 -1
  22. package/dist/Components/Scale/Scale.d.ts +2 -0
  23. package/dist/Components/Scale/ScaleComponent.d.ts +0 -1
  24. package/dist/Components/SimpleButton/SimpleButtonComponent.d.ts +0 -1
  25. package/dist/Components/Slider20/Slider20Component.d.ts +0 -1
  26. package/dist/Components/TestimonialGrid/TestimonialGridComponent.d.ts +0 -1
  27. package/dist/Components/TestimonialSingle/TestimonialSingleComponent.d.ts +0 -1
  28. package/dist/Components/Waterfall/WaterfallComponent.d.ts +0 -1
  29. package/dist/ControlSlider-SiOt22l_.js +1 -0
  30. package/dist/ControlSlider-pZv7H6BU.mjs +334 -0
  31. package/dist/FAQ-C7823fyi.js +166 -0
  32. package/dist/FAQ-CZ39u4m8.mjs +588 -0
  33. package/dist/Form-BX5_41nb.mjs +472 -0
  34. package/dist/Form-Dn-6A1He.js +153 -0
  35. package/dist/Grid-CemGhf3F.js +374 -0
  36. package/dist/Grid-cfQsXW3b.mjs +1553 -0
  37. package/dist/Helix-2Vr-9WBa.js +43 -0
  38. package/dist/Helix-BmkAKT1G.mjs +315 -0
  39. package/dist/Hive-BC6zQBsv.js +321 -0
  40. package/dist/Hive-BGMWinrW.mjs +1425 -0
  41. package/dist/HiveLightboxTitles-DhEeFKWs.mjs +507 -0
  42. package/dist/HiveLightboxTitles-DlyptAaK.js +1 -0
  43. package/dist/ImageRevealSlider-BBWtFjUF.js +1 -0
  44. package/dist/ImageRevealSlider-BdFGyVEP.mjs +184 -0
  45. package/dist/Lightbox-CIss_nOG.js +1 -0
  46. package/dist/Lightbox-eP9qAZzL.mjs +665 -0
  47. package/dist/LightboxJournal-D59ex6wH.mjs +1613 -0
  48. package/dist/LightboxJournal-DAEZOPDi.js +523 -0
  49. package/dist/LightboxStrip-BDjI1jyH.js +386 -0
  50. package/dist/LightboxStrip-YspzBP8N.mjs +1574 -0
  51. package/dist/List-C32WImI3.js +377 -0
  52. package/dist/List-DW7fyJbf.mjs +1891 -0
  53. package/dist/Marquee-BYClHHws.mjs +551 -0
  54. package/dist/Marquee-vmHaTGIP.js +133 -0
  55. package/dist/MarqueeText-4Rip_sQX.mjs +515 -0
  56. package/dist/MarqueeText-E6OubMOG.js +132 -0
  57. package/dist/Mercury-BwF_XW2w.js +267 -0
  58. package/dist/Mercury-DuKJQ1Zo.mjs +1701 -0
  59. package/dist/OnelinerForm-BEu7_sho.mjs +434 -0
  60. package/dist/OnelinerForm-C2Y_XMCY.js +194 -0
  61. package/dist/Pretext-10CcyP1E.mjs +2762 -0
  62. package/dist/Pretext-DvQ3xsni.js +231 -0
  63. package/dist/PretextComponent-CGycuNNn.js +1 -0
  64. package/dist/PretextComponent-DN8cyZ8x.mjs +11633 -0
  65. package/dist/RichTextRenderer-B6WtTYlR.mjs +32 -0
  66. package/dist/RichTextRenderer-CIy6yI8U.js +1 -0
  67. package/dist/Scale-Bg3bGICG.js +114 -0
  68. package/dist/Scale-TnkWtRrs.mjs +409 -0
  69. package/dist/SimpleButton-C-o2W9bS.mjs +451 -0
  70. package/dist/SimpleButton-nGEcO2gB.js +243 -0
  71. package/dist/Slider20-C9o2REDl.js +272 -0
  72. package/dist/Slider20-Dm8BeCli.mjs +851 -0
  73. package/dist/SvgImage-B5mR9y6q.mjs +51 -0
  74. package/dist/SvgImage-DFlmxAoL.js +1 -0
  75. package/dist/TestimonialGrid-CPu4qQ6B.mjs +492 -0
  76. package/dist/TestimonialGrid-D4ieiz9e.js +90 -0
  77. package/dist/TestimonialSingle-CVu15ZtV.js +125 -0
  78. package/dist/TestimonialSingle-DLdnAVF7.mjs +391 -0
  79. package/dist/Waterfall-A0FjM2my.mjs +1400 -0
  80. package/dist/Waterfall-DnPDHbCL.js +287 -0
  81. package/dist/buildColorVars-CE2D5cQV.js +1 -0
  82. package/dist/buildColorVars-CLyWQm5K.mjs +21 -0
  83. package/dist/components-BFJINCME.mjs +2053 -0
  84. package/dist/components-DTCDEBo0.js +1 -0
  85. package/dist/components.css +1 -1
  86. package/dist/elements.d.ts +7 -0
  87. package/dist/elements.js +1 -0
  88. package/dist/elements.mjs +63 -0
  89. package/dist/elements.node.d.ts +6 -0
  90. package/dist/elements.node.js +1 -0
  91. package/dist/elements.node.mjs +21 -0
  92. package/dist/forking.d.ts +1 -0
  93. package/dist/formFieldValidation-DZl2KVaF.js +1 -0
  94. package/dist/formFieldValidation-DvihFrq5.mjs +21 -0
  95. package/dist/getColorAlpha-BVBY0N5x.mjs +39 -0
  96. package/dist/getColorAlpha-CoSseoCn.js +1 -0
  97. package/dist/getImageRect-BQhQXvT8.js +1 -0
  98. package/dist/getImageRect-CBMhFNHM.mjs +109 -0
  99. package/dist/index.d.ts +1 -0
  100. package/dist/index.js +1 -28862
  101. package/dist/index.mjs +16 -62473
  102. package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
  103. package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
  104. package/dist/panelAvailability-D179wwJx.mjs +27 -0
  105. package/dist/panelAvailability-DnOe0rQ4.js +1 -0
  106. package/dist/react-splide.esm-CabaEmHi.js +6 -0
  107. package/dist/react-splide.esm-DQqds4PL.mjs +1750 -0
  108. package/dist/readTestimonialTextMeasure-BIXpGFEt.mjs +13 -0
  109. package/dist/readTestimonialTextMeasure-CEPaB4Sy.js +1 -0
  110. package/dist/scalingValue-C9JH5L6O.mjs +6 -0
  111. package/dist/scalingValue-CSHYgTZl.js +1 -0
  112. package/dist/sources.d.ts +1 -0
  113. package/dist/sources.js +23865 -0
  114. package/dist/sources.mjs +23891 -0
  115. package/dist/textStylesToCss-05Mn6I_2.mjs +32 -0
  116. package/dist/textStylesToCss-CNN3zZTV.js +1 -0
  117. package/dist/types/Component.d.ts +0 -1
  118. package/dist/useLightboxScrollLock-Hf16Eq4g.js +1 -0
  119. package/dist/useLightboxScrollLock-VQ07s7EJ.mjs +18 -0
  120. package/dist/useLightboxSwipeDismiss-Br9uE5G0.js +1 -0
  121. package/dist/useLightboxSwipeDismiss-SGv6Ra33.mjs +95 -0
  122. package/dist/useScopedStyles-Bf6yohVQ.js +1 -0
  123. package/dist/useScopedStyles-DhBG3557.mjs +11 -0
  124. package/dist/utils-033j3qNL.js +1 -0
  125. package/dist/utils-FxC9rcxw.mjs +247 -0
  126. package/dist/utils.js +1 -1
  127. package/dist/utils.mjs +17 -11
  128. package/package.json +31 -2
  129. package/dist/index-2JTNRDR1.js +0 -1
  130. package/dist/index-DA8t6EZ4.mjs +0 -255
  131. package/dist/panelAvailability-CgSic84c.mjs +0 -126
  132. package/dist/panelAvailability-D8c7cdbu.js +0 -1
@@ -0,0 +1,665 @@
1
+ import { jsxs as U, Fragment as ue, jsx as g } from "react/jsx-runtime";
2
+ import { useState as P, useEffect as F, useRef as R, useCallback as Fe } from "react";
3
+ import { createPortal as Oe } from "react-dom";
4
+ import { s as d } from "./scalingValue-C9JH5L6O.mjs";
5
+ import { S as se } from "./SvgImage-B5mR9y6q.mjs";
6
+ import N from "classnames";
7
+ import { S as We, a as Ve } from "./react-splide.esm-DQqds4PL.mjs";
8
+ import { R as De } from "./RichTextRenderer-B6WtTYlR.mjs";
9
+ import { b as ve, g as be } from "./getImageRect-CBMhFNHM.mjs";
10
+ import { g as we } from "./getColorAlpha-BVBY0N5x.mjs";
11
+ import { n as Xe } from "./textStylesToCss-05Mn6I_2.mjs";
12
+ const He = "LightBox-module__hidden___9s-9x", Me = "LightBox-module__heroImage___sTxNF", Pe = "LightBox-module__background___rm9ml", Ye = "LightBox-module__editor___4ACaY", Ee = "LightBox-module__contentStyle___Bgnsq", Ue = "LightBox-module__imageStyle___tLIlB", je = "LightBox-module__imgWrapper___LuFUp", Ge = "LightBox-module__contain___8-yaS", Ke = "LightBox-module__cover___hNvOG", Ze = "LightBox-module__caption___b6L2I", qe = "LightBox-module__captionTextInner___rCGNH", Je = "LightBox-module__lightboxSplide___XFuWC", Qe = "LightBox-module__arrow___iz38X", et = "LightBox-module__arrowVertical___Zfz81", tt = "LightBox-module__nextArrow___zkAQN", nt = "LightBox-module__arrowInner___p48sW", ot = "LightBox-module__arrowIcon___3VaFf", rt = "LightBox-module__arrowImg___pNV88", it = "LightBox-module__mirror___pjeXc", ct = "LightBox-module__thumbsWrapper___GB-nU", lt = "LightBox-module__thumbsContainerVertical___wttk5", at = "LightBox-module__thumbsContainer___osSma", st = "LightBox-module__thumbsAlignStart___MO6tY", ut = "LightBox-module__thumbsAlignCenter___Q4sUx", dt = "LightBox-module__thumbsAlignEnd___p4y9R", ht = "LightBox-module__thumbItem___HvnF3", mt = "LightBox-module__closeButton___g2khP", gt = "LightBox-module__fadeIn___0m5GW", ft = "LightBox-module__slideInLeft___gPYwC", pt = "LightBox-module__slideInRight___S-pPp", _t = "LightBox-module__slideInTop___DFdAj", vt = "LightBox-module__slideInBottom___m27kZ", bt = "LightBox-module__fadeOut___55qBR", wt = "LightBox-module__slideOutLeft___NvU7P", Lt = "LightBox-module__slideOutRight___SK7eC", xt = "LightBox-module__slideOutTop___Vgg0z", yt = "LightBox-module__slideOutBottom___nJ0Ef", It = "LightBox-module__scaleSlide___vZriG", e = {
13
+ hidden: He,
14
+ heroImage: Me,
15
+ background: Pe,
16
+ editor: Ye,
17
+ contentStyle: Ee,
18
+ imageStyle: Ue,
19
+ imgWrapper: je,
20
+ contain: Ge,
21
+ cover: Ke,
22
+ caption: Ze,
23
+ captionTextInner: qe,
24
+ lightboxSplide: Je,
25
+ arrow: Qe,
26
+ arrowVertical: et,
27
+ nextArrow: tt,
28
+ arrowInner: nt,
29
+ arrowIcon: ot,
30
+ arrowImg: rt,
31
+ mirror: it,
32
+ thumbsWrapper: ct,
33
+ thumbsContainerVertical: lt,
34
+ thumbsContainer: at,
35
+ thumbsAlignStart: st,
36
+ thumbsAlignCenter: ut,
37
+ thumbsAlignEnd: dt,
38
+ thumbItem: ht,
39
+ closeButton: mt,
40
+ fadeIn: gt,
41
+ slideInLeft: ft,
42
+ slideInRight: pt,
43
+ slideInTop: _t,
44
+ slideInBottom: vt,
45
+ fadeOut: bt,
46
+ slideOutLeft: wt,
47
+ slideOutRight: Lt,
48
+ slideOutTop: xt,
49
+ slideOutBottom: yt,
50
+ scaleSlide: It
51
+ }, ee = (a, L, m) => {
52
+ const f = {}, [B, k] = a.split("-");
53
+ return B === "top" ? (f.top = "0", f.bottom = "auto") : B === "middle" ? (f.top = "50%", f.bottom = "auto") : B === "bottom" && (f.top = "auto", f.bottom = "0"), k === "left" ? (f.left = "0", f.right = "auto") : k === "center" ? (f.left = "50%", f.right = "auto") : k === "right" && (f.left = "auto", f.right = "0"), B === "middle" && k === "center" ? f.transform = `translate(calc(-50% + ${d(L.x, m)}), calc(-50% + ${d(L.y, m)}))` : B === "middle" ? f.transform = `translate(${d(L.x, m)}, calc(-50% + ${d(L.y, m)}))` : k === "center" ? f.transform = `translate(calc(-50% + ${d(L.x, m)}), ${d(L.y, m)})` : f.transform = `translate(${d(L.x, m)}, ${d(L.y, m)})`, f;
54
+ };
55
+ function Ct(a, L) {
56
+ const m = (() => {
57
+ if (a === "fade in") return e.fadeIn;
58
+ if (a === "slide in" || a === "mix")
59
+ switch (L) {
60
+ case "left":
61
+ return e.slideInLeft;
62
+ case "right":
63
+ return e.slideInRight;
64
+ case "top":
65
+ return e.slideInTop;
66
+ case "bottom":
67
+ return e.slideInBottom;
68
+ default:
69
+ return e.slideInRight;
70
+ }
71
+ return e.fadeIn;
72
+ })(), f = (() => {
73
+ if (a === "fade in" || a === "mix") return e.fadeIn;
74
+ if (a === "slide in")
75
+ switch (L) {
76
+ case "left":
77
+ return e.slideInLeft;
78
+ case "right":
79
+ return e.slideInRight;
80
+ case "top":
81
+ return e.slideInTop;
82
+ case "bottom":
83
+ return e.slideInBottom;
84
+ default:
85
+ return e.slideInRight;
86
+ }
87
+ return e.fadeIn;
88
+ })(), B = (() => {
89
+ if (a === "fade in" || a === "mix") return e.fadeOut;
90
+ if (a === "slide in")
91
+ switch (L) {
92
+ case "left":
93
+ return e.slideOutLeft;
94
+ case "right":
95
+ return e.slideOutRight;
96
+ case "top":
97
+ return e.slideOutTop;
98
+ case "bottom":
99
+ return e.slideOutBottom;
100
+ default:
101
+ return e.slideOutRight;
102
+ }
103
+ return e.fadeOut;
104
+ })(), k = (() => {
105
+ if (a === "fade in") return e.fadeOut;
106
+ if (a === "slide in" || a === "mix")
107
+ switch (L) {
108
+ case "left":
109
+ return e.slideOutLeft;
110
+ case "right":
111
+ return e.slideOutRight;
112
+ case "top":
113
+ return e.slideOutTop;
114
+ case "bottom":
115
+ return e.slideOutBottom;
116
+ default:
117
+ return e.slideOutRight;
118
+ }
119
+ return e.fadeOut;
120
+ })();
121
+ return { appearClass: m, backdropAppearClass: f, backdropDisappearClass: B, disappearClass: k };
122
+ }
123
+ const Vt = ({ settings: a, content: L, styles: m, portalId: f, activeEvent: B, isEditor: k, isPreviewMode: o }) => {
124
+ const [j, D] = P(!1), { assetId: G } = a.thumbnailBlock.cover;
125
+ return F(() => {
126
+ B === "close" && D(!1), B === "open" && D(!0);
127
+ }, [B]), /* @__PURE__ */ U(ue, { children: [
128
+ /* @__PURE__ */ g(
129
+ "img",
130
+ {
131
+ src: G,
132
+ alt: "Cover",
133
+ className: e.heroImage,
134
+ onClick: () => D(!0)
135
+ }
136
+ ),
137
+ /* @__PURE__ */ g(
138
+ St,
139
+ {
140
+ isOpen: j,
141
+ onClose: () => D(!1),
142
+ content: L,
143
+ settings: a,
144
+ lightboxStyles: m,
145
+ portalId: f,
146
+ isEditor: k
147
+ }
148
+ )
149
+ ] });
150
+ }, St = ({ isOpen: a, onClose: L, content: m, lightboxStyles: f, settings: B, portalId: k, isEditor: o, metadata: j }) => {
151
+ var _e;
152
+ const { widthSettings: D, fontSettings: G, letterSpacing: xe, textAlign: ye, wordSpacing: Ie, fontSizeLineHeight: de, textAppearance: te, color: Ce } = f.imageCaption ?? {}, [O, K] = P(0), [he, ne] = P(0), [oe, re] = P(!1), [Se, Z] = P(!1), [me, ge] = P({}), y = R(null), ie = R(null), T = R(null), X = R(!1), I = R(null), H = R(null), M = R(null), C = R(null), W = R(!1), fe = R(null), [Be, ce] = P(!1), { appear: q, triggers: $, slider: c, thumbnail: p, controls: _, area: S, caption: Y, layout: E } = B.lightboxBlock, { appearClass: ke, backdropAppearClass: Ae, backdropDisappearClass: Te, disappearClass: Re } = Ct(q.type, q.direction), le = (j == null ? void 0 : j.itemId) ?? null;
153
+ F(() => {
154
+ const t = () => {
155
+ setTimeout(() => {
156
+ var r, s;
157
+ (s = (r = y.current) == null ? void 0 : r.splide) == null || s.refresh();
158
+ }, 16);
159
+ }, n = () => {
160
+ ne((r) => r + 1);
161
+ };
162
+ return window.addEventListener("ArticleEditor.Layout:change", t), window.addEventListener("ArticleEditor.ComponentContent:change", n), () => {
163
+ window.removeEventListener("ArticleEditor.Layout:change", t), window.removeEventListener("ArticleEditor.ComponentContent:change", n);
164
+ };
165
+ }, []), F(() => {
166
+ if (!a || !p.isActive) {
167
+ ce(!1);
168
+ return;
169
+ }
170
+ const t = fe.current;
171
+ if (!t) return;
172
+ const n = () => {
173
+ c.direction === "horiz" ? ce(t.scrollWidth > t.clientWidth) : ce(t.scrollHeight > t.clientHeight);
174
+ };
175
+ n();
176
+ const r = new ResizeObserver(n);
177
+ return r.observe(t), () => r.disconnect();
178
+ }, [a, p.isActive, m.length, me, c.direction]);
179
+ const V = Fe(() => {
180
+ const t = window.matchMedia("(max-width: 768px)").matches, n = we(S.color);
181
+ t && !o && n > 0.9 && (document.body.style.backgroundColor = ""), re(!0), X.current = !0;
182
+ const r = (s) => {
183
+ s.target === I.current && s.animationName && (I.current && H.current && I.current.removeEventListener("animationend", H.current), H.current = null, X.current && (X.current = !1, L()), re(!1));
184
+ };
185
+ I.current && (H.current = r, I.current.addEventListener("animationend", r));
186
+ }, [L, S.color, o]), $e = (t, n, r) => {
187
+ var s, h;
188
+ if (t) {
189
+ if ($.type === "click" && $.switch === "image")
190
+ $.repeat === "close" && O === m.length - 1 ? V() : (s = y.current) == null || s.go("+1");
191
+ else if ($.type === "click" && $.switch === "50/50") {
192
+ const u = t.getBoundingClientRect(), i = n - u.left, v = r - u.top, A = u.width, b = u.height;
193
+ let x;
194
+ c.direction === "horiz" ? x = i < A / 2 ? "-1" : "+1" : x = v < b / 2 ? "-1" : "+1", (h = y.current) == null || h.go(x);
195
+ }
196
+ }
197
+ }, pe = (t) => {
198
+ if (W.current) {
199
+ W.current = !1;
200
+ return;
201
+ }
202
+ const n = m[O], r = (n == null ? void 0 : n.image.objectFit) === "cover";
203
+ let s, h;
204
+ if ("changedTouches" in t && t.changedTouches.length > 0)
205
+ s = t.changedTouches[0].clientX, h = t.changedTouches[0].clientY;
206
+ else if ("clientX" in t)
207
+ s = t.clientX, h = t.clientY;
208
+ else
209
+ return;
210
+ let u;
211
+ if (r && T.current) {
212
+ const i = ve(T.current);
213
+ u = s >= i.left && s <= i.right && h >= i.top && h <= i.bottom;
214
+ } else {
215
+ const i = T.current ? be(T.current) : null;
216
+ if (!i) {
217
+ t.target === t.currentTarget && V();
218
+ return;
219
+ }
220
+ u = s >= i.x && s <= i.x + i.width && h >= i.y && h <= i.y + i.height;
221
+ }
222
+ u ? $e(T.current, s, h) : V();
223
+ }, ze = (t) => {
224
+ const n = t.target;
225
+ (n.classList.contains(e.thumbsWrapper) || n.classList.contains(e.thumbsContainer)) && pe(t);
226
+ };
227
+ F(() => {
228
+ if (!a) return;
229
+ const t = (n) => {
230
+ var r, s;
231
+ if (n.key === "Escape") {
232
+ V();
233
+ return;
234
+ }
235
+ if (n.key === "ArrowRight") {
236
+ K((h) => (h + 1) % Math.max(m.length, 1)), (r = y.current) == null || r.go("+1");
237
+ return;
238
+ }
239
+ n.key === "ArrowLeft" && (K((h) => (h - 1 + Math.max(m.length, 1)) % Math.max(m.length, 1)), (s = y.current) == null || s.go("-1"));
240
+ };
241
+ return window.addEventListener("keydown", t), () => {
242
+ window.removeEventListener("keydown", t);
243
+ };
244
+ }, [a, V, m.length]), F(() => {
245
+ if (a) {
246
+ if (K(0), ne((n) => n + 1), X.current = !1, re(!1), Z(!1), ge({}), !le) return;
247
+ const t = new CustomEvent("page-overlay", { detail: { itemId: le } });
248
+ window.dispatchEvent(t);
249
+ }
250
+ return () => {
251
+ I.current && H.current && (I.current.removeEventListener("animationend", H.current), H.current = null), Z(!1);
252
+ };
253
+ }, [a, le]), F(() => {
254
+ ie.current !== null && ie.current !== c.type && ne((t) => t + 1), ie.current = c.type;
255
+ }, [c.type]), F(() => {
256
+ if (!a) return;
257
+ const t = document.body.style.overflow, n = window.matchMedia("(max-width: 768px)").matches, r = we(S.color);
258
+ document.body.style.overflow = "hidden", Z(!1);
259
+ const s = (u) => {
260
+ u.target === I.current && !X.current && u.animationName && (n && !o && r > 0.9 && (document.body.style.backgroundColor = S.color), Z(!0), I.current && M.current && I.current.removeEventListener("animationend", M.current), M.current = null);
261
+ };
262
+ I.current && (M.current = s, I.current.addEventListener("animationend", s));
263
+ const h = (u) => {
264
+ const i = u.target;
265
+ i && (i.closest(`.${e.thumbsWrapper}`) || i.closest(`.${e.thumbsContainer}`)) || c.type !== "slide" && u.preventDefault();
266
+ };
267
+ return document.addEventListener("touchmove", h, { passive: !1 }), () => {
268
+ document.body.style.overflow = t, document.removeEventListener("touchmove", h), I.current && M.current && (I.current.removeEventListener("animationend", M.current), M.current = null), Z(!1);
269
+ };
270
+ }, [a, o, S.color, c.type]), F(() => {
271
+ if (!a) return;
272
+ const t = (n) => {
273
+ var s, h;
274
+ if (X.current) {
275
+ n.stopPropagation();
276
+ return;
277
+ }
278
+ if (W.current) {
279
+ W.current = !1;
280
+ return;
281
+ }
282
+ const r = n.target;
283
+ if (!(r && (r.closest(`.${e.thumbsContainer}`) || r.closest(`.${e.thumbItem}`) || r.closest(`.${e.arrow}`) || r.closest(`.${e.closeButton}`) || r.closest(`.${e.caption}`)))) {
284
+ if (c.type === "slide" && $.type === "drag" && ((h = (s = y.current) == null ? void 0 : s.splide) != null && h.root)) {
285
+ const u = y.current.splide.root;
286
+ if (r && (u.contains(r) || u === r))
287
+ return;
288
+ }
289
+ if (n.touches.length === 0 && n.changedTouches.length > 0) {
290
+ const u = m[O], i = (u == null ? void 0 : u.image.objectFit) === "cover", v = n.changedTouches[0];
291
+ let A;
292
+ if (i && T.current) {
293
+ const b = ve(T.current);
294
+ A = v.clientX >= b.left && v.clientX <= b.right && v.clientY >= b.top && v.clientY <= b.bottom;
295
+ } else {
296
+ const b = T.current ? be(T.current) : null;
297
+ if (!b) return;
298
+ A = v.clientX >= b.x && v.clientX <= b.x + b.width && v.clientY >= b.y && v.clientY <= b.y + b.height;
299
+ }
300
+ if (!A) {
301
+ n.stopPropagation(), X.current = !0;
302
+ const b = (x) => {
303
+ x.stopPropagation(), x.preventDefault(), document.removeEventListener("click", b, !0);
304
+ };
305
+ document.addEventListener("click", b, !0), V();
306
+ }
307
+ }
308
+ }
309
+ };
310
+ return document.addEventListener("touchend", t, { passive: !0 }), () => {
311
+ document.removeEventListener("touchend", t);
312
+ };
313
+ }, [a, V, O, m]);
314
+ const ae = (c.type === "scale" || c.type === "fade") && c.direction === "vert" && $.type === "drag";
315
+ F(() => {
316
+ var x, J;
317
+ if (!a || !ae || !((J = (x = y.current) == null ? void 0 : x.splide) != null && J.root)) return;
318
+ const t = y.current.splide.root, n = 30, r = (l, w) => {
319
+ if (C.current) {
320
+ const z = Math.abs(l - C.current.x), Q = Math.abs(w - C.current.y);
321
+ (z > 0 || Q > 0) && (W.current = !0);
322
+ }
323
+ }, s = (l) => {
324
+ C.current && (l.preventDefault(), r(l.clientX, l.clientY));
325
+ }, h = (l) => {
326
+ C.current && l.touches.length > 0 && (l.preventDefault(), r(l.touches[0].clientX, l.touches[0].clientY));
327
+ }, u = (l, w) => {
328
+ if (!C.current || !y.current) {
329
+ C.current = null;
330
+ return;
331
+ }
332
+ const z = Math.abs(l - C.current.x), Q = Math.abs(w - C.current.y);
333
+ Q > n && Q > z && y.current.go(w < C.current.y ? "+1" : "-1"), C.current = null;
334
+ }, i = (l) => {
335
+ C.current && u(l.clientX, l.clientY), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), document.removeEventListener("pointermove", s);
336
+ }, v = (l) => {
337
+ if (C.current) {
338
+ if (l.changedTouches.length > 0) {
339
+ const w = l.changedTouches[0];
340
+ u(w.clientX, w.clientY);
341
+ }
342
+ document.removeEventListener("touchend", v), document.removeEventListener("touchcancel", v), document.removeEventListener("touchmove", h);
343
+ }
344
+ }, A = (l) => {
345
+ C.current = { x: l.clientX, y: l.clientY }, W.current = !1, document.addEventListener("pointermove", s, { passive: !1 }), document.addEventListener("pointerup", i), document.addEventListener("pointercancel", i);
346
+ }, b = (l) => {
347
+ l.touches.length > 0 && (C.current = { x: l.touches[0].clientX, y: l.touches[0].clientY }, W.current = !1, document.addEventListener("touchmove", h, { passive: !1 }), document.addEventListener("touchend", v), document.addEventListener("touchcancel", v));
348
+ };
349
+ return t.addEventListener("pointerdown", A), t.addEventListener("touchstart", b), () => {
350
+ t.removeEventListener("pointerdown", A), t.removeEventListener("touchstart", b), document.removeEventListener("pointermove", s), document.removeEventListener("pointerup", i), document.removeEventListener("pointercancel", i), document.removeEventListener("touchmove", h), document.removeEventListener("touchend", v), document.removeEventListener("touchcancel", v), C.current = null, W.current = !1;
351
+ };
352
+ }, [a, ae, he]);
353
+ const Ne = {
354
+ backgroundColor: S.color,
355
+ backdropFilter: `blur(${S.blur}px)`,
356
+ animationDuration: `${parseInt(q.duration)}ms`,
357
+ animationTimingFunction: "ease",
358
+ animationFillMode: "both"
359
+ };
360
+ return typeof document > "u" || !document.getElementById(k) ? null : Oe(
361
+ /* @__PURE__ */ U(ue, { children: [
362
+ /* @__PURE__ */ g(
363
+ "div",
364
+ {
365
+ ref: o ? null : I,
366
+ className: N(e.background, oe ? Te : Ae, { [e.editor]: o }, { [e.hidden]: !a }),
367
+ style: {
368
+ ...Ne,
369
+ ...Se && !o && !oe ? { position: "absolute" } : {}
370
+ }
371
+ }
372
+ ),
373
+ /* @__PURE__ */ U(
374
+ "div",
375
+ {
376
+ ref: o ? I : null,
377
+ className: N(e.contentStyle, oe ? Re : ke, { [e.editor]: o }, { [e.hidden]: !a }),
378
+ style: {
379
+ animationDuration: `${parseInt(q.duration)}ms`,
380
+ animationTimingFunction: "ease",
381
+ animationFillMode: "both"
382
+ },
383
+ children: [
384
+ /* @__PURE__ */ g(
385
+ We,
386
+ {
387
+ onMove: (t) => K(t.index),
388
+ ref: y,
389
+ className: e.lightboxSplide,
390
+ options: {
391
+ arrows: !1,
392
+ speed: c.duration ? parseInt(c.duration) : 500,
393
+ direction: c.direction === "horiz" || c.type === "fade" || c.type === "scale" ? "ltr" : "ttb",
394
+ pagination: !1,
395
+ // Disable Splide's drag when we need custom vertical drag handling
396
+ drag: $.type === "drag" && !ae,
397
+ perPage: 1,
398
+ width: "100%",
399
+ height: "100%",
400
+ type: c.type === "fade" || c.type === "scale" ? "fade" : "loop",
401
+ padding: 0,
402
+ rewind: $.repeat !== "close",
403
+ start: 0
404
+ },
405
+ style: { "--splide-speed": c.duration },
406
+ children: m.map((t, n) => {
407
+ const r = ee(E.position, E.offset, o), s = `${d(E.padding.top, o)} ${d(E.padding.right, o)} ${d(E.padding.bottom, o)} ${d(E.padding.left, o)}`, h = c.type === "scale" ? (() => {
408
+ const { transform: u, ...i } = r;
409
+ return {
410
+ ...i,
411
+ position: "absolute",
412
+ padding: s,
413
+ boxSizing: "border-box",
414
+ "--position-transform": u || "none"
415
+ };
416
+ })() : { ...r, position: "absolute", padding: s, boxSizing: "border-box" };
417
+ return /* @__PURE__ */ g(Ve, { children: /* @__PURE__ */ g("div", { className: e.imgWrapper, onClick: pe, children: /* @__PURE__ */ g(
418
+ "img",
419
+ {
420
+ ref: n === O ? T : null,
421
+ className: N(e.imageStyle, {
422
+ [e.contain]: t.image.objectFit === "contain",
423
+ [e.cover]: t.image.objectFit === "cover",
424
+ [e.scaleSlide]: c.type === "scale"
425
+ }),
426
+ src: t.image.assetId,
427
+ alt: t.image.name ?? "",
428
+ style: { ...h, pointerEvents: t.image.objectFit === "contain" ? "none" : "auto" }
429
+ }
430
+ ) }) }, n);
431
+ })
432
+ },
433
+ he
434
+ ),
435
+ _.isActive && /* @__PURE__ */ U(ue, { children: [
436
+ /* @__PURE__ */ g(
437
+ "div",
438
+ {
439
+ className: N(e.arrow, { [e.arrowVertical]: c.direction === "vert" }),
440
+ style: { color: _.color, "--arrow-hover-color": _.hover },
441
+ children: /* @__PURE__ */ U(
442
+ "button",
443
+ {
444
+ className: e.arrowInner,
445
+ style: { transform: `translate(${d(_.offset.x, o)}, ${d(_.offset.y * (c.direction === "horiz" ? 1 : -1), o)}) scale(${_.scale}) rotate(${c.direction === "horiz" ? "0deg" : "90deg"})` },
446
+ onClick: () => {
447
+ var t;
448
+ return (t = y.current) == null ? void 0 : t.go("-1");
449
+ },
450
+ "aria-label": "Previous",
451
+ children: [
452
+ _.arrowsImgUrl && /* @__PURE__ */ g(
453
+ se,
454
+ {
455
+ url: _.arrowsImgUrl,
456
+ fill: _.color,
457
+ hoverFill: _.hover,
458
+ className: N(e.arrowImg, e.mirror)
459
+ }
460
+ ),
461
+ !_.arrowsImgUrl && /* @__PURE__ */ g(Le, { color: _.color, className: N(e.arrowIcon, e.arrowImg, e.mirror) })
462
+ ]
463
+ }
464
+ )
465
+ }
466
+ ),
467
+ /* @__PURE__ */ g(
468
+ "div",
469
+ {
470
+ className: N(e.arrow, e.nextArrow, { [e.arrowVertical]: c.direction === "vert" }),
471
+ style: { color: _.color, "--arrow-hover-color": _.hover },
472
+ children: /* @__PURE__ */ U(
473
+ "button",
474
+ {
475
+ className: e.arrowInner,
476
+ style: { transform: `translate(${d(_.offset.x * (c.direction === "horiz" ? -1 : 1), o)}, ${d(_.offset.y, o)}) scale(${_.scale}) rotate(${c.direction === "horiz" ? "0deg" : "90deg"})` },
477
+ onClick: () => {
478
+ var t;
479
+ return (t = y.current) == null ? void 0 : t.go("+1");
480
+ },
481
+ "aria-label": "Next",
482
+ children: [
483
+ _.arrowsImgUrl && /* @__PURE__ */ g(
484
+ se,
485
+ {
486
+ url: _.arrowsImgUrl,
487
+ fill: _.color,
488
+ hoverFill: _.hover,
489
+ className: e.arrowImg
490
+ }
491
+ ),
492
+ !_.arrowsImgUrl && /* @__PURE__ */ g(Le, { color: _.color, className: N(e.arrowIcon, e.arrowImg) })
493
+ ]
494
+ }
495
+ )
496
+ }
497
+ )
498
+ ] }),
499
+ S.closeIconUrl && (() => {
500
+ const t = ee(S.closeIconAlign, S.closeIconOffset, o), n = `scale(${S.closeIconScale})`, r = t.transform ? `${t.transform} ${n}` : n;
501
+ return /* @__PURE__ */ g("button", { className: e.closeButton, style: { ...t, transform: r }, onClick: V, "aria-label": "Close lightbox", children: /* @__PURE__ */ g(se, { url: S.closeIconUrl, fill: S.closeIconColor ?? "#000000", hoverFill: S.closeIconHover ?? "#cccccc" }) });
502
+ })(),
503
+ Y && Y.isActive && f.imageCaption && ((_e = m[O]) == null ? void 0 : _e.imageCaption) && /* @__PURE__ */ g(
504
+ "div",
505
+ {
506
+ className: e.caption,
507
+ style: {
508
+ ...ee(Y.alignment, Y.offset, o),
509
+ fontFamily: Xe(G.fontFamily),
510
+ fontWeight: G.fontWeight,
511
+ fontStyle: G.fontStyle,
512
+ width: D.sizing === "auto" ? "max-content" : d(D.width, o),
513
+ letterSpacing: d(xe, o),
514
+ wordSpacing: d(Ie, o),
515
+ textAlign: ye,
516
+ fontSize: d(de.fontSize, o),
517
+ lineHeight: d(de.lineHeight, o),
518
+ textTransform: te.textTransform ?? "none",
519
+ textDecoration: te.textDecoration ?? "none",
520
+ fontVariant: te.fontVariant ?? "normal",
521
+ color: Ce
522
+ },
523
+ onClick: (t) => t.stopPropagation(),
524
+ children: /* @__PURE__ */ g(
525
+ "div",
526
+ {
527
+ "data-styles": "imageCaption",
528
+ className: e.captionTextInner,
529
+ style: {
530
+ "--link-color": Y.linkColor,
531
+ "--link-hover-color": Y.linkHoverColor
532
+ },
533
+ children: /* @__PURE__ */ g(De, { content: m[O].imageCaption })
534
+ }
535
+ )
536
+ }
537
+ ),
538
+ p.isActive && (() => {
539
+ const [t, n] = p.position.split("-"), r = c.direction === "horiz" ? `${t}-left` : p.position, s = ee(r, p.offset, o), h = () => {
540
+ if (c.direction === "horiz") {
541
+ if (n === "left") return "flex-start";
542
+ if (n === "center") return "center";
543
+ if (n === "right") return "flex-end";
544
+ } else {
545
+ if (t === "top") return "flex-start";
546
+ if (t === "middle") return "center";
547
+ if (t === "bottom") return "flex-end";
548
+ }
549
+ return "flex-start";
550
+ };
551
+ return /* @__PURE__ */ g(
552
+ "div",
553
+ {
554
+ ref: fe,
555
+ className: e.thumbsWrapper,
556
+ onClick: (u) => ze(u),
557
+ style: {
558
+ position: o ? "absolute" : "fixed",
559
+ ...s,
560
+ ...c.direction === "horiz" ? {
561
+ maxWidth: "100vw",
562
+ width: "100%",
563
+ overflowX: "auto",
564
+ overflowY: "hidden"
565
+ } : {
566
+ maxHeight: "100vh",
567
+ overflowY: "auto",
568
+ overflowX: "hidden"
569
+ }
570
+ },
571
+ children: /* @__PURE__ */ g(
572
+ "div",
573
+ {
574
+ className: N(e.thumbsContainer, {
575
+ [e.thumbsContainerVertical]: c.direction === "vert",
576
+ [e.thumbsAlignStart]: p.align === "start",
577
+ [e.thumbsAlignCenter]: p.align === "center",
578
+ [e.thumbsAlignEnd]: p.align === "end"
579
+ }),
580
+ style: {
581
+ gap: d(p.grid.gap, o),
582
+ justifyContent: Be ? "flex-start" : h()
583
+ },
584
+ children: m.map((u, i) => {
585
+ const v = i === O, A = me[i], x = p.grid.size * (v ? p.activeState.scale : 1), J = () => {
586
+ if (p.fit !== "fit") return {};
587
+ if (!A)
588
+ return c.direction === "horiz" ? { height: d(x, o) } : { width: d(x, o) };
589
+ const l = A.width / A.height;
590
+ if (c.direction === "horiz") {
591
+ const w = x, z = w * l;
592
+ return {
593
+ width: d(z, o),
594
+ height: d(w, o)
595
+ };
596
+ } else {
597
+ const w = x, z = w / l;
598
+ return {
599
+ width: d(w, o),
600
+ height: d(z, o)
601
+ };
602
+ }
603
+ };
604
+ return /* @__PURE__ */ g(
605
+ "button",
606
+ {
607
+ className: e.thumbItem,
608
+ style: {
609
+ ...c.direction === "horiz" && p.fit !== "fit" ? { height: d(x, o) } : {},
610
+ ...c.direction === "vert" && p.fit !== "fit" ? { width: d(x, o) } : {},
611
+ ...p.fit === "cover" ? { width: d(x, o), height: d(x, o) } : {},
612
+ ...J(),
613
+ transition: v ? "all 0.25s ease-out" : "none",
614
+ opacity: v ? p.activeState.opacity / 100 : p.opacity / 100,
615
+ "--thumb-hover": p.activeState.opacity / 100
616
+ },
617
+ onClick: (l) => {
618
+ var w;
619
+ l.stopPropagation(), K(i), (w = y.current) == null || w.go(i);
620
+ },
621
+ onMouseEnter: () => {
622
+ var l;
623
+ p.triggers === "hov" && ((l = y.current) == null || l.go(i));
624
+ },
625
+ children: /* @__PURE__ */ g(
626
+ "img",
627
+ {
628
+ src: u.image.assetId,
629
+ alt: u.image.name ?? "",
630
+ onLoad: (l) => {
631
+ const w = l.currentTarget;
632
+ w.naturalWidth && w.naturalHeight && ge((z) => ({
633
+ ...z,
634
+ [i]: { width: w.naturalWidth, height: w.naturalHeight }
635
+ }));
636
+ },
637
+ style: {
638
+ objectFit: p.fit === "cover" ? "cover" : "contain",
639
+ ...p.fit === "fit" ? { maxWidth: "100%", maxHeight: "100%", objectFit: "contain" } : {},
640
+ ...p.fit === "cover" ? { width: "100%", height: "100%" } : {}
641
+ }
642
+ }
643
+ )
644
+ },
645
+ `${u.image.name}-${i}`
646
+ );
647
+ })
648
+ }
649
+ )
650
+ }
651
+ );
652
+ })()
653
+ ]
654
+ }
655
+ )
656
+ ] }),
657
+ document.getElementById(k)
658
+ );
659
+ };
660
+ function Le({ color: a, className: L }) {
661
+ return /* @__PURE__ */ g("svg", { viewBox: "0 0 10 18", className: L, children: /* @__PURE__ */ g("g", { id: "Symbols", stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: /* @__PURE__ */ g("path", { d: "M-3.70710678,4.29289322 C-3.34662282,3.93240926 -2.77939176,3.90467972 -2.38710056,4.20970461 L-2.29289322,4.29289322 L5,11.585 L12.2928932,4.29289322 C12.6533772,3.93240926 13.2206082,3.90467972 13.6128994,4.20970461 L13.7071068,4.29289322 C14.0675907,4.65337718 14.0953203,5.22060824 13.7902954,5.61289944 L13.7071068,5.70710678 L5.70710678,13.7071068 C5.34662282,14.0675907 4.77939176,14.0953203 4.38710056,13.7902954 L4.29289322,13.7071068 L-3.70710678,5.70710678 C-4.09763107,5.31658249 -4.09763107,4.68341751 -3.70710678,4.29289322 Z", id: "Shape-Copy", fill: a, transform: "translate(5, 9) rotate(-90) translate(-5, -9)" }) }) });
662
+ }
663
+ export {
664
+ Vt as LightboxGallery
665
+ };