@frybynite/image-cloud 0.7.4 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.js CHANGED
@@ -1,12 +1,12 @@
1
- import { jsx as $t } from "react/jsx-runtime";
2
- import { forwardRef as Pt, useRef as wt, useImperativeHandle as Ut, useEffect as _t } from "react";
3
- const ft = Object.freeze({
1
+ import { jsx as Ot } from "react/jsx-runtime";
2
+ import { forwardRef as Pt, useRef as xt, useImperativeHandle as Ut, useEffect as _t } from "react";
3
+ const gt = Object.freeze({
4
4
  none: "none",
5
5
  sm: "0 2px 4px rgba(0,0,0,0.1)",
6
6
  md: "0 4px 16px rgba(0,0,0,0.4)",
7
7
  lg: "0 8px 32px rgba(0,0,0,0.5)",
8
8
  glow: "0 0 30px rgba(255,255,255,0.6)"
9
- }), xt = Object.freeze({
9
+ }), Et = Object.freeze({
10
10
  energetic: Object.freeze({ overshoot: 0.25, bounces: 2, decayRatio: 0.5 }),
11
11
  playful: Object.freeze({ overshoot: 0.15, bounces: 1, decayRatio: 0.5 }),
12
12
  subtle: Object.freeze({ overshoot: 0.08, bounces: 1, decayRatio: 0.5 })
@@ -15,18 +15,18 @@ const ft = Object.freeze({
15
15
  bouncy: Object.freeze({ stiffness: 300, damping: 15, mass: 1, oscillations: 4 }),
16
16
  wobbly: Object.freeze({ stiffness: 180, damping: 12, mass: 1.5, oscillations: 5 }),
17
17
  snappy: Object.freeze({ stiffness: 400, damping: 25, mass: 0.8, oscillations: 2 })
18
- }), Et = Object.freeze({
18
+ }), It = Object.freeze({
19
19
  gentle: Object.freeze({ amplitude: 30, frequency: 1.5, decay: !0, decayRate: 0.9, phase: 0 }),
20
20
  playful: Object.freeze({ amplitude: 50, frequency: 2.5, decay: !0, decayRate: 0.7, phase: 0 }),
21
21
  serpentine: Object.freeze({ amplitude: 60, frequency: 3, decay: !1, decayRate: 1, phase: 0 }),
22
22
  flutter: Object.freeze({ amplitude: 20, frequency: 4, decay: !0, decayRate: 0.5, phase: 0 })
23
23
  }), pt = Object.freeze({
24
24
  type: "linear"
25
- }), bt = Object.freeze({
26
- mode: "none"
27
25
  }), yt = Object.freeze({
28
26
  mode: "none"
29
- }), Ct = Object.freeze({
27
+ }), bt = Object.freeze({
28
+ mode: "none"
29
+ }), Rt = Object.freeze({
30
30
  default: Object.freeze({
31
31
  border: Object.freeze({
32
32
  width: 0,
@@ -80,28 +80,28 @@ const ft = Object.freeze({
80
80
  min: -15,
81
81
  max: 15
82
82
  })
83
- }), Rt = Object.freeze({
83
+ }), Mt = Object.freeze({
84
84
  sizing: jt,
85
85
  rotation: kt
86
- }), Mt = Object.freeze({
86
+ }), Lt = Object.freeze({
87
87
  validateUrls: !0,
88
88
  validationTimeout: 5e3,
89
89
  validationMethod: "head",
90
90
  allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "bmp"]
91
- }), Lt = Object.freeze({
91
+ }), zt = Object.freeze({
92
92
  enabled: !1,
93
93
  centers: !1,
94
94
  loaders: !1
95
- }), y = Object.freeze({
95
+ }), b = Object.freeze({
96
96
  // Loader configuration (always an array, composite behavior is implicit)
97
97
  loaders: [],
98
98
  // Shared loader settings and debug config
99
99
  config: Object.freeze({
100
- loaders: Mt,
101
- debug: Lt
100
+ loaders: Lt,
101
+ debug: zt
102
102
  }),
103
103
  // Image sizing and rotation configuration
104
- image: Rt,
104
+ image: Mt,
105
105
  // Pattern-based layout configuration
106
106
  layout: Object.freeze({
107
107
  algorithm: "radial",
@@ -164,8 +164,8 @@ const ft = Object.freeze({
164
164
  easing: "cubic-bezier(0.25, 1, 0.5, 1)",
165
165
  // smooth deceleration
166
166
  path: pt,
167
- rotation: bt,
168
- scale: yt
167
+ rotation: yt,
168
+ scale: bt
169
169
  })
170
170
  }),
171
171
  // Pattern-based interaction configuration
@@ -218,7 +218,7 @@ const ft = Object.freeze({
218
218
  })
219
219
  }),
220
220
  // Image styling
221
- styling: Ct
221
+ styling: Rt
222
222
  });
223
223
  function Z(n, t) {
224
224
  if (!n) return t || {};
@@ -248,15 +248,15 @@ function Gt(n, t) {
248
248
  ...n.sizing,
249
249
  ...t.sizing
250
250
  }, t.sizing.variance)) {
251
- const i = t.sizing.variance, o = i.min !== void 0 && i.min >= 0.25 && i.min <= 1 ? i.min : n.sizing?.variance?.min ?? 1, s = i.max !== void 0 && i.max >= 1 && i.max <= 1.75 ? i.max : n.sizing?.variance?.max ?? 1;
252
- e.sizing.variance = { min: o, max: s };
251
+ const i = t.sizing.variance, o = i.min !== void 0 && i.min >= 0.25 && i.min <= 1 ? i.min : n.sizing?.variance?.min ?? 1, a = i.max !== void 0 && i.max >= 1 && i.max <= 1.75 ? i.max : n.sizing?.variance?.max ?? 1;
252
+ e.sizing.variance = { min: o, max: a };
253
253
  }
254
254
  if (t.rotation !== void 0 && (e.rotation = {
255
255
  ...n.rotation,
256
256
  ...t.rotation
257
257
  }, t.rotation.range)) {
258
- const i = t.rotation.range, o = i.min !== void 0 && i.min >= -180 && i.min <= 0 ? i.min : n.rotation?.range?.min ?? -15, s = i.max !== void 0 && i.max >= 0 && i.max <= 180 ? i.max : n.rotation?.range?.max ?? 15;
259
- e.rotation.range = { min: o, max: s };
258
+ const i = t.rotation.range, o = i.min !== void 0 && i.min >= -180 && i.min <= 0 ? i.min : n.rotation?.range?.min ?? -15, a = i.max !== void 0 && i.max >= 0 && i.max <= 180 ? i.max : n.rotation?.range?.max ?? 15;
259
+ e.rotation.range = { min: o, max: a };
260
260
  }
261
261
  return e;
262
262
  }
@@ -300,92 +300,92 @@ function Xt(n = {}) {
300
300
  });
301
301
  const r = {
302
302
  loaders: {
303
- ...Mt,
303
+ ...Lt,
304
304
  ...n.config?.loaders ?? {}
305
305
  }
306
- }, a = {
306
+ }, s = {
307
307
  loaders: o,
308
308
  config: r,
309
- image: Gt(Rt, i),
310
- layout: { ...y.layout },
311
- animation: { ...y.animation },
312
- interaction: { ...y.interaction },
313
- rendering: { ...y.rendering },
314
- styling: Wt(Ct, n.styling)
309
+ image: Gt(Mt, i),
310
+ layout: { ...b.layout },
311
+ animation: { ...b.animation },
312
+ interaction: { ...b.interaction },
313
+ rendering: { ...b.rendering },
314
+ styling: Wt(Rt, n.styling)
315
315
  };
316
- return n.layout && (a.layout = {
317
- ...y.layout,
316
+ return n.layout && (s.layout = {
317
+ ...b.layout,
318
318
  ...n.layout
319
- }, n.layout.responsive && (a.layout.responsive = {
320
- ...y.layout.responsive,
321
- mobile: n.layout.responsive.mobile ? { ...y.layout.responsive.mobile, ...n.layout.responsive.mobile } : y.layout.responsive.mobile,
322
- tablet: n.layout.responsive.tablet ? { ...y.layout.responsive.tablet, ...n.layout.responsive.tablet } : y.layout.responsive.tablet
323
- }), n.layout.spacing && (a.layout.spacing = {
324
- ...y.layout.spacing,
319
+ }, n.layout.responsive && (s.layout.responsive = {
320
+ ...b.layout.responsive,
321
+ mobile: n.layout.responsive.mobile ? { ...b.layout.responsive.mobile, ...n.layout.responsive.mobile } : b.layout.responsive.mobile,
322
+ tablet: n.layout.responsive.tablet ? { ...b.layout.responsive.tablet, ...n.layout.responsive.tablet } : b.layout.responsive.tablet
323
+ }), n.layout.spacing && (s.layout.spacing = {
324
+ ...b.layout.spacing,
325
325
  ...n.layout.spacing
326
- })), n.animation && (a.animation = {
327
- ...y.animation,
326
+ })), n.animation && (s.animation = {
327
+ ...b.animation,
328
328
  ...n.animation
329
- }, n.animation.easing && (a.animation.easing = {
330
- ...y.animation.easing,
329
+ }, n.animation.easing && (s.animation.easing = {
330
+ ...b.animation.easing,
331
331
  ...n.animation.easing
332
- }), n.animation.queue && (a.animation.queue = {
333
- ...y.animation.queue,
332
+ }), n.animation.queue && (s.animation.queue = {
333
+ ...b.animation.queue,
334
334
  ...n.animation.queue
335
- }), n.animation.performance && (a.animation.performance = {
336
- ...y.animation.performance,
335
+ }), n.animation.performance && (s.animation.performance = {
336
+ ...b.animation.performance,
337
337
  ...n.animation.performance
338
- }), n.animation.entry && (a.animation.entry = {
339
- ...y.animation.entry,
338
+ }), n.animation.entry && (s.animation.entry = {
339
+ ...b.animation.entry,
340
340
  ...n.animation.entry,
341
341
  start: n.animation.entry.start ? {
342
- ...y.animation.entry.start,
342
+ ...b.animation.entry.start,
343
343
  ...n.animation.entry.start,
344
- circular: n.animation.entry.start.circular ? { ...y.animation.entry.start.circular, ...n.animation.entry.start.circular } : y.animation.entry.start.circular
345
- } : y.animation.entry.start,
346
- timing: n.animation.entry.timing ? { ...y.animation.entry.timing, ...n.animation.entry.timing } : y.animation.entry.timing,
347
- path: n.animation.entry.path ? { ...pt, ...n.animation.entry.path } : y.animation.entry.path,
348
- rotation: n.animation.entry.rotation ? { ...bt, ...n.animation.entry.rotation } : y.animation.entry.rotation,
349
- scale: n.animation.entry.scale ? { ...yt, ...n.animation.entry.scale } : y.animation.entry.scale
350
- })), n.interaction && (a.interaction = {
351
- ...y.interaction,
344
+ circular: n.animation.entry.start.circular ? { ...b.animation.entry.start.circular, ...n.animation.entry.start.circular } : b.animation.entry.start.circular
345
+ } : b.animation.entry.start,
346
+ timing: n.animation.entry.timing ? { ...b.animation.entry.timing, ...n.animation.entry.timing } : b.animation.entry.timing,
347
+ path: n.animation.entry.path ? { ...pt, ...n.animation.entry.path } : b.animation.entry.path,
348
+ rotation: n.animation.entry.rotation ? { ...yt, ...n.animation.entry.rotation } : b.animation.entry.rotation,
349
+ scale: n.animation.entry.scale ? { ...bt, ...n.animation.entry.scale } : b.animation.entry.scale
350
+ })), n.interaction && (s.interaction = {
351
+ ...b.interaction,
352
352
  ...n.interaction
353
- }, n.interaction.focus && (a.interaction.focus = {
354
- ...y.interaction.focus,
353
+ }, n.interaction.focus && (s.interaction.focus = {
354
+ ...b.interaction.focus,
355
355
  ...n.interaction.focus
356
- }), n.interaction.navigation && (a.interaction.navigation = {
357
- ...y.interaction.navigation,
356
+ }), n.interaction.navigation && (s.interaction.navigation = {
357
+ ...b.interaction.navigation,
358
358
  ...n.interaction.navigation
359
- }), n.interaction.gestures && (a.interaction.gestures = {
360
- ...y.interaction.gestures,
359
+ }), n.interaction.gestures && (s.interaction.gestures = {
360
+ ...b.interaction.gestures,
361
361
  ...n.interaction.gestures
362
- })), n.rendering && (a.rendering = {
363
- ...y.rendering,
362
+ })), n.rendering && (s.rendering = {
363
+ ...b.rendering,
364
364
  ...n.rendering
365
- }, n.rendering.responsive && (a.rendering.responsive = {
366
- ...y.rendering.responsive,
365
+ }, n.rendering.responsive && (s.rendering.responsive = {
366
+ ...b.rendering.responsive,
367
367
  ...n.rendering.responsive,
368
- breakpoints: n.rendering.responsive.breakpoints ? { ...y.rendering.responsive.breakpoints, ...n.rendering.responsive.breakpoints } : y.rendering.responsive.breakpoints,
369
- mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection : y.rendering.responsive.mobileDetection
370
- }), n.rendering.ui && (a.rendering.ui = {
371
- ...y.rendering.ui,
368
+ breakpoints: n.rendering.responsive.breakpoints ? { ...b.rendering.responsive.breakpoints, ...n.rendering.responsive.breakpoints } : b.rendering.responsive.breakpoints,
369
+ mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection : b.rendering.responsive.mobileDetection
370
+ }), n.rendering.ui && (s.rendering.ui = {
371
+ ...b.rendering.ui,
372
372
  ...n.rendering.ui
373
- }), n.rendering.performance && (a.rendering.performance = {
374
- ...y.rendering.performance,
373
+ }), n.rendering.performance && (s.rendering.performance = {
374
+ ...b.rendering.performance,
375
375
  ...n.rendering.performance
376
- })), a.config.debug = {
377
- ...Lt,
376
+ })), s.config.debug = {
377
+ ...zt,
378
378
  ...n.config?.debug ?? {}
379
- }, a;
379
+ }, s;
380
380
  }
381
381
  function Bt(n, t) {
382
- return { ...n ? xt[n] : xt.playful, ...t };
382
+ return { ...n ? Et[n] : Et.playful, ...t };
383
383
  }
384
384
  function Jt(n, t) {
385
385
  return { ...n ? St[n] : St.gentle, ...t };
386
386
  }
387
387
  function Vt(n, t) {
388
- return { ...n ? Et[n] : Et.gentle, ...t };
388
+ return { ...n ? It[n] : It.gentle, ...t };
389
389
  }
