@norskvideo/norsk-studio-source-switcher 1.9.0
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/client/info.js +3198 -0
- package/client/style.css +3 -0
- package/client/tailwind.css +1560 -0
- package/lib/fullscreen-view.js +299 -0
- package/lib/fullscreen-view.js.map +1 -0
- package/lib/index.js +41 -0
- package/lib/index.js.map +1 -0
- package/lib/info.js +151 -0
- package/lib/info.js.map +1 -0
- package/lib/inline-view.js +15 -0
- package/lib/inline-view.js.map +1 -0
- package/lib/runtime.js +580 -0
- package/lib/runtime.js.map +1 -0
- package/lib/summary-view.js +48 -0
- package/lib/summary-view.js.map +1 -0
- package/lib/test/runtime.js +306 -0
- package/lib/test/runtime.js.map +1 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/types.yaml +120 -0
- package/package.json +65 -0
package/client/info.js
ADDED
@@ -0,0 +1,3198 @@
|
|
1
|
+
var __create = Object.create;
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
+
var __esm = (fn, res) => function __init() {
|
8
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
9
|
+
};
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
12
|
+
};
|
13
|
+
var __export = (target, all) => {
|
14
|
+
for (var name in all)
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
16
|
+
};
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
19
|
+
for (let key of __getOwnPropNames(from))
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
22
|
+
}
|
23
|
+
return to;
|
24
|
+
};
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
30
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
31
|
+
mod
|
32
|
+
));
|
33
|
+
|
34
|
+
// external-global-plugin:react
|
35
|
+
var require_react = __commonJS({
|
36
|
+
"external-global-plugin:react"(exports, module) {
|
37
|
+
module.exports = window.ReactExports;
|
38
|
+
}
|
39
|
+
});
|
40
|
+
|
41
|
+
// external-global-plugin:react/jsx-runtime
|
42
|
+
var require_jsx_runtime = __commonJS({
|
43
|
+
"external-global-plugin:react/jsx-runtime"(exports, module) {
|
44
|
+
module.exports = window.ReactJsx;
|
45
|
+
}
|
46
|
+
});
|
47
|
+
|
48
|
+
// ../../node_modules/@norskvideo/norsk-studio/lib/shared/shared-views.js
|
49
|
+
var require_shared_views = __commonJS({
|
50
|
+
"../../node_modules/@norskvideo/norsk-studio/lib/shared/shared-views.js"(exports) {
|
51
|
+
"use strict";
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
53
|
+
exports.GlobalIceServerView = GlobalIceServerView;
|
54
|
+
var jsx_runtime_1 = require_jsx_runtime();
|
55
|
+
function GlobalIceServerView(i) {
|
56
|
+
return (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-flow-row-dense grid-cols-3 text-sm", children: [(0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "URL" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: i.url }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Reported URL" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: i.reportedUrl ?? "" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Username" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: i.username ?? "" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-1", children: "Password" }), (0, jsx_runtime_1.jsx)("div", { className: "col-span-2", children: i.credential ?? "" })] });
|
57
|
+
}
|
58
|
+
}
|
59
|
+
});
|
60
|
+
|
61
|
+
// ../../node_modules/@norskvideo/norsk-studio/lib/shared/config.js
|
62
|
+
var require_config = __commonJS({
|
63
|
+
"../../node_modules/@norskvideo/norsk-studio/lib/shared/config.js"(exports) {
|
64
|
+
"use strict";
|
65
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
66
|
+
if (k2 === void 0)
|
67
|
+
k2 = k;
|
68
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
69
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
70
|
+
desc = { enumerable: true, get: function() {
|
71
|
+
return m[k];
|
72
|
+
} };
|
73
|
+
}
|
74
|
+
Object.defineProperty(o, k2, desc);
|
75
|
+
} : function(o, m, k, k2) {
|
76
|
+
if (k2 === void 0)
|
77
|
+
k2 = k;
|
78
|
+
o[k2] = m[k];
|
79
|
+
});
|
80
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
81
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
82
|
+
} : function(o, v) {
|
83
|
+
o["default"] = v;
|
84
|
+
});
|
85
|
+
var __importStar = exports && exports.__importStar || function(mod) {
|
86
|
+
if (mod && mod.__esModule)
|
87
|
+
return mod;
|
88
|
+
var result = {};
|
89
|
+
if (mod != null) {
|
90
|
+
for (var k in mod)
|
91
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
92
|
+
__createBinding(result, mod, k);
|
93
|
+
}
|
94
|
+
__setModuleDefault(result, mod);
|
95
|
+
return result;
|
96
|
+
};
|
97
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
98
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
99
|
+
};
|
100
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
101
|
+
exports.GlobalIceServers = GlobalIceServers2;
|
102
|
+
exports.contractHardwareAcceleration = contractHardwareAcceleration;
|
103
|
+
exports.HardwareSelection = HardwareSelection2;
|
104
|
+
exports.RootDataDir = RootDataDir;
|
105
|
+
var react_1 = __importDefault(require_react());
|
106
|
+
function GlobalIceServers2(f) {
|
107
|
+
const GlobalIceServerView = react_1.default.lazy(async () => {
|
108
|
+
const views = await Promise.resolve().then(() => __importStar(require_shared_views()));
|
109
|
+
return { default: views.GlobalIceServerView };
|
110
|
+
});
|
111
|
+
const { validation: { Z } } = f;
|
112
|
+
return {
|
113
|
+
id: "ice-servers",
|
114
|
+
form: {
|
115
|
+
help: "ICE Servers to use for either STUN or TURN",
|
116
|
+
hint: {
|
117
|
+
envOverride: true,
|
118
|
+
type: "form-list",
|
119
|
+
form: {
|
120
|
+
url: {
|
121
|
+
help: "URL of the STUN/TURN server (with turn:/stun: prefix) as accessed by Norsk Studio",
|
122
|
+
hint: {
|
123
|
+
type: "text",
|
124
|
+
validation: f.validation.IceServer
|
125
|
+
}
|
126
|
+
},
|
127
|
+
reportedUrl: {
|
128
|
+
help: "Optional URL of the STUN/TURN server as accessed by the client (if different to the above)",
|
129
|
+
hint: {
|
130
|
+
type: "text",
|
131
|
+
validation: f.validation.IceServer
|
132
|
+
}
|
133
|
+
},
|
134
|
+
username: {
|
135
|
+
help: "Optional username",
|
136
|
+
hint: {
|
137
|
+
type: "text",
|
138
|
+
validation: Z.string()
|
139
|
+
}
|
140
|
+
},
|
141
|
+
credential: {
|
142
|
+
help: "Optional password",
|
143
|
+
hint: {
|
144
|
+
type: "text",
|
145
|
+
validation: Z.string()
|
146
|
+
}
|
147
|
+
}
|
148
|
+
},
|
149
|
+
view: GlobalIceServerView,
|
150
|
+
defaultValue: [{
|
151
|
+
url: "stun:stun.l.google.com:19302"
|
152
|
+
}]
|
153
|
+
}
|
154
|
+
}
|
155
|
+
};
|
156
|
+
}
|
157
|
+
function contractHardwareAcceleration(value, accepted) {
|
158
|
+
if (!value)
|
159
|
+
return void 0;
|
160
|
+
const expanded = accepted;
|
161
|
+
if (expanded.includes(value)) {
|
162
|
+
return value;
|
163
|
+
}
|
164
|
+
return void 0;
|
165
|
+
}
|
166
|
+
function HardwareSelection2() {
|
167
|
+
return {
|
168
|
+
id: "hardware-acceleration",
|
169
|
+
form: {
|
170
|
+
help: "Where available, use the specified hardware for encodes/compose operations",
|
171
|
+
hint: {
|
172
|
+
type: "select",
|
173
|
+
optional: true,
|
174
|
+
options: [
|
175
|
+
{ value: "ma35d", display: "MA35D" },
|
176
|
+
{ value: "quadra", display: "Quadra" },
|
177
|
+
{ value: "nvidia", display: "Nvidia" },
|
178
|
+
{ value: "logan", display: "Logan" }
|
179
|
+
]
|
180
|
+
}
|
181
|
+
}
|
182
|
+
};
|
183
|
+
}
|
184
|
+
function RootDataDir() {
|
185
|
+
return {
|
186
|
+
id: "root-data-dir",
|
187
|
+
form: {
|
188
|
+
help: "The root data dir to use against relative file paths in components/etc",
|
189
|
+
hint: {
|
190
|
+
type: "text",
|
191
|
+
defaultValue: "/"
|
192
|
+
}
|
193
|
+
}
|
194
|
+
};
|
195
|
+
}
|
196
|
+
}
|
197
|
+
});
|
198
|
+
|
199
|
+
// build/inline-view.js
|
200
|
+
var inline_view_exports = {};
|
201
|
+
__export(inline_view_exports, {
|
202
|
+
default: () => inline_view_default
|
203
|
+
});
|
204
|
+
function InlineView({ state }) {
|
205
|
+
return (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [(0, import_jsx_runtime.jsx)("h5", { children: "Sources" }), (0, import_jsx_runtime.jsx)("ul", { children: state.knownSources.map((s, i) => state.activeSource.id == s.id && state.activeSource.key == s.key ? (0, import_jsx_runtime.jsxs)("li", { className: activeClasses, children: [s.key ?? s.id, " <--"] }, i) : state.availableSources.find((a) => a.id == s.id && a.key == s.key) ? (0, import_jsx_runtime.jsxs)("li", { className: availableClasses, children: [s.key ?? s.id, " (available)"] }, i) : (0, import_jsx_runtime.jsxs)("li", { className: inactiveClasses, children: [s.key ?? s.id, " (inactive)"] }, i)) })] });
|
206
|
+
}
|
207
|
+
var import_jsx_runtime, activeClasses, availableClasses, inactiveClasses, inline_view_default;
|
208
|
+
var init_inline_view = __esm({
|
209
|
+
"build/inline-view.js"() {
|
210
|
+
"use strict";
|
211
|
+
import_jsx_runtime = __toESM(require_jsx_runtime());
|
212
|
+
activeClasses = "active text-green-300 dark:text-green-300";
|
213
|
+
availableClasses = "available text-green-300 dark:text-green-300";
|
214
|
+
inactiveClasses = "inactive text-orange-300 dark:text-orange-300";
|
215
|
+
inline_view_default = InlineView;
|
216
|
+
}
|
217
|
+
});
|
218
|
+
|
219
|
+
// external-global-plugin:@norskvideo/webrtc-client
|
220
|
+
var require_webrtc_client = __commonJS({
|
221
|
+
"external-global-plugin:@norskvideo/webrtc-client"(exports, module) {
|
222
|
+
module.exports = window.WebRtcClient;
|
223
|
+
}
|
224
|
+
});
|
225
|
+
|
226
|
+
// build/summary-view.js
|
227
|
+
var summary_view_exports = {};
|
228
|
+
__export(summary_view_exports, {
|
229
|
+
default: () => summary_view_default
|
230
|
+
});
|
231
|
+
function SummaryView({ state, config, sendCommand }) {
|
232
|
+
const [previewSource, setPreviewSource] = (0, import_react.useState)(void 0);
|
233
|
+
const [activePlayerSource, setActivePlayerSource] = (0, import_react.useState)(void 0);
|
234
|
+
const [initialLoad, setInitialLoad] = (0, import_react.useState)(true);
|
235
|
+
(0, import_react.useEffect)(() => {
|
236
|
+
if (previewSource !== activePlayerSource || initialLoad) {
|
237
|
+
const player = previewSource == void 0 ? state.previewPlayerUrl : state.players.find((p) => p.source.id == previewSource.id && p.source.key == previewSource.key)?.player;
|
238
|
+
if (!player)
|
239
|
+
return;
|
240
|
+
if (currentClient) {
|
241
|
+
currentClient.videoElements.forEach((e) => {
|
242
|
+
e.remove();
|
243
|
+
});
|
244
|
+
}
|
245
|
+
currentClient = new import_webrtc_client.WhepClient({ url: player, container: document.getElementById(`${config.id}-preview`) ?? void 0 });
|
246
|
+
void currentClient.start();
|
247
|
+
setActivePlayerSource(previewSource);
|
248
|
+
setInitialLoad(false);
|
249
|
+
}
|
250
|
+
}, [
|
251
|
+
previewSource,
|
252
|
+
activePlayerSource,
|
253
|
+
initialLoad,
|
254
|
+
state.players
|
255
|
+
]);
|
256
|
+
return (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [(0, import_jsx_runtime2.jsx)("h5", { children: "Sources" }), (0, import_jsx_runtime2.jsx)("ul", { children: state.knownSources.map((s, i) => state.activeSource.id == s.id && state.activeSource.key == s.key ? (0, import_jsx_runtime2.jsxs)("li", { className: activeClasses2, children: [s.key ?? s.id, " <--"] }, i) : state.availableSources.find((a) => s.id == a.id && s.key == a.key) ? (0, import_jsx_runtime2.jsxs)("li", { className: availableClasses2, children: [s.key ?? s.id, " (available)"] }, i) : (0, import_jsx_runtime2.jsxs)("li", { className: inactiveClasses2, children: [s.key ?? s.id, " (inactive)"] }, i)) }), (0, import_jsx_runtime2.jsx)("h2", { children: "Controls" }), (0, import_jsx_runtime2.jsx)("h4", { children: previewSource ? previewSource.key ?? previewSource.id : "Preview" }), (0, import_jsx_runtime2.jsx)("div", { id: `${config.id}-preview` }), (0, import_jsx_runtime2.jsx)("label", { htmlFor: "select-preview", className: "mt-2", children: "Source" }), (0, import_jsx_runtime2.jsxs)("select", { id: "select-preview", className: "mt-2 node-editor-select-input", onChange: (e) => {
|
257
|
+
setPreviewSource(JSON.parse(e.currentTarget.value));
|
258
|
+
}, children: [(0, import_jsx_runtime2.jsx)("option", { selected: previewSource === void 0, children: "---" }), state.availableSources.map((s, i) => (0, import_jsx_runtime2.jsx)("option", { selected: previewSource == s, value: JSON.stringify(s), children: s.key ?? s.id }, i))] }), previewSource ? (0, import_jsx_runtime2.jsx)("button", { type: "button", className: "mt-2 mb-2 text-white w-full justify-center bg-primary-700 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800", onClick: (e) => {
|
259
|
+
e.preventDefault();
|
260
|
+
sendCommand({ type: "select-source", source: previewSource, overlays: [] });
|
261
|
+
setPreviewSource(void 0);
|
262
|
+
}, children: "Make Active" }) : (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, {})] });
|
263
|
+
}
|
264
|
+
var import_jsx_runtime2, import_react, import_webrtc_client, activeClasses2, availableClasses2, inactiveClasses2, currentClient, summary_view_default;
|
265
|
+
var init_summary_view = __esm({
|
266
|
+
"build/summary-view.js"() {
|
267
|
+
"use strict";
|
268
|
+
import_jsx_runtime2 = __toESM(require_jsx_runtime());
|
269
|
+
import_react = __toESM(require_react());
|
270
|
+
import_webrtc_client = __toESM(require_webrtc_client());
|
271
|
+
activeClasses2 = "active text-green-300 dark:text-green-300";
|
272
|
+
availableClasses2 = "available text-green-300 dark:text-green-300";
|
273
|
+
inactiveClasses2 = "inactive text-orange-300 dark:text-orange-300";
|
274
|
+
currentClient = void 0;
|
275
|
+
summary_view_default = SummaryView;
|
276
|
+
}
|
277
|
+
});
|
278
|
+
|
279
|
+
// ../../node_modules/interactjs/dist/interact.min.js
|
280
|
+
var require_interact_min = __commonJS({
|
281
|
+
"../../node_modules/interactjs/dist/interact.min.js"(exports, module) {
|
282
|
+
!function(t, e) {
|
283
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).interact = e();
|
284
|
+
}(exports, function() {
|
285
|
+
"use strict";
|
286
|
+
function t(t2, e2) {
|
287
|
+
var n2 = Object.keys(t2);
|
288
|
+
if (Object.getOwnPropertySymbols) {
|
289
|
+
var r2 = Object.getOwnPropertySymbols(t2);
|
290
|
+
e2 && (r2 = r2.filter(function(e3) {
|
291
|
+
return Object.getOwnPropertyDescriptor(t2, e3).enumerable;
|
292
|
+
})), n2.push.apply(n2, r2);
|
293
|
+
}
|
294
|
+
return n2;
|
295
|
+
}
|
296
|
+
function e(e2) {
|
297
|
+
for (var n2 = 1; n2 < arguments.length; n2++) {
|
298
|
+
var r2 = null != arguments[n2] ? arguments[n2] : {};
|
299
|
+
n2 % 2 ? t(Object(r2), true).forEach(function(t2) {
|
300
|
+
a(e2, t2, r2[t2]);
|
301
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(r2)) : t(Object(r2)).forEach(function(t2) {
|
302
|
+
Object.defineProperty(e2, t2, Object.getOwnPropertyDescriptor(r2, t2));
|
303
|
+
});
|
304
|
+
}
|
305
|
+
return e2;
|
306
|
+
}
|
307
|
+
function n(t2) {
|
308
|
+
return n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(t3) {
|
309
|
+
return typeof t3;
|
310
|
+
} : function(t3) {
|
311
|
+
return t3 && "function" == typeof Symbol && t3.constructor === Symbol && t3 !== Symbol.prototype ? "symbol" : typeof t3;
|
312
|
+
}, n(t2);
|
313
|
+
}
|
314
|
+
function r(t2, e2) {
|
315
|
+
if (!(t2 instanceof e2))
|
316
|
+
throw new TypeError("Cannot call a class as a function");
|
317
|
+
}
|
318
|
+
function i(t2, e2) {
|
319
|
+
for (var n2 = 0; n2 < e2.length; n2++) {
|
320
|
+
var r2 = e2[n2];
|
321
|
+
r2.enumerable = r2.enumerable || false, r2.configurable = true, "value" in r2 && (r2.writable = true), Object.defineProperty(t2, d(r2.key), r2);
|
322
|
+
}
|
323
|
+
}
|
324
|
+
function o(t2, e2, n2) {
|
325
|
+
return e2 && i(t2.prototype, e2), n2 && i(t2, n2), Object.defineProperty(t2, "prototype", { writable: false }), t2;
|
326
|
+
}
|
327
|
+
function a(t2, e2, n2) {
|
328
|
+
return (e2 = d(e2)) in t2 ? Object.defineProperty(t2, e2, { value: n2, enumerable: true, configurable: true, writable: true }) : t2[e2] = n2, t2;
|
329
|
+
}
|
330
|
+
function s(t2, e2) {
|
331
|
+
if ("function" != typeof e2 && null !== e2)
|
332
|
+
throw new TypeError("Super expression must either be null or a function");
|
333
|
+
t2.prototype = Object.create(e2 && e2.prototype, { constructor: { value: t2, writable: true, configurable: true } }), Object.defineProperty(t2, "prototype", { writable: false }), e2 && l(t2, e2);
|
334
|
+
}
|
335
|
+
function c(t2) {
|
336
|
+
return c = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
|
337
|
+
return t3.__proto__ || Object.getPrototypeOf(t3);
|
338
|
+
}, c(t2);
|
339
|
+
}
|
340
|
+
function l(t2, e2) {
|
341
|
+
return l = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
|
342
|
+
return t3.__proto__ = e3, t3;
|
343
|
+
}, l(t2, e2);
|
344
|
+
}
|
345
|
+
function u(t2) {
|
346
|
+
if (void 0 === t2)
|
347
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
348
|
+
return t2;
|
349
|
+
}
|
350
|
+
function p(t2) {
|
351
|
+
var e2 = function() {
|
352
|
+
if ("undefined" == typeof Reflect || !Reflect.construct)
|
353
|
+
return false;
|
354
|
+
if (Reflect.construct.sham)
|
355
|
+
return false;
|
356
|
+
if ("function" == typeof Proxy)
|
357
|
+
return true;
|
358
|
+
try {
|
359
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
360
|
+
})), true;
|
361
|
+
} catch (t3) {
|
362
|
+
return false;
|
363
|
+
}
|
364
|
+
}();
|
365
|
+
return function() {
|
366
|
+
var n2, r2 = c(t2);
|
367
|
+
if (e2) {
|
368
|
+
var i2 = c(this).constructor;
|
369
|
+
n2 = Reflect.construct(r2, arguments, i2);
|
370
|
+
} else
|
371
|
+
n2 = r2.apply(this, arguments);
|
372
|
+
return function(t3, e3) {
|
373
|
+
if (e3 && ("object" == typeof e3 || "function" == typeof e3))
|
374
|
+
return e3;
|
375
|
+
if (void 0 !== e3)
|
376
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
377
|
+
return u(t3);
|
378
|
+
}(this, n2);
|
379
|
+
};
|
380
|
+
}
|
381
|
+
function f() {
|
382
|
+
return f = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(t2, e2, n2) {
|
383
|
+
var r2 = function(t3, e3) {
|
384
|
+
for (; !Object.prototype.hasOwnProperty.call(t3, e3) && null !== (t3 = c(t3)); )
|
385
|
+
;
|
386
|
+
return t3;
|
387
|
+
}(t2, e2);
|
388
|
+
if (r2) {
|
389
|
+
var i2 = Object.getOwnPropertyDescriptor(r2, e2);
|
390
|
+
return i2.get ? i2.get.call(arguments.length < 3 ? t2 : n2) : i2.value;
|
391
|
+
}
|
392
|
+
}, f.apply(this, arguments);
|
393
|
+
}
|
394
|
+
function d(t2) {
|
395
|
+
var e2 = function(t3, e3) {
|
396
|
+
if ("object" != typeof t3 || null === t3)
|
397
|
+
return t3;
|
398
|
+
var n2 = t3[Symbol.toPrimitive];
|
399
|
+
if (void 0 !== n2) {
|
400
|
+
var r2 = n2.call(t3, e3 || "default");
|
401
|
+
if ("object" != typeof r2)
|
402
|
+
return r2;
|
403
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
404
|
+
}
|
405
|
+
return ("string" === e3 ? String : Number)(t3);
|
406
|
+
}(t2, "string");
|
407
|
+
return "symbol" == typeof e2 ? e2 : e2 + "";
|
408
|
+
}
|
409
|
+
var h = function(t2) {
|
410
|
+
return !(!t2 || !t2.Window) && t2 instanceof t2.Window;
|
411
|
+
}, v = void 0, g = void 0;
|
412
|
+
function m(t2) {
|
413
|
+
v = t2;
|
414
|
+
var e2 = t2.document.createTextNode("");
|
415
|
+
e2.ownerDocument !== t2.document && "function" == typeof t2.wrap && t2.wrap(e2) === e2 && (t2 = t2.wrap(t2)), g = t2;
|
416
|
+
}
|
417
|
+
function y(t2) {
|
418
|
+
return h(t2) ? t2 : (t2.ownerDocument || t2).defaultView || g.window;
|
419
|
+
}
|
420
|
+
"undefined" != typeof window && window && m(window);
|
421
|
+
var b = function(t2) {
|
422
|
+
return !!t2 && "object" === n(t2);
|
423
|
+
}, x = function(t2) {
|
424
|
+
return "function" == typeof t2;
|
425
|
+
}, w = { window: function(t2) {
|
426
|
+
return t2 === g || h(t2);
|
427
|
+
}, docFrag: function(t2) {
|
428
|
+
return b(t2) && 11 === t2.nodeType;
|
429
|
+
}, object: b, func: x, number: function(t2) {
|
430
|
+
return "number" == typeof t2;
|
431
|
+
}, bool: function(t2) {
|
432
|
+
return "boolean" == typeof t2;
|
433
|
+
}, string: function(t2) {
|
434
|
+
return "string" == typeof t2;
|
435
|
+
}, element: function(t2) {
|
436
|
+
if (!t2 || "object" !== n(t2))
|
437
|
+
return false;
|
438
|
+
var e2 = y(t2) || g;
|
439
|
+
return /object|function/.test("undefined" == typeof Element ? "undefined" : n(Element)) ? t2 instanceof Element || t2 instanceof e2.Element : 1 === t2.nodeType && "string" == typeof t2.nodeName;
|
440
|
+
}, plainObject: function(t2) {
|
441
|
+
return b(t2) && !!t2.constructor && /function Object\b/.test(t2.constructor.toString());
|
442
|
+
}, array: function(t2) {
|
443
|
+
return b(t2) && void 0 !== t2.length && x(t2.splice);
|
444
|
+
} };
|
445
|
+
function E(t2) {
|
446
|
+
var e2 = t2.interaction;
|
447
|
+
if ("drag" === e2.prepared.name) {
|
448
|
+
var n2 = e2.prepared.axis;
|
449
|
+
"x" === n2 ? (e2.coords.cur.page.y = e2.coords.start.page.y, e2.coords.cur.client.y = e2.coords.start.client.y, e2.coords.velocity.client.y = 0, e2.coords.velocity.page.y = 0) : "y" === n2 && (e2.coords.cur.page.x = e2.coords.start.page.x, e2.coords.cur.client.x = e2.coords.start.client.x, e2.coords.velocity.client.x = 0, e2.coords.velocity.page.x = 0);
|
450
|
+
}
|
451
|
+
}
|
452
|
+
function T(t2) {
|
453
|
+
var e2 = t2.iEvent, n2 = t2.interaction;
|
454
|
+
if ("drag" === n2.prepared.name) {
|
455
|
+
var r2 = n2.prepared.axis;
|
456
|
+
if ("x" === r2 || "y" === r2) {
|
457
|
+
var i2 = "x" === r2 ? "y" : "x";
|
458
|
+
e2.page[i2] = n2.coords.start.page[i2], e2.client[i2] = n2.coords.start.client[i2], e2.delta[i2] = 0;
|
459
|
+
}
|
460
|
+
}
|
461
|
+
}
|
462
|
+
var S = { id: "actions/drag", install: function(t2) {
|
463
|
+
var e2 = t2.actions, n2 = t2.Interactable, r2 = t2.defaults;
|
464
|
+
n2.prototype.draggable = S.draggable, e2.map.drag = S, e2.methodDict.drag = "draggable", r2.actions.drag = S.defaults;
|
465
|
+
}, listeners: { "interactions:before-action-move": E, "interactions:action-resume": E, "interactions:action-move": T, "auto-start:check": function(t2) {
|
466
|
+
var e2 = t2.interaction, n2 = t2.interactable, r2 = t2.buttons, i2 = n2.options.drag;
|
467
|
+
if (i2 && i2.enabled && (!e2.pointerIsDown || !/mouse|pointer/.test(e2.pointerType) || 0 != (r2 & n2.options.drag.mouseButtons)))
|
468
|
+
return t2.action = { name: "drag", axis: "start" === i2.lockAxis ? i2.startAxis : i2.lockAxis }, false;
|
469
|
+
} }, draggable: function(t2) {
|
470
|
+
return w.object(t2) ? (this.options.drag.enabled = false !== t2.enabled, this.setPerAction("drag", t2), this.setOnEvents("drag", t2), /^(xy|x|y|start)$/.test(t2.lockAxis) && (this.options.drag.lockAxis = t2.lockAxis), /^(xy|x|y)$/.test(t2.startAxis) && (this.options.drag.startAxis = t2.startAxis), this) : w.bool(t2) ? (this.options.drag.enabled = t2, this) : this.options.drag;
|
471
|
+
}, beforeMove: E, move: T, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
|
472
|
+
return "move";
|
473
|
+
}, filterEventType: function(t2) {
|
474
|
+
return 0 === t2.search("drag");
|
475
|
+
} }, _ = S, P = { init: function(t2) {
|
476
|
+
var e2 = t2;
|
477
|
+
P.document = e2.document, P.DocumentFragment = e2.DocumentFragment || O, P.SVGElement = e2.SVGElement || O, P.SVGSVGElement = e2.SVGSVGElement || O, P.SVGElementInstance = e2.SVGElementInstance || O, P.Element = e2.Element || O, P.HTMLElement = e2.HTMLElement || P.Element, P.Event = e2.Event, P.Touch = e2.Touch || O, P.PointerEvent = e2.PointerEvent || e2.MSPointerEvent;
|
478
|
+
}, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
|
479
|
+
function O() {
|
480
|
+
}
|
481
|
+
var k = P;
|
482
|
+
var D = { init: function(t2) {
|
483
|
+
var e2 = k.Element, n2 = t2.navigator || {};
|
484
|
+
D.supportsTouch = "ontouchstart" in t2 || w.func(t2.DocumentTouch) && k.document instanceof t2.DocumentTouch, D.supportsPointerEvent = false !== n2.pointerEnabled && !!k.PointerEvent, D.isIOS = /iP(hone|od|ad)/.test(n2.platform), D.isIOS7 = /iP(hone|od|ad)/.test(n2.platform) && /OS 7[^\d]/.test(n2.appVersion), D.isIe9 = /MSIE 9/.test(n2.userAgent), D.isOperaMobile = "Opera" === n2.appName && D.supportsTouch && /Presto/.test(n2.userAgent), D.prefixedMatchesSelector = "matches" in e2.prototype ? "matches" : "webkitMatchesSelector" in e2.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e2.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e2.prototype ? "oMatchesSelector" : "msMatchesSelector", D.pEventTypes = D.supportsPointerEvent ? k.PointerEvent === t2.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, D.wheelEvent = k.document && "onmousewheel" in k.document ? "mousewheel" : "wheel";
|
485
|
+
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null };
|
486
|
+
var I = D;
|
487
|
+
function M(t2, e2) {
|
488
|
+
if (t2.contains)
|
489
|
+
return t2.contains(e2);
|
490
|
+
for (; e2; ) {
|
491
|
+
if (e2 === t2)
|
492
|
+
return true;
|
493
|
+
e2 = e2.parentNode;
|
494
|
+
}
|
495
|
+
return false;
|
496
|
+
}
|
497
|
+
function z(t2, e2) {
|
498
|
+
for (; w.element(t2); ) {
|
499
|
+
if (R(t2, e2))
|
500
|
+
return t2;
|
501
|
+
t2 = A(t2);
|
502
|
+
}
|
503
|
+
return null;
|
504
|
+
}
|
505
|
+
function A(t2) {
|
506
|
+
var e2 = t2.parentNode;
|
507
|
+
if (w.docFrag(e2)) {
|
508
|
+
for (; (e2 = e2.host) && w.docFrag(e2); )
|
509
|
+
;
|
510
|
+
return e2;
|
511
|
+
}
|
512
|
+
return e2;
|
513
|
+
}
|
514
|
+
function R(t2, e2) {
|
515
|
+
return g !== v && (e2 = e2.replace(/\/deep\//g, " ")), t2[I.prefixedMatchesSelector](e2);
|
516
|
+
}
|
517
|
+
var C = function(t2) {
|
518
|
+
return t2.parentNode || t2.host;
|
519
|
+
};
|
520
|
+
function j(t2, e2) {
|
521
|
+
for (var n2, r2 = [], i2 = t2; (n2 = C(i2)) && i2 !== e2 && n2 !== i2.ownerDocument; )
|
522
|
+
r2.unshift(i2), i2 = n2;
|
523
|
+
return r2;
|
524
|
+
}
|
525
|
+
function F(t2, e2, n2) {
|
526
|
+
for (; w.element(t2); ) {
|
527
|
+
if (R(t2, e2))
|
528
|
+
return true;
|
529
|
+
if ((t2 = A(t2)) === n2)
|
530
|
+
return R(t2, e2);
|
531
|
+
}
|
532
|
+
return false;
|
533
|
+
}
|
534
|
+
function X(t2) {
|
535
|
+
return t2.correspondingUseElement || t2;
|
536
|
+
}
|
537
|
+
function Y(t2) {
|
538
|
+
var e2 = t2 instanceof k.SVGElement ? t2.getBoundingClientRect() : t2.getClientRects()[0];
|
539
|
+
return e2 && { left: e2.left, right: e2.right, top: e2.top, bottom: e2.bottom, width: e2.width || e2.right - e2.left, height: e2.height || e2.bottom - e2.top };
|
540
|
+
}
|
541
|
+
function L(t2) {
|
542
|
+
var e2, n2 = Y(t2);
|
543
|
+
if (!I.isIOS7 && n2) {
|
544
|
+
var r2 = { x: (e2 = (e2 = y(t2)) || g).scrollX || e2.document.documentElement.scrollLeft, y: e2.scrollY || e2.document.documentElement.scrollTop };
|
545
|
+
n2.left += r2.x, n2.right += r2.x, n2.top += r2.y, n2.bottom += r2.y;
|
546
|
+
}
|
547
|
+
return n2;
|
548
|
+
}
|
549
|
+
function q(t2) {
|
550
|
+
for (var e2 = []; t2; )
|
551
|
+
e2.push(t2), t2 = A(t2);
|
552
|
+
return e2;
|
553
|
+
}
|
554
|
+
function B(t2) {
|
555
|
+
return !!w.string(t2) && (k.document.querySelector(t2), true);
|
556
|
+
}
|
557
|
+
function V(t2, e2) {
|
558
|
+
for (var n2 in e2)
|
559
|
+
t2[n2] = e2[n2];
|
560
|
+
return t2;
|
561
|
+
}
|
562
|
+
function W(t2, e2, n2) {
|
563
|
+
return "parent" === t2 ? A(n2) : "self" === t2 ? e2.getRect(n2) : z(n2, t2);
|
564
|
+
}
|
565
|
+
function G(t2, e2, n2, r2) {
|
566
|
+
var i2 = t2;
|
567
|
+
return w.string(i2) ? i2 = W(i2, e2, n2) : w.func(i2) && (i2 = i2.apply(void 0, r2)), w.element(i2) && (i2 = L(i2)), i2;
|
568
|
+
}
|
569
|
+
function N(t2) {
|
570
|
+
return t2 && { x: "x" in t2 ? t2.x : t2.left, y: "y" in t2 ? t2.y : t2.top };
|
571
|
+
}
|
572
|
+
function U(t2) {
|
573
|
+
return !t2 || "x" in t2 && "y" in t2 || ((t2 = V({}, t2)).x = t2.left || 0, t2.y = t2.top || 0, t2.width = t2.width || (t2.right || 0) - t2.x, t2.height = t2.height || (t2.bottom || 0) - t2.y), t2;
|
574
|
+
}
|
575
|
+
function H(t2, e2, n2) {
|
576
|
+
t2.left && (e2.left += n2.x), t2.right && (e2.right += n2.x), t2.top && (e2.top += n2.y), t2.bottom && (e2.bottom += n2.y), e2.width = e2.right - e2.left, e2.height = e2.bottom - e2.top;
|
577
|
+
}
|
578
|
+
function K(t2, e2, n2) {
|
579
|
+
var r2 = n2 && t2.options[n2];
|
580
|
+
return N(G(r2 && r2.origin || t2.options.origin, t2, e2, [t2 && e2])) || { x: 0, y: 0 };
|
581
|
+
}
|
582
|
+
function $(t2, e2) {
|
583
|
+
var n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : function(t3) {
|
584
|
+
return true;
|
585
|
+
}, r2 = arguments.length > 3 ? arguments[3] : void 0;
|
586
|
+
if (r2 = r2 || {}, w.string(t2) && -1 !== t2.search(" ") && (t2 = J(t2)), w.array(t2))
|
587
|
+
return t2.forEach(function(t3) {
|
588
|
+
return $(t3, e2, n2, r2);
|
589
|
+
}), r2;
|
590
|
+
if (w.object(t2) && (e2 = t2, t2 = ""), w.func(e2) && n2(t2))
|
591
|
+
r2[t2] = r2[t2] || [], r2[t2].push(e2);
|
592
|
+
else if (w.array(e2))
|
593
|
+
for (var i2 = 0, o2 = e2; i2 < o2.length; i2++) {
|
594
|
+
var a2 = o2[i2];
|
595
|
+
$(t2, a2, n2, r2);
|
596
|
+
}
|
597
|
+
else if (w.object(e2))
|
598
|
+
for (var s2 in e2) {
|
599
|
+
$(J(s2).map(function(e3) {
|
600
|
+
return "".concat(t2).concat(e3);
|
601
|
+
}), e2[s2], n2, r2);
|
602
|
+
}
|
603
|
+
return r2;
|
604
|
+
}
|
605
|
+
function J(t2) {
|
606
|
+
return t2.trim().split(/ +/);
|
607
|
+
}
|
608
|
+
var Q = function(t2, e2) {
|
609
|
+
return Math.sqrt(t2 * t2 + e2 * e2);
|
610
|
+
}, Z = ["webkit", "moz"];
|
611
|
+
function tt(t2, e2) {
|
612
|
+
t2.__set || (t2.__set = {});
|
613
|
+
var n2 = function(n3) {
|
614
|
+
if (Z.some(function(t3) {
|
615
|
+
return 0 === n3.indexOf(t3);
|
616
|
+
}))
|
617
|
+
return 1;
|
618
|
+
"function" != typeof t2[n3] && "__set" !== n3 && Object.defineProperty(t2, n3, { get: function() {
|
619
|
+
return n3 in t2.__set ? t2.__set[n3] : t2.__set[n3] = e2[n3];
|
620
|
+
}, set: function(e3) {
|
621
|
+
t2.__set[n3] = e3;
|
622
|
+
}, configurable: true });
|
623
|
+
};
|
624
|
+
for (var r2 in e2)
|
625
|
+
n2(r2);
|
626
|
+
return t2;
|
627
|
+
}
|
628
|
+
function et(t2, e2) {
|
629
|
+
t2.page = t2.page || {}, t2.page.x = e2.page.x, t2.page.y = e2.page.y, t2.client = t2.client || {}, t2.client.x = e2.client.x, t2.client.y = e2.client.y, t2.timeStamp = e2.timeStamp;
|
630
|
+
}
|
631
|
+
function nt(t2) {
|
632
|
+
t2.page.x = 0, t2.page.y = 0, t2.client.x = 0, t2.client.y = 0;
|
633
|
+
}
|
634
|
+
function rt(t2) {
|
635
|
+
return t2 instanceof k.Event || t2 instanceof k.Touch;
|
636
|
+
}
|
637
|
+
function it(t2, e2, n2) {
|
638
|
+
return t2 = t2 || "page", (n2 = n2 || {}).x = e2[t2 + "X"], n2.y = e2[t2 + "Y"], n2;
|
639
|
+
}
|
640
|
+
function ot(t2, e2) {
|
641
|
+
return e2 = e2 || { x: 0, y: 0 }, I.isOperaMobile && rt(t2) ? (it("screen", t2, e2), e2.x += window.scrollX, e2.y += window.scrollY) : it("page", t2, e2), e2;
|
642
|
+
}
|
643
|
+
function at(t2) {
|
644
|
+
return w.number(t2.pointerId) ? t2.pointerId : t2.identifier;
|
645
|
+
}
|
646
|
+
function st(t2, e2, n2) {
|
647
|
+
var r2 = e2.length > 1 ? lt(e2) : e2[0];
|
648
|
+
ot(r2, t2.page), function(t3, e3) {
|
649
|
+
e3 = e3 || {}, I.isOperaMobile && rt(t3) ? it("screen", t3, e3) : it("client", t3, e3);
|
650
|
+
}(r2, t2.client), t2.timeStamp = n2;
|
651
|
+
}
|
652
|
+
function ct(t2) {
|
653
|
+
var e2 = [];
|
654
|
+
return w.array(t2) ? (e2[0] = t2[0], e2[1] = t2[1]) : "touchend" === t2.type ? 1 === t2.touches.length ? (e2[0] = t2.touches[0], e2[1] = t2.changedTouches[0]) : 0 === t2.touches.length && (e2[0] = t2.changedTouches[0], e2[1] = t2.changedTouches[1]) : (e2[0] = t2.touches[0], e2[1] = t2.touches[1]), e2;
|
655
|
+
}
|
656
|
+
function lt(t2) {
|
657
|
+
for (var e2 = { pageX: 0, pageY: 0, clientX: 0, clientY: 0, screenX: 0, screenY: 0 }, n2 = 0; n2 < t2.length; n2++) {
|
658
|
+
var r2 = t2[n2];
|
659
|
+
for (var i2 in e2)
|
660
|
+
e2[i2] += r2[i2];
|
661
|
+
}
|
662
|
+
for (var o2 in e2)
|
663
|
+
e2[o2] /= t2.length;
|
664
|
+
return e2;
|
665
|
+
}
|
666
|
+
function ut(t2) {
|
667
|
+
if (!t2.length)
|
668
|
+
return null;
|
669
|
+
var e2 = ct(t2), n2 = Math.min(e2[0].pageX, e2[1].pageX), r2 = Math.min(e2[0].pageY, e2[1].pageY), i2 = Math.max(e2[0].pageX, e2[1].pageX), o2 = Math.max(e2[0].pageY, e2[1].pageY);
|
670
|
+
return { x: n2, y: r2, left: n2, top: r2, right: i2, bottom: o2, width: i2 - n2, height: o2 - r2 };
|
671
|
+
}
|
672
|
+
function pt(t2, e2) {
|
673
|
+
var n2 = e2 + "X", r2 = e2 + "Y", i2 = ct(t2), o2 = i2[0][n2] - i2[1][n2], a2 = i2[0][r2] - i2[1][r2];
|
674
|
+
return Q(o2, a2);
|
675
|
+
}
|
676
|
+
function ft(t2, e2) {
|
677
|
+
var n2 = e2 + "X", r2 = e2 + "Y", i2 = ct(t2), o2 = i2[1][n2] - i2[0][n2], a2 = i2[1][r2] - i2[0][r2];
|
678
|
+
return 180 * Math.atan2(a2, o2) / Math.PI;
|
679
|
+
}
|
680
|
+
function dt(t2) {
|
681
|
+
return w.string(t2.pointerType) ? t2.pointerType : w.number(t2.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t2.pointerType] : /touch/.test(t2.type || "") || t2 instanceof k.Touch ? "touch" : "mouse";
|
682
|
+
}
|
683
|
+
function ht(t2) {
|
684
|
+
var e2 = w.func(t2.composedPath) ? t2.composedPath() : t2.path;
|
685
|
+
return [X(e2 ? e2[0] : t2.target), X(t2.currentTarget)];
|
686
|
+
}
|
687
|
+
var vt = function() {
|
688
|
+
function t2(e2) {
|
689
|
+
r(this, t2), this.immediatePropagationStopped = false, this.propagationStopped = false, this._interaction = e2;
|
690
|
+
}
|
691
|
+
return o(t2, [{ key: "preventDefault", value: function() {
|
692
|
+
} }, { key: "stopPropagation", value: function() {
|
693
|
+
this.propagationStopped = true;
|
694
|
+
} }, { key: "stopImmediatePropagation", value: function() {
|
695
|
+
this.immediatePropagationStopped = this.propagationStopped = true;
|
696
|
+
} }]), t2;
|
697
|
+
}();
|
698
|
+
Object.defineProperty(vt.prototype, "interaction", { get: function() {
|
699
|
+
return this._interaction._proxy;
|
700
|
+
}, set: function() {
|
701
|
+
} });
|
702
|
+
var gt = function(t2, e2) {
|
703
|
+
for (var n2 = 0; n2 < e2.length; n2++) {
|
704
|
+
var r2 = e2[n2];
|
705
|
+
t2.push(r2);
|
706
|
+
}
|
707
|
+
return t2;
|
708
|
+
}, mt = function(t2) {
|
709
|
+
return gt([], t2);
|
710
|
+
}, yt = function(t2, e2) {
|
711
|
+
for (var n2 = 0; n2 < t2.length; n2++)
|
712
|
+
if (e2(t2[n2], n2, t2))
|
713
|
+
return n2;
|
714
|
+
return -1;
|
715
|
+
}, bt = function(t2, e2) {
|
716
|
+
return t2[yt(t2, e2)];
|
717
|
+
}, xt = function(t2) {
|
718
|
+
s(n2, t2);
|
719
|
+
var e2 = p(n2);
|
720
|
+
function n2(t3, i2, o2) {
|
721
|
+
var a2;
|
722
|
+
r(this, n2), (a2 = e2.call(this, i2._interaction)).dropzone = void 0, a2.dragEvent = void 0, a2.relatedTarget = void 0, a2.draggable = void 0, a2.propagationStopped = false, a2.immediatePropagationStopped = false;
|
723
|
+
var s2 = "dragleave" === o2 ? t3.prev : t3.cur, c2 = s2.element, l2 = s2.dropzone;
|
724
|
+
return a2.type = o2, a2.target = c2, a2.currentTarget = c2, a2.dropzone = l2, a2.dragEvent = i2, a2.relatedTarget = i2.target, a2.draggable = i2.interactable, a2.timeStamp = i2.timeStamp, a2;
|
725
|
+
}
|
726
|
+
return o(n2, [{ key: "reject", value: function() {
|
727
|
+
var t3 = this, e3 = this._interaction.dropState;
|
728
|
+
if ("dropactivate" === this.type || this.dropzone && e3.cur.dropzone === this.dropzone && e3.cur.element === this.target)
|
729
|
+
if (e3.prev.dropzone = this.dropzone, e3.prev.element = this.target, e3.rejected = true, e3.events.enter = null, this.stopImmediatePropagation(), "dropactivate" === this.type) {
|
730
|
+
var r2 = e3.activeDrops, i2 = yt(r2, function(e4) {
|
731
|
+
var n3 = e4.dropzone, r3 = e4.element;
|
732
|
+
return n3 === t3.dropzone && r3 === t3.target;
|
733
|
+
});
|
734
|
+
e3.activeDrops.splice(i2, 1);
|
735
|
+
var o2 = new n2(e3, this.dragEvent, "dropdeactivate");
|
736
|
+
o2.dropzone = this.dropzone, o2.target = this.target, this.dropzone.fire(o2);
|
737
|
+
} else
|
738
|
+
this.dropzone.fire(new n2(e3, this.dragEvent, "dragleave"));
|
739
|
+
} }, { key: "preventDefault", value: function() {
|
740
|
+
} }, { key: "stopPropagation", value: function() {
|
741
|
+
this.propagationStopped = true;
|
742
|
+
} }, { key: "stopImmediatePropagation", value: function() {
|
743
|
+
this.immediatePropagationStopped = this.propagationStopped = true;
|
744
|
+
} }]), n2;
|
745
|
+
}(vt);
|
746
|
+
function wt(t2, e2) {
|
747
|
+
for (var n2 = 0, r2 = t2.slice(); n2 < r2.length; n2++) {
|
748
|
+
var i2 = r2[n2], o2 = i2.dropzone, a2 = i2.element;
|
749
|
+
e2.dropzone = o2, e2.target = a2, o2.fire(e2), e2.propagationStopped = e2.immediatePropagationStopped = false;
|
750
|
+
}
|
751
|
+
}
|
752
|
+
function Et(t2, e2) {
|
753
|
+
for (var n2 = function(t3, e3) {
|
754
|
+
for (var n3 = [], r3 = 0, i3 = t3.interactables.list; r3 < i3.length; r3++) {
|
755
|
+
var o2 = i3[r3];
|
756
|
+
if (o2.options.drop.enabled) {
|
757
|
+
var a2 = o2.options.drop.accept;
|
758
|
+
if (!(w.element(a2) && a2 !== e3 || w.string(a2) && !R(e3, a2) || w.func(a2) && !a2({ dropzone: o2, draggableElement: e3 })))
|
759
|
+
for (var s2 = 0, c2 = o2.getAllElements(); s2 < c2.length; s2++) {
|
760
|
+
var l2 = c2[s2];
|
761
|
+
l2 !== e3 && n3.push({ dropzone: o2, element: l2, rect: o2.getRect(l2) });
|
762
|
+
}
|
763
|
+
}
|
764
|
+
}
|
765
|
+
return n3;
|
766
|
+
}(t2, e2), r2 = 0; r2 < n2.length; r2++) {
|
767
|
+
var i2 = n2[r2];
|
768
|
+
i2.rect = i2.dropzone.getRect(i2.element);
|
769
|
+
}
|
770
|
+
return n2;
|
771
|
+
}
|
772
|
+
function Tt(t2, e2, n2) {
|
773
|
+
for (var r2 = t2.dropState, i2 = t2.interactable, o2 = t2.element, a2 = [], s2 = 0, c2 = r2.activeDrops; s2 < c2.length; s2++) {
|
774
|
+
var l2 = c2[s2], u2 = l2.dropzone, p2 = l2.element, f2 = l2.rect, d2 = u2.dropCheck(e2, n2, i2, o2, p2, f2);
|
775
|
+
a2.push(d2 ? p2 : null);
|
776
|
+
}
|
777
|
+
var h2 = function(t3) {
|
778
|
+
for (var e3, n3, r3, i3 = [], o3 = 0; o3 < t3.length; o3++) {
|
779
|
+
var a3 = t3[o3], s3 = t3[e3];
|
780
|
+
if (a3 && o3 !== e3)
|
781
|
+
if (s3) {
|
782
|
+
var c3 = C(a3), l3 = C(s3);
|
783
|
+
if (c3 !== a3.ownerDocument)
|
784
|
+
if (l3 !== a3.ownerDocument)
|
785
|
+
if (c3 !== l3) {
|
786
|
+
i3 = i3.length ? i3 : j(s3);
|
787
|
+
var u3 = void 0;
|
788
|
+
if (s3 instanceof k.HTMLElement && a3 instanceof k.SVGElement && !(a3 instanceof k.SVGSVGElement)) {
|
789
|
+
if (a3 === l3)
|
790
|
+
continue;
|
791
|
+
u3 = a3.ownerSVGElement;
|
792
|
+
} else
|
793
|
+
u3 = a3;
|
794
|
+
for (var p3 = j(u3, s3.ownerDocument), f3 = 0; p3[f3] && p3[f3] === i3[f3]; )
|
795
|
+
f3++;
|
796
|
+
var d3 = [p3[f3 - 1], p3[f3], i3[f3]];
|
797
|
+
if (d3[0])
|
798
|
+
for (var h3 = d3[0].lastChild; h3; ) {
|
799
|
+
if (h3 === d3[1]) {
|
800
|
+
e3 = o3, i3 = p3;
|
801
|
+
break;
|
802
|
+
}
|
803
|
+
if (h3 === d3[2])
|
804
|
+
break;
|
805
|
+
h3 = h3.previousSibling;
|
806
|
+
}
|
807
|
+
} else
|
808
|
+
r3 = s3, void 0, void 0, (parseInt(y(n3 = a3).getComputedStyle(n3).zIndex, 10) || 0) >= (parseInt(y(r3).getComputedStyle(r3).zIndex, 10) || 0) && (e3 = o3);
|
809
|
+
else
|
810
|
+
e3 = o3;
|
811
|
+
} else
|
812
|
+
e3 = o3;
|
813
|
+
}
|
814
|
+
return e3;
|
815
|
+
}(a2);
|
816
|
+
return r2.activeDrops[h2] || null;
|
817
|
+
}
|
818
|
+
function St(t2, e2, n2) {
|
819
|
+
var r2 = t2.dropState, i2 = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
|
820
|
+
return "dragstart" === n2.type && (i2.activate = new xt(r2, n2, "dropactivate"), i2.activate.target = null, i2.activate.dropzone = null), "dragend" === n2.type && (i2.deactivate = new xt(r2, n2, "dropdeactivate"), i2.deactivate.target = null, i2.deactivate.dropzone = null), r2.rejected || (r2.cur.element !== r2.prev.element && (r2.prev.dropzone && (i2.leave = new xt(r2, n2, "dragleave"), n2.dragLeave = i2.leave.target = r2.prev.element, n2.prevDropzone = i2.leave.dropzone = r2.prev.dropzone), r2.cur.dropzone && (i2.enter = new xt(r2, n2, "dragenter"), n2.dragEnter = r2.cur.element, n2.dropzone = r2.cur.dropzone)), "dragend" === n2.type && r2.cur.dropzone && (i2.drop = new xt(r2, n2, "drop"), n2.dropzone = r2.cur.dropzone, n2.relatedTarget = r2.cur.element), "dragmove" === n2.type && r2.cur.dropzone && (i2.move = new xt(r2, n2, "dropmove"), n2.dropzone = r2.cur.dropzone)), i2;
|
821
|
+
}
|
822
|
+
function _t(t2, e2) {
|
823
|
+
var n2 = t2.dropState, r2 = n2.activeDrops, i2 = n2.cur, o2 = n2.prev;
|
824
|
+
e2.leave && o2.dropzone.fire(e2.leave), e2.enter && i2.dropzone.fire(e2.enter), e2.move && i2.dropzone.fire(e2.move), e2.drop && i2.dropzone.fire(e2.drop), e2.deactivate && wt(r2, e2.deactivate), n2.prev.dropzone = i2.dropzone, n2.prev.element = i2.element;
|
825
|
+
}
|
826
|
+
function Pt(t2, e2) {
|
827
|
+
var n2 = t2.interaction, r2 = t2.iEvent, i2 = t2.event;
|
828
|
+
if ("dragmove" === r2.type || "dragend" === r2.type) {
|
829
|
+
var o2 = n2.dropState;
|
830
|
+
e2.dynamicDrop && (o2.activeDrops = Et(e2, n2.element));
|
831
|
+
var a2 = r2, s2 = Tt(n2, a2, i2);
|
832
|
+
o2.rejected = o2.rejected && !!s2 && s2.dropzone === o2.cur.dropzone && s2.element === o2.cur.element, o2.cur.dropzone = s2 && s2.dropzone, o2.cur.element = s2 && s2.element, o2.events = St(n2, 0, a2);
|
833
|
+
}
|
834
|
+
}
|
835
|
+
var Ot = { id: "actions/drop", install: function(t2) {
|
836
|
+
var e2 = t2.actions, n2 = t2.interactStatic, r2 = t2.Interactable, i2 = t2.defaults;
|
837
|
+
t2.usePlugin(_), r2.prototype.dropzone = function(t3) {
|
838
|
+
return function(t4, e3) {
|
839
|
+
if (w.object(e3)) {
|
840
|
+
if (t4.options.drop.enabled = false !== e3.enabled, e3.listeners) {
|
841
|
+
var n3 = $(e3.listeners), r3 = Object.keys(n3).reduce(function(t5, e4) {
|
842
|
+
return t5[/^(enter|leave)/.test(e4) ? "drag".concat(e4) : /^(activate|deactivate|move)/.test(e4) ? "drop".concat(e4) : e4] = n3[e4], t5;
|
843
|
+
}, {}), i3 = t4.options.drop.listeners;
|
844
|
+
i3 && t4.off(i3), t4.on(r3), t4.options.drop.listeners = r3;
|
845
|
+
}
|
846
|
+
return w.func(e3.ondrop) && t4.on("drop", e3.ondrop), w.func(e3.ondropactivate) && t4.on("dropactivate", e3.ondropactivate), w.func(e3.ondropdeactivate) && t4.on("dropdeactivate", e3.ondropdeactivate), w.func(e3.ondragenter) && t4.on("dragenter", e3.ondragenter), w.func(e3.ondragleave) && t4.on("dragleave", e3.ondragleave), w.func(e3.ondropmove) && t4.on("dropmove", e3.ondropmove), /^(pointer|center)$/.test(e3.overlap) ? t4.options.drop.overlap = e3.overlap : w.number(e3.overlap) && (t4.options.drop.overlap = Math.max(Math.min(1, e3.overlap), 0)), "accept" in e3 && (t4.options.drop.accept = e3.accept), "checker" in e3 && (t4.options.drop.checker = e3.checker), t4;
|
847
|
+
}
|
848
|
+
if (w.bool(e3))
|
849
|
+
return t4.options.drop.enabled = e3, t4;
|
850
|
+
return t4.options.drop;
|
851
|
+
}(this, t3);
|
852
|
+
}, r2.prototype.dropCheck = function(t3, e3, n3, r3, i3, o2) {
|
853
|
+
return function(t4, e4, n4, r4, i4, o3, a2) {
|
854
|
+
var s2 = false;
|
855
|
+
if (!(a2 = a2 || t4.getRect(o3)))
|
856
|
+
return !!t4.options.drop.checker && t4.options.drop.checker(e4, n4, s2, t4, o3, r4, i4);
|
857
|
+
var c2 = t4.options.drop.overlap;
|
858
|
+
if ("pointer" === c2) {
|
859
|
+
var l2 = K(r4, i4, "drag"), u2 = ot(e4);
|
860
|
+
u2.x += l2.x, u2.y += l2.y;
|
861
|
+
var p2 = u2.x > a2.left && u2.x < a2.right, f2 = u2.y > a2.top && u2.y < a2.bottom;
|
862
|
+
s2 = p2 && f2;
|
863
|
+
}
|
864
|
+
var d2 = r4.getRect(i4);
|
865
|
+
if (d2 && "center" === c2) {
|
866
|
+
var h2 = d2.left + d2.width / 2, v2 = d2.top + d2.height / 2;
|
867
|
+
s2 = h2 >= a2.left && h2 <= a2.right && v2 >= a2.top && v2 <= a2.bottom;
|
868
|
+
}
|
869
|
+
if (d2 && w.number(c2)) {
|
870
|
+
s2 = Math.max(0, Math.min(a2.right, d2.right) - Math.max(a2.left, d2.left)) * Math.max(0, Math.min(a2.bottom, d2.bottom) - Math.max(a2.top, d2.top)) / (d2.width * d2.height) >= c2;
|
871
|
+
}
|
872
|
+
t4.options.drop.checker && (s2 = t4.options.drop.checker(e4, n4, s2, t4, o3, r4, i4));
|
873
|
+
return s2;
|
874
|
+
}(this, t3, e3, n3, r3, i3, o2);
|
875
|
+
}, n2.dynamicDrop = function(e3) {
|
876
|
+
return w.bool(e3) ? (t2.dynamicDrop = e3, n2) : t2.dynamicDrop;
|
877
|
+
}, V(e2.phaselessTypes, { dragenter: true, dragleave: true, dropactivate: true, dropdeactivate: true, dropmove: true, drop: true }), e2.methodDict.drop = "dropzone", t2.dynamicDrop = false, i2.actions.drop = Ot.defaults;
|
878
|
+
}, listeners: { "interactions:before-action-start": function(t2) {
|
879
|
+
var e2 = t2.interaction;
|
880
|
+
"drag" === e2.prepared.name && (e2.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
|
881
|
+
}, "interactions:after-action-start": function(t2, e2) {
|
882
|
+
var n2 = t2.interaction, r2 = (t2.event, t2.iEvent);
|
883
|
+
if ("drag" === n2.prepared.name) {
|
884
|
+
var i2 = n2.dropState;
|
885
|
+
i2.activeDrops = [], i2.events = {}, i2.activeDrops = Et(e2, n2.element), i2.events = St(n2, 0, r2), i2.events.activate && (wt(i2.activeDrops, i2.events.activate), e2.fire("actions/drop:start", { interaction: n2, dragEvent: r2 }));
|
886
|
+
}
|
887
|
+
}, "interactions:action-move": Pt, "interactions:after-action-move": function(t2, e2) {
|
888
|
+
var n2 = t2.interaction, r2 = t2.iEvent;
|
889
|
+
if ("drag" === n2.prepared.name) {
|
890
|
+
var i2 = n2.dropState;
|
891
|
+
_t(n2, i2.events), e2.fire("actions/drop:move", { interaction: n2, dragEvent: r2 }), i2.events = {};
|
892
|
+
}
|
893
|
+
}, "interactions:action-end": function(t2, e2) {
|
894
|
+
if ("drag" === t2.interaction.prepared.name) {
|
895
|
+
var n2 = t2.interaction, r2 = t2.iEvent;
|
896
|
+
Pt(t2, e2), _t(n2, n2.dropState.events), e2.fire("actions/drop:end", { interaction: n2, dragEvent: r2 });
|
897
|
+
}
|
898
|
+
}, "interactions:stop": function(t2) {
|
899
|
+
var e2 = t2.interaction;
|
900
|
+
if ("drag" === e2.prepared.name) {
|
901
|
+
var n2 = e2.dropState;
|
902
|
+
n2 && (n2.activeDrops = null, n2.events = null, n2.cur.dropzone = null, n2.cur.element = null, n2.prev.dropzone = null, n2.prev.element = null, n2.rejected = false);
|
903
|
+
}
|
904
|
+
} }, getActiveDrops: Et, getDrop: Tt, getDropEvents: St, fireDropEvents: _t, filterEventType: function(t2) {
|
905
|
+
return 0 === t2.search("drag") || 0 === t2.search("drop");
|
906
|
+
}, defaults: { enabled: false, accept: null, overlap: "pointer" } }, kt = Ot;
|
907
|
+
function Dt(t2) {
|
908
|
+
var e2 = t2.interaction, n2 = t2.iEvent, r2 = t2.phase;
|
909
|
+
if ("gesture" === e2.prepared.name) {
|
910
|
+
var i2 = e2.pointers.map(function(t3) {
|
911
|
+
return t3.pointer;
|
912
|
+
}), o2 = "start" === r2, a2 = "end" === r2, s2 = e2.interactable.options.deltaSource;
|
913
|
+
if (n2.touches = [i2[0], i2[1]], o2)
|
914
|
+
n2.distance = pt(i2, s2), n2.box = ut(i2), n2.scale = 1, n2.ds = 0, n2.angle = ft(i2, s2), n2.da = 0, e2.gesture.startDistance = n2.distance, e2.gesture.startAngle = n2.angle;
|
915
|
+
else if (a2 || e2.pointers.length < 2) {
|
916
|
+
var c2 = e2.prevEvent;
|
917
|
+
n2.distance = c2.distance, n2.box = c2.box, n2.scale = c2.scale, n2.ds = 0, n2.angle = c2.angle, n2.da = 0;
|
918
|
+
} else
|
919
|
+
n2.distance = pt(i2, s2), n2.box = ut(i2), n2.scale = n2.distance / e2.gesture.startDistance, n2.angle = ft(i2, s2), n2.ds = n2.scale - e2.gesture.scale, n2.da = n2.angle - e2.gesture.angle;
|
920
|
+
e2.gesture.distance = n2.distance, e2.gesture.angle = n2.angle, w.number(n2.scale) && n2.scale !== 1 / 0 && !isNaN(n2.scale) && (e2.gesture.scale = n2.scale);
|
921
|
+
}
|
922
|
+
}
|
923
|
+
var It = { id: "actions/gesture", before: ["actions/drag", "actions/resize"], install: function(t2) {
|
924
|
+
var e2 = t2.actions, n2 = t2.Interactable, r2 = t2.defaults;
|
925
|
+
n2.prototype.gesturable = function(t3) {
|
926
|
+
return w.object(t3) ? (this.options.gesture.enabled = false !== t3.enabled, this.setPerAction("gesture", t3), this.setOnEvents("gesture", t3), this) : w.bool(t3) ? (this.options.gesture.enabled = t3, this) : this.options.gesture;
|
927
|
+
}, e2.map.gesture = It, e2.methodDict.gesture = "gesturable", r2.actions.gesture = It.defaults;
|
928
|
+
}, listeners: { "interactions:action-start": Dt, "interactions:action-move": Dt, "interactions:action-end": Dt, "interactions:new": function(t2) {
|
929
|
+
t2.interaction.gesture = { angle: 0, distance: 0, scale: 1, startAngle: 0, startDistance: 0 };
|
930
|
+
}, "auto-start:check": function(t2) {
|
931
|
+
if (!(t2.interaction.pointers.length < 2)) {
|
932
|
+
var e2 = t2.interactable.options.gesture;
|
933
|
+
if (e2 && e2.enabled)
|
934
|
+
return t2.action = { name: "gesture" }, false;
|
935
|
+
}
|
936
|
+
} }, defaults: {}, getCursor: function() {
|
937
|
+
return "";
|
938
|
+
}, filterEventType: function(t2) {
|
939
|
+
return 0 === t2.search("gesture");
|
940
|
+
} }, Mt = It;
|
941
|
+
function zt(t2, e2, n2, r2, i2, o2, a2) {
|
942
|
+
if (!e2)
|
943
|
+
return false;
|
944
|
+
if (true === e2) {
|
945
|
+
var s2 = w.number(o2.width) ? o2.width : o2.right - o2.left, c2 = w.number(o2.height) ? o2.height : o2.bottom - o2.top;
|
946
|
+
if (a2 = Math.min(a2, Math.abs(("left" === t2 || "right" === t2 ? s2 : c2) / 2)), s2 < 0 && ("left" === t2 ? t2 = "right" : "right" === t2 && (t2 = "left")), c2 < 0 && ("top" === t2 ? t2 = "bottom" : "bottom" === t2 && (t2 = "top")), "left" === t2) {
|
947
|
+
var l2 = s2 >= 0 ? o2.left : o2.right;
|
948
|
+
return n2.x < l2 + a2;
|
949
|
+
}
|
950
|
+
if ("top" === t2) {
|
951
|
+
var u2 = c2 >= 0 ? o2.top : o2.bottom;
|
952
|
+
return n2.y < u2 + a2;
|
953
|
+
}
|
954
|
+
if ("right" === t2)
|
955
|
+
return n2.x > (s2 >= 0 ? o2.right : o2.left) - a2;
|
956
|
+
if ("bottom" === t2)
|
957
|
+
return n2.y > (c2 >= 0 ? o2.bottom : o2.top) - a2;
|
958
|
+
}
|
959
|
+
return !!w.element(r2) && (w.element(e2) ? e2 === r2 : F(r2, e2, i2));
|
960
|
+
}
|
961
|
+
function At(t2) {
|
962
|
+
var e2 = t2.iEvent, n2 = t2.interaction;
|
963
|
+
if ("resize" === n2.prepared.name && n2.resizeAxes) {
|
964
|
+
var r2 = e2;
|
965
|
+
n2.interactable.options.resize.square ? ("y" === n2.resizeAxes ? r2.delta.x = r2.delta.y : r2.delta.y = r2.delta.x, r2.axes = "xy") : (r2.axes = n2.resizeAxes, "x" === n2.resizeAxes ? r2.delta.y = 0 : "y" === n2.resizeAxes && (r2.delta.x = 0));
|
966
|
+
}
|
967
|
+
}
|
968
|
+
var Rt, Ct, jt = { id: "actions/resize", before: ["actions/drag"], install: function(t2) {
|
969
|
+
var e2 = t2.actions, n2 = t2.browser, r2 = t2.Interactable, i2 = t2.defaults;
|
970
|
+
jt.cursors = function(t3) {
|
971
|
+
return t3.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" };
|
972
|
+
}(n2), jt.defaultMargin = n2.supportsTouch || n2.supportsPointerEvent ? 20 : 10, r2.prototype.resizable = function(e3) {
|
973
|
+
return function(t3, e4, n3) {
|
974
|
+
if (w.object(e4))
|
975
|
+
return t3.options.resize.enabled = false !== e4.enabled, t3.setPerAction("resize", e4), t3.setOnEvents("resize", e4), w.string(e4.axis) && /^x$|^y$|^xy$/.test(e4.axis) ? t3.options.resize.axis = e4.axis : null === e4.axis && (t3.options.resize.axis = n3.defaults.actions.resize.axis), w.bool(e4.preserveAspectRatio) ? t3.options.resize.preserveAspectRatio = e4.preserveAspectRatio : w.bool(e4.square) && (t3.options.resize.square = e4.square), t3;
|
976
|
+
if (w.bool(e4))
|
977
|
+
return t3.options.resize.enabled = e4, t3;
|
978
|
+
return t3.options.resize;
|
979
|
+
}(this, e3, t2);
|
980
|
+
}, e2.map.resize = jt, e2.methodDict.resize = "resizable", i2.actions.resize = jt.defaults;
|
981
|
+
}, listeners: { "interactions:new": function(t2) {
|
982
|
+
t2.interaction.resizeAxes = "xy";
|
983
|
+
}, "interactions:action-start": function(t2) {
|
984
|
+
!function(t3) {
|
985
|
+
var e2 = t3.iEvent, n2 = t3.interaction;
|
986
|
+
if ("resize" === n2.prepared.name && n2.prepared.edges) {
|
987
|
+
var r2 = e2, i2 = n2.rect;
|
988
|
+
n2._rects = { start: V({}, i2), corrected: V({}, i2), previous: V({}, i2), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, r2.edges = n2.prepared.edges, r2.rect = n2._rects.corrected, r2.deltaRect = n2._rects.delta;
|
989
|
+
}
|
990
|
+
}(t2), At(t2);
|
991
|
+
}, "interactions:action-move": function(t2) {
|
992
|
+
!function(t3) {
|
993
|
+
var e2 = t3.iEvent, n2 = t3.interaction;
|
994
|
+
if ("resize" === n2.prepared.name && n2.prepared.edges) {
|
995
|
+
var r2 = e2, i2 = n2.interactable.options.resize.invert, o2 = "reposition" === i2 || "negate" === i2, a2 = n2.rect, s2 = n2._rects, c2 = s2.start, l2 = s2.corrected, u2 = s2.delta, p2 = s2.previous;
|
996
|
+
if (V(p2, l2), o2) {
|
997
|
+
if (V(l2, a2), "reposition" === i2) {
|
998
|
+
if (l2.top > l2.bottom) {
|
999
|
+
var f2 = l2.top;
|
1000
|
+
l2.top = l2.bottom, l2.bottom = f2;
|
1001
|
+
}
|
1002
|
+
if (l2.left > l2.right) {
|
1003
|
+
var d2 = l2.left;
|
1004
|
+
l2.left = l2.right, l2.right = d2;
|
1005
|
+
}
|
1006
|
+
}
|
1007
|
+
} else
|
1008
|
+
l2.top = Math.min(a2.top, c2.bottom), l2.bottom = Math.max(a2.bottom, c2.top), l2.left = Math.min(a2.left, c2.right), l2.right = Math.max(a2.right, c2.left);
|
1009
|
+
for (var h2 in l2.width = l2.right - l2.left, l2.height = l2.bottom - l2.top, l2)
|
1010
|
+
u2[h2] = l2[h2] - p2[h2];
|
1011
|
+
r2.edges = n2.prepared.edges, r2.rect = l2, r2.deltaRect = u2;
|
1012
|
+
}
|
1013
|
+
}(t2), At(t2);
|
1014
|
+
}, "interactions:action-end": function(t2) {
|
1015
|
+
var e2 = t2.iEvent, n2 = t2.interaction;
|
1016
|
+
if ("resize" === n2.prepared.name && n2.prepared.edges) {
|
1017
|
+
var r2 = e2;
|
1018
|
+
r2.edges = n2.prepared.edges, r2.rect = n2._rects.corrected, r2.deltaRect = n2._rects.delta;
|
1019
|
+
}
|
1020
|
+
}, "auto-start:check": function(t2) {
|
1021
|
+
var e2 = t2.interaction, n2 = t2.interactable, r2 = t2.element, i2 = t2.rect, o2 = t2.buttons;
|
1022
|
+
if (i2) {
|
1023
|
+
var a2 = V({}, e2.coords.cur.page), s2 = n2.options.resize;
|
1024
|
+
if (s2 && s2.enabled && (!e2.pointerIsDown || !/mouse|pointer/.test(e2.pointerType) || 0 != (o2 & s2.mouseButtons))) {
|
1025
|
+
if (w.object(s2.edges)) {
|
1026
|
+
var c2 = { left: false, right: false, top: false, bottom: false };
|
1027
|
+
for (var l2 in c2)
|
1028
|
+
c2[l2] = zt(l2, s2.edges[l2], a2, e2._latestPointer.eventTarget, r2, i2, s2.margin || jt.defaultMargin);
|
1029
|
+
c2.left = c2.left && !c2.right, c2.top = c2.top && !c2.bottom, (c2.left || c2.right || c2.top || c2.bottom) && (t2.action = { name: "resize", edges: c2 });
|
1030
|
+
} else {
|
1031
|
+
var u2 = "y" !== s2.axis && a2.x > i2.right - jt.defaultMargin, p2 = "x" !== s2.axis && a2.y > i2.bottom - jt.defaultMargin;
|
1032
|
+
(u2 || p2) && (t2.action = { name: "resize", axes: (u2 ? "x" : "") + (p2 ? "y" : "") });
|
1033
|
+
}
|
1034
|
+
return !t2.action && void 0;
|
1035
|
+
}
|
1036
|
+
}
|
1037
|
+
} }, defaults: { square: false, preserveAspectRatio: false, axis: "xy", margin: NaN, edges: null, invert: "none" }, cursors: null, getCursor: function(t2) {
|
1038
|
+
var e2 = t2.edges, n2 = t2.axis, r2 = t2.name, i2 = jt.cursors, o2 = null;
|
1039
|
+
if (n2)
|
1040
|
+
o2 = i2[r2 + n2];
|
1041
|
+
else if (e2) {
|
1042
|
+
for (var a2 = "", s2 = 0, c2 = ["top", "bottom", "left", "right"]; s2 < c2.length; s2++) {
|
1043
|
+
var l2 = c2[s2];
|
1044
|
+
e2[l2] && (a2 += l2);
|
1045
|
+
}
|
1046
|
+
o2 = i2[a2];
|
1047
|
+
}
|
1048
|
+
return o2;
|
1049
|
+
}, filterEventType: function(t2) {
|
1050
|
+
return 0 === t2.search("resize");
|
1051
|
+
}, defaultMargin: null }, Ft = jt, Xt = { id: "actions", install: function(t2) {
|
1052
|
+
t2.usePlugin(Mt), t2.usePlugin(Ft), t2.usePlugin(_), t2.usePlugin(kt);
|
1053
|
+
} }, Yt = 0;
|
1054
|
+
var Lt = { request: function(t2) {
|
1055
|
+
return Rt(t2);
|
1056
|
+
}, cancel: function(t2) {
|
1057
|
+
return Ct(t2);
|
1058
|
+
}, init: function(t2) {
|
1059
|
+
if (Rt = t2.requestAnimationFrame, Ct = t2.cancelAnimationFrame, !Rt)
|
1060
|
+
for (var e2 = ["ms", "moz", "webkit", "o"], n2 = 0; n2 < e2.length; n2++) {
|
1061
|
+
var r2 = e2[n2];
|
1062
|
+
Rt = t2["".concat(r2, "RequestAnimationFrame")], Ct = t2["".concat(r2, "CancelAnimationFrame")] || t2["".concat(r2, "CancelRequestAnimationFrame")];
|
1063
|
+
}
|
1064
|
+
Rt = Rt && Rt.bind(t2), Ct = Ct && Ct.bind(t2), Rt || (Rt = function(e3) {
|
1065
|
+
var n3 = Date.now(), r3 = Math.max(0, 16 - (n3 - Yt)), i2 = t2.setTimeout(function() {
|
1066
|
+
e3(n3 + r3);
|
1067
|
+
}, r3);
|
1068
|
+
return Yt = n3 + r3, i2;
|
1069
|
+
}, Ct = function(t3) {
|
1070
|
+
return clearTimeout(t3);
|
1071
|
+
});
|
1072
|
+
} };
|
1073
|
+
var qt = { defaults: { enabled: false, margin: 60, container: null, speed: 300 }, now: Date.now, interaction: null, i: 0, x: 0, y: 0, isScrolling: false, prevTime: 0, margin: 0, speed: 0, start: function(t2) {
|
1074
|
+
qt.isScrolling = true, Lt.cancel(qt.i), t2.autoScroll = qt, qt.interaction = t2, qt.prevTime = qt.now(), qt.i = Lt.request(qt.scroll);
|
1075
|
+
}, stop: function() {
|
1076
|
+
qt.isScrolling = false, qt.interaction && (qt.interaction.autoScroll = null), Lt.cancel(qt.i);
|
1077
|
+
}, scroll: function() {
|
1078
|
+
var t2 = qt.interaction, e2 = t2.interactable, n2 = t2.element, r2 = t2.prepared.name, i2 = e2.options[r2].autoScroll, o2 = Bt(i2.container, e2, n2), a2 = qt.now(), s2 = (a2 - qt.prevTime) / 1e3, c2 = i2.speed * s2;
|
1079
|
+
if (c2 >= 1) {
|
1080
|
+
var l2 = { x: qt.x * c2, y: qt.y * c2 };
|
1081
|
+
if (l2.x || l2.y) {
|
1082
|
+
var u2 = Vt(o2);
|
1083
|
+
w.window(o2) ? o2.scrollBy(l2.x, l2.y) : o2 && (o2.scrollLeft += l2.x, o2.scrollTop += l2.y);
|
1084
|
+
var p2 = Vt(o2), f2 = { x: p2.x - u2.x, y: p2.y - u2.y };
|
1085
|
+
(f2.x || f2.y) && e2.fire({ type: "autoscroll", target: n2, interactable: e2, delta: f2, interaction: t2, container: o2 });
|
1086
|
+
}
|
1087
|
+
qt.prevTime = a2;
|
1088
|
+
}
|
1089
|
+
qt.isScrolling && (Lt.cancel(qt.i), qt.i = Lt.request(qt.scroll));
|
1090
|
+
}, check: function(t2, e2) {
|
1091
|
+
var n2;
|
1092
|
+
return null == (n2 = t2.options[e2].autoScroll) ? void 0 : n2.enabled;
|
1093
|
+
}, onInteractionMove: function(t2) {
|
1094
|
+
var e2 = t2.interaction, n2 = t2.pointer;
|
1095
|
+
if (e2.interacting() && qt.check(e2.interactable, e2.prepared.name))
|
1096
|
+
if (e2.simulation)
|
1097
|
+
qt.x = qt.y = 0;
|
1098
|
+
else {
|
1099
|
+
var r2, i2, o2, a2, s2 = e2.interactable, c2 = e2.element, l2 = e2.prepared.name, u2 = s2.options[l2].autoScroll, p2 = Bt(u2.container, s2, c2);
|
1100
|
+
if (w.window(p2))
|
1101
|
+
a2 = n2.clientX < qt.margin, r2 = n2.clientY < qt.margin, i2 = n2.clientX > p2.innerWidth - qt.margin, o2 = n2.clientY > p2.innerHeight - qt.margin;
|
1102
|
+
else {
|
1103
|
+
var f2 = Y(p2);
|
1104
|
+
a2 = n2.clientX < f2.left + qt.margin, r2 = n2.clientY < f2.top + qt.margin, i2 = n2.clientX > f2.right - qt.margin, o2 = n2.clientY > f2.bottom - qt.margin;
|
1105
|
+
}
|
1106
|
+
qt.x = i2 ? 1 : a2 ? -1 : 0, qt.y = o2 ? 1 : r2 ? -1 : 0, qt.isScrolling || (qt.margin = u2.margin, qt.speed = u2.speed, qt.start(e2));
|
1107
|
+
}
|
1108
|
+
} };
|
1109
|
+
function Bt(t2, e2, n2) {
|
1110
|
+
return (w.string(t2) ? W(t2, e2, n2) : t2) || y(n2);
|
1111
|
+
}
|
1112
|
+
function Vt(t2) {
|
1113
|
+
return w.window(t2) && (t2 = window.document.body), { x: t2.scrollLeft, y: t2.scrollTop };
|
1114
|
+
}
|
1115
|
+
var Wt = { id: "auto-scroll", install: function(t2) {
|
1116
|
+
var e2 = t2.defaults, n2 = t2.actions;
|
1117
|
+
t2.autoScroll = qt, qt.now = function() {
|
1118
|
+
return t2.now();
|
1119
|
+
}, n2.phaselessTypes.autoscroll = true, e2.perAction.autoScroll = qt.defaults;
|
1120
|
+
}, listeners: { "interactions:new": function(t2) {
|
1121
|
+
t2.interaction.autoScroll = null;
|
1122
|
+
}, "interactions:destroy": function(t2) {
|
1123
|
+
t2.interaction.autoScroll = null, qt.stop(), qt.interaction && (qt.interaction = null);
|
1124
|
+
}, "interactions:stop": qt.stop, "interactions:action-move": function(t2) {
|
1125
|
+
return qt.onInteractionMove(t2);
|
1126
|
+
} } }, Gt = Wt;
|
1127
|
+
function Nt(t2, e2) {
|
1128
|
+
var n2 = false;
|
1129
|
+
return function() {
|
1130
|
+
return n2 || (g.console.warn(e2), n2 = true), t2.apply(this, arguments);
|
1131
|
+
};
|
1132
|
+
}
|
1133
|
+
function Ut(t2, e2) {
|
1134
|
+
return t2.name = e2.name, t2.axis = e2.axis, t2.edges = e2.edges, t2;
|
1135
|
+
}
|
1136
|
+
function Ht(t2) {
|
1137
|
+
return w.bool(t2) ? (this.options.styleCursor = t2, this) : null === t2 ? (delete this.options.styleCursor, this) : this.options.styleCursor;
|
1138
|
+
}
|
1139
|
+
function Kt(t2) {
|
1140
|
+
return w.func(t2) ? (this.options.actionChecker = t2, this) : null === t2 ? (delete this.options.actionChecker, this) : this.options.actionChecker;
|
1141
|
+
}
|
1142
|
+
var $t = { id: "auto-start/interactableMethods", install: function(t2) {
|
1143
|
+
var e2 = t2.Interactable;
|
1144
|
+
e2.prototype.getAction = function(e3, n2, r2, i2) {
|
1145
|
+
var o2 = function(t3, e4, n3, r3, i3) {
|
1146
|
+
var o3 = t3.getRect(r3), a2 = e4.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[e4.button], s2 = { action: null, interactable: t3, interaction: n3, element: r3, rect: o3, buttons: a2 };
|
1147
|
+
return i3.fire("auto-start:check", s2), s2.action;
|
1148
|
+
}(this, n2, r2, i2, t2);
|
1149
|
+
return this.options.actionChecker ? this.options.actionChecker(e3, n2, o2, this, i2, r2) : o2;
|
1150
|
+
}, e2.prototype.ignoreFrom = Nt(function(t3) {
|
1151
|
+
return this._backCompatOption("ignoreFrom", t3);
|
1152
|
+
}, "Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."), e2.prototype.allowFrom = Nt(function(t3) {
|
1153
|
+
return this._backCompatOption("allowFrom", t3);
|
1154
|
+
}, "Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."), e2.prototype.actionChecker = Kt, e2.prototype.styleCursor = Ht;
|
1155
|
+
} };
|
1156
|
+
function Jt(t2, e2, n2, r2, i2) {
|
1157
|
+
return e2.testIgnoreAllow(e2.options[t2.name], n2, r2) && e2.options[t2.name].enabled && ee(e2, n2, t2, i2) ? t2 : null;
|
1158
|
+
}
|
1159
|
+
function Qt(t2, e2, n2, r2, i2, o2, a2) {
|
1160
|
+
for (var s2 = 0, c2 = r2.length; s2 < c2; s2++) {
|
1161
|
+
var l2 = r2[s2], u2 = i2[s2], p2 = l2.getAction(e2, n2, t2, u2);
|
1162
|
+
if (p2) {
|
1163
|
+
var f2 = Jt(p2, l2, u2, o2, a2);
|
1164
|
+
if (f2)
|
1165
|
+
return { action: f2, interactable: l2, element: u2 };
|
1166
|
+
}
|
1167
|
+
}
|
1168
|
+
return { action: null, interactable: null, element: null };
|
1169
|
+
}
|
1170
|
+
function Zt(t2, e2, n2, r2, i2) {
|
1171
|
+
var o2 = [], a2 = [], s2 = r2;
|
1172
|
+
function c2(t3) {
|
1173
|
+
o2.push(t3), a2.push(s2);
|
1174
|
+
}
|
1175
|
+
for (; w.element(s2); ) {
|
1176
|
+
o2 = [], a2 = [], i2.interactables.forEachMatch(s2, c2);
|
1177
|
+
var l2 = Qt(t2, e2, n2, o2, a2, r2, i2);
|
1178
|
+
if (l2.action && !l2.interactable.options[l2.action.name].manualStart)
|
1179
|
+
return l2;
|
1180
|
+
s2 = A(s2);
|
1181
|
+
}
|
1182
|
+
return { action: null, interactable: null, element: null };
|
1183
|
+
}
|
1184
|
+
function te(t2, e2, n2) {
|
1185
|
+
var r2 = e2.action, i2 = e2.interactable, o2 = e2.element;
|
1186
|
+
r2 = r2 || { name: null }, t2.interactable = i2, t2.element = o2, Ut(t2.prepared, r2), t2.rect = i2 && r2.name ? i2.getRect(o2) : null, ie(t2, n2), n2.fire("autoStart:prepared", { interaction: t2 });
|
1187
|
+
}
|
1188
|
+
function ee(t2, e2, n2, r2) {
|
1189
|
+
var i2 = t2.options, o2 = i2[n2.name].max, a2 = i2[n2.name].maxPerElement, s2 = r2.autoStart.maxInteractions, c2 = 0, l2 = 0, u2 = 0;
|
1190
|
+
if (!(o2 && a2 && s2))
|
1191
|
+
return false;
|
1192
|
+
for (var p2 = 0, f2 = r2.interactions.list; p2 < f2.length; p2++) {
|
1193
|
+
var d2 = f2[p2], h2 = d2.prepared.name;
|
1194
|
+
if (d2.interacting()) {
|
1195
|
+
if (++c2 >= s2)
|
1196
|
+
return false;
|
1197
|
+
if (d2.interactable === t2) {
|
1198
|
+
if ((l2 += h2 === n2.name ? 1 : 0) >= o2)
|
1199
|
+
return false;
|
1200
|
+
if (d2.element === e2 && (u2++, h2 === n2.name && u2 >= a2))
|
1201
|
+
return false;
|
1202
|
+
}
|
1203
|
+
}
|
1204
|
+
}
|
1205
|
+
return s2 > 0;
|
1206
|
+
}
|
1207
|
+
function ne(t2, e2) {
|
1208
|
+
return w.number(t2) ? (e2.autoStart.maxInteractions = t2, this) : e2.autoStart.maxInteractions;
|
1209
|
+
}
|
1210
|
+
function re(t2, e2, n2) {
|
1211
|
+
var r2 = n2.autoStart.cursorElement;
|
1212
|
+
r2 && r2 !== t2 && (r2.style.cursor = ""), t2.ownerDocument.documentElement.style.cursor = e2, t2.style.cursor = e2, n2.autoStart.cursorElement = e2 ? t2 : null;
|
1213
|
+
}
|
1214
|
+
function ie(t2, e2) {
|
1215
|
+
var n2 = t2.interactable, r2 = t2.element, i2 = t2.prepared;
|
1216
|
+
if ("mouse" === t2.pointerType && n2 && n2.options.styleCursor) {
|
1217
|
+
var o2 = "";
|
1218
|
+
if (i2.name) {
|
1219
|
+
var a2 = n2.options[i2.name].cursorChecker;
|
1220
|
+
o2 = w.func(a2) ? a2(i2, n2, r2, t2._interacting) : e2.actions.map[i2.name].getCursor(i2);
|
1221
|
+
}
|
1222
|
+
re(t2.element, o2 || "", e2);
|
1223
|
+
} else
|
1224
|
+
e2.autoStart.cursorElement && re(e2.autoStart.cursorElement, "", e2);
|
1225
|
+
}
|
1226
|
+
var oe = { id: "auto-start/base", before: ["actions"], install: function(t2) {
|
1227
|
+
var e2 = t2.interactStatic, n2 = t2.defaults;
|
1228
|
+
t2.usePlugin($t), n2.base.actionChecker = null, n2.base.styleCursor = true, V(n2.perAction, { manualStart: false, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e2.maxInteractions = function(e3) {
|
1229
|
+
return ne(e3, t2);
|
1230
|
+
}, t2.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: ee, cursorElement: null };
|
1231
|
+
}, listeners: { "interactions:down": function(t2, e2) {
|
1232
|
+
var n2 = t2.interaction, r2 = t2.pointer, i2 = t2.event, o2 = t2.eventTarget;
|
1233
|
+
n2.interacting() || te(n2, Zt(n2, r2, i2, o2, e2), e2);
|
1234
|
+
}, "interactions:move": function(t2, e2) {
|
1235
|
+
!function(t3, e3) {
|
1236
|
+
var n2 = t3.interaction, r2 = t3.pointer, i2 = t3.event, o2 = t3.eventTarget;
|
1237
|
+
"mouse" !== n2.pointerType || n2.pointerIsDown || n2.interacting() || te(n2, Zt(n2, r2, i2, o2, e3), e3);
|
1238
|
+
}(t2, e2), function(t3, e3) {
|
1239
|
+
var n2 = t3.interaction;
|
1240
|
+
if (n2.pointerIsDown && !n2.interacting() && n2.pointerWasMoved && n2.prepared.name) {
|
1241
|
+
e3.fire("autoStart:before-start", t3);
|
1242
|
+
var r2 = n2.interactable, i2 = n2.prepared.name;
|
1243
|
+
i2 && r2 && (r2.options[i2].manualStart || !ee(r2, n2.element, n2.prepared, e3) ? n2.stop() : (n2.start(n2.prepared, r2, n2.element), ie(n2, e3)));
|
1244
|
+
}
|
1245
|
+
}(t2, e2);
|
1246
|
+
}, "interactions:stop": function(t2, e2) {
|
1247
|
+
var n2 = t2.interaction, r2 = n2.interactable;
|
1248
|
+
r2 && r2.options.styleCursor && re(n2.element, "", e2);
|
1249
|
+
} }, maxInteractions: ne, withinInteractionLimit: ee, validateAction: Jt }, ae = oe;
|
1250
|
+
var se = { id: "auto-start/dragAxis", listeners: { "autoStart:before-start": function(t2, e2) {
|
1251
|
+
var n2 = t2.interaction, r2 = t2.eventTarget, i2 = t2.dx, o2 = t2.dy;
|
1252
|
+
if ("drag" === n2.prepared.name) {
|
1253
|
+
var a2 = Math.abs(i2), s2 = Math.abs(o2), c2 = n2.interactable.options.drag, l2 = c2.startAxis, u2 = a2 > s2 ? "x" : a2 < s2 ? "y" : "xy";
|
1254
|
+
if (n2.prepared.axis = "start" === c2.lockAxis ? u2[0] : c2.lockAxis, "xy" !== u2 && "xy" !== l2 && l2 !== u2) {
|
1255
|
+
n2.prepared.name = null;
|
1256
|
+
for (var p2 = r2, f2 = function(t3) {
|
1257
|
+
if (t3 !== n2.interactable) {
|
1258
|
+
var i3 = n2.interactable.options.drag;
|
1259
|
+
if (!i3.manualStart && t3.testIgnoreAllow(i3, p2, r2)) {
|
1260
|
+
var o3 = t3.getAction(n2.downPointer, n2.downEvent, n2, p2);
|
1261
|
+
if (o3 && "drag" === o3.name && function(t4, e3) {
|
1262
|
+
if (!e3)
|
1263
|
+
return false;
|
1264
|
+
var n3 = e3.options.drag.startAxis;
|
1265
|
+
return "xy" === t4 || "xy" === n3 || n3 === t4;
|
1266
|
+
}(u2, t3) && ae.validateAction(o3, t3, p2, r2, e2))
|
1267
|
+
return t3;
|
1268
|
+
}
|
1269
|
+
}
|
1270
|
+
}; w.element(p2); ) {
|
1271
|
+
var d2 = e2.interactables.forEachMatch(p2, f2);
|
1272
|
+
if (d2) {
|
1273
|
+
n2.prepared.name = "drag", n2.interactable = d2, n2.element = p2;
|
1274
|
+
break;
|
1275
|
+
}
|
1276
|
+
p2 = A(p2);
|
1277
|
+
}
|
1278
|
+
}
|
1279
|
+
}
|
1280
|
+
} } };
|
1281
|
+
function ce(t2) {
|
1282
|
+
var e2 = t2.prepared && t2.prepared.name;
|
1283
|
+
if (!e2)
|
1284
|
+
return null;
|
1285
|
+
var n2 = t2.interactable.options;
|
1286
|
+
return n2[e2].hold || n2[e2].delay;
|
1287
|
+
}
|
1288
|
+
var le = { id: "auto-start/hold", install: function(t2) {
|
1289
|
+
var e2 = t2.defaults;
|
1290
|
+
t2.usePlugin(ae), e2.perAction.hold = 0, e2.perAction.delay = 0;
|
1291
|
+
}, listeners: { "interactions:new": function(t2) {
|
1292
|
+
t2.interaction.autoStartHoldTimer = null;
|
1293
|
+
}, "autoStart:prepared": function(t2) {
|
1294
|
+
var e2 = t2.interaction, n2 = ce(e2);
|
1295
|
+
n2 > 0 && (e2.autoStartHoldTimer = setTimeout(function() {
|
1296
|
+
e2.start(e2.prepared, e2.interactable, e2.element);
|
1297
|
+
}, n2));
|
1298
|
+
}, "interactions:move": function(t2) {
|
1299
|
+
var e2 = t2.interaction, n2 = t2.duplicate;
|
1300
|
+
e2.autoStartHoldTimer && e2.pointerWasMoved && !n2 && (clearTimeout(e2.autoStartHoldTimer), e2.autoStartHoldTimer = null);
|
1301
|
+
}, "autoStart:before-start": function(t2) {
|
1302
|
+
var e2 = t2.interaction;
|
1303
|
+
ce(e2) > 0 && (e2.prepared.name = null);
|
1304
|
+
} }, getHoldDuration: ce }, ue = le, pe = { id: "auto-start", install: function(t2) {
|
1305
|
+
t2.usePlugin(ae), t2.usePlugin(ue), t2.usePlugin(se);
|
1306
|
+
} }, fe = function(t2) {
|
1307
|
+
return /^(always|never|auto)$/.test(t2) ? (this.options.preventDefault = t2, this) : w.bool(t2) ? (this.options.preventDefault = t2 ? "always" : "never", this) : this.options.preventDefault;
|
1308
|
+
};
|
1309
|
+
function de(t2) {
|
1310
|
+
var e2 = t2.interaction, n2 = t2.event;
|
1311
|
+
e2.interactable && e2.interactable.checkAndPreventDefault(n2);
|
1312
|
+
}
|
1313
|
+
var he = { id: "core/interactablePreventDefault", install: function(t2) {
|
1314
|
+
var e2 = t2.Interactable;
|
1315
|
+
e2.prototype.preventDefault = fe, e2.prototype.checkAndPreventDefault = function(e3) {
|
1316
|
+
return function(t3, e4, n2) {
|
1317
|
+
var r2 = t3.options.preventDefault;
|
1318
|
+
if ("never" !== r2)
|
1319
|
+
if ("always" !== r2) {
|
1320
|
+
if (e4.events.supportsPassive && /^touch(start|move)$/.test(n2.type)) {
|
1321
|
+
var i2 = y(n2.target).document, o2 = e4.getDocOptions(i2);
|
1322
|
+
if (!o2 || !o2.events || false !== o2.events.passive)
|
1323
|
+
return;
|
1324
|
+
}
|
1325
|
+
/^(mouse|pointer|touch)*(down|start)/i.test(n2.type) || w.element(n2.target) && R(n2.target, "input,select,textarea,[contenteditable=true],[contenteditable=true] *") || n2.preventDefault();
|
1326
|
+
} else
|
1327
|
+
n2.preventDefault();
|
1328
|
+
}(this, t2, e3);
|
1329
|
+
}, t2.interactions.docEvents.push({ type: "dragstart", listener: function(e3) {
|
1330
|
+
for (var n2 = 0, r2 = t2.interactions.list; n2 < r2.length; n2++) {
|
1331
|
+
var i2 = r2[n2];
|
1332
|
+
if (i2.element && (i2.element === e3.target || M(i2.element, e3.target)))
|
1333
|
+
return void i2.interactable.checkAndPreventDefault(e3);
|
1334
|
+
}
|
1335
|
+
} });
|
1336
|
+
}, listeners: ["down", "move", "up", "cancel"].reduce(function(t2, e2) {
|
1337
|
+
return t2["interactions:".concat(e2)] = de, t2;
|
1338
|
+
}, {}) };
|
1339
|
+
function ve(t2, e2) {
|
1340
|
+
if (e2.phaselessTypes[t2])
|
1341
|
+
return true;
|
1342
|
+
for (var n2 in e2.map)
|
1343
|
+
if (0 === t2.indexOf(n2) && t2.substr(n2.length) in e2.phases)
|
1344
|
+
return true;
|
1345
|
+
return false;
|
1346
|
+
}
|
1347
|
+
function ge(t2) {
|
1348
|
+
var e2 = {};
|
1349
|
+
for (var n2 in t2) {
|
1350
|
+
var r2 = t2[n2];
|
1351
|
+
w.plainObject(r2) ? e2[n2] = ge(r2) : w.array(r2) ? e2[n2] = mt(r2) : e2[n2] = r2;
|
1352
|
+
}
|
1353
|
+
return e2;
|
1354
|
+
}
|
1355
|
+
var me = function() {
|
1356
|
+
function t2(e2) {
|
1357
|
+
r(this, t2), 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 = e2, this.result = ye(), this.edges = { left: false, right: false, top: false, bottom: false };
|
1358
|
+
}
|
1359
|
+
return o(t2, [{ key: "start", value: function(t3, e2) {
|
1360
|
+
var n2, r2, i2 = t3.phase, o2 = this.interaction, a2 = function(t4) {
|
1361
|
+
var e3 = t4.interactable.options[t4.prepared.name], n3 = e3.modifiers;
|
1362
|
+
if (n3 && n3.length)
|
1363
|
+
return n3;
|
1364
|
+
return ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map(function(t5) {
|
1365
|
+
var n4 = e3[t5];
|
1366
|
+
return n4 && n4.enabled && { options: n4, methods: n4._methods };
|
1367
|
+
}).filter(function(t5) {
|
1368
|
+
return !!t5;
|
1369
|
+
});
|
1370
|
+
}(o2);
|
1371
|
+
this.prepareStates(a2), this.startEdges = V({}, o2.edges), this.edges = V({}, this.startEdges), this.startOffset = (n2 = o2.rect, r2 = e2, n2 ? { left: r2.x - n2.left, top: r2.y - n2.top, right: n2.right - r2.x, bottom: n2.bottom - r2.y } : { left: 0, top: 0, right: 0, bottom: 0 }), this.startDelta = { x: 0, y: 0 };
|
1372
|
+
var s2 = this.fillArg({ phase: i2, pageCoords: e2, preEnd: false });
|
1373
|
+
return this.result = ye(), this.startAll(s2), this.result = this.setAll(s2);
|
1374
|
+
} }, { key: "fillArg", value: function(t3) {
|
1375
|
+
var e2 = this.interaction;
|
1376
|
+
return t3.interaction = e2, t3.interactable = e2.interactable, t3.element = e2.element, t3.rect || (t3.rect = e2.rect), t3.edges || (t3.edges = this.startEdges), t3.startOffset = this.startOffset, t3;
|
1377
|
+
} }, { key: "startAll", value: function(t3) {
|
1378
|
+
for (var e2 = 0, n2 = this.states; e2 < n2.length; e2++) {
|
1379
|
+
var r2 = n2[e2];
|
1380
|
+
r2.methods.start && (t3.state = r2, r2.methods.start(t3));
|
1381
|
+
}
|
1382
|
+
} }, { key: "setAll", value: function(t3) {
|
1383
|
+
var e2 = t3.phase, n2 = t3.preEnd, r2 = t3.skipModifiers, i2 = t3.rect, o2 = t3.edges;
|
1384
|
+
t3.coords = V({}, t3.pageCoords), t3.rect = V({}, i2), t3.edges = V({}, o2);
|
1385
|
+
for (var a2 = r2 ? this.states.slice(r2) : this.states, s2 = ye(t3.coords, t3.rect), c2 = 0; c2 < a2.length; c2++) {
|
1386
|
+
var l2, u2 = a2[c2], p2 = u2.options, f2 = V({}, t3.coords), d2 = null;
|
1387
|
+
null != (l2 = u2.methods) && l2.set && this.shouldDo(p2, n2, e2) && (t3.state = u2, d2 = u2.methods.set(t3), H(t3.edges, t3.rect, { x: t3.coords.x - f2.x, y: t3.coords.y - f2.y })), s2.eventProps.push(d2);
|
1388
|
+
}
|
1389
|
+
V(this.edges, t3.edges), s2.delta.x = t3.coords.x - t3.pageCoords.x, s2.delta.y = t3.coords.y - t3.pageCoords.y, s2.rectDelta.left = t3.rect.left - i2.left, s2.rectDelta.right = t3.rect.right - i2.right, s2.rectDelta.top = t3.rect.top - i2.top, s2.rectDelta.bottom = t3.rect.bottom - i2.bottom;
|
1390
|
+
var h2 = this.result.coords, v2 = this.result.rect;
|
1391
|
+
if (h2 && v2) {
|
1392
|
+
var g2 = s2.rect.left !== v2.left || s2.rect.right !== v2.right || s2.rect.top !== v2.top || s2.rect.bottom !== v2.bottom;
|
1393
|
+
s2.changed = g2 || h2.x !== s2.coords.x || h2.y !== s2.coords.y;
|
1394
|
+
}
|
1395
|
+
return s2;
|
1396
|
+
} }, { key: "applyToInteraction", value: function(t3) {
|
1397
|
+
var e2 = this.interaction, n2 = t3.phase, r2 = e2.coords.cur, i2 = e2.coords.start, o2 = this.result, a2 = this.startDelta, s2 = o2.delta;
|
1398
|
+
"start" === n2 && V(this.startDelta, o2.delta);
|
1399
|
+
for (var c2 = 0, l2 = [[i2, a2], [r2, s2]]; c2 < l2.length; c2++) {
|
1400
|
+
var u2 = l2[c2], p2 = u2[0], f2 = u2[1];
|
1401
|
+
p2.page.x += f2.x, p2.page.y += f2.y, p2.client.x += f2.x, p2.client.y += f2.y;
|
1402
|
+
}
|
1403
|
+
var d2 = this.result.rectDelta, h2 = t3.rect || e2.rect;
|
1404
|
+
h2.left += d2.left, h2.right += d2.right, h2.top += d2.top, h2.bottom += d2.bottom, h2.width = h2.right - h2.left, h2.height = h2.bottom - h2.top;
|
1405
|
+
} }, { key: "setAndApply", value: function(t3) {
|
1406
|
+
var e2 = this.interaction, n2 = t3.phase, r2 = t3.preEnd, i2 = t3.skipModifiers, o2 = this.setAll(this.fillArg({ preEnd: r2, phase: n2, pageCoords: t3.modifiedCoords || e2.coords.cur.page }));
|
1407
|
+
if (this.result = o2, !o2.changed && (!i2 || i2 < this.states.length) && e2.interacting())
|
1408
|
+
return false;
|
1409
|
+
if (t3.modifiedCoords) {
|
1410
|
+
var a2 = e2.coords.cur.page, s2 = { x: t3.modifiedCoords.x - a2.x, y: t3.modifiedCoords.y - a2.y };
|
1411
|
+
o2.coords.x += s2.x, o2.coords.y += s2.y, o2.delta.x += s2.x, o2.delta.y += s2.y;
|
1412
|
+
}
|
1413
|
+
this.applyToInteraction(t3);
|
1414
|
+
} }, { key: "beforeEnd", value: function(t3) {
|
1415
|
+
var e2 = t3.interaction, n2 = t3.event, r2 = this.states;
|
1416
|
+
if (r2 && r2.length) {
|
1417
|
+
for (var i2 = false, o2 = 0; o2 < r2.length; o2++) {
|
1418
|
+
var a2 = r2[o2];
|
1419
|
+
t3.state = a2;
|
1420
|
+
var s2 = a2.options, c2 = a2.methods, l2 = c2.beforeEnd && c2.beforeEnd(t3);
|
1421
|
+
if (l2)
|
1422
|
+
return this.endResult = l2, false;
|
1423
|
+
i2 = i2 || !i2 && this.shouldDo(s2, true, t3.phase, true);
|
1424
|
+
}
|
1425
|
+
i2 && e2.move({ event: n2, preEnd: true });
|
1426
|
+
}
|
1427
|
+
} }, { key: "stop", value: function(t3) {
|
1428
|
+
var e2 = t3.interaction;
|
1429
|
+
if (this.states && this.states.length) {
|
1430
|
+
var n2 = V({ states: this.states, interactable: e2.interactable, element: e2.element, rect: null }, t3);
|
1431
|
+
this.fillArg(n2);
|
1432
|
+
for (var r2 = 0, i2 = this.states; r2 < i2.length; r2++) {
|
1433
|
+
var o2 = i2[r2];
|
1434
|
+
n2.state = o2, o2.methods.stop && o2.methods.stop(n2);
|
1435
|
+
}
|
1436
|
+
this.states = null, this.endResult = null;
|
1437
|
+
}
|
1438
|
+
} }, { key: "prepareStates", value: function(t3) {
|
1439
|
+
this.states = [];
|
1440
|
+
for (var e2 = 0; e2 < t3.length; e2++) {
|
1441
|
+
var n2 = t3[e2], r2 = n2.options, i2 = n2.methods, o2 = n2.name;
|
1442
|
+
this.states.push({ options: r2, methods: i2, index: e2, name: o2 });
|
1443
|
+
}
|
1444
|
+
return this.states;
|
1445
|
+
} }, { key: "restoreInteractionCoords", value: function(t3) {
|
1446
|
+
var e2 = t3.interaction, n2 = e2.coords, r2 = e2.rect, i2 = e2.modification;
|
1447
|
+
if (i2.result) {
|
1448
|
+
for (var o2 = i2.startDelta, a2 = i2.result, s2 = a2.delta, c2 = a2.rectDelta, l2 = 0, u2 = [[n2.start, o2], [n2.cur, s2]]; l2 < u2.length; l2++) {
|
1449
|
+
var p2 = u2[l2], f2 = p2[0], d2 = p2[1];
|
1450
|
+
f2.page.x -= d2.x, f2.page.y -= d2.y, f2.client.x -= d2.x, f2.client.y -= d2.y;
|
1451
|
+
}
|
1452
|
+
r2.left -= c2.left, r2.right -= c2.right, r2.top -= c2.top, r2.bottom -= c2.bottom;
|
1453
|
+
}
|
1454
|
+
} }, { key: "shouldDo", value: function(t3, e2, n2, r2) {
|
1455
|
+
return !(!t3 || false === t3.enabled || r2 && !t3.endOnly || t3.endOnly && !e2 || "start" === n2 && !t3.setStart);
|
1456
|
+
} }, { key: "copyFrom", value: function(t3) {
|
1457
|
+
this.startOffset = t3.startOffset, this.startDelta = t3.startDelta, this.startEdges = t3.startEdges, this.edges = t3.edges, this.states = t3.states.map(function(t4) {
|
1458
|
+
return ge(t4);
|
1459
|
+
}), this.result = ye(V({}, t3.result.coords), V({}, t3.result.rect));
|
1460
|
+
} }, { key: "destroy", value: function() {
|
1461
|
+
for (var t3 in this)
|
1462
|
+
this[t3] = null;
|
1463
|
+
} }]), t2;
|
1464
|
+
}();
|
1465
|
+
function ye(t2, e2) {
|
1466
|
+
return { rect: e2, coords: t2, delta: { x: 0, y: 0 }, rectDelta: { left: 0, right: 0, top: 0, bottom: 0 }, eventProps: [], changed: true };
|
1467
|
+
}
|
1468
|
+
function be(t2, e2) {
|
1469
|
+
var n2 = t2.defaults, r2 = { start: t2.start, set: t2.set, beforeEnd: t2.beforeEnd, stop: t2.stop }, i2 = function(t3) {
|
1470
|
+
var i3 = t3 || {};
|
1471
|
+
for (var o2 in i3.enabled = false !== i3.enabled, n2)
|
1472
|
+
o2 in i3 || (i3[o2] = n2[o2]);
|
1473
|
+
var a2 = { options: i3, methods: r2, name: e2, enable: function() {
|
1474
|
+
return i3.enabled = true, a2;
|
1475
|
+
}, disable: function() {
|
1476
|
+
return i3.enabled = false, a2;
|
1477
|
+
} };
|
1478
|
+
return a2;
|
1479
|
+
};
|
1480
|
+
return e2 && "string" == typeof e2 && (i2._defaults = n2, i2._methods = r2), i2;
|
1481
|
+
}
|
1482
|
+
function xe(t2) {
|
1483
|
+
var e2 = t2.iEvent, n2 = t2.interaction.modification.result;
|
1484
|
+
n2 && (e2.modifiers = n2.eventProps);
|
1485
|
+
}
|
1486
|
+
var we = { id: "modifiers/base", before: ["actions"], install: function(t2) {
|
1487
|
+
t2.defaults.perAction.modifiers = [];
|
1488
|
+
}, listeners: { "interactions:new": function(t2) {
|
1489
|
+
var e2 = t2.interaction;
|
1490
|
+
e2.modification = new me(e2);
|
1491
|
+
}, "interactions:before-action-start": function(t2) {
|
1492
|
+
var e2 = t2.interaction, n2 = t2.interaction.modification;
|
1493
|
+
n2.start(t2, e2.coords.start.page), e2.edges = n2.edges, n2.applyToInteraction(t2);
|
1494
|
+
}, "interactions:before-action-move": function(t2) {
|
1495
|
+
var e2 = t2.interaction, n2 = e2.modification, r2 = n2.setAndApply(t2);
|
1496
|
+
return e2.edges = n2.edges, r2;
|
1497
|
+
}, "interactions:before-action-end": function(t2) {
|
1498
|
+
var e2 = t2.interaction, n2 = e2.modification, r2 = n2.beforeEnd(t2);
|
1499
|
+
return e2.edges = n2.startEdges, r2;
|
1500
|
+
}, "interactions:action-start": xe, "interactions:action-move": xe, "interactions:action-end": xe, "interactions:after-action-start": function(t2) {
|
1501
|
+
return t2.interaction.modification.restoreInteractionCoords(t2);
|
1502
|
+
}, "interactions:after-action-move": function(t2) {
|
1503
|
+
return t2.interaction.modification.restoreInteractionCoords(t2);
|
1504
|
+
}, "interactions:stop": function(t2) {
|
1505
|
+
return t2.interaction.modification.stop(t2);
|
1506
|
+
} } }, Ee = we, Te = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: false, origin: { x: 0, y: 0 } }, actions: {} }, Se = function(t2) {
|
1507
|
+
s(n2, t2);
|
1508
|
+
var e2 = p(n2);
|
1509
|
+
function n2(t3, i2, o2, a2, s2, c2, l2) {
|
1510
|
+
var p2;
|
1511
|
+
r(this, n2), (p2 = e2.call(this, t3)).relatedTarget = null, p2.screenX = void 0, p2.screenY = void 0, p2.button = void 0, p2.buttons = void 0, p2.ctrlKey = void 0, p2.shiftKey = void 0, p2.altKey = void 0, p2.metaKey = void 0, p2.page = void 0, p2.client = void 0, p2.delta = void 0, p2.rect = void 0, p2.x0 = void 0, p2.y0 = void 0, p2.t0 = void 0, p2.dt = void 0, p2.duration = void 0, p2.clientX0 = void 0, p2.clientY0 = void 0, p2.velocity = void 0, p2.speed = void 0, p2.swipe = void 0, p2.axes = void 0, p2.preEnd = void 0, s2 = s2 || t3.element;
|
1512
|
+
var f2 = t3.interactable, d2 = (f2 && f2.options || Te).deltaSource, h2 = K(f2, s2, o2), v2 = "start" === a2, g2 = "end" === a2, m2 = v2 ? u(p2) : t3.prevEvent, y2 = v2 ? t3.coords.start : g2 ? { page: m2.page, client: m2.client, timeStamp: t3.coords.cur.timeStamp } : t3.coords.cur;
|
1513
|
+
return p2.page = V({}, y2.page), p2.client = V({}, y2.client), p2.rect = V({}, t3.rect), p2.timeStamp = y2.timeStamp, g2 || (p2.page.x -= h2.x, p2.page.y -= h2.y, p2.client.x -= h2.x, p2.client.y -= h2.y), p2.ctrlKey = i2.ctrlKey, p2.altKey = i2.altKey, p2.shiftKey = i2.shiftKey, p2.metaKey = i2.metaKey, p2.button = i2.button, p2.buttons = i2.buttons, p2.target = s2, p2.currentTarget = s2, p2.preEnd = c2, p2.type = l2 || o2 + (a2 || ""), p2.interactable = f2, p2.t0 = v2 ? t3.pointers[t3.pointers.length - 1].downTime : m2.t0, p2.x0 = t3.coords.start.page.x - h2.x, p2.y0 = t3.coords.start.page.y - h2.y, p2.clientX0 = t3.coords.start.client.x - h2.x, p2.clientY0 = t3.coords.start.client.y - h2.y, p2.delta = v2 || g2 ? { x: 0, y: 0 } : { x: p2[d2].x - m2[d2].x, y: p2[d2].y - m2[d2].y }, p2.dt = t3.coords.delta.timeStamp, p2.duration = p2.timeStamp - p2.t0, p2.velocity = V({}, t3.coords.velocity[d2]), p2.speed = Q(p2.velocity.x, p2.velocity.y), p2.swipe = g2 || "inertiastart" === a2 ? p2.getSwipe() : null, p2;
|
1514
|
+
}
|
1515
|
+
return o(n2, [{ key: "getSwipe", value: function() {
|
1516
|
+
var t3 = this._interaction;
|
1517
|
+
if (t3.prevEvent.speed < 600 || this.timeStamp - t3.prevEvent.timeStamp > 150)
|
1518
|
+
return null;
|
1519
|
+
var e3 = 180 * Math.atan2(t3.prevEvent.velocityY, t3.prevEvent.velocityX) / Math.PI;
|
1520
|
+
e3 < 0 && (e3 += 360);
|
1521
|
+
var n3 = 112.5 <= e3 && e3 < 247.5, r2 = 202.5 <= e3 && e3 < 337.5;
|
1522
|
+
return { up: r2, down: !r2 && 22.5 <= e3 && e3 < 157.5, left: n3, right: !n3 && (292.5 <= e3 || e3 < 67.5), angle: e3, speed: t3.prevEvent.speed, velocity: { x: t3.prevEvent.velocityX, y: t3.prevEvent.velocityY } };
|
1523
|
+
} }, { key: "preventDefault", value: function() {
|
1524
|
+
} }, { key: "stopImmediatePropagation", value: function() {
|
1525
|
+
this.immediatePropagationStopped = this.propagationStopped = true;
|
1526
|
+
} }, { key: "stopPropagation", value: function() {
|
1527
|
+
this.propagationStopped = true;
|
1528
|
+
} }]), n2;
|
1529
|
+
}(vt);
|
1530
|
+
Object.defineProperties(Se.prototype, { pageX: { get: function() {
|
1531
|
+
return this.page.x;
|
1532
|
+
}, set: function(t2) {
|
1533
|
+
this.page.x = t2;
|
1534
|
+
} }, pageY: { get: function() {
|
1535
|
+
return this.page.y;
|
1536
|
+
}, set: function(t2) {
|
1537
|
+
this.page.y = t2;
|
1538
|
+
} }, clientX: { get: function() {
|
1539
|
+
return this.client.x;
|
1540
|
+
}, set: function(t2) {
|
1541
|
+
this.client.x = t2;
|
1542
|
+
} }, clientY: { get: function() {
|
1543
|
+
return this.client.y;
|
1544
|
+
}, set: function(t2) {
|
1545
|
+
this.client.y = t2;
|
1546
|
+
} }, dx: { get: function() {
|
1547
|
+
return this.delta.x;
|
1548
|
+
}, set: function(t2) {
|
1549
|
+
this.delta.x = t2;
|
1550
|
+
} }, dy: { get: function() {
|
1551
|
+
return this.delta.y;
|
1552
|
+
}, set: function(t2) {
|
1553
|
+
this.delta.y = t2;
|
1554
|
+
} }, velocityX: { get: function() {
|
1555
|
+
return this.velocity.x;
|
1556
|
+
}, set: function(t2) {
|
1557
|
+
this.velocity.x = t2;
|
1558
|
+
} }, velocityY: { get: function() {
|
1559
|
+
return this.velocity.y;
|
1560
|
+
}, set: function(t2) {
|
1561
|
+
this.velocity.y = t2;
|
1562
|
+
} } });
|
1563
|
+
var _e = o(function t2(e2, n2, i2, o2, a2) {
|
1564
|
+
r(this, t2), this.id = void 0, this.pointer = void 0, this.event = void 0, this.downTime = void 0, this.downTarget = void 0, this.id = e2, this.pointer = n2, this.event = i2, this.downTime = o2, this.downTarget = a2;
|
1565
|
+
}), Pe = function(t2) {
|
1566
|
+
return t2.interactable = "", t2.element = "", t2.prepared = "", t2.pointerIsDown = "", t2.pointerWasMoved = "", t2._proxy = "", t2;
|
1567
|
+
}({}), Oe = function(t2) {
|
1568
|
+
return t2.start = "", t2.move = "", t2.end = "", t2.stop = "", t2.interacting = "", t2;
|
1569
|
+
}({}), ke = 0, De = function() {
|
1570
|
+
function t2(e2) {
|
1571
|
+
var n2 = this, i2 = e2.pointerType, o2 = e2.scopeFire;
|
1572
|
+
r(this, t2), 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 = false, this.pointerWasMoved = false, this._interacting = false, this._ending = false, this._stopped = true, this._proxy = void 0, this.simulation = null, this.doMove = Nt(function(t3) {
|
1573
|
+
this.move(t3);
|
1574
|
+
}, "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 = ke++, this._scopeFire = o2, this.pointerType = i2;
|
1575
|
+
var a2 = this;
|
1576
|
+
this._proxy = {};
|
1577
|
+
var s2 = function(t3) {
|
1578
|
+
Object.defineProperty(n2._proxy, t3, { get: function() {
|
1579
|
+
return a2[t3];
|
1580
|
+
} });
|
1581
|
+
};
|
1582
|
+
for (var c2 in Pe)
|
1583
|
+
s2(c2);
|
1584
|
+
var l2 = function(t3) {
|
1585
|
+
Object.defineProperty(n2._proxy, t3, { value: function() {
|
1586
|
+
return a2[t3].apply(a2, arguments);
|
1587
|
+
} });
|
1588
|
+
};
|
1589
|
+
for (var u2 in Oe)
|
1590
|
+
l2(u2);
|
1591
|
+
this._scopeFire("interactions:new", { interaction: this });
|
1592
|
+
}
|
1593
|
+
return o(t2, [{ key: "pointerMoveTolerance", get: function() {
|
1594
|
+
return 1;
|
1595
|
+
} }, { key: "pointerDown", value: function(t3, e2, n2) {
|
1596
|
+
var r2 = this.updatePointer(t3, e2, n2, true), i2 = this.pointers[r2];
|
1597
|
+
this._scopeFire("interactions:down", { pointer: t3, event: e2, eventTarget: n2, pointerIndex: r2, pointerInfo: i2, type: "down", interaction: this });
|
1598
|
+
} }, { key: "start", value: function(t3, e2, n2) {
|
1599
|
+
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < ("gesture" === t3.name ? 2 : 1) || !e2.options[t3.name].enabled) && (Ut(this.prepared, t3), this.interactable = e2, this.element = n2, this.rect = e2.getRect(n2), this.edges = this.prepared.edges ? V({}, this.prepared.edges) : { left: true, right: true, top: true, bottom: true }, this._stopped = false, this._interacting = this._doPhase({ interaction: this, event: this.downEvent, phase: "start" }) && !this._stopped, this._interacting);
|
1600
|
+
} }, { key: "pointerMove", value: function(t3, e2, n2) {
|
1601
|
+
this.simulation || this.modification && this.modification.endResult || this.updatePointer(t3, e2, n2, false);
|
1602
|
+
var r2, i2, o2 = 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;
|
1603
|
+
this.pointerIsDown && !this.pointerWasMoved && (r2 = this.coords.cur.client.x - this.coords.start.client.x, i2 = this.coords.cur.client.y - this.coords.start.client.y, this.pointerWasMoved = Q(r2, i2) > this.pointerMoveTolerance);
|
1604
|
+
var a2, s2, c2, l2 = this.getPointerIndex(t3), u2 = { pointer: t3, pointerIndex: l2, pointerInfo: this.pointers[l2], event: e2, type: "move", eventTarget: n2, dx: r2, dy: i2, duplicate: o2, interaction: this };
|
1605
|
+
o2 || (a2 = this.coords.velocity, s2 = this.coords.delta, c2 = Math.max(s2.timeStamp / 1e3, 1e-3), a2.page.x = s2.page.x / c2, a2.page.y = s2.page.y / c2, a2.client.x = s2.client.x / c2, a2.client.y = s2.client.y / c2, a2.timeStamp = c2), this._scopeFire("interactions:move", u2), o2 || this.simulation || (this.interacting() && (u2.type = null, this.move(u2)), this.pointerWasMoved && et(this.coords.prev, this.coords.cur));
|
1606
|
+
} }, { key: "move", value: function(t3) {
|
1607
|
+
t3 && t3.event || nt(this.coords.delta), (t3 = V({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, t3 || {})).phase = "move", this._doPhase(t3);
|
1608
|
+
} }, { key: "pointerUp", value: function(t3, e2, n2, r2) {
|
1609
|
+
var i2 = this.getPointerIndex(t3);
|
1610
|
+
-1 === i2 && (i2 = this.updatePointer(t3, e2, n2, false));
|
1611
|
+
var o2 = /cancel$/i.test(e2.type) ? "cancel" : "up";
|
1612
|
+
this._scopeFire("interactions:".concat(o2), { pointer: t3, pointerIndex: i2, pointerInfo: this.pointers[i2], event: e2, eventTarget: n2, type: o2, curEventTarget: r2, interaction: this }), this.simulation || this.end(e2), this.removePointer(t3, e2);
|
1613
|
+
} }, { key: "documentBlur", value: function(t3) {
|
1614
|
+
this.end(t3), this._scopeFire("interactions:blur", { event: t3, type: "blur", interaction: this });
|
1615
|
+
} }, { key: "end", value: function(t3) {
|
1616
|
+
var e2;
|
1617
|
+
this._ending = true, t3 = t3 || this._latestPointer.event, this.interacting() && (e2 = this._doPhase({ event: t3, interaction: this, phase: "end" })), this._ending = false, true === e2 && this.stop();
|
1618
|
+
} }, { key: "currentAction", value: function() {
|
1619
|
+
return this._interacting ? this.prepared.name : null;
|
1620
|
+
} }, { key: "interacting", value: function() {
|
1621
|
+
return this._interacting;
|
1622
|
+
} }, { key: "stop", value: function() {
|
1623
|
+
this._scopeFire("interactions:stop", { interaction: this }), this.interactable = this.element = null, this._interacting = false, this._stopped = true, this.prepared.name = this.prevEvent = null;
|
1624
|
+
} }, { key: "getPointerIndex", value: function(t3) {
|
1625
|
+
var e2 = at(t3);
|
1626
|
+
return "mouse" === this.pointerType || "pen" === this.pointerType ? this.pointers.length - 1 : yt(this.pointers, function(t4) {
|
1627
|
+
return t4.id === e2;
|
1628
|
+
});
|
1629
|
+
} }, { key: "getPointerInfo", value: function(t3) {
|
1630
|
+
return this.pointers[this.getPointerIndex(t3)];
|
1631
|
+
} }, { key: "updatePointer", value: function(t3, e2, n2, r2) {
|
1632
|
+
var i2, o2, a2, s2 = at(t3), c2 = this.getPointerIndex(t3), l2 = this.pointers[c2];
|
1633
|
+
return r2 = false !== r2 && (r2 || /(down|start)$/i.test(e2.type)), l2 ? l2.pointer = t3 : (l2 = new _e(s2, t3, e2, null, null), c2 = this.pointers.length, this.pointers.push(l2)), st(this.coords.cur, this.pointers.map(function(t4) {
|
1634
|
+
return t4.pointer;
|
1635
|
+
}), this._now()), i2 = this.coords.delta, o2 = this.coords.prev, a2 = this.coords.cur, i2.page.x = a2.page.x - o2.page.x, i2.page.y = a2.page.y - o2.page.y, i2.client.x = a2.client.x - o2.client.x, i2.client.y = a2.client.y - o2.client.y, i2.timeStamp = a2.timeStamp - o2.timeStamp, r2 && (this.pointerIsDown = true, l2.downTime = this.coords.cur.timeStamp, l2.downTarget = n2, tt(this.downPointer, t3), this.interacting() || (et(this.coords.start, this.coords.cur), et(this.coords.prev, this.coords.cur), this.downEvent = e2, this.pointerWasMoved = false)), this._updateLatestPointer(t3, e2, n2), this._scopeFire("interactions:update-pointer", { pointer: t3, event: e2, eventTarget: n2, down: r2, pointerInfo: l2, pointerIndex: c2, interaction: this }), c2;
|
1636
|
+
} }, { key: "removePointer", value: function(t3, e2) {
|
1637
|
+
var n2 = this.getPointerIndex(t3);
|
1638
|
+
if (-1 !== n2) {
|
1639
|
+
var r2 = this.pointers[n2];
|
1640
|
+
this._scopeFire("interactions:remove-pointer", { pointer: t3, event: e2, eventTarget: null, pointerIndex: n2, pointerInfo: r2, interaction: this }), this.pointers.splice(n2, 1), this.pointerIsDown = false;
|
1641
|
+
}
|
1642
|
+
} }, { key: "_updateLatestPointer", value: function(t3, e2, n2) {
|
1643
|
+
this._latestPointer.pointer = t3, this._latestPointer.event = e2, this._latestPointer.eventTarget = n2;
|
1644
|
+
} }, { key: "destroy", value: function() {
|
1645
|
+
this._latestPointer.pointer = null, this._latestPointer.event = null, this._latestPointer.eventTarget = null;
|
1646
|
+
} }, { key: "_createPreparedEvent", value: function(t3, e2, n2, r2) {
|
1647
|
+
return new Se(this, t3, this.prepared.name, e2, this.element, n2, r2);
|
1648
|
+
} }, { key: "_fireEvent", value: function(t3) {
|
1649
|
+
var e2;
|
1650
|
+
null == (e2 = this.interactable) || e2.fire(t3), (!this.prevEvent || t3.timeStamp >= this.prevEvent.timeStamp) && (this.prevEvent = t3);
|
1651
|
+
} }, { key: "_doPhase", value: function(t3) {
|
1652
|
+
var e2 = t3.event, n2 = t3.phase, r2 = t3.preEnd, i2 = t3.type, o2 = this.rect;
|
1653
|
+
if (o2 && "move" === n2 && (H(this.edges, o2, this.coords.delta[this.interactable.options.deltaSource]), o2.width = o2.right - o2.left, o2.height = o2.bottom - o2.top), false === this._scopeFire("interactions:before-action-".concat(n2), t3))
|
1654
|
+
return false;
|
1655
|
+
var a2 = t3.iEvent = this._createPreparedEvent(e2, n2, r2, i2);
|
1656
|
+
return this._scopeFire("interactions:action-".concat(n2), t3), "start" === n2 && (this.prevEvent = a2), this._fireEvent(a2), this._scopeFire("interactions:after-action-".concat(n2), t3), true;
|
1657
|
+
} }, { key: "_now", value: function() {
|
1658
|
+
return Date.now();
|
1659
|
+
} }]), t2;
|
1660
|
+
}();
|
1661
|
+
function Ie(t2) {
|
1662
|
+
Me(t2.interaction);
|
1663
|
+
}
|
1664
|
+
function Me(t2) {
|
1665
|
+
if (!function(t3) {
|
1666
|
+
return !(!t3.offset.pending.x && !t3.offset.pending.y);
|
1667
|
+
}(t2))
|
1668
|
+
return false;
|
1669
|
+
var e2 = t2.offset.pending;
|
1670
|
+
return Ae(t2.coords.cur, e2), Ae(t2.coords.delta, e2), H(t2.edges, t2.rect, e2), e2.x = 0, e2.y = 0, true;
|
1671
|
+
}
|
1672
|
+
function ze(t2) {
|
1673
|
+
var e2 = t2.x, n2 = t2.y;
|
1674
|
+
this.offset.pending.x += e2, this.offset.pending.y += n2, this.offset.total.x += e2, this.offset.total.y += n2;
|
1675
|
+
}
|
1676
|
+
function Ae(t2, e2) {
|
1677
|
+
var n2 = t2.page, r2 = t2.client, i2 = e2.x, o2 = e2.y;
|
1678
|
+
n2.x += i2, n2.y += o2, r2.x += i2, r2.y += o2;
|
1679
|
+
}
|
1680
|
+
Oe.offsetBy = "";
|
1681
|
+
var Re = { id: "offset", before: ["modifiers", "pointer-events", "actions", "inertia"], install: function(t2) {
|
1682
|
+
t2.Interaction.prototype.offsetBy = ze;
|
1683
|
+
}, listeners: { "interactions:new": function(t2) {
|
1684
|
+
t2.interaction.offset = { total: { x: 0, y: 0 }, pending: { x: 0, y: 0 } };
|
1685
|
+
}, "interactions:update-pointer": function(t2) {
|
1686
|
+
return function(t3) {
|
1687
|
+
t3.pointerIsDown && (Ae(t3.coords.cur, t3.offset.total), t3.offset.pending.x = 0, t3.offset.pending.y = 0);
|
1688
|
+
}(t2.interaction);
|
1689
|
+
}, "interactions:before-action-start": Ie, "interactions:before-action-move": Ie, "interactions:before-action-end": function(t2) {
|
1690
|
+
var e2 = t2.interaction;
|
1691
|
+
if (Me(e2))
|
1692
|
+
return e2.move({ offset: true }), e2.end(), false;
|
1693
|
+
}, "interactions:stop": function(t2) {
|
1694
|
+
var e2 = t2.interaction;
|
1695
|
+
e2.offset.total.x = 0, e2.offset.total.y = 0, e2.offset.pending.x = 0, e2.offset.pending.y = 0;
|
1696
|
+
} } }, Ce = Re;
|
1697
|
+
var je = function() {
|
1698
|
+
function t2(e2) {
|
1699
|
+
r(this, t2), this.active = false, this.isModified = false, this.smoothEnd = false, this.allowResume = false, 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 = e2;
|
1700
|
+
}
|
1701
|
+
return o(t2, [{ key: "start", value: function(t3) {
|
1702
|
+
var e2 = this.interaction, n2 = Fe(e2);
|
1703
|
+
if (!n2 || !n2.enabled)
|
1704
|
+
return false;
|
1705
|
+
var r2 = e2.coords.velocity.client, i2 = Q(r2.x, r2.y), o2 = this.modification || (this.modification = new me(e2));
|
1706
|
+
if (o2.copyFrom(e2.modification), this.t0 = e2._now(), this.allowResume = n2.allowResume, this.v0 = i2, this.currentOffset = { x: 0, y: 0 }, this.startCoords = e2.coords.cur.page, this.modifierArg = o2.fillArg({ pageCoords: this.startCoords, preEnd: true, phase: "inertiastart" }), this.t0 - e2.coords.cur.timeStamp < 50 && i2 > n2.minSpeed && i2 > n2.endSpeed)
|
1707
|
+
this.startInertia();
|
1708
|
+
else {
|
1709
|
+
if (o2.result = o2.setAll(this.modifierArg), !o2.result.changed)
|
1710
|
+
return false;
|
1711
|
+
this.startSmoothEnd();
|
1712
|
+
}
|
1713
|
+
return e2.modification.result.rect = null, e2.offsetBy(this.targetOffset), e2._doPhase({ interaction: e2, event: t3, phase: "inertiastart" }), e2.offsetBy({ x: -this.targetOffset.x, y: -this.targetOffset.y }), e2.modification.result.rect = null, this.active = true, e2.simulation = this, true;
|
1714
|
+
} }, { key: "startInertia", value: function() {
|
1715
|
+
var t3 = this, e2 = this.interaction.coords.velocity.client, n2 = Fe(this.interaction), r2 = n2.resistance, i2 = -Math.log(n2.endSpeed / this.v0) / r2;
|
1716
|
+
this.targetOffset = { x: (e2.x - i2) / r2, y: (e2.y - i2) / r2 }, this.te = i2, this.lambda_v0 = r2 / this.v0, this.one_ve_v0 = 1 - n2.endSpeed / this.v0;
|
1717
|
+
var o2 = this.modification, a2 = this.modifierArg;
|
1718
|
+
a2.pageCoords = { x: this.startCoords.x + this.targetOffset.x, y: this.startCoords.y + this.targetOffset.y }, o2.result = o2.setAll(a2), o2.result.changed && (this.isModified = true, this.modifiedOffset = { x: this.targetOffset.x + o2.result.delta.x, y: this.targetOffset.y + o2.result.delta.y }), this.onNextFrame(function() {
|
1719
|
+
return t3.inertiaTick();
|
1720
|
+
});
|
1721
|
+
} }, { key: "startSmoothEnd", value: function() {
|
1722
|
+
var t3 = this;
|
1723
|
+
this.smoothEnd = true, this.isModified = true, this.targetOffset = { x: this.modification.result.delta.x, y: this.modification.result.delta.y }, this.onNextFrame(function() {
|
1724
|
+
return t3.smoothEndTick();
|
1725
|
+
});
|
1726
|
+
} }, { key: "onNextFrame", value: function(t3) {
|
1727
|
+
var e2 = this;
|
1728
|
+
this.timeout = Lt.request(function() {
|
1729
|
+
e2.active && t3();
|
1730
|
+
});
|
1731
|
+
} }, { key: "inertiaTick", value: function() {
|
1732
|
+
var t3, e2, n2, r2, i2, o2, a2, s2 = this, c2 = this.interaction, l2 = Fe(c2).resistance, u2 = (c2._now() - this.t0) / 1e3;
|
1733
|
+
if (u2 < this.te) {
|
1734
|
+
var p2, f2 = 1 - (Math.exp(-l2 * u2) - this.lambda_v0) / this.one_ve_v0;
|
1735
|
+
this.isModified ? (t3 = 0, e2 = 0, n2 = this.targetOffset.x, r2 = this.targetOffset.y, i2 = this.modifiedOffset.x, o2 = this.modifiedOffset.y, p2 = { x: Ye(a2 = f2, t3, n2, i2), y: Ye(a2, e2, r2, o2) }) : p2 = { x: this.targetOffset.x * f2, y: this.targetOffset.y * f2 };
|
1736
|
+
var d2 = { x: p2.x - this.currentOffset.x, y: p2.y - this.currentOffset.y };
|
1737
|
+
this.currentOffset.x += d2.x, this.currentOffset.y += d2.y, c2.offsetBy(d2), c2.move(), this.onNextFrame(function() {
|
1738
|
+
return s2.inertiaTick();
|
1739
|
+
});
|
1740
|
+
} else
|
1741
|
+
c2.offsetBy({ x: this.modifiedOffset.x - this.currentOffset.x, y: this.modifiedOffset.y - this.currentOffset.y }), this.end();
|
1742
|
+
} }, { key: "smoothEndTick", value: function() {
|
1743
|
+
var t3 = this, e2 = this.interaction, n2 = e2._now() - this.t0, r2 = Fe(e2).smoothEndDuration;
|
1744
|
+
if (n2 < r2) {
|
1745
|
+
var i2 = { x: Le(n2, 0, this.targetOffset.x, r2), y: Le(n2, 0, this.targetOffset.y, r2) }, o2 = { x: i2.x - this.currentOffset.x, y: i2.y - this.currentOffset.y };
|
1746
|
+
this.currentOffset.x += o2.x, this.currentOffset.y += o2.y, e2.offsetBy(o2), e2.move({ skipModifiers: this.modifierCount }), this.onNextFrame(function() {
|
1747
|
+
return t3.smoothEndTick();
|
1748
|
+
});
|
1749
|
+
} else
|
1750
|
+
e2.offsetBy({ x: this.targetOffset.x - this.currentOffset.x, y: this.targetOffset.y - this.currentOffset.y }), this.end();
|
1751
|
+
} }, { key: "resume", value: function(t3) {
|
1752
|
+
var e2 = t3.pointer, n2 = t3.event, r2 = t3.eventTarget, i2 = this.interaction;
|
1753
|
+
i2.offsetBy({ x: -this.currentOffset.x, y: -this.currentOffset.y }), i2.updatePointer(e2, n2, r2, true), i2._doPhase({ interaction: i2, event: n2, phase: "resume" }), et(i2.coords.prev, i2.coords.cur), this.stop();
|
1754
|
+
} }, { key: "end", value: function() {
|
1755
|
+
this.interaction.move(), this.interaction.end(), this.stop();
|
1756
|
+
} }, { key: "stop", value: function() {
|
1757
|
+
this.active = this.smoothEnd = false, this.interaction.simulation = null, Lt.cancel(this.timeout);
|
1758
|
+
} }]), t2;
|
1759
|
+
}();
|
1760
|
+
function Fe(t2) {
|
1761
|
+
var e2 = t2.interactable, n2 = t2.prepared;
|
1762
|
+
return e2 && e2.options && n2.name && e2.options[n2.name].inertia;
|
1763
|
+
}
|
1764
|
+
var Xe = { id: "inertia", before: ["modifiers", "actions"], install: function(t2) {
|
1765
|
+
var e2 = t2.defaults;
|
1766
|
+
t2.usePlugin(Ce), t2.usePlugin(Ee), t2.actions.phases.inertiastart = true, t2.actions.phases.resume = true, e2.perAction.inertia = { enabled: false, resistance: 10, minSpeed: 100, endSpeed: 10, allowResume: true, smoothEndDuration: 300 };
|
1767
|
+
}, listeners: { "interactions:new": function(t2) {
|
1768
|
+
var e2 = t2.interaction;
|
1769
|
+
e2.inertia = new je(e2);
|
1770
|
+
}, "interactions:before-action-end": function(t2) {
|
1771
|
+
var e2 = t2.interaction, n2 = t2.event;
|
1772
|
+
return (!e2._interacting || e2.simulation || !e2.inertia.start(n2)) && null;
|
1773
|
+
}, "interactions:down": function(t2) {
|
1774
|
+
var e2 = t2.interaction, n2 = t2.eventTarget, r2 = e2.inertia;
|
1775
|
+
if (r2.active)
|
1776
|
+
for (var i2 = n2; w.element(i2); ) {
|
1777
|
+
if (i2 === e2.element) {
|
1778
|
+
r2.resume(t2);
|
1779
|
+
break;
|
1780
|
+
}
|
1781
|
+
i2 = A(i2);
|
1782
|
+
}
|
1783
|
+
}, "interactions:stop": function(t2) {
|
1784
|
+
var e2 = t2.interaction.inertia;
|
1785
|
+
e2.active && e2.stop();
|
1786
|
+
}, "interactions:before-action-resume": function(t2) {
|
1787
|
+
var e2 = t2.interaction.modification;
|
1788
|
+
e2.stop(t2), e2.start(t2, t2.interaction.coords.cur.page), e2.applyToInteraction(t2);
|
1789
|
+
}, "interactions:before-action-inertiastart": function(t2) {
|
1790
|
+
return t2.interaction.modification.setAndApply(t2);
|
1791
|
+
}, "interactions:action-resume": xe, "interactions:action-inertiastart": xe, "interactions:after-action-inertiastart": function(t2) {
|
1792
|
+
return t2.interaction.modification.restoreInteractionCoords(t2);
|
1793
|
+
}, "interactions:after-action-resume": function(t2) {
|
1794
|
+
return t2.interaction.modification.restoreInteractionCoords(t2);
|
1795
|
+
} } };
|
1796
|
+
function Ye(t2, e2, n2, r2) {
|
1797
|
+
var i2 = 1 - t2;
|
1798
|
+
return i2 * i2 * e2 + 2 * i2 * t2 * n2 + t2 * t2 * r2;
|
1799
|
+
}
|
1800
|
+
function Le(t2, e2, n2, r2) {
|
1801
|
+
return -n2 * (t2 /= r2) * (t2 - 2) + e2;
|
1802
|
+
}
|
1803
|
+
var qe = Xe;
|
1804
|
+
function Be(t2, e2) {
|
1805
|
+
for (var n2 = 0; n2 < e2.length; n2++) {
|
1806
|
+
var r2 = e2[n2];
|
1807
|
+
if (t2.immediatePropagationStopped)
|
1808
|
+
break;
|
1809
|
+
r2(t2);
|
1810
|
+
}
|
1811
|
+
}
|
1812
|
+
var Ve = function() {
|
1813
|
+
function t2(e2) {
|
1814
|
+
r(this, t2), this.options = void 0, this.types = {}, this.propagationStopped = false, this.immediatePropagationStopped = false, this.global = void 0, this.options = V({}, e2 || {});
|
1815
|
+
}
|
1816
|
+
return o(t2, [{ key: "fire", value: function(t3) {
|
1817
|
+
var e2, n2 = this.global;
|
1818
|
+
(e2 = this.types[t3.type]) && Be(t3, e2), !t3.propagationStopped && n2 && (e2 = n2[t3.type]) && Be(t3, e2);
|
1819
|
+
} }, { key: "on", value: function(t3, e2) {
|
1820
|
+
var n2 = $(t3, e2);
|
1821
|
+
for (t3 in n2)
|
1822
|
+
this.types[t3] = gt(this.types[t3] || [], n2[t3]);
|
1823
|
+
} }, { key: "off", value: function(t3, e2) {
|
1824
|
+
var n2 = $(t3, e2);
|
1825
|
+
for (t3 in n2) {
|
1826
|
+
var r2 = this.types[t3];
|
1827
|
+
if (r2 && r2.length)
|
1828
|
+
for (var i2 = 0, o2 = n2[t3]; i2 < o2.length; i2++) {
|
1829
|
+
var a2 = o2[i2], s2 = r2.indexOf(a2);
|
1830
|
+
-1 !== s2 && r2.splice(s2, 1);
|
1831
|
+
}
|
1832
|
+
}
|
1833
|
+
} }, { key: "getRect", value: function(t3) {
|
1834
|
+
return null;
|
1835
|
+
} }]), t2;
|
1836
|
+
}();
|
1837
|
+
var We = function() {
|
1838
|
+
function t2(e2) {
|
1839
|
+
r(this, t2), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e2, tt(this, e2);
|
1840
|
+
}
|
1841
|
+
return o(t2, [{ key: "preventOriginalDefault", value: function() {
|
1842
|
+
this.originalEvent.preventDefault();
|
1843
|
+
} }, { key: "stopPropagation", value: function() {
|
1844
|
+
this.originalEvent.stopPropagation();
|
1845
|
+
} }, { key: "stopImmediatePropagation", value: function() {
|
1846
|
+
this.originalEvent.stopImmediatePropagation();
|
1847
|
+
} }]), t2;
|
1848
|
+
}();
|
1849
|
+
function Ge(t2) {
|
1850
|
+
return w.object(t2) ? { capture: !!t2.capture, passive: !!t2.passive } : { capture: !!t2, passive: false };
|
1851
|
+
}
|
1852
|
+
function Ne(t2, e2) {
|
1853
|
+
return t2 === e2 || ("boolean" == typeof t2 ? !!e2.capture === t2 && false == !!e2.passive : !!t2.capture == !!e2.capture && !!t2.passive == !!e2.passive);
|
1854
|
+
}
|
1855
|
+
var Ue = { id: "events", install: function(t2) {
|
1856
|
+
var e2, n2 = [], r2 = {}, i2 = [], o2 = { add: a2, remove: s2, addDelegate: function(t3, e3, n3, o3, s3) {
|
1857
|
+
var u2 = Ge(s3);
|
1858
|
+
if (!r2[n3]) {
|
1859
|
+
r2[n3] = [];
|
1860
|
+
for (var p2 = 0; p2 < i2.length; p2++) {
|
1861
|
+
var f2 = i2[p2];
|
1862
|
+
a2(f2, n3, c2), a2(f2, n3, l2, true);
|
1863
|
+
}
|
1864
|
+
}
|
1865
|
+
var d2 = r2[n3], h2 = bt(d2, function(n4) {
|
1866
|
+
return n4.selector === t3 && n4.context === e3;
|
1867
|
+
});
|
1868
|
+
h2 || (h2 = { selector: t3, context: e3, listeners: [] }, d2.push(h2));
|
1869
|
+
h2.listeners.push({ func: o3, options: u2 });
|
1870
|
+
}, removeDelegate: function(t3, e3, n3, i3, o3) {
|
1871
|
+
var a3, u2 = Ge(o3), p2 = r2[n3], f2 = false;
|
1872
|
+
if (!p2)
|
1873
|
+
return;
|
1874
|
+
for (a3 = p2.length - 1; a3 >= 0; a3--) {
|
1875
|
+
var d2 = p2[a3];
|
1876
|
+
if (d2.selector === t3 && d2.context === e3) {
|
1877
|
+
for (var h2 = d2.listeners, v2 = h2.length - 1; v2 >= 0; v2--) {
|
1878
|
+
var g2 = h2[v2];
|
1879
|
+
if (g2.func === i3 && Ne(g2.options, u2)) {
|
1880
|
+
h2.splice(v2, 1), h2.length || (p2.splice(a3, 1), s2(e3, n3, c2), s2(e3, n3, l2, true)), f2 = true;
|
1881
|
+
break;
|
1882
|
+
}
|
1883
|
+
}
|
1884
|
+
if (f2)
|
1885
|
+
break;
|
1886
|
+
}
|
1887
|
+
}
|
1888
|
+
}, delegateListener: c2, delegateUseCapture: l2, delegatedEvents: r2, documents: i2, targets: n2, supportsOptions: false, supportsPassive: false };
|
1889
|
+
function a2(t3, e3, r3, i3) {
|
1890
|
+
if (t3.addEventListener) {
|
1891
|
+
var a3 = Ge(i3), s3 = bt(n2, function(e4) {
|
1892
|
+
return e4.eventTarget === t3;
|
1893
|
+
});
|
1894
|
+
s3 || (s3 = { eventTarget: t3, events: {} }, n2.push(s3)), s3.events[e3] || (s3.events[e3] = []), bt(s3.events[e3], function(t4) {
|
1895
|
+
return t4.func === r3 && Ne(t4.options, a3);
|
1896
|
+
}) || (t3.addEventListener(e3, r3, o2.supportsOptions ? a3 : a3.capture), s3.events[e3].push({ func: r3, options: a3 }));
|
1897
|
+
}
|
1898
|
+
}
|
1899
|
+
function s2(t3, e3, r3, i3) {
|
1900
|
+
if (t3.addEventListener && t3.removeEventListener) {
|
1901
|
+
var a3 = yt(n2, function(e4) {
|
1902
|
+
return e4.eventTarget === t3;
|
1903
|
+
}), c3 = n2[a3];
|
1904
|
+
if (c3 && c3.events)
|
1905
|
+
if ("all" !== e3) {
|
1906
|
+
var l3 = false, u2 = c3.events[e3];
|
1907
|
+
if (u2) {
|
1908
|
+
if ("all" === r3) {
|
1909
|
+
for (var p2 = u2.length - 1; p2 >= 0; p2--) {
|
1910
|
+
var f2 = u2[p2];
|
1911
|
+
s2(t3, e3, f2.func, f2.options);
|
1912
|
+
}
|
1913
|
+
return;
|
1914
|
+
}
|
1915
|
+
for (var d2 = Ge(i3), h2 = 0; h2 < u2.length; h2++) {
|
1916
|
+
var v2 = u2[h2];
|
1917
|
+
if (v2.func === r3 && Ne(v2.options, d2)) {
|
1918
|
+
t3.removeEventListener(e3, r3, o2.supportsOptions ? d2 : d2.capture), u2.splice(h2, 1), 0 === u2.length && (delete c3.events[e3], l3 = true);
|
1919
|
+
break;
|
1920
|
+
}
|
1921
|
+
}
|
1922
|
+
}
|
1923
|
+
l3 && !Object.keys(c3.events).length && n2.splice(a3, 1);
|
1924
|
+
} else
|
1925
|
+
for (e3 in c3.events)
|
1926
|
+
c3.events.hasOwnProperty(e3) && s2(t3, e3, "all");
|
1927
|
+
}
|
1928
|
+
}
|
1929
|
+
function c2(t3, e3) {
|
1930
|
+
for (var n3 = Ge(e3), i3 = new We(t3), o3 = r2[t3.type], a3 = ht(t3)[0], s3 = a3; w.element(s3); ) {
|
1931
|
+
for (var c3 = 0; c3 < o3.length; c3++) {
|
1932
|
+
var l3 = o3[c3], u2 = l3.selector, p2 = l3.context;
|
1933
|
+
if (R(s3, u2) && M(p2, a3) && M(p2, s3)) {
|
1934
|
+
var f2 = l3.listeners;
|
1935
|
+
i3.currentTarget = s3;
|
1936
|
+
for (var d2 = 0; d2 < f2.length; d2++) {
|
1937
|
+
var h2 = f2[d2];
|
1938
|
+
Ne(h2.options, n3) && h2.func(i3);
|
1939
|
+
}
|
1940
|
+
}
|
1941
|
+
}
|
1942
|
+
s3 = A(s3);
|
1943
|
+
}
|
1944
|
+
}
|
1945
|
+
function l2(t3) {
|
1946
|
+
return c2(t3, true);
|
1947
|
+
}
|
1948
|
+
return null == (e2 = t2.document) || e2.createElement("div").addEventListener("test", null, { get capture() {
|
1949
|
+
return o2.supportsOptions = true;
|
1950
|
+
}, get passive() {
|
1951
|
+
return o2.supportsPassive = true;
|
1952
|
+
} }), t2.events = o2, o2;
|
1953
|
+
} }, He = { methodOrder: ["simulationResume", "mouseOrPen", "hasPointer", "idle"], search: function(t2) {
|
1954
|
+
for (var e2 = 0, n2 = He.methodOrder; e2 < n2.length; e2++) {
|
1955
|
+
var r2 = n2[e2], i2 = He[r2](t2);
|
1956
|
+
if (i2)
|
1957
|
+
return i2;
|
1958
|
+
}
|
1959
|
+
return null;
|
1960
|
+
}, simulationResume: function(t2) {
|
1961
|
+
var e2 = t2.pointerType, n2 = t2.eventType, r2 = t2.eventTarget, i2 = t2.scope;
|
1962
|
+
if (!/down|start/i.test(n2))
|
1963
|
+
return null;
|
1964
|
+
for (var o2 = 0, a2 = i2.interactions.list; o2 < a2.length; o2++) {
|
1965
|
+
var s2 = a2[o2], c2 = r2;
|
1966
|
+
if (s2.simulation && s2.simulation.allowResume && s2.pointerType === e2)
|
1967
|
+
for (; c2; ) {
|
1968
|
+
if (c2 === s2.element)
|
1969
|
+
return s2;
|
1970
|
+
c2 = A(c2);
|
1971
|
+
}
|
1972
|
+
}
|
1973
|
+
return null;
|
1974
|
+
}, mouseOrPen: function(t2) {
|
1975
|
+
var e2, n2 = t2.pointerId, r2 = t2.pointerType, i2 = t2.eventType, o2 = t2.scope;
|
1976
|
+
if ("mouse" !== r2 && "pen" !== r2)
|
1977
|
+
return null;
|
1978
|
+
for (var a2 = 0, s2 = o2.interactions.list; a2 < s2.length; a2++) {
|
1979
|
+
var c2 = s2[a2];
|
1980
|
+
if (c2.pointerType === r2) {
|
1981
|
+
if (c2.simulation && !Ke(c2, n2))
|
1982
|
+
continue;
|
1983
|
+
if (c2.interacting())
|
1984
|
+
return c2;
|
1985
|
+
e2 || (e2 = c2);
|
1986
|
+
}
|
1987
|
+
}
|
1988
|
+
if (e2)
|
1989
|
+
return e2;
|
1990
|
+
for (var l2 = 0, u2 = o2.interactions.list; l2 < u2.length; l2++) {
|
1991
|
+
var p2 = u2[l2];
|
1992
|
+
if (!(p2.pointerType !== r2 || /down/i.test(i2) && p2.simulation))
|
1993
|
+
return p2;
|
1994
|
+
}
|
1995
|
+
return null;
|
1996
|
+
}, hasPointer: function(t2) {
|
1997
|
+
for (var e2 = t2.pointerId, n2 = 0, r2 = t2.scope.interactions.list; n2 < r2.length; n2++) {
|
1998
|
+
var i2 = r2[n2];
|
1999
|
+
if (Ke(i2, e2))
|
2000
|
+
return i2;
|
2001
|
+
}
|
2002
|
+
return null;
|
2003
|
+
}, idle: function(t2) {
|
2004
|
+
for (var e2 = t2.pointerType, n2 = 0, r2 = t2.scope.interactions.list; n2 < r2.length; n2++) {
|
2005
|
+
var i2 = r2[n2];
|
2006
|
+
if (1 === i2.pointers.length) {
|
2007
|
+
var o2 = i2.interactable;
|
2008
|
+
if (o2 && (!o2.options.gesture || !o2.options.gesture.enabled))
|
2009
|
+
continue;
|
2010
|
+
} else if (i2.pointers.length >= 2)
|
2011
|
+
continue;
|
2012
|
+
if (!i2.interacting() && e2 === i2.pointerType)
|
2013
|
+
return i2;
|
2014
|
+
}
|
2015
|
+
return null;
|
2016
|
+
} };
|
2017
|
+
function Ke(t2, e2) {
|
2018
|
+
return t2.pointers.some(function(t3) {
|
2019
|
+
return t3.id === e2;
|
2020
|
+
});
|
2021
|
+
}
|
2022
|
+
var $e = He, Je = ["pointerDown", "pointerMove", "pointerUp", "updatePointer", "removePointer", "windowBlur"];
|
2023
|
+
function Qe(t2, e2) {
|
2024
|
+
return function(n2) {
|
2025
|
+
var r2 = e2.interactions.list, i2 = dt(n2), o2 = ht(n2), a2 = o2[0], s2 = o2[1], c2 = [];
|
2026
|
+
if (/^touch/.test(n2.type)) {
|
2027
|
+
e2.prevTouchTime = e2.now();
|
2028
|
+
for (var l2 = 0, u2 = n2.changedTouches; l2 < u2.length; l2++) {
|
2029
|
+
var p2 = u2[l2], f2 = { pointer: p2, pointerId: at(p2), pointerType: i2, eventType: n2.type, eventTarget: a2, curEventTarget: s2, scope: e2 }, d2 = Ze(f2);
|
2030
|
+
c2.push([f2.pointer, f2.eventTarget, f2.curEventTarget, d2]);
|
2031
|
+
}
|
2032
|
+
} else {
|
2033
|
+
var h2 = false;
|
2034
|
+
if (!I.supportsPointerEvent && /mouse/.test(n2.type)) {
|
2035
|
+
for (var v2 = 0; v2 < r2.length && !h2; v2++)
|
2036
|
+
h2 = "mouse" !== r2[v2].pointerType && r2[v2].pointerIsDown;
|
2037
|
+
h2 = h2 || e2.now() - e2.prevTouchTime < 500 || 0 === n2.timeStamp;
|
2038
|
+
}
|
2039
|
+
if (!h2) {
|
2040
|
+
var g2 = { pointer: n2, pointerId: at(n2), pointerType: i2, eventType: n2.type, curEventTarget: s2, eventTarget: a2, scope: e2 }, m2 = Ze(g2);
|
2041
|
+
c2.push([g2.pointer, g2.eventTarget, g2.curEventTarget, m2]);
|
2042
|
+
}
|
2043
|
+
}
|
2044
|
+
for (var y2 = 0; y2 < c2.length; y2++) {
|
2045
|
+
var b2 = c2[y2], x2 = b2[0], w2 = b2[1], E2 = b2[2];
|
2046
|
+
b2[3][t2](x2, n2, w2, E2);
|
2047
|
+
}
|
2048
|
+
};
|
2049
|
+
}
|
2050
|
+
function Ze(t2) {
|
2051
|
+
var e2 = t2.pointerType, n2 = t2.scope, r2 = { interaction: $e.search(t2), searchDetails: t2 };
|
2052
|
+
return n2.fire("interactions:find", r2), r2.interaction || n2.interactions.new({ pointerType: e2 });
|
2053
|
+
}
|
2054
|
+
function tn(t2, e2) {
|
2055
|
+
var n2 = t2.doc, r2 = t2.scope, i2 = t2.options, o2 = r2.interactions.docEvents, a2 = r2.events, s2 = a2[e2];
|
2056
|
+
for (var c2 in r2.browser.isIOS && !i2.events && (i2.events = { passive: false }), a2.delegatedEvents)
|
2057
|
+
s2(n2, c2, a2.delegateListener), s2(n2, c2, a2.delegateUseCapture, true);
|
2058
|
+
for (var l2 = i2 && i2.events, u2 = 0; u2 < o2.length; u2++) {
|
2059
|
+
var p2 = o2[u2];
|
2060
|
+
s2(n2, p2.type, p2.listener, l2);
|
2061
|
+
}
|
2062
|
+
}
|
2063
|
+
var en = { id: "core/interactions", install: function(t2) {
|
2064
|
+
for (var e2 = {}, n2 = 0; n2 < Je.length; n2++) {
|
2065
|
+
var i2 = Je[n2];
|
2066
|
+
e2[i2] = Qe(i2, t2);
|
2067
|
+
}
|
2068
|
+
var a2, c2 = I.pEventTypes;
|
2069
|
+
function l2() {
|
2070
|
+
for (var e3 = 0, n3 = t2.interactions.list; e3 < n3.length; e3++) {
|
2071
|
+
var r2 = n3[e3];
|
2072
|
+
if (r2.pointerIsDown && "touch" === r2.pointerType && !r2._interacting)
|
2073
|
+
for (var i3 = function() {
|
2074
|
+
var e4 = a3[o2];
|
2075
|
+
t2.documents.some(function(t3) {
|
2076
|
+
return M(t3.doc, e4.downTarget);
|
2077
|
+
}) || r2.removePointer(e4.pointer, e4.event);
|
2078
|
+
}, o2 = 0, a3 = r2.pointers; o2 < a3.length; o2++)
|
2079
|
+
i3();
|
2080
|
+
}
|
2081
|
+
}
|
2082
|
+
(a2 = k.PointerEvent ? [{ type: c2.down, listener: l2 }, { type: c2.down, listener: e2.pointerDown }, { type: c2.move, listener: e2.pointerMove }, { type: c2.up, listener: e2.pointerUp }, { type: c2.cancel, listener: e2.pointerUp }] : [{ type: "mousedown", listener: e2.pointerDown }, { type: "mousemove", listener: e2.pointerMove }, { type: "mouseup", listener: e2.pointerUp }, { type: "touchstart", listener: l2 }, { type: "touchstart", listener: e2.pointerDown }, { type: "touchmove", listener: e2.pointerMove }, { type: "touchend", listener: e2.pointerUp }, { type: "touchcancel", listener: e2.pointerUp }]).push({ type: "blur", listener: function(e3) {
|
2083
|
+
for (var n3 = 0, r2 = t2.interactions.list; n3 < r2.length; n3++) {
|
2084
|
+
r2[n3].documentBlur(e3);
|
2085
|
+
}
|
2086
|
+
} }), t2.prevTouchTime = 0, t2.Interaction = function(e3) {
|
2087
|
+
s(i3, e3);
|
2088
|
+
var n3 = p(i3);
|
2089
|
+
function i3() {
|
2090
|
+
return r(this, i3), n3.apply(this, arguments);
|
2091
|
+
}
|
2092
|
+
return o(i3, [{ key: "pointerMoveTolerance", get: function() {
|
2093
|
+
return t2.interactions.pointerMoveTolerance;
|
2094
|
+
}, set: function(e4) {
|
2095
|
+
t2.interactions.pointerMoveTolerance = e4;
|
2096
|
+
} }, { key: "_now", value: function() {
|
2097
|
+
return t2.now();
|
2098
|
+
} }]), i3;
|
2099
|
+
}(De), t2.interactions = { list: [], new: function(e3) {
|
2100
|
+
e3.scopeFire = function(e4, n4) {
|
2101
|
+
return t2.fire(e4, n4);
|
2102
|
+
};
|
2103
|
+
var n3 = new t2.Interaction(e3);
|
2104
|
+
return t2.interactions.list.push(n3), n3;
|
2105
|
+
}, listeners: e2, docEvents: a2, pointerMoveTolerance: 1 }, t2.usePlugin(he);
|
2106
|
+
}, listeners: { "scope:add-document": function(t2) {
|
2107
|
+
return tn(t2, "add");
|
2108
|
+
}, "scope:remove-document": function(t2) {
|
2109
|
+
return tn(t2, "remove");
|
2110
|
+
}, "interactable:unset": function(t2, e2) {
|
2111
|
+
for (var n2 = t2.interactable, r2 = e2.interactions.list.length - 1; r2 >= 0; r2--) {
|
2112
|
+
var i2 = e2.interactions.list[r2];
|
2113
|
+
i2.interactable === n2 && (i2.stop(), e2.fire("interactions:destroy", { interaction: i2 }), i2.destroy(), e2.interactions.list.length > 2 && e2.interactions.list.splice(r2, 1));
|
2114
|
+
}
|
2115
|
+
} }, onDocSignal: tn, doOnInteractions: Qe, methodNames: Je }, nn = en, rn = function(t2) {
|
2116
|
+
return t2[t2.On = 0] = "On", t2[t2.Off = 1] = "Off", t2;
|
2117
|
+
}(rn || {}), on = function() {
|
2118
|
+
function t2(e2, n2, i2, o2) {
|
2119
|
+
r(this, t2), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new Ve(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = n2.actions, this.target = e2, this._context = n2.context || i2, this._win = y(B(e2) ? this._context : e2), this._doc = this._win.document, this._scopeEvents = o2, this.set(n2);
|
2120
|
+
}
|
2121
|
+
return o(t2, [{ key: "_defaults", get: function() {
|
2122
|
+
return { base: {}, perAction: {}, actions: {} };
|
2123
|
+
} }, { key: "setOnEvents", value: function(t3, e2) {
|
2124
|
+
return w.func(e2.onstart) && this.on("".concat(t3, "start"), e2.onstart), w.func(e2.onmove) && this.on("".concat(t3, "move"), e2.onmove), w.func(e2.onend) && this.on("".concat(t3, "end"), e2.onend), w.func(e2.oninertiastart) && this.on("".concat(t3, "inertiastart"), e2.oninertiastart), this;
|
2125
|
+
} }, { key: "updatePerActionListeners", value: function(t3, e2, n2) {
|
2126
|
+
var r2, i2 = this, o2 = null == (r2 = this._actions.map[t3]) ? void 0 : r2.filterEventType, a2 = function(t4) {
|
2127
|
+
return (null == o2 || o2(t4)) && ve(t4, i2._actions);
|
2128
|
+
};
|
2129
|
+
(w.array(e2) || w.object(e2)) && this._onOff(rn.Off, t3, e2, void 0, a2), (w.array(n2) || w.object(n2)) && this._onOff(rn.On, t3, n2, void 0, a2);
|
2130
|
+
} }, { key: "setPerAction", value: function(t3, e2) {
|
2131
|
+
var n2 = this._defaults;
|
2132
|
+
for (var r2 in e2) {
|
2133
|
+
var i2 = r2, o2 = this.options[t3], a2 = e2[i2];
|
2134
|
+
"listeners" === i2 && this.updatePerActionListeners(t3, o2.listeners, a2), w.array(a2) ? o2[i2] = mt(a2) : w.plainObject(a2) ? (o2[i2] = V(o2[i2] || {}, ge(a2)), w.object(n2.perAction[i2]) && "enabled" in n2.perAction[i2] && (o2[i2].enabled = false !== a2.enabled)) : w.bool(a2) && w.object(n2.perAction[i2]) ? o2[i2].enabled = a2 : o2[i2] = a2;
|
2135
|
+
}
|
2136
|
+
} }, { key: "getRect", value: function(t3) {
|
2137
|
+
return t3 = t3 || (w.element(this.target) ? this.target : null), w.string(this.target) && (t3 = t3 || this._context.querySelector(this.target)), L(t3);
|
2138
|
+
} }, { key: "rectChecker", value: function(t3) {
|
2139
|
+
var e2 = this;
|
2140
|
+
return w.func(t3) ? (this.getRect = function(n2) {
|
2141
|
+
var r2 = V({}, t3.apply(e2, n2));
|
2142
|
+
return "width" in r2 || (r2.width = r2.right - r2.left, r2.height = r2.bottom - r2.top), r2;
|
2143
|
+
}, this) : null === t3 ? (delete this.getRect, this) : this.getRect;
|
2144
|
+
} }, { key: "_backCompatOption", value: function(t3, e2) {
|
2145
|
+
if (B(e2) || w.object(e2)) {
|
2146
|
+
for (var n2 in this.options[t3] = e2, this._actions.map)
|
2147
|
+
this.options[n2][t3] = e2;
|
2148
|
+
return this;
|
2149
|
+
}
|
2150
|
+
return this.options[t3];
|
2151
|
+
} }, { key: "origin", value: function(t3) {
|
2152
|
+
return this._backCompatOption("origin", t3);
|
2153
|
+
} }, { key: "deltaSource", value: function(t3) {
|
2154
|
+
return "page" === t3 || "client" === t3 ? (this.options.deltaSource = t3, this) : this.options.deltaSource;
|
2155
|
+
} }, { key: "getAllElements", value: function() {
|
2156
|
+
var t3 = this.target;
|
2157
|
+
return w.string(t3) ? Array.from(this._context.querySelectorAll(t3)) : w.func(t3) && t3.getAllElements ? t3.getAllElements() : w.element(t3) ? [t3] : [];
|
2158
|
+
} }, { key: "context", value: function() {
|
2159
|
+
return this._context;
|
2160
|
+
} }, { key: "inContext", value: function(t3) {
|
2161
|
+
return this._context === t3.ownerDocument || M(this._context, t3);
|
2162
|
+
} }, { key: "testIgnoreAllow", value: function(t3, e2, n2) {
|
2163
|
+
return !this.testIgnore(t3.ignoreFrom, e2, n2) && this.testAllow(t3.allowFrom, e2, n2);
|
2164
|
+
} }, { key: "testAllow", value: function(t3, e2, n2) {
|
2165
|
+
return !t3 || !!w.element(n2) && (w.string(t3) ? F(n2, t3, e2) : !!w.element(t3) && M(t3, n2));
|
2166
|
+
} }, { key: "testIgnore", value: function(t3, e2, n2) {
|
2167
|
+
return !(!t3 || !w.element(n2)) && (w.string(t3) ? F(n2, t3, e2) : !!w.element(t3) && M(t3, n2));
|
2168
|
+
} }, { key: "fire", value: function(t3) {
|
2169
|
+
return this.events.fire(t3), this;
|
2170
|
+
} }, { key: "_onOff", value: function(t3, e2, n2, r2, i2) {
|
2171
|
+
w.object(e2) && !w.array(e2) && (r2 = n2, n2 = null);
|
2172
|
+
var o2 = $(e2, n2, i2);
|
2173
|
+
for (var a2 in o2) {
|
2174
|
+
"wheel" === a2 && (a2 = I.wheelEvent);
|
2175
|
+
for (var s2 = 0, c2 = o2[a2]; s2 < c2.length; s2++) {
|
2176
|
+
var l2 = c2[s2];
|
2177
|
+
ve(a2, this._actions) ? this.events[t3 === rn.On ? "on" : "off"](a2, l2) : w.string(this.target) ? this._scopeEvents[t3 === rn.On ? "addDelegate" : "removeDelegate"](this.target, this._context, a2, l2, r2) : this._scopeEvents[t3 === rn.On ? "add" : "remove"](this.target, a2, l2, r2);
|
2178
|
+
}
|
2179
|
+
}
|
2180
|
+
return this;
|
2181
|
+
} }, { key: "on", value: function(t3, e2, n2) {
|
2182
|
+
return this._onOff(rn.On, t3, e2, n2);
|
2183
|
+
} }, { key: "off", value: function(t3, e2, n2) {
|
2184
|
+
return this._onOff(rn.Off, t3, e2, n2);
|
2185
|
+
} }, { key: "set", value: function(t3) {
|
2186
|
+
var e2 = this._defaults;
|
2187
|
+
for (var n2 in w.object(t3) || (t3 = {}), this.options = ge(e2.base), this._actions.methodDict) {
|
2188
|
+
var r2 = n2, i2 = this._actions.methodDict[r2];
|
2189
|
+
this.options[r2] = {}, this.setPerAction(r2, V(V({}, e2.perAction), e2.actions[r2])), this[i2](t3[r2]);
|
2190
|
+
}
|
2191
|
+
for (var o2 in t3)
|
2192
|
+
"getRect" !== o2 ? w.func(this[o2]) && this[o2](t3[o2]) : this.rectChecker(t3.getRect);
|
2193
|
+
return this;
|
2194
|
+
} }, { key: "unset", value: function() {
|
2195
|
+
if (w.string(this.target))
|
2196
|
+
for (var t3 in this._scopeEvents.delegatedEvents)
|
2197
|
+
for (var e2 = this._scopeEvents.delegatedEvents[t3], n2 = e2.length - 1; n2 >= 0; n2--) {
|
2198
|
+
var r2 = e2[n2], i2 = r2.selector, o2 = r2.context, a2 = r2.listeners;
|
2199
|
+
i2 === this.target && o2 === this._context && e2.splice(n2, 1);
|
2200
|
+
for (var s2 = a2.length - 1; s2 >= 0; s2--)
|
2201
|
+
this._scopeEvents.removeDelegate(this.target, this._context, t3, a2[s2][0], a2[s2][1]);
|
2202
|
+
}
|
2203
|
+
else
|
2204
|
+
this._scopeEvents.remove(this.target, "all");
|
2205
|
+
} }]), t2;
|
2206
|
+
}(), an = function() {
|
2207
|
+
function t2(e2) {
|
2208
|
+
var n2 = this;
|
2209
|
+
r(this, t2), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = e2, e2.addListeners({ "interactable:unset": function(t3) {
|
2210
|
+
var e3 = t3.interactable, r2 = e3.target, i2 = w.string(r2) ? n2.selectorMap[r2] : r2[n2.scope.id], o2 = yt(i2, function(t4) {
|
2211
|
+
return t4 === e3;
|
2212
|
+
});
|
2213
|
+
i2.splice(o2, 1);
|
2214
|
+
} });
|
2215
|
+
}
|
2216
|
+
return o(t2, [{ key: "new", value: function(t3, e2) {
|
2217
|
+
e2 = V(e2 || {}, { actions: this.scope.actions });
|
2218
|
+
var n2 = new this.scope.Interactable(t3, e2, this.scope.document, this.scope.events);
|
2219
|
+
return this.scope.addDocument(n2._doc), this.list.push(n2), w.string(t3) ? (this.selectorMap[t3] || (this.selectorMap[t3] = []), this.selectorMap[t3].push(n2)) : (n2.target[this.scope.id] || Object.defineProperty(t3, this.scope.id, { value: [], configurable: true }), t3[this.scope.id].push(n2)), this.scope.fire("interactable:new", { target: t3, options: e2, interactable: n2, win: this.scope._win }), n2;
|
2220
|
+
} }, { key: "getExisting", value: function(t3, e2) {
|
2221
|
+
var n2 = e2 && e2.context || this.scope.document, r2 = w.string(t3), i2 = r2 ? this.selectorMap[t3] : t3[this.scope.id];
|
2222
|
+
if (i2)
|
2223
|
+
return bt(i2, function(e3) {
|
2224
|
+
return e3._context === n2 && (r2 || e3.inContext(t3));
|
2225
|
+
});
|
2226
|
+
} }, { key: "forEachMatch", value: function(t3, e2) {
|
2227
|
+
for (var n2 = 0, r2 = this.list; n2 < r2.length; n2++) {
|
2228
|
+
var i2 = r2[n2], o2 = void 0;
|
2229
|
+
if ((w.string(i2.target) ? w.element(t3) && R(t3, i2.target) : t3 === i2.target) && i2.inContext(t3) && (o2 = e2(i2)), void 0 !== o2)
|
2230
|
+
return o2;
|
2231
|
+
}
|
2232
|
+
} }]), t2;
|
2233
|
+
}();
|
2234
|
+
var sn = function() {
|
2235
|
+
function t2() {
|
2236
|
+
var e2 = this;
|
2237
|
+
r(this, t2), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = false, this.listenerMaps = [], this.browser = I, this.defaults = ge(Te), this.Eventable = Ve, this.actions = { map: {}, phases: { start: true, move: true, end: true }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = function(t3) {
|
2238
|
+
var e3 = function e4(n3, r2) {
|
2239
|
+
var i2 = t3.interactables.getExisting(n3, r2);
|
2240
|
+
return i2 || ((i2 = t3.interactables.new(n3, r2)).events.global = e4.globalEvents), i2;
|
2241
|
+
};
|
2242
|
+
return e3.getPointerAverage = lt, e3.getTouchBBox = ut, e3.getTouchDistance = pt, e3.getTouchAngle = ft, e3.getElementRect = L, e3.getElementClientRect = Y, e3.matchesSelector = R, e3.closest = z, e3.globalEvents = {}, e3.version = "1.10.27", e3.scope = t3, e3.use = function(t4, e4) {
|
2243
|
+
return this.scope.usePlugin(t4, e4), this;
|
2244
|
+
}, e3.isSet = function(t4, e4) {
|
2245
|
+
return !!this.scope.interactables.get(t4, e4 && e4.context);
|
2246
|
+
}, e3.on = Nt(function(t4, e4, n3) {
|
2247
|
+
if (w.string(t4) && -1 !== t4.search(" ") && (t4 = t4.trim().split(/ +/)), w.array(t4)) {
|
2248
|
+
for (var r2 = 0, i2 = t4; r2 < i2.length; r2++) {
|
2249
|
+
var o2 = i2[r2];
|
2250
|
+
this.on(o2, e4, n3);
|
2251
|
+
}
|
2252
|
+
return this;
|
2253
|
+
}
|
2254
|
+
if (w.object(t4)) {
|
2255
|
+
for (var a2 in t4)
|
2256
|
+
this.on(a2, t4[a2], e4);
|
2257
|
+
return this;
|
2258
|
+
}
|
2259
|
+
return ve(t4, this.scope.actions) ? this.globalEvents[t4] ? this.globalEvents[t4].push(e4) : this.globalEvents[t4] = [e4] : this.scope.events.add(this.scope.document, t4, e4, { options: n3 }), this;
|
2260
|
+
}, "The interact.on() method is being deprecated"), e3.off = Nt(function(t4, e4, n3) {
|
2261
|
+
if (w.string(t4) && -1 !== t4.search(" ") && (t4 = t4.trim().split(/ +/)), w.array(t4)) {
|
2262
|
+
for (var r2 = 0, i2 = t4; r2 < i2.length; r2++) {
|
2263
|
+
var o2 = i2[r2];
|
2264
|
+
this.off(o2, e4, n3);
|
2265
|
+
}
|
2266
|
+
return this;
|
2267
|
+
}
|
2268
|
+
if (w.object(t4)) {
|
2269
|
+
for (var a2 in t4)
|
2270
|
+
this.off(a2, t4[a2], e4);
|
2271
|
+
return this;
|
2272
|
+
}
|
2273
|
+
var s2;
|
2274
|
+
return ve(t4, this.scope.actions) ? t4 in this.globalEvents && -1 !== (s2 = this.globalEvents[t4].indexOf(e4)) && this.globalEvents[t4].splice(s2, 1) : this.scope.events.remove(this.scope.document, t4, e4, n3), this;
|
2275
|
+
}, "The interact.off() method is being deprecated"), e3.debug = function() {
|
2276
|
+
return this.scope;
|
2277
|
+
}, e3.supportsTouch = function() {
|
2278
|
+
return I.supportsTouch;
|
2279
|
+
}, e3.supportsPointerEvent = function() {
|
2280
|
+
return I.supportsPointerEvent;
|
2281
|
+
}, e3.stop = function() {
|
2282
|
+
for (var t4 = 0, e4 = this.scope.interactions.list; t4 < e4.length; t4++)
|
2283
|
+
e4[t4].stop();
|
2284
|
+
return this;
|
2285
|
+
}, e3.pointerMoveTolerance = function(t4) {
|
2286
|
+
return w.number(t4) ? (this.scope.interactions.pointerMoveTolerance = t4, this) : this.scope.interactions.pointerMoveTolerance;
|
2287
|
+
}, e3.addDocument = function(t4, e4) {
|
2288
|
+
this.scope.addDocument(t4, e4);
|
2289
|
+
}, e3.removeDocument = function(t4) {
|
2290
|
+
this.scope.removeDocument(t4);
|
2291
|
+
}, e3;
|
2292
|
+
}(this), this.InteractEvent = Se, this.Interactable = void 0, this.interactables = new an(this), this._win = void 0, this.document = void 0, this.window = void 0, this.documents = [], this._plugins = { list: [], map: {} }, this.onWindowUnload = function(t3) {
|
2293
|
+
return e2.removeDocument(t3.target);
|
2294
|
+
};
|
2295
|
+
var n2 = this;
|
2296
|
+
this.Interactable = function(t3) {
|
2297
|
+
s(i2, t3);
|
2298
|
+
var e3 = p(i2);
|
2299
|
+
function i2() {
|
2300
|
+
return r(this, i2), e3.apply(this, arguments);
|
2301
|
+
}
|
2302
|
+
return o(i2, [{ key: "_defaults", get: function() {
|
2303
|
+
return n2.defaults;
|
2304
|
+
} }, { key: "set", value: function(t4) {
|
2305
|
+
return f(c(i2.prototype), "set", this).call(this, t4), n2.fire("interactable:set", { options: t4, interactable: this }), this;
|
2306
|
+
} }, { key: "unset", value: function() {
|
2307
|
+
f(c(i2.prototype), "unset", this).call(this);
|
2308
|
+
var t4 = n2.interactables.list.indexOf(this);
|
2309
|
+
t4 < 0 || (n2.interactables.list.splice(t4, 1), n2.fire("interactable:unset", { interactable: this }));
|
2310
|
+
} }]), i2;
|
2311
|
+
}(on);
|
2312
|
+
}
|
2313
|
+
return o(t2, [{ key: "addListeners", value: function(t3, e2) {
|
2314
|
+
this.listenerMaps.push({ id: e2, map: t3 });
|
2315
|
+
} }, { key: "fire", value: function(t3, e2) {
|
2316
|
+
for (var n2 = 0, r2 = this.listenerMaps; n2 < r2.length; n2++) {
|
2317
|
+
var i2 = r2[n2].map[t3];
|
2318
|
+
if (i2 && false === i2(e2, this, t3))
|
2319
|
+
return false;
|
2320
|
+
}
|
2321
|
+
} }, { key: "init", value: function(t3) {
|
2322
|
+
return this.isInitialized ? this : function(t4, e2) {
|
2323
|
+
t4.isInitialized = true, w.window(e2) && m(e2);
|
2324
|
+
return k.init(e2), I.init(e2), Lt.init(e2), t4.window = e2, t4.document = e2.document, t4.usePlugin(nn), t4.usePlugin(Ue), t4;
|
2325
|
+
}(this, t3);
|
2326
|
+
} }, { key: "pluginIsInstalled", value: function(t3) {
|
2327
|
+
var e2 = t3.id;
|
2328
|
+
return e2 ? !!this._plugins.map[e2] : -1 !== this._plugins.list.indexOf(t3);
|
2329
|
+
} }, { key: "usePlugin", value: function(t3, e2) {
|
2330
|
+
if (!this.isInitialized)
|
2331
|
+
return this;
|
2332
|
+
if (this.pluginIsInstalled(t3))
|
2333
|
+
return this;
|
2334
|
+
if (t3.id && (this._plugins.map[t3.id] = t3), this._plugins.list.push(t3), t3.install && t3.install(this, e2), t3.listeners && t3.before) {
|
2335
|
+
for (var n2 = 0, r2 = this.listenerMaps.length, i2 = t3.before.reduce(function(t4, e3) {
|
2336
|
+
return t4[e3] = true, t4[cn(e3)] = true, t4;
|
2337
|
+
}, {}); n2 < r2; n2++) {
|
2338
|
+
var o2 = this.listenerMaps[n2].id;
|
2339
|
+
if (o2 && (i2[o2] || i2[cn(o2)]))
|
2340
|
+
break;
|
2341
|
+
}
|
2342
|
+
this.listenerMaps.splice(n2, 0, { id: t3.id, map: t3.listeners });
|
2343
|
+
} else
|
2344
|
+
t3.listeners && this.listenerMaps.push({ id: t3.id, map: t3.listeners });
|
2345
|
+
return this;
|
2346
|
+
} }, { key: "addDocument", value: function(t3, e2) {
|
2347
|
+
if (-1 !== this.getDocIndex(t3))
|
2348
|
+
return false;
|
2349
|
+
var n2 = y(t3);
|
2350
|
+
e2 = e2 ? V({}, e2) : {}, this.documents.push({ doc: t3, options: e2 }), this.events.documents.push(t3), t3 !== this.document && this.events.add(n2, "unload", this.onWindowUnload), this.fire("scope:add-document", { doc: t3, window: n2, scope: this, options: e2 });
|
2351
|
+
} }, { key: "removeDocument", value: function(t3) {
|
2352
|
+
var e2 = this.getDocIndex(t3), n2 = y(t3), r2 = this.documents[e2].options;
|
2353
|
+
this.events.remove(n2, "unload", this.onWindowUnload), this.documents.splice(e2, 1), this.events.documents.splice(e2, 1), this.fire("scope:remove-document", { doc: t3, window: n2, scope: this, options: r2 });
|
2354
|
+
} }, { key: "getDocIndex", value: function(t3) {
|
2355
|
+
for (var e2 = 0; e2 < this.documents.length; e2++)
|
2356
|
+
if (this.documents[e2].doc === t3)
|
2357
|
+
return e2;
|
2358
|
+
return -1;
|
2359
|
+
} }, { key: "getDocOptions", value: function(t3) {
|
2360
|
+
var e2 = this.getDocIndex(t3);
|
2361
|
+
return -1 === e2 ? null : this.documents[e2].options;
|
2362
|
+
} }, { key: "now", value: function() {
|
2363
|
+
return (this.window.Date || Date).now();
|
2364
|
+
} }]), t2;
|
2365
|
+
}();
|
2366
|
+
function cn(t2) {
|
2367
|
+
return t2 && t2.replace(/\/.*$/, "");
|
2368
|
+
}
|
2369
|
+
var ln = new sn(), un = ln.interactStatic, pn = "undefined" != typeof globalThis ? globalThis : window;
|
2370
|
+
ln.init(pn);
|
2371
|
+
var fn = Object.freeze({ __proto__: null, edgeTarget: function() {
|
2372
|
+
}, elements: function() {
|
2373
|
+
}, grid: function(t2) {
|
2374
|
+
var e2 = [["x", "y"], ["left", "top"], ["right", "bottom"], ["width", "height"]].filter(function(e3) {
|
2375
|
+
var n3 = e3[0], r2 = e3[1];
|
2376
|
+
return n3 in t2 || r2 in t2;
|
2377
|
+
}), n2 = function(n3, r2) {
|
2378
|
+
for (var i2 = t2.range, o2 = t2.limits, a2 = void 0 === o2 ? { left: -1 / 0, right: 1 / 0, top: -1 / 0, bottom: 1 / 0 } : o2, s2 = t2.offset, c2 = void 0 === s2 ? { x: 0, y: 0 } : s2, l2 = { range: i2, grid: t2, x: null, y: null }, u2 = 0; u2 < e2.length; u2++) {
|
2379
|
+
var p2 = e2[u2], f2 = p2[0], d2 = p2[1], h2 = Math.round((n3 - c2.x) / t2[f2]), v2 = Math.round((r2 - c2.y) / t2[d2]);
|
2380
|
+
l2[f2] = Math.max(a2.left, Math.min(a2.right, h2 * t2[f2] + c2.x)), l2[d2] = Math.max(a2.top, Math.min(a2.bottom, v2 * t2[d2] + c2.y));
|
2381
|
+
}
|
2382
|
+
return l2;
|
2383
|
+
};
|
2384
|
+
return n2.grid = t2, n2.coordFields = e2, n2;
|
2385
|
+
} }), dn = { id: "snappers", install: function(t2) {
|
2386
|
+
var e2 = t2.interactStatic;
|
2387
|
+
e2.snappers = V(e2.snappers || {}, fn), e2.createSnapGrid = e2.snappers.grid;
|
2388
|
+
} }, hn = dn, vn = { start: function(t2) {
|
2389
|
+
var n2 = t2.state, r2 = t2.rect, i2 = t2.edges, o2 = t2.pageCoords, a2 = n2.options, s2 = a2.ratio, c2 = a2.enabled, l2 = n2.options, u2 = l2.equalDelta, p2 = l2.modifiers;
|
2390
|
+
"preserve" === s2 && (s2 = r2.width / r2.height), n2.startCoords = V({}, o2), n2.startRect = V({}, r2), n2.ratio = s2, n2.equalDelta = u2;
|
2391
|
+
var f2 = n2.linkedEdges = { top: i2.top || i2.left && !i2.bottom, left: i2.left || i2.top && !i2.right, bottom: i2.bottom || i2.right && !i2.top, right: i2.right || i2.bottom && !i2.left };
|
2392
|
+
if (n2.xIsPrimaryAxis = !(!i2.left && !i2.right), n2.equalDelta) {
|
2393
|
+
var d2 = (f2.left ? 1 : -1) * (f2.top ? 1 : -1);
|
2394
|
+
n2.edgeSign = { x: d2, y: d2 };
|
2395
|
+
} else
|
2396
|
+
n2.edgeSign = { x: f2.left ? -1 : 1, y: f2.top ? -1 : 1 };
|
2397
|
+
if (false !== c2 && V(i2, f2), null != p2 && p2.length) {
|
2398
|
+
var h2 = new me(t2.interaction);
|
2399
|
+
h2.copyFrom(t2.interaction.modification), h2.prepareStates(p2), n2.subModification = h2, h2.startAll(e({}, t2));
|
2400
|
+
}
|
2401
|
+
}, set: function(t2) {
|
2402
|
+
var n2 = t2.state, r2 = t2.rect, i2 = t2.coords, o2 = n2.linkedEdges, a2 = V({}, i2), s2 = n2.equalDelta ? gn : mn;
|
2403
|
+
if (V(t2.edges, o2), s2(n2, n2.xIsPrimaryAxis, i2, r2), !n2.subModification)
|
2404
|
+
return null;
|
2405
|
+
var c2 = V({}, r2);
|
2406
|
+
H(o2, c2, { x: i2.x - a2.x, y: i2.y - a2.y });
|
2407
|
+
var l2 = n2.subModification.setAll(e(e({}, t2), {}, { rect: c2, edges: o2, pageCoords: i2, prevCoords: i2, prevRect: c2 })), u2 = l2.delta;
|
2408
|
+
l2.changed && (s2(n2, Math.abs(u2.x) > Math.abs(u2.y), l2.coords, l2.rect), V(i2, l2.coords));
|
2409
|
+
return l2.eventProps;
|
2410
|
+
}, defaults: { ratio: "preserve", equalDelta: false, modifiers: [], enabled: false } };
|
2411
|
+
function gn(t2, e2, n2) {
|
2412
|
+
var r2 = t2.startCoords, i2 = t2.edgeSign;
|
2413
|
+
e2 ? n2.y = r2.y + (n2.x - r2.x) * i2.y : n2.x = r2.x + (n2.y - r2.y) * i2.x;
|
2414
|
+
}
|
2415
|
+
function mn(t2, e2, n2, r2) {
|
2416
|
+
var i2 = t2.startRect, o2 = t2.startCoords, a2 = t2.ratio, s2 = t2.edgeSign;
|
2417
|
+
if (e2) {
|
2418
|
+
var c2 = r2.width / a2;
|
2419
|
+
n2.y = o2.y + (c2 - i2.height) * s2.y;
|
2420
|
+
} else {
|
2421
|
+
var l2 = r2.height * a2;
|
2422
|
+
n2.x = o2.x + (l2 - i2.width) * s2.x;
|
2423
|
+
}
|
2424
|
+
}
|
2425
|
+
var yn = be(vn, "aspectRatio"), bn = function() {
|
2426
|
+
};
|
2427
|
+
bn._defaults = {};
|
2428
|
+
var xn = bn;
|
2429
|
+
function wn(t2, e2, n2) {
|
2430
|
+
return w.func(t2) ? G(t2, e2.interactable, e2.element, [n2.x, n2.y, e2]) : G(t2, e2.interactable, e2.element);
|
2431
|
+
}
|
2432
|
+
var En = { start: function(t2) {
|
2433
|
+
var e2 = t2.rect, n2 = t2.startOffset, r2 = t2.state, i2 = t2.interaction, o2 = t2.pageCoords, a2 = r2.options, s2 = a2.elementRect, c2 = V({ left: 0, top: 0, right: 0, bottom: 0 }, a2.offset || {});
|
2434
|
+
if (e2 && s2) {
|
2435
|
+
var l2 = wn(a2.restriction, i2, o2);
|
2436
|
+
if (l2) {
|
2437
|
+
var u2 = l2.right - l2.left - e2.width, p2 = l2.bottom - l2.top - e2.height;
|
2438
|
+
u2 < 0 && (c2.left += u2, c2.right += u2), p2 < 0 && (c2.top += p2, c2.bottom += p2);
|
2439
|
+
}
|
2440
|
+
c2.left += n2.left - e2.width * s2.left, c2.top += n2.top - e2.height * s2.top, c2.right += n2.right - e2.width * (1 - s2.right), c2.bottom += n2.bottom - e2.height * (1 - s2.bottom);
|
2441
|
+
}
|
2442
|
+
r2.offset = c2;
|
2443
|
+
}, set: function(t2) {
|
2444
|
+
var e2 = t2.coords, n2 = t2.interaction, r2 = t2.state, i2 = r2.options, o2 = r2.offset, a2 = wn(i2.restriction, n2, e2);
|
2445
|
+
if (a2) {
|
2446
|
+
var s2 = function(t3) {
|
2447
|
+
return !t3 || "left" in t3 && "top" in t3 || ((t3 = V({}, t3)).left = t3.x || 0, t3.top = t3.y || 0, t3.right = t3.right || t3.left + t3.width, t3.bottom = t3.bottom || t3.top + t3.height), t3;
|
2448
|
+
}(a2);
|
2449
|
+
e2.x = Math.max(Math.min(s2.right - o2.right, e2.x), s2.left + o2.left), e2.y = Math.max(Math.min(s2.bottom - o2.bottom, e2.y), s2.top + o2.top);
|
2450
|
+
}
|
2451
|
+
}, defaults: { restriction: null, elementRect: null, offset: null, endOnly: false, enabled: false } }, Tn = be(En, "restrict"), Sn = { top: 1 / 0, left: 1 / 0, bottom: -1 / 0, right: -1 / 0 }, _n = { top: -1 / 0, left: -1 / 0, bottom: 1 / 0, right: 1 / 0 };
|
2452
|
+
function Pn(t2, e2) {
|
2453
|
+
for (var n2 = 0, r2 = ["top", "left", "bottom", "right"]; n2 < r2.length; n2++) {
|
2454
|
+
var i2 = r2[n2];
|
2455
|
+
i2 in t2 || (t2[i2] = e2[i2]);
|
2456
|
+
}
|
2457
|
+
return t2;
|
2458
|
+
}
|
2459
|
+
var On = { noInner: Sn, noOuter: _n, start: function(t2) {
|
2460
|
+
var e2, n2 = t2.interaction, r2 = t2.startOffset, i2 = t2.state, o2 = i2.options;
|
2461
|
+
o2 && (e2 = N(wn(o2.offset, n2, n2.coords.start.page))), e2 = e2 || { x: 0, y: 0 }, i2.offset = { top: e2.y + r2.top, left: e2.x + r2.left, bottom: e2.y - r2.bottom, right: e2.x - r2.right };
|
2462
|
+
}, set: function(t2) {
|
2463
|
+
var e2 = t2.coords, n2 = t2.edges, r2 = t2.interaction, i2 = t2.state, o2 = i2.offset, a2 = i2.options;
|
2464
|
+
if (n2) {
|
2465
|
+
var s2 = V({}, e2), c2 = wn(a2.inner, r2, s2) || {}, l2 = wn(a2.outer, r2, s2) || {};
|
2466
|
+
Pn(c2, Sn), Pn(l2, _n), n2.top ? e2.y = Math.min(Math.max(l2.top + o2.top, s2.y), c2.top + o2.top) : n2.bottom && (e2.y = Math.max(Math.min(l2.bottom + o2.bottom, s2.y), c2.bottom + o2.bottom)), n2.left ? e2.x = Math.min(Math.max(l2.left + o2.left, s2.x), c2.left + o2.left) : n2.right && (e2.x = Math.max(Math.min(l2.right + o2.right, s2.x), c2.right + o2.right));
|
2467
|
+
}
|
2468
|
+
}, defaults: { inner: null, outer: null, offset: null, endOnly: false, enabled: false } }, kn = be(On, "restrictEdges"), Dn = V({ get elementRect() {
|
2469
|
+
return { top: 0, left: 0, bottom: 1, right: 1 };
|
2470
|
+
}, set elementRect(t2) {
|
2471
|
+
} }, En.defaults), In = be({ start: En.start, set: En.set, defaults: Dn }, "restrictRect"), Mn = { width: -1 / 0, height: -1 / 0 }, zn = { width: 1 / 0, height: 1 / 0 };
|
2472
|
+
var An = be({ start: function(t2) {
|
2473
|
+
return On.start(t2);
|
2474
|
+
}, set: function(t2) {
|
2475
|
+
var e2 = t2.interaction, n2 = t2.state, r2 = t2.rect, i2 = t2.edges, o2 = n2.options;
|
2476
|
+
if (i2) {
|
2477
|
+
var a2 = U(wn(o2.min, e2, t2.coords)) || Mn, s2 = U(wn(o2.max, e2, t2.coords)) || zn;
|
2478
|
+
n2.options = { endOnly: o2.endOnly, inner: V({}, On.noInner), outer: V({}, On.noOuter) }, i2.top ? (n2.options.inner.top = r2.bottom - a2.height, n2.options.outer.top = r2.bottom - s2.height) : i2.bottom && (n2.options.inner.bottom = r2.top + a2.height, n2.options.outer.bottom = r2.top + s2.height), i2.left ? (n2.options.inner.left = r2.right - a2.width, n2.options.outer.left = r2.right - s2.width) : i2.right && (n2.options.inner.right = r2.left + a2.width, n2.options.outer.right = r2.left + s2.width), On.set(t2), n2.options = o2;
|
2479
|
+
}
|
2480
|
+
}, defaults: { min: null, max: null, endOnly: false, enabled: false } }, "restrictSize");
|
2481
|
+
var Rn = { start: function(t2) {
|
2482
|
+
var e2, n2 = t2.interaction, r2 = t2.interactable, i2 = t2.element, o2 = t2.rect, a2 = t2.state, s2 = t2.startOffset, c2 = a2.options, l2 = c2.offsetWithOrigin ? function(t3) {
|
2483
|
+
var e3 = t3.interaction.element, n3 = N(G(t3.state.options.origin, null, null, [e3])), r3 = n3 || K(t3.interactable, e3, t3.interaction.prepared.name);
|
2484
|
+
return r3;
|
2485
|
+
}(t2) : { x: 0, y: 0 };
|
2486
|
+
if ("startCoords" === c2.offset)
|
2487
|
+
e2 = { x: n2.coords.start.page.x, y: n2.coords.start.page.y };
|
2488
|
+
else {
|
2489
|
+
var u2 = G(c2.offset, r2, i2, [n2]);
|
2490
|
+
(e2 = N(u2) || { x: 0, y: 0 }).x += l2.x, e2.y += l2.y;
|
2491
|
+
}
|
2492
|
+
var p2 = c2.relativePoints;
|
2493
|
+
a2.offsets = o2 && p2 && p2.length ? p2.map(function(t3, n3) {
|
2494
|
+
return { index: n3, relativePoint: t3, x: s2.left - o2.width * t3.x + e2.x, y: s2.top - o2.height * t3.y + e2.y };
|
2495
|
+
}) : [{ index: 0, relativePoint: null, x: e2.x, y: e2.y }];
|
2496
|
+
}, set: function(t2) {
|
2497
|
+
var e2 = t2.interaction, n2 = t2.coords, r2 = t2.state, i2 = r2.options, o2 = r2.offsets, a2 = K(e2.interactable, e2.element, e2.prepared.name), s2 = V({}, n2), c2 = [];
|
2498
|
+
i2.offsetWithOrigin || (s2.x -= a2.x, s2.y -= a2.y);
|
2499
|
+
for (var l2 = 0, u2 = o2; l2 < u2.length; l2++)
|
2500
|
+
for (var p2 = u2[l2], f2 = s2.x - p2.x, d2 = s2.y - p2.y, h2 = 0, v2 = i2.targets.length; h2 < v2; h2++) {
|
2501
|
+
var g2 = i2.targets[h2], m2 = void 0;
|
2502
|
+
(m2 = w.func(g2) ? g2(f2, d2, e2._proxy, p2, h2) : g2) && c2.push({ x: (w.number(m2.x) ? m2.x : f2) + p2.x, y: (w.number(m2.y) ? m2.y : d2) + p2.y, range: w.number(m2.range) ? m2.range : i2.range, source: g2, index: h2, offset: p2 });
|
2503
|
+
}
|
2504
|
+
for (var y2 = { target: null, inRange: false, distance: 0, range: 0, delta: { x: 0, y: 0 } }, b2 = 0; b2 < c2.length; b2++) {
|
2505
|
+
var x2 = c2[b2], E2 = x2.range, T2 = x2.x - s2.x, S2 = x2.y - s2.y, _2 = Q(T2, S2), P2 = _2 <= E2;
|
2506
|
+
E2 === 1 / 0 && y2.inRange && y2.range !== 1 / 0 && (P2 = false), y2.target && !(P2 ? y2.inRange && E2 !== 1 / 0 ? _2 / E2 < y2.distance / y2.range : E2 === 1 / 0 && y2.range !== 1 / 0 || _2 < y2.distance : !y2.inRange && _2 < y2.distance) || (y2.target = x2, y2.distance = _2, y2.range = E2, y2.inRange = P2, y2.delta.x = T2, y2.delta.y = S2);
|
2507
|
+
}
|
2508
|
+
return y2.inRange && (n2.x = y2.target.x, n2.y = y2.target.y), r2.closest = y2, y2;
|
2509
|
+
}, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: true, origin: null, relativePoints: null, endOnly: false, enabled: false } }, Cn = be(Rn, "snap");
|
2510
|
+
var jn = { start: function(t2) {
|
2511
|
+
var e2 = t2.state, n2 = t2.edges, r2 = e2.options;
|
2512
|
+
if (!n2)
|
2513
|
+
return null;
|
2514
|
+
t2.state = { options: { targets: null, relativePoints: [{ x: n2.left ? 0 : 1, y: n2.top ? 0 : 1 }], offset: r2.offset || "self", origin: { x: 0, y: 0 }, range: r2.range } }, e2.targetFields = e2.targetFields || [["width", "height"], ["x", "y"]], Rn.start(t2), e2.offsets = t2.state.offsets, t2.state = e2;
|
2515
|
+
}, set: function(t2) {
|
2516
|
+
var e2 = t2.interaction, n2 = t2.state, r2 = t2.coords, i2 = n2.options, o2 = n2.offsets, a2 = { x: r2.x - o2[0].x, y: r2.y - o2[0].y };
|
2517
|
+
n2.options = V({}, i2), n2.options.targets = [];
|
2518
|
+
for (var s2 = 0, c2 = i2.targets || []; s2 < c2.length; s2++) {
|
2519
|
+
var l2 = c2[s2], u2 = void 0;
|
2520
|
+
if (u2 = w.func(l2) ? l2(a2.x, a2.y, e2) : l2) {
|
2521
|
+
for (var p2 = 0, f2 = n2.targetFields; p2 < f2.length; p2++) {
|
2522
|
+
var d2 = f2[p2], h2 = d2[0], v2 = d2[1];
|
2523
|
+
if (h2 in u2 || v2 in u2) {
|
2524
|
+
u2.x = u2[h2], u2.y = u2[v2];
|
2525
|
+
break;
|
2526
|
+
}
|
2527
|
+
}
|
2528
|
+
n2.options.targets.push(u2);
|
2529
|
+
}
|
2530
|
+
}
|
2531
|
+
var g2 = Rn.set(t2);
|
2532
|
+
return n2.options = i2, g2;
|
2533
|
+
}, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: false, enabled: false } }, Fn = be(jn, "snapSize");
|
2534
|
+
var Xn = { aspectRatio: yn, restrictEdges: kn, restrict: Tn, restrictRect: In, restrictSize: An, snapEdges: be({ start: function(t2) {
|
2535
|
+
var e2 = t2.edges;
|
2536
|
+
return e2 ? (t2.state.targetFields = t2.state.targetFields || [[e2.left ? "left" : "right", e2.top ? "top" : "bottom"]], jn.start(t2)) : null;
|
2537
|
+
}, set: jn.set, defaults: V(ge(jn.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: Cn, snapSize: Fn, spring: xn, avoid: xn, transform: xn, rubberband: xn }, Yn = { id: "modifiers", install: function(t2) {
|
2538
|
+
var e2 = t2.interactStatic;
|
2539
|
+
for (var n2 in t2.usePlugin(Ee), t2.usePlugin(hn), e2.modifiers = Xn, Xn) {
|
2540
|
+
var r2 = Xn[n2], i2 = r2._defaults, o2 = r2._methods;
|
2541
|
+
i2._methods = o2, t2.defaults.perAction[n2] = i2;
|
2542
|
+
}
|
2543
|
+
} }, Ln = Yn, qn = function(t2) {
|
2544
|
+
s(n2, t2);
|
2545
|
+
var e2 = p(n2);
|
2546
|
+
function n2(t3, i2, o2, a2, s2, c2) {
|
2547
|
+
var l2;
|
2548
|
+
if (r(this, n2), tt(u(l2 = e2.call(this, s2)), o2), o2 !== i2 && tt(u(l2), i2), l2.timeStamp = c2, l2.originalEvent = o2, l2.type = t3, l2.pointerId = at(i2), l2.pointerType = dt(i2), l2.target = a2, l2.currentTarget = null, "tap" === t3) {
|
2549
|
+
var p2 = s2.getPointerIndex(i2);
|
2550
|
+
l2.dt = l2.timeStamp - s2.pointers[p2].downTime;
|
2551
|
+
var f2 = l2.timeStamp - s2.tapTime;
|
2552
|
+
l2.double = !!s2.prevTap && "doubletap" !== s2.prevTap.type && s2.prevTap.target === l2.target && f2 < 500;
|
2553
|
+
} else
|
2554
|
+
"doubletap" === t3 && (l2.dt = i2.timeStamp - s2.tapTime, l2.double = true);
|
2555
|
+
return l2;
|
2556
|
+
}
|
2557
|
+
return o(n2, [{ key: "_subtractOrigin", value: function(t3) {
|
2558
|
+
var e3 = t3.x, n3 = t3.y;
|
2559
|
+
return this.pageX -= e3, this.pageY -= n3, this.clientX -= e3, this.clientY -= n3, this;
|
2560
|
+
} }, { key: "_addOrigin", value: function(t3) {
|
2561
|
+
var e3 = t3.x, n3 = t3.y;
|
2562
|
+
return this.pageX += e3, this.pageY += n3, this.clientX += e3, this.clientY += n3, this;
|
2563
|
+
} }, { key: "preventDefault", value: function() {
|
2564
|
+
this.originalEvent.preventDefault();
|
2565
|
+
} }]), n2;
|
2566
|
+
}(vt), Bn = { id: "pointer-events/base", before: ["inertia", "modifiers", "auto-start", "actions"], install: function(t2) {
|
2567
|
+
t2.pointerEvents = Bn, t2.defaults.actions.pointerEvents = Bn.defaults, V(t2.actions.phaselessTypes, Bn.types);
|
2568
|
+
}, listeners: { "interactions:new": function(t2) {
|
2569
|
+
var e2 = t2.interaction;
|
2570
|
+
e2.prevTap = null, e2.tapTime = 0;
|
2571
|
+
}, "interactions:update-pointer": function(t2) {
|
2572
|
+
var e2 = t2.down, n2 = t2.pointerInfo;
|
2573
|
+
if (!e2 && n2.hold)
|
2574
|
+
return;
|
2575
|
+
n2.hold = { duration: 1 / 0, timeout: null };
|
2576
|
+
}, "interactions:move": function(t2, e2) {
|
2577
|
+
var n2 = t2.interaction, r2 = t2.pointer, i2 = t2.event, o2 = t2.eventTarget;
|
2578
|
+
t2.duplicate || n2.pointerIsDown && !n2.pointerWasMoved || (n2.pointerIsDown && Gn(t2), Vn({ interaction: n2, pointer: r2, event: i2, eventTarget: o2, type: "move" }, e2));
|
2579
|
+
}, "interactions:down": function(t2, e2) {
|
2580
|
+
!function(t3, e3) {
|
2581
|
+
for (var n2 = t3.interaction, r2 = t3.pointer, i2 = t3.event, o2 = t3.eventTarget, a2 = t3.pointerIndex, s2 = n2.pointers[a2].hold, c2 = q(o2), l2 = { interaction: n2, pointer: r2, event: i2, eventTarget: o2, type: "hold", targets: [], path: c2, node: null }, u2 = 0; u2 < c2.length; u2++) {
|
2582
|
+
var p2 = c2[u2];
|
2583
|
+
l2.node = p2, e3.fire("pointerEvents:collect-targets", l2);
|
2584
|
+
}
|
2585
|
+
if (!l2.targets.length)
|
2586
|
+
return;
|
2587
|
+
for (var f2 = 1 / 0, d2 = 0, h2 = l2.targets; d2 < h2.length; d2++) {
|
2588
|
+
var v2 = h2[d2].eventable.options.holdDuration;
|
2589
|
+
v2 < f2 && (f2 = v2);
|
2590
|
+
}
|
2591
|
+
s2.duration = f2, s2.timeout = setTimeout(function() {
|
2592
|
+
Vn({ interaction: n2, eventTarget: o2, pointer: r2, event: i2, type: "hold" }, e3);
|
2593
|
+
}, f2);
|
2594
|
+
}(t2, e2), Vn(t2, e2);
|
2595
|
+
}, "interactions:up": function(t2, e2) {
|
2596
|
+
Gn(t2), Vn(t2, e2), function(t3, e3) {
|
2597
|
+
var n2 = t3.interaction, r2 = t3.pointer, i2 = t3.event, o2 = t3.eventTarget;
|
2598
|
+
n2.pointerWasMoved || Vn({ interaction: n2, eventTarget: o2, pointer: r2, event: i2, type: "tap" }, e3);
|
2599
|
+
}(t2, e2);
|
2600
|
+
}, "interactions:cancel": function(t2, e2) {
|
2601
|
+
Gn(t2), Vn(t2, e2);
|
2602
|
+
} }, PointerEvent: qn, fire: Vn, collectEventTargets: Wn, defaults: { holdDuration: 600, ignoreFrom: null, allowFrom: null, origin: { x: 0, y: 0 } }, types: { down: true, move: true, up: true, cancel: true, tap: true, doubletap: true, hold: true } };
|
2603
|
+
function Vn(t2, e2) {
|
2604
|
+
var n2 = t2.interaction, r2 = t2.pointer, i2 = t2.event, o2 = t2.eventTarget, a2 = t2.type, s2 = t2.targets, c2 = void 0 === s2 ? Wn(t2, e2) : s2, l2 = new qn(a2, r2, i2, o2, n2, e2.now());
|
2605
|
+
e2.fire("pointerEvents:new", { pointerEvent: l2 });
|
2606
|
+
for (var u2 = { interaction: n2, pointer: r2, event: i2, eventTarget: o2, targets: c2, type: a2, pointerEvent: l2 }, p2 = 0; p2 < c2.length; p2++) {
|
2607
|
+
var f2 = c2[p2];
|
2608
|
+
for (var d2 in f2.props || {})
|
2609
|
+
l2[d2] = f2.props[d2];
|
2610
|
+
var h2 = K(f2.eventable, f2.node);
|
2611
|
+
if (l2._subtractOrigin(h2), l2.eventable = f2.eventable, l2.currentTarget = f2.node, f2.eventable.fire(l2), l2._addOrigin(h2), l2.immediatePropagationStopped || l2.propagationStopped && p2 + 1 < c2.length && c2[p2 + 1].node !== l2.currentTarget)
|
2612
|
+
break;
|
2613
|
+
}
|
2614
|
+
if (e2.fire("pointerEvents:fired", u2), "tap" === a2) {
|
2615
|
+
var v2 = l2.double ? Vn({ interaction: n2, pointer: r2, event: i2, eventTarget: o2, type: "doubletap" }, e2) : l2;
|
2616
|
+
n2.prevTap = v2, n2.tapTime = v2.timeStamp;
|
2617
|
+
}
|
2618
|
+
return l2;
|
2619
|
+
}
|
2620
|
+
function Wn(t2, e2) {
|
2621
|
+
var n2 = t2.interaction, r2 = t2.pointer, i2 = t2.event, o2 = t2.eventTarget, a2 = t2.type, s2 = n2.getPointerIndex(r2), c2 = n2.pointers[s2];
|
2622
|
+
if ("tap" === a2 && (n2.pointerWasMoved || !c2 || c2.downTarget !== o2))
|
2623
|
+
return [];
|
2624
|
+
for (var l2 = q(o2), u2 = { interaction: n2, pointer: r2, event: i2, eventTarget: o2, type: a2, path: l2, targets: [], node: null }, p2 = 0; p2 < l2.length; p2++) {
|
2625
|
+
var f2 = l2[p2];
|
2626
|
+
u2.node = f2, e2.fire("pointerEvents:collect-targets", u2);
|
2627
|
+
}
|
2628
|
+
return "hold" === a2 && (u2.targets = u2.targets.filter(function(t3) {
|
2629
|
+
var e3, r3;
|
2630
|
+
return t3.eventable.options.holdDuration === (null == (e3 = n2.pointers[s2]) || null == (r3 = e3.hold) ? void 0 : r3.duration);
|
2631
|
+
})), u2.targets;
|
2632
|
+
}
|
2633
|
+
function Gn(t2) {
|
2634
|
+
var e2 = t2.interaction, n2 = t2.pointerIndex, r2 = e2.pointers[n2].hold;
|
2635
|
+
r2 && r2.timeout && (clearTimeout(r2.timeout), r2.timeout = null);
|
2636
|
+
}
|
2637
|
+
var Nn = Object.freeze({ __proto__: null, default: Bn });
|
2638
|
+
function Un(t2) {
|
2639
|
+
var e2 = t2.interaction;
|
2640
|
+
e2.holdIntervalHandle && (clearInterval(e2.holdIntervalHandle), e2.holdIntervalHandle = null);
|
2641
|
+
}
|
2642
|
+
var Hn = { id: "pointer-events/holdRepeat", install: function(t2) {
|
2643
|
+
t2.usePlugin(Bn);
|
2644
|
+
var e2 = t2.pointerEvents;
|
2645
|
+
e2.defaults.holdRepeatInterval = 0, e2.types.holdrepeat = t2.actions.phaselessTypes.holdrepeat = true;
|
2646
|
+
}, listeners: ["move", "up", "cancel", "endall"].reduce(function(t2, e2) {
|
2647
|
+
return t2["pointerEvents:".concat(e2)] = Un, t2;
|
2648
|
+
}, { "pointerEvents:new": function(t2) {
|
2649
|
+
var e2 = t2.pointerEvent;
|
2650
|
+
"hold" === e2.type && (e2.count = (e2.count || 0) + 1);
|
2651
|
+
}, "pointerEvents:fired": function(t2, e2) {
|
2652
|
+
var n2 = t2.interaction, r2 = t2.pointerEvent, i2 = t2.eventTarget, o2 = t2.targets;
|
2653
|
+
if ("hold" === r2.type && o2.length) {
|
2654
|
+
var a2 = o2[0].eventable.options.holdRepeatInterval;
|
2655
|
+
a2 <= 0 || (n2.holdIntervalHandle = setTimeout(function() {
|
2656
|
+
e2.pointerEvents.fire({ interaction: n2, eventTarget: i2, type: "hold", pointer: r2, event: r2 }, e2);
|
2657
|
+
}, a2));
|
2658
|
+
}
|
2659
|
+
} }) }, Kn = Hn;
|
2660
|
+
var $n = { id: "pointer-events/interactableTargets", install: function(t2) {
|
2661
|
+
var e2 = t2.Interactable;
|
2662
|
+
e2.prototype.pointerEvents = function(t3) {
|
2663
|
+
return V(this.events.options, t3), this;
|
2664
|
+
};
|
2665
|
+
var n2 = e2.prototype._backCompatOption;
|
2666
|
+
e2.prototype._backCompatOption = function(t3, e3) {
|
2667
|
+
var r2 = n2.call(this, t3, e3);
|
2668
|
+
return r2 === this && (this.events.options[t3] = e3), r2;
|
2669
|
+
};
|
2670
|
+
}, listeners: { "pointerEvents:collect-targets": function(t2, e2) {
|
2671
|
+
var n2 = t2.targets, r2 = t2.node, i2 = t2.type, o2 = t2.eventTarget;
|
2672
|
+
e2.interactables.forEachMatch(r2, function(t3) {
|
2673
|
+
var e3 = t3.events, a2 = e3.options;
|
2674
|
+
e3.types[i2] && e3.types[i2].length && t3.testIgnoreAllow(a2, r2, o2) && n2.push({ node: r2, eventable: e3, props: { interactable: t3 } });
|
2675
|
+
});
|
2676
|
+
}, "interactable:new": function(t2) {
|
2677
|
+
var e2 = t2.interactable;
|
2678
|
+
e2.events.getRect = function(t3) {
|
2679
|
+
return e2.getRect(t3);
|
2680
|
+
};
|
2681
|
+
}, "interactable:set": function(t2, e2) {
|
2682
|
+
var n2 = t2.interactable, r2 = t2.options;
|
2683
|
+
V(n2.events.options, e2.pointerEvents.defaults), V(n2.events.options, r2.pointerEvents || {});
|
2684
|
+
} } }, Jn = $n, Qn = { id: "pointer-events", install: function(t2) {
|
2685
|
+
t2.usePlugin(Nn), t2.usePlugin(Kn), t2.usePlugin(Jn);
|
2686
|
+
} }, Zn = Qn;
|
2687
|
+
var tr = { id: "reflow", install: function(t2) {
|
2688
|
+
var e2 = t2.Interactable;
|
2689
|
+
t2.actions.phases.reflow = true, e2.prototype.reflow = function(e3) {
|
2690
|
+
return function(t3, e4, n2) {
|
2691
|
+
for (var r2 = t3.getAllElements(), i2 = n2.window.Promise, o2 = i2 ? [] : null, a2 = function() {
|
2692
|
+
var a3 = r2[s2], c2 = t3.getRect(a3);
|
2693
|
+
if (!c2)
|
2694
|
+
return 1;
|
2695
|
+
var l2, u2 = bt(n2.interactions.list, function(n3) {
|
2696
|
+
return n3.interacting() && n3.interactable === t3 && n3.element === a3 && n3.prepared.name === e4.name;
|
2697
|
+
});
|
2698
|
+
if (u2)
|
2699
|
+
u2.move(), o2 && (l2 = u2._reflowPromise || new i2(function(t4) {
|
2700
|
+
u2._reflowResolve = t4;
|
2701
|
+
}));
|
2702
|
+
else {
|
2703
|
+
var p2 = U(c2), f2 = /* @__PURE__ */ function(t4) {
|
2704
|
+
return { coords: t4, get page() {
|
2705
|
+
return this.coords.page;
|
2706
|
+
}, get client() {
|
2707
|
+
return this.coords.client;
|
2708
|
+
}, get timeStamp() {
|
2709
|
+
return this.coords.timeStamp;
|
2710
|
+
}, get pageX() {
|
2711
|
+
return this.coords.page.x;
|
2712
|
+
}, get pageY() {
|
2713
|
+
return this.coords.page.y;
|
2714
|
+
}, get clientX() {
|
2715
|
+
return this.coords.client.x;
|
2716
|
+
}, get clientY() {
|
2717
|
+
return this.coords.client.y;
|
2718
|
+
}, get pointerId() {
|
2719
|
+
return this.coords.pointerId;
|
2720
|
+
}, get target() {
|
2721
|
+
return this.coords.target;
|
2722
|
+
}, get type() {
|
2723
|
+
return this.coords.type;
|
2724
|
+
}, get pointerType() {
|
2725
|
+
return this.coords.pointerType;
|
2726
|
+
}, get buttons() {
|
2727
|
+
return this.coords.buttons;
|
2728
|
+
}, preventDefault: function() {
|
2729
|
+
} };
|
2730
|
+
}({ page: { x: p2.x, y: p2.y }, client: { x: p2.x, y: p2.y }, timeStamp: n2.now() });
|
2731
|
+
l2 = function(t4, e5, n3, r3, i3) {
|
2732
|
+
var o3 = t4.interactions.new({ pointerType: "reflow" }), a4 = { interaction: o3, event: i3, pointer: i3, eventTarget: n3, phase: "reflow" };
|
2733
|
+
o3.interactable = e5, o3.element = n3, o3.prevEvent = i3, o3.updatePointer(i3, i3, n3, true), nt(o3.coords.delta), Ut(o3.prepared, r3), o3._doPhase(a4);
|
2734
|
+
var s3 = t4.window, c3 = s3.Promise, l3 = c3 ? new c3(function(t5) {
|
2735
|
+
o3._reflowResolve = t5;
|
2736
|
+
}) : void 0;
|
2737
|
+
o3._reflowPromise = l3, o3.start(r3, e5, n3), o3._interacting ? (o3.move(a4), o3.end(i3)) : (o3.stop(), o3._reflowResolve());
|
2738
|
+
return o3.removePointer(i3, i3), l3;
|
2739
|
+
}(n2, t3, a3, e4, f2);
|
2740
|
+
}
|
2741
|
+
o2 && o2.push(l2);
|
2742
|
+
}, s2 = 0; s2 < r2.length && !a2(); s2++)
|
2743
|
+
;
|
2744
|
+
return o2 && i2.all(o2).then(function() {
|
2745
|
+
return t3;
|
2746
|
+
});
|
2747
|
+
}(this, e3, t2);
|
2748
|
+
};
|
2749
|
+
}, listeners: { "interactions:stop": function(t2, e2) {
|
2750
|
+
var n2 = t2.interaction;
|
2751
|
+
"reflow" === n2.pointerType && (n2._reflowResolve && n2._reflowResolve(), function(t3, e3) {
|
2752
|
+
t3.splice(t3.indexOf(e3), 1);
|
2753
|
+
}(e2.interactions.list, n2));
|
2754
|
+
} } }, er = tr;
|
2755
|
+
if (un.use(he), un.use(Ce), un.use(Zn), un.use(qe), un.use(Ln), un.use(pe), un.use(Xt), un.use(Gt), un.use(er), un.default = un, "object" === ("undefined" == typeof module ? "undefined" : n(module)) && module)
|
2756
|
+
try {
|
2757
|
+
module.exports = un;
|
2758
|
+
} catch (t2) {
|
2759
|
+
}
|
2760
|
+
return un.default = un, un;
|
2761
|
+
});
|
2762
|
+
}
|
2763
|
+
});
|
2764
|
+
|
2765
|
+
// build/fullscreen-view.js
|
2766
|
+
var fullscreen_view_exports = {};
|
2767
|
+
__export(fullscreen_view_exports, {
|
2768
|
+
default: () => fullscreen_view_default
|
2769
|
+
});
|
2770
|
+
function createPlayerElement(stream, container) {
|
2771
|
+
const element = document.createElement("video");
|
2772
|
+
element.controls = true;
|
2773
|
+
container.appendChild(element);
|
2774
|
+
element.muted = true;
|
2775
|
+
element.autoplay = true;
|
2776
|
+
element.srcObject = stream;
|
2777
|
+
return element;
|
2778
|
+
}
|
2779
|
+
async function maybeCreatePlayer(created, source, url) {
|
2780
|
+
if (!created.find((c) => c.source.id == source.id && c.source.key == source.key)) {
|
2781
|
+
const container = document.getElementById(mkContainerId(source)) || void 0;
|
2782
|
+
const client = new MyWhepClient({ url, container, streamId: source.id, streamKey: source.key });
|
2783
|
+
await client.start();
|
2784
|
+
const next = [...created];
|
2785
|
+
next.push({
|
2786
|
+
source,
|
2787
|
+
client
|
2788
|
+
});
|
2789
|
+
return next;
|
2790
|
+
} else {
|
2791
|
+
return created;
|
2792
|
+
}
|
2793
|
+
}
|
2794
|
+
function FullScreenView(multiCamera) {
|
2795
|
+
const [state, setState] = (0, import_react2.useState)({ createdClient: [], livePreviewSource: void 0, overlays: [] });
|
2796
|
+
const overlayRefs = (0, import_react2.useRef)([]);
|
2797
|
+
const refLivePreviewVideo = (0, import_react2.useRef)(null);
|
2798
|
+
(0, import_react2.useEffect)(() => {
|
2799
|
+
const promise = async () => {
|
2800
|
+
let nextCreated = state.createdClient;
|
2801
|
+
for (const entry of multiCamera.state.players) {
|
2802
|
+
nextCreated = await maybeCreatePlayer(nextCreated, entry.source, entry.player);
|
2803
|
+
}
|
2804
|
+
if (multiCamera.state.previewPlayerUrl)
|
2805
|
+
nextCreated = await maybeCreatePlayer(nextCreated, { id: "preview" }, multiCamera.state.previewPlayerUrl);
|
2806
|
+
let initialLivePreviewSource;
|
2807
|
+
if (state.livePreviewSource === void 0) {
|
2808
|
+
const fallbackSource = nextCreated.find((s) => s.source.id === "fallback");
|
2809
|
+
if (fallbackSource) {
|
2810
|
+
initialLivePreviewSource = fallbackSource;
|
2811
|
+
}
|
2812
|
+
}
|
2813
|
+
setState({ ...state, createdClient: nextCreated, livePreviewSource: initialLivePreviewSource });
|
2814
|
+
for (const c of nextCreated) {
|
2815
|
+
if (!multiCamera.state.players.find((s) => s.source.id == c.source.id && s.source.key == s.source.key)) {
|
2816
|
+
c.client.videoElements.forEach((e) => {
|
2817
|
+
e.remove();
|
2818
|
+
});
|
2819
|
+
}
|
2820
|
+
}
|
2821
|
+
if (refLivePreviewVideo.current) {
|
2822
|
+
(0, import_interactjs.default)(refLivePreviewVideo.current).dropzone({
|
2823
|
+
accept: "video",
|
2824
|
+
ondrop: (e) => {
|
2825
|
+
const video = e.relatedTarget;
|
2826
|
+
const streamId = video.getAttribute("data-streamid");
|
2827
|
+
const streamKey = video.getAttribute("data-streamkey");
|
2828
|
+
if (!streamId) {
|
2829
|
+
} else {
|
2830
|
+
const targetRect = refLivePreviewVideo.current?.getBoundingClientRect();
|
2831
|
+
if (targetRect) {
|
2832
|
+
const relativeX = e.dragEvent.page.x - targetRect?.left;
|
2833
|
+
const relativeY = e.dragEvent.page.y - targetRect?.top;
|
2834
|
+
setState((state2) => {
|
2835
|
+
const sourceVideo = state2.createdClient.find((c) => c.source.id == streamId && c.source.key == streamKey);
|
2836
|
+
if (!sourceVideo) {
|
2837
|
+
console.warn("Couldn't find source to build overlay", { streamId, streamKey });
|
2838
|
+
return state2;
|
2839
|
+
}
|
2840
|
+
const videoRect = video.getBoundingClientRect();
|
2841
|
+
state2.overlays.push({
|
2842
|
+
x: relativeX,
|
2843
|
+
y: relativeY,
|
2844
|
+
width: DEFAULT_OVERLAY_WIDTH,
|
2845
|
+
height: videoRect.height / (videoRect.width / DEFAULT_OVERLAY_WIDTH),
|
2846
|
+
source: sourceVideo
|
2847
|
+
});
|
2848
|
+
return { ...state2 };
|
2849
|
+
});
|
2850
|
+
}
|
2851
|
+
}
|
2852
|
+
}
|
2853
|
+
});
|
2854
|
+
}
|
2855
|
+
};
|
2856
|
+
void promise().catch((e) => {
|
2857
|
+
console.error(e);
|
2858
|
+
});
|
2859
|
+
}, []);
|
2860
|
+
(0, import_react2.useEffect)(() => {
|
2861
|
+
const promise = async () => {
|
2862
|
+
if (!state.livePreviewSource)
|
2863
|
+
return;
|
2864
|
+
await state.livePreviewSource.client.started;
|
2865
|
+
if (refLivePreviewVideo.current && state.livePreviewSource.client.mediaStream) {
|
2866
|
+
const ele = refLivePreviewVideo.current;
|
2867
|
+
refLivePreviewVideo.current.autoplay = true;
|
2868
|
+
refLivePreviewVideo.current.controls = false;
|
2869
|
+
refLivePreviewVideo.current.srcObject = state.livePreviewSource.client.mediaStream;
|
2870
|
+
refLivePreviewVideo.current.oncanplaythrough = () => {
|
2871
|
+
void ele.play();
|
2872
|
+
};
|
2873
|
+
}
|
2874
|
+
};
|
2875
|
+
void promise();
|
2876
|
+
}, [state.livePreviewSource]);
|
2877
|
+
const takeButtonClasses = "text-gray-900 bg-white border border-gray-300 focus:outline-none focus:ring-0 focus:ring-gray-200 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 dark:bg-gray-800 dark:border-gray-600 dark:focus:ring-gray-700 w-full dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700 dark:hover:border-gray-600";
|
2878
|
+
const sourcesSorted = multiCamera.state.availableSources.sort(sortSource).reduce(({ fallback, inputs }, s) => {
|
2879
|
+
if (s.id === "fallback") {
|
2880
|
+
return { fallback: s, inputs };
|
2881
|
+
}
|
2882
|
+
return { fallback, inputs: [...inputs, s] };
|
2883
|
+
}, { fallback: void 0, inputs: [] });
|
2884
|
+
if (sourcesSorted.fallback) {
|
2885
|
+
sourcesSorted.inputs.unshift(sourcesSorted.fallback);
|
2886
|
+
}
|
2887
|
+
return (0, import_jsx_runtime3.jsx)("div", { id: "camera-control-container", className: "bg-gray-50 dark:bg-gray-900", children: (0, import_jsx_runtime3.jsxs)("div", { className: "flex flex-col h-full gap-4 2xl:mx-40 md:mx-6", children: [(0, import_jsx_runtime3.jsxs)("div", { id: "camera-control-preview-grid", className: "mb-6", children: [(0, import_jsx_runtime3.jsx)("h2", { children: "Camera Control" }), (0, import_jsx_runtime3.jsx)("div", { className: "grid 2xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2 xs:grid-cols-2 grid-rows-1 gap-4", children: sourcesSorted.inputs.map((s, i) => {
|
2888
|
+
const isLive = isSourceSwitchSourceEqual(s, multiCamera.state.activeSource);
|
2889
|
+
return (0, import_jsx_runtime3.jsxs)("div", { className: "relative", children: [(0, import_jsx_runtime3.jsx)("div", { className: `${isLive ? "border-green-400 border-solid border-2" : ""}`, id: mkContainerId(s) }), (0, import_jsx_runtime3.jsxs)("button", { className: takeButtonClasses, onClick: (_e) => {
|
2890
|
+
setState({ ...state, livePreviewSource: state.createdClient.find((c) => isSourceSwitchSourceEqual(c.source, s)) });
|
2891
|
+
}, children: ["Preview ", s.key ?? s.id] }), (0, import_jsx_runtime3.jsx)("div", { children: isLive ? (0, import_jsx_runtime3.jsx)("span", { className: "absolute top-2 left-2 z-10 px-1 bg-green-300 text-white dark:text-black cursor-default text-xs", children: "Live" }) : (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, {}) })] }, i);
|
2892
|
+
}) })] }), (0, import_jsx_runtime3.jsxs)("div", { id: "live-views", className: "grid grid-cols-2 gap-4 mb-6", children: [(0, import_jsx_runtime3.jsxs)("div", { id: "video-live-preview", className: "h-full relative 2xl:w-8/12 lg:w-10/12 justify-self-end", children: [(0, import_jsx_runtime3.jsx)("video", { id: "video-live", muted: true, autoPlay: true, ref: refLivePreviewVideo }), state.overlays.map((o, i) => {
|
2893
|
+
return (0, import_jsx_runtime3.jsx)("video", { style: {
|
2894
|
+
position: "absolute",
|
2895
|
+
left: `${o.x}px`,
|
2896
|
+
top: `${o.y}px`,
|
2897
|
+
width: `${o.width}px`,
|
2898
|
+
height: `${o.height}px`
|
2899
|
+
}, muted: true, autoPlay: true, ref: (ref) => {
|
2900
|
+
if (ref) {
|
2901
|
+
ref.srcObject = o.source.client.mediaStream ?? null;
|
2902
|
+
(0, import_interactjs.default)(ref).draggable({
|
2903
|
+
listeners: {
|
2904
|
+
move: (event) => {
|
2905
|
+
o.x += event.dx;
|
2906
|
+
o.y += event.dy;
|
2907
|
+
ref.style.left = `${o.x}px`;
|
2908
|
+
ref.style.top = `${o.y}px`;
|
2909
|
+
}
|
2910
|
+
},
|
2911
|
+
inertia: true,
|
2912
|
+
modifiers: [
|
2913
|
+
import_interactjs.default.modifiers.restrictRect({
|
2914
|
+
restriction: "parent",
|
2915
|
+
endOnly: true
|
2916
|
+
})
|
2917
|
+
]
|
2918
|
+
}).resizable({
|
2919
|
+
// resize from all edges and corners
|
2920
|
+
edges: { left: true, right: true, bottom: true, top: true },
|
2921
|
+
preserveAspectRatio: true,
|
2922
|
+
listeners: {
|
2923
|
+
move(event) {
|
2924
|
+
o.width = event.rect.width;
|
2925
|
+
o.height = event.rect.height;
|
2926
|
+
o.x += event.deltaRect.left;
|
2927
|
+
o.y += event.deltaRect.top;
|
2928
|
+
ref.style.left = `${o.x}px`;
|
2929
|
+
ref.style.top = `${o.y}px`;
|
2930
|
+
ref.style.width = `${o.width}px`;
|
2931
|
+
ref.style.height = `${o.height}px`;
|
2932
|
+
}
|
2933
|
+
}
|
2934
|
+
});
|
2935
|
+
}
|
2936
|
+
overlayRefs.current.push(ref);
|
2937
|
+
} }, i);
|
2938
|
+
}), (0, import_jsx_runtime3.jsxs)("button", { className: takeButtonClasses, onClick: (_e) => {
|
2939
|
+
if (state.livePreviewSource && refLivePreviewVideo.current) {
|
2940
|
+
const parentRect = refLivePreviewVideo.current.getBoundingClientRect();
|
2941
|
+
multiCamera.sendCommand({
|
2942
|
+
type: "select-source",
|
2943
|
+
source: state.livePreviewSource.source,
|
2944
|
+
overlays: state.overlays.map((o) => {
|
2945
|
+
return {
|
2946
|
+
source: o.source.source,
|
2947
|
+
destRect: {
|
2948
|
+
x: o.x / parentRect.width * multiCamera.config.resolution.width,
|
2949
|
+
y: o.y / parentRect.height * multiCamera.config.resolution.height,
|
2950
|
+
width: o.width / parentRect.width * multiCamera.config.resolution.width,
|
2951
|
+
height: o.height / parentRect.height * multiCamera.config.resolution.height
|
2952
|
+
}
|
2953
|
+
};
|
2954
|
+
})
|
2955
|
+
});
|
2956
|
+
}
|
2957
|
+
}, children: ["Take ", state.overlays.length > 0 ? "Composition" : state.livePreviewSource?.source.key ?? state.livePreviewSource?.source.id] }), (0, import_jsx_runtime3.jsxs)("div", { className: "absolute top-0 left-0 z-10 ml-2 mt-2 p-2 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white opacity-70", children: ["Live Preview: ", (0, import_jsx_runtime3.jsx)("span", { id: "active-source-overlay", children: state.livePreviewSource?.source.key ?? state.livePreviewSource?.source.id })] })] }), (0, import_jsx_runtime3.jsxs)("div", { className: "relative 2xl:w-8/12 lg:w-10/12 justify-self-start", children: [(0, import_jsx_runtime3.jsx)("div", { id: "preview-container-preview", className: "w-full" }), (0, import_jsx_runtime3.jsxs)("div", { className: "absolute top-0 left-0 z-10 ml-2 mt-2 p-2 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white opacity-70", children: ["Live Output: ", (0, import_jsx_runtime3.jsx)("span", { id: "active-source-overlay", children: multiCamera.state.activeSource.key ?? multiCamera.state.activeSource.id })] })] })] })] }) });
|
2958
|
+
}
|
2959
|
+
function sortSource(a, b) {
|
2960
|
+
const aKey = a.key || "";
|
2961
|
+
const bKey = b.key || "";
|
2962
|
+
if (aKey > bKey)
|
2963
|
+
return 1;
|
2964
|
+
if (aKey < bKey)
|
2965
|
+
return -1;
|
2966
|
+
return 0;
|
2967
|
+
}
|
2968
|
+
function isSourceSwitchSourceEqual(a, b) {
|
2969
|
+
return a.id === b.id && a.key === b.key;
|
2970
|
+
}
|
2971
|
+
function mkContainerId(source) {
|
2972
|
+
return `preview-container-${source.id}${source.key ? "-" + source.key : ""}`;
|
2973
|
+
}
|
2974
|
+
var import_jsx_runtime3, import_react2, import_interactjs, import_webrtc_client2, DEFAULT_OVERLAY_WIDTH, MyWhepClient, fullscreen_view_default;
|
2975
|
+
var init_fullscreen_view = __esm({
|
2976
|
+
"build/fullscreen-view.js"() {
|
2977
|
+
"use strict";
|
2978
|
+
import_jsx_runtime3 = __toESM(require_jsx_runtime());
|
2979
|
+
import_react2 = __toESM(require_react());
|
2980
|
+
import_interactjs = __toESM(require_interact_min());
|
2981
|
+
import_webrtc_client2 = __toESM(require_webrtc_client());
|
2982
|
+
DEFAULT_OVERLAY_WIDTH = 100;
|
2983
|
+
MyWhepClient = class extends import_webrtc_client2.WhepClient {
|
2984
|
+
started;
|
2985
|
+
resolveStartedPromise;
|
2986
|
+
mediaStream;
|
2987
|
+
streamId;
|
2988
|
+
streamKey;
|
2989
|
+
constructor(config) {
|
2990
|
+
super(config);
|
2991
|
+
this.streamId = config.streamId;
|
2992
|
+
this.streamKey = config.streamKey;
|
2993
|
+
this.started = new Promise((resolve, _reject) => {
|
2994
|
+
this.resolveStartedPromise = resolve;
|
2995
|
+
if (this.mediaStream) {
|
2996
|
+
this.resolveStartedPromise = void 0;
|
2997
|
+
resolve(this.mediaStream);
|
2998
|
+
}
|
2999
|
+
});
|
3000
|
+
}
|
3001
|
+
async handleGotTrack(ev) {
|
3002
|
+
if (ev.track.kind == "video" && ev.streams.length > 0) {
|
3003
|
+
this.outputVideoTracks.push(ev.track);
|
3004
|
+
}
|
3005
|
+
if (ev.track.kind == "audio") {
|
3006
|
+
this.outputAudioTrack = ev.track;
|
3007
|
+
}
|
3008
|
+
if (this.outputAudioTrack && this.outputVideoTracks.length > this.videoElements.length) {
|
3009
|
+
for (let i = 0; i < this.outputVideoTracks.length; i++) {
|
3010
|
+
if (this.videoElements[i])
|
3011
|
+
continue;
|
3012
|
+
let stream = void 0;
|
3013
|
+
if (i == 0) {
|
3014
|
+
stream = new MediaStream([this.outputAudioTrack, this.outputVideoTracks[i]]);
|
3015
|
+
} else {
|
3016
|
+
stream = new MediaStream([this.outputVideoTracks[i]]);
|
3017
|
+
}
|
3018
|
+
if (this.container) {
|
3019
|
+
const e = createPlayerElement(stream, this.container);
|
3020
|
+
this.mediaStream = stream;
|
3021
|
+
this.videoElements.push(e);
|
3022
|
+
this.resolveStartedPromise?.(stream);
|
3023
|
+
e.style.userSelect = "none";
|
3024
|
+
e.style.touchAction = "none";
|
3025
|
+
e.setAttribute("data-streamid", this.streamId);
|
3026
|
+
if (this.streamKey)
|
3027
|
+
e.setAttribute("data-streamkey", this.streamKey);
|
3028
|
+
let element = void 0;
|
3029
|
+
let target = void 0;
|
3030
|
+
(0, import_interactjs.default)(e).draggable({
|
3031
|
+
listeners: {
|
3032
|
+
start: (e2) => {
|
3033
|
+
element = document.createElement("video");
|
3034
|
+
element.controls = false;
|
3035
|
+
element.style.position = "absolute";
|
3036
|
+
element.style.left = `${e2.page.x}px`;
|
3037
|
+
element.style.top = `${e2.page.y}px`;
|
3038
|
+
element.style.width = `${DEFAULT_OVERLAY_WIDTH}px`;
|
3039
|
+
document.body.appendChild(element);
|
3040
|
+
element.muted = true;
|
3041
|
+
element.autoplay = true;
|
3042
|
+
element.srcObject = stream;
|
3043
|
+
return true;
|
3044
|
+
},
|
3045
|
+
move: (e2) => {
|
3046
|
+
if (element) {
|
3047
|
+
element.style.left = `${e2.page.x}px`;
|
3048
|
+
element.style.top = `${e2.page.y}px`;
|
3049
|
+
}
|
3050
|
+
if (e2.dragEnter) {
|
3051
|
+
target = e2.dragEnter;
|
3052
|
+
}
|
3053
|
+
if (e2.dragLeave && target) {
|
3054
|
+
target = void 0;
|
3055
|
+
}
|
3056
|
+
}
|
3057
|
+
}
|
3058
|
+
}).on("dragend", () => {
|
3059
|
+
element?.remove();
|
3060
|
+
});
|
3061
|
+
}
|
3062
|
+
}
|
3063
|
+
}
|
3064
|
+
}
|
3065
|
+
};
|
3066
|
+
fullscreen_view_default = FullScreenView;
|
3067
|
+
}
|
3068
|
+
});
|
3069
|
+
|
3070
|
+
// build/info.js
|
3071
|
+
var import_react3 = __toESM(require_react());
|
3072
|
+
var import_config = __toESM(require_config());
|
3073
|
+
function info_default(R) {
|
3074
|
+
const { defineComponent, Av, common: { Resolutions, FrameRates } } = R;
|
3075
|
+
const InlineView2 = import_react3.default.lazy(async () => Promise.resolve().then(() => (init_inline_view(), inline_view_exports)));
|
3076
|
+
const SummaryView2 = import_react3.default.lazy(async () => Promise.resolve().then(() => (init_summary_view(), summary_view_exports)));
|
3077
|
+
const FullscreenView = import_react3.default.lazy(async () => Promise.resolve().then(() => (init_fullscreen_view(), fullscreen_view_exports)));
|
3078
|
+
return defineComponent({
|
3079
|
+
identifier: "processor.sourceSwitcher",
|
3080
|
+
category: "processor",
|
3081
|
+
name: "Source Switcher",
|
3082
|
+
subscription: {
|
3083
|
+
accepts: {
|
3084
|
+
type: "multi-stream",
|
3085
|
+
media: Av
|
3086
|
+
},
|
3087
|
+
produces: {
|
3088
|
+
type: "single-stream",
|
3089
|
+
media: Av
|
3090
|
+
}
|
3091
|
+
},
|
3092
|
+
extraValidation: (ctx) => {
|
3093
|
+
ctx.subscriptions.forEach((s) => {
|
3094
|
+
if (s.streams.select.includes("audio") && s.streams.select.includes("video")) {
|
3095
|
+
return;
|
3096
|
+
}
|
3097
|
+
ctx.addError("Each subscription for Source Switcher must contain both video *and* audio, subscription to " + s.source + " only contains " + s.streams.select.join(","));
|
3098
|
+
});
|
3099
|
+
},
|
3100
|
+
display: (desc) => {
|
3101
|
+
return {
|
3102
|
+
resolution: desc.config.resolution.width.toString() + "x" + desc.config.resolution.height.toString(),
|
3103
|
+
frameRate: desc.config.frameRate.frames.toString() + "/" + desc.config.frameRate.seconds.toString()
|
3104
|
+
};
|
3105
|
+
},
|
3106
|
+
css: [
|
3107
|
+
"style.css",
|
3108
|
+
"tailwind.css"
|
3109
|
+
],
|
3110
|
+
runtime: {
|
3111
|
+
initialState: () => ({
|
3112
|
+
activeSource: { id: "" },
|
3113
|
+
activeOverlays: [],
|
3114
|
+
availableSources: [],
|
3115
|
+
knownSources: [],
|
3116
|
+
players: []
|
3117
|
+
}),
|
3118
|
+
handleEvent: (ev, state) => {
|
3119
|
+
const evType = ev.type;
|
3120
|
+
switch (evType) {
|
3121
|
+
case "active-source-changed":
|
3122
|
+
return { ...state, activeSource: ev.activeSource };
|
3123
|
+
case "source-online":
|
3124
|
+
state.availableSources.push(ev.source);
|
3125
|
+
return { ...state };
|
3126
|
+
case "player-online":
|
3127
|
+
state.players.push({ source: ev.source, player: ev.url });
|
3128
|
+
return { ...state };
|
3129
|
+
case "preview-player-online":
|
3130
|
+
state.previewPlayerUrl = ev.url;
|
3131
|
+
return { ...state };
|
3132
|
+
case "source-offline": {
|
3133
|
+
const sourceIndex = state.availableSources.findIndex((s) => s.key == ev.source.key && s.id == ev.source.id);
|
3134
|
+
const playerIndex = state.players.findIndex((s) => s.source.key == ev.source.key && s.source.id == ev.source.id);
|
3135
|
+
if (sourceIndex >= 0)
|
3136
|
+
state.availableSources.splice(sourceIndex, 1);
|
3137
|
+
if (playerIndex >= 0)
|
3138
|
+
state.players.splice(playerIndex, 1);
|
3139
|
+
return { ...state };
|
3140
|
+
}
|
3141
|
+
case "sources-discovered": {
|
3142
|
+
state.knownSources = ev.sources;
|
3143
|
+
return { ...state };
|
3144
|
+
}
|
3145
|
+
default:
|
3146
|
+
assertUnreachable(evType);
|
3147
|
+
}
|
3148
|
+
},
|
3149
|
+
inline: InlineView2,
|
3150
|
+
summary: SummaryView2,
|
3151
|
+
fullscreen: FullscreenView
|
3152
|
+
},
|
3153
|
+
configForm: {
|
3154
|
+
global: {
|
3155
|
+
iceServers: (0, import_config.GlobalIceServers)(R),
|
3156
|
+
hardware: (0, import_config.HardwareSelection)()
|
3157
|
+
},
|
3158
|
+
form: {
|
3159
|
+
resolution: {
|
3160
|
+
help: "All video will be normalised to this resolution",
|
3161
|
+
hint: { type: "select", options: Resolutions, defaultValue: { width: 1920, height: 1080 } }
|
3162
|
+
},
|
3163
|
+
frameRate: {
|
3164
|
+
help: "All video will be normalised to this frame rate",
|
3165
|
+
hint: { type: "select", options: FrameRates, defaultValue: { frames: 25, seconds: 1 } }
|
3166
|
+
},
|
3167
|
+
sampleRate: {
|
3168
|
+
help: "All audio will be normalised to this sample rate",
|
3169
|
+
hint: {
|
3170
|
+
defaultValue: 48e3,
|
3171
|
+
type: "select",
|
3172
|
+
options: [
|
3173
|
+
{ value: 48e3, display: "48000" },
|
3174
|
+
{ value: 44100, display: "44100" }
|
3175
|
+
]
|
3176
|
+
}
|
3177
|
+
},
|
3178
|
+
channelLayout: {
|
3179
|
+
help: "All audio will be normalised to this channel layout",
|
3180
|
+
hint: {
|
3181
|
+
defaultValue: "stereo",
|
3182
|
+
type: "select",
|
3183
|
+
options: [
|
3184
|
+
{ value: "mono", display: "Mono" },
|
3185
|
+
{ value: "stereo", display: "Stereo" }
|
3186
|
+
]
|
3187
|
+
}
|
3188
|
+
}
|
3189
|
+
}
|
3190
|
+
}
|
3191
|
+
});
|
3192
|
+
}
|
3193
|
+
function assertUnreachable(_) {
|
3194
|
+
throw new Error("Didn't expect to get here");
|
3195
|
+
}
|
3196
|
+
export {
|
3197
|
+
info_default as default
|
3198
|
+
};
|