!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(window,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="./",i(i.s=31)}({0:function(t,e,i){"use strict";function n(t,e,i,n,o,s,a,r){var l,h="function"==typeof t?t.options:t;if(e&&(h.render=e,h.staticRenderFns=i,h._compiled=!0),n&&(h.functional=!0),s&&(h._scopeId="data-v-"+s),a?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},h._ssrRegister=l):o&&(l=r?function(){o.call(this,(h.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(h.functional){h._injectStyles=l;var c=h.render;h.render=function(t,e){return l.call(e),c(t,e)}}else{var u=h.beforeCreate;h.beforeCreate=u?[].concat(u,l):[l]}return{exports:t,options:h}}i.d(e,"a",(function(){return n}))},31:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this.$createElement;return(this._self._c||t)("div",[this._t("default",null,{images:this.images,options:this.options})],2)};n._withStripped=!0;var o=i(38),s=i.n(o);function a(){return(a=Object.assign||function(t){for(var e=1;e1?e-1:0),n=1;n0&&i.forEach((function(e){q(e)&&Object.keys(e).forEach((function(i){t[i]=e[i]}))})),t},B=/^(?:width|height|left|top|marginLeft|marginTop)$/;function U(t,e){var i=t.style;H(e,(function(t,e){B.test(e)&&Y(t)&&(t+="px"),i[e]=t}))}function K(t){return X(t)?t.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"):t}function Z(t,e){return!(!t||!e)&&(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)}function G(t,e){if(t&&e)if(Y(t.length))H(t,(function(t){G(t,e)}));else if(t.classList)t.classList.add(e);else{var i=t.className.trim();i?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e}}function J(t,e){t&&e&&(Y(t.length)?H(t,(function(t){J(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Q(t,e,i){e&&(Y(t.length)?H(t,(function(t){Q(t,e,i)})):i?G(t,e):J(t,e))}var tt=/([a-z\d])([A-Z])/g;function et(t){return t.replace(tt,"$1-$2").toLowerCase()}function it(t,e){return q(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(et(e)))}function nt(t,e,i){q(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(et(e)),i)}var ot=function(){var t=!1;if(c){var e=!1,i=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});u.addEventListener("test",i,n),u.removeEventListener("test",i,n)}return t}();function st(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;e.trim().split(N).forEach((function(e){if(!ot){var s=t.listeners;s&&s[e]&&s[e][i]&&(o=s[e][i],delete s[e][i],0===Object.keys(s[e]).length&&delete s[e],0===Object.keys(s).length&&delete t.listeners)}t.removeEventListener(e,o,n)}))}function at(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;e.trim().split(N).forEach((function(e){if(n.once&&!ot){var s=t.listeners,a=void 0===s?{}:s;o=function(){delete a[e][i],t.removeEventListener(e,o,n);for(var s=arguments.length,r=new Array(s),l=0;lr?c=r/s:a=l*s,a=Math.min(.9*a,e),c=Math.min(.9*c,o);var u=(r-a)/2,d=(l-c)/2,m={left:u,top:d,x:u,y:d,width:a,height:c,oldRatio:1,ratio:a/e,aspectRatio:s,naturalWidth:e,naturalHeight:o},f=$({},m);n.rotatable&&(m.rotate=h.rotate||0,f.rotate=0),n.scalable&&(m.scaleX=h.scaleX||1,m.scaleY=h.scaleY||1,f.scaleX=1,f.scaleY=1),i.imageData=m,i.initialImageData=f,t&&t()}))},renderImage:function(t){var e=this,i=this.image,n=this.imageData;if(U(i,$({width:n.width,height:n.height,marginLeft:n.x,marginTop:n.y},ht(n))),t)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&Z(i,A)){var o=function(){e.imageRendering=!1,t()};this.imageRendering={abort:function(){st(i,"transitionend",o)}},at(i,"transitionend",o,{once:!0})}else t()},resetImage:function(){if(this.viewing||this.viewed){var t=this.image;this.viewing&&this.viewing.abort(),t.parentNode.removeChild(t),this.image=null}}},pt={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;at(e,"click",this.onClick=this.click.bind(this)),at(e,"dragstart",this.onDragStart=this.dragstart.bind(this)),at(i,C,this.onPointerDown=this.pointerdown.bind(this)),at(n,R,this.onPointerMove=this.pointermove.bind(this)),at(n,L,this.onPointerUp=this.pointerup.bind(this)),at(n,"keydown",this.onKeyDown=this.keydown.bind(this)),at(window,"resize",this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&at(e,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&at(i,"dblclick",this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;st(e,"click",this.onClick),st(e,"dragstart",this.onDragStart),st(i,C,this.onPointerDown),st(n,R,this.onPointerMove),st(n,L,this.onPointerUp),st(n,"keydown",this.onKeyDown),st(window,"resize",this.onResize),t.zoomable&&t.zoomOnWheel&&st(e,"wheel",this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&st(i,"dblclick",this.onDblclick)}},wt={click:function(t){var e=this.options,i=this.imageData,n=t.target,o=it(n,F);switch(o||"img"!==n.localName||"li"!==n.parentElement.localName||(o=it(n=n.parentElement,F)),d&&t.isTrusted&&n===this.canvas&&clearTimeout(this.clickCanvasTimeout),o){case"mix":this.played?this.stop():e.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.hide();break;case"view":this.view(it(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&&(d&&t.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(t))},load:function(){var t=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var e=this.element,i=this.options,n=this.image,o=this.index,s=this.viewerData;J(n,E),i.loading&&J(this.canvas,D),n.style.cssText="height:0;"+"margin-left:".concat(s.width/2,"px;")+"margin-top:".concat(s.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage((function(){Q(n,S,i.movable),Q(n,A,i.transition),t.renderImage((function(){t.viewed=!0,t.viewing=!1,V(i.viewed)&&at(e,"viewed",i.viewed,{once:!0}),rt(e,"viewed",{originalImage:t.images[o],index:o,image:n},{cancelable:!1})}))}))},loadImage:function(t){var e=t.target,i=e.parentNode,n=i.offsetWidth||30,o=i.offsetHeight||50,s=!!it(e,"filled");ut(e,this.options,(function(t,i){var a=t/i,r=n,l=o;o*a>n?s?r=o*a:l=n/a:s?l=n/a:r=o*a,U(e,$({width:r,height:l},ht({translateX:(n-r)/2,translateY:(o-l)/2})))}))},keydown:function(t){var e=this.options;if(e.keyboard){var i=t.keyCode||t.which||t.charCode;switch(i){case 13:this.viewer.contains(t.target)&&this.click(t)}if(this.fulled)switch(i){case 27:this.played?this.stop():e.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.prev(e.loop);break;case 38:t.preventDefault(),this.zoom(e.zoomRatio,!0);break;case 39:this.next(e.loop);break;case 40:t.preventDefault(),this.zoom(-e.zoomRatio,!0);break;case 48:case 49:t.ctrlKey&&(t.preventDefault(),this.toggle())}}},dragstart:function(t){"img"===t.target.localName&&t.preventDefault()},pointerdown:function(t){var e=this.options,i=this.pointers,n=t.buttons,o=t.button;if(!(!this.viewed||this.showing||this.viewing||this.hiding||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(Y(n)&&1!==n||Y(o)&&0!==o||t.ctrlKey))){t.preventDefault(),t.changedTouches?H(t.changedTouches,(function(t){i[t.identifier]=mt(t)})):i[t.pointerId||0]=mt(t);var s=!!e.movable&&"move";e.zoomOnTouch&&e.zoomable&&Object.keys(i).length>1?s="zoom":e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(s="switch"),!e.transition||"move"!==s&&"zoom"!==s||J(this.image,A),this.action=s}},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),t.changedTouches?H(t.changedTouches,(function(t){$(e[t.identifier]||{},mt(t,!0))})):$(e[t.pointerId||0]||{},mt(t,!0)),this.change(t))},pointerup:function(t){var e,i=this,n=this.options,o=this.action,s=this.pointers;t.changedTouches?H(t.changedTouches,(function(t){e=s[t.identifier],delete s[t.identifier]})):(e=s[t.pointerId||0],delete s[t.pointerId||0]),o&&(t.preventDefault(),!n.transition||"move"!==o&&"zoom"!==o||G(this.image,A),this.action=!1,d&&"zoom"!==o&&e&&Date.now()-e.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),n.toggleOnDblclick&&this.viewed&&t.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout((function(){rt(i.image,"dblclick")}),50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout((function(){i.imageClicked=!1}),500)):(this.imageClicked=!1,n.backdrop&&"static"!==n.backdrop&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout((function(){rt(i.canvas,"click")}),50)))))},resize:function(){var t=this;if(this.isShown&&!this.hiding&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage()})),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement))return void this.stop();H(this.player.getElementsByTagName("img"),(function(e){at(e,"load",t.loadImage.bind(t),{once:!0}),rt(e,"load")}))}},wheel:function(t){var e=this;if(this.viewed&&(t.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50);var i=Number(this.options.zoomRatio)||.1,n=1;t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*i,!0,t)}}},bt={show:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.element,i=this.options;if(i.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(t),this;if(V(i.show)&&at(e,"show",i.show,{once:!0}),!1===rt(e,"show")||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var n=this.viewer;if(J(n,y),n.setAttribute("role","dialog"),n.setAttribute("aria-labelledby",this.title.id),n.setAttribute("aria-modal",!0),n.removeAttribute("aria-hidden"),i.transition&&!t){var o=this.shown.bind(this);this.transitioning={abort:function(){st(n,"transitionend",o),J(n,T)}},G(n,A),n.initialOffsetWidth=n.offsetWidth,at(n,"transitionend",o,{once:!0}),G(n,T)}else G(n,T),this.shown();return this},hide:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.element,n=this.options;if(n.inline||this.hiding||!this.isShown&&!this.showing)return this;if(V(n.hide)&&at(i,"hide",n.hide,{once:!0}),!1===rt(i,"hide"))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var o=this.viewer,s=this.image,a=function(){J(o,T),t.hidden()};if(n.transition&&!e){var r=function e(i){i&&i.target===o&&(st(o,"transitionend",e),t.hidden())},l=function(){Z(o,A)?(at(o,"transitionend",r),J(o,T)):a()};this.transitioning={abort:function(){t.viewed&&Z(s,A)?st(s,"transitionend",l):Z(o,A)&&st(o,"transitionend",r)}},this.viewed&&Z(s,A)?(at(s,"transitionend",l,{once:!0}),this.zoomTo(0,!1,null,!0)):l()}else a();return this},view:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.initialViewIndex;if(e=Number(e)||0,this.hiding||this.played||e<0||e>=this.length||this.viewed&&e===this.index)return this;if(!this.isShown)return this.index=e,this.show();this.viewing&&this.viewing.abort();var i=this.element,n=this.options,o=this.title,s=this.canvas,a=this.items[e],r=a.querySelector("img"),l=it(r,"originalUrl"),h=r.getAttribute("alt"),c=document.createElement("img");if(H(n.inheritedAttributes,(function(t){var e=r.getAttribute(t);null!==e&&c.setAttribute(t,e)})),c.src=l,c.alt=h,V(n.view)&&at(i,"view",n.view,{once:!0}),!1===rt(i,"view",{originalImage:this.images[e],index:e,image:c})||!this.isShown||this.hiding||this.played)return this;var u=this.items[this.index];u&&(J(u,f),u.removeAttribute("aria-selected")),G(a,f),a.setAttribute("aria-selected",!0),n.focus&&a.focus(),this.image=c,this.viewed=!1,this.index=e,this.imageData={},G(c,E),n.loading&&G(s,D),s.innerHTML="",s.appendChild(c),this.renderList(),o.innerHTML="";var d,m,v=function(){var e=t.imageData,i=Array.isArray(n.title)?n.title[1]:n.title;o.innerHTML=K(V(i)?i.call(t,c,e):"".concat(h," (").concat(e.naturalWidth," × ").concat(e.naturalHeight,")"))};return at(i,"viewed",v,{once:!0}),this.viewing={abort:function(){st(i,"viewed",v),c.complete?t.imageRendering?t.imageRendering.abort():t.imageInitializing&&t.imageInitializing.abort():(c.src="",st(c,"load",d),t.timeout&&clearTimeout(t.timeout))}},c.complete?this.load():(at(c,"load",d=function(){st(c,"error",m),t.load()},{once:!0}),at(c,"error",m=function(){st(c,"load",d),t.timeout&&(clearTimeout(t.timeout),t.timeout=!1),J(c,E),n.loading&&J(t.canvas,D)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){J(c,E),t.timeout=!1}),1e3)),this},prev:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.index-1;return e<0&&(e=t?this.length-1:0),this.view(e),this},next:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.length-1,i=this.index+1;return i>e&&(i=t?0:e),this.view(i),this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData;return this.moveTo(P(t)?t:i.x+Number(t),P(e)?e:i.y+Number(e)),this},moveTo:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=this.element,s=this.options,a=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&s.movable){var r=a.x,l=a.y,h=!1;if(Y(t)?h=!0:t=r,Y(i)?h=!0:i=l,h){if(V(s.move)&&at(o,"move",s.move,{once:!0}),!1===rt(o,"move",{x:t,y:i,oldX:r,oldY:l,originalEvent:n}))return this;a.x=t,a.y=i,a.left=t,a.top=i,this.moving=!0,this.renderImage((function(){e.moving=!1,V(s.moved)&&at(o,"moved",s.moved,{once:!0}),rt(o,"moved",{x:t,y:i,oldX:r,oldY:l,originalEvent:n},{cancelable:!1})}))}}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t)),this},rotateTo:function(t){var e=this,i=this.element,n=this.options,o=this.imageData;if(Y(t=Number(t))&&this.viewed&&!this.played&&n.rotatable){var s=o.rotate;if(V(n.rotate)&&at(i,"rotate",n.rotate,{once:!0}),!1===rt(i,"rotate",{degree:t,oldDegree:s}))return this;o.rotate=t,this.rotating=!0,this.renderImage((function(){e.rotating=!1,V(n.rotated)&&at(i,"rotated",n.rotated,{once:!0}),rt(i,"rotated",{degree:t,oldDegree:s},{cancelable:!1})}))}return this},scaleX:function(t){return this.scale(t,this.imageData.scaleY),this},scaleY:function(t){return this.scale(this.imageData.scaleX,t),this},scale:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=this.element,o=this.options,s=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&o.scalable){var a=s.scaleX,r=s.scaleY,l=!1;if(Y(t)?l=!0:t=a,Y(i)?l=!0:i=r,l){if(V(o.scale)&&at(n,"scale",o.scale,{once:!0}),!1===rt(n,"scale",{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:r}))return this;s.scaleX=t,s.scaleY=i,this.scaling=!0,this.renderImage((function(){e.scaling=!1,V(o.scaled)&&at(n,"scaled",o.scaled,{once:!0}),rt(n,"scaled",{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:r},{cancelable:!1})}))}}return this},zoom:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=this.imageData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(n.width*t/n.naturalWidth,e,i),this},zoomTo:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=this.element,a=this.options,r=this.pointers,l=this.imageData,h=l.x,c=l.y,u=l.width,d=l.height,m=l.naturalWidth,f=l.naturalHeight;if(Y(t=Math.max(0,t))&&this.viewed&&!this.played&&(o||a.zoomable)){if(!o){var v=Math.max(.01,a.minZoomRatio),g=Math.min(100,a.maxZoomRatio);t=Math.min(Math.max(t,v),g)}n&&a.zoomRatio>=.055&&t>.95&&t<1.05&&(t=1);var p=m*t,w=f*t,b=p-u,y=w-d,x=l.ratio;if(V(a.zoom)&&at(s,"zoom",a.zoom,{once:!0}),!1===rt(s,"zoom",{ratio:t,oldRatio:x,originalEvent:n}))return this;if(this.zooming=!0,n){var k=lt(this.viewer),z=r&&Object.keys(r).length?ft(r):{pageX:n.pageX,pageY:n.pageY};l.x-=b*((z.pageX-k.left-h)/u),l.y-=y*((z.pageY-k.top-c)/d)}else l.x-=b/2,l.y-=y/2;l.left=l.x,l.top=l.y,l.width=p,l.height=w,l.oldRatio=x,l.ratio=t,this.renderImage((function(){e.zooming=!1,V(a.zoomed)&&at(s,"zoomed",a.zoomed,{once:!0}),rt(s,"zoomed",{ratio:t,oldRatio:x,originalEvent:n},{cancelable:!1})})),i&&this.tooltip()}return this},play:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isShown||this.played)return this;var i=this.element,n=this.options;if(V(n.play)&&at(i,"play",n.play,{once:!0}),!1===rt(i,"play"))return this;var o=this.player,s=this.loadImage.bind(this),a=[],r=0,l=0;if(this.played=!0,this.onLoadWhenPlay=s,e&&this.requestFullscreen(e),G(o,I),H(this.items,(function(t,e){var i=t.querySelector("img"),h=document.createElement("img");h.src=it(i,"originalUrl"),h.alt=i.getAttribute("alt"),h.referrerPolicy=i.referrerPolicy,r+=1,G(h,g),Q(h,A,n.transition),Z(t,f)&&(G(h,T),l=e),a.push(h),at(h,"load",s,{once:!0}),o.appendChild(h)})),Y(n.interval)&&n.interval>0){var h=function e(){t.playing=setTimeout((function(){J(a[l],T),G(a[l=(l+=1)1&&h()}return this},stop:function(){var t=this;if(!this.played)return this;var e=this.element,i=this.options;if(V(i.stop)&&at(e,"stop",i.stop,{once:!0}),!1===rt(e,"stop"))return this;var n=this.player;return this.played=!1,clearTimeout(this.playing),H(n.getElementsByTagName("img"),(function(e){st(e,"load",t.onLoadWhenPlay)})),J(n,I),n.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(),G(this.button,b),e.transition&&(J(o,A),this.viewed&&J(n,A)),G(i,p),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),U(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=$({},this.containerData),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage((function(){e.transition&&setTimeout((function(){G(n,A),G(o,A)}),0)}))}))),this},exit:function(){var t=this,e=this.options,i=this.viewer,n=this.image,o=this.list;return this.isShown&&!this.played&&this.fulled&&e.inline?(this.fulled=!1,this.close(),J(this.button,b),e.transition&&(J(o,A),this.viewed&&J(n,A)),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),J(i,p),U(i,{zIndex:e.zIndexInline}),this.viewerData=$({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage((function(){e.transition&&setTimeout((function(){G(n,A),G(o,A)}),0)}))})),this):this},tooltip:function(){var t=this,e=this.options,i=this.tooltipBox,n=this.imageData;return this.viewed&&!this.played&&e.tooltip?(i.textContent="".concat(Math.round(100*n.ratio),"%"),this.tooltipping?clearTimeout(this.tooltipping):e.transition?(this.fading&&rt(i,"transitionend"),G(i,I),G(i,g),G(i,A),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,G(i,T)):(G(i,I),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout((function(){e.transition?(at(i,"transitionend",(function(){J(i,I),J(i,g),J(i,A),i.setAttribute("aria-hidden",!0),t.fading=!1}),{once:!0}),J(i,T),t.fading=!0):(J(i,I),i.setAttribute("aria-hidden",!0)),t.tooltipping=!1}),1e3),this):this},toggle:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return 1===this.imageData.ratio?this.zoomTo(this.imageData.oldRatio,!0,t):this.zoomTo(1,!0,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=$({},this.initialImageData),this.renderImage()),this},update:function(){var t=this,e=this.element,i=this.options,n=this.isImg;if(n&&!e.parentNode)return this.destroy();var o=[];if(H(n?[e]:e.querySelectorAll("img"),(function(e){V(i.filter)?i.filter.call(t,e)&&o.push(e):t.getImageURL(e)&&o.push(e)})),!o.length)return this;if(this.images=o,this.length=o.length,this.ready){var s=[];if(H(this.items,(function(t,e){var i=t.querySelector("img"),n=o[e];n&&i&&n.src===i.src&&n.alt===i.alt||s.push(e)})),U(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var a=s.indexOf(this.index);if(a>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-a,this.length-1),0));else{var r=this.items[this.index];G(r,f),r.setAttribute("aria-selected",!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var t=this.element,e=this.options;return t.viewer?(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||st(t,"click",this.onStart),t.viewer=void 0,this):this}},yt={getImageURL:function(t){var e=this.options.url;return e=X(e)?t.getAttribute(e):V(e)?e.call(this,t):""},enforceFocus:function(){var t=this;this.clearEnforceFocus(),at(document,"focusin",this.onFocusin=function(e){var i=t.viewer,n=e.target;n===document||n===i||i.contains(n)||null!==n.getAttribute("tabindex")&&"true"===n.getAttribute("aria-modal")||i.focus()})},clearEnforceFocus:function(){this.onFocusin&&(st(document,"focusin",this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;G(t,O),t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px")},close:function(){var t=this.body;J(t,O),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()),V(e.shown)&&at(t,"shown",e.shown,{once:!0}),!1!==rt(t,"shown")&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var t=this.element,e=this.options,i=this.viewer;e.fucus&&this.clearEnforceFocus(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.close(),this.unbind(),G(i,y),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),i.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.hiding=!1,this.destroyed||(V(e.hidden)&&at(t,"hidden",e.hidden,{once:!0}),rt(t,"hidden",null,{cancelable:!1}))},requestFullscreen:function(t){var e=this.element.ownerDocument;if(this.fulled&&!(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)){var i=e.documentElement;i.requestFullscreen?W(t)?i.requestFullscreen(t):i.requestFullscreen():i.webkitRequestFullscreen?i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):i.mozRequestFullScreen?i.mozRequestFullScreen():i.msRequestFullscreen&&i.msRequestFullscreen()}},exitFullscreen:function(){var t=this.element.ownerDocument;this.fulled&&(t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement)&&(t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen?t.webkitExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.msExitFullscreen&&t.msExitFullscreen())},change:function(t){var e=this.options,i=this.pointers,n=i[Object.keys(i)[0]];if(n){var s=n.endX-n.startX,a=n.endY-n.startY;switch(this.action){case"move":this.move(s,a,t);break;case"zoom":this.zoom(function(t){var e=o({},t),i=[];return H(t,(function(t,n){delete e[n],H(e,(function(e){var n=Math.abs(t.startX-e.startX),o=Math.abs(t.startY-e.startY),s=Math.abs(t.endX-e.endX),a=Math.abs(t.endY-e.endY),r=Math.sqrt(n*n+o*o),l=(Math.sqrt(s*s+a*a)-r)/r;i.push(l)}))})),i.sort((function(t,e){return Math.abs(t)1&&r>Math.abs(a)&&(this.pointers={},s>1?this.prev(e.loop):s<-1&&this.next(e.loop))}H(i,(function(t){t.startX=t.endX,t.startY=t.endY}))}},isSwitchable:function(){var t=this.imageData,e=this.viewerData;return this.length>1&&t.x>=0&&t.y>=0&&t.width<=e.width&&t.height<=e.height}},xt=u.Viewer,kt=(vt=-1,function(){return vt+=1}),zt=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(a(this,t),!e||1!==e.nodeType)throw new Error("The first argument is required and must be an element.");this.element=e,this.options=$({},h,W(i)&&i),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.id=kt(),this.init()}var e,i,n;return e=t,n=[{key:"noConflict",value:function(){return window.Viewer=xt,t}},{key:"setDefaults",value:function(t){$(h,W(t)&&t)}}],(i=[{key:"init",value:function(){var t=this,e=this.element,i=this.options;if(!e.viewer){e.viewer=this,i.focus&&!i.keyboard&&(i.focus=!1);var n="img"===e.localName,o=[];if(H(n?[e]:e.querySelectorAll("img"),(function(e){V(i.filter)?i.filter.call(t,e)&&o.push(e):t.getImageURL(e)&&o.push(e)})),this.isImg=n,this.length=o.length,this.images=o,this.initBody(),P(document.createElement("viewer").style.transition)&&(i.transition=!1),i.inline){var s=0,a=function(){var e;(s+=1)===t.length&&(t.initializing=!1,t.delaying={abort:function(){clearTimeout(e)}},e=setTimeout((function(){t.delaying=!1,t.build()}),0))};this.initializing={abort:function(){H(o,(function(t){t.complete||st(t,"load",a)}))}},H(o,(function(t){t.complete?a():at(t,"load",a,{once:!0})}))}else at(e,"click",this.onStart=function(e){var n=e.target;"img"!==n.localName||V(i.filter)&&!i.filter.call(t,n)||t.view(t.images.indexOf(n))})}}},{key:"build",value:function(){if(!this.ready){var t=this.element,e=this.options,i=t.parentNode,n=document.createElement("div");n.innerHTML='
';var o=n.querySelector(".".concat("viewer","-container")),s=o.querySelector(".".concat("viewer","-title")),a=o.querySelector(".".concat("viewer","-toolbar")),r=o.querySelector(".".concat("viewer","-navbar")),l=o.querySelector(".".concat("viewer","-button")),h=o.querySelector(".".concat("viewer","-canvas"));if(this.parent=i,this.viewer=o,this.title=s,this.toolbar=a,this.navbar=r,this.button=l,this.canvas=h,this.footer=o.querySelector(".".concat("viewer","-footer")),this.tooltipBox=o.querySelector(".".concat("viewer","-tooltip")),this.player=o.querySelector(".".concat("viewer","-player")),this.list=o.querySelector(".".concat("viewer","-list")),o.id="".concat("viewer").concat(this.id),s.id="".concat("viewer","Title").concat(this.id),G(s,e.title?dt(Array.isArray(e.title)?e.title[0]:e.title):y),G(r,e.navbar?dt(e.navbar):y),Q(l,y,!e.button),e.keyboard&&l.setAttribute("tabindex",0),e.backdrop&&(G(o,"".concat("viewer","-backdrop")),e.inline||"static"===e.backdrop||nt(h,F,"hide")),X(e.className)&&e.className&&e.className.split(N).forEach((function(t){G(o,t)})),e.toolbar){var c=document.createElement("ul"),u=W(e.toolbar),d=M.slice(0,3),m=M.slice(7,9),f=M.slice(9);u||G(a,dt(e.toolbar)),H(u?e.toolbar:M,(function(t,i){var n=u&&W(t),o=u?et(i):t,s=n&&!P(t.show)?t.show:t;if(s&&(e.zoomable||-1===d.indexOf(o))&&(e.rotatable||-1===m.indexOf(o))&&(e.scalable||-1===f.indexOf(o))){var a=n&&!P(t.size)?t.size:t,r=n&&!P(t.click)?t.click:t,l=document.createElement("li");e.keyboard&&l.setAttribute("tabindex",0),l.setAttribute("role","button"),G(l,"".concat("viewer","-").concat(o)),V(r)||nt(l,F,o),Y(s)&&G(l,dt(s)),-1!==["small","large"].indexOf(a)?G(l,"".concat("viewer","-").concat(a)):"play"===o&&G(l,"".concat("viewer","-large")),V(r)&&at(l,"click",r),c.appendChild(l)}})),a.appendChild(c)}else G(a,y);if(!e.rotatable){var b=a.querySelectorAll('li[class*="rotate"]');G(b,E),H(b,(function(t){a.appendChild(t)}))}if(e.inline)G(l,w),U(o,{zIndex:e.zIndexInline}),"static"===window.getComputedStyle(i).position&&U(i,{position:"relative"}),i.insertBefore(o,t.nextSibling);else{G(l,v),G(o,p),G(o,g),G(o,y),U(o,{zIndex:e.zIndex});var x=e.container;X(x)&&(x=t.ownerDocument.querySelector(x)),x||(x=this.body),x.appendChild(o)}e.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,V(e.ready)&&at(t,"ready",e.ready,{once:!0}),!1!==rt(t,"ready")?this.ready&&e.inline&&this.view(this.index):this.ready=!1}}}])&&r(e.prototype,i),n&&r(e,n),t}();$(zt.prototype,gt,pt,wt,bt,yt),t.exports=zt}})})); //# sourceMappingURL=ImageViewer.js.map