js-cloudimage-360-view 4.2.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,105 +1,105 @@
1
- var ti = Object.defineProperty;
2
- var ei = (e, t, i) => t in e ? ti(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
- var le = (e, t, i) => ei(e, typeof t != "symbol" ? t + "" : t, i);
4
- var Mt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
- function ii(e) {
1
+ var ni = Object.defineProperty;
2
+ var ri = (e, t, i) => t in e ? ni(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
+ var de = (e, t, i) => ri(e, typeof t != "symbol" ? t + "" : t, i);
4
+ var Rt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
+ function ai(e) {
6
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
7
  }
8
- var Ze = "Expected a function", ce = NaN, si = "[object Symbol]", oi = /^\s+|\s+$/g, ni = /^[-+]0x[0-9a-f]+$/i, ri = /^0b[01]+$/i, ai = /^0o[0-7]+$/i, li = parseInt, ci = typeof Mt == "object" && Mt && Mt.Object === Object && Mt, hi = typeof self == "object" && self && self.Object === Object && self, di = ci || hi || Function("return this")(), ui = Object.prototype, pi = ui.toString, fi = Math.max, mi = Math.min, Kt = function() {
9
- return di.Date.now();
8
+ var Ne = "Expected a function", ue = NaN, li = "[object Symbol]", ci = /^\s+|\s+$/g, hi = /^[-+]0x[0-9a-f]+$/i, di = /^0b[01]+$/i, ui = /^0o[0-7]+$/i, pi = parseInt, mi = typeof Rt == "object" && Rt && Rt.Object === Object && Rt, fi = typeof self == "object" && self && self.Object === Object && self, vi = mi || fi || Function("return this")(), gi = Object.prototype, yi = gi.toString, bi = Math.max, wi = Math.min, Kt = function() {
9
+ return vi.Date.now();
10
10
  };
11
- function vi(e, t, i) {
12
- var s, o, n, l, r, a, c = 0, h = !1, p = !1, f = !0;
11
+ function Ii(e, t, i) {
12
+ var s, o, n, l, r, a, c = 0, h = !1, u = !1, f = !0;
13
13
  if (typeof e != "function")
14
- throw new TypeError(Ze);
15
- t = he(t) || 0, Bt(i) && (h = !!i.leading, p = "maxWait" in i, n = p ? fi(he(i.maxWait) || 0, t) : n, f = "trailing" in i ? !!i.trailing : f);
16
- function u(y) {
17
- var O = s, S = o;
18
- return s = o = void 0, c = y, l = e.apply(S, O), l;
14
+ throw new TypeError(Ne);
15
+ t = pe(t) || 0, Wt(i) && (h = !!i.leading, u = "maxWait" in i, n = u ? bi(pe(i.maxWait) || 0, t) : n, f = "trailing" in i ? !!i.trailing : f);
16
+ function p(m) {
17
+ var g = s, C = o;
18
+ return s = o = void 0, c = m, l = e.apply(C, g), l;
19
19
  }
20
- function I(y) {
21
- return c = y, r = setTimeout(m, t), h ? u(y) : l;
20
+ function I(m) {
21
+ return c = m, r = setTimeout(O, t), h ? p(m) : l;
22
22
  }
23
- function g(y) {
24
- var O = y - a, S = y - c, E = t - O;
25
- return p ? mi(E, n - S) : E;
23
+ function b(m) {
24
+ var g = m - a, C = m - c, A = t - g;
25
+ return u ? wi(A, n - C) : A;
26
26
  }
27
- function v(y) {
28
- var O = y - a, S = y - c;
29
- return a === void 0 || O >= t || O < 0 || p && S >= n;
27
+ function v(m) {
28
+ var g = m - a, C = m - c;
29
+ return a === void 0 || g >= t || g < 0 || u && C >= n;
30
30
  }
31
- function m() {
32
- var y = Kt();
33
- if (v(y))
34
- return b(y);
35
- r = setTimeout(m, g(y));
31
+ function O() {
32
+ var m = Kt();
33
+ if (v(m))
34
+ return E(m);
35
+ r = setTimeout(O, b(m));
36
36
  }
37
- function b(y) {
38
- return r = void 0, f && s ? u(y) : (s = o = void 0, l);
37
+ function E(m) {
38
+ return r = void 0, f && s ? p(m) : (s = o = void 0, l);
39
39
  }
40
- function x() {
40
+ function w() {
41
41
  r !== void 0 && clearTimeout(r), c = 0, s = a = o = r = void 0;
42
42
  }
43
- function w() {
44
- return r === void 0 ? l : b(Kt());
43
+ function y() {
44
+ return r === void 0 ? l : E(Kt());
45
45
  }
46
- function C() {
47
- var y = Kt(), O = v(y);
48
- if (s = arguments, o = this, a = y, O) {
46
+ function x() {
47
+ var m = Kt(), g = v(m);
48
+ if (s = arguments, o = this, a = m, g) {
49
49
  if (r === void 0)
50
50
  return I(a);
51
- if (p)
52
- return r = setTimeout(m, t), u(a);
51
+ if (u)
52
+ return r = setTimeout(O, t), p(a);
53
53
  }
54
- return r === void 0 && (r = setTimeout(m, t)), l;
54
+ return r === void 0 && (r = setTimeout(O, t)), l;
55
55
  }
56
- return C.cancel = x, C.flush = w, C;
56
+ return x.cancel = w, x.flush = y, x;
57
57
  }
58
- function gi(e, t, i) {
58
+ function Ci(e, t, i) {
59
59
  var s = !0, o = !0;
60
60
  if (typeof e != "function")
61
- throw new TypeError(Ze);
62
- return Bt(i) && (s = "leading" in i ? !!i.leading : s, o = "trailing" in i ? !!i.trailing : o), vi(e, t, {
61
+ throw new TypeError(Ne);
62
+ return Wt(i) && (s = "leading" in i ? !!i.leading : s, o = "trailing" in i ? !!i.trailing : o), Ii(e, t, {
63
63
  leading: s,
64
64
  maxWait: t,
65
65
  trailing: o
66
66
  });
67
67
  }
68
- function Bt(e) {
68
+ function Wt(e) {
69
69
  var t = typeof e;
70
70
  return !!e && (t == "object" || t == "function");
71
71
  }
72
- function yi(e) {
72
+ function xi(e) {
73
73
  return !!e && typeof e == "object";
74
74
  }
75
- function bi(e) {
76
- return typeof e == "symbol" || yi(e) && pi.call(e) == si;
75
+ function Oi(e) {
76
+ return typeof e == "symbol" || xi(e) && yi.call(e) == li;
77
77
  }
78
- function he(e) {
78
+ function pe(e) {
79
79
  if (typeof e == "number")
80
80
  return e;
81
- if (bi(e))
82
- return ce;
83
- if (Bt(e)) {
81
+ if (Oi(e))
82
+ return ue;
83
+ if (Wt(e)) {
84
84
  var t = typeof e.valueOf == "function" ? e.valueOf() : e;
85
- e = Bt(t) ? t + "" : t;
85
+ e = Wt(t) ? t + "" : t;
86
86
  }
87
87
  if (typeof e != "string")
88
88
  return e === 0 ? e : +e;
89
- e = e.replace(oi, "");
90
- var i = ri.test(e);
91
- return i || ai.test(e) ? li(e.slice(2), i ? 2 : 8) : ni.test(e) ? ce : +e;
89
+ e = e.replace(ci, "");
90
+ var i = di.test(e);
91
+ return i || ui.test(e) ? pi(e.slice(2), i ? 2 : 8) : hi.test(e) ? ue : +e;
92
92
  }
93
- var wi = gi;
94
- const de = /* @__PURE__ */ ii(wi), M = {
93
+ var Ei = Ci;
94
+ const me = /* @__PURE__ */ ai(Ei), R = {
95
95
  SPIN_X: "spin-x",
96
96
  SPIN_Y: "spin-y",
97
97
  SPIN_XY: "spin-xy",
98
98
  SPIN_YX: "spin-yx"
99
- }, Ii = [!1, 0, null, void 0, "false", "0", "null", "undefined"], P = {
99
+ }, Ai = [!1, 0, null, void 0, "false", "0", "null", "undefined"], Y = {
100
100
  X: "x-axis",
101
101
  Y: "y-axis"
102
- }, xi = [37, 39], Ci = [38, 40], ue = 10, Oi = 150, pe = 800, Ei = 150, Si = 200, fe = 50, Ai = 50, Li = 5, me = 5, ki = "https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/360_view.svg", d = {
102
+ }, Si = [37, 39], ki = [38, 40], Ti = typeof navigator < "u" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), fe = Ti ? 32 : 10, Li = 150, Ht = 800, Mi = 150, Pi = 200, ve = 50, Yi = 50, Xi = 5, ge = 5, d = {
103
103
  folder: "/",
104
104
  apiVersion: "v7",
105
105
  filenameX: "image-{index}.jpg",
@@ -116,10 +116,11 @@ const de = /* @__PURE__ */ ii(wi), M = {
116
116
  keys: !1,
117
117
  keysReverse: !1,
118
118
  autoplay: !1,
119
- autoplayBehavior: M.SPIN_X,
119
+ autoplayBehavior: R.SPIN_X,
120
120
  playOnce: !1,
121
121
  autoplayReverse: !1,
122
122
  pointerZoom: 0,
123
+ pointerZoomTrigger: "dblclick",
123
124
  fullscreen: !1,
124
125
  magnifier: null,
125
126
  bottomCircle: !0,
@@ -133,8 +134,9 @@ const de = /* @__PURE__ */ ii(wi), M = {
133
134
  imageInfo: !1,
134
135
  initialIconShown: !0,
135
136
  hotspots: null,
137
+ hotspotTrigger: "hover",
136
138
  hide360Logo: !1,
137
- logoSrc: ki,
139
+ logoSrc: null,
138
140
  inertia: !1,
139
141
  pinchZoom: !0,
140
142
  hints: !0,
@@ -153,58 +155,60 @@ const de = /* @__PURE__ */ ii(wi), M = {
153
155
  onZoomOut: null,
154
156
  onDragStart: null,
155
157
  onDragEnd: null
156
- }, Ti = (e) => ({
157
- folder: L(e, "folder", d.folder),
158
- apiVersion: L(e, "api-version", d.apiVersion),
159
- filenameX: L(e, "filename") || L(e, "filename-x") || d.filenameX,
160
- filenameY: L(e, "filename-y", d.filenameY),
161
- imageListX: L(e, "image-list-x", d.imageListX),
162
- imageListY: L(e, "image-list-y", d.imageListY),
163
- indexZeroBase: parseInt(L(e, "index-zero-base", d.indexZeroBase), 10),
164
- amountX: parseInt(L(e, "amount-x", d.amountX), 10),
165
- amountY: parseInt(L(e, "amount-y", d.amountY), 10),
166
- speed: parseInt(L(e, "speed", d.speed), 10),
167
- dragSpeed: parseInt(L(e, "drag-speed", d.dragSpeed), 10),
168
- draggable: X(e, "draggable", d.draggable),
169
- swipeable: X(e, "swipeable", d.swipeable),
170
- keys: X(e, "keys", d.keys),
171
- keysReverse: X(e, "keys-reverse", d.keysReverse),
172
- autoplay: X(e, "autoplay", d.autoplay),
173
- autoplayBehavior: L(e, "autoplay-behavior", d.autoplayBehavior),
174
- playOnce: X(e, "play-once", d.playOnce),
175
- autoplayReverse: X(e, "autoplay-reverse", d.autoplayReverse),
176
- pointerZoom: parseFloat(L(e, "pointer-zoom", d.pointerZoom)),
177
- fullscreen: X(e, "fullscreen") || X(e, "full-screen", d.fullscreen),
178
- magnifier: parseFloat(L(e, "magnifier", d.magnifier)),
158
+ }, Ri = (e) => ({
159
+ folder: k(e, "folder", d.folder),
160
+ apiVersion: k(e, "api-version", d.apiVersion),
161
+ filenameX: k(e, "filename") || k(e, "filename-x") || d.filenameX,
162
+ filenameY: k(e, "filename-y", d.filenameY),
163
+ imageListX: k(e, "image-list-x", d.imageListX),
164
+ imageListY: k(e, "image-list-y", d.imageListY),
165
+ indexZeroBase: parseInt(k(e, "index-zero-base", d.indexZeroBase), 10),
166
+ amountX: parseInt(k(e, "amount-x", d.amountX), 10),
167
+ amountY: parseInt(k(e, "amount-y", d.amountY), 10),
168
+ speed: parseInt(k(e, "speed", d.speed), 10),
169
+ dragSpeed: parseInt(k(e, "drag-speed", d.dragSpeed), 10),
170
+ draggable: P(e, "draggable", d.draggable),
171
+ swipeable: P(e, "swipeable", d.swipeable),
172
+ keys: P(e, "keys", d.keys),
173
+ keysReverse: P(e, "keys-reverse", d.keysReverse),
174
+ autoplay: P(e, "autoplay", d.autoplay),
175
+ autoplayBehavior: k(e, "autoplay-behavior", d.autoplayBehavior),
176
+ playOnce: P(e, "play-once", d.playOnce),
177
+ autoplayReverse: P(e, "autoplay-reverse", d.autoplayReverse),
178
+ pointerZoom: parseFloat(k(e, "pointer-zoom", d.pointerZoom)),
179
+ pointerZoomTrigger: k(e, "pointer-zoom-trigger", d.pointerZoomTrigger),
180
+ fullscreen: P(e, "fullscreen") || P(e, "full-screen", d.fullscreen),
181
+ magnifier: parseFloat(k(e, "magnifier", d.magnifier)),
179
182
  bottomCircleOffset: parseInt(
180
- L(e, "bottom-circle-offset", d.bottomCircleOffset),
183
+ k(e, "bottom-circle-offset", d.bottomCircleOffset),
181
184
  10
182
185
  ),
183
- ciToken: L(e, "responsive", d.ciToken),
184
- ciFilters: L(e, "filters", d.ciFilters),
185
- ciTransformation: L(e, "transformation", d.ciTransformation),
186
- lazyload: X(e, "lazyload", d.lazyload),
187
- dragReverse: X(e, "drag-reverse", d.dragReverse),
188
- stopAtEdges: X(e, "stop-at-edges", d.stopAtEdges),
189
- imageInfo: X(e, "info", d.imageInfo),
190
- initialIconShown: !Ht(e, "initial-icon"),
191
- bottomCircle: !Ht(e, "bottom-circle"),
192
- hide360Logo: X(e, "hide-360-logo", d.hide360Logo),
193
- logoSrc: L(e, "logo-src", d.logoSrc),
194
- inertia: X(e, "inertia", d.inertia),
195
- pinchZoom: X(e, "pinch-zoom", d.pinchZoom),
196
- hints: !Ht(e, "hints"),
197
- theme: L(e, "theme", d.theme),
198
- hotspotTimelineOnClick: !Ht(e, "hotspot-timeline-on-click"),
199
- aspectRatio: L(e, "aspect-ratio", d.aspectRatio)
200
- }), Yi = (e) => {
186
+ ciToken: k(e, "responsive", d.ciToken),
187
+ ciFilters: k(e, "filters", d.ciFilters),
188
+ ciTransformation: k(e, "transformation", d.ciTransformation),
189
+ lazyload: P(e, "lazyload", d.lazyload),
190
+ dragReverse: P(e, "drag-reverse", d.dragReverse),
191
+ stopAtEdges: P(e, "stop-at-edges", d.stopAtEdges),
192
+ imageInfo: P(e, "info", d.imageInfo),
193
+ initialIconShown: !Zt(e, "initial-icon"),
194
+ bottomCircle: !Zt(e, "bottom-circle"),
195
+ hide360Logo: P(e, "hide-360-logo", d.hide360Logo),
196
+ logoSrc: k(e, "logo-src", d.logoSrc),
197
+ inertia: P(e, "inertia", d.inertia),
198
+ pinchZoom: P(e, "pinch-zoom", d.pinchZoom),
199
+ hints: !Zt(e, "hints"),
200
+ theme: k(e, "theme", d.theme),
201
+ hotspotTrigger: k(e, "hotspot-trigger", d.hotspotTrigger),
202
+ hotspotTimelineOnClick: !Zt(e, "hotspot-timeline-on-click"),
203
+ aspectRatio: k(e, "aspect-ratio", d.aspectRatio)
204
+ }), Hi = (e) => {
201
205
  const t = [];
202
206
  e.amountX !== void 0 && e.amountX < 0 && t.push("amountX should be a positive number"), e.amountY !== void 0 && e.amountY < 0 && t.push("amountY should be a positive number"), e.speed !== void 0 && e.speed <= 0 && t.push("speed should be a positive number"), e.dragSpeed !== void 0 && e.dragSpeed <= 0 && t.push("dragSpeed should be a positive number"), e.pointerZoom !== void 0 && e.pointerZoom !== 0 && (e.pointerZoom < 1 || e.pointerZoom > 5) && t.push("pointerZoom should be between 1 and 5 (or 0 to disable)"), e.magnifier !== void 0 && e.magnifier !== null && e.magnifier !== 0 && (e.magnifier < 1 || e.magnifier > 5) && t.push("magnifier should be between 1 and 5 (or 0/null to disable)"), !e.folder && !e.imageListX && !e.imageListY && t.push("Either folder or imageListX/imageListY is required"), e.folder && !e.amountX && !e.imageListX && t.push("amountX is required when using folder (unless imageListX is provided)");
203
207
  const i = ["spin-x", "spin-y", "spin-xy", "spin-yx"];
204
208
  return e.autoplayBehavior && !i.includes(e.autoplayBehavior) && t.push(`autoplayBehavior should be one of: ${i.join(", ")}`), t.forEach((s) => {
205
209
  console.warn(`CloudImage 360: ${s}`);
206
210
  }), t.length === 0;
207
- }, Xi = (e) => (Yi(e), {
211
+ }, Zi = (e) => (Hi(e), {
208
212
  folder: e.folder || d.folder,
209
213
  apiVersion: e.apiVersion || d.apiVersion,
210
214
  filenameX: e.filenameX || e.filename || d.filenameX,
@@ -225,6 +229,7 @@ const de = /* @__PURE__ */ ii(wi), M = {
225
229
  playOnce: e.playOnce ?? d.playOnce,
226
230
  autoplayReverse: e.autoplayReverse ?? d.autoplayReverse,
227
231
  pointerZoom: parseFloat(e.pointerZoom ?? d.pointerZoom),
232
+ pointerZoomTrigger: e.pointerZoomTrigger || d.pointerZoomTrigger,
228
233
  fullscreen: e.fullscreen ?? d.fullscreen,
229
234
  magnifier: parseFloat(e.magnifier ?? d.magnifier),
230
235
  bottomCircleOffset: parseInt(e.bottomCircleOffset ?? d.bottomCircleOffset, 10),
@@ -238,6 +243,7 @@ const de = /* @__PURE__ */ ii(wi), M = {
238
243
  initialIconShown: e.initialIconShown ?? d.initialIconShown,
239
244
  bottomCircle: e.bottomCircle ?? d.bottomCircle,
240
245
  hotspots: e.hotspots ?? d.hotspots,
246
+ hotspotTrigger: e.hotspotTrigger || d.hotspotTrigger,
241
247
  hide360Logo: e.hide360Logo ?? d.hide360Logo,
242
248
  logoSrc: e.logoSrc || d.logoSrc,
243
249
  inertia: e.inertia ?? d.inertia,
@@ -258,32 +264,32 @@ const de = /* @__PURE__ */ ii(wi), M = {
258
264
  onZoomOut: e.onZoomOut ?? d.onZoomOut,
259
265
  onDragStart: e.onDragStart ?? d.onDragStart,
260
266
  onDragEnd: e.onDragEnd ?? d.onDragEnd
261
- }), L = (e, t, i) => e.getAttribute(t) || e.getAttribute(`data-${t}`) || i, X = (e, t, i) => {
267
+ }), k = (e, t, i) => e.getAttribute(t) || e.getAttribute(`data-${t}`) || i, P = (e, t, i) => {
262
268
  if (!(e.hasAttribute(t) || e.hasAttribute(`data-${t}`))) return i;
263
- const o = L(e, t, null);
269
+ const o = k(e, t, null);
264
270
  return o !== "false" && o !== "0";
265
- }, Ht = (e, t) => L(e, t, null) === "false", Pi = (e = 1) => {
271
+ }, Zt = (e, t) => k(e, t, null) === "false", Di = (e = 1) => {
266
272
  const t = Math.round(window.devicePixelRatio || 1);
267
273
  return parseInt(e) * t;
268
- }, Ri = (e, t, i) => new URL(e).origin.includes("cloudimg") ? e : `https://${t}.cloudimg.io/${i}${e}`, Mi = ({ ciTransformation: e, responsiveWidth: t, ciFilters: i }) => {
274
+ }, Bi = (e, t, i) => new URL(e).origin.includes("cloudimg") ? e : `https://${t}.cloudimg.io/${i}${e}`, Wi = ({ ciTransformation: e, responsiveWidth: t, ciFilters: i }) => {
269
275
  const s = `width=${t}`, o = e || s, n = i ? `&f=${i}` : "";
270
276
  return `${o}${n}`;
271
- }, Et = (e, t) => {
277
+ }, xt = (e, t) => {
272
278
  const { folder: i, apiVersion: s, filename: o = "", ciParams: n } = e, { ciToken: l, ciFilters: r, ciTransformation: a } = n || {}, c = `${i}${o}`;
273
- if (!l) return c;
274
- const h = Ii.includes(s) ? null : s, p = h ? `${h}/` : "", f = Pi(t), u = Ri(c, l, p), I = Mi({
279
+ if (!l || !t) return c;
280
+ const h = Ai.includes(s) ? null : s, u = h ? `${h}/` : "", f = Di(t), p = Bi(c, l, u), I = Wi({
275
281
  ciTransformation: a,
276
282
  responsiveWidth: f,
277
283
  ciFilters: r
278
284
  });
279
- return `${u}${I ? "?" : ""}${I}`;
280
- }, Hi = (e, t, i) => {
285
+ return `${p}${I ? "?" : ""}${I}`;
286
+ }, Fi = (e, t, i) => {
281
287
  const [s, o] = e.split("?"), n = `${t}=${encodeURIComponent(i)}`;
282
288
  if (!o)
283
289
  return `${s}?${n}`;
284
290
  const l = new URLSearchParams(o);
285
291
  return l.set(t, i), `${s}?${l.toString()}`;
286
- }, Di = (e, t) => Hi(e, "width", t), Be = (e, t = 0) => (e += "", e.length >= t ? e : new Array(t - e.length + 1).join("0") + e), Zi = (e, { amount: t = 0, indexZeroBase: i = 0 } = {}) => Array.from({ length: t }, (s, o) => e.replace("{index}", Be(o + 1, i))), Bi = ({
292
+ }, Vi = (e, t) => Fi(e, "width", t), ze = (e, t = 0) => (e += "", e.length >= t ? e : new Array(t - e.length + 1).join("0") + e), Ni = (e, { amount: t = 0, indexZeroBase: i = 0 } = {}) => Array.from({ length: t }, (s, o) => e.replace("{index}", ze(o + 1, i))), zi = typeof navigator < "u" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), ji = zi ? 3 : 6, $i = ({
287
293
  imagesUrls: e,
288
294
  onFirstImageLoad: t,
289
295
  onImageLoad: i,
@@ -292,64 +298,67 @@ const de = /* @__PURE__ */ ii(wi), M = {
292
298
  autoplayReverse: n
293
299
  }) => {
294
300
  let l = 0, r = 0;
295
- const a = e.length, c = [], h = [], p = (m, b, x = !1) => {
296
- const w = {
301
+ const a = e.length, c = [], h = [];
302
+ let u = 0, f = 0;
303
+ const p = [], I = (m, g, C = !1) => {
304
+ const A = {
297
305
  message: `Failed to load image: ${m}`,
298
306
  url: m,
299
- index: b,
300
- isFirstImage: x
307
+ index: g,
308
+ isFirstImage: C
301
309
  };
302
- h.push(w), r++, o == null || o({
303
- error: w,
310
+ h.push(A), r++, o == null || o({
311
+ error: A,
304
312
  errorCount: r,
305
313
  totalImages: a,
306
314
  errors: h
307
315
  });
308
- }, f = () => {
316
+ }, b = () => {
309
317
  l === a && (s == null || s(c, { errorCount: r, errors: h }));
310
- }, u = (m, b) => {
311
- const x = new Image();
312
- x.crossOrigin = "anonymous", x.src = m, x.onload = async () => {
318
+ }, v = () => {
319
+ for (; u < ji && f < p.length; ) {
320
+ const m = p[f];
321
+ f++, O(e[m], m);
322
+ }
323
+ }, O = (m, g) => {
324
+ u++;
325
+ const C = new Image();
326
+ C.crossOrigin = "anonymous", C.src = m, C.onload = async () => {
313
327
  try {
314
- const w = await createImageBitmap(x), C = {
328
+ const A = await createImageBitmap(C), S = {
315
329
  src: m,
316
- bitmapImage: w,
317
- naturalWidth: x.naturalWidth,
318
- naturalHeight: x.naturalHeight
330
+ bitmapImage: A,
331
+ naturalWidth: C.naturalWidth,
332
+ naturalHeight: C.naturalHeight
319
333
  };
320
- l++, c[b] = C, i == null || i(C, b), f();
334
+ C.onload = null, C.onerror = null, C.src = "", l++, u--, c[g] = S, i == null || i(S, g), b(), v();
321
335
  } catch {
322
- l++, p(m, b), f();
336
+ C.onload = null, C.onerror = null, C.src = "", l++, u--, I(m, g), b(), v();
323
337
  }
324
- }, x.onerror = () => {
325
- l++, p(m, b), f();
338
+ }, C.onerror = () => {
339
+ C.onload = null, C.onerror = null, C.src = "", l++, u--, I(m, g), b(), v();
326
340
  };
327
- }, I = new Image(), g = n ? e.length - 1 : 0, v = e[g];
328
- I.crossOrigin = "anonymous", I.src = v, I.onload = async () => {
341
+ }, E = (m) => {
342
+ for (let g = 0; g < e.length; g++)
343
+ g !== m && p.push(g);
344
+ f = 0, v();
345
+ }, w = new Image(), y = n ? e.length - 1 : 0, x = e[y];
346
+ w.crossOrigin = "anonymous", w.src = x, w.onload = async () => {
329
347
  try {
330
- const m = await createImageBitmap(I), b = {
331
- src: v,
348
+ const m = await createImageBitmap(w), g = {
349
+ src: x,
332
350
  bitmapImage: m,
333
- naturalWidth: I.naturalWidth,
334
- naturalHeight: I.naturalHeight
351
+ naturalWidth: w.naturalWidth,
352
+ naturalHeight: w.naturalHeight
335
353
  };
336
- c[g] = b, l++, t == null || t(b), i == null || i(b, g);
337
- for (let x = 0; x < e.length; x++)
338
- x !== g && u(e[x], x);
339
- f();
354
+ w.onload = null, w.onerror = null, w.src = "", c[y] = g, l++, t == null || t(g), i == null || i(g, y), a === 1 ? b() : E(y);
340
355
  } catch {
341
- l++, p(v, g, !0);
342
- for (let b = 0; b < e.length; b++)
343
- b !== g && u(e[b], b);
344
- f();
356
+ w.onload = null, w.onerror = null, w.src = "", l++, I(x, y, !0), a === 1 ? b() : E(y);
345
357
  }
346
- }, I.onerror = () => {
347
- l++, p(v, g, !0);
348
- for (let m = 0; m < e.length; m++)
349
- m !== g && u(e[m], m);
350
- f();
358
+ }, w.onerror = () => {
359
+ w.onload = null, w.onerror = null, w.src = "", l++, I(x, y, !0), a === 1 ? b() : E(y);
351
360
  };
352
- }, ve = ({
361
+ }, ye = ({
353
362
  cdnPathX: e,
354
363
  cdnPathY: t,
355
364
  configX: i,
@@ -359,50 +368,50 @@ const de = /* @__PURE__ */ ii(wi), M = {
359
368
  onAllImagesLoad: l,
360
369
  onError: r
361
370
  }) => {
362
- let a = { x: !1, y: !1 }, c = [], h = [], p = { errorCount: 0, errors: [] }, f = { errorCount: 0, errors: [] };
363
- const u = e || i.imageList.length, I = t || s.imageList.length, g = () => {
371
+ let a = { x: !1, y: !1 }, c = [], h = [], u = { errorCount: 0, errors: [] }, f = { errorCount: 0, errors: [] };
372
+ const p = e || i.imageList.length, I = t || s.imageList.length, b = () => {
364
373
  if (a.x && a.y) {
365
- const m = {
366
- errorCount: p.errorCount + f.errorCount,
367
- errors: [...p.errors, ...f.errors]
374
+ const O = {
375
+ errorCount: u.errorCount + f.errorCount,
376
+ errors: [...u.errors, ...f.errors]
368
377
  };
369
- l == null || l(c, h, m);
378
+ l == null || l(c, h, O);
370
379
  }
371
- }, v = ({ cdnPath: m, config: b, orientation: x, loadedImages: w, loadStats: C, onFirstImageLoad: y }) => {
372
- const O = x === P.X, S = b.imageList.length ? b.imageList : Zi(m, b);
373
- Bi({
374
- imagesUrls: S,
375
- onFirstImageLoad: y,
376
- onImageLoad: (E, A) => {
377
- n == null || n(E, A, x), w[A] = E;
380
+ }, v = ({ cdnPath: O, config: E, orientation: w, loadedImages: y, loadStats: x, onFirstImageLoad: m }) => {
381
+ const g = w === Y.X, C = E.imageList.length ? E.imageList : Ni(O, E);
382
+ $i({
383
+ imagesUrls: C,
384
+ onFirstImageLoad: m,
385
+ onImageLoad: (A, S) => {
386
+ n == null || n(A, S, w), y[S] = A;
378
387
  },
379
- onError: (E) => {
380
- r == null || r({ ...E, orientation: x });
388
+ onError: (A) => {
389
+ r == null || r({ ...A, orientation: w });
381
390
  },
382
- onAllImagesLoad: (E, A) => {
383
- w.length = 0, E.forEach((k, R) => {
384
- k && (w[R] = k);
385
- }), C.errorCount = A.errorCount, C.errors = A.errors.map((k) => ({ ...k, orientation: x })), a[O ? "x" : "y"] = !0, g();
391
+ onAllImagesLoad: (A, S) => {
392
+ y.length = 0, A.forEach((T, X) => {
393
+ T && (y[X] = T);
394
+ }), x.errorCount = S.errorCount, x.errors = S.errors.map((T) => ({ ...T, orientation: w })), a[g ? "x" : "y"] = !0, b();
386
395
  },
387
- autoplayReverse: b.autoplayReverse
396
+ autoplayReverse: E.autoplayReverse
388
397
  });
389
398
  };
390
- u ? v({
399
+ p ? v({
391
400
  cdnPath: e,
392
401
  config: i,
393
- orientation: P.X,
402
+ orientation: Y.X,
394
403
  loadedImages: c,
395
- loadStats: p,
404
+ loadStats: u,
396
405
  onFirstImageLoad: o
397
406
  }) : a.x = !0, I ? v({
398
407
  cdnPath: t,
399
408
  config: s,
400
- orientation: P.Y,
409
+ orientation: Y.Y,
401
410
  loadedImages: h,
402
411
  loadStats: f,
403
- onFirstImageLoad: u ? void 0 : o
404
- }) : a.y = !0, !u && !I && g();
405
- }, Wi = `
412
+ onFirstImageLoad: p ? void 0 : o
413
+ }) : a.y = !0, !p && !I && b();
414
+ }, Gi = `
406
415
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1052 156" aria-hidden="true">
407
416
  <path fill="currentColor" d="M409.9,145.6c-42.7-1.7-85.5-4.4-128.1-8.4c-21.3-2-42.6-4.3-63.8-7.1c-21.2-2.8-42.4-5.9-63.4-9.7c-21.1-3.8-42-8.2-62.7-13.7c-10.3-2.8-20.6-5.8-30.7-9.4c-10.1-3.5-20.1-7.6-29.5-12.7c-4.7-2.6-9.3-5.4-13.5-8.8c-2.1-1.7-4-3.6-5.8-5.6c-1.8-2-3.3-4.3-4.3-6.8c-1.1-2.5-1.6-5.3-1.4-8c0.2-2.7,1.1-5.4,2.4-7.7c2.7-4.8,6.7-8.5,11-11.7c8.6-6.4,18.4-10.9,28.3-15c9.9-4,20.1-7.3,30.4-10.3c-10.2,3.1-20.4,6.5-30.3,10.5c-9.8,4.1-19.6,8.7-28.1,15.1c-4.2,3.2-8.2,6.9-10.7,11.6c-1.2,2.3-2.1,4.8-2.3,7.5c-0.1,2.6,0.4,5.2,1.4,7.6c2.1,4.8,5.9,8.7,10,12.1c4.1,3.3,8.7,6.1,13.4,8.6c9.4,5,19.4,8.9,29.4,12.4c10.1,3.5,20.4,6.4,30.7,9.1c20.7,5.3,41.6,9.5,62.7,13.2c21,3.6,42.2,6.6,63.4,9.2c21.2,2.6,42.5,4.8,63.7,6.6c42.6,3.7,85.2,6,127.9,7.4L409.9,145.6z"/>
408
417
  <path fill="currentColor" d="M977.1,11.6c13.8,4.1,27.4,8.8,40.4,15.2c6.4,3.2,12.7,6.9,18.3,11.5c2.7,2.4,5.3,5,7.3,8c2,3,3.3,6.6,3.3,10.3c0,3.7-1.4,7.2-3.3,10.3c-2,3.1-4.5,5.7-7.3,8.1c-2.7,2.4-5.7,4.4-8.8,6.3c-1.6,0.9-3.1,1.9-4.7,2.7l-2.4,1.3l-2.4,1.2C1004.5,93,990.8,97.8,977,102c-6.9,2.1-13.8,4-20.8,5.8c-7,1.8-14,3.5-21,5c-14.1,3.1-28.2,5.9-42.4,8.3c-28.4,4.9-57,8.8-85.6,12c-57.3,6.4-114.8,10.2-172.4,12.2c-57.6,2-115.2,2.3-172.9,0.8l0.1-4c57.5,1.8,115.1,1.9,172.6,0.2c57.5-1.7,115-5.2,172.3-11.2c28.6-3.1,57.2-6.7,85.6-11.5c14.2-2.4,28.3-5,42.4-8.1c7-1.5,14-3.1,21-4.9c7-1.7,13.9-3.6,20.8-5.7c13.8-4.1,27.4-8.8,40.3-15.2l2.4-1.2l2.4-1.3c1.6-0.8,3.1-1.8,4.7-2.7c3-1.9,6-3.9,8.7-6.2c2.7-2.3,5.2-4.9,7.2-7.9c1.9-3,3.2-6.4,3.3-10c0-3.6-1.2-7-3.1-10c-1.9-3-4.4-5.6-7.1-8c-5.5-4.7-11.7-8.3-18.1-11.6C1004.5,20.6,990.8,15.8,977.1,11.6z"/>
@@ -413,121 +422,157 @@ const de = /* @__PURE__ */ ii(wi), M = {
413
422
  <path fill="currentColor" d="M10.9,9.7c0-1.1-0.8-2-2.5-2.5c1.3-0.5,1.9-1.3,1.9-2.3c0-1.7-1.7-2.8-4.6-2.8c-1.5,0-2.7,0.3-3.6,0.8v1.7c0.9-0.4,2.3-0.7,3.4-0.7C7,3.9,8,4.4,8,5.1c0,0.8-0.7,1.3-2.4,1.3H4.3v1.6h1.3c2,0,2.9,0.8,2.9,1.6c0,0.8-1,1.5-2.8,1.5c-1.5,0-2.8-0.3-3.7-0.6v1.7c0.9,0.3,2.1,0.6,3.8,0.6C9.2,12.8,10.9,11.4,10.9,9.7"/>
414
423
  </g>
415
424
  </svg>
416
- `, Fi = (e) => {
425
+ `, _i = (e) => {
417
426
  const t = document.createElement("div");
418
- return t.innerHTML = Wi, t.style.bottom = `${e}%`, t.className = "cloudimage-360-view-360-circle", t;
419
- }, Ni = `
420
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
421
- <!-- Circular arrows -->
422
- <path d="M 75 50 A 25 25 0 1 1 50 25" stroke="currentColor" stroke-width="3"/>
423
- <path d="M 25 50 A 25 25 0 1 1 50 75" stroke="currentColor" stroke-width="3"/>
424
- <!-- Arrow heads -->
425
- <path d="M 50 25 L 56 31 M 50 25 L 56 19" stroke="currentColor" stroke-width="3"/>
426
- <path d="M 50 75 L 44 69 M 50 75 L 44 81" stroke="currentColor" stroke-width="3"/>
427
- <!-- 360 text -->
428
- <text x="50" y="54" text-anchor="middle" font-size="16" font-weight="600" fill="currentColor" stroke="none" font-family="system-ui, -apple-system, sans-serif">360°</text>
427
+ return t.innerHTML = Gi, t.style.bottom = `${e}%`, t.className = "cloudimage-360-view-360-circle", t;
428
+ }, Ui = `
429
+ <svg width="150" height="87" viewBox="0 0 150 87" xmlns="http://www.w3.org/2000/svg">
430
+ <g clip-path="url(#clip0_751_188)">
431
+ <g filter="url(#filter0_d_751_188)">
432
+ <path d="M112.566 15.2227C112.598 15.706 112.529 16.1906 112.364 16.6458C112.198 17.101 111.94 17.5167 111.605 17.8665C111.27 18.2163 110.866 18.4925 110.418 18.6775C109.971 18.8626 109.489 18.9524 109.005 18.9412C108.532 18.955 108.06 18.871 107.621 18.6944C107.181 18.5178 106.782 18.2524 106.45 17.9148C106.117 17.5772 105.858 17.1747 105.688 16.7323C105.518 16.29 105.442 15.8174 105.463 15.344C105.437 14.8591 105.511 14.374 105.68 13.9188C105.849 13.4635 106.109 13.0477 106.445 12.697C106.781 12.3463 107.186 12.0681 107.633 11.8797C108.081 11.6912 108.562 11.5965 109.048 11.6013C111.213 11.5952 112.566 13.1299 112.566 15.2227ZM106.961 15.2895C106.961 16.7574 107.913 17.825 109.03 17.825C110.146 17.825 111.08 16.8059 111.08 15.2652C111.08 14.1551 110.473 12.7053 109.005 12.7053C107.537 12.7053 106.961 14.0884 106.961 15.2895Z" fill="white"/>
433
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M110.164 12.3811C110.552 12.5859 110.861 12.8886 111.093 13.2348C111.506 13.8535 111.681 14.6156 111.681 15.2652C111.681 16.5122 111.13 17.5742 110.261 18.0908C110.603 17.9385 110.912 17.7212 111.171 17.4507C111.448 17.1612 111.662 16.8172 111.799 16.4404C111.936 16.0637 111.993 15.6626 111.966 15.2626L111.965 15.2427V15.2227C111.965 14.3058 111.67 13.5543 111.182 13.0378C110.913 12.7532 110.573 12.5262 110.164 12.3811ZM108.002 18.1944C107.011 17.7212 106.36 16.5793 106.36 15.2895C106.36 14.6064 106.522 13.8357 106.931 13.2157C107.06 13.021 107.212 12.8427 107.389 12.6885C107.204 12.81 107.033 12.9523 106.88 13.1128C106.6 13.4042 106.384 13.7497 106.244 14.128C106.103 14.5062 106.042 14.9093 106.063 15.3122L106.065 15.3415L106.063 15.3708C106.046 15.7615 106.109 16.1517 106.25 16.5168C106.39 16.882 106.604 17.2143 106.878 17.493C107.153 17.7717 107.482 17.9908 107.845 18.1366C107.897 18.1574 107.949 18.1767 108.002 18.1944ZM109.05 11.0002C108.483 10.9951 107.922 11.1058 107.4 11.3256C106.877 11.5459 106.404 11.8711 106.011 12.2811C105.619 12.6912 105.314 13.1773 105.116 13.7096C104.922 14.2327 104.835 14.7894 104.861 15.3466C104.841 15.8928 104.931 16.4375 105.127 16.9478C105.327 17.4673 105.631 17.9401 106.022 18.3366C106.412 18.7331 106.88 19.0448 107.397 19.2522C107.908 19.4577 108.456 19.5564 109.007 19.5425C109.569 19.5533 110.128 19.448 110.648 19.2331C111.173 19.0162 111.646 18.6924 112.039 18.2823C112.432 17.8722 112.735 17.3848 112.929 16.8512C113.121 16.3239 113.202 15.7628 113.167 15.203C113.163 14.035 112.782 12.9803 112.056 12.2121C111.323 11.4362 110.28 10.9976 109.05 11.0002ZM107.934 13.8783C107.689 14.2501 107.562 14.7714 107.562 15.2895C107.562 16.5291 108.34 17.2239 109.03 17.2239C109.716 17.2239 110.479 16.5808 110.479 15.2652C110.479 14.8047 110.35 14.2869 110.093 13.9031C109.851 13.5403 109.507 13.3065 109.005 13.3065C108.495 13.3065 108.163 13.5319 107.934 13.8783Z" fill="white"/>
434
+ <path d="M94.3617 40.718H95.5396C99.9046 40.718 103.369 37.1844 103.369 32.8193V19.5164C103.369 15.1514 99.8353 11.6871 95.5396 11.6871H94.3617C89.9967 11.6871 86.5324 15.2207 86.5324 19.5164V32.8193C86.4631 37.1844 90.0659 40.718 94.3617 40.718ZM91.1052 19.5164C91.1052 17.715 92.5602 16.26 94.3617 16.26H95.5396C97.341 16.26 98.796 17.715 98.796 19.5164V32.8193C98.796 34.6208 97.341 36.0758 95.5396 36.0758H94.3617C92.5602 36.0758 91.1052 34.6208 91.1052 32.8193V19.5164Z" fill="white"/>
435
+ <path d="M74.6152 40.7179C79.2574 40.7179 82.9988 36.9765 82.9988 32.3343C82.9988 27.6922 79.2574 23.9507 74.6152 23.9507C73.9916 23.9507 73.2988 24.02 72.7445 24.1586C73.9223 21.4564 75.7931 18.685 78.7724 16.4678C79.8117 15.7749 80.0195 14.3199 79.2574 13.2806C78.5645 12.2413 77.1095 12.0335 76.0702 12.7956C67.8944 18.8928 66.578 28.0386 66.3701 31.2258C66.3701 31.2258 66.3701 31.2257 66.3701 31.295C66.3009 31.6415 66.3009 31.9879 66.3009 32.4036C66.2316 36.9072 70.0423 40.7179 74.6152 40.7179ZM74.6152 28.4543C76.6938 28.4543 78.3566 30.1865 78.3566 32.1958C78.3566 34.2051 76.6245 35.9372 74.6152 35.9372C72.6752 35.9372 71.0123 34.3436 70.8737 32.4729C70.8737 32.4036 70.943 32.265 70.943 32.1265C70.943 32.1265 70.943 31.9186 71.0123 31.5722C71.2202 29.84 72.8138 28.4543 74.6152 28.4543Z" fill="white"/>
436
+ <path d="M54.3143 36.0758C52.2358 36.0758 50.5729 34.3436 50.5729 32.3343C50.5729 31.0179 49.5336 30.0479 48.2864 30.0479C46.97 30.0479 46 31.0872 46 32.3343C46 36.9765 49.7414 40.718 54.3836 40.718C59.0258 40.718 62.7672 36.9765 62.7672 32.1958C62.7672 29.84 61.7279 27.6229 60.0651 26.0986C61.7279 24.505 62.7672 22.4264 62.7672 20.0014C62.7672 15.3592 59.0258 11.6178 54.3836 11.6178C49.7414 11.6178 46 15.3592 46 20.0014C46 21.3178 47.0393 22.2879 48.2864 22.2879C49.6029 22.2879 50.5729 21.2486 50.5729 20.0014C50.5729 17.9228 52.305 16.26 54.3143 16.26C56.3236 16.26 58.0558 17.9921 58.0558 20.0014C58.0558 22.0107 56.3236 23.7429 54.3143 23.7429C52.9979 23.7429 52.0279 24.7822 52.0279 26.0293C52.0279 27.3458 53.0672 28.3157 54.3143 28.3157C56.3929 28.3157 58.0558 30.0479 58.0558 32.0572C58.1251 34.3436 56.4622 36.0758 54.3143 36.0758Z" fill="white"/>
437
+ </g>
438
+ <g filter="url(#filter1_d_751_188)">
439
+ <path d="M26.8762 25.5149C27.5172 25.2883 28.1927 25.7659 28.1927 26.4458V33.5925C28.1927 34.0014 27.9493 34.3677 27.5768 34.5364C23.692 36.2966 3.80303 46.5259 37.3945 58.1537C37.3945 58.1537 57.0291 63.5205 76.923 63.6974C77.4752 63.7023 77.9231 63.2541 77.9231 62.7018V57.8317C77.9231 57.0995 78.6841 56.6156 79.3472 56.9261L103.851 68.4011C104.598 68.7507 104.624 69.8027 103.897 70.1897L79.3926 83.2187C78.7265 83.5728 77.9231 83.0901 77.9231 82.3357V75.7982C77.9231 75.2459 77.5039 74.797 76.9517 74.7892C68.3815 74.6673 6 72.8926 6 47.0574C6 47.0574 6 32.8966 26.8762 25.5149Z" fill="white"/>
440
+ <path d="M111.768 58.2062C110.979 57.639 111.335 56.0078 112.271 55.7479C118.431 54.037 131.443 49.0118 131.443 41.6445C131.443 34.2279 126.608 31.5583 124.732 30.8016C124.308 30.6306 124 30.2281 124 29.7708V26.2189C124 25.5882 124.573 25.1253 125.18 25.2967C129.233 26.4408 142.336 31.2278 142.336 45.2982C142.336 45.2982 142.336 58.9459 122.524 65.4395C122.224 65.5379 121.887 65.4876 121.63 65.3031L111.768 58.2062Z" fill="white"/>
441
+ </g>
442
+ </g>
443
+ <defs>
444
+ <filter id="filter0_d_751_188" x="38" y="3" width="83.1749" height="45.718" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
445
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
446
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
447
+ <feOffset/>
448
+ <feGaussianBlur stdDeviation="4"/>
449
+ <feComposite in2="hardAlpha" operator="out"/>
450
+ <feColorMatrix type="matrix" values="0 0 0 0 0.133333 0 0 0 0 0.145098 0 0 0 0 0.160784 0 0 0 0.4 0"/>
451
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_751_188"/>
452
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_751_188" result="shape"/>
453
+ </filter>
454
+ <filter id="filter1_d_751_188" x="4" y="25.2607" width="140.336" height="63.0764" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
455
+ <feFlood flood-opacity="0" result="BackgroundImageFix"/>
456
+ <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
457
+ <feOffset dy="3"/>
458
+ <feGaussianBlur stdDeviation="1"/>
459
+ <feComposite in2="hardAlpha" operator="out"/>
460
+ <feColorMatrix type="matrix" values="0 0 0 0 0.301961 0 0 0 0 0.360784 0 0 0 0 0.454902 0 0 0 0.4 0"/>
461
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_751_188"/>
462
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_751_188" result="shape"/>
463
+ </filter>
464
+ <clipPath id="clip0_751_188">
465
+ <rect width="150" height="87" fill="white"/>
466
+ </clipPath>
467
+ </defs>
429
468
  </svg>
430
- `, Vi = (e) => {
469
+ `, Ki = (e) => {
431
470
  const t = document.createElement("div");
432
- return t.className = "cloudimage-initial-icon", t.setAttribute("aria-label", "360 degree view - drag to rotate"), e ? (t.style.backgroundImage = `url('${e}')`, t.style.backgroundPosition = "50% 50%", t.style.backgroundSize = "contain", t.style.backgroundRepeat = "no-repeat") : t.innerHTML = Ni, t;
433
- }, ji = (e, t) => {
471
+ return t.className = "cloudimage-initial-icon", t.setAttribute("aria-label", "360 degree view - drag to rotate"), e ? (t.style.backgroundImage = `url('${e}')`, t.style.backgroundPosition = "50% 50%", t.style.backgroundSize = "contain", t.style.backgroundRepeat = "no-repeat") : t.innerHTML = Ui, t;
472
+ }, Ji = (e, t) => {
434
473
  const { width: i, height: s } = t, o = document.createElement("canvas");
435
474
  return o.width = i, o.height = s, o.style.width = "100%", o.style.height = "auto", e.appendChild(o), o;
436
- }, $i = () => {
475
+ }, qi = () => {
437
476
  const e = document.createElement("button");
438
477
  return e.className = "cloudimage-360-button cloudimage-360-close-icon", e.setAttribute("aria-label", "Close fullscreen"), e.setAttribute("type", "button"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>', e;
439
- }, zi = () => {
478
+ }, Qi = () => {
440
479
  const e = document.createElement("button");
441
480
  return e.className = "cloudimage-360-button cloudimage-360-fullscreen-button", e.setAttribute("aria-label", "View fullscreen"), e.setAttribute("type", "button"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/></svg>', e;
442
- }, ge = (e) => {
481
+ }, be = (e) => {
443
482
  const t = document.createElement("div");
444
483
  return t.className = "cloudimage-360-icons-container", e.appendChild(t), t;
445
- }, Gi = (e) => {
484
+ }, ts = (e) => {
446
485
  const t = document.createElement("div");
447
486
  return t.className = "cloudimage-360-inner-box", t.setAttribute("role", "img"), t.setAttribute("aria-label", "360 degree product view. Use mouse drag or arrow keys to rotate."), e.appendChild(t), t;
448
- }, Ui = () => {
487
+ }, es = () => {
449
488
  const e = document.createElement("button");
450
489
  return e.className = "cloudimage-360-button cloudimage-360-magnifier-button", e.setAttribute("aria-label", "Magnify image"), e.setAttribute("type", "button"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/><path d="M11 8v6"/><path d="M8 11h6"/></svg>', e;
451
- }, Ki = (e) => {
490
+ }, is = () => {
491
+ const e = document.createElement("button");
492
+ return e.className = "cloudimage-360-button cloudimage-360-zoom-out-button", e.setAttribute("aria-label", "Zoom out"), e.setAttribute("type", "button"), e.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/><path d="M8 11h6"/></svg>', e;
493
+ }, ss = (e) => {
452
494
  const t = document.createElement("div");
453
- t.className = "cloudimage-initial-icon";
495
+ t.className = "cloudimage-360-loader";
454
496
  const i = document.createElement("span");
455
497
  return i.className = "percentage", i.innerText = "0%", t.appendChild(i), e.appendChild(t), t;
456
- }, _i = (e) => {
498
+ }, os = (e) => {
457
499
  const t = document.createElement("div");
458
500
  t.className = "cloudimage-360-fullscreen-modal";
459
501
  const i = e.cloneNode();
460
502
  return i.style.width = "100%", i.style.maxWidth = "100%", i.style.height = "100vh", i.style.maxHeight = "100%", t.appendChild(i), window.document.body.appendChild(t), i;
461
- }, Jt = (e, t) => {
503
+ }, qt = (e, t) => {
462
504
  const i = e.querySelector(t);
463
505
  i && i.parentNode.removeChild(i);
464
- }, Ji = () => {
506
+ }, ns = () => {
465
507
  const e = document.createElement("div");
466
508
  return e.className = "cloudimage-loading-spinner", e;
467
- }, qi = () => {
509
+ }, rs = () => {
468
510
  const e = document.createElement("div");
469
511
  return e.className = "cloudimage-360-transition-overlay", e;
470
- }, Qi = (e) => {
512
+ }, as = (e) => {
471
513
  const t = document.createElement("div");
472
514
  return t.className = "cloudimage-360-hotspot-container", e.appendChild(t), t;
473
- }, ts = (e) => {
515
+ }, ls = (e) => {
474
516
  const t = document.createElement("div");
475
517
  return t.className = "cloudimage-360-sr-only", t.setAttribute("role", "status"), t.setAttribute("aria-live", "polite"), t.setAttribute("aria-atomic", "true"), e.appendChild(t), t;
476
- }, es = (e, t) => {
518
+ }, cs = (e, t) => {
477
519
  e && (e.textContent = "", setTimeout(() => {
478
520
  e.textContent = t;
479
521
  }, 50));
480
- }, We = {
522
+ }, je = {
481
523
  drag: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2"/><path d="M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2"/><path d="M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8"/><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/></svg>',
482
524
  swipe: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="M8 12h8"/></svg>',
483
525
  click: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 9 5 12 1.8-5.2L21 14Z"/><path d="M7.2 2.2 8 5.1"/><path d="m5.1 8-2.9-.8"/><path d="M14 4.1 12 6"/><path d="m6 12-1.9 2"/></svg>',
484
526
  pinch: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l4 4"/><path d="M18 6l-4 4"/><path d="M6 18l4-4"/><path d="M18 18l-4-4"/><circle cx="12" cy="12" r="2"/></svg>',
485
527
  keys: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="20" height="16" x="2" y="4" rx="2"/><path d="m9 10 3 3 3-3"/></svg>',
486
528
  fullscreen: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/></svg>'
487
- }, is = {
529
+ }, we = {
488
530
  drag: "Drag to rotate",
489
531
  swipe: "Swipe to rotate",
490
532
  click: "Click to zoom",
533
+ dblclick: "Double-click to zoom",
491
534
  pinch: "Pinch to zoom",
492
535
  keys: "Use arrow keys",
493
536
  fullscreen: "Click for fullscreen"
494
- }, ss = (e) => {
495
- const t = document.createElement("div");
496
- return t.className = "cloudimage-360-hint-item", t.innerHTML = `
497
- ${We[e]}
498
- <span>${is[e]}</span>
499
- `, t;
500
- }, ye = (e, t = []) => {
501
- if (!t || t.length === 0) return null;
537
+ }, hs = (e, t = {}) => {
502
538
  const i = document.createElement("div");
503
- i.className = "cloudimage-360-hints-overlay", i.setAttribute("role", "tooltip"), i.setAttribute("aria-label", "Interaction hints");
539
+ i.className = "cloudimage-360-hint-item";
540
+ let s = we[e];
541
+ return e === "click" && t.pointerZoomTrigger === "dblclick" && (s = we.dblclick), i.innerHTML = `
542
+ ${je[e]}
543
+ <span>${s}</span>
544
+ `, i;
545
+ }, Ie = (e, t = [], i = {}) => {
546
+ if (!t || t.length === 0) return null;
504
547
  const s = document.createElement("div");
505
- return s.className = "cloudimage-360-hints-container", t.forEach((o) => {
506
- We[o] && s.appendChild(ss(o));
507
- }), i.appendChild(s), e.appendChild(i), i;
508
- }, be = (e, t) => t ? ["swipe"] : ["drag", "click"], we = (e) => {
548
+ s.className = "cloudimage-360-hints-overlay", s.setAttribute("role", "tooltip"), s.setAttribute("aria-label", "Interaction hints");
549
+ const o = document.createElement("div");
550
+ return o.className = "cloudimage-360-hints-container", t.forEach((n) => {
551
+ je[n] && o.appendChild(hs(n, i));
552
+ }), s.appendChild(o), e.appendChild(s), s;
553
+ }, Ce = (e, t) => t ? ["swipe", "pinch"] : ["drag", "click"], xe = (e) => {
509
554
  e && e.classList.add("visible");
510
- }, os = (e) => {
555
+ }, ds = (e) => {
511
556
  e && (e.classList.remove("visible"), e.classList.add("hiding"), setTimeout(() => {
512
557
  e.classList.remove("hiding");
513
558
  }, 300));
514
- }, ns = (e) => {
559
+ }, us = (e) => {
515
560
  if (!e || typeof e != "object") return null;
516
561
  const t = Object.keys(e).map((s) => parseInt(s, 10)).filter((s) => !isNaN(s)).sort((s, o) => s - o);
517
562
  if (t.length === 0) return null;
518
563
  const i = Math.floor(t.length / 2);
519
564
  return t[i];
520
- }, rs = (e) => {
565
+ }, ps = (e) => {
521
566
  const t = [];
522
567
  return !e || !Array.isArray(e) || e.forEach((i, s) => {
523
- const o = ns(i.positions);
568
+ const o = us(i.positions);
524
569
  o !== null && t.push({
525
570
  id: i.id || `hotspot-${s}`,
526
571
  frame: o,
527
572
  label: i.label || null
528
573
  });
529
574
  }), t;
530
- }, as = 400, ls = (e, t, i, s) => {
575
+ }, ms = 400, fs = (e, t, i, s) => {
531
576
  const o = document.createElement("button");
532
577
  o.className = "cloudimage-360-hotspot-timeline-dot", o.setAttribute("type", "button"), o.setAttribute("aria-label", s || `Go to hotspot at frame ${t + 1}`), o.setAttribute("data-frame", t.toString()), o.setAttribute("data-hotspot-id", e);
533
578
  const n = i > 1 ? t / (i - 1) * 100 : 0;
@@ -538,7 +583,7 @@ const de = /* @__PURE__ */ ii(wi), M = {
538
583
  o.addEventListener("mouseenter", () => {
539
584
  r = setTimeout(() => {
540
585
  l.classList.add("visible");
541
- }, as);
586
+ }, ms);
542
587
  }), o.addEventListener("mouseleave", () => {
543
588
  r && (clearTimeout(r), r = null), l.classList.remove("visible");
544
589
  }), o.addEventListener("click", () => {
@@ -546,8 +591,8 @@ const de = /* @__PURE__ */ ii(wi), M = {
546
591
  });
547
592
  }
548
593
  return o;
549
- }, cs = (e, t, i) => {
550
- const s = rs(i);
594
+ }, vs = (e, t, i) => {
595
+ const s = ps(i);
551
596
  if (s.length === 0) return null;
552
597
  const o = document.createElement("div");
553
598
  o.className = "cloudimage-360-hotspot-timeline", o.setAttribute("role", "navigation"), o.setAttribute("aria-label", "Hotspot timeline navigation");
@@ -555,37 +600,37 @@ const de = /* @__PURE__ */ ii(wi), M = {
555
600
  n.className = "cloudimage-360-hotspot-timeline-track";
556
601
  const l = document.createElement("div");
557
602
  return l.className = "cloudimage-360-hotspot-timeline-indicator", s.forEach(({ id: r, frame: a, label: c }) => {
558
- const h = ls(r, a, t, c);
603
+ const h = fs(r, a, t, c);
559
604
  n.appendChild(h);
560
605
  }), n.appendChild(l), o.appendChild(n), e.appendChild(o), {
561
606
  element: o,
562
607
  indicator: l,
563
608
  hotspotFrames: s
564
609
  };
565
- }, hs = (e, t, i) => {
610
+ }, gs = (e, t, i) => {
566
611
  if (!e) return;
567
612
  const s = i > 1 ? t / (i - 1) * 100 : 0;
568
613
  e.style.left = `${s}%`;
569
- }, ds = (e) => {
614
+ }, ys = (e) => {
570
615
  e && e.classList.add("visible");
571
- }, us = (e) => {
616
+ }, bs = (e) => {
572
617
  e && e.classList.remove("visible");
573
- }, qt = (e, t = []) => {
618
+ }, Qt = (e, t = []) => {
574
619
  if (!e) return t;
575
620
  try {
576
621
  return JSON.parse(e);
577
622
  } catch (i) {
578
623
  return console.warn("CloudImage 360: Failed to parse JSON:", i.message), t;
579
624
  }
580
- }, ps = (e, t) => {
625
+ }, ws = (e, t) => {
581
626
  const [i, s] = e.split("?");
582
627
  if (!s) return e;
583
628
  const o = new RegExp(`^${t}=|&${t}=`), n = s.split("&").filter((l) => !o.test(l)).join("&");
584
629
  return n ? `${i}?${n}` : i;
585
- }, fs = (e) => {
586
- const t = ps(e, "width"), i = t.includes("?") ? "&" : "?";
630
+ }, Is = (e) => {
631
+ const t = ws(e, "width"), i = t.includes("?") ? "&" : "?";
587
632
  return `${t}${i}width=${150 * devicePixelRatio}`;
588
- }, ms = (e) => {
633
+ }, Cs = (e) => {
589
634
  const t = {
590
635
  root: null,
591
636
  rootMargin: "0px",
@@ -599,25 +644,25 @@ const de = /* @__PURE__ */ ii(wi), M = {
599
644
  l.isIntersecting && (i(l.target), n.unobserve(l.target));
600
645
  });
601
646
  }, t).observe(e);
602
- }, vs = (e, t) => {
603
- const i = Be(1, t);
647
+ }, xs = (e, t) => {
648
+ const i = ze(1, t);
604
649
  return e.replace("{index}", i);
605
- }, gs = (e, t) => {
650
+ }, Os = (e, t) => {
606
651
  const [i] = e, s = /(https?):\/\//i.test(i);
607
- return Et({
652
+ return xt({
608
653
  ...t,
609
654
  folder: s ? "" : t.folder,
610
655
  filename: i
611
656
  });
612
- }, ys = (e, t) => {
657
+ }, Es = (e, t) => {
613
658
  const { imageList: i, indexZeroBase: s } = t;
614
659
  if (i.length) {
615
- const o = qt(i, null);
660
+ const o = Qt(i, null);
616
661
  if (o)
617
- return gs(o, t);
662
+ return Os(o, t);
618
663
  }
619
- return vs(e, s);
620
- }, Ie = (e, t, i) => {
664
+ return xs(e, s);
665
+ }, Oe = (e, t, i) => {
621
666
  const s = new Image();
622
667
  return s.setAttribute(t ? "data-src" : "src", e), s.className = i, s.style.cssText = `
623
668
  position: ${t ? "absolute" : "static"};
@@ -628,9 +673,9 @@ const de = /* @__PURE__ */ ii(wi), M = {
628
673
  object-position: center;
629
674
  filter: blur(10px);
630
675
  `, s;
631
- }, xe = (e, t, i) => {
632
- const { innerBox: s, imageList: o, lazyload: n } = t || {}, [l] = o, r = l || ys(e, t), a = fs(r), c = Ie(a, n, "cloudimage-lazy"), h = Ie(a, !1, "cloudimage-360-placeholder"), p = (f) => {
633
- Jt(s, ".cloudimage-lazy"), i && i({
676
+ }, Ee = (e, t, i) => {
677
+ const { innerBox: s, imageList: o, lazyload: n } = t || {}, [l] = o, r = l || Es(e, t), a = Is(r), c = Oe(a, n, "cloudimage-lazy"), h = Oe(a, !1, "cloudimage-360-placeholder"), u = (f) => {
678
+ qt(s, ".cloudimage-lazy"), i && i({
634
679
  event: f,
635
680
  width: c.width,
636
681
  height: c.height,
@@ -639,8 +684,8 @@ const de = /* @__PURE__ */ ii(wi), M = {
639
684
  src: a
640
685
  });
641
686
  };
642
- c.onload = p, s.appendChild(c), s.appendChild(h), ms(c);
643
- }, bs = (e, t, i) => {
687
+ c.onload = u, s.appendChild(c), s.appendChild(h), Cs(c);
688
+ }, As = (e, t, i) => {
644
689
  const s = new Image();
645
690
  s.src = e, s.onload = (o) => {
646
691
  t && t({
@@ -655,59 +700,75 @@ const de = /* @__PURE__ */ ii(wi), M = {
655
700
  const n = new Error(`Failed to load image: ${e}`);
656
701
  n.url = e, n.event = o, i ? i(n) : console.error(n.message);
657
702
  };
658
- }, ws = (e, t) => {
703
+ }, Ss = (e, t) => {
659
704
  const i = t.getBoundingClientRect(), s = e.touches ? e.touches[0].clientX : e.clientX, o = e.touches ? e.touches[0].clientY : e.clientY;
660
705
  return {
661
706
  x: s - i.left,
662
707
  y: o - i.top
663
708
  };
664
- }, _t = (e, t, i) => {
665
- const { container: s, w: o, h: n, zoom: l, bw: r, offsetX: a, offsetY: c } = t, h = ws(e, s);
666
- let p = h.x, f = h.y;
667
- p = Math.max(o / l, Math.min(p, s.offsetWidth - o / l)), f = Math.max(n / l, Math.min(f, s.offsetHeight - n / l)), i.style.left = `${p - o}px`, i.style.top = `${f - n}px`;
668
- const u = (p - a) * l - o + r, I = (f - c) * l - n + r;
669
- i.style.backgroundPosition = `-${u}px -${I}px`;
670
- }, Is = (e, t, i, s, o, n) => {
709
+ }, Jt = (e, t, i) => {
710
+ const { container: s, w: o, h: n, zoom: l, bw: r, offsetX: a, offsetY: c } = t, h = Ss(e, s);
711
+ let u = h.x, f = h.y;
712
+ u = Math.max(o / l, Math.min(u, s.offsetWidth - o / l)), f = Math.max(n / l, Math.min(f, s.offsetHeight - n / l)), i.style.left = `${u - o}px`, i.style.top = `${f - n}px`;
713
+ const p = (u - a) * l - o + r, I = (f - c) * l - n + r;
714
+ i.style.backgroundPosition = `-${p}px -${I}px`;
715
+ }, ks = (e, t, i, s, o, n) => {
671
716
  const { x: l = 0, y: r = 0 } = i || {}, a = (t.offsetWidth - l * 2) * n, c = (t.offsetHeight - r * 2) * n;
672
717
  if (!o) return;
673
718
  o.setAttribute("class", "cloudimage-360-img-magnifier-glass"), t.prepend(o), o.style.backgroundImage = `url('${s.src}')`, o.style.backgroundSize = `${a}px ${c}px`;
674
- const h = 3, p = o.offsetWidth / 2, f = o.offsetHeight / 2, u = {
719
+ const h = 3, u = o.offsetWidth / 2, f = o.offsetHeight / 2, p = {
675
720
  container: t,
676
- w: p,
721
+ w: u,
677
722
  h: f,
678
723
  zoom: n,
679
724
  bw: h,
680
725
  offsetX: l,
681
726
  offsetY: r
682
727
  };
683
- _t(e, u, o);
728
+ Jt(e, p, o);
684
729
  const I = (v) => {
685
- _t(v, u, o);
686
- }, g = (v) => {
687
- v.preventDefault(), _t(v, u, o);
730
+ Jt(v, p, o);
731
+ }, b = (v) => {
732
+ v.preventDefault(), Jt(v, p, o);
688
733
  };
689
- o.addEventListener("mousemove", I), t.addEventListener("mousemove", I), t.addEventListener("touchmove", g);
690
- }, xs = (e, t, i) => {
734
+ o.addEventListener("mousemove", I), t.addEventListener("mousemove", I), t.addEventListener("touchmove", b);
735
+ }, Ts = (e, t, i) => {
691
736
  const { clientX: s, clientY: o } = e, n = t.getBoundingClientRect(), l = t.width / (n.width * i), r = t.height / (n.height * i), a = (s - n.left) * l, c = (o - n.top) * r;
692
737
  return { offsetX: a, offsetY: c };
693
- }, Ce = (e, { bottom: t, top: i }) => {
738
+ }, Ls = (e, t, i) => {
739
+ const s = e / i, o = t / i;
740
+ return { zoomedWidth: s, zoomedHeight: o };
741
+ }, Ms = ({
742
+ pointerX: e,
743
+ pointerY: t,
744
+ imageData: i,
745
+ zoomedWidth: s,
746
+ zoomedHeight: o,
747
+ drawWidth: n,
748
+ drawHeight: l
749
+ }) => {
750
+ const { naturalWidth: r, naturalHeight: a } = i;
751
+ let c = e / n * r - s / 2, h = t / l * a - o / 2;
752
+ const u = Math.max(0, r - s), f = Math.max(0, a - o);
753
+ return c = Math.max(0, Math.min(c, u)), h = Math.max(0, Math.min(h, f)), { zoomOffsetX: c, zoomOffsetY: h };
754
+ }, Ae = (e, { bottom: t, top: i }) => {
694
755
  e ? t() : i();
695
- }, Oe = (e, { left: t, right: i }) => {
756
+ }, Se = (e, { left: t, right: i }) => {
696
757
  e ? t() : i();
697
- }, Cs = ({ autoplayBehavior: e, spinY: t, reversed: i, loopTriggers: s }) => {
758
+ }, Ps = ({ autoplayBehavior: e, spinY: t, reversed: i, loopTriggers: s }) => {
698
759
  switch (e) {
699
- case M.SPIN_XY:
700
- case M.SPIN_YX:
701
- t ? Ce(i, s) : Oe(i, s);
760
+ case R.SPIN_XY:
761
+ case R.SPIN_YX:
762
+ t ? Ae(i, s) : Se(i, s);
702
763
  break;
703
- case M.SPIN_Y:
704
- Ce(i, s);
764
+ case R.SPIN_Y:
765
+ Ae(i, s);
705
766
  break;
706
- case M.SPIN_X:
767
+ case R.SPIN_X:
707
768
  default:
708
- Oe(i, s);
769
+ Se(i, s);
709
770
  }
710
- }, Os = ({
771
+ }, Ys = ({
711
772
  autoplayBehavior: e,
712
773
  activeImageX: t,
713
774
  activeImageY: i,
@@ -720,15 +781,15 @@ const de = /* @__PURE__ */ ii(wi), M = {
720
781
  return n ? r === 0 : r === c;
721
782
  };
722
783
  switch (e) {
723
- case M.SPIN_XY:
724
- case M.SPIN_Y:
784
+ case R.SPIN_XY:
785
+ case R.SPIN_Y:
725
786
  return l(i, o);
726
- case M.SPIN_X:
727
- case M.SPIN_YX:
787
+ case R.SPIN_X:
788
+ case R.SPIN_YX:
728
789
  default:
729
790
  return l(t, s);
730
791
  }
731
- }, Es = ({
792
+ }, Xs = ({
732
793
  autoplayBehavior: e,
733
794
  activeImageX: t,
734
795
  activeImageY: i,
@@ -738,39 +799,39 @@ const de = /* @__PURE__ */ ii(wi), M = {
738
799
  spinDirection: l
739
800
  }) => {
740
801
  const r = t === (n ? 0 : s - 1), a = i === (n ? 0 : o - 1);
741
- return e === M.SPIN_XY || e === M.SPIN_YX ? l === "x" && r || l === "y" && a : !1;
742
- }, Ss = (e, t, i) => {
802
+ return e === R.SPIN_XY || e === R.SPIN_YX ? l === "x" && r || l === "y" && a : !1;
803
+ }, Rs = (e, t, i) => {
743
804
  if (!i) return "x";
744
805
  if (!t) return "y";
745
806
  switch (e) {
746
- case M.SPIN_XY:
807
+ case R.SPIN_XY:
747
808
  return "x";
748
- case M.SPIN_YX:
809
+ case R.SPIN_YX:
749
810
  return "y";
750
- case M.SPIN_Y:
811
+ case R.SPIN_Y:
751
812
  return "y";
752
- case M.SPIN_X:
813
+ case R.SPIN_X:
753
814
  default:
754
815
  return "x";
755
816
  }
756
- }, As = (e) => e === "x" ? "y" : "x", Ee = (e, t) => {
757
- const i = [...xi];
758
- return t ? [...i, ...Ci].includes(e) : i.includes(e);
759
- }, Se = ({ deltaX: e, deltaY: t, reversed: i, allowSpinX: s, allowSpinY: o, threshold: n = 0 }) => {
817
+ }, Hs = (e) => e === "x" ? "y" : "x", ke = (e, t) => {
818
+ const i = [...Si];
819
+ return t ? [...i, ...ki].includes(e) : i.includes(e);
820
+ }, Te = ({ deltaX: e, deltaY: t, reversed: i, allowSpinX: s, allowSpinY: o, threshold: n = 0 }) => {
760
821
  const l = s && !o || o && !s ? 0 : n, r = Math.abs(e), a = Math.abs(t);
761
822
  return s && r - l > a ? i ? e > 0 ? "left" : "right" : e > 0 ? "right" : "left" : o && a - l > r ? i ? t > 0 ? "up" : "down" : t > 0 ? "down" : "up" : null;
762
- }, Ls = () => "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, ks = (e, t = 150) => {
823
+ }, Zs = () => "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, Ds = (e, t = 150) => {
763
824
  let i;
764
825
  return function(...s) {
765
826
  clearTimeout(i), i = setTimeout(() => {
766
827
  e.apply(this, s);
767
828
  }, t);
768
829
  };
769
- }, Fe = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHY9KHQsYSxlKT0+e2NvbnN0IHM9dC9lLG49YS9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sej0oe3BvaW50ZXJYOnQscG9pbnRlclk6YSxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOmcsbmF0dXJhbEhlaWdodDp1fT1lO2xldCBmPXQvaSpnLXMvMixtPWEvYyp1LW4vMjtjb25zdCB4PU1hdGgubWF4KDAsZy1zKSxPPU1hdGgubWF4KDAsdS1uKTtyZXR1cm4gZj1NYXRoLm1heCgwLE1hdGgubWluKGYseCkpLG09TWF0aC5tYXgoMCxNYXRoLm1pbihtLE8pKSx7em9vbU9mZnNldFg6Zix6b29tT2Zmc2V0WTptfX07bGV0IG8saCxyLGQsbCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIHQ9Pntjb25zdHthY3Rpb246YSxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpnLGltYWdlQXNwZWN0UmF0aW86dSxjb250YWluZXJXaWR0aDpmLGNvbnRhaW5lckhlaWdodDptfT10LmRhdGE7c3dpdGNoKGEpe2Nhc2UiaW5pdENhbnZhcyI6QyhlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjpwKHUsZixtKTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpJKG4saSxjLGcpO2JyZWFrfX07Y29uc3QgQz0odCxhKT0+e289dCxoPW8uZ2V0Q29udGV4dCgiMmQiKSxyPWF9LHA9KHQsYSxlKT0+e2NvbnN0IHM9YS9lO3c9dD5zLG8ud2lkdGg9YSpyLG8uaGVpZ2h0PWUqcixoLnNjYWxlKHIsciksdz8oZD1hLGw9YS90KToobD1lLGQ9ZSp0KSxoLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxoLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEk9KHQ9e30sYT0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09dDtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L3ItbCkvMik6KGk9KG8ud2lkdGgvci1kKS8yLGM9MCksaC5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLGEhPT0xKXtjb25zdHtuYXR1cmFsV2lkdGg6ZyxuYXR1cmFsSGVpZ2h0OnV9PXQse3pvb21lZFdpZHRoOmYsem9vbWVkSGVpZ2h0Om19PXYoZyx1LGEpLHt6b29tT2Zmc2V0WDp4LHpvb21PZmZzZXRZOk99PXooe3BvaW50ZXJYOmUscG9pbnRlclk6cyxpbWFnZURhdGE6dCx6b29tZWRXaWR0aDpmLHpvb21lZEhlaWdodDptLGRyYXdXaWR0aDpkLGRyYXdIZWlnaHQ6bH0pO2guZHJhd0ltYWdlKG4seCxPLGYsbSxpLGMsZCxsKX1lbHNlIGguZHJhd0ltYWdlKG4saSxjLGQsbCl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y2FudmFzLndvcmtlci1DZzBma3BEMS5qcy5tYXAK", Ts = (e) => Uint8Array.from(atob(e), (t) => t.charCodeAt(0)), Ae = typeof self < "u" && self.Blob && new Blob([Ts(Fe)], { type: "text/javascript;charset=utf-8" });
770
- function Ys(e) {
830
+ }, $e = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHY9KHQsYSxlKT0+e2NvbnN0IHM9dC9lLG49YS9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sej0oe3BvaW50ZXJYOnQscG9pbnRlclk6YSxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOmcsbmF0dXJhbEhlaWdodDp1fT1lO2xldCBmPXQvaSpnLXMvMixtPWEvYyp1LW4vMjtjb25zdCB4PU1hdGgubWF4KDAsZy1zKSxPPU1hdGgubWF4KDAsdS1uKTtyZXR1cm4gZj1NYXRoLm1heCgwLE1hdGgubWluKGYseCkpLG09TWF0aC5tYXgoMCxNYXRoLm1pbihtLE8pKSx7em9vbU9mZnNldFg6Zix6b29tT2Zmc2V0WTptfX07bGV0IG8saCxyLGQsbCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIHQ9Pntjb25zdHthY3Rpb246YSxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpnLGltYWdlQXNwZWN0UmF0aW86dSxjb250YWluZXJXaWR0aDpmLGNvbnRhaW5lckhlaWdodDptfT10LmRhdGE7c3dpdGNoKGEpe2Nhc2UiaW5pdENhbnZhcyI6QyhlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjpwKHUsZixtKTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpJKG4saSxjLGcpO2JyZWFrfX07Y29uc3QgQz0odCxhKT0+e289dCxoPW8uZ2V0Q29udGV4dCgiMmQiKSxyPWF9LHA9KHQsYSxlKT0+e2NvbnN0IHM9YS9lO3c9dD5zLG8ud2lkdGg9YSpyLG8uaGVpZ2h0PWUqcixoLnNjYWxlKHIsciksdz8oZD1hLGw9YS90KToobD1lLGQ9ZSp0KSxoLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxoLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEk9KHQ9e30sYT0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09dDtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L3ItbCkvMik6KGk9KG8ud2lkdGgvci1kKS8yLGM9MCksaC5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLGEhPT0xKXtjb25zdHtuYXR1cmFsV2lkdGg6ZyxuYXR1cmFsSGVpZ2h0OnV9PXQse3pvb21lZFdpZHRoOmYsem9vbWVkSGVpZ2h0Om19PXYoZyx1LGEpLHt6b29tT2Zmc2V0WDp4LHpvb21PZmZzZXRZOk99PXooe3BvaW50ZXJYOmUscG9pbnRlclk6cyxpbWFnZURhdGE6dCx6b29tZWRXaWR0aDpmLHpvb21lZEhlaWdodDptLGRyYXdXaWR0aDpkLGRyYXdIZWlnaHQ6bH0pO2guZHJhd0ltYWdlKG4seCxPLGYsbSxpLGMsZCxsKX1lbHNlIGguZHJhd0ltYWdlKG4saSxjLGQsbCl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y2FudmFzLndvcmtlci1DZzBma3BEMS5qcy5tYXAK", Bs = (e) => Uint8Array.from(atob(e), (t) => t.charCodeAt(0)), Le = typeof self < "u" && self.Blob && new Blob([Bs($e)], { type: "text/javascript;charset=utf-8" });
831
+ function Ws(e) {
771
832
  let t;
772
833
  try {
773
- if (t = Ae && (self.URL || self.webkitURL).createObjectURL(Ae), !t) throw "";
834
+ if (t = Le && (self.URL || self.webkitURL).createObjectURL(Le), !t) throw "";
774
835
  const i = new Worker(t, {
775
836
  name: e == null ? void 0 : e.name
776
837
  });
@@ -779,7 +840,7 @@ function Ys(e) {
779
840
  }), i;
780
841
  } catch {
781
842
  return new Worker(
782
- "data:text/javascript;base64," + Fe,
843
+ "data:text/javascript;base64," + $e,
783
844
  {
784
845
  name: e == null ? void 0 : e.name
785
846
  }
@@ -788,7 +849,84 @@ function Ys(e) {
788
849
  t && (self.URL || self.webkitURL).revokeObjectURL(t);
789
850
  }
790
851
  }
791
- const Xs = /* @__PURE__ */ new Set([
852
+ class Fs {
853
+ constructor() {
854
+ this.canvas = null, this.ctx = null, this.dpr = 1, this.drawWidth = 0, this.drawHeight = 0, this.wideImage = !1;
855
+ }
856
+ /**
857
+ * Mimics worker.postMessage() interface
858
+ */
859
+ postMessage(t) {
860
+ const {
861
+ action: i,
862
+ offscreen: s,
863
+ // Will be a regular canvas on main thread
864
+ devicePixelRatio: o,
865
+ imageData: n,
866
+ zoomScale: l,
867
+ pointerX: r,
868
+ pointerY: a,
869
+ imageAspectRatio: c,
870
+ containerWidth: h,
871
+ containerHeight: u
872
+ } = t;
873
+ switch (i) {
874
+ case "initCanvas":
875
+ this.initCanvas(s, o);
876
+ break;
877
+ case "adaptCanvasSize":
878
+ this.adaptCanvasSize(c, h, u);
879
+ break;
880
+ case "drawImageOnCanvas":
881
+ this.drawImageOnCanvas(n, l, r, a);
882
+ break;
883
+ }
884
+ }
885
+ /**
886
+ * Mimics worker.terminate() - cleans up resources
887
+ */
888
+ terminate() {
889
+ var t, i;
890
+ this.ctx && this.ctx.clearRect(0, 0, ((t = this.canvas) == null ? void 0 : t.width) || 0, ((i = this.canvas) == null ? void 0 : i.height) || 0), this.canvas = null, this.ctx = null;
891
+ }
892
+ initCanvas(t, i) {
893
+ this.canvas = t, this.ctx = t.getContext("2d"), this.dpr = i;
894
+ }
895
+ adaptCanvasSize(t, i, s) {
896
+ if (!this.canvas || !this.ctx) return;
897
+ const o = i / s;
898
+ this.wideImage = t > o, this.canvas.width = i * this.dpr, this.canvas.height = s * this.dpr, this.ctx.scale(this.dpr, this.dpr), this.wideImage ? (this.drawWidth = i, this.drawHeight = i / t) : (this.drawHeight = s, this.drawWidth = s * t), this.ctx.imageSmoothingEnabled = !0, this.ctx.imageSmoothingQuality = "high";
899
+ }
900
+ drawImageOnCanvas(t = {}, i = 1, s = 0, o = 0) {
901
+ const { bitmapImage: n } = t;
902
+ if (!this.canvas || !this.ctx || !n) return;
903
+ let l, r;
904
+ if (this.wideImage ? (l = 0, r = (this.canvas.height / this.dpr - this.drawHeight) / 2) : (l = (this.canvas.width / this.dpr - this.drawWidth) / 2, r = 0), this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height), i !== 1) {
905
+ const { naturalWidth: a, naturalHeight: c } = t, { zoomedWidth: h, zoomedHeight: u } = Ls(a, c, i), { zoomOffsetX: f, zoomOffsetY: p } = Ms({
906
+ pointerX: s,
907
+ pointerY: o,
908
+ imageData: t,
909
+ zoomedWidth: h,
910
+ zoomedHeight: u,
911
+ drawWidth: this.drawWidth,
912
+ drawHeight: this.drawHeight
913
+ });
914
+ this.ctx.drawImage(
915
+ n,
916
+ f,
917
+ p,
918
+ h,
919
+ u,
920
+ l,
921
+ r,
922
+ this.drawWidth,
923
+ this.drawHeight
924
+ );
925
+ } else
926
+ this.ctx.drawImage(n, l, r, this.drawWidth, this.drawHeight);
927
+ }
928
+ }
929
+ const Vs = /* @__PURE__ */ new Set([
792
930
  // Basic HTML
793
931
  "p",
794
932
  "span",
@@ -847,7 +985,7 @@ const Xs = /* @__PURE__ */ new Set([
847
985
  "lineargradient",
848
986
  "radialgradient",
849
987
  "stop"
850
- ]), Le = {
988
+ ]), Me = {
851
989
  a: ["href", "title", "target", "rel"],
852
990
  img: ["src", "alt", "title", "width", "height"],
853
991
  button: ["type", "disabled", "name", "value"],
@@ -875,12 +1013,12 @@ const Xs = /* @__PURE__ */ new Set([
875
1013
  clippath: ["id"],
876
1014
  mask: ["id"],
877
1015
  "*": ["class", "id", "style"]
878
- }, Ps = [
1016
+ }, Ns = [
879
1017
  /javascript:/gi,
880
1018
  /vbscript:/gi,
881
1019
  /data:/gi,
882
1020
  /on\w+\s*=/gi
883
- ], Rs = (e) => {
1021
+ ], zs = (e) => {
884
1022
  if (typeof e != "string")
885
1023
  return "";
886
1024
  const t = document.createElement("template");
@@ -888,7 +1026,7 @@ const Xs = /* @__PURE__ */ new Set([
888
1026
  const i = (s) => {
889
1027
  if (Array.from(s.childNodes).forEach(i), s.nodeType === Node.ELEMENT_NODE) {
890
1028
  const n = s.tagName.toLowerCase();
891
- if (!Xs.has(n)) {
1029
+ if (!Vs.has(n)) {
892
1030
  if (n === "script" || n === "style") {
893
1031
  s.remove();
894
1032
  return;
@@ -898,8 +1036,8 @@ const Xs = /* @__PURE__ */ new Set([
898
1036
  return;
899
1037
  }
900
1038
  const l = [
901
- ...Le[n] || [],
902
- ...Le["*"] || []
1039
+ ...Me[n] || [],
1040
+ ...Me["*"] || []
903
1041
  ];
904
1042
  if (Array.from(s.attributes).forEach((a) => {
905
1043
  const c = a.name.toLowerCase();
@@ -912,8 +1050,8 @@ const Xs = /* @__PURE__ */ new Set([
912
1050
  return;
913
1051
  }
914
1052
  let h = a.value;
915
- Ps.forEach((p) => {
916
- p.test(h) && s.removeAttribute(a.name);
1053
+ Ns.forEach((u) => {
1054
+ u.test(h) && s.removeAttribute(a.name);
917
1055
  });
918
1056
  }), n === "a") {
919
1057
  const a = s.getAttribute("href");
@@ -926,12 +1064,12 @@ const Xs = /* @__PURE__ */ new Set([
926
1064
  }
927
1065
  };
928
1066
  return i(t.content), t.innerHTML;
929
- }, Ms = (e) => e === "x" ? P.X : P.Y, Hs = (e, t, i) => e.filter(
930
- (s) => Ms(s.orientation) === i && t in s.positions
931
- ), Ds = (e, t) => {
1067
+ }, js = (e) => e === "x" ? Y.X : Y.Y, $s = (e, t, i) => e.filter(
1068
+ (s) => js(s.orientation) === i && t in s.positions
1069
+ ), Gs = (e, t) => {
932
1070
  const i = document.createElement("button");
933
1071
  return i.id = e, i.className = "cloudimage-360-hotspot", i.dataset.hotspotId = e, i.setAttribute("type", "button"), i.setAttribute("aria-label", t || `Hotspot ${e}`), i.setAttribute("aria-haspopup", "true"), i.setAttribute("aria-expanded", "false"), i;
934
- }, Zs = (e) => {
1072
+ }, _s = (e) => {
935
1073
  const t = Object.entries(e).sort(([n], [l]) => Number(n) - Number(l));
936
1074
  let i = null, s = null;
937
1075
  const o = {};
@@ -946,7 +1084,7 @@ const Xs = /* @__PURE__ */ new Set([
946
1084
  };
947
1085
  }
948
1086
  return o;
949
- }, Bs = (e) => [
1087
+ }, Us = (e) => [
950
1088
  {
951
1089
  name: "offset",
952
1090
  options: {
@@ -959,16 +1097,16 @@ const Xs = /* @__PURE__ */ new Set([
959
1097
  boundary: e
960
1098
  }
961
1099
  }
962
- ], Ws = (e, t) => {
1100
+ ], Ks = (e, t) => {
963
1101
  const i = document.createElement("div");
964
- return i.className = "cloudimage-360-popper", i.id = `cloudimage-360-popper-${t}`, i.dataset.popperId = t, i.setAttribute("role", "tooltip"), i.setAttribute("aria-hidden", "false"), typeof e == "string" && /<\/?[a-z][\s\S]*>/i.test(e) ? i.innerHTML = Rs(e) : i.textContent = e, document.body.appendChild(i), i;
965
- }, Fs = (e) => {
1102
+ return i.className = "cloudimage-360-popper", i.id = `cloudimage-360-popper-${t}`, i.dataset.popperId = t, i.setAttribute("role", "tooltip"), i.setAttribute("aria-hidden", "false"), typeof e == "string" && /<\/?[a-z][\s\S]*>/i.test(e) ? i.innerHTML = zs(e) : i.textContent = e, document.body.appendChild(i), i;
1103
+ }, Js = (e) => {
966
1104
  const t = [...e];
967
1105
  return t.forEach((i, s) => {
968
- const o = { ...Zs(i.positions) };
1106
+ const o = { ..._s(i.positions) };
969
1107
  t[s].initialPositions = o, t[s].positions = o;
970
1108
  }), t;
971
- }, Ns = ({
1109
+ }, qs = ({
972
1110
  newWidth: e,
973
1111
  newHeight: t,
974
1112
  initialContainerSize: i,
@@ -977,25 +1115,25 @@ const Xs = /* @__PURE__ */ new Set([
977
1115
  }) => {
978
1116
  const [n, l] = i;
979
1117
  let r = e, a = t, c = 0, h = 0;
980
- const p = e / t;
981
- s > p ? (a = e / s, h = (t - a) / 2) : (r = t * s, c = (e - r) / 2);
982
- const u = r / n, I = a / l;
983
- return o.map((g) => {
1118
+ const u = e / t;
1119
+ s > u ? (a = e / s, h = (t - a) / 2) : (r = t * s, c = (e - r) / 2);
1120
+ const p = r / n, I = a / l;
1121
+ return o.map((b) => {
984
1122
  const v = {};
985
- return Object.entries(g.initialPositions).forEach(([m, b]) => {
986
- v[m] = {
987
- x: b.x * u + c,
988
- y: b.y * I + h
1123
+ return Object.entries(b.initialPositions).forEach(([O, E]) => {
1124
+ v[O] = {
1125
+ x: E.x * p + c,
1126
+ y: E.y * I + h
989
1127
  };
990
- }), { ...g, positions: v };
1128
+ }), { ...b, positions: v };
991
1129
  });
992
1130
  };
993
- var H = "top", F = "bottom", N = "right", D = "left", ee = "auto", Tt = [H, F, N, D], ut = "start", Lt = "end", Vs = "clippingParents", Ne = "viewport", Ot = "popper", js = "reference", ke = /* @__PURE__ */ Tt.reduce(function(e, t) {
994
- return e.concat([t + "-" + ut, t + "-" + Lt]);
995
- }, []), Ve = /* @__PURE__ */ [].concat(Tt, [ee]).reduce(function(e, t) {
996
- return e.concat([t, t + "-" + ut, t + "-" + Lt]);
997
- }, []), $s = "beforeRead", zs = "read", Gs = "afterRead", Us = "beforeMain", Ks = "main", _s = "afterMain", Js = "beforeWrite", qs = "write", Qs = "afterWrite", to = [$s, zs, Gs, Us, Ks, _s, Js, qs, Qs];
998
- function $(e) {
1131
+ var H = "top", F = "bottom", V = "right", Z = "left", ie = "auto", kt = [H, F, V, Z], mt = "start", At = "end", Qs = "clippingParents", Ge = "viewport", Ct = "popper", to = "reference", Pe = /* @__PURE__ */ kt.reduce(function(e, t) {
1132
+ return e.concat([t + "-" + mt, t + "-" + At]);
1133
+ }, []), _e = /* @__PURE__ */ [].concat(kt, [ie]).reduce(function(e, t) {
1134
+ return e.concat([t, t + "-" + mt, t + "-" + At]);
1135
+ }, []), eo = "beforeRead", io = "read", so = "afterRead", oo = "beforeMain", no = "main", ro = "afterMain", ao = "beforeWrite", lo = "write", co = "afterWrite", ho = [eo, io, so, oo, no, ro, ao, lo, co];
1136
+ function j(e) {
999
1137
  return e ? (e.nodeName || "").toLowerCase() : null;
1000
1138
  }
1001
1139
  function B(e) {
@@ -1007,7 +1145,7 @@ function B(e) {
1007
1145
  }
1008
1146
  return e;
1009
1147
  }
1010
- function nt(e) {
1148
+ function st(e) {
1011
1149
  var t = B(e).Element;
1012
1150
  return e instanceof t || e instanceof Element;
1013
1151
  }
@@ -1015,23 +1153,23 @@ function W(e) {
1015
1153
  var t = B(e).HTMLElement;
1016
1154
  return e instanceof t || e instanceof HTMLElement;
1017
1155
  }
1018
- function ie(e) {
1156
+ function se(e) {
1019
1157
  if (typeof ShadowRoot > "u")
1020
1158
  return !1;
1021
1159
  var t = B(e).ShadowRoot;
1022
1160
  return e instanceof t || e instanceof ShadowRoot;
1023
1161
  }
1024
- function eo(e) {
1162
+ function uo(e) {
1025
1163
  var t = e.state;
1026
1164
  Object.keys(t.elements).forEach(function(i) {
1027
1165
  var s = t.styles[i] || {}, o = t.attributes[i] || {}, n = t.elements[i];
1028
- !W(n) || !$(n) || (Object.assign(n.style, s), Object.keys(o).forEach(function(l) {
1166
+ !W(n) || !j(n) || (Object.assign(n.style, s), Object.keys(o).forEach(function(l) {
1029
1167
  var r = o[l];
1030
1168
  r === !1 ? n.removeAttribute(l) : n.setAttribute(l, r === !0 ? "" : r);
1031
1169
  }));
1032
1170
  });
1033
1171
  }
1034
- function io(e) {
1172
+ function po(e) {
1035
1173
  var t = e.state, i = {
1036
1174
  popper: {
1037
1175
  position: t.options.strategy,
@@ -1049,51 +1187,51 @@ function io(e) {
1049
1187
  var o = t.elements[s], n = t.attributes[s] || {}, l = Object.keys(t.styles.hasOwnProperty(s) ? t.styles[s] : i[s]), r = l.reduce(function(a, c) {
1050
1188
  return a[c] = "", a;
1051
1189
  }, {});
1052
- !W(o) || !$(o) || (Object.assign(o.style, r), Object.keys(n).forEach(function(a) {
1190
+ !W(o) || !j(o) || (Object.assign(o.style, r), Object.keys(n).forEach(function(a) {
1053
1191
  o.removeAttribute(a);
1054
1192
  }));
1055
1193
  });
1056
1194
  };
1057
1195
  }
1058
- const so = {
1196
+ const mo = {
1059
1197
  name: "applyStyles",
1060
1198
  enabled: !0,
1061
1199
  phase: "write",
1062
- fn: eo,
1063
- effect: io,
1200
+ fn: uo,
1201
+ effect: po,
1064
1202
  requires: ["computeStyles"]
1065
1203
  };
1066
- function j(e) {
1204
+ function z(e) {
1067
1205
  return e.split("-")[0];
1068
1206
  }
1069
- var ot = Math.max, Wt = Math.min, pt = Math.round;
1070
- function Qt() {
1207
+ var it = Math.max, Ft = Math.min, ft = Math.round;
1208
+ function te() {
1071
1209
  var e = navigator.userAgentData;
1072
1210
  return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(t) {
1073
1211
  return t.brand + "/" + t.version;
1074
1212
  }).join(" ") : navigator.userAgent;
1075
1213
  }
1076
- function je() {
1077
- return !/^((?!chrome|android).)*safari/i.test(Qt());
1214
+ function Ue() {
1215
+ return !/^((?!chrome|android).)*safari/i.test(te());
1078
1216
  }
1079
- function ft(e, t, i) {
1217
+ function vt(e, t, i) {
1080
1218
  t === void 0 && (t = !1), i === void 0 && (i = !1);
1081
1219
  var s = e.getBoundingClientRect(), o = 1, n = 1;
1082
- t && W(e) && (o = e.offsetWidth > 0 && pt(s.width) / e.offsetWidth || 1, n = e.offsetHeight > 0 && pt(s.height) / e.offsetHeight || 1);
1083
- var l = nt(e) ? B(e) : window, r = l.visualViewport, a = !je() && i, c = (s.left + (a && r ? r.offsetLeft : 0)) / o, h = (s.top + (a && r ? r.offsetTop : 0)) / n, p = s.width / o, f = s.height / n;
1220
+ t && W(e) && (o = e.offsetWidth > 0 && ft(s.width) / e.offsetWidth || 1, n = e.offsetHeight > 0 && ft(s.height) / e.offsetHeight || 1);
1221
+ var l = st(e) ? B(e) : window, r = l.visualViewport, a = !Ue() && i, c = (s.left + (a && r ? r.offsetLeft : 0)) / o, h = (s.top + (a && r ? r.offsetTop : 0)) / n, u = s.width / o, f = s.height / n;
1084
1222
  return {
1085
- width: p,
1223
+ width: u,
1086
1224
  height: f,
1087
1225
  top: h,
1088
- right: c + p,
1226
+ right: c + u,
1089
1227
  bottom: h + f,
1090
1228
  left: c,
1091
1229
  x: c,
1092
1230
  y: h
1093
1231
  };
1094
1232
  }
1095
- function se(e) {
1096
- var t = ft(e), i = e.offsetWidth, s = e.offsetHeight;
1233
+ function oe(e) {
1234
+ var t = vt(e), i = e.offsetWidth, s = e.offsetHeight;
1097
1235
  return Math.abs(t.width - i) <= 1 && (i = t.width), Math.abs(t.height - s) <= 1 && (s = t.height), {
1098
1236
  x: e.offsetLeft,
1099
1237
  y: e.offsetTop,
@@ -1101,11 +1239,11 @@ function se(e) {
1101
1239
  height: s
1102
1240
  };
1103
1241
  }
1104
- function $e(e, t) {
1242
+ function Ke(e, t) {
1105
1243
  var i = t.getRootNode && t.getRootNode();
1106
1244
  if (e.contains(t))
1107
1245
  return !0;
1108
- if (i && ie(i)) {
1246
+ if (i && se(i)) {
1109
1247
  var s = t;
1110
1248
  do {
1111
1249
  if (s && e.isSameNode(s))
@@ -1118,40 +1256,40 @@ function $e(e, t) {
1118
1256
  function J(e) {
1119
1257
  return B(e).getComputedStyle(e);
1120
1258
  }
1121
- function oo(e) {
1122
- return ["table", "td", "th"].indexOf($(e)) >= 0;
1259
+ function fo(e) {
1260
+ return ["table", "td", "th"].indexOf(j(e)) >= 0;
1123
1261
  }
1124
1262
  function Q(e) {
1125
- return ((nt(e) ? e.ownerDocument : (
1263
+ return ((st(e) ? e.ownerDocument : (
1126
1264
  // $FlowFixMe[prop-missing]
1127
1265
  e.document
1128
1266
  )) || window.document).documentElement;
1129
1267
  }
1130
1268
  function Nt(e) {
1131
- return $(e) === "html" ? e : (
1269
+ return j(e) === "html" ? e : (
1132
1270
  // this is a quicker (but less type safe) way to save quite some bytes from the bundle
1133
1271
  // $FlowFixMe[incompatible-return]
1134
1272
  // $FlowFixMe[prop-missing]
1135
1273
  e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
1136
1274
  e.parentNode || // DOM Element detected
1137
- (ie(e) ? e.host : null) || // ShadowRoot detected
1275
+ (se(e) ? e.host : null) || // ShadowRoot detected
1138
1276
  // $FlowFixMe[incompatible-call]: HTMLElement is a Node
1139
1277
  Q(e)
1140
1278
  );
1141
1279
  }
1142
- function Te(e) {
1280
+ function Ye(e) {
1143
1281
  return !W(e) || // https://github.com/popperjs/popper-core/issues/837
1144
1282
  J(e).position === "fixed" ? null : e.offsetParent;
1145
1283
  }
1146
- function no(e) {
1147
- var t = /firefox/i.test(Qt()), i = /Trident/i.test(Qt());
1284
+ function vo(e) {
1285
+ var t = /firefox/i.test(te()), i = /Trident/i.test(te());
1148
1286
  if (i && W(e)) {
1149
1287
  var s = J(e);
1150
1288
  if (s.position === "fixed")
1151
1289
  return null;
1152
1290
  }
1153
1291
  var o = Nt(e);
1154
- for (ie(o) && (o = o.host); W(o) && ["html", "body"].indexOf($(o)) < 0; ) {
1292
+ for (se(o) && (o = o.host); W(o) && ["html", "body"].indexOf(j(o)) < 0; ) {
1155
1293
  var n = J(o);
1156
1294
  if (n.transform !== "none" || n.perspective !== "none" || n.contain === "paint" || ["transform", "perspective"].indexOf(n.willChange) !== -1 || t && n.willChange === "filter" || t && n.filter && n.filter !== "none")
1157
1295
  return o;
@@ -1159,22 +1297,22 @@ function no(e) {
1159
1297
  }
1160
1298
  return null;
1161
1299
  }
1162
- function Yt(e) {
1163
- for (var t = B(e), i = Te(e); i && oo(i) && J(i).position === "static"; )
1164
- i = Te(i);
1165
- return i && ($(i) === "html" || $(i) === "body" && J(i).position === "static") ? t : i || no(e) || t;
1300
+ function Tt(e) {
1301
+ for (var t = B(e), i = Ye(e); i && fo(i) && J(i).position === "static"; )
1302
+ i = Ye(i);
1303
+ return i && (j(i) === "html" || j(i) === "body" && J(i).position === "static") ? t : i || vo(e) || t;
1166
1304
  }
1167
- function oe(e) {
1305
+ function ne(e) {
1168
1306
  return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
1169
1307
  }
1170
- function St(e, t, i) {
1171
- return ot(e, Wt(t, i));
1308
+ function Ot(e, t, i) {
1309
+ return it(e, Ft(t, i));
1172
1310
  }
1173
- function ro(e, t, i) {
1174
- var s = St(e, t, i);
1311
+ function go(e, t, i) {
1312
+ var s = Ot(e, t, i);
1175
1313
  return s > i ? i : s;
1176
1314
  }
1177
- function ze() {
1315
+ function Je() {
1178
1316
  return {
1179
1317
  top: 0,
1180
1318
  right: 0,
@@ -1182,114 +1320,114 @@ function ze() {
1182
1320
  left: 0
1183
1321
  };
1184
1322
  }
1185
- function Ge(e) {
1186
- return Object.assign({}, ze(), e);
1323
+ function qe(e) {
1324
+ return Object.assign({}, Je(), e);
1187
1325
  }
1188
- function Ue(e, t) {
1326
+ function Qe(e, t) {
1189
1327
  return t.reduce(function(i, s) {
1190
1328
  return i[s] = e, i;
1191
1329
  }, {});
1192
1330
  }
1193
- var ao = function(t, i) {
1331
+ var yo = function(t, i) {
1194
1332
  return t = typeof t == "function" ? t(Object.assign({}, i.rects, {
1195
1333
  placement: i.placement
1196
- })) : t, Ge(typeof t != "number" ? t : Ue(t, Tt));
1334
+ })) : t, qe(typeof t != "number" ? t : Qe(t, kt));
1197
1335
  };
1198
- function lo(e) {
1199
- var t, i = e.state, s = e.name, o = e.options, n = i.elements.arrow, l = i.modifiersData.popperOffsets, r = j(i.placement), a = oe(r), c = [D, N].indexOf(r) >= 0, h = c ? "height" : "width";
1336
+ function bo(e) {
1337
+ var t, i = e.state, s = e.name, o = e.options, n = i.elements.arrow, l = i.modifiersData.popperOffsets, r = z(i.placement), a = ne(r), c = [Z, V].indexOf(r) >= 0, h = c ? "height" : "width";
1200
1338
  if (!(!n || !l)) {
1201
- var p = ao(o.padding, i), f = se(n), u = a === "y" ? H : D, I = a === "y" ? F : N, g = i.rects.reference[h] + i.rects.reference[a] - l[a] - i.rects.popper[h], v = l[a] - i.rects.reference[a], m = Yt(n), b = m ? a === "y" ? m.clientHeight || 0 : m.clientWidth || 0 : 0, x = g / 2 - v / 2, w = p[u], C = b - f[h] - p[I], y = b / 2 - f[h] / 2 + x, O = St(w, y, C), S = a;
1202
- i.modifiersData[s] = (t = {}, t[S] = O, t.centerOffset = O - y, t);
1339
+ var u = yo(o.padding, i), f = oe(n), p = a === "y" ? H : Z, I = a === "y" ? F : V, b = i.rects.reference[h] + i.rects.reference[a] - l[a] - i.rects.popper[h], v = l[a] - i.rects.reference[a], O = Tt(n), E = O ? a === "y" ? O.clientHeight || 0 : O.clientWidth || 0 : 0, w = b / 2 - v / 2, y = u[p], x = E - f[h] - u[I], m = E / 2 - f[h] / 2 + w, g = Ot(y, m, x), C = a;
1340
+ i.modifiersData[s] = (t = {}, t[C] = g, t.centerOffset = g - m, t);
1203
1341
  }
1204
1342
  }
1205
- function co(e) {
1343
+ function wo(e) {
1206
1344
  var t = e.state, i = e.options, s = i.element, o = s === void 0 ? "[data-popper-arrow]" : s;
1207
- o != null && (typeof o == "string" && (o = t.elements.popper.querySelector(o), !o) || $e(t.elements.popper, o) && (t.elements.arrow = o));
1345
+ o != null && (typeof o == "string" && (o = t.elements.popper.querySelector(o), !o) || Ke(t.elements.popper, o) && (t.elements.arrow = o));
1208
1346
  }
1209
- const ho = {
1347
+ const Io = {
1210
1348
  name: "arrow",
1211
1349
  enabled: !0,
1212
1350
  phase: "main",
1213
- fn: lo,
1214
- effect: co,
1351
+ fn: bo,
1352
+ effect: wo,
1215
1353
  requires: ["popperOffsets"],
1216
1354
  requiresIfExists: ["preventOverflow"]
1217
1355
  };
1218
- function mt(e) {
1356
+ function gt(e) {
1219
1357
  return e.split("-")[1];
1220
1358
  }
1221
- var uo = {
1359
+ var Co = {
1222
1360
  top: "auto",
1223
1361
  right: "auto",
1224
1362
  bottom: "auto",
1225
1363
  left: "auto"
1226
1364
  };
1227
- function po(e, t) {
1365
+ function xo(e, t) {
1228
1366
  var i = e.x, s = e.y, o = t.devicePixelRatio || 1;
1229
1367
  return {
1230
- x: pt(i * o) / o || 0,
1231
- y: pt(s * o) / o || 0
1368
+ x: ft(i * o) / o || 0,
1369
+ y: ft(s * o) / o || 0
1232
1370
  };
1233
1371
  }
1234
- function Ye(e) {
1235
- var t, i = e.popper, s = e.popperRect, o = e.placement, n = e.variation, l = e.offsets, r = e.position, a = e.gpuAcceleration, c = e.adaptive, h = e.roundOffsets, p = e.isFixed, f = l.x, u = f === void 0 ? 0 : f, I = l.y, g = I === void 0 ? 0 : I, v = typeof h == "function" ? h({
1236
- x: u,
1237
- y: g
1372
+ function Xe(e) {
1373
+ var t, i = e.popper, s = e.popperRect, o = e.placement, n = e.variation, l = e.offsets, r = e.position, a = e.gpuAcceleration, c = e.adaptive, h = e.roundOffsets, u = e.isFixed, f = l.x, p = f === void 0 ? 0 : f, I = l.y, b = I === void 0 ? 0 : I, v = typeof h == "function" ? h({
1374
+ x: p,
1375
+ y: b
1238
1376
  }) : {
1239
- x: u,
1240
- y: g
1377
+ x: p,
1378
+ y: b
1241
1379
  };
1242
- u = v.x, g = v.y;
1243
- var m = l.hasOwnProperty("x"), b = l.hasOwnProperty("y"), x = D, w = H, C = window;
1380
+ p = v.x, b = v.y;
1381
+ var O = l.hasOwnProperty("x"), E = l.hasOwnProperty("y"), w = Z, y = H, x = window;
1244
1382
  if (c) {
1245
- var y = Yt(i), O = "clientHeight", S = "clientWidth";
1246
- if (y === B(i) && (y = Q(i), J(y).position !== "static" && r === "absolute" && (O = "scrollHeight", S = "scrollWidth")), y = y, o === H || (o === D || o === N) && n === Lt) {
1247
- w = F;
1248
- var E = p && y === C && C.visualViewport ? C.visualViewport.height : (
1383
+ var m = Tt(i), g = "clientHeight", C = "clientWidth";
1384
+ if (m === B(i) && (m = Q(i), J(m).position !== "static" && r === "absolute" && (g = "scrollHeight", C = "scrollWidth")), m = m, o === H || (o === Z || o === V) && n === At) {
1385
+ y = F;
1386
+ var A = u && m === x && x.visualViewport ? x.visualViewport.height : (
1249
1387
  // $FlowFixMe[prop-missing]
1250
- y[O]
1388
+ m[g]
1251
1389
  );
1252
- g -= E - s.height, g *= a ? 1 : -1;
1390
+ b -= A - s.height, b *= a ? 1 : -1;
1253
1391
  }
1254
- if (o === D || (o === H || o === F) && n === Lt) {
1255
- x = N;
1256
- var A = p && y === C && C.visualViewport ? C.visualViewport.width : (
1392
+ if (o === Z || (o === H || o === F) && n === At) {
1393
+ w = V;
1394
+ var S = u && m === x && x.visualViewport ? x.visualViewport.width : (
1257
1395
  // $FlowFixMe[prop-missing]
1258
- y[S]
1396
+ m[C]
1259
1397
  );
1260
- u -= A - s.width, u *= a ? 1 : -1;
1398
+ p -= S - s.width, p *= a ? 1 : -1;
1261
1399
  }
1262
1400
  }
1263
- var k = Object.assign({
1401
+ var T = Object.assign({
1264
1402
  position: r
1265
- }, c && uo), R = h === !0 ? po({
1266
- x: u,
1267
- y: g
1403
+ }, c && Co), X = h === !0 ? xo({
1404
+ x: p,
1405
+ y: b
1268
1406
  }, B(i)) : {
1269
- x: u,
1270
- y: g
1407
+ x: p,
1408
+ y: b
1271
1409
  };
1272
- if (u = R.x, g = R.y, a) {
1273
- var T;
1274
- return Object.assign({}, k, (T = {}, T[w] = b ? "0" : "", T[x] = m ? "0" : "", T.transform = (C.devicePixelRatio || 1) <= 1 ? "translate(" + u + "px, " + g + "px)" : "translate3d(" + u + "px, " + g + "px, 0)", T));
1410
+ if (p = X.x, b = X.y, a) {
1411
+ var L;
1412
+ return Object.assign({}, T, (L = {}, L[y] = E ? "0" : "", L[w] = O ? "0" : "", L.transform = (x.devicePixelRatio || 1) <= 1 ? "translate(" + p + "px, " + b + "px)" : "translate3d(" + p + "px, " + b + "px, 0)", L));
1275
1413
  }
1276
- return Object.assign({}, k, (t = {}, t[w] = b ? g + "px" : "", t[x] = m ? u + "px" : "", t.transform = "", t));
1414
+ return Object.assign({}, T, (t = {}, t[y] = E ? b + "px" : "", t[w] = O ? p + "px" : "", t.transform = "", t));
1277
1415
  }
1278
- function fo(e) {
1416
+ function Oo(e) {
1279
1417
  var t = e.state, i = e.options, s = i.gpuAcceleration, o = s === void 0 ? !0 : s, n = i.adaptive, l = n === void 0 ? !0 : n, r = i.roundOffsets, a = r === void 0 ? !0 : r, c = {
1280
- placement: j(t.placement),
1281
- variation: mt(t.placement),
1418
+ placement: z(t.placement),
1419
+ variation: gt(t.placement),
1282
1420
  popper: t.elements.popper,
1283
1421
  popperRect: t.rects.popper,
1284
1422
  gpuAcceleration: o,
1285
1423
  isFixed: t.options.strategy === "fixed"
1286
1424
  };
1287
- t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, Ye(Object.assign({}, c, {
1425
+ t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, Xe(Object.assign({}, c, {
1288
1426
  offsets: t.modifiersData.popperOffsets,
1289
1427
  position: t.options.strategy,
1290
1428
  adaptive: l,
1291
1429
  roundOffsets: a
1292
- })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, Ye(Object.assign({}, c, {
1430
+ })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, Xe(Object.assign({}, c, {
1293
1431
  offsets: t.modifiersData.arrow,
1294
1432
  position: "absolute",
1295
1433
  adaptive: !1,
@@ -1298,17 +1436,17 @@ function fo(e) {
1298
1436
  "data-popper-placement": t.placement
1299
1437
  });
1300
1438
  }
1301
- const mo = {
1439
+ const Eo = {
1302
1440
  name: "computeStyles",
1303
1441
  enabled: !0,
1304
1442
  phase: "beforeWrite",
1305
- fn: fo,
1443
+ fn: Oo,
1306
1444
  data: {}
1307
1445
  };
1308
1446
  var Dt = {
1309
1447
  passive: !0
1310
1448
  };
1311
- function vo(e) {
1449
+ function Ao(e) {
1312
1450
  var t = e.state, i = e.instance, s = e.options, o = s.scroll, n = o === void 0 ? !0 : o, l = s.resize, r = l === void 0 ? !0 : l, a = B(t.elements.popper), c = [].concat(t.scrollParents.reference, t.scrollParents.popper);
1313
1451
  return n && c.forEach(function(h) {
1314
1452
  h.addEventListener("scroll", i.update, Dt);
@@ -1318,85 +1456,85 @@ function vo(e) {
1318
1456
  }), r && a.removeEventListener("resize", i.update, Dt);
1319
1457
  };
1320
1458
  }
1321
- const go = {
1459
+ const So = {
1322
1460
  name: "eventListeners",
1323
1461
  enabled: !0,
1324
1462
  phase: "write",
1325
1463
  fn: function() {
1326
1464
  },
1327
- effect: vo,
1465
+ effect: Ao,
1328
1466
  data: {}
1329
1467
  };
1330
- var yo = {
1468
+ var ko = {
1331
1469
  left: "right",
1332
1470
  right: "left",
1333
1471
  bottom: "top",
1334
1472
  top: "bottom"
1335
1473
  };
1336
- function Zt(e) {
1474
+ function Bt(e) {
1337
1475
  return e.replace(/left|right|bottom|top/g, function(t) {
1338
- return yo[t];
1476
+ return ko[t];
1339
1477
  });
1340
1478
  }
1341
- var bo = {
1479
+ var To = {
1342
1480
  start: "end",
1343
1481
  end: "start"
1344
1482
  };
1345
- function Xe(e) {
1483
+ function Re(e) {
1346
1484
  return e.replace(/start|end/g, function(t) {
1347
- return bo[t];
1485
+ return To[t];
1348
1486
  });
1349
1487
  }
1350
- function ne(e) {
1488
+ function re(e) {
1351
1489
  var t = B(e), i = t.pageXOffset, s = t.pageYOffset;
1352
1490
  return {
1353
1491
  scrollLeft: i,
1354
1492
  scrollTop: s
1355
1493
  };
1356
1494
  }
1357
- function re(e) {
1358
- return ft(Q(e)).left + ne(e).scrollLeft;
1495
+ function ae(e) {
1496
+ return vt(Q(e)).left + re(e).scrollLeft;
1359
1497
  }
1360
- function wo(e, t) {
1498
+ function Lo(e, t) {
1361
1499
  var i = B(e), s = Q(e), o = i.visualViewport, n = s.clientWidth, l = s.clientHeight, r = 0, a = 0;
1362
1500
  if (o) {
1363
1501
  n = o.width, l = o.height;
1364
- var c = je();
1502
+ var c = Ue();
1365
1503
  (c || !c && t === "fixed") && (r = o.offsetLeft, a = o.offsetTop);
1366
1504
  }
1367
1505
  return {
1368
1506
  width: n,
1369
1507
  height: l,
1370
- x: r + re(e),
1508
+ x: r + ae(e),
1371
1509
  y: a
1372
1510
  };
1373
1511
  }
1374
- function Io(e) {
1375
- var t, i = Q(e), s = ne(e), o = (t = e.ownerDocument) == null ? void 0 : t.body, n = ot(i.scrollWidth, i.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), l = ot(i.scrollHeight, i.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), r = -s.scrollLeft + re(e), a = -s.scrollTop;
1376
- return J(o || i).direction === "rtl" && (r += ot(i.clientWidth, o ? o.clientWidth : 0) - n), {
1512
+ function Mo(e) {
1513
+ var t, i = Q(e), s = re(e), o = (t = e.ownerDocument) == null ? void 0 : t.body, n = it(i.scrollWidth, i.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), l = it(i.scrollHeight, i.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), r = -s.scrollLeft + ae(e), a = -s.scrollTop;
1514
+ return J(o || i).direction === "rtl" && (r += it(i.clientWidth, o ? o.clientWidth : 0) - n), {
1377
1515
  width: n,
1378
1516
  height: l,
1379
1517
  x: r,
1380
1518
  y: a
1381
1519
  };
1382
1520
  }
1383
- function ae(e) {
1521
+ function le(e) {
1384
1522
  var t = J(e), i = t.overflow, s = t.overflowX, o = t.overflowY;
1385
1523
  return /auto|scroll|overlay|hidden/.test(i + o + s);
1386
1524
  }
1387
- function Ke(e) {
1388
- return ["html", "body", "#document"].indexOf($(e)) >= 0 ? e.ownerDocument.body : W(e) && ae(e) ? e : Ke(Nt(e));
1525
+ function ti(e) {
1526
+ return ["html", "body", "#document"].indexOf(j(e)) >= 0 ? e.ownerDocument.body : W(e) && le(e) ? e : ti(Nt(e));
1389
1527
  }
1390
- function At(e, t) {
1528
+ function Et(e, t) {
1391
1529
  var i;
1392
1530
  t === void 0 && (t = []);
1393
- var s = Ke(e), o = s === ((i = e.ownerDocument) == null ? void 0 : i.body), n = B(s), l = o ? [n].concat(n.visualViewport || [], ae(s) ? s : []) : s, r = t.concat(l);
1531
+ var s = ti(e), o = s === ((i = e.ownerDocument) == null ? void 0 : i.body), n = B(s), l = o ? [n].concat(n.visualViewport || [], le(s) ? s : []) : s, r = t.concat(l);
1394
1532
  return o ? r : (
1395
1533
  // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
1396
- r.concat(At(Nt(l)))
1534
+ r.concat(Et(Nt(l)))
1397
1535
  );
1398
1536
  }
1399
- function te(e) {
1537
+ function ee(e) {
1400
1538
  return Object.assign({}, e, {
1401
1539
  left: e.x,
1402
1540
  top: e.y,
@@ -1404,28 +1542,28 @@ function te(e) {
1404
1542
  bottom: e.y + e.height
1405
1543
  });
1406
1544
  }
1407
- function xo(e, t) {
1408
- var i = ft(e, !1, t === "fixed");
1545
+ function Po(e, t) {
1546
+ var i = vt(e, !1, t === "fixed");
1409
1547
  return i.top = i.top + e.clientTop, i.left = i.left + e.clientLeft, i.bottom = i.top + e.clientHeight, i.right = i.left + e.clientWidth, i.width = e.clientWidth, i.height = e.clientHeight, i.x = i.left, i.y = i.top, i;
1410
1548
  }
1411
- function Pe(e, t, i) {
1412
- return t === Ne ? te(wo(e, i)) : nt(t) ? xo(t, i) : te(Io(Q(e)));
1549
+ function He(e, t, i) {
1550
+ return t === Ge ? ee(Lo(e, i)) : st(t) ? Po(t, i) : ee(Mo(Q(e)));
1413
1551
  }
1414
- function Co(e) {
1415
- var t = At(Nt(e)), i = ["absolute", "fixed"].indexOf(J(e).position) >= 0, s = i && W(e) ? Yt(e) : e;
1416
- return nt(s) ? t.filter(function(o) {
1417
- return nt(o) && $e(o, s) && $(o) !== "body";
1552
+ function Yo(e) {
1553
+ var t = Et(Nt(e)), i = ["absolute", "fixed"].indexOf(J(e).position) >= 0, s = i && W(e) ? Tt(e) : e;
1554
+ return st(s) ? t.filter(function(o) {
1555
+ return st(o) && Ke(o, s) && j(o) !== "body";
1418
1556
  }) : [];
1419
1557
  }
1420
- function Oo(e, t, i, s) {
1421
- var o = t === "clippingParents" ? Co(e) : [].concat(t), n = [].concat(o, [i]), l = n[0], r = n.reduce(function(a, c) {
1422
- var h = Pe(e, c, s);
1423
- return a.top = ot(h.top, a.top), a.right = Wt(h.right, a.right), a.bottom = Wt(h.bottom, a.bottom), a.left = ot(h.left, a.left), a;
1424
- }, Pe(e, l, s));
1558
+ function Xo(e, t, i, s) {
1559
+ var o = t === "clippingParents" ? Yo(e) : [].concat(t), n = [].concat(o, [i]), l = n[0], r = n.reduce(function(a, c) {
1560
+ var h = He(e, c, s);
1561
+ return a.top = it(h.top, a.top), a.right = Ft(h.right, a.right), a.bottom = Ft(h.bottom, a.bottom), a.left = it(h.left, a.left), a;
1562
+ }, He(e, l, s));
1425
1563
  return r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
1426
1564
  }
1427
- function _e(e) {
1428
- var t = e.reference, i = e.element, s = e.placement, o = s ? j(s) : null, n = s ? mt(s) : null, l = t.x + t.width / 2 - i.width / 2, r = t.y + t.height / 2 - i.height / 2, a;
1565
+ function ei(e) {
1566
+ var t = e.reference, i = e.element, s = e.placement, o = s ? z(s) : null, n = s ? gt(s) : null, l = t.x + t.width / 2 - i.width / 2, r = t.y + t.height / 2 - i.height / 2, a;
1429
1567
  switch (o) {
1430
1568
  case H:
1431
1569
  a = {
@@ -1439,13 +1577,13 @@ function _e(e) {
1439
1577
  y: t.y + t.height
1440
1578
  };
1441
1579
  break;
1442
- case N:
1580
+ case V:
1443
1581
  a = {
1444
1582
  x: t.x + t.width,
1445
1583
  y: r
1446
1584
  };
1447
1585
  break;
1448
- case D:
1586
+ case Z:
1449
1587
  a = {
1450
1588
  x: t.x - i.width,
1451
1589
  y: r
@@ -1457,126 +1595,126 @@ function _e(e) {
1457
1595
  y: t.y
1458
1596
  };
1459
1597
  }
1460
- var c = o ? oe(o) : null;
1598
+ var c = o ? ne(o) : null;
1461
1599
  if (c != null) {
1462
1600
  var h = c === "y" ? "height" : "width";
1463
1601
  switch (n) {
1464
- case ut:
1602
+ case mt:
1465
1603
  a[c] = a[c] - (t[h] / 2 - i[h] / 2);
1466
1604
  break;
1467
- case Lt:
1605
+ case At:
1468
1606
  a[c] = a[c] + (t[h] / 2 - i[h] / 2);
1469
1607
  break;
1470
1608
  }
1471
1609
  }
1472
1610
  return a;
1473
1611
  }
1474
- function kt(e, t) {
1612
+ function St(e, t) {
1475
1613
  t === void 0 && (t = {});
1476
- var i = t, s = i.placement, o = s === void 0 ? e.placement : s, n = i.strategy, l = n === void 0 ? e.strategy : n, r = i.boundary, a = r === void 0 ? Vs : r, c = i.rootBoundary, h = c === void 0 ? Ne : c, p = i.elementContext, f = p === void 0 ? Ot : p, u = i.altBoundary, I = u === void 0 ? !1 : u, g = i.padding, v = g === void 0 ? 0 : g, m = Ge(typeof v != "number" ? v : Ue(v, Tt)), b = f === Ot ? js : Ot, x = e.rects.popper, w = e.elements[I ? b : f], C = Oo(nt(w) ? w : w.contextElement || Q(e.elements.popper), a, h, l), y = ft(e.elements.reference), O = _e({
1477
- reference: y,
1478
- element: x,
1614
+ var i = t, s = i.placement, o = s === void 0 ? e.placement : s, n = i.strategy, l = n === void 0 ? e.strategy : n, r = i.boundary, a = r === void 0 ? Qs : r, c = i.rootBoundary, h = c === void 0 ? Ge : c, u = i.elementContext, f = u === void 0 ? Ct : u, p = i.altBoundary, I = p === void 0 ? !1 : p, b = i.padding, v = b === void 0 ? 0 : b, O = qe(typeof v != "number" ? v : Qe(v, kt)), E = f === Ct ? to : Ct, w = e.rects.popper, y = e.elements[I ? E : f], x = Xo(st(y) ? y : y.contextElement || Q(e.elements.popper), a, h, l), m = vt(e.elements.reference), g = ei({
1615
+ reference: m,
1616
+ element: w,
1479
1617
  placement: o
1480
- }), S = te(Object.assign({}, x, O)), E = f === Ot ? S : y, A = {
1481
- top: C.top - E.top + m.top,
1482
- bottom: E.bottom - C.bottom + m.bottom,
1483
- left: C.left - E.left + m.left,
1484
- right: E.right - C.right + m.right
1485
- }, k = e.modifiersData.offset;
1486
- if (f === Ot && k) {
1487
- var R = k[o];
1488
- Object.keys(A).forEach(function(T) {
1489
- var z = [N, F].indexOf(T) >= 0 ? 1 : -1, G = [H, F].indexOf(T) >= 0 ? "y" : "x";
1490
- A[T] += R[G] * z;
1618
+ }), C = ee(Object.assign({}, w, g)), A = f === Ct ? C : m, S = {
1619
+ top: x.top - A.top + O.top,
1620
+ bottom: A.bottom - x.bottom + O.bottom,
1621
+ left: x.left - A.left + O.left,
1622
+ right: A.right - x.right + O.right
1623
+ }, T = e.modifiersData.offset;
1624
+ if (f === Ct && T) {
1625
+ var X = T[o];
1626
+ Object.keys(S).forEach(function(L) {
1627
+ var $ = [V, F].indexOf(L) >= 0 ? 1 : -1, G = [H, F].indexOf(L) >= 0 ? "y" : "x";
1628
+ S[L] += X[G] * $;
1491
1629
  });
1492
1630
  }
1493
- return A;
1631
+ return S;
1494
1632
  }
1495
- function Eo(e, t) {
1633
+ function Ro(e, t) {
1496
1634
  t === void 0 && (t = {});
1497
- var i = t, s = i.placement, o = i.boundary, n = i.rootBoundary, l = i.padding, r = i.flipVariations, a = i.allowedAutoPlacements, c = a === void 0 ? Ve : a, h = mt(s), p = h ? r ? ke : ke.filter(function(I) {
1498
- return mt(I) === h;
1499
- }) : Tt, f = p.filter(function(I) {
1635
+ var i = t, s = i.placement, o = i.boundary, n = i.rootBoundary, l = i.padding, r = i.flipVariations, a = i.allowedAutoPlacements, c = a === void 0 ? _e : a, h = gt(s), u = h ? r ? Pe : Pe.filter(function(I) {
1636
+ return gt(I) === h;
1637
+ }) : kt, f = u.filter(function(I) {
1500
1638
  return c.indexOf(I) >= 0;
1501
1639
  });
1502
- f.length === 0 && (f = p);
1503
- var u = f.reduce(function(I, g) {
1504
- return I[g] = kt(e, {
1505
- placement: g,
1640
+ f.length === 0 && (f = u);
1641
+ var p = f.reduce(function(I, b) {
1642
+ return I[b] = St(e, {
1643
+ placement: b,
1506
1644
  boundary: o,
1507
1645
  rootBoundary: n,
1508
1646
  padding: l
1509
- })[j(g)], I;
1647
+ })[z(b)], I;
1510
1648
  }, {});
1511
- return Object.keys(u).sort(function(I, g) {
1512
- return u[I] - u[g];
1649
+ return Object.keys(p).sort(function(I, b) {
1650
+ return p[I] - p[b];
1513
1651
  });
1514
1652
  }
1515
- function So(e) {
1516
- if (j(e) === ee)
1653
+ function Ho(e) {
1654
+ if (z(e) === ie)
1517
1655
  return [];
1518
- var t = Zt(e);
1519
- return [Xe(e), t, Xe(t)];
1656
+ var t = Bt(e);
1657
+ return [Re(e), t, Re(t)];
1520
1658
  }
1521
- function Ao(e) {
1659
+ function Zo(e) {
1522
1660
  var t = e.state, i = e.options, s = e.name;
1523
1661
  if (!t.modifiersData[s]._skip) {
1524
- for (var o = i.mainAxis, n = o === void 0 ? !0 : o, l = i.altAxis, r = l === void 0 ? !0 : l, a = i.fallbackPlacements, c = i.padding, h = i.boundary, p = i.rootBoundary, f = i.altBoundary, u = i.flipVariations, I = u === void 0 ? !0 : u, g = i.allowedAutoPlacements, v = t.options.placement, m = j(v), b = m === v, x = a || (b || !I ? [Zt(v)] : So(v)), w = [v].concat(x).reduce(function(q, V) {
1525
- return q.concat(j(V) === ee ? Eo(t, {
1526
- placement: V,
1662
+ for (var o = i.mainAxis, n = o === void 0 ? !0 : o, l = i.altAxis, r = l === void 0 ? !0 : l, a = i.fallbackPlacements, c = i.padding, h = i.boundary, u = i.rootBoundary, f = i.altBoundary, p = i.flipVariations, I = p === void 0 ? !0 : p, b = i.allowedAutoPlacements, v = t.options.placement, O = z(v), E = O === v, w = a || (E || !I ? [Bt(v)] : Ho(v)), y = [v].concat(w).reduce(function(q, N) {
1663
+ return q.concat(z(N) === ie ? Ro(t, {
1664
+ placement: N,
1527
1665
  boundary: h,
1528
- rootBoundary: p,
1666
+ rootBoundary: u,
1529
1667
  padding: c,
1530
1668
  flipVariations: I,
1531
- allowedAutoPlacements: g
1532
- }) : V);
1533
- }, []), C = t.rects.reference, y = t.rects.popper, O = /* @__PURE__ */ new Map(), S = !0, E = w[0], A = 0; A < w.length; A++) {
1534
- var k = w[A], R = j(k), T = mt(k) === ut, z = [H, F].indexOf(R) >= 0, G = z ? "width" : "height", Y = kt(t, {
1535
- placement: k,
1669
+ allowedAutoPlacements: b
1670
+ }) : N);
1671
+ }, []), x = t.rects.reference, m = t.rects.popper, g = /* @__PURE__ */ new Map(), C = !0, A = y[0], S = 0; S < y.length; S++) {
1672
+ var T = y[S], X = z(T), L = gt(T) === mt, $ = [H, F].indexOf(X) >= 0, G = $ ? "width" : "height", M = St(t, {
1673
+ placement: T,
1536
1674
  boundary: h,
1537
- rootBoundary: p,
1675
+ rootBoundary: u,
1538
1676
  altBoundary: f,
1539
1677
  padding: c
1540
- }), Z = z ? T ? N : D : T ? F : H;
1541
- C[G] > y[G] && (Z = Zt(Z));
1542
- var rt = Zt(Z), U = [];
1543
- if (n && U.push(Y[R] <= 0), r && U.push(Y[Z] <= 0, Y[rt] <= 0), U.every(function(q) {
1678
+ }), D = $ ? L ? V : Z : L ? F : H;
1679
+ x[G] > m[G] && (D = Bt(D));
1680
+ var ot = Bt(D), _ = [];
1681
+ if (n && _.push(M[X] <= 0), r && _.push(M[D] <= 0, M[ot] <= 0), _.every(function(q) {
1544
1682
  return q;
1545
1683
  })) {
1546
- E = k, S = !1;
1684
+ A = T, C = !1;
1547
1685
  break;
1548
1686
  }
1549
- O.set(k, U);
1687
+ g.set(T, _);
1550
1688
  }
1551
- if (S)
1552
- for (var at = I ? 3 : 1, vt = function(V) {
1553
- var et = w.find(function(it) {
1554
- var K = O.get(it);
1555
- if (K)
1556
- return K.slice(0, V).every(function(ct) {
1557
- return ct;
1689
+ if (C)
1690
+ for (var nt = I ? 3 : 1, yt = function(N) {
1691
+ var et = y.find(function(at) {
1692
+ var U = g.get(at);
1693
+ if (U)
1694
+ return U.slice(0, N).every(function(lt) {
1695
+ return lt;
1558
1696
  });
1559
1697
  });
1560
1698
  if (et)
1561
- return E = et, "break";
1562
- }, tt = at; tt > 0; tt--) {
1563
- var lt = vt(tt);
1564
- if (lt === "break") break;
1699
+ return A = et, "break";
1700
+ }, tt = nt; tt > 0; tt--) {
1701
+ var rt = yt(tt);
1702
+ if (rt === "break") break;
1565
1703
  }
1566
- t.placement !== E && (t.modifiersData[s]._skip = !0, t.placement = E, t.reset = !0);
1704
+ t.placement !== A && (t.modifiersData[s]._skip = !0, t.placement = A, t.reset = !0);
1567
1705
  }
1568
1706
  }
1569
- const Lo = {
1707
+ const Do = {
1570
1708
  name: "flip",
1571
1709
  enabled: !0,
1572
1710
  phase: "main",
1573
- fn: Ao,
1711
+ fn: Zo,
1574
1712
  requiresIfExists: ["offset"],
1575
1713
  data: {
1576
1714
  _skip: !1
1577
1715
  }
1578
1716
  };
1579
- function Re(e, t, i) {
1717
+ function Ze(e, t, i) {
1580
1718
  return i === void 0 && (i = {
1581
1719
  x: 0,
1582
1720
  y: 0
@@ -1587,39 +1725,39 @@ function Re(e, t, i) {
1587
1725
  left: e.left - t.width - i.x
1588
1726
  };
1589
1727
  }
1590
- function Me(e) {
1591
- return [H, N, F, D].some(function(t) {
1728
+ function De(e) {
1729
+ return [H, V, F, Z].some(function(t) {
1592
1730
  return e[t] >= 0;
1593
1731
  });
1594
1732
  }
1595
- function ko(e) {
1596
- var t = e.state, i = e.name, s = t.rects.reference, o = t.rects.popper, n = t.modifiersData.preventOverflow, l = kt(t, {
1733
+ function Bo(e) {
1734
+ var t = e.state, i = e.name, s = t.rects.reference, o = t.rects.popper, n = t.modifiersData.preventOverflow, l = St(t, {
1597
1735
  elementContext: "reference"
1598
- }), r = kt(t, {
1736
+ }), r = St(t, {
1599
1737
  altBoundary: !0
1600
- }), a = Re(l, s), c = Re(r, o, n), h = Me(a), p = Me(c);
1738
+ }), a = Ze(l, s), c = Ze(r, o, n), h = De(a), u = De(c);
1601
1739
  t.modifiersData[i] = {
1602
1740
  referenceClippingOffsets: a,
1603
1741
  popperEscapeOffsets: c,
1604
1742
  isReferenceHidden: h,
1605
- hasPopperEscaped: p
1743
+ hasPopperEscaped: u
1606
1744
  }, t.attributes.popper = Object.assign({}, t.attributes.popper, {
1607
1745
  "data-popper-reference-hidden": h,
1608
- "data-popper-escaped": p
1746
+ "data-popper-escaped": u
1609
1747
  });
1610
1748
  }
1611
- const To = {
1749
+ const Wo = {
1612
1750
  name: "hide",
1613
1751
  enabled: !0,
1614
1752
  phase: "main",
1615
1753
  requiresIfExists: ["preventOverflow"],
1616
- fn: ko
1754
+ fn: Bo
1617
1755
  };
1618
- function Yo(e, t, i) {
1619
- var s = j(e), o = [D, H].indexOf(s) >= 0 ? -1 : 1, n = typeof i == "function" ? i(Object.assign({}, t, {
1756
+ function Fo(e, t, i) {
1757
+ var s = z(e), o = [Z, H].indexOf(s) >= 0 ? -1 : 1, n = typeof i == "function" ? i(Object.assign({}, t, {
1620
1758
  placement: e
1621
1759
  })) : i, l = n[0], r = n[1];
1622
- return l = l || 0, r = (r || 0) * o, [D, N].indexOf(s) >= 0 ? {
1760
+ return l = l || 0, r = (r || 0) * o, [Z, V].indexOf(s) >= 0 ? {
1623
1761
  x: r,
1624
1762
  y: l
1625
1763
  } : {
@@ -1627,108 +1765,108 @@ function Yo(e, t, i) {
1627
1765
  y: r
1628
1766
  };
1629
1767
  }
1630
- function Xo(e) {
1631
- var t = e.state, i = e.options, s = e.name, o = i.offset, n = o === void 0 ? [0, 0] : o, l = Ve.reduce(function(h, p) {
1632
- return h[p] = Yo(p, t.rects, n), h;
1768
+ function Vo(e) {
1769
+ var t = e.state, i = e.options, s = e.name, o = i.offset, n = o === void 0 ? [0, 0] : o, l = _e.reduce(function(h, u) {
1770
+ return h[u] = Fo(u, t.rects, n), h;
1633
1771
  }, {}), r = l[t.placement], a = r.x, c = r.y;
1634
1772
  t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += a, t.modifiersData.popperOffsets.y += c), t.modifiersData[s] = l;
1635
1773
  }
1636
- const Po = {
1774
+ const No = {
1637
1775
  name: "offset",
1638
1776
  enabled: !0,
1639
1777
  phase: "main",
1640
1778
  requires: ["popperOffsets"],
1641
- fn: Xo
1779
+ fn: Vo
1642
1780
  };
1643
- function Ro(e) {
1781
+ function zo(e) {
1644
1782
  var t = e.state, i = e.name;
1645
- t.modifiersData[i] = _e({
1783
+ t.modifiersData[i] = ei({
1646
1784
  reference: t.rects.reference,
1647
1785
  element: t.rects.popper,
1648
1786
  placement: t.placement
1649
1787
  });
1650
1788
  }
1651
- const Mo = {
1789
+ const jo = {
1652
1790
  name: "popperOffsets",
1653
1791
  enabled: !0,
1654
1792
  phase: "read",
1655
- fn: Ro,
1793
+ fn: zo,
1656
1794
  data: {}
1657
1795
  };
1658
- function Ho(e) {
1796
+ function $o(e) {
1659
1797
  return e === "x" ? "y" : "x";
1660
1798
  }
1661
- function Do(e) {
1662
- var t = e.state, i = e.options, s = e.name, o = i.mainAxis, n = o === void 0 ? !0 : o, l = i.altAxis, r = l === void 0 ? !1 : l, a = i.boundary, c = i.rootBoundary, h = i.altBoundary, p = i.padding, f = i.tether, u = f === void 0 ? !0 : f, I = i.tetherOffset, g = I === void 0 ? 0 : I, v = kt(t, {
1799
+ function Go(e) {
1800
+ var t = e.state, i = e.options, s = e.name, o = i.mainAxis, n = o === void 0 ? !0 : o, l = i.altAxis, r = l === void 0 ? !1 : l, a = i.boundary, c = i.rootBoundary, h = i.altBoundary, u = i.padding, f = i.tether, p = f === void 0 ? !0 : f, I = i.tetherOffset, b = I === void 0 ? 0 : I, v = St(t, {
1663
1801
  boundary: a,
1664
1802
  rootBoundary: c,
1665
- padding: p,
1803
+ padding: u,
1666
1804
  altBoundary: h
1667
- }), m = j(t.placement), b = mt(t.placement), x = !b, w = oe(m), C = Ho(w), y = t.modifiersData.popperOffsets, O = t.rects.reference, S = t.rects.popper, E = typeof g == "function" ? g(Object.assign({}, t.rects, {
1805
+ }), O = z(t.placement), E = gt(t.placement), w = !E, y = ne(O), x = $o(y), m = t.modifiersData.popperOffsets, g = t.rects.reference, C = t.rects.popper, A = typeof b == "function" ? b(Object.assign({}, t.rects, {
1668
1806
  placement: t.placement
1669
- })) : g, A = typeof E == "number" ? {
1670
- mainAxis: E,
1671
- altAxis: E
1807
+ })) : b, S = typeof A == "number" ? {
1808
+ mainAxis: A,
1809
+ altAxis: A
1672
1810
  } : Object.assign({
1673
1811
  mainAxis: 0,
1674
1812
  altAxis: 0
1675
- }, E), k = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, R = {
1813
+ }, A), T = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, X = {
1676
1814
  x: 0,
1677
1815
  y: 0
1678
1816
  };
1679
- if (y) {
1817
+ if (m) {
1680
1818
  if (n) {
1681
- var T, z = w === "y" ? H : D, G = w === "y" ? F : N, Y = w === "y" ? "height" : "width", Z = y[w], rt = Z + v[z], U = Z - v[G], at = u ? -S[Y] / 2 : 0, vt = b === ut ? O[Y] : S[Y], tt = b === ut ? -S[Y] : -O[Y], lt = t.elements.arrow, q = u && lt ? se(lt) : {
1819
+ var L, $ = y === "y" ? H : Z, G = y === "y" ? F : V, M = y === "y" ? "height" : "width", D = m[y], ot = D + v[$], _ = D - v[G], nt = p ? -C[M] / 2 : 0, yt = E === mt ? g[M] : C[M], tt = E === mt ? -C[M] : -g[M], rt = t.elements.arrow, q = p && rt ? oe(rt) : {
1682
1820
  width: 0,
1683
1821
  height: 0
1684
- }, V = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : ze(), et = V[z], it = V[G], K = St(0, O[Y], q[Y]), ct = x ? O[Y] / 2 - at - K - et - A.mainAxis : vt - K - et - A.mainAxis, Vt = x ? -O[Y] / 2 + at + K + it + A.mainAxis : tt + K + it + A.mainAxis, gt = t.elements.arrow && Yt(t.elements.arrow), jt = gt ? w === "y" ? gt.clientTop || 0 : gt.clientLeft || 0 : 0, Xt = (T = k == null ? void 0 : k[w]) != null ? T : 0, $t = Z + ct - Xt - jt, zt = Z + Vt - Xt, Pt = St(u ? Wt(rt, $t) : rt, Z, u ? ot(U, zt) : U);
1685
- y[w] = Pt, R[w] = Pt - Z;
1822
+ }, N = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : Je(), et = N[$], at = N[G], U = Ot(0, g[M], q[M]), lt = w ? g[M] / 2 - nt - U - et - S.mainAxis : yt - U - et - S.mainAxis, zt = w ? -g[M] / 2 + nt + U + at + S.mainAxis : tt + U + at + S.mainAxis, ct = t.elements.arrow && Tt(t.elements.arrow), jt = ct ? y === "y" ? ct.clientTop || 0 : ct.clientLeft || 0 : 0, Lt = (L = T == null ? void 0 : T[y]) != null ? L : 0, $t = D + lt - Lt - jt, Gt = D + zt - Lt, Mt = Ot(p ? Ft(ot, $t) : ot, D, p ? it(_, Gt) : _);
1823
+ m[y] = Mt, X[y] = Mt - D;
1686
1824
  }
1687
1825
  if (r) {
1688
- var Rt, Gt = w === "x" ? H : D, Ut = w === "x" ? F : N, _ = y[C], ht = C === "y" ? "height" : "width", yt = _ + v[Gt], dt = _ - v[Ut], st = [H, D].indexOf(m) !== -1, bt = (Rt = k == null ? void 0 : k[C]) != null ? Rt : 0, wt = st ? yt : _ - O[ht] - S[ht] - bt + A.altAxis, It = st ? _ + O[ht] + S[ht] - bt - A.altAxis : dt, xt = u && st ? ro(wt, _, It) : St(u ? wt : yt, _, u ? It : dt);
1689
- y[C] = xt, R[C] = xt - _;
1826
+ var Pt, _t = y === "x" ? H : Z, Ut = y === "x" ? F : V, K = m[x], ht = x === "y" ? "height" : "width", Yt = K + v[_t], Xt = K - v[Ut], dt = [H, Z].indexOf(O) !== -1, ut = (Pt = T == null ? void 0 : T[x]) != null ? Pt : 0, pt = dt ? Yt : K - g[ht] - C[ht] - ut + S.altAxis, bt = dt ? K + g[ht] + C[ht] - ut - S.altAxis : Xt, wt = p && dt ? go(pt, K, bt) : Ot(p ? pt : Yt, K, p ? bt : Xt);
1827
+ m[x] = wt, X[x] = wt - K;
1690
1828
  }
1691
- t.modifiersData[s] = R;
1829
+ t.modifiersData[s] = X;
1692
1830
  }
1693
1831
  }
1694
- const Zo = {
1832
+ const _o = {
1695
1833
  name: "preventOverflow",
1696
1834
  enabled: !0,
1697
1835
  phase: "main",
1698
- fn: Do,
1836
+ fn: Go,
1699
1837
  requiresIfExists: ["offset"]
1700
1838
  };
1701
- function Bo(e) {
1839
+ function Uo(e) {
1702
1840
  return {
1703
1841
  scrollLeft: e.scrollLeft,
1704
1842
  scrollTop: e.scrollTop
1705
1843
  };
1706
1844
  }
1707
- function Wo(e) {
1708
- return e === B(e) || !W(e) ? ne(e) : Bo(e);
1845
+ function Ko(e) {
1846
+ return e === B(e) || !W(e) ? re(e) : Uo(e);
1709
1847
  }
1710
- function Fo(e) {
1711
- var t = e.getBoundingClientRect(), i = pt(t.width) / e.offsetWidth || 1, s = pt(t.height) / e.offsetHeight || 1;
1848
+ function Jo(e) {
1849
+ var t = e.getBoundingClientRect(), i = ft(t.width) / e.offsetWidth || 1, s = ft(t.height) / e.offsetHeight || 1;
1712
1850
  return i !== 1 || s !== 1;
1713
1851
  }
1714
- function No(e, t, i) {
1852
+ function qo(e, t, i) {
1715
1853
  i === void 0 && (i = !1);
1716
- var s = W(t), o = W(t) && Fo(t), n = Q(t), l = ft(e, o, i), r = {
1854
+ var s = W(t), o = W(t) && Jo(t), n = Q(t), l = vt(e, o, i), r = {
1717
1855
  scrollLeft: 0,
1718
1856
  scrollTop: 0
1719
1857
  }, a = {
1720
1858
  x: 0,
1721
1859
  y: 0
1722
1860
  };
1723
- return (s || !s && !i) && (($(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
1724
- ae(n)) && (r = Wo(t)), W(t) ? (a = ft(t, !0), a.x += t.clientLeft, a.y += t.clientTop) : n && (a.x = re(n))), {
1861
+ return (s || !s && !i) && ((j(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
1862
+ le(n)) && (r = Ko(t)), W(t) ? (a = vt(t, !0), a.x += t.clientLeft, a.y += t.clientTop) : n && (a.x = ae(n))), {
1725
1863
  x: l.left + r.scrollLeft - a.x,
1726
1864
  y: l.top + r.scrollTop - a.y,
1727
1865
  width: l.width,
1728
1866
  height: l.height
1729
1867
  };
1730
1868
  }
1731
- function Vo(e) {
1869
+ function Qo(e) {
1732
1870
  var t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), s = [];
1733
1871
  e.forEach(function(n) {
1734
1872
  t.set(n.name, n);
@@ -1747,15 +1885,15 @@ function Vo(e) {
1747
1885
  i.has(n.name) || o(n);
1748
1886
  }), s;
1749
1887
  }
1750
- function jo(e) {
1751
- var t = Vo(e);
1752
- return to.reduce(function(i, s) {
1888
+ function tn(e) {
1889
+ var t = Qo(e);
1890
+ return ho.reduce(function(i, s) {
1753
1891
  return i.concat(t.filter(function(o) {
1754
1892
  return o.phase === s;
1755
1893
  }));
1756
1894
  }, []);
1757
1895
  }
1758
- function $o(e) {
1896
+ function en(e) {
1759
1897
  var t;
1760
1898
  return function() {
1761
1899
  return t || (t = new Promise(function(i) {
@@ -1765,7 +1903,7 @@ function $o(e) {
1765
1903
  })), t;
1766
1904
  };
1767
1905
  }
1768
- function zo(e) {
1906
+ function sn(e) {
1769
1907
  var t = e.reduce(function(i, s) {
1770
1908
  var o = i[s.name];
1771
1909
  return i[s.name] = o ? Object.assign({}, o, s, {
@@ -1777,27 +1915,27 @@ function zo(e) {
1777
1915
  return t[i];
1778
1916
  });
1779
1917
  }
1780
- var He = {
1918
+ var Be = {
1781
1919
  placement: "bottom",
1782
1920
  modifiers: [],
1783
1921
  strategy: "absolute"
1784
1922
  };
1785
- function De() {
1923
+ function We() {
1786
1924
  for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
1787
1925
  t[i] = arguments[i];
1788
1926
  return !t.some(function(s) {
1789
1927
  return !(s && typeof s.getBoundingClientRect == "function");
1790
1928
  });
1791
1929
  }
1792
- function Go(e) {
1930
+ function on(e) {
1793
1931
  e === void 0 && (e = {});
1794
- var t = e, i = t.defaultModifiers, s = i === void 0 ? [] : i, o = t.defaultOptions, n = o === void 0 ? He : o;
1932
+ var t = e, i = t.defaultModifiers, s = i === void 0 ? [] : i, o = t.defaultOptions, n = o === void 0 ? Be : o;
1795
1933
  return function(r, a, c) {
1796
1934
  c === void 0 && (c = n);
1797
1935
  var h = {
1798
1936
  placement: "bottom",
1799
1937
  orderedModifiers: [],
1800
- options: Object.assign({}, He, n),
1938
+ options: Object.assign({}, Be, n),
1801
1939
  modifiersData: {},
1802
1940
  elements: {
1803
1941
  reference: r,
@@ -1805,18 +1943,18 @@ function Go(e) {
1805
1943
  },
1806
1944
  attributes: {},
1807
1945
  styles: {}
1808
- }, p = [], f = !1, u = {
1946
+ }, u = [], f = !1, p = {
1809
1947
  state: h,
1810
- setOptions: function(m) {
1811
- var b = typeof m == "function" ? m(h.options) : m;
1812
- g(), h.options = Object.assign({}, n, h.options, b), h.scrollParents = {
1813
- reference: nt(r) ? At(r) : r.contextElement ? At(r.contextElement) : [],
1814
- popper: At(a)
1948
+ setOptions: function(O) {
1949
+ var E = typeof O == "function" ? O(h.options) : O;
1950
+ b(), h.options = Object.assign({}, n, h.options, E), h.scrollParents = {
1951
+ reference: st(r) ? Et(r) : r.contextElement ? Et(r.contextElement) : [],
1952
+ popper: Et(a)
1815
1953
  };
1816
- var x = jo(zo([].concat(s, h.options.modifiers)));
1817
- return h.orderedModifiers = x.filter(function(w) {
1818
- return w.enabled;
1819
- }), I(), u.update();
1954
+ var w = tn(sn([].concat(s, h.options.modifiers)));
1955
+ return h.orderedModifiers = w.filter(function(y) {
1956
+ return y.enabled;
1957
+ }), I(), p.update();
1820
1958
  },
1821
1959
  // Sync update – it will always be executed, even if not necessary. This
1822
1960
  // is useful for low frequency updates where sync behavior simplifies the
@@ -1825,25 +1963,25 @@ function Go(e) {
1825
1963
  // prefer the async Popper#update method
1826
1964
  forceUpdate: function() {
1827
1965
  if (!f) {
1828
- var m = h.elements, b = m.reference, x = m.popper;
1829
- if (De(b, x)) {
1966
+ var O = h.elements, E = O.reference, w = O.popper;
1967
+ if (We(E, w)) {
1830
1968
  h.rects = {
1831
- reference: No(b, Yt(x), h.options.strategy === "fixed"),
1832
- popper: se(x)
1833
- }, h.reset = !1, h.placement = h.options.placement, h.orderedModifiers.forEach(function(A) {
1834
- return h.modifiersData[A.name] = Object.assign({}, A.data);
1969
+ reference: qo(E, Tt(w), h.options.strategy === "fixed"),
1970
+ popper: oe(w)
1971
+ }, h.reset = !1, h.placement = h.options.placement, h.orderedModifiers.forEach(function(S) {
1972
+ return h.modifiersData[S.name] = Object.assign({}, S.data);
1835
1973
  });
1836
- for (var w = 0; w < h.orderedModifiers.length; w++) {
1974
+ for (var y = 0; y < h.orderedModifiers.length; y++) {
1837
1975
  if (h.reset === !0) {
1838
- h.reset = !1, w = -1;
1976
+ h.reset = !1, y = -1;
1839
1977
  continue;
1840
1978
  }
1841
- var C = h.orderedModifiers[w], y = C.fn, O = C.options, S = O === void 0 ? {} : O, E = C.name;
1842
- typeof y == "function" && (h = y({
1979
+ var x = h.orderedModifiers[y], m = x.fn, g = x.options, C = g === void 0 ? {} : g, A = x.name;
1980
+ typeof m == "function" && (h = m({
1843
1981
  state: h,
1844
- options: S,
1845
- name: E,
1846
- instance: u
1982
+ options: C,
1983
+ name: A,
1984
+ instance: p
1847
1985
  }) || h);
1848
1986
  }
1849
1987
  }
@@ -1851,56 +1989,63 @@ function Go(e) {
1851
1989
  },
1852
1990
  // Async and optimistically optimized update – it will not be executed if
1853
1991
  // not necessary (debounced to run at most once-per-tick)
1854
- update: $o(function() {
1992
+ update: en(function() {
1855
1993
  return new Promise(function(v) {
1856
- u.forceUpdate(), v(h);
1994
+ p.forceUpdate(), v(h);
1857
1995
  });
1858
1996
  }),
1859
1997
  destroy: function() {
1860
- g(), f = !0;
1998
+ b(), f = !0;
1861
1999
  }
1862
2000
  };
1863
- if (!De(r, a))
1864
- return u;
1865
- u.setOptions(c).then(function(v) {
2001
+ if (!We(r, a))
2002
+ return p;
2003
+ p.setOptions(c).then(function(v) {
1866
2004
  !f && c.onFirstUpdate && c.onFirstUpdate(v);
1867
2005
  });
1868
2006
  function I() {
1869
2007
  h.orderedModifiers.forEach(function(v) {
1870
- var m = v.name, b = v.options, x = b === void 0 ? {} : b, w = v.effect;
1871
- if (typeof w == "function") {
1872
- var C = w({
2008
+ var O = v.name, E = v.options, w = E === void 0 ? {} : E, y = v.effect;
2009
+ if (typeof y == "function") {
2010
+ var x = y({
1873
2011
  state: h,
1874
- name: m,
1875
- instance: u,
1876
- options: x
1877
- }), y = function() {
2012
+ name: O,
2013
+ instance: p,
2014
+ options: w
2015
+ }), m = function() {
1878
2016
  };
1879
- p.push(C || y);
2017
+ u.push(x || m);
1880
2018
  }
1881
2019
  });
1882
2020
  }
1883
- function g() {
1884
- p.forEach(function(v) {
2021
+ function b() {
2022
+ u.forEach(function(v) {
1885
2023
  return v();
1886
- }), p = [];
2024
+ }), u = [];
1887
2025
  }
1888
- return u;
2026
+ return p;
1889
2027
  };
1890
2028
  }
1891
- var Uo = [go, Mo, mo, so, Po, Lo, Zo, ho, To], Ko = /* @__PURE__ */ Go({
1892
- defaultModifiers: Uo
2029
+ var nn = [So, jo, Eo, mo, No, Do, _o, Io, Wo], rn = /* @__PURE__ */ on({
2030
+ defaultModifiers: nn
1893
2031
  });
1894
- class _o {
1895
- constructor(t, i, s) {
1896
- le(this, "updateHotspotPosition", (t, i) => {
2032
+ class an {
2033
+ /**
2034
+ * @param {Array} hotspotsConfig - Hotspot configuration array
2035
+ * @param {HTMLElement} container - Container element
2036
+ * @param {number} imageAspectRatio - Image aspect ratio
2037
+ * @param {Object} options - Additional options
2038
+ * @param {string} options.trigger - 'hover' or 'click' (default: 'hover')
2039
+ */
2040
+ constructor(t, i, s, o = {}) {
2041
+ de(this, "updateHotspotPosition", (t, i) => {
1897
2042
  this.currentActiveIndex = t, this.currentOrientation = i;
1898
- const s = Hs(this.hotspotsConfig, t, i);
2043
+ const s = $s(this.hotspotsConfig, t, i);
1899
2044
  this.hideHotspots(), s.forEach((o) => this.updateAndShowHotspot(o, t));
1900
2045
  });
1901
- this.container = i, this.popper = null, this.popperInstance = null, this.hotspotsContainer = Qi(this.container), this.hotspotsConfig = Fs(t), this.shouldHidePopper = !0, this.hidePopper = this.hidePopper.bind(this), this.imageAspectRatio = s, this.hotspotElements = /* @__PURE__ */ new Map(), this.popperListeners = [];
1902
- const { containerSize: o } = t[0];
1903
- this.initialContainerSize = o || [i.offsetWidth, i.offsetHeight], this.initHotspots(), this.observeContainerResize();
2046
+ this.container = i, this.popper = null, this.popperInstance = null, this.hotspotsContainer = as(this.container), this.hotspotsConfig = Js(t), this.shouldHidePopper = !0, this.hidePopper = this.hidePopper.bind(this), this.forceHidePopper = this.forceHidePopper.bind(this), this.imageAspectRatio = s, this.hotspotElements = /* @__PURE__ */ new Map(), this.popperListeners = [], this.trigger = o.trigger || "hover";
2047
+ const { containerSize: n } = t[0];
2048
+ this.initialContainerSize = n || [i.offsetWidth, i.offsetHeight], this.initHotspots(), this.observeContainerResize();
1904
2049
  }
1905
2050
  observeContainerResize() {
1906
2051
  this.resizeObserver = new ResizeObserver(() => {
@@ -1909,7 +2054,7 @@ class _o {
1909
2054
  }), this.resizeObserver.observe(this.container);
1910
2055
  }
1911
2056
  updateHotspotsForResize(t, i) {
1912
- this.hotspotsConfig = Ns({
2057
+ this.hotspotsConfig = qs({
1913
2058
  newWidth: t,
1914
2059
  newHeight: i,
1915
2060
  initialContainerSize: this.initialContainerSize,
@@ -1923,12 +2068,12 @@ class _o {
1923
2068
  }), this.popperListeners = [];
1924
2069
  }
1925
2070
  showPopper({ hotspotElement: t, content: i, id: s, keepOpen: o }) {
1926
- this.popperInstance && this.popperInstance.instanceId !== s && this.hidePopper();
2071
+ this.popperInstance && this.hidePopper();
1927
2072
  const n = {
1928
2073
  placement: "top",
1929
- modifiers: Bs(this.container)
2074
+ modifiers: Us(this.container)
1930
2075
  };
1931
- this.popper = Ws(i, s), this.popper.setAttribute("data-show", ""), this.currentHotspotElement = t, t.setAttribute("aria-expanded", "true"), t.setAttribute("aria-describedby", `cloudimage-360-popper-${s}`);
2076
+ this.popper = Ks(i, s), this.popper.setAttribute("data-show", ""), this.currentHotspotElement = t, t.setAttribute("aria-expanded", "true"), t.setAttribute("aria-describedby", `cloudimage-360-popper-${s}`);
1932
2077
  const l = () => {
1933
2078
  this.shouldHidePopper = !1;
1934
2079
  }, r = () => {
@@ -1944,7 +2089,7 @@ class _o {
1944
2089
  { element: t, event: "mouseleave", handler: a },
1945
2090
  { element: t, event: "mouseenter", handler: c }
1946
2091
  ), this.popperInstance = {
1947
- ...Ko(t, this.popper, n),
2092
+ ...rn(t, this.popper, n),
1948
2093
  keepOpen: o,
1949
2094
  instanceId: s
1950
2095
  };
@@ -1953,25 +2098,36 @@ class _o {
1953
2098
  var t;
1954
2099
  this.shouldHidePopper && !((t = this.popperInstance) != null && t.keepOpen) && (this.hidePopperTimeout = setTimeout(() => {
1955
2100
  this.shouldHidePopper && this.hidePopper();
1956
- }, Ei));
2101
+ }, Mi));
1957
2102
  }
1958
2103
  hidePopper() {
1959
- if (this.cleanupPopperListeners(), this.currentHotspotElement && (this.currentHotspotElement.setAttribute("aria-expanded", "false"), this.currentHotspotElement.removeAttribute("aria-describedby"), this.currentHotspotElement = null), this.popperInstance && (this.popperInstance.destroy(), this.popperInstance = null), this.popper) {
2104
+ if (this.hidePopperTimeout && (clearTimeout(this.hidePopperTimeout), this.hidePopperTimeout = null), this.cleanupPopperListeners(), this.currentHotspotElement && (this.currentHotspotElement.setAttribute("aria-expanded", "false"), this.currentHotspotElement.removeAttribute("aria-describedby"), this.currentHotspotElement = null), this.popperInstance && (this.popperInstance.destroy(), this.popperInstance = null), this.popper) {
1960
2105
  this.popper.removeAttribute("data-show"), this.popper.setAttribute("aria-hidden", "true");
1961
2106
  const t = this.popper;
1962
2107
  this.popper = null, setTimeout(() => {
1963
2108
  t.remove();
1964
- }, Si);
2109
+ }, Pi);
1965
2110
  }
2111
+ this.shouldHidePopper = !0;
2112
+ }
2113
+ /**
2114
+ * Force hide the popper immediately, ignoring keepOpen and shouldHidePopper flags
2115
+ * Use this when the user starts dragging or other interactions that should close the modal
2116
+ */
2117
+ forceHidePopper() {
2118
+ this.shouldHidePopper = !0, this.popperInstance && (this.popperInstance.keepOpen = !1), this.hidePopper();
1966
2119
  }
1967
2120
  createHotspot(t) {
1968
- const { id: i, content: s, keepOpen: o, onClick: n, label: l } = t, r = Ds(i, l);
1969
- n && (r.style.cursor = "pointer"), r.onclick = (a) => {
1970
- a.stopPropagation(), n == null || n(a, this.popperInstance, i);
1971
- }, s && (r.addEventListener(
2121
+ const { id: i, content: s, keepOpen: o, onClick: n, label: l } = t, r = Gs(i, l);
2122
+ (n || s && this.trigger === "click") && (r.style.cursor = "pointer"), r.onclick = (a) => {
2123
+ var c;
2124
+ a.stopPropagation(), s && this.trigger === "click" && (((c = this.popperInstance) == null ? void 0 : c.instanceId) === i ? this.hidePopper() : this.showPopper({ hotspotElement: r, content: s, id: i, keepOpen: o })), n == null || n(a, this.popperInstance, i);
2125
+ }, s && (this.trigger === "hover" && (r.addEventListener(
1972
2126
  "mouseenter",
1973
2127
  () => this.showPopper({ hotspotElement: r, content: s, id: i, keepOpen: o })
1974
- ), r.addEventListener(
2128
+ ), r.addEventListener("mouseleave", () => {
2129
+ this.shouldHidePopper = !0, this.checkAndHidePopper();
2130
+ })), r.addEventListener(
1975
2131
  "focus",
1976
2132
  () => this.showPopper({ hotspotElement: r, content: s, id: i, keepOpen: o })
1977
2133
  ), r.addEventListener("blur", () => {
@@ -2012,32 +2168,48 @@ class _o {
2012
2168
  this.hidePopperTimeout && clearTimeout(this.hidePopperTimeout), this.resizeObserver.disconnect(), this.hidePopper(), this.hotspotElements.clear(), this.hotspotsContainer.innerHTML = "";
2013
2169
  }
2014
2170
  }
2015
- class Ft {
2171
+ const Fe = typeof navigator < "u" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
2172
+ class Vt {
2016
2173
  constructor(t, i, s) {
2017
- this.container = t, this.isClicked = !1, this.fullscreenView = !!s, this.imagesX = [], this.imagesY = [], this.devicePixelRatio = Math.round(window.devicePixelRatio || 1), this.id = t.id, this.movementStart = { x: 0, y: 0 }, this.draggingDirection = null, this.isReady = !1, this.velocityX = 0, this.velocityY = 0, this.lastDragTime = 0, this.lastDragX = 0, this.lastDragY = 0, this.inertiaAnimationId = null, this.hasInteracted = !1, this.currentZoomScale = 1, this.touchDevice = Ls(), this.dragJustEnded = !1, this.isPinching = !1, this.initialPinchDistance = 0, this.pinchZoomLevel = 1, this.pinchZoomEmitted = !1, this.lastEmittedZoom = 1, this.panOffsetX = 0, this.panOffsetY = 0, this.canvasWorker = new Ys(), this.hotspotTimeline = null, this.hotspotTimelineIndicator = null, this.isAnimatingToFrame = !1, this.onMoveHandler = this.onMoveHandler.bind(this), this.destroy = this.destroy.bind(this), this.init(this.container, i);
2174
+ this.container = t, this.isClicked = !1, this.fullscreenView = !!s, this.imagesX = [], this.imagesY = [];
2175
+ const o = Math.round(window.devicePixelRatio || 1);
2176
+ this.devicePixelRatio = Fe ? Math.min(o, 2) : o, this.id = t.id, this.movementStart = { x: 0, y: 0 }, this.draggingDirection = null, this.isReady = !1, this.velocityX = 0, this.velocityY = 0, this.lastDragTime = 0, this.lastDragX = 0, this.lastDragY = 0, this.inertiaAnimationId = null, this.hasInteracted = !1, this.currentZoomScale = 1, this.touchDevice = Zs(), this.dragJustEnded = !1, this.isPinching = !1, this.initialPinchDistance = 0, this.pinchZoomLevel = 1, this.pinchZoomEmitted = !1, this.lastEmittedZoom = 1, this.panOffsetX = 0, this.panOffsetY = 0, this.useMainThreadCanvas = Fe, this.canvasWorker = this.useMainThreadCanvas ? new Fs() : new Ws(), this.hotspotTimeline = null, this.hotspotTimelineIndicator = null, this.isAnimatingToFrame = !1, this.onMoveHandler = this.onMoveHandler.bind(this), this.destroy = this.destroy.bind(this), this.init(this.container, i);
2177
+ }
2178
+ /**
2179
+ * Close ImageBitmap objects to free GPU memory
2180
+ * @param {Array} images - Array of image objects with bitmapImage property
2181
+ */
2182
+ closeImageBitmaps(t) {
2183
+ !t || !Array.isArray(t) || t.forEach((i) => {
2184
+ var s;
2185
+ (s = i == null ? void 0 : i.bitmapImage) != null && s.close && i.bitmapImage.close();
2186
+ });
2018
2187
  }
2019
2188
  emit(t, i = {}) {
2020
2189
  const s = this[t];
2021
2190
  typeof s == "function" && s({ ...i, viewerId: this.id });
2022
2191
  }
2023
2192
  announce(t) {
2024
- es(this.ariaLiveRegion, t);
2193
+ cs(this.ariaLiveRegion, t);
2025
2194
  }
2026
2195
  mouseDown(t) {
2027
2196
  if (!this.isReady || this.glass) return;
2028
- const { pageX: i, pageY: s } = t;
2029
- this.hideHints(), this.hideHotspotPopper(), this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null), this.autoplayJustStopped = !1, (this.autoplay || this.loopTimeoutId) && (this.stopAutoplay(), this.autoplay = !1, this.autoplayJustStopped = !0), this.movementStart = { x: i, y: s }, this.isClicked = !0, this.isDragging = !1, this.inertia && (this.velocityX = 0, this.velocityY = 0, this.lastDragTime = performance.now(), this.lastDragX = i, this.lastDragY = s);
2197
+ const i = t.target;
2198
+ if (i && i.closest && (i.closest(".cloudimage-360-button") || i.closest(".cloudimage-360-hotspot-timeline-dot") || i.closest(".cloudimage-360-hotspot")))
2199
+ return;
2200
+ const { pageX: s, pageY: o } = t;
2201
+ this.hideHints(), this.hideHotspotPopper(), this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null), this.autoplayJustStopped = !1, (this.autoplay || this.loopTimeoutId) && (this.stopAutoplay(), this.autoplay = !1, this.autoplayJustStopped = !0), this.movementStart = { x: s, y: o }, this.isClicked = !0, this.isDragging = !1, this.inertia && (this.velocityX = 0, this.velocityY = 0, this.lastDragTime = performance.now(), this.lastDragX = s, this.lastDragY = o);
2030
2202
  }
2031
2203
  mouseUp() {
2032
2204
  this.isReady && (!this.isZoomed && !this.autoplayJustStopped && this.showAllIcons(), this.inertia && this.isDragging && (Math.abs(this.velocityX) > 0.1 || Math.abs(this.velocityY) > 0.1) && this.startInertia(), this.isDragging && (this.emit("onDragEnd"), this.dragJustEnded = !0), this.movementStart = { x: 0, y: 0 }, this.isClicked = !1, this.isDragging = !1, this.innerBox.style.cursor = "grab");
2033
2205
  }
2034
2206
  startInertia() {
2035
- const s = this.fullscreenView ? document.body : this.container, o = this.dragSpeed / fe, n = o * (this.amountX / s.offsetWidth), l = o * (this.amountY / s.offsetHeight), r = () => {
2207
+ const s = this.fullscreenView ? document.body : this.container, o = this.dragSpeed / ve, n = o * (this.amountX / s.offsetWidth), l = o * (this.amountY / s.offsetHeight), r = () => {
2036
2208
  if (this.velocityX *= 0.95, this.velocityY *= 0.95, Math.abs(this.velocityX) < 0.01 && Math.abs(this.velocityY) < 0.01) {
2037
2209
  this.inertiaAnimationId = null;
2038
2210
  return;
2039
2211
  }
2040
- const a = this.velocityX * 16, c = this.velocityY * 16, h = Se({
2212
+ const a = this.velocityX * 16, c = this.velocityY * 16, h = Te({
2041
2213
  deltaX: a,
2042
2214
  deltaY: c,
2043
2215
  reversed: this.dragReverse,
@@ -2045,8 +2217,8 @@ class Ft {
2045
2217
  allowSpinY: this.allowSpinY
2046
2218
  });
2047
2219
  if (h) {
2048
- const p = this.allowSpinX ? Math.max(1, Math.abs(Math.round(a * n))) : 0, f = this.allowSpinY ? Math.max(1, Math.abs(Math.round(c * l))) : 0;
2049
- (p > 0 || f > 0) && this.onMoveHandler(h, p, f);
2220
+ const u = this.allowSpinX ? Math.max(1, Math.abs(Math.round(a * n))) : 0, f = this.allowSpinY ? Math.max(1, Math.abs(Math.round(c * l))) : 0;
2221
+ (u > 0 || f > 0) && this.onMoveHandler(h, u, f);
2050
2222
  }
2051
2223
  this.inertiaAnimationId = requestAnimationFrame(r);
2052
2224
  };
@@ -2056,26 +2228,28 @@ class Ft {
2056
2228
  if (!this.isReady || !this.isClicked) return;
2057
2229
  const s = t - this.movementStart.x, o = i - this.movementStart.y;
2058
2230
  if (this.inertia) {
2059
- const f = performance.now(), u = f - this.lastDragTime;
2060
- u > 0 && u < 100 && (this.velocityX = (t - this.lastDragX) / u, this.velocityY = (i - this.lastDragY) / u), this.lastDragTime = f, this.lastDragX = t, this.lastDragY = i;
2231
+ const f = performance.now(), p = f - this.lastDragTime;
2232
+ p > 0 && p < 100 && (this.velocityX = (t - this.lastDragX) / p, this.velocityY = (i - this.lastDragY) / p), this.lastDragTime = f, this.lastDragX = t, this.lastDragY = i;
2061
2233
  }
2062
- this.draggingDirection = Se({
2234
+ this.draggingDirection = Te({
2063
2235
  deltaX: s,
2064
2236
  deltaY: o,
2065
2237
  reversed: this.dragReverse,
2066
2238
  allowSpinX: this.allowSpinX,
2067
2239
  allowSpinY: this.allowSpinY
2068
2240
  }) || this.draggingDirection;
2069
- const n = this.fullscreenView ? document.body : this.container, l = this.dragSpeed / fe, r = l * (this.amountX / n.offsetWidth), a = l * (this.amountY / n.offsetHeight), c = this.allowSpinX ? Math.abs(Math.round(s * r)) : 0, h = this.allowSpinY ? Math.abs(Math.round(o * a)) : 0;
2241
+ const n = this.fullscreenView ? document.body : this.container, l = this.dragSpeed / ve, r = l * (this.amountX / n.offsetWidth), a = l * (this.amountY / n.offsetHeight), c = this.allowSpinX ? Math.abs(Math.round(s * r)) : 0, h = this.allowSpinY ? Math.abs(Math.round(o * a)) : 0;
2070
2242
  (this.allowSpinX && c !== 0 || this.allowSpinY && h !== 0) && (this.hasInteracted = !0, this.hideHotspotPopper(), this.onMoveHandler(this.draggingDirection, c, h), this.movementStart = { x: t, y: i }, setTimeout(() => {
2071
2243
  this.isDragging || (this.isDragging = !0, this.emit("onDragStart"));
2072
- }, Oi));
2244
+ }, Li));
2073
2245
  }
2074
2246
  mouseMove(t) {
2075
- !this.isReady || !this.isClicked && !this.isZoomed || this.glass || (this.hideAllIcons(), this.drag(t.pageX, t.pageY), this.isZoomed && this.applyZoom(t));
2247
+ !this.isReady || !this.isClicked && !this.isZoomed || this.glass || (this.isZoomed || this.hideAllIcons(), this.drag(t.pageX, t.pageY), this.isZoomed && this.applyZoom(t));
2076
2248
  }
2077
2249
  mouseClick(t) {
2078
- if (!(!this.isReady || this.isDragging)) {
2250
+ if (!this.isReady || this.isDragging) return;
2251
+ const i = t.target;
2252
+ if (!(i && i.closest && (i.closest(".cloudimage-360-button") || i.closest(".cloudimage-360-hotspot-timeline-dot") || i.closest(".cloudimage-360-hotspot")))) {
2079
2253
  if (this.dragJustEnded) {
2080
2254
  this.dragJustEnded = !1;
2081
2255
  return;
@@ -2088,18 +2262,23 @@ class Ft {
2088
2262
  this.removeGlass();
2089
2263
  return;
2090
2264
  }
2091
- this.pointerZoom && !this.glass && !this.touchDevice && this.toggleZoom(t);
2265
+ this.pointerZoomTrigger === "click" && this.pointerZoom && !this.glass && !this.touchDevice && this.toggleZoom(t);
2092
2266
  }
2093
2267
  }
2268
+ mouseDblClick(t) {
2269
+ if (!this.isReady) return;
2270
+ const i = t.target;
2271
+ i && i.closest && (i.closest(".cloudimage-360-button") || i.closest(".cloudimage-360-hotspot-timeline-dot") || i.closest(".cloudimage-360-hotspot")) || this.pointerZoomTrigger === "dblclick" && this.pointerZoom && !this.glass && !this.touchDevice && this.toggleZoom(t);
2272
+ }
2094
2273
  loadHigherQualityImages(t, i) {
2095
- const s = Et(this.srcXConfig, t), o = this.allowSpinY ? Et(this.srcYConfig, t) : null;
2096
- ve({
2274
+ const s = xt(this.srcXConfig, t), o = this.allowSpinY ? xt(this.srcYConfig, t) : null;
2275
+ ye({
2097
2276
  cdnPathX: s,
2098
2277
  cdnPathY: o,
2099
2278
  configX: this.srcXConfig,
2100
2279
  configY: this.srcYConfig,
2101
2280
  onAllImagesLoad: (n, l) => {
2102
- this.imagesX = n, this.imagesY = l, i();
2281
+ this.closeImageBitmaps(this.imagesX), this.closeImageBitmaps(this.imagesY), this.imagesX = n, this.imagesY = l, i();
2103
2282
  },
2104
2283
  onError: (n) => this.emit("onError", n)
2105
2284
  });
@@ -2108,31 +2287,46 @@ class Ft {
2108
2287
  this.hotspotsInstance && this.hotspotsInstance.hideHotspots();
2109
2288
  }
2110
2289
  hideHotspotPopper() {
2111
- this.hotspotsInstance && this.hotspotsInstance.hidePopper();
2290
+ this.hotspotsInstance && this.hotspotsInstance.forceHidePopper();
2112
2291
  }
2113
2292
  toggleZoom(t) {
2114
2293
  if (this.isZoomed)
2115
2294
  this.showTransitionOverlay(), setTimeout(() => {
2116
2295
  this.removeZoom();
2117
- }, pe);
2296
+ }, Ht);
2118
2297
  else {
2119
2298
  let i = (this.fullscreenView || this.pointerZoom ? document.body : this.container).offsetWidth;
2120
2299
  this.hideHotspots(), this.showLoadingSpinner(), this.loadHigherQualityImages(i, () => {
2121
2300
  this.showTransitionOverlay(), setTimeout(() => {
2122
2301
  this.applyZoom(t);
2123
- }, pe);
2302
+ }, Ht);
2124
2303
  });
2125
2304
  }
2126
2305
  }
2127
2306
  removeZoom() {
2128
- this.isZoomed = !1, this.updateView(), this.showAllIcons(), this.hideTransitionOverlay(), this.emit("onZoomOut"), this.announce("Zoomed out");
2307
+ this.isZoomed = !1, this.updateView(), this.showAllIcons(), this.hideZoomOutIcon(), this.hideTransitionOverlay(), this.emit("onZoomOut"), this.announce("Zoomed out");
2308
+ }
2309
+ zoomIn(t) {
2310
+ if (this.isZoomed || !this.pointerZoom) return;
2311
+ t == null || t.stopPropagation();
2312
+ let i = (this.fullscreenView || this.pointerZoom ? document.body : this.container).offsetWidth;
2313
+ this.hideHotspots(), this.hideAllIcons(), this.showLoadingSpinner(), this.loadHigherQualityImages(i, () => {
2314
+ this.showTransitionOverlay(), setTimeout(() => {
2315
+ this.applyZoom(t);
2316
+ }, Ht);
2317
+ });
2318
+ }
2319
+ zoomOut(t) {
2320
+ this.isZoomed && (t == null || t.stopPropagation(), this.showTransitionOverlay(), setTimeout(() => {
2321
+ this.removeZoom();
2322
+ }, Ht));
2129
2323
  }
2130
2324
  mouseLeave() {
2131
2325
  this.isZoomed && this.removeZoom();
2132
2326
  }
2133
2327
  applyZoom(t) {
2134
- const { offsetX: i, offsetY: s } = xs(t, this.canvas, this.devicePixelRatio);
2135
- this.isZoomed = !0, this.hideAllIcons(), this.hideLoadingSpinner(), this.hideTransitionOverlay(), this.updateView(this.pointerZoom, i, s), this.emit("onZoomIn", { zoomLevel: this.pointerZoom }), this.announce("Zoomed in. Move mouse to pan. Click to zoom out.");
2328
+ const { offsetX: i, offsetY: s } = Ts(t, this.canvas, this.devicePixelRatio);
2329
+ this.isZoomed || (this.isZoomed = !0, this.hideAllIcons(), this.hideLoadingSpinner(), this.hideTransitionOverlay(), this.showZoomOutIcon(), this.emit("onZoomIn", { zoomLevel: this.pointerZoom }), this.announce("Zoomed in. Move mouse to pan. Click to zoom out.")), this.updateView(this.pointerZoom, i, s);
2136
2330
  }
2137
2331
  touchOutside(t) {
2138
2332
  if (!this.glass) return;
@@ -2141,7 +2335,8 @@ class Ft {
2141
2335
  touchStart(t) {
2142
2336
  if (!this.isReady || this.glass || !t.touches || !t.touches.length) return;
2143
2337
  const i = t.target;
2144
- if (i && i.closest && i.closest(".cloudimage-360-button")) return;
2338
+ if (i && i.closest && (i.closest(".cloudimage-360-button") || i.closest(".cloudimage-360-hotspot-timeline-dot") || i.closest(".cloudimage-360-hotspot")))
2339
+ return;
2145
2340
  if (this.hideHints(), t.touches.length === 2 && this.pinchZoom && !this.isDragging) {
2146
2341
  t.preventDefault(), this.isPinching = !0, this.isClicked = !1, this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null);
2147
2342
  const n = t.touches[0], l = t.touches[1];
@@ -2192,10 +2387,10 @@ class Ft {
2192
2387
  this.initialPinchDistance = l;
2193
2388
  return;
2194
2389
  }
2195
- const r = l / this.initialPinchDistance, a = Math.max(1, Math.min(this.pinchZoomLevel * r, me));
2390
+ const r = l / this.initialPinchDistance, a = Math.max(1, Math.min(this.pinchZoomLevel * r, ge));
2196
2391
  if (this.initialPinchDistance = l, this.pinchZoomLevel = a, !this.canvas) return;
2197
- const c = this.canvas.getBoundingClientRect(), h = c.width / 2 * this.devicePixelRatio, p = c.height / 2 * this.devicePixelRatio;
2198
- a > 1 ? (this.isZoomed = !0, this.hideAllIcons(), this.updateView(a, h, p), (!this.pinchZoomEmitted || a > this.lastEmittedZoom) && (this.emit("onZoomIn", { zoomLevel: a }), this.pinchZoomEmitted = !0, this.lastEmittedZoom = a)) : (this.isZoomed = !1, this.panOffsetX = 0, this.panOffsetY = 0, this.updateView());
2392
+ const c = this.canvas.getBoundingClientRect(), h = c.width / 2 * this.devicePixelRatio, u = c.height / 2 * this.devicePixelRatio;
2393
+ a > 1 ? (this.isZoomed = !0, this.hideAllIcons(), this.updateView(a, h, u), (!this.pinchZoomEmitted || a > this.lastEmittedZoom) && (this.emit("onZoomIn", { zoomLevel: a }), this.pinchZoomEmitted = !0, this.lastEmittedZoom = a)) : (this.isZoomed = !1, this.panOffsetX = 0, this.panOffsetY = 0, this.updateView());
2199
2394
  return;
2200
2395
  }
2201
2396
  if (!this.isClicked || !t.touches || !t.touches[0]) return;
@@ -2210,7 +2405,7 @@ class Ft {
2210
2405
  keyDown(t) {
2211
2406
  if (!this.isReady) return;
2212
2407
  const { keyCode: i } = t, s = this.keysReverse;
2213
- switch (this.autoplay && this.stopAutoplay(), Ee(i, this.allowSpinY) && (this.hasInteracted = !0, this.hideAllIcons(), this.hideHints()), i) {
2408
+ switch (this.autoplay && this.stopAutoplay(), ke(i, this.allowSpinY) && (this.hasInteracted = !0, this.hideAllIcons(), this.hideHints()), i) {
2214
2409
  case 37:
2215
2410
  s ? this.moveLeft() : this.moveRight();
2216
2411
  break;
@@ -2227,19 +2422,19 @@ class Ft {
2227
2422
  }
2228
2423
  keyUp(t) {
2229
2424
  const { keyCode: i } = t;
2230
- Ee(i, this.allowSpinY) && this.showAllIcons();
2425
+ ke(i, this.allowSpinY) && this.showAllIcons();
2231
2426
  }
2232
2427
  moveActiveXIndexUp(t) {
2233
- this.orientation = P.X, this.activeImageX = (this.activeImageX + t) % this.amountX;
2428
+ this.orientation = Y.X, this.activeImageX = (this.activeImageX + t) % this.amountX;
2234
2429
  }
2235
2430
  moveActiveXIndexDown(t) {
2236
- this.orientation = P.X, this.activeImageX = (this.activeImageX - t + this.amountX) % this.amountX;
2431
+ this.orientation = Y.X, this.activeImageX = (this.activeImageX - t + this.amountX) % this.amountX;
2237
2432
  }
2238
2433
  moveActiveYIndexUp(t) {
2239
- this.orientation = P.Y, this.activeImageY = (this.activeImageY + t) % this.amountY;
2434
+ this.orientation = Y.Y, this.activeImageY = (this.activeImageY + t) % this.amountY;
2240
2435
  }
2241
2436
  moveActiveYIndexDown(t) {
2242
- this.orientation = P.Y, this.activeImageY = (this.activeImageY - t + this.amountY) % this.amountY;
2437
+ this.orientation = Y.Y, this.activeImageY = (this.activeImageY - t + this.amountY) % this.amountY;
2243
2438
  }
2244
2439
  moveRight(t, i = 1) {
2245
2440
  t && this.activeImageX >= this.imagesX.length - 1 || (this.moveActiveXIndexUp(i), this.isZoomed || this.updateView());
@@ -2263,8 +2458,8 @@ class Ft {
2263
2458
  });
2264
2459
  }
2265
2460
  updateView(t, i, s) {
2266
- const o = this.orientation === P.X ? this.activeImageX : this.activeImageY, n = this.orientation === P.X ? this.imagesX[this.activeImageX] : this.imagesY[this.activeImageY];
2267
- this.hotspotsInstance && !this.isZoomed && !this.autoplay && this.hotspotsInstance.updateHotspotPosition(o, this.orientation), this.hotspotTimelineIndicator && this.orientation === P.X && this.updateHotspotTimelinePosition(), this.drawImageOnCanvas(n, t, i, s);
2461
+ const o = this.orientation === Y.X ? this.activeImageX : this.activeImageY, n = this.orientation === Y.X ? this.imagesX[this.activeImageX] : this.imagesY[this.activeImageY];
2462
+ this.hotspotsInstance && !this.isZoomed && !this.autoplay && this.hotspotsInstance.updateHotspotPosition(o, this.orientation), this.hotspotTimelineIndicator && this.orientation === Y.X && this.updateHotspotTimelinePosition(), this.drawImageOnCanvas(n, t, i, s);
2268
2463
  }
2269
2464
  updatePercentageInLoader(t = 0) {
2270
2465
  this.loader && (this.loader.innerText = t + "%");
@@ -2282,16 +2477,21 @@ class Ft {
2282
2477
  });
2283
2478
  }
2284
2479
  drawImageOnCanvas(t, i = 1, s = 0, o = 0) {
2285
- this.canvasWorker.postMessage({
2286
- action: "drawImageOnCanvas",
2287
- imageData: t,
2288
- zoomScale: i,
2289
- pointerX: s,
2290
- pointerY: o
2291
- });
2480
+ this.pendingDrawData = { imageData: t, zoomScale: i, pointerX: s, pointerY: o }, this.drawFrameRequested || (this.drawFrameRequested = !0, requestAnimationFrame(() => {
2481
+ if (this.drawFrameRequested = !1, this.pendingDrawData) {
2482
+ const { imageData: n, zoomScale: l, pointerX: r, pointerY: a } = this.pendingDrawData;
2483
+ this.canvasWorker.postMessage({
2484
+ action: "drawImageOnCanvas",
2485
+ imageData: n,
2486
+ zoomScale: l,
2487
+ pointerX: r,
2488
+ pointerY: a
2489
+ });
2490
+ }
2491
+ }));
2292
2492
  }
2293
2493
  pushImageToSet(t, i, s) {
2294
- s === P.X ? this.imagesX[i] = t : this.imagesY[i] = t;
2494
+ s === Y.X ? this.imagesX[i] = t : this.imagesY[i] = t;
2295
2495
  }
2296
2496
  calculatePercentage() {
2297
2497
  const t = this.amountX + this.amountY, i = this.imagesX.length + this.imagesY.length;
@@ -2304,17 +2504,21 @@ class Ft {
2304
2504
  this.createContainers(t), this.adaptCanvasSize(i), this.drawImageOnCanvas(i);
2305
2505
  }
2306
2506
  onAllImagesLoaded() {
2307
- if (this.addAllIcons(), this.isReady = !0, this.amountX = this.imagesX.length, this.amountY = this.imagesY.length, this.activeImageX = this.autoplayReverse ? this.amountX - 1 : 0, this.activeImageY = this.autoplayReverse ? this.amountY - 1 : 0, this.hotspots && (this.hotspotsInstance = new _o(this.hotspots, this.innerBox, this.imageAspectRatio), this.addHotspotTimeline(), this.showHotspotTimeline()), this.emit("onLoad", { imagesX: this.imagesX.length, imagesY: this.imagesY.length }), this.emit("onReady"), this.announce("360 degree view loaded. Use mouse drag or arrow keys to rotate."), this.hints !== !1 && !this.autoplay) {
2308
- const t = this.hints === !0 || this.hints === void 0 ? be(this.viewerConfig, this.touchDevice) : this.hints;
2309
- t && t.length > 0 && (this.hintsOverlay = ye(this.innerBox, t), we(this.hintsOverlay));
2507
+ if (this.addAllIcons(), this.isReady = !0, this.amountX = this.imagesX.length, this.amountY = this.imagesY.length, this.activeImageX = this.autoplayReverse ? this.amountX - 1 : 0, this.activeImageY = this.autoplayReverse ? this.amountY - 1 : 0, this.hotspots && (this.hotspotsInstance = new an(this.hotspots, this.innerBox, this.imageAspectRatio, {
2508
+ trigger: this.hotspotTrigger
2509
+ }), this.addHotspotTimeline(), this.showHotspotTimeline()), this.emit("onLoad", { imagesX: this.imagesX.length, imagesY: this.imagesY.length }), this.emit("onReady"), this.announce("360 degree view loaded. Use mouse drag or arrow keys to rotate."), this.hints !== !1 && !this.autoplay) {
2510
+ const t = this.hints === !0 || this.hints === void 0 ? Ce(this.viewerConfig, this.touchDevice) : this.hints;
2511
+ t && t.length > 0 && (this.hintsOverlay = Ie(this.innerBox, t, {
2512
+ pointerZoomTrigger: this.pointerZoomTrigger
2513
+ }), xe(this.hintsOverlay));
2310
2514
  }
2311
- this.autoplay && (this.hideAllIcons(), ks(this.play.bind(this))());
2515
+ this.autoplay && (this.hideAllIcons(), Ds(this.play.bind(this))());
2312
2516
  }
2313
2517
  magnify(t) {
2314
2518
  t.stopPropagation();
2315
- const { src: i } = this.orientation === P.Y ? this.imagesY[this.activeImageY] : this.imagesX[this.activeImageX], o = (this.fullscreenView ? document.body : this.container).offsetWidth * this.magnifier, n = Di(i, o);
2316
- this.showLoadingSpinner(), this.createGlass(), bs(n, (a) => {
2317
- this.hideLoadingSpinner(), this.magnified = !0, Is(t, this.innerBox, this.offset, a, this.glass, this.magnifier);
2519
+ const { src: i } = this.orientation === Y.Y ? this.imagesY[this.activeImageY] : this.imagesX[this.activeImageX], o = (this.fullscreenView ? document.body : this.container).offsetWidth * this.magnifier, n = Vi(i, o);
2520
+ this.showLoadingSpinner(), this.createGlass(), As(n, (a) => {
2521
+ this.hideLoadingSpinner(), this.magnified = !0, ks(t, this.innerBox, this.offset, a, this.glass, this.magnifier);
2318
2522
  }, (a) => {
2319
2523
  this.hideLoadingSpinner(), this.removeGlass(), this.emit("onError", {
2320
2524
  error: { message: a.message, url: a.url },
@@ -2325,12 +2529,19 @@ class Ft {
2325
2529
  });
2326
2530
  }
2327
2531
  openFullscreenModal(t) {
2328
- t.stopPropagation(), window.document.body.style.overflow = "hidden";
2329
- const i = _i(this.container);
2330
- new Ft(i, this.viewerConfig, !0), this.emit("onFullscreenOpen"), this.announce("Opened fullscreen mode. Press Escape to exit.");
2532
+ t.stopPropagation(), this.hideHotspotPopper(), this.releaseMemory(), window.document.body.style.overflow = "hidden";
2533
+ const i = os(this.container);
2534
+ this.fullscreenInstance = new Vt(i, this.viewerConfig, !0), this.fullscreenInstance.originalViewer = this, this.emit("onFullscreenOpen"), this.announce("Opened fullscreen mode. Press Escape to exit.");
2331
2535
  }
2332
2536
  closeFullscreenModal(t) {
2333
- t.stopPropagation(), document.body.removeChild(this.container.parentNode), window.document.body.style.overflow = "visible", this.emit("onFullscreenClose"), this.announce("Exited fullscreen mode");
2537
+ t.stopPropagation();
2538
+ const i = this.originalViewer || this, s = this.fullscreenView ? this : i.fullscreenInstance;
2539
+ if (s) {
2540
+ s.hideHotspotPopper();
2541
+ const o = s.container.parentNode;
2542
+ o && o.parentNode && o.parentNode.removeChild(o), s.destroy(), i.fullscreenInstance && (i.fullscreenInstance = null);
2543
+ }
2544
+ window.document.body.style.overflow = "visible", i.reloadImages(), i.emit("onFullscreenClose"), i.announce("Exited fullscreen mode");
2334
2545
  }
2335
2546
  play() {
2336
2547
  if (this.isClicked) return;
@@ -2342,7 +2553,7 @@ class Ft {
2342
2553
  bottom: this.moveBottom.bind(this)
2343
2554
  };
2344
2555
  this.loopTimeoutId = window.setInterval(() => {
2345
- if (this.playOnce && Os({
2556
+ if (this.playOnce && Ys({
2346
2557
  autoplayBehavior: this.autoplayBehavior,
2347
2558
  activeImageX: this.activeImageX,
2348
2559
  activeImageY: this.activeImageY,
@@ -2353,7 +2564,7 @@ class Ft {
2353
2564
  this.stopAutoplay();
2354
2565
  return;
2355
2566
  }
2356
- Es({
2567
+ Xs({
2357
2568
  autoplayBehavior: this.autoplayBehavior,
2358
2569
  activeImageX: this.activeImageX,
2359
2570
  activeImageY: this.activeImageY,
@@ -2361,9 +2572,9 @@ class Ft {
2361
2572
  amountY: this.amountY,
2362
2573
  autoplayReverse: this.autoplayReverse,
2363
2574
  spinDirection: this.spinDirection
2364
- }) && (this.spinDirection = As(this.spinDirection));
2575
+ }) && (this.spinDirection = Hs(this.spinDirection));
2365
2576
  const n = this.spinDirection === "y";
2366
- Cs({
2577
+ Ps({
2367
2578
  autoplayBehavior: this.autoplayBehavior,
2368
2579
  spinY: n,
2369
2580
  reversed: this.autoplayReverse,
@@ -2373,15 +2584,37 @@ class Ft {
2373
2584
  }
2374
2585
  stopAutoplay() {
2375
2586
  if (this.showAllIcons(), this.autoplay = !1, window.clearTimeout(this.loopTimeoutId), this.loopTimeoutId = null, this.emit("onAutoplayStop"), this.hints !== !1 && !this.hintsOverlay && !this.hintsHidden) {
2376
- const t = this.hints === !0 ? be(this.viewerConfig, this.touchDevice) : this.hints;
2377
- t && t.length > 0 && (this.hintsOverlay = ye(this.innerBox, t), we(this.hintsOverlay));
2587
+ const t = this.hints === !0 ? Ce(this.viewerConfig, this.touchDevice) : this.hints;
2588
+ t && t.length > 0 && (this.hintsOverlay = Ie(this.innerBox, t, {
2589
+ pointerZoomTrigger: this.pointerZoomTrigger
2590
+ }), xe(this.hintsOverlay));
2378
2591
  }
2379
2592
  }
2380
2593
  destroy() {
2381
- this.stopAutoplay(), this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null), this.removeEvents(), this.canvasWorker && (this.canvasWorker.terminate(), this.canvasWorker = null), this.hotspotsInstance && this.hotspotsInstance.destroy(), this.hintsOverlay && this.hintsOverlay.parentNode && (this.hintsOverlay.parentNode.removeChild(this.hintsOverlay), this.hintsOverlay = null), this.hotspotTimeline && this.hotspotTimeline.parentNode && (this.hotspotTimeline.parentNode.removeChild(this.hotspotTimeline), this.hotspotTimeline = null, this.hotspotTimelineIndicator = null), this.container && (this.container.classList.remove("ci360-theme-dark"), this.container.innerHTML = "");
2594
+ this.stopAutoplay(), this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null), this.removeEvents(), this.closeImageBitmaps(this.imagesX), this.closeImageBitmaps(this.imagesY), this.imagesX = [], this.imagesY = [], this.canvasWorker && (this.canvasWorker.terminate(), this.canvasWorker = null), this.hotspotsInstance && this.hotspotsInstance.destroy(), this.hintsOverlay && this.hintsOverlay.parentNode && (this.hintsOverlay.parentNode.removeChild(this.hintsOverlay), this.hintsOverlay = null), this.hotspotTimeline && this.hotspotTimeline.parentNode && (this.hotspotTimeline.parentNode.removeChild(this.hotspotTimeline), this.hotspotTimeline = null, this.hotspotTimelineIndicator = null), this.container && (this.container.classList.remove("ci360-theme-dark"), this.container.innerHTML = "");
2595
+ }
2596
+ /**
2597
+ * Release memory by closing ImageBitmap objects without destroying the viewer.
2598
+ * Useful for freeing memory when the viewer scrolls off-screen on mobile.
2599
+ * Call reloadImages() to restore the images when the viewer becomes visible again.
2600
+ */
2601
+ releaseMemory() {
2602
+ this.stopAutoplay(), this.closeImageBitmaps(this.imagesX), this.closeImageBitmaps(this.imagesY), this.imagesX = [], this.imagesY = [], this.isMemoryReleased = !0;
2603
+ }
2604
+ /**
2605
+ * Reload images after memory was released.
2606
+ * Call this when the viewer becomes visible again after releaseMemory() was called.
2607
+ */
2608
+ reloadImages() {
2609
+ if (!this.isMemoryReleased) return;
2610
+ this.isMemoryReleased = !1;
2611
+ const t = this.container.offsetWidth;
2612
+ this.loadHigherQualityImages(t, () => {
2613
+ this.updateView();
2614
+ });
2382
2615
  }
2383
2616
  addInitialIcon() {
2384
- this.initialIcon || this.hide360Logo || (this.initialIcon = Vi(this.logoSrc), this.innerBox.appendChild(this.initialIcon));
2617
+ this.initialIcon || this.hide360Logo || (this.initialIcon = Ki(this.logoSrc), this.innerBox.appendChild(this.initialIcon));
2385
2618
  }
2386
2619
  showInitialIcon() {
2387
2620
  !this.initialIcon || this.hasInteracted || (this.initialIcon.style.opacity = 1);
@@ -2396,19 +2629,25 @@ class Ft {
2396
2629
  this.showAllIcons(), this.innerBox.removeChild(this.glass), this.glass = null, this.magnified = !1;
2397
2630
  }
2398
2631
  addMagnifierIcon() {
2399
- this.magnifier && (this.magnifierIcon = Ui(), this.magnifierIcon.onclick = this.magnify.bind(this), this.iconsContainer.appendChild(this.magnifierIcon));
2632
+ this.pointerZoom && (this.magnifierIcon = es(), this.magnifierIcon.onclick = this.zoomIn.bind(this), this.iconsContainer.appendChild(this.magnifierIcon), this.zoomOutIcon = is(), this.zoomOutIcon.onclick = this.zoomOut.bind(this), this.zoomOutIcon.style.display = "none", this.iconsContainer.appendChild(this.zoomOutIcon));
2400
2633
  }
2401
2634
  showMagnifierIcon() {
2402
- this.magnifierIcon && (this.magnifierIcon.style.visibility = "visible", this.magnifierIcon.style.opacity = 1);
2635
+ this.magnifierIcon && (this.magnifierIcon.style.display = "", this.magnifierIcon.style.visibility = "visible", this.magnifierIcon.style.opacity = 1);
2403
2636
  }
2404
2637
  hideMagnifierIcon() {
2405
- this.magnifierIcon && (this.magnifierIcon.style.visibility = "hidden", this.magnifierIcon.style.opacity = 0);
2638
+ this.magnifierIcon && (this.magnifierIcon.style.display = "none", this.magnifierIcon.style.visibility = "hidden", this.magnifierIcon.style.opacity = 0);
2639
+ }
2640
+ showZoomOutIcon() {
2641
+ this.zoomOutIcon && (this.zoomOutIcon.style.display = "", this.zoomOutIcon.style.visibility = "visible", this.zoomOutIcon.style.opacity = 1);
2642
+ }
2643
+ hideZoomOutIcon() {
2644
+ this.zoomOutIcon && (this.zoomOutIcon.style.display = "none", this.zoomOutIcon.style.visibility = "hidden", this.zoomOutIcon.style.opacity = 0);
2406
2645
  }
2407
2646
  addFullscreenIcon() {
2408
- this.fullscreen && (this.fullscreenIcon = zi(), this.fullscreenIcon.onclick = this.openFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenIcon));
2647
+ this.fullscreen && (this.fullscreenIcon = Qi(), this.fullscreenIcon.onclick = this.openFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenIcon));
2409
2648
  }
2410
2649
  addCloseFullscreenIcon() {
2411
- this.fullscreenCloseIcon = $i(), this.fullscreenCloseIcon.onclick = this.closeFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenCloseIcon);
2650
+ this.fullscreenCloseIcon = qi(), this.fullscreenCloseIcon.onclick = this.closeFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenCloseIcon);
2412
2651
  }
2413
2652
  showFullscreenIcon() {
2414
2653
  this.fullscreenIcon && (this.fullscreenIcon.style.opacity = 1);
@@ -2417,7 +2656,7 @@ class Ft {
2417
2656
  this.fullscreenIcon && (this.fullscreenIcon.style.opacity = 0);
2418
2657
  }
2419
2658
  add360ViewCircleIcon() {
2420
- this.view360CircleIcon || (this.view360CircleIcon = Fi(this.bottomCircleOffset), this.innerBox.appendChild(this.view360CircleIcon));
2659
+ this.view360CircleIcon || (this.view360CircleIcon = _i(this.bottomCircleOffset), this.innerBox.appendChild(this.view360CircleIcon));
2421
2660
  }
2422
2661
  show360ViewCircleIcon() {
2423
2662
  this.view360CircleIcon && (this.view360CircleIcon.style.opacity = 1);
@@ -2426,13 +2665,13 @@ class Ft {
2426
2665
  this.view360CircleIcon && (this.view360CircleIcon.style.opacity = 0);
2427
2666
  }
2428
2667
  addLoadingSpinner() {
2429
- this.loadingSpinner = Ji(), this.innerBox.appendChild(this.loadingSpinner);
2668
+ this.loadingSpinner = ns(), this.innerBox.appendChild(this.loadingSpinner);
2430
2669
  }
2431
2670
  showLoadingSpinner() {
2432
2671
  this.loadingSpinner && (this.hideAllIcons(), this.loadingSpinner.style.opacity = 1);
2433
2672
  }
2434
2673
  createTransitionOverlay() {
2435
- this.transitionOverlay = qi(), this.innerBox.appendChild(this.transitionOverlay);
2674
+ this.transitionOverlay = rs(), this.innerBox.appendChild(this.transitionOverlay);
2436
2675
  }
2437
2676
  showTransitionOverlay() {
2438
2677
  this.transitionOverlay && (this.hideAllIcons(), this.transitionOverlay.style.opacity = 1);
@@ -2444,28 +2683,28 @@ class Ft {
2444
2683
  this.loadingSpinner && (this.loadingSpinner.style.opacity = 0);
2445
2684
  }
2446
2685
  hideHints() {
2447
- !this.hintsOverlay || this.hintsHidden || (this.hintsHidden = !0, os(this.hintsOverlay));
2686
+ !this.hintsOverlay || this.hintsHidden || (this.hintsHidden = !0, ds(this.hintsOverlay));
2448
2687
  }
2449
2688
  addHotspotTimeline() {
2450
2689
  if (!this.hotspots || this.hotspotTimeline) return;
2451
- const t = cs(this.container, this.amountX, this.hotspots);
2690
+ const t = vs(this.container, this.amountX, this.hotspots);
2452
2691
  if (!t) return;
2453
2692
  this.hotspotTimeline = t.element, this.hotspotTimelineIndicator = t.indicator, this.hotspotTimeline.querySelectorAll(".cloudimage-360-hotspot-timeline-dot").forEach((s) => {
2454
2693
  s.addEventListener("click", (o) => {
2455
- o.stopPropagation();
2694
+ o.stopPropagation(), this.hideAllIcons(), this.hideHints();
2456
2695
  const n = parseInt(s.getAttribute("data-frame"), 10), l = s.getAttribute("data-hotspot-id");
2457
2696
  isNaN(n) || this.animateToFrame(n, l);
2458
2697
  });
2459
2698
  }), this.updateHotspotTimelinePosition();
2460
2699
  }
2461
2700
  showHotspotTimeline() {
2462
- ds(this.hotspotTimeline);
2701
+ ys(this.hotspotTimeline);
2463
2702
  }
2464
2703
  hideHotspotTimeline() {
2465
- us(this.hotspotTimeline);
2704
+ bs(this.hotspotTimeline);
2466
2705
  }
2467
2706
  updateHotspotTimelinePosition() {
2468
- hs(this.hotspotTimelineIndicator, this.activeImageX, this.amountX);
2707
+ gs(this.hotspotTimelineIndicator, this.activeImageX, this.amountX);
2469
2708
  }
2470
2709
  /**
2471
2710
  * Animates the viewer to a target frame, optionally showing a hotspot popup on arrival
@@ -2502,13 +2741,13 @@ class Ft {
2502
2741
  this.view360CircleIcon && (this.innerBox.removeChild(this.view360CircleIcon), this.view360CircleIcon = null);
2503
2742
  }
2504
2743
  addAllIcons() {
2505
- this.removeLoader(), this.innerBox.style.cursor = "grab", this.pointerZoom && (this.createTransitionOverlay(), this.addLoadingSpinner()), !this.fullscreenView && !this.touchDevice && this.addMagnifierIcon(), this.fullscreenView || this.addFullscreenIcon(), this.initialIconShown && this.addInitialIcon(), this.bottomCircle && this.add360ViewCircleIcon();
2744
+ this.removeLoader(), this.iconsContainer && (this.innerBox.style.cursor = "grab", this.pointerZoom && (this.createTransitionOverlay(), this.addLoadingSpinner()), !this.fullscreenView && !this.touchDevice && this.addMagnifierIcon(), this.fullscreenView || this.addFullscreenIcon(), this.initialIconShown && this.addInitialIcon(), this.bottomCircle && this.add360ViewCircleIcon());
2506
2745
  }
2507
2746
  showAllIcons() {
2508
2747
  this.showInitialIcon(), this.show360ViewCircleIcon(), this.showMagnifierIcon(), this.showFullscreenIcon(), this.showHotspotTimeline();
2509
2748
  }
2510
2749
  hideAllIcons() {
2511
- this.hideInitialIcon(), this.hide360ViewCircleIcon(), this.hideMagnifierIcon(), this.hideFullscreenIcon(), this.hideHotspotTimeline();
2750
+ this.hideInitialIcon(), this.hide360ViewCircleIcon(), this.hideMagnifierIcon(), this.hideZoomOutIcon(), this.hideFullscreenIcon();
2512
2751
  }
2513
2752
  removeLoader() {
2514
2753
  this.loader && (this.innerBox.removeChild(this.loader), this.loader = null);
@@ -2520,10 +2759,10 @@ class Ft {
2520
2759
  this.removeMouseEvents(), this.removeTouchEvents(), this.removeKeyboardEvents(), this.removeEscKeyHandler();
2521
2760
  }
2522
2761
  addMouseEvents() {
2523
- this.boundMouseClick = this.mouseClick.bind(this), this.boundMouseDown = this.mouseDown.bind(this), this.boundMouseMove = de(this.mouseMove.bind(this), ue), this.boundMouseUp = this.mouseUp.bind(this), this.boundMouseLeave = this.mouseLeave.bind(this), this.innerBox.addEventListener("click", this.boundMouseClick), this.innerBox.addEventListener("mousedown", this.boundMouseDown), this.innerBox.addEventListener("mouseleave", this.boundMouseLeave), document.addEventListener("mousemove", this.boundMouseMove), document.addEventListener("mouseup", this.boundMouseUp);
2762
+ this.boundMouseClick = this.mouseClick.bind(this), this.boundMouseDblClick = this.mouseDblClick.bind(this), this.boundMouseDown = this.mouseDown.bind(this), this.boundMouseMove = me(this.mouseMove.bind(this), fe), this.boundMouseUp = this.mouseUp.bind(this), this.boundMouseLeave = this.mouseLeave.bind(this), this.innerBox.addEventListener("click", this.boundMouseClick), this.innerBox.addEventListener("dblclick", this.boundMouseDblClick), this.innerBox.addEventListener("mousedown", this.boundMouseDown), this.innerBox.addEventListener("mouseleave", this.boundMouseLeave), document.addEventListener("mousemove", this.boundMouseMove), document.addEventListener("mouseup", this.boundMouseUp);
2524
2763
  }
2525
2764
  addTouchEvents() {
2526
- this.boundTouchOutside = this.touchOutside.bind(this), this.boundTouchStart = this.touchStart.bind(this), this.boundTouchEnd = this.touchEnd.bind(this), this.boundTouchMove = de(this.touchMove.bind(this), ue), document.addEventListener("touchstart", this.boundTouchOutside), this.container.addEventListener("touchstart", this.boundTouchStart), this.container.addEventListener("touchend", this.boundTouchEnd), this.container.addEventListener("touchmove", this.boundTouchMove);
2765
+ this.boundTouchOutside = this.touchOutside.bind(this), this.boundTouchStart = this.touchStart.bind(this), this.boundTouchEnd = this.touchEnd.bind(this), this.boundTouchMove = me(this.touchMove.bind(this), fe), document.addEventListener("touchstart", this.boundTouchOutside), this.container.addEventListener("touchstart", this.boundTouchStart), this.container.addEventListener("touchend", this.boundTouchEnd), this.container.addEventListener("touchmove", this.boundTouchMove);
2527
2766
  }
2528
2767
  addKeyboardEvents() {
2529
2768
  this.boundKeyDown = this.keyDown.bind(this), this.boundKeyUp = this.keyUp.bind(this), document.addEventListener("keydown", this.boundKeyDown), document.addEventListener("keyup", this.boundKeyUp);
@@ -2537,7 +2776,7 @@ class Ft {
2537
2776
  document.removeEventListener("keydown", this.boundEscHandler);
2538
2777
  }
2539
2778
  removeMouseEvents() {
2540
- this.innerBox.removeEventListener("click", this.boundMouseClick), this.innerBox.removeEventListener("mousedown", this.boundMouseDown), this.innerBox.removeEventListener("mouseleave", this.boundMouseLeave), document.removeEventListener("mousemove", this.boundMouseMove), document.removeEventListener("mouseup", this.boundMouseUp);
2779
+ this.innerBox.removeEventListener("click", this.boundMouseClick), this.innerBox.removeEventListener("dblclick", this.boundMouseDblClick), this.innerBox.removeEventListener("mousedown", this.boundMouseDown), this.innerBox.removeEventListener("mouseleave", this.boundMouseLeave), document.removeEventListener("mousemove", this.boundMouseMove), document.removeEventListener("mouseup", this.boundMouseUp);
2541
2780
  }
2542
2781
  removeTouchEvents() {
2543
2782
  document.removeEventListener("touchstart", this.boundTouchOutside), this.container.removeEventListener("touchstart", this.boundTouchStart), this.container.removeEventListener("touchend", this.boundTouchEnd), this.container.removeEventListener("touchmove", this.boundTouchMove);
@@ -2546,115 +2785,126 @@ class Ft {
2546
2785
  document.removeEventListener("keydown", this.boundKeyDown), document.removeEventListener("keyup", this.boundKeyUp);
2547
2786
  }
2548
2787
  createContainers(t) {
2549
- this.iconsContainer = ge(this.innerBox), this.canvas = ji(this.innerBox, t), this.loader = Ki(this.innerBox), this.ariaLiveRegion = ts(this.innerBox);
2550
- const i = this.canvas.transferControlToOffscreen();
2551
- this.canvasWorker.postMessage(
2552
- {
2788
+ if (this.iconsContainer = be(this.innerBox), this.canvas = Ji(this.innerBox, t), this.loader = ss(this.innerBox), this.ariaLiveRegion = ls(this.innerBox), this.useMainThreadCanvas)
2789
+ this.canvasWorker.postMessage({
2553
2790
  action: "initCanvas",
2554
- offscreen: i,
2791
+ offscreen: this.canvas,
2555
2792
  devicePixelRatio: this.devicePixelRatio
2556
- },
2557
- [i]
2558
- ), this.fullscreenView && this.addCloseFullscreenIcon(), Jt(this.innerBox, ".cloudimage-360-placeholder");
2793
+ });
2794
+ else {
2795
+ const i = this.canvas.transferControlToOffscreen();
2796
+ this.canvasWorker.postMessage(
2797
+ {
2798
+ action: "initCanvas",
2799
+ offscreen: i,
2800
+ devicePixelRatio: this.devicePixelRatio
2801
+ },
2802
+ [i]
2803
+ );
2804
+ }
2805
+ this.fullscreenView && this.addCloseFullscreenIcon(), qt(this.innerBox, ".cloudimage-360-placeholder");
2559
2806
  }
2560
2807
  update(t) {
2561
- this.isReady && (this.stopAutoplay(), Jt(this.innerBox, ".cloudimage-360-icons-container"), this.init(this.container, t, !0), this.iconsContainer = ge(this.innerBox), this.onAllImagesLoaded());
2808
+ this.isReady && (this.stopAutoplay(), qt(this.innerBox, ".cloudimage-360-icons-container"), this.init(this.container, t, !0), this.iconsContainer = be(this.innerBox), this.onAllImagesLoaded());
2562
2809
  }
2563
2810
  init(t, i, s) {
2564
- const o = i ? Xi(i) : Ti(t), {
2811
+ const o = i ? Zi(i) : Ri(t), {
2565
2812
  folder: n,
2566
2813
  apiVersion: l,
2567
2814
  filenameX: r,
2568
2815
  filenameY: a,
2569
2816
  imageListX: c,
2570
2817
  imageListY: h,
2571
- indexZeroBase: p,
2818
+ indexZeroBase: u,
2572
2819
  amountX: f,
2573
- amountY: u,
2820
+ amountY: p,
2574
2821
  draggable: I = !0,
2575
- swipeable: g = !0,
2822
+ swipeable: b = !0,
2576
2823
  keys: v,
2577
- keysReverse: m,
2578
- bottomCircleOffset: b,
2579
- autoplay: x,
2580
- autoplayBehavior: w,
2581
- playOnce: C,
2582
- speed: y,
2583
- autoplayReverse: O,
2584
- fullscreen: S,
2585
- magnifier: E,
2586
- ciToken: A,
2587
- ciFilters: k,
2588
- ciTransformation: R,
2589
- lazyload: T,
2590
- dragSpeed: z,
2824
+ keysReverse: O,
2825
+ bottomCircleOffset: E,
2826
+ autoplay: w,
2827
+ autoplayBehavior: y,
2828
+ playOnce: x,
2829
+ speed: m,
2830
+ autoplayReverse: g,
2831
+ fullscreen: C,
2832
+ magnifier: A,
2833
+ ciToken: S,
2834
+ ciFilters: T,
2835
+ ciTransformation: X,
2836
+ lazyload: L,
2837
+ dragSpeed: $,
2591
2838
  stopAtEdges: G,
2592
- pointerZoom: Y,
2593
- imageInfo: Z = "black",
2594
- initialIconShown: rt,
2595
- bottomCircle: U,
2596
- hotspots: at,
2597
- dragReverse: vt,
2598
- hide360Logo: tt,
2599
- logoSrc: lt,
2600
- inertia: q,
2601
- pinchZoom: V,
2602
- hints: et,
2603
- theme: it,
2604
- hotspotTimelineOnClick: K = !0,
2839
+ pointerZoom: M,
2840
+ pointerZoomTrigger: D = "dblclick",
2841
+ imageInfo: ot = "black",
2842
+ initialIconShown: _,
2843
+ bottomCircle: nt,
2844
+ hotspots: yt,
2845
+ hotspotTrigger: tt = "hover",
2846
+ dragReverse: rt,
2847
+ hide360Logo: q,
2848
+ logoSrc: N,
2849
+ inertia: et,
2850
+ pinchZoom: at,
2851
+ hints: U,
2852
+ theme: lt,
2853
+ hotspotTimelineOnClick: zt = !0,
2605
2854
  aspectRatio: ct,
2606
2855
  // Event callbacks
2607
- onReady: Vt,
2608
- onLoad: gt,
2609
- onSpin: jt,
2610
- onAutoplayStart: Xt,
2611
- onAutoplayStop: $t,
2612
- onFullscreenOpen: zt,
2613
- onFullscreenClose: Pt,
2614
- onZoomIn: Rt,
2615
- onZoomOut: Gt,
2616
- onDragStart: Ut,
2617
- onDragEnd: _,
2618
- onError: ht
2619
- } = o, yt = { ciToken: A, ciFilters: k, ciTransformation: R }, dt = qt(c, []), st = qt(h, []);
2620
- if (this.viewerConfig = o, this.amountX = dt.length || f, this.amountY = st.length || u, this.allowSpinX = !!this.amountX, this.allowSpinY = !!this.amountY, this.activeImageX = O ? this.amountX - 1 : 0, this.activeImageY = O ? this.amountY - 1 : 0, this.bottomCircleOffset = b, this.autoplay = x, this.autoplayBehavior = w, this.playOnce = C, this.speed = y, this.autoplayReverse = O, this.fullscreen = S, this.magnifier = E > 1 ? Math.min(E, Li) : 0, this.dragSpeed = Math.max(z, Ai), this.stopAtEdges = G, this.ciParams = yt, this.apiVersion = l, this.pointerZoom = Y > 1 ? Math.min(Y, me) : null, this.keysReverse = m, this.info = Z, this.keys = v, this.innerBox = this.innerBox ?? Gi(this.container), ct && (this.container.style.aspectRatio = ct), this.initialIconShown = rt, this.bottomCircle = U, this.spinDirection = Ss(this.autoplayBehavior, this.allowSpinX, this.allowSpinY), this.dragReverse = vt, this.hotspots = at, this.hide360Logo = tt, this.logoSrc = lt, this.inertia = q, this.pinchZoom = V, this.hints = et, this.hotspotTimelineOnClick = K, it === "dark" ? this.container.classList.add("ci360-theme-dark") : it === "light" && this.container.classList.remove("ci360-theme-dark"), this.onReady = Vt, this.onLoad = gt, this.onSpin = jt, this.onAutoplayStart = Xt, this.onAutoplayStop = $t, this.onFullscreenOpen = zt, this.onFullscreenClose = Pt, this.onZoomIn = Rt, this.onZoomOut = Gt, this.onDragStart = Ut, this.onDragEnd = _, this.onError = ht, this.srcXConfig = {
2856
+ onReady: jt,
2857
+ onLoad: Lt,
2858
+ onSpin: $t,
2859
+ onAutoplayStart: Gt,
2860
+ onAutoplayStop: Mt,
2861
+ onFullscreenOpen: Pt,
2862
+ onFullscreenClose: _t,
2863
+ onZoomIn: Ut,
2864
+ onZoomOut: K,
2865
+ onDragStart: ht,
2866
+ onDragEnd: Yt,
2867
+ onError: Xt
2868
+ } = o, dt = { ciToken: S, ciFilters: T, ciTransformation: X }, ut = Qt(c, []), pt = Qt(h, []);
2869
+ if (this.viewerConfig = o, this.amountX = ut.length || f, this.amountY = pt.length || p, this.allowSpinX = !!this.amountX, this.allowSpinY = !!this.amountY, this.activeImageX = g ? this.amountX - 1 : 0, this.activeImageY = g ? this.amountY - 1 : 0, this.bottomCircleOffset = E, this.autoplay = w, this.autoplayBehavior = y, this.playOnce = x, this.speed = m, this.autoplayReverse = g, this.fullscreen = C, this.magnifier = A > 1 ? Math.min(A, Xi) : 0, this.dragSpeed = Math.max($, Yi), this.stopAtEdges = G, this.ciParams = dt, this.apiVersion = l, this.pointerZoom = M > 1 ? Math.min(M, ge) : null, this.pointerZoomTrigger = D, this.keysReverse = O, this.info = ot, this.keys = v, this.innerBox = this.innerBox ?? ts(this.container), ct && (this.container.style.aspectRatio = ct), this.initialIconShown = _, this.bottomCircle = nt, this.spinDirection = Rs(this.autoplayBehavior, this.allowSpinX, this.allowSpinY), this.dragReverse = rt, this.hotspots = yt, this.hotspotTrigger = tt, this.hide360Logo = q, this.logoSrc = N, this.inertia = et, this.pinchZoom = at, this.hints = U, this.hotspotTimelineOnClick = zt, lt === "dark" ? this.container.classList.add("ci360-theme-dark") : lt === "light" && this.container.classList.remove("ci360-theme-dark"), this.onReady = jt, this.onLoad = Lt, this.onSpin = $t, this.onAutoplayStart = Gt, this.onAutoplayStop = Mt, this.onFullscreenOpen = Pt, this.onFullscreenClose = _t, this.onZoomIn = Ut, this.onZoomOut = K, this.onDragStart = ht, this.onDragEnd = Yt, this.onError = Xt, this.srcXConfig = {
2621
2870
  folder: n,
2622
2871
  filename: r,
2623
- imageList: dt,
2872
+ imageList: ut,
2624
2873
  container: t,
2625
2874
  innerBox: this.innerBox,
2626
2875
  apiVersion: l,
2627
- ciParams: yt,
2628
- lazyload: T,
2876
+ ciParams: dt,
2877
+ lazyload: L,
2629
2878
  amount: this.amountX,
2630
- indexZeroBase: p,
2631
- autoplayReverse: O,
2632
- orientation: P.X
2879
+ indexZeroBase: u,
2880
+ autoplayReverse: g,
2881
+ orientation: Y.X
2633
2882
  }, this.srcYConfig = {
2634
2883
  ...this.srcXConfig,
2635
2884
  filename: a,
2636
- imageList: st,
2637
- orientation: P.Y,
2885
+ imageList: pt,
2886
+ orientation: Y.Y,
2638
2887
  amount: this.amountY
2639
- }, s && this.removeEvents(), this.attachEvents(I, g, v), s) return;
2640
- const bt = (this.fullscreenView ? document.body : this.container).offsetWidth, wt = this.allowSpinX && !dt.length ? Et(this.srcXConfig, bt) : null, It = this.allowSpinY && !st.length ? Et(this.srcYConfig, bt) : null, xt = (Je) => {
2641
- ve({
2888
+ }, s && this.removeEvents(), this.attachEvents(I, b, v), s) return;
2889
+ const bt = (this.fullscreenView ? document.body : this.container).offsetWidth, wt = this.allowSpinX && !ut.length ? xt(this.srcXConfig, bt) : null, ce = this.allowSpinY && !pt.length ? xt(this.srcYConfig, bt) : null, he = (ii) => {
2890
+ ye({
2642
2891
  cdnPathX: wt,
2643
- cdnPathY: It,
2892
+ cdnPathY: ce,
2644
2893
  configX: this.srcXConfig,
2645
2894
  configY: this.srcYConfig,
2646
- onImageLoad: (Ct, qe, Qe) => this.onImageLoad(Ct, qe, Qe),
2647
- onFirstImageLoad: (Ct) => this.onFirstImageLoaded(Je, Ct),
2895
+ onImageLoad: (It, si, oi) => this.onImageLoad(It, si, oi),
2896
+ onFirstImageLoad: (It) => this.onFirstImageLoaded(ii, It),
2648
2897
  onAllImagesLoad: this.onAllImagesLoaded.bind(this),
2649
- onError: (Ct) => this.emit("onError", Ct)
2898
+ onError: (It) => this.emit("onError", It)
2650
2899
  });
2651
2900
  };
2652
- this.allowSpinX ? xe(wt, this.srcXConfig, xt) : this.allowSpinY && xe(It, this.srcYConfig, xt);
2901
+ this.allowSpinX ? Ee(wt, this.srcXConfig, he) : this.allowSpinY && Ee(ce, this.srcYConfig, he);
2653
2902
  }
2654
2903
  }
2655
- class qo {
2904
+ const Ve = typeof navigator < "u" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
2905
+ class cn {
2656
2906
  constructor() {
2657
- this.views = /* @__PURE__ */ new Map(), this.initAll = this.initAll.bind(this), this.getViews = this.getViews.bind(this);
2907
+ this.views = /* @__PURE__ */ new Map(), this.initAll = this.initAll.bind(this), this.getViews = this.getViews.bind(this), this.memoryObserver = null, this.memoryManagementAutoEnabled = !1;
2658
2908
  }
2659
2909
  generateId() {
2660
2910
  return `ci360-${Math.random().toString(36).slice(2, 11)}`;
@@ -2663,16 +2913,16 @@ class qo {
2663
2913
  if (!t) return;
2664
2914
  const o = t.id || this.generateId();
2665
2915
  t.id || (t.id = o);
2666
- const n = new Ft(t, i, s);
2667
- return this.views.set(o, n), n;
2916
+ const n = new Vt(t, i, s);
2917
+ return this.views.set(o, n), Ve && !this.memoryManagementAutoEnabled && (this.memoryManagementAutoEnabled = !0, setTimeout(() => this.enableMemoryManagement(), 100)), n;
2668
2918
  }
2669
2919
  initAll(t = "cloudimage-360") {
2670
2920
  [...document.querySelectorAll(`.${t}`)].filter(Boolean).forEach((s) => {
2671
2921
  const o = s.id || this.generateId();
2672
2922
  s.id || (s.id = o);
2673
- const n = new Ft(s);
2923
+ const n = new Vt(s);
2674
2924
  this.views.set(o, n);
2675
- });
2925
+ }), Ve && !this.memoryManagementAutoEnabled && this.views.size > 0 && (this.memoryManagementAutoEnabled = !0, setTimeout(() => this.enableMemoryManagement(), 100));
2676
2926
  }
2677
2927
  destroy(t) {
2678
2928
  const i = this.getViewById(t);
@@ -2697,8 +2947,50 @@ class qo {
2697
2947
  const n = document.getElementById(t);
2698
2948
  return this.init(n, o);
2699
2949
  }
2950
+ /**
2951
+ * Enable automatic memory management for mobile devices.
2952
+ * Releases memory for off-screen viewers and reloads when they become visible.
2953
+ * Also releases memory when the page is backgrounded (visibilitychange).
2954
+ * Call this after initializing all viewers.
2955
+ * @param {Object} options - Configuration options
2956
+ * @param {string} options.rootMargin - IntersectionObserver rootMargin (default: '200px')
2957
+ */
2958
+ enableMemoryManagement(t = {}) {
2959
+ this.memoryObserver && this.memoryObserver.disconnect();
2960
+ const i = t.rootMargin || "200px";
2961
+ this.memoryObserver = new IntersectionObserver(
2962
+ (s) => {
2963
+ s.forEach((o) => {
2964
+ const n = this.getViewById(o.target.id);
2965
+ n && (o.isIntersecting ? n.isMemoryReleased && n.reloadImages() : !n.isMemoryReleased && n.isReady && n.releaseMemory());
2966
+ });
2967
+ },
2968
+ { rootMargin: i }
2969
+ ), this.views.forEach((s, o) => {
2970
+ const n = document.getElementById(o);
2971
+ n && this.memoryObserver.observe(n);
2972
+ }), this.boundVisibilityHandler = () => {
2973
+ document.hidden ? this.views.forEach((s) => {
2974
+ !s.isMemoryReleased && s.isReady && s.releaseMemory();
2975
+ }) : this.views.forEach((s, o) => {
2976
+ if (s.isMemoryReleased) {
2977
+ const n = document.getElementById(o);
2978
+ if (n) {
2979
+ const l = n.getBoundingClientRect();
2980
+ l.top < window.innerHeight && l.bottom > 0 && s.reloadImages();
2981
+ }
2982
+ }
2983
+ });
2984
+ }, document.addEventListener("visibilitychange", this.boundVisibilityHandler);
2985
+ }
2986
+ /**
2987
+ * Disable automatic memory management
2988
+ */
2989
+ disableMemoryManagement() {
2990
+ this.memoryObserver && (this.memoryObserver.disconnect(), this.memoryObserver = null), this.boundVisibilityHandler && (document.removeEventListener("visibilitychange", this.boundVisibilityHandler), this.boundVisibilityHandler = null);
2991
+ }
2700
2992
  }
2701
2993
  export {
2702
- qo as default
2994
+ cn as default
2703
2995
  };
2704
- //# sourceMappingURL=ci360-CILBSFAa.mjs.map
2996
+ //# sourceMappingURL=ci360-CzKohD8_.mjs.map