UNPKG

@egjs/react-conveyer

Version:

React Conveyer adds Drag gestures to your Native Scroll.

1,501 lines (1,497 loc) 82.9 kB
import { useRef as ue, useMemo as it, useState as zt, useEffect as st } from "react"; /*! * @egjs/react-conveyer v1.8.1-alpha.0 * (c) 2025 [object Object] * @license MIT */ function wt(i, r) { for (var e = i.length, t = 0; t < e; ++t) if (r(i[t], t)) return !0; return !1; } function Ht(i, r) { for (var e = i.length, t = 0; t < e; ++t) if (r(i[t], t)) return i[t]; return null; } function Xt(i) { var r = i; if (typeof r > "u") { if (typeof navigator > "u" || !navigator) return ""; r = navigator.userAgent || ""; } return r.toLowerCase(); } function St(i, r) { try { return new RegExp(i, "g").exec(r); } catch { return null; } } function ce() { if (typeof navigator > "u" || !navigator || !navigator.userAgentData) return !1; var i = navigator.userAgentData, r = i.brands || i.uaList; return !!(r && r.length); } function fe(i, r) { var e = St("(" + i + ")((?:\\/|\\s|:)([0-9|\\.|_]+))", r); return e ? e[3] : ""; } function _t(i) { return i.replace(/_/g, "."); } function B(i, r) { var e = null, t = "-1"; return wt(i, function(n) { var s = St("(" + n.test + ")((?:\\/|\\s|:)([0-9|\\.|_]+))?", r); return !s || n.brand ? !1 : (e = n, t = s[3] || "-1", n.versionAlias ? t = n.versionAlias : n.versionTest && (t = fe(n.versionTest.toLowerCase(), r) || t), t = _t(t), !0); }), { preset: e, version: t }; } function U(i, r) { var e = { brand: "", version: "-1" }; return wt(i, function(t) { var n = Ut(r, t); return n ? (e.brand = t.id, e.version = t.versionAlias || n.version, e.version !== "-1") : !1; }), e; } function Ut(i, r) { return Ht(i, function(e) { var t = e.brand; return St("" + r.test, t.toLowerCase()); }); } var Kt = [{ test: "phantomjs", id: "phantomjs" }, { test: "whale", id: "whale" }, { test: "edgios|edge|edg", id: "edge" }, { test: "msie|trident|windows phone", id: "ie", versionTest: "iemobile|msie|rv" }, { test: "miuibrowser", id: "miui browser" }, { test: "samsungbrowser", id: "samsung internet" }, { test: "samsung", id: "samsung internet", versionTest: "version" }, { test: "chrome|crios", id: "chrome" }, { test: "firefox|fxios", id: "firefox" }, { test: "android", id: "android browser", versionTest: "version" }, { test: "safari|iphone|ipad|ipod", id: "safari", versionTest: "version" }], qt = [{ test: "(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)", id: "chrome", versionTest: "chrome" }, { test: "chromium", id: "chrome" }, { test: "whale", id: "chrome", versionAlias: "-1", brand: !0 }], gt = [{ test: "applewebkit", id: "webkit", versionTest: "applewebkit|safari" }], $t = [{ test: "(?=(iphone|ipad))(?!(.*version))", id: "webview" }, { test: "(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))", id: "webview" }, { // test webview test: "webview", id: "webview" }], Gt = [{ test: "windows phone", id: "windows phone" }, { test: "windows 2000", id: "window", versionAlias: "5.0" }, { test: "windows nt", id: "window" }, { test: "win32|windows", id: "window" }, { test: "iphone|ipad|ipod", id: "ios", versionTest: "iphone os|cpu os" }, { test: "macos|macintel|mac os x", id: "mac" }, { test: "android|linux armv81", id: "android" }, { test: "tizen", id: "tizen" }, { test: "webos|web0s", id: "webos" }]; function Qt(i) { return !!B($t, i).preset; } function le(i) { var r = Xt(i), e = !!/mobi/g.exec(r), t = { name: "unknown", version: "-1", majorVersion: -1, webview: Qt(r), chromium: !1, chromiumVersion: "-1", webkit: !1, webkitVersion: "-1" }, n = { name: "unknown", version: "-1", majorVersion: -1 }, s = B(Kt, r), a = s.preset, o = s.version, u = B(Gt, r), c = u.preset, h = u.version, v = B(qt, r); if (t.chromium = !!v.preset, t.chromiumVersion = v.version, !t.chromium) { var l = B(gt, r); t.webkit = !!l.preset, t.webkitVersion = l.version; } return c && (n.name = c.id, n.version = h, n.majorVersion = parseInt(h, 10)), a && (t.name = a.id, t.version = o, t.webview && n.name === "ios" && t.name !== "safari" && (t.webview = !1)), t.majorVersion = parseInt(t.version, 10), { browser: t, os: n, isMobile: e, isHints: !1 }; } function he(i) { var r = navigator.userAgentData, e = (r.uaList || r.brands).slice(), t = r.mobile || !1, n = e[0], s = (r.platform || navigator.platform).toLowerCase(), a = { name: n.brand, version: n.version, majorVersion: -1, webkit: !1, webkitVersion: "-1", chromium: !1, chromiumVersion: "-1", webview: !!U($t, e).brand || Qt(Xt()) }, o = { name: "unknown", version: "-1", majorVersion: -1 }; a.webkit = !a.chromium && wt(gt, function(l) { return Ut(e, l); }); var u = U(qt, e); if (a.chromium = !!u.brand, a.chromiumVersion = u.version || "-1", !a.chromium) { var c = U(gt, e); a.webkit = !!c.brand, a.webkitVersion = c.version || "-1"; } var h = Ht(Gt, function(l) { return new RegExp("" + l.test, "g").exec(s); }); o.name = h ? h.id : ""; { var v = U(Kt, e); a.name = v.brand || a.name, a.version = v.brand && i ? i.uaFullVersion : v.version; } return a.webkit && (o.name = t ? "ios" : "mac"), o.name === "ios" && a.webview && (a.version = "-1"), o.version = _t(o.version), a.version = _t(a.version), o.majorVersion = parseInt(o.version, 10), a.majorVersion = parseInt(a.version, 10), { browser: a, os: o, isMobile: t, isHints: !0 }; } function ve(i) { return ce() ? he() : le(i); } /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ function de(i) { var r = typeof Symbol == "function" && Symbol.iterator, e = r && i[r], t = 0; if (e) return e.call(i); if (i && typeof i.length == "number") return { next: function() { return i && t >= i.length && (i = void 0), { value: i && i[t++], done: !i }; } }; throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined."); } function _e(i, r) { var e = typeof Symbol == "function" && i[Symbol.iterator]; if (!e) return i; var t = e.call(i), n, s = [], a; try { for (; (r === void 0 || r-- > 0) && !(n = t.next()).done; ) s.push(n.value); } catch (o) { a = { error: o }; } finally { try { n && !n.done && (e = t.return) && e.call(t); } finally { if (a) throw a.error; } } return s; } function at() { for (var i = [], r = 0; r < arguments.length; r++) i = i.concat(_e(arguments[r])); return i; } var W = function(i) { return typeof i > "u"; }, pt = /* @__PURE__ */ (function() { function i(e, t) { var n, s; if (this._canceled = !1, t) try { for (var a = de(Object.keys(t)), o = a.next(); !o.done; o = a.next()) { var u = o.value; this[u] = t[u]; } } catch (c) { n = { error: c }; } finally { try { o && !o.done && (s = a.return) && s.call(a); } finally { if (n) throw n.error; } } this.eventType = e; } var r = i.prototype; return r.stop = function() { this._canceled = !0; }, r.isCanceled = function() { return this._canceled; }, i; })(), tt = /* @__PURE__ */ (function() { function i() { this._eventHandler = {}; } var r = i.prototype; return r.trigger = function(e) { for (var t = [], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n]; var s = e instanceof pt ? e.eventType : e, a = at(this._eventHandler[s] || []); return a.length <= 0 ? this : (e instanceof pt ? (e.currentTarget = this, a.forEach(function(o) { o(e); })) : a.forEach(function(o) { o.apply(void 0, at(t)); }), this); }, r.once = function(e, t) { var n = this; if (typeof e == "object" && W(t)) { var s = e; for (var a in s) this.once(a, s[a]); return this; } else if (typeof e == "string" && typeof t == "function") { var o = function() { for (var u = [], c = 0; c < arguments.length; c++) u[c] = arguments[c]; t.apply(void 0, at(u)), n.off(e, o); }; this.on(e, o); } return this; }, r.hasOn = function(e) { return !!this._eventHandler[e]; }, r.on = function(e, t) { if (typeof e == "object" && W(t)) { var n = e; for (var s in n) this.on(s, n[s]); return this; } else if (typeof e == "string" && typeof t == "function") { var a = this._eventHandler[e]; W(a) && (this._eventHandler[e] = [], a = this._eventHandler[e]), a.push(t); } return this; }, r.off = function(e, t) { if (W(e)) return this._eventHandler = {}, this; if (W(t)) { if (typeof e == "string") return delete this._eventHandler[e], this; var n = e; for (var s in n) this.off(s, n[s]); return this; } var a = this._eventHandler[e]; if (a) { for (var o = a.length, u = 0; u < o; ++u) if (a[u] === t) { a.splice(u, 1), o <= 1 && delete this._eventHandler[e]; break; } } return this; }, i.VERSION = "3.0.5", i; })(), R = pt; function Z(i) { return Object.keys(i); } function ge(i) { return i.replace(/[\s-_]([a-z])/g, function(r, e) { return e.toUpperCase(); }); } function pe(i) { return typeof i == "function"; } var mt = "__observers__", $ = "__computed__", ot = 1, ut = "__CFCS_DETECTED_DEPENDENCIES__", Et = function(i, r) { return Et = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) { e.__proto__ = t; } || function(e, t) { for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]); }, Et(i, r); }; function me(i, r) { if (typeof r != "function" && r !== null) throw new TypeError("Class extends value " + String(r) + " is not a constructor or null"); Et(i, r); function e() { this.constructor = i; } i.prototype = r === null ? Object.create(r) : (e.prototype = r.prototype, new e()); } function jt(i, r, e) { if (arguments.length === 2) for (var t = 0, n = r.length, s; t < n; t++) (s || !(t in r)) && (s || (s = Array.prototype.slice.call(r, 0, t)), s[t] = r[t]); return i.concat(s || Array.prototype.slice.call(r)); } function Tt() { Object[ut] = Object[ut] || {}; var i = Object[ut]; return i[ot] = i[ot] || [], i[ot]; } function Ee() { var i = Tt(); return i[i.length - 1]; } function be(i) { var r = Tt(), e = [], t = { host: i, observers: e, push: function(n) { i !== n && e.indexOf(n) === -1 && e.push(n); } }; return r.push(t), t; } function ye() { var i = Tt(); return i.pop(); } var Zt = /* @__PURE__ */ (function() { function i(e) { this._emitter = new tt(), this._current = e; } var r = i.prototype; return Object.defineProperty(r, "current", { /** * return the current value. */ get: function() { var e = Ee(); return e?.push(this), this._current; }, set: function(e) { this._setCurrent(e); }, enumerable: !1, configurable: !0 }), r.subscribe = function(e) { return this.current, this._emitter.on("update", e), this; }, r.unsubscribe = function(e) { return this._emitter.off("update", e), this; }, r._setCurrent = function(e) { var t = this._current, n = e !== t; this._current = e, n && this._emitter.trigger("update", e, t); }, r.toString = function() { return "".concat(this.current); }, r.valueOf = function() { return this.current; }, i; })(), xe = /* @__PURE__ */ (function(i) { me(r, i); function r(t) { var n = i.call(this) || this; return n._computedCallback = t, n._registered = [], n._onCheckUpdate = function() { n._setCurrent(n.current); }, n._current = n.current, n; } var e = r.prototype; return Object.defineProperty(e, "current", { get: function() { var t = this; be(this); var n = this._computedCallback(), s = ye(); return this._registered.forEach(function(a) { a.unsubscribe(t._onCheckUpdate); }), s.observers.forEach(function(a) { a.subscribe(t._onCheckUpdate); }), this._registered = s.observers, n; }, enumerable: !1, configurable: !0 }), r; })(Zt); function Lt(i, r, e) { e === void 0 && (e = r); var t = { configurable: !0, get: function() { return D(this, e).current; }, set: function(n) { D(this, e, n).current = n; } }; Object.defineProperty(i, r, t), e !== r && Object.defineProperty(i, e, { configurable: !0, get: function() { return D(this, e).current; } }); } function Jt() { for (var i = [], r = 0; r < arguments.length; r++) i[r] = arguments[r]; return i.length > 1 ? Lt(i[0], i[1]) : function(e, t) { return Lt(e, t, i[0]); }; } function ct() { for (var i = [], r = 0; r < arguments.length; r++) i[r] = arguments[r]; return Jt.apply(void 0, i); } function Me(i) { i.subscribe = function(r, e) { this[r], D(this, r).subscribe(e); }, i.unsubscribe = function(r, e) { var t = this; if (!r) { Z(et(this)).forEach(function(n) { t.unsubscribe(n); }); return; } r in this && D(this, r).unsubscribe(e); }; } function te(i) { var r = i.prototype; Me(r); } function Oe(i) { return new Zt(i); } function Pe(i) { return new xe(i); } function we(i, r) { var e = {}; return r && r.forEach(function(t) { e[t] = function() { for (var n = [], s = 0; s < arguments.length; s++) n[s] = arguments[s]; var a = i.current || i.value; return a[t].apply(a, n); }; }), e; } function Se(i) { var r = {}; return Object.defineProperty(i, mt, { get: function() { return r; } }), r; } function et(i, r) { var e, t; i[mt] || Se(i); var n = i[mt]; if (!r) { var s = (t = (e = i?.constructor) === null || e === void 0 ? void 0 : e.prototype) === null || t === void 0 ? void 0 : t[$]; s && s.forEach(function(a) { !(a in n) && a in i && i[a]; }); } return n; } function D(i, r, e) { var t = et(i); return t[r] || (t[r] = Oe(e)), t[r]; } function Te(i, r) { var e = pe(i) ? { setup: i } : i; function t() { var d, p, x, S, I; return (I = (x = (d = void 0) !== null && d !== void 0 ? d : (p = e.props) === null || p === void 0 ? void 0 : p.call(e)) !== null && x !== void 0 ? x : (S = e.data) === null || S === void 0 ? void 0 : S.call(e)) !== null && I !== void 0 ? I : {}; } var n = new tt(), s = [], a = [], o = [], u = [], c = { current: null }, h = [], v = null, l = [], f = [], _ = function(d) { s.push(d); }, m = function(d) { a.push(d); }, b = function(d) { o.push(d); }, E = function(d) { u.push(d); }, g = function(d) { for (var p = [], x = 1; x < arguments.length; x++) p[x - 1] = arguments[x]; n.trigger.apply(n, jt([d], p, !1)); }, y = function(d) { v = d; }, O = function(d) { l = d; }, P = function(d) { f = d; }; return e.setup && (c.current = e.setup({ getProps: t, setInitialState: y, setEvents: O, setMethods: P, onMounted: _, onDestroy: b, onInit: m, emit: g, on: E }) || null), e.created && (c.current = e.created(t()) || null), e.events && O(e.events), e.state && y(e.state), e.methods && P(e.methods), e.mounted && _(e.mounted), e.destroy && o.push(e.destroy), e.init && a.push(e.init), e.on && u.push(function(d, p, x) { var S = e.on(d, p, x); return function() { var I; S && S(), (I = e.off) === null || I === void 0 || I.call(e, d, p, x); }; }), { events: function() { return l; }, state: function() { var d = c.current; if (v) return v; if (d) { var p = et(d); y(Z(p).reduce(function(x, S) { return x[S] = p[S].current, x; }, {})); } return v || {}; }, instance: function() { return c.current; }, mounted: function() { var d = t(); s.forEach(function(p) { c.current = p(d, c.current) || c.current; }); }, init: function() { var d = c.current, p = t(); h = l.map(function(x) { var S = function() { for (var H, Rt = [], X = 0; X < arguments.length; X++) Rt[X] = arguments[X]; (H = n).trigger.apply(H, jt([x], Rt, !1)); }, I = c.current; return u.map(function(H) { return H(I, x, S); }).filter(Boolean); }), a.forEach(function(x) { x(d, p); }); }, destroy: function() { h.forEach(function(x) { x.forEach(function(S) { S(); }); }), n.off(); var d = c.current, p = t(); o.forEach(function(x) { x(d, p); }); }, methods: function() { return we(c, f); }, on: function(d, p) { n.on(d, p); }, off: function(d, p) { n.off(d, p); } }; } function Ie(i, r, e) { var t = e.get; function n() { var o = et(this, !0); return r in o || (o[r] = Pe(t.bind(this))), D(this, r).current; } var s = { configurable: !0, get: n }; i[$] || (i[$] = []); var a = i[$]; return a.indexOf(r) === -1 && a.push(r), Object.defineProperty(i, r, s), s; } /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var bt = function(i, r) { return bt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) { e.__proto__ = t; } || function(e, t) { for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); }, bt(i, r); }; function V(i, r) { bt(i, r); function e() { this.constructor = i; } i.prototype = r === null ? Object.create(r) : (e.prototype = r.prototype, new e()); } var M = function() { return M = Object.assign || function(r) { for (var e, t = 1, n = arguments.length; t < n; t++) { e = arguments[t]; for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && (r[s] = e[s]); } return r; }, M.apply(this, arguments); }; function yt(i, r, e, t) { var n = arguments.length, s = n < 3 ? r : t === null ? t = Object.getOwnPropertyDescriptor(r, e) : t, a; if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(i, r, e, t); else for (var o = i.length - 1; o >= 0; o--) (a = i[o]) && (s = (n < 3 ? a(s) : n > 3 ? a(r, e, s) : a(r, e)) || s); return n > 3 && s && Object.defineProperty(r, e, s), s; } var w; typeof window > "u" ? w = { navigator: { userAgent: "" } } : w = window; var k = 1, De = 2, Ae = 4, A = 6, Ce = 8, Re = 16, C = 24, nt = 30, J = "left", xt = "right", Mt = "middle", ee = { 1: J, 2: Mt, 3: xt }, It = "any", ze = "none", je = "shift", Le = "ctrl", Ve = "alt", We = "meta", Be = 16, Ne = 30, Vt = "ontouchstart" in w && ve().browser.name === "safari", Ye = (function() { if (typeof document > "u") return ""; for (var i = (document.head || document.getElementsByTagName("head")[0]).style, r = ["transform", "webkitTransform", "msTransform", "mozTransform"], e = 0, t = r.length; e < t; e++) if (r[e] in i) return r[e]; return ""; })(), Ot = { "-webkit-user-select": "none", "-ms-user-select": "none", "-moz-user-select": "none", "user-select": "none", "-webkit-user-drag": "none" }, Wt = function(i) { for (var r = [], e = 0, t = i.length; e < t; e++) r.push(i[e]); return r; }, Dt = function(i, r) { r === void 0 && (r = !1); var e; if (typeof i == "string") { var t = i.match(/^<([a-z]+)\s*([^>]*)>/); if (t) { var n = document.createElement("div"); n.innerHTML = i, e = Wt(n.childNodes); } else e = Wt(document.querySelectorAll(i)); r || (e = e.length >= 1 ? e[0] : void 0); } else i === w ? e = i : "value" in i || "current" in i ? e = i.value || i.current : i.nodeName && (i.nodeType === 1 || i.nodeType === 9) ? e = i : "jQuery" in w && i instanceof jQuery || i.constructor.prototype.jquery ? e = r ? i.toArray() : i.get(0) : Array.isArray(i) && (e = i.map(function(s) { return Dt(s); }), r || (e = e.length >= 1 ? e[0] : void 0)); return e; }, z = w.requestAnimationFrame || w.webkitRequestAnimationFrame, N = w.cancelAnimationFrame || w.webkitCancelAnimationFrame; if (z && !N) { var ft = {}, Fe = z; z = function(i) { var r = function(t) { ft[e] && i(t); }, e = Fe(r); return ft[e] = !0, e; }, N = function(i) { delete ft[i]; }; } else z && N || (z = function(i) { return w.setTimeout(function() { i(w.performance && w.performance.now && w.performance.now() || (/* @__PURE__ */ new Date()).getTime()); }, 16); }, N = w.clearTimeout); var ke = function(i) { return z(i); }, He = function(i) { N(i); }, T = function(i, r) { var e = {}; for (var t in i) t && (e[t] = r(i[t], t)); return e; }, ne = function(i, r) { var e = {}; for (var t in i) t && r(i[t], t) && (e[t] = i[t]); return e; }, At = function(i, r) { for (var e in i) if (e && !r(i[e], e)) return !1; return !0; }, Y = function(i, r) { return At(i, function(e, t) { return e === r[t]; }); }, lt = {}, re = function(i, r) { return lt[r] || (lt[r] = Ue(r)), lt[r](i); }, Bt = function(i, r) { return !i || !r ? i : T(i, function(e, t) { return re(e, typeof r == "number" ? r : r[t]); }); }, G = function(i) { if (!isFinite(i)) return 0; var r = "".concat(i); if (r.indexOf("e") >= 0) { for (var e = 0, t = 1; Math.round(i * t) / t !== i; ) t *= 10, e++; return e; } return r.indexOf(".") >= 0 ? r.length - r.indexOf(".") - 1 : 0; }, Xe = function(i) { return 1 / Math.pow(10, i); }, Ue = function(i) { var r = i < 1 ? Math.pow(10, G(i)) : 1; return function(e) { return i === 0 ? 0 : Math.round(Math.round(e / i) * i * r) / r; }; }, Ke = function(i, r) { return Math.atan2(r, i) * 180 / Math.PI; }, qe = function(i) { var r = !0; return Object.keys(Ot).forEach(function(e) { (!i || i[e] !== Ot[e]) && (r = !1); }), r; }, ie = function(i, r) { return i && r ? nt : i ? A : r ? C : k; }, j = function(i, r, e) { return e ? !!(r === nt || r & i && e & i) : !!(r & i); }, $e = function(i, r, e) { var t, n = (t = {}, t[k] = "auto", t[nt] = "none", t[C] = "pan-x", t[A] = "pan-y", t), s = {}; if (i && i.style) { var a = r.touchAction ? r.touchAction : n[e], o = M(M({}, Ot), { "touch-action": i.style["touch-action"] === "none" ? "none" : a }); Object.keys(o).forEach(function(u) { s[u] = i.style[u]; }), Object.keys(o).forEach(function(u) { i.style[u] = o[u]; }); } return s; }, Ge = function(i, r) { i && i.style && r && Object.keys(r).forEach(function(e) { i.style[e] = r[e]; }); }, Qe = /* @__PURE__ */ (function() { function i(e) { this._axes = e, this.holdingCount = 0; } var r = i.prototype; return r.hold = function(e, t) { var n = this._getRoundPos(e).roundPos; this._axes.trigger(new R("hold", { pos: n, input: t.input || null, inputEvent: t.event || null, isTrusted: !0 })); }, r.triggerRelease = function(e) { var t = this._getRoundPos(e.destPos, e.depaPos), n = t.roundPos, s = t.roundDepa; e.destPos = n, e.depaPos = s, e.setTo = this._createUserControll(e.destPos, e.duration), this._axes.trigger(new R("release", M(M({}, e), { bounceRatio: this._getBounceRatio(n) }))); }, r.triggerChange = function(e, t, n, s) { var a = this; s === void 0 && (s = !1); var o = this.animationManager, u = o.axisManager, c = o.getEventInfo(), h = this._getRoundPos(e, t), v = h.roundPos, l = h.roundDepa, f = u.moveTo(v, l), _ = n?.event || c?.event || null, m = { pos: f.pos, delta: f.delta, bounceRatio: this._getBounceRatio(f.pos), holding: s, inputEvent: _, isTrusted: !!_, input: n?.input || c?.input || null, set: _ ? this._createUserControll(f.pos) : function() { } // eslint-disable-line @typescript-eslint/no-empty-function }, b = new R("change", m); return this._axes.trigger(b), Object.keys(f.pos).forEach(function(E) { var g = f.pos[E]; D(a._axes, E, g).current = g; }), _ && u.set(m.set().destPos), !b.isCanceled(); }, r.triggerAnimationStart = function(e) { var t = this._getRoundPos(e.destPos, e.depaPos), n = t.roundPos, s = t.roundDepa; e.destPos = n, e.depaPos = s, e.setTo = this._createUserControll(e.destPos, e.duration); var a = new R("animationStart", e); return this._axes.trigger(a), !a.isCanceled(); }, r.triggerAnimationEnd = function(e) { e === void 0 && (e = !1), this._axes.trigger(new R("animationEnd", { isTrusted: e })); }, r.triggerFinish = function(e) { e === void 0 && (e = !1), this._axes.trigger(new R("finish", { isTrusted: e })); }, r.setAnimationManager = function(e) { this.animationManager = e; }, r.destroy = function() { this._axes.off(); }, r._createUserControll = function(e, t) { t === void 0 && (t = 0); var n = { destPos: M({}, e), duration: t }; return function(s, a) { return s && (n.destPos = M({}, s)), a !== void 0 && (n.duration = a), n; }; }, r._getRoundPos = function(e, t) { var n = this._axes.options.round; return { roundPos: Bt(e, n), roundDepa: Bt(t, n) }; }, r._getBounceRatio = function(e) { return this._axes.axisManager.map(e, function(t, n) { return t < n.range[0] && n.bounce[0] !== 0 ? (n.range[0] - t) / n.bounce[0] : t > n.range[1] && n.bounce[1] !== 0 ? (t - n.range[1]) / n.bounce[1] : 0; }); }, yt([Jt], i.prototype, "holdingCount", void 0), i; })(), Ze = /* @__PURE__ */ (function() { function i(e) { this._options = e, this._prevented = !1; } var r = i.prototype; return r.isInterrupting = function() { return this._options.interruptable || this._prevented; }, r.isInterrupted = function() { return !this._options.interruptable && this._prevented; }, r.setInterrupt = function(e) { this._options.interruptable || (this._prevented = e); }, i; })(), se = function(i, r, e, t) { var n = i, s = [e[0] ? r[0] : t ? r[0] - t[0] : r[0], e[1] ? r[1] : t ? r[1] + t[1] : r[1]]; return n = Math.max(s[0], n), n = Math.min(s[1], n), n; }, ae = function(i, r) { return i < r[0] || i > r[1]; }, Je = function(i, r, e, t) { return !t[0] && i === r[0] - e[0] || !t[1] && i === r[1] + e[1]; }, tn = function(i, r) { var e = Math.sqrt(i / r * 2); return e < 100 ? 0 : e; }, Nt = function(i, r, e) { return e[1] && i > r[1] || e[0] && i < r[0]; }, F = function(i, r, e) { var t = i, n = r[0], s = r[1], a = s - n; return e[1] && i > s && (t = (t - s) % a + n), e[0] && i < n && (t = (t - n) % a + s), t; }, en = /* @__PURE__ */ (function() { function i(e) { var t = this; this._axis = e, this._complementOptions(), this._pos = Object.keys(this._axis).reduce(function(n, s) { return n[s] = t._axis[s].startPos, n; }, {}); } var r = i.prototype; return r.getDelta = function(e, t) { var n = this.get(e); return T(this.get(t), function(s, a) { return s - n[a]; }); }, r.get = function(e) { var t = this; return e && Array.isArray(e) ? e.reduce(function(n, s) { return s && s in t._pos && (n[s] = t._pos[s]), n; }, {}) : M(M({}, this._pos), e || {}); }, r.moveTo = function(e, t) { t === void 0 && (t = this._pos); var n = T(this._pos, function(s, a) { return a in e && a in t ? e[a] - t[a] : 0; }); return this.set(this.map(e, function(s, a) { return a ? F(s, a.range, a.circular) : 0; })), { pos: M({}, this._pos), delta: n }; }, r.set = function(e) { for (var t in e) t && t in this._pos && (this._pos[t] = e[t]); }, r.every = function(e, t) { var n = this._axis; return At(e, function(s, a) { return t(s, n[a], a); }); }, r.filter = function(e, t) { var n = this._axis; return ne(e, function(s, a) { return t(s, n[a], a); }); }, r.map = function(e, t) { var n = this._axis; return T(e, function(s, a) { return t(s, n[a], a); }); }, r.isOutside = function(e) { return !this.every(e ? this.get(e) : this._pos, function(t, n) { return !ae(t, n.range); }); }, r.getAxisOptions = function(e) { return this._axis[e]; }, r.setAxis = function(e) { var t = this; Object.keys(e).forEach(function(n) { if (!t._axis[n]) throw new Error("Axis ".concat(n, " does not exist in Axes instance")); t._axis[n] = M(M({}, t._axis[n]), e[n]); }), this._complementOptions(); }, r._complementOptions = function() { var e = this; Object.keys(this._axis).forEach(function(t) { e._axis[t] = M({ range: [0, 100], startPos: e._axis[t].range[0], bounce: [0, 0], circular: [!1, !1] }, e._axis[t]), ["bounce", "circular"].forEach(function(n) { var s = e._axis, a = s[t][n]; /string|number|boolean/.test(typeof a) && (s[t][n] = [a, a]); }); }); }, i; })(), nn = "ontouchstart" in w, Q = "PointerEvent" in w, rn = "MSPointerEvent" in w, sn = Q || rn, oe = function(i, r) { return !!(!r || r.indexOf(It) > -1 || r.indexOf(ze) > -1 && !i.shiftKey && !i.ctrlKey && !i.altKey && !i.metaKey || r.indexOf(je) > -1 && i.shiftKey || r.indexOf(Le) > -1 && i.ctrlKey || r.indexOf(Ve) > -1 && i.altKey || r.indexOf(We) > -1 && i.metaKey); }, rt = /* @__PURE__ */ (function() { function i() { var e = this; this._stopContextMenu = function(t) { t.preventDefault(), w.removeEventListener("contextmenu", e._stopContextMenu); }; } var r = i.prototype; return r.extendEvent = function(e) { var t, n = this.prevEvent, s = this._getCenter(e), a = n ? this._getMovement(e) : { x: 0, y: 0 }, o = n ? this._getScale(e) : 1, u = n ? Ke(s.x - n.center.x, s.y - n.center.y) : 0, c = n ? n.deltaX + a.x : a.x, h = n ? n.deltaY + a.y : a.y, v = a.x, l = a.y, f = this._latestInterval, _ = Date.now(), m = f ? _ - f.timestamp : 0, b = n ? n.velocityX : 0, E = n ? n.velocityY : 0, g = n ? n.directionX : 1, y = n ? n.directionY : 1; return v > 0 ? g = 1 : v < 0 && (g = -1), l > 0 ? y = 1 : l < 0 && (y = -1), (!f || m >= Be) && (f && (t = [(c - f.deltaX) / m, (h - f.deltaY) / m], b = t[0], E = t[1]), this._latestInterval = { timestamp: _, deltaX: c, deltaY: h }), { srcEvent: e, scale: o, angle: u, center: s, deltaX: c, deltaY: h, offsetX: v, offsetY: l, directionX: g, directionY: y, velocityX: b, velocityY: E, preventSystemEvent: !0 }; }, r._getDistance = function(e, t) { var n = t.clientX - e.clientX, s = t.clientY - e.clientY; return Math.sqrt(n * n + s * s); }, r._getButton = function(e) { var t = { 1: J, 2: xt, 4: Mt }, n = this._isTouchEvent(e) ? J : t[e.buttons]; return n || null; }, r._isTouchEvent = function(e) { return e.type && e.type.indexOf("touch") > -1; }, r._isValidButton = function(e, t) { return t.indexOf(e) > -1; }, r._isValidEvent = function(e, t, n) { return (!t || oe(e, t)) && (!n || this._isValidButton(this._getButton(e), n)); }, r._preventMouseButton = function(e, t) { t === xt ? w.addEventListener("contextmenu", this._stopContextMenu) : t === Mt && e.preventDefault(); }, i; })(), an = /* @__PURE__ */ (function(i) { V(r, i); function r() { var t = i !== null && i.apply(this, arguments) || this; return t.start = ["mousedown"], t.move = ["mousemove"], t.end = ["mouseup"], t; } var e = r.prototype; return e.onEventStart = function(t, n, s) { var a = this._getButton(t); return this._isValidEvent(t, n, s) ? (this._preventMouseButton(t, a), this.extendEvent(t)) : null; }, e.onEventMove = function(t, n, s) { return this._isValidEvent(t, n, s) ? this.extendEvent(t) : null; }, e.onEventEnd = function() { }, e.onRelease = function() { this.prevEvent = null; }, e.getTouches = function(t, n) { return n && this._isValidButton(ee[t.which], n) && this.end.indexOf(t.type) === -1 ? 1 : 0; }, e._getScale = function() { return 1; }, e._getCenter = function(t) { return { x: t.clientX, y: t.clientY }; }, e._getMovement = function(t) { var n = this.prevEvent.srcEvent; return { x: t.clientX - n.clientX, y: t.clientY - n.clientY }; }, r; })(rt), on = /* @__PURE__ */ (function(i) { V(r, i); function r() { var t = i !== null && i.apply(this, arguments) || this; return t.start = ["touchstart"], t.move = ["touchmove"], t.end = ["touchend", "touchcancel"], t; } var e = r.prototype; return e.onEventStart = function(t, n) { return this._baseTouches = t.touches, this._isValidEvent(t, n) ? this.extendEvent(t) : null; }, e.onEventMove = function(t, n) { return this._isValidEvent(t, n) ? this.extendEvent(t) : null; }, e.onEventEnd = function(t) { this._baseTouches = t.touches; }, e.onRelease = function() { this.prevEvent = null, this._baseTouches = null; }, e.getTouches = function(t) { return t.touches.length; }, e._getScale = function(t) { return t.touches.length !== 2 || this._baseTouches.length < 2 ? null : this._getDistance(t.touches[0], t.touches[1]) / this._getDistance(this._baseTouches[0], this._baseTouches[1]); }, e._getCenter = function(t) { return { x: t.touches[0].clientX, y: t.touches[0].clientY }; }, e._getMovement = function(t) { var n = this.prevEvent.srcEvent; return t.touches[0].identifier !== n.touches[0].identifier ? { x: 0, y: 0 } : { x: t.touches[0].clientX - n.touches[0].clientX, y: t.touches[0].clientY - n.touches[0].clientY }; }, r; })(rt), un = /* @__PURE__ */ (function(i) { V(r, i); function r() { var t = i !== null && i.apply(this, arguments) || this; return t.start = Q ? ["pointerdown"] : ["MSPointerDown"], t.move = Q ? ["pointermove"] : ["MSPointerMove"], t.end = Q ? ["pointerup", "pointercancel"] : ["MSPointerUp", "MSPointerCancel"], t._firstInputs = [], t._recentInputs = [], t; } var e = r.prototype; return e.onEventStart = function(t, n, s) { var a = this._getButton(t); return this._isValidEvent(t, n, s) ? (this._preventMouseButton(t, a), this._updatePointerEvent(t), this.extendEvent(t)) : null; }, e.onEventMove = function(t, n, s) { return this._isValidEvent(t, n, s) ? (this._updatePointerEvent(t), this.extendEvent(t)) : null; }, e.onEventEnd = function(t) { this._removePointerEvent(t); }, e.onRelease = function() { this.prevEvent = null, this._firstInputs = [], this._recentInputs = []; }, e.getTouches = function() { return this._recentInputs.length; }, e._getScale = function() { return this._recentInputs.length !== 2 ? null : this._getDistance(this._recentInputs[0], this._recentInputs[1]) / this._getDistance(this._firstInputs[0], this._firstInputs[1]); }, e._getCenter = function(t) { return { x: t.clientX, y: t.clientY }; }, e._getMovement = function(t) { var n = this.prevEvent.srcEvent; return t.pointerId !== n.pointerId ? { x: 0, y: 0 } : { x: t.clientX - n.clientX, y: t.clientY - n.clientY }; }, e._updatePointerEvent = function(t) { var n = this, s = !1; this._recentInputs.forEach(function(a, o) { a.pointerId === t.pointerId && (s = !0, n._recentInputs[o] = t); }), s || (this._firstInputs.push(t), this._recentInputs.push(t)); }, e._removePointerEvent = function(t) { this._firstInputs = this._firstInputs.filter(function(n) { return n.pointerId !== t.pointerId; }), this._recentInputs = this._recentInputs.filter(function(n) { return n.pointerId !== t.pointerId; }); }, r; })(rt), cn = /* @__PURE__ */ (function(i) { V(r, i); function r() { var t = i !== null && i.apply(this, arguments) || this; return t.start = ["mousedown", "touchstart"], t.move = ["mousemove", "touchmove"], t.end = ["mouseup", "touchend", "touchcancel"], t; } var e = r.prototype; return e.onEventStart = function(t, n, s) { var a = this._getButton(t); return this._isTouchEvent(t) && (this._baseTouches = t.touches), this._isValidEvent(t, n, s) ? (this._preventMouseButton(t, a), this.extendEvent(t)) : null; }, e.onEventMove = function(t, n, s) { return this._isValidEvent(t, n, s) ? this.extendEvent(t) : null; }, e.onEventEnd = function(t) { this._isTouchEvent(t) && (this._baseTouches = t.touches); }, e.onRelease = function() { this.prevEvent = null, this._baseTouches = null; }, e.getTouches = function(t, n) { return this._isTouchEvent(t) ? t.touches.length : this._isValidButton(ee[t.which], n) && this.end.indexOf(t.type) === -1 ? 1 : 0; }, e._getScale = function(t) { return this._isTouchEvent(t) ? t.touches.length !== 2 || this._baseTouches.length < 2 ? 1 : this._getDistance(t.touches[0], t.touches[1]) / this._getDistance(this._baseTouches[0], this._baseTouches[1]) : this.prevEvent.scale; }, e._getCenter = function(t) { return this._isTouchEvent(t) ? { x: t.touches[0].clientX, y: t.touches[0].clientY } : { x: t.clientX, y: t.clientY }; }, e._getMovement = function(t) { var n = this, s = this.prevEvent.srcEvent, a = [t, s].map(function(c) { return n._isTouchEvent(c) ? { id: c.touches[0].identifier, x: c.touches[0].clientX, y: c.touches[0].clientY } : { id: null, x: c.clientX, y: c.clientY }; }), o = a[0], u = a[1]; return o.id === u.id ? { x: o.x - u.x, y: o.y - u.y } : { x: 0, y: 0 }; }, r; })(rt), Ct = function(i, r) { return r.reduce(function(e, t, n) { return i[n] && (e[i[n]] = t), e; }, {}); }, Yt = function(i) { i === void 0 && (i = []); var r = !1, e = !1, t = !1; return i.forEach(function(n) { switch (n) { case "mouse": e = !0; break; case "touch": r = nn; break; case "pointer": t = sn; } }), t ? new un() : r && e ? new cn() : r ? new on() : e ? new an() : null; }; function Ft(i) { return i.indexOf("touch") > -1 ? { passive: !1 } : !1; } var fn = /* @__PURE__ */ (function() { function i(e) { var t = e.options, n = e.interruptManager, s = e.eventManager, a = e.axisManager, o = e.animationManager; this._isOutside = !1, this._moveDistance = null, this._isStopped = !1, this.options = t, this._interruptManager = n, this._eventManager = s, this._axisManager = a, this._animationManager = o; } var r = i.prototype; return r.get = function(e) { return this._axisManager.get(e.axes); }, r.hold = function(e, t) { if (!(this._interruptManager.isInterrupted() || !e.axes.length)) { var n = { input: e, event: t }; this._isStopped = !1, this._interruptManager.setInterrupt(!0), this._animationManager.stopAnimation(n), ++this._eventManager.holdingCount, this._moveDistance || this._eventManager.hold(this._axisManager.get(), n), this._isOutside = this._axisManager.isOutside(e.axes), this._moveDistance = this._axisManager.get(e.axes); } }, r.change = function(e, t, n, s) { if (!(this._isStopped || !this._interruptManager.isInterrupting() || this._axisManager.every(n, function(l) { return l === 0; }))) { var a = t.srcEvent ? t.srcEvent : t; if (!a.__childrenAxesAlreadyChanged) { var o = this._moveDistance || this._axisManager.get(e.axes), u; u = T(o, function(l, f) { return l + (n[f] || 0); }), this._moveDistance && (this._moveDistance = this._axisManager.map(u, function(l, f) { var _ = f.circular, m = f.range; return _ && (_[0] || _[1]) ? F(l, m, _) : l; })), this._isOutside && this._axisManager.every(o, function(l, f) { return !ae(l, f.range); }) && (this._isOutside = !1), o = this._atOutside(o), u = this._atOutside(u), (!this.options.nested || !this._isEndofAxis(n, o, u)) && (a.__childrenAxesAlreadyChanged = !0); var c = { input: e, event: t }; if (s) { var h = this._animationManager.getDuration(u, o); this._animationManager.animateTo(u, h, c); } else { var v = !this._eventManager.triggerChange(u, o, c, !0); v && (this._isStopped = !0, this._moveDistance = null, this._animationManager.finish(!1)); } } } }, r.release = function(e, t, n, s) { if (!(this._isStopped || !this._interruptManager.isInterrupting() || !this._moveDistance)) { var a = t.srcEvent ? t.srcEvent : t; a.__childrenAxesAlreadyReleased && (n = n.map(function() { return 0; })); var o = this._axisManager.get(e.axes), u = this._axisManager.get(), c = this._animationManager.getDisplacement(n), h = Ct(e.axes, c), v = this._axisManager.get(this._axisManager.map(h, function(E, g, y) { return g.circular && (g.circular[0] || g.circular[1]) ? o[y] + E : se(o[y] + E, g.range, g.circular, g.bounce); })); a.__childrenAxesAlreadyReleased = !0; var l = this._animationManager.getDuration(v, o, s); l === 0 && (v = M({}, u)); var f = { depaPos: u, destPos: v, duration: l, delta: this._axisManager.getDelta(u, v), inputEvent: t, input: e, isTrusted: !0 }; --this._eventManager.holdingCount, this._eventManager.triggerRelease(f), this._eventManager.holdingCount === 0 && (this._moveDistance = null); var _ = this._animationManager.getUserControl(f), m = Y(_.destPos, u), b = { input: e, event: t }; m || _.duration === 0 ? (m || this._eventManager.triggerChange(_.destPos, u, b, !0), this._interruptManager.setInterrupt(!1), this._axisManager.isOutside() ? this._animationManager.restore(b) : this._eventManager.triggerFinish(!0)) : this._animationManager.animateTo(_.destPos, _.duration, b); } }, r._atOutside = function(e) { var t = this; return this._isOutside ? this._axisManager.map(e, function(n, s) { var a = s.range[0] - s.bounce[0], o = s.range[1] + s.bounce[1]; return n > o ? o : n < a ? a : n; }) : this._axisManager.map(e, function(n, s) { var a = s.range[0], o = s.range[1], u = s.bounce, c = s.circular; return c[0] && n < a || c[1] && n > o ? n : n < a ? a - t._animationManager.interpolate(a - n, u[0]) : n > o ? o + t._animationManager.interpolate(n - o, u[1]) : n; }); }, r._isEndofAxis = function(e, t, n) { return this._axisManager.every(t, function(s, a, o) { return e[o] === 0 || t[o] === n[o] && Je(s, a.range, a.bounce, a.circular); }); }, i; })(), ht = function(i, r, e) { return Math.max(Math.min(i, e), r); }, ln = /* @__PURE__ */ (function() { function i(e) { var t = e.options, n = e.interruptManager, s = e.eventManager, a = e.axisManager; this._options = t, this.interruptManager = n, this.eventManager = s, this.axisManager = a, this.animationEnd = this.animationEnd.bind(this); } var r = i.prototype; return r.getDuration = function(e, t, n) { var s = this, a; if (typeof n < "u") a = n; else { var o = T(t, function(u, c) { return tn(Math.abs(u - e[c]), s._options.deceleration); }); a = Object.keys(o).reduce(function(u, c) { return Math.max(u, o[c]); }, -1 / 0); } return ht(a, this._options.minimumDuration, this._options.maximumDuration); }, r.getDisplacement = function(e) { var t = Math.pow(e.reduce(function(s, a) { return s + a * a; }, 0), 1 / e.length), n = Math.abs(t / -this._options.deceleration); return e.map(function(s) { return s / 2 * n; }); }, r.stopAnimation = function(e) { if (this._animateParam) { var t = this.axisManager.get(), n = this.axisManager.map(t, function(s, a) { return F(s, a.range, a.circular); }); At(n, function(s, a) { return t[a] === s; }) || this.eventManager.triggerChange(n, t, e, !!e), this._animateParam = null, this._raf && He(this._raf), this._raf = null, this.eventManager.triggerAnimationEnd(!!e?.event); } }, r.getEventInfo = function() { return this._animateParam && this._animateParam.input && this._animateParam.inputEvent ? { input: this._animateParam.input, event: this._animateParam.inputEvent } : null; }, r.restore = function(e) { var t = this.axisManager.get(), n = this.axisManager.map(t, function(s, a) { return Math.min(a.range[1], Math.max(a.range[0], s)); }); this.stopAnimation(), this.animateTo(n, this.getDuration(t, n), e); }, r.animationEnd = function() { var e = this.getEventInfo(); this._animateParam = null; var t = this.axisManager.filter(this.axisManager.get(), function(n, s) { return Nt(n, s.range, s.circular); }); Object.keys(t).length > 0 && this.setTo(this.axisManager.map(t, function(n, s) { return F(n, s.range, s.circular); })), this.interruptManager.setInterrupt(!1), this.eventManager.triggerAnimationEnd(!!e), this.axisManager.isOutside() ? this.restore(e) : this.finish(!!e); }, r.finish = function(e) { this._animateParam = null, this.interruptManager.setInterrupt(!1), this.eventManager.triggerFinish(e); }, r.getUserControl = function(e) { var t = e.setTo(); return t.destPos = this.axisManager.get(t.destPos), t.duration = ht(t.duration, this._options.minimumDuration, this._options.maximumDuration), t; }, r.animateTo = function(e, t, n) { var s = this; this.stopAnimation(); var a = this._createAnimationParam(e, t, n), o = M({}, a.depaPos), u = this.eventManager.triggerAnimationStart(a), c = this.getUserControl(a); if (!u && this.axisManager.every(c.destPos, function(v, l) { return Nt(v, l.range, l.circular); }) && console.warn("You can't stop the 'animation' event when 'circular' is true."), u && !Y(c.destPos, o)) { var h = n?.event || null; this._animateLoop({ depaPos: o, destPos: c.destPos, duration: c.duration, delta: this.axisManager.getDelta(o, c.destPos), isTrusted: !!h, inputEvent: h, input: n?.input || null }, function() { return s.animationEnd(); }); } }, r.setTo = function(e, t) { t === void 0 && (t = 0); var n = Object.keys(e), s = this.axisManager.get(n); if (Y(e, s)) return this; this.interruptManager.setInterrupt(!0); var a = ne(e, function(o, u) { return s[u] !== o; }); return Object.keys(a).length ? (a = this.axisManager.map(a, function(o, u) { var c = u.range, h = u.circular; return h && (h[0] || h[1]) ? o : se(o, c, h); }), Y(a, s) ? this : (t > 0 ? this.animateTo(a, t) : (this.stopAnimation(), this.eventManager.triggerChange(a), this.finish(!1)), this)) : this; }, r.setBy = function(e, t) { return t === void 0 && (t = 0), this.setTo(T(this.axisManager.get(Object.keys(e)), function(n, s) { return n + e[s]; }), t); }, r.setOptions = function(e) { this._options = M(M({}, this._options), e); }, r._createAnimationParam = function(e, t, n) { var s = this.axisManager.get(), a = e, o = n?.event || null; return { depaPos: s, destPos: a, duration: ht(t, this._options.minimumDuration, this._options.maximumDuration), delta: this.axisManager.getDelta(s, a), inputEvent: o, input: n?.input || null, isTrusted: !!o, done: this.animationEnd }; }, r._animateLoop = function(e, t) { var n = this; if (e.duration) { this._animateParam = M(M({}, e), { startTime: (/* @__PURE__ */ new Date()).getTime() }); var s = T(e.destPos, function(u) { return u; }), a = this._initState(this._animateParam), o = function() { n._raf = null; var u = n._animateParam, c = n._getNextState(a), h = !n.eventManager.triggerChange(c.pos, a.pos); if (a = c, c.finished) { u.destPos = n.