{"version":3,"file":"FederatedMouseEvent.mjs","sources":["../src/FederatedMouseEvent.ts"],"sourcesContent":["import { Point } from '@pixi/core';\nimport { FederatedEvent } from './FederatedEvent';\n\nimport type { IPointData } from '@pixi/core';\nimport type { DisplayObject } from '@pixi/display';\nimport type { PixiTouch } from './FederatedEvent';\n\n/**\n * A {@link PIXI.FederatedEvent} for mouse events.\n * @memberof PIXI\n */\nexport class FederatedMouseEvent extends FederatedEvent<\nMouseEvent | PointerEvent | PixiTouch\n> implements MouseEvent\n{\n /** Whether the \"alt\" key was pressed when this mouse event occurred. */\n altKey: boolean;\n\n /** The specific button that was pressed in this mouse event. */\n button: number;\n\n /** The button depressed when this event occurred. */\n buttons: number;\n\n /** Whether the \"control\" key was pressed when this mouse event occurred. */\n ctrlKey: boolean;\n\n /** Whether the \"meta\" key was pressed when this mouse event occurred. */\n metaKey: boolean;\n\n /** This is currently not implemented in the Federated Events API. */\n relatedTarget: EventTarget;\n\n /** Whether the \"shift\" key was pressed when this mouse event occurred. */\n shiftKey: boolean;\n\n /** The coordinates of the mouse event relative to the canvas. */\n public client: Point = new Point();\n\n /** @readonly */\n public get clientX(): number { return this.client.x; }\n\n /** @readonly */\n public get clientY(): number { return this.client.y; }\n\n /**\n * Alias for {@link PIXI.FederatedMouseEvent.clientX this.clientX}.\n * @readonly\n */\n get x(): number { return this.clientX; }\n\n /**\n * Alias for {@link PIXI.FederatedMouseEvent.clientY this.clientY}.\n * @readonly\n */\n get y(): number { return this.clientY; }\n\n /** This is the number of clicks that occurs in 200ms/click of each other. */\n public detail: number;\n\n /** The movement in this pointer relative to the last `mousemove` event. */\n public movement: Point = new Point();\n\n /** @readonly */\n get movementX(): number { return this.movement.x; }\n\n /** @readonly */\n get movementY(): number { return this.movement.y; }\n\n /**\n * The offset of the pointer coordinates w.r.t. target DisplayObject in world space. This is\n * not supported at the moment.\n */\n public offset: Point = new Point();\n\n /** @readonly */\n get offsetX(): number { return this.offset.x; }\n\n /** @readonly */\n get offsetY(): number { return this.offset.y; }\n\n /** The pointer coordinates in world space. */\n public global: Point = new Point();\n\n /** @readonly */\n get globalX(): number { return this.global.x; }\n\n /** @readonly */\n get globalY(): number { return this.global.y; }\n\n /**\n * The pointer coordinates in the renderer's {@link PIXI.Renderer.screen screen}. This has slightly\n * different semantics than native PointerEvent screenX/screenY.\n */\n public screen: Point = new Point();\n\n /**\n * The pointer coordinates in the renderer's screen. Alias for {@code screen.x}.\n * @readonly\n */\n get screenX(): number { return this.screen.x; }\n\n /**\n * The pointer coordinates in the renderer's screen. Alias for {@code screen.y}.\n * @readonly\n */\n get screenY(): number { return this.screen.y; }\n\n /**\n * This will return the local coordinates of the specified displayObject for this InteractionData\n * @param {PIXI.DisplayObject} displayObject - The DisplayObject that you would like the local\n * coords off\n * @param {PIXI.IPointData} point - A Point object in which to store the value, optional (otherwise\n * will create a new point)\n * @param {PIXI.IPointData} globalPos - A Point object containing your custom global coords, optional\n * (otherwise will use the current global coords)\n * @returns - A point containing the coordinates of the InteractionData position relative\n * to the DisplayObject\n */\n public getLocalPosition

(displayObject: DisplayObject, point?: P, globalPos?: IPointData): P\n {\n return displayObject.worldTransform.applyInverse

(globalPos || this.global, point);\n }\n\n /**\n * Whether the modifier key was pressed when this event natively occurred.\n * @param key - The modifier key.\n */\n getModifierState(key: string): boolean\n {\n return 'getModifierState' in this.nativeEvent && this.nativeEvent.getModifierState(key);\n }\n\n /**\n * Not supported.\n * @param _typeArg\n * @param _canBubbleArg\n * @param _cancelableArg\n * @param _viewArg\n * @param _detailArg\n * @param _screenXArg\n * @param _screenYArg\n * @param _clientXArg\n * @param _clientYArg\n * @param _ctrlKeyArg\n * @param _altKeyArg\n * @param _shiftKeyArg\n * @param _metaKeyArg\n * @param _buttonArg\n * @param _relatedTargetArg\n * @deprecated since 7.0.0\n */\n // eslint-disable-next-line max-params\n initMouseEvent(\n _typeArg: string,\n _canBubbleArg: boolean,\n _cancelableArg: boolean,\n _viewArg: Window,\n _detailArg: number,\n _screenXArg: number,\n _screenYArg: number,\n _clientXArg: number,\n _clientYArg: number,\n _ctrlKeyArg: boolean,\n _altKeyArg: boolean,\n _shiftKeyArg: boolean,\n _metaKeyArg: boolean,\n _buttonArg: number,\n _relatedTargetArg: EventTarget\n ): void\n {\n throw new Error('Method not implemented.');\n }\n}\n"],"names":[],"mappings":";;AAWO,MAAM,4BAA4B,eAGzC;AAAA,EAHO,cAAA;AAAA,UAAA,GAAA,SAAA,GA0BI,KAAA,SAAgB,IAAI,SAwBpB,KAAA,WAAkB,IAAI,SAYtB,KAAA,SAAgB,IAAI,SASpB,KAAA,SAAgB,IAAI,SAYpB,KAAA,SAAgB,IAAI;EAAM;AAAA;AAAA,EAtDjC,IAAW,UAAkB;AAAE,WAAO,KAAK,OAAO;AAAA,EAAG;AAAA;AAAA,EAGrD,IAAW,UAAkB;AAAE,WAAO,KAAK,OAAO;AAAA,EAAG;AAAA;AAAA;AAAA;AAAA;AAAA,EAMrD,IAAI,IAAY;AAAE,WAAO,KAAK;AAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA,EAMvC,IAAI,IAAY;AAAE,WAAO,KAAK;AAAA,EAAS;AAAA;AAAA,EASvC,IAAI,YAAoB;AAAE,WAAO,KAAK,SAAS;AAAA,EAAG;AAAA;AAAA,EAGlD,IAAI,YAAoB;AAAE,WAAO,KAAK,SAAS;AAAA,EAAG;AAAA;AAAA,EASlD,IAAI,UAAkB;AAAE,WAAO,KAAK,OAAO;AAAA,EAAG;AAAA;AAAA,EAG9C,IAAI,UAAkB;AAAE,WAAO,KAAK,OAAO;AAAA,EAAG;AAAA;AAAA,EAM9C,IAAI,UAAkB;AAAE,WAAO,KAAK,OAAO;AAAA,EAAG;AAAA;AAAA,EAG9C,IAAI,UAAkB;AAAE,WAAO,KAAK,OAAO;AAAA,EAAG;AAAA;AAAA;AAAA;AAAA;AAAA,EAY9C,IAAI,UAAkB;AAAE,WAAO,KAAK,OAAO;AAAA,EAAG;AAAA;AAAA;AAAA;AAAA;AA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