"use strict";function ownKeys(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 _objectSpread2(e){for(var t=1;t
',IS_BROWSER="undefined"!=typeof window&&void 0!==window.document,WINDOW=IS_BROWSER?window:{},IS_TOUCH_DEVICE=!(!IS_BROWSER||!WINDOW.document.documentElement)&&"ontouchstart"in WINDOW.document.documentElement,HAS_POINTER_EVENT=!!IS_BROWSER&&"PointerEvent"in WINDOW,NAMESPACE="viewer",ACTION_MOVE="move",ACTION_SWITCH="switch",ACTION_ZOOM="zoom",CLASS_ACTIVE="".concat(NAMESPACE,"-active"),CLASS_CLOSE="".concat(NAMESPACE,"-close"),CLASS_FADE="".concat(NAMESPACE,"-fade"),CLASS_FIXED="".concat(NAMESPACE,"-fixed"),CLASS_FULLSCREEN="".concat(NAMESPACE,"-fullscreen"),CLASS_FULLSCREEN_EXIT="".concat(NAMESPACE,"-fullscreen-exit"),CLASS_HIDE="".concat(NAMESPACE,"-hide"),CLASS_HIDE_MD_DOWN="".concat(NAMESPACE,"-hide-md-down"),CLASS_HIDE_SM_DOWN="".concat(NAMESPACE,"-hide-sm-down"),CLASS_HIDE_XS_DOWN="".concat(NAMESPACE,"-hide-xs-down"),CLASS_IN="".concat(NAMESPACE,"-in"),CLASS_INVISIBLE="".concat(NAMESPACE,"-invisible"),CLASS_LOADING="".concat(NAMESPACE,"-loading"),CLASS_MOVE="".concat(NAMESPACE,"-move"),CLASS_OPEN="".concat(NAMESPACE,"-open"),CLASS_SHOW="".concat(NAMESPACE,"-show"),CLASS_TRANSITION="".concat(NAMESPACE,"-transition"),EVENT_CLICK="click",EVENT_DBLCLICK="dblclick",EVENT_DRAG_START="dragstart",EVENT_FOCUSIN="focusin",EVENT_KEY_DOWN="keydown",EVENT_LOAD="load",EVENT_ERROR="error",EVENT_TOUCH_END=IS_TOUCH_DEVICE?"touchend touchcancel":"mouseup",EVENT_TOUCH_MOVE=IS_TOUCH_DEVICE?"touchmove":"mousemove",EVENT_TOUCH_START=IS_TOUCH_DEVICE?"touchstart":"mousedown",EVENT_POINTER_DOWN=HAS_POINTER_EVENT?"pointerdown":EVENT_TOUCH_START,EVENT_POINTER_MOVE=HAS_POINTER_EVENT?"pointermove":EVENT_TOUCH_MOVE,EVENT_POINTER_UP=HAS_POINTER_EVENT?"pointerup pointercancel":EVENT_TOUCH_END,EVENT_RESIZE="resize",EVENT_TRANSITION_END="transitionend",EVENT_WHEEL="wheel",EVENT_READY="ready",EVENT_SHOW="show",EVENT_SHOWN="shown",EVENT_HIDE="hide",EVENT_HIDDEN="hidden",EVENT_VIEW="view",EVENT_VIEWED="viewed",EVENT_MOVE="move",EVENT_MOVED="moved",EVENT_ROTATE="rotate",EVENT_ROTATED="rotated",EVENT_SCALE="scale",EVENT_SCALED="scaled",EVENT_ZOOM="zoom",EVENT_ZOOMED="zoomed",EVENT_PLAY="play",EVENT_STOP="stop",DATA_ACTION="".concat(NAMESPACE,"Action"),REGEXP_SPACES=/\s\s*/,BUTTONS=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function isString(t){return"string"==typeof t}var isNaN=Number.isNaN||WINDOW.isNaN;function isNumber(t){return"number"==typeof t&&!isNaN(t)}function isUndefined(t){return void 0===t}function isObject(t){return"object"===_typeof(t)&&null!==t}var hasOwnProperty=Object.prototype.hasOwnProperty;function isPlainObject(t){if(!isObject(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&hasOwnProperty.call(i,"isPrototypeOf")}catch(t){return!1}}function isFunction(t){return"function"==typeof t}function forEach(e,i){if(e&&isFunction(i))if(Array.isArray(e)||isNumber(e.length))for(var t=e.length,n=0;n/g,">"):t}function hasClass(t,e){return!(!t||!e)&&(t.classList?t.classList.contains(e):-1=this.length||this.viewed&&t===this.index)return this;if(!this.isShown)return this.index=t,this.show();this.viewing&&this.viewing.abort();var e=this.element,n=this.options,s=this.title,a=this.canvas,o=this.items[t],r=o.querySelector("img"),l=getData(r,"originalUrl"),h=r.getAttribute("alt"),c=document.createElement("img");if(forEach(n.inheritedAttributes,function(t){var e=r.getAttribute(t);null!==e&&c.setAttribute(t,e)}),c.src=l,c.alt=h,isFunction(n.view)&&addListener(e,EVENT_VIEW,n.view,{once:!0}),!1===dispatchEvent(e,EVENT_VIEW,{originalImage:this.images[t],index:t,image:c})||!this.isShown||this.hiding||this.played)return this;l=this.items[this.index];l&&(removeClass(l,CLASS_ACTIVE),l.removeAttribute("aria-selected")),addClass(o,CLASS_ACTIVE),o.setAttribute("aria-selected",!0),n.focus&&o.focus(),this.image=c,this.viewed=!1,this.index=t,this.imageData={},addClass(c,CLASS_INVISIBLE),n.loading&&addClass(a,CLASS_LOADING),a.innerHTML="",a.appendChild(c),this.renderList(),s.innerHTML="";function d(){var t=i.imageData,e=Array.isArray(n.title)?n.title[1]:n.title;s.innerHTML=escapeHTMLEntities(isFunction(e)?e.call(i,c,t):"".concat(h," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")"))}var u,E;return addListener(e,EVENT_VIEWED,d,{once:!0}),this.viewing={abort:function(){removeListener(e,EVENT_VIEWED,d),c.complete?i.imageRendering?i.imageRendering.abort():i.imageInitializing&&i.imageInitializing.abort():(c.src="",removeListener(c,EVENT_LOAD,u),i.timeout&&clearTimeout(i.timeout))}},c.complete?this.load():(addListener(c,EVENT_LOAD,u=function(){removeListener(c,EVENT_ERROR,E),i.load()},{once:!0}),addListener(c,EVENT_ERROR,E=function(){removeListener(c,EVENT_LOAD,u),i.timeout&&(clearTimeout(i.timeout),i.timeout=!1),removeClass(c,CLASS_INVISIBLE),n.loading&&removeClass(i.canvas,CLASS_LOADING)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){removeClass(c,CLASS_INVISIBLE),i.timeout=!1},1e3)),this},prev:function(){var t=this.index-1;return t<0&&(t=0Math.abs(a)&&(this.pointers={},1