@blueking/monitor-trace-log 1.0.0-beta.4 → 1.0.0-beta.6

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/852.js ADDED
@@ -0,0 +1,3110 @@
1
+ export const __webpack_id__ = 852;
2
+ export const __webpack_ids__ = [852];
3
+ export const __webpack_modules__ = {
4
+
5
+ /***/ 9852:
6
+ /***/ ((__unused_webpack___webpack_module__, __unused_webpack___webpack_exports__, __webpack_require__) => {
7
+
8
+
9
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/extensions/Extensions.mjs
10
+ var Extensions = __webpack_require__(8507);
11
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/container/Container.mjs + 14 modules
12
+ var Container = __webpack_require__(5819);
13
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/maths/point/Point.mjs
14
+ var Point = __webpack_require__(5101);
15
+ ;// ./node_modules/pixi.js/lib/events/FederatedEvent.mjs
16
+
17
+
18
+ "use strict";
19
+ class FederatedEvent {
20
+ /**
21
+ * @param manager - The event boundary which manages this event. Propagation can only occur
22
+ * within the boundary's jurisdiction.
23
+ */
24
+ constructor(manager) {
25
+ /** Flags whether this event bubbles. This will take effect only if it is set before propagation. */
26
+ this.bubbles = true;
27
+ /** @deprecated since 7.0.0 */
28
+ this.cancelBubble = true;
29
+ /**
30
+ * Flags whether this event can be canceled using {@link FederatedEvent.preventDefault}. This is always
31
+ * false (for now).
32
+ */
33
+ this.cancelable = false;
34
+ /**
35
+ * Flag added for compatibility with DOM {@code Event}. It is not used in the Federated Events
36
+ * API.
37
+ * @see https://dom.spec.whatwg.org/#dom-event-composed
38
+ */
39
+ this.composed = false;
40
+ /** Flags whether the default response of the user agent was prevent through this event. */
41
+ this.defaultPrevented = false;
42
+ /**
43
+ * The propagation phase.
44
+ * @default {@link FederatedEvent.NONE}
45
+ */
46
+ this.eventPhase = FederatedEvent.prototype.NONE;
47
+ /** Flags whether propagation was stopped. */
48
+ this.propagationStopped = false;
49
+ /** Flags whether propagation was immediately stopped. */
50
+ this.propagationImmediatelyStopped = false;
51
+ /** The coordinates of the event relative to the nearest DOM layer. This is a non-standard property. */
52
+ this.layer = new Point.Point();
53
+ /** The coordinates of the event relative to the DOM document. This is a non-standard property. */
54
+ this.page = new Point.Point();
55
+ this.NONE = 0;
56
+ this.CAPTURING_PHASE = 1;
57
+ this.AT_TARGET = 2;
58
+ this.BUBBLING_PHASE = 3;
59
+ this.manager = manager;
60
+ }
61
+ /** @readonly */
62
+ get layerX() {
63
+ return this.layer.x;
64
+ }
65
+ /** @readonly */
66
+ get layerY() {
67
+ return this.layer.y;
68
+ }
69
+ /** @readonly */
70
+ get pageX() {
71
+ return this.page.x;
72
+ }
73
+ /** @readonly */
74
+ get pageY() {
75
+ return this.page.y;
76
+ }
77
+ /**
78
+ * Fallback for the deprecated @code{InteractionEvent.data}.
79
+ * @deprecated since 7.0.0
80
+ */
81
+ get data() {
82
+ return this;
83
+ }
84
+ /** The propagation path for this event. Alias for {@link EventBoundary.propagationPath}. */
85
+ composedPath() {
86
+ if (this.manager && (!this.path || this.path[this.path.length - 1] !== this.target)) {
87
+ this.path = this.target ? this.manager.propagationPath(this.target) : [];
88
+ }
89
+ return this.path;
90
+ }
91
+ /**
92
+ * Unimplemented method included for implementing the DOM interface {@code Event}. It will throw an {@code Error}.
93
+ * @deprecated
94
+ * @param _type
95
+ * @param _bubbles
96
+ * @param _cancelable
97
+ */
98
+ initEvent(_type, _bubbles, _cancelable) {
99
+ throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
100
+ }
101
+ /**
102
+ * Unimplemented method included for implementing the DOM interface {@code UIEvent}. It will throw an {@code Error}.
103
+ * @deprecated
104
+ * @param _typeArg
105
+ * @param _bubblesArg
106
+ * @param _cancelableArg
107
+ * @param _viewArg
108
+ * @param _detailArg
109
+ */
110
+ initUIEvent(_typeArg, _bubblesArg, _cancelableArg, _viewArg, _detailArg) {
111
+ throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.");
112
+ }
113
+ /** Prevent default behavior of PixiJS and the user agent. */
114
+ preventDefault() {
115
+ if (this.nativeEvent instanceof Event && this.nativeEvent.cancelable) {
116
+ this.nativeEvent.preventDefault();
117
+ }
118
+ this.defaultPrevented = true;
119
+ }
120
+ /**
121
+ * Stop this event from propagating to any addition listeners, including on the
122
+ * {@link FederatedEventTarget.currentTarget currentTarget} and also the following
123
+ * event targets on the propagation path.
124
+ */
125
+ stopImmediatePropagation() {
126
+ this.propagationImmediatelyStopped = true;
127
+ }
128
+ /**
129
+ * Stop this event from propagating to the next {@link FederatedEventTarget}. The rest of the listeners
130
+ * on the {@link FederatedEventTarget.currentTarget currentTarget} will still be notified.
131
+ */
132
+ stopPropagation() {
133
+ this.propagationStopped = true;
134
+ }
135
+ }
136
+
137
+
138
+ //# sourceMappingURL=FederatedEvent.mjs.map
139
+
140
+ ;// ./node_modules/ismobilejs/esm/isMobile.js
141
+ var appleIphone = /iPhone/i;
142
+ var appleIpod = /iPod/i;
143
+ var appleTablet = /iPad/i;
144
+ var appleUniversal = /\biOS-universal(?:.+)Mac\b/i;
145
+ var androidPhone = /\bAndroid(?:.+)Mobile\b/i;
146
+ var androidTablet = /Android/i;
147
+ var amazonPhone = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i;
148
+ var amazonTablet = /Silk/i;
149
+ var windowsPhone = /Windows Phone/i;
150
+ var windowsTablet = /\bWindows(?:.+)ARM\b/i;
151
+ var otherBlackBerry = /BlackBerry/i;
152
+ var otherBlackBerry10 = /BB10/i;
153
+ var otherOpera = /Opera Mini/i;
154
+ var otherChrome = /\b(CriOS|Chrome)(?:.+)Mobile/i;
155
+ var otherFirefox = /Mobile(?:.+)Firefox\b/i;
156
+ var isAppleTabletOnIos13 = function (navigator) {
157
+ return (typeof navigator !== 'undefined' &&
158
+ navigator.platform === 'MacIntel' &&
159
+ typeof navigator.maxTouchPoints === 'number' &&
160
+ navigator.maxTouchPoints > 1 &&
161
+ typeof MSStream === 'undefined');
162
+ };
163
+ function createMatch(userAgent) {
164
+ return function (regex) { return regex.test(userAgent); };
165
+ }
166
+ function isMobile(param) {
167
+ var nav = {
168
+ userAgent: '',
169
+ platform: '',
170
+ maxTouchPoints: 0
171
+ };
172
+ if (!param && typeof navigator !== 'undefined') {
173
+ nav = {
174
+ userAgent: navigator.userAgent,
175
+ platform: navigator.platform,
176
+ maxTouchPoints: navigator.maxTouchPoints || 0
177
+ };
178
+ }
179
+ else if (typeof param === 'string') {
180
+ nav.userAgent = param;
181
+ }
182
+ else if (param && param.userAgent) {
183
+ nav = {
184
+ userAgent: param.userAgent,
185
+ platform: param.platform,
186
+ maxTouchPoints: param.maxTouchPoints || 0
187
+ };
188
+ }
189
+ var userAgent = nav.userAgent;
190
+ var tmp = userAgent.split('[FBAN');
191
+ if (typeof tmp[1] !== 'undefined') {
192
+ userAgent = tmp[0];
193
+ }
194
+ tmp = userAgent.split('Twitter');
195
+ if (typeof tmp[1] !== 'undefined') {
196
+ userAgent = tmp[0];
197
+ }
198
+ var match = createMatch(userAgent);
199
+ var result = {
200
+ apple: {
201
+ phone: match(appleIphone) && !match(windowsPhone),
202
+ ipod: match(appleIpod),
203
+ tablet: !match(appleIphone) &&
204
+ (match(appleTablet) || isAppleTabletOnIos13(nav)) &&
205
+ !match(windowsPhone),
206
+ universal: match(appleUniversal),
207
+ device: (match(appleIphone) ||
208
+ match(appleIpod) ||
209
+ match(appleTablet) ||
210
+ match(appleUniversal) ||
211
+ isAppleTabletOnIos13(nav)) &&
212
+ !match(windowsPhone)
213
+ },
214
+ amazon: {
215
+ phone: match(amazonPhone),
216
+ tablet: !match(amazonPhone) && match(amazonTablet),
217
+ device: match(amazonPhone) || match(amazonTablet)
218
+ },
219
+ android: {
220
+ phone: (!match(windowsPhone) && match(amazonPhone)) ||
221
+ (!match(windowsPhone) && match(androidPhone)),
222
+ tablet: !match(windowsPhone) &&
223
+ !match(amazonPhone) &&
224
+ !match(androidPhone) &&
225
+ (match(amazonTablet) || match(androidTablet)),
226
+ device: (!match(windowsPhone) &&
227
+ (match(amazonPhone) ||
228
+ match(amazonTablet) ||
229
+ match(androidPhone) ||
230
+ match(androidTablet))) ||
231
+ match(/\bokhttp\b/i)
232
+ },
233
+ windows: {
234
+ phone: match(windowsPhone),
235
+ tablet: match(windowsTablet),
236
+ device: match(windowsPhone) || match(windowsTablet)
237
+ },
238
+ other: {
239
+ blackberry: match(otherBlackBerry),
240
+ blackberry10: match(otherBlackBerry10),
241
+ opera: match(otherOpera),
242
+ firefox: match(otherFirefox),
243
+ chrome: match(otherChrome),
244
+ device: match(otherBlackBerry) ||
245
+ match(otherBlackBerry10) ||
246
+ match(otherOpera) ||
247
+ match(otherFirefox) ||
248
+ match(otherChrome)
249
+ },
250
+ any: false,
251
+ phone: false,
252
+ tablet: false
253
+ };
254
+ result.any =
255
+ result.apple.device ||
256
+ result.android.device ||
257
+ result.windows.device ||
258
+ result.other.device;
259
+ result.phone =
260
+ result.apple.phone || result.android.phone || result.windows.phone;
261
+ result.tablet =
262
+ result.apple.tablet || result.android.tablet || result.windows.tablet;
263
+ return result;
264
+ }
265
+ //# sourceMappingURL=isMobile.js.map
266
+ ;// ./node_modules/pixi.js/lib/utils/browser/isMobile.mjs
267
+
268
+
269
+ "use strict";
270
+ const isMobileCall = isMobile["default"] ?? isMobile;
271
+ const isMobile_isMobile = isMobileCall(globalThis.navigator);
272
+
273
+
274
+ //# sourceMappingURL=isMobile.mjs.map
275
+
276
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/utils/data/removeItems.mjs
277
+ var removeItems = __webpack_require__(9903);
278
+ ;// ./node_modules/pixi.js/lib/accessibility/AccessibilitySystem.mjs
279
+
280
+
281
+
282
+
283
+
284
+ "use strict";
285
+ const KEY_CODE_TAB = 9;
286
+ const DIV_TOUCH_SIZE = 100;
287
+ const DIV_TOUCH_POS_X = 0;
288
+ const DIV_TOUCH_POS_Y = 0;
289
+ const DIV_TOUCH_ZINDEX = 2;
290
+ const DIV_HOOK_SIZE = 1;
291
+ const DIV_HOOK_POS_X = -1e3;
292
+ const DIV_HOOK_POS_Y = -1e3;
293
+ const DIV_HOOK_ZINDEX = 2;
294
+ class AccessibilitySystem {
295
+ // 2fps
296
+ // eslint-disable-next-line jsdoc/require-param
297
+ /**
298
+ * @param {WebGLRenderer|WebGPURenderer} renderer - A reference to the current renderer
299
+ */
300
+ constructor(renderer, _mobileInfo = isMobile_isMobile) {
301
+ this._mobileInfo = _mobileInfo;
302
+ /** Setting this to true will visually show the divs. */
303
+ this.debug = false;
304
+ /** Internal variable, see isActive getter. */
305
+ this._isActive = false;
306
+ /** Internal variable, see isMobileAccessibility getter. */
307
+ this._isMobileAccessibility = false;
308
+ /** A simple pool for storing divs. */
309
+ this._pool = [];
310
+ /** This is a tick used to check if an object is no longer being rendered. */
311
+ this._renderId = 0;
312
+ /** The array of currently active accessible items. */
313
+ this._children = [];
314
+ /** Count to throttle div updates on android devices. */
315
+ this._androidUpdateCount = 0;
316
+ /** The frequency to update the div elements. */
317
+ this._androidUpdateFrequency = 500;
318
+ this._hookDiv = null;
319
+ if (_mobileInfo.tablet || _mobileInfo.phone) {
320
+ this._createTouchHook();
321
+ }
322
+ const div = document.createElement("div");
323
+ div.style.width = `${DIV_TOUCH_SIZE}px`;
324
+ div.style.height = `${DIV_TOUCH_SIZE}px`;
325
+ div.style.position = "absolute";
326
+ div.style.top = `${DIV_TOUCH_POS_X}px`;
327
+ div.style.left = `${DIV_TOUCH_POS_Y}px`;
328
+ div.style.zIndex = DIV_TOUCH_ZINDEX.toString();
329
+ this._div = div;
330
+ this._renderer = renderer;
331
+ this._onKeyDown = this._onKeyDown.bind(this);
332
+ this._onMouseMove = this._onMouseMove.bind(this);
333
+ globalThis.addEventListener("keydown", this._onKeyDown, false);
334
+ }
335
+ /**
336
+ * Value of `true` if accessibility is currently active and accessibility layers are showing.
337
+ * @member {boolean}
338
+ * @readonly
339
+ */
340
+ get isActive() {
341
+ return this._isActive;
342
+ }
343
+ /**
344
+ * Value of `true` if accessibility is enabled for touch devices.
345
+ * @member {boolean}
346
+ * @readonly
347
+ */
348
+ get isMobileAccessibility() {
349
+ return this._isMobileAccessibility;
350
+ }
351
+ get hookDiv() {
352
+ return this._hookDiv;
353
+ }
354
+ /**
355
+ * Creates the touch hooks.
356
+ * @private
357
+ */
358
+ _createTouchHook() {
359
+ const hookDiv = document.createElement("button");
360
+ hookDiv.style.width = `${DIV_HOOK_SIZE}px`;
361
+ hookDiv.style.height = `${DIV_HOOK_SIZE}px`;
362
+ hookDiv.style.position = "absolute";
363
+ hookDiv.style.top = `${DIV_HOOK_POS_X}px`;
364
+ hookDiv.style.left = `${DIV_HOOK_POS_Y}px`;
365
+ hookDiv.style.zIndex = DIV_HOOK_ZINDEX.toString();
366
+ hookDiv.style.backgroundColor = "#FF0000";
367
+ hookDiv.title = "select to enable accessibility for this content";
368
+ hookDiv.addEventListener("focus", () => {
369
+ this._isMobileAccessibility = true;
370
+ this._activate();
371
+ this._destroyTouchHook();
372
+ });
373
+ document.body.appendChild(hookDiv);
374
+ this._hookDiv = hookDiv;
375
+ }
376
+ /**
377
+ * Destroys the touch hooks.
378
+ * @private
379
+ */
380
+ _destroyTouchHook() {
381
+ if (!this._hookDiv) {
382
+ return;
383
+ }
384
+ document.body.removeChild(this._hookDiv);
385
+ this._hookDiv = null;
386
+ }
387
+ /**
388
+ * Activating will cause the Accessibility layer to be shown.
389
+ * This is called when a user presses the tab key.
390
+ * @private
391
+ */
392
+ _activate() {
393
+ if (this._isActive) {
394
+ return;
395
+ }
396
+ this._isActive = true;
397
+ globalThis.document.addEventListener("mousemove", this._onMouseMove, true);
398
+ globalThis.removeEventListener("keydown", this._onKeyDown, false);
399
+ this._renderer.runners.postrender.add(this);
400
+ this._renderer.view.canvas.parentNode?.appendChild(this._div);
401
+ }
402
+ /**
403
+ * Deactivating will cause the Accessibility layer to be hidden.
404
+ * This is called when a user moves the mouse.
405
+ * @private
406
+ */
407
+ _deactivate() {
408
+ if (!this._isActive || this._isMobileAccessibility) {
409
+ return;
410
+ }
411
+ this._isActive = false;
412
+ globalThis.document.removeEventListener("mousemove", this._onMouseMove, true);
413
+ globalThis.addEventListener("keydown", this._onKeyDown, false);
414
+ this._renderer.runners.postrender.remove(this);
415
+ this._div.parentNode?.removeChild(this._div);
416
+ }
417
+ /**
418
+ * This recursive function will run through the scene graph and add any new accessible objects to the DOM layer.
419
+ * @private
420
+ * @param {Container} container - The Container to check.
421
+ */
422
+ _updateAccessibleObjects(container) {
423
+ if (!container.visible || !container.accessibleChildren) {
424
+ return;
425
+ }
426
+ if (container.accessible && container.isInteractive()) {
427
+ if (!container._accessibleActive) {
428
+ this._addChild(container);
429
+ }
430
+ container._renderId = this._renderId;
431
+ }
432
+ const children = container.children;
433
+ if (children) {
434
+ for (let i = 0; i < children.length; i++) {
435
+ this._updateAccessibleObjects(children[i]);
436
+ }
437
+ }
438
+ }
439
+ /**
440
+ * Runner init called, view is available at this point.
441
+ * @ignore
442
+ */
443
+ init(options) {
444
+ this.debug = options?.debug ?? this.debug;
445
+ this._renderer.runners.postrender.remove(this);
446
+ }
447
+ /**
448
+ * Runner postrender was called, ensure that all divs are mapped correctly to their Containers.
449
+ * Only fires while active.
450
+ * @ignore
451
+ */
452
+ postrender() {
453
+ const now = performance.now();
454
+ if (this._mobileInfo.android.device && now < this._androidUpdateCount) {
455
+ return;
456
+ }
457
+ this._androidUpdateCount = now + this._androidUpdateFrequency;
458
+ if (!this._renderer.renderingToScreen || !this._renderer.view.canvas) {
459
+ return;
460
+ }
461
+ if (this._renderer.lastObjectRendered) {
462
+ this._updateAccessibleObjects(this._renderer.lastObjectRendered);
463
+ }
464
+ const { x, y, width, height } = this._renderer.view.canvas.getBoundingClientRect();
465
+ const { width: viewWidth, height: viewHeight, resolution } = this._renderer;
466
+ const sx = width / viewWidth * resolution;
467
+ const sy = height / viewHeight * resolution;
468
+ let div = this._div;
469
+ div.style.left = `${x}px`;
470
+ div.style.top = `${y}px`;
471
+ div.style.width = `${viewWidth}px`;
472
+ div.style.height = `${viewHeight}px`;
473
+ for (let i = 0; i < this._children.length; i++) {
474
+ const child = this._children[i];
475
+ if (child._renderId !== this._renderId) {
476
+ child._accessibleActive = false;
477
+ (0,removeItems.removeItems)(this._children, i, 1);
478
+ this._div.removeChild(child._accessibleDiv);
479
+ this._pool.push(child._accessibleDiv);
480
+ child._accessibleDiv = null;
481
+ i--;
482
+ } else {
483
+ div = child._accessibleDiv;
484
+ let hitArea = child.hitArea;
485
+ const wt = child.worldTransform;
486
+ if (child.hitArea) {
487
+ div.style.left = `${(wt.tx + hitArea.x * wt.a) * sx}px`;
488
+ div.style.top = `${(wt.ty + hitArea.y * wt.d) * sy}px`;
489
+ div.style.width = `${hitArea.width * wt.a * sx}px`;
490
+ div.style.height = `${hitArea.height * wt.d * sy}px`;
491
+ } else {
492
+ hitArea = child.getBounds().rectangle;
493
+ this._capHitArea(hitArea);
494
+ div.style.left = `${hitArea.x * sx}px`;
495
+ div.style.top = `${hitArea.y * sy}px`;
496
+ div.style.width = `${hitArea.width * sx}px`;
497
+ div.style.height = `${hitArea.height * sy}px`;
498
+ if (div.title !== child.accessibleTitle && child.accessibleTitle !== null) {
499
+ div.title = child.accessibleTitle || "";
500
+ }
501
+ if (div.getAttribute("aria-label") !== child.accessibleHint && child.accessibleHint !== null) {
502
+ div.setAttribute("aria-label", child.accessibleHint || "");
503
+ }
504
+ }
505
+ if (child.accessibleTitle !== div.title || child.tabIndex !== div.tabIndex) {
506
+ div.title = child.accessibleTitle || "";
507
+ div.tabIndex = child.tabIndex;
508
+ if (this.debug) {
509
+ this._updateDebugHTML(div);
510
+ }
511
+ }
512
+ }
513
+ }
514
+ this._renderId++;
515
+ }
516
+ /**
517
+ * private function that will visually add the information to the
518
+ * accessibility div
519
+ * @param {HTMLElement} div -
520
+ */
521
+ _updateDebugHTML(div) {
522
+ div.innerHTML = `type: ${div.type}</br> title : ${div.title}</br> tabIndex: ${div.tabIndex}`;
523
+ }
524
+ /**
525
+ * Adjust the hit area based on the bounds of a display object
526
+ * @param {Rectangle} hitArea - Bounds of the child
527
+ */
528
+ _capHitArea(hitArea) {
529
+ if (hitArea.x < 0) {
530
+ hitArea.width += hitArea.x;
531
+ hitArea.x = 0;
532
+ }
533
+ if (hitArea.y < 0) {
534
+ hitArea.height += hitArea.y;
535
+ hitArea.y = 0;
536
+ }
537
+ const { width: viewWidth, height: viewHeight } = this._renderer;
538
+ if (hitArea.x + hitArea.width > viewWidth) {
539
+ hitArea.width = viewWidth - hitArea.x;
540
+ }
541
+ if (hitArea.y + hitArea.height > viewHeight) {
542
+ hitArea.height = viewHeight - hitArea.y;
543
+ }
544
+ }
545
+ /**
546
+ * Adds a Container to the accessibility manager
547
+ * @private
548
+ * @param {Container} container - The child to make accessible.
549
+ */
550
+ _addChild(container) {
551
+ let div = this._pool.pop();
552
+ if (!div) {
553
+ div = document.createElement("button");
554
+ div.style.width = `${DIV_TOUCH_SIZE}px`;
555
+ div.style.height = `${DIV_TOUCH_SIZE}px`;
556
+ div.style.backgroundColor = this.debug ? "rgba(255,255,255,0.5)" : "transparent";
557
+ div.style.position = "absolute";
558
+ div.style.zIndex = DIV_TOUCH_ZINDEX.toString();
559
+ div.style.borderStyle = "none";
560
+ if (navigator.userAgent.toLowerCase().includes("chrome")) {
561
+ div.setAttribute("aria-live", "off");
562
+ } else {
563
+ div.setAttribute("aria-live", "polite");
564
+ }
565
+ if (navigator.userAgent.match(/rv:.*Gecko\//)) {
566
+ div.setAttribute("aria-relevant", "additions");
567
+ } else {
568
+ div.setAttribute("aria-relevant", "text");
569
+ }
570
+ div.addEventListener("click", this._onClick.bind(this));
571
+ div.addEventListener("focus", this._onFocus.bind(this));
572
+ div.addEventListener("focusout", this._onFocusOut.bind(this));
573
+ }
574
+ div.style.pointerEvents = container.accessiblePointerEvents;
575
+ div.type = container.accessibleType;
576
+ if (container.accessibleTitle && container.accessibleTitle !== null) {
577
+ div.title = container.accessibleTitle;
578
+ } else if (!container.accessibleHint || container.accessibleHint === null) {
579
+ div.title = `container ${container.tabIndex}`;
580
+ }
581
+ if (container.accessibleHint && container.accessibleHint !== null) {
582
+ div.setAttribute("aria-label", container.accessibleHint);
583
+ }
584
+ if (this.debug) {
585
+ this._updateDebugHTML(div);
586
+ }
587
+ container._accessibleActive = true;
588
+ container._accessibleDiv = div;
589
+ div.container = container;
590
+ this._children.push(container);
591
+ this._div.appendChild(container._accessibleDiv);
592
+ container._accessibleDiv.tabIndex = container.tabIndex;
593
+ }
594
+ /**
595
+ * Dispatch events with the EventSystem.
596
+ * @param e
597
+ * @param type
598
+ * @private
599
+ */
600
+ _dispatchEvent(e, type) {
601
+ const { container: target } = e.target;
602
+ const boundary = this._renderer.events.rootBoundary;
603
+ const event = Object.assign(new FederatedEvent(boundary), { target });
604
+ boundary.rootTarget = this._renderer.lastObjectRendered;
605
+ type.forEach((type2) => boundary.dispatchEvent(event, type2));
606
+ }
607
+ /**
608
+ * Maps the div button press to pixi's EventSystem (click)
609
+ * @private
610
+ * @param {MouseEvent} e - The click event.
611
+ */
612
+ _onClick(e) {
613
+ this._dispatchEvent(e, ["click", "pointertap", "tap"]);
614
+ }
615
+ /**
616
+ * Maps the div focus events to pixi's EventSystem (mouseover)
617
+ * @private
618
+ * @param {FocusEvent} e - The focus event.
619
+ */
620
+ _onFocus(e) {
621
+ if (!e.target.getAttribute("aria-live")) {
622
+ e.target.setAttribute("aria-live", "assertive");
623
+ }
624
+ this._dispatchEvent(e, ["mouseover"]);
625
+ }
626
+ /**
627
+ * Maps the div focus events to pixi's EventSystem (mouseout)
628
+ * @private
629
+ * @param {FocusEvent} e - The focusout event.
630
+ */
631
+ _onFocusOut(e) {
632
+ if (!e.target.getAttribute("aria-live")) {
633
+ e.target.setAttribute("aria-live", "polite");
634
+ }
635
+ this._dispatchEvent(e, ["mouseout"]);
636
+ }
637
+ /**
638
+ * Is called when a key is pressed
639
+ * @private
640
+ * @param {KeyboardEvent} e - The keydown event.
641
+ */
642
+ _onKeyDown(e) {
643
+ if (e.keyCode !== KEY_CODE_TAB) {
644
+ return;
645
+ }
646
+ this._activate();
647
+ }
648
+ /**
649
+ * Is called when the mouse moves across the renderer element
650
+ * @private
651
+ * @param {MouseEvent} e - The mouse event.
652
+ */
653
+ _onMouseMove(e) {
654
+ if (e.movementX === 0 && e.movementY === 0) {
655
+ return;
656
+ }
657
+ this._deactivate();
658
+ }
659
+ /** Destroys the accessibility manager */
660
+ destroy() {
661
+ this._destroyTouchHook();
662
+ this._div = null;
663
+ globalThis.document.removeEventListener("mousemove", this._onMouseMove, true);
664
+ globalThis.removeEventListener("keydown", this._onKeyDown);
665
+ this._pool = null;
666
+ this._children = null;
667
+ this._renderer = null;
668
+ }
669
+ }
670
+ /** @ignore */
671
+ AccessibilitySystem.extension = {
672
+ type: [
673
+ Extensions.ExtensionType.WebGLSystem,
674
+ Extensions.ExtensionType.WebGPUSystem
675
+ ],
676
+ name: "accessibility"
677
+ };
678
+
679
+
680
+ //# sourceMappingURL=AccessibilitySystem.mjs.map
681
+
682
+ ;// ./node_modules/pixi.js/lib/accessibility/accessibilityTarget.mjs
683
+
684
+ const accessibilityTarget = {
685
+ /**
686
+ * Flag for if the object is accessible. If true AccessibilityManager will overlay a
687
+ * shadow div with attributes set
688
+ * @member {boolean}
689
+ * @memberof scene.Container#
690
+ */
691
+ accessible: false,
692
+ /**
693
+ * Sets the title attribute of the shadow div
694
+ * If accessibleTitle AND accessibleHint has not been this will default to 'container [tabIndex]'
695
+ * @member {string}
696
+ * @memberof scene.Container#
697
+ */
698
+ accessibleTitle: null,
699
+ /**
700
+ * Sets the aria-label attribute of the shadow div
701
+ * @member {string}
702
+ * @memberof scene.Container#
703
+ */
704
+ accessibleHint: null,
705
+ /**
706
+ * @member {number}
707
+ * @memberof scene.Container#
708
+ * @todo Needs docs.
709
+ */
710
+ tabIndex: 0,
711
+ /**
712
+ * @member {boolean}
713
+ * @memberof scene.Container#
714
+ * @private
715
+ */
716
+ _accessibleActive: false,
717
+ /**
718
+ * @memberof scene.Container#
719
+ * @private
720
+ */
721
+ _accessibleDiv: null,
722
+ /**
723
+ * Specify the type of div the accessible layer is. Screen readers treat the element differently
724
+ * depending on this type. Defaults to button.
725
+ * @member {string}
726
+ * @memberof scene.Container#
727
+ * @default 'button'
728
+ */
729
+ accessibleType: "button",
730
+ /**
731
+ * Specify the pointer-events the accessible div will use
732
+ * Defaults to auto.
733
+ * @type {PointerEvents}
734
+ * @memberof scene.Container#
735
+ * @default 'auto'
736
+ */
737
+ accessiblePointerEvents: "auto",
738
+ /**
739
+ * Setting to false will prevent any children inside this container to
740
+ * be accessible. Defaults to true.
741
+ * @member {boolean}
742
+ * @memberof scene.Container#
743
+ * @default true
744
+ */
745
+ accessibleChildren: true,
746
+ /**
747
+ * @member {number}
748
+ * @memberof scene.Container#
749
+ * @private
750
+ */
751
+ _renderId: -1
752
+ };
753
+
754
+
755
+ //# sourceMappingURL=accessibilityTarget.mjs.map
756
+
757
+ ;// ./node_modules/pixi.js/lib/accessibility/init.mjs
758
+
759
+
760
+
761
+
762
+
763
+ "use strict";
764
+ Extensions.extensions.add(AccessibilitySystem);
765
+ Container.Container.mixin(accessibilityTarget);
766
+ //# sourceMappingURL=init.mjs.map
767
+
768
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/app/init.mjs + 2 modules
769
+ var init = __webpack_require__(4732);
770
+ // EXTERNAL MODULE: ./node_modules/eventemitter3/index.mjs
771
+ var eventemitter3 = __webpack_require__(4486);
772
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/utils/logging/warn.mjs
773
+ var warn = __webpack_require__(268);
774
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/ticker/const.mjs
775
+ var ticker_const = __webpack_require__(4458);
776
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/ticker/Ticker.mjs + 1 modules
777
+ var Ticker = __webpack_require__(7309);
778
+ ;// ./node_modules/pixi.js/lib/events/EventTicker.mjs
779
+
780
+
781
+
782
+ "use strict";
783
+ class EventsTickerClass {
784
+ constructor() {
785
+ /** The frequency that fake events will be fired. */
786
+ this.interactionFrequency = 10;
787
+ this._deltaTime = 0;
788
+ this._didMove = false;
789
+ this._tickerAdded = false;
790
+ this._pauseUpdate = true;
791
+ }
792
+ /**
793
+ * Initializes the event ticker.
794
+ * @param events - The event system.
795
+ */
796
+ init(events) {
797
+ this.removeTickerListener();
798
+ this.events = events;
799
+ this.interactionFrequency = 10;
800
+ this._deltaTime = 0;
801
+ this._didMove = false;
802
+ this._tickerAdded = false;
803
+ this._pauseUpdate = true;
804
+ }
805
+ /** Whether to pause the update checks or not. */
806
+ get pauseUpdate() {
807
+ return this._pauseUpdate;
808
+ }
809
+ set pauseUpdate(paused) {
810
+ this._pauseUpdate = paused;
811
+ }
812
+ /** Adds the ticker listener. */
813
+ addTickerListener() {
814
+ if (this._tickerAdded || !this.domElement) {
815
+ return;
816
+ }
817
+ Ticker.Ticker.system.add(this._tickerUpdate, this, ticker_const.UPDATE_PRIORITY.INTERACTION);
818
+ this._tickerAdded = true;
819
+ }
820
+ /** Removes the ticker listener. */
821
+ removeTickerListener() {
822
+ if (!this._tickerAdded) {
823
+ return;
824
+ }
825
+ Ticker.Ticker.system.remove(this._tickerUpdate, this);
826
+ this._tickerAdded = false;
827
+ }
828
+ /** Sets flag to not fire extra events when the user has already moved there mouse */
829
+ pointerMoved() {
830
+ this._didMove = true;
831
+ }
832
+ /** Updates the state of interactive objects. */
833
+ _update() {
834
+ if (!this.domElement || this._pauseUpdate) {
835
+ return;
836
+ }
837
+ if (this._didMove) {
838
+ this._didMove = false;
839
+ return;
840
+ }
841
+ const rootPointerEvent = this.events["_rootPointerEvent"];
842
+ if (this.events.supportsTouchEvents && rootPointerEvent.pointerType === "touch") {
843
+ return;
844
+ }
845
+ globalThis.document.dispatchEvent(new PointerEvent("pointermove", {
846
+ clientX: rootPointerEvent.clientX,
847
+ clientY: rootPointerEvent.clientY,
848
+ pointerType: rootPointerEvent.pointerType,
849
+ pointerId: rootPointerEvent.pointerId
850
+ }));
851
+ }
852
+ /**
853
+ * Updates the state of interactive objects if at least {@link interactionFrequency}
854
+ * milliseconds have passed since the last invocation.
855
+ *
856
+ * Invoked by a throttled ticker update from {@link Ticker.system}.
857
+ * @param ticker - The throttled ticker.
858
+ */
859
+ _tickerUpdate(ticker) {
860
+ this._deltaTime += ticker.deltaTime;
861
+ if (this._deltaTime < this.interactionFrequency) {
862
+ return;
863
+ }
864
+ this._deltaTime = 0;
865
+ this._update();
866
+ }
867
+ }
868
+ const EventsTicker = new EventsTickerClass();
869
+
870
+
871
+ //# sourceMappingURL=EventTicker.mjs.map
872
+
873
+ ;// ./node_modules/pixi.js/lib/events/FederatedMouseEvent.mjs
874
+
875
+
876
+
877
+ "use strict";
878
+ class FederatedMouseEvent extends FederatedEvent {
879
+ constructor() {
880
+ super(...arguments);
881
+ /** The coordinates of the mouse event relative to the canvas. */
882
+ this.client = new Point.Point();
883
+ /** The movement in this pointer relative to the last `mousemove` event. */
884
+ this.movement = new Point.Point();
885
+ /** The offset of the pointer coordinates w.r.t. target Container in world space. This is not supported at the moment. */
886
+ this.offset = new Point.Point();
887
+ /** The pointer coordinates in world space. */
888
+ this.global = new Point.Point();
889
+ /**
890
+ * The pointer coordinates in the renderer's {@link Renderer.screen screen}. This has slightly
891
+ * different semantics than native PointerEvent screenX/screenY.
892
+ */
893
+ this.screen = new Point.Point();
894
+ }
895
+ /** @readonly */
896
+ get clientX() {
897
+ return this.client.x;
898
+ }
899
+ /** @readonly */
900
+ get clientY() {
901
+ return this.client.y;
902
+ }
903
+ /**
904
+ * Alias for {@link FederatedMouseEvent.clientX this.clientX}.
905
+ * @readonly
906
+ */
907
+ get x() {
908
+ return this.clientX;
909
+ }
910
+ /**
911
+ * Alias for {@link FederatedMouseEvent.clientY this.clientY}.
912
+ * @readonly
913
+ */
914
+ get y() {
915
+ return this.clientY;
916
+ }
917
+ /** @readonly */
918
+ get movementX() {
919
+ return this.movement.x;
920
+ }
921
+ /** @readonly */
922
+ get movementY() {
923
+ return this.movement.y;
924
+ }
925
+ /** @readonly */
926
+ get offsetX() {
927
+ return this.offset.x;
928
+ }
929
+ /** @readonly */
930
+ get offsetY() {
931
+ return this.offset.y;
932
+ }
933
+ /** @readonly */
934
+ get globalX() {
935
+ return this.global.x;
936
+ }
937
+ /** @readonly */
938
+ get globalY() {
939
+ return this.global.y;
940
+ }
941
+ /**
942
+ * The pointer coordinates in the renderer's screen. Alias for {@code screen.x}.
943
+ * @readonly
944
+ */
945
+ get screenX() {
946
+ return this.screen.x;
947
+ }
948
+ /**
949
+ * The pointer coordinates in the renderer's screen. Alias for {@code screen.y}.
950
+ * @readonly
951
+ */
952
+ get screenY() {
953
+ return this.screen.y;
954
+ }
955
+ /**
956
+ * This will return the local coordinates of the specified container for this InteractionData
957
+ * @param {Container} container - The Container that you would like the local
958
+ * coords off
959
+ * @param {PointData} point - A Point object in which to store the value, optional (otherwise
960
+ * will create a new point)
961
+ * @param {PointData} globalPos - A Point object containing your custom global coords, optional
962
+ * (otherwise will use the current global coords)
963
+ * @returns - A point containing the coordinates of the InteractionData position relative
964
+ * to the Container
965
+ */
966
+ getLocalPosition(container, point, globalPos) {
967
+ return container.worldTransform.applyInverse(globalPos || this.global, point);
968
+ }
969
+ /**
970
+ * Whether the modifier key was pressed when this event natively occurred.
971
+ * @param key - The modifier key.
972
+ */
973
+ getModifierState(key) {
974
+ return "getModifierState" in this.nativeEvent && this.nativeEvent.getModifierState(key);
975
+ }
976
+ /**
977
+ * Not supported.
978
+ * @param _typeArg
979
+ * @param _canBubbleArg
980
+ * @param _cancelableArg
981
+ * @param _viewArg
982
+ * @param _detailArg
983
+ * @param _screenXArg
984
+ * @param _screenYArg
985
+ * @param _clientXArg
986
+ * @param _clientYArg
987
+ * @param _ctrlKeyArg
988
+ * @param _altKeyArg
989
+ * @param _shiftKeyArg
990
+ * @param _metaKeyArg
991
+ * @param _buttonArg
992
+ * @param _relatedTargetArg
993
+ * @deprecated since 7.0.0
994
+ */
995
+ // eslint-disable-next-line max-params
996
+ initMouseEvent(_typeArg, _canBubbleArg, _cancelableArg, _viewArg, _detailArg, _screenXArg, _screenYArg, _clientXArg, _clientYArg, _ctrlKeyArg, _altKeyArg, _shiftKeyArg, _metaKeyArg, _buttonArg, _relatedTargetArg) {
997
+ throw new Error("Method not implemented.");
998
+ }
999
+ }
1000
+
1001
+
1002
+ //# sourceMappingURL=FederatedMouseEvent.mjs.map
1003
+
1004
+ ;// ./node_modules/pixi.js/lib/events/FederatedPointerEvent.mjs
1005
+
1006
+
1007
+ "use strict";
1008
+ class FederatedPointerEvent extends FederatedMouseEvent {
1009
+ constructor() {
1010
+ super(...arguments);
1011
+ /**
1012
+ * The width of the pointer's contact along the x-axis, measured in CSS pixels.
1013
+ * radiusX of TouchEvents will be represented by this value.
1014
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width
1015
+ */
1016
+ this.width = 0;
1017
+ /**
1018
+ * The height of the pointer's contact along the y-axis, measured in CSS pixels.
1019
+ * radiusY of TouchEvents will be represented by this value.
1020
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height
1021
+ */
1022
+ this.height = 0;
1023
+ /**
1024
+ * Indicates whether or not the pointer device that created the event is the primary pointer.
1025
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary
1026
+ */
1027
+ this.isPrimary = false;
1028
+ }
1029
+ // Only included for completeness for now
1030
+ getCoalescedEvents() {
1031
+ if (this.type === "pointermove" || this.type === "mousemove" || this.type === "touchmove") {
1032
+ return [this];
1033
+ }
1034
+ return [];
1035
+ }
1036
+ // Only included for completeness for now
1037
+ getPredictedEvents() {
1038
+ throw new Error("getPredictedEvents is not supported!");
1039
+ }
1040
+ }
1041
+
1042
+
1043
+ //# sourceMappingURL=FederatedPointerEvent.mjs.map
1044
+
1045
+ ;// ./node_modules/pixi.js/lib/events/FederatedWheelEvent.mjs
1046
+
1047
+
1048
+ "use strict";
1049
+ class FederatedWheelEvent extends FederatedMouseEvent {
1050
+ constructor() {
1051
+ super(...arguments);
1052
+ /** Units specified in pixels. */
1053
+ this.DOM_DELTA_PIXEL = 0;
1054
+ /** Units specified in lines. */
1055
+ this.DOM_DELTA_LINE = 1;
1056
+ /** Units specified in pages. */
1057
+ this.DOM_DELTA_PAGE = 2;
1058
+ }
1059
+ }
1060
+ /** Units specified in pixels. */
1061
+ FederatedWheelEvent.DOM_DELTA_PIXEL = 0;
1062
+ /** Units specified in lines. */
1063
+ FederatedWheelEvent.DOM_DELTA_LINE = 1;
1064
+ /** Units specified in pages. */
1065
+ FederatedWheelEvent.DOM_DELTA_PAGE = 2;
1066
+
1067
+
1068
+ //# sourceMappingURL=FederatedWheelEvent.mjs.map
1069
+
1070
+ ;// ./node_modules/pixi.js/lib/events/EventBoundary.mjs
1071
+
1072
+
1073
+
1074
+
1075
+
1076
+
1077
+
1078
+
1079
+ "use strict";
1080
+ const PROPAGATION_LIMIT = 2048;
1081
+ const tempHitLocation = new Point.Point();
1082
+ const tempLocalMapping = new Point.Point();
1083
+ class EventBoundary {
1084
+ /**
1085
+ * @param rootTarget - The holder of the event boundary.
1086
+ */
1087
+ constructor(rootTarget) {
1088
+ /**
1089
+ * Emits events after they were dispatched into the scene graph.
1090
+ *
1091
+ * This can be used for global events listening, regardless of the scene graph being used. It should
1092
+ * not be used by interactive libraries for normal use.
1093
+ *
1094
+ * Special events that do not bubble all the way to the root target are not emitted from here,
1095
+ * e.g. pointerenter, pointerleave, click.
1096
+ */
1097
+ this.dispatch = new eventemitter3["default"]();
1098
+ /**
1099
+ * This flag would emit `pointermove`, `touchmove`, and `mousemove` events on all Containers.
1100
+ *
1101
+ * The `moveOnAll` semantics mirror those of earlier versions of PixiJS. This was disabled in favor of
1102
+ * the Pointer Event API's approach.
1103
+ */
1104
+ this.moveOnAll = false;
1105
+ /** Enables the global move events. `globalpointermove`, `globaltouchmove`, and `globalmousemove` */
1106
+ this.enableGlobalMoveEvents = true;
1107
+ /**
1108
+ * State object for mapping methods.
1109
+ * @see EventBoundary#trackingData
1110
+ */
1111
+ this.mappingState = {
1112
+ trackingData: {}
1113
+ };
1114
+ /**
1115
+ * The event pool maps event constructors to an free pool of instances of those specific events.
1116
+ * @see EventBoundary#allocateEvent
1117
+ * @see EventBoundary#freeEvent
1118
+ */
1119
+ this.eventPool = /* @__PURE__ */ new Map();
1120
+ /** Every interactive element gathered from the scene. Only used in `pointermove` */
1121
+ this._allInteractiveElements = [];
1122
+ /** Every element that passed the hit test. Only used in `pointermove` */
1123
+ this._hitElements = [];
1124
+ /** Whether or not to collect all the interactive elements from the scene. Enabled in `pointermove` */
1125
+ this._isPointerMoveEvent = false;
1126
+ this.rootTarget = rootTarget;
1127
+ this.hitPruneFn = this.hitPruneFn.bind(this);
1128
+ this.hitTestFn = this.hitTestFn.bind(this);
1129
+ this.mapPointerDown = this.mapPointerDown.bind(this);
1130
+ this.mapPointerMove = this.mapPointerMove.bind(this);
1131
+ this.mapPointerOut = this.mapPointerOut.bind(this);
1132
+ this.mapPointerOver = this.mapPointerOver.bind(this);
1133
+ this.mapPointerUp = this.mapPointerUp.bind(this);
1134
+ this.mapPointerUpOutside = this.mapPointerUpOutside.bind(this);
1135
+ this.mapWheel = this.mapWheel.bind(this);
1136
+ this.mappingTable = {};
1137
+ this.addEventMapping("pointerdown", this.mapPointerDown);
1138
+ this.addEventMapping("pointermove", this.mapPointerMove);
1139
+ this.addEventMapping("pointerout", this.mapPointerOut);
1140
+ this.addEventMapping("pointerleave", this.mapPointerOut);
1141
+ this.addEventMapping("pointerover", this.mapPointerOver);
1142
+ this.addEventMapping("pointerup", this.mapPointerUp);
1143
+ this.addEventMapping("pointerupoutside", this.mapPointerUpOutside);
1144
+ this.addEventMapping("wheel", this.mapWheel);
1145
+ }
1146
+ /**
1147
+ * Adds an event mapping for the event `type` handled by `fn`.
1148
+ *
1149
+ * Event mappings can be used to implement additional or custom events. They take an event
1150
+ * coming from the upstream scene (or directly from the {@link EventSystem}) and dispatch new downstream events
1151
+ * generally trickling down and bubbling up to {@link EventBoundary.rootTarget this.rootTarget}.
1152
+ *
1153
+ * To modify the semantics of existing events, the built-in mapping methods of EventBoundary should be overridden
1154
+ * instead.
1155
+ * @param type - The type of upstream event to map.
1156
+ * @param fn - The mapping method. The context of this function must be bound manually, if desired.
1157
+ */
1158
+ addEventMapping(type, fn) {
1159
+ if (!this.mappingTable[type]) {
1160
+ this.mappingTable[type] = [];
1161
+ }
1162
+ this.mappingTable[type].push({
1163
+ fn,
1164
+ priority: 0
1165
+ });
1166
+ this.mappingTable[type].sort((a, b) => a.priority - b.priority);
1167
+ }
1168
+ /**
1169
+ * Dispatches the given event
1170
+ * @param e - The event to dispatch.
1171
+ * @param type - The type of event to dispatch. Defaults to `e.type`.
1172
+ */
1173
+ dispatchEvent(e, type) {
1174
+ e.propagationStopped = false;
1175
+ e.propagationImmediatelyStopped = false;
1176
+ this.propagate(e, type);
1177
+ this.dispatch.emit(type || e.type, e);
1178
+ }
1179
+ /**
1180
+ * Maps the given upstream event through the event boundary and propagates it downstream.
1181
+ * @param e - The event to map.
1182
+ */
1183
+ mapEvent(e) {
1184
+ if (!this.rootTarget) {
1185
+ return;
1186
+ }
1187
+ const mappers = this.mappingTable[e.type];
1188
+ if (mappers) {
1189
+ for (let i = 0, j = mappers.length; i < j; i++) {
1190
+ mappers[i].fn(e);
1191
+ }
1192
+ } else {
1193
+ (0,warn.warn)(`[EventBoundary]: Event mapping not defined for ${e.type}`);
1194
+ }
1195
+ }
1196
+ /**
1197
+ * Finds the Container that is the target of a event at the given coordinates.
1198
+ *
1199
+ * The passed (x,y) coordinates are in the world space above this event boundary.
1200
+ * @param x - The x coordinate of the event.
1201
+ * @param y - The y coordinate of the event.
1202
+ */
1203
+ hitTest(x, y) {
1204
+ EventsTicker.pauseUpdate = true;
1205
+ const useMove = this._isPointerMoveEvent && this.enableGlobalMoveEvents;
1206
+ const fn = useMove ? "hitTestMoveRecursive" : "hitTestRecursive";
1207
+ const invertedPath = this[fn](
1208
+ this.rootTarget,
1209
+ this.rootTarget.eventMode,
1210
+ tempHitLocation.set(x, y),
1211
+ this.hitTestFn,
1212
+ this.hitPruneFn
1213
+ );
1214
+ return invertedPath && invertedPath[0];
1215
+ }
1216
+ /**
1217
+ * Propagate the passed event from from {@link EventBoundary.rootTarget this.rootTarget} to its
1218
+ * target {@code e.target}.
1219
+ * @param e - The event to propagate.
1220
+ * @param type - The type of event to propagate. Defaults to `e.type`.
1221
+ */
1222
+ propagate(e, type) {
1223
+ if (!e.target) {
1224
+ return;
1225
+ }
1226
+ const composedPath = e.composedPath();
1227
+ e.eventPhase = e.CAPTURING_PHASE;
1228
+ for (let i = 0, j = composedPath.length - 1; i < j; i++) {
1229
+ e.currentTarget = composedPath[i];
1230
+ this.notifyTarget(e, type);
1231
+ if (e.propagationStopped || e.propagationImmediatelyStopped)
1232
+ return;
1233
+ }
1234
+ e.eventPhase = e.AT_TARGET;
1235
+ e.currentTarget = e.target;
1236
+ this.notifyTarget(e, type);
1237
+ if (e.propagationStopped || e.propagationImmediatelyStopped)
1238
+ return;
1239
+ e.eventPhase = e.BUBBLING_PHASE;
1240
+ for (let i = composedPath.length - 2; i >= 0; i--) {
1241
+ e.currentTarget = composedPath[i];
1242
+ this.notifyTarget(e, type);
1243
+ if (e.propagationStopped || e.propagationImmediatelyStopped)
1244
+ return;
1245
+ }
1246
+ }
1247
+ /**
1248
+ * Emits the event {@code e} to all interactive containers. The event is propagated in the bubbling phase always.
1249
+ *
1250
+ * This is used in the `globalpointermove` event.
1251
+ * @param e - The emitted event.
1252
+ * @param type - The listeners to notify.
1253
+ * @param targets - The targets to notify.
1254
+ */
1255
+ all(e, type, targets = this._allInteractiveElements) {
1256
+ if (targets.length === 0)
1257
+ return;
1258
+ e.eventPhase = e.BUBBLING_PHASE;
1259
+ const events = Array.isArray(type) ? type : [type];
1260
+ for (let i = targets.length - 1; i >= 0; i--) {
1261
+ events.forEach((event) => {
1262
+ e.currentTarget = targets[i];
1263
+ this.notifyTarget(e, event);
1264
+ });
1265
+ }
1266
+ }
1267
+ /**
1268
+ * Finds the propagation path from {@link EventBoundary.rootTarget rootTarget} to the passed
1269
+ * {@code target}. The last element in the path is {@code target}.
1270
+ * @param target - The target to find the propagation path to.
1271
+ */
1272
+ propagationPath(target) {
1273
+ const propagationPath = [target];
1274
+ for (let i = 0; i < PROPAGATION_LIMIT && (target !== this.rootTarget && target.parent); i++) {
1275
+ if (!target.parent) {
1276
+ throw new Error("Cannot find propagation path to disconnected target");
1277
+ }
1278
+ propagationPath.push(target.parent);
1279
+ target = target.parent;
1280
+ }
1281
+ propagationPath.reverse();
1282
+ return propagationPath;
1283
+ }
1284
+ hitTestMoveRecursive(currentTarget, eventMode, location, testFn, pruneFn, ignore = false) {
1285
+ let shouldReturn = false;
1286
+ if (this._interactivePrune(currentTarget))
1287
+ return null;
1288
+ if (currentTarget.eventMode === "dynamic" || eventMode === "dynamic") {
1289
+ EventsTicker.pauseUpdate = false;
1290
+ }
1291
+ if (currentTarget.interactiveChildren && currentTarget.children) {
1292
+ const children = currentTarget.children;
1293
+ for (let i = children.length - 1; i >= 0; i--) {
1294
+ const child = children[i];
1295
+ const nestedHit = this.hitTestMoveRecursive(
1296
+ child,
1297
+ this._isInteractive(eventMode) ? eventMode : child.eventMode,
1298
+ location,
1299
+ testFn,
1300
+ pruneFn,
1301
+ ignore || pruneFn(currentTarget, location)
1302
+ );
1303
+ if (nestedHit) {
1304
+ if (nestedHit.length > 0 && !nestedHit[nestedHit.length - 1].parent) {
1305
+ continue;
1306
+ }
1307
+ const isInteractive = currentTarget.isInteractive();
1308
+ if (nestedHit.length > 0 || isInteractive) {
1309
+ if (isInteractive)
1310
+ this._allInteractiveElements.push(currentTarget);
1311
+ nestedHit.push(currentTarget);
1312
+ }
1313
+ if (this._hitElements.length === 0)
1314
+ this._hitElements = nestedHit;
1315
+ shouldReturn = true;
1316
+ }
1317
+ }
1318
+ }
1319
+ const isInteractiveMode = this._isInteractive(eventMode);
1320
+ const isInteractiveTarget = currentTarget.isInteractive();
1321
+ if (isInteractiveTarget && isInteractiveTarget)
1322
+ this._allInteractiveElements.push(currentTarget);
1323
+ if (ignore || this._hitElements.length > 0)
1324
+ return null;
1325
+ if (shouldReturn)
1326
+ return this._hitElements;
1327
+ if (isInteractiveMode && (!pruneFn(currentTarget, location) && testFn(currentTarget, location))) {
1328
+ return isInteractiveTarget ? [currentTarget] : [];
1329
+ }
1330
+ return null;
1331
+ }
1332
+ /**
1333
+ * Recursive implementation for {@link EventBoundary.hitTest hitTest}.
1334
+ * @param currentTarget - The Container that is to be hit tested.
1335
+ * @param eventMode - The event mode for the `currentTarget` or one of its parents.
1336
+ * @param location - The location that is being tested for overlap.
1337
+ * @param testFn - Callback that determines whether the target passes hit testing. This callback
1338
+ * can assume that `pruneFn` failed to prune the container.
1339
+ * @param pruneFn - Callback that determiness whether the target and all of its children
1340
+ * cannot pass the hit test. It is used as a preliminary optimization to prune entire subtrees
1341
+ * of the scene graph.
1342
+ * @returns An array holding the hit testing target and all its ancestors in order. The first element
1343
+ * is the target itself and the last is {@link EventBoundary.rootTarget rootTarget}. This is the opposite
1344
+ * order w.r.t. the propagation path. If no hit testing target is found, null is returned.
1345
+ */
1346
+ hitTestRecursive(currentTarget, eventMode, location, testFn, pruneFn) {
1347
+ if (this._interactivePrune(currentTarget) || pruneFn(currentTarget, location)) {
1348
+ return null;
1349
+ }
1350
+ if (currentTarget.eventMode === "dynamic" || eventMode === "dynamic") {
1351
+ EventsTicker.pauseUpdate = false;
1352
+ }
1353
+ if (currentTarget.interactiveChildren && currentTarget.children) {
1354
+ const children = currentTarget.children;
1355
+ const relativeLocation = location;
1356
+ for (let i = children.length - 1; i >= 0; i--) {
1357
+ const child = children[i];
1358
+ const nestedHit = this.hitTestRecursive(
1359
+ child,
1360
+ this._isInteractive(eventMode) ? eventMode : child.eventMode,
1361
+ relativeLocation,
1362
+ testFn,
1363
+ pruneFn
1364
+ );
1365
+ if (nestedHit) {
1366
+ if (nestedHit.length > 0 && !nestedHit[nestedHit.length - 1].parent) {
1367
+ continue;
1368
+ }
1369
+ const isInteractive = currentTarget.isInteractive();
1370
+ if (nestedHit.length > 0 || isInteractive)
1371
+ nestedHit.push(currentTarget);
1372
+ return nestedHit;
1373
+ }
1374
+ }
1375
+ }
1376
+ const isInteractiveMode = this._isInteractive(eventMode);
1377
+ const isInteractiveTarget = currentTarget.isInteractive();
1378
+ if (isInteractiveMode && testFn(currentTarget, location)) {
1379
+ return isInteractiveTarget ? [currentTarget] : [];
1380
+ }
1381
+ return null;
1382
+ }
1383
+ _isInteractive(int) {
1384
+ return int === "static" || int === "dynamic";
1385
+ }
1386
+ _interactivePrune(container) {
1387
+ if (!container || !container.visible || !container.renderable || !container.measurable) {
1388
+ return true;
1389
+ }
1390
+ if (container.eventMode === "none") {
1391
+ return true;
1392
+ }
1393
+ if (container.eventMode === "passive" && !container.interactiveChildren) {
1394
+ return true;
1395
+ }
1396
+ return false;
1397
+ }
1398
+ /**
1399
+ * Checks whether the container or any of its children cannot pass the hit test at all.
1400
+ *
1401
+ * {@link EventBoundary}'s implementation uses the {@link Container.hitArea hitArea}
1402
+ * and {@link Container._maskEffect} for pruning.
1403
+ * @param container - The container to prune.
1404
+ * @param location - The location to test for overlap.
1405
+ */
1406
+ hitPruneFn(container, location) {
1407
+ if (container.hitArea) {
1408
+ container.worldTransform.applyInverse(location, tempLocalMapping);
1409
+ if (!container.hitArea.contains(tempLocalMapping.x, tempLocalMapping.y)) {
1410
+ return true;
1411
+ }
1412
+ }
1413
+ if (container.effects && container.effects.length) {
1414
+ for (let i = 0; i < container.effects.length; i++) {
1415
+ const effect = container.effects[i];
1416
+ if (effect.containsPoint) {
1417
+ const effectContainsPoint = effect.containsPoint(location, this.hitTestFn);
1418
+ if (!effectContainsPoint) {
1419
+ return true;
1420
+ }
1421
+ }
1422
+ }
1423
+ }
1424
+ return false;
1425
+ }
1426
+ /**
1427
+ * Checks whether the container passes hit testing for the given location.
1428
+ * @param container - The container to test.
1429
+ * @param location - The location to test for overlap.
1430
+ * @returns - Whether `container` passes hit testing for `location`.
1431
+ */
1432
+ hitTestFn(container, location) {
1433
+ if (container.hitArea) {
1434
+ return true;
1435
+ }
1436
+ if (container?.containsPoint) {
1437
+ container.worldTransform.applyInverse(location, tempLocalMapping);
1438
+ return container.containsPoint(tempLocalMapping);
1439
+ }
1440
+ return false;
1441
+ }
1442
+ /**
1443
+ * Notify all the listeners to the event's `currentTarget`.
1444
+ *
1445
+ * If the `currentTarget` contains the property `on<type>`, then it is called here,
1446
+ * simulating the behavior from version 6.x and prior.
1447
+ * @param e - The event passed to the target.
1448
+ * @param type - The type of event to notify. Defaults to `e.type`.
1449
+ */
1450
+ notifyTarget(e, type) {
1451
+ if (!e.currentTarget.isInteractive()) {
1452
+ return;
1453
+ }
1454
+ type ?? (type = e.type);
1455
+ const handlerKey = `on${type}`;
1456
+ e.currentTarget[handlerKey]?.(e);
1457
+ const key = e.eventPhase === e.CAPTURING_PHASE || e.eventPhase === e.AT_TARGET ? `${type}capture` : type;
1458
+ this._notifyListeners(e, key);
1459
+ if (e.eventPhase === e.AT_TARGET) {
1460
+ this._notifyListeners(e, type);
1461
+ }
1462
+ }
1463
+ /**
1464
+ * Maps the upstream `pointerdown` events to a downstream `pointerdown` event.
1465
+ *
1466
+ * `touchstart`, `rightdown`, `mousedown` events are also dispatched for specific pointer types.
1467
+ * @param from - The upstream `pointerdown` event.
1468
+ */
1469
+ mapPointerDown(from) {
1470
+ if (!(from instanceof FederatedPointerEvent)) {
1471
+ (0,warn.warn)("EventBoundary cannot map a non-pointer event as a pointer event");
1472
+ return;
1473
+ }
1474
+ const e = this.createPointerEvent(from);
1475
+ this.dispatchEvent(e, "pointerdown");
1476
+ if (e.pointerType === "touch") {
1477
+ this.dispatchEvent(e, "touchstart");
1478
+ } else if (e.pointerType === "mouse" || e.pointerType === "pen") {
1479
+ const isRightButton = e.button === 2;
1480
+ this.dispatchEvent(e, isRightButton ? "rightdown" : "mousedown");
1481
+ }
1482
+ const trackingData = this.trackingData(from.pointerId);
1483
+ trackingData.pressTargetsByButton[from.button] = e.composedPath();
1484
+ this.freeEvent(e);
1485
+ }
1486
+ /**
1487
+ * Maps the upstream `pointermove` to downstream `pointerout`, `pointerover`, and `pointermove` events, in that order.
1488
+ *
1489
+ * The tracking data for the specific pointer has an updated `overTarget`. `mouseout`, `mouseover`,
1490
+ * `mousemove`, and `touchmove` events are fired as well for specific pointer types.
1491
+ * @param from - The upstream `pointermove` event.
1492
+ */
1493
+ mapPointerMove(from) {
1494
+ if (!(from instanceof FederatedPointerEvent)) {
1495
+ (0,warn.warn)("EventBoundary cannot map a non-pointer event as a pointer event");
1496
+ return;
1497
+ }
1498
+ this._allInteractiveElements.length = 0;
1499
+ this._hitElements.length = 0;
1500
+ this._isPointerMoveEvent = true;
1501
+ const e = this.createPointerEvent(from);
1502
+ this._isPointerMoveEvent = false;
1503
+ const isMouse = e.pointerType === "mouse" || e.pointerType === "pen";
1504
+ const trackingData = this.trackingData(from.pointerId);
1505
+ const outTarget = this.findMountedTarget(trackingData.overTargets);
1506
+ if (trackingData.overTargets?.length > 0 && outTarget !== e.target) {
1507
+ const outType = from.type === "mousemove" ? "mouseout" : "pointerout";
1508
+ const outEvent = this.createPointerEvent(from, outType, outTarget);
1509
+ this.dispatchEvent(outEvent, "pointerout");
1510
+ if (isMouse)
1511
+ this.dispatchEvent(outEvent, "mouseout");
1512
+ if (!e.composedPath().includes(outTarget)) {
1513
+ const leaveEvent = this.createPointerEvent(from, "pointerleave", outTarget);
1514
+ leaveEvent.eventPhase = leaveEvent.AT_TARGET;
1515
+ while (leaveEvent.target && !e.composedPath().includes(leaveEvent.target)) {
1516
+ leaveEvent.currentTarget = leaveEvent.target;
1517
+ this.notifyTarget(leaveEvent);
1518
+ if (isMouse)
1519
+ this.notifyTarget(leaveEvent, "mouseleave");
1520
+ leaveEvent.target = leaveEvent.target.parent;
1521
+ }
1522
+ this.freeEvent(leaveEvent);
1523
+ }
1524
+ this.freeEvent(outEvent);
1525
+ }
1526
+ if (outTarget !== e.target) {
1527
+ const overType = from.type === "mousemove" ? "mouseover" : "pointerover";
1528
+ const overEvent = this.clonePointerEvent(e, overType);
1529
+ this.dispatchEvent(overEvent, "pointerover");
1530
+ if (isMouse)
1531
+ this.dispatchEvent(overEvent, "mouseover");
1532
+ let overTargetAncestor = outTarget?.parent;
1533
+ while (overTargetAncestor && overTargetAncestor !== this.rootTarget.parent) {
1534
+ if (overTargetAncestor === e.target)
1535
+ break;
1536
+ overTargetAncestor = overTargetAncestor.parent;
1537
+ }
1538
+ const didPointerEnter = !overTargetAncestor || overTargetAncestor === this.rootTarget.parent;
1539
+ if (didPointerEnter) {
1540
+ const enterEvent = this.clonePointerEvent(e, "pointerenter");
1541
+ enterEvent.eventPhase = enterEvent.AT_TARGET;
1542
+ while (enterEvent.target && enterEvent.target !== outTarget && enterEvent.target !== this.rootTarget.parent) {
1543
+ enterEvent.currentTarget = enterEvent.target;
1544
+ this.notifyTarget(enterEvent);
1545
+ if (isMouse)
1546
+ this.notifyTarget(enterEvent, "mouseenter");
1547
+ enterEvent.target = enterEvent.target.parent;
1548
+ }
1549
+ this.freeEvent(enterEvent);
1550
+ }
1551
+ this.freeEvent(overEvent);
1552
+ }
1553
+ const allMethods = [];
1554
+ const allowGlobalPointerEvents = this.enableGlobalMoveEvents ?? true;
1555
+ this.moveOnAll ? allMethods.push("pointermove") : this.dispatchEvent(e, "pointermove");
1556
+ allowGlobalPointerEvents && allMethods.push("globalpointermove");
1557
+ if (e.pointerType === "touch") {
1558
+ this.moveOnAll ? allMethods.splice(1, 0, "touchmove") : this.dispatchEvent(e, "touchmove");
1559
+ allowGlobalPointerEvents && allMethods.push("globaltouchmove");
1560
+ }
1561
+ if (isMouse) {
1562
+ this.moveOnAll ? allMethods.splice(1, 0, "mousemove") : this.dispatchEvent(e, "mousemove");
1563
+ allowGlobalPointerEvents && allMethods.push("globalmousemove");
1564
+ this.cursor = e.target?.cursor;
1565
+ }
1566
+ if (allMethods.length > 0) {
1567
+ this.all(e, allMethods);
1568
+ }
1569
+ this._allInteractiveElements.length = 0;
1570
+ this._hitElements.length = 0;
1571
+ trackingData.overTargets = e.composedPath();
1572
+ this.freeEvent(e);
1573
+ }
1574
+ /**
1575
+ * Maps the upstream `pointerover` to downstream `pointerover` and `pointerenter` events, in that order.
1576
+ *
1577
+ * The tracking data for the specific pointer gets a new `overTarget`.
1578
+ * @param from - The upstream `pointerover` event.
1579
+ */
1580
+ mapPointerOver(from) {
1581
+ if (!(from instanceof FederatedPointerEvent)) {
1582
+ (0,warn.warn)("EventBoundary cannot map a non-pointer event as a pointer event");
1583
+ return;
1584
+ }
1585
+ const trackingData = this.trackingData(from.pointerId);
1586
+ const e = this.createPointerEvent(from);
1587
+ const isMouse = e.pointerType === "mouse" || e.pointerType === "pen";
1588
+ this.dispatchEvent(e, "pointerover");
1589
+ if (isMouse)
1590
+ this.dispatchEvent(e, "mouseover");
1591
+ if (e.pointerType === "mouse")
1592
+ this.cursor = e.target?.cursor;
1593
+ const enterEvent = this.clonePointerEvent(e, "pointerenter");
1594
+ enterEvent.eventPhase = enterEvent.AT_TARGET;
1595
+ while (enterEvent.target && enterEvent.target !== this.rootTarget.parent) {
1596
+ enterEvent.currentTarget = enterEvent.target;
1597
+ this.notifyTarget(enterEvent);
1598
+ if (isMouse)
1599
+ this.notifyTarget(enterEvent, "mouseenter");
1600
+ enterEvent.target = enterEvent.target.parent;
1601
+ }
1602
+ trackingData.overTargets = e.composedPath();
1603
+ this.freeEvent(e);
1604
+ this.freeEvent(enterEvent);
1605
+ }
1606
+ /**
1607
+ * Maps the upstream `pointerout` to downstream `pointerout`, `pointerleave` events, in that order.
1608
+ *
1609
+ * The tracking data for the specific pointer is cleared of a `overTarget`.
1610
+ * @param from - The upstream `pointerout` event.
1611
+ */
1612
+ mapPointerOut(from) {
1613
+ if (!(from instanceof FederatedPointerEvent)) {
1614
+ (0,warn.warn)("EventBoundary cannot map a non-pointer event as a pointer event");
1615
+ return;
1616
+ }
1617
+ const trackingData = this.trackingData(from.pointerId);
1618
+ if (trackingData.overTargets) {
1619
+ const isMouse = from.pointerType === "mouse" || from.pointerType === "pen";
1620
+ const outTarget = this.findMountedTarget(trackingData.overTargets);
1621
+ const outEvent = this.createPointerEvent(from, "pointerout", outTarget);
1622
+ this.dispatchEvent(outEvent);
1623
+ if (isMouse)
1624
+ this.dispatchEvent(outEvent, "mouseout");
1625
+ const leaveEvent = this.createPointerEvent(from, "pointerleave", outTarget);
1626
+ leaveEvent.eventPhase = leaveEvent.AT_TARGET;
1627
+ while (leaveEvent.target && leaveEvent.target !== this.rootTarget.parent) {
1628
+ leaveEvent.currentTarget = leaveEvent.target;
1629
+ this.notifyTarget(leaveEvent);
1630
+ if (isMouse)
1631
+ this.notifyTarget(leaveEvent, "mouseleave");
1632
+ leaveEvent.target = leaveEvent.target.parent;
1633
+ }
1634
+ trackingData.overTargets = null;
1635
+ this.freeEvent(outEvent);
1636
+ this.freeEvent(leaveEvent);
1637
+ }
1638
+ this.cursor = null;
1639
+ }
1640
+ /**
1641
+ * Maps the upstream `pointerup` event to downstream `pointerup`, `pointerupoutside`,
1642
+ * and `click`/`rightclick`/`pointertap` events, in that order.
1643
+ *
1644
+ * The `pointerupoutside` event bubbles from the original `pointerdown` target to the most specific
1645
+ * ancestor of the `pointerdown` and `pointerup` targets, which is also the `click` event's target. `touchend`,
1646
+ * `rightup`, `mouseup`, `touchendoutside`, `rightupoutside`, `mouseupoutside`, and `tap` are fired as well for
1647
+ * specific pointer types.
1648
+ * @param from - The upstream `pointerup` event.
1649
+ */
1650
+ mapPointerUp(from) {
1651
+ if (!(from instanceof FederatedPointerEvent)) {
1652
+ (0,warn.warn)("EventBoundary cannot map a non-pointer event as a pointer event");
1653
+ return;
1654
+ }
1655
+ const now = performance.now();
1656
+ const e = this.createPointerEvent(from);
1657
+ this.dispatchEvent(e, "pointerup");
1658
+ if (e.pointerType === "touch") {
1659
+ this.dispatchEvent(e, "touchend");
1660
+ } else if (e.pointerType === "mouse" || e.pointerType === "pen") {
1661
+ const isRightButton = e.button === 2;
1662
+ this.dispatchEvent(e, isRightButton ? "rightup" : "mouseup");
1663
+ }
1664
+ const trackingData = this.trackingData(from.pointerId);
1665
+ const pressTarget = this.findMountedTarget(trackingData.pressTargetsByButton[from.button]);
1666
+ let clickTarget = pressTarget;
1667
+ if (pressTarget && !e.composedPath().includes(pressTarget)) {
1668
+ let currentTarget = pressTarget;
1669
+ while (currentTarget && !e.composedPath().includes(currentTarget)) {
1670
+ e.currentTarget = currentTarget;
1671
+ this.notifyTarget(e, "pointerupoutside");
1672
+ if (e.pointerType === "touch") {
1673
+ this.notifyTarget(e, "touchendoutside");
1674
+ } else if (e.pointerType === "mouse" || e.pointerType === "pen") {
1675
+ const isRightButton = e.button === 2;
1676
+ this.notifyTarget(e, isRightButton ? "rightupoutside" : "mouseupoutside");
1677
+ }
1678
+ currentTarget = currentTarget.parent;
1679
+ }
1680
+ delete trackingData.pressTargetsByButton[from.button];
1681
+ clickTarget = currentTarget;
1682
+ }
1683
+ if (clickTarget) {
1684
+ const clickEvent = this.clonePointerEvent(e, "click");
1685
+ clickEvent.target = clickTarget;
1686
+ clickEvent.path = null;
1687
+ if (!trackingData.clicksByButton[from.button]) {
1688
+ trackingData.clicksByButton[from.button] = {
1689
+ clickCount: 0,
1690
+ target: clickEvent.target,
1691
+ timeStamp: now
1692
+ };
1693
+ }
1694
+ const clickHistory = trackingData.clicksByButton[from.button];
1695
+ if (clickHistory.target === clickEvent.target && now - clickHistory.timeStamp < 200) {
1696
+ ++clickHistory.clickCount;
1697
+ } else {
1698
+ clickHistory.clickCount = 1;
1699
+ }
1700
+ clickHistory.target = clickEvent.target;
1701
+ clickHistory.timeStamp = now;
1702
+ clickEvent.detail = clickHistory.clickCount;
1703
+ if (clickEvent.pointerType === "mouse") {
1704
+ const isRightButton = clickEvent.button === 2;
1705
+ this.dispatchEvent(clickEvent, isRightButton ? "rightclick" : "click");
1706
+ } else if (clickEvent.pointerType === "touch") {
1707
+ this.dispatchEvent(clickEvent, "tap");
1708
+ }
1709
+ this.dispatchEvent(clickEvent, "pointertap");
1710
+ this.freeEvent(clickEvent);
1711
+ }
1712
+ this.freeEvent(e);
1713
+ }
1714
+ /**
1715
+ * Maps the upstream `pointerupoutside` event to a downstream `pointerupoutside` event, bubbling from the original
1716
+ * `pointerdown` target to `rootTarget`.
1717
+ *
1718
+ * (The most specific ancestor of the `pointerdown` event and the `pointerup` event must the
1719
+ * `{@link EventBoundary}'s root because the `pointerup` event occurred outside of the boundary.)
1720
+ *
1721
+ * `touchendoutside`, `mouseupoutside`, and `rightupoutside` events are fired as well for specific pointer
1722
+ * types. The tracking data for the specific pointer is cleared of a `pressTarget`.
1723
+ * @param from - The upstream `pointerupoutside` event.
1724
+ */
1725
+ mapPointerUpOutside(from) {
1726
+ if (!(from instanceof FederatedPointerEvent)) {
1727
+ (0,warn.warn)("EventBoundary cannot map a non-pointer event as a pointer event");
1728
+ return;
1729
+ }
1730
+ const trackingData = this.trackingData(from.pointerId);
1731
+ const pressTarget = this.findMountedTarget(trackingData.pressTargetsByButton[from.button]);
1732
+ const e = this.createPointerEvent(from);
1733
+ if (pressTarget) {
1734
+ let currentTarget = pressTarget;
1735
+ while (currentTarget) {
1736
+ e.currentTarget = currentTarget;
1737
+ this.notifyTarget(e, "pointerupoutside");
1738
+ if (e.pointerType === "touch") {
1739
+ this.notifyTarget(e, "touchendoutside");
1740
+ } else if (e.pointerType === "mouse" || e.pointerType === "pen") {
1741
+ this.notifyTarget(e, e.button === 2 ? "rightupoutside" : "mouseupoutside");
1742
+ }
1743
+ currentTarget = currentTarget.parent;
1744
+ }
1745
+ delete trackingData.pressTargetsByButton[from.button];
1746
+ }
1747
+ this.freeEvent(e);
1748
+ }
1749
+ /**
1750
+ * Maps the upstream `wheel` event to a downstream `wheel` event.
1751
+ * @param from - The upstream `wheel` event.
1752
+ */
1753
+ mapWheel(from) {
1754
+ if (!(from instanceof FederatedWheelEvent)) {
1755
+ (0,warn.warn)("EventBoundary cannot map a non-wheel event as a wheel event");
1756
+ return;
1757
+ }
1758
+ const wheelEvent = this.createWheelEvent(from);
1759
+ this.dispatchEvent(wheelEvent);
1760
+ this.freeEvent(wheelEvent);
1761
+ }
1762
+ /**
1763
+ * Finds the most specific event-target in the given propagation path that is still mounted in the scene graph.
1764
+ *
1765
+ * This is used to find the correct `pointerup` and `pointerout` target in the case that the original `pointerdown`
1766
+ * or `pointerover` target was unmounted from the scene graph.
1767
+ * @param propagationPath - The propagation path was valid in the past.
1768
+ * @returns - The most specific event-target still mounted at the same location in the scene graph.
1769
+ */
1770
+ findMountedTarget(propagationPath) {
1771
+ if (!propagationPath) {
1772
+ return null;
1773
+ }
1774
+ let currentTarget = propagationPath[0];
1775
+ for (let i = 1; i < propagationPath.length; i++) {
1776
+ if (propagationPath[i].parent === currentTarget) {
1777
+ currentTarget = propagationPath[i];
1778
+ } else {
1779
+ break;
1780
+ }
1781
+ }
1782
+ return currentTarget;
1783
+ }
1784
+ /**
1785
+ * Creates an event whose {@code originalEvent} is {@code from}, with an optional `type` and `target` override.
1786
+ *
1787
+ * The event is allocated using {@link EventBoundary#allocateEvent this.allocateEvent}.
1788
+ * @param from - The {@code originalEvent} for the returned event.
1789
+ * @param [type=from.type] - The type of the returned event.
1790
+ * @param target - The target of the returned event.
1791
+ */
1792
+ createPointerEvent(from, type, target) {
1793
+ const event = this.allocateEvent(FederatedPointerEvent);
1794
+ this.copyPointerData(from, event);
1795
+ this.copyMouseData(from, event);
1796
+ this.copyData(from, event);
1797
+ event.nativeEvent = from.nativeEvent;
1798
+ event.originalEvent = from;
1799
+ event.target = target ?? this.hitTest(event.global.x, event.global.y) ?? this._hitElements[0];
1800
+ if (typeof type === "string") {
1801
+ event.type = type;
1802
+ }
1803
+ return event;
1804
+ }
1805
+ /**
1806
+ * Creates a wheel event whose {@code originalEvent} is {@code from}.
1807
+ *
1808
+ * The event is allocated using {@link EventBoundary#allocateEvent this.allocateEvent}.
1809
+ * @param from - The upstream wheel event.
1810
+ */
1811
+ createWheelEvent(from) {
1812
+ const event = this.allocateEvent(FederatedWheelEvent);
1813
+ this.copyWheelData(from, event);
1814
+ this.copyMouseData(from, event);
1815
+ this.copyData(from, event);
1816
+ event.nativeEvent = from.nativeEvent;
1817
+ event.originalEvent = from;
1818
+ event.target = this.hitTest(event.global.x, event.global.y);
1819
+ return event;
1820
+ }
1821
+ /**
1822
+ * Clones the event {@code from}, with an optional {@code type} override.
1823
+ *
1824
+ * The event is allocated using {@link EventBoundary#allocateEvent this.allocateEvent}.
1825
+ * @param from - The event to clone.
1826
+ * @param [type=from.type] - The type of the returned event.
1827
+ */
1828
+ clonePointerEvent(from, type) {
1829
+ const event = this.allocateEvent(FederatedPointerEvent);
1830
+ event.nativeEvent = from.nativeEvent;
1831
+ event.originalEvent = from.originalEvent;
1832
+ this.copyPointerData(from, event);
1833
+ this.copyMouseData(from, event);
1834
+ this.copyData(from, event);
1835
+ event.target = from.target;
1836
+ event.path = from.composedPath().slice();
1837
+ event.type = type ?? event.type;
1838
+ return event;
1839
+ }
1840
+ /**
1841
+ * Copies wheel {@link FederatedWheelEvent} data from {@code from} into {@code to}.
1842
+ *
1843
+ * The following properties are copied:
1844
+ * + deltaMode
1845
+ * + deltaX
1846
+ * + deltaY
1847
+ * + deltaZ
1848
+ * @param from - The event to copy data from.
1849
+ * @param to - The event to copy data into.
1850
+ */
1851
+ copyWheelData(from, to) {
1852
+ to.deltaMode = from.deltaMode;
1853
+ to.deltaX = from.deltaX;
1854
+ to.deltaY = from.deltaY;
1855
+ to.deltaZ = from.deltaZ;
1856
+ }
1857
+ /**
1858
+ * Copies pointer {@link FederatedPointerEvent} data from {@code from} into {@code to}.
1859
+ *
1860
+ * The following properties are copied:
1861
+ * + pointerId
1862
+ * + width
1863
+ * + height
1864
+ * + isPrimary
1865
+ * + pointerType
1866
+ * + pressure
1867
+ * + tangentialPressure
1868
+ * + tiltX
1869
+ * + tiltY
1870
+ * @param from - The event to copy data from.
1871
+ * @param to - The event to copy data into.
1872
+ */
1873
+ copyPointerData(from, to) {
1874
+ if (!(from instanceof FederatedPointerEvent && to instanceof FederatedPointerEvent))
1875
+ return;
1876
+ to.pointerId = from.pointerId;
1877
+ to.width = from.width;
1878
+ to.height = from.height;
1879
+ to.isPrimary = from.isPrimary;
1880
+ to.pointerType = from.pointerType;
1881
+ to.pressure = from.pressure;
1882
+ to.tangentialPressure = from.tangentialPressure;
1883
+ to.tiltX = from.tiltX;
1884
+ to.tiltY = from.tiltY;
1885
+ to.twist = from.twist;
1886
+ }
1887
+ /**
1888
+ * Copies mouse {@link FederatedMouseEvent} data from {@code from} to {@code to}.
1889
+ *
1890
+ * The following properties are copied:
1891
+ * + altKey
1892
+ * + button
1893
+ * + buttons
1894
+ * + clientX
1895
+ * + clientY
1896
+ * + metaKey
1897
+ * + movementX
1898
+ * + movementY
1899
+ * + pageX
1900
+ * + pageY
1901
+ * + x
1902
+ * + y
1903
+ * + screen
1904
+ * + shiftKey
1905
+ * + global
1906
+ * @param from - The event to copy data from.
1907
+ * @param to - The event to copy data into.
1908
+ */
1909
+ copyMouseData(from, to) {
1910
+ if (!(from instanceof FederatedMouseEvent && to instanceof FederatedMouseEvent))
1911
+ return;
1912
+ to.altKey = from.altKey;
1913
+ to.button = from.button;
1914
+ to.buttons = from.buttons;
1915
+ to.client.copyFrom(from.client);
1916
+ to.ctrlKey = from.ctrlKey;
1917
+ to.metaKey = from.metaKey;
1918
+ to.movement.copyFrom(from.movement);
1919
+ to.screen.copyFrom(from.screen);
1920
+ to.shiftKey = from.shiftKey;
1921
+ to.global.copyFrom(from.global);
1922
+ }
1923
+ /**
1924
+ * Copies base {@link FederatedEvent} data from {@code from} into {@code to}.
1925
+ *
1926
+ * The following properties are copied:
1927
+ * + isTrusted
1928
+ * + srcElement
1929
+ * + timeStamp
1930
+ * + type
1931
+ * @param from - The event to copy data from.
1932
+ * @param to - The event to copy data into.
1933
+ */
1934
+ copyData(from, to) {
1935
+ to.isTrusted = from.isTrusted;
1936
+ to.srcElement = from.srcElement;
1937
+ to.timeStamp = performance.now();
1938
+ to.type = from.type;
1939
+ to.detail = from.detail;
1940
+ to.view = from.view;
1941
+ to.which = from.which;
1942
+ to.layer.copyFrom(from.layer);
1943
+ to.page.copyFrom(from.page);
1944
+ }
1945
+ /**
1946
+ * @param id - The pointer ID.
1947
+ * @returns The tracking data stored for the given pointer. If no data exists, a blank
1948
+ * state will be created.
1949
+ */
1950
+ trackingData(id) {
1951
+ if (!this.mappingState.trackingData[id]) {
1952
+ this.mappingState.trackingData[id] = {
1953
+ pressTargetsByButton: {},
1954
+ clicksByButton: {},
1955
+ overTarget: null
1956
+ };
1957
+ }
1958
+ return this.mappingState.trackingData[id];
1959
+ }
1960
+ /**
1961
+ * Allocate a specific type of event from {@link EventBoundary#eventPool this.eventPool}.
1962
+ *
1963
+ * This allocation is constructor-agnostic, as long as it only takes one argument - this event
1964
+ * boundary.
1965
+ * @param constructor - The event's constructor.
1966
+ */
1967
+ allocateEvent(constructor) {
1968
+ if (!this.eventPool.has(constructor)) {
1969
+ this.eventPool.set(constructor, []);
1970
+ }
1971
+ const event = this.eventPool.get(constructor).pop() || new constructor(this);
1972
+ event.eventPhase = event.NONE;
1973
+ event.currentTarget = null;
1974
+ event.defaultPrevented = false;
1975
+ event.path = null;
1976
+ event.target = null;
1977
+ return event;
1978
+ }
1979
+ /**
1980
+ * Frees the event and puts it back into the event pool.
1981
+ *
1982
+ * It is illegal to reuse the event until it is allocated again, using `this.allocateEvent`.
1983
+ *
1984
+ * It is also advised that events not allocated from {@link EventBoundary#allocateEvent this.allocateEvent}
1985
+ * not be freed. This is because of the possibility that the same event is freed twice, which can cause
1986
+ * it to be allocated twice & result in overwriting.
1987
+ * @param event - The event to be freed.
1988
+ * @throws Error if the event is managed by another event boundary.
1989
+ */
1990
+ freeEvent(event) {
1991
+ if (event.manager !== this)
1992
+ throw new Error("It is illegal to free an event not managed by this EventBoundary!");
1993
+ const constructor = event.constructor;
1994
+ if (!this.eventPool.has(constructor)) {
1995
+ this.eventPool.set(constructor, []);
1996
+ }
1997
+ this.eventPool.get(constructor).push(event);
1998
+ }
1999
+ /**
2000
+ * Similar to {@link EventEmitter.emit}, except it stops if the `propagationImmediatelyStopped` flag
2001
+ * is set on the event.
2002
+ * @param e - The event to call each listener with.
2003
+ * @param type - The event key.
2004
+ */
2005
+ _notifyListeners(e, type) {
2006
+ const listeners = e.currentTarget._events[type];
2007
+ if (!listeners)
2008
+ return;
2009
+ if ("fn" in listeners) {
2010
+ if (listeners.once)
2011
+ e.currentTarget.removeListener(type, listeners.fn, void 0, true);
2012
+ listeners.fn.call(listeners.context, e);
2013
+ } else {
2014
+ for (let i = 0, j = listeners.length; i < j && !e.propagationImmediatelyStopped; i++) {
2015
+ if (listeners[i].once)
2016
+ e.currentTarget.removeListener(type, listeners[i].fn, void 0, true);
2017
+ listeners[i].fn.call(listeners[i].context, e);
2018
+ }
2019
+ }
2020
+ }
2021
+ }
2022
+
2023
+
2024
+ //# sourceMappingURL=EventBoundary.mjs.map
2025
+
2026
+ ;// ./node_modules/pixi.js/lib/events/EventSystem.mjs
2027
+
2028
+
2029
+
2030
+
2031
+
2032
+
2033
+ "use strict";
2034
+ const MOUSE_POINTER_ID = 1;
2035
+ const TOUCH_TO_POINTER = {
2036
+ touchstart: "pointerdown",
2037
+ touchend: "pointerup",
2038
+ touchendoutside: "pointerupoutside",
2039
+ touchmove: "pointermove",
2040
+ touchcancel: "pointercancel"
2041
+ };
2042
+ const _EventSystem = class _EventSystem {
2043
+ /**
2044
+ * @param {Renderer} renderer
2045
+ */
2046
+ constructor(renderer) {
2047
+ /** Does the device support touch events https://www.w3.org/TR/touch-events/ */
2048
+ this.supportsTouchEvents = "ontouchstart" in globalThis;
2049
+ /** Does the device support pointer events https://www.w3.org/Submission/pointer-events/ */
2050
+ this.supportsPointerEvents = !!globalThis.PointerEvent;
2051
+ /**
2052
+ * The DOM element to which the root event listeners are bound. This is automatically set to
2053
+ * the renderer's {@link Renderer#view view}.
2054
+ */
2055
+ this.domElement = null;
2056
+ /** The resolution used to convert between the DOM client space into world space. */
2057
+ this.resolution = 1;
2058
+ this.renderer = renderer;
2059
+ this.rootBoundary = new EventBoundary(null);
2060
+ EventsTicker.init(this);
2061
+ this.autoPreventDefault = true;
2062
+ this._eventsAdded = false;
2063
+ this._rootPointerEvent = new FederatedPointerEvent(null);
2064
+ this._rootWheelEvent = new FederatedWheelEvent(null);
2065
+ this.cursorStyles = {
2066
+ default: "inherit",
2067
+ pointer: "pointer"
2068
+ };
2069
+ this.features = new Proxy({ ..._EventSystem.defaultEventFeatures }, {
2070
+ set: (target, key, value) => {
2071
+ if (key === "globalMove") {
2072
+ this.rootBoundary.enableGlobalMoveEvents = value;
2073
+ }
2074
+ target[key] = value;
2075
+ return true;
2076
+ }
2077
+ });
2078
+ this._onPointerDown = this._onPointerDown.bind(this);
2079
+ this._onPointerMove = this._onPointerMove.bind(this);
2080
+ this._onPointerUp = this._onPointerUp.bind(this);
2081
+ this._onPointerOverOut = this._onPointerOverOut.bind(this);
2082
+ this.onWheel = this.onWheel.bind(this);
2083
+ }
2084
+ /**
2085
+ * The default interaction mode for all display objects.
2086
+ * @see Container.eventMode
2087
+ * @type {EventMode}
2088
+ * @readonly
2089
+ * @since 7.2.0
2090
+ */
2091
+ static get defaultEventMode() {
2092
+ return this._defaultEventMode;
2093
+ }
2094
+ /**
2095
+ * Runner init called, view is available at this point.
2096
+ * @ignore
2097
+ */
2098
+ init(options) {
2099
+ const { canvas, resolution } = this.renderer;
2100
+ this.setTargetElement(canvas);
2101
+ this.resolution = resolution;
2102
+ _EventSystem._defaultEventMode = options.eventMode ?? "passive";
2103
+ Object.assign(this.features, options.eventFeatures ?? {});
2104
+ this.rootBoundary.enableGlobalMoveEvents = this.features.globalMove;
2105
+ }
2106
+ /**
2107
+ * Handle changing resolution.
2108
+ * @ignore
2109
+ */
2110
+ resolutionChange(resolution) {
2111
+ this.resolution = resolution;
2112
+ }
2113
+ /** Destroys all event listeners and detaches the renderer. */
2114
+ destroy() {
2115
+ this.setTargetElement(null);
2116
+ this.renderer = null;
2117
+ this._currentCursor = null;
2118
+ }
2119
+ /**
2120
+ * Sets the current cursor mode, handling any callbacks or CSS style changes.
2121
+ * @param mode - cursor mode, a key from the cursorStyles dictionary
2122
+ */
2123
+ setCursor(mode) {
2124
+ mode || (mode = "default");
2125
+ let applyStyles = true;
2126
+ if (globalThis.OffscreenCanvas && this.domElement instanceof OffscreenCanvas) {
2127
+ applyStyles = false;
2128
+ }
2129
+ if (this._currentCursor === mode) {
2130
+ return;
2131
+ }
2132
+ this._currentCursor = mode;
2133
+ const style = this.cursorStyles[mode];
2134
+ if (style) {
2135
+ switch (typeof style) {
2136
+ case "string":
2137
+ if (applyStyles) {
2138
+ this.domElement.style.cursor = style;
2139
+ }
2140
+ break;
2141
+ case "function":
2142
+ style(mode);
2143
+ break;
2144
+ case "object":
2145
+ if (applyStyles) {
2146
+ Object.assign(this.domElement.style, style);
2147
+ }
2148
+ break;
2149
+ }
2150
+ } else if (applyStyles && typeof mode === "string" && !Object.prototype.hasOwnProperty.call(this.cursorStyles, mode)) {
2151
+ this.domElement.style.cursor = mode;
2152
+ }
2153
+ }
2154
+ /**
2155
+ * The global pointer event.
2156
+ * Useful for getting the pointer position without listening to events.
2157
+ * @since 7.2.0
2158
+ */
2159
+ get pointer() {
2160
+ return this._rootPointerEvent;
2161
+ }
2162
+ /**
2163
+ * Event handler for pointer down events on {@link EventSystem#domElement this.domElement}.
2164
+ * @param nativeEvent - The native mouse/pointer/touch event.
2165
+ */
2166
+ _onPointerDown(nativeEvent) {
2167
+ if (!this.features.click)
2168
+ return;
2169
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
2170
+ const events = this._normalizeToPointerData(nativeEvent);
2171
+ if (this.autoPreventDefault && events[0].isNormalized) {
2172
+ const cancelable = nativeEvent.cancelable || !("cancelable" in nativeEvent);
2173
+ if (cancelable) {
2174
+ nativeEvent.preventDefault();
2175
+ }
2176
+ }
2177
+ for (let i = 0, j = events.length; i < j; i++) {
2178
+ const nativeEvent2 = events[i];
2179
+ const federatedEvent = this._bootstrapEvent(this._rootPointerEvent, nativeEvent2);
2180
+ this.rootBoundary.mapEvent(federatedEvent);
2181
+ }
2182
+ this.setCursor(this.rootBoundary.cursor);
2183
+ }
2184
+ /**
2185
+ * Event handler for pointer move events on on {@link EventSystem#domElement this.domElement}.
2186
+ * @param nativeEvent - The native mouse/pointer/touch events.
2187
+ */
2188
+ _onPointerMove(nativeEvent) {
2189
+ if (!this.features.move)
2190
+ return;
2191
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
2192
+ EventsTicker.pointerMoved();
2193
+ const normalizedEvents = this._normalizeToPointerData(nativeEvent);
2194
+ for (let i = 0, j = normalizedEvents.length; i < j; i++) {
2195
+ const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
2196
+ this.rootBoundary.mapEvent(event);
2197
+ }
2198
+ this.setCursor(this.rootBoundary.cursor);
2199
+ }
2200
+ /**
2201
+ * Event handler for pointer up events on {@link EventSystem#domElement this.domElement}.
2202
+ * @param nativeEvent - The native mouse/pointer/touch event.
2203
+ */
2204
+ _onPointerUp(nativeEvent) {
2205
+ if (!this.features.click)
2206
+ return;
2207
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
2208
+ let target = nativeEvent.target;
2209
+ if (nativeEvent.composedPath && nativeEvent.composedPath().length > 0) {
2210
+ target = nativeEvent.composedPath()[0];
2211
+ }
2212
+ const outside = target !== this.domElement ? "outside" : "";
2213
+ const normalizedEvents = this._normalizeToPointerData(nativeEvent);
2214
+ for (let i = 0, j = normalizedEvents.length; i < j; i++) {
2215
+ const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
2216
+ event.type += outside;
2217
+ this.rootBoundary.mapEvent(event);
2218
+ }
2219
+ this.setCursor(this.rootBoundary.cursor);
2220
+ }
2221
+ /**
2222
+ * Event handler for pointer over & out events on {@link EventSystem#domElement this.domElement}.
2223
+ * @param nativeEvent - The native mouse/pointer/touch event.
2224
+ */
2225
+ _onPointerOverOut(nativeEvent) {
2226
+ if (!this.features.click)
2227
+ return;
2228
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
2229
+ const normalizedEvents = this._normalizeToPointerData(nativeEvent);
2230
+ for (let i = 0, j = normalizedEvents.length; i < j; i++) {
2231
+ const event = this._bootstrapEvent(this._rootPointerEvent, normalizedEvents[i]);
2232
+ this.rootBoundary.mapEvent(event);
2233
+ }
2234
+ this.setCursor(this.rootBoundary.cursor);
2235
+ }
2236
+ /**
2237
+ * Passive handler for `wheel` events on {@link EventSystem.domElement this.domElement}.
2238
+ * @param nativeEvent - The native wheel event.
2239
+ */
2240
+ onWheel(nativeEvent) {
2241
+ if (!this.features.wheel)
2242
+ return;
2243
+ const wheelEvent = this.normalizeWheelEvent(nativeEvent);
2244
+ this.rootBoundary.rootTarget = this.renderer.lastObjectRendered;
2245
+ this.rootBoundary.mapEvent(wheelEvent);
2246
+ }
2247
+ /**
2248
+ * Sets the {@link EventSystem#domElement domElement} and binds event listeners.
2249
+ *
2250
+ * To deregister the current DOM element without setting a new one, pass {@code null}.
2251
+ * @param element - The new DOM element.
2252
+ */
2253
+ setTargetElement(element) {
2254
+ this._removeEvents();
2255
+ this.domElement = element;
2256
+ EventsTicker.domElement = element;
2257
+ this._addEvents();
2258
+ }
2259
+ /** Register event listeners on {@link Renderer#domElement this.domElement}. */
2260
+ _addEvents() {
2261
+ if (this._eventsAdded || !this.domElement) {
2262
+ return;
2263
+ }
2264
+ EventsTicker.addTickerListener();
2265
+ const style = this.domElement.style;
2266
+ if (style) {
2267
+ if (globalThis.navigator.msPointerEnabled) {
2268
+ style.msContentZooming = "none";
2269
+ style.msTouchAction = "none";
2270
+ } else if (this.supportsPointerEvents) {
2271
+ style.touchAction = "none";
2272
+ }
2273
+ }
2274
+ if (this.supportsPointerEvents) {
2275
+ globalThis.document.addEventListener("pointermove", this._onPointerMove, true);
2276
+ this.domElement.addEventListener("pointerdown", this._onPointerDown, true);
2277
+ this.domElement.addEventListener("pointerleave", this._onPointerOverOut, true);
2278
+ this.domElement.addEventListener("pointerover", this._onPointerOverOut, true);
2279
+ globalThis.addEventListener("pointerup", this._onPointerUp, true);
2280
+ } else {
2281
+ globalThis.document.addEventListener("mousemove", this._onPointerMove, true);
2282
+ this.domElement.addEventListener("mousedown", this._onPointerDown, true);
2283
+ this.domElement.addEventListener("mouseout", this._onPointerOverOut, true);
2284
+ this.domElement.addEventListener("mouseover", this._onPointerOverOut, true);
2285
+ globalThis.addEventListener("mouseup", this._onPointerUp, true);
2286
+ if (this.supportsTouchEvents) {
2287
+ this.domElement.addEventListener("touchstart", this._onPointerDown, true);
2288
+ this.domElement.addEventListener("touchend", this._onPointerUp, true);
2289
+ this.domElement.addEventListener("touchmove", this._onPointerMove, true);
2290
+ }
2291
+ }
2292
+ this.domElement.addEventListener("wheel", this.onWheel, {
2293
+ passive: true,
2294
+ capture: true
2295
+ });
2296
+ this._eventsAdded = true;
2297
+ }
2298
+ /** Unregister event listeners on {@link EventSystem#domElement this.domElement}. */
2299
+ _removeEvents() {
2300
+ if (!this._eventsAdded || !this.domElement) {
2301
+ return;
2302
+ }
2303
+ EventsTicker.removeTickerListener();
2304
+ const style = this.domElement.style;
2305
+ if (style) {
2306
+ if (globalThis.navigator.msPointerEnabled) {
2307
+ style.msContentZooming = "";
2308
+ style.msTouchAction = "";
2309
+ } else if (this.supportsPointerEvents) {
2310
+ style.touchAction = "";
2311
+ }
2312
+ }
2313
+ if (this.supportsPointerEvents) {
2314
+ globalThis.document.removeEventListener("pointermove", this._onPointerMove, true);
2315
+ this.domElement.removeEventListener("pointerdown", this._onPointerDown, true);
2316
+ this.domElement.removeEventListener("pointerleave", this._onPointerOverOut, true);
2317
+ this.domElement.removeEventListener("pointerover", this._onPointerOverOut, true);
2318
+ globalThis.removeEventListener("pointerup", this._onPointerUp, true);
2319
+ } else {
2320
+ globalThis.document.removeEventListener("mousemove", this._onPointerMove, true);
2321
+ this.domElement.removeEventListener("mousedown", this._onPointerDown, true);
2322
+ this.domElement.removeEventListener("mouseout", this._onPointerOverOut, true);
2323
+ this.domElement.removeEventListener("mouseover", this._onPointerOverOut, true);
2324
+ globalThis.removeEventListener("mouseup", this._onPointerUp, true);
2325
+ if (this.supportsTouchEvents) {
2326
+ this.domElement.removeEventListener("touchstart", this._onPointerDown, true);
2327
+ this.domElement.removeEventListener("touchend", this._onPointerUp, true);
2328
+ this.domElement.removeEventListener("touchmove", this._onPointerMove, true);
2329
+ }
2330
+ }
2331
+ this.domElement.removeEventListener("wheel", this.onWheel, true);
2332
+ this.domElement = null;
2333
+ this._eventsAdded = false;
2334
+ }
2335
+ /**
2336
+ * Maps x and y coords from a DOM object and maps them correctly to the PixiJS view. The
2337
+ * resulting value is stored in the point. This takes into account the fact that the DOM
2338
+ * element could be scaled and positioned anywhere on the screen.
2339
+ * @param {PointData} point - the point that the result will be stored in
2340
+ * @param {number} x - the x coord of the position to map
2341
+ * @param {number} y - the y coord of the position to map
2342
+ */
2343
+ mapPositionToPoint(point, x, y) {
2344
+ const rect = this.domElement.isConnected ? this.domElement.getBoundingClientRect() : {
2345
+ x: 0,
2346
+ y: 0,
2347
+ width: this.domElement.width,
2348
+ height: this.domElement.height,
2349
+ left: 0,
2350
+ top: 0
2351
+ };
2352
+ const resolutionMultiplier = 1 / this.resolution;
2353
+ point.x = (x - rect.left) * (this.domElement.width / rect.width) * resolutionMultiplier;
2354
+ point.y = (y - rect.top) * (this.domElement.height / rect.height) * resolutionMultiplier;
2355
+ }
2356
+ /**
2357
+ * Ensures that the original event object contains all data that a regular pointer event would have
2358
+ * @param event - The original event data from a touch or mouse event
2359
+ * @returns An array containing a single normalized pointer event, in the case of a pointer
2360
+ * or mouse event, or a multiple normalized pointer events if there are multiple changed touches
2361
+ */
2362
+ _normalizeToPointerData(event) {
2363
+ const normalizedEvents = [];
2364
+ if (this.supportsTouchEvents && event instanceof TouchEvent) {
2365
+ for (let i = 0, li = event.changedTouches.length; i < li; i++) {
2366
+ const touch = event.changedTouches[i];
2367
+ if (typeof touch.button === "undefined")
2368
+ touch.button = 0;
2369
+ if (typeof touch.buttons === "undefined")
2370
+ touch.buttons = 1;
2371
+ if (typeof touch.isPrimary === "undefined") {
2372
+ touch.isPrimary = event.touches.length === 1 && event.type === "touchstart";
2373
+ }
2374
+ if (typeof touch.width === "undefined")
2375
+ touch.width = touch.radiusX || 1;
2376
+ if (typeof touch.height === "undefined")
2377
+ touch.height = touch.radiusY || 1;
2378
+ if (typeof touch.tiltX === "undefined")
2379
+ touch.tiltX = 0;
2380
+ if (typeof touch.tiltY === "undefined")
2381
+ touch.tiltY = 0;
2382
+ if (typeof touch.pointerType === "undefined")
2383
+ touch.pointerType = "touch";
2384
+ if (typeof touch.pointerId === "undefined")
2385
+ touch.pointerId = touch.identifier || 0;
2386
+ if (typeof touch.pressure === "undefined")
2387
+ touch.pressure = touch.force || 0.5;
2388
+ if (typeof touch.twist === "undefined")
2389
+ touch.twist = 0;
2390
+ if (typeof touch.tangentialPressure === "undefined")
2391
+ touch.tangentialPressure = 0;
2392
+ if (typeof touch.layerX === "undefined")
2393
+ touch.layerX = touch.offsetX = touch.clientX;
2394
+ if (typeof touch.layerY === "undefined")
2395
+ touch.layerY = touch.offsetY = touch.clientY;
2396
+ touch.isNormalized = true;
2397
+ touch.type = event.type;
2398
+ normalizedEvents.push(touch);
2399
+ }
2400
+ } else if (!globalThis.MouseEvent || event instanceof MouseEvent && (!this.supportsPointerEvents || !(event instanceof globalThis.PointerEvent))) {
2401
+ const tempEvent = event;
2402
+ if (typeof tempEvent.isPrimary === "undefined")
2403
+ tempEvent.isPrimary = true;
2404
+ if (typeof tempEvent.width === "undefined")
2405
+ tempEvent.width = 1;
2406
+ if (typeof tempEvent.height === "undefined")
2407
+ tempEvent.height = 1;
2408
+ if (typeof tempEvent.tiltX === "undefined")
2409
+ tempEvent.tiltX = 0;
2410
+ if (typeof tempEvent.tiltY === "undefined")
2411
+ tempEvent.tiltY = 0;
2412
+ if (typeof tempEvent.pointerType === "undefined")
2413
+ tempEvent.pointerType = "mouse";
2414
+ if (typeof tempEvent.pointerId === "undefined")
2415
+ tempEvent.pointerId = MOUSE_POINTER_ID;
2416
+ if (typeof tempEvent.pressure === "undefined")
2417
+ tempEvent.pressure = 0.5;
2418
+ if (typeof tempEvent.twist === "undefined")
2419
+ tempEvent.twist = 0;
2420
+ if (typeof tempEvent.tangentialPressure === "undefined")
2421
+ tempEvent.tangentialPressure = 0;
2422
+ tempEvent.isNormalized = true;
2423
+ normalizedEvents.push(tempEvent);
2424
+ } else {
2425
+ normalizedEvents.push(event);
2426
+ }
2427
+ return normalizedEvents;
2428
+ }
2429
+ /**
2430
+ * Normalizes the native {@link https://w3c.github.io/uievents/#interface-wheelevent WheelEvent}.
2431
+ *
2432
+ * The returned {@link FederatedWheelEvent} is a shared instance. It will not persist across
2433
+ * multiple native wheel events.
2434
+ * @param nativeEvent - The native wheel event that occurred on the canvas.
2435
+ * @returns A federated wheel event.
2436
+ */
2437
+ normalizeWheelEvent(nativeEvent) {
2438
+ const event = this._rootWheelEvent;
2439
+ this._transferMouseData(event, nativeEvent);
2440
+ event.deltaX = nativeEvent.deltaX;
2441
+ event.deltaY = nativeEvent.deltaY;
2442
+ event.deltaZ = nativeEvent.deltaZ;
2443
+ event.deltaMode = nativeEvent.deltaMode;
2444
+ this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY);
2445
+ event.global.copyFrom(event.screen);
2446
+ event.offset.copyFrom(event.screen);
2447
+ event.nativeEvent = nativeEvent;
2448
+ event.type = nativeEvent.type;
2449
+ return event;
2450
+ }
2451
+ /**
2452
+ * Normalizes the `nativeEvent` into a federateed {@link FederatedPointerEvent}.
2453
+ * @param event
2454
+ * @param nativeEvent
2455
+ */
2456
+ _bootstrapEvent(event, nativeEvent) {
2457
+ event.originalEvent = null;
2458
+ event.nativeEvent = nativeEvent;
2459
+ event.pointerId = nativeEvent.pointerId;
2460
+ event.width = nativeEvent.width;
2461
+ event.height = nativeEvent.height;
2462
+ event.isPrimary = nativeEvent.isPrimary;
2463
+ event.pointerType = nativeEvent.pointerType;
2464
+ event.pressure = nativeEvent.pressure;
2465
+ event.tangentialPressure = nativeEvent.tangentialPressure;
2466
+ event.tiltX = nativeEvent.tiltX;
2467
+ event.tiltY = nativeEvent.tiltY;
2468
+ event.twist = nativeEvent.twist;
2469
+ this._transferMouseData(event, nativeEvent);
2470
+ this.mapPositionToPoint(event.screen, nativeEvent.clientX, nativeEvent.clientY);
2471
+ event.global.copyFrom(event.screen);
2472
+ event.offset.copyFrom(event.screen);
2473
+ event.isTrusted = nativeEvent.isTrusted;
2474
+ if (event.type === "pointerleave") {
2475
+ event.type = "pointerout";
2476
+ }
2477
+ if (event.type.startsWith("mouse")) {
2478
+ event.type = event.type.replace("mouse", "pointer");
2479
+ }
2480
+ if (event.type.startsWith("touch")) {
2481
+ event.type = TOUCH_TO_POINTER[event.type] || event.type;
2482
+ }
2483
+ return event;
2484
+ }
2485
+ /**
2486
+ * Transfers base & mouse event data from the {@code nativeEvent} to the federated event.
2487
+ * @param event
2488
+ * @param nativeEvent
2489
+ */
2490
+ _transferMouseData(event, nativeEvent) {
2491
+ event.isTrusted = nativeEvent.isTrusted;
2492
+ event.srcElement = nativeEvent.srcElement;
2493
+ event.timeStamp = performance.now();
2494
+ event.type = nativeEvent.type;
2495
+ event.altKey = nativeEvent.altKey;
2496
+ event.button = nativeEvent.button;
2497
+ event.buttons = nativeEvent.buttons;
2498
+ event.client.x = nativeEvent.clientX;
2499
+ event.client.y = nativeEvent.clientY;
2500
+ event.ctrlKey = nativeEvent.ctrlKey;
2501
+ event.metaKey = nativeEvent.metaKey;
2502
+ event.movement.x = nativeEvent.movementX;
2503
+ event.movement.y = nativeEvent.movementY;
2504
+ event.page.x = nativeEvent.pageX;
2505
+ event.page.y = nativeEvent.pageY;
2506
+ event.relatedTarget = null;
2507
+ event.shiftKey = nativeEvent.shiftKey;
2508
+ }
2509
+ };
2510
+ /** @ignore */
2511
+ _EventSystem.extension = {
2512
+ name: "events",
2513
+ type: [
2514
+ Extensions.ExtensionType.WebGLSystem,
2515
+ Extensions.ExtensionType.CanvasSystem,
2516
+ Extensions.ExtensionType.WebGPUSystem
2517
+ ],
2518
+ priority: -1
2519
+ };
2520
+ /**
2521
+ * The event features that are enabled by the EventSystem
2522
+ * (included in the **pixi.js** and **pixi.js-legacy** bundle), otherwise it will be ignored.
2523
+ * @since 7.2.0
2524
+ */
2525
+ _EventSystem.defaultEventFeatures = {
2526
+ /** Enables pointer events associated with pointer movement. */
2527
+ move: true,
2528
+ /** Enables global pointer move events. */
2529
+ globalMove: true,
2530
+ /** Enables pointer events associated with clicking. */
2531
+ click: true,
2532
+ /** Enables wheel events. */
2533
+ wheel: true
2534
+ };
2535
+ let EventSystem = _EventSystem;
2536
+
2537
+
2538
+ //# sourceMappingURL=EventSystem.mjs.map
2539
+
2540
+ ;// ./node_modules/pixi.js/lib/events/FederatedEventTarget.mjs
2541
+
2542
+
2543
+
2544
+ "use strict";
2545
+ const FederatedContainer = {
2546
+ /**
2547
+ * Property-based event handler for the `click` event.
2548
+ * @memberof scene.Container#
2549
+ * @default null
2550
+ * @example
2551
+ * this.onclick = (event) => {
2552
+ * //some function here that happens on click
2553
+ * }
2554
+ */
2555
+ onclick: null,
2556
+ /**
2557
+ * Property-based event handler for the `mousedown` event.
2558
+ * @memberof scene.Container#
2559
+ * @default null
2560
+ * @example
2561
+ * this.onmousedown = (event) => {
2562
+ * //some function here that happens on mousedown
2563
+ * }
2564
+ */
2565
+ onmousedown: null,
2566
+ /**
2567
+ * Property-based event handler for the `mouseenter` event.
2568
+ * @memberof scene.Container#
2569
+ * @default null
2570
+ * @example
2571
+ * this.onmouseenter = (event) => {
2572
+ * //some function here that happens on mouseenter
2573
+ * }
2574
+ */
2575
+ onmouseenter: null,
2576
+ /**
2577
+ * Property-based event handler for the `mouseleave` event.
2578
+ * @memberof scene.Container#
2579
+ * @default null
2580
+ * @example
2581
+ * this.onmouseleave = (event) => {
2582
+ * //some function here that happens on mouseleave
2583
+ * }
2584
+ */
2585
+ onmouseleave: null,
2586
+ /**
2587
+ * Property-based event handler for the `mousemove` event.
2588
+ * @memberof scene.Container#
2589
+ * @default null
2590
+ * @example
2591
+ * this.onmousemove = (event) => {
2592
+ * //some function here that happens on mousemove
2593
+ * }
2594
+ */
2595
+ onmousemove: null,
2596
+ /**
2597
+ * Property-based event handler for the `globalmousemove` event.
2598
+ * @memberof scene.Container#
2599
+ * @default null
2600
+ * @example
2601
+ * this.onglobalmousemove = (event) => {
2602
+ * //some function here that happens on globalmousemove
2603
+ * }
2604
+ */
2605
+ onglobalmousemove: null,
2606
+ /**
2607
+ * Property-based event handler for the `mouseout` event.
2608
+ * @memberof scene.Container#
2609
+ * @default null
2610
+ * @example
2611
+ * this.onmouseout = (event) => {
2612
+ * //some function here that happens on mouseout
2613
+ * }
2614
+ */
2615
+ onmouseout: null,
2616
+ /**
2617
+ * Property-based event handler for the `mouseover` event.
2618
+ * @memberof scene.Container#
2619
+ * @default null
2620
+ * @example
2621
+ * this.onmouseover = (event) => {
2622
+ * //some function here that happens on mouseover
2623
+ * }
2624
+ */
2625
+ onmouseover: null,
2626
+ /**
2627
+ * Property-based event handler for the `mouseup` event.
2628
+ * @memberof scene.Container#
2629
+ * @default null
2630
+ * @example
2631
+ * this.onmouseup = (event) => {
2632
+ * //some function here that happens on mouseup
2633
+ * }
2634
+ */
2635
+ onmouseup: null,
2636
+ /**
2637
+ * Property-based event handler for the `mouseupoutside` event.
2638
+ * @memberof scene.Container#
2639
+ * @default null
2640
+ * @example
2641
+ * this.onmouseupoutside = (event) => {
2642
+ * //some function here that happens on mouseupoutside
2643
+ * }
2644
+ */
2645
+ onmouseupoutside: null,
2646
+ /**
2647
+ * Property-based event handler for the `pointercancel` event.
2648
+ * @memberof scene.Container#
2649
+ * @default null
2650
+ * @example
2651
+ * this.onpointercancel = (event) => {
2652
+ * //some function here that happens on pointercancel
2653
+ * }
2654
+ */
2655
+ onpointercancel: null,
2656
+ /**
2657
+ * Property-based event handler for the `pointerdown` event.
2658
+ * @memberof scene.Container#
2659
+ * @default null
2660
+ * @example
2661
+ * this.onpointerdown = (event) => {
2662
+ * //some function here that happens on pointerdown
2663
+ * }
2664
+ */
2665
+ onpointerdown: null,
2666
+ /**
2667
+ * Property-based event handler for the `pointerenter` event.
2668
+ * @memberof scene.Container#
2669
+ * @default null
2670
+ * @example
2671
+ * this.onpointerenter = (event) => {
2672
+ * //some function here that happens on pointerenter
2673
+ * }
2674
+ */
2675
+ onpointerenter: null,
2676
+ /**
2677
+ * Property-based event handler for the `pointerleave` event.
2678
+ * @memberof scene.Container#
2679
+ * @default null
2680
+ * @example
2681
+ * this.onpointerleave = (event) => {
2682
+ * //some function here that happens on pointerleave
2683
+ * }
2684
+ */
2685
+ onpointerleave: null,
2686
+ /**
2687
+ * Property-based event handler for the `pointermove` event.
2688
+ * @memberof scene.Container#
2689
+ * @default null
2690
+ * @example
2691
+ * this.onpointermove = (event) => {
2692
+ * //some function here that happens on pointermove
2693
+ * }
2694
+ */
2695
+ onpointermove: null,
2696
+ /**
2697
+ * Property-based event handler for the `globalpointermove` event.
2698
+ * @memberof scene.Container#
2699
+ * @default null
2700
+ * @example
2701
+ * this.onglobalpointermove = (event) => {
2702
+ * //some function here that happens on globalpointermove
2703
+ * }
2704
+ */
2705
+ onglobalpointermove: null,
2706
+ /**
2707
+ * Property-based event handler for the `pointerout` event.
2708
+ * @memberof scene.Container#
2709
+ * @default null
2710
+ * @example
2711
+ * this.onpointerout = (event) => {
2712
+ * //some function here that happens on pointerout
2713
+ * }
2714
+ */
2715
+ onpointerout: null,
2716
+ /**
2717
+ * Property-based event handler for the `pointerover` event.
2718
+ * @memberof scene.Container#
2719
+ * @default null
2720
+ * @example
2721
+ * this.onpointerover = (event) => {
2722
+ * //some function here that happens on pointerover
2723
+ * }
2724
+ */
2725
+ onpointerover: null,
2726
+ /**
2727
+ * Property-based event handler for the `pointertap` event.
2728
+ * @memberof scene.Container#
2729
+ * @default null
2730
+ * @example
2731
+ * this.onpointertap = (event) => {
2732
+ * //some function here that happens on pointertap
2733
+ * }
2734
+ */
2735
+ onpointertap: null,
2736
+ /**
2737
+ * Property-based event handler for the `pointerup` event.
2738
+ * @memberof scene.Container#
2739
+ * @default null
2740
+ * @example
2741
+ * this.onpointerup = (event) => {
2742
+ * //some function here that happens on pointerup
2743
+ * }
2744
+ */
2745
+ onpointerup: null,
2746
+ /**
2747
+ * Property-based event handler for the `pointerupoutside` event.
2748
+ * @memberof scene.Container#
2749
+ * @default null
2750
+ * @example
2751
+ * this.onpointerupoutside = (event) => {
2752
+ * //some function here that happens on pointerupoutside
2753
+ * }
2754
+ */
2755
+ onpointerupoutside: null,
2756
+ /**
2757
+ * Property-based event handler for the `rightclick` event.
2758
+ * @memberof scene.Container#
2759
+ * @default null
2760
+ * @example
2761
+ * this.onrightclick = (event) => {
2762
+ * //some function here that happens on rightclick
2763
+ * }
2764
+ */
2765
+ onrightclick: null,
2766
+ /**
2767
+ * Property-based event handler for the `rightdown` event.
2768
+ * @memberof scene.Container#
2769
+ * @default null
2770
+ * @example
2771
+ * this.onrightdown = (event) => {
2772
+ * //some function here that happens on rightdown
2773
+ * }
2774
+ */
2775
+ onrightdown: null,
2776
+ /**
2777
+ * Property-based event handler for the `rightup` event.
2778
+ * @memberof scene.Container#
2779
+ * @default null
2780
+ * @example
2781
+ * this.onrightup = (event) => {
2782
+ * //some function here that happens on rightup
2783
+ * }
2784
+ */
2785
+ onrightup: null,
2786
+ /**
2787
+ * Property-based event handler for the `rightupoutside` event.
2788
+ * @memberof scene.Container#
2789
+ * @default null
2790
+ * @example
2791
+ * this.onrightupoutside = (event) => {
2792
+ * //some function here that happens on rightupoutside
2793
+ * }
2794
+ */
2795
+ onrightupoutside: null,
2796
+ /**
2797
+ * Property-based event handler for the `tap` event.
2798
+ * @memberof scene.Container#
2799
+ * @default null
2800
+ * @example
2801
+ * this.ontap = (event) => {
2802
+ * //some function here that happens on tap
2803
+ * }
2804
+ */
2805
+ ontap: null,
2806
+ /**
2807
+ * Property-based event handler for the `touchcancel` event.
2808
+ * @memberof scene.Container#
2809
+ * @default null
2810
+ * @example
2811
+ * this.ontouchcancel = (event) => {
2812
+ * //some function here that happens on touchcancel
2813
+ * }
2814
+ */
2815
+ ontouchcancel: null,
2816
+ /**
2817
+ * Property-based event handler for the `touchend` event.
2818
+ * @memberof scene.Container#
2819
+ * @default null
2820
+ * @example
2821
+ * this.ontouchend = (event) => {
2822
+ * //some function here that happens on touchend
2823
+ * }
2824
+ */
2825
+ ontouchend: null,
2826
+ /**
2827
+ * Property-based event handler for the `touchendoutside` event.
2828
+ * @memberof scene.Container#
2829
+ * @default null
2830
+ * @example
2831
+ * this.ontouchendoutside = (event) => {
2832
+ * //some function here that happens on touchendoutside
2833
+ * }
2834
+ */
2835
+ ontouchendoutside: null,
2836
+ /**
2837
+ * Property-based event handler for the `touchmove` event.
2838
+ * @memberof scene.Container#
2839
+ * @default null
2840
+ * @example
2841
+ * this.ontouchmove = (event) => {
2842
+ * //some function here that happens on touchmove
2843
+ * }
2844
+ */
2845
+ ontouchmove: null,
2846
+ /**
2847
+ * Property-based event handler for the `globaltouchmove` event.
2848
+ * @memberof scene.Container#
2849
+ * @default null
2850
+ * @example
2851
+ * this.onglobaltouchmove = (event) => {
2852
+ * //some function here that happens on globaltouchmove
2853
+ * }
2854
+ */
2855
+ onglobaltouchmove: null,
2856
+ /**
2857
+ * Property-based event handler for the `touchstart` event.
2858
+ * @memberof scene.Container#
2859
+ * @default null
2860
+ * @example
2861
+ * this.ontouchstart = (event) => {
2862
+ * //some function here that happens on touchstart
2863
+ * }
2864
+ */
2865
+ ontouchstart: null,
2866
+ /**
2867
+ * Property-based event handler for the `wheel` event.
2868
+ * @memberof scene.Container#
2869
+ * @default null
2870
+ * @example
2871
+ * this.onwheel = (event) => {
2872
+ * //some function here that happens on wheel
2873
+ * }
2874
+ */
2875
+ onwheel: null,
2876
+ /**
2877
+ * Enable interaction events for the Container. Touch, pointer and mouse
2878
+ * @memberof scene.Container#
2879
+ */
2880
+ get interactive() {
2881
+ return this.eventMode === "dynamic" || this.eventMode === "static";
2882
+ },
2883
+ set interactive(value) {
2884
+ this.eventMode = value ? "static" : "passive";
2885
+ },
2886
+ /**
2887
+ * @ignore
2888
+ */
2889
+ _internalEventMode: void 0,
2890
+ /**
2891
+ * Enable interaction events for the Container. Touch, pointer and mouse.
2892
+ * There are 5 types of interaction settings:
2893
+ * - `'none'`: Ignores all interaction events, even on its children.
2894
+ * - `'passive'`: **(default)** Does not emit events and ignores all hit testing on itself and non-interactive children.
2895
+ * Interactive children will still emit events.
2896
+ * - `'auto'`: Does not emit events but is hit tested if parent is interactive. Same as `interactive = false` in v7
2897
+ * - `'static'`: Emit events and is hit tested. Same as `interaction = true` in v7
2898
+ * - `'dynamic'`: Emits events and is hit tested but will also receive mock interaction events fired from a ticker to
2899
+ * allow for interaction when the mouse isn't moving
2900
+ * @example
2901
+ * import { Sprite } from 'pixi.js';
2902
+ *
2903
+ * const sprite = new Sprite(texture);
2904
+ * sprite.eventMode = 'static';
2905
+ * sprite.on('tap', (event) => {
2906
+ * // Handle event
2907
+ * });
2908
+ * @memberof scene.Container#
2909
+ * @since 7.2.0
2910
+ */
2911
+ get eventMode() {
2912
+ return this._internalEventMode ?? EventSystem.defaultEventMode;
2913
+ },
2914
+ set eventMode(value) {
2915
+ this._internalEventMode = value;
2916
+ },
2917
+ /**
2918
+ * Determines if the container is interactive or not
2919
+ * @returns {boolean} Whether the container is interactive or not
2920
+ * @memberof scene.Container#
2921
+ * @since 7.2.0
2922
+ * @example
2923
+ * import { Sprite } from 'pixi.js';
2924
+ *
2925
+ * const sprite = new Sprite(texture);
2926
+ * sprite.eventMode = 'static';
2927
+ * sprite.isInteractive(); // true
2928
+ *
2929
+ * sprite.eventMode = 'dynamic';
2930
+ * sprite.isInteractive(); // true
2931
+ *
2932
+ * sprite.eventMode = 'none';
2933
+ * sprite.isInteractive(); // false
2934
+ *
2935
+ * sprite.eventMode = 'passive';
2936
+ * sprite.isInteractive(); // false
2937
+ *
2938
+ * sprite.eventMode = 'auto';
2939
+ * sprite.isInteractive(); // false
2940
+ */
2941
+ isInteractive() {
2942
+ return this.eventMode === "static" || this.eventMode === "dynamic";
2943
+ },
2944
+ /**
2945
+ * Determines if the children to the container can be clicked/touched
2946
+ * Setting this to false allows PixiJS to bypass a recursive `hitTest` function
2947
+ * @memberof scene.Container#
2948
+ */
2949
+ interactiveChildren: true,
2950
+ /**
2951
+ * Interaction shape. Children will be hit first, then this shape will be checked.
2952
+ * Setting this will cause this shape to be checked in hit tests rather than the container's bounds.
2953
+ * @example
2954
+ * import { Rectangle, Sprite } from 'pixi.js';
2955
+ *
2956
+ * const sprite = new Sprite(texture);
2957
+ * sprite.interactive = true;
2958
+ * sprite.hitArea = new Rectangle(0, 0, 100, 100);
2959
+ * @member {IHitArea}
2960
+ * @memberof scene.Container#
2961
+ */
2962
+ hitArea: null,
2963
+ /**
2964
+ * Unlike `on` or `addListener` which are methods from EventEmitter, `addEventListener`
2965
+ * seeks to be compatible with the DOM's `addEventListener` with support for options.
2966
+ * @memberof scene.Container
2967
+ * @param type - The type of event to listen to.
2968
+ * @param listener - The listener callback or object.
2969
+ * @param options - Listener options, used for capture phase.
2970
+ * @example
2971
+ * // Tell the user whether they did a single, double, triple, or nth click.
2972
+ * button.addEventListener('click', {
2973
+ * handleEvent(e): {
2974
+ * let prefix;
2975
+ *
2976
+ * switch (e.detail) {
2977
+ * case 1: prefix = 'single'; break;
2978
+ * case 2: prefix = 'double'; break;
2979
+ * case 3: prefix = 'triple'; break;
2980
+ * default: prefix = e.detail + 'th'; break;
2981
+ * }
2982
+ *
2983
+ * console.log('That was a ' + prefix + 'click');
2984
+ * }
2985
+ * });
2986
+ *
2987
+ * // But skip the first click!
2988
+ * button.parent.addEventListener('click', function blockClickOnce(e) {
2989
+ * e.stopImmediatePropagation();
2990
+ * button.parent.removeEventListener('click', blockClickOnce, true);
2991
+ * }, {
2992
+ * capture: true,
2993
+ * });
2994
+ */
2995
+ addEventListener(type, listener, options) {
2996
+ const capture = typeof options === "boolean" && options || typeof options === "object" && options.capture;
2997
+ const signal = typeof options === "object" ? options.signal : void 0;
2998
+ const once = typeof options === "object" ? options.once === true : false;
2999
+ const context = typeof listener === "function" ? void 0 : listener;
3000
+ type = capture ? `${type}capture` : type;
3001
+ const listenerFn = typeof listener === "function" ? listener : listener.handleEvent;
3002
+ const emitter = this;
3003
+ if (signal) {
3004
+ signal.addEventListener("abort", () => {
3005
+ emitter.off(type, listenerFn, context);
3006
+ });
3007
+ }
3008
+ if (once) {
3009
+ emitter.once(type, listenerFn, context);
3010
+ } else {
3011
+ emitter.on(type, listenerFn, context);
3012
+ }
3013
+ },
3014
+ /**
3015
+ * Unlike `off` or `removeListener` which are methods from EventEmitter, `removeEventListener`
3016
+ * seeks to be compatible with the DOM's `removeEventListener` with support for options.
3017
+ * @memberof scene.Container
3018
+ * @param type - The type of event the listener is bound to.
3019
+ * @param listener - The listener callback or object.
3020
+ * @param options - The original listener options. This is required to deregister a capture phase listener.
3021
+ */
3022
+ removeEventListener(type, listener, options) {
3023
+ const capture = typeof options === "boolean" && options || typeof options === "object" && options.capture;
3024
+ const context = typeof listener === "function" ? void 0 : listener;
3025
+ type = capture ? `${type}capture` : type;
3026
+ listener = typeof listener === "function" ? listener : listener.handleEvent;
3027
+ this.off(type, listener, context);
3028
+ },
3029
+ /**
3030
+ * Dispatch the event on this {@link Container} using the event's {@link EventBoundary}.
3031
+ *
3032
+ * The target of the event is set to `this` and the `defaultPrevented` flag is cleared before dispatch.
3033
+ * @memberof scene.Container
3034
+ * @param e - The event to dispatch.
3035
+ * @returns Whether the {@link FederatedEvent.preventDefault preventDefault}() method was not invoked.
3036
+ * @example
3037
+ * // Reuse a click event!
3038
+ * button.dispatchEvent(clickEvent);
3039
+ */
3040
+ dispatchEvent(e) {
3041
+ if (!(e instanceof FederatedEvent)) {
3042
+ throw new Error("Container cannot propagate events outside of the Federated Events API");
3043
+ }
3044
+ e.defaultPrevented = false;
3045
+ e.path = null;
3046
+ e.target = this;
3047
+ e.manager.dispatchEvent(e);
3048
+ return !e.defaultPrevented;
3049
+ }
3050
+ };
3051
+
3052
+
3053
+ //# sourceMappingURL=FederatedEventTarget.mjs.map
3054
+
3055
+ ;// ./node_modules/pixi.js/lib/events/init.mjs
3056
+
3057
+
3058
+
3059
+
3060
+
3061
+ "use strict";
3062
+ Extensions.extensions.add(EventSystem);
3063
+ Container.Container.mixin(FederatedContainer);
3064
+ //# sourceMappingURL=init.mjs.map
3065
+
3066
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/spritesheet/init.mjs + 8 modules
3067
+ var spritesheet_init = __webpack_require__(6312);
3068
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/rendering/init.mjs + 7 modules
3069
+ var rendering_init = __webpack_require__(5753);
3070
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/graphics/init.mjs + 1 modules
3071
+ var graphics_init = __webpack_require__(8928);
3072
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/mesh/init.mjs + 1 modules
3073
+ var mesh_init = __webpack_require__(5285);
3074
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/particle-container/init.mjs + 12 modules
3075
+ var particle_container_init = __webpack_require__(9305);
3076
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/text/init.mjs + 3 modules
3077
+ var text_init = __webpack_require__(6958);
3078
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/text-bitmap/init.mjs + 9 modules
3079
+ var text_bitmap_init = __webpack_require__(23);
3080
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/text-html/init.mjs + 14 modules
3081
+ var text_html_init = __webpack_require__(9147);
3082
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/sprite-tiling/init.mjs + 7 modules
3083
+ var sprite_tiling_init = __webpack_require__(8723);
3084
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/scene/sprite-nine-slice/init.mjs + 3 modules
3085
+ var sprite_nine_slice_init = __webpack_require__(7252);
3086
+ // EXTERNAL MODULE: ./node_modules/pixi.js/lib/filters/init.mjs + 4 modules
3087
+ var filters_init = __webpack_require__(9935);
3088
+ ;// ./node_modules/pixi.js/lib/environment-browser/browserAll.mjs
3089
+
3090
+
3091
+
3092
+
3093
+
3094
+
3095
+
3096
+
3097
+
3098
+
3099
+
3100
+
3101
+
3102
+
3103
+
3104
+ "use strict";
3105
+ //# sourceMappingURL=browserAll.mjs.map
3106
+
3107
+
3108
+ /***/ })
3109
+
3110
+ };