@cntrl-site/components 1.0.103 → 1.0.104

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 (41) hide show
  1. package/dist/Components/helpers/LazyVideo/LazyVideo.d.ts +4 -0
  2. package/dist/Components/utils/index.d.ts +1 -0
  3. package/dist/Components/utils/useLazyVideos.d.ts +15 -0
  4. package/dist/Grid-B2_o1dvz.mjs +1576 -0
  5. package/dist/Grid-Bq6bk2AQ.js +374 -0
  6. package/dist/{Helix-2Vr-9WBa.js → Helix-B7rxlvKq.js} +2 -2
  7. package/dist/{Helix-BmkAKT1G.mjs → Helix-BrKQzGX5.mjs} +53 -53
  8. package/dist/{Hive-BGMWinrW.mjs → Hive-BusARSOi.mjs} +114 -111
  9. package/dist/Hive-Dh5nKPGm.js +321 -0
  10. package/dist/LazyVideo-Cn_vmMq8.js +1 -0
  11. package/dist/LazyVideo-D8eVYFyw.mjs +15 -0
  12. package/dist/Marquee-CdtAqhQE.mjs +563 -0
  13. package/dist/Marquee-DUN8wUax.js +133 -0
  14. package/dist/{Mercury-DuKJQ1Zo.mjs → Mercury-BRqlbk4i.mjs} +55 -54
  15. package/dist/Mercury-C-O2VGkK.js +267 -0
  16. package/dist/{PretextComponent-CGycuNNn.js → PretextComponent-D5P0AjnL.js} +1 -1
  17. package/dist/{PretextComponent-DN8cyZ8x.mjs → PretextComponent-s4DDfmzY.mjs} +6 -6
  18. package/dist/{Waterfall-A0FjM2my.mjs → Waterfall-DKuh4bnv.mjs} +299 -295
  19. package/dist/Waterfall-fdiHR0Rc.js +287 -0
  20. package/dist/{components-DTCDEBo0.js → components-DzNixU7Q.js} +1 -1
  21. package/dist/{components-BFJINCME.mjs → components-Yf9Zjska.mjs} +1 -1
  22. package/dist/elements.js +1 -1
  23. package/dist/elements.mjs +6 -6
  24. package/dist/elements.node.js +1 -1
  25. package/dist/elements.node.mjs +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/index.mjs +2 -2
  28. package/dist/sources.js +125 -49
  29. package/dist/sources.mjs +129 -53
  30. package/dist/useLazyVideos-BbgdvELi.js +1 -0
  31. package/dist/useLazyVideos-CZLyNolX.mjs +72 -0
  32. package/dist/utils.js +1 -1
  33. package/dist/utils.mjs +14 -12
  34. package/package.json +5 -3
  35. package/dist/Grid-CemGhf3F.js +0 -374
  36. package/dist/Grid-cfQsXW3b.mjs +0 -1553
  37. package/dist/Hive-BC6zQBsv.js +0 -321
  38. package/dist/Marquee-BYClHHws.mjs +0 -551
  39. package/dist/Marquee-vmHaTGIP.js +0 -133
  40. package/dist/Mercury-BwF_XW2w.js +0 -267
  41. package/dist/Waterfall-DnPDHbCL.js +0 -287
@@ -1,12 +1,14 @@
1
1
  import { jsx as h, jsxs as bt, Fragment as ve } from "react/jsx-runtime";
2
- import { useRef as y, useState as $, useCallback as w, useEffect as D, useLayoutEffect as Pt, useMemo as me } from "react";
3
- import { createPortal as ln } from "react-dom";
4
- import { g as an, a as cn } from "./getImageRect-CBMhFNHM.mjs";
2
+ import { useState as $, useRef as y, useCallback as w, useEffect as D, useLayoutEffect as Pt, useMemo as me } from "react";
3
+ import { createPortal as an } from "react-dom";
4
+ import { g as ln, a as cn } from "./getImageRect-CBMhFNHM.mjs";
5
5
  import { s as ne } from "./scalingValue-C9JH5L6O.mjs";
6
6
  import { u as sn } from "./useScopedStyles-DhBG3557.mjs";
