﻿(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a3d30854"],{"0808":function(t,e,i){},6944:function(t,e,i){(function(e,n){t.exports=n(i("c82c"),i("2b0e"))})(0,(function(t,e){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.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get: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=6)}([function(e,i){e.exports=t},function(t,e,i){"use strict";function n(){var t={},e=!1,i=0,o=arguments.length;function r(i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e&&"[object Object]"===Object.prototype.toString.call(i[o])?t[o]=n(!0,t[o],i[o]):t[o]=i[o])}for("[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],i++);i<o;i++){var a=arguments[i];r(a)}return t}e["a"]=n},function(t,i){t.exports=e},function(t,e,i){"use strict";var n=i(0),o=i.n(n),r=i(1),a=i(2),s=i.n(a),l=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.images,n=void 0===e?[]:e,a=t.options,l=void 0===a?{}:a;l=i.i(r["a"])(l,{inline:!1});var c=s.a.extend({render:function(t){return t("div",{style:{display:"none"},class:["__viewer-token"]},n.map((function(e){return t("img",{attrs:"string"===typeof e?{src:e}:e})})))}}),h=new c;h.$mount(),document.body.appendChild(h.$el);var u=new o.a(h.$el,l),d=u.destroy.bind(u);return u.destroy=function(){return d(),h.$destroy(),document.body.removeChild(h.$el),u},u.show(),h.$el.addEventListener("hidden",(function(){this.viewer===u&&u.destroy()})),u};e["a"]=l},function(t,e,i){"use strict";(function(t){var n=i(0),o=i.n(n),r=i(7),a=(i.n(r),i(2)),s=i.n(a),l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.name,a=void 0===n?"viewer":n,l=e.debug,c=void 0!==l&&l;function h(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];s.a.nextTick((function(){n&&!u(t)||(i||!t["$"+a]?(m(t),t["$"+a]=new o.a(t,e),g("Viewer created")):(t["$"+a].update(),g("Viewer updated")))}))}function u(t){var e=t.innerHTML.match(/<img([\w\W]+?)[\\/]?>/g),i=e?e.join(""):void 0;return t.__viewerImageDiffCache===i?(g("Element change detected, but image(s) has not changed"),!1):(g("Image change detected"),t.__viewerImageDiffCache=i,!0)}function d(e,i,n,o){v(e);var r=t.MutationObserver||t.WebKitMutationObserver||t.MozMutationObserver;if(r){var a=new r((function(t){t.forEach((function(t){g("Viewer mutation:"+t.type),n(e,i,o,!0)}))})),s={attributes:!0,childList:!0,characterData:!0,subtree:!0};a.observe(e,s),e.__viewerMutationObserver=a,g("Observer created")}else g("Observer not supported")}function f(t,e,i,n){var o=e.expression,r=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;o&&r.test(o)?(t.__viewerUnwatch=i.context.$watch(o,(function(e,i){g("Change detected by watcher: ",o),n(t,e,!0)}),{deep:!0}),g("Watcher created, expression: ",o)):g("Only simple dot-delimited paths can create watcher")}function m(t){t["$"+a]&&(t["$"+a].destroy(),delete t["$"+a],g("Viewer destroyed"))}function v(t){t.__viewerMutationObserver&&(t.__viewerMutationObserver.disconnect(),delete t.__viewerMutationObserver,g("Observer destroyed"))}function p(t){t.__viewerUnwatch&&(t.__viewerUnwatch(),delete t.__viewerUnwatch,g("Watcher destroyed"))}function g(){var t;c&&(t=console).log.apply(t,arguments)}var b={bind:function(t,e,n){g("Viewer bind");var o=i.i(r["debounce"])(50,h);o(t,e.value),f(t,e,n,o),e.modifiers.static||d(t,e.value,o,e.modifiers.rebuild)},unbind:function(t,e){g("Viewer unbind"),v(t),p(t),m(t)}};return b};e["a"]=l}).call(e,i(9))},function(t,e,i){var n=i(10)(i(8),i(11),null,null);n.options.__file="/Volumes/public/Workspace/web/v-viewer/src/component.vue",n.esModule&&Object.keys(n.esModule).some((function(t){return"default"!==t&&"__esModule"!==t}))&&console.error("named exports are not supported in *.vue files."),n.options.functional&&console.error("[vue-loader] component.vue: functional components are not supported with templates, they should use render functions."),t.exports=n.exports},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(1),o=i(0),r=i.n(o),a=i(5),s=i.n(a),l=i(4),c=i(3);i.d(e,"component",(function(){return s.a})),i.d(e,"directive",(function(){return l["a"]})),i.d(e,"api",(function(){return c["a"]})),i.d(e,"Viewer",(function(){return r.a})),e["default"]={install:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=e.name,a=void 0===o?"viewer":o,h=e.debug,u=void 0!==h&&h,d=e.defaultOptions;r.a.setDefaults(d),t.component(a,i.i(n["a"])(s.a,{name:a})),t.directive(a,i.i(l["a"])({name:a,debug:u})),t.prototype["$"+a+"Api"]=c["a"]},setDefaults:function(t){r.a.setDefaults(t)}}},function(t,e,i){var n,o,r,a="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};(function(i,s){"object"===a(e)&&"undefined"!==typeof t?s(e):(o=[e],n=s,r="function"===typeof n?n.apply(e,o):n,void 0===r||(t.exports=r))})(0,(function(t){"use strict";function e(t,e,i,n){var o,r=!1,a=0;function s(){o&&clearTimeout(o)}function l(){s(),r=!0}function c(){for(var l=arguments.length,c=new Array(l),h=0;h<l;h++)c[h]=arguments[h];var u=this,d=Date.now()-a;function f(){a=Date.now(),i.apply(u,c)}function m(){o=void 0}r||(n&&!o&&f(),s(),void 0===n&&d>t?f():!0!==e&&(o=setTimeout(n?m:f,void 0===n?t-d:t)))}return"boolean"!==typeof e&&(n=i,i=e,e=void 0),c.cancel=l,c}function i(t,i,n){return void 0===n?e(t,i,!1):e(t,n,!1!==i)}t.debounce=i,t.throttle=e,Object.defineProperty(t,"__esModule",{value:!0})}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=i(0),o=i.n(n);e["default"]={props:{images:{type:Array},rebuild:{type:Boolean,default:!1},trigger:{},options:{type:Object}},data:function(){return{}},computed:{},methods:{onChange:function(){this.rebuild?this.rebuildViewer():this.updateViewer()},rebuildViewer:function(){this.destroyViewer(),this.createViewer()},updateViewer:function(){this.$viewer?(this.$viewer.update(),this.$emit("inited",this.$viewer)):this.createViewer()},destroyViewer:function(){this.$viewer&&this.$viewer.destroy()},createViewer:function(){this.$viewer=new o.a(this.$el,this.options),this.$emit("inited",this.$viewer)}},watch:{images:function(){var t=this;this.$nextTick((function(){t.onChange()}))},trigger:{handler:function(){var t=this;this.$nextTick((function(){t.onChange()}))},deep:!0},options:{handler:function(){var t=this;this.$nextTick((function(){t.rebuildViewer()}))},deep:!0}},mounted:function(){this.createViewer()},destroyed:function(){this.destroyViewer()}}},function(t,e){var i,n="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};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(o){"object"===("undefined"===typeof window?"undefined":n(window))&&(i=window)}t.exports=i},function(t,e){t.exports=function(t,e,i,n){var o,r=t=t||{},a=typeof t.default;"object"!==a&&"function"!==a||(o=t,r=t.default);var s="function"===typeof r?r.options:r;if(e&&(s.render=e.render,s.staticRenderFns=e.staticRenderFns),i&&(s._scopeId=i),n){var l=Object.create(s.computed||null);Object.keys(n).forEach((function(t){var e=n[t];l[t]=function(){return e}})),s.computed=l}return{esModule:o,exports:r,options:s}}},function(t,e,i){t.exports={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[t._t("default",null,{images:t.images,options:t.options})],2)},staticRenderFns:[]},t.exports.render._withStripped=!0}])}))},c82c:function(t,e,i){
/*!
 * Viewer.js v1.11.1
 * https://fengyuanchen.github.io/viewerjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2022-11-06T05:18:19.939Z
 */
(function(e,i){t.exports=i()})(0,(function(){"use strict";function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function e(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?t(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var s={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},l='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>',c="undefined"!==typeof window&&"undefined"!==typeof window.document,h=c?window:{},u=!(!c||!h.document.documentElement)&&"ontouchstart"in h.document.documentElement,d=!!c&&"PointerEvent"in h,f="viewer",m="move",v="switch",p="zoom",g="".concat(f,"-active"),b="".concat(f,"-close"),w="".concat(f,"-fade"),y="".concat(f,"-fixed"),x="".concat(f,"-fullscreen"),k="".concat(f,"-fullscreen-exit"),z="".concat(f,"-hide"),O="".concat(f,"-hide-md-down"),T="".concat(f,"-hide-sm-down"),D="".concat(f,"-hide-xs-down"),E="".concat(f,"-in"),S="".concat(f,"-invisible"),A="".concat(f,"-loading"),I="".concat(f,"-move"),C="".concat(f,"-open"),M="".concat(f,"-show"),L="".concat(f,"-transition"),R="click",F="dblclick",j="dragstart",_="focusin",N="keydown",P="load",Y="error",X=u?"touchend touchcancel":"mouseup",$=u?"touchmove":"mousemove",W=u?"touchstart":"mousedown",q=d?"pointerdown":W,V=d?"pointermove":$,H=d?"pointerup pointercancel":X,B="resize",U="transitionend",Z="wheel",K="ready",J="show",G="shown",Q="hide",tt="hidden",et="view",it="viewed",nt="move",ot="moved",rt="rotate",at="rotated",st="scale",lt="scaled",ct="zoom",ht="zoomed",ut="play",dt="stop",ft="".concat(f,"Action"),mt=/\s\s*/,vt=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function pt(t){return"string"===typeof t}var gt=Number.isNaN||h.isNaN;function bt(t){return"number"===typeof t&&!gt(t)}function wt(t){return"undefined"===typeof t}function yt(t){return"object"===i(t)&&null!==t}var xt=Object.prototype.hasOwnProperty;function kt(t){if(!yt(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&xt.call(i,"isPrototypeOf")}catch(n){return!1}}function zt(t){return"function"===typeof t}function Ot(t,e){if(t&&zt(e))if(Array.isArray(t)||bt(t.length)){var i,n=t.length;for(i=0;i<n;i+=1)if(!1===e.call(t,t[i],i,t))break}else yt(t)&&Object.keys(t).forEach((function(i){e.call(t,t[i],i,t)}));return t}var Tt=Object.assign||function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return yt(t)&&i.length>0&&i.forEach((function(e){yt(e)&&Object.keys(e).forEach((function(i){t[i]=e[i]}))})),t},Dt=/^(?:width|height|left|top|marginLeft|marginTop)$/;function Et(t,e){var i=t.style;Ot(e,(function(t,e){Dt.test(e)&&bt(t)&&(t+="px"),i[e]=t}))}function St(t){return pt(t)?t.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):t}function At(t,e){return!(!t||!e)&&(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)}function It(t,e){if(t&&e)if(bt(t.length))Ot(t,(function(t){It(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 Ct(t,e){t&&e&&(bt(t.length)?Ot(t,(function(t){Ct(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function Mt(t,e,i){e&&(bt(t.length)?Ot(t,(function(t){Mt(t,e,i)})):i?It(t,e):Ct(t,e))}var Lt=/([a-z\d])([A-Z])/g;function Rt(t){return t.replace(Lt,"$1-$2").toLowerCase()}function Ft(t,e){return yt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Rt(e)))}function jt(t,e,i){yt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(Rt(e)),i)}var _t=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}});h.addEventListener("test",i,n),h.removeEventListener("test",i,n)}return t}();function Nt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;e.trim().split(mt).forEach((function(e){if(!_t){var r=t.listeners;r&&r[e]&&r[e][i]&&(o=r[e][i],delete r[e][i],0===Object.keys(r[e]).length&&delete r[e],0===Object.keys(r).length&&delete t.listeners)}t.removeEventListener(e,o,n)}))}function Pt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;e.trim().split(mt).forEach((function(e){if(n.once&&!_t){var r=t.listeners,a=void 0===r?{}:r;o=function(){delete a[e][i],t.removeEventListener(e,o,n);for(var r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];i.apply(t,s)},a[e]||(a[e]={}),a[e][i]&&t.removeEventListener(e,a[e][i],n),a[e][i]=o,t.listeners=a}t.addEventListener(e,o,n)}))}function Yt(t,i,n,o){var r;return zt(Event)&&zt(CustomEvent)?r=new CustomEvent(i,e({bubbles:!0,cancelable:!0,detail:n},o)):(r=document.createEvent("CustomEvent"),r.initCustomEvent(i,!0,!0,n)),t.dispatchEvent(r)}function Xt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}function $t(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,o=t.translateX,r=t.translateY,a=[];bt(o)&&0!==o&&a.push("translateX(".concat(o,"px)")),bt(r)&&0!==r&&a.push("translateY(".concat(r,"px)")),bt(e)&&0!==e&&a.push("rotate(".concat(e,"deg)")),bt(i)&&1!==i&&a.push("scaleX(".concat(i,")")),bt(n)&&1!==n&&a.push("scaleY(".concat(n,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Wt(t){return pt(t)?decodeURIComponent(t.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}var qt=h.navigator&&/(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(h.navigator.userAgent);function Vt(t,e,i){var n=document.createElement("img");if(t.naturalWidth&&!qt)return i(t.naturalWidth,t.naturalHeight),n;var o=document.body||document.documentElement;return n.onload=function(){i(n.width,n.height),qt||o.removeChild(n)},Ot(e.inheritedAttributes,(function(e){var i=t.getAttribute(e);null!==i&&n.setAttribute(e,i)})),n.src=t.src,qt||(n.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(n)),n}function Ht(t){switch(t){case 2:return D;case 3:return T;case 4:return O;default:return""}}function Bt(t){var i=e({},t),n=[];return Ot(t,(function(t,e){delete i[e],Ot(i,(function(e){var i=Math.abs(t.startX-e.startX),o=Math.abs(t.startY-e.startY),r=Math.abs(t.endX-e.endX),a=Math.abs(t.endY-e.endY),s=Math.sqrt(i*i+o*o),l=Math.sqrt(r*r+a*a),c=(l-s)/s;n.push(c)}))})),n.sort((function(t,e){return Math.abs(t)<Math.abs(e)})),n[0]}function Ut(t,i){var n=t.pageX,o=t.pageY,r={endX:n,endY:o};return i?r:e({timeStamp:Date.now(),startX:n,startY:o},r)}function Zt(t){var e=0,i=0,n=0;return Ot(t,(function(t){var o=t.startX,r=t.startY;e+=o,i+=r,n+=1})),e/=n,i/=n,{pageX:e,pageY:i}}var Kt={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var t=this.element.ownerDocument,e=t.body||t.documentElement;this.body=e,this.scrollbarWidth=window.innerWidth-t.documentElement.clientWidth,this.initialBodyPaddingRight=e.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(e).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var t,e=this.options,i=this.parent;e.inline&&(t={width:Math.max(i.offsetWidth,e.minWidth),height:Math.max(i.offsetHeight,e.minHeight)},this.parentData=t),!this.fulled&&t||(t=this.containerData),this.viewerData=Tt({},t)},renderViewer:function(){this.options.inline&&!this.fulled&&Et(this.viewer,this.viewerData)},initList:function(){var t=this,e=this.element,i=this.options,n=this.list,o=[];n.innerHTML="",Ot(this.images,(function(e,r){var a=e.src,s=e.alt||Wt(a),l=t.getImageURL(e);if(a||l){var c=document.createElement("li"),h=document.createElement("img");Ot(i.inheritedAttributes,(function(t){var i=e.getAttribute(t);null!==i&&h.setAttribute(t,i)})),i.navbar&&(h.src=a||l),h.alt=s,h.setAttribute("data-original-url",l||a),c.setAttribute("data-index",r),c.setAttribute("data-viewer-action","view"),c.setAttribute("role","button"),i.keyboard&&c.setAttribute("tabindex",0),c.appendChild(h),n.appendChild(c),o.push(c)}})),this.items=o,Ot(o,(function(e){var n,o,r=e.firstElementChild;jt(r,"filled",!0),i.loading&&It(e,A),Pt(r,P,n=function(n){Nt(r,Y,o),i.loading&&Ct(e,A),t.loadImage(n)},{once:!0}),Pt(r,Y,o=function(){Nt(r,P,n),i.loading&&Ct(e,A)},{once:!0})})),i.transition&&Pt(e,it,(function(){It(n,L)}),{once:!0})},renderList:function(){var t=this.index,e=this.items[t];if(e){var i=e.nextElementSibling,n=parseInt(window.getComputedStyle(i||e).marginLeft,10),o=e.offsetWidth,r=o+n;Et(this.list,Tt({width:r*this.length-n},$t({translateX:(this.viewerData.width-o)/2-r*t})))}},resetList:function(){var t=this.list;t.innerHTML="",Ct(t,L),Et(t,$t({translateX:0}))},initImage:function(t){var e,i=this,n=this.options,o=this.image,r=this.viewerData,a=this.footer.offsetHeight,s=r.width,l=Math.max(r.height-a,a),c=this.imageData||{};this.imageInitializing={abort:function(){e.onload=null}},e=Vt(o,n,(function(e,o){var r=e/o,a=Math.max(0,Math.min(1,n.initialCoverage)),h=s,u=l;i.imageInitializing=!1,l*r>s?u=s/r:h=l*r,a=bt(a)?a:.9,h=Math.min(h*a,e),u=Math.min(u*a,o);var d=(s-h)/2,f=(l-u)/2,m={left:d,top:f,x:d,y:f,width:h,height:u,oldRatio:1,ratio:h/e,aspectRatio:r,naturalWidth:e,naturalHeight:o},v=Tt({},m);n.rotatable&&(m.rotate=c.rotate||0,v.rotate=0),n.scalable&&(m.scaleX=c.scaleX||1,m.scaleY=c.scaleY||1,v.scaleX=1,v.scaleY=1),i.imageData=m,i.initialImageData=v,t&&t()}))},renderImage:function(t){var e=this,i=this.image,n=this.imageData;if(Et(i,Tt({width:n.width,height:n.height,marginLeft:n.x,marginTop:n.y},$t(n))),t)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&At(i,L)){var o=function(){e.imageRendering=!1,t()};this.imageRendering={abort:function(){Nt(i,U,o)}},Pt(i,U,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}}},Jt={bind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;Pt(e,R,this.onClick=this.click.bind(this)),Pt(e,j,this.onDragStart=this.dragstart.bind(this)),Pt(i,q,this.onPointerDown=this.pointerdown.bind(this)),Pt(n,V,this.onPointerMove=this.pointermove.bind(this)),Pt(n,H,this.onPointerUp=this.pointerup.bind(this)),Pt(n,N,this.onKeyDown=this.keydown.bind(this)),Pt(window,B,this.onResize=this.resize.bind(this)),t.zoomable&&t.zoomOnWheel&&Pt(e,Z,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleOnDblclick&&Pt(i,F,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var t=this.options,e=this.viewer,i=this.canvas,n=this.element.ownerDocument;Nt(e,R,this.onClick),Nt(e,j,this.onDragStart),Nt(i,q,this.onPointerDown),Nt(n,V,this.onPointerMove),Nt(n,H,this.onPointerUp),Nt(n,N,this.onKeyDown),Nt(window,B,this.onResize),t.zoomable&&t.zoomOnWheel&&Nt(e,Z,this.onWheel,{passive:!1,capture:!0}),t.toggleOnDblclick&&Nt(i,F,this.onDblclick)}},Gt={click:function(t){var e=this.options,i=this.imageData,n=t.target,o=Ft(n,ft);switch(o||"img"!==n.localName||"li"!==n.parentElement.localName||(n=n.parentElement,o=Ft(n,ft)),u&&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(Ft(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&&(u&&t.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(t.isTrusted?t:t.detail&&t.detail.originalEvent))},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,r=this.viewerData;Ct(n,S),i.loading&&Ct(this.canvas,A),n.style.cssText="height:0;"+"margin-left:".concat(r.width/2,"px;")+"margin-top:".concat(r.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage((function(){Mt(n,I,i.movable),Mt(n,L,i.transition),t.renderImage((function(){t.viewed=!0,t.viewing=!1,zt(i.viewed)&&Pt(e,it,i.viewed,{once:!0}),Yt(e,it,{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,r=!!Ft(e,"filled");Vt(e,this.options,(function(t,i){var a=t/i,s=n,l=o;o*a>n?r?s=o*a:l=n/a:r?l=n/a:s=o*a,Et(e,Tt({width:s,height:l},$t({translateX:(n-s)/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);break}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.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());break}}},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)&&(bt(n)&&1!==n||bt(o)&&0!==o||t.ctrlKey))){t.preventDefault(),t.changedTouches?Ot(t.changedTouches,(function(t){i[t.identifier]=Ut(t)})):i[t.pointerId||0]=Ut(t);var r=!!e.movable&&m;e.zoomOnTouch&&e.zoomable&&Object.keys(i).length>1?r=p:e.slideOnTouch&&("touch"===t.pointerType||"touchstart"===t.type)&&this.isSwitchable()&&(r=v),!e.transition||r!==m&&r!==p||Ct(this.image,L),this.action=r}},pointermove:function(t){var e=this.pointers,i=this.action;this.viewed&&i&&(t.preventDefault(),t.changedTouches?Ot(t.changedTouches,(function(t){Tt(e[t.identifier]||{},Ut(t,!0))})):Tt(e[t.pointerId||0]||{},Ut(t,!0)),this.change(t))},pointerup:function(t){var e,i=this,n=this.options,o=this.action,r=this.pointers;t.changedTouches?Ot(t.changedTouches,(function(t){e=r[t.identifier],delete r[t.identifier]})):(e=r[t.pointerId||0],delete r[t.pointerId||0]),o&&(t.preventDefault(),!n.transition||o!==m&&o!==p||It(this.image,L),this.action=!1,u&&o!==p&&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(){Yt(i.image,F,{originalEvent:t})}),50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout((function(){i.imageClicked=!1}),500)):(this.imageClicked=!1,n.backdrop&&"static"!==n.backdrop&&t.target===this.canvas&&(this.clickCanvasTimeout=setTimeout((function(){Yt(i.canvas,R,{originalEvent:t})}),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();Ot(this.player.getElementsByTagName("img"),(function(e){Pt(e,P,t.loadImage.bind(t),{once:!0}),Yt(e,P)}))}},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,null,t)}}},Qt={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(zt(i.show)&&Pt(e,J,i.show,{once:!0}),!1===Yt(e,J)||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var n=this.viewer;if(Ct(n,z),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(){Nt(n,U,o),Ct(n,E)}},It(n,L),n.initialOffsetWidth=n.offsetWidth,Pt(n,U,o,{once:!0}),It(n,E)}else It(n,E),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(zt(n.hide)&&Pt(i,Q,n.hide,{once:!0}),!1===Yt(i,Q))return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var o=this.viewer,r=this.image,a=function(){Ct(o,E),t.hidden()};if(n.transition&&!e){var s=function e(i){i&&i.target===o&&(Nt(o,U,e),t.hidden())},l=function(){At(o,L)?(Pt(o,U,s),Ct(o,E)):a()};this.transitioning={abort:function(){t.viewed&&At(r,L)?Nt(r,U,l):At(o,L)&&Nt(o,U,s)}},this.viewed&&At(r,L)?(Pt(r,U,l,{once:!0}),this.zoomTo(0,!1,null,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,r=this.canvas,a=this.items[e],s=a.querySelector("img"),l=Ft(s,"originalUrl"),c=s.getAttribute("alt"),h=document.createElement("img");if(Ot(n.inheritedAttributes,(function(t){var e=s.getAttribute(t);null!==e&&h.setAttribute(t,e)})),h.src=l,h.alt=c,zt(n.view)&&Pt(i,et,n.view,{once:!0}),!1===Yt(i,et,{originalImage:this.images[e],index:e,image:h})||!this.isShown||this.hiding||this.played)return this;var u=this.items[this.index];u&&(Ct(u,g),u.removeAttribute("aria-selected")),It(a,g),a.setAttribute("aria-selected",!0),n.focus&&a.focus(),this.image=h,this.viewed=!1,this.index=e,this.imageData={},It(h,S),n.loading&&It(r,A),r.innerHTML="",r.appendChild(h),this.renderList(),o.innerHTML="";var d,f,m=function(){var e=t.imageData,i=Array.isArray(n.title)?n.title[1]:n.title;o.innerHTML=St(zt(i)?i.call(t,h,e):"".concat(c," (").concat(e.naturalWidth," 脳 ").concat(e.naturalHeight,")"))};return Pt(i,it,m,{once:!0}),this.viewing={abort:function(){Nt(i,it,m),h.complete?t.imageRendering?t.imageRendering.abort():t.imageInitializing&&t.imageInitializing.abort():(h.src="",Nt(h,P,d),t.timeout&&clearTimeout(t.timeout))}},h.complete?this.load():(Pt(h,P,d=function(){Nt(h,Y,f),t.load()},{once:!0}),Pt(h,Y,f=function(){Nt(h,P,d),t.timeout&&(clearTimeout(t.timeout),t.timeout=!1),Ct(h,S),n.loading&&Ct(t.canvas,A)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout((function(){Ct(h,S),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(wt(t)?t:i.x+Number(t),wt(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,r=this.options,a=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&r.movable){var s=a.x,l=a.y,c=!1;if(bt(t)?c=!0:t=s,bt(i)?c=!0:i=l,c){if(zt(r.move)&&Pt(o,nt,r.move,{once:!0}),!1===Yt(o,nt,{x:t,y:i,oldX:s,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,zt(r.moved)&&Pt(o,ot,r.moved,{once:!0}),Yt(o,ot,{x:t,y:i,oldX:s,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(t=Number(t),bt(t)&&this.viewed&&!this.played&&n.rotatable){var r=o.rotate;if(zt(n.rotate)&&Pt(i,rt,n.rotate,{once:!0}),!1===Yt(i,rt,{degree:t,oldDegree:r}))return this;o.rotate=t,this.rotating=!0,this.renderImage((function(){e.rotating=!1,zt(n.rotated)&&Pt(i,at,n.rotated,{once:!0}),Yt(i,at,{degree:t,oldDegree:r},{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,r=this.imageData;if(t=Number(t),i=Number(i),this.viewed&&!this.played&&o.scalable){var a=r.scaleX,s=r.scaleY,l=!1;if(bt(t)?l=!0:t=a,bt(i)?l=!0:i=s,l){if(zt(o.scale)&&Pt(n,st,o.scale,{once:!0}),!1===Yt(n,st,{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:s}))return this;r.scaleX=t,r.scaleY=i,this.scaling=!0,this.renderImage((function(){e.scaling=!1,zt(o.scaled)&&Pt(n,lt,o.scaled,{once:!0}),Yt(n,lt,{scaleX:t,scaleY:i,oldScaleX:a,oldScaleY:s},{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=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=this.imageData;return t=Number(t),t=t<0?1/(1-t):1+t,this.zoomTo(o.width*t/o.naturalWidth,e,i,n),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]:null,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=this.element,s=this.options,l=this.pointers,c=this.imageData,h=c.x,u=c.y,d=c.width,f=c.height,m=c.naturalWidth,v=c.naturalHeight;if(t=Math.max(0,t),bt(t)&&this.viewed&&!this.played&&(r||s.zoomable)){if(!r){var p=Math.max(.01,s.minZoomRatio),g=Math.min(100,s.maxZoomRatio);t=Math.min(Math.max(t,p),g)}if(o)switch(o.type){case"wheel":s.zoomRatio>=.055&&t>.95&&t<1.05&&(t=1);break;case"pointermove":case"touchmove":case"mousemove":t>.99&&t<1.01&&(t=1);break}var b=m*t,w=v*t,y=b-d,x=w-f,k=c.ratio;if(zt(s.zoom)&&Pt(a,ct,s.zoom,{once:!0}),!1===Yt(a,ct,{ratio:t,oldRatio:k,originalEvent:o}))return this;if(this.zooming=!0,o){var z=Xt(this.viewer),O=l&&Object.keys(l).length>0?Zt(l):{pageX:o.pageX,pageY:o.pageY};c.x-=y*((O.pageX-z.left-h)/d),c.y-=x*((O.pageY-z.top-u)/f)}else kt(n)&&bt(n.x)&&bt(n.y)?(c.x-=y*((n.x-h)/d),c.y-=x*((n.y-u)/f)):(c.x-=y/2,c.y-=x/2);c.left=c.x,c.top=c.y,c.width=b,c.height=w,c.oldRatio=k,c.ratio=t,this.renderImage((function(){e.zooming=!1,zt(s.zoomed)&&Pt(a,ht,s.zoomed,{once:!0}),Yt(a,ht,{ratio:t,oldRatio:k,originalEvent:o},{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(zt(n.play)&&Pt(i,ut,n.play,{once:!0}),!1===Yt(i,ut))return this;var o=this.player,r=this.loadImage.bind(this),a=[],s=0,l=0;if(this.played=!0,this.onLoadWhenPlay=r,e&&this.requestFullscreen(e),It(o,M),Ot(this.items,(function(t,e){var i=t.querySelector("img"),c=document.createElement("img");c.src=Ft(i,"originalUrl"),c.alt=i.getAttribute("alt"),c.referrerPolicy=i.referrerPolicy,s+=1,It(c,w),Mt(c,L,n.transition),At(t,g)&&(It(c,E),l=e),a.push(c),Pt(c,P,r,{once:!0}),o.appendChild(c)})),bt(n.interval)&&n.interval>0){var c=function e(){clearTimeout(t.playing.timeout),Ct(a[l],E),l-=1,l=l>=0?l:s-1,It(a[l],E),t.playing.timeout=setTimeout(e,n.interval)},h=function e(){clearTimeout(t.playing.timeout),Ct(a[l],E),l+=1,l=l<s?l:0,It(a[l],E),t.playing.timeout=setTimeout(e,n.interval)};s>1&&(this.playing={prev:c,next:h,timeout:setTimeout(h,n.interval)})}return this},stop:function(){var t=this;if(!this.played)return this;var e=this.element,i=this.options;if(zt(i.stop)&&Pt(e,dt,i.stop,{once:!0}),!1===Yt(e,dt))return this;var n=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,Ot(n.getElementsByTagName("img"),(function(e){Nt(e,P,t.onLoadWhenPlay)})),Ct(n,M),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(),It(this.button,k),e.transition&&(Ct(o,L),this.viewed&&Ct(n,L)),It(i,y),i.setAttribute("role","dialog"),i.setAttribute("aria-labelledby",this.title.id),i.setAttribute("aria-modal",!0),i.removeAttribute("style"),Et(i,{zIndex:e.zIndex}),e.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=Tt({},this.containerData),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage((function(){e.transition&&setTimeout((function(){It(n,L),It(o,L)}),0)}))}))),this},exit:function(){var t=this,e=this.options,i=this.viewer,n=this.image,o=this.list;return this.isShown&&!this.played&&this.fulled&&e.inline?(this.fulled=!1,this.close(),Ct(this.button,k),e.transition&&(Ct(o,L),this.viewed&&Ct(n,L)),e.focus&&this.clearEnforceFocus(),i.removeAttribute("role"),i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-modal"),Ct(i,y),Et(i,{zIndex:e.zIndexInline}),this.viewerData=Tt({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage((function(){t.renderImage((function(){e.transition&&setTimeout((function(){It(n,L),It(o,L)}),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&&Yt(i,U),It(i,M),It(i,w),It(i,L),i.removeAttribute("aria-hidden"),i.initialOffsetWidth=i.offsetWidth,It(i,E)):(It(i,M),i.removeAttribute("aria-hidden")),this.tooltipping=setTimeout((function(){e.transition?(Pt(i,U,(function(){Ct(i,M),Ct(i,w),Ct(i,L),i.setAttribute("aria-hidden",!0),t.fading=!1}),{once:!0}),Ct(i,E),t.fading=!0):(Ct(i,M),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,null,t):this.zoomTo(1,!0,null,t),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=Tt({},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(Ot(n?[e]:e.querySelectorAll("img"),(function(e){zt(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 r=[];if(Ot(this.items,(function(t,e){var i=t.querySelector("img"),n=o[e];n&&i&&n.src===i.src&&n.alt===i.alt||r.push(e)})),Et(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var a=r.indexOf(this.index);if(a>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-a,this.length-1),0));else{var s=this.items[this.index];It(s,g),s.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[f]?(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||Nt(t,R,this.onStart),t[f]=void 0,this):this}},te={getImageURL:function(t){var e=this.options.url;return e=pt(e)?t.getAttribute(e):zt(e)?e.call(this,t):"",e},enforceFocus:function(){var t=this;this.clearEnforceFocus(),Pt(document,_,this.onFocusin=function(e){var i=t.viewer,n=e.target;if(n!==document&&n!==i&&!i.contains(n)){while(n){if(null!==n.getAttribute("tabindex")||"true"===n.getAttribute("aria-modal"))return;n=n.parentElement}i.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(Nt(document,_,this.onFocusin),this.onFocusin=null)},open:function(){var t=this.body;It(t,C),this.scrollbarWidth>0&&(t.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var t=this.body;Ct(t,C),this.scrollbarWidth>0&&(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()),zt(e.shown)&&Pt(t,G,e.shown,{once:!0}),!1!==Yt(t,G)&&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(),It(i,z),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||(zt(e.hidden)&&Pt(t,tt,e.hidden,{once:!0}),Yt(t,tt,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?kt(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 o=n.endX-n.startX,r=n.endY-n.startY;switch(this.action){case m:this.move(o,r,t);break;case p:this.zoom(Bt(i),!1,null,t);break;case v:this.action="switched";var a=Math.abs(o);a>1&&a>Math.abs(r)&&(this.pointers={},o>1?this.prev(e.loop):o<-1&&this.next(e.loop));break}Ot(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}},ee=h.Viewer,ie=function(t){return function(){return t+=1,t}}(-1),ne=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(n(this,t),!e||1!==e.nodeType)throw new Error("The first argument is required and must be an element.");this.element=e,this.options=Tt({},s,kt(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=ie(),this.init()}return r(t,[{key:"init",value:function(){var t=this,e=this.element,i=this.options;if(!e[f]){e[f]=this,i.focus&&!i.keyboard&&(i.focus=!1);var n="img"===e.localName,o=[];if(Ot(n?[e]:e.querySelectorAll("img"),(function(e){zt(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(),wt(document.createElement(f).style.transition)&&(i.transition=!1),i.inline){var r=0,a=function(){var e;(r+=1,r===t.length)&&(t.initializing=!1,t.delaying={abort:function(){clearTimeout(e)}},e=setTimeout((function(){t.delaying=!1,t.build()}),0))};this.initializing={abort:function(){Ot(o,(function(t){t.complete||(Nt(t,P,a),Nt(t,Y,a))}))}},Ot(o,(function(t){var e,i;t.complete?a():(Pt(t,P,e=function(){Nt(t,Y,i),a()},{once:!0}),Pt(t,Y,i=function(){Nt(t,P,e),a()},{once:!0}))}))}else Pt(e,R,this.onStart=function(e){var n=e.target;"img"!==n.localName||zt(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=l;var o=n.querySelector(".".concat(f,"-container")),r=o.querySelector(".".concat(f,"-title")),a=o.querySelector(".".concat(f,"-toolbar")),s=o.querySelector(".".concat(f,"-navbar")),c=o.querySelector(".".concat(f,"-button")),h=o.querySelector(".".concat(f,"-canvas"));if(this.parent=i,this.viewer=o,this.title=r,this.toolbar=a,this.navbar=s,this.button=c,this.canvas=h,this.footer=o.querySelector(".".concat(f,"-footer")),this.tooltipBox=o.querySelector(".".concat(f,"-tooltip")),this.player=o.querySelector(".".concat(f,"-player")),this.list=o.querySelector(".".concat(f,"-list")),o.id="".concat(f).concat(this.id),r.id="".concat(f,"Title").concat(this.id),It(r,e.title?Ht(Array.isArray(e.title)?e.title[0]:e.title):z),It(s,e.navbar?Ht(e.navbar):z),Mt(c,z,!e.button),e.keyboard&&c.setAttribute("tabindex",0),e.backdrop&&(It(o,"".concat(f,"-backdrop")),e.inline||"static"===e.backdrop||jt(h,ft,"hide")),pt(e.className)&&e.className&&e.className.split(mt).forEach((function(t){It(o,t)})),e.toolbar){var u=document.createElement("ul"),d=kt(e.toolbar),m=vt.slice(0,3),v=vt.slice(7,9),p=vt.slice(9);d||It(a,Ht(e.toolbar)),Ot(d?e.toolbar:vt,(function(t,i){var n=d&&kt(t),o=d?Rt(i):t,r=n&&!wt(t.show)?t.show:t;if(r&&(e.zoomable||-1===m.indexOf(o))&&(e.rotatable||-1===v.indexOf(o))&&(e.scalable||-1===p.indexOf(o))){var a=n&&!wt(t.size)?t.size:t,s=n&&!wt(t.click)?t.click:t,l=document.createElement("li");e.keyboard&&l.setAttribute("tabindex",0),l.setAttribute("role","button"),It(l,"".concat(f,"-").concat(o)),zt(s)||jt(l,ft,o),bt(r)&&It(l,Ht(r)),-1!==["small","large"].indexOf(a)?It(l,"".concat(f,"-").concat(a)):"play"===o&&It(l,"".concat(f,"-large")),zt(s)&&Pt(l,R,s),u.appendChild(l)}})),a.appendChild(u)}else It(a,z);if(!e.rotatable){var g=a.querySelectorAll('li[class*="rotate"]');It(g,S),Ot(g,(function(t){a.appendChild(t)}))}if(e.inline)It(c,x),Et(o,{zIndex:e.zIndexInline}),"static"===window.getComputedStyle(i).position&&Et(i,{position:"relative"}),i.insertBefore(o,t.nextSibling);else{It(c,b),It(o,y),It(o,w),It(o,z),Et(o,{zIndex:e.zIndex});var k=e.container;pt(k)&&(k=t.ownerDocument.querySelector(k)),k||(k=this.body),k.appendChild(o)}e.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,zt(e.ready)&&Pt(t,K,e.ready,{once:!0}),!1!==Yt(t,K)?this.ready&&e.inline&&this.view(this.index):this.ready=!1}}}],[{key:"noConflict",value:function(){return window.Viewer=ee,t}},{key:"setDefaults",value:function(t){Tt(s,kt(t)&&t)}}]),t}();return Tt(ne.prototype,Kt,Jt,Gt,Qt,te),ne}))}}]);