viewerjs 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * Viewer.js v1.13.0
2
+ * Viewer.js v1.14.0
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: 2026-09-06T10:39:42.533Z
8
+ * Date: 2026-09-12T12:12:27.170Z
9
9
  */.viewer-close:before,.viewer-flip-horizontal:before,.viewer-flip-vertical:before,.viewer-fullscreen-exit:before,.viewer-fullscreen:before,.viewer-next:before,.viewer-one-to-one:before,.viewer-play:before,.viewer-prev:before,.viewer-reset:before,.viewer-rotate-left:before,.viewer-rotate-right:before,.viewer-zoom-in:before,.viewer-zoom-out:before{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 40'%3E%3Cpath fill='%23fff' d='M49.6 17.9h20.2v3.9H49.6zm123.1 2 10.9-11 2.7 2.8-8.2 8.2 8.2 8.2-2.7 2.7-10.9-10.9zm94 0-10.8-11-2.7 2.8 8.1 8.2-8.1 8.2 2.7 2.7 10.8-10.9zM212 9.3l20.1 10.6L212 30.5V9.3zm161.5 4.6-7.2 6 7.2 5.9v-4h12.4v4l7.3-5.9-7.3-6v4h-12.4v-4zm40.2 12.3 5.9 7.2 5.9-7.2h-4V13.6h4l-5.9-7.3-5.9 7.3h4v12.6h-4zm35.9-16.5h6.3v2h-4.3V16h-2V9.7Zm14 0h6.2V16h-2v-4.3h-4.2v-2Zm6.2 14V30h-6.2v-2h4.2v-4.3h2Zm-14 6.3h-6.2v-6.3h2v4.4h4.3v2Zm-438 .1v-8.3H9.6v-3.9h8.2V9.7h3.9v8.2h8.1v3.9h-8.1v8.3h-3.9zM93.6 9.7h-5.8v3.9h2V30h3.8V9.7zm16.1 0h-5.8v3.9h1.9V30h3.9V9.7zm-11.9 4.1h3.9v3.9h-3.9zm0 8.2h3.9v3.9h-3.9zm244.6-11.7 7.2 5.9-7.2 6v-3.6c-5.4-.4-7.8.8-8.7 2.8-.8 1.7-1.8 4.9 2.8 8.2-6.3-2-7.5-6.9-6-11.3 1.6-4.4 8-5 11.9-4.9v-3.1Zm147.2 13.4h6.3V30h-2v-4.3h-4.3v-2zm14 6.3v-6.3h6.2v2h-4.3V30h-1.9zm6.2-14h-6.2V9.7h1.9V14h4.3v2zm-13.9 0h-6.3v-2h4.3V9.7h2V16zm33.3 12.5 8.6-8.6-8.6-8.7 1.9-1.9 8.6 8.7 8.6-8.7 1.9 1.9-8.6 8.7 8.6 8.6-1.9 2-8.6-8.7-8.6 8.7-1.9-2zM297 10.3l-7.1 5.9 7.2 6v-3.6c5.3-.4 7.7.8 8.7 2.8.8 1.7 1.7 4.9-2.9 8.2 6.3-2 7.5-6.9 6-11.3-1.6-4.4-7.9-5-11.8-4.9v-3.1Zm-157.3-.6c2.3 0 4.4.7 6 2l2.5-3 1.9 9.2h-9.3l2.6-3.1a6.2 6.2 0 0 0-9.9 5.1c0 3.4 2.8 6.3 6.2 6.3 2.8 0 5.1-1.9 6-4.4h4c-1 4.7-5 8.3-10 8.3a10 10 0 0 1-10-10.2 10 10 0 0 1 10-10.2Z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:280px;color:transparent;display:block;font-size:0;height:20px;line-height:0;width:20px}.viewer-zoom-in:before{background-position:0 0;content:"Zoom In"}.viewer-zoom-out:before{background-position:-20px 0;content:"Zoom Out"}.viewer-one-to-one:before{background-position:-40px 0;content:"One to One"}.viewer-reset:before{background-position:-60px 0;content:"Reset"}.viewer-prev:before{background-position:-80px 0;content:"Previous"}.viewer-play:before{background-position:-100px 0;content:"Play"}.viewer-next:before{background-position:-120px 0;content:"Next"}.viewer-rotate-left:before{background-position:-140px 0;content:"Rotate Left"}.viewer-rotate-right:before{background-position:-160px 0;content:"Rotate Right"}.viewer-flip-horizontal:before{background-position:-180px 0;content:"Flip Horizontal"}.viewer-flip-vertical:before{background-position:-200px 0;content:"Flip Vertical"}.viewer-fullscreen:before{background-position:-220px 0;content:"Enter Full Screen"}.viewer-fullscreen-exit:before{background-position:-240px 0;content:"Exit Full Screen"}.viewer-close:before{background-position:-260px 0;content:"Close"}.viewer-container{-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;bottom:0;direction:ltr;font-size:0;left:0;line-height:0;overflow:hidden;position:absolute;right:0;top:0;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.viewer-container ::-moz-selection,.viewer-container::-moz-selection{background-color:transparent}.viewer-container ::selection,.viewer-container::selection{background-color:transparent}.viewer-container:focus{outline:0}.viewer-container img{display:block;height:auto;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.viewer-canvas{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.viewer-canvas>img{height:auto;margin:15px auto;max-width:90%!important;width:auto}.viewer-magnifier{background-color:#fff;background-repeat:no-repeat;border:2px solid #fff;border-radius:50%;box-shadow:0 1px 5px rgba(0,0,0,.5);box-sizing:border-box;display:none;left:16px;overflow:hidden;pointer-events:none;position:absolute;top:16px;z-index:2}.viewer-magnifier.viewer-show{display:block}.viewer-magnifier-image{left:0;max-width:none!important;position:absolute;top:0;-ms-transform-origin:center;transform-origin:center}.viewer-navigation{left:0;position:absolute;right:0;top:50%}.viewer-navigation>.viewer-next,.viewer-navigation>.viewer-prev{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;height:40px;margin-top:-20px;position:absolute;width:40px}.viewer-navigation>.viewer-next:focus,.viewer-navigation>.viewer-next:hover,.viewer-navigation>.viewer-prev:focus,.viewer-navigation>.viewer-prev:hover{background-color:rgba(0,0,0,.8)}.viewer-navigation>.viewer-next:focus,.viewer-navigation>.viewer-prev:focus{box-shadow:0 0 3px #fff;outline:0}.viewer-navigation>.viewer-next:before,.viewer-navigation>.viewer-prev:before{margin:10px}.viewer-navigation>.viewer-prev{left:15px}.viewer-navigation>.viewer-next{right:15px}.viewer-navigation>.viewer-large{height:48px;margin-top:-24px;width:48px}.viewer-navigation>.viewer-large:before{margin:14px}.viewer-navigation>.viewer-small{height:32px;margin-top:-16px;width:32px}.viewer-navigation>.viewer-small:before{margin:6px}.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-navbar.viewer-small>.viewer-list{height:40px;>li{height:40px;width:24px}}.viewer-navbar.viewer-large>.viewer-list{height:60px;>li{height:60px;width:36px}}.viewer-list{box-sizing:content-box;height:50px;margin:0;overflow:hidden;padding:1px 0}.viewer-list>li{color:transparent;cursor:pointer;float:left;font-size:0;height:50px;line-height:0;opacity:.5;overflow:hidden;transition:opacity .15s;width:30px}.viewer-list>li:focus,.viewer-list>li:hover{opacity:.75}.viewer-list>li:focus{outline:0}.viewer-list>li+li{margin-left:1px}.viewer-list>.viewer-loading{position:relative}.viewer-list>.viewer-loading:after{border-width:2px;height:20px;margin-left:-10px;margin-top:-10px;width:20px}.viewer-list>.viewer-active,.viewer-list>.viewer-active:focus,.viewer-list>.viewer-active:hover{opacity:1}.viewer-player{background-color:#000;bottom:0;cursor:none;display:none;right:0;z-index:1}.viewer-player,.viewer-player>img{left:0;position:absolute;top:0}.viewer-toolbar>ul{display:inline-block;margin:0 auto 5px;overflow:hidden;padding:6px 3px}.viewer-toolbar>ul>li{background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;float:left;height:24px;overflow:hidden;transition:background-color .15s;width:24px}.viewer-toolbar>ul>li:focus,.viewer-toolbar>ul>li:hover{background-color:rgba(0,0,0,.8)}.viewer-toolbar>ul>li:focus{box-shadow:0 0 3px #fff;outline:0;position:relative;z-index:1}.viewer-toolbar>ul>li:before{margin:2px}.viewer-toolbar>ul>li+li{margin-left:1px}.viewer-toolbar>ul>.viewer-small{height:18px;margin-bottom:3px;margin-top:3px;width:18px}.viewer-toolbar>ul>.viewer-small:before{margin:-1px}.viewer-toolbar>ul>.viewer-large{height:30px;margin-bottom:-3px;margin-top:-3px;width:30px}.viewer-toolbar>ul>.viewer-large:before{margin:5px}.viewer-tooltip{background-color:rgba(0,0,0,.8);border-radius:10px;color:#fff;display:none;font-size:12px;height:20px;left:50%;line-height:20px;margin-left:-25px;margin-top:-10px;position:absolute;text-align:center;top:50%;width:50px}.viewer-title{color:#ccc;display:inline-block;font-size:12px;line-height:1.2;margin:5px 5%;max-width:90%;min-height:14px;opacity:.8;overflow:hidden;text-overflow:ellipsis;transition:opacity .15s;white-space:nowrap}.viewer-title:hover{opacity:1}.viewer-button{-webkit-app-region:no-drag;background-color:rgba(0,0,0,.5);border-radius:50%;cursor:pointer;height:80px;overflow:hidden;position:absolute;right:-40px;top:-40px;transition:background-color .15s;width:80px}.viewer-button:focus,.viewer-button:hover{background-color:rgba(0,0,0,.8)}.viewer-button:focus{box-shadow:0 0 3px #fff;outline:0}.viewer-button:before{bottom:15px;left:15px;position:absolute}.viewer-fixed{position:fixed}.viewer-open{overflow:hidden}.viewer-show{display:block}.viewer-hide{display:none}.viewer-backdrop{background-color:rgba(0,0,0,.5)}.viewer-invisible{visibility:hidden}.viewer-move{cursor:move;cursor:grab}.viewer-fade{opacity:0}.viewer-in{opacity:1}.viewer-transition{transition:all .3s}@keyframes viewer-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.viewer-loading:after{animation:viewer-spinner 1s linear infinite;border:4px solid hsla(0,0%,100%,.1);border-left-color:hsla(0,0%,100%,.5);border-radius:50%;content:"";display:inline-block;height:40px;left:50%;margin-left:-20px;margin-top:-20px;position:absolute;top:50%;width:40px;z-index:1}@media (max-width:767px){.viewer-hide-xs-down{display:none}}@media (max-width:991px){.viewer-hide-sm-down{display:none}}@media (max-width:1199px){.viewer-hide-md-down{display:none}}
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * Viewer.js v1.13.0
2
+ * Viewer.js v1.14.0
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: 2026-09-06T10:39:44.170Z
8
+ * Date: 2026-09-12T12:12:29.730Z
9
9
  */
10
- ((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Viewer=e()})(this,function(){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,g(n.key),n)}}function a(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 s(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?a(Object(o),!0).forEach(function(t){var e,i;e=n,i=o[t=t],(t=g(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)):a(Object(o)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function g(t){t=((t,e)=>{if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);if("object"!=typeof(i=i.call(t,e||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string");return"symbol"==typeof t?t:t+""}function q(t){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var W={backdrop:!0,button:!0,navbar:!0,navigation:!1,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,autoplay:!0,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,preload:!0,minWidth:200,minHeight:100,movable:!0,magnifier:!1,rotatable:!0,rotateOnGesture:!0,rotateOnTouch:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnGesture:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},t="undefined"!=typeof window&&void 0!==window.document,e=t?window:{},r=!(!t||!e.document.documentElement)&&"ontouchstart"in e.document.documentElement,i=t&&"PointerEvent"in e,p="viewer",j="move",H="rotate",B="switch",h="transform",l="zoom",V="".concat(p,"-active"),G="".concat(p,"-close"),U="".concat(p,"-fade"),Z="".concat(p,"-fixed"),K="".concat(p,"-fullscreen"),$="".concat(p,"-fullscreen-exit"),b="".concat(p,"-hide"),_="".concat(p,"-hide-md-down"),J="".concat(p,"-hide-sm-down"),Q="".concat(p,"-hide-xs-down"),u="".concat(p,"-in"),w="".concat(p,"-invisible"),f="".concat(p,"-loading"),tt="".concat(p,"-move"),et="".concat(p,"-open"),d="".concat(p,"-show"),z="".concat(p,"-transition"),y="click",it="dblclick",nt="dragstart",ot="focusin",at="keydown",v="load",x="error",st=i?"pointerdown":r?"touchstart":"mousedown",rt=i?"pointerenter":"mouseenter",ht=i?"pointerleave":"mouseleave",lt=i?"pointermove":r?"touchmove":"mousemove",ct=i?"pointerup pointercancel":r?"touchend touchcancel":"mouseup",c="transitionend",ut="gesturestart gesturechange gestureend",k="viewed",dt="rotated",T="".concat(p,"Action"),mt=/\s+/,gt=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function ft(t){return"string"==typeof t}var vt=Number.isNaN||e.isNaN;function E(t){return"number"==typeof t&&!vt(t)}function D(t){return void 0===t}function o(t){return"object"===q(t)&&null!==t}var pt=Object.prototype.hasOwnProperty;function I(t){if(!o(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&pt.call(i,"isPrototypeOf")}catch(t){return!1}}function M(t){return"function"==typeof t}function O(e,i){if(e&&M(i))if(Array.isArray(e)||E(e.length))for(var t=e.length,n=0;n<t&&!1!==i.call(e,e[n],n,e);n+=1);else o(e)&&Object.keys(e).forEach(function(t){i.call(e,e[t],t,e)})}function bt(i,n,t){O(t,function(t){var e=n.getAttribute(t);null!==e&&i.setAttribute(t,e)})}function S(t,e){t=t.transition;return t&&!1!==t[e]}var m=Object.assign||function(i){for(var t=arguments.length,e=new Array(1<t?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return o(i)&&0<e.length&&e.forEach(function(e){o(e)&&Object.keys(e).forEach(function(t){i[t]=e[t]})}),i},wt=/^(?:width|height|left|top|marginLeft|marginTop)$/;function A(t,e){var i=t.style;O(e,function(t,e){wt.test(e)&&E(t)&&(t+="px"),i[e]=t})}function yt(t,e){return t&&e&&(t.classList?t.classList.contains(e):-1<t.className.split(mt).indexOf(e))}function C(t,e){var i;t&&e&&(E(t.length)?O(t,function(t){C(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 R(t,e){var i;t&&e&&(E(t.length)?O(t,function(t){R(t,e)}):t.classList?t.classList.remove(e):(i=t.className)&&0<=i.indexOf(e)&&(t.className=i.split(mt).filter(function(t){return t&&t!==e}).join(" ")))}function L(t,e,i){e&&(E(t.length)?O(t,function(t){L(t,e,i)}):(i?C:R)(t,e))}var xt=/([a-z\d])([A-Z])/g;function zt(t){return t.replace(xt,"$1-$2").toLowerCase()}function Y(t,e){return o(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(zt(e)))}function kt(t,e,i){o(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(zt(e)),i)}Et=!1,t&&(Tt=!1,i=function(){},t=Object.defineProperty({},"once",{get:function(){return Et=!0,Tt},set:function(t){Tt=t}}),e.addEventListener("test",i,t),e.removeEventListener("test",i,t));var Tt,Et,Dt=Et;function X(i,t,n,e){var o=3<arguments.length&&void 0!==e?e:{},a=n;t.trim().split(mt).forEach(function(t){var e;Dt||(e=i.listeners)&&e[t]&&e[t][n]&&(a=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,a,o)})}function N(a,t,s,e){var r=3<arguments.length&&void 0!==e?e:{},h=s;t.trim().split(mt).forEach(function(n){var t,o;r.once&&!Dt&&(t=a.listeners,h=function(){delete o[n][s],a.removeEventListener(n,h,r);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];s.apply(a,e)},(o=void 0===t?{}:t)[n]||(o[n]={}),o[n][s]&&a.removeEventListener(n,o[n][s],r),o[n][s]=h,a.listeners=o),a.addEventListener(n,h,r)})}function P(t,e,i,n){var o;return M(Event)&&M(CustomEvent)?o=new CustomEvent(e,s({bubbles:!0,cancelable:!0,detail:i},n)):(o=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(o)}function It(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,o=t.translateX,t=t.translateY,a=[],o=(E(o)&&0!==o&&a.push("translateX(".concat(o,"px)")),E(t)&&0!==t&&a.push("translateY(".concat(t,"px)")),E(e)&&0!==e&&a.push("rotate(".concat(e,"deg)")),E(i)&&E(n)&&(1!==i||1!==n)&&(a.push("scaleX(".concat(i,")")),a.push("scaleY(".concat(n,")"))),a.length?a.join(" "):"none");return{WebkitTransform:o,msTransform:o,transform:o}}var Mt=e.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(e.navigator.userAgent);function Ot(t,e,i){var n,o=document.createElement("img");return t.naturalWidth&&!Mt?i(t.naturalWidth,t.naturalHeight):(n=document.body||document.documentElement,o.onload=function(){i(o.width,o.height),Mt||n.removeChild(o)},bt(o,t,e.inheritedAttributes),o.src=t.src,Mt||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",n.appendChild(o))),o}function F(t){switch(t){case 2:return Q;case 3:return J;case 4:return _;default:return""}}function St(t){var e=s({},t),a=[];return O(t,function(o,t){delete e[t],O(e,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]}function At(t){var e=s({},t),n=[];return O(t,function(i,t){delete e[t],O(e,function(t){var e=Math.atan2(t.startY-i.startY,t.startX-i.startX),t=Math.atan2(t.endY-i.endY,t.endX-i.endX)-e;t>Math.PI?t-=2*Math.PI:t<-Math.PI&&(t+=2*Math.PI),n.push(180*t/Math.PI)})}),n.sort(function(t,e){return Math.abs(e)-Math.abs(t)}),n[0]||0}function Ct(t,e){var i=t.pageX,t=t.pageY,n={endX:i,endY:t};return e?n:s({timeStamp:Date.now(),startX:i,startY:t},n)}var Rt,i={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var t=this.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=m({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&A(this.viewer,this.viewerData)},initList:function(){var r=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.index,e=this.element,h=this.options,l=this.list,c=[],i=I(h.navbar)?h.navbar:{},n=document.createElement("li"),o=(l.appendChild(n),n.offsetWidth+parseInt(window.getComputedStyle(n).marginLeft,10)),u=(l.removeChild(n),E(i.visibleItemCount)?Math.floor(i.visibleItemCount):Math.floor(this.containerData.width/o)),d=0<(u=Math.min(u,this.length))?Math.min(Math.max(0,t-Math.floor(u/2)),Math.max(0,this.length-u)):0,m=0<u?Math.min(this.length,d+u):this.length;l.innerHTML="",O(this.images,function(t,e){var i,n,o,a,s;0<u&&(e<d||m<=e)||(i=t.src,n=t.alt||(ft(n=i)?decodeURIComponent(n.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""),o=r.getImageURL(t),(i||o)&&(a=document.createElement("li"),bt(s=document.createElement("img"),t,h.inheritedAttributes),h.navbar&&(s.src=i||o),s.alt=n,s.setAttribute("data-original-url",o||i),a.setAttribute("data-index",e),a.setAttribute("data-viewer-action","view"),a.setAttribute("role","button"),h.keyboard&&a.setAttribute("tabindex",0),a.appendChild(s),l.appendChild(a),c.push(a)))}),this.items=c,this.viewed&&(n=this.getItem(this.index))&&(C(n,V),n.setAttribute("aria-selected",!0)),O(c,function(e){var t,i,n=e.firstElementChild;kt(n,"filled",!0),h.loading&&C(e,f),N(n,v,t=function(t){X(n,x,i),h.loading&&R(e,f),r.loadImage(t)},{once:!0}),N(n,x,i=function(){X(n,v,t),h.loading&&R(e,f)},{once:!0})}),S(h,"view")&&N(e,k,function(){C(l,z)},{once:!0})},getItem:function(e){var i;return O(this.items,function(t){return Number(Y(t,"index"))!==e||(i=t,!1)}),i},renderList:function(){var t,e,i=this.index,i=this.getItem(i);i&&(t=i.nextElementSibling,t=parseInt(window.getComputedStyle(t||i).marginLeft,10),e=i.offsetWidth,A(this.list,m({width:(e+t)*this.items.length-t},It({translateX:(this.viewerData.width-e)/2-i.offsetLeft}))))},resetList:function(){var t=this.list;t.innerHTML="",R(t,z),A(t,m({width:0},It({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=Ot(e,l,function(t,e){var i=t/e,n=Math.max(0,Math.min(1,l.initialCoverage)),o=c,a=u,n=(h.imageInitializing=!1,c<u*i?a=c/i:o=u*i,n=E(n)?n:.9,o=Math.min(o*n,t),a=Math.min(a*n,e),(c-o)/2),s=(u-a)/2,n={left:n,top:s,x:n,y:s,width:o,height:a,oldRatio:1,ratio:o/t,aspectRatio:i,naturalWidth:t,naturalHeight:e},s=m({},n);l.rotatable&&(n.rotate=d.rotate||0,s.rotate=0),l.scalable&&(n.scaleX=d.scaleX||1,n.scaleY=d.scaleY||1,s.scaleX=1,s.scaleY=1),h.imageData=n,h.initialImageData=s,r&&r()})},renderImage:function(t){var e,i=this,n=this.image,o=this.imageData;A(n,m({width:o.width,height:o.height,marginLeft:o.x,marginTop:o.y},It(o))),this.magnifierPoint&&this.renderMagnifier(),t&&(o=!1,this.viewing?o="view":this.moving?o="move":this.rotating?o="rotate":this.scaling?o="scale":this.zooming&&(o="zoom"),o&&S(this.options,o)&&yt(n,z)?(e=function(){i.imageRendering=!1,t()},this.imageRendering={abort:function(){X(n,c,e)}},N(n,c,e,{once:!0})):t())},resetImage:function(){var t=this.image;t&&(this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null,this.title.innerHTML="")}},t={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.ownerDocument;N(e,y,this.onClick=this.click.bind(this)),N(e,nt,this.onDragStart=this.dragstart.bind(this)),N(e,rt,this.onMagnifyEnter=this.magnify.bind(this)),N(e,lt,this.onMagnify=this.magnify.bind(this)),N(e,ht,this.onMagnifierLeave=this.hideMagnifier.bind(this)),N(i,st,this.onPointerDown=this.pointerdown.bind(this)),N(n,lt,this.onPointerMove=this.pointermove.bind(this)),N(n,ct,this.onPointerUp=this.pointerup.bind(this)),N(n,at,this.onKeyDown=this.keydown.bind(this)),N(window,"resize",this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&N(e,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),(t.zoomable&&t.zoomOnGesture||t.rotatable&&t.rotateOnGesture)&&N(e,ut,this.onGesture=this.gesture.bind(this),{passive:!1}),t.toggleOnDblclick&&N(i,it,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.ownerDocument;X(e,y,this.onClick),X(e,nt,this.onDragStart),X(e,rt,this.onMagnifyEnter),X(e,lt,this.onMagnify),X(e,ht,this.onMagnifierLeave),X(i,st,this.onPointerDown),X(n,lt,this.onPointerMove),X(n,ct,this.onPointerUp),X(n,at,this.onKeyDown),X(window,"resize",this.onResize),t.zoomable&&t.zoomOnWheel&&X(e,"wheel",this.onWheel,{passive:!1,capture:!0}),(t.zoomable&&t.zoomOnGesture||t.rotatable&&t.rotateOnGesture)&&X(e,ut,this.onGesture,{passive:!1}),t.toggleOnDblclick&&X(i,it,this.onDblclick)}},Lt={click:function(t){var e=this.options,i=this.imageData,n=t.target,o=Y(n,T);switch(o||"img"!==n.localName||"li"!==n.parentElement.localName||(o=Y(n=n.parentElement,T)),r&&t.isTrusted&&n===this.canvas&&clearTimeout(this.clickCanvasTimeout),o){case"mix":this.played?this.stop():e.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(Y(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&&(r&&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,a=this.viewerData;R(n,w),i.loading&&R(this.canvas,f),n.style.cssText="height:0;"+"margin-left:".concat(a.width/2,"px;")+"margin-top:".concat(a.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){L(n,tt,i.movable),L(n,z,S(i,"view")),t.renderImage(function(){t.viewed=!0,t.viewing=!1,setTimeout(function(){L(n,z,i.transition)},300),M(i.viewed)&&N(e,k,i.viewed,{once:!0}),P(e,k,{originalImage:t.images[o],index:o,image:n},{cancelable:!1})})})},loadImage:function(t){var n=t.target,t=n.parentNode,o=t.offsetWidth||30,a=t.offsetHeight||50,s=!!Y(n,"filled");Ot(n,this.options,function(t,e){var t=t/e,e=o,i=a;o<a*t?s?e=a*t:i=o/t:s?i=o/t:e=a*t,A(n,m({width:e,height:i},It({translateX:(o-e)/2,translateY:(a-i)/2})))})},keydown:function(t){var e=this.options;if(e.keyboard){var i=t.keyCode||t.which||t.charCode;if(13===i&&this.viewer.contains(t.target)&&this.click(t),this.fulled)switch(i){case 27:this.played?this.stop():e.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(e.loop);break;case 38:t.preventDefault(),this.zoom(e.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(e.loop);break;case 40:t.preventDefault(),this.zoom(-e.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle())}}},dragstart:function(t){"img"===t.target.localName&&t.preventDefault()},magnify:function(t){t.changedTouches||t.pointerType&&"mouse"!==t.pointerType?this.hideMagnifier():(this.magnifierPoint={clientX:t.clientX,clientY:t.clientY},this.renderMagnifier())},renderMagnifier:function(){var t,e,i,n,o,a,s,r,h,l,c,u,d=this.options,m=this.imageData,g=this.magnifier,f=this.magnifierImage,v=this.viewer,p=I(d.magnifier)?d.magnifier:{},b=this.magnifierPoint;!(d.magnifier&&this.fulled&&this.viewed&&g&&f&&b)||(d=Math.max(1,Number(p.size)||100),t=Math.max(1,Number(p.zoomRatio)||2),p=Number(p.opacity),v=v.getBoundingClientRect(),h=b.clientX-v.left,v=b.clientY-v.top,e=this.image.currentSrc||this.image.src,i=this.image.getBoundingClientRect(),b.clientX<i.left)||b.clientX>i.right||b.clientY<i.top||b.clientY>i.bottom||(b=E(m.scaleX)?m.scaleX:1,i=E(m.scaleY)?m.scaleY:1,a=(m.rotate||0)*Math.PI/180,n=(s=Math.cos(a))*b,o=(a=Math.sin(a))*b,a=-a*i,s=s*i,0==(u=b*i))?this.hideMagnifier():(r=(s*(h-(l=m.x+m.width/2))-a*(v-(c=m.y+m.height/2)))/u+m.width/2,h=(-o*(h-l)+n*(v-c))/u+m.height/2,c=n*(r*t-(l=m.width*t)/2)+a*(h*t-(v=m.height*t)/2),u=o*(r*t-l/2)+s*(h*t-v/2),this.magnifierSourcePoint={x:r,y:h},g.style.width="".concat(d,"px"),g.style.height="".concat(d,"px"),g.style.opacity="".concat(Math.max(0,Math.min(1,E(p)?p:1))),f.src=e,f.style.width="".concat(l,"px"),f.style.height="".concat(v,"px"),f.style.left="".concat(d/2-l/2-c,"px"),f.style.top="".concat(d/2-v/2-u,"px"),f.style.transform="rotate(".concat(m.rotate||0,"deg) scaleX(").concat(b,") scaleY(").concat(i,")"),g.removeAttribute("aria-hidden"),C(g,"viewer-show"))},hideMagnifier:function(){this.magnifier&&(R(this.magnifier,"viewer-show"),this.magnifier.setAttribute("aria-hidden",!0),this.magnifierPoint=null)},pointerdown:function(t){var e=this.options,i=this.pointers,n=t.buttons,o=t.button;this.pointerMoved=!1,!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(E(n)&&1!==n||E(o)&&0!==o||t.ctrlKey)||(t.preventDefault(),t.changedTouches?O(t.changedTouches,function(t){i[t.identifier]=Ct(t)}):i[t.pointerId||0]=Ct(t),n=!!e.movable&&j,(e.zoomable&&e.zoomOnTouch||e.rotatable&&e.rotateOnTouch)&&1<Object.keys(i).length?n=h:e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(n=B),n!==j&&n!==l&&n!==H&&n!==h||R(this.image,z),this.action=n)},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),t.changedTouches?O(t.changedTouches,function(t){m(e[t.identifier]||{},Ct(t,!0))}):m(e[t.pointerId||0]||{},Ct(t,!0)),this.change(t))},pointerup:function(t){var e,i,n=this,o=this.options,a=this.action,s=this.pointers;t.changedTouches?O(t.changedTouches,function(t){e=s[t.identifier],delete s[t.identifier]}):(e=s[t.pointerId||0],delete s[t.pointerId||0]),a&&(t.preventDefault(),a!==j&&a!==l&&a!==H&&a!==h||(i=a===h?S(o,l)||S(o,H):S(o,a),L(this.image,z,i)),this.action=!1,r)&&a!==l&&a!==h&&e&&Date.now()-e.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),o.toggleOnDblclick&&this.viewed&&t.target===this.image?this.pointerMoved?this.imageClicked=!1:this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){P(n.image,it,{originalEvent:t})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){n.imageClicked=!1},500)):(this.imageClicked=!1,o.backdrop&&"static"!==o.backdrop&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){P(n.canvas,y,{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(),D((I(this.options.navbar)?this.options.navbar:{}).visibleItemCount)&&this.initList(this.index),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage()}),this.played)&&(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?this.stop():O(this.player.getElementsByTagName("img"),function(t){N(t,v,e.loadImage.bind(e),{once:!0}),P(t,v)}))},wheel:function(t){var e,i,n=this;this.viewed&&(t.preventDefault(),this.gesturing||this.wheeling||(this.wheeling=!0,setTimeout(function(){n.wheeling=!1},50),e=Number(this.options.zoomRatio)||.1,i=1,t.deltaY?i=0<t.deltaY?1:-1:t.wheelDelta?i=-t.wheelDelta/120:t.detail&&(i=0<t.detail?1:-1),this.zoom(-i*e,!0,null,t)))},gesture:function(t){var e=this.options;if(this.viewed&&(e.zoomOnGesture||e.rotateOnGesture))switch(t.preventDefault(),t.type){case"gesturestart":this.gesturing=!0,this.gestureScale=t.scale||1,this.gestureRotation=t.rotation||0;break;case"gesturechange":var i=t.scale||1,n=i/(this.gestureScale||1),o=Number(t.rotation),a=o-(this.gestureRotation||0);this.gestureScale=i,e.zoomable&&e.zoomOnGesture&&1!=n&&this.zoom(1<=n?n-1:1-1/n,!1,null,t),e.rotatable&&e.rotateOnGesture&&E(o)&&(this.gestureRotation=o,0!=a)&&this.rotate(a);break;case"gestureend":this.gesturing=!1,this.gestureScale=1,this.gestureRotation=0}}},Yt={show:function(){var t,e,i=0<arguments.length&&void 0!==arguments[0]&&arguments[0],n=this.element,o=this.options;return o.inline||this.showing||this.isShown||this.showing||(this.ready?(M(o.show)&&N(n,"show",o.show,{once:!0}),!1!==P(n,"show")&&this.ready&&(this.hiding&&this.transitioning.abort(),this.showing=!0,this.open(),R(t=this.viewer,b),t.setAttribute("role","dialog"),t.setAttribute("aria-labelledby",this.title.id),t.setAttribute("aria-modal",!0),t.removeAttribute("aria-hidden"),S(o,"show")&&!i?(e=this.shown.bind(this),this.transitioning={abort:function(){X(t,c,e),R(t,u)}},C(t,z),t.initialOffsetWidth=t.offsetWidth,N(t,c,e,{once:!0}),C(t,u)):(C(t,u),this.shown()))):(this.build(),this.ready&&this.show(i))),this},hide:function(){var e,t,i,n,o,a=this,s=0<arguments.length&&void 0!==arguments[0]&&arguments[0],r=this.element,h=this.options;return h.inline||this.hiding||!this.isShown&&!this.showing||(M(h.hide)&&N(r,"hide",h.hide,{once:!0}),!1===P(r,"hide"))||this.destroyed||(this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort(),e=this.viewer,t=this.image,i=function(){R(e,u),a.hidden()},S(h,"hide")&&!s?(n=function(t){t&&t.target===e&&(X(e,c,n),a.hidden())},o=function(){yt(e,z)?(N(e,c,n),R(e,u)):i()},this.transitioning={abort:function(){a.viewed&&yt(t,z)?X(t,c,o):yt(e,z)&&X(e,c,n)}},this.viewed&&yt(t,z)?(N(t,c,o,{once:!0}),this.zoomTo(0,!1,null,null,!0)):o()):i()),this},view:function(){var i=this,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options.initialViewIndex,o=this.index,n=Number(n)||0;if(!(this.hiding||this.played||n<0||n>=this.length||this.viewed&&n===o)){if(!this.isShown)return this.index=n,this.show();this.viewing&&this.viewing.abort();var t,e,a,s=this.element,r=this.options,h=this.title,l=this.canvas,c=this.getItem(n),u=(c||(this.initList(n),c=this.getItem(n)),c.querySelector("img")),d=Y(u,"originalUrl"),m=u.getAttribute("alt"),g=document.createElement("img");bt(g,u,r.inheritedAttributes),g.src=d,g.alt=m,M(r.view)&&N(s,"view",r.view,{once:!0}),!1===P(s,"view",{originalImage:this.images[n],index:n,image:g})||!this.isShown||this.hiding||this.played||(this.hideMagnifier(),(u=this.getItem(o))&&(R(u,V),u.removeAttribute("aria-selected")),C(c,V),c.setAttribute("aria-selected",!0),r.focus&&c.focus(),this.image=g,this.viewed=!1,this.index=n,this.imageData={},C(g,w),r.loading&&C(l,f),l.innerHTML="",l.appendChild(g),this.renderList(),h.innerHTML="",N(s,k,t=function(){var t=i.imageData,e=Array.isArray(r.title)?r.title[1]:r.title;h.innerHTML=ft(e=M(e)?e.call(i,g,t):"".concat(m," (").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,r.preload&&(e=(e=n+(t=n<o?-1:1))<0||e>=i.length?r.loop?0<t?0:i.length-1:-1:e)!==n&&(t=i.images[e],bt(e=document.createElement("img"),t,r.inheritedAttributes),e.src=i.getImageURL(t)||t.src)},{once:!0}),this.viewing={abort:function(){X(s,k,t),g.complete?i.imageRendering?i.imageRendering.abort():i.imageInitializing&&i.imageInitializing.abort():(g.src="",X(g,v,e),i.timeout&&clearTimeout(i.timeout))}},g.complete?this.load():(N(g,v,e=function(){X(g,x,a),i.load()},{once:!0}),N(g,x,a=function(){X(g,v,e),i.timeout&&(clearTimeout(i.timeout),i.timeout=!1),R(g,w),r.loading&&R(i.canvas,f)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){R(g,w),i.timeout=!1},1e3)))}return this},prev:function(){var t=this.index-1;return t<0&&(t=0<arguments.length&&void 0!==arguments[0]&&arguments[0]?this.length-1:0),this.view(t),this},next:function(){var t=this.length-1,e=this.index+1;return this.view(e=t<e?0<arguments.length&&void 0!==arguments[0]&&arguments[0]?0:t:e),this},move:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData;return this.moveTo(D(t)?t:i.x+Number(t),D(e)?e:i.y+Number(e)),this},moveTo:function(t){var e=this,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,o=this.element,a=this.options,s=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&a.movable){var r=s.x,h=s.y,l=!1;if(E(t)?l=!0:t=r,E(i)?l=!0:i=h,l){if(M(a.move)&&N(o,"move",a.move,{once:!0}),!1===P(o,"move",{x:t,y:i,oldX:r,oldY:h,originalEvent:n}))return this;s.x=t,s.y=i,s.left=t,s.top=i,L(this.image,z,S(a,"move")),this.moving=!0,this.renderImage(function(){e.moving=!1,M(a.moved)&&N(o,"moved",a.moved,{once:!0}),P(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(E(t=Number(t))&&this.viewed&&!this.played&&n.rotatable){var a=o.rotate;if(M(n.rotate)&&N(i,"rotate",n.rotate,{once:!0}),!1===P(i,"rotate",{degree:t,oldDegree:a}))return this;o.rotate=t,L(this.image,z,S(n,"rotate")),this.rotating=!0,this.renderImage(function(){e.rotating=!1,M(n.rotated)&&N(i,dt,n.rotated,{once:!0}),P(i,dt,{degree:t,oldDegree:a},{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,a=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&o.scalable){var s=a.scaleX,r=a.scaleY,h=!1;if(E(t)?h=!0:t=s,E(i)?h=!0:i=r,h){if(M(o.scale)&&N(n,"scale",o.scale,{once:!0}),!1===P(n,"scale",{scaleX:t,scaleY:i,oldScaleX:s,oldScaleY:r}))return this;a.scaleX=t,a.scaleY=i,L(this.image,z,S(o,"scale")),this.scaling=!0,this.renderImage(function(){e.scaling=!1,M(o.scaled)&&N(n,"scaled",o.scaled,{once:!0}),P(n,"scaled",{scaleX:t,scaleY:i,oldScaleX:s,oldScaleY:r},{cancelable:!1})})}}return this},zoom:function(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,o=this.imageData;return t=Number(t),this.zoomTo(o.width*(t=t<0?1/(1-t):1+t)/o.naturalWidth,e,i,n),this},zoomTo:function(t){var i,n,o,e=this,a=1<arguments.length&&void 0!==arguments[1]&&arguments[1],s=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,h=4<arguments.length&&void 0!==arguments[4]&&arguments[4],l=this.element,c=this.options,u=this.pointers,d=this.imageData,m=d.x,g=d.y,f=d.width,v=d.height,p=d.naturalWidth,b=d.naturalHeight;if(E(t=Math.max(0,t))&&this.viewed&&!this.played&&(h||c.zoomable)){if(h||(h=Math.max(.01,M(c.minZoomRatio)?c.minZoomRatio.call(this,this.image,d):c.minZoomRatio),y=Math.min(100,M(c.maxZoomRatio)?c.maxZoomRatio.call(this,this.image,d):c.maxZoomRatio),t=Math.min(Math.max(t,h),y)),r)switch(r.type){case"wheel":.055<=c.zoomRatio&&.95<t&&t<1.05&&(t=1);break;case"pointermove":case"touchmove":case"mousemove":.99<t&&t<1.01&&(t=1)}var w,h=p*t,y=b*t,p=h-f,b=y-v,x=d.ratio;if(M(c.zoom)&&N(l,"zoom",c.zoom,{once:!0}),!1===P(l,"zoom",{ratio:t,oldRatio:x,originalEvent:r}))return this;this.zooming=!0,r?(w={left:(w=(w=this.viewer).getBoundingClientRect()).left+(window.pageXOffset-document.documentElement.clientLeft),top:w.top+(window.pageYOffset-document.documentElement.clientTop)},u=u&&0<Object.keys(u).length?(o=n=i=0,O(u,function(t){var e=t.startX;i+=e,n+=t.startY,o+=1}),{pageX:i/=o,pageY:n/=o}):{pageX:r.pageX,pageY:r.pageY},d.x-=(u.pageX-w.left-m)/f*p,d.y-=(u.pageY-w.top-g)/v*b):I(s)&&E(s.x)&&E(s.y)?(d.x-=p*((s.x-m)/f),d.y-=b*((s.y-g)/v)):(d.x-=p/2,d.y-=b/2),d.left=d.x,d.top=d.y,d.width=h,d.height=y,d.oldRatio=x,d.ratio=t,L(this.image,z,S(c,"zoom")),this.renderImage(function(){e.zooming=!1,M(c.zoomed)&&N(l,"zoomed",c.zoomed,{once:!0}),P(l,"zoomed",{ratio:t,oldRatio:x,originalEvent:r},{cancelable:!1})}),a&&this.tooltip()}return this},play:function(){var t,n,o,a,s,r,h,e,i,l=this,c=0<arguments.length&&void 0!==arguments[0]&&arguments[0];return this.isShown&&!this.played&&(t=this.element,M((n=this.options).play)&&N(t,"play",n.play,{once:!0}),!1!==P(t,"play")&&(o=this.player,a=this.loadImage.bind(this),s=[],h=r=0,this.played=!0,this.onLoadWhenPlay=a,c&&this.requestFullscreen(c),C(o,d),O(this.images,function(t,e){var i=document.createElement("img");i.src=l.getImageURL(t)||t.src,i.alt=t.alt||"",i.referrerPolicy=t.referrerPolicy,r+=1,C(i,U),L(i,z,S(n,"play")),e===l.index&&(C(i,u),h=e),s.push(i),N(i,v,a,{once:!0}),o.appendChild(i)}),E(n.interval))&&0<n.interval&&(e=function(){clearTimeout(l.playing.timeout),R(s[h],u),C(s[h=0<=--h?h:r-1],u),l.playing.timeout=n.autoplay?setTimeout(e,n.interval):null},i=function(){clearTimeout(l.playing.timeout),R(s[h],u),C(s[h=(h+=1)<r?h:0],u),l.playing.timeout=n.autoplay?setTimeout(i,n.interval):null},1<r))&&(this.playing={prev:e,next:i,timeout:n.autoplay?setTimeout(i,n.interval):null}),this},stop:function(){var t,e,i=this;return this.played&&(t=this.element,M((e=this.options).stop)&&N(t,"stop",e.stop,{once:!0}),!1!==P(t,"stop"))&&(e=this.player,clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,O(e.getElementsByTagName("img"),function(t){X(t,v,i.onLoadWhenPlay)}),R(e,d),e.innerHTML="",this.exitFullscreen()),this},full:function(){var t=this,e=this.options,i=this.viewer,n=this.image,o=this.list;return this.isShown&&!this.played&&!this.fulled&&e.inline&&(this.fulled=!0,this.open(),C(this.button,$),R(o,z),this.viewed&&R(n,z),C(i,Z),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),A(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=m({},this.containerData),this.renderList(),this.viewed)&&this.initImage(function(){t.renderImage()}),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(),R(this.button,$),R(o,z),this.viewed&&R(n,z),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),R(i,Z),A(i,{zIndex:e.zIndexInline}),this.viewerData=m({},this.parentData),this.renderViewer(),this.renderList(),this.viewed)&&this.initImage(function(){t.renderImage()}),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):S(e,"tooltip")?(this.fading&&P(i,c),C(i,d),C(i,U),C(i,z),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,C(i,u)):(C(i,d),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){S(e,"tooltip")?(N(i,c,function(){R(i,d),R(i,U),R(i,z),i.setAttribute("aria-hidden",!0),t.fading=!1},{once:!0}),R(i,u),t.fading=!0):(R(i,d),i.setAttribute("aria-hidden",!0)),t.tooltipping=!1},1e3)),this},toggle:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;return 1===this.imageData.ratio?this.zoomTo(this.imageData.oldRatio,!0,null,t):this.zoomTo(1,!0,null,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=m({},this.initialImageData),this.renderImage()),this},update:function(t){var n,o,e=this,i=this.element,a=this.options,s=this.isImg;return I(t)&&m(a,t),s&&!i.parentNode?this.destroy():(n=[],O(s?[i]:i.querySelectorAll("img"),function(t){M(a.filter)?a.filter.call(e,t)&&n.push(t):e.getImageURL(t)&&n.push(t)}),n.length&&(this.images=n,this.length=n.length,this.ready?(o=[],O(this.items,function(t){var e=t.querySelector("img"),t=Number(Y(t,"index")),i=n[t];i&&e&&i.src===e.src&&i.alt===e.alt||o.push(t)}),A(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))):(C(s=this.getItem(this.index),V),s.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[p]&&(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||(X(t,y,this.onElementClick),X(t,at,this.onElementKeyDown)),t[p]=void 0),this}},Xt={getImageURL:function(t){var e=this.options.url;return e=ft(e)?t.getAttribute(e):M(e)?e.call(this,t):""},enforceFocus:function(){var n=this;this.clearEnforceFocus(),N(document,ot,this.onFocusin=function(t){var e=n.viewer,i=t.target;if(i!==document&&i!==e&&!e.contains(i)){for(;i;){if(null!==i.getAttribute("tabindex")||"true"===i.getAttribute("aria-modal"))return;i=i.parentElement}e.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(X(document,ot,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;C(t,et),0<this.scrollbarWidth&&(t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var t=this.body;R(t,et),0<this.scrollbarWidth&&(t.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var t=this.element,e=this.options,i=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,e.focus&&(i.focus(),this.enforceFocus()),M(e.shown)&&N(t,"shown",e.shown,{once:!0}),!1!==P(t,"shown")&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,e=this.options,i=this.viewer,n=i.ownerDocument.activeElement;n&&i.contains(n)&&M(n.blur)&&n.blur(),e.focus&&this.clearEnforceFocus(),this.close(),this.unbind(),C(i,b),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),i.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(M(e.hidden)&&N(t,"hidden",e.hidden,{once:!0}),P(t,"hidden",null,{cancelable:!1}))},requestFullscreen:function(t){var e=this.ownerDocument;this.fulled&&!(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)&&((e=e.documentElement).requestFullscreen?I(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.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 o=n.endX-n.startX,a=n.endY-n.startY;switch(this.action){case j:0==o&&0==a||(this.pointerMoved=!0,this.move(o,a,t));break;case l:e.zoomable&&e.zoomOnTouch&&0!==(s=St(i))&&this.zoom(s,!1,null,t);break;case H:e.rotatable&&e.rotateOnTouch&&0!==(s=At(i))&&this.rotate(s,t);break;case h:e.zoomable&&e.zoomOnTouch&&0!==(s=St(i))&&this.zoom(s,!1,null,t),e.rotatable&&e.rotateOnTouch&&0!==(s=At(i))&&this.rotate(s,t);break;case B:this.action="switched";var s=Math.abs(o);1<s&&s>Math.abs(a)&&(this.pointers={},1<o?this.prev(e.loop):o<-1&&this.next(e.loop))}O(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}},Nt=e.Viewer,Pt=(Rt=-1,function(){return Rt+=1}),e=(()=>{function o(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=this,n=o;if(!(i instanceof n))throw new TypeError("Cannot call a class as a function");if(!t||1!==t.nodeType&&11!==t.nodeType)throw new Error("The first argument is required and must be an element.");this.element=t,this.ownerDocument=t.ownerDocument||t.host.ownerDocument,this.options=m({},W,I(e)&&e),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=Pt(),this.init()}return t=o,i=[{key:"create",value:function(t,e){return new o(t,e)}},{key:"setDefaults",value:function(t){m(W,I(t)&&t)}},{key:"noConflict",value:function(){return window.Viewer=Nt,o}}],(e=[{key:"init",value:function(){var t,e,i,n,o=this,a=this.element,s=this.options;a[p]||(a[p]=this,s.focus&&!s.keyboard&&(s.focus=!1),e=[],O((t="img"===a.localName)?[a]:a.querySelectorAll("img"),function(t){M(s.filter)?s.filter.call(o,t)&&e.push(t):o.getImageURL(t)&&e.push(t)}),this.isImg=t,this.length=e.length,this.images=e,this.initBody(),D(this.ownerDocument.createElement(p).style.transition)&&(s.transition=!1),s.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(){O(e,function(t){t.complete||(X(t,v,n),X(t,x,n))})}},O(e,function(t){var e,i;t.complete?n():(N(t,v,e=function(){X(t,x,i),n()},{once:!0}),N(t,x,i=function(){X(t,v,e),n()},{once:!0}))})):(N(a,y,this.onElementClick=function(t){t=t.target;"img"!==t.localName||M(s.filter)&&!s.filter.call(o,t)||o.view(o.images.indexOf(t))}),N(a,at,this.onElementKeyDown=function(t){var e=t.target,i=t.key;"img"!==e.localName||"Enter"!==i&&" "!==i||(t.preventDefault(),M(s.filter)&&!s.filter.call(o,e))||o.view(o.images.indexOf(e))})))}},{key:"build",value:function(){var t,a,e,i,n,o,s,r,h,l,c,u,d,m,g,f,v;this.ready||(t=this.element,a=this.options,e=t.parentNode,(f=document.createElement("div")).innerHTML='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-magnifier" aria-hidden="true"><img class="viewer-magnifier-image" alt=""></div><div class="viewer-navigation"><div class="viewer-prev" data-viewer-action="prev" role="button" aria-label="Previous"></div><div class="viewer-next" data-viewer-action="next" role="button" aria-label="Next"></div></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>',f=(i=f.querySelector(".".concat(p,"-container"))).querySelector(".".concat(p,"-title")),n=i.querySelector(".".concat(p,"-toolbar")),o=i.querySelector(".".concat(p,"-navbar")),s=i.querySelector(".".concat(p,"-navigation")),r=i.querySelector(".".concat(p,"-button")),h=i.querySelector(".".concat(p,"-canvas")),this.parent=e,this.viewer=i,this.title=f,this.toolbar=n,this.navbar=o,this.navigation=s,this.button=r,this.canvas=h,this.footer=i.querySelector(".".concat(p,"-footer")),this.magnifier=i.querySelector(".".concat(p,"-magnifier")),this.magnifierImage=i.querySelector(".".concat(p,"-magnifier-image")),this.tooltipBox=i.querySelector(".".concat(p,"-tooltip")),this.player=i.querySelector(".".concat(p,"-player")),this.list=i.querySelector(".".concat(p,"-list")),i.id="".concat(p).concat(this.id),f.id="".concat(p,"Title").concat(this.id),C(f,a.title?F(Array.isArray(a.title)?a.title[0]:a.title):b),f=I(a.navbar)?a.navbar:{},v=a.navbar,l=D(f.size)?a.navbar:f.size,C(o,(v=I(a.navbar)?!!D(f.show)||f.show:v)?F(v):b),-1!==["small","medium","large"].indexOf(l)&&C(o,"".concat(p,"-").concat(l)),I(a.navigation)?O(s.querySelectorAll('[role="button"]'),function(t){var e=Y(t,T),e=a.navigation[e],i=I(e),n=i&&!D(e.show)?e.show:e,i=i&&!D(e.size)?e.size:e;L(t,b,!n),E(n)&&C(t,F(n)),-1!==["small","large"].indexOf(i)&&C(t,"".concat(p,"-").concat(i))}):C(s,a.navigation?F(a.navigation):b),L(r,b,!a.button),a.keyboard&&(r.setAttribute("tabindex",0),O(s.querySelectorAll('[role="button"]'),function(t){t.setAttribute("tabindex",0)})),a.backdrop&&(C(i,"".concat(p,"-backdrop")),a.inline||"static"===a.backdrop||kt(h,T,"hide")),ft(a.className)&&a.className&&a.className.split(mt).forEach(function(t){C(i,t)}),a.toolbar?(c=document.createElement("ul"),u=I(a.toolbar),d=gt.slice(0,3),m=gt.slice(7,9),g=gt.slice(9),u||C(n,F(a.toolbar)),O(u?a.toolbar:gt,function(t,e){var i,n=u&&I(t),e=u?zt(e):t,o=n&&!D(t.show)?t.show:t;!o||!a.zoomable&&-1!==d.indexOf(e)||!a.rotatable&&-1!==m.indexOf(e)||!a.scalable&&-1!==g.indexOf(e)||(i=n&&!D(t.size)?t.size:t,n=n&&!D(t.click)?t.click:t,t=document.createElement("li"),a.keyboard&&t.setAttribute("tabindex",0),t.setAttribute("role","button"),C(t,"".concat(p,"-").concat(e)),M(n)||kt(t,T,e),E(o)&&C(t,F(o)),-1!==["small","large"].indexOf(i)?C(t,"".concat(p,"-").concat(i)):"play"===e&&C(t,"".concat(p,"-large")),M(n)&&N(t,y,n),c.appendChild(t))}),n.appendChild(c)):C(n,b),a.rotatable||(C(f=n.querySelectorAll('li[class*="rotate"]'),w),O(f,function(t){n.appendChild(t)})),a.inline?(C(r,K),A(i,{zIndex:a.zIndexInline}),"static"===window.getComputedStyle(e).position&&A(e,{position:"relative"}),e.insertBefore(i,t.nextSibling)):(C(r,G),C(i,Z),C(i,U),C(i,b),A(i,{zIndex:a.zIndex}),(v=(v=ft(v=a.container)?this.ownerDocument.querySelector(v):v)||this.body).appendChild(i)),a.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,M(a.ready)&&N(t,"ready",a.ready,{once:!0}),!1===P(t,"ready")?this.ready=!1:this.ready&&a.inline&&this.view(this.index))}}])&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i})();return m(e.prototype,i,t,Lt,Yt,Xt),e});
10
+ ((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Viewer=e()})(this,function(){function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function a(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 s(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?a(Object(o),!0).forEach(function(t){var e,i;e=n,i=o[t=t],(t=u(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)):a(Object(o)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function u(t){t=((t,e)=>{if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);if("object"!=typeof(i=i.call(t,e||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")})(t,"string");return"symbol"==typeof t?t:t+""}function q(t){return(q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var W={backdrop:!0,button:!0,navbar:!0,navigation:!1,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,autoplay:!0,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,preload:!0,minWidth:200,minHeight:100,movable:!0,magnifier:!1,rotatable:!0,rotateOnGesture:!0,rotateOnTouch:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnGesture:!0,zoomOnWheel:!0,slideOnTouch:!0,slideOnWheel:!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,playing:null,stop:null},t="undefined"!=typeof window&&void 0!==window.document,e=t?window:{},r=!(!t||!e.document.documentElement)&&"ontouchstart"in e.document.documentElement,i=t&&"PointerEvent"in e,p="viewer",j="move",H="rotate",B="switch",l="transform",h="zoom",V="".concat(p,"-active"),G="".concat(p,"-close"),K="".concat(p,"-fade"),U="".concat(p,"-fixed"),Z="".concat(p,"-fullscreen"),$="".concat(p,"-fullscreen-exit"),b="".concat(p,"-hide"),_="".concat(p,"-hide-md-down"),J="".concat(p,"-hide-sm-down"),Q="".concat(p,"-hide-xs-down"),d="".concat(p,"-in"),w="".concat(p,"-invisible"),v="".concat(p,"-loading"),tt="".concat(p,"-move"),et="".concat(p,"-open"),m="".concat(p,"-show"),x="".concat(p,"-transition"),z="click",it="dblclick",nt="dragstart",ot="focusin",at="keydown",f="load",y="error",st=i?"pointerdown":r?"touchstart":"mousedown",rt=i?"pointerenter":"mouseenter",lt=i?"pointerleave":"mouseleave",ht=i?"pointermove":r?"touchmove":"mousemove",ct=i?"pointerup pointercancel":r?"touchend touchcancel":"mouseup",c="transitionend",ut="gesturestart gesturechange gestureend",E="viewed",dt="rotated",mt="playing",gt="".concat(p,"Action"),vt=/\s+/,ft=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function k(t){return"string"==typeof t}var pt={ctrl:"ctrlKey",shift:"shiftKey",alt:"altKey",meta:"metaKey"};function bt(t,e){return!!t&&(!0===t||k(t)&&t.split("+").every(function(t){return e[pt[t.trim().toLowerCase()]]}))}var wt=Number.isNaN||e.isNaN;function O(t){return"number"==typeof t&&!wt(t)}function T(t){return void 0===t}function o(t){return"object"===q(t)&&null!==t}var yt=Object.prototype.hasOwnProperty;function D(t){if(!o(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&yt.call(i,"isPrototypeOf")}catch(t){return!1}}function I(t){return"function"==typeof t}function M(e,i){if(e&&I(i))if(Array.isArray(e)||O(e.length))for(var t=e.length,n=0;n<t&&!1!==i.call(e,e[n],n,e);n+=1);else o(e)&&Object.keys(e).forEach(function(t){i.call(e,e[t],t,e)})}function Et(i,n,t){M(t,function(t){var e=n.getAttribute(t);null!==e&&i.setAttribute(t,e)})}function S(t,e){t=t.transition;return t&&!1!==t[e]}var g=Object.assign||function(i){for(var t=arguments.length,e=new Array(1<t?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return o(i)&&0<e.length&&e.forEach(function(e){o(e)&&Object.keys(e).forEach(function(t){i[t]=e[t]})}),i},xt=/^(?:width|height|left|top|marginLeft|marginTop)$/;function A(t,e){var i=t.style;M(e,function(t,e){xt.test(e)&&O(t)&&(t+="px"),i[e]=t})}function zt(t,e){return t&&e&&(t.classList?t.classList.contains(e):-1<t.className.split(vt).indexOf(e))}function C(t,e){var i;t&&e&&(O(t.length)?M(t,function(t){C(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 R(t,e){var i;t&&e&&(O(t.length)?M(t,function(t){R(t,e)}):t.classList?t.classList.remove(e):(i=t.className)&&0<=i.indexOf(e)&&(t.className=i.split(vt).filter(function(t){return t&&t!==e}).join(" ")))}function L(t,e,i){e&&(O(t.length)?M(t,function(t){L(t,e,i)}):(i?C:R)(t,e))}var kt=/([a-z\d])([A-Z])/g;function Ot(t){return t.replace(kt,"$1-$2").toLowerCase()}function Y(t,e){return o(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Ot(e)))}function Tt(t,e,i){o(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(Ot(e)),i)}It=!1,t&&(Dt=!1,i=function(){},t=Object.defineProperty({},"once",{get:function(){return It=!0,Dt},set:function(t){Dt=t}}),e.addEventListener("test",i,t),e.removeEventListener("test",i,t));var Dt,It,Mt=It;function X(i,t,n,e){var o=3<arguments.length&&void 0!==e?e:{},a=n;t.trim().split(vt).forEach(function(t){var e;Mt||(e=i.listeners)&&e[t]&&e[t][n]&&(a=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,a,o)})}function N(a,t,s,e){var r=3<arguments.length&&void 0!==e?e:{},l=s;t.trim().split(vt).forEach(function(n){var t,o;r.once&&!Mt&&(t=a.listeners,l=function(){delete o[n][s],a.removeEventListener(n,l,r);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];s.apply(a,e)},(o=void 0===t?{}:t)[n]||(o[n]={}),o[n][s]&&a.removeEventListener(n,o[n][s],r),o[n][s]=l,a.listeners=o),a.addEventListener(n,l,r)})}function P(t,e,i,n){var o;return I(Event)&&I(CustomEvent)?o=new CustomEvent(e,s({bubbles:!0,cancelable:!0,detail:i},n)):(o=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(o)}function St(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,o=t.translateX,t=t.translateY,a=[],o=(O(o)&&0!==o&&a.push("translateX(".concat(o,"px)")),O(t)&&0!==t&&a.push("translateY(".concat(t,"px)")),O(e)&&0!==e&&a.push("rotate(".concat(e,"deg)")),O(i)&&O(n)&&(1!==i||1!==n)&&(a.push("scaleX(".concat(i,")")),a.push("scaleY(".concat(n,")"))),a.length?a.join(" "):"none");return{WebkitTransform:o,msTransform:o,transform:o}}var At=e.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(e.navigator.userAgent);function Ct(t,e,i){var n,o=document.createElement("img");return t.naturalWidth&&!At?i(t.naturalWidth,t.naturalHeight):(n=document.body||document.documentElement,o.onload=function(){i(o.width,o.height),At||n.removeChild(o)},Et(o,t,e.inheritedAttributes),o.src=t.src,At||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",n.appendChild(o))),o}function F(t){switch(t){case 2:return Q;case 3:return J;case 4:return _;default:return""}}function Rt(t){var e=s({},t),a=[];return M(t,function(o,t){delete e[t],M(e,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]}function Lt(t){var e=s({},t),n=[];return M(t,function(i,t){delete e[t],M(e,function(t){var e=Math.atan2(t.startY-i.startY,t.startX-i.startX),t=Math.atan2(t.endY-i.endY,t.endX-i.endX)-e;t>Math.PI?t-=2*Math.PI:t<-Math.PI&&(t+=2*Math.PI),n.push(180*t/Math.PI)})}),n.sort(function(t,e){return Math.abs(e)-Math.abs(t)}),n[0]||0}function Yt(t,e){var i=t.pageX,t=t.pageY,n={endX:i,endY:t};return e?n:s({timeStamp:Date.now(),startX:i,startY:t},n)}var Xt,i={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var t=this.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=g({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&A(this.viewer,this.viewerData)},initList:function(){var r=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.index,e=this.element,l=this.options,h=this.list,c=[],i=D(l.navbar)?l.navbar:{},n=document.createElement("li"),o=(this.containerData||this.initContainer(),h.appendChild(n),n.offsetWidth+parseInt(window.getComputedStyle(n).marginLeft,10)),u=(h.removeChild(n),O(i.visibleItemCount)?Math.floor(i.visibleItemCount):Math.floor(this.containerData.width/o)),d=0<(u=Math.min(u,this.length))?Math.min(Math.max(0,t-Math.floor(u/2)),Math.max(0,this.length-u)):0,m=0<u?Math.min(this.length,d+u):this.length;h.innerHTML="",M(this.images,function(t,e){var i,n,o,a,s;0<u&&(e<d||m<=e)||(i=t.src,n=t.alt||(k(n=i)?decodeURIComponent(n.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""),o=r.getImageURL(t),(i||o)&&(a=document.createElement("li"),Et(s=document.createElement("img"),t,l.inheritedAttributes),l.navbar&&(s.src=i||o),s.alt=n,s.setAttribute("data-original-url",o||i),a.setAttribute("data-index",e),a.setAttribute("data-viewer-action","view"),a.setAttribute("role","button"),l.keyboard&&a.setAttribute("tabindex",0),a.appendChild(s),h.appendChild(a),c.push(a)))}),this.items=c,this.viewed&&(n=this.getItem(this.index))&&(C(n,V),n.setAttribute("aria-selected",!0)),M(c,function(e){var t,i,n=e.firstElementChild;Tt(n,"filled",!0),l.loading&&C(e,v),N(n,f,t=function(t){X(n,y,i),l.loading&&R(e,v),r.loadImage(t)},{once:!0}),N(n,y,i=function(){X(n,f,t),l.loading&&R(e,v)},{once:!0})}),S(l,"view")&&N(e,E,function(){C(h,x)},{once:!0})},getItem:function(e){var i;return M(this.items,function(t){return Number(Y(t,"index"))!==e||(i=t,!1)}),i},renderList:function(){var t,e,i=this.index,i=this.getItem(i);i&&(t=i.nextElementSibling,t=parseInt(window.getComputedStyle(t||i).marginLeft,10),e=i.offsetWidth,A(this.list,g({width:(e+t)*this.items.length-t},St({translateX:(this.viewerData.width-e)/2-i.offsetLeft}))))},resetList:function(){var t=this.list;t.innerHTML="",R(t,x),A(t,g({width:0},St({translateX:0})))},initImage:function(r){var t,l=this,h=this.options,e=this.image,i=this.viewerData,n=this.footer.offsetHeight,c=i.width,u=Math.max(i.height-n,n),d=this.imageData||{};this.imageInitializing={abort:function(){t.onload=null}},t=Ct(e,h,function(t,e){var i=t/e,n=Math.max(0,Math.min(1,h.initialCoverage)),o=c,a=u,n=(l.imageInitializing=!1,c<u*i?a=c/i:o=u*i,n=O(n)?n:.9,o=Math.min(o*n,t),a=Math.min(a*n,e),(c-o)/2),s=(u-a)/2,n={left:n,top:s,x:n,y:s,width:o,height:a,oldRatio:1,ratio:o/t,aspectRatio:i,naturalWidth:t,naturalHeight:e},s=g({},n);h.rotatable&&(n.rotate=d.rotate||0,s.rotate=0),h.scalable&&(n.scaleX=d.scaleX||1,n.scaleY=d.scaleY||1,s.scaleX=1,s.scaleY=1),l.imageData=n,l.initialImageData=s,r&&r()})},renderImage:function(t){var e,i=this,n=this.image,o=this.imageData;A(n,g({width:o.width,height:o.height,marginLeft:o.x,marginTop:o.y},St(o))),this.magnifierPoint&&this.renderMagnifier(),t&&(o=!1,this.viewing?o="view":this.moving?o="move":this.rotating?o="rotate":this.scaling?o="scale":this.zooming&&(o="zoom"),o&&S(this.options,o)&&zt(n,x)?(e=function(){i.imageRendering=!1,t()},this.imageRendering={abort:function(){X(n,c,e)}},N(n,c,e,{once:!0})):t())},resetImage:function(){var t=this.image;t&&(this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null,this.title.innerHTML="")}},t={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.ownerDocument;N(e,z,this.onClick=this.click.bind(this)),N(e,nt,this.onDragStart=this.dragstart.bind(this)),N(e,rt,this.onMagnifyEnter=this.magnify.bind(this)),N(e,ht,this.onMagnify=this.magnify.bind(this)),N(e,lt,this.onMagnifierLeave=this.hideMagnifier.bind(this)),N(i,st,this.onPointerDown=this.pointerdown.bind(this)),N(n,ht,this.onPointerMove=this.pointermove.bind(this)),N(n,ct,this.onPointerUp=this.pointerup.bind(this)),N(n,at,this.onKeyDown=this.keydown.bind(this)),N(window,"resize",this.onResize=this.resize.bind(this)),(t.zoomable&&t.zoomOnWheel||t.slideOnWheel)&&N(e,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),(t.zoomable&&t.zoomOnGesture||t.rotatable&&t.rotateOnGesture)&&N(e,ut,this.onGesture=this.gesture.bind(this),{passive:!1}),t.toggleOnDblclick&&N(i,it,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.ownerDocument;X(e,z,this.onClick),X(e,nt,this.onDragStart),X(e,rt,this.onMagnifyEnter),X(e,ht,this.onMagnify),X(e,lt,this.onMagnifierLeave),X(i,st,this.onPointerDown),X(n,ht,this.onPointerMove),X(n,ct,this.onPointerUp),X(n,at,this.onKeyDown),X(window,"resize",this.onResize),(t.zoomable&&t.zoomOnWheel||t.slideOnWheel)&&X(e,"wheel",this.onWheel,{passive:!1,capture:!0}),(t.zoomable&&t.zoomOnGesture||t.rotatable&&t.rotateOnGesture)&&X(e,ut,this.onGesture,{passive:!1}),t.toggleOnDblclick&&X(i,it,this.onDblclick)}},Nt={click:function(t){var e=this.options,i=this.imageData,n=t.target,o=Y(n,gt);switch(o||"img"!==n.localName||"li"!==n.parentElement.localName||(o=Y(n=n.parentElement,gt)),r&&t.isTrusted&&n===this.canvas&&clearTimeout(this.clickCanvasTimeout),this.actionEvent=t,o){case"mix":this.played?this.stop():e.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(Y(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&&(r&&t.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.actionEvent=t.isTrusted?t:t.detail&&t.detail.originalEvent,this.toggle())},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,a=this.viewerData;R(n,w),i.loading&&R(this.canvas,v),n.style.cssText="height:0;"+"margin-left:".concat(a.width/2,"px;")+"margin-top:".concat(a.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){L(n,tt,i.movable),L(n,x,S(i,"view")),t.renderImage(function(){t.viewed=!0,t.viewing=!1,setTimeout(function(){L(n,x,i.transition)},300),I(i.viewed)&&N(e,E,i.viewed,{once:!0}),P(e,E,{originalImage:t.images[o],index:o,image:n,originalEvent:t.viewOriginalEvent||null},{cancelable:!1}),t.viewOriginalEvent=null})})},loadImage:function(t){var n=t.target,t=n.parentNode,o=t.offsetWidth||30,a=t.offsetHeight||50,s=!!Y(n,"filled");Ct(n,this.options,function(t,e){var t=t/e,e=o,i=a;o<a*t?s?e=a*t:i=o/t:s?i=o/t:e=a*t,A(n,g({width:e,height:i},St({translateX:(o-e)/2,translateY:(a-i)/2})))})},keydown:function(t){var e=this.options;if(e.keyboard){var i=t.keyCode||t.which||t.charCode;if(this.actionEvent=t,13===i&&this.viewer.contains(t.target)&&this.click(t),this.fulled)switch(i){case 27:this.played?this.stop():e.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(e.loop);break;case 38:t.preventDefault(),this.zoom(e.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(e.loop);break;case 40:t.preventDefault(),this.zoom(-e.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle())}}},dragstart:function(t){"img"===t.target.localName&&t.preventDefault()},magnify:function(t){t.changedTouches||t.pointerType&&"mouse"!==t.pointerType?this.hideMagnifier():(this.magnifierPoint={clientX:t.clientX,clientY:t.clientY},this.renderMagnifier())},renderMagnifier:function(){var t,e,i,n,o,a,s,r,l,h,c,u,d=this.options,m=this.imageData,g=this.magnifier,v=this.magnifierImage,f=this.viewer,p=D(d.magnifier)?d.magnifier:{},b=this.magnifierPoint;!(d.magnifier&&this.fulled&&this.viewed&&g&&v&&b)||(d=Math.max(1,Number(p.size)||100),t=Math.max(1,Number(p.zoomRatio)||2),p=Number(p.opacity),f=f.getBoundingClientRect(),l=b.clientX-f.left,f=b.clientY-f.top,e=this.image.currentSrc||this.image.src,i=this.image.getBoundingClientRect(),b.clientX<i.left)||b.clientX>i.right||b.clientY<i.top||b.clientY>i.bottom||(b=O(m.scaleX)?m.scaleX:1,i=O(m.scaleY)?m.scaleY:1,a=(m.rotate||0)*Math.PI/180,n=(s=Math.cos(a))*b,o=(a=Math.sin(a))*b,a=-a*i,s=s*i,0==(u=b*i))?this.hideMagnifier():(r=(s*(l-(h=m.x+m.width/2))-a*(f-(c=m.y+m.height/2)))/u+m.width/2,l=(-o*(l-h)+n*(f-c))/u+m.height/2,c=n*(r*t-(h=m.width*t)/2)+a*(l*t-(f=m.height*t)/2),u=o*(r*t-h/2)+s*(l*t-f/2),this.magnifierSourcePoint={x:r,y:l},g.style.width="".concat(d,"px"),g.style.height="".concat(d,"px"),g.style.opacity="".concat(Math.max(0,Math.min(1,O(p)?p:1))),v.src=e,v.style.width="".concat(h,"px"),v.style.height="".concat(f,"px"),v.style.left="".concat(d/2-h/2-c,"px"),v.style.top="".concat(d/2-f/2-u,"px"),v.style.transform="rotate(".concat(m.rotate||0,"deg) scaleX(").concat(b,") scaleY(").concat(i,")"),g.removeAttribute("aria-hidden"),C(g,"viewer-show"))},hideMagnifier:function(){this.magnifier&&(R(this.magnifier,"viewer-show"),this.magnifier.setAttribute("aria-hidden",!0),this.magnifierPoint=null)},pointerdown:function(t){var e=this.options,i=this.pointers,n=t.buttons,o=t.button;this.pointerMoved=!1,!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(O(n)&&1!==n||O(o)&&0!==o||t.ctrlKey)||(t.preventDefault(),t.changedTouches?M(t.changedTouches,function(t){i[t.identifier]=Yt(t)}):i[t.pointerId||0]=Yt(t),n=!!e.movable&&j,(e.zoomable&&e.zoomOnTouch||e.rotatable&&e.rotateOnTouch)&&1<Object.keys(i).length?n=l:e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(n=B),n!==j&&n!==h&&n!==H&&n!==l||R(this.image,x),this.action=n)},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),t.changedTouches?M(t.changedTouches,function(t){g(e[t.identifier]||{},Yt(t,!0))}):g(e[t.pointerId||0]||{},Yt(t,!0)),this.change(t))},pointerup:function(t){var e,i,n=this,o=this.options,a=this.action,s=this.pointers;t.changedTouches?M(t.changedTouches,function(t){e=s[t.identifier],delete s[t.identifier]}):(e=s[t.pointerId||0],delete s[t.pointerId||0]),a&&(t.preventDefault(),a!==j&&a!==h&&a!==H&&a!==l||(i=a===l?S(o,h)||S(o,H):S(o,a),L(this.image,x,i)),this.action=!1,r)&&a!==h&&a!==l&&e&&Date.now()-e.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),o.toggleOnDblclick&&this.viewed&&t.target===this.image?this.pointerMoved?this.imageClicked=!1:this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){P(n.image,it,{originalEvent:t})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){n.imageClicked=!1},500)):(this.imageClicked=!1,o.backdrop&&"static"!==o.backdrop&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){P(n.canvas,z,{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(),T((D(this.options.navbar)?this.options.navbar:{}).visibleItemCount)&&this.initList(this.index),this.renderList(),this.viewed&&this.initImage(function(){e.renderImage()}),this.played)&&(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?this.stop():M(this.player.getElementsByTagName("img"),function(t){N(t,f,e.loadImage.bind(e),{once:!0}),P(t,f)}))},wheel:function(t){var e,i=this,n=this.options,o=this.navbar;this.viewed&&(t.preventDefault(),this.gesturing||this.wheeling||(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),e=1,t.deltaY?e=0<t.deltaY?1:-1:t.wheelDelta?e=-t.wheelDelta/120:t.detail&&(e=0<t.detail?1:-1),!(o&&o.contains(t.target))&&n.zoomable&&bt(n.zoomOnWheel,t)?(o=Number(n.zoomRatio)||.1,this.actionEvent=t,this.zoom(-e*o,!0)):bt(n.slideOnWheel,t)&&(this.actionEvent=t,0<e?this.next(n.loop):e<0&&this.prev(n.loop))))},gesture:function(t){var e=this.options;if(this.viewed&&(e.zoomOnGesture||e.rotateOnGesture))switch(t.preventDefault(),t.type){case"gesturestart":this.gesturing=!0,this.gestureScale=t.scale||1,this.gestureRotation=t.rotation||0;break;case"gesturechange":var i=t.scale||1,n=i/(this.gestureScale||1),o=Number(t.rotation),a=o-(this.gestureRotation||0);this.gestureScale=i,e.zoomable&&e.zoomOnGesture&&1!=n&&(this.actionEvent=t,this.zoom(1<=n?n-1:1-1/n)),e.rotatable&&e.rotateOnGesture&&O(o)&&(this.gestureRotation=o,0!=a)&&(this.actionEvent=t,this.rotate(a));break;case"gestureend":this.gesturing=!1,this.gestureScale=1,this.gestureRotation=0}}},Pt={show:function(){var t,e,i,n=0<arguments.length&&void 0!==arguments[0]&&arguments[0],o=this.element,a=this.options;return a.inline||this.showing||this.isShown||this.showing||(this.ready?(t=this.actionEvent||this.showOriginalEvent||this.viewOriginalEvent||null,this.actionEvent=null,this.showOriginalEvent=t,I(a.show)&&N(o,"show",a.show,{once:!0}),!1!==P(o,"show",{originalEvent:t})&&this.ready&&(this.hiding&&this.transitioning.abort(),this.showing=!0,this.open(),R(e=this.viewer,b),e.setAttribute("role","dialog"),e.setAttribute("aria-labelledby",this.title.id),e.setAttribute("aria-modal",!0),e.removeAttribute("aria-hidden"),S(a,"show")&&!n?(i=this.shown.bind(this),this.transitioning={abort:function(){X(e,c,i),R(e,d)}},C(e,x),e.initialOffsetWidth=e.offsetWidth,N(e,c,i,{once:!0}),C(e,d)):(C(e,d),this.shown()))):(this.build(),this.ready&&this.show(n))),this},hide:function(){var t,e,i,n,o,a,s=this,r=0<arguments.length&&void 0!==arguments[0]&&arguments[0],l=this.element,h=this.options;return h.inline||this.hiding||!this.isShown&&!this.showing||(t=this.actionEvent||this.hideOriginalEvent||null,this.actionEvent=null,this.hideOriginalEvent=t,I(h.hide)&&N(l,"hide",h.hide,{once:!0}),!1===P(l,"hide",{originalEvent:t}))||this.destroyed||(this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort(),e=this.viewer,i=this.image,n=function(){R(e,d),s.hidden()},S(h,"hide")&&!r?(o=function(t){t&&t.target===e&&(X(e,c,o),s.hidden())},a=function(){zt(e,x)?(N(e,c,o),R(e,d)):n()},this.transitioning={abort:function(){s.viewed&&zt(i,x)?X(i,c,a):zt(e,x)&&X(e,c,o)}},this.viewed&&zt(i,x)?(N(i,c,a,{once:!0}),this.zoomTo(0,!1,null,!0)):a()):n()),this},view:function(){var o=this,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.options.initialViewIndex,n=this.index,i=Number(i)||0;if(!(this.hiding||this.played||i<0||i>=this.length||this.viewed&&i===n)){var t=this.actionEvent||this.viewOriginalEvent||null;if(this.actionEvent=null,this.viewOriginalEvent=t,!this.isShown)return this.index=i,this.show();this.viewing&&this.viewing.abort();var a,s,r=this.element,l=this.options,h=this.title,e=this.canvas,c=this.getItem(i),u=(c||(this.initList(i),c=this.getItem(i)),c.querySelector("img")),d=Y(u,"originalUrl"),m=u.getAttribute("alt"),g=document.createElement("img");Et(g,u,l.inheritedAttributes),g.src=d,g.alt=m,I(l.view)&&N(r,"view",l.view,{once:!0}),!1===P(r,"view",{originalImage:this.images[i],index:i,image:g,originalEvent:t})||!this.isShown||this.hiding||this.played||(this.hideMagnifier(),(d=this.getItem(n))&&(R(d,V),d.removeAttribute("aria-selected")),C(c,V),c.setAttribute("aria-selected",!0),l.focus&&c.focus(),this.image=g,this.viewed=!1,this.index=i,this.imageData={},C(g,w),l.loading&&C(e,v),e.innerHTML="",e.appendChild(g),this.renderList(),h.innerHTML="",N(r,E,a=function(){var t=o.imageData,e=Array.isArray(l.title)?l.title[1]:l.title;h.innerHTML=k(e=I(e)?e.call(o,g,t):"".concat(m," (").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,l.preload&&(e=(e=i+(t=i<n?-1:1))<0||e>=o.length?l.loop?0<t?0:o.length-1:-1:e)!==i&&(t=o.images[e],Et(e=document.createElement("img"),t,l.inheritedAttributes),e.src=o.getImageURL(t)||t.src)},{once:!0}),(s=function(){function e(){X(g,f,t),X(g,y,i),o.timeout&&(clearTimeout(o.timeout),o.timeout=!1)}var t,i,n=0<arguments.length&&void 0!==arguments[0]&&arguments[0];o.viewing={abort:function(){X(r,E,a),g.complete?o.imageRendering?o.imageRendering.abort():o.imageInitializing&&o.imageInitializing.abort():(g.src="",e())}},g.complete?o.load():(N(g,f,t=function(){e(),o.load()},{once:!0}),N(g,y,i=function(){if(e(),!n){var t=u.src;if(t&&t!==g.src)return g.src=t,void s(!0)}R(g,w),l.loading&&R(o.canvas,v)},{once:!0}),o.timeout&&clearTimeout(o.timeout),o.timeout=setTimeout(function(){R(g,w),o.timeout=!1},1e3))})())}return this},prev:function(){var t=this.index-1;return t<0&&(t=0<arguments.length&&void 0!==arguments[0]&&arguments[0]?this.length-1:0),this.view(t),this},next:function(){var t=this.length-1,e=this.index+1;return this.view(e=t<e?0<arguments.length&&void 0!==arguments[0]&&arguments[0]?0:t:e),this},move:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData;return this.moveTo(T(t)?t:i.x+Number(t),T(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=this.element,o=this.options,a=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&o.movable){var s=a.x,r=a.y,l=!1;if(O(t)?l=!0:t=s,O(i)?l=!0:i=r,l){var h=this.actionEvent||null;if(this.actionEvent=null,I(o.move)&&N(n,"move",o.move,{once:!0}),!1===P(n,"move",{x:t,y:i,oldX:s,oldY:r,originalEvent:h}))return this;a.x=t,a.y=i,a.left=t,a.top=i,L(this.image,x,S(o,"move")),this.moving=!0,this.renderImage(function(){e.moving=!1,I(o.moved)&&N(n,"moved",o.moved,{once:!0}),P(n,"moved",{x:t,y:i,oldX:s,oldY:r,originalEvent:h},{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(O(t=Number(t))&&this.viewed&&!this.played&&n.rotatable){var a=o.rotate,s=this.actionEvent||null;if(this.actionEvent=null,I(n.rotate)&&N(i,"rotate",n.rotate,{once:!0}),!1===P(i,"rotate",{degree:t,oldDegree:a,originalEvent:s}))return this;o.rotate=t,L(this.image,x,S(n,"rotate")),this.rotating=!0,this.renderImage(function(){e.rotating=!1,I(n.rotated)&&N(i,dt,n.rotated,{once:!0}),P(i,dt,{degree:t,oldDegree:a,originalEvent: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,a=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&o.scalable){var s=a.scaleX,r=a.scaleY,l=!1;if(O(t)?l=!0:t=s,O(i)?l=!0:i=r,l){var h=this.actionEvent||null;if(this.actionEvent=null,I(o.scale)&&N(n,"scale",o.scale,{once:!0}),!1===P(n,"scale",{scaleX:t,scaleY:i,oldScaleX:s,oldScaleY:r,originalEvent:h}))return this;a.scaleX=t,a.scaleY=i,L(this.image,x,S(o,"scale")),this.scaling=!0,this.renderImage(function(){e.scaling=!1,I(o.scaled)&&N(n,"scaled",o.scaled,{once:!0}),P(n,"scaled",{scaleX:t,scaleY:i,oldScaleX:s,oldScaleY:r,originalEvent:h},{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,a=1<arguments.length&&void 0!==arguments[1]&&arguments[1],s=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,r=3<arguments.length&&void 0!==arguments[3]&&arguments[3],l=this.element,h=this.options,c=this.pointers,u=this.imageData,d=u.x,m=u.y,g=u.width,v=u.height,f=u.naturalWidth,p=u.naturalHeight;if(O(t=Math.max(0,t))&&this.viewed&&!this.played&&(r||h.zoomable)){r||(r=Math.max(.01,I(h.minZoomRatio)?h.minZoomRatio.call(this,this.image,u):h.minZoomRatio),y=Math.min(100,I(h.maxZoomRatio)?h.maxZoomRatio.call(this,this.image,u):h.maxZoomRatio),t=Math.min(Math.max(t,r),y));var b=this.actionEvent||null;if(this.actionEvent=null,b&&b.type!==z)switch(b.type){case"wheel":.055<=h.zoomRatio&&.95<t&&t<1.05&&(t=1);break;case"pointermove":case"touchmove":case"mousemove":.99<t&&t<1.01&&(t=1)}var w,r=f*t,y=p*t,f=r-g,p=y-v,E=u.ratio;if(I(h.zoom)&&N(l,"zoom",h.zoom,{once:!0}),!1===P(l,"zoom",{ratio:t,oldRatio:E,originalEvent:b}))return this;this.zooming=!0,b&&b.type!==z?(w={left:(w=(w=this.viewer).getBoundingClientRect()).left+(window.pageXOffset-document.documentElement.clientLeft),top:w.top+(window.pageYOffset-document.documentElement.clientTop)},c=c&&0<Object.keys(c).length?(o=n=i=0,M(c,function(t){var e=t.startX;i+=e,n+=t.startY,o+=1}),{pageX:i/=o,pageY:n/=o}):{pageX:b.pageX,pageY:b.pageY},u.x-=(c.pageX-w.left-d)/g*f,u.y-=(c.pageY-w.top-m)/v*p):D(s)&&O(s.x)&&O(s.y)?(u.x-=f*((s.x-d)/g),u.y-=p*((s.y-m)/v)):(u.x-=f/2,u.y-=p/2),u.left=u.x,u.top=u.y,u.width=r,u.height=y,u.oldRatio=E,u.ratio=t,L(this.image,x,S(h,"zoom")),this.renderImage(function(){e.zooming=!1,I(h.zoomed)&&N(l,"zoomed",h.zoomed,{once:!0}),P(l,"zoomed",{ratio:t,oldRatio:E,originalEvent:b},{cancelable:!1})}),a&&this.tooltip()}return this},play:function(){var i,n,t,o,a,s,r,l,h,c,u=this,e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];return this.isShown&&!this.played&&(i=this.element,n=this.options,t=this.actionEvent||null,this.actionEvent=null,I(n.play)&&N(i,"play",n.play,{once:!0}),!1!==P(i,"play",{originalEvent:t})&&(o=this.player,a=this.loadImage.bind(this),s=[],l=r=0,this.played=!0,this.onLoadWhenPlay=a,e&&this.requestFullscreen(e),C(o,m),o.removeAttribute("aria-hidden"),M(this.images,function(t,e){var i=document.createElement("img");i.src=u.getImageURL(t)||t.src,i.alt=t.alt||"",i.referrerPolicy=t.referrerPolicy,r+=1,C(i,K),L(i,x,S(n,"play")),e===u.index&&(C(i,d),l=e),s.push(i),N(i,f,a,{once:!0}),o.appendChild(i)}),O(n.interval))&&0<n.interval&&(h=function(){clearTimeout(u.playing.timeout);var t=u.actionEvent||null;u.actionEvent=null;var e=0<=(e=l-1)?e:r-1;I(n.playing)&&N(i,mt,n.playing,{once:!0}),!1!==P(i,mt,{originalImage:u.images[e],index:e,image:s[e],originalEvent:t})&&(R(s[l],d),C(s[l=e],d)),u.playing.timeout=n.autoplay?setTimeout(h,n.interval):null},c=function(){clearTimeout(u.playing.timeout);var t=u.actionEvent||null;u.actionEvent=null;var e=(e=l+1)<r?e:0;I(n.playing)&&N(i,mt,n.playing,{once:!0}),!1!==P(i,mt,{originalImage:u.images[e],index:e,image:s[e],originalEvent:t})&&(R(s[l],d),C(s[l=e],d)),u.playing.timeout=n.autoplay?setTimeout(c,n.interval):null},1<r))&&(this.playing={prev:h,next:c,timeout:n.autoplay?setTimeout(c,n.interval):null}),this},stop:function(){var t,e,i,n=this;return this.played&&(t=this.element,i=this.options,e=this.actionEvent||null,this.actionEvent=null,I(i.stop)&&N(t,"stop",i.stop,{once:!0}),!1!==P(t,"stop",{originalEvent:e}))&&(i=this.player,clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,M(i.getElementsByTagName("img"),function(t){X(t,f,n.onLoadWhenPlay)}),R(i,m),i.setAttribute("aria-hidden",!0),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(),C(this.button,$),R(o,x),this.viewed&&R(n,x),C(i,U),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),A(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=g({},this.containerData),this.renderList(),this.viewed)&&this.initImage(function(){t.renderImage()}),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(),R(this.button,$),R(o,x),this.viewed&&R(n,x),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),R(i,U),A(i,{zIndex:e.zIndexInline}),this.viewerData=g({},this.parentData),this.renderViewer(),this.renderList(),this.viewed)&&this.initImage(function(){t.renderImage()}),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):S(e,"tooltip")?(this.fading&&P(i,c),C(i,m),C(i,K),C(i,x),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,C(i,d)):(C(i,m),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){S(e,"tooltip")?(N(i,c,function(){R(i,m),R(i,K),R(i,x),i.setAttribute("aria-hidden",!0),t.fading=!1},{once:!0}),R(i,d),t.fading=!0):(R(i,m),i.setAttribute("aria-hidden",!0)),t.tooltipping=!1},1e3)),this},toggle:function(){return 1===this.imageData.ratio?this.zoomTo(this.imageData.oldRatio,!0):this.zoomTo(1,!0),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=g({},this.initialImageData),this.renderImage()),this},update:function(t){var n,o,e=this,i=this.element,a=this.options,s=this.isImg;return D(t)&&g(a,t),s&&!i.parentNode?this.destroy():(n=[],M(s?[i]:i.querySelectorAll("img"),function(t){I(a.filter)?a.filter.call(e,t)&&n.push(t):e.getImageURL(t)&&n.push(t)}),n.length&&(this.images=n,this.length=n.length,this.ready?(o=[],M(this.items,function(t){var e=t.querySelector("img"),t=Number(Y(t,"index")),i=n[t];i&&e&&i.src===e.src&&i.alt===e.alt||o.push(t)}),A(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))):(C(s=this.getItem(this.index),V),s.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[p]&&(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||(X(t,z,this.onElementClick),X(t,at,this.onElementKeyDown)),t[p]=void 0),this}},Ft={getImageURL:function(t){var e=this.options.url;return e=k(e)?t.getAttribute(e):I(e)?e.call(this,t):""},enforceFocus:function(){var n=this;this.clearEnforceFocus(),N(document,ot,this.onFocusin=function(t){var e=n.viewer,i=t.target;if(i!==document&&i!==e&&!e.contains(i)){for(;i;){if(null!==i.getAttribute("tabindex")||"true"===i.getAttribute("aria-modal"))return;i=i.parentElement}e.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(X(document,ot,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;C(t,et),0<this.scrollbarWidth&&(t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var t=this.body;R(t,et),0<this.scrollbarWidth&&(t.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var t=this.element,e=this.options,i=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,e.focus&&(i.focus(),this.enforceFocus()),I(e.shown)&&N(t,"shown",e.shown,{once:!0}),!1!==P(t,"shown",{originalEvent:this.showOriginalEvent||null})&&(this.showOriginalEvent=null,this.ready)&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,e=this.options,i=this.viewer,n=i.ownerDocument.activeElement;n&&i.contains(n)&&I(n.blur)&&n.blur(),e.focus&&this.clearEnforceFocus(),this.close(),this.unbind(),C(i,b),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),i.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(I(e.hidden)&&N(t,"hidden",e.hidden,{once:!0}),P(t,"hidden",{originalEvent:this.hideOriginalEvent||null},{cancelable:!1}),this.hideOriginalEvent=null)},requestFullscreen:function(t){var e=this.ownerDocument;this.fulled&&!(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)&&((e=e.documentElement).requestFullscreen?D(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.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 o=n.endX-n.startX,a=n.endY-n.startY;switch(this.action){case j:0==o&&0==a||(this.pointerMoved=!0,this.actionEvent=t,this.move(o,a));break;case h:e.zoomable&&e.zoomOnTouch&&0!==(s=Rt(i))&&(this.actionEvent=t,this.zoom(s));break;case H:e.rotatable&&e.rotateOnTouch&&0!==(s=Lt(i))&&(this.actionEvent=t,this.rotate(s));break;case l:e.zoomable&&e.zoomOnTouch&&0!==(s=Rt(i))&&(this.actionEvent=t,this.zoom(s)),e.rotatable&&e.rotateOnTouch&&0!==(s=Lt(i))&&(this.actionEvent=t,this.rotate(s));break;case B:this.action="switched";var s=Math.abs(o);1<s&&s>Math.abs(a)&&(this.pointers={},this.actionEvent=t,1<o?this.prev(e.loop):o<-1&&this.next(e.loop))}M(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}},qt=e.Viewer,Wt=(Xt=-1,function(){return Xt+=1}),e=(()=>{function o(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=this,n=o;if(!(i instanceof n))throw new TypeError("Cannot call a class as a function");if(!t||1!==t.nodeType&&11!==t.nodeType)throw new Error("The first argument is required and must be an element.");this.element=t,this.ownerDocument=t.ownerDocument||t.host.ownerDocument,this.options=g({},W,D(e)&&e),this.action=!1,this.actionEvent=null,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=Wt(),this.init()}return t=o,i=[{key:"create",value:function(t,e){return new o(t,e)}},{key:"setDefaults",value:function(t){g(W,D(t)&&t)}},{key:"noConflict",value:function(){return window.Viewer=qt,o}}],(e=[{key:"init",value:function(){var t,e,i,n,o=this,a=this.element,s=this.options;a[p]||(a[p]=this,s.focus&&!s.keyboard&&(s.focus=!1),e=[],M((t="img"===a.localName)?[a]:a.querySelectorAll("img"),function(t){I(s.filter)?s.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(),T(this.ownerDocument.createElement(p).style.transition)&&(s.transition=!1),s.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(){M(e,function(t){t.complete||(X(t,f,n),X(t,y,n))})}},M(e,function(t){var e,i;t.complete?n():(N(t,f,e=function(){X(t,y,i),n()},{once:!0}),N(t,y,i=function(){X(t,f,e),n()},{once:!0}))})):(N(a,z,this.onElementClick=function(t){var e=t.target;"img"!==e.localName||I(s.filter)&&!s.filter.call(o,e)||(o.actionEvent=t,o.view(o.images.indexOf(e)))}),N(a,at,this.onElementKeyDown=function(t){var e=t.target,i=t.key;"img"!==e.localName||"Enter"!==i&&" "!==i||(t.preventDefault(),I(s.filter)&&!s.filter.call(o,e))||(o.actionEvent=t,o.view(o.images.indexOf(e)))})))}},{key:"build",value:function(){var t,a,e,i,n,o,s,r,l,h,c,u,d,m,g,v,f;this.ready||(t=this.element,a=this.options,e=t.parentNode,(v=document.createElement("div")).innerHTML='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-magnifier" aria-hidden="true"><img class="viewer-magnifier-image" alt=""></div><div class="viewer-navigation" aria-hidden="true"><div class="viewer-prev" data-viewer-action="prev" role="button" aria-label="Previous"></div><div class="viewer-next" data-viewer-action="next" role="button" aria-label="Next"></div></div><div class="viewer-footer" aria-hidden="true"><div class="viewer-title" aria-hidden="true"></div><div class="viewer-toolbar" aria-hidden="true"></div><div class="viewer-navbar" aria-hidden="true"><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" aria-hidden="true"></div><div class="viewer-player" aria-hidden="true"></div></div>',v=(i=v.querySelector(".".concat(p,"-container"))).querySelector(".".concat(p,"-title")),n=i.querySelector(".".concat(p,"-toolbar")),f=i.querySelector(".".concat(p,"-navbar")),o=i.querySelector(".".concat(p,"-navigation")),s=i.querySelector(".".concat(p,"-button")),r=i.querySelector(".".concat(p,"-canvas")),this.parent=e,this.viewer=i,this.title=v,this.toolbar=n,this.navbar=f,this.navigation=o,this.button=s,this.canvas=r,this.footer=i.querySelector(".".concat(p,"-footer")),this.magnifier=i.querySelector(".".concat(p,"-magnifier")),this.magnifierImage=i.querySelector(".".concat(p,"-magnifier-image")),this.tooltipBox=i.querySelector(".".concat(p,"-tooltip")),this.player=i.querySelector(".".concat(p,"-player")),this.list=i.querySelector(".".concat(p,"-list")),i.id="".concat(p).concat(this.id),v.id="".concat(p,"Title").concat(this.id),C(v,a.title?F(Array.isArray(a.title)?a.title[0]:a.title):b),a.title&&v.removeAttribute("aria-hidden"),v=D(a.navbar)?a.navbar:{},l=a.navbar,h=T(v.size)?a.navbar:v.size,C(f,(l=D(a.navbar)?!!T(v.show)||v.show:l)?F(l):b),l&&f.removeAttribute("aria-hidden"),-1!==["small","medium","large"].indexOf(h)&&C(f,"".concat(p,"-").concat(h)),D(a.navigation)?M(o.querySelectorAll('[role="button"]'),function(t){var e=Y(t,gt),e=a.navigation[e],i=D(e),n=i&&!T(e.show)?e.show:e,i=i&&!T(e.size)?e.size:e;L(t,b,!n),O(n)&&C(t,F(n)),-1!==["small","large"].indexOf(i)&&C(t,"".concat(p,"-").concat(i))}):C(o,a.navigation?F(a.navigation):b),a.navigation&&o.removeAttribute("aria-hidden"),L(s,b,!a.button),a.button&&s.removeAttribute("aria-hidden"),a.keyboard&&(s.setAttribute("tabindex",0),M(o.querySelectorAll('[role="button"]'),function(t){t.setAttribute("tabindex",0)})),a.backdrop&&(C(i,"".concat(p,"-backdrop")),a.inline||"static"===a.backdrop||Tt(r,gt,"hide")),k(a.className)&&a.className&&a.className.split(vt).forEach(function(t){C(i,t)}),a.toolbar?(c=document.createElement("ul"),u=D(a.toolbar),d=ft.slice(0,3),m=ft.slice(7,9),g=ft.slice(9),u||C(n,F(a.toolbar)),n.removeAttribute("aria-hidden"),M(u?a.toolbar:ft,function(t,e){var i,n=u&&D(t),e=u?Ot(e):t,o=n&&!T(t.show)?t.show:t;!o||!a.zoomable&&-1!==d.indexOf(e)||!a.rotatable&&-1!==m.indexOf(e)||!a.scalable&&-1!==g.indexOf(e)||(i=n&&!T(t.size)?t.size:t,n=n&&!T(t.click)?t.click:t,t=document.createElement("li"),a.keyboard&&t.setAttribute("tabindex",0),t.setAttribute("role","button"),C(t,"".concat(p,"-").concat(e)),I(n)||Tt(t,gt,e),O(o)&&C(t,F(o)),-1!==["small","large"].indexOf(i)?C(t,"".concat(p,"-").concat(i)):"play"===e&&C(t,"".concat(p,"-large")),I(n)&&N(t,z,n),c.appendChild(t))}),n.appendChild(c)):C(n,b),a.title||l||a.toolbar?this.footer.removeAttribute("aria-hidden"):C(this.footer,b),a.rotatable||(C(v=n.querySelectorAll('li[class*="rotate"]'),w),M(v,function(t){n.appendChild(t)})),a.inline?(C(s,Z),A(i,{zIndex:a.zIndexInline}),"static"===window.getComputedStyle(e).position&&A(e,{position:"relative"}),e.insertBefore(i,t.nextSibling)):(C(s,G),C(i,U),C(i,K),C(i,b),A(i,{zIndex:a.zIndex}),(f=(f=k(f=a.container)?this.ownerDocument.querySelector(f):f)||this.body).appendChild(i)),a.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,I(a.ready)&&N(t,"ready",a.ready,{once:!0}),!1===P(t,"ready")?this.ready=!1:this.ready&&a.inline&&this.view(this.index))}}])&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i})();return g(e.prototype,i,t,Nt,Pt,Ft),e});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viewerjs",
3
3
  "description": "JavaScript image viewer.",
4
- "version": "1.13.0",
4
+ "version": "1.14.0",
5
5
  "main": "dist/viewer.common.js",
6
6
  "module": "dist/viewer.esm.js",
7
7
  "browser": "dist/viewer.js",
@@ -68,6 +68,7 @@ export const EVENT_SCALED = 'scaled';
68
68
  export const EVENT_ZOOM = 'zoom';
69
69
  export const EVENT_ZOOMED = 'zoomed';
70
70
  export const EVENT_PLAY = 'play';
71
+ export const EVENT_PLAYING = 'playing';
71
72
  export const EVENT_STOP = 'stop';
72
73
 
73
74
  // Data keys
@@ -204,7 +204,10 @@ export default {
204
204
 
205
205
  /**
206
206
  * Enable to zoom the image by wheeling mouse.
207
- * @type {boolean}
207
+ * Set to a modifier key name (`ctrl`, `shift`, `alt`, `meta`), or a
208
+ * combination joined with `+` (e.g. `ctrl+shift`), to only zoom when
209
+ * the given modifier key(s) are held down while wheeling.
210
+ * @type {boolean | string}
208
211
  */
209
212
  zoomOnWheel: true,
210
213
 
@@ -214,6 +217,17 @@ export default {
214
217
  */
215
218
  slideOnTouch: true,
216
219
 
220
+ /**
221
+ * Enable to slide to the next or previous image by wheeling mouse.
222
+ * Set to a modifier key name (`ctrl`, `shift`, `alt`, `meta`), or a
223
+ * combination joined with `+` (e.g. `ctrl+shift`), to only slide when
224
+ * the given modifier key(s) are held down while wheeling.
225
+ * Takes effect over the navbar, and also over the rest of the viewer
226
+ * when `zoomOnWheel` doesn't take effect for the wheel event.
227
+ * @type {boolean | string}
228
+ */
229
+ slideOnWheel: true,
230
+
217
231
  /**
218
232
  * Indicate if toggle the image size between its natural size
219
233
  * and initial size when double click on the image or not.
@@ -289,5 +303,6 @@ export default {
289
303
  zoom: null,
290
304
  zoomed: null,
291
305
  play: null,
306
+ playing: null,
292
307
  stop: null,
293
308
  };
package/src/js/events.js CHANGED
@@ -37,7 +37,7 @@ export default {
37
37
  addListener(document, EVENT_KEY_DOWN, (this.onKeyDown = this.keydown.bind(this)));
38
38
  addListener(window, EVENT_RESIZE, (this.onResize = this.resize.bind(this)));
39
39
 
40
- if (options.zoomable && options.zoomOnWheel) {
40
+ if ((options.zoomable && options.zoomOnWheel) || options.slideOnWheel) {
41
41
  addListener(viewer, EVENT_WHEEL, (this.onWheel = this.wheel.bind(this)), {
42
42
  passive: false,
43
43
  capture: true,
@@ -71,7 +71,7 @@ export default {
71
71
  removeListener(document, EVENT_KEY_DOWN, this.onKeyDown);
72
72
  removeListener(window, EVENT_RESIZE, this.onResize);
73
73
 
74
- if (options.zoomable && options.zoomOnWheel) {
74
+ if ((options.zoomable && options.zoomOnWheel) || options.slideOnWheel) {
75
75
  removeListener(viewer, EVENT_WHEEL, this.onWheel, {
76
76
  passive: false,
77
77
  capture: true,
@@ -30,6 +30,7 @@ import {
30
30
  isPlainObject,
31
31
  isTransitionEnabled,
32
32
  isUndefined,
33
+ isWheelActionEnabled,
33
34
  removeClass,
34
35
  setStyle,
35
36
  toggleClass,
@@ -51,6 +52,8 @@ export default {
51
52
  clearTimeout(this.clickCanvasTimeout);
52
53
  }
53
54
 
55
+ this.actionEvent = event;
56
+
54
57
  switch (action) {
55
58
  case 'mix':
56
59
  if (this.played) {
@@ -138,7 +141,8 @@ export default {
138
141
  }
139
142
 
140
143
  // XXX: No pageX/Y properties in custom event, fallback to the original event.
141
- this.toggle(event.isTrusted ? event : (event.detail && event.detail.originalEvent));
144
+ this.actionEvent = event.isTrusted ? event : (event.detail && event.detail.originalEvent);
145
+ this.toggle();
142
146
  }
143
147
  },
144
148
 
@@ -196,9 +200,12 @@ export default {
196
200
  originalImage: this.images[index],
197
201
  index,
198
202
  image,
203
+ originalEvent: this.viewOriginalEvent || null,
199
204
  }, {
200
205
  cancelable: false,
201
206
  });
207
+
208
+ this.viewOriginalEvent = null;
202
209
  });
203
210
  });
204
211
  },
@@ -246,6 +253,8 @@ export default {
246
253
 
247
254
  const keyCode = event.keyCode || event.which || event.charCode;
248
255
 
256
+ this.actionEvent = event;
257
+
249
258
  switch (keyCode) {
250
259
  // Enter
251
260
  case 13:
@@ -656,6 +665,8 @@ export default {
656
665
  },
657
666
 
658
667
  wheel(event) {
668
+ const { options, navbar } = this;
669
+
659
670
  if (!this.viewed) {
660
671
  return;
661
672
  }
@@ -666,7 +677,7 @@ export default {
666
677
  return;
667
678
  }
668
679
 
669
- // Limit wheel speed to prevent zoom too fast
680
+ // Limit wheel speed to prevent zoom or slide too fast
670
681
  if (this.wheeling) {
671
682
  return;
672
683
  }
@@ -677,7 +688,6 @@ export default {
677
688
  this.wheeling = false;
678
689
  }, 50);
679
690
 
680
- const ratio = Number(this.options.zoomRatio) || 0.1;
681
691
  let delta = 1;
682
692
 
683
693
  if (event.deltaY) {
@@ -688,7 +698,29 @@ export default {
688
698
  delta = event.detail > 0 ? 1 : -1;
689
699
  }
690
700
 
691
- this.zoom(-delta * ratio, true, null, event);
701
+ // Wheeling over the navbar never zooms, only slides
702
+ const overNavbar = navbar && navbar.contains(event.target);
703
+ const zoomable = !overNavbar
704
+ && options.zoomable
705
+ && isWheelActionEnabled(options.zoomOnWheel, event);
706
+
707
+ if (zoomable) {
708
+ const ratio = Number(options.zoomRatio) || 0.1;
709
+
710
+ this.actionEvent = event;
711
+ this.zoom(-delta * ratio, true);
712
+ return;
713
+ }
714
+
715
+ if (isWheelActionEnabled(options.slideOnWheel, event)) {
716
+ this.actionEvent = event;
717
+
718
+ if (delta > 0) {
719
+ this.next(options.loop);
720
+ } else if (delta < 0) {
721
+ this.prev(options.loop);
722
+ }
723
+ }
692
724
  },
693
725
 
694
726
  gesture(event) {
@@ -716,13 +748,15 @@ export default {
716
748
  this.gestureScale = scale;
717
749
 
718
750
  if (options.zoomable && options.zoomOnGesture && ratio !== 1) {
719
- this.zoom(ratio >= 1 ? ratio - 1 : 1 - (1 / ratio), false, null, event);
751
+ this.actionEvent = event;
752
+ this.zoom(ratio >= 1 ? ratio - 1 : 1 - (1 / ratio));
720
753
  }
721
754
 
722
755
  if (options.rotatable && options.rotateOnGesture && isNumber(rotation)) {
723
756
  this.gestureRotation = rotation;
724
757
 
725
758
  if (degree !== 0) {
759
+ this.actionEvent = event;
726
760
  this.rotate(degree);
727
761
  }
728
762
  }