{"version":3,"sources":["node_modules/@angular/material/fesm2022/ripple-5bdada85.mjs","node_modules/@angular/material/fesm2022/ripple-loader-dabcd93d.mjs","node_modules/@angular/material/fesm2022/structural-styles-326dcb39.mjs"],"sourcesContent":["import { normalizePassiveListenerOptions, _getEventTarget, Platform } from '@angular/cdk/platform';\nimport * as i0 from '@angular/core';\nimport { Component, ChangeDetectionStrategy, ViewEncapsulation, InjectionToken, inject, ElementRef, ANIMATION_MODULE_TYPE, NgZone, Injector, Directive, Input } from '@angular/core';\nimport { isFakeMousedownFromScreenReader, isFakeTouchstartFromScreenReader } from '@angular/cdk/a11y';\nimport { coerceElement } from '@angular/cdk/coercion';\nimport { _CdkPrivateStyleLoader } from '@angular/cdk/private';\n\n/** Possible states for a ripple element. */\nvar RippleState = /*#__PURE__*/function (RippleState) {\n RippleState[RippleState[\"FADING_IN\"] = 0] = \"FADING_IN\";\n RippleState[RippleState[\"VISIBLE\"] = 1] = \"VISIBLE\";\n RippleState[RippleState[\"FADING_OUT\"] = 2] = \"FADING_OUT\";\n RippleState[RippleState[\"HIDDEN\"] = 3] = \"HIDDEN\";\n return RippleState;\n}(RippleState || {});\n/**\n * Reference to a previously launched ripple element.\n */\nclass RippleRef {\n _renderer;\n element;\n config;\n _animationForciblyDisabledThroughCss;\n /** Current state of the ripple. */\n state = RippleState.HIDDEN;\n constructor(_renderer, /** Reference to the ripple HTML element. */\n element, /** Ripple configuration used for the ripple. */\n config, /* Whether animations are forcibly disabled for ripples through CSS. */\n _animationForciblyDisabledThroughCss = false) {\n this._renderer = _renderer;\n this.element = element;\n this.config = config;\n this._animationForciblyDisabledThroughCss = _animationForciblyDisabledThroughCss;\n }\n /** Fades out the ripple element. */\n fadeOut() {\n this._renderer.fadeOutRipple(this);\n }\n}\n\n/** Options used to bind a passive capturing event. */\nconst passiveCapturingEventOptions$1 = /*#__PURE__*/normalizePassiveListenerOptions({\n passive: true,\n capture: true\n});\n/** Manages events through delegation so that as few event handlers as possible are bound. */\nclass RippleEventManager {\n _events = /*#__PURE__*/new Map();\n /** Adds an event handler. */\n addHandler(ngZone, name, element, handler) {\n const handlersForEvent = this._events.get(name);\n if (handlersForEvent) {\n const handlersForElement = handlersForEvent.get(element);\n if (handlersForElement) {\n handlersForElement.add(handler);\n } else {\n handlersForEvent.set(element, new Set([handler]));\n }\n } else {\n this._events.set(name, new Map([[element, new Set([handler])]]));\n ngZone.runOutsideAngular(() => {\n document.addEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions$1);\n });\n }\n }\n /** Removes an event handler. */\n removeHandler(name, element, handler) {\n const handlersForEvent = this._events.get(name);\n if (!handlersForEvent) {\n return;\n }\n const handlersForElement = handlersForEvent.get(element);\n if (!handlersForElement) {\n return;\n }\n handlersForElement.delete(handler);\n if (handlersForElement.size === 0) {\n handlersForEvent.delete(element);\n }\n if (handlersForEvent.size === 0) {\n this._events.delete(name);\n document.removeEventListener(name, this._delegateEventHandler, passiveCapturingEventOptions$1);\n }\n }\n /** Event handler that is bound and which dispatches the events to the different targets. */\n _delegateEventHandler = event => {\n const target = _getEventTarget(event);\n if (target) {\n this._events.get(event.type)?.forEach((handlers, element) => {\n if (element === target || element.contains(target)) {\n handlers.forEach(handler => handler.handleEvent(event));\n }\n });\n }\n };\n}\n\n/**\n * Default ripple animation configuration for ripples without an explicit\n * animation config specified.\n */\nconst defaultRippleAnimationConfig = {\n enterDuration: 225,\n exitDuration: 150\n};\n/**\n * Timeout for ignoring mouse events. Mouse events will be temporary ignored after touch\n * events to avoid synthetic mouse events.\n */\nconst ignoreMouseEventsTimeout = 800;\n/** Options used to bind a passive capturing event. */\nconst passiveCapturingEventOptions = /*#__PURE__*/normalizePassiveListenerOptions({\n passive: true,\n capture: true\n});\n/** Events that signal that the pointer is down. */\nconst pointerDownEvents = ['mousedown', 'touchstart'];\n/** Events that signal that the pointer is up. */\nconst pointerUpEvents = ['mouseup', 'mouseleave', 'touchend', 'touchcancel'];\nlet _MatRippleStylesLoader = /*#__PURE__*/(() => {\n class _MatRippleStylesLoader {\n static ɵfac = function _MatRippleStylesLoader_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || _MatRippleStylesLoader)();\n };\n static ɵcmp = /* @__PURE__ */i0.ɵɵdefineComponent({\n type: _MatRippleStylesLoader,\n selectors: [[\"ng-component\"]],\n hostAttrs: [\"mat-ripple-style-loader\", \"\"],\n decls: 0,\n vars: 0,\n template: function _MatRippleStylesLoader_Template(rf, ctx) {},\n styles: [\".mat-ripple{overflow:hidden;position:relative}.mat-ripple:not(:empty){transform:translateZ(0)}.mat-ripple.mat-ripple-unbounded{overflow:visible}.mat-ripple-element{position:absolute;border-radius:50%;pointer-events:none;transition:opacity,transform 0ms cubic-bezier(0, 0, 0.2, 1);transform:scale3d(0, 0, 0);background-color:var(--mat-ripple-color, color-mix(in srgb, var(--mat-sys-on-surface) 10%, transparent))}@media(forced-colors: active){.mat-ripple-element{display:none}}.cdk-drag-preview .mat-ripple-element,.cdk-drag-placeholder .mat-ripple-element{display:none}\"],\n encapsulation: 2,\n changeDetection: 0\n });\n }\n return _MatRippleStylesLoader;\n})();\n/*#__PURE__*/(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && void 0;\n})();\n/**\n * Helper service that performs DOM manipulations. Not intended to be used outside this module.\n * The constructor takes a reference to the ripple directive's host element and a map of DOM\n * event handlers to be installed on the element that triggers ripple animations.\n * This will eventually become a custom renderer once Angular support exists.\n * @docs-private\n */\nclass RippleRenderer {\n _target;\n _ngZone;\n _platform;\n /** Element where the ripples are being added to. */\n _containerElement;\n /** Element which triggers the ripple elements on mouse events. */\n _triggerElement;\n /** Whether the pointer is currently down or not. */\n _isPointerDown = false;\n /**\n * Map of currently active ripple references.\n * The ripple reference is mapped to its element event listeners.\n * The reason why `| null` is used is that event listeners are added only\n * when the condition is truthy (see the `_startFadeOutTransition` method).\n */\n _activeRipples = /*#__PURE__*/new Map();\n /** Latest non-persistent ripple that was triggered. */\n _mostRecentTransientRipple;\n /** Time in milliseconds when the last touchstart event happened. */\n _lastTouchStartEvent;\n /** Whether pointer-up event listeners have been registered. */\n _pointerUpEventsRegistered = false;\n /**\n * Cached dimensions of the ripple container. Set when the first\n * ripple is shown and cleared once no more ripples are visible.\n */\n _containerRect;\n static _eventManager = /*#__PURE__*/new RippleEventManager();\n constructor(_target, _ngZone, elementOrElementRef, _platform, injector) {\n this._target = _target;\n this._ngZone = _ngZone;\n this._platform = _platform;\n // Only do anything if we're on the browser.\n if (_platform.isBrowser) {\n this._containerElement = coerceElement(elementOrElementRef);\n }\n if (injector) {\n injector.get(_CdkPrivateStyleLoader).load(_MatRippleStylesLoader);\n }\n }\n /**\n * Fades in a ripple at the given coordinates.\n * @param x Coordinate within the element, along the X axis at which to start the ripple.\n * @param y Coordinate within the element, along the Y axis at which to start the ripple.\n * @param config Extra ripple options.\n */\n fadeInRipple(x, y, config = {}) {\n const containerRect = this._containerRect = this._containerRect || this._containerElement.getBoundingClientRect();\n const animationConfig = {\n ...defaultRippleAnimationConfig,\n ...config.animation\n };\n if (config.centered) {\n x = containerRect.left + containerRect.width / 2;\n y = containerRect.top + containerRect.height / 2;\n }\n const radius = config.radius || distanceToFurthestCorner(x, y, containerRect);\n const offsetX = x - containerRect.left;\n const offsetY = y - containerRect.top;\n const enterDuration = animationConfig.enterDuration;\n const ripple = document.createElement('div');\n ripple.classList.add('mat-ripple-element');\n ripple.style.left = `${offsetX - radius}px`;\n ripple.style.top = `${offsetY - radius}px`;\n ripple.style.height = `${radius * 2}px`;\n ripple.style.width = `${radius * 2}px`;\n // If a custom color has been specified, set it as inline style. If no color is\n // set, the default color will be applied through the ripple theme styles.\n if (config.color != null) {\n ripple.style.backgroundColor = config.color;\n }\n ripple.style.transitionDuration = `${enterDuration}ms`;\n this._containerElement.appendChild(ripple);\n // By default the browser does not recalculate the styles of dynamically created\n // ripple elements. This is critical to ensure that the `scale` animates properly.\n // We enforce a style recalculation by calling `getComputedStyle` and *accessing* a property.\n // See: https://gist.github.com/paulirish/5d52fb081b3570c81e3a\n const computedStyles = window.getComputedStyle(ripple);\n const userTransitionProperty = computedStyles.transitionProperty;\n const userTransitionDuration = computedStyles.transitionDuration;\n // Note: We detect whether animation is forcibly disabled through CSS (e.g. through\n // `transition: none` or `display: none`). This is technically unexpected since animations are\n // controlled through the animation config, but this exists for backwards compatibility. This\n // logic does not need to be super accurate since it covers some edge cases which can be easily\n // avoided by users.\n const animationForciblyDisabledThroughCss = userTransitionProperty === 'none' ||\n // Note: The canonical unit for serialized CSS `