evotars 0.0.10 → 0.0.12

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.
@@ -0,0 +1,1968 @@
1
+ import { P as m, r as J, E as w, T as L, U as Q, a as ee, w as y, e as z, C as Z } from "./index-B5GUB2He.js";
2
+ import "./webworkerAll-Bg_9Ksbn.js";
3
+ class M {
4
+ /**
5
+ * @param manager - The event boundary which manages this event. Propagation can only occur
6
+ * within the boundary's jurisdiction.
7
+ */
8
+ constructor(e) {
9
+ this.bubbles = !0, this.cancelBubble = !0, this.cancelable = !1, this.composed = !1, this.defaultPrevented = !1, this.eventPhase = M.prototype.NONE, this.propagationStopped = !1, this.propagationImmediatelyStopped = !1, this.layer = new m(), this.page = new m(), this.NONE = 0, this.CAPTURING_PHASE = 1, this.AT_TARGET = 2, this.BUBBLING_PHASE = 3, this.manager = e;
10
+ }
11
+ /** @readonly */
12
+ get layerX() {
13
+ return this.layer.x;
14
+ }
15
+ /** @readonly */
16
+ get layerY() {
17
+ return this.layer.y;
18
+ }
19
+ /** @readonly */
20
+ get pageX() {
21
+ return this.page.x;
22
+ }
23
+ /** @readonly */
24
+ get pageY() {
25
+ return this.page.y;
26
+ }
27
+ /**
28
+ * Fallback for the deprecated @code{InteractionEvent.data}.
29
+ * @deprecated since 7.0.0
30
+ */
31
+ get data() {
32
+ return this;
33
+ }
34
+ /** The propagation path for this event. Alias for {@link EventBoundary.propagationPath}. */
35
+ composedPath() {
36
+ return this.manager && (!this.path || this.path[this.path.length - 1] !== this.target) && (this.path = this.target ? this.manager.propagationPath(this.target) : []), this.path;
37
+ }
38
+ /**
39
+ * Unimplemented method included for implementing the DOM interface {@code Event}. It will throw an {@code Error}.
40
+ * @deprecated
41
+ * @param _type
42
+ * @param _bubbles
43
+ * @param _cancelable
44
+ */
45
+ initEvent(e, t, i) {
46
+ throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
47
+ }
48
+ /**
49
+ * Unimplemented method included for implementing the DOM interface {@code UIEvent}. It will throw an {@code Error}.
50
+ * @deprecated
51
+ * @param _typeArg
52
+ * @param _bubblesArg
53
+ * @param _cancelableArg
54
+ * @param _viewArg
55
+ * @param _detailArg
56
+ */
57
+ initUIEvent(e, t, i, n, s) {
58
+ throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
59
+ }
60
+ /** Prevent default behavior of PixiJS and the user agent. */
61
+ preventDefault() {
62
+ this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.preventDefault(), this.defaultPrevented = !0;
63
+ }
64
+ /**
65
+ * Stop this event from propagating to any addition listeners, including on the
66
+ * {@link FederatedEventTarget.currentTarget currentTarget} and also the following
67
+ * event targets on the propagation path.
68
+ */
69
+ stopImmediatePropagation() {
70
+ this.propagationImmediatelyStopped = !0;
71
+ }
72
+ /**
73
+ * Stop this event from propagating to the next {@link FederatedEventTarget}. The rest of the listeners
74
+ * on the {@link FederatedEventTarget.currentTarget currentTarget} will still be notified.
75
+ */
76
+ stopPropagation() {
77
+ this.propagationStopped = !0;
78
+ }
79
+ }
80
+ var O = /iPhone/i, C = /iPod/i, S = /iPad/i, U = /\biOS-universal(?:.+)Mac\b/i, k = /\bAndroid(?:.+)Mobile\b/i, H = /Android/i, b = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i, A = /Silk/i, g = /Windows Phone/i, X = /\bWindows(?:.+)ARM\b/i, R = /BlackBerry/i, F = /BB10/i, Y = /Opera Mini/i, K = /\b(CriOS|Chrome)(?:.+)Mobile/i, $ = /Mobile(?:.+)Firefox\b/i, G = function(r) {
81
+ return typeof r < "u" && r.platform === "MacIntel" && typeof r.maxTouchPoints == "number" && r.maxTouchPoints > 1 && typeof MSStream > "u";
82
+ };
83
+ function te(r) {
84
+ return function(e) {
85
+ return e.test(r);
86
+ };
87
+ }
88
+ function W(r) {
89
+ var e = {
90
+ userAgent: "",
91
+ platform: "",
92
+ maxTouchPoints: 0
93
+ };
94
+ !r && typeof navigator < "u" ? e = {
95
+ userAgent: navigator.userAgent,
96
+ platform: navigator.platform,
97
+ maxTouchPoints: navigator.maxTouchPoints || 0
98
+ } : typeof r == "string" ? e.userAgent = r : r && r.userAgent && (e = {
99
+ userAgent: r.userAgent,
100
+ platform: r.platform,
101
+ maxTouchPoints: r.maxTouchPoints || 0
102
+ });
103
+ var t = e.userAgent, i = t.split("[FBAN");
104
+ typeof i[1] < "u" && (t = i[0]), i = t.split("Twitter"), typeof i[1] < "u" && (t = i[0]);
105
+ var n = te(t), s = {
106
+ apple: {
107
+ phone: n(O) && !n(g),
108
+ ipod: n(C),
109
+ tablet: !n(O) && (n(S) || G(e)) && !n(g),
110
+ universal: n(U),
111
+ device: (n(O) || n(C) || n(S) || n(U) || G(e)) && !n(g)
112
+ },
113
+ amazon: {
114
+ phone: n(b),
115
+ tablet: !n(b) && n(A),
116
+ device: n(b) || n(A)
117
+ },
118
+ android: {
119
+ phone: !n(g) && n(b) || !n(g) && n(k),
120
+ tablet: !n(g) && !n(b) && !n(k) && (n(A) || n(H)),
121
+ device: !n(g) && (n(b) || n(A) || n(k) || n(H)) || n(/\bokhttp\b/i)
122
+ },
123
+ windows: {
124
+ phone: n(g),
125
+ tablet: n(X),
126
+ device: n(g) || n(X)
127
+ },
128
+ other: {
129
+ blackberry: n(R),
130
+ blackberry10: n(F),
131
+ opera: n(Y),
132
+ firefox: n($),
133
+ chrome: n(K),
134
+ device: n(R) || n(F) || n(Y) || n($) || n(K)
135
+ },
136
+ any: !1,
137
+ phone: !1,
138
+ tablet: !1
139
+ };
140
+ return s.any = s.apple.device || s.android.device || s.windows.device || s.other.device, s.phone = s.apple.phone || s.android.phone || s.windows.phone, s.tablet = s.apple.tablet || s.android.tablet || s.windows.tablet, s;
141
+ }
142
+ const ie = W.default ?? W, ne = ie(globalThis.navigator), se = 9, I = 100, oe = 0, re = 0, j = 2, N = 1, ae = -1e3, he = -1e3, le = 2;
143
+ class V {
144
+ // 2fps
145
+ // eslint-disable-next-line jsdoc/require-param
146
+ /**
147
+ * @param {WebGLRenderer|WebGPURenderer} renderer - A reference to the current renderer
148
+ */
149
+ constructor(e, t = ne) {
150
+ this._mobileInfo = t, this.debug = !1, this._isActive = !1, this._isMobileAccessibility = !1, this._pool = [], this._renderId = 0, this._children = [], this._androidUpdateCount = 0, this._androidUpdateFrequency = 500, this._hookDiv = null, (t.tablet || t.phone) && this._createTouchHook();
151
+ const i = document.createElement("div");
152
+ i.style.width = `${I}px`, i.style.height = `${I}px`, i.style.position = "absolute", i.style.top = `${oe}px`, i.style.left = `${re}px`, i.style.zIndex = j.toString(), this._div = i, this._renderer = e, this._onKeyDown = this._onKeyDown.bind(this), this._onMouseMove = this._onMouseMove.bind(this), globalThis.addEventListener("keydown", this._onKeyDown, !1);
153
+ }
154
+ /**
155
+ * Value of `true` if accessibility is currently active and accessibility layers are showing.
156
+ * @member {boolean}
157
+ * @readonly
158
+ */
159
+ get isActive() {
160
+ return this._isActive;
161
+ }
162
+ /**
163
+ * Value of `true` if accessibility is enabled for touch devices.
164
+ * @member {boolean}
165
+ * @readonly
166
+ */
167
+ get isMobileAccessibility() {
168
+ return this._isMobileAccessibility;
169
+ }
170
+ get hookDiv() {
171
+ return this._hookDiv;
172
+ }
173
+ /**
174
+ * Creates the touch hooks.
175
+ * @private
176
+ */
177
+ _createTouchHook() {
178
+ const e = document.createElement("button");
179
+ e.style.width = `${N}px`, e.style.height = `${N}px`, e.style.position = "absolute", e.style.top = `${ae}px`, e.style.left = `${he}px`, e.style.zIndex = le.toString(), e.style.backgroundColor = "#FF0000", e.title = "select to enable accessibility for this content", e.addEventListener("focus", () => {
180
+ this._isMobileAccessibility = !0, this._activate(), this._destroyTouchHook();
181
+ }), document.body.appendChild(e), this._hookDiv = e;
182
+ }
183
+ /**
184
+ * Destroys the touch hooks.
185
+ * @private
186
+ */
187
+ _destroyTouchHook() {
188
+ this._hookDiv && (document.body.removeChild(this._hookDiv), this._hookDiv = null);
189
+ }
190
+ /**
191
+ * Activating will cause the Accessibility layer to be shown.
192
+ * This is called when a user presses the tab key.
193
+ * @private
194
+ */
195
+ _activate() {
196
+ var e;
197
+ this._isActive || (this._isActive = !0, globalThis.document.addEventListener("mousemove", this._onMouseMove, !0), globalThis.removeEventListener("keydown", this._onKeyDown, !1), this._renderer.runners.postrender.add(this), (e = this._renderer.view.canvas.parentNode) == null || e.appendChild(this._div));
198
+ }
199
+ /**
200
+ * Deactivating will cause the Accessibility layer to be hidden.
201
+ * This is called when a user moves the mouse.
202
+ * @private
203
+ */
204
+ _deactivate() {
205
+ var e;
206
+ !this._isActive || this._isMobileAccessibility || (this._isActive = !1, globalThis.document.removeEventListener("mousemove", this._onMouseMove, !0), globalThis.addEventListener("keydown", this._onKeyDown, !1), this._renderer.runners.postrender.remove(this), (e = this._div.parentNode) == null || e.removeChild(this._div));
207
+ }
208
+ /**
209
+ * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer.
210
+ * @private
211
+ * @param {Container} container - The Container to check.
212
+ */
213
+ _updateAccessibleObjects(e) {
214
+ if (!e.visible || !e.accessibleChildren)
215
+ return;
216
+ e.accessible && e.isInteractive() && (e._accessibleActive || this._addChild(e), e._renderId = this._renderId);
217
+ const t = e.children;
218
+ if (t)
219
+ for (let i = 0; i < t.length; i++)
220
+ this._updateAccessibleObjects(t[i]);
221
+ }
222
+ /**
223
+ * Runner init called, view is available at this point.
224
+ * @ignore
225
+ */
226
+ init(e) {
227
+ this.debug = (e == null ? void 0 : e.debug) ?? this.debug, this._renderer.runners.postrender.remove(this);
228
+ }
229
+ /**
230
+ * Runner postrender was called, ensure that all divs are mapped correctly to their Containers.
231
+ * Only fires while active.
232
+ * @ignore
233
+ */
234
+ postrender() {
235
+ const e = performance.now();
236
+ if (this._mobileInfo.android.device && e < this._androidUpdateCount || (this._androidUpdateCount = e + this._androidUpdateFrequency, !this._renderer.renderingToScreen || !this._renderer.view.canvas))
237
+ return;
238
+ this._renderer.lastObjectRendered && this._updateAccessibleObjects(this._renderer.lastObjectRendered);
239
+ const { x: t, y: i, width: n, height: s } = this._renderer.view.canvas.getBoundingClientRect(), { width: o, height: a, resolution: c } = this._renderer, p = n / o * c, v = s / a * c;
240
+ let h = this._div;
241
+ h.style.left = `${t}px`, h.style.top = `${i}px`, h.style.width = `${o}px`, h.style.height = `${a}px`;
242
+ for (let l = 0; l < this._children.length; l++) {
243
+ const u = this._children[l];
244
+ if (u._renderId !== this._renderId)
245
+ u._accessibleActive = !1, J(this._children, l, 1), this._div.removeChild(u._accessibleDiv), this._pool.push(u._accessibleDiv), u._accessibleDiv = null, l--;
246
+ else {
247
+ h = u._accessibleDiv;
248
+ let d = u.hitArea;
249
+ const _ = u.worldTransform;
250
+ u.hitArea ? (h.style.left = `${(_.tx + d.x * _.a) * p}px`, h.style.top = `${(_.ty + d.y * _.d) * v}px`, h.style.width = `${d.width * _.a * p}px`, h.style.height = `${d.height * _.d * v}px`) : (d = u.getBounds().rectangle, this._capHitArea(d), h.style.left = `${d.x * p}px`, h.style.top = `${d.y * v}px`, h.style.width = `${d.width * p}px`, h.style.height = `${d.height * v}px`, h.title !== u.accessibleTitle && u.accessibleTitle !== null && (h.title = u.accessibleTitle || ""), h.getAttribute("aria-label") !== u.accessibleHint && u.accessibleHint !== null && h.setAttribute("aria-label", u.accessibleHint || "")), (u.accessibleTitle !== h.title || u.tabIndex !== h.tabIndex) && (h.title = u.accessibleTitle || "", h.tabIndex = u.tabIndex, this.debug && this._updateDebugHTML(h));
251
+ }
252
+ }
253
+ this._renderId++;
254
+ }
255
+ /**
256
+ * private function that will visually add the information to the
257
+ * accessibility div
258
+ * @param {HTMLElement} div -
259
+ */
260
+ _updateDebugHTML(e) {
261
+ e.innerHTML = `type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`;
262
+ }
263
+ /**
264
+ * Adjust the hit area based on the bounds of a display object
265
+ * @param {Rectangle} hitArea - Bounds of the child
266
+ */
267
+ _capHitArea(e) {
268
+ e.x < 0 && (e.width += e.x, e.x = 0), e.y < 0 && (e.height += e.y, e.y = 0);
269
+ const { width: t, height: i } = this._renderer;
270
+ e.x + e.width > t && (e.width = t - e.x), e.y + e.height > i && (e.height = i - e.y);
271
+ }
272
+ /**
273
+ * Adds a Container to the accessibility manager
274
+ * @private
275
+ * @param {Container} container - The child to make accessible.
276
+ */
277
+ _addChild(e) {
278
+ let t = this._pool.pop();
279
+ t || (t = document.createElement("button"), t.style.width = `${I}px`, t.style.height = `${I}px`, t.style.backgroundColor = this.debug ? "rgba(255,255,255,0.5)" : "transparent", t.style.position = "absolute", t.style.zIndex = j.toString(), t.style.borderStyle = "none", navigator.userAgent.toLowerCase().includes("chrome") ? t.setAttribute("aria-live", "off") : t.setAttribute("aria-live", "polite"), navigator.userAgent.match(/rv:.*Gecko\//) ? t.setAttribute("aria-relevant", "additions") : t.setAttribute("aria-relevant", "text"), t.addEventListener("click", this._onClick.bind(this)), t.addEventListener("focus", this._onFocus.bind(this)), t.addEventListener("focusout", this._onFocusOut.bind(this))), t.style.pointerEvents = e.accessiblePointerEvents, t.type = e.accessibleType, e.accessibleTitle && e.accessibleTitle !== null ? t.title = e.accessibleTitle : (!e.accessibleHint || e.accessibleHint === null) && (t.title = `container ${e.tabIndex}`), e.accessibleHint && e.accessibleHint !== null && t.setAttribute("aria-label", e.accessibleHint), this.debug && this._updateDebugHTML(t), e._accessibleActive = !0, e._accessibleDiv = t, t.container = e, this._children.push(e), this._div.appendChild(e._accessibleDiv), e._accessibleDiv.tabIndex = e.tabIndex;
280
+ }
281
+ /**
282
+ * Dispatch events with the EventSystem.
283
+ * @param e
284
+ * @param type
285
+ * @private
286
+ */
287
+ _dispatchEvent(e, t) {
288
+ const { container: i } = e.target, n = this._renderer.events.rootBoundary, s = Object.assign(new M(n), { target: i });
289
+ n.rootTarget = this._renderer.lastObjectRendered, t.forEach((o) => n.dispatchEvent(s, o));
290
+ }
291
+ /**
292
+ * Maps the div button press to pixi's EventSystem (click)
293
+ * @private
294
+ * @param {MouseEvent} e - The click event.
295
+ */
296
+ _onClick(e) {
297
+ this._dispatchEvent(e, ["click", "pointertap", "tap"]);
298
+ }
299
+ /**
300
+ * Maps the div focus events to pixi's EventSystem (mouseover)
301
+ * @private
302
+ * @param {FocusEvent} e - The focus event.
303
+ */
304
+ _onFocus(e) {
305
+ e.target.getAttribute("aria-live") || e.target.setAttribute("aria-live", "assertive"), this._dispatchEvent(e, ["mouseover"]);
306
+ }
307
+ /**
308
+ * Maps the div focus events to pixi's EventSystem (mouseout)
309
+ * @private
310
+ * @param {FocusEvent} e - The focusout event.
311
+ */
312
+ _onFocusOut(e) {
313
+ e.target.getAttribute("aria-live") || e.target.setAttribute("aria-live", "polite"), this._dispatchEvent(e, ["mouseout"]);
314
+ }
315
+ /**
316
+ * Is called when a key is pressed
317
+ * @private
318
+ * @param {KeyboardEvent} e - The keydown event.
319
+ */
320
+ _onKeyDown(e) {
321
+ e.keyCode === se && this._activate();
322
+ }
323
+ /**
324
+ * Is called when the mouse moves across the renderer element
325
+ * @private
326
+ * @param {MouseEvent} e - The mouse event.
327
+ */
328
+ _onMouseMove(e) {
329
+ e.movementX === 0 && e.movementY === 0 || this._deactivate();
330
+ }
331
+ /** Destroys the accessibility manager */
332
+ destroy() {
333
+ this._destroyTouchHook(), this._div = null, globalThis.document.removeEventListener("mousemove", this._onMouseMove, !0), globalThis.removeEventListener("keydown", this._onKeyDown), this._pool = null, this._children = null, this._renderer = null;
334
+ }
335
+ }
336
+ V.extension = {
337
+ type: [
338
+ w.WebGLSystem,
339
+ w.WebGPUSystem
340
+ ],
341
+ name: "accessibility"
342
+ };
343
+ const ue = {
344
+ /**
345
+ * Flag for if the object is accessible. If true AccessibilityManager will overlay a
346
+ * shadow div with attributes set
347
+ * @member {boolean}
348
+ * @memberof scene.Container#
349
+ */
350
+ accessible: !1,
351
+ /**
352
+ * Sets the title attribute of the shadow div
353
+ * If accessibleTitle AND accessibleHint has not been this will default to 'container [tabIndex]'
354
+ * @member {string}
355
+ * @memberof scene.Container#
356
+ */
357
+ accessibleTitle: null,
358
+ /**
359
+ * Sets the aria-label attribute of the shadow div
360
+ * @member {string}
361
+ * @memberof scene.Container#
362
+ */
363
+ accessibleHint: null,
364
+ /**
365
+ * @member {number}
366
+ * @memberof scene.Container#
367
+ * @todo Needs docs.
368
+ */
369
+ tabIndex: 0,
370
+ /**
371
+ * @member {boolean}
372
+ * @memberof scene.Container#
373
+ * @private
374
+ */
375
+ _accessibleActive: !1,
376
+ /**
377
+ * @memberof scene.Container#
378
+ * @private
379
+ */
380
+ _accessibleDiv: null,
381
+ /**
382
+ * Specify the type of div the accessible layer is. Screen readers treat the element differently
383
+ * depending on this type. Defaults to button.
384
+ * @member {string}
385
+ * @memberof scene.Container#
386
+ * @default 'button'
387
+ */
388
+ accessibleType: "button",
389
+ /**
390
+ * Specify the pointer-events the accessible div will use
391
+ * Defaults to auto.
392
+ * @type {PointerEvents}
393
+ * @memberof scene.Container#
394
+ * @default 'auto'
395
+ */
396
+ accessiblePointerEvents: "auto",
397
+ /**
398
+ * Setting to false will prevent any children inside this container to
399
+ * be accessible. Defaults to true.
400
+ * @member {boolean}
401
+ * @memberof scene.Container#
402
+ * @default true
403
+ */
404
+ accessibleChildren: !0,
405
+ /**
406
+ * @member {number}
407
+ * @memberof scene.Container#
408
+ * @private
409
+ */
410
+ _renderId: -1
411
+ };
412
+ class de {
413
+ constructor() {
414
+ this.interactionFrequency = 10, this._deltaTime = 0, this._didMove = !1, this._tickerAdded = !1, this._pauseUpdate = !0;
415
+ }
416
+ /**
417
+ * Initializes the event ticker.
418
+ * @param events - The event system.
419
+ */
420
+ init(e) {
421
+ this.removeTickerListener(), this.events = e, this.interactionFrequency = 10, this._deltaTime = 0, this._didMove = !1, this._tickerAdded = !1, this._pauseUpdate = !0;
422
+ }
423
+ /** Whether to pause the update checks or not. */
424
+ get pauseUpdate() {
425
+ return this._pauseUpdate;
426
+ }
427
+ set pauseUpdate(e) {
428
+ this._pauseUpdate = e;
429
+ }
430
+ /** Adds the ticker listener. */
431
+ addTickerListener() {
432
+ this._tickerAdded || !this.domElement || (L.system.add(this._tickerUpdate, this, Q.INTERACTION), this._tickerAdded = !0);
433
+ }
434
+ /** Removes the ticker listener. */
435
+ removeTickerListener() {
436
+ this._tickerAdded && (L.system.remove(this._tickerUpdate, this), this._tickerAdded = !1);
437
+ }
438
+ /** Sets flag to not fire extra events when the user has already moved there mouse */
439
+ pointerMoved() {
440
+ this._didMove = !0;
441
+ }
442
+ /** Updates the state of interactive objects. */
443
+ _update() {
444
+ if (!this.domElement || this._pauseUpdate)
445
+ return;
446
+ if (this._didMove) {
447
+ this._didMove = !1;
448
+ return;
449
+ }
450
+ const e = this.events._rootPointerEvent;
451
+ this.events.supportsTouchEvents && e.pointerType === "touch" || globalThis.document.dispatchEvent(new PointerEvent("pointermove", {
452
+ clientX: e.clientX,
453
+ clientY: e.clientY
454
+ }));
455
+ }
456
+ /**
457
+ * Updates the state of interactive objects if at least {@link interactionFrequency}
458
+ * milliseconds have passed since the last invocation.
459
+ *
460
+ * Invoked by a throttled ticker update from {@link Ticker.system}.
461
+ * @param ticker - The throttled ticker.
462
+ */
463
+ _tickerUpdate(e) {
464
+ this._deltaTime += e.deltaTime, !(this._deltaTime < this.interactionFrequency) && (this._deltaTime = 0, this._update());
465
+ }
466
+ }
467
+ const E = new de();
468
+ class D extends M {
469
+ constructor() {
470
+ super(...arguments), this.client = new m(), this.movement = new m(), this.offset = new m(), this.global = new m(), this.screen = new m();
471
+ }
472
+ /** @readonly */
473
+ get clientX() {
474
+ return this.client.x;
475
+ }
476
+ /** @readonly */
477
+ get clientY() {
478
+ return this.client.y;
479
+ }
480
+ /**
481
+ * Alias for {@link FederatedMouseEvent.clientX this.clientX}.
482
+ * @readonly
483
+ */
484
+ get x() {
485
+ return this.clientX;
486
+ }
487
+ /**
488
+ * Alias for {@link FederatedMouseEvent.clientY this.clientY}.
489
+ * @readonly
490
+ */
491
+ get y() {
492
+ return this.clientY;
493
+ }
494
+ /** @readonly */
495
+ get movementX() {
496
+ return this.movement.x;
497
+ }
498
+ /** @readonly */
499
+ get movementY() {
500
+ return this.movement.y;
501
+ }
502
+ /** @readonly */
503
+ get offsetX() {
504
+ return this.offset.x;
505
+ }
506
+ /** @readonly */
507
+ get offsetY() {
508
+ return this.offset.y;
509
+ }
510
+ /** @readonly */
511
+ get globalX() {
512
+ return this.global.x;
513
+ }
514
+ /** @readonly */
515
+ get globalY() {
516
+ return this.global.y;
517
+ }
518
+ /**
519
+ * The pointer coordinates in the renderer's screen. Alias for {@code screen.x}.
520
+ * @readonly
521
+ */
522
+ get screenX() {
523
+ return this.screen.x;
524
+ }
525
+ /**
526
+ * The pointer coordinates in the renderer's screen. Alias for {@code screen.y}.
527
+ * @readonly
528
+ */
529
+ get screenY() {
530
+ return this.screen.y;
531
+ }
532
+ /**
533
+ * This will return the local coordinates of the specified container for this InteractionData
534
+ * @param {Container} container - The Container that you would like the local
535
+ * coords off
536
+ * @param {PointData} point - A Point object in which to store the value, optional (otherwise
537
+ * will create a new point)
538
+ * @param {PointData} globalPos - A Point object containing your custom global coords, optional
539
+ * (otherwise will use the current global coords)
540
+ * @returns - A point containing the coordinates of the InteractionData position relative
541
+ * to the Container
542
+ */
543
+ getLocalPosition(e, t, i) {
544
+ return e.worldTransform.applyInverse(i || this.global, t);
545
+ }
546
+ /**
547
+ * Whether the modifier key was pressed when this event natively occurred.
548
+ * @param key - The modifier key.
549
+ */
550
+ getModifierState(e) {
551
+ return "getModifierState" in this.nativeEvent && this.nativeEvent.getModifierState(e);
552
+ }
553
+ /**
554
+ * Not supported.
555
+ * @param _typeArg
556
+ * @param _canBubbleArg
557
+ * @param _cancelableArg
558
+ * @param _viewArg
559
+ * @param _detailArg
560
+ * @param _screenXArg
561
+ * @param _screenYArg
562
+ * @param _clientXArg
563
+ * @param _clientYArg
564
+ * @param _ctrlKeyArg
565
+ * @param _altKeyArg
566
+ * @param _shiftKeyArg
567
+ * @param _metaKeyArg
568
+ * @param _buttonArg
569
+ * @param _relatedTargetArg
570
+ * @deprecated since 7.0.0
571
+ */
572
+ // eslint-disable-next-line max-params
573
+ initMouseEvent(e, t, i, n, s, o, a, c, p, v, h, l, u, d, _) {
574
+ throw new Error("Method not implemented.");
575
+ }
576
+ }
577
+ class f extends D {
578
+ constructor() {
579
+ super(...arguments), this.width = 0, this.height = 0, this.isPrimary = !1;
580
+ }
581
+ // Only included for completeness for now
582
+ getCoalescedEvents() {
583
+ return this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove" ? [this] : [];
584
+ }
585
+ // Only included for completeness for now
586
+ getPredictedEvents() {
587
+ throw new Error("getPredictedEvents is not supported!");
588
+ }
589
+ }
590
+ class T extends D {
591
+ constructor() {
592
+ super(...arguments), this.DOM_DELTA_PIXEL = 0, this.DOM_DELTA_LINE = 1, this.DOM_DELTA_PAGE = 2;
593
+ }
594
+ }
595
+ T.DOM_DELTA_PIXEL = 0;
596
+ T.DOM_DELTA_LINE = 1;
597
+ T.DOM_DELTA_PAGE = 2;
598
+ const ce = 2048, pe = new m(), P = new m();
599
+ class ve {
600
+ /**
601
+ * @param rootTarget - The holder of the event boundary.
602
+ */
603
+ constructor(e) {
604
+ this.dispatch = new ee(), this.moveOnAll = !1, this.enableGlobalMoveEvents = !0, this.mappingState = {
605
+ trackingData: {}
606
+ }, this.eventPool = /* @__PURE__ */ new Map(), this._allInteractiveElements = [], this._hitElements = [], this._isPointerMoveEvent = !1, this.rootTarget = e, this.hitPruneFn = this.hitPruneFn.bind(this), this.hitTestFn = this.hitTestFn.bind(this), this.mapPointerDown = this.mapPointerDown.bind(this), this.mapPointerMove = this.mapPointerMove.bind(this), this.mapPointerOut = this.mapPointerOut.bind(this), this.mapPointerOver = this.mapPointerOver.bind(this), this.mapPointerUp = this.mapPointerUp.bind(this), this.mapPointerUpOutside = this.mapPointerUpOutside.bind(this), this.mapWheel = this.mapWheel.bind(this), this.mappingTable = {}, this.addEventMapping("pointerdown", this.mapPointerDown), this.addEventMapping("pointermove", this.mapPointerMove), this.addEventMapping("pointerout", this.mapPointerOut), this.addEventMapping("pointerleave", this.mapPointerOut), this.addEventMapping("pointerover", this.mapPointerOver), this.addEventMapping("pointerup", this.mapPointerUp), this.addEventMapping("pointerupoutside", this.mapPointerUpOutside), this.addEventMapping("wheel", this.mapWheel);
607
+ }
608
+ /**
609
+ * Adds an event mapping for the event `type` handled by `fn`.
610
+ *
611
+ * Event mappings can be used to implement additional or custom events. They take an event
612
+ * coming from the upstream scene (or directly from the {@link EventSystem}) and dispatch new downstream events
613
+ * generally trickling down and bubbling up to {@link EventBoundary.rootTarget this.rootTarget}.
614
+ *
615
+ * To modify the semantics of existing events, the built-in mapping methods of EventBoundary should be overridden
616
+ * instead.
617
+ * @param type - The type of upstream event to map.
618
+ * @param fn - The mapping method. The context of this function must be bound manually, if desired.
619
+ */
620
+ addEventMapping(e, t) {
621
+ this.mappingTable[e] || (this.mappingTable[e] = []), this.mappingTable[e].push({
622
+ fn: t,
623
+ priority: 0
624
+ }), this.mappingTable[e].sort((i, n) => i.priority - n.priority);
625
+ }
626
+ /**
627
+ * Dispatches the given event
628
+ * @param e - The event to dispatch.
629
+ * @param type - The type of event to dispatch. Defaults to `e.type`.
630
+ */
631
+ dispatchEvent(e, t) {
632
+ e.propagationStopped = !1, e.propagationImmediatelyStopped = !1, this.propagate(e, t), this.dispatch.emit(t || e.type, e);
633
+ }
634
+ /**
635
+ * Maps the given upstream event through the event boundary and propagates it downstream.
636
+ * @param e - The event to map.
637
+ */
638
+ mapEvent(e) {
639
+ if (!this.rootTarget)
640
+ return;
641
+ const t = this.mappingTable[e.type];
642
+ if (t)
643
+ for (let i = 0, n = t.length; i < n; i++)
644
+ t[i].fn(e);
645
+ else
646
+ y(`[EventBoundary]: Event mapping not defined for ${e.type}`);
647
+ }
648
+ /**
649
+ * Finds the Container that is the target of a event at the given coordinates.
650
+ *
651
+ * The passed (x,y) coordinates are in the world space above this event boundary.
652
+ * @param x - The x coordinate of the event.
653
+ * @param y - The y coordinate of the event.
654
+ */
655
+ hitTest(e, t) {
656
+ E.pauseUpdate = !0;
657
+ const n = this._isPointerMoveEvent && this.enableGlobalMoveEvents ? "hitTestMoveRecursive" : "hitTestRecursive", s = this[n](
658
+ this.rootTarget,
659
+ this.rootTarget.eventMode,
660
+ pe.set(e, t),
661
+ this.hitTestFn,
662
+ this.hitPruneFn
663
+ );
664
+ return s && s[0];
665
+ }
666
+ /**
667
+ * Propagate the passed event from from {@link EventBoundary.rootTarget this.rootTarget} to its
668
+ * target {@code e.target}.
669
+ * @param e - The event to propagate.
670
+ * @param type - The type of event to propagate. Defaults to `e.type`.
671
+ */
672
+ propagate(e, t) {
673
+ if (!e.target)
674
+ return;
675
+ const i = e.composedPath();
676
+ e.eventPhase = e.CAPTURING_PHASE;
677
+ for (let n = 0, s = i.length - 1; n < s; n++)
678
+ if (e.currentTarget = i[n], this.notifyTarget(e, t), e.propagationStopped || e.propagationImmediatelyStopped)
679
+ return;
680
+ if (e.eventPhase = e.AT_TARGET, e.currentTarget = e.target, this.notifyTarget(e, t), !(e.propagationStopped || e.propagationImmediatelyStopped)) {
681
+ e.eventPhase = e.BUBBLING_PHASE;
682
+ for (let n = i.length - 2; n >= 0; n--)
683
+ if (e.currentTarget = i[n], this.notifyTarget(e, t), e.propagationStopped || e.propagationImmediatelyStopped)
684
+ return;
685
+ }
686
+ }
687
+ /**
688
+ * Emits the event {@code e} to all interactive containers. The event is propagated in the bubbling phase always.
689
+ *
690
+ * This is used in the `globalpointermove` event.
691
+ * @param e - The emitted event.
692
+ * @param type - The listeners to notify.
693
+ * @param targets - The targets to notify.
694
+ */
695
+ all(e, t, i = this._allInteractiveElements) {
696
+ if (i.length === 0)
697
+ return;
698
+ e.eventPhase = e.BUBBLING_PHASE;
699
+ const n = Array.isArray(t) ? t : [t];
700
+ for (let s = i.length - 1; s >= 0; s--)
701
+ n.forEach((o) => {
702
+ e.currentTarget = i[s], this.notifyTarget(e, o);
703
+ });
704
+ }
705
+ /**
706
+ * Finds the propagation path from {@link EventBoundary.rootTarget rootTarget} to the passed
707
+ * {@code target}. The last element in the path is {@code target}.
708
+ * @param target - The target to find the propagation path to.
709
+ */
710
+ propagationPath(e) {
711
+ const t = [e];
712
+ for (let i = 0; i < ce && e !== this.rootTarget && e.parent; i++) {
713
+ if (!e.parent)
714
+ throw new Error("Cannot find propagation path to disconnected target");
715
+ t.push(e.parent), e = e.parent;
716
+ }
717
+ return t.reverse(), t;
718
+ }
719
+ hitTestMoveRecursive(e, t, i, n, s, o = !1) {
720
+ let a = !1;
721
+ if (this._interactivePrune(e))
722
+ return null;
723
+ if ((e.eventMode === "dynamic" || t === "dynamic") && (E.pauseUpdate = !1), e.interactiveChildren && e.children) {
724
+ const v = e.children;
725
+ for (let h = v.length - 1; h >= 0; h--) {
726
+ const l = v[h], u = this.hitTestMoveRecursive(
727
+ l,
728
+ this._isInteractive(t) ? t : l.eventMode,
729
+ i,
730
+ n,
731
+ s,
732
+ o || s(e, i)
733
+ );
734
+ if (u) {
735
+ if (u.length > 0 && !u[u.length - 1].parent)
736
+ continue;
737
+ const d = e.isInteractive();
738
+ (u.length > 0 || d) && (d && this._allInteractiveElements.push(e), u.push(e)), this._hitElements.length === 0 && (this._hitElements = u), a = !0;
739
+ }
740
+ }
741
+ }
742
+ const c = this._isInteractive(t), p = e.isInteractive();
743
+ return p && p && this._allInteractiveElements.push(e), o || this._hitElements.length > 0 ? null : a ? this._hitElements : c && !s(e, i) && n(e, i) ? p ? [e] : [] : null;
744
+ }
745
+ /**
746
+ * Recursive implementation for {@link EventBoundary.hitTest hitTest}.
747
+ * @param currentTarget - The Container that is to be hit tested.
748
+ * @param eventMode - The event mode for the `currentTarget` or one of its parents.
749
+ * @param location - The location that is being tested for overlap.
750
+ * @param testFn - Callback that determines whether the target passes hit testing. This callback
751
+ * can assume that `pruneFn` failed to prune the container.
752
+ * @param pruneFn - Callback that determiness whether the target and all of its children
753
+ * cannot pass the hit test. It is used as a preliminary optimization to prune entire subtrees
754
+ * of the scene graph.
755
+ * @returns An array holding the hit testing target and all its ancestors in order. The first element
756
+ * is the target itself and the last is {@link EventBoundary.rootTarget rootTarget}. This is the opposite
757
+ * order w.r.t. the propagation path. If no hit testing target is found, null is returned.
758
+ */
759
+ hitTestRecursive(e, t, i, n, s) {
760
+ if (this._interactivePrune(e) || s(e, i))
761
+ return null;
762
+ if ((e.eventMode === "dynamic" || t === "dynamic") && (E.pauseUpdate = !1), e.interactiveChildren && e.children) {
763
+ const c = e.children, p = i;
764
+ for (let v = c.length - 1; v >= 0; v--) {
765
+ const h = c[v], l = this.hitTestRecursive(
766
+ h,
767
+ this._isInteractive(t) ? t : h.eventMode,
768
+ p,
769
+ n,
770
+ s
771
+ );
772
+ if (l) {
773
+ if (l.length > 0 && !l[l.length - 1].parent)
774
+ continue;
775
+ const u = e.isInteractive();
776
+ return (l.length > 0 || u) && l.push(e), l;
777
+ }
778
+ }
779
+ }
780
+ const o = this._isInteractive(t), a = e.isInteractive();
781
+ return o && n(e, i) ? a ? [e] : [] : null;
782
+ }
783
+ _isInteractive(e) {
784
+ return e === "static" || e === "dynamic";
785
+ }
786
+ _interactivePrune(e) {
787
+ return !e || !e.visible || !e.renderable || !e.includeInBuild || !e.measurable || e.eventMode === "none" || e.eventMode === "passive" && !e.interactiveChildren;
788
+ }
789
+ /**
790
+ * Checks whether the container or any of its children cannot pass the hit test at all.
791
+ *
792
+ * {@link EventBoundary}'s implementation uses the {@link Container.hitArea hitArea}
793
+ * and {@link Container._maskEffect} for pruning.
794
+ * @param container - The container to prune.
795
+ * @param location - The location to test for overlap.
796
+ */
797
+ hitPruneFn(e, t) {
798
+ if (e.hitArea && (e.worldTransform.applyInverse(t, P), !e.hitArea.contains(P.x, P.y)))
799
+ return !0;
800
+ if (e.effects && e.effects.length)
801
+ for (let i = 0; i < e.effects.length; i++) {
802
+ const n = e.effects[i];
803
+ if (n.containsPoint && !n.containsPoint(t, this.hitTestFn))
804
+ return !0;
805
+ }
806
+ return !1;
807
+ }
808
+ /**
809
+ * Checks whether the container passes hit testing for the given location.
810
+ * @param container - The container to test.
811
+ * @param location - The location to test for overlap.
812
+ * @returns - Whether `container` passes hit testing for `location`.
813
+ */
814
+ hitTestFn(e, t) {
815
+ return e.hitArea ? !0 : e != null && e.containsPoint ? (e.worldTransform.applyInverse(t, P), e.containsPoint(P)) : !1;
816
+ }
817
+ /**
818
+ * Notify all the listeners to the event's `currentTarget`.
819
+ *
820
+ * If the `currentTarget` contains the property `on<type>`, then it is called here,
821
+ * simulating the behavior from version 6.x and prior.
822
+ * @param e - The event passed to the target.
823
+ * @param type - The type of event to notify. Defaults to `e.type`.
824
+ */
825
+ notifyTarget(e, t) {
826
+ var s, o;
827
+ t = t ?? e.type;
828
+ const i = `on${t}`;
829
+ (o = (s = e.currentTarget)[i]) == null || o.call(s, e);
830
+ const n = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? `${t}capture` : t;
831
+ this._notifyListeners(e, n), e.eventPhase === e.AT_TARGET && this._notifyListeners(e, t);
832
+ }
833
+ /**
834
+ * Maps the upstream `pointerdown` events to a downstream `pointerdown` event.
835
+ *
836
+ * `touchstart`, `rightdown`, `mousedown` events are also dispatched for specific pointer types.
837
+ * @param from - The upstream `pointerdown` event.
838
+ */
839
+ mapPointerDown(e) {
840
+ if (!(e instanceof f)) {
841
+ y("EventBoundary cannot map a non-pointer event as a pointer event");
842
+ return;
843
+ }
844
+ const t = this.createPointerEvent(e);
845
+ if (this.dispatchEvent(t, "pointerdown"), t.pointerType === "touch")
846
+ this.dispatchEvent(t, "touchstart");
847
+ else if (t.pointerType === "mouse" || t.pointerType === "pen") {
848
+ const n = t.button === 2;
849
+ this.dispatchEvent(t, n ? "rightdown" : "mousedown");
850
+ }
851
+ const i = this.trackingData(e.pointerId);
852
+ i.pressTargetsByButton[e.button] = t.composedPath(), this.freeEvent(t);
853
+ }
854
+ /**
855
+ * Maps the upstream `pointermove` to downstream `pointerout`, `pointerover`, and `pointermove` events, in that order.
856
+ *
857
+ * The tracking data for the specific pointer has an updated `overTarget`. `mouseout`, `mouseover`,
858
+ * `mousemove`, and `touchmove` events are fired as well for specific pointer types.
859
+ * @param from - The upstream `pointermove` event.
860
+ */
861
+ mapPointerMove(e) {
862
+ var c, p;
863
+ if (!(e instanceof f)) {
864
+ y("EventBoundary cannot map a non-pointer event as a pointer event");
865
+ return;
866
+ }
867
+ this._allInteractiveElements.length = 0, this._hitElements.length = 0, this._isPointerMoveEvent = !0;
868
+ const t = this.createPointerEvent(e);
869
+ this._isPointerMoveEvent = !1;
870
+ const i = t.pointerType === "mouse" || t.pointerType === "pen", n = this.trackingData(e.pointerId), s = this.findMountedTarget(n.overTargets);
871
+ if (((c = n.overTargets) == null ? void 0 : c.length) > 0 && s !== t.target) {
872
+ const v = e.type === "mousemove" ? "mouseout" : "pointerout", h = this.createPointerEvent(e, v, s);
873
+ if (this.dispatchEvent(h, "pointerout"), i && this.dispatchEvent(h, "mouseout"), !t.composedPath().includes(s)) {
874
+ const l = this.createPointerEvent(e, "pointerleave", s);
875
+ for (l.eventPhase = l.AT_TARGET; l.target && !t.composedPath().includes(l.target); )
876
+ l.currentTarget = l.target, this.notifyTarget(l), i && this.notifyTarget(l, "mouseleave"), l.target = l.target.parent;
877
+ this.freeEvent(l);
878
+ }
879
+ this.freeEvent(h);
880
+ }
881
+ if (s !== t.target) {
882
+ const v = e.type === "mousemove" ? "mouseover" : "pointerover", h = this.clonePointerEvent(t, v);
883
+ this.dispatchEvent(h, "pointerover"), i && this.dispatchEvent(h, "mouseover");
884
+ let l = s == null ? void 0 : s.parent;
885
+ for (; l && l !== this.rootTarget.parent && l !== t.target; )
886
+ l = l.parent;
887
+ if (!l || l === this.rootTarget.parent) {
888
+ const d = this.clonePointerEvent(t, "pointerenter");
889
+ for (d.eventPhase = d.AT_TARGET; d.target && d.target !== s && d.target !== this.rootTarget.parent; )
890
+ d.currentTarget = d.target, this.notifyTarget(d), i && this.notifyTarget(d, "mouseenter"), d.target = d.target.parent;
891
+ this.freeEvent(d);
892
+ }
893
+ this.freeEvent(h);
894
+ }
895
+ const o = [], a = this.enableGlobalMoveEvents ?? !0;
896
+ this.moveOnAll ? o.push("pointermove") : this.dispatchEvent(t, "pointermove"), a && o.push("globalpointermove"), t.pointerType === "touch" && (this.moveOnAll ? o.splice(1, 0, "touchmove") : this.dispatchEvent(t, "touchmove"), a && o.push("globaltouchmove")), i && (this.moveOnAll ? o.splice(1, 0, "mousemove") : this.dispatchEvent(t, "mousemove"), a && o.push("globalmousemove"), this.cursor = (p = t.target) == null ? void 0 : p.cursor), o.length > 0 && this.all(t, o), this._allInteractiveElements.length = 0, this._hitElements.length = 0, n.overTargets = t.composedPath(), this.freeEvent(t);
897
+ }
898
+ /**
899
+ * Maps the upstream `pointerover` to downstream `pointerover` and `pointerenter` events, in that order.
900
+ *
901
+ * The tracking data for the specific pointer gets a new `overTarget`.
902
+ * @param from - The upstream `pointerover` event.
903
+ */
904
+ mapPointerOver(e) {
905
+ var o;
906
+ if (!(e instanceof f)) {
907
+ y("EventBoundary cannot map a non-pointer event as a pointer event");
908
+ return;
909
+ }
910
+ const t = this.trackingData(e.pointerId), i = this.createPointerEvent(e), n = i.pointerType === "mouse" || i.pointerType === "pen";
911
+ this.dispatchEvent(i, "pointerover"), n && this.dispatchEvent(i, "mouseover"), i.pointerType === "mouse" && (this.cursor = (o = i.target) == null ? void 0 : o.cursor);
912
+ const s = this.clonePointerEvent(i, "pointerenter");
913
+ for (s.eventPhase = s.AT_TARGET; s.target && s.target !== this.rootTarget.parent; )
914
+ s.currentTarget = s.target, this.notifyTarget(s), n && this.notifyTarget(s, "mouseenter"), s.target = s.target.parent;
915
+ t.overTargets = i.composedPath(), this.freeEvent(i), this.freeEvent(s);
916
+ }
917
+ /**
918
+ * Maps the upstream `pointerout` to downstream `pointerout`, `pointerleave` events, in that order.
919
+ *
920
+ * The tracking data for the specific pointer is cleared of a `overTarget`.
921
+ * @param from - The upstream `pointerout` event.
922
+ */
923
+ mapPointerOut(e) {
924
+ if (!(e instanceof f)) {
925
+ y("EventBoundary cannot map a non-pointer event as a pointer event");
926
+ return;
927
+ }
928
+ const t = this.trackingData(e.pointerId);
929
+ if (t.overTargets) {
930
+ const i = e.pointerType === "mouse" || e.pointerType === "pen", n = this.findMountedTarget(t.overTargets), s = this.createPointerEvent(e, "pointerout", n);
931
+ this.dispatchEvent(s), i && this.dispatchEvent(s, "mouseout");
932
+ const o = this.createPointerEvent(e, "pointerleave", n);
933
+ for (o.eventPhase = o.AT_TARGET; o.target && o.target !== this.rootTarget.parent; )
934
+ o.currentTarget = o.target, this.notifyTarget(o), i && this.notifyTarget(o, "mouseleave"), o.target = o.target.parent;
935
+ t.overTargets = null, this.freeEvent(s), this.freeEvent(o);
936
+ }
937
+ this.cursor = null;
938
+ }
939
+ /**
940
+ * Maps the upstream `pointerup` event to downstream `pointerup`, `pointerupoutside`,
941
+ * and `click`/`rightclick`/`pointertap` events, in that order.
942
+ *
943
+ * The `pointerupoutside` event bubbles from the original `pointerdown` target to the most specific
944
+ * ancestor of the `pointerdown` and `pointerup` targets, which is also the `click` event's target. `touchend`,
945
+ * `rightup`, `mouseup`, `touchendoutside`, `rightupoutside`, `mouseupoutside`, and `tap` are fired as well for
946
+ * specific pointer types.
947
+ * @param from - The upstream `pointerup` event.
948
+ */
949
+ mapPointerUp(e) {
950
+ if (!(e instanceof f)) {
951
+ y("EventBoundary cannot map a non-pointer event as a pointer event");
952
+ return;
953
+ }
954
+ const t = performance.now(), i = this.createPointerEvent(e);
955
+ if (this.dispatchEvent(i, "pointerup"), i.pointerType === "touch")
956
+ this.dispatchEvent(i, "touchend");
957
+ else if (i.pointerType === "mouse" || i.pointerType === "pen") {
958
+ const a = i.button === 2;
959
+ this.dispatchEvent(i, a ? "rightup" : "mouseup");
960
+ }
961
+ const n = this.trackingData(e.pointerId), s = this.findMountedTarget(n.pressTargetsByButton[e.button]);
962
+ let o = s;
963
+ if (s && !i.composedPath().includes(s)) {
964
+ let a = s;
965
+ for (; a && !i.composedPath().includes(a); ) {
966
+ if (i.currentTarget = a, this.notifyTarget(i, "pointerupoutside"), i.pointerType === "touch")
967
+ this.notifyTarget(i, "touchendoutside");
968
+ else if (i.pointerType === "mouse" || i.pointerType === "pen") {
969
+ const c = i.button === 2;
970
+ this.notifyTarget(i, c ? "rightupoutside" : "mouseupoutside");
971
+ }
972
+ a = a.parent;
973
+ }
974
+ delete n.pressTargetsByButton[e.button], o = a;
975
+ }
976
+ if (o) {
977
+ const a = this.clonePointerEvent(i, "click");
978
+ a.target = o, a.path = null, n.clicksByButton[e.button] || (n.clicksByButton[e.button] = {
979
+ clickCount: 0,
980
+ target: a.target,
981
+ timeStamp: t
982
+ });
983
+ const c = n.clicksByButton[e.button];
984
+ if (c.target === a.target && t - c.timeStamp < 200 ? ++c.clickCount : c.clickCount = 1, c.target = a.target, c.timeStamp = t, a.detail = c.clickCount, a.pointerType === "mouse") {
985
+ const p = a.button === 2;
986
+ this.dispatchEvent(a, p ? "rightclick" : "click");
987
+ } else
988
+ a.pointerType === "touch" && this.dispatchEvent(a, "tap");
989
+ this.dispatchEvent(a, "pointertap"), this.freeEvent(a);
990
+ }
991
+ this.freeEvent(i);
992
+ }
993
+ /**
994
+ * Maps the upstream `pointerupoutside` event to a downstream `pointerupoutside` event, bubbling from the original
995
+ * `pointerdown` target to `rootTarget`.
996
+ *
997
+ * (The most specific ancestor of the `pointerdown` event and the `pointerup` event must the
998
+ * `{@link EventBoundary}'s root because the `pointerup` event occurred outside of the boundary.)
999
+ *
1000
+ * `touchendoutside`, `mouseupoutside`, and `rightupoutside` events are fired as well for specific pointer
1001
+ * types. The tracking data for the specific pointer is cleared of a `pressTarget`.
1002
+ * @param from - The upstream `pointerupoutside` event.
1003
+ */
1004
+ mapPointerUpOutside(e) {
1005
+ if (!(e instanceof f)) {
1006
+ y("EventBoundary cannot map a non-pointer event as a pointer event");
1007
+ return;
1008
+ }
1009
+ const t = this.trackingData(e.pointerId), i = this.findMountedTarget(t.pressTargetsByButton[e.button]), n = this.createPointerEvent(e);
1010
+ if (i) {
1011
+ let s = i;
1012
+ for (; s; )
1013
+ n.currentTarget = s, this.notifyTarget(n, "pointerupoutside"), n.pointerType === "touch" ? this.notifyTarget(n, "touchendoutside") : (n.pointerType === "mouse" || n.pointerType === "pen") && this.notifyTarget(n, n.button === 2 ? "rightupoutside" : "mouseupoutside"), s = s.parent;
1014
+ delete t.pressTargetsByButton[e.button];
1015
+ }
1016
+ this.freeEvent(n);
1017
+ }
1018
+ /**
1019
+ * Maps the upstream `wheel` event to a downstream `wheel` event.
1020
+ * @param from - The upstream `wheel` event.
1021
+ */
1022
+ mapWheel(e) {
1023
+ if (!(e instanceof T)) {
1024
+ y("EventBoundary cannot map a non-wheel event as a wheel event");
1025
+ return;
1026
+ }
1027
+ const t = this.createWheelEvent(e);
1028
+ this.dispatchEvent(t), this.freeEvent(t);
1029
+ }
1030
+ /**
1031
+ * Finds the most specific event-target in the given propagation path that is still mounted in the scene graph.
1032
+ *
1033
+ * This is used to find the correct `pointerup` and `pointerout` target in the case that the original `pointerdown`
1034
+ * or `pointerover` target was unmounted from the scene graph.
1035
+ * @param propagationPath - The propagation path was valid in the past.
1036
+ * @returns - The most specific event-target still mounted at the same location in the scene graph.
1037
+ */
1038
+ findMountedTarget(e) {
1039
+ if (!e)
1040
+ return null;
1041
+ let t = e[0];
1042
+ for (let i = 1; i < e.length && e[i].parent === t; i++)
1043
+ t = e[i];
1044
+ return t;
1045
+ }
1046
+ /**
1047
+ * Creates an event whose {@code originalEvent} is {@code from}, with an optional `type` and `target` override.
1048
+ *
1049
+ * The event is allocated using {@link EventBoundary#allocateEvent this.allocateEvent}.
1050
+ * @param from - The {@code originalEvent} for the returned event.
1051
+ * @param [type=from.type] - The type of the returned event.
1052
+ * @param target - The target of the returned event.
1053
+ */
1054
+ createPointerEvent(e, t, i) {
1055
+ const n = this.allocateEvent(f);
1056
+ return this.copyPointerData(e, n), this.copyMouseData(e, n), this.copyData(e, n), n.nativeEvent = e.nativeEvent, n.originalEvent = e, n.target = i ?? this.hitTest(n.global.x, n.global.y) ?? this._hitElements[0], typeof t == "string" && (n.type = t), n;
1057
+ }
1058
+ /**
1059
+ * Creates a wheel event whose {@code originalEvent} is {@code from}.
1060
+ *
1061
+ * The event is allocated using {@link EventBoundary#allocateEvent this.allocateEvent}.
1062
+ * @param from - The upstream wheel event.
1063
+ */
1064
+ createWheelEvent(e) {
1065
+ const t = this.allocateEvent(T);
1066
+ return this.copyWheelData(e, t), this.copyMouseData(e, t), this.copyData(e, t), t.nativeEvent = e.nativeEvent, t.originalEvent = e, t.target = this.hitTest(t.global.x, t.global.y), t;
1067
+ }
1068
+ /**
1069
+ * Clones the event {@code from}, with an optional {@code type} override.
1070
+ *
1071
+ * The event is allocated using {@link EventBoundary#allocateEvent this.allocateEvent}.
1072
+ * @param from - The event to clone.
1073
+ * @param [type=from.type] - The type of the returned event.
1074
+ */
1075
+ clonePointerEvent(e, t) {
1076
+ const i = this.allocateEvent(f);
1077
+ return i.nativeEvent = e.nativeEvent, i.originalEvent = e.originalEvent, this.copyPointerData(e, i), this.copyMouseData(e, i), this.copyData(e, i), i.target = e.target, i.path = e.composedPath().slice(), i.type = t ?? i.type, i;
1078
+ }
1079
+ /**
1080
+ * Copies wheel {@link FederatedWheelEvent} data from {@code from} into {@code to}.
1081
+ *
1082
+ * The following properties are copied:
1083
+ * + deltaMode
1084
+ * + deltaX
1085
+ * + deltaY
1086
+ * + deltaZ
1087
+ * @param from - The event to copy data from.
1088
+ * @param to - The event to copy data into.
1089
+ */
1090
+ copyWheelData(e, t) {
1091
+ t.deltaMode = e.deltaMode, t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ;
1092
+ }
1093
+ /**
1094
+ * Copies pointer {@link FederatedPointerEvent} data from {@code from} into {@code to}.
1095
+ *
1096
+ * The following properties are copied:
1097
+ * + pointerId
1098
+ * + width
1099
+ * + height
1100
+ * + isPrimary
1101
+ * + pointerType
1102
+ * + pressure
1103
+ * + tangentialPressure
1104
+ * + tiltX
1105
+ * + tiltY
1106
+ * @param from - The event to copy data from.
1107
+ * @param to - The event to copy data into.
1108
+ */
1109
+ copyPointerData(e, t) {
1110
+ e instanceof f && t instanceof f && (t.pointerId = e.pointerId, t.width = e.width, t.height = e.height, t.isPrimary = e.isPrimary, t.pointerType = e.pointerType, t.pressure = e.pressure, t.tangentialPressure = e.tangentialPressure, t.tiltX = e.tiltX, t.tiltY = e.tiltY, t.twist = e.twist);
1111
+ }
1112
+ /**
1113
+ * Copies mouse {@link FederatedMouseEvent} data from {@code from} to {@code to}.
1114
+ *
1115
+ * The following properties are copied:
1116
+ * + altKey
1117
+ * + button
1118
+ * + buttons
1119
+ * + clientX
1120
+ * + clientY
1121
+ * + metaKey
1122
+ * + movementX
1123
+ * + movementY
1124
+ * + pageX
1125
+ * + pageY
1126
+ * + x
1127
+ * + y
1128
+ * + screen
1129
+ * + shiftKey
1130
+ * + global
1131
+ * @param from - The event to copy data from.
1132
+ * @param to - The event to copy data into.
1133
+ */
1134
+ copyMouseData(e, t) {
1135
+ e instanceof D && t instanceof D && (t.altKey = e.altKey, t.button = e.button, t.buttons = e.buttons, t.client.copyFrom(e.client), t.ctrlKey = e.ctrlKey, t.metaKey = e.metaKey, t.movement.copyFrom(e.movement), t.screen.copyFrom(e.screen), t.shiftKey = e.shiftKey, t.global.copyFrom(e.global));
1136
+ }
1137
+ /**
1138
+ * Copies base {@link FederatedEvent} data from {@code from} into {@code to}.
1139
+ *
1140
+ * The following properties are copied:
1141
+ * + isTrusted
1142
+ * + srcElement
1143
+ * + timeStamp
1144
+ * + type
1145
+ * @param from - The event to copy data from.
1146
+ * @param to - The event to copy data into.
1147
+ */
1148
+ copyData(e, t) {
1149
+ t.isTrusted = e.isTrusted, t.srcElement = e.srcElement, t.timeStamp = performance.now(), t.type = e.type, t.detail = e.detail, t.view = e.view, t.which = e.which, t.layer.copyFrom(e.layer), t.page.copyFrom(e.page);
1150
+ }
1151
+ /**
1152
+ * @param id - The pointer ID.
1153
+ * @returns The tracking data stored for the given pointer. If no data exists, a blank
1154
+ * state will be created.
1155
+ */
1156
+ trackingData(e) {
1157
+ return this.mappingState.trackingData[e] || (this.mappingState.trackingData[e] = {
1158
+ pressTargetsByButton: {},
1159
+ clicksByButton: {},
1160
+ overTarget: null
1161
+ }), this.mappingState.trackingData[e];
1162
+ }
1163
+ /**
1164
+ * Allocate a specific type of event from {@link EventBoundary#eventPool this.eventPool}.
1165
+ *
1166
+ * This allocation is constructor-agnostic, as long as it only takes one argument - this event
1167
+ * boundary.
1168
+ * @param constructor - The event's constructor.
1169
+ */
1170
+ allocateEvent(e) {
1171
+ this.eventPool.has(e) || this.eventPool.set(e, []);
1172
+ const t = this.eventPool.get(e).pop() || new e(this);
1173
+ return t.eventPhase = t.NONE, t.currentTarget = null, t.path = null, t.target = null, t;
1174
+ }
1175
+ /**
1176
+ * Frees the event and puts it back into the event pool.
1177
+ *
1178
+ * It is illegal to reuse the event until it is allocated again, using `this.allocateEvent`.
1179
+ *
1180
+ * It is also advised that events not allocated from {@link EventBoundary#allocateEvent this.allocateEvent}
1181
+ * not be freed. This is because of the possibility that the same event is freed twice, which can cause
1182
+ * it to be allocated twice & result in overwriting.
1183
+ * @param event - The event to be freed.
1184
+ * @throws Error if the event is managed by another event boundary.
1185
+ */
1186
+ freeEvent(e) {
1187
+ if (e.manager !== this)
1188
+ throw new Error("It is illegal to free an event not managed by this EventBoundary!");
1189
+ const t = e.constructor;
1190
+ this.eventPool.has(t) || this.eventPool.set(t, []), this.eventPool.get(t).push(e);
1191
+ }
1192
+ /**
1193
+ * Similar to {@link EventEmitter.emit}, except it stops if the `propagationImmediatelyStopped` flag
1194
+ * is set on the event.
1195
+ * @param e - The event to call each listener with.
1196
+ * @param type - The event key.
1197
+ */
1198
+ _notifyListeners(e, t) {
1199
+ const i = e.currentTarget._events[t];
1200
+ if (i && e.currentTarget.isInteractive())
1201
+ if ("fn" in i)
1202
+ i.once && e.currentTarget.removeListener(t, i.fn, void 0, !0), i.fn.call(i.context, e);
1203
+ else
1204
+ for (let n = 0, s = i.length; n < s && !e.propagationImmediatelyStopped; n++)
1205
+ i[n].once && e.currentTarget.removeListener(t, i[n].fn, void 0, !0), i[n].fn.call(i[n].context, e);
1206
+ }
1207
+ }
1208
+ const fe = 1, ge = {
1209
+ touchstart: "pointerdown",
1210
+ touchend: "pointerup",
1211
+ touchendoutside: "pointerupoutside",
1212
+ touchmove: "pointermove",
1213
+ touchcancel: "pointercancel"
1214
+ }, B = class x {
1215
+ /**
1216
+ * @param {Renderer} renderer
1217
+ */
1218
+ constructor(e) {
1219
+ this.supportsTouchEvents = "ontouchstart" in globalThis, this.supportsPointerEvents = !!globalThis.PointerEvent, this.domElement = null, this.resolution = 1, this.renderer = e, this.rootBoundary = new ve(null), E.init(this), this.autoPreventDefault = !0, this._eventsAdded = !1, this._rootPointerEvent = new f(null), this._rootWheelEvent = new T(null), this.cursorStyles = {
1220
+ default: "inherit",
1221
+ pointer: "pointer"
1222
+ }, this.features = new Proxy({ ...x.defaultEventFeatures }, {
1223
+ set: (t, i, n) => (i === "globalMove" && (this.rootBoundary.enableGlobalMoveEvents = n), t[i] = n, !0)
1224
+ }), this._onPointerDown = this._onPointerDown.bind(this), this._onPointerMove = this._onPointerMove.bind(this), this._onPointerUp = this._onPointerUp.bind(this), this._onPointerOverOut = this._onPointerOverOut.bind(this), this.onWheel = this.onWheel.bind(this);
1225
+ }
1226
+ /**
1227
+ * The default interaction mode for all display objects.
1228
+ * @see Container.eventMode
1229
+ * @type {EventMode}
1230
+ * @readonly
1231
+ * @since 7.2.0
1232
+ */
1233
+ static get defaultEventMode() {
1234
+ return this._defaultEventMode;
1235
+ }
1236
+ /**
1237
+ * Runner init called, view is available at this point.
1238
+ * @ignore
1239
+ */
1240
+ init(e) {
1241
+ const { canvas: t, resolution: i } = this.renderer;
1242
+ this.setTargetElement(t), this.resolution = i, x._defaultEventMode = e.eventMode ?? "passive", Object.assign(this.features, e.eventFeatures ?? {}), this.rootBoundary.enableGlobalMoveEvents = this.features.globalMove;
1243
+ }
1244
+ /**
1245
+ * Handle changing resolution.
1246
+ * @ignore
1247
+ */
1248
+ resolutionChange(e) {
1249
+ this.resolution = e;
1250
+ }
1251
+ /** Destroys all event listeners and detaches the renderer. */
1252
+ destroy() {
1253
+ this.setTargetElement(null), this.renderer = null, this._currentCursor = null;
1254
+ }
1255
+ /**
1256
+ * Sets the current cursor mode, handling any callbacks or CSS style changes.
1257
+ * @param mode - cursor mode, a key from the cursorStyles dictionary
1258
+ */
1259
+ setCursor(e) {
1260
+ e = e || "default";
1261
+ let t = !0;
1262
+ if (globalThis.OffscreenCanvas && this.domElement instanceof OffscreenCanvas && (t = !1), this._currentCursor === e)
1263
+ return;
1264
+ this._currentCursor = e;
1265
+ const i = this.cursorStyles[e];
1266
+ if (i)
1267
+ switch (typeof i) {
1268
+ case "string":
1269
+ t && (this.domElement.style.cursor = i);
1270
+ break;
1271
+ case "function":
1272
+ i(e);
1273
+ break;
1274
+ case "object":
1275
+ t && Object.assign(this.domElement.style, i);
1276
+ break;
1277
+ }
1278
+ else
1279
+ t && typeof e == "string" && !Object.prototype.hasOwnProperty.call(this.cursorStyles, e) && (this.domElement.style.cursor = e);
1280
+ }
1281
+ /**
1282
+ * The global pointer event.
1283
+ * Useful for getting the pointer position without listening to events.
1284
+ * @since 7.2.0
1285
+ */
1286
+ get pointer() {
1287
+ return this._rootPointerEvent;
1288
+ }
1289
+ /**
1290
+ * Event handler for pointer down events on {@link EventSystem#domElement this.domElement}.
1291
+ * @param nativeEvent - The native mouse/pointer/touch event.
1292
+ */
1293
+ _onPointerDown(e) {
1294
+ if (!this.features.click)
1295
+ return;
1296
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
1297
+ const t = this._normalizeToPointerData(e);
1298
+ this.autoPreventDefault && t[0].isNormalized && (e.cancelable || !("cancelable" in e)) && e.preventDefault();
1299
+ for (let i = 0, n = t.length; i < n; i++) {
1300
+ const s = t[i], o = this._bootstrapEvent(this._rootPointerEvent, s);
1301
+ this.rootBoundary.mapEvent(o);
1302
+ }
1303
+ this.setCursor(this.rootBoundary.cursor);
1304
+ }
1305
+ /**
1306
+ * Event handler for pointer move events on on {@link EventSystem#domElement this.domElement}.
1307
+ * @param nativeEvent - The native mouse/pointer/touch events.
1308
+ */
1309
+ _onPointerMove(e) {
1310
+ if (!this.features.move)
1311
+ return;
1312
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, E.pointerMoved();
1313
+ const t = this._normalizeToPointerData(e);
1314
+ for (let i = 0, n = t.length; i < n; i++) {
1315
+ const s = this._bootstrapEvent(this._rootPointerEvent, t[i]);
1316
+ this.rootBoundary.mapEvent(s);
1317
+ }
1318
+ this.setCursor(this.rootBoundary.cursor);
1319
+ }
1320
+ /**
1321
+ * Event handler for pointer up events on {@link EventSystem#domElement this.domElement}.
1322
+ * @param nativeEvent - The native mouse/pointer/touch event.
1323
+ */
1324
+ _onPointerUp(e) {
1325
+ if (!this.features.click)
1326
+ return;
1327
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
1328
+ let t = e.target;
1329
+ e.composedPath && e.composedPath().length > 0 && (t = e.composedPath()[0]);
1330
+ const i = t !== this.domElement ? "outside" : "", n = this._normalizeToPointerData(e);
1331
+ for (let s = 0, o = n.length; s < o; s++) {
1332
+ const a = this._bootstrapEvent(this._rootPointerEvent, n[s]);
1333
+ a.type += i, this.rootBoundary.mapEvent(a);
1334
+ }
1335
+ this.setCursor(this.rootBoundary.cursor);
1336
+ }
1337
+ /**
1338
+ * Event handler for pointer over & out events on {@link EventSystem#domElement this.domElement}.
1339
+ * @param nativeEvent - The native mouse/pointer/touch event.
1340
+ */
1341
+ _onPointerOverOut(e) {
1342
+ if (!this.features.click)
1343
+ return;
1344
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
1345
+ const t = this._normalizeToPointerData(e);
1346
+ for (let i = 0, n = t.length; i < n; i++) {
1347
+ const s = this._bootstrapEvent(this._rootPointerEvent, t[i]);
1348
+ this.rootBoundary.mapEvent(s);
1349
+ }
1350
+ this.setCursor(this.rootBoundary.cursor);
1351
+ }
1352
+ /**
1353
+ * Passive handler for `wheel` events on {@link EventSystem.domElement this.domElement}.
1354
+ * @param nativeEvent - The native wheel event.
1355
+ */
1356
+ onWheel(e) {
1357
+ if (!this.features.wheel)
1358
+ return;
1359
+ const t = this.normalizeWheelEvent(e);
1360
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered, this.rootBoundary.mapEvent(t);
1361
+ }
1362
+ /**
1363
+ * Sets the {@link EventSystem#domElement domElement} and binds event listeners.
1364
+ *
1365
+ * To deregister the current DOM element without setting a new one, pass {@code null}.
1366
+ * @param element - The new DOM element.
1367
+ */
1368
+ setTargetElement(e) {
1369
+ this._removeEvents(), this.domElement = e, E.domElement = e, this._addEvents();
1370
+ }
1371
+ /** Register event listeners on {@link Renderer#domElement this.domElement}. */
1372
+ _addEvents() {
1373
+ if (this._eventsAdded || !this.domElement)
1374
+ return;
1375
+ E.addTickerListener();
1376
+ const e = this.domElement.style;
1377
+ e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "none", e.msTouchAction = "none") : this.supportsPointerEvents && (e.touchAction = "none")), this.supportsPointerEvents ? (globalThis.document.addEventListener("pointermove", this._onPointerMove, !0), this.domElement.addEventListener("pointerdown", this._onPointerDown, !0), this.domElement.addEventListener("pointerleave", this._onPointerOverOut, !0), this.domElement.addEventListener("pointerover", this._onPointerOverOut, !0), globalThis.addEventListener("pointerup", this._onPointerUp, !0)) : (globalThis.document.addEventListener("mousemove", this._onPointerMove, !0), this.domElement.addEventListener("mousedown", this._onPointerDown, !0), this.domElement.addEventListener("mouseout", this._onPointerOverOut, !0), this.domElement.addEventListener("mouseover", this._onPointerOverOut, !0), globalThis.addEventListener("mouseup", this._onPointerUp, !0), this.supportsTouchEvents && (this.domElement.addEventListener("touchstart", this._onPointerDown, !0), this.domElement.addEventListener("touchend", this._onPointerUp, !0), this.domElement.addEventListener("touchmove", this._onPointerMove, !0))), this.domElement.addEventListener("wheel", this.onWheel, {
1378
+ passive: !0,
1379
+ capture: !0
1380
+ }), this._eventsAdded = !0;
1381
+ }
1382
+ /** Unregister event listeners on {@link EventSystem#domElement this.domElement}. */
1383
+ _removeEvents() {
1384
+ if (!this._eventsAdded || !this.domElement)
1385
+ return;
1386
+ E.removeTickerListener();
1387
+ const e = this.domElement.style;
1388
+ e && (globalThis.navigator.msPointerEnabled ? (e.msContentZooming = "", e.msTouchAction = "") : this.supportsPointerEvents && (e.touchAction = "")), this.supportsPointerEvents ? (globalThis.document.removeEventListener("pointermove", this._onPointerMove, !0), this.domElement.removeEventListener("pointerdown", this._onPointerDown, !0), this.domElement.removeEventListener("pointerleave", this._onPointerOverOut, !0), this.domElement.removeEventListener("pointerover", this._onPointerOverOut, !0), globalThis.removeEventListener("pointerup", this._onPointerUp, !0)) : (globalThis.document.removeEventListener("mousemove", this._onPointerMove, !0), this.domElement.removeEventListener("mousedown", this._onPointerDown, !0), this.domElement.removeEventListener("mouseout", this._onPointerOverOut, !0), this.domElement.removeEventListener("mouseover", this._onPointerOverOut, !0), globalThis.removeEventListener("mouseup", this._onPointerUp, !0), this.supportsTouchEvents && (this.domElement.removeEventListener("touchstart", this._onPointerDown, !0), this.domElement.removeEventListener("touchend", this._onPointerUp, !0), this.domElement.removeEventListener("touchmove", this._onPointerMove, !0))), this.domElement.removeEventListener("wheel", this.onWheel, !0), this.domElement = null, this._eventsAdded = !1;
1389
+ }
1390
+ /**
1391
+ * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The
1392
+ * resulting value is stored in the point. This takes into account the fact that the DOM
1393
+ * element could be scaled and positioned anywhere on the screen.
1394
+ * @param {PointData} point - the point that the result will be stored in
1395
+ * @param {number} x - the x coord of the position to map
1396
+ * @param {number} y - the y coord of the position to map
1397
+ */
1398
+ mapPositionToPoint(e, t, i) {
1399
+ const n = this.domElement.isConnected ? this.domElement.getBoundingClientRect() : {
1400
+ x: 0,
1401
+ y: 0,
1402
+ width: this.domElement.width,
1403
+ height: this.domElement.height,
1404
+ left: 0,
1405
+ top: 0
1406
+ }, s = 1 / this.resolution;
1407
+ e.x = (t - n.left) * (this.domElement.width / n.width) * s, e.y = (i - n.top) * (this.domElement.height / n.height) * s;
1408
+ }
1409
+ /**
1410
+ * Ensures that the original event object contains all data that a regular pointer event would have
1411
+ * @param event - The original event data from a touch or mouse event
1412
+ * @returns An array containing a single normalized pointer event, in the case of a pointer
1413
+ * or mouse event, or a multiple normalized pointer events if there are multiple changed touches
1414
+ */
1415
+ _normalizeToPointerData(e) {
1416
+ const t = [];
1417
+ if (this.supportsTouchEvents && e instanceof TouchEvent)
1418
+ for (let i = 0, n = e.changedTouches.length; i < n; i++) {
1419
+ const s = e.changedTouches[i];
1420
+ typeof s.button > "u" && (s.button = 0), typeof s.buttons > "u" && (s.buttons = 1), typeof s.isPrimary > "u" && (s.isPrimary = e.touches.length === 1 && e.type === "touchstart"), typeof s.width > "u" && (s.width = s.radiusX || 1), typeof s.height > "u" && (s.height = s.radiusY || 1), typeof s.tiltX > "u" && (s.tiltX = 0), typeof s.tiltY > "u" && (s.tiltY = 0), typeof s.pointerType > "u" && (s.pointerType = "touch"), typeof s.pointerId > "u" && (s.pointerId = s.identifier || 0), typeof s.pressure > "u" && (s.pressure = s.force || 0.5), typeof s.twist > "u" && (s.twist = 0), typeof s.tangentialPressure > "u" && (s.tangentialPressure = 0), typeof s.layerX > "u" && (s.layerX = s.offsetX = s.clientX), typeof s.layerY > "u" && (s.layerY = s.offsetY = s.clientY), s.isNormalized = !0, s.type = e.type, t.push(s);
1421
+ }
1422
+ else if (!globalThis.MouseEvent || e instanceof MouseEvent && (!this.supportsPointerEvents || !(e instanceof globalThis.PointerEvent))) {
1423
+ const i = e;
1424
+ typeof i.isPrimary > "u" && (i.isPrimary = !0), typeof i.width > "u" && (i.width = 1), typeof i.height > "u" && (i.height = 1), typeof i.tiltX > "u" && (i.tiltX = 0), typeof i.tiltY > "u" && (i.tiltY = 0), typeof i.pointerType > "u" && (i.pointerType = "mouse"), typeof i.pointerId > "u" && (i.pointerId = fe), typeof i.pressure > "u" && (i.pressure = 0.5), typeof i.twist > "u" && (i.twist = 0), typeof i.tangentialPressure > "u" && (i.tangentialPressure = 0), i.isNormalized = !0, t.push(i);
1425
+ } else
1426
+ t.push(e);
1427
+ return t;
1428
+ }
1429
+ /**
1430
+ * Normalizes the native {@link https://w3c.github.io/uievents/#interface-wheelevent WheelEvent}.
1431
+ *
1432
+ * The returned {@link FederatedWheelEvent} is a shared instance. It will not persist across
1433
+ * multiple native wheel events.
1434
+ * @param nativeEvent - The native wheel event that occurred on the canvas.
1435
+ * @returns A federated wheel event.
1436
+ */
1437
+ normalizeWheelEvent(e) {
1438
+ const t = this._rootWheelEvent;
1439
+ return this._transferMouseData(t, e), t.deltaX = e.deltaX, t.deltaY = e.deltaY, t.deltaZ = e.deltaZ, t.deltaMode = e.deltaMode, this.mapPositionToPoint(t.screen, e.clientX, e.clientY), t.global.copyFrom(t.screen), t.offset.copyFrom(t.screen), t.nativeEvent = e, t.type = e.type, t;
1440
+ }
1441
+ /**
1442
+ * Normalizes the `nativeEvent` into a federateed {@link FederatedPointerEvent}.
1443
+ * @param event
1444
+ * @param nativeEvent
1445
+ */
1446
+ _bootstrapEvent(e, t) {
1447
+ return e.originalEvent = null, e.nativeEvent = t, e.pointerId = t.pointerId, e.width = t.width, e.height = t.height, e.isPrimary = t.isPrimary, e.pointerType = t.pointerType, e.pressure = t.pressure, e.tangentialPressure = t.tangentialPressure, e.tiltX = t.tiltX, e.tiltY = t.tiltY, e.twist = t.twist, this._transferMouseData(e, t), this.mapPositionToPoint(e.screen, t.clientX, t.clientY), e.global.copyFrom(e.screen), e.offset.copyFrom(e.screen), e.isTrusted = t.isTrusted, e.type === "pointerleave" && (e.type = "pointerout"), e.type.startsWith("mouse") && (e.type = e.type.replace("mouse", "pointer")), e.type.startsWith("touch") && (e.type = ge[e.type] || e.type), e;
1448
+ }
1449
+ /**
1450
+ * Transfers base & mouse event data from the {@code nativeEvent} to the federated event.
1451
+ * @param event
1452
+ * @param nativeEvent
1453
+ */
1454
+ _transferMouseData(e, t) {
1455
+ e.isTrusted = t.isTrusted, e.srcElement = t.srcElement, e.timeStamp = performance.now(), e.type = t.type, e.altKey = t.altKey, e.button = t.button, e.buttons = t.buttons, e.client.x = t.clientX, e.client.y = t.clientY, e.ctrlKey = t.ctrlKey, e.metaKey = t.metaKey, e.movement.x = t.movementX, e.movement.y = t.movementY, e.page.x = t.pageX, e.page.y = t.pageY, e.relatedTarget = null, e.shiftKey = t.shiftKey;
1456
+ }
1457
+ };
1458
+ B.extension = {
1459
+ name: "events",
1460
+ type: [
1461
+ w.WebGLSystem,
1462
+ w.CanvasSystem,
1463
+ w.WebGPUSystem
1464
+ ],
1465
+ priority: -1
1466
+ };
1467
+ B.defaultEventFeatures = {
1468
+ /** Enables pointer events associated with pointer movement. */
1469
+ move: !0,
1470
+ /** Enables global pointer move events. */
1471
+ globalMove: !0,
1472
+ /** Enables pointer events associated with clicking. */
1473
+ click: !0,
1474
+ /** Enables wheel events. */
1475
+ wheel: !0
1476
+ };
1477
+ let q = B;
1478
+ const me = {
1479
+ /**
1480
+ * Property-based event handler for the `click` event.
1481
+ * @memberof scene.Container#
1482
+ * @default null
1483
+ * @example
1484
+ * this.onclick = (event) => {
1485
+ * //some function here that happens on click
1486
+ * }
1487
+ */
1488
+ onclick: null,
1489
+ /**
1490
+ * Property-based event handler for the `mousedown` event.
1491
+ * @memberof scene.Container#
1492
+ * @default null
1493
+ * @example
1494
+ * this.onmousedown = (event) => {
1495
+ * //some function here that happens on mousedown
1496
+ * }
1497
+ */
1498
+ onmousedown: null,
1499
+ /**
1500
+ * Property-based event handler for the `mouseenter` event.
1501
+ * @memberof scene.Container#
1502
+ * @default null
1503
+ * @example
1504
+ * this.onmouseenter = (event) => {
1505
+ * //some function here that happens on mouseenter
1506
+ * }
1507
+ */
1508
+ onmouseenter: null,
1509
+ /**
1510
+ * Property-based event handler for the `mouseleave` event.
1511
+ * @memberof scene.Container#
1512
+ * @default null
1513
+ * @example
1514
+ * this.onmouseleave = (event) => {
1515
+ * //some function here that happens on mouseleave
1516
+ * }
1517
+ */
1518
+ onmouseleave: null,
1519
+ /**
1520
+ * Property-based event handler for the `mousemove` event.
1521
+ * @memberof scene.Container#
1522
+ * @default null
1523
+ * @example
1524
+ * this.onmousemove = (event) => {
1525
+ * //some function here that happens on mousemove
1526
+ * }
1527
+ */
1528
+ onmousemove: null,
1529
+ /**
1530
+ * Property-based event handler for the `globalmousemove` event.
1531
+ * @memberof scene.Container#
1532
+ * @default null
1533
+ * @example
1534
+ * this.onglobalmousemove = (event) => {
1535
+ * //some function here that happens on globalmousemove
1536
+ * }
1537
+ */
1538
+ onglobalmousemove: null,
1539
+ /**
1540
+ * Property-based event handler for the `mouseout` event.
1541
+ * @memberof scene.Container#
1542
+ * @default null
1543
+ * @example
1544
+ * this.onmouseout = (event) => {
1545
+ * //some function here that happens on mouseout
1546
+ * }
1547
+ */
1548
+ onmouseout: null,
1549
+ /**
1550
+ * Property-based event handler for the `mouseover` event.
1551
+ * @memberof scene.Container#
1552
+ * @default null
1553
+ * @example
1554
+ * this.onmouseover = (event) => {
1555
+ * //some function here that happens on mouseover
1556
+ * }
1557
+ */
1558
+ onmouseover: null,
1559
+ /**
1560
+ * Property-based event handler for the `mouseup` event.
1561
+ * @memberof scene.Container#
1562
+ * @default null
1563
+ * @example
1564
+ * this.onmouseup = (event) => {
1565
+ * //some function here that happens on mouseup
1566
+ * }
1567
+ */
1568
+ onmouseup: null,
1569
+ /**
1570
+ * Property-based event handler for the `mouseupoutside` event.
1571
+ * @memberof scene.Container#
1572
+ * @default null
1573
+ * @example
1574
+ * this.onmouseupoutside = (event) => {
1575
+ * //some function here that happens on mouseupoutside
1576
+ * }
1577
+ */
1578
+ onmouseupoutside: null,
1579
+ /**
1580
+ * Property-based event handler for the `pointercancel` event.
1581
+ * @memberof scene.Container#
1582
+ * @default null
1583
+ * @example
1584
+ * this.onpointercancel = (event) => {
1585
+ * //some function here that happens on pointercancel
1586
+ * }
1587
+ */
1588
+ onpointercancel: null,
1589
+ /**
1590
+ * Property-based event handler for the `pointerdown` event.
1591
+ * @memberof scene.Container#
1592
+ * @default null
1593
+ * @example
1594
+ * this.onpointerdown = (event) => {
1595
+ * //some function here that happens on pointerdown
1596
+ * }
1597
+ */
1598
+ onpointerdown: null,
1599
+ /**
1600
+ * Property-based event handler for the `pointerenter` event.
1601
+ * @memberof scene.Container#
1602
+ * @default null
1603
+ * @example
1604
+ * this.onpointerenter = (event) => {
1605
+ * //some function here that happens on pointerenter
1606
+ * }
1607
+ */
1608
+ onpointerenter: null,
1609
+ /**
1610
+ * Property-based event handler for the `pointerleave` event.
1611
+ * @memberof scene.Container#
1612
+ * @default null
1613
+ * @example
1614
+ * this.onpointerleave = (event) => {
1615
+ * //some function here that happens on pointerleave
1616
+ * }
1617
+ */
1618
+ onpointerleave: null,
1619
+ /**
1620
+ * Property-based event handler for the `pointermove` event.
1621
+ * @memberof scene.Container#
1622
+ * @default null
1623
+ * @example
1624
+ * this.onpointermove = (event) => {
1625
+ * //some function here that happens on pointermove
1626
+ * }
1627
+ */
1628
+ onpointermove: null,
1629
+ /**
1630
+ * Property-based event handler for the `globalpointermove` event.
1631
+ * @memberof scene.Container#
1632
+ * @default null
1633
+ * @example
1634
+ * this.onglobalpointermove = (event) => {
1635
+ * //some function here that happens on globalpointermove
1636
+ * }
1637
+ */
1638
+ onglobalpointermove: null,
1639
+ /**
1640
+ * Property-based event handler for the `pointerout` event.
1641
+ * @memberof scene.Container#
1642
+ * @default null
1643
+ * @example
1644
+ * this.onpointerout = (event) => {
1645
+ * //some function here that happens on pointerout
1646
+ * }
1647
+ */
1648
+ onpointerout: null,
1649
+ /**
1650
+ * Property-based event handler for the `pointerover` event.
1651
+ * @memberof scene.Container#
1652
+ * @default null
1653
+ * @example
1654
+ * this.onpointerover = (event) => {
1655
+ * //some function here that happens on pointerover
1656
+ * }
1657
+ */
1658
+ onpointerover: null,
1659
+ /**
1660
+ * Property-based event handler for the `pointertap` event.
1661
+ * @memberof scene.Container#
1662
+ * @default null
1663
+ * @example
1664
+ * this.onpointertap = (event) => {
1665
+ * //some function here that happens on pointertap
1666
+ * }
1667
+ */
1668
+ onpointertap: null,
1669
+ /**
1670
+ * Property-based event handler for the `pointerup` event.
1671
+ * @memberof scene.Container#
1672
+ * @default null
1673
+ * @example
1674
+ * this.onpointerup = (event) => {
1675
+ * //some function here that happens on pointerup
1676
+ * }
1677
+ */
1678
+ onpointerup: null,
1679
+ /**
1680
+ * Property-based event handler for the `pointerupoutside` event.
1681
+ * @memberof scene.Container#
1682
+ * @default null
1683
+ * @example
1684
+ * this.onpointerupoutside = (event) => {
1685
+ * //some function here that happens on pointerupoutside
1686
+ * }
1687
+ */
1688
+ onpointerupoutside: null,
1689
+ /**
1690
+ * Property-based event handler for the `rightclick` event.
1691
+ * @memberof scene.Container#
1692
+ * @default null
1693
+ * @example
1694
+ * this.onrightclick = (event) => {
1695
+ * //some function here that happens on rightclick
1696
+ * }
1697
+ */
1698
+ onrightclick: null,
1699
+ /**
1700
+ * Property-based event handler for the `rightdown` event.
1701
+ * @memberof scene.Container#
1702
+ * @default null
1703
+ * @example
1704
+ * this.onrightdown = (event) => {
1705
+ * //some function here that happens on rightdown
1706
+ * }
1707
+ */
1708
+ onrightdown: null,
1709
+ /**
1710
+ * Property-based event handler for the `rightup` event.
1711
+ * @memberof scene.Container#
1712
+ * @default null
1713
+ * @example
1714
+ * this.onrightup = (event) => {
1715
+ * //some function here that happens on rightup
1716
+ * }
1717
+ */
1718
+ onrightup: null,
1719
+ /**
1720
+ * Property-based event handler for the `rightupoutside` event.
1721
+ * @memberof scene.Container#
1722
+ * @default null
1723
+ * @example
1724
+ * this.onrightupoutside = (event) => {
1725
+ * //some function here that happens on rightupoutside
1726
+ * }
1727
+ */
1728
+ onrightupoutside: null,
1729
+ /**
1730
+ * Property-based event handler for the `tap` event.
1731
+ * @memberof scene.Container#
1732
+ * @default null
1733
+ * @example
1734
+ * this.ontap = (event) => {
1735
+ * //some function here that happens on tap
1736
+ * }
1737
+ */
1738
+ ontap: null,
1739
+ /**
1740
+ * Property-based event handler for the `touchcancel` event.
1741
+ * @memberof scene.Container#
1742
+ * @default null
1743
+ * @example
1744
+ * this.ontouchcancel = (event) => {
1745
+ * //some function here that happens on touchcancel
1746
+ * }
1747
+ */
1748
+ ontouchcancel: null,
1749
+ /**
1750
+ * Property-based event handler for the `touchend` event.
1751
+ * @memberof scene.Container#
1752
+ * @default null
1753
+ * @example
1754
+ * this.ontouchend = (event) => {
1755
+ * //some function here that happens on touchend
1756
+ * }
1757
+ */
1758
+ ontouchend: null,
1759
+ /**
1760
+ * Property-based event handler for the `touchendoutside` event.
1761
+ * @memberof scene.Container#
1762
+ * @default null
1763
+ * @example
1764
+ * this.ontouchendoutside = (event) => {
1765
+ * //some function here that happens on touchendoutside
1766
+ * }
1767
+ */
1768
+ ontouchendoutside: null,
1769
+ /**
1770
+ * Property-based event handler for the `touchmove` event.
1771
+ * @memberof scene.Container#
1772
+ * @default null
1773
+ * @example
1774
+ * this.ontouchmove = (event) => {
1775
+ * //some function here that happens on touchmove
1776
+ * }
1777
+ */
1778
+ ontouchmove: null,
1779
+ /**
1780
+ * Property-based event handler for the `globaltouchmove` event.
1781
+ * @memberof scene.Container#
1782
+ * @default null
1783
+ * @example
1784
+ * this.onglobaltouchmove = (event) => {
1785
+ * //some function here that happens on globaltouchmove
1786
+ * }
1787
+ */
1788
+ onglobaltouchmove: null,
1789
+ /**
1790
+ * Property-based event handler for the `touchstart` event.
1791
+ * @memberof scene.Container#
1792
+ * @default null
1793
+ * @example
1794
+ * this.ontouchstart = (event) => {
1795
+ * //some function here that happens on touchstart
1796
+ * }
1797
+ */
1798
+ ontouchstart: null,
1799
+ /**
1800
+ * Property-based event handler for the `wheel` event.
1801
+ * @memberof scene.Container#
1802
+ * @default null
1803
+ * @example
1804
+ * this.onwheel = (event) => {
1805
+ * //some function here that happens on wheel
1806
+ * }
1807
+ */
1808
+ onwheel: null,
1809
+ /**
1810
+ * Enable interaction events for the Container. Touch, pointer and mouse
1811
+ * @memberof scene.Container#
1812
+ */
1813
+ get interactive() {
1814
+ return this.eventMode === "dynamic" || this.eventMode === "static";
1815
+ },
1816
+ set interactive(r) {
1817
+ this.eventMode = r ? "static" : "passive";
1818
+ },
1819
+ /**
1820
+ * @ignore
1821
+ */
1822
+ _internalEventMode: void 0,
1823
+ /**
1824
+ * Enable interaction events for the Container. Touch, pointer and mouse.
1825
+ * There are 5 types of interaction settings:
1826
+ * - `'none'`: Ignores all interaction events, even on its children.
1827
+ * - `'passive'`: **(default)** Does not emit events and ignores all hit testing on itself and non-interactive children.
1828
+ * Interactive children will still emit events.
1829
+ * - `'auto'`: Does not emit events but is hit tested if parent is interactive. Same as `interactive = false` in v7
1830
+ * - `'static'`: Emit events and is hit tested. Same as `interaction = true` in v7
1831
+ * - `'dynamic'`: Emits events and is hit tested but will also receive mock interaction events fired from a ticker to
1832
+ * allow for interaction when the mouse isn't moving
1833
+ * @example
1834
+ * import { Sprite } from 'pixi.js';
1835
+ *
1836
+ * const sprite = new Sprite(texture);
1837
+ * sprite.eventMode = 'static';
1838
+ * sprite.on('tap', (event) => {
1839
+ * // Handle event
1840
+ * });
1841
+ * @memberof scene.Container#
1842
+ * @since 7.2.0
1843
+ */
1844
+ get eventMode() {
1845
+ return this._internalEventMode ?? q.defaultEventMode;
1846
+ },
1847
+ set eventMode(r) {
1848
+ this._internalEventMode = r;
1849
+ },
1850
+ /**
1851
+ * Determines if the container is interactive or not
1852
+ * @returns {boolean} Whether the container is interactive or not
1853
+ * @memberof scene.Container#
1854
+ * @since 7.2.0
1855
+ * @example
1856
+ * import { Sprite } from 'pixi.js';
1857
+ *
1858
+ * const sprite = new Sprite(texture);
1859
+ * sprite.eventMode = 'static';
1860
+ * sprite.isInteractive(); // true
1861
+ *
1862
+ * sprite.eventMode = 'dynamic';
1863
+ * sprite.isInteractive(); // true
1864
+ *
1865
+ * sprite.eventMode = 'none';
1866
+ * sprite.isInteractive(); // false
1867
+ *
1868
+ * sprite.eventMode = 'passive';
1869
+ * sprite.isInteractive(); // false
1870
+ *
1871
+ * sprite.eventMode = 'auto';
1872
+ * sprite.isInteractive(); // false
1873
+ */
1874
+ isInteractive() {
1875
+ return this.eventMode === "static" || this.eventMode === "dynamic";
1876
+ },
1877
+ /**
1878
+ * Determines if the children to the container can be clicked/touched
1879
+ * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
1880
+ * @memberof scene.Container#
1881
+ */
1882
+ interactiveChildren: !0,
1883
+ /**
1884
+ * Interaction shape. Children will be hit first, then this shape will be checked.
1885
+ * Setting this will cause this shape to be checked in hit tests rather than the container's bounds.
1886
+ * @example
1887
+ * import { Rectangle, Sprite } from 'pixi.js';
1888
+ *
1889
+ * const sprite = new Sprite(texture);
1890
+ * sprite.interactive = true;
1891
+ * sprite.hitArea = new Rectangle(0, 0, 100, 100);
1892
+ * @member {IHitArea}
1893
+ * @memberof scene.Container#
1894
+ */
1895
+ hitArea: null,
1896
+ /**
1897
+ * Unlike `on` or `addListener` which are methods from EventEmitter, `addEventListener`
1898
+ * seeks to be compatible with the DOM's `addEventListener` with support for options.
1899
+ * @memberof scene.Container
1900
+ * @param type - The type of event to listen to.
1901
+ * @param listener - The listener callback or object.
1902
+ * @param options - Listener options, used for capture phase.
1903
+ * @example
1904
+ * // Tell the user whether they did a single, double, triple, or nth click.
1905
+ * button.addEventListener('click', {
1906
+ * handleEvent(e): {
1907
+ * let prefix;
1908
+ *
1909
+ * switch (e.detail) {
1910
+ * case 1: prefix = 'single'; break;
1911
+ * case 2: prefix = 'double'; break;
1912
+ * case 3: prefix = 'triple'; break;
1913
+ * default: prefix = e.detail + 'th'; break;
1914
+ * }
1915
+ *
1916
+ * console.log('That was a ' + prefix + 'click');
1917
+ * }
1918
+ * });
1919
+ *
1920
+ * // But skip the first click!
1921
+ * button.parent.addEventListener('click', function blockClickOnce(e) {
1922
+ * e.stopImmediatePropagation();
1923
+ * button.parent.removeEventListener('click', blockClickOnce, true);
1924
+ * }, {
1925
+ * capture: true,
1926
+ * });
1927
+ */
1928
+ addEventListener(r, e, t) {
1929
+ const i = typeof t == "boolean" && t || typeof t == "object" && t.capture, n = typeof t == "object" ? t.signal : void 0, s = typeof t == "object" ? t.once === !0 : !1, o = typeof e == "function" ? void 0 : e;
1930
+ r = i ? `${r}capture` : r;
1931
+ const a = typeof e == "function" ? e : e.handleEvent, c = this;
1932
+ n && n.addEventListener("abort", () => {
1933
+ c.off(r, a, o);
1934
+ }), s ? c.once(r, a, o) : c.on(r, a, o);
1935
+ },
1936
+ /**
1937
+ * Unlike `off` or `removeListener` which are methods from EventEmitter, `removeEventListener`
1938
+ * seeks to be compatible with the DOM's `removeEventListener` with support for options.
1939
+ * @memberof scene.Container
1940
+ * @param type - The type of event the listener is bound to.
1941
+ * @param listener - The listener callback or object.
1942
+ * @param options - The original listener options. This is required to deregister a capture phase listener.
1943
+ */
1944
+ removeEventListener(r, e, t) {
1945
+ const i = typeof t == "boolean" && t || typeof t == "object" && t.capture, n = typeof e == "function" ? void 0 : e;
1946
+ r = i ? `${r}capture` : r, e = typeof e == "function" ? e : e.handleEvent, this.off(r, e, n);
1947
+ },
1948
+ /**
1949
+ * Dispatch the event on this {@link Container} using the event's {@link EventBoundary}.
1950
+ *
1951
+ * The target of the event is set to `this` and the `defaultPrevented` flag is cleared before dispatch.
1952
+ * @memberof scene.Container
1953
+ * @param e - The event to dispatch.
1954
+ * @returns Whether the {@link FederatedEvent.preventDefault preventDefault}() method was not invoked.
1955
+ * @example
1956
+ * // Reuse a click event!
1957
+ * button.dispatchEvent(clickEvent);
1958
+ */
1959
+ dispatchEvent(r) {
1960
+ if (!(r instanceof M))
1961
+ throw new Error("Container cannot propagate events outside of the Federated Events API");
1962
+ return r.defaultPrevented = !1, r.path = null, r.target = this, r.manager.dispatchEvent(r), !r.defaultPrevented;
1963
+ }
1964
+ };
1965
+ z.add(V);
1966
+ Z.mixin(ue);
1967
+ z.add(q);
1968
+ Z.mixin(me);