@cntrl-site/components 1.0.106-alpha.0 → 1.0.107-alpha.1

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 (92) hide show
  1. package/dist/ArchivePopup-DMpGP8r2.js +176 -0
  2. package/dist/ArchivePopup-X4EtTAyA.mjs +694 -0
  3. package/dist/ArchivePopupComponent-BTniPIfi.js +1 -0
  4. package/dist/{PretextComponent-j-OsRZTx.mjs → ArchivePopupComponent-GgAT2Avz.mjs} +954 -479
  5. package/dist/ClickGallerie-CYQMgrIr.js +36 -0
  6. package/dist/ClickGallerie-o2U6oyOF.mjs +272 -0
  7. package/dist/Components/ArchivePopup/ArchivePopup.d.ts +154 -0
  8. package/dist/Components/ArchivePopup/ArchivePopupComponent.d.ts +288 -0
  9. package/dist/Components/ClickGallerie/ClickGallerie.d.ts +2 -1
  10. package/dist/Components/Helix/Helix.d.ts +4 -1
  11. package/dist/Components/Hive/Hive.d.ts +4 -1
  12. package/dist/Components/ImageRevealSlider/ImageRevealSlider.d.ts +2 -1
  13. package/dist/Components/List/List.d.ts +6 -2
  14. package/dist/Components/Marquee/Marquee.d.ts +6 -2
  15. package/dist/Components/MarqueeText/MarqueeText.d.ts +2 -1
  16. package/dist/Components/Mercury/Mercury.d.ts +4 -1
  17. package/dist/Components/Waterfall/WaterfallLightbox.d.ts +4 -1
  18. package/dist/Components/utils/EmbedMediaFrame.d.ts +27 -0
  19. package/dist/Components/utils/LinkWrapper.d.ts +16 -0
  20. package/dist/Components/utils/embedMedia.d.ts +40 -0
  21. package/dist/Components/utils/index.d.ts +6 -0
  22. package/dist/{ControlSlider-SiOt22l_.js → ControlSlider-Kkec-i14.js} +1 -1
  23. package/dist/{ControlSlider-pZv7H6BU.mjs → ControlSlider-LcZmviGX.mjs} +1 -1
  24. package/dist/EmbedMediaFrame-DsOTKE4i.js +1 -0
  25. package/dist/EmbedMediaFrame-DwHeOAy5.mjs +164 -0
  26. package/dist/{FAQ-C7823fyi.js → FAQ-BxhMo7T8.js} +1 -1
  27. package/dist/{FAQ-CZ39u4m8.mjs → FAQ-CdwSft5p.mjs} +1 -1
  28. package/dist/Grid-CFHTP3mb.js +378 -0
  29. package/dist/Grid-e-gLfsji.mjs +1590 -0
  30. package/dist/Helix-BpLo9FD3.js +43 -0
  31. package/dist/Helix-CidI3ucE.mjs +324 -0
  32. package/dist/{Hive-D6-R6TwM.mjs → Hive-BsmFHk2i.mjs} +505 -475
  33. package/dist/Hive-D1j6wZpV.js +321 -0
  34. package/dist/ImageRevealSlider-BuukTGAK.js +1 -0
  35. package/dist/{ImageRevealSlider-BdFGyVEP.mjs → ImageRevealSlider-Df9sygk9.mjs} +63 -70
  36. package/dist/{Lightbox-eP9qAZzL.mjs → Lightbox-C_fXsfdz.mjs} +1 -1
  37. package/dist/{Lightbox-CIss_nOG.js → Lightbox-DaunVrkp.js} +1 -1
  38. package/dist/LinkWrapper-Ca84iPtg.js +1 -0
  39. package/dist/LinkWrapper-DZs9hlOn.mjs +13 -0
  40. package/dist/{List-DW7fyJbf.mjs → List-Bh_-l9vD.mjs} +532 -520
  41. package/dist/List-DVvpQ24J.js +377 -0
  42. package/dist/Marquee-DByooiWP.mjs +578 -0
  43. package/dist/Marquee-DfIP-tIN.js +133 -0
  44. package/dist/{MarqueeText-Rzt2fJYt.mjs → MarqueeText-D6FNCe6P.mjs} +115 -114
  45. package/dist/MarqueeText-DsUiV6Zv.js +132 -0
  46. package/dist/Mercury-B-s2Kvuq.js +267 -0
  47. package/dist/Mercury-CCW0Es-s.mjs +1700 -0
  48. package/dist/{RichTextRenderer-B6WtTYlR.mjs → RichTextRenderer-BptwNpbJ.mjs} +10 -9
  49. package/dist/RichTextRenderer-K90Dd7pt.js +1 -0
  50. package/dist/{Slider20-Dm8BeCli.mjs → Slider20-CCzixTiN.mjs} +1 -1
  51. package/dist/{Slider20-C9o2REDl.js → Slider20-fMVeRfgx.js} +1 -1
  52. package/dist/{TestimonialGrid-CPu4qQ6B.mjs → TestimonialGrid-CbsVxSn9.mjs} +1 -1
  53. package/dist/{TestimonialGrid-D4ieiz9e.js → TestimonialGrid-CiCagfBU.js} +1 -1
  54. package/dist/{TestimonialSingle-DLdnAVF7.mjs → TestimonialSingle-BVm3Amrl.mjs} +1 -1
  55. package/dist/{TestimonialSingle-CVu15ZtV.js → TestimonialSingle-BWXynGjv.js} +1 -1
  56. package/dist/Waterfall-3kKioKh2.mjs +1432 -0
  57. package/dist/Waterfall-DII4-WV5.js +288 -0
  58. package/dist/{components-D2LyuDm-.mjs → components-DKuQ8PUa.mjs} +19 -18
  59. package/dist/components-SEwSqFrQ.js +1 -0
  60. package/dist/content/postFieldBindings.d.ts +29 -0
  61. package/dist/elements.js +1 -1
  62. package/dist/elements.mjs +22 -21
  63. package/dist/elements.node.js +1 -1
  64. package/dist/elements.node.mjs +1 -1
  65. package/dist/index.d.ts +3 -1
  66. package/dist/index.js +1 -1
  67. package/dist/index.mjs +52 -15
  68. package/dist/sources.js +1331 -233
  69. package/dist/sources.mjs +1355 -256
  70. package/dist/types/SchemaV1.d.ts +53 -1
  71. package/dist/utils.js +1 -1
  72. package/dist/utils.mjs +30 -20
  73. package/package.json +1 -1
  74. package/dist/ClickGallerie-D7g093HX.js +0 -36
  75. package/dist/ClickGallerie-QSOQjSdv.mjs +0 -271
  76. package/dist/Grid-BBpdl60K.js +0 -374
  77. package/dist/Grid-DS53S_gA.mjs +0 -1576
  78. package/dist/Helix-BPn9V1sg.mjs +0 -315
  79. package/dist/Helix-DcgsCc4D.js +0 -43
  80. package/dist/Hive-n8Fz-j3o.js +0 -321
  81. package/dist/ImageRevealSlider-BBWtFjUF.js +0 -1
  82. package/dist/List-C32WImI3.js +0 -377
  83. package/dist/Marquee-DOIRRCu4.js +0 -133
  84. package/dist/Marquee-O_PDwlIb.mjs +0 -564
  85. package/dist/MarqueeText-DkaO2lQ5.js +0 -132
  86. package/dist/Mercury-C9D10TTT.mjs +0 -1702
  87. package/dist/Mercury-DynO-NxY.js +0 -267
  88. package/dist/PretextComponent-BnsS2zJ6.js +0 -1
  89. package/dist/RichTextRenderer-CIy6yI8U.js +0 -1
  90. package/dist/Waterfall-DC2WQ3GT.js +0 -287
  91. package/dist/Waterfall-Yud2VR62.mjs +0 -1404
  92. package/dist/components-B9Vdjf0w.js +0 -1
