viewerjs 1.10.2 → 1.10.3

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,11 +1,11 @@
1
1
  /*!
2
- * Viewer.js v1.10.2
2
+ * Viewer.js v1.10.3
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: 2021-10-22T13:59:51.046Z
8
+ * Date: 2022-02-02T05:15:01.702Z
9
9
  */
10
10
 
11
11
  function ownKeys(object, enumerableOnly) {
@@ -13,14 +13,9 @@ function ownKeys(object, enumerableOnly) {
13
13
 
14
14
  if (Object.getOwnPropertySymbols) {
15
15
  var symbols = Object.getOwnPropertySymbols(object);
16
-
17
- if (enumerableOnly) {
18
- symbols = symbols.filter(function (sym) {
19
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
20
- });
21
- }
22
-
23
- keys.push.apply(keys, symbols);
16
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
17
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
18
+ })), keys.push.apply(keys, symbols);
24
19
  }
25
20
 
26
21
  return keys;
@@ -28,19 +23,12 @@ function ownKeys(object, enumerableOnly) {
28
23
 
29
24
  function _objectSpread2(target) {
30
25
  for (var i = 1; i < arguments.length; i++) {
31
- var source = arguments[i] != null ? arguments[i] : {};
32
-
33
- if (i % 2) {
34
- ownKeys(Object(source), true).forEach(function (key) {
35
- _defineProperty(target, key, source[key]);
36
- });
37
- } else if (Object.getOwnPropertyDescriptors) {
38
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
39
- } else {
40
- ownKeys(Object(source)).forEach(function (key) {
41
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
42
- });
43
- }
26
+ var source = null != arguments[i] ? arguments[i] : {};
27
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
28
+ _defineProperty(target, key, source[key]);
29
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
30
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
31
+ });
44
32
  }
45
33
 
46
34
  return target;
@@ -49,17 +37,11 @@ function _objectSpread2(target) {
49
37
  function _typeof(obj) {
50
38
  "@babel/helpers - typeof";
51
39
 
52
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
53
- _typeof = function (obj) {
54
- return typeof obj;
55
- };
56
- } else {
57
- _typeof = function (obj) {
58
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
59
- };
60
- }
61
-
62
- return _typeof(obj);
40
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
41
+ return typeof obj;
42
+ } : function (obj) {
43
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
44
+ }, _typeof(obj);
63
45
  }
64
46
 
65
47
  function _classCallCheck(instance, Constructor) {
@@ -81,6 +63,9 @@ function _defineProperties(target, props) {
81
63
  function _createClass(Constructor, protoProps, staticProps) {
82
64
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
83
65
  if (staticProps) _defineProperties(Constructor, staticProps);
66
+ Object.defineProperty(Constructor, "prototype", {
67
+ writable: false
68
+ });
84
69
  return Constructor;
85
70
  }
86
71
 
@@ -1452,9 +1437,10 @@ var handlers = {
1452
1437
  // Cancel the emulated double click when the native dblclick event was triggered.
1453
1438
  if (IS_TOUCH_DEVICE && event.isTrusted) {
1454
1439
  clearTimeout(this.doubleClickImageTimeout);
1455
- }
1440
+ } // XXX: No pageX/Y properties in custom event, fallback to the original event.
1441
+
1456
1442
 
1457
- this.toggle(event);
1443
+ this.toggle(event.isTrusted ? event : event.detail && event.detail.originalEvent);
1458
1444
  }
1459
1445
  },
1460
1446
  load: function load() {
@@ -1721,7 +1707,9 @@ var handlers = {
1721
1707
  this.imageClicked = false; // This timeout will be cleared later when a native dblclick event is triggering
1722
1708
 
1723
1709
  this.doubleClickImageTimeout = setTimeout(function () {
1724
- dispatchEvent(_this2.image, EVENT_DBLCLICK);
1710
+ dispatchEvent(_this2.image, EVENT_DBLCLICK, {
1711
+ originalEvent: event
1712
+ });
1725
1713
  }, 50);
1726
1714
  } else {
1727
1715
  this.imageClicked = true; // The default timing of a double click in Windows is 500 ms
@@ -1736,7 +1724,9 @@ var handlers = {
1736
1724
  if (options.backdrop && options.backdrop !== 'static' && event.target === this.canvas) {
1737
1725
  // This timeout will be cleared later when a native click event is triggering
1738
1726
  this.clickCanvasTimeout = setTimeout(function () {
1739
- dispatchEvent(_this2.canvas, EVENT_CLICK);
1727
+ dispatchEvent(_this2.canvas, EVENT_CLICK, {
1728
+ originalEvent: event
1729
+ });
1740
1730
  }, 50);
1741
1731
  }
1742
1732
  }
@@ -2490,8 +2480,24 @@ var methods = {
2490
2480
  ratio = Math.min(Math.max(ratio, minZoomRatio), maxZoomRatio);
2491
2481
  }
2492
2482
 
2493
- if (_originalEvent && options.zoomRatio >= 0.055 && ratio > 0.95 && ratio < 1.05) {
2494
- ratio = 1;
2483
+ if (_originalEvent) {
2484
+ switch (_originalEvent.type) {
2485
+ case 'wheel':
2486
+ if (options.zoomRatio >= 0.055 && ratio > 0.95 && ratio < 1.05) {
2487
+ ratio = 1;
2488
+ }
2489
+
2490
+ break;
2491
+
2492
+ case 'pointermove':
2493
+ case 'touchmove':
2494
+ case 'mousemove':
2495
+ if (ratio > 0.99 && ratio < 1.01) {
2496
+ ratio = 1;
2497
+ }
2498
+
2499
+ break;
2500
+ }
2495
2501
  }
2496
2502
 
2497
2503
  var newWidth = naturalWidth * ratio;
@@ -2518,7 +2524,7 @@ var methods = {
2518
2524
 
2519
2525
  if (_originalEvent) {
2520
2526
  var offset = getOffset(this.viewer);
2521
- var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
2527
+ var center = pointers && Object.keys(pointers).length > 0 ? getPointersCenter(pointers) : {
2522
2528
  pageX: _originalEvent.pageX,
2523
2529
  pageY: _originalEvent.pageY
2524
2530
  }; // Zoom from the triggering point of the event
package/dist/viewer.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * Viewer.js v1.10.2
2
+ * Viewer.js v1.10.3
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: 2021-10-22T13:59:51.046Z
8
+ * Date: 2022-02-02T05:15:01.702Z
9
9
  */
10
10
 
11
11
  (function (global, factory) {
@@ -19,14 +19,9 @@
19
19
 
20
20
  if (Object.getOwnPropertySymbols) {
21
21
  var symbols = Object.getOwnPropertySymbols(object);
22
-
23
- if (enumerableOnly) {
24
- symbols = symbols.filter(function (sym) {
25
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
26
- });
27
- }
28
-
29
- keys.push.apply(keys, symbols);
22
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
23
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
24
+ })), keys.push.apply(keys, symbols);
30
25
  }
31
26
 
32
27
  return keys;
@@ -34,19 +29,12 @@
34
29
 
35
30
  function _objectSpread2(target) {
36
31
  for (var i = 1; i < arguments.length; i++) {
37
- var source = arguments[i] != null ? arguments[i] : {};
38
-
39
- if (i % 2) {
40
- ownKeys(Object(source), true).forEach(function (key) {
41
- _defineProperty(target, key, source[key]);
42
- });
43
- } else if (Object.getOwnPropertyDescriptors) {
44
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
45
- } else {
46
- ownKeys(Object(source)).forEach(function (key) {
47
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
48
- });
49
- }
32
+ var source = null != arguments[i] ? arguments[i] : {};
33
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
34
+ _defineProperty(target, key, source[key]);
35
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
36
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
37
+ });
50
38
  }
51
39
 
52
40
  return target;
@@ -55,17 +43,11 @@
55
43
  function _typeof(obj) {
56
44
  "@babel/helpers - typeof";
57
45
 
58
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
59
- _typeof = function (obj) {
60
- return typeof obj;
61
- };
62
- } else {
63
- _typeof = function (obj) {
64
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
65
- };
66
- }
67
-
68
- return _typeof(obj);
46
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
47
+ return typeof obj;
48
+ } : function (obj) {
49
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
50
+ }, _typeof(obj);
69
51
  }
70
52
 
71
53
  function _classCallCheck(instance, Constructor) {
@@ -87,6 +69,9 @@
87
69
  function _createClass(Constructor, protoProps, staticProps) {
88
70
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
89
71
  if (staticProps) _defineProperties(Constructor, staticProps);
72
+ Object.defineProperty(Constructor, "prototype", {
73
+ writable: false
74
+ });
90
75
  return Constructor;
91
76
  }
92
77
 
@@ -1458,9 +1443,10 @@
1458
1443
  // Cancel the emulated double click when the native dblclick event was triggered.
1459
1444
  if (IS_TOUCH_DEVICE && event.isTrusted) {
1460
1445
  clearTimeout(this.doubleClickImageTimeout);
1461
- }
1446
+ } // XXX: No pageX/Y properties in custom event, fallback to the original event.
1447
+
1462
1448
 
1463
- this.toggle(event);
1449
+ this.toggle(event.isTrusted ? event : event.detail && event.detail.originalEvent);
1464
1450
  }
