st-comp 0.0.166 → 0.0.168
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/es/KlinePlus.cjs +3 -3
- package/es/KlinePlus.js +440 -397
- package/es/VarSelectDialog.cjs +3 -3
- package/es/VarSelectDialog.js +2906 -163
- package/es/VarietySearch.cjs +1 -3
- package/es/VarietySearch.js +895 -1152
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +202 -204
- package/lib/{index-80531492.js → index-89cc73f4.js} +24051 -24262
- package/lib/{python-20a1a5fc.js → python-dcf91e91.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlinePlus/index.vue +40 -6
- package/packages/KlinePlus/utils.js +24 -1
- package/packages/VarietySearch/components/FactorScreen/index.vue +4 -5
- package/src/pages/KlinePlus/index.vue +25 -6
- package/es/el-autocomplete-5064d466.js +0 -2759
- package/es/el-autocomplete-814993af.cjs +0 -1
- package/packages/VarietySearch/components/FactorScreen/ScriptSelect.vue +0 -303
- package/packages/VarietySearch/components/FactorScreen/VarietySelect.vue +0 -78
|
@@ -1,2759 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Nn, useAttrs as ni, ref as Z, computed as ft, onBeforeUnmount as ri, onMounted as ii, openBlock as dt, createBlock as oi, unref as I, withCtx as ge, createElementVNode as jn, normalizeClass as vt, normalizeStyle as Fn, createVNode as ht, createElementBlock as Nt, renderSlot as Me, Fragment as ai, renderList as si, createTextVNode as ci, toDisplayString as li, mergeProps as ui, withKeys as Ge, withModifiers as $n, createSlots as pi } from "vue";
|
|
2
|
-
import { o as fi } from "./el-scrollbar-bcf29780.js";
|
|
3
|
-
import { E as di, l as vi } from "./index-3425f2f0.js";
|
|
4
|
-
import { u as hi, E as gi } from "./el-input-42315ac4.js";
|
|
5
|
-
import { b as mi, u as yi, E as bi, a as xi } from "./el-popper-85365d5b.js";
|
|
6
|
-
import { U as gt, I as Xt, C as Vn } from "./index-21fb27eb.js";
|
|
7
|
-
import { k as wi, m as Bn, N as Ei, a as Vt, c as Si, u as Ti, _ as _i, o as Lt, t as Pi, w as ki } from "./base-4bcd2756.js";
|
|
8
|
-
import { d as Oi } from "./use-form-common-props-54c31983.js";
|
|
9
|
-
import { u as Ii } from "./index-ef7c4392.js";
|
|
10
|
-
import { d as Di } from "./debounce-51046b06.js";
|
|
11
|
-
import { g as Mi, c as Ai } from "./_commonjsHelpers-10dfc225.js";
|
|
12
|
-
const zi = wi({
|
|
13
|
-
valueKey: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: "value"
|
|
16
|
-
},
|
|
17
|
-
modelValue: {
|
|
18
|
-
type: [String, Number],
|
|
19
|
-
default: ""
|
|
20
|
-
},
|
|
21
|
-
debounce: {
|
|
22
|
-
type: Number,
|
|
23
|
-
default: 300
|
|
24
|
-
},
|
|
25
|
-
placement: {
|
|
26
|
-
type: Bn(String),
|
|
27
|
-
values: [
|
|
28
|
-
"top",
|
|
29
|
-
"top-start",
|
|
30
|
-
"top-end",
|
|
31
|
-
"bottom",
|
|
32
|
-
"bottom-start",
|
|
33
|
-
"bottom-end"
|
|
34
|
-
],
|
|
35
|
-
default: "bottom-start"
|
|
36
|
-
},
|
|
37
|
-
fetchSuggestions: {
|
|
38
|
-
type: Bn([Function, Array]),
|
|
39
|
-
default: Ei
|
|
40
|
-
},
|
|
41
|
-
popperClass: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: ""
|
|
44
|
-
},
|
|
45
|
-
triggerOnFocus: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: !0
|
|
48
|
-
},
|
|
49
|
-
selectWhenUnmatched: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: !1
|
|
52
|
-
},
|
|
53
|
-
hideLoading: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: !1
|
|
56
|
-
},
|
|
57
|
-
teleported: mi.teleported,
|
|
58
|
-
highlightFirstItem: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: !1
|
|
61
|
-
},
|
|
62
|
-
fitInputWidth: {
|
|
63
|
-
type: Boolean,
|
|
64
|
-
default: !1
|
|
65
|
-
},
|
|
66
|
-
clearable: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default: !1
|
|
69
|
-
},
|
|
70
|
-
disabled: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
default: !1
|
|
73
|
-
},
|
|
74
|
-
name: String,
|
|
75
|
-
...yi(["ariaLabel"])
|
|
76
|
-
}), Ci = {
|
|
77
|
-
[gt]: (z) => Vt(z),
|
|
78
|
-
[Xt]: (z) => Vt(z),
|
|
79
|
-
[Vn]: (z) => Vt(z),
|
|
80
|
-
focus: (z) => z instanceof FocusEvent,
|
|
81
|
-
blur: (z) => z instanceof FocusEvent,
|
|
82
|
-
clear: () => !0,
|
|
83
|
-
select: (z) => Si(z)
|
|
84
|
-
}, Ln = "ElAutocomplete", Ri = Nn({
|
|
85
|
-
name: Ln,
|
|
86
|
-
inheritAttrs: !1
|
|
87
|
-
}), ji = /* @__PURE__ */ Nn({
|
|
88
|
-
...Ri,
|
|
89
|
-
props: zi,
|
|
90
|
-
emits: Ci,
|
|
91
|
-
setup(z, { expose: Yt, emit: F }) {
|
|
92
|
-
const M = z, le = hi(), R = ni(), Ae = Oi(), k = Ti("autocomplete"), $ = Z(), ue = Z(), q = Z(), Te = Z();
|
|
93
|
-
let me = !1, ee = !1;
|
|
94
|
-
const j = Z([]), A = Z(-1), ze = Z(""), U = Z(!1), G = Z(!1), te = Z(!1), B = Ii(), _e = ft(() => R.style), J = ft(() => (j.value.length > 0 || te.value) && U.value), d = ft(() => !M.hideLoading && te.value), Ce = ft(() => $.value ? Array.from($.value.$el.querySelectorAll("input")) : []), Ke = () => {
|
|
95
|
-
J.value && (ze.value = `${$.value.$el.offsetWidth}px`);
|
|
96
|
-
}, Pe = () => {
|
|
97
|
-
A.value = -1;
|
|
98
|
-
}, Re = async (x) => {
|
|
99
|
-
if (G.value)
|
|
100
|
-
return;
|
|
101
|
-
const D = (y) => {
|
|
102
|
-
te.value = !1, !G.value && (Lt(y) ? (j.value = y, A.value = M.highlightFirstItem ? 0 : -1) : Pi(Ln, "autocomplete suggestions must be an array"));
|
|
103
|
-
};
|
|
104
|
-
if (te.value = !0, Lt(M.fetchSuggestions))
|
|
105
|
-
D(M.fetchSuggestions);
|
|
106
|
-
else {
|
|
107
|
-
const y = await M.fetchSuggestions(x, D);
|
|
108
|
-
Lt(y) && D(y);
|
|
109
|
-
}
|
|
110
|
-
}, N = Di(Re, M.debounce), pe = (x) => {
|
|
111
|
-
const D = !!x;
|
|
112
|
-
if (F(Xt, x), F(gt, x), G.value = !1, U.value || (U.value = D), !M.triggerOnFocus && !x) {
|
|
113
|
-
G.value = !0, j.value = [];
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
N(x);
|
|
117
|
-
}, C = (x) => {
|
|
118
|
-
var D;
|
|
119
|
-
Ae.value || (((D = x.target) == null ? void 0 : D.tagName) !== "INPUT" || Ce.value.includes(document.activeElement)) && (U.value = !0);
|
|
120
|
-
}, X = (x) => {
|
|
121
|
-
F(Vn, x);
|
|
122
|
-
}, Y = (x) => {
|
|
123
|
-
ee ? ee = !1 : (U.value = !0, F("focus", x), M.triggerOnFocus && !me && N(String(M.modelValue)));
|
|
124
|
-
}, ne = (x) => {
|
|
125
|
-
setTimeout(() => {
|
|
126
|
-
var D;
|
|
127
|
-
if ((D = q.value) != null && D.isFocusInsideContent()) {
|
|
128
|
-
ee = !0;
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
U.value && re(), F("blur", x);
|
|
132
|
-
});
|
|
133
|
-
}, He = () => {
|
|
134
|
-
U.value = !1, F(gt, ""), F("clear");
|
|
135
|
-
}, K = async () => {
|
|
136
|
-
J.value && A.value >= 0 && A.value < j.value.length ? ke(j.value[A.value]) : M.selectWhenUnmatched && (F("select", { value: M.modelValue }), j.value = [], A.value = -1);
|
|
137
|
-
}, Q = (x) => {
|
|
138
|
-
J.value && (x.preventDefault(), x.stopPropagation(), re());
|
|
139
|
-
}, re = () => {
|
|
140
|
-
U.value = !1;
|
|
141
|
-
}, Je = () => {
|
|
142
|
-
var x;
|
|
143
|
-
(x = $.value) == null || x.focus();
|
|
144
|
-
}, je = () => {
|
|
145
|
-
var x;
|
|
146
|
-
(x = $.value) == null || x.blur();
|
|
147
|
-
}, ke = async (x) => {
|
|
148
|
-
F(Xt, x[M.valueKey]), F(gt, x[M.valueKey]), F("select", x), j.value = [], A.value = -1;
|
|
149
|
-
}, ye = (x) => {
|
|
150
|
-
if (!J.value || te.value)
|
|
151
|
-
return;
|
|
152
|
-
if (x < 0) {
|
|
153
|
-
A.value = -1;
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
x >= j.value.length && (x = j.value.length - 1);
|
|
157
|
-
const D = ue.value.querySelector(`.${k.be("suggestion", "wrap")}`), ie = D.querySelectorAll(`.${k.be("suggestion", "list")} li`)[x], oe = D.scrollTop, { offsetTop: be, scrollHeight: xe } = ie;
|
|
158
|
-
be + xe > oe + D.clientHeight && (D.scrollTop += xe), be < oe && (D.scrollTop -= xe), A.value = x, $.value.ref.setAttribute("aria-activedescendant", `${B.value}-item-${A.value}`);
|
|
159
|
-
}, Oe = fi(Te, () => {
|
|
160
|
-
var x;
|
|
161
|
-
(x = q.value) != null && x.isFocusInsideContent() || J.value && re();
|
|
162
|
-
});
|
|
163
|
-
return ri(() => {
|
|
164
|
-
Oe == null || Oe();
|
|
165
|
-
}), ii(() => {
|
|
166
|
-
$.value.ref.setAttribute("role", "textbox"), $.value.ref.setAttribute("aria-autocomplete", "list"), $.value.ref.setAttribute("aria-controls", "id"), $.value.ref.setAttribute("aria-activedescendant", `${B.value}-item-${A.value}`), me = $.value.ref.hasAttribute("readonly");
|
|
167
|
-
}), Yt({
|
|
168
|
-
highlightedIndex: A,
|
|
169
|
-
activated: U,
|
|
170
|
-
loading: te,
|
|
171
|
-
inputRef: $,
|
|
172
|
-
popperRef: q,
|
|
173
|
-
suggestions: j,
|
|
174
|
-
handleSelect: ke,
|
|
175
|
-
handleKeyEnter: K,
|
|
176
|
-
focus: Je,
|
|
177
|
-
blur: je,
|
|
178
|
-
close: re,
|
|
179
|
-
highlight: ye,
|
|
180
|
-
getData: Re
|
|
181
|
-
}), (x, D) => (dt(), oi(I(bi), {
|
|
182
|
-
ref_key: "popperRef",
|
|
183
|
-
ref: q,
|
|
184
|
-
visible: I(J),
|
|
185
|
-
placement: x.placement,
|
|
186
|
-
"fallback-placements": ["bottom-start", "top-start"],
|
|
187
|
-
"popper-class": [I(k).e("popper"), x.popperClass],
|
|
188
|
-
teleported: x.teleported,
|
|
189
|
-
"gpu-acceleration": !1,
|
|
190
|
-
pure: "",
|
|
191
|
-
"manual-mode": "",
|
|
192
|
-
effect: "light",
|
|
193
|
-
trigger: "click",
|
|
194
|
-
transition: `${I(k).namespace.value}-zoom-in-top`,
|
|
195
|
-
persistent: "",
|
|
196
|
-
role: "listbox",
|
|
197
|
-
onBeforeShow: Ke,
|
|
198
|
-
onHide: Pe
|
|
199
|
-
}, {
|
|
200
|
-
content: ge(() => [
|
|
201
|
-
jn("div", {
|
|
202
|
-
ref_key: "regionRef",
|
|
203
|
-
ref: ue,
|
|
204
|
-
class: vt([I(k).b("suggestion"), I(k).is("loading", I(d))]),
|
|
205
|
-
style: Fn({
|
|
206
|
-
[x.fitInputWidth ? "width" : "minWidth"]: ze.value,
|
|
207
|
-
outline: "none"
|
|
208
|
-
}),
|
|
209
|
-
role: "region"
|
|
210
|
-
}, [
|
|
211
|
-
ht(I(xi), {
|
|
212
|
-
id: I(B),
|
|
213
|
-
tag: "ul",
|
|
214
|
-
"wrap-class": I(k).be("suggestion", "wrap"),
|
|
215
|
-
"view-class": I(k).be("suggestion", "list"),
|
|
216
|
-
role: "listbox"
|
|
217
|
-
}, {
|
|
218
|
-
default: ge(() => [
|
|
219
|
-
I(d) ? (dt(), Nt("li", { key: 0 }, [
|
|
220
|
-
Me(x.$slots, "loading", {}, () => [
|
|
221
|
-
ht(I(di), {
|
|
222
|
-
class: vt(I(k).is("loading"))
|
|
223
|
-
}, {
|
|
224
|
-
default: ge(() => [
|
|
225
|
-
ht(I(vi))
|
|
226
|
-
]),
|
|
227
|
-
_: 1
|
|
228
|
-
}, 8, ["class"])
|
|
229
|
-
])
|
|
230
|
-
])) : (dt(!0), Nt(ai, { key: 1 }, si(j.value, (y, ie) => (dt(), Nt("li", {
|
|
231
|
-
id: `${I(B)}-item-${ie}`,
|
|
232
|
-
key: ie,
|
|
233
|
-
class: vt({ highlighted: A.value === ie }),
|
|
234
|
-
role: "option",
|
|
235
|
-
"aria-selected": A.value === ie,
|
|
236
|
-
onClick: (oe) => ke(y)
|
|
237
|
-
}, [
|
|
238
|
-
Me(x.$slots, "default", { item: y }, () => [
|
|
239
|
-
ci(li(y[x.valueKey]), 1)
|
|
240
|
-
])
|
|
241
|
-
], 10, ["id", "aria-selected", "onClick"]))), 128))
|
|
242
|
-
]),
|
|
243
|
-
_: 3
|
|
244
|
-
}, 8, ["id", "wrap-class", "view-class"])
|
|
245
|
-
], 6)
|
|
246
|
-
]),
|
|
247
|
-
default: ge(() => [
|
|
248
|
-
jn("div", {
|
|
249
|
-
ref_key: "listboxRef",
|
|
250
|
-
ref: Te,
|
|
251
|
-
class: vt([I(k).b(), x.$attrs.class]),
|
|
252
|
-
style: Fn(I(_e)),
|
|
253
|
-
role: "combobox",
|
|
254
|
-
"aria-haspopup": "listbox",
|
|
255
|
-
"aria-expanded": I(J),
|
|
256
|
-
"aria-owns": I(B)
|
|
257
|
-
}, [
|
|
258
|
-
ht(I(gi), ui({
|
|
259
|
-
ref_key: "inputRef",
|
|
260
|
-
ref: $
|
|
261
|
-
}, I(le), {
|
|
262
|
-
clearable: x.clearable,
|
|
263
|
-
disabled: I(Ae),
|
|
264
|
-
name: x.name,
|
|
265
|
-
"model-value": x.modelValue,
|
|
266
|
-
"aria-label": x.ariaLabel,
|
|
267
|
-
onInput: pe,
|
|
268
|
-
onChange: X,
|
|
269
|
-
onFocus: Y,
|
|
270
|
-
onBlur: ne,
|
|
271
|
-
onClear: He,
|
|
272
|
-
onKeydown: [
|
|
273
|
-
Ge($n((y) => ye(A.value - 1), ["prevent"]), ["up"]),
|
|
274
|
-
Ge($n((y) => ye(A.value + 1), ["prevent"]), ["down"]),
|
|
275
|
-
Ge(K, ["enter"]),
|
|
276
|
-
Ge(re, ["tab"]),
|
|
277
|
-
Ge(Q, ["esc"])
|
|
278
|
-
],
|
|
279
|
-
onMousedown: C
|
|
280
|
-
}), pi({
|
|
281
|
-
_: 2
|
|
282
|
-
}, [
|
|
283
|
-
x.$slots.prepend ? {
|
|
284
|
-
name: "prepend",
|
|
285
|
-
fn: ge(() => [
|
|
286
|
-
Me(x.$slots, "prepend")
|
|
287
|
-
])
|
|
288
|
-
} : void 0,
|
|
289
|
-
x.$slots.append ? {
|
|
290
|
-
name: "append",
|
|
291
|
-
fn: ge(() => [
|
|
292
|
-
Me(x.$slots, "append")
|
|
293
|
-
])
|
|
294
|
-
} : void 0,
|
|
295
|
-
x.$slots.prefix ? {
|
|
296
|
-
name: "prefix",
|
|
297
|
-
fn: ge(() => [
|
|
298
|
-
Me(x.$slots, "prefix")
|
|
299
|
-
])
|
|
300
|
-
} : void 0,
|
|
301
|
-
x.$slots.suffix ? {
|
|
302
|
-
name: "suffix",
|
|
303
|
-
fn: ge(() => [
|
|
304
|
-
Me(x.$slots, "suffix")
|
|
305
|
-
])
|
|
306
|
-
} : void 0
|
|
307
|
-
]), 1040, ["clearable", "disabled", "name", "model-value", "aria-label", "onKeydown"])
|
|
308
|
-
], 14, ["aria-expanded", "aria-owns"])
|
|
309
|
-
]),
|
|
310
|
-
_: 3
|
|
311
|
-
}, 8, ["visible", "placement", "popper-class", "teleported", "transition"]));
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
var Fi = /* @__PURE__ */ _i(ji, [["__file", "autocomplete.vue"]]);
|
|
315
|
-
const Hi = ki(Fi);
|
|
316
|
-
var mt = { exports: {} };
|
|
317
|
-
mt.exports;
|
|
318
|
-
(function(z, Yt) {
|
|
319
|
-
(function(F, M) {
|
|
320
|
-
z.exports = M();
|
|
321
|
-
})(Ai, function() {
|
|
322
|
-
function F(t, e) {
|
|
323
|
-
var n = Object.keys(t);
|
|
324
|
-
if (Object.getOwnPropertySymbols) {
|
|
325
|
-
var r = Object.getOwnPropertySymbols(t);
|
|
326
|
-
e && (r = r.filter(function(i) {
|
|
327
|
-
return Object.getOwnPropertyDescriptor(t, i).enumerable;
|
|
328
|
-
})), n.push.apply(n, r);
|
|
329
|
-
}
|
|
330
|
-
return n;
|
|
331
|
-
}
|
|
332
|
-
function M(t) {
|
|
333
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
334
|
-
var n = arguments[e] != null ? arguments[e] : {};
|
|
335
|
-
e % 2 ? F(Object(n), !0).forEach(function(r) {
|
|
336
|
-
$(t, r, n[r]);
|
|
337
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : F(Object(n)).forEach(function(r) {
|
|
338
|
-
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
return t;
|
|
342
|
-
}
|
|
343
|
-
function le(t) {
|
|
344
|
-
return le = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
345
|
-
return typeof e;
|
|
346
|
-
} : function(e) {
|
|
347
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
348
|
-
}, le(t);
|
|
349
|
-
}
|
|
350
|
-
function R(t, e) {
|
|
351
|
-
if (!(t instanceof e))
|
|
352
|
-
throw new TypeError("Cannot call a class as a function");
|
|
353
|
-
}
|
|
354
|
-
function Ae(t, e) {
|
|
355
|
-
for (var n = 0; n < e.length; n++) {
|
|
356
|
-
var r = e[n];
|
|
357
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, A(r.key), r);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
function k(t, e, n) {
|
|
361
|
-
return e && Ae(t.prototype, e), n && Ae(t, n), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
362
|
-
}
|
|
363
|
-
function $(t, e, n) {
|
|
364
|
-
return (e = A(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
|
|
365
|
-
}
|
|
366
|
-
function ue(t, e) {
|
|
367
|
-
if (typeof e != "function" && e !== null)
|
|
368
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
369
|
-
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && Te(t, e);
|
|
370
|
-
}
|
|
371
|
-
function q(t) {
|
|
372
|
-
return q = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
373
|
-
return e.__proto__ || Object.getPrototypeOf(e);
|
|
374
|
-
}, q(t);
|
|
375
|
-
}
|
|
376
|
-
function Te(t, e) {
|
|
377
|
-
return Te = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
378
|
-
return n.__proto__ = r, n;
|
|
379
|
-
}, Te(t, e);
|
|
380
|
-
}
|
|
381
|
-
function me(t) {
|
|
382
|
-
if (t === void 0)
|
|
383
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
384
|
-
return t;
|
|
385
|
-
}
|
|
386
|
-
function ee(t) {
|
|
387
|
-
var e = function() {
|
|
388
|
-
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
389
|
-
return !1;
|
|
390
|
-
if (typeof Proxy == "function")
|
|
391
|
-
return !0;
|
|
392
|
-
try {
|
|
393
|
-
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
394
|
-
})), !0;
|
|
395
|
-
} catch {
|
|
396
|
-
return !1;
|
|
397
|
-
}
|
|
398
|
-
}();
|
|
399
|
-
return function() {
|
|
400
|
-
var n, r = q(t);
|
|
401
|
-
if (e) {
|
|
402
|
-
var i = q(this).constructor;
|
|
403
|
-
n = Reflect.construct(r, arguments, i);
|
|
404
|
-
} else
|
|
405
|
-
n = r.apply(this, arguments);
|
|
406
|
-
return function(o, a) {
|
|
407
|
-
if (a && (typeof a == "object" || typeof a == "function"))
|
|
408
|
-
return a;
|
|
409
|
-
if (a !== void 0)
|
|
410
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
411
|
-
return me(o);
|
|
412
|
-
}(this, n);
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
function j() {
|
|
416
|
-
return j = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(t, e, n) {
|
|
417
|
-
var r = function(o, a) {
|
|
418
|
-
for (; !Object.prototype.hasOwnProperty.call(o, a) && (o = q(o)) !== null; )
|
|
419
|
-
;
|
|
420
|
-
return o;
|
|
421
|
-
}(t, e);
|
|
422
|
-
if (r) {
|
|
423
|
-
var i = Object.getOwnPropertyDescriptor(r, e);
|
|
424
|
-
return i.get ? i.get.call(arguments.length < 3 ? t : n) : i.value;
|
|
425
|
-
}
|
|
426
|
-
}, j.apply(this, arguments);
|
|
427
|
-
}
|
|
428
|
-
function A(t) {
|
|
429
|
-
var e = function(n, r) {
|
|
430
|
-
if (typeof n != "object" || n === null)
|
|
431
|
-
return n;
|
|
432
|
-
var i = n[Symbol.toPrimitive];
|
|
433
|
-
if (i !== void 0) {
|
|
434
|
-
var o = i.call(n, r || "default");
|
|
435
|
-
if (typeof o != "object")
|
|
436
|
-
return o;
|
|
437
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
438
|
-
}
|
|
439
|
-
return (r === "string" ? String : Number)(n);
|
|
440
|
-
}(t, "string");
|
|
441
|
-
return typeof e == "symbol" ? e : e + "";
|
|
442
|
-
}
|
|
443
|
-
var ze = function(t) {
|
|
444
|
-
return !(!t || !t.Window) && t instanceof t.Window;
|
|
445
|
-
}, U = void 0, G = void 0;
|
|
446
|
-
function te(t) {
|
|
447
|
-
U = t;
|
|
448
|
-
var e = t.document.createTextNode("");
|
|
449
|
-
e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)), G = t;
|
|
450
|
-
}
|
|
451
|
-
function B(t) {
|
|
452
|
-
return ze(t) ? t : (t.ownerDocument || t).defaultView || G.window;
|
|
453
|
-
}
|
|
454
|
-
typeof window < "u" && window && te(window);
|
|
455
|
-
var _e = function(t) {
|
|
456
|
-
return !!t && le(t) === "object";
|
|
457
|
-
}, J = function(t) {
|
|
458
|
-
return typeof t == "function";
|
|
459
|
-
}, d = { window: function(t) {
|
|
460
|
-
return t === G || ze(t);
|
|
461
|
-
}, docFrag: function(t) {
|
|
462
|
-
return _e(t) && t.nodeType === 11;
|
|
463
|
-
}, object: _e, func: J, number: function(t) {
|
|
464
|
-
return typeof t == "number";
|
|
465
|
-
}, bool: function(t) {
|
|
466
|
-
return typeof t == "boolean";
|
|
467
|
-
}, string: function(t) {
|
|
468
|
-
return typeof t == "string";
|
|
469
|
-
}, element: function(t) {
|
|
470
|
-
if (!t || le(t) !== "object")
|
|
471
|
-
return !1;
|
|
472
|
-
var e = B(t) || G;
|
|
473
|
-
return /object|function/.test(typeof Element > "u" ? "undefined" : le(Element)) ? t instanceof Element || t instanceof e.Element : t.nodeType === 1 && typeof t.nodeName == "string";
|
|
474
|
-
}, plainObject: function(t) {
|
|
475
|
-
return _e(t) && !!t.constructor && /function Object\b/.test(t.constructor.toString());
|
|
476
|
-
}, array: function(t) {
|
|
477
|
-
return _e(t) && t.length !== void 0 && J(t.splice);
|
|
478
|
-
} };
|
|
479
|
-
function Ce(t) {
|
|
480
|
-
var e = t.interaction;
|
|
481
|
-
if (e.prepared.name === "drag") {
|
|
482
|
-
var n = e.prepared.axis;
|
|
483
|
-
n === "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) : n === "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);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
function Ke(t) {
|
|
487
|
-
var e = t.iEvent, n = t.interaction;
|
|
488
|
-
if (n.prepared.name === "drag") {
|
|
489
|
-
var r = n.prepared.axis;
|
|
490
|
-
if (r === "x" || r === "y") {
|
|
491
|
-
var i = r === "x" ? "y" : "x";
|
|
492
|
-
e.page[i] = n.coords.start.page[i], e.client[i] = n.coords.start.client[i], e.delta[i] = 0;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
var Pe = { id: "actions/drag", install: function(t) {
|
|
497
|
-
var e = t.actions, n = t.Interactable, r = t.defaults;
|
|
498
|
-
n.prototype.draggable = Pe.draggable, e.map.drag = Pe, e.methodDict.drag = "draggable", r.actions.drag = Pe.defaults;
|
|
499
|
-
}, listeners: { "interactions:before-action-move": Ce, "interactions:action-resume": Ce, "interactions:action-move": Ke, "auto-start:check": function(t) {
|
|
500
|
-
var e = t.interaction, n = t.interactable, r = t.buttons, i = n.options.drag;
|
|
501
|
-
if (i && i.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || r & n.options.drag.mouseButtons))
|
|
502
|
-
return t.action = { name: "drag", axis: i.lockAxis === "start" ? i.startAxis : i.lockAxis }, !1;
|
|
503
|
-
} }, draggable: function(t) {
|
|
504
|
-
return d.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) : d.bool(t) ? (this.options.drag.enabled = t, this) : this.options.drag;
|
|
505
|
-
}, beforeMove: Ce, move: Ke, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
|
|
506
|
-
return "move";
|
|
507
|
-
}, filterEventType: function(t) {
|
|
508
|
-
return t.search("drag") === 0;
|
|
509
|
-
} }, Re = Pe, N = { init: function(t) {
|
|
510
|
-
var e = t;
|
|
511
|
-
N.document = e.document, N.DocumentFragment = e.DocumentFragment || pe, N.SVGElement = e.SVGElement || pe, N.SVGSVGElement = e.SVGSVGElement || pe, N.SVGElementInstance = e.SVGElementInstance || pe, N.Element = e.Element || pe, N.HTMLElement = e.HTMLElement || N.Element, N.Event = e.Event, N.Touch = e.Touch || pe, N.PointerEvent = e.PointerEvent || e.MSPointerEvent;
|
|
512
|
-
}, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
|
|
513
|
-
function pe() {
|
|
514
|
-
}
|
|
515
|
-
var C = N, X = { init: function(t) {
|
|
516
|
-
var e = C.Element, n = t.navigator || {};
|
|
517
|
-
X.supportsTouch = "ontouchstart" in t || d.func(t.DocumentTouch) && C.document instanceof t.DocumentTouch, X.supportsPointerEvent = n.pointerEnabled !== !1 && !!C.PointerEvent, X.isIOS = /iP(hone|od|ad)/.test(n.platform), X.isIOS7 = /iP(hone|od|ad)/.test(n.platform) && /OS 7[^\d]/.test(n.appVersion), X.isIe9 = /MSIE 9/.test(n.userAgent), X.isOperaMobile = n.appName === "Opera" && X.supportsTouch && /Presto/.test(n.userAgent), X.prefixedMatchesSelector = "matches" in e.prototype ? "matches" : "webkitMatchesSelector" in e.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e.prototype ? "oMatchesSelector" : "msMatchesSelector", X.pEventTypes = X.supportsPointerEvent ? C.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, X.wheelEvent = C.document && "onmousewheel" in C.document ? "mousewheel" : "wheel";
|
|
518
|
-
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, Y = X;
|
|
519
|
-
function ne(t, e) {
|
|
520
|
-
if (t.contains)
|
|
521
|
-
return t.contains(e);
|
|
522
|
-
for (; e; ) {
|
|
523
|
-
if (e === t)
|
|
524
|
-
return !0;
|
|
525
|
-
e = e.parentNode;
|
|
526
|
-
}
|
|
527
|
-
return !1;
|
|
528
|
-
}
|
|
529
|
-
function He(t, e) {
|
|
530
|
-
for (; d.element(t); ) {
|
|
531
|
-
if (Q(t, e))
|
|
532
|
-
return t;
|
|
533
|
-
t = K(t);
|
|
534
|
-
}
|
|
535
|
-
return null;
|
|
536
|
-
}
|
|
537
|
-
function K(t) {
|
|
538
|
-
var e = t.parentNode;
|
|
539
|
-
if (d.docFrag(e)) {
|
|
540
|
-
for (; (e = e.host) && d.docFrag(e); )
|
|
541
|
-
;
|
|
542
|
-
return e;
|
|
543
|
-
}
|
|
544
|
-
return e;
|
|
545
|
-
}
|
|
546
|
-
function Q(t, e) {
|
|
547
|
-
return G !== U && (e = e.replace(/\/deep\//g, " ")), t[Y.prefixedMatchesSelector](e);
|
|
548
|
-
}
|
|
549
|
-
var re = function(t) {
|
|
550
|
-
return t.parentNode || t.host;
|
|
551
|
-
};
|
|
552
|
-
function Je(t, e) {
|
|
553
|
-
for (var n, r = [], i = t; (n = re(i)) && i !== e && n !== i.ownerDocument; )
|
|
554
|
-
r.unshift(i), i = n;
|
|
555
|
-
return r;
|
|
556
|
-
}
|
|
557
|
-
function je(t, e, n) {
|
|
558
|
-
for (; d.element(t); ) {
|
|
559
|
-
if (Q(t, e))
|
|
560
|
-
return !0;
|
|
561
|
-
if ((t = K(t)) === n)
|
|
562
|
-
return Q(t, e);
|
|
563
|
-
}
|
|
564
|
-
return !1;
|
|
565
|
-
}
|
|
566
|
-
function ke(t) {
|
|
567
|
-
return t.correspondingUseElement || t;
|
|
568
|
-
}
|
|
569
|
-
function ye(t) {
|
|
570
|
-
var e = t instanceof C.SVGElement ? t.getBoundingClientRect() : t.getClientRects()[0];
|
|
571
|
-
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 };
|
|
572
|
-
}
|
|
573
|
-
function Oe(t) {
|
|
574
|
-
var e, n = ye(t);
|
|
575
|
-
if (!Y.isIOS7 && n) {
|
|
576
|
-
var r = { x: (e = (e = B(t)) || G).scrollX || e.document.documentElement.scrollLeft, y: e.scrollY || e.document.documentElement.scrollTop };
|
|
577
|
-
n.left += r.x, n.right += r.x, n.top += r.y, n.bottom += r.y;
|
|
578
|
-
}
|
|
579
|
-
return n;
|
|
580
|
-
}
|
|
581
|
-
function x(t) {
|
|
582
|
-
for (var e = []; t; )
|
|
583
|
-
e.push(t), t = K(t);
|
|
584
|
-
return e;
|
|
585
|
-
}
|
|
586
|
-
function D(t) {
|
|
587
|
-
return !!d.string(t) && (C.document.querySelector(t), !0);
|
|
588
|
-
}
|
|
589
|
-
function y(t, e) {
|
|
590
|
-
for (var n in e)
|
|
591
|
-
t[n] = e[n];
|
|
592
|
-
return t;
|
|
593
|
-
}
|
|
594
|
-
function ie(t, e, n) {
|
|
595
|
-
return t === "parent" ? K(n) : t === "self" ? e.getRect(n) : He(n, t);
|
|
596
|
-
}
|
|
597
|
-
function oe(t, e, n, r) {
|
|
598
|
-
var i = t;
|
|
599
|
-
return d.string(i) ? i = ie(i, e, n) : d.func(i) && (i = i.apply(void 0, r)), d.element(i) && (i = Oe(i)), i;
|
|
600
|
-
}
|
|
601
|
-
function be(t) {
|
|
602
|
-
return t && { x: "x" in t ? t.x : t.left, y: "y" in t ? t.y : t.top };
|
|
603
|
-
}
|
|
604
|
-
function xe(t) {
|
|
605
|
-
return !t || "x" in t && "y" in t || ((t = y({}, 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;
|
|
606
|
-
}
|
|
607
|
-
function Qe(t, e, n) {
|
|
608
|
-
t.left && (e.left += n.x), t.right && (e.right += n.x), t.top && (e.top += n.y), t.bottom && (e.bottom += n.y), e.width = e.right - e.left, e.height = e.bottom - e.top;
|
|
609
|
-
}
|
|
610
|
-
function Fe(t, e, n) {
|
|
611
|
-
var r = n && t.options[n];
|
|
612
|
-
return be(oe(r && r.origin || t.options.origin, t, e, [t && e])) || { x: 0, y: 0 };
|
|
613
|
-
}
|
|
614
|
-
function we(t, e) {
|
|
615
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(c) {
|
|
616
|
-
return !0;
|
|
617
|
-
}, r = arguments.length > 3 ? arguments[3] : void 0;
|
|
618
|
-
if (r = r || {}, d.string(t) && t.search(" ") !== -1 && (t = Wt(t)), d.array(t))
|
|
619
|
-
return t.forEach(function(c) {
|
|
620
|
-
return we(c, e, n, r);
|
|
621
|
-
}), r;
|
|
622
|
-
if (d.object(t) && (e = t, t = ""), d.func(e) && n(t))
|
|
623
|
-
r[t] = r[t] || [], r[t].push(e);
|
|
624
|
-
else if (d.array(e))
|
|
625
|
-
for (var i = 0, o = e; i < o.length; i++) {
|
|
626
|
-
var a = o[i];
|
|
627
|
-
we(t, a, n, r);
|
|
628
|
-
}
|
|
629
|
-
else if (d.object(e))
|
|
630
|
-
for (var s in e)
|
|
631
|
-
we(Wt(s).map(function(c) {
|
|
632
|
-
return "".concat(t).concat(c);
|
|
633
|
-
}), e[s], n, r);
|
|
634
|
-
return r;
|
|
635
|
-
}
|
|
636
|
-
function Wt(t) {
|
|
637
|
-
return t.trim().split(/ +/);
|
|
638
|
-
}
|
|
639
|
-
var $e = function(t, e) {
|
|
640
|
-
return Math.sqrt(t * t + e * e);
|
|
641
|
-
}, Xn = ["webkit", "moz"];
|
|
642
|
-
function Ze(t, e) {
|
|
643
|
-
t.__set || (t.__set = {});
|
|
644
|
-
var n = function(i) {
|
|
645
|
-
if (Xn.some(function(o) {
|
|
646
|
-
return i.indexOf(o) === 0;
|
|
647
|
-
}))
|
|
648
|
-
return 1;
|
|
649
|
-
typeof t[i] != "function" && i !== "__set" && Object.defineProperty(t, i, { get: function() {
|
|
650
|
-
return i in t.__set ? t.__set[i] : t.__set[i] = e[i];
|
|
651
|
-
}, set: function(o) {
|
|
652
|
-
t.__set[i] = o;
|
|
653
|
-
}, configurable: !0 });
|
|
654
|
-
};
|
|
655
|
-
for (var r in e)
|
|
656
|
-
n(r);
|
|
657
|
-
return t;
|
|
658
|
-
}
|
|
659
|
-
function et(t, e) {
|
|
660
|
-
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;
|
|
661
|
-
}
|
|
662
|
-
function qt(t) {
|
|
663
|
-
t.page.x = 0, t.page.y = 0, t.client.x = 0, t.client.y = 0;
|
|
664
|
-
}
|
|
665
|
-
function Ut(t) {
|
|
666
|
-
return t instanceof C.Event || t instanceof C.Touch;
|
|
667
|
-
}
|
|
668
|
-
function tt(t, e, n) {
|
|
669
|
-
return t = t || "page", (n = n || {}).x = e[t + "X"], n.y = e[t + "Y"], n;
|
|
670
|
-
}
|
|
671
|
-
function Gt(t, e) {
|
|
672
|
-
return e = e || { x: 0, y: 0 }, Y.isOperaMobile && Ut(t) ? (tt("screen", t, e), e.x += window.scrollX, e.y += window.scrollY) : tt("page", t, e), e;
|
|
673
|
-
}
|
|
674
|
-
function Be(t) {
|
|
675
|
-
return d.number(t.pointerId) ? t.pointerId : t.identifier;
|
|
676
|
-
}
|
|
677
|
-
function Yn(t, e, n) {
|
|
678
|
-
var r = e.length > 1 ? Kt(e) : e[0];
|
|
679
|
-
Gt(r, t.page), function(i, o) {
|
|
680
|
-
o = o || {}, Y.isOperaMobile && Ut(i) ? tt("screen", i, o) : tt("client", i, o);
|
|
681
|
-
}(r, t.client), t.timeStamp = n;
|
|
682
|
-
}
|
|
683
|
-
function yt(t) {
|
|
684
|
-
var e = [];
|
|
685
|
-
return d.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;
|
|
686
|
-
}
|
|
687
|
-
function Kt(t) {
|
|
688
|
-
for (var e = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, n = 0; n < t.length; n++) {
|
|
689
|
-
var r = t[n];
|
|
690
|
-
for (var i in e)
|
|
691
|
-
e[i] += r[i];
|
|
692
|
-
}
|
|
693
|
-
for (var o in e)
|
|
694
|
-
e[o] /= t.length;
|
|
695
|
-
return e;
|
|
696
|
-
}
|
|
697
|
-
function bt(t) {
|
|
698
|
-
if (!t.length)
|
|
699
|
-
return null;
|
|
700
|
-
var e = yt(t), n = Math.min(e[0].pageX, e[1].pageX), r = Math.min(e[0].pageY, e[1].pageY), i = Math.max(e[0].pageX, e[1].pageX), o = Math.max(e[0].pageY, e[1].pageY);
|
|
701
|
-
return { x: n, y: r, left: n, top: r, right: i, bottom: o, width: i - n, height: o - r };
|
|
702
|
-
}
|
|
703
|
-
function xt(t, e) {
|
|
704
|
-
var n = e + "X", r = e + "Y", i = yt(t), o = i[0][n] - i[1][n], a = i[0][r] - i[1][r];
|
|
705
|
-
return $e(o, a);
|
|
706
|
-
}
|
|
707
|
-
function wt(t, e) {
|
|
708
|
-
var n = e + "X", r = e + "Y", i = yt(t), o = i[1][n] - i[0][n], a = i[1][r] - i[0][r];
|
|
709
|
-
return 180 * Math.atan2(a, o) / Math.PI;
|
|
710
|
-
}
|
|
711
|
-
function Ht(t) {
|
|
712
|
-
return d.string(t.pointerType) ? t.pointerType : d.number(t.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t.pointerType] : /touch/.test(t.type || "") || t instanceof C.Touch ? "touch" : "mouse";
|
|
713
|
-
}
|
|
714
|
-
function Jt(t) {
|
|
715
|
-
var e = d.func(t.composedPath) ? t.composedPath() : t.path;
|
|
716
|
-
return [ke(e ? e[0] : t.target), ke(t.currentTarget)];
|
|
717
|
-
}
|
|
718
|
-
var nt = function() {
|
|
719
|
-
function t(e) {
|
|
720
|
-
R(this, t), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = e;
|
|
721
|
-
}
|
|
722
|
-
return k(t, [{ key: "preventDefault", value: function() {
|
|
723
|
-
} }, { key: "stopPropagation", value: function() {
|
|
724
|
-
this.propagationStopped = !0;
|
|
725
|
-
} }, { key: "stopImmediatePropagation", value: function() {
|
|
726
|
-
this.immediatePropagationStopped = this.propagationStopped = !0;
|
|
727
|
-
} }]), t;
|
|
728
|
-
}();
|
|
729
|
-
Object.defineProperty(nt.prototype, "interaction", { get: function() {
|
|
730
|
-
return this._interaction._proxy;
|
|
731
|
-
}, set: function() {
|
|
732
|
-
} });
|
|
733
|
-
var Qt = function(t, e) {
|
|
734
|
-
for (var n = 0; n < e.length; n++) {
|
|
735
|
-
var r = e[n];
|
|
736
|
-
t.push(r);
|
|
737
|
-
}
|
|
738
|
-
return t;
|
|
739
|
-
}, Zt = function(t) {
|
|
740
|
-
return Qt([], t);
|
|
741
|
-
}, Ne = function(t, e) {
|
|
742
|
-
for (var n = 0; n < t.length; n++)
|
|
743
|
-
if (e(t[n], n, t))
|
|
744
|
-
return n;
|
|
745
|
-
return -1;
|
|
746
|
-
}, Ve = function(t, e) {
|
|
747
|
-
return t[Ne(t, e)];
|
|
748
|
-
}, Ie = function(t) {
|
|
749
|
-
ue(n, t);
|
|
750
|
-
var e = ee(n);
|
|
751
|
-
function n(r, i, o) {
|
|
752
|
-
var a;
|
|
753
|
-
R(this, n), (a = e.call(this, i._interaction)).dropzone = void 0, a.dragEvent = void 0, a.relatedTarget = void 0, a.draggable = void 0, a.propagationStopped = !1, a.immediatePropagationStopped = !1;
|
|
754
|
-
var s = o === "dragleave" ? r.prev : r.cur, c = s.element, u = s.dropzone;
|
|
755
|
-
return a.type = o, a.target = c, a.currentTarget = c, a.dropzone = u, a.dragEvent = i, a.relatedTarget = i.target, a.draggable = i.interactable, a.timeStamp = i.timeStamp, a;
|
|
756
|
-
}
|
|
757
|
-
return k(n, [{ key: "reject", value: function() {
|
|
758
|
-
var r = this, i = this._interaction.dropState;
|
|
759
|
-
if (this.type === "dropactivate" || this.dropzone && i.cur.dropzone === this.dropzone && i.cur.element === this.target)
|
|
760
|
-
if (i.prev.dropzone = this.dropzone, i.prev.element = this.target, i.rejected = !0, i.events.enter = null, this.stopImmediatePropagation(), this.type === "dropactivate") {
|
|
761
|
-
var o = i.activeDrops, a = Ne(o, function(c) {
|
|
762
|
-
var u = c.dropzone, l = c.element;
|
|
763
|
-
return u === r.dropzone && l === r.target;
|
|
764
|
-
});
|
|
765
|
-
i.activeDrops.splice(a, 1);
|
|
766
|
-
var s = new n(i, this.dragEvent, "dropdeactivate");
|
|
767
|
-
s.dropzone = this.dropzone, s.target = this.target, this.dropzone.fire(s);
|
|
768
|
-
} else
|
|
769
|
-
this.dropzone.fire(new n(i, this.dragEvent, "dragleave"));
|
|
770
|
-
} }, { key: "preventDefault", value: function() {
|
|
771
|
-
} }, { key: "stopPropagation", value: function() {
|
|
772
|
-
this.propagationStopped = !0;
|
|
773
|
-
} }, { key: "stopImmediatePropagation", value: function() {
|
|
774
|
-
this.immediatePropagationStopped = this.propagationStopped = !0;
|
|
775
|
-
} }]), n;
|
|
776
|
-
}(nt);
|
|
777
|
-
function en(t, e) {
|
|
778
|
-
for (var n = 0, r = t.slice(); n < r.length; n++) {
|
|
779
|
-
var i = r[n], o = i.dropzone, a = i.element;
|
|
780
|
-
e.dropzone = o, e.target = a, o.fire(e), e.propagationStopped = e.immediatePropagationStopped = !1;
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
function Et(t, e) {
|
|
784
|
-
for (var n = function(o, a) {
|
|
785
|
-
for (var s = [], c = 0, u = o.interactables.list; c < u.length; c++) {
|
|
786
|
-
var l = u[c];
|
|
787
|
-
if (l.options.drop.enabled) {
|
|
788
|
-
var p = l.options.drop.accept;
|
|
789
|
-
if (!(d.element(p) && p !== a || d.string(p) && !Q(a, p) || d.func(p) && !p({ dropzone: l, draggableElement: a })))
|
|
790
|
-
for (var f = 0, h = l.getAllElements(); f < h.length; f++) {
|
|
791
|
-
var v = h[f];
|
|
792
|
-
v !== a && s.push({ dropzone: l, element: v, rect: l.getRect(v) });
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
return s;
|
|
797
|
-
}(t, e), r = 0; r < n.length; r++) {
|
|
798
|
-
var i = n[r];
|
|
799
|
-
i.rect = i.dropzone.getRect(i.element);
|
|
800
|
-
}
|
|
801
|
-
return n;
|
|
802
|
-
}
|
|
803
|
-
function tn(t, e, n) {
|
|
804
|
-
for (var r = t.dropState, i = t.interactable, o = t.element, a = [], s = 0, c = r.activeDrops; s < c.length; s++) {
|
|
805
|
-
var u = c[s], l = u.dropzone, p = u.element, f = u.rect, h = l.dropCheck(e, n, i, o, p, f);
|
|
806
|
-
a.push(h ? p : null);
|
|
807
|
-
}
|
|
808
|
-
var v = function(g) {
|
|
809
|
-
for (var b, m, w, T = [], P = 0; P < g.length; P++) {
|
|
810
|
-
var E = g[P], _ = g[b];
|
|
811
|
-
if (E && P !== b)
|
|
812
|
-
if (_) {
|
|
813
|
-
var L = re(E), O = re(_);
|
|
814
|
-
if (L !== E.ownerDocument)
|
|
815
|
-
if (O !== E.ownerDocument)
|
|
816
|
-
if (L !== O) {
|
|
817
|
-
T = T.length ? T : Je(_);
|
|
818
|
-
var W = void 0;
|
|
819
|
-
if (_ instanceof C.HTMLElement && E instanceof C.SVGElement && !(E instanceof C.SVGSVGElement)) {
|
|
820
|
-
if (E === O)
|
|
821
|
-
continue;
|
|
822
|
-
W = E.ownerSVGElement;
|
|
823
|
-
} else
|
|
824
|
-
W = E;
|
|
825
|
-
for (var H = Je(W, _.ownerDocument), ce = 0; H[ce] && H[ce] === T[ce]; )
|
|
826
|
-
ce++;
|
|
827
|
-
var pt = [H[ce - 1], H[ce], T[ce]];
|
|
828
|
-
if (pt[0])
|
|
829
|
-
for (var Ue = pt[0].lastChild; Ue; ) {
|
|
830
|
-
if (Ue === pt[1]) {
|
|
831
|
-
b = P, T = H;
|
|
832
|
-
break;
|
|
833
|
-
}
|
|
834
|
-
if (Ue === pt[2])
|
|
835
|
-
break;
|
|
836
|
-
Ue = Ue.previousSibling;
|
|
837
|
-
}
|
|
838
|
-
} else
|
|
839
|
-
w = _, (parseInt(B(m = E).getComputedStyle(m).zIndex, 10) || 0) >= (parseInt(B(w).getComputedStyle(w).zIndex, 10) || 0) && (b = P);
|
|
840
|
-
else
|
|
841
|
-
b = P;
|
|
842
|
-
} else
|
|
843
|
-
b = P;
|
|
844
|
-
}
|
|
845
|
-
return b;
|
|
846
|
-
}(a);
|
|
847
|
-
return r.activeDrops[v] || null;
|
|
848
|
-
}
|
|
849
|
-
function St(t, e, n) {
|
|
850
|
-
var r = t.dropState, i = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
|
|
851
|
-
return n.type === "dragstart" && (i.activate = new Ie(r, n, "dropactivate"), i.activate.target = null, i.activate.dropzone = null), n.type === "dragend" && (i.deactivate = new Ie(r, n, "dropdeactivate"), i.deactivate.target = null, i.deactivate.dropzone = null), r.rejected || (r.cur.element !== r.prev.element && (r.prev.dropzone && (i.leave = new Ie(r, n, "dragleave"), n.dragLeave = i.leave.target = r.prev.element, n.prevDropzone = i.leave.dropzone = r.prev.dropzone), r.cur.dropzone && (i.enter = new Ie(r, n, "dragenter"), n.dragEnter = r.cur.element, n.dropzone = r.cur.dropzone)), n.type === "dragend" && r.cur.dropzone && (i.drop = new Ie(r, n, "drop"), n.dropzone = r.cur.dropzone, n.relatedTarget = r.cur.element), n.type === "dragmove" && r.cur.dropzone && (i.move = new Ie(r, n, "dropmove"), n.dropzone = r.cur.dropzone)), i;
|
|
852
|
-
}
|
|
853
|
-
function Tt(t, e) {
|
|
854
|
-
var n = t.dropState, r = n.activeDrops, i = n.cur, o = n.prev;
|
|
855
|
-
e.leave && o.dropzone.fire(e.leave), e.enter && i.dropzone.fire(e.enter), e.move && i.dropzone.fire(e.move), e.drop && i.dropzone.fire(e.drop), e.deactivate && en(r, e.deactivate), n.prev.dropzone = i.dropzone, n.prev.element = i.element;
|
|
856
|
-
}
|
|
857
|
-
function nn(t, e) {
|
|
858
|
-
var n = t.interaction, r = t.iEvent, i = t.event;
|
|
859
|
-
if (r.type === "dragmove" || r.type === "dragend") {
|
|
860
|
-
var o = n.dropState;
|
|
861
|
-
e.dynamicDrop && (o.activeDrops = Et(e, n.element));
|
|
862
|
-
var a = r, s = tn(n, a, i);
|
|
863
|
-
o.rejected = o.rejected && !!s && s.dropzone === o.cur.dropzone && s.element === o.cur.element, o.cur.dropzone = s && s.dropzone, o.cur.element = s && s.element, o.events = St(n, 0, a);
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
var rn = { id: "actions/drop", install: function(t) {
|
|
867
|
-
var e = t.actions, n = t.interactStatic, r = t.Interactable, i = t.defaults;
|
|
868
|
-
t.usePlugin(Re), r.prototype.dropzone = function(o) {
|
|
869
|
-
return function(a, s) {
|
|
870
|
-
if (d.object(s)) {
|
|
871
|
-
if (a.options.drop.enabled = s.enabled !== !1, s.listeners) {
|
|
872
|
-
var c = we(s.listeners), u = Object.keys(c).reduce(function(p, f) {
|
|
873
|
-
return p[/^(enter|leave)/.test(f) ? "drag".concat(f) : /^(activate|deactivate|move)/.test(f) ? "drop".concat(f) : f] = c[f], p;
|
|
874
|
-
}, {}), l = a.options.drop.listeners;
|
|
875
|
-
l && a.off(l), a.on(u), a.options.drop.listeners = u;
|
|
876
|
-
}
|
|
877
|
-
return d.func(s.ondrop) && a.on("drop", s.ondrop), d.func(s.ondropactivate) && a.on("dropactivate", s.ondropactivate), d.func(s.ondropdeactivate) && a.on("dropdeactivate", s.ondropdeactivate), d.func(s.ondragenter) && a.on("dragenter", s.ondragenter), d.func(s.ondragleave) && a.on("dragleave", s.ondragleave), d.func(s.ondropmove) && a.on("dropmove", s.ondropmove), /^(pointer|center)$/.test(s.overlap) ? a.options.drop.overlap = s.overlap : d.number(s.overlap) && (a.options.drop.overlap = Math.max(Math.min(1, s.overlap), 0)), "accept" in s && (a.options.drop.accept = s.accept), "checker" in s && (a.options.drop.checker = s.checker), a;
|
|
878
|
-
}
|
|
879
|
-
return d.bool(s) ? (a.options.drop.enabled = s, a) : a.options.drop;
|
|
880
|
-
}(this, o);
|
|
881
|
-
}, r.prototype.dropCheck = function(o, a, s, c, u, l) {
|
|
882
|
-
return function(p, f, h, v, g, b, m) {
|
|
883
|
-
var w = !1;
|
|
884
|
-
if (!(m = m || p.getRect(b)))
|
|
885
|
-
return !!p.options.drop.checker && p.options.drop.checker(f, h, w, p, b, v, g);
|
|
886
|
-
var T = p.options.drop.overlap;
|
|
887
|
-
if (T === "pointer") {
|
|
888
|
-
var P = Fe(v, g, "drag"), E = Gt(f);
|
|
889
|
-
E.x += P.x, E.y += P.y;
|
|
890
|
-
var _ = E.x > m.left && E.x < m.right, L = E.y > m.top && E.y < m.bottom;
|
|
891
|
-
w = _ && L;
|
|
892
|
-
}
|
|
893
|
-
var O = v.getRect(g);
|
|
894
|
-
if (O && T === "center") {
|
|
895
|
-
var W = O.left + O.width / 2, H = O.top + O.height / 2;
|
|
896
|
-
w = W >= m.left && W <= m.right && H >= m.top && H <= m.bottom;
|
|
897
|
-
}
|
|
898
|
-
return O && d.number(T) && (w = Math.max(0, Math.min(m.right, O.right) - Math.max(m.left, O.left)) * Math.max(0, Math.min(m.bottom, O.bottom) - Math.max(m.top, O.top)) / (O.width * O.height) >= T), p.options.drop.checker && (w = p.options.drop.checker(f, h, w, p, b, v, g)), w;
|
|
899
|
-
}(this, o, a, s, c, u, l);
|
|
900
|
-
}, n.dynamicDrop = function(o) {
|
|
901
|
-
return d.bool(o) ? (t.dynamicDrop = o, n) : t.dynamicDrop;
|
|
902
|
-
}, y(e.phaselessTypes, { dragenter: !0, dragleave: !0, dropactivate: !0, dropdeactivate: !0, dropmove: !0, drop: !0 }), e.methodDict.drop = "dropzone", t.dynamicDrop = !1, i.actions.drop = rn.defaults;
|
|
903
|
-
}, listeners: { "interactions:before-action-start": function(t) {
|
|
904
|
-
var e = t.interaction;
|
|
905
|
-
e.prepared.name === "drag" && (e.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
|
|
906
|
-
}, "interactions:after-action-start": function(t, e) {
|
|
907
|
-
var n = t.interaction, r = (t.event, t.iEvent);
|
|
908
|
-
if (n.prepared.name === "drag") {
|
|
909
|
-
var i = n.dropState;
|
|
910
|
-
i.activeDrops = [], i.events = {}, i.activeDrops = Et(e, n.element), i.events = St(n, 0, r), i.events.activate && (en(i.activeDrops, i.events.activate), e.fire("actions/drop:start", { interaction: n, dragEvent: r }));
|
|
911
|
-
}
|
|
912
|
-
}, "interactions:action-move": nn, "interactions:after-action-move": function(t, e) {
|
|
913
|
-
var n = t.interaction, r = t.iEvent;
|
|
914
|
-
if (n.prepared.name === "drag") {
|
|
915
|
-
var i = n.dropState;
|
|
916
|
-
Tt(n, i.events), e.fire("actions/drop:move", { interaction: n, dragEvent: r }), i.events = {};
|
|
917
|
-
}
|
|
918
|
-
}, "interactions:action-end": function(t, e) {
|
|
919
|
-
if (t.interaction.prepared.name === "drag") {
|
|
920
|
-
var n = t.interaction, r = t.iEvent;
|
|
921
|
-
nn(t, e), Tt(n, n.dropState.events), e.fire("actions/drop:end", { interaction: n, dragEvent: r });
|
|
922
|
-
}
|
|
923
|
-
}, "interactions:stop": function(t) {
|
|
924
|
-
var e = t.interaction;
|
|
925
|
-
if (e.prepared.name === "drag") {
|
|
926
|
-
var n = e.dropState;
|
|
927
|
-
n && (n.activeDrops = null, n.events = null, n.cur.dropzone = null, n.cur.element = null, n.prev.dropzone = null, n.prev.element = null, n.rejected = !1);
|
|
928
|
-
}
|
|
929
|
-
} }, getActiveDrops: Et, getDrop: tn, getDropEvents: St, fireDropEvents: Tt, filterEventType: function(t) {
|
|
930
|
-
return t.search("drag") === 0 || t.search("drop") === 0;
|
|
931
|
-
}, defaults: { enabled: !1, accept: null, overlap: "pointer" } }, Wn = rn;
|
|
932
|
-
function _t(t) {
|
|
933
|
-
var e = t.interaction, n = t.iEvent, r = t.phase;
|
|
934
|
-
if (e.prepared.name === "gesture") {
|
|
935
|
-
var i = e.pointers.map(function(u) {
|
|
936
|
-
return u.pointer;
|
|
937
|
-
}), o = r === "start", a = r === "end", s = e.interactable.options.deltaSource;
|
|
938
|
-
if (n.touches = [i[0], i[1]], o)
|
|
939
|
-
n.distance = xt(i, s), n.box = bt(i), n.scale = 1, n.ds = 0, n.angle = wt(i, s), n.da = 0, e.gesture.startDistance = n.distance, e.gesture.startAngle = n.angle;
|
|
940
|
-
else if (a || e.pointers.length < 2) {
|
|
941
|
-
var c = e.prevEvent;
|
|
942
|
-
n.distance = c.distance, n.box = c.box, n.scale = c.scale, n.ds = 0, n.angle = c.angle, n.da = 0;
|
|
943
|
-
} else
|
|
944
|
-
n.distance = xt(i, s), n.box = bt(i), n.scale = n.distance / e.gesture.startDistance, n.angle = wt(i, s), n.ds = n.scale - e.gesture.scale, n.da = n.angle - e.gesture.angle;
|
|
945
|
-
e.gesture.distance = n.distance, e.gesture.angle = n.angle, d.number(n.scale) && n.scale !== 1 / 0 && !isNaN(n.scale) && (e.gesture.scale = n.scale);
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
var Pt = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(t) {
|
|
949
|
-
var e = t.actions, n = t.Interactable, r = t.defaults;
|
|
950
|
-
n.prototype.gesturable = function(i) {
|
|
951
|
-
return d.object(i) ? (this.options.gesture.enabled = i.enabled !== !1, this.setPerAction("gesture", i), this.setOnEvents("gesture", i), this) : d.bool(i) ? (this.options.gesture.enabled = i, this) : this.options.gesture;
|
|
952
|
-
}, e.map.gesture = Pt, e.methodDict.gesture = "gesturable", r.actions.gesture = Pt.defaults;
|
|
953
|
-
}, listeners: { "interactions:action-start": _t, "interactions:action-move": _t, "interactions:action-end": _t, "interactions:new": function(t) {
|
|
954
|
-
t.interaction.gesture = { angle: 0, distance: 0, scale: 1, startAngle: 0, startDistance: 0 };
|
|
955
|
-
}, "auto-start:check": function(t) {
|
|
956
|
-
if (!(t.interaction.pointers.length < 2)) {
|
|
957
|
-
var e = t.interactable.options.gesture;
|
|
958
|
-
if (e && e.enabled)
|
|
959
|
-
return t.action = { name: "gesture" }, !1;
|
|
960
|
-
}
|
|
961
|
-
} }, defaults: {}, getCursor: function() {
|
|
962
|
-
return "";
|
|
963
|
-
}, filterEventType: function(t) {
|
|
964
|
-
return t.search("gesture") === 0;
|
|
965
|
-
} }, qn = Pt;
|
|
966
|
-
function Un(t, e, n, r, i, o, a) {
|
|
967
|
-
if (!e)
|
|
968
|
-
return !1;
|
|
969
|
-
if (e === !0) {
|
|
970
|
-
var s = d.number(o.width) ? o.width : o.right - o.left, c = d.number(o.height) ? o.height : o.bottom - o.top;
|
|
971
|
-
if (a = Math.min(a, Math.abs((t === "left" || t === "right" ? s : c) / 2)), s < 0 && (t === "left" ? t = "right" : t === "right" && (t = "left")), c < 0 && (t === "top" ? t = "bottom" : t === "bottom" && (t = "top")), t === "left") {
|
|
972
|
-
var u = s >= 0 ? o.left : o.right;
|
|
973
|
-
return n.x < u + a;
|
|
974
|
-
}
|
|
975
|
-
if (t === "top") {
|
|
976
|
-
var l = c >= 0 ? o.top : o.bottom;
|
|
977
|
-
return n.y < l + a;
|
|
978
|
-
}
|
|
979
|
-
if (t === "right")
|
|
980
|
-
return n.x > (s >= 0 ? o.right : o.left) - a;
|
|
981
|
-
if (t === "bottom")
|
|
982
|
-
return n.y > (c >= 0 ? o.bottom : o.top) - a;
|
|
983
|
-
}
|
|
984
|
-
return !!d.element(r) && (d.element(e) ? e === r : je(r, e, i));
|
|
985
|
-
}
|
|
986
|
-
function on(t) {
|
|
987
|
-
var e = t.iEvent, n = t.interaction;
|
|
988
|
-
if (n.prepared.name === "resize" && n.resizeAxes) {
|
|
989
|
-
var r = e;
|
|
990
|
-
n.interactable.options.resize.square ? (n.resizeAxes === "y" ? r.delta.x = r.delta.y : r.delta.y = r.delta.x, r.axes = "xy") : (r.axes = n.resizeAxes, n.resizeAxes === "x" ? r.delta.y = 0 : n.resizeAxes === "y" && (r.delta.x = 0));
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
var ae, Ee, se = { id: "actions/resize", before: ["actions/drag"], install: function(t) {
|
|
994
|
-
var e = t.actions, n = t.browser, r = t.Interactable, i = t.defaults;
|
|
995
|
-
se.cursors = function(o) {
|
|
996
|
-
return o.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" };
|
|
997
|
-
}(n), se.defaultMargin = n.supportsTouch || n.supportsPointerEvent ? 20 : 10, r.prototype.resizable = function(o) {
|
|
998
|
-
return function(a, s, c) {
|
|
999
|
-
return d.object(s) ? (a.options.resize.enabled = s.enabled !== !1, a.setPerAction("resize", s), a.setOnEvents("resize", s), d.string(s.axis) && /^x$|^y$|^xy$/.test(s.axis) ? a.options.resize.axis = s.axis : s.axis === null && (a.options.resize.axis = c.defaults.actions.resize.axis), d.bool(s.preserveAspectRatio) ? a.options.resize.preserveAspectRatio = s.preserveAspectRatio : d.bool(s.square) && (a.options.resize.square = s.square), a) : d.bool(s) ? (a.options.resize.enabled = s, a) : a.options.resize;
|
|
1000
|
-
}(this, o, t);
|
|
1001
|
-
}, e.map.resize = se, e.methodDict.resize = "resizable", i.actions.resize = se.defaults;
|
|
1002
|
-
}, listeners: { "interactions:new": function(t) {
|
|
1003
|
-
t.interaction.resizeAxes = "xy";
|
|
1004
|
-
}, "interactions:action-start": function(t) {
|
|
1005
|
-
(function(e) {
|
|
1006
|
-
var n = e.iEvent, r = e.interaction;
|
|
1007
|
-
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1008
|
-
var i = n, o = r.rect;
|
|
1009
|
-
r._rects = { start: y({}, o), corrected: y({}, o), previous: y({}, o), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, i.edges = r.prepared.edges, i.rect = r._rects.corrected, i.deltaRect = r._rects.delta;
|
|
1010
|
-
}
|
|
1011
|
-
})(t), on(t);
|
|
1012
|
-
}, "interactions:action-move": function(t) {
|
|
1013
|
-
(function(e) {
|
|
1014
|
-
var n = e.iEvent, r = e.interaction;
|
|
1015
|
-
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1016
|
-
var i = n, o = r.interactable.options.resize.invert, a = o === "reposition" || o === "negate", s = r.rect, c = r._rects, u = c.start, l = c.corrected, p = c.delta, f = c.previous;
|
|
1017
|
-
if (y(f, l), a) {
|
|
1018
|
-
if (y(l, s), o === "reposition") {
|
|
1019
|
-
if (l.top > l.bottom) {
|
|
1020
|
-
var h = l.top;
|
|
1021
|
-
l.top = l.bottom, l.bottom = h;
|
|
1022
|
-
}
|
|
1023
|
-
if (l.left > l.right) {
|
|
1024
|
-
var v = l.left;
|
|
1025
|
-
l.left = l.right, l.right = v;
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
} else
|
|
1029
|
-
l.top = Math.min(s.top, u.bottom), l.bottom = Math.max(s.bottom, u.top), l.left = Math.min(s.left, u.right), l.right = Math.max(s.right, u.left);
|
|
1030
|
-
for (var g in l.width = l.right - l.left, l.height = l.bottom - l.top, l)
|
|
1031
|
-
p[g] = l[g] - f[g];
|
|
1032
|
-
i.edges = r.prepared.edges, i.rect = l, i.deltaRect = p;
|
|
1033
|
-
}
|
|
1034
|
-
})(t), on(t);
|
|
1035
|
-
}, "interactions:action-end": function(t) {
|
|
1036
|
-
var e = t.iEvent, n = t.interaction;
|
|
1037
|
-
if (n.prepared.name === "resize" && n.prepared.edges) {
|
|
1038
|
-
var r = e;
|
|
1039
|
-
r.edges = n.prepared.edges, r.rect = n._rects.corrected, r.deltaRect = n._rects.delta;
|
|
1040
|
-
}
|
|
1041
|
-
}, "auto-start:check": function(t) {
|
|
1042
|
-
var e = t.interaction, n = t.interactable, r = t.element, i = t.rect, o = t.buttons;
|
|
1043
|
-
if (i) {
|
|
1044
|
-
var a = y({}, e.coords.cur.page), s = n.options.resize;
|
|
1045
|
-
if (s && s.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || o & s.mouseButtons)) {
|
|
1046
|
-
if (d.object(s.edges)) {
|
|
1047
|
-
var c = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
1048
|
-
for (var u in c)
|
|
1049
|
-
c[u] = Un(u, s.edges[u], a, e._latestPointer.eventTarget, r, i, s.margin || se.defaultMargin);
|
|
1050
|
-
c.left = c.left && !c.right, c.top = c.top && !c.bottom, (c.left || c.right || c.top || c.bottom) && (t.action = { name: "resize", edges: c });
|
|
1051
|
-
} else {
|
|
1052
|
-
var l = s.axis !== "y" && a.x > i.right - se.defaultMargin, p = s.axis !== "x" && a.y > i.bottom - se.defaultMargin;
|
|
1053
|
-
(l || p) && (t.action = { name: "resize", axes: (l ? "x" : "") + (p ? "y" : "") });
|
|
1054
|
-
}
|
|
1055
|
-
return !t.action && void 0;
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
} }, defaults: { square: !1, preserveAspectRatio: !1, axis: "xy", margin: NaN, edges: null, invert: "none" }, cursors: null, getCursor: function(t) {
|
|
1059
|
-
var e = t.edges, n = t.axis, r = t.name, i = se.cursors, o = null;
|
|
1060
|
-
if (n)
|
|
1061
|
-
o = i[r + n];
|
|
1062
|
-
else if (e) {
|
|
1063
|
-
for (var a = "", s = 0, c = ["top", "bottom", "left", "right"]; s < c.length; s++) {
|
|
1064
|
-
var u = c[s];
|
|
1065
|
-
e[u] && (a += u);
|
|
1066
|
-
}
|
|
1067
|
-
o = i[a];
|
|
1068
|
-
}
|
|
1069
|
-
return o;
|
|
1070
|
-
}, filterEventType: function(t) {
|
|
1071
|
-
return t.search("resize") === 0;
|
|
1072
|
-
}, defaultMargin: null }, Gn = se, Kn = { id: "actions", install: function(t) {
|
|
1073
|
-
t.usePlugin(qn), t.usePlugin(Gn), t.usePlugin(Re), t.usePlugin(Wn);
|
|
1074
|
-
} }, an = 0, fe = { request: function(t) {
|
|
1075
|
-
return ae(t);
|
|
1076
|
-
}, cancel: function(t) {
|
|
1077
|
-
return Ee(t);
|
|
1078
|
-
}, init: function(t) {
|
|
1079
|
-
if (ae = t.requestAnimationFrame, Ee = t.cancelAnimationFrame, !ae)
|
|
1080
|
-
for (var e = ["ms", "moz", "webkit", "o"], n = 0; n < e.length; n++) {
|
|
1081
|
-
var r = e[n];
|
|
1082
|
-
ae = t["".concat(r, "RequestAnimationFrame")], Ee = t["".concat(r, "CancelAnimationFrame")] || t["".concat(r, "CancelRequestAnimationFrame")];
|
|
1083
|
-
}
|
|
1084
|
-
ae = ae && ae.bind(t), Ee = Ee && Ee.bind(t), ae || (ae = function(i) {
|
|
1085
|
-
var o = Date.now(), a = Math.max(0, 16 - (o - an)), s = t.setTimeout(function() {
|
|
1086
|
-
i(o + a);
|
|
1087
|
-
}, a);
|
|
1088
|
-
return an = o + a, s;
|
|
1089
|
-
}, Ee = function(i) {
|
|
1090
|
-
return clearTimeout(i);
|
|
1091
|
-
});
|
|
1092
|
-
} }, S = { 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) {
|
|
1093
|
-
S.isScrolling = !0, fe.cancel(S.i), t.autoScroll = S, S.interaction = t, S.prevTime = S.now(), S.i = fe.request(S.scroll);
|
|
1094
|
-
}, stop: function() {
|
|
1095
|
-
S.isScrolling = !1, S.interaction && (S.interaction.autoScroll = null), fe.cancel(S.i);
|
|
1096
|
-
}, scroll: function() {
|
|
1097
|
-
var t = S.interaction, e = t.interactable, n = t.element, r = t.prepared.name, i = e.options[r].autoScroll, o = sn(i.container, e, n), a = S.now(), s = (a - S.prevTime) / 1e3, c = i.speed * s;
|
|
1098
|
-
if (c >= 1) {
|
|
1099
|
-
var u = { x: S.x * c, y: S.y * c };
|
|
1100
|
-
if (u.x || u.y) {
|
|
1101
|
-
var l = cn(o);
|
|
1102
|
-
d.window(o) ? o.scrollBy(u.x, u.y) : o && (o.scrollLeft += u.x, o.scrollTop += u.y);
|
|
1103
|
-
var p = cn(o), f = { x: p.x - l.x, y: p.y - l.y };
|
|
1104
|
-
(f.x || f.y) && e.fire({ type: "autoscroll", target: n, interactable: e, delta: f, interaction: t, container: o });
|
|
1105
|
-
}
|
|
1106
|
-
S.prevTime = a;
|
|
1107
|
-
}
|
|
1108
|
-
S.isScrolling && (fe.cancel(S.i), S.i = fe.request(S.scroll));
|
|
1109
|
-
}, check: function(t, e) {
|
|
1110
|
-
var n;
|
|
1111
|
-
return (n = t.options[e].autoScroll) == null ? void 0 : n.enabled;
|
|
1112
|
-
}, onInteractionMove: function(t) {
|
|
1113
|
-
var e = t.interaction, n = t.pointer;
|
|
1114
|
-
if (e.interacting() && S.check(e.interactable, e.prepared.name))
|
|
1115
|
-
if (e.simulation)
|
|
1116
|
-
S.x = S.y = 0;
|
|
1117
|
-
else {
|
|
1118
|
-
var r, i, o, a, s = e.interactable, c = e.element, u = e.prepared.name, l = s.options[u].autoScroll, p = sn(l.container, s, c);
|
|
1119
|
-
if (d.window(p))
|
|
1120
|
-
a = n.clientX < S.margin, r = n.clientY < S.margin, i = n.clientX > p.innerWidth - S.margin, o = n.clientY > p.innerHeight - S.margin;
|
|
1121
|
-
else {
|
|
1122
|
-
var f = ye(p);
|
|
1123
|
-
a = n.clientX < f.left + S.margin, r = n.clientY < f.top + S.margin, i = n.clientX > f.right - S.margin, o = n.clientY > f.bottom - S.margin;
|
|
1124
|
-
}
|
|
1125
|
-
S.x = i ? 1 : a ? -1 : 0, S.y = o ? 1 : r ? -1 : 0, S.isScrolling || (S.margin = l.margin, S.speed = l.speed, S.start(e));
|
|
1126
|
-
}
|
|
1127
|
-
} };
|
|
1128
|
-
function sn(t, e, n) {
|
|
1129
|
-
return (d.string(t) ? ie(t, e, n) : t) || B(n);
|
|
1130
|
-
}
|
|
1131
|
-
function cn(t) {
|
|
1132
|
-
return d.window(t) && (t = window.document.body), { x: t.scrollLeft, y: t.scrollTop };
|
|
1133
|
-
}
|
|
1134
|
-
var Hn = { id: "auto-scroll", install: function(t) {
|
|
1135
|
-
var e = t.defaults, n = t.actions;
|
|
1136
|
-
t.autoScroll = S, S.now = function() {
|
|
1137
|
-
return t.now();
|
|
1138
|
-
}, n.phaselessTypes.autoscroll = !0, e.perAction.autoScroll = S.defaults;
|
|
1139
|
-
}, listeners: { "interactions:new": function(t) {
|
|
1140
|
-
t.interaction.autoScroll = null;
|
|
1141
|
-
}, "interactions:destroy": function(t) {
|
|
1142
|
-
t.interaction.autoScroll = null, S.stop(), S.interaction && (S.interaction = null);
|
|
1143
|
-
}, "interactions:stop": S.stop, "interactions:action-move": function(t) {
|
|
1144
|
-
return S.onInteractionMove(t);
|
|
1145
|
-
} } }, Jn = Hn;
|
|
1146
|
-
function Le(t, e) {
|
|
1147
|
-
var n = !1;
|
|
1148
|
-
return function() {
|
|
1149
|
-
return n || (G.console.warn(e), n = !0), t.apply(this, arguments);
|
|
1150
|
-
};
|
|
1151
|
-
}
|
|
1152
|
-
function kt(t, e) {
|
|
1153
|
-
return t.name = e.name, t.axis = e.axis, t.edges = e.edges, t;
|
|
1154
|
-
}
|
|
1155
|
-
function Qn(t) {
|
|
1156
|
-
return d.bool(t) ? (this.options.styleCursor = t, this) : t === null ? (delete this.options.styleCursor, this) : this.options.styleCursor;
|
|
1157
|
-
}
|
|
1158
|
-
function Zn(t) {
|
|
1159
|
-
return d.func(t) ? (this.options.actionChecker = t, this) : t === null ? (delete this.options.actionChecker, this) : this.options.actionChecker;
|
|
1160
|
-
}
|
|
1161
|
-
var er = { id: "auto-start/interactableMethods", install: function(t) {
|
|
1162
|
-
var e = t.Interactable;
|
|
1163
|
-
e.prototype.getAction = function(n, r, i, o) {
|
|
1164
|
-
var a = function(s, c, u, l, p) {
|
|
1165
|
-
var f = s.getRect(l), h = c.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[c.button], v = { action: null, interactable: s, interaction: u, element: l, rect: f, buttons: h };
|
|
1166
|
-
return p.fire("auto-start:check", v), v.action;
|
|
1167
|
-
}(this, r, i, o, t);
|
|
1168
|
-
return this.options.actionChecker ? this.options.actionChecker(n, r, a, this, o, i) : a;
|
|
1169
|
-
}, e.prototype.ignoreFrom = Le(function(n) {
|
|
1170
|
-
return this._backCompatOption("ignoreFrom", n);
|
|
1171
|
-
}, "Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."), e.prototype.allowFrom = Le(function(n) {
|
|
1172
|
-
return this._backCompatOption("allowFrom", n);
|
|
1173
|
-
}, "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), e.prototype.actionChecker = Zn, e.prototype.styleCursor = Qn;
|
|
1174
|
-
} };
|
|
1175
|
-
function ln(t, e, n, r, i) {
|
|
1176
|
-
return e.testIgnoreAllow(e.options[t.name], n, r) && e.options[t.name].enabled && rt(e, n, t, i) ? t : null;
|
|
1177
|
-
}
|
|
1178
|
-
function tr(t, e, n, r, i, o, a) {
|
|
1179
|
-
for (var s = 0, c = r.length; s < c; s++) {
|
|
1180
|
-
var u = r[s], l = i[s], p = u.getAction(e, n, t, l);
|
|
1181
|
-
if (p) {
|
|
1182
|
-
var f = ln(p, u, l, o, a);
|
|
1183
|
-
if (f)
|
|
1184
|
-
return { action: f, interactable: u, element: l };
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
return { action: null, interactable: null, element: null };
|
|
1188
|
-
}
|
|
1189
|
-
function un(t, e, n, r, i) {
|
|
1190
|
-
var o = [], a = [], s = r;
|
|
1191
|
-
function c(l) {
|
|
1192
|
-
o.push(l), a.push(s);
|
|
1193
|
-
}
|
|
1194
|
-
for (; d.element(s); ) {
|
|
1195
|
-
o = [], a = [], i.interactables.forEachMatch(s, c);
|
|
1196
|
-
var u = tr(t, e, n, o, a, r, i);
|
|
1197
|
-
if (u.action && !u.interactable.options[u.action.name].manualStart)
|
|
1198
|
-
return u;
|
|
1199
|
-
s = K(s);
|
|
1200
|
-
}
|
|
1201
|
-
return { action: null, interactable: null, element: null };
|
|
1202
|
-
}
|
|
1203
|
-
function pn(t, e, n) {
|
|
1204
|
-
var r = e.action, i = e.interactable, o = e.element;
|
|
1205
|
-
r = r || { name: null }, t.interactable = i, t.element = o, kt(t.prepared, r), t.rect = i && r.name ? i.getRect(o) : null, dn(t, n), n.fire("autoStart:prepared", { interaction: t });
|
|
1206
|
-
}
|
|
1207
|
-
function rt(t, e, n, r) {
|
|
1208
|
-
var i = t.options, o = i[n.name].max, a = i[n.name].maxPerElement, s = r.autoStart.maxInteractions, c = 0, u = 0, l = 0;
|
|
1209
|
-
if (!(o && a && s))
|
|
1210
|
-
return !1;
|
|
1211
|
-
for (var p = 0, f = r.interactions.list; p < f.length; p++) {
|
|
1212
|
-
var h = f[p], v = h.prepared.name;
|
|
1213
|
-
if (h.interacting() && (++c >= s || h.interactable === t && ((u += v === n.name ? 1 : 0) >= o || h.element === e && (l++, v === n.name && l >= a))))
|
|
1214
|
-
return !1;
|
|
1215
|
-
}
|
|
1216
|
-
return s > 0;
|
|
1217
|
-
}
|
|
1218
|
-
function fn(t, e) {
|
|
1219
|
-
return d.number(t) ? (e.autoStart.maxInteractions = t, this) : e.autoStart.maxInteractions;
|
|
1220
|
-
}
|
|
1221
|
-
function Ot(t, e, n) {
|
|
1222
|
-
var r = n.autoStart.cursorElement;
|
|
1223
|
-
r && r !== t && (r.style.cursor = ""), t.ownerDocument.documentElement.style.cursor = e, t.style.cursor = e, n.autoStart.cursorElement = e ? t : null;
|
|
1224
|
-
}
|
|
1225
|
-
function dn(t, e) {
|
|
1226
|
-
var n = t.interactable, r = t.element, i = t.prepared;
|
|
1227
|
-
if (t.pointerType === "mouse" && n && n.options.styleCursor) {
|
|
1228
|
-
var o = "";
|
|
1229
|
-
if (i.name) {
|
|
1230
|
-
var a = n.options[i.name].cursorChecker;
|
|
1231
|
-
o = d.func(a) ? a(i, n, r, t._interacting) : e.actions.map[i.name].getCursor(i);
|
|
1232
|
-
}
|
|
1233
|
-
Ot(t.element, o || "", e);
|
|
1234
|
-
} else
|
|
1235
|
-
e.autoStart.cursorElement && Ot(e.autoStart.cursorElement, "", e);
|
|
1236
|
-
}
|
|
1237
|
-
var nr = { id: "auto-start/base", before: ["actions"], install: function(t) {
|
|
1238
|
-
var e = t.interactStatic, n = t.defaults;
|
|
1239
|
-
t.usePlugin(er), n.base.actionChecker = null, n.base.styleCursor = !0, y(n.perAction, { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e.maxInteractions = function(r) {
|
|
1240
|
-
return fn(r, t);
|
|
1241
|
-
}, t.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: rt, cursorElement: null };
|
|
1242
|
-
}, listeners: { "interactions:down": function(t, e) {
|
|
1243
|
-
var n = t.interaction, r = t.pointer, i = t.event, o = t.eventTarget;
|
|
1244
|
-
n.interacting() || pn(n, un(n, r, i, o, e), e);
|
|
1245
|
-
}, "interactions:move": function(t, e) {
|
|
1246
|
-
(function(n, r) {
|
|
1247
|
-
var i = n.interaction, o = n.pointer, a = n.event, s = n.eventTarget;
|
|
1248
|
-
i.pointerType !== "mouse" || i.pointerIsDown || i.interacting() || pn(i, un(i, o, a, s, r), r);
|
|
1249
|
-
})(t, e), function(n, r) {
|
|
1250
|
-
var i = n.interaction;
|
|
1251
|
-
if (i.pointerIsDown && !i.interacting() && i.pointerWasMoved && i.prepared.name) {
|
|
1252
|
-
r.fire("autoStart:before-start", n);
|
|
1253
|
-
var o = i.interactable, a = i.prepared.name;
|
|
1254
|
-
a && o && (o.options[a].manualStart || !rt(o, i.element, i.prepared, r) ? i.stop() : (i.start(i.prepared, o, i.element), dn(i, r)));
|
|
1255
|
-
}
|
|
1256
|
-
}(t, e);
|
|
1257
|
-
}, "interactions:stop": function(t, e) {
|
|
1258
|
-
var n = t.interaction, r = n.interactable;
|
|
1259
|
-
r && r.options.styleCursor && Ot(n.element, "", e);
|
|
1260
|
-
} }, maxInteractions: fn, withinInteractionLimit: rt, validateAction: ln }, It = nr, rr = { id: "auto-start/dragAxis", listeners: { "autoStart:before-start": function(t, e) {
|
|
1261
|
-
var n = t.interaction, r = t.eventTarget, i = t.dx, o = t.dy;
|
|
1262
|
-
if (n.prepared.name === "drag") {
|
|
1263
|
-
var a = Math.abs(i), s = Math.abs(o), c = n.interactable.options.drag, u = c.startAxis, l = a > s ? "x" : a < s ? "y" : "xy";
|
|
1264
|
-
if (n.prepared.axis = c.lockAxis === "start" ? l[0] : c.lockAxis, l !== "xy" && u !== "xy" && u !== l) {
|
|
1265
|
-
n.prepared.name = null;
|
|
1266
|
-
for (var p = r, f = function(v) {
|
|
1267
|
-
if (v !== n.interactable) {
|
|
1268
|
-
var g = n.interactable.options.drag;
|
|
1269
|
-
if (!g.manualStart && v.testIgnoreAllow(g, p, r)) {
|
|
1270
|
-
var b = v.getAction(n.downPointer, n.downEvent, n, p);
|
|
1271
|
-
if (b && b.name === "drag" && function(m, w) {
|
|
1272
|
-
if (!w)
|
|
1273
|
-
return !1;
|
|
1274
|
-
var T = w.options.drag.startAxis;
|
|
1275
|
-
return m === "xy" || T === "xy" || T === m;
|
|
1276
|
-
}(l, v) && It.validateAction(b, v, p, r, e))
|
|
1277
|
-
return v;
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
}; d.element(p); ) {
|
|
1281
|
-
var h = e.interactables.forEachMatch(p, f);
|
|
1282
|
-
if (h) {
|
|
1283
|
-
n.prepared.name = "drag", n.interactable = h, n.element = p;
|
|
1284
|
-
break;
|
|
1285
|
-
}
|
|
1286
|
-
p = K(p);
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
} } };
|
|
1291
|
-
function Dt(t) {
|
|
1292
|
-
var e = t.prepared && t.prepared.name;
|
|
1293
|
-
if (!e)
|
|
1294
|
-
return null;
|
|
1295
|
-
var n = t.interactable.options;
|
|
1296
|
-
return n[e].hold || n[e].delay;
|
|
1297
|
-
}
|
|
1298
|
-
var ir = { id: "auto-start/hold", install: function(t) {
|
|
1299
|
-
var e = t.defaults;
|
|
1300
|
-
t.usePlugin(It), e.perAction.hold = 0, e.perAction.delay = 0;
|
|
1301
|
-
}, listeners: { "interactions:new": function(t) {
|
|
1302
|
-
t.interaction.autoStartHoldTimer = null;
|
|
1303
|
-
}, "autoStart:prepared": function(t) {
|
|
1304
|
-
var e = t.interaction, n = Dt(e);
|
|
1305
|
-
n > 0 && (e.autoStartHoldTimer = setTimeout(function() {
|
|
1306
|
-
e.start(e.prepared, e.interactable, e.element);
|
|
1307
|
-
}, n));
|
|
1308
|
-
}, "interactions:move": function(t) {
|
|
1309
|
-
var e = t.interaction, n = t.duplicate;
|
|
1310
|
-
e.autoStartHoldTimer && e.pointerWasMoved && !n && (clearTimeout(e.autoStartHoldTimer), e.autoStartHoldTimer = null);
|
|
1311
|
-
}, "autoStart:before-start": function(t) {
|
|
1312
|
-
var e = t.interaction;
|
|
1313
|
-
Dt(e) > 0 && (e.prepared.name = null);
|
|
1314
|
-
} }, getHoldDuration: Dt }, or = ir, ar = { id: "auto-start", install: function(t) {
|
|
1315
|
-
t.usePlugin(It), t.usePlugin(or), t.usePlugin(rr);
|
|
1316
|
-
} }, sr = function(t) {
|
|
1317
|
-
return /^(always|never|auto)$/.test(t) ? (this.options.preventDefault = t, this) : d.bool(t) ? (this.options.preventDefault = t ? "always" : "never", this) : this.options.preventDefault;
|
|
1318
|
-
};
|
|
1319
|
-
function cr(t) {
|
|
1320
|
-
var e = t.interaction, n = t.event;
|
|
1321
|
-
e.interactable && e.interactable.checkAndPreventDefault(n);
|
|
1322
|
-
}
|
|
1323
|
-
var vn = { id: "core/interactablePreventDefault", install: function(t) {
|
|
1324
|
-
var e = t.Interactable;
|
|
1325
|
-
e.prototype.preventDefault = sr, e.prototype.checkAndPreventDefault = function(n) {
|
|
1326
|
-
return function(r, i, o) {
|
|
1327
|
-
var a = r.options.preventDefault;
|
|
1328
|
-
if (a !== "never")
|
|
1329
|
-
if (a !== "always") {
|
|
1330
|
-
if (i.events.supportsPassive && /^touch(start|move)$/.test(o.type)) {
|
|
1331
|
-
var s = B(o.target).document, c = i.getDocOptions(s);
|
|
1332
|
-
if (!c || !c.events || c.events.passive !== !1)
|
|
1333
|
-
return;
|
|
1334
|
-
}
|
|
1335
|
-
/^(mouse|pointer|touch)*(down|start)/i.test(o.type) || d.element(o.target) && Q(o.target, "input,select,textarea,[contenteditable=true],[contenteditable=true] *") || o.preventDefault();
|
|
1336
|
-
} else
|
|
1337
|
-
o.preventDefault();
|
|
1338
|
-
}(this, t, n);
|
|
1339
|
-
}, t.interactions.docEvents.push({ type: "dragstart", listener: function(n) {
|
|
1340
|
-
for (var r = 0, i = t.interactions.list; r < i.length; r++) {
|
|
1341
|
-
var o = i[r];
|
|
1342
|
-
if (o.element && (o.element === n.target || ne(o.element, n.target)))
|
|
1343
|
-
return void o.interactable.checkAndPreventDefault(n);
|
|
1344
|
-
}
|
|
1345
|
-
} });
|
|
1346
|
-
}, listeners: ["down", "move", "up", "cancel"].reduce(function(t, e) {
|
|
1347
|
-
return t["interactions:".concat(e)] = cr, t;
|
|
1348
|
-
}, {}) };
|
|
1349
|
-
function it(t, e) {
|
|
1350
|
-
if (e.phaselessTypes[t])
|
|
1351
|
-
return !0;
|
|
1352
|
-
for (var n in e.map)
|
|
1353
|
-
if (t.indexOf(n) === 0 && t.substr(n.length) in e.phases)
|
|
1354
|
-
return !0;
|
|
1355
|
-
return !1;
|
|
1356
|
-
}
|
|
1357
|
-
function De(t) {
|
|
1358
|
-
var e = {};
|
|
1359
|
-
for (var n in t) {
|
|
1360
|
-
var r = t[n];
|
|
1361
|
-
d.plainObject(r) ? e[n] = De(r) : d.array(r) ? e[n] = Zt(r) : e[n] = r;
|
|
1362
|
-
}
|
|
1363
|
-
return e;
|
|
1364
|
-
}
|
|
1365
|
-
var Mt = function() {
|
|
1366
|
-
function t(e) {
|
|
1367
|
-
R(this, t), this.states = [], this.startOffset = { left: 0, right: 0, top: 0, bottom: 0 }, this.startDelta = void 0, this.result = void 0, this.endResult = void 0, this.startEdges = void 0, this.edges = void 0, this.interaction = void 0, this.interaction = e, this.result = ot(), this.edges = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
1368
|
-
}
|
|
1369
|
-
return k(t, [{ key: "start", value: function(e, n) {
|
|
1370
|
-
var r, i, o = e.phase, a = this.interaction, s = function(u) {
|
|
1371
|
-
var l = u.interactable.options[u.prepared.name], p = l.modifiers;
|
|
1372
|
-
return p && p.length ? p : ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map(function(f) {
|
|
1373
|
-
var h = l[f];
|
|
1374
|
-
return h && h.enabled && { options: h, methods: h._methods };
|
|
1375
|
-
}).filter(function(f) {
|
|
1376
|
-
return !!f;
|
|
1377
|
-
});
|
|
1378
|
-
}(a);
|
|
1379
|
-
this.prepareStates(s), this.startEdges = y({}, a.edges), this.edges = y({}, this.startEdges), this.startOffset = (r = a.rect, i = n, r ? { left: i.x - r.left, top: i.y - r.top, right: r.right - i.x, bottom: r.bottom - i.y } : { left: 0, top: 0, right: 0, bottom: 0 }), this.startDelta = { x: 0, y: 0 };
|
|
1380
|
-
var c = this.fillArg({ phase: o, pageCoords: n, preEnd: !1 });
|
|
1381
|
-
return this.result = ot(), this.startAll(c), this.result = this.setAll(c);
|
|
1382
|
-
} }, { key: "fillArg", value: function(e) {
|
|
1383
|
-
var n = this.interaction;
|
|
1384
|
-
return e.interaction = n, e.interactable = n.interactable, e.element = n.element, e.rect || (e.rect = n.rect), e.edges || (e.edges = this.startEdges), e.startOffset = this.startOffset, e;
|
|
1385
|
-
} }, { key: "startAll", value: function(e) {
|
|
1386
|
-
for (var n = 0, r = this.states; n < r.length; n++) {
|
|
1387
|
-
var i = r[n];
|
|
1388
|
-
i.methods.start && (e.state = i, i.methods.start(e));
|
|
1389
|
-
}
|
|
1390
|
-
} }, { key: "setAll", value: function(e) {
|
|
1391
|
-
var n = e.phase, r = e.preEnd, i = e.skipModifiers, o = e.rect, a = e.edges;
|
|
1392
|
-
e.coords = y({}, e.pageCoords), e.rect = y({}, o), e.edges = y({}, a);
|
|
1393
|
-
for (var s = i ? this.states.slice(i) : this.states, c = ot(e.coords, e.rect), u = 0; u < s.length; u++) {
|
|
1394
|
-
var l, p = s[u], f = p.options, h = y({}, e.coords), v = null;
|
|
1395
|
-
(l = p.methods) != null && l.set && this.shouldDo(f, r, n) && (e.state = p, v = p.methods.set(e), Qe(e.edges, e.rect, { x: e.coords.x - h.x, y: e.coords.y - h.y })), c.eventProps.push(v);
|
|
1396
|
-
}
|
|
1397
|
-
y(this.edges, e.edges), c.delta.x = e.coords.x - e.pageCoords.x, c.delta.y = e.coords.y - e.pageCoords.y, c.rectDelta.left = e.rect.left - o.left, c.rectDelta.right = e.rect.right - o.right, c.rectDelta.top = e.rect.top - o.top, c.rectDelta.bottom = e.rect.bottom - o.bottom;
|
|
1398
|
-
var g = this.result.coords, b = this.result.rect;
|
|
1399
|
-
if (g && b) {
|
|
1400
|
-
var m = c.rect.left !== b.left || c.rect.right !== b.right || c.rect.top !== b.top || c.rect.bottom !== b.bottom;
|
|
1401
|
-
c.changed = m || g.x !== c.coords.x || g.y !== c.coords.y;
|
|
1402
|
-
}
|
|
1403
|
-
return c;
|
|
1404
|
-
} }, { key: "applyToInteraction", value: function(e) {
|
|
1405
|
-
var n = this.interaction, r = e.phase, i = n.coords.cur, o = n.coords.start, a = this.result, s = this.startDelta, c = a.delta;
|
|
1406
|
-
r === "start" && y(this.startDelta, a.delta);
|
|
1407
|
-
for (var u = 0, l = [[o, s], [i, c]]; u < l.length; u++) {
|
|
1408
|
-
var p = l[u], f = p[0], h = p[1];
|
|
1409
|
-
f.page.x += h.x, f.page.y += h.y, f.client.x += h.x, f.client.y += h.y;
|
|
1410
|
-
}
|
|
1411
|
-
var v = this.result.rectDelta, g = e.rect || n.rect;
|
|
1412
|
-
g.left += v.left, g.right += v.right, g.top += v.top, g.bottom += v.bottom, g.width = g.right - g.left, g.height = g.bottom - g.top;
|
|
1413
|
-
} }, { key: "setAndApply", value: function(e) {
|
|
1414
|
-
var n = this.interaction, r = e.phase, i = e.preEnd, o = e.skipModifiers, a = this.setAll(this.fillArg({ preEnd: i, phase: r, pageCoords: e.modifiedCoords || n.coords.cur.page }));
|
|
1415
|
-
if (this.result = a, !a.changed && (!o || o < this.states.length) && n.interacting())
|
|
1416
|
-
return !1;
|
|
1417
|
-
if (e.modifiedCoords) {
|
|
1418
|
-
var s = n.coords.cur.page, c = { x: e.modifiedCoords.x - s.x, y: e.modifiedCoords.y - s.y };
|
|
1419
|
-
a.coords.x += c.x, a.coords.y += c.y, a.delta.x += c.x, a.delta.y += c.y;
|
|
1420
|
-
}
|
|
1421
|
-
this.applyToInteraction(e);
|
|
1422
|
-
} }, { key: "beforeEnd", value: function(e) {
|
|
1423
|
-
var n = e.interaction, r = e.event, i = this.states;
|
|
1424
|
-
if (i && i.length) {
|
|
1425
|
-
for (var o = !1, a = 0; a < i.length; a++) {
|
|
1426
|
-
var s = i[a];
|
|
1427
|
-
e.state = s;
|
|
1428
|
-
var c = s.options, u = s.methods, l = u.beforeEnd && u.beforeEnd(e);
|
|
1429
|
-
if (l)
|
|
1430
|
-
return this.endResult = l, !1;
|
|
1431
|
-
o = o || !o && this.shouldDo(c, !0, e.phase, !0);
|
|
1432
|
-
}
|
|
1433
|
-
o && n.move({ event: r, preEnd: !0 });
|
|
1434
|
-
}
|
|
1435
|
-
} }, { key: "stop", value: function(e) {
|
|
1436
|
-
var n = e.interaction;
|
|
1437
|
-
if (this.states && this.states.length) {
|
|
1438
|
-
var r = y({ states: this.states, interactable: n.interactable, element: n.element, rect: null }, e);
|
|
1439
|
-
this.fillArg(r);
|
|
1440
|
-
for (var i = 0, o = this.states; i < o.length; i++) {
|
|
1441
|
-
var a = o[i];
|
|
1442
|
-
r.state = a, a.methods.stop && a.methods.stop(r);
|
|
1443
|
-
}
|
|
1444
|
-
this.states = null, this.endResult = null;
|
|
1445
|
-
}
|
|
1446
|
-
} }, { key: "prepareStates", value: function(e) {
|
|
1447
|
-
this.states = [];
|
|
1448
|
-
for (var n = 0; n < e.length; n++) {
|
|
1449
|
-
var r = e[n], i = r.options, o = r.methods, a = r.name;
|
|
1450
|
-
this.states.push({ options: i, methods: o, index: n, name: a });
|
|
1451
|
-
}
|
|
1452
|
-
return this.states;
|
|
1453
|
-
} }, { key: "restoreInteractionCoords", value: function(e) {
|
|
1454
|
-
var n = e.interaction, r = n.coords, i = n.rect, o = n.modification;
|
|
1455
|
-
if (o.result) {
|
|
1456
|
-
for (var a = o.startDelta, s = o.result, c = s.delta, u = s.rectDelta, l = 0, p = [[r.start, a], [r.cur, c]]; l < p.length; l++) {
|
|
1457
|
-
var f = p[l], h = f[0], v = f[1];
|
|
1458
|
-
h.page.x -= v.x, h.page.y -= v.y, h.client.x -= v.x, h.client.y -= v.y;
|
|
1459
|
-
}
|
|
1460
|
-
i.left -= u.left, i.right -= u.right, i.top -= u.top, i.bottom -= u.bottom;
|
|
1461
|
-
}
|
|
1462
|
-
} }, { key: "shouldDo", value: function(e, n, r, i) {
|
|
1463
|
-
return !(!e || e.enabled === !1 || i && !e.endOnly || e.endOnly && !n || r === "start" && !e.setStart);
|
|
1464
|
-
} }, { key: "copyFrom", value: function(e) {
|
|
1465
|
-
this.startOffset = e.startOffset, this.startDelta = e.startDelta, this.startEdges = e.startEdges, this.edges = e.edges, this.states = e.states.map(function(n) {
|
|
1466
|
-
return De(n);
|
|
1467
|
-
}), this.result = ot(y({}, e.result.coords), y({}, e.result.rect));
|
|
1468
|
-
} }, { key: "destroy", value: function() {
|
|
1469
|
-
for (var e in this)
|
|
1470
|
-
this[e] = null;
|
|
1471
|
-
} }]), t;
|
|
1472
|
-
}();
|
|
1473
|
-
function ot(t, e) {
|
|
1474
|
-
return { rect: e, coords: t, delta: { x: 0, y: 0 }, rectDelta: { left: 0, right: 0, top: 0, bottom: 0 }, eventProps: [], changed: !0 };
|
|
1475
|
-
}
|
|
1476
|
-
function de(t, e) {
|
|
1477
|
-
var n = t.defaults, r = { start: t.start, set: t.set, beforeEnd: t.beforeEnd, stop: t.stop }, i = function(o) {
|
|
1478
|
-
var a = o || {};
|
|
1479
|
-
for (var s in a.enabled = a.enabled !== !1, n)
|
|
1480
|
-
s in a || (a[s] = n[s]);
|
|
1481
|
-
var c = { options: a, methods: r, name: e, enable: function() {
|
|
1482
|
-
return a.enabled = !0, c;
|
|
1483
|
-
}, disable: function() {
|
|
1484
|
-
return a.enabled = !1, c;
|
|
1485
|
-
} };
|
|
1486
|
-
return c;
|
|
1487
|
-
};
|
|
1488
|
-
return e && typeof e == "string" && (i._defaults = n, i._methods = r), i;
|
|
1489
|
-
}
|
|
1490
|
-
function Xe(t) {
|
|
1491
|
-
var e = t.iEvent, n = t.interaction.modification.result;
|
|
1492
|
-
n && (e.modifiers = n.eventProps);
|
|
1493
|
-
}
|
|
1494
|
-
var lr = { id: "modifiers/base", before: ["actions"], install: function(t) {
|
|
1495
|
-
t.defaults.perAction.modifiers = [];
|
|
1496
|
-
}, listeners: { "interactions:new": function(t) {
|
|
1497
|
-
var e = t.interaction;
|
|
1498
|
-
e.modification = new Mt(e);
|
|
1499
|
-
}, "interactions:before-action-start": function(t) {
|
|
1500
|
-
var e = t.interaction, n = t.interaction.modification;
|
|
1501
|
-
n.start(t, e.coords.start.page), e.edges = n.edges, n.applyToInteraction(t);
|
|
1502
|
-
}, "interactions:before-action-move": function(t) {
|
|
1503
|
-
var e = t.interaction, n = e.modification, r = n.setAndApply(t);
|
|
1504
|
-
return e.edges = n.edges, r;
|
|
1505
|
-
}, "interactions:before-action-end": function(t) {
|
|
1506
|
-
var e = t.interaction, n = e.modification, r = n.beforeEnd(t);
|
|
1507
|
-
return e.edges = n.startEdges, r;
|
|
1508
|
-
}, "interactions:action-start": Xe, "interactions:action-move": Xe, "interactions:action-end": Xe, "interactions:after-action-start": function(t) {
|
|
1509
|
-
return t.interaction.modification.restoreInteractionCoords(t);
|
|
1510
|
-
}, "interactions:after-action-move": function(t) {
|
|
1511
|
-
return t.interaction.modification.restoreInteractionCoords(t);
|
|
1512
|
-
}, "interactions:stop": function(t) {
|
|
1513
|
-
return t.interaction.modification.stop(t);
|
|
1514
|
-
} } }, hn = lr, gn = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} }, At = function(t) {
|
|
1515
|
-
ue(n, t);
|
|
1516
|
-
var e = ee(n);
|
|
1517
|
-
function n(r, i, o, a, s, c, u) {
|
|
1518
|
-
var l;
|
|
1519
|
-
R(this, n), (l = e.call(this, r)).relatedTarget = null, l.screenX = void 0, l.screenY = void 0, l.button = void 0, l.buttons = void 0, l.ctrlKey = void 0, l.shiftKey = void 0, l.altKey = void 0, l.metaKey = void 0, l.page = void 0, l.client = void 0, l.delta = void 0, l.rect = void 0, l.x0 = void 0, l.y0 = void 0, l.t0 = void 0, l.dt = void 0, l.duration = void 0, l.clientX0 = void 0, l.clientY0 = void 0, l.velocity = void 0, l.speed = void 0, l.swipe = void 0, l.axes = void 0, l.preEnd = void 0, s = s || r.element;
|
|
1520
|
-
var p = r.interactable, f = (p && p.options || gn).deltaSource, h = Fe(p, s, o), v = a === "start", g = a === "end", b = v ? me(l) : r.prevEvent, m = v ? r.coords.start : g ? { page: b.page, client: b.client, timeStamp: r.coords.cur.timeStamp } : r.coords.cur;
|
|
1521
|
-
return l.page = y({}, m.page), l.client = y({}, m.client), l.rect = y({}, r.rect), l.timeStamp = m.timeStamp, g || (l.page.x -= h.x, l.page.y -= h.y, l.client.x -= h.x, l.client.y -= h.y), l.ctrlKey = i.ctrlKey, l.altKey = i.altKey, l.shiftKey = i.shiftKey, l.metaKey = i.metaKey, l.button = i.button, l.buttons = i.buttons, l.target = s, l.currentTarget = s, l.preEnd = c, l.type = u || o + (a || ""), l.interactable = p, l.t0 = v ? r.pointers[r.pointers.length - 1].downTime : b.t0, l.x0 = r.coords.start.page.x - h.x, l.y0 = r.coords.start.page.y - h.y, l.clientX0 = r.coords.start.client.x - h.x, l.clientY0 = r.coords.start.client.y - h.y, l.delta = v || g ? { x: 0, y: 0 } : { x: l[f].x - b[f].x, y: l[f].y - b[f].y }, l.dt = r.coords.delta.timeStamp, l.duration = l.timeStamp - l.t0, l.velocity = y({}, r.coords.velocity[f]), l.speed = $e(l.velocity.x, l.velocity.y), l.swipe = g || a === "inertiastart" ? l.getSwipe() : null, l;
|
|
1522
|
-
}
|
|
1523
|
-
return k(n, [{ key: "getSwipe", value: function() {
|
|
1524
|
-
var r = this._interaction;
|
|
1525
|
-
if (r.prevEvent.speed < 600 || this.timeStamp - r.prevEvent.timeStamp > 150)
|
|
1526
|
-
return null;
|
|
1527
|
-
var i = 180 * Math.atan2(r.prevEvent.velocityY, r.prevEvent.velocityX) / Math.PI;
|
|
1528
|
-
i < 0 && (i += 360);
|
|
1529
|
-
var o = 112.5 <= i && i < 247.5, a = 202.5 <= i && i < 337.5;
|
|
1530
|
-
return { up: a, down: !a && 22.5 <= i && i < 157.5, left: o, right: !o && (292.5 <= i || i < 67.5), angle: i, speed: r.prevEvent.speed, velocity: { x: r.prevEvent.velocityX, y: r.prevEvent.velocityY } };
|
|
1531
|
-
} }, { key: "preventDefault", value: function() {
|
|
1532
|
-
} }, { key: "stopImmediatePropagation", value: function() {
|
|
1533
|
-
this.immediatePropagationStopped = this.propagationStopped = !0;
|
|
1534
|
-
} }, { key: "stopPropagation", value: function() {
|
|
1535
|
-
this.propagationStopped = !0;
|
|
1536
|
-
} }]), n;
|
|
1537
|
-
}(nt);
|
|
1538
|
-
Object.defineProperties(At.prototype, { pageX: { get: function() {
|
|
1539
|
-
return this.page.x;
|
|
1540
|
-
}, set: function(t) {
|
|
1541
|
-
this.page.x = t;
|
|
1542
|
-
} }, pageY: { get: function() {
|
|
1543
|
-
return this.page.y;
|
|
1544
|
-
}, set: function(t) {
|
|
1545
|
-
this.page.y = t;
|
|
1546
|
-
} }, clientX: { get: function() {
|
|
1547
|
-
return this.client.x;
|
|
1548
|
-
}, set: function(t) {
|
|
1549
|
-
this.client.x = t;
|
|
1550
|
-
} }, clientY: { get: function() {
|
|
1551
|
-
return this.client.y;
|
|
1552
|
-
}, set: function(t) {
|
|
1553
|
-
this.client.y = t;
|
|
1554
|
-
} }, dx: { get: function() {
|
|
1555
|
-
return this.delta.x;
|
|
1556
|
-
}, set: function(t) {
|
|
1557
|
-
this.delta.x = t;
|
|
1558
|
-
} }, dy: { get: function() {
|
|
1559
|
-
return this.delta.y;
|
|
1560
|
-
}, set: function(t) {
|
|
1561
|
-
this.delta.y = t;
|
|
1562
|
-
} }, velocityX: { get: function() {
|
|
1563
|
-
return this.velocity.x;
|
|
1564
|
-
}, set: function(t) {
|
|
1565
|
-
this.velocity.x = t;
|
|
1566
|
-
} }, velocityY: { get: function() {
|
|
1567
|
-
return this.velocity.y;
|
|
1568
|
-
}, set: function(t) {
|
|
1569
|
-
this.velocity.y = t;
|
|
1570
|
-
} } });
|
|
1571
|
-
var ur = k(function t(e, n, r, i, o) {
|
|
1572
|
-
R(this, t), this.id = void 0, this.pointer = void 0, this.event = void 0, this.downTime = void 0, this.downTarget = void 0, this.id = e, this.pointer = n, this.event = r, this.downTime = i, this.downTarget = o;
|
|
1573
|
-
}), pr = function(t) {
|
|
1574
|
-
return t.interactable = "", t.element = "", t.prepared = "", t.pointerIsDown = "", t.pointerWasMoved = "", t._proxy = "", t;
|
|
1575
|
-
}({}), mn = function(t) {
|
|
1576
|
-
return t.start = "", t.move = "", t.end = "", t.stop = "", t.interacting = "", t;
|
|
1577
|
-
}({}), fr = 0, dr = function() {
|
|
1578
|
-
function t(e) {
|
|
1579
|
-
var n = this, r = e.pointerType, i = e.scopeFire;
|
|
1580
|
-
R(this, t), this.interactable = null, this.element = null, this.rect = null, this._rects = void 0, this.edges = null, this._scopeFire = void 0, this.prepared = { name: null, axis: null, edges: null }, this.pointerType = void 0, this.pointers = [], this.downEvent = null, this.downPointer = {}, this._latestPointer = { pointer: null, event: null, eventTarget: null }, this.prevEvent = null, this.pointerIsDown = !1, this.pointerWasMoved = !1, this._interacting = !1, this._ending = !1, this._stopped = !0, this._proxy = void 0, this.simulation = null, this.doMove = Le(function(l) {
|
|
1581
|
-
this.move(l);
|
|
1582
|
-
}, "The interaction.doMove() method has been renamed to interaction.move()"), this.coords = { start: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, prev: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, cur: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, delta: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, velocity: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 } }, this._id = fr++, this._scopeFire = i, this.pointerType = r;
|
|
1583
|
-
var o = this;
|
|
1584
|
-
this._proxy = {};
|
|
1585
|
-
var a = function(l) {
|
|
1586
|
-
Object.defineProperty(n._proxy, l, { get: function() {
|
|
1587
|
-
return o[l];
|
|
1588
|
-
} });
|
|
1589
|
-
};
|
|
1590
|
-
for (var s in pr)
|
|
1591
|
-
a(s);
|
|
1592
|
-
var c = function(l) {
|
|
1593
|
-
Object.defineProperty(n._proxy, l, { value: function() {
|
|
1594
|
-
return o[l].apply(o, arguments);
|
|
1595
|
-
} });
|
|
1596
|
-
};
|
|
1597
|
-
for (var u in mn)
|
|
1598
|
-
c(u);
|
|
1599
|
-
this._scopeFire("interactions:new", { interaction: this });
|
|
1600
|
-
}
|
|
1601
|
-
return k(t, [{ key: "pointerMoveTolerance", get: function() {
|
|
1602
|
-
return 1;
|
|
1603
|
-
} }, { key: "pointerDown", value: function(e, n, r) {
|
|
1604
|
-
var i = this.updatePointer(e, n, r, !0), o = this.pointers[i];
|
|
1605
|
-
this._scopeFire("interactions:down", { pointer: e, event: n, eventTarget: r, pointerIndex: i, pointerInfo: o, type: "down", interaction: this });
|
|
1606
|
-
} }, { key: "start", value: function(e, n, r) {
|
|
1607
|
-
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (kt(this.prepared, e), this.interactable = n, this.element = r, this.rect = n.getRect(r), this.edges = this.prepared.edges ? y({}, this.prepared.edges) : { left: !0, right: !0, top: !0, bottom: !0 }, this._stopped = !1, this._interacting = this._doPhase({ interaction: this, event: this.downEvent, phase: "start" }) && !this._stopped, this._interacting);
|
|
1608
|
-
} }, { key: "pointerMove", value: function(e, n, r) {
|
|
1609
|
-
this.simulation || this.modification && this.modification.endResult || this.updatePointer(e, n, r, !1);
|
|
1610
|
-
var i, o, a = this.coords.cur.page.x === this.coords.prev.page.x && this.coords.cur.page.y === this.coords.prev.page.y && this.coords.cur.client.x === this.coords.prev.client.x && this.coords.cur.client.y === this.coords.prev.client.y;
|
|
1611
|
-
this.pointerIsDown && !this.pointerWasMoved && (i = this.coords.cur.client.x - this.coords.start.client.x, o = this.coords.cur.client.y - this.coords.start.client.y, this.pointerWasMoved = $e(i, o) > this.pointerMoveTolerance);
|
|
1612
|
-
var s, c, u, l = this.getPointerIndex(e), p = { pointer: e, pointerIndex: l, pointerInfo: this.pointers[l], event: n, type: "move", eventTarget: r, dx: i, dy: o, duplicate: a, interaction: this };
|
|
1613
|
-
a || (s = this.coords.velocity, c = this.coords.delta, u = Math.max(c.timeStamp / 1e3, 1e-3), s.page.x = c.page.x / u, s.page.y = c.page.y / u, s.client.x = c.client.x / u, s.client.y = c.client.y / u, s.timeStamp = u), this._scopeFire("interactions:move", p), a || this.simulation || (this.interacting() && (p.type = null, this.move(p)), this.pointerWasMoved && et(this.coords.prev, this.coords.cur));
|
|
1614
|
-
} }, { key: "move", value: function(e) {
|
|
1615
|
-
e && e.event || qt(this.coords.delta), (e = y({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, e || {})).phase = "move", this._doPhase(e);
|
|
1616
|
-
} }, { key: "pointerUp", value: function(e, n, r, i) {
|
|
1617
|
-
var o = this.getPointerIndex(e);
|
|
1618
|
-
o === -1 && (o = this.updatePointer(e, n, r, !1));
|
|
1619
|
-
var a = /cancel$/i.test(n.type) ? "cancel" : "up";
|
|
1620
|
-
this._scopeFire("interactions:".concat(a), { pointer: e, pointerIndex: o, pointerInfo: this.pointers[o], event: n, eventTarget: r, type: a, curEventTarget: i, interaction: this }), this.simulation || this.end(n), this.removePointer(e, n);
|
|
1621
|
-
} }, { key: "documentBlur", value: function(e) {
|
|
1622
|
-
this.end(e), this._scopeFire("interactions:blur", { event: e, type: "blur", interaction: this });
|
|
1623
|
-
} }, { key: "end", value: function(e) {
|
|
1624
|
-
var n;
|
|
1625
|
-
this._ending = !0, e = e || this._latestPointer.event, this.interacting() && (n = this._doPhase({ event: e, interaction: this, phase: "end" })), this._ending = !1, n === !0 && this.stop();
|
|
1626
|
-
} }, { key: "currentAction", value: function() {
|
|
1627
|
-
return this._interacting ? this.prepared.name : null;
|
|
1628
|
-
} }, { key: "interacting", value: function() {
|
|
1629
|
-
return this._interacting;
|
|
1630
|
-
} }, { key: "stop", value: function() {
|
|
1631
|
-
this._scopeFire("interactions:stop", { interaction: this }), this.interactable = this.element = null, this._interacting = !1, this._stopped = !0, this.prepared.name = this.prevEvent = null;
|
|
1632
|
-
} }, { key: "getPointerIndex", value: function(e) {
|
|
1633
|
-
var n = Be(e);
|
|
1634
|
-
return this.pointerType === "mouse" || this.pointerType === "pen" ? this.pointers.length - 1 : Ne(this.pointers, function(r) {
|
|
1635
|
-
return r.id === n;
|
|
1636
|
-
});
|
|
1637
|
-
} }, { key: "getPointerInfo", value: function(e) {
|
|
1638
|
-
return this.pointers[this.getPointerIndex(e)];
|
|
1639
|
-
} }, { key: "updatePointer", value: function(e, n, r, i) {
|
|
1640
|
-
var o, a, s, c = Be(e), u = this.getPointerIndex(e), l = this.pointers[u];
|
|
1641
|
-
return i = i !== !1 && (i || /(down|start)$/i.test(n.type)), l ? l.pointer = e : (l = new ur(c, e, n, null, null), u = this.pointers.length, this.pointers.push(l)), Yn(this.coords.cur, this.pointers.map(function(p) {
|
|
1642
|
-
return p.pointer;
|
|
1643
|
-
}), this._now()), o = this.coords.delta, a = this.coords.prev, s = this.coords.cur, o.page.x = s.page.x - a.page.x, o.page.y = s.page.y - a.page.y, o.client.x = s.client.x - a.client.x, o.client.y = s.client.y - a.client.y, o.timeStamp = s.timeStamp - a.timeStamp, i && (this.pointerIsDown = !0, l.downTime = this.coords.cur.timeStamp, l.downTarget = r, Ze(this.downPointer, e), this.interacting() || (et(this.coords.start, this.coords.cur), et(this.coords.prev, this.coords.cur), this.downEvent = n, this.pointerWasMoved = !1)), this._updateLatestPointer(e, n, r), this._scopeFire("interactions:update-pointer", { pointer: e, event: n, eventTarget: r, down: i, pointerInfo: l, pointerIndex: u, interaction: this }), u;
|
|
1644
|
-
} }, { key: "removePointer", value: function(e, n) {
|
|
1645
|
-
var r = this.getPointerIndex(e);
|
|
1646
|
-
if (r !== -1) {
|
|
1647
|
-
var i = this.pointers[r];
|
|
1648
|
-
this._scopeFire("interactions:remove-pointer", { pointer: e, event: n, eventTarget: null, pointerIndex: r, pointerInfo: i, interaction: this }), this.pointers.splice(r, 1), this.pointerIsDown = !1;
|
|
1649
|
-
}
|
|
1650
|
-
} }, { key: "_updateLatestPointer", value: function(e, n, r) {
|
|
1651
|
-
this._latestPointer.pointer = e, this._latestPointer.event = n, this._latestPointer.eventTarget = r;
|
|
1652
|
-
} }, { key: "destroy", value: function() {
|
|
1653
|
-
this._latestPointer.pointer = null, this._latestPointer.event = null, this._latestPointer.eventTarget = null;
|
|
1654
|
-
} }, { key: "_createPreparedEvent", value: function(e, n, r, i) {
|
|
1655
|
-
return new At(this, e, this.prepared.name, n, this.element, r, i);
|
|
1656
|
-
} }, { key: "_fireEvent", value: function(e) {
|
|
1657
|
-
var n;
|
|
1658
|
-
(n = this.interactable) == null || n.fire(e), (!this.prevEvent || e.timeStamp >= this.prevEvent.timeStamp) && (this.prevEvent = e);
|
|
1659
|
-
} }, { key: "_doPhase", value: function(e) {
|
|
1660
|
-
var n = e.event, r = e.phase, i = e.preEnd, o = e.type, a = this.rect;
|
|
1661
|
-
if (a && r === "move" && (Qe(this.edges, a, this.coords.delta[this.interactable.options.deltaSource]), a.width = a.right - a.left, a.height = a.bottom - a.top), this._scopeFire("interactions:before-action-".concat(r), e) === !1)
|
|
1662
|
-
return !1;
|
|
1663
|
-
var s = e.iEvent = this._createPreparedEvent(n, r, i, o);
|
|
1664
|
-
return this._scopeFire("interactions:action-".concat(r), e), r === "start" && (this.prevEvent = s), this._fireEvent(s), this._scopeFire("interactions:after-action-".concat(r), e), !0;
|
|
1665
|
-
} }, { key: "_now", value: function() {
|
|
1666
|
-
return Date.now();
|
|
1667
|
-
} }]), t;
|
|
1668
|
-
}();
|
|
1669
|
-
function yn(t) {
|
|
1670
|
-
bn(t.interaction);
|
|
1671
|
-
}
|
|
1672
|
-
function bn(t) {
|
|
1673
|
-
if (!function(n) {
|
|
1674
|
-
return !(!n.offset.pending.x && !n.offset.pending.y);
|
|
1675
|
-
}(t))
|
|
1676
|
-
return !1;
|
|
1677
|
-
var e = t.offset.pending;
|
|
1678
|
-
return zt(t.coords.cur, e), zt(t.coords.delta, e), Qe(t.edges, t.rect, e), e.x = 0, e.y = 0, !0;
|
|
1679
|
-
}
|
|
1680
|
-
function vr(t) {
|
|
1681
|
-
var e = t.x, n = t.y;
|
|
1682
|
-
this.offset.pending.x += e, this.offset.pending.y += n, this.offset.total.x += e, this.offset.total.y += n;
|
|
1683
|
-
}
|
|
1684
|
-
function zt(t, e) {
|
|
1685
|
-
var n = t.page, r = t.client, i = e.x, o = e.y;
|
|
1686
|
-
n.x += i, n.y += o, r.x += i, r.y += o;
|
|
1687
|
-
}
|
|
1688
|
-
mn.offsetBy = "";
|
|
1689
|
-
var hr = { id: "offset", before: ["modifiers", "pointer-events", "actions", "inertia"], install: function(t) {
|
|
1690
|
-
t.Interaction.prototype.offsetBy = vr;
|
|
1691
|
-
}, listeners: { "interactions:new": function(t) {
|
|
1692
|
-
t.interaction.offset = { total: { x: 0, y: 0 }, pending: { x: 0, y: 0 } };
|
|
1693
|
-
}, "interactions:update-pointer": function(t) {
|
|
1694
|
-
return function(e) {
|
|
1695
|
-
e.pointerIsDown && (zt(e.coords.cur, e.offset.total), e.offset.pending.x = 0, e.offset.pending.y = 0);
|
|
1696
|
-
}(t.interaction);
|
|
1697
|
-
}, "interactions:before-action-start": yn, "interactions:before-action-move": yn, "interactions:before-action-end": function(t) {
|
|
1698
|
-
var e = t.interaction;
|
|
1699
|
-
if (bn(e))
|
|
1700
|
-
return e.move({ offset: !0 }), e.end(), !1;
|
|
1701
|
-
}, "interactions:stop": function(t) {
|
|
1702
|
-
var e = t.interaction;
|
|
1703
|
-
e.offset.total.x = 0, e.offset.total.y = 0, e.offset.pending.x = 0, e.offset.pending.y = 0;
|
|
1704
|
-
} } }, xn = hr, gr = function() {
|
|
1705
|
-
function t(e) {
|
|
1706
|
-
R(this, t), this.active = !1, this.isModified = !1, this.smoothEnd = !1, this.allowResume = !1, this.modification = void 0, this.modifierCount = 0, this.modifierArg = void 0, this.startCoords = void 0, this.t0 = 0, this.v0 = 0, this.te = 0, this.targetOffset = void 0, this.modifiedOffset = void 0, this.currentOffset = void 0, this.lambda_v0 = 0, this.one_ve_v0 = 0, this.timeout = void 0, this.interaction = void 0, this.interaction = e;
|
|
1707
|
-
}
|
|
1708
|
-
return k(t, [{ key: "start", value: function(e) {
|
|
1709
|
-
var n = this.interaction, r = at(n);
|
|
1710
|
-
if (!r || !r.enabled)
|
|
1711
|
-
return !1;
|
|
1712
|
-
var i = n.coords.velocity.client, o = $e(i.x, i.y), a = this.modification || (this.modification = new Mt(n));
|
|
1713
|
-
if (a.copyFrom(n.modification), this.t0 = n._now(), this.allowResume = r.allowResume, this.v0 = o, this.currentOffset = { x: 0, y: 0 }, this.startCoords = n.coords.cur.page, this.modifierArg = a.fillArg({ pageCoords: this.startCoords, preEnd: !0, phase: "inertiastart" }), this.t0 - n.coords.cur.timeStamp < 50 && o > r.minSpeed && o > r.endSpeed)
|
|
1714
|
-
this.startInertia();
|
|
1715
|
-
else {
|
|
1716
|
-
if (a.result = a.setAll(this.modifierArg), !a.result.changed)
|
|
1717
|
-
return !1;
|
|
1718
|
-
this.startSmoothEnd();
|
|
1719
|
-
}
|
|
1720
|
-
return n.modification.result.rect = null, n.offsetBy(this.targetOffset), n._doPhase({ interaction: n, event: e, phase: "inertiastart" }), n.offsetBy({ x: -this.targetOffset.x, y: -this.targetOffset.y }), n.modification.result.rect = null, this.active = !0, n.simulation = this, !0;
|
|
1721
|
-
} }, { key: "startInertia", value: function() {
|
|
1722
|
-
var e = this, n = this.interaction.coords.velocity.client, r = at(this.interaction), i = r.resistance, o = -Math.log(r.endSpeed / this.v0) / i;
|
|
1723
|
-
this.targetOffset = { x: (n.x - o) / i, y: (n.y - o) / i }, this.te = o, this.lambda_v0 = i / this.v0, this.one_ve_v0 = 1 - r.endSpeed / this.v0;
|
|
1724
|
-
var a = this.modification, s = this.modifierArg;
|
|
1725
|
-
s.pageCoords = { x: this.startCoords.x + this.targetOffset.x, y: this.startCoords.y + this.targetOffset.y }, a.result = a.setAll(s), a.result.changed && (this.isModified = !0, this.modifiedOffset = { x: this.targetOffset.x + a.result.delta.x, y: this.targetOffset.y + a.result.delta.y }), this.onNextFrame(function() {
|
|
1726
|
-
return e.inertiaTick();
|
|
1727
|
-
});
|
|
1728
|
-
} }, { key: "startSmoothEnd", value: function() {
|
|
1729
|
-
var e = this;
|
|
1730
|
-
this.smoothEnd = !0, this.isModified = !0, this.targetOffset = { x: this.modification.result.delta.x, y: this.modification.result.delta.y }, this.onNextFrame(function() {
|
|
1731
|
-
return e.smoothEndTick();
|
|
1732
|
-
});
|
|
1733
|
-
} }, { key: "onNextFrame", value: function(e) {
|
|
1734
|
-
var n = this;
|
|
1735
|
-
this.timeout = fe.request(function() {
|
|
1736
|
-
n.active && e();
|
|
1737
|
-
});
|
|
1738
|
-
} }, { key: "inertiaTick", value: function() {
|
|
1739
|
-
var e, n, r, i, o, a, s, c = this, u = this.interaction, l = at(u).resistance, p = (u._now() - this.t0) / 1e3;
|
|
1740
|
-
if (p < this.te) {
|
|
1741
|
-
var f, h = 1 - (Math.exp(-l * p) - this.lambda_v0) / this.one_ve_v0;
|
|
1742
|
-
this.isModified ? (e = 0, n = 0, r = this.targetOffset.x, i = this.targetOffset.y, o = this.modifiedOffset.x, a = this.modifiedOffset.y, f = { x: wn(s = h, e, r, o), y: wn(s, n, i, a) }) : f = { x: this.targetOffset.x * h, y: this.targetOffset.y * h };
|
|
1743
|
-
var v = { x: f.x - this.currentOffset.x, y: f.y - this.currentOffset.y };
|
|
1744
|
-
this.currentOffset.x += v.x, this.currentOffset.y += v.y, u.offsetBy(v), u.move(), this.onNextFrame(function() {
|
|
1745
|
-
return c.inertiaTick();
|
|
1746
|
-
});
|
|
1747
|
-
} else
|
|
1748
|
-
u.offsetBy({ x: this.modifiedOffset.x - this.currentOffset.x, y: this.modifiedOffset.y - this.currentOffset.y }), this.end();
|
|
1749
|
-
} }, { key: "smoothEndTick", value: function() {
|
|
1750
|
-
var e = this, n = this.interaction, r = n._now() - this.t0, i = at(n).smoothEndDuration;
|
|
1751
|
-
if (r < i) {
|
|
1752
|
-
var o = { x: En(r, 0, this.targetOffset.x, i), y: En(r, 0, this.targetOffset.y, i) }, a = { x: o.x - this.currentOffset.x, y: o.y - this.currentOffset.y };
|
|
1753
|
-
this.currentOffset.x += a.x, this.currentOffset.y += a.y, n.offsetBy(a), n.move({ skipModifiers: this.modifierCount }), this.onNextFrame(function() {
|
|
1754
|
-
return e.smoothEndTick();
|
|
1755
|
-
});
|
|
1756
|
-
} else
|
|
1757
|
-
n.offsetBy({ x: this.targetOffset.x - this.currentOffset.x, y: this.targetOffset.y - this.currentOffset.y }), this.end();
|
|
1758
|
-
} }, { key: "resume", value: function(e) {
|
|
1759
|
-
var n = e.pointer, r = e.event, i = e.eventTarget, o = this.interaction;
|
|
1760
|
-
o.offsetBy({ x: -this.currentOffset.x, y: -this.currentOffset.y }), o.updatePointer(n, r, i, !0), o._doPhase({ interaction: o, event: r, phase: "resume" }), et(o.coords.prev, o.coords.cur), this.stop();
|
|
1761
|
-
} }, { key: "end", value: function() {
|
|
1762
|
-
this.interaction.move(), this.interaction.end(), this.stop();
|
|
1763
|
-
} }, { key: "stop", value: function() {
|
|
1764
|
-
this.active = this.smoothEnd = !1, this.interaction.simulation = null, fe.cancel(this.timeout);
|
|
1765
|
-
} }]), t;
|
|
1766
|
-
}();
|
|
1767
|
-
function at(t) {
|
|
1768
|
-
var e = t.interactable, n = t.prepared;
|
|
1769
|
-
return e && e.options && n.name && e.options[n.name].inertia;
|
|
1770
|
-
}
|
|
1771
|
-
var mr = { id: "inertia", before: ["modifiers", "actions"], install: function(t) {
|
|
1772
|
-
var e = t.defaults;
|
|
1773
|
-
t.usePlugin(xn), t.usePlugin(hn), t.actions.phases.inertiastart = !0, t.actions.phases.resume = !0, e.perAction.inertia = { enabled: !1, resistance: 10, minSpeed: 100, endSpeed: 10, allowResume: !0, smoothEndDuration: 300 };
|
|
1774
|
-
}, listeners: { "interactions:new": function(t) {
|
|
1775
|
-
var e = t.interaction;
|
|
1776
|
-
e.inertia = new gr(e);
|
|
1777
|
-
}, "interactions:before-action-end": function(t) {
|
|
1778
|
-
var e = t.interaction, n = t.event;
|
|
1779
|
-
return (!e._interacting || e.simulation || !e.inertia.start(n)) && null;
|
|
1780
|
-
}, "interactions:down": function(t) {
|
|
1781
|
-
var e = t.interaction, n = t.eventTarget, r = e.inertia;
|
|
1782
|
-
if (r.active)
|
|
1783
|
-
for (var i = n; d.element(i); ) {
|
|
1784
|
-
if (i === e.element) {
|
|
1785
|
-
r.resume(t);
|
|
1786
|
-
break;
|
|
1787
|
-
}
|
|
1788
|
-
i = K(i);
|
|
1789
|
-
}
|
|
1790
|
-
}, "interactions:stop": function(t) {
|
|
1791
|
-
var e = t.interaction.inertia;
|
|
1792
|
-
e.active && e.stop();
|
|
1793
|
-
}, "interactions:before-action-resume": function(t) {
|
|
1794
|
-
var e = t.interaction.modification;
|
|
1795
|
-
e.stop(t), e.start(t, t.interaction.coords.cur.page), e.applyToInteraction(t);
|
|
1796
|
-
}, "interactions:before-action-inertiastart": function(t) {
|
|
1797
|
-
return t.interaction.modification.setAndApply(t);
|
|
1798
|
-
}, "interactions:action-resume": Xe, "interactions:action-inertiastart": Xe, "interactions:after-action-inertiastart": function(t) {
|
|
1799
|
-
return t.interaction.modification.restoreInteractionCoords(t);
|
|
1800
|
-
}, "interactions:after-action-resume": function(t) {
|
|
1801
|
-
return t.interaction.modification.restoreInteractionCoords(t);
|
|
1802
|
-
} } };
|
|
1803
|
-
function wn(t, e, n, r) {
|
|
1804
|
-
var i = 1 - t;
|
|
1805
|
-
return i * i * e + 2 * i * t * n + t * t * r;
|
|
1806
|
-
}
|
|
1807
|
-
function En(t, e, n, r) {
|
|
1808
|
-
return -n * (t /= r) * (t - 2) + e;
|
|
1809
|
-
}
|
|
1810
|
-
var yr = mr;
|
|
1811
|
-
function Sn(t, e) {
|
|
1812
|
-
for (var n = 0; n < e.length; n++) {
|
|
1813
|
-
var r = e[n];
|
|
1814
|
-
if (t.immediatePropagationStopped)
|
|
1815
|
-
break;
|
|
1816
|
-
r(t);
|
|
1817
|
-
}
|
|
1818
|
-
}
|
|
1819
|
-
var Tn = function() {
|
|
1820
|
-
function t(e) {
|
|
1821
|
-
R(this, t), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = y({}, e || {});
|
|
1822
|
-
}
|
|
1823
|
-
return k(t, [{ key: "fire", value: function(e) {
|
|
1824
|
-
var n, r = this.global;
|
|
1825
|
-
(n = this.types[e.type]) && Sn(e, n), !e.propagationStopped && r && (n = r[e.type]) && Sn(e, n);
|
|
1826
|
-
} }, { key: "on", value: function(e, n) {
|
|
1827
|
-
var r = we(e, n);
|
|
1828
|
-
for (e in r)
|
|
1829
|
-
this.types[e] = Qt(this.types[e] || [], r[e]);
|
|
1830
|
-
} }, { key: "off", value: function(e, n) {
|
|
1831
|
-
var r = we(e, n);
|
|
1832
|
-
for (e in r) {
|
|
1833
|
-
var i = this.types[e];
|
|
1834
|
-
if (i && i.length)
|
|
1835
|
-
for (var o = 0, a = r[e]; o < a.length; o++) {
|
|
1836
|
-
var s = a[o], c = i.indexOf(s);
|
|
1837
|
-
c !== -1 && i.splice(c, 1);
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
} }, { key: "getRect", value: function(e) {
|
|
1841
|
-
return null;
|
|
1842
|
-
} }]), t;
|
|
1843
|
-
}(), br = function() {
|
|
1844
|
-
function t(e) {
|
|
1845
|
-
R(this, t), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e, Ze(this, e);
|
|
1846
|
-
}
|
|
1847
|
-
return k(t, [{ key: "preventOriginalDefault", value: function() {
|
|
1848
|
-
this.originalEvent.preventDefault();
|
|
1849
|
-
} }, { key: "stopPropagation", value: function() {
|
|
1850
|
-
this.originalEvent.stopPropagation();
|
|
1851
|
-
} }, { key: "stopImmediatePropagation", value: function() {
|
|
1852
|
-
this.originalEvent.stopImmediatePropagation();
|
|
1853
|
-
} }]), t;
|
|
1854
|
-
}();
|
|
1855
|
-
function Ye(t) {
|
|
1856
|
-
return d.object(t) ? { capture: !!t.capture, passive: !!t.passive } : { capture: !!t, passive: !1 };
|
|
1857
|
-
}
|
|
1858
|
-
function st(t, e) {
|
|
1859
|
-
return t === e || (typeof t == "boolean" ? !!e.capture === t && !e.passive : !!t.capture == !!e.capture && !!t.passive == !!e.passive);
|
|
1860
|
-
}
|
|
1861
|
-
var xr = { id: "events", install: function(t) {
|
|
1862
|
-
var e, n = [], r = {}, i = [], o = { add: a, remove: s, addDelegate: function(l, p, f, h, v) {
|
|
1863
|
-
var g = Ye(v);
|
|
1864
|
-
if (!r[f]) {
|
|
1865
|
-
r[f] = [];
|
|
1866
|
-
for (var b = 0; b < i.length; b++) {
|
|
1867
|
-
var m = i[b];
|
|
1868
|
-
a(m, f, c), a(m, f, u, !0);
|
|
1869
|
-
}
|
|
1870
|
-
}
|
|
1871
|
-
var w = r[f], T = Ve(w, function(P) {
|
|
1872
|
-
return P.selector === l && P.context === p;
|
|
1873
|
-
});
|
|
1874
|
-
T || (T = { selector: l, context: p, listeners: [] }, w.push(T)), T.listeners.push({ func: h, options: g });
|
|
1875
|
-
}, removeDelegate: function(l, p, f, h, v) {
|
|
1876
|
-
var g, b = Ye(v), m = r[f], w = !1;
|
|
1877
|
-
if (m)
|
|
1878
|
-
for (g = m.length - 1; g >= 0; g--) {
|
|
1879
|
-
var T = m[g];
|
|
1880
|
-
if (T.selector === l && T.context === p) {
|
|
1881
|
-
for (var P = T.listeners, E = P.length - 1; E >= 0; E--) {
|
|
1882
|
-
var _ = P[E];
|
|
1883
|
-
if (_.func === h && st(_.options, b)) {
|
|
1884
|
-
P.splice(E, 1), P.length || (m.splice(g, 1), s(p, f, c), s(p, f, u, !0)), w = !0;
|
|
1885
|
-
break;
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
if (w)
|
|
1889
|
-
break;
|
|
1890
|
-
}
|
|
1891
|
-
}
|
|
1892
|
-
}, delegateListener: c, delegateUseCapture: u, delegatedEvents: r, documents: i, targets: n, supportsOptions: !1, supportsPassive: !1 };
|
|
1893
|
-
function a(l, p, f, h) {
|
|
1894
|
-
if (l.addEventListener) {
|
|
1895
|
-
var v = Ye(h), g = Ve(n, function(b) {
|
|
1896
|
-
return b.eventTarget === l;
|
|
1897
|
-
});
|
|
1898
|
-
g || (g = { eventTarget: l, events: {} }, n.push(g)), g.events[p] || (g.events[p] = []), Ve(g.events[p], function(b) {
|
|
1899
|
-
return b.func === f && st(b.options, v);
|
|
1900
|
-
}) || (l.addEventListener(p, f, o.supportsOptions ? v : v.capture), g.events[p].push({ func: f, options: v }));
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
function s(l, p, f, h) {
|
|
1904
|
-
if (l.addEventListener && l.removeEventListener) {
|
|
1905
|
-
var v = Ne(n, function(L) {
|
|
1906
|
-
return L.eventTarget === l;
|
|
1907
|
-
}), g = n[v];
|
|
1908
|
-
if (g && g.events)
|
|
1909
|
-
if (p !== "all") {
|
|
1910
|
-
var b = !1, m = g.events[p];
|
|
1911
|
-
if (m) {
|
|
1912
|
-
if (f === "all") {
|
|
1913
|
-
for (var w = m.length - 1; w >= 0; w--) {
|
|
1914
|
-
var T = m[w];
|
|
1915
|
-
s(l, p, T.func, T.options);
|
|
1916
|
-
}
|
|
1917
|
-
return;
|
|
1918
|
-
}
|
|
1919
|
-
for (var P = Ye(h), E = 0; E < m.length; E++) {
|
|
1920
|
-
var _ = m[E];
|
|
1921
|
-
if (_.func === f && st(_.options, P)) {
|
|
1922
|
-
l.removeEventListener(p, f, o.supportsOptions ? P : P.capture), m.splice(E, 1), m.length === 0 && (delete g.events[p], b = !0);
|
|
1923
|
-
break;
|
|
1924
|
-
}
|
|
1925
|
-
}
|
|
1926
|
-
}
|
|
1927
|
-
b && !Object.keys(g.events).length && n.splice(v, 1);
|
|
1928
|
-
} else
|
|
1929
|
-
for (p in g.events)
|
|
1930
|
-
g.events.hasOwnProperty(p) && s(l, p, "all");
|
|
1931
|
-
}
|
|
1932
|
-
}
|
|
1933
|
-
function c(l, p) {
|
|
1934
|
-
for (var f = Ye(p), h = new br(l), v = r[l.type], g = Jt(l)[0], b = g; d.element(b); ) {
|
|
1935
|
-
for (var m = 0; m < v.length; m++) {
|
|
1936
|
-
var w = v[m], T = w.selector, P = w.context;
|
|
1937
|
-
if (Q(b, T) && ne(P, g) && ne(P, b)) {
|
|
1938
|
-
var E = w.listeners;
|
|
1939
|
-
h.currentTarget = b;
|
|
1940
|
-
for (var _ = 0; _ < E.length; _++) {
|
|
1941
|
-
var L = E[_];
|
|
1942
|
-
st(L.options, f) && L.func(h);
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
b = K(b);
|
|
1947
|
-
}
|
|
1948
|
-
}
|
|
1949
|
-
function u(l) {
|
|
1950
|
-
return c(l, !0);
|
|
1951
|
-
}
|
|
1952
|
-
return (e = t.document) == null || e.createElement("div").addEventListener("test", null, { get capture() {
|
|
1953
|
-
return o.supportsOptions = !0;
|
|
1954
|
-
}, get passive() {
|
|
1955
|
-
return o.supportsPassive = !0;
|
|
1956
|
-
} }), t.events = o, o;
|
|
1957
|
-
} }, Ct = { methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"], search: function(t) {
|
|
1958
|
-
for (var e = 0, n = Ct.methodOrder; e < n.length; e++) {
|
|
1959
|
-
var r = n[e], i = Ct[r](t);
|
|
1960
|
-
if (i)
|
|
1961
|
-
return i;
|
|
1962
|
-
}
|
|
1963
|
-
return null;
|
|
1964
|
-
}, simulationResume: function(t) {
|
|
1965
|
-
var e = t.pointerType, n = t.eventType, r = t.eventTarget, i = t.scope;
|
|
1966
|
-
if (!/down|start/i.test(n))
|
|
1967
|
-
return null;
|
|
1968
|
-
for (var o = 0, a = i.interactions.list; o < a.length; o++) {
|
|
1969
|
-
var s = a[o], c = r;
|
|
1970
|
-
if (s.simulation && s.simulation.allowResume && s.pointerType === e)
|
|
1971
|
-
for (; c; ) {
|
|
1972
|
-
if (c === s.element)
|
|
1973
|
-
return s;
|
|
1974
|
-
c = K(c);
|
|
1975
|
-
}
|
|
1976
|
-
}
|
|
1977
|
-
return null;
|
|
1978
|
-
}, mouseOrPen: function(t) {
|
|
1979
|
-
var e, n = t.pointerId, r = t.pointerType, i = t.eventType, o = t.scope;
|
|
1980
|
-
if (r !== "mouse" && r !== "pen")
|
|
1981
|
-
return null;
|
|
1982
|
-
for (var a = 0, s = o.interactions.list; a < s.length; a++) {
|
|
1983
|
-
var c = s[a];
|
|
1984
|
-
if (c.pointerType === r) {
|
|
1985
|
-
if (c.simulation && !_n(c, n))
|
|
1986
|
-
continue;
|
|
1987
|
-
if (c.interacting())
|
|
1988
|
-
return c;
|
|
1989
|
-
e || (e = c);
|
|
1990
|
-
}
|
|
1991
|
-
}
|
|
1992
|
-
if (e)
|
|
1993
|
-
return e;
|
|
1994
|
-
for (var u = 0, l = o.interactions.list; u < l.length; u++) {
|
|
1995
|
-
var p = l[u];
|
|
1996
|
-
if (!(p.pointerType !== r || /down/i.test(i) && p.simulation))
|
|
1997
|
-
return p;
|
|
1998
|
-
}
|
|
1999
|
-
return null;
|
|
2000
|
-
}, hasPointer: function(t) {
|
|
2001
|
-
for (var e = t.pointerId, n = 0, r = t.scope.interactions.list; n < r.length; n++) {
|
|
2002
|
-
var i = r[n];
|
|
2003
|
-
if (_n(i, e))
|
|
2004
|
-
return i;
|
|
2005
|
-
}
|
|
2006
|
-
return null;
|
|
2007
|
-
}, idle: function(t) {
|
|
2008
|
-
for (var e = t.pointerType, n = 0, r = t.scope.interactions.list; n < r.length; n++) {
|
|
2009
|
-
var i = r[n];
|
|
2010
|
-
if (i.pointers.length === 1) {
|
|
2011
|
-
var o = i.interactable;
|
|
2012
|
-
if (o && (!o.options.gesture || !o.options.gesture.enabled))
|
|
2013
|
-
continue;
|
|
2014
|
-
} else if (i.pointers.length >= 2)
|
|
2015
|
-
continue;
|
|
2016
|
-
if (!i.interacting() && e === i.pointerType)
|
|
2017
|
-
return i;
|
|
2018
|
-
}
|
|
2019
|
-
return null;
|
|
2020
|
-
} };
|
|
2021
|
-
function _n(t, e) {
|
|
2022
|
-
return t.pointers.some(function(n) {
|
|
2023
|
-
return n.id === e;
|
|
2024
|
-
});
|
|
2025
|
-
}
|
|
2026
|
-
var wr = Ct, Rt = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer", "windowBlur"];
|
|
2027
|
-
function Pn(t, e) {
|
|
2028
|
-
return function(n) {
|
|
2029
|
-
var r = e.interactions.list, i = Ht(n), o = Jt(n), a = o[0], s = o[1], c = [];
|
|
2030
|
-
if (/^touch/.test(n.type)) {
|
|
2031
|
-
e.prevTouchTime = e.now();
|
|
2032
|
-
for (var u = 0, l = n.changedTouches; u < l.length; u++) {
|
|
2033
|
-
var p = l[u], f = { pointer: p, pointerId: Be(p), pointerType: i, eventType: n.type, eventTarget: a, curEventTarget: s, scope: e }, h = kn(f);
|
|
2034
|
-
c.push([f.pointer, f.eventTarget, f.curEventTarget, h]);
|
|
2035
|
-
}
|
|
2036
|
-
} else {
|
|
2037
|
-
var v = !1;
|
|
2038
|
-
if (!Y.supportsPointerEvent && /mouse/.test(n.type)) {
|
|
2039
|
-
for (var g = 0; g < r.length && !v; g++)
|
|
2040
|
-
v = r[g].pointerType !== "mouse" && r[g].pointerIsDown;
|
|
2041
|
-
v = v || e.now() - e.prevTouchTime < 500 || n.timeStamp === 0;
|
|
2042
|
-
}
|
|
2043
|
-
if (!v) {
|
|
2044
|
-
var b = { pointer: n, pointerId: Be(n), pointerType: i, eventType: n.type, curEventTarget: s, eventTarget: a, scope: e }, m = kn(b);
|
|
2045
|
-
c.push([b.pointer, b.eventTarget, b.curEventTarget, m]);
|
|
2046
|
-
}
|
|
2047
|
-
}
|
|
2048
|
-
for (var w = 0; w < c.length; w++) {
|
|
2049
|
-
var T = c[w], P = T[0], E = T[1], _ = T[2];
|
|
2050
|
-
T[3][t](P, n, E, _);
|
|
2051
|
-
}
|
|
2052
|
-
};
|
|
2053
|
-
}
|
|
2054
|
-
function kn(t) {
|
|
2055
|
-
var e = t.pointerType, n = t.scope, r = { interaction: wr.search(t), searchDetails: t };
|
|
2056
|
-
return n.fire("interactions:find", r), r.interaction || n.interactions.new({ pointerType: e });
|
|
2057
|
-
}
|
|
2058
|
-
function jt(t, e) {
|
|
2059
|
-
var n = t.doc, r = t.scope, i = t.options, o = r.interactions.docEvents, a = r.events, s = a[e];
|
|
2060
|
-
for (var c in r.browser.isIOS && !i.events && (i.events = { passive: !1 }), a.delegatedEvents)
|
|
2061
|
-
s(n, c, a.delegateListener), s(n, c, a.delegateUseCapture, !0);
|
|
2062
|
-
for (var u = i && i.events, l = 0; l < o.length; l++) {
|
|
2063
|
-
var p = o[l];
|
|
2064
|
-
s(n, p.type, p.listener, u);
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
|
-
var Er = { id: "core/interactions", install: function(t) {
|
|
2068
|
-
for (var e = {}, n = 0; n < Rt.length; n++) {
|
|
2069
|
-
var r = Rt[n];
|
|
2070
|
-
e[r] = Pn(r, t);
|
|
2071
|
-
}
|
|
2072
|
-
var i, o = Y.pEventTypes;
|
|
2073
|
-
function a() {
|
|
2074
|
-
for (var s = 0, c = t.interactions.list; s < c.length; s++) {
|
|
2075
|
-
var u = c[s];
|
|
2076
|
-
if (u.pointerIsDown && u.pointerType === "touch" && !u._interacting)
|
|
2077
|
-
for (var l = function() {
|
|
2078
|
-
var h = f[p];
|
|
2079
|
-
t.documents.some(function(v) {
|
|
2080
|
-
return ne(v.doc, h.downTarget);
|
|
2081
|
-
}) || u.removePointer(h.pointer, h.event);
|
|
2082
|
-
}, p = 0, f = u.pointers; p < f.length; p++)
|
|
2083
|
-
l();
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
(i = C.PointerEvent ? [{ type: o.down, listener: a }, { type: o.down, listener: e.pointerDown }, { type: o.move, listener: e.pointerMove }, { type: o.up, listener: e.pointerUp }, { type: o.cancel, listener: e.pointerUp }] : [{ type: "mousedown", listener: e.pointerDown }, { type: "mousemove", listener: e.pointerMove }, { type: "mouseup", listener: e.pointerUp }, { type: "touchstart", listener: a }, { type: "touchstart", listener: e.pointerDown }, { type: "touchmove", listener: e.pointerMove }, { type: "touchend", listener: e.pointerUp }, { type: "touchcancel", listener: e.pointerUp }]).push({ type: "blur", listener: function(s) {
|
|
2087
|
-
for (var c = 0, u = t.interactions.list; c < u.length; c++)
|
|
2088
|
-
u[c].documentBlur(s);
|
|
2089
|
-
} }), t.prevTouchTime = 0, t.Interaction = function(s) {
|
|
2090
|
-
ue(u, s);
|
|
2091
|
-
var c = ee(u);
|
|
2092
|
-
function u() {
|
|
2093
|
-
return R(this, u), c.apply(this, arguments);
|
|
2094
|
-
}
|
|
2095
|
-
return k(u, [{ key: "pointerMoveTolerance", get: function() {
|
|
2096
|
-
return t.interactions.pointerMoveTolerance;
|
|
2097
|
-
}, set: function(l) {
|
|
2098
|
-
t.interactions.pointerMoveTolerance = l;
|
|
2099
|
-
} }, { key: "_now", value: function() {
|
|
2100
|
-
return t.now();
|
|
2101
|
-
} }]), u;
|
|
2102
|
-
}(dr), t.interactions = { list: [], new: function(s) {
|
|
2103
|
-
s.scopeFire = function(u, l) {
|
|
2104
|
-
return t.fire(u, l);
|
|
2105
|
-
};
|
|
2106
|
-
var c = new t.Interaction(s);
|
|
2107
|
-
return t.interactions.list.push(c), c;
|
|
2108
|
-
}, listeners: e, docEvents: i, pointerMoveTolerance: 1 }, t.usePlugin(vn);
|
|
2109
|
-
}, listeners: { "scope:add-document": function(t) {
|
|
2110
|
-
return jt(t, "add");
|
|
2111
|
-
}, "scope:remove-document": function(t) {
|
|
2112
|
-
return jt(t, "remove");
|
|
2113
|
-
}, "interactable:unset": function(t, e) {
|
|
2114
|
-
for (var n = t.interactable, r = e.interactions.list.length - 1; r >= 0; r--) {
|
|
2115
|
-
var i = e.interactions.list[r];
|
|
2116
|
-
i.interactable === n && (i.stop(), e.fire("interactions:destroy", { interaction: i }), i.destroy(), e.interactions.list.length > 2 && e.interactions.list.splice(r, 1));
|
|
2117
|
-
}
|
|
2118
|
-
} }, onDocSignal: jt, doOnInteractions: Pn, methodNames: Rt }, Sr = Er, ve = function(t) {
|
|
2119
|
-
return t[t.On = 0] = "On", t[t.Off = 1] = "Off", t;
|
|
2120
|
-
}(ve || {}), Tr = function() {
|
|
2121
|
-
function t(e, n, r, i) {
|
|
2122
|
-
R(this, t), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new Tn(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = n.actions, this.target = e, this._context = n.context || r, this._win = B(D(e) ? this._context : e), this._doc = this._win.document, this._scopeEvents = i, this.set(n);
|
|
2123
|
-
}
|
|
2124
|
-
return k(t, [{ key: "_defaults", get: function() {
|
|
2125
|
-
return { base: {}, perAction: {}, actions: {} };
|
|
2126
|
-
} }, { key: "setOnEvents", value: function(e, n) {
|
|
2127
|
-
return d.func(n.onstart) && this.on("".concat(e, "start"), n.onstart), d.func(n.onmove) && this.on("".concat(e, "move"), n.onmove), d.func(n.onend) && this.on("".concat(e, "end"), n.onend), d.func(n.oninertiastart) && this.on("".concat(e, "inertiastart"), n.oninertiastart), this;
|
|
2128
|
-
} }, { key: "updatePerActionListeners", value: function(e, n, r) {
|
|
2129
|
-
var i, o = this, a = (i = this._actions.map[e]) == null ? void 0 : i.filterEventType, s = function(c) {
|
|
2130
|
-
return (a == null || a(c)) && it(c, o._actions);
|
|
2131
|
-
};
|
|
2132
|
-
(d.array(n) || d.object(n)) && this._onOff(ve.Off, e, n, void 0, s), (d.array(r) || d.object(r)) && this._onOff(ve.On, e, r, void 0, s);
|
|
2133
|
-
} }, { key: "setPerAction", value: function(e, n) {
|
|
2134
|
-
var r = this._defaults;
|
|
2135
|
-
for (var i in n) {
|
|
2136
|
-
var o = i, a = this.options[e], s = n[o];
|
|
2137
|
-
o === "listeners" && this.updatePerActionListeners(e, a.listeners, s), d.array(s) ? a[o] = Zt(s) : d.plainObject(s) ? (a[o] = y(a[o] || {}, De(s)), d.object(r.perAction[o]) && "enabled" in r.perAction[o] && (a[o].enabled = s.enabled !== !1)) : d.bool(s) && d.object(r.perAction[o]) ? a[o].enabled = s : a[o] = s;
|
|
2138
|
-
}
|
|
2139
|
-
} }, { key: "getRect", value: function(e) {
|
|
2140
|
-
return e = e || (d.element(this.target) ? this.target : null), d.string(this.target) && (e = e || this._context.querySelector(this.target)), Oe(e);
|
|
2141
|
-
} }, { key: "rectChecker", value: function(e) {
|
|
2142
|
-
var n = this;
|
|
2143
|
-
return d.func(e) ? (this.getRect = function(r) {
|
|
2144
|
-
var i = y({}, e.apply(n, r));
|
|
2145
|
-
return "width" in i || (i.width = i.right - i.left, i.height = i.bottom - i.top), i;
|
|
2146
|
-
}, this) : e === null ? (delete this.getRect, this) : this.getRect;
|
|
2147
|
-
} }, { key: "_backCompatOption", value: function(e, n) {
|
|
2148
|
-
if (D(n) || d.object(n)) {
|
|
2149
|
-
for (var r in this.options[e] = n, this._actions.map)
|
|
2150
|
-
this.options[r][e] = n;
|
|
2151
|
-
return this;
|
|
2152
|
-
}
|
|
2153
|
-
return this.options[e];
|
|
2154
|
-
} }, { key: "origin", value: function(e) {
|
|
2155
|
-
return this._backCompatOption("origin", e);
|
|
2156
|
-
} }, { key: "deltaSource", value: function(e) {
|
|
2157
|
-
return e === "page" || e === "client" ? (this.options.deltaSource = e, this) : this.options.deltaSource;
|
|
2158
|
-
} }, { key: "getAllElements", value: function() {
|
|
2159
|
-
var e = this.target;
|
|
2160
|
-
return d.string(e) ? Array.from(this._context.querySelectorAll(e)) : d.func(e) && e.getAllElements ? e.getAllElements() : d.element(e) ? [e] : [];
|
|
2161
|
-
} }, { key: "context", value: function() {
|
|
2162
|
-
return this._context;
|
|
2163
|
-
} }, { key: "inContext", value: function(e) {
|
|
2164
|
-
return this._context === e.ownerDocument || ne(this._context, e);
|
|
2165
|
-
} }, { key: "testIgnoreAllow", value: function(e, n, r) {
|
|
2166
|
-
return !this.testIgnore(e.ignoreFrom, n, r) && this.testAllow(e.allowFrom, n, r);
|
|
2167
|
-
} }, { key: "testAllow", value: function(e, n, r) {
|
|
2168
|
-
return !e || !!d.element(r) && (d.string(e) ? je(r, e, n) : !!d.element(e) && ne(e, r));
|
|
2169
|
-
} }, { key: "testIgnore", value: function(e, n, r) {
|
|
2170
|
-
return !(!e || !d.element(r)) && (d.string(e) ? je(r, e, n) : !!d.element(e) && ne(e, r));
|
|
2171
|
-
} }, { key: "fire", value: function(e) {
|
|
2172
|
-
return this.events.fire(e), this;
|
|
2173
|
-
} }, { key: "_onOff", value: function(e, n, r, i, o) {
|
|
2174
|
-
d.object(n) && !d.array(n) && (i = r, r = null);
|
|
2175
|
-
var a = we(n, r, o);
|
|
2176
|
-
for (var s in a) {
|
|
2177
|
-
s === "wheel" && (s = Y.wheelEvent);
|
|
2178
|
-
for (var c = 0, u = a[s]; c < u.length; c++) {
|
|
2179
|
-
var l = u[c];
|
|
2180
|
-
it(s, this._actions) ? this.events[e === ve.On ? "on" : "off"](s, l) : d.string(this.target) ? this._scopeEvents[e === ve.On ? "addDelegate" : "removeDelegate"](this.target, this._context, s, l, i) : this._scopeEvents[e === ve.On ? "add" : "remove"](this.target, s, l, i);
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
return this;
|
|
2184
|
-
} }, { key: "on", value: function(e, n, r) {
|
|
2185
|
-
return this._onOff(ve.On, e, n, r);
|
|
2186
|
-
} }, { key: "off", value: function(e, n, r) {
|
|
2187
|
-
return this._onOff(ve.Off, e, n, r);
|
|
2188
|
-
} }, { key: "set", value: function(e) {
|
|
2189
|
-
var n = this._defaults;
|
|
2190
|
-
for (var r in d.object(e) || (e = {}), this.options = De(n.base), this._actions.methodDict) {
|
|
2191
|
-
var i = r, o = this._actions.methodDict[i];
|
|
2192
|
-
this.options[i] = {}, this.setPerAction(i, y(y({}, n.perAction), n.actions[i])), this[o](e[i]);
|
|
2193
|
-
}
|
|
2194
|
-
for (var a in e)
|
|
2195
|
-
a !== "getRect" ? d.func(this[a]) && this[a](e[a]) : this.rectChecker(e.getRect);
|
|
2196
|
-
return this;
|
|
2197
|
-
} }, { key: "unset", value: function() {
|
|
2198
|
-
if (d.string(this.target))
|
|
2199
|
-
for (var e in this._scopeEvents.delegatedEvents)
|
|
2200
|
-
for (var n = this._scopeEvents.delegatedEvents[e], r = n.length - 1; r >= 0; r--) {
|
|
2201
|
-
var i = n[r], o = i.selector, a = i.context, s = i.listeners;
|
|
2202
|
-
o === this.target && a === this._context && n.splice(r, 1);
|
|
2203
|
-
for (var c = s.length - 1; c >= 0; c--)
|
|
2204
|
-
this._scopeEvents.removeDelegate(this.target, this._context, e, s[c][0], s[c][1]);
|
|
2205
|
-
}
|
|
2206
|
-
else
|
|
2207
|
-
this._scopeEvents.remove(this.target, "all");
|
|
2208
|
-
} }]), t;
|
|
2209
|
-
}(), _r = function() {
|
|
2210
|
-
function t(e) {
|
|
2211
|
-
var n = this;
|
|
2212
|
-
R(this, t), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = e, e.addListeners({ "interactable:unset": function(r) {
|
|
2213
|
-
var i = r.interactable, o = i.target, a = d.string(o) ? n.selectorMap[o] : o[n.scope.id], s = Ne(a, function(c) {
|
|
2214
|
-
return c === i;
|
|
2215
|
-
});
|
|
2216
|
-
a.splice(s, 1);
|
|
2217
|
-
} });
|
|
2218
|
-
}
|
|
2219
|
-
return k(t, [{ key: "new", value: function(e, n) {
|
|
2220
|
-
n = y(n || {}, { actions: this.scope.actions });
|
|
2221
|
-
var r = new this.scope.Interactable(e, n, this.scope.document, this.scope.events);
|
|
2222
|
-
return this.scope.addDocument(r._doc), this.list.push(r), d.string(e) ? (this.selectorMap[e] || (this.selectorMap[e] = []), this.selectorMap[e].push(r)) : (r.target[this.scope.id] || Object.defineProperty(e, this.scope.id, { value: [], configurable: !0 }), e[this.scope.id].push(r)), this.scope.fire("interactable:new", { target: e, options: n, interactable: r, win: this.scope._win }), r;
|
|
2223
|
-
} }, { key: "getExisting", value: function(e, n) {
|
|
2224
|
-
var r = n && n.context || this.scope.document, i = d.string(e), o = i ? this.selectorMap[e] : e[this.scope.id];
|
|
2225
|
-
if (o)
|
|
2226
|
-
return Ve(o, function(a) {
|
|
2227
|
-
return a._context === r && (i || a.inContext(e));
|
|
2228
|
-
});
|
|
2229
|
-
} }, { key: "forEachMatch", value: function(e, n) {
|
|
2230
|
-
for (var r = 0, i = this.list; r < i.length; r++) {
|
|
2231
|
-
var o = i[r], a = void 0;
|
|
2232
|
-
if ((d.string(o.target) ? d.element(e) && Q(e, o.target) : e === o.target) && o.inContext(e) && (a = n(o)), a !== void 0)
|
|
2233
|
-
return a;
|
|
2234
|
-
}
|
|
2235
|
-
} }]), t;
|
|
2236
|
-
}(), Pr = function() {
|
|
2237
|
-
function t() {
|
|
2238
|
-
var e = this;
|
|
2239
|
-
R(this, t), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = !1, this.listenerMaps = [], this.browser = Y, this.defaults = De(gn), this.Eventable = Tn, this.actions = { map: {}, phases: { start: !0, move: !0, end: !0 }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = function(r) {
|
|
2240
|
-
var i = function o(a, s) {
|
|
2241
|
-
var c = r.interactables.getExisting(a, s);
|
|
2242
|
-
return c || ((c = r.interactables.new(a, s)).events.global = o.globalEvents), c;
|
|
2243
|
-
};
|
|
2244
|
-
return i.getPointerAverage = Kt, i.getTouchBBox = bt, i.getTouchDistance = xt, i.getTouchAngle = wt, i.getElementRect = Oe, i.getElementClientRect = ye, i.matchesSelector = Q, i.closest = He, i.globalEvents = {}, i.version = "1.10.27", i.scope = r, i.use = function(o, a) {
|
|
2245
|
-
return this.scope.usePlugin(o, a), this;
|
|
2246
|
-
}, i.isSet = function(o, a) {
|
|
2247
|
-
return !!this.scope.interactables.get(o, a && a.context);
|
|
2248
|
-
}, i.on = Le(function(o, a, s) {
|
|
2249
|
-
if (d.string(o) && o.search(" ") !== -1 && (o = o.trim().split(/ +/)), d.array(o)) {
|
|
2250
|
-
for (var c = 0, u = o; c < u.length; c++) {
|
|
2251
|
-
var l = u[c];
|
|
2252
|
-
this.on(l, a, s);
|
|
2253
|
-
}
|
|
2254
|
-
return this;
|
|
2255
|
-
}
|
|
2256
|
-
if (d.object(o)) {
|
|
2257
|
-
for (var p in o)
|
|
2258
|
-
this.on(p, o[p], a);
|
|
2259
|
-
return this;
|
|
2260
|
-
}
|
|
2261
|
-
return it(o, this.scope.actions) ? this.globalEvents[o] ? this.globalEvents[o].push(a) : this.globalEvents[o] = [a] : this.scope.events.add(this.scope.document, o, a, { options: s }), this;
|
|
2262
|
-
}, "The interact.on() method is being deprecated"), i.off = Le(function(o, a, s) {
|
|
2263
|
-
if (d.string(o) && o.search(" ") !== -1 && (o = o.trim().split(/ +/)), d.array(o)) {
|
|
2264
|
-
for (var c = 0, u = o; c < u.length; c++) {
|
|
2265
|
-
var l = u[c];
|
|
2266
|
-
this.off(l, a, s);
|
|
2267
|
-
}
|
|
2268
|
-
return this;
|
|
2269
|
-
}
|
|
2270
|
-
if (d.object(o)) {
|
|
2271
|
-
for (var p in o)
|
|
2272
|
-
this.off(p, o[p], a);
|
|
2273
|
-
return this;
|
|
2274
|
-
}
|
|
2275
|
-
var f;
|
|
2276
|
-
return it(o, this.scope.actions) ? o in this.globalEvents && (f = this.globalEvents[o].indexOf(a)) !== -1 && this.globalEvents[o].splice(f, 1) : this.scope.events.remove(this.scope.document, o, a, s), this;
|
|
2277
|
-
}, "The interact.off() method is being deprecated"), i.debug = function() {
|
|
2278
|
-
return this.scope;
|
|
2279
|
-
}, i.supportsTouch = function() {
|
|
2280
|
-
return Y.supportsTouch;
|
|
2281
|
-
}, i.supportsPointerEvent = function() {
|
|
2282
|
-
return Y.supportsPointerEvent;
|
|
2283
|
-
}, i.stop = function() {
|
|
2284
|
-
for (var o = 0, a = this.scope.interactions.list; o < a.length; o++)
|
|
2285
|
-
a[o].stop();
|
|
2286
|
-
return this;
|
|
2287
|
-
}, i.pointerMoveTolerance = function(o) {
|
|
2288
|
-
return d.number(o) ? (this.scope.interactions.pointerMoveTolerance = o, this) : this.scope.interactions.pointerMoveTolerance;
|
|
2289
|
-
}, i.addDocument = function(o, a) {
|
|
2290
|
-
this.scope.addDocument(o, a);
|
|
2291
|
-
}, i.removeDocument = function(o) {
|
|
2292
|
-
this.scope.removeDocument(o);
|
|
2293
|
-
}, i;
|
|
2294
|
-
}(this), this.InteractEvent = At, this.Interactable = void 0, this.interactables = new _r(this), this._win = void 0, this.document = void 0, this.window = void 0, this.documents = [], this._plugins = { list: [], map: {} }, this.onWindowUnload = function(r) {
|
|
2295
|
-
return e.removeDocument(r.target);
|
|
2296
|
-
};
|
|
2297
|
-
var n = this;
|
|
2298
|
-
this.Interactable = function(r) {
|
|
2299
|
-
ue(o, r);
|
|
2300
|
-
var i = ee(o);
|
|
2301
|
-
function o() {
|
|
2302
|
-
return R(this, o), i.apply(this, arguments);
|
|
2303
|
-
}
|
|
2304
|
-
return k(o, [{ key: "_defaults", get: function() {
|
|
2305
|
-
return n.defaults;
|
|
2306
|
-
} }, { key: "set", value: function(a) {
|
|
2307
|
-
return j(q(o.prototype), "set", this).call(this, a), n.fire("interactable:set", { options: a, interactable: this }), this;
|
|
2308
|
-
} }, { key: "unset", value: function() {
|
|
2309
|
-
j(q(o.prototype), "unset", this).call(this);
|
|
2310
|
-
var a = n.interactables.list.indexOf(this);
|
|
2311
|
-
a < 0 || (n.interactables.list.splice(a, 1), n.fire("interactable:unset", { interactable: this }));
|
|
2312
|
-
} }]), o;
|
|
2313
|
-
}(Tr);
|
|
2314
|
-
}
|
|
2315
|
-
return k(t, [{ key: "addListeners", value: function(e, n) {
|
|
2316
|
-
this.listenerMaps.push({ id: n, map: e });
|
|
2317
|
-
} }, { key: "fire", value: function(e, n) {
|
|
2318
|
-
for (var r = 0, i = this.listenerMaps; r < i.length; r++) {
|
|
2319
|
-
var o = i[r].map[e];
|
|
2320
|
-
if (o && o(n, this, e) === !1)
|
|
2321
|
-
return !1;
|
|
2322
|
-
}
|
|
2323
|
-
} }, { key: "init", value: function(e) {
|
|
2324
|
-
return this.isInitialized ? this : function(n, r) {
|
|
2325
|
-
return n.isInitialized = !0, d.window(r) && te(r), C.init(r), Y.init(r), fe.init(r), n.window = r, n.document = r.document, n.usePlugin(Sr), n.usePlugin(xr), n;
|
|
2326
|
-
}(this, e);
|
|
2327
|
-
} }, { key: "pluginIsInstalled", value: function(e) {
|
|
2328
|
-
var n = e.id;
|
|
2329
|
-
return n ? !!this._plugins.map[n] : this._plugins.list.indexOf(e) !== -1;
|
|
2330
|
-
} }, { key: "usePlugin", value: function(e, n) {
|
|
2331
|
-
if (!this.isInitialized)
|
|
2332
|
-
return this;
|
|
2333
|
-
if (this.pluginIsInstalled(e))
|
|
2334
|
-
return this;
|
|
2335
|
-
if (e.id && (this._plugins.map[e.id] = e), this._plugins.list.push(e), e.install && e.install(this, n), e.listeners && e.before) {
|
|
2336
|
-
for (var r = 0, i = this.listenerMaps.length, o = e.before.reduce(function(s, c) {
|
|
2337
|
-
return s[c] = !0, s[On(c)] = !0, s;
|
|
2338
|
-
}, {}); r < i; r++) {
|
|
2339
|
-
var a = this.listenerMaps[r].id;
|
|
2340
|
-
if (a && (o[a] || o[On(a)]))
|
|
2341
|
-
break;
|
|
2342
|
-
}
|
|
2343
|
-
this.listenerMaps.splice(r, 0, { id: e.id, map: e.listeners });
|
|
2344
|
-
} else
|
|
2345
|
-
e.listeners && this.listenerMaps.push({ id: e.id, map: e.listeners });
|
|
2346
|
-
return this;
|
|
2347
|
-
} }, { key: "addDocument", value: function(e, n) {
|
|
2348
|
-
if (this.getDocIndex(e) !== -1)
|
|
2349
|
-
return !1;
|
|
2350
|
-
var r = B(e);
|
|
2351
|
-
n = n ? y({}, n) : {}, this.documents.push({ doc: e, options: n }), this.events.documents.push(e), e !== this.document && this.events.add(r, "unload", this.onWindowUnload), this.fire("scope:add-document", { doc: e, window: r, scope: this, options: n });
|
|
2352
|
-
} }, { key: "removeDocument", value: function(e) {
|
|
2353
|
-
var n = this.getDocIndex(e), r = B(e), i = this.documents[n].options;
|
|
2354
|
-
this.events.remove(r, "unload", this.onWindowUnload), this.documents.splice(n, 1), this.events.documents.splice(n, 1), this.fire("scope:remove-document", { doc: e, window: r, scope: this, options: i });
|
|
2355
|
-
} }, { key: "getDocIndex", value: function(e) {
|
|
2356
|
-
for (var n = 0; n < this.documents.length; n++)
|
|
2357
|
-
if (this.documents[n].doc === e)
|
|
2358
|
-
return n;
|
|
2359
|
-
return -1;
|
|
2360
|
-
} }, { key: "getDocOptions", value: function(e) {
|
|
2361
|
-
var n = this.getDocIndex(e);
|
|
2362
|
-
return n === -1 ? null : this.documents[n].options;
|
|
2363
|
-
} }, { key: "now", value: function() {
|
|
2364
|
-
return (this.window.Date || Date).now();
|
|
2365
|
-
} }]), t;
|
|
2366
|
-
}();
|
|
2367
|
-
function On(t) {
|
|
2368
|
-
return t && t.replace(/\/.*$/, "");
|
|
2369
|
-
}
|
|
2370
|
-
var In = new Pr(), V = In.interactStatic, kr = typeof globalThis < "u" ? globalThis : window;
|
|
2371
|
-
In.init(kr);
|
|
2372
|
-
var Or = Object.freeze({ __proto__: null, edgeTarget: function() {
|
|
2373
|
-
}, elements: function() {
|
|
2374
|
-
}, grid: function(t) {
|
|
2375
|
-
var e = [["x", "y"], ["left", "top"], ["right", "bottom"], ["width", "height"]].filter(function(r) {
|
|
2376
|
-
var i = r[0], o = r[1];
|
|
2377
|
-
return i in t || o in t;
|
|
2378
|
-
}), n = function(r, i) {
|
|
2379
|
-
for (var o = t.range, a = t.limits, s = a === void 0 ? { left: -1 / 0, right: 1 / 0, top: -1 / 0, bottom: 1 / 0 } : a, c = t.offset, u = c === void 0 ? { x: 0, y: 0 } : c, l = { range: o, grid: t, x: null, y: null }, p = 0; p < e.length; p++) {
|
|
2380
|
-
var f = e[p], h = f[0], v = f[1], g = Math.round((r - u.x) / t[h]), b = Math.round((i - u.y) / t[v]);
|
|
2381
|
-
l[h] = Math.max(s.left, Math.min(s.right, g * t[h] + u.x)), l[v] = Math.max(s.top, Math.min(s.bottom, b * t[v] + u.y));
|
|
2382
|
-
}
|
|
2383
|
-
return l;
|
|
2384
|
-
};
|
|
2385
|
-
return n.grid = t, n.coordFields = e, n;
|
|
2386
|
-
} }), Ir = { id: "snappers", install: function(t) {
|
|
2387
|
-
var e = t.interactStatic;
|
|
2388
|
-
e.snappers = y(e.snappers || {}, Or), e.createSnapGrid = e.snappers.grid;
|
|
2389
|
-
} }, Dr = Ir, Mr = { start: function(t) {
|
|
2390
|
-
var e = t.state, n = t.rect, r = t.edges, i = t.pageCoords, o = e.options, a = o.ratio, s = o.enabled, c = e.options, u = c.equalDelta, l = c.modifiers;
|
|
2391
|
-
a === "preserve" && (a = n.width / n.height), e.startCoords = y({}, i), e.startRect = y({}, n), e.ratio = a, e.equalDelta = u;
|
|
2392
|
-
var p = e.linkedEdges = { top: r.top || r.left && !r.bottom, left: r.left || r.top && !r.right, bottom: r.bottom || r.right && !r.top, right: r.right || r.bottom && !r.left };
|
|
2393
|
-
if (e.xIsPrimaryAxis = !(!r.left && !r.right), e.equalDelta) {
|
|
2394
|
-
var f = (p.left ? 1 : -1) * (p.top ? 1 : -1);
|
|
2395
|
-
e.edgeSign = { x: f, y: f };
|
|
2396
|
-
} else
|
|
2397
|
-
e.edgeSign = { x: p.left ? -1 : 1, y: p.top ? -1 : 1 };
|
|
2398
|
-
if (s !== !1 && y(r, p), l != null && l.length) {
|
|
2399
|
-
var h = new Mt(t.interaction);
|
|
2400
|
-
h.copyFrom(t.interaction.modification), h.prepareStates(l), e.subModification = h, h.startAll(M({}, t));
|
|
2401
|
-
}
|
|
2402
|
-
}, set: function(t) {
|
|
2403
|
-
var e = t.state, n = t.rect, r = t.coords, i = e.linkedEdges, o = y({}, r), a = e.equalDelta ? Ar : zr;
|
|
2404
|
-
if (y(t.edges, i), a(e, e.xIsPrimaryAxis, r, n), !e.subModification)
|
|
2405
|
-
return null;
|
|
2406
|
-
var s = y({}, n);
|
|
2407
|
-
Qe(i, s, { x: r.x - o.x, y: r.y - o.y });
|
|
2408
|
-
var c = e.subModification.setAll(M(M({}, t), {}, { rect: s, edges: i, pageCoords: r, prevCoords: r, prevRect: s })), u = c.delta;
|
|
2409
|
-
return c.changed && (a(e, Math.abs(u.x) > Math.abs(u.y), c.coords, c.rect), y(r, c.coords)), c.eventProps;
|
|
2410
|
-
}, defaults: { ratio: "preserve", equalDelta: !1, modifiers: [], enabled: !1 } };
|
|
2411
|
-
function Ar(t, e, n) {
|
|
2412
|
-
var r = t.startCoords, i = t.edgeSign;
|
|
2413
|
-
e ? n.y = r.y + (n.x - r.x) * i.y : n.x = r.x + (n.y - r.y) * i.x;
|
|
2414
|
-
}
|
|
2415
|
-
function zr(t, e, n, r) {
|
|
2416
|
-
var i = t.startRect, o = t.startCoords, a = t.ratio, s = t.edgeSign;
|
|
2417
|
-
if (e) {
|
|
2418
|
-
var c = r.width / a;
|
|
2419
|
-
n.y = o.y + (c - i.height) * s.y;
|
|
2420
|
-
} else {
|
|
2421
|
-
var u = r.height * a;
|
|
2422
|
-
n.x = o.x + (u - i.width) * s.x;
|
|
2423
|
-
}
|
|
2424
|
-
}
|
|
2425
|
-
var Cr = de(Mr, "aspectRatio"), Dn = function() {
|
|
2426
|
-
};
|
|
2427
|
-
Dn._defaults = {};
|
|
2428
|
-
var ct = Dn;
|
|
2429
|
-
function Se(t, e, n) {
|
|
2430
|
-
return d.func(t) ? oe(t, e.interactable, e.element, [n.x, n.y, e]) : oe(t, e.interactable, e.element);
|
|
2431
|
-
}
|
|
2432
|
-
var lt = { start: function(t) {
|
|
2433
|
-
var e = t.rect, n = t.startOffset, r = t.state, i = t.interaction, o = t.pageCoords, a = r.options, s = a.elementRect, c = y({ left: 0, top: 0, right: 0, bottom: 0 }, a.offset || {});
|
|
2434
|
-
if (e && s) {
|
|
2435
|
-
var u = Se(a.restriction, i, o);
|
|
2436
|
-
if (u) {
|
|
2437
|
-
var l = u.right - u.left - e.width, p = u.bottom - u.top - e.height;
|
|
2438
|
-
l < 0 && (c.left += l, c.right += l), p < 0 && (c.top += p, c.bottom += p);
|
|
2439
|
-
}
|
|
2440
|
-
c.left += n.left - e.width * s.left, c.top += n.top - e.height * s.top, c.right += n.right - e.width * (1 - s.right), c.bottom += n.bottom - e.height * (1 - s.bottom);
|
|
2441
|
-
}
|
|
2442
|
-
r.offset = c;
|
|
2443
|
-
}, set: function(t) {
|
|
2444
|
-
var e = t.coords, n = t.interaction, r = t.state, i = r.options, o = r.offset, a = Se(i.restriction, n, e);
|
|
2445
|
-
if (a) {
|
|
2446
|
-
var s = function(c) {
|
|
2447
|
-
return !c || "left" in c && "top" in c || ((c = y({}, c)).left = c.x || 0, c.top = c.y || 0, c.right = c.right || c.left + c.width, c.bottom = c.bottom || c.top + c.height), c;
|
|
2448
|
-
}(a);
|
|
2449
|
-
e.x = Math.max(Math.min(s.right - o.right, e.x), s.left + o.left), e.y = Math.max(Math.min(s.bottom - o.bottom, e.y), s.top + o.top);
|
|
2450
|
-
}
|
|
2451
|
-
}, defaults: { restriction: null, elementRect: null, offset: null, endOnly: !1, enabled: !1 } }, Rr = de(lt, "restrict"), Mn = { top: 1 / 0, left: 1 / 0, bottom: -1 / 0, right: -1 / 0 }, An = { top: -1 / 0, left: -1 / 0, bottom: 1 / 0, right: 1 / 0 };
|
|
2452
|
-
function zn(t, e) {
|
|
2453
|
-
for (var n = 0, r = ["top", "left", "bottom", "right"]; n < r.length; n++) {
|
|
2454
|
-
var i = r[n];
|
|
2455
|
-
i in t || (t[i] = e[i]);
|
|
2456
|
-
}
|
|
2457
|
-
return t;
|
|
2458
|
-
}
|
|
2459
|
-
var We = { noInner: Mn, noOuter: An, start: function(t) {
|
|
2460
|
-
var e, n = t.interaction, r = t.startOffset, i = t.state, o = i.options;
|
|
2461
|
-
o && (e = be(Se(o.offset, n, n.coords.start.page))), e = e || { x: 0, y: 0 }, i.offset = { top: e.y + r.top, left: e.x + r.left, bottom: e.y - r.bottom, right: e.x - r.right };
|
|
2462
|
-
}, set: function(t) {
|
|
2463
|
-
var e = t.coords, n = t.edges, r = t.interaction, i = t.state, o = i.offset, a = i.options;
|
|
2464
|
-
if (n) {
|
|
2465
|
-
var s = y({}, e), c = Se(a.inner, r, s) || {}, u = Se(a.outer, r, s) || {};
|
|
2466
|
-
zn(c, Mn), zn(u, An), n.top ? e.y = Math.min(Math.max(u.top + o.top, s.y), c.top + o.top) : n.bottom && (e.y = Math.max(Math.min(u.bottom + o.bottom, s.y), c.bottom + o.bottom)), n.left ? e.x = Math.min(Math.max(u.left + o.left, s.x), c.left + o.left) : n.right && (e.x = Math.max(Math.min(u.right + o.right, s.x), c.right + o.right));
|
|
2467
|
-
}
|
|
2468
|
-
}, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, jr = de(We, "restrictEdges"), Fr = y({ get elementRect() {
|
|
2469
|
-
return { top: 0, left: 0, bottom: 1, right: 1 };
|
|
2470
|
-
}, set elementRect(t) {
|
|
2471
|
-
} }, lt.defaults), $r = de({ start: lt.start, set: lt.set, defaults: Fr }, "restrictRect"), Br = { width: -1 / 0, height: -1 / 0 }, Nr = { width: 1 / 0, height: 1 / 0 }, Vr = de({ start: function(t) {
|
|
2472
|
-
return We.start(t);
|
|
2473
|
-
}, set: function(t) {
|
|
2474
|
-
var e = t.interaction, n = t.state, r = t.rect, i = t.edges, o = n.options;
|
|
2475
|
-
if (i) {
|
|
2476
|
-
var a = xe(Se(o.min, e, t.coords)) || Br, s = xe(Se(o.max, e, t.coords)) || Nr;
|
|
2477
|
-
n.options = { endOnly: o.endOnly, inner: y({}, We.noInner), outer: y({}, We.noOuter) }, i.top ? (n.options.inner.top = r.bottom - a.height, n.options.outer.top = r.bottom - s.height) : i.bottom && (n.options.inner.bottom = r.top + a.height, n.options.outer.bottom = r.top + s.height), i.left ? (n.options.inner.left = r.right - a.width, n.options.outer.left = r.right - s.width) : i.right && (n.options.inner.right = r.left + a.width, n.options.outer.right = r.left + s.width), We.set(t), n.options = o;
|
|
2478
|
-
}
|
|
2479
|
-
}, defaults: { min: null, max: null, endOnly: !1, enabled: !1 } }, "restrictSize"), Ft = { start: function(t) {
|
|
2480
|
-
var e, n = t.interaction, r = t.interactable, i = t.element, o = t.rect, a = t.state, s = t.startOffset, c = a.options, u = c.offsetWithOrigin ? function(f) {
|
|
2481
|
-
var h = f.interaction.element, v = be(oe(f.state.options.origin, null, null, [h])), g = v || Fe(f.interactable, h, f.interaction.prepared.name);
|
|
2482
|
-
return g;
|
|
2483
|
-
}(t) : { x: 0, y: 0 };
|
|
2484
|
-
if (c.offset === "startCoords")
|
|
2485
|
-
e = { x: n.coords.start.page.x, y: n.coords.start.page.y };
|
|
2486
|
-
else {
|
|
2487
|
-
var l = oe(c.offset, r, i, [n]);
|
|
2488
|
-
(e = be(l) || { x: 0, y: 0 }).x += u.x, e.y += u.y;
|
|
2489
|
-
}
|
|
2490
|
-
var p = c.relativePoints;
|
|
2491
|
-
a.offsets = o && p && p.length ? p.map(function(f, h) {
|
|
2492
|
-
return { index: h, relativePoint: f, x: s.left - o.width * f.x + e.x, y: s.top - o.height * f.y + e.y };
|
|
2493
|
-
}) : [{ index: 0, relativePoint: null, x: e.x, y: e.y }];
|
|
2494
|
-
}, set: function(t) {
|
|
2495
|
-
var e = t.interaction, n = t.coords, r = t.state, i = r.options, o = r.offsets, a = Fe(e.interactable, e.element, e.prepared.name), s = y({}, n), c = [];
|
|
2496
|
-
i.offsetWithOrigin || (s.x -= a.x, s.y -= a.y);
|
|
2497
|
-
for (var u = 0, l = o; u < l.length; u++)
|
|
2498
|
-
for (var p = l[u], f = s.x - p.x, h = s.y - p.y, v = 0, g = i.targets.length; v < g; v++) {
|
|
2499
|
-
var b = i.targets[v], m = void 0;
|
|
2500
|
-
(m = d.func(b) ? b(f, h, e._proxy, p, v) : b) && c.push({ x: (d.number(m.x) ? m.x : f) + p.x, y: (d.number(m.y) ? m.y : h) + p.y, range: d.number(m.range) ? m.range : i.range, source: b, index: v, offset: p });
|
|
2501
|
-
}
|
|
2502
|
-
for (var w = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, T = 0; T < c.length; T++) {
|
|
2503
|
-
var P = c[T], E = P.range, _ = P.x - s.x, L = P.y - s.y, O = $e(_, L), W = O <= E;
|
|
2504
|
-
E === 1 / 0 && w.inRange && w.range !== 1 / 0 && (W = !1), w.target && !(W ? w.inRange && E !== 1 / 0 ? O / E < w.distance / w.range : E === 1 / 0 && w.range !== 1 / 0 || O < w.distance : !w.inRange && O < w.distance) || (w.target = P, w.distance = O, w.range = E, w.inRange = W, w.delta.x = _, w.delta.y = L);
|
|
2505
|
-
}
|
|
2506
|
-
return w.inRange && (n.x = w.target.x, n.y = w.target.y), r.closest = w, w;
|
|
2507
|
-
}, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Lr = de(Ft, "snap"), ut = { start: function(t) {
|
|
2508
|
-
var e = t.state, n = t.edges, r = e.options;
|
|
2509
|
-
if (!n)
|
|
2510
|
-
return null;
|
|
2511
|
-
t.state = { options: { targets: null, relativePoints: [{ x: n.left ? 0 : 1, y: n.top ? 0 : 1 }], offset: r.offset || "self", origin: { x: 0, y: 0 }, range: r.range } }, e.targetFields = e.targetFields || [["width", "height"], ["x", "y"]], Ft.start(t), e.offsets = t.state.offsets, t.state = e;
|
|
2512
|
-
}, set: function(t) {
|
|
2513
|
-
var e = t.interaction, n = t.state, r = t.coords, i = n.options, o = n.offsets, a = { x: r.x - o[0].x, y: r.y - o[0].y };
|
|
2514
|
-
n.options = y({}, i), n.options.targets = [];
|
|
2515
|
-
for (var s = 0, c = i.targets || []; s < c.length; s++) {
|
|
2516
|
-
var u = c[s], l = void 0;
|
|
2517
|
-
if (l = d.func(u) ? u(a.x, a.y, e) : u) {
|
|
2518
|
-
for (var p = 0, f = n.targetFields; p < f.length; p++) {
|
|
2519
|
-
var h = f[p], v = h[0], g = h[1];
|
|
2520
|
-
if (v in l || g in l) {
|
|
2521
|
-
l.x = l[v], l.y = l[g];
|
|
2522
|
-
break;
|
|
2523
|
-
}
|
|
2524
|
-
}
|
|
2525
|
-
n.options.targets.push(l);
|
|
2526
|
-
}
|
|
2527
|
-
}
|
|
2528
|
-
var b = Ft.set(t);
|
|
2529
|
-
return n.options = i, b;
|
|
2530
|
-
}, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, Xr = de(ut, "snapSize"), $t = { aspectRatio: Cr, restrictEdges: jr, restrict: Rr, restrictRect: $r, restrictSize: Vr, snapEdges: de({ start: function(t) {
|
|
2531
|
-
var e = t.edges;
|
|
2532
|
-
return e ? (t.state.targetFields = t.state.targetFields || [[e.left ? "left" : "right", e.top ? "top" : "bottom"]], ut.start(t)) : null;
|
|
2533
|
-
}, set: ut.set, defaults: y(De(ut.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: Lr, snapSize: Xr, spring: ct, avoid: ct, transform: ct, rubberband: ct }, Yr = { id: "modifiers", install: function(t) {
|
|
2534
|
-
var e = t.interactStatic;
|
|
2535
|
-
for (var n in t.usePlugin(hn), t.usePlugin(Dr), e.modifiers = $t, $t) {
|
|
2536
|
-
var r = $t[n], i = r._defaults, o = r._methods;
|
|
2537
|
-
i._methods = o, t.defaults.perAction[n] = i;
|
|
2538
|
-
}
|
|
2539
|
-
} }, Wr = Yr, Cn = function(t) {
|
|
2540
|
-
ue(n, t);
|
|
2541
|
-
var e = ee(n);
|
|
2542
|
-
function n(r, i, o, a, s, c) {
|
|
2543
|
-
var u;
|
|
2544
|
-
if (R(this, n), Ze(me(u = e.call(this, s)), o), o !== i && Ze(me(u), i), u.timeStamp = c, u.originalEvent = o, u.type = r, u.pointerId = Be(i), u.pointerType = Ht(i), u.target = a, u.currentTarget = null, r === "tap") {
|
|
2545
|
-
var l = s.getPointerIndex(i);
|
|
2546
|
-
u.dt = u.timeStamp - s.pointers[l].downTime;
|
|
2547
|
-
var p = u.timeStamp - s.tapTime;
|
|
2548
|
-
u.double = !!s.prevTap && s.prevTap.type !== "doubletap" && s.prevTap.target === u.target && p < 500;
|
|
2549
|
-
} else
|
|
2550
|
-
r === "doubletap" && (u.dt = i.timeStamp - s.tapTime, u.double = !0);
|
|
2551
|
-
return u;
|
|
2552
|
-
}
|
|
2553
|
-
return k(n, [{ key: "_subtractOrigin", value: function(r) {
|
|
2554
|
-
var i = r.x, o = r.y;
|
|
2555
|
-
return this.pageX -= i, this.pageY -= o, this.clientX -= i, this.clientY -= o, this;
|
|
2556
|
-
} }, { key: "_addOrigin", value: function(r) {
|
|
2557
|
-
var i = r.x, o = r.y;
|
|
2558
|
-
return this.pageX += i, this.pageY += o, this.clientX += i, this.clientY += o, this;
|
|
2559
|
-
} }, { key: "preventDefault", value: function() {
|
|
2560
|
-
this.originalEvent.preventDefault();
|
|
2561
|
-
} }]), n;
|
|
2562
|
-
}(nt), qe = { id: "pointer-events/base", before: ["inertia", "modifiers", "auto-start", "actions"], install: function(t) {
|
|
2563
|
-
t.pointerEvents = qe, t.defaults.actions.pointerEvents = qe.defaults, y(t.actions.phaselessTypes, qe.types);
|
|
2564
|
-
}, listeners: { "interactions:new": function(t) {
|
|
2565
|
-
var e = t.interaction;
|
|
2566
|
-
e.prevTap = null, e.tapTime = 0;
|
|
2567
|
-
}, "interactions:update-pointer": function(t) {
|
|
2568
|
-
var e = t.down, n = t.pointerInfo;
|
|
2569
|
-
!e && n.hold || (n.hold = { duration: 1 / 0, timeout: null });
|
|
2570
|
-
}, "interactions:move": function(t, e) {
|
|
2571
|
-
var n = t.interaction, r = t.pointer, i = t.event, o = t.eventTarget;
|
|
2572
|
-
t.duplicate || n.pointerIsDown && !n.pointerWasMoved || (n.pointerIsDown && Bt(t), he({ interaction: n, pointer: r, event: i, eventTarget: o, type: "move" }, e));
|
|
2573
|
-
}, "interactions:down": function(t, e) {
|
|
2574
|
-
(function(n, r) {
|
|
2575
|
-
for (var i = n.interaction, o = n.pointer, a = n.event, s = n.eventTarget, c = n.pointerIndex, u = i.pointers[c].hold, l = x(s), p = { interaction: i, pointer: o, event: a, eventTarget: s, type: "hold", targets: [], path: l, node: null }, f = 0; f < l.length; f++) {
|
|
2576
|
-
var h = l[f];
|
|
2577
|
-
p.node = h, r.fire("pointerEvents:collect-targets", p);
|
|
2578
|
-
}
|
|
2579
|
-
if (p.targets.length) {
|
|
2580
|
-
for (var v = 1 / 0, g = 0, b = p.targets; g < b.length; g++) {
|
|
2581
|
-
var m = b[g].eventable.options.holdDuration;
|
|
2582
|
-
m < v && (v = m);
|
|
2583
|
-
}
|
|
2584
|
-
u.duration = v, u.timeout = setTimeout(function() {
|
|
2585
|
-
he({ interaction: i, eventTarget: s, pointer: o, event: a, type: "hold" }, r);
|
|
2586
|
-
}, v);
|
|
2587
|
-
}
|
|
2588
|
-
})(t, e), he(t, e);
|
|
2589
|
-
}, "interactions:up": function(t, e) {
|
|
2590
|
-
Bt(t), he(t, e), function(n, r) {
|
|
2591
|
-
var i = n.interaction, o = n.pointer, a = n.event, s = n.eventTarget;
|
|
2592
|
-
i.pointerWasMoved || he({ interaction: i, eventTarget: s, pointer: o, event: a, type: "tap" }, r);
|
|
2593
|
-
}(t, e);
|
|
2594
|
-
}, "interactions:cancel": function(t, e) {
|
|
2595
|
-
Bt(t), he(t, e);
|
|
2596
|
-
} }, PointerEvent: Cn, fire: he, collectEventTargets: Rn, defaults: { holdDuration: 600, ignoreFrom: null, allowFrom: null, origin: { x: 0, y: 0 } }, types: { down: !0, move: !0, up: !0, cancel: !0, tap: !0, doubletap: !0, hold: !0 } };
|
|
2597
|
-
function he(t, e) {
|
|
2598
|
-
var n = t.interaction, r = t.pointer, i = t.event, o = t.eventTarget, a = t.type, s = t.targets, c = s === void 0 ? Rn(t, e) : s, u = new Cn(a, r, i, o, n, e.now());
|
|
2599
|
-
e.fire("pointerEvents:new", { pointerEvent: u });
|
|
2600
|
-
for (var l = { interaction: n, pointer: r, event: i, eventTarget: o, targets: c, type: a, pointerEvent: u }, p = 0; p < c.length; p++) {
|
|
2601
|
-
var f = c[p];
|
|
2602
|
-
for (var h in f.props || {})
|
|
2603
|
-
u[h] = f.props[h];
|
|
2604
|
-
var v = Fe(f.eventable, f.node);
|
|
2605
|
-
if (u._subtractOrigin(v), u.eventable = f.eventable, u.currentTarget = f.node, f.eventable.fire(u), u._addOrigin(v), u.immediatePropagationStopped || u.propagationStopped && p + 1 < c.length && c[p + 1].node !== u.currentTarget)
|
|
2606
|
-
break;
|
|
2607
|
-
}
|
|
2608
|
-
if (e.fire("pointerEvents:fired", l), a === "tap") {
|
|
2609
|
-
var g = u.double ? he({ interaction: n, pointer: r, event: i, eventTarget: o, type: "doubletap" }, e) : u;
|
|
2610
|
-
n.prevTap = g, n.tapTime = g.timeStamp;
|
|
2611
|
-
}
|
|
2612
|
-
return u;
|
|
2613
|
-
}
|
|
2614
|
-
function Rn(t, e) {
|
|
2615
|
-
var n = t.interaction, r = t.pointer, i = t.event, o = t.eventTarget, a = t.type, s = n.getPointerIndex(r), c = n.pointers[s];
|
|
2616
|
-
if (a === "tap" && (n.pointerWasMoved || !c || c.downTarget !== o))
|
|
2617
|
-
return [];
|
|
2618
|
-
for (var u = x(o), l = { interaction: n, pointer: r, event: i, eventTarget: o, type: a, path: u, targets: [], node: null }, p = 0; p < u.length; p++) {
|
|
2619
|
-
var f = u[p];
|
|
2620
|
-
l.node = f, e.fire("pointerEvents:collect-targets", l);
|
|
2621
|
-
}
|
|
2622
|
-
return a === "hold" && (l.targets = l.targets.filter(function(h) {
|
|
2623
|
-
var v, g;
|
|
2624
|
-
return h.eventable.options.holdDuration === ((v = n.pointers[s]) == null || (g = v.hold) == null ? void 0 : g.duration);
|
|
2625
|
-
})), l.targets;
|
|
2626
|
-
}
|
|
2627
|
-
function Bt(t) {
|
|
2628
|
-
var e = t.interaction, n = t.pointerIndex, r = e.pointers[n].hold;
|
|
2629
|
-
r && r.timeout && (clearTimeout(r.timeout), r.timeout = null);
|
|
2630
|
-
}
|
|
2631
|
-
var qr = Object.freeze({ __proto__: null, default: qe });
|
|
2632
|
-
function Ur(t) {
|
|
2633
|
-
var e = t.interaction;
|
|
2634
|
-
e.holdIntervalHandle && (clearInterval(e.holdIntervalHandle), e.holdIntervalHandle = null);
|
|
2635
|
-
}
|
|
2636
|
-
var Gr = { id: "pointer-events/holdRepeat", install: function(t) {
|
|
2637
|
-
t.usePlugin(qe);
|
|
2638
|
-
var e = t.pointerEvents;
|
|
2639
|
-
e.defaults.holdRepeatInterval = 0, e.types.holdrepeat = t.actions.phaselessTypes.holdrepeat = !0;
|
|
2640
|
-
}, listeners: ["move", "up", "cancel", "endall"].reduce(function(t, e) {
|
|
2641
|
-
return t["pointerEvents:".concat(e)] = Ur, t;
|
|
2642
|
-
}, { "pointerEvents:new": function(t) {
|
|
2643
|
-
var e = t.pointerEvent;
|
|
2644
|
-
e.type === "hold" && (e.count = (e.count || 0) + 1);
|
|
2645
|
-
}, "pointerEvents:fired": function(t, e) {
|
|
2646
|
-
var n = t.interaction, r = t.pointerEvent, i = t.eventTarget, o = t.targets;
|
|
2647
|
-
if (r.type === "hold" && o.length) {
|
|
2648
|
-
var a = o[0].eventable.options.holdRepeatInterval;
|
|
2649
|
-
a <= 0 || (n.holdIntervalHandle = setTimeout(function() {
|
|
2650
|
-
e.pointerEvents.fire({ interaction: n, eventTarget: i, type: "hold", pointer: r, event: r }, e);
|
|
2651
|
-
}, a));
|
|
2652
|
-
}
|
|
2653
|
-
} }) }, Kr = Gr, Hr = { id: "pointer-events/interactableTargets", install: function(t) {
|
|
2654
|
-
var e = t.Interactable;
|
|
2655
|
-
e.prototype.pointerEvents = function(r) {
|
|
2656
|
-
return y(this.events.options, r), this;
|
|
2657
|
-
};
|
|
2658
|
-
var n = e.prototype._backCompatOption;
|
|
2659
|
-
e.prototype._backCompatOption = function(r, i) {
|
|
2660
|
-
var o = n.call(this, r, i);
|
|
2661
|
-
return o === this && (this.events.options[r] = i), o;
|
|
2662
|
-
};
|
|
2663
|
-
}, listeners: { "pointerEvents:collect-targets": function(t, e) {
|
|
2664
|
-
var n = t.targets, r = t.node, i = t.type, o = t.eventTarget;
|
|
2665
|
-
e.interactables.forEachMatch(r, function(a) {
|
|
2666
|
-
var s = a.events, c = s.options;
|
|
2667
|
-
s.types[i] && s.types[i].length && a.testIgnoreAllow(c, r, o) && n.push({ node: r, eventable: s, props: { interactable: a } });
|
|
2668
|
-
});
|
|
2669
|
-
}, "interactable:new": function(t) {
|
|
2670
|
-
var e = t.interactable;
|
|
2671
|
-
e.events.getRect = function(n) {
|
|
2672
|
-
return e.getRect(n);
|
|
2673
|
-
};
|
|
2674
|
-
}, "interactable:set": function(t, e) {
|
|
2675
|
-
var n = t.interactable, r = t.options;
|
|
2676
|
-
y(n.events.options, e.pointerEvents.defaults), y(n.events.options, r.pointerEvents || {});
|
|
2677
|
-
} } }, Jr = Hr, Qr = { id: "pointer-events", install: function(t) {
|
|
2678
|
-
t.usePlugin(qr), t.usePlugin(Kr), t.usePlugin(Jr);
|
|
2679
|
-
} }, Zr = Qr, ei = { id: "reflow", install: function(t) {
|
|
2680
|
-
var e = t.Interactable;
|
|
2681
|
-
t.actions.phases.reflow = !0, e.prototype.reflow = function(n) {
|
|
2682
|
-
return function(r, i, o) {
|
|
2683
|
-
for (var a = r.getAllElements(), s = o.window.Promise, c = s ? [] : null, u = function() {
|
|
2684
|
-
var p = a[l], f = r.getRect(p);
|
|
2685
|
-
if (!f)
|
|
2686
|
-
return 1;
|
|
2687
|
-
var h, v = Ve(o.interactions.list, function(m) {
|
|
2688
|
-
return m.interacting() && m.interactable === r && m.element === p && m.prepared.name === i.name;
|
|
2689
|
-
});
|
|
2690
|
-
if (v)
|
|
2691
|
-
v.move(), c && (h = v._reflowPromise || new s(function(m) {
|
|
2692
|
-
v._reflowResolve = m;
|
|
2693
|
-
}));
|
|
2694
|
-
else {
|
|
2695
|
-
var g = xe(f), b = function(m) {
|
|
2696
|
-
return { coords: m, get page() {
|
|
2697
|
-
return this.coords.page;
|
|
2698
|
-
}, get client() {
|
|
2699
|
-
return this.coords.client;
|
|
2700
|
-
}, get timeStamp() {
|
|
2701
|
-
return this.coords.timeStamp;
|
|
2702
|
-
}, get pageX() {
|
|
2703
|
-
return this.coords.page.x;
|
|
2704
|
-
}, get pageY() {
|
|
2705
|
-
return this.coords.page.y;
|
|
2706
|
-
}, get clientX() {
|
|
2707
|
-
return this.coords.client.x;
|
|
2708
|
-
}, get clientY() {
|
|
2709
|
-
return this.coords.client.y;
|
|
2710
|
-
}, get pointerId() {
|
|
2711
|
-
return this.coords.pointerId;
|
|
2712
|
-
}, get target() {
|
|
2713
|
-
return this.coords.target;
|
|
2714
|
-
}, get type() {
|
|
2715
|
-
return this.coords.type;
|
|
2716
|
-
}, get pointerType() {
|
|
2717
|
-
return this.coords.pointerType;
|
|
2718
|
-
}, get buttons() {
|
|
2719
|
-
return this.coords.buttons;
|
|
2720
|
-
}, preventDefault: function() {
|
|
2721
|
-
} };
|
|
2722
|
-
}({ page: { x: g.x, y: g.y }, client: { x: g.x, y: g.y }, timeStamp: o.now() });
|
|
2723
|
-
h = function(m, w, T, P, E) {
|
|
2724
|
-
var _ = m.interactions.new({ pointerType: "reflow" }), L = { interaction: _, event: E, pointer: E, eventTarget: T, phase: "reflow" };
|
|
2725
|
-
_.interactable = w, _.element = T, _.prevEvent = E, _.updatePointer(E, E, T, !0), qt(_.coords.delta), kt(_.prepared, P), _._doPhase(L);
|
|
2726
|
-
var O = m.window, W = O.Promise, H = W ? new W(function(ce) {
|
|
2727
|
-
_._reflowResolve = ce;
|
|
2728
|
-
}) : void 0;
|
|
2729
|
-
return _._reflowPromise = H, _.start(P, w, T), _._interacting ? (_.move(L), _.end(E)) : (_.stop(), _._reflowResolve()), _.removePointer(E, E), H;
|
|
2730
|
-
}(o, r, p, i, b);
|
|
2731
|
-
}
|
|
2732
|
-
c && c.push(h);
|
|
2733
|
-
}, l = 0; l < a.length && !u(); l++)
|
|
2734
|
-
;
|
|
2735
|
-
return c && s.all(c).then(function() {
|
|
2736
|
-
return r;
|
|
2737
|
-
});
|
|
2738
|
-
}(this, n, t);
|
|
2739
|
-
};
|
|
2740
|
-
}, listeners: { "interactions:stop": function(t, e) {
|
|
2741
|
-
var n = t.interaction;
|
|
2742
|
-
n.pointerType === "reflow" && (n._reflowResolve && n._reflowResolve(), function(r, i) {
|
|
2743
|
-
r.splice(r.indexOf(i), 1);
|
|
2744
|
-
}(e.interactions.list, n));
|
|
2745
|
-
} } }, ti = ei;
|
|
2746
|
-
if (V.use(vn), V.use(xn), V.use(Zr), V.use(yr), V.use(Wr), V.use(ar), V.use(Kn), V.use(Jn), V.use(ti), V.default = V, le(z) === "object" && z)
|
|
2747
|
-
try {
|
|
2748
|
-
z.exports = V;
|
|
2749
|
-
} catch {
|
|
2750
|
-
}
|
|
2751
|
-
return V.default = V, V;
|
|
2752
|
-
});
|
|
2753
|
-
})(mt, mt.exports);
|
|
2754
|
-
var $i = mt.exports;
|
|
2755
|
-
const Ji = /* @__PURE__ */ Mi($i);
|
|
2756
|
-
export {
|
|
2757
|
-
Hi as E,
|
|
2758
|
-
Ji as i
|
|
2759
|
-
};
|