390
390
  class Kt {
391
391
  constructor(t) {
@@ -412,31 +412,31 @@ class Kt {
412
412
  * @param easing - CSS easing function (optional)
413
413
  * @returns AnimationHandle that can be used to cancel or query the animation
414
414
  */
415
- animateTransformCancellable(t, e, i, o = null, s = null) {
415
+ animateTransformCancellable(t, e, i, o = null, a = null) {
416
416
  this.cancelAllAnimations(t);
417
- const r = o ?? this.config.duration, a = s ?? this.config.easing.default, h = this.buildTransformString(e), c = this.buildTransformString(i);
417
+ const r = o ?? this.config.duration, s = a ?? this.config.easing.default, h = this.buildTransformString(e), c = this.buildTransformString(i);
418
418
  t.style.transition = "none";
419
- const u = t.animate(
419
+ const d = t.animate(
420
420
  [
421
421
  { transform: h },
422
422
  { transform: c }
423
423
  ],
424
424
  {
425
425
  duration: r,
426
- easing: a,
426
+ easing: s,
427
427
  fill: "forwards"
428
428
  // Keep final state after animation
429
429
  }
430
430
  ), l = {
431
431
  id: `anim-${++this.animationIdCounter}`,
432
432
  element: t,
433
- animation: u,
433
+ animation: d,
434
434
  fromState: e,
435
435
  toState: i,
436
436
  startTime: performance.now(),
437
437
  duration: r
438
438
  };
439
- return this.activeAnimations.set(t, l), u.finished.then(() => {
439
+ return this.activeAnimations.set(t, l), d.finished.then(() => {
440
440
  t.style.transform = c, this.activeAnimations.delete(t);
441
441
  }).catch(() => {
442
442
  this.activeAnimations.delete(t);
@@ -483,8 +483,8 @@ class Kt {
483
483
  const i = getComputedStyle(t).transform;
484
484
  if (i === "none" || !i)
485
485
  return { x: 0, y: 0, rotation: 0, scale: 1 };
486
- const o = new DOMMatrix(i), s = Math.sqrt(o.a * o.a + o.b * o.b), r = Math.atan2(o.b, o.a) * (180 / Math.PI), a = o.e, h = o.f;
487
- return { x: a, y: h, rotation: r, scale: s };
486
+ const o = new DOMMatrix(i), a = Math.sqrt(o.a * o.a + o.b * o.b), r = Math.atan2(o.b, o.a) * (180 / Math.PI), s = o.e, h = o.f;
487
+ return { x: s, y: h, rotation: r, scale: a };
488
488
  }
489
489
  /**
490
490
  * Check if an element has an active animation
@@ -511,10 +511,10 @@ class Kt {
511
511
  * @returns Promise that resolves when animation completes
512
512
  */
513
513
  animateTransform(t, e, i = null, o = null) {
514
- return new Promise((s) => {
515
- const r = i ?? this.config.duration, a = o ?? this.config.easing.default;
516
- t.style.transition = `transform ${r}ms ${a}, box-shadow ${r}ms ${a}`, t.style.transform = this.buildTransformString(e), setTimeout(() => {
517
- s();
514
+ return new Promise((a) => {
515
+ const r = i ?? this.config.duration, s = o ?? this.config.easing.default;
516
+ t.style.transition = `transform ${r}ms ${s}, box-shadow ${r}ms ${s}`, t.style.transform = this.buildTransformString(e), setTimeout(() => {
517
+ a();
518
518
  }, r);
519
519
  });
520
520
  }
@@ -547,27 +547,27 @@ function V(n, t, e) {
547
547
  return n + (t - n) * e;
548
548
  }
549
549
  function Zt(n, t, e, i) {
550
- const { overshoot: o, bounces: s, decayRatio: r } = i, a = e.x - t.x, h = e.y - t.y, c = Qt(s, r);
551
- let u = 0, l = 0, d = 1, f = o, b = !1;
552
- for (let g = 0; g < c.length; g++)
553
- if (n <= c[g].time) {
554
- l = g === 0 ? 0 : c[g - 1].time, d = c[g].time, f = c[g].overshoot, b = c[g].isOvershoot;
550
+ const { overshoot: o, bounces: a, decayRatio: r } = i, s = e.x - t.x, h = e.y - t.y, c = Qt(a, r);
551
+ let d = 0, l = 0, u = 1, g = o, p = !1;
552
+ for (let f = 0; f < c.length; f++)
553
+ if (n <= c[f].time) {
554
+ l = f === 0 ? 0 : c[f - 1].time, u = c[f].time, g = c[f].overshoot, p = c[f].isOvershoot;
555
555
  break;
556
556
  }
557
- const p = (n - l) / (d - l);
558
- if (b)
559
- u = 1 + f * ot(p);
557
+ const y = (n - l) / (u - l);
558
+ if (p)
559
+ d = 1 + g * it(y);
560
560
  else if (l === 0)
561
- u = ot(p);
561
+ d = it(y);
562
562
  else {
563
563
  const m = 1 + (c.find(
564
- (S, v) => S.time > l && v > 0 && c[v - 1].isOvershoot
565
- )?.overshoot || f);
566
- u = V(m, 1, ot(p));
564
+ (E, v) => E.time > l && v > 0 && c[v - 1].isOvershoot
565
+ )?.overshoot || g);
566
+ d = V(m, 1, it(y));
567
567
  }
568
568
  return {
569
- x: t.x + a * u,
570
- y: t.y + h * u
569
+ x: t.x + s * d,
570
+ y: t.y + h * d
571
571
  };
572
572
  }
573
573
  function Qt(n, t) {
@@ -576,56 +576,56 @@ function Qt(n, t) {
576
576
  e.push({ time: i, overshoot: 0, isOvershoot: !1 });
577
577
  let o = 0.15;
578
578
  const r = 0.4 / (n * 2);
579
- for (let a = 0; a < n; a++)
579
+ for (let s = 0; s < n; s++)
580
580
  i += r, e.push({ time: i, overshoot: o, isOvershoot: !0 }), i += r, e.push({ time: i, overshoot: o * t, isOvershoot: !1 }), o *= t;
581
581
  return e.push({ time: 1, overshoot: 0, isOvershoot: !1 }), e;
582
582
  }
583
583
  function te(n, t, e, i) {
584
- const { stiffness: o, damping: s, mass: r, oscillations: a } = i, h = e.x - t.x, c = e.y - t.y, u = Math.sqrt(o / r), l = s / (2 * Math.sqrt(o * r));
585
- let d;
584
+ const { stiffness: o, damping: a, mass: r, oscillations: s } = i, h = e.x - t.x, c = e.y - t.y, d = Math.sqrt(o / r), l = a / (2 * Math.sqrt(o * r));
585
+ let u;
586
586
  if (l < 1) {
587
- const f = u * Math.sqrt(1 - l * l), b = Math.exp(-l * u * n * 3), p = Math.cos(f * n * a * Math.PI);
588
- d = 1 - b * p;
587
+ const g = d * Math.sqrt(1 - l * l), p = Math.exp(-l * d * n * 3), y = Math.cos(g * n * s * Math.PI);
588
+ u = 1 - p * y;
589
589
  } else
590
- d = 1 - Math.exp(-u * n * 3);
591
- return d = Math.max(0, Math.min(d, 1.3)), {
592
- x: t.x + h * d,
593
- y: t.y + c * d
590
+ u = 1 - Math.exp(-d * n * 3);
591
+ return u = Math.max(0, Math.min(u, 1.3)), {
592
+ x: t.x + h * u,
593
+ y: t.y + c * u
594
594
  };
595
595
  }
596
596
  function ee(n, t, e, i) {
597
- const { amplitude: o, frequency: s, decay: r, decayRate: a, phase: h } = i, c = e.x - t.x, u = e.y - t.y, l = Math.sqrt(c * c + u * u), d = l > 0 ? -u / l : 0, f = l > 0 ? c / l : 1, b = s * Math.PI * 2 * n + h, p = r ? Math.pow(1 - n, a) : 1, g = o * Math.sin(b) * p, m = ie(n);
597
+ const { amplitude: o, frequency: a, decay: r, decayRate: s, phase: h } = i, c = e.x - t.x, d = e.y - t.y, l = Math.sqrt(c * c + d * d), u = l > 0 ? -d / l : 0, g = l > 0 ? c / l : 1, p = a * Math.PI * 2 * n + h, y = r ? Math.pow(1 - n, s) : 1, f = o * Math.sin(p) * y, m = ie(n);
598
598
  return {
599
- x: V(t.x, e.x, m) + g * d,
600
- y: V(t.y, e.y, m) + g * f
599
+ x: V(t.x, e.x, m) + f * u,
600
+ y: V(t.y, e.y, m) + f * g
601
601
  };
602
602
  }
603
- function ot(n) {
603
+ function it(n) {
604
604
  return 1 - (1 - n) * (1 - n);
605
605
  }
606
606
  function ie(n) {
607
607
  return 1 - Math.pow(1 - n, 3);
608
608
  }
609
609
  function ne(n, t, e) {
610
- const { amplitude: i, frequency: o, decay: s } = e, r = Math.sin(n * o * Math.PI * 2), a = s ? Math.pow(1 - n, 2) : 1, h = i * r * a;
610
+ const { amplitude: i, frequency: o, decay: a } = e, r = Math.sin(n * o * Math.PI * 2), s = a ? Math.pow(1 - n, 2) : 1, h = i * r * s;
611
611
  return t + h;
612
612
  }
613
613
  function oe(n, t, e) {
614
- const { overshoot: i, bounces: o } = e, s = [];
615
- s.push({ time: 0.5, scale: i });
614
+ const { overshoot: i, bounces: o } = e, a = [];
615
+ a.push({ time: 0.5, scale: i });
616
616
  let r = i;
617
- const a = 0.5, c = 0.5 / (o * 2);
618
- let u = 0.5;
619
- for (let d = 0; d < o; d++) {
620
- const f = 1 - (r - 1) * a;
621
- u += c, s.push({ time: u, scale: f }), r = 1 + (r - 1) * a * a, u += c, d < o - 1 && s.push({ time: u, scale: r });
617
+ const s = 0.5, c = 0.5 / (o * 2);
618
+ let d = 0.5;
619
+ for (let u = 0; u < o; u++) {
620
+ const g = 1 - (r - 1) * s;
621
+ d += c, a.push({ time: d, scale: g }), r = 1 + (r - 1) * s * s, d += c, u < o - 1 && a.push({ time: d, scale: r });
622
622
  }
623
- s.push({ time: 1, scale: 1 });
623
+ a.push({ time: 1, scale: 1 });
624
624
  let l = 1;
625
- for (let d = 0; d < s.length; d++)
626
- if (n <= s[d].time) {
627
- const f = d === 0 ? 0 : s[d - 1].time, b = d === 0 ? 1 : s[d - 1].scale, p = (n - f) / (s[d].time - f), g = ot(p);
628
- l = b + (s[d].scale - b) * g;
625
+ for (let u = 0; u < a.length; u++)
626
+ if (n <= a[u].time) {
627
+ const g = u === 0 ? 0 : a[u - 1].time, p = u === 0 ? 1 : a[u - 1].scale, y = (n - g) / (a[u].time - g), f = it(y);
628
+ l = p + (a[u].scale - p) * f;
629
629
  break;
630
630
  }
631
631
  return l * t;
@@ -636,61 +636,61 @@ function se(n) {
636
636
  startPosition: e,
637
637
  endPosition: i,
638
638
  pathConfig: o,
639
- duration: s,
639
+ duration: a,
640
640
  imageWidth: r,
641
- imageHeight: a,
641
+ imageHeight: s,
642
642
  rotation: h,
643
643
  scale: c,
644
- onComplete: u,
644
+ onComplete: d,
645
645
  rotationConfig: l,
646
- startRotation: d,
647
- scaleConfig: f,
648
- startScale: b
649
- } = n, p = o.type, g = d !== void 0 && d !== h, m = l?.mode === "wobble", S = l?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, v = g || m, w = b !== void 0 && b !== c, E = f?.mode === "pop", x = f?.pop || { overshoot: 1.2, bounces: 1 };
650
- if ((p === "linear" || p === "arc") && !v && !(w || E)) {
651
- u && u();
646
+ startRotation: u,
647
+ scaleConfig: g,
648
+ startScale: p
649
+ } = n, y = o.type, f = u !== void 0 && u !== h, m = l?.mode === "wobble", E = l?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, v = f || m, w = p !== void 0 && p !== c, S = g?.mode === "pop", x = g?.pop || { overshoot: 1.2, bounces: 1 };
650
+ if ((y === "linear" || y === "arc") && !v && !(w || S)) {
651
+ d && d();
652
652
  return;
653
653
  }
654
- const L = performance.now(), z = -r / 2, U = -a / 2;
654
+ const L = performance.now(), z = -r / 2, U = -s / 2;
655
655
  function _(Y) {
656
- const N = Y - L, T = Math.min(N / s, 1);
657
- let D;
658
- switch (p) {
656
+ const N = Y - L, A = Math.min(N / a, 1);
657
+ let $;
658
+ switch (y) {
659
659
  case "bounce": {
660
- const O = Bt(
660
+ const D = Bt(
661
661
  o.bouncePreset,
662
662
  o.bounce
663
663
  );
664
- D = Zt(T, e, i, O);
664
+ $ = Zt(A, e, i, D);
665
665
  break;
666
666
  }
667
667
  case "elastic": {
668
- const O = Jt(
668
+ const D = Jt(
669
669
  o.elasticPreset,
670
670
  o.elastic
671
671
  );
672
- D = te(T, e, i, O);
672
+ $ = te(A, e, i, D);
673
673
  break;
674
674
  }
675
675
  case "wave": {
676
- const O = Vt(
676
+ const D = Vt(
677
677
  o.wavePreset,
678
678
  o.wave
679
679
  );
680
- D = ee(T, e, i, O);
680
+ $ = ee(A, e, i, D);
681
681
  break;
682
682
  }
683
683
  default:
684
- D = {
685
- x: V(e.x, i.x, T),
686
- y: V(e.y, i.y, T)
684
+ $ = {
685
+ x: V(e.x, i.x, A),
686
+ y: V(e.y, i.y, A)
687
687
  };
688
688
  }
689
- const k = D.x - i.x, H = D.y - i.y;
689
+ const k = $.x - i.x, H = $.y - i.y;
690
690
  let R;
691
- m ? R = ne(T, h, S) : g ? R = V(d, h, T) : R = h;
692
- let C;
693
- E ? C = oe(T, c, x) : w ? C = V(b, c, T) : C = c, t.style.transform = `translate(${z}px, ${U}px) translate(${k}px, ${H}px) rotate(${R}deg) scale(${C})`, T < 1 ? requestAnimationFrame(_) : (t.style.transform = `translate(${z}px, ${U}px) rotate(${h}deg) scale(${c})`, u && u());
691
+ m ? R = ne(A, h, E) : f ? R = V(u, h, A) : R = h;
692
+ let T;
693
+ S ? T = oe(A, c, x) : w ? T = V(p, c, A) : T = c, t.style.transform = `translate(${z}px, ${U}px) translate(${k}px, ${H}px) rotate(${R}deg) scale(${T})`, A < 1 ? requestAnimationFrame(_) : (t.style.transform = `translate(${z}px, ${U}px) rotate(${h}deg) scale(${c})`, d && d());
694
694
  }
695
695
  requestAnimationFrame(_);
696
696
  }
@@ -707,7 +707,7 @@ const re = {
707
707
  };
708
708
  class ce {
709
709
  constructor(t, e) {
710
- this.config = t, this.layoutAlgorithm = e, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || pt, this.rotationConfig = t.rotation || bt, this.scaleConfig = t.scale || yt;
710
+ this.config = t, this.layoutAlgorithm = e, this.resolvedStartPosition = this.resolveStartPosition(), this.pathConfig = t.path || pt, this.rotationConfig = t.rotation || yt, this.scaleConfig = t.scale || bt;
711
711
  }
712
712
  /**
713
713
  * Get the effective start position, considering layout-aware defaults
@@ -718,72 +718,72 @@ class ce {
718
718
  /**
719
719
  * Calculate the starting position for an image's entry animation
720
720
  */
721
- calculateStartPosition(t, e, i, o, s) {
722
- const r = this.resolvedStartPosition, a = this.config.start.offset ?? 100;
721
+ calculateStartPosition(t, e, i, o, a) {
722
+ const r = this.resolvedStartPosition, s = this.config.start.offset ?? 100;
723
723
  switch (r) {
724
724
  case "nearest-edge":
725
- return this.calculateNearestEdge(t, e, i, a);
725
+ return this.calculateNearestEdge(t, e, i, s);
726
726
  case "top":
727
- return this.calculateEdgePosition("top", t, e, i, a);
727
+ return this.calculateEdgePosition("top", t, e, i, s);
728
728
  case "bottom":
729
- return this.calculateEdgePosition("bottom", t, e, i, a);
729
+ return this.calculateEdgePosition("bottom", t, e, i, s);
730
730
  case "left":
731
- return this.calculateEdgePosition("left", t, e, i, a);
731
+ return this.calculateEdgePosition("left", t, e, i, s);
732
732
  case "right":
733
- return this.calculateEdgePosition("right", t, e, i, a);
733
+ return this.calculateEdgePosition("right", t, e, i, s);
734
734
  case "center":
735
735
  return this.calculateCenterPosition(i, t, e);
736
736
  case "random-edge":
737
- return this.calculateRandomEdge(t, e, i, a);
737
+ return this.calculateRandomEdge(t, e, i, s);
738
738
  case "circular":
739
739
  return this.calculateCircularPosition(
740
740
  t,
741
741
  e,
742
742
  i,
743
743
  o,
744
- s
744
+ a
745
745
  );
746
746
  default:
747
- return this.calculateNearestEdge(t, e, i, a);
747
+ return this.calculateNearestEdge(t, e, i, s);
748
748
  }
749
749
  }
750
750
  /**
751
751
  * Calculate start position from the nearest edge (current default behavior)
752
752
  */
753
753
  calculateNearestEdge(t, e, i, o) {
754
- const s = t.x, r = t.y, a = s, h = i.width - s, c = r, u = i.height - r, l = Math.min(a, h, c, u);
755
- let d = t.x, f = t.y;
756
- return l === a ? d = -(e.width + o) : l === h ? d = i.width + o : l === c ? f = -(e.height + o) : f = i.height + o, { x: d, y: f };
754
+ const a = t.x, r = t.y, s = a, h = i.width - a, c = r, d = i.height - r, l = Math.min(s, h, c, d);
755
+ let u = t.x, g = t.y;
756
+ return l === s ? u = -(e.width + o) : l === h ? u = i.width + o : l === c ? g = -(e.height + o) : g = i.height + o, { x: u, y: g };
757
757
  }
758
758
  /**
759
759
  * Calculate start position from a specific edge
760
760
  */
761
- calculateEdgePosition(t, e, i, o, s) {
762
- let r = e.x, a = e.y;
761
+ calculateEdgePosition(t, e, i, o, a) {
762
+ let r = e.x, s = e.y;
763
763
  switch (t) {
764
764
  case "top":
765
- a = -(i.height + s);
765
+ s = -(i.height + a);
766
766
  break;
767
767
  case "bottom":
768
- a = o.height + s;
768
+ s = o.height + a;
769
769
  break;
770
770
  case "left":
771
- r = -(i.width + s);
771
+ r = -(i.width + a);
772
772
  break;
773
773
  case "right":
774
- r = o.width + s;
774
+ r = o.width + a;
775
775
  break;
776
776
  }
777
- return { x: r, y: a };
777
+ return { x: r, y: s };
778
778
  }
779
779
  /**
780
780
  * Calculate start position from center with scale animation
781
781
  */
782
782
  calculateCenterPosition(t, e, i) {
783
- const o = t.width / 2, s = t.height / 2;
783
+ const o = t.width / 2, a = t.height / 2;
784
784
  return {
785
785
  x: o,
786
- y: s,
786
+ y: a,
787
787
  useScale: !0
788
788
  // Signal to use scale animation from 0
789
789
  };
@@ -792,27 +792,27 @@ class ce {
792
792
  * Calculate start position from a random edge
793
793
  */
794
794
  calculateRandomEdge(t, e, i, o) {
795
- const s = ["top", "bottom", "left", "right"], r = s[Math.floor(Math.random() * s.length)];
795
+ const a = ["top", "bottom", "left", "right"], r = a[Math.floor(Math.random() * a.length)];
796
796
  return this.calculateEdgePosition(r, t, e, i, o);
797
797
  }
798
798
  /**
799
799
  * Calculate start position on a circle around the container
800
800
  */
801
- calculateCircularPosition(t, e, i, o, s) {
802
- const r = this.config.start.circular || {}, a = r.distribution || "even";
801
+ calculateCircularPosition(t, e, i, o, a) {
802
+ const r = this.config.start.circular || {}, s = r.distribution || "even";
803
803
  let h;
804
804
  const c = r.radius || "120%";
805
805
  if (typeof c == "string" && c.endsWith("%")) {
806
- const p = parseFloat(c) / 100;
806
+ const y = parseFloat(c) / 100;
807
807
  h = Math.sqrt(
808
808
  i.width ** 2 + i.height ** 2
809
- ) * p / 2;
809
+ ) * y / 2;
810
810
  } else
811
811
  h = typeof c == "number" ? c : 500;
812
- let u;
813
- a === "even" ? u = o / s * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
814
- const l = i.width / 2, d = i.height / 2, f = l + Math.cos(u) * h, b = d + Math.sin(u) * h;
815
- return { x: f, y: b };
812
+ let d;
813
+ s === "even" ? d = o / a * 2 * Math.PI : d = Math.random() * 2 * Math.PI;
814
+ const l = i.width / 2, u = i.height / 2, g = l + Math.cos(d) * h, p = u + Math.sin(d) * h;
815
+ return { x: g, y: p };
816
816
  }
817
817
  /**
818
818
  * Get animation parameters for an image
@@ -831,9 +831,9 @@ class ce {
831
831
  * Build a CSS transform string for the start position
832
832
  * Uses pixel-based centering offset for reliable cross-browser behavior
833
833
  */
834
- buildStartTransform(t, e, i, o, s, r, a, h) {
835
- const c = t.x - e.x, u = t.y - e.y, l = a !== void 0 ? a : i, d = h !== void 0 ? h : o, f = s !== void 0 ? -s / 2 : 0, b = r !== void 0 ? -r / 2 : 0, p = s !== void 0 ? `translate(${f}px, ${b}px)` : "translate(-50%, -50%)";
836
- return t.useScale ? `${p} translate(${c}px, ${u}px) rotate(${l}deg) scale(0)` : `${p} translate(${c}px, ${u}px) rotate(${l}deg) scale(${d})`;
834
+ buildStartTransform(t, e, i, o, a, r, s, h) {
835
+ const c = t.x - e.x, d = t.y - e.y, l = s !== void 0 ? s : i, u = h !== void 0 ? h : o, g = a !== void 0 ? -a / 2 : 0, p = r !== void 0 ? -r / 2 : 0, y = a !== void 0 ? `translate(${g}px, ${p}px)` : "translate(-50%, -50%)";
836
+ return t.useScale ? `${y} translate(${c}px, ${d}px) rotate(${l}deg) scale(0)` : `${y} translate(${c}px, ${d}px) rotate(${l}deg) scale(${u})`;
837
837
  }
838
838
  /**
839
839
  * Build the final CSS transform string
@@ -841,8 +841,8 @@ class ce {
841
841
  */
842
842
  buildFinalTransform(t, e, i, o) {
843
843
  if (i !== void 0 && o !== void 0) {
844
- const s = -i / 2, r = -o / 2;
845
- return `translate(${s}px, ${r}px) rotate(${t}deg) scale(${e})`;
844
+ const a = -i / 2, r = -o / 2;
845
+ return `translate(${a}px, ${r}px) rotate(${t}deg) scale(${e})`;
846
846
  }
847
847
  return `translate(-50%, -50%) rotate(${t}deg) scale(${e})`;
848
848
  }
@@ -960,7 +960,7 @@ class ce {
960
960
  amplitude: 15,
961
961
  frequency: 3,
962
962
  decay: !0
963
- }, { amplitude: o, frequency: s, decay: r } = i, a = Math.sin(t * s * Math.PI * 2), h = r ? Math.pow(1 - t, 2) : 1, c = o * a * h;
963
+ }, { amplitude: o, frequency: a, decay: r } = i, s = Math.sin(t * a * Math.PI * 2), h = r ? Math.pow(1 - t, 2) : 1, c = o * s * h;
964
964
  return e + c;
965
965
  }
966
966
  /**
@@ -1017,15 +1017,15 @@ class ce {
1017
1017
  const i = this.scaleConfig.pop || {
1018
1018
  overshoot: 1.2,
1019
1019
  bounces: 1
1020
- }, { overshoot: o, bounces: s } = i, r = this.generateScaleBounceKeyframes(s, o);
1021
- let a = e;
1020
+ }, { overshoot: o, bounces: a } = i, r = this.generateScaleBounceKeyframes(a, o);
1021
+ let s = e;
1022
1022
  for (let h = 0; h < r.length; h++)
1023
1023
  if (t <= r[h].time) {
1024
- const c = h === 0 ? 0 : r[h - 1].time, u = h === 0 ? e : r[h - 1].scale, l = (t - c) / (r[h].time - c), d = this.easeOutQuad(l);
1025
- a = u + (r[h].scale - u) * d;
1024
+ const c = h === 0 ? 0 : r[h - 1].time, d = h === 0 ? e : r[h - 1].scale, l = (t - c) / (r[h].time - c), u = this.easeOutQuad(l);
1025
+ s = d + (r[h].scale - d) * u;
1026
1026
  break;
1027
1027
  }
1028
- return a * e;
1028
+ return s * e;
1029
1029
  }
1030
1030
  /**
1031
1031
  * Generate keyframes for scale bounce animation
@@ -1034,11 +1034,11 @@ class ce {
1034
1034
  const i = [];
1035
1035
  i.push({ time: 0.5, scale: e });
1036
1036
  let o = e;
1037
- const s = 0.5, a = 0.5 / (t * 2);
1037
+ const a = 0.5, s = 0.5 / (t * 2);
1038
1038
  let h = 0.5;
1039
1039
  for (let c = 0; c < t; c++) {
1040
- const u = 1 - (o - 1) * s;
1041
- h += a, i.push({ time: h, scale: u }), o = 1 + (o - 1) * s * s, h += a, c < t - 1 && i.push({ time: h, scale: o });
1040
+ const d = 1 - (o - 1) * a;
1041
+ h += s, i.push({ time: h, scale: d }), o = 1 + (o - 1) * a * a, h += s, c < t - 1 && i.push({ time: h, scale: o });
1042
1042
  }
1043
1043
  return i.push({ time: 1, scale: 1 }), i;
1044
1044
  }
@@ -1061,11 +1061,11 @@ class le {
1061
1061
  * @returns Array of layout objects with position, rotation, scale
1062
1062
  */
1063
1063
  generate(t, e, i = {}) {
1064
- const o = [], { width: s, height: r } = e, a = this.config.spacing.padding, h = i.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, g = h * 1.5 / 2, m = h / 2, S = s - a - g, v = r - a - m, w = a + g, E = a + m;
1064
+ const o = [], { width: a, height: r } = e, s = this.config.spacing.padding, h = i.fixedHeight ?? 200, c = this.imageConfig.rotation?.mode ?? "none", d = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, u = this.imageConfig.sizing?.variance?.min ?? 1, g = this.imageConfig.sizing?.variance?.max ?? 1, p = u !== 1 || g !== 1, f = h * 1.5 / 2, m = h / 2, E = a - s - f, v = r - s - m, w = s + f, S = s + m;
1065
1065
  for (let x = 0; x < t; x++) {
1066
- const A = this.random(w, S), L = this.random(E, v), z = c === "random" ? this.random(u, l) : 0, U = b ? this.random(d, f) : 1, _ = h * U, Y = {
1066
+ const C = this.random(w, E), L = this.random(S, v), z = c === "random" ? this.random(d, l) : 0, U = p ? this.random(u, g) : 1, _ = h * U, Y = {
1067
1067
  id: x,
1068
- x: A,
1068
+ x: C,
1069
1069
  y: L,
1070
1070
  rotation: z,
1071
1071
  scale: U,
@@ -1097,16 +1097,16 @@ class he {
1097
1097
  * @returns Array of layout objects with position, rotation, scale
1098
1098
  */
1099
1099
  generate(t, e, i = {}) {
1100
- const o = [], { width: s, height: r } = e, a = i.fixedHeight ?? 200, h = this.imageConfig.rotation?.mode ?? "none", c = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, l = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, f = l !== 1 || d !== 1, b = this.config.scaleDecay ?? 0, p = i.fixedHeight ?? a, g = s / 2, m = r / 2, S = Math.ceil(Math.sqrt(t));
1100
+ const o = [], { width: a, height: r } = e, s = i.fixedHeight ?? 200, h = this.imageConfig.rotation?.mode ?? "none", c = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, l = this.imageConfig.sizing?.variance?.min ?? 1, u = this.imageConfig.sizing?.variance?.max ?? 1, g = l !== 1 || u !== 1, p = this.config.scaleDecay ?? 0, y = i.fixedHeight ?? s, f = a / 2, m = r / 2, E = Math.ceil(Math.sqrt(t));
1101
1101
  if (t > 0) {
1102
- const E = f ? this.random(l, d) : 1, x = p * E;
1102
+ const S = g ? this.random(l, u) : 1, x = y * S;
1103
1103
  o.push({
1104
1104
  id: 0,
1105
- x: g,
1105
+ x: f,
1106
1106
  y: m,
1107
- rotation: h === "random" ? this.random(c * 0.33, u * 0.33) : 0,
1107
+ rotation: h === "random" ? this.random(c * 0.33, d * 0.33) : 0,
1108
1108
  // Less rotation for center
1109
- scale: E,
1109
+ scale: S,
1110
1110
  baseSize: x,
1111
1111
  zIndex: 100
1112
1112
  // Center image is highest
@@ -1114,22 +1114,22 @@ class he {
1114
1114
  }
1115
1115
  let v = 1, w = 1;
1116
1116
  for (; v < t; ) {
1117
- const E = w / S, x = b > 0 ? 1 - E * b * 0.5 : 1, A = w * (p * 0.8), L = A * 1.5, z = Math.PI * (3 * (L + A) - Math.sqrt((3 * L + A) * (L + 3 * A))), U = this.estimateWidth(p), _ = Math.floor(z / (U * 0.7));
1117
+ const S = w / E, x = p > 0 ? 1 - S * p * 0.5 : 1, C = w * (y * 0.8), L = C * 1.5, z = Math.PI * (3 * (L + C) - Math.sqrt((3 * L + C) * (L + 3 * C))), U = this.estimateWidth(y), _ = Math.floor(z / (U * 0.7));
1118
1118
  if (_ === 0) {
1119
1119
  w++;
1120
1120
  continue;
1121
1121
  }
1122
1122
  const Y = 2 * Math.PI / _, N = w * (20 * Math.PI / 180);
1123
- for (let T = 0; T < _ && v < t; T++) {
1124
- const D = T * Y + N, k = f ? this.random(l, d) : 1, H = x * k, R = p * H;
1125
- let C = g + Math.cos(D) * L, O = m + Math.sin(D) * A;
1126
- const $ = this.config.spacing.padding ?? 50, P = R * 1.5 / 2, M = R / 2;
1127
- C - P < $ ? C = $ + P : C + P > s - $ && (C = s - $ - P), O - M < $ ? O = $ + M : O + M > r - $ && (O = r - $ - M);
1128
- const W = h === "random" ? this.random(c, u) : 0;
1123
+ for (let A = 0; A < _ && v < t; A++) {
1124
+ const $ = A * Y + N, k = g ? this.random(l, u) : 1, H = x * k, R = y * H;
1125
+ let T = f + Math.cos($) * L, D = m + Math.sin($) * C;
1126
+ const O = this.config.spacing.padding ?? 50, P = R * 1.5 / 2, M = R / 2;
1127
+ T - P < O ? T = O + P : T + P > a - O && (T = a - O - P), D - M < O ? D = O + M : D + M > r - O && (D = r - O - M);
1128
+ const W = h === "random" ? this.random(c, d) : 0;
1129
1129
  o.push({
1130
1130
  id: v,
1131
- x: C,
1132
- y: O,
1131
+ x: T,
1132
+ y: D,
1133
1133
  rotation: W,
1134
1134
  scale: H,
1135
1135
  baseSize: R,
@@ -1170,7 +1170,7 @@ const de = {
1170
1170
  alignment: "center",
1171
1171
  gap: 10,
1172
1172
  overflowOffset: 0.25
1173
- }, It = [
1173
+ }, Ct = [
1174
1174
  { x: 1, y: 1 },
1175
1175
  // bottom-right
1176
1176
  { x: -1, y: -1 },
@@ -1200,65 +1200,65 @@ class ue {
1200
1200
  * @returns Array of layout objects with position, rotation, scale
1201
1201
  */
1202
1202
  generate(t, e, i = {}) {
1203
- const o = [], { width: s, height: r } = e, a = { ...de, ...this.config.grid }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.sizing?.variance?.min ?? 1, d = this.imageConfig.sizing?.variance?.max ?? 1, f = l !== 1 || d !== 1, b = s - 2 * h, p = r - 2 * h, { columns: g, rows: m } = this.calculateGridDimensions(
1203
+ const o = [], { width: a, height: r } = e, s = { ...de, ...this.config.grid }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, d = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.sizing?.variance?.min ?? 1, u = this.imageConfig.sizing?.variance?.max ?? 1, g = l !== 1 || u !== 1, p = a - 2 * h, y = r - 2 * h, { columns: f, rows: m } = this.calculateGridDimensions(
1204
1204
  t,
1205
- b,
1206
1205
  p,
1206
+ y,
1207
1207
  c,
1208
- a
1209
- ), S = a.stagger === "row", v = a.stagger === "column", w = S ? g + 0.5 : g, E = v ? m + 0.5 : m, x = (b - a.gap * (g - 1)) / w, A = (p - a.gap * (m - 1)) / E, L = S ? x / 2 : 0, z = v ? A / 2 : 0, U = 1 + a.overlap, _ = Math.min(x, A) * U, Y = i.fixedHeight ? Math.min(i.fixedHeight, _) : _, N = g * x + (g - 1) * a.gap + L, T = m * A + (m - 1) * a.gap + z, D = h + (b - N) / 2, k = h + (p - T) / 2, H = g * m, R = a.columns !== "auto" && a.rows !== "auto", C = R && t > H;
1208
+ s
1209
+ ), E = s.stagger === "row", v = s.stagger === "column", w = E ? f + 0.5 : f, S = v ? m + 0.5 : m, x = (p - s.gap * (f - 1)) / w, C = (y - s.gap * (m - 1)) / S, L = E ? x / 2 : 0, z = v ? C / 2 : 0, U = 1 + s.overlap, _ = Math.min(x, C) * U, Y = i.fixedHeight ? Math.min(i.fixedHeight, _) : _, N = f * x + (f - 1) * s.gap + L, A = m * C + (m - 1) * s.gap + z, $ = h + (p - N) / 2, k = h + (y - A) / 2, H = f * m, R = s.columns !== "auto" && s.rows !== "auto", T = R && t > H;
1210
1210
  typeof window < "u" && (window.__gridOverflowDebug = {
1211
- gridConfigColumns: a.columns,
1212
- gridConfigRows: a.rows,
1213
- columns: g,
1211
+ gridConfigColumns: s.columns,
1212
+ gridConfigRows: s.rows,
1213
+ columns: f,
1214
1214
  rows: m,
1215
1215
  cellCount: H,
1216
1216
  hasFixedGrid: R,
1217
1217
  imageCount: t,
1218
- isOverflowMode: C
1218
+ isOverflowMode: T
1219
1219
  });
1220
- const O = C ? new Array(H).fill(0) : [], $ = Math.min(x, A) * a.overflowOffset;
1220
+ const D = T ? new Array(H).fill(0) : [], O = Math.min(x, C) * s.overflowOffset;
1221
1221
  for (let F = 0; F < t; F++) {
1222
1222
  let P, M, W = 0;
1223
- if (C && F >= H) {
1223
+ if (T && F >= H) {
1224
1224
  const q = F - H, j = q % H;
1225
- W = Math.floor(q / H) + 1, O[j]++, a.fillDirection === "row" ? (P = j % g, M = Math.floor(j / g)) : (M = j % m, P = Math.floor(j / m));
1225
+ W = Math.floor(q / H) + 1, D[j]++, s.fillDirection === "row" ? (P = j % f, M = Math.floor(j / f)) : (M = j % m, P = Math.floor(j / m));
1226
1226
  } else
1227
- a.fillDirection === "row" ? (P = F % g, M = Math.floor(F / g)) : (M = F % m, P = Math.floor(F / m));
1228
- let G = D + P * (x + a.gap) + x / 2, X = k + M * (A + a.gap) + A / 2;
1229
- if (a.stagger === "row" && M % 2 === 1 ? G += x / 2 : a.stagger === "column" && P % 2 === 1 && (X += A / 2), W > 0) {
1230
- const q = (W - 1) % It.length, j = It[q];
1231
- G += j.x * $, X += j.y * $;
1227
+ s.fillDirection === "row" ? (P = F % f, M = Math.floor(F / f)) : (M = F % m, P = Math.floor(F / m));
1228
+ let G = $ + P * (x + s.gap) + x / 2, X = k + M * (C + s.gap) + C / 2;
1229
+ if (s.stagger === "row" && M % 2 === 1 ? G += x / 2 : s.stagger === "column" && P % 2 === 1 && (X += C / 2), W > 0) {
1230
+ const q = (W - 1) % Ct.length, j = Ct[q];
1231
+ G += j.x * O, X += j.y * O;
1232
1232
  }
1233
- if (a.jitter > 0) {
1234
- const q = x / 2 * a.jitter, j = A / 2 * a.jitter;
1233
+ if (s.jitter > 0) {
1234
+ const q = x / 2 * s.jitter, j = C / 2 * s.jitter;
1235
1235
  G += this.random(-q, q), X += this.random(-j, j);
1236
1236
  }
1237
1237
  let B = G, J = X;
1238
- if (!C && a.fillDirection === "row") {
1239
- const q = t % g || g;
1240
- if (M === Math.floor((t - 1) / g) && q < g) {
1241
- const vt = q * x + (q - 1) * a.gap;
1242
- let gt = 0;
1243
- a.alignment === "center" ? gt = (N - vt) / 2 : a.alignment === "end" && (gt = N - vt), B += gt;
1238
+ if (!T && s.fillDirection === "row") {
1239
+ const q = t % f || f;
1240
+ if (M === Math.floor((t - 1) / f) && q < f) {
1241
+ const wt = q * x + (q - 1) * s.gap;
1242
+ let dt = 0;
1243
+ s.alignment === "center" ? dt = (N - wt) / 2 : s.alignment === "end" && (dt = N - wt), B += dt;
1244
1244
  }
1245
1245
  }
1246
- const rt = f ? this.random(l, d) : 1, K = Y * rt, it = K * 1.5 / 2, nt = K / 2, lt = h + it, ht = s - h - it, Dt = h + nt, Ot = r - h - nt;
1247
- B = Math.max(lt, Math.min(B, ht)), J = Math.max(Dt, Math.min(J, Ot));
1248
- let dt = 0;
1249
- if (u === "random") {
1246
+ const st = g ? this.random(l, u) : 1, K = Y * st, tt = K * 1.5 / 2, et = K / 2, rt = h + tt, ct = a - h - tt, $t = h + et, Dt = r - h - et;
1247
+ B = Math.max(rt, Math.min(B, ct)), J = Math.max($t, Math.min(J, Dt));
1248
+ let lt = 0;
1249
+ if (d === "random") {
1250
1250
  const q = this.imageConfig.rotation?.range?.min ?? -15, j = this.imageConfig.rotation?.range?.max ?? 15;
1251
- a.jitter > 0 ? dt = this.random(q * a.jitter, j * a.jitter) : dt = this.random(q, j);
1251
+ s.jitter > 0 ? lt = this.random(q * s.jitter, j * s.jitter) : lt = this.random(q, j);
1252
1252
  }
1253
- let ut;
1254
- C && W > 0 ? ut = 50 - W : ut = C ? 100 + F : F + 1, o.push({
1253
+ let ht;
1254
+ T && W > 0 ? ht = 50 - W : ht = T ? 100 + F : F + 1, o.push({
1255
1255
  id: F,
1256
1256
  x: B,
1257
1257
  y: J,
1258
- rotation: dt,
1259
- scale: rt,
1258
+ rotation: lt,
1259
+ scale: st,
1260
1260
  baseSize: K,
1261
- zIndex: ut
1261
+ zIndex: ht
1262
1262
  });
1263
1263
  }
1264
1264
  return o;
@@ -1266,20 +1266,20 @@ class ue {
1266
1266
  /**
1267
1267
  * Calculate optimal grid dimensions based on image count and container
1268
1268
  */
1269
- calculateGridDimensions(t, e, i, o, s) {
1270
- let r, a;
1271
- if (s.columns !== "auto" && s.rows !== "auto")
1272
- r = s.columns, a = s.rows;
1273
- else if (s.columns !== "auto")
1274
- r = s.columns, a = Math.ceil(t / r);
1275
- else if (s.rows !== "auto")
1276
- a = s.rows, r = Math.ceil(t / a);
1269
+ calculateGridDimensions(t, e, i, o, a) {
1270
+ let r, s;
1271
+ if (a.columns !== "auto" && a.rows !== "auto")
1272
+ r = a.columns, s = a.rows;
1273
+ else if (a.columns !== "auto")
1274
+ r = a.columns, s = Math.ceil(t / r);
1275
+ else if (a.rows !== "auto")
1276
+ s = a.rows, r = Math.ceil(t / s);
1277
1277
  else {
1278
1278
  const h = e / i;
1279
- for (r = Math.max(1, Math.round(Math.sqrt(t * h / 1.4))), a = Math.ceil(t / r); r > 1 && (r - 1) * a >= t; )
1279
+ for (r = Math.max(1, Math.round(Math.sqrt(t * h / 1.4))), s = Math.ceil(t / r); r > 1 && (r - 1) * s >= t; )
1280
1280
  r--;
1281
1281
  }
1282
- return { columns: Math.max(1, r), rows: Math.max(1, a) };
1282
+ return { columns: Math.max(1, r), rows: Math.max(1, s) };
1283
1283
  }
1284
1284
  /**
1285
1285
  * Utility: Generate random number between min and max
@@ -1307,35 +1307,35 @@ class me {
1307
1307
  * @returns Array of layout objects with position, rotation, scale
1308
1308
  */
1309
1309
  generate(t, e, i = {}) {
1310
- const o = [], { width: s, height: r } = e, a = { ...fe, ...this.config.spiral }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, f = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || b !== 1, g = this.config.scaleDecay ?? a.scaleDecay, m = s / 2, S = r / 2, v = Math.min(
1310
+ const o = [], { width: a, height: r } = e, s = { ...fe, ...this.config.spiral }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, d = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, g = this.imageConfig.sizing?.variance?.min ?? 1, p = this.imageConfig.sizing?.variance?.max ?? 1, y = g !== 1 || p !== 1, f = this.config.scaleDecay ?? s.scaleDecay, m = a / 2, E = r / 2, v = Math.min(
1311
1311
  m - h - c / 2,
1312
- S - h - c / 2
1313
- ), w = a.direction === "clockwise" ? -1 : 1;
1314
- for (let E = 0; E < t; E++) {
1315
- let x, A;
1316
- if (a.spiralType === "golden")
1317
- x = E * ge * w + a.startAngle, A = this.calculateGoldenRadius(E, t, v, a.tightness);
1318
- else if (a.spiralType === "archimedean") {
1319
- const G = E * 0.5 * a.tightness;
1320
- x = G * w + a.startAngle, A = this.calculateArchimedeanRadius(G, t, v, a.tightness);
1312
+ E - h - c / 2
1313
+ ), w = s.direction === "clockwise" ? -1 : 1;
1314
+ for (let S = 0; S < t; S++) {
1315
+ let x, C;
1316
+ if (s.spiralType === "golden")
1317
+ x = S * ge * w + s.startAngle, C = this.calculateGoldenRadius(S, t, v, s.tightness);
1318
+ else if (s.spiralType === "archimedean") {
1319
+ const G = S * 0.5 * s.tightness;
1320
+ x = G * w + s.startAngle, C = this.calculateArchimedeanRadius(G, t, v, s.tightness);
1321
1321
  } else {
1322
- const G = E * 0.3 * a.tightness;
1323
- x = G * w + a.startAngle, A = this.calculateLogarithmicRadius(G, t, v, a.tightness);
1322
+ const G = S * 0.3 * s.tightness;
1323
+ x = G * w + s.startAngle, C = this.calculateLogarithmicRadius(G, t, v, s.tightness);
1324
1324
  }
1325
- const L = m + Math.cos(x) * A, z = S + Math.sin(x) * A, U = A / v, _ = g > 0 ? 1 - U * g * 0.5 : 1, Y = p ? this.random(f, b) : 1, N = _ * Y, T = c * N, k = T * 1.5 / 2, H = T / 2, R = h + k, C = s - h - k, O = h + H, $ = r - h - H, F = Math.max(R, Math.min(L, C)), P = Math.max(O, Math.min(z, $));
1325
+ const L = m + Math.cos(x) * C, z = E + Math.sin(x) * C, U = C / v, _ = f > 0 ? 1 - U * f * 0.5 : 1, Y = y ? this.random(g, p) : 1, N = _ * Y, A = c * N, k = A * 1.5 / 2, H = A / 2, R = h + k, T = a - h - k, D = h + H, O = r - h - H, F = Math.max(R, Math.min(L, T)), P = Math.max(D, Math.min(z, O));
1326
1326
  let M = 0;
1327
- if (u === "random") {
1328
- const G = x * 180 / Math.PI % 360, X = this.random(l, d);
1329
- M = a.spiralType === "golden" ? X : G * 0.1 + X * 0.9;
1330
- } else u === "tangent" && (M = this.calculateSpiralTangent(x, A, a));
1331
- const W = t - E;
1327
+ if (d === "random") {
1328
+ const G = x * 180 / Math.PI % 360, X = this.random(l, u);
1329
+ M = s.spiralType === "golden" ? X : G * 0.1 + X * 0.9;
1330
+ } else d === "tangent" && (M = this.calculateSpiralTangent(x, C, s));
1331
+ const W = t - S;
1332
1332
  o.push({
1333
- id: E,
1333
+ id: S,
1334
1334
  x: F,
1335
1335
  y: P,
1336
1336
  rotation: M,
1337
1337
  scale: N,
1338
- baseSize: T,
1338
+ baseSize: A,
1339
1339
  zIndex: W
1340
1340
  });
1341
1341
  }
@@ -1350,11 +1350,11 @@ class me {
1350
1350
  if (i.spiralType === "golden")
1351
1351
  o = t + Math.PI / 2;
1352
1352
  else if (i.spiralType === "archimedean") {
1353
- const r = 1 / i.tightness, a = Math.atan(e / r);
1354
- o = t + a;
1353
+ const r = 1 / i.tightness, s = Math.atan(e / r);
1354
+ o = t + s;
1355
1355
  } else {
1356
- const r = 0.15 / i.tightness, a = Math.atan(1 / r);
1357
- o = t + a;
1356
+ const r = 0.15 / i.tightness, s = Math.atan(1 / r);
1357
+ o = t + s;
1358
1358
  }
1359
1359
  return o * 180 / Math.PI % 360 - 90;
1360
1360
  }
@@ -1371,16 +1371,16 @@ class me {
1371
1371
  * r = a + b*θ (constant spacing between arms)
1372
1372
  */
1373
1373
  calculateArchimedeanRadius(t, e, i, o) {
1374
- const s = e * 0.5 * o;
1375
- return t / s * i;
1374
+ const a = e * 0.5 * o;
1375
+ return t / a * i;
1376
1376
  }
1377
1377
  /**
1378
1378
  * Calculate radius for logarithmic (equiangular) spiral
1379
1379
  * r = a * e^(b*θ)
1380
1380
  */
1381
1381
  calculateLogarithmicRadius(t, e, i, o) {
1382
- const s = i * 0.05, r = 0.15 / o, a = s * Math.exp(r * t), h = e * 0.3 * o, c = s * Math.exp(r * h);
1383
- return a / c * i;
1382
+ const a = i * 0.05, r = 0.15 / o, s = a * Math.exp(r * t), h = e * 0.3 * o, c = a * Math.exp(r * h);
1383
+ return s / c * i;
1384
1384
  }
1385
1385
  /**
1386
1386
  * Utility: Generate random number between min and max
@@ -1397,7 +1397,7 @@ const pe = {
1397
1397
  overlap: 0.3,
1398
1398
  distribution: "gaussian"
1399
1399
  };
1400
- class be {
1400
+ class ye {
1401
1401
  constructor(t, e = {}) {
1402
1402
  this.config = t, this.imageConfig = e;
1403
1403
  }
@@ -1409,46 +1409,46 @@ class be {
1409
1409
  * @returns Array of layout objects with position, rotation, scale
1410
1410
  */
1411
1411
  generate(t, e, i = {}) {
1412
- const o = [], { width: s, height: r } = e, a = { ...pe, ...this.config.cluster }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, u = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, d = this.imageConfig.rotation?.range?.max ?? 15, f = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = f !== 1 || b !== 1, g = this.calculateClusterCount(
1412
+ const o = [], { width: a, height: r } = e, s = { ...pe, ...this.config.cluster }, h = this.config.spacing.padding, c = i.fixedHeight ?? 200, d = this.imageConfig.rotation?.mode ?? "none", l = this.imageConfig.rotation?.range?.min ?? -15, u = this.imageConfig.rotation?.range?.max ?? 15, g = this.imageConfig.sizing?.variance?.min ?? 1, p = this.imageConfig.sizing?.variance?.max ?? 1, y = g !== 1 || p !== 1, f = this.calculateClusterCount(
1413
1413
  t,
1414
- a.clusterCount,
1415
- s,
1414
+ s.clusterCount,
1415
+ a,
1416
1416
  r,
1417
- a.clusterSpacing
1417
+ s.clusterSpacing
1418
1418
  ), m = this.generateClusterCenters(
1419
- g,
1420
- s,
1419
+ f,
1420
+ a,
1421
1421
  r,
1422
1422
  h,
1423
- a
1424
- ), S = new Array(g).fill(0);
1423
+ s
1424
+ ), E = new Array(f).fill(0);
1425
1425
  for (let w = 0; w < t; w++)
1426
- S[w % g]++;
1426
+ E[w % f]++;
1427
1427
  let v = 0;
1428
- for (let w = 0; w < g; w++) {
1429
- const E = m[w], x = S[w];
1430
- for (let A = 0; A < x; A++) {
1428
+ for (let w = 0; w < f; w++) {
1429
+ const S = m[w], x = E[w];
1430
+ for (let C = 0; C < x; C++) {
1431
1431
  let L, z;
1432
- if (a.distribution === "gaussian")
1433
- L = this.gaussianRandom() * E.spread, z = this.gaussianRandom() * E.spread;
1432
+ if (s.distribution === "gaussian")
1433
+ L = this.gaussianRandom() * S.spread, z = this.gaussianRandom() * S.spread;
1434
1434
  else {
1435
- const M = this.random(0, Math.PI * 2), W = this.random(0, E.spread);
1435
+ const M = this.random(0, Math.PI * 2), W = this.random(0, S.spread);
1436
1436
  L = Math.cos(M) * W, z = Math.sin(M) * W;
1437
1437
  }
1438
- const U = 1 + a.overlap * 0.5, _ = 1 + a.overlap * 0.3;
1438
+ const U = 1 + s.overlap * 0.5, _ = 1 + s.overlap * 0.3;
1439
1439
  L /= U, z /= U;
1440
- const Y = p ? this.random(f, b) : 1, N = _ * Y, T = c * N;
1441
- let D = E.x + L, k = E.y + z;
1442
- const R = T * 1.5 / 2, C = T / 2;
1443
- D = Math.max(h + R, Math.min(D, s - h - R)), k = Math.max(h + C, Math.min(k, r - h - C));
1444
- const O = u === "random" ? this.random(l, d) : 0, F = Math.sqrt(L * L + z * z) / E.spread, P = Math.round((1 - F) * 50) + 1;
1440
+ const Y = y ? this.random(g, p) : 1, N = _ * Y, A = c * N;
1441
+ let $ = S.x + L, k = S.y + z;
1442
+ const R = A * 1.5 / 2, T = A / 2;
1443
+ $ = Math.max(h + R, Math.min($, a - h - R)), k = Math.max(h + T, Math.min(k, r - h - T));
1444
+ const D = d === "random" ? this.random(l, u) : 0, F = Math.sqrt(L * L + z * z) / S.spread, P = Math.round((1 - F) * 50) + 1;
1445
1445
  o.push({
1446
1446
  id: v,
1447
- x: D,
1447
+ x: $,
1448
1448
  y: k,
1449
- rotation: O,
1449
+ rotation: D,
1450
1450
  scale: N,
1451
- baseSize: T,
1451
+ baseSize: A,
1452
1452
  zIndex: P
1453
1453
  }), v++;
1454
1454
  }
@@ -1458,36 +1458,36 @@ class be {
1458
1458
  /**
1459
1459
  * Calculate optimal number of clusters based on image count and container
1460
1460
  */
1461
- calculateClusterCount(t, e, i, o, s) {
1461
+ calculateClusterCount(t, e, i, o, a) {
1462
1462
  if (e !== "auto")
1463
1463
  return Math.max(1, Math.min(e, t));
1464
- const a = Math.max(1, Math.ceil(t / 8)), h = Math.floor(
1465
- i / s * (o / s) * 0.6
1464
+ const s = Math.max(1, Math.ceil(t / 8)), h = Math.floor(
1465
+ i / a * (o / a) * 0.6
1466
1466
  );
1467
- return Math.max(1, Math.min(a, h, 10));
1467
+ return Math.max(1, Math.min(s, h, 10));
1468
1468
  }
1469
1469
  /**
1470
1470
  * Generate cluster center positions with spacing constraints
1471
1471
  */
1472
- generateClusterCenters(t, e, i, o, s) {
1473
- const r = [], h = o + s.clusterSpread, c = e - o - s.clusterSpread, u = o + s.clusterSpread, l = i - o - s.clusterSpread;
1474
- for (let d = 0; d < t; d++) {
1475
- let f = null, b = -1;
1476
- for (let p = 0; p < 100; p++) {
1477
- const g = {
1472
+ generateClusterCenters(t, e, i, o, a) {
1473
+ const r = [], h = o + a.clusterSpread, c = e - o - a.clusterSpread, d = o + a.clusterSpread, l = i - o - a.clusterSpread;
1474
+ for (let u = 0; u < t; u++) {
1475
+ let g = null, p = -1;
1476
+ for (let y = 0; y < 100; y++) {
1477
+ const f = {
1478
1478
  x: this.random(h, c),
1479
- y: this.random(u, l),
1480
- spread: this.calculateClusterSpread(s)
1479
+ y: this.random(d, l),
1480
+ spread: this.calculateClusterSpread(a)
1481
1481
  };
1482
1482
  let m = 1 / 0;
1483
- for (const S of r) {
1484
- const v = g.x - S.x, w = g.y - S.y, E = Math.sqrt(v * v + w * w);
1485
- m = Math.min(m, E);
1483
+ for (const E of r) {
1484
+ const v = f.x - E.x, w = f.y - E.y, S = Math.sqrt(v * v + w * w);
1485
+ m = Math.min(m, S);
1486
1486
  }
1487
- if ((r.length === 0 || m > b) && (f = g, b = m), m >= s.clusterSpacing)
1487
+ if ((r.length === 0 || m > p) && (g = f, p = m), m >= a.clusterSpacing)
1488
1488
  break;
1489
1489
  }
1490
- f && r.push(f);
1490
+ g && r.push(g);
1491
1491
  }
1492
1492
  return r;
1493
1493
  }
@@ -1515,7 +1515,7 @@ class be {
1515
1515
  return Math.random() * (e - t) + t;
1516
1516
  }
1517
1517
  }
1518
- class ye {
1518
+ class be {
1519
1519
  constructor(t, e = {}) {
1520
1520
  this.config = t, this.imageConfig = e;
1521
1521
  }
@@ -1527,24 +1527,24 @@ class ye {
1527
1527
  * @returns Array of layout objects with position, rotation, scale
1528
1528
  */
1529
1529
  generate(t, e, i = {}) {
1530
- const o = [], { width: s, height: r } = e, a = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, c = this.imageConfig.rotation?.mode ?? "none", u = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, d = this.imageConfig.sizing?.variance?.min ?? 1, f = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || f !== 1, p = i.fixedHeight ?? a, g = {
1530
+ const o = [], { width: a, height: r } = e, s = i.fixedHeight ?? 200, h = this.config.spacing.padding ?? 50, c = this.imageConfig.rotation?.mode ?? "none", d = this.imageConfig.rotation?.range?.min ?? -15, l = this.imageConfig.rotation?.range?.max ?? 15, u = this.imageConfig.sizing?.variance?.min ?? 1, g = this.imageConfig.sizing?.variance?.max ?? 1, p = u !== 1 || g !== 1, y = i.fixedHeight ?? s, f = {
1531
1531
  ...Ht,
1532
1532
  ...this.config.wave
1533
- }, { rows: m, amplitude: S, frequency: v, phaseShift: w, synchronization: E } = g, x = Math.ceil(t / m), z = p * 1.5 / 2, U = h + z, _ = s - h - z, Y = _ - U, N = x > 1 ? Y / (x - 1) : 0, T = h + S + p / 2, D = r - h - S - p / 2, k = D - T, H = m > 1 ? k / (m - 1) : 0;
1533
+ }, { rows: m, amplitude: E, frequency: v, phaseShift: w, synchronization: S } = f, x = Math.ceil(t / m), z = y * 1.5 / 2, U = h + z, _ = a - h - z, Y = _ - U, N = x > 1 ? Y / (x - 1) : 0, A = h + E + y / 2, $ = r - h - E - y / 2, k = $ - A, H = m > 1 ? k / (m - 1) : 0;
1534
1534
  let R = 0;
1535
- for (let C = 0; C < m && R < t; C++) {
1536
- const O = m === 1 ? (T + D) / 2 : T + C * H;
1537
- let $ = 0;
1538
- E === "offset" ? $ = C * w : E === "alternating" && ($ = C * Math.PI);
1535
+ for (let T = 0; T < m && R < t; T++) {
1536
+ const D = m === 1 ? (A + $) / 2 : A + T * H;
1537
+ let O = 0;
1538
+ S === "offset" ? O = T * w : S === "alternating" && (O = T * Math.PI);
1539
1539
  for (let F = 0; F < x && R < t; F++) {
1540
- const P = x === 1 ? (U + _) / 2 : U + F * N, M = this.calculateWaveY(P, s, S, v, $), W = P, G = O + M, X = b ? this.random(d, f) : 1, B = p * X;
1540
+ const P = x === 1 ? (U + _) / 2 : U + F * N, M = this.calculateWaveY(P, a, E, v, O), W = P, G = D + M, X = p ? this.random(u, g) : 1, B = y * X;
1541
1541
  let J = 0;
1542
- c === "tangent" ? J = this.calculateRotation(P, s, S, v, $) : c === "random" && (J = this.random(u, l));
1543
- const K = B * 1.5 / 2, ct = B / 2, it = h + K, nt = s - h - K, lt = h + ct, ht = r - h - ct;
1542
+ c === "tangent" ? J = this.calculateRotation(P, a, E, v, O) : c === "random" && (J = this.random(d, l));
1543
+ const K = B * 1.5 / 2, at = B / 2, tt = h + K, et = a - h - K, rt = h + at, ct = r - h - at;
1544
1544
  o.push({
1545
1545
  id: R,
1546
- x: Math.max(it, Math.min(W, nt)),
1547
- y: Math.max(lt, Math.min(G, ht)),
1546
+ x: Math.max(tt, Math.min(W, et)),
1547
+ y: Math.max(rt, Math.min(G, ct)),
1548
1548
  rotation: J,
1549
1549
  scale: X,
1550
1550
  baseSize: B,
@@ -1563,9 +1563,9 @@ class ye {
1563
1563
  * @param phase - Phase offset
1564
1564
  * @returns Y displacement from baseline
1565
1565
  */
1566
- calculateWaveY(t, e, i, o, s) {
1566
+ calculateWaveY(t, e, i, o, a) {
1567
1567
  const r = t / e;
1568
- return i * Math.sin(o * r * 2 * Math.PI + s);
1568
+ return i * Math.sin(o * r * 2 * Math.PI + a);
1569
1569
  }
1570
1570
  /**
1571
1571
  * Calculate rotation based on wave tangent
@@ -1576,9 +1576,9 @@ class ye {
1576
1576
  * @param phase - Phase offset
1577
1577
  * @returns Rotation angle in degrees
1578
1578
  */
1579
- calculateRotation(t, e, i, o, s) {
1580
- const r = t / e, a = i * o * 2 * Math.PI * Math.cos(o * r * 2 * Math.PI + s) / e;
1581
- return Math.atan(a) * (180 / Math.PI);
1579
+ calculateRotation(t, e, i, o, a) {
1580
+ const r = t / e, s = i * o * 2 * Math.PI * Math.cos(o * r * 2 * Math.PI + a) / e;
1581
+ return Math.atan(s) * (180 / Math.PI);
1582
1582
  }
1583
1583
  /**
1584
1584
  * Estimate image width based on height
@@ -1609,9 +1609,9 @@ class ve {
1609
1609
  case "spiral":
1610
1610
  return new me(this.config, this.imageConfig);
1611
1611
  case "cluster":
1612
- return new be(this.config, this.imageConfig);
1613
- case "wave":
1614
1612
  return new ye(this.config, this.imageConfig);
1613
+ case "wave":
1614
+ return new be(this.config, this.imageConfig);
1615
1615
  default:
1616
1616
  return new le(this.config, this.imageConfig);
1617
1617
  }
@@ -1625,8 +1625,8 @@ class ve {
1625
1625
  */
1626
1626
  generateLayout(t, e, i = {}) {
1627
1627
  const o = this.placementLayout.generate(t, e, i);
1628
- return o.forEach((s) => {
1629
- this.layouts.set(s.id, s);
1628
+ return o.forEach((a) => {
1629
+ this.layouts.set(a.id, a);
1630
1630
  }), o;
1631
1631
  }
1632
1632
  /**
@@ -1680,8 +1680,8 @@ class ve {
1680
1680
  return;
1681
1681
  if (typeof i == "number")
1682
1682
  return i;
1683
- const o = i, s = this.resolveBreakpoint(t);
1684
- return s === "mobile" ? o.mobile ?? o.tablet ?? o.screen : s === "tablet" ? o.tablet ?? o.screen ?? o.mobile : o.screen ?? o.tablet ?? o.mobile;
1683
+ const o = i, a = this.resolveBreakpoint(t);
1684
+ return a === "mobile" ? o.mobile ?? o.tablet ?? o.screen : a === "tablet" ? o.tablet ?? o.screen ?? o.mobile : o.screen ?? o.tablet ?? o.mobile;
1685
1685
  }
1686
1686
  /**
1687
1687
  * Calculate adaptive image size based on container dimensions and image count
@@ -1692,18 +1692,18 @@ class ve {
1692
1692
  * @returns Calculated sizing result with height
1693
1693
  */
1694
1694
  calculateAdaptiveSize(t, e, i, o) {
1695
- const s = this.imageConfig.sizing, r = this.resolveBaseHeight(o);
1695
+ const a = this.imageConfig.sizing, r = this.resolveBaseHeight(o);
1696
1696
  if (r !== void 0)
1697
1697
  return { height: r };
1698
- const a = s?.minSize ?? 50, h = s?.maxSize ?? 400, c = this.config.targetCoverage ?? 0.6, u = this.config.densityFactor ?? 1, { width: l, height: d } = t, p = l * d * c / e;
1699
- let m = Math.sqrt(p / 1.4);
1700
- m *= u, m = Math.min(m, i);
1701
- let S = this.clamp(m, a, h);
1702
- if (S === a && m < a) {
1703
- const v = Math.max(a * 0.05, 20);
1704
- S = Math.max(v, m);
1698
+ const s = a?.minSize ?? 50, h = a?.maxSize ?? 400, c = this.config.targetCoverage ?? 0.6, d = this.config.densityFactor ?? 1, { width: l, height: u } = t, y = l * u * c / e;
1699
+ let m = Math.sqrt(y / 1.4);
1700
+ m *= d, m = Math.min(m, i);
1701
+ let E = this.clamp(m, s, h);
1702
+ if (E === s && m < s) {
1703
+ const v = Math.max(s * 0.05, 20);
1704
+ E = Math.max(v, m);
1705
1705
  }
1706
- return { height: S };
1706
+ return { height: E };
1707
1707
  }
1708
1708
  /**
1709
1709
  * Utility: Clamp a value between min and max
@@ -1722,18 +1722,67 @@ const At = {
1722
1722
  hexagon: "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)",
1723
1723
  octagon: "polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",
1724
1724
  diamond: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"
1725
+ }, we = {
1726
+ // Circle - uses radius in pixels (refHeight of 100px = 50px radius)
1727
+ circle: {
1728
+ refHeight: 100,
1729
+ points: []
1730
+ // Special case: handled separately
1731
+ },
1732
+ // Square - maintains perfect aspect ratio (always 1:1)
1733
+ square: {
1734
+ refHeight: 100,
1735
+ points: [[0, 0], [100, 0], [100, 100], [0, 100]]
1736
+ },
1737
+ // Triangle - isosceles triangle
1738
+ triangle: {
1739
+ refHeight: 100,
1740
+ points: [[50, 0], [100, 100], [0, 100]]
1741
+ },
1742
+ // Pentagon - regular pentagon
1743
+ pentagon: {
1744
+ refHeight: 100,
1745
+ points: [[50, 0], [100, 38], [82, 100], [18, 100], [0, 38]]
1746
+ },
1747
+ // Hexagon - regular hexagon
1748
+ hexagon: {
1749
+ refHeight: 100,
1750
+ points: [[25, 0], [75, 0], [100, 50], [75, 100], [25, 100], [0, 50]]
1751
+ },
1752
+ // Octagon - regular octagon
1753
+ octagon: {
1754
+ refHeight: 100,
1755
+ points: [[30, 0], [70, 0], [100, 30], [100, 70], [70, 100], [30, 100], [0, 70], [0, 30]]
1756
+ },
1757
+ // Diamond - 45-degree rotated square
1758
+ diamond: {
1759
+ refHeight: 100,
1760
+ points: [[50, 0], [100, 50], [50, 100], [0, 50]]
1761
+ }
1725
1762
  };
1726
- function we(n) {
1763
+ function xe(n) {
1727
1764
  if (n)
1728
1765
  return n in At ? At[n] : n;
1729
1766
  }
1730
- function xe(n) {
1731
- return n in ft;
1767
+ function Ee(n, t, e) {
1768
+ const i = we[n];
1769
+ if (!i) return "";
1770
+ const o = t / i.refHeight;
1771
+ if (n === "circle")
1772
+ return `circle(${Math.round(50 * o * 100) / 100}px)`;
1773
+ const a = i.refHeight * o, r = a / 2, s = a / 2, h = (e ?? a) / 2, c = t / 2, d = h - r, l = c - s;
1774
+ return `polygon(${i.points.map(([g, p]) => {
1775
+ const y = Math.round((g * o + d) * 100) / 100, f = Math.round((p * o + l) * 100) / 100;
1776
+ return `${y}px ${f}px`;
1777
+ }).join(", ")})`;
1732
1778
  }
1733
1779
  function Se(n) {
1734
- return n ? xe(n) ? ft[n] : n : ft.md;
1780
+ return n in gt;
1781
+ }
1782
+ function Ie(n) {
1783
+ return n ? Se(n) ? gt[n] : n : gt.md;
1735
1784
  }
1736
- function Ee(n) {
1785
+ function Ce(n) {
1737
1786
  if (!n) return "";
1738
1787
  const t = [];
1739
1788
  if (n.grayscale !== void 0 && t.push(`grayscale(${n.grayscale})`), n.blur !== void 0 && t.push(`blur(${n.blur}px)`), n.brightness !== void 0 && t.push(`brightness(${n.brightness})`), n.contrast !== void 0 && t.push(`contrast(${n.contrast})`), n.saturate !== void 0 && t.push(`saturate(${n.saturate})`), n.opacity !== void 0 && t.push(`opacity(${n.opacity})`), n.sepia !== void 0 && t.push(`sepia(${n.sepia})`), n.hueRotate !== void 0 && t.push(`hue-rotate(${n.hueRotate}deg)`), n.invert !== void 0 && t.push(`invert(${n.invert})`), n.dropShadow !== void 0)
@@ -1751,43 +1800,54 @@ function Q(n) {
1751
1800
  const t = n.width ?? 0, e = n.style ?? "solid", i = n.color ?? "#000000";
1752
1801
  return `${t}px ${e} ${i}`;
1753
1802
  }
1754
- function st(n) {
1803
+ function vt(n, t, e) {
1755
1804
  if (!n) return {};
1756
- const t = {};
1805
+ const i = {};
1757
1806
  if (n.borderRadiusTopLeft !== void 0 || n.borderRadiusTopRight !== void 0 || n.borderRadiusBottomRight !== void 0 || n.borderRadiusBottomLeft !== void 0) {
1758
1807
  const s = n.border?.radius ?? 0;
1759
- n.borderRadiusTopLeft !== void 0 ? t.borderTopLeftRadius = `${n.borderRadiusTopLeft}px` : s && (t.borderTopLeftRadius = `${s}px`), n.borderRadiusTopRight !== void 0 ? t.borderTopRightRadius = `${n.borderRadiusTopRight}px` : s && (t.borderTopRightRadius = `${s}px`), n.borderRadiusBottomRight !== void 0 ? t.borderBottomRightRadius = `${n.borderRadiusBottomRight}px` : s && (t.borderBottomRightRadius = `${s}px`), n.borderRadiusBottomLeft !== void 0 ? t.borderBottomLeftRadius = `${n.borderRadiusBottomLeft}px` : s && (t.borderBottomLeftRadius = `${s}px`);
1760
- } else n.border?.radius !== void 0 && (t.borderRadius = `${n.border.radius}px`);
1808
+ n.borderRadiusTopLeft !== void 0 ? i.borderTopLeftRadius = `${n.borderRadiusTopLeft}px` : s && (i.borderTopLeftRadius = `${s}px`), n.borderRadiusTopRight !== void 0 ? i.borderTopRightRadius = `${n.borderRadiusTopRight}px` : s && (i.borderTopRightRadius = `${s}px`), n.borderRadiusBottomRight !== void 0 ? i.borderBottomRightRadius = `${n.borderRadiusBottomRight}px` : s && (i.borderBottomRightRadius = `${s}px`), n.borderRadiusBottomLeft !== void 0 ? i.borderBottomLeftRadius = `${n.borderRadiusBottomLeft}px` : s && (i.borderBottomLeftRadius = `${s}px`);
1809
+ } else n.border?.radius !== void 0 && (i.borderRadius = `${n.border.radius}px`);
1761
1810
  if (n.borderTop || n.borderRight || n.borderBottom || n.borderLeft) {
1762
- const s = n.border || {}, r = { ...s, ...n.borderTop }, a = { ...s, ...n.borderRight }, h = { ...s, ...n.borderBottom }, c = { ...s, ...n.borderLeft };
1763
- t.borderTop = Q(r), t.borderRight = Q(a), t.borderBottom = Q(h), t.borderLeft = Q(c);
1764
- } else n.border && (t.border = Q(n.border));
1765
- n.shadow !== void 0 && (t.boxShadow = Se(n.shadow));
1766
- const o = Ee(n.filter);
1767
- if (t.filter = o || "none", n.opacity !== void 0 && (t.opacity = String(n.opacity)), n.cursor !== void 0 && (t.cursor = n.cursor), n.outline && n.outline.style !== "none" && (n.outline.width ?? 0) > 0) {
1768
- const s = n.outline.width ?? 0, r = n.outline.style ?? "solid", a = n.outline.color ?? "#000000";
1769
- t.outline = `${s}px ${r} ${a}`, n.outline.offset !== void 0 && (t.outlineOffset = `${n.outline.offset}px`);
1770
- }
1771
- if (n.objectFit !== void 0 && (t.objectFit = n.objectFit), n.aspectRatio !== void 0 && (t.aspectRatio = n.aspectRatio), n.clipPath !== void 0) {
1772
- const s = we(n.clipPath);
1773
- s && (s === "none" ? t.clipPath = "unset" : (t.clipPath = s, t.overflow = "hidden"));
1774
- }
1775
- return t;
1811
+ const s = n.border || {}, h = { ...s, ...n.borderTop }, c = { ...s, ...n.borderRight }, d = { ...s, ...n.borderBottom }, l = { ...s, ...n.borderLeft };
1812
+ i.borderTop = Q(h), i.borderRight = Q(c), i.borderBottom = Q(d), i.borderLeft = Q(l);
1813
+ } else n.border && (i.border = Q(n.border));
1814
+ n.shadow !== void 0 && (i.boxShadow = Ie(n.shadow));
1815
+ const r = Ce(n.filter);
1816
+ if (i.filter = r || "none", n.opacity !== void 0 && (i.opacity = String(n.opacity)), n.cursor !== void 0 && (i.cursor = n.cursor), n.outline && n.outline.style !== "none" && (n.outline.width ?? 0) > 0) {
1817
+ const s = n.outline.width ?? 0, h = n.outline.style ?? "solid", c = n.outline.color ?? "#000000";
1818
+ i.outline = `${s}px ${h} ${c}`, n.outline.offset !== void 0 && (i.outlineOffset = `${n.outline.offset}px`);
1819
+ }
1820
+ if (n.objectFit !== void 0 && (i.objectFit = n.objectFit), n.aspectRatio !== void 0 && (i.aspectRatio = n.aspectRatio), n.clipPath !== void 0) {
1821
+ let s;
1822
+ const h = typeof n.clipPath == "object" && n.clipPath !== null && "shape" in n.clipPath, c = h ? n.clipPath : void 0;
1823
+ if (c?.mode === "height-relative" && t)
1824
+ s = Ee(c.shape, t, e);
1825
+ else {
1826
+ const d = h && c ? c.shape : n.clipPath;
1827
+ s = xe(d);
1828
+ }
1829
+ s && (s === "none" ? i.clipPath = "unset" : (i.clipPath = s, i.overflow = "hidden"));
1830
+ }
1831
+ return i;
1776
1832
  }
1777
- function tt(n, t) {
1833
+ function Ae(n, t) {
1778
1834
  t.borderRadius !== void 0 && (n.style.borderRadius = t.borderRadius), t.borderTopLeftRadius !== void 0 && (n.style.borderTopLeftRadius = t.borderTopLeftRadius), t.borderTopRightRadius !== void 0 && (n.style.borderTopRightRadius = t.borderTopRightRadius), t.borderBottomRightRadius !== void 0 && (n.style.borderBottomRightRadius = t.borderBottomRightRadius), t.borderBottomLeftRadius !== void 0 && (n.style.borderBottomLeftRadius = t.borderBottomLeftRadius), t.border !== void 0 && (n.style.border = t.border), t.borderTop !== void 0 && (n.style.borderTop = t.borderTop), t.borderRight !== void 0 && (n.style.borderRight = t.borderRight), t.borderBottom !== void 0 && (n.style.borderBottom = t.borderBottom), t.borderLeft !== void 0 && (n.style.borderLeft = t.borderLeft), t.boxShadow !== void 0 && (n.style.boxShadow = t.boxShadow), t.filter !== void 0 && (n.style.filter = t.filter), t.opacity !== void 0 && (n.style.opacity = t.opacity), t.cursor !== void 0 && (n.style.cursor = t.cursor), t.outline !== void 0 && (n.style.outline = t.outline), t.outlineOffset !== void 0 && (n.style.outlineOffset = t.outlineOffset), t.objectFit !== void 0 && (n.style.objectFit = t.objectFit), t.aspectRatio !== void 0 && (n.style.aspectRatio = t.aspectRatio), t.clipPath !== void 0 && (n.style.clipPath = t.clipPath), t.overflow !== void 0 && (n.style.overflow = t.overflow);
1779
1835
  }
1780
- function zt(n) {
1836
+ function ut(n, t, e, i) {
1837
+ const o = vt(t, e, i);
1838
+ Ae(n, o);
1839
+ }
1840
+ function Ft(n) {
1781
1841
  return n ? Array.isArray(n) ? n.join(" ") : n : "";
1782
1842
  }
1783
- function et(n, t) {
1784
- const e = zt(t);
1843
+ function nt(n, t) {
1844
+ const e = Ft(t);
1785
1845
  e && e.split(" ").forEach((i) => {
1786
1846
  i.trim() && n.classList.add(i.trim());
1787
1847
  });
1788
1848
  }
1789
- function Ft(n, t) {
1790
- const e = zt(t);
1849
+ function ft(n, t) {
1850
+ const e = Ft(t);
1791
1851
  e && e.split(" ").forEach((i) => {
1792
1852
  i.trim() && n.classList.remove(i.trim());
1793
1853
  });
@@ -1796,9 +1856,9 @@ const Tt = {
1796
1856
  UNFOCUSING: 999,
1797
1857
  FOCUSING: 1e3
1798
1858
  };
1799
- class Ie {
1859
+ class Te {
1800
1860
  constructor(t, e, i) {
1801
- this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = e, this.defaultStyles = st(i?.default), this.focusedStyles = st(i?.focused), this.defaultClassName = i?.default?.className, this.focusedClassName = i?.focused?.className;
1861
+ this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null, this.focusGeneration = 0, this.config = t, this.animationEngine = e, this.styling = i, this.focusedClassName = i?.focused?.className;
1802
1862
  }
1803
1863
  /**
1804
1864
  * Get current state machine state
@@ -1823,19 +1883,19 @@ class Ie {
1823
1883
  * Returns actual pixel dimensions instead of scale factor for sharper rendering
1824
1884
  */
1825
1885
  calculateFocusDimensions(t, e, i) {
1826
- const o = this.normalizeScalePercent(this.config.scalePercent), s = i.height * o, r = t / e;
1827
- let a = s, h = a * r;
1886
+ const o = this.normalizeScalePercent(this.config.scalePercent), a = i.height * o, r = t / e;
1887
+ let s = a, h = s * r;
1828
1888
  const c = i.width * o;
1829
- return h > c && (h = c, a = h / r), { width: h, height: a };
1889
+ return h > c && (h = c, s = h / r), { width: h, height: s };
1830
1890
  }
1831
1891
  /**
1832
1892
  * Calculate the transform needed to center an image (position only, no scale)
1833
1893
  * Scale is handled by animating actual dimensions for sharper rendering
1834
1894
  */
1835
1895
  calculateFocusTransform(t, e) {
1836
- const i = t.width / 2, o = t.height / 2, s = i - e.x, r = o - e.y;
1896
+ const i = t.width / 2, o = t.height / 2, a = i - e.x, r = o - e.y;
1837
1897
  return {
1838
- x: s,
1898
+ x: a,
1839
1899
  y: r,
1840
1900
  rotation: 0,
1841
1901
  scale: 1
@@ -1857,19 +1917,19 @@ class Ie {
1857
1917
  * Create a Web Animation that animates both transform (position) and dimensions
1858
1918
  * This provides sharper zoom by re-rendering at target size instead of scaling pixels
1859
1919
  */
1860
- animateWithDimensions(t, e, i, o, s, r, a, h) {
1861
- const c = this.buildDimensionZoomTransform(e), u = this.buildDimensionZoomTransform(i);
1920
+ animateWithDimensions(t, e, i, o, a, r, s, h) {
1921
+ const c = this.buildDimensionZoomTransform(e), d = this.buildDimensionZoomTransform(i);
1862
1922
  return t.style.transition = "none", t.animate(
1863
1923
  [
1864
1924
  {
1865
1925
  transform: c,
1866
1926
  width: `${o}px`,
1867
- height: `${s}px`
1927
+ height: `${a}px`
1868
1928
  },
1869
1929
  {
1870
- transform: u,
1930
+ transform: d,
1871
1931
  width: `${r}px`,
1872
- height: `${a}px`
1932
+ height: `${s}px`
1873
1933
  }
1874
1934
  ],
1875
1935
  {
@@ -1881,15 +1941,30 @@ class Ie {
1881
1941
  }
1882
1942
  /**
1883
1943
  * Apply focused styling to an element
1944
+ * Applies non-clip-path styles immediately, clip-path will be updated during animation via startClipPathAnimation
1884
1945
  */
1885
1946
  applyFocusedStyling(t, e) {
1886
- t.style.zIndex = String(e), t.classList.add("fbn-ic-focused"), tt(t, this.focusedStyles), et(t, this.focusedClassName);
1947
+ t.style.zIndex = String(e), t.classList.add("fbn-ic-focused"), nt(t, this.focusedClassName);
1887
1948
  }
1888
1949
  /**
1889
1950
  * Remove focused styling from an element
1951
+ * Removes classes and z-index, clip-path will be updated during animation via startClipPathAnimation
1890
1952
  */
1891
1953
  removeFocusedStyling(t, e) {
1892
- t.style.zIndex = e, t.classList.remove("fbn-ic-focused"), Ft(t, this.focusedClassName), tt(t, this.defaultStyles), et(t, this.defaultClassName);
1954
+ t.style.zIndex = e, t.classList.remove("fbn-ic-focused"), ft(t, this.focusedClassName);
1955
+ }
1956
+ /**
1957
+ * Continuously update clip-path during animation based on current element dimensions
1958
+ * This ensures clip-path changes smoothly as width/height animate
1959
+ */
1960
+ startClipPathAnimation(t, e, i) {
1961
+ let o = i ? this.styling?.focused ?? this.styling?.default : this.styling?.default;
1962
+ i && this.styling?.focused && this.styling.focused.clipPath === void 0 && (o = { ...o, clipPath: void 0 });
1963
+ const a = () => {
1964
+ const r = t.offsetHeight, s = t.offsetWidth, h = vt(o, r, s);
1965
+ h.clipPath !== void 0 ? t.style.clipPath = h.clipPath : t.style.clipPath = "unset", h.overflow !== void 0 && (t.style.overflow = h.overflow), e.animation.playState === "running" && requestAnimationFrame(a);
1966
+ };
1967
+ requestAnimationFrame(a);
1893
1968
  }
1894
1969
  /**
1895
1970
  * Start focus animation for an image using dimension-based zoom
@@ -1897,48 +1972,50 @@ class Ie {
1897
1972
  * @param fromTransform - Optional starting transform (for mid-animation reversals)
1898
1973
  * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
1899
1974
  */
1900
- startFocusAnimation(t, e, i, o, s) {
1901
- const r = t.style.zIndex || "", a = t.offsetWidth, h = t.offsetHeight, c = this.calculateFocusDimensions(a, h, e), u = this.calculateFocusTransform(e, i);
1902
- this.applyFocusedStyling(t, Tt.FOCUSING), this.animationEngine.cancelAllAnimations(t);
1903
- const l = o ?? {
1975
+ startFocusAnimation(t, e, i, o, a) {
1976
+ const r = t.style.zIndex || "", s = t.offsetWidth, h = t.offsetHeight, c = this.calculateFocusDimensions(s, h, e), d = this.calculateFocusTransform(e, i);
1977
+ this.animationEngine.cancelAllAnimations(t);
1978
+ const l = this.config.animationDuration ?? 600;
1979
+ this.applyFocusedStyling(t, Tt.FOCUSING);
1980
+ const u = o ?? {
1904
1981
  x: 0,
1905
1982
  y: 0,
1906
1983
  rotation: i.rotation,
1907
1984
  scale: 1
1908
1985
  // No scale - using dimensions
1909
- }, d = s?.width ?? a, f = s?.height ?? h, b = this.config.animationDuration ?? 600, p = this.animateWithDimensions(
1986
+ }, g = a?.width ?? s, p = a?.height ?? h, y = this.animateWithDimensions(
1910
1987
  t,
1911
- l,
1912
1988
  u,
1913
1989
  d,
1914
- f,
1990
+ g,
1991
+ p,
1915
1992
  c.width,
1916
1993
  c.height,
1917
- b
1918
- ), g = {
1994
+ l
1995
+ ), f = {
1919
1996
  id: `focus-${Date.now()}`,
1920
1997
  element: t,
1921
- animation: p,
1922
- fromState: l,
1923
- toState: u,
1998
+ animation: y,
1999
+ fromState: u,
2000
+ toState: d,
1924
2001
  startTime: performance.now(),
1925
- duration: b
2002
+ duration: l
1926
2003
  };
1927
2004
  return this.focusData = {
1928
2005
  element: t,
1929
2006
  originalState: i,
1930
- focusTransform: u,
2007
+ focusTransform: d,
1931
2008
  originalZIndex: r,
1932
- originalWidth: a,
2009
+ originalWidth: s,
1933
2010
  originalHeight: h,
1934
2011
  focusWidth: c.width,
1935
2012
  focusHeight: c.height
1936
- }, {
2013
+ }, this.startClipPathAnimation(t, f, !0), {
1937
2014
  element: t,
1938
2015
  originalState: i,
1939
- animationHandle: g,
2016
+ animationHandle: f,
1940
2017
  direction: "in",
1941
- originalWidth: a,
2018
+ originalWidth: s,
1942
2019
  originalHeight: h
1943
2020
  };
1944
2021
  }
@@ -1949,37 +2026,39 @@ class Ie {
1949
2026
  */
1950
2027
  startUnfocusAnimation(t, e, i, o) {
1951
2028
  t.style.zIndex = String(Tt.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
1952
- const s = i ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, r = o?.width ?? this.focusData?.focusWidth ?? t.offsetWidth, a = o?.height ?? this.focusData?.focusHeight ?? t.offsetHeight, h = {
2029
+ const a = this.config.animationDuration ?? 600;
2030
+ t.classList.remove("fbn-ic-focused"), ft(t, this.focusedClassName);
2031
+ const r = i ?? this.focusData?.focusTransform ?? { x: 0, y: 0, rotation: 0, scale: 1 }, s = o?.width ?? this.focusData?.focusWidth ?? t.offsetWidth, h = o?.height ?? this.focusData?.focusHeight ?? t.offsetHeight, c = {
1953
2032
  x: 0,
1954
2033
  y: 0,
1955
2034
  rotation: e.rotation,
1956
2035
  scale: 1
1957
2036
  // No scale - using dimensions
1958
- }, c = this.focusData?.originalWidth ?? t.offsetWidth, u = this.focusData?.originalHeight ?? t.offsetHeight, l = this.config.animationDuration ?? 600, d = this.animateWithDimensions(
2037
+ }, d = this.focusData?.originalWidth ?? t.offsetWidth, l = this.focusData?.originalHeight ?? t.offsetHeight, u = this.animateWithDimensions(
1959
2038
  t,
1960
- s,
1961
- h,
1962
2039
  r,
1963
- a,
1964
2040
  c,
1965
- u,
1966
- l
1967
- ), f = {
2041
+ s,
2042
+ h,
2043
+ d,
2044
+ l,
2045
+ a
2046
+ ), g = {
1968
2047
  id: `unfocus-${Date.now()}`,
1969
2048
  element: t,
1970
- animation: d,
1971
- fromState: s,
1972
- toState: h,
2049
+ animation: u,
2050
+ fromState: r,
2051
+ toState: c,
1973
2052
  startTime: performance.now(),
1974
- duration: l
2053
+ duration: a
1975
2054
  };
1976
- return {
2055
+ return this.startClipPathAnimation(t, g, !1), {
1977
2056
  element: t,
1978
2057
  originalState: e,
1979
- animationHandle: f,
2058
+ animationHandle: g,
1980
2059
  direction: "out",
1981
- originalWidth: c,
1982
- originalHeight: u
2060
+ originalWidth: d,
2061
+ originalHeight: l
1983
2062
  };
1984
2063
  }
1985
2064
  /**
@@ -1997,10 +2076,10 @@ class Ie {
1997
2076
  * Caller is responsible for calling animationEngine.cancelAllAnimations() afterwards.
1998
2077
  */
1999
2078
  captureMidAnimationState(t) {
2000
- const e = getComputedStyle(t), i = new DOMMatrix(e.transform), o = t.offsetWidth, s = t.offsetHeight, r = i.e + o * 0.5, a = i.f + s * 0.5, h = Math.atan2(i.b, i.a) * (180 / Math.PI);
2001
- return t.style.width = `${o}px`, t.style.height = `${s}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${a}px) rotate(${h}deg)`, t.style.transition = "none", {
2002
- transform: { x: r, y: a, rotation: h, scale: 1 },
2003
- dimensions: { width: o, height: s }
2079
+ const e = getComputedStyle(t), i = new DOMMatrix(e.transform), o = t.offsetWidth, a = t.offsetHeight, r = i.e + o * 0.5, s = i.f + a * 0.5, h = Math.atan2(i.b, i.a) * (180 / Math.PI);
2080
+ return t.style.width = `${o}px`, t.style.height = `${a}px`, t.style.transform = `translate(-50%, -50%) translate(${r}px, ${s}px) rotate(${h}deg)`, t.style.transition = "none", {
2081
+ transform: { x: r, y: s, rotation: h, scale: 1 },
2082
+ dimensions: { width: o, height: a }
2004
2083
  };
2005
2084
  }
2006
2085
  /**
@@ -2015,10 +2094,10 @@ class Ie {
2015
2094
  /**
2016
2095
  * Reset an element instantly to its original position and dimensions (no animation)
2017
2096
  */
2018
- resetElementInstantly(t, e, i, o, s) {
2097
+ resetElementInstantly(t, e, i, o, a) {
2019
2098
  this.animationEngine.cancelAllAnimations(t);
2020
2099
  const r = ["translate(-50%, -50%)"];
2021
- r.push("translate(0px, 0px)"), r.push(`rotate(${e.rotation}deg)`), t.style.transition = "none", t.style.transform = r.join(" "), o !== void 0 && s !== void 0 && (t.style.width = `${o}px`, t.style.height = `${s}px`), this.removeFocusedStyling(t, i);
2100
+ r.push("translate(0px, 0px)"), r.push(`rotate(${e.rotation}deg)`), t.style.transition = "none", t.style.transform = r.join(" "), o !== void 0 && a !== void 0 && (t.style.width = `${o}px`, t.style.height = `${a}px`), this.removeFocusedStyling(t, i);
2022
2101
  }
2023
2102
  /**
2024
2103
  * Focus (zoom) an image to center of container
@@ -2028,11 +2107,11 @@ class Ie {
2028
2107
  if (this.currentFocus === t && this.state === I.FOCUSED)
2029
2108
  return this.unfocusImage();
2030
2109
  if (this.incoming?.element === t && this.state === I.FOCUSING) {
2031
- const { transform: s, dimensions: r } = this.captureMidAnimationState(t);
2110
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
2032
2111
  this.animationEngine.cancelAllAnimations(t), this.outgoing = this.startUnfocusAnimation(
2033
2112
  t,
2034
2113
  this.incoming.originalState,
2035
- s,
2114
+ a,
2036
2115
  r
2037
2116
  ), this.incoming = null, this.state = I.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
2038
2117
  return;
@@ -2075,18 +2154,18 @@ class Ie {
2075
2154
  if (this.incoming?.element === t)
2076
2155
  return;
2077
2156
  if (this.outgoing?.element === t) {
2078
- const { transform: s, dimensions: r } = this.captureMidAnimationState(t);
2157
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
2079
2158
  if (this.animationEngine.cancelAllAnimations(t), this.incoming) {
2080
- const { transform: a, dimensions: h } = this.captureMidAnimationState(this.incoming.element);
2159
+ const { transform: s, dimensions: h } = this.captureMidAnimationState(this.incoming.element);
2081
2160
  this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2082
2161
  this.incoming.element,
2083
2162
  this.incoming.originalState,
2084
- a,
2163
+ s,
2085
2164
  h
2086
2165
  );
2087
2166
  } else
2088
2167
  this.outgoing = null;
2089
- if (this.incoming = this.startFocusAnimation(t, e, i, s, r), await Promise.all([
2168
+ if (this.incoming = this.startFocusAnimation(t, e, i, a, r), await Promise.all([
2090
2169
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2091
2170
  this.waitForAnimation(this.incoming.animationHandle)
2092
2171
  ]), this.focusGeneration !== o) return;
@@ -2100,11 +2179,11 @@ class Ie {
2100
2179
  this.outgoing.originalWidth,
2101
2180
  this.outgoing.originalHeight
2102
2181
  ), this.outgoing = null), this.incoming) {
2103
- const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2182
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2104
2183
  this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2105
2184
  this.incoming.element,
2106
2185
  this.incoming.originalState,
2107
- s,
2186
+ a,
2108
2187
  r
2109
2188
  );
2110
2189
  }
@@ -2125,11 +2204,11 @@ class Ie {
2125
2204
  const t = ++this.focusGeneration;
2126
2205
  if (!this.currentFocus || !this.focusData) {
2127
2206
  if (this.incoming && this.state === I.FOCUSING) {
2128
- const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2207
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2129
2208
  if (this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2130
2209
  this.incoming.element,
2131
2210
  this.incoming.originalState,
2132
- s,
2211
+ a,
2133
2212
  r
2134
2213
  ), this.incoming = null, this.state = I.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2135
2214
  this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = I.IDLE;
@@ -2137,19 +2216,19 @@ class Ie {
2137
2216
  return;
2138
2217
  }
2139
2218
  if (this.state === I.CROSS_ANIMATING && this.incoming) {
2140
- const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2219
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2141
2220
  this.animationEngine.cancelAllAnimations(this.incoming.element);
2142
- const a = this.startUnfocusAnimation(
2221
+ const s = this.startUnfocusAnimation(
2143
2222
  this.incoming.element,
2144
2223
  this.incoming.originalState,
2145
- s,
2224
+ a,
2146
2225
  r
2147
2226
  );
2148
2227
  if (await Promise.all([
2149
2228
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2150
- this.waitForAnimation(a.animationHandle)
2229
+ this.waitForAnimation(s.animationHandle)
2151
2230
  ]), this.focusGeneration !== t) return;
2152
- this.outgoing && this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.removeFocusedStyling(a.element, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
2231
+ this.outgoing && this.removeFocusedStyling(this.outgoing.element, this.outgoing.originalState.zIndex?.toString() || ""), this.removeFocusedStyling(s.element, this.incoming.originalState.zIndex?.toString() || ""), this.outgoing = null, this.incoming = null, this.currentFocus = null, this.focusData = null, this.state = I.IDLE;
2153
2232
  return;
2154
2233
  }
2155
2234
  this.state = I.UNFOCUSING;
@@ -2194,8 +2273,8 @@ class Ie {
2194
2273
  */
2195
2274
  setDragOffset(t) {
2196
2275
  if (!this.currentFocus || !this.focusData || this.state !== I.FOCUSED) return;
2197
- const e = this.currentFocus, i = this.focusData.focusTransform, o = ["translate(-50%, -50%)"], s = (i.x ?? 0) + t, r = i.y ?? 0;
2198
- o.push(`translate(${s}px, ${r}px)`), i.rotation !== void 0 && o.push(`rotate(${i.rotation}deg)`), e.style.transition = "none", e.style.transform = o.join(" ");
2276
+ const e = this.currentFocus, i = this.focusData.focusTransform, o = ["translate(-50%, -50%)"], a = (i.x ?? 0) + t, r = i.y ?? 0;
2277
+ o.push(`translate(${a}px, ${r}px)`), i.rotation !== void 0 && o.push(`rotate(${i.rotation}deg)`), e.style.transition = "none", e.style.transform = o.join(" ");
2199
2278
  }
2200
2279
  /**
2201
2280
  * Clear the drag offset, optionally animating back to center
@@ -2204,9 +2283,9 @@ class Ie {
2204
2283
  */
2205
2284
  clearDragOffset(t, e = 150) {
2206
2285
  if (!this.currentFocus || !this.focusData || this.state !== I.FOCUSED) return;
2207
- const i = this.currentFocus, o = this.focusData.focusTransform, s = ["translate(-50%, -50%)"], r = o.x ?? 0, a = o.y ?? 0;
2208
- s.push(`translate(${r}px, ${a}px)`), o.rotation !== void 0 && s.push(`rotate(${o.rotation}deg)`);
2209
- const h = s.join(" ");
2286
+ const i = this.currentFocus, o = this.focusData.focusTransform, a = ["translate(-50%, -50%)"], r = o.x ?? 0, s = o.y ?? 0;
2287
+ a.push(`translate(${r}px, ${s}px)`), o.rotation !== void 0 && a.push(`rotate(${o.rotation}deg)`);
2288
+ const h = a.join(" ");
2210
2289
  t ? (i.style.transition = `transform ${e}ms ease-out`, i.style.transform = h, setTimeout(() => {
2211
2290
  this.currentFocus === i && (i.style.transition = "none");
2212
2291
  }, e)) : (i.style.transition = "none", i.style.transform = h);
@@ -2236,7 +2315,7 @@ class Ie {
2236
2315
  ), this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2237
2316
  }
2238
2317
  }
2239
- const Ae = 50, Te = 0.5, Ce = 20, Re = 0.3, Me = 150, Le = 30, at = class at {
2318
+ const Re = 50, Me = 0.5, Le = 20, ze = 0.3, Fe = 150, $e = 30, ot = class ot {
2240
2319
  constructor(t, e) {
2241
2320
  this.enabled = !1, this.touchState = null, this.recentTouchTimestamp = 0, this.container = t, this.callbacks = e, this.boundTouchStart = this.handleTouchStart.bind(this), this.boundTouchMove = this.handleTouchMove.bind(this), this.boundTouchEnd = this.handleTouchEnd.bind(this), this.boundTouchCancel = this.handleTouchCancel.bind(this);
2242
2321
  }
@@ -2263,7 +2342,7 @@ const Ae = 50, Te = 0.5, Ce = 20, Re = 0.3, Me = 150, Le = 30, at = class at {
2263
2342
  * Used to prevent click-outside from unfocusing immediately after touch
2264
2343
  */
2265
2344
  hadRecentTouch() {
2266
- return Date.now() - this.recentTouchTimestamp < at.TOUCH_CLICK_DELAY;
2345
+ return Date.now() - this.recentTouchTimestamp < ot.TOUCH_CLICK_DELAY;
2267
2346
  }
2268
2347
  handleTouchStart(t) {
2269
2348
  if (t.touches.length !== 1) return;
@@ -2282,29 +2361,29 @@ const Ae = 50, Te = 0.5, Ce = 20, Re = 0.3, Me = 150, Le = 30, at = class at {
2282
2361
  if (!this.touchState || t.touches.length !== 1) return;
2283
2362
  const e = t.touches[0], i = e.clientX - this.touchState.startX, o = e.clientY - this.touchState.startY;
2284
2363
  if (this.touchState.isHorizontalSwipe === null && Math.sqrt(i * i + o * o) > 10) {
2285
- const a = Math.atan2(Math.abs(o), Math.abs(i)) * (180 / Math.PI);
2286
- this.touchState.isHorizontalSwipe = a <= Le;
2364
+ const s = Math.atan2(Math.abs(o), Math.abs(i)) * (180 / Math.PI);
2365
+ this.touchState.isHorizontalSwipe = s <= $e;
2287
2366
  }
2288
2367
  if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
2289
2368
  t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = e.clientX;
2290
- const s = i * Re;
2291
- this.callbacks.onDragOffset(s);
2369
+ const a = i * ze;
2370
+ this.callbacks.onDragOffset(a);
2292
2371
  }
2293
2372
  }
2294
2373
  handleTouchEnd(t) {
2295
2374
  if (!this.touchState) return;
2296
2375
  this.recentTouchTimestamp = Date.now();
2297
- const e = this.touchState.currentX - this.touchState.startX, i = performance.now() - this.touchState.startTime, o = Math.abs(e) / i, s = Math.abs(e);
2376
+ const e = this.touchState.currentX - this.touchState.startX, i = performance.now() - this.touchState.startTime, o = Math.abs(e) / i, a = Math.abs(e);
2298
2377
  let r = !1;
2299
- this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (s >= Ae || o >= Te && s >= Ce) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2378
+ this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= Re || o >= Me && a >= Le) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2300
2379
  }
2301
2380
  handleTouchCancel(t) {
2302
2381
  this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
2303
2382
  }
2304
2383
  };
2305
- at.TOUCH_CLICK_DELAY = 300;
2306
- let mt = at;
2307
- class ze {
2384
+ ot.TOUCH_CLICK_DELAY = 300;
2385
+ let mt = ot;
2386
+ class De {
2308
2387
  constructor(t) {
2309
2388
  if (this._prepared = !1, this._discoveredUrls = [], this.apiKey = t.apiKey ?? "", this.apiEndpoint = t.apiEndpoint ?? "https://www.googleapis.com/drive/v3/files", this.debugLogging = t.debugLogging ?? !1, this.sources = t.sources ?? [], !this.sources || this.sources.length === 0)
2310
2389
  throw new Error("GoogleDriveLoader requires at least one source to be configured");
@@ -2318,8 +2397,8 @@ class ze {
2318
2397
  for (const e of this.sources)
2319
2398
  if ("folders" in e)
2320
2399
  for (const i of e.folders) {
2321
- const o = e.recursive !== void 0 ? e.recursive : !0, s = await this.loadFromFolder(i, t, o);
2322
- this._discoveredUrls.push(...s);
2400
+ const o = e.recursive !== void 0 ? e.recursive : !0, a = await this.loadFromFolder(i, t, o);
2401
+ this._discoveredUrls.push(...a);
2323
2402
  }
2324
2403
  else if ("files" in e) {
2325
2404
  const i = await this.loadFiles(e.files, t);
@@ -2385,8 +2464,8 @@ class ze {
2385
2464
  return this.loadImagesDirectly(o, e);
2386
2465
  try {
2387
2466
  return i ? await this.loadImagesRecursively(o, e) : await this.loadImagesFromSingleFolder(o, e);
2388
- } catch (s) {
2389
- return console.error("Error loading from Google Drive API:", s), this.loadImagesDirectly(o, e);
2467
+ } catch (a) {
2468
+ return console.error("Error loading from Google Drive API:", a), this.loadImagesDirectly(o, e);
2390
2469
  }
2391
2470
  }
2392
2471
  /**
@@ -2396,14 +2475,14 @@ class ze {
2396
2475
  * @returns Promise resolving to array of image URLs
2397
2476
  */
2398
2477
  async loadImagesFromSingleFolder(t, e) {
2399
- const i = [], o = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(r);
2400
- if (!a.ok)
2401
- throw new Error(`API request failed: ${a.status} ${a.statusText}`);
2402
- const c = (await a.json()).files.filter(
2403
- (u) => u.mimeType.startsWith("image/") && e.isAllowed(u.name)
2478
+ const i = [], o = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, s = await fetch(r);
2479
+ if (!s.ok)
2480
+ throw new Error(`API request failed: ${s.status} ${s.statusText}`);
2481
+ const c = (await s.json()).files.filter(
2482
+ (d) => d.mimeType.startsWith("image/") && e.isAllowed(d.name)
2404
2483
  );
2405
- return this.log(`Found ${c.length} images in folder ${t} (non-recursive)`), c.forEach((u) => {
2406
- i.push(`https://lh3.googleusercontent.com/d/${u.id}=s1600`), this.log(`Added file: ${u.name}`);
2484
+ return this.log(`Found ${c.length} images in folder ${t} (non-recursive)`), c.forEach((d) => {
2485
+ i.push(`https://lh3.googleusercontent.com/d/${d.id}=s1600`), this.log(`Added file: ${d.name}`);
2407
2486
  }), i;
2408
2487
  }
2409
2488
  /**
@@ -2415,24 +2494,24 @@ class ze {
2415
2494
  async loadFiles(t, e) {
2416
2495
  const i = [];
2417
2496
  for (const o of t) {
2418
- const s = this.extractFileId(o);
2419
- if (!s) {
2497
+ const a = this.extractFileId(o);
2498
+ if (!a) {
2420
2499
  this.log(`Skipping invalid file URL: ${o}`);
2421
2500
  continue;
2422
2501
  }
2423
2502
  if (this.apiKey && this.apiKey !== "YOUR_API_KEY_HERE")
2424
2503
  try {
2425
- const r = `${this.apiEndpoint}/${s}?fields=name,mimeType&key=${this.apiKey}`, a = await fetch(r);
2426
- if (a.ok) {
2427
- const h = await a.json();
2428
- h.mimeType.startsWith("image/") && e.isAllowed(h.name) ? (i.push(`https://lh3.googleusercontent.com/d/${s}=s1600`), this.log(`Added file: ${h.name}`)) : this.log(`Skipping non-image file: ${h.name} (${h.mimeType})`);
2504
+ const r = `${this.apiEndpoint}/${a}?fields=name,mimeType&key=${this.apiKey}`, s = await fetch(r);
2505
+ if (s.ok) {
2506
+ const h = await s.json();
2507
+ h.mimeType.startsWith("image/") && e.isAllowed(h.name) ? (i.push(`https://lh3.googleusercontent.com/d/${a}=s1600`), this.log(`Added file: ${h.name}`)) : this.log(`Skipping non-image file: ${h.name} (${h.mimeType})`);
2429
2508
  } else
2430
- this.log(`Failed to fetch metadata for file ${s}: ${a.status}`);
2509
+ this.log(`Failed to fetch metadata for file ${a}: ${s.status}`);
2431
2510
  } catch (r) {
2432
- this.log(`Error fetching metadata for file ${s}:`, r);
2511
+ this.log(`Error fetching metadata for file ${a}:`, r);
2433
2512
  }
2434
2513
  else
2435
- i.push(`https://lh3.googleusercontent.com/d/${s}=s1600`);
2514
+ i.push(`https://lh3.googleusercontent.com/d/${a}=s1600`);
2436
2515
  }
2437
2516
  return i;
2438
2517
  }
@@ -2466,21 +2545,21 @@ class ze {
2466
2545
  * @returns Promise resolving to array of image URLs
2467
2546
  */
2468
2547
  async loadImagesRecursively(t, e) {
2469
- const i = [], o = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, a = await fetch(r);
2470
- if (!a.ok)
2471
- throw new Error(`API request failed: ${a.status} ${a.statusText}`);
2472
- const h = await a.json(), c = h.files.filter(
2548
+ const i = [], o = `'${t}' in parents and trashed=false`, r = `${this.apiEndpoint}?q=${encodeURIComponent(o)}&fields=files(id,name,mimeType,thumbnailLink)&key=${this.apiKey}`, s = await fetch(r);
2549
+ if (!s.ok)
2550
+ throw new Error(`API request failed: ${s.status} ${s.statusText}`);
2551
+ const h = await s.json(), c = h.files.filter(
2473
2552
  (l) => l.mimeType.startsWith("image/") && e.isAllowed(l.name)
2474
- ), u = h.files.filter(
2553
+ ), d = h.files.filter(
2475
2554
  (l) => l.mimeType === "application/vnd.google-apps.folder"
2476
2555
  );
2477
- this.log(`Found ${h.files.length} total items in folder ${t}`), h.files.forEach((l) => this.log(` - File: ${l.name} (${l.mimeType})`)), this.log(`- ${c.length} valid files (images only)`), this.log(`- ${u.length} subfolders`), c.forEach((l) => {
2556
+ this.log(`Found ${h.files.length} total items in folder ${t}`), h.files.forEach((l) => this.log(` - File: ${l.name} (${l.mimeType})`)), this.log(`- ${c.length} valid files (images only)`), this.log(`- ${d.length} subfolders`), c.forEach((l) => {
2478
2557
  i.push(`https://lh3.googleusercontent.com/d/${l.id}=s1600`), this.log(`Added file: ${l.name}`);
2479
2558
  });
2480
- for (const l of u) {
2559
+ for (const l of d) {
2481
2560
  this.log(`Loading images from subfolder: ${l.name}`);
2482
- const d = await this.loadImagesRecursively(l.id, e);
2483
- i.push(...d);
2561
+ const u = await this.loadImagesRecursively(l.id, e);
2562
+ i.push(...u);
2484
2563
  }
2485
2564
  return i;
2486
2565
  }
@@ -2496,9 +2575,9 @@ class ze {
2496
2575
  const i = `https://drive.google.com/embeddedfolderview?id=${t}`, o = await fetch(i, { mode: "cors" });
2497
2576
  if (!o.ok)
2498
2577
  throw new Error("Cannot access folder directly (CORS or permissions issue)");
2499
- const s = await o.text(), r = /\/file\/d\/([a-zA-Z0-9_-]+)/g, a = [...s.matchAll(r)];
2500
- return [...new Set(a.map((u) => u[1]))].map(
2501
- (u) => `https://drive.google.com/uc?export=view&id=${u}`
2578
+ const a = await o.text(), r = /\/file\/d\/([a-zA-Z0-9_-]+)/g, s = [...a.matchAll(r)];
2579
+ return [...new Set(s.map((d) => d[1]))].map(
2580
+ (d) => `https://drive.google.com/uc?export=view&id=${d}`
2502
2581
  );
2503
2582
  } catch (i) {
2504
2583
  throw console.error("Direct loading failed:", i), new Error(
@@ -2525,7 +2604,7 @@ class ze {
2525
2604
  this.debugLogging && typeof console < "u" && console.log(...t);
2526
2605
  }
2527
2606
  }
2528
- class Fe {
2607
+ class Oe {
2529
2608
  constructor(t) {
2530
2609
  if (this._prepared = !1, this._discoveredUrls = [], this.validateUrls = t.validateUrls !== !1, this.validationTimeout = t.validationTimeout ?? 5e3, this.validationMethod = t.validationMethod ?? "head", this.debugLogging = t.debugLogging ?? !1, this.sources = t.sources ?? [], !this.sources || this.sources.length === 0)
2531
2610
  throw new Error("StaticImageLoader requires at least one source to be configured");
@@ -2590,8 +2669,8 @@ class Fe {
2590
2669
  return console.warn("URLs must be an array:", t), [];
2591
2670
  const i = [];
2592
2671
  for (const o of t) {
2593
- const s = o.split("/").pop() || o;
2594
- if (!e.isAllowed(s)) {
2672
+ const a = o.split("/").pop() || o;
2673
+ if (!e.isAllowed(a)) {
2595
2674
  this.log(`Skipping filtered URL: ${o}`);
2596
2675
  continue;
2597
2676
  }
@@ -2610,12 +2689,12 @@ class Fe {
2610
2689
  if (!Array.isArray(e))
2611
2690
  return console.warn("files must be an array:", e), [];
2612
2691
  const o = [];
2613
- for (const s of e) {
2614
- if (!i.isAllowed(s)) {
2615
- this.log(`Skipping filtered file: ${s}`);
2692
+ for (const a of e) {
2693
+ if (!i.isAllowed(a)) {
2694
+ this.log(`Skipping filtered file: ${a}`);
2616
2695
  continue;
2617
2696
  }
2618
- const r = this.constructUrl(t, s);
2697
+ const r = this.constructUrl(t, a);
2619
2698
  this.validateUrls ? await this.validateUrl(r) ? o.push(r) : console.warn(`Skipping invalid/missing file: ${r}`) : o.push(r);
2620
2699
  }
2621
2700
  return o;
@@ -2631,15 +2710,15 @@ class Fe {
2631
2710
  this.log(`Fetching JSON endpoint: ${t}`);
2632
2711
  const i = new AbortController(), o = setTimeout(() => i.abort(), 1e4);
2633
2712
  try {
2634
- const s = await fetch(t, { signal: i.signal });
2635
- if (clearTimeout(o), !s.ok)
2636
- throw new Error(`HTTP ${s.status} fetching ${t}`);
2637
- const r = await s.json();
2713
+ const a = await fetch(t, { signal: i.signal });
2714
+ if (clearTimeout(o), !a.ok)
2715
+ throw new Error(`HTTP ${a.status} fetching ${t}`);
2716
+ const r = await a.json();
2638
2717
  if (!r || !Array.isArray(r.images))
2639
2718
  throw new Error('JSON source must return JSON with shape { "images": ["url1", "url2", ...] }');
2640
2719
  return this.log(`JSON endpoint returned ${r.images.length} image(s)`), await this.processUrls(r.images, e);
2641
- } catch (s) {
2642
- throw clearTimeout(o), s instanceof Error && s.name === "AbortError" ? new Error(`Timeout fetching JSON endpoint: ${t}`) : s;
2720
+ } catch (a) {
2721
+ throw clearTimeout(o), a instanceof Error && a.name === "AbortError" ? new Error(`Timeout fetching JSON endpoint: ${t}`) : a;
2643
2722
  }
2644
2723
  }
2645
2724
  /**
@@ -2661,11 +2740,11 @@ class Fe {
2661
2740
  if (!(t.startsWith(window.location.origin) || t.startsWith("/")))
2662
2741
  return this.log(`Skipping validation for cross-origin URL: ${t}`), !0;
2663
2742
  try {
2664
- const i = new AbortController(), o = setTimeout(() => i.abort(), this.validationTimeout), s = await fetch(t, {
2743
+ const i = new AbortController(), o = setTimeout(() => i.abort(), this.validationTimeout), a = await fetch(t, {
2665
2744
  method: "HEAD",
2666
2745
  signal: i.signal
2667
2746
  });
2668
- return clearTimeout(o), s.ok ? !0 : (this.log(`Validation failed for ${t}: HTTP ${s.status}`), !1);
2747
+ return clearTimeout(o), a.ok ? !0 : (this.log(`Validation failed for ${t}: HTTP ${a.status}`), !1);
2669
2748
  } catch (i) {
2670
2749
  return i instanceof Error && (i.name === "AbortError" ? this.log(`Validation timeout for ${t}`) : this.log(`Validation failed for ${t}:`, i.message)), !1;
2671
2750
  }
@@ -2705,7 +2784,7 @@ class Fe {
2705
2784
  this.debugLogging && typeof console < "u" && console.log(...t);
2706
2785
  }
2707
2786
  }
2708
- class De {
2787
+ class Pe {
2709
2788
  constructor(t) {
2710
2789
  if (this._prepared = !1, this._discoveredUrls = [], this.loaders = t.loaders, this.debugLogging = t.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
2711
2790
  throw new Error("CompositeLoader requires at least one loader to be configured");
@@ -2719,8 +2798,8 @@ class De {
2719
2798
  this._discoveredUrls = [], this.log(`Preparing ${this.loaders.length} loader(s) in parallel`);
2720
2799
  const e = this.loaders.map((i, o) => i.prepare(t).then(() => {
2721
2800
  this.log(`Loader ${o} prepared with ${i.imagesLength()} images`);
2722
- }).catch((s) => {
2723
- console.warn(`Loader ${o} failed to prepare:`, s);
2801
+ }).catch((a) => {
2802
+ console.warn(`Loader ${o} failed to prepare:`, a);
2724
2803
  }));
2725
2804
  await Promise.all(e);
2726
2805
  for (const i of this.loaders)
@@ -2762,7 +2841,7 @@ class De {
2762
2841
  this.debugLogging && typeof console < "u" && console.log("[CompositeLoader]", ...t);
2763
2842
  }
2764
2843
  }
2765
- class Oe {
2844
+ class Ue {
2766
2845
  /**
2767
2846
  * Create a new ImageFilter
2768
2847
  * @param extensions - Array of allowed file extensions (without dots)
@@ -2799,7 +2878,7 @@ class Oe {
2799
2878
  // isAllowedDate(date: Date): boolean
2800
2879
  // isAllowedDimensions(width: number, height: number): boolean
2801
2880
  }
2802
- const $e = `
2881
+ const _e = `
2803
2882
  .fbn-ic-gallery {
2804
2883
  position: relative;
2805
2884
  width: 100%;
@@ -2849,20 +2928,20 @@ const $e = `
2849
2928
  display: none !important;
2850
2929
  }
2851
2930
  `;
2852
- function Pe() {
2931
+ function He() {
2853
2932
  if (typeof document > "u") return;
2854
2933
  const n = "fbn-ic-functional-styles";
2855
2934
  if (document.getElementById(n)) return;
2856
2935
  const t = document.createElement("style");
2857
- t.id = n, t.textContent = $e, document.head.appendChild(t);
2936
+ t.id = n, t.textContent = _e, document.head.appendChild(t);
2858
2937
  }
2859
- let Ue = class {
2938
+ let Ne = class {
2860
2939
  constructor(t = {}) {
2861
2940
  this.fullConfig = Xt(t), t.container instanceof HTMLElement ? (this.containerRef = t.container, this.containerId = null) : (this.containerRef = null, this.containerId = t.container || "imageCloud"), this.imagesLoaded = !1, this.imageElements = [], this.imageLayouts = [], this.currentImageHeight = 225, this.currentFocusIndex = null, this.hoveredImage = null, this.resizeTimeout = null, this.displayQueue = [], this.queueInterval = null, this.loadGeneration = 0, this.loadingElAutoCreated = !1, this.errorElAutoCreated = !1, this.counterEl = null, this.counterElAutoCreated = !1, this.animationEngine = new Kt(this.fullConfig.animation), this.layoutEngine = new ve({
2862
2941
  layout: this.fullConfig.layout,
2863
2942
  image: this.fullConfig.image
2864
- }), this.zoomEngine = new Ie(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = st(this.fullConfig.styling?.default), this.hoverStyles = st(this.fullConfig.styling?.hover), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
2865
- const e = this.fullConfig.animation.entry || y.animation.entry;
2943
+ }), this.zoomEngine = new Te(this.fullConfig.interaction.focus, this.animationEngine, this.fullConfig.styling), this.defaultStyles = vt(this.fullConfig.styling?.default), this.defaultClassName = this.fullConfig.styling?.default?.className, this.hoverClassName = this.fullConfig.styling?.hover?.className;
2944
+ const e = this.fullConfig.animation.entry || b.animation.entry;
2866
2945
  this.entryAnimationEngine = new ce(
2867
2946
  e,
2868
2947
  this.fullConfig.layout.algorithm
@@ -2873,7 +2952,7 @@ let Ue = class {
2873
2952
  */
2874
2953
  createImageFilter() {
2875
2954
  const t = this.fullConfig.config.loaders?.allowedExtensions;
2876
- return new Oe(t);
2955
+ return new Ue(t);
2877
2956
  }
2878
2957
  /**
2879
2958
  * Create appropriate image loader based on config
@@ -2884,7 +2963,7 @@ let Ue = class {
2884
2963
  if (!t || t.length === 0)
2885
2964
  throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");
2886
2965
  const i = t.map((o) => this.createLoaderFromEntry(o, e));
2887
- return i.length === 1 ? i[0] : new De({
2966
+ return i.length === 1 ? i[0] : new Pe({
2888
2967
  loaders: i,
2889
2968
  debugLogging: this.fullConfig.config.debug?.loaders
2890
2969
  });
@@ -2902,14 +2981,14 @@ let Ue = class {
2902
2981
  allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
2903
2982
  debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
2904
2983
  };
2905
- return new Fe(o);
2984
+ return new Oe(o);
2906
2985
  } else if ("googleDrive" in t) {
2907
2986
  const i = t.googleDrive, o = {
2908
2987
  ...i,
2909
2988
  allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
2910
2989
  debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
2911
2990
  };
2912
- return new ze(o);
2991
+ return new De(o);
2913
2992
  } else
2914
2993
  throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`);
2915
2994
  }
@@ -2918,7 +2997,7 @@ let Ue = class {
2918
2997
  */
2919
2998
  async init() {
2920
2999
  try {
2921
- if (Pe(), this.containerRef)
3000
+ if (He(), this.containerRef)
2922
3001
  this.containerEl = this.containerRef;
2923
3002
  else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
2924
3003
  throw new Error(`Container #${this.containerId} not found`);
@@ -2927,7 +3006,7 @@ let Ue = class {
2927
3006
  onPrev: () => this.navigateToPreviousImage(),
2928
3007
  onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
2929
3008
  onDragEnd: (t) => {
2930
- t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Me);
3009
+ t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Fe);
2931
3010
  }
2932
3011
  }), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
2933
3012
  } catch (t) {
@@ -3022,13 +3101,13 @@ let Ue = class {
3022
3101
  this.showError("No images found."), this.showLoading(!1);
3023
3102
  return;
3024
3103
  }
3025
- const i = this.getContainerBounds(), o = this.getImageHeight(), s = window.innerWidth;
3104
+ const i = this.getContainerBounds(), o = this.getImageHeight(), a = window.innerWidth;
3026
3105
  this.logDebug(`Adaptive sizing input: container=${i.width}x${i.height}px, images=${t}, responsiveMax=${o}px`);
3027
3106
  const r = this.layoutEngine.calculateAdaptiveSize(
3028
3107
  i,
3029
3108
  t,
3030
3109
  o,
3031
- s
3110
+ a
3032
3111
  );
3033
3112
  this.logDebug(`Adaptive sizing result: height=${r.height}px`), await this.createImageCloud(e, r.height), this.showLoading(!1), this.imagesLoaded = !0;
3034
3113
  } catch (t) {
@@ -3045,41 +3124,41 @@ let Ue = class {
3045
3124
  if (!this.containerEl) return;
3046
3125
  const i = this.getContainerBounds();
3047
3126
  this.currentImageHeight = e;
3048
- const o = this.loadGeneration, s = this.layoutEngine.generateLayout(t.length, i, { fixedHeight: e });
3049
- this.imageLayouts = s, this.displayQueue = [];
3127
+ const o = this.loadGeneration, a = this.layoutEngine.generateLayout(t.length, i, { fixedHeight: e });
3128
+ this.imageLayouts = a, this.displayQueue = [];
3050
3129
  let r = 0;
3051
- const a = (c) => {
3130
+ const s = (c) => {
3052
3131
  this.containerEl && (this.containerEl.appendChild(c), this.imageElements.push(c), requestAnimationFrame(() => {
3053
3132
  if (c.offsetWidth, c.style.opacity = this.defaultStyles.opacity ?? "1", c.dataset.startX && (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || c.dataset.startRotation !== c.dataset.rotation || c.dataset.startScale !== c.dataset.scale)) {
3054
- const d = {
3133
+ const u = {
3055
3134
  x: parseFloat(c.dataset.startX),
3056
3135
  y: parseFloat(c.dataset.startY)
3057
- }, f = {
3136
+ }, g = {
3058
3137
  x: parseFloat(c.dataset.endX),
3059
3138
  y: parseFloat(c.dataset.endY)
3060
- }, b = parseFloat(c.dataset.imageWidth), p = parseFloat(c.dataset.imageHeight), g = parseFloat(c.dataset.rotation), m = parseFloat(c.dataset.scale), S = c.dataset.startRotation ? parseFloat(c.dataset.startRotation) : g, v = c.dataset.startScale ? parseFloat(c.dataset.startScale) : m, w = this.entryAnimationEngine.getTiming();
3139
+ }, p = parseFloat(c.dataset.imageWidth), y = parseFloat(c.dataset.imageHeight), f = parseFloat(c.dataset.rotation), m = parseFloat(c.dataset.scale), E = c.dataset.startRotation ? parseFloat(c.dataset.startRotation) : f, v = c.dataset.startScale ? parseFloat(c.dataset.startScale) : m, w = this.entryAnimationEngine.getTiming();
3061
3140
  se({
3062
3141
  element: c,
3063
- startPosition: d,
3064
- endPosition: f,
3142
+ startPosition: u,
3143
+ endPosition: g,
3065
3144
  pathConfig: this.entryAnimationEngine.getPathConfig(),
3066
3145
  duration: w.duration,
3067
- imageWidth: b,
3068
- imageHeight: p,
3069
- rotation: g,
3146
+ imageWidth: p,
3147
+ imageHeight: y,
3148
+ rotation: f,
3070
3149
  scale: m,
3071
3150
  rotationConfig: this.entryAnimationEngine.getRotationConfig(),
3072
- startRotation: S,
3151
+ startRotation: E,
3073
3152
  scaleConfig: this.entryAnimationEngine.getScaleConfig(),
3074
3153
  startScale: v
3075
3154
  });
3076
3155
  } else {
3077
- const d = c.dataset.finalTransform || "";
3078
- c.style.transform = d;
3156
+ const u = c.dataset.finalTransform || "";
3157
+ c.style.transform = u;
3079
3158
  }
3080
3159
  const l = parseInt(c.dataset.imageId || "0");
3081
3160
  if (this.fullConfig.config.debug?.enabled && l < 3) {
3082
- const d = c.dataset.finalTransform || "";
3161
+ const u = c.dataset.finalTransform || "";
3083
3162
  console.log(`Image ${l} final state:`, {
3084
3163
  left: c.style.left,
3085
3164
  top: c.style.top,
@@ -3087,7 +3166,7 @@ let Ue = class {
3087
3166
  height: c.style.height,
3088
3167
  computedWidth: c.offsetWidth,
3089
3168
  computedHeight: c.offsetHeight,
3090
- transform: d,
3169
+ transform: u,
3091
3170
  pathType: this.entryAnimationEngine.getPathType()
3092
3171
  });
3093
3172
  }
@@ -3096,7 +3175,7 @@ let Ue = class {
3096
3175
  if (this.logDebug("Starting queue processing, enabled:", this.fullConfig.animation.queue.enabled), !this.fullConfig.animation.queue.enabled) {
3097
3176
  for (; this.displayQueue.length > 0; ) {
3098
3177
  const c = this.displayQueue.shift();
3099
- c && a(c);
3178
+ c && s(c);
3100
3179
  }
3101
3180
  return;
3102
3181
  }
@@ -3107,70 +3186,76 @@ let Ue = class {
3107
3186
  }
3108
3187
  if (this.displayQueue.length > 0) {
3109
3188
  const c = this.displayQueue.shift();
3110
- c && a(c);
3189
+ c && s(c);
3111
3190
  }
3112
3191
  r >= t.length && this.displayQueue.length === 0 && this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
3113
3192
  }, this.fullConfig.animation.queue.interval);
3114
3193
  };
3115
3194
  if ("IntersectionObserver" in window && this.containerEl) {
3116
- const c = new IntersectionObserver((u) => {
3117
- u.forEach((l) => {
3195
+ const c = new IntersectionObserver((d) => {
3196
+ d.forEach((l) => {
3118
3197
  l.isIntersecting && (h(), c.disconnect());
3119
3198
  });
3120
3199
  }, { threshold: 0.1, rootMargin: "50px" });
3121
3200
  c.observe(this.containerEl);
3122
3201
  } else
3123
3202
  h();
3124
- this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((c) => c.remove()), s.forEach((c, u) => {
3203
+ this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((c) => c.remove()), a.forEach((c, d) => {
3125
3204
  const l = document.createElement("div");
3126
3205
  l.className = "fbn-ic-debug-center", l.style.position = "absolute", l.style.width = "12px", l.style.height = "12px", l.style.borderRadius = "50%", l.style.backgroundColor = "red", l.style.border = "2px solid yellow", l.style.zIndex = "9999", l.style.pointerEvents = "none";
3127
- const d = c.x, f = c.y;
3128
- l.style.left = `${d - 6}px`, l.style.top = `${f - 6}px`, l.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(f)})`, this.containerEl.appendChild(l);
3129
- })), t.forEach((c, u) => {
3206
+ const u = c.x, g = c.y;
3207
+ l.style.left = `${u - 6}px`, l.style.top = `${g - 6}px`, l.title = `Image ${d}: center (${Math.round(u)}, ${Math.round(g)})`, this.containerEl.appendChild(l);
3208
+ })), t.forEach((c, d) => {
3130
3209
  const l = document.createElement("img");
3131
- l.referrerPolicy = "no-referrer", l.classList.add("fbn-ic-image"), l.dataset.imageId = String(u);
3132
- const d = s[u];
3133
- l.style.position = "absolute", l.style.width = "auto", l.style.height = `${e}px`, l.style.left = `${d.x}px`, l.style.top = `${d.y}px`, d.zIndex && (l.style.zIndex = String(d.zIndex)), tt(l, this.defaultStyles), et(l, this.defaultClassName), l.addEventListener("mouseenter", () => {
3134
- this.hoveredImage = { element: l, layout: d }, this.zoomEngine.isInvolved(l) || (tt(l, this.hoverStyles), et(l, this.hoverClassName));
3210
+ l.referrerPolicy = "no-referrer", l.classList.add("fbn-ic-image"), l.dataset.imageId = String(d), l.dataset.createdFlag = "true";
3211
+ const u = a[d];
3212
+ l.style.position = "absolute", l.style.width = "auto", l.style.height = `${e}px`, l.style.left = `${u.x}px`, l.style.top = `${u.y}px`, u.zIndex && (l.style.zIndex = String(u.zIndex)), nt(l, this.defaultClassName), l.addEventListener("mouseenter", () => {
3213
+ if (this.hoveredImage = { element: l, layout: u }, !this.zoomEngine.isInvolved(l)) {
3214
+ const g = l.cachedRenderedWidth;
3215
+ ut(l, this.fullConfig.styling?.hover, e, g), nt(l, this.hoverClassName);
3216
+ }
3135
3217
  }), l.addEventListener("mouseleave", () => {
3136
- this.hoveredImage = null, this.zoomEngine.isInvolved(l) || (tt(l, this.defaultStyles), Ft(l, this.hoverClassName), et(l, this.defaultClassName));
3137
- }), l.addEventListener("click", (f) => {
3138
- f.stopPropagation(), this.handleImageClick(l, d);
3218
+ if (this.hoveredImage = null, !this.zoomEngine.isInvolved(l)) {
3219
+ const g = l.cachedRenderedWidth;
3220
+ ut(l, this.fullConfig.styling?.default, e, g), ft(l, this.hoverClassName), nt(l, this.defaultClassName);
3221
+ }
3222
+ }), l.addEventListener("click", (g) => {
3223
+ g.stopPropagation(), this.handleImageClick(l, u);
3139
3224
  }), l.style.opacity = "0", l.style.transition = this.entryAnimationEngine.getTransitionCSS(), l.onload = () => {
3140
3225
  if (o !== this.loadGeneration)
3141
3226
  return;
3142
- const f = l.naturalWidth / l.naturalHeight, b = e * f;
3143
- l.style.width = `${b}px`;
3144
- const p = { x: d.x, y: d.y }, g = { width: b, height: e }, m = this.entryAnimationEngine.calculateStartPosition(
3145
- p,
3146
- g,
3227
+ const g = l.naturalWidth / l.naturalHeight, p = e * g;
3228
+ l.dataset.onloadCalled = "true", window.DEBUG_CLIPPATH && console.log(`[onload #${d}] Called with imageHeight=${e}, renderedWidth=${p}`), l.style.width = `${p}px`, l.cachedRenderedWidth = p, l.aspectRatio = g, ut(l, this.fullConfig.styling?.default, e, p);
3229
+ const y = { x: u.x, y: u.y }, f = { width: p, height: e }, m = this.entryAnimationEngine.calculateStartPosition(
3230
+ y,
3231
+ f,
3147
3232
  i,
3148
- u,
3233
+ d,
3149
3234
  t.length
3150
- ), S = this.entryAnimationEngine.calculateStartRotation(d.rotation), v = this.entryAnimationEngine.calculateStartScale(d.scale), w = this.entryAnimationEngine.buildFinalTransform(
3151
- d.rotation,
3152
- d.scale,
3153
- b,
3235
+ ), E = this.entryAnimationEngine.calculateStartRotation(u.rotation), v = this.entryAnimationEngine.calculateStartScale(u.scale), w = this.entryAnimationEngine.buildFinalTransform(
3236
+ u.rotation,
3237
+ u.scale,
3238
+ p,
3154
3239
  e
3155
- ), E = this.entryAnimationEngine.buildStartTransform(
3240
+ ), S = this.entryAnimationEngine.buildStartTransform(
3156
3241
  m,
3242
+ y,
3243
+ u.rotation,
3244
+ u.scale,
3157
3245
  p,
3158
- d.rotation,
3159
- d.scale,
3160
- b,
3161
3246
  e,
3162
- S,
3247
+ E,
3163
3248
  v
3164
3249
  );
3165
- this.fullConfig.config.debug?.enabled && u < 3 && console.log(`Image ${u}:`, {
3166
- finalPosition: p,
3167
- imageSize: g,
3168
- left: d.x,
3169
- top: d.y,
3250
+ this.fullConfig.config.debug?.enabled && d < 3 && console.log(`Image ${d}:`, {
3251
+ finalPosition: y,
3252
+ imageSize: f,
3253
+ left: u.x,
3254
+ top: u.y,
3170
3255
  finalTransform: w,
3171
- renderedWidth: b,
3256
+ renderedWidth: p,
3172
3257
  renderedHeight: e
3173
- }), l.style.transform = E, l.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || S !== d.rotation || v !== d.scale) && (l.dataset.startX = String(m.x), l.dataset.startY = String(m.y), l.dataset.endX = String(p.x), l.dataset.endY = String(p.y), l.dataset.imageWidth = String(b), l.dataset.imageHeight = String(e), l.dataset.rotation = String(d.rotation), l.dataset.scale = String(d.scale), l.dataset.startRotation = String(S), l.dataset.startScale = String(v)), this.displayQueue.push(l);
3258
+ }), l.style.transform = S, l.dataset.finalTransform = w, (this.entryAnimationEngine.requiresJSAnimation() || this.entryAnimationEngine.requiresJSRotation() || this.entryAnimationEngine.requiresJSScale() || E !== u.rotation || v !== u.scale) && (l.dataset.startX = String(m.x), l.dataset.startY = String(m.y), l.dataset.endX = String(y.x), l.dataset.endY = String(y.y), l.dataset.imageWidth = String(p), l.dataset.imageHeight = String(e), l.dataset.rotation = String(u.rotation), l.dataset.scale = String(u.scale), l.dataset.startRotation = String(E), l.dataset.startScale = String(v)), this.displayQueue.push(l);
3174
3259
  }, l.onerror = () => r++, l.src = c;
3175
3260
  });
3176
3261
  }
@@ -3183,8 +3268,8 @@ let Ue = class {
3183
3268
  if (i)
3184
3269
  await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter();
3185
3270
  else {
3186
- const s = t.dataset.imageId;
3187
- this.currentFocusIndex = s !== void 0 ? parseInt(s, 10) : null, this.swipeEngine?.enable(), await this.zoomEngine.focusImage(t, o, e), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex);
3271
+ const a = t.dataset.imageId;
3272
+ this.currentFocusIndex = a !== void 0 ? parseInt(a, 10) : null, this.swipeEngine?.enable(), await this.zoomEngine.focusImage(t, o, e), this.currentFocusIndex !== null && this.updateCounter(this.currentFocusIndex);
3188
3273
  }
3189
3274
  }
3190
3275
  /**
@@ -3215,28 +3300,28 @@ let Ue = class {
3215
3300
  this.clearImageCloud(), this.loadingElAutoCreated && this.loadingEl && (this.loadingEl.remove(), this.loadingEl = null), this.errorElAutoCreated && this.errorEl && (this.errorEl.remove(), this.errorEl = null), this.counterElAutoCreated && this.counterEl && (this.counterEl.remove(), this.counterEl = null), this.resizeTimeout !== null && clearTimeout(this.resizeTimeout), this.swipeEngine?.destroy();
3216
3301
  }
3217
3302
  };
3218
- const je = Pt(
3303
+ const Ge = Pt(
3219
3304
  function({ className: t, style: e, ...i }, o) {
3220
- const s = wt(null), r = wt(null);
3305
+ const a = xt(null), r = xt(null);
3221
3306
  return Ut(o, () => ({
3222
3307
  get instance() {
3223
3308
  return r.current;
3224
3309
  }
3225
3310
  })), _t(() => {
3226
- if (!s.current) return;
3227
- const a = new Ue({
3228
- container: s.current,
3311
+ if (!a.current) return;
3312
+ const s = new Ne({
3313
+ container: a.current,
3229
3314
  ...i
3230
3315
  });
3231
- return r.current = a, a.init().catch((h) => {
3316
+ return r.current = s, s.init().catch((h) => {
3232
3317
  console.error("ImageCloud init failed:", h);
3233
3318
  }), () => {
3234
- a.destroy(), r.current = null;
3319
+ s.destroy(), r.current = null;
3235
3320
  };
3236
- }, [JSON.stringify(i)]), /* @__PURE__ */ $t("div", { ref: s, className: t, style: e });
3321
+ }, [JSON.stringify(i)]), /* @__PURE__ */ Ot("div", { ref: a, className: t, style: e });
3237
3322
  }
3238
3323
  );
3239
3324
  export {
3240
- je as ImageCloud
3325
+ Ge as ImageCloud
3241
3326
  };
3242
3327
  //# sourceMappingURL=react.js.map