js-cloudimage-360-view 4.0.0 → 4.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,117 +1,105 @@
1
- import './js-cloudimage-360-view.min.css';var De = Object.defineProperty;
2
- var Ne = (e, t, i) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
- var ee = (e, t, i) => Ne(e, typeof t != "symbol" ? t + "" : t, i);
4
- var Et = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
- function $e(e) {
1
+ import './js-cloudimage-360-view.min.css';var qe = Object.defineProperty;
2
+ var ti = (e, t, i) => t in e ? qe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
3
+ var le = (e, t, i) => ti(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 ei(e) {
6
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
7
  }
8
- var Oe = "Expected a function", ie = NaN, Ve = "[object Symbol]", je = /^\s+|\s+$/g, Fe = /^[-+]0x[0-9a-f]+$/i, Ge = /^0b[01]+$/i, ze = /^0o[0-7]+$/i, Ue = parseInt, Ke = typeof Et == "object" && Et && Et.Object === Object && Et, qe = typeof self == "object" && self && self.Object === Object && self, Je = Ke || qe || Function("return this")(), Qe = Object.prototype, _e = Qe.toString, ti = Math.max, ei = Math.min, kt = function() {
9
- return Je.Date.now();
8
+ var Ze = "Expected a function", ce = NaN, ii = "[object Symbol]", ni = /^\s+|\s+$/g, oi = /^[-+]0x[0-9a-f]+$/i, si = /^0b[01]+$/i, ri = /^0o[0-7]+$/i, ai = parseInt, li = typeof Mt == "object" && Mt && Mt.Object === Object && Mt, ci = typeof self == "object" && self && self.Object === Object && self, hi = li || ci || Function("return this")(), di = Object.prototype, ui = di.toString, pi = Math.max, fi = Math.min, _t = function() {
9
+ return hi.Date.now();
10
10
  };
11
- function ii(e, t, i) {
12
- var n, o, s, a, r, c, l = 0, h = !1, u = !1, f = !0;
11
+ function mi(e, t, i) {
12
+ var n, o, s, l, r, a, c = 0, h = !1, p = !1, f = !0;
13
13
  if (typeof e != "function")
14
- throw new TypeError(Oe);
15
- t = ne(t) || 0, Rt(i) && (h = !!i.leading, u = "maxWait" in i, s = u ? ti(ne(i.maxWait) || 0, t) : s, f = "trailing" in i ? !!i.trailing : f);
16
- function d(m) {
17
- var I = n, E = o;
18
- return n = o = void 0, l = m, a = e.apply(E, I), a;
14
+ throw new TypeError(Ze);
15
+ t = he(t) || 0, Bt(i) && (h = !!i.leading, p = "maxWait" in i, s = p ? pi(he(i.maxWait) || 0, t) : s, f = "trailing" in i ? !!i.trailing : f);
16
+ function u(y) {
17
+ var O = n, S = o;
18
+ return n = o = void 0, c = y, l = e.apply(S, O), l;
19
19
  }
20
- function y(m) {
21
- return l = m, r = setTimeout(x, t), h ? d(m) : a;
20
+ function I(y) {
21
+ return c = y, r = setTimeout(m, t), h ? u(y) : l;
22
22
  }
23
- function g(m) {
24
- var I = m - c, E = m - l, S = t - I;
25
- return u ? ei(S, s - E) : S;
23
+ function g(y) {
24
+ var O = y - a, S = y - c, E = t - O;
25
+ return p ? fi(E, s - S) : E;
26
26
  }
27
- function v(m) {
28
- var I = m - c, E = m - l;
29
- return c === void 0 || I >= t || I < 0 || u && E >= s;
27
+ function v(y) {
28
+ var O = y - a, S = y - c;
29
+ return a === void 0 || O >= t || O < 0 || p && S >= s;
30
30
  }
31
- function x() {
32
- var m = kt();
33
- if (v(m))
34
- return C(m);
35
- r = setTimeout(x, g(m));
36
- }
37
- function C(m) {
38
- return r = void 0, f && n ? d(m) : (n = o = void 0, a);
31
+ function m() {
32
+ var y = _t();
33
+ if (v(y))
34
+ return b(y);
35
+ r = setTimeout(m, g(y));
39
36
  }
40
- function O() {
41
- r !== void 0 && clearTimeout(r), l = 0, n = c = o = r = void 0;
37
+ function b(y) {
38
+ return r = void 0, f && n ? u(y) : (n = o = void 0, l);
42
39
  }
43
- function b() {
44
- return r === void 0 ? a : C(kt());
40
+ function x() {
41
+ r !== void 0 && clearTimeout(r), c = 0, n = a = o = r = void 0;
45
42
  }
46
43
  function w() {
47
- var m = kt(), I = v(m);
48
- if (n = arguments, o = this, c = m, I) {
44
+ return r === void 0 ? l : b(_t());
45
+ }
46
+ function C() {
47
+ var y = _t(), O = v(y);
48
+ if (n = arguments, o = this, a = y, O) {
49
49
  if (r === void 0)
50
- return y(c);
51
- if (u)
52
- return r = setTimeout(x, t), d(c);
50
+ return I(a);
51
+ if (p)
52
+ return r = setTimeout(m, t), u(a);
53
53
  }
54
- return r === void 0 && (r = setTimeout(x, t)), a;
54
+ return r === void 0 && (r = setTimeout(m, t)), l;
55
55
  }
56
- return w.cancel = O, w.flush = b, w;
56
+ return C.cancel = x, C.flush = w, C;
57
57
  }
58
- function ni(e, t, i) {
58
+ function vi(e, t, i) {
59
59
  var n = !0, o = !0;
60
60
  if (typeof e != "function")
61
- throw new TypeError(Oe);
62
- return Rt(i) && (n = "leading" in i ? !!i.leading : n, o = "trailing" in i ? !!i.trailing : o), ii(e, t, {
61
+ throw new TypeError(Ze);
62
+ return Bt(i) && (n = "leading" in i ? !!i.leading : n, o = "trailing" in i ? !!i.trailing : o), mi(e, t, {
63
63
  leading: n,
64
64
  maxWait: t,
65
65
  trailing: o
66
66
  });
67
67
  }
68
- function Rt(e) {
68
+ function Bt(e) {
69
69
  var t = typeof e;
70
70
  return !!e && (t == "object" || t == "function");
71
71
  }
72
- function oi(e) {
72
+ function gi(e) {
73
73
  return !!e && typeof e == "object";
74
74
  }
75
- function si(e) {
76
- return typeof e == "symbol" || oi(e) && _e.call(e) == Ve;
75
+ function yi(e) {
76
+ return typeof e == "symbol" || gi(e) && ui.call(e) == ii;
77
77
  }
78
- function ne(e) {
78
+ function he(e) {
79
79
  if (typeof e == "number")
80
80
  return e;
81
- if (si(e))
82
- return ie;
83
- if (Rt(e)) {
81
+ if (yi(e))
82
+ return ce;
83
+ if (Bt(e)) {
84
84
  var t = typeof e.valueOf == "function" ? e.valueOf() : e;
85
- e = Rt(t) ? t + "" : t;
85
+ e = Bt(t) ? t + "" : t;
86
86
  }
87
87
  if (typeof e != "string")
88
88
  return e === 0 ? e : +e;
89
- e = e.replace(je, "");
90
- var i = Ge.test(e);
91
- return i || ze.test(e) ? Ue(e.slice(2), i ? 2 : 8) : Fe.test(e) ? ie : +e;
89
+ e = e.replace(ni, "");
90
+ var i = si.test(e);
91
+ return i || ri.test(e) ? ai(e.slice(2), i ? 2 : 8) : oi.test(e) ? ce : +e;
92
92
  }
93
- var ri = ni;
94
- const oe = /* @__PURE__ */ $e(ri), T = {
93
+ var bi = vi;
94
+ const de = /* @__PURE__ */ ei(bi), M = {
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
- }, ai = [!1, 0, null, void 0, "false", "0", "null", "undefined"], A = {
99
+ }, wi = [!1, 0, null, void 0, "false", "0", "null", "undefined"], P = {
100
100
  X: "x-axis",
101
- Y: "y-axis",
102
- CENTER: "center"
103
- }, ci = [
104
- "folder",
105
- "folderX",
106
- "folderY",
107
- "filenameX",
108
- "filenameY",
109
- "imageListX",
110
- "imageListY",
111
- "indexZeroBase",
112
- "amountX",
113
- "amountY"
114
- ], li = [37, 39], hi = [38, 40], se = 10, p = {
101
+ Y: "y-axis"
102
+ }, Ii = [37, 39], xi = [38, 40], ue = 10, Ci = 150, pe = 800, Oi = 150, Ei = 200, fe = 50, Si = 50, Ai = 5, me = 5, Li = "https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/360_view.svg", d = {
115
103
  folder: "/",
116
104
  apiVersion: "v7",
117
105
  filenameX: "image-{index}.jpg",
@@ -128,7 +116,7 @@ const oe = /* @__PURE__ */ $e(ri), T = {
128
116
  keys: !1,
129
117
  keysReverse: !1,
130
118
  autoplay: !1,
131
- autoplayBehavior: T.SPIN_X,
119
+ autoplayBehavior: M.SPIN_X,
132
120
  playOnce: !1,
133
121
  autoplayReverse: !1,
134
122
  pointerZoom: 0,
@@ -144,229 +132,457 @@ const oe = /* @__PURE__ */ $e(ri), T = {
144
132
  stopAtEdges: !1,
145
133
  imageInfo: !1,
146
134
  initialIconShown: !0,
147
- hotspots: null
148
- }, di = (e) => ({
149
- folder: R(e, "folder", p.folder),
150
- apiVersion: R(e, "api-version", p.apiVersion),
151
- filenameX: R(e, "filename") || R(e, "filename-x") || p.filenameX,
152
- filenameY: R(e, "filename-y", p.filenameY),
153
- imageListX: R(e, "image-list-x", p.imageListX),
154
- imageListY: R(e, "image-list-y", p.imageListY),
155
- indexZeroBase: parseInt(R(e, "index-zero-base", p.indexZeroBase), 10),
156
- amountX: parseInt(R(e, "amount-x", p.amountX), 10),
157
- amountY: parseInt(R(e, "amount-y", p.amountY), 10),
158
- speed: parseInt(R(e, "speed", p.speed), 10),
159
- dragSpeed: parseInt(R(e, "drag-speed", p.dragSpeed), 10),
160
- draggable: B(e, "draggable", p.draggable),
161
- swipeable: B(e, "swipeable", p.swipeable),
162
- keys: B(e, "keys", p.keys),
163
- keysReverse: B(e, "keys-reverse", p.keysReverse),
164
- autoplay: B(e, "autoplay", p.autoplay),
165
- autoplayBehavior: R(e, "autoplay-behavior", p.autoplayBehavior),
166
- playOnce: B(e, "play-once", p.playOnce),
167
- autoplayReverse: B(e, "autoplay-reverse", p.autoplayReverse),
168
- pointerZoom: parseFloat(R(e, "pointer-zoom", p.pointerZoom), 10),
169
- fullscreen: B(e, "fullscreen") || B(e, "full-screen", p.fullscreen),
170
- magnifier: parseFloat(R(e, "magnifier", p.magnifier), 10),
135
+ hotspots: null,
136
+ hide360Logo: !1,
137
+ logoSrc: Li,
138
+ inertia: !1,
139
+ pinchZoom: !0,
140
+ hints: !0,
141
+ theme: null,
142
+ hotspotTimelineOnClick: !0,
143
+ // Event callbacks
144
+ onReady: null,
145
+ onLoad: null,
146
+ onSpin: null,
147
+ onAutoplayStart: null,
148
+ onAutoplayStop: null,
149
+ onFullscreenOpen: null,
150
+ onFullscreenClose: null,
151
+ onZoomIn: null,
152
+ onZoomOut: null,
153
+ onDragStart: null,
154
+ onDragEnd: null
155
+ }, ki = (e) => ({
156
+ folder: k(e, "folder", d.folder),
157
+ apiVersion: k(e, "api-version", d.apiVersion),
158
+ filenameX: k(e, "filename") || k(e, "filename-x") || d.filenameX,
159
+ filenameY: k(e, "filename-y", d.filenameY),
160
+ imageListX: k(e, "image-list-x", d.imageListX),
161
+ imageListY: k(e, "image-list-y", d.imageListY),
162
+ indexZeroBase: parseInt(k(e, "index-zero-base", d.indexZeroBase), 10),
163
+ amountX: parseInt(k(e, "amount-x", d.amountX), 10),
164
+ amountY: parseInt(k(e, "amount-y", d.amountY), 10),
165
+ speed: parseInt(k(e, "speed", d.speed), 10),
166
+ dragSpeed: parseInt(k(e, "drag-speed", d.dragSpeed), 10),
167
+ draggable: X(e, "draggable", d.draggable),
168
+ swipeable: X(e, "swipeable", d.swipeable),
169
+ keys: X(e, "keys", d.keys),
170
+ keysReverse: X(e, "keys-reverse", d.keysReverse),
171
+ autoplay: X(e, "autoplay", d.autoplay),
172
+ autoplayBehavior: k(e, "autoplay-behavior", d.autoplayBehavior),
173
+ playOnce: X(e, "play-once", d.playOnce),
174
+ autoplayReverse: X(e, "autoplay-reverse", d.autoplayReverse),
175
+ pointerZoom: parseFloat(k(e, "pointer-zoom", d.pointerZoom)),
176
+ fullscreen: X(e, "fullscreen") || X(e, "full-screen", d.fullscreen),
177
+ magnifier: parseFloat(k(e, "magnifier", d.magnifier)),
171
178
  bottomCircleOffset: parseInt(
172
- R(e, "bottom-circle-offset", p.bottomCircleOffset),
179
+ k(e, "bottom-circle-offset", d.bottomCircleOffset),
173
180
  10
174
181
  ),
175
- ciToken: R(e, "responsive", p.ciToken),
176
- ciFilters: R(e, "filters", p.ciFilters),
177
- ciTransformation: R(e, "transformation", p.ciTransformation),
178
- lazyload: B(e, "lazyload", p.lazyload),
179
- dragReverse: B(e, "drag-reverse", p.dragReverse),
180
- stopAtEdges: B(e, "stop-at-edges", p.stopAtEdges),
181
- imageInfo: B(e, "info", p.imageInfo),
182
- initialIconShown: !re(e, "initial-icon"),
183
- bottomCircle: !re(e, "bottom-circle")
184
- }), ui = (e) => ({
185
- folder: e.folder || p.folder,
186
- apiVersion: e.apiVersion || p.apiVersion,
187
- filenameX: e.filenameX || e.filename || p.filenameX,
188
- filenameY: e.filenameY || p.filenameY,
189
- imageListX: e.imageListX || p.imageListX,
190
- imageListY: e.imageListY || p.imageListY,
191
- indexZeroBase: parseInt(e.indexZeroBase ?? p.indexZeroBase, 10),
192
- amountX: parseInt(e.amountX ?? p.amountX, 10),
193
- amountY: parseInt(e.amountY ?? p.amountY, 10),
194
- speed: parseInt(e.speed ?? p.speed, 10),
195
- draggable: e.draggable ?? p.draggable,
196
- swipeable: e.swipeable ?? p.swipeable,
197
- dragSpeed: parseInt(e.dragSpeed ?? p.dragSpeed, 10),
198
- keys: e.keys ?? p.keys,
199
- keysReverse: e.keysReverse ?? p.keysReverse,
200
- autoplay: e.autoplay ?? p.autoplay,
201
- autoplayBehavior: e.autoplayBehavior || p.autoplayBehavior,
202
- playOnce: e.playOnce ?? p.playOnce,
203
- autoplayReverse: e.autoplayReverse ?? p.autoplayReverse,
204
- pointerZoom: parseFloat(e.pointerZoom ?? p.pointerZoom, 10),
205
- fullscreen: e.fullscreen ?? p.fullscreen,
206
- magnifier: parseFloat(e.magnifier ?? p.magnifier, 10),
207
- bottomCircleOffset: parseInt(e.bottomCircleOffset ?? p.bottomCircleOffset, 10),
208
- ciToken: e.ciToken || p.ciToken,
209
- ciFilters: e.ciFilters || p.ciFilters,
210
- ciTransformation: e.ciTransformation || p.ciTransformation,
211
- lazyload: e.lazyload ?? p.lazyload,
212
- dragReverse: e.dragReverse ?? p.dragReverse,
213
- stopAtEdges: e.stopAtEdges ?? p.stopAtEdges,
214
- imageInfo: e.imageInfo ?? p.imageInfo,
215
- initialIconShown: e.initialIconShown ?? p.initialIconShown,
216
- bottomCircle: e.bottomCircle ?? p.bottomCircle,
217
- hotspots: e.hotspots ?? p.hotspots
218
- }), R = (e, t, i) => e.getAttribute(t) || e.getAttribute(`data-${t}`) || i, B = (e, t, i) => e.hasAttribute(t) || e.hasAttribute(`data-${t}`) || i, re = (e, t) => R(e, t, null) === "false", pi = (e, t, i = ci) => i.some((n) => n in t && t[n] !== e[n]), fi = (e = 1) => {
182
+ ciToken: k(e, "responsive", d.ciToken),
183
+ ciFilters: k(e, "filters", d.ciFilters),
184
+ ciTransformation: k(e, "transformation", d.ciTransformation),
185
+ lazyload: X(e, "lazyload", d.lazyload),
186
+ dragReverse: X(e, "drag-reverse", d.dragReverse),
187
+ stopAtEdges: X(e, "stop-at-edges", d.stopAtEdges),
188
+ imageInfo: X(e, "info", d.imageInfo),
189
+ initialIconShown: !Ht(e, "initial-icon"),
190
+ bottomCircle: !Ht(e, "bottom-circle"),
191
+ hide360Logo: X(e, "hide-360-logo", d.hide360Logo),
192
+ logoSrc: k(e, "logo-src", d.logoSrc),
193
+ inertia: X(e, "inertia", d.inertia),
194
+ pinchZoom: X(e, "pinch-zoom", d.pinchZoom),
195
+ hints: !Ht(e, "hints"),
196
+ theme: k(e, "theme", d.theme),
197
+ hotspotTimelineOnClick: !Ht(e, "hotspot-timeline-on-click")
198
+ }), Ti = (e) => {
199
+ const t = [];
200
+ 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)");
201
+ const i = ["spin-x", "spin-y", "spin-xy", "spin-yx"];
202
+ return e.autoplayBehavior && !i.includes(e.autoplayBehavior) && t.push(`autoplayBehavior should be one of: ${i.join(", ")}`), t.forEach((n) => {
203
+ console.warn(`CloudImage 360: ${n}`);
204
+ }), t.length === 0;
205
+ }, Yi = (e) => (Ti(e), {
206
+ folder: e.folder || d.folder,
207
+ apiVersion: e.apiVersion || d.apiVersion,
208
+ filenameX: e.filenameX || e.filename || d.filenameX,
209
+ filenameY: e.filenameY || d.filenameY,
210
+ imageListX: e.imageListX || d.imageListX,
211
+ imageListY: e.imageListY || d.imageListY,
212
+ indexZeroBase: parseInt(e.indexZeroBase ?? d.indexZeroBase, 10),
213
+ amountX: parseInt(e.amountX ?? d.amountX, 10),
214
+ amountY: parseInt(e.amountY ?? d.amountY, 10),
215
+ speed: parseInt(e.speed ?? d.speed, 10),
216
+ draggable: e.draggable ?? d.draggable,
217
+ swipeable: e.swipeable ?? d.swipeable,
218
+ dragSpeed: parseInt(e.dragSpeed ?? d.dragSpeed, 10),
219
+ keys: e.keys ?? d.keys,
220
+ keysReverse: e.keysReverse ?? d.keysReverse,
221
+ autoplay: e.autoplay ?? d.autoplay,
222
+ autoplayBehavior: e.autoplayBehavior || d.autoplayBehavior,
223
+ playOnce: e.playOnce ?? d.playOnce,
224
+ autoplayReverse: e.autoplayReverse ?? d.autoplayReverse,
225
+ pointerZoom: parseFloat(e.pointerZoom ?? d.pointerZoom),
226
+ fullscreen: e.fullscreen ?? d.fullscreen,
227
+ magnifier: parseFloat(e.magnifier ?? d.magnifier),
228
+ bottomCircleOffset: parseInt(e.bottomCircleOffset ?? d.bottomCircleOffset, 10),
229
+ ciToken: e.ciToken || d.ciToken,
230
+ ciFilters: e.ciFilters || d.ciFilters,
231
+ ciTransformation: e.ciTransformation || d.ciTransformation,
232
+ lazyload: e.lazyload ?? d.lazyload,
233
+ dragReverse: e.dragReverse ?? d.dragReverse,
234
+ stopAtEdges: e.stopAtEdges ?? d.stopAtEdges,
235
+ imageInfo: e.imageInfo ?? d.imageInfo,
236
+ initialIconShown: e.initialIconShown ?? d.initialIconShown,
237
+ bottomCircle: e.bottomCircle ?? d.bottomCircle,
238
+ hotspots: e.hotspots ?? d.hotspots,
239
+ hide360Logo: e.hide360Logo ?? d.hide360Logo,
240
+ logoSrc: e.logoSrc || d.logoSrc,
241
+ inertia: e.inertia ?? d.inertia,
242
+ pinchZoom: e.pinchZoom ?? d.pinchZoom,
243
+ hints: e.hints ?? d.hints,
244
+ theme: e.theme || d.theme,
245
+ hotspotTimelineOnClick: e.hotspotTimelineOnClick ?? d.hotspotTimelineOnClick,
246
+ // Event callbacks
247
+ onReady: e.onReady ?? d.onReady,
248
+ onLoad: e.onLoad ?? d.onLoad,
249
+ onSpin: e.onSpin ?? d.onSpin,
250
+ onAutoplayStart: e.onAutoplayStart ?? d.onAutoplayStart,
251
+ onAutoplayStop: e.onAutoplayStop ?? d.onAutoplayStop,
252
+ onFullscreenOpen: e.onFullscreenOpen ?? d.onFullscreenOpen,
253
+ onFullscreenClose: e.onFullscreenClose ?? d.onFullscreenClose,
254
+ onZoomIn: e.onZoomIn ?? d.onZoomIn,
255
+ onZoomOut: e.onZoomOut ?? d.onZoomOut,
256
+ onDragStart: e.onDragStart ?? d.onDragStart,
257
+ onDragEnd: e.onDragEnd ?? d.onDragEnd
258
+ }), k = (e, t, i) => e.getAttribute(t) || e.getAttribute(`data-${t}`) || i, X = (e, t, i) => {
259
+ if (!(e.hasAttribute(t) || e.hasAttribute(`data-${t}`))) return i;
260
+ const o = k(e, t, null);
261
+ return o !== "false" && o !== "0";
262
+ }, Ht = (e, t) => k(e, t, null) === "false", Xi = (e = 1) => {
219
263
  const t = Math.round(window.devicePixelRatio || 1);
220
264
  return parseInt(e) * t;
221
- }, mi = (e, t, i) => new URL(e).origin.includes("cloudimg") ? e : `https://${t}.cloudimg.io/${i}${e}`, vi = ({ ciTransformation: e, responsiveWidth: t, ciFilters: i }) => {
265
+ }, Pi = (e, t, i) => new URL(e).origin.includes("cloudimg") ? e : `https://${t}.cloudimg.io/${i}${e}`, Ri = ({ ciTransformation: e, responsiveWidth: t, ciFilters: i }) => {
222
266
  const n = `width=${t}`, o = e || n, s = i ? `&f=${i}` : "";
223
267
  return `${o}${s}`;
224
- }, gt = (e, t) => {
225
- const { folder: i, apiVersion: n, filename: o = "", ciParams: s } = e, { ciToken: a, ciFilters: r, ciTransformation: c } = s || {}, l = `${i}${o}`;
226
- if (!a) return l;
227
- const h = ai.includes(n) ? null : n, u = h ? `${h}/` : "", f = fi(t), d = mi(l, a, u), y = vi({
228
- ciTransformation: c,
268
+ }, Ot = (e, t) => {
269
+ const { folder: i, apiVersion: n, filename: o = "", ciParams: s } = e, { ciToken: l, ciFilters: r, ciTransformation: a } = s || {}, c = `${i}${o}`;
270
+ if (!l) return c;
271
+ const h = wi.includes(n) ? null : n, p = h ? `${h}/` : "", f = Xi(t), u = Pi(c, l, p), I = Ri({
272
+ ciTransformation: a,
229
273
  responsiveWidth: f,
230
274
  ciFilters: r
231
275
  });
232
- return `${d}${y ? "?" : ""}${y}`;
233
- }, gi = (e, t, i) => {
276
+ return `${u}${I ? "?" : ""}${I}`;
277
+ }, Mi = (e, t, i) => {
234
278
  const [n, o] = e.split("?"), s = `${t}=${encodeURIComponent(i)}`;
235
279
  if (!o)
236
280
  return `${n}?${s}`;
237
- const a = new URLSearchParams(o);
238
- return a.set(t, i), `${n}?${a.toString()}`;
239
- }, yi = (e, t) => gi(e, "width", t), Ee = (e, t = 0) => (e += "", e.length >= t ? e : new Array(t - e.length + 1).join("0") + e), bi = (e, { amount: t = 0, indexZeroBase: i = 0 } = {}) => Array.from({ length: t }, (n, o) => e.replace("{index}", Ee(o + 1, i))), wi = ({
281
+ const l = new URLSearchParams(o);
282
+ return l.set(t, i), `${n}?${l.toString()}`;
283
+ }, Hi = (e, t) => Mi(e, "width", t), Be = (e, t = 0) => (e += "", e.length >= t ? e : new Array(t - e.length + 1).join("0") + e), Di = (e, { amount: t = 0, indexZeroBase: i = 0 } = {}) => Array.from({ length: t }, (n, o) => e.replace("{index}", Be(o + 1, i))), Zi = ({
240
284
  imagesUrls: e,
241
285
  onFirstImageLoad: t,
242
286
  onImageLoad: i,
243
287
  onAllImagesLoad: n,
244
- autoplayReverse: o
288
+ onError: o,
289
+ autoplayReverse: s
245
290
  }) => {
246
- let s = 0;
247
- const a = e.length, r = [], c = (u, f) => {
248
- const d = new Image();
249
- d.crossOrigin = "anonymous", d.src = u, d.onload = async () => {
250
- const y = await createImageBitmap(d), g = {
251
- src: u,
252
- bitmapImage: y,
253
- naturalWidth: l.naturalWidth,
254
- naturalHeight: l.naturalHeight
255
- };
256
- s++, r[f] = g, i == null || i(g, f), s === a && (n == null || n(r));
257
- }, d.onerror = () => {
258
- console.error(`Failed to load image: ${u}`), s++, s === a && (n == null || n(r));
291
+ let l = 0, r = 0;
292
+ const a = e.length, c = [], h = [], p = (m, b, x = !1) => {
293
+ const w = {
294
+ message: `Failed to load image: ${m}`,
295
+ url: m,
296
+ index: b,
297
+ isFirstImage: x
259
298
  };
260
- }, l = new Image(), h = e[o ? e.length - 1 : 0];
261
- l.crossOrigin = "anonymous", l.src = h, l.onload = async () => {
262
- const u = await createImageBitmap(l), f = {
263
- src: h,
264
- bitmapImage: u,
265
- naturalWidth: l.naturalWidth,
266
- naturalHeight: l.naturalHeight
299
+ h.push(w), r++, o == null || o({
300
+ error: w,
301
+ errorCount: r,
302
+ totalImages: a,
303
+ errors: h
304
+ });
305
+ }, f = () => {
306
+ l === a && (n == null || n(c, { errorCount: r, errors: h }));
307
+ }, u = (m, b) => {
308
+ const x = new Image();
309
+ x.crossOrigin = "anonymous", x.src = m, x.onload = async () => {
310
+ try {
311
+ const w = await createImageBitmap(x), C = {
312
+ src: m,
313
+ bitmapImage: w,
314
+ naturalWidth: x.naturalWidth,
315
+ naturalHeight: x.naturalHeight
316
+ };
317
+ l++, c[b] = C, i == null || i(C, b), f();
318
+ } catch {
319
+ l++, p(m, b), f();
320
+ }
321
+ }, x.onerror = () => {
322
+ l++, p(m, b), f();
267
323
  };
268
- r[0] = f, s++, t == null || t(f), i == null || i(f, 0);
269
- for (let d = 1; d < e.length; d++)
270
- c(e[d], d);
271
- }, l.onerror = () => {
272
- console.error(`Failed to load first image: ${e[0]}`), s++;
273
- for (let u = 1; u < e.length; u++)
274
- c(e[u], u);
324
+ }, I = new Image(), g = s ? e.length - 1 : 0, v = e[g];
325
+ I.crossOrigin = "anonymous", I.src = v, I.onload = async () => {
326
+ try {
327
+ const m = await createImageBitmap(I), b = {
328
+ src: v,
329
+ bitmapImage: m,
330
+ naturalWidth: I.naturalWidth,
331
+ naturalHeight: I.naturalHeight
332
+ };
333
+ c[g] = b, l++, t == null || t(b), i == null || i(b, g);
334
+ for (let x = 0; x < e.length; x++)
335
+ x !== g && u(e[x], x);
336
+ f();
337
+ } catch {
338
+ l++, p(v, g, !0);
339
+ for (let b = 0; b < e.length; b++)
340
+ b !== g && u(e[b], b);
341
+ f();
342
+ }
343
+ }, I.onerror = () => {
344
+ l++, p(v, g, !0);
345
+ for (let m = 0; m < e.length; m++)
346
+ m !== g && u(e[m], m);
347
+ f();
275
348
  };
276
- }, ae = ({
349
+ }, ve = ({
277
350
  cdnPathX: e,
278
351
  cdnPathY: t,
279
352
  configX: i,
280
353
  configY: n,
281
354
  onFirstImageLoad: o,
282
355
  onImageLoad: s,
283
- onAllImagesLoad: a
356
+ onAllImagesLoad: l,
357
+ onError: r
284
358
  }) => {
285
- let r = { x: !1, y: !1 }, c = [], l = [];
286
- const h = e || i.imageList.length, u = t || n.imageList.length, f = () => {
287
- r.x && r.y && a(c, l);
288
- }, d = ({ cdnPath: y, config: g, orientation: v, loadedImages: x, onFirstImageLoad: C }) => {
289
- const O = v === A.X, b = g.imageList.length ? g.imageList : bi(y, g);
290
- wi({
291
- imagesUrls: b,
292
- onFirstImageLoad: C,
293
- onImageLoad: (w, m) => {
294
- s == null || s(w, m, v), x[m] = w;
359
+ let a = { x: !1, y: !1 }, c = [], h = [], p = { errorCount: 0, errors: [] }, f = { errorCount: 0, errors: [] };
360
+ const u = e || i.imageList.length, I = t || n.imageList.length, g = () => {
361
+ if (a.x && a.y) {
362
+ const m = {
363
+ errorCount: p.errorCount + f.errorCount,
364
+ errors: [...p.errors, ...f.errors]
365
+ };
366
+ l == null || l(c, h, m);
367
+ }
368
+ }, v = ({ cdnPath: m, config: b, orientation: x, loadedImages: w, loadStats: C, onFirstImageLoad: y }) => {
369
+ const O = x === P.X, S = b.imageList.length ? b.imageList : Di(m, b);
370
+ Zi({
371
+ imagesUrls: S,
372
+ onFirstImageLoad: y,
373
+ onImageLoad: (E, A) => {
374
+ s == null || s(E, A, x), w[A] = E;
375
+ },
376
+ onError: (E) => {
377
+ r == null || r({ ...E, orientation: x });
295
378
  },
296
- onAllImagesLoad: (w) => {
297
- x = w, r[O ? "x" : "y"] = !0, f();
379
+ onAllImagesLoad: (E, A) => {
380
+ w.length = 0, E.forEach((L, R) => {
381
+ L && (w[R] = L);
382
+ }), C.errorCount = A.errorCount, C.errors = A.errors.map((L) => ({ ...L, orientation: x })), a[O ? "x" : "y"] = !0, g();
298
383
  },
299
- autoplayReverse: g.autoplayReverse
384
+ autoplayReverse: b.autoplayReverse
300
385
  });
301
386
  };
302
- h ? d({
387
+ u ? v({
303
388
  cdnPath: e,
304
389
  config: i,
305
- orientation: A.X,
390
+ orientation: P.X,
306
391
  loadedImages: c,
392
+ loadStats: p,
307
393
  onFirstImageLoad: o
308
- }) : r.x = !0, u ? d({
394
+ }) : a.x = !0, I ? v({
309
395
  cdnPath: t,
310
396
  config: n,
311
- orientation: A.Y,
312
- loadedImages: l,
313
- onFirstImageLoad: h ? void 0 : o
314
- }) : r.y = !0;
315
- }, xi = (e) => {
316
- const t = new Image();
317
- return t.src = "https://scaleflex.cloudimg.io/v7/plugins/js-cloudimage-360-view/assets/img/360.svg", t.style.bottom = `${e}%`, t.className = "cloudimage-360-view-360-circle", t;
318
- }, Ii = () => {
319
- const e = document.createElement("div");
320
- return e.className = "cloudimage-initial-icon", e.innerText = "360°", e;
321
- }, Ci = (e, t) => {
397
+ orientation: P.Y,
398
+ loadedImages: h,
399
+ loadStats: f,
400
+ onFirstImageLoad: u ? void 0 : o
401
+ }) : a.y = !0, !u && !I && g();
402
+ }, Bi = `
403
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1052 156" aria-hidden="true">
404
+ <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"/>
405
+ <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"/>
406
+ <g transform="translate(415, 136)">
407
+ <path fill="currentColor" d="M18.1,11.2c-1.8,0-2.8-1.2-2.8-3V8c0.8-0.4,1.7-0.6,2.8-0.6c1.5,0,2.5,0.6,2.5,1.7C20.6,10.2,19.8,11.2,18.1,11.2L18.1,11.2z M18.3,5.7c-1.1,0-2,0.3-2.8,0.7c0.3-1.6,1.5-2.6,3.7-2.6c1.1,0,2.3,0.3,3.1,0.5V2.6c-0.8-0.3-1.9-0.5-3.1-0.5c-4.2,0-6.2,2.1-6.2,5.8c0,3.2,1.8,4.9,5.1,4.9c3.3,0,5-1.7,5-3.6C23,7,21.3,5.7,18.3,5.7L18.3,5.7z"/>
408
+ <path fill="currentColor" d="M39.3,1.8c0.9,0,1.6,0.7,1.6,1.5c0,0.8-0.7,1.6-1.6,1.6c-0.8,0-1.6-0.7-1.6-1.6C37.8,2.5,38.5,1.8,39.3,1.8L39.3,1.8z M39.3,6.3c1.7,0,3.1-1.3,3.1-3c0-1.6-1.4-3-3.1-3c-1.7,0-3.1,1.3-3.1,3C36.2,5,37.6,6.3,39.3,6.3L39.3,6.3z"/>
409
+ <path fill="currentColor" d="M30.3,3.8c2.1,0,2.9,1.4,2.9,3.6c0,2.2-0.8,3.6-2.9,3.6c-2.1,0-2.9-1.5-2.9-3.6C27.4,5.3,28.1,3.8,30.3,3.8L30.3,3.8z M30.2,12.8c3.9,0,5.2-2.6,5.2-5.4c0-2.8-1.3-5.3-5.2-5.3c-3.9,0-5.3,2.6-5.3,5.4C25,10.3,26.3,12.8,30.2,12.8L30.2,12.8z"/>
410
+ <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"/>
411
+ </g>
412
+ </svg>
413
+ `, Wi = (e) => {
414
+ const t = document.createElement("div");
415
+ return t.innerHTML = Bi, t.style.bottom = `${e}%`, t.className = "cloudimage-360-view-360-circle", t;
416
+ }, Fi = `
417
+ <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">
418
+ <!-- Circular arrows -->
419
+ <path d="M 75 50 A 25 25 0 1 1 50 25" stroke="currentColor" stroke-width="3"/>
420
+ <path d="M 25 50 A 25 25 0 1 1 50 75" stroke="currentColor" stroke-width="3"/>
421
+ <!-- Arrow heads -->
422
+ <path d="M 50 25 L 56 31 M 50 25 L 56 19" stroke="currentColor" stroke-width="3"/>
423
+ <path d="M 50 75 L 44 69 M 50 75 L 44 81" stroke="currentColor" stroke-width="3"/>
424
+ <!-- 360 text -->
425
+ <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>
426
+ </svg>
427
+ `, Ni = (e) => {
428
+ const t = document.createElement("div");
429
+ 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 = Fi, t;
430
+ }, Vi = (e, t) => {
322
431
  const { width: i, height: n } = t, o = document.createElement("canvas");
323
432
  return o.width = i, o.height = n, o.style.width = "100%", o.style.height = "auto", e.appendChild(o), o;
324
- }, Oi = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='m147-96-51-51%20261-261H192v-72h288v288h-72v-165L147-96Zm333-384v-288h72v165l261-261%2051%2051-261%20261h165v72H480Z'/%3e%3c/svg%3e", Ei = () => {
325
- const e = document.createElement("div");
326
- return e.className = "cloudimage-360-button cloudimage-360-close-icon", e.innerHTML = `<img alt="close icon" src=${Oi}>`, e;
327
- }, Si = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='M144-144v-192h72v120h120v72H144Zm480%200v-72h120v-120h72v192H624ZM144-624v-192h192v72H216v120h-72Zm600%200v-120H624v-72h192v192h-72Z'/%3e%3c/svg%3e", Yi = () => {
328
- const e = document.createElement("div");
329
- return e.className = "cloudimage-360-button cloudimage-360-fullscreen-button", e.innerHTML = `<img alt="fullscreen icon" src=${Si}>`, e;
330
- }, ce = (e) => {
433
+ }, ji = () => {
434
+ const e = document.createElement("button");
435
+ 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;
436
+ }, $i = () => {
437
+ const e = document.createElement("button");
438
+ 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;
439
+ }, ge = (e) => {
331
440
  const t = document.createElement("div");
332
441
  return t.className = "cloudimage-360-icons-container", e.appendChild(t), t;
333
- }, Ri = (e) => {
442
+ }, Gi = (e) => {
334
443
  const t = document.createElement("div");
335
- return t.className = "cloudimage-360-inner-box", e.appendChild(t), t;
336
- }, Xi = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='20px'%20viewBox='0%20-960%20960%20960'%20width='20px'%20fill='%235f6368'%3e%3cpath%20d='M765-144%20526-383q-30%2022-65.79%2034.5-35.79%2012.5-76.18%2012.5Q284-336%20214-406t-70-170q0-100%2070-170t170-70q100%200%20170%2070t70%20170.03q0%2040.39-12.5%2076.18Q599-464%20577-434l239%20239-51%2051ZM384-408q70%200%20119-49t49-119q0-70-49-119t-119-49q-70%200-119%2049t-49%20119q0%2070%2049%20119t119%2049Z'/%3e%3c/svg%3e", Li = () => {
337
- const e = document.createElement("div");
338
- return e.className = "cloudimage-360-button cloudimage-360-magnifier-button", e.innerHTML = `<img alt="magnifier icon" src=${Xi}>`, e;
339
- }, Pi = (e) => {
444
+ 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;
445
+ }, zi = () => {
446
+ const e = document.createElement("button");
447
+ 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;
448
+ }, Ui = (e) => {
340
449
  const t = document.createElement("div");
341
450
  t.className = "cloudimage-initial-icon";
342
451
  const i = document.createElement("span");
343
452
  return i.className = "percentage", i.innerText = "0%", t.appendChild(i), e.appendChild(t), t;
344
- }, Ti = (e) => {
453
+ }, _i = (e) => {
345
454
  const t = document.createElement("div");
346
455
  t.className = "cloudimage-360-fullscreen-modal";
347
456
  const i = e.cloneNode();
348
- return i.style.height = "100vh", i.style.maxHeight = "100%", t.appendChild(i), window.document.body.appendChild(t), i;
349
- }, Wt = (e, t) => {
457
+ 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;
458
+ }, Jt = (e, t) => {
350
459
  const i = e.querySelector(t);
351
460
  i && i.parentNode.removeChild(i);
352
- }, Ai = () => {
461
+ }, Ki = () => {
353
462
  const e = document.createElement("div");
354
463
  return e.className = "cloudimage-loading-spinner", e;
355
- }, ki = () => {
464
+ }, Ji = () => {
356
465
  const e = document.createElement("div");
357
466
  return e.className = "cloudimage-360-transition-overlay", e;
358
- }, Mi = (e) => {
467
+ }, Qi = (e) => {
359
468
  const t = document.createElement("div");
360
469
  return t.className = "cloudimage-360-hotspot-container", e.appendChild(t), t;
361
- }, Wi = (e, t) => {
470
+ }, qi = (e) => {
471
+ const t = document.createElement("div");
472
+ 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;
473
+ }, tn = (e, t) => {
474
+ e && (e.textContent = "", setTimeout(() => {
475
+ e.textContent = t;
476
+ }, 50));
477
+ }, We = {
478
+ 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>',
479
+ 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>',
480
+ 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>',
481
+ 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>',
482
+ 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>',
483
+ 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>'
484
+ }, en = {
485
+ drag: "Drag to rotate",
486
+ swipe: "Swipe to rotate",
487
+ click: "Click to zoom",
488
+ pinch: "Pinch to zoom",
489
+ keys: "Use arrow keys",
490
+ fullscreen: "Click for fullscreen"
491
+ }, nn = (e) => {
492
+ const t = document.createElement("div");
493
+ return t.className = "cloudimage-360-hint-item", t.innerHTML = `
494
+ ${We[e]}
495
+ <span>${en[e]}</span>
496
+ `, t;
497
+ }, ye = (e, t = []) => {
498
+ if (!t || t.length === 0) return null;
499
+ const i = document.createElement("div");
500
+ i.className = "cloudimage-360-hints-overlay", i.setAttribute("role", "tooltip"), i.setAttribute("aria-label", "Interaction hints");
501
+ const n = document.createElement("div");
502
+ return n.className = "cloudimage-360-hints-container", t.forEach((o) => {
503
+ We[o] && n.appendChild(nn(o));
504
+ }), i.appendChild(n), e.appendChild(i), i;
505
+ }, be = (e, t) => t ? ["swipe"] : ["drag", "click"], we = (e) => {
506
+ e && e.classList.add("visible");
507
+ }, on = (e) => {
508
+ e && (e.classList.remove("visible"), e.classList.add("hiding"), setTimeout(() => {
509
+ e.classList.remove("hiding");
510
+ }, 300));
511
+ }, sn = (e) => {
512
+ if (!e || typeof e != "object") return null;
513
+ const t = Object.keys(e).map((n) => parseInt(n, 10)).filter((n) => !isNaN(n)).sort((n, o) => n - o);
514
+ if (t.length === 0) return null;
515
+ const i = Math.floor(t.length / 2);
516
+ return t[i];
517
+ }, rn = (e) => {
518
+ const t = [];
519
+ return !e || !Array.isArray(e) || e.forEach((i, n) => {
520
+ const o = sn(i.positions);
521
+ o !== null && t.push({
522
+ id: i.id || `hotspot-${n}`,
523
+ frame: o,
524
+ label: i.label || null
525
+ });
526
+ }), t;
527
+ }, an = 400, ln = (e, t, i, n) => {
528
+ const o = document.createElement("button");
529
+ o.className = "cloudimage-360-hotspot-timeline-dot", o.setAttribute("type", "button"), o.setAttribute("aria-label", n || `Go to hotspot at frame ${t + 1}`), o.setAttribute("data-frame", t.toString()), o.setAttribute("data-hotspot-id", e);
530
+ const s = i > 1 ? t / (i - 1) * 100 : 0;
531
+ if (o.style.left = `${s}%`, n) {
532
+ const l = document.createElement("span");
533
+ l.className = "cloudimage-360-hotspot-timeline-tooltip", l.textContent = n, o.appendChild(l);
534
+ let r = null;
535
+ o.addEventListener("mouseenter", () => {
536
+ r = setTimeout(() => {
537
+ l.classList.add("visible");
538
+ }, an);
539
+ }), o.addEventListener("mouseleave", () => {
540
+ r && (clearTimeout(r), r = null), l.classList.remove("visible");
541
+ }), o.addEventListener("click", () => {
542
+ r && (clearTimeout(r), r = null), l.classList.remove("visible");
543
+ });
544
+ }
545
+ return o;
546
+ }, cn = (e, t, i) => {
547
+ const n = rn(i);
548
+ if (n.length === 0) return null;
549
+ const o = document.createElement("div");
550
+ o.className = "cloudimage-360-hotspot-timeline", o.setAttribute("role", "navigation"), o.setAttribute("aria-label", "Hotspot timeline navigation");
551
+ const s = document.createElement("div");
552
+ s.className = "cloudimage-360-hotspot-timeline-track";
553
+ const l = document.createElement("div");
554
+ return l.className = "cloudimage-360-hotspot-timeline-indicator", n.forEach(({ id: r, frame: a, label: c }) => {
555
+ const h = ln(r, a, t, c);
556
+ s.appendChild(h);
557
+ }), s.appendChild(l), o.appendChild(s), e.appendChild(o), {
558
+ element: o,
559
+ indicator: l,
560
+ hotspotFrames: n
561
+ };
562
+ }, hn = (e, t, i) => {
563
+ if (!e) return;
564
+ const n = i > 1 ? t / (i - 1) * 100 : 0;
565
+ e.style.left = `${n}%`;
566
+ }, dn = (e) => {
567
+ e && e.classList.add("visible");
568
+ }, un = (e) => {
569
+ e && e.classList.remove("visible");
570
+ }, Qt = (e, t = []) => {
571
+ if (!e) return t;
572
+ try {
573
+ return JSON.parse(e);
574
+ } catch (i) {
575
+ return console.warn("CloudImage 360: Failed to parse JSON:", i.message), t;
576
+ }
577
+ }, pn = (e, t) => {
362
578
  const [i, n] = e.split("?");
363
579
  if (!n) return e;
364
- const o = new RegExp(`^${t}=|&${t}=`), s = n.split("&").filter((a) => !o.test(a)).join("&");
580
+ const o = new RegExp(`^${t}=|&${t}=`), s = n.split("&").filter((l) => !o.test(l)).join("&");
365
581
  return s ? `${i}?${s}` : i;
366
- }, Hi = (e) => {
367
- const t = Wi(e, "width"), i = t.includes("?") ? "&" : "?";
582
+ }, fn = (e) => {
583
+ const t = pn(e, "width"), i = t.includes("?") ? "&" : "?";
368
584
  return `${t}${i}width=${150 * devicePixelRatio}`;
369
- }, Bi = (e) => {
585
+ }, mn = (e) => {
370
586
  const t = {
371
587
  root: null,
372
588
  rootMargin: "0px",
@@ -376,31 +592,29 @@ const oe = /* @__PURE__ */ $e(ri), T = {
376
592
  s && (o.src = s);
377
593
  };
378
594
  new IntersectionObserver((o, s) => {
379
- o.forEach((a) => {
380
- a.isIntersecting && (i(a.target), s.unobserve(a.target));
595
+ o.forEach((l) => {
596
+ l.isIntersecting && (i(l.target), s.unobserve(l.target));
381
597
  });
382
598
  }, t).observe(e);
383
- }, Zi = (e, t) => {
384
- const i = Ee(1, t);
599
+ }, vn = (e, t) => {
600
+ const i = Be(1, t);
385
601
  return e.replace("{index}", i);
386
- }, Di = (e, t) => {
602
+ }, gn = (e, t) => {
387
603
  const [i] = e, n = /(https?):\/\//i.test(i);
388
- return gt({
604
+ return Ot({
389
605
  ...t,
390
606
  folder: n ? "" : t.folder,
391
607
  filename: i
392
608
  });
393
- }, Ni = (e, t) => {
609
+ }, yn = (e, t) => {
394
610
  const { imageList: i, indexZeroBase: n } = t;
395
- if (i.length)
396
- try {
397
- const o = JSON.parse(i);
398
- return Di(o, t);
399
- } catch (o) {
400
- console.error(`Wrong format in image-list attribute: ${o.message}`);
401
- }
402
- return Zi(e, n);
403
- }, le = (e, t, i) => {
611
+ if (i.length) {
612
+ const o = Qt(i, null);
613
+ if (o)
614
+ return gn(o, t);
615
+ }
616
+ return vn(e, n);
617
+ }, Ie = (e, t, i) => {
404
618
  const n = new Image();
405
619
  return n.setAttribute(t ? "data-src" : "src", e), n.className = i, n.style.cssText = `
406
620
  position: ${t ? "absolute" : "static"};
@@ -411,84 +625,86 @@ const oe = /* @__PURE__ */ $e(ri), T = {
411
625
  object-position: center;
412
626
  filter: blur(10px);
413
627
  `, n;
414
- }, he = (e, t, i) => {
415
- const { innerBox: n, imageList: o, lazyload: s } = t || {}, [a] = o, r = a || Ni(e, t), c = Hi(r), l = le(c, s, "cloudimage-lazy"), h = le(c, !1, "cloudimage-360-placeholder"), u = (f) => {
416
- Wt(n, ".cloudimage-lazy"), i && i({
628
+ }, xe = (e, t, i) => {
629
+ const { innerBox: n, imageList: o, lazyload: s } = t || {}, [l] = o, r = l || yn(e, t), a = fn(r), c = Ie(a, s, "cloudimage-lazy"), h = Ie(a, !1, "cloudimage-360-placeholder"), p = (f) => {
630
+ Jt(n, ".cloudimage-lazy"), i && i({
417
631
  event: f,
418
- width: l.width,
419
- height: l.height,
420
- naturalWidth: l.naturalWidth,
421
- naturalHeight: l.naturalHeight,
422
- src: c
632
+ width: c.width,
633
+ height: c.height,
634
+ naturalWidth: c.naturalWidth,
635
+ naturalHeight: c.naturalHeight,
636
+ src: a
423
637
  });
424
638
  };
425
- l.onload = u, n.appendChild(l), n.appendChild(h), Bi(l);
426
- }, $i = (e, t) => {
427
- const i = new Image();
428
- i.src = e, i.onload = (n) => {
639
+ c.onload = p, n.appendChild(c), n.appendChild(h), mn(c);
640
+ }, bn = (e, t, i) => {
641
+ const n = new Image();
642
+ n.src = e, n.onload = (o) => {
429
643
  t && t({
430
- event: n,
431
- width: i.width,
432
- height: i.height,
433
- naturalWidth: i.naturalWidth,
434
- naturalHeight: i.naturalHeight,
644
+ event: o,
645
+ width: n.width,
646
+ height: n.height,
647
+ naturalWidth: n.naturalWidth,
648
+ naturalHeight: n.naturalHeight,
435
649
  src: e
436
650
  });
437
- }, i.onerror = function() {
651
+ }, n.onerror = (o) => {
652
+ const s = new Error(`Failed to load image: ${e}`);
653
+ s.url = e, s.event = o, i ? i(s) : console.error(s.message);
438
654
  };
439
- }, Vi = (e, t) => {
655
+ }, wn = (e, t) => {
440
656
  const i = t.getBoundingClientRect(), n = e.touches ? e.touches[0].clientX : e.clientX, o = e.touches ? e.touches[0].clientY : e.clientY;
441
657
  return {
442
658
  x: n - i.left,
443
659
  y: o - i.top
444
660
  };
445
- }, Mt = (e, t, i) => {
446
- const { container: n, w: o, h: s, zoom: a, bw: r, offsetX: c, offsetY: l } = t, h = Vi(e, n);
447
- let u = h.x, f = h.y;
448
- u = Math.max(o / a, Math.min(u, n.offsetWidth - o / a)), f = Math.max(s / a, Math.min(f, n.offsetHeight - s / a)), i.style.left = `${u - o}px`, i.style.top = `${f - s}px`;
449
- const d = (u - c) * a - o + r, y = (f - l) * a - s + r;
450
- i.style.backgroundPosition = `-${d}px -${y}px`;
451
- }, ji = (e, t, i, n, o, s) => {
452
- const { x: a = 0, y: r = 0 } = i || {}, c = (t.offsetWidth - a * 2) * s, l = (t.offsetHeight - r * 2) * s;
661
+ }, Kt = (e, t, i) => {
662
+ const { container: n, w: o, h: s, zoom: l, bw: r, offsetX: a, offsetY: c } = t, h = wn(e, n);
663
+ let p = h.x, f = h.y;
664
+ p = Math.max(o / l, Math.min(p, n.offsetWidth - o / l)), f = Math.max(s / l, Math.min(f, n.offsetHeight - s / l)), i.style.left = `${p - o}px`, i.style.top = `${f - s}px`;
665
+ const u = (p - a) * l - o + r, I = (f - c) * l - s + r;
666
+ i.style.backgroundPosition = `-${u}px -${I}px`;
667
+ }, In = (e, t, i, n, o, s) => {
668
+ const { x: l = 0, y: r = 0 } = i || {}, a = (t.offsetWidth - l * 2) * s, c = (t.offsetHeight - r * 2) * s;
453
669
  if (!o) return;
454
- o.setAttribute("class", "cloudimage-360-img-magnifier-glass"), t.prepend(o), o.style.backgroundImage = `url('${n.src}')`, o.style.backgroundSize = `${c}px ${l}px`;
455
- const h = 3, u = o.offsetWidth / 2, f = o.offsetHeight / 2, d = {
670
+ o.setAttribute("class", "cloudimage-360-img-magnifier-glass"), t.prepend(o), o.style.backgroundImage = `url('${n.src}')`, o.style.backgroundSize = `${a}px ${c}px`;
671
+ const h = 3, p = o.offsetWidth / 2, f = o.offsetHeight / 2, u = {
456
672
  container: t,
457
- w: u,
673
+ w: p,
458
674
  h: f,
459
675
  zoom: s,
460
676
  bw: h,
461
- offsetX: a,
677
+ offsetX: l,
462
678
  offsetY: r
463
679
  };
464
- Mt(e, d, o);
465
- const y = (v) => {
466
- Mt(v, d, o);
680
+ Kt(e, u, o);
681
+ const I = (v) => {
682
+ Kt(v, u, o);
467
683
  }, g = (v) => {
468
- v.preventDefault(), Mt(v, d, o);
684
+ v.preventDefault(), Kt(v, u, o);
469
685
  };
470
- o.addEventListener("mousemove", y), t.addEventListener("mousemove", y), t.addEventListener("touchmove", g);
471
- }, Fi = (e, t, i) => {
472
- const { clientX: n, clientY: o } = e, s = t.getBoundingClientRect(), a = t.width / (s.width * i), r = t.height / (s.height * i), c = (n - s.left) * a, l = (o - s.top) * r;
473
- return { offsetX: c, offsetY: l };
474
- }, de = (e, { bottom: t, top: i }) => {
686
+ o.addEventListener("mousemove", I), t.addEventListener("mousemove", I), t.addEventListener("touchmove", g);
687
+ }, xn = (e, t, i) => {
688
+ const { clientX: n, clientY: o } = e, s = t.getBoundingClientRect(), l = t.width / (s.width * i), r = t.height / (s.height * i), a = (n - s.left) * l, c = (o - s.top) * r;
689
+ return { offsetX: a, offsetY: c };
690
+ }, Ce = (e, { bottom: t, top: i }) => {
475
691
  e ? t() : i();
476
- }, ue = (e, { left: t, right: i }) => {
692
+ }, Oe = (e, { left: t, right: i }) => {
477
693
  e ? t() : i();
478
- }, Gi = ({ autoplayBehavior: e, spinY: t, reversed: i, loopTriggers: n }) => {
694
+ }, Cn = ({ autoplayBehavior: e, spinY: t, reversed: i, loopTriggers: n }) => {
479
695
  switch (e) {
480
- case T.SPIN_XY:
481
- case T.SPIN_YX:
482
- t ? de(i, n) : ue(i, n);
696
+ case M.SPIN_XY:
697
+ case M.SPIN_YX:
698
+ t ? Ce(i, n) : Oe(i, n);
483
699
  break;
484
- case T.SPIN_Y:
485
- de(i, n);
700
+ case M.SPIN_Y:
701
+ Ce(i, n);
486
702
  break;
487
- case T.SPIN_X:
703
+ case M.SPIN_X:
488
704
  default:
489
- ue(i, n);
705
+ Oe(i, n);
490
706
  }
491
- }, zi = ({
707
+ }, On = ({
492
708
  autoplayBehavior: e,
493
709
  activeImageX: t,
494
710
  activeImageY: i,
@@ -496,62 +712,62 @@ const oe = /* @__PURE__ */ $e(ri), T = {
496
712
  amountY: o,
497
713
  autoplayReverse: s
498
714
  }) => {
499
- const a = (r, c) => {
500
- const l = c - 1;
501
- return s ? r === 0 : r === l;
715
+ const l = (r, a) => {
716
+ const c = a - 1;
717
+ return s ? r === 0 : r === c;
502
718
  };
503
719
  switch (e) {
504
- case T.SPIN_XY:
505
- case T.SPIN_Y:
506
- return a(i, o);
507
- case T.SPIN_X:
508
- case T.SPIN_YX:
720
+ case M.SPIN_XY:
721
+ case M.SPIN_Y:
722
+ return l(i, o);
723
+ case M.SPIN_X:
724
+ case M.SPIN_YX:
509
725
  default:
510
- return a(t, n);
726
+ return l(t, n);
511
727
  }
512
- }, Ui = ({
728
+ }, En = ({
513
729
  autoplayBehavior: e,
514
730
  activeImageX: t,
515
731
  activeImageY: i,
516
732
  amountX: n,
517
733
  amountY: o,
518
734
  autoplayReverse: s,
519
- spinDirection: a
735
+ spinDirection: l
520
736
  }) => {
521
- const r = t === (s ? 0 : n - 1), c = i === (s ? 0 : o - 1);
522
- return e === T.SPIN_XY || e === T.SPIN_YX ? a === "x" && r || a === "y" && c : !1;
523
- }, Ki = (e, t, i) => {
737
+ const r = t === (s ? 0 : n - 1), a = i === (s ? 0 : o - 1);
738
+ return e === M.SPIN_XY || e === M.SPIN_YX ? l === "x" && r || l === "y" && a : !1;
739
+ }, Sn = (e, t, i) => {
524
740
  if (!i) return "x";
525
741
  if (!t) return "y";
526
742
  switch (e) {
527
- case T.SPIN_XY:
743
+ case M.SPIN_XY:
528
744
  return "x";
529
- case T.SPIN_YX:
745
+ case M.SPIN_YX:
530
746
  return "y";
531
- case T.SPIN_Y:
747
+ case M.SPIN_Y:
532
748
  return "y";
533
- case T.SPIN_X:
749
+ case M.SPIN_X:
534
750
  default:
535
751
  return "x";
536
752
  }
537
- }, qi = (e) => e === "x" ? "y" : "x", pe = (e, t) => {
538
- const i = [...li];
539
- return t ? [...i, ...hi].includes(e) : i.includes(e);
540
- }, Ji = ({ deltaX: e, deltaY: t, reversed: i, allowSpinX: n, allowSpinY: o, threshold: s = 0 }) => {
541
- const a = n && !o || o && !n ? 0 : s, r = Math.abs(e), c = Math.abs(t);
542
- return n && r - a > c ? i ? e > 0 ? "left" : "right" : e > 0 ? "right" : "left" : o && c - a > r ? i ? t > 0 ? "up" : "down" : t > 0 ? "down" : "up" : null;
543
- }, Qi = () => "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, _i = (e, t = 150) => {
753
+ }, An = (e) => e === "x" ? "y" : "x", Ee = (e, t) => {
754
+ const i = [...Ii];
755
+ return t ? [...i, ...xi].includes(e) : i.includes(e);
756
+ }, Se = ({ deltaX: e, deltaY: t, reversed: i, allowSpinX: n, allowSpinY: o, threshold: s = 0 }) => {
757
+ const l = n && !o || o && !n ? 0 : s, r = Math.abs(e), a = Math.abs(t);
758
+ return n && 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;
759
+ }, Ln = () => "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, kn = (e, t = 150) => {
544
760
  let i;
545
761
  return function(...n) {
546
762
  clearTimeout(i), i = setTimeout(() => {
547
763
  e.apply(this, n);
548
764
  }, t);
549
765
  };
550
- }, Se = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHg9KGEsdCxlKT0+e2NvbnN0IHM9YS9lLG49dC9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sTz0oe3BvaW50ZXJYOmEscG9pbnRlclk6dCxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOnIsbmF0dXJhbEhlaWdodDpsfT1lO2xldCBnPWEvaSpyLXMvMix1PXQvYypsLW4vMjtjb25zdCBwPU1hdGgubWF4KDAsci1zKSxJPU1hdGgubWF4KDAsbC1uKTtyZXR1cm4gZz1NYXRoLm1heCgwLE1hdGgubWluKGcscCkpLHU9TWF0aC5tYXgoMCxNYXRoLm1pbih1LEkpKSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fX07bGV0IG8sbSxmLGgsZCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIGE9Pntjb25zdHthY3Rpb246dCxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpyLGltYWdlQXNwZWN0UmF0aW86bCxjb250YWluZXJXaWR0aDpnLGNvbnRhaW5lckhlaWdodDp1fT1hLmRhdGE7c3dpdGNoKHQpe2Nhc2UiaW5pdENhbnZhcyI6dihlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjp6KGwsZyx1KTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpDKG4saSxjLHIpO2JyZWFrfX07Y29uc3Qgdj0oYSx0KT0+e289YSxtPW8uZ2V0Q29udGV4dCgiMmQiKSxmPXR9LHo9KGEsdCxlKT0+e2NvbnN0IHM9dC9lO3c9YT5zLG8ud2lkdGg9dCpmLG8uaGVpZ2h0PWUqZixtLnNjYWxlKGYsZiksdz8oaD10LGQ9dC9hKTooZD1lLGg9ZSphKSxtLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxtLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEM9KGE9e30sdD0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09YTtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L2YtZCkvMik6KGk9KG8ud2lkdGgvZi1oKS8yLGM9MCksbS5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLHQhPT0xKXtjb25zdHt6b29tZWRXaWR0aDpyLHpvb21lZEhlaWdodDpsfT14KGgsZCx0KSx7em9vbU9mZnNldFg6Zyx6b29tT2Zmc2V0WTp1fT1PKHtwb2ludGVyWDplLHBvaW50ZXJZOnMsaW1hZ2VEYXRhOmEsem9vbWVkV2lkdGg6cix6b29tZWRIZWlnaHQ6bCxkcmF3V2lkdGg6aCxkcmF3SGVpZ2h0OmR9KTttLmRyYXdJbWFnZShuLGcsdSxyLGwsaSxjLGgsZCl9ZWxzZSBtLmRyYXdJbWFnZShuLGksYyxoLGQpfX0pKCk7Cg==", tn = (e) => Uint8Array.from(atob(e), (t) => t.charCodeAt(0)), fe = typeof self < "u" && self.Blob && new Blob([tn(Se)], { type: "text/javascript;charset=utf-8" });
551
- function en(e) {
766
+ }, Fe = "KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHY9KHQsYSxlKT0+e2NvbnN0IHM9dC9lLG49YS9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sej0oe3BvaW50ZXJYOnQscG9pbnRlclk6YSxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOmcsbmF0dXJhbEhlaWdodDp1fT1lO2xldCBmPXQvaSpnLXMvMixtPWEvYyp1LW4vMjtjb25zdCB4PU1hdGgubWF4KDAsZy1zKSxPPU1hdGgubWF4KDAsdS1uKTtyZXR1cm4gZj1NYXRoLm1heCgwLE1hdGgubWluKGYseCkpLG09TWF0aC5tYXgoMCxNYXRoLm1pbihtLE8pKSx7em9vbU9mZnNldFg6Zix6b29tT2Zmc2V0WTptfX07bGV0IG8saCxyLGQsbCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIHQ9Pntjb25zdHthY3Rpb246YSxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpnLGltYWdlQXNwZWN0UmF0aW86dSxjb250YWluZXJXaWR0aDpmLGNvbnRhaW5lckhlaWdodDptfT10LmRhdGE7c3dpdGNoKGEpe2Nhc2UiaW5pdENhbnZhcyI6QyhlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjpwKHUsZixtKTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpJKG4saSxjLGcpO2JyZWFrfX07Y29uc3QgQz0odCxhKT0+e289dCxoPW8uZ2V0Q29udGV4dCgiMmQiKSxyPWF9LHA9KHQsYSxlKT0+e2NvbnN0IHM9YS9lO3c9dD5zLG8ud2lkdGg9YSpyLG8uaGVpZ2h0PWUqcixoLnNjYWxlKHIsciksdz8oZD1hLGw9YS90KToobD1lLGQ9ZSp0KSxoLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxoLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEk9KHQ9e30sYT0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09dDtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L3ItbCkvMik6KGk9KG8ud2lkdGgvci1kKS8yLGM9MCksaC5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLGEhPT0xKXtjb25zdHtuYXR1cmFsV2lkdGg6ZyxuYXR1cmFsSGVpZ2h0OnV9PXQse3pvb21lZFdpZHRoOmYsem9vbWVkSGVpZ2h0Om19PXYoZyx1LGEpLHt6b29tT2Zmc2V0WDp4LHpvb21PZmZzZXRZOk99PXooe3BvaW50ZXJYOmUscG9pbnRlclk6cyxpbWFnZURhdGE6dCx6b29tZWRXaWR0aDpmLHpvb21lZEhlaWdodDptLGRyYXdXaWR0aDpkLGRyYXdIZWlnaHQ6bH0pO2guZHJhd0ltYWdlKG4seCxPLGYsbSxpLGMsZCxsKX1lbHNlIGguZHJhd0ltYWdlKG4saSxjLGQsbCl9fSkoKTsK", Tn = (e) => Uint8Array.from(atob(e), (t) => t.charCodeAt(0)), Ae = typeof self < "u" && self.Blob && new Blob([Tn(Fe)], { type: "text/javascript;charset=utf-8" });
767
+ function Yn(e) {
552
768
  let t;
553
769
  try {
554
- if (t = fe && (self.URL || self.webkitURL).createObjectURL(fe), !t) throw "";
770
+ if (t = Ae && (self.URL || self.webkitURL).createObjectURL(Ae), !t) throw "";
555
771
  const i = new Worker(t, {
556
772
  name: e == null ? void 0 : e.name
557
773
  });
@@ -560,7 +776,7 @@ function en(e) {
560
776
  }), i;
561
777
  } catch {
562
778
  return new Worker(
563
- "data:text/javascript;base64," + Se,
779
+ "data:text/javascript;base64," + Fe,
564
780
  {
565
781
  name: e == null ? void 0 : e.name
566
782
  }
@@ -569,27 +785,165 @@ function en(e) {
569
785
  t && (self.URL || self.webkitURL).revokeObjectURL(t);
570
786
  }
571
787
  }
572
- const nn = (e) => e === "x" ? A.X : A.Y, on = (e, t, i) => e.filter(
573
- (n) => nn(n.orientation) === i && t in n.positions
574
- ), sn = (e) => {
575
- const t = document.createElement("span");
576
- return t.id = e, t.className = "cloudimage-360-hotspot", t.dataset.hotspotId = e, t;
577
- }, rn = (e) => {
578
- const t = Object.entries(e).sort(([s], [a]) => Number(s) - Number(a));
788
+ const Xn = /* @__PURE__ */ new Set([
789
+ // Basic HTML
790
+ "p",
791
+ "span",
792
+ "div",
793
+ "br",
794
+ "hr",
795
+ "strong",
796
+ "em",
797
+ "b",
798
+ "i",
799
+ "u",
800
+ "s",
801
+ "h1",
802
+ "h2",
803
+ "h3",
804
+ "h4",
805
+ "h5",
806
+ "h6",
807
+ "ul",
808
+ "ol",
809
+ "li",
810
+ "a",
811
+ "img",
812
+ "button",
813
+ "table",
814
+ "thead",
815
+ "tbody",
816
+ "tr",
817
+ "th",
818
+ "td",
819
+ "blockquote",
820
+ "pre",
821
+ "code",
822
+ "label",
823
+ "input",
824
+ "select",
825
+ "option",
826
+ "textarea",
827
+ // SVG elements
828
+ "svg",
829
+ "path",
830
+ "circle",
831
+ "rect",
832
+ "line",
833
+ "polyline",
834
+ "polygon",
835
+ "ellipse",
836
+ "g",
837
+ "text",
838
+ "tspan",
839
+ "defs",
840
+ "use",
841
+ "symbol",
842
+ "clippath",
843
+ "mask",
844
+ "lineargradient",
845
+ "radialgradient",
846
+ "stop"
847
+ ]), Le = {
848
+ a: ["href", "title", "target", "rel"],
849
+ img: ["src", "alt", "title", "width", "height"],
850
+ button: ["type", "disabled", "name", "value"],
851
+ input: ["type", "name", "value", "placeholder", "disabled", "readonly", "checked", "min", "max", "step"],
852
+ select: ["name", "disabled", "multiple"],
853
+ option: ["value", "disabled", "selected"],
854
+ textarea: ["name", "placeholder", "disabled", "readonly", "rows", "cols"],
855
+ label: ["for"],
856
+ // SVG attributes
857
+ svg: ["viewbox", "width", "height", "fill", "stroke", "xmlns", "preserveaspectratio"],
858
+ path: ["d", "fill", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin", "transform"],
859
+ circle: ["cx", "cy", "r", "fill", "stroke", "stroke-width"],
860
+ rect: ["x", "y", "width", "height", "rx", "ry", "fill", "stroke", "stroke-width"],
861
+ line: ["x1", "y1", "x2", "y2", "stroke", "stroke-width"],
862
+ polyline: ["points", "fill", "stroke", "stroke-width"],
863
+ polygon: ["points", "fill", "stroke", "stroke-width"],
864
+ ellipse: ["cx", "cy", "rx", "ry", "fill", "stroke", "stroke-width"],
865
+ g: ["transform", "fill", "stroke"],
866
+ text: ["x", "y", "dx", "dy", "text-anchor", "fill", "font-size", "font-family", "font-weight"],
867
+ tspan: ["x", "y", "dx", "dy"],
868
+ use: ["href", "xlink:href", "x", "y", "width", "height"],
869
+ lineargradient: ["id", "x1", "y1", "x2", "y2", "gradientunits"],
870
+ radialgradient: ["id", "cx", "cy", "r", "fx", "fy", "gradientunits"],
871
+ stop: ["offset", "stop-color", "stop-opacity"],
872
+ clippath: ["id"],
873
+ mask: ["id"],
874
+ "*": ["class", "id", "style"]
875
+ }, Pn = [
876
+ /javascript:/gi,
877
+ /vbscript:/gi,
878
+ /data:/gi,
879
+ /on\w+\s*=/gi
880
+ ], Rn = (e) => {
881
+ if (typeof e != "string")
882
+ return "";
883
+ const t = document.createElement("template");
884
+ t.innerHTML = e;
885
+ const i = (n) => {
886
+ if (Array.from(n.childNodes).forEach(i), n.nodeType === Node.ELEMENT_NODE) {
887
+ const s = n.tagName.toLowerCase();
888
+ if (!Xn.has(s)) {
889
+ if (s === "script" || s === "style") {
890
+ n.remove();
891
+ return;
892
+ }
893
+ const a = document.createTextNode(n.textContent);
894
+ n.parentNode.replaceChild(a, n);
895
+ return;
896
+ }
897
+ const l = [
898
+ ...Le[s] || [],
899
+ ...Le["*"] || []
900
+ ];
901
+ if (Array.from(n.attributes).forEach((a) => {
902
+ const c = a.name.toLowerCase();
903
+ if (c.startsWith("on")) {
904
+ n.removeAttribute(a.name);
905
+ return;
906
+ }
907
+ if (!l.includes(c)) {
908
+ n.removeAttribute(a.name);
909
+ return;
910
+ }
911
+ let h = a.value;
912
+ Pn.forEach((p) => {
913
+ p.test(h) && n.removeAttribute(a.name);
914
+ });
915
+ }), s === "a") {
916
+ const a = n.getAttribute("href");
917
+ a && (/^(https?:|mailto:|tel:|#|\/)/i.test(a.trim()) || n.removeAttribute("href")), n.getAttribute("target") === "_blank" && n.setAttribute("rel", "noopener noreferrer");
918
+ }
919
+ if (s === "img") {
920
+ const a = n.getAttribute("src");
921
+ a && (/^(https?:|\/|data:image\/)/i.test(a.trim()) || n.removeAttribute("src"));
922
+ }
923
+ }
924
+ };
925
+ return i(t.content), t.innerHTML;
926
+ }, Mn = (e) => e === "x" ? P.X : P.Y, Hn = (e, t, i) => e.filter(
927
+ (n) => Mn(n.orientation) === i && t in n.positions
928
+ ), Dn = (e, t) => {
929
+ const i = document.createElement("button");
930
+ 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;
931
+ }, Zn = (e) => {
932
+ const t = Object.entries(e).sort(([s], [l]) => Number(s) - Number(l));
579
933
  let i = null, n = null;
580
934
  const o = {};
581
- for (const [s, a] of t)
582
- if (!a)
935
+ for (const [s, l] of t)
936
+ if (!l)
583
937
  o[s] = { x: i, y: n };
584
938
  else {
585
- const { x: r, y: c } = a;
586
- r != null && (i = r), c != null && (n = c), o[s] = {
939
+ const { x: r, y: a } = l;
940
+ r != null && (i = r), a != null && (n = a), o[s] = {
587
941
  x: r || i,
588
- y: c || n
942
+ y: a || n
589
943
  };
590
944
  }
591
945
  return o;
592
- }, an = (e) => [
946
+ }, Bn = (e) => [
593
947
  {
594
948
  name: "offset",
595
949
  options: {
@@ -602,46 +956,46 @@ const nn = (e) => e === "x" ? A.X : A.Y, on = (e, t, i) => e.filter(
602
956
  boundary: e
603
957
  }
604
958
  }
605
- ], cn = (e, t) => {
959
+ ], Wn = (e, t) => {
606
960
  const i = document.createElement("div");
607
- return i.className = "cloudimage-360-popper", i.id = `cloudimage-360-popper-${t}`, i.dataset.popperId = t, typeof e == "string" && /<\/?[a-z][\s\S]*>/i.test(e) ? i.innerHTML = e : i.textContent = e, document.body.appendChild(i), i;
608
- }, ln = (e) => {
961
+ 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 = Rn(e) : i.textContent = e, document.body.appendChild(i), i;
962
+ }, Fn = (e) => {
609
963
  const t = [...e];
610
964
  return t.forEach((i, n) => {
611
- const o = { ...rn(i.positions) };
965
+ const o = { ...Zn(i.positions) };
612
966
  t[n].initialPositions = o, t[n].positions = o;
613
967
  }), t;
614
- }, hn = ({
968
+ }, Nn = ({
615
969
  newWidth: e,
616
970
  newHeight: t,
617
971
  initialContainerSize: i,
618
972
  imageAspectRatio: n,
619
973
  hotspotsConfig: o
620
974
  }) => {
621
- const [s, a] = i;
622
- let r = e, c = t, l = 0, h = 0;
623
- const u = e / t;
624
- n > u ? (c = e / n, h = (t - c) / 2) : (r = t * n, l = (e - r) / 2);
625
- const d = r / s, y = c / a;
975
+ const [s, l] = i;
976
+ let r = e, a = t, c = 0, h = 0;
977
+ const p = e / t;
978
+ n > p ? (a = e / n, h = (t - a) / 2) : (r = t * n, c = (e - r) / 2);
979
+ const u = r / s, I = a / l;
626
980
  return o.map((g) => {
627
981
  const v = {};
628
- return Object.entries(g.initialPositions).forEach(([x, C]) => {
629
- v[x] = {
630
- x: C.x * d + l,
631
- y: C.y * y + h
982
+ return Object.entries(g.initialPositions).forEach(([m, b]) => {
983
+ v[m] = {
984
+ x: b.x * u + c,
985
+ y: b.y * I + h
632
986
  };
633
987
  }), { ...g, positions: v };
634
988
  });
635
989
  };
636
- var k = "top", N = "bottom", $ = "right", M = "left", Zt = "auto", It = [k, N, $, M], ct = "start", wt = "end", dn = "clippingParents", Ye = "viewport", vt = "popper", un = "reference", me = /* @__PURE__ */ It.reduce(function(e, t) {
637
- return e.concat([t + "-" + ct, t + "-" + wt]);
638
- }, []), Re = /* @__PURE__ */ [].concat(It, [Zt]).reduce(function(e, t) {
639
- return e.concat([t, t + "-" + ct, t + "-" + wt]);
640
- }, []), pn = "beforeRead", fn = "read", mn = "afterRead", vn = "beforeMain", gn = "main", yn = "afterMain", bn = "beforeWrite", wn = "write", xn = "afterWrite", In = [pn, fn, mn, vn, gn, yn, bn, wn, xn];
641
- function z(e) {
990
+ var H = "top", F = "bottom", N = "right", D = "left", ee = "auto", kt = [H, F, N, D], ut = "start", At = "end", Vn = "clippingParents", Ne = "viewport", Ct = "popper", jn = "reference", ke = /* @__PURE__ */ kt.reduce(function(e, t) {
991
+ return e.concat([t + "-" + ut, t + "-" + At]);
992
+ }, []), Ve = /* @__PURE__ */ [].concat(kt, [ee]).reduce(function(e, t) {
993
+ return e.concat([t, t + "-" + ut, t + "-" + At]);
994
+ }, []), $n = "beforeRead", Gn = "read", zn = "afterRead", Un = "beforeMain", _n = "main", Kn = "afterMain", Jn = "beforeWrite", Qn = "write", qn = "afterWrite", to = [$n, Gn, zn, Un, _n, Kn, Jn, Qn, qn];
995
+ function $(e) {
642
996
  return e ? (e.nodeName || "").toLowerCase() : null;
643
997
  }
644
- function Z(e) {
998
+ function B(e) {
645
999
  if (e == null)
646
1000
  return window;
647
1001
  if (e.toString() !== "[object Window]") {
@@ -651,30 +1005,30 @@ function Z(e) {
651
1005
  return e;
652
1006
  }
653
1007
  function st(e) {
654
- var t = Z(e).Element;
1008
+ var t = B(e).Element;
655
1009
  return e instanceof t || e instanceof Element;
656
1010
  }
657
- function D(e) {
658
- var t = Z(e).HTMLElement;
1011
+ function W(e) {
1012
+ var t = B(e).HTMLElement;
659
1013
  return e instanceof t || e instanceof HTMLElement;
660
1014
  }
661
- function Dt(e) {
1015
+ function ie(e) {
662
1016
  if (typeof ShadowRoot > "u")
663
1017
  return !1;
664
- var t = Z(e).ShadowRoot;
1018
+ var t = B(e).ShadowRoot;
665
1019
  return e instanceof t || e instanceof ShadowRoot;
666
1020
  }
667
- function Cn(e) {
1021
+ function eo(e) {
668
1022
  var t = e.state;
669
1023
  Object.keys(t.elements).forEach(function(i) {
670
1024
  var n = t.styles[i] || {}, o = t.attributes[i] || {}, s = t.elements[i];
671
- !D(s) || !z(s) || (Object.assign(s.style, n), Object.keys(o).forEach(function(a) {
672
- var r = o[a];
673
- r === !1 ? s.removeAttribute(a) : s.setAttribute(a, r === !0 ? "" : r);
1025
+ !W(s) || !$(s) || (Object.assign(s.style, n), Object.keys(o).forEach(function(l) {
1026
+ var r = o[l];
1027
+ r === !1 ? s.removeAttribute(l) : s.setAttribute(l, r === !0 ? "" : r);
674
1028
  }));
675
1029
  });
676
1030
  }
677
- function On(e) {
1031
+ function io(e) {
678
1032
  var t = e.state, i = {
679
1033
  popper: {
680
1034
  position: t.options.strategy,
@@ -689,54 +1043,54 @@ function On(e) {
689
1043
  };
690
1044
  return Object.assign(t.elements.popper.style, i.popper), t.styles = i, t.elements.arrow && Object.assign(t.elements.arrow.style, i.arrow), function() {
691
1045
  Object.keys(t.elements).forEach(function(n) {
692
- var o = t.elements[n], s = t.attributes[n] || {}, a = Object.keys(t.styles.hasOwnProperty(n) ? t.styles[n] : i[n]), r = a.reduce(function(c, l) {
693
- return c[l] = "", c;
1046
+ var o = t.elements[n], s = t.attributes[n] || {}, l = Object.keys(t.styles.hasOwnProperty(n) ? t.styles[n] : i[n]), r = l.reduce(function(a, c) {
1047
+ return a[c] = "", a;
694
1048
  }, {});
695
- !D(o) || !z(o) || (Object.assign(o.style, r), Object.keys(s).forEach(function(c) {
696
- o.removeAttribute(c);
1049
+ !W(o) || !$(o) || (Object.assign(o.style, r), Object.keys(s).forEach(function(a) {
1050
+ o.removeAttribute(a);
697
1051
  }));
698
1052
  });
699
1053
  };
700
1054
  }
701
- const En = {
1055
+ const no = {
702
1056
  name: "applyStyles",
703
1057
  enabled: !0,
704
1058
  phase: "write",
705
- fn: Cn,
706
- effect: On,
1059
+ fn: eo,
1060
+ effect: io,
707
1061
  requires: ["computeStyles"]
708
1062
  };
709
- function G(e) {
1063
+ function j(e) {
710
1064
  return e.split("-")[0];
711
1065
  }
712
- var ot = Math.max, Xt = Math.min, lt = Math.round;
713
- function Ht() {
1066
+ var ot = Math.max, Wt = Math.min, pt = Math.round;
1067
+ function qt() {
714
1068
  var e = navigator.userAgentData;
715
1069
  return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(t) {
716
1070
  return t.brand + "/" + t.version;
717
1071
  }).join(" ") : navigator.userAgent;
718
1072
  }
719
- function Xe() {
720
- return !/^((?!chrome|android).)*safari/i.test(Ht());
1073
+ function je() {
1074
+ return !/^((?!chrome|android).)*safari/i.test(qt());
721
1075
  }
722
- function ht(e, t, i) {
1076
+ function ft(e, t, i) {
723
1077
  t === void 0 && (t = !1), i === void 0 && (i = !1);
724
1078
  var n = e.getBoundingClientRect(), o = 1, s = 1;
725
- t && D(e) && (o = e.offsetWidth > 0 && lt(n.width) / e.offsetWidth || 1, s = e.offsetHeight > 0 && lt(n.height) / e.offsetHeight || 1);
726
- var a = st(e) ? Z(e) : window, r = a.visualViewport, c = !Xe() && i, l = (n.left + (c && r ? r.offsetLeft : 0)) / o, h = (n.top + (c && r ? r.offsetTop : 0)) / s, u = n.width / o, f = n.height / s;
1079
+ t && W(e) && (o = e.offsetWidth > 0 && pt(n.width) / e.offsetWidth || 1, s = e.offsetHeight > 0 && pt(n.height) / e.offsetHeight || 1);
1080
+ var l = st(e) ? B(e) : window, r = l.visualViewport, a = !je() && i, c = (n.left + (a && r ? r.offsetLeft : 0)) / o, h = (n.top + (a && r ? r.offsetTop : 0)) / s, p = n.width / o, f = n.height / s;
727
1081
  return {
728
- width: u,
1082
+ width: p,
729
1083
  height: f,
730
1084
  top: h,
731
- right: l + u,
1085
+ right: c + p,
732
1086
  bottom: h + f,
733
- left: l,
734
- x: l,
1087
+ left: c,
1088
+ x: c,
735
1089
  y: h
736
1090
  };
737
1091
  }
738
- function Nt(e) {
739
- var t = ht(e), i = e.offsetWidth, n = e.offsetHeight;
1092
+ function ne(e) {
1093
+ var t = ft(e), i = e.offsetWidth, n = e.offsetHeight;
740
1094
  return Math.abs(t.width - i) <= 1 && (i = t.width), Math.abs(t.height - n) <= 1 && (n = t.height), {
741
1095
  x: e.offsetLeft,
742
1096
  y: e.offsetTop,
@@ -744,11 +1098,11 @@ function Nt(e) {
744
1098
  height: n
745
1099
  };
746
1100
  }
747
- function Le(e, t) {
1101
+ function $e(e, t) {
748
1102
  var i = t.getRootNode && t.getRootNode();
749
1103
  if (e.contains(t))
750
1104
  return !0;
751
- if (i && Dt(i)) {
1105
+ if (i && ie(i)) {
752
1106
  var n = t;
753
1107
  do {
754
1108
  if (n && e.isSameNode(n))
@@ -759,42 +1113,42 @@ function Le(e, t) {
759
1113
  return !1;
760
1114
  }
761
1115
  function J(e) {
762
- return Z(e).getComputedStyle(e);
1116
+ return B(e).getComputedStyle(e);
763
1117
  }
764
- function Sn(e) {
765
- return ["table", "td", "th"].indexOf(z(e)) >= 0;
1118
+ function oo(e) {
1119
+ return ["table", "td", "th"].indexOf($(e)) >= 0;
766
1120
  }
767
- function et(e) {
1121
+ function q(e) {
768
1122
  return ((st(e) ? e.ownerDocument : (
769
1123
  // $FlowFixMe[prop-missing]
770
1124
  e.document
771
1125
  )) || window.document).documentElement;
772
1126
  }
773
- function Pt(e) {
774
- return z(e) === "html" ? e : (
1127
+ function Nt(e) {
1128
+ return $(e) === "html" ? e : (
775
1129
  // this is a quicker (but less type safe) way to save quite some bytes from the bundle
776
1130
  // $FlowFixMe[incompatible-return]
777
1131
  // $FlowFixMe[prop-missing]
778
1132
  e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
779
1133
  e.parentNode || // DOM Element detected
780
- (Dt(e) ? e.host : null) || // ShadowRoot detected
1134
+ (ie(e) ? e.host : null) || // ShadowRoot detected
781
1135
  // $FlowFixMe[incompatible-call]: HTMLElement is a Node
782
- et(e)
1136
+ q(e)
783
1137
  );
784
1138
  }
785
- function ve(e) {
786
- return !D(e) || // https://github.com/popperjs/popper-core/issues/837
1139
+ function Te(e) {
1140
+ return !W(e) || // https://github.com/popperjs/popper-core/issues/837
787
1141
  J(e).position === "fixed" ? null : e.offsetParent;
788
1142
  }
789
- function Yn(e) {
790
- var t = /firefox/i.test(Ht()), i = /Trident/i.test(Ht());
791
- if (i && D(e)) {
1143
+ function so(e) {
1144
+ var t = /firefox/i.test(qt()), i = /Trident/i.test(qt());
1145
+ if (i && W(e)) {
792
1146
  var n = J(e);
793
1147
  if (n.position === "fixed")
794
1148
  return null;
795
1149
  }
796
- var o = Pt(e);
797
- for (Dt(o) && (o = o.host); D(o) && ["html", "body"].indexOf(z(o)) < 0; ) {
1150
+ var o = Nt(e);
1151
+ for (ie(o) && (o = o.host); W(o) && ["html", "body"].indexOf($(o)) < 0; ) {
798
1152
  var s = J(o);
799
1153
  if (s.transform !== "none" || s.perspective !== "none" || s.contain === "paint" || ["transform", "perspective"].indexOf(s.willChange) !== -1 || t && s.willChange === "filter" || t && s.filter && s.filter !== "none")
800
1154
  return o;
@@ -802,22 +1156,22 @@ function Yn(e) {
802
1156
  }
803
1157
  return null;
804
1158
  }
805
- function Ct(e) {
806
- for (var t = Z(e), i = ve(e); i && Sn(i) && J(i).position === "static"; )
807
- i = ve(i);
808
- return i && (z(i) === "html" || z(i) === "body" && J(i).position === "static") ? t : i || Yn(e) || t;
1159
+ function Tt(e) {
1160
+ for (var t = B(e), i = Te(e); i && oo(i) && J(i).position === "static"; )
1161
+ i = Te(i);
1162
+ return i && ($(i) === "html" || $(i) === "body" && J(i).position === "static") ? t : i || so(e) || t;
809
1163
  }
810
- function $t(e) {
1164
+ function oe(e) {
811
1165
  return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
812
1166
  }
813
- function yt(e, t, i) {
814
- return ot(e, Xt(t, i));
1167
+ function Et(e, t, i) {
1168
+ return ot(e, Wt(t, i));
815
1169
  }
816
- function Rn(e, t, i) {
817
- var n = yt(e, t, i);
1170
+ function ro(e, t, i) {
1171
+ var n = Et(e, t, i);
818
1172
  return n > i ? i : n;
819
1173
  }
820
- function Pe() {
1174
+ function Ge() {
821
1175
  return {
822
1176
  top: 0,
823
1177
  right: 0,
@@ -825,221 +1179,221 @@ function Pe() {
825
1179
  left: 0
826
1180
  };
827
1181
  }
828
- function Te(e) {
829
- return Object.assign({}, Pe(), e);
1182
+ function ze(e) {
1183
+ return Object.assign({}, Ge(), e);
830
1184
  }
831
- function Ae(e, t) {
1185
+ function Ue(e, t) {
832
1186
  return t.reduce(function(i, n) {
833
1187
  return i[n] = e, i;
834
1188
  }, {});
835
1189
  }
836
- var Xn = function(t, i) {
1190
+ var ao = function(t, i) {
837
1191
  return t = typeof t == "function" ? t(Object.assign({}, i.rects, {
838
1192
  placement: i.placement
839
- })) : t, Te(typeof t != "number" ? t : Ae(t, It));
1193
+ })) : t, ze(typeof t != "number" ? t : Ue(t, kt));
840
1194
  };
841
- function Ln(e) {
842
- var t, i = e.state, n = e.name, o = e.options, s = i.elements.arrow, a = i.modifiersData.popperOffsets, r = G(i.placement), c = $t(r), l = [M, $].indexOf(r) >= 0, h = l ? "height" : "width";
843
- if (!(!s || !a)) {
844
- var u = Xn(o.padding, i), f = Nt(s), d = c === "y" ? k : M, y = c === "y" ? N : $, g = i.rects.reference[h] + i.rects.reference[c] - a[c] - i.rects.popper[h], v = a[c] - i.rects.reference[c], x = Ct(s), C = x ? c === "y" ? x.clientHeight || 0 : x.clientWidth || 0 : 0, O = g / 2 - v / 2, b = u[d], w = C - f[h] - u[y], m = C / 2 - f[h] / 2 + O, I = yt(b, m, w), E = c;
845
- i.modifiersData[n] = (t = {}, t[E] = I, t.centerOffset = I - m, t);
1195
+ function lo(e) {
1196
+ var t, i = e.state, n = e.name, o = e.options, s = i.elements.arrow, l = i.modifiersData.popperOffsets, r = j(i.placement), a = oe(r), c = [D, N].indexOf(r) >= 0, h = c ? "height" : "width";
1197
+ if (!(!s || !l)) {
1198
+ var p = ao(o.padding, i), f = ne(s), 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 = Tt(s), 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 = Et(w, y, C), S = a;
1199
+ i.modifiersData[n] = (t = {}, t[S] = O, t.centerOffset = O - y, t);
846
1200
  }
847
1201
  }
848
- function Pn(e) {
1202
+ function co(e) {
849
1203
  var t = e.state, i = e.options, n = i.element, o = n === void 0 ? "[data-popper-arrow]" : n;
850
- o != null && (typeof o == "string" && (o = t.elements.popper.querySelector(o), !o) || Le(t.elements.popper, o) && (t.elements.arrow = o));
1204
+ o != null && (typeof o == "string" && (o = t.elements.popper.querySelector(o), !o) || $e(t.elements.popper, o) && (t.elements.arrow = o));
851
1205
  }
852
- const Tn = {
1206
+ const ho = {
853
1207
  name: "arrow",
854
1208
  enabled: !0,
855
1209
  phase: "main",
856
- fn: Ln,
857
- effect: Pn,
1210
+ fn: lo,
1211
+ effect: co,
858
1212
  requires: ["popperOffsets"],
859
1213
  requiresIfExists: ["preventOverflow"]
860
1214
  };
861
- function dt(e) {
1215
+ function mt(e) {
862
1216
  return e.split("-")[1];
863
1217
  }
864
- var An = {
1218
+ var uo = {
865
1219
  top: "auto",
866
1220
  right: "auto",
867
1221
  bottom: "auto",
868
1222
  left: "auto"
869
1223
  };
870
- function kn(e, t) {
1224
+ function po(e, t) {
871
1225
  var i = e.x, n = e.y, o = t.devicePixelRatio || 1;
872
1226
  return {
873
- x: lt(i * o) / o || 0,
874
- y: lt(n * o) / o || 0
1227
+ x: pt(i * o) / o || 0,
1228
+ y: pt(n * o) / o || 0
875
1229
  };
876
1230
  }
877
- function ge(e) {
878
- var t, i = e.popper, n = e.popperRect, o = e.placement, s = e.variation, a = e.offsets, r = e.position, c = e.gpuAcceleration, l = e.adaptive, h = e.roundOffsets, u = e.isFixed, f = a.x, d = f === void 0 ? 0 : f, y = a.y, g = y === void 0 ? 0 : y, v = typeof h == "function" ? h({
879
- x: d,
1231
+ function Ye(e) {
1232
+ var t, i = e.popper, n = e.popperRect, o = e.placement, s = 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({
1233
+ x: u,
880
1234
  y: g
881
1235
  }) : {
882
- x: d,
1236
+ x: u,
883
1237
  y: g
884
1238
  };
885
- d = v.x, g = v.y;
886
- var x = a.hasOwnProperty("x"), C = a.hasOwnProperty("y"), O = M, b = k, w = window;
887
- if (l) {
888
- var m = Ct(i), I = "clientHeight", E = "clientWidth";
889
- if (m === Z(i) && (m = et(i), J(m).position !== "static" && r === "absolute" && (I = "scrollHeight", E = "scrollWidth")), m = m, o === k || (o === M || o === $) && s === wt) {
890
- b = N;
891
- var S = u && m === w && w.visualViewport ? w.visualViewport.height : (
1239
+ u = v.x, g = v.y;
1240
+ var m = l.hasOwnProperty("x"), b = l.hasOwnProperty("y"), x = D, w = H, C = window;
1241
+ if (c) {
1242
+ var y = Tt(i), O = "clientHeight", S = "clientWidth";
1243
+ 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) && s === At) {
1244
+ w = F;
1245
+ var E = p && y === C && C.visualViewport ? C.visualViewport.height : (
892
1246
  // $FlowFixMe[prop-missing]
893
- m[I]
1247
+ y[O]
894
1248
  );
895
- g -= S - n.height, g *= c ? 1 : -1;
1249
+ g -= E - n.height, g *= a ? 1 : -1;
896
1250
  }
897
- if (o === M || (o === k || o === N) && s === wt) {
898
- O = $;
899
- var Y = u && m === w && w.visualViewport ? w.visualViewport.width : (
1251
+ if (o === D || (o === H || o === F) && s === At) {
1252
+ x = N;
1253
+ var A = p && y === C && C.visualViewport ? C.visualViewport.width : (
900
1254
  // $FlowFixMe[prop-missing]
901
- m[E]
1255
+ y[S]
902
1256
  );
903
- d -= Y - n.width, d *= c ? 1 : -1;
1257
+ u -= A - n.width, u *= a ? 1 : -1;
904
1258
  }
905
1259
  }
906
- var X = Object.assign({
1260
+ var L = Object.assign({
907
1261
  position: r
908
- }, l && An), W = h === !0 ? kn({
909
- x: d,
1262
+ }, c && uo), R = h === !0 ? po({
1263
+ x: u,
910
1264
  y: g
911
- }, Z(i)) : {
912
- x: d,
1265
+ }, B(i)) : {
1266
+ x: u,
913
1267
  y: g
914
1268
  };
915
- if (d = W.x, g = W.y, c) {
916
- var L;
917
- return Object.assign({}, X, (L = {}, L[b] = C ? "0" : "", L[O] = x ? "0" : "", L.transform = (w.devicePixelRatio || 1) <= 1 ? "translate(" + d + "px, " + g + "px)" : "translate3d(" + d + "px, " + g + "px, 0)", L));
1269
+ if (u = R.x, g = R.y, a) {
1270
+ var T;
1271
+ return Object.assign({}, L, (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));
918
1272
  }
919
- return Object.assign({}, X, (t = {}, t[b] = C ? g + "px" : "", t[O] = x ? d + "px" : "", t.transform = "", t));
1273
+ return Object.assign({}, L, (t = {}, t[w] = b ? g + "px" : "", t[x] = m ? u + "px" : "", t.transform = "", t));
920
1274
  }
921
- function Mn(e) {
922
- var t = e.state, i = e.options, n = i.gpuAcceleration, o = n === void 0 ? !0 : n, s = i.adaptive, a = s === void 0 ? !0 : s, r = i.roundOffsets, c = r === void 0 ? !0 : r, l = {
923
- placement: G(t.placement),
924
- variation: dt(t.placement),
1275
+ function fo(e) {
1276
+ var t = e.state, i = e.options, n = i.gpuAcceleration, o = n === void 0 ? !0 : n, s = i.adaptive, l = s === void 0 ? !0 : s, r = i.roundOffsets, a = r === void 0 ? !0 : r, c = {
1277
+ placement: j(t.placement),
1278
+ variation: mt(t.placement),
925
1279
  popper: t.elements.popper,
926
1280
  popperRect: t.rects.popper,
927
1281
  gpuAcceleration: o,
928
1282
  isFixed: t.options.strategy === "fixed"
929
1283
  };
930
- t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, ge(Object.assign({}, l, {
1284
+ t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, Ye(Object.assign({}, c, {
931
1285
  offsets: t.modifiersData.popperOffsets,
932
1286
  position: t.options.strategy,
933
- adaptive: a,
934
- roundOffsets: c
935
- })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, ge(Object.assign({}, l, {
1287
+ adaptive: l,
1288
+ roundOffsets: a
1289
+ })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, Ye(Object.assign({}, c, {
936
1290
  offsets: t.modifiersData.arrow,
937
1291
  position: "absolute",
938
1292
  adaptive: !1,
939
- roundOffsets: c
1293
+ roundOffsets: a
940
1294
  })))), t.attributes.popper = Object.assign({}, t.attributes.popper, {
941
1295
  "data-popper-placement": t.placement
942
1296
  });
943
1297
  }
944
- const Wn = {
1298
+ const mo = {
945
1299
  name: "computeStyles",
946
1300
  enabled: !0,
947
1301
  phase: "beforeWrite",
948
- fn: Mn,
1302
+ fn: fo,
949
1303
  data: {}
950
1304
  };
951
- var St = {
1305
+ var Dt = {
952
1306
  passive: !0
953
1307
  };
954
- function Hn(e) {
955
- var t = e.state, i = e.instance, n = e.options, o = n.scroll, s = o === void 0 ? !0 : o, a = n.resize, r = a === void 0 ? !0 : a, c = Z(t.elements.popper), l = [].concat(t.scrollParents.reference, t.scrollParents.popper);
956
- return s && l.forEach(function(h) {
957
- h.addEventListener("scroll", i.update, St);
958
- }), r && c.addEventListener("resize", i.update, St), function() {
959
- s && l.forEach(function(h) {
960
- h.removeEventListener("scroll", i.update, St);
961
- }), r && c.removeEventListener("resize", i.update, St);
1308
+ function vo(e) {
1309
+ var t = e.state, i = e.instance, n = e.options, o = n.scroll, s = o === void 0 ? !0 : o, l = n.resize, r = l === void 0 ? !0 : l, a = B(t.elements.popper), c = [].concat(t.scrollParents.reference, t.scrollParents.popper);
1310
+ return s && c.forEach(function(h) {
1311
+ h.addEventListener("scroll", i.update, Dt);
1312
+ }), r && a.addEventListener("resize", i.update, Dt), function() {
1313
+ s && c.forEach(function(h) {
1314
+ h.removeEventListener("scroll", i.update, Dt);
1315
+ }), r && a.removeEventListener("resize", i.update, Dt);
962
1316
  };
963
1317
  }
964
- const Bn = {
1318
+ const go = {
965
1319
  name: "eventListeners",
966
1320
  enabled: !0,
967
1321
  phase: "write",
968
1322
  fn: function() {
969
1323
  },
970
- effect: Hn,
1324
+ effect: vo,
971
1325
  data: {}
972
1326
  };
973
- var Zn = {
1327
+ var yo = {
974
1328
  left: "right",
975
1329
  right: "left",
976
1330
  bottom: "top",
977
1331
  top: "bottom"
978
1332
  };
979
- function Yt(e) {
1333
+ function Zt(e) {
980
1334
  return e.replace(/left|right|bottom|top/g, function(t) {
981
- return Zn[t];
1335
+ return yo[t];
982
1336
  });
983
1337
  }
984
- var Dn = {
1338
+ var bo = {
985
1339
  start: "end",
986
1340
  end: "start"
987
1341
  };
988
- function ye(e) {
1342
+ function Xe(e) {
989
1343
  return e.replace(/start|end/g, function(t) {
990
- return Dn[t];
1344
+ return bo[t];
991
1345
  });
992
1346
  }
993
- function Vt(e) {
994
- var t = Z(e), i = t.pageXOffset, n = t.pageYOffset;
1347
+ function se(e) {
1348
+ var t = B(e), i = t.pageXOffset, n = t.pageYOffset;
995
1349
  return {
996
1350
  scrollLeft: i,
997
1351
  scrollTop: n
998
1352
  };
999
1353
  }
1000
- function jt(e) {
1001
- return ht(et(e)).left + Vt(e).scrollLeft;
1354
+ function re(e) {
1355
+ return ft(q(e)).left + se(e).scrollLeft;
1002
1356
  }
1003
- function Nn(e, t) {
1004
- var i = Z(e), n = et(e), o = i.visualViewport, s = n.clientWidth, a = n.clientHeight, r = 0, c = 0;
1357
+ function wo(e, t) {
1358
+ var i = B(e), n = q(e), o = i.visualViewport, s = n.clientWidth, l = n.clientHeight, r = 0, a = 0;
1005
1359
  if (o) {
1006
- s = o.width, a = o.height;
1007
- var l = Xe();
1008
- (l || !l && t === "fixed") && (r = o.offsetLeft, c = o.offsetTop);
1360
+ s = o.width, l = o.height;
1361
+ var c = je();
1362
+ (c || !c && t === "fixed") && (r = o.offsetLeft, a = o.offsetTop);
1009
1363
  }
1010
1364
  return {
1011
1365
  width: s,
1012
- height: a,
1013
- x: r + jt(e),
1014
- y: c
1366
+ height: l,
1367
+ x: r + re(e),
1368
+ y: a
1015
1369
  };
1016
1370
  }
1017
- function $n(e) {
1018
- var t, i = et(e), n = Vt(e), o = (t = e.ownerDocument) == null ? void 0 : t.body, s = ot(i.scrollWidth, i.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), a = ot(i.scrollHeight, i.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), r = -n.scrollLeft + jt(e), c = -n.scrollTop;
1371
+ function Io(e) {
1372
+ var t, i = q(e), n = se(e), o = (t = e.ownerDocument) == null ? void 0 : t.body, s = 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 = -n.scrollLeft + re(e), a = -n.scrollTop;
1019
1373
  return J(o || i).direction === "rtl" && (r += ot(i.clientWidth, o ? o.clientWidth : 0) - s), {
1020
1374
  width: s,
1021
- height: a,
1375
+ height: l,
1022
1376
  x: r,
1023
- y: c
1377
+ y: a
1024
1378
  };
1025
1379
  }
1026
- function Ft(e) {
1380
+ function ae(e) {
1027
1381
  var t = J(e), i = t.overflow, n = t.overflowX, o = t.overflowY;
1028
1382
  return /auto|scroll|overlay|hidden/.test(i + o + n);
1029
1383
  }
1030
- function ke(e) {
1031
- return ["html", "body", "#document"].indexOf(z(e)) >= 0 ? e.ownerDocument.body : D(e) && Ft(e) ? e : ke(Pt(e));
1384
+ function _e(e) {
1385
+ return ["html", "body", "#document"].indexOf($(e)) >= 0 ? e.ownerDocument.body : W(e) && ae(e) ? e : _e(Nt(e));
1032
1386
  }
1033
- function bt(e, t) {
1387
+ function St(e, t) {
1034
1388
  var i;
1035
1389
  t === void 0 && (t = []);
1036
- var n = ke(e), o = n === ((i = e.ownerDocument) == null ? void 0 : i.body), s = Z(n), a = o ? [s].concat(s.visualViewport || [], Ft(n) ? n : []) : n, r = t.concat(a);
1390
+ var n = _e(e), o = n === ((i = e.ownerDocument) == null ? void 0 : i.body), s = B(n), l = o ? [s].concat(s.visualViewport || [], ae(n) ? n : []) : n, r = t.concat(l);
1037
1391
  return o ? r : (
1038
1392
  // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
1039
- r.concat(bt(Pt(a)))
1393
+ r.concat(St(Nt(l)))
1040
1394
  );
1041
1395
  }
1042
- function Bt(e) {
1396
+ function te(e) {
1043
1397
  return Object.assign({}, e, {
1044
1398
  left: e.x,
1045
1399
  top: e.y,
@@ -1047,180 +1401,179 @@ function Bt(e) {
1047
1401
  bottom: e.y + e.height
1048
1402
  });
1049
1403
  }
1050
- function Vn(e, t) {
1051
- var i = ht(e, !1, t === "fixed");
1404
+ function xo(e, t) {
1405
+ var i = ft(e, !1, t === "fixed");
1052
1406
  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;
1053
1407
  }
1054
- function be(e, t, i) {
1055
- return t === Ye ? Bt(Nn(e, i)) : st(t) ? Vn(t, i) : Bt($n(et(e)));
1408
+ function Pe(e, t, i) {
1409
+ return t === Ne ? te(wo(e, i)) : st(t) ? xo(t, i) : te(Io(q(e)));
1056
1410
  }
1057
- function jn(e) {
1058
- var t = bt(Pt(e)), i = ["absolute", "fixed"].indexOf(J(e).position) >= 0, n = i && D(e) ? Ct(e) : e;
1411
+ function Co(e) {
1412
+ var t = St(Nt(e)), i = ["absolute", "fixed"].indexOf(J(e).position) >= 0, n = i && W(e) ? Tt(e) : e;
1059
1413
  return st(n) ? t.filter(function(o) {
1060
- return st(o) && Le(o, n) && z(o) !== "body";
1414
+ return st(o) && $e(o, n) && $(o) !== "body";
1061
1415
  }) : [];
1062
1416
  }
1063
- function Fn(e, t, i, n) {
1064
- var o = t === "clippingParents" ? jn(e) : [].concat(t), s = [].concat(o, [i]), a = s[0], r = s.reduce(function(c, l) {
1065
- var h = be(e, l, n);
1066
- return c.top = ot(h.top, c.top), c.right = Xt(h.right, c.right), c.bottom = Xt(h.bottom, c.bottom), c.left = ot(h.left, c.left), c;
1067
- }, be(e, a, n));
1417
+ function Oo(e, t, i, n) {
1418
+ var o = t === "clippingParents" ? Co(e) : [].concat(t), s = [].concat(o, [i]), l = s[0], r = s.reduce(function(a, c) {
1419
+ var h = Pe(e, c, n);
1420
+ 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;
1421
+ }, Pe(e, l, n));
1068
1422
  return r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
1069
1423
  }
1070
- function Me(e) {
1071
- var t = e.reference, i = e.element, n = e.placement, o = n ? G(n) : null, s = n ? dt(n) : null, a = t.x + t.width / 2 - i.width / 2, r = t.y + t.height / 2 - i.height / 2, c;
1424
+ function Ke(e) {
1425
+ var t = e.reference, i = e.element, n = e.placement, o = n ? j(n) : null, s = n ? mt(n) : null, l = t.x + t.width / 2 - i.width / 2, r = t.y + t.height / 2 - i.height / 2, a;
1072
1426
  switch (o) {
1073
- case k:
1074
- c = {
1075
- x: a,
1427
+ case H:
1428
+ a = {
1429
+ x: l,
1076
1430
  y: t.y - i.height
1077
1431
  };
1078
1432
  break;
1079
- case N:
1080
- c = {
1081
- x: a,
1433
+ case F:
1434
+ a = {
1435
+ x: l,
1082
1436
  y: t.y + t.height
1083
1437
  };
1084
1438
  break;
1085
- case $:
1086
- c = {
1439
+ case N:
1440
+ a = {
1087
1441
  x: t.x + t.width,
1088
1442
  y: r
1089
1443
  };
1090
1444
  break;
1091
- case M:
1092
- c = {
1445
+ case D:
1446
+ a = {
1093
1447
  x: t.x - i.width,
1094
1448
  y: r
1095
1449
  };
1096
1450
  break;
1097
1451
  default:
1098
- c = {
1452
+ a = {
1099
1453
  x: t.x,
1100
1454
  y: t.y
1101
1455
  };
1102
1456
  }
1103
- var l = o ? $t(o) : null;
1104
- if (l != null) {
1105
- var h = l === "y" ? "height" : "width";
1457
+ var c = o ? oe(o) : null;
1458
+ if (c != null) {
1459
+ var h = c === "y" ? "height" : "width";
1106
1460
  switch (s) {
1107
- case ct:
1108
- c[l] = c[l] - (t[h] / 2 - i[h] / 2);
1461
+ case ut:
1462
+ a[c] = a[c] - (t[h] / 2 - i[h] / 2);
1109
1463
  break;
1110
- case wt:
1111
- c[l] = c[l] + (t[h] / 2 - i[h] / 2);
1464
+ case At:
1465
+ a[c] = a[c] + (t[h] / 2 - i[h] / 2);
1112
1466
  break;
1113
1467
  }
1114
1468
  }
1115
- return c;
1469
+ return a;
1116
1470
  }
1117
- function xt(e, t) {
1471
+ function Lt(e, t) {
1118
1472
  t === void 0 && (t = {});
1119
- var i = t, n = i.placement, o = n === void 0 ? e.placement : n, s = i.strategy, a = s === void 0 ? e.strategy : s, r = i.boundary, c = r === void 0 ? dn : r, l = i.rootBoundary, h = l === void 0 ? Ye : l, u = i.elementContext, f = u === void 0 ? vt : u, d = i.altBoundary, y = d === void 0 ? !1 : d, g = i.padding, v = g === void 0 ? 0 : g, x = Te(typeof v != "number" ? v : Ae(v, It)), C = f === vt ? un : vt, O = e.rects.popper, b = e.elements[y ? C : f], w = Fn(st(b) ? b : b.contextElement || et(e.elements.popper), c, h, a), m = ht(e.elements.reference), I = Me({
1120
- reference: m,
1121
- element: O,
1122
- strategy: "absolute",
1473
+ var i = t, n = i.placement, o = n === void 0 ? e.placement : n, s = i.strategy, l = s === void 0 ? e.strategy : s, r = i.boundary, a = r === void 0 ? Vn : r, c = i.rootBoundary, h = c === void 0 ? Ne : c, p = i.elementContext, f = p === void 0 ? Ct : p, u = i.altBoundary, I = u === void 0 ? !1 : u, g = i.padding, v = g === void 0 ? 0 : g, m = ze(typeof v != "number" ? v : Ue(v, kt)), b = f === Ct ? jn : Ct, x = e.rects.popper, w = e.elements[I ? b : f], C = Oo(st(w) ? w : w.contextElement || q(e.elements.popper), a, h, l), y = ft(e.elements.reference), O = Ke({
1474
+ reference: y,
1475
+ element: x,
1123
1476
  placement: o
1124
- }), E = Bt(Object.assign({}, O, I)), S = f === vt ? E : m, Y = {
1125
- top: w.top - S.top + x.top,
1126
- bottom: S.bottom - w.bottom + x.bottom,
1127
- left: w.left - S.left + x.left,
1128
- right: S.right - w.right + x.right
1129
- }, X = e.modifiersData.offset;
1130
- if (f === vt && X) {
1131
- var W = X[o];
1132
- Object.keys(Y).forEach(function(L) {
1133
- var U = [$, N].indexOf(L) >= 0 ? 1 : -1, K = [k, N].indexOf(L) >= 0 ? "y" : "x";
1134
- Y[L] += W[K] * U;
1477
+ }), S = te(Object.assign({}, x, O)), E = f === Ct ? S : y, A = {
1478
+ top: C.top - E.top + m.top,
1479
+ bottom: E.bottom - C.bottom + m.bottom,
1480
+ left: C.left - E.left + m.left,
1481
+ right: E.right - C.right + m.right
1482
+ }, L = e.modifiersData.offset;
1483
+ if (f === Ct && L) {
1484
+ var R = L[o];
1485
+ Object.keys(A).forEach(function(T) {
1486
+ var G = [N, F].indexOf(T) >= 0 ? 1 : -1, z = [H, F].indexOf(T) >= 0 ? "y" : "x";
1487
+ A[T] += R[z] * G;
1135
1488
  });
1136
1489
  }
1137
- return Y;
1490
+ return A;
1138
1491
  }
1139
- function Gn(e, t) {
1492
+ function Eo(e, t) {
1140
1493
  t === void 0 && (t = {});
1141
- var i = t, n = i.placement, o = i.boundary, s = i.rootBoundary, a = i.padding, r = i.flipVariations, c = i.allowedAutoPlacements, l = c === void 0 ? Re : c, h = dt(n), u = h ? r ? me : me.filter(function(y) {
1142
- return dt(y) === h;
1143
- }) : It, f = u.filter(function(y) {
1144
- return l.indexOf(y) >= 0;
1494
+ var i = t, n = i.placement, o = i.boundary, s = i.rootBoundary, l = i.padding, r = i.flipVariations, a = i.allowedAutoPlacements, c = a === void 0 ? Ve : a, h = mt(n), p = h ? r ? ke : ke.filter(function(I) {
1495
+ return mt(I) === h;
1496
+ }) : kt, f = p.filter(function(I) {
1497
+ return c.indexOf(I) >= 0;
1145
1498
  });
1146
- f.length === 0 && (f = u);
1147
- var d = f.reduce(function(y, g) {
1148
- return y[g] = xt(e, {
1499
+ f.length === 0 && (f = p);
1500
+ var u = f.reduce(function(I, g) {
1501
+ return I[g] = Lt(e, {
1149
1502
  placement: g,
1150
1503
  boundary: o,
1151
1504
  rootBoundary: s,
1152
- padding: a
1153
- })[G(g)], y;
1505
+ padding: l
1506
+ })[j(g)], I;
1154
1507
  }, {});
1155
- return Object.keys(d).sort(function(y, g) {
1156
- return d[y] - d[g];
1508
+ return Object.keys(u).sort(function(I, g) {
1509
+ return u[I] - u[g];
1157
1510
  });
1158
1511
  }
1159
- function zn(e) {
1160
- if (G(e) === Zt)
1512
+ function So(e) {
1513
+ if (j(e) === ee)
1161
1514
  return [];
1162
- var t = Yt(e);
1163
- return [ye(e), t, ye(t)];
1515
+ var t = Zt(e);
1516
+ return [Xe(e), t, Xe(t)];
1164
1517
  }
1165
- function Un(e) {
1518
+ function Ao(e) {
1166
1519
  var t = e.state, i = e.options, n = e.name;
1167
1520
  if (!t.modifiersData[n]._skip) {
1168
- for (var o = i.mainAxis, s = o === void 0 ? !0 : o, a = i.altAxis, r = a === void 0 ? !0 : a, c = i.fallbackPlacements, l = i.padding, h = i.boundary, u = i.rootBoundary, f = i.altBoundary, d = i.flipVariations, y = d === void 0 ? !0 : d, g = i.allowedAutoPlacements, v = t.options.placement, x = G(v), C = x === v, O = c || (C || !y ? [Yt(v)] : zn(v)), b = [v].concat(O).reduce(function(j, V) {
1169
- return j.concat(G(V) === Zt ? Gn(t, {
1521
+ for (var o = i.mainAxis, s = 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) {
1522
+ return Q.concat(j(V) === ee ? Eo(t, {
1170
1523
  placement: V,
1171
1524
  boundary: h,
1172
- rootBoundary: u,
1173
- padding: l,
1174
- flipVariations: y,
1525
+ rootBoundary: p,
1526
+ padding: c,
1527
+ flipVariations: I,
1175
1528
  allowedAutoPlacements: g
1176
1529
  }) : V);
1177
- }, []), w = t.rects.reference, m = t.rects.popper, I = /* @__PURE__ */ new Map(), E = !0, S = b[0], Y = 0; Y < b.length; Y++) {
1178
- var X = b[Y], W = G(X), L = dt(X) === ct, U = [k, N].indexOf(W) >= 0, K = U ? "width" : "height", P = xt(t, {
1179
- placement: X,
1530
+ }, []), C = t.rects.reference, y = t.rects.popper, O = /* @__PURE__ */ new Map(), S = !0, E = w[0], A = 0; A < w.length; A++) {
1531
+ var L = w[A], R = j(L), T = mt(L) === ut, G = [H, F].indexOf(R) >= 0, z = G ? "width" : "height", Y = Lt(t, {
1532
+ placement: L,
1180
1533
  boundary: h,
1181
- rootBoundary: u,
1534
+ rootBoundary: p,
1182
1535
  altBoundary: f,
1183
- padding: l
1184
- }), H = U ? L ? $ : M : L ? N : k;
1185
- w[K] > m[K] && (H = Yt(H));
1186
- var rt = Yt(H), q = [];
1187
- if (s && q.push(P[W] <= 0), r && q.push(P[H] <= 0, P[rt] <= 0), q.every(function(j) {
1188
- return j;
1536
+ padding: c
1537
+ }), Z = G ? T ? N : D : T ? F : H;
1538
+ C[z] > y[z] && (Z = Zt(Z));
1539
+ var rt = Zt(Z), U = [];
1540
+ if (s && U.push(Y[R] <= 0), r && U.push(Y[Z] <= 0, Y[rt] <= 0), U.every(function(Q) {
1541
+ return Q;
1189
1542
  })) {
1190
- S = X, E = !1;
1543
+ E = L, S = !1;
1191
1544
  break;
1192
1545
  }
1193
- I.set(X, q);
1546
+ O.set(L, U);
1194
1547
  }
1195
- if (E)
1196
- for (var at = y ? 3 : 1, ut = function(V) {
1197
- var tt = b.find(function(it) {
1198
- var F = I.get(it);
1199
- if (F)
1200
- return F.slice(0, V).every(function(pt) {
1201
- return pt;
1548
+ if (S)
1549
+ for (var at = I ? 3 : 1, vt = function(V) {
1550
+ var et = w.find(function(it) {
1551
+ var _ = O.get(it);
1552
+ if (_)
1553
+ return _.slice(0, V).every(function(gt) {
1554
+ return gt;
1202
1555
  });
1203
1556
  });
1204
- if (tt)
1205
- return S = tt, "break";
1206
- }, Q = at; Q > 0; Q--) {
1207
- var _ = ut(Q);
1208
- if (_ === "break") break;
1557
+ if (et)
1558
+ return E = et, "break";
1559
+ }, tt = at; tt > 0; tt--) {
1560
+ var lt = vt(tt);
1561
+ if (lt === "break") break;
1209
1562
  }
1210
- t.placement !== S && (t.modifiersData[n]._skip = !0, t.placement = S, t.reset = !0);
1563
+ t.placement !== E && (t.modifiersData[n]._skip = !0, t.placement = E, t.reset = !0);
1211
1564
  }
1212
1565
  }
1213
- const Kn = {
1566
+ const Lo = {
1214
1567
  name: "flip",
1215
1568
  enabled: !0,
1216
1569
  phase: "main",
1217
- fn: Un,
1570
+ fn: Ao,
1218
1571
  requiresIfExists: ["offset"],
1219
1572
  data: {
1220
1573
  _skip: !1
1221
1574
  }
1222
1575
  };
1223
- function we(e, t, i) {
1576
+ function Re(e, t, i) {
1224
1577
  return i === void 0 && (i = {
1225
1578
  x: 0,
1226
1579
  y: 0
@@ -1231,160 +1584,159 @@ function we(e, t, i) {
1231
1584
  left: e.left - t.width - i.x
1232
1585
  };
1233
1586
  }
1234
- function xe(e) {
1235
- return [k, $, N, M].some(function(t) {
1587
+ function Me(e) {
1588
+ return [H, N, F, D].some(function(t) {
1236
1589
  return e[t] >= 0;
1237
1590
  });
1238
1591
  }
1239
- function qn(e) {
1240
- var t = e.state, i = e.name, n = t.rects.reference, o = t.rects.popper, s = t.modifiersData.preventOverflow, a = xt(t, {
1592
+ function ko(e) {
1593
+ var t = e.state, i = e.name, n = t.rects.reference, o = t.rects.popper, s = t.modifiersData.preventOverflow, l = Lt(t, {
1241
1594
  elementContext: "reference"
1242
- }), r = xt(t, {
1595
+ }), r = Lt(t, {
1243
1596
  altBoundary: !0
1244
- }), c = we(a, n), l = we(r, o, s), h = xe(c), u = xe(l);
1597
+ }), a = Re(l, n), c = Re(r, o, s), h = Me(a), p = Me(c);
1245
1598
  t.modifiersData[i] = {
1246
- referenceClippingOffsets: c,
1247
- popperEscapeOffsets: l,
1599
+ referenceClippingOffsets: a,
1600
+ popperEscapeOffsets: c,
1248
1601
  isReferenceHidden: h,
1249
- hasPopperEscaped: u
1602
+ hasPopperEscaped: p
1250
1603
  }, t.attributes.popper = Object.assign({}, t.attributes.popper, {
1251
1604
  "data-popper-reference-hidden": h,
1252
- "data-popper-escaped": u
1605
+ "data-popper-escaped": p
1253
1606
  });
1254
1607
  }
1255
- const Jn = {
1608
+ const To = {
1256
1609
  name: "hide",
1257
1610
  enabled: !0,
1258
1611
  phase: "main",
1259
1612
  requiresIfExists: ["preventOverflow"],
1260
- fn: qn
1613
+ fn: ko
1261
1614
  };
1262
- function Qn(e, t, i) {
1263
- var n = G(e), o = [M, k].indexOf(n) >= 0 ? -1 : 1, s = typeof i == "function" ? i(Object.assign({}, t, {
1615
+ function Yo(e, t, i) {
1616
+ var n = j(e), o = [D, H].indexOf(n) >= 0 ? -1 : 1, s = typeof i == "function" ? i(Object.assign({}, t, {
1264
1617
  placement: e
1265
- })) : i, a = s[0], r = s[1];
1266
- return a = a || 0, r = (r || 0) * o, [M, $].indexOf(n) >= 0 ? {
1618
+ })) : i, l = s[0], r = s[1];
1619
+ return l = l || 0, r = (r || 0) * o, [D, N].indexOf(n) >= 0 ? {
1267
1620
  x: r,
1268
- y: a
1621
+ y: l
1269
1622
  } : {
1270
- x: a,
1623
+ x: l,
1271
1624
  y: r
1272
1625
  };
1273
1626
  }
1274
- function _n(e) {
1275
- var t = e.state, i = e.options, n = e.name, o = i.offset, s = o === void 0 ? [0, 0] : o, a = Re.reduce(function(h, u) {
1276
- return h[u] = Qn(u, t.rects, s), h;
1277
- }, {}), r = a[t.placement], c = r.x, l = r.y;
1278
- t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += c, t.modifiersData.popperOffsets.y += l), t.modifiersData[n] = a;
1627
+ function Xo(e) {
1628
+ var t = e.state, i = e.options, n = e.name, o = i.offset, s = o === void 0 ? [0, 0] : o, l = Ve.reduce(function(h, p) {
1629
+ return h[p] = Yo(p, t.rects, s), h;
1630
+ }, {}), r = l[t.placement], a = r.x, c = r.y;
1631
+ t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += a, t.modifiersData.popperOffsets.y += c), t.modifiersData[n] = l;
1279
1632
  }
1280
- const to = {
1633
+ const Po = {
1281
1634
  name: "offset",
1282
1635
  enabled: !0,
1283
1636
  phase: "main",
1284
1637
  requires: ["popperOffsets"],
1285
- fn: _n
1638
+ fn: Xo
1286
1639
  };
1287
- function eo(e) {
1640
+ function Ro(e) {
1288
1641
  var t = e.state, i = e.name;
1289
- t.modifiersData[i] = Me({
1642
+ t.modifiersData[i] = Ke({
1290
1643
  reference: t.rects.reference,
1291
1644
  element: t.rects.popper,
1292
- strategy: "absolute",
1293
1645
  placement: t.placement
1294
1646
  });
1295
1647
  }
1296
- const io = {
1648
+ const Mo = {
1297
1649
  name: "popperOffsets",
1298
1650
  enabled: !0,
1299
1651
  phase: "read",
1300
- fn: eo,
1652
+ fn: Ro,
1301
1653
  data: {}
1302
1654
  };
1303
- function no(e) {
1655
+ function Ho(e) {
1304
1656
  return e === "x" ? "y" : "x";
1305
1657
  }
1306
- function oo(e) {
1307
- var t = e.state, i = e.options, n = e.name, o = i.mainAxis, s = o === void 0 ? !0 : o, a = i.altAxis, r = a === void 0 ? !1 : a, c = i.boundary, l = i.rootBoundary, h = i.altBoundary, u = i.padding, f = i.tether, d = f === void 0 ? !0 : f, y = i.tetherOffset, g = y === void 0 ? 0 : y, v = xt(t, {
1308
- boundary: c,
1309
- rootBoundary: l,
1310
- padding: u,
1658
+ function Do(e) {
1659
+ var t = e.state, i = e.options, n = e.name, o = i.mainAxis, s = 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 = Lt(t, {
1660
+ boundary: a,
1661
+ rootBoundary: c,
1662
+ padding: p,
1311
1663
  altBoundary: h
1312
- }), x = G(t.placement), C = dt(t.placement), O = !C, b = $t(x), w = no(b), m = t.modifiersData.popperOffsets, I = t.rects.reference, E = t.rects.popper, S = typeof g == "function" ? g(Object.assign({}, t.rects, {
1664
+ }), 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, {
1313
1665
  placement: t.placement
1314
- })) : g, Y = typeof S == "number" ? {
1315
- mainAxis: S,
1316
- altAxis: S
1666
+ })) : g, A = typeof E == "number" ? {
1667
+ mainAxis: E,
1668
+ altAxis: E
1317
1669
  } : Object.assign({
1318
1670
  mainAxis: 0,
1319
1671
  altAxis: 0
1320
- }, S), X = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, W = {
1672
+ }, E), L = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, R = {
1321
1673
  x: 0,
1322
1674
  y: 0
1323
1675
  };
1324
- if (m) {
1676
+ if (y) {
1325
1677
  if (s) {
1326
- var L, U = b === "y" ? k : M, K = b === "y" ? N : $, P = b === "y" ? "height" : "width", H = m[b], rt = H + v[U], q = H - v[K], at = d ? -E[P] / 2 : 0, ut = C === ct ? I[P] : E[P], Q = C === ct ? -E[P] : -I[P], _ = t.elements.arrow, j = d && _ ? Nt(_) : {
1678
+ var T, G = w === "y" ? H : D, z = w === "y" ? F : N, Y = w === "y" ? "height" : "width", Z = y[w], rt = Z + v[G], U = Z - v[z], 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 ? ne(lt) : {
1327
1679
  width: 0,
1328
1680
  height: 0
1329
- }, V = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : Pe(), tt = V[U], it = V[K], F = yt(0, I[P], j[P]), pt = O ? I[P] / 2 - at - F - tt - Y.mainAxis : ut - F - tt - Y.mainAxis, ft = O ? -I[P] / 2 + at + F + it + Y.mainAxis : Q + F + it + Y.mainAxis, mt = t.elements.arrow && Ct(t.elements.arrow), Tt = mt ? b === "y" ? mt.clientTop || 0 : mt.clientLeft || 0 : 0, Gt = (L = X == null ? void 0 : X[b]) != null ? L : 0, We = H + pt - Gt - Tt, He = H + ft - Gt, zt = yt(d ? Xt(rt, We) : rt, H, d ? ot(q, He) : q);
1330
- m[b] = zt, W[b] = zt - H;
1681
+ }, V = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : Ge(), et = V[G], it = V[z], _ = Et(0, O[Y], Q[Y]), gt = x ? O[Y] / 2 - at - _ - et - A.mainAxis : vt - _ - et - A.mainAxis, Vt = x ? -O[Y] / 2 + at + _ + it + A.mainAxis : tt + _ + it + A.mainAxis, yt = t.elements.arrow && Tt(t.elements.arrow), jt = yt ? w === "y" ? yt.clientTop || 0 : yt.clientLeft || 0 : 0, Yt = (T = L == null ? void 0 : L[w]) != null ? T : 0, $t = Z + gt - Yt - jt, Gt = Z + Vt - Yt, Xt = Et(u ? Wt(rt, $t) : rt, Z, u ? ot(U, Gt) : U);
1682
+ y[w] = Xt, R[w] = Xt - Z;
1331
1683
  }
1332
1684
  if (r) {
1333
- var Ut, Be = b === "x" ? k : M, Ze = b === "x" ? N : $, nt = m[w], Ot = w === "y" ? "height" : "width", Kt = nt + v[Be], qt = nt - v[Ze], At = [k, M].indexOf(x) !== -1, Jt = (Ut = X == null ? void 0 : X[w]) != null ? Ut : 0, Qt = At ? Kt : nt - I[Ot] - E[Ot] - Jt + Y.altAxis, _t = At ? nt + I[Ot] + E[Ot] - Jt - Y.altAxis : qt, te = d && At ? Rn(Qt, nt, _t) : yt(d ? Qt : Kt, nt, d ? _t : qt);
1334
- m[w] = te, W[w] = te - nt;
1685
+ var Pt, zt = w === "x" ? H : D, Ut = w === "x" ? F : N, K = y[C], nt = C === "y" ? "height" : "width", ct = K + v[zt], ht = K - v[Ut], dt = [H, D].indexOf(m) !== -1, bt = (Pt = L == null ? void 0 : L[C]) != null ? Pt : 0, wt = dt ? ct : K - O[nt] - S[nt] - bt + A.altAxis, It = dt ? K + O[nt] + S[nt] - bt - A.altAxis : ht, Rt = u && dt ? ro(wt, K, It) : Et(u ? wt : ct, K, u ? It : ht);
1686
+ y[C] = Rt, R[C] = Rt - K;
1335
1687
  }
1336
- t.modifiersData[n] = W;
1688
+ t.modifiersData[n] = R;
1337
1689
  }
1338
1690
  }
1339
- const so = {
1691
+ const Zo = {
1340
1692
  name: "preventOverflow",
1341
1693
  enabled: !0,
1342
1694
  phase: "main",
1343
- fn: oo,
1695
+ fn: Do,
1344
1696
  requiresIfExists: ["offset"]
1345
1697
  };
1346
- function ro(e) {
1698
+ function Bo(e) {
1347
1699
  return {
1348
1700
  scrollLeft: e.scrollLeft,
1349
1701
  scrollTop: e.scrollTop
1350
1702
  };
1351
1703
  }
1352
- function ao(e) {
1353
- return e === Z(e) || !D(e) ? Vt(e) : ro(e);
1704
+ function Wo(e) {
1705
+ return e === B(e) || !W(e) ? se(e) : Bo(e);
1354
1706
  }
1355
- function co(e) {
1356
- var t = e.getBoundingClientRect(), i = lt(t.width) / e.offsetWidth || 1, n = lt(t.height) / e.offsetHeight || 1;
1707
+ function Fo(e) {
1708
+ var t = e.getBoundingClientRect(), i = pt(t.width) / e.offsetWidth || 1, n = pt(t.height) / e.offsetHeight || 1;
1357
1709
  return i !== 1 || n !== 1;
1358
1710
  }
1359
- function lo(e, t, i) {
1711
+ function No(e, t, i) {
1360
1712
  i === void 0 && (i = !1);
1361
- var n = D(t), o = D(t) && co(t), s = et(t), a = ht(e, o, i), r = {
1713
+ var n = W(t), o = W(t) && Fo(t), s = q(t), l = ft(e, o, i), r = {
1362
1714
  scrollLeft: 0,
1363
1715
  scrollTop: 0
1364
- }, c = {
1716
+ }, a = {
1365
1717
  x: 0,
1366
1718
  y: 0
1367
1719
  };
1368
- return (n || !n && !i) && ((z(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
1369
- Ft(s)) && (r = ao(t)), D(t) ? (c = ht(t, !0), c.x += t.clientLeft, c.y += t.clientTop) : s && (c.x = jt(s))), {
1370
- x: a.left + r.scrollLeft - c.x,
1371
- y: a.top + r.scrollTop - c.y,
1372
- width: a.width,
1373
- height: a.height
1720
+ return (n || !n && !i) && (($(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
1721
+ ae(s)) && (r = Wo(t)), W(t) ? (a = ft(t, !0), a.x += t.clientLeft, a.y += t.clientTop) : s && (a.x = re(s))), {
1722
+ x: l.left + r.scrollLeft - a.x,
1723
+ y: l.top + r.scrollTop - a.y,
1724
+ width: l.width,
1725
+ height: l.height
1374
1726
  };
1375
1727
  }
1376
- function ho(e) {
1728
+ function Vo(e) {
1377
1729
  var t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), n = [];
1378
1730
  e.forEach(function(s) {
1379
1731
  t.set(s.name, s);
1380
1732
  });
1381
1733
  function o(s) {
1382
1734
  i.add(s.name);
1383
- var a = [].concat(s.requires || [], s.requiresIfExists || []);
1384
- a.forEach(function(r) {
1735
+ var l = [].concat(s.requires || [], s.requiresIfExists || []);
1736
+ l.forEach(function(r) {
1385
1737
  if (!i.has(r)) {
1386
- var c = t.get(r);
1387
- c && o(c);
1738
+ var a = t.get(r);
1739
+ a && o(a);
1388
1740
  }
1389
1741
  }), n.push(s);
1390
1742
  }
@@ -1392,15 +1744,15 @@ function ho(e) {
1392
1744
  i.has(s.name) || o(s);
1393
1745
  }), n;
1394
1746
  }
1395
- function uo(e) {
1396
- var t = ho(e);
1397
- return In.reduce(function(i, n) {
1747
+ function jo(e) {
1748
+ var t = Vo(e);
1749
+ return to.reduce(function(i, n) {
1398
1750
  return i.concat(t.filter(function(o) {
1399
1751
  return o.phase === n;
1400
1752
  }));
1401
1753
  }, []);
1402
1754
  }
1403
- function po(e) {
1755
+ function $o(e) {
1404
1756
  var t;
1405
1757
  return function() {
1406
1758
  return t || (t = new Promise(function(i) {
@@ -1410,7 +1762,7 @@ function po(e) {
1410
1762
  })), t;
1411
1763
  };
1412
1764
  }
1413
- function fo(e) {
1765
+ function Go(e) {
1414
1766
  var t = e.reduce(function(i, n) {
1415
1767
  var o = i[n.name];
1416
1768
  return i[n.name] = o ? Object.assign({}, o, n, {
@@ -1422,46 +1774,46 @@ function fo(e) {
1422
1774
  return t[i];
1423
1775
  });
1424
1776
  }
1425
- var Ie = {
1777
+ var He = {
1426
1778
  placement: "bottom",
1427
1779
  modifiers: [],
1428
1780
  strategy: "absolute"
1429
1781
  };
1430
- function Ce() {
1782
+ function De() {
1431
1783
  for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++)
1432
1784
  t[i] = arguments[i];
1433
1785
  return !t.some(function(n) {
1434
1786
  return !(n && typeof n.getBoundingClientRect == "function");
1435
1787
  });
1436
1788
  }
1437
- function mo(e) {
1789
+ function zo(e) {
1438
1790
  e === void 0 && (e = {});
1439
- var t = e, i = t.defaultModifiers, n = i === void 0 ? [] : i, o = t.defaultOptions, s = o === void 0 ? Ie : o;
1440
- return function(r, c, l) {
1441
- l === void 0 && (l = s);
1791
+ var t = e, i = t.defaultModifiers, n = i === void 0 ? [] : i, o = t.defaultOptions, s = o === void 0 ? He : o;
1792
+ return function(r, a, c) {
1793
+ c === void 0 && (c = s);
1442
1794
  var h = {
1443
1795
  placement: "bottom",
1444
1796
  orderedModifiers: [],
1445
- options: Object.assign({}, Ie, s),
1797
+ options: Object.assign({}, He, s),
1446
1798
  modifiersData: {},
1447
1799
  elements: {
1448
1800
  reference: r,
1449
- popper: c
1801
+ popper: a
1450
1802
  },
1451
1803
  attributes: {},
1452
1804
  styles: {}
1453
- }, u = [], f = !1, d = {
1805
+ }, p = [], f = !1, u = {
1454
1806
  state: h,
1455
- setOptions: function(x) {
1456
- var C = typeof x == "function" ? x(h.options) : x;
1457
- g(), h.options = Object.assign({}, s, h.options, C), h.scrollParents = {
1458
- reference: st(r) ? bt(r) : r.contextElement ? bt(r.contextElement) : [],
1459
- popper: bt(c)
1807
+ setOptions: function(m) {
1808
+ var b = typeof m == "function" ? m(h.options) : m;
1809
+ g(), h.options = Object.assign({}, s, h.options, b), h.scrollParents = {
1810
+ reference: st(r) ? St(r) : r.contextElement ? St(r.contextElement) : [],
1811
+ popper: St(a)
1460
1812
  };
1461
- var O = uo(fo([].concat(n, h.options.modifiers)));
1462
- return h.orderedModifiers = O.filter(function(b) {
1463
- return b.enabled;
1464
- }), y(), d.update();
1813
+ var x = jo(Go([].concat(n, h.options.modifiers)));
1814
+ return h.orderedModifiers = x.filter(function(w) {
1815
+ return w.enabled;
1816
+ }), I(), u.update();
1465
1817
  },
1466
1818
  // Sync update – it will always be executed, even if not necessary. This
1467
1819
  // is useful for low frequency updates where sync behavior simplifies the
@@ -1470,25 +1822,25 @@ function mo(e) {
1470
1822
  // prefer the async Popper#update method
1471
1823
  forceUpdate: function() {
1472
1824
  if (!f) {
1473
- var x = h.elements, C = x.reference, O = x.popper;
1474
- if (Ce(C, O)) {
1825
+ var m = h.elements, b = m.reference, x = m.popper;
1826
+ if (De(b, x)) {
1475
1827
  h.rects = {
1476
- reference: lo(C, Ct(O), h.options.strategy === "fixed"),
1477
- popper: Nt(O)
1478
- }, h.reset = !1, h.placement = h.options.placement, h.orderedModifiers.forEach(function(Y) {
1479
- return h.modifiersData[Y.name] = Object.assign({}, Y.data);
1828
+ reference: No(b, Tt(x), h.options.strategy === "fixed"),
1829
+ popper: ne(x)
1830
+ }, h.reset = !1, h.placement = h.options.placement, h.orderedModifiers.forEach(function(A) {
1831
+ return h.modifiersData[A.name] = Object.assign({}, A.data);
1480
1832
  });
1481
- for (var b = 0; b < h.orderedModifiers.length; b++) {
1833
+ for (var w = 0; w < h.orderedModifiers.length; w++) {
1482
1834
  if (h.reset === !0) {
1483
- h.reset = !1, b = -1;
1835
+ h.reset = !1, w = -1;
1484
1836
  continue;
1485
1837
  }
1486
- var w = h.orderedModifiers[b], m = w.fn, I = w.options, E = I === void 0 ? {} : I, S = w.name;
1487
- typeof m == "function" && (h = m({
1838
+ var C = h.orderedModifiers[w], y = C.fn, O = C.options, S = O === void 0 ? {} : O, E = C.name;
1839
+ typeof y == "function" && (h = y({
1488
1840
  state: h,
1489
- options: E,
1490
- name: S,
1491
- instance: d
1841
+ options: S,
1842
+ name: E,
1843
+ instance: u
1492
1844
  }) || h);
1493
1845
  }
1494
1846
  }
@@ -1496,54 +1848,54 @@ function mo(e) {
1496
1848
  },
1497
1849
  // Async and optimistically optimized update – it will not be executed if
1498
1850
  // not necessary (debounced to run at most once-per-tick)
1499
- update: po(function() {
1851
+ update: $o(function() {
1500
1852
  return new Promise(function(v) {
1501
- d.forceUpdate(), v(h);
1853
+ u.forceUpdate(), v(h);
1502
1854
  });
1503
1855
  }),
1504
1856
  destroy: function() {
1505
1857
  g(), f = !0;
1506
1858
  }
1507
1859
  };
1508
- if (!Ce(r, c))
1509
- return d;
1510
- d.setOptions(l).then(function(v) {
1511
- !f && l.onFirstUpdate && l.onFirstUpdate(v);
1860
+ if (!De(r, a))
1861
+ return u;
1862
+ u.setOptions(c).then(function(v) {
1863
+ !f && c.onFirstUpdate && c.onFirstUpdate(v);
1512
1864
  });
1513
- function y() {
1865
+ function I() {
1514
1866
  h.orderedModifiers.forEach(function(v) {
1515
- var x = v.name, C = v.options, O = C === void 0 ? {} : C, b = v.effect;
1516
- if (typeof b == "function") {
1517
- var w = b({
1867
+ var m = v.name, b = v.options, x = b === void 0 ? {} : b, w = v.effect;
1868
+ if (typeof w == "function") {
1869
+ var C = w({
1518
1870
  state: h,
1519
- name: x,
1520
- instance: d,
1521
- options: O
1522
- }), m = function() {
1871
+ name: m,
1872
+ instance: u,
1873
+ options: x
1874
+ }), y = function() {
1523
1875
  };
1524
- u.push(w || m);
1876
+ p.push(C || y);
1525
1877
  }
1526
1878
  });
1527
1879
  }
1528
1880
  function g() {
1529
- u.forEach(function(v) {
1881
+ p.forEach(function(v) {
1530
1882
  return v();
1531
- }), u = [];
1883
+ }), p = [];
1532
1884
  }
1533
- return d;
1885
+ return u;
1534
1886
  };
1535
1887
  }
1536
- var vo = [Bn, io, Wn, En, to, Kn, so, Tn, Jn], go = /* @__PURE__ */ mo({
1537
- defaultModifiers: vo
1888
+ var Uo = [go, Mo, mo, no, Po, Lo, Zo, ho, To], _o = /* @__PURE__ */ zo({
1889
+ defaultModifiers: Uo
1538
1890
  });
1539
- class yo {
1891
+ class Ko {
1540
1892
  constructor(t, i, n) {
1541
- ee(this, "updateHotspotPosition", (t, i) => {
1893
+ le(this, "updateHotspotPosition", (t, i) => {
1542
1894
  this.currentActiveIndex = t, this.currentOrientation = i;
1543
- const n = on(this.hotspotsConfig, t, i);
1895
+ const n = Hn(this.hotspotsConfig, t, i);
1544
1896
  this.hideHotspots(), n.forEach((o) => this.updateAndShowHotspot(o, t));
1545
1897
  });
1546
- this.container = i, this.popper = null, this.popperInstance = null, this.hotspotsContainer = Mi(this.container), this.hotspotsConfig = ln(t), this.shouldHidePopper = !0, this.hidePopper = this.hidePopper.bind(this), this.imageAspectRatio = n;
1898
+ this.container = i, this.popper = null, this.popperInstance = null, this.hotspotsContainer = Qi(this.container), this.hotspotsConfig = Fn(t), this.shouldHidePopper = !0, this.hidePopper = this.hidePopper.bind(this), this.imageAspectRatio = n, this.hotspotElements = /* @__PURE__ */ new Map(), this.popperListeners = [];
1547
1899
  const { containerSize: o } = t[0];
1548
1900
  this.initialContainerSize = o || [i.offsetWidth, i.offsetHeight], this.initHotspots(), this.observeContainerResize();
1549
1901
  }
@@ -1554,7 +1906,7 @@ class yo {
1554
1906
  }), this.resizeObserver.observe(this.container);
1555
1907
  }
1556
1908
  updateHotspotsForResize(t, i) {
1557
- this.hotspotsConfig = hn({
1909
+ this.hotspotsConfig = Nn({
1558
1910
  newWidth: t,
1559
1911
  newHeight: i,
1560
1912
  initialContainerSize: this.initialContainerSize,
@@ -1562,22 +1914,34 @@ class yo {
1562
1914
  hotspotsConfig: this.hotspotsConfig
1563
1915
  }), this.updateHotspotPosition(this.currentActiveIndex, this.currentOrientation);
1564
1916
  }
1917
+ cleanupPopperListeners() {
1918
+ this.popperListeners.forEach(({ element: t, event: i, handler: n }) => {
1919
+ t.removeEventListener(i, n);
1920
+ }), this.popperListeners = [];
1921
+ }
1565
1922
  showPopper({ hotspotElement: t, content: i, id: n, keepOpen: o }) {
1566
1923
  this.popperInstance && this.popperInstance.instanceId !== n && this.hidePopper();
1567
1924
  const s = {
1568
1925
  placement: "top",
1569
- modifiers: an(this.container)
1926
+ modifiers: Bn(this.container)
1570
1927
  };
1571
- this.popper = cn(i, n), this.popper.setAttribute("data-show", ""), this.popper.addEventListener("mouseenter", () => {
1928
+ this.popper = Wn(i, n), this.popper.setAttribute("data-show", ""), this.currentHotspotElement = t, t.setAttribute("aria-expanded", "true"), t.setAttribute("aria-describedby", `cloudimage-360-popper-${n}`);
1929
+ const l = () => {
1572
1930
  this.shouldHidePopper = !1;
1573
- }), this.popper.addEventListener("mouseleave", () => {
1931
+ }, r = () => {
1574
1932
  this.shouldHidePopper = !0, this.checkAndHidePopper();
1575
- }), t.addEventListener("mouseleave", () => {
1933
+ }, a = () => {
1576
1934
  this.shouldHidePopper = !0, this.checkAndHidePopper();
1577
- }), t.addEventListener("mouseenter", () => {
1935
+ }, c = () => {
1578
1936
  this.shouldHidePopper = !1, this.hidePopperTimeout && clearTimeout(this.hidePopperTimeout);
1579
- }), this.popperInstance = {
1580
- ...go(t, this.popper, s),
1937
+ };
1938
+ this.popper.addEventListener("mouseenter", l), this.popper.addEventListener("mouseleave", r), t.addEventListener("mouseleave", a), t.addEventListener("mouseenter", c), this.popperListeners.push(
1939
+ { element: this.popper, event: "mouseenter", handler: l },
1940
+ { element: this.popper, event: "mouseleave", handler: r },
1941
+ { element: t, event: "mouseleave", handler: a },
1942
+ { element: t, event: "mouseenter", handler: c }
1943
+ ), this.popperInstance = {
1944
+ ..._o(t, this.popper, s),
1581
1945
  keepOpen: o,
1582
1946
  instanceId: n
1583
1947
  };
@@ -1586,21 +1950,30 @@ class yo {
1586
1950
  var t;
1587
1951
  this.shouldHidePopper && !((t = this.popperInstance) != null && t.keepOpen) && (this.hidePopperTimeout = setTimeout(() => {
1588
1952
  this.shouldHidePopper && this.hidePopper();
1589
- }, 150));
1953
+ }, Oi));
1590
1954
  }
1591
1955
  hidePopper() {
1592
- this.popperInstance && (this.popperInstance.destroy(), this.popperInstance = null), this.popper && (this.popper.removeAttribute("data-show"), setTimeout(() => {
1593
- this.popper && this.popper.remove(), this.popper = null;
1594
- }, 200));
1956
+ 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) {
1957
+ this.popper.removeAttribute("data-show"), this.popper.setAttribute("aria-hidden", "true");
1958
+ const t = this.popper;
1959
+ this.popper = null, setTimeout(() => {
1960
+ t.remove();
1961
+ }, Ei);
1962
+ }
1595
1963
  }
1596
1964
  createHotspot(t) {
1597
- const { id: i, content: n, keepOpen: o, onClick: s } = t, a = sn(i);
1598
- s && (a.style.cursor = "pointer"), a.onclick = (r) => {
1599
- r.stopPropagation(), s == null || s(r, this.popperInstance, i);
1600
- }, n && a.addEventListener(
1965
+ const { id: i, content: n, keepOpen: o, onClick: s, label: l } = t, r = Dn(i, l);
1966
+ s && (r.style.cursor = "pointer"), r.onclick = (a) => {
1967
+ a.stopPropagation(), s == null || s(a, this.popperInstance, i);
1968
+ }, n && (r.addEventListener(
1601
1969
  "mouseenter",
1602
- () => this.showPopper({ hotspotElement: a, content: n, id: i, keepOpen: o })
1603
- ), this.hotspotsContainer.appendChild(a);
1970
+ () => this.showPopper({ hotspotElement: r, content: n, id: i, keepOpen: o })
1971
+ ), r.addEventListener(
1972
+ "focus",
1973
+ () => this.showPopper({ hotspotElement: r, content: n, id: i, keepOpen: o })
1974
+ ), r.addEventListener("blur", () => {
1975
+ this.shouldHidePopper = !0, this.checkAndHidePopper();
1976
+ })), this.hotspotsContainer.appendChild(r);
1604
1977
  }
1605
1978
  hideHotspots() {
1606
1979
  this.hotspotsContainer.querySelectorAll(".cloudimage-360-hotspot").forEach((t) => {
@@ -1608,8 +1981,23 @@ class yo {
1608
1981
  });
1609
1982
  }
1610
1983
  updateAndShowHotspot(t, i) {
1611
- const { positions: n, id: o } = t, { x: s, y: a } = n[i] ?? {}, r = this.hotspotsContainer.querySelector(`[data-hotspot-id="${o}"]`);
1612
- r && (r.style.translate = `${s}px ${a}px`, r.style.opacity = 1, r.style.pointerEvents = "all");
1984
+ const { positions: n, id: o } = t, { x: s, y: l } = n[i] ?? {}, r = this.hotspotsContainer.querySelector(`[data-hotspot-id="${o}"]`);
1985
+ r && (r.style.translate = `${s}px ${l}px`, r.style.opacity = 1, r.style.pointerEvents = "all");
1986
+ }
1987
+ /**
1988
+ * Shows the popper for a specific hotspot by ID
1989
+ * @param {string} hotspotId - The ID of the hotspot to show
1990
+ */
1991
+ showHotspotById(t) {
1992
+ const i = this.hotspotsConfig.find((o) => o.id === t);
1993
+ if (!i || !i.content) return;
1994
+ const n = this.hotspotsContainer.querySelector(`[data-hotspot-id="${t}"]`);
1995
+ n && n.style.opacity === "1" && this.showPopper({
1996
+ hotspotElement: n,
1997
+ content: i.content,
1998
+ id: t,
1999
+ keepOpen: i.keepOpen
2000
+ });
1613
2001
  }
1614
2002
  createAllHotspots() {
1615
2003
  this.hotspotsConfig.forEach((t) => this.createHotspot(t));
@@ -1618,41 +2006,81 @@ class yo {
1618
2006
  this.createAllHotspots();
1619
2007
  }
1620
2008
  destroy() {
1621
- this.resizeObserver.disconnect(), this.hidePopper(), this.hotspotsContainer.innerHTML = "";
2009
+ this.hidePopperTimeout && clearTimeout(this.hidePopperTimeout), this.resizeObserver.disconnect(), this.hidePopper(), this.hotspotElements.clear(), this.hotspotsContainer.innerHTML = "";
1622
2010
  }
1623
2011
  }
1624
- class Lt {
2012
+ class Ft {
1625
2013
  constructor(t, i, n) {
1626
- this.container = t, this.isClicked = !1, this.fullscreenView = !!n, 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.currentZoomScale = 1, this.touchDevice = Qi(), this.canvasWorker = new en(), this.onMoveHandler = this.onMoveHandler.bind(this), this.destroy = this.destroy.bind(this), this.init(this.container, i);
2014
+ this.container = t, this.isClicked = !1, this.fullscreenView = !!n, 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 = Ln(), 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 Yn(), 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);
2015
+ }
2016
+ emit(t, i = {}) {
2017
+ const n = this[t];
2018
+ typeof n == "function" && n({ ...i, viewerId: this.id });
2019
+ }
2020
+ announce(t) {
2021
+ tn(this.ariaLiveRegion, t);
1627
2022
  }
1628
2023
  mouseDown(t) {
1629
2024
  if (!this.isReady || this.glass) return;
1630
2025
  const { pageX: i, pageY: n } = t;
1631
- (this.autoplay || this.loopTimeoutId) && (this.stopAutoplay(), this.autoplay = !1), this.movementStart = { x: i, y: n }, this.isClicked = !0, this.isDragging = !1;
2026
+ 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: n }, this.isClicked = !0, this.isDragging = !1, this.inertia && (this.velocityX = 0, this.velocityY = 0, this.lastDragTime = performance.now(), this.lastDragX = i, this.lastDragY = n);
1632
2027
  }
1633
2028
  mouseUp() {
1634
- this.isReady && (this.isZoomed || this.showAllIcons(), this.movementStart = { x: 0, y: 0 }, this.isClicked = !1, this.innerBox.style.cursor = "grab");
2029
+ 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");
2030
+ }
2031
+ startInertia() {
2032
+ const n = this.fullscreenView ? document.body : this.container, o = this.dragSpeed / fe, s = o * (this.amountX / n.offsetWidth), l = o * (this.amountY / n.offsetHeight), r = () => {
2033
+ if (this.velocityX *= 0.95, this.velocityY *= 0.95, Math.abs(this.velocityX) < 0.01 && Math.abs(this.velocityY) < 0.01) {
2034
+ this.inertiaAnimationId = null;
2035
+ return;
2036
+ }
2037
+ const a = this.velocityX * 16, c = this.velocityY * 16, h = Se({
2038
+ deltaX: a,
2039
+ deltaY: c,
2040
+ reversed: this.dragReverse,
2041
+ allowSpinX: this.allowSpinX,
2042
+ allowSpinY: this.allowSpinY
2043
+ });
2044
+ if (h) {
2045
+ const p = this.allowSpinX ? Math.max(1, Math.abs(Math.round(a * s))) : 0, f = this.allowSpinY ? Math.max(1, Math.abs(Math.round(c * l))) : 0;
2046
+ (p > 0 || f > 0) && this.onMoveHandler(h, p, f);
2047
+ }
2048
+ this.inertiaAnimationId = requestAnimationFrame(r);
2049
+ };
2050
+ this.inertiaAnimationId = requestAnimationFrame(r);
1635
2051
  }
1636
2052
  drag(t, i) {
1637
2053
  if (!this.isReady || !this.isClicked) return;
1638
2054
  const n = t - this.movementStart.x, o = i - this.movementStart.y;
1639
- this.draggingDirection = Ji({
2055
+ if (this.inertia) {
2056
+ const f = performance.now(), u = f - this.lastDragTime;
2057
+ 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;
2058
+ }
2059
+ this.draggingDirection = Se({
1640
2060
  deltaX: n,
1641
2061
  deltaY: o,
1642
2062
  reversed: this.dragReverse,
1643
2063
  allowSpinX: this.allowSpinX,
1644
2064
  allowSpinY: this.allowSpinY
1645
2065
  }) || this.draggingDirection;
1646
- const s = this.fullscreenView ? document.body : this.container, a = this.dragSpeed / 50, r = a * (this.amountX / s.offsetWidth), c = a * (this.amountY / s.offsetHeight), l = this.allowSpinX ? Math.abs(Math.round(n * r)) : 0, h = this.allowSpinY ? Math.abs(Math.round(o * c)) : 0;
1647
- (this.allowSpinX && l !== 0 || this.allowSpinY && h !== 0) && (this.hideHotspotPopper(), this.onMoveHandler(this.draggingDirection, l, h), this.movementStart = { x: t, y: i }, setTimeout(() => {
1648
- this.isDragging = !0;
1649
- }, 150));
2066
+ const s = this.fullscreenView ? document.body : this.container, l = this.dragSpeed / fe, r = l * (this.amountX / s.offsetWidth), a = l * (this.amountY / s.offsetHeight), c = this.allowSpinX ? Math.abs(Math.round(n * r)) : 0, h = this.allowSpinY ? Math.abs(Math.round(o * a)) : 0;
2067
+ (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(() => {
2068
+ this.isDragging || (this.isDragging = !0, this.emit("onDragStart"));
2069
+ }, Ci));
1650
2070
  }
1651
2071
  mouseMove(t) {
1652
2072
  !this.isReady || !this.isClicked && !this.isZoomed || this.glass || (this.hideAllIcons(), this.drag(t.pageX, t.pageY), this.isZoomed && this.applyZoom(t));
1653
2073
  }
1654
2074
  mouseClick(t) {
1655
2075
  if (!(!this.isReady || this.isDragging)) {
2076
+ if (this.dragJustEnded) {
2077
+ this.dragJustEnded = !1;
2078
+ return;
2079
+ }
2080
+ if (this.autoplayJustStopped) {
2081
+ this.autoplayJustStopped = !1;
2082
+ return;
2083
+ }
1656
2084
  if (this.glass && this.magnified) {
1657
2085
  this.removeGlass();
1658
2086
  return;
@@ -1661,15 +2089,16 @@ class Lt {
1661
2089
  }
1662
2090
  }
1663
2091
  loadHigherQualityImages(t, i) {
1664
- const n = gt(this.srcXConfig, t), o = this.allowSpinY ? gt(this.srcYConfig, t) : null;
1665
- ae({
2092
+ const n = Ot(this.srcXConfig, t), o = this.allowSpinY ? Ot(this.srcYConfig, t) : null;
2093
+ ve({
1666
2094
  cdnPathX: n,
1667
2095
  cdnPathY: o,
1668
2096
  configX: this.srcXConfig,
1669
2097
  configY: this.srcYConfig,
1670
- onAllImagesLoad: (s, a) => {
1671
- this.imagesX = s, this.imagesY = a, i();
1672
- }
2098
+ onAllImagesLoad: (s, l) => {
2099
+ this.imagesX = s, this.imagesY = l, i();
2100
+ },
2101
+ onError: (s) => this.emit("onError", s)
1673
2102
  });
1674
2103
  }
1675
2104
  hideHotspots() {
@@ -1682,44 +2111,103 @@ class Lt {
1682
2111
  if (this.isZoomed)
1683
2112
  this.showTransitionOverlay(), setTimeout(() => {
1684
2113
  this.removeZoom();
1685
- }, 800);
2114
+ }, pe);
1686
2115
  else {
1687
2116
  let i = (this.fullscreenView || this.pointerZoom ? document.body : this.container).offsetWidth;
1688
2117
  this.hideHotspots(), this.showLoadingSpinner(), this.loadHigherQualityImages(i, () => {
1689
2118
  this.showTransitionOverlay(), setTimeout(() => {
1690
2119
  this.applyZoom(t);
1691
- }, 800);
2120
+ }, pe);
1692
2121
  });
1693
2122
  }
1694
2123
  }
1695
2124
  removeZoom() {
1696
- this.isZoomed = !1, this.updateView(), this.showAllIcons(), this.hideTransitionOverlay();
2125
+ this.isZoomed = !1, this.updateView(), this.showAllIcons(), this.hideTransitionOverlay(), this.emit("onZoomOut"), this.announce("Zoomed out");
2126
+ }
2127
+ mouseLeave() {
2128
+ this.isZoomed && this.removeZoom();
1697
2129
  }
1698
2130
  applyZoom(t) {
1699
- const { offsetX: i, offsetY: n } = Fi(t, this.canvas, this.devicePixelRatio);
1700
- this.isZoomed = !0, this.hideAllIcons(), this.hideLoadingSpinner(), this.hideTransitionOverlay(), this.updateView(this.pointerZoom, i, n);
2131
+ const { offsetX: i, offsetY: n } = xn(t, this.canvas, this.devicePixelRatio);
2132
+ this.isZoomed = !0, this.hideAllIcons(), this.hideLoadingSpinner(), this.hideTransitionOverlay(), this.updateView(this.pointerZoom, i, n), this.emit("onZoomIn", { zoomLevel: this.pointerZoom }), this.announce("Zoomed in. Move mouse to pan. Click to zoom out.");
1701
2133
  }
1702
2134
  touchOutside(t) {
1703
2135
  if (!this.glass) return;
1704
2136
  !this.canvas.contains(t.target) && this.removeGlass();
1705
2137
  }
1706
2138
  touchStart(t) {
1707
- if (!this.isReady || t.touches.length > 1 || this.glass) return;
1708
- const { pageX: i, pageY: n } = t.touches[0];
1709
- (this.autoplay || this.loopTimeoutId) && (this.stopAutoplay(), this.autoplay = !1), this.hideAllIcons(), this.movementStart = { x: i, y: n }, this.isClicked = !0;
2139
+ if (!this.isReady || this.glass || !t.touches || !t.touches.length) return;
2140
+ const i = t.target;
2141
+ if (i && i.closest && i.closest(".cloudimage-360-button")) return;
2142
+ if (this.hideHints(), t.touches.length === 2 && this.pinchZoom && !this.isDragging) {
2143
+ t.preventDefault(), this.isPinching = !0, this.isClicked = !1, this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null);
2144
+ const s = t.touches[0], l = t.touches[1];
2145
+ if (this.initialPinchDistance = this.getPinchDistance(s, l), (this.autoplay || this.loopTimeoutId) && (this.stopAutoplay(), this.autoplay = !1), !this.isZoomed && this.pinchZoomLevel === 1) {
2146
+ const r = (this.fullscreenView ? document.body : this.container).offsetWidth;
2147
+ this.hideHotspots(), this.loadHigherQualityImages(r, () => {
2148
+ });
2149
+ }
2150
+ return;
2151
+ }
2152
+ if (t.touches.length > 1) return;
2153
+ const { pageX: n, pageY: o } = t.touches[0];
2154
+ this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null), (this.autoplay || this.loopTimeoutId) && (this.stopAutoplay(), this.autoplay = !1), this.hideAllIcons(), this.hideHotspotPopper(), this.movementStart = { x: n, y: o }, this.isClicked = !0, this.isDragging = !1, this.inertia && (this.velocityX = 0, this.velocityY = 0, this.lastDragTime = performance.now(), this.lastDragX = n, this.lastDragY = o);
2155
+ }
2156
+ getPinchDistance(t, i) {
2157
+ const n = t.pageX - i.pageX, o = t.pageY - i.pageY;
2158
+ return Math.sqrt(n * n + o * o);
2159
+ }
2160
+ getPinchCenter(t, i) {
2161
+ return {
2162
+ x: (t.pageX + i.pageX) / 2,
2163
+ y: (t.pageY + i.pageY) / 2
2164
+ };
1710
2165
  }
1711
- touchEnd() {
1712
- this.isReady && (this.showAllIcons(), this.movementStart = { x: 0, y: 0 }, this.isClicked = !1);
2166
+ touchEnd(t) {
2167
+ if (this.isReady) {
2168
+ if (this.isPinching) {
2169
+ if (!t.touches || t.touches.length < 2) {
2170
+ if (this.isPinching = !1, this.initialPinchDistance = 0, this.pinchZoomLevel <= 1) {
2171
+ const i = this.pinchZoomEmitted;
2172
+ this.pinchZoomLevel = 1, this.pinchZoomEmitted = !1, this.lastEmittedZoom = 1, this.isZoomed = !1, this.panOffsetX = 0, this.panOffsetY = 0, this.showAllIcons(), this.updateView(), i && this.emit("onZoomOut");
2173
+ } else if (this.canvas) {
2174
+ const i = this.canvas.getBoundingClientRect();
2175
+ this.panOffsetX = i.width / 2 * this.devicePixelRatio, this.panOffsetY = i.height / 2 * this.devicePixelRatio;
2176
+ }
2177
+ }
2178
+ return;
2179
+ }
2180
+ this.showAllIcons(), this.inertia && this.isDragging && (Math.abs(this.velocityX) > 0.1 || Math.abs(this.velocityY) > 0.1) && this.startInertia(), this.movementStart = { x: 0, y: 0 }, this.isClicked = !1, this.isDragging = !1;
2181
+ }
1713
2182
  }
1714
2183
  touchMove(t) {
1715
- if (!this.isReady || !this.isClicked || this.glass) return;
2184
+ if (!this.isReady || this.glass) return;
2185
+ if (this.isPinching && t.touches.length === 2) {
2186
+ t.preventDefault();
2187
+ const o = t.touches[0], s = t.touches[1], l = this.getPinchDistance(o, s);
2188
+ if (this.initialPinchDistance === 0) {
2189
+ this.initialPinchDistance = l;
2190
+ return;
2191
+ }
2192
+ const r = l / this.initialPinchDistance, a = Math.max(1, Math.min(this.pinchZoomLevel * r, me));
2193
+ if (this.initialPinchDistance = l, this.pinchZoomLevel = a, !this.canvas) return;
2194
+ const c = this.canvas.getBoundingClientRect(), h = c.width / 2 * this.devicePixelRatio, p = c.height / 2 * this.devicePixelRatio;
2195
+ 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());
2196
+ return;
2197
+ }
2198
+ if (!this.isClicked || !t.touches || !t.touches[0]) return;
1716
2199
  const { pageX: i, pageY: n } = t.touches[0];
1717
- t.preventDefault(), this.drag(i, n);
2200
+ if (t.preventDefault(), this.isZoomed && this.pinchZoomLevel > 1) {
2201
+ const o = i - this.movementStart.x, s = n - this.movementStart.y;
2202
+ this.panOffsetX -= o * this.devicePixelRatio, this.panOffsetY -= s * this.devicePixelRatio, this.movementStart = { x: i, y: n }, this.updateView(this.pinchZoomLevel, this.panOffsetX, this.panOffsetY);
2203
+ return;
2204
+ }
2205
+ this.drag(i, n);
1718
2206
  }
1719
2207
  keyDown(t) {
1720
2208
  if (!this.isReady) return;
1721
2209
  const { keyCode: i } = t, n = this.keysReverse;
1722
- switch (this.autoplay && this.stopAutoplay(), pe(i, this.allowSpinY) && this.hideAllIcons(), i) {
2210
+ switch (this.autoplay && this.stopAutoplay(), Ee(i, this.allowSpinY) && (this.hasInteracted = !0, this.hideAllIcons(), this.hideHints()), i) {
1723
2211
  case 37:
1724
2212
  n ? this.moveLeft() : this.moveRight();
1725
2213
  break;
@@ -1736,19 +2224,19 @@ class Lt {
1736
2224
  }
1737
2225
  keyUp(t) {
1738
2226
  const { keyCode: i } = t;
1739
- pe(i, this.allowSpinY) && this.showAllIcons();
2227
+ Ee(i, this.allowSpinY) && this.showAllIcons();
1740
2228
  }
1741
2229
  moveActiveXIndexUp(t) {
1742
- this.orientation = A.X, this.activeImageX = (this.activeImageX + t) % this.amountX;
2230
+ this.orientation = P.X, this.activeImageX = (this.activeImageX + t) % this.amountX;
1743
2231
  }
1744
2232
  moveActiveXIndexDown(t) {
1745
- this.orientation = A.X, this.activeImageX = (this.activeImageX - t + this.amountX) % this.amountX;
2233
+ this.orientation = P.X, this.activeImageX = (this.activeImageX - t + this.amountX) % this.amountX;
1746
2234
  }
1747
2235
  moveActiveYIndexUp(t) {
1748
- this.orientation = A.Y, this.activeImageY = (this.activeImageY + t) % this.amountY;
2236
+ this.orientation = P.Y, this.activeImageY = (this.activeImageY + t) % this.amountY;
1749
2237
  }
1750
2238
  moveActiveYIndexDown(t) {
1751
- this.orientation = A.Y, this.activeImageY = (this.activeImageY - t + this.amountY) % this.amountY;
2239
+ this.orientation = P.Y, this.activeImageY = (this.activeImageY - t + this.amountY) % this.amountY;
1752
2240
  }
1753
2241
  moveRight(t, i = 1) {
1754
2242
  t && this.activeImageX >= this.imagesX.length - 1 || (this.moveActiveXIndexUp(i), this.isZoomed || this.updateView());
@@ -1763,11 +2251,17 @@ class Lt {
1763
2251
  t && this.activeImageY <= 0 || (this.moveActiveYIndexDown(i), this.isZoomed || this.updateView());
1764
2252
  }
1765
2253
  onMoveHandler(t, i = 1, n = 1) {
1766
- t === "right" ? this.moveRight(this.stopAtEdges, i) : t === "left" ? this.moveLeft(this.stopAtEdges, i) : t === "up" ? this.moveTop(this.stopAtEdges, n) : t === "down" && this.moveBottom(this.stopAtEdges, n);
2254
+ t === "right" ? this.moveRight(this.stopAtEdges, i) : t === "left" ? this.moveLeft(this.stopAtEdges, i) : t === "up" ? this.moveTop(this.stopAtEdges, n) : t === "down" && this.moveBottom(this.stopAtEdges, n), this.emit("onSpin", {
2255
+ direction: t,
2256
+ activeImageX: this.activeImageX,
2257
+ activeImageY: this.activeImageY,
2258
+ amountX: this.amountX,
2259
+ amountY: this.amountY
2260
+ });
1767
2261
  }
1768
2262
  updateView(t, i, n) {
1769
- const o = this.orientation === A.X ? this.activeImageX : this.activeImageY, s = this.orientation === A.X ? this.imagesX[this.activeImageX] : this.imagesY[this.activeImageY];
1770
- this.hotspotsInstance && !this.isZoomed && !this.autoplay && this.hotspotsInstance.updateHotspotPosition(o, this.orientation), this.drawImageOnCanvas(s, t, i, n);
2263
+ const o = this.orientation === P.X ? this.activeImageX : this.activeImageY, s = this.orientation === P.X ? this.imagesX[this.activeImageX] : this.imagesY[this.activeImageY];
2264
+ this.hotspotsInstance && !this.isZoomed && !this.autoplay && this.hotspotsInstance.updateHotspotPosition(o, this.orientation), this.hotspotTimelineIndicator && this.orientation === P.X && this.updateHotspotTimelinePosition(), this.drawImageOnCanvas(s, t, i, n);
1771
2265
  }
1772
2266
  updatePercentageInLoader(t = 0) {
1773
2267
  this.loader && (this.loader.innerText = t + "%");
@@ -1794,7 +2288,7 @@ class Lt {
1794
2288
  });
1795
2289
  }
1796
2290
  pushImageToSet(t, i, n) {
1797
- n === A.X ? this.imagesX[i] = t : this.imagesY[i] = t;
2291
+ n === P.X ? this.imagesX[i] = t : this.imagesY[i] = t;
1798
2292
  }
1799
2293
  calculatePercentage() {
1800
2294
  const t = this.amountX + this.amountY, i = this.imagesX.length + this.imagesY.length;
@@ -1807,26 +2301,37 @@ class Lt {
1807
2301
  this.createContainers(t), this.adaptCanvasSize(i), this.drawImageOnCanvas(i);
1808
2302
  }
1809
2303
  onAllImagesLoaded() {
1810
- this.addAllIcons(), this.hotspots && (this.hotspotsInstance = new yo(this.hotspots, this.innerBox, this.imageAspectRatio)), 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.autoplay && (this.hideAllIcons(), _i(this.play.bind(this))());
2304
+ 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 Ko(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) {
2305
+ const t = this.hints === !0 || this.hints === void 0 ? be(this.viewerConfig, this.touchDevice) : this.hints;
2306
+ t && t.length > 0 && (this.hintsOverlay = ye(this.innerBox, t), we(this.hintsOverlay));
2307
+ }
2308
+ this.autoplay && (this.hideAllIcons(), kn(this.play.bind(this))());
1811
2309
  }
1812
2310
  magnify(t) {
1813
2311
  t.stopPropagation();
1814
- const { src: i } = this.orientation === A.Y ? this.imagesY[this.activeImageY] : this.imagesX[this.activeImageX], o = (this.fullscreenView ? document.body : this.container).offsetWidth * this.magnifier, s = yi(i, o);
1815
- this.showLoadingSpinner(), this.createGlass(), $i(s, (r) => {
1816
- this.hideLoadingSpinner(), this.magnified = !0, ji(t, this.innerBox, this.offset, r, this.glass, this.magnifier);
2312
+ 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, s = Hi(i, o);
2313
+ this.showLoadingSpinner(), this.createGlass(), bn(s, (a) => {
2314
+ this.hideLoadingSpinner(), this.magnified = !0, In(t, this.innerBox, this.offset, a, this.glass, this.magnifier);
2315
+ }, (a) => {
2316
+ this.hideLoadingSpinner(), this.removeGlass(), this.emit("onError", {
2317
+ error: { message: a.message, url: a.url },
2318
+ errorCount: 1,
2319
+ totalImages: 1,
2320
+ errors: [{ message: a.message, url: a.url }]
2321
+ });
1817
2322
  });
1818
2323
  }
1819
2324
  openFullscreenModal(t) {
1820
- t.stopPropagation();
1821
- const i = Ti(this.container);
1822
- new Lt(i, this.viewerConfig, !0);
2325
+ t.stopPropagation(), window.document.body.style.overflow = "hidden";
2326
+ const i = _i(this.container);
2327
+ new Ft(i, this.viewerConfig, !0), this.emit("onFullscreenOpen"), this.announce("Opened fullscreen mode. Press Escape to exit.");
1823
2328
  }
1824
2329
  closeFullscreenModal(t) {
1825
- t.stopPropagation(), document.body.removeChild(this.container.parentNode), window.document.body.style.overflow = "visible";
2330
+ t.stopPropagation(), document.body.removeChild(this.container.parentNode), window.document.body.style.overflow = "visible", this.emit("onFullscreenClose"), this.announce("Exited fullscreen mode");
1826
2331
  }
1827
2332
  play() {
1828
2333
  if (this.isClicked) return;
1829
- this.hide360ViewCircleIcon();
2334
+ this.hide360ViewCircleIcon(), this.emit("onAutoplayStart");
1830
2335
  const t = this.speed * 36 / (this.amountX + this.amountY), i = {
1831
2336
  left: this.moveLeft.bind(this),
1832
2337
  right: this.moveRight.bind(this),
@@ -1834,7 +2339,7 @@ class Lt {
1834
2339
  bottom: this.moveBottom.bind(this)
1835
2340
  };
1836
2341
  this.loopTimeoutId = window.setInterval(() => {
1837
- if (this.playOnce && zi({
2342
+ if (this.playOnce && On({
1838
2343
  autoplayBehavior: this.autoplayBehavior,
1839
2344
  activeImageX: this.activeImageX,
1840
2345
  activeImageY: this.activeImageY,
@@ -1845,7 +2350,7 @@ class Lt {
1845
2350
  this.stopAutoplay();
1846
2351
  return;
1847
2352
  }
1848
- Ui({
2353
+ En({
1849
2354
  autoplayBehavior: this.autoplayBehavior,
1850
2355
  activeImageX: this.activeImageX,
1851
2356
  activeImageY: this.activeImageY,
@@ -1853,9 +2358,9 @@ class Lt {
1853
2358
  amountY: this.amountY,
1854
2359
  autoplayReverse: this.autoplayReverse,
1855
2360
  spinDirection: this.spinDirection
1856
- }) && (this.spinDirection = qi(this.spinDirection));
2361
+ }) && (this.spinDirection = An(this.spinDirection));
1857
2362
  const s = this.spinDirection === "y";
1858
- Gi({
2363
+ Cn({
1859
2364
  autoplayBehavior: this.autoplayBehavior,
1860
2365
  spinY: s,
1861
2366
  reversed: this.autoplayReverse,
@@ -1864,18 +2369,19 @@ class Lt {
1864
2369
  }, t);
1865
2370
  }
1866
2371
  stopAutoplay() {
1867
- this.showAllIcons(), this.autoplay = !1, window.clearTimeout(this.loopTimeoutId);
2372
+ if (this.showAllIcons(), this.autoplay = !1, window.clearTimeout(this.loopTimeoutId), this.loopTimeoutId = null, this.emit("onAutoplayStop"), this.hints !== !1 && !this.hintsOverlay && !this.hintsHidden) {
2373
+ const t = this.hints === !0 ? be(this.viewerConfig, this.touchDevice) : this.hints;
2374
+ t && t.length > 0 && (this.hintsOverlay = ye(this.innerBox, t), we(this.hintsOverlay));
2375
+ }
1868
2376
  }
1869
2377
  destroy() {
1870
- this.stopAutoplay(), this.hotspotsInstance && this.hotspotsInstance.destroy();
1871
- const t = this.container, i = t.cloneNode(!0), n = i.querySelector(".cloudimage-360-inner-box");
1872
- i.removeChild(n), t.parentNode.replaceChild(i, t);
2378
+ 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 = "");
1873
2379
  }
1874
2380
  addInitialIcon() {
1875
- this.initialIcon || (this.initialIcon = Ii(), this.innerBox.appendChild(this.initialIcon));
2381
+ this.initialIcon || this.hide360Logo || (this.initialIcon = Ni(this.logoSrc), this.innerBox.appendChild(this.initialIcon));
1876
2382
  }
1877
2383
  showInitialIcon() {
1878
- this.initialIcon && (this.initialIcon.style.opacity = 1);
2384
+ !this.initialIcon || this.hasInteracted || (this.initialIcon.style.opacity = 1);
1879
2385
  }
1880
2386
  hideInitialIcon() {
1881
2387
  this.initialIcon && (this.initialIcon.style.opacity = 0);
@@ -1887,7 +2393,7 @@ class Lt {
1887
2393
  this.showAllIcons(), this.innerBox.removeChild(this.glass), this.glass = null, this.magnified = !1;
1888
2394
  }
1889
2395
  addMagnifierIcon() {
1890
- this.magnifier && (this.magnifierIcon = Li(), this.magnifierIcon.onclick = this.magnify.bind(this), this.iconsContainer.appendChild(this.magnifierIcon));
2396
+ this.magnifier && (this.magnifierIcon = zi(), this.magnifierIcon.onclick = this.magnify.bind(this), this.iconsContainer.appendChild(this.magnifierIcon));
1891
2397
  }
1892
2398
  showMagnifierIcon() {
1893
2399
  this.magnifierIcon && (this.magnifierIcon.style.visibility = "visible", this.magnifierIcon.style.opacity = 1);
@@ -1896,10 +2402,10 @@ class Lt {
1896
2402
  this.magnifierIcon && (this.magnifierIcon.style.visibility = "hidden", this.magnifierIcon.style.opacity = 0);
1897
2403
  }
1898
2404
  addFullscreenIcon() {
1899
- this.fullscreen && (this.fullscreenIcon = Yi(), this.fullscreenIcon.onclick = this.openFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenIcon));
2405
+ this.fullscreen && (this.fullscreenIcon = $i(), this.fullscreenIcon.onclick = this.openFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenIcon));
1900
2406
  }
1901
2407
  addCloseFullscreenIcon() {
1902
- this.fullscreenCloseIcon = Ei(), this.fullscreenCloseIcon.onclick = this.closeFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenCloseIcon);
2408
+ this.fullscreenCloseIcon = ji(), this.fullscreenCloseIcon.onclick = this.closeFullscreenModal.bind(this), this.iconsContainer.appendChild(this.fullscreenCloseIcon);
1903
2409
  }
1904
2410
  showFullscreenIcon() {
1905
2411
  this.fullscreenIcon && (this.fullscreenIcon.style.opacity = 1);
@@ -1908,7 +2414,7 @@ class Lt {
1908
2414
  this.fullscreenIcon && (this.fullscreenIcon.style.opacity = 0);
1909
2415
  }
1910
2416
  add360ViewCircleIcon() {
1911
- this.view360CircleIcon || (this.view360CircleIcon = xi(this.bottomCircleOffset), this.innerBox.appendChild(this.view360CircleIcon));
2417
+ this.view360CircleIcon || (this.view360CircleIcon = Wi(this.bottomCircleOffset), this.innerBox.appendChild(this.view360CircleIcon));
1912
2418
  }
1913
2419
  show360ViewCircleIcon() {
1914
2420
  this.view360CircleIcon && (this.view360CircleIcon.style.opacity = 1);
@@ -1917,13 +2423,13 @@ class Lt {
1917
2423
  this.view360CircleIcon && (this.view360CircleIcon.style.opacity = 0);
1918
2424
  }
1919
2425
  addLoadingSpinner() {
1920
- this.loadingSpinner = Ai(), this.innerBox.appendChild(this.loadingSpinner);
2426
+ this.loadingSpinner = Ki(), this.innerBox.appendChild(this.loadingSpinner);
1921
2427
  }
1922
2428
  showLoadingSpinner() {
1923
2429
  this.loadingSpinner && (this.hideAllIcons(), this.loadingSpinner.style.opacity = 1);
1924
2430
  }
1925
2431
  createTransitionOverlay() {
1926
- this.transitionOverlay = ki(), this.innerBox.appendChild(this.transitionOverlay);
2432
+ this.transitionOverlay = Ji(), this.innerBox.appendChild(this.transitionOverlay);
1927
2433
  }
1928
2434
  showTransitionOverlay() {
1929
2435
  this.transitionOverlay && (this.hideAllIcons(), this.transitionOverlay.style.opacity = 1);
@@ -1934,38 +2440,101 @@ class Lt {
1934
2440
  hideLoadingSpinner() {
1935
2441
  this.loadingSpinner && (this.loadingSpinner.style.opacity = 0);
1936
2442
  }
2443
+ hideHints() {
2444
+ !this.hintsOverlay || this.hintsHidden || (this.hintsHidden = !0, on(this.hintsOverlay));
2445
+ }
2446
+ addHotspotTimeline() {
2447
+ if (!this.hotspots || this.hotspotTimeline) return;
2448
+ const t = cn(this.container, this.amountX, this.hotspots);
2449
+ if (!t) return;
2450
+ this.hotspotTimeline = t.element, this.hotspotTimelineIndicator = t.indicator, this.hotspotTimeline.querySelectorAll(".cloudimage-360-hotspot-timeline-dot").forEach((n) => {
2451
+ n.addEventListener("click", (o) => {
2452
+ o.stopPropagation();
2453
+ const s = parseInt(n.getAttribute("data-frame"), 10), l = n.getAttribute("data-hotspot-id");
2454
+ isNaN(s) || this.animateToFrame(s, l);
2455
+ });
2456
+ }), this.updateHotspotTimelinePosition();
2457
+ }
2458
+ showHotspotTimeline() {
2459
+ dn(this.hotspotTimeline);
2460
+ }
2461
+ hideHotspotTimeline() {
2462
+ un(this.hotspotTimeline);
2463
+ }
2464
+ updateHotspotTimelinePosition() {
2465
+ hn(this.hotspotTimelineIndicator, this.activeImageX, this.amountX);
2466
+ }
2467
+ /**
2468
+ * Animates the viewer to a target frame, optionally showing a hotspot popup on arrival
2469
+ * @param {number} targetFrame - The frame to animate to
2470
+ * @param {string} [hotspotId] - Optional hotspot ID to show popup for after animation
2471
+ */
2472
+ animateToFrame(t, i) {
2473
+ if (this.isAnimatingToFrame || t === this.activeImageX) {
2474
+ t === this.activeImageX && i && this.hotspotsInstance && this.hotspotTimelineOnClick && this.hotspotsInstance.showHotspotById(i);
2475
+ return;
2476
+ }
2477
+ this.isAnimatingToFrame = !0, this.hasInteracted = !0, (this.autoplay || this.loopTimeoutId) && (this.stopAutoplay(), this.autoplay = !1), this.inertiaAnimationId && (cancelAnimationFrame(this.inertiaAnimationId), this.inertiaAnimationId = null);
2478
+ const n = this.activeImageX, o = (t - n + this.amountX) % this.amountX, s = (n - t + this.amountX) % this.amountX, l = o <= s, r = l ? o : s;
2479
+ if (r === 0) {
2480
+ this.isAnimatingToFrame = !1;
2481
+ return;
2482
+ }
2483
+ const a = 30;
2484
+ let c = r;
2485
+ const h = () => {
2486
+ if (c <= 0) {
2487
+ this.isAnimatingToFrame = !1, i && this.hotspotsInstance && this.hotspotTimelineOnClick && setTimeout(() => {
2488
+ this.hotspotsInstance.showHotspotById(i);
2489
+ }, 50);
2490
+ return;
2491
+ }
2492
+ l ? this.moveRight() : this.moveLeft(), c--, c > 0 ? setTimeout(h, a) : (this.isAnimatingToFrame = !1, i && this.hotspotsInstance && this.hotspotTimelineOnClick && setTimeout(() => {
2493
+ this.hotspotsInstance.showHotspotById(i);
2494
+ }, 50));
2495
+ };
2496
+ h();
2497
+ }
1937
2498
  remove360ViewCircleIcon() {
1938
2499
  this.view360CircleIcon && (this.innerBox.removeChild(this.view360CircleIcon), this.view360CircleIcon = null);
1939
2500
  }
1940
2501
  addAllIcons() {
1941
- 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();
2502
+ 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();
1942
2503
  }
1943
2504
  showAllIcons() {
1944
- this.showInitialIcon(), this.show360ViewCircleIcon(), this.showMagnifierIcon(), this.showFullscreenIcon();
2505
+ this.showInitialIcon(), this.show360ViewCircleIcon(), this.showMagnifierIcon(), this.showFullscreenIcon(), this.showHotspotTimeline();
1945
2506
  }
1946
2507
  hideAllIcons() {
1947
- this.hideInitialIcon(), this.hide360ViewCircleIcon(), this.hideMagnifierIcon(), this.hideFullscreenIcon();
2508
+ this.hideInitialIcon(), this.hide360ViewCircleIcon(), this.hideMagnifierIcon(), this.hideFullscreenIcon(), this.hideHotspotTimeline();
1948
2509
  }
1949
2510
  removeLoader() {
1950
2511
  this.loader && (this.innerBox.removeChild(this.loader), this.loader = null);
1951
2512
  }
1952
2513
  attachEvents(t, i, n) {
1953
- t && this.addMouseEvents(), i && this.addTouchEvents(), n && this.addKeyboardEvents();
2514
+ t && this.addMouseEvents(), i && this.addTouchEvents(), n && this.addKeyboardEvents(), this.addEscKeyHandler();
1954
2515
  }
1955
2516
  removeEvents() {
1956
- this.removeMouseEvents(), this.removeTouchEvents(), this.removeKeyboardEvents();
2517
+ this.removeMouseEvents(), this.removeTouchEvents(), this.removeKeyboardEvents(), this.removeEscKeyHandler();
1957
2518
  }
1958
2519
  addMouseEvents() {
1959
- this.boundMouseClick = this.mouseClick.bind(this), this.boundMouseDown = this.mouseDown.bind(this), this.boundMouseMove = oe(this.mouseMove.bind(this), se), this.boundMouseUp = this.mouseUp.bind(this), this.innerBox.addEventListener("click", this.boundMouseClick), this.innerBox.addEventListener("mousedown", this.boundMouseDown), document.addEventListener("mousemove", this.boundMouseMove), document.addEventListener("mouseup", this.boundMouseUp);
2520
+ 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);
1960
2521
  }
1961
2522
  addTouchEvents() {
1962
- this.boundTouchOutside = this.touchOutside.bind(this), this.boundTouchStart = this.touchStart.bind(this), this.boundTouchEnd = this.touchEnd.bind(this), this.boundTouchMove = oe(this.touchMove.bind(this), se), document.addEventListener("touchstart", this.boundTouchOutside), this.container.addEventListener("touchstart", this.boundTouchStart), this.container.addEventListener("touchend", this.boundTouchEnd), this.container.addEventListener("touchmove", this.boundTouchMove);
2523
+ 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);
1963
2524
  }
1964
2525
  addKeyboardEvents() {
1965
2526
  this.boundKeyDown = this.keyDown.bind(this), this.boundKeyUp = this.keyUp.bind(this), document.addEventListener("keydown", this.boundKeyDown), document.addEventListener("keyup", this.boundKeyUp);
1966
2527
  }
2528
+ addEscKeyHandler() {
2529
+ this.boundEscHandler = (t) => {
2530
+ t.keyCode === 27 && (this.fullscreenView ? this.closeFullscreenModal(t) : this.isZoomed ? this.removeZoom() : this.glass && this.removeGlass());
2531
+ }, document.addEventListener("keydown", this.boundEscHandler);
2532
+ }
2533
+ removeEscKeyHandler() {
2534
+ document.removeEventListener("keydown", this.boundEscHandler);
2535
+ }
1967
2536
  removeMouseEvents() {
1968
- this.innerBox.removeEventListener("click", this.boundMouseClick), this.innerBox.removeEventListener("mousedown", this.boundMouseDown), document.removeEventListener("mousemove", this.boundMouseMove), document.removeEventListener("mouseup", this.boundMouseUp);
2537
+ 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);
1969
2538
  }
1970
2539
  removeTouchEvents() {
1971
2540
  document.removeEventListener("touchstart", this.boundTouchOutside), this.container.removeEventListener("touchstart", this.boundTouchStart), this.container.removeEventListener("touchend", this.boundTouchEnd), this.container.removeEventListener("touchmove", this.boundTouchMove);
@@ -1974,7 +2543,7 @@ class Lt {
1974
2543
  document.removeEventListener("keydown", this.boundKeyDown), document.removeEventListener("keyup", this.boundKeyUp);
1975
2544
  }
1976
2545
  createContainers(t) {
1977
- this.iconsContainer = ce(this.innerBox), this.canvas = Ci(this.innerBox, t), this.loader = Pi(this.innerBox);
2546
+ this.iconsContainer = ge(this.innerBox), this.canvas = Vi(this.innerBox, t), this.loader = Ui(this.innerBox), this.ariaLiveRegion = qi(this.innerBox);
1978
2547
  const i = this.canvas.transferControlToOffscreen();
1979
2548
  this.canvasWorker.postMessage(
1980
2549
  {
@@ -1983,81 +2552,103 @@ class Lt {
1983
2552
  devicePixelRatio: this.devicePixelRatio
1984
2553
  },
1985
2554
  [i]
1986
- ), this.fullscreenView && this.addCloseFullscreenIcon(), Wt(this.innerBox, ".cloudimage-360-placeholder");
2555
+ ), this.fullscreenView && this.addCloseFullscreenIcon(), Jt(this.innerBox, ".cloudimage-360-placeholder");
1987
2556
  }
1988
2557
  update(t) {
1989
- this.isReady && (this.stopAutoplay(), Wt(this.innerBox, ".cloudimage-360-icons-container"), this.init(this.container, t, !0), this.iconsContainer = ce(this.innerBox), this.onAllImagesLoaded());
2558
+ this.isReady && (this.stopAutoplay(), Jt(this.innerBox, ".cloudimage-360-icons-container"), this.init(this.container, t, !0), this.iconsContainer = ge(this.innerBox), this.onAllImagesLoaded());
1990
2559
  }
1991
2560
  init(t, i, n) {
1992
- const o = i ? ui(i) : di(t), {
2561
+ const o = i ? Yi(i) : ki(t), {
1993
2562
  folder: s,
1994
- apiVersion: a,
2563
+ apiVersion: l,
1995
2564
  filenameX: r,
1996
- filenameY: c,
1997
- imageListX: l,
2565
+ filenameY: a,
2566
+ imageListX: c,
1998
2567
  imageListY: h,
1999
- indexZeroBase: u,
2568
+ indexZeroBase: p,
2000
2569
  amountX: f,
2001
- amountY: d,
2002
- draggable: y = !0,
2570
+ amountY: u,
2571
+ draggable: I = !0,
2003
2572
  swipeable: g = !0,
2004
2573
  keys: v,
2005
- keysReverse: x,
2006
- bottomCircleOffset: C,
2007
- autoplay: O,
2008
- autoplayBehavior: b,
2009
- playOnce: w,
2010
- speed: m,
2011
- autoplayReverse: I,
2012
- fullscreen: E,
2013
- magnifier: S,
2014
- ciToken: Y,
2015
- ciFilters: X,
2016
- ciTransformation: W,
2017
- lazyload: L,
2018
- dragSpeed: U,
2019
- stopAtEdges: K,
2020
- pointerZoom: P,
2021
- imageInfo: H = "black",
2574
+ keysReverse: m,
2575
+ bottomCircleOffset: b,
2576
+ autoplay: x,
2577
+ autoplayBehavior: w,
2578
+ playOnce: C,
2579
+ speed: y,
2580
+ autoplayReverse: O,
2581
+ fullscreen: S,
2582
+ magnifier: E,
2583
+ ciToken: A,
2584
+ ciFilters: L,
2585
+ ciTransformation: R,
2586
+ lazyload: T,
2587
+ dragSpeed: G,
2588
+ stopAtEdges: z,
2589
+ pointerZoom: Y,
2590
+ imageInfo: Z = "black",
2022
2591
  initialIconShown: rt,
2023
- bottomCircle: q,
2592
+ bottomCircle: U,
2024
2593
  hotspots: at,
2025
- dragReverse: ut
2026
- } = o, Q = { ciToken: Y, ciFilters: X, ciTransformation: W }, _ = l ? JSON.parse(l) : [], j = h ? JSON.parse(h) : [];
2027
- if (this.viewerConfig = o, this.amountX = _.length || f, this.amountY = j.length || d, this.allowSpinX = !!this.amountX, this.allowSpinY = !!this.amountY, this.activeImageX = I ? this.amountX - 1 : 0, this.activeImageY = I ? this.amountY - 1 : 0, this.bottomCircleOffset = C, this.autoplay = O, this.autoplayBehavior = b, this.playOnce = w, this.speed = m, this.autoplayReverse = I, this.fullscreen = E, this.magnifier = S > 1 ? Math.min(S, 5) : 0, this.dragSpeed = Math.max(U, 50), this.stopAtEdges = K, this.ciParams = Q, this.apiVersion = a, this.pointerZoom = P > 1 ? Math.min(P, 5) : null, this.keysReverse = x, this.info = H, this.keys = v, this.innerBox = this.innerBox ?? Ri(this.container), this.initialIconShown = rt, this.bottomCircle = q, this.spinDirection = Ki(this.autoplayBehavior, this.allowSpinX, this.allowSpinY), this.dragReverse = ut, this.hotspots = at, this.srcXConfig = {
2594
+ dragReverse: vt,
2595
+ hide360Logo: tt,
2596
+ logoSrc: lt,
2597
+ inertia: Q,
2598
+ pinchZoom: V,
2599
+ hints: et,
2600
+ theme: it,
2601
+ hotspotTimelineOnClick: _ = !0,
2602
+ // Event callbacks
2603
+ onReady: gt,
2604
+ onLoad: Vt,
2605
+ onSpin: yt,
2606
+ onAutoplayStart: jt,
2607
+ onAutoplayStop: Yt,
2608
+ onFullscreenOpen: $t,
2609
+ onFullscreenClose: Gt,
2610
+ onZoomIn: Xt,
2611
+ onZoomOut: Pt,
2612
+ onDragStart: zt,
2613
+ onDragEnd: Ut,
2614
+ onError: K
2615
+ } = o, nt = { ciToken: A, ciFilters: L, ciTransformation: R }, ct = Qt(c, []), ht = Qt(h, []);
2616
+ if (this.viewerConfig = o, this.amountX = ct.length || f, this.amountY = ht.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, Ai) : 0, this.dragSpeed = Math.max(G, Si), this.stopAtEdges = z, this.ciParams = nt, 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), this.initialIconShown = rt, this.bottomCircle = U, this.spinDirection = Sn(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 = _, it === "dark" ? this.container.classList.add("ci360-theme-dark") : it === "light" && this.container.classList.remove("ci360-theme-dark"), this.onReady = gt, this.onLoad = Vt, this.onSpin = yt, this.onAutoplayStart = jt, this.onAutoplayStop = Yt, this.onFullscreenOpen = $t, this.onFullscreenClose = Gt, this.onZoomIn = Xt, this.onZoomOut = Pt, this.onDragStart = zt, this.onDragEnd = Ut, this.onError = K, this.srcXConfig = {
2028
2617
  folder: s,
2029
2618
  filename: r,
2030
- imageList: _,
2619
+ imageList: ct,
2031
2620
  container: t,
2032
2621
  innerBox: this.innerBox,
2033
- apiVersion: a,
2034
- ciParams: Q,
2035
- lazyload: L,
2622
+ apiVersion: l,
2623
+ ciParams: nt,
2624
+ lazyload: T,
2036
2625
  amount: this.amountX,
2037
- indexZeroBase: u,
2038
- autoplayReverse: I
2626
+ indexZeroBase: p,
2627
+ autoplayReverse: O,
2628
+ orientation: P.X
2039
2629
  }, this.srcYConfig = {
2040
2630
  ...this.srcXConfig,
2041
- filename: c,
2042
- imageList: j,
2043
- orientation: A.Y,
2631
+ filename: a,
2632
+ imageList: ht,
2633
+ orientation: P.Y,
2044
2634
  amount: this.amountY
2045
- }, n && this.removeEvents(), this.attachEvents(y, g, v), n) return;
2046
- const V = (this.fullscreenView ? document.body : this.container).offsetWidth, tt = this.allowSpinX && !_.length ? gt(this.srcXConfig, V) : null, it = this.allowSpinY && !j.length ? gt(this.srcYConfig, V) : null, F = (pt) => {
2047
- ae({
2048
- cdnPathX: tt,
2049
- cdnPathY: it,
2635
+ }, n && this.removeEvents(), this.attachEvents(I, g, v), n) return;
2636
+ const dt = (this.fullscreenView ? document.body : this.container).offsetWidth, bt = this.allowSpinX && !ct.length ? Ot(this.srcXConfig, dt) : null, wt = this.allowSpinY && !ht.length ? Ot(this.srcYConfig, dt) : null, It = (Rt) => {
2637
+ ve({
2638
+ cdnPathX: bt,
2639
+ cdnPathY: wt,
2050
2640
  configX: this.srcXConfig,
2051
2641
  configY: this.srcYConfig,
2052
- onImageLoad: (ft, mt, Tt) => this.onImageLoad(ft, mt, Tt),
2053
- onFirstImageLoad: (ft) => this.onFirstImageLoaded(pt, ft),
2054
- onAllImagesLoad: this.onAllImagesLoaded.bind(this)
2642
+ onImageLoad: (xt, Je, Qe) => this.onImageLoad(xt, Je, Qe),
2643
+ onFirstImageLoad: (xt) => this.onFirstImageLoaded(Rt, xt),
2644
+ onAllImagesLoad: this.onAllImagesLoaded.bind(this),
2645
+ onError: (xt) => this.emit("onError", xt)
2055
2646
  });
2056
2647
  };
2057
- this.allowSpinX ? he(tt, this.srcXConfig, F) : this.allowSpinY && he(it, this.srcYConfig, F);
2648
+ this.allowSpinX ? xe(bt, this.srcXConfig, It) : this.allowSpinY && xe(wt, this.srcYConfig, It);
2058
2649
  }
2059
2650
  }
2060
- class bo {
2651
+ class Jo {
2061
2652
  constructor() {
2062
2653
  this.views = /* @__PURE__ */ new Map(), this.initAll = this.initAll.bind(this), this.getViews = this.getViews.bind(this);
2063
2654
  }
@@ -2068,14 +2659,14 @@ class bo {
2068
2659
  if (!t) return;
2069
2660
  const o = t.id || this.generateId();
2070
2661
  t.id || (t.id = o);
2071
- const s = new Lt(t, i, n);
2662
+ const s = new Ft(t, i, n);
2072
2663
  return this.views.set(o, s), s;
2073
2664
  }
2074
2665
  initAll(t = "cloudimage-360") {
2075
2666
  [...document.querySelectorAll(`.${t}`)].filter(Boolean).forEach((n) => {
2076
2667
  const o = n.id || this.generateId();
2077
2668
  n.id || (n.id = o);
2078
- const s = new Lt(n);
2669
+ const s = new Ft(n);
2079
2670
  this.views.set(o, s);
2080
2671
  });
2081
2672
  }
@@ -2095,17 +2686,15 @@ class bo {
2095
2686
  return Array.from(this.views.values());
2096
2687
  }
2097
2688
  updateView(t, i) {
2098
- const n = this.getViewById(t), o = { ...n.viewerConfig, ...i };
2099
- if (pi(n.viewerConfig, i)) {
2100
- n.destroy();
2101
- const a = document.getElementById(t);
2102
- this.init(a, o);
2103
- } else
2104
- n.update(o);
2105
- return n;
2689
+ const n = this.getViewById(t);
2690
+ if (!n) return null;
2691
+ const o = { ...n.viewerConfig, ...i };
2692
+ n.destroy();
2693
+ const s = document.getElementById(t);
2694
+ return this.init(s, o);
2106
2695
  }
2107
2696
  }
2108
- window.CI360 = bo;
2697
+ window.CI360 = Jo;
2109
2698
  export {
2110
- bo as default
2699
+ Jo as default
2111
2700
  };