react-calendar-timeline
Version:
react-calendar-timeline
947 lines (946 loc) • 259 kB
JavaScript
import { jsx as U, jsxs as Ve } from "react/jsx-runtime";
import se, { createElement as Rt, useContext as wi, Component as xe, createRef as Si, PureComponent as ws } from "react";
function Hn(s) {
let i = 0, a = 0, u = !0;
for (; s; )
!s.offsetParent && s.tagName === "BODY" && s.scrollLeft === 0 && s.scrollTop === 0 && (s = document.scrollingElement || s), i += s.offsetLeft - (u ? 0 : s.scrollLeft) + s.clientLeft, a += s.offsetTop - (u ? 0 : s.scrollTop) + s.clientTop, s = s.offsetParent, u = !1;
return { x: i, y: a };
}
function jt(s) {
if (s === document.body)
return { scrollLeft: 0, scrollTop: 0 };
{
const i = jt(s.parentNode);
return {
scrollLeft: s.scrollLeft + i.scrollLeft,
scrollTop: s.scrollTop + i.scrollTop
};
}
}
function At(s) {
if (s === document.body || !s.offsetParent)
return { offsetLeft: 0, offsetTop: 0 };
{
const i = At(s.offsetParent);
return {
offsetLeft: s.offsetLeft + i.offsetLeft,
offsetTop: s.offsetTop + i.offsetTop
};
}
}
var We = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Ze(s) {
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
}
var Lt = { exports: {} };
Lt.exports;
(function(s, i) {
(function(a, u) {
s.exports = u();
})(We, function() {
function a(t, e) {
var r = Object.keys(t);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(t);
e && (n = n.filter(function(o) {
return Object.getOwnPropertyDescriptor(t, o).enumerable;
})), r.push.apply(r, n);
}
return r;
}
function u(t) {
for (var e = 1; e < arguments.length; e++) {
var r = arguments[e] != null ? arguments[e] : {};
e % 2 ? a(Object(r), !0).forEach(function(n) {
x(t, n, r[n]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : a(Object(r)).forEach(function(n) {
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(r, n));
});
}
return t;
}
function f(t) {
return f = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
return typeof e;
} : function(e) {
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, f(t);
}
function v(t, e) {
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
}
function m(t, e) {
for (var r = 0; r < e.length; r++) {
var n = e[r];
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, C(n.key), n);
}
}
function y(t, e, r) {
return e && m(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
}
function x(t, e, r) {
return (e = C(e)) in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
}
function O(t, e) {
if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && P(t, e);
}
function $(t) {
return $ = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
return e.__proto__ || Object.getPrototypeOf(e);
}, $(t);
}
function P(t, e) {
return P = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, n) {
return r.__proto__ = n, r;
}, P(t, e);
}
function T(t) {
if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return t;
}
function _(t) {
var e = function() {
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
if (typeof Proxy == "function") return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
})), !0;
} catch {
return !1;
}
}();
return function() {
var r, n = $(t);
if (e) {
var o = $(this).constructor;
r = Reflect.construct(n, arguments, o);
} else r = n.apply(this, arguments);
return function(l, c) {
if (c && (typeof c == "object" || typeof c == "function")) return c;
if (c !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
return T(l);
}(this, r);
};
}
function M() {
return M = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(t, e, r) {
var n = function(l, c) {
for (; !Object.prototype.hasOwnProperty.call(l, c) && (l = $(l)) !== null; ) ;
return l;
}(t, e);
if (n) {
var o = Object.getOwnPropertyDescriptor(n, e);
return o.get ? o.get.call(arguments.length < 3 ? t : r) : o.value;
}
}, M.apply(this, arguments);
}
function C(t) {
var e = function(r, n) {
if (typeof r != "object" || r === null) return r;
var o = r[Symbol.toPrimitive];
if (o !== void 0) {
var l = o.call(r, n);
if (typeof l != "object") return l;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return String(r);
}(t, "string");
return typeof e == "symbol" ? e : e + "";
}
var z = function(t) {
return !(!t || !t.Window) && t instanceof t.Window;
}, N = void 0, G = void 0;
function Q(t) {
N = t;
var e = t.document.createTextNode("");
e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)), G = t;
}
function te(t) {
return z(t) ? t : (t.ownerDocument || t).defaultView || G.window;
}
typeof window < "u" && window && Q(window);
var re = function(t) {
return !!t && f(t) === "object";
}, ue = function(t) {
return typeof t == "function";
}, S = { window: function(t) {
return t === G || z(t);
}, docFrag: function(t) {
return re(t) && t.nodeType === 11;
}, object: re, func: ue, number: function(t) {
return typeof t == "number";
}, bool: function(t) {
return typeof t == "boolean";
}, string: function(t) {
return typeof t == "string";
}, element: function(t) {
if (!t || f(t) !== "object") return !1;
var e = te(t) || G;
return /object|function/.test(typeof Element > "u" ? "undefined" : f(Element)) ? t instanceof Element || t instanceof e.Element : t.nodeType === 1 && typeof t.nodeName == "string";
}, plainObject: function(t) {
return re(t) && !!t.constructor && /function Object\b/.test(t.constructor.toString());
}, array: function(t) {
return re(t) && t.length !== void 0 && ue(t.splice);
} };
function be(t) {
var e = t.interaction;
if (e.prepared.name === "drag") {
var r = e.prepared.axis;
r === "x" ? (e.coords.cur.page.y = e.coords.start.page.y, e.coords.cur.client.y = e.coords.start.client.y, e.coords.velocity.client.y = 0, e.coords.velocity.page.y = 0) : r === "y" && (e.coords.cur.page.x = e.coords.start.page.x, e.coords.cur.client.x = e.coords.start.client.x, e.coords.velocity.client.x = 0, e.coords.velocity.page.x = 0);
}
}
function we(t) {
var e = t.iEvent, r = t.interaction;
if (r.prepared.name === "drag") {
var n = r.prepared.axis;
if (n === "x" || n === "y") {
var o = n === "x" ? "y" : "x";
e.page[o] = r.coords.start.page[o], e.client[o] = r.coords.start.client[o], e.delta[o] = 0;
}
}
}
var ce = { id: "actions/drag", install: function(t) {
var e = t.actions, r = t.Interactable, n = t.defaults;
r.prototype.draggable = ce.draggable, e.map.drag = ce, e.methodDict.drag = "draggable", n.actions.drag = ce.defaults;
}, listeners: { "interactions:before-action-move": be, "interactions:action-resume": be, "interactions:action-move": we, "auto-start:check": function(t) {
var e = t.interaction, r = t.interactable, n = t.buttons, o = r.options.drag;
if (o && o.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || n & r.options.drag.mouseButtons)) return t.action = { name: "drag", axis: o.lockAxis === "start" ? o.startAxis : o.lockAxis }, !1;
} }, draggable: function(t) {
return S.object(t) ? (this.options.drag.enabled = t.enabled !== !1, this.setPerAction("drag", t), this.setOnEvents("drag", t), /^(xy|x|y|start)$/.test(t.lockAxis) && (this.options.drag.lockAxis = t.lockAxis), /^(xy|x|y)$/.test(t.startAxis) && (this.options.drag.startAxis = t.startAxis), this) : S.bool(t) ? (this.options.drag.enabled = t, this) : this.options.drag;
}, beforeMove: be, move: we, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
return "move";
}, filterEventType: function(t) {
return t.search("drag") === 0;
} }, ne = ce, de = { init: function(t) {
var e = t;
de.document = e.document, de.DocumentFragment = e.DocumentFragment || Ee, de.SVGElement = e.SVGElement || Ee, de.SVGSVGElement = e.SVGSVGElement || Ee, de.SVGElementInstance = e.SVGElementInstance || Ee, de.Element = e.Element || Ee, de.HTMLElement = e.HTMLElement || de.Element, de.Event = e.Event, de.Touch = e.Touch || Ee, de.PointerEvent = e.PointerEvent || e.MSPointerEvent;
}, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
function Ee() {
}
var W = de, k = { init: function(t) {
var e = W.Element, r = t.navigator || {};
k.supportsTouch = "ontouchstart" in t || S.func(t.DocumentTouch) && W.document instanceof t.DocumentTouch, k.supportsPointerEvent = r.pointerEnabled !== !1 && !!W.PointerEvent, k.isIOS = /iP(hone|od|ad)/.test(r.platform), k.isIOS7 = /iP(hone|od|ad)/.test(r.platform) && /OS 7[^\d]/.test(r.appVersion), k.isIe9 = /MSIE 9/.test(r.userAgent), k.isOperaMobile = r.appName === "Opera" && k.supportsTouch && /Presto/.test(r.userAgent), k.prefixedMatchesSelector = "matches" in e.prototype ? "matches" : "webkitMatchesSelector" in e.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e.prototype ? "oMatchesSelector" : "msMatchesSelector", k.pEventTypes = k.supportsPointerEvent ? W.PointerEvent === t.MSPointerEvent ? { up: "MSPointerUp", down: "MSPointerDown", over: "mouseover", out: "mouseout", move: "MSPointerMove", cancel: "MSPointerCancel" } : { up: "pointerup", down: "pointerdown", over: "pointerover", out: "pointerout", move: "pointermove", cancel: "pointercancel" } : null, k.wheelEvent = W.document && "onmousewheel" in W.document ? "mousewheel" : "wheel";
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, R = k;
function F(t, e) {
if (t.contains) return t.contains(e);
for (; e; ) {
if (e === t) return !0;
e = e.parentNode;
}
return !1;
}
function A(t, e) {
for (; S.element(t); ) {
if (X(t, e)) return t;
t = K(t);
}
return null;
}
function K(t) {
var e = t.parentNode;
if (S.docFrag(e)) {
for (; (e = e.host) && S.docFrag(e); ) ;
return e;
}
return e;
}
function X(t, e) {
return G !== N && (e = e.replace(/\/deep\//g, " ")), t[R.prefixedMatchesSelector](e);
}
var ie = function(t) {
return t.parentNode || t.host;
};
function ae(t, e) {
for (var r, n = [], o = t; (r = ie(o)) && o !== e && r !== o.ownerDocument; ) n.unshift(o), o = r;
return n;
}
function pe(t, e, r) {
for (; S.element(t); ) {
if (X(t, e)) return !0;
if ((t = K(t)) === r) return X(t, e);
}
return !1;
}
function he(t) {
return t.correspondingUseElement || t;
}
function ve(t) {
var e = t instanceof W.SVGElement ? t.getBoundingClientRect() : t.getClientRects()[0];
return e && { left: e.left, right: e.right, top: e.top, bottom: e.bottom, width: e.width || e.right - e.left, height: e.height || e.bottom - e.top };
}
function Oe(t) {
var e, r = ve(t);
if (!R.isIOS7 && r) {
var n = { x: (e = (e = te(t)) || G).scrollX || e.document.documentElement.scrollLeft, y: e.scrollY || e.document.documentElement.scrollTop };
r.left += n.x, r.right += n.x, r.top += n.y, r.bottom += n.y;
}
return r;
}
function Ce(t) {
for (var e = []; t; ) e.push(t), t = K(t);
return e;
}
function ke(t) {
return !!S.string(t) && (W.document.querySelector(t), !0);
}
function H(t, e) {
for (var r in e) t[r] = e[r];
return t;
}
function fe(t, e, r) {
return t === "parent" ? K(r) : t === "self" ? e.getRect(r) : A(r, t);
}
function ye(t, e, r, n) {
var o = t;
return S.string(o) ? o = fe(o, e, r) : S.func(o) && (o = o.apply(void 0, n)), S.element(o) && (o = Oe(o)), o;
}
function _e(t) {
return t && { x: "x" in t ? t.x : t.left, y: "y" in t ? t.y : t.top };
}
function ze(t) {
return !t || "x" in t && "y" in t || ((t = H({}, t)).x = t.left || 0, t.y = t.top || 0, t.width = t.width || (t.right || 0) - t.x, t.height = t.height || (t.bottom || 0) - t.y), t;
}
function mt(t, e, r) {
t.left && (e.left += r.x), t.right && (e.right += r.x), t.top && (e.top += r.y), t.bottom && (e.bottom += r.y), e.width = e.right - e.left, e.height = e.bottom - e.top;
}
function it(t, e, r) {
var n = r && t.options[r];
return _e(ye(n && n.origin || t.options.origin, t, e, [t && e])) || { x: 0, y: 0 };
}
function Ue(t, e) {
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(h) {
return !0;
}, n = arguments.length > 3 ? arguments[3] : void 0;
if (n = n || {}, S.string(t) && t.search(" ") !== -1 && (t = Br(t)), S.array(t)) return t.forEach(function(h) {
return Ue(h, e, r, n);
}), n;
if (S.object(t) && (e = t, t = ""), S.func(e) && r(t)) n[t] = n[t] || [], n[t].push(e);
else if (S.array(e)) for (var o = 0, l = e; o < l.length; o++) {
var c = l[o];
Ue(t, c, r, n);
}
else if (S.object(e)) for (var p in e)
Ue(Br(p).map(function(h) {
return "".concat(t).concat(h);
}), e[p], r, n);
return n;
}
function Br(t) {
return t.trim().split(/ +/);
}
var ot = function(t, e) {
return Math.sqrt(t * t + e * e);
}, ao = ["webkit", "moz"];
function bt(t, e) {
t.__set || (t.__set = {});
var r = function(o) {
if (ao.some(function(l) {
return o.indexOf(l) === 0;
})) return 1;
typeof t[o] != "function" && o !== "__set" && Object.defineProperty(t, o, { get: function() {
return o in t.__set ? t.__set[o] : t.__set[o] = e[o];
}, set: function(l) {
t.__set[o] = l;
}, configurable: !0 });
};
for (var n in e) r(n);
return t;
}
function yt(t, e) {
t.page = t.page || {}, t.page.x = e.page.x, t.page.y = e.page.y, t.client = t.client || {}, t.client.x = e.client.x, t.client.y = e.client.y, t.timeStamp = e.timeStamp;
}
function Vr(t) {
t.page.x = 0, t.page.y = 0, t.client.x = 0, t.client.y = 0;
}
function qr(t) {
return t instanceof W.Event || t instanceof W.Touch;
}
function Tt(t, e, r) {
return t = t || "page", (r = r || {}).x = e[t + "X"], r.y = e[t + "Y"], r;
}
function Zr(t, e) {
return e = e || { x: 0, y: 0 }, R.isOperaMobile && qr(t) ? (Tt("screen", t, e), e.x += window.scrollX, e.y += window.scrollY) : Tt("page", t, e), e;
}
function st(t) {
return S.number(t.pointerId) ? t.pointerId : t.identifier;
}
function lo(t, e, r) {
var n = e.length > 1 ? Jr(e) : e[0];
Zr(n, t.page), function(o, l) {
l = l || {}, R.isOperaMobile && qr(o) ? Tt("screen", o, l) : Tt("client", o, l);
}(n, t.client), t.timeStamp = r;
}
function Jt(t) {
var e = [];
return S.array(t) ? (e[0] = t[0], e[1] = t[1]) : t.type === "touchend" ? t.touches.length === 1 ? (e[0] = t.touches[0], e[1] = t.changedTouches[0]) : t.touches.length === 0 && (e[0] = t.changedTouches[0], e[1] = t.changedTouches[1]) : (e[0] = t.touches[0], e[1] = t.touches[1]), e;
}
function Jr(t) {
for (var e = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, r = 0; r < t.length; r++) {
var n = t[r];
for (var o in e) e[o] += n[o];
}
for (var l in e) e[l] /= t.length;
return e;
}
function Qt(t) {
if (!t.length) return null;
var e = Jt(t), r = Math.min(e[0].pageX, e[1].pageX), n = Math.min(e[0].pageY, e[1].pageY), o = Math.max(e[0].pageX, e[1].pageX), l = Math.max(e[0].pageY, e[1].pageY);
return { x: r, y: n, left: r, top: n, right: o, bottom: l, width: o - r, height: l - n };
}
function er(t, e) {
var r = e + "X", n = e + "Y", o = Jt(t), l = o[0][r] - o[1][r], c = o[0][n] - o[1][n];
return ot(l, c);
}
function tr(t, e) {
var r = e + "X", n = e + "Y", o = Jt(t), l = o[1][r] - o[0][r], c = o[1][n] - o[0][n];
return 180 * Math.atan2(c, l) / Math.PI;
}
function Qr(t) {
return S.string(t.pointerType) ? t.pointerType : S.number(t.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t.pointerType] : /touch/.test(t.type || "") || t instanceof W.Touch ? "touch" : "mouse";
}
function en(t) {
var e = S.func(t.composedPath) ? t.composedPath() : t.path;
return [he(e ? e[0] : t.target), he(t.currentTarget)];
}
var wt = function() {
function t(e) {
v(this, t), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = e;
}
return y(t, [{ key: "preventDefault", value: function() {
} }, { key: "stopPropagation", value: function() {
this.propagationStopped = !0;
} }, { key: "stopImmediatePropagation", value: function() {
this.immediatePropagationStopped = this.propagationStopped = !0;
} }]), t;
}();
Object.defineProperty(wt.prototype, "interaction", { get: function() {
return this._interaction._proxy;
}, set: function() {
} });
var tn = function(t, e) {
for (var r = 0; r < e.length; r++) {
var n = e[r];
t.push(n);
}
return t;
}, rn = function(t) {
return tn([], t);
}, at = function(t, e) {
for (var r = 0; r < t.length; r++) if (e(t[r], r, t)) return r;
return -1;
}, lt = function(t, e) {
return t[at(t, e)];
}, Xe = function(t) {
O(r, t);
var e = _(r);
function r(n, o, l) {
var c;
v(this, r), (c = e.call(this, o._interaction)).dropzone = void 0, c.dragEvent = void 0, c.relatedTarget = void 0, c.draggable = void 0, c.propagationStopped = !1, c.immediatePropagationStopped = !1;
var p = l === "dragleave" ? n.prev : n.cur, h = p.element, g = p.dropzone;
return c.type = l, c.target = h, c.currentTarget = h, c.dropzone = g, c.dragEvent = o, c.relatedTarget = o.target, c.draggable = o.interactable, c.timeStamp = o.timeStamp, c;
}
return y(r, [{ key: "reject", value: function() {
var n = this, o = this._interaction.dropState;
if (this.type === "dropactivate" || this.dropzone && o.cur.dropzone === this.dropzone && o.cur.element === this.target) if (o.prev.dropzone = this.dropzone, o.prev.element = this.target, o.rejected = !0, o.events.enter = null, this.stopImmediatePropagation(), this.type === "dropactivate") {
var l = o.activeDrops, c = at(l, function(h) {
var g = h.dropzone, d = h.element;
return g === n.dropzone && d === n.target;
});
o.activeDrops.splice(c, 1);
var p = new r(o, this.dragEvent, "dropdeactivate");
p.dropzone = this.dropzone, p.target = this.target, this.dropzone.fire(p);
} else this.dropzone.fire(new r(o, this.dragEvent, "dragleave"));
} }, { key: "preventDefault", value: function() {
} }, { key: "stopPropagation", value: function() {
this.propagationStopped = !0;
} }, { key: "stopImmediatePropagation", value: function() {
this.immediatePropagationStopped = this.propagationStopped = !0;
} }]), r;
}(wt);
function nn(t, e) {
for (var r = 0, n = t.slice(); r < n.length; r++) {
var o = n[r], l = o.dropzone, c = o.element;
e.dropzone = l, e.target = c, l.fire(e), e.propagationStopped = e.immediatePropagationStopped = !1;
}
}
function rr(t, e) {
for (var r = function(l, c) {
for (var p = [], h = 0, g = l.interactables.list; h < g.length; h++) {
var d = g[h];
if (d.options.drop.enabled) {
var b = d.options.drop.accept;
if (!(S.element(b) && b !== c || S.string(b) && !X(c, b) || S.func(b) && !b({ dropzone: d, draggableElement: c }))) for (var w = 0, I = d.getAllElements(); w < I.length; w++) {
var E = I[w];
E !== c && p.push({ dropzone: d, element: E, rect: d.getRect(E) });
}
}
}
return p;
}(t, e), n = 0; n < r.length; n++) {
var o = r[n];
o.rect = o.dropzone.getRect(o.element);
}
return r;
}
function on(t, e, r) {
for (var n = t.dropState, o = t.interactable, l = t.element, c = [], p = 0, h = n.activeDrops; p < h.length; p++) {
var g = h[p], d = g.dropzone, b = g.element, w = g.rect, I = d.dropCheck(e, r, o, l, b, w);
c.push(I ? b : null);
}
var E = function(D) {
for (var L, j, Y, q = [], ee = 0; ee < D.length; ee++) {
var B = D[ee], Z = D[L];
if (B && ee !== L) if (Z) {
var me = ie(B), le = ie(Z);
if (me !== B.ownerDocument) if (le !== B.ownerDocument) if (me !== le) {
q = q.length ? q : ae(Z);
var Te = void 0;
if (Z instanceof W.HTMLElement && B instanceof W.SVGElement && !(B instanceof W.SVGSVGElement)) {
if (B === le) continue;
Te = B.ownerSVGElement;
} else Te = B;
for (var Se = ae(Te, Z.ownerDocument), De = 0; Se[De] && Se[De] === q[De]; ) De++;
var Pt = [Se[De - 1], Se[De], q[De]];
if (Pt[0]) for (var ft = Pt[0].lastChild; ft; ) {
if (ft === Pt[1]) {
L = ee, q = Se;
break;
}
if (ft === Pt[2]) break;
ft = ft.previousSibling;
}
} else Y = Z, (parseInt(te(j = B).getComputedStyle(j).zIndex, 10) || 0) >= (parseInt(te(Y).getComputedStyle(Y).zIndex, 10) || 0) && (L = ee);
else L = ee;
} else L = ee;
}
return L;
}(c);
return n.activeDrops[E] || null;
}
function nr(t, e, r) {
var n = t.dropState, o = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
return r.type === "dragstart" && (o.activate = new Xe(n, r, "dropactivate"), o.activate.target = null, o.activate.dropzone = null), r.type === "dragend" && (o.deactivate = new Xe(n, r, "dropdeactivate"), o.deactivate.target = null, o.deactivate.dropzone = null), n.rejected || (n.cur.element !== n.prev.element && (n.prev.dropzone && (o.leave = new Xe(n, r, "dragleave"), r.dragLeave = o.leave.target = n.prev.element, r.prevDropzone = o.leave.dropzone = n.prev.dropzone), n.cur.dropzone && (o.enter = new Xe(n, r, "dragenter"), r.dragEnter = n.cur.element, r.dropzone = n.cur.dropzone)), r.type === "dragend" && n.cur.dropzone && (o.drop = new Xe(n, r, "drop"), r.dropzone = n.cur.dropzone, r.relatedTarget = n.cur.element), r.type === "dragmove" && n.cur.dropzone && (o.move = new Xe(n, r, "dropmove"), r.dropzone = n.cur.dropzone)), o;
}
function ir(t, e) {
var r = t.dropState, n = r.activeDrops, o = r.cur, l = r.prev;
e.leave && l.dropzone.fire(e.leave), e.enter && o.dropzone.fire(e.enter), e.move && o.dropzone.fire(e.move), e.drop && o.dropzone.fire(e.drop), e.deactivate && nn(n, e.deactivate), r.prev.dropzone = o.dropzone, r.prev.element = o.element;
}
function sn(t, e) {
var r = t.interaction, n = t.iEvent, o = t.event;
if (n.type === "dragmove" || n.type === "dragend") {
var l = r.dropState;
e.dynamicDrop && (l.activeDrops = rr(e, r.element));
var c = n, p = on(r, c, o);
l.rejected = l.rejected && !!p && p.dropzone === l.cur.dropzone && p.element === l.cur.element, l.cur.dropzone = p && p.dropzone, l.cur.element = p && p.element, l.events = nr(r, 0, c);
}
}
var an = { id: "actions/drop", install: function(t) {
var e = t.actions, r = t.interactStatic, n = t.Interactable, o = t.defaults;
t.usePlugin(ne), n.prototype.dropzone = function(l) {
return function(c, p) {
if (S.object(p)) {
if (c.options.drop.enabled = p.enabled !== !1, p.listeners) {
var h = Ue(p.listeners), g = Object.keys(h).reduce(function(b, w) {
return b[/^(enter|leave)/.test(w) ? "drag".concat(w) : /^(activate|deactivate|move)/.test(w) ? "drop".concat(w) : w] = h[w], b;
}, {}), d = c.options.drop.listeners;
d && c.off(d), c.on(g), c.options.drop.listeners = g;
}
return S.func(p.ondrop) && c.on("drop", p.ondrop), S.func(p.ondropactivate) && c.on("dropactivate", p.ondropactivate), S.func(p.ondropdeactivate) && c.on("dropdeactivate", p.ondropdeactivate), S.func(p.ondragenter) && c.on("dragenter", p.ondragenter), S.func(p.ondragleave) && c.on("dragleave", p.ondragleave), S.func(p.ondropmove) && c.on("dropmove", p.ondropmove), /^(pointer|center)$/.test(p.overlap) ? c.options.drop.overlap = p.overlap : S.number(p.overlap) && (c.options.drop.overlap = Math.max(Math.min(1, p.overlap), 0)), "accept" in p && (c.options.drop.accept = p.accept), "checker" in p && (c.options.drop.checker = p.checker), c;
}
return S.bool(p) ? (c.options.drop.enabled = p, c) : c.options.drop;
}(this, l);
}, n.prototype.dropCheck = function(l, c, p, h, g, d) {
return function(b, w, I, E, D, L, j) {
var Y = !1;
if (!(j = j || b.getRect(L))) return !!b.options.drop.checker && b.options.drop.checker(w, I, Y, b, L, E, D);
var q = b.options.drop.overlap;
if (q === "pointer") {
var ee = it(E, D, "drag"), B = Zr(w);
B.x += ee.x, B.y += ee.y;
var Z = B.x > j.left && B.x < j.right, me = B.y > j.top && B.y < j.bottom;
Y = Z && me;
}
var le = E.getRect(D);
if (le && q === "center") {
var Te = le.left + le.width / 2, Se = le.top + le.height / 2;
Y = Te >= j.left && Te <= j.right && Se >= j.top && Se <= j.bottom;
}
return le && S.number(q) && (Y = Math.max(0, Math.min(j.right, le.right) - Math.max(j.left, le.left)) * Math.max(0, Math.min(j.bottom, le.bottom) - Math.max(j.top, le.top)) / (le.width * le.height) >= q), b.options.drop.checker && (Y = b.options.drop.checker(w, I, Y, b, L, E, D)), Y;
}(this, l, c, p, h, g, d);
}, r.dynamicDrop = function(l) {
return S.bool(l) ? (t.dynamicDrop = l, r) : t.dynamicDrop;
}, H(e.phaselessTypes, { dragenter: !0, dragleave: !0, dropactivate: !0, dropdeactivate: !0, dropmove: !0, drop: !0 }), e.methodDict.drop = "dropzone", t.dynamicDrop = !1, o.actions.drop = an.defaults;
}, listeners: { "interactions:before-action-start": function(t) {
var e = t.interaction;
e.prepared.name === "drag" && (e.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
}, "interactions:after-action-start": function(t, e) {
var r = t.interaction, n = (t.event, t.iEvent);
if (r.prepared.name === "drag") {
var o = r.dropState;
o.activeDrops = [], o.events = {}, o.activeDrops = rr(e, r.element), o.events = nr(r, 0, n), o.events.activate && (nn(o.activeDrops, o.events.activate), e.fire("actions/drop:start", { interaction: r, dragEvent: n }));
}
}, "interactions:action-move": sn, "interactions:after-action-move": function(t, e) {
var r = t.interaction, n = t.iEvent;
if (r.prepared.name === "drag") {
var o = r.dropState;
ir(r, o.events), e.fire("actions/drop:move", { interaction: r, dragEvent: n }), o.events = {};
}
}, "interactions:action-end": function(t, e) {
if (t.interaction.prepared.name === "drag") {
var r = t.interaction, n = t.iEvent;
sn(t, e), ir(r, r.dropState.events), e.fire("actions/drop:end", { interaction: r, dragEvent: n });
}
}, "interactions:stop": function(t) {
var e = t.interaction;
if (e.prepared.name === "drag") {
var r = e.dropState;
r && (r.activeDrops = null, r.events = null, r.cur.dropzone = null, r.cur.element = null, r.prev.dropzone = null, r.prev.element = null, r.rejected = !1);
}
} }, getActiveDrops: rr, getDrop: on, getDropEvents: nr, fireDropEvents: ir, filterEventType: function(t) {
return t.search("drag") === 0 || t.search("drop") === 0;
}, defaults: { enabled: !1, accept: null, overlap: "pointer" } }, co = an;
function or(t) {
var e = t.interaction, r = t.iEvent, n = t.phase;
if (e.prepared.name === "gesture") {
var o = e.pointers.map(function(g) {
return g.pointer;
}), l = n === "start", c = n === "end", p = e.interactable.options.deltaSource;
if (r.touches = [o[0], o[1]], l) r.distance = er(o, p), r.box = Qt(o), r.scale = 1, r.ds = 0, r.angle = tr(o, p), r.da = 0, e.gesture.startDistance = r.distance, e.gesture.startAngle = r.angle;
else if (c || e.pointers.length < 2) {
var h = e.prevEvent;
r.distance = h.distance, r.box = h.box, r.scale = h.scale, r.ds = 0, r.angle = h.angle, r.da = 0;
} else r.distance = er(o, p), r.box = Qt(o), r.scale = r.distance / e.gesture.startDistance, r.angle = tr(o, p), r.ds = r.scale - e.gesture.scale, r.da = r.angle - e.gesture.angle;
e.gesture.distance = r.distance, e.gesture.angle = r.angle, S.number(r.scale) && r.scale !== 1 / 0 && !isNaN(r.scale) && (e.gesture.scale = r.scale);
}
}
var sr = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(t) {
var e = t.actions, r = t.Interactable, n = t.defaults;
r.prototype.gesturable = function(o) {
return S.object(o) ? (this.options.gesture.enabled = o.enabled !== !1, this.setPerAction("gesture", o), this.setOnEvents("gesture", o), this) : S.bool(o) ? (this.options.gesture.enabled = o, this) : this.options.gesture;
}, e.map.gesture = sr, e.methodDict.gesture = "gesturable", n.actions.gesture = sr.defaults;
}, listeners: { "interactions:action-start": or, "interactions:action-move": or, "interactions:action-end": or, "interactions:new": function(t) {
t.interaction.gesture = { angle: 0, distance: 0, scale: 1, startAngle: 0, startDistance: 0 };
}, "auto-start:check": function(t) {
if (!(t.interaction.pointers.length < 2)) {
var e = t.interactable.options.gesture;
if (e && e.enabled) return t.action = { name: "gesture" }, !1;
}
} }, defaults: {}, getCursor: function() {
return "";
}, filterEventType: function(t) {
return t.search("gesture") === 0;
} }, uo = sr;
function po(t, e, r, n, o, l, c) {
if (!e) return !1;
if (e === !0) {
var p = S.number(l.width) ? l.width : l.right - l.left, h = S.number(l.height) ? l.height : l.bottom - l.top;
if (c = Math.min(c, Math.abs((t === "left" || t === "right" ? p : h) / 2)), p < 0 && (t === "left" ? t = "right" : t === "right" && (t = "left")), h < 0 && (t === "top" ? t = "bottom" : t === "bottom" && (t = "top")), t === "left") {
var g = p >= 0 ? l.left : l.right;
return r.x < g + c;
}
if (t === "top") {
var d = h >= 0 ? l.top : l.bottom;
return r.y < d + c;
}
if (t === "right") return r.x > (p >= 0 ? l.right : l.left) - c;
if (t === "bottom") return r.y > (h >= 0 ? l.bottom : l.top) - c;
}
return !!S.element(n) && (S.element(e) ? e === n : pe(n, e, o));
}
function ln(t) {
var e = t.iEvent, r = t.interaction;
if (r.prepared.name === "resize" && r.resizeAxes) {
var n = e;
r.interactable.options.resize.square ? (r.resizeAxes === "y" ? n.delta.x = n.delta.y : n.delta.y = n.delta.x, n.axes = "xy") : (n.axes = r.resizeAxes, r.resizeAxes === "x" ? n.delta.y = 0 : r.resizeAxes === "y" && (n.delta.x = 0));
}
}
var Ie, Ne, Pe = { id: "actions/resize", before: ["actions/drag"], install: function(t) {
var e = t.actions, r = t.browser, n = t.Interactable, o = t.defaults;
Pe.cursors = function(l) {
return l.isIe9 ? { x: "e-resize", y: "s-resize", xy: "se-resize", top: "n-resize", left: "w-resize", bottom: "s-resize", right: "e-resize", topleft: "se-resize", bottomright: "se-resize", topright: "ne-resize", bottomleft: "ne-resize" } : { x: "ew-resize", y: "ns-resize", xy: "nwse-resize", top: "ns-resize", left: "ew-resize", bottom: "ns-resize", right: "ew-resize", topleft: "nwse-resize", bottomright: "nwse-resize", topright: "nesw-resize", bottomleft: "nesw-resize" };
}(r), Pe.defaultMargin = r.supportsTouch || r.supportsPointerEvent ? 20 : 10, n.prototype.resizable = function(l) {
return function(c, p, h) {
return S.object(p) ? (c.options.resize.enabled = p.enabled !== !1, c.setPerAction("resize", p), c.setOnEvents("resize", p), S.string(p.axis) && /^x$|^y$|^xy$/.test(p.axis) ? c.options.resize.axis = p.axis : p.axis === null && (c.options.resize.axis = h.defaults.actions.resize.axis), S.bool(p.preserveAspectRatio) ? c.options.resize.preserveAspectRatio = p.preserveAspectRatio : S.bool(p.square) && (c.options.resize.square = p.square), c) : S.bool(p) ? (c.options.resize.enabled = p, c) : c.options.resize;
}(this, l, t);
}, e.map.resize = Pe, e.methodDict.resize = "resizable", o.actions.resize = Pe.defaults;
}, listeners: { "interactions:new": function(t) {
t.interaction.resizeAxes = "xy";
}, "interactions:action-start": function(t) {
(function(e) {
var r = e.iEvent, n = e.interaction;
if (n.prepared.name === "resize" && n.prepared.edges) {
var o = r, l = n.rect;
n._rects = { start: H({}, l), corrected: H({}, l), previous: H({}, l), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, o.edges = n.prepared.edges, o.rect = n._rects.corrected, o.deltaRect = n._rects.delta;
}
})(t), ln(t);
}, "interactions:action-move": function(t) {
(function(e) {
var r = e.iEvent, n = e.interaction;
if (n.prepared.name === "resize" && n.prepared.edges) {
var o = r, l = n.interactable.options.resize.invert, c = l === "reposition" || l === "negate", p = n.rect, h = n._rects, g = h.start, d = h.corrected, b = h.delta, w = h.previous;
if (H(w, d), c) {
if (H(d, p), l === "reposition") {
if (d.top > d.bottom) {
var I = d.top;
d.top = d.bottom, d.bottom = I;
}
if (d.left > d.right) {
var E = d.left;
d.left = d.right, d.right = E;
}
}
} else d.top = Math.min(p.top, g.bottom), d.bottom = Math.max(p.bottom, g.top), d.left = Math.min(p.left, g.right), d.right = Math.max(p.right, g.left);
for (var D in d.width = d.right - d.left, d.height = d.bottom - d.top, d) b[D] = d[D] - w[D];
o.edges = n.prepared.edges, o.rect = d, o.deltaRect = b;
}
})(t), ln(t);
}, "interactions:action-end": function(t) {
var e = t.iEvent, r = t.interaction;
if (r.prepared.name === "resize" && r.prepared.edges) {
var n = e;
n.edges = r.prepared.edges, n.rect = r._rects.corrected, n.deltaRect = r._rects.delta;
}
}, "auto-start:check": function(t) {
var e = t.interaction, r = t.interactable, n = t.element, o = t.rect, l = t.buttons;
if (o) {
var c = H({}, e.coords.cur.page), p = r.options.resize;
if (p && p.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || l & p.mouseButtons)) {
if (S.object(p.edges)) {
var h = { left: !1, right: !1, top: !1, bottom: !1 };
for (var g in h) h[g] = po(g, p.edges[g], c, e._latestPointer.eventTarget, n, o, p.margin || Pe.defaultMargin);
h.left = h.left && !h.right, h.top = h.top && !h.bottom, (h.left || h.right || h.top || h.bottom) && (t.action = { name: "resize", edges: h });
} else {
var d = p.axis !== "y" && c.x > o.right - Pe.defaultMargin, b = p.axis !== "x" && c.y > o.bottom - Pe.defaultMargin;
(d || b) && (t.action = { name: "resize", axes: (d ? "x" : "") + (b ? "y" : "") });
}
return !t.action && void 0;
}
}
} }, defaults: { square: !1, preserveAspectRatio: !1, axis: "xy", margin: NaN, edges: null, invert: "none" }, cursors: null, getCursor: function(t) {
var e = t.edges, r = t.axis, n = t.name, o = Pe.cursors, l = null;
if (r) l = o[n + r];
else if (e) {
for (var c = "", p = 0, h = ["top", "bottom", "left", "right"]; p < h.length; p++) {
var g = h[p];
e[g] && (c += g);
}
l = o[c];
}
return l;
}, filterEventType: function(t) {
return t.search("resize") === 0;
}, defaultMargin: null }, ho = Pe, fo = { id: "actions", install: function(t) {
t.usePlugin(uo), t.usePlugin(ho), t.usePlugin(ne), t.usePlugin(co);
} }, cn = 0, je = { request: function(t) {
return Ie(t);
}, cancel: function(t) {
return Ne(t);
}, init: function(t) {
if (Ie = t.requestAnimationFrame, Ne = t.cancelAnimationFrame, !Ie) for (var e = ["ms", "moz", "webkit", "o"], r = 0; r < e.length; r++) {
var n = e[r];
Ie = t["".concat(n, "RequestAnimationFrame")], Ne = t["".concat(n, "CancelAnimationFrame")] || t["".concat(n, "CancelRequestAnimationFrame")];
}
Ie = Ie && Ie.bind(t), Ne = Ne && Ne.bind(t), Ie || (Ie = function(o) {
var l = Date.now(), c = Math.max(0, 16 - (l - cn)), p = t.setTimeout(function() {
o(l + c);
}, c);
return cn = l + c, p;
}, Ne = function(o) {
return clearTimeout(o);
});
} }, V = { defaults: { enabled: !1, margin: 60, container: null, speed: 300 }, now: Date.now, interaction: null, i: 0, x: 0, y: 0, isScrolling: !1, prevTime: 0, margin: 0, speed: 0, start: function(t) {
V.isScrolling = !0, je.cancel(V.i), t.autoScroll = V, V.interaction = t, V.prevTime = V.now(), V.i = je.request(V.scroll);
}, stop: function() {
V.isScrolling = !1, V.interaction && (V.interaction.autoScroll = null), je.cancel(V.i);
}, scroll: function() {
var t = V.interaction, e = t.interactable, r = t.element, n = t.prepared.name, o = e.options[n].autoScroll, l = un(o.container, e, r), c = V.now(), p = (c - V.prevTime) / 1e3, h = o.speed * p;
if (h >= 1) {
var g = { x: V.x * h, y: V.y * h };
if (g.x || g.y) {
var d = pn(l);
S.window(l) ? l.scrollBy(g.x, g.y) : l && (l.scrollLeft += g.x, l.scrollTop += g.y);
var b = pn(l), w = { x: b.x - d.x, y: b.y - d.y };
(w.x || w.y) && e.fire({ type: "autoscroll", target: r, interactable: e, delta: w, interaction: t, container: l });
}
V.prevTime = c;
}
V.isScrolling && (je.cancel(V.i), V.i = je.request(V.scroll));
}, check: function(t, e) {
var r;
return (r = t.options[e].autoScroll) == null ? void 0 : r.enabled;
}, onInteractionMove: function(t) {
var e = t.interaction, r = t.pointer;
if (e.interacting() && V.check(e.interactable, e.prepared.name)) if (e.simulation) V.x = V.y = 0;
else {
var n, o, l, c, p = e.interactable, h = e.element, g = e.prepared.name, d = p.options[g].autoScroll, b = un(d.container, p, h);
if (S.window(b)) c = r.clientX < V.margin, n = r.clientY < V.margin, o = r.clientX > b.innerWidth - V.margin, l = r.clientY > b.innerHeight - V.margin;
else {
var w = ve(b);
c = r.clientX < w.left + V.margin, n = r.clientY < w.top + V.margin, o = r.clientX > w.right - V.margin, l = r.clientY > w.bottom - V.margin;
}
V.x = o ? 1 : c ? -1 : 0, V.y = l ? 1 : n ? -1 : 0, V.isScrolling || (V.margin = d.margin, V.speed = d.speed, V.start(e));
}
} };
function un(t, e, r) {
return (S.string(t) ? fe(t, e, r) : t) || te(r);
}
function pn(t) {
return S.window(t) && (t = window.document.body), { x: t.scrollLeft, y: t.scrollTop };
}
var vo = { id: "auto-scroll", install: function(t) {
var e = t.defaults, r = t.actions;
t.autoScroll = V, V.now = function() {
return t.now();
}, r.phaselessTypes.autoscroll = !0, e.perAction.autoScroll = V.defaults;
}, listeners: { "interactions:new": function(t) {
t.interaction.autoScroll = null;
}, "interactions:destroy": function(t) {
t.interaction.autoScroll = null, V.stop(), V.interaction && (V.interaction = null);
}, "interactions:stop": V.stop, "interactions:action-move": function(t) {
return V.onInteractionMove(t);
} } }, go = vo;
function ct(t, e) {
var r = !1;
return function() {
return r || (G.console.warn(e), r = !0), t.apply(this, arguments);
};
}
function ar(t, e) {
return t.name = e.name, t.axis = e.axis, t.edges = e.edges, t;
}
function mo(t) {
return S.bool(t) ? (this.options.styleCursor = t, this) : t === null ? (delete this.options.styleCursor, this) : this.options.styleCursor;
}
function bo(t) {
return S.func(t) ? (this.options.actionChecker = t, this) : t === null ? (delete this.options.actionChecker, this) : this.options.actionChecker;
}
var yo = { id: "auto-start/interactableMethods", install: function(t) {
var e = t.Interactable;
e.prototype.getAction = function(r, n, o, l) {
var c = function(p, h, g, d, b) {
var w = p.getRect(d), I = h.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[h.button], E = { action: null, interactable: p, interaction: g, element: d, rect: w, buttons: I };
return b.fire("auto-start:check", E), E.action;
}(this, n, o, l, t);
return this.options.actionChecker ? this.options.actionChecker(r, n, c, this, l, o) : c;
}, e.prototype.ignoreFrom = ct(function(r) {
return this._backCompatOption("ignoreFrom", r);
}, "Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."), e.prototype.allowFrom = ct(function(r) {
return this._backCompatOption("allowFrom", r);
}, "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), e.prototype.actionChecker = bo, e.prototype.styleCursor = mo;
} };
function hn(t, e, r, n, o) {
return e.testIgnoreAllow(e.options[t.name], r, n) && e.options[t.name].enabled && St(e, r, t, o) ? t : null;
}
function To(t, e, r, n, o, l, c) {
for (var p = 0, h = n.length; p < h; p++) {
var g = n[p], d = o[p], b = g.getAction(e, r, t, d);
if (b) {
var w = hn(b, g, d, l, c);
if (w) return { action: w, interactable: g, element: d };
}
}
return { action: null, interactable: null, element: null };
}
function dn(t, e, r, n, o) {
var l = [], c = [], p = n;
function h(d) {
l.push(d), c.push(p);
}
for (; S.element(p); ) {
l = [], c = [], o.interactables.forEachMatch(p, h);
var g = To(t, e, r, l, c, n, o);
if (g.action && !g.interactable.options[g.action.name].manualStart) return g;
p = K(p);
}
return { action: null, interactable: null, element: null };
}
function fn(t, e, r) {
var n = e.action, o = e.interactable, l = e.element;
n = n || { name: null }, t.interactable = o, t.element = l, ar(t.prepared, n), t.rect = o && n.name ? o.getRect(l) : null, gn(t, r), r.fire("autoStart:prepared", { interaction: t });
}
function St(t, e, r, n) {
var o = t.options, l = o[r.name].max, c = o[r.name].maxPerElement, p = n.autoStart.maxInteractions, h = 0, g = 0, d = 0;
if (!(l && c && p)) return !1;
for (var b = 0, w = n.interactions.list; b < w.length; b++) {
var I = w[b], E = I.prepared.name;
if (I.interacting() && (++h >= p || I.interactable === t && ((g += E === r.name ? 1 : 0) >= l || I.element === e && (d++, E === r.name && d >= c))))
return !1;
}
return p > 0;
}
function vn(t, e) {
return S.number(t) ? (e.autoStart.maxInteractions = t, this) : e.autoStart.maxInteractions;
}
function lr(t, e, r) {
var n = r.autoStart.cursorElement;
n && n !== t && (n.style.cursor = ""), t.ownerDocument.documentElement.style.cursor = e, t.style.cursor = e, r.autoStart.cursorElement = e ? t : null;
}
function gn(t, e) {
var r = t.interactable, n = t.element, o = t.prepared;
if (t.pointerType === "mouse" && r && r.options.styleCursor) {
var l = "";
if (o.name) {
var c = r.options[o.name].cursorChecker;
l = S.func(c) ? c(o, r, n, t._interacting) : e.actions.map[o.name].getCursor(o);
}
lr(t.element, l || "", e);
} else e.autoStart.cursorElement && lr(e.autoStart.cursorElement, "", e);
}
var wo = { id: "auto-start/base", before: ["actions"], install: function(t) {
var e = t.interactStatic, r = t.defaults;
t.usePlugin(yo), r.base.actionChecker = null, r.base.styleCursor = !0, H(r.perAction, { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e.maxInteractions = function(n) {
return vn(n, t);
}, t.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: St, cursorElement: null };
}, listeners: { "interactions:down": function(t, e) {
var r = t.interaction, n = t.pointer, o = t.event, l = t.eventTarget;
r.interacting() || fn(r, dn(r, n, o, l, e), e);
}, "interactions:move": function(t, e) {
(function(r, n) {
var o = r.interaction, l = r.pointer, c = r.event, p = r.eventTarget;
o.pointerType !== "mouse" || o.pointerIsDown || o.interacting() || fn(o, dn(o, l, c, p, n), n);
})(t, e), function(r, n) {
var o = r.interaction;
if (o.pointerIsDown && !o.interacting() && o.pointerWasMoved && o.prepared.name) {
n.fire("autoStart:before-start", r);
var l = o.interactable, c = o.prepared.name;
c && l && (l.options[c].manualStart || !St(l, o.element, o.prepared, n) ? o.stop() : (o.start(o.prepared, l, o.element), gn(o, n)));
}
}(t, e);
}, "interactions:stop": function(t, e) {
var r = t.interaction, n = r.interactable;
n && n.options.styleCursor && lr(r.element, "", e);
} }, maxInteractions: vn, withinInteractionLimit: St, validateAction: hn }, cr = wo, So = { id: "auto-start/dragAxis", listeners: { "autoStart:before-start": function(t, e) {
var r = t.interaction, n = t.eventTarget, o = t.dx, l = t.dy;
if (r.prepared.name === "drag") {
var c = Math.abs(o), p = Math.abs(l), h = r.interactable.options.drag, g = h.startAxis, d = c > p ? "x" : c < p ? "y" : "xy";
if (r.prepared.axis = h.lockAxis === "start" ? d[0] : h.lockAxis, d !== "xy" && g !== "xy" && g !== d) {
r.prepared.name = null;
for (var b = n, w = function(E) {
if (E !== r.interactable) {
var D = r.interactable.options.drag;
if (!D.manualStart && E.testIgnoreAllow(D, b, n)) {
var L = E.getAction(r.downPointer, r.downEvent, r, b);
if (L && L.name === "drag" && function(j, Y) {
if (!Y) return !1;
var q = Y.options.drag.startAxis;
return j === "xy" || q === "xy" || q === j;
}(d, E) && cr.validateAction(L, E, b, n, e)) return E;
}
}
}; S.element(b); ) {
var I = e.interactables.forEachMatch(b, w);
if (I) {
r.prepared.name = "drag", r.interactable = I, r.element = b;
break;
}
b = K(b);
}
}
}
} } };
function ur(t) {
var e = t.prepared && t.prepared.name;
if (!e) return null;
var r = t.interactable.options;
return r[e].hold || r[e].delay;