"use strict";exports.id=1280,exports.ids=[1280],exports.modules={81280:(e,t,n)=>{var s=n(16689);let o={delta:10,preventScrollOnSwipe:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},i={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},a="mousemove",c="mouseup";function rotateXYByAngle(e,t){if(0===t)return e;let n=Math.PI/180*t,s=e[0]*Math.cos(n)+e[1]*Math.sin(n),o=e[1]*Math.cos(n)-e[0]*Math.sin(n);return[s,o]}t.QS=function(e){var t,n,r;let u;let{trackMouse:l}=e,p=s.useRef(Object.assign({},i)),h=s.useRef(Object.assign({},o)),g=s.useRef(Object.assign({},h.current));for(u in g.current=Object.assign({},h.current),h.current=Object.assign(Object.assign({},o),e),o)void 0===h.current[u]&&(h.current[u]=o[u]);let[O,v]=s.useMemo(()=>(function(e,t){let onStart=t=>{let n="touches"in t;n&&t.touches.length>1||e((e,s)=>{s.trackMouse&&!n&&(document.addEventListener(a,onMove),document.addEventListener(c,onUp));let{clientX:o,clientY:r}=n?t.touches[0]:t,u=rotateXYByAngle([o,r],s.rotationAngle);return s.onTouchStartOrOnMouseDown&&s.onTouchStartOrOnMouseDown({event:t}),Object.assign(Object.assign(Object.assign({},e),i),{initial:u.slice(),xy:u,start:t.timeStamp||0})})},onMove=t=>{e((e,n)=>{let s="touches"in t;if(s&&t.touches.length>1)return e;if(t.timeStamp-e.start>n.swipeDuration)return e.swiping?Object.assign(Object.assign({},e),{swiping:!1}):e;let{clientX:i,clientY:a}=s?t.touches[0]:t,[c,r]=rotateXYByAngle([i,a],n.rotationAngle),u=c-e.xy[0],l=r-e.xy[1],p=Math.abs(u),h=Math.abs(l),g=(t.timeStamp||0)-e.start,O=Math.sqrt(p*p+h*h)/(g||1),v=[u/(g||1),l/(g||1)],b=p>h?u>0?"Right":"Left":l>0?"Down":"Up",d="number"==typeof n.delta?n.delta:n.delta[b.toLowerCase()]||o.delta;if(p<d&&h<d&&!e.swiping)return e;let S={absX:p,absY:h,deltaX:u,deltaY:l,dir:b,event:t,first:e.first,initial:e.initial,velocity:O,vxvy:v};S.first&&n.onSwipeStart&&n.onSwipeStart(S),n.onSwiping&&n.onSwiping(S);let j=!1;return(n.onSwiping||n.onSwiped||n[`onSwiped${b}`])&&(j=!0),j&&n.preventScrollOnSwipe&&n.trackTouch&&t.cancelable&&t.preventDefault(),Object.assign(Object.assign({},e),{first:!1,eventData:S,swiping:!0})})},onEnd=t=>{e((e,n)=>{let s;if(e.swiping&&e.eventData){if(t.timeStamp-e.start<n.swipeDuration){s=Object.assign(Object.assign({},e.eventData),{event:t}),n.onSwiped&&n.onSwiped(s);let o=n[`onSwiped${s.dir}`];o&&o(s)}}else n.onTap&&n.onTap({event:t});return n.onTouchEndOrOnMouseUp&&n.onTouchEndOrOnMouseUp({event:t}),Object.assign(Object.assign(Object.assign({},e),i),{eventData:s})})},cleanUpMouse=()=>{document.removeEventListener(a,onMove),document.removeEventListener(c,onUp)},onUp=e=>{cleanUpMouse(),onEnd(e)},attachTouch=(e,t)=>{let cleanup=()=>{};if(e&&e.addEventListener){let n=Object.assign(Object.assign({},o.touchEventOptions),t.touchEventOptions),s=[["touchstart",onStart,n],["touchmove",onMove,Object.assign(Object.assign({},n),t.preventScrollOnSwipe?{passive:!1}:{})],["touchend",onEnd,n]];s.forEach(([t,n,s])=>e.addEventListener(t,n,s)),cleanup=()=>s.forEach(([t,n])=>e.removeEventListener(t,n))}return cleanup},n={ref:t=>{null!==t&&e((e,n)=>{if(e.el===t)return e;let s={};return e.el&&e.el!==t&&e.cleanUpTouch&&(e.cleanUpTouch(),s.cleanUpTouch=void 0),n.trackTouch&&t&&(s.cleanUpTouch=attachTouch(t,n)),Object.assign(Object.assign(Object.assign({},e),{el:t}),s)})}};return t.trackMouse&&(n.onMouseDown=onStart),[n,attachTouch]})(e=>p.current=e(p.current,h.current),{trackMouse:l}),[l]);return p.current=(t=p.current,n=h.current,r=g.current,n.trackTouch&&t.el?t.cleanUpTouch?n.preventScrollOnSwipe!==r.preventScrollOnSwipe||n.touchEventOptions.passive!==r.touchEventOptions.passive?(t.cleanUpTouch(),Object.assign(Object.assign({},t),{cleanUpTouch:v(t.el,n)})):t:Object.assign(Object.assign({},t),{cleanUpTouch:v(t.el,n)}):(t.cleanUpTouch&&t.cleanUpTouch(),Object.assign(Object.assign({},t),{cleanUpTouch:void 0}))),O}}};