@frybynite/image-cloud 0.7.3 → 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/vue.js CHANGED
@@ -1,11 +1,11 @@
1
- import { defineComponent as Ot, ref as wt, onMounted as $t, onUnmounted as Ut, watch as Pt, h as _t } from "vue";
2
- const mt = Object.freeze({
1
+ import { defineComponent as Ot, ref as xt, onMounted as Pt, onUnmounted as Ut, watch as _t, h as Ht } from "vue";
2
+ const gt = Object.freeze({
3
3
  none: "none",
4
4
  sm: "0 2px 4px rgba(0,0,0,0.1)",
5
5
  md: "0 4px 16px rgba(0,0,0,0.4)",
6
6
  lg: "0 8px 32px rgba(0,0,0,0.5)",
7
7
  glow: "0 0 30px rgba(255,255,255,0.6)"
8
- }), xt = Object.freeze({
8
+ }), Et = Object.freeze({
9
9
  energetic: Object.freeze({ overshoot: 0.25, bounces: 2, decayRatio: 0.5 }),
10
10
  playful: Object.freeze({ overshoot: 0.15, bounces: 1, decayRatio: 0.5 }),
11
11
  subtle: Object.freeze({ overshoot: 0.08, bounces: 1, decayRatio: 0.5 })
@@ -14,18 +14,18 @@ const mt = Object.freeze({
14
14
  bouncy: Object.freeze({ stiffness: 300, damping: 15, mass: 1, oscillations: 4 }),
15
15
  wobbly: Object.freeze({ stiffness: 180, damping: 12, mass: 1.5, oscillations: 5 }),
16
16
  snappy: Object.freeze({ stiffness: 400, damping: 25, mass: 0.8, oscillations: 2 })
17
- }), Et = Object.freeze({
17
+ }), It = Object.freeze({
18
18
  gentle: Object.freeze({ amplitude: 30, frequency: 1.5, decay: !0, decayRate: 0.9, phase: 0 }),
19
19
  playful: Object.freeze({ amplitude: 50, frequency: 2.5, decay: !0, decayRate: 0.7, phase: 0 }),
20
20
  serpentine: Object.freeze({ amplitude: 60, frequency: 3, decay: !1, decayRate: 1, phase: 0 }),
21
21
  flutter: Object.freeze({ amplitude: 20, frequency: 4, decay: !0, decayRate: 0.5, phase: 0 })
22
22
  }), pt = Object.freeze({
23
23
  type: "linear"
24
- }), bt = Object.freeze({
25
- mode: "none"
26
24
  }), yt = Object.freeze({
27
25
  mode: "none"
28
- }), Tt = Object.freeze({
26
+ }), bt = Object.freeze({
27
+ mode: "none"
28
+ }), Rt = Object.freeze({
29
29
  default: Object.freeze({
30
30
  border: Object.freeze({
31
31
  width: 0,
@@ -34,6 +34,7 @@ const mt = Object.freeze({
34
34
  style: "solid"
35
35
  }),
36
36
  shadow: "none",
37
+ clipPath: void 0,
37
38
  filter: Object.freeze({}),
38
39
  opacity: 1,
39
40
  cursor: "pointer",
@@ -50,17 +51,17 @@ const mt = Object.freeze({
50
51
  focused: Object.freeze({
51
52
  shadow: "none"
52
53
  })
53
- }), Ht = Object.freeze({
54
+ }), Nt = Object.freeze({
54
55
  rows: 1,
55
56
  amplitude: 100,
56
57
  frequency: 2,
57
58
  phaseShift: 0,
58
59
  synchronization: "offset"
59
60
  // Note: Image rotation along wave is now controlled via image.rotation.mode = 'tangent'
60
- }), Nt = Object.freeze({
61
+ }), jt = Object.freeze({
61
62
  mobile: Object.freeze({ maxWidth: 767 }),
62
63
  tablet: Object.freeze({ maxWidth: 1199 })
63
- }), jt = Object.freeze({
64
+ }), kt = Object.freeze({
64
65
  mode: "adaptive",
65
66
  // Default to adaptive sizing
66
67
  minSize: 50,
@@ -72,40 +73,40 @@ const mt = Object.freeze({
72
73
  // No variance by default
73
74
  max: 1
74
75
  })
75
- }), kt = Object.freeze({
76
+ }), Wt = Object.freeze({
76
77
  mode: "none",
77
78
  range: Object.freeze({
78
79
  min: -15,
79
80
  max: 15
80
81
  })
81
- }), Ct = Object.freeze({
82
- sizing: jt,
83
- rotation: kt
84
- }), Rt = Object.freeze({
82
+ }), Mt = Object.freeze({
83
+ sizing: kt,
84
+ rotation: Wt
85
+ }), Lt = Object.freeze({
85
86
  validateUrls: !0,
86
87
  validationTimeout: 5e3,
87
88
  validationMethod: "head",
88
89
  allowedExtensions: ["jpg", "jpeg", "png", "gif", "webp", "bmp"]
89
- }), Mt = Object.freeze({
90
+ }), zt = Object.freeze({
90
91
  enabled: !1,
91
92
  centers: !1,
92
93
  loaders: !1
93
- }), y = Object.freeze({
94
+ }), b = Object.freeze({
94
95
  // Loader configuration (always an array, composite behavior is implicit)
95
96
  loaders: [],
96
97
  // Shared loader settings and debug config
97
98
  config: Object.freeze({
98
- loaders: Rt,
99
- debug: Mt
99
+ loaders: Lt,
100
+ debug: zt
100
101
  }),
101
102
  // Image sizing and rotation configuration
102
- image: Ct,
103
+ image: Mt,
103
104
  // Pattern-based layout configuration
104
105
  layout: Object.freeze({
105
106
  algorithm: "radial",
106
107
  scaleDecay: 0,
107
108
  // No decay by default (0-1 for radial/spiral)
108
- responsive: Nt,
109
+ responsive: jt,
109
110
  targetCoverage: 0.6,
110
111
  // Target 60% of container area
111
112
  densityFactor: 1,
@@ -162,8 +163,8 @@ const mt = Object.freeze({
162
163
  easing: "cubic-bezier(0.25, 1, 0.5, 1)",
163
164
  // smooth deceleration
164
165
  path: pt,
165
- rotation: bt,
166
- scale: yt
166
+ rotation: yt,
167
+ scale: bt
167
168
  })
168
169
  }),
169
170
  // Pattern-based interaction configuration
@@ -216,15 +217,15 @@ const mt = Object.freeze({
216
217
  })
217
218
  }),
218
219
  // Image styling
219
- styling: Tt
220
+ styling: Rt
220
221
  });
221
222
  function Z(n, t) {
222
223
  if (!n) return t || {};
223
224
  if (!t) return { ...n };
224
225
  const e = { ...n };
225
- return t.border !== void 0 && (e.border = { ...n.border, ...t.border }), t.borderTop !== void 0 && (e.borderTop = { ...n.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (e.borderRight = { ...n.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (e.borderBottom = { ...n.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (e.borderLeft = { ...n.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (e.filter = { ...n.filter, ...t.filter }), t.outline !== void 0 && (e.outline = { ...n.outline, ...t.outline }), t.shadow !== void 0 && (e.shadow = t.shadow), t.opacity !== void 0 && (e.opacity = t.opacity), t.cursor !== void 0 && (e.cursor = t.cursor), t.className !== void 0 && (e.className = t.className), t.objectFit !== void 0 && (e.objectFit = t.objectFit), t.aspectRatio !== void 0 && (e.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (e.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (e.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (e.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (e.borderRadiusBottomLeft = t.borderRadiusBottomLeft), e;
226
+ return t.border !== void 0 && (e.border = { ...n.border, ...t.border }), t.borderTop !== void 0 && (e.borderTop = { ...n.borderTop, ...t.borderTop }), t.borderRight !== void 0 && (e.borderRight = { ...n.borderRight, ...t.borderRight }), t.borderBottom !== void 0 && (e.borderBottom = { ...n.borderBottom, ...t.borderBottom }), t.borderLeft !== void 0 && (e.borderLeft = { ...n.borderLeft, ...t.borderLeft }), t.filter !== void 0 && (e.filter = { ...n.filter, ...t.filter }), t.outline !== void 0 && (e.outline = { ...n.outline, ...t.outline }), t.shadow !== void 0 && (e.shadow = t.shadow), t.clipPath !== void 0 && (e.clipPath = t.clipPath), t.opacity !== void 0 && (e.opacity = t.opacity), t.cursor !== void 0 && (e.cursor = t.cursor), t.className !== void 0 && (e.className = t.className), t.objectFit !== void 0 && (e.objectFit = t.objectFit), t.aspectRatio !== void 0 && (e.aspectRatio = t.aspectRatio), t.borderRadiusTopLeft !== void 0 && (e.borderRadiusTopLeft = t.borderRadiusTopLeft), t.borderRadiusTopRight !== void 0 && (e.borderRadiusTopRight = t.borderRadiusTopRight), t.borderRadiusBottomRight !== void 0 && (e.borderRadiusBottomRight = t.borderRadiusBottomRight), t.borderRadiusBottomLeft !== void 0 && (e.borderRadiusBottomLeft = t.borderRadiusBottomLeft), e;
226
227
  }
227
- function Wt(n, t) {
228
+ function Gt(n, t) {
228
229
  if (!t) return { ...n };
229
230
  const e = Z(n.default, t.default), i = Z(
230
231
  Z(e, n.hover),
@@ -239,26 +240,26 @@ function Wt(n, t) {
239
240
  focused: o
240
241
  };
241
242
  }
242
- function Gt(n, t) {
243
+ function qt(n, t) {
243
244
  if (!t) return { ...n };
244
245
  const e = { ...n };
245
246
  if (t.sizing !== void 0 && (e.sizing = {
246
247
  ...n.sizing,
247
248
  ...t.sizing
248
249
  }, t.sizing.variance)) {
249
- 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;
250
- e.sizing.variance = { min: o, max: s };
250
+ 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;
251
+ e.sizing.variance = { min: o, max: a };
251
252
  }
252
253
  if (t.rotation !== void 0 && (e.rotation = {
253
254
  ...n.rotation,
254
255
  ...t.rotation
255
256
  }, t.rotation.range)) {
256
- 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;
257
- e.rotation.range = { min: o, max: s };
257
+ 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;
258
+ e.rotation.range = { min: o, max: a };
258
259
  }
259
260
  return e;
260
261
  }
261
- function qt(n) {
262
+ function Yt(n) {
262
263
  const t = n.layout?.rotation;
263
264
  if (t && "enabled" in t)
264
265
  return {
@@ -268,7 +269,7 @@ function qt(n) {
268
269
  }
269
270
  };
270
271
  }
271
- function Yt(n) {
272
+ function Xt(n) {
272
273
  const t = n.layout?.sizing?.variance;
273
274
  if (t)
274
275
  return {
@@ -279,8 +280,8 @@ function Yt(n) {
279
280
  }
280
281
  };
281
282
  }
282
- function Xt(n = {}) {
283
- const t = qt(n), e = Yt(n);
283
+ function Bt(n = {}) {
284
+ const t = Yt(n), e = Xt(n);
284
285
  let i = n.image;
285
286
  (t || e) && (i = {
286
287
  ...e || {},
@@ -298,94 +299,94 @@ function Xt(n = {}) {
298
299
  });
299
300
  const r = {
300
301
  loaders: {
301
- ...Rt,
302
+ ...Lt,
302
303
  ...n.config?.loaders ?? {}
303
304
  }
304
- }, a = {
305
+ }, s = {
305
306
  loaders: o,
306
307
  config: r,
307
- image: Gt(Ct, i),
308
- layout: { ...y.layout },
309
- animation: { ...y.animation },
310
- interaction: { ...y.interaction },
311
- rendering: { ...y.rendering },
312
- styling: Wt(Tt, n.styling)
308
+ image: qt(Mt, i),
309
+ layout: { ...b.layout },
310
+ animation: { ...b.animation },
311
+ interaction: { ...b.interaction },
312
+ rendering: { ...b.rendering },
313
+ styling: Gt(Rt, n.styling)
313
314
  };
314
- return n.layout && (a.layout = {
315
- ...y.layout,
315
+ return n.layout && (s.layout = {
316
+ ...b.layout,
316
317
  ...n.layout
317
- }, n.layout.responsive && (a.layout.responsive = {
318
- ...y.layout.responsive,
319
- mobile: n.layout.responsive.mobile ? { ...y.layout.responsive.mobile, ...n.layout.responsive.mobile } : y.layout.responsive.mobile,
320
- tablet: n.layout.responsive.tablet ? { ...y.layout.responsive.tablet, ...n.layout.responsive.tablet } : y.layout.responsive.tablet
321
- }), n.layout.spacing && (a.layout.spacing = {
322
- ...y.layout.spacing,
318
+ }, n.layout.responsive && (s.layout.responsive = {
319
+ ...b.layout.responsive,
320
+ mobile: n.layout.responsive.mobile ? { ...b.layout.responsive.mobile, ...n.layout.responsive.mobile } : b.layout.responsive.mobile,
321
+ tablet: n.layout.responsive.tablet ? { ...b.layout.responsive.tablet, ...n.layout.responsive.tablet } : b.layout.responsive.tablet
322
+ }), n.layout.spacing && (s.layout.spacing = {
323
+ ...b.layout.spacing,
323
324
  ...n.layout.spacing
324
- })), n.animation && (a.animation = {
325
- ...y.animation,
325
+ })), n.animation && (s.animation = {
326
+ ...b.animation,
326
327
  ...n.animation
327
- }, n.animation.easing && (a.animation.easing = {
328
- ...y.animation.easing,
328
+ }, n.animation.easing && (s.animation.easing = {
329
+ ...b.animation.easing,
329
330
  ...n.animation.easing
330
- }), n.animation.queue && (a.animation.queue = {
331
- ...y.animation.queue,
331
+ }), n.animation.queue && (s.animation.queue = {
332
+ ...b.animation.queue,
332
333
  ...n.animation.queue
333
- }), n.animation.performance && (a.animation.performance = {
334
- ...y.animation.performance,
334
+ }), n.animation.performance && (s.animation.performance = {
335
+ ...b.animation.performance,
335
336
  ...n.animation.performance
336
- }), n.animation.entry && (a.animation.entry = {
337
- ...y.animation.entry,
337
+ }), n.animation.entry && (s.animation.entry = {
338
+ ...b.animation.entry,
338
339
  ...n.animation.entry,
339
340
  start: n.animation.entry.start ? {
340
- ...y.animation.entry.start,
341
+ ...b.animation.entry.start,
341
342
  ...n.animation.entry.start,
342
- circular: n.animation.entry.start.circular ? { ...y.animation.entry.start.circular, ...n.animation.entry.start.circular } : y.animation.entry.start.circular
343
- } : y.animation.entry.start,
344
- timing: n.animation.entry.timing ? { ...y.animation.entry.timing, ...n.animation.entry.timing } : y.animation.entry.timing,
345
- path: n.animation.entry.path ? { ...pt, ...n.animation.entry.path } : y.animation.entry.path,
346
- rotation: n.animation.entry.rotation ? { ...bt, ...n.animation.entry.rotation } : y.animation.entry.rotation,
347
- scale: n.animation.entry.scale ? { ...yt, ...n.animation.entry.scale } : y.animation.entry.scale
348
- })), n.interaction && (a.interaction = {
349
- ...y.interaction,
343
+ circular: n.animation.entry.start.circular ? { ...b.animation.entry.start.circular, ...n.animation.entry.start.circular } : b.animation.entry.start.circular
344
+ } : b.animation.entry.start,
345
+ timing: n.animation.entry.timing ? { ...b.animation.entry.timing, ...n.animation.entry.timing } : b.animation.entry.timing,
346
+ path: n.animation.entry.path ? { ...pt, ...n.animation.entry.path } : b.animation.entry.path,
347
+ rotation: n.animation.entry.rotation ? { ...yt, ...n.animation.entry.rotation } : b.animation.entry.rotation,
348
+ scale: n.animation.entry.scale ? { ...bt, ...n.animation.entry.scale } : b.animation.entry.scale
349
+ })), n.interaction && (s.interaction = {
350
+ ...b.interaction,
350
351
  ...n.interaction
351
- }, n.interaction.focus && (a.interaction.focus = {
352
- ...y.interaction.focus,
352
+ }, n.interaction.focus && (s.interaction.focus = {
353
+ ...b.interaction.focus,
353
354
  ...n.interaction.focus
354
- }), n.interaction.navigation && (a.interaction.navigation = {
355
- ...y.interaction.navigation,
355
+ }), n.interaction.navigation && (s.interaction.navigation = {
356
+ ...b.interaction.navigation,
356
357
  ...n.interaction.navigation
357
- }), n.interaction.gestures && (a.interaction.gestures = {
358
- ...y.interaction.gestures,
358
+ }), n.interaction.gestures && (s.interaction.gestures = {
359
+ ...b.interaction.gestures,
359
360
  ...n.interaction.gestures
360
- })), n.rendering && (a.rendering = {
361
- ...y.rendering,
361
+ })), n.rendering && (s.rendering = {
362
+ ...b.rendering,
362
363
  ...n.rendering
363
- }, n.rendering.responsive && (a.rendering.responsive = {
364
- ...y.rendering.responsive,
364
+ }, n.rendering.responsive && (s.rendering.responsive = {
365
+ ...b.rendering.responsive,
365
366
  ...n.rendering.responsive,
366
- breakpoints: n.rendering.responsive.breakpoints ? { ...y.rendering.responsive.breakpoints, ...n.rendering.responsive.breakpoints } : y.rendering.responsive.breakpoints,
367
- mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection : y.rendering.responsive.mobileDetection
368
- }), n.rendering.ui && (a.rendering.ui = {
369
- ...y.rendering.ui,
367
+ breakpoints: n.rendering.responsive.breakpoints ? { ...b.rendering.responsive.breakpoints, ...n.rendering.responsive.breakpoints } : b.rendering.responsive.breakpoints,
368
+ mobileDetection: n.rendering.responsive.mobileDetection ? n.rendering.responsive.mobileDetection : b.rendering.responsive.mobileDetection
369
+ }), n.rendering.ui && (s.rendering.ui = {
370
+ ...b.rendering.ui,
370
371
  ...n.rendering.ui
371
- }), n.rendering.performance && (a.rendering.performance = {
372
- ...y.rendering.performance,
372
+ }), n.rendering.performance && (s.rendering.performance = {
373
+ ...b.rendering.performance,
373
374
  ...n.rendering.performance
374
- })), a.config.debug = {
375
- ...Mt,
375
+ })), s.config.debug = {
376
+ ...zt,
376
377
  ...n.config?.debug ?? {}
377
- }, a;
378
+ }, s;
378
379
  }
379
- function Bt(n, t) {
380
- return { ...n ? xt[n] : xt.playful, ...t };
380
+ function Vt(n, t) {
381
+ return { ...n ? Et[n] : Et.playful, ...t };
381
382
  }
382
383
  function Jt(n, t) {
383
384
  return { ...n ? St[n] : St.gentle, ...t };
384
385
  }
385
- function Vt(n, t) {
386
- return { ...n ? Et[n] : Et.gentle, ...t };
386
+ function Kt(n, t) {
387
+ return { ...n ? It[n] : It.gentle, ...t };
387
388
  }
388
- class Kt {
389
+ class Zt {
389
390
  constructor(t) {
390
391
  this.activeAnimations = /* @__PURE__ */ new Map(), this.animationIdCounter = 0, this.config = t;
391
392
  }
@@ -410,31 +411,31 @@ class Kt {
410
411
  * @param easing - CSS easing function (optional)
411
412
  * @returns AnimationHandle that can be used to cancel or query the animation
412
413
  */
413
- animateTransformCancellable(t, e, i, o = null, s = null) {
414
+ animateTransformCancellable(t, e, i, o = null, a = null) {
414
415
  this.cancelAllAnimations(t);
415
- const r = o ?? this.config.duration, a = s ?? this.config.easing.default, h = this.buildTransformString(e), c = this.buildTransformString(i);
416
+ const r = o ?? this.config.duration, s = a ?? this.config.easing.default, h = this.buildTransformString(e), c = this.buildTransformString(i);
416
417
  t.style.transition = "none";
417
- const u = t.animate(
418
+ const d = t.animate(
418
419
  [
419
420
  { transform: h },
420
421
  { transform: c }
421
422
  ],
422
423
  {
423
424
  duration: r,
424
- easing: a,
425
+ easing: s,
425
426
  fill: "forwards"
426
427
  // Keep final state after animation
427
428
  }
428
429
  ), l = {
429
430
  id: `anim-${++this.animationIdCounter}`,
430
431
  element: t,
431
- animation: u,
432
+ animation: d,
432
433
  fromState: e,
433
434
  toState: i,
434
435
  startTime: performance.now(),
435
436
  duration: r
436
437
  };
437
- return this.activeAnimations.set(t, l), u.finished.then(() => {
438
+ return this.activeAnimations.set(t, l), d.finished.then(() => {
438
439
  t.style.transform = c, this.activeAnimations.delete(t);
439
440
  }).catch(() => {
440
441
  this.activeAnimations.delete(t);
@@ -481,8 +482,8 @@ class Kt {
481
482
  const i = getComputedStyle(t).transform;
482
483
  if (i === "none" || !i)
483
484
  return { x: 0, y: 0, rotation: 0, scale: 1 };
484
- 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;
485
- return { x: a, y: h, rotation: r, scale: s };
485
+ 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;
486
+ return { x: s, y: h, rotation: r, scale: a };
486
487
  }
487
488
  /**
488
489
  * Check if an element has an active animation
@@ -509,10 +510,10 @@ class Kt {
509
510
  * @returns Promise that resolves when animation completes
510
511
  */
511
512
  animateTransform(t, e, i = null, o = null) {
512
- return new Promise((s) => {
513
- const r = i ?? this.config.duration, a = o ?? this.config.easing.default;
514
- t.style.transition = `transform ${r}ms ${a}, box-shadow ${r}ms ${a}`, t.style.transform = this.buildTransformString(e), setTimeout(() => {
515
- s();
513
+ return new Promise((a) => {
514
+ const r = i ?? this.config.duration, s = o ?? this.config.easing.default;
515
+ t.style.transition = `transform ${r}ms ${s}, box-shadow ${r}ms ${s}`, t.style.transform = this.buildTransformString(e), setTimeout(() => {
516
+ a();
516
517
  }, r);
517
518
  });
518
519
  }
@@ -541,161 +542,161 @@ class Kt {
541
542
  return new Promise((e) => setTimeout(e, t));
542
543
  }
543
544
  }
544
- function V(n, t, e) {
545
+ function J(n, t, e) {
545
546
  return n + (t - n) * e;
546
547
  }
547
- function Zt(n, t, e, i) {
548
- const { overshoot: o, bounces: s, decayRatio: r } = i, a = e.x - t.x, h = e.y - t.y, c = Qt(s, r);
549
- let u = 0, l = 0, d = 1, m = o, b = !1;
550
- for (let g = 0; g < c.length; g++)
551
- if (n <= c[g].time) {
552
- l = g === 0 ? 0 : c[g - 1].time, d = c[g].time, m = c[g].overshoot, b = c[g].isOvershoot;
548
+ function Qt(n, t, e, i) {
549
+ const { overshoot: o, bounces: a, decayRatio: r } = i, s = e.x - t.x, h = e.y - t.y, c = te(a, r);
550
+ let d = 0, l = 0, u = 1, g = o, p = !1;
551
+ for (let f = 0; f < c.length; f++)
552
+ if (n <= c[f].time) {
553
+ l = f === 0 ? 0 : c[f - 1].time, u = c[f].time, g = c[f].overshoot, p = c[f].isOvershoot;
553
554
  break;
554
555
  }
555
- const p = (n - l) / (d - l);
556
- if (b)
557
- u = 1 + m * ot(p);
556
+ const y = (n - l) / (u - l);
557
+ if (p)
558
+ d = 1 + g * it(y);
558
559
  else if (l === 0)
559
- u = ot(p);
560
+ d = it(y);
560
561
  else {
561
- const f = 1 + (c.find(
562
- (S, v) => S.time > l && v > 0 && c[v - 1].isOvershoot
563
- )?.overshoot || m);
564
- u = V(f, 1, ot(p));
562
+ const m = 1 + (c.find(
563
+ (E, v) => E.time > l && v > 0 && c[v - 1].isOvershoot
564
+ )?.overshoot || g);
565
+ d = J(m, 1, it(y));
565
566
  }
566
567
  return {
567
- x: t.x + a * u,
568
- y: t.y + h * u
568
+ x: t.x + s * d,
569
+ y: t.y + h * d
569
570
  };
570
571
  }
571
- function Qt(n, t) {
572
+ function te(n, t) {
572
573
  const e = [];
573
574
  let i = 0.6;
574
575
  e.push({ time: i, overshoot: 0, isOvershoot: !1 });
575
576
  let o = 0.15;
576
577
  const r = 0.4 / (n * 2);
577
- for (let a = 0; a < n; a++)
578
+ for (let s = 0; s < n; s++)
578
579
  i += r, e.push({ time: i, overshoot: o, isOvershoot: !0 }), i += r, e.push({ time: i, overshoot: o * t, isOvershoot: !1 }), o *= t;
579
580
  return e.push({ time: 1, overshoot: 0, isOvershoot: !1 }), e;
580
581
  }
581
- function te(n, t, e, i) {
582
- 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));
583
- let d;
582
+ function ee(n, t, e, i) {
583
+ 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));
584
+ let u;
584
585
  if (l < 1) {
585
- const m = u * Math.sqrt(1 - l * l), b = Math.exp(-l * u * n * 3), p = Math.cos(m * n * a * Math.PI);
586
- d = 1 - b * p;
586
+ const g = d * Math.sqrt(1 - l * l), p = Math.exp(-l * d * n * 3), y = Math.cos(g * n * s * Math.PI);
587
+ u = 1 - p * y;
587
588
  } else
588
- d = 1 - Math.exp(-u * n * 3);
589
- return d = Math.max(0, Math.min(d, 1.3)), {
590
- x: t.x + h * d,
591
- y: t.y + c * d
589
+ u = 1 - Math.exp(-d * n * 3);
590
+ return u = Math.max(0, Math.min(u, 1.3)), {
591
+ x: t.x + h * u,
592
+ y: t.y + c * u
592
593
  };
593
594
  }
594
- function ee(n, t, e, i) {
595
- 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, m = 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, f = ie(n);
595
+ function ie(n, t, e, i) {
596
+ 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 = ne(n);
596
597
  return {
597
- x: V(t.x, e.x, f) + g * d,
598
- y: V(t.y, e.y, f) + g * m
598
+ x: J(t.x, e.x, m) + f * u,
599
+ y: J(t.y, e.y, m) + f * g
599
600
  };
600
601
  }
601
- function ot(n) {
602
+ function it(n) {
602
603
  return 1 - (1 - n) * (1 - n);
603
604
  }
604
- function ie(n) {
605
+ function ne(n) {
605
606
  return 1 - Math.pow(1 - n, 3);
606
607
  }
607
- function ne(n, t, e) {
608
- 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;
608
+ function oe(n, t, e) {
609
+ 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;
609
610
  return t + h;
610
611
  }
611
- function oe(n, t, e) {
612
- const { overshoot: i, bounces: o } = e, s = [];
613
- s.push({ time: 0.5, scale: i });
612
+ function se(n, t, e) {
613
+ const { overshoot: i, bounces: o } = e, a = [];
614
+ a.push({ time: 0.5, scale: i });
614
615
  let r = i;
615
- const a = 0.5, c = 0.5 / (o * 2);
616
- let u = 0.5;
617
- for (let d = 0; d < o; d++) {
618
- const m = 1 - (r - 1) * a;
619
- u += c, s.push({ time: u, scale: m }), r = 1 + (r - 1) * a * a, u += c, d < o - 1 && s.push({ time: u, scale: r });
616
+ const s = 0.5, c = 0.5 / (o * 2);
617
+ let d = 0.5;
618
+ for (let u = 0; u < o; u++) {
619
+ const g = 1 - (r - 1) * s;
620
+ 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 });
620
621
  }
621
- s.push({ time: 1, scale: 1 });
622
+ a.push({ time: 1, scale: 1 });
622
623
  let l = 1;
623
- for (let d = 0; d < s.length; d++)
624
- if (n <= s[d].time) {
625
- const m = d === 0 ? 0 : s[d - 1].time, b = d === 0 ? 1 : s[d - 1].scale, p = (n - m) / (s[d].time - m), g = ot(p);
626
- l = b + (s[d].scale - b) * g;
624
+ for (let u = 0; u < a.length; u++)
625
+ if (n <= a[u].time) {
626
+ 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);
627
+ l = p + (a[u].scale - p) * f;
627
628
  break;
628
629
  }
629
630
  return l * t;
630
631
  }
631
- function se(n) {
632
+ function ae(n) {
632
633
  const {
633
634
  element: t,
634
635
  startPosition: e,
635
636
  endPosition: i,
636
637
  pathConfig: o,
637
- duration: s,
638
+ duration: a,
638
639
  imageWidth: r,
639
- imageHeight: a,
640
+ imageHeight: s,
640
641
  rotation: h,
641
642
  scale: c,
642
- onComplete: u,
643
+ onComplete: d,
643
644
  rotationConfig: l,
644
- startRotation: d,
645
- scaleConfig: m,
646
- startScale: b
647
- } = n, p = o.type, g = d !== void 0 && d !== h, f = l?.mode === "wobble", S = l?.wobble || { amplitude: 15, frequency: 3, decay: !0 }, v = g || f, w = b !== void 0 && b !== c, E = m?.mode === "pop", x = m?.pop || { overshoot: 1.2, bounces: 1 };
648
- if ((p === "linear" || p === "arc") && !v && !(w || E)) {
649
- u && u();
645
+ startRotation: u,
646
+ scaleConfig: g,
647
+ startScale: p
648
+ } = 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 };
649
+ if ((y === "linear" || y === "arc") && !v && !(w || S)) {
650
+ d && d();
650
651
  return;
651
652
  }
652
- const L = performance.now(), z = -r / 2, P = -a / 2;
653
+ const L = performance.now(), z = -r / 2, U = -s / 2;
653
654
  function _(Y) {
654
- const N = Y - L, T = Math.min(N / s, 1);
655
- let D;
656
- switch (p) {
655
+ const N = Y - L, A = Math.min(N / a, 1);
656
+ let $;
657
+ switch (y) {
657
658
  case "bounce": {
658
- const O = Bt(
659
+ const D = Vt(
659
660
  o.bouncePreset,
660
661
  o.bounce
661
662
  );
662
- D = Zt(T, e, i, O);
663
+ $ = Qt(A, e, i, D);
663
664
  break;
664
665
  }
665
666
  case "elastic": {
666
- const O = Jt(
667
+ const D = Jt(
667
668
  o.elasticPreset,
668
669
  o.elastic
669
670
  );
670
- D = te(T, e, i, O);
671
+ $ = ee(A, e, i, D);
671
672
  break;
672
673
  }
673
674
  case "wave": {
674
- const O = Vt(
675
+ const D = Kt(
675
676
  o.wavePreset,
676
677
  o.wave
677
678
  );
678
- D = ee(T, e, i, O);
679
+ $ = ie(A, e, i, D);
679
680
  break;
680
681
  }
681
682
  default:
682
- D = {
683
- x: V(e.x, i.x, T),
684
- y: V(e.y, i.y, T)
683
+ $ = {
684
+ x: J(e.x, i.x, A),
685
+ y: J(e.y, i.y, A)
685
686
  };
686
687
  }
687
- const k = D.x - i.x, H = D.y - i.y;
688
+ const k = $.x - i.x, H = $.y - i.y;
688
689
  let R;
689
- f ? R = ne(T, h, S) : g ? R = V(d, h, T) : R = h;
690
- let C;
691
- E ? C = oe(T, c, x) : w ? C = V(b, c, T) : C = c, t.style.transform = `translate(${z}px, ${P}px) translate(${k}px, ${H}px) rotate(${R}deg) scale(${C})`, T < 1 ? requestAnimationFrame(_) : (t.style.transform = `translate(${z}px, ${P}px) rotate(${h}deg) scale(${c})`, u && u());
690
+ m ? R = oe(A, h, E) : f ? R = J(u, h, A) : R = h;
691
+ let T;
692
+ S ? T = se(A, c, x) : w ? T = J(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());
692
693
  }
693
694
  requestAnimationFrame(_);
694
695
  }
695
- function ae(n) {
696
+ function re(n) {
696
697
  return n === "bounce" || n === "elastic" || n === "wave";
697
698
  }
698
- const re = {
699
+ const ce = {
699
700
  radial: "center",
700
701
  spiral: "center",
701
702
  grid: "top",
@@ -703,85 +704,85 @@ const re = {
703
704
  random: "nearest-edge",
704
705
  wave: "left"
705
706
  };
706
- class ce {
707
+ class le {
707
708
  constructor(t, e) {
708
- 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;
709
+ 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;
709
710
  }
710
711
  /**
711
712
  * Get the effective start position, considering layout-aware defaults
712
713
  */
713
714
  resolveStartPosition() {
714
- return this.config.start.position ? this.config.start.position : re[this.layoutAlgorithm] || "nearest-edge";
715
+ return this.config.start.position ? this.config.start.position : ce[this.layoutAlgorithm] || "nearest-edge";
715
716
  }
716
717
  /**
717
718
  * Calculate the starting position for an image's entry animation
718
719
  */
719
- calculateStartPosition(t, e, i, o, s) {
720
- const r = this.resolvedStartPosition, a = this.config.start.offset ?? 100;
720
+ calculateStartPosition(t, e, i, o, a) {
721
+ const r = this.resolvedStartPosition, s = this.config.start.offset ?? 100;
721
722
  switch (r) {
722
723
  case "nearest-edge":
723
- return this.calculateNearestEdge(t, e, i, a);
724
+ return this.calculateNearestEdge(t, e, i, s);
724
725
  case "top":
725
- return this.calculateEdgePosition("top", t, e, i, a);
726
+ return this.calculateEdgePosition("top", t, e, i, s);
726
727
  case "bottom":
727
- return this.calculateEdgePosition("bottom", t, e, i, a);
728
+ return this.calculateEdgePosition("bottom", t, e, i, s);
728
729
  case "left":
729
- return this.calculateEdgePosition("left", t, e, i, a);
730
+ return this.calculateEdgePosition("left", t, e, i, s);
730
731
  case "right":
731
- return this.calculateEdgePosition("right", t, e, i, a);
732
+ return this.calculateEdgePosition("right", t, e, i, s);
732
733
  case "center":
733
734
  return this.calculateCenterPosition(i, t, e);
734
735
  case "random-edge":
735
- return this.calculateRandomEdge(t, e, i, a);
736
+ return this.calculateRandomEdge(t, e, i, s);
736
737
  case "circular":
737
738
  return this.calculateCircularPosition(
738
739
  t,
739
740
  e,
740
741
  i,
741
742
  o,
742
- s
743
+ a
743
744
  );
744
745
  default:
745
- return this.calculateNearestEdge(t, e, i, a);
746
+ return this.calculateNearestEdge(t, e, i, s);
746
747
  }
747
748
  }
748
749
  /**
749
750
  * Calculate start position from the nearest edge (current default behavior)
750
751
  */
751
752
  calculateNearestEdge(t, e, i, o) {
752
- 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);
753
- let d = t.x, m = t.y;
754
- return l === a ? d = -(e.width + o) : l === h ? d = i.width + o : l === c ? m = -(e.height + o) : m = i.height + o, { x: d, y: m };
753
+ 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);
754
+ let u = t.x, g = t.y;
755
+ 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 };
755
756
  }
756
757
  /**
757
758
  * Calculate start position from a specific edge
758
759
  */
759
- calculateEdgePosition(t, e, i, o, s) {
760
- let r = e.x, a = e.y;
760
+ calculateEdgePosition(t, e, i, o, a) {
761
+ let r = e.x, s = e.y;
761
762
  switch (t) {
762
763
  case "top":
763
- a = -(i.height + s);
764
+ s = -(i.height + a);
764
765
  break;
765
766
  case "bottom":
766
- a = o.height + s;
767
+ s = o.height + a;
767
768
  break;
768
769
  case "left":
769
- r = -(i.width + s);
770
+ r = -(i.width + a);
770
771
  break;
771
772
  case "right":
772
- r = o.width + s;
773
+ r = o.width + a;
773
774
  break;
774
775
  }
775
- return { x: r, y: a };
776
+ return { x: r, y: s };
776
777
  }
777
778
  /**
778
779
  * Calculate start position from center with scale animation
779
780
  */
780
781
  calculateCenterPosition(t, e, i) {
781
- const o = t.width / 2, s = t.height / 2;
782
+ const o = t.width / 2, a = t.height / 2;
782
783
  return {
783
784
  x: o,
784
- y: s,
785
+ y: a,
785
786
  useScale: !0
786
787
  // Signal to use scale animation from 0
787
788
  };
@@ -790,27 +791,27 @@ class ce {
790
791
  * Calculate start position from a random edge
791
792
  */
792
793
  calculateRandomEdge(t, e, i, o) {
793
- const s = ["top", "bottom", "left", "right"], r = s[Math.floor(Math.random() * s.length)];
794
+ const a = ["top", "bottom", "left", "right"], r = a[Math.floor(Math.random() * a.length)];
794
795
  return this.calculateEdgePosition(r, t, e, i, o);
795
796
  }
796
797
  /**
797
798
  * Calculate start position on a circle around the container
798
799
  */
799
- calculateCircularPosition(t, e, i, o, s) {
800
- const r = this.config.start.circular || {}, a = r.distribution || "even";
800
+ calculateCircularPosition(t, e, i, o, a) {
801
+ const r = this.config.start.circular || {}, s = r.distribution || "even";
801
802
  let h;
802
803
  const c = r.radius || "120%";
803
804
  if (typeof c == "string" && c.endsWith("%")) {
804
- const p = parseFloat(c) / 100;
805
+ const y = parseFloat(c) / 100;
805
806
  h = Math.sqrt(
806
807
  i.width ** 2 + i.height ** 2
807
- ) * p / 2;
808
+ ) * y / 2;
808
809
  } else
809
810
  h = typeof c == "number" ? c : 500;
810
- let u;
811
- a === "even" ? u = o / s * 2 * Math.PI : u = Math.random() * 2 * Math.PI;
812
- const l = i.width / 2, d = i.height / 2, m = l + Math.cos(u) * h, b = d + Math.sin(u) * h;
813
- return { x: m, y: b };
811
+ let d;
812
+ s === "even" ? d = o / a * 2 * Math.PI : d = Math.random() * 2 * Math.PI;
813
+ const l = i.width / 2, u = i.height / 2, g = l + Math.cos(d) * h, p = u + Math.sin(d) * h;
814
+ return { x: g, y: p };
814
815
  }
815
816
  /**
816
817
  * Get animation parameters for an image
@@ -829,9 +830,9 @@ class ce {
829
830
  * Build a CSS transform string for the start position
830
831
  * Uses pixel-based centering offset for reliable cross-browser behavior
831
832
  */
832
- buildStartTransform(t, e, i, o, s, r, a, h) {
833
- const c = t.x - e.x, u = t.y - e.y, l = a !== void 0 ? a : i, d = h !== void 0 ? h : o, m = s !== void 0 ? -s / 2 : 0, b = r !== void 0 ? -r / 2 : 0, p = s !== void 0 ? `translate(${m}px, ${b}px)` : "translate(-50%, -50%)";
834
- 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})`;
833
+ buildStartTransform(t, e, i, o, a, r, s, h) {
834
+ 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%)";
835
+ 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})`;
835
836
  }
836
837
  /**
837
838
  * Build the final CSS transform string
@@ -839,8 +840,8 @@ class ce {
839
840
  */
840
841
  buildFinalTransform(t, e, i, o) {
841
842
  if (i !== void 0 && o !== void 0) {
842
- const s = -i / 2, r = -o / 2;
843
- return `translate(${s}px, ${r}px) rotate(${t}deg) scale(${e})`;
843
+ const a = -i / 2, r = -o / 2;
844
+ return `translate(${a}px, ${r}px) rotate(${t}deg) scale(${e})`;
844
845
  }
845
846
  return `translate(-50%, -50%) rotate(${t}deg) scale(${e})`;
846
847
  }
@@ -856,7 +857,7 @@ class ce {
856
857
  * Check if the current path type requires JavaScript animation
857
858
  */
858
859
  requiresJSAnimation() {
859
- return ae(this.pathConfig.type);
860
+ return re(this.pathConfig.type);
860
861
  }
861
862
  /**
862
863
  * Get the path configuration
@@ -958,7 +959,7 @@ class ce {
958
959
  amplitude: 15,
959
960
  frequency: 3,
960
961
  decay: !0
961
- }, { 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;
962
+ }, { 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;
962
963
  return e + c;
963
964
  }
964
965
  /**
@@ -1015,15 +1016,15 @@ class ce {
1015
1016
  const i = this.scaleConfig.pop || {
1016
1017
  overshoot: 1.2,
1017
1018
  bounces: 1
1018
- }, { overshoot: o, bounces: s } = i, r = this.generateScaleBounceKeyframes(s, o);
1019
- let a = e;
1019
+ }, { overshoot: o, bounces: a } = i, r = this.generateScaleBounceKeyframes(a, o);
1020
+ let s = e;
1020
1021
  for (let h = 0; h < r.length; h++)
1021
1022
  if (t <= r[h].time) {
1022
- 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);
1023
- a = u + (r[h].scale - u) * d;
1023
+ 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);
1024
+ s = d + (r[h].scale - d) * u;
1024
1025
  break;
1025
1026
  }
1026
- return a * e;
1027
+ return s * e;
1027
1028
  }
1028
1029
  /**
1029
1030
  * Generate keyframes for scale bounce animation
@@ -1032,11 +1033,11 @@ class ce {
1032
1033
  const i = [];
1033
1034
  i.push({ time: 0.5, scale: e });
1034
1035
  let o = e;
1035
- const s = 0.5, a = 0.5 / (t * 2);
1036
+ const a = 0.5, s = 0.5 / (t * 2);
1036
1037
  let h = 0.5;
1037
1038
  for (let c = 0; c < t; c++) {
1038
- const u = 1 - (o - 1) * s;
1039
- 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 });
1039
+ const d = 1 - (o - 1) * a;
1040
+ 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 });
1040
1041
  }
1041
1042
  return i.push({ time: 1, scale: 1 }), i;
1042
1043
  }
@@ -1047,7 +1048,7 @@ class ce {
1047
1048
  return 1 - (1 - t) * (1 - t);
1048
1049
  }
1049
1050
  }
1050
- class le {
1051
+ class he {
1051
1052
  constructor(t, e = {}) {
1052
1053
  this.config = t, this.imageConfig = e;
1053
1054
  }
@@ -1059,14 +1060,14 @@ class le {
1059
1060
  * @returns Array of layout objects with position, rotation, scale
1060
1061
  */
1061
1062
  generate(t, e, i = {}) {
1062
- 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, m = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || m !== 1, g = h * 1.5 / 2, f = h / 2, S = s - a - g, v = r - a - f, w = a + g, E = a + f;
1063
+ 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;
1063
1064
  for (let x = 0; x < t; x++) {
1064
- const A = this.random(w, S), L = this.random(E, v), z = c === "random" ? this.random(u, l) : 0, P = b ? this.random(d, m) : 1, _ = h * P, Y = {
1065
+ 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 = {
1065
1066
  id: x,
1066
- x: A,
1067
+ x: C,
1067
1068
  y: L,
1068
1069
  rotation: z,
1069
- scale: P,
1070
+ scale: U,
1070
1071
  baseSize: _
1071
1072
  };
1072
1073
  o.push(Y);
@@ -1083,7 +1084,7 @@ class le {
1083
1084
  return Math.random() * (e - t) + t;
1084
1085
  }
1085
1086
  }
1086
- class he {
1087
+ class de {
1087
1088
  constructor(t, e = {}) {
1088
1089
  this.config = t, this.imageConfig = e;
1089
1090
  }
@@ -1095,16 +1096,16 @@ class he {
1095
1096
  * @returns Array of layout objects with position, rotation, scale
1096
1097
  */
1097
1098
  generate(t, e, i = {}) {
1098
- 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, m = l !== 1 || d !== 1, b = this.config.scaleDecay ?? 0, p = i.fixedHeight ?? a, g = s / 2, f = r / 2, S = Math.ceil(Math.sqrt(t));
1099
+ 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));
1099
1100
  if (t > 0) {
1100
- const E = m ? this.random(l, d) : 1, x = p * E;
1101
+ const S = g ? this.random(l, u) : 1, x = y * S;
1101
1102
  o.push({
1102
1103
  id: 0,
1103
- x: g,
1104
- y: f,
1105
- rotation: h === "random" ? this.random(c * 0.33, u * 0.33) : 0,
1104
+ x: f,
1105
+ y: m,
1106
+ rotation: h === "random" ? this.random(c * 0.33, d * 0.33) : 0,
1106
1107
  // Less rotation for center
1107
- scale: E,
1108
+ scale: S,
1108
1109
  baseSize: x,
1109
1110
  zIndex: 100
1110
1111
  // Center image is highest
@@ -1112,22 +1113,22 @@ class he {
1112
1113
  }
1113
1114
  let v = 1, w = 1;
1114
1115
  for (; v < t; ) {
1115
- 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))), P = this.estimateWidth(p), _ = Math.floor(z / (P * 0.7));
1116
+ 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));
1116
1117
  if (_ === 0) {
1117
1118
  w++;
1118
1119
  continue;
1119
1120
  }
1120
1121
  const Y = 2 * Math.PI / _, N = w * (20 * Math.PI / 180);
1121
- for (let T = 0; T < _ && v < t; T++) {
1122
- const D = T * Y + N, k = m ? this.random(l, d) : 1, H = x * k, R = p * H;
1123
- let C = g + Math.cos(D) * L, O = f + Math.sin(D) * A;
1124
- const $ = this.config.spacing.padding ?? 50, U = R * 1.5 / 2, M = R / 2;
1125
- C - U < $ ? C = $ + U : C + U > s - $ && (C = s - $ - U), O - M < $ ? O = $ + M : O + M > r - $ && (O = r - $ - M);
1126
- const W = h === "random" ? this.random(c, u) : 0;
1122
+ for (let A = 0; A < _ && v < t; A++) {
1123
+ const $ = A * Y + N, k = g ? this.random(l, u) : 1, H = x * k, R = y * H;
1124
+ let T = f + Math.cos($) * L, D = m + Math.sin($) * C;
1125
+ const O = this.config.spacing.padding ?? 50, P = R * 1.5 / 2, M = R / 2;
1126
+ 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);
1127
+ const W = h === "random" ? this.random(c, d) : 0;
1127
1128
  o.push({
1128
1129
  id: v,
1129
- x: C,
1130
- y: O,
1130
+ x: T,
1131
+ y: D,
1131
1132
  rotation: W,
1132
1133
  scale: H,
1133
1134
  baseSize: R,
@@ -1158,7 +1159,7 @@ class he {
1158
1159
  return Math.random() * (e - t) + t;
1159
1160
  }
1160
1161
  }
1161
- const de = {
1162
+ const ue = {
1162
1163
  columns: "auto",
1163
1164
  rows: "auto",
1164
1165
  stagger: "none",
@@ -1168,7 +1169,7 @@ const de = {
1168
1169
  alignment: "center",
1169
1170
  gap: 10,
1170
1171
  overflowOffset: 0.25
1171
- }, It = [
1172
+ }, Ct = [
1172
1173
  { x: 1, y: 1 },
1173
1174
  // bottom-right
1174
1175
  { x: -1, y: -1 },
@@ -1186,7 +1187,7 @@ const de = {
1186
1187
  { x: 0, y: 1 }
1187
1188
  // down
1188
1189
  ];
1189
- class ue {
1190
+ class ge {
1190
1191
  constructor(t, e = {}) {
1191
1192
  this.config = t, this.imageConfig = e;
1192
1193
  }
@@ -1198,65 +1199,65 @@ class ue {
1198
1199
  * @returns Array of layout objects with position, rotation, scale
1199
1200
  */
1200
1201
  generate(t, e, i = {}) {
1201
- 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, m = l !== 1 || d !== 1, b = s - 2 * h, p = r - 2 * h, { columns: g, rows: f } = this.calculateGridDimensions(
1202
+ const o = [], { width: a, height: r } = e, s = { ...ue, ...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(
1202
1203
  t,
1203
- b,
1204
1204
  p,
1205
+ y,
1205
1206
  c,
1206
- a
1207
- ), S = a.stagger === "row", v = a.stagger === "column", w = S ? g + 0.5 : g, E = v ? f + 0.5 : f, x = (b - a.gap * (g - 1)) / w, A = (p - a.gap * (f - 1)) / E, L = S ? x / 2 : 0, z = v ? A / 2 : 0, P = 1 + a.overlap, _ = Math.min(x, A) * P, Y = i.fixedHeight ? Math.min(i.fixedHeight, _) : _, N = g * x + (g - 1) * a.gap + L, T = f * A + (f - 1) * a.gap + z, D = h + (b - N) / 2, k = h + (p - T) / 2, H = g * f, R = a.columns !== "auto" && a.rows !== "auto", C = R && t > H;
1207
+ s
1208
+ ), 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;
1208
1209
  typeof window < "u" && (window.__gridOverflowDebug = {
1209
- gridConfigColumns: a.columns,
1210
- gridConfigRows: a.rows,
1211
- columns: g,
1212
- rows: f,
1210
+ gridConfigColumns: s.columns,
1211
+ gridConfigRows: s.rows,
1212
+ columns: f,
1213
+ rows: m,
1213
1214
  cellCount: H,
1214
1215
  hasFixedGrid: R,
1215
1216
  imageCount: t,
1216
- isOverflowMode: C
1217
+ isOverflowMode: T
1217
1218
  });
1218
- const O = C ? new Array(H).fill(0) : [], $ = Math.min(x, A) * a.overflowOffset;
1219
+ const D = T ? new Array(H).fill(0) : [], O = Math.min(x, C) * s.overflowOffset;
1219
1220
  for (let F = 0; F < t; F++) {
1220
- let U, M, W = 0;
1221
- if (C && F >= H) {
1221
+ let P, M, W = 0;
1222
+ if (T && F >= H) {
1222
1223
  const q = F - H, j = q % H;
1223
- W = Math.floor(q / H) + 1, O[j]++, a.fillDirection === "row" ? (U = j % g, M = Math.floor(j / g)) : (M = j % f, U = Math.floor(j / f));
1224
+ 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));
1224
1225
  } else
1225
- a.fillDirection === "row" ? (U = F % g, M = Math.floor(F / g)) : (M = F % f, U = Math.floor(F / f));
1226
- let G = D + U * (x + a.gap) + x / 2, X = k + M * (A + a.gap) + A / 2;
1227
- if (a.stagger === "row" && M % 2 === 1 ? G += x / 2 : a.stagger === "column" && U % 2 === 1 && (X += A / 2), W > 0) {
1228
- const q = (W - 1) % It.length, j = It[q];
1229
- G += j.x * $, X += j.y * $;
1226
+ s.fillDirection === "row" ? (P = F % f, M = Math.floor(F / f)) : (M = F % m, P = Math.floor(F / m));
1227
+ let G = $ + P * (x + s.gap) + x / 2, X = k + M * (C + s.gap) + C / 2;
1228
+ if (s.stagger === "row" && M % 2 === 1 ? G += x / 2 : s.stagger === "column" && P % 2 === 1 && (X += C / 2), W > 0) {
1229
+ const q = (W - 1) % Ct.length, j = Ct[q];
1230
+ G += j.x * O, X += j.y * O;
1230
1231
  }
1231
- if (a.jitter > 0) {
1232
- const q = x / 2 * a.jitter, j = A / 2 * a.jitter;
1232
+ if (s.jitter > 0) {
1233
+ const q = x / 2 * s.jitter, j = C / 2 * s.jitter;
1233
1234
  G += this.random(-q, q), X += this.random(-j, j);
1234
1235
  }
1235
- let B = G, J = X;
1236
- if (!C && a.fillDirection === "row") {
1237
- const q = t % g || g;
1238
- if (M === Math.floor((t - 1) / g) && q < g) {
1239
- const vt = q * x + (q - 1) * a.gap;
1240
- let gt = 0;
1241
- a.alignment === "center" ? gt = (N - vt) / 2 : a.alignment === "end" && (gt = N - vt), B += gt;
1236
+ let B = G, V = X;
1237
+ if (!T && s.fillDirection === "row") {
1238
+ const q = t % f || f;
1239
+ if (M === Math.floor((t - 1) / f) && q < f) {
1240
+ const wt = q * x + (q - 1) * s.gap;
1241
+ let dt = 0;
1242
+ s.alignment === "center" ? dt = (N - wt) / 2 : s.alignment === "end" && (dt = N - wt), B += dt;
1242
1243
  }
1243
1244
  }
1244
- const rt = m ? this.random(l, d) : 1, K = Y * rt, it = K * 1.5 / 2, nt = K / 2, lt = h + it, ht = s - h - it, Ft = h + nt, Dt = r - h - nt;
1245
- B = Math.max(lt, Math.min(B, ht)), J = Math.max(Ft, Math.min(J, Dt));
1246
- let dt = 0;
1247
- if (u === "random") {
1245
+ 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;
1246
+ B = Math.max(rt, Math.min(B, ct)), V = Math.max($t, Math.min(V, Dt));
1247
+ let lt = 0;
1248
+ if (d === "random") {
1248
1249
  const q = this.imageConfig.rotation?.range?.min ?? -15, j = this.imageConfig.rotation?.range?.max ?? 15;
1249
- a.jitter > 0 ? dt = this.random(q * a.jitter, j * a.jitter) : dt = this.random(q, j);
1250
+ s.jitter > 0 ? lt = this.random(q * s.jitter, j * s.jitter) : lt = this.random(q, j);
1250
1251
  }
1251
- let ut;
1252
- C && W > 0 ? ut = 50 - W : ut = C ? 100 + F : F + 1, o.push({
1252
+ let ht;
1253
+ T && W > 0 ? ht = 50 - W : ht = T ? 100 + F : F + 1, o.push({
1253
1254
  id: F,
1254
1255
  x: B,
1255
- y: J,
1256
- rotation: dt,
1257
- scale: rt,
1256
+ y: V,
1257
+ rotation: lt,
1258
+ scale: st,
1258
1259
  baseSize: K,
1259
- zIndex: ut
1260
+ zIndex: ht
1260
1261
  });
1261
1262
  }
1262
1263
  return o;
@@ -1264,20 +1265,20 @@ class ue {
1264
1265
  /**
1265
1266
  * Calculate optimal grid dimensions based on image count and container
1266
1267
  */
1267
- calculateGridDimensions(t, e, i, o, s) {
1268
- let r, a;
1269
- if (s.columns !== "auto" && s.rows !== "auto")
1270
- r = s.columns, a = s.rows;
1271
- else if (s.columns !== "auto")
1272
- r = s.columns, a = Math.ceil(t / r);
1273
- else if (s.rows !== "auto")
1274
- a = s.rows, r = Math.ceil(t / a);
1268
+ calculateGridDimensions(t, e, i, o, a) {
1269
+ let r, s;
1270
+ if (a.columns !== "auto" && a.rows !== "auto")
1271
+ r = a.columns, s = a.rows;
1272
+ else if (a.columns !== "auto")
1273
+ r = a.columns, s = Math.ceil(t / r);
1274
+ else if (a.rows !== "auto")
1275
+ s = a.rows, r = Math.ceil(t / s);
1275
1276
  else {
1276
1277
  const h = e / i;
1277
- for (r = Math.max(1, Math.round(Math.sqrt(t * h / 1.4))), a = Math.ceil(t / r); r > 1 && (r - 1) * a >= t; )
1278
+ for (r = Math.max(1, Math.round(Math.sqrt(t * h / 1.4))), s = Math.ceil(t / r); r > 1 && (r - 1) * s >= t; )
1278
1279
  r--;
1279
1280
  }
1280
- return { columns: Math.max(1, r), rows: Math.max(1, a) };
1281
+ return { columns: Math.max(1, r), rows: Math.max(1, s) };
1281
1282
  }
1282
1283
  /**
1283
1284
  * Utility: Generate random number between min and max
@@ -1286,14 +1287,14 @@ class ue {
1286
1287
  return Math.random() * (e - t) + t;
1287
1288
  }
1288
1289
  }
1289
- const ge = Math.PI * (3 - Math.sqrt(5)), me = {
1290
+ const fe = Math.PI * (3 - Math.sqrt(5)), me = {
1290
1291
  spiralType: "golden",
1291
1292
  direction: "counterclockwise",
1292
1293
  tightness: 1,
1293
1294
  scaleDecay: 0,
1294
1295
  startAngle: 0
1295
1296
  };
1296
- class fe {
1297
+ class pe {
1297
1298
  constructor(t, e = {}) {
1298
1299
  this.config = t, this.imageConfig = e;
1299
1300
  }
@@ -1305,35 +1306,35 @@ class fe {
1305
1306
  * @returns Array of layout objects with position, rotation, scale
1306
1307
  */
1307
1308
  generate(t, e, i = {}) {
1308
- const o = [], { width: s, height: r } = e, a = { ...me, ...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, m = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = m !== 1 || b !== 1, g = this.config.scaleDecay ?? a.scaleDecay, f = s / 2, S = r / 2, v = Math.min(
1309
- f - h - c / 2,
1310
- S - h - c / 2
1311
- ), w = a.direction === "clockwise" ? -1 : 1;
1312
- for (let E = 0; E < t; E++) {
1313
- let x, A;
1314
- if (a.spiralType === "golden")
1315
- x = E * ge * w + a.startAngle, A = this.calculateGoldenRadius(E, t, v, a.tightness);
1316
- else if (a.spiralType === "archimedean") {
1317
- const G = E * 0.5 * a.tightness;
1318
- x = G * w + a.startAngle, A = this.calculateArchimedeanRadius(G, t, v, a.tightness);
1309
+ const o = [], { width: a, height: r } = e, s = { ...me, ...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(
1310
+ m - h - c / 2,
1311
+ E - h - c / 2
1312
+ ), w = s.direction === "clockwise" ? -1 : 1;
1313
+ for (let S = 0; S < t; S++) {
1314
+ let x, C;
1315
+ if (s.spiralType === "golden")
1316
+ x = S * fe * w + s.startAngle, C = this.calculateGoldenRadius(S, t, v, s.tightness);
1317
+ else if (s.spiralType === "archimedean") {
1318
+ const G = S * 0.5 * s.tightness;
1319
+ x = G * w + s.startAngle, C = this.calculateArchimedeanRadius(G, t, v, s.tightness);
1319
1320
  } else {
1320
- const G = E * 0.3 * a.tightness;
1321
- x = G * w + a.startAngle, A = this.calculateLogarithmicRadius(G, t, v, a.tightness);
1321
+ const G = S * 0.3 * s.tightness;
1322
+ x = G * w + s.startAngle, C = this.calculateLogarithmicRadius(G, t, v, s.tightness);
1322
1323
  }
1323
- const L = f + Math.cos(x) * A, z = S + Math.sin(x) * A, P = A / v, _ = g > 0 ? 1 - P * g * 0.5 : 1, Y = p ? this.random(m, 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)), U = Math.max(O, Math.min(z, $));
1324
+ 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));
1324
1325
  let M = 0;
1325
- if (u === "random") {
1326
- const G = x * 180 / Math.PI % 360, X = this.random(l, d);
1327
- M = a.spiralType === "golden" ? X : G * 0.1 + X * 0.9;
1328
- } else u === "tangent" && (M = this.calculateSpiralTangent(x, A, a));
1329
- const W = t - E;
1326
+ if (d === "random") {
1327
+ const G = x * 180 / Math.PI % 360, X = this.random(l, u);
1328
+ M = s.spiralType === "golden" ? X : G * 0.1 + X * 0.9;
1329
+ } else d === "tangent" && (M = this.calculateSpiralTangent(x, C, s));
1330
+ const W = t - S;
1330
1331
  o.push({
1331
- id: E,
1332
+ id: S,
1332
1333
  x: F,
1333
- y: U,
1334
+ y: P,
1334
1335
  rotation: M,
1335
1336
  scale: N,
1336
- baseSize: T,
1337
+ baseSize: A,
1337
1338
  zIndex: W
1338
1339
  });
1339
1340
  }
@@ -1348,11 +1349,11 @@ class fe {
1348
1349
  if (i.spiralType === "golden")
1349
1350
  o = t + Math.PI / 2;
1350
1351
  else if (i.spiralType === "archimedean") {
1351
- const r = 1 / i.tightness, a = Math.atan(e / r);
1352
- o = t + a;
1352
+ const r = 1 / i.tightness, s = Math.atan(e / r);
1353
+ o = t + s;
1353
1354
  } else {
1354
- const r = 0.15 / i.tightness, a = Math.atan(1 / r);
1355
- o = t + a;
1355
+ const r = 0.15 / i.tightness, s = Math.atan(1 / r);
1356
+ o = t + s;
1356
1357
  }
1357
1358
  return o * 180 / Math.PI % 360 - 90;
1358
1359
  }
@@ -1369,16 +1370,16 @@ class fe {
1369
1370
  * r = a + b*θ (constant spacing between arms)
1370
1371
  */
1371
1372
  calculateArchimedeanRadius(t, e, i, o) {
1372
- const s = e * 0.5 * o;
1373
- return t / s * i;
1373
+ const a = e * 0.5 * o;
1374
+ return t / a * i;
1374
1375
  }
1375
1376
  /**
1376
1377
  * Calculate radius for logarithmic (equiangular) spiral
1377
1378
  * r = a * e^(b*θ)
1378
1379
  */
1379
1380
  calculateLogarithmicRadius(t, e, i, o) {
1380
- 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);
1381
- return a / c * i;
1381
+ 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);
1382
+ return s / c * i;
1382
1383
  }
1383
1384
  /**
1384
1385
  * Utility: Generate random number between min and max
@@ -1387,7 +1388,7 @@ class fe {
1387
1388
  return Math.random() * (e - t) + t;
1388
1389
  }
1389
1390
  }
1390
- const pe = {
1391
+ const ye = {
1391
1392
  clusterCount: "auto",
1392
1393
  clusterSpread: 150,
1393
1394
  clusterSpacing: 200,
@@ -1407,47 +1408,47 @@ class be {
1407
1408
  * @returns Array of layout objects with position, rotation, scale
1408
1409
  */
1409
1410
  generate(t, e, i = {}) {
1410
- 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, m = this.imageConfig.sizing?.variance?.min ?? 1, b = this.imageConfig.sizing?.variance?.max ?? 1, p = m !== 1 || b !== 1, g = this.calculateClusterCount(
1411
+ const o = [], { width: a, height: r } = e, s = { ...ye, ...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(
1411
1412
  t,
1412
- a.clusterCount,
1413
- s,
1413
+ s.clusterCount,
1414
+ a,
1414
1415
  r,
1415
- a.clusterSpacing
1416
- ), f = this.generateClusterCenters(
1417
- g,
1418
- s,
1416
+ s.clusterSpacing
1417
+ ), m = this.generateClusterCenters(
1418
+ f,
1419
+ a,
1419
1420
  r,
1420
1421
  h,
1421
- a
1422
- ), S = new Array(g).fill(0);
1422
+ s
1423
+ ), E = new Array(f).fill(0);
1423
1424
  for (let w = 0; w < t; w++)
1424
- S[w % g]++;
1425
+ E[w % f]++;
1425
1426
  let v = 0;
1426
- for (let w = 0; w < g; w++) {
1427
- const E = f[w], x = S[w];
1428
- for (let A = 0; A < x; A++) {
1427
+ for (let w = 0; w < f; w++) {
1428
+ const S = m[w], x = E[w];
1429
+ for (let C = 0; C < x; C++) {
1429
1430
  let L, z;
1430
- if (a.distribution === "gaussian")
1431
- L = this.gaussianRandom() * E.spread, z = this.gaussianRandom() * E.spread;
1431
+ if (s.distribution === "gaussian")
1432
+ L = this.gaussianRandom() * S.spread, z = this.gaussianRandom() * S.spread;
1432
1433
  else {
1433
- const M = this.random(0, Math.PI * 2), W = this.random(0, E.spread);
1434
+ const M = this.random(0, Math.PI * 2), W = this.random(0, S.spread);
1434
1435
  L = Math.cos(M) * W, z = Math.sin(M) * W;
1435
1436
  }
1436
- const P = 1 + a.overlap * 0.5, _ = 1 + a.overlap * 0.3;
1437
- L /= P, z /= P;
1438
- const Y = p ? this.random(m, b) : 1, N = _ * Y, T = c * N;
1439
- let D = E.x + L, k = E.y + z;
1440
- const R = T * 1.5 / 2, C = T / 2;
1441
- D = Math.max(h + R, Math.min(D, s - h - R)), k = Math.max(h + C, Math.min(k, r - h - C));
1442
- const O = u === "random" ? this.random(l, d) : 0, F = Math.sqrt(L * L + z * z) / E.spread, U = Math.round((1 - F) * 50) + 1;
1437
+ const U = 1 + s.overlap * 0.5, _ = 1 + s.overlap * 0.3;
1438
+ L /= U, z /= U;
1439
+ const Y = y ? this.random(g, p) : 1, N = _ * Y, A = c * N;
1440
+ let $ = S.x + L, k = S.y + z;
1441
+ const R = A * 1.5 / 2, T = A / 2;
1442
+ $ = Math.max(h + R, Math.min($, a - h - R)), k = Math.max(h + T, Math.min(k, r - h - T));
1443
+ 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;
1443
1444
  o.push({
1444
1445
  id: v,
1445
- x: D,
1446
+ x: $,
1446
1447
  y: k,
1447
- rotation: O,
1448
+ rotation: D,
1448
1449
  scale: N,
1449
- baseSize: T,
1450
- zIndex: U
1450
+ baseSize: A,
1451
+ zIndex: P
1451
1452
  }), v++;
1452
1453
  }
1453
1454
  }
@@ -1456,36 +1457,36 @@ class be {
1456
1457
  /**
1457
1458
  * Calculate optimal number of clusters based on image count and container
1458
1459
  */
1459
- calculateClusterCount(t, e, i, o, s) {
1460
+ calculateClusterCount(t, e, i, o, a) {
1460
1461
  if (e !== "auto")
1461
1462
  return Math.max(1, Math.min(e, t));
1462
- const a = Math.max(1, Math.ceil(t / 8)), h = Math.floor(
1463
- i / s * (o / s) * 0.6
1463
+ const s = Math.max(1, Math.ceil(t / 8)), h = Math.floor(
1464
+ i / a * (o / a) * 0.6
1464
1465
  );
1465
- return Math.max(1, Math.min(a, h, 10));
1466
+ return Math.max(1, Math.min(s, h, 10));
1466
1467
  }
1467
1468
  /**
1468
1469
  * Generate cluster center positions with spacing constraints
1469
1470
  */
1470
- generateClusterCenters(t, e, i, o, s) {
1471
- const r = [], h = o + s.clusterSpread, c = e - o - s.clusterSpread, u = o + s.clusterSpread, l = i - o - s.clusterSpread;
1472
- for (let d = 0; d < t; d++) {
1473
- let m = null, b = -1;
1474
- for (let p = 0; p < 100; p++) {
1475
- const g = {
1471
+ generateClusterCenters(t, e, i, o, a) {
1472
+ const r = [], h = o + a.clusterSpread, c = e - o - a.clusterSpread, d = o + a.clusterSpread, l = i - o - a.clusterSpread;
1473
+ for (let u = 0; u < t; u++) {
1474
+ let g = null, p = -1;
1475
+ for (let y = 0; y < 100; y++) {
1476
+ const f = {
1476
1477
  x: this.random(h, c),
1477
- y: this.random(u, l),
1478
- spread: this.calculateClusterSpread(s)
1478
+ y: this.random(d, l),
1479
+ spread: this.calculateClusterSpread(a)
1479
1480
  };
1480
- let f = 1 / 0;
1481
- for (const S of r) {
1482
- const v = g.x - S.x, w = g.y - S.y, E = Math.sqrt(v * v + w * w);
1483
- f = Math.min(f, E);
1481
+ let m = 1 / 0;
1482
+ for (const E of r) {
1483
+ const v = f.x - E.x, w = f.y - E.y, S = Math.sqrt(v * v + w * w);
1484
+ m = Math.min(m, S);
1484
1485
  }
1485
- if ((r.length === 0 || f > b) && (m = g, b = f), f >= s.clusterSpacing)
1486
+ if ((r.length === 0 || m > p) && (g = f, p = m), m >= a.clusterSpacing)
1486
1487
  break;
1487
1488
  }
1488
- m && r.push(m);
1489
+ g && r.push(g);
1489
1490
  }
1490
1491
  return r;
1491
1492
  }
@@ -1513,7 +1514,7 @@ class be {
1513
1514
  return Math.random() * (e - t) + t;
1514
1515
  }
1515
1516
  }
1516
- class ye {
1517
+ class ve {
1517
1518
  constructor(t, e = {}) {
1518
1519
  this.config = t, this.imageConfig = e;
1519
1520
  }
@@ -1525,25 +1526,25 @@ class ye {
1525
1526
  * @returns Array of layout objects with position, rotation, scale
1526
1527
  */
1527
1528
  generate(t, e, i = {}) {
1528
- 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, m = this.imageConfig.sizing?.variance?.max ?? 1, b = d !== 1 || m !== 1, p = i.fixedHeight ?? a, g = {
1529
- ...Ht,
1529
+ 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 = {
1530
+ ...Nt,
1530
1531
  ...this.config.wave
1531
- }, { rows: f, amplitude: S, frequency: v, phaseShift: w, synchronization: E } = g, x = Math.ceil(t / f), z = p * 1.5 / 2, P = h + z, _ = s - h - z, Y = _ - P, N = x > 1 ? Y / (x - 1) : 0, T = h + S + p / 2, D = r - h - S - p / 2, k = D - T, H = f > 1 ? k / (f - 1) : 0;
1532
+ }, { 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;
1532
1533
  let R = 0;
1533
- for (let C = 0; C < f && R < t; C++) {
1534
- const O = f === 1 ? (T + D) / 2 : T + C * H;
1535
- let $ = 0;
1536
- E === "offset" ? $ = C * w : E === "alternating" && ($ = C * Math.PI);
1534
+ for (let T = 0; T < m && R < t; T++) {
1535
+ const D = m === 1 ? (A + $) / 2 : A + T * H;
1536
+ let O = 0;
1537
+ S === "offset" ? O = T * w : S === "alternating" && (O = T * Math.PI);
1537
1538
  for (let F = 0; F < x && R < t; F++) {
1538
- const U = x === 1 ? (P + _) / 2 : P + F * N, M = this.calculateWaveY(U, s, S, v, $), W = U, G = O + M, X = b ? this.random(d, m) : 1, B = p * X;
1539
- let J = 0;
1540
- c === "tangent" ? J = this.calculateRotation(U, s, S, v, $) : c === "random" && (J = this.random(u, l));
1541
- const K = B * 1.5 / 2, ct = B / 2, it = h + K, nt = s - h - K, lt = h + ct, ht = r - h - ct;
1539
+ 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;
1540
+ let V = 0;
1541
+ c === "tangent" ? V = this.calculateRotation(P, a, E, v, O) : c === "random" && (V = this.random(d, l));
1542
+ const K = B * 1.5 / 2, at = B / 2, tt = h + K, et = a - h - K, rt = h + at, ct = r - h - at;
1542
1543
  o.push({
1543
1544
  id: R,
1544
- x: Math.max(it, Math.min(W, nt)),
1545
- y: Math.max(lt, Math.min(G, ht)),
1546
- rotation: J,
1545
+ x: Math.max(tt, Math.min(W, et)),
1546
+ y: Math.max(rt, Math.min(G, ct)),
1547
+ rotation: V,
1547
1548
  scale: X,
1548
1549
  baseSize: B,
1549
1550
  zIndex: R + 1
@@ -1561,9 +1562,9 @@ class ye {
1561
1562
  * @param phase - Phase offset
1562
1563
  * @returns Y displacement from baseline
1563
1564
  */
1564
- calculateWaveY(t, e, i, o, s) {
1565
+ calculateWaveY(t, e, i, o, a) {
1565
1566
  const r = t / e;
1566
- return i * Math.sin(o * r * 2 * Math.PI + s);
1567
+ return i * Math.sin(o * r * 2 * Math.PI + a);
1567
1568
  }
1568
1569
  /**
1569
1570
  * Calculate rotation based on wave tangent
@@ -1574,9 +1575,9 @@ class ye {
1574
1575
  * @param phase - Phase offset
1575
1576
  * @returns Rotation angle in degrees
1576
1577
  */
1577
- calculateRotation(t, e, i, o, s) {
1578
- const r = t / e, a = i * o * 2 * Math.PI * Math.cos(o * r * 2 * Math.PI + s) / e;
1579
- return Math.atan(a) * (180 / Math.PI);
1578
+ calculateRotation(t, e, i, o, a) {
1579
+ const r = t / e, s = i * o * 2 * Math.PI * Math.cos(o * r * 2 * Math.PI + a) / e;
1580
+ return Math.atan(s) * (180 / Math.PI);
1580
1581
  }
1581
1582
  /**
1582
1583
  * Estimate image width based on height
@@ -1590,7 +1591,7 @@ class ye {
1590
1591
  return Math.random() * (e - t) + t;
1591
1592
  }
1592
1593
  }
1593
- class ve {
1594
+ class we {
1594
1595
  constructor(t) {
1595
1596
  this.config = t.layout, this.imageConfig = t.image, this.layouts = /* @__PURE__ */ new Map(), this.placementLayout = this.initLayout();
1596
1597
  }
@@ -1601,17 +1602,17 @@ class ve {
1601
1602
  initLayout() {
1602
1603
  switch (this.config.algorithm) {
1603
1604
  case "radial":
1604
- return new he(this.config, this.imageConfig);
1605
+ return new de(this.config, this.imageConfig);
1605
1606
  case "grid":
1606
- return new ue(this.config, this.imageConfig);
1607
+ return new ge(this.config, this.imageConfig);
1607
1608
  case "spiral":
1608
- return new fe(this.config, this.imageConfig);
1609
+ return new pe(this.config, this.imageConfig);
1609
1610
  case "cluster":
1610
1611
  return new be(this.config, this.imageConfig);
1611
1612
  case "wave":
1612
- return new ye(this.config, this.imageConfig);
1613
+ return new ve(this.config, this.imageConfig);
1613
1614
  default:
1614
- return new le(this.config, this.imageConfig);
1615
+ return new he(this.config, this.imageConfig);
1615
1616
  }
1616
1617
  }
1617
1618
  /**
@@ -1623,8 +1624,8 @@ class ve {
1623
1624
  */
1624
1625
  generateLayout(t, e, i = {}) {
1625
1626
  const o = this.placementLayout.generate(t, e, i);
1626
- return o.forEach((s) => {
1627
- this.layouts.set(s.id, s);
1627
+ return o.forEach((a) => {
1628
+ this.layouts.set(a.id, a);
1628
1629
  }), o;
1629
1630
  }
1630
1631
  /**
@@ -1678,8 +1679,8 @@ class ve {
1678
1679
  return;
1679
1680
  if (typeof i == "number")
1680
1681
  return i;
1681
- const o = i, s = this.resolveBreakpoint(t);
1682
- return s === "mobile" ? o.mobile ?? o.tablet ?? o.screen : s === "tablet" ? o.tablet ?? o.screen ?? o.mobile : o.screen ?? o.tablet ?? o.mobile;
1682
+ const o = i, a = this.resolveBreakpoint(t);
1683
+ return a === "mobile" ? o.mobile ?? o.tablet ?? o.screen : a === "tablet" ? o.tablet ?? o.screen ?? o.mobile : o.screen ?? o.tablet ?? o.mobile;
1683
1684
  }
1684
1685
  /**
1685
1686
  * Calculate adaptive image size based on container dimensions and image count
@@ -1690,18 +1691,18 @@ class ve {
1690
1691
  * @returns Calculated sizing result with height
1691
1692
  */
1692
1693
  calculateAdaptiveSize(t, e, i, o) {
1693
- const s = this.imageConfig.sizing, r = this.resolveBaseHeight(o);
1694
+ const a = this.imageConfig.sizing, r = this.resolveBaseHeight(o);
1694
1695
  if (r !== void 0)
1695
1696
  return { height: r };
1696
- 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;
1697
- let f = Math.sqrt(p / 1.4);
1698
- f *= u, f = Math.min(f, i);
1699
- let S = this.clamp(f, a, h);
1700
- if (S === a && f < a) {
1701
- const v = Math.max(a * 0.05, 20);
1702
- S = Math.max(v, f);
1697
+ 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;
1698
+ let m = Math.sqrt(y / 1.4);
1699
+ m *= d, m = Math.min(m, i);
1700
+ let E = this.clamp(m, s, h);
1701
+ if (E === s && m < s) {
1702
+ const v = Math.max(s * 0.05, 20);
1703
+ E = Math.max(v, m);
1703
1704
  }
1704
- return { height: S };
1705
+ return { height: E };
1705
1706
  }
1706
1707
  /**
1707
1708
  * Utility: Clamp a value between min and max
@@ -1711,13 +1712,76 @@ class ve {
1711
1712
  }
1712
1713
  }
1713
1714
  var I = /* @__PURE__ */ ((n) => (n.IDLE = "idle", n.FOCUSING = "focusing", n.FOCUSED = "focused", n.UNFOCUSING = "unfocusing", n.CROSS_ANIMATING = "cross_animating", n))(I || {});
1714
- function we(n) {
1715
- return n in mt;
1715
+ const At = {
1716
+ // Geometric shapes - uses percentages for responsive sizing
1717
+ circle: "circle(50%)",
1718
+ square: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)",
1719
+ triangle: "polygon(50% 0%, 100% 100%, 0% 100%)",
1720
+ pentagon: "polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)",
1721
+ hexagon: "polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)",
1722
+ octagon: "polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)",
1723
+ diamond: "polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)"
1724
+ }, xe = {
1725
+ // Circle - uses radius in pixels (refHeight of 100px = 50px radius)
1726
+ circle: {
1727
+ refHeight: 100,
1728
+ points: []
1729
+ // Special case: handled separately
1730
+ },
1731
+ // Square - maintains perfect aspect ratio (always 1:1)
1732
+ square: {
1733
+ refHeight: 100,
1734
+ points: [[0, 0], [100, 0], [100, 100], [0, 100]]
1735
+ },
1736
+ // Triangle - isosceles triangle
1737
+ triangle: {
1738
+ refHeight: 100,
1739
+ points: [[50, 0], [100, 100], [0, 100]]
1740
+ },
1741
+ // Pentagon - regular pentagon
1742
+ pentagon: {
1743
+ refHeight: 100,
1744
+ points: [[50, 0], [100, 38], [82, 100], [18, 100], [0, 38]]
1745
+ },
1746
+ // Hexagon - regular hexagon
1747
+ hexagon: {
1748
+ refHeight: 100,
1749
+ points: [[25, 0], [75, 0], [100, 50], [75, 100], [25, 100], [0, 50]]
1750
+ },
1751
+ // Octagon - regular octagon
1752
+ octagon: {
1753
+ refHeight: 100,
1754
+ points: [[30, 0], [70, 0], [100, 30], [100, 70], [70, 100], [30, 100], [0, 70], [0, 30]]
1755
+ },
1756
+ // Diamond - 45-degree rotated square
1757
+ diamond: {
1758
+ refHeight: 100,
1759
+ points: [[50, 0], [100, 50], [50, 100], [0, 50]]
1760
+ }
1761
+ };
1762
+ function Ee(n) {
1763
+ if (n)
1764
+ return n in At ? At[n] : n;
1716
1765
  }
1717
- function xe(n) {
1718
- return n ? we(n) ? mt[n] : n : mt.md;
1766
+ function Se(n, t, e) {
1767
+ const i = xe[n];
1768
+ if (!i) return "";
1769
+ const o = t / i.refHeight;
1770
+ if (n === "circle")
1771
+ return `circle(${Math.round(50 * o * 100) / 100}px)`;
1772
+ const a = i.refHeight * o, r = a / 2, s = a / 2, h = (e ?? a) / 2, c = t / 2, d = h - r, l = c - s;
1773
+ return `polygon(${i.points.map(([g, p]) => {
1774
+ const y = Math.round((g * o + d) * 100) / 100, f = Math.round((p * o + l) * 100) / 100;
1775
+ return `${y}px ${f}px`;
1776
+ }).join(", ")})`;
1719
1777
  }
1720
- function Se(n) {
1778
+ function Ie(n) {
1779
+ return n in gt;
1780
+ }
1781
+ function Ce(n) {
1782
+ return n ? Ie(n) ? gt[n] : n : gt.md;
1783
+ }
1784
+ function Ae(n) {
1721
1785
  if (!n) return "";
1722
1786
  const t = [];
1723
1787
  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)
@@ -1735,50 +1799,65 @@ function Q(n) {
1735
1799
  const t = n.width ?? 0, e = n.style ?? "solid", i = n.color ?? "#000000";
1736
1800
  return `${t}px ${e} ${i}`;
1737
1801
  }
1738
- function st(n) {
1802
+ function vt(n, t, e) {
1739
1803
  if (!n) return {};
1740
- const t = {};
1804
+ const i = {};
1741
1805
  if (n.borderRadiusTopLeft !== void 0 || n.borderRadiusTopRight !== void 0 || n.borderRadiusBottomRight !== void 0 || n.borderRadiusBottomLeft !== void 0) {
1742
1806
  const s = n.border?.radius ?? 0;
1743
- 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`);
1744
- } else n.border?.radius !== void 0 && (t.borderRadius = `${n.border.radius}px`);
1807
+ 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`);
1808
+ } else n.border?.radius !== void 0 && (i.borderRadius = `${n.border.radius}px`);
1745
1809
  if (n.borderTop || n.borderRight || n.borderBottom || n.borderLeft) {
1746
- const s = n.border || {}, r = { ...s, ...n.borderTop }, a = { ...s, ...n.borderRight }, h = { ...s, ...n.borderBottom }, c = { ...s, ...n.borderLeft };
1747
- t.borderTop = Q(r), t.borderRight = Q(a), t.borderBottom = Q(h), t.borderLeft = Q(c);
1748
- } else n.border && (t.border = Q(n.border));
1749
- n.shadow !== void 0 && (t.boxShadow = xe(n.shadow));
1750
- const o = Se(n.filter);
1751
- 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) {
1752
- const s = n.outline.width ?? 0, r = n.outline.style ?? "solid", a = n.outline.color ?? "#000000";
1753
- t.outline = `${s}px ${r} ${a}`, n.outline.offset !== void 0 && (t.outlineOffset = `${n.outline.offset}px`);
1754
- }
1755
- return n.objectFit !== void 0 && (t.objectFit = n.objectFit), n.aspectRatio !== void 0 && (t.aspectRatio = n.aspectRatio), t;
1810
+ const s = n.border || {}, h = { ...s, ...n.borderTop }, c = { ...s, ...n.borderRight }, d = { ...s, ...n.borderBottom }, l = { ...s, ...n.borderLeft };
1811
+ i.borderTop = Q(h), i.borderRight = Q(c), i.borderBottom = Q(d), i.borderLeft = Q(l);
1812
+ } else n.border && (i.border = Q(n.border));
1813
+ n.shadow !== void 0 && (i.boxShadow = Ce(n.shadow));
1814
+ const r = Ae(n.filter);
1815
+ 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) {
1816
+ const s = n.outline.width ?? 0, h = n.outline.style ?? "solid", c = n.outline.color ?? "#000000";
1817
+ i.outline = `${s}px ${h} ${c}`, n.outline.offset !== void 0 && (i.outlineOffset = `${n.outline.offset}px`);
1818
+ }
1819
+ if (n.objectFit !== void 0 && (i.objectFit = n.objectFit), n.aspectRatio !== void 0 && (i.aspectRatio = n.aspectRatio), n.clipPath !== void 0) {
1820
+ let s;
1821
+ const h = typeof n.clipPath == "object" && n.clipPath !== null && "shape" in n.clipPath, c = h ? n.clipPath : void 0;
1822
+ if (c?.mode === "height-relative" && t)
1823
+ s = Se(c.shape, t, e);
1824
+ else {
1825
+ const d = h && c ? c.shape : n.clipPath;
1826
+ s = Ee(d);
1827
+ }
1828
+ s && (s === "none" ? i.clipPath = "unset" : (i.clipPath = s, i.overflow = "hidden"));
1829
+ }
1830
+ return i;
1831
+ }
1832
+ function Te(n, t) {
1833
+ 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);
1756
1834
  }
1757
- function tt(n, t) {
1758
- 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);
1835
+ function ut(n, t, e, i) {
1836
+ const o = vt(t, e, i);
1837
+ Te(n, o);
1759
1838
  }
1760
- function Lt(n) {
1839
+ function Ft(n) {
1761
1840
  return n ? Array.isArray(n) ? n.join(" ") : n : "";
1762
1841
  }
1763
- function et(n, t) {
1764
- const e = Lt(t);
1842
+ function nt(n, t) {
1843
+ const e = Ft(t);
1765
1844
  e && e.split(" ").forEach((i) => {
1766
1845
  i.trim() && n.classList.add(i.trim());
1767
1846
  });
1768
1847
  }
1769
- function zt(n, t) {
1770
- const e = Lt(t);
1848
+ function ft(n, t) {
1849
+ const e = Ft(t);
1771
1850
  e && e.split(" ").forEach((i) => {
1772
1851
  i.trim() && n.classList.remove(i.trim());
1773
1852
  });
1774
1853
  }
1775
- const At = {
1854
+ const Tt = {
1776
1855
  UNFOCUSING: 999,
1777
1856
  FOCUSING: 1e3
1778
1857
  };
1779
- class Ee {
1858
+ class Re {
1780
1859
  constructor(t, e, i) {
1781
- 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;
1860
+ 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;
1782
1861
  }
1783
1862
  /**
1784
1863
  * Get current state machine state
@@ -1803,19 +1882,19 @@ class Ee {
1803
1882
  * Returns actual pixel dimensions instead of scale factor for sharper rendering
1804
1883
  */
1805
1884
  calculateFocusDimensions(t, e, i) {
1806
- const o = this.normalizeScalePercent(this.config.scalePercent), s = i.height * o, r = t / e;
1807
- let a = s, h = a * r;
1885
+ const o = this.normalizeScalePercent(this.config.scalePercent), a = i.height * o, r = t / e;
1886
+ let s = a, h = s * r;
1808
1887
  const c = i.width * o;
1809
- return h > c && (h = c, a = h / r), { width: h, height: a };
1888
+ return h > c && (h = c, s = h / r), { width: h, height: s };
1810
1889
  }
1811
1890
  /**
1812
1891
  * Calculate the transform needed to center an image (position only, no scale)
1813
1892
  * Scale is handled by animating actual dimensions for sharper rendering
1814
1893
  */
1815
1894
  calculateFocusTransform(t, e) {
1816
- const i = t.width / 2, o = t.height / 2, s = i - e.x, r = o - e.y;
1895
+ const i = t.width / 2, o = t.height / 2, a = i - e.x, r = o - e.y;
1817
1896
  return {
1818
- x: s,
1897
+ x: a,
1819
1898
  y: r,
1820
1899
  rotation: 0,
1821
1900
  scale: 1
@@ -1837,19 +1916,19 @@ class Ee {
1837
1916
  * Create a Web Animation that animates both transform (position) and dimensions
1838
1917
  * This provides sharper zoom by re-rendering at target size instead of scaling pixels
1839
1918
  */
1840
- animateWithDimensions(t, e, i, o, s, r, a, h) {
1841
- const c = this.buildDimensionZoomTransform(e), u = this.buildDimensionZoomTransform(i);
1919
+ animateWithDimensions(t, e, i, o, a, r, s, h) {
1920
+ const c = this.buildDimensionZoomTransform(e), d = this.buildDimensionZoomTransform(i);
1842
1921
  return t.style.transition = "none", t.animate(
1843
1922
  [
1844
1923
  {
1845
1924
  transform: c,
1846
1925
  width: `${o}px`,
1847
- height: `${s}px`
1926
+ height: `${a}px`
1848
1927
  },
1849
1928
  {
1850
- transform: u,
1929
+ transform: d,
1851
1930
  width: `${r}px`,
1852
- height: `${a}px`
1931
+ height: `${s}px`
1853
1932
  }
1854
1933
  ],
1855
1934
  {
@@ -1861,15 +1940,30 @@ class Ee {
1861
1940
  }
1862
1941
  /**
1863
1942
  * Apply focused styling to an element
1943
+ * Applies non-clip-path styles immediately, clip-path will be updated during animation via startClipPathAnimation
1864
1944
  */
1865
1945
  applyFocusedStyling(t, e) {
1866
- t.style.zIndex = String(e), t.classList.add("fbn-ic-focused"), tt(t, this.focusedStyles), et(t, this.focusedClassName);
1946
+ t.style.zIndex = String(e), t.classList.add("fbn-ic-focused"), nt(t, this.focusedClassName);
1867
1947
  }
1868
1948
  /**
1869
1949
  * Remove focused styling from an element
1950
+ * Removes classes and z-index, clip-path will be updated during animation via startClipPathAnimation
1870
1951
  */
1871
1952
  removeFocusedStyling(t, e) {
1872
- t.style.zIndex = e, t.classList.remove("fbn-ic-focused"), zt(t, this.focusedClassName), tt(t, this.defaultStyles), et(t, this.defaultClassName);
1953
+ t.style.zIndex = e, t.classList.remove("fbn-ic-focused"), ft(t, this.focusedClassName);
1954
+ }
1955
+ /**
1956
+ * Continuously update clip-path during animation based on current element dimensions
1957
+ * This ensures clip-path changes smoothly as width/height animate
1958
+ */
1959
+ startClipPathAnimation(t, e, i) {
1960
+ let o = i ? this.styling?.focused ?? this.styling?.default : this.styling?.default;
1961
+ i && this.styling?.focused && this.styling.focused.clipPath === void 0 && (o = { ...o, clipPath: void 0 });
1962
+ const a = () => {
1963
+ const r = t.offsetHeight, s = t.offsetWidth, h = vt(o, r, s);
1964
+ 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);
1965
+ };
1966
+ requestAnimationFrame(a);
1873
1967
  }
1874
1968
  /**
1875
1969
  * Start focus animation for an image using dimension-based zoom
@@ -1877,48 +1971,50 @@ class Ee {
1877
1971
  * @param fromTransform - Optional starting transform (for mid-animation reversals)
1878
1972
  * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
1879
1973
  */
1880
- startFocusAnimation(t, e, i, o, s) {
1881
- const r = t.style.zIndex || "", a = t.offsetWidth, h = t.offsetHeight, c = this.calculateFocusDimensions(a, h, e), u = this.calculateFocusTransform(e, i);
1882
- this.applyFocusedStyling(t, At.FOCUSING), this.animationEngine.cancelAllAnimations(t);
1883
- const l = o ?? {
1974
+ startFocusAnimation(t, e, i, o, a) {
1975
+ const r = t.style.zIndex || "", s = t.offsetWidth, h = t.offsetHeight, c = this.calculateFocusDimensions(s, h, e), d = this.calculateFocusTransform(e, i);
1976
+ this.animationEngine.cancelAllAnimations(t);
1977
+ const l = this.config.animationDuration ?? 600;
1978
+ this.applyFocusedStyling(t, Tt.FOCUSING);
1979
+ const u = o ?? {
1884
1980
  x: 0,
1885
1981
  y: 0,
1886
1982
  rotation: i.rotation,
1887
1983
  scale: 1
1888
1984
  // No scale - using dimensions
1889
- }, d = s?.width ?? a, m = s?.height ?? h, b = this.config.animationDuration ?? 600, p = this.animateWithDimensions(
1985
+ }, g = a?.width ?? s, p = a?.height ?? h, y = this.animateWithDimensions(
1890
1986
  t,
1891
- l,
1892
1987
  u,
1893
1988
  d,
1894
- m,
1989
+ g,
1990
+ p,
1895
1991
  c.width,
1896
1992
  c.height,
1897
- b
1898
- ), g = {
1993
+ l
1994
+ ), f = {
1899
1995
  id: `focus-${Date.now()}`,
1900
1996
  element: t,
1901
- animation: p,
1902
- fromState: l,
1903
- toState: u,
1997
+ animation: y,
1998
+ fromState: u,
1999
+ toState: d,
1904
2000
  startTime: performance.now(),
1905
- duration: b
2001
+ duration: l
1906
2002
  };
1907
2003
  return this.focusData = {
1908
2004
  element: t,
1909
2005
  originalState: i,
1910
- focusTransform: u,
2006
+ focusTransform: d,
1911
2007
  originalZIndex: r,
1912
- originalWidth: a,
2008
+ originalWidth: s,
1913
2009
  originalHeight: h,
1914
2010
  focusWidth: c.width,
1915
2011
  focusHeight: c.height
1916
- }, {
2012
+ }, this.startClipPathAnimation(t, f, !0), {
1917
2013
  element: t,
1918
2014
  originalState: i,
1919
- animationHandle: g,
2015
+ animationHandle: f,
1920
2016
  direction: "in",
1921
- originalWidth: a,
2017
+ originalWidth: s,
1922
2018
  originalHeight: h
1923
2019
  };
1924
2020
  }
@@ -1928,38 +2024,40 @@ class Ee {
1928
2024
  * @param fromDimensions - Optional starting dimensions (for mid-animation reversals)
1929
2025
  */
1930
2026
  startUnfocusAnimation(t, e, i, o) {
1931
- t.style.zIndex = String(At.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
1932
- 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 = {
2027
+ t.style.zIndex = String(Tt.UNFOCUSING), this.animationEngine.cancelAllAnimations(t);
2028
+ const a = this.config.animationDuration ?? 600;
2029
+ t.classList.remove("fbn-ic-focused"), ft(t, this.focusedClassName);
2030
+ 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 = {
1933
2031
  x: 0,
1934
2032
  y: 0,
1935
2033
  rotation: e.rotation,
1936
2034
  scale: 1
1937
2035
  // No scale - using dimensions
1938
- }, c = this.focusData?.originalWidth ?? t.offsetWidth, u = this.focusData?.originalHeight ?? t.offsetHeight, l = this.config.animationDuration ?? 600, d = this.animateWithDimensions(
2036
+ }, d = this.focusData?.originalWidth ?? t.offsetWidth, l = this.focusData?.originalHeight ?? t.offsetHeight, u = this.animateWithDimensions(
1939
2037
  t,
1940
- s,
1941
- h,
1942
2038
  r,
1943
- a,
1944
2039
  c,
1945
- u,
1946
- l
1947
- ), m = {
2040
+ s,
2041
+ h,
2042
+ d,
2043
+ l,
2044
+ a
2045
+ ), g = {
1948
2046
  id: `unfocus-${Date.now()}`,
1949
2047
  element: t,
1950
- animation: d,
1951
- fromState: s,
1952
- toState: h,
2048
+ animation: u,
2049
+ fromState: r,
2050
+ toState: c,
1953
2051
  startTime: performance.now(),
1954
- duration: l
2052
+ duration: a
1955
2053
  };
1956
- return {
2054
+ return this.startClipPathAnimation(t, g, !1), {
1957
2055
  element: t,
1958
2056
  originalState: e,
1959
- animationHandle: m,
2057
+ animationHandle: g,
1960
2058
  direction: "out",
1961
- originalWidth: c,
1962
- originalHeight: u
2059
+ originalWidth: d,
2060
+ originalHeight: l
1963
2061
  };
1964
2062
  }
1965
2063
  /**
@@ -1977,10 +2075,10 @@ class Ee {
1977
2075
  * Caller is responsible for calling animationEngine.cancelAllAnimations() afterwards.
1978
2076
  */
1979
2077
  captureMidAnimationState(t) {
1980
- 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);
1981
- 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", {
1982
- transform: { x: r, y: a, rotation: h, scale: 1 },
1983
- dimensions: { width: o, height: s }
2078
+ 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);
2079
+ 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", {
2080
+ transform: { x: r, y: s, rotation: h, scale: 1 },
2081
+ dimensions: { width: o, height: a }
1984
2082
  };
1985
2083
  }
1986
2084
  /**
@@ -1995,10 +2093,10 @@ class Ee {
1995
2093
  /**
1996
2094
  * Reset an element instantly to its original position and dimensions (no animation)
1997
2095
  */
1998
- resetElementInstantly(t, e, i, o, s) {
2096
+ resetElementInstantly(t, e, i, o, a) {
1999
2097
  this.animationEngine.cancelAllAnimations(t);
2000
2098
  const r = ["translate(-50%, -50%)"];
2001
- 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);
2099
+ 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);
2002
2100
  }
2003
2101
  /**
2004
2102
  * Focus (zoom) an image to center of container
@@ -2008,11 +2106,11 @@ class Ee {
2008
2106
  if (this.currentFocus === t && this.state === I.FOCUSED)
2009
2107
  return this.unfocusImage();
2010
2108
  if (this.incoming?.element === t && this.state === I.FOCUSING) {
2011
- const { transform: s, dimensions: r } = this.captureMidAnimationState(t);
2109
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
2012
2110
  this.animationEngine.cancelAllAnimations(t), this.outgoing = this.startUnfocusAnimation(
2013
2111
  t,
2014
2112
  this.incoming.originalState,
2015
- s,
2113
+ a,
2016
2114
  r
2017
2115
  ), 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;
2018
2116
  return;
@@ -2055,18 +2153,18 @@ class Ee {
2055
2153
  if (this.incoming?.element === t)
2056
2154
  return;
2057
2155
  if (this.outgoing?.element === t) {
2058
- const { transform: s, dimensions: r } = this.captureMidAnimationState(t);
2156
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(t);
2059
2157
  if (this.animationEngine.cancelAllAnimations(t), this.incoming) {
2060
- const { transform: a, dimensions: h } = this.captureMidAnimationState(this.incoming.element);
2158
+ const { transform: s, dimensions: h } = this.captureMidAnimationState(this.incoming.element);
2061
2159
  this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2062
2160
  this.incoming.element,
2063
2161
  this.incoming.originalState,
2064
- a,
2162
+ s,
2065
2163
  h
2066
2164
  );
2067
2165
  } else
2068
2166
  this.outgoing = null;
2069
- if (this.incoming = this.startFocusAnimation(t, e, i, s, r), await Promise.all([
2167
+ if (this.incoming = this.startFocusAnimation(t, e, i, a, r), await Promise.all([
2070
2168
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2071
2169
  this.waitForAnimation(this.incoming.animationHandle)
2072
2170
  ]), this.focusGeneration !== o) return;
@@ -2080,11 +2178,11 @@ class Ee {
2080
2178
  this.outgoing.originalWidth,
2081
2179
  this.outgoing.originalHeight
2082
2180
  ), this.outgoing = null), this.incoming) {
2083
- const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2181
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2084
2182
  this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2085
2183
  this.incoming.element,
2086
2184
  this.incoming.originalState,
2087
- s,
2185
+ a,
2088
2186
  r
2089
2187
  );
2090
2188
  }
@@ -2105,11 +2203,11 @@ class Ee {
2105
2203
  const t = ++this.focusGeneration;
2106
2204
  if (!this.currentFocus || !this.focusData) {
2107
2205
  if (this.incoming && this.state === I.FOCUSING) {
2108
- const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2206
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2109
2207
  if (this.animationEngine.cancelAllAnimations(this.incoming.element), this.outgoing = this.startUnfocusAnimation(
2110
2208
  this.incoming.element,
2111
2209
  this.incoming.originalState,
2112
- s,
2210
+ a,
2113
2211
  r
2114
2212
  ), this.incoming = null, this.state = I.UNFOCUSING, await this.waitForAnimation(this.outgoing.animationHandle), this.focusGeneration !== t) return;
2115
2213
  this.removeFocusedStyling(this.outgoing.element, this.focusData?.originalZIndex || ""), this.outgoing = null, this.focusData = null, this.state = I.IDLE;
@@ -2117,19 +2215,19 @@ class Ee {
2117
2215
  return;
2118
2216
  }
2119
2217
  if (this.state === I.CROSS_ANIMATING && this.incoming) {
2120
- const { transform: s, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2218
+ const { transform: a, dimensions: r } = this.captureMidAnimationState(this.incoming.element);
2121
2219
  this.animationEngine.cancelAllAnimations(this.incoming.element);
2122
- const a = this.startUnfocusAnimation(
2220
+ const s = this.startUnfocusAnimation(
2123
2221
  this.incoming.element,
2124
2222
  this.incoming.originalState,
2125
- s,
2223
+ a,
2126
2224
  r
2127
2225
  );
2128
2226
  if (await Promise.all([
2129
2227
  this.outgoing ? this.waitForAnimation(this.outgoing.animationHandle) : Promise.resolve(),
2130
- this.waitForAnimation(a.animationHandle)
2228
+ this.waitForAnimation(s.animationHandle)
2131
2229
  ]), this.focusGeneration !== t) return;
2132
- 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;
2230
+ 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;
2133
2231
  return;
2134
2232
  }
2135
2233
  this.state = I.UNFOCUSING;
@@ -2174,8 +2272,8 @@ class Ee {
2174
2272
  */
2175
2273
  setDragOffset(t) {
2176
2274
  if (!this.currentFocus || !this.focusData || this.state !== I.FOCUSED) return;
2177
- const e = this.currentFocus, i = this.focusData.focusTransform, o = ["translate(-50%, -50%)"], s = (i.x ?? 0) + t, r = i.y ?? 0;
2178
- 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(" ");
2275
+ const e = this.currentFocus, i = this.focusData.focusTransform, o = ["translate(-50%, -50%)"], a = (i.x ?? 0) + t, r = i.y ?? 0;
2276
+ 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(" ");
2179
2277
  }
2180
2278
  /**
2181
2279
  * Clear the drag offset, optionally animating back to center
@@ -2184,9 +2282,9 @@ class Ee {
2184
2282
  */
2185
2283
  clearDragOffset(t, e = 150) {
2186
2284
  if (!this.currentFocus || !this.focusData || this.state !== I.FOCUSED) return;
2187
- const i = this.currentFocus, o = this.focusData.focusTransform, s = ["translate(-50%, -50%)"], r = o.x ?? 0, a = o.y ?? 0;
2188
- s.push(`translate(${r}px, ${a}px)`), o.rotation !== void 0 && s.push(`rotate(${o.rotation}deg)`);
2189
- const h = s.join(" ");
2285
+ const i = this.currentFocus, o = this.focusData.focusTransform, a = ["translate(-50%, -50%)"], r = o.x ?? 0, s = o.y ?? 0;
2286
+ a.push(`translate(${r}px, ${s}px)`), o.rotation !== void 0 && a.push(`rotate(${o.rotation}deg)`);
2287
+ const h = a.join(" ");
2190
2288
  t ? (i.style.transition = `transform ${e}ms ease-out`, i.style.transform = h, setTimeout(() => {
2191
2289
  this.currentFocus === i && (i.style.transition = "none");
2192
2290
  }, e)) : (i.style.transition = "none", i.style.transform = h);
@@ -2216,7 +2314,7 @@ class Ee {
2216
2314
  ), this.state = I.IDLE, this.currentFocus = null, this.focusData = null, this.outgoing = null, this.incoming = null;
2217
2315
  }
2218
2316
  }
2219
- const Ie = 50, Ae = 0.5, Te = 20, Ce = 0.3, Re = 150, Me = 30, at = class at {
2317
+ const Me = 50, Le = 0.5, ze = 20, Fe = 0.3, $e = 150, De = 30, ot = class ot {
2220
2318
  constructor(t, e) {
2221
2319
  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);
2222
2320
  }
@@ -2243,7 +2341,7 @@ const Ie = 50, Ae = 0.5, Te = 20, Ce = 0.3, Re = 150, Me = 30, at = class at {
2243
2341
  * Used to prevent click-outside from unfocusing immediately after touch
2244
2342
  */
2245
2343
  hadRecentTouch() {
2246
- return Date.now() - this.recentTouchTimestamp < at.TOUCH_CLICK_DELAY;
2344
+ return Date.now() - this.recentTouchTimestamp < ot.TOUCH_CLICK_DELAY;
2247
2345
  }
2248
2346
  handleTouchStart(t) {
2249
2347
  if (t.touches.length !== 1) return;
@@ -2262,29 +2360,29 @@ const Ie = 50, Ae = 0.5, Te = 20, Ce = 0.3, Re = 150, Me = 30, at = class at {
2262
2360
  if (!this.touchState || t.touches.length !== 1) return;
2263
2361
  const e = t.touches[0], i = e.clientX - this.touchState.startX, o = e.clientY - this.touchState.startY;
2264
2362
  if (this.touchState.isHorizontalSwipe === null && Math.sqrt(i * i + o * o) > 10) {
2265
- const a = Math.atan2(Math.abs(o), Math.abs(i)) * (180 / Math.PI);
2266
- this.touchState.isHorizontalSwipe = a <= Me;
2363
+ const s = Math.atan2(Math.abs(o), Math.abs(i)) * (180 / Math.PI);
2364
+ this.touchState.isHorizontalSwipe = s <= De;
2267
2365
  }
2268
2366
  if (this.touchState.isHorizontalSwipe !== !1 && this.touchState.isHorizontalSwipe === !0) {
2269
2367
  t.preventDefault(), this.touchState.isDragging = !0, this.touchState.currentX = e.clientX;
2270
- const s = i * Ce;
2271
- this.callbacks.onDragOffset(s);
2368
+ const a = i * Fe;
2369
+ this.callbacks.onDragOffset(a);
2272
2370
  }
2273
2371
  }
2274
2372
  handleTouchEnd(t) {
2275
2373
  if (!this.touchState) return;
2276
2374
  this.recentTouchTimestamp = Date.now();
2277
- const e = this.touchState.currentX - this.touchState.startX, i = performance.now() - this.touchState.startTime, o = Math.abs(e) / i, s = Math.abs(e);
2375
+ const e = this.touchState.currentX - this.touchState.startX, i = performance.now() - this.touchState.startTime, o = Math.abs(e) / i, a = Math.abs(e);
2278
2376
  let r = !1;
2279
- this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (s >= Ie || o >= Ae && s >= Te) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2377
+ this.touchState.isHorizontalSwipe === !0 && this.touchState.isDragging && (a >= Me || o >= Le && a >= ze) && (r = !0, e < 0 ? this.callbacks.onNext() : this.callbacks.onPrev()), this.touchState.isDragging && this.callbacks.onDragEnd(r), this.touchState = null;
2280
2378
  }
2281
2379
  handleTouchCancel(t) {
2282
2380
  this.touchState?.isDragging && this.callbacks.onDragEnd(!1), this.touchState = null;
2283
2381
  }
2284
2382
  };
2285
- at.TOUCH_CLICK_DELAY = 300;
2286
- let ft = at;
2287
- class Le {
2383
+ ot.TOUCH_CLICK_DELAY = 300;
2384
+ let mt = ot;
2385
+ class Oe {
2288
2386
  constructor(t) {
2289
2387
  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)
2290
2388
  throw new Error("GoogleDriveLoader requires at least one source to be configured");
@@ -2298,8 +2396,8 @@ class Le {
2298
2396
  for (const e of this.sources)
2299
2397
  if ("folders" in e)
2300
2398
  for (const i of e.folders) {
2301
- const o = e.recursive !== void 0 ? e.recursive : !0, s = await this.loadFromFolder(i, t, o);
2302
- this._discoveredUrls.push(...s);
2399
+ const o = e.recursive !== void 0 ? e.recursive : !0, a = await this.loadFromFolder(i, t, o);
2400
+ this._discoveredUrls.push(...a);
2303
2401
  }
2304
2402
  else if ("files" in e) {
2305
2403
  const i = await this.loadFiles(e.files, t);
@@ -2365,8 +2463,8 @@ class Le {
2365
2463
  return this.loadImagesDirectly(o, e);
2366
2464
  try {
2367
2465
  return i ? await this.loadImagesRecursively(o, e) : await this.loadImagesFromSingleFolder(o, e);
2368
- } catch (s) {
2369
- return console.error("Error loading from Google Drive API:", s), this.loadImagesDirectly(o, e);
2466
+ } catch (a) {
2467
+ return console.error("Error loading from Google Drive API:", a), this.loadImagesDirectly(o, e);
2370
2468
  }
2371
2469
  }
2372
2470
  /**
@@ -2376,14 +2474,14 @@ class Le {
2376
2474
  * @returns Promise resolving to array of image URLs
2377
2475
  */
2378
2476
  async loadImagesFromSingleFolder(t, e) {
2379
- 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);
2380
- if (!a.ok)
2381
- throw new Error(`API request failed: ${a.status} ${a.statusText}`);
2382
- const c = (await a.json()).files.filter(
2383
- (u) => u.mimeType.startsWith("image/") && e.isAllowed(u.name)
2477
+ 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);
2478
+ if (!s.ok)
2479
+ throw new Error(`API request failed: ${s.status} ${s.statusText}`);
2480
+ const c = (await s.json()).files.filter(
2481
+ (d) => d.mimeType.startsWith("image/") && e.isAllowed(d.name)
2384
2482
  );
2385
- return this.log(`Found ${c.length} images in folder ${t} (non-recursive)`), c.forEach((u) => {
2386
- i.push(`https://lh3.googleusercontent.com/d/${u.id}=s1600`), this.log(`Added file: ${u.name}`);
2483
+ return this.log(`Found ${c.length} images in folder ${t} (non-recursive)`), c.forEach((d) => {
2484
+ i.push(`https://lh3.googleusercontent.com/d/${d.id}=s1600`), this.log(`Added file: ${d.name}`);
2387
2485
  }), i;
2388
2486
  }
2389
2487
  /**
@@ -2395,24 +2493,24 @@ class Le {
2395
2493
  async loadFiles(t, e) {
2396
2494
  const i = [];
2397
2495
  for (const o of t) {
2398
- const s = this.extractFileId(o);
2399
- if (!s) {
2496
+ const a = this.extractFileId(o);
2497
+ if (!a) {
2400
2498
  this.log(`Skipping invalid file URL: ${o}`);
2401
2499
  continue;
2402
2500
  }
2403
2501
  if (this.apiKey && this.apiKey !== "YOUR_API_KEY_HERE")
2404
2502
  try {
2405
- const r = `${this.apiEndpoint}/${s}?fields=name,mimeType&key=${this.apiKey}`, a = await fetch(r);
2406
- if (a.ok) {
2407
- const h = await a.json();
2408
- 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})`);
2503
+ const r = `${this.apiEndpoint}/${a}?fields=name,mimeType&key=${this.apiKey}`, s = await fetch(r);
2504
+ if (s.ok) {
2505
+ const h = await s.json();
2506
+ 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})`);
2409
2507
  } else
2410
- this.log(`Failed to fetch metadata for file ${s}: ${a.status}`);
2508
+ this.log(`Failed to fetch metadata for file ${a}: ${s.status}`);
2411
2509
  } catch (r) {
2412
- this.log(`Error fetching metadata for file ${s}:`, r);
2510
+ this.log(`Error fetching metadata for file ${a}:`, r);
2413
2511
  }
2414
2512
  else
2415
- i.push(`https://lh3.googleusercontent.com/d/${s}=s1600`);
2513
+ i.push(`https://lh3.googleusercontent.com/d/${a}=s1600`);
2416
2514
  }
2417
2515
  return i;
2418
2516
  }
@@ -2446,21 +2544,21 @@ class Le {
2446
2544
  * @returns Promise resolving to array of image URLs
2447
2545
  */
2448
2546
  async loadImagesRecursively(t, e) {
2449
- 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);
2450
- if (!a.ok)
2451
- throw new Error(`API request failed: ${a.status} ${a.statusText}`);
2452
- const h = await a.json(), c = h.files.filter(
2547
+ 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);
2548
+ if (!s.ok)
2549
+ throw new Error(`API request failed: ${s.status} ${s.statusText}`);
2550
+ const h = await s.json(), c = h.files.filter(
2453
2551
  (l) => l.mimeType.startsWith("image/") && e.isAllowed(l.name)
2454
- ), u = h.files.filter(
2552
+ ), d = h.files.filter(
2455
2553
  (l) => l.mimeType === "application/vnd.google-apps.folder"
2456
2554
  );
2457
- 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) => {
2555
+ 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) => {
2458
2556
  i.push(`https://lh3.googleusercontent.com/d/${l.id}=s1600`), this.log(`Added file: ${l.name}`);
2459
2557
  });
2460
- for (const l of u) {
2558
+ for (const l of d) {
2461
2559
  this.log(`Loading images from subfolder: ${l.name}`);
2462
- const d = await this.loadImagesRecursively(l.id, e);
2463
- i.push(...d);
2560
+ const u = await this.loadImagesRecursively(l.id, e);
2561
+ i.push(...u);
2464
2562
  }
2465
2563
  return i;
2466
2564
  }
@@ -2476,9 +2574,9 @@ class Le {
2476
2574
  const i = `https://drive.google.com/embeddedfolderview?id=${t}`, o = await fetch(i, { mode: "cors" });
2477
2575
  if (!o.ok)
2478
2576
  throw new Error("Cannot access folder directly (CORS or permissions issue)");
2479
- const s = await o.text(), r = /\/file\/d\/([a-zA-Z0-9_-]+)/g, a = [...s.matchAll(r)];
2480
- return [...new Set(a.map((u) => u[1]))].map(
2481
- (u) => `https://drive.google.com/uc?export=view&id=${u}`
2577
+ const a = await o.text(), r = /\/file\/d\/([a-zA-Z0-9_-]+)/g, s = [...a.matchAll(r)];
2578
+ return [...new Set(s.map((d) => d[1]))].map(
2579
+ (d) => `https://drive.google.com/uc?export=view&id=${d}`
2482
2580
  );
2483
2581
  } catch (i) {
2484
2582
  throw console.error("Direct loading failed:", i), new Error(
@@ -2505,7 +2603,7 @@ class Le {
2505
2603
  this.debugLogging && typeof console < "u" && console.log(...t);
2506
2604
  }
2507
2605
  }
2508
- class ze {
2606
+ class Pe {
2509
2607
  constructor(t) {
2510
2608
  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)
2511
2609
  throw new Error("StaticImageLoader requires at least one source to be configured");
@@ -2570,8 +2668,8 @@ class ze {
2570
2668
  return console.warn("URLs must be an array:", t), [];
2571
2669
  const i = [];
2572
2670
  for (const o of t) {
2573
- const s = o.split("/").pop() || o;
2574
- if (!e.isAllowed(s)) {
2671
+ const a = o.split("/").pop() || o;
2672
+ if (!e.isAllowed(a)) {
2575
2673
  this.log(`Skipping filtered URL: ${o}`);
2576
2674
  continue;
2577
2675
  }
@@ -2590,12 +2688,12 @@ class ze {
2590
2688
  if (!Array.isArray(e))
2591
2689
  return console.warn("files must be an array:", e), [];
2592
2690
  const o = [];
2593
- for (const s of e) {
2594
- if (!i.isAllowed(s)) {
2595
- this.log(`Skipping filtered file: ${s}`);
2691
+ for (const a of e) {
2692
+ if (!i.isAllowed(a)) {
2693
+ this.log(`Skipping filtered file: ${a}`);
2596
2694
  continue;
2597
2695
  }
2598
- const r = this.constructUrl(t, s);
2696
+ const r = this.constructUrl(t, a);
2599
2697
  this.validateUrls ? await this.validateUrl(r) ? o.push(r) : console.warn(`Skipping invalid/missing file: ${r}`) : o.push(r);
2600
2698
  }
2601
2699
  return o;
@@ -2611,15 +2709,15 @@ class ze {
2611
2709
  this.log(`Fetching JSON endpoint: ${t}`);
2612
2710
  const i = new AbortController(), o = setTimeout(() => i.abort(), 1e4);
2613
2711
  try {
2614
- const s = await fetch(t, { signal: i.signal });
2615
- if (clearTimeout(o), !s.ok)
2616
- throw new Error(`HTTP ${s.status} fetching ${t}`);
2617
- const r = await s.json();
2712
+ const a = await fetch(t, { signal: i.signal });
2713
+ if (clearTimeout(o), !a.ok)
2714
+ throw new Error(`HTTP ${a.status} fetching ${t}`);
2715
+ const r = await a.json();
2618
2716
  if (!r || !Array.isArray(r.images))
2619
2717
  throw new Error('JSON source must return JSON with shape { "images": ["url1", "url2", ...] }');
2620
2718
  return this.log(`JSON endpoint returned ${r.images.length} image(s)`), await this.processUrls(r.images, e);
2621
- } catch (s) {
2622
- throw clearTimeout(o), s instanceof Error && s.name === "AbortError" ? new Error(`Timeout fetching JSON endpoint: ${t}`) : s;
2719
+ } catch (a) {
2720
+ throw clearTimeout(o), a instanceof Error && a.name === "AbortError" ? new Error(`Timeout fetching JSON endpoint: ${t}`) : a;
2623
2721
  }
2624
2722
  }
2625
2723
  /**
@@ -2641,11 +2739,11 @@ class ze {
2641
2739
  if (!(t.startsWith(window.location.origin) || t.startsWith("/")))
2642
2740
  return this.log(`Skipping validation for cross-origin URL: ${t}`), !0;
2643
2741
  try {
2644
- const i = new AbortController(), o = setTimeout(() => i.abort(), this.validationTimeout), s = await fetch(t, {
2742
+ const i = new AbortController(), o = setTimeout(() => i.abort(), this.validationTimeout), a = await fetch(t, {
2645
2743
  method: "HEAD",
2646
2744
  signal: i.signal
2647
2745
  });
2648
- return clearTimeout(o), s.ok ? !0 : (this.log(`Validation failed for ${t}: HTTP ${s.status}`), !1);
2746
+ return clearTimeout(o), a.ok ? !0 : (this.log(`Validation failed for ${t}: HTTP ${a.status}`), !1);
2649
2747
  } catch (i) {
2650
2748
  return i instanceof Error && (i.name === "AbortError" ? this.log(`Validation timeout for ${t}`) : this.log(`Validation failed for ${t}:`, i.message)), !1;
2651
2749
  }
@@ -2685,7 +2783,7 @@ class ze {
2685
2783
  this.debugLogging && typeof console < "u" && console.log(...t);
2686
2784
  }
2687
2785
  }
2688
- class Fe {
2786
+ class Ue {
2689
2787
  constructor(t) {
2690
2788
  if (this._prepared = !1, this._discoveredUrls = [], this.loaders = t.loaders, this.debugLogging = t.debugLogging ?? !1, !this.loaders || this.loaders.length === 0)
2691
2789
  throw new Error("CompositeLoader requires at least one loader to be configured");
@@ -2699,8 +2797,8 @@ class Fe {
2699
2797
  this._discoveredUrls = [], this.log(`Preparing ${this.loaders.length} loader(s) in parallel`);
2700
2798
  const e = this.loaders.map((i, o) => i.prepare(t).then(() => {
2701
2799
  this.log(`Loader ${o} prepared with ${i.imagesLength()} images`);
2702
- }).catch((s) => {
2703
- console.warn(`Loader ${o} failed to prepare:`, s);
2800
+ }).catch((a) => {
2801
+ console.warn(`Loader ${o} failed to prepare:`, a);
2704
2802
  }));
2705
2803
  await Promise.all(e);
2706
2804
  for (const i of this.loaders)
@@ -2742,7 +2840,7 @@ class Fe {
2742
2840
  this.debugLogging && typeof console < "u" && console.log("[CompositeLoader]", ...t);
2743
2841
  }
2744
2842
  }
2745
- class De {
2843
+ class _e {
2746
2844
  /**
2747
2845
  * Create a new ImageFilter
2748
2846
  * @param extensions - Array of allowed file extensions (without dots)
@@ -2779,7 +2877,7 @@ class De {
2779
2877
  // isAllowedDate(date: Date): boolean
2780
2878
  // isAllowedDimensions(width: number, height: number): boolean
2781
2879
  }
2782
- const Oe = `
2880
+ const He = `
2783
2881
  .fbn-ic-gallery {
2784
2882
  position: relative;
2785
2883
  width: 100%;
@@ -2829,21 +2927,21 @@ const Oe = `
2829
2927
  display: none !important;
2830
2928
  }
2831
2929
  `;
2832
- function $e() {
2930
+ function Ne() {
2833
2931
  if (typeof document > "u") return;
2834
2932
  const n = "fbn-ic-functional-styles";
2835
2933
  if (document.getElementById(n)) return;
2836
2934
  const t = document.createElement("style");
2837
- t.id = n, t.textContent = Oe, document.head.appendChild(t);
2935
+ t.id = n, t.textContent = He, document.head.appendChild(t);
2838
2936
  }
2839
- let Ue = class {
2937
+ let je = class {
2840
2938
  constructor(t = {}) {
2841
- 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({
2939
+ this.fullConfig = Bt(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 Zt(this.fullConfig.animation), this.layoutEngine = new we({
2842
2940
  layout: this.fullConfig.layout,
2843
2941
  image: this.fullConfig.image
2844
- }), this.zoomEngine = new Ee(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;
2845
- const e = this.fullConfig.animation.entry || y.animation.entry;
2846
- this.entryAnimationEngine = new ce(
2942
+ }), this.zoomEngine = new Re(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;
2943
+ const e = this.fullConfig.animation.entry || b.animation.entry;
2944
+ this.entryAnimationEngine = new le(
2847
2945
  e,
2848
2946
  this.fullConfig.layout.algorithm
2849
2947
  ), this.swipeEngine = null, this.imageFilter = this.createImageFilter(), this.imageLoader = this.createLoader(), this.containerEl = null, this.loadingEl = null, this.errorEl = null;
@@ -2853,7 +2951,7 @@ let Ue = class {
2853
2951
  */
2854
2952
  createImageFilter() {
2855
2953
  const t = this.fullConfig.config.loaders?.allowedExtensions;
2856
- return new De(t);
2954
+ return new _e(t);
2857
2955
  }
2858
2956
  /**
2859
2957
  * Create appropriate image loader based on config
@@ -2864,7 +2962,7 @@ let Ue = class {
2864
2962
  if (!t || t.length === 0)
2865
2963
  throw new Error("No loaders configured. Provide `images`, `loaders`, or both.");
2866
2964
  const i = t.map((o) => this.createLoaderFromEntry(o, e));
2867
- return i.length === 1 ? i[0] : new Fe({
2965
+ return i.length === 1 ? i[0] : new Ue({
2868
2966
  loaders: i,
2869
2967
  debugLogging: this.fullConfig.config.debug?.loaders
2870
2968
  });
@@ -2882,14 +2980,14 @@ let Ue = class {
2882
2980
  allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
2883
2981
  debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
2884
2982
  };
2885
- return new ze(o);
2983
+ return new Pe(o);
2886
2984
  } else if ("googleDrive" in t) {
2887
2985
  const i = t.googleDrive, o = {
2888
2986
  ...i,
2889
2987
  allowedExtensions: i.allowedExtensions ?? e.allowedExtensions,
2890
2988
  debugLogging: i.debugLogging ?? this.fullConfig.config.debug?.loaders
2891
2989
  };
2892
- return new Le(o);
2990
+ return new Oe(o);
2893
2991
  } else
2894
2992
  throw new Error(`Unknown loader entry: ${JSON.stringify(t)}`);
2895
2993
  }
@@ -2898,16 +2996,16 @@ let Ue = class {
2898
2996
  */
2899
2997
  async init() {
2900
2998
  try {
2901
- if ($e(), this.containerRef)
2999
+ if (Ne(), this.containerRef)
2902
3000
  this.containerEl = this.containerRef;
2903
3001
  else if (this.containerEl = document.getElementById(this.containerId), !this.containerEl)
2904
3002
  throw new Error(`Container #${this.containerId} not found`);
2905
- this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new ft(this.containerEl, {
3003
+ this.containerEl.classList.add("fbn-ic-gallery"), this.swipeEngine = new mt(this.containerEl, {
2906
3004
  onNext: () => this.navigateToNextImage(),
2907
3005
  onPrev: () => this.navigateToPreviousImage(),
2908
3006
  onDragOffset: (t) => this.zoomEngine.setDragOffset(t),
2909
3007
  onDragEnd: (t) => {
2910
- t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, Re);
3008
+ t ? this.zoomEngine.clearDragOffset(!1) : this.zoomEngine.clearDragOffset(!0, $e);
2911
3009
  }
2912
3010
  }), this.setupUI(), this.setupEventListeners(), this.logDebug("ImageCloud initialized"), await this.loadImages();
2913
3011
  } catch (t) {
@@ -3002,13 +3100,13 @@ let Ue = class {
3002
3100
  this.showError("No images found."), this.showLoading(!1);
3003
3101
  return;
3004
3102
  }
3005
- const i = this.getContainerBounds(), o = this.getImageHeight(), s = window.innerWidth;
3103
+ const i = this.getContainerBounds(), o = this.getImageHeight(), a = window.innerWidth;
3006
3104
  this.logDebug(`Adaptive sizing input: container=${i.width}x${i.height}px, images=${t}, responsiveMax=${o}px`);
3007
3105
  const r = this.layoutEngine.calculateAdaptiveSize(
3008
3106
  i,
3009
3107
  t,
3010
3108
  o,
3011
- s
3109
+ a
3012
3110
  );
3013
3111
  this.logDebug(`Adaptive sizing result: height=${r.height}px`), await this.createImageCloud(e, r.height), this.showLoading(!1), this.imagesLoaded = !0;
3014
3112
  } catch (t) {
@@ -3025,41 +3123,41 @@ let Ue = class {
3025
3123
  if (!this.containerEl) return;
3026
3124
  const i = this.getContainerBounds();
3027
3125
  this.currentImageHeight = e;
3028
- const o = this.loadGeneration, s = this.layoutEngine.generateLayout(t.length, i, { fixedHeight: e });
3029
- this.imageLayouts = s, this.displayQueue = [];
3126
+ const o = this.loadGeneration, a = this.layoutEngine.generateLayout(t.length, i, { fixedHeight: e });
3127
+ this.imageLayouts = a, this.displayQueue = [];
3030
3128
  let r = 0;
3031
- const a = (c) => {
3129
+ const s = (c) => {
3032
3130
  this.containerEl && (this.containerEl.appendChild(c), this.imageElements.push(c), requestAnimationFrame(() => {
3033
3131
  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)) {
3034
- const d = {
3132
+ const u = {
3035
3133
  x: parseFloat(c.dataset.startX),
3036
3134
  y: parseFloat(c.dataset.startY)
3037
- }, m = {
3135
+ }, g = {
3038
3136
  x: parseFloat(c.dataset.endX),
3039
3137
  y: parseFloat(c.dataset.endY)
3040
- }, b = parseFloat(c.dataset.imageWidth), p = parseFloat(c.dataset.imageHeight), g = parseFloat(c.dataset.rotation), f = parseFloat(c.dataset.scale), S = c.dataset.startRotation ? parseFloat(c.dataset.startRotation) : g, v = c.dataset.startScale ? parseFloat(c.dataset.startScale) : f, w = this.entryAnimationEngine.getTiming();
3041
- se({
3138
+ }, 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();
3139
+ ae({
3042
3140
  element: c,
3043
- startPosition: d,
3044
- endPosition: m,
3141
+ startPosition: u,
3142
+ endPosition: g,
3045
3143
  pathConfig: this.entryAnimationEngine.getPathConfig(),
3046
3144
  duration: w.duration,
3047
- imageWidth: b,
3048
- imageHeight: p,
3049
- rotation: g,
3050
- scale: f,
3145
+ imageWidth: p,
3146
+ imageHeight: y,
3147
+ rotation: f,
3148
+ scale: m,
3051
3149
  rotationConfig: this.entryAnimationEngine.getRotationConfig(),
3052
- startRotation: S,
3150
+ startRotation: E,
3053
3151
  scaleConfig: this.entryAnimationEngine.getScaleConfig(),
3054
3152
  startScale: v
3055
3153
  });
3056
3154
  } else {
3057
- const d = c.dataset.finalTransform || "";
3058
- c.style.transform = d;
3155
+ const u = c.dataset.finalTransform || "";
3156
+ c.style.transform = u;
3059
3157
  }
3060
3158
  const l = parseInt(c.dataset.imageId || "0");
3061
3159
  if (this.fullConfig.config.debug?.enabled && l < 3) {
3062
- const d = c.dataset.finalTransform || "";
3160
+ const u = c.dataset.finalTransform || "";
3063
3161
  console.log(`Image ${l} final state:`, {
3064
3162
  left: c.style.left,
3065
3163
  top: c.style.top,
@@ -3067,7 +3165,7 @@ let Ue = class {
3067
3165
  height: c.style.height,
3068
3166
  computedWidth: c.offsetWidth,
3069
3167
  computedHeight: c.offsetHeight,
3070
- transform: d,
3168
+ transform: u,
3071
3169
  pathType: this.entryAnimationEngine.getPathType()
3072
3170
  });
3073
3171
  }
@@ -3076,7 +3174,7 @@ let Ue = class {
3076
3174
  if (this.logDebug("Starting queue processing, enabled:", this.fullConfig.animation.queue.enabled), !this.fullConfig.animation.queue.enabled) {
3077
3175
  for (; this.displayQueue.length > 0; ) {
3078
3176
  const c = this.displayQueue.shift();
3079
- c && a(c);
3177
+ c && s(c);
3080
3178
  }
3081
3179
  return;
3082
3180
  }
@@ -3087,70 +3185,76 @@ let Ue = class {
3087
3185
  }
3088
3186
  if (this.displayQueue.length > 0) {
3089
3187
  const c = this.displayQueue.shift();
3090
- c && a(c);
3188
+ c && s(c);
3091
3189
  }
3092
3190
  r >= t.length && this.displayQueue.length === 0 && this.queueInterval !== null && (clearInterval(this.queueInterval), this.queueInterval = null);
3093
3191
  }, this.fullConfig.animation.queue.interval);
3094
3192
  };
3095
3193
  if ("IntersectionObserver" in window && this.containerEl) {
3096
- const c = new IntersectionObserver((u) => {
3097
- u.forEach((l) => {
3194
+ const c = new IntersectionObserver((d) => {
3195
+ d.forEach((l) => {
3098
3196
  l.isIntersecting && (h(), c.disconnect());
3099
3197
  });
3100
3198
  }, { threshold: 0.1, rootMargin: "50px" });
3101
3199
  c.observe(this.containerEl);
3102
3200
  } else
3103
3201
  h();
3104
- this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((c) => c.remove()), s.forEach((c, u) => {
3202
+ this.fullConfig.config.debug?.centers && this.containerEl && (this.containerEl.querySelectorAll(".fbn-ic-debug-center").forEach((c) => c.remove()), a.forEach((c, d) => {
3105
3203
  const l = document.createElement("div");
3106
3204
  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";
3107
- const d = c.x, m = c.y;
3108
- l.style.left = `${d - 6}px`, l.style.top = `${m - 6}px`, l.title = `Image ${u}: center (${Math.round(d)}, ${Math.round(m)})`, this.containerEl.appendChild(l);
3109
- })), t.forEach((c, u) => {
3205
+ const u = c.x, g = c.y;
3206
+ 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);
3207
+ })), t.forEach((c, d) => {
3110
3208
  const l = document.createElement("img");
3111
- l.referrerPolicy = "no-referrer", l.classList.add("fbn-ic-image"), l.dataset.imageId = String(u);
3112
- const d = s[u];
3113
- 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", () => {
3114
- this.hoveredImage = { element: l, layout: d }, this.zoomEngine.isInvolved(l) || (tt(l, this.hoverStyles), et(l, this.hoverClassName));
3209
+ l.referrerPolicy = "no-referrer", l.classList.add("fbn-ic-image"), l.dataset.imageId = String(d), l.dataset.createdFlag = "true";
3210
+ const u = a[d];
3211
+ 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", () => {
3212
+ if (this.hoveredImage = { element: l, layout: u }, !this.zoomEngine.isInvolved(l)) {
3213
+ const g = l.cachedRenderedWidth;
3214
+ ut(l, this.fullConfig.styling?.hover, e, g), nt(l, this.hoverClassName);
3215
+ }
3115
3216
  }), l.addEventListener("mouseleave", () => {
3116
- this.hoveredImage = null, this.zoomEngine.isInvolved(l) || (tt(l, this.defaultStyles), zt(l, this.hoverClassName), et(l, this.defaultClassName));
3117
- }), l.addEventListener("click", (m) => {
3118
- m.stopPropagation(), this.handleImageClick(l, d);
3217
+ if (this.hoveredImage = null, !this.zoomEngine.isInvolved(l)) {
3218
+ const g = l.cachedRenderedWidth;
3219
+ ut(l, this.fullConfig.styling?.default, e, g), ft(l, this.hoverClassName), nt(l, this.defaultClassName);
3220
+ }
3221
+ }), l.addEventListener("click", (g) => {
3222
+ g.stopPropagation(), this.handleImageClick(l, u);
3119
3223
  }), l.style.opacity = "0", l.style.transition = this.entryAnimationEngine.getTransitionCSS(), l.onload = () => {
3120
3224
  if (o !== this.loadGeneration)
3121
3225
  return;
3122
- const m = l.naturalWidth / l.naturalHeight, b = e * m;
3123
- l.style.width = `${b}px`;
3124
- const p = { x: d.x, y: d.y }, g = { width: b, height: e }, f = this.entryAnimationEngine.calculateStartPosition(
3125
- p,
3126
- g,
3226
+ const g = l.naturalWidth / l.naturalHeight, p = e * g;
3227
+ 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);
3228
+ const y = { x: u.x, y: u.y }, f = { width: p, height: e }, m = this.entryAnimationEngine.calculateStartPosition(
3229
+ y,
3230
+ f,
3127
3231
  i,
3128
- u,
3232
+ d,
3129
3233
  t.length
3130
- ), S = this.entryAnimationEngine.calculateStartRotation(d.rotation), v = this.entryAnimationEngine.calculateStartScale(d.scale), w = this.entryAnimationEngine.buildFinalTransform(
3131
- d.rotation,
3132
- d.scale,
3133
- b,
3234
+ ), E = this.entryAnimationEngine.calculateStartRotation(u.rotation), v = this.entryAnimationEngine.calculateStartScale(u.scale), w = this.entryAnimationEngine.buildFinalTransform(
3235
+ u.rotation,
3236
+ u.scale,
3237
+ p,
3134
3238
  e
3135
- ), E = this.entryAnimationEngine.buildStartTransform(
3136
- f,
3239
+ ), S = this.entryAnimationEngine.buildStartTransform(
3240
+ m,
3241
+ y,
3242
+ u.rotation,
3243
+ u.scale,
3137
3244
  p,
3138
- d.rotation,
3139
- d.scale,
3140
- b,
3141
3245
  e,
3142
- S,
3246
+ E,
3143
3247
  v
3144
3248
  );
3145
- this.fullConfig.config.debug?.enabled && u < 3 && console.log(`Image ${u}:`, {
3146
- finalPosition: p,
3147
- imageSize: g,
3148
- left: d.x,
3149
- top: d.y,
3249
+ this.fullConfig.config.debug?.enabled && d < 3 && console.log(`Image ${d}:`, {
3250
+ finalPosition: y,
3251
+ imageSize: f,
3252
+ left: u.x,
3253
+ top: u.y,
3150
3254
  finalTransform: w,
3151
- renderedWidth: b,
3255
+ renderedWidth: p,
3152
3256
  renderedHeight: e
3153
- }), 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(f.x), l.dataset.startY = String(f.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);
3257
+ }), 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);
3154
3258
  }, l.onerror = () => r++, l.src = c;
3155
3259
  });
3156
3260
  }
@@ -3163,8 +3267,8 @@ let Ue = class {
3163
3267
  if (i)
3164
3268
  await this.zoomEngine.unfocusImage(), this.currentFocusIndex = null, this.swipeEngine?.disable(), this.hideCounter();
3165
3269
  else {
3166
- const s = t.dataset.imageId;
3167
- 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);
3270
+ const a = t.dataset.imageId;
3271
+ 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);
3168
3272
  }
3169
3273
  }
3170
3274
  /**
@@ -3195,7 +3299,7 @@ let Ue = class {
3195
3299
  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();
3196
3300
  }
3197
3301
  };
3198
- const He = Ot({
3302
+ const Ge = Ot({
3199
3303
  name: "ImageCloud",
3200
3304
  props: {
3201
3305
  options: {
@@ -3204,34 +3308,34 @@ const He = Ot({
3204
3308
  }
3205
3309
  },
3206
3310
  setup(n, { expose: t }) {
3207
- const e = wt(null), i = wt(null);
3311
+ const e = xt(null), i = xt(null);
3208
3312
  function o() {
3209
3313
  if (!e.value) return;
3210
3314
  i.value?.destroy();
3211
- const s = new Ue({
3315
+ const a = new je({
3212
3316
  container: e.value,
3213
3317
  ...n.options
3214
3318
  });
3215
- i.value = s, s.init().catch((r) => {
3319
+ i.value = a, a.init().catch((r) => {
3216
3320
  console.error("ImageCloud init failed:", r);
3217
3321
  });
3218
3322
  }
3219
- return $t(() => {
3323
+ return Pt(() => {
3220
3324
  o();
3221
3325
  }), Ut(() => {
3222
3326
  i.value?.destroy(), i.value = null;
3223
- }), Pt(
3327
+ }), _t(
3224
3328
  () => n.options,
3225
3329
  () => {
3226
3330
  o();
3227
3331
  },
3228
3332
  { deep: !0 }
3229
- ), t({ instance: i }), () => _t("div", {
3333
+ ), t({ instance: i }), () => Ht("div", {
3230
3334
  ref: e
3231
3335
  });
3232
3336
  }
3233
3337
  });
3234
3338
  export {
3235
- He as ImageCloud
3339
+ Ge as ImageCloud
3236
3340
  };
3237
3341
  //# sourceMappingURL=vue.js.map