PageSourceSearch

https://storefront-002.beyourahi.workers.dev/assets/embla-carousel-wheel-gestures.esm-H5SbBhtO.js

js storefront-002.beyourahi.workers.dev collected 2026-10-03 08:12:18 UTC 7,684 bytes, 1 lines download raw bytes

1function P(){return P=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(t[u]=i[u])}return t},P.apply(this,arguments)}var oe=.996,se=function(n,i){return i===void 0&&(i=oe),n*i/(1-i)};function ue(t){return t[t.length-1]}function le(t){return t.reduce(function(n,i){return n+i})/t.length}var ce=function(n,i,u){return Math.min(Math.max(i,n),u)};function k(t,n){if(t.length!==n.length)throw new Error("vectors must be same length");return t.map(function(i,u){return i+n[u]})}function Q(t){return Math.max.apply(Math,t.map(Math.abs))}function O(t){return Object.freeze(t),Object.values(t).forEach(function(n){n!==null&&typeof n=="object"&&!Object.isFrozen(n)&&O(n)}),t}function ve(){var t={};function n(m,s){return t[m]=(t[m]||[]).concat(s),function(){return i(m,s)}}function i(m,s){t[m]=(t[m]||[]).filter(function(e){return e!==s})}function u(m,s){m in t&&t[m].forEach(function(e){return e(s)})}return O({on:n,off:i,dispatch:u})}function fe(t){var n=[],i=function(e){return e.addEventListener("wheel",t,{passive:!1}),n.push(e),function(){return u(e)}},u=function(e){e.removeEventListener("wheel",t),n=n.filter(function(A){return A!==e})},m=function(){n.forEach(u)};return O({observe:i,unobserve:u,disconnect:m})}var me=16*1.125,de=typeof window<"u"&&window.innerHeight||800,$=[1,me,de];function he(t){var n=t.deltaX*$[t.deltaMode],i=t.deltaY*$[t.deltaMode],u=(t.deltaZ||0)*$[t.deltaMode];return{timeStamp:t.timeStamp,axisDelta:[n,i,u]}}var pe=[-1,-1,-1];function ge(t,n){if(!n)return t;var i=n===!0?pe:n.map(function(u){return u?-1:1});return P({},t,{axisDelta:t.axisDelta.map(function(u,m){return u*i[m]})})}var ee=700,Me=function(n){return P({},n,{axisDelta:n.axisDelta.map(function(i){return ce(i,-ee,ee)})})},Ee=.6,xe=.96,Ae=2,te=5,ne=O({preventWheelAction:!0,reverseSign:[!0,!0,!1]}),De=400;function re(){return{isStarted:!1,isStartPublished:!1,isMomentum:!1,startTime:0,lastAbsDelta:1/0,axisMovement:[0,0,0],axisVelocity:[0,0,0],accelerationFactors:[],scrollPoints:[],scrollPointsToMerge:[],willEndTimeout:De}}function be(t){t===void 0&&(t={});var n=ve(),i=n.on,u=n.off,m=n.dispatch,s=ne,e=re(),A,D=!1,W,C=function(r){Array.isArray(r)?r.forEach(function(o){return w(o)}):w(r)},X=function(r){return r===void 0&&(r={}),Object.values(r).some(function(o){return o==null})?s:s=O(P({},ne,s,r))},L=function(r){var o=P({event:A,isStart:!1,isEnding:!1,isMomentumCancel:!1,isMomentum:e.isMomentum,axisDelta:[0,0,0],axisVelocity:e.axisVelocity,axisMovement:e.axisMovement,get axisMovementProjection(){return k(o.axisMovement,o.axisVelocity.map(function(f){return se(f)}))}},r);m("wheel",P({},o,{previous:W})),W=o},g=function(r,o){var f=s,h=f.preventWheelAction,p=o[0],a=o[1],c=o[2];if(typeof h=="boolean")return h;switch(h){case"x":return Math.abs(p)>=r;case"y":return Math.abs(a)>=r;case"z":return Math.abs(c)>=r;default:return!1}},w=function(r){var o=Me(ge(he(r),s.reverseSign)),f=o.axisDelta,h=o.timeStamp,p=Q(f);if(r.preventDefault&&g(p,f)&&r.preventDefault(),e.isStarted?e.isMomentum&&p>Math.max(2,e.lastAbsDelta*2)&&(S(!0),E()):E(),p===0&&Object.is&&Object.is(r.deltaX,-0)){D=!0;return}A=r,e.axisMovement=k(e.axisMovement,f),e.lastAbsDelta=p,e.scrollPointsToMerge.push({axisDelta:f,timeStamp:h}),x(),L({axisDelta:f,isStart:!e.isStartPublished}),e.isStartPublished=!0,I()},x=function(){e.scrollPointsToMerge.length===Ae?(e.scrollPoints.unshift({axisDeltaSum:e.scrollPointsToMerge.map(function(r){return r.axisDelta}).reduce(k),timeStamp:le(e.scrollPointsToMerge.map(function(r){return r.timeStamp}))}),V(),e.scrollPointsToMerge.length=0,e.scrollPoints.length=1,e.isMomentum||b()):e.isStartPublished||j()},j=function(){e.axisVelocity=ue(e.scrollPointsToMerge).axisDelta.map(function(r){return r/e.willEndTimeout})},V=function(){var r=e.scrollPoints,o=r[0],f=r[1];if(!(!f||!o)){var h=o.timeStamp-f.timeStamp;if(!(h<=0)){var p=o.axisDeltaSum.map(function(c){return c/h}),a=p.map(function(c,v){return c/(e.axisVelocity[v]||1)});e.axisVelocity=p,e.accelerationFactors.push(a),Y(h)}}},Y=function(r){var o=Math.ceil(r/10)*10*1.2;e.isMomentum||(o=Math.max(100,o*2)),e.willEndTimeout=Math.min(1e3,Math.round(o))},z=function(r){return r===0?!0:r<=xe&&r>=Ee},b=function(){if(e.accelerationFactors.length>=te){if(D&&(D=!1,Q(e.axisVelocity)>=.2)){M();return}var r=e.accelerationFactors.slice(te*-1),o=r.every(function(f){var h=!!f.reduce(function(a,c){return a&&a<1&&a===c?1:0}),p=f.filter(z).length===f.length;return h||p}
1);o&&M(),e.accelerationFactors=r}},M=function(){e.isMomentum=!0},E=function(){e=re(),e.isStarted=!0,e.startTime=Date.now(),W=void 0,D=!1},I=(function(){var l;return function(){clearTimeout(l),l=setTimeout(S,e.willEndTimeout)}})(),S=function(r){r===void 0&&(r=!1),e.isStarted&&(e.isMomentum&&r?L({isEnding:!0,isMomentumCancel:!0}):L({isEnding:!0}),e.isMomentum=!1,e.isStarted=!1)},N=fe(C),G=N.observe,H=N.unobserve,F=N.disconnect;return X(t),O({on:i,off:u,observe:G,unobserve:H,disconnect:F,feedWheel:C,updateOptions:X})}var Se={active:!0,breakpoints:{},wheelDraggingClass:"is-wheel-dragging",forceWheelAxis:void 0,target:void 0};ae.globalOptions=void 0;function ae(t){t===void 0&&(t={});var n,i=function(){};function u(s,e){var A,D,W=e.mergeOptions,C=e.optionsAtMedia,X=W(Se,ae.globalOptions),L=W(X,t);n=C(L);var g=s.internalEngine(),w=(A=n.target)!=null?A:s.containerNode().parentNode,x=(D=n.forceWheelAxis)!=null?D:g.options.axis,j=be({preventWheelAction:x,reverseSign:[!0,!0,!1]});function V(){I=(x==="x"?g.containerRect.width:g.containerRect.height)/2}var Y=j.observe(w),z=j.on("wheel",p),b=!1,M,E=0,I=0,S=!1;V(),s.on("resize",V);function N(a){try{M=new MouseEvent("mousedown",a.event),o(M)}catch{return i()}b=!0,E=0,H(),n.wheelDraggingClass&&w.classList.add(n.wheelDraggingClass)}function G(a){b=!1,o(r("mouseup",a)),F(),n.wheelDraggingClass&&w.classList.remove(n.wheelDraggingClass)}function H(){document.documentElement.addEventListener("mousemove",l,!0),document.documentElement.addEventListener("mouseup",l,!0),document.documentElement.addEventListener("mousedown",l,!0)}function F(){document.documentElement.removeEventListener("mousemove",l,!0),document.documentElement.removeEventListener("mouseup",l,!0),document.documentElement.removeEventListener("mousedown",l,!0)}function l(a){b&&a.isTrusted&&a.stopImmediatePropagation()}function r(a,c){var v,d;if(x===g.options.axis){var T=c.axisMovement;v=T[0],d=T[1]}else{var _=c.axisMovement;d=_[0],v=_[1]}var B=f(c),y=B.isAtBoundary;if(y){var R=Math.min(E/I,1),Z=.25+R*.5,U=v>0?-1:1,ie=E*U,q=ie*Z;v+=q,d+=q}if(!g.options.skipSnaps&&!g.options.dragFree){var J=g.containerRect.width,K=g.containerRect.height;v=v<0?Math.max(v,-J):Math.min(v,J),d=d<0?Math.max(d,-K):Math.min(d,K)}return new MouseEvent(a,{clientX:M.clientX+v,clientY:M.clientY+d,screenX:M.screenX+v,screenY:M.screenY+d,movementX:v,movementY:d,button:0,bubbles:!0,cancelable:!0,composed:!0})}function o(a){s.containerNode().dispatchEvent(a)}function f(a){var c=a.axisDelta,v=c[0],d=c[1],T=s.scrollProgress(),_=T<1,B=T>0,y=x==="x"?v:d,R=y<0,Z=y>0,U=R&&!_||Z&&!B;return{isAtBoundary:U,primaryAxisDelta:y}}function h(a){var c=f(a),v=c.isAtBoundary,d=c.primaryAxisDelta;if(v&&!a.isMomentum){if(E+=Math.abs(d),E>I)return S=!0,G(a),!0}else E=0;return!1}function p(a){var c=a.axisDelta,v=c[0],d=c[1],T=x==="x"?v:d,_=x==="x"?d:v,B=a.isMomentum&&a.previous&&!a.previous.isMomentum,y=a.isEnding&&!a.isMomentum||B,R=Math.abs(T)>Math.abs(_);R&&!b&&!a.isMomentum&&!S&&N(a),S&&a.isEnding&&(S=!1),b&&(h(a)||(y?G(a):o(r("mousemove",a))))}i=function(){Y(),z(),s.off("resize",V),F()}}var m={name:"wheelGestures",options:t,init:u,destroy:function(){return i()}};return m}export{ae as W};

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.