viewerjs 1.11.6 → 1.11.7

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,15 +1,37 @@
1
1
  /*!
2
- * Viewer.js v1.11.6
2
+ * Viewer.js v1.11.7
3
3
  * https://fengyuanchen.github.io/viewerjs
4
4
  *
5
5
  * Copyright 2015-present Chen Fengyuan
6
6
  * Released under the MIT license
7
7
  *
8
- * Date: 2023-09-17T03:16:38.052Z
8
+ * Date: 2024-11-24T04:32:19.116Z
9
9
  */
10
10
 
11
11
  'use strict';
12
12
 
13
+ function _classCallCheck(a, n) {
14
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
15
+ }
16
+ function _defineProperties(e, r) {
17
+ for (var t = 0; t < r.length; t++) {
18
+ var o = r[t];
19
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
20
+ }
21
+ }
22
+ function _createClass(e, r, t) {
23
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
24
+ writable: !1
25
+ }), e;
26
+ }
27
+ function _defineProperty(e, r, t) {
28
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
29
+ value: t,
30
+ enumerable: !0,
31
+ configurable: !0,
32
+ writable: !0
33
+ }) : e[r] = t, e;
34
+ }
13
35
  function ownKeys(e, r) {
14
36
  var t = Object.keys(e);
15
37
  if (Object.getOwnPropertySymbols) {
@@ -31,6 +53,20 @@ function _objectSpread2(e) {
31
53
  }
32
54
  return e;
33
55
  }
56
+ function _toPrimitive(t, r) {
57
+ if ("object" != typeof t || !t) return t;
58
+ var e = t[Symbol.toPrimitive];
59
+ if (void 0 !== e) {
60
+ var i = e.call(t, r || "default");
61
+ if ("object" != typeof i) return i;
62
+ throw new TypeError("@@toPrimitive must return a primitive value.");
63
+ }
64
+ return ("string" === r ? String : Number)(t);
65
+ }
66
+ function _toPropertyKey(t) {
67
+ var i = _toPrimitive(t, "string");
68
+ return "symbol" == typeof i ? i : i + "";
69
+ }
34
70
  function _typeof(o) {
35
71
  "@babel/helpers - typeof";
36
72
 
@@ -40,56 +76,6 @@ function _typeof(o) {
40
76
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
41
77
  }, _typeof(o);
42
78
  }
43
- function _classCallCheck(instance, Constructor) {
44
- if (!(instance instanceof Constructor)) {
45
- throw new TypeError("Cannot call a class as a function");
46
- }
47
- }
48
- function _defineProperties(target, props) {
49
- for (var i = 0; i < props.length; i++) {
50
- var descriptor = props[i];
51
- descriptor.enumerable = descriptor.enumerable || false;
52
- descriptor.configurable = true;
53
- if ("value" in descriptor) descriptor.writable = true;
54
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
55
- }
56
- }
57
- function _createClass(Constructor, protoProps, staticProps) {
58
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
59
- if (staticProps) _defineProperties(Constructor, staticProps);
60
- Object.defineProperty(Constructor, "prototype", {
61
- writable: false
62
- });
63
- return Constructor;
64
- }
65
- function _defineProperty(obj, key, value) {
66
- key = _toPropertyKey(key);
67
- if (key in obj) {
68
- Object.defineProperty(obj, key, {
69
- value: value,
70
- enumerable: true,
71
- configurable: true,
72
- writable: true
73
- });
74
- } else {
75
- obj[key] = value;
76
- }
77
- return obj;
78
- }
79
- function _toPrimitive(input, hint) {
80
- if (typeof input !== "object" || input === null) return input;
81
- var prim = input[Symbol.toPrimitive];
82
- if (prim !== undefined) {
83
- var res = prim.call(input, hint || "default");
84
- if (typeof res !== "object") return res;
85
- throw new TypeError("@@toPrimitive must return a primitive value.");
86
- }
87
- return (hint === "string" ? String : Number)(input);
88
- }
89
- function _toPropertyKey(arg) {
90
- var key = _toPrimitive(arg, "string");
91
- return typeof key === "symbol" ? key : String(key);
92
- }
93
79
 
94
80
  var DEFAULTS = {
95
81
  /**
@@ -1762,17 +1748,17 @@ var methods = {
1762
1748
  _this.hidden();
1763
1749
  };
1764
1750
  if (options.transition && !immediate) {
1765
- var onViewerTransitionEnd = function onViewerTransitionEnd(event) {
1751
+ var _onViewerTransitionEnd = function onViewerTransitionEnd(event) {
1766
1752
  // Ignore all propagating `transitionend` events (#275).
1767
1753
  if (event && event.target === viewer) {
1768
- removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1754
+ removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1769
1755
  _this.hidden();
1770
1756
  }
1771
1757
  };
1772
1758
  var onImageTransitionEnd = function onImageTransitionEnd() {
1773
1759
  // In case of show the viewer by `viewer.show(true)` previously (#407).
1774
1760
  if (hasClass(viewer, CLASS_TRANSITION)) {
1775
- addListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1761
+ addListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1776
1762
  removeClass(viewer, CLASS_IN);
1777
1763
  } else {
1778
1764
  hideImmediately();
@@ -1783,7 +1769,7 @@ var methods = {
1783
1769
  if (_this.viewed && hasClass(image, CLASS_TRANSITION)) {
1784
1770
  removeListener(image, EVENT_TRANSITION_END, onImageTransitionEnd);
1785
1771
  } else if (hasClass(viewer, CLASS_TRANSITION)) {
1786
- removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1772
+ removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1787
1773
  }
1788
1774
  }
1789
1775
  };
@@ -2376,27 +2362,27 @@ var methods = {
2376
2362
  player.appendChild(image);
2377
2363
  });
2378
2364
  if (isNumber(options.interval) && options.interval > 0) {
2379
- var prev = function prev() {
2365
+ var _prev = function prev() {
2380
2366
  clearTimeout(_this7.playing.timeout);
2381
2367
  removeClass(list[index], CLASS_IN);
2382
2368
  index -= 1;
2383
2369
  index = index >= 0 ? index : total - 1;
2384
2370
  addClass(list[index], CLASS_IN);
2385
- _this7.playing.timeout = setTimeout(prev, options.interval);
2371
+ _this7.playing.timeout = setTimeout(_prev, options.interval);
2386
2372
  };
2387
- var next = function next() {
2373
+ var _next = function next() {
2388
2374
  clearTimeout(_this7.playing.timeout);
2389
2375
  removeClass(list[index], CLASS_IN);
2390
2376
  index += 1;
2391
2377
  index = index < total ? index : 0;
2392
2378
  addClass(list[index], CLASS_IN);
2393
- _this7.playing.timeout = setTimeout(next, options.interval);
2379
+ _this7.playing.timeout = setTimeout(_next, options.interval);
2394
2380
  };
2395
2381
  if (total > 1) {
2396
2382
  this.playing = {
2397
- prev: prev,
2398
- next: next,
2399
- timeout: setTimeout(next, options.interval)
2383
+ prev: _prev,
2384
+ next: _next,
2385
+ timeout: setTimeout(_next, options.interval)
2400
2386
  };
2401
2387
  }
2402
2388
  }
@@ -2968,7 +2954,7 @@ var Viewer = /*#__PURE__*/function () {
2968
2954
  this.id = getUniqueID();
2969
2955
  this.init();
2970
2956
  }
2971
- _createClass(Viewer, [{
2957
+ return _createClass(Viewer, [{
2972
2958
  key: "init",
2973
2959
  value: function init() {
2974
2960
  var _this = this;
@@ -3230,7 +3216,6 @@ var Viewer = /*#__PURE__*/function () {
3230
3216
  assign(DEFAULTS, isPlainObject(options) && options);
3231
3217
  }
3232
3218
  }]);
3233
- return Viewer;
3234
3219
  }();
3235
3220
  assign(Viewer.prototype, render, events, handlers, methods, others);
3236
3221
 
package/dist/viewer.css CHANGED
@@ -1,15 +1,15 @@
1
1
  /*!
2
- * Viewer.js v1.11.6
2
+ * Viewer.js v1.11.7
3
3
  * https://fengyuanchen.github.io/viewerjs
4
4
  *
5
5
  * Copyright 2015-present Chen Fengyuan
6
6
  * Released under the MIT license
7
7
  *
8
- * Date: 2023-09-17T03:16:35.830Z
8
+ * Date: 2024-11-24T04:32:14.526Z
9
9
  */
10
10
 
11
11
  .viewer-zoom-in::before, .viewer-zoom-out::before, .viewer-one-to-one::before, .viewer-reset::before, .viewer-prev::before, .viewer-play::before, .viewer-next::before, .viewer-rotate-left::before, .viewer-rotate-right::before, .viewer-flip-horizontal::before, .viewer-flip-vertical::before, .viewer-fullscreen::before, .viewer-fullscreen-exit::before, .viewer-close::before {
12
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAAUCAYAAABWOyJDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAQPSURBVHic7Zs/iFxVFMa/0U2UaJGksUgnIVhYxVhpjDbZCBmLdAYECxsRFBTUamcXUiSNncgKQbSxsxH8gzAP3FU2jY0kKKJNiiiIghFlccnP4p3nPCdv3p9778vsLOcHB2bfveeb7955c3jvvNkBIMdxnD64a94GHMfZu3iBcRynN7zAOI7TG15gHCeeNUkr8zaxG2lbYDYsdgMbktBsP03jdQwljSXdtBhLOmtjowC9Mg9L+knSlcD8TNKpSA9lBpK2JF2VdDSR5n5J64m0qli399hNFMUlpshQii5jbXTbHGviB0nLNeNDSd9VO4A2UdB2fp+x0eCnaXxWXGA2X0au/3HgN9P4LFCjIANOJdrLr0zzZ+BEpNYDwKbpnQMeAw4m8HjQtM6Z9qa917zPQwFr3M5KgA6J5rTJCdFZJj9/lyvGhsDvwFNVuV2MhhjrK6b9bFiE+j1r87eBl4HDwCF7/U/k+ofAX5b/EXBv5JoLMuILzf3Ap6Z3EzgdqHMCuF7hcQf4HDgeoHnccncqdK/TvSDWffFXI/exICY/xZyqc6XLWF1UFZna4gJ7q8BsRvgd2/xXpo6P+D9dfT7PpECtA3cnWPM0GXGFZh/wgWltA+cDNC7X+AP4GzjZQe+k5dRxuYPeiuXU7e1qwLpDz7dFjXKRaSwuMLvAlG8zZlG+YmiK1HoFqT7wP2z+4Q45TfEGcMt01xLoNZEBTwRqD4BLpnMLeC1A41UmVxsXgXeBayV/Wx20rpTyrpnWRft7p6O/FdqzGrDukPNtkaMoMo3FBdBSQMOnYBCReyf05s126fU9ytfX98+mY54Kxnp7S9K3kj6U9KYdG0h6UdLbkh7poFXMfUnSOyVvL0h6VtIXHbS6nOP+s/Zm9mvyXW1uuC9ohZ72E9uDmXWLJOB1GxsH+DxPftsB8B6wlGDN02TAkxG6+4D3TWsbeC5CS8CDFce+AW500LhhOW2020TRjK3b21HEmgti9m0RonxbdMZeVzV+/4tF3cBpP7E9mKHNL5q8h5g0eYsCMQz0epq8gQrwMXAgcs0FGXGFRcB9wCemF9PkbYqM/Bas7fxLwNeJPdTdpo4itQti8lPMqTpXuozVRVXPpbHI3KkNTB1NfkL81j2mvhDp91HgV9MKuRIqrykj3WPq4rHyL+axj8/qGPmTqi6F9YDlHOvJU6oYcTsh/TYSzWmTE6JT19CtLTJt32D6CmHe0eQn1O8z5AXgT4sx4Vcu0/EQecMydB8z0hUWkTd2t4CrwNEePqMBcAR4mrBbwyXLPWJa8zrXmmLEhNBmfpkuY2102xxrih+pb+ieAb6vGhuA97UcJ5KR8gZ77K+99xxeYBzH6Q3/Z0fHcXrDC4zjOL3hBcZxnN74F+zlvXFWXF9PAAAAAElFTkSuQmCC');
12
+ background-image: url("data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 viewBox%3D%220 0 560 40%22%3E%3Cpath fill%3D%22%23fff%22 d%3D%22M49.6 17.9h20.2v3.9H49.6zm123.1 2 10.9-11 2.7 2.8-8.2 8.2 8.2 8.2-2.7 2.7-10.9-10.9zm94 0-10.8-11-2.7 2.8 8.1 8.2-8.1 8.2 2.7 2.7 10.8-10.9zM212 9.3l20.1 10.6L212 30.5V9.3zm161.5 4.6-7.2 6 7.2 5.9v-4h12.4v4l7.3-5.9-7.3-6v4h-12.4v-4zm40.2 12.3 5.9 7.2 5.9-7.2h-4V13.6h4l-5.9-7.3-5.9 7.3h4v12.6h-4zm35.9-16.5h6.3v2h-4.3V16h-2V9.7Zm14 0h6.2V16h-2v-4.3h-4.2v-2Zm6.2 14V30h-6.2v-2h4.2v-4.3h2Zm-14 6.3h-6.2v-6.3h2v4.4h4.3v2Zm-438 .1v-8.3H9.6v-3.9h8.2V9.7h3.9v8.2h8.1v3.9h-8.1v8.3h-3.9zM93.6 9.7h-5.8v3.9h2V30h3.8V9.7zm16.1 0h-5.8v3.9h1.9V30h3.9V9.7zm-11.9 4.1h3.9v3.9h-3.9zm0 8.2h3.9v3.9h-3.9zm244.6-11.7 7.2 5.9-7.2 6v-3.6c-5.4-.4-7.8.8-8.7 2.8-.8 1.7-1.8 4.9 2.8 8.2-6.3-2-7.5-6.9-6-11.3 1.6-4.4 8-5 11.9-4.9v-3.1Zm147.2 13.4h6.3V30h-2v-4.3h-4.3v-2zm14 6.3v-6.3h6.2v2h-4.3V30h-1.9zm6.2-14h-6.2V9.7h1.9V14h4.3v2zm-13.9 0h-6.3v-2h4.3V9.7h2V16zm33.3 12.5 8.6-8.6-8.6-8.7 1.9-1.9 8.6 8.7 8.6-8.7 1.9 1.9-8.6 8.7 8.6 8.6-1.9 2-8.6-8.7-8.6 8.7-1.9-2zM297 10.3l-7.1 5.9 7.2 6v-3.6c5.3-.4 7.7.8 8.7 2.8.8 1.7 1.7 4.9-2.9 8.2 6.3-2 7.5-6.9 6-11.3-1.6-4.4-7.9-5-11.8-4.9v-3.1Zm-157.3-.6c2.3 0 4.4.7 6 2l2.5-3 1.9 9.2h-9.3l2.6-3.1a6.2 6.2 0 0 0-9.9 5.1c0 3.4 2.8 6.3 6.2 6.3 2.8 0 5.1-1.9 6-4.4h4c-1 4.7-5 8.3-10 8.3a10 10 0 0 1-10-10.2 10 10 0 0 1 10-10.2Z%22%2F%3E%3C%2Fsvg%3E");
13
13
  background-repeat: no-repeat;
14
14
  background-size: 280px;
15
15
  color: transparent;
@@ -1,13 +1,35 @@
1
1
  /*!
2
- * Viewer.js v1.11.6
2
+ * Viewer.js v1.11.7
3
3
  * https://fengyuanchen.github.io/viewerjs
4
4
  *
5
5
  * Copyright 2015-present Chen Fengyuan
6
6
  * Released under the MIT license
7
7
  *
8
- * Date: 2023-09-17T03:16:38.052Z
8
+ * Date: 2024-11-24T04:32:19.116Z
9
9
  */
10
10
 
11
+ function _classCallCheck(a, n) {
12
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
13
+ }
14
+ function _defineProperties(e, r) {
15
+ for (var t = 0; t < r.length; t++) {
16
+ var o = r[t];
17
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
18
+ }
19
+ }
20
+ function _createClass(e, r, t) {
21
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
22
+ writable: !1
23
+ }), e;
24
+ }
25
+ function _defineProperty(e, r, t) {
26
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
27
+ value: t,
28
+ enumerable: !0,
29
+ configurable: !0,
30
+ writable: !0
31
+ }) : e[r] = t, e;
32
+ }
11
33
  function ownKeys(e, r) {
12
34
  var t = Object.keys(e);
13
35
  if (Object.getOwnPropertySymbols) {
@@ -29,6 +51,20 @@ function _objectSpread2(e) {
29
51
  }
30
52
  return e;
31
53
  }
54
+ function _toPrimitive(t, r) {
55
+ if ("object" != typeof t || !t) return t;
56
+ var e = t[Symbol.toPrimitive];
57
+ if (void 0 !== e) {
58
+ var i = e.call(t, r || "default");
59
+ if ("object" != typeof i) return i;
60
+ throw new TypeError("@@toPrimitive must return a primitive value.");
61
+ }
62
+ return ("string" === r ? String : Number)(t);
63
+ }
64
+ function _toPropertyKey(t) {
65
+ var i = _toPrimitive(t, "string");
66
+ return "symbol" == typeof i ? i : i + "";
67
+ }
32
68
  function _typeof(o) {
33
69
  "@babel/helpers - typeof";
34
70
 
@@ -38,56 +74,6 @@ function _typeof(o) {
38
74
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
39
75
  }, _typeof(o);
40
76
  }
41
- function _classCallCheck(instance, Constructor) {
42
- if (!(instance instanceof Constructor)) {
43
- throw new TypeError("Cannot call a class as a function");
44
- }
45
- }
46
- function _defineProperties(target, props) {
47
- for (var i = 0; i < props.length; i++) {
48
- var descriptor = props[i];
49
- descriptor.enumerable = descriptor.enumerable || false;
50
- descriptor.configurable = true;
51
- if ("value" in descriptor) descriptor.writable = true;
52
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
53
- }
54
- }
55
- function _createClass(Constructor, protoProps, staticProps) {
56
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
57
- if (staticProps) _defineProperties(Constructor, staticProps);
58
- Object.defineProperty(Constructor, "prototype", {
59
- writable: false
60
- });
61
- return Constructor;
62
- }
63
- function _defineProperty(obj, key, value) {
64
- key = _toPropertyKey(key);
65
- if (key in obj) {
66
- Object.defineProperty(obj, key, {
67
- value: value,
68
- enumerable: true,
69
- configurable: true,
70
- writable: true
71
- });
72
- } else {
73
- obj[key] = value;
74
- }
75
- return obj;
76
- }
77
- function _toPrimitive(input, hint) {
78
- if (typeof input !== "object" || input === null) return input;
79
- var prim = input[Symbol.toPrimitive];
80
- if (prim !== undefined) {
81
- var res = prim.call(input, hint || "default");
82
- if (typeof res !== "object") return res;
83
- throw new TypeError("@@toPrimitive must return a primitive value.");
84
- }
85
- return (hint === "string" ? String : Number)(input);
86
- }
87
- function _toPropertyKey(arg) {
88
- var key = _toPrimitive(arg, "string");
89
- return typeof key === "symbol" ? key : String(key);
90
- }
91
77
 
92
78
  var DEFAULTS = {
93
79
  /**
@@ -1760,17 +1746,17 @@ var methods = {
1760
1746
  _this.hidden();
1761
1747
  };
1762
1748
  if (options.transition && !immediate) {
1763
- var onViewerTransitionEnd = function onViewerTransitionEnd(event) {
1749
+ var _onViewerTransitionEnd = function onViewerTransitionEnd(event) {
1764
1750
  // Ignore all propagating `transitionend` events (#275).
1765
1751
  if (event && event.target === viewer) {
1766
- removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1752
+ removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1767
1753
  _this.hidden();
1768
1754
  }
1769
1755
  };
1770
1756
  var onImageTransitionEnd = function onImageTransitionEnd() {
1771
1757
  // In case of show the viewer by `viewer.show(true)` previously (#407).
1772
1758
  if (hasClass(viewer, CLASS_TRANSITION)) {
1773
- addListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1759
+ addListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1774
1760
  removeClass(viewer, CLASS_IN);
1775
1761
  } else {
1776
1762
  hideImmediately();
@@ -1781,7 +1767,7 @@ var methods = {
1781
1767
  if (_this.viewed && hasClass(image, CLASS_TRANSITION)) {
1782
1768
  removeListener(image, EVENT_TRANSITION_END, onImageTransitionEnd);
1783
1769
  } else if (hasClass(viewer, CLASS_TRANSITION)) {
1784
- removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1770
+ removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1785
1771
  }
1786
1772
  }
1787
1773
  };
@@ -2374,27 +2360,27 @@ var methods = {
2374
2360
  player.appendChild(image);
2375
2361
  });
2376
2362
  if (isNumber(options.interval) && options.interval > 0) {
2377
- var prev = function prev() {
2363
+ var _prev = function prev() {
2378
2364
  clearTimeout(_this7.playing.timeout);
2379
2365
  removeClass(list[index], CLASS_IN);
2380
2366
  index -= 1;
2381
2367
  index = index >= 0 ? index : total - 1;
2382
2368
  addClass(list[index], CLASS_IN);
2383
- _this7.playing.timeout = setTimeout(prev, options.interval);
2369
+ _this7.playing.timeout = setTimeout(_prev, options.interval);
2384
2370
  };
2385
- var next = function next() {
2371
+ var _next = function next() {
2386
2372
  clearTimeout(_this7.playing.timeout);
2387
2373
  removeClass(list[index], CLASS_IN);
2388
2374
  index += 1;
2389
2375
  index = index < total ? index : 0;
2390
2376
  addClass(list[index], CLASS_IN);
2391
- _this7.playing.timeout = setTimeout(next, options.interval);
2377
+ _this7.playing.timeout = setTimeout(_next, options.interval);
2392
2378
  };
2393
2379
  if (total > 1) {
2394
2380
  this.playing = {
2395
- prev: prev,
2396
- next: next,
2397
- timeout: setTimeout(next, options.interval)
2381
+ prev: _prev,
2382
+ next: _next,
2383
+ timeout: setTimeout(_next, options.interval)
2398
2384
  };
2399
2385
  }
2400
2386
  }
@@ -2966,7 +2952,7 @@ var Viewer = /*#__PURE__*/function () {
2966
2952
  this.id = getUniqueID();
2967
2953
  this.init();
2968
2954
  }
2969
- _createClass(Viewer, [{
2955
+ return _createClass(Viewer, [{
2970
2956
  key: "init",
2971
2957
  value: function init() {
2972
2958
  var _this = this;
@@ -3228,7 +3214,6 @@ var Viewer = /*#__PURE__*/function () {
3228
3214
  assign(DEFAULTS, isPlainObject(options) && options);
3229
3215
  }
3230
3216
  }]);
3231
- return Viewer;
3232
3217
  }();
3233
3218
  assign(Viewer.prototype, render, events, handlers, methods, others);
3234
3219
 
package/dist/viewer.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Viewer.js v1.11.6
2
+ * Viewer.js v1.11.7
3
3
  * https://fengyuanchen.github.io/viewerjs
4
4
  *
5
5
  * Copyright 2015-present Chen Fengyuan
6
6
  * Released under the MIT license
7
7
  *
8
- * Date: 2023-09-17T03:16:38.052Z
8
+ * Date: 2024-11-24T04:32:19.116Z
9
9
  */
10
10
 
11
11
  (function (global, factory) {
@@ -14,6 +14,28 @@
14
14
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Viewer = factory());
15
15
  })(this, (function () { 'use strict';
16
16
 
17
+ function _classCallCheck(a, n) {
18
+ if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
19
+ }
20
+ function _defineProperties(e, r) {
21
+ for (var t = 0; t < r.length; t++) {
22
+ var o = r[t];
23
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
24
+ }
25
+ }
26
+ function _createClass(e, r, t) {
27
+ return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
28
+ writable: !1
29
+ }), e;
30
+ }
31
+ function _defineProperty(e, r, t) {
32
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
33
+ value: t,
34
+ enumerable: !0,
35
+ configurable: !0,
36
+ writable: !0
37
+ }) : e[r] = t, e;
38
+ }
17
39
  function ownKeys(e, r) {
18
40
  var t = Object.keys(e);
19
41
  if (Object.getOwnPropertySymbols) {
@@ -35,6 +57,20 @@
35
57
  }
36
58
  return e;
37
59
  }
60
+ function _toPrimitive(t, r) {
61
+ if ("object" != typeof t || !t) return t;
62
+ var e = t[Symbol.toPrimitive];
63
+ if (void 0 !== e) {
64
+ var i = e.call(t, r || "default");
65
+ if ("object" != typeof i) return i;
66
+ throw new TypeError("@@toPrimitive must return a primitive value.");
67
+ }
68
+ return ("string" === r ? String : Number)(t);
69
+ }
70
+ function _toPropertyKey(t) {
71
+ var i = _toPrimitive(t, "string");
72
+ return "symbol" == typeof i ? i : i + "";
73
+ }
38
74
  function _typeof(o) {
39
75
  "@babel/helpers - typeof";
40
76
 
@@ -44,56 +80,6 @@
44
80
  return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
45
81
  }, _typeof(o);
46
82
  }
47
- function _classCallCheck(instance, Constructor) {
48
- if (!(instance instanceof Constructor)) {
49
- throw new TypeError("Cannot call a class as a function");
50
- }
51
- }
52
- function _defineProperties(target, props) {
53
- for (var i = 0; i < props.length; i++) {
54
- var descriptor = props[i];
55
- descriptor.enumerable = descriptor.enumerable || false;
56
- descriptor.configurable = true;
57
- if ("value" in descriptor) descriptor.writable = true;
58
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
59
- }
60
- }
61
- function _createClass(Constructor, protoProps, staticProps) {
62
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
63
- if (staticProps) _defineProperties(Constructor, staticProps);
64
- Object.defineProperty(Constructor, "prototype", {
65
- writable: false
66
- });
67
- return Constructor;
68
- }
69
- function _defineProperty(obj, key, value) {
70
- key = _toPropertyKey(key);
71
- if (key in obj) {
72
- Object.defineProperty(obj, key, {
73
- value: value,
74
- enumerable: true,
75
- configurable: true,
76
- writable: true
77
- });
78
- } else {
79
- obj[key] = value;
80
- }
81
- return obj;
82
- }
83
- function _toPrimitive(input, hint) {
84
- if (typeof input !== "object" || input === null) return input;
85
- var prim = input[Symbol.toPrimitive];
86
- if (prim !== undefined) {
87
- var res = prim.call(input, hint || "default");
88
- if (typeof res !== "object") return res;
89
- throw new TypeError("@@toPrimitive must return a primitive value.");
90
- }
91
- return (hint === "string" ? String : Number)(input);
92
- }
93
- function _toPropertyKey(arg) {
94
- var key = _toPrimitive(arg, "string");
95
- return typeof key === "symbol" ? key : String(key);
96
- }
97
83
 
98
84
  var DEFAULTS = {
99
85
  /**
@@ -1766,17 +1752,17 @@
1766
1752
  _this.hidden();
1767
1753
  };
1768
1754
  if (options.transition && !immediate) {
1769
- var onViewerTransitionEnd = function onViewerTransitionEnd(event) {
1755
+ var _onViewerTransitionEnd = function onViewerTransitionEnd(event) {
1770
1756
  // Ignore all propagating `transitionend` events (#275).
1771
1757
  if (event && event.target === viewer) {
1772
- removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1758
+ removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1773
1759
  _this.hidden();
1774
1760
  }
1775
1761
  };
1776
1762
  var onImageTransitionEnd = function onImageTransitionEnd() {
1777
1763
  // In case of show the viewer by `viewer.show(true)` previously (#407).
1778
1764
  if (hasClass(viewer, CLASS_TRANSITION)) {
1779
- addListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1765
+ addListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1780
1766
  removeClass(viewer, CLASS_IN);
1781
1767
  } else {
1782
1768
  hideImmediately();
@@ -1787,7 +1773,7 @@
1787
1773
  if (_this.viewed && hasClass(image, CLASS_TRANSITION)) {
1788
1774
  removeListener(image, EVENT_TRANSITION_END, onImageTransitionEnd);
1789
1775
  } else if (hasClass(viewer, CLASS_TRANSITION)) {
1790
- removeListener(viewer, EVENT_TRANSITION_END, onViewerTransitionEnd);
1776
+ removeListener(viewer, EVENT_TRANSITION_END, _onViewerTransitionEnd);
1791
1777
  }
1792
1778
  }
1793
1779
  };
@@ -2380,27 +2366,27 @@
2380
2366
  player.appendChild(image);
2381
2367
  });
2382
2368
  if (isNumber(options.interval) && options.interval > 0) {
2383
- var prev = function prev() {
2369
+ var _prev = function prev() {
2384
2370
  clearTimeout(_this7.playing.timeout);
2385
2371
  removeClass(list[index], CLASS_IN);
2386
2372
  index -= 1;
2387
2373
  index = index >= 0 ? index : total - 1;
2388
2374
  addClass(list[index], CLASS_IN);
2389
- _this7.playing.timeout = setTimeout(prev, options.interval);
2375
+ _this7.playing.timeout = setTimeout(_prev, options.interval);
2390
2376
  };
2391
- var next = function next() {
2377
+ var _next = function next() {
2392
2378
  clearTimeout(_this7.playing.timeout);
2393
2379
  removeClass(list[index], CLASS_IN);
2394
2380
  index += 1;
2395
2381
  index = index < total ? index : 0;
2396
2382
  addClass(list[index], CLASS_IN);
2397
- _this7.playing.timeout = setTimeout(next, options.interval);
2383
+ _this7.playing.timeout = setTimeout(_next, options.interval);
2398
2384
  };
2399
2385
  if (total > 1) {
2400
2386
  this.playing = {
2401
- prev: prev,
2402
- next: next,
2403
- timeout: setTimeout(next, options.interval)
2387
+ prev: _prev,
2388
+ next: _next,
2389
+ timeout: setTimeout(_next, options.interval)
2404
2390
  };
2405
2391
  }
2406
2392
  }
@@ -2972,7 +2958,7 @@
2972
2958
  this.id = getUniqueID();
2973
2959
  this.init();
2974
2960
  }
2975
- _createClass(Viewer, [{
2961
+ return _createClass(Viewer, [{
2976
2962
  key: "init",
2977
2963
  value: function init() {
2978
2964
  var _this = this;
@@ -3234,7 +3220,6 @@
3234
3220
  assign(DEFAULTS, isPlainObject(options) && options);
3235
3221
  }
3236
3222
  }]);
3237
- return Viewer;
3238
3223
  }();
3239
3224
  assign(Viewer.prototype, render, events, handlers, methods, others);
3240
3225
 
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * Viewer.js v1.11.6
2
+ * Viewer.js v1.11.7
3
3
  * https://fengyuanchen.github.io/viewerjs
4
4
  *
5
5
  * Copyright 2015-present Chen Fengyuan
6
6
  * Released under the MIT license
7
7
  *
8
- * Date: 2023-09-17T03:16:35.830Z
9
- */.viewer-close:before,.viewer-flip-horizontal:before,.viewer-flip-vertical:before,.viewer-fullscreen-exit:before,.viewer-fullscreen:before,.viewer-next:before,.viewer-one-to-one:before,.viewer-play:before,.viewer-prev:before,.viewer-reset:before,.viewer-rotate-left:before,.viewer-rotate-right:before,.viewer-zoom-in:before,.viewer-zoom-out:before{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARgAAAAUCAYAAABWOyJDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAQPSURBVHic7Zs/iFxVFMa/0U2UaJGksUgnIVhYxVhpjDbZCBmLdAYECxsRFBTUamcXUiSNncgKQbSxsxH8gzAP3FU2jY0kKKJNiiiIghFlccnP4p3nPCdv3p9778vsLOcHB2bfveeb7955c3jvvNkBIMdxnD64a94GHMfZu3iBcRynN7zAOI7TG15gHCeeNUkr8zaxG2lbYDYsdgMbktBsP03jdQwljSXdtBhLOmtjowC9Mg9L+knSlcD8TNKpSA9lBpK2JF2VdDSR5n5J64m0qli399hNFMUlpshQii5jbXTbHGviB0nLNeNDSd9VO4A2UdB2fp+x0eCnaXxWXGA2X0au/3HgN9P4LFCjIANOJdrLr0zzZ+BEpNYDwKbpnQMeAw4m8HjQtM6Z9qa917zPQwFr3M5KgA6J5rTJCdFZJj9/lyvGhsDvwFNVuV2MhhjrK6b9bFiE+j1r87eBl4HDwCF7/U/k+ofAX5b/EXBv5JoLMuILzf3Ap6Z3EzgdqHMCuF7hcQf4HDgeoHnccncqdK/TvSDWffFXI/exICY/xZyqc6XLWF1UFZna4gJ7q8BsRvgd2/xXpo6P+D9dfT7PpECtA3cnWPM0GXGFZh/wgWltA+cDNC7X+AP4GzjZQe+k5dRxuYPeiuXU7e1qwLpDz7dFjXKRaSwuMLvAlG8zZlG+YmiK1HoFqT7wP2z+4Q45TfEGcMt01xLoNZEBTwRqD4BLpnMLeC1A41UmVxsXgXeBayV/Wx20rpTyrpnWRft7p6O/FdqzGrDukPNtkaMoMo3FBdBSQMOnYBCReyf05s126fU9ytfX98+mY54Kxnp7S9K3kj6U9KYdG0h6UdLbkh7poFXMfUnSOyVvL0h6VtIXHbS6nOP+s/Zm9mvyXW1uuC9ohZ72E9uDmXWLJOB1GxsH+DxPftsB8B6wlGDN02TAkxG6+4D3TWsbeC5CS8CDFce+AW500LhhOW2020TRjK3b21HEmgti9m0RonxbdMZeVzV+/4tF3cBpP7E9mKHNL5q8h5g0eYsCMQz0epq8gQrwMXAgcs0FGXGFRcB9wCemF9PkbYqM/Bas7fxLwNeJPdTdpo4itQti8lPMqTpXuozVRVXPpbHI3KkNTB1NfkL81j2mvhDp91HgV9MKuRIqrykj3WPq4rHyL+axj8/qGPmTqi6F9YDlHOvJU6oYcTsh/TYSzWmTE6JT19CtLTJt32D6CmHe0eQn1O8z5AXgT4sx4Vcu0/EQecMydB8z0hUWkTd2t4CrwNEePqMBcAR4mrBbwyXLPWJa8zrXmmLEhNBmfpkuY2102xxrih+pb+ieAb6vGhuA97UcJ5KR8gZ77K+99xxeYBzH6Q3/Z0fHcXrDC4zjOL3hBcZxnN74F+zlvXFWXF9PAAAAAElFTkSuQmCC");background-repeat:no-repeat;background-size:280px;color:transparent;display:block;font-size:0;height:20px;line-height:0;width:20px}.viewer-zoom-in:before{background-position:0 0;content:"Zoom In"}.viewer-zoom-out:before{background-position:-20px 0;content:"Zoom Out"}.viewer-one-to-one:before{background-position:-40px 0;content:"One to One"}.viewer-reset:before{background-position:-60px 0;content:"Reset"}.viewer-prev:before{background-position:-80px 0;content:"Previous"}.viewer-play:before{background-position:-100px 0;content:"Play"}.viewer-next:before{background-position:-120px 0;content:"Next"}.viewer-rotate-left:before{background-position:-140px 0;content:"Rotate Left"}.viewer-rotate-right:before{background-position:-160px 0;content:"Rotate Right"}.viewer-flip-horizontal:before{background-position:-180px 0;content:"Flip Horizontal"}.viewer-flip-vertical:before{background-position:-200px 0;content:"Flip Vertical"}.viewer-fullscreen:before{background-position:-220px 0;content:"Enter Full Screen"}.viewer-fullscreen-exit:before{background-position:-240px 0;content:"Exit Full Screen"}.viewer-close:before{background-position:-260px 0;content:"Close"}.viewer-container{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;bottom:0;direction:ltr;font-size:0;left:0;line-height:0;overflow:hidden;position:absolute;right:0;top:0;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.viewer-container ::-moz-selection,.viewer-container::-moz-selection{background-color:transparent}.viewer-container ::selection,.viewer-container::selection{background-color:transparent}.viewer-container:focus{outline:0}.viewer-container img{display:block;height:auto;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.viewer-canvas{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.viewer-canvas>img{height:auto;margin:15px auto;max-width:90%!important;width:auto}.viewer-footer{bottom:0;left:0;overflow:hidden;position:absolute;right:0;text-align:center}.viewer-navbar{background-color:rgba(0,0,0,.5);overflow:hidden}.viewer-list{box-sizing:content-box;height:50px;margin:0;overflow:hidden;padding:1px 0}.viewer-list>li{color:transparent;cursor:pointer;float:left;font-size:0;height:50px;line-height:0;opacity:.5;overflow:hidden;transition:opacity .15s;width:30px}.viewer-list>li:focus,.viewer-list>li:hover{opacity:.75}.viewer-list>li:focus{outline:0}.viewer-list>li+li{margin-left:1px}.viewer-list>.viewer-loading{position:relative}.viewer-list>.viewer-loading:after{border-width:2px;height:20px;margin-left:-10px;margin-top:-10px;width:20px}.viewer-list>.viewer-active,.viewer-list>.viewer-active:focus,.viewer-list>.viewer-active:hover{opacity:1}.viewer-player{background-color:#000;bottom:0;cursor:none;display:none;right:0;z-index:1}.viewer-player,.viewer-player>img{left:0;position:absolute;top:0}.viewer-toolbar>ul{display:inline-block;margin:0 auto 5px;overflow:hidden;padding:6px 3px}.viewer-toolbar>ul>li{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;float:left;height:24px;overflow:hidden;transition:background-color .15s;width:24px}.viewer-toolbar>ul>li:focus,.viewer-toolbar>ul>li:hover{background-color:rgba(0,0,0,.8)}.viewer-toolbar>ul>li:focus{box-shadow:0 0 3px #fff;outline:0;position:relative;z-index:1}.viewer-toolbar>ul>li:before{margin:2px}.viewer-toolbar>ul>li+li{margin-left:1px}.viewer-toolbar>ul>.viewer-small{height:18px;margin-bottom:3px;margin-top:3px;width:18px}.viewer-toolbar>ul>.viewer-small:before{margin:-1px}.viewer-toolbar>ul>.viewer-large{height:30px;margin-bottom:-3px;margin-top:-3px;width:30px}.viewer-toolbar>ul>.viewer-large:before{margin:5px}.viewer-tooltip{background-color:rgba(0,0,0,.8);border-radius:10px;color:#fff;display:none;font-size:12px;height:20px;left:50%;line-height:20px;margin-left:-25px;margin-top:-10px;position:absolute;text-align:center;top:50%;width:50px}.viewer-title{color:#ccc;display:inline-block;font-size:12px;line-height:1.2;margin:5px 5%;max-width:90%;min-height:14px;opacity:.8;overflow:hidden;text-overflow:ellipsis;transition:opacity .15s;white-space:nowrap}.viewer-title:hover{opacity:1}.viewer-button{-webkit-app-region:no-drag;background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;height:80px;overflow:hidden;position:absolute;right:-40px;top:-40px;transition:background-color .15s;width:80px}.viewer-button:focus,.viewer-button:hover{background-color:rgba(0,0,0,.8)}.viewer-button:focus{box-shadow:0 0 3px #fff;outline:0}.viewer-button:before{bottom:15px;left:15px;position:absolute}.viewer-fixed{position:fixed}.viewer-open{overflow:hidden}.viewer-show{display:block}.viewer-hide{display:none}.viewer-backdrop{background-color:rgba(0,0,0,.5)}.viewer-invisible{visibility:hidden}.viewer-move{cursor:move;cursor:grab}.viewer-fade{opacity:0}.viewer-in{opacity:1}.viewer-transition{transition:all .3s}@keyframes viewer-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.viewer-loading:after{animation:viewer-spinner 1s linear infinite;border:4px solid hsla(0,0%,100%,.1);border-left-color:hsla(0,0%,100%,.5);border-radius:50%;content:"";display:inline-block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px;z-index:1}@media (max-width:767px){.viewer-hide-xs-down{display:none}}@media (max-width:991px){.viewer-hide-sm-down{display:none}}@media (max-width:1199px){.viewer-hide-md-down{display:none}}
8
+ * Date: 2024-11-24T04:32:14.526Z
9
+ */.viewer-close:before,.viewer-flip-horizontal:before,.viewer-flip-vertical:before,.viewer-fullscreen-exit:before,.viewer-fullscreen:before,.viewer-next:before,.viewer-one-to-one:before,.viewer-play:before,.viewer-prev:before,.viewer-reset:before,.viewer-rotate-left:before,.viewer-rotate-right:before,.viewer-zoom-in:before,.viewer-zoom-out:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 40'%3E%3Cpath fill='%23fff' d='M49.6 17.9h20.2v3.9H49.6zm123.1 2 10.9-11 2.7 2.8-8.2 8.2 8.2 8.2-2.7 2.7-10.9-10.9zm94 0-10.8-11-2.7 2.8 8.1 8.2-8.1 8.2 2.7 2.7 10.8-10.9zM212 9.3l20.1 10.6L212 30.5V9.3zm161.5 4.6-7.2 6 7.2 5.9v-4h12.4v4l7.3-5.9-7.3-6v4h-12.4v-4zm40.2 12.3 5.9 7.2 5.9-7.2h-4V13.6h4l-5.9-7.3-5.9 7.3h4v12.6h-4zm35.9-16.5h6.3v2h-4.3V16h-2V9.7Zm14 0h6.2V16h-2v-4.3h-4.2v-2Zm6.2 14V30h-6.2v-2h4.2v-4.3h2Zm-14 6.3h-6.2v-6.3h2v4.4h4.3v2Zm-438 .1v-8.3H9.6v-3.9h8.2V9.7h3.9v8.2h8.1v3.9h-8.1v8.3h-3.9zM93.6 9.7h-5.8v3.9h2V30h3.8V9.7zm16.1 0h-5.8v3.9h1.9V30h3.9V9.7zm-11.9 4.1h3.9v3.9h-3.9zm0 8.2h3.9v3.9h-3.9zm244.6-11.7 7.2 5.9-7.2 6v-3.6c-5.4-.4-7.8.8-8.7 2.8-.8 1.7-1.8 4.9 2.8 8.2-6.3-2-7.5-6.9-6-11.3 1.6-4.4 8-5 11.9-4.9v-3.1Zm147.2 13.4h6.3V30h-2v-4.3h-4.3v-2zm14 6.3v-6.3h6.2v2h-4.3V30h-1.9zm6.2-14h-6.2V9.7h1.9V14h4.3v2zm-13.9 0h-6.3v-2h4.3V9.7h2V16zm33.3 12.5 8.6-8.6-8.6-8.7 1.9-1.9 8.6 8.7 8.6-8.7 1.9 1.9-8.6 8.7 8.6 8.6-1.9 2-8.6-8.7-8.6 8.7-1.9-2zM297 10.3l-7.1 5.9 7.2 6v-3.6c5.3-.4 7.7.8 8.7 2.8.8 1.7 1.7 4.9-2.9 8.2 6.3-2 7.5-6.9 6-11.3-1.6-4.4-7.9-5-11.8-4.9v-3.1Zm-157.3-.6c2.3 0 4.4.7 6 2l2.5-3 1.9 9.2h-9.3l2.6-3.1a6.2 6.2 0 0 0-9.9 5.1c0 3.4 2.8 6.3 6.2 6.3 2.8 0 5.1-1.9 6-4.4h4c-1 4.7-5 8.3-10 8.3a10 10 0 0 1-10-10.2 10 10 0 0 1 10-10.2Z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:280px;color:transparent;display:block;font-size:0;height:20px;line-height:0;width:20px}.viewer-zoom-in:before{background-position:0 0;content:"Zoom In"}.viewer-zoom-out:before{background-position:-20px 0;content:"Zoom Out"}.viewer-one-to-one:before{background-position:-40px 0;content:"One to One"}.viewer-reset:before{background-position:-60px 0;content:"Reset"}.viewer-prev:before{background-position:-80px 0;content:"Previous"}.viewer-play:before{background-position:-100px 0;content:"Play"}.viewer-next:before{background-position:-120px 0;content:"Next"}.viewer-rotate-left:before{background-position:-140px 0;content:"Rotate Left"}.viewer-rotate-right:before{background-position:-160px 0;content:"Rotate Right"}.viewer-flip-horizontal:before{background-position:-180px 0;content:"Flip Horizontal"}.viewer-flip-vertical:before{background-position:-200px 0;content:"Flip Vertical"}.viewer-fullscreen:before{background-position:-220px 0;content:"Enter Full Screen"}.viewer-fullscreen-exit:before{background-position:-240px 0;content:"Exit Full Screen"}.viewer-close:before{background-position:-260px 0;content:"Close"}.viewer-container{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;bottom:0;direction:ltr;font-size:0;left:0;line-height:0;overflow:hidden;position:absolute;right:0;top:0;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.viewer-container ::-moz-selection,.viewer-container::-moz-selection{background-color:transparent}.viewer-container ::selection,.viewer-container::selection{background-color:transparent}.viewer-container:focus{outline:0}.viewer-container img{display:block;height:auto;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.viewer-canvas{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.viewer-canvas>img{height:auto;margin:15px auto;max-width:90%!important;width:auto}.viewer-footer{bottom:0;left:0;overflow:hidden;position:absolute;right:0;text-align:center}.viewer-navbar{background-color:rgba(0,0,0,.5);overflow:hidden}.viewer-list{box-sizing:content-box;height:50px;margin:0;overflow:hidden;padding:1px 0}.viewer-list>li{color:transparent;cursor:pointer;float:left;font-size:0;height:50px;line-height:0;opacity:.5;overflow:hidden;transition:opacity .15s;width:30px}.viewer-list>li:focus,.viewer-list>li:hover{opacity:.75}.viewer-list>li:focus{outline:0}.viewer-list>li+li{margin-left:1px}.viewer-list>.viewer-loading{position:relative}.viewer-list>.viewer-loading:after{border-width:2px;height:20px;margin-left:-10px;margin-top:-10px;width:20px}.viewer-list>.viewer-active,.viewer-list>.viewer-active:focus,.viewer-list>.viewer-active:hover{opacity:1}.viewer-player{background-color:#000;bottom:0;cursor:none;display:none;right:0;z-index:1}.viewer-player,.viewer-player>img{left:0;position:absolute;top:0}.viewer-toolbar>ul{display:inline-block;margin:0 auto 5px;overflow:hidden;padding:6px 3px}.viewer-toolbar>ul>li{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;float:left;height:24px;overflow:hidden;transition:background-color .15s;width:24px}.viewer-toolbar>ul>li:focus,.viewer-toolbar>ul>li:hover{background-color:rgba(0,0,0,.8)}.viewer-toolbar>ul>li:focus{box-shadow:0 0 3px #fff;outline:0;position:relative;z-index:1}.viewer-toolbar>ul>li:before{margin:2px}.viewer-toolbar>ul>li+li{margin-left:1px}.viewer-toolbar>ul>.viewer-small{height:18px;margin-bottom:3px;margin-top:3px;width:18px}.viewer-toolbar>ul>.viewer-small:before{margin:-1px}.viewer-toolbar>ul>.viewer-large{height:30px;margin-bottom:-3px;margin-top:-3px;width:30px}.viewer-toolbar>ul>.viewer-large:before{margin:5px}.viewer-tooltip{background-color:rgba(0,0,0,.8);border-radius:10px;color:#fff;display:none;font-size:12px;height:20px;left:50%;line-height:20px;margin-left:-25px;margin-top:-10px;position:absolute;text-align:center;top:50%;width:50px}.viewer-title{color:#ccc;display:inline-block;font-size:12px;line-height:1.2;margin:5px 5%;max-width:90%;min-height:14px;opacity:.8;overflow:hidden;text-overflow:ellipsis;transition:opacity .15s;white-space:nowrap}.viewer-title:hover{opacity:1}.viewer-button{-webkit-app-region:no-drag;background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;height:80px;overflow:hidden;position:absolute;right:-40px;top:-40px;transition:background-color .15s;width:80px}.viewer-button:focus,.viewer-button:hover{background-color:rgba(0,0,0,.8)}.viewer-button:focus{box-shadow:0 0 3px #fff;outline:0}.viewer-button:before{bottom:15px;left:15px;position:absolute}.viewer-fixed{position:fixed}.viewer-open{overflow:hidden}.viewer-show{display:block}.viewer-hide{display:none}.viewer-backdrop{background-color:rgba(0,0,0,.5)}.viewer-invisible{visibility:hidden}.viewer-move{cursor:move;cursor:grab}.viewer-fade{opacity:0}.viewer-in{opacity:1}.viewer-transition{transition:all .3s}@keyframes viewer-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.viewer-loading:after{animation:viewer-spinner 1s linear infinite;border:4px solid hsla(0,0%,100%,.1);border-left-color:hsla(0,0%,100%,.5);border-radius:50%;content:"";display:inline-block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px;z-index:1}@media (max-width:767px){.viewer-hide-xs-down{display:none}}@media (max-width:991px){.viewer-hide-sm-down{display:none}}@media (max-width:1199px){.viewer-hide-md-down{display:none}}
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * Viewer.js v1.11.6
2
+ * Viewer.js v1.11.7
3
3
  * https://fengyuanchen.github.io/viewerjs
4
4
  *
5
5
  * Copyright 2015-present Chen Fengyuan
6
6
  * Released under the MIT license
7
7
  *
8
- * Date: 2023-09-17T03:16:38.052Z
8
+ * Date: 2024-11-24T04:32:19.116Z
9
9
  */
10
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Viewer=e()}(this,function(){"use strict";function s(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function P(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach(function(t){var e,i;e=n,i=o[t=t],(t=l(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);if("object"!=typeof(i=i.call(t,e||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}var W={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},t="undefined"!=typeof window&&void 0!==window.document,e=t?window:{},a=!(!t||!e.document.documentElement)&&"ontouchstart"in e.document.documentElement,i=t&&"PointerEvent"in e,g="viewer",h="move",j="switch",c="zoom",f="".concat(g,"-active"),H="".concat(g,"-close"),B="".concat(g,"-fade"),V="".concat(g,"-fixed"),U="".concat(g,"-fullscreen"),K="".concat(g,"-fullscreen-exit"),v="".concat(g,"-hide"),Z="".concat(g,"-hide-md-down"),$="".concat(g,"-hide-sm-down"),_="".concat(g,"-hide-xs-down"),u="".concat(g,"-in"),p="".concat(g,"-invisible"),b="".concat(g,"-loading"),G="".concat(g,"-move"),J="".concat(g,"-open"),d="".concat(g,"-show"),m="".concat(g,"-transition"),w="click",Q="dblclick",tt="dragstart",et="focusin",it="keydown",y="load",x="error",nt=i?"pointerdown":a?"touchstart":"mousedown",ot=i?"pointermove":a?"touchmove":"mousemove",st=i?"pointerup pointercancel":a?"touchend touchcancel":"mouseup",at="resize",k="transitionend",rt="wheel",z="viewed",lt="rotated",ht="".concat(g,"Action"),ct=/\s\s*/,ut=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function T(t){return"string"==typeof t}var dt=Number.isNaN||e.isNaN;function E(t){return"number"==typeof t&&!dt(t)}function D(t){return void 0===t}function o(t){return"object"===n(t)&&null!==t}var mt=Object.prototype.hasOwnProperty;function S(t){if(!o(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&mt.call(i,"isPrototypeOf")}catch(t){return!1}}function I(t){return"function"==typeof t}function A(e,i){if(e&&I(i))if(Array.isArray(e)||E(e.length))for(var t=e.length,n=0;n<t&&!1!==i.call(e,e[n],n,e);n+=1);else o(e)&&Object.keys(e).forEach(function(t){i.call(e,e[t],t,e)})}var O=Object.assign||function(i){for(var t=arguments.length,e=new Array(1<t?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return o(i)&&0<e.length&&e.forEach(function(e){o(e)&&Object.keys(e).forEach(function(t){i[t]=e[t]})}),i},gt=/^(?:width|height|left|top|marginLeft|marginTop)$/;function C(t,e){var i=t.style;A(e,function(t,e){gt.test(e)&&E(t)&&(t+="px"),i[e]=t})}function L(t,e){return t&&e&&(t.classList?t.classList.contains(e):-1<t.className.indexOf(e))}function R(t,e){var i;t&&e&&(E(t.length)?A(t,function(t){R(t,e)}):t.classList?t.classList.add(e):(i=t.className.trim())?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e)}function M(t,e){t&&e&&(E(t.length)?A(t,function(t){M(t,e)}):t.classList?t.classList.remove(e):0<=t.className.indexOf(e)&&(t.className=t.className.replace(e,"")))}function F(t,e,i){e&&(E(t.length)?A(t,function(t){F(t,e,i)}):(i?R:M)(t,e))}var ft=/([a-z\d])([A-Z])/g;function vt(t){return t.replace(ft,"$1-$2").toLowerCase()}function N(t,e){return o(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(vt(e)))}function pt(t,e,i){o(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(vt(e)),i)}wt=!1,t&&(bt=!1,i=function(){},t=Object.defineProperty({},"once",{get:function(){return wt=!0,bt},set:function(t){bt=t}}),e.addEventListener("test",i,t),e.removeEventListener("test",i,t));var bt,wt,yt=wt;function Y(i,t,n,e){var o=3<arguments.length&&void 0!==e?e:{},s=n;t.trim().split(ct).forEach(function(t){var e;yt||(e=i.listeners)&&e[t]&&e[t][n]&&(s=e[t][n],delete e[t][n],0===Object.keys(e[t]).length&&delete e[t],0===Object.keys(e).length)&&delete i.listeners,i.removeEventListener(t,s,o)})}function X(s,t,a,e){var r=3<arguments.length&&void 0!==e?e:{},l=a;t.trim().split(ct).forEach(function(n){var t,o;r.once&&!yt&&(t=s.listeners,l=function(){delete o[n][a],s.removeEventListener(n,l,r);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];a.apply(s,e)},(o=void 0===t?{}:t)[n]||(o[n]={}),o[n][a]&&s.removeEventListener(n,o[n][a],r),o[n][a]=l,s.listeners=o),s.addEventListener(n,l,r)})}function q(t,e,i,n){var o;return I(Event)&&I(CustomEvent)?o=new CustomEvent(e,P({bubbles:!0,cancelable:!0,detail:i},n)):(o=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(o)}function xt(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,o=t.translateX,t=t.translateY,s=[],o=(E(o)&&0!==o&&s.push("translateX(".concat(o,"px)")),E(t)&&0!==t&&s.push("translateY(".concat(t,"px)")),E(e)&&0!==e&&s.push("rotate(".concat(e,"deg)")),E(i)&&1!==i&&s.push("scaleX(".concat(i,")")),E(n)&&1!==n&&s.push("scaleY(".concat(n,")")),s.length?s.join(" "):"none");return{WebkitTransform:o,msTransform:o,transform:o}}var kt=e.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(e.navigator.userAgent);function zt(i,t,e){var n,o=document.createElement("img");return i.naturalWidth&&!kt?e(i.naturalWidth,i.naturalHeight):(n=document.body||document.documentElement,o.onload=function(){e(o.width,o.height),kt||n.removeChild(o)},A(t.inheritedAttributes,function(t){var e=i.getAttribute(t);null!==e&&o.setAttribute(t,e)}),o.src=i.src,kt||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",n.appendChild(o))),o}function Tt(t){switch(t){case 2:return _;case 3:return $;case 4:return Z;default:return""}}function Et(t,e){var i=t.pageX,t=t.pageY,n={endX:i,endY:t};return e?n:P({timeStamp:Date.now(),startX:i,startY:t},n)}var Dt,i={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var t=this.element.ownerDocument,e=t.body||t.documentElement;this.body=e,this.scrollbarWidth=window.innerWidth-t.documentElement.clientWidth,this.initialBodyPaddingRight=e.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(e).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var t,e=this.options,i=this.parent;e.inline&&(t={width:Math.max(i.offsetWidth,e.minWidth),height:Math.max(i.offsetHeight,e.minHeight)},this.parentData=t),!this.fulled&&t||(t=this.containerData),this.viewerData=O({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&C(this.viewer,this.viewerData)},initList:function(){var r=this,t=this.element,l=this.options,h=this.list,c=[];h.innerHTML="",A(this.images,function(i,t){var e,n,o=i.src,s=i.alt||(T(s=o)?decodeURIComponent(s.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""),a=r.getImageURL(i);(o||a)&&(e=document.createElement("li"),n=document.createElement("img"),A(l.inheritedAttributes,function(t){var e=i.getAttribute(t);null!==e&&n.setAttribute(t,e)}),l.navbar&&(n.src=o||a),n.alt=s,n.setAttribute("data-original-url",a||o),e.setAttribute("data-index",t),e.setAttribute("data-viewer-action","view"),e.setAttribute("role","button"),l.keyboard&&e.setAttribute("tabindex",0),e.appendChild(n),h.appendChild(e),c.push(e))}),A(this.items=c,function(e){var t,i,n=e.firstElementChild;pt(n,"filled",!0),l.loading&&R(e,b),X(n,y,t=function(t){Y(n,x,i),l.loading&&M(e,b),r.loadImage(t)},{once:!0}),X(n,x,i=function(){Y(n,y,t),l.loading&&M(e,b)},{once:!0})}),l.transition&&X(t,z,function(){R(h,m)},{once:!0})},renderList:function(){var t,e,i=this.index,n=this.items[i];n&&(t=n.nextElementSibling,t=parseInt(window.getComputedStyle(t||n).marginLeft,10),n=n.offsetWidth,C(this.list,O({width:(e=n+t)*this.length-t},xt({translateX:(this.viewerData.width-n)/2-e*i}))))},resetList:function(){var t=this.list;t.innerHTML="",M(t,m),C(t,xt({translateX:0}))},initImage:function(r){var t,l=this,h=this.options,e=this.image,i=this.viewerData,n=this.footer.offsetHeight,c=i.width,u=Math.max(i.height-n,n),d=this.imageData||{};this.imageInitializing={abort:function(){t.onload=null}},t=zt(e,h,function(t,e){var i=t/e,n=Math.max(0,Math.min(1,h.initialCoverage)),o=c,s=u,n=(l.imageInitializing=!1,c<u*i?s=c/i:o=u*i,n=E(n)?n:.9,o=Math.min(o*n,t),s=Math.min(s*n,e),(c-o)/2),a=(u-s)/2,n={left:n,top:a,x:n,y:a,width:o,height:s,oldRatio:1,ratio:o/t,aspectRatio:i,naturalWidth:t,naturalHeight:e},a=O({},n);h.rotatable&&(n.rotate=d.rotate||0,a.rotate=0),h.scalable&&(n.scaleX=d.scaleX||1,n.scaleY=d.scaleY||1,a.scaleX=1,a.scaleY=1),l.imageData=n,l.initialImageData=a,r&&r()})},renderImage:function(t){var e,i=this,n=this.image,o=this.imageData;C(n,O({width:o.width,height:o.height,marginLeft:o.x,marginTop:o.y},xt(o))),t&&((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&L(n,m)?(e=function(){i.imageRendering=!1,t()},this.imageRendering={abort:function(){Y(n,k,e)}},X(n,k,e,{once:!0})):t())},resetImage:function(){var t=this.image;t&&(this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null,this.title.innerHTML="")}},t={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;X(e,w,this.onClick=this.click.bind(this)),X(e,tt,this.onDragStart=this.dragstart.bind(this)),X(i,nt,this.onPointerDown=this.pointerdown.bind(this)),X(n,ot,this.onPointerMove=this.pointermove.bind(this)),X(n,st,this.onPointerUp=this.pointerup.bind(this)),X(n,it,this.onKeyDown=this.keydown.bind(this)),X(window,at,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&X(e,rt,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&X(i,Q,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;Y(e,w,this.onClick),Y(e,tt,this.onDragStart),Y(i,nt,this.onPointerDown),Y(n,ot,this.onPointerMove),Y(n,st,this.onPointerUp),Y(n,it,this.onKeyDown),Y(window,at,this.onResize),t.zoomable&&t.zoomOnWheel&&Y(e,rt,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&Y(i,Q,this.onDblclick)}},St={click:function(t){var e=this.options,i=this.imageData,n=t.target,o=N(n,ht);switch(o||"img"!==n.localName||"li"!==n.parentElement.localName||(o=N(n=n.parentElement,ht)),a&&t.isTrusted&&n===this.canvas&&clearTimeout(this.clickCanvasTimeout),o){case"mix":this.played?this.stop():e.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(N(n,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(e.loop);break;case"play":this.play(e.fullscreen);break;case"next":this.next(e.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-i.scaleX||-1);break;case"flip-vertical":this.scaleY(-i.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(t){t.preventDefault(),this.viewed&&t.target===this.image&&(a&&t.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(t.isTrusted?t:t.detail&&t.detail.originalEvent))},load:function(){var t=this,e=(this.timeout&&(clearTimeout(this.timeout),this.timeout=!1),this.element),i=this.options,n=this.image,o=this.index,s=this.viewerData;M(n,p),i.loading&&M(this.canvas,b),n.style.cssText="height:0;"+"margin-left:".concat(s.width/2,"px;")+"margin-top:".concat(s.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){F(n,G,i.movable),F(n,m,i.transition),t.renderImage(function(){t.viewed=!0,t.viewing=!1,I(i.viewed)&&X(e,z,i.viewed,{once:!0}),q(e,z,{originalImage:t.images[o],index:o,image:n},{cancelable:!1})})})},loadImage:function(t){var n=t.target,t=n.parentNode,o=t.offsetWidth||30,s=t.offsetHeight||50,a=!!N(n,"filled");zt(n,this.options,function(t,e){var t=t/e,e=o,i=s;o<s*t?a?e=s*t:i=o/t:a?i=o/t:e=s*t,C(n,O({width:e,height:i},xt({translateX:(o-e)/2,translateY:(s-i)/2})))})},keydown:function(t){var e=this.options;if(e.keyboard){var i=t.keyCode||t.which||t.charCode;if(13===i&&this.viewer.contains(t.target)&&this.click(t),this.fulled)switch(i){case 27:this.played?this.stop():e.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(e.loop);break;case 38:t.preventDefault(),this.zoom(e.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(e.loop);break;case 40:t.preventDefault(),this.zoom(-e.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle())}}},dragstart:function(t){"img"===t.target.localName&&t.preventDefault()},pointerdown:function(t){var e=this.options,i=this.pointers,n=t.buttons,o=t.button;this.pointerMoved=!1,!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(E(n)&&1!==n||E(o)&&0!==o||t.ctrlKey)||(t.preventDefault(),t.changedTouches?A(t.changedTouches,function(t){i[t.identifier]=Et(t)}):i[t.pointerId||0]=Et(t),n=!!e.movable&&h,e.zoomOnTouch&&e.zoomable&&1<Object.keys(i).length?n=c:e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(n=j),!e.transition||n!==h&&n!==c||M(this.image,m),this.action=n)},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),t.changedTouches?A(t.changedTouches,function(t){O(e[t.identifier]||{},Et(t,!0))}):O(e[t.pointerId||0]||{},Et(t,!0)),this.change(t))},pointerup:function(t){var e,i=this,n=this.options,o=this.action,s=this.pointers;t.changedTouches?A(t.changedTouches,function(t){e=s[t.identifier],delete s[t.identifier]}):(e=s[t.pointerId||0],delete s[t.pointerId||0]),o&&(t.preventDefault(),!n.transition||o!==h&&o!==c||R(this.image,m),this.action=!1,a)&&o!==c&&e&&Date.now()-e.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),n.toggleOnDblclick&&this.viewed&&t.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){q(i.image,Q,{originalEvent:t})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){i.imageClicked=!1},500)):(this.imageClicked=!1,n.backdrop&&"static"!==n.backdrop&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){q(i.canvas,w,{originalEvent:t})},50))))},resize:function(){var e=this;this.isShown&&!this.hiding&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage()}),this.played)&&(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?this.stop():A(this.player.getElementsByTagName("img"),function(t){X(t,y,e.loadImage.bind(e),{once:!0}),q(t,y)}))},wheel:function(t){var e,i,n=this;this.viewed&&(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout(function(){n.wheeling=!1},50),e=Number(this.options.zoomRatio)||.1,i=1,t.deltaY?i=0<t.deltaY?1:-1:t.wheelDelta?i=-t.wheelDelta/120:t.detail&&(i=0<t.detail?1:-1),this.zoom(-i*e,!0,null,t)))}},It={show:function(){var t,e,i=0<arguments.length&&void 0!==arguments[0]&&arguments[0],n=this.element,o=this.options;return o.inline||this.showing||this.isShown||this.showing||(this.ready?(I(o.show)&&X(n,"show",o.show,{once:!0}),!1!==q(n,"show")&&this.ready&&(this.hiding&&this.transitioning.abort(),this.showing=!0,this.open(),M(t=this.viewer,v),t.setAttribute("role","dialog"),t.setAttribute("aria-labelledby",this.title.id),t.setAttribute("aria-modal",!0),t.removeAttribute("aria-hidden"),o.transition&&!i?(e=this.shown.bind(this),this.transitioning={abort:function(){Y(t,k,e),M(t,u)}},R(t,m),t.initialOffsetWidth=t.offsetWidth,X(t,k,e,{once:!0}),R(t,u)):(R(t,u),this.shown()))):(this.build(),this.ready&&this.show(i))),this},hide:function(){var i,t,e,n,o,s=this,a=0<arguments.length&&void 0!==arguments[0]&&arguments[0],r=this.element,l=this.options;return l.inline||this.hiding||!this.isShown&&!this.showing||(I(l.hide)&&X(r,"hide",l.hide,{once:!0}),!1!==q(r,"hide")&&(this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort(),i=this.viewer,t=this.image,e=function(){M(i,u),s.hidden()},l.transition&&!a?(n=function t(e){e&&e.target===i&&(Y(i,k,t),s.hidden())},o=function(){L(i,m)?(X(i,k,n),M(i,u)):e()},this.transitioning={abort:function(){s.viewed&&L(t,m)?Y(t,k,o):L(i,m)&&Y(i,k,n)}},this.viewed&&L(t,m)?(X(t,k,o,{once:!0}),this.zoomTo(0,!1,null,null,!0)):o()):e())),this},view:function(){var i=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options.initialViewIndex,t=Number(t)||0;if(!(this.hiding||this.played||t<0||t>=this.length||this.viewed&&t===this.index)){if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var e,n,o,s=this.element,a=this.options,r=this.title,l=this.canvas,h=this.items[t],c=h.querySelector("img"),u=N(c,"originalUrl"),d=c.getAttribute("alt"),m=document.createElement("img");A(a.inheritedAttributes,function(t){var e=c.getAttribute(t);null!==e&&m.setAttribute(t,e)}),m.src=u,m.alt=d,I(a.view)&&X(s,"view",a.view,{once:!0}),!1===q(s,"view",{originalImage:this.images[t],index:t,image:m})||!this.isShown||this.hiding||this.played||((u=this.items[this.index])&&(M(u,f),u.removeAttribute("aria-selected")),R(h,f),h.setAttribute("aria-selected",!0),a.focus&&h.focus(),this.image=m,this.viewed=!1,this.index=t,this.imageData={},R(m,p),a.loading&&R(l,b),l.innerHTML="",l.appendChild(m),this.renderList(),r.innerHTML="",X(s,z,e=function(){var t=i.imageData,e=Array.isArray(a.title)?a.title[1]:a.title;r.innerHTML=T(e=I(e)?e.call(i,m,t):"".concat(d," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")"))?e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):e},{once:!0}),this.viewing={abort:function(){Y(s,z,e),m.complete?i.imageRendering?i.imageRendering.abort():i.imageInitializing&&i.imageInitializing.abort():(m.src="",Y(m,y,n),i.timeout&&clearTimeout(i.timeout))}},m.complete?this.load():(X(m,y,n=function(){Y(m,x,o),i.load()},{once:!0}),X(m,x,o=function(){Y(m,y,n),i.timeout&&(clearTimeout(i.timeout),i.timeout=!1),M(m,p),a.loading&&M(i.canvas,b)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){M(m,p),i.timeout=!1},1e3)))}return this},prev:function(){var t=this.index-1;return t<0&&(t=0<arguments.length&&void 0!==arguments[0]&&arguments[0]?this.length-1:0),this.view(t),this},next:function(){var t=this.length-1,e=this.index+1;return this.view(e=t<e?0<arguments.length&&void 0!==arguments[0]&&arguments[0]?0:t:e),this},move:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData;return this.moveTo(D(t)?t:i.x+Number(t),D(e)?e:i.y+Number(e)),this},moveTo:function(t){var e=this,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,o=this.element,s=this.options,a=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&s.movable){var r=a.x,l=a.y,h=!1;if(E(t)?h=!0:t=r,E(i)?h=!0:i=l,h){if(I(s.move)&&X(o,"move",s.move,{once:!0}),!1===q(o,"move",{x:t,y:i,oldX:r,oldY:l,originalEvent:n}))return this;a.x=t,a.y=i,a.left=t,a.top=i,this.moving=!0,this.renderImage(function(){e.moving=!1,I(s.moved)&&X(o,"moved",s.moved,{once:!0}),q(o,"moved",{x:t,y:i,oldX:r,oldY:l,originalEvent:n},{cancelable:!1})})}}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t)),this},rotateTo:function(t){var e=this,i=this.element,n=this.options,o=this.imageData;if(E(t=Number(t))&&this.viewed&&!this.played&&n.rotatable){var s=o.rotate;if(I(n.rotate)&&X(i,"rotate",n.rotate,{once:!0}),!1===q(i,"rotate",{degree:t,oldDegree:s}))return this;o.rotate=t,this.rotating=!0,this.renderImage(function(){e.rotating=!1,I(n.rotated)&&X(i,lt,n.rotated,{once:!0}),q(i,lt,{degree:t,oldDegree:s},{cancelable:!1})})}return this},scaleX:function(t){return this.scale(t,this.imageData.scaleY),this},scaleY:function(t){return this.scale(this.imageData.scaleX,t),this},scale:function(t){var e=this,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=this.element,o=this.options,s=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&o.scalable){var a=s.scaleX,r=s.scaleY,l=!1;if(E(t)?l=!0:t=a,E(i)?l=!0:i=r,l){if(I(o.scale)&&X(n,"scale",o.scale,{once:!0}),!1===q(n,"scale",{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:r}))return this;s.scaleX=t,s.scaleY=i,this.scaling=!0,this.renderImage(function(){e.scaling=!1,I(o.scaled)&&X(n,"scaled",o.scaled,{once:!0}),q(n,"scaled",{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:r},{cancelable:!1})})}}return this},zoom:function(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,o=this.imageData;return t=Number(t),this.zoomTo(o.width*(t=t<0?1/(1-t):1+t)/o.naturalWidth,e,i,n),this},zoomTo:function(t){var i,n,o,e=this,s=1<arguments.length&&void 0!==arguments[1]&&arguments[1],a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,l=4<arguments.length&&void 0!==arguments[4]&&arguments[4],h=this.element,c=this.options,u=this.pointers,d=this.imageData,m=d.x,g=d.y,f=d.width,v=d.height,p=d.naturalWidth,b=d.naturalHeight;if(E(t=Math.max(0,t))&&this.viewed&&!this.played&&(l||c.zoomable)){if(l||(l=Math.max(.01,c.minZoomRatio),y=Math.min(100,c.maxZoomRatio),t=Math.min(Math.max(t,l),y)),r)switch(r.type){case"wheel":.055<=c.zoomRatio&&.95<t&&t<1.05&&(t=1);break;case"pointermove":case"touchmove":case"mousemove":.99<t&&t<1.01&&(t=1)}var w,l=p*t,y=b*t,p=l-f,b=y-v,x=d.ratio;if(I(c.zoom)&&X(h,"zoom",c.zoom,{once:!0}),!1===q(h,"zoom",{ratio:t,oldRatio:x,originalEvent:r}))return this;this.zooming=!0,r?(w={left:(w=(w=this.viewer).getBoundingClientRect()).left+(window.pageXOffset-document.documentElement.clientLeft),top:w.top+(window.pageYOffset-document.documentElement.clientTop)},u=u&&0<Object.keys(u).length?(o=n=i=0,A(u,function(t){var e=t.startX,t=t.startY;i+=e,n+=t,o+=1}),{pageX:i/=o,pageY:n/=o}):{pageX:r.pageX,pageY:r.pageY},d.x-=(u.pageX-w.left-m)/f*p,d.y-=(u.pageY-w.top-g)/v*b):S(a)&&E(a.x)&&E(a.y)?(d.x-=p*((a.x-m)/f),d.y-=b*((a.y-g)/v)):(d.x-=p/2,d.y-=b/2),d.left=d.x,d.top=d.y,d.width=l,d.height=y,d.oldRatio=x,d.ratio=t,this.renderImage(function(){e.zooming=!1,I(c.zoomed)&&X(h,"zoomed",c.zoomed,{once:!0}),q(h,"zoomed",{ratio:t,oldRatio:x,originalEvent:r},{cancelable:!1})}),s&&this.tooltip()}return this},play:function(){var t,o,s,a,r,l,h,e,i=this,n=0<arguments.length&&void 0!==arguments[0]&&arguments[0];return this.isShown&&!this.played&&(t=this.element,I((o=this.options).play)&&X(t,"play",o.play,{once:!0}),!1!==q(t,"play")&&(s=this.player,a=this.loadImage.bind(this),r=[],h=l=0,this.played=!0,this.onLoadWhenPlay=a,n&&this.requestFullscreen(n),R(s,d),A(this.items,function(t,e){var i=t.querySelector("img"),n=document.createElement("img");n.src=N(i,"originalUrl"),n.alt=i.getAttribute("alt"),n.referrerPolicy=i.referrerPolicy,l+=1,R(n,B),F(n,m,o.transition),L(t,f)&&(R(n,u),h=e),r.push(n),X(n,y,a,{once:!0}),s.appendChild(n)}),E(o.interval))&&0<o.interval&&(e=function t(){clearTimeout(i.playing.timeout),M(r[h],u),R(r[h=(h+=1)<l?h:0],u),i.playing.timeout=setTimeout(t,o.interval)},1<l))&&(this.playing={prev:function t(){clearTimeout(i.playing.timeout),M(r[h],u),R(r[h=0<=--h?h:l-1],u),i.playing.timeout=setTimeout(t,o.interval)},next:e,timeout:setTimeout(e,o.interval)}),this},stop:function(){var t,e,i=this;return this.played&&(t=this.element,I((e=this.options).stop)&&X(t,"stop",e.stop,{once:!0}),!1!==q(t,"stop"))&&(e=this.player,clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,A(e.getElementsByTagName("img"),function(t){Y(t,y,i.onLoadWhenPlay)}),M(e,d),e.innerHTML="",this.exitFullscreen()),this},full:function(){var t=this,e=this.options,i=this.viewer,n=this.image,o=this.list;return this.isShown&&!this.played&&!this.fulled&&e.inline&&(this.fulled=!0,this.open(),R(this.button,K),e.transition&&(M(o,m),this.viewed)&&M(n,m),R(i,V),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),C(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=O({},this.containerData),this.renderList(),this.viewed)&&this.initImage(function(){t.renderImage(function(){e.transition&&setTimeout(function(){R(n,m),R(o,m)},0)})}),this},exit:function(){var t=this,e=this.options,i=this.viewer,n=this.image,o=this.list;return this.isShown&&!this.played&&this.fulled&&e.inline&&(this.fulled=!1,this.close(),M(this.button,K),e.transition&&(M(o,m),this.viewed)&&M(n,m),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),M(i,V),C(i,{zIndex:e.zIndexInline}),this.viewerData=O({},this.parentData),this.renderViewer(),this.renderList(),this.viewed)&&this.initImage(function(){t.renderImage(function(){e.transition&&setTimeout(function(){R(n,m),R(o,m)},0)})}),this},tooltip:function(){var t=this,e=this.options,i=this.tooltipBox,n=this.imageData;return this.viewed&&!this.played&&e.tooltip&&(i.textContent="".concat(Math.round(100*n.ratio),"%"),this.tooltipping?clearTimeout(this.tooltipping):e.transition?(this.fading&&q(i,k),R(i,d),R(i,B),R(i,m),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,R(i,u)):(R(i,d),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){e.transition?(X(i,k,function(){M(i,d),M(i,B),M(i,m),i.setAttribute("aria-hidden",!0),t.fading=!1},{once:!0}),M(i,u),t.fading=!0):(M(i,d),i.setAttribute("aria-hidden",!0)),t.tooltipping=!1},1e3)),this},toggle:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;return 1===this.imageData.ratio?this.zoomTo(this.imageData.oldRatio,!0,null,t):this.zoomTo(1,!0,null,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=O({},this.initialImageData),this.renderImage()),this},update:function(){var n,o,e=this,t=this.element,i=this.options,s=this.isImg;return s&&!t.parentNode?this.destroy():(n=[],A(s?[t]:t.querySelectorAll("img"),function(t){I(i.filter)?i.filter.call(e,t)&&n.push(t):e.getImageURL(t)&&n.push(t)}),n.length&&(this.images=n,this.length=n.length,this.ready?(o=[],A(this.items,function(t,e){var t=t.querySelector("img"),i=n[e];i&&t&&i.src===t.src&&i.alt===t.alt||o.push(e)}),C(this.list,{width:"auto"}),this.initList(),this.isShown&&(this.length?this.viewed&&(0<=(s=o.indexOf(this.index))?(this.viewed=!1,this.view(Math.max(Math.min(this.index-s,this.length-1),0))):(R(t=this.items[this.index],f),t.setAttribute("aria-selected",!0))):(this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""))):this.build()),this)},destroy:function(){var t=this.element,e=this.options;return t[g]&&(this.destroyed=!0,this.ready?(this.played&&this.stop(),e.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):e.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),e.inline||Y(t,w,this.onStart),t[g]=void 0),this}},At={getImageURL:function(t){var e=this.options.url;return e=T(e)?t.getAttribute(e):I(e)?e.call(this,t):""},enforceFocus:function(){var n=this;this.clearEnforceFocus(),X(document,et,this.onFocusin=function(t){var e=n.viewer,i=t.target;if(i!==document&&i!==e&&!e.contains(i)){for(;i;){if(null!==i.getAttribute("tabindex")||"true"===i.getAttribute("aria-modal"))return;i=i.parentElement}e.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(Y(document,et,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;R(t,J),0<this.scrollbarWidth&&(t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var t=this.body;M(t,J),0<this.scrollbarWidth&&(t.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var t=this.element,e=this.options,i=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,e.focus&&(i.focus(),this.enforceFocus()),I(e.shown)&&X(t,"shown",e.shown,{once:!0}),!1!==q(t,"shown")&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,e=this.options,i=this.viewer;e.fucus&&this.clearEnforceFocus(),this.close(),this.unbind(),R(i,v),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),i.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(I(e.hidden)&&X(t,"hidden",e.hidden,{once:!0}),q(t,"hidden",null,{cancelable:!1}))},requestFullscreen:function(t){var e=this.element.ownerDocument;this.fulled&&!(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)&&((e=e.documentElement).requestFullscreen?S(t)?e.requestFullscreen(t):e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen())},exitFullscreen:function(){var t=this.element.ownerDocument;this.fulled&&(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},change:function(t){var e=this.options,i=this.pointers,n=i[Object.keys(i)[0]];if(n){var s,a,o=n.endX-n.startX,r=n.endY-n.startY;switch(this.action){case h:0==o&&0==r||(this.pointerMoved=!0,this.move(o,r,t));break;case c:this.zoom((s=P({},l=i),a=[],A(l,function(o,t){delete s[t],A(s,function(t){var e=Math.abs(o.startX-t.startX),i=Math.abs(o.startY-t.startY),n=Math.abs(o.endX-t.endX),t=Math.abs(o.endY-t.endY),e=Math.sqrt(e*e+i*i),i=Math.sqrt(n*n+t*t);a.push((i-e)/e)})}),a.sort(function(t,e){return Math.abs(t)<Math.abs(e)}),a[0]),!1,null,t);break;case j:this.action="switched";var l=Math.abs(o);1<l&&l>Math.abs(r)&&(this.pointers={},1<o?this.prev(e.loop):o<-1&&this.next(e.loop))}A(i,function(t){t.startX=t.endX,t.startY=t.endY})}},isSwitchable:function(){var t=this.imageData,e=this.viewerData;return 1<this.length&&0<=t.x&&0<=t.y&&t.width<=e.width&&t.height<=e.height}},Ot=e.Viewer,Ct=(Dt=-1,function(){return Dt+=1}),e=function(){function o(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=this,n=o;if(!(i instanceof n))throw new TypeError("Cannot call a class as a function");if(!t||1!==t.nodeType)throw new Error("The first argument is required and must be an element.");this.element=t,this.options=O({},W,S(e)&&e),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=Ct(),this.init()}var t,e,i;return t=o,i=[{key:"noConflict",value:function(){return window.Viewer=Ot,o}},{key:"setDefaults",value:function(t){O(W,S(t)&&t)}}],(e=[{key:"init",value:function(){var t,e,i,n,o=this,s=this.element,a=this.options;s[g]||(s[g]=this,a.focus&&!a.keyboard&&(a.focus=!1),t="img"===s.localName,e=[],A(t?[s]:s.querySelectorAll("img"),function(t){I(a.filter)?a.filter.call(o,t)&&e.push(t):o.getImageURL(t)&&e.push(t)}),this.isImg=t,this.length=e.length,this.images=e,this.initBody(),D(document.createElement(g).style.transition)&&(a.transition=!1),a.inline?(i=0,n=function(){var t;(i+=1)===o.length&&(o.initializing=!1,o.delaying={abort:function(){clearTimeout(t)}},t=setTimeout(function(){o.delaying=!1,o.build()},0))},this.initializing={abort:function(){A(e,function(t){t.complete||(Y(t,y,n),Y(t,x,n))})}},A(e,function(t){var e,i;t.complete?n():(X(t,y,e=function(){Y(t,x,i),n()},{once:!0}),X(t,x,i=function(){Y(t,y,e),n()},{once:!0}))})):X(s,w,this.onStart=function(t){t=t.target;"img"!==t.localName||I(a.filter)&&!a.filter.call(o,t)||o.view(o.images.indexOf(t))}))}},{key:"build",value:function(){var t,s,e,i,n,o,a,r,l,h,c,u,d,m;this.ready||(t=this.element,s=this.options,e=t.parentNode,(d=document.createElement("div")).innerHTML='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>',d=(i=d.querySelector(".".concat(g,"-container"))).querySelector(".".concat(g,"-title")),n=i.querySelector(".".concat(g,"-toolbar")),m=i.querySelector(".".concat(g,"-navbar")),o=i.querySelector(".".concat(g,"-button")),a=i.querySelector(".".concat(g,"-canvas")),this.parent=e,this.viewer=i,this.title=d,this.toolbar=n,this.navbar=m,this.button=o,this.canvas=a,this.footer=i.querySelector(".".concat(g,"-footer")),this.tooltipBox=i.querySelector(".".concat(g,"-tooltip")),this.player=i.querySelector(".".concat(g,"-player")),this.list=i.querySelector(".".concat(g,"-list")),i.id="".concat(g).concat(this.id),d.id="".concat(g,"Title").concat(this.id),R(d,s.title?Tt(Array.isArray(s.title)?s.title[0]:s.title):v),R(m,s.navbar?Tt(s.navbar):v),F(o,v,!s.button),s.keyboard&&o.setAttribute("tabindex",0),s.backdrop&&(R(i,"".concat(g,"-backdrop")),s.inline||"static"===s.backdrop||pt(a,ht,"hide")),T(s.className)&&s.className&&s.className.split(ct).forEach(function(t){R(i,t)}),s.toolbar?(r=document.createElement("ul"),l=S(s.toolbar),h=ut.slice(0,3),c=ut.slice(7,9),u=ut.slice(9),l||R(n,Tt(s.toolbar)),A(l?s.toolbar:ut,function(t,e){var i,n=l&&S(t),e=l?vt(e):t,o=n&&!D(t.show)?t.show:t;!o||!s.zoomable&&-1!==h.indexOf(e)||!s.rotatable&&-1!==c.indexOf(e)||!s.scalable&&-1!==u.indexOf(e)||(i=n&&!D(t.size)?t.size:t,n=n&&!D(t.click)?t.click:t,t=document.createElement("li"),s.keyboard&&t.setAttribute("tabindex",0),t.setAttribute("role","button"),R(t,"".concat(g,"-").concat(e)),I(n)||pt(t,ht,e),E(o)&&R(t,Tt(o)),-1!==["small","large"].indexOf(i)?R(t,"".concat(g,"-").concat(i)):"play"===e&&R(t,"".concat(g,"-large")),I(n)&&X(t,w,n),r.appendChild(t))}),n.appendChild(r)):R(n,v),s.rotatable||(R(d=n.querySelectorAll('li[class*="rotate"]'),p),A(d,function(t){n.appendChild(t)})),s.inline?(R(o,U),C(i,{zIndex:s.zIndexInline}),"static"===window.getComputedStyle(e).position&&C(e,{position:"relative"}),e.insertBefore(i,t.nextSibling)):(R(o,H),R(i,V),R(i,B),R(i,v),C(i,{zIndex:s.zIndex}),(m=(m=T(m=s.container)?t.ownerDocument.querySelector(m):m)||this.body).appendChild(i)),s.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,I(s.ready)&&X(t,"ready",s.ready,{once:!0}),!1===q(t,"ready")?this.ready=!1:this.ready&&s.inline&&this.view(this.index))}}])&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),o}();return O(e.prototype,i,t,St,It,At),e});
10
+ ((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Viewer=e()})(this,function(){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,r(n.key),n)}}function s(e,t){var i,n=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)),n}function P(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?s(Object(o),!0).forEach(function(t){var e,i;e=n,i=o[t=t],(t=r(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):s(Object(o)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function r(t){t=((t,e)=>{if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);if("object"!=typeof(i=i.call(t,e||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string");return"symbol"==typeof t?t:t+""}function l(t){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var W={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},t="undefined"!=typeof window&&void 0!==window.document,e=t?window:{},a=!(!t||!e.document.documentElement)&&"ontouchstart"in e.document.documentElement,i=t&&"PointerEvent"in e,g="viewer",h="move",j="switch",c="zoom",f="".concat(g,"-active"),H="".concat(g,"-close"),B="".concat(g,"-fade"),V="".concat(g,"-fixed"),U="".concat(g,"-fullscreen"),K="".concat(g,"-fullscreen-exit"),v="".concat(g,"-hide"),Z="".concat(g,"-hide-md-down"),$="".concat(g,"-hide-sm-down"),_="".concat(g,"-hide-xs-down"),u="".concat(g,"-in"),p="".concat(g,"-invisible"),b="".concat(g,"-loading"),G="".concat(g,"-move"),J="".concat(g,"-open"),d="".concat(g,"-show"),m="".concat(g,"-transition"),w="click",Q="dblclick",tt="dragstart",et="focusin",it="keydown",y="load",x="error",nt=i?"pointerdown":a?"touchstart":"mousedown",ot=i?"pointermove":a?"touchmove":"mousemove",st=i?"pointerup pointercancel":a?"touchend touchcancel":"mouseup",at="resize",k="transitionend",rt="wheel",z="viewed",lt="rotated",ht="".concat(g,"Action"),ct=/\s\s*/,ut=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function T(t){return"string"==typeof t}var dt=Number.isNaN||e.isNaN;function E(t){return"number"==typeof t&&!dt(t)}function D(t){return void 0===t}function o(t){return"object"===l(t)&&null!==t}var mt=Object.prototype.hasOwnProperty;function S(t){if(!o(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&mt.call(i,"isPrototypeOf")}catch(t){return!1}}function I(t){return"function"==typeof t}function A(e,i){if(e&&I(i))if(Array.isArray(e)||E(e.length))for(var t=e.length,n=0;n<t&&!1!==i.call(e,e[n],n,e);n+=1);else o(e)&&Object.keys(e).forEach(function(t){i.call(e,e[t],t,e)})}var O=Object.assign||function(i){for(var t=arguments.length,e=new Array(1<t?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return o(i)&&0<e.length&&e.forEach(function(e){o(e)&&Object.keys(e).forEach(function(t){i[t]=e[t]})}),i},gt=/^(?:width|height|left|top|marginLeft|marginTop)$/;function C(t,e){var i=t.style;A(e,function(t,e){gt.test(e)&&E(t)&&(t+="px"),i[e]=t})}function L(t,e){return t&&e&&(t.classList?t.classList.contains(e):-1<t.className.indexOf(e))}function R(t,e){var i;t&&e&&(E(t.length)?A(t,function(t){R(t,e)}):t.classList?t.classList.add(e):(i=t.className.trim())?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e)}function M(t,e){t&&e&&(E(t.length)?A(t,function(t){M(t,e)}):t.classList?t.classList.remove(e):0<=t.className.indexOf(e)&&(t.className=t.className.replace(e,"")))}function F(t,e,i){e&&(E(t.length)?A(t,function(t){F(t,e,i)}):(i?R:M)(t,e))}var ft=/([a-z\d])([A-Z])/g;function vt(t){return t.replace(ft,"$1-$2").toLowerCase()}function N(t,e){return o(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(vt(e)))}function pt(t,e,i){o(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(vt(e)),i)}wt=!1,t&&(bt=!1,i=function(){},t=Object.defineProperty({},"once",{get:function(){return wt=!0,bt},set:function(t){bt=t}}),e.addEventListener("test",i,t),e.removeEventListener("test",i,t));var bt,wt,yt=wt;function Y(i,t,n,e){var o=3<arguments.length&&void 0!==e?e:{},s=n;t.trim().split(ct).forEach(function(t){var e;yt||(e=i.listeners)&&e[t]&&e[t][n]&&(s=e[t][n],delete e[t][n],0===Object.keys(e[t]).length&&delete e[t],0===Object.keys(e).length)&&delete i.listeners,i.removeEventListener(t,s,o)})}function X(s,t,a,e){var r=3<arguments.length&&void 0!==e?e:{},l=a;t.trim().split(ct).forEach(function(n){var t,o;r.once&&!yt&&(t=s.listeners,l=function(){delete o[n][a],s.removeEventListener(n,l,r);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];a.apply(s,e)},(o=void 0===t?{}:t)[n]||(o[n]={}),o[n][a]&&s.removeEventListener(n,o[n][a],r),o[n][a]=l,s.listeners=o),s.addEventListener(n,l,r)})}function q(t,e,i,n){var o;return I(Event)&&I(CustomEvent)?o=new CustomEvent(e,P({bubbles:!0,cancelable:!0,detail:i},n)):(o=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(o)}function xt(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,o=t.translateX,t=t.translateY,s=[],o=(E(o)&&0!==o&&s.push("translateX(".concat(o,"px)")),E(t)&&0!==t&&s.push("translateY(".concat(t,"px)")),E(e)&&0!==e&&s.push("rotate(".concat(e,"deg)")),E(i)&&1!==i&&s.push("scaleX(".concat(i,")")),E(n)&&1!==n&&s.push("scaleY(".concat(n,")")),s.length?s.join(" "):"none");return{WebkitTransform:o,msTransform:o,transform:o}}var kt=e.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(e.navigator.userAgent);function zt(i,t,e){var n,o=document.createElement("img");return i.naturalWidth&&!kt?e(i.naturalWidth,i.naturalHeight):(n=document.body||document.documentElement,o.onload=function(){e(o.width,o.height),kt||n.removeChild(o)},A(t.inheritedAttributes,function(t){var e=i.getAttribute(t);null!==e&&o.setAttribute(t,e)}),o.src=i.src,kt||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",n.appendChild(o))),o}function Tt(t){switch(t){case 2:return _;case 3:return $;case 4:return Z;default:return""}}function Et(t,e){var i=t.pageX,t=t.pageY,n={endX:i,endY:t};return e?n:P({timeStamp:Date.now(),startX:i,startY:t},n)}var Dt,i={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var t=this.element.ownerDocument,e=t.body||t.documentElement;this.body=e,this.scrollbarWidth=window.innerWidth-t.documentElement.clientWidth,this.initialBodyPaddingRight=e.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(e).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var t,e=this.options,i=this.parent;e.inline&&(t={width:Math.max(i.offsetWidth,e.minWidth),height:Math.max(i.offsetHeight,e.minHeight)},this.parentData=t),!this.fulled&&t||(t=this.containerData),this.viewerData=O({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&C(this.viewer,this.viewerData)},initList:function(){var r=this,t=this.element,l=this.options,h=this.list,c=[];h.innerHTML="",A(this.images,function(i,t){var e,n,o=i.src,s=i.alt||(T(s=o)?decodeURIComponent(s.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""),a=r.getImageURL(i);(o||a)&&(e=document.createElement("li"),n=document.createElement("img"),A(l.inheritedAttributes,function(t){var e=i.getAttribute(t);null!==e&&n.setAttribute(t,e)}),l.navbar&&(n.src=o||a),n.alt=s,n.setAttribute("data-original-url",a||o),e.setAttribute("data-index",t),e.setAttribute("data-viewer-action","view"),e.setAttribute("role","button"),l.keyboard&&e.setAttribute("tabindex",0),e.appendChild(n),h.appendChild(e),c.push(e))}),A(this.items=c,function(e){var t,i,n=e.firstElementChild;pt(n,"filled",!0),l.loading&&R(e,b),X(n,y,t=function(t){Y(n,x,i),l.loading&&M(e,b),r.loadImage(t)},{once:!0}),X(n,x,i=function(){Y(n,y,t),l.loading&&M(e,b)},{once:!0})}),l.transition&&X(t,z,function(){R(h,m)},{once:!0})},renderList:function(){var t,e,i=this.index,n=this.items[i];n&&(t=n.nextElementSibling,t=parseInt(window.getComputedStyle(t||n).marginLeft,10),n=n.offsetWidth,C(this.list,O({width:(e=n+t)*this.length-t},xt({translateX:(this.viewerData.width-n)/2-e*i}))))},resetList:function(){var t=this.list;t.innerHTML="",M(t,m),C(t,xt({translateX:0}))},initImage:function(r){var t,l=this,h=this.options,e=this.image,i=this.viewerData,n=this.footer.offsetHeight,c=i.width,u=Math.max(i.height-n,n),d=this.imageData||{};this.imageInitializing={abort:function(){t.onload=null}},t=zt(e,h,function(t,e){var i=t/e,n=Math.max(0,Math.min(1,h.initialCoverage)),o=c,s=u,n=(l.imageInitializing=!1,c<u*i?s=c/i:o=u*i,n=E(n)?n:.9,o=Math.min(o*n,t),s=Math.min(s*n,e),(c-o)/2),a=(u-s)/2,n={left:n,top:a,x:n,y:a,width:o,height:s,oldRatio:1,ratio:o/t,aspectRatio:i,naturalWidth:t,naturalHeight:e},a=O({},n);h.rotatable&&(n.rotate=d.rotate||0,a.rotate=0),h.scalable&&(n.scaleX=d.scaleX||1,n.scaleY=d.scaleY||1,a.scaleX=1,a.scaleY=1),l.imageData=n,l.initialImageData=a,r&&r()})},renderImage:function(t){var e,i=this,n=this.image,o=this.imageData;C(n,O({width:o.width,height:o.height,marginLeft:o.x,marginTop:o.y},xt(o))),t&&((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&L(n,m)?(e=function(){i.imageRendering=!1,t()},this.imageRendering={abort:function(){Y(n,k,e)}},X(n,k,e,{once:!0})):t())},resetImage:function(){var t=this.image;t&&(this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null,this.title.innerHTML="")}},t={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;X(e,w,this.onClick=this.click.bind(this)),X(e,tt,this.onDragStart=this.dragstart.bind(this)),X(i,nt,this.onPointerDown=this.pointerdown.bind(this)),X(n,ot,this.onPointerMove=this.pointermove.bind(this)),X(n,st,this.onPointerUp=this.pointerup.bind(this)),X(n,it,this.onKeyDown=this.keydown.bind(this)),X(window,at,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&X(e,rt,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&X(i,Q,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;Y(e,w,this.onClick),Y(e,tt,this.onDragStart),Y(i,nt,this.onPointerDown),Y(n,ot,this.onPointerMove),Y(n,st,this.onPointerUp),Y(n,it,this.onKeyDown),Y(window,at,this.onResize),t.zoomable&&t.zoomOnWheel&&Y(e,rt,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&Y(i,Q,this.onDblclick)}},St={click:function(t){var e=this.options,i=this.imageData,n=t.target,o=N(n,ht);switch(o||"img"!==n.localName||"li"!==n.parentElement.localName||(o=N(n=n.parentElement,ht)),a&&t.isTrusted&&n===this.canvas&&clearTimeout(this.clickCanvasTimeout),o){case"mix":this.played?this.stop():e.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(N(n,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(e.loop);break;case"play":this.play(e.fullscreen);break;case"next":this.next(e.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-i.scaleX||-1);break;case"flip-vertical":this.scaleY(-i.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(t){t.preventDefault(),this.viewed&&t.target===this.image&&(a&&t.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(t.isTrusted?t:t.detail&&t.detail.originalEvent))},load:function(){var t=this,e=(this.timeout&&(clearTimeout(this.timeout),this.timeout=!1),this.element),i=this.options,n=this.image,o=this.index,s=this.viewerData;M(n,p),i.loading&&M(this.canvas,b),n.style.cssText="height:0;"+"margin-left:".concat(s.width/2,"px;")+"margin-top:".concat(s.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){F(n,G,i.movable),F(n,m,i.transition),t.renderImage(function(){t.viewed=!0,t.viewing=!1,I(i.viewed)&&X(e,z,i.viewed,{once:!0}),q(e,z,{originalImage:t.images[o],index:o,image:n},{cancelable:!1})})})},loadImage:function(t){var n=t.target,t=n.parentNode,o=t.offsetWidth||30,s=t.offsetHeight||50,a=!!N(n,"filled");zt(n,this.options,function(t,e){var t=t/e,e=o,i=s;o<s*t?a?e=s*t:i=o/t:a?i=o/t:e=s*t,C(n,O({width:e,height:i},xt({translateX:(o-e)/2,translateY:(s-i)/2})))})},keydown:function(t){var e=this.options;if(e.keyboard){var i=t.keyCode||t.which||t.charCode;if(13===i&&this.viewer.contains(t.target)&&this.click(t),this.fulled)switch(i){case 27:this.played?this.stop():e.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(e.loop);break;case 38:t.preventDefault(),this.zoom(e.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(e.loop);break;case 40:t.preventDefault(),this.zoom(-e.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle())}}},dragstart:function(t){"img"===t.target.localName&&t.preventDefault()},pointerdown:function(t){var e=this.options,i=this.pointers,n=t.buttons,o=t.button;this.pointerMoved=!1,!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(E(n)&&1!==n||E(o)&&0!==o||t.ctrlKey)||(t.preventDefault(),t.changedTouches?A(t.changedTouches,function(t){i[t.identifier]=Et(t)}):i[t.pointerId||0]=Et(t),n=!!e.movable&&h,e.zoomOnTouch&&e.zoomable&&1<Object.keys(i).length?n=c:e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(n=j),!e.transition||n!==h&&n!==c||M(this.image,m),this.action=n)},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),t.changedTouches?A(t.changedTouches,function(t){O(e[t.identifier]||{},Et(t,!0))}):O(e[t.pointerId||0]||{},Et(t,!0)),this.change(t))},pointerup:function(t){var e,i=this,n=this.options,o=this.action,s=this.pointers;t.changedTouches?A(t.changedTouches,function(t){e=s[t.identifier],delete s[t.identifier]}):(e=s[t.pointerId||0],delete s[t.pointerId||0]),o&&(t.preventDefault(),!n.transition||o!==h&&o!==c||R(this.image,m),this.action=!1,a)&&o!==c&&e&&Date.now()-e.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),n.toggleOnDblclick&&this.viewed&&t.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){q(i.image,Q,{originalEvent:t})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){i.imageClicked=!1},500)):(this.imageClicked=!1,n.backdrop&&"static"!==n.backdrop&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){q(i.canvas,w,{originalEvent:t})},50))))},resize:function(){var e=this;this.isShown&&!this.hiding&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage()}),this.played)&&(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?this.stop():A(this.player.getElementsByTagName("img"),function(t){X(t,y,e.loadImage.bind(e),{once:!0}),q(t,y)}))},wheel:function(t){var e,i,n=this;this.viewed&&(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout(function(){n.wheeling=!1},50),e=Number(this.options.zoomRatio)||.1,i=1,t.deltaY?i=0<t.deltaY?1:-1:t.wheelDelta?i=-t.wheelDelta/120:t.detail&&(i=0<t.detail?1:-1),this.zoom(-i*e,!0,null,t)))}},It={show:function(){var t,e,i=0<arguments.length&&void 0!==arguments[0]&&arguments[0],n=this.element,o=this.options;return o.inline||this.showing||this.isShown||this.showing||(this.ready?(I(o.show)&&X(n,"show",o.show,{once:!0}),!1!==q(n,"show")&&this.ready&&(this.hiding&&this.transitioning.abort(),this.showing=!0,this.open(),M(t=this.viewer,v),t.setAttribute("role","dialog"),t.setAttribute("aria-labelledby",this.title.id),t.setAttribute("aria-modal",!0),t.removeAttribute("aria-hidden"),o.transition&&!i?(e=this.shown.bind(this),this.transitioning={abort:function(){Y(t,k,e),M(t,u)}},R(t,m),t.initialOffsetWidth=t.offsetWidth,X(t,k,e,{once:!0}),R(t,u)):(R(t,u),this.shown()))):(this.build(),this.ready&&this.show(i))),this},hide:function(){var e,t,i,n,o,s=this,a=0<arguments.length&&void 0!==arguments[0]&&arguments[0],r=this.element,l=this.options;return l.inline||this.hiding||!this.isShown&&!this.showing||(I(l.hide)&&X(r,"hide",l.hide,{once:!0}),!1!==q(r,"hide")&&(this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort(),e=this.viewer,t=this.image,i=function(){M(e,u),s.hidden()},l.transition&&!a?(n=function(t){t&&t.target===e&&(Y(e,k,n),s.hidden())},o=function(){L(e,m)?(X(e,k,n),M(e,u)):i()},this.transitioning={abort:function(){s.viewed&&L(t,m)?Y(t,k,o):L(e,m)&&Y(e,k,n)}},this.viewed&&L(t,m)?(X(t,k,o,{once:!0}),this.zoomTo(0,!1,null,null,!0)):o()):i())),this},view:function(){var i=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options.initialViewIndex,t=Number(t)||0;if(!(this.hiding||this.played||t<0||t>=this.length||this.viewed&&t===this.index)){if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var e,n,o,s=this.element,a=this.options,r=this.title,l=this.canvas,h=this.items[t],c=h.querySelector("img"),u=N(c,"originalUrl"),d=c.getAttribute("alt"),m=document.createElement("img");A(a.inheritedAttributes,function(t){var e=c.getAttribute(t);null!==e&&m.setAttribute(t,e)}),m.src=u,m.alt=d,I(a.view)&&X(s,"view",a.view,{once:!0}),!1===q(s,"view",{originalImage:this.images[t],index:t,image:m})||!this.isShown||this.hiding||this.played||((u=this.items[this.index])&&(M(u,f),u.removeAttribute("aria-selected")),R(h,f),h.setAttribute("aria-selected",!0),a.focus&&h.focus(),this.image=m,this.viewed=!1,this.index=t,this.imageData={},R(m,p),a.loading&&R(l,b),l.innerHTML="",l.appendChild(m),this.renderList(),r.innerHTML="",X(s,z,e=function(){var t=i.imageData,e=Array.isArray(a.title)?a.title[1]:a.title;r.innerHTML=T(e=I(e)?e.call(i,m,t):"".concat(d," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")"))?e.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):e},{once:!0}),this.viewing={abort:function(){Y(s,z,e),m.complete?i.imageRendering?i.imageRendering.abort():i.imageInitializing&&i.imageInitializing.abort():(m.src="",Y(m,y,n),i.timeout&&clearTimeout(i.timeout))}},m.complete?this.load():(X(m,y,n=function(){Y(m,x,o),i.load()},{once:!0}),X(m,x,o=function(){Y(m,y,n),i.timeout&&(clearTimeout(i.timeout),i.timeout=!1),M(m,p),a.loading&&M(i.canvas,b)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){M(m,p),i.timeout=!1},1e3)))}return this},prev:function(){var t=this.index-1;return t<0&&(t=0<arguments.length&&void 0!==arguments[0]&&arguments[0]?this.length-1:0),this.view(t),this},next:function(){var t=this.length-1,e=this.index+1;return this.view(e=t<e?0<arguments.length&&void 0!==arguments[0]&&arguments[0]?0:t:e),this},move:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData;return this.moveTo(D(t)?t:i.x+Number(t),D(e)?e:i.y+Number(e)),this},moveTo:function(t){var e=this,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,o=this.element,s=this.options,a=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&s.movable){var r=a.x,l=a.y,h=!1;if(E(t)?h=!0:t=r,E(i)?h=!0:i=l,h){if(I(s.move)&&X(o,"move",s.move,{once:!0}),!1===q(o,"move",{x:t,y:i,oldX:r,oldY:l,originalEvent:n}))return this;a.x=t,a.y=i,a.left=t,a.top=i,this.moving=!0,this.renderImage(function(){e.moving=!1,I(s.moved)&&X(o,"moved",s.moved,{once:!0}),q(o,"moved",{x:t,y:i,oldX:r,oldY:l,originalEvent:n},{cancelable:!1})})}}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t)),this},rotateTo:function(t){var e=this,i=this.element,n=this.options,o=this.imageData;if(E(t=Number(t))&&this.viewed&&!this.played&&n.rotatable){var s=o.rotate;if(I(n.rotate)&&X(i,"rotate",n.rotate,{once:!0}),!1===q(i,"rotate",{degree:t,oldDegree:s}))return this;o.rotate=t,this.rotating=!0,this.renderImage(function(){e.rotating=!1,I(n.rotated)&&X(i,lt,n.rotated,{once:!0}),q(i,lt,{degree:t,oldDegree:s},{cancelable:!1})})}return this},scaleX:function(t){return this.scale(t,this.imageData.scaleY),this},scaleY:function(t){return this.scale(this.imageData.scaleX,t),this},scale:function(t){var e=this,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=this.element,o=this.options,s=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&o.scalable){var a=s.scaleX,r=s.scaleY,l=!1;if(E(t)?l=!0:t=a,E(i)?l=!0:i=r,l){if(I(o.scale)&&X(n,"scale",o.scale,{once:!0}),!1===q(n,"scale",{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:r}))return this;s.scaleX=t,s.scaleY=i,this.scaling=!0,this.renderImage(function(){e.scaling=!1,I(o.scaled)&&X(n,"scaled",o.scaled,{once:!0}),q(n,"scaled",{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:r},{cancelable:!1})})}}return this},zoom:function(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,o=this.imageData;return t=Number(t),this.zoomTo(o.width*(t=t<0?1/(1-t):1+t)/o.naturalWidth,e,i,n),this},zoomTo:function(t){var i,n,o,e=this,s=1<arguments.length&&void 0!==arguments[1]&&arguments[1],a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,l=4<arguments.length&&void 0!==arguments[4]&&arguments[4],h=this.element,c=this.options,u=this.pointers,d=this.imageData,m=d.x,g=d.y,f=d.width,v=d.height,p=d.naturalWidth,b=d.naturalHeight;if(E(t=Math.max(0,t))&&this.viewed&&!this.played&&(l||c.zoomable)){if(l||(l=Math.max(.01,c.minZoomRatio),y=Math.min(100,c.maxZoomRatio),t=Math.min(Math.max(t,l),y)),r)switch(r.type){case"wheel":.055<=c.zoomRatio&&.95<t&&t<1.05&&(t=1);break;case"pointermove":case"touchmove":case"mousemove":.99<t&&t<1.01&&(t=1)}var w,l=p*t,y=b*t,p=l-f,b=y-v,x=d.ratio;if(I(c.zoom)&&X(h,"zoom",c.zoom,{once:!0}),!1===q(h,"zoom",{ratio:t,oldRatio:x,originalEvent:r}))return this;this.zooming=!0,r?(w={left:(w=(w=this.viewer).getBoundingClientRect()).left+(window.pageXOffset-document.documentElement.clientLeft),top:w.top+(window.pageYOffset-document.documentElement.clientTop)},u=u&&0<Object.keys(u).length?(o=n=i=0,A(u,function(t){var e=t.startX;i+=e,n+=t.startY,o+=1}),{pageX:i/=o,pageY:n/=o}):{pageX:r.pageX,pageY:r.pageY},d.x-=(u.pageX-w.left-m)/f*p,d.y-=(u.pageY-w.top-g)/v*b):S(a)&&E(a.x)&&E(a.y)?(d.x-=p*((a.x-m)/f),d.y-=b*((a.y-g)/v)):(d.x-=p/2,d.y-=b/2),d.left=d.x,d.top=d.y,d.width=l,d.height=y,d.oldRatio=x,d.ratio=t,this.renderImage(function(){e.zooming=!1,I(c.zoomed)&&X(h,"zoomed",c.zoomed,{once:!0}),q(h,"zoomed",{ratio:t,oldRatio:x,originalEvent:r},{cancelable:!1})}),s&&this.tooltip()}return this},play:function(){var t,o,s,a,r,l,h,e,i,n=this,c=0<arguments.length&&void 0!==arguments[0]&&arguments[0];return this.isShown&&!this.played&&(t=this.element,I((o=this.options).play)&&X(t,"play",o.play,{once:!0}),!1!==q(t,"play")&&(s=this.player,a=this.loadImage.bind(this),r=[],h=l=0,this.played=!0,this.onLoadWhenPlay=a,c&&this.requestFullscreen(c),R(s,d),A(this.items,function(t,e){var i=t.querySelector("img"),n=document.createElement("img");n.src=N(i,"originalUrl"),n.alt=i.getAttribute("alt"),n.referrerPolicy=i.referrerPolicy,l+=1,R(n,B),F(n,m,o.transition),L(t,f)&&(R(n,u),h=e),r.push(n),X(n,y,a,{once:!0}),s.appendChild(n)}),E(o.interval))&&0<o.interval&&(e=function(){clearTimeout(n.playing.timeout),M(r[h],u),R(r[h=0<=--h?h:l-1],u),n.playing.timeout=setTimeout(e,o.interval)},i=function(){clearTimeout(n.playing.timeout),M(r[h],u),R(r[h=(h+=1)<l?h:0],u),n.playing.timeout=setTimeout(i,o.interval)},1<l))&&(this.playing={prev:e,next:i,timeout:setTimeout(i,o.interval)}),this},stop:function(){var t,e,i=this;return this.played&&(t=this.element,I((e=this.options).stop)&&X(t,"stop",e.stop,{once:!0}),!1!==q(t,"stop"))&&(e=this.player,clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,A(e.getElementsByTagName("img"),function(t){Y(t,y,i.onLoadWhenPlay)}),M(e,d),e.innerHTML="",this.exitFullscreen()),this},full:function(){var t=this,e=this.options,i=this.viewer,n=this.image,o=this.list;return this.isShown&&!this.played&&!this.fulled&&e.inline&&(this.fulled=!0,this.open(),R(this.button,K),e.transition&&(M(o,m),this.viewed)&&M(n,m),R(i,V),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),C(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=O({},this.containerData),this.renderList(),this.viewed)&&this.initImage(function(){t.renderImage(function(){e.transition&&setTimeout(function(){R(n,m),R(o,m)},0)})}),this},exit:function(){var t=this,e=this.options,i=this.viewer,n=this.image,o=this.list;return this.isShown&&!this.played&&this.fulled&&e.inline&&(this.fulled=!1,this.close(),M(this.button,K),e.transition&&(M(o,m),this.viewed)&&M(n,m),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),M(i,V),C(i,{zIndex:e.zIndexInline}),this.viewerData=O({},this.parentData),this.renderViewer(),this.renderList(),this.viewed)&&this.initImage(function(){t.renderImage(function(){e.transition&&setTimeout(function(){R(n,m),R(o,m)},0)})}),this},tooltip:function(){var t=this,e=this.options,i=this.tooltipBox,n=this.imageData;return this.viewed&&!this.played&&e.tooltip&&(i.textContent="".concat(Math.round(100*n.ratio),"%"),this.tooltipping?clearTimeout(this.tooltipping):e.transition?(this.fading&&q(i,k),R(i,d),R(i,B),R(i,m),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,R(i,u)):(R(i,d),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){e.transition?(X(i,k,function(){M(i,d),M(i,B),M(i,m),i.setAttribute("aria-hidden",!0),t.fading=!1},{once:!0}),M(i,u),t.fading=!0):(M(i,d),i.setAttribute("aria-hidden",!0)),t.tooltipping=!1},1e3)),this},toggle:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;return 1===this.imageData.ratio?this.zoomTo(this.imageData.oldRatio,!0,null,t):this.zoomTo(1,!0,null,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=O({},this.initialImageData),this.renderImage()),this},update:function(){var n,o,e=this,t=this.element,i=this.options,s=this.isImg;return s&&!t.parentNode?this.destroy():(n=[],A(s?[t]:t.querySelectorAll("img"),function(t){I(i.filter)?i.filter.call(e,t)&&n.push(t):e.getImageURL(t)&&n.push(t)}),n.length&&(this.images=n,this.length=n.length,this.ready?(o=[],A(this.items,function(t,e){var t=t.querySelector("img"),i=n[e];i&&t&&i.src===t.src&&i.alt===t.alt||o.push(e)}),C(this.list,{width:"auto"}),this.initList(),this.isShown&&(this.length?this.viewed&&(0<=(s=o.indexOf(this.index))?(this.viewed=!1,this.view(Math.max(Math.min(this.index-s,this.length-1),0))):(R(t=this.items[this.index],f),t.setAttribute("aria-selected",!0))):(this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""))):this.build()),this)},destroy:function(){var t=this.element,e=this.options;return t[g]&&(this.destroyed=!0,this.ready?(this.played&&this.stop(),e.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):e.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),e.inline||Y(t,w,this.onStart),t[g]=void 0),this}},At={getImageURL:function(t){var e=this.options.url;return e=T(e)?t.getAttribute(e):I(e)?e.call(this,t):""},enforceFocus:function(){var n=this;this.clearEnforceFocus(),X(document,et,this.onFocusin=function(t){var e=n.viewer,i=t.target;if(i!==document&&i!==e&&!e.contains(i)){for(;i;){if(null!==i.getAttribute("tabindex")||"true"===i.getAttribute("aria-modal"))return;i=i.parentElement}e.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(Y(document,et,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;R(t,J),0<this.scrollbarWidth&&(t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var t=this.body;M(t,J),0<this.scrollbarWidth&&(t.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var t=this.element,e=this.options,i=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,e.focus&&(i.focus(),this.enforceFocus()),I(e.shown)&&X(t,"shown",e.shown,{once:!0}),!1!==q(t,"shown")&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,e=this.options,i=this.viewer;e.fucus&&this.clearEnforceFocus(),this.close(),this.unbind(),R(i,v),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),i.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(I(e.hidden)&&X(t,"hidden",e.hidden,{once:!0}),q(t,"hidden",null,{cancelable:!1}))},requestFullscreen:function(t){var e=this.element.ownerDocument;this.fulled&&!(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)&&((e=e.documentElement).requestFullscreen?S(t)?e.requestFullscreen(t):e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen())},exitFullscreen:function(){var t=this.element.ownerDocument;this.fulled&&(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},change:function(t){var e=this.options,i=this.pointers,n=i[Object.keys(i)[0]];if(n){var s,a,o=n.endX-n.startX,r=n.endY-n.startY;switch(this.action){case h:0==o&&0==r||(this.pointerMoved=!0,this.move(o,r,t));break;case c:this.zoom((s=P({},l=i),a=[],A(l,function(o,t){delete s[t],A(s,function(t){var e=Math.abs(o.startX-t.startX),i=Math.abs(o.startY-t.startY),n=Math.abs(o.endX-t.endX),t=Math.abs(o.endY-t.endY),e=Math.sqrt(e*e+i*i),i=Math.sqrt(n*n+t*t);a.push((i-e)/e)})}),a.sort(function(t,e){return Math.abs(t)<Math.abs(e)}),a[0]),!1,null,t);break;case j:this.action="switched";var l=Math.abs(o);1<l&&l>Math.abs(r)&&(this.pointers={},1<o?this.prev(e.loop):o<-1&&this.next(e.loop))}A(i,function(t){t.startX=t.endX,t.startY=t.endY})}},isSwitchable:function(){var t=this.imageData,e=this.viewerData;return 1<this.length&&0<=t.x&&0<=t.y&&t.width<=e.width&&t.height<=e.height}},Ot=e.Viewer,Ct=(Dt=-1,function(){return Dt+=1}),e=(()=>{function o(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=this,n=o;if(!(i instanceof n))throw new TypeError("Cannot call a class as a function");if(!t||1!==t.nodeType)throw new Error("The first argument is required and must be an element.");this.element=t,this.options=O({},W,S(e)&&e),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=Ct(),this.init()}return t=o,i=[{key:"noConflict",value:function(){return window.Viewer=Ot,o}},{key:"setDefaults",value:function(t){O(W,S(t)&&t)}}],(e=[{key:"init",value:function(){var t,e,i,n,o=this,s=this.element,a=this.options;s[g]||(s[g]=this,a.focus&&!a.keyboard&&(a.focus=!1),e=[],A((t="img"===s.localName)?[s]:s.querySelectorAll("img"),function(t){I(a.filter)?a.filter.call(o,t)&&e.push(t):o.getImageURL(t)&&e.push(t)}),this.isImg=t,this.length=e.length,this.images=e,this.initBody(),D(document.createElement(g).style.transition)&&(a.transition=!1),a.inline?(i=0,n=function(){var t;(i+=1)===o.length&&(o.initializing=!1,o.delaying={abort:function(){clearTimeout(t)}},t=setTimeout(function(){o.delaying=!1,o.build()},0))},this.initializing={abort:function(){A(e,function(t){t.complete||(Y(t,y,n),Y(t,x,n))})}},A(e,function(t){var e,i;t.complete?n():(X(t,y,e=function(){Y(t,x,i),n()},{once:!0}),X(t,x,i=function(){Y(t,y,e),n()},{once:!0}))})):X(s,w,this.onStart=function(t){t=t.target;"img"!==t.localName||I(a.filter)&&!a.filter.call(o,t)||o.view(o.images.indexOf(t))}))}},{key:"build",value:function(){var t,s,e,i,n,o,a,r,l,h,c,u,d,m;this.ready||(t=this.element,s=this.options,e=t.parentNode,(d=document.createElement("div")).innerHTML='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>',d=(i=d.querySelector(".".concat(g,"-container"))).querySelector(".".concat(g,"-title")),n=i.querySelector(".".concat(g,"-toolbar")),m=i.querySelector(".".concat(g,"-navbar")),o=i.querySelector(".".concat(g,"-button")),a=i.querySelector(".".concat(g,"-canvas")),this.parent=e,this.viewer=i,this.title=d,this.toolbar=n,this.navbar=m,this.button=o,this.canvas=a,this.footer=i.querySelector(".".concat(g,"-footer")),this.tooltipBox=i.querySelector(".".concat(g,"-tooltip")),this.player=i.querySelector(".".concat(g,"-player")),this.list=i.querySelector(".".concat(g,"-list")),i.id="".concat(g).concat(this.id),d.id="".concat(g,"Title").concat(this.id),R(d,s.title?Tt(Array.isArray(s.title)?s.title[0]:s.title):v),R(m,s.navbar?Tt(s.navbar):v),F(o,v,!s.button),s.keyboard&&o.setAttribute("tabindex",0),s.backdrop&&(R(i,"".concat(g,"-backdrop")),s.inline||"static"===s.backdrop||pt(a,ht,"hide")),T(s.className)&&s.className&&s.className.split(ct).forEach(function(t){R(i,t)}),s.toolbar?(r=document.createElement("ul"),l=S(s.toolbar),h=ut.slice(0,3),c=ut.slice(7,9),u=ut.slice(9),l||R(n,Tt(s.toolbar)),A(l?s.toolbar:ut,function(t,e){var i,n=l&&S(t),e=l?vt(e):t,o=n&&!D(t.show)?t.show:t;!o||!s.zoomable&&-1!==h.indexOf(e)||!s.rotatable&&-1!==c.indexOf(e)||!s.scalable&&-1!==u.indexOf(e)||(i=n&&!D(t.size)?t.size:t,n=n&&!D(t.click)?t.click:t,t=document.createElement("li"),s.keyboard&&t.setAttribute("tabindex",0),t.setAttribute("role","button"),R(t,"".concat(g,"-").concat(e)),I(n)||pt(t,ht,e),E(o)&&R(t,Tt(o)),-1!==["small","large"].indexOf(i)?R(t,"".concat(g,"-").concat(i)):"play"===e&&R(t,"".concat(g,"-large")),I(n)&&X(t,w,n),r.appendChild(t))}),n.appendChild(r)):R(n,v),s.rotatable||(R(d=n.querySelectorAll('li[class*="rotate"]'),p),A(d,function(t){n.appendChild(t)})),s.inline?(R(o,U),C(i,{zIndex:s.zIndexInline}),"static"===window.getComputedStyle(e).position&&C(e,{position:"relative"}),e.insertBefore(i,t.nextSibling)):(R(o,H),R(i,V),R(i,B),R(i,v),C(i,{zIndex:s.zIndex}),(m=(m=T(m=s.container)?t.ownerDocument.querySelector(m):m)||this.body).appendChild(i)),s.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,I(s.ready)&&X(t,"ready",s.ready,{once:!0}),!1===q(t,"ready")?this.ready=!1:this.ready&&s.inline&&this.view(this.index))}}])&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i})();return O(e.prototype,i,t,St,It,At),e});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viewerjs",
3
3
  "description": "JavaScript image viewer.",
4
- "version": "1.11.6",
4
+ "version": "1.11.7",
5
5
  "main": "dist/viewer.common.js",
6
6
  "module": "dist/viewer.esm.js",
7
7
  "browser": "dist/viewer.js",
@@ -20,7 +20,7 @@
20
20
  "compress": "npm run compress:css && npm run compress:js",
21
21
  "compress:css": "postcss dist/viewer.css -u cssnano -o dist/viewer.min.css --no-map",
22
22
  "compress:js": "uglifyjs dist/viewer.js -o dist/viewer.min.js -c -m --comments /^!/",
23
- "copy": "cpy dist/viewer.css docs/css",
23
+ "copy": "cpy dist/viewer.css docs/css --flat",
24
24
  "lint": "npm run lint:js && npm run lint:css",
25
25
  "lint:css": "stylelint **/*.{css,scss} --fix",
26
26
  "lint:js": "eslint . --fix",
@@ -28,7 +28,6 @@
28
28
  "release": "npm run clean && npm run lint && npm run build && npm run compress && npm run copy && npm test",
29
29
  "start": "npm-run-all --parallel watch:*",
30
30
  "test": "karma start",
31
- "test:coverage": "cat coverage/lcov.info | codecov",
32
31
  "watch:css": "postcss src/index.css -o docs/css/viewer.css -m -w",
33
32
  "watch:js": "rollup -c -m -w"
34
33
  },
@@ -57,24 +56,24 @@
57
56
  },
58
57
  "homepage": "https://fengyuanchen.github.io/viewerjs",
59
58
  "devDependencies": {
60
- "@babel/core": "^7.22.20",
61
- "@babel/preset-env": "^7.22.20",
62
- "@commitlint/cli": "^17.7.1",
63
- "@commitlint/config-conventional": "^17.7.0",
59
+ "@babel/core": "^7.26.0",
60
+ "@babel/preset-env": "^7.26.0",
61
+ "@commitlint/cli": "^17.8.1",
62
+ "@commitlint/config-conventional": "^17.8.1",
64
63
  "@rollup/plugin-babel": "^5.3.1",
65
64
  "babel-plugin-istanbul": "^6.1.1",
66
- "chai": "^4.3.8",
65
+ "chai": "^4.5.0",
67
66
  "change-case": "^4.1.2",
68
67
  "codecov": "^3.8.3",
69
- "cpy-cli": "^4.2.0",
68
+ "cpy-cli": "^5.0.0",
70
69
  "create-banner": "^2.0.0",
71
70
  "cssnano": "^5.1.15",
72
71
  "del-cli": "^5.1.0",
73
72
  "eslint": "^8.49.0",
74
73
  "eslint-config-airbnb-base": "^15.0.0",
75
- "eslint-plugin-import": "^2.28.1",
74
+ "eslint-plugin-import": "^2.31.0",
76
75
  "husky": "^8.0.3",
77
- "karma": "^6.4.2",
76
+ "karma": "^6.4.4",
78
77
  "karma-chai": "^0.1.0",
79
78
  "karma-chrome-launcher": "^3.2.0",
80
79
  "karma-coverage-istanbul-reporter": "^3.0.3",
@@ -84,17 +83,17 @@
84
83
  "lint-staged": "^13.3.0",
85
84
  "mocha": "^9.2.2",
86
85
  "npm-run-all": "^4.1.5",
87
- "postcss": "^8.4.29",
86
+ "postcss": "^8.4.49",
88
87
  "postcss-cli": "^10.1.0",
89
88
  "postcss-header": "^3.0.3",
90
89
  "postcss-import": "^15.1.0",
91
90
  "postcss-preset-env": "^7.8.3",
92
91
  "postcss-url": "^10.1.3",
93
92
  "puppeteer": "^19.11.1",
94
- "rollup": "^2.79.1",
93
+ "rollup": "^2.79.2",
95
94
  "stylelint": "^13.13.1",
96
95
  "stylelint-config-standard": "^22.0.0",
97
96
  "stylelint-order": "^4.1.0",
98
- "uglify-js": "^3.17.4"
97
+ "uglify-js": "^3.19.3"
99
98
  }
100
99
  }
@@ -13,7 +13,7 @@
13
13
  .viewer-fullscreen-exit,
14
14
  .viewer-close {
15
15
  &::before {
16
- background-image: url('../images/icons.png');
16
+ background-image: url('../images/icons.svg');
17
17
  background-repeat: no-repeat;
18
18
  background-size: 280px;
19
19
  color: transparent;
@@ -14,7 +14,7 @@
14
14
  &-fullscreen-exit,
15
15
  &-close {
16
16
  &::before {
17
- background-image: url('../images/icons.png');
17
+ background-image: url('../images/icons.svg');
18
18
  background-repeat: no-repeat;
19
19
  background-size: 280px;
20
20
  color: transparent;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 560 40"><path fill="#fff" d="M49.6 17.9h20.2v3.9H49.6zm123.1 2 10.9-11 2.7 2.8-8.2 8.2 8.2 8.2-2.7 2.7-10.9-10.9zm94 0-10.8-11-2.7 2.8 8.1 8.2-8.1 8.2 2.7 2.7 10.8-10.9zM212 9.3l20.1 10.6L212 30.5V9.3zm161.5 4.6-7.2 6 7.2 5.9v-4h12.4v4l7.3-5.9-7.3-6v4h-12.4v-4zm40.2 12.3 5.9 7.2 5.9-7.2h-4V13.6h4l-5.9-7.3-5.9 7.3h4v12.6h-4zm35.9-16.5h6.3v2h-4.3V16h-2V9.7Zm14 0h6.2V16h-2v-4.3h-4.2v-2Zm6.2 14V30h-6.2v-2h4.2v-4.3h2Zm-14 6.3h-6.2v-6.3h2v4.4h4.3v2Zm-438 .1v-8.3H9.6v-3.9h8.2V9.7h3.9v8.2h8.1v3.9h-8.1v8.3h-3.9zM93.6 9.7h-5.8v3.9h2V30h3.8V9.7zm16.1 0h-5.8v3.9h1.9V30h3.9V9.7zm-11.9 4.1h3.9v3.9h-3.9zm0 8.2h3.9v3.9h-3.9zm244.6-11.7 7.2 5.9-7.2 6v-3.6c-5.4-.4-7.8.8-8.7 2.8-.8 1.7-1.8 4.9 2.8 8.2-6.3-2-7.5-6.9-6-11.3 1.6-4.4 8-5 11.9-4.9v-3.1Zm147.2 13.4h6.3V30h-2v-4.3h-4.3v-2zm14 6.3v-6.3h6.2v2h-4.3V30h-1.9zm6.2-14h-6.2V9.7h1.9V14h4.3v2zm-13.9 0h-6.3v-2h4.3V9.7h2V16zm33.3 12.5 8.6-8.6-8.6-8.7 1.9-1.9 8.6 8.7 8.6-8.7 1.9 1.9-8.6 8.7 8.6 8.6-1.9 2-8.6-8.7-8.6 8.7-1.9-2zM297 10.3l-7.1 5.9 7.2 6v-3.6c5.3-.4 7.7.8 8.7 2.8.8 1.7 1.7 4.9-2.9 8.2 6.3-2 7.5-6.9 6-11.3-1.6-4.4-7.9-5-11.8-4.9v-3.1Zm-157.3-.6c2.3 0 4.4.7 6 2l2.5-3 1.9 9.2h-9.3l2.6-3.1a6.2 6.2 0 0 0-9.9 5.1c0 3.4 2.8 6.3 6.2 6.3 2.8 0 5.1-1.9 6-4.4h4c-1 4.7-5 8.3-10 8.3a10 10 0 0 1-10-10.2 10 10 0 0 1 10-10.2Z"/></svg>
Binary file
Binary file