@dotss/tictoccroc 0.0.33 → 0.0.35

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.
@@ -1,132 +1,137 @@
1
- import { jsxs as C, jsx as S } from "react/jsx-runtime";
2
- import { forwardRef as B, useMemo as x, useState as v, useRef as F, useImperativeHandle as W, useEffect as y, Children as z, isValidElement as N, cloneElement as D } from "react";
3
- import { Flexbox as l, Skeleton as L } from "@dotss/ui";
4
- import V from "@dotss/ui/core/useTheme";
5
- import $ from "../../Image/Image.mjs";
6
- import { findImageInChildren as q } from "../Masonry.utils.mjs";
7
- const U = B(
1
+ import { jsxs as E, jsx as b } from "react/jsx-runtime";
2
+ import { forwardRef as q, useMemo as D, useState as v, useRef as V, useImperativeHandle as $, useEffect as k, Children as z, isValidElement as G, cloneElement as J } from "react";
3
+ import { Flexbox as g, Skeleton as K } from "@dotss/ui";
4
+ import O from "@dotss/ui/core/useTheme";
5
+ import P from "../../Image/Image.mjs";
6
+ import { findImageInChildren as Q } from "../Masonry.utils.mjs";
7
+ import U from "../../../hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.mjs";
8
+ const a = q(
8
9
  ({
9
- children: s,
10
- width: c = 0,
11
- height: h = 0,
12
- spacing: T = 2,
13
- borderRadius: o = 0,
14
- direction: b = "vertical",
10
+ children: u,
11
+ width: h = 0,
12
+ height: p = 0,
13
+ spacing: w = 2,
14
+ borderRadius: d = 0,
15
+ direction: C = "vertical",
15
16
  setInnerRef: t,
16
- sourceMetadata: r,
17
+ sourceMetadataMap: S,
18
+ onLoad: T,
19
+ onManualLoad: l,
17
20
  ...e
18
- }, E) => {
19
- var k;
20
- const { spacing: j } = V(), f = x(() => q(s), [s]), p = (k = f == null ? void 0 : f.props) == null ? void 0 : k.src, i = x(
21
- () => r == null ? void 0 : r.find((n) => n.src === p),
22
- [r, p]
23
- ), [g, H] = v((i == null ? void 0 : i.width) ?? c ?? 0), [d, I] = v((i == null ? void 0 : i.height) ?? h ?? 0), [w, m] = v(!1), u = F(null);
24
- W(E, () => u.current);
25
- const A = (n) => {
26
- n.propertyName !== "padding-top" && n.propertyName !== "padding-left" || m(!0);
27
- };
28
- return y(() => {
29
- H((i == null ? void 0 : i.width) ?? c ?? 0), I((i == null ? void 0 : i.height) ?? h ?? 0);
30
- }, [c, h, i == null ? void 0 : i.width, i == null ? void 0 : i.height]), y(() => {
31
- if (!(i != null && i.width) || !(i != null && i.height)) return;
32
- const n = setTimeout(() => {
33
- m(!0);
34
- }, 500);
35
- return () => {
36
- clearTimeout(n);
37
- };
38
- }, [i == null ? void 0 : i.width, i == null ? void 0 : i.height]), y(() => {
39
- t == null || t(u.current);
40
- }, [t]), /* @__PURE__ */ C(
41
- l,
21
+ }, x) => {
22
+ const { spacing: j } = O(), r = D(() => {
23
+ var n, f;
24
+ return ((f = (n = Q(u)) == null ? void 0 : n.props) == null ? void 0 : f.src) ?? "";
25
+ }, [u]), i = S == null ? void 0 : S.get(r), [s, H] = v((i == null ? void 0 : i.width) ?? h ?? 0), [c, W] = v((i == null ? void 0 : i.height) ?? p ?? 0), [A, y] = v(!1), o = V(null), m = !r || !!r && A;
26
+ $(x, () => o.current);
27
+ const B = (n) => {
28
+ n.propertyName !== "padding-top" && n.propertyName !== "padding-left" || y(!0);
29
+ }, F = () => y(!0);
30
+ return U(() => {
31
+ if (!(i != null && i.loaded) && o.current && r) {
32
+ const n = o.current.querySelector("img");
33
+ if (!n || !n.complete) return;
34
+ const { naturalWidth: f, naturalHeight: I, src: N } = n;
35
+ l == null || l(f, I, N);
36
+ }
37
+ }, [r, i == null ? void 0 : i.loaded, l]), k(() => {
38
+ H((i == null ? void 0 : i.width) ?? h ?? 0), W((i == null ? void 0 : i.height) ?? p ?? 0);
39
+ }, [h, p, i == null ? void 0 : i.width, i == null ? void 0 : i.height]), k(() => {
40
+ if (!(i != null && i.loaded) || (i == null ? void 0 : i.width) !== s || (i == null ? void 0 : i.height) !== c) return;
41
+ const n = setTimeout(() => y(!0), 300);
42
+ return () => clearTimeout(n);
43
+ }, [i, s, c]), k(() => {
44
+ t == null || t(o.current);
45
+ }, [t]), /* @__PURE__ */ E(
46
+ g,
42
47
  {
43
- ref: u,
48
+ ref: o,
44
49
  flexDirection: "column",
45
50
  ...e,
46
51
  inlineCSS: {
52
+ contain: "content",
47
53
  transform: "translate3d(0, 0, 0)",
48
54
  breakInside: "avoid",
49
55
  ...e == null ? void 0 : e.inlineCSS
50
56
  },
51
57
  children: [
52
- b === "vertical" && /* @__PURE__ */ S(
53
- l,
58
+ C === "vertical" && /* @__PURE__ */ b(
59
+ g,
54
60
  {
55
61
  inlineCSS: {
56
- minHeight: j.content(T)
62
+ minHeight: j.content(w)
57
63
  }
58
64
  }
59
65
  ),
60
- /* @__PURE__ */ S(
61
- l,
66
+ /* @__PURE__ */ E(
67
+ g,
62
68
  {
63
- onTransitionEnd: A,
69
+ onTransitionEnd: B,
64
70
  inlineCSS: {
65
71
  position: "relative",
66
72
  overflow: "hidden",
67
73
  scrollbarWidth: "none",
74
+ borderRadius: d,
68
75
  "&::-webkit-scrollbar": {
69
76
  display: "none"
70
77
  },
71
78
  ...e == null ? void 0 : e.inlineCSS
72
79
  },
73
- style: b === "vertical" ? {
74
- borderRadius: o,
75
- paddingTop: `calc(${d / g} * 100%)`,
76
- transition: "padding-top 0.3s 0.1s"
80
+ style: C === "vertical" ? {
81
+ paddingTop: `calc(${c / s} * 100%)`,
82
+ transition: "padding-top 0.3s"
77
83
  } : {
78
- borderRadius: o,
79
- paddingLeft: g,
80
- paddingTop: d,
81
- transition: "padding-top 0.3s 0.1s, padding-left 0.3s 0.1s"
84
+ paddingLeft: s,
85
+ paddingTop: c,
86
+ transition: "padding-top 0.3s, padding-left 0.3s"
82
87
  },
83
- children: /* @__PURE__ */ C(
84
- l,
85
- {
86
- inlineCSS: {
87
- position: "absolute",
88
- top: 0,
89
- left: 0,
90
- width: "100%",
91
- height: "100%",
92
- overflow: "hidden",
93
- borderRadius: o,
94
- transition: "border-radius 0.3s 0.1s",
95
- zIndex: 1
96
- },
97
- children: [
98
- /* @__PURE__ */ S(
99
- L,
100
- {
101
- borderRadius: o,
102
- inlineCSS: {
103
- position: "absolute",
104
- top: 0,
105
- left: 0,
106
- width: "100%",
107
- height: "100%",
108
- opacity: !p || w ? 0 : 1,
109
- transition: "opacity 0.3s 0.1s",
110
- pointerEvents: w ? "none" : void 0,
111
- zIndex: 2
112
- }
113
- }
114
- ),
115
- z.toArray(s).filter(N).map((n) => n.type === $ || n.type === "img" ? D(n, {
116
- width: g,
117
- height: d,
88
+ children: [
89
+ /* @__PURE__ */ b(
90
+ g,
91
+ {
92
+ inlineCSS: {
93
+ position: "absolute",
94
+ top: 0,
95
+ left: 0,
96
+ width: "100%",
97
+ height: "100%",
98
+ opacity: m ? 1 : 0,
99
+ transition: "opacity 0.3s"
100
+ },
101
+ style: {
102
+ borderRadius: d > 0 ? d : 0
103
+ },
104
+ children: z.toArray(u).filter(G).map((n) => n.type === P || n.type === "img" ? J(n, {
105
+ width: i == null ? void 0 : i.originWidth,
118
106
  draggable: !1,
119
107
  style: {
120
- overflow: "hidden",
121
108
  objectFit: "cover",
122
109
  ...n.props.style
123
110
  },
124
111
  ...n.props,
125
- enableFallback: !0
112
+ enableFallback: !0,
113
+ onLoad: T,
114
+ onError: F
126
115
  }) : n)
127
- ]
128
- }
129
- )
116
+ }
117
+ ),
118
+ /* @__PURE__ */ b(
119
+ K,
120
+ {
121
+ borderRadius: 0,
122
+ inlineCSS: {
123
+ position: "absolute",
124
+ top: 0,
125
+ left: 0,
126
+ width: "100%",
127
+ height: "100%",
128
+ opacity: m ? 0 : 1,
129
+ transition: "opacity 0.3s",
130
+ pointerEvents: m ? "none" : void 0
131
+ }
132
+ }
133
+ )
134
+ ]
130
135
  }
131
136
  )
132
137
  ]
@@ -135,5 +140,5 @@ const U = B(
135
140
  }
136
141
  );
137
142
  export {
138
- U as default
143
+ a as default
139
144
  };
@@ -1,28 +1,28 @@
1
- import { jsxs as O, jsx as x } from "react/jsx-runtime";
2
- import { useState as P, useRef as i, Children as et, isValidElement as nt, useEffect as N, cloneElement as Yt } from "react";
3
- import { Flexbox as Y, Typography as ct, IconButton as $t } from "@dotss/ui";
1
+ import { jsxs as B, jsx as x } from "react/jsx-runtime";
2
+ import { useState as v, useRef as i, Children as nt, isValidElement as ct, useEffect as N, cloneElement as Yt } from "react";
3
+ import { Flexbox as $, Typography as at, IconButton as $t } from "@dotss/ui";
4
4
  import wt from "@dotss/ui/core/useTheme";
5
5
  import Xt from "@dotss/ui/Dialog";
6
- import at from "./MediaBlock/MediaBlock.mjs";
6
+ import st from "./MediaBlock/MediaBlock.mjs";
7
7
  import Rt from "../Swiper/Swiper.mjs";
8
8
  function Dt({
9
- children: B,
10
- open: $ = !1,
11
- onClose: V,
9
+ children: V,
10
+ open: w = !1,
11
+ onClose: Z,
12
12
  onSwipe: q,
13
- initialPage: Z = 0,
14
- title: J,
15
- loop: st = !1,
16
- fallback: ut,
17
- ...v
13
+ initialPage: J = 0,
14
+ title: K,
15
+ loop: ut = !1,
16
+ fallback: it,
17
+ ...E
18
18
  }) {
19
19
  const {
20
- palette: { grey: it, etc: K }
21
- } = wt(), [ot, Q] = P(!1), [lt, ft] = P(Z), [ht, mt] = P("100vh"), [_, S] = P(1), [gt, b] = P(!1), o = i(null), e = i(1), U = i(1), k = i(3), y = i(0), M = i(0), E = i(0), W = i(0), n = i(0), c = i(0), l = i(!1), h = i(!1), A = i(null), w = i(0), C = i(0), dt = et.toArray(B).filter((r) => nt(r)).filter((r) => r.type === at), pt = et.toArray(B).filter((r) => nt(r)).filter((r) => r.type !== at), xt = (r) => (t) => {
22
- l.current && t.stopPropagation(), E.current = t.clientX - n.current, W.current = t.clientY - c.current, h.current = e.current > 1, r == null || r(t);
20
+ palette: { grey: ot, etc: Q }
21
+ } = wt(), [lt, _] = v(!1), [G, ft] = v(J), [ht, mt] = v("100vh"), [U, b] = v(1), [gt, Y] = v(!1), o = i(null), e = i(1), k = i(1), tt = i(3), y = i(0), M = i(0), W = i(0), A = i(0), n = i(0), c = i(0), l = i(!1), h = i(!1), D = i(null), X = i(0), C = i(0), dt = nt.toArray(V).filter((r) => ct(r)).filter((r) => r.type === st), pt = nt.toArray(V).filter((r) => ct(r)).filter((r) => r.type !== st), xt = (r) => (t) => {
22
+ l.current && t.stopPropagation(), W.current = t.clientX - n.current, A.current = t.clientY - c.current, h.current = e.current > 1, r == null || r(t);
23
23
  }, yt = (r) => (t) => {
24
24
  if (!h.current) return;
25
- n.current = t.clientX - E.current, c.current = t.clientY - W.current;
25
+ n.current = t.clientX - W.current, c.current = t.clientY - A.current;
26
26
  const u = t.currentTarget, { width: s, height: a } = u.getBoundingClientRect(), d = s / e.current, m = a / e.current, f = Math.max(
27
27
  0,
28
28
  (d * e.current - o.current.offsetWidth) / 2
@@ -37,11 +37,11 @@ function Dt({
37
37
  Math.max(c.current, -g),
38
38
  g
39
39
  ), t.currentTarget.style.cursor = "grabbing", t.currentTarget.style.transition = "none", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`, r == null || r(t);
40
- }, tt = (r) => (t) => {
40
+ }, rt = (r) => (t) => {
41
41
  h.current && (t.currentTarget.style.cursor = "grab"), h.current = !1, r == null || r(t);
42
42
  }, Mt = (r) => (t) => {
43
- if (E.current = t.touches[0].clientX - n.current, W.current = t.touches[0].clientY - c.current, l.current = t.touches.length === 2, h.current = t.touches.length === 1 && e.current > 1, l.current) {
44
- b(!0);
43
+ if (W.current = t.touches[0].clientX - n.current, A.current = t.touches[0].clientY - c.current, l.current = t.touches.length === 2, h.current = t.touches.length === 1 && e.current > 1, l.current) {
44
+ Y(!0);
45
45
  const u = t.touches[1].clientX - t.touches[0].clientX, s = t.touches[1].clientY - t.touches[0].clientY;
46
46
  y.current = Math.hypot(u, s);
47
47
  }
@@ -52,26 +52,26 @@ function Dt({
52
52
  const a = t.touches[1].clientX - t.touches[0].clientX, d = t.touches[1].clientY - t.touches[0].clientY;
53
53
  M.current = Math.hypot(a, d);
54
54
  const m = M.current / y.current, f = Math.min(
55
- Math.max(U.current, e.current * m),
56
- k.current
57
- ), g = (t.touches[0].clientX + t.touches[1].clientX) / 2, p = (t.touches[0].clientY + t.touches[1].clientY) / 2, { left: D, top: F, width: X, height: I } = t.currentTarget.getBoundingClientRect(), G = X / e.current, z = I / e.current, L = g - D - X / 2, j = p - F - I / 2, R = f / e.current;
58
- n.current -= L * (R - 1), c.current -= j * (R - 1), e.current = f, S(f), b(!0);
59
- const T = Math.max(
55
+ Math.max(k.current, e.current * m),
56
+ tt.current
57
+ ), g = (t.touches[0].clientX + t.touches[1].clientX) / 2, p = (t.touches[0].clientY + t.touches[1].clientY) / 2, { left: S, top: F, width: R, height: I } = t.currentTarget.getBoundingClientRect(), O = R / e.current, z = I / e.current, L = g - S - R / 2, j = p - F - I / 2, T = f / e.current;
58
+ n.current -= L * (T - 1), c.current -= j * (T - 1), e.current = f, b(f), Y(!0);
59
+ const H = Math.max(
60
60
  0,
61
- (G * e.current - o.current.offsetWidth) / 2
62
- ), H = Math.max(
61
+ (O * e.current - o.current.offsetWidth) / 2
62
+ ), P = Math.max(
63
63
  0,
64
64
  (z * e.current - o.current.offsetHeight) / 2
65
65
  );
66
66
  n.current = Math.min(
67
- Math.max(n.current, -T),
68
- T
69
- ), c.current = Math.min(
70
- Math.max(c.current, -H),
67
+ Math.max(n.current, -H),
71
68
  H
69
+ ), c.current = Math.min(
70
+ Math.max(c.current, -P),
71
+ P
72
72
  ), y.current = M.current, t.currentTarget.style.transition = "none", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`;
73
73
  } else if (h.current && s) {
74
- n.current = t.touches[0].clientX - E.current, c.current = t.touches[0].clientY - W.current;
74
+ n.current = t.touches[0].clientX - W.current, c.current = t.touches[0].clientY - A.current;
75
75
  const { width: a, height: d } = t.currentTarget.getBoundingClientRect(), m = a / e.current, f = d / e.current, g = Math.max(
76
76
  0,
77
77
  (m * e.current - o.current.offsetWidth) / 2
@@ -88,7 +88,7 @@ function Dt({
88
88
  ), t.currentTarget.style.transition = "none", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`;
89
89
  }
90
90
  r == null || r(t);
91
- }, rt = (r) => (t) => {
91
+ }, et = (r) => (t) => {
92
92
  const u = e.current;
93
93
  if (l.current && u > 1.2) {
94
94
  const s = Math.abs(
@@ -103,11 +103,11 @@ function Dt({
103
103
  Math.max(c.current, -a),
104
104
  a
105
105
  ), t.currentTarget.style.transition = "transform 0.3s", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`;
106
- } else l.current && u <= 1.2 && (n.current = 0, c.current = 0, y.current = 0, M.current = 0, e.current = 1, l.current = !1, h.current = !1, S(1), b(!1), t.currentTarget.style.transition = "transform 0.3s", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`);
106
+ } else l.current && u <= 1.2 && (n.current = 0, c.current = 0, y.current = 0, M.current = 0, e.current = 1, l.current = !1, h.current = !1, b(1), Y(!1), t.currentTarget.style.transition = "transform 0.3s", t.currentTarget.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`);
107
107
  h.current = !1, r == null || r(t);
108
108
  }, St = ({ currentPage: r }) => {
109
109
  var u;
110
- r !== lt ? (n.current = 0, c.current = 0, y.current = 0, e.current = 1, M.current = 0, l.current = !1, h.current = !1, S(1), Array.from(((u = A.current) == null ? void 0 : u.getElementsByTagName("img")) || []).forEach((a) => {
110
+ r !== G ? (n.current = 0, c.current = 0, y.current = 0, e.current = 1, M.current = 0, l.current = !1, h.current = !1, b(1), Array.from(((u = D.current) == null ? void 0 : u.getElementsByTagName("img")) || []).forEach((a) => {
111
111
  a.style.cursor = "default", a.style.transition = "transform 0.1s 0.1s", a.style.transform = "translate3d(0, 0, 0) scale(1)";
112
112
  })) : e.current > 1.2 && (l.current = !0), q == null || q(r), ft(r);
113
113
  }, bt = () => {
@@ -115,19 +115,19 @@ function Dt({
115
115
  };
116
116
  return N(() => {
117
117
  var u;
118
- const r = Array.from(((u = A.current) == null ? void 0 : u.getElementsByTagName("img")) || []), t = (s) => {
119
- s.preventDefault(), l.current = !0, b(!0);
118
+ const r = Array.from(((u = D.current) == null ? void 0 : u.getElementsByTagName("img")) || []), t = (s) => {
119
+ s.preventDefault(), l.current = !0, Y(!0);
120
120
  const a = s.currentTarget, d = s.deltaY > 0 ? -0.1 : 0.1, m = Math.min(
121
- Math.max(U.current, e.current + d),
122
- k.current
123
- ), { left: f, top: g, width: p, height: D } = a.getBoundingClientRect(), F = p / e.current, X = D / e.current, I = s.clientX - f - p / 2, G = s.clientY - g - D / 2, z = m / e.current;
124
- n.current -= I * (z - 1), c.current -= G * (z - 1), e.current = m, S(m);
121
+ Math.max(k.current, e.current + d),
122
+ tt.current
123
+ ), { left: f, top: g, width: p, height: S } = a.getBoundingClientRect(), F = p / e.current, R = S / e.current, I = s.clientX - f - p / 2, O = s.clientY - g - S / 2, z = m / e.current;
124
+ n.current -= I * (z - 1), c.current -= O * (z - 1), e.current = m, b(m);
125
125
  const L = Math.max(
126
126
  0,
127
127
  (F * e.current - o.current.offsetWidth) / 2
128
128
  ), j = Math.max(
129
129
  0,
130
- (X * e.current - o.current.offsetHeight) / 2
130
+ (R * e.current - o.current.offsetHeight) / 2
131
131
  );
132
132
  n.current = Math.min(
133
133
  Math.max(n.current, -L),
@@ -136,23 +136,23 @@ function Dt({
136
136
  Math.max(c.current, -j),
137
137
  j
138
138
  ), l.current = !0, a.style.cursor = "grab", a.style.transition = "none", a.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`, C.current && cancelAnimationFrame(C.current), C.current = requestAnimationFrame(() => {
139
- const R = e.current;
140
- if (R > 1) {
141
- const T = Math.max(
139
+ const T = e.current;
140
+ if (T > 1) {
141
+ const H = Math.max(
142
142
  0,
143
143
  (F * e.current - o.current.offsetWidth) / 2
144
- ), H = Math.max(
144
+ ), P = Math.max(
145
145
  0,
146
- (X * e.current - o.current.offsetHeight) / 2
146
+ (R * e.current - o.current.offsetHeight) / 2
147
147
  );
148
148
  n.current = Math.min(
149
- Math.max(n.current, -T),
150
- T
151
- ), c.current = Math.min(
152
- Math.max(c.current, -H),
149
+ Math.max(n.current, -H),
153
150
  H
151
+ ), c.current = Math.min(
152
+ Math.max(c.current, -P),
153
+ P
154
154
  ), a.style.cursor = "default", a.style.transition = "transform 0.3s", a.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`;
155
- } else R <= 1.2 && (n.current = 0, c.current = 0, y.current = 0, M.current = 0, e.current = 1, l.current = !1, h.current = !1, S(1), b(!1), a.style.cursor = "default", a.style.transition = "transform 0.3s", a.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`);
155
+ } else T <= 1.2 && (n.current = 0, c.current = 0, y.current = 0, M.current = 0, e.current = 1, l.current = !1, h.current = !1, b(1), Y(!1), a.style.cursor = "default", a.style.transition = "transform 0.3s", a.style.transform = `translate3d(${n.current}px, ${c.current}px, 0) scale(${e.current})`);
156
156
  });
157
157
  };
158
158
  return r.forEach((s) => {
@@ -162,35 +162,35 @@ function Dt({
162
162
  s.removeEventListener("wheel", t);
163
163
  });
164
164
  };
165
- }, [ot]), N(() => {
165
+ }, [lt]), N(() => {
166
166
  const r = () => {
167
167
  var u;
168
- const t = (u = A.current) == null ? void 0 : u.offsetHeight;
168
+ const t = (u = D.current) == null ? void 0 : u.offsetHeight;
169
169
  t && mt(`${t}px`);
170
170
  };
171
171
  return r(), window.addEventListener("resize", r), () => {
172
172
  window.removeEventListener("resize", r);
173
173
  };
174
- }, []), N(() => ($ ? w.current = requestAnimationFrame(() => {
175
- Q(!0);
176
- }) : Q(!1), () => {
177
- w.current && cancelAnimationFrame(w.current);
178
- }), [$]), N(() => ($ && (e.current = 1, S(1), b(!1), n.current = 0, c.current = 0, y.current = 0, M.current = 0, l.current = !1, h.current = !1), () => {
179
- C.current && cancelAnimationFrame(C.current), w.current && cancelAnimationFrame(w.current);
180
- }), [$]), /* @__PURE__ */ O(
174
+ }, []), N(() => (w ? X.current = requestAnimationFrame(() => {
175
+ _(!0);
176
+ }) : _(!1), () => {
177
+ X.current && cancelAnimationFrame(X.current);
178
+ }), [w]), N(() => (w && (e.current = 1, b(1), Y(!1), n.current = 0, c.current = 0, y.current = 0, M.current = 0, l.current = !1, h.current = !1), () => {
179
+ C.current && cancelAnimationFrame(C.current), X.current && cancelAnimationFrame(X.current);
180
+ }), [w]), /* @__PURE__ */ B(
181
181
  Xt,
182
182
  {
183
183
  ref: o,
184
- open: $,
185
- onClose: V,
184
+ open: w,
185
+ onClose: Z,
186
186
  fullScreen: !0,
187
187
  hideStatusBar: !0,
188
188
  hideSystemNavigationBar: !0,
189
189
  "aria-modal": !0,
190
- "aria-labelledby": J ? "media-dialog-title" : void 0,
191
- ...v,
190
+ "aria-labelledby": K ? "media-dialog-title" : void 0,
191
+ ...E,
192
192
  inlineCSS: {
193
- backgroundColor: it.black,
193
+ backgroundColor: ot.black,
194
194
  scrollbarWidth: "none",
195
195
  "&::-webkit-scrollbar": {
196
196
  display: "none"
@@ -201,11 +201,11 @@ function Dt({
201
201
  display: "none"
202
202
  }
203
203
  },
204
- ...v == null ? void 0 : v.inlineCSS
204
+ ...E == null ? void 0 : E.inlineCSS
205
205
  },
206
206
  children: [
207
207
  /* @__PURE__ */ x(
208
- Y,
208
+ $,
209
209
  {
210
210
  "aria-hidden": !0,
211
211
  inlineCSS: {
@@ -214,13 +214,13 @@ function Dt({
214
214
  left: 0,
215
215
  width: "100%",
216
216
  minHeight: "var(--status-bar-height, 0px)",
217
- backgroundColor: K.dimmed01,
217
+ backgroundColor: Q.dimmed01,
218
218
  zIndex: 2
219
219
  }
220
220
  }
221
221
  ),
222
222
  /* @__PURE__ */ x(
223
- Y,
223
+ $,
224
224
  {
225
225
  tag: "header",
226
226
  inlineCSS: {
@@ -228,11 +228,11 @@ function Dt({
228
228
  top: "var(--status-bar-height, 0px)",
229
229
  left: 0,
230
230
  width: "100%",
231
- backgroundColor: K.dimmed01,
231
+ backgroundColor: Q.dimmed01,
232
232
  zIndex: 2
233
233
  },
234
- children: /* @__PURE__ */ O(
235
- Y,
234
+ children: /* @__PURE__ */ B(
235
+ $,
236
236
  {
237
237
  alignItems: "center",
238
238
  p: 2,
@@ -245,9 +245,9 @@ function Dt({
245
245
  maxHeight: 56
246
246
  },
247
247
  children: [
248
- /* @__PURE__ */ x(Y, {}),
248
+ /* @__PURE__ */ x($, {}),
249
249
  /* @__PURE__ */ x(
250
- ct,
250
+ at,
251
251
  {
252
252
  id: "media-dialog-title",
253
253
  tag: "div",
@@ -258,19 +258,19 @@ function Dt({
258
258
  inlineCSS: {
259
259
  flexGrow: 1
260
260
  },
261
- children: J
261
+ children: K
262
262
  }
263
263
  ),
264
- /* @__PURE__ */ x(Y, { justifyContent: "flex-end", children: /* @__PURE__ */ x($t, { name: "CloseLine", color: "tertiary", onClick: V, "aria-label": "창 닫기" }) })
264
+ /* @__PURE__ */ x($, { justifyContent: "flex-end", children: /* @__PURE__ */ x($t, { name: "CloseLine", color: "tertiary", onClick: Z, "aria-label": "창 닫기" }) })
265
265
  ]
266
266
  }
267
267
  )
268
268
  }
269
269
  ),
270
270
  /* @__PURE__ */ x(
271
- Y,
271
+ $,
272
272
  {
273
- ref: A,
273
+ ref: D,
274
274
  alignItems: "center",
275
275
  justifyContent: "center",
276
276
  inlineCSS: {
@@ -285,28 +285,29 @@ function Dt({
285
285
  {
286
286
  onSwipe: St,
287
287
  onSwiping: bt,
288
- initialPage: Z,
289
- loop: st,
288
+ initialPage: J,
289
+ loop: ut,
290
290
  disableSwipe: gt,
291
291
  children: dt.map(
292
- (r) => {
293
- var t, u, s, a, d, m, f, g, p;
292
+ (r, t) => {
293
+ var u, s, a, d, m, f, g, p, S;
294
294
  return Yt(r, {
295
- fallback: ut,
295
+ fallback: it,
296
296
  ...r.props,
297
297
  imageProps: {
298
298
  ...r.props.imageProps,
299
- onMouseDown: xt((t = r.props.imageProps) == null ? void 0 : t.onMouseDown),
300
- onMouseMove: yt((u = r.props.imageProps) == null ? void 0 : u.onMouseMove),
301
- onMouseUp: tt((s = r.props.imageProps) == null ? void 0 : s.onMouseUp),
302
- onMouseOut: tt((a = r.props.imageProps) == null ? void 0 : a.onMouseOut),
303
- onTouchStart: Mt((d = r.props.imageProps) == null ? void 0 : d.onTouchStart),
304
- onTouchMove: Ct((m = r.props.imageProps) == null ? void 0 : m.onTouchMove),
305
- onTouchEnd: rt((f = r.props.imageProps) == null ? void 0 : f.onTouchEnd),
306
- onTouchCancel: rt((g = r.props.imageProps) == null ? void 0 : g.onTouchCancel),
299
+ lazy: G - 1 > t || G + 1 < t,
300
+ onMouseDown: xt((u = r.props.imageProps) == null ? void 0 : u.onMouseDown),
301
+ onMouseMove: yt((s = r.props.imageProps) == null ? void 0 : s.onMouseMove),
302
+ onMouseUp: rt((a = r.props.imageProps) == null ? void 0 : a.onMouseUp),
303
+ onMouseOut: rt((d = r.props.imageProps) == null ? void 0 : d.onMouseOut),
304
+ onTouchStart: Mt((m = r.props.imageProps) == null ? void 0 : m.onTouchStart),
305
+ onTouchMove: Ct((f = r.props.imageProps) == null ? void 0 : f.onTouchMove),
306
+ onTouchEnd: et((g = r.props.imageProps) == null ? void 0 : g.onTouchEnd),
307
+ onTouchCancel: et((p = r.props.imageProps) == null ? void 0 : p.onTouchCancel),
307
308
  style: {
308
309
  maxHeight: ht,
309
- ...(p = r.props.imageProps) == null ? void 0 : p.style
310
+ ...(S = r.props.imageProps) == null ? void 0 : S.style
310
311
  }
311
312
  }
312
313
  });
@@ -317,9 +318,9 @@ function Dt({
317
318
  }
318
319
  ),
319
320
  pt,
320
- /* @__PURE__ */ O(ct, { role: "status", visuallyHidden: !0, children: [
321
- _ > 1 && "이미지가 확대되었어요.",
322
- _ <= 1 && "이미지가 원래 크기로 복원되었어요."
321
+ /* @__PURE__ */ B(at, { role: "status", visuallyHidden: !0, children: [
322
+ U > 1 && "이미지가 확대되었어요.",
323
+ U <= 1 && "이미지가 원래 크기로 복원되었어요."
323
324
  ] })
324
325
  ]
325
326
  }