1465
1451
  },
1466
1452
  load: function load() {
@@ -1727,7 +1713,9 @@
1727
1713
  this.imageClicked = false; // This timeout will be cleared later when a native dblclick event is triggering
1728
1714
 
1729
1715
  this.doubleClickImageTimeout = setTimeout(function () {
1730
- dispatchEvent(_this2.image, EVENT_DBLCLICK);
1716
+ dispatchEvent(_this2.image, EVENT_DBLCLICK, {
1717
+ originalEvent: event
1718
+ });
1731
1719
  }, 50);
1732
1720
  } else {
1733
1721
  this.imageClicked = true; // The default timing of a double click in Windows is 500 ms
@@ -1742,7 +1730,9 @@
1742
1730
  if (options.backdrop && options.backdrop !== 'static' && event.target === this.canvas) {
1743
1731
  // This timeout will be cleared later when a native click event is triggering
1744
1732
  this.clickCanvasTimeout = setTimeout(function () {
1745
- dispatchEvent(_this2.canvas, EVENT_CLICK);
1733
+ dispatchEvent(_this2.canvas, EVENT_CLICK, {
1734
+ originalEvent: event
1735
+ });
1746
1736
  }, 50);
1747
1737
  }
1748
1738
  }
@@ -2496,8 +2486,24 @@
2496
2486
  ratio = Math.min(Math.max(ratio, minZoomRatio), maxZoomRatio);
2497
2487
  }
2498
2488
 
