import{g as He}from"./BosuxZz1.js";import{_ as we,o as We,b as Fe,f as $t,B as Kt,S as te}from"./LrfSKRHt.js";var ie={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
 * http://hammerjs.github.io/
 *
 * Copyright (c) 2016 Jorik Tangelder;
 * Licensed under the MIT license */(function(r){(function(a,l,H,c){var T=["","webkit","Moz","MS","ms","o"],w=l.createElement("div"),ne="function",b=Math.round,M=Math.abs,ut=Date.now;function ft(t,e,i){return setTimeout(mt(t,i),e)}function Y(t,e,i){return Array.isArray(t)?(N(t,i[e],i),!0):!1}function N(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==c)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function Nt(t,e,i){var n="DEPRECATED METHOD: "+e+`
`+i+` AT 
`;return function(){var s=new Error("get-stack-trace"),o=s&&s.stack?s.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",h=a.console&&(a.console.warn||a.console.log);return h&&h.call(a.console,n,o),t.apply(this,arguments)}}var y;typeof Object.assign!="function"?y=function(e){if(e===c||e===null)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(e),n=1;n<arguments.length;n++){var s=arguments[n];if(s!==c&&s!==null)for(var o in s)s.hasOwnProperty(o)&&(i[o]=s[o])}return i}:y=Object.assign;var Ct=Nt(function(e,i,n){for(var s=Object.keys(i),o=0;o<s.length;)(!n||n&&e[s[o]]===c)&&(e[s[o]]=i[s[o]]),o++;return e},"extend","Use `assign`."),se=Nt(function(e,i){return Ct(e,i,!0)},"merge","Use `assign`.");function p(t,e,i){var n=e.prototype,s;s=t.prototype=Object.create(n),s.constructor=t,s._super=n,i&&y(s,i)}function mt(t,e){return function(){return t.apply(e,arguments)}}function vt(t,e){return typeof t==ne?t.apply(e&&e[0]||c,e):t}function Ot(t,e){return t===c?e:t}function Q(t,e,i){N($(e),function(n){t.addEventListener(n,i,!1)})}function j(t,e,i){N($(e),function(n){t.removeEventListener(n,i,!1)})}function At(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function x(t,e){return t.indexOf(e)>-1}function $(t){return t.trim().split(/\s+/g)}function X(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function K(t){return Array.prototype.slice.call(t,0)}function zt(t,e,i){for(var n=[],s=[],o=0;o<t.length;){var h=t[o][e];X(s,h)<0&&n.push(t[o]),s[o]=h,o++}return n=n.sort(function(m,d){return m[e]>d[e]}),n}function tt(t,e){for(var i,n,s=e[0].toUpperCase()+e.slice(1),o=0;o<T.length;){if(i=T[o],n=i?i+s:e,n in t)return n;o++}return c}var oe=1;function re(){return oe++}function Mt(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||a}var ae=/mobile|tablet|ip(ad|hone|od)|android/i,xt="ontouchstart"in a,he=tt(a,"PointerEvent")!==c,le=xt&&ae.test(navigator.userAgent),W="touch",ce="pen",dt="mouse",ue="kinect",fe=25,v=1,R=2,u=4,g=8,et=1,F=2,q=4,V=8,k=16,P=F|q,D=V|k,Rt=P|D,Dt=["x","y"],it=["clientX","clientY"];function E(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(n){vt(t.options.enable,[t])&&i.handler(n)},this.init()}E.prototype={handler:function(){},init:function(){this.evEl&&Q(this.element,this.evEl,this.domHandler),this.evTarget&&Q(this.target,this.evTarget,this.domHandler),this.evWin&&Q(Mt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&j(this.element,this.evEl,this.domHandler),this.evTarget&&j(this.target,this.evTarget,this.domHandler),this.evWin&&j(Mt(this.element),this.evWin,this.domHandler)}};function me(t){var e,i=t.options.inputClass;return i?e=i:he?e=pt:le?e=ot:xt?e=Tt:e=st,new e(t,ve)}function ve(t,e,i){var n=i.pointers.length,s=i.changedPointers.length,o=e&v&&n-s===0,h=e&(u|g)&&n-s===0;i.isFirst=!!o,i.isFinal=!!h,o&&(t.session={}),i.eventType=e,de(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function de(t,e){var i=t.session,n=e.pointers,s=n.length;i.firstInput||(i.firstInput=Ut(e)),s>1&&!i.firstMultiple?i.firstMultiple=Ut(e):s===1&&(i.firstMultiple=!1);var o=i.firstInput,h=i.firstMultiple,f=h?h.center:o.center,m=e.center=bt(n);e.timeStamp=ut(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=gt(f,m),e.distance=nt(f,m),ge(i,e),e.offsetDirection=Xt(e.deltaX,e.deltaY);var d=Yt(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=d.x,e.overallVelocityY=d.y,e.overallVelocity=M(d.x)>M(d.y)?d.x:d.y,e.scale=h?Ee(h.pointers,n):1,e.rotation=h?Te(h.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,pe(i,e);var S=t.element;At(e.srcEvent.target,S)&&(S=e.srcEvent.target),e.target=S}function ge(t,e){var i=e.center,n=t.offsetDelta||{},s=t.prevDelta||{},o=t.prevInput||{};(e.eventType===v||o.eventType===u)&&(s=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=s.x+(i.x-n.x),e.deltaY=s.y+(i.y-n.y)}function pe(t,e){var i=t.lastInterval||e,n=e.timeStamp-i.timeStamp,s,o,h,f;if(e.eventType!=g&&(n>fe||i.velocity===c)){var m=e.deltaX-i.deltaX,d=e.deltaY-i.deltaY,S=Yt(n,m,d);o=S.x,h=S.y,s=M(S.x)>M(S.y)?S.x:S.y,f=Xt(m,d),t.lastInterval=e}else s=i.velocity,o=i.velocityX,h=i.velocityY,f=i.direction;e.velocity=s,e.velocityX=o,e.velocityY=h,e.direction=f}function Ut(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:b(t.pointers[i].clientX),clientY:b(t.pointers[i].clientY)},i++;return{timeStamp:ut(),pointers:e,center:bt(e),deltaX:t.deltaX,deltaY:t.deltaY}}function bt(t){var e=t.length;if(e===1)return{x:b(t[0].clientX),y:b(t[0].clientY)};for(var i=0,n=0,s=0;s<e;)i+=t[s].clientX,n+=t[s].clientY,s++;return{x:b(i/e),y:b(n/e)}}function Yt(t,e,i){return{x:e/t||0,y:i/t||0}}function Xt(t,e){return t===e?et:M(t)>=M(e)?t<0?F:q:e<0?V:k}function nt(t,e,i){i||(i=Dt);var n=e[i[0]]-t[i[0]],s=e[i[1]]-t[i[1]];return Math.sqrt(n*n+s*s)}function gt(t,e,i){i||(i=Dt);var n=e[i[0]]-t[i[0]],s=e[i[1]]-t[i[1]];return Math.atan2(s,n)*180/Math.PI}function Te(t,e){return gt(e[1],e[0],it)+gt(t[1],t[0],it)}function Ee(t,e){return nt(e[0],e[1],it)/nt(t[0],t[1],it)}var Ie={mousedown:v,mousemove:R,mouseup:u},Le="mousedown",ye="mousemove mouseup";function st(){this.evEl=Le,this.evWin=ye,this.pressed=!1,E.apply(this,arguments)}p(st,E,{handler:function(e){var i=Ie[e.type];i&v&&e.button===0&&(this.pressed=!0),i&R&&e.which!==1&&(i=u),this.pressed&&(i&u&&(this.pressed=!1),this.callback(this.manager,i,{pointers:[e],changedPointers:[e],pointerType:dt,srcEvent:e}))}});var Pe={pointerdown:v,pointermove:R,pointerup:u,pointercancel:g,pointerout:g},_e={2:W,3:ce,4:dt,5:ue},Zt="pointerdown",Ht="pointermove pointerup pointercancel";a.MSPointerEvent&&!a.PointerEvent&&(Zt="MSPointerDown",Ht="MSPointerMove MSPointerUp MSPointerCancel");function pt(){this.evEl=Zt,this.evWin=Ht,E.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}p(pt,E,{handler:function(e){var i=this.store,n=!1,s=e.type.toLowerCase().replace("ms",""),o=Pe[s],h=_e[e.pointerType]||e.pointerType,f=h==W,m=X(i,e.pointerId,"pointerId");o&v&&(e.button===0||f)?m<0&&(i.push(e),m=i.length-1):o&(u|g)&&(n=!0),!(m<0)&&(i[m]=e,this.callback(this.manager,o,{pointers:i,changedPointers:[e],pointerType:h,srcEvent:e}),n&&i.splice(m,1))}});var Se={touchstart:v,touchmove:R,touchend:u,touchcancel:g},Ne="touchstart",Ce="touchstart touchmove touchend touchcancel";function wt(){this.evTarget=Ne,this.evWin=Ce,this.started=!1,E.apply(this,arguments)}p(wt,E,{handler:function(e){var i=Se[e.type];if(i===v&&(this.started=!0),!!this.started){var n=Oe.call(this,e,i);i&(u|g)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,i,{pointers:n[0],changedPointers:n[1],pointerType:W,srcEvent:e})}}});function Oe(t,e){var i=K(t.touches),n=K(t.changedTouches);return e&(u|g)&&(i=zt(i.concat(n),"identifier")),[i,n]}var Ae={touchstart:v,touchmove:R,touchend:u,touchcancel:g},ze="touchstart touchmove touchend touchcancel";function ot(){this.evTarget=ze,this.targetIds={},E.apply(this,arguments)}p(ot,E,{handler:function(e){var i=Ae[e.type],n=Me.call(this,e,i);n&&this.callback(this.manager,i,{pointers:n[0],changedPointers:n[1],pointerType:W,srcEvent:e})}});function Me(t,e){var i=K(t.touches),n=this.targetIds;if(e&(v|R)&&i.length===1)return n[i[0].identifier]=!0,[i,i];var s,o,h=K(t.changedTouches),f=[],m=this.target;if(o=i.filter(function(d){return At(d.target,m)}),e===v)for(s=0;s<o.length;)n[o[s].identifier]=!0,s++;for(s=0;s<h.length;)n[h[s].identifier]&&f.push(h[s]),e&(u|g)&&delete n[h[s].identifier],s++;if(f.length)return[zt(o.concat(f),"identifier"),f]}var xe=2500,Wt=25;function Tt(){E.apply(this,arguments);var t=mt(this.handler,this);this.touch=new ot(this.manager,t),this.mouse=new st(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}p(Tt,E,{handler:function(e,i,n){var s=n.pointerType==W,o=n.pointerType==dt;if(!(o&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(s)Re.call(this,i,n);else if(o&&De.call(this,n))return;this.callback(e,i,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Re(t,e){t&v?(this.primaryTouch=e.changedPointers[0].identifier,Ft.call(this,e)):t&(u|g)&&Ft.call(this,e)}function Ft(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches,s=function(){var o=n.indexOf(i);o>-1&&n.splice(o,1)};setTimeout(s,xe)}}function De(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var s=this.lastTouches[n],o=Math.abs(e-s.x),h=Math.abs(i-s.y);if(o<=Wt&&h<=Wt)return!0}return!1}var qt=tt(w.style,"touchAction"),Vt=qt!==c,kt="compute",Gt="auto",Et="manipulation",U="none",G="pan-x",B="pan-y",rt=be();function It(t,e){this.manager=t,this.set(e)}It.prototype={set:function(t){t==kt&&(t=this.compute()),Vt&&this.manager.element.style&&rt[t]&&(this.manager.element.style[qt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return N(this.manager.recognizers,function(e){vt(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),Ue(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented){e.preventDefault();return}var n=this.actions,s=x(n,U)&&!rt[U],o=x(n,B)&&!rt[B],h=x(n,G)&&!rt[G];if(s){var f=t.pointers.length===1,m=t.distance<2,d=t.deltaTime<250;if(f&&m&&d)return}if(!(h&&o)&&(s||o&&i&P||h&&i&D))return this.preventSrc(e)},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};function Ue(t){if(x(t,U))return U;var e=x(t,G),i=x(t,B);return e&&i?U:e||i?e?G:B:x(t,Et)?Et:Gt}function be(){if(!Vt)return!1;var t={},e=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){t[i]=e?a.CSS.supports("touch-action",i):!0}),t}var at=1,I=2,Z=4,A=8,C=A,J=16,_=32;function O(t){this.options=y({},this.defaults,t||{}),this.id=re(),this.manager=null,this.options.enable=Ot(this.options.enable,!0),this.state=at,this.simultaneous={},this.requireFail=[]}O.prototype={defaults:{},set:function(t){return y(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(Y(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=ht(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return Y(t,"dropRecognizeWith",this)?this:(t=ht(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(Y(t,"requireFailure",this))return this;var e=this.requireFail;return t=ht(t,this),X(e,t)===-1&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(Y(t,"dropRequireFailure",this))return this;t=ht(t,this);var e=X(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function n(s){e.manager.emit(s,t)}i<A&&n(e.options.event+Bt(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=A&&n(e.options.event+Bt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=_},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(_|at)))return!1;t++}return!0},recognize:function(t){var e=y({},t);if(!vt(this.options.enable,[this,e])){this.reset(),this.state=_;return}this.state&(C|J|_)&&(this.state=at),this.state=this.process(e),this.state&(I|Z|A|J)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}};function Bt(t){return t&J?"cancel":t&A?"end":t&Z?"move":t&I?"start":""}function Jt(t){return t==k?"down":t==V?"up":t==F?"left":t==q?"right":""}function ht(t,e){var i=e.manager;return i?i.get(t):t}function L(){O.apply(this,arguments)}p(L,O,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return e===0||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=e&(I|Z),s=this.attrTest(t);return n&&(i&g||!s)?e|J:n||s?i&u?e|A:e&I?e|Z:I:_}});function lt(){L.apply(this,arguments),this.pX=null,this.pY=null}p(lt,L,{defaults:{event:"pan",threshold:10,pointers:1,direction:Rt},getTouchAction:function(){var t=this.options.direction,e=[];return t&P&&e.push(B),t&D&&e.push(G),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,s=t.direction,o=t.deltaX,h=t.deltaY;return s&e.direction||(e.direction&P?(s=o===0?et:o<0?F:q,i=o!=this.pX,n=Math.abs(t.deltaX)):(s=h===0?et:h<0?V:k,i=h!=this.pY,n=Math.abs(t.deltaY))),t.direction=s,i&&n>e.threshold&&s&e.direction},attrTest:function(t){return L.prototype.attrTest.call(this,t)&&(this.state&I||!(this.state&I)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Jt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}});function Lt(){L.apply(this,arguments)}p(Lt,L,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[U]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&I)},emit:function(t){if(t.scale!==1){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}});function yt(){O.apply(this,arguments),this._timer=null,this._input=null}p(yt,O,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Gt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,s=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(u|g)&&!s)this.reset();else if(t.eventType&v)this.reset(),this._timer=ft(function(){this.state=C,this.tryEmit()},e.time,this);else if(t.eventType&u)return C;return _},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===C&&(t&&t.eventType&u?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=ut(),this.manager.emit(this.options.event,this._input)))}});function Pt(){L.apply(this,arguments)}p(Pt,L,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[U]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&I)}});function _t(){L.apply(this,arguments)}p(_t,L,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:P|D,pointers:1},getTouchAction:function(){return lt.prototype.getTouchAction.call(this)},attrTest:function(t){var e=this.options.direction,i;return e&(P|D)?i=t.overallVelocity:e&P?i=t.overallVelocityX:e&D&&(i=t.overallVelocityY),this._super.attrTest.call(this,t)&&e&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&M(i)>this.options.velocity&&t.eventType&u},emit:function(t){var e=Jt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}});function ct(){O.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}p(ct,O,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Et]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,s=t.deltaTime<e.time;if(this.reset(),t.eventType&v&&this.count===0)return this.failTimeout();if(n&&s&&i){if(t.eventType!=u)return this.failTimeout();var o=this.pTime?t.timeStamp-this.pTime<e.interval:!0,h=!this.pCenter||nt(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,!h||!o?this.count=1:this.count+=1,this._input=t;var f=this.count%e.taps;if(f===0)return this.hasRequireFailures()?(this._timer=ft(function(){this.state=C,this.tryEmit()},e.interval,this),I):C}return _},failTimeout:function(){return this._timer=ft(function(){this.state=_},this.options.interval,this),_},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==C&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function z(t,e){return e=e||{},e.recognizers=Ot(e.recognizers,z.defaults.preset),new St(t,e)}z.VERSION="2.0.7",z.defaults={domEvents:!1,touchAction:kt,enable:!0,inputTarget:null,inputClass:null,preset:[[Pt,{enable:!1}],[Lt,{enable:!1},["rotate"]],[_t,{direction:P}],[lt,{direction:P},["swipe"]],[ct],[ct,{event:"doubletap",taps:2},["tap"]],[yt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Ye=1,Qt=2;function St(t,e){this.options=y({},z.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=me(this),this.touchAction=new It(this,this.options.touchAction),jt(this,!0),N(this.options.recognizers,function(i){var n=this.add(new i[0](i[1]));i[2]&&n.recognizeWith(i[2]),i[3]&&n.requireFailure(i[3])},this)}St.prototype={set:function(t){return y(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?Qt:Ye},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var i,n=this.recognizers,s=e.curRecognizer;(!s||s&&s.state&C)&&(s=e.curRecognizer=null);for(var o=0;o<n.length;)i=n[o],e.stopped!==Qt&&(!s||i==s||i.canRecognizeWith(s))?i.recognize(t):i.reset(),!s&&i.state&(I|Z|A)&&(s=e.curRecognizer=i),o++}},get:function(t){if(t instanceof O)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(Y(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(Y(t,"remove",this))return this;if(t=this.get(t),t){var e=this.recognizers,i=X(e,t);i!==-1&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==c&&e!==c){var i=this.handlers;return N($(t),function(n){i[n]=i[n]||[],i[n].push(e)}),this}},off:function(t,e){if(t!==c){var i=this.handlers;return N($(t),function(n){e?i[n]&&i[n].splice(X(i[n],e),1):delete i[n]}),this}},emit:function(t,e){this.options.domEvents&&Xe(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(!(!i||!i.length)){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](e),n++}},destroy:function(){this.element&&jt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function jt(t,e){var i=t.element;if(i.style){var n;N(t.options.cssProps,function(s,o){n=tt(i.style,o),e?(t.oldCssProps[n]=i.style[n],i.style[n]=s):i.style[n]=t.oldCssProps[n]||""}),e||(t.oldCssProps={})}}function Xe(t,e){var i=l.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}y(z,{INPUT_START:v,INPUT_MOVE:R,INPUT_END:u,INPUT_CANCEL:g,STATE_POSSIBLE:at,STATE_BEGAN:I,STATE_CHANGED:Z,STATE_ENDED:A,STATE_RECOGNIZED:C,STATE_CANCELLED:J,STATE_FAILED:_,DIRECTION_NONE:et,DIRECTION_LEFT:F,DIRECTION_RIGHT:q,DIRECTION_UP:V,DIRECTION_DOWN:k,DIRECTION_HORIZONTAL:P,DIRECTION_VERTICAL:D,DIRECTION_ALL:Rt,Manager:St,Input:E,TouchAction:It,TouchInput:ot,MouseInput:st,PointerEventInput:pt,TouchMouseInput:Tt,SingleTouchInput:wt,Recognizer:O,AttrRecognizer:L,Tap:ct,Pan:lt,Swipe:_t,Pinch:Lt,Rotate:Pt,Press:yt,on:Q,off:j,each:N,merge:se,extend:Ct,assign:y,inherit:p,bindFn:mt,prefixed:tt});var Ze=typeof a<"u"?a:typeof self<"u"?self:{};Ze.Hammer=z,r.exports?r.exports=z:a[H]=z})(window,document,"Hammer")})(ie);var qe=ie.exports;const ee=He(qe),Ve={props:{unzoomedImageUrl:{required:!0,type:String},zoomedImageUrl:{required:!1,type:String,default:void 0},fixedHeight:{required:!1,type:Number,default:0},maxZoomLevel:{required:!1,type:Number,default:2.5},item:{type:String,default:void 0},active:{type:Boolean,default:!1},zoomed:{type:Boolean,default:!1}},emits:["zoom-change"],data(){return{image:null,highResolutionImage:null,imageHeight:0,imageWidth:0,height:0,width:0,zoomLocationX:0,zoomLocationY:0,spacingTop:0,spacingLeft:0,highResolutionImageLoaded:!1,zoomLevel:1,startScale:0,startZoom:1,startLocationX:0,startLocationY:0,startTranslateLocationX:0,startTranslateLocationY:0,lastPanPosition:null,hammerManager:null,disablePan:!1}},computed:{normalizedZoomLevel(){return this.zoomLevel<1?1:this.zoomLevel>this.maxZoomLevel?this.maxZoomLevel:this.zoomLevel},imageUrl(){return this.highResolutionImageLoaded&&this.zoomLevel>1?this.zoomedImageUrl:this.unzoomedImageUrl},style(){return this.imageWidth!==0&&this.$refs.container?{transform:this.isZoomed?`scale(${this.normalizedZoomLevel}) translateX(${this.zoomLocationX}%) translateY(${this.zoomLocationY}%)`:""}:{}},containerStyle(){if(this.fixedHeight)return{height:`${this.fixedHeight}px`}},screenImageWidth(){return this.height*this.imageWidth/this.imageHeight},isTouchDevice(){return"ontouchstart"in window||navigator.msMaxTouchPoints>0},percentageZoomLocation(){return this.getPercentageLocationFromTranslateLocation(this.zoomLocationX,this.zoomLocationY)},isZoomed(){return this.zoomLevel!==1}},watch:{active(){this.resetZoom()},zoomed(){this.active&&this.onZoomButtonClick()},isZoomed(r){r&&!this.highResolutionImageLoaded&&this.zoomedImageUrl&&(this.highResolutionImage=new Image,this.highResolutionImage.addEventListener("load",this.loadHighResolutionImage),this.highResolutionImage.src=this.zoomedImageUrl),r||(this.zoomLocationX=0,this.zoomLocationY=0,this.startLocationX=0,this.startLocationY=0,this.startScale=0),this.$emit("zoom-change",r)},fixedHeight(){this.calculateSize()},zoomedImageUrl(r){r?(this.highResolutionImageLoaded=!1,this.highResolutionImage=new Image,this.highResolutionImage.addEventListener("load",this.loadHighResolutionImage),this.highResolutionImage.src=r):this.highResolutionImageLoaded=!1}},mounted(){window.addEventListener("resize",this.calculateSize),window.addEventListener("scroll",this.onScroll),this.image=new Image,this.image.addEventListener("load",this.loadImage),this.image.src=this.unzoomedImageUrl,this.$nextTick(()=>{this.hammerManager=new ee(this.$refs.container,{touchAction:"auto",domEvents:!0,inputClass:ee.TouchMouseInput}),this.hammerManager.get("pinch").set({enable:!0,threshold:.05}),this.hammerManager.get("pan").set({enable:!0,pointers:0,threshold:5}),this.hammerManager.get("doubletap").set({interval:500,posThreshold:20}),this.hammerManager.on("doubletap",this.onDoubleTap),this.hammerManager.on("pinchout",this.onPinchOut),this.hammerManager.on("pinchin",this.onPinchIn),this.hammerManager.on("pinchend",this.onPinchEnd),this.hammerManager.on("pan",this.onPan),this.hammerManager.on("panend",this.onPanEnd),this.$refs.container.addEventListener("touchstart",this.onTouchStart)})},beforeUnmount(){this.hammerManager&&this.hammerManager.off("doubletap pinchout pinchin pinchend"),this.$refs.container&&this.$refs.container.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("resize",this.calculateSize),window.removeEventListener("scroll",this.onScroll)},methods:{getPercentageLocation(r,a){const l=(this.width-this.screenImageWidth)/2;return{x:(r-l-this.spacingLeft)/this.screenImageWidth*100,y:(a-this.spacingTop)/this.height*100}},getTranslateLocation(r,a){const l=this.getPercentageLocation(r,a);return l.x<0?l.x=0:l.x>100&&(l.x=100),l.y<0?l.y=0:l.y>100&&(l.y=100),{x:(l.x-50)*(this.screenImageWidth/this.width)*-1,y:(l.y-50)*-1}},getPercentageLocationFromTranslateLocation(r,a){return{x:r/(this.screenImageWidth/this.width)/-1+50,y:a/-1+50}},zoomToRelativeLocation(r,a){const l=this.getTranslateLocation(r,a);return this.zoomLocationX=l.x-l.x/this.maxZoomLevel,this.zoomLocationY=l.y-l.y/this.maxZoomLevel,!0},zoomToPinchLocation(){this.startLocationX===null||this.startLocationX===null||(this.zoomLocationX=this.startLocationX-this.startTranslateLocationX/this.normalizedZoomLevel,this.zoomLocationY=this.startLocationY-this.startTranslateLocationY/this.normalizedZoomLevel)},setupPinchLocation(r){const a=this.getTranslateLocation(r.center.x,r.center.y);this.startScale=r.scale,this.startZoom=this.normalizedZoomLevel,a?(this.startTranslateLocationX=a.x,this.startTranslateLocationY=a.y,this.startLocationX=this.zoomLocationX+a.x/this.normalizedZoomLevel,this.startLocationY=this.zoomLocationY+a.y/this.normalizedZoomLevel):(this.startLocationX=null,this.startLocationY=null)},toggleZoom(r,a){this.isZoomed?this.zoomLevel=1:(this.zoomToRelativeLocation(r,a),this.zoomLevel=this.maxZoomLevel)},resetZoom(){this.isZoomed&&(this.zoomLevel=1)},loadImage(){this.imageWidth=this.image.naturalWidth,this.imageHeight=this.image.naturalHeight,this.calculateSize(),this.onScroll(null),this.image.removeEventListener("load",this.loadImage),this.image=null},loadHighResolutionImage(){this.imageWidth=this.highResolutionImage.naturalWidth,this.imageHeight=this.highResolutionImage.naturalHeight,this.highResolutionImageLoaded=!0,this.calculateSize(),this.onScroll(null),this.highResolutionImage.removeEventListener("load",this.loadHighResolutionImage),this.highResolutionImage=null},onZoomButtonClick(){this.toggleZoom(window.innerWidth/2,window.innerWidth/2)},onTouchStart(r){(typeof r.cancelable!="boolean"||r.cancelable)&&r.preventDefault()},onMouseClick(r){this.toggleZoom(r.clientX,r.clientY)},onMouseMove(r){this.isZoomed&&this.zoomToRelativeLocation(r.clientX,r.clientY)},onDoubleTap(r){this.updateSpacing(),this.toggleZoom(r.pointers[0].clientX,r.pointers[0].clientY)},onPinchOut(r){r.srcEvent.preventDefault(),r.srcEvent.stopPropagation(),this.startScale||(this.updateSpacing(),this.setupPinchLocation(r)),this.zoomLevel=this.startZoom+r.scale-this.startScale,this.zoomToPinchLocation()},onPinchIn(r){r.srcEvent.preventDefault(),r.srcEvent.stopPropagation(),this.startScale||this.setupPinchLocation(r),this.zoomLevel=this.startZoom-(this.startScale-r.scale)*this.maxZoomLevel*2,this.zoomToPinchLocation()},onPinchEnd(r){r.srcEvent.stopPropagation(),this.startScale=0},onPan(r){if(this.isZoomed){(typeof r.srcEvent.cancelable!="boolean"||r.srcEvent.cancelable)&&r.srcEvent.preventDefault();const a=this.getPercentageLocation(r.center.x,r.center.y);this.lastPanPosition||(this.lastPanPosition=a);const l=this.zoomLocationX+(a.x-this.lastPanPosition.x)/this.normalizedZoomLevel,H=this.zoomLocationY+(a.y-this.lastPanPosition.y)/this.normalizedZoomLevel,c=this.getPercentageLocationFromTranslateLocation(l,H);c.x>=50/this.normalizedZoomLevel&&c.x<=100-50/this.normalizedZoomLevel&&c.y>=50/this.normalizedZoomLevel&&c.y<=100-50/this.normalizedZoomLevel?(r.srcEvent.stopPropagation(),this.zoomLocationX=l,this.zoomLocationY=H,this.lastPanPosition=a):this.disablePan||r.srcEvent.stopPropagation()}},onPanEnd(r){this.isZoomed&&!(this.disablePan&&(this.percentageZoomLocation.x<53/this.normalizedZoomLevel||this.percentageZoomLocation.x>97-50/this.normalizedZoomLevel))&&r.srcEvent.stopPropagation(),this.lastPanPosition=null,this.disablePan=this.percentageZoomLocation.x<53/this.normalizedZoomLevel||this.percentageZoomLocation.x>97-50/this.normalizedZoomLevel},calculateSize(){if(this.imageWidth===0||!this.$refs.container)return;const r=this.$refs.container.getBoundingClientRect();this.width=r.width,this.height=this.fixedHeight||r.height},onScroll(){this.updateSpacing()},updateSpacing(){if(!this.$refs.container)return;const r=this.$refs.container.getBoundingClientRect();this.spacingTop=r.top}}},ke=["src"];function Ge(r,a,l,H,c,T){return We(),Fe("div",null,[$t("div",{ref:"container",class:Kt(["zoomable-image__container",{"zoomable-image__container--zoomed":T.isZoomed}]),style:te(T.containerStyle),onClick:a[0]||(a[0]=(...w)=>T.onMouseClick&&T.onMouseClick(...w)),onMousemove:a[1]||(a[1]=(...w)=>T.onMouseMove&&T.onMouseMove(...w))},[$t("img",{class:Kt([{"zoomable-image--zoomed":T.normalizedZoomLevel>1},"zoomable-image"]),src:T.imageUrl,style:te(T.style)},null,14,ke)],38)])}const Qe=we(Ve,[["render",Ge]]);export{Qe as default};