11/*!
2- * Viewer.js v1.11.6
2+ * Viewer.js v1.11.7
33 * https://fengyuanchen.github.io/viewerjs
44 *
55 * Copyright 2015-present Chen Fengyuan
66 * Released under the MIT license
77 *
8- * Date: 2023-09-17T03:16:38.052Z
8+ * Date: 2024-11-24T04:32:19.116Z
99 */
1010
1111'use strict' ;
1212
13+ function _classCallCheck ( a , n ) {
14+ if ( ! ( a instanceof n ) ) throw new TypeError ( "Cannot call a class as a function" ) ;
15+ }
16+ function _defineProperties ( e , r ) {
17+ for ( var t = 0 ; t < r . length ; t ++ ) {
18+ var o = r [ t ] ;
19+ o . enumerable = o . enumerable || ! 1 , o . configurable = ! 0 , "value" in o && ( o . writable = ! 0 ) , Object . defineProperty ( e , _toPropertyKey ( o . key ) , o ) ;
20+ }
21+ }
22+ function _createClass ( e , r , t ) {
23+ return r && _defineProperties ( e . prototype , r ) , t && _defineProperties ( e , t ) , Object . defineProperty ( e , "prototype" , {
24+ writable : ! 1
25+ } ) , e ;
26+ }
27+ function _defineProperty ( e , r , t ) {
28+ return ( r = _toPropertyKey ( r ) ) in e ? Object . defineProperty ( e , r , {
29+ value : t ,
30+ enumerable : ! 0 ,
31+ configurable : ! 0 ,
32+ writable : ! 0
33+ } ) : e [ r ] = t , e ;
34+ }
1335function ownKeys ( e , r ) {
1436 var t = Object . keys ( e ) ;
1537 if ( Object . getOwnPropertySymbols ) {
@@ -31,6 +53,20 @@ function _objectSpread2(e) {
3153 }
3254 return e ;
3355}
56+ function _toPrimitive ( t , r ) {
57+ if ( "object" != typeof t || ! t ) return t ;
58+ var e = t [ Symbol . toPrimitive ] ;
59+ if ( void 0 !== e ) {
60+ var i = e . call ( t , r || "default" ) ;
61+ if ( "object" != typeof i ) return i ;
62+ throw new TypeError ( "@@toPrimitive must return a primitive value." ) ;
63+ }
64+ return ( "string" === r ? String : Number ) ( t ) ;
65+ }
66+ function _toPropertyKey ( t ) {
67+ var i = _toPrimitive ( t , "string" ) ;
68+ return "symbol" == typeof i ? i : i + "" ;
69+ }
3470function _typeof ( o ) {
3571 "@babel/helpers - typeof" ;
3672
@@ -40,56 +76,6 @@ function _typeof(o) {
4076 return o && "function" == typeof Symbol && o . constructor === Symbol && o !== Symbol . prototype ? "symbol" : typeof o ;
4177 } , _typeof ( o ) ;
4278}
43- function _classCallCheck ( instance , Constructor ) {
44- if ( ! ( instance instanceof Constructor ) ) {
45- throw new TypeError ( "Cannot call a class as a function" ) ;
46- }
47- }
48- function _defineProperties ( target , props ) {
49- for ( var i = 0 ; i < props . length ; i ++ ) {
50- var descriptor = props [ i ] ;
51- descriptor . enumerable = descriptor . enumerable || false ;
52- descriptor . configurable = true ;
53- if ( "value" in descriptor ) descriptor . writable = true ;
54- Object . defineProperty ( target , _toPropertyKey ( descriptor . key ) , descriptor ) ;
55- }
56- }
57- function _createClass ( Constructor , protoProps , staticProps ) {
58- if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ;
59- if ( staticProps ) _defineProperties ( Constructor , staticProps ) ;
60- Object . defineProperty ( Constructor , "prototype" , {
61- writable : false
62- } ) ;
63- return Constructor ;
64- }
65- function _defineProperty ( obj , key , value ) {
66- key = _toPropertyKey ( key ) ;
67- if ( key in obj ) {
68- Object . defineProperty ( obj , key , {
69- value : value ,
70- enumerable : true ,
71- configurable : true ,
72- writable : true
73- } ) ;
74- } else {
75- obj [ key ] = value ;
76- }
77- return obj ;
78- }
79- function _toPrimitive ( input , hint ) {
80- if ( typeof input !== "object" || input === null ) return input ;
81- var prim = input [ Symbol . toPrimitive ] ;
82- if ( prim !== undefined ) {
83- var res = prim . call ( input , hint || "default" ) ;
84- if ( typeof res !== "object" ) return res ;
85- throw new TypeError ( "@@toPrimitive must return a primitive value." ) ;
86- }
87- return ( hint === "string" ? String : Number ) ( input ) ;
88- }
89- function _toPropertyKey ( arg ) {
90- var key = _toPrimitive ( arg , "string" ) ;
91- return typeof key === "symbol" ? key : String ( key ) ;
92- }
9379
9480var DEFAULTS = {
9581 /**
@@ -1762,17 +1748,17 @@ var methods = {
17621748 _this . hidden ( ) ;
17631749 } ;
17641750 if ( options . transition && ! immediate ) {
1765- var onViewerTransitionEnd = function onViewerTransitionEnd ( event ) {
1751+ var _onViewerTransitionEnd = function onViewerTransitionEnd ( event ) {
17661752 // Ignore all propagating `transitionend` events (#275).
17671753 if ( event && event . target === viewer ) {
1768- removeListener ( viewer , EVENT_TRANSITION_END , onViewerTransitionEnd ) ;
1754+ removeListener ( viewer , EVENT_TRANSITION_END , _onViewerTransitionEnd ) ;
17691755 _this . hidden ( ) ;
17701756 }
17711757 } ;
17721758 var onImageTransitionEnd = function onImageTransitionEnd ( ) {
17731759 // In case of show the viewer by `viewer.show(true)` previously (#407).
17741760 if ( hasClass ( viewer , CLASS_TRANSITION ) ) {
1775- addListener ( viewer , EVENT_TRANSITION_END , onViewerTransitionEnd ) ;
1761+ addListener ( viewer , EVENT_TRANSITION_END , _onViewerTransitionEnd ) ;
17761762 removeClass ( viewer , CLASS_IN ) ;
17771763 } else {
17781764 hideImmediately ( ) ;
@@ -1783,7 +1769,7 @@ var methods = {
17831769 if ( _this . viewed && hasClass ( image , CLASS_TRANSITION ) ) {
17841770 removeListener ( image , EVENT_TRANSITION_END , onImageTransitionEnd ) ;
17851771 } else if ( hasClass ( viewer , CLASS_TRANSITION ) ) {
1786- removeListener ( viewer , EVENT_TRANSITION_END , onViewerTransitionEnd ) ;
1772+ removeListener ( viewer , EVENT_TRANSITION_END , _onViewerTransitionEnd ) ;
17871773 }
17881774 }
17891775 } ;
@@ -2376,27 +2362,27 @@ var methods = {
23762362 player . appendChild ( image ) ;
23772363 } ) ;
23782364 if ( isNumber ( options . interval ) && options . interval > 0 ) {
2379- var prev = function prev ( ) {
2365+ var _prev = function prev ( ) {
23802366 clearTimeout ( _this7 . playing . timeout ) ;
23812367 removeClass ( list [ index ] , CLASS_IN ) ;
23822368 index -= 1 ;
23832369 index = index >= 0 ? index : total - 1 ;
23842370 addClass ( list [ index ] , CLASS_IN ) ;
2385- _this7 . playing . timeout = setTimeout ( prev , options . interval ) ;
2371+ _this7 . playing . timeout = setTimeout ( _prev , options . interval ) ;
23862372 } ;
2387- var next = function next ( ) {
2373+ var _next = function next ( ) {
23882374 clearTimeout ( _this7 . playing . timeout ) ;
23892375 removeClass ( list [ index ] , CLASS_IN ) ;
23902376 index += 1 ;
23912377 index = index < total ? index : 0 ;
23922378 addClass ( list [ index ] , CLASS_IN ) ;
2393- _this7 . playing . timeout = setTimeout ( next , options . interval ) ;
2379+ _this7 . playing . timeout = setTimeout ( _next , options . interval ) ;
23942380 } ;
23952381 if ( total > 1 ) {
23962382 this . playing = {
2397- prev : prev ,
2398- next : next ,
2399- timeout : setTimeout ( next , options . interval )
2383+ prev : _prev ,
2384+ next : _next ,
2385+ timeout : setTimeout ( _next , options . interval )
24002386 } ;
24012387 }
24022388 }
@@ -2968,7 +2954,7 @@ var Viewer = /*#__PURE__*/function () {
29682954 this . id = getUniqueID ( ) ;
29692955 this . init ( ) ;
29702956 }
2971- _createClass ( Viewer , [ {
2957+ return _createClass ( Viewer , [ {
29722958 key : "init" ,
29732959 value : function init ( ) {
29742960 var _this = this ;
@@ -3230,7 +3216,6 @@ var Viewer = /*#__PURE__*/function () {
32303216 assign ( DEFAULTS , isPlainObject ( options ) && options ) ;
32313217 }
32323218 } ] ) ;
3233- return Viewer ;
32343219} ( ) ;
32353220assign ( Viewer . prototype , render , events , handlers , methods , others ) ;
32363221
0 commit comments