@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
@@ -1,22 +1,23 @@
1
- import { jsxs as kt, Fragment as be, jsx as d } from "react/jsx-runtime";
1
+ import { jsxs as At, Fragment as Ie, jsx as u } from "react/jsx-runtime";
2
2
  import { s as se } from "./scalingValue-C9JH5L6O.mjs";
3
- import { u as un } from "./useScopedStyles-DhBG3557.mjs";
4
- import { u as dn } from "./useLazyVideos-CxXyEjRQ.mjs";
5
- import { L as fn } from "./LazyVideo-CdAWymKO.mjs";
6
- import { useRef as w, useState as $, useMemo as $e, useCallback as m, useEffect as G, useLayoutEffect as le } from "react";
7
- import { createPortal as hn } from "react-dom";
8
- import { H as gn } from "./HiveLightboxTitles-DhEeFKWs.mjs";
9
- import { g as pn } from "./getImageRect-CBMhFNHM.mjs";
10
- function mn(t) {
3
+ import { u as hn } from "./useScopedStyles-DhBG3557.mjs";
4
+ import { u as gn } from "./useLazyVideos-CxXyEjRQ.mjs";
5
+ import { i as zt, E as Ze, g as pn } from "./EmbedMediaFrame-DwHeOAy5.mjs";
6
+ import { L as mn } from "./LazyVideo-CdAWymKO.mjs";
7
+ import { useRef as w, useState as $, useMemo as xe, useCallback as m, useEffect as B, useLayoutEffect as le } from "react";
8
+ import { createPortal as wn } from "react-dom";
9
+ import { H as vn } from "./HiveLightboxTitles-DhEeFKWs.mjs";
10
+ import { g as yn } from "./getImageRect-CBMhFNHM.mjs";
11
+ function $n(t) {
11
12
  return `calc(var(--cntrl-article-width, 100vw) * ${t / 1440})`;
12
13
  }
13
- function wn(t) {
14
+ function xn(t) {
14
15
  return `
15
16
  .${t}-wrapper {
16
17
  display: grid;
17
18
  align-items: start;
18
19
  justify-content: center;
19
- min-height: ${mn(48)};
20
+ min-height: ${$n(48)};
20
21
  }
21
22
  .${t}-item {
22
23
  display: flex;
@@ -333,26 +334,26 @@ function wn(t) {
333
334
  }
334
335
  `;
335
336
  }
336
- const Be = { assetId: "", name: "", objectFit: "cover" }, rt = 500, Ut = 650, B = "cubic-bezier(0.22, 1, 0.36, 1)", vn = 72, yn = 50, $n = 1e4, xn = 650, bn = 500;
337
- function In(t, e) {
337
+ const Ye = { assetId: "", name: "", objectFit: "cover" }, it = 500, Zt = 650, V = "cubic-bezier(0.22, 1, 0.36, 1)", bn = 72, In = 50, Sn = 1e4, Ln = 650, kn = 500;
338
+ function An(t, e) {
338
339
  const i = t.width / e.width, r = t.height / e.height, o = t.left - e.left, l = t.top - e.top;
339
340
  return `translate(${o}px, ${l}px) scale(${i}, ${r})`;
340
341
  }
341
- function Ye(t, e) {
342
+ function Ke(t, e) {
342
343
  if (e === "contain" && t instanceof HTMLImageElement) {
343
- const r = pn(t);
344
+ const r = yn(t);
344
345
  return { left: r.x, top: r.y, width: r.width, height: r.height };
345
346
  }
346
347
  const i = t.getBoundingClientRect();
347
348
  return { left: i.left, top: i.top, width: i.width, height: i.height };
348
349
  }
349
- function Sn(t, e, i) {
350
+ function Rn(t, e, i) {
350
351
  const r = t.querySelector(`[data-hive-grid-index="${e}"]`);
351
- return r instanceof HTMLElement ? Ye(r, i) : null;
352
+ return r instanceof HTMLElement ? Ke(r, i) : null;
352
353
  }
353
- function Ln(t) {
354
+ function Tn(t) {
354
355
  return t.reduce((e, i, r) => {
355
- const o = Se(i.gallery), g = Le(o).filter((a) => a.lightboxMedia).map((a) => a.lightboxMedia);
356
+ const o = Le(i.gallery), g = ke(o).filter((a) => a.lightboxMedia).map((a) => a.lightboxMedia);
356
357
  return g.length === 0 || e.push({
357
358
  gridIndex: r,
358
359
  items: g,
@@ -364,22 +365,22 @@ function Ln(t) {
364
365
  }), e;
365
366
  }, []);
366
367
  }
367
- function Zt(t, e, i) {
368
+ function Kt(t, e, i) {
368
369
  var o;
369
370
  if (t.length <= 1) return null;
370
371
  const r = (e + i + t.length) % t.length;
371
372
  return ((o = t[r]) == null ? void 0 : o.items[0]) ?? null;
372
373
  }
373
- function Ge(t, e, i) {
374
+ function qe(t, e, i) {
374
375
  if (t.length <= 2) return null;
375
376
  const r = (e + i + t.length) % t.length;
376
- return Zt(t, r, i);
377
+ return Kt(t, r, i);
377
378
  }
378
- const kn = 0.03;
379
- function qe(t) {
380
- return t.width * kn;
379
+ const Hn = 0.03;
380
+ function Je(t) {
381
+ return t.width * Hn;
381
382
  }
382
- const xe = {
383
+ const be = {
383
384
  left: 0,
384
385
  top: 0,
385
386
  width: typeof window < "u" ? window.innerWidth : 1440,
@@ -393,27 +394,31 @@ function ae(t, e) {
393
394
  height: t.height
394
395
  };
395
396
  }
396
- function Xe(t) {
397
+ function Ue(t) {
397
398
  const e = t.getBoundingClientRect();
398
399
  return { width: e.width, height: e.height, left: e.left, top: e.top };
399
400
  }
400
- function An(t) {
401
+ function En(t) {
401
402
  return t instanceof HTMLVideoElement ? { width: t.videoWidth, height: t.videoHeight } : { width: t.naturalWidth, height: t.naturalHeight };
402
403
  }
403
- function Ie(t, e, i) {
404
+ function Se(t, e, i) {
404
405
  const r = t.getBoundingClientRect(), o = r.width, l = r.height, g = e / i, a = o / l;
405
406
  if (g > a) {
406
- const L = o / g;
407
- return { width: o, height: L, left: r.left, top: r.top + (l - L) / 2 };
407
+ const S = o / g;
408
+ return { width: o, height: S, left: r.left, top: r.top + (l - S) / 2 };
408
409
  }
409
- const b = l * g;
410
- return { width: b, height: l, left: r.left + (o - b) / 2, top: r.top };
410
+ const W = l * g;
411
+ return { width: W, height: l, left: r.left + (o - W) / 2, top: r.top };
411
412
  }
412
- function Rn(t, e) {
413
- return !t || !(e != null && e.width) || !(e != null && e.height) ? null : Ie(t, e.width, e.height);
413
+ function Fn(t, e) {
414
+ return !t || !(e != null && e.width) || !(e != null && e.height) ? null : Se(t, e.width, e.height);
414
415
  }
415
- function Tn(t, e) {
416
+ function Cn(t, e) {
416
417
  if (zt(t)) {
418
+ e(t.assetId, pn(t), 1);
419
+ return;
420
+ }
421
+ if (Dt(t)) {
417
422
  const r = document.createElement("video"), o = () => {
418
423
  r.videoWidth > 0 && r.videoHeight > 0 && e(t.assetId, r.videoWidth, r.videoHeight), r.removeEventListener("loadedmetadata", o);
419
424
  };
@@ -425,19 +430,21 @@ function Tn(t, e) {
425
430
  i.naturalWidth > 0 && i.naturalHeight > 0 && e(t.assetId, i.naturalWidth, i.naturalHeight);
426
431
  }, i.src = t.assetId;
427
432
  }
428
- function Hn(t) {
433
+ function Nn(t) {
429
434
  const e = /* @__PURE__ */ new Set(), i = [];
430
435
  for (const r of t) {
431
- const o = Se(r.gallery), l = Le(o);
436
+ const o = Le(r.gallery), l = ke(o);
432
437
  for (const g of l)
433
438
  for (const a of [g.displayMedia, g.lightboxMedia])
434
439
  a != null && a.assetId && !e.has(a.assetId) && (e.add(a.assetId), i.push(a));
435
440
  }
436
441
  return i;
437
442
  }
438
- function Cn({ mediaList: t }) {
443
+ function Wn({ mediaList: t }) {
439
444
  const [e, i] = $(null);
440
- return dn(e, { preload: "metadata" }), t.length === 0 ? null : /* @__PURE__ */ d(
445
+ gn(e, { preload: "metadata" });
446
+ const r = t.filter((o) => !zt(o));
447
+ return r.length === 0 ? null : /* @__PURE__ */ u(
441
448
  "div",
442
449
  {
443
450
  ref: i,
@@ -450,35 +457,35 @@ function Cn({ mediaList: t }) {
450
457
  opacity: 0,
451
458
  pointerEvents: "none"
452
459
  },
453
- children: t.map((r) => zt(r) ? /* @__PURE__ */ d(
460
+ children: r.map((o) => Dt(o) ? /* @__PURE__ */ u(
454
461
  "video",
455
462
  {
456
- src: r.assetId,
463
+ src: o.assetId,
457
464
  preload: "none",
458
465
  muted: !0,
459
466
  playsInline: !0
460
467
  },
461
- r.assetId
462
- ) : /* @__PURE__ */ d(
468
+ o.assetId
469
+ ) : /* @__PURE__ */ u(
463
470
  "img",
464
471
  {
465
- src: r.assetId,
472
+ src: o.assetId,
466
473
  alt: ""
467
474
  },
468
- r.assetId
475
+ o.assetId
469
476
  ))
470
477
  }
471
478
  );
472
479
  }
473
480
  function Ot(t, e, i) {
474
- const { width: r, height: o, top: l } = t, { left: g, width: a } = i, b = qe(i);
481
+ const { width: r, height: o, top: l } = t, { left: g, width: a } = i, W = Je(i);
475
482
  return e === "left" ? {
476
- left: g + b - r,
483
+ left: g + W - r,
477
484
  top: l,
478
485
  width: r,
479
486
  height: o
480
487
  } : {
481
- left: g + a - b,
488
+ left: g + a - W,
482
489
  top: l,
483
490
  width: r,
484
491
  height: o
@@ -491,8 +498,8 @@ function ue(t, e, i) {
491
498
  left: 2 * r.left - t.left
492
499
  };
493
500
  }
494
- function Nn(t, e, i) {
495
- const { left: r, width: o } = i, l = qe(i);
501
+ function jn(t, e, i) {
502
+ const { left: r, width: o } = i, l = Je(i);
496
503
  return e === "left" ? {
497
504
  left: r,
498
505
  top: t.top,
@@ -505,7 +512,7 @@ function Nn(t, e, i) {
505
512
  height: t.height
506
513
  };
507
514
  }
508
- function Ue(t, e, i, r) {
515
+ function Qe(t, e, i, r) {
509
516
  const o = Ot(t, "left", r), l = Ot(t, "right", r), g = ue(t, "left", r), a = ue(t, "right", r);
510
517
  if (i === 1)
511
518
  switch (e) {
@@ -533,54 +540,54 @@ function Ue(t, e, i, r) {
533
540
  return { start: t, end: t };
534
541
  }
535
542
  }
536
- function Fn(t, e, i, r) {
537
- const { start: o, end: l } = Ue(t, e, i, r);
543
+ function On(t, e, i, r) {
544
+ const { start: o, end: l } = Qe(t, e, i, r);
538
545
  return {
539
546
  x: l.left - o.left,
540
547
  y: l.top - o.top
541
548
  };
542
549
  }
543
- function En(t, e, i) {
550
+ function zn(t, e, i) {
544
551
  const r = Ot(t, e, i), o = ue(t, e, i);
545
552
  return {
546
553
  x: o.left - r.left,
547
554
  y: o.top - r.top
548
555
  };
549
556
  }
550
- function Ze(t) {
557
+ function Pe(t) {
551
558
  if (!Array.isArray(t) || t.length === 0) return !1;
552
559
  const e = t[0];
553
560
  return e !== null && typeof e == "object" && "media" in e && Array.isArray(e.media);
554
561
  }
555
- function Se(t) {
562
+ function Le(t) {
556
563
  if (!t) return;
557
- if (Ze(t)) return t;
564
+ if (Pe(t)) return t;
558
565
  if (!Array.isArray(t)) return;
559
566
  const [e, i] = t, r = e != null && e.assetId ? e : void 0, o = i != null && i.assetId ? i : void 0;
560
567
  if (!(!r && !o))
561
568
  return [{
562
569
  media: [
563
- o ?? r ?? Be,
564
- r ?? o ?? Be
570
+ o ?? r ?? Ye,
571
+ r ?? o ?? Ye
565
572
  ]
566
573
  }];
567
574
  }
568
- function Wn(t) {
575
+ function Dn(t) {
569
576
  const [e, i] = t.media;
570
577
  return i != null && i.assetId ? i : e != null && e.assetId ? e : null;
571
578
  }
572
- function jn(t) {
579
+ function Mn(t) {
573
580
  const [e] = t.media;
574
581
  return e != null && e.assetId ? e : null;
575
582
  }
576
- function Le(t) {
583
+ function ke(t) {
577
584
  if (!Array.isArray(t) || t.length === 0) return [];
578
- if (Ze(t)) {
585
+ if (Pe(t)) {
579
586
  const e = [];
580
587
  for (const i of t) {
581
- const r = Wn(i);
588
+ const r = Dn(i);
582
589
  if (!r) continue;
583
- const o = jn(i);
590
+ const o = Mn(i);
584
591
  e.push({
585
592
  displayMedia: r,
586
593
  lightboxMedia: o != null && o.assetId ? o : null
@@ -593,18 +600,32 @@ function Le(t) {
593
600
  lightboxMedia: e
594
601
  }));
595
602
  }
596
- function zt(t) {
597
- return t.type === "video" ? !0 : /\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(t.assetId);
603
+ function Dt(t) {
604
+ return zt(t) ? !1 : t.type === "video" ? !0 : /\.(mp4|webm|ogg|mov)(\?|#|$)/i.test(t.assetId);
598
605
  }
599
- function On({
606
+ function _n({
600
607
  media: t,
601
608
  className: e,
602
609
  style: i,
603
610
  gridIndex: r,
604
611
  onMediaClick: o
605
612
  }) {
606
- return zt(t) ? /* @__PURE__ */ d(
607
- fn,
613
+ return zt(t) ? /* @__PURE__ */ u(
614
+ Ze,
615
+ {
616
+ media: t,
617
+ fit: i.objectFit === "contain" ? "contain" : "cover",
618
+ silentLoop: !0,
619
+ className: e,
620
+ "data-hive-grid-index": r,
621
+ style: {
622
+ ...i,
623
+ cursor: o ? "pointer" : "default"
624
+ },
625
+ onClick: o
626
+ }
627
+ ) : Dt(t) ? /* @__PURE__ */ u(
628
+ mn,
608
629
  {
609
630
  src: t.assetId,
610
631
  className: e,
@@ -619,7 +640,7 @@ function On({
619
640
  playsInline: !0,
620
641
  onClick: o
621
642
  }
622
- ) : /* @__PURE__ */ d(
643
+ ) : /* @__PURE__ */ u(
623
644
  "img",
624
645
  {
625
646
  src: t.assetId,
@@ -634,32 +655,32 @@ function On({
634
655
  }
635
656
  );
636
657
  }
637
- function zn({
658
+ function Vn({
638
659
  src: t,
639
- phase: e,
640
- onMediaElement: i,
641
- wrapperStyle: r,
642
- videoStyle: o,
643
- onLoadedMetadata: l,
644
- onTransitionEnd: g
660
+ onMediaElement: e,
661
+ wrapperStyle: i,
662
+ videoStyle: r,
663
+ onLoadedMetadata: o,
664
+ onTransitionEnd: l
645
665
  }) {
646
- const a = w(null);
647
- return G(() => {
648
- const b = a.current;
649
- return i == null || i(b ?? null), () => {
650
- b == null || b.pause(), i == null || i(null);
666
+ const g = w(null);
667
+ return B(() => {
668
+ const a = g.current;
669
+ return e == null || e(a ?? null), () => {
670
+ a == null || a.pause(), e == null || e(null);
651
671
  };
652
- }, [t, i]), /* @__PURE__ */ d("div", { style: r, onTransitionEnd: g, children: /* @__PURE__ */ d(
672
+ }, [t, e]), /* @__PURE__ */ u("div", { style: i, onTransitionEnd: l, children: /* @__PURE__ */ u(
653
673
  "video",
654
674
  {
655
- ref: a,
675
+ ref: g,
656
676
  src: t,
657
- controls: e === "open",
677
+ muted: !0,
678
+ autoPlay: !0,
679
+ loop: !0,
658
680
  playsInline: !0,
659
681
  preload: "auto",
660
- onLoadedMetadata: l,
661
- onClick: (b) => b.stopPropagation(),
662
- style: o
682
+ onLoadedMetadata: o,
683
+ style: r
663
684
  },
664
685
  t
665
686
  ) });
@@ -670,11 +691,13 @@ function ce({
670
691
  onTransitionEnd: i,
671
692
  onMeasure: r
672
693
  }) {
673
- return zt(t) ? /* @__PURE__ */ d(
694
+ return zt(t) ? /* @__PURE__ */ u("img", { src: t.thumbnail, alt: t.name, style: e, onTransitionEnd: i }) : Dt(t) ? /* @__PURE__ */ u(
674
695
  "video",
675
696
  {
676
697
  src: t.assetId,
677
698
  muted: !0,
699
+ autoPlay: !0,
700
+ loop: !0,
678
701
  playsInline: !0,
679
702
  preload: "auto",
680
703
  style: e,
@@ -684,7 +707,7 @@ function ce({
684
707
  },
685
708
  onTransitionEnd: i
686
709
  }
687
- ) : /* @__PURE__ */ d(
710
+ ) : /* @__PURE__ */ u(
688
711
  "img",
689
712
  {
690
713
  src: t.assetId,
@@ -698,7 +721,7 @@ function ce({
698
721
  }
699
722
  );
700
723
  }
701
- function Dn({
724
+ function Bn({
702
725
  prefix: t,
703
726
  items: e,
704
727
  index: i,
@@ -707,366 +730,365 @@ function Dn({
707
730
  isEditor: l,
708
731
  isEditMode: g,
709
732
  isPreviewMode: a,
710
- canNavigate: b,
711
- lightboxEntries: L,
712
- entryIdx: ot,
713
- layoutId: X,
714
- sourceRect: O,
715
- resolveCloseSourceRect: At,
716
- onClose: Dt,
717
- onPrev: Mt,
718
- onNext: _t
733
+ canNavigate: W,
734
+ lightboxEntries: S,
735
+ entryIdx: rt,
736
+ layoutId: G,
737
+ sourceRect: j,
738
+ resolveCloseSourceRect: Rt,
739
+ onClose: Mt,
740
+ onPrev: _t,
741
+ onNext: Vt
719
742
  }) {
720
- const Kt = w(null), Rt = w(null), Tt = w(null), Ht = w(/* @__PURE__ */ new Map()), [q, Ct] = $(0), st = w(null), xt = w(0), z = w(0), W = w("none"), U = w(!1), Z = w(!1), lt = w(!1), at = w(null), k = w(null), Nt = w(null), ft = w(() => {
721
- }), K = w(null), D = w(null), ht = w(null), ct = w(!1), [R, bt] = $(null), [T, Jt] = $(xe), [de, fe] = $(0), [f, gt] = $("opening"), [J, It] = $(0), [Vt, A] = $(0), [Y, he] = $(!1), [Q, pt] = $(null), [St, mt] = $(null), [x, v] = $(null), [wt, H] = $(!1), [vt, Bt] = $(null), [Gt, P] = $(!1), Lt = w(!1), [M, E] = $(!1), [Ke, ke] = $(!1), Ae = w(i), Re = w(void 0), h = e[i], Qt = h ? zt(h) : !1, tt = Vt !== 0 || Y, ge = !g && (!l || !!a), ut = b && !g, yt = L.length > 1, Ft = m((n, s) => e.length <= 1 ? null : e[(n + s + e.length) % e.length] ?? null, [e]), C = yt ? Zt(L, ot, -1) : Ft(i, -1), N = yt ? Zt(L, ot, 1) : Ft(i, 1), pe = Q === -1 && tt ? yt && St !== null ? Zt(L, St, -1) : x !== null ? Ft(x, -1) : null : null, me = Q === 1 && tt ? yt && St !== null ? Zt(L, St, 1) : x !== null ? Ft(x, 1) : null : null, Je = pe && pe.assetId !== (C == null ? void 0 : C.assetId) ? pe : null, Qe = me && me.assetId !== (N == null ? void 0 : N.assetId) ? me : null, Pe = C && ut ? (() => {
722
- const n = yt ? Ge(L, ot, -1) : e.length > 2 ? Ft((i - 1 + e.length) % e.length, -1) : null;
723
- return n && n.assetId !== C.assetId ? n : null;
724
- })() : null, tn = N && ut ? (() => {
725
- const n = yt ? Ge(L, ot, 1) : e.length > 2 ? Ft((i + 1) % e.length, 1) : null;
726
- return n && n.assetId !== N.assetId ? n : null;
727
- })() : null, Pt = Je ?? Pe, te = Qe ?? tn, $t = m((n, s, u) => {
728
- if (!n || !s || !u) return;
729
- const c = Ht.current, y = c.get(n);
730
- (y == null ? void 0 : y.width) === s && (y == null ? void 0 : y.height) === u || (c.set(n, { width: s, height: u }), Ct((V) => V + 1));
731
- }, []), Et = m((n) => {
743
+ const Jt = w(null), Tt = w(null), Ht = w(null), Et = w(/* @__PURE__ */ new Map()), [Y, Ft] = $(0), ot = w(null), xt = w(0), O = w(0), N = w("none"), q = w(!1), U = w(!1), st = w(!1), lt = w(null), L = w(null), Ct = w(null), dt = w(() => {
744
+ }), Z = w(null), z = w(null), ft = w(null), at = w(!1), [A, bt] = $(null), [R, Qt] = $(be), [de, fe] = $(0), [h, ht] = $("opening"), [K, It] = $(0), [Bt, k] = $(0), [X, he] = $(!1), [J, gt] = $(null), [St, pt] = $(null), [x, v] = $(null), [mt, T] = $(!1), [wt, Gt] = $(null), [Xt, Q] = $(!1), Lt = w(!1), [D, C] = $(!1), [tn, Ae] = $(!1), Re = w(i), Te = w(void 0), d = e[i], He = d ? Dt(d) : !1, Ee = d ? zt(d) : !1, vt = Bt !== 0 || X, ge = !g && (!l || !!a), ct = W && !g, yt = S.length > 1, Nt = m((n, s) => e.length <= 1 ? null : e[(n + s + e.length) % e.length] ?? null, [e]), H = yt ? Kt(S, rt, -1) : Nt(i, -1), E = yt ? Kt(S, rt, 1) : Nt(i, 1), pe = J === -1 && vt ? yt && St !== null ? Kt(S, St, -1) : x !== null ? Nt(x, -1) : null : null, me = J === 1 && vt ? yt && St !== null ? Kt(S, St, 1) : x !== null ? Nt(x, 1) : null : null, en = pe && pe.assetId !== (H == null ? void 0 : H.assetId) ? pe : null, nn = me && me.assetId !== (E == null ? void 0 : E.assetId) ? me : null, rn = H && ct ? (() => {
745
+ const n = yt ? qe(S, rt, -1) : e.length > 2 ? Nt((i - 1 + e.length) % e.length, -1) : null;
746
+ return n && n.assetId !== H.assetId ? n : null;
747
+ })() : null, on = E && ct ? (() => {
748
+ const n = yt ? qe(S, rt, 1) : e.length > 2 ? Nt((i + 1) % e.length, 1) : null;
749
+ return n && n.assetId !== E.assetId ? n : null;
750
+ })() : null, Pt = en ?? rn, te = nn ?? on, $t = m((n, s, f) => {
751
+ if (!n || !s || !f) return;
752
+ const c = Et.current, y = c.get(n);
753
+ (y == null ? void 0 : y.width) === s && (y == null ? void 0 : y.height) === f || (c.set(n, { width: s, height: f }), Ft((_) => _ + 1));
754
+ }, []), Wt = m((n) => {
732
755
  if (!(n != null && n.assetId)) return null;
733
- const s = Ht.current.get(n.assetId);
734
- return Rn(Rt.current, s);
735
- }, [q, de]), ee = m(() => {
736
- if (!h) return;
737
- const n = Et(h);
756
+ const s = Et.current.get(n.assetId);
757
+ return Fn(Tt.current, s);
758
+ }, [Y, de]), ee = m(() => {
759
+ if (!d) return;
760
+ const n = Wt(d);
738
761
  if (n) {
739
762
  bt(n);
740
763
  return;
741
764
  }
742
- const s = Rt.current;
743
- s && bt(Xe(s));
744
- }, [h, Et]), ne = m((n) => {
765
+ const s = Tt.current;
766
+ s && bt(Ue(s));
767
+ }, [d, Wt]), ne = m((n) => {
745
768
  if (yt) {
746
- const s = L.length;
747
- mt((ot + n + s) % s), v(null);
769
+ const s = S.length;
770
+ pt((rt + n + s) % s), v(null);
748
771
  return;
749
772
  }
750
- e.length > 1 && (v((i + n + e.length) % e.length), mt(null));
751
- }, [yt, L.length, ot, e.length, i]), F = m((n) => {
752
- lt.current = n, he(n);
753
- }, []), I = m(() => {
754
- at.current !== null && (window.clearTimeout(at.current), at.current = null);
755
- }, []), Te = m(() => {
756
- I(), at.current = window.setTimeout(() => {
757
- I(), F(!1);
758
- }, Ut + 32);
759
- }, [I, F]), He = m(() => {
760
- const n = Kt.current;
773
+ e.length > 1 && (v((i + n + e.length) % e.length), pt(null));
774
+ }, [yt, S.length, rt, e.length, i]), F = m((n) => {
775
+ st.current = n, he(n);
776
+ }, []), b = m(() => {
777
+ lt.current !== null && (window.clearTimeout(lt.current), lt.current = null);
778
+ }, []), Fe = m(() => {
779
+ b(), lt.current = window.setTimeout(() => {
780
+ b(), F(!1);
781
+ }, Zt + 32);
782
+ }, [b, F]), Ce = m(() => {
783
+ const n = Jt.current;
761
784
  if (!n) {
762
- Jt({
785
+ Qt({
763
786
  left: 0,
764
787
  top: 0,
765
- width: typeof window < "u" ? window.innerWidth : xe.width,
766
- height: typeof window < "u" ? window.innerHeight : xe.height
788
+ width: typeof window < "u" ? window.innerWidth : be.width,
789
+ height: typeof window < "u" ? window.innerHeight : be.height
767
790
  });
768
791
  return;
769
792
  }
770
793
  const s = n.getBoundingClientRect();
771
- Jt({
794
+ Qt({
772
795
  left: s.left,
773
796
  top: s.top,
774
797
  width: s.width,
775
798
  height: s.height
776
799
  });
777
- }, []), Ce = m((n, s) => {
778
- if (tt) {
779
- if (M && !Y)
780
- return `translate(${Vt}px, 0px)`;
781
- if (Y && Q !== null) {
782
- const u = Et(n);
783
- if (!u) return;
784
- const { x: c, y } = Fn(u, s, Q, T);
800
+ }, []), Ne = m((n, s) => {
801
+ if (vt) {
802
+ if (D && !X)
803
+ return `translate(${Bt}px, 0px)`;
804
+ if (X && J !== null) {
805
+ const f = Wt(n);
806
+ if (!f) return;
807
+ const { x: c, y } = On(f, s, J, R);
785
808
  return `translate(${c}px, ${y}px)`;
786
809
  }
787
- if (Y)
810
+ if (X)
788
811
  return "translate(0px, 0px)";
789
812
  }
790
813
  }, [
791
- tt,
792
- M,
793
- Y,
794
- Vt,
795
- Q,
796
- T,
797
- Et
798
- ]), Wt = m(() => {
799
- const n = k.current;
800
- k.current = null, I(), F(!1), pt(null), mt(null), v(null), A(0), E(!1), U.current = !1, z.current = 0, W.current = "none", n === -1 ? Mt() : n === 1 && _t();
801
- }, [I, F, Mt, _t]), ie = m(() => {
802
- I(), at.current = window.setTimeout(() => {
803
- k.current !== null && Wt();
804
- }, Ut + 32);
805
- }, [I, Wt]), Ne = m(() => {
806
- I(), k.current = null, F(!1), pt(null), mt(null), v(null), A(0), E(!1), U.current = !1, z.current = 0, W.current = "none";
807
- }, [I, F]), Fe = m((n) => {
808
- if (!(!ut || !R)) {
809
- if (lt.current) {
810
- if (k.current === n) {
811
- Nt.current = n, Wt();
814
+ vt,
815
+ D,
816
+ X,
817
+ Bt,
818
+ J,
819
+ R,
820
+ Wt
821
+ ]), jt = m(() => {
822
+ const n = L.current;
823
+ L.current = null, b(), F(!1), gt(null), pt(null), v(null), k(0), C(!1), q.current = !1, O.current = 0, N.current = "none", n === -1 ? _t() : n === 1 && Vt();
824
+ }, [b, F, _t, Vt]), ie = m(() => {
825
+ b(), lt.current = window.setTimeout(() => {
826
+ L.current !== null && jt();
827
+ }, Zt + 32);
828
+ }, [b, jt]), We = m(() => {
829
+ b(), L.current = null, F(!1), gt(null), pt(null), v(null), k(0), C(!1), q.current = !1, O.current = 0, N.current = "none";
830
+ }, [b, F]), je = m((n) => {
831
+ if (!(!ct || !A)) {
832
+ if (st.current) {
833
+ if (L.current === n) {
834
+ Ct.current = n, jt();
812
835
  return;
813
836
  }
814
- Ne();
837
+ We();
815
838
  }
816
- I(), ne(n), k.current = n, pt(n), F(!0), ie();
839
+ b(), ne(n), L.current = n, gt(n), F(!0), ie();
817
840
  }
818
841
  }, [
819
- ut,
820
- R,
821
- Wt,
822
- Ne,
823
- I,
842
+ ct,
843
+ A,
844
+ jt,
845
+ We,
846
+ b,
824
847
  ne,
825
848
  F,
826
849
  ie
827
850
  ]);
828
- ft.current = Fe;
829
- const dt = m(() => {
830
- K.current = null, ct.current = !1, D.current !== null && (window.clearInterval(D.current), D.current = null), ht.current !== null && (window.clearTimeout(ht.current), ht.current = null);
851
+ dt.current = je;
852
+ const ut = m(() => {
853
+ Z.current = null, at.current = !1, z.current !== null && (window.clearInterval(z.current), z.current = null), ft.current !== null && (window.clearTimeout(ft.current), ft.current = null);
831
854
  }, []), we = m((n) => {
832
- D.current !== null && window.clearInterval(D.current);
833
- const s = ct.current ? bn : xn;
834
- D.current = window.setInterval(() => {
835
- ft.current(n);
855
+ z.current !== null && window.clearInterval(z.current);
856
+ const s = at.current ? kn : Ln;
857
+ z.current = window.setInterval(() => {
858
+ dt.current(n);
836
859
  }, s);
837
- }, []), Ee = m((n) => {
838
- K.current !== n && (dt(), K.current = n, ct.current = !1, ft.current(n), we(n), ht.current = window.setTimeout(() => {
839
- ht.current = null, K.current === n && (ct.current = !0, we(n));
840
- }, $n));
841
- }, [dt, we]), et = m(() => {
842
- const n = Rt.current;
860
+ }, []), Oe = m((n) => {
861
+ Z.current !== n && (ut(), Z.current = n, at.current = !1, dt.current(n), we(n), ft.current = window.setTimeout(() => {
862
+ ft.current = null, Z.current === n && (at.current = !0, we(n));
863
+ }, Sn));
864
+ }, [ut, we]), P = m(() => {
865
+ const n = Tt.current;
843
866
  if (!n) return;
844
- const s = h == null ? void 0 : h.assetId, u = s ? Ht.current.get(s) : void 0;
845
- if (u != null && u.width && (u != null && u.height)) {
846
- bt(Ie(n, u.width, u.height));
867
+ const s = d == null ? void 0 : d.assetId, f = s ? Et.current.get(s) : void 0;
868
+ if (f != null && f.width && (f != null && f.height)) {
869
+ bt(Se(n, f.width, f.height));
847
870
  return;
848
871
  }
849
- const c = Tt.current;
872
+ const c = Ht.current;
850
873
  if (c && s && (c.src === s || c.currentSrc === s)) {
851
- const { width: V, height: p } = An(c);
852
- if (V && p) {
853
- $t(s, V, p), bt(Ie(n, V, p));
874
+ const { width: _, height: p } = En(c);
875
+ if (_ && p) {
876
+ $t(s, _, p), bt(Se(n, _, p));
854
877
  return;
855
878
  }
856
879
  }
857
- const y = Xe(n);
880
+ const y = Ue(n);
858
881
  !y.width || !y.height || bt(y);
859
- }, [h == null ? void 0 : h.assetId, $t]), We = m((n) => {
860
- if (Tt.current = n, !!n) {
882
+ }, [d == null ? void 0 : d.assetId, $t]), ze = m((n) => {
883
+ if (Ht.current = n, !!n) {
861
884
  if (n instanceof HTMLVideoElement) {
862
- n.readyState >= 1 && n.videoWidth > 0 && et();
885
+ n.readyState >= 1 && n.videoWidth > 0 && P();
863
886
  return;
864
887
  }
865
- n.complete && n.naturalWidth > 0 && et();
888
+ n.complete && n.naturalWidth > 0 && P();
866
889
  }
867
- }, [et]), Xt = m(() => {
868
- He(), et(), fe((n) => n + 1);
869
- }, [He, et]);
870
- G(() => {
871
- Xt();
872
- const n = Rt.current, s = Kt.current, u = new ResizeObserver(() => Xt());
873
- return n && u.observe(n), s && u.observe(s), window.addEventListener("resize", Xt), () => {
874
- u.disconnect(), window.removeEventListener("resize", Xt);
890
+ }, [P]), Yt = m(() => {
891
+ Ce(), P(), fe((n) => n + 1);
892
+ }, [Ce, P]);
893
+ B(() => {
894
+ Yt();
895
+ const n = Tt.current, s = Jt.current, f = new ResizeObserver(() => Yt());
896
+ return n && f.observe(n), s && f.observe(s), window.addEventListener("resize", Yt), () => {
897
+ f.disconnect(), window.removeEventListener("resize", Yt);
875
898
  };
876
- }, [Xt, i, X]), le(() => {
877
- if (!h) return;
878
- const n = Tt.current;
899
+ }, [Yt, i, G]), le(() => {
900
+ if (!d) return;
901
+ const n = Ht.current;
879
902
  if (n) {
880
903
  if (n instanceof HTMLImageElement && n.complete && n.naturalWidth > 0) {
881
- et();
904
+ P();
882
905
  return;
883
906
  }
884
- n instanceof HTMLVideoElement && n.readyState >= 1 && n.videoWidth > 0 && et();
907
+ n instanceof HTMLVideoElement && n.readyState >= 1 && n.videoWidth > 0 && P();
885
908
  }
886
- }, [h == null ? void 0 : h.assetId, i, et]), G(() => {
909
+ }, [d == null ? void 0 : d.assetId, i, P]), B(() => {
887
910
  ee();
888
- }, [ee, q]), G(() => {
889
- const n = /* @__PURE__ */ new Set(), s = [], u = (c) => {
911
+ }, [ee, Y]), B(() => {
912
+ const n = /* @__PURE__ */ new Set(), s = [], f = (c) => {
890
913
  !(c != null && c.assetId) || n.has(c.assetId) || (n.add(c.assetId), s.push(c));
891
914
  };
892
- e.forEach(u), L.forEach((c) => c.items.forEach(u)), s.forEach((c) => {
893
- Ht.current.has(c.assetId) || Tn(c, $t);
915
+ e.forEach(f), S.forEach((c) => c.items.forEach(f)), s.forEach((c) => {
916
+ Et.current.has(c.assetId) || Cn(c, $t);
894
917
  });
895
- }, [e, L, $t]), G(() => {
896
- if (f !== "opening" || !R) return;
897
- if (!O) {
898
- gt("open");
918
+ }, [e, S, $t]), B(() => {
919
+ if (h !== "opening" || !A) return;
920
+ if (!j) {
921
+ ht("open");
899
922
  return;
900
923
  }
901
- H(!1);
924
+ T(!1);
902
925
  const n = requestAnimationFrame(() => {
903
926
  requestAnimationFrame(() => {
904
- H(!0), gt("open");
927
+ T(!0), ht("open");
905
928
  });
906
929
  });
907
930
  return () => cancelAnimationFrame(n);
908
- }, [f, R, O]), G(() => {
909
- if (f !== "closing") return;
910
- const n = setTimeout(() => Dt(), rt);
931
+ }, [h, A, j]), B(() => {
932
+ if (h !== "closing") return;
933
+ const n = setTimeout(() => Mt(), it);
911
934
  return () => clearTimeout(n);
912
- }, [f, Dt]), G(() => () => {
913
- I();
914
- }, [I]), le(() => {
915
- Ae.current === i && Re.current === (h == null ? void 0 : h.assetId) || (I(), k.current = null, pt(null), mt(null), v(null), It(0), A(0), F(!1), ke(!1), E(!1), xt.current = 0, z.current = 0, W.current = "none", U.current = !1, st.current = null, Z.current = !1, Tt.current = null, ee(), Ae.current = i, Re.current = h == null ? void 0 : h.assetId);
916
- }, [i, h == null ? void 0 : h.assetId, F, I, ee]), le(() => {
917
- const n = Nt.current;
918
- n !== null && (Nt.current = null, requestAnimationFrame(() => {
919
- ft.current(n);
935
+ }, [h, Mt]), B(() => () => {
936
+ b();
937
+ }, [b]), le(() => {
938
+ Re.current === i && Te.current === (d == null ? void 0 : d.assetId) || (b(), L.current = null, gt(null), pt(null), v(null), It(0), k(0), F(!1), Ae(!1), C(!1), xt.current = 0, O.current = 0, N.current = "none", q.current = !1, ot.current = null, U.current = !1, Ht.current = null, ee(), Re.current = i, Te.current = d == null ? void 0 : d.assetId);
939
+ }, [i, d == null ? void 0 : d.assetId, F, b, ee]), le(() => {
940
+ const n = Ct.current;
941
+ n !== null && (Ct.current = null, requestAnimationFrame(() => {
942
+ dt.current(n);
920
943
  }));
921
- }, [i, ot, h == null ? void 0 : h.assetId]), le(() => {
922
- if (f === "opening") {
923
- Lt.current = !1, P(!1);
944
+ }, [i, rt, d == null ? void 0 : d.assetId]), le(() => {
945
+ if (h === "opening") {
946
+ Lt.current = !1, Q(!1);
924
947
  return;
925
948
  }
926
- if (f !== "open" || Lt.current) return;
927
- if (!C && !N) {
949
+ if (h !== "open" || Lt.current) return;
950
+ if (!H && !E) {
928
951
  Lt.current = !0;
929
952
  return;
930
953
  }
931
- P(!1);
954
+ Q(!1);
932
955
  const n = requestAnimationFrame(() => {
933
956
  requestAnimationFrame(() => {
934
- P(!0), Lt.current = !0;
957
+ Q(!0), Lt.current = !0;
935
958
  });
936
959
  });
937
960
  return () => cancelAnimationFrame(n);
938
- }, [f, C == null ? void 0 : C.assetId, N == null ? void 0 : N.assetId]), G(() => {
939
- if (f !== "open") return;
961
+ }, [h, H == null ? void 0 : H.assetId, E == null ? void 0 : E.assetId]), B(() => {
962
+ if (h !== "open") return;
940
963
  const n = () => {
941
- const p = (S) => {
942
- S.stopPropagation(), S.preventDefault(), document.removeEventListener("click", p, !0);
964
+ const p = (I) => {
965
+ I.stopPropagation(), I.preventDefault(), document.removeEventListener("click", p, !0);
943
966
  };
944
967
  document.addEventListener("click", p, !0);
945
968
  }, s = (p) => {
946
- const S = p < 0 ? 1 : -1;
947
- I(), ne(S), k.current = S, pt(S), F(!0), ie();
948
- }, u = (p) => {
949
- if (Math.abs(p) > yn && ut) {
969
+ const I = p < 0 ? 1 : -1;
970
+ b(), ne(I), L.current = I, gt(I), F(!0), ie();
971
+ }, f = (p) => {
972
+ if (Math.abs(p) > In && ct) {
950
973
  s(p);
951
974
  return;
952
975
  }
953
- k.current = null, pt(null), mt(null), v(null), F(!0), A(0), Te();
976
+ L.current = null, gt(null), pt(null), v(null), F(!0), k(0), Fe();
954
977
  }, c = (p) => {
955
- if (p.touches.length !== 1 || lt.current) return;
956
- const S = p.touches[0];
957
- Z.current = !0, st.current = { x: S.clientX, y: S.clientY }, W.current = "none", z.current = 0, U.current = !1;
978
+ if (p.touches.length !== 1 || st.current) return;
979
+ const I = p.touches[0];
980
+ U.current = !0, ot.current = { x: I.clientX, y: I.clientY }, N.current = "none", O.current = 0, q.current = !1;
958
981
  }, y = (p) => {
959
- if (!st.current || p.touches.length !== 1 || lt.current) return;
960
- const S = p.touches[0], nt = S.clientX - st.current.x, it = S.clientY - st.current.y;
961
- if (W.current === "none") {
962
- if (Math.abs(nt) < 10 && Math.abs(it) < 10) return;
963
- if (Math.abs(nt) > Math.abs(it)) {
964
- if (!ut) return;
965
- W.current = "horizontal";
966
- } else if (it > 0) {
982
+ if (!ot.current || p.touches.length !== 1 || st.current) return;
983
+ const I = p.touches[0], et = I.clientX - ot.current.x, nt = I.clientY - ot.current.y;
984
+ if (N.current === "none") {
985
+ if (Math.abs(et) < 10 && Math.abs(nt) < 10) return;
986
+ if (Math.abs(et) > Math.abs(nt)) {
987
+ if (!ct) return;
988
+ N.current = "horizontal";
989
+ } else if (nt > 0) {
967
990
  if (!ge) return;
968
- W.current = "vertical";
991
+ N.current = "vertical";
969
992
  } else
970
993
  return;
971
994
  }
972
- if (W.current === "horizontal") {
973
- U.current = !0, E(!0), z.current = nt, A(nt), p.preventDefault();
995
+ if (N.current === "horizontal") {
996
+ q.current = !0, C(!0), O.current = et, k(et), p.preventDefault();
974
997
  return;
975
998
  }
976
- W.current === "vertical" && (U.current = !0, E(!0), xt.current = it, It(it), p.preventDefault());
977
- }, V = () => {
978
- if (!st.current) return;
979
- const p = W.current, S = U.current;
980
- if (S && p === "horizontal")
981
- u(z.current), n();
982
- else if (S && p === "vertical") {
983
- const nt = xt.current;
984
- if (ge && nt > vn) {
985
- const it = window.innerHeight;
986
- xt.current = it, ke(!0), It(it), gt("closing");
999
+ N.current === "vertical" && (q.current = !0, C(!0), xt.current = nt, It(nt), p.preventDefault());
1000
+ }, _ = () => {
1001
+ if (!ot.current) return;
1002
+ const p = N.current, I = q.current;
1003
+ if (I && p === "horizontal")
1004
+ f(O.current), n();
1005
+ else if (I && p === "vertical") {
1006
+ const et = xt.current;
1007
+ if (ge && et > bn) {
1008
+ const nt = window.innerHeight;
1009
+ xt.current = nt, Ae(!0), It(nt), ht("closing");
987
1010
  } else
988
1011
  xt.current = 0, It(0);
989
1012
  n();
990
- } else p === "horizontal" && Math.abs(z.current) > 0 && (u(z.current), n());
991
- st.current = null, W.current = "none", z.current = 0, U.current = !1, E(!1);
1013
+ } else p === "horizontal" && Math.abs(O.current) > 0 && (f(O.current), n());
1014
+ ot.current = null, N.current = "none", O.current = 0, q.current = !1, C(!1);
992
1015
  };
993
- return document.addEventListener("touchstart", c, { passive: !0 }), document.addEventListener("touchmove", y, { passive: !1 }), document.addEventListener("touchend", V), document.addEventListener("touchcancel", V), () => {
994
- document.removeEventListener("touchstart", c), document.removeEventListener("touchmove", y), document.removeEventListener("touchend", V), document.removeEventListener("touchcancel", V);
1016
+ return document.addEventListener("touchstart", c, { passive: !0 }), document.addEventListener("touchmove", y, { passive: !1 }), document.addEventListener("touchend", _), document.addEventListener("touchcancel", _), () => {
1017
+ document.removeEventListener("touchstart", c), document.removeEventListener("touchmove", y), document.removeEventListener("touchend", _), document.removeEventListener("touchcancel", _);
995
1018
  };
996
- }, [f, ut, F, Te, I, ge, ie, ne]);
1019
+ }, [h, ct, F, Fe, b, ge, ie, ne]);
997
1020
  const ve = m(() => {
998
- const n = (At == null ? void 0 : At()) ?? O ?? null;
999
- n && R && (Bt(n), H(!0)), gt("closing");
1000
- }, [At, O, R]);
1001
- G(() => {
1021
+ const n = (Rt == null ? void 0 : Rt()) ?? j ?? null;
1022
+ n && A && (Gt(n), T(!0)), ht("closing");
1023
+ }, [Rt, j, A]);
1024
+ B(() => {
1002
1025
  const n = (c) => {
1003
1026
  if (c.key === "Escape") {
1004
- if (l && a || f === "closing") return;
1005
- dt(), ve();
1027
+ if (l && a || h === "closing") return;
1028
+ ut(), ve();
1006
1029
  return;
1007
1030
  }
1008
- if (c.key !== "ArrowLeft" && c.key !== "ArrowRight" || f !== "open" || !ut) return;
1031
+ if (c.key !== "ArrowLeft" && c.key !== "ArrowRight" || h !== "open" || !ct) return;
1009
1032
  c.preventDefault();
1010
1033
  const y = c.key === "ArrowLeft" ? -1 : 1;
1011
- c.repeat && K.current === y || Ee(y);
1034
+ c.repeat && Z.current === y || Oe(y);
1012
1035
  }, s = (c) => {
1013
1036
  if (c.key !== "ArrowLeft" && c.key !== "ArrowRight") return;
1014
1037
  const y = c.key === "ArrowLeft" ? -1 : 1;
1015
- K.current === y && dt();
1016
- }, u = () => {
1017
- dt();
1038
+ Z.current === y && ut();
1039
+ }, f = () => {
1040
+ ut();
1018
1041
  };
1019
- return window.addEventListener("keydown", n), window.addEventListener("keyup", s), window.addEventListener("blur", u), () => {
1020
- window.removeEventListener("keydown", n), window.removeEventListener("keyup", s), window.removeEventListener("blur", u), dt();
1042
+ return window.addEventListener("keydown", n), window.addEventListener("keyup", s), window.addEventListener("blur", f), () => {
1043
+ window.removeEventListener("keydown", n), window.removeEventListener("keyup", s), window.removeEventListener("blur", f), ut();
1021
1044
  };
1022
1045
  }, [
1023
- f,
1046
+ h,
1024
1047
  l,
1025
1048
  a,
1026
1049
  ve,
1027
- ut,
1028
- Ee,
1029
- dt
1030
- ]), G(() => {
1031
- f !== "open" && dt();
1032
- }, [f, dt]);
1033
- const je = () => {
1034
- f === "closing" || g || ve();
1035
- }, j = f === "open", re = f === "closing", en = J > 0 ? Math.max(0, 1 - J / 500) : 1, nn = J > 0 ? Math.max(0.35, 1 - J / 500) : 1, jt = m((n) => {
1036
- if (!(n.propertyName !== "transform" || !lt.current)) {
1037
- if (k.current !== null) {
1038
- Wt();
1050
+ ct,
1051
+ Oe,
1052
+ ut
1053
+ ]), B(() => {
1054
+ h !== "open" && ut();
1055
+ }, [h, ut]);
1056
+ const De = () => {
1057
+ h === "closing" || g || ve();
1058
+ }, tt = h === "open", re = h === "closing", sn = K > 0 ? Math.max(0, 1 - K / 500) : 1, ln = K > 0 ? Math.max(0.35, 1 - K / 500) : 1, kt = m((n) => {
1059
+ if (!(n.propertyName !== "transform" || !st.current)) {
1060
+ if (L.current !== null) {
1061
+ jt();
1039
1062
  return;
1040
1063
  }
1041
- I(), F(!1);
1064
+ b(), F(!1);
1042
1065
  }
1043
- }, [I, F, Wt]), ye = f === "closing" ? vt ?? O : O, rn = ye && R && (f === "opening" || re) ? In(ye, R) : void 0, on = tt && h ? Ce(h, "center") : J > 0 ? `translateY(${J}px)` : rn, _ = R ? ae(R, T) : null, Oe = !!(ye && R), sn = Oe && (f === "closing" || f === "open" && wt), ze = {
1066
+ }, [b, F, jt]), ye = h === "closing" ? wt ?? j : j, an = ye && A && (h === "opening" || re) ? An(ye, A) : void 0, cn = vt && d ? Ne(d, "center") : K > 0 ? `translateY(${K}px)` : an, M = A ? ae(A, R) : null, Me = !!(ye && A), un = Me && (h === "closing" || h === "open" && mt), $e = {
1044
1067
  position: "absolute",
1045
- top: _ == null ? void 0 : _.top,
1046
- left: _ == null ? void 0 : _.left,
1047
- width: _ == null ? void 0 : _.width,
1048
- height: _ == null ? void 0 : _.height,
1068
+ top: M == null ? void 0 : M.top,
1069
+ left: M == null ? void 0 : M.left,
1070
+ width: M == null ? void 0 : M.width,
1071
+ height: M == null ? void 0 : M.height,
1049
1072
  objectFit: "contain",
1050
1073
  transformOrigin: "top left",
1051
- transform: on,
1052
- opacity: J > 0 ? nn : Oe ? 1 : f === "opening" || re ? 0 : 1,
1053
- transition: M && !Y ? "none" : Y ? `transform ${Ut}ms ${B}` : Ke ? `transform ${rt}ms ${B}, opacity ${rt}ms ${B}` : sn ? `transform ${rt}ms ${B}` : f === "opening" || re ? `opacity ${rt}ms ${B}` : "none",
1054
- pointerEvents: Qt && j && !tt ? "auto" : "none",
1055
- touchAction: Qt && j ? "none" : void 0,
1074
+ transform: cn,
1075
+ opacity: K > 0 ? ln : Me ? 1 : h === "opening" || re ? 0 : 1,
1076
+ transition: D && !X ? "none" : X ? `transform ${Zt}ms ${V}` : tn ? `transform ${it}ms ${V}, opacity ${it}ms ${V}` : un ? `transform ${it}ms ${V}` : h === "opening" || re ? `opacity ${it}ms ${V}` : "none",
1077
+ pointerEvents: "none",
1056
1078
  zIndex: 1,
1057
- overflow: Qt ? "hidden" : void 0
1058
- }, ln = {
1079
+ overflow: He || Ee ? "hidden" : void 0
1080
+ }, _e = {
1059
1081
  width: "100%",
1060
1082
  height: "100%",
1061
1083
  display: "block",
1062
1084
  objectFit: "contain",
1063
- pointerEvents: j && !tt ? "auto" : "none"
1064
- }, oe = (n, s, u = "adjacent") => {
1065
- const c = Et(n);
1085
+ pointerEvents: "none"
1086
+ }, oe = (n, s, f = "adjacent") => {
1087
+ const c = Wt(n);
1066
1088
  if (!c) return { display: "none" };
1067
- const y = u === "far" ? s === "left" ? "far-left" : "far-right" : s === "left" ? "left-adjacent" : "right-adjacent", { start: V } = Q !== null ? Ue(c, y, Q, T) : {
1068
- start: u === "far" ? ue(c, s, T) : Ot(c, s, T)
1069
- }, p = ae(V, T), S = Ce(n, y), nt = !tt && u === "adjacent" && j && !Gt ? En(c, s, T) : null, it = u === "far" && tt && Q === (s === "left" ? -1 : 1), an = M && !Y ? !1 : Y, cn = u === "adjacent" && j && Gt && !tt;
1089
+ const y = f === "far" ? s === "left" ? "far-left" : "far-right" : s === "left" ? "left-adjacent" : "right-adjacent", { start: _ } = J !== null ? Qe(c, y, J, R) : {
1090
+ start: f === "far" ? ue(c, s, R) : Ot(c, s, R)
1091
+ }, p = ae(_, R), I = Ne(n, y), et = !vt && f === "adjacent" && tt && !Xt ? zn(c, s, R) : null, nt = f === "far" && vt && J === (s === "left" ? -1 : 1), dn = D && !X ? !1 : X, fn = f === "adjacent" && tt && Xt && !vt;
1070
1092
  return {
1071
1093
  position: "absolute",
1072
1094
  top: p.top,
@@ -1074,53 +1096,53 @@ function Dn({
1074
1096
  width: p.width,
1075
1097
  height: p.height,
1076
1098
  objectFit: "contain",
1077
- transform: S ?? (nt ? `translate(${nt.x}px, ${nt.y}px)` : void 0),
1078
- opacity: u === "far" ? j && it ? 1 : 0 : j ? 1 : 0,
1079
- transition: an ? u === "far" ? `transform ${Ut}ms ${B}` : `transform ${Ut}ms ${B}, opacity ${rt}ms ${B}` : cn ? `transform ${rt}ms ${B}` : f === "opening" || re ? `opacity ${rt}ms ${B}` : "none",
1099
+ transform: I ?? (et ? `translate(${et.x}px, ${et.y}px)` : void 0),
1100
+ opacity: f === "far" ? tt && nt ? 1 : 0 : tt ? 1 : 0,
1101
+ transition: dn ? f === "far" ? `transform ${Zt}ms ${V}` : `transform ${Zt}ms ${V}, opacity ${it}ms ${V}` : fn ? `transform ${it}ms ${V}` : h === "opening" || re ? `opacity ${it}ms ${V}` : "none",
1080
1102
  pointerEvents: "none",
1081
1103
  zIndex: 1
1082
1104
  };
1083
- }, De = (n, s) => {
1084
- const u = Et(n);
1085
- return u ? Nn(Ot(u, s, T), s, T) : null;
1086
- }, Me = (n) => (s) => {
1105
+ }, Ve = (n, s) => {
1106
+ const f = Wt(n);
1107
+ return f ? jn(Ot(f, s, R), s, R) : null;
1108
+ }, Be = (n) => (s) => {
1087
1109
  if (!g) {
1088
- if (Z.current) {
1089
- Z.current = !1;
1110
+ if (U.current) {
1111
+ U.current = !1;
1090
1112
  return;
1091
1113
  }
1092
- s.stopPropagation(), Fe(n);
1114
+ s.stopPropagation(), je(n);
1093
1115
  }
1094
- }, _e = C ? De(C, "left") : null, Ve = N ? De(N, "right") : null, Yt = _e ? ae(_e, T) : null, qt = Ve ? ae(Ve, T) : null;
1095
- return /* @__PURE__ */ kt(
1116
+ }, Ge = H ? Ve(H, "left") : null, Xe = E ? Ve(E, "right") : null, qt = Ge ? ae(Ge, R) : null, Ut = Xe ? ae(Xe, R) : null;
1117
+ return /* @__PURE__ */ At(
1096
1118
  "div",
1097
1119
  {
1098
- ref: Kt,
1120
+ ref: Jt,
1099
1121
  className: [
1100
1122
  `${t}-lightbox`,
1101
1123
  l ? `${t}-lightbox-editor` : "",
1102
1124
  g ? `${t}-lightbox-edit-mode` : ""
1103
1125
  ].filter(Boolean).join(" "),
1104
1126
  style: {
1105
- touchAction: f === "open" ? "none" : void 0
1127
+ touchAction: h === "open" ? "none" : void 0
1106
1128
  },
1107
- onClick: je,
1129
+ onClick: De,
1108
1130
  children: [
1109
- /* @__PURE__ */ d(
1131
+ /* @__PURE__ */ u(
1110
1132
  "div",
1111
1133
  {
1112
1134
  style: {
1113
1135
  position: "absolute",
1114
1136
  inset: 0,
1115
1137
  background: o.backgroundColor ?? "#FFFFFF",
1116
- opacity: j ? en : 0,
1117
- transition: M ? "none" : `opacity ${rt}ms ${B}`,
1138
+ opacity: tt ? sn : 0,
1139
+ transition: D ? "none" : `opacity ${it}ms ${V}`,
1118
1140
  pointerEvents: "none"
1119
1141
  }
1120
1142
  }
1121
1143
  ),
1122
- /* @__PURE__ */ kt("div", { className: `${t}-lightbox-dismiss-area`, children: [
1123
- /* @__PURE__ */ kt(
1144
+ /* @__PURE__ */ At("div", { className: `${t}-lightbox-dismiss-area`, children: [
1145
+ /* @__PURE__ */ At(
1124
1146
  "div",
1125
1147
  {
1126
1148
  style: {
@@ -1133,8 +1155,8 @@ function Dn({
1133
1155
  justifyContent: "center"
1134
1156
  },
1135
1157
  children: [
1136
- /* @__PURE__ */ d("div", { style: { height: "10%" } }),
1137
- /* @__PURE__ */ d(
1158
+ /* @__PURE__ */ u("div", { style: { height: "10%" } }),
1159
+ /* @__PURE__ */ u(
1138
1160
  "div",
1139
1161
  {
1140
1162
  style: {
@@ -1144,25 +1166,25 @@ function Dn({
1144
1166
  justifyContent: "center",
1145
1167
  alignItems: "center"
1146
1168
  },
1147
- children: /* @__PURE__ */ d("div", { ref: Rt, style: { width: "100%", height: "100%" } })
1169
+ children: /* @__PURE__ */ u("div", { ref: Tt, style: { width: "100%", height: "100%" } })
1148
1170
  }
1149
1171
  ),
1150
- /* @__PURE__ */ d("div", { style: { height: "10%" } })
1172
+ /* @__PURE__ */ u("div", { style: { height: "10%" } })
1151
1173
  ]
1152
1174
  }
1153
1175
  ),
1154
- /* @__PURE__ */ d(
1176
+ /* @__PURE__ */ u(
1155
1177
  "div",
1156
1178
  {
1157
1179
  style: {
1158
1180
  position: "absolute",
1159
1181
  inset: 0,
1160
- opacity: j ? 1 : 0,
1161
- transition: M ? "none" : `opacity ${rt}ms ${B}`,
1182
+ opacity: tt ? 1 : 0,
1183
+ transition: D ? "none" : `opacity ${it}ms ${V}`,
1162
1184
  pointerEvents: "none"
1163
1185
  },
1164
- children: /* @__PURE__ */ d(
1165
- gn,
1186
+ children: /* @__PURE__ */ u(
1187
+ vn,
1166
1188
  {
1167
1189
  prefix: t,
1168
1190
  entry: r,
@@ -1170,117 +1192,125 @@ function Dn({
1170
1192
  isEditor: l,
1171
1193
  isEditMode: g,
1172
1194
  isPreviewMode: a,
1173
- onClose: je
1195
+ onClose: De
1174
1196
  }
1175
1197
  )
1176
1198
  }
1177
1199
  )
1178
1200
  ] }),
1179
- j && Pt && /* @__PURE__ */ d(
1201
+ tt && Pt && /* @__PURE__ */ u(
1180
1202
  ce,
1181
1203
  {
1182
1204
  media: Pt,
1183
1205
  style: oe(Pt, "left", "far"),
1184
1206
  onMeasure: $t,
1185
- onTransitionEnd: jt
1207
+ onTransitionEnd: kt
1186
1208
  },
1187
1209
  `far-prev-${Pt.assetId}`
1188
1210
  ),
1189
- j && C && /* @__PURE__ */ kt(be, { children: [
1190
- /* @__PURE__ */ d(
1211
+ tt && H && /* @__PURE__ */ At(Ie, { children: [
1212
+ /* @__PURE__ */ u(
1191
1213
  ce,
1192
1214
  {
1193
- media: C,
1194
- style: oe(C, "left"),
1215
+ media: H,
1216
+ style: oe(H, "left"),
1195
1217
  onMeasure: $t,
1196
- onTransitionEnd: jt
1218
+ onTransitionEnd: kt
1197
1219
  },
1198
- `prev-${C.assetId}`
1220
+ `prev-${H.assetId}`
1199
1221
  ),
1200
- Yt && /* @__PURE__ */ d(
1222
+ qt && /* @__PURE__ */ u(
1201
1223
  "div",
1202
1224
  {
1203
1225
  style: {
1204
1226
  position: "absolute",
1205
- top: Yt.top,
1206
- left: Yt.left,
1207
- width: Yt.width,
1208
- height: Yt.height,
1209
- cursor: g || M ? "default" : "pointer",
1210
- pointerEvents: g || M ? "none" : "auto",
1227
+ top: qt.top,
1228
+ left: qt.left,
1229
+ width: qt.width,
1230
+ height: qt.height,
1231
+ cursor: g || D ? "default" : "pointer",
1232
+ pointerEvents: g || D ? "none" : "auto",
1211
1233
  zIndex: 3
1212
1234
  },
1213
- onClick: Me(-1)
1235
+ onClick: Be(-1)
1214
1236
  }
1215
1237
  )
1216
1238
  ] }),
1217
- j && N && /* @__PURE__ */ kt(be, { children: [
1218
- /* @__PURE__ */ d(
1239
+ tt && E && /* @__PURE__ */ At(Ie, { children: [
1240
+ /* @__PURE__ */ u(
1219
1241
  ce,
1220
1242
  {
1221
- media: N,
1222
- style: oe(N, "right"),
1243
+ media: E,
1244
+ style: oe(E, "right"),
1223
1245
  onMeasure: $t,
1224
- onTransitionEnd: jt
1246
+ onTransitionEnd: kt
1225
1247
  },
1226
- `next-${N.assetId}`
1248
+ `next-${E.assetId}`
1227
1249
  ),
1228
- qt && /* @__PURE__ */ d(
1250
+ Ut && /* @__PURE__ */ u(
1229
1251
  "div",
1230
1252
  {
1231
1253
  style: {
1232
1254
  position: "absolute",
1233
- top: qt.top,
1234
- left: qt.left,
1235
- width: qt.width,
1236
- height: qt.height,
1237
- cursor: g || M ? "default" : "pointer",
1238
- pointerEvents: g || M ? "none" : "auto",
1255
+ top: Ut.top,
1256
+ left: Ut.left,
1257
+ width: Ut.width,
1258
+ height: Ut.height,
1259
+ cursor: g || D ? "default" : "pointer",
1260
+ pointerEvents: g || D ? "none" : "auto",
1239
1261
  zIndex: 3
1240
1262
  },
1241
- onClick: Me(1)
1263
+ onClick: Be(1)
1242
1264
  }
1243
1265
  )
1244
1266
  ] }),
1245
- j && te && /* @__PURE__ */ d(
1267
+ tt && te && /* @__PURE__ */ u(
1246
1268
  ce,
1247
1269
  {
1248
1270
  media: te,
1249
1271
  style: oe(te, "right", "far"),
1250
1272
  onMeasure: $t,
1251
- onTransitionEnd: jt
1273
+ onTransitionEnd: kt
1252
1274
  },
1253
1275
  `far-next-${te.assetId}`
1254
1276
  ),
1255
- R && h && (Qt ? /* @__PURE__ */ d(
1256
- zn,
1277
+ A && d && (Ee ? /* @__PURE__ */ u("div", { style: $e, onTransitionEnd: kt, children: /* @__PURE__ */ u(
1278
+ Ze,
1279
+ {
1280
+ media: d,
1281
+ fit: "contain",
1282
+ lazy: !1,
1283
+ startsAtOnce: !0,
1284
+ style: _e
1285
+ }
1286
+ ) }, `${i}-${d.assetId}`) : He ? /* @__PURE__ */ u(
1287
+ Vn,
1257
1288
  {
1258
- src: h.assetId,
1259
- phase: f,
1260
- onMediaElement: We,
1261
- wrapperStyle: ze,
1262
- videoStyle: ln,
1263
- onLoadedMetadata: et,
1264
- onTransitionEnd: jt
1289
+ src: d.assetId,
1290
+ onMediaElement: ze,
1291
+ wrapperStyle: $e,
1292
+ videoStyle: _e,
1293
+ onLoadedMetadata: P,
1294
+ onTransitionEnd: kt
1265
1295
  },
1266
- `${i}-${h.assetId}`
1267
- ) : /* @__PURE__ */ d(
1296
+ `${i}-${d.assetId}`
1297
+ ) : /* @__PURE__ */ u(
1268
1298
  "img",
1269
1299
  {
1270
- ref: We,
1271
- src: h.assetId,
1272
- alt: h.name,
1273
- onLoad: et,
1274
- onTransitionEnd: jt,
1275
- style: ze
1300
+ ref: ze,
1301
+ src: d.assetId,
1302
+ alt: d.name,
1303
+ onLoad: P,
1304
+ onTransitionEnd: kt,
1305
+ style: $e
1276
1306
  },
1277
- `${i}-${h.assetId}`
1307
+ `${i}-${d.assetId}`
1278
1308
  ))
1279
1309
  ]
1280
1310
  }
1281
1311
  );
1282
1312
  }
1283
- function Zn({
1313
+ function ti({
1284
1314
  settings: t,
1285
1315
  content: e,
1286
1316
  isEditor: i,
@@ -1289,10 +1319,10 @@ function Zn({
1289
1319
  layoutId: l,
1290
1320
  portalId: g
1291
1321
  }) {
1292
- const { prefix: a } = un(), { gridLayout: b, verticalGap: L, align: ot = "top", imageDisplay: X } = t, O = (X == null ? void 0 : X.display) === "cover", At = (X == null ? void 0 : X.ratioValue) ?? "1:1", Dt = (X == null ? void 0 : X.reversed) ?? !1, [Mt, _t] = At.split(":").map(Number), Tt = `${Dt ? _t : Mt} / ${Dt ? Mt : _t}`, Ht = b.entryWidth ?? 0.2, q = b.columnsCount, Ct = se(Ht, i), st = se(b.horizontalGap ?? 0, i), xt = Ct, z = Ct, W = {
1322
+ const { prefix: a } = hn(), { gridLayout: W, verticalGap: S, align: rt = "top", imageDisplay: G } = t, j = (G == null ? void 0 : G.display) === "cover", Rt = (G == null ? void 0 : G.ratioValue) ?? "1:1", Mt = (G == null ? void 0 : G.reversed) ?? !1, [_t, Vt] = Rt.split(":").map(Number), Ht = `${Mt ? Vt : _t} / ${Mt ? _t : Vt}`, Et = W.entryWidth ?? 0.2, Y = W.columnsCount, Ft = se(Et, i), ot = se(W.horizontalGap ?? 0, i), xt = Ft, O = Ft, N = {
1293
1323
  width: xt,
1294
- ...O ? { aspectRatio: Tt, height: "auto", overflow: "hidden" } : { height: "auto" }
1295
- }, U = O ? {
1324
+ ...j ? { aspectRatio: Ht, height: "auto", overflow: "hidden" } : { height: "auto" }
1325
+ }, q = j ? {
1296
1326
  objectFit: "cover",
1297
1327
  pointerEvents: "auto",
1298
1328
  width: "100%",
@@ -1304,116 +1334,116 @@ function Zn({
1304
1334
  width: "auto",
1305
1335
  height: "auto",
1306
1336
  maxWidth: "100%"
1307
- }, Z = w(null), [lt, at] = $(!1), [k, Nt] = $([]), [ft, K] = $(0), [D, ht] = $(0), [ct, R] = $(null), [bt, T] = $({
1337
+ }, U = w(null), [st, lt] = $(!1), [L, Ct] = $([]), [dt, Z] = $(0), [z, ft] = $(0), [at, A] = $(null), [bt, R] = $({
1308
1338
  title1: "",
1309
1339
  title2: "",
1310
1340
  title3: ""
1311
- }), Jt = (() => {
1312
- const x = {}, v = Z.current ? getComputedStyle(Z.current).getPropertyValue("--cntrl-article-width").trim() : "";
1341
+ }), Qt = (() => {
1342
+ const x = {}, v = U.current ? getComputedStyle(U.current).getPropertyValue("--cntrl-article-width").trim() : "";
1313
1343
  return v && (x["--cntrl-article-width"] = v), x;
1314
- })(), de = !i || r || o, fe = $e(() => wn(a), [a]), f = e ?? [], gt = f.length % q || q, J = gt < q && f.length > 0, It = f.length - gt, Vt = J ? Math.floor((q - gt) / 2) + 1 : 1, A = $e(() => Ln(f), [f]), Y = $e(() => Hn(f), [f]), he = (x, v, wt) => {
1344
+ })(), de = !i || r || o, fe = xe(() => xn(a), [a]), h = e ?? [], ht = h.length % Y || Y, K = ht < Y && h.length > 0, It = h.length - ht, Bt = K ? Math.floor((Y - ht) / 2) + 1 : 1, k = xe(() => Tn(h), [h]), X = xe(() => Nn(h), [h]), he = (x, v, mt) => {
1315
1345
  if (i && !o && !r) return;
1316
- const H = A.findIndex((Bt) => Bt.gridIndex === x);
1317
- if (H < 0) return;
1318
- const vt = A[H];
1319
- ht(H), Nt(vt.items), K(v), T(vt.entry), R(wt ?? null), at(!0);
1320
- }, Q = m(() => {
1321
- at(!1), R(null);
1322
- }, []), pt = m(() => {
1323
- const x = A[D];
1324
- return !x || !Z.current ? ct : Sn(
1325
- Z.current,
1346
+ const T = k.findIndex((Gt) => Gt.gridIndex === x);
1347
+ if (T < 0) return;
1348
+ const wt = k[T];
1349
+ ft(T), Ct(wt.items), Z(v), R(wt.entry), A(mt ?? null), lt(!0);
1350
+ }, J = m(() => {
1351
+ lt(!1), A(null);
1352
+ }, []), gt = m(() => {
1353
+ const x = k[z];
1354
+ return !x || !U.current ? at : Rn(
1355
+ U.current,
1326
1356
  x.gridIndex,
1327
- O ? "cover" : "contain"
1328
- ) ?? ct;
1329
- }, [A, D, ct, O]), St = m((x) => {
1330
- if (A.length > 1) {
1331
- const v = A.length, wt = (D + x + v) % v, H = A[wt], vt = Math.min(ft, H.items.length - 1);
1332
- ht(wt), Nt(H.items), K(vt), T(H.entry);
1357
+ j ? "cover" : "contain"
1358
+ ) ?? at;
1359
+ }, [k, z, at, j]), St = m((x) => {
1360
+ if (k.length > 1) {
1361
+ const v = k.length, mt = (z + x + v) % v, T = k[mt], wt = Math.min(dt, T.items.length - 1);
1362
+ ft(mt), Ct(T.items), Z(wt), R(T.entry);
1333
1363
  return;
1334
1364
  }
1335
- K((v) => (v + x + k.length) % k.length);
1336
- }, [A, D, ft, k.length]), mt = A.length > 1 || k.length > 1;
1337
- return G(() => {
1338
- if (!lt || typeof document > "u") return;
1365
+ Z((v) => (v + x + L.length) % L.length);
1366
+ }, [k, z, dt, L.length]), pt = k.length > 1 || L.length > 1;
1367
+ return B(() => {
1368
+ if (!st || typeof document > "u") return;
1339
1369
  const x = document.body.style.overflow;
1340
1370
  return document.body.style.overflow = "hidden", () => {
1341
1371
  document.body.style.overflow = x;
1342
1372
  };
1343
- }, [lt]), G(() => {
1344
- !i || o || r || at(!1);
1345
- }, [i, o, r]), /* @__PURE__ */ kt(be, { children: [
1346
- /* @__PURE__ */ d("style", { dangerouslySetInnerHTML: { __html: fe } }),
1347
- /* @__PURE__ */ d(Cn, { mediaList: Y }),
1348
- /* @__PURE__ */ d(
1373
+ }, [st]), B(() => {
1374
+ !i || o || r || lt(!1);
1375
+ }, [i, o, r]), /* @__PURE__ */ At(Ie, { children: [
1376
+ /* @__PURE__ */ u("style", { dangerouslySetInnerHTML: { __html: fe } }),
1377
+ /* @__PURE__ */ u(Wn, { mediaList: X }),
1378
+ /* @__PURE__ */ u(
1349
1379
  "div",
1350
1380
  {
1351
- ref: Z,
1352
- className: `${a}-wrapper ${a}-align-entries ${a}-image-align-${ot}`.trim(),
1381
+ ref: U,
1382
+ className: `${a}-wrapper ${a}-align-entries ${a}-image-align-${rt}`.trim(),
1353
1383
  style: {
1354
- gridTemplateColumns: `repeat(${q}, ${Ct})`,
1384
+ gridTemplateColumns: `repeat(${Y}, ${Ft})`,
1355
1385
  rowGap: 0,
1356
- columnGap: st,
1357
- width: se(b.wrapperWidth ?? 0, i),
1358
- [`--${a}-align-entries-row-gap`]: se(L ?? 0, i)
1386
+ columnGap: ot,
1387
+ width: se(W.wrapperWidth ?? 0, i),
1388
+ [`--${a}-align-entries-row-gap`]: se(S ?? 0, i)
1359
1389
  },
1360
- children: f.map((x, v) => {
1361
- const wt = Se(x.gallery), H = Le(wt), vt = H.filter((E) => E.lightboxMedia).map((E) => E.lightboxMedia), Bt = Math.floor(v / q) === Math.ceil(f.length / q) - 1, Gt = J && v >= It ? `${Vt + (v - It)}` : void 0, P = H[0], Lt = P != null && P.lightboxMedia ? vt.findIndex((E) => E.assetId === P.lightboxMedia.assetId) : -1, M = /* @__PURE__ */ d("div", { className: `${a}-item-image-wrapper`, style: W, children: H.length > 0 && /* @__PURE__ */ d(
1362
- On,
1390
+ children: h.map((x, v) => {
1391
+ const mt = Le(x.gallery), T = ke(mt), wt = T.filter((C) => C.lightboxMedia).map((C) => C.lightboxMedia), Gt = Math.floor(v / Y) === Math.ceil(h.length / Y) - 1, Xt = K && v >= It ? `${Bt + (v - It)}` : void 0, Q = T[0], Lt = Q != null && Q.lightboxMedia ? wt.findIndex((C) => C.assetId === Q.lightboxMedia.assetId) : -1, D = /* @__PURE__ */ u("div", { className: `${a}-item-image-wrapper`, style: N, children: T.length > 0 && /* @__PURE__ */ u(
1392
+ _n,
1363
1393
  {
1364
- media: P.displayMedia,
1394
+ media: Q.displayMedia,
1365
1395
  gridIndex: v,
1366
- className: `${a}-item-${zt(P.displayMedia) ? "video" : "image"}`.trim(),
1367
- style: U,
1368
- onMediaClick: de && Lt >= 0 ? (E) => he(
1396
+ className: `${a}-item-${Dt(Q.displayMedia) ? "video" : "image"}`.trim(),
1397
+ style: q,
1398
+ onMediaClick: de && Lt >= 0 ? (C) => he(
1369
1399
  v,
1370
1400
  Lt,
1371
- Ye(E.currentTarget, O ? "cover" : "contain")
1401
+ Ke(C.currentTarget, j ? "cover" : "contain")
1372
1402
  ) : void 0
1373
1403
  }
1374
1404
  ) });
1375
- return /* @__PURE__ */ d("div", { className: `${a}-item`, children: /* @__PURE__ */ kt(
1405
+ return /* @__PURE__ */ u("div", { className: `${a}-item`, children: /* @__PURE__ */ At(
1376
1406
  "div",
1377
1407
  {
1378
1408
  className: [
1379
1409
  o ? `${a}-item-inner` : `${a}-item-inner-hidden`,
1380
- Bt ? `${a}-item-inner-last-row` : ""
1410
+ Gt ? `${a}-item-inner-last-row` : ""
1381
1411
  ].filter(Boolean).join(" "),
1382
1412
  style: {
1383
- width: Ct,
1384
- ...Gt ? { gridColumn: Gt } : {}
1413
+ width: Ft,
1414
+ ...Xt ? { gridColumn: Xt } : {}
1385
1415
  },
1386
1416
  children: [
1387
- /* @__PURE__ */ d("div", { className: `${a}-item-title-row`, children: /* @__PURE__ */ d("div", { style: { height: 0, width: z } }) }),
1388
- /* @__PURE__ */ d("a", { className: `${a}-item-image-link`, children: M }),
1389
- /* @__PURE__ */ d("div", { className: `${a}-item-subtitle-row`, children: /* @__PURE__ */ d("div", { style: { height: 0, width: z } }) })
1417
+ /* @__PURE__ */ u("div", { className: `${a}-item-title-row`, children: /* @__PURE__ */ u("div", { style: { height: 0, width: O } }) }),
1418
+ /* @__PURE__ */ u("a", { className: `${a}-item-image-link`, children: D }),
1419
+ /* @__PURE__ */ u("div", { className: `${a}-item-subtitle-row`, children: /* @__PURE__ */ u("div", { style: { height: 0, width: O } }) })
1390
1420
  ]
1391
1421
  }
1392
1422
  ) }, v);
1393
1423
  })
1394
1424
  }
1395
1425
  ),
1396
- lt && typeof document < "u" && (() => {
1426
+ st && typeof document < "u" && (() => {
1397
1427
  const x = (g ? document.getElementById(g) : null) ?? document.body;
1398
- return hn(
1399
- /* @__PURE__ */ d("div", { style: Jt, "data-selection": "none", children: /* @__PURE__ */ d(
1400
- Dn,
1428
+ return wn(
1429
+ /* @__PURE__ */ u("div", { style: Qt, "data-selection": "none", children: /* @__PURE__ */ u(
1430
+ Bn,
1401
1431
  {
1402
1432
  prefix: a,
1403
- items: k,
1404
- index: ft,
1433
+ items: L,
1434
+ index: dt,
1405
1435
  entry: bt,
1406
1436
  settings: t,
1407
1437
  isEditor: i,
1408
1438
  isEditMode: o,
1409
1439
  isPreviewMode: r,
1410
- canNavigate: mt,
1411
- lightboxEntries: A,
1412
- entryIdx: D,
1440
+ canNavigate: pt,
1441
+ lightboxEntries: k,
1442
+ entryIdx: z,
1413
1443
  layoutId: l,
1414
- sourceRect: ct,
1415
- resolveCloseSourceRect: pt,
1416
- onClose: Q,
1444
+ sourceRect: at,
1445
+ resolveCloseSourceRect: gt,
1446
+ onClose: J,
1417
1447
  onPrev: () => St(-1),
1418
1448
  onNext: () => St(1)
1419
1449
  }
@@ -1424,5 +1454,5 @@ function Zn({
1424
1454
  ] });
1425
1455
  }
1426
1456
  export {
1427
- Zn as Hive
1457
+ ti as Hive
1428
1458
  };