/*! * Viewer.js v1.7.1 * https://fengyuanchen.github.io/viewerjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2020-09-29T13:45:20.981Z */ !function(t,i){"object"==typeof exports&&"undefined"!=typeof module?module.exports=i():"function"==typeof define&&define.amd?define(i):(t="undefined"!=typeof globalThis?globalThis:t||self).Viewer=i()}(this,function(){"use strict";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})(t)}function s(t,i){for(var e=0;e=this.length||this.viewed&&i===this.index)return this;if(!this.isShown)return this.index=i,this.show();this.viewing&&this.viewing.abort();var n=this.element,s=this.options,o=this.title,a=this.canvas,r=this.items[i],h=r.querySelector("img"),t=mt(h,"originalUrl"),l=h.getAttribute("alt"),c=document.createElement("img");if(nt(s.inheritedAttributes,function(t){var i=h.getAttribute(t);null!==i&&c.setAttribute(t,i)}),c.src=t,c.alt=l,et(s.view)&&bt(n,"view",s.view,{once:!0}),!1===yt(n,"view",{originalImage:this.images[i],index:i,image:c})||!this.isShown||this.hiding||this.played)return this;this.image=c,lt(this.items[this.index],m),ht(r,m),this.viewed=!1,this.index=i,this.imageData={},ht(c,D),s.loading&&ht(a,T),a.innerHTML="",a.appendChild(c),this.renderList(),o.innerHTML="";function u(){var t=e.imageData,i=Array.isArray(s.title)?s.title[1]:s.title;o.innerHTML=$(t=et(i)?i.call(e,c,t):"".concat(l," (").concat(t.naturalWidth," × ").concat(t.naturalHeight,")"))?t.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">"):t}var d;return bt(n,V,u,{once:!0}),this.viewing={abort:function(){wt(n,V,u),c.complete?e.imageRendering?e.imageRendering.abort():e.imageInitializing&&e.imageInitializing.abort():(c.src="",wt(c,P,d),e.timeout&&clearTimeout(e.timeout))}},c.complete?this.load():(bt(c,P,d=this.load.bind(this),{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){lt(c,D),e.timeout=!1},1e3)),this},prev:function(t){var i=0Math.abs(r)&&(this.pointers={},1
',n=(e=d.querySelector(".".concat(g,"-container"))).querySelector(".".concat(g,"-title")),s=e.querySelector(".".concat(g,"-toolbar")),a=e.querySelector(".".concat(g,"-navbar")),m=e.querySelector(".".concat(g,"-button")),d=e.querySelector(".".concat(g,"-canvas")),this.parent=i,this.viewer=e,this.title=n,this.toolbar=s,this.navbar=a,this.button=m,this.canvas=d,this.footer=e.querySelector(".".concat(g,"-footer")),this.tooltipBox=e.querySelector(".".concat(g,"-tooltip")),this.player=e.querySelector(".".concat(g,"-player")),this.list=e.querySelector(".".concat(g,"-list")),ht(n,o.title?Dt(Array.isArray(o.title)?o.title[0]:o.title):b),ht(a,o.navbar?Dt(o.navbar):b),ct(m,b,!o.button),o.backdrop&&(ht(e,"".concat(g,"-backdrop")),o.inline||"static"===o.backdrop||gt(d,U,"hide")),$(o.className)&&o.className&&o.className.split(K).forEach(function(t){ht(e,t)}),o.toolbar?(r=document.createElement("ul"),h=it(o.toolbar),l=Z.slice(0,3),c=Z.slice(7,9),u=Z.slice(9),h||ht(s,Dt(o.toolbar)),nt(h?o.toolbar:Z,function(t,i){var e=h&&it(t),n=h?dt(i):t,s=e&&!J(t.show)?t.show:t;!s||!o.zoomable&&-1!==l.indexOf(n)||!o.rotatable&&-1!==c.indexOf(n)||!o.scalable&&-1!==u.indexOf(n)||(i=e&&!J(t.size)?t.size:t,e=e&&!J(t.click)?t.click:t,(t=document.createElement("li")).setAttribute("role","button"),ht(t,"".concat(g,"-").concat(n)),et(e)||gt(t,U,n),G(s)&&ht(t,Dt(s)),-1!==["small","large"].indexOf(i)?ht(t,"".concat(g,"-").concat(i)):"play"===n&&ht(t,"".concat(g,"-large")),et(e)&&bt(t,C,e),r.appendChild(t))}),s.appendChild(r)):ht(s,b),o.rotatable||(ht(d=s.querySelectorAll('li[class*="rotate"]'),D),nt(d,function(t){s.appendChild(t)})),o.inline?(ht(m,w),at(e,{zIndex:o.zIndexInline}),"static"===window.getComputedStyle(i).position&&at(i,{position:"relative"}),i.insertBefore(e,t.nextSibling)):(ht(m,f),ht(e,v),ht(e,p),ht(e,b),at(e,{zIndex:o.zIndex}),$(m=o.container)&&(m=t.ownerDocument.querySelector(m)),(m=m||this.body).appendChild(e)),o.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,et(o.ready)&&bt(t,F,o.ready,{once:!0}),!1!==yt(t,F)?this.ready&&o.inline&&this.view(this.index):this.ready=!1)}}])&&s(t.prototype,i),n&&s(t,n),e}();return st(n.prototype,It,r,t,Et,Ot),n});