7
- import { t as un } from "./textStylesToCss-05Mn6I_2.mjs";
8
- import { H as fn } from "./HiveLightboxTitles-DhEeFKWs.mjs";
9
- function dn(t) {
7
+ import { L as un } from "./LazyVideo-D8eVYFyw.mjs";
8
+ import { t as fn } from "./textStylesToCss-05Mn6I_2.mjs";
9
+ import { u as dn } from "./useLazyVideos-CZLyNolX.mjs";
10
+ import { H as hn } from "./HiveLightboxTitles-DhEeFKWs.mjs";
11
+ function pn(t) {
10
12
  return `
11
13
  .${t}-titles-row {
12
14
  position: relative;
@@ -207,27 +209,27 @@ function dn(t) {
207
209
  }
208
210
  `;
209
211
  }
210
- const Q = 500, _t = 650, M = "cubic-bezier(0.22, 1, 0.36, 1)", hn = 72, pn = 50, gn = 1e4, mn = 650, wn = 500;
211
- function vn(t, e) {
212
- const r = t.width / e.width, o = t.height / e.height, i = t.left - e.left, a = t.top - e.top;
213
- return `translate(${i}px, ${a}px) scale(${r}, ${o})`;
212
+ const Q = 500, _t = 650, B = "cubic-bezier(0.22, 1, 0.36, 1)", gn = 72, mn = 50, wn = 1e4, vn = 650, yn = 500;
213
+ function xn(t, n) {
214
+ const r = t.width / n.width, o = t.height / n.height, i = t.left - n.left, l = t.top - n.top;
215
+ return `translate(${i}px, ${l}px) scale(${r}, ${o})`;
214
216
  }
215
- function je(t, e) {
216
- if (e === "contain" && t instanceof HTMLImageElement) {
217
- const o = an(t);
217
+ function je(t, n) {
218
+ if (n === "contain" && t instanceof HTMLImageElement) {
219
+ const o = ln(t);
218
220
  return { left: o.x, top: o.y, width: o.width, height: o.height };
219
221
  }
220
222
  const r = t.getBoundingClientRect();
221
223
  return { left: r.left, top: r.top, width: r.width, height: r.height };
222
224
  }
223
- function yn(t, e, r) {
224
- const o = t.querySelector(`[data-waterfall-index="${e}"]`);
225
+ function $n(t, n, r) {
226
+ const o = t.querySelector(`[data-waterfall-index="${n}"]`);
225
227
  return o instanceof HTMLElement ? je(o, r) : null;
226
228
  }
227
- function xn(t) {
228
- return t.reduce((e, r, o) => {
229
+ function bn(t) {
230
+ return t.reduce((n, r, o) => {
229
231
  var i;
230
- return (i = r.image) != null && i.assetId && e.push({
232
+ return (i = r.image) != null && i.assetId && n.push({
231
233
  gridIndex: o,
232
234
  items: [r.image],
233
235
  entry: {
@@ -235,23 +237,23 @@ function xn(t) {
235
237
  title2: r.subtitle ?? "",
236
238
  title3: r.caption ?? ""
237
239
  }
238
- }), e;
240
+ }), n;
239
241
  }, []);
240
242
  }
241
- function jt(t, e, r) {
243
+ function jt(t, n, r) {
242
244
  var i;
243
245
  if (t.length <= 1) return null;
244
- const o = (e + r + t.length) % t.length;
246
+ const o = (n + r + t.length) % t.length;
245
247
  return ((i = t[o]) == null ? void 0 : i.items[0]) ?? null;
246
248
  }
247
- function De(t, e, r) {
249
+ function De(t, n, r) {
248
250
  if (t.length <= 2) return null;
249
- const o = (e + r + t.length) % t.length;
251
+ const o = (n + r + t.length) % t.length;
250
252
  return jt(t, o, r);
251
253
  }
252
- const $n = 0.03;
254
+ const Sn = 0.03;
253
255
  function Ve(t) {
254
- return t.width * $n;
256
+ return t.width * Sn;
255
257
  }
256
258
  const we = {
257
259
  left: 0,
@@ -259,58 +261,60 @@ const we = {
259
261
  width: typeof window < "u" ? window.innerWidth : 1440,
260
262
  height: typeof window < "u" ? window.innerHeight : 900
261
263
  };
262
- function te(t, e) {
264
+ function te(t, n) {
263
265
  return {
264
- left: t.left - e.left,
265
- top: t.top - e.top,
266
+ left: t.left - n.left,
267
+ top: t.top - n.top,
266
268
  width: t.width,
267
269
  height: t.height
268
270
  };
269
271
  }
270
272
  function _e(t) {
271
- const e = t.getBoundingClientRect();
272
- return { width: e.width, height: e.height, left: e.left, top: e.top };
273
+ const n = t.getBoundingClientRect();
274
+ return { width: n.width, height: n.height, left: n.left, top: n.top };
273
275
  }
274
- function bn(t) {
276
+ function In(t) {
275
277
  return t instanceof HTMLVideoElement ? { width: t.videoWidth, height: t.videoHeight } : { width: t.naturalWidth, height: t.naturalHeight };
276
278
  }
277
- function ye(t, e, r) {
278
- const o = t.getBoundingClientRect(), i = o.width, a = o.height, p = e / r, s = i / a;
279
+ function ye(t, n, r) {
280
+ const o = t.getBoundingClientRect(), i = o.width, l = o.height, p = n / r, s = i / l;
279
281
  if (p > s) {
280
282
  const b = i / p;
281
- return { width: i, height: b, left: o.left, top: o.top + (a - b) / 2 };
283
+ return { width: i, height: b, left: o.left, top: o.top + (l - b) / 2 };
282
284
  }
283
- const I = a * p;
284
- return { width: I, height: a, left: o.left + (i - I) / 2, top: o.top };
285
+ const I = l * p;
286
+ return { width: I, height: l, left: o.left + (i - I) / 2, top: o.top };
285
287
  }
286
- function Sn(t, e) {
287
- return !t || !(e != null && e.width) || !(e != null && e.height) ? null : ye(t, e.width, e.height);
288
+ function Ln(t, n) {
289
+ return !t || !(n != null && n.width) || !(n != null && n.height) ? null : ye(t, n.width, n.height);
288
290
  }
289
- function In(t, e) {
291
+ function Tn(t, n) {
290
292
  if (oe(t)) {
291
293
  const o = document.createElement("video"), i = () => {
292
- o.videoWidth > 0 && o.videoHeight > 0 && e(t.assetId, o.videoWidth, o.videoHeight), o.removeEventListener("loadedmetadata", i);
294
+ o.videoWidth > 0 && o.videoHeight > 0 && n(t.assetId, o.videoWidth, o.videoHeight), o.removeEventListener("loadedmetadata", i);
293
295
  };
294
296
  o.addEventListener("loadedmetadata", i), o.preload = "auto", o.src = t.assetId, o.load();
295
297
  return;
296
298
  }
297
299
  const r = new Image();
298
300
  r.onload = () => {
299
- r.naturalWidth > 0 && r.naturalHeight > 0 && e(t.assetId, r.naturalWidth, r.naturalHeight);
301
+ r.naturalWidth > 0 && r.naturalHeight > 0 && n(t.assetId, r.naturalWidth, r.naturalHeight);
300
302
  }, r.src = t.assetId;
301
303
  }
302
- function Ln(t) {
303
- const e = /* @__PURE__ */ new Set(), r = [];
304
+ function kn(t) {
305
+ const n = /* @__PURE__ */ new Set(), r = [];
304
306
  for (const o of t) {
305
307
  const i = o.image;
306
- !(i != null && i.assetId) || e.has(i.assetId) || (e.add(i.assetId), r.push(i));
308
+ !(i != null && i.assetId) || n.has(i.assetId) || (n.add(i.assetId), r.push(i));
307
309
  }
308
310
  return r;
309
311
  }
310
- function Tn({ mediaList: t }) {
311
- return t.length === 0 ? null : /* @__PURE__ */ h(
312
+ function Hn({ mediaList: t }) {
313
+ const [n, r] = $(null);
314
+ return dn(n, { preload: "metadata" }), t.length === 0 ? null : /* @__PURE__ */ h(
312
315
  "div",
313
316
  {
317
+ ref: r,
314
318
  "aria-hidden": !0,
315
319
  style: {
316
320
  position: "absolute",
@@ -320,98 +324,98 @@ function Tn({ mediaList: t }) {
320
324
  opacity: 0,
321
325
  pointerEvents: "none"
322
326
  },
323
- children: t.map((e) => oe(e) ? /* @__PURE__ */ h(
327
+ children: t.map((o) => oe(o) ? /* @__PURE__ */ h(
324
328
  "video",
325
329
  {
326
- src: e.assetId,
327
- preload: "auto",
330
+ src: o.assetId,
331
+ preload: "none",
328
332
  muted: !0,
329
333
  playsInline: !0
330
334
  },
331
- e.assetId
335
+ o.assetId
332
336
  ) : /* @__PURE__ */ h(
333
337
  "img",
334
338
  {
335
- src: e.assetId,
339
+ src: o.assetId,
336
340
  alt: ""
337
341
  },
338
- e.assetId
342
+ o.assetId
339
343
  ))
340
344
  }
341
345
  );
342
346
  }
343
- function Nt(t, e, r) {
344
- const { width: o, height: i, top: a } = t, { left: p, width: s } = r, I = Ve(r);
345
- return e === "left" ? {
347
+ function Nt(t, n, r) {
348
+ const { width: o, height: i, top: l } = t, { left: p, width: s } = r, I = Ve(r);
349
+ return n === "left" ? {
346
350
  left: p + I - o,
347
- top: a,
351
+ top: l,
348
352
  width: o,
349
353
  height: i
350
354
  } : {
351
355
  left: p + s - I,
352
- top: a,
356
+ top: l,
353
357
  width: o,
354
358
  height: i
355
359
  };
356
360
  }
357
- function re(t, e, r) {
358
- const o = Nt(t, e, r);
361
+ function re(t, n, r) {
362
+ const o = Nt(t, n, r);
359
363
  return {
360
364
  ...o,
361
365
  left: 2 * o.left - t.left
362
366
  };
363
367
  }
364
- function kn(t, e, r) {
365
- const { left: o, width: i } = r, a = Ve(r);
366
- return e === "left" ? {
368
+ function An(t, n, r) {
369
+ const { left: o, width: i } = r, l = Ve(r);
370
+ return n === "left" ? {
367
371
  left: o,
368
372
  top: t.top,
369
- width: a,
373
+ width: l,
370
374
  height: t.height
371
375
  } : {
372
- left: o + i - a,
376
+ left: o + i - l,
373
377
  top: t.top,
374
- width: a,
378
+ width: l,
375
379
  height: t.height
376
380
  };
377
381
  }
378
- function Be(t, e, r, o) {
379
- const i = Nt(t, "left", o), a = Nt(t, "right", o), p = re(t, "left", o), s = re(t, "right", o);
382
+ function Me(t, n, r, o) {
383
+ const i = Nt(t, "left", o), l = Nt(t, "right", o), p = re(t, "left", o), s = re(t, "right", o);
380
384
  if (r === 1)
381
- switch (e) {
385
+ switch (n) {
382
386
  case "center":
383
387
  return { start: t, end: i };
384
388
  case "right-adjacent":
385
- return { start: a, end: t };
389
+ return { start: l, end: t };
386
390
  case "left-adjacent":
387
391
  return { start: i, end: p };
388
392
  case "far-right":
389
- return { start: s, end: a };
393
+ return { start: s, end: l };
390
394
  default:
391
395
  return { start: t, end: t };
392
396
  }
393
- switch (e) {
397
+ switch (n) {
394
398
  case "center":
395
- return { start: t, end: a };
399
+ return { start: t, end: l };
396
400
  case "left-adjacent":
397
401
  return { start: i, end: t };
398
402
  case "right-adjacent":
399
- return { start: a, end: s };
403
+ return { start: l, end: s };
400
404
  case "far-left":
401
405
  return { start: p, end: i };
402
406
  default:
403
407
  return { start: t, end: t };
404
408
  }
405
409
  }
406
- function Hn(t, e, r, o) {
407
- const { start: i, end: a } = Be(t, e, r, o);
410
+ function Rn(t, n, r, o) {
411
+ const { start: i, end: l } = Me(t, n, r, o);
408
412
  return {
409
- x: a.left - i.left,
410
- y: a.top - i.top
413
+ x: l.left - i.left,
414
+ y: l.top - i.top
411
415
  };
412
416
  }
413
- function An(t, e, r) {
414
- const o = Nt(t, e, r), i = re(t, e, r);
417
+ function Cn(t, n, r) {
418
+ const o = Nt(t, n, r), i = re(t, n, r);
415
419
  return {
416
420
  x: i.left - o.left,
417
421
  y: i.top - o.top
@@ -420,13 +424,13 @@ function An(t, e, r) {
420
424
  function oe(t) {
421
425
  return t.type === "video" ? !0 : /\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(t.assetId);
422
426
  }
423
- function Rn({
427
+ function En({
424
428
  src: t,
425
- phase: e,
429
+ phase: n,
426
430
  onMediaElement: r,
427
431
  wrapperStyle: o,
428
432
  videoStyle: i,
429
- onLoadedMetadata: a,
433
+ onLoadedMetadata: l,
430
434
  onTransitionEnd: p
431
435
  }) {
432
436
  const s = y(null);
@@ -440,10 +444,10 @@ function Rn({
440
444
  {
441
445
  ref: s,
442
446
  src: t,
443
- controls: e === "open",
447
+ controls: n === "open",
444
448
  playsInline: !0,
445
449
  preload: "auto",
446
- onLoadedMetadata: a,
450
+ onLoadedMetadata: l,
447
451
  onClick: (I) => I.stopPropagation(),
448
452
  style: i
449
453
  },
@@ -452,7 +456,7 @@ function Rn({
452
456
  }
453
457
  function ee({
454
458
  media: t,
455
- style: e,
459
+ style: n,
456
460
  onTransitionEnd: r,
457
461
  onMeasure: o
458
462
  }) {
@@ -463,10 +467,10 @@ function ee({
463
467
  muted: !0,
464
468
  playsInline: !0,
465
469
  preload: "auto",
466
- style: e,
470
+ style: n,
467
471
  onLoadedMetadata: (i) => {
468
- const a = i.currentTarget;
469
- a.videoWidth > 0 && a.videoHeight > 0 && (o == null || o(t.assetId, a.videoWidth, a.videoHeight));
472
+ const l = i.currentTarget;
473
+ l.videoWidth > 0 && l.videoHeight > 0 && (o == null || o(t.assetId, l.videoWidth, l.videoHeight));
470
474
  },
471
475
  onTransitionEnd: r
472
476
  }
@@ -475,22 +479,22 @@ function ee({
475
479
  {
476
480
  src: t.assetId,
477
481
  alt: t.name,
478
- style: e,
482
+ style: n,
479
483
  onLoad: (i) => {
480
- const a = i.currentTarget;
481
- a.naturalWidth > 0 && a.naturalHeight > 0 && (o == null || o(t.assetId, a.naturalWidth, a.naturalHeight));
484
+ const l = i.currentTarget;
485
+ l.naturalWidth > 0 && l.naturalHeight > 0 && (o == null || o(t.assetId, l.naturalWidth, l.naturalHeight));
482
486
  },
483
487
  onTransitionEnd: r
484
488
  }
485
489
  );
486
490
  }
487
- function Cn({
491
+ function Nn({
488
492
  prefix: t,
489
- items: e,
493
+ items: n,
490
494
  index: r,
491
495
  entry: o,
492
496
  settings: i,
493
- isEditor: a,
497
+ isEditor: l,
494
498
  isEditMode: p,
495
499
  isPreviewMode: s,
496
500
  canNavigate: I,
@@ -503,39 +507,39 @@ function Cn({
503
507
  onPrev: tt,
504
508
  onNext: Ft
505
509
  }) {
506
- const Wt = y(null), G = y(null), X = y(null), et = y(/* @__PURE__ */ new Map()), [ut, Bt] = $(0), nt = y(null), rt = y(0), k = y(0), C = y("none"), F = y(!1), yt = y(!1), xt = y(!1), ft = y(null), _ = y(null), St = y(null), ot = y(() => {
507
- }), dt = y(null), ht = y(null), pt = y(null), it = y(!1), [E, $t] = $(null), [N, W] = $(we), [le, ae] = $(0), [g, It] = $("opening"), [q, Lt] = $(0), [f, v] = $(0), [S, j] = $(!1), [O, lt] = $(null), [gt, Tt] = $(null), [Mt, kt] = $(null), [Me, ce] = $(!1), [Ge, Xe] = $(null), [xe, se] = $(!1), Gt = y(!1), [Y, Ht] = $(!1), [qe, $e] = $(!1), be = y(r), Se = y(void 0), d = e[r], Xt = d ? oe(d) : !1, U = f !== 0 || S, ue = !p && (!a || !!s), at = I && !p, mt = b.length > 1, At = w((n, l) => e.length <= 1 ? null : e[(n + l + e.length) % e.length] ?? null, [e]), H = mt ? jt(b, P, -1) : At(r, -1), A = mt ? jt(b, P, 1) : At(r, 1), fe = O === -1 && U ? mt && gt !== null ? jt(b, gt, -1) : Mt !== null ? At(Mt, -1) : null : null, de = O === 1 && U ? mt && gt !== null ? jt(b, gt, 1) : Mt !== null ? At(Mt, 1) : null : null, Ye = fe && fe.assetId !== (H == null ? void 0 : H.assetId) ? fe : null, Ue = de && de.assetId !== (A == null ? void 0 : A.assetId) ? de : null, Ze = H && at ? (() => {
508
- const n = mt ? De(b, P, -1) : e.length > 2 ? At((r - 1 + e.length) % e.length, -1) : null;
509
- return n && n.assetId !== H.assetId ? n : null;
510
- })() : null, Ke = A && at ? (() => {
511
- const n = mt ? De(b, P, 1) : e.length > 2 ? At((r + 1) % e.length, 1) : null;
512
- return n && n.assetId !== A.assetId ? n : null;
513
- })() : null, qt = Ye ?? Ze, Yt = Ue ?? Ke, wt = w((n, l, u) => {
514
- if (!n || !l || !u) return;
515
- const c = et.current, x = c.get(n);
516
- (x == null ? void 0 : x.width) === l && (x == null ? void 0 : x.height) === u || (c.set(n, { width: l, height: u }), Bt((B) => B + 1));
517
- }, []), Rt = w((n) => {
518
- if (!(n != null && n.assetId)) return null;
519
- const l = et.current.get(n.assetId);
520
- return Sn(G.current, l);
521
- }, [ut, le]), Ut = w(() => {
510
+ const Wt = y(null), G = y(null), X = y(null), et = y(/* @__PURE__ */ new Map()), [ut, Mt] = $(0), nt = y(null), rt = y(0), k = y(0), C = y("none"), F = y(!1), yt = y(!1), xt = y(!1), ft = y(null), _ = y(null), St = y(null), ot = y(() => {
511
+ }), dt = y(null), ht = y(null), pt = y(null), it = y(!1), [E, $t] = $(null), [N, W] = $(we), [ae, le] = $(0), [g, It] = $("opening"), [q, Lt] = $(0), [f, v] = $(0), [S, j] = $(!1), [z, at] = $(null), [gt, Tt] = $(null), [Bt, kt] = $(null), [Be, ce] = $(!1), [Ge, Xe] = $(null), [xe, se] = $(!1), Gt = y(!1), [Y, Ht] = $(!1), [qe, $e] = $(!1), be = y(r), Se = y(void 0), d = n[r], Xt = d ? oe(d) : !1, U = f !== 0 || S, ue = !p && (!l || !!s), lt = I && !p, mt = b.length > 1, At = w((e, a) => n.length <= 1 ? null : n[(e + a + n.length) % n.length] ?? null, [n]), H = mt ? jt(b, P, -1) : At(r, -1), A = mt ? jt(b, P, 1) : At(r, 1), fe = z === -1 && U ? mt && gt !== null ? jt(b, gt, -1) : Bt !== null ? At(Bt, -1) : null : null, de = z === 1 && U ? mt && gt !== null ? jt(b, gt, 1) : Bt !== null ? At(Bt, 1) : null : null, Ye = fe && fe.assetId !== (H == null ? void 0 : H.assetId) ? fe : null, Ue = de && de.assetId !== (A == null ? void 0 : A.assetId) ? de : null, Ze = H && lt ? (() => {
512
+ const e = mt ? De(b, P, -1) : n.length > 2 ? At((r - 1 + n.length) % n.length, -1) : null;
513
+ return e && e.assetId !== H.assetId ? e : null;
514
+ })() : null, Ke = A && lt ? (() => {
515
+ const e = mt ? De(b, P, 1) : n.length > 2 ? At((r + 1) % n.length, 1) : null;
516
+ return e && e.assetId !== A.assetId ? e : null;
517
+ })() : null, qt = Ye ?? Ze, Yt = Ue ?? Ke, wt = w((e, a, u) => {
518
+ if (!e || !a || !u) return;
519
+ const c = et.current, x = c.get(e);
520
+ (x == null ? void 0 : x.width) === a && (x == null ? void 0 : x.height) === u || (c.set(e, { width: a, height: u }), Mt((M) => M + 1));
521
+ }, []), Rt = w((e) => {
522
+ if (!(e != null && e.assetId)) return null;
523
+ const a = et.current.get(e.assetId);
524
+ return Ln(G.current, a);
525
+ }, [ut, ae]), Ut = w(() => {
522
526
  if (!d) return;
523
- const n = Rt(d);
524
- if (n) {
525
- $t(n);
527
+ const e = Rt(d);
528
+ if (e) {
529
+ $t(e);
526
530
  return;
527
531
  }
528
- const l = G.current;
529
- l && $t(_e(l));
530
- }, [d, Rt]), Zt = w((n) => {
532
+ const a = G.current;
533
+ a && $t(_e(a));
534
+ }, [d, Rt]), Zt = w((e) => {
531
535
  if (mt) {
532
- const l = b.length;
533
- Tt((P + n + l) % l), kt(null);
536
+ const a = b.length;
537
+ Tt((P + e + a) % a), kt(null);
534
538
  return;
535
539
  }
536
- e.length > 1 && (kt((r + n + e.length) % e.length), Tt(null));
537
- }, [mt, b.length, P, e.length, r]), R = w((n) => {
538
- xt.current = n, j(n);
540
+ n.length > 1 && (kt((r + e + n.length) % n.length), Tt(null));
541
+ }, [mt, b.length, P, n.length, r]), R = w((e) => {
542
+ xt.current = e, j(e);
539
543
  }, []), L = w(() => {
540
544
  ft.current !== null && (window.clearTimeout(ft.current), ft.current = null);
541
545
  }, []), Ie = w(() => {
@@ -543,8 +547,8 @@ function Cn({
543
547
  L(), R(!1);
544
548
  }, _t + 32);
545
549
  }, [L, R]), Le = w(() => {
546
- const n = Wt.current;
547
- if (!n) {
550
+ const e = Wt.current;
551
+ if (!e) {
548
552
  W({
549
553
  left: 0,
550
554
  top: 0,
@@ -553,21 +557,21 @@ function Cn({
553
557
  });
554
558
  return;
555
559
  }
556
- const l = n.getBoundingClientRect();
560
+ const a = e.getBoundingClientRect();
557
561
  W({
558
- left: l.left,
559
- top: l.top,
560
- width: l.width,
561
- height: l.height
562
+ left: a.left,
563
+ top: a.top,
564
+ width: a.width,
565
+ height: a.height
562
566
  });
563
- }, []), Te = w((n, l) => {
567
+ }, []), Te = w((e, a) => {
564
568
  if (U) {
565
569
  if (Y && !S)
566
570
  return `translate(${f}px, 0px)`;
567
- if (S && O !== null) {
568
- const u = Rt(n);
571
+ if (S && z !== null) {
572
+ const u = Rt(e);
569
573
  if (!u) return;
570
- const { x: c, y: x } = Hn(u, l, O, N);
574
+ const { x: c, y: x } = Rn(u, a, z, N);
571
575
  return `translate(${c}px, ${x}px)`;
572
576
  }
573
577
  if (S)
@@ -578,31 +582,31 @@ function Cn({
578
582
  Y,
579
583
  S,
580
584
  f,
581
- O,
585
+ z,
582
586
  N,
583
587
  Rt
584
588
  ]), Ct = w(() => {
585
- const n = _.current;
586
- _.current = null, L(), R(!1), lt(null), Tt(null), kt(null), v(0), Ht(!1), F.current = !1, k.current = 0, C.current = "none", n === -1 ? tt() : n === 1 && Ft();
589
+ const e = _.current;
590
+ _.current = null, L(), R(!1), at(null), Tt(null), kt(null), v(0), Ht(!1), F.current = !1, k.current = 0, C.current = "none", e === -1 ? tt() : e === 1 && Ft();
587
591
  }, [L, R, tt, Ft]), Kt = w(() => {
588
592
  L(), ft.current = window.setTimeout(() => {
589
593
  _.current !== null && Ct();
590
594
  }, _t + 32);
591
595
  }, [L, Ct]), ke = w(() => {
592
- L(), _.current = null, R(!1), lt(null), Tt(null), kt(null), v(0), Ht(!1), F.current = !1, k.current = 0, C.current = "none";
593
- }, [L, R]), He = w((n) => {
594
- if (!(!at || !E)) {
596
+ L(), _.current = null, R(!1), at(null), Tt(null), kt(null), v(0), Ht(!1), F.current = !1, k.current = 0, C.current = "none";
597
+ }, [L, R]), He = w((e) => {
598
+ if (!(!lt || !E)) {
595
599
  if (xt.current) {
596
- if (_.current === n) {
597
- St.current = n, Ct();
600
+ if (_.current === e) {
601
+ St.current = e, Ct();
598
602
  return;
599
603
  }
600
604
  ke();
601
605
  }
602
- L(), Zt(n), _.current = n, lt(n), R(!0), Kt();
606
+ L(), Zt(e), _.current = e, at(e), R(!0), Kt();
603
607
  }
604
608
  }, [
605
- at,
609
+ lt,
606
610
  E,
607
611
  Ct,
608
612
  ke,
@@ -614,95 +618,95 @@ function Cn({
614
618
  ot.current = He;
615
619
  const ct = w(() => {
616
620
  dt.current = null, it.current = !1, ht.current !== null && (window.clearInterval(ht.current), ht.current = null), pt.current !== null && (window.clearTimeout(pt.current), pt.current = null);
617
- }, []), he = w((n) => {
621
+ }, []), he = w((e) => {
618
622
  ht.current !== null && window.clearInterval(ht.current);
619
- const l = it.current ? wn : mn;
623
+ const a = it.current ? yn : vn;
620
624
  ht.current = window.setInterval(() => {
621
- ot.current(n);
622
- }, l);
623
- }, []), Ae = w((n) => {
624
- dt.current !== n && (ct(), dt.current = n, it.current = !1, ot.current(n), he(n), pt.current = window.setTimeout(() => {
625
- pt.current = null, dt.current === n && (it.current = !0, he(n));
626
- }, gn));
625
+ ot.current(e);
626
+ }, a);
627
+ }, []), Ae = w((e) => {
628
+ dt.current !== e && (ct(), dt.current = e, it.current = !1, ot.current(e), he(e), pt.current = window.setTimeout(() => {
629
+ pt.current = null, dt.current === e && (it.current = !0, he(e));
630
+ }, wn));
627
631
  }, [ct, he]), Z = w(() => {
628
- const n = G.current;
629
- if (!n) return;
630
- const l = d == null ? void 0 : d.assetId, u = l ? et.current.get(l) : void 0;
632
+ const e = G.current;
633
+ if (!e) return;
634
+ const a = d == null ? void 0 : d.assetId, u = a ? et.current.get(a) : void 0;
631
635
  if (u != null && u.width && (u != null && u.height)) {
632
- $t(ye(n, u.width, u.height));
636
+ $t(ye(e, u.width, u.height));
633
637
  return;
634
638
  }
635
639
  const c = X.current;
636
- if (c && l && (c.src === l || c.currentSrc === l)) {
637
- const { width: B, height: m } = bn(c);
638
- if (B && m) {
639
- wt(l, B, m), $t(ye(n, B, m));
640
+ if (c && a && (c.src === a || c.currentSrc === a)) {
641
+ const { width: M, height: m } = In(c);
642
+ if (M && m) {
643
+ wt(a, M, m), $t(ye(e, M, m));
640
644
  return;
641
645
  }
642
646
  }
643
- const x = _e(n);
647
+ const x = _e(e);
644
648
  !x.width || !x.height || $t(x);
645
- }, [d == null ? void 0 : d.assetId, wt]), Re = w((n) => {
646
- if (X.current = n, !!n) {
647
- if (n instanceof HTMLVideoElement) {
648
- n.readyState >= 1 && n.videoWidth > 0 && Z();
649
+ }, [d == null ? void 0 : d.assetId, wt]), Re = w((e) => {
650
+ if (X.current = e, !!e) {
651
+ if (e instanceof HTMLVideoElement) {
652
+ e.readyState >= 1 && e.videoWidth > 0 && Z();
649
653
  return;
650
654
  }
651
- n.complete && n.naturalWidth > 0 && Z();
655
+ e.complete && e.naturalWidth > 0 && Z();
652
656
  }
653
- }, [Z]), Ot = w(() => {
654
- Le(), Z(), ae((n) => n + 1);
657
+ }, [Z]), zt = w(() => {
658
+ Le(), Z(), le((e) => e + 1);
655
659
  }, [Le, Z]);
656
660
  D(() => {
657
- Ot();
658
- const n = G.current, l = Wt.current, u = new ResizeObserver(() => Ot());
659
- return n && u.observe(n), l && u.observe(l), window.addEventListener("resize", Ot), () => {
660
- u.disconnect(), window.removeEventListener("resize", Ot);
661
+ zt();
662
+ const e = G.current, a = Wt.current, u = new ResizeObserver(() => zt());
663
+ return e && u.observe(e), a && u.observe(a), window.addEventListener("resize", zt), () => {
664
+ u.disconnect(), window.removeEventListener("resize", zt);
661
665
  };
662
- }, [Ot, r, ie]), Pt(() => {
666
+ }, [zt, r, ie]), Pt(() => {
663
667
  if (!d) return;
664
- const n = X.current;
665
- if (n) {
666
- if (n instanceof HTMLImageElement && n.complete && n.naturalWidth > 0) {
668
+ const e = X.current;
669
+ if (e) {
670
+ if (e instanceof HTMLImageElement && e.complete && e.naturalWidth > 0) {
667
671
  Z();
668
672
  return;
669
673
  }
670
- n instanceof HTMLVideoElement && n.readyState >= 1 && n.videoWidth > 0 && Z();
674
+ e instanceof HTMLVideoElement && e.readyState >= 1 && e.videoWidth > 0 && Z();
671
675
  }
672
676
  }, [d == null ? void 0 : d.assetId, r, Z]), D(() => {
673
677
  Ut();
674
678
  }, [Ut, ut]), D(() => {
675
- const n = /* @__PURE__ */ new Set(), l = [], u = (c) => {
676
- !(c != null && c.assetId) || n.has(c.assetId) || (n.add(c.assetId), l.push(c));
679
+ const e = /* @__PURE__ */ new Set(), a = [], u = (c) => {
680
+ !(c != null && c.assetId) || e.has(c.assetId) || (e.add(c.assetId), a.push(c));
677
681
  };
678
- e.forEach(u), b.forEach((c) => c.items.forEach(u)), l.forEach((c) => {
679
- et.current.has(c.assetId) || In(c, wt);
682
+ n.forEach(u), b.forEach((c) => c.items.forEach(u)), a.forEach((c) => {
683
+ et.current.has(c.assetId) || Tn(c, wt);
680
684
  });
681
- }, [e, b, wt]), D(() => {
685
+ }, [n, b, wt]), D(() => {
682
686
  if (g !== "opening" || !E) return;
683
687
  if (!st) {
684
688
  It("open");
685
689
  return;
686
690
  }
687
691
  ce(!1);
688
- const n = requestAnimationFrame(() => {
692
+ const e = requestAnimationFrame(() => {
689
693
  requestAnimationFrame(() => {
690
694
  ce(!0), It("open");
691
695
  });
692
696
  });
693
- return () => cancelAnimationFrame(n);
697
+ return () => cancelAnimationFrame(e);
694
698
  }, [g, E, st]), D(() => {
695
699
  if (g !== "closing") return;
696
- const n = setTimeout(() => Vt(), Q);
697
- return () => clearTimeout(n);
700
+ const e = setTimeout(() => Vt(), Q);
701
+ return () => clearTimeout(e);
698
702
  }, [g, Vt]), D(() => () => {
699
703
  L();
700
704
  }, [L]), Pt(() => {
701
- be.current === r && Se.current === (d == null ? void 0 : d.assetId) || (L(), _.current = null, lt(null), Tt(null), kt(null), Lt(0), v(0), R(!1), $e(!1), Ht(!1), rt.current = 0, k.current = 0, C.current = "none", F.current = !1, nt.current = null, yt.current = !1, X.current = null, Ut(), be.current = r, Se.current = d == null ? void 0 : d.assetId);
705
+ be.current === r && Se.current === (d == null ? void 0 : d.assetId) || (L(), _.current = null, at(null), Tt(null), kt(null), Lt(0), v(0), R(!1), $e(!1), Ht(!1), rt.current = 0, k.current = 0, C.current = "none", F.current = !1, nt.current = null, yt.current = !1, X.current = null, Ut(), be.current = r, Se.current = d == null ? void 0 : d.assetId);
702
706
  }, [r, d == null ? void 0 : d.assetId, R, L, Ut]), Pt(() => {
703
- const n = St.current;
704
- n !== null && (St.current = null, requestAnimationFrame(() => {
705
- ot.current(n);
707
+ const e = St.current;
708
+ e !== null && (St.current = null, requestAnimationFrame(() => {
709
+ ot.current(e);
706
710
  }));
707
711
  }, [r, P, d == null ? void 0 : d.assetId]), Pt(() => {
708
712
  if (g === "opening") {
@@ -715,28 +719,28 @@ function Cn({
715
719
  return;
716
720
  }
717
721
  se(!1);
718
- const n = requestAnimationFrame(() => {
722
+ const e = requestAnimationFrame(() => {
719
723
  requestAnimationFrame(() => {
720
724
  se(!0), Gt.current = !0;
721
725
  });
722
726
  });
723
- return () => cancelAnimationFrame(n);
727
+ return () => cancelAnimationFrame(e);
724
728
  }, [g, H == null ? void 0 : H.assetId, A == null ? void 0 : A.assetId]), D(() => {
725
729
  if (g !== "open") return;
726
- const n = () => {
730
+ const e = () => {
727
731
  const m = (T) => {
728
732
  T.stopPropagation(), T.preventDefault(), document.removeEventListener("click", m, !0);
729
733
  };
730
734
  document.addEventListener("click", m, !0);
731
- }, l = (m) => {
735
+ }, a = (m) => {
732
736
  const T = m < 0 ? 1 : -1;
733
- L(), Zt(T), _.current = T, lt(T), R(!0), Kt();
737
+ L(), Zt(T), _.current = T, at(T), R(!0), Kt();
734
738
  }, u = (m) => {
735
- if (Math.abs(m) > pn && at) {
736
- l(m);
739
+ if (Math.abs(m) > mn && lt) {
740
+ a(m);
737
741
  return;
738
742
  }
739
- _.current = null, lt(null), Tt(null), kt(null), R(!0), v(0), Ie();
743
+ _.current = null, at(null), Tt(null), kt(null), R(!0), v(0), Ie();
740
744
  }, c = (m) => {
741
745
  if (m.touches.length !== 1 || xt.current) return;
742
746
  const T = m.touches[0];
@@ -747,7 +751,7 @@ function Cn({
747
751
  if (C.current === "none") {
748
752
  if (Math.abs(K) < 10 && Math.abs(J) < 10) return;
749
753
  if (Math.abs(K) > Math.abs(J)) {
750
- if (!at) return;
754
+ if (!lt) return;
751
755
  C.current = "horizontal";
752
756
  } else if (J > 0) {
753
757
  if (!ue) return;
@@ -760,57 +764,57 @@ function Cn({
760
764
  return;
761
765
  }
762
766
  C.current === "vertical" && (F.current = !0, Ht(!0), rt.current = J, Lt(J), m.preventDefault());
763
- }, B = () => {
767
+ }, M = () => {
764
768
  if (!nt.current) return;
765
769
  const m = C.current, T = F.current;
766
770
  if (T && m === "horizontal")
767
- u(k.current), n();
771
+ u(k.current), e();
768
772
  else if (T && m === "vertical") {
769
773
  const K = rt.current;
770
- if (ue && K > hn) {
774
+ if (ue && K > gn) {
771
775
  const J = window.innerHeight;
772
776
  rt.current = J, $e(!0), Lt(J), It("closing");
773
777
  } else
774
778
  rt.current = 0, Lt(0);
775
- n();
776
- } else m === "horizontal" && Math.abs(k.current) > 0 && (u(k.current), n());
779
+ e();
780
+ } else m === "horizontal" && Math.abs(k.current) > 0 && (u(k.current), e());
777
781
  nt.current = null, C.current = "none", k.current = 0, F.current = !1, Ht(!1);
778
782
  };
779
- return document.addEventListener("touchstart", c, { passive: !0 }), document.addEventListener("touchmove", x, { passive: !1 }), document.addEventListener("touchend", B), document.addEventListener("touchcancel", B), () => {
780
- document.removeEventListener("touchstart", c), document.removeEventListener("touchmove", x), document.removeEventListener("touchend", B), document.removeEventListener("touchcancel", B);
783
+ return document.addEventListener("touchstart", c, { passive: !0 }), document.addEventListener("touchmove", x, { passive: !1 }), document.addEventListener("touchend", M), document.addEventListener("touchcancel", M), () => {
784
+ document.removeEventListener("touchstart", c), document.removeEventListener("touchmove", x), document.removeEventListener("touchend", M), document.removeEventListener("touchcancel", M);
781
785
  };
782
- }, [g, at, R, Ie, L, ue, Kt, Zt]);
786
+ }, [g, lt, R, Ie, L, ue, Kt, Zt]);
783
787
  const pe = w(() => {
784
- const n = (vt == null ? void 0 : vt()) ?? st ?? null;
785
- n && E && (Xe(n), ce(!0)), It("closing");
788
+ const e = (vt == null ? void 0 : vt()) ?? st ?? null;
789
+ e && E && (Xe(e), ce(!0)), It("closing");
786
790
  }, [vt, st, E]);
787
791
  D(() => {
788
- const n = (c) => {
792
+ const e = (c) => {
789
793
  if (c.key === "Escape") {
790
- if (a && s || g === "closing") return;
794
+ if (l && s || g === "closing") return;
791
795
  ct(), pe();
792
796
  return;
793
797
  }
794
- if (c.key !== "ArrowLeft" && c.key !== "ArrowRight" || g !== "open" || !at) return;
798
+ if (c.key !== "ArrowLeft" && c.key !== "ArrowRight" || g !== "open" || !lt) return;
795
799
  c.preventDefault();
796
800
  const x = c.key === "ArrowLeft" ? -1 : 1;
797
801
  c.repeat && dt.current === x || Ae(x);
798
- }, l = (c) => {
802
+ }, a = (c) => {
799
803
  if (c.key !== "ArrowLeft" && c.key !== "ArrowRight") return;
800
804
  const x = c.key === "ArrowLeft" ? -1 : 1;
801
805
  dt.current === x && ct();
802
806
  }, u = () => {
803
807
  ct();
804
808
  };
805
- return window.addEventListener("keydown", n), window.addEventListener("keyup", l), window.addEventListener("blur", u), () => {
806
- window.removeEventListener("keydown", n), window.removeEventListener("keyup", l), window.removeEventListener("blur", u), ct();
809
+ return window.addEventListener("keydown", e), window.addEventListener("keyup", a), window.addEventListener("blur", u), () => {
810
+ window.removeEventListener("keydown", e), window.removeEventListener("keyup", a), window.removeEventListener("blur", u), ct();
807
811
  };
808
812
  }, [
809
813
  g,
810
- a,
814
+ l,
811
815
  s,
812
816
  pe,
813
- at,
817
+ lt,
814
818
  Ae,
815
819
  ct
816
820
  ]), D(() => {
@@ -818,15 +822,15 @@ function Cn({
818
822
  }, [g, ct]);
819
823
  const Ce = () => {
820
824
  g === "closing" || p || pe();
821
- }, z = g === "open", Jt = g === "closing", Je = q > 0 ? Math.max(0, 1 - q / 500) : 1, Qe = q > 0 ? Math.max(0.35, 1 - q / 500) : 1, Et = w((n) => {
822
- if (!(n.propertyName !== "transform" || !xt.current)) {
825
+ }, O = g === "open", Jt = g === "closing", Je = q > 0 ? Math.max(0, 1 - q / 500) : 1, Qe = q > 0 ? Math.max(0.35, 1 - q / 500) : 1, Et = w((e) => {
826
+ if (!(e.propertyName !== "transform" || !xt.current)) {
823
827
  if (_.current !== null) {
824
828
  Ct();
825
829
  return;
826
830
  }
827
831
  L(), R(!1);
828
832
  }
829
- }, [L, R, Ct]), ge = g === "closing" ? Ge ?? st : st, Pe = ge && E && (g === "opening" || Jt) ? vn(ge, E) : void 0, tn = U && d ? Te(d, "center") : q > 0 ? `translateY(${q}px)` : Pe, V = E ? te(E, N) : null, Ee = !!(ge && E), en = Ee && (g === "closing" || g === "open" && Me), Ne = {
833
+ }, [L, R, Ct]), ge = g === "closing" ? Ge ?? st : st, Pe = ge && E && (g === "opening" || Jt) ? xn(ge, E) : void 0, tn = U && d ? Te(d, "center") : q > 0 ? `translateY(${q}px)` : Pe, V = E ? te(E, N) : null, Ee = !!(ge && E), en = Ee && (g === "closing" || g === "open" && Be), Ne = {
830
834
  position: "absolute",
831
835
  top: V == null ? void 0 : V.top,
832
836
  left: V == null ? void 0 : V.left,
@@ -836,9 +840,9 @@ function Cn({
836
840
  transformOrigin: "top left",
837
841
  transform: tn,
838
842
  opacity: q > 0 ? Qe : Ee ? 1 : g === "opening" || Jt ? 0 : 1,
839
- transition: Y && !S ? "none" : S ? `transform ${_t}ms ${M}` : qe ? `transform ${Q}ms ${M}, opacity ${Q}ms ${M}` : en ? `transform ${Q}ms ${M}` : g === "opening" || Jt ? `opacity ${Q}ms ${M}` : "none",
840
- pointerEvents: Xt && z && !U ? "auto" : "none",
841
- touchAction: Xt && z ? "none" : void 0,
843
+ transition: Y && !S ? "none" : S ? `transform ${_t}ms ${B}` : qe ? `transform ${Q}ms ${B}, opacity ${Q}ms ${B}` : en ? `transform ${Q}ms ${B}` : g === "opening" || Jt ? `opacity ${Q}ms ${B}` : "none",
844
+ pointerEvents: Xt && O && !U ? "auto" : "none",
845
+ touchAction: Xt && O ? "none" : void 0,
842
846
  zIndex: 1,
843
847
  overflow: Xt ? "hidden" : void 0
844
848
  }, nn = {
@@ -846,13 +850,13 @@ function Cn({
846
850
  height: "100%",
847
851
  display: "block",
848
852
  objectFit: "contain",
849
- pointerEvents: z && !U ? "auto" : "none"
850
- }, Qt = (n, l, u = "adjacent") => {
851
- const c = Rt(n);
853
+ pointerEvents: O && !U ? "auto" : "none"
854
+ }, Qt = (e, a, u = "adjacent") => {
855
+ const c = Rt(e);
852
856
  if (!c) return { display: "none" };
853
- const x = u === "far" ? l === "left" ? "far-left" : "far-right" : l === "left" ? "left-adjacent" : "right-adjacent", { start: B } = O !== null ? Be(c, x, O, N) : {
854
- start: u === "far" ? re(c, l, N) : Nt(c, l, N)
855
- }, m = te(B, N), T = Te(n, x), K = !U && u === "adjacent" && z && !xe ? An(c, l, N) : null, J = u === "far" && U && O === (l === "left" ? -1 : 1), rn = Y && !S ? !1 : S, on = u === "adjacent" && z && xe && !U;
857
+ const x = u === "far" ? a === "left" ? "far-left" : "far-right" : a === "left" ? "left-adjacent" : "right-adjacent", { start: M } = z !== null ? Me(c, x, z, N) : {
858
+ start: u === "far" ? re(c, a, N) : Nt(c, a, N)
859
+ }, m = te(M, N), T = Te(e, x), K = !U && u === "adjacent" && O && !xe ? Cn(c, a, N) : null, J = u === "far" && U && z === (a === "left" ? -1 : 1), rn = Y && !S ? !1 : S, on = u === "adjacent" && O && xe && !U;
856
860
  return {
857
861
  position: "absolute",
858
862
  top: m.top,
@@ -861,30 +865,30 @@ function Cn({
861
865
  height: m.height,
862
866
  objectFit: "contain",
863
867
  transform: T ?? (K ? `translate(${K.x}px, ${K.y}px)` : void 0),
864
- opacity: u === "far" ? z && J ? 1 : 0 : z ? 1 : 0,
865
- transition: rn ? u === "far" ? `transform ${_t}ms ${M}` : `transform ${_t}ms ${M}, opacity ${Q}ms ${M}` : on ? `transform ${Q}ms ${M}` : g === "opening" || Jt ? `opacity ${Q}ms ${M}` : "none",
868
+ opacity: u === "far" ? O && J ? 1 : 0 : O ? 1 : 0,
869
+ transition: rn ? u === "far" ? `transform ${_t}ms ${B}` : `transform ${_t}ms ${B}, opacity ${Q}ms ${B}` : on ? `transform ${Q}ms ${B}` : g === "opening" || Jt ? `opacity ${Q}ms ${B}` : "none",
866
870
  pointerEvents: "none",
867
871
  zIndex: 1
868
872
  };
869
- }, Fe = (n, l) => {
870
- const u = Rt(n);
871
- return u ? kn(Nt(u, l, N), l, N) : null;
872
- }, We = (n) => (l) => {
873
+ }, Fe = (e, a) => {
874
+ const u = Rt(e);
875
+ return u ? An(Nt(u, a, N), a, N) : null;
876
+ }, We = (e) => (a) => {
873
877
  if (!p) {
874
878
  if (yt.current) {
875
879
  yt.current = !1;
876
880
  return;
877
881
  }
878
- l.stopPropagation(), He(n);
882
+ a.stopPropagation(), He(e);
879
883
  }
880
- }, Oe = H ? Fe(H, "left") : null, ze = A ? Fe(A, "right") : null, zt = Oe ? te(Oe, N) : null, Dt = ze ? te(ze, N) : null;
884
+ }, ze = H ? Fe(H, "left") : null, Oe = A ? Fe(A, "right") : null, Ot = ze ? te(ze, N) : null, Dt = Oe ? te(Oe, N) : null;
881
885
  return /* @__PURE__ */ bt(
882
886
  "div",
883
887
  {
884
888
  ref: Wt,
885
889
  className: [
886
890
  `${t}-lightbox`,
887
- a ? `${t}-lightbox-editor` : "",
891
+ l ? `${t}-lightbox-editor` : "",
888
892
  p ? `${t}-lightbox-edit-mode` : ""
889
893
  ].filter(Boolean).join(" "),
890
894
  style: {
@@ -899,8 +903,8 @@ function Cn({
899
903
  position: "absolute",
900
904
  inset: 0,
901
905
  background: i.backgroundColor ?? "#FFFFFF",
902
- opacity: z ? Je : 0,
903
- transition: Y ? "none" : `opacity ${Q}ms ${M}`,
906
+ opacity: O ? Je : 0,
907
+ transition: Y ? "none" : `opacity ${Q}ms ${B}`,
904
908
  pointerEvents: "none"
905
909
  }
906
910
  }
@@ -943,17 +947,17 @@ function Cn({
943
947
  style: {
944
948
  position: "absolute",
945
949
  inset: 0,
946
- opacity: z ? 1 : 0,
947
- transition: Y ? "none" : `opacity ${Q}ms ${M}`,
950
+ opacity: O ? 1 : 0,
951
+ transition: Y ? "none" : `opacity ${Q}ms ${B}`,
948
952
  pointerEvents: "none"
949
953
  },
950
954
  children: /* @__PURE__ */ h(
951
- fn,
955
+ hn,
952
956
  {
953
957
  prefix: t,
954
958
  entry: o,
955
959
  settings: i,
956
- isEditor: a,
960
+ isEditor: l,
957
961
  isEditMode: p,
958
962
  isPreviewMode: s,
959
963
  onClose: Ce
@@ -962,7 +966,7 @@ function Cn({
962
966
  }
963
967
  )
964
968
  ] }),
965
- z && qt && /* @__PURE__ */ h(
969
+ O && qt && /* @__PURE__ */ h(
966
970
  ee,
967
971
  {
968
972
  media: qt,
@@ -972,7 +976,7 @@ function Cn({
972
976
  },
973
977
  `far-prev-${qt.assetId}`
974
978
  ),
975
- z && H && /* @__PURE__ */ bt(ve, { children: [
979
+ O && H && /* @__PURE__ */ bt(ve, { children: [
976
980
  /* @__PURE__ */ h(
977
981
  ee,
978
982
  {
@@ -983,15 +987,15 @@ function Cn({
983
987
  },
984
988
  `prev-${H.assetId}`
985
989
  ),
986
- zt && /* @__PURE__ */ h(
990
+ Ot && /* @__PURE__ */ h(
987
991
  "div",
988
992
  {
989
993
  style: {
990
994
  position: "absolute",
991
- top: zt.top,
992
- left: zt.left,
993
- width: zt.width,
994
- height: zt.height,
995
+ top: Ot.top,
996
+ left: Ot.left,
997
+ width: Ot.width,
998
+ height: Ot.height,
995
999
  cursor: p || Y ? "default" : "pointer",
996
1000
  pointerEvents: p || Y ? "none" : "auto",
997
1001
  zIndex: 3
@@ -1000,7 +1004,7 @@ function Cn({
1000
1004
  }
1001
1005
  )
1002
1006
  ] }),
1003
- z && A && /* @__PURE__ */ bt(ve, { children: [
1007
+ O && A && /* @__PURE__ */ bt(ve, { children: [
1004
1008
  /* @__PURE__ */ h(
1005
1009
  ee,
1006
1010
  {
@@ -1028,7 +1032,7 @@ function Cn({
1028
1032
  }
1029
1033
  )
1030
1034
  ] }),
1031
- z && Yt && /* @__PURE__ */ h(
1035
+ O && Yt && /* @__PURE__ */ h(
1032
1036
  ee,
1033
1037
  {
1034
1038
  media: Yt,
@@ -1039,7 +1043,7 @@ function Cn({
1039
1043
  `far-next-${Yt.assetId}`
1040
1044
  ),
1041
1045
  E && d && (Xt ? /* @__PURE__ */ h(
1042
- Rn,
1046
+ En,
1043
1047
  {
1044
1048
  src: d.assetId,
1045
1049
  phase: g,
@@ -1066,8 +1070,8 @@ function Cn({
1066
1070
  }
1067
1071
  );
1068
1072
  }
1069
- const En = 20, Nn = 0.18;
1070
- function Fn(t) {
1073
+ const Fn = 20, Wn = 0.18;
1074
+ function zn(t) {
1071
1075
  return `
1072
1076
  .${t}-wrapper {
1073
1077
  box-sizing: border-box;
@@ -1155,26 +1159,26 @@ function Fn(t) {
1155
1159
  z-index: 2;
1156
1160
  pointer-events: auto;
1157
1161
  }
1158
- ${dn(t)}
1162
+ ${pn(t)}
1159
1163
  `;
1160
1164
  }
1161
- function Wn(t) {
1162
- const { imageDisplay: e } = t ?? {}, r = (e == null ? void 0 : e.ratioValue) ?? "1:1", o = (e == null ? void 0 : e.reversed) ?? !1, [i, a] = r.split(":").map(Number), p = o ? a : i, s = o ? i : a;
1165
+ function On(t) {
1166
+ const { imageDisplay: n } = t ?? {}, r = (n == null ? void 0 : n.ratioValue) ?? "1:1", o = (n == null ? void 0 : n.reversed) ?? !1, [i, l] = r.split(":").map(Number), p = o ? l : i, s = o ? i : l;
1163
1167
  return s > 0 ? p / s : 1;
1164
1168
  }
1165
- function On(t) {
1166
- const e = t instanceof HTMLVideoElement ? t.videoWidth : t.naturalWidth, r = t instanceof HTMLVideoElement ? t.videoHeight : t.naturalHeight;
1167
- return !e || !r ? null : e / r;
1169
+ function Dn(t) {
1170
+ const n = t instanceof HTMLVideoElement ? t.videoWidth : t.naturalWidth, r = t instanceof HTMLVideoElement ? t.videoHeight : t.naturalHeight;
1171
+ return !n || !r ? null : n / r;
1168
1172
  }
1169
- function zn(t, e, r) {
1173
+ function _n(t, n, r) {
1170
1174
  const o = (t == null ? void 0 : t.titleFontSize) ?? 0.07, i = (t == null ? void 0 : t.titleLineHeight) ?? o;
1171
1175
  return {
1172
- [`--${e}-line-height`]: ne(i, r ?? !1),
1173
- [`--${e}-image-inline-gap`]: ne(o * Nn, r ?? !1),
1174
- [`--${e}-image-aspect`]: Wn(t)
1176
+ [`--${n}-line-height`]: ne(i, r ?? !1),
1177
+ [`--${n}-image-inline-gap`]: ne(o * Wn, r ?? !1),
1178
+ [`--${n}-image-aspect`]: On(t)
1175
1179
  };
1176
1180
  }
1177
- function Dn(t, e) {
1181
+ function jn(t, n) {
1178
1182
  var o, i;
1179
1183
  const r = {
1180
1184
  fontSettings: {
@@ -1189,48 +1193,48 @@ function Dn(t, e) {
1189
1193
  textAppearance: t == null ? void 0 : t.titleTextAppearance,
1190
1194
  color: (t == null ? void 0 : t.titleColor) ?? "#000000"
1191
1195
  };
1192
- return un(r, e);
1196
+ return fn(r, n);
1193
1197
  }
1194
- function _n(t) {
1198
+ function Vn(t) {
1195
1199
  var i;
1196
- const e = ((i = t == null ? void 0 : t.imageDisplay) == null ? void 0 : i.display) === "cover", r = ((t == null ? void 0 : t.lightbox) ?? "on") === "on", o = {
1197
- objectFit: e ? "cover" : "contain",
1200
+ const n = ((i = t == null ? void 0 : t.imageDisplay) == null ? void 0 : i.display) === "cover", r = ((t == null ? void 0 : t.lightbox) ?? "on") === "on", o = {
1201
+ objectFit: n ? "cover" : "contain",
1198
1202
  pointerEvents: "auto",
1199
1203
  ...r ? { cursor: "pointer" } : null
1200
1204
  };
1201
1205
  return {
1202
- objectFitMode: e ? "cover" : "contain",
1206
+ objectFitMode: n ? "cover" : "contain",
1203
1207
  imageStyle: o
1204
1208
  };
1205
1209
  }
1206
- function jn(t, e, r, o, i, a) {
1207
- if (!(!t || !e))
1210
+ function Mn(t, n, r, o, i, l) {
1211
+ if (!(!t || !n))
1208
1212
  return (p) => {
1209
1213
  var I;
1210
1214
  const s = ((I = p.currentTarget.closest(`.${o}-item`)) == null ? void 0 : I.querySelector(
1211
1215
  `[data-waterfall-index="${r}"]`
1212
1216
  )) ?? (p.currentTarget instanceof HTMLImageElement || p.currentTarget instanceof HTMLVideoElement ? p.currentTarget : null);
1213
- a(
1217
+ l(
1214
1218
  r,
1215
1219
  s ? je(s, i) : void 0
1216
1220
  );
1217
1221
  };
1218
1222
  }
1219
- function Zn({
1223
+ function Pn({
1220
1224
  settings: t,
1221
- content: e,
1225
+ content: n,
1222
1226
  isEditor: r,
1223
1227
  isPreviewMode: o,
1224
1228
  isEditMode: i,
1225
- layoutId: a,
1229
+ layoutId: l,
1226
1230
  portalId: p
1227
1231
  }) {
1228
- const { prefix: s } = sn(), I = me(() => Fn(s), [s]), b = e ?? [], P = (t == null ? void 0 : t.type) ?? "a", ie = typeof (t == null ? void 0 : t.wrapperWidth) == "number" ? t.wrapperWidth : 1, st = typeof (t == null ? void 0 : t.horizontalGap) == "number" ? t.horizontalGap : 0, vt = ne(st, r ?? !1), Vt = `max(${vt}, ${En}px)`, { objectFitMode: tt, imageStyle: Ft } = _n(t), Wt = Dn(t, r), G = y(null), [X, et] = $(!1), [ut, Bt] = $([]), [nt, rt] = $(0), [k, C] = $(0), [F, yt] = $(null), [xt, ft] = $({ title1: "", title2: "", title3: "" }), _ = (!r || o) && !X, St = (t == null ? void 0 : t.imageHoverEffect) ?? { sizeType: "none", value: 120 }, ot = St.sizeType ?? "none", dt = _ && ot !== "none" ? `${s}-item-image-hover-${ot}` : void 0, ht = (St.value ?? 120) / 100, pt = w((f) => {
1232
+ const { prefix: s } = sn(), I = me(() => zn(s), [s]), b = n ?? [], P = (t == null ? void 0 : t.type) ?? "a", ie = typeof (t == null ? void 0 : t.wrapperWidth) == "number" ? t.wrapperWidth : 1, st = typeof (t == null ? void 0 : t.horizontalGap) == "number" ? t.horizontalGap : 0, vt = ne(st, r ?? !1), Vt = `max(${vt}, ${Fn}px)`, { objectFitMode: tt, imageStyle: Ft } = Vn(t), Wt = jn(t, r), G = y(null), [X, et] = $(!1), [ut, Mt] = $([]), [nt, rt] = $(0), [k, C] = $(0), [F, yt] = $(null), [xt, ft] = $({ title1: "", title2: "", title3: "" }), _ = (!r || o) && !X, St = (t == null ? void 0 : t.imageHoverEffect) ?? { sizeType: "none", value: 120 }, ot = St.sizeType ?? "none", dt = _ && ot !== "none" ? `${s}-item-image-hover-${ot}` : void 0, ht = (St.value ?? 120) / 100, pt = w((f) => {
1229
1233
  !f || ot !== "scale" || (f.style.transformOrigin = cn(f));
1230
1234
  }, [ot]), it = w((f) => {
1231
1235
  if (f) {
1232
1236
  if (tt === "contain") {
1233
- const v = On(f);
1237
+ const v = Dn(f);
1234
1238
  if (v) {
1235
1239
  const S = f.closest(`.${s}-item-image`);
1236
1240
  S instanceof HTMLElement && S.style.setProperty(`--${s}-item-media-aspect`, String(v));
@@ -1241,26 +1245,26 @@ function Zn({
1241
1245
  }, [s, pt, tt]), E = {
1242
1246
  width: ne(ie, r ?? !1),
1243
1247
  ...Wt,
1244
- ...zn(t, s, r),
1248
+ ..._n(t, s, r),
1245
1249
  [`--${s}-image-hover-scale`]: String(ht)
1246
1250
  }, $t = (() => {
1247
1251
  const f = {}, v = G.current ? getComputedStyle(G.current).getPropertyValue("--cntrl-article-width").trim() : "";
1248
1252
  return v && (f["--cntrl-article-width"] = v), f;
1249
- })(), N = ((t == null ? void 0 : t.lightbox) ?? "on") === "on" && (!r || o || i), W = me(() => xn(b), [b]), le = me(() => Ln(b), [b]), ae = (f, v) => {
1253
+ })(), N = ((t == null ? void 0 : t.lightbox) ?? "on") === "on" && (!r || o || i), W = me(() => bn(b), [b]), ae = me(() => kn(b), [b]), le = (f, v) => {
1250
1254
  if (((t == null ? void 0 : t.lightbox) ?? "on") === "off" || r && !i && !o) return;
1251
- const S = W.findIndex((O) => O.gridIndex === f);
1255
+ const S = W.findIndex((z) => z.gridIndex === f);
1252
1256
  if (S < 0) return;
1253
1257
  const j = W[S];
1254
- C(S), Bt(j.items), rt(0), ft(j.entry), yt(v ?? null), et(!0);
1258
+ C(S), Mt(j.items), rt(0), ft(j.entry), yt(v ?? null), et(!0);
1255
1259
  }, g = w(() => {
1256
1260
  et(!1), yt(null);
1257
1261
  }, []), It = w(() => {
1258
1262
  const f = W[k];
1259
- return !f || !G.current ? F : yn(G.current, f.gridIndex, tt) ?? F;
1263
+ return !f || !G.current ? F : $n(G.current, f.gridIndex, tt) ?? F;
1260
1264
  }, [W, k, F, tt]), q = w((f) => {
1261
1265
  if (W.length > 1) {
1262
1266
  const v = W.length, S = (k + f + v) % v, j = W[S];
1263
- C(S), Bt(j.items), rt(0), ft(j.entry);
1267
+ C(S), Mt(j.items), rt(0), ft(j.entry);
1264
1268
  return;
1265
1269
  }
1266
1270
  rt((v) => (v + f + ut.length) % ut.length);
@@ -1277,16 +1281,16 @@ function Zn({
1277
1281
  ((t == null ? void 0 : t.lightbox) ?? "on") === "off" && et(!1);
1278
1282
  }, [t == null ? void 0 : t.lightbox]), /* @__PURE__ */ bt(ve, { children: [
1279
1283
  /* @__PURE__ */ h("style", { dangerouslySetInnerHTML: { __html: I } }),
1280
- /* @__PURE__ */ h(Tn, { mediaList: le }),
1284
+ /* @__PURE__ */ h(Hn, { mediaList: ae }),
1281
1285
  /* @__PURE__ */ h("div", { ref: G, className: `${s}-wrapper ${s}-type-${P}`, style: E, children: b.map((f, v) => {
1282
- var O, lt;
1283
- const S = !!((O = f.image) != null && O.assetId), j = jn(
1286
+ var z, at;
1287
+ const S = !!((z = f.image) != null && z.assetId), j = Mn(
1284
1288
  !!N,
1285
1289
  S,
1286
1290
  v,
1287
1291
  s,
1288
1292
  tt,
1289
- ae
1293
+ le
1290
1294
  );
1291
1295
  return /* @__PURE__ */ bt(
1292
1296
  "div",
@@ -1302,7 +1306,7 @@ function Zn({
1302
1306
  children: f.title
1303
1307
  }
1304
1308
  ) : null,
1305
- (lt = f.image) != null && lt.assetId ? /* @__PURE__ */ h(
1309
+ (at = f.image) != null && at.assetId ? /* @__PURE__ */ h(
1306
1310
  "span",
1307
1311
  {
1308
1312
  className: [
@@ -1311,7 +1315,7 @@ function Zn({
1311
1315
  dt
1312
1316
  ].filter(Boolean).join(" "),
1313
1317
  children: f.image.type === "video" ? /* @__PURE__ */ h(
1314
- "video",
1318
+ un,
1315
1319
  {
1316
1320
  ref: it,
1317
1321
  src: f.image.assetId,
@@ -1322,7 +1326,7 @@ function Zn({
1322
1326
  loop: !0,
1323
1327
  autoPlay: !0,
1324
1328
  onClick: j,
1325
- onLoadedData: (gt) => it(gt.currentTarget)
1329
+ onLoadedMetadata: (gt) => it(gt.currentTarget)
1326
1330
  }
1327
1331
  ) : /* @__PURE__ */ h(
1328
1332
  "img",
@@ -1367,9 +1371,9 @@ function Zn({
1367
1371
  }) }),
1368
1372
  X && ((t == null ? void 0 : t.lightbox) ?? "on") === "on" && typeof document < "u" && t && (() => {
1369
1373
  const f = (p ? document.getElementById(p) : null) ?? document.body;
1370
- return ln(
1374
+ return an(
1371
1375
  /* @__PURE__ */ h("div", { style: $t, "data-selection": "none", children: /* @__PURE__ */ h(
1372
- Cn,
1376
+ Nn,
1373
1377
  {
1374
1378
  prefix: s,
1375
1379
  items: ut,
@@ -1382,7 +1386,7 @@ function Zn({
1382
1386
  canNavigate: Lt,
1383
1387
  lightboxEntries: W,
1384
1388
  entryIdx: k,
1385
- layoutId: a,
1389
+ layoutId: l,
1386
1390
  sourceRect: F,
1387
1391
  resolveCloseSourceRect: It,
1388
1392
  onClose: g,
@@ -1396,5 +1400,5 @@ function Zn({
1396
1400
  ] });
1397
1401
  }
1398
1402
  export {
1399
- Zn as Waterfall
1403
+ Pn as Waterfall
1400
1404
  };