@@ -0,0 +1,694 @@
1
+ import { jsx as s, jsxs as x, Fragment as Ee } from "react/jsx-runtime";
2
+ import { useRef as L, useState as h, useMemo as Le, useEffect as w, useCallback as ut, useLayoutEffect as _e, Fragment as dt } from "react";
3
+ import { createPortal as pt } from "react-dom";
4
+ import _ from "classnames";
5
+ import { s as mt } from "./scalingValue-C9JH5L6O.mjs";
6
+ import { b as ft } from "./buildColorVars-CLyWQm5K.mjs";
7
+ import { u as vt } from "./useScopedStyles-DhBG3557.mjs";
8
+ import { R as gt } from "./RichTextRenderer-BptwNpbJ.mjs";
9
+ import { o as Ae, t as Se } from "./textStylesToCss-05Mn6I_2.mjs";
10
+ import { u as ht } from "./useLightboxScrollLock-VQ07s7EJ.mjs";
11
+ const Y = 2, $t = 5, yt = ["title2", "title3", "title4"], F = ["column1Width", "column2Width", "column3Width", "column4Width"], q = {
12
+ center: { x: "50%", y: "50%" },
13
+ "left-top": { x: "0%", y: "0%" },
14
+ "top-center": { x: "50%", y: "0%" },
15
+ "top-right": { x: "100%", y: "0%" },
16
+ "left-center": { x: "0%", y: "50%" },
17
+ "right-center": { x: "100%", y: "50%" },
18
+ "left-bottom": { x: "0%", y: "100%" },
19
+ "bottom-center": { x: "50%", y: "100%" },
20
+ "right-bottom": { x: "100%", y: "100%" }
21
+ }, jt = Object.keys(q), wt = ["column1", "column2", "column3", "column4", "column5"], Ct = {
22
+ triggerColor: "trigger-color",
23
+ triggerHoverColor: "trigger-hover-color",
24
+ closeColor: "close-color",
25
+ closeHoverColor: "close-hover-color",
26
+ panelColor: "panel-color",
27
+ textColor: "text-color",
28
+ textHoverColor: "text-hover-color",
29
+ overlayColor: "overlay-color"
30
+ }, bt = ["hover", "open"], H = 300, Me = 4e-3, Ie = 4e-3, xt = 20, Oe = 0.0139, Te = 0.3194, Fe = { top: 972e-5, right: 972e-5, bottom: 972e-5, left: 972e-5 }, He = 800, Lt = [
31
+ "--cntrl-article-width",
32
+ "--cntrl-article-top",
33
+ "--cntrl-article-left",
34
+ "--cntrl-viewport-height"
35
+ ];
36
+ function z(e) {
37
+ return Math.min(Math.max(Math.round(e ?? Y), Y), $t);
38
+ }
39
+ function ze(e) {
40
+ const { panelWidth: o = Te, panelPadding: n = Fe, columnGap: l = Oe } = e, a = (z(e.columns) - 1) * l;
41
+ return Math.max(0, o - n.left - n.right - a);
42
+ }
43
+ function _t(e) {
44
+ const o = z(e.columns), n = ze(e) / o;
45
+ return Object.fromEntries(F.slice(0, o - 1).map((l) => [l, n]));
46
+ }
47
+ function At(e) {
48
+ const o = z(e.columns), n = ze(e), l = F.slice(0, o - 1).map((m) => {
49
+ const p = e[m];
50
+ return typeof p == "number" ? Math.max(0, p) : n / o;
51
+ }), a = l.reduce((m, p) => m + p, 0), i = a > n ? n / a : 1;
52
+ return [...l.map((m) => m * i), Math.max(0, n - a * i)];
53
+ }
54
+ function Kt(e, o) {
55
+ return typeof e.columns != "number" || e.columns === o.columns ? e : { ...e, ..._t({ ...o, ...e }) };
56
+ }
57
+ function St(e) {
58
+ const o = e.reduce((n, l) => n + l, 0);
59
+ return e.map((n) => `minmax(0, ${o > 0 ? n / o * 100 : 1}fr)`).join(" ");
60
+ }
61
+ function It(e) {
62
+ const o = [];
63
+ return e.forEach((n, l) => {
64
+ var d;
65
+ const a = ((d = n.group) == null ? void 0 : d.trim()) ?? "", i = o[o.length - 1];
66
+ if (!i || a !== "" && a !== i.label) {
67
+ o.push({ label: a, rows: [{ item: n, index: l }] });
68
+ return;
69
+ }
70
+ i.rows.push({ item: n, index: l });
71
+ }), o;
72
+ }
73
+ function Rt(e) {
74
+ return e.type === "video" ? !0 : e.type === "image" ? !1 : /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.name ?? "") || /\.(mp4|webm|ogg|mov)(\?|$)/i.test(e.assetId);
75
+ }
76
+ function Nt(e) {
77
+ let o = e;
78
+ for (; o; ) {
79
+ if (getComputedStyle(o).getPropertyValue("--cntrl-article-width").trim())
80
+ return o;
81
+ o = o.parentElement;
82
+ }
83
+ return e;
84
+ }
85
+ function Re(e) {
86
+ const o = {}, n = Nt(e);
87
+ if (!n) return o;
88
+ const l = getComputedStyle(n);
89
+ for (const a of Lt) {
90
+ const i = l.getPropertyValue(a).trim();
91
+ i && (o[a] = i);
92
+ }
93
+ return o;
94
+ }
95
+ function Ne(e, o, n) {
96
+ const l = e, a = (d) => l[`${o}${d}`] ?? (n ? l[`${n}${d}`] : void 0), i = a("FontSettings");
97
+ return {
98
+ fontSettings: {
99
+ fontFamily: a("FontFamily"),
100
+ fontWeight: (i == null ? void 0 : i.fontWeight) ?? 400,
101
+ fontStyle: (i == null ? void 0 : i.fontStyle) ?? "normal"
102
+ },
103
+ fontSize: a("FontSize") ?? 0.01,
104
+ lineHeight: a("LineHeight"),
105
+ letterSpacing: a("LetterSpacing") ?? 0,
106
+ wordSpacing: a("WordSpacing") ?? 0,
107
+ textAlign: a("TextAlign"),
108
+ textAppearance: a("TextAppearance"),
109
+ color: "#000000"
110
+ };
111
+ }
112
+ function Et(e) {
113
+ return `
114
+ .${e}-trigger,
115
+ .${e}-close {
116
+ display: inline-block;
117
+ margin: 0;
118
+ padding: 0;
119
+ border: 0;
120
+ background: none;
121
+ cursor: pointer;
122
+ white-space: nowrap;
123
+ transition: color 150ms ease;
124
+ -webkit-appearance: none;
125
+ appearance: none;
126
+ -webkit-tap-highlight-color: transparent;
127
+ }
128
+ .${e}-trigger {
129
+ color: var(--${e}-trigger-color);
130
+ }
131
+ .${e}-close {
132
+ color: var(--${e}-close-color);
133
+ }
134
+ .${e}-trigger:focus,
135
+ .${e}-close:focus {
136
+ outline: none;
137
+ }
138
+ .${e}-trigger:focus-visible,
139
+ .${e}-close:focus-visible {
140
+ outline: 1px solid currentColor;
141
+ outline-offset: 2px;
142
+ }
143
+ .${e}-interactive .${e}-trigger:hover,
144
+ .${e}-state-hover .${e}-trigger {
145
+ color: var(--${e}-trigger-hover-color, var(--${e}-trigger-color));
146
+ }
147
+ .${e}-close:hover {
148
+ color: var(--${e}-close-hover-color, var(--${e}-close-color));
149
+ }
150
+ .${e}-editor .${e}-trigger {
151
+ cursor: default;
152
+ }
153
+ .${e}-overlay {
154
+ position: fixed;
155
+ inset: 0;
156
+ z-index: 9997;
157
+ overflow: hidden;
158
+ overscroll-behavior: none;
159
+ opacity: 0;
160
+ pointer-events: none;
161
+ transition: opacity ${H}ms ease;
162
+ }
163
+ .${e}-inline-layer {
164
+ position: fixed;
165
+ inset: 0;
166
+ z-index: 9997;
167
+ overflow: hidden;
168
+ pointer-events: none;
169
+ }
170
+ .${e}-overlay-editor {
171
+ inset: auto;
172
+ top: var(--cntrl-article-top, 0);
173
+ left: var(--cntrl-article-left, 0);
174
+ width: var(--cntrl-article-width, 100vw) !important;
175
+ height: var(--cntrl-viewport-height, 100vh) !important;
176
+ }
177
+ .${e}-overlay-edit-mode {
178
+ z-index: 1;
179
+ }
180
+ .${e}-overlay-active {
181
+ opacity: 1;
182
+ pointer-events: auto;
183
+ }
184
+ .${e}-backdrop {
185
+ position: absolute;
186
+ inset: 0;
187
+ background-color: var(--${e}-overlay-color);
188
+ }
189
+ .${e}-media-layer {
190
+ position: absolute;
191
+ inset: 0;
192
+ pointer-events: none;
193
+ }
194
+ .${e}-media {
195
+ position: absolute;
196
+ inset: 0;
197
+ width: 100%;
198
+ height: 100%;
199
+ object-fit: cover;
200
+ opacity: 0;
201
+ transition: opacity ${He}ms cubic-bezier(0, 0, 0.58, 1);
202
+ }
203
+ .${e}-media-contain {
204
+ object-fit: contain;
205
+ }
206
+ .${e}-media-visible {
207
+ opacity: 1;
208
+ }
209
+ .${e}-close {
210
+ position: absolute;
211
+ z-index: 2;
212
+ }
213
+ .${e}-panel {
214
+ position: absolute;
215
+ top: var(--${e}-panel-y);
216
+ left: var(--${e}-panel-x);
217
+ z-index: 1;
218
+ box-sizing: border-box;
219
+ max-width: 100%;
220
+ max-height: 100%;
221
+ overflow-y: auto;
222
+ transform: translate(calc(-1 * var(--${e}-panel-x)), calc(-1 * var(--${e}-panel-y) + 12px));
223
+ background-color: var(--${e}-panel-color);
224
+ color: var(--${e}-text-color);
225
+ overscroll-behavior: contain;
226
+ transition: transform ${H}ms cubic-bezier(0, 0, 0.58, 1);
227
+ }
228
+ .${e}-overlay-active .${e}-panel {
229
+ transform: translate(calc(-1 * var(--${e}-panel-x)), calc(-1 * var(--${e}-panel-y)));
230
+ }
231
+ .${e}-panel-settled {
232
+ transition: none;
233
+ }
234
+ .${e}-panel-inline {
235
+ position: relative;
236
+ top: auto;
237
+ left: auto;
238
+ max-height: none;
239
+ transform: none;
240
+ transition: none;
241
+ }
242
+ .${e}-media-layer-instant .${e}-media {
243
+ transition: none;
244
+ }
245
+ .${e}-panel-copy {
246
+ position: absolute;
247
+ pointer-events: none;
248
+ }
249
+ .${e}-panel-copy .${e}-row-active .${e}-title {
250
+ color: var(--${e}-text-hover-color, var(--${e}-text-color));
251
+ }
252
+ @media (prefers-reduced-motion: reduce) {
253
+ .${e}-panel {
254
+ transition: none;
255
+ }
256
+ }
257
+ .${e}-group ~ .${e}-group {
258
+ margin-top: var(--${e}-group-gap);
259
+ }
260
+ .${e}-row {
261
+ display: grid;
262
+ grid-template-columns: var(--${e}-grid-columns);
263
+ column-gap: var(--${e}-column-gap);
264
+ align-items: baseline;
265
+ }
266
+ .${e}-group-label {
267
+ min-width: 0;
268
+ overflow-wrap: anywhere;
269
+ }
270
+ .${e}-title {
271
+ min-width: 0;
272
+ overflow-wrap: anywhere;
273
+ transition: color 150ms cubic-bezier(0, 0, 0.58, 1);
274
+ }
275
+ .${e}-control-anchor {
276
+ position: absolute;
277
+ pointer-events: none;
278
+ z-index: 2;
279
+ }
280
+ .${e}-title a {
281
+ text-decoration: inherit;
282
+ }
283
+ .${e}-interactive .${e}-row:hover .${e}-title,
284
+ .${e}-row:focus-within .${e}-title,
285
+ .${e}-state-hover .${e}-row:first-child .${e}-title {
286
+ color: var(--${e}-text-hover-color, var(--${e}-text-color));
287
+ }
288
+ `;
289
+ }
290
+ function Mt({
291
+ P: e,
292
+ media: o,
293
+ isVisible: n
294
+ }) {
295
+ const l = L(null), [a, i] = h(!1), d = Rt(o), m = _(
296
+ `${e}-media`,
297
+ o.objectFit === "contain" && `${e}-media-contain`,
298
+ n && a && `${e}-media-visible`
299
+ );
300
+ return w(() => {
301
+ var r;
302
+ const p = l.current;
303
+ !d || !p || (n ? (r = p.play()) == null || r.catch(() => {
304
+ }) : p.pause());
305
+ }, [d, n]), d ? /* @__PURE__ */ s(
306
+ "video",
307
+ {
308
+ ref: l,
309
+ className: m,
310
+ src: o.assetId,
311
+ muted: !0,
312
+ loop: !0,
313
+ playsInline: !0,
314
+ preload: "auto",
315
+ onLoadedData: () => i(!0)
316
+ }
317
+ ) : /* @__PURE__ */ s(
318
+ "img",
319
+ {
320
+ className: m,
321
+ src: o.assetId,
322
+ alt: "",
323
+ decoding: "async",
324
+ onLoad: () => i(!0)
325
+ }
326
+ );
327
+ }
328
+ function Ot(e, o, n, l, a) {
329
+ const i = o[o.length - 1];
330
+ let d = n;
331
+ return o.slice(0, -1).map((m, p) => {
332
+ const r = d + m + l / 2;
333
+ return d += m + l, /* @__PURE__ */ s(
334
+ "div",
335
+ {
336
+ "data-controls": F[p],
337
+ "data-controls-axis": "x",
338
+ "data-controls-variant": "column-width",
339
+ "data-controls-min": String(xt),
340
+ "data-controls-max-fraction": String(m + i),
341
+ className: `${e}-control-anchor`,
342
+ style: { top: 0, left: a(r - Ie / 2), width: a(Ie), height: "100%" }
343
+ },
344
+ F[p]
345
+ );
346
+ });
347
+ }
348
+ function Tt(e, o, n, l) {
349
+ const a = (i) => l(Math.max(i, Me));
350
+ return /* @__PURE__ */ x(Ee, { children: [
351
+ /* @__PURE__ */ s(
352
+ "div",
353
+ {
354
+ "data-controls": "panelPadding.top",
355
+ "data-controls-axis": "y",
356
+ "data-controls-variant": "row-padding",
357
+ "data-controls-min": "0",
358
+ className: `${e}-control-anchor`,
359
+ style: { top: 0, left: 0, width: "100%", height: a(n.top) }
360
+ }
361
+ ),
362
+ /* @__PURE__ */ s(
363
+ "div",
364
+ {
365
+ "data-controls": "panelPadding.bottom",
366
+ "data-controls-axis": "y",
367
+ "data-controls-variant": "row-padding",
368
+ "data-controls-reverse": "",
369
+ "data-controls-min": "0",
370
+ className: `${e}-control-anchor`,
371
+ style: { bottom: 0, left: 0, width: "100%", height: a(n.bottom) }
372
+ }
373
+ ),
374
+ /* @__PURE__ */ s(
375
+ "div",
376
+ {
377
+ "data-controls": "panelPadding.left",
378
+ "data-controls-axis": "x",
379
+ "data-controls-variant": "column-padding",
380
+ "data-controls-min": "0",
381
+ "data-controls-max-fraction": String(Math.max(0, o - n.right)),
382
+ className: `${e}-control-anchor`,
383
+ style: { top: 0, left: 0, width: a(n.left), height: "100%" }
384
+ }
385
+ ),
386
+ /* @__PURE__ */ s(
387
+ "div",
388
+ {
389
+ "data-controls": "panelPadding.right",
390
+ "data-controls-axis": "x",
391
+ "data-controls-variant": "column-padding",
392
+ "data-controls-reverse": "",
393
+ "data-controls-min": "0",
394
+ "data-controls-max-fraction": String(Math.max(0, o - n.left)),
395
+ className: `${e}-control-anchor`,
396
+ style: { top: 0, right: 0, width: a(n.right), height: "100%" }
397
+ }
398
+ )
399
+ ] });
400
+ }
401
+ function Xt({
402
+ settings: e,
403
+ content: o,
404
+ isEditor: n,
405
+ isEditMode: l,
406
+ isPreviewMode: a,
407
+ activeEvent: i,
408
+ portalId: d,
409
+ currentState: m,
410
+ unavailableStates: p
411
+ }) {
412
+ const { prefix: r } = vt(), {
413
+ type: Be = "a",
414
+ triggerLabel: Z = "Archive",
415
+ closeLabel: De = "Close",
416
+ columns: Ue = Y,
417
+ columnGap: J = Oe,
418
+ panelPosition: We,
419
+ panelWidth: Q = Te,
420
+ panelPadding: A = Fe,
421
+ panelRadius: ke = 0,
422
+ groupGap: P = 0.0139,
423
+ triggerColor: Ve = "#000000",
424
+ triggerHoverColor: Ge = "#666666",
425
+ closeColor: je = "#000000",
426
+ closeHoverColor: Ke = "#666666",
427
+ panelColor: Xe = "#FFFFFF",
428
+ textColor: Ye = "#333132",
429
+ textHoverColor: qe = "#BBBBBB",
430
+ overlayColor: Ze = "#FFFFFFE6"
431
+ } = e, ee = o ?? [], B = L(null), D = L(null), U = L(null), te = L(null), oe = L(null), ne = L(null), [Je, M] = h(!1), [N, re] = h(!1), [O, ae] = h(!1), [le, ie] = h(!1), [C, S] = h(null), [ce, Qe] = h(() => /* @__PURE__ */ new Set()), [b, Pe] = h(null), [se, ue] = h({}), [I, W] = h(null), [et, de] = h(!1), E = !!(n && !a), $ = !n || !!a, f = Be === "b", tt = E && m === "open" && !(p != null && p.includes("open")), y = !f && (tt || ($ || !!l) && Je), v = (t) => mt(t, n ?? !1), ot = Le(() => Et(r), [r]), nt = Le(() => It(o ?? []), [o]), pe = q[We] ?? q.center, me = z(Ue), fe = At(e), rt = ["title", ...yt].slice(0, me - 1);
432
+ ht(y && !E), w(() => {
433
+ E && !l && M(!1);
434
+ }, [E, l]), w(() => {
435
+ if (y) {
436
+ ue(Re(B.current)), re(!0);
437
+ return;
438
+ }
439
+ ae(!1), S(null);
440
+ const t = window.setTimeout(() => re(!1), H);
441
+ return () => window.clearTimeout(t);
442
+ }, [y]), w(() => {
443
+ var c;
444
+ if (!y || !N) return;
445
+ (c = U.current) == null || c.getBoundingClientRect();
446
+ const t = requestAnimationFrame(() => ae(!0));
447
+ return () => cancelAnimationFrame(t);
448
+ }, [y, N]), w(() => {
449
+ if (!O) {
450
+ ie(!1);
451
+ return;
452
+ }
453
+ const t = window.setTimeout(() => ie(!0), H);
454
+ return () => window.clearTimeout(t);
455
+ }, [O]);
456
+ const T = ut(() => {
457
+ const t = D.current, c = U.current;
458
+ if (!t || !c) return;
459
+ const u = t.getBoundingClientRect(), g = c.getBoundingClientRect();
460
+ Pe({ top: u.top - g.top, left: u.left - g.left });
461
+ }, []);
462
+ _e(() => {
463
+ if (N)
464
+ return T(), window.addEventListener("resize", T), () => window.removeEventListener("resize", T);
465
+ }, [N, T]), w(() => {
466
+ var c;
467
+ if (!y || !$) return;
468
+ (c = te.current) == null || c.focus({ preventScroll: !0 });
469
+ const t = (u) => {
470
+ u.key === "Escape" && M(!1);
471
+ };
472
+ return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
473
+ }, [y, $]), _e(() => {
474
+ if (!f || C === null) return;
475
+ const t = oe.current, c = ne.current;
476
+ if (!t || !c) return;
477
+ const u = t.getBoundingClientRect(), g = c.getBoundingClientRect();
478
+ W({ top: u.top - g.top, left: u.left - g.left, width: u.width });
479
+ }, [f, C]), w(() => {
480
+ if (C !== null) return;
481
+ const t = window.setTimeout(() => W(null), He);
482
+ return () => window.clearTimeout(t);
483
+ }, [C]);
484
+ const ve = I !== null;
485
+ w(() => {
486
+ if (!f || !ve) return;
487
+ const t = () => {
488
+ de(!0), S(null), W(null);
489
+ };
490
+ return document.addEventListener("scroll", t, { capture: !0, passive: !0 }), window.addEventListener("resize", t), () => {
491
+ document.removeEventListener("scroll", t, { capture: !0 }), window.removeEventListener("resize", t);
492
+ };
493
+ }, [f, ve]);
494
+ const ge = () => {
495
+ var t;
496
+ $ && (M(!1), (t = D.current) == null || t.focus({ preventScroll: !0 }));
497
+ }, he = (t) => {
498
+ var c, u;
499
+ if (!$ || !((u = (c = ee[t]) == null ? void 0 : c.image) != null && u.assetId)) {
500
+ S(null);
501
+ return;
502
+ }
503
+ Qe((g) => g.has(t) ? g : new Set(g).add(t)), f && C === null && ue(Re(B.current)), de(!1), S(t);
504
+ }, $e = (t) => {
505
+ S((c) => c === t ? null : c);
506
+ }, at = (t) => {
507
+ !$ && t.target.closest("a") && t.preventDefault();
508
+ }, ye = Ae(Se(Ne(e, "trigger"), n)), we = wt.slice(0, me).map((t) => Ae(Se(Ne(e, t, "list"), n))), k = ft(r, {
509
+ triggerColor: Ve,
510
+ triggerHoverColor: Ge,
511
+ closeColor: je,
512
+ closeHoverColor: Ke,
513
+ panelColor: Xe,
514
+ textColor: Ye,
515
+ textHoverColor: qe,
516
+ overlayColor: Ze
517
+ }, Ct, bt), V = i && i !== "default" ? `${r}-state-${i}` : "", G = $ ? `${r}-interactive` : "", Ce = /* @__PURE__ */ s("div", { className: _(`${r}-media-layer`, et && `${r}-media-layer-instant`), "aria-hidden": "true", children: [...ce].map((t) => {
518
+ var u;
519
+ const c = (u = ee[t]) == null ? void 0 : u.image;
520
+ return c != null && c.assetId ? /* @__PURE__ */ s(
521
+ Mt,
522
+ {
523
+ P: r,
524
+ media: c,
525
+ isVisible: C === t
526
+ },
527
+ `${t}-${c.assetId}`
528
+ ) : null;
529
+ }) }), j = !!l && (f || le), K = (t) => /* @__PURE__ */ x(
530
+ "div",
531
+ {
532
+ ref: t ? void 0 : oe,
533
+ className: _(
534
+ `${r}-panel`,
535
+ // Only the open and close slide; once open, a new position or size moves the panel straight there.
536
+ O && le && `${r}-panel-settled`,
537
+ f && `${r}-panel-inline`,
538
+ t && `${r}-panel-copy`
539
+ ),
540
+ style: {
541
+ width: v(Q),
542
+ paddingTop: v(A.top),
543
+ paddingRight: v(A.right),
544
+ paddingBottom: v(A.bottom),
545
+ paddingLeft: v(A.left),
546
+ borderRadius: v(ke),
547
+ [`--${r}-group-gap`]: v(P),
548
+ [`--${r}-panel-x`]: pe.x,
549
+ [`--${r}-panel-y`]: pe.y,
550
+ [`--${r}-grid-columns`]: St(fe),
551
+ [`--${r}-column-gap`]: v(J),
552
+ ...t && I ? { top: I.top, left: I.left, width: I.width } : {}
553
+ },
554
+ "data-lightbox-scrollable": f ? void 0 : "",
555
+ "aria-hidden": t || void 0,
556
+ onMouseLeave: t ? void 0 : () => S(null),
557
+ onClickCapture: t ? void 0 : at,
558
+ children: [
559
+ !t && j && Tt(r, Q, A, v),
560
+ !t && j && Ot(r, fe, A.left, J, v),
561
+ nt.map((c, u) => /* @__PURE__ */ x(dt, { children: [
562
+ !t && j && u > 0 && // Left at its static top, the anchor sits right where the gap above this group starts.
563
+ /* @__PURE__ */ s(
564
+ "div",
565
+ {
566
+ "data-controls": "groupGap",
567
+ "data-controls-paired": "",
568
+ "data-controls-axis": "y",
569
+ "data-controls-reverse": "",
570
+ "data-controls-min": "0",
571
+ className: `${r}-control-anchor`,
572
+ style: { left: 0, width: "100%", height: v(Math.max(P, Me)) }
573
+ }
574
+ ),
575
+ /* @__PURE__ */ s("div", { className: `${r}-group`, children: c.rows.map(({ item: g, index: R }, ct) => /* @__PURE__ */ x(
576
+ "div",
577
+ {
578
+ className: _(`${r}-row`, t && R === C && `${r}-row-active`),
579
+ ...t ? {} : {
580
+ onMouseEnter: () => he(R),
581
+ onMouseLeave: () => $e(R),
582
+ onFocus: () => he(R),
583
+ onBlur: () => $e(R)
584
+ },
585
+ children: [
586
+ /* @__PURE__ */ s("span", { className: `${r}-group-label`, style: we[0], children: ct === 0 ? c.label : "" }),
587
+ rt.map((xe, st) => {
588
+ const X = g[xe];
589
+ return /* @__PURE__ */ s("div", { className: `${r}-title`, style: we[st + 1], children: Array.isArray(X) ? /* @__PURE__ */ s(gt, { content: X }) : X }, xe);
590
+ })
591
+ ]
592
+ },
593
+ R
594
+ )) })
595
+ ] }, u))
596
+ ]
597
+ }
598
+ ), lt = N ? /* @__PURE__ */ x(
599
+ "div",
600
+ {
601
+ ref: U,
602
+ className: _(
603
+ `${r}-overlay`,
604
+ n && `${r}-overlay-editor`,
605
+ l && `${r}-overlay-edit-mode`,
606
+ O && `${r}-overlay-active`,
607
+ G,
608
+ V
609
+ ),
610
+ style: { ...k, ...se },
611
+ role: "dialog",
612
+ "aria-modal": "true",
613
+ "aria-label": Z,
614
+ "data-selection": "none",
615
+ children: [
616
+ /* @__PURE__ */ s("div", { className: `${r}-backdrop`, "aria-hidden": "true", onClick: ge }),
617
+ Ce,
618
+ /* @__PURE__ */ s(
619
+ "button",
620
+ {
621
+ ref: te,
622
+ type: "button",
623
+ className: `${r}-close`,
624
+ style: {
625
+ ...ye,
626
+ top: (b == null ? void 0 : b.top) ?? 0,
627
+ left: (b == null ? void 0 : b.left) ?? 0,
628
+ visibility: b ? "visible" : "hidden"
629
+ },
630
+ onClick: ge,
631
+ children: De
632
+ }
633
+ ),
634
+ K(!1)
635
+ ]
636
+ }
637
+ ) : null, it = f && ce.size > 0 ? /* @__PURE__ */ x(
638
+ "div",
639
+ {
640
+ ref: ne,
641
+ className: _(`${r}-inline-layer`, n && `${r}-overlay-editor`, G, V),
642
+ style: { ...k, ...se },
643
+ "aria-hidden": "true",
644
+ "data-selection": "none",
645
+ children: [
646
+ Ce,
647
+ I && K(!0)
648
+ ]
649
+ }
650
+ ) : null, be = lt ?? it;
651
+ return /* @__PURE__ */ x(Ee, { children: [
652
+ /* @__PURE__ */ s("style", { dangerouslySetInnerHTML: { __html: ot } }),
653
+ /* @__PURE__ */ s(
654
+ "div",
655
+ {
656
+ ref: B,
657
+ className: _(E && `${r}-editor`, G, V),
658
+ style: k,
659
+ children: f ? K(!1) : /* @__PURE__ */ s(
660
+ "button",
661
+ {
662
+ ref: D,
663
+ type: "button",
664
+ className: `${r}-trigger`,
665
+ style: ye,
666
+ "aria-haspopup": "dialog",
667
+ "aria-expanded": y,
668
+ onClick: () => {
669
+ $ && M(!0);
670
+ },
671
+ children: Z
672
+ }
673
+ )
674
+ }
675
+ ),
676
+ be && typeof document < "u" && pt(
677
+ be,
678
+ (d ? document.getElementById(d) : null) ?? document.body
679
+ )
680
+ ] });
681
+ }
682
+ export {
683
+ wt as ARCHIVE_POPUP_COLUMN_STYLE_PREFIXES,
684
+ F as ARCHIVE_POPUP_COLUMN_WIDTH_KEYS,
685
+ yt as ARCHIVE_POPUP_EXTRA_TITLE_KEYS,
686
+ $t as ARCHIVE_POPUP_MAX_COLUMNS,
687
+ Y as ARCHIVE_POPUP_MIN_COLUMNS,
688
+ jt as ARCHIVE_POPUP_PANEL_POSITIONS,
689
+ Xt as ArchivePopup,
690
+ Kt as applyArchivePopupColumnCountChange,
691
+ _t as getArchivePopupEqualColumnWidths,
692
+ It as groupArchiveRows,
693
+ At as resolveArchivePopupColumnWidths
694
+ };