@cntrl-site/components 1.0.116-alpha.0 → 1.0.116
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.
- package/dist/{Burger-DyORh_vF.mjs → Burger-BkVgNMGU.mjs} +1 -1
- package/dist/{Burger-B4kXX9aY.js → Burger-C3yVbQcq.js} +1 -1
- package/dist/Chronicles-BNvvaFYY.mjs +744 -0
- package/dist/Chronicles-Dj1gvNjE.js +196 -0
- package/dist/{ChroniclesComponent-jh4v7wp6.mjs → ChroniclesComponent-0ZWBPdbh.mjs} +542 -491
- package/dist/ChroniclesComponent-D4_6w8f7.js +1 -0
- package/dist/Components/Chronicles/Chronicles.d.ts +7 -1
- package/dist/Components/Chronicles/ChroniclesComponent.d.ts +26 -2
- package/dist/Components/LightboxJournal/LightboxJournal.d.ts +1 -0
- package/dist/Components/LightboxStrip/LightboxStrip.d.ts +1 -0
- package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +0 -7
- package/dist/{ControlSlider-DB4nbVLT.js → ControlSlider-C8ckUIDm.js} +1 -1
- package/dist/{ControlSlider-3w-bHQEg.mjs → ControlSlider-DqKfaKMG.mjs} +1 -1
- package/dist/{FAQ-GmiwRdFq.mjs → FAQ-CJHCMSBa.mjs} +1 -1
- package/dist/{FAQ-7HEkaoU6.js → FAQ-DLh63Utr.js} +1 -1
- package/dist/{Grid-BzarI5Mc.js → Grid-OvzWvUW9.js} +1 -1
- package/dist/{Grid-Z2JZyUdC.mjs → Grid-t07NDMzY.mjs} +1 -1
- package/dist/{Hive-34KvKNsa.js → Hive-CzabuuCc.js} +1 -1
- package/dist/{Hive-7xHXyMM1.mjs → Hive-DyxYd5eg.mjs} +1 -1
- package/dist/{HiveLightboxTitles-BCoL46-V.mjs → HiveLightboxTitles-DhEeFKWs.mjs} +1 -1
- package/dist/{HiveLightboxTitles-DEeyQGcf.js → HiveLightboxTitles-DlyptAaK.js} +1 -1
- package/dist/{Lightbox-DzPqgKP4.mjs → Lightbox-BY99NS14.mjs} +1 -1
- package/dist/{Lightbox-Cb7lyaNt.js → Lightbox-DZckgBzK.js} +1 -1
- package/dist/LightboxJournal-Bmw2zm4t.js +549 -0
- package/dist/{LightboxJournal-C_q7_s-B.mjs → LightboxJournal-gePVKQJ4.mjs} +429 -403
- package/dist/{LightboxStrip-BrNj7ipX.mjs → LightboxStrip-BPQiQhd3.mjs} +461 -435
- package/dist/LightboxStrip-CTxRwLYk.js +412 -0
- package/dist/{Mercury-BmhtFYOw.js → Mercury-B-s2Kvuq.js} +1 -1
- package/dist/{Mercury-Q788wrYQ.mjs → Mercury-CCW0Es-s.mjs} +1 -1
- package/dist/{OnelinerForm-D8WIB9Qy.mjs → OnelinerForm-BEu7_sho.mjs} +1 -1
- package/dist/{OnelinerForm-CUmY-bXL.js → OnelinerForm-C2Y_XMCY.js} +1 -1
- package/dist/{SimpleButton-DTpzfmb6.mjs → SimpleButton-C-o2W9bS.mjs} +1 -1
- package/dist/{SimpleButton-DtaCYa3y.js → SimpleButton-nGEcO2gB.js} +1 -1
- package/dist/{Slider20-q0iGgnE3.js → Slider20-BOmjDRf2.js} +1 -1
- package/dist/{Slider20-CKngROrc.mjs → Slider20-DUi6qwnd.mjs} +1 -1
- package/dist/SvgImage-B5mR9y6q.mjs +51 -0
- package/dist/SvgImage-DFlmxAoL.js +1 -0
- package/dist/{TestimonialSingle-CpEUendN.js → TestimonialSingle-BORQom3u.js} +1 -1
- package/dist/{TestimonialSingle-Bax71Hyo.mjs → TestimonialSingle-DrnyReim.mjs} +1 -1
- package/dist/{Waterfall-znaoynn5.mjs → Waterfall-3kKioKh2.mjs} +1 -1
- package/dist/{Waterfall-B9YWMhrg.js → Waterfall-DII4-WV5.js} +1 -1
- package/dist/components-B8MjlzLL.js +1 -0
- package/dist/{components-C9Fu28pp.mjs → components-BQjon_-7.mjs} +29 -653
- package/dist/elements.js +1 -1
- package/dist/elements.mjs +23 -24
- package/dist/elements.node.js +1 -1
- package/dist/elements.node.mjs +1 -1
- package/dist/index.d.ts +2 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +38 -61
- package/dist/loadSvgMaskUrl-DfF7ay6h.js +1 -0
- package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +20 -0
- package/dist/sources.js +124 -25
- package/dist/sources.mjs +131 -32
- package/dist/types/Component.d.ts +0 -7
- package/dist/types/SchemaV1.d.ts +3 -3
- package/package.json +1 -1
- package/dist/Chronicles-Cy2h3jlZ.mjs +0 -724
- package/dist/Chronicles-D0ojQzOP.js +0 -196
- package/dist/ChroniclesComponent-DYPJBI3d.js +0 -1
- package/dist/Components/PopupMenu/PopupMenu.d.ts +0 -73
- package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +0 -594
- package/dist/Components/PopupMenu/popupMenuLayout.d.ts +0 -203
- package/dist/Components/PopupMenu/popupMenuSnap.d.ts +0 -61
- package/dist/LightboxJournal-BFF5aKRz.js +0 -523
- package/dist/LightboxStrip-CC2e0_9A.js +0 -386
- package/dist/PopupMenu-CYdDyzEt.mjs +0 -1372
- package/dist/PopupMenu-Di1fHgho.js +0 -409
- package/dist/SvgImage-CwRq9-ec.mjs +0 -56
- package/dist/SvgImage-_QN8ngad.js +0 -1
- package/dist/components-6QFLq5OI.js +0 -1
- package/dist/loadSvgMaskUrl-B6kHUyof.js +0 -1
- package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +0 -39
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { jsxs as w, jsx as f, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { u as
|
|
5
|
-
import { i as
|
|
6
|
-
import { s as
|
|
7
|
-
import { S as
|
|
8
|
-
import { u as
|
|
9
|
-
import { t as
|
|
10
|
-
const
|
|
1
|
+
import { jsxs as w, jsx as f, Fragment as yt } from "react/jsx-runtime";
|
|
2
|
+
import { useState as wt, useRef as p, useMemo as O, useCallback as W, useEffect as ft, useLayoutEffect as ae } from "react";
|
|
3
|
+
import { createPortal as zn } from "react-dom";
|
|
4
|
+
import { u as Fn } from "./useScopedStyles-DhBG3557.mjs";
|
|
5
|
+
import { i as Kt, g as Ve, u as Kn } from "./useLightboxSwipeDismiss-SGv6Ra33.mjs";
|
|
6
|
+
import { s as _t } from "./scalingValue-C9JH5L6O.mjs";
|
|
7
|
+
import { S as Bn } from "./SvgImage-B5mR9y6q.mjs";
|
|
8
|
+
import { u as Hn } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
|
|
9
|
+
import { t as Dn } from "./textStylesToCss-05Mn6I_2.mjs";
|
|
10
|
+
const Xn = (e, o, a, c) => {
|
|
11
11
|
const s = Math.min(Math.abs(e) / Math.max(c, 1), 1);
|
|
12
12
|
return o + (a - o) * s;
|
|
13
|
-
},
|
|
13
|
+
}, jn = (e) => {
|
|
14
14
|
e.style.transition = "", e.style.transform = "", e.style.willChange = "";
|
|
15
|
-
},
|
|
15
|
+
}, Gn = (e) => {
|
|
16
16
|
const o = getComputedStyle(e).transform;
|
|
17
17
|
return o === "none" ? 0 : new DOMMatrixReadOnly(o).m41;
|
|
18
|
-
},
|
|
19
|
-
const m = e.scrollLeft,
|
|
20
|
-
|
|
18
|
+
}, Vn = (e, o, a, { duration: c, easing: s, onComplete: d }) => {
|
|
19
|
+
const m = e.scrollLeft, $ = a - m, A = m - a, F = (M, tt) => {
|
|
20
|
+
jn(o), e.scrollLeft = M, tt && (d == null || d());
|
|
21
21
|
};
|
|
22
|
-
if (Math.abs(
|
|
23
|
-
return
|
|
22
|
+
if (Math.abs($) < 0.5)
|
|
23
|
+
return F(a, !0), () => {
|
|
24
24
|
};
|
|
25
|
-
let k = !1,
|
|
26
|
-
const
|
|
27
|
-
o.removeEventListener("transitionend",
|
|
28
|
-
},
|
|
29
|
-
|
|
25
|
+
let k = !1, P = 0;
|
|
26
|
+
const R = () => {
|
|
27
|
+
o.removeEventListener("transitionend", K), clearTimeout(P);
|
|
28
|
+
}, K = (M) => {
|
|
29
|
+
M.target !== o || M.propertyName !== "transform" || k || (k = !0, R(), F(a, !0));
|
|
30
30
|
};
|
|
31
|
-
return o.addEventListener("transitionend",
|
|
32
|
-
k || (k = !0,
|
|
31
|
+
return o.addEventListener("transitionend", K), o.style.willChange = "transform", o.style.transition = "none", o.style.transform = "translate3d(0, 0, 0)", o.offsetHeight, o.style.transition = `transform ${c}ms ${s}`, o.style.transform = `translate3d(${A}px, 0, 0)`, P = window.setTimeout(() => {
|
|
32
|
+
k || (k = !0, R(), F(a, !0));
|
|
33
33
|
}, c + 64), () => {
|
|
34
|
-
k || (k = !0,
|
|
34
|
+
k || (k = !0, R(), F(m - Gn(o), !1));
|
|
35
35
|
};
|
|
36
|
-
},
|
|
36
|
+
}, $t = 300, Yn = 900, qn = 1500, Un = "cubic-bezier(0.16, 1, 0.3, 1)", Zn = 3e3, Jn = 2, Qn = 16, Pn = 0.05, tr = 1, Ot = 0.3, er = 50, nr = 20, ut = 4e-3, rr = ["title1", "title2", "title3"], or = {
|
|
37
37
|
title1: "1",
|
|
38
38
|
title2: "2",
|
|
39
39
|
title3: "3"
|
|
40
|
-
},
|
|
40
|
+
}, ir = {
|
|
41
41
|
title1: "title1Color",
|
|
42
42
|
title2: "title2Color",
|
|
43
43
|
title3: "title3Color"
|
|
44
|
-
},
|
|
44
|
+
}, lr = {
|
|
45
45
|
title1: 0.02,
|
|
46
46
|
title2: 0.02,
|
|
47
47
|
title3: 0.02
|
|
48
|
-
},
|
|
48
|
+
}, kt = (e) => `max(${e}, ${nr}px)`, sr = (e) => {
|
|
49
49
|
if (!Array.isArray(e) || e.length === 0) return {};
|
|
50
50
|
const o = e.find((s) => (s == null ? void 0 : s.type) === "paragraph") ?? e[0], a = o == null ? void 0 : o.children;
|
|
51
51
|
if (!Array.isArray(a)) return {};
|
|
@@ -55,7 +55,7 @@ const Bn = (e, o, a, c) => {
|
|
|
55
55
|
title2: c[1],
|
|
56
56
|
title3: c[2]
|
|
57
57
|
};
|
|
58
|
-
},
|
|
58
|
+
}, ar = (e) => {
|
|
59
59
|
if (!e)
|
|
60
60
|
return { title1: "", title2: "", title3: "" };
|
|
61
61
|
if (e.title1 || e.title2 || e.title3)
|
|
@@ -64,89 +64,89 @@ const Bn = (e, o, a, c) => {
|
|
|
64
64
|
title2: e.title2 ?? "",
|
|
65
65
|
title3: e.title3 ?? ""
|
|
66
66
|
};
|
|
67
|
-
const o =
|
|
67
|
+
const o = sr(e.text);
|
|
68
68
|
return {
|
|
69
69
|
title1: o.title1 ?? "",
|
|
70
70
|
title2: o.title2 ?? "",
|
|
71
71
|
title3: o.title3 ?? ""
|
|
72
72
|
};
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
}, X = (e, o) => `${e}${o.charAt(0).toUpperCase()}${o.slice(1)}`, cr = (e) => [
|
|
74
|
+
X(e, "fontFamily"),
|
|
75
|
+
X(e, "fontSettings"),
|
|
76
76
|
{
|
|
77
77
|
type: "row",
|
|
78
78
|
items: [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
X(e, "fontSize"),
|
|
80
|
+
X(e, "lineHeight"),
|
|
81
|
+
X(e, "letterSpacing"),
|
|
82
|
+
X(e, "wordSpacing")
|
|
83
83
|
]
|
|
84
84
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
],
|
|
85
|
+
X(e, "textAlign"),
|
|
86
|
+
X(e, "textAppearance")
|
|
87
|
+
], Lr = () => ({
|
|
88
88
|
type: "tab",
|
|
89
89
|
id: "stripTextStyle",
|
|
90
90
|
tabs: Object.fromEntries(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
rr.map((e) => [
|
|
92
|
+
or[e],
|
|
93
|
+
cr(e)
|
|
94
94
|
])
|
|
95
95
|
)
|
|
96
|
-
}),
|
|
96
|
+
}), fe = (e, o) => {
|
|
97
97
|
if (e <= 0)
|
|
98
98
|
return [];
|
|
99
99
|
const a = o.slice(0, e), c = a.reduce((d, m) => d + m, 0);
|
|
100
100
|
if (c <= 1)
|
|
101
101
|
return a;
|
|
102
102
|
const { widths: s } = [...a].reverse().reduce(
|
|
103
|
-
({ overflow: d, widths: m },
|
|
104
|
-
if (d <= 0 ||
|
|
105
|
-
return { overflow: d, widths: [
|
|
106
|
-
const
|
|
103
|
+
({ overflow: d, widths: m }, $) => {
|
|
104
|
+
if (d <= 0 || $ <= 0)
|
|
105
|
+
return { overflow: d, widths: [$, ...m] };
|
|
106
|
+
const A = Math.min(d, $);
|
|
107
107
|
return {
|
|
108
|
-
overflow: d -
|
|
109
|
-
widths: [
|
|
108
|
+
overflow: d - A,
|
|
109
|
+
widths: [$ - A, ...m]
|
|
110
110
|
};
|
|
111
111
|
},
|
|
112
112
|
{ overflow: c - 1, widths: [] }
|
|
113
113
|
);
|
|
114
114
|
return s;
|
|
115
|
-
},
|
|
115
|
+
}, Ye = (e, o) => fe(e, o), Et = (e, o) => {
|
|
116
116
|
const a = o.filter((c, s) => s !== e).reduce((c, s) => c + s, 0);
|
|
117
117
|
return Math.max(1 - a, 0);
|
|
118
|
-
},
|
|
118
|
+
}, Ge = (e, o) => {
|
|
119
119
|
const a = e.map((c) => o[c.widthKey] ?? 0);
|
|
120
120
|
return {
|
|
121
|
-
resolved:
|
|
122
|
-
effective:
|
|
121
|
+
resolved: fe(e.length, a),
|
|
122
|
+
effective: Ye(e.length, a)
|
|
123
123
|
};
|
|
124
|
-
},
|
|
125
|
-
const
|
|
126
|
-
return o &&
|
|
124
|
+
}, ur = (e, o, a, c, s, d, m) => {
|
|
125
|
+
const $ = [];
|
|
126
|
+
return o && $.push({
|
|
127
127
|
prefix: "title1",
|
|
128
128
|
widthKey: "title1Width",
|
|
129
129
|
className: `${e}-title1`,
|
|
130
130
|
style: s,
|
|
131
131
|
text: o
|
|
132
|
-
}), a &&
|
|
132
|
+
}), a && $.push({
|
|
133
133
|
prefix: "title2",
|
|
134
134
|
widthKey: "title2Width",
|
|
135
135
|
marginLeftKey: "title2MarginLeft",
|
|
136
136
|
className: `${e}-title2`,
|
|
137
137
|
style: d,
|
|
138
138
|
text: a
|
|
139
|
-
}), c &&
|
|
139
|
+
}), c && $.push({
|
|
140
140
|
prefix: "title3",
|
|
141
141
|
widthKey: "title3Width",
|
|
142
142
|
marginLeftKey: "title3MarginLeft",
|
|
143
143
|
className: `${e}-title3`,
|
|
144
144
|
style: m,
|
|
145
145
|
text: c
|
|
146
|
-
}),
|
|
147
|
-
},
|
|
146
|
+
}), $;
|
|
147
|
+
}, ce = (e, o) => {
|
|
148
148
|
const a = (c) => {
|
|
149
|
-
const s =
|
|
149
|
+
const s = X(o, c);
|
|
150
150
|
return e[s];
|
|
151
151
|
};
|
|
152
152
|
return {
|
|
@@ -161,12 +161,12 @@ const Bn = (e, o, a, c) => {
|
|
|
161
161
|
wordSpacing: a("wordSpacing") ?? 0,
|
|
162
162
|
textAlign: a("textAlign") ?? "left",
|
|
163
163
|
textAppearance: a("textAppearance"),
|
|
164
|
-
color: e[
|
|
164
|
+
color: e[ir[o]]
|
|
165
165
|
};
|
|
166
|
-
},
|
|
166
|
+
}, fr = (e, o, a, c) => e.slice(0, c).reduce(
|
|
167
167
|
(s, d, m) => s + (d != null && d.marginLeftKey ? a[d.marginLeftKey] ?? 0 : 0) + (o[m] ?? 0),
|
|
168
168
|
0
|
|
169
|
-
),
|
|
169
|
+
), ue = (e, o, a) => {
|
|
170
170
|
var s, d;
|
|
171
171
|
const c = {
|
|
172
172
|
fontSettings: {
|
|
@@ -174,7 +174,7 @@ const Bn = (e, o, a, c) => {
|
|
|
174
174
|
fontWeight: ((s = o.fontSettings) == null ? void 0 : s.fontWeight) ?? 400,
|
|
175
175
|
fontStyle: ((d = o.fontSettings) == null ? void 0 : d.fontStyle) ?? "normal"
|
|
176
176
|
},
|
|
177
|
-
fontSize: o.fontSize ??
|
|
177
|
+
fontSize: o.fontSize ?? lr[e],
|
|
178
178
|
lineHeight: o.lineHeight,
|
|
179
179
|
letterSpacing: o.letterSpacing,
|
|
180
180
|
wordSpacing: o.wordSpacing,
|
|
@@ -182,8 +182,8 @@ const Bn = (e, o, a, c) => {
|
|
|
182
182
|
textAppearance: o.textAppearance,
|
|
183
183
|
color: o.color ?? "#ffffff"
|
|
184
184
|
};
|
|
185
|
-
return
|
|
186
|
-
},
|
|
185
|
+
return Dn(c, a);
|
|
186
|
+
}, hr = ({
|
|
187
187
|
prefix: e,
|
|
188
188
|
images: o,
|
|
189
189
|
settings: a,
|
|
@@ -193,99 +193,99 @@ const Bn = (e, o, a, c) => {
|
|
|
193
193
|
onClose: m
|
|
194
194
|
}) => {
|
|
195
195
|
const {
|
|
196
|
-
backgroundColor:
|
|
197
|
-
thumbnailSize:
|
|
198
|
-
thumbnailGap:
|
|
196
|
+
backgroundColor: $,
|
|
197
|
+
thumbnailSize: A,
|
|
198
|
+
thumbnailGap: F,
|
|
199
199
|
thumbnailMarginBottom: k,
|
|
200
|
-
imageGap:
|
|
201
|
-
closeIcon:
|
|
202
|
-
closeIconMaxWidth:
|
|
203
|
-
closeIconColor:
|
|
200
|
+
imageGap: P,
|
|
201
|
+
closeIcon: R,
|
|
202
|
+
closeIconMaxWidth: K,
|
|
203
|
+
closeIconColor: M,
|
|
204
204
|
closeIconHoverColor: tt,
|
|
205
|
-
thumbnailTrigger:
|
|
206
|
-
thumbnailVisibility:
|
|
207
|
-
thumbnailObjectFit:
|
|
208
|
-
thumbnailActive:
|
|
209
|
-
thumbnailActiveColor:
|
|
210
|
-
title1Width:
|
|
211
|
-
title2Width:
|
|
212
|
-
title3Width:
|
|
205
|
+
thumbnailTrigger: St,
|
|
206
|
+
thumbnailVisibility: ht,
|
|
207
|
+
thumbnailObjectFit: Lt,
|
|
208
|
+
thumbnailActive: Ue,
|
|
209
|
+
thumbnailActiveColor: Ze,
|
|
210
|
+
title1Width: Bt,
|
|
211
|
+
title2Width: he,
|
|
212
|
+
title3Width: de,
|
|
213
213
|
title1MarginLeft: C = 0,
|
|
214
|
-
title2MarginLeft:
|
|
215
|
-
title3MarginLeft:
|
|
216
|
-
titleRowMarginBottom:
|
|
217
|
-
titleHeaderLayout:
|
|
218
|
-
contentMarginTop:
|
|
219
|
-
iconMarginLeft:
|
|
220
|
-
} = a, et = (t) =>
|
|
221
|
-
|
|
222
|
-
const
|
|
223
|
-
() =>
|
|
224
|
-
[e, nt,
|
|
225
|
-
), rt =
|
|
214
|
+
title2MarginLeft: me = 0,
|
|
215
|
+
title3MarginLeft: pe = 0,
|
|
216
|
+
titleRowMarginBottom: ge = 0,
|
|
217
|
+
titleHeaderLayout: ve = "desktop",
|
|
218
|
+
contentMarginTop: Je,
|
|
219
|
+
iconMarginLeft: Qe
|
|
220
|
+
} = a, et = (t) => _t(t, c ?? !1), Pe = A ?? a.thumnailSize ?? 0.03, be = et(Pe), Ht = et(F), Dt = et(k ?? 0.02), dt = et(P ?? 0), xe = et(Je ?? 0), tn = kt(xe), ye = et(Qe ?? 0), [nt, Xt] = wt(0), N = p(nt);
|
|
221
|
+
N.current = nt;
|
|
222
|
+
const en = o[nt], { title1: jt, title2: Gt, title3: Vt } = ar(en), we = ue("title1", ce(a, "title1"), c), $e = ue("title2", ce(a, "title2"), c), Se = ue("title3", ce(a, "title3"), c), _ = ve === "mobile", q = !s && (!c || d), mt = q, pt = q, nn = q, Le = Kt(Lt), rn = Le ? { "--image-aspect-ratio": Ve(Lt) } : void 0, Te = !!(jt || Gt || Vt), v = O(
|
|
223
|
+
() => ur(e, jt, Gt, Vt, we, $e, Se),
|
|
224
|
+
[e, nt, jt, Gt, Vt, we, $e, Se]
|
|
225
|
+
), rt = O(() => ({ title1Width: Bt, title2Width: he, title3Width: de }), [Bt, he, de]), Tt = O(() => v.map((t) => rt[t.widthKey]), [v, rt]), B = O(() => fe(v.length, Tt), [v.length, Tt]), Ie = O(() => Ye(v.length, Tt), [v.length, Tt]), It = O(() => v.filter((t) => t.prefix === "title1"), [v]), E = O(() => v.filter((t) => t.prefix === "title2" || t.prefix === "title3"), [v]), Wt = O(() => Ge(It, rt), [It, rt]), j = O(() => Ge(E, rt), [E, rt]), Yt = W((t, n) => {
|
|
226
226
|
const r = v.indexOf(t);
|
|
227
|
-
if (!
|
|
227
|
+
if (!_ || n === "single-row")
|
|
228
228
|
return {
|
|
229
|
-
effectiveWidth:
|
|
230
|
-
resolvedWidth:
|
|
231
|
-
maxWidth:
|
|
229
|
+
effectiveWidth: Ie[r] ?? 0,
|
|
230
|
+
resolvedWidth: B[r] ?? 0,
|
|
231
|
+
maxWidth: Et(r, B)
|
|
232
232
|
};
|
|
233
233
|
if (n === "two-row-top") {
|
|
234
|
-
const l =
|
|
234
|
+
const l = It.indexOf(t);
|
|
235
235
|
return {
|
|
236
|
-
effectiveWidth:
|
|
237
|
-
resolvedWidth:
|
|
238
|
-
maxWidth:
|
|
236
|
+
effectiveWidth: Wt.effective[l] ?? 0,
|
|
237
|
+
resolvedWidth: Wt.resolved[l] ?? 0,
|
|
238
|
+
maxWidth: Et(l, Wt.resolved)
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
|
-
const i =
|
|
241
|
+
const i = E.indexOf(t);
|
|
242
242
|
return {
|
|
243
243
|
effectiveWidth: j.effective[i] ?? 0,
|
|
244
244
|
resolvedWidth: j.resolved[i] ?? 0,
|
|
245
|
-
maxWidth:
|
|
245
|
+
maxWidth: Et(i, j.resolved)
|
|
246
246
|
};
|
|
247
247
|
}, [
|
|
248
|
-
|
|
248
|
+
E,
|
|
249
249
|
j,
|
|
250
|
-
|
|
251
|
-
|
|
250
|
+
Ie,
|
|
251
|
+
B,
|
|
252
252
|
v,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
]), y =
|
|
257
|
-
(t) =>
|
|
253
|
+
It,
|
|
254
|
+
Wt,
|
|
255
|
+
_
|
|
256
|
+
]), y = W(
|
|
257
|
+
(t) => _t(t, c ?? !1),
|
|
258
258
|
[c]
|
|
259
|
-
),
|
|
259
|
+
), on = y(ge ?? 0), z = O(
|
|
260
260
|
() => ({
|
|
261
261
|
title1MarginLeft: C,
|
|
262
|
-
title2MarginLeft:
|
|
263
|
-
title3MarginLeft:
|
|
262
|
+
title2MarginLeft: me,
|
|
263
|
+
title3MarginLeft: pe
|
|
264
264
|
}),
|
|
265
|
-
[C,
|
|
266
|
-
),
|
|
265
|
+
[C, me, pe]
|
|
266
|
+
), ln = W(
|
|
267
267
|
(t) => v.slice(0, t + 1).reduce(
|
|
268
|
-
(n, r, i) => n + (r != null && r.marginLeftKey ? z[r.marginLeftKey] ?? 0 : 0) + (
|
|
268
|
+
(n, r, i) => n + (r != null && r.marginLeftKey ? z[r.marginLeftKey] ?? 0 : 0) + (B[i] ?? 0),
|
|
269
269
|
0
|
|
270
|
-
) + (
|
|
271
|
-
[v, z,
|
|
272
|
-
),
|
|
273
|
-
() =>
|
|
274
|
-
[
|
|
275
|
-
),
|
|
276
|
-
(t) =>
|
|
270
|
+
) + (_ ? 0 : C ?? 0),
|
|
271
|
+
[v, z, B, _, C]
|
|
272
|
+
), sn = W(
|
|
273
|
+
() => _ ? 0 : C ?? 0,
|
|
274
|
+
[_, C]
|
|
275
|
+
), qt = W(
|
|
276
|
+
(t) => E.slice(0, t).reduce(
|
|
277
277
|
(n, r, i) => n + (r.marginLeftKey ? z[r.marginLeftKey] ?? 0 : 0) + (j.resolved[i] ?? 0),
|
|
278
278
|
0
|
|
279
279
|
),
|
|
280
|
-
[
|
|
281
|
-
),
|
|
280
|
+
[E, j.resolved, z]
|
|
281
|
+
), an = W(
|
|
282
282
|
(t) => {
|
|
283
|
-
const n =
|
|
284
|
-
return
|
|
283
|
+
const n = E[t];
|
|
284
|
+
return qt(t) + (n.marginLeftKey ? z[n.marginLeftKey] ?? 0 : 0) + (j.resolved[t] ?? 0);
|
|
285
285
|
},
|
|
286
|
-
[
|
|
287
|
-
),
|
|
288
|
-
const r = t.marginLeftKey ? z[t.marginLeftKey] ?? 0 : 0, { effectiveWidth: i, resolvedWidth: l, maxWidth: u } =
|
|
286
|
+
[E, j.resolved, qt, z]
|
|
287
|
+
), Ut = (t, n) => {
|
|
288
|
+
const r = t.marginLeftKey ? z[t.marginLeftKey] ?? 0 : 0, { effectiveWidth: i, resolvedWidth: l, maxWidth: u } = Yt(t, n), h = s && n === "two-row-top";
|
|
289
289
|
return /* @__PURE__ */ w(
|
|
290
290
|
"div",
|
|
291
291
|
{
|
|
@@ -337,9 +337,9 @@ const Bn = (e, o, a, c) => {
|
|
|
337
337
|
},
|
|
338
338
|
t.className
|
|
339
339
|
);
|
|
340
|
-
},
|
|
341
|
-
const t =
|
|
342
|
-
const i = C ?? 0, l = t >= 0 ?
|
|
340
|
+
}, cn = () => {
|
|
341
|
+
const t = _ ? -1 : v.findIndex((i) => i.prefix === "title1"), n = !_ && (s || (C ?? 0) > 0) ? (() => {
|
|
342
|
+
const i = C ?? 0, l = t >= 0 ? B[t] : Bt ?? 0;
|
|
343
343
|
return /* @__PURE__ */ f(
|
|
344
344
|
"div",
|
|
345
345
|
{
|
|
@@ -360,19 +360,19 @@ const Bn = (e, o, a, c) => {
|
|
|
360
360
|
);
|
|
361
361
|
})() : null, r = v.flatMap((i, l) => {
|
|
362
362
|
if (!i.marginLeftKey) return [];
|
|
363
|
-
const u = z[i.marginLeftKey] ?? 0, h =
|
|
363
|
+
const u = z[i.marginLeftKey] ?? 0, h = fr(
|
|
364
364
|
v,
|
|
365
|
-
|
|
365
|
+
B,
|
|
366
366
|
z,
|
|
367
367
|
l
|
|
368
|
-
) +
|
|
368
|
+
) + sn();
|
|
369
369
|
return /* @__PURE__ */ f(
|
|
370
370
|
"div",
|
|
371
371
|
{
|
|
372
372
|
"data-controls": i.marginLeftKey,
|
|
373
373
|
"data-controls-axis": "x",
|
|
374
374
|
"data-controls-min": "0",
|
|
375
|
-
"data-controls-max-fraction": String(
|
|
375
|
+
"data-controls-max-fraction": String(B[l]),
|
|
376
376
|
style: {
|
|
377
377
|
position: "absolute",
|
|
378
378
|
top: 0,
|
|
@@ -386,11 +386,11 @@ const Bn = (e, o, a, c) => {
|
|
|
386
386
|
);
|
|
387
387
|
});
|
|
388
388
|
return n ? [n, ...r] : r;
|
|
389
|
-
},
|
|
390
|
-
const r =
|
|
389
|
+
}, un = () => v.map((t, n) => {
|
|
390
|
+
const r = Et(
|
|
391
391
|
n,
|
|
392
|
-
|
|
393
|
-
), l =
|
|
392
|
+
B
|
|
393
|
+
), l = ln(n) - ut / 2;
|
|
394
394
|
return /* @__PURE__ */ f("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f(
|
|
395
395
|
"div",
|
|
396
396
|
{
|
|
@@ -409,9 +409,9 @@ const Bn = (e, o, a, c) => {
|
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
411
|
) }, `${t.widthKey}-junction`);
|
|
412
|
-
}),
|
|
412
|
+
}), fn = () => E.flatMap((t, n) => {
|
|
413
413
|
if (!t.marginLeftKey) return [];
|
|
414
|
-
const r = z[t.marginLeftKey] ?? 0, i =
|
|
414
|
+
const r = z[t.marginLeftKey] ?? 0, i = qt(n), { resolvedWidth: l } = Yt(t, "two-row-bottom");
|
|
415
415
|
return /* @__PURE__ */ f(
|
|
416
416
|
"div",
|
|
417
417
|
{
|
|
@@ -430,8 +430,8 @@ const Bn = (e, o, a, c) => {
|
|
|
430
430
|
},
|
|
431
431
|
t.marginLeftKey
|
|
432
432
|
);
|
|
433
|
-
}),
|
|
434
|
-
const { maxWidth: r } =
|
|
433
|
+
}), hn = () => E.map((t, n) => {
|
|
434
|
+
const { maxWidth: r } = Yt(t, "two-row-bottom"), l = an(n) - ut / 2;
|
|
435
435
|
return /* @__PURE__ */ f("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f(
|
|
436
436
|
"div",
|
|
437
437
|
{
|
|
@@ -450,32 +450,32 @@ const Bn = (e, o, a, c) => {
|
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
) }, `${t.widthKey}-junction`);
|
|
453
|
-
}),
|
|
453
|
+
}), dn = p(null), b = p(null), Zt = p(null), We = p(null), At = p([]), S = p([]), ot = p(0), Rt = p(null), x = p({
|
|
454
454
|
isActive: !1,
|
|
455
455
|
startX: 0,
|
|
456
456
|
scrollLeft: 0,
|
|
457
457
|
startActiveIndex: 0,
|
|
458
458
|
hasMoved: !1
|
|
459
|
-
}),
|
|
460
|
-
() => Array.from({ length:
|
|
461
|
-
[o,
|
|
462
|
-
), [
|
|
463
|
-
|
|
464
|
-
x.current.isActive ||
|
|
465
|
-
},
|
|
466
|
-
}, [
|
|
467
|
-
s ||
|
|
459
|
+
}), gt = p(null), it = p(null), Jt = p(0), Qt = p("forward"), G = p(0), V = p(null), U = p(!1), L = o.length > 1 && (!s || !!d), Pt = L ? 3 : 1, mn = O(
|
|
460
|
+
() => Array.from({ length: Pt }, () => o).flat(),
|
|
461
|
+
[o, Pt]
|
|
462
|
+
), [pn, Ae] = wt(!1), [Re, Me] = wt(!1), [gn, te] = wt(!0), Z = p(null), lt = p(null), ee = p(!1), Ce = p(!1), ne = p(null), J = p(null), Ne = mt && !gn, H = W(() => {
|
|
463
|
+
mt && (te(!0), J.current && clearTimeout(J.current), J.current = setTimeout(() => {
|
|
464
|
+
x.current.isActive || te(!1);
|
|
465
|
+
}, Zn));
|
|
466
|
+
}, [mt]), vt = W(() => {
|
|
467
|
+
s || Ce.current || (Ce.current = !0, Me(!1), ne.current = setTimeout(() => {
|
|
468
468
|
m();
|
|
469
|
-
},
|
|
470
|
-
}, [s, m]),
|
|
469
|
+
}, $t));
|
|
470
|
+
}, [s, m]), _e = () => /* @__PURE__ */ w(
|
|
471
471
|
"div",
|
|
472
472
|
{
|
|
473
473
|
className: `${e}-close-icon`,
|
|
474
|
-
"data-overlay-content-hidden":
|
|
474
|
+
"data-overlay-content-hidden": Ne ? "true" : "false",
|
|
475
475
|
style: {
|
|
476
|
-
width:
|
|
477
|
-
height:
|
|
478
|
-
marginRight:
|
|
476
|
+
width: _t(K ?? 0, c),
|
|
477
|
+
height: _t(K ?? 0, c),
|
|
478
|
+
marginRight: ye,
|
|
479
479
|
"--close-icon-hover-color": tt
|
|
480
480
|
},
|
|
481
481
|
children: [
|
|
@@ -484,14 +484,14 @@ const Bn = (e, o, a, c) => {
|
|
|
484
484
|
{
|
|
485
485
|
type: "button",
|
|
486
486
|
className: `${e}-close-icon-inner`,
|
|
487
|
-
onClick:
|
|
487
|
+
onClick: vt,
|
|
488
488
|
"aria-label": "Close",
|
|
489
489
|
children: /* @__PURE__ */ f(
|
|
490
|
-
|
|
490
|
+
Bn,
|
|
491
491
|
{
|
|
492
|
-
url:
|
|
493
|
-
fill:
|
|
494
|
-
hoverFill: c && !d ?
|
|
492
|
+
url: R,
|
|
493
|
+
fill: M,
|
|
494
|
+
hoverFill: c && !d ? M : tt,
|
|
495
495
|
className: `${e}-close-icon-img`
|
|
496
496
|
}
|
|
497
497
|
)
|
|
@@ -508,7 +508,7 @@ const Bn = (e, o, a, c) => {
|
|
|
508
508
|
position: "absolute",
|
|
509
509
|
top: 0,
|
|
510
510
|
left: "100%",
|
|
511
|
-
width:
|
|
511
|
+
width: ye,
|
|
512
512
|
height: "100%",
|
|
513
513
|
pointerEvents: "auto"
|
|
514
514
|
}
|
|
@@ -516,7 +516,7 @@ const Bn = (e, o, a, c) => {
|
|
|
516
516
|
)
|
|
517
517
|
]
|
|
518
518
|
}
|
|
519
|
-
),
|
|
519
|
+
), Oe = (t = "two-row") => /* @__PURE__ */ f(
|
|
520
520
|
"div",
|
|
521
521
|
{
|
|
522
522
|
...t === "two-row" && s ? {
|
|
@@ -530,20 +530,20 @@ const Bn = (e, o, a, c) => {
|
|
|
530
530
|
...t === "two-row" && s ? { pointerEvents: "auto" } : {}
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
),
|
|
534
|
-
const t = v.find((i) => i.prefix === "title1"), n = v.filter((i) => i.prefix === "title2" || i.prefix === "title3"), r = n.length > 0 || s || (
|
|
535
|
-
return /* @__PURE__ */ w(
|
|
533
|
+
), vn = () => {
|
|
534
|
+
const t = v.find((i) => i.prefix === "title1"), n = v.filter((i) => i.prefix === "title2" || i.prefix === "title3"), r = n.length > 0 || s || (ge ?? 0) > 0;
|
|
535
|
+
return /* @__PURE__ */ w(yt, { children: [
|
|
536
536
|
/* @__PURE__ */ w("div", { className: `${e}-header-row-top`, children: [
|
|
537
|
-
(C ?? 0) > 0 || s ?
|
|
538
|
-
t &&
|
|
539
|
-
|
|
537
|
+
(C ?? 0) > 0 || s ? Oe() : null,
|
|
538
|
+
t && Ut(t, "two-row-top"),
|
|
539
|
+
R && _e()
|
|
540
540
|
] }),
|
|
541
541
|
r ? /* @__PURE__ */ w("div", { className: `${e}-header-row-bottom-wrap`, children: [
|
|
542
542
|
n.length > 0 ? /* @__PURE__ */ w("div", { className: `${e}-header-row-bottom`, children: [
|
|
543
|
-
n.map((i) =>
|
|
544
|
-
s && /* @__PURE__ */ w(
|
|
545
|
-
|
|
546
|
-
|
|
543
|
+
n.map((i) => Ut(i, "two-row-bottom")),
|
|
544
|
+
s && /* @__PURE__ */ w(yt, { children: [
|
|
545
|
+
fn(),
|
|
546
|
+
hn()
|
|
547
547
|
] })
|
|
548
548
|
] }) : null,
|
|
549
549
|
/* @__PURE__ */ f(
|
|
@@ -554,7 +554,7 @@ const Bn = (e, o, a, c) => {
|
|
|
554
554
|
"data-controls-reverse": s ? "" : void 0,
|
|
555
555
|
className: s ? `${e}-control` : void 0,
|
|
556
556
|
style: {
|
|
557
|
-
height:
|
|
557
|
+
height: on,
|
|
558
558
|
width: "100%",
|
|
559
559
|
flexShrink: 0,
|
|
560
560
|
pointerEvents: s ? "auto" : "none"
|
|
@@ -563,377 +563,377 @@ const Bn = (e, o, a, c) => {
|
|
|
563
563
|
)
|
|
564
564
|
] }) : null
|
|
565
565
|
] });
|
|
566
|
-
},
|
|
567
|
-
(C ?? 0) > 0 || s ?
|
|
568
|
-
v.map((t) =>
|
|
569
|
-
s ? /* @__PURE__ */ w(
|
|
570
|
-
|
|
571
|
-
|
|
566
|
+
}, bn = () => /* @__PURE__ */ w(yt, { children: [
|
|
567
|
+
(C ?? 0) > 0 || s ? Oe("single-row") : null,
|
|
568
|
+
v.map((t) => Ut(t, "single-row")),
|
|
569
|
+
s ? /* @__PURE__ */ w(yt, { children: [
|
|
570
|
+
cn(),
|
|
571
|
+
un()
|
|
572
572
|
] }) : null,
|
|
573
|
-
|
|
574
|
-
] }),
|
|
575
|
-
isSwipeDragging:
|
|
576
|
-
backdropStyle:
|
|
577
|
-
mediaAreaStyle:
|
|
578
|
-
overlayContentStyle:
|
|
579
|
-
swipeHandlers:
|
|
580
|
-
dismissAreaStyle:
|
|
581
|
-
} =
|
|
582
|
-
enabled:
|
|
583
|
-
onClose:
|
|
584
|
-
animMs:
|
|
585
|
-
isBlockedTarget:
|
|
586
|
-
}),
|
|
587
|
-
if (!
|
|
573
|
+
R ? _e() : null
|
|
574
|
+
] }), re = W((t) => !!(t.closest("[data-controls]") || t.closest(`.${e}-thumbnails`) || t.closest(`.${e}-close-icon`)), [e]), {
|
|
575
|
+
isSwipeDragging: xn,
|
|
576
|
+
backdropStyle: yn,
|
|
577
|
+
mediaAreaStyle: wn,
|
|
578
|
+
overlayContentStyle: $n,
|
|
579
|
+
swipeHandlers: Sn,
|
|
580
|
+
dismissAreaStyle: Ln
|
|
581
|
+
} = Kn({
|
|
582
|
+
enabled: q ?? !1,
|
|
583
|
+
onClose: vt,
|
|
584
|
+
animMs: $t,
|
|
585
|
+
isBlockedTarget: re
|
|
586
|
+
}), oe = () => {
|
|
587
|
+
if (!L || o.length === 0)
|
|
588
588
|
return ot.current = 0, 0;
|
|
589
|
-
const t =
|
|
589
|
+
const t = S.current[0], n = S.current[o.length];
|
|
590
590
|
if (!t || !n) return ot.current;
|
|
591
591
|
const r = n.offsetLeft - t.offsetLeft;
|
|
592
592
|
return r > 0 && (ot.current = r), ot.current;
|
|
593
|
-
},
|
|
594
|
-
if (!
|
|
595
|
-
const n = b.current, r =
|
|
596
|
-
!n || r <= 0 || r < n.clientWidth * 0.25 || (n.scrollLeft <= 0 ? (n.scrollLeft += r, t && (x.current.scrollLeft += r),
|
|
597
|
-
},
|
|
598
|
-
if (!
|
|
593
|
+
}, Q = (t = !1) => {
|
|
594
|
+
if (!L) return;
|
|
595
|
+
const n = b.current, r = oe();
|
|
596
|
+
!n || r <= 0 || r < n.clientWidth * 0.25 || (n.scrollLeft <= 0 ? (n.scrollLeft += r, t && (x.current.scrollLeft += r), U.current && (G.current += r)) : n.scrollLeft >= r * 2 && (n.scrollLeft -= r, t && (x.current.scrollLeft -= r), U.current && (G.current -= r)));
|
|
597
|
+
}, ke = (t, n = ((r) => (r = b.current) == null ? void 0 : r.scrollLeft)() ?? 0) => {
|
|
598
|
+
if (!L) return t;
|
|
599
599
|
let i = o.length + t, l = 1 / 0;
|
|
600
|
-
for (let u = 0; u <
|
|
601
|
-
const h = u * o.length + t, g =
|
|
600
|
+
for (let u = 0; u < Pt; u++) {
|
|
601
|
+
const h = u * o.length + t, g = S.current[h];
|
|
602
602
|
if (!g) continue;
|
|
603
|
-
const
|
|
604
|
-
|
|
603
|
+
const T = Math.abs(g.offsetLeft - n);
|
|
604
|
+
T < l && (l = T, i = h);
|
|
605
605
|
}
|
|
606
606
|
return i;
|
|
607
|
-
},
|
|
607
|
+
}, Ee = (t) => {
|
|
608
608
|
const n = b.current;
|
|
609
609
|
return !t || !n ? !1 : t.offsetWidth > n.clientWidth + 1;
|
|
610
|
-
},
|
|
610
|
+
}, ie = (t) => {
|
|
611
611
|
const n = b.current;
|
|
612
|
-
if (!t || !n || !
|
|
612
|
+
if (!t || !n || !Ee(t)) return !1;
|
|
613
613
|
const r = t.offsetLeft, i = r + t.offsetWidth;
|
|
614
614
|
return n.scrollLeft >= r - 1 && n.scrollLeft + n.clientWidth <= i + 1;
|
|
615
615
|
}, st = (t = ((n) => (n = b.current) == null ? void 0 : n.scrollLeft)() ?? 0) => {
|
|
616
|
-
for (let i = 0; i <
|
|
617
|
-
const l =
|
|
618
|
-
if (l &&
|
|
616
|
+
for (let i = 0; i < S.current.length; i += 1) {
|
|
617
|
+
const l = S.current[i];
|
|
618
|
+
if (l && ie(l))
|
|
619
619
|
return i;
|
|
620
620
|
}
|
|
621
621
|
let r = { flatIndex: 0, distance: 1 / 0 };
|
|
622
|
-
return
|
|
622
|
+
return S.current.forEach((i, l) => {
|
|
623
623
|
if (!i) return;
|
|
624
624
|
const u = Math.abs(i.offsetLeft - t);
|
|
625
625
|
u < r.distance && (r = { flatIndex: l, distance: u });
|
|
626
626
|
}), r.flatIndex;
|
|
627
|
-
},
|
|
628
|
-
b.current &&
|
|
629
|
-
n && (n.style.scrollSnapAlign =
|
|
627
|
+
}, ze = (t) => {
|
|
628
|
+
b.current && S.current.forEach((n) => {
|
|
629
|
+
n && (n.style.scrollSnapAlign = Ee(n) && t === "backward" ? "end" : "start");
|
|
630
630
|
});
|
|
631
|
-
},
|
|
632
|
-
const i = t - n, l = st(n), u =
|
|
633
|
-
if (
|
|
631
|
+
}, Tn = (t, n, r) => {
|
|
632
|
+
const i = t - n, l = st(n), u = S.current[l];
|
|
633
|
+
if (ie(u))
|
|
634
634
|
return st(t) % o.length;
|
|
635
|
-
const h =
|
|
636
|
-
return
|
|
637
|
-
},
|
|
638
|
-
if (
|
|
639
|
-
const n =
|
|
635
|
+
const h = S.current[l + 1], g = u ? h ? h.offsetLeft - u.offsetLeft : u.offsetWidth : 0, T = g > 0 ? i > g * Ot ? 1 : i < -g * Ot ? -1 : 0 : 0;
|
|
636
|
+
return T === 0 ? r : L ? (r + T + o.length) % o.length : Math.max(0, Math.min(o.length - 1, r + T));
|
|
637
|
+
}, Fe = W((t = !1) => {
|
|
638
|
+
if (ht !== "on" || s) return;
|
|
639
|
+
const n = We.current, r = N.current, i = At.current[r];
|
|
640
640
|
if (!n || !i || n.scrollWidth <= n.clientWidth) return;
|
|
641
641
|
const l = n.scrollLeft, u = l + n.clientWidth, h = i.offsetLeft, g = h + i.offsetWidth;
|
|
642
642
|
if (h >= l && g <= u) return;
|
|
643
|
-
const
|
|
644
|
-
let
|
|
645
|
-
if (!t &&
|
|
646
|
-
const ct =
|
|
647
|
-
g > u ?
|
|
648
|
-
} else g > u ?
|
|
649
|
-
n.scrollLeft = Math.max(0, Math.min(
|
|
650
|
-
}, [s,
|
|
651
|
-
t && (
|
|
643
|
+
const T = n.scrollWidth - n.clientWidth;
|
|
644
|
+
let I = l;
|
|
645
|
+
if (!t && Z.current === null) {
|
|
646
|
+
const ct = At.current[r - 1], xt = At.current[r + 1], Nt = ct ? i.offsetLeft - ct.offsetLeft : xt ? xt.offsetLeft - i.offsetLeft : i.offsetWidth;
|
|
647
|
+
g > u ? I += Nt : h < l && (I -= Nt);
|
|
648
|
+
} else g > u ? I = g - n.clientWidth : I = h;
|
|
649
|
+
n.scrollLeft = Math.max(0, Math.min(T, I));
|
|
650
|
+
}, [s, ht]), le = W((t = !1) => {
|
|
651
|
+
t && (ee.current = !0), lt.current === null && (lt.current = requestAnimationFrame(() => {
|
|
652
652
|
lt.current = null;
|
|
653
|
-
const n =
|
|
654
|
-
|
|
653
|
+
const n = ee.current;
|
|
654
|
+
ee.current = !1, Fe(n);
|
|
655
655
|
}));
|
|
656
|
-
}, [
|
|
657
|
-
if (t ===
|
|
658
|
-
const n =
|
|
659
|
-
|
|
660
|
-
const r = Math.abs(t - n) > 1, i =
|
|
661
|
-
|
|
662
|
-
}, [o.length,
|
|
663
|
-
if (!b.current || o.length === 0 ||
|
|
656
|
+
}, [Fe]), In = W((t) => {
|
|
657
|
+
if (t === N.current) return;
|
|
658
|
+
const n = N.current;
|
|
659
|
+
N.current = t;
|
|
660
|
+
const r = Math.abs(t - n) > 1, i = L && o.length > 1 && (n === o.length - 1 && t === 0 || n === 0 && t === o.length - 1);
|
|
661
|
+
Xt(t), le(r || i);
|
|
662
|
+
}, [o.length, L, le]), D = () => {
|
|
663
|
+
if (!b.current || o.length === 0 || Z.current !== null || x.current.isActive && x.current.hasMoved) return;
|
|
664
664
|
const t = b.current.scrollLeft, n = st(t) % o.length;
|
|
665
|
-
n !==
|
|
666
|
-
},
|
|
667
|
-
|
|
668
|
-
},
|
|
665
|
+
n !== N.current && In(n);
|
|
666
|
+
}, Wn = () => {
|
|
667
|
+
Z.current = null;
|
|
668
|
+
}, Y = (t) => {
|
|
669
669
|
const n = b.current;
|
|
670
670
|
n && (n.style.scrollSnapType = t ? "" : "none");
|
|
671
|
-
},
|
|
671
|
+
}, bt = () => {
|
|
672
672
|
var t;
|
|
673
673
|
(t = it.current) == null || t.call(it), it.current = null;
|
|
674
|
-
},
|
|
675
|
-
|
|
676
|
-
},
|
|
674
|
+
}, Mt = () => {
|
|
675
|
+
V.current !== null && (cancelAnimationFrame(V.current), V.current = null), U.current = !1;
|
|
676
|
+
}, Ke = () => {
|
|
677
677
|
const t = b.current;
|
|
678
678
|
if (!t) {
|
|
679
|
-
|
|
679
|
+
V.current = null, U.current = !1;
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
682
|
const n = G.current - t.scrollLeft;
|
|
683
683
|
if (Math.abs(n) < 0.5) {
|
|
684
|
-
t.scrollLeft = G.current,
|
|
684
|
+
t.scrollLeft = G.current, Q(), D(), V.current = null, U.current = !1;
|
|
685
685
|
return;
|
|
686
686
|
}
|
|
687
|
-
t.scrollLeft += n *
|
|
688
|
-
},
|
|
689
|
-
const t =
|
|
687
|
+
t.scrollLeft += n * Pn, Q(), D(), H(), V.current = requestAnimationFrame(Ke);
|
|
688
|
+
}, Be = () => {
|
|
689
|
+
const t = Zt.current;
|
|
690
690
|
t && (t.style.transition = "", t.style.transform = "", t.style.willChange = "");
|
|
691
|
-
},
|
|
692
|
-
|
|
693
|
-
},
|
|
694
|
-
const l = b.current, u =
|
|
691
|
+
}, He = (t, n, r, i) => {
|
|
692
|
+
Be(), t.scrollLeft = n, Jt.current = t.scrollLeft, Q(), r !== void 0 ? (N.current = r, Xt(r)) : D(), Y(!0), i == null || i();
|
|
693
|
+
}, De = (t, { behavior: n = "smooth", activeIndex: r, onComplete: i } = {}) => {
|
|
694
|
+
const l = b.current, u = Zt.current;
|
|
695
695
|
if (!l || !u) return;
|
|
696
|
-
if (
|
|
697
|
-
|
|
696
|
+
if (Mt(), bt(), Y(!1), n === "auto") {
|
|
697
|
+
He(l, t, r, i);
|
|
698
698
|
return;
|
|
699
699
|
}
|
|
700
|
-
const h = Math.abs(t - l.scrollLeft), g =
|
|
700
|
+
const h = Math.abs(t - l.scrollLeft), g = Xn(
|
|
701
701
|
h,
|
|
702
|
-
|
|
703
|
-
|
|
702
|
+
Yn,
|
|
703
|
+
qn,
|
|
704
704
|
l.clientWidth * 0.55
|
|
705
705
|
);
|
|
706
|
-
it.current =
|
|
706
|
+
it.current = Vn(l, u, t, {
|
|
707
707
|
duration: g,
|
|
708
|
-
easing:
|
|
708
|
+
easing: Un,
|
|
709
709
|
onComplete: () => {
|
|
710
|
-
it.current = null,
|
|
710
|
+
it.current = null, He(l, t, r, i);
|
|
711
711
|
}
|
|
712
712
|
});
|
|
713
|
-
},
|
|
713
|
+
}, An = (t = "smooth") => {
|
|
714
714
|
const n = b.current;
|
|
715
715
|
if (!n || o.length === 0) return;
|
|
716
|
-
const r = st() % o.length, i =
|
|
717
|
-
l &&
|
|
718
|
-
},
|
|
716
|
+
const r = st() % o.length, i = ke(r, n.scrollLeft), l = S.current[i];
|
|
717
|
+
l && De(l.offsetLeft, { behavior: t, activeIndex: r });
|
|
718
|
+
}, Rn = (t, n = "smooth", r, i) => {
|
|
719
719
|
const l = b.current;
|
|
720
720
|
if (!l || o.length === 0) return;
|
|
721
|
-
const u = (i ?? l.scrollLeft) - t, h = st(t), g =
|
|
722
|
-
if (
|
|
723
|
-
|
|
721
|
+
const u = (i ?? l.scrollLeft) - t, h = st(t), g = S.current[h];
|
|
722
|
+
if (ie(g)) {
|
|
723
|
+
Y(!0), D();
|
|
724
724
|
return;
|
|
725
725
|
}
|
|
726
|
-
const
|
|
727
|
-
if ((
|
|
728
|
-
const
|
|
726
|
+
const T = S.current[h + 1], I = g ? T ? T.offsetLeft - g.offsetLeft : g.offsetWidth : 0;
|
|
727
|
+
if ((I > 0 ? u > I * Ot ? 1 : u < -I * Ot ? -1 : 0 : 0) !== 0) {
|
|
728
|
+
const kn = r ?? h % o.length, En = Tn(
|
|
729
729
|
i ?? l.scrollLeft,
|
|
730
730
|
t,
|
|
731
|
-
|
|
731
|
+
kn
|
|
732
732
|
);
|
|
733
|
-
at(
|
|
733
|
+
at(En, n);
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
|
-
const
|
|
737
|
-
if (
|
|
738
|
-
|
|
736
|
+
const xt = i ?? l.scrollLeft, Nt = st(xt), je = S.current[Nt];
|
|
737
|
+
if (je && Math.abs(je.offsetLeft - xt) < 1) {
|
|
738
|
+
Y(!0), D();
|
|
739
739
|
return;
|
|
740
740
|
}
|
|
741
|
-
|
|
741
|
+
An("auto");
|
|
742
742
|
}, at = (t, n = "smooth") => {
|
|
743
743
|
const r = b.current;
|
|
744
744
|
if (!r || o.length === 0) return;
|
|
745
|
-
const i =
|
|
746
|
-
l && (n === "smooth" ?
|
|
745
|
+
const i = ke(t, r.scrollLeft), l = S.current[i];
|
|
746
|
+
l && (n === "smooth" ? Z.current = t : Z.current = null, N.current = t, Xt(t), le(!0), De(l.offsetLeft, {
|
|
747
747
|
behavior: n,
|
|
748
748
|
activeIndex: t,
|
|
749
|
-
onComplete: n === "smooth" ?
|
|
749
|
+
onComplete: n === "smooth" ? Wn : void 0
|
|
750
750
|
}));
|
|
751
|
-
},
|
|
752
|
-
|
|
753
|
-
},
|
|
754
|
-
const u = r - t, h = i - n, g = Math.abs(u),
|
|
755
|
-
if (g <
|
|
756
|
-
const
|
|
751
|
+
}, se = () => {
|
|
752
|
+
gt.current && (window.removeEventListener("pointerup", gt.current), window.removeEventListener("pointercancel", gt.current), gt.current = null);
|
|
753
|
+
}, Mn = (t, n, r, i, l) => {
|
|
754
|
+
const u = r - t, h = i - n, g = Math.abs(u), T = Math.abs(h);
|
|
755
|
+
if (g < er || g <= T) return !1;
|
|
756
|
+
const I = u < 0 ? 1 : -1, ct = L ? (l + I + o.length) % o.length : Math.max(0, Math.min(o.length - 1, l + I));
|
|
757
757
|
return ct === l ? !1 : (at(ct), !0);
|
|
758
|
-
},
|
|
758
|
+
}, Ct = (t) => {
|
|
759
759
|
if (!x.current.isActive) return;
|
|
760
|
-
|
|
760
|
+
se();
|
|
761
761
|
const n = b.current;
|
|
762
762
|
if (!n) return;
|
|
763
763
|
const { scrollLeft: r, startActiveIndex: i, hasMoved: l } = x.current, u = n.scrollLeft;
|
|
764
|
-
|
|
764
|
+
Q(!0), x.current = {
|
|
765
765
|
isActive: !1,
|
|
766
766
|
startX: 0,
|
|
767
767
|
scrollLeft: 0,
|
|
768
768
|
startActiveIndex: 0,
|
|
769
769
|
hasMoved: !1
|
|
770
|
-
},
|
|
771
|
-
},
|
|
772
|
-
const r =
|
|
773
|
-
|
|
770
|
+
}, Ae(!1), t !== void 0 && n.hasPointerCapture(t) && n.releasePointerCapture(t), l ? Rn(r, "smooth", i, u) : (Y(!0), D()), H();
|
|
771
|
+
}, Cn = (t, n) => {
|
|
772
|
+
const r = Rt.current;
|
|
773
|
+
Rt.current = null, r && (Mn(
|
|
774
774
|
r.startX,
|
|
775
775
|
r.startY,
|
|
776
776
|
t,
|
|
777
777
|
n,
|
|
778
778
|
r.startActiveIndex
|
|
779
|
-
),
|
|
780
|
-
},
|
|
781
|
-
if (!
|
|
779
|
+
), H());
|
|
780
|
+
}, Nn = (t) => {
|
|
781
|
+
if (!pt) return;
|
|
782
782
|
if (t.pointerType === "touch") {
|
|
783
|
-
if (
|
|
784
|
-
|
|
783
|
+
if (Mt(), Y(!0), re(t.target)) return;
|
|
784
|
+
Rt.current = {
|
|
785
785
|
startX: t.clientX,
|
|
786
786
|
startY: t.clientY,
|
|
787
|
-
startActiveIndex:
|
|
787
|
+
startActiveIndex: N.current
|
|
788
788
|
};
|
|
789
789
|
return;
|
|
790
790
|
}
|
|
791
|
-
if (t.pointerType !== "mouse" || t.button !== 0 ||
|
|
791
|
+
if (t.pointerType !== "mouse" || t.button !== 0 || re(t.target)) return;
|
|
792
792
|
const n = b.current;
|
|
793
793
|
if (!n) return;
|
|
794
|
-
|
|
794
|
+
Mt(), bt(), Be(), Z.current = null, x.current = {
|
|
795
795
|
isActive: !0,
|
|
796
796
|
startX: t.clientX,
|
|
797
797
|
scrollLeft: n.scrollLeft,
|
|
798
|
-
startActiveIndex:
|
|
798
|
+
startActiveIndex: N.current,
|
|
799
799
|
hasMoved: !1
|
|
800
|
-
},
|
|
800
|
+
}, Y(!1), H(), n.setPointerCapture(t.pointerId), se();
|
|
801
801
|
const r = (i) => {
|
|
802
|
-
i.pointerType === "mouse" &&
|
|
802
|
+
i.pointerType === "mouse" && Ct(i.pointerId);
|
|
803
803
|
};
|
|
804
|
-
|
|
805
|
-
},
|
|
806
|
-
if (!
|
|
804
|
+
gt.current = r, window.addEventListener("pointerup", r), window.addEventListener("pointercancel", r);
|
|
805
|
+
}, _n = (t) => {
|
|
806
|
+
if (!pt || t.pointerType !== "mouse") return;
|
|
807
807
|
const n = b.current;
|
|
808
808
|
if (!n || !x.current.isActive) return;
|
|
809
809
|
if (t.buttons === 0) {
|
|
810
|
-
|
|
810
|
+
Ct(t.pointerId);
|
|
811
811
|
return;
|
|
812
812
|
}
|
|
813
813
|
const r = t.clientX - x.current.startX;
|
|
814
|
-
Math.abs(r) >
|
|
815
|
-
},
|
|
816
|
-
if (
|
|
814
|
+
Math.abs(r) > tr && (x.current.hasMoved = !0, Ae(!0)), x.current.hasMoved && (t.preventDefault(), n.scrollLeft = x.current.scrollLeft - r, Q(!0), D(), H());
|
|
815
|
+
}, Xe = (t) => {
|
|
816
|
+
if (pt) {
|
|
817
817
|
if (t.pointerType === "touch") {
|
|
818
|
-
t.type === "pointerup" ?
|
|
818
|
+
t.type === "pointerup" ? Cn(t.clientX, t.clientY) : Rt.current = null;
|
|
819
819
|
return;
|
|
820
820
|
}
|
|
821
|
-
t.pointerType === "mouse" &&
|
|
821
|
+
t.pointerType === "mouse" && Ct(t.pointerId);
|
|
822
822
|
}
|
|
823
|
-
},
|
|
824
|
-
!
|
|
823
|
+
}, On = (t) => {
|
|
824
|
+
!pt || t.pointerType !== "mouse" || Ct(t.pointerId);
|
|
825
825
|
};
|
|
826
|
-
return
|
|
827
|
-
const t = requestAnimationFrame(() =>
|
|
826
|
+
return Hn(), ft(() => {
|
|
827
|
+
const t = requestAnimationFrame(() => Me(!0));
|
|
828
828
|
return () => {
|
|
829
|
-
cancelAnimationFrame(t),
|
|
829
|
+
cancelAnimationFrame(t), bt(), se(), lt.current !== null && (cancelAnimationFrame(lt.current), lt.current = null), ne.current && clearTimeout(ne.current), J.current && clearTimeout(J.current);
|
|
830
830
|
};
|
|
831
831
|
}, []), ft(() => {
|
|
832
|
-
if (!
|
|
833
|
-
|
|
832
|
+
if (!mt) {
|
|
833
|
+
te(!0);
|
|
834
834
|
return;
|
|
835
835
|
}
|
|
836
|
-
|
|
837
|
-
const t = () =>
|
|
836
|
+
H();
|
|
837
|
+
const t = () => H();
|
|
838
838
|
return document.addEventListener("pointermove", t, { passive: !0 }), document.addEventListener("pointerdown", t, { passive: !0 }), () => {
|
|
839
|
-
document.removeEventListener("pointermove", t), document.removeEventListener("pointerdown", t),
|
|
839
|
+
document.removeEventListener("pointermove", t), document.removeEventListener("pointerdown", t), J.current && clearTimeout(J.current);
|
|
840
840
|
};
|
|
841
|
-
}, [
|
|
841
|
+
}, [mt, H]), ft(() => {
|
|
842
842
|
const t = (n) => {
|
|
843
|
-
n.key === "Escape" &&
|
|
843
|
+
n.key === "Escape" && vt();
|
|
844
844
|
};
|
|
845
845
|
return window.addEventListener("keydown", t), () => window.removeEventListener("keydown", t);
|
|
846
|
-
}, [
|
|
847
|
-
|
|
848
|
-
}, [
|
|
849
|
-
s || at(
|
|
850
|
-
}, [
|
|
846
|
+
}, [vt]), ae(() => {
|
|
847
|
+
oe();
|
|
848
|
+
}, [dt, o.length, L]), ae(() => {
|
|
849
|
+
s || at(N.current, "auto");
|
|
850
|
+
}, [dt, s]), ae(() => {
|
|
851
851
|
at(0, "auto");
|
|
852
|
-
}, [o.length,
|
|
852
|
+
}, [o.length, L]), ft(() => {
|
|
853
853
|
const t = b.current;
|
|
854
|
-
if (!t || s || !
|
|
854
|
+
if (!t || s || !q) return;
|
|
855
855
|
const n = (r) => {
|
|
856
856
|
if (r.preventDefault(), Math.abs(r.deltaY) <= Math.abs(r.deltaX)) return;
|
|
857
|
-
const i = r.deltaMode === 1 ?
|
|
857
|
+
const i = r.deltaMode === 1 ? Qn : r.deltaMode === 2 ? t.clientHeight : 1, l = r.deltaY * i * Jn;
|
|
858
858
|
if (l !== 0) {
|
|
859
|
-
if (
|
|
859
|
+
if (bt(), U.current || (U.current = !0, G.current = t.scrollLeft, Z.current = null, Y(!1)), G.current += l, !L) {
|
|
860
860
|
const u = t.scrollWidth - t.clientWidth;
|
|
861
861
|
G.current = Math.max(0, Math.min(u, G.current));
|
|
862
862
|
}
|
|
863
|
-
|
|
863
|
+
H(), V.current === null && (V.current = requestAnimationFrame(Ke));
|
|
864
864
|
}
|
|
865
865
|
};
|
|
866
866
|
return t.addEventListener("wheel", n, { passive: !1 }), () => {
|
|
867
|
-
t.removeEventListener("wheel", n),
|
|
867
|
+
t.removeEventListener("wheel", n), Mt();
|
|
868
868
|
};
|
|
869
|
-
}, [s,
|
|
869
|
+
}, [s, q, L]), ft(() => {
|
|
870
870
|
const t = b.current;
|
|
871
871
|
if (!t) return;
|
|
872
872
|
const n = () => {
|
|
873
|
-
|
|
874
|
-
const i = t.scrollLeft, l = i -
|
|
875
|
-
|
|
873
|
+
Q(x.current.isActive);
|
|
874
|
+
const i = t.scrollLeft, l = i - Jt.current;
|
|
875
|
+
Jt.current = i;
|
|
876
876
|
const u = ot.current > 0 ? ot.current * 0.5 : 1 / 0;
|
|
877
877
|
if (l !== 0 && Math.abs(l) < u) {
|
|
878
878
|
const h = l > 0 ? "forward" : "backward";
|
|
879
|
-
h !==
|
|
879
|
+
h !== Qt.current && (Qt.current = h, ze(h));
|
|
880
880
|
}
|
|
881
|
-
x.current.isActive && x.current.hasMoved ||
|
|
881
|
+
x.current.isActive && x.current.hasMoved || D();
|
|
882
882
|
};
|
|
883
883
|
t.addEventListener("scroll", n, { passive: !0 });
|
|
884
884
|
const r = new ResizeObserver(() => {
|
|
885
|
-
|
|
885
|
+
oe(), Q(x.current.isActive), ze(Qt.current), D();
|
|
886
886
|
});
|
|
887
887
|
return r.observe(t), () => {
|
|
888
|
-
|
|
888
|
+
bt(), t.removeEventListener("scroll", n), r.disconnect();
|
|
889
889
|
};
|
|
890
|
-
}, [o.length,
|
|
890
|
+
}, [o.length, L]), /* @__PURE__ */ w(
|
|
891
891
|
"div",
|
|
892
892
|
{
|
|
893
893
|
"data-selection": "none",
|
|
894
894
|
className: `${e}-lightbox${c ? ` ${e}-lightbox-editor` : ""}${s ? ` ${e}-lightbox-edit-mode` : ""}`,
|
|
895
895
|
onClick: () => {
|
|
896
|
-
|
|
896
|
+
xn || vt();
|
|
897
897
|
},
|
|
898
898
|
role: "dialog",
|
|
899
899
|
"aria-modal": "true",
|
|
900
900
|
"aria-label": "Image gallery",
|
|
901
901
|
style: {
|
|
902
|
-
opacity:
|
|
903
|
-
transition: `opacity ${
|
|
904
|
-
pointerEvents:
|
|
902
|
+
opacity: Re ? 1 : 0,
|
|
903
|
+
transition: `opacity ${$t}ms ease`,
|
|
904
|
+
pointerEvents: Re ? "auto" : "none"
|
|
905
905
|
},
|
|
906
906
|
children: [
|
|
907
|
-
/* @__PURE__ */ f("div", { className: `${e}-lightbox-backdrop`, style: { backgroundColor:
|
|
907
|
+
/* @__PURE__ */ f("div", { className: `${e}-lightbox-backdrop`, style: { backgroundColor: $, ...yn } }),
|
|
908
908
|
/* @__PURE__ */ w(
|
|
909
909
|
"div",
|
|
910
910
|
{
|
|
911
|
-
ref:
|
|
911
|
+
ref: dn,
|
|
912
912
|
className: `${e}-lightbox-dismiss-area`,
|
|
913
|
-
style:
|
|
914
|
-
...
|
|
913
|
+
style: Ln,
|
|
914
|
+
...Sn,
|
|
915
915
|
children: [
|
|
916
|
-
/* @__PURE__ */ f("div", { className: `${e}-lightbox-content`, style:
|
|
916
|
+
/* @__PURE__ */ f("div", { className: `${e}-lightbox-content`, style: wn, onClick: (t) => t.stopPropagation(), children: /* @__PURE__ */ f(
|
|
917
917
|
"div",
|
|
918
918
|
{
|
|
919
919
|
ref: b,
|
|
920
920
|
className: `${e}-lightbox-strip`,
|
|
921
921
|
"data-lightbox-scrollable": "",
|
|
922
|
-
"data-mouse-draggable":
|
|
923
|
-
"data-mouse-dragging":
|
|
924
|
-
onPointerDown:
|
|
925
|
-
onPointerMove:
|
|
926
|
-
onPointerUp:
|
|
927
|
-
onPointerCancel:
|
|
928
|
-
onLostPointerCapture:
|
|
929
|
-
children: /* @__PURE__ */ f("div", { ref:
|
|
930
|
-
const r = t.image.objectFit ?? "contain", i = n % o.length, l = Math.floor(n / o.length), u =
|
|
922
|
+
"data-mouse-draggable": pt && o.length > 0 ? "true" : "false",
|
|
923
|
+
"data-mouse-dragging": pn ? "true" : "false",
|
|
924
|
+
onPointerDown: Nn,
|
|
925
|
+
onPointerMove: _n,
|
|
926
|
+
onPointerUp: Xe,
|
|
927
|
+
onPointerCancel: Xe,
|
|
928
|
+
onLostPointerCapture: On,
|
|
929
|
+
children: /* @__PURE__ */ f("div", { ref: Zt, className: `${e}-lightbox-strip-track`, style: { gap: dt }, children: mn.map((t, n) => {
|
|
930
|
+
const r = t.image.objectFit ?? "contain", i = n % o.length, l = Math.floor(n / o.length), u = kt(dt), h = `calc(-0.5 * (${u} + ${dt}))`;
|
|
931
931
|
return /* @__PURE__ */ w(
|
|
932
932
|
"div",
|
|
933
933
|
{
|
|
934
|
-
ref: (g) =>
|
|
934
|
+
ref: (g) => S.current[n] = g,
|
|
935
935
|
className: `${e}-strip-item`,
|
|
936
|
-
style: { height:
|
|
936
|
+
style: { height: ve === "mobile" ? "calc(0.75 * var(--cntrl-viewport-height, 100vh))" : "100%" },
|
|
937
937
|
children: [
|
|
938
938
|
/* @__PURE__ */ f(
|
|
939
939
|
"img",
|
|
@@ -975,8 +975,8 @@ const Bn = (e, o, a, c) => {
|
|
|
975
975
|
"div",
|
|
976
976
|
{
|
|
977
977
|
className: `${e}-lightbox-content-inner`,
|
|
978
|
-
"data-overlay-content-hidden":
|
|
979
|
-
style:
|
|
978
|
+
"data-overlay-content-hidden": Ne ? "true" : "false",
|
|
979
|
+
style: $n,
|
|
980
980
|
children: [
|
|
981
981
|
/* @__PURE__ */ f(
|
|
982
982
|
"div",
|
|
@@ -984,7 +984,7 @@ const Bn = (e, o, a, c) => {
|
|
|
984
984
|
style: {
|
|
985
985
|
position: "relative",
|
|
986
986
|
width: "100%",
|
|
987
|
-
height:
|
|
987
|
+
height: xe,
|
|
988
988
|
flexShrink: 0,
|
|
989
989
|
pointerEvents: "none"
|
|
990
990
|
},
|
|
@@ -999,7 +999,7 @@ const Bn = (e, o, a, c) => {
|
|
|
999
999
|
left: 0,
|
|
1000
1000
|
right: 0,
|
|
1001
1001
|
top: 0,
|
|
1002
|
-
height:
|
|
1002
|
+
height: tn,
|
|
1003
1003
|
pointerEvents: "auto",
|
|
1004
1004
|
zIndex: 3
|
|
1005
1005
|
}
|
|
@@ -1007,21 +1007,21 @@ const Bn = (e, o, a, c) => {
|
|
|
1007
1007
|
)
|
|
1008
1008
|
}
|
|
1009
1009
|
),
|
|
1010
|
-
/* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "row", width: "100%", flex: 1, minHeight: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f("div", { className: `${e}-lightbox-content-area${
|
|
1010
|
+
/* @__PURE__ */ f("div", { style: { display: "flex", flexDirection: "row", width: "100%", flex: 1, minHeight: 0, pointerEvents: "none" }, children: /* @__PURE__ */ f("div", { className: `${e}-lightbox-content-area${_ ? ` ${e}-lightbox-content-area-stacked` : ""}`, children: (Te || R) && /* @__PURE__ */ f("div", { className: `${e}-header ${_ ? `${e}-header-two-row` : `${e}-header-single-row`}`, children: _ ? vn() : Te || R ? bn() : null }) }) })
|
|
1011
1011
|
]
|
|
1012
1012
|
}
|
|
1013
1013
|
),
|
|
1014
|
-
o.length > 1 &&
|
|
1015
|
-
const t =
|
|
1014
|
+
o.length > 1 && ht === "on" && (() => {
|
|
1015
|
+
const t = kt(Dt), n = `calc(-0.5 * (${Dt} + ${t}))`;
|
|
1016
1016
|
return /* @__PURE__ */ f(
|
|
1017
1017
|
"div",
|
|
1018
1018
|
{
|
|
1019
1019
|
className: `${e}-thumbnails-wrap`,
|
|
1020
|
-
style: { bottom:
|
|
1020
|
+
style: { bottom: Dt },
|
|
1021
1021
|
children: /* @__PURE__ */ f(
|
|
1022
1022
|
"div",
|
|
1023
1023
|
{
|
|
1024
|
-
ref:
|
|
1024
|
+
ref: We,
|
|
1025
1025
|
className: `${e}-thumbnails`,
|
|
1026
1026
|
"data-lightbox-scrollable": "",
|
|
1027
1027
|
onClick: (r) => r.stopPropagation(),
|
|
@@ -1029,19 +1029,19 @@ const Bn = (e, o, a, c) => {
|
|
|
1029
1029
|
"div",
|
|
1030
1030
|
{
|
|
1031
1031
|
className: `${e}-thumbnails-track`,
|
|
1032
|
-
"data-thumbnail-active":
|
|
1032
|
+
"data-thumbnail-active": Ue,
|
|
1033
1033
|
style: {
|
|
1034
|
-
gap:
|
|
1035
|
-
"--thumbnail-active-color":
|
|
1034
|
+
gap: Ht,
|
|
1035
|
+
"--thumbnail-active-color": Ze
|
|
1036
1036
|
},
|
|
1037
1037
|
children: [
|
|
1038
1038
|
o.map((r, i) => {
|
|
1039
|
-
const l =
|
|
1039
|
+
const l = kt(Ht), u = `calc(-0.5 * (${l} + ${Ht}))`;
|
|
1040
1040
|
return /* @__PURE__ */ w(
|
|
1041
1041
|
"div",
|
|
1042
1042
|
{
|
|
1043
1043
|
ref: (h) => {
|
|
1044
|
-
|
|
1044
|
+
At.current[i] = h;
|
|
1045
1045
|
},
|
|
1046
1046
|
style: { position: "relative", flex: "0 0 auto" },
|
|
1047
1047
|
children: [
|
|
@@ -1051,24 +1051,24 @@ const Bn = (e, o, a, c) => {
|
|
|
1051
1051
|
type: "button",
|
|
1052
1052
|
className: `${e}-thumb`,
|
|
1053
1053
|
"data-active": nt === i ? "true" : "false",
|
|
1054
|
-
onClick: () =>
|
|
1055
|
-
onMouseEnter: () =>
|
|
1054
|
+
onClick: () => q && St === "click" && at(i),
|
|
1055
|
+
onMouseEnter: () => nn && St === "hover" && at(i),
|
|
1056
1056
|
"aria-label": r.image.name ? `View ${r.image.name}` : `View image ${i + 1}`,
|
|
1057
1057
|
"aria-current": nt === i ? "true" : void 0,
|
|
1058
1058
|
children: /* @__PURE__ */ f(
|
|
1059
1059
|
"img",
|
|
1060
1060
|
{
|
|
1061
|
-
className: `${e}-thumb-image${
|
|
1061
|
+
className: `${e}-thumb-image${Le ? ` ${e}-thumb-image-cover` : ""}`,
|
|
1062
1062
|
src: r.image.assetId,
|
|
1063
1063
|
alt: "",
|
|
1064
1064
|
draggable: !1,
|
|
1065
1065
|
style: {
|
|
1066
|
-
...
|
|
1067
|
-
maxWidth:
|
|
1068
|
-
maxHeight:
|
|
1069
|
-
width:
|
|
1066
|
+
...rn,
|
|
1067
|
+
maxWidth: be,
|
|
1068
|
+
maxHeight: be,
|
|
1069
|
+
width: Lt.display === "cover" ? "auto" : "100%",
|
|
1070
1070
|
height: "auto",
|
|
1071
|
-
objectFit:
|
|
1071
|
+
objectFit: Lt.display === "cover" ? "cover" : "contain"
|
|
1072
1072
|
}
|
|
1073
1073
|
}
|
|
1074
1074
|
)
|
|
@@ -1126,8 +1126,8 @@ const Bn = (e, o, a, c) => {
|
|
|
1126
1126
|
]
|
|
1127
1127
|
}
|
|
1128
1128
|
);
|
|
1129
|
-
}
|
|
1130
|
-
function
|
|
1129
|
+
}, zt = 400, Ft = "cubic-bezier(0.25, 0.1, 0.25, 1)", qe = 1.1, dr = `${((1 - 1 / qe) / 2 * 100).toFixed(4)}%`;
|
|
1130
|
+
function mr(e) {
|
|
1131
1131
|
return `
|
|
1132
1132
|
.${e}-wrapper {
|
|
1133
1133
|
position: relative;
|
|
@@ -1173,6 +1173,32 @@ function ur(e) {
|
|
|
1173
1173
|
max-width: 100%;
|
|
1174
1174
|
}
|
|
1175
1175
|
|
|
1176
|
+
.${e}-hover-zoom-in .${e}-cover-image {
|
|
1177
|
+
clip-path: inset(0);
|
|
1178
|
+
transition: transform ${zt}ms ${Ft}, clip-path ${zt}ms ${Ft};
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
.${e}-hover-scale-down .${e}-cover-image {
|
|
1182
|
+
transition: transform ${zt}ms ${Ft};
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
.${e}-hover-greyscale .${e}-cover-image {
|
|
1186
|
+
transition: filter ${zt}ms ${Ft};
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
@media (hover: hover) {
|
|
1190
|
+
.${e}-hover-zoom-in .${e}-cover:hover .${e}-cover-image {
|
|
1191
|
+
transform: scale(${qe});
|
|
1192
|
+
clip-path: inset(${dr});
|
|
1193
|
+
}
|
|
1194
|
+
.${e}-hover-scale-down .${e}-cover:hover .${e}-cover-image {
|
|
1195
|
+
transform: scale(0.9);
|
|
1196
|
+
}
|
|
1197
|
+
.${e}-hover-greyscale .${e}-cover:hover .${e}-cover-image {
|
|
1198
|
+
filter: grayscale(1);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1176
1202
|
.${e}-lightbox {
|
|
1177
1203
|
position: fixed;
|
|
1178
1204
|
inset: 0;
|
|
@@ -1359,7 +1385,7 @@ function ur(e) {
|
|
|
1359
1385
|
background-color: transparent;
|
|
1360
1386
|
padding: 0;
|
|
1361
1387
|
opacity: 1;
|
|
1362
|
-
transition: opacity ${
|
|
1388
|
+
transition: opacity ${$t}ms ease;
|
|
1363
1389
|
}
|
|
1364
1390
|
|
|
1365
1391
|
.${e}-close-icon[data-overlay-content-hidden="true"] {
|
|
@@ -1472,7 +1498,7 @@ function ur(e) {
|
|
|
1472
1498
|
display: flex;
|
|
1473
1499
|
flex-direction: column;
|
|
1474
1500
|
opacity: 1;
|
|
1475
|
-
transition: opacity ${
|
|
1501
|
+
transition: opacity ${$t}ms ease;
|
|
1476
1502
|
}
|
|
1477
1503
|
|
|
1478
1504
|
.${e}-lightbox-content-inner[data-overlay-content-hidden="true"] {
|
|
@@ -1515,60 +1541,60 @@ function ur(e) {
|
|
|
1515
1541
|
}
|
|
1516
1542
|
`;
|
|
1517
1543
|
}
|
|
1518
|
-
const
|
|
1519
|
-
const { prefix: m } =
|
|
1520
|
-
|
|
1544
|
+
const Tr = ({ settings: e, content: o, isEditor: a, isEditMode: c, isPreviewMode: s, portalId: d }) => {
|
|
1545
|
+
const { prefix: m } = Fn(), { cover: $, coverFit: A, hover: F = "none" } = e, k = F !== "none" && (!a || s) ? ` ${m}-hover-${F}` : "", P = p(null), [R, K] = wt(!1), M = o ?? [], tt = R && M.length > 0, St = () => {
|
|
1546
|
+
M.length !== 0 && K(!0);
|
|
1521
1547
|
};
|
|
1522
1548
|
return ft(() => {
|
|
1523
|
-
!a || c || s ||
|
|
1524
|
-
}, [a, c, s]), /* @__PURE__ */ w(
|
|
1525
|
-
/* @__PURE__ */ w("div", { ref:
|
|
1526
|
-
/* @__PURE__ */ f("style", { dangerouslySetInnerHTML: { __html:
|
|
1527
|
-
|
|
1549
|
+
!a || c || s || K(!1);
|
|
1550
|
+
}, [a, c, s]), /* @__PURE__ */ w(yt, { children: [
|
|
1551
|
+
/* @__PURE__ */ w("div", { ref: P, className: `${m}-wrapper${k}`, children: [
|
|
1552
|
+
/* @__PURE__ */ f("style", { dangerouslySetInnerHTML: { __html: mr(m) } }),
|
|
1553
|
+
$ && /* @__PURE__ */ f(
|
|
1528
1554
|
"div",
|
|
1529
1555
|
{
|
|
1530
|
-
className: `${m}-cover ${
|
|
1531
|
-
onClick: () =>
|
|
1532
|
-
style: { ...
|
|
1556
|
+
className: `${m}-cover ${Kt(A) ? `${m}-ratio-wrapper-cover` : `${m}-ratio-wrapper-fit`}`,
|
|
1557
|
+
onClick: () => St(),
|
|
1558
|
+
style: { ...Kt(A) ? { "--image-aspect-ratio": Ve(A) } : {} },
|
|
1533
1559
|
"aria-label": "Open image gallery",
|
|
1534
1560
|
children: /* @__PURE__ */ f(
|
|
1535
1561
|
"img",
|
|
1536
1562
|
{
|
|
1537
|
-
className: `${m}-cover-image ${
|
|
1538
|
-
src:
|
|
1563
|
+
className: `${m}-cover-image ${Kt(A) ? `${m}-cover-image-cover` : `${m}-cover-image-fit`}`,
|
|
1564
|
+
src: $,
|
|
1539
1565
|
alt: "cover"
|
|
1540
1566
|
}
|
|
1541
1567
|
)
|
|
1542
1568
|
}
|
|
1543
1569
|
)
|
|
1544
1570
|
] }),
|
|
1545
|
-
|
|
1546
|
-
const
|
|
1547
|
-
return
|
|
1571
|
+
tt && typeof document < "u" && (() => {
|
|
1572
|
+
const ht = (d ? document.getElementById(d) : null) ?? document.body;
|
|
1573
|
+
return zn(
|
|
1548
1574
|
/* @__PURE__ */ f(
|
|
1549
|
-
|
|
1575
|
+
hr,
|
|
1550
1576
|
{
|
|
1551
1577
|
prefix: m,
|
|
1552
|
-
images:
|
|
1578
|
+
images: M,
|
|
1553
1579
|
settings: e,
|
|
1554
1580
|
isEditor: a,
|
|
1555
1581
|
isEditMode: c,
|
|
1556
1582
|
isPreviewMode: s,
|
|
1557
|
-
onClose: () =>
|
|
1583
|
+
onClose: () => K(!1)
|
|
1558
1584
|
}
|
|
1559
1585
|
),
|
|
1560
|
-
|
|
1586
|
+
ht
|
|
1561
1587
|
);
|
|
1562
1588
|
})()
|
|
1563
1589
|
] });
|
|
1564
1590
|
};
|
|
1565
1591
|
export {
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1592
|
+
Tr as LightboxStrip,
|
|
1593
|
+
rr as STRIP_TEXT_STYLE_PREFIXES,
|
|
1594
|
+
or as STRIP_TEXT_STYLE_TAB_LABELS,
|
|
1595
|
+
Lr as createStripTextStylePanelTab,
|
|
1596
|
+
cr as createStripTextStyleTabContentItems,
|
|
1597
|
+
sr as extractTitlesFromLegacyText,
|
|
1598
|
+
X as getStripTextStyleSettingKey,
|
|
1599
|
+
ar as resolveStripItemTitles
|
|
1574
1600
|
};
|