vistaview 0.6.6 → 0.7.0

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/vistaview.js CHANGED
@@ -1,31 +1,31 @@
1
- var W = Object.defineProperty;
2
- var A = (s, t, e) => t in s ? W(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
- var l = (s, t, e) => A(s, typeof t != "symbol" ? t + "" : t, e);
4
- function $(s) {
1
+ var F = Object.defineProperty;
2
+ var A = (s, t, e) => t in s ? F(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var h = (s, t, e) => A(s, typeof t != "symbol" ? t + "" : t, e);
4
+ function S(s) {
5
5
  return s && !/^0(px|%|r?em|vw|vh|vmin|vmax|cm|mm|in|pt|pc|ex|ch)?$/i.test(s.trim()) && s;
6
6
  }
7
- function F(s) {
8
- const e = window.getComputedStyle(s).objectFit || "", { width: i, height: n } = s.getBoundingClientRect(), o = s.naturalWidth, a = s.naturalHeight;
7
+ function z(s) {
8
+ const e = window.getComputedStyle(s).objectFit || "", { width: n, height: i } = s.getBoundingClientRect(), o = s.naturalWidth, a = s.naturalHeight;
9
9
  if (!e)
10
- return { width: i, height: n };
10
+ return { width: n, height: i };
11
11
  if (!o || !a)
12
- return { width: i, height: n };
13
- const r = o / a, h = i / n;
12
+ return { width: n, height: i };
13
+ const r = o / a, l = n / i;
14
14
  switch (e) {
15
15
  case "fill":
16
- return { width: i, height: n };
16
+ return { width: n, height: i };
17
17
  case "none":
18
18
  return { width: o, height: a };
19
19
  case "contain":
20
- return r > h ? { width: i, height: i / r } : { width: n * r, height: n };
20
+ return r > l ? { width: n, height: n / r } : { width: i * r, height: i };
21
21
  case "cover":
22
- return r < h ? { width: i, height: i / r } : { width: n * r, height: n };
22
+ return r < l ? { width: n, height: n / r } : { width: i * r, height: i };
23
23
  case "scale-down": {
24
- const c = { width: o, height: a }, m = r > h ? { width: i, height: i / r } : { width: n * r, height: n };
24
+ const c = { width: o, height: a }, m = r > l ? { width: n, height: n / r } : { width: i * r, height: i };
25
25
  return m.width <= c.width && m.height <= c.height ? m : c;
26
26
  }
27
27
  }
28
- return { width: i, height: n };
28
+ return { width: n, height: i };
29
29
  }
30
30
  function D(s) {
31
31
  const t = getComputedStyle(s), e = s.getBoundingClientRect();
@@ -42,13 +42,13 @@ function D(s) {
42
42
  naturalHeight: s.naturalHeight
43
43
  };
44
44
  }
45
- function P(s) {
46
- const t = s.imageElm ? D(s.imageElm) : null, e = s.anchorElm ? D(s.anchorElm) : null, i = $(t == null ? void 0 : t.borderRadius), n = e && $(e == null ? void 0 : e.borderRadius), o = (n ? e == null ? void 0 : e.borderRadius : i ? t == null ? void 0 : t.borderRadius : "") || "";
45
+ function k(s) {
46
+ const t = s.imageElm ? D(s.imageElm) : null, e = s.anchorElm ? D(s.anchorElm) : null, n = S(t == null ? void 0 : t.borderRadius), i = e && S(e == null ? void 0 : e.borderRadius), o = (i ? e == null ? void 0 : e.borderRadius : n ? t == null ? void 0 : t.borderRadius : "") || "";
47
47
  return {
48
48
  fit: (t == null ? void 0 : t.objectFit) || (e == null ? void 0 : e.objectFit) || "",
49
49
  pos: (t == null ? void 0 : t.objectPosition) || "",
50
50
  br: o,
51
- overflow: n ? e.overflow : i ? t.overflow : "",
51
+ overflow: i ? e.overflow : n ? t.overflow : "",
52
52
  nw: (t == null ? void 0 : t.naturalWidth) || 0,
53
53
  nh: (t == null ? void 0 : t.naturalHeight) || 0,
54
54
  w: (e == null ? void 0 : e.width) || (t == null ? void 0 : t.width) || 0,
@@ -57,53 +57,53 @@ function P(s) {
57
57
  left: (e == null ? void 0 : e.left) || (t == null ? void 0 : t.left) || 0
58
58
  };
59
59
  }
60
- function H(s, t, e, i = !1) {
60
+ function W(s, t, e, n = !1) {
61
61
  const {
62
- fit: n,
62
+ fit: i,
63
63
  w: o,
64
64
  h: a,
65
65
  // this ones makes things hard. not used.
66
66
  // pos,
67
67
  // overflow,
68
68
  nw: r,
69
- nh: h,
69
+ nh: l,
70
70
  br: c,
71
71
  top: m,
72
- left: w
73
- } = P(s), b = Math.min(Math.max(w, -o), window.innerWidth + o) - window.innerWidth / 2 + o / 2, p = Math.min(Math.max(m, -a), window.innerHeight + a) - window.innerHeight / 2 + a / 2, d = e.style;
74
- d.width = `${o}px`, d.height = `${a}px`, d.objectFit = n, e.width = r, e.height = h, d.setProperty("--vvw-init-radius", `${c}`), d.setProperty("--vvw-pulse-radius", `calc(1.3 * ${c})`), d.setProperty("--vvw-init-x", `${b}px`), d.setProperty("--vvw-init-y", `${p}px`), i && (d.setProperty("--vvw-current-x", `${b}px`), d.setProperty("--vvw-current-y", `${p}px`));
75
- const v = F(s.imageElm), g = Math.min(o, v.width), f = Math.min(a, v.height), u = t.style;
76
- u.setProperty("--vvw-init-radius", `${c}`), u.setProperty("--vvw-init-w", `${g}px`), u.setProperty("--vvw-init-h", `${f}px`), i && (u.setProperty("--vvw-current-radius", `${c}`), u.setProperty("--vvw-current-w", `${g}px`), u.setProperty("--vvw-current-h", `${f}px`), t.dataset.vvwWidth = g.toString(), t.dataset.vvwHeight = f.toString());
72
+ left: p
73
+ } = k(s), L = Math.min(Math.max(p, -o), window.innerWidth + o) - window.innerWidth / 2 + o / 2, g = Math.min(Math.max(m, -a), window.innerHeight + a) - window.innerHeight / 2 + a / 2, d = e.style;
74
+ d.width = `${o}px`, d.height = `${a}px`, d.objectFit = i, e.width = r, e.height = l, d.setProperty("--vvw-init-radius", `${c}`), d.setProperty("--vvw-pulse-radius", `calc(1.3 * ${c})`), d.setProperty("--vvw-init-x", `${L}px`), d.setProperty("--vvw-init-y", `${g}px`), n && (d.setProperty("--vvw-current-x", `${L}px`), d.setProperty("--vvw-current-y", `${g}px`));
75
+ const u = z(s.imageElm), y = Math.min(o, u.width), f = Math.min(a, u.height), v = t.style;
76
+ v.setProperty("--vvw-init-radius", `${c}`), v.setProperty("--vvw-init-w", `${y}px`), v.setProperty("--vvw-init-h", `${f}px`), n && (v.setProperty("--vvw-current-radius", `${c}`), v.setProperty("--vvw-current-w", `${y}px`), v.setProperty("--vvw-current-h", `${f}px`), t.dataset.vvwWidth = y.toString(), t.dataset.vvwHeight = f.toString());
77
77
  }
78
- function S(s) {
79
- const t = window.innerWidth, e = window.innerHeight, i = s.naturalWidth, n = s.naturalHeight;
80
- if (!i || !n)
78
+ function M(s) {
79
+ const t = window.innerWidth, e = window.innerHeight, n = s.naturalWidth, i = s.naturalHeight;
80
+ if (!n || !i)
81
81
  throw new Error("Image natural dimensions are zero");
82
- if (i < t && n < e)
82
+ if (n < t && i < e)
83
83
  return {
84
- width: i,
85
- height: n
84
+ width: n,
85
+ height: i
86
86
  };
87
- const o = i / n, a = t / e;
88
- let r, h;
89
- return o > a ? (r = t, h = t / o) : (h = e, r = e * o), {
87
+ const o = n / i, a = t / e;
88
+ let r, l;
89
+ return o > a ? (r = t, l = t / o) : (l = e, r = e * o), {
90
90
  width: r,
91
- height: h
91
+ height: l
92
92
  };
93
93
  }
94
- function z(s, t, e) {
94
+ function q(s, t, e) {
95
95
  return Math.min(Math.max(s, t), e);
96
96
  }
97
97
  function C(s, t = 2) {
98
98
  const e = Math.pow(10, t);
99
99
  return Math.round(s * e) / e;
100
100
  }
101
- const k = '<svg viewBox="0 0 24 24"><path d="m15 18-6-6 6-6"/></svg>', q = '<svg viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></svg>', R = '<svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/></svg>', O = '<svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="8" x2="14" y1="11" y2="11"/></svg>', Z = '<svg viewBox="0 0 24 24"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>', Y = '<svg viewBox="0 0 24 24"><path d="M12 15V3"/><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5"/></svg>';
102
- let I = null;
103
- function X() {
104
- return I || (window.trustedTypes || (window.trustedTypes = {
101
+ const R = '<svg viewBox="0 0 24 24"><path d="m15 18-6-6 6-6"/></svg>', O = '<svg viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></svg>', Z = '<svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="11" x2="11" y1="8" y2="14"/><line x1="8" x2="14" y1="11" y2="11"/></svg>', X = '<svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="8"/><line x1="21" x2="16.65" y1="21" y2="16.65"/><line x1="8" x2="14" y1="11" y2="11"/></svg>', N = '<svg viewBox="0 0 24 24"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>', Y = '<svg viewBox="0 0 24 24"><path d="M12 15V3"/><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><path d="m7 10 5 5 5-5"/></svg>';
102
+ let $ = null;
103
+ function B() {
104
+ return $ || (window.trustedTypes || (window.trustedTypes = {
105
105
  createPolicy: (s, t) => t
106
- }), I = window.trustedTypes.createPolicy("vistaView-policy", {
106
+ }), $ = window.trustedTypes.createPolicy("vistaView-policy", {
107
107
  createHTML: (s) => s,
108
108
  // HTML is generated by us, not user input
109
109
  createScript: () => {
@@ -112,34 +112,34 @@ function X() {
112
112
  createScriptURL: () => {
113
113
  throw new Error("Not implemented");
114
114
  }
115
- }), I);
115
+ }), $);
116
116
  }
117
- function M(s) {
118
- const e = X().createHTML(s), i = document.createElement("template");
119
- i.innerHTML = e;
120
- const n = i.content;
121
- return i.remove(), n;
117
+ function P(s) {
118
+ const e = B().createHTML(s), n = document.createElement("template");
119
+ n.innerHTML = e;
120
+ const i = n.content;
121
+ return n.remove(), i;
122
122
  }
123
- function N() {
123
+ function j() {
124
124
  return {
125
125
  name: "download",
126
126
  icon: Y,
127
127
  onClick: async (s) => {
128
128
  var o;
129
- const t = await fetch(s.src), e = await t.blob(), i = t.url, n = document.createElement("a");
130
- n.href = URL.createObjectURL(e), n.download = ((o = i.split("/").pop()) == null ? void 0 : o.split("?")[0].split("#")[0]) || "download", document.body.appendChild(n), n.click(), document.body.removeChild(n);
129
+ const t = await fetch(s.src), e = await t.blob(), n = t.url, i = document.createElement("a");
130
+ i.href = URL.createObjectURL(e), i.download = ((o = n.split("/").pop()) == null ? void 0 : o.split("?")[0].split("#")[0]) || "download", document.body.appendChild(i), i.click(), document.body.removeChild(i);
131
131
  }
132
132
  };
133
133
  }
134
- function B(s) {
134
+ function V(s) {
135
135
  if (typeof s == "string")
136
136
  switch (s) {
137
137
  case "zoomIn":
138
- return `<button aria-label="Zoom In" class="vvw-zoom-in vvw-ui">${R}</button>`;
138
+ return `<button aria-label="Zoom In" class="vvw-zoom-in vvw-ui">${Z}</button>`;
139
139
  case "zoomOut":
140
- return `<button aria-label="Zoom Out" disabled class="vvw-zoom-out vvw-ui">${O}</button>`;
140
+ return `<button aria-label="Zoom Out" disabled class="vvw-zoom-out vvw-ui">${X}</button>`;
141
141
  case "close":
142
- return `<button aria-label="Close" class="vvw-close vvw-ui">${Z}</button>`;
142
+ return `<button aria-label="Close" class="vvw-close vvw-ui">${N}</button>`;
143
143
  case "indexDisplay":
144
144
  return '<div class="vvw-index vvw-ui" aria-hidden="true"></div>';
145
145
  case "description":
@@ -149,35 +149,35 @@ function B(s) {
149
149
  }
150
150
  return `<button class="vvw-ui" aria-label="${s.description || s.name}" data-vvw-control="${s.name}">${s.icon}</button>`;
151
151
  }
152
- function j(s, t) {
152
+ function U(s, t) {
153
153
  const e = document.createElement("div");
154
154
  e.className = "vvw-item", e.dataset.vvwPos = `${t !== void 0 ? t : ""}`, e.dataset.vvwIdx = s.index.toString(), e.appendChild(
155
- M(
155
+ P(
156
156
  `<img class="vvw-img-lo" src="${s.thumb || s.src}" alt="${s.alt || ""}" />
157
157
  <img class="vvw-img-hi" src="${s.src}" alt="${s.alt || ""}" />`
158
158
  )
159
159
  );
160
- const i = e.querySelector("img.vvw-img-lo"), n = e.querySelector("img.vvw-img-hi");
161
- return H(s, n, i, t === 0), e;
160
+ const n = e.querySelector("img.vvw-img-lo"), i = e.querySelector("img.vvw-img-hi");
161
+ return W(s, i, n, t === 0), e;
162
162
  }
163
- function U({
163
+ function K({
164
164
  controls: s
165
165
  }) {
166
- const t = (i) => i ? i.map(B).join("") : "";
167
- return M(
166
+ const t = (n) => n ? n.map(V).join("") : "";
167
+ return P(
168
168
  `<div class="vvw-root" id="vvw-root">
169
169
  <div class="vvw-container">
170
170
  <div class="vvw-bg"></div>
171
171
  <div class="vvw-image-container"></div>
172
172
  <div class="vvw-top-bar"><div>${t(s == null ? void 0 : s.topLeft)}</div><div>${t(s == null ? void 0 : s.topCenter)}</div><div>${t(s == null ? void 0 : s.topRight)}</div></div>
173
173
  <div class="vvw-bottom-bar"><div>${t(s == null ? void 0 : s.bottomLeft)}</div><div>${t(s == null ? void 0 : s.bottomCenter)}</div><div>${t(s == null ? void 0 : s.bottomRight)}</div></div>
174
- <div class="vvw-prev vvw-ui"><button aria-label="Previous">${k}</button></div>
175
- <div class="vvw-next vvw-ui"><button aria-label="Next">${q}</button></div>
174
+ <div class="vvw-prev vvw-ui"><button aria-label="Previous">${R}</button></div>
175
+ <div class="vvw-next vvw-ui"><button aria-label="Next">${O}</button></div>
176
176
  </div>
177
177
  </div>`
178
178
  );
179
179
  }
180
- const T = {
180
+ const H = {
181
181
  // debug, don't remove
182
182
  // animationDurationBase: 1000,
183
183
  animationDurationBase: 333,
@@ -188,90 +188,98 @@ const T = {
188
188
  rapidLimit: 222,
189
189
  controls: {
190
190
  topLeft: ["indexDisplay"],
191
- topRight: ["zoomIn", "zoomOut", N(), "close"],
191
+ topRight: ["zoomIn", "zoomOut", j(), "close"],
192
192
  bottomLeft: ["description"]
193
193
  }
194
194
  };
195
- function K(s) {
196
- }
197
195
  function _(s) {
198
- const t = s.options.preloads;
199
- s.imageContainer.style.width = `${(t * 2 + 1) * 100}vw`, s.imageContainer.style.left = `-${t * 100}vw`, s.imageContainer.style.display = "flex", G(s);
200
196
  }
201
197
  function G(s) {
202
- let t = { x: 0, y: 0 }, e = { x: 0, y: 0 }, i = null;
203
- s.registerPointerListener((n) => {
204
- if (!n.hasInternalExecution && !(n.pointers.length > 1)) {
205
- if (n.event === "down" && (t = { x: n.pointer.x, y: n.pointer.y }, e = { x: n.pointer.x, y: n.pointer.y }), n.event === "move") {
206
- e = { x: n.pointer.x, y: n.pointer.y };
207
- const o = e.x - t.x, a = e.y - t.y;
208
- if (!i && Math.abs(a) > Math.abs(o) || i === "y") {
209
- const r = a / window.innerHeight * 100;
210
- s.imageContainer.style.transition = "none", s.imageContainer.style.transform = `translateY(${r}vh)`, i = "y";
211
- } else if (!i && Math.abs(o) > Math.abs(a) || i === "x") {
212
- const r = o / window.innerWidth * 100;
213
- s.imageContainer.style.transition = "none", s.imageContainer.style.transform = `translateX(${r}vw)`, i = "x";
198
+ const t = s.options.preloads;
199
+ s.imageContainer.style.width = `${(t * 2 + 1) * 100}vw`, s.imageContainer.style.left = `-${t * 100}vw`, s.imageContainer.style.display = "flex", J(s);
200
+ }
201
+ function J(s) {
202
+ let t = { x: 0, y: 0 }, e = { x: 0, y: 0 }, n = null;
203
+ s.registerPointerListener((i) => {
204
+ var o;
205
+ if (!i.hasInternalExecution && !(i.pointers.length > 1)) {
206
+ if (i.event === "down" && (t = { x: i.pointer.x, y: i.pointer.y }, e = { x: i.pointer.x, y: i.pointer.y }, (o = i.abortController) == null || o.abort()), i.event === "move") {
207
+ e = { x: i.pointer.x, y: i.pointer.y };
208
+ const a = e.x - t.x, r = e.y - t.y;
209
+ if (!n && Math.abs(r) > Math.abs(a) || n === "y") {
210
+ const l = r / window.innerHeight * 100;
211
+ s.imageContainer.style.transition = "none", s.imageContainer.style.transform = `translateY(${l}vh)`, n = "y";
212
+ } else if (!n && Math.abs(a) > Math.abs(r) || n === "x") {
213
+ const l = a / window.innerWidth * 100;
214
+ s.imageContainer.style.transition = "none", s.imageContainer.style.transform = `translateX(${l}vw)`, n = "x";
214
215
  }
215
216
  }
216
- if (n.event === "up" || n.event === "cancel") {
217
- let o = function(a) {
218
- var r;
219
- (r = s.imageContainer) == null || r.addEventListener("transitionend", function h() {
220
- var c;
221
- (c = s.imageContainer) == null || c.removeEventListener("transitionend", h), s.imageContainer.style.transition = "", s.imageContainer.style.transform = "";
222
- }), s.imageContainer.style.transition = "transform 222ms ease", s.imageContainer.style.transform = a;
217
+ if (i.event === "up" || i.event === "cancel") {
218
+ let a = function(r) {
219
+ var l;
220
+ (l = s.imageContainer) == null || l.addEventListener("transitionend", function c() {
221
+ var m;
222
+ (m = s.imageContainer) == null || m.removeEventListener("transitionend", c), s.imageContainer.style.transition = "", s.imageContainer.style.transform = "";
223
+ }), s.imageContainer.style.transition = "transform 222ms ease", s.imageContainer.style.transform = r;
223
224
  };
224
- if (i === "y") {
225
- const a = e.y - t.y, r = n.pointer.movementY, h = 8;
226
- s.imageContainer.style.transition = "", a > 0 && Math.abs(r) > h || a < 0 && Math.abs(r) > h ? (s.imageContainer.style.transition = "transform 222ms ease", s.imageContainer.style.transform = "translateY(0vh)", s.close()) : o("translateY(0vh)");
225
+ if (n === "y") {
226
+ const r = e.y - t.y;
227
+ Math.abs(r) > 144 ? (s.imageContainer.style.transition = "transform 222ms ease", s.imageContainer.style.transform = "translateY(0vh)", s.close()) : a("translateY(0vh)");
227
228
  }
228
- if (i === "x") {
229
- const a = e.x - t.x, r = n.pointer.movementX, h = 8;
230
- s.imageContainer.style.transition = "", a > 0 && Math.abs(r) > h ? s.prev() : a < 0 && Math.abs(r) > h ? s.next() : o("translateX(0vw)");
229
+ if (n === "x") {
230
+ const r = e.x - t.x, l = i.pointer.movementX, c = 1;
231
+ s.imageContainer.style.transition = "", r > 0 && Math.abs(l) > c ? s.prev() : r < 0 && Math.abs(l) > c ? s.next() : a("translateX(0vw)");
231
232
  }
232
- i = null, t = { x: 0, y: 0 }, e = { x: 0, y: 0 };
233
+ n = null, t = { x: 0, y: 0 }, e = { x: 0, y: 0 };
233
234
  }
234
235
  }
235
236
  });
236
237
  }
237
- function J(s) {
238
+ function Q(s) {
238
239
  }
239
- async function Q({
240
+ function tt({
240
241
  vistaView: { isReducedMotion: s },
241
242
  htmlElements: { to: t },
242
- index: { from: e, to: i },
243
- vistaView: { elements: n, imageContainer: o, options: a }
243
+ index: { from: e, to: n },
244
+ vistaView: { elements: i, imageContainer: o, options: a }
244
245
  }, r) {
245
- if (!t || r.aborted || s || !(Math.abs(i - e) === 1 || e === 0 && i === n.length - 1 || e === n.length - 1 && i === 0))
246
- return;
247
- const c = Math.round(a.animationDurationBase * 100) / 100;
248
- return new Promise((m) => {
249
- o.addEventListener(
250
- "transitionend",
251
- () => {
252
- m(() => {
253
- o.style.transition = "", o.style.transform = "";
254
- });
246
+ if (!(!t || r.aborted || s || !(Math.abs(n - e) === 1 || e === 0 && n === i.length - 1 || e === i.length - 1 && n === 0)))
247
+ return {
248
+ cleanup: () => {
249
+ o.style.transition = "", o.style.transform = "";
255
250
  },
256
- { once: !0 }
257
- );
258
- const w = i === e + 1 || e === n.length - 1 && i === 0 ? "translateX(-100vw)" : "translateX(100vw)";
259
- o.style.transition = `transform ${c}ms ease`, o.style.transform = w;
260
- });
251
+ transitionEnded: new Promise((c) => {
252
+ o.addEventListener(
253
+ "transitionend",
254
+ () => {
255
+ c();
256
+ },
257
+ { once: !0 }
258
+ ), o.addEventListener(
259
+ "transitioncancel",
260
+ () => {
261
+ r.aborted && c();
262
+ },
263
+ { once: !0 }
264
+ );
265
+ const m = Math.round(a.animationDurationBase * 100) / 100, p = n === e + 1 || e === i.length - 1 && n === 0 ? "translateX(-100vw)" : "translateX(100vw)";
266
+ o.style.transition = `transform ${m}ms ease`, o.style.transform = p;
267
+ })
268
+ };
261
269
  }
262
- class V {
270
+ class et {
263
271
  constructor({ elm: t, listeners: e }) {
264
- l(this, "pointers", []);
265
- l(this, "elm");
266
- l(this, "listeners", []);
267
- l(this, "lastPointerDownId", null);
268
- l(this, "removeLastPointer", () => {
272
+ h(this, "pointers", []);
273
+ h(this, "elm");
274
+ h(this, "listeners", []);
275
+ h(this, "lastPointerDownId", null);
276
+ h(this, "removeLastPointer", () => {
269
277
  if (this.pointers.length && this.lastPointerDownId !== null) {
270
278
  const t = this.pointers.findIndex((e) => e.id === this.lastPointerDownId);
271
279
  t !== -1 && this.pointers.splice(t, 1);
272
280
  }
273
281
  });
274
- l(this, "onPointerDown", (t) => {
282
+ h(this, "onPointerDown", (t) => {
275
283
  if (!this.listeners.length || t.button !== 0) return;
276
284
  t.preventDefault(), this.lastPointerDownId = t.pointerId, window.addEventListener("contextmenu", this.removeLastPointer, { once: !0 }), window.addEventListener("auxclick", this.removeLastPointer, { once: !0 });
277
285
  let e = {
@@ -282,7 +290,7 @@ class V {
282
290
  id: t.pointerId
283
291
  };
284
292
  this.pointers.push(e), this.listeners.forEach(
285
- (i) => i({
293
+ (n) => n({
286
294
  event: "down",
287
295
  pointer: e,
288
296
  pointers: this.pointers,
@@ -290,12 +298,12 @@ class V {
290
298
  })
291
299
  );
292
300
  });
293
- l(this, "onPointerMove", (t) => {
301
+ h(this, "onPointerMove", (t) => {
294
302
  if (!this.listeners.length) return;
295
303
  t.preventDefault();
296
- const e = this.pointers.find((i) => i.id === t.pointerId);
304
+ const e = this.pointers.find((n) => n.id === t.pointerId);
297
305
  e && (e.movementX = t.movementX, e.movementY = t.movementY, e.x = t.clientX, e.y = t.clientY, this.listeners.forEach(
298
- (i) => i({
306
+ (n) => n({
299
307
  event: "move",
300
308
  pointer: e,
301
309
  pointers: this.pointers,
@@ -303,39 +311,39 @@ class V {
303
311
  })
304
312
  ));
305
313
  });
306
- l(this, "onPointerUp", (t) => {
314
+ h(this, "onPointerUp", (t) => {
307
315
  if (!this.listeners.length || t.button !== 0 || (window.removeEventListener("contextmenu", this.removeLastPointer), window.removeEventListener("auxclick", this.removeLastPointer), t.target instanceof Node && !this.elm.contains(t.target) && t.target !== document.querySelector("html") && t.target !== document))
308
316
  return;
309
317
  t.preventDefault();
310
318
  const e = this.pointers.findIndex((o) => o.id === t.pointerId);
311
319
  if (e === -1) return;
312
- const i = this.pointers[e];
313
- i.x = t.clientX, i.y = t.clientY;
314
- const n = this.pointers.length;
320
+ const n = this.pointers[e];
321
+ n.x = t.clientX, n.y = t.clientY;
322
+ const i = this.pointers.length;
315
323
  this.pointers.splice(e, 1), this.listeners.forEach(
316
324
  (o) => o({
317
325
  event: "up",
318
- pointer: i,
326
+ pointer: n,
319
327
  pointers: this.pointers,
320
- lastPointerLen: n
328
+ lastPointerLen: i
321
329
  })
322
330
  );
323
331
  });
324
- l(this, "onPointerCancel", (t) => {
332
+ h(this, "onPointerCancel", (t) => {
325
333
  if (!this.listeners.length || t.target instanceof Node && !this.elm.contains(t.target) && t.target !== document.querySelector("html") && t.target !== document)
326
334
  return;
327
335
  t.preventDefault();
328
336
  const e = this.pointers.findIndex((o) => o.id === t.pointerId);
329
337
  if (e === -1) return;
330
- const i = this.pointers[e];
331
- i.x = t.clientX, i.y = t.clientY;
332
- const n = this.pointers.length;
338
+ const n = this.pointers[e];
339
+ n.x = t.clientX, n.y = t.clientY;
340
+ const i = this.pointers.length;
333
341
  this.pointers.splice(e, 1), this.listeners.forEach(
334
342
  (o) => o({
335
343
  event: "cancel",
336
- pointer: i,
344
+ pointer: n,
337
345
  pointers: this.pointers,
338
- lastPointerLen: n
346
+ lastPointerLen: i
339
347
  })
340
348
  );
341
349
  });
@@ -354,13 +362,13 @@ class V {
354
362
  this.listeners = this.listeners.filter((e) => e !== t);
355
363
  }
356
364
  getPointerDistance(t, e) {
357
- const i = t.x - e.x, n = t.y - e.y;
358
- return Math.sqrt(i * i + n * n);
365
+ const n = t.x - e.x, i = t.y - e.y;
366
+ return Math.sqrt(n * n + i * i);
359
367
  }
360
368
  getCentroid() {
361
369
  if (this.pointers.length === 0) return null;
362
370
  const t = this.pointers.reduce(
363
- (e, i) => (e.x += i.x, e.y += i.y, e),
371
+ (e, n) => (e.x += n.x, e.y += n.y, e),
364
372
  { x: 0, y: 0 }
365
373
  );
366
374
  return {
@@ -369,20 +377,20 @@ class V {
369
377
  };
370
378
  }
371
379
  }
372
- class tt {
380
+ class it {
373
381
  constructor(t, e) {
374
- l(this, "maxZoomLevel");
375
- l(this, "image", null);
376
- l(this, "rect", null);
377
- l(this, "initialCenter", { x: 0, y: 0 });
378
- l(this, "maxDimension", { width: 0 });
379
- l(this, "minDimension", { initialWidth: 0, initialHeight: 0, minWidth: 0, closingWidth: 0 });
380
- l(this, "accumulatedTranslate", { x: 0, y: 0 });
382
+ h(this, "maxZoomLevel");
383
+ h(this, "image", null);
384
+ h(this, "rect", null);
385
+ h(this, "initialCenter", { x: 0, y: 0 });
386
+ h(this, "maxDimension", { width: 0 });
387
+ h(this, "minDimension", { initialWidth: 0, initialHeight: 0, minWidth: 0, closingWidth: 0 });
388
+ h(this, "accumulatedTranslate", { x: 0, y: 0 });
381
389
  // state
382
- l(this, "scale", 1);
383
- l(this, "translate", { x: 0, y: 0 });
384
- l(this, "onScale", null);
385
- l(this, "animationTimestamp", 0);
390
+ h(this, "scale", 1);
391
+ h(this, "translate", { x: 0, y: 0 });
392
+ h(this, "onScale", null);
393
+ h(this, "animationTimestamp", 0);
386
394
  this.maxZoomLevel = t, this.onScale = e;
387
395
  }
388
396
  clean() {
@@ -396,10 +404,10 @@ class tt {
396
404
  width: t.naturalWidth * this.maxZoomLevel
397
405
  }, !t.dataset.vvwWidth || !t.dataset.vvwHeight)
398
406
  throw new Error("VistaImageState: Image dataset vvwWidth or vvwHeight not set.");
399
- const e = parseFloat(t.dataset.vvwWidth), i = parseFloat(t.dataset.vvwHeight);
407
+ const e = parseFloat(t.dataset.vvwWidth), n = parseFloat(t.dataset.vvwHeight);
400
408
  this.minDimension = {
401
409
  initialWidth: e,
402
- initialHeight: i,
410
+ initialHeight: n,
403
411
  minWidth: e * 0.1,
404
412
  closingWidth: e * 0.5
405
413
  }, this.accumulatedTranslate = { x: 0, y: 0 };
@@ -410,79 +418,79 @@ class tt {
410
418
  move(t) {
411
419
  this.image && (this.rect || (this.rect = this.image.getBoundingClientRect()), this.translate.x = C(t.x - this.initialCenter.x), this.translate.y = C(t.y - this.initialCenter.y), this.image.style.transform = `translate3d(${this.translate.x}px, ${this.translate.y}px, 0px) scale(${this.scale})`);
412
420
  }
413
- snapToTargetIfClose(t, e, i = 1) {
414
- return Math.abs(t - e) <= i && (t = e), t;
421
+ snapToTargetIfClose(t, e, n = 1) {
422
+ return Math.abs(t - e) <= n && (t = e), t;
415
423
  }
416
424
  scaleMove(t, e) {
417
425
  if (!this.image) return;
418
426
  this.rect || (this.rect = this.image.getBoundingClientRect()), e || (e = this.initialCenter);
419
- const i = this.snapToTargetIfClose(
420
- z(this.rect.width * t, this.minDimension.minWidth, this.maxDimension.width),
427
+ const n = this.snapToTargetIfClose(
428
+ q(this.rect.width * t, this.minDimension.minWidth, this.maxDimension.width),
421
429
  this.minDimension.initialWidth
422
430
  );
423
431
  this.onScale && this.onScale({
424
- scale: i / (this.maxDimension.width / this.maxZoomLevel),
425
- isMax: i >= this.maxDimension.width,
426
- isMin: i <= this.minDimension.initialWidth
427
- }), this.scale = C(i / this.rect.width);
428
- const n = this.rect.left + this.rect.width / 2, o = this.rect.top + this.rect.height / 2, a = this.initialCenter.x - n, r = this.initialCenter.y - o, h = a * (1 - this.scale), c = r * (1 - this.scale), m = e.x - this.initialCenter.x, w = e.y - this.initialCenter.y;
429
- this.translate.x = C(h + m), this.translate.y = C(c + w), this.image.style.transform = `translate3d(${this.translate.x}px, ${this.translate.y}px, 0px) scale(${this.scale})`, i <= this.minDimension.closingWidth ? this.image.style.opacity = "0.5" : this.image.style.opacity = "";
432
+ scale: n / (this.maxDimension.width / this.maxZoomLevel),
433
+ isMax: n >= this.maxDimension.width,
434
+ isMin: n <= this.minDimension.initialWidth
435
+ }), this.scale = C(n / this.rect.width);
436
+ const i = this.rect.left + this.rect.width / 2, o = this.rect.top + this.rect.height / 2, a = this.initialCenter.x - i, r = this.initialCenter.y - o, l = a * (1 - this.scale), c = r * (1 - this.scale), m = e.x - this.initialCenter.x, p = e.y - this.initialCenter.y;
437
+ this.translate.x = C(l + m), this.translate.y = C(c + p), this.image.style.transform = `translate3d(${this.translate.x}px, ${this.translate.y}px, 0px) scale(${this.scale})`, n <= this.minDimension.closingWidth ? this.image.style.opacity = "0.5" : this.image.style.opacity = "";
430
438
  }
431
439
  moveAndNormalize(t) {
432
- let e = 0, i = !1;
433
- const n = ({ x: o, y: a }) => {
434
- if (i)
440
+ let e = 0, n = !1;
441
+ const i = ({ x: o, y: a }) => {
442
+ if (n)
435
443
  return;
436
444
  if (Math.abs(o) < 1e-3 && Math.abs(a) < 1e-3)
437
445
  return this.normalize();
438
446
  o *= 0.9, a *= 0.9;
439
447
  const r = this.image.getBoundingClientRect();
440
- this.translate.x = C(this.translate.x + o), this.translate.y = C(this.translate.y + a), r.right < window.innerWidth / 2 && (this.translate.x += (window.innerWidth / 2 - r.right) * 0.1, o *= 0.7), r.left > window.innerWidth / 2 && (this.translate.x -= (r.left - window.innerWidth / 2) * 0.1, o *= 0.7), r.bottom < window.innerHeight / 2 && (this.translate.y += (window.innerHeight / 2 - r.bottom) * 0.1, a *= 0.7), r.top > window.innerHeight / 2 && (this.translate.y -= (r.top - window.innerHeight / 2) * 0.1, a *= 0.7), this.image.style.transform = `translate3d(${this.translate.x}px, ${this.translate.y}px, 0px) scale(${this.scale})`, e = requestAnimationFrame(() => n({ x: o, y: a }));
448
+ this.translate.x = C(this.translate.x + o), this.translate.y = C(this.translate.y + a), r.right < window.innerWidth / 2 && (this.translate.x += (window.innerWidth / 2 - r.right) * 0.1, o *= 0.7), r.left > window.innerWidth / 2 && (this.translate.x -= (r.left - window.innerWidth / 2) * 0.1, o *= 0.7), r.bottom < window.innerHeight / 2 && (this.translate.y += (window.innerHeight / 2 - r.bottom) * 0.1, a *= 0.7), r.top > window.innerHeight / 2 && (this.translate.y -= (r.top - window.innerHeight / 2) * 0.1, a *= 0.7), this.image.style.transform = `translate3d(${this.translate.x}px, ${this.translate.y}px, 0px) scale(${this.scale})`, e = requestAnimationFrame(() => i({ x: o, y: a }));
441
449
  };
442
- return n({
450
+ return i({
443
451
  x: t.movementX,
444
452
  y: t.movementY
445
453
  }), () => {
446
- i = !0, cancelAnimationFrame(e), this.normalize(!1);
454
+ n = !0, cancelAnimationFrame(e), this.normalize(!1);
447
455
  };
448
456
  }
449
457
  animateZoom(t) {
450
458
  if (!this.image) return;
451
459
  this.rect || (this.rect = this.image.getBoundingClientRect());
452
- const e = Date.now(), i = this.image;
453
- this.rect.width * t < this.minDimension.closingWidth || i.width < Math.floor(this.minDimension.initialWidth) || (i.addEventListener(
460
+ const e = Date.now(), n = this.image;
461
+ this.rect.width * t < this.minDimension.closingWidth || n.width < Math.floor(this.minDimension.initialWidth) || (n.addEventListener(
454
462
  "transitionend",
455
463
  () => {
456
- this.animationTimestamp === e && i && (i.style.transition = "", this.normalize());
464
+ this.animationTimestamp === e && n && (n.style.transition = "", this.normalize());
457
465
  },
458
466
  { once: !0 }
459
- ), i.style.transition || (i.style.transition = "all 222ms ease"), this.animationTimestamp = e, this.scaleMove(t));
467
+ ), n.style.transition || (n.style.transition = "all 222ms ease"), this.animationTimestamp = e, this.scaleMove(t));
460
468
  }
461
469
  normalize(t = !0) {
462
470
  if (!this.image || !this.rect) return;
463
471
  const e = this.snapToTargetIfClose(
464
472
  this.rect.width * this.scale,
465
473
  this.minDimension.initialWidth
466
- ), i = this.snapToTargetIfClose(
474
+ ), n = this.snapToTargetIfClose(
467
475
  this.rect.height * this.scale,
468
476
  this.minDimension.initialHeight
469
477
  );
470
- if (this.image.style.width = `${e}px`, this.image.style.height = `${i}px`, this.scale = 1, this.image.style.opacity = "", this.accumulatedTranslate.x += this.translate.x, this.accumulatedTranslate.y += this.translate.y, this.image.style.left = `calc(50% + ${this.accumulatedTranslate.x}px)`, this.image.style.top = `calc(50% + ${this.accumulatedTranslate.y}px)`, this.translate = { x: 0, y: 0 }, this.image.style.transform = "", this.rect = this.image.getBoundingClientRect(), e <= this.minDimension.closingWidth)
478
+ if (this.image.style.width = `${e}px`, this.image.style.height = `${n}px`, this.scale = 1, this.image.style.opacity = "", this.accumulatedTranslate.x += this.translate.x, this.accumulatedTranslate.y += this.translate.y, this.image.style.left = `calc(50% + ${this.accumulatedTranslate.x}px)`, this.image.style.top = `calc(50% + ${this.accumulatedTranslate.y}px)`, this.translate = { x: 0, y: 0 }, this.image.style.transform = "", this.rect = this.image.getBoundingClientRect(), e <= this.minDimension.closingWidth)
471
479
  return this.clean(), !0;
472
480
  if (e < this.minDimension.initialWidth)
473
481
  this.accumulatedTranslate.x = 0, this.accumulatedTranslate.y = 0, requestAnimationFrame(() => {
474
- const n = this.image;
475
- n && (n.addEventListener(
482
+ const i = this.image;
483
+ i && (i.addEventListener(
476
484
  "transitionend",
477
485
  () => {
478
- n && (this.clean(), this.rect = null);
486
+ i && (this.clean(), this.rect = null);
479
487
  },
480
488
  { once: !0 }
481
- ), n.style.transition = "all 222ms ease", n.style.width = `${this.minDimension.initialWidth}px`, n.style.height = `${this.minDimension.initialHeight}px`, n.style.left = "50%", n.style.top = "50%");
489
+ ), i.style.transition = "all 222ms ease", i.style.width = `${this.minDimension.initialWidth}px`, i.style.height = `${this.minDimension.initialHeight}px`, i.style.left = "50%", i.style.top = "50%");
482
490
  });
483
491
  else if (t) {
484
- let n = !1;
485
- if (this.rect.right < window.innerWidth / 2 && (n = !0, this.accumulatedTranslate.x += window.innerWidth / 2 - this.rect.right), this.rect.left > window.innerWidth / 2 && (n = !0, this.accumulatedTranslate.x -= this.rect.left - window.innerWidth / 2), this.rect.bottom < window.innerHeight / 2 && (n = !0, this.accumulatedTranslate.y += window.innerHeight / 2 - this.rect.bottom), this.rect.top > window.innerHeight / 2 && (n = !0, this.accumulatedTranslate.y -= this.rect.top - window.innerHeight / 2), n) {
492
+ let i = !1;
493
+ if (this.rect.right < window.innerWidth / 2 && (i = !0, this.accumulatedTranslate.x += window.innerWidth / 2 - this.rect.right), this.rect.left > window.innerWidth / 2 && (i = !0, this.accumulatedTranslate.x -= this.rect.left - window.innerWidth / 2), this.rect.bottom < window.innerHeight / 2 && (i = !0, this.accumulatedTranslate.y += window.innerHeight / 2 - this.rect.bottom), this.rect.top > window.innerHeight / 2 && (i = !0, this.accumulatedTranslate.y -= this.rect.top - window.innerHeight / 2), i) {
486
494
  const o = this.image;
487
495
  o.addEventListener(
488
496
  "transitionend",
@@ -496,12 +504,12 @@ class tt {
496
504
  }
497
505
  }
498
506
  }
499
- class et {
507
+ class nt {
500
508
  constructor() {
501
- l(this, "fiolast", {});
509
+ h(this, "fiolast", {});
502
510
  }
503
511
  // first in out
504
- fio(t, e, i = 50) {
512
+ fio(t, e, n = 50) {
505
513
  const o = Date.now() - (this.fiolast[e] ?? 0), a = () => {
506
514
  this.fiolast[e] = Date.now(), t();
507
515
  };
@@ -509,38 +517,40 @@ class et {
509
517
  a();
510
518
  return;
511
519
  }
512
- o >= i && a();
520
+ o >= n && a();
513
521
  }
514
522
  }
515
523
  const x = {
516
524
  somethingOpened: null
517
525
  };
518
- class it {
526
+ class st {
519
527
  constructor(t, e = {}) {
520
- l(this, "options");
521
- l(this, "elements");
522
- l(this, "isReducedMotion");
523
- l(this, "currentIndex", -1);
524
- l(this, "currentChildren", null);
525
- l(this, "setupFunction", K);
526
- l(this, "initFunction", _);
527
- l(this, "closeFunction", J);
528
- l(this, "transitionFunction", Q);
529
- l(this, "pointers", null);
530
- l(this, "imageState");
531
- l(this, "root", null);
532
- l(this, "imageContainer", null);
533
- l(this, "onClickElements", (t) => {
528
+ h(this, "options");
529
+ h(this, "elements");
530
+ h(this, "isReducedMotion");
531
+ h(this, "currentIndex", -1);
532
+ h(this, "currentChildren", null);
533
+ h(this, "setupFunction", _);
534
+ h(this, "initFunction", G);
535
+ h(this, "closeFunction", Q);
536
+ h(this, "transitionFunction", tt);
537
+ h(this, "pointers", null);
538
+ h(this, "imageState");
539
+ h(this, "imageTransitions", /* @__PURE__ */ new Map());
540
+ h(this, "root", null);
541
+ h(this, "imageContainer", null);
542
+ h(this, "onClickElements", (t) => {
534
543
  t.preventDefault();
535
544
  const e = t.currentTarget;
536
545
  e.dataset.vistaIdx && this.open(parseInt(e.dataset.vistaIdx));
537
546
  });
538
- l(this, "defaultOnClickHandler", (t) => t.preventDefault());
539
- l(this, "abortController", null);
540
- l(this, "throttle", new et());
541
- l(this, "lastSwapTime", 0);
542
- l(this, "isZoomedIn", !1);
543
- l(this, "onKeyDown", (t) => {
547
+ h(this, "defaultOnClickHandler", (t) => t.preventDefault());
548
+ h(this, "abortController", null);
549
+ h(this, "throttle", new nt());
550
+ h(this, "lastSwapTime", 0);
551
+ h(this, "transitionCleanup", null);
552
+ h(this, "isZoomedIn", !1);
553
+ h(this, "onKeyDown", (t) => {
544
554
  switch (t.key) {
545
555
  case "ArrowLeft":
546
556
  t.preventDefault(), this.prev();
@@ -559,7 +569,7 @@ class it {
559
569
  break;
560
570
  }
561
571
  });
562
- l(this, "onScroll", (t) => {
572
+ h(this, "onScroll", (t) => {
563
573
  t.preventDefault();
564
574
  const e = t.deltaY;
565
575
  this.imageState.setInitialCenter({
@@ -567,29 +577,29 @@ class it {
567
577
  y: t.clientY
568
578
  }), e < 0 ? this.zoomIn() : e > 0 && this.zoomOut();
569
579
  });
570
- l(this, "onResizeHandler", () => {
580
+ h(this, "onResizeHandler", () => {
571
581
  this.currentChildren.htmls.forEach((t, e) => {
572
- const i = this.currentChildren.images[e], n = t.querySelector("img.vvw-img-hi"), o = t.querySelector("img.vvw-img-lo");
573
- if (H(i, n, o, !1), n.classList.contains("vvw--loaded")) {
574
- const { width: a, height: r } = S(n);
575
- n.style.setProperty("--vvw-current-w", `${a}px`), n.style.setProperty("--vvw-current-h", `${r}px`), n.dataset.vvwWidth = a.toString(), n.dataset.vvwHeight = r.toString();
582
+ const n = this.currentChildren.images[e], i = t.querySelector("img.vvw-img-hi"), o = t.querySelector("img.vvw-img-lo");
583
+ if (W(n, i, o, !1), i.classList.contains("vvw--loaded")) {
584
+ const { width: a, height: r } = M(i);
585
+ i.style.setProperty("--vvw-current-w", `${a}px`), i.style.setProperty("--vvw-current-h", `${r}px`), i.dataset.vvwWidth = a.toString(), i.dataset.vvwHeight = r.toString();
576
586
  }
577
587
  });
578
588
  });
579
589
  /// POINTERS
580
- l(this, "pointerListeners", []);
581
- l(this, "getInternalPointerListener", () => {
590
+ h(this, "pointerListeners", []);
591
+ h(this, "getInternalPointerListener", () => {
582
592
  const t = this.imageState;
583
- let e = 0, i = !1, n = () => {
593
+ let e = 0, n = !1, i = () => {
584
594
  };
585
595
  return (o) => {
586
596
  if (o.event === "down") {
587
- if (n(), this.isZoomedIn && o.pointers.length === 1) {
597
+ if (i(), this.isZoomedIn && o.pointers.length === 1) {
588
598
  const a = this.pointers.getCentroid();
589
599
  t.setInitialCenter(a);
590
600
  }
591
601
  if (o.pointers.length >= 2) {
592
- i = !0;
602
+ n = !0;
593
603
  const a = this.pointers.getCentroid();
594
604
  e = this.pointers.getPointerDistance(o.pointers[0], o.pointers[1]), t.setInitialCenter(a);
595
605
  }
@@ -598,87 +608,97 @@ class it {
598
608
  const a = this.pointers.getCentroid();
599
609
  t.move(a);
600
610
  }
601
- if (o.pointers.length >= 2 && i) {
611
+ if (o.pointers.length >= 2 && n) {
602
612
  const a = this.pointers.getCentroid(), r = this.pointers.getPointerDistance(o.pointers[0], o.pointers[1]);
603
613
  t.scaleMove(r / e, a);
604
614
  }
605
- } else (o.event === "up" || o.event === "cancel") && (i || this.isZoomedIn) && (i ? (i = !1, t.normalize() && requestAnimationFrame(() => {
615
+ } else (o.event === "up" || o.event === "cancel") && (n || this.isZoomedIn) && (n ? (n = !1, t.normalize() && requestAnimationFrame(() => {
606
616
  this.close();
607
- })) : this.isZoomedIn && o.pointers.length === 0 && (n = t.moveAndNormalize(o.pointer)));
617
+ })) : this.isZoomedIn && o.pointers.length === 0 && (i = t.moveAndNormalize(o.pointer)));
608
618
  this.pointerListeners.forEach(
609
619
  (a) => a({
610
620
  ...o,
611
- hasInternalExecution: this.isZoomedIn || i
621
+ hasInternalExecution: this.isZoomedIn || n,
622
+ abortController: this.abortController
612
623
  })
613
624
  );
614
625
  };
615
626
  });
616
627
  this.elements = t, this.options = {
617
- ...T,
628
+ ...H,
618
629
  ...e,
619
630
  controls: {
620
- ...T.controls,
631
+ ...H.controls,
621
632
  ...e.controls
622
633
  }
623
- }, this.imageState = new tt(
634
+ }, this.imageState = new it(
624
635
  this.options.maxZoomLevel,
625
- (i) => {
626
- var n, o, a, r, h, c;
627
- i.isMin ? (this.isZoomedIn = !1, (n = this.qs(".vvw-zoom-out")) == null || n.setAttribute("disabled", "true"), (o = this.qs('.vvw-item[data-vvw-idx="' + this.currentIndex + '"]')) == null || o.style.setProperty(
636
+ (n) => {
637
+ var i, o, a, r, l, c;
638
+ n.isMin ? (this.isZoomedIn = !1, (i = this.qs(".vvw-zoom-out")) == null || i.setAttribute("disabled", "true"), (o = this.qs('.vvw-item[data-vvw-idx="' + this.currentIndex + '"]')) == null || o.style.setProperty(
628
639
  "pointer-events",
629
640
  "none"
630
641
  )) : (this.isZoomedIn = !0, (a = this.qs(".vvw-zoom-out")) == null || a.removeAttribute("disabled"), (r = this.qs('.vvw-item[data-vvw-idx="' + this.currentIndex + '"]')) == null || r.style.setProperty(
631
642
  "pointer-events",
632
643
  "auto"
633
- )), i.isMax ? (h = this.qs(".vvw-zoom-in")) == null || h.setAttribute("disabled", "true") : (c = this.qs(".vvw-zoom-in")) == null || c.removeAttribute("disabled");
644
+ )), n.isMax ? (l = this.qs(".vvw-zoom-in")) == null || l.setAttribute("disabled", "true") : (c = this.qs(".vvw-zoom-in")) == null || c.removeAttribute("disabled");
634
645
  }
635
- ), this.options.setupFunction && (this.setupFunction = this.options.setupFunction), this.options.closeFunction && (this.closeFunction = this.options.closeFunction), this.options.initFunction && (this.initFunction = this.options.initFunction), this.options.transitionFunction && (this.transitionFunction = this.options.transitionFunction), this.isReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.elements instanceof NodeList && this.elements.forEach((i, n) => {
636
- i.dataset.vistaIdx = n.toString(), i.addEventListener("click", this.defaultOnClickHandler), i.addEventListener("pointerup", this.onClickElements);
646
+ ), this.options.setupFunction && (this.setupFunction = this.options.setupFunction), this.options.closeFunction && (this.closeFunction = this.options.closeFunction), this.options.initFunction && (this.initFunction = this.options.initFunction), this.options.transitionFunction && (this.transitionFunction = this.options.transitionFunction), this.isReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.elements instanceof NodeList && this.elements.forEach((n, i) => {
647
+ n.dataset.vistaIdx = i.toString(), n.addEventListener("click", this.defaultOnClickHandler), n.addEventListener("pointerup", this.onClickElements);
637
648
  });
638
649
  }
639
650
  qs(t) {
640
651
  return this.root ? this.root.querySelector(t) : null;
641
652
  }
642
653
  async swap(t, e) {
643
- const i = this.options.preloads || 0, n = this.currentIndex, { htmls: o, images: a } = this.getChildElements(i, n), r = this.imageContainer, h = this.currentChildren, c = {
644
- htmlElements: { from: h.htmls, to: o },
645
- images: { from: h.images, to: a },
654
+ const n = this.options.preloads || 0, i = this.currentIndex, { htmls: o, images: a } = this.getChildElements(n, i), r = this.imageContainer, l = this.currentChildren, c = {
655
+ htmlElements: { from: l.htmls, to: o },
656
+ images: { from: l.images, to: a },
646
657
  index: { from: t, to: this.currentIndex },
647
658
  via: e || { next: !1, prev: !1 },
648
659
  vistaView: this
649
660
  };
650
661
  this.setupFunction(c), this.currentChildren = { htmls: o, images: a }, this.displayActiveIndex();
651
- const m = this.abortController.signal, w = performance.now(), b = w - this.lastSwapTime < this.options.rapidLimit;
652
- let p = null;
653
- b || (p = await this.transitionFunction(c, m)), this.lastSwapTime = w;
654
- const d = o[Math.floor(o.length / 2)].dataset.vvwIdx, v = r.querySelector(
662
+ const m = this.abortController.signal;
663
+ if (performance.now() - this.lastSwapTime < this.options.rapidLimit) {
664
+ r.innerHTML = "", this.transitionCleanup && this.transitionCleanup(), o.forEach((b) => {
665
+ r.appendChild(b);
666
+ }), this.lastSwapTime = performance.now(), this.waitForImagesToLoad(), this.options.onImageView && this.options.onImageView(c);
667
+ return;
668
+ }
669
+ const g = this.transitionFunction(c, m);
670
+ g && (this.transitionCleanup = g.cleanup, await g.transitionEnded), this.lastSwapTime = performance.now();
671
+ const d = o[Math.floor(o.length / 2)].dataset.vvwIdx, u = r.querySelector(
655
672
  `.vvw-item[data-vvw-idx="${d}"] img.vvw-img-hi`
656
- ), g = v.getAttribute("style") || "", f = v.classList.contains("vvw--loaded"), u = v.width, L = v.height;
657
- this.imageState.reset(), r.innerHTML = "", p instanceof Function && p(), o.forEach((E) => {
658
- const y = E.querySelector("img.vvw-img-hi");
659
- E.dataset.vvwPos === "0" && !m.aborted && g && f && // ready &&
660
- u && L && (y.classList.add("vvw--loaded"), y.classList.add("vvw--ready"), y.setAttribute("style", g), y.width = u, y.height = L, y.dataset.vvwWidth = u.toString(), y.dataset.vvwHeight = L.toString()), r.appendChild(E), y.classList.contains("vvw--ready") && (this.imageState.setCurrentImage(y), this.imageState.setInitialCenter());
673
+ ), y = this.imageTransitions.get(u);
674
+ this.imageTransitions.delete(u);
675
+ const f = u.getAttribute("style") || "", v = u.classList.contains("vvw--loaded"), E = u.classList.contains("vvw--ready"), I = u.width, T = u.height;
676
+ this.imageState.reset(), r.innerHTML = "", this.transitionCleanup && this.transitionCleanup(), o.forEach((b) => {
677
+ const w = b.querySelector("img.vvw-img-hi");
678
+ b.dataset.vvwPos === "0" && !m.aborted && f && I && T && (v && (w.classList.add("vvw--loaded"), w.dataset.vvwWidth = u.dataset.vvwWidth || "", w.dataset.vvwHeight = u.dataset.vvwHeight || ""), E && (w.classList.add("vvw--ready"), w.width = I, w.height = T), w.setAttribute("style", f)), r.appendChild(b), b.dataset.vvwPos === "0" && !m.aborted && E ? (this.imageState.setCurrentImage(w), this.imageState.setInitialCenter()) : b.dataset.vvwPos === "0" && !m.aborted && f && I && T && v && y && (this.imageTransitions.set(w, y), this.transitionImage(w, () => {
679
+ this.imageState.setCurrentImage(w), this.imageState.setInitialCenter(), w.classList.add("vvw--ready");
680
+ }));
661
681
  }), this.waitForImagesToLoad(), this.options.onImageView && this.options.onImageView(c);
662
682
  }
663
683
  getChildElements(t, e) {
664
- const i = [], n = [];
684
+ const n = [], i = [];
665
685
  for (let o = -t; o <= t; o++) {
666
- const a = (e + o + this.elements.length) % this.elements.length, r = this.elements[a], h = r instanceof HTMLImageElement ? r : r instanceof HTMLAnchorElement && r.querySelector("img") || void 0, c = r instanceof HTMLElement ? {
686
+ const a = (e + o + this.elements.length) % this.elements.length, r = this.elements[a], l = r instanceof HTMLImageElement ? r : r instanceof HTMLAnchorElement && r.querySelector("img") || void 0, c = r instanceof HTMLElement ? {
667
687
  index: a,
668
- imageElm: h instanceof HTMLImageElement ? h : void 0,
688
+ imageElm: l instanceof HTMLImageElement ? l : void 0,
669
689
  anchorElm: r instanceof HTMLAnchorElement ? r : void 0,
670
690
  src: r.dataset.vistaviewSrc || r.getAttribute("href") || r.getAttribute("src") || "",
671
- thumb: r.dataset.vistaviewThumb || (h instanceof HTMLImageElement ? h.getAttribute("src") : void 0) || r.getAttribute("href") || void 0,
672
- alt: h instanceof HTMLImageElement && h.getAttribute("alt") || void 0
691
+ thumb: r.dataset.vistaviewThumb || (l instanceof HTMLImageElement ? l.getAttribute("src") : void 0) || r.getAttribute("href") || void 0,
692
+ alt: l instanceof HTMLImageElement && l.getAttribute("alt") || void 0
673
693
  } : {
674
694
  index: a,
675
695
  ...r
676
696
  };
677
- n.push(c), i.push(j(c, o));
697
+ i.push(c), n.push(U(c, o));
678
698
  }
679
699
  return {
680
- htmls: i,
681
- images: n
700
+ htmls: n,
701
+ images: i
682
702
  };
683
703
  }
684
704
  zoomIn() {
@@ -702,45 +722,56 @@ class it {
702
722
  displayActiveIndex() {
703
723
  var a;
704
724
  const t = this.currentIndex;
705
- this.elements instanceof NodeList && this.elements.forEach((r, h) => {
706
- r.style.opacity = "", h === t && (r.style.opacity = "0");
725
+ this.elements instanceof NodeList && this.elements.forEach((r, l) => {
726
+ r.style.opacity = "", l === t && (r.style.opacity = "0");
707
727
  });
708
- const e = this.qs(".vvw-index"), i = `${t + 1}`, n = `${this.elements.length}`;
709
- e && (e.textContent = `${i} / ${n}`);
728
+ const e = this.qs(".vvw-index"), n = `${t + 1}`, i = `${this.elements.length}`;
729
+ e && (e.textContent = `${n} / ${i}`);
710
730
  const o = this.qs(".vvw-desc");
711
731
  if (o) {
712
- const r = (a = this.currentChildren) == null ? void 0 : a.images.find((c) => c.index === t), h = (r == null ? void 0 : r.alt) || "";
713
- h ? (o.textContent = h, o.setAttribute("aria-label", `Image ${i} of ${n}: ${h}`)) : (o.textContent = "", o.setAttribute("aria-label", `Image ${i} of ${n}`));
732
+ const r = (a = this.currentChildren) == null ? void 0 : a.images.find((c) => c.index === t), l = (r == null ? void 0 : r.alt) || "";
733
+ l ? (o.textContent = l, o.setAttribute("aria-label", `Image ${n} of ${i}: ${l}`)) : (o.textContent = "", o.setAttribute("aria-label", `Image ${n} of ${i}`));
714
734
  }
715
735
  }
736
+ transitionImage(t, e) {
737
+ const n = this.imageTransitions.get(t);
738
+ n && requestAnimationFrame(() => {
739
+ const { current: i, target: o } = n, a = {
740
+ width: i.width + (o.width - i.width) * 0.1,
741
+ height: i.height + (o.height - i.height) * 0.1,
742
+ radius: i.radius + (o.radius - i.radius) * 0.1
743
+ };
744
+ Math.abs(a.width - o.width) < 0.5 && Math.abs(a.height - o.height) < 0.5 && Math.abs(a.radius - o.radius) < 0.5 ? (t.style.setProperty("--vvw-current-w", `${o.width}px`), t.style.setProperty("--vvw-current-h", `${o.height}px`), t.style.setProperty("--vvw-current-radius", `${o.radius}px`), this.imageTransitions.delete(t), e()) : (t.style.setProperty("--vvw-current-w", `${a.width}px`), t.style.setProperty("--vvw-current-h", `${a.height}px`), t.style.setProperty("--vvw-current-radius", `${a.radius}px`), this.imageTransitions.set(t, { current: a, target: o }), this.transitionImage(t, e));
745
+ });
746
+ }
716
747
  waitForImagesToLoad() {
717
- this.imageContainer.querySelectorAll("img.vvw-img-hi:not(.vvw--loaded)").forEach((i) => {
718
- const n = i, o = () => {
719
- var r;
720
- n.width = n.naturalWidth, n.height = n.naturalHeight;
721
- const a = (r = n.parentElement) == null ? void 0 : r.matches(`[data-vvw-idx="${this.currentIndex}"]`);
722
- n.addEventListener(
723
- "transitionend",
724
- () => {
725
- a && (this.imageState.setCurrentImage(n), this.imageState.setInitialCenter()), n.classList.add("vvw--ready");
748
+ this.imageContainer.querySelectorAll("img.vvw-img-hi:not(.vvw--loaded)").forEach((n) => {
749
+ const i = n, o = () => {
750
+ var c;
751
+ i.width = i.naturalWidth, i.height = i.naturalHeight;
752
+ const a = (c = i.parentElement) == null ? void 0 : c.matches(`[data-vvw-idx="${this.currentIndex}"]`), { width: r, height: l } = M(i);
753
+ i.dataset.vvwWidth = r.toString(), i.dataset.vvwHeight = l.toString(), i.classList.add("vvw--loaded"), this.imageTransitions.set(i, {
754
+ current: {
755
+ width: i.style.getPropertyValue("--vvw-current-w") ? parseFloat(i.style.getPropertyValue("--vvw-current-w")) : 0,
756
+ height: i.style.getPropertyValue("--vvw-current-h") ? parseFloat(i.style.getPropertyValue("--vvw-current-h")) : 0,
757
+ radius: i.style.getPropertyValue("--vvw-current-radius") ? parseFloat(i.style.getPropertyValue("--vvw-current-radius")) : 0
726
758
  },
727
- { once: !0 }
728
- ), n.classList.add("vvw--loaded"), requestAnimationFrame(() => {
729
- const { width: h, height: c } = S(n);
730
- n.style.setProperty("--vvw-current-w", `${h}px`), n.style.setProperty("--vvw-current-h", `${c}px`), n.dataset.vvwWidth = h.toString(), n.dataset.vvwHeight = c.toString(), n.style.setProperty("--vvw-current-radius", "0px");
759
+ target: { width: r, height: l, radius: 0 }
760
+ }), this.transitionImage(i, () => {
761
+ a && (this.imageState.setCurrentImage(i), this.imageState.setInitialCenter()), i.classList.add("vvw--ready");
731
762
  });
732
763
  };
733
- if (n.complete && n.naturalWidth !== 0) {
764
+ if (i.complete && i.naturalWidth !== 0) {
734
765
  o();
735
766
  return;
736
767
  }
737
- n.addEventListener("load", () => {
768
+ i.addEventListener("load", () => {
738
769
  o();
739
- }), n.addEventListener("error", () => {
770
+ }), i.addEventListener("error", () => {
740
771
  var r;
741
- n.classList.add("vvw--loaderror");
772
+ i.classList.add("vvw--loaderror");
742
773
  const a = document.createElement("p");
743
- a.className = "vvw-img-err", a.setAttribute("role", "alert"), a.textContent = "Error loading image", (r = n.parentNode) == null || r.appendChild(a);
774
+ a.className = "vvw-img-err", a.setAttribute("role", "alert"), a.textContent = "Error loading image", (r = i.parentNode) == null || r.appendChild(a);
744
775
  });
745
776
  });
746
777
  }
@@ -752,17 +783,17 @@ class it {
752
783
  }
753
784
  /// OPEN
754
785
  open(t = 0) {
755
- var c, m, w, b, p;
786
+ var c, m, p, L, g;
756
787
  if (x.somethingOpened)
757
788
  return;
758
789
  x.somethingOpened = this, this.currentIndex = t, document.body.style.overflow = "hidden";
759
- const e = U({
790
+ const e = K({
760
791
  controls: this.options.controls
761
792
  });
762
793
  if (document.body.prepend(e), this.root = document.body.querySelector("#vvw-root"), !this.root)
763
794
  throw new Error("Failed to setup VistaView root element.");
764
795
  this.imageContainer = this.qs(".vvw-image-container"), this.options.animationDurationBase && this.root.style.setProperty("--vvw-anim-dur", `${this.options.animationDurationBase}`), this.options.initialZIndex !== void 0 && this.root.style.setProperty("--vvw-init-z", `${this.options.initialZIndex ?? 0}`), this.options.arrowOnSmallScreens && this.root.classList.add("vvw-arrow-sm");
765
- const i = this.options.preloads || 0, n = t, { images: o, htmls: a } = this.getChildElements(i, n), r = {
796
+ const n = this.options.preloads || 0, i = t, { images: o, htmls: a } = this.getChildElements(n, i), r = {
766
797
  htmlElements: { from: null, to: a },
767
798
  images: { from: null, to: o },
768
799
  index: { from: null, to: this.currentIndex },
@@ -771,11 +802,11 @@ class it {
771
802
  };
772
803
  this.setupFunction(r), this.currentChildren = { htmls: a, images: o }, a.forEach((d) => {
773
804
  this.imageContainer.appendChild(d);
774
- }), (c = this.qs(".vvw-close")) == null || c.addEventListener("click", () => this.close()), (m = this.qs(".vvw-zoom-in")) == null || m.addEventListener("click", () => this.zoomIn()), (w = this.qs(".vvw-zoom-out")) == null || w.addEventListener("click", () => this.zoomOut()), (b = this.qs(".vvw-prev>button")) == null || b.addEventListener("click", () => this.prev()), (p = this.qs(".vvw-next>button")) == null || p.addEventListener("click", () => this.next()), this.options.keyboardListeners && window.addEventListener("keydown", this.onKeyDown), window.addEventListener("wheel", this.onScroll, { passive: !1 }), window.addEventListener("resize", this.onResizeHandler), this.pointers = new V({
805
+ }), (c = this.qs(".vvw-close")) == null || c.addEventListener("click", () => this.close()), (m = this.qs(".vvw-zoom-in")) == null || m.addEventListener("click", () => this.zoomIn()), (p = this.qs(".vvw-zoom-out")) == null || p.addEventListener("click", () => this.zoomOut()), (L = this.qs(".vvw-prev>button")) == null || L.addEventListener("click", () => this.prev()), (g = this.qs(".vvw-next>button")) == null || g.addEventListener("click", () => this.next()), this.options.keyboardListeners && window.addEventListener("keydown", this.onKeyDown), window.addEventListener("wheel", this.onScroll, { passive: !1 }), window.addEventListener("resize", this.onResizeHandler), this.pointers = new et({
775
806
  elm: this.imageContainer,
776
807
  listeners: [this.getInternalPointerListener()]
777
808
  });
778
- const h = {};
809
+ const l = {};
779
810
  [
780
811
  ...this.options.controls.topLeft || [],
781
812
  ...this.options.controls.topRight || [],
@@ -784,26 +815,24 @@ class it {
784
815
  ...this.options.controls.bottomLeft || [],
785
816
  ...this.options.controls.bottomRight || []
786
817
  ].forEach((d) => {
787
- typeof d != "string" && (h[d.name] = d);
818
+ typeof d != "string" && (l[d.name] = d);
788
819
  }), this.root.querySelectorAll("button[data-vvw-control]").forEach((d) => {
789
- const v = d;
790
- v.addEventListener("click", (g) => {
791
- const f = g.currentTarget.dataset.vvwControl, u = h[f], L = this.currentChildren.images.find(
792
- (E) => E.index === this.currentIndex
820
+ const u = d;
821
+ u.addEventListener("click", (y) => {
822
+ const f = y.currentTarget.dataset.vvwControl, v = l[f], E = this.currentChildren.images.find(
823
+ (I) => I.index === this.currentIndex
793
824
  );
794
- u && L && (u.onClick.constructor.name === "AsyncFunction" ? (v.classList.add("vvw--loading"), u.onClick(L, this).finally(() => {
795
- v.classList.remove("vvw--loading");
796
- })) : u.onClick(L, this));
825
+ v && E && (v.onClick.constructor.name === "AsyncFunction" ? (u.classList.add("vvw--loading"), v.onClick(E, this).finally(() => {
826
+ u.classList.remove("vvw--loading");
827
+ })) : v.onClick(E, this));
797
828
  });
798
829
  }), this.initFunction(this), requestAnimationFrame(() => {
799
830
  var d;
800
831
  (d = this.root) == null || d.addEventListener(
801
832
  "transitionend",
802
833
  () => {
803
- var v, g;
804
- (v = this.root) == null || v.classList.add("vvw--settled"), this.waitForImagesToLoad(), (g = this.qs(".vvw-bg")) == null || g.addEventListener("click", (f) => {
805
- f.preventDefault(), this.close();
806
- }), this.imageState.reset();
834
+ var u;
835
+ (u = this.root) == null || u.classList.add("vvw--settled"), this.waitForImagesToLoad(), this.imageState.reset();
807
836
  },
808
837
  { once: !0 }
809
838
  ), this.root.classList.add("vvw--active"), this.displayActiveIndex(), this.options.onOpen && this.options.onOpen(this), this.options.onImageView && this.options.onImageView(r);
@@ -812,11 +841,11 @@ class it {
812
841
  /// CLOSE
813
842
  async close(t = !0) {
814
843
  x.somethingOpened === this && this.root && (t ? await new Promise((e) => {
815
- let n = 0;
844
+ let i = 0;
816
845
  this.root.addEventListener("transitionend", (o) => {
817
- o.target === this.root && (n++, n === 2 && this.elements instanceof NodeList && this.elements.forEach((a) => {
846
+ o.target === this.root && (i++, i === 2 && this.elements instanceof NodeList && this.elements.forEach((a) => {
818
847
  a.style.opacity = "";
819
- }), n === 3 && e(null));
848
+ }), i === 3 && e(null));
820
849
  }), this.root.classList.add("vvw--closing");
821
850
  }) : this.elements instanceof NodeList && this.elements.forEach((e) => {
822
851
  e.style.opacity = "";
@@ -845,48 +874,48 @@ class it {
845
874
  view(t, e) {
846
875
  if (x.somethingOpened !== this || t < 0 || t >= this.elements.length)
847
876
  return;
848
- const i = this.currentIndex;
877
+ const n = this.currentIndex;
849
878
  this.currentIndex = t;
850
- const n = this.abortController;
851
- n == null || n.abort(), this.abortController = new AbortController(), this.swap(i, e);
879
+ const i = this.abortController;
880
+ i == null || i.abort(), this.abortController = new AbortController(), this.swap(n, e);
852
881
  }
853
882
  }
854
- function nt(s) {
883
+ function ot(s) {
855
884
  let t = null;
856
885
  if (typeof s == "string" ? t = document.querySelectorAll(s) : s instanceof NodeList && (t = s), t)
857
886
  for (let e = 0; e < t.length; e++) {
858
- const i = t[e];
859
- if (!(i.dataset.vistaviewSrc || i.getAttribute("href") || i.getAttribute("src") || ""))
887
+ const n = t[e];
888
+ if (!(n.dataset.vistaviewSrc || n.getAttribute("href") || n.getAttribute("src") || ""))
860
889
  return `Element at index ${e} is missing 'src' / 'data-vistaview-src' / 'href' attribute.`;
861
890
  }
862
891
  else {
863
892
  const e = s;
864
- for (let i = 0; i < e.length; i++)
865
- if (!e[i].src)
866
- return `Element at index ${i} is missing 'src' attribute.`;
893
+ for (let n = 0; n < e.length; n++)
894
+ if (!e[n].src)
895
+ return `Element at index ${n} is missing 'src' attribute.`;
867
896
  }
868
897
  return t || s;
869
898
  }
870
- function ot({ elements: s, ...t }) {
899
+ function at({ elements: s, ...t }) {
871
900
  if (!s) throw new Error("No elements");
872
- let e = nt(s);
901
+ let e = ot(s);
873
902
  if (typeof e == "string")
874
903
  return null;
875
- const i = new it(e, t);
904
+ const n = new st(e, t);
876
905
  return {
877
- open: (n = 0) => i.open(n),
878
- close: () => i.close(),
879
- next: () => i.next(),
880
- prev: () => i.prev(),
881
- destroy: () => i.destroy(),
882
- getCurrentIndex: () => i.getCurrentIndex(),
883
- view: (n) => {
884
- i.view(n);
906
+ open: (i = 0) => n.open(i),
907
+ close: () => n.close(),
908
+ next: () => n.next(),
909
+ prev: () => n.prev(),
910
+ destroy: () => n.destroy(),
911
+ getCurrentIndex: () => n.getCurrentIndex(),
912
+ view: (i) => {
913
+ n.view(i);
885
914
  }
886
915
  };
887
916
  }
888
917
  export {
889
- T as DefaultOptions,
890
- ot as vistaView,
891
- N as vistaViewDownload
918
+ H as DefaultOptions,
919
+ at as vistaView,
920
+ j as vistaViewDownload
892
921
  };