vendor: 17,498 bytes, line 1
1(function(global,factory){typeof exports=="object"&&typeof module!="undefined"?module.exports=factory():typeof define=="function"&&define.amd?define(factory):(global=typeof globalThis!="undefined"?globalThis:global||self,global.lgZoom=factory())})(this,function(){"use strict";var __assign=function(){return __assign=Object.assign||function __assign(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)},zoomSettings={scale:1,zoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},lGEvents={afterAppendSlide:"lgAfterAppendSlide",init:"lgInit",hasVideo:"lgHasVideo",containerResize:"lgContainerResize",updateSlides:"lgUpdateSlides",afterAppendSubHtml:"lgAfterAppendSubHtml",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",beforeSlide:"lgBeforeSlide",afterSlide:"lgAfterSlide",posterClick:"lgPosterClick",dragStart:"lgDragStart",dragMove:"lgDragMove",dragEnd:"lgDragEnd",beforeNextSlide:"lgBeforeNextSlide",beforePrevSlide:"lgBeforePrevSlide",beforeClose:"lgBeforeClose",afterClose:"lgAfterClose",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical",autoplay:"lgAutoplay",autoplayStart:"lgAutoplayStart",autoplayStop:"lgAutoplayStop"},Zoom=function(){function Zoom(instance,$LG){return this.core=instance,this.$LG=$LG,this.settings=__assign(__assign({},zoomSettings),this.core.settings),this}return Zoom.prototype.buildTemplates=function(){var zoomIcons=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(zoomIcons+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(zoomIcons)},Zoom.prototype.enableZoom=function(event){var _this=this,_speed=this.settings.enableZoomAfter+event.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&event.detail.delay?_speed=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){if(!_this.isImageSlide())return;_this.core.getSlideItem(event.detail.index).addClass("lg-zoomable"),event.detail.index===_this.core.index&&_this.setZoomEssentials()},_speed+30)},Zoom.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(lGEvents.slideItemLoad+".zoom",this.enableZoom.bind(this))},Zoom.prototype.getModifier=function(rotateValue,axis,el){var originalRotate=rotateValue;rotateValue=Math.abs(rotateValue);var transformValues=this.getCurrentTransform(el);if(!transformValues)return 1;var modifier=1;if(axis==="X"){var flipHorizontalValue=Math.sign(parseFloat(transformValues[0]));rotateValue===0||rotateValue===180?modifier=1:rotateValue===90&&(originalRotate===-90&&flipHorizontalValue===1||originalRotate===90&&flipHorizontalValue===-1?modifier=-1:modifier=1),modifier*=flipHorizontalValue}else{var flipVerticalValue=Math.sign(parseFloat(transformValues[3]));if(rotateValue===0||rotateValue===180)modifier=1;else if(rotateValue===90){var sinX=parseFloat(transformValues[1]),sinMinusX=parseFloat(transformValues[2]);modifier=Math.sign(sinX*sinMinusX*originalRotate*flipVerticalValue)}modifier*=flipVerticalValue}return modifier},Zoom.prototype.getImageSize=function($image,rotateValue,axis){var imageSizes={y:"offsetHeight",x:"offsetWidth"};return Math.abs(rotateValue)===90&&(axis==="x"?axis="y":axis="x"),$image[imageSizes[axis]]},Zoom.prototype.getDragCords=function(e,rotateValue){return rotateValue===90?{x:e.pageY,y:e.pageX}:{x:e.pageX,y:e.pageY}},Zoom.prototype.getSwipeCords=function(e,rotateValue){var x=e.targetTouches[0].pageX,y=e.targetTouches[0].pageY;return rotateValue===90?{x:y,y:x}:{x:x,y:y}},Zoom.prototype.getDragAllowedAxises=function(rotateValue,scale){scale=scale||this.scale||1;var allowY=this.imageYSize*scale>this.containerRect.height,allowX=this.imageXSize*scale>this.containerRect.width;return rotateValue===90?{allowX:allowY,allowY:allowX}:{allowX:allowX,allowY:allowY}},Zoom.prototype.getCurrentTransform=function(el){if(!el)return;var st=window.getComputedStyle(el,null),tm=st.getPropertyValue("-webkit-transform")||st.getPropertyValue("-moz-transform")||st.getPropertyValue("-ms-transform")||st.getPropertyValue("-o-transform")||st.getPropertyValue("transform")||"none";if(tm!=="none")return tm.split("(")[1].split(")")[0].split(",");return},Zoom.prototype.getCurrentRotation=function(el){if(!el)return 0;var values=this.getCurrentTransform(el);return values?Math.round(Math.atan2(parseFloat(values[1]),parseFloat(values[0]))*(180/Math.PI)):0},Zoom.prototype.setZoomEssentials=function(){var $image=this.core.getSlideItem(this.core.index).find(".lg-image").first(),rotateEl=this.core.getSlideItem(this.core.index).find(".lg-img-rotate").first().get();this.rotateValue=this.getCurrentRotation(rotateEl),this.imageYSize=this.getImageSize($image.get(),this.rotateValue,"y"),this.imageXSize=this.getImageSize($image.get(),this.rotateValue,"x"),this.containerRect=this.core.outer.get().getBoundingClientRect(),this.modifierX=this.getModifier(this.rotateValue,"X",rotateEl),this.modifierY=this.getModifier(this.rotateValue,"Y",rotateEl)},Zoom.prototype.zoomImage=function(scale){var offsetX=(this.containerRect.width-this.imageXSize)/2+this.containerRect.left,_a=this.core.mediaContainerPosition,top=_a.top,bottom=_a.bottom,topBottomSpacing=Math.abs(top-bottom)/2,offsetY=(this.containerRect.height-this.imageYSize-topBottomSpacing*this.modifierX)/2+this.scrollTop+this.containerRect.top,originalX,originalY;scale===1&&(this.positionChanged=!1);var dragAllowedAxises=this.getDragAllowedAxises(Math.abs(this.rotateValue),scale),allowY=dragAllowedAxises.allowY,allowX=dragAllowedAxises.allowX;this.positionChanged&&(originalX=this.left/(this.scale-1),originalY=this.top/(this.scale-1),this.pageX=Math.abs(originalX)+offsetX,this.pageY=Math.abs(originalY)+offsetY,this.positionChanged=!1);var possibleSwipeCords=this.getPossibleSwipeDragCords(this.rotateValue,scale),_x=offsetX-this.pageX,_y=offsetY-this.pageY,x=(scale-1)*_x,y=(scale-1)*_y;allowX?this.isBeyondPossibleLeft(x,possibleSwipeCords.minX)?x=possibleSwipeCords.minX:this.isBeyondPossibleRight(x,possibleSwipeCords.maxX)&&(x=possibleSwipeCords.maxX):scale>1&&(x<possibleSwipeCords.minX?x=possibleSwipeCords.minX:x>possibleSwipeCords.maxX&&(x=possibleSwipeCords.maxX)),allowY?this.isBeyondPossibleTop(y,possibleSwipeCords.minY)?y=possibleSwipeCords.minY:this.isBeyondPossibleBottom(y,possibleSwipeCords.maxY)&&(y=possibleSwipeCords.maxY):scale>1&&(y<possibleSwipeCords.minY?y=possibleSwipeCords.minY:y>possibleSwipeCords.maxY&&(y=possibleSwipeCords.maxY)),this.setZoomStyles({x:x,y:y,scale:scale})},Zoom.prototype.setZoomStyles=function(style){var $image=this.core.getSlideItem(this.core.index).find(".lg-image").first(),$dummyImage=this.core.outer.find(".lg-current .lg-dummy-img").first(),$imageWrap=$image.parent();this.scale=style.scale,$image.css("transform","scale3d("+style.scale+", "+style.scale+", 1)"),$dummyImage.css("transform","scale3d("+style.scale+", "+style.scale+", 1)");var transform="translate3d("+style.x+"px, "+style.y+"px, 0)";$imageWrap.css("transform",transform),this.left=style.x,this.top=style.y},Zoom.prototype.setActualSize=function(index,event){var _this=this;if(!this.isImageSlide()||this.core.outer.hasClass("lg-first-slide-loading"))return;var scale=this.getCurrentImageActualSizeScale();this.core.outer.hasClass("lg-zoomed")?this.scale=1:this.scale=this.getScale(scale),this.setPageCords(event),this.beginZoom(this.scale),this.zoomImage(this.scale),setTimeout(function(){_this.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},10)},Zoom.prototype.getNaturalWidth=function(index){var $image=this.core.getSlideItem(index).find(".lg-image").first(),naturalWidth=this.core.galleryItems[index].width;return naturalWidth?parseFloat(naturalWidth):$image.get().naturalWidth},Zoom.prototype.getActualSizeScale=function(naturalWidth,width){var _scale,scale;return naturalWidth>width?(_scale=naturalWidth/width,scale=_scale||2):scale=1,scale},Zoom.prototype.getCurrentImageActualSizeScale=function(){var $image=this.core.getSlideItem(this.core.index).find(".lg-image").first(),width=$image.get().offsetWidth,naturalWidth=this.getNaturalWidth(this.core.index)||width;return this.getActualSizeScale(naturalWidth,width)},Zoom.prototype.getPageCords=function(event){var cords={};if(event)cords.x=event.pageX||event.targetTouches[0].pageX,cords.y=event.pageY||event.targetTouches[0].pageY;else{var containerRect=this.core.outer.get().getBoundingClientRect();cords.x=containerRect.width/2+containerRect.left,cords.y=containerRect.height/2+this.scrollTop+containerRect.top}return cords},Zoom.prototype.setPageCords=function(event){var pageCords=this.getPageCords(event);this.pageX=pageCords.x,this.pageY=pageCords.y},Zoom.prototype.beginZoom=function(scale){this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging");if(scale>1){this.core.outer.addClass("lg-zoomed");var $actualSize=this.core.getElementById("lg-actual-size");$actualSize.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)}else this.resetZoom();return scale>1},Zoom.prototype.getScale=function(scale){var actualSizeScale=this.getCurrentImageActualSizeScale();return scale<1?scale=1:scale>actualSizeScale&&(scale=actualSizeScale),scale},Zoom.prototype.init=function(){var _this=this;if(!this.settings.zoom)return;this.buildTemplates(),this.enableZoomOnSlideItemLoad();var tapped=null;this.core.outer.on("dblclick.lg",function(event){if(!_this.$LG(event.target).hasClass("lg-image"))return;_this.setActualSize(_this.core.index,event)}),this.core.outer.on("touchstart.lg",function(event){var $target=_this.$LG(event.target);event.targetTouches.length===1&&$target.hasClass("lg-image")&&(tapped?(clearTimeout(tapped),tapped=null,event.preventDefault(),_this.setActualSize(_this.core.index,event)):tapped=setTimeout(function(){tapped=null},300))}),this.core.LGel.on(lGEvents.containerResize+".zoom "+lGEvents.rotateRight+".zoom "+lGEvents.rotateLeft+".zoom "+lGEvents.flipHorizontal+".zoom "+lGEvents.flipVertical+".zoom",function(){if(!_this.core.lgOpened||!_this.isImageSlide())return;_this.setPageCords(),_this.setZoomEssentials(),_this.zoomImage(_this.scale)}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){if(!_this.core.lgOpened)return;_this.scrollTop=_this.$LG(window).scrollTop()}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){_this.core.outer.find(".lg-current .lg-image").get()&&(_this.scale-=_this.settings.scale,_this.scale=_this.getScale(_this.scale),_this.beginZoom(_this.scale),_this.zoomImage(_this.scale))}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){_this.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){_this.setActualSize(_this.core.index)}),this.core.LGel.on(lGEvents.beforeOpen+".zoom",function(){_this.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(lGEvents.afterOpen+".zoom",function(){_this.scrollTop=_this.$LG(window).scrollTop(),_this.pageX=_this.core.outer.width()/2,_this.pageY=_this.core.outer.height()/2+_this.scrollTop,_this.scale=1}),this.core.LGel.on(lGEvents.afterSlide+".zoom",function(event){var prevIndex=event.detail.prevIndex;_this.scale=1,_this.positionChanged=!1,_this.resetZoom(prevIndex),_this.isImageSlide()&&_this.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1},Zoom.prototype.zoomIn=function(scale){if(!this.isImageSlide())return;scale?this.scale=scale:this.scale+=this.settings.scale,this.scale=this.getScale(this.scale),this.beginZoom(this.scale),this.zoomImage(this.scale)},Zoom.prototype.resetZoom=function(index){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var $actualSize=this.core.getElementById("lg-actual-size"),$item=this.core.getSlideItem(index!==undefined?index:this.core.index);$actualSize.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),$item.find(".lg-img-wrap").first().removeAttr("style"),$item.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},Zoom.prototype.getTouchDistance=function(e){return Math.sqrt((e.targetTouches[0].pageX-e.targetTouches[1].pageX)*(e.targetTouches[0].pageX-e.targetTouches[1].pageX)+(e.targetTouches[0].pageY-e.targetTouches[1].pageY)*(e.targetTouches[0].pageY-e.targetTouches[1].pageY))},Zoom.prototype.pinchZoom=function(){var _this=this,startDist=0,pinchStarted=!1,initScale=1,$item=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(e){$item=_this.core.getSlideItem(_this.core.index);if(!_this.isImageSlide())return;e.targetTouches.length===2&&!_this.core.outer.hasClass("lg-first-slide-loading")&&(_this.$LG(e.target).hasClass("lg-item")||$item.get().contains(e.target))&&(initScale=_this.scale||1,_this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),_this.core.touchAction="pinch",startDist=_this.getTouchDistance(e))}),this.core.$inner.on("touchmove.lg",function(e){if(e.targetTouches.length===2&&_this.core.touchAction==="pinch"&&(_this.$LG(e.target).hasClass("lg-item")||$item.get().contains(e.target))){e.preventDefault();var endDist=_this.getTouchDistance(e),distance=startDist-endDist;!pinchStarted&&Math.abs(distance)>5&&(pinchStarted=!0),pinchStarted&&(_this.scale=Math.max(1,initScale+ -distance*.008),_this.zoomImage(_this.scale))}}),this.core.$inner.on("touchend.lg",function(e){_this.core.touchAction==="pinch"&&(_this.$LG(e.target).hasClass("lg-item")||$item.get().contains(e.target))&&(pinchStarted=!1,startDist=0,_this.scale<=1?_this.resetZoom():(_this.scale=_this.getScale(_this.scale),_this.zoomImage(_this.scale),_this.core.outer.addClass("lg-zoomed")),_this.core.touchAction=undefined)})},Zoom.prototype.touchendZoom=function(startCoords,endCoords,allowX,allowY,touchDuration,rotateValue){var distanceXnew=endCoords.x-startCoords.x,distanceYnew=endCoords.y-startCoords.y,speedX=Math.abs(distanceXnew)/touchDuration+1,speedY=Math.abs(distanceYnew)/touchDuration+1;speedX>2&&(speedX+=1),speedY>2&&(speedY+=1),distanceXnew*=speedX,distanceYnew*=speedY;var _LGel=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),distance={};distance.x=this.left+distanceXnew*this.modifierX,distance.y=this.top+distanceYnew*this.modifierY;var possibleSwipeCords=this.getPossibleSwipeDragCords(rotateValue);if(Math.abs(distanceXnew)>15||Math.abs(distanceYnew)>15)allowY&&(this.isBeyondPossibleTop(distance.y,possibleSwipeCords.minY)?distance.y=possibleSwipeCords.minY:this.isBeyondPossibleBottom(distance.y,possibleSwipeCords.maxY)&&(distance.y=possibleSwipeCords.maxY)),allowX&&(this.isBeyondPossibleLeft(distance.x,possibleSwipeCords.minX)?distance.x=possibleSwipeCords.minX:this.isBeyondPossibleRight(distance.x,possibleSwipeCords.maxX)&&(distance.x=possibleSwipeCords.maxX)),allowY?this.top=distance.y:distance.y=this.top,allowX?this.left=distance.x:distance.x=this.left,this.setZoomSwipeStyles(_LGel,distance),this.positionChanged=!0},Zoom.prototype.getZoomSwipeCords=function(startCoords,endCoords,allowX,allowY,possibleSwipeCords){var distance={};if(allowY){distance.y=this.top+(endCoords.y-startCoords.y)*this.modifierY;if(this.isBeyondPossibleTop(distance.y,possibleSwipeCords.minY)){var diffMinY=possibleSwipeCords.minY-distance.y;distance.y=possibleSwipeCords.minY-diffMinY/6}else if(this.isBeyondPossibleBottom(distance.y,possibleSwipeCords.maxY)){var diffMaxY=distance.y-possibleSwipeCords.maxY;distance.y=possibleSwipeCords.maxY+diffMaxY/6}}else distance.y=this.top;if(allowX){distance.x=this.left+(endCoords.x-startCoords.x)*this.modifierX;if(this.isBeyondPossibleLeft(distance.x,possibleSwipeCords.minX)){var diffMinX=possibleSwipeCords.minX-distance.x;distance.x=possibleSwipeCords.minX-diffMinX/6}else if(this.isBeyondPossibleRight(distance.x,possibleSwipeCords.maxX)){var difMaxX=distance.x-possibleSwipeCords.maxX;distance.x=possibleSwipeCords.maxX+difMaxX/6}}else distance.x=this.left;return distance},Zoom.prototype.isBeyondPossibleLeft=function(x,minX){return x>=minX},Zoom.prototype.isBeyondPossibleRight=function(x,maxX){return x<=maxX},Zoom.prototype.isBeyondPossibleTop=function(y,minY){return y>=minY},Zoom.prototype.isBeyondPossibleBottom=function(y,maxY){return y<=maxY},Zoom.prototype.isImageSlide=function(){var currentItem=this.core.galleryItems[this.core.index];return this.core.getSlideType(currentItem)==="image"},Zoom.prototype.getPossibleSwipeDragCords=function(rotateValue,scale){var dataScale=scale||this.scale||1,elDataScale=Math.abs(dataScale),_a=this.core.mediaContainerPosition,top=_a.top,bottom=_a.bottom,topBottomSpacing=Math.abs(top-bottom)/2,minY=(this.imageYSize-this.containerRect.height)/2+topB
1ottomSpacing*this.modifierX,maxY=this.containerRect.height-this.imageYSize*elDataScale+minY,minX=(this.imageXSize-this.containerRect.width)/2,maxX=this.containerRect.width-this.imageXSize*elDataScale+minX,possibleSwipeCords={minY:minY,maxY:maxY,minX:minX,maxX:maxX};return Math.abs(rotateValue)===90&&(possibleSwipeCords={minY:minX,maxY:maxX,minX:minY,maxX:maxY}),possibleSwipeCords},Zoom.prototype.setZoomSwipeStyles=function(LGel,distance){LGel.css("transform","translate3d("+distance.x+"px, "+distance.y+"px, 0)")},Zoom.prototype.zoomSwipe=function(){var _this=this,startCoords={},endCoords={},isMoved=!1,allowX=!1,allowY=!1,startTime=new Date,endTime=new Date,possibleSwipeCords,_LGel,$item=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(e){if(!_this.isImageSlide())return;$item=_this.core.getSlideItem(_this.core.index);if((_this.$LG(e.target).hasClass("lg-item")||$item.get().contains(e.target))&&e.targetTouches.length===1&&_this.core.outer.hasClass("lg-zoomed")){e.preventDefault(),startTime=new Date,_this.core.touchAction="zoomSwipe",_LGel=_this.core.getSlideItem(_this.core.index).find(".lg-img-wrap").first();var dragAllowedAxises=_this.getDragAllowedAxises(Math.abs(_this.rotateValue));allowY=dragAllowedAxises.allowY,allowX=dragAllowedAxises.allowX;if(allowX||allowY)startCoords=_this.getSwipeCords(e,Math.abs(_this.rotateValue));possibleSwipeCords=_this.getPossibleSwipeDragCords(_this.rotateValue),_this.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(e){if(e.targetTouches.length===1&&_this.core.touchAction==="zoomSwipe"&&(_this.$LG(e.target).hasClass("lg-item")||$item.get().contains(e.target))){e.preventDefault(),_this.core.touchAction="zoomSwipe",endCoords=_this.getSwipeCords(e,Math.abs(_this.rotateValue));var distance=_this.getZoomSwipeCords(startCoords,endCoords,allowX,allowY,possibleSwipeCords);if(Math.abs(endCoords.x-startCoords.x)>15||Math.abs(endCoords.y-startCoords.y)>15)isMoved=!0,_this.setZoomSwipeStyles(_LGel,distance)}}),this.core.$inner.on("touchend.lg",function(e){if(_this.core.touchAction==="zoomSwipe"&&(_this.$LG(e.target).hasClass("lg-item")||$item.get().contains(e.target))){_this.core.touchAction=undefined,_this.core.outer.removeClass("lg-zoom-dragging");if(!isMoved)return;isMoved=!1,endTime=new Date;var touchDuration=endTime.valueOf()-startTime.valueOf();_this.touchendZoom(startCoords,endCoords,allowX,allowY,touchDuration,_this.rotateValue)}})},Zoom.prototype.zoomDrag=function(){var _this=this,startCoords={},endCoords={},isDragging=!1,isMoved=!1,allowX=!1,allowY=!1,startTime,endTime,possibleSwipeCords,_LGel;this.core.outer.on("mousedown.lg.zoom",function(e){if(!_this.isImageSlide())return;var $item=_this.core.getSlideItem(_this.core.index);if(_this.$LG(e.target).hasClass("lg-item")||$item.get().contains(e.target)){startTime=new Date,_LGel=_this.core.getSlideItem(_this.core.index).find(".lg-img-wrap").first();var dragAllowedAxises=_this.getDragAllowedAxises(Math.abs(_this.rotateValue));allowY=dragAllowedAxises.allowY,allowX=dragAllowedAxises.allowX,_this.core.outer.hasClass("lg-zoomed")&&_this.$LG(e.target).hasClass("lg-object")&&(allowX||allowY)&&(e.preventDefault(),startCoords=_this.getDragCords(e,Math.abs(_this.rotateValue)),possibleSwipeCords=_this.getPossibleSwipeDragCords(_this.rotateValue),isDragging=!0,_this.core.outer.get().scrollLeft+=1,_this.core.outer.get().scrollLeft-=1,_this.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(e){if(isDragging){isMoved=!0,endCoords=_this.getDragCords(e,Math.abs(_this.rotateValue));var distance=_this.getZoomSwipeCords(startCoords,endCoords,allowX,allowY,possibleSwipeCords);_this.setZoomSwipeStyles(_LGel,distance)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(e){if(isDragging){endTime=new Date,isDragging=!1,_this.core.outer.removeClass("lg-zoom-dragging");if(isMoved&&(startCoords.x!==endCoords.x||startCoords.y!==endCoords.y)){endCoords=_this.getDragCords(e,Math.abs(_this.rotateValue));var touchDuration=endTime.valueOf()-startTime.valueOf();_this.touchendZoom(startCoords,endCoords,allowX,allowY,touchDuration,_this.rotateValue)}isMoved=!1}_this.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},Zoom.prototype.closeGallery=function(){this.resetZoom()},Zoom.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},Zoom}();return Zoom})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.