@zenpatient-org/healthspan-marketing-ui 0.1.127 → 0.1.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ComplexImageCarousel/ComplexCarousel/ComplexCarousel.cjs.js +1 -1
- package/dist/components/ComplexImageCarousel/ComplexCarousel/ComplexCarousel.es.js +29 -28
- package/dist/components/ComplexImageCarousel/useComplexImageCarousel.cjs.js +1 -1
- package/dist/components/ComplexImageCarousel/useComplexImageCarousel.es.js +121 -91
- package/dist/components/HighlightedTitle/HighlightedTitle.cjs.js +1 -1
- package/dist/components/HighlightedTitle/HighlightedTitle.es.js +14 -14
- package/dist/healthspan-marketing-ui.css +1 -1
- package/dist/modules/LongevityPathways/LongevityPathways.cjs.js +1 -1
- package/dist/modules/LongevityPathways/LongevityPathways.es.js +24 -14
- package/dist/modules/LongevityPathways/longevityPathways.module.css.cjs.js +1 -1
- package/dist/modules/LongevityPathways/longevityPathways.module.css.es.js +5 -3
- package/dist/node_modules/gsap/Draggable.cjs.js +1 -0
- package/dist/node_modules/gsap/Draggable.es.js +605 -0
- package/package.json +1 -1
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
import { getGlobalMatrix as Ie, Matrix2D as ei } from "./utils/matrix.es.js";
|
|
2
|
+
function zt(h) {
|
|
3
|
+
if (h === void 0)
|
|
4
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
5
|
+
return h;
|
|
6
|
+
}
|
|
7
|
+
function di(h, t) {
|
|
8
|
+
h.prototype = Object.create(t.prototype), h.prototype.constructor = h, h.__proto__ = t;
|
|
9
|
+
}
|
|
10
|
+
var v, Y, te, de, ve, bt, _e, Pt, je, Pe, ti, kt, nt, Yt, et, ce, tt, dt, ii, Lt, pt = 0, oi = function() {
|
|
11
|
+
return typeof window < "u";
|
|
12
|
+
}, ni = function() {
|
|
13
|
+
return v || oi() && (v = window.gsap) && v.registerPlugin && v;
|
|
14
|
+
}, Ee = function(t) {
|
|
15
|
+
return typeof t == "function";
|
|
16
|
+
}, it = function(t) {
|
|
17
|
+
return typeof t == "object";
|
|
18
|
+
}, ue = function(t) {
|
|
19
|
+
return typeof t > "u";
|
|
20
|
+
}, ht = function() {
|
|
21
|
+
return !1;
|
|
22
|
+
}, ot = "transform", Ct = "transformOrigin", Me = function(t) {
|
|
23
|
+
return Math.round(t * 1e4) / 1e4;
|
|
24
|
+
}, Ze = Array.isArray, ct = function(t, n) {
|
|
25
|
+
var i = te.createElementNS ? te.createElementNS("http://www.w3.org/1999/xhtml".replace(/^https/, "http"), t) : te.createElement(t);
|
|
26
|
+
return i.style ? i : te.createElement(t);
|
|
27
|
+
}, Gt = 180 / Math.PI, Ae = 1e20, hi = new ei(), Se = Date.now || function() {
|
|
28
|
+
return (/* @__PURE__ */ new Date()).getTime();
|
|
29
|
+
}, Be = [], ze = {}, pi = 0, gi = /^(?:a|input|textarea|button|select)$/i, Qt = 0, He = {}, we = {}, ri = function(t, n) {
|
|
30
|
+
var i = {}, l;
|
|
31
|
+
for (l in t)
|
|
32
|
+
i[l] = n ? t[l] * n : t[l];
|
|
33
|
+
return i;
|
|
34
|
+
}, xi = function(t, n) {
|
|
35
|
+
for (var i in n)
|
|
36
|
+
i in t || (t[i] = n[i]);
|
|
37
|
+
return t;
|
|
38
|
+
}, Vt = function h(t, n) {
|
|
39
|
+
for (var i = t.length, l; i--; )
|
|
40
|
+
n ? t[i].style.touchAction = n : t[i].style.removeProperty("touch-action"), l = t[i].children, l && l.length && h(l, n);
|
|
41
|
+
}, li = function() {
|
|
42
|
+
return Be.forEach(function(t) {
|
|
43
|
+
return t();
|
|
44
|
+
});
|
|
45
|
+
}, yi = function(t) {
|
|
46
|
+
Be.push(t), Be.length === 1 && v.ticker.add(li);
|
|
47
|
+
}, Kt = function() {
|
|
48
|
+
return !Be.length && v.ticker.remove(li);
|
|
49
|
+
}, Ut = function(t) {
|
|
50
|
+
for (var n = Be.length; n--; )
|
|
51
|
+
Be[n] === t && Be.splice(n, 1);
|
|
52
|
+
v.to(Kt, {
|
|
53
|
+
overwrite: !0,
|
|
54
|
+
delay: 15,
|
|
55
|
+
duration: 0,
|
|
56
|
+
onComplete: Kt,
|
|
57
|
+
data: "_draggable"
|
|
58
|
+
});
|
|
59
|
+
}, mi = function(t, n) {
|
|
60
|
+
for (var i in n)
|
|
61
|
+
i in t || (t[i] = n[i]);
|
|
62
|
+
return t;
|
|
63
|
+
}, V = function(t, n, i, l) {
|
|
64
|
+
if (t.addEventListener) {
|
|
65
|
+
var f = nt[n];
|
|
66
|
+
l = l || (ti ? {
|
|
67
|
+
passive: !1
|
|
68
|
+
} : null), t.addEventListener(f || n, i, l), f && n !== f && t.addEventListener(n, i, l);
|
|
69
|
+
}
|
|
70
|
+
}, z = function(t, n, i, l) {
|
|
71
|
+
if (t.removeEventListener) {
|
|
72
|
+
var f = nt[n];
|
|
73
|
+
t.removeEventListener(f || n, i, l), f && n !== f && t.removeEventListener(n, i, l);
|
|
74
|
+
}
|
|
75
|
+
}, re = function(t) {
|
|
76
|
+
t.preventDefault && t.preventDefault(), t.preventManipulation && t.preventManipulation();
|
|
77
|
+
}, wi = function(t, n) {
|
|
78
|
+
for (var i = t.length; i--; )
|
|
79
|
+
if (t[i].identifier === n)
|
|
80
|
+
return !0;
|
|
81
|
+
}, _i = function h(t) {
|
|
82
|
+
Yt = t.touches && pt < t.touches.length, z(t.target, "touchend", h);
|
|
83
|
+
}, qt = function(t) {
|
|
84
|
+
Yt = t.touches && pt < t.touches.length, V(t.target, "touchend", _i);
|
|
85
|
+
}, Ge = function(t) {
|
|
86
|
+
return Y.pageYOffset || t.scrollTop || t.documentElement.scrollTop || t.body.scrollTop || 0;
|
|
87
|
+
}, Qe = function(t) {
|
|
88
|
+
return Y.pageXOffset || t.scrollLeft || t.documentElement.scrollLeft || t.body.scrollLeft || 0;
|
|
89
|
+
}, $t = function h(t, n) {
|
|
90
|
+
V(t, "scroll", n), Ve(t.parentNode) || h(t.parentNode, n);
|
|
91
|
+
}, Jt = function h(t, n) {
|
|
92
|
+
z(t, "scroll", n), Ve(t.parentNode) || h(t.parentNode, n);
|
|
93
|
+
}, Ve = function(t) {
|
|
94
|
+
return !t || t === de || t.nodeType === 9 || t === te.body || t === Y || !t.nodeType || !t.parentNode;
|
|
95
|
+
}, Zt = function(t, n) {
|
|
96
|
+
var i = n === "x" ? "Width" : "Height", l = "scroll" + i, f = "client" + i;
|
|
97
|
+
return Math.max(0, Ve(t) ? Math.max(de[l], ve[l]) - (Y["inner" + i] || de[f] || ve[f]) : t[l] - t[f]);
|
|
98
|
+
}, Dt = function h(t, n) {
|
|
99
|
+
var i = Zt(t, "x"), l = Zt(t, "y");
|
|
100
|
+
Ve(t) ? t = we : h(t.parentNode, n), t._gsMaxScrollX = i, t._gsMaxScrollY = l, n || (t._gsScrollX = t.scrollLeft || 0, t._gsScrollY = t.scrollTop || 0);
|
|
101
|
+
}, Mt = function(t, n, i) {
|
|
102
|
+
var l = t.style;
|
|
103
|
+
l && (ue(l[n]) && (n = je(n, t) || n), i == null ? l.removeProperty && l.removeProperty(n.replace(/([A-Z])/g, "-$1").toLowerCase()) : l[n] = i);
|
|
104
|
+
}, rt = function(t) {
|
|
105
|
+
return Y.getComputedStyle(t instanceof Element ? t : t.host || (t.parentNode || {}).host || t);
|
|
106
|
+
}, Oe = {}, We = function(t) {
|
|
107
|
+
if (t === Y)
|
|
108
|
+
return Oe.left = Oe.top = 0, Oe.width = Oe.right = de.clientWidth || t.innerWidth || ve.clientWidth || 0, Oe.height = Oe.bottom = (t.innerHeight || 0) - 20 < de.clientHeight ? de.clientHeight : t.innerHeight || ve.clientHeight || 0, Oe;
|
|
109
|
+
var n = t.ownerDocument || te, i = ue(t.pageX) ? !t.nodeType && !ue(t.left) && !ue(t.top) ? t : Pe(t)[0].getBoundingClientRect() : {
|
|
110
|
+
left: t.pageX - Qe(n),
|
|
111
|
+
top: t.pageY - Ge(n),
|
|
112
|
+
right: t.pageX - Qe(n) + 1,
|
|
113
|
+
bottom: t.pageY - Ge(n) + 1
|
|
114
|
+
};
|
|
115
|
+
return ue(i.right) && !ue(i.width) ? (i.right = i.left + i.width, i.bottom = i.top + i.height) : ue(i.width) && (i = {
|
|
116
|
+
width: i.right - i.left,
|
|
117
|
+
height: i.bottom - i.top,
|
|
118
|
+
right: i.right,
|
|
119
|
+
left: i.left,
|
|
120
|
+
bottom: i.bottom,
|
|
121
|
+
top: i.top
|
|
122
|
+
}), i;
|
|
123
|
+
}, F = function(t, n, i) {
|
|
124
|
+
var l = t.vars, f = l[i], x = t._listeners[n], c;
|
|
125
|
+
return Ee(f) && (c = f.apply(l.callbackScope || t, l[i + "Params"] || [t.pointerEvent])), x && t.dispatchEvent(n) === !1 && (c = !1), c;
|
|
126
|
+
}, jt = function(t, n) {
|
|
127
|
+
var i = Pe(t)[0], l, f, x;
|
|
128
|
+
return !i.nodeType && i !== Y ? ue(t.left) ? (f = t.min || t.minX || t.minRotation || 0, l = t.min || t.minY || 0, {
|
|
129
|
+
left: f,
|
|
130
|
+
top: l,
|
|
131
|
+
width: (t.max || t.maxX || t.maxRotation || 0) - f,
|
|
132
|
+
height: (t.max || t.maxY || 0) - l
|
|
133
|
+
}) : (x = {
|
|
134
|
+
x: 0,
|
|
135
|
+
y: 0
|
|
136
|
+
}, {
|
|
137
|
+
left: t.left - x.x,
|
|
138
|
+
top: t.top - x.y,
|
|
139
|
+
width: t.width,
|
|
140
|
+
height: t.height
|
|
141
|
+
}) : vi(i, n);
|
|
142
|
+
}, le = {}, vi = function(t, n) {
|
|
143
|
+
n = Pe(n)[0];
|
|
144
|
+
var i = t.getBBox && t.ownerSVGElement, l = t.ownerDocument || te, f, x, c, L, b, _, D, S, e, y, R, J, N;
|
|
145
|
+
if (t === Y)
|
|
146
|
+
c = Ge(l), f = Qe(l), x = f + (l.documentElement.clientWidth || t.innerWidth || l.body.clientWidth || 0), L = c + ((t.innerHeight || 0) - 20 < l.documentElement.clientHeight ? l.documentElement.clientHeight : t.innerHeight || l.body.clientHeight || 0);
|
|
147
|
+
else {
|
|
148
|
+
if (n === Y || ue(n))
|
|
149
|
+
return t.getBoundingClientRect();
|
|
150
|
+
f = c = 0, i ? (y = t.getBBox(), R = y.width, J = y.height) : (t.viewBox && (y = t.viewBox.baseVal) && (f = y.x || 0, c = y.y || 0, R = y.width, J = y.height), R || (N = rt(t), y = N.boxSizing === "border-box", R = (parseFloat(N.width) || t.clientWidth || 0) + (y ? 0 : parseFloat(N.borderLeftWidth) + parseFloat(N.borderRightWidth)), J = (parseFloat(N.height) || t.clientHeight || 0) + (y ? 0 : parseFloat(N.borderTopWidth) + parseFloat(N.borderBottomWidth)))), x = R, L = J;
|
|
151
|
+
}
|
|
152
|
+
return t === n ? {
|
|
153
|
+
left: f,
|
|
154
|
+
top: c,
|
|
155
|
+
width: x - f,
|
|
156
|
+
height: L - c
|
|
157
|
+
} : (b = Ie(n, !0).multiply(Ie(t)), _ = b.apply({
|
|
158
|
+
x: f,
|
|
159
|
+
y: c
|
|
160
|
+
}), D = b.apply({
|
|
161
|
+
x,
|
|
162
|
+
y: c
|
|
163
|
+
}), S = b.apply({
|
|
164
|
+
x,
|
|
165
|
+
y: L
|
|
166
|
+
}), e = b.apply({
|
|
167
|
+
x: f,
|
|
168
|
+
y: L
|
|
169
|
+
}), f = Math.min(_.x, D.x, S.x, e.x), c = Math.min(_.y, D.y, S.y, e.y), {
|
|
170
|
+
left: f,
|
|
171
|
+
top: c,
|
|
172
|
+
width: Math.max(_.x, D.x, S.x, e.x) - f,
|
|
173
|
+
height: Math.max(_.y, D.y, S.y, e.y) - c
|
|
174
|
+
});
|
|
175
|
+
}, St = function(t, n, i, l, f, x) {
|
|
176
|
+
var c = {}, L, b, _;
|
|
177
|
+
if (n)
|
|
178
|
+
if (f !== 1 && n instanceof Array) {
|
|
179
|
+
if (c.end = L = [], _ = n.length, it(n[0]))
|
|
180
|
+
for (b = 0; b < _; b++)
|
|
181
|
+
L[b] = ri(n[b], f);
|
|
182
|
+
else
|
|
183
|
+
for (b = 0; b < _; b++)
|
|
184
|
+
L[b] = n[b] * f;
|
|
185
|
+
i += 1.1, l -= 1.1;
|
|
186
|
+
} else Ee(n) ? c.end = function(D) {
|
|
187
|
+
var S = n.call(t, D), e, y;
|
|
188
|
+
if (f !== 1)
|
|
189
|
+
if (it(S)) {
|
|
190
|
+
e = {};
|
|
191
|
+
for (y in S)
|
|
192
|
+
e[y] = S[y] * f;
|
|
193
|
+
S = e;
|
|
194
|
+
} else
|
|
195
|
+
S *= f;
|
|
196
|
+
return S;
|
|
197
|
+
} : c.end = n;
|
|
198
|
+
return (i || i === 0) && (c.max = i), (l || l === 0) && (c.min = l), x && (c.velocity = 0), c;
|
|
199
|
+
}, Ti = function h(t) {
|
|
200
|
+
var n;
|
|
201
|
+
return !t || !t.getAttribute || t === ve ? !1 : (n = t.getAttribute("data-clickable")) === "true" || n !== "false" && (gi.test(t.nodeName + "") || t.getAttribute("contentEditable") === "true") ? !0 : h(t.parentNode);
|
|
202
|
+
}, ut = function(t, n) {
|
|
203
|
+
for (var i = t.length, l; i--; )
|
|
204
|
+
l = t[i], l.ondragstart = l.onselectstart = n ? null : ht, v.set(l, {
|
|
205
|
+
lazy: !0,
|
|
206
|
+
userSelect: n ? "text" : "none"
|
|
207
|
+
});
|
|
208
|
+
}, bi = function h(t) {
|
|
209
|
+
if (rt(t).position === "fixed")
|
|
210
|
+
return !0;
|
|
211
|
+
if (t = t.parentNode, t && t.nodeType === 1)
|
|
212
|
+
return h(t);
|
|
213
|
+
}, si, Xt, Di = function(t, n) {
|
|
214
|
+
t = v.utils.toArray(t)[0], n = n || {};
|
|
215
|
+
var i = document.createElement("div"), l = i.style, f = t.firstChild, x = 0, c = 0, L = t.scrollTop, b = t.scrollLeft, _ = t.scrollWidth, D = t.scrollHeight, S = 0, e = 0, y = 0, R, J, N, ke, Le, Ce;
|
|
216
|
+
si && n.force3D !== !1 ? (Le = "translate3d(", Ce = "px,0px)") : ot && (Le = "translate(", Ce = "px)"), this.scrollTop = function(E, j) {
|
|
217
|
+
if (!arguments.length)
|
|
218
|
+
return -this.top();
|
|
219
|
+
this.top(-E, j);
|
|
220
|
+
}, this.scrollLeft = function(E, j) {
|
|
221
|
+
if (!arguments.length)
|
|
222
|
+
return -this.left();
|
|
223
|
+
this.left(-E, j);
|
|
224
|
+
}, this.left = function(E, j) {
|
|
225
|
+
if (!arguments.length)
|
|
226
|
+
return -(t.scrollLeft + c);
|
|
227
|
+
var I = t.scrollLeft - b, M = c;
|
|
228
|
+
if ((I > 2 || I < -2) && !j) {
|
|
229
|
+
b = t.scrollLeft, v.killTweensOf(this, {
|
|
230
|
+
left: 1,
|
|
231
|
+
scrollLeft: 1
|
|
232
|
+
}), this.left(-b), n.onKill && n.onKill();
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
E = -E, E < 0 ? (c = E - 0.5 | 0, E = 0) : E > e ? (c = E - e | 0, E = e) : c = 0, (c || M) && (this._skip || (l[ot] = Le + -c + "px," + -x + Ce), c + S >= 0 && (l.paddingRight = c + S + "px")), t.scrollLeft = E | 0, b = t.scrollLeft;
|
|
236
|
+
}, this.top = function(E, j) {
|
|
237
|
+
if (!arguments.length)
|
|
238
|
+
return -(t.scrollTop + x);
|
|
239
|
+
var I = t.scrollTop - L, M = x;
|
|
240
|
+
if ((I > 2 || I < -2) && !j) {
|
|
241
|
+
L = t.scrollTop, v.killTweensOf(this, {
|
|
242
|
+
top: 1,
|
|
243
|
+
scrollTop: 1
|
|
244
|
+
}), this.top(-L), n.onKill && n.onKill();
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
E = -E, E < 0 ? (x = E - 0.5 | 0, E = 0) : E > y ? (x = E - y | 0, E = y) : x = 0, (x || M) && (this._skip || (l[ot] = Le + -c + "px," + -x + Ce)), t.scrollTop = E | 0, L = t.scrollTop;
|
|
248
|
+
}, this.maxScrollTop = function() {
|
|
249
|
+
return y;
|
|
250
|
+
}, this.maxScrollLeft = function() {
|
|
251
|
+
return e;
|
|
252
|
+
}, this.disable = function() {
|
|
253
|
+
for (f = i.firstChild; f; )
|
|
254
|
+
ke = f.nextSibling, t.appendChild(f), f = ke;
|
|
255
|
+
t === i.parentNode && t.removeChild(i);
|
|
256
|
+
}, this.enable = function() {
|
|
257
|
+
if (f = t.firstChild, f !== i) {
|
|
258
|
+
for (; f; )
|
|
259
|
+
ke = f.nextSibling, i.appendChild(f), f = ke;
|
|
260
|
+
t.appendChild(i), this.calibrate();
|
|
261
|
+
}
|
|
262
|
+
}, this.calibrate = function(E) {
|
|
263
|
+
var j = t.clientWidth === R, I, M, xe;
|
|
264
|
+
L = t.scrollTop, b = t.scrollLeft, !(j && t.clientHeight === J && i.offsetHeight === N && _ === t.scrollWidth && D === t.scrollHeight && !E) && ((x || c) && (M = this.left(), xe = this.top(), this.left(-t.scrollLeft), this.top(-t.scrollTop)), I = rt(t), (!j || E) && (l.display = "block", l.width = "auto", l.paddingRight = "0px", S = Math.max(0, t.scrollWidth - t.clientWidth), S && (S += parseFloat(I.paddingLeft) + (Xt ? parseFloat(I.paddingRight) : 0))), l.display = "inline-block", l.position = "relative", l.overflow = "visible", l.verticalAlign = "top", l.boxSizing = "content-box", l.width = "100%", l.paddingRight = S + "px", Xt && (l.paddingBottom = I.paddingBottom), R = t.clientWidth, J = t.clientHeight, _ = t.scrollWidth, D = t.scrollHeight, e = t.scrollWidth - R, y = t.scrollHeight - J, N = i.offsetHeight, l.display = "block", (M || xe) && (this.left(M), this.top(xe)));
|
|
265
|
+
}, this.content = i, this.element = t, this._skip = !1, this.enable();
|
|
266
|
+
}, Et = function(t) {
|
|
267
|
+
if (oi() && document.body) {
|
|
268
|
+
var n = window && window.navigator;
|
|
269
|
+
Y = window, te = document, de = te.documentElement, ve = te.body, bt = ct("div"), dt = !!window.PointerEvent, _e = ct("div"), _e.style.cssText = "visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab", tt = _e.style.cursor === "grab" ? "grab" : "move", et = n && n.userAgent.toLowerCase().indexOf("android") !== -1, kt = "ontouchstart" in de && "orientation" in Y || n && (n.MaxTouchPoints > 0 || n.msMaxTouchPoints > 0), Xt = function() {
|
|
270
|
+
var i = ct("div"), l = ct("div"), f = l.style, x = ve, c;
|
|
271
|
+
return f.display = "inline-block", f.position = "relative", i.style.cssText = "width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden", i.appendChild(l), x.appendChild(i), c = l.offsetHeight + 18 > i.scrollHeight, x.removeChild(i), c;
|
|
272
|
+
}(), nt = function(i) {
|
|
273
|
+
for (var l = i.split(","), f = ("onpointerdown" in bt ? "pointerdown,pointermove,pointerup,pointercancel" : "onmspointerdown" in bt ? "MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel" : i).split(","), x = {}, c = 4; --c > -1; )
|
|
274
|
+
x[l[c]] = f[c], x[f[c]] = l[c];
|
|
275
|
+
try {
|
|
276
|
+
de.addEventListener("test", null, Object.defineProperty({}, "passive", {
|
|
277
|
+
get: function() {
|
|
278
|
+
ti = 1;
|
|
279
|
+
}
|
|
280
|
+
}));
|
|
281
|
+
} catch {
|
|
282
|
+
}
|
|
283
|
+
return x;
|
|
284
|
+
}("touchstart,touchmove,touchend,touchcancel"), V(te, "touchcancel", ht), V(Y, "touchmove", ht), ve && ve.addEventListener("touchstart", ht), V(te, "contextmenu", function() {
|
|
285
|
+
for (var i in ze)
|
|
286
|
+
ze[i].isPressed && ze[i].endDrag();
|
|
287
|
+
}), v = Pt = ni();
|
|
288
|
+
}
|
|
289
|
+
v ? (ce = v.plugins.inertia, ii = v.core.context || function() {
|
|
290
|
+
}, je = v.utils.checkPrefix, ot = je(ot), Ct = je(Ct), Pe = v.utils.toArray, Lt = v.core.getStyleSaver, si = !!je("perspective")) : t && console.warn("Please gsap.registerPlugin(Draggable)");
|
|
291
|
+
}, Mi = /* @__PURE__ */ function() {
|
|
292
|
+
function h(n) {
|
|
293
|
+
this._listeners = {}, this.target = n || this;
|
|
294
|
+
}
|
|
295
|
+
var t = h.prototype;
|
|
296
|
+
return t.addEventListener = function(i, l) {
|
|
297
|
+
var f = this._listeners[i] || (this._listeners[i] = []);
|
|
298
|
+
~f.indexOf(l) || f.push(l);
|
|
299
|
+
}, t.removeEventListener = function(i, l) {
|
|
300
|
+
var f = this._listeners[i], x = f && f.indexOf(l);
|
|
301
|
+
x >= 0 && f.splice(x, 1);
|
|
302
|
+
}, t.dispatchEvent = function(i) {
|
|
303
|
+
var l = this, f;
|
|
304
|
+
return (this._listeners[i] || []).forEach(function(x) {
|
|
305
|
+
return x.call(l, {
|
|
306
|
+
type: i,
|
|
307
|
+
target: l.target
|
|
308
|
+
}) === !1 && (f = !1);
|
|
309
|
+
}), f;
|
|
310
|
+
}, h;
|
|
311
|
+
}(), gt = /* @__PURE__ */ function(h) {
|
|
312
|
+
di(t, h);
|
|
313
|
+
function t(n, i) {
|
|
314
|
+
var l;
|
|
315
|
+
l = h.call(this) || this, Pt || Et(1), n = Pe(n)[0], l.styles = Lt && Lt(n, "transform,left,top"), ce || (ce = v.plugins.inertia), l.vars = i = ri(i || {}), l.target = n, l.x = l.y = l.rotation = 0, l.dragResistance = parseFloat(i.dragResistance) || 0, l.edgeResistance = isNaN(i.edgeResistance) ? 1 : parseFloat(i.edgeResistance) || 0, l.lockAxis = i.lockAxis, l.autoScroll = i.autoScroll || 0, l.lockedAxis = null, l.allowEventDefault = !!i.allowEventDefault, v.getProperty(n, "x");
|
|
316
|
+
var f = (i.type || "x,y").toLowerCase(), x = ~f.indexOf("x") || ~f.indexOf("y"), c = f.indexOf("rotation") !== -1, L = c ? "rotation" : x ? "x" : "left", b = x ? "y" : "top", _ = !!(~f.indexOf("x") || ~f.indexOf("left") || f === "scroll"), D = !!(~f.indexOf("y") || ~f.indexOf("top") || f === "scroll"), S = i.minimumMovement || 2, e = zt(l), y = Pe(i.trigger || i.handle || n), R = {}, J = 0, N = !1, ke = i.autoScrollMarginTop || 40, Le = i.autoScrollMarginRight || 40, Ce = i.autoScrollMarginBottom || 40, E = i.autoScrollMarginLeft || 40, j = i.clickableTest || Ti, I = 0, M = n._gsap || v.core.getCache(n), xe = bi(n), Fe = function(o, s) {
|
|
317
|
+
return parseFloat(M.get(n, o, s));
|
|
318
|
+
}, P = n.ownerDocument || te, ye, m, he, pe, U, G, Xe, Rt, Nt, O, A, Q, H, lt, ie, Ke, K, xt, Te, be, Ye, Ue, q, k, At, oe, se, yt, mt, Ot, ee, It, st, Bt = function(o) {
|
|
319
|
+
return re(o), o.stopImmediatePropagation && o.stopImmediatePropagation(), !1;
|
|
320
|
+
}, ge = function g(o) {
|
|
321
|
+
if (e.autoScroll && e.isDragging && (N || K)) {
|
|
322
|
+
var s = n, r = e.autoScroll * 15, a, u, d, w, p, C, T, X;
|
|
323
|
+
for (N = !1, we.scrollTop = Y.pageYOffset != null ? Y.pageYOffset : P.documentElement.scrollTop != null ? P.documentElement.scrollTop : P.body.scrollTop, we.scrollLeft = Y.pageXOffset != null ? Y.pageXOffset : P.documentElement.scrollLeft != null ? P.documentElement.scrollLeft : P.body.scrollLeft, w = e.pointerX - we.scrollLeft, p = e.pointerY - we.scrollTop; s && !u; )
|
|
324
|
+
u = Ve(s.parentNode), a = u ? we : s.parentNode, d = u ? {
|
|
325
|
+
bottom: Math.max(de.clientHeight, Y.innerHeight || 0),
|
|
326
|
+
right: Math.max(de.clientWidth, Y.innerWidth || 0),
|
|
327
|
+
left: 0,
|
|
328
|
+
top: 0
|
|
329
|
+
} : a.getBoundingClientRect(), C = T = 0, D && (X = a._gsMaxScrollY - a.scrollTop, X < 0 ? T = X : p > d.bottom - Ce && X ? (N = !0, T = Math.min(X, r * (1 - Math.max(0, d.bottom - p) / Ce) | 0)) : p < d.top + ke && a.scrollTop && (N = !0, T = -Math.min(a.scrollTop, r * (1 - Math.max(0, p - d.top) / ke) | 0)), T && (a.scrollTop += T)), _ && (X = a._gsMaxScrollX - a.scrollLeft, X < 0 ? C = X : w > d.right - Le && X ? (N = !0, C = Math.min(X, r * (1 - Math.max(0, d.right - w) / Le) | 0)) : w < d.left + E && a.scrollLeft && (N = !0, C = -Math.min(a.scrollLeft, r * (1 - Math.max(0, w - d.left) / E) | 0)), C && (a.scrollLeft += C)), u && (C || T) && (Y.scrollTo(a.scrollLeft, a.scrollTop), Je(e.pointerX + C, e.pointerY + T)), s = a;
|
|
330
|
+
}
|
|
331
|
+
if (K) {
|
|
332
|
+
var B = e.x, Z = e.y;
|
|
333
|
+
c ? (e.deltaX = B - parseFloat(M.rotation), e.rotation = B, M.rotation = B + "deg", M.renderTransform(1, M)) : m ? (D && (e.deltaY = Z - m.top(), m.top(Z)), _ && (e.deltaX = B - m.left(), m.left(B))) : x ? (D && (e.deltaY = Z - parseFloat(M.y), M.y = Z + "px"), _ && (e.deltaX = B - parseFloat(M.x), M.x = B + "px"), M.renderTransform(1, M)) : (D && (e.deltaY = Z - parseFloat(n.style.top || 0), n.style.top = Z + "px"), _ && (e.deltaX = B - parseFloat(n.style.left || 0), n.style.left = B + "px")), Rt && !o && !yt && (yt = !0, F(e, "drag", "onDrag") === !1 && (_ && (e.x -= e.deltaX), D && (e.y -= e.deltaY), g(!0)), yt = !1);
|
|
334
|
+
}
|
|
335
|
+
K = !1;
|
|
336
|
+
}, Re = function(o, s) {
|
|
337
|
+
var r = e.x, a = e.y, u, d;
|
|
338
|
+
n._gsap || (M = v.core.getCache(n)), M.uncache && v.getProperty(n, "x"), x ? (e.x = parseFloat(M.x), e.y = parseFloat(M.y)) : c ? e.x = e.rotation = parseFloat(M.rotation) : m ? (e.y = m.top(), e.x = m.left()) : (e.y = parseFloat(n.style.top || (d = rt(n)) && d.top) || 0, e.x = parseFloat(n.style.left || (d || {}).left) || 0), (Te || be || Ye) && !s && (e.isDragging || e.isThrowing) && (Ye && (He.x = e.x, He.y = e.y, u = Ye(He), u.x !== e.x && (e.x = u.x, K = !0), u.y !== e.y && (e.y = u.y, K = !0)), Te && (u = Te(e.x), u !== e.x && (e.x = u, c && (e.rotation = u), K = !0)), be && (u = be(e.y), u !== e.y && (e.y = u), K = !0)), K && ge(!0), o || (e.deltaX = e.x - r, e.deltaY = e.y - a, F(e, "throwupdate", "onThrowUpdate"));
|
|
339
|
+
}, wt = function(o, s, r, a) {
|
|
340
|
+
return s == null && (s = -Ae), r == null && (r = Ae), Ee(o) ? function(u) {
|
|
341
|
+
var d = e.isPressed ? 1 - e.edgeResistance : 1;
|
|
342
|
+
return o.call(e, (u > r ? r + (u - r) * d : u < s ? s + (u - s) * d : u) * a) * a;
|
|
343
|
+
} : Ze(o) ? function(u) {
|
|
344
|
+
for (var d = o.length, w = 0, p = Ae, C, T; --d > -1; )
|
|
345
|
+
C = o[d], T = C - u, T < 0 && (T = -T), T < p && C >= s && C <= r && (w = d, p = T);
|
|
346
|
+
return o[w];
|
|
347
|
+
} : isNaN(o) ? function(u) {
|
|
348
|
+
return u;
|
|
349
|
+
} : function() {
|
|
350
|
+
return o * a;
|
|
351
|
+
};
|
|
352
|
+
}, ai = function(o, s, r, a, u, d, w) {
|
|
353
|
+
return d = d && d < Ae ? d * d : Ae, Ee(o) ? function(p) {
|
|
354
|
+
var C = e.isPressed ? 1 - e.edgeResistance : 1, T = p.x, X = p.y, B, Z, me;
|
|
355
|
+
return p.x = T = T > r ? r + (T - r) * C : T < s ? s + (T - s) * C : T, p.y = X = X > u ? u + (X - u) * C : X < a ? a + (X - a) * C : X, B = o.call(e, p), B !== p && (p.x = B.x, p.y = B.y), w !== 1 && (p.x *= w, p.y *= w), d < Ae && (Z = p.x - T, me = p.y - X, Z * Z + me * me > d && (p.x = T, p.y = X)), p;
|
|
356
|
+
} : Ze(o) ? function(p) {
|
|
357
|
+
for (var C = o.length, T = 0, X = Ae, B, Z, me, ne; --C > -1; )
|
|
358
|
+
me = o[C], B = me.x - p.x, Z = me.y - p.y, ne = B * B + Z * Z, ne < X && (T = C, X = ne);
|
|
359
|
+
return X <= d ? o[T] : p;
|
|
360
|
+
} : function(p) {
|
|
361
|
+
return p;
|
|
362
|
+
};
|
|
363
|
+
}, _t = function() {
|
|
364
|
+
var o, s, r, a;
|
|
365
|
+
Xe = !1, m ? (m.calibrate(), e.minX = A = -m.maxScrollLeft(), e.minY = H = -m.maxScrollTop(), e.maxX = O = e.maxY = Q = 0, Xe = !0) : i.bounds && (o = jt(i.bounds, n.parentNode), c ? (e.minX = A = o.left, e.maxX = O = o.left + o.width, e.minY = H = e.maxY = Q = 0) : !ue(i.bounds.maxX) || !ue(i.bounds.maxY) ? (o = i.bounds, e.minX = A = o.minX, e.minY = H = o.minY, e.maxX = O = o.maxX, e.maxY = Q = o.maxY) : (s = jt(n, n.parentNode), e.minX = A = Math.round(Fe(L, "px") + o.left - s.left), e.minY = H = Math.round(Fe(b, "px") + o.top - s.top), e.maxX = O = Math.round(A + (o.width - s.width)), e.maxY = Q = Math.round(H + (o.height - s.height))), A > O && (e.minX = O, e.maxX = O = A, A = e.minX), H > Q && (e.minY = Q, e.maxY = Q = H, H = e.minY), c && (e.minRotation = A, e.maxRotation = O), Xe = !0), i.liveSnap && (r = i.liveSnap === !0 ? i.snap || {} : i.liveSnap, a = Ze(r) || Ee(r), c ? (Te = wt(a ? r : r.rotation, A, O, 1), be = null) : r.points ? Ye = ai(a ? r : r.points, A, O, H, Q, r.radius, m ? -1 : 1) : (_ && (Te = wt(a ? r : r.x || r.left || r.scrollLeft, A, O, m ? -1 : 1)), D && (be = wt(a ? r : r.y || r.top || r.scrollTop, H, Q, m ? -1 : 1))));
|
|
366
|
+
}, fi = function() {
|
|
367
|
+
e.isThrowing = !1, F(e, "throwcomplete", "onThrowComplete");
|
|
368
|
+
}, ci = function() {
|
|
369
|
+
e.isThrowing = !1;
|
|
370
|
+
}, vt = function(o, s) {
|
|
371
|
+
var r, a, u, d;
|
|
372
|
+
o && ce ? (o === !0 && (r = i.snap || i.liveSnap || {}, a = Ze(r) || Ee(r), o = {
|
|
373
|
+
resistance: (i.throwResistance || i.resistance || 1e3) / (c ? 10 : 1)
|
|
374
|
+
}, c ? o.rotation = St(e, a ? r : r.rotation, O, A, 1, s) : (_ && (o[L] = St(e, a ? r : r.points || r.x || r.left, O, A, m ? -1 : 1, s || e.lockedAxis === "x")), D && (o[b] = St(e, a ? r : r.points || r.y || r.top, Q, H, m ? -1 : 1, s || e.lockedAxis === "y")), (r.points || Ze(r) && it(r[0])) && (o.linkedProps = L + "," + b, o.radius = r.radius))), e.isThrowing = !0, d = isNaN(i.overshootTolerance) ? i.edgeResistance === 1 ? 0 : 1 - e.edgeResistance + 0.2 : i.overshootTolerance, o.duration || (o.duration = {
|
|
375
|
+
max: Math.max(i.minDuration || 0, "maxDuration" in i ? i.maxDuration : 2),
|
|
376
|
+
min: isNaN(i.minDuration) ? d === 0 || it(o) && o.resistance > 1e3 ? 0 : 0.5 : i.minDuration,
|
|
377
|
+
overshoot: d
|
|
378
|
+
}), e.tween = u = v.to(m || n, {
|
|
379
|
+
inertia: o,
|
|
380
|
+
data: "_draggable",
|
|
381
|
+
inherit: !1,
|
|
382
|
+
onComplete: fi,
|
|
383
|
+
onInterrupt: ci,
|
|
384
|
+
onUpdate: i.fastMode ? F : Re,
|
|
385
|
+
onUpdateParams: i.fastMode ? [e, "onthrowupdate", "onThrowUpdate"] : r && r.radius ? [!1, !0] : []
|
|
386
|
+
}), i.fastMode || (m && (m._skip = !0), u.render(1e9, !0, !0), Re(!0, !0), e.endX = e.x, e.endY = e.y, c && (e.endRotation = e.x), u.play(0), Re(!0, !0), m && (m._skip = !1))) : Xe && e.applyBounds();
|
|
387
|
+
}, Ft = function(o) {
|
|
388
|
+
var s = k, r;
|
|
389
|
+
k = Ie(n.parentNode, !0), o && e.isPressed && !k.equals(s || new ei()) && (r = s.inverse().apply({
|
|
390
|
+
x: he,
|
|
391
|
+
y: pe
|
|
392
|
+
}), k.apply(r, r), he = r.x, pe = r.y), k.equals(hi) && (k = null);
|
|
393
|
+
}, at = function() {
|
|
394
|
+
var o = 1 - e.edgeResistance, s = xe ? Qe(P) : 0, r = xe ? Ge(P) : 0, a, u, d;
|
|
395
|
+
x && (M.x = Fe(L, "px") + "px", M.y = Fe(b, "px") + "px", M.renderTransform()), Ft(!1), le.x = e.pointerX - s, le.y = e.pointerY - r, k && k.apply(le, le), he = le.x, pe = le.y, K && (Je(e.pointerX, e.pointerY), ge(!0)), It = Ie(n), m ? (_t(), G = m.top(), U = m.left()) : (qe() ? (Re(!0, !0), _t()) : e.applyBounds(), c ? (a = n.ownerSVGElement ? [M.xOrigin - n.getBBox().x, M.yOrigin - n.getBBox().y] : (rt(n)[Ct] || "0 0").split(" "), Ke = e.rotationOrigin = Ie(n).apply({
|
|
396
|
+
x: parseFloat(a[0]) || 0,
|
|
397
|
+
y: parseFloat(a[1]) || 0
|
|
398
|
+
}), Re(!0, !0), u = e.pointerX - Ke.x - s, d = Ke.y - e.pointerY + r, U = e.x, G = e.y = Math.atan2(d, u) * Gt) : (G = Fe(b, "px"), U = Fe(L, "px"))), Xe && o && (U > O ? U = O + (U - O) / o : U < A && (U = A - (A - U) / o), c || (G > Q ? G = Q + (G - Q) / o : G < H && (G = H - (H - G) / o))), e.startX = U = Me(U), e.startY = G = Me(G);
|
|
399
|
+
}, qe = function() {
|
|
400
|
+
return e.tween && e.tween.isActive();
|
|
401
|
+
}, ui = function() {
|
|
402
|
+
_e.parentNode && !qe() && !e.isDragging && _e.parentNode.removeChild(_e);
|
|
403
|
+
}, $e = function(o, s) {
|
|
404
|
+
var r;
|
|
405
|
+
if (!ye || e.isPressed || !o || (o.type === "mousedown" || o.type === "pointerdown") && !s && Se() - I < 30 && nt[e.pointerEvent.type]) {
|
|
406
|
+
ee && o && ye && re(o);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
if (At = qe(), st = !1, e.pointerEvent = o, nt[o.type] ? (q = ~o.type.indexOf("touch") ? o.currentTarget || o.target : P, V(q, "touchend", ae), V(q, "touchmove", Ne), V(q, "touchcancel", ae), V(P, "touchstart", qt)) : (q = null, V(P, "mousemove", Ne)), se = null, (!dt || !q) && (V(P, "mouseup", ae), o && o.target && V(o.target, "mouseup", ae)), Ue = j.call(e, o.target) && i.dragClickables === !1 && !s, Ue) {
|
|
410
|
+
V(o.target, "change", ae), F(e, "pressInit", "onPressInit"), F(e, "press", "onPress"), ut(y, !0), ee = !1;
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
if (oe = !q || _ === D || e.vars.allowNativeTouchScrolling === !1 || e.vars.allowContextMenu && o && (o.ctrlKey || o.which > 2) ? !1 : _ ? "y" : "x", ee = !oe && !e.allowEventDefault, ee && (re(o), V(Y, "touchforcechange", re)), o.changedTouches ? (o = lt = o.changedTouches[0], ie = o.identifier) : o.pointerId ? ie = o.pointerId : lt = ie = null, pt++, yi(ge), pe = e.pointerY = o.pageY, he = e.pointerX = o.pageX, F(e, "pressInit", "onPressInit"), (oe || e.autoScroll) && Dt(n.parentNode), n.parentNode && e.autoScroll && !m && !c && n.parentNode._gsMaxScrollX && !_e.parentNode && !n.getBBox && (_e.style.width = n.parentNode.scrollWidth + "px", n.parentNode.appendChild(_e)), at(), e.tween && e.tween.kill(), e.isThrowing = !1, v.killTweensOf(m || n, R, !0), m && v.killTweensOf(n, {
|
|
414
|
+
scrollTo: 1
|
|
415
|
+
}, !0), e.tween = e.lockedAxis = null, (i.zIndexBoost || !c && !m && i.zIndexBoost !== !1) && (n.style.zIndex = t.zIndex++), e.isPressed = !0, Rt = !!(i.onDrag || e._listeners.drag), Nt = !!(i.onMove || e._listeners.move), i.cursor !== !1 || i.activeCursor)
|
|
416
|
+
for (r = y.length; --r > -1; )
|
|
417
|
+
v.set(y[r], {
|
|
418
|
+
cursor: i.activeCursor || i.cursor || (tt === "grab" ? "grabbing" : tt)
|
|
419
|
+
});
|
|
420
|
+
F(e, "press", "onPress");
|
|
421
|
+
}, Ne = function(o) {
|
|
422
|
+
var s = o, r, a, u, d, w, p;
|
|
423
|
+
if (!ye || Yt || !e.isPressed || !o) {
|
|
424
|
+
ee && o && ye && re(o);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
if (e.pointerEvent = o, r = o.changedTouches, r) {
|
|
428
|
+
if (o = r[0], o !== lt && o.identifier !== ie) {
|
|
429
|
+
for (d = r.length; --d > -1 && (o = r[d]).identifier !== ie && o.target !== n; )
|
|
430
|
+
;
|
|
431
|
+
if (d < 0)
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
} else if (o.pointerId && ie && o.pointerId !== ie)
|
|
435
|
+
return;
|
|
436
|
+
if (q && oe && !se && (le.x = o.pageX - (xe ? Qe(P) : 0), le.y = o.pageY - (xe ? Ge(P) : 0), k && k.apply(le, le), a = le.x, u = le.y, w = Math.abs(a - he), p = Math.abs(u - pe), (w !== p && (w > S || p > S) || et && oe === se) && (se = w > p && _ ? "x" : "y", oe && se !== oe && V(Y, "touchforcechange", re), e.vars.lockAxisOnTouchScroll !== !1 && _ && D && (e.lockedAxis = se === "x" ? "y" : "x", Ee(e.vars.onLockAxis) && e.vars.onLockAxis.call(e, s)), et && oe === se))) {
|
|
437
|
+
ae(s);
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
!e.allowEventDefault && (!oe || se && oe !== se) && s.cancelable !== !1 ? (re(s), ee = !0) : ee && (ee = !1), e.autoScroll && (N = !0), Je(o.pageX, o.pageY, Nt);
|
|
441
|
+
}, Je = function(o, s, r) {
|
|
442
|
+
var a = 1 - e.dragResistance, u = 1 - e.edgeResistance, d = e.pointerX, w = e.pointerY, p = G, C = e.x, T = e.y, X = e.endX, B = e.endY, Z = e.endRotation, me = K, ne, De, $, W, Tt, fe;
|
|
443
|
+
e.pointerX = o, e.pointerY = s, xe && (o -= Qe(P), s -= Ge(P)), c ? (W = Math.atan2(Ke.y - s, o - Ke.x) * Gt, Tt = e.y - W, Tt > 180 ? (G -= 360, e.y = W) : Tt < -180 && (G += 360, e.y = W), e.x !== U || Math.max(Math.abs(he - o), Math.abs(pe - s)) > S ? (e.y = W, $ = U + (G - W) * a) : $ = U) : (k && (fe = o * k.a + s * k.c + k.e, s = o * k.b + s * k.d + k.f, o = fe), De = s - pe, ne = o - he, De < S && De > -S && (De = 0), ne < S && ne > -S && (ne = 0), (e.lockAxis || e.lockedAxis) && (ne || De) && (fe = e.lockedAxis, fe || (e.lockedAxis = fe = _ && Math.abs(ne) > Math.abs(De) ? "y" : D ? "x" : null, fe && Ee(e.vars.onLockAxis) && e.vars.onLockAxis.call(e, e.pointerEvent)), fe === "y" ? De = 0 : fe === "x" && (ne = 0)), $ = Me(U + ne * a), W = Me(G + De * a)), (Te || be || Ye) && (e.x !== $ || e.y !== W && !c) && (Ye && (He.x = $, He.y = W, fe = Ye(He), $ = Me(fe.x), W = Me(fe.y)), Te && ($ = Me(Te($))), be && (W = Me(be(W)))), Xe && ($ > O ? $ = O + Math.round(($ - O) * u) : $ < A && ($ = A + Math.round(($ - A) * u)), c || (W > Q ? W = Math.round(Q + (W - Q) * u) : W < H && (W = Math.round(H + (W - H) * u)))), (e.x !== $ || e.y !== W && !c) && (c ? (e.endRotation = e.x = e.endX = $, K = !0) : (D && (e.y = e.endY = W, K = !0), _ && (e.x = e.endX = $, K = !0)), !r || F(e, "move", "onMove") !== !1 ? !e.isDragging && e.isPressed && (e.isDragging = st = !0, F(e, "dragstart", "onDragStart")) : (e.pointerX = d, e.pointerY = w, G = p, e.x = C, e.y = T, e.endX = X, e.endY = B, e.endRotation = Z, K = me));
|
|
444
|
+
}, ae = function g(o, s) {
|
|
445
|
+
if (!ye || !e.isPressed || o && ie != null && !s && (o.pointerId && o.pointerId !== ie && o.target !== n || o.changedTouches && !wi(o.changedTouches, ie))) {
|
|
446
|
+
ee && o && ye && re(o);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
e.isPressed = !1;
|
|
450
|
+
var r = o, a = e.isDragging, u = e.vars.allowContextMenu && o && (o.ctrlKey || o.which > 2), d = v.delayedCall(1e-3, ui), w, p, C, T, X;
|
|
451
|
+
if (q ? (z(q, "touchend", g), z(q, "touchmove", Ne), z(q, "touchcancel", g), z(P, "touchstart", qt)) : z(P, "mousemove", Ne), z(Y, "touchforcechange", re), (!dt || !q) && (z(P, "mouseup", g), o && o.target && z(o.target, "mouseup", g)), K = !1, a && (J = Qt = Se(), e.isDragging = !1), Ut(ge), Ue && !u) {
|
|
452
|
+
o && (z(o.target, "change", g), e.pointerEvent = r), ut(y, !1), F(e, "release", "onRelease"), F(e, "click", "onClick"), Ue = !1;
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
for (p = y.length; --p > -1; )
|
|
456
|
+
Mt(y[p], "cursor", i.cursor || (i.cursor !== !1 ? tt : null));
|
|
457
|
+
if (pt--, o) {
|
|
458
|
+
if (w = o.changedTouches, w && (o = w[0], o !== lt && o.identifier !== ie)) {
|
|
459
|
+
for (p = w.length; --p > -1 && (o = w[p]).identifier !== ie && o.target !== n; )
|
|
460
|
+
;
|
|
461
|
+
if (p < 0 && !s)
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
e.pointerEvent = r, e.pointerX = o.pageX, e.pointerY = o.pageY;
|
|
465
|
+
}
|
|
466
|
+
return u && r ? (re(r), ee = !0, F(e, "release", "onRelease")) : r && !a ? (ee = !1, At && (i.snap || i.bounds) && vt(i.inertia || i.throwProps), F(e, "release", "onRelease"), (!et || r.type !== "touchmove") && r.type.indexOf("cancel") === -1 && (F(e, "click", "onClick"), Se() - I < 300 && F(e, "doubleclick", "onDoubleClick"), T = r.target || n, I = Se(), X = function() {
|
|
467
|
+
I !== mt && e.enabled() && !e.isPressed && !r.defaultPrevented && (T.click ? T.click() : P.createEvent && (C = P.createEvent("MouseEvents"), C.initMouseEvent("click", !0, !0, Y, 1, e.pointerEvent.screenX, e.pointerEvent.screenY, e.pointerX, e.pointerY, !1, !1, !1, !1, 0, null), T.dispatchEvent(C)));
|
|
468
|
+
}, !et && !r.defaultPrevented && v.delayedCall(0.05, X))) : (vt(i.inertia || i.throwProps), !e.allowEventDefault && r && (i.dragClickables !== !1 || !j.call(e, r.target)) && a && (!oe || se && oe === se) && r.cancelable !== !1 ? (ee = !0, re(r)) : ee = !1, F(e, "release", "onRelease")), qe() && d.duration(e.tween.duration()), a && F(e, "dragend", "onDragEnd"), !0;
|
|
469
|
+
}, ft = function(o) {
|
|
470
|
+
if (o && e.isDragging && !m) {
|
|
471
|
+
var s = o.target || n.parentNode, r = s.scrollLeft - s._gsScrollX, a = s.scrollTop - s._gsScrollY;
|
|
472
|
+
(r || a) && (k ? (he -= r * k.a + a * k.c, pe -= a * k.d + r * k.b) : (he -= r, pe -= a), s._gsScrollX += r, s._gsScrollY += a, Je(e.pointerX, e.pointerY));
|
|
473
|
+
}
|
|
474
|
+
}, Ht = function(o) {
|
|
475
|
+
var s = Se(), r = s - I < 100, a = s - J < 50, u = r && mt === I, d = e.pointerEvent && e.pointerEvent.defaultPrevented, w = r && Ot === I, p = o.isTrusted || o.isTrusted == null && r && u;
|
|
476
|
+
if ((u || a && e.vars.suppressClickOnDrag !== !1) && o.stopImmediatePropagation && o.stopImmediatePropagation(), r && !(e.pointerEvent && e.pointerEvent.defaultPrevented) && (!u || p && !w)) {
|
|
477
|
+
p && u && (Ot = I), mt = I;
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
(e.isPressed || a || r) && (!p || !o.detail || !r || d) && re(o), !r && !a && !st && (o && o.target && (e.pointerEvent = o), F(e, "click", "onClick"));
|
|
481
|
+
}, Wt = function(o) {
|
|
482
|
+
return k ? {
|
|
483
|
+
x: o.x * k.a + o.y * k.c + k.e,
|
|
484
|
+
y: o.x * k.b + o.y * k.d + k.f
|
|
485
|
+
} : {
|
|
486
|
+
x: o.x,
|
|
487
|
+
y: o.y
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
return xt = t.get(n), xt && xt.kill(), l.startDrag = function(g, o) {
|
|
491
|
+
var s, r, a, u;
|
|
492
|
+
$e(g || e.pointerEvent, !0), o && !e.hitTest(g || e.pointerEvent) && (s = We(g || e.pointerEvent), r = We(n), a = Wt({
|
|
493
|
+
x: s.left + s.width / 2,
|
|
494
|
+
y: s.top + s.height / 2
|
|
495
|
+
}), u = Wt({
|
|
496
|
+
x: r.left + r.width / 2,
|
|
497
|
+
y: r.top + r.height / 2
|
|
498
|
+
}), he -= a.x - u.x, pe -= a.y - u.y), e.isDragging || (e.isDragging = st = !0, F(e, "dragstart", "onDragStart"));
|
|
499
|
+
}, l.drag = Ne, l.endDrag = function(g) {
|
|
500
|
+
return ae(g || e.pointerEvent, !0);
|
|
501
|
+
}, l.timeSinceDrag = function() {
|
|
502
|
+
return e.isDragging ? 0 : (Se() - J) / 1e3;
|
|
503
|
+
}, l.timeSinceClick = function() {
|
|
504
|
+
return (Se() - I) / 1e3;
|
|
505
|
+
}, l.hitTest = function(g, o) {
|
|
506
|
+
return t.hitTest(e.target, g, o);
|
|
507
|
+
}, l.getDirection = function(g, o) {
|
|
508
|
+
var s = g === "velocity" && ce ? g : it(g) && !c ? "element" : "start", r, a, u, d, w, p;
|
|
509
|
+
return s === "element" && (w = We(e.target), p = We(g)), r = s === "start" ? e.x - U : s === "velocity" ? ce.getVelocity(n, L) : w.left + w.width / 2 - (p.left + p.width / 2), c ? r < 0 ? "counter-clockwise" : "clockwise" : (o = o || 2, a = s === "start" ? e.y - G : s === "velocity" ? ce.getVelocity(n, b) : w.top + w.height / 2 - (p.top + p.height / 2), u = Math.abs(r / a), d = u < 1 / o ? "" : r < 0 ? "left" : "right", u < o && (d !== "" && (d += "-"), d += a < 0 ? "up" : "down"), d);
|
|
510
|
+
}, l.applyBounds = function(g, o) {
|
|
511
|
+
var s, r, a, u, d, w;
|
|
512
|
+
if (g && i.bounds !== g)
|
|
513
|
+
return i.bounds = g, e.update(!0, o);
|
|
514
|
+
if (Re(!0), _t(), Xe && !qe()) {
|
|
515
|
+
if (s = e.x, r = e.y, s > O ? s = O : s < A && (s = A), r > Q ? r = Q : r < H && (r = H), (e.x !== s || e.y !== r) && (a = !0, e.x = e.endX = s, c ? e.endRotation = s : e.y = e.endY = r, K = !0, ge(!0), e.autoScroll && !e.isDragging))
|
|
516
|
+
for (Dt(n.parentNode), u = n, we.scrollTop = Y.pageYOffset != null ? Y.pageYOffset : P.documentElement.scrollTop != null ? P.documentElement.scrollTop : P.body.scrollTop, we.scrollLeft = Y.pageXOffset != null ? Y.pageXOffset : P.documentElement.scrollLeft != null ? P.documentElement.scrollLeft : P.body.scrollLeft; u && !w; )
|
|
517
|
+
w = Ve(u.parentNode), d = w ? we : u.parentNode, D && d.scrollTop > d._gsMaxScrollY && (d.scrollTop = d._gsMaxScrollY), _ && d.scrollLeft > d._gsMaxScrollX && (d.scrollLeft = d._gsMaxScrollX), u = d;
|
|
518
|
+
e.isThrowing && (a || e.endX > O || e.endX < A || e.endY > Q || e.endY < H) && vt(i.inertia || i.throwProps, a);
|
|
519
|
+
}
|
|
520
|
+
return e;
|
|
521
|
+
}, l.update = function(g, o, s) {
|
|
522
|
+
if (o && e.isPressed) {
|
|
523
|
+
var r = Ie(n), a = It.apply({
|
|
524
|
+
x: e.x - U,
|
|
525
|
+
y: e.y - G
|
|
526
|
+
}), u = Ie(n.parentNode, !0);
|
|
527
|
+
u.apply({
|
|
528
|
+
x: r.e - a.x,
|
|
529
|
+
y: r.f - a.y
|
|
530
|
+
}, a), e.x -= a.x - u.e, e.y -= a.y - u.f, ge(!0), at();
|
|
531
|
+
}
|
|
532
|
+
var d = e.x, w = e.y;
|
|
533
|
+
return Ft(!o), g ? e.applyBounds() : (K && s && ge(!0), Re(!0)), o && (Je(e.pointerX, e.pointerY), K && ge(!0)), e.isPressed && !o && (_ && Math.abs(d - e.x) > 0.01 || D && Math.abs(w - e.y) > 0.01 && !c) && at(), e.autoScroll && (Dt(n.parentNode, e.isDragging), N = e.isDragging, ge(!0), Jt(n, ft), $t(n, ft)), e;
|
|
534
|
+
}, l.enable = function(g) {
|
|
535
|
+
var o = {
|
|
536
|
+
lazy: !0
|
|
537
|
+
}, s, r, a;
|
|
538
|
+
if (i.cursor !== !1 && (o.cursor = i.cursor || tt), v.utils.checkPrefix("touchCallout") && (o.touchCallout = "none"), g !== "soft") {
|
|
539
|
+
for (Vt(y, _ === D ? "none" : i.allowNativeTouchScrolling && n.scrollHeight === n.clientHeight == (n.scrollWidth === n.clientHeight) || i.allowEventDefault ? "manipulation" : _ ? "pan-y" : "pan-x"), r = y.length; --r > -1; )
|
|
540
|
+
a = y[r], dt || V(a, "mousedown", $e), V(a, "touchstart", $e), V(a, "click", Ht, !0), v.set(a, o), a.getBBox && a.ownerSVGElement && _ !== D && v.set(a.ownerSVGElement, {
|
|
541
|
+
touchAction: i.allowNativeTouchScrolling || i.allowEventDefault ? "manipulation" : _ ? "pan-y" : "pan-x"
|
|
542
|
+
}), i.allowContextMenu || V(a, "contextmenu", Bt);
|
|
543
|
+
ut(y, !1);
|
|
544
|
+
}
|
|
545
|
+
return $t(n, ft), ye = !0, ce && g !== "soft" && ce.track(m || n, x ? "x,y" : c ? "rotation" : "top,left"), n._gsDragID = s = n._gsDragID || "d" + pi++, ze[s] = e, m && (m.enable(), m.element._gsDragID = s), (i.bounds || c) && at(), i.bounds && e.applyBounds(), e;
|
|
546
|
+
}, l.disable = function(g) {
|
|
547
|
+
for (var o = e.isDragging, s = y.length, r; --s > -1; )
|
|
548
|
+
Mt(y[s], "cursor", null);
|
|
549
|
+
if (g !== "soft") {
|
|
550
|
+
for (Vt(y, null), s = y.length; --s > -1; )
|
|
551
|
+
r = y[s], Mt(r, "touchCallout", null), z(r, "mousedown", $e), z(r, "touchstart", $e), z(r, "click", Ht, !0), z(r, "contextmenu", Bt);
|
|
552
|
+
ut(y, !0), q && (z(q, "touchcancel", ae), z(q, "touchend", ae), z(q, "touchmove", Ne)), z(P, "mouseup", ae), z(P, "mousemove", Ne);
|
|
553
|
+
}
|
|
554
|
+
return Jt(n, ft), ye = !1, ce && g !== "soft" && (ce.untrack(m || n, x ? "x,y" : c ? "rotation" : "top,left"), e.tween && e.tween.kill()), m && m.disable(), Ut(ge), e.isDragging = e.isPressed = Ue = !1, o && F(e, "dragend", "onDragEnd"), e;
|
|
555
|
+
}, l.enabled = function(g, o) {
|
|
556
|
+
return arguments.length ? g ? e.enable(o) : e.disable(o) : ye;
|
|
557
|
+
}, l.kill = function() {
|
|
558
|
+
return e.isThrowing = !1, e.tween && e.tween.kill(), e.disable(), v.set(y, {
|
|
559
|
+
clearProps: "userSelect"
|
|
560
|
+
}), delete ze[n._gsDragID], e;
|
|
561
|
+
}, l.revert = function() {
|
|
562
|
+
this.kill(), this.styles && this.styles.revert();
|
|
563
|
+
}, ~f.indexOf("scroll") && (m = l.scrollProxy = new Di(n, xi({
|
|
564
|
+
onKill: function() {
|
|
565
|
+
e.isPressed && ae(null);
|
|
566
|
+
}
|
|
567
|
+
}, i)), n.style.overflowY = D && !kt ? "auto" : "hidden", n.style.overflowX = _ && !kt ? "auto" : "hidden", n = m.content), c ? R.rotation = 1 : (_ && (R[L] = 1), D && (R[b] = 1)), M.force3D = "force3D" in i ? i.force3D : !0, ii(zt(l)), l.enable(), l;
|
|
568
|
+
}
|
|
569
|
+
return t.register = function(i) {
|
|
570
|
+
v = i, Et();
|
|
571
|
+
}, t.create = function(i, l) {
|
|
572
|
+
return Pt || Et(!0), Pe(i).map(function(f) {
|
|
573
|
+
return new t(f, l);
|
|
574
|
+
});
|
|
575
|
+
}, t.get = function(i) {
|
|
576
|
+
return ze[(Pe(i)[0] || {})._gsDragID];
|
|
577
|
+
}, t.timeSinceDrag = function() {
|
|
578
|
+
return (Se() - Qt) / 1e3;
|
|
579
|
+
}, t.hitTest = function(i, l, f) {
|
|
580
|
+
if (i === l)
|
|
581
|
+
return !1;
|
|
582
|
+
var x = We(i), c = We(l), L = x.top, b = x.left, _ = x.right, D = x.bottom, S = x.width, e = x.height, y = c.left > _ || c.right < b || c.top > D || c.bottom < L, R, J, N;
|
|
583
|
+
return y || !f ? !y : (N = (f + "").indexOf("%") !== -1, f = parseFloat(f) || 0, R = {
|
|
584
|
+
left: Math.max(b, c.left),
|
|
585
|
+
top: Math.max(L, c.top)
|
|
586
|
+
}, R.width = Math.min(_, c.right) - R.left, R.height = Math.min(D, c.bottom) - R.top, R.width < 0 || R.height < 0 ? !1 : N ? (f *= 0.01, J = R.width * R.height, J >= S * e * f || J >= c.width * c.height * f) : R.width > f && R.height > f);
|
|
587
|
+
}, t;
|
|
588
|
+
}(Mi);
|
|
589
|
+
mi(gt.prototype, {
|
|
590
|
+
pointerX: 0,
|
|
591
|
+
pointerY: 0,
|
|
592
|
+
startX: 0,
|
|
593
|
+
startY: 0,
|
|
594
|
+
deltaX: 0,
|
|
595
|
+
deltaY: 0,
|
|
596
|
+
isDragging: !1,
|
|
597
|
+
isPressed: !1
|
|
598
|
+
});
|
|
599
|
+
gt.zIndex = 1e3;
|
|
600
|
+
gt.version = "3.13.0";
|
|
601
|
+
ni() && v.registerPlugin(gt);
|
|
602
|
+
export {
|
|
603
|
+
gt as Draggable,
|
|
604
|
+
gt as default
|
|
605
|
+
};
|