2499
- if (_originalEvent && options.zoomRatio >= 0.055 && ratio > 0.95 && ratio < 1.05) {
2500
- ratio = 1;
2489
+ if (_originalEvent) {
2490
+ switch (_originalEvent.type) {
2491
+ case 'wheel':
2492
+ if (options.zoomRatio >= 0.055 && ratio > 0.95 && ratio < 1.05) {
2493
+ ratio = 1;
2494
+ }
2495
+
2496
+ break;
2497
+
2498
+ case 'pointermove':
2499
+ case 'touchmove':
2500
+ case 'mousemove':
2501
+ if (ratio > 0.99 && ratio < 1.01) {
2502
+ ratio = 1;
2503
+ }
2504
+
2505
+ break;
2506
+ }
2501
2507
  }
2502
2508
 
2503
2509
  var newWidth = naturalWidth * ratio;
@@ -2524,7 +2530,7 @@
2524
2530
 
2525
2531
  if (_originalEvent) {
2526
2532
  var offset = getOffset(this.viewer);
2527
- var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
2533
+ var center = pointers && Object.keys(pointers).length > 0 ? getPointersCenter(pointers) : {
2528
2534
  pageX: _originalEvent.pageX,
2529
2535
  pageY: _originalEvent.pageY
2530
2536
  }; // Zoom from the triggering point of the event
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * Viewer.js v1.10.2
2
+ * Viewer.js v1.10.3
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: 2021-10-22T13:59:46.805Z
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{-webkit-box-sizing:content-box;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;-webkit-transition:opacity .15s;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;-webkit-transition:background-color .15s;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{-webkit-box-shadow:0 0 3px #fff;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:0 5% 5px;max-width:90%;opacity:.8;overflow:hidden;text-overflow:ellipsis;-webkit-transition:opacity .15s;transition:opacity .15s;white-space:nowrap}.viewer-title:hover{opacity:1}.viewer-button{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;height:80px;overflow:hidden;position:absolute;right:-40px;top:-40px;-webkit-transition:background-color .15s;transition:background-color .15s;width:80px}.viewer-button:focus,.viewer-button:hover{background-color:rgba(0,0,0,.8)}.viewer-button:focus{-webkit-box-shadow:0 0 3px #fff;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:-webkit-grab;cursor:grab}.viewer-fade{opacity:0}.viewer-in{opacity:1}.viewer-transition{-webkit-transition:all .3s;transition:all .3s}@-webkit-keyframes viewer-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes viewer-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.viewer-loading:after{-webkit-animation:viewer-spinner 1s linear infinite;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: 2022-02-02T05:14:59.271Z
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;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:0 5% 5px;max-width:90%;opacity:.8;overflow:hidden;text-overflow:ellipsis;transition:opacity .15s;white-space:nowrap}.viewer-title:hover{opacity:1}.viewer-button{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:-webkit-grab;cursor:grab}.viewer-fade{opacity:0}.viewer-in{opacity:1}.viewer-transition{transition:all .3s}@-webkit-keyframes viewer-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes viewer-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.viewer-loading:after{-webkit-animation:viewer-spinner 1s linear infinite;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.10.2
2
+ * Viewer.js v1.10.3
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: 2021-10-22T13:59:51.046Z
8
+ * Date: 2022-02-02T05:15:01.702Z
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 e(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 l(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?e(Object(o),!0).forEach(function(t){var e,i;e=n,t=o[i=t],i in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function i(t){return(i="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 o(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,n.key,n)}}var s={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"],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,n=t?window:{},a=!(!t||!n.document.documentElement)&&"ontouchstart"in n.document.documentElement,r=t&&"PointerEvent"in n,g="viewer",c="move",u="switch",d="zoom",f="".concat(g,"-active"),v="".concat(g,"-close"),p="".concat(g,"-fade"),b="".concat(g,"-fixed"),w="".concat(g,"-fullscreen"),h="".concat(g,"-fullscreen-exit"),y="".concat(g,"-hide"),m="".concat(g,"-hide-md-down"),x="".concat(g,"-hide-sm-down"),k="".concat(g,"-hide-xs-down"),z="".concat(g,"-in"),D="".concat(g,"-invisible"),T="".concat(g,"-loading"),E="".concat(g,"-move"),I="".concat(g,"-open"),A="".concat(g,"-show"),S="".concat(g,"-transition"),O="click",C="dblclick",L="dragstart",R="focusin",F="keydown",N="load",Y="error",X=r?"pointerdown":a?"touchstart":"mousedown",M=r?"pointermove":a?"touchmove":"mousemove",q=r?"pointerup pointercancel":a?"touchend touchcancel":"mouseup",P="resize",W="transitionend",j="wheel",H="ready",B="show",V="viewed",U="rotated",K="".concat(g,"Action"),Z=/\s\s*/,$=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function _(t){return"string"==typeof t}var G=Number.isNaN||n.isNaN;function J(t){return"number"==typeof t&&!G(t)}function Q(t){return void 0===t}function tt(t){return"object"===i(t)&&null!==t}var et=Object.prototype.hasOwnProperty;function it(t){if(!tt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&et.call(i,"isPrototypeOf")}catch(t){return!1}}function nt(t){return"function"==typeof t}function ot(e,i){if(e&&nt(i))if(Array.isArray(e)||J(e.length))for(var t=e.length,n=0;n<t&&!1!==i.call(e,e[n],n,e);n+=1);else tt(e)&&Object.keys(e).forEach(function(t){i.call(e,e[t],t,e)});return e}var st=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 tt(i)&&0<e.length&&e.forEach(function(e){tt(e)&&Object.keys(e).forEach(function(t){i[t]=e[t]})}),i},at=/^(?:width|height|left|top|marginLeft|marginTop)$/;function rt(t,e){var i=t.style;ot(e,function(t,e){at.test(e)&&J(t)&&(t+="px"),i[e]=t})}function ht(t,e){return t&&e&&(t.classList?t.classList.contains(e):-1<t.className.indexOf(e))}function lt(t,e){var i;t&&e&&(J(t.length)?ot(t,function(t){lt(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 ct(t,e){t&&e&&(J(t.length)?ot(t,function(t){ct(t,e)}):t.classList?t.classList.remove(e):0<=t.className.indexOf(e)&&(t.className=t.className.replace(e,"")))}function ut(t,e,i){e&&(J(t.length)?ot(t,function(t){ut(t,e,i)}):(i?lt:ct)(t,e))}var dt=/([a-z\d])([A-Z])/g;function mt(t){return t.replace(dt,"$1-$2").toLowerCase()}function gt(t,e){return tt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(mt(e)))}function ft(t,e,i){tt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(mt(e)),i)}var vt,pt,bt=(pt=!1,t&&(vt=!1,St=function(){},Ot=Object.defineProperty({},"once",{get:function(){return pt=!0,vt},set:function(t){vt=t}}),n.addEventListener("test",St,Ot),n.removeEventListener("test",St,Ot)),pt);function wt(i,t,n,e){var o=3<arguments.length&&void 0!==e?e:{},s=n;t.trim().split(Z).forEach(function(t){var e;bt||(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 yt(s,t,a,e){var r=3<arguments.length&&void 0!==e?e:{},h=a;t.trim().split(Z).forEach(function(n){var t,o;r.once&&!bt&&(t=s.listeners,h=function(){delete o[n][a],s.removeEventListener(n,h,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]=h,s.listeners=o),s.addEventListener(n,h,r)})}function xt(t,e,i,n){var o;return nt(Event)&&nt(CustomEvent)?o=new CustomEvent(e,l({bubbles:!0,cancelable:!0,detail:i},n)):(o=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(o)}function kt(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,o=t.translateX,s=t.translateY,t=[];J(o)&&0!==o&&t.push("translateX(".concat(o,"px)")),J(s)&&0!==s&&t.push("translateY(".concat(s,"px)")),J(e)&&0!==e&&t.push("rotate(".concat(e,"deg)")),J(i)&&1!==i&&t.push("scaleX(".concat(i,")")),J(n)&&1!==n&&t.push("scaleY(".concat(n,")"));t=t.length?t.join(" "):"none";return{WebkitTransform:t,msTransform:t,transform:t}}var zt=n.navigator&&/(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(n.navigator.userAgent);function Dt(i,t,e){var n=document.createElement("img");if(i.naturalWidth&&!zt)return e(i.naturalWidth,i.naturalHeight),n;var o=document.body||document.documentElement;return n.onload=function(){e(n.width,n.height),zt||o.removeChild(n)},ot(t.inheritedAttributes,function(t){var e=i.getAttribute(t);null!==e&&n.setAttribute(t,e)}),n.src=i.src,zt||(n.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;",o.appendChild(n)),n}function Tt(t){switch(t){case 2:return k;case 3:return x;case 4:return m;default:return""}}function Et(t,e){var i=t.pageX,n=t.pageY,t={endX:i,endY:n};return e?t:l({timeStamp:Date.now(),startX:i,startY:n},t)}var It,At={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=st({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&rt(this.viewer,this.viewerData)},initList:function(){var r=this,t=this.element,h=this.options,l=this.list,c=[];l.innerHTML="",ot(this.images,function(i,t){var e,n,o=i.src,s=i.alt||(_(e=o)?decodeURIComponent(e.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""),a=r.getImageURL(i);(o||a)&&(e=document.createElement("li"),n=document.createElement("img"),ot(h.inheritedAttributes,function(t){var e=i.getAttribute(t);null!==e&&n.setAttribute(t,e)}),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"),h.keyboard&&e.setAttribute("tabindex",0),e.appendChild(n),l.appendChild(e),c.push(e))}),ot(this.items=c,function(e){var t,i,n=e.firstElementChild;ft(n,"filled",!0),h.loading&&lt(e,T),yt(n,N,t=function(t){wt(n,Y,i),h.loading&&ct(e,T),r.loadImage(t)},{once:!0}),yt(n,Y,i=function(){wt(n,N,t),h.loading&&ct(e,T)},{once:!0})}),h.transition&&yt(t,V,function(){lt(l,S)},{once:!0})},renderList:function(){var t,e,i=this.index,n=this.items[i];n&&(e=n.nextElementSibling,t=parseInt(window.getComputedStyle(e||n).marginLeft,10),e=n.offsetWidth,rt(this.list,st({width:(n=e+t)*this.length-t},kt({translateX:(this.viewerData.width-e)/2-n*i}))))},resetList:function(){var t=this.list;t.innerHTML="",ct(t,S),rt(t,kt({translateX:0}))},initImage:function(r){var t,h=this,l=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=Dt(e,l,function(t,e){var i=t/e,n=c,o=u;h.imageInitializing=!1,c<u*i?o=c/i:n=u*i;var n=Math.min(.9*n,t),o=Math.min(.9*o,e),s=(c-n)/2,a=(u-o)/2,t={left:s,top:a,x:s,y:a,width:n,height:o,oldRatio:1,ratio:n/t,aspectRatio:i,naturalWidth:t,naturalHeight:e},e=st({},t);l.rotatable&&(t.rotate=d.rotate||0,e.rotate=0),l.scalable&&(t.scaleX=d.scaleX||1,t.scaleY=d.scaleY||1,e.scaleX=1,e.scaleY=1),h.imageData=t,h.initialImageData=e,r&&r()})},renderImage:function(t){var e,i=this,n=this.image,o=this.imageData;rt(n,st({width:o.width,height:o.height,marginLeft:o.x,marginTop:o.y},kt(o))),t&&((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&ht(n,S)?(e=function(){i.imageRendering=!1,t()},this.imageRendering={abort:function(){wt(n,W,e)}},yt(n,W,e,{once:!0})):t())},resetImage:function(){var t;(this.viewing||this.viewed)&&(t=this.image,this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null)}},r={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;yt(e,O,this.onClick=this.click.bind(this)),yt(e,L,this.onDragStart=this.dragstart.bind(this)),yt(i,X,this.onPointerDown=this.pointerdown.bind(this)),yt(n,M,this.onPointerMove=this.pointermove.bind(this)),yt(n,q,this.onPointerUp=this.pointerup.bind(this)),yt(n,F,this.onKeyDown=this.keydown.bind(this)),yt(window,P,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&yt(e,j,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&yt(i,C,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;wt(e,O,this.onClick),wt(e,L,this.onDragStart),wt(i,X,this.onPointerDown),wt(n,M,this.onPointerMove),wt(n,q,this.onPointerUp),wt(n,F,this.onKeyDown),wt(window,P,this.onResize),t.zoomable&&t.zoomOnWheel&&wt(e,j,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&wt(i,C,this.onDblclick)}},t={click:function(t){var e=this.options,i=this.imageData,n=t.target,o=gt(n,K);switch(o||"img"!==n.localName||"li"!==n.parentElement.localName||(o=gt(n=n.parentElement,K)),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.hide();break;case"view":this.view(gt(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))},load:function(){var t=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var e=this.element,i=this.options,n=this.image,o=this.index,s=this.viewerData;ct(n,D),i.loading&&ct(this.canvas,T),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(){ut(n,E,i.movable),ut(n,S,i.transition),t.renderImage(function(){t.viewed=!0,t.viewing=!1,nt(i.viewed)&&yt(e,V,i.viewed,{once:!0}),xt(e,V,{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=!!gt(n,"filled");Dt(n,this.options,function(t,e){var i=t/e,t=o,e=s;o<s*i?a?t=s*i:e=o/i:a?e=o/i:t=s*i,rt(n,st({width:t,height:e},kt({translateX:(o-t)/2,translateY:(s-e)/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.prev(e.loop);break;case 38:t.preventDefault(),this.zoom(e.zoomRatio,!0);break;case 39: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.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(J(n)&&1!==n||J(o)&&0!==o||t.ctrlKey)||(t.preventDefault(),t.changedTouches?ot(t.changedTouches,function(t){i[t.identifier]=Et(t)}):i[t.pointerId||0]=Et(t),o=!!e.movable&&c,e.zoomOnTouch&&e.zoomable&&1<Object.keys(i).length?o=d:e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(o=u),!e.transition||o!==c&&o!==d||ct(this.image,S),this.action=o)},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),t.changedTouches?ot(t.changedTouches,function(t){st(e[t.identifier]||{},Et(t,!0))}):st(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?ot(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!==c&&o!==d||lt(this.image,S),this.action=!1,a&&o!==d&&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(){xt(i.image,C)},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(){xt(i.canvas,O)},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?ot(this.player.getElementsByTagName("img"),function(t){yt(t,N,e.loadImage.bind(e),{once:!0}),xt(t,N)}):this.stop()))},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,t)))}},St={show:function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.element,i=this.options;if(i.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(t),this;if(nt(i.show)&&yt(e,B,i.show,{once:!0}),!1===xt(e,B)||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var n,o=this.viewer;return ct(o,y),o.setAttribute("role","dialog"),o.setAttribute("aria-labelledby",this.title.id),o.setAttribute("aria-modal",!0),o.removeAttribute("aria-hidden"),i.transition&&!t?(n=this.shown.bind(this),this.transitioning={abort:function(){wt(o,W,n),ct(o,z)}},lt(o,S),o.initialOffsetWidth=o.offsetWidth,yt(o,W,n,{once:!0}),lt(o,z)):(lt(o,z),this.shown()),this},hide:function(){var i=this,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.element,n=this.options;if(n.inline||this.hiding||!this.isShown&&!this.showing)return this;if(nt(n.hide)&&yt(e,"hide",n.hide,{once:!0}),!1===xt(e,"hide"))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var o,s,a=this.viewer,r=this.image,h=function(){ct(a,z),i.hidden()};return n.transition&&!t?(o=function t(e){e&&e.target===a&&(wt(a,W,t),i.hidden())},s=function(){ht(a,S)?(yt(a,W,o),ct(a,z)):h()},this.transitioning={abort:function(){i.viewed&&ht(r,S)?wt(r,W,s):ht(a,S)&&wt(a,W,o)}},this.viewed&&ht(r,S)?(yt(r,W,s,{once:!0}),this.zoomTo(0,!1,null,!0)):s()):h(),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)return this;if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var e=this.element,n=this.options,o=this.title,s=this.canvas,a=this.items[t],r=a.querySelector("img"),h=gt(r,"originalUrl"),l=r.getAttribute("alt"),c=document.createElement("img");if(ot(n.inheritedAttributes,function(t){var e=r.getAttribute(t);null!==e&&c.setAttribute(t,e)}),c.src=h,c.alt=l,nt(n.view)&&yt(e,"view",n.view,{once:!0}),!1===xt(e,"view",{originalImage:this.images[t],index:t,image:c})||!this.isShown||this.hiding||this.played)return this;h=this.items[this.index];h&&(ct(h,f),h.removeAttribute("aria-selected")),lt(a,f),a.setAttribute("aria-selected",!0),n.focus&&a.focus(),this.image=c,this.viewed=!1,this.index=t,this.imageData={},lt(c,D),n.loading&&lt(s,T),s.innerHTML="",s.appendChild(c),this.renderList(),o.innerHTML="";function u(){var t=i.imageData,e=Array.isArray(n.title)?n.title[1]:n.title;o.innerHTML=_(t=nt(e)?e.call(i,c,t):"".concat(l," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")"))?t.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):t}var d,m;return yt(e,V,u,{once:!0}),this.viewing={abort:function(){wt(e,V,u),c.complete?i.imageRendering?i.imageRendering.abort():i.imageInitializing&&i.imageInitializing.abort():(c.src="",wt(c,N,d),i.timeout&&clearTimeout(i.timeout))}},c.complete?this.load():(yt(c,N,d=function(){wt(c,Y,m),i.load()},{once:!0}),yt(c,Y,m=function(){wt(c,N,d),i.timeout&&(clearTimeout(i.timeout),i.timeout=!1),ct(c,D),n.loading&&ct(i.canvas,T)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){ct(c,D),i.timeout=!1},1e3)),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(Q(t)?t:i.x+Number(t),Q(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,h=a.y,l=!1;if(J(t)?l=!0:t=r,J(i)?l=!0:i=h,l){if(nt(s.move)&&yt(o,"move",s.move,{once:!0}),!1===xt(o,"move",{x:t,y:i,oldX:r,oldY:h,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,nt(s.moved)&&yt(o,"moved",s.moved,{once:!0}),xt(o,"moved",{x:t,y:i,oldX:r,oldY:h,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(J(t=Number(t))&&this.viewed&&!this.played&&n.rotatable){var s=o.rotate;if(nt(n.rotate)&&yt(i,"rotate",n.rotate,{once:!0}),!1===xt(i,"rotate",{degree:t,oldDegree:s}))return this;o.rotate=t,this.rotating=!0,this.renderImage(function(){e.rotating=!1,nt(n.rotated)&&yt(i,U,n.rotated,{once:!0}),xt(i,U,{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,h=!1;if(J(t)?h=!0:t=a,J(i)?h=!0:i=r,h){if(nt(o.scale)&&yt(n,"scale",o.scale,{once:!0}),!1===xt(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,nt(o.scaled)&&yt(n,"scaled",o.scaled,{once:!0}),xt(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=this.imageData;return t=Number(t),this.zoomTo(n.width*(t=t<0?1/(1-t):1+t)/n.naturalWidth,e,i),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],h=this.element,l=this.options,c=this.pointers,u=this.imageData,d=u.x,m=u.y,g=u.width,f=u.height,v=u.naturalWidth,p=u.naturalHeight;if(J(t=Math.max(0,t))&&this.viewed&&!this.played&&(r||l.zoomable)){r||(b=Math.max(.01,l.minZoomRatio),w=Math.min(100,l.maxZoomRatio),t=Math.min(Math.max(t,b),w));var r=v*(t=a&&.055<=l.zoomRatio&&.95<t&&t<1.05?1:t),b=p*t,w=r-g,v=b-f,y=u.ratio;if(nt(l.zoom)&&yt(h,"zoom",l.zoom,{once:!0}),!1===xt(h,"zoom",{ratio:t,oldRatio:y,originalEvent:a}))return this;this.zooming=!0,a?(p={left:(p=(p=this.viewer).getBoundingClientRect()).left+(window.pageXOffset-document.documentElement.clientLeft),top:p.top+(window.pageYOffset-document.documentElement.clientTop)},c=c&&Object.keys(c).length?(o=n=i=0,ot(c,function(t){var e=t.startX,t=t.startY;i+=e,n+=t,o+=1}),{pageX:i/=o,pageY:n/=o}):{pageX:a.pageX,pageY:a.pageY},u.x-=(c.pageX-p.left-d)/g*w,u.y-=(c.pageY-p.top-m)/f*v):(u.x-=w/2,u.y-=v/2),u.left=u.x,u.top=u.y,u.width=r,u.height=b,u.oldRatio=y,u.ratio=t,this.renderImage(function(){e.zooming=!1,nt(l.zoomed)&&yt(h,"zoomed",l.zoomed,{once:!0}),xt(h,"zoomed",{ratio:t,oldRatio:y,originalEvent:a},{cancelable:!1})}),s&&this.tooltip()}return this},play:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!this.isShown||this.played)return this;var i=this.element,o=this.options;if(nt(o.play)&&yt(i,"play",o.play,{once:!0}),!1===xt(i,"play"))return this;var s=this.player,a=this.loadImage.bind(this),r=[],h=0,l=0;return this.played=!0,this.onLoadWhenPlay=a,t&&this.requestFullscreen(t),lt(s,A),ot(this.items,function(t,e){var i=t.querySelector("img"),n=document.createElement("img");n.src=gt(i,"originalUrl"),n.alt=i.getAttribute("alt"),n.referrerPolicy=i.referrerPolicy,h+=1,lt(n,p),ut(n,S,o.transition),ht(t,f)&&(lt(n,z),l=e),r.push(n),yt(n,N,a,{once:!0}),s.appendChild(n)}),J(o.interval)&&0<o.interval&&1<h&&function t(){e.playing=setTimeout(function(){ct(r[l],z),lt(r[l=(l+=1)<h?l:0],z),t()},o.interval)}(),this},stop:function(){var e=this;if(!this.played)return this;var t=this.element,i=this.options;if(nt(i.stop)&&yt(t,"stop",i.stop,{once:!0}),!1===xt(t,"stop"))return this;t=this.player;return this.played=!1,clearTimeout(this.playing),ot(t.getElementsByTagName("img"),function(t){wt(t,N,e.onLoadWhenPlay)}),ct(t,A),t.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(),lt(this.button,h),e.transition&&(ct(o,S),this.viewed&&ct(n,S)),lt(i,b),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),rt(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=st({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){e.transition&&setTimeout(function(){lt(n,S),lt(o,S)},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(),ct(this.button,h),e.transition&&(ct(o,S),this.viewed&&ct(n,S)),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),ct(i,b),rt(i,{zIndex:e.zIndexInline}),this.viewerData=st({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){e.transition&&setTimeout(function(){lt(n,S),lt(o,S)},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&&xt(i,W),lt(i,A),lt(i,p),lt(i,S),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,lt(i,z)):(lt(i,A),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){e.transition?(yt(i,W,function(){ct(i,A),ct(i,p),ct(i,S),i.setAttribute("aria-hidden",!0),t.fading=!1},{once:!0}),ct(i,z),t.fading=!0):(ct(i,A),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,t):this.zoomTo(1,!0,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=st({},this.initialImageData),this.renderImage()),this},update:function(){var e=this,t=this.element,i=this.options,n=this.isImg;if(n&&!t.parentNode)return this.destroy();var o,s=[];return ot(n?[t]:t.querySelectorAll("img"),function(t){nt(i.filter)?i.filter.call(e,t)&&s.push(t):e.getImageURL(t)&&s.push(t)}),s.length&&(this.images=s,this.length=s.length,this.ready?(o=[],ot(this.items,function(t,e){var i=t.querySelector("img"),t=s[e];t&&i&&t.src===i.src&&t.alt===i.alt||o.push(e)}),rt(this.list,{width:"auto"}),this.initList(),this.isShown&&(this.length?this.viewed&&(0<=(t=o.indexOf(this.index))?(this.viewed=!1,this.view(Math.max(Math.min(this.index-t,this.length-1),0))):(lt(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||wt(t,O,this.onStart),t[g]=void 0),this}},Ot={getImageURL:function(t){var e=this.options.url;return e=_(e)?t.getAttribute(e):nt(e)?e.call(this,t):""},enforceFocus:function(){var i=this;this.clearEnforceFocus(),yt(document,R,this.onFocusin=function(t){var e=i.viewer,t=t.target;t===document||t===e||e.contains(t)||null!==t.getAttribute("tabindex")&&"true"===t.getAttribute("aria-modal")||e.focus()})},clearEnforceFocus:function(){this.onFocusin&&(wt(document,R,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;lt(t,I),t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px")},close:function(){var t=this.body;ct(t,I),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()),nt(e.shown)&&yt(t,"shown",e.shown,{once:!0}),!1!==xt(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.fulled=!1,this.viewed=!1,this.isShown=!1,this.close(),this.unbind(),lt(i,y),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),i.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.hiding=!1,this.destroyed||(nt(e.hidden)&&yt(t,"hidden",e.hidden,{once:!0}),xt(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?it(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 c:this.move(o,r,t);break;case d:this.zoom((s=l({},h=i),a=[],ot(h,function(o,t){delete s[t],ot(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),i=Math.sqrt(e*e+i*i),t=Math.sqrt(n*n+t*t);a.push((t-i)/i)})}),a.sort(function(t,e){return Math.abs(t)<Math.abs(e)}),a[0]),!1,t);break;case u:this.action="switched";var h=Math.abs(o);1<h&&h>Math.abs(r)&&(this.pointers={},1<o?this.prev(e.loop):o<-1&&this.next(e.loop))}ot(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}},Ct=n.Viewer,Lt=(It=-1,function(){return It+=1}),n=function(){function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),!t||1!==t.nodeType)throw new Error("The first argument is required and must be an element.");this.element=t,this.options=st({},s,it(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.id=Lt(),this.init()}var t,e,n;return t=i,n=[{key:"noConflict",value:function(){return window.Viewer=Ct,i}},{key:"setDefaults",value:function(t){st(s,it(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=[],ot(t?[s]:s.querySelectorAll("img"),function(t){nt(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(),Q(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(){ot(e,function(t){t.complete||wt(t,N,n)})}},ot(e,function(t){t.complete?n():yt(t,N,n,{once:!0})})):yt(s,O,this.onStart=function(t){t=t.target;"img"!==t.localName||nt(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,h,l,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>',n=(i=d.querySelector(".".concat(g,"-container"))).querySelector(".".concat(g,"-title")),o=i.querySelector(".".concat(g,"-toolbar")),a=i.querySelector(".".concat(g,"-navbar")),m=i.querySelector(".".concat(g,"-button")),d=i.querySelector(".".concat(g,"-canvas")),this.parent=e,this.viewer=i,this.title=n,this.toolbar=o,this.navbar=a,this.button=m,this.canvas=d,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),n.id="".concat(g,"Title").concat(this.id),lt(n,s.title?Tt(Array.isArray(s.title)?s.title[0]:s.title):y),lt(a,s.navbar?Tt(s.navbar):y),ut(m,y,!s.button),s.keyboard&&m.setAttribute("tabindex",0),s.backdrop&&(lt(i,"".concat(g,"-backdrop")),s.inline||"static"===s.backdrop||ft(d,K,"hide")),_(s.className)&&s.className&&s.className.split(Z).forEach(function(t){lt(i,t)}),s.toolbar?(r=document.createElement("ul"),h=it(s.toolbar),l=$.slice(0,3),c=$.slice(7,9),u=$.slice(9),h||lt(o,Tt(s.toolbar)),ot(h?s.toolbar:$,function(t,e){var i=h&&it(t),n=h?mt(e):t,o=i&&!Q(t.show)?t.show:t;!o||!s.zoomable&&-1!==l.indexOf(n)||!s.rotatable&&-1!==c.indexOf(n)||!s.scalable&&-1!==u.indexOf(n)||(e=i&&!Q(t.size)?t.size:t,i=i&&!Q(t.click)?t.click:t,t=document.createElement("li"),s.keyboard&&t.setAttribute("tabindex",0),t.setAttribute("role","button"),lt(t,"".concat(g,"-").concat(n)),nt(i)||ft(t,K,n),J(o)&&lt(t,Tt(o)),-1!==["small","large"].indexOf(e)?lt(t,"".concat(g,"-").concat(e)):"play"===n&&lt(t,"".concat(g,"-large")),nt(i)&&yt(t,O,i),r.appendChild(t))}),o.appendChild(r)):lt(o,y),s.rotatable||(lt(d=o.querySelectorAll('li[class*="rotate"]'),D),ot(d,function(t){o.appendChild(t)})),s.inline?(lt(m,w),rt(i,{zIndex:s.zIndexInline}),"static"===window.getComputedStyle(e).position&&rt(e,{position:"relative"}),e.insertBefore(i,t.nextSibling)):(lt(m,v),lt(i,b),lt(i,p),lt(i,y),rt(i,{zIndex:s.zIndex}),(m=(m=_(m=s.container)?t.ownerDocument.querySelector(m):m)||this.body).appendChild(i)),s.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,nt(s.ready)&&yt(t,H,s.ready,{once:!0}),!1!==xt(t,H)?this.ready&&s.inline&&this.view(this.index):this.ready=!1)}}])&&o(t.prototype,e),n&&o(t,n),i}();return st(n.prototype,At,r,t,St,Ot),n});
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 e(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 l(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?e(Object(o),!0).forEach(function(t){var e,i;e=n,i=o[t=t],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)):e(Object(o)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function i(t){return(i="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 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,n.key,n)}}var s={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"],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,o=t?window:{},a=!(!t||!o.document.documentElement)&&"ontouchstart"in o.document.documentElement,r=t&&"PointerEvent"in o,g="viewer",c="move",d="switch",m="zoom",b="".concat(g,"-active"),w="".concat(g,"-close"),y="".concat(g,"-fade"),E="".concat(g,"-fixed"),I="".concat(g,"-fullscreen"),h="".concat(g,"-fullscreen-exit"),A="".concat(g,"-hide"),S="".concat(g,"-hide-md-down"),O="".concat(g,"-hide-sm-down"),C="".concat(g,"-hide-xs-down"),L="".concat(g,"-in"),R="".concat(g,"-invisible"),F="".concat(g,"-loading"),N="".concat(g,"-move"),Y="".concat(g,"-open"),X="".concat(g,"-show"),u="".concat(g,"-transition"),M="click",P="dblclick",q="dragstart",W="focusin",j="keydown",H="load",B="error",V=r?"pointerdown":a?"touchstart":"mousedown",U=r?"pointermove":a?"touchmove":"mousemove",K=r?"pointerup pointercancel":a?"touchend touchcancel":"mouseup",Z="resize",$="transitionend",_="wheel",G="ready",J="show",Q="viewed",tt="rotated",et="".concat(g,"Action"),it=/\s\s*/,nt=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function ot(t){return"string"==typeof t}var st=Number.isNaN||o.isNaN;function x(t){return"number"==typeof t&&!st(t)}function at(t){return void 0===t}function rt(t){return"object"===i(t)&&null!==t}var ht=Object.prototype.hasOwnProperty;function lt(t){if(!rt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&ht.call(i,"isPrototypeOf")}catch(t){return!1}}function k(t){return"function"==typeof t}function z(e,i){if(e&&k(i))if(Array.isArray(e)||x(e.length))for(var t=e.length,n=0;n<t&&!1!==i.call(e,e[n],n,e);n+=1);else rt(e)&&Object.keys(e).forEach(function(t){i.call(e,e[t],t,e)});return e}var ct=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 rt(i)&&0<e.length&&e.forEach(function(e){rt(e)&&Object.keys(e).forEach(function(t){i[t]=e[t]})}),i},ut=/^(?:width|height|left|top|marginLeft|marginTop)$/;function dt(t,e){var i=t.style;z(e,function(t,e){ut.test(e)&&x(t)&&(t+="px"),i[e]=t})}function mt(t,e){return t&&e&&(t.classList?t.classList.contains(e):-1<t.className.indexOf(e))}function f(t,e){var i;t&&e&&(x(t.length)?z(t,function(t){f(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 v(t,e){t&&e&&(x(t.length)?z(t,function(t){v(t,e)}):t.classList?t.classList.remove(e):0<=t.className.indexOf(e)&&(t.className=t.className.replace(e,"")))}function gt(t,e,i){e&&(x(t.length)?z(t,function(t){gt(t,e,i)}):(i?f:v)(t,e))}var ft=/([a-z\d])([A-Z])/g;function vt(t){return t.replace(ft,"$1-$2").toLowerCase()}function pt(t,e){return rt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(vt(e)))}function bt(t,e,i){rt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(vt(e)),i)}yt=!1,t&&(wt=!1,r=function(){},t=Object.defineProperty({},"once",{get:function(){return yt=!0,wt},set:function(t){wt=t}}),o.addEventListener("test",r,t),o.removeEventListener("test",r,t));var wt,yt,xt=yt;function p(i,t,n,e){var o=3<arguments.length&&void 0!==e?e:{},s=n;t.trim().split(it).forEach(function(t){var e;xt||(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 T(s,t,a,e){var r=3<arguments.length&&void 0!==e?e:{},h=a;t.trim().split(it).forEach(function(n){var t,o;r.once&&!xt&&(t=s.listeners,h=function(){delete o[n][a],s.removeEventListener(n,h,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]=h,s.listeners=o),s.addEventListener(n,h,r)})}function D(t,e,i,n){var o;return k(Event)&&k(CustomEvent)?o=new CustomEvent(e,l({bubbles:!0,cancelable:!0,detail:i},n)):(o=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(o)}function kt(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,o=t.translateX,t=t.translateY,s=[],o=(x(o)&&0!==o&&s.push("translateX(".concat(o,"px)")),x(t)&&0!==t&&s.push("translateY(".concat(t,"px)")),x(e)&&0!==e&&s.push("rotate(".concat(e,"deg)")),x(i)&&1!==i&&s.push("scaleX(".concat(i,")")),x(n)&&1!==n&&s.push("scaleY(".concat(n,")")),s.length?s.join(" "):"none");return{WebkitTransform:o,msTransform:o,transform:o}}var zt=o.navigator&&/(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(o.navigator.userAgent);function Tt(i,t,e){var n=document.createElement("img");if(i.naturalWidth&&!zt)return e(i.naturalWidth,i.naturalHeight),n;var o=document.body||document.documentElement;return n.onload=function(){e(n.width,n.height),zt||o.removeChild(n)},z(t.inheritedAttributes,function(t){var e=i.getAttribute(t);null!==e&&n.setAttribute(t,e)}),n.src=i.src,zt||(n.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;",o.appendChild(n)),n}function Dt(t){switch(t){case 2:return C;case 3:return O;case 4:return S;default:return""}}function Et(t,e){var i=t.pageX,t=t.pageY,n={endX:i,endY:t};return e?n:l({timeStamp:Date.now(),startX:i,startY:t},n)}var It,r={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=ct({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&dt(this.viewer,this.viewerData)},initList:function(){var r=this,t=this.element,h=this.options,l=this.list,c=[];l.innerHTML="",z(this.images,function(i,t){var e,n,o=i.src,s=i.alt||(ot(s=o)?decodeURIComponent(s.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""),a=r.getImageURL(i);(o||a)&&(e=document.createElement("li"),n=document.createElement("img"),z(h.inheritedAttributes,function(t){var e=i.getAttribute(t);null!==e&&n.setAttribute(t,e)}),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"),h.keyboard&&e.setAttribute("tabindex",0),e.appendChild(n),l.appendChild(e),c.push(e))}),z(this.items=c,function(e){var t,i,n=e.firstElementChild;bt(n,"filled",!0),h.loading&&f(e,F),T(n,H,t=function(t){p(n,B,i),h.loading&&v(e,F),r.loadImage(t)},{once:!0}),T(n,B,i=function(){p(n,H,t),h.loading&&v(e,F)},{once:!0})}),h.transition&&T(t,Q,function(){f(l,u)},{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,dt(this.list,ct({width:(e=n+t)*this.length-t},kt({translateX:(this.viewerData.width-n)/2-e*i}))))},resetList:function(){var t=this.list;t.innerHTML="",v(t,u),dt(t,kt({translateX:0}))},initImage:function(r){var t,h=this,l=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=Tt(e,l,function(t,e){var i=t/e,n=c,o=u,s=(h.imageInitializing=!1,c<u*i?o=c/i:n=u*i,n=Math.min(.9*n,t),o=Math.min(.9*o,e),(c-n)/2),a=(u-o)/2,s={left:s,top:a,x:s,y:a,width:n,height:o,oldRatio:1,ratio:n/t,aspectRatio:i,naturalWidth:t,naturalHeight:e},a=ct({},s);l.rotatable&&(s.rotate=d.rotate||0,a.rotate=0),l.scalable&&(s.scaleX=d.scaleX||1,s.scaleY=d.scaleY||1,a.scaleX=1,a.scaleY=1),h.imageData=s,h.initialImageData=a,r&&r()})},renderImage:function(t){var e,i=this,n=this.image,o=this.imageData;dt(n,ct({width:o.width,height:o.height,marginLeft:o.x,marginTop:o.y},kt(o))),t&&((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&mt(n,u)?(e=function(){i.imageRendering=!1,t()},this.imageRendering={abort:function(){p(n,$,e)}},T(n,$,e,{once:!0})):t())},resetImage:function(){var t;(this.viewing||this.viewed)&&(t=this.image,this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null)}},t={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;T(e,M,this.onClick=this.click.bind(this)),T(e,q,this.onDragStart=this.dragstart.bind(this)),T(i,V,this.onPointerDown=this.pointerdown.bind(this)),T(n,U,this.onPointerMove=this.pointermove.bind(this)),T(n,K,this.onPointerUp=this.pointerup.bind(this)),T(n,j,this.onKeyDown=this.keydown.bind(this)),T(window,Z,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&T(e,_,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&T(i,P,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;p(e,M,this.onClick),p(e,q,this.onDragStart),p(i,V,this.onPointerDown),p(n,U,this.onPointerMove),p(n,K,this.onPointerUp),p(n,j,this.onKeyDown),p(window,Z,this.onResize),t.zoomable&&t.zoomOnWheel&&p(e,_,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&p(i,P,this.onDblclick)}},At={click:function(t){var e=this.options,i=this.imageData,n=t.target,o=pt(n,et);switch(o||"img"!==n.localName||"li"!==n.parentElement.localName||(o=pt(n=n.parentElement,et)),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.hide();break;case"view":this.view(pt(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;v(n,R),i.loading&&v(this.canvas,F),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(){gt(n,N,i.movable),gt(n,u,i.transition),t.renderImage(function(){t.viewed=!0,t.viewing=!1,k(i.viewed)&&T(e,Q,i.viewed,{once:!0}),D(e,Q,{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=!!pt(n,"filled");Tt(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,dt(n,ct({width:e,height:i},kt({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.prev(e.loop);break;case 38:t.preventDefault(),this.zoom(e.zoomRatio,!0);break;case 39: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.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(x(n)&&1!==n||x(o)&&0!==o||t.ctrlKey)||(t.preventDefault(),t.changedTouches?z(t.changedTouches,function(t){i[t.identifier]=Et(t)}):i[t.pointerId||0]=Et(t),n=!!e.movable&&c,e.zoomOnTouch&&e.zoomable&&1<Object.keys(i).length?n=m:e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(n=d),!e.transition||n!==c&&n!==m||v(this.image,u),this.action=n)},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),t.changedTouches?z(t.changedTouches,function(t){ct(e[t.identifier]||{},Et(t,!0))}):ct(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?z(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!==c&&o!==m||f(this.image,u),this.action=!1,a&&o!==m&&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(){D(i.image,P,{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(){D(i.canvas,M,{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?z(this.player.getElementsByTagName("img"),function(t){T(t,H,e.loadImage.bind(e),{once:!0}),D(t,H)}):this.stop()))},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,t)))}},St={show:function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.element,i=this.options;if(i.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(t),this;if(k(i.show)&&T(e,J,i.show,{once:!0}),!1===D(e,J)||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var n,o=this.viewer;return v(o,A),o.setAttribute("role","dialog"),o.setAttribute("aria-labelledby",this.title.id),o.setAttribute("aria-modal",!0),o.removeAttribute("aria-hidden"),i.transition&&!t?(n=this.shown.bind(this),this.transitioning={abort:function(){p(o,$,n),v(o,L)}},f(o,u),o.initialOffsetWidth=o.offsetWidth,T(o,$,n,{once:!0}),f(o,L)):(f(o,L),this.shown()),this},hide:function(){var i=this,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.element,n=this.options;if(n.inline||this.hiding||!this.isShown&&!this.showing)return this;if(k(n.hide)&&T(e,"hide",n.hide,{once:!0}),!1===D(e,"hide"))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var o,s,a=this.viewer,r=this.image,h=function(){v(a,L),i.hidden()};return n.transition&&!t?(o=function t(e){e&&e.target===a&&(p(a,$,t),i.hidden())},s=function(){mt(a,u)?(T(a,$,o),v(a,L)):h()},this.transitioning={abort:function(){i.viewed&&mt(r,u)?p(r,$,s):mt(a,u)&&p(a,$,o)}},this.viewed&&mt(r,u)?(T(r,$,s,{once:!0}),this.zoomTo(0,!1,null,!0)):s()):h(),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)return this;if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var e=this.element,n=this.options,l=this.title,o=this.canvas,s=this.items[t],a=s.querySelector("img"),r=pt(a,"originalUrl"),c=a.getAttribute("alt"),h=document.createElement("img");if(z(n.inheritedAttributes,function(t){var e=a.getAttribute(t);null!==e&&h.setAttribute(t,e)}),h.src=r,h.alt=c,k(n.view)&&T(e,"view",n.view,{once:!0}),!1===D(e,"view",{originalImage:this.images[t],index:t,image:h})||!this.isShown||this.hiding||this.played)return this;function u(){var t=i.imageData,e=Array.isArray(n.title)?n.title[1]:n.title;l.innerHTML=ot(e=k(e)?e.call(i,h,t):"".concat(c," (").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}var d,m,r=this.items[this.index];r&&(v(r,b),r.removeAttribute("aria-selected")),f(s,b),s.setAttribute("aria-selected",!0),n.focus&&s.focus(),this.image=h,this.viewed=!1,this.index=t,this.imageData={},f(h,R),n.loading&&f(o,F),o.innerHTML="",o.appendChild(h),this.renderList(),l.innerHTML="";return T(e,Q,u,{once:!0}),this.viewing={abort:function(){p(e,Q,u),h.complete?i.imageRendering?i.imageRendering.abort():i.imageInitializing&&i.imageInitializing.abort():(h.src="",p(h,H,d),i.timeout&&clearTimeout(i.timeout))}},h.complete?this.load():(T(h,H,d=function(){p(h,B,m),i.load()},{once:!0}),T(h,B,m=function(){p(h,H,d),i.timeout&&(clearTimeout(i.timeout),i.timeout=!1),v(h,R),n.loading&&v(i.canvas,F)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){v(h,R),i.timeout=!1},1e3)),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(at(t)?t:i.x+Number(t),at(e)?e:i.y+Number(e)),this},moveTo:function(t){var l=this,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=this.element,o=this.options,s=this.imageData;if(t=Number(t),e=Number(e),this.viewed&&!this.played&&o.movable){var a=s.x,r=s.y,h=!1;if(x(t)?h=!0:t=a,x(e)?h=!0:e=r,h){if(k(o.move)&&T(n,"move",o.move,{once:!0}),!1===D(n,"move",{x:t,y:e,oldX:a,oldY:r,originalEvent:i}))return this;s.x=t,s.y=e,s.left=t,s.top=e,this.moving=!0,this.renderImage(function(){l.moving=!1,k(o.moved)&&T(n,"moved",o.moved,{once:!0}),D(n,"moved",{x:t,y:e,oldX:a,oldY:r,originalEvent:i},{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(x(t=Number(t))&&this.viewed&&!this.played&&n.rotatable){var s=o.rotate;if(k(n.rotate)&&T(i,"rotate",n.rotate,{once:!0}),!1===D(i,"rotate",{degree:t,oldDegree:s}))return this;o.rotate=t,this.rotating=!0,this.renderImage(function(){e.rotating=!1,k(n.rotated)&&T(i,tt,n.rotated,{once:!0}),D(i,tt,{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,h=!1;if(x(t)?h=!0:t=a,x(i)?h=!0:i=r,h){if(k(o.scale)&&T(n,"scale",o.scale,{once:!0}),!1===D(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,k(o.scaled)&&T(n,"scaled",o.scaled,{once:!0}),D(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=this.imageData;return t=Number(t),this.zoomTo(n.width*(t=t<0?1/(1-t):1+t)/n.naturalWidth,e,i),this},zoomTo:function(t){var l,c,i,u=this,d=1<arguments.length&&void 0!==arguments[1]&&arguments[1],e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=3<arguments.length&&void 0!==arguments[3]&&arguments[3],o=this.element,s=this.options,a=this.pointers,r=this.imageData,m=r.x,g=r.y,f=r.width,v=r.height,p=r.naturalWidth,b=r.naturalHeight;if(x(t=Math.max(0,t))&&this.viewed&&!this.played&&(n||s.zoomable)){if(n||(n=Math.max(.01,s.minZoomRatio),w=Math.min(100,s.maxZoomRatio),t=Math.min(Math.max(t,n),w)),e)switch(e.type){case"wheel":.055<=s.zoomRatio&&.95<t&&t<1.05&&(t=1);break;case"pointermove":case"touchmove":case"mousemove":.99<t&&t<1.01&&(t=1)}var h,n=p*t,w=b*t,p=n-f,b=w-v,y=r.ratio;if(k(s.zoom)&&T(o,"zoom",s.zoom,{once:!0}),!1===D(o,"zoom",{ratio:t,oldRatio:y,originalEvent:e}))return this;this.zooming=!0,e?(h={left:(h=(h=this.viewer).getBoundingClientRect()).left+(window.pageXOffset-document.documentElement.clientLeft),top:h.top+(window.pageYOffset-document.documentElement.clientTop)},a=a&&0<Object.keys(a).length?(i=c=l=0,z(a,function(t){var e=t.startX,t=t.startY;l+=e,c+=t,i+=1}),{pageX:l/=i,pageY:c/=i}):{pageX:e.pageX,pageY:e.pageY},r.x-=(a.pageX-h.left-m)/f*p,r.y-=(a.pageY-h.top-g)/v*b):(r.x-=p/2,r.y-=b/2),r.left=r.x,r.top=r.y,r.width=n,r.height=w,r.oldRatio=y,r.ratio=t,this.renderImage(function(){u.zooming=!1,k(s.zoomed)&&T(o,"zoomed",s.zoomed,{once:!0}),D(o,"zoomed",{ratio:t,oldRatio:y,originalEvent:e},{cancelable:!1})}),d&&this.tooltip()}return this},play:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(!this.isShown||this.played)return this;var i=this.element,o=this.options;if(k(o.play)&&T(i,"play",o.play,{once:!0}),!1===D(i,"play"))return this;var s=this.player,a=this.loadImage.bind(this),r=[],h=0,l=0;return this.played=!0,this.onLoadWhenPlay=a,t&&this.requestFullscreen(t),f(s,X),z(this.items,function(t,e){var i=t.querySelector("img"),n=document.createElement("img");n.src=pt(i,"originalUrl"),n.alt=i.getAttribute("alt"),n.referrerPolicy=i.referrerPolicy,h+=1,f(n,y),gt(n,u,o.transition),mt(t,b)&&(f(n,L),l=e),r.push(n),T(n,H,a,{once:!0}),s.appendChild(n)}),x(o.interval)&&0<o.interval&&1<h&&function t(){e.playing=setTimeout(function(){v(r[l],L),f(r[l=(l+=1)<h?l:0],L),t()},o.interval)}(),this},stop:function(){var e=this;if(!this.played)return this;var t=this.element,i=this.options;if(k(i.stop)&&T(t,"stop",i.stop,{once:!0}),!1===D(t,"stop"))return this;i=this.player;return this.played=!1,clearTimeout(this.playing),z(i.getElementsByTagName("img"),function(t){p(t,H,e.onLoadWhenPlay)}),v(i,X),i.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(),f(this.button,h),e.transition&&(v(o,u),this.viewed&&v(n,u)),f(i,E),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),dt(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=ct({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){e.transition&&setTimeout(function(){f(n,u),f(o,u)},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(),v(this.button,h),e.transition&&(v(o,u),this.viewed&&v(n,u)),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),v(i,E),dt(i,{zIndex:e.zIndexInline}),this.viewerData=ct({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){t.renderImage(function(){e.transition&&setTimeout(function(){f(n,u),f(o,u)},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&&D(i,$),f(i,X),f(i,y),f(i,u),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,f(i,L)):(f(i,X),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){e.transition?(T(i,$,function(){v(i,X),v(i,y),v(i,u),i.setAttribute("aria-hidden",!0),t.fading=!1},{once:!0}),v(i,L),t.fading=!0):(v(i,X),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,t):this.zoomTo(1,!0,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=ct({},this.initialImageData),this.renderImage()),this},update:function(){var e=this,t=this.element,i=this.options,n=this.isImg;if(n&&!t.parentNode)return this.destroy();var o,s=[];return z(n?[t]:t.querySelectorAll("img"),function(t){k(i.filter)?i.filter.call(e,t)&&s.push(t):e.getImageURL(t)&&s.push(t)}),s.length&&(this.images=s,this.length=s.length,this.ready?(o=[],z(this.items,function(t,e){var t=t.querySelector("img"),i=s[e];i&&t&&i.src===t.src&&i.alt===t.alt||o.push(e)}),dt(this.list,{width:"auto"}),this.initList(),this.isShown&&(this.length?this.viewed&&(0<=(n=o.indexOf(this.index))?(this.viewed=!1,this.view(Math.max(Math.min(this.index-n,this.length-1),0))):(f(t=this.items[this.index],b),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||p(t,M,this.onStart),t[g]=void 0),this}},Ot={getImageURL:function(t){var e=this.options.url;return e=ot(e)?t.getAttribute(e):k(e)?e.call(this,t):""},enforceFocus:function(){var i=this;this.clearEnforceFocus(),T(document,W,this.onFocusin=function(t){var e=i.viewer,t=t.target;t===document||t===e||e.contains(t)||null!==t.getAttribute("tabindex")&&"true"===t.getAttribute("aria-modal")||e.focus()})},clearEnforceFocus:function(){this.onFocusin&&(p(document,W,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;f(t,Y),t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px")},close:function(){var t=this.body;v(t,Y),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()),k(e.shown)&&T(t,"shown",e.shown,{once:!0}),!1!==D(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.fulled=!1,this.viewed=!1,this.isShown=!1,this.close(),this.unbind(),f(i,A),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),i.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.hiding=!1,this.destroyed||(k(e.hidden)&&T(t,"hidden",e.hidden,{once:!0}),D(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?lt(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 c:this.move(o,r,t);break;case m:this.zoom((s=l({},h=i),a=[],z(h,function(o,t){delete s[t],z(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,t);break;case d:this.action="switched";var h=Math.abs(o);1<h&&h>Math.abs(r)&&(this.pointers={},1<o?this.prev(e.loop):o<-1&&this.next(e.loop))}z(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}},Ct=o.Viewer,Lt=(It=-1,function(){return It+=1}),o=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=ct({},s,lt(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.id=Lt(),this.init()}var t,e,i;return t=o,i=[{key:"noConflict",value:function(){return window.Viewer=Ct,o}},{key:"setDefaults",value:function(t){ct(s,lt(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=[],z(t?[s]:s.querySelectorAll("img"),function(t){k(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(),at(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(){z(e,function(t){t.complete||p(t,H,n)})}},z(e,function(t){t.complete?n():T(t,H,n,{once:!0})})):T(s,M,this.onStart=function(t){t=t.target;"img"!==t.localName||k(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,c,r,u,d,m,h,l;this.ready||(t=this.element,s=this.options,e=t.parentNode,(h=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>',h=(i=h.querySelector(".".concat(g,"-container"))).querySelector(".".concat(g,"-title")),n=i.querySelector(".".concat(g,"-toolbar")),l=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=h,this.toolbar=n,this.navbar=l,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),h.id="".concat(g,"Title").concat(this.id),f(h,s.title?Dt(Array.isArray(s.title)?s.title[0]:s.title):A),f(l,s.navbar?Dt(s.navbar):A),gt(o,A,!s.button),s.keyboard&&o.setAttribute("tabindex",0),s.backdrop&&(f(i,"".concat(g,"-backdrop")),s.inline||"static"===s.backdrop||bt(a,et,"hide")),ot(s.className)&&s.className&&s.className.split(it).forEach(function(t){f(i,t)}),s.toolbar?(c=document.createElement("ul"),r=lt(s.toolbar),u=nt.slice(0,3),d=nt.slice(7,9),m=nt.slice(9),r||f(n,Dt(s.toolbar)),z(r?s.toolbar:nt,function(t,e){var i,n=r&&lt(t),e=r?vt(e):t,o=n&&!at(t.show)?t.show:t;!o||!s.zoomable&&-1!==u.indexOf(e)||!s.rotatable&&-1!==d.indexOf(e)||!s.scalable&&-1!==m.indexOf(e)||(i=n&&!at(t.size)?t.size:t,n=n&&!at(t.click)?t.click:t,t=document.createElement("li"),s.keyboard&&t.setAttribute("tabindex",0),t.setAttribute("role","button"),f(t,"".concat(g,"-").concat(e)),k(n)||bt(t,et,e),x(o)&&f(t,Dt(o)),-1!==["small","large"].indexOf(i)?f(t,"".concat(g,"-").concat(i)):"play"===e&&f(t,"".concat(g,"-large")),k(n)&&T(t,M,n),c.appendChild(t))}),n.appendChild(c)):f(n,A),s.rotatable||(f(h=n.querySelectorAll('li[class*="rotate"]'),R),z(h,function(t){n.appendChild(t)})),s.inline?(f(o,I),dt(i,{zIndex:s.zIndexInline}),"static"===window.getComputedStyle(e).position&&dt(e,{position:"relative"}),e.insertBefore(i,t.nextSibling)):(f(o,w),f(i,E),f(i,y),f(i,A),dt(i,{zIndex:s.zIndex}),(l=(l=ot(l=s.container)?t.ownerDocument.querySelector(l):l)||this.body).appendChild(i)),s.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,k(s.ready)&&T(t,G,s.ready,{once:!0}),!1!==D(t,G)?this.ready&&s.inline&&this.view(this.index):this.ready=!1)}}])&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),o}();return ct(o.prototype,r,t,At,St,Ot),o});