Files
WrenchBoardIonic2023/.angular/cache/14.2.0/babel-webpack/474baefb14fc864b1ef4412cf8cf9eb9.json
T
CHIEFSOFT\ameye cea49e295a first commit
2023-05-12 22:30:08 -04:00

1 line
190 KiB
JSON

{"ast":null,"code":"import _asyncToGenerator from \"D:/MobileDev/WRB/WrenchBoard2023a/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\n\n/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { r as registerInstance, e as createEvent, c as writeTask, h, H as Host, i as getElement } from './index-1a99aeb7.js';\nimport { b as getIonMode, c as config } from './ionic-global-04e268e7.js';\nimport { f as findClosestIonContent, i as isIonContent, d as disableContentScrollY, r as resetContentScrollY, a as findIonContent, p as printIonContentErrorMsg } from './index-3413f7be.js';\nimport { C as CoreDelegate, a as attachComponent, d as detachComponent } from './framework-delegate-ce4f806c.js';\nimport { g as getElementRoot, l as clamp, r as raf, j as inheritAttributes } from './helpers-4d272360.js';\nimport { KEYBOARD_DID_OPEN } from './keyboard-4d5544a0.js';\nimport { p as printIonWarning } from './index-c4b11676.js';\nimport { B as BACKDROP, e as prepareOverlay, d as present, h as activeAnimations, f as dismiss, g as eventMethod } from './overlays-f469834d.js';\nimport { g as getClassMap } from './theme-7670341c.js';\nimport { e as deepReady } from './index-8191d09f.js';\nimport { c as createAnimation } from './animation-36c1d77d.js';\nimport { g as getTimeGivenProgression } from './cubic-bezier-c313947a.js';\nimport { createGesture } from './index-3f1a7d95.js';\nimport { w as win } from './index-33ffec25.js';\nimport './hardware-back-button-490df115.js';\nimport './gesture-controller-17e82006.js';\nvar Style;\n\n(function (Style) {\n Style[\"Dark\"] = \"DARK\";\n Style[\"Light\"] = \"LIGHT\";\n Style[\"Default\"] = \"DEFAULT\";\n})(Style || (Style = {}));\n\nconst StatusBar = {\n getEngine() {\n var _a, _b, _c;\n\n return ((_b = (_a = win) === null || _a === void 0 ? void 0 : _a.Capacitor) === null || _b === void 0 ? void 0 : _b.isPluginAvailable('StatusBar')) && ((_c = win) === null || _c === void 0 ? void 0 : _c.Capacitor.Plugins.StatusBar);\n },\n\n supportsDefaultStatusBarStyle() {\n var _a, _b;\n /**\n * The 'DEFAULT' status bar style was added\n * to the @capacitor/status-bar plugin in Capacitor 3.\n * PluginHeaders is only supported in Capacitor 3+,\n * so we can use this to detect Capacitor 3.\n */\n\n\n return !!((_b = (_a = win) === null || _a === void 0 ? void 0 : _a.Capacitor) === null || _b === void 0 ? void 0 : _b.PluginHeaders);\n },\n\n setStyle(options) {\n const engine = this.getEngine();\n\n if (!engine) {\n return;\n }\n\n engine.setStyle(options);\n }\n\n};\n/**\n * Use y = mx + b to\n * figure out the backdrop value\n * at a particular x coordinate. This\n * is useful when the backdrop does\n * not begin to fade in until after\n * the 0 breakpoint.\n */\n\nconst getBackdropValueForSheet = (x, backdropBreakpoint) => {\n /**\n * We will use these points:\n * (backdropBreakpoint, 0)\n * (maxBreakpoint, 1)\n * We know that at the beginning breakpoint,\n * the backdrop will be hidden. We also\n * know that at the maxBreakpoint, the backdrop\n * must be fully visible. maxBreakpoint should\n * always be 1 even if the maximum value\n * of the breakpoints array is not 1 since\n * the animation runs from a progress of 0\n * to a progress of 1.\n * m = (y2 - y1) / (x2 - x1)\n *\n * This is simplified from:\n * m = (1 - 0) / (maxBreakpoint - backdropBreakpoint)\n *\n * If the backdropBreakpoint is 1, we return 0 as the\n * backdrop is completely hidden.\n *\n */\n if (backdropBreakpoint === 1) {\n return 0;\n }\n\n const slope = 1 / (1 - backdropBreakpoint);\n /**\n * From here, compute b which is\n * the backdrop opacity if the offset\n * is 0. If the backdrop does not\n * begin to fade in until after the\n * 0 breakpoint, this b value will be\n * negative. This is fine as we never pass\n * b directly into the animation keyframes.\n * b = y - mx\n * Use a known point: (backdropBreakpoint, 0)\n * This is simplified from:\n * b = 0 - (backdropBreakpoint * slope)\n */\n\n const b = -(backdropBreakpoint * slope);\n /**\n * Finally, we can now determine the\n * backdrop offset given an arbitrary\n * gesture offset.\n */\n\n return x * slope + b;\n};\n/**\n * The tablet/desktop card modal activates\n * when the window width is >= 768.\n * At that point, the presenting element\n * is not transformed, so we do not need to\n * adjust the status bar color.\n *\n * Note: We check supportsDefaultStatusBarStyle so that\n * Capacitor <= 2 users do not get their status bar\n * stuck in an inconsistent state due to a lack of\n * support for Style.Default.\n */\n\n\nconst setCardStatusBarDark = () => {\n if (!win || win.innerWidth >= 768 || !StatusBar.supportsDefaultStatusBarStyle()) {\n return;\n }\n\n StatusBar.setStyle({\n style: Style.Dark\n });\n};\n\nconst setCardStatusBarDefault = () => {\n if (!win || win.innerWidth >= 768 || !StatusBar.supportsDefaultStatusBarStyle()) {\n return;\n }\n\n StatusBar.setStyle({\n style: Style.Default\n });\n};\n\nconst handleCanDismiss = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (el, animation) {\n /**\n * If canDismiss is not a function\n * then we can return early. If canDismiss is `true`,\n * then canDismissBlocksGesture is `false` as canDismiss\n * will never interrupt the gesture. As a result,\n * this code block is never reached. If canDismiss is `false`,\n * then we never dismiss.\n */\n if (typeof el.canDismiss !== 'function') {\n return;\n }\n /**\n * Run the canDismiss callback.\n * If the function returns `true`,\n * then we can proceed with dismiss.\n */\n\n\n const shouldDismiss = yield el.canDismiss();\n\n if (!shouldDismiss) {\n return;\n }\n /**\n * If canDismiss resolved after the snap\n * back animation finished, we can\n * dismiss immediately.\n *\n * If canDismiss resolved before the snap\n * back animation finished, we need to\n * wait until the snap back animation is\n * done before dismissing.\n */\n\n\n if (animation.isRunning()) {\n animation.onFinish(() => {\n el.dismiss(undefined, 'handler');\n }, {\n oneTimeCallback: true\n });\n } else {\n el.dismiss(undefined, 'handler');\n }\n });\n\n return function handleCanDismiss(_x, _x2) {\n return _ref.apply(this, arguments);\n };\n}();\n/**\n * This function lets us simulate a realistic spring-like animation\n * when swiping down on the modal.\n * There are two forces that we need to use to compute the spring physics:\n *\n * 1. Stiffness, k: This is a measure of resistance applied a spring.\n * 2. Dampening, c: This value has the effect of reducing or preventing oscillation.\n *\n * Using these two values, we can calculate the Spring Force and the Dampening Force\n * to compute the total force applied to a spring.\n *\n * Spring Force: This force pulls a spring back into its equilibrium position.\n * Hooke's Law tells us that that spring force (FS) = kX.\n * k is the stiffness of a spring, and X is the displacement of the spring from its\n * equilibrium position. In this case, it is the amount by which the free end\n * of a spring was displaced (stretched/pushed) from its \"relaxed\" position.\n *\n * Dampening Force: This force slows down motion. Without it, a spring would oscillate forever.\n * The dampening force, FD, can be found via this formula: FD = -cv\n * where c the dampening value and v is velocity.\n *\n * Therefore, the resulting force that is exerted on the block is:\n * F = FS + FD = -kX - cv\n *\n * Newton's 2nd Law tells us that F = ma:\n * ma = -kX - cv.\n *\n * For Ionic's purposes, we can assume that m = 1:\n * a = -kX - cv\n *\n * Imagine a block attached to the end of a spring. At equilibrium\n * the block is at position x = 1.\n * Pressing on the block moves it to position x = 0;\n * So, to calculate the displacement, we need to take the\n * current position and subtract the previous position from it.\n * X = x - x0 = 0 - 1 = -1.\n *\n * For Ionic's purposes, we are only pushing on the spring modal\n * so we have a max position of 1.\n * As a result, we can expand displacement to this formula:\n * X = x - 1\n *\n * a = -k(x - 1) - cv\n *\n * We can represent the motion of something as a function of time: f(t) = x.\n * The derivative of position gives us the velocity: f'(t)\n * The derivative of the velocity gives us the acceleration: f''(t)\n *\n * We can substitute the formula above with these values:\n *\n * f\"(t) = -k * (f(t) - 1) - c * f'(t)\n *\n * This is called a differential equation.\n *\n * We know that at t = 0, we are at x = 0 because the modal does not move: f(0) = 0\n * This means our velocity is also zero: f'(0) = 0.\n *\n * We can cheat a bit and plug the formula into Wolfram Alpha.\n * However, we need to pick stiffness and dampening values:\n * k = 0.57\n * c = 15\n *\n * I picked these as they are fairly close to native iOS's spring effect\n * with the modal.\n *\n * What we plug in is this: f(0) = 0; f'(0) = 0; f''(t) = -0.57(f(t) - 1) - 15f'(t)\n *\n * The result is a formula that lets us calculate the acceleration\n * for a given time t.\n * Note: This is the approximate form of the solution. Wolfram Alpha will\n * give you a complex differential equation too.\n */\n\n\nconst calculateSpringStep = t => {\n return 0.00255275 * 2.71828 ** (-14.9619 * t) - 1.00255 * 2.71828 ** (-0.0380968 * t) + 1;\n}; // Defaults for the card swipe animation\n\n\nconst SwipeToCloseDefaults = {\n MIN_PRESENTING_SCALE: 0.93\n};\n\nconst createSwipeToCloseGesture = (el, animation, onDismiss) => {\n /**\n * The step value at which a card modal\n * is eligible for dismissing via gesture.\n */\n const DISMISS_THRESHOLD = 0.5;\n const height = el.offsetHeight;\n let isOpen = false;\n let canDismissBlocksGesture = false;\n let contentEl = null;\n let scrollEl = null;\n const canDismissMaxStep = 0.2;\n let initialScrollY = true;\n let lastStep = 0;\n\n const getScrollY = () => {\n if (contentEl && isIonContent(contentEl)) {\n return contentEl.scrollY;\n /**\n * Custom scroll containers are intended to be\n * used with virtual scrolling, so we assume\n * there is scrolling in this case.\n */\n } else {\n return true;\n }\n };\n\n const canStart = detail => {\n const target = detail.event.target;\n\n if (target === null || !target.closest) {\n return true;\n }\n /**\n * If we are swiping on the content,\n * swiping should only be possible if\n * the content is scrolled all the way\n * to the top so that we do not interfere\n * with scrolling.\n *\n * We cannot assume that the `ion-content`\n * target will remain consistent between\n * swipes. For example, when using\n * ion-nav within a card modal it is\n * possible to swipe, push a view, and then\n * swipe again. The target content will not\n * be the same between swipes.\n */\n\n\n contentEl = findClosestIonContent(target);\n\n if (contentEl) {\n /**\n * The card should never swipe to close\n * on the content with a refresher.\n * Note: We cannot solve this by making the\n * swipeToClose gesture have a higher priority\n * than the refresher gesture as the iOS native\n * refresh gesture uses a scroll listener in\n * addition to a gesture.\n *\n * Note: Do not use getScrollElement here\n * because we need this to be a synchronous\n * operation, and getScrollElement is\n * asynchronous.\n */\n if (isIonContent(contentEl)) {\n const root = getElementRoot(contentEl);\n scrollEl = root.querySelector('.inner-scroll');\n } else {\n scrollEl = contentEl;\n }\n\n const hasRefresherInContent = !!contentEl.querySelector('ion-refresher');\n return !hasRefresherInContent && scrollEl.scrollTop === 0;\n }\n /**\n * Card should be swipeable on all\n * parts of the modal except for the footer.\n */\n\n\n const footer = target.closest('ion-footer');\n\n if (footer === null) {\n return true;\n }\n\n return false;\n };\n\n const onStart = detail => {\n const {\n deltaY\n } = detail;\n /**\n * Get the initial scrollY value so\n * that we can correctly reset the scrollY\n * prop when the gesture ends.\n */\n\n initialScrollY = getScrollY();\n /**\n * If canDismiss is anything other than `true`\n * then users should be able to swipe down\n * until a threshold is hit. At that point,\n * the card modal should not proceed any further.\n * TODO (FW-937)\n * Remove undefined check\n */\n\n canDismissBlocksGesture = el.canDismiss !== undefined && el.canDismiss !== true;\n /**\n * If we are pulling down, then\n * it is possible we are pulling on the\n * content. We do not want scrolling to\n * happen at the same time as the gesture.\n */\n\n if (deltaY > 0 && contentEl) {\n disableContentScrollY(contentEl);\n }\n\n animation.progressStart(true, isOpen ? 1 : 0);\n };\n\n const onMove = detail => {\n const {\n deltaY\n } = detail;\n /**\n * If we are pulling down, then\n * it is possible we are pulling on the\n * content. We do not want scrolling to\n * happen at the same time as the gesture.\n */\n\n if (deltaY > 0 && contentEl) {\n disableContentScrollY(contentEl);\n }\n /**\n * If we are swiping on the content\n * then the swipe gesture should only\n * happen if we are pulling down.\n *\n * However, if we pull up and\n * then down such that the scroll position\n * returns to 0, we should be able to swipe\n * the card.\n */\n\n\n const step = detail.deltaY / height;\n /**\n * Check if user is swiping down and\n * if we have a canDismiss value that\n * should block the gesture from\n * proceeding,\n */\n\n const isAttempingDismissWithCanDismiss = step >= 0 && canDismissBlocksGesture;\n /**\n * If we are blocking the gesture from dismissing,\n * set the max step value so that the sheet cannot be\n * completely hidden.\n */\n\n const maxStep = isAttempingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;\n /**\n * If we are blocking the gesture from\n * dismissing, calculate the spring modifier value\n * this will be added to the starting breakpoint\n * value to give the gesture a spring-like feeling.\n * Note that the starting breakpoint is always 0,\n * so we omit adding 0 to the result.\n */\n\n const processedStep = isAttempingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;\n const clampedStep = clamp(0.0001, processedStep, maxStep);\n animation.progressStep(clampedStep);\n /**\n * When swiping down half way, the status bar style\n * should be reset to its default value.\n *\n * We track lastStep so that we do not fire these\n * functions on every onMove, only when the user has\n * crossed a certain threshold.\n */\n\n if (clampedStep >= DISMISS_THRESHOLD && lastStep < DISMISS_THRESHOLD) {\n setCardStatusBarDefault();\n /**\n * However, if we swipe back up, then the\n * status bar style should be set to have light\n * text on a dark background.\n */\n } else if (clampedStep < DISMISS_THRESHOLD && lastStep >= DISMISS_THRESHOLD) {\n setCardStatusBarDark();\n }\n\n lastStep = clampedStep;\n };\n\n const onEnd = detail => {\n const velocity = detail.velocityY;\n const step = detail.deltaY / height;\n const isAttempingDismissWithCanDismiss = step >= 0 && canDismissBlocksGesture;\n const maxStep = isAttempingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;\n const processedStep = isAttempingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;\n const clampedStep = clamp(0.0001, processedStep, maxStep);\n const threshold = (detail.deltaY + velocity * 1000) / height;\n /**\n * If canDismiss blocks\n * the swipe gesture, then the\n * animation can never complete until\n * canDismiss is checked.\n */\n\n const shouldComplete = !isAttempingDismissWithCanDismiss && threshold >= DISMISS_THRESHOLD;\n let newStepValue = shouldComplete ? -0.001 : 0.001;\n\n if (!shouldComplete) {\n animation.easing('cubic-bezier(1, 0, 0.68, 0.28)');\n newStepValue += getTimeGivenProgression([0, 0], [1, 0], [0.68, 0.28], [1, 1], clampedStep)[0];\n } else {\n animation.easing('cubic-bezier(0.32, 0.72, 0, 1)');\n newStepValue += getTimeGivenProgression([0, 0], [0.32, 0.72], [0, 1], [1, 1], clampedStep)[0];\n }\n\n const duration = shouldComplete ? computeDuration(step * height, velocity) : computeDuration((1 - clampedStep) * height, velocity);\n isOpen = shouldComplete;\n gesture.enable(false);\n\n if (contentEl) {\n resetContentScrollY(contentEl, initialScrollY);\n }\n\n animation.onFinish(() => {\n if (!shouldComplete) {\n gesture.enable(true);\n }\n }).progressEnd(shouldComplete ? 1 : 0, newStepValue, duration);\n /**\n * If the canDismiss value blocked the gesture\n * from proceeding, then we should ignore whatever\n * shouldComplete is. Whether or not the modal\n * animation should complete is now determined by\n * canDismiss.\n *\n * If the user swiped >25% of the way\n * to the max step, then we should\n * check canDismiss. 25% was chosen\n * to avoid accidental swipes.\n */\n\n if (isAttempingDismissWithCanDismiss && clampedStep > maxStep / 4) {\n handleCanDismiss(el, animation);\n } else if (shouldComplete) {\n onDismiss();\n }\n };\n\n const gesture = createGesture({\n el,\n gestureName: 'modalSwipeToClose',\n gesturePriority: 39,\n direction: 'y',\n threshold: 10,\n canStart,\n onStart,\n onMove,\n onEnd\n });\n return gesture;\n};\n\nconst computeDuration = (remaining, velocity) => {\n return clamp(400, remaining / Math.abs(velocity * 1.1), 500);\n};\n\nconst createSheetEnterAnimation = opts => {\n const {\n currentBreakpoint,\n backdropBreakpoint\n } = opts;\n /**\n * If the backdropBreakpoint is undefined, then the backdrop\n * should always fade in. If the backdropBreakpoint came before the\n * current breakpoint, then the backdrop should be fading in.\n */\n\n const shouldShowBackdrop = backdropBreakpoint === undefined || backdropBreakpoint < currentBreakpoint;\n const initialBackdrop = shouldShowBackdrop ? `calc(var(--backdrop-opacity) * ${currentBreakpoint})` : '0';\n const backdropAnimation = createAnimation('backdropAnimation').fromTo('opacity', 0, initialBackdrop);\n\n if (shouldShowBackdrop) {\n backdropAnimation.beforeStyles({\n 'pointer-events': 'none'\n }).afterClearStyles(['pointer-events']);\n }\n\n const wrapperAnimation = createAnimation('wrapperAnimation').keyframes([{\n offset: 0,\n opacity: 1,\n transform: 'translateY(100%)'\n }, {\n offset: 1,\n opacity: 1,\n transform: `translateY(${100 - currentBreakpoint * 100}%)`\n }]);\n return {\n wrapperAnimation,\n backdropAnimation\n };\n};\n\nconst createSheetLeaveAnimation = opts => {\n const {\n currentBreakpoint,\n backdropBreakpoint\n } = opts;\n /**\n * Backdrop does not always fade in from 0 to 1 if backdropBreakpoint\n * is defined, so we need to account for that offset by figuring out\n * what the current backdrop value should be.\n */\n\n const backdropValue = `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(currentBreakpoint, backdropBreakpoint)})`;\n const defaultBackdrop = [{\n offset: 0,\n opacity: backdropValue\n }, {\n offset: 1,\n opacity: 0\n }];\n const customBackdrop = [{\n offset: 0,\n opacity: backdropValue\n }, {\n offset: backdropBreakpoint,\n opacity: 0\n }, {\n offset: 1,\n opacity: 0\n }];\n const backdropAnimation = createAnimation('backdropAnimation').keyframes(backdropBreakpoint !== 0 ? customBackdrop : defaultBackdrop);\n const wrapperAnimation = createAnimation('wrapperAnimation').keyframes([{\n offset: 0,\n opacity: 1,\n transform: `translateY(${100 - currentBreakpoint * 100}%)`\n }, {\n offset: 1,\n opacity: 1,\n transform: `translateY(100%)`\n }]);\n return {\n wrapperAnimation,\n backdropAnimation\n };\n};\n\nconst createEnterAnimation$1 = () => {\n const backdropAnimation = createAnimation().fromTo('opacity', 0.01, 'var(--backdrop-opacity)').beforeStyles({\n 'pointer-events': 'none'\n }).afterClearStyles(['pointer-events']);\n const wrapperAnimation = createAnimation().fromTo('transform', 'translateY(100vh)', 'translateY(0vh)');\n return {\n backdropAnimation,\n wrapperAnimation\n };\n};\n/**\n * iOS Modal Enter Animation for the Card presentation style\n */\n\n\nconst iosEnterAnimation = (baseEl, opts) => {\n const {\n presentingEl,\n currentBreakpoint\n } = opts;\n const root = getElementRoot(baseEl);\n const {\n wrapperAnimation,\n backdropAnimation\n } = currentBreakpoint !== undefined ? createSheetEnterAnimation(opts) : createEnterAnimation$1();\n backdropAnimation.addElement(root.querySelector('ion-backdrop'));\n wrapperAnimation.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow')).beforeStyles({\n opacity: 1\n });\n const baseAnimation = createAnimation('entering-base').addElement(baseEl).easing('cubic-bezier(0.32,0.72,0,1)').duration(500).addAnimation(wrapperAnimation);\n\n if (presentingEl) {\n const isMobile = window.innerWidth < 768;\n const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;\n const presentingElRoot = getElementRoot(presentingEl);\n const presentingAnimation = createAnimation().beforeStyles({\n transform: 'translateY(0)',\n 'transform-origin': 'top center',\n overflow: 'hidden'\n });\n const bodyEl = document.body;\n\n if (isMobile) {\n /**\n * Fallback for browsers that does not support `max()` (ex: Firefox)\n * No need to worry about statusbar padding since engines like Gecko\n * are not used as the engine for standalone Cordova/Capacitor apps\n */\n const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';\n const modalTransform = hasCardModal ? '-10px' : transformOffset;\n const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;\n const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;\n presentingAnimation.afterStyles({\n transform: finalTransform\n }).beforeAddWrite(() => bodyEl.style.setProperty('background-color', 'black')).addElement(presentingEl).keyframes([{\n offset: 0,\n filter: 'contrast(1)',\n transform: 'translateY(0px) scale(1)',\n borderRadius: '0px'\n }, {\n offset: 1,\n filter: 'contrast(0.85)',\n transform: finalTransform,\n borderRadius: '10px 10px 0 0'\n }]);\n baseAnimation.addAnimation(presentingAnimation);\n } else {\n baseAnimation.addAnimation(backdropAnimation);\n\n if (!hasCardModal) {\n wrapperAnimation.fromTo('opacity', '0', '1');\n } else {\n const toPresentingScale = hasCardModal ? SwipeToCloseDefaults.MIN_PRESENTING_SCALE : 1;\n const finalTransform = `translateY(-10px) scale(${toPresentingScale})`;\n presentingAnimation.afterStyles({\n transform: finalTransform\n }).addElement(presentingElRoot.querySelector('.modal-wrapper')).keyframes([{\n offset: 0,\n filter: 'contrast(1)',\n transform: 'translateY(0) scale(1)'\n }, {\n offset: 1,\n filter: 'contrast(0.85)',\n transform: finalTransform\n }]);\n const shadowAnimation = createAnimation().afterStyles({\n transform: finalTransform\n }).addElement(presentingElRoot.querySelector('.modal-shadow')).keyframes([{\n offset: 0,\n opacity: '1',\n transform: 'translateY(0) scale(1)'\n }, {\n offset: 1,\n opacity: '0',\n transform: finalTransform\n }]);\n baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);\n }\n }\n } else {\n baseAnimation.addAnimation(backdropAnimation);\n }\n\n return baseAnimation;\n};\n\nconst createLeaveAnimation$1 = () => {\n const backdropAnimation = createAnimation().fromTo('opacity', 'var(--backdrop-opacity)', 0);\n const wrapperAnimation = createAnimation().fromTo('transform', 'translateY(0vh)', 'translateY(100vh)');\n return {\n backdropAnimation,\n wrapperAnimation\n };\n};\n/**\n * iOS Modal Leave Animation\n */\n\n\nconst iosLeaveAnimation = (baseEl, opts, duration = 500) => {\n const {\n presentingEl,\n currentBreakpoint\n } = opts;\n const root = getElementRoot(baseEl);\n const {\n wrapperAnimation,\n backdropAnimation\n } = currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation$1();\n backdropAnimation.addElement(root.querySelector('ion-backdrop'));\n wrapperAnimation.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow')).beforeStyles({\n opacity: 1\n });\n const baseAnimation = createAnimation('leaving-base').addElement(baseEl).easing('cubic-bezier(0.32,0.72,0,1)').duration(duration).addAnimation(wrapperAnimation);\n\n if (presentingEl) {\n const isMobile = window.innerWidth < 768;\n const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;\n const presentingElRoot = getElementRoot(presentingEl);\n const presentingAnimation = createAnimation().beforeClearStyles(['transform']).afterClearStyles(['transform']).onFinish(currentStep => {\n // only reset background color if this is the last card-style modal\n if (currentStep !== 1) {\n return;\n }\n\n presentingEl.style.setProperty('overflow', '');\n const numModals = Array.from(bodyEl.querySelectorAll('ion-modal')).filter(m => m.presentingElement !== undefined).length;\n\n if (numModals <= 1) {\n bodyEl.style.setProperty('background-color', '');\n }\n });\n const bodyEl = document.body;\n\n if (isMobile) {\n const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';\n const modalTransform = hasCardModal ? '-10px' : transformOffset;\n const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;\n const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;\n presentingAnimation.addElement(presentingEl).keyframes([{\n offset: 0,\n filter: 'contrast(0.85)',\n transform: finalTransform,\n borderRadius: '10px 10px 0 0'\n }, {\n offset: 1,\n filter: 'contrast(1)',\n transform: 'translateY(0px) scale(1)',\n borderRadius: '0px'\n }]);\n baseAnimation.addAnimation(presentingAnimation);\n } else {\n baseAnimation.addAnimation(backdropAnimation);\n\n if (!hasCardModal) {\n wrapperAnimation.fromTo('opacity', '1', '0');\n } else {\n const toPresentingScale = hasCardModal ? SwipeToCloseDefaults.MIN_PRESENTING_SCALE : 1;\n const finalTransform = `translateY(-10px) scale(${toPresentingScale})`;\n presentingAnimation.addElement(presentingElRoot.querySelector('.modal-wrapper')).afterStyles({\n transform: 'translate3d(0, 0, 0)'\n }).keyframes([{\n offset: 0,\n filter: 'contrast(0.85)',\n transform: finalTransform\n }, {\n offset: 1,\n filter: 'contrast(1)',\n transform: 'translateY(0) scale(1)'\n }]);\n const shadowAnimation = createAnimation().addElement(presentingElRoot.querySelector('.modal-shadow')).afterStyles({\n transform: 'translateY(0) scale(1)'\n }).keyframes([{\n offset: 0,\n opacity: '0',\n transform: finalTransform\n }, {\n offset: 1,\n opacity: '1',\n transform: 'translateY(0) scale(1)'\n }]);\n baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);\n }\n }\n } else {\n baseAnimation.addAnimation(backdropAnimation);\n }\n\n return baseAnimation;\n};\n\nconst createEnterAnimation = () => {\n const backdropAnimation = createAnimation().fromTo('opacity', 0.01, 'var(--backdrop-opacity)').beforeStyles({\n 'pointer-events': 'none'\n }).afterClearStyles(['pointer-events']);\n const wrapperAnimation = createAnimation().keyframes([{\n offset: 0,\n opacity: 0.01,\n transform: 'translateY(40px)'\n }, {\n offset: 1,\n opacity: 1,\n transform: `translateY(0px)`\n }]);\n return {\n backdropAnimation,\n wrapperAnimation\n };\n};\n/**\n * Md Modal Enter Animation\n */\n\n\nconst mdEnterAnimation = (baseEl, opts) => {\n const {\n currentBreakpoint\n } = opts;\n const root = getElementRoot(baseEl);\n const {\n wrapperAnimation,\n backdropAnimation\n } = currentBreakpoint !== undefined ? createSheetEnterAnimation(opts) : createEnterAnimation();\n backdropAnimation.addElement(root.querySelector('ion-backdrop'));\n wrapperAnimation.addElement(root.querySelector('.modal-wrapper'));\n return createAnimation().addElement(baseEl).easing('cubic-bezier(0.36,0.66,0.04,1)').duration(280).addAnimation([backdropAnimation, wrapperAnimation]);\n};\n\nconst createLeaveAnimation = () => {\n const backdropAnimation = createAnimation().fromTo('opacity', 'var(--backdrop-opacity)', 0);\n const wrapperAnimation = createAnimation().keyframes([{\n offset: 0,\n opacity: 0.99,\n transform: `translateY(0px)`\n }, {\n offset: 1,\n opacity: 0,\n transform: 'translateY(40px)'\n }]);\n return {\n backdropAnimation,\n wrapperAnimation\n };\n};\n/**\n * Md Modal Leave Animation\n */\n\n\nconst mdLeaveAnimation = (baseEl, opts) => {\n const {\n currentBreakpoint\n } = opts;\n const root = getElementRoot(baseEl);\n const {\n wrapperAnimation,\n backdropAnimation\n } = currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation();\n backdropAnimation.addElement(root.querySelector('ion-backdrop'));\n wrapperAnimation.addElement(root.querySelector('.modal-wrapper'));\n return createAnimation().easing('cubic-bezier(0.47,0,0.745,0.715)').duration(200).addAnimation([backdropAnimation, wrapperAnimation]);\n};\n\nconst createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], getCurrentBreakpoint, onDismiss, onBreakpointChange) => {\n // Defaults for the sheet swipe animation\n const defaultBackdrop = [{\n offset: 0,\n opacity: 'var(--backdrop-opacity)'\n }, {\n offset: 1,\n opacity: 0.01\n }];\n const customBackdrop = [{\n offset: 0,\n opacity: 'var(--backdrop-opacity)'\n }, {\n offset: 1 - backdropBreakpoint,\n opacity: 0\n }, {\n offset: 1,\n opacity: 0\n }];\n const SheetDefaults = {\n WRAPPER_KEYFRAMES: [{\n offset: 0,\n transform: 'translateY(0%)'\n }, {\n offset: 1,\n transform: 'translateY(100%)'\n }],\n BACKDROP_KEYFRAMES: backdropBreakpoint !== 0 ? customBackdrop : defaultBackdrop\n };\n const contentEl = baseEl.querySelector('ion-content');\n const height = wrapperEl.clientHeight;\n let currentBreakpoint = initialBreakpoint;\n let offset = 0;\n let canDismissBlocksGesture = false;\n const canDismissMaxStep = 0.95;\n const wrapperAnimation = animation.childAnimations.find(ani => ani.id === 'wrapperAnimation');\n const backdropAnimation = animation.childAnimations.find(ani => ani.id === 'backdropAnimation');\n const maxBreakpoint = breakpoints[breakpoints.length - 1];\n const minBreakpoint = breakpoints[0];\n\n const enableBackdrop = () => {\n baseEl.style.setProperty('pointer-events', 'auto');\n backdropEl.style.setProperty('pointer-events', 'auto');\n /**\n * When the backdrop is enabled, elements such\n * as inputs should not be focusable outside\n * the sheet.\n */\n\n baseEl.classList.remove('ion-disable-focus-trap');\n };\n\n const disableBackdrop = () => {\n baseEl.style.setProperty('pointer-events', 'none');\n backdropEl.style.setProperty('pointer-events', 'none');\n /**\n * When the backdrop is enabled, elements such\n * as inputs should not be focusable outside\n * the sheet.\n * Adding this class disables focus trapping\n * for the sheet temporarily.\n */\n\n baseEl.classList.add('ion-disable-focus-trap');\n };\n /**\n * After the entering animation completes,\n * we need to set the animation to go from\n * offset 0 to offset 1 so that users can\n * swipe in any direction. We then set the\n * animation offset to the current breakpoint\n * so there is no flickering.\n */\n\n\n if (wrapperAnimation && backdropAnimation) {\n wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);\n backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);\n animation.progressStart(true, 1 - currentBreakpoint);\n /**\n * If backdrop is not enabled, then content\n * behind modal should be clickable. To do this, we need\n * to remove pointer-events from ion-modal as a whole.\n * ion-backdrop and .modal-wrapper always have pointer-events: auto\n * applied, so the modal content can still be interacted with.\n */\n\n const shouldEnableBackdrop = currentBreakpoint > backdropBreakpoint;\n\n if (shouldEnableBackdrop) {\n enableBackdrop();\n } else {\n disableBackdrop();\n }\n }\n\n if (contentEl && currentBreakpoint !== maxBreakpoint) {\n contentEl.scrollY = false;\n }\n\n const canStart = detail => {\n /**\n * If the sheet is fully expanded and\n * the user is swiping on the content,\n * the gesture should not start to\n * allow for scrolling on the content.\n */\n const content = detail.event.target.closest('ion-content');\n currentBreakpoint = getCurrentBreakpoint();\n\n if (currentBreakpoint === 1 && content) {\n return false;\n }\n\n return true;\n };\n\n const onStart = () => {\n /**\n * If canDismiss is anything other than `true`\n * then users should be able to swipe down\n * until a threshold is hit. At that point,\n * the card modal should not proceed any further.\n *\n * canDismiss is never fired via gesture if there is\n * no 0 breakpoint. However, it can be fired if the user\n * presses Esc or the hardware back button.\n * TODO (FW-937)\n * Remove undefined check\n */\n canDismissBlocksGesture = baseEl.canDismiss !== undefined && baseEl.canDismiss !== true && minBreakpoint === 0;\n /**\n * If swiping on the content\n * we should disable scrolling otherwise\n * the sheet will expand and the content will scroll.\n */\n\n if (contentEl) {\n contentEl.scrollY = false;\n }\n\n raf(() => {\n /**\n * Dismisses the open keyboard when the sheet drag gesture is started.\n * Sets the focus onto the modal element.\n */\n baseEl.focus();\n });\n animation.progressStart(true, 1 - currentBreakpoint);\n };\n\n const onMove = detail => {\n /**\n * Given the change in gesture position on the Y axis,\n * compute where the offset of the animation should be\n * relative to where the user dragged.\n */\n const initialStep = 1 - currentBreakpoint;\n const secondToLastBreakpoint = breakpoints.length > 1 ? 1 - breakpoints[1] : undefined;\n const step = initialStep + detail.deltaY / height;\n const isAttemptingDismissWithCanDismiss = secondToLastBreakpoint !== undefined && step >= secondToLastBreakpoint && canDismissBlocksGesture;\n /**\n * If we are blocking the gesture from dismissing,\n * set the max step value so that the sheet cannot be\n * completely hidden.\n */\n\n const maxStep = isAttemptingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;\n /**\n * If we are blocking the gesture from\n * dismissing, calculate the spring modifier value\n * this will be added to the starting breakpoint\n * value to give the gesture a spring-like feeling.\n * Note that when isAttemptingDismissWithCanDismiss is true,\n * the modifier is always added to the breakpoint that\n * appears right after the 0 breakpoint.\n *\n * Note that this modifier is essentially the progression\n * between secondToLastBreakpoint and maxStep which is\n * why we subtract secondToLastBreakpoint. This lets us get\n * the result as a value from 0 to 1.\n */\n\n const processedStep = isAttemptingDismissWithCanDismiss && secondToLastBreakpoint !== undefined ? secondToLastBreakpoint + calculateSpringStep((step - secondToLastBreakpoint) / (maxStep - secondToLastBreakpoint)) : step;\n offset = clamp(0.0001, processedStep, maxStep);\n animation.progressStep(offset);\n };\n\n const onEnd = detail => {\n /**\n * When the gesture releases, we need to determine\n * the closest breakpoint to snap to.\n */\n const velocity = detail.velocityY;\n const threshold = (detail.deltaY + velocity * 100) / height;\n const diff = currentBreakpoint - threshold;\n const closest = breakpoints.reduce((a, b) => {\n return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;\n });\n moveSheetToBreakpoint({\n breakpoint: closest,\n breakpointOffset: offset,\n canDismiss: canDismissBlocksGesture\n });\n };\n\n const moveSheetToBreakpoint = options => {\n const {\n breakpoint,\n canDismiss,\n breakpointOffset\n } = options;\n /**\n * canDismiss should only prevent snapping\n * when users are trying to dismiss. If canDismiss\n * is present but the user is trying to swipe upwards,\n * we should allow that to happen,\n */\n\n const shouldPreventDismiss = canDismiss && breakpoint === 0;\n const snapToBreakpoint = shouldPreventDismiss ? currentBreakpoint : breakpoint;\n const shouldRemainOpen = snapToBreakpoint !== 0;\n currentBreakpoint = 0;\n /**\n * Update the animation so that it plays from\n * the last offset to the closest snap point.\n */\n\n if (wrapperAnimation && backdropAnimation) {\n wrapperAnimation.keyframes([{\n offset: 0,\n transform: `translateY(${breakpointOffset * 100}%)`\n }, {\n offset: 1,\n transform: `translateY(${(1 - snapToBreakpoint) * 100}%)`\n }]);\n backdropAnimation.keyframes([{\n offset: 0,\n opacity: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(1 - breakpointOffset, backdropBreakpoint)})`\n }, {\n offset: 1,\n opacity: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(snapToBreakpoint, backdropBreakpoint)})`\n }]);\n animation.progressStep(0);\n }\n /**\n * Gesture should remain disabled until the\n * snapping animation completes.\n */\n\n\n gesture.enable(false);\n\n if (shouldPreventDismiss) {\n handleCanDismiss(baseEl, animation);\n } else if (!shouldRemainOpen) {\n onDismiss();\n }\n\n return new Promise(resolve => {\n animation.onFinish(() => {\n if (shouldRemainOpen) {\n /**\n * Once the snapping animation completes,\n * we need to reset the animation to go\n * from 0 to 1 so users can swipe in any direction.\n * We then set the animation offset to the current\n * breakpoint so that it starts at the snapped position.\n */\n if (wrapperAnimation && backdropAnimation) {\n raf(() => {\n wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);\n backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);\n animation.progressStart(true, 1 - snapToBreakpoint);\n currentBreakpoint = snapToBreakpoint;\n onBreakpointChange(currentBreakpoint);\n /**\n * If the sheet is fully expanded, we can safely\n * enable scrolling again.\n */\n\n if (contentEl && currentBreakpoint === breakpoints[breakpoints.length - 1]) {\n contentEl.scrollY = true;\n }\n /**\n * Backdrop should become enabled\n * after the backdropBreakpoint value\n */\n\n\n const shouldEnableBackdrop = currentBreakpoint > backdropBreakpoint;\n\n if (shouldEnableBackdrop) {\n enableBackdrop();\n } else {\n disableBackdrop();\n }\n\n gesture.enable(true);\n resolve();\n });\n } else {\n gesture.enable(true);\n resolve();\n }\n } else {\n resolve();\n }\n /**\n * This must be a one time callback\n * otherwise a new callback will\n * be added every time onEnd runs.\n */\n\n }, {\n oneTimeCallback: true\n }).progressEnd(1, 0, 500);\n });\n };\n\n const gesture = createGesture({\n el: wrapperEl,\n gestureName: 'modalSheet',\n gesturePriority: 40,\n direction: 'y',\n threshold: 10,\n canStart,\n onStart,\n onMove,\n onEnd\n });\n return {\n gesture,\n moveSheetToBreakpoint\n };\n};\n\nconst modalIosCss = \":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.modal-handle::before{padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\\\"\\\"}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.modal-handle::before{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: 1px){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: 1px){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-card) .modal-wrapper,:host-context([dir=rtl]).modal-card .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-sheet) .modal-wrapper,:host-context([dir=rtl]).modal-sheet .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}\";\nconst modalMdCss = \":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.modal-handle::before{padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\\\"\\\"}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.modal-handle::before{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}\";\nconst Modal = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.didPresent = createEvent(this, \"ionModalDidPresent\", 7);\n this.willPresent = createEvent(this, \"ionModalWillPresent\", 7);\n this.willDismiss = createEvent(this, \"ionModalWillDismiss\", 7);\n this.didDismiss = createEvent(this, \"ionModalDidDismiss\", 7);\n this.ionBreakpointDidChange = createEvent(this, \"ionBreakpointDidChange\", 7);\n this.didPresentShorthand = createEvent(this, \"didPresent\", 7);\n this.willPresentShorthand = createEvent(this, \"willPresent\", 7);\n this.willDismissShorthand = createEvent(this, \"willDismiss\", 7);\n this.didDismissShorthand = createEvent(this, \"didDismiss\", 7);\n this.modalIndex = modalIds++;\n this.coreDelegate = CoreDelegate();\n this.isSheetModal = false;\n this.inheritedAttributes = {};\n this.inline = false; // Whether or not modal is being dismissed via gesture\n\n this.gestureAnimationDismissing = false;\n this.presented = false;\n /** @internal */\n\n this.hasController = false;\n /**\n * If `true`, the keyboard will be automatically dismissed when the overlay is presented.\n */\n\n this.keyboardClose = true;\n /**\n * A decimal value between 0 and 1 that indicates the\n * point after which the backdrop will begin to fade in\n * when using a sheet modal. Prior to this point, the\n * backdrop will be hidden and the content underneath\n * the sheet can be interacted with. This value is exclusive\n * meaning the backdrop will become active after the value\n * specified.\n */\n\n this.backdropBreakpoint = 0;\n /**\n * The interaction behavior for the sheet modal when the handle is pressed.\n *\n * Defaults to `\"none\"`, which means the modal will not change size or position when the handle is pressed.\n * Set to `\"cycle\"` to let the modal cycle between available breakpoints when pressed.\n *\n * Handle behavior is unavailable when the `handle` property is set to `false` or\n * when the `breakpoints` property is not set (using a fullscreen or card modal).\n */\n\n this.handleBehavior = 'none';\n /**\n * If `true`, the modal will be dismissed when the backdrop is clicked.\n */\n\n this.backdropDismiss = true;\n /**\n * If `true`, a backdrop will be displayed behind the modal.\n * This property controls whether or not the backdrop\n * darkens the screen when the modal is presented.\n * It does not control whether or not the backdrop\n * is active or present in the DOM.\n */\n\n this.showBackdrop = true;\n /**\n * If `true`, the modal will animate.\n */\n\n this.animated = true;\n /**\n * If `true`, the modal can be swiped to dismiss. Only applies in iOS mode.\n * @deprecated - To prevent modals from dismissing, use canDismiss instead.\n */\n\n this.swipeToClose = false;\n /**\n * If `true`, the modal will open. If `false`, the modal will close.\n * Use this if you need finer grained control over presentation, otherwise\n * just use the modalController or the `trigger` property.\n * Note: `isOpen` will not automatically be set back to `false` when\n * the modal dismisses. You will need to do that in your code.\n */\n\n this.isOpen = false;\n /**\n * If `true`, the component passed into `ion-modal` will\n * automatically be mounted when the modal is created. The\n * component will remain mounted even when the modal is dismissed.\n * However, the component will be destroyed when the modal is\n * destroyed. This property is not reactive and should only be\n * used when initially creating a modal.\n *\n * Note: This feature only applies to inline modals in JavaScript\n * frameworks such as Angular, React, and Vue.\n */\n\n this.keepContentsMounted = false;\n\n this.configureTriggerInteraction = () => {\n const {\n trigger,\n el,\n destroyTriggerInteraction\n } = this;\n\n if (destroyTriggerInteraction) {\n destroyTriggerInteraction();\n }\n\n const triggerEl = trigger !== undefined ? document.getElementById(trigger) : null;\n\n if (!triggerEl) {\n return;\n }\n\n const configureTriggerInteraction = (trigEl, modalEl) => {\n const openModal = () => {\n modalEl.present();\n };\n\n trigEl.addEventListener('click', openModal);\n return () => {\n trigEl.removeEventListener('click', openModal);\n };\n };\n\n this.destroyTriggerInteraction = configureTriggerInteraction(triggerEl, el);\n };\n\n this.onHandleClick = () => {\n const {\n sheetTransition,\n handleBehavior\n } = this;\n\n if (handleBehavior !== 'cycle' || sheetTransition !== undefined) {\n /**\n * The sheet modal should not advance to the next breakpoint\n * if the handle behavior is not `cycle` or if the handle\n * is clicked while the sheet is moving to a breakpoint.\n */\n return;\n }\n\n this.moveToNextBreakpoint();\n };\n\n this.onBackdropTap = () => {\n const {\n sheetTransition\n } = this;\n\n if (sheetTransition !== undefined) {\n /**\n * When the handle is double clicked at the largest breakpoint,\n * it will start to move to the first breakpoint. While transitioning,\n * the backdrop will often receive the second click. We prevent the\n * backdrop from dismissing the modal while moving between breakpoints.\n */\n return;\n }\n\n this.dismiss(undefined, BACKDROP);\n };\n\n this.onLifecycle = modalEvent => {\n const el = this.usersElement;\n const name = LIFECYCLE_MAP[modalEvent.type];\n\n if (el && name) {\n const ev = new CustomEvent(name, {\n bubbles: false,\n cancelable: false,\n detail: modalEvent.detail\n });\n el.dispatchEvent(ev);\n }\n };\n }\n\n onIsOpenChange(newValue, oldValue) {\n if (newValue === true && oldValue === false) {\n this.present();\n } else if (newValue === false && oldValue === true) {\n this.dismiss();\n }\n }\n\n onTriggerChange() {\n this.configureTriggerInteraction();\n }\n\n swipeToCloseChanged(enable) {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n if (_this.gesture) {\n _this.gesture.enable(enable);\n } else if (enable) {\n yield _this.initSwipeToClose();\n }\n })();\n }\n\n breakpointsChanged(breakpoints) {\n if (breakpoints !== undefined) {\n this.sortedBreakpoints = breakpoints.sort((a, b) => a - b);\n }\n }\n\n connectedCallback() {\n prepareOverlay(this.el);\n }\n\n componentWillLoad() {\n const {\n breakpoints,\n initialBreakpoint,\n swipeToClose,\n el\n } = this;\n this.inheritedAttributes = inheritAttributes(el, ['role']);\n /**\n * If user has custom ID set then we should\n * not assign the default incrementing ID.\n */\n\n this.modalId = this.el.hasAttribute('id') ? this.el.getAttribute('id') : `ion-modal-${this.modalIndex}`;\n const isSheetModal = this.isSheetModal = breakpoints !== undefined && initialBreakpoint !== undefined;\n\n if (isSheetModal) {\n this.currentBreakpoint = this.initialBreakpoint;\n }\n\n if (breakpoints !== undefined && initialBreakpoint !== undefined && !breakpoints.includes(initialBreakpoint)) {\n printIonWarning('Your breakpoints array must include the initialBreakpoint value.');\n }\n\n if (swipeToClose) {\n printIonWarning('swipeToClose has been deprecated in favor of canDismiss.\\n\\nIf you want a card modal to be swipeable, set canDismiss to `true`. In the next major release of Ionic, swipeToClose will be removed, and all card modals will be swipeable by default.');\n }\n }\n\n componentDidLoad() {\n /**\n * If modal was rendered with isOpen=\"true\"\n * then we should open modal immediately.\n */\n if (this.isOpen === true) {\n raf(() => this.present());\n }\n\n this.breakpointsChanged(this.breakpoints);\n this.configureTriggerInteraction();\n }\n /**\n * Determines whether or not an overlay\n * is being used inline or via a controller/JS\n * and returns the correct delegate.\n * By default, subsequent calls to getDelegate\n * will use a cached version of the delegate.\n * This is useful for calling dismiss after\n * present so that the correct delegate is given.\n */\n\n\n getDelegate(force = false) {\n if (this.workingDelegate && !force) {\n return {\n delegate: this.workingDelegate,\n inline: this.inline\n };\n }\n /**\n * If using overlay inline\n * we potentially need to use the coreDelegate\n * so that this works in vanilla JS apps.\n * If a developer has presented this component\n * via a controller, then we can assume\n * the component is already in the\n * correct place.\n */\n\n\n const parentEl = this.el.parentNode;\n const inline = this.inline = parentEl !== null && !this.hasController;\n const delegate = this.workingDelegate = inline ? this.delegate || this.coreDelegate : this.delegate;\n return {\n inline,\n delegate\n };\n }\n /**\n * Determines whether or not the\n * modal is allowed to dismiss based\n * on the state of the canDismiss prop.\n */\n\n\n checkCanDismiss() {\n var _this2 = this;\n\n return _asyncToGenerator(function* () {\n const {\n canDismiss\n } = _this2;\n /**\n * TODO (FW-937) - Remove the following check in\n * the next major release of Ionic.\n */\n\n if (canDismiss === undefined) {\n return true;\n }\n\n if (typeof canDismiss === 'function') {\n return canDismiss();\n }\n\n return canDismiss;\n })();\n }\n /**\n * Present the modal overlay after it has been created.\n */\n\n\n present() {\n var _this3 = this;\n\n return _asyncToGenerator(function* () {\n if (_this3.presented) {\n return;\n }\n /**\n * When using an inline modal\n * and dismissing a modal it is possible to\n * quickly present the modal while it is\n * dismissing. We need to await any current\n * transition to allow the dismiss to finish\n * before presenting again.\n */\n\n\n if (_this3.currentTransition !== undefined) {\n yield _this3.currentTransition;\n }\n /**\n * If the modal is presented multiple times (inline modals), we\n * need to reset the current breakpoint to the initial breakpoint.\n */\n\n\n _this3.currentBreakpoint = _this3.initialBreakpoint;\n const data = Object.assign(Object.assign({}, _this3.componentProps), {\n modal: _this3.el\n });\n\n const {\n inline,\n delegate\n } = _this3.getDelegate(true);\n\n _this3.usersElement = yield attachComponent(delegate, _this3.el, _this3.component, ['ion-page'], data, inline);\n yield deepReady(_this3.usersElement);\n writeTask(() => _this3.el.classList.add('show-modal'));\n _this3.currentTransition = present(_this3, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {\n presentingEl: _this3.presentingElement,\n currentBreakpoint: _this3.initialBreakpoint,\n backdropBreakpoint: _this3.backdropBreakpoint\n });\n /**\n * TODO (FW-937) - In the next major release of Ionic, all card modals\n * will be swipeable by default. canDismiss will be used to determine if the\n * modal can be dismissed. This check should change to check the presence of\n * presentingElement instead.\n *\n * If we did not do this check, then not using swipeToClose would mean you could\n * not run canDismiss on swipe as there would be no swipe gesture created.\n */\n\n const hasCardModal = _this3.swipeToClose || _this3.canDismiss !== undefined && _this3.presentingElement !== undefined;\n /**\n * We need to change the status bar at the\n * start of the animation so that it completes\n * by the time the card animation is done.\n */\n\n if (hasCardModal && getIonMode(_this3) === 'ios') {\n setCardStatusBarDark();\n }\n\n yield _this3.currentTransition;\n\n if (_this3.isSheetModal) {\n _this3.initSheetGesture();\n } else if (hasCardModal) {\n yield _this3.initSwipeToClose();\n }\n /* tslint:disable-next-line */\n\n\n if (typeof window !== 'undefined') {\n _this3.keyboardOpenCallback = () => {\n if (_this3.gesture) {\n /**\n * When the native keyboard is opened and the webview\n * is resized, the gesture implementation will become unresponsive\n * and enter a free-scroll mode.\n *\n * When the keyboard is opened, we disable the gesture for\n * a single frame and re-enable once the contents have repositioned\n * from the keyboard placement.\n */\n _this3.gesture.enable(false);\n\n raf(() => {\n if (_this3.gesture) {\n _this3.gesture.enable(true);\n }\n });\n }\n };\n\n window.addEventListener(KEYBOARD_DID_OPEN, _this3.keyboardOpenCallback);\n }\n\n _this3.currentTransition = undefined;\n })();\n }\n\n initSwipeToClose() {\n var _this4 = this;\n\n if (getIonMode(this) !== 'ios') {\n return;\n }\n\n const {\n el\n } = this; // All of the elements needed for the swipe gesture\n // should be in the DOM and referenced by now, except\n // for the presenting el\n\n const animationBuilder = this.leaveAnimation || config.get('modalLeave', iosLeaveAnimation);\n const ani = this.animation = animationBuilder(el, {\n presentingEl: this.presentingElement\n });\n const contentEl = findIonContent(el);\n\n if (!contentEl) {\n printIonContentErrorMsg(el);\n return;\n }\n\n this.gesture = createSwipeToCloseGesture(el, ani, () => {\n /**\n * While the gesture animation is finishing\n * it is possible for a user to tap the backdrop.\n * This would result in the dismiss animation\n * being played again. Typically this is avoided\n * by setting `presented = false` on the overlay\n * component; however, we cannot do that here as\n * that would prevent the element from being\n * removed from the DOM.\n */\n this.gestureAnimationDismissing = true;\n this.animation.onFinish( /*#__PURE__*/_asyncToGenerator(function* () {\n yield _this4.dismiss(undefined, 'gesture');\n _this4.gestureAnimationDismissing = false;\n }));\n });\n this.gesture.enable(true);\n }\n\n initSheetGesture() {\n const {\n wrapperEl,\n initialBreakpoint,\n backdropBreakpoint\n } = this;\n\n if (!wrapperEl || initialBreakpoint === undefined) {\n return;\n }\n\n const animationBuilder = this.enterAnimation || config.get('modalEnter', iosEnterAnimation);\n const ani = this.animation = animationBuilder(this.el, {\n presentingEl: this.presentingElement,\n currentBreakpoint: initialBreakpoint,\n backdropBreakpoint\n });\n ani.progressStart(true, 1);\n const {\n gesture,\n moveSheetToBreakpoint\n } = createSheetGesture(this.el, this.backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, ani, this.sortedBreakpoints, () => {\n var _a;\n\n return (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : 0;\n }, () => this.sheetOnDismiss(), breakpoint => {\n if (this.currentBreakpoint !== breakpoint) {\n this.currentBreakpoint = breakpoint;\n this.ionBreakpointDidChange.emit({\n breakpoint\n });\n }\n });\n this.gesture = gesture;\n this.moveSheetToBreakpoint = moveSheetToBreakpoint;\n this.gesture.enable(true);\n }\n\n sheetOnDismiss() {\n var _this5 = this;\n\n /**\n * While the gesture animation is finishing\n * it is possible for a user to tap the backdrop.\n * This would result in the dismiss animation\n * being played again. Typically this is avoided\n * by setting `presented = false` on the overlay\n * component; however, we cannot do that here as\n * that would prevent the element from being\n * removed from the DOM.\n */\n this.gestureAnimationDismissing = true;\n this.animation.onFinish( /*#__PURE__*/_asyncToGenerator(function* () {\n _this5.currentBreakpoint = 0;\n\n _this5.ionBreakpointDidChange.emit({\n breakpoint: _this5.currentBreakpoint\n });\n\n yield _this5.dismiss(undefined, 'gesture');\n _this5.gestureAnimationDismissing = false;\n }));\n }\n /**\n * Dismiss the modal overlay after it has been presented.\n *\n * @param data Any data to emit in the dismiss events.\n * @param role The role of the element that is dismissing the modal. For example, 'cancel' or 'backdrop'.\n */\n\n\n dismiss(data, role) {\n var _this6 = this;\n\n return _asyncToGenerator(function* () {\n if (_this6.gestureAnimationDismissing && role !== 'gesture') {\n return false;\n }\n /**\n * If a canDismiss handler is responsible\n * for calling the dismiss method, we should\n * not run the canDismiss check again.\n */\n\n\n if (role !== 'handler' && !(yield _this6.checkCanDismiss())) {\n return false;\n }\n /**\n * We need to start the status bar change\n * before the animation so that the change\n * finishes when the dismiss animation does.\n * TODO (FW-937)\n */\n\n\n const hasCardModal = _this6.swipeToClose || _this6.canDismiss !== undefined && _this6.presentingElement !== undefined;\n\n if (hasCardModal && getIonMode(_this6) === 'ios') {\n setCardStatusBarDefault();\n }\n /* tslint:disable-next-line */\n\n\n if (typeof window !== 'undefined' && _this6.keyboardOpenCallback) {\n window.removeEventListener(KEYBOARD_DID_OPEN, _this6.keyboardOpenCallback);\n }\n /**\n * When using an inline modal\n * and presenting a modal it is possible to\n * quickly dismiss the modal while it is\n * presenting. We need to await any current\n * transition to allow the present to finish\n * before dismissing again.\n */\n\n\n if (_this6.currentTransition !== undefined) {\n yield _this6.currentTransition;\n }\n\n const enteringAnimation = activeAnimations.get(_this6) || [];\n _this6.currentTransition = dismiss(_this6, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {\n presentingEl: _this6.presentingElement,\n currentBreakpoint: _this6.currentBreakpoint || _this6.initialBreakpoint,\n backdropBreakpoint: _this6.backdropBreakpoint\n });\n const dismissed = yield _this6.currentTransition;\n\n if (dismissed) {\n const {\n delegate\n } = _this6.getDelegate();\n\n yield detachComponent(delegate, _this6.usersElement);\n writeTask(() => _this6.el.classList.remove('show-modal'));\n\n if (_this6.animation) {\n _this6.animation.destroy();\n }\n\n if (_this6.gesture) {\n _this6.gesture.destroy();\n }\n\n enteringAnimation.forEach(ani => ani.destroy());\n }\n\n _this6.currentBreakpoint = undefined;\n _this6.currentTransition = undefined;\n _this6.animation = undefined;\n return dismissed;\n })();\n }\n /**\n * Returns a promise that resolves when the modal did dismiss.\n */\n\n\n onDidDismiss() {\n return eventMethod(this.el, 'ionModalDidDismiss');\n }\n /**\n * Returns a promise that resolves when the modal will dismiss.\n */\n\n\n onWillDismiss() {\n return eventMethod(this.el, 'ionModalWillDismiss');\n }\n /**\n * Move a sheet style modal to a specific breakpoint. The breakpoint value must\n * be a value defined in your `breakpoints` array.\n */\n\n\n setCurrentBreakpoint(breakpoint) {\n var _this7 = this;\n\n return _asyncToGenerator(function* () {\n if (!_this7.isSheetModal) {\n printIonWarning('setCurrentBreakpoint is only supported on sheet modals.');\n return;\n }\n\n if (!_this7.breakpoints.includes(breakpoint)) {\n printIonWarning(`Attempted to set invalid breakpoint value ${breakpoint}. Please double check that the breakpoint value is part of your defined breakpoints.`);\n return;\n }\n\n const {\n currentBreakpoint,\n moveSheetToBreakpoint,\n canDismiss,\n breakpoints\n } = _this7;\n\n if (currentBreakpoint === breakpoint) {\n return;\n }\n\n if (moveSheetToBreakpoint) {\n _this7.sheetTransition = moveSheetToBreakpoint({\n breakpoint,\n breakpointOffset: 1 - currentBreakpoint,\n canDismiss: canDismiss !== undefined && canDismiss !== true && breakpoints[0] === 0\n });\n yield _this7.sheetTransition;\n _this7.sheetTransition = undefined;\n }\n })();\n }\n /**\n * Returns the current breakpoint of a sheet style modal\n */\n\n\n getCurrentBreakpoint() {\n var _this8 = this;\n\n return _asyncToGenerator(function* () {\n return _this8.currentBreakpoint;\n })();\n }\n\n moveToNextBreakpoint() {\n var _this9 = this;\n\n return _asyncToGenerator(function* () {\n const {\n breakpoints,\n currentBreakpoint\n } = _this9;\n\n if (!breakpoints || currentBreakpoint == null) {\n /**\n * If the modal does not have breakpoints and/or the current\n * breakpoint is not set, we can't move to the next breakpoint.\n */\n return false;\n }\n\n const allowedBreakpoints = breakpoints.filter(b => b !== 0);\n const currentBreakpointIndex = allowedBreakpoints.indexOf(currentBreakpoint);\n const nextBreakpointIndex = (currentBreakpointIndex + 1) % allowedBreakpoints.length;\n const nextBreakpoint = allowedBreakpoints[nextBreakpointIndex];\n /**\n * Sets the current breakpoint to the next available breakpoint.\n * If the current breakpoint is the last breakpoint, we set the current\n * breakpoint to the first non-zero breakpoint to avoid dismissing the sheet.\n */\n\n yield _this9.setCurrentBreakpoint(nextBreakpoint);\n return true;\n })();\n }\n\n render() {\n const {\n handle,\n isSheetModal,\n presentingElement,\n htmlAttributes,\n handleBehavior,\n inheritedAttributes\n } = this;\n const showHandle = handle !== false && isSheetModal;\n const mode = getIonMode(this);\n const {\n modalId\n } = this;\n const isCardModal = presentingElement !== undefined && mode === 'ios';\n const isHandleCycle = handleBehavior === 'cycle';\n return h(Host, Object.assign({\n \"no-router\": true,\n \"aria-modal\": \"true\",\n role: \"dialog\",\n tabindex: \"-1\"\n }, htmlAttributes, inheritedAttributes, {\n style: {\n zIndex: `${20000 + this.overlayIndex}`\n },\n class: Object.assign({\n [mode]: true,\n ['modal-default']: !isCardModal && !isSheetModal,\n [`modal-card`]: isCardModal,\n [`modal-sheet`]: isSheetModal,\n 'overlay-hidden': true\n }, getClassMap(this.cssClass)),\n id: modalId,\n onIonBackdropTap: this.onBackdropTap,\n onIonModalDidPresent: this.onLifecycle,\n onIonModalWillPresent: this.onLifecycle,\n onIonModalWillDismiss: this.onLifecycle,\n onIonModalDidDismiss: this.onLifecycle\n }), h(\"ion-backdrop\", {\n ref: el => this.backdropEl = el,\n visible: this.showBackdrop,\n tappable: this.backdropDismiss,\n part: \"backdrop\"\n }), mode === 'ios' && h(\"div\", {\n class: \"modal-shadow\"\n }), h(\"div\", {\n class: \"modal-wrapper ion-overlay-wrapper\",\n part: \"content\",\n ref: el => this.wrapperEl = el\n }, showHandle && h(\"button\", {\n class: \"modal-handle\",\n // Prevents the handle from receiving keyboard focus when it does not cycle\n tabIndex: !isHandleCycle ? -1 : 0,\n \"aria-label\": \"Activate to adjust the size of the dialog overlaying the screen\",\n onClick: isHandleCycle ? this.onHandleClick : undefined,\n part: \"handle\"\n }), h(\"slot\", null)));\n }\n\n get el() {\n return getElement(this);\n }\n\n static get watchers() {\n return {\n \"isOpen\": [\"onIsOpenChange\"],\n \"trigger\": [\"onTriggerChange\"],\n \"swipeToClose\": [\"swipeToCloseChanged\"]\n };\n }\n\n};\nconst LIFECYCLE_MAP = {\n ionModalDidPresent: 'ionViewDidEnter',\n ionModalWillPresent: 'ionViewWillEnter',\n ionModalWillDismiss: 'ionViewWillLeave',\n ionModalDidDismiss: 'ionViewDidLeave'\n};\nlet modalIds = 0;\nModal.style = {\n ios: modalIosCss,\n md: modalMdCss\n};\nexport { Modal as ion_modal };","map":{"version":3,"names":["r","registerInstance","e","createEvent","c","writeTask","h","H","Host","i","getElement","b","getIonMode","config","f","findClosestIonContent","isIonContent","d","disableContentScrollY","resetContentScrollY","a","findIonContent","p","printIonContentErrorMsg","C","CoreDelegate","attachComponent","detachComponent","g","getElementRoot","l","clamp","raf","j","inheritAttributes","KEYBOARD_DID_OPEN","printIonWarning","B","BACKDROP","prepareOverlay","present","activeAnimations","dismiss","eventMethod","getClassMap","deepReady","createAnimation","getTimeGivenProgression","createGesture","w","win","Style","StatusBar","getEngine","_a","_b","_c","Capacitor","isPluginAvailable","Plugins","supportsDefaultStatusBarStyle","PluginHeaders","setStyle","options","engine","getBackdropValueForSheet","x","backdropBreakpoint","slope","setCardStatusBarDark","innerWidth","style","Dark","setCardStatusBarDefault","Default","handleCanDismiss","el","animation","canDismiss","shouldDismiss","isRunning","onFinish","undefined","oneTimeCallback","calculateSpringStep","t","SwipeToCloseDefaults","MIN_PRESENTING_SCALE","createSwipeToCloseGesture","onDismiss","DISMISS_THRESHOLD","height","offsetHeight","isOpen","canDismissBlocksGesture","contentEl","scrollEl","canDismissMaxStep","initialScrollY","lastStep","getScrollY","scrollY","canStart","detail","target","event","closest","root","querySelector","hasRefresherInContent","scrollTop","footer","onStart","deltaY","progressStart","onMove","step","isAttempingDismissWithCanDismiss","maxStep","processedStep","clampedStep","progressStep","onEnd","velocity","velocityY","threshold","shouldComplete","newStepValue","easing","duration","computeDuration","gesture","enable","progressEnd","gestureName","gesturePriority","direction","remaining","Math","abs","createSheetEnterAnimation","opts","currentBreakpoint","shouldShowBackdrop","initialBackdrop","backdropAnimation","fromTo","beforeStyles","afterClearStyles","wrapperAnimation","keyframes","offset","opacity","transform","createSheetLeaveAnimation","backdropValue","defaultBackdrop","customBackdrop","createEnterAnimation$1","iosEnterAnimation","baseEl","presentingEl","addElement","querySelectorAll","baseAnimation","addAnimation","isMobile","window","hasCardModal","tagName","presentingElement","presentingElRoot","presentingAnimation","overflow","bodyEl","document","body","transformOffset","CSS","supports","modalTransform","toPresentingScale","finalTransform","afterStyles","beforeAddWrite","setProperty","filter","borderRadius","shadowAnimation","createLeaveAnimation$1","iosLeaveAnimation","beforeClearStyles","currentStep","numModals","Array","from","m","length","createEnterAnimation","mdEnterAnimation","createLeaveAnimation","mdLeaveAnimation","createSheetGesture","backdropEl","wrapperEl","initialBreakpoint","breakpoints","getCurrentBreakpoint","onBreakpointChange","SheetDefaults","WRAPPER_KEYFRAMES","BACKDROP_KEYFRAMES","clientHeight","childAnimations","find","ani","id","maxBreakpoint","minBreakpoint","enableBackdrop","classList","remove","disableBackdrop","add","shouldEnableBackdrop","content","focus","initialStep","secondToLastBreakpoint","isAttemptingDismissWithCanDismiss","diff","reduce","moveSheetToBreakpoint","breakpoint","breakpointOffset","shouldPreventDismiss","snapToBreakpoint","shouldRemainOpen","Promise","resolve","modalIosCss","modalMdCss","Modal","constructor","hostRef","didPresent","willPresent","willDismiss","didDismiss","ionBreakpointDidChange","didPresentShorthand","willPresentShorthand","willDismissShorthand","didDismissShorthand","modalIndex","modalIds","coreDelegate","isSheetModal","inheritedAttributes","inline","gestureAnimationDismissing","presented","hasController","keyboardClose","handleBehavior","backdropDismiss","showBackdrop","animated","swipeToClose","keepContentsMounted","configureTriggerInteraction","trigger","destroyTriggerInteraction","triggerEl","getElementById","trigEl","modalEl","openModal","addEventListener","removeEventListener","onHandleClick","sheetTransition","moveToNextBreakpoint","onBackdropTap","onLifecycle","modalEvent","usersElement","name","LIFECYCLE_MAP","type","ev","CustomEvent","bubbles","cancelable","dispatchEvent","onIsOpenChange","newValue","oldValue","onTriggerChange","swipeToCloseChanged","initSwipeToClose","breakpointsChanged","sortedBreakpoints","sort","connectedCallback","componentWillLoad","modalId","hasAttribute","getAttribute","includes","componentDidLoad","getDelegate","force","workingDelegate","delegate","parentEl","parentNode","checkCanDismiss","currentTransition","data","Object","assign","componentProps","modal","component","initSheetGesture","keyboardOpenCallback","animationBuilder","leaveAnimation","get","enterAnimation","sheetOnDismiss","emit","role","enteringAnimation","dismissed","destroy","forEach","onDidDismiss","onWillDismiss","setCurrentBreakpoint","allowedBreakpoints","currentBreakpointIndex","indexOf","nextBreakpointIndex","nextBreakpoint","render","handle","htmlAttributes","showHandle","mode","isCardModal","isHandleCycle","tabindex","zIndex","overlayIndex","class","cssClass","onIonBackdropTap","onIonModalDidPresent","onIonModalWillPresent","onIonModalWillDismiss","onIonModalDidDismiss","ref","visible","tappable","part","tabIndex","onClick","watchers","ionModalDidPresent","ionModalWillPresent","ionModalWillDismiss","ionModalDidDismiss","ios","md","ion_modal"],"sources":["D:/MobileDev/WRB/WrenchBoard2023a/node_modules/@ionic/core/dist/esm/ion-modal.entry.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { r as registerInstance, e as createEvent, c as writeTask, h, H as Host, i as getElement } from './index-1a99aeb7.js';\nimport { b as getIonMode, c as config } from './ionic-global-04e268e7.js';\nimport { f as findClosestIonContent, i as isIonContent, d as disableContentScrollY, r as resetContentScrollY, a as findIonContent, p as printIonContentErrorMsg } from './index-3413f7be.js';\nimport { C as CoreDelegate, a as attachComponent, d as detachComponent } from './framework-delegate-ce4f806c.js';\nimport { g as getElementRoot, l as clamp, r as raf, j as inheritAttributes } from './helpers-4d272360.js';\nimport { KEYBOARD_DID_OPEN } from './keyboard-4d5544a0.js';\nimport { p as printIonWarning } from './index-c4b11676.js';\nimport { B as BACKDROP, e as prepareOverlay, d as present, h as activeAnimations, f as dismiss, g as eventMethod } from './overlays-f469834d.js';\nimport { g as getClassMap } from './theme-7670341c.js';\nimport { e as deepReady } from './index-8191d09f.js';\nimport { c as createAnimation } from './animation-36c1d77d.js';\nimport { g as getTimeGivenProgression } from './cubic-bezier-c313947a.js';\nimport { createGesture } from './index-3f1a7d95.js';\nimport { w as win } from './index-33ffec25.js';\nimport './hardware-back-button-490df115.js';\nimport './gesture-controller-17e82006.js';\n\nvar Style;\n(function (Style) {\n Style[\"Dark\"] = \"DARK\";\n Style[\"Light\"] = \"LIGHT\";\n Style[\"Default\"] = \"DEFAULT\";\n})(Style || (Style = {}));\nconst StatusBar = {\n getEngine() {\n var _a, _b, _c;\n return ((_b = (_a = win) === null || _a === void 0 ? void 0 : _a.Capacitor) === null || _b === void 0 ? void 0 : _b.isPluginAvailable('StatusBar')) && ((_c = win) === null || _c === void 0 ? void 0 : _c.Capacitor.Plugins.StatusBar);\n },\n supportsDefaultStatusBarStyle() {\n var _a, _b;\n /**\n * The 'DEFAULT' status bar style was added\n * to the @capacitor/status-bar plugin in Capacitor 3.\n * PluginHeaders is only supported in Capacitor 3+,\n * so we can use this to detect Capacitor 3.\n */\n return !!((_b = (_a = win) === null || _a === void 0 ? void 0 : _a.Capacitor) === null || _b === void 0 ? void 0 : _b.PluginHeaders);\n },\n setStyle(options) {\n const engine = this.getEngine();\n if (!engine) {\n return;\n }\n engine.setStyle(options);\n },\n};\n\n/**\n * Use y = mx + b to\n * figure out the backdrop value\n * at a particular x coordinate. This\n * is useful when the backdrop does\n * not begin to fade in until after\n * the 0 breakpoint.\n */\nconst getBackdropValueForSheet = (x, backdropBreakpoint) => {\n /**\n * We will use these points:\n * (backdropBreakpoint, 0)\n * (maxBreakpoint, 1)\n * We know that at the beginning breakpoint,\n * the backdrop will be hidden. We also\n * know that at the maxBreakpoint, the backdrop\n * must be fully visible. maxBreakpoint should\n * always be 1 even if the maximum value\n * of the breakpoints array is not 1 since\n * the animation runs from a progress of 0\n * to a progress of 1.\n * m = (y2 - y1) / (x2 - x1)\n *\n * This is simplified from:\n * m = (1 - 0) / (maxBreakpoint - backdropBreakpoint)\n *\n * If the backdropBreakpoint is 1, we return 0 as the\n * backdrop is completely hidden.\n *\n */\n if (backdropBreakpoint === 1) {\n return 0;\n }\n const slope = 1 / (1 - backdropBreakpoint);\n /**\n * From here, compute b which is\n * the backdrop opacity if the offset\n * is 0. If the backdrop does not\n * begin to fade in until after the\n * 0 breakpoint, this b value will be\n * negative. This is fine as we never pass\n * b directly into the animation keyframes.\n * b = y - mx\n * Use a known point: (backdropBreakpoint, 0)\n * This is simplified from:\n * b = 0 - (backdropBreakpoint * slope)\n */\n const b = -(backdropBreakpoint * slope);\n /**\n * Finally, we can now determine the\n * backdrop offset given an arbitrary\n * gesture offset.\n */\n return x * slope + b;\n};\n/**\n * The tablet/desktop card modal activates\n * when the window width is >= 768.\n * At that point, the presenting element\n * is not transformed, so we do not need to\n * adjust the status bar color.\n *\n * Note: We check supportsDefaultStatusBarStyle so that\n * Capacitor <= 2 users do not get their status bar\n * stuck in an inconsistent state due to a lack of\n * support for Style.Default.\n */\nconst setCardStatusBarDark = () => {\n if (!win || win.innerWidth >= 768 || !StatusBar.supportsDefaultStatusBarStyle()) {\n return;\n }\n StatusBar.setStyle({ style: Style.Dark });\n};\nconst setCardStatusBarDefault = () => {\n if (!win || win.innerWidth >= 768 || !StatusBar.supportsDefaultStatusBarStyle()) {\n return;\n }\n StatusBar.setStyle({ style: Style.Default });\n};\n\nconst handleCanDismiss = async (el, animation) => {\n /**\n * If canDismiss is not a function\n * then we can return early. If canDismiss is `true`,\n * then canDismissBlocksGesture is `false` as canDismiss\n * will never interrupt the gesture. As a result,\n * this code block is never reached. If canDismiss is `false`,\n * then we never dismiss.\n */\n if (typeof el.canDismiss !== 'function') {\n return;\n }\n /**\n * Run the canDismiss callback.\n * If the function returns `true`,\n * then we can proceed with dismiss.\n */\n const shouldDismiss = await el.canDismiss();\n if (!shouldDismiss) {\n return;\n }\n /**\n * If canDismiss resolved after the snap\n * back animation finished, we can\n * dismiss immediately.\n *\n * If canDismiss resolved before the snap\n * back animation finished, we need to\n * wait until the snap back animation is\n * done before dismissing.\n */\n if (animation.isRunning()) {\n animation.onFinish(() => {\n el.dismiss(undefined, 'handler');\n }, { oneTimeCallback: true });\n }\n else {\n el.dismiss(undefined, 'handler');\n }\n};\n/**\n * This function lets us simulate a realistic spring-like animation\n * when swiping down on the modal.\n * There are two forces that we need to use to compute the spring physics:\n *\n * 1. Stiffness, k: This is a measure of resistance applied a spring.\n * 2. Dampening, c: This value has the effect of reducing or preventing oscillation.\n *\n * Using these two values, we can calculate the Spring Force and the Dampening Force\n * to compute the total force applied to a spring.\n *\n * Spring Force: This force pulls a spring back into its equilibrium position.\n * Hooke's Law tells us that that spring force (FS) = kX.\n * k is the stiffness of a spring, and X is the displacement of the spring from its\n * equilibrium position. In this case, it is the amount by which the free end\n * of a spring was displaced (stretched/pushed) from its \"relaxed\" position.\n *\n * Dampening Force: This force slows down motion. Without it, a spring would oscillate forever.\n * The dampening force, FD, can be found via this formula: FD = -cv\n * where c the dampening value and v is velocity.\n *\n * Therefore, the resulting force that is exerted on the block is:\n * F = FS + FD = -kX - cv\n *\n * Newton's 2nd Law tells us that F = ma:\n * ma = -kX - cv.\n *\n * For Ionic's purposes, we can assume that m = 1:\n * a = -kX - cv\n *\n * Imagine a block attached to the end of a spring. At equilibrium\n * the block is at position x = 1.\n * Pressing on the block moves it to position x = 0;\n * So, to calculate the displacement, we need to take the\n * current position and subtract the previous position from it.\n * X = x - x0 = 0 - 1 = -1.\n *\n * For Ionic's purposes, we are only pushing on the spring modal\n * so we have a max position of 1.\n * As a result, we can expand displacement to this formula:\n * X = x - 1\n *\n * a = -k(x - 1) - cv\n *\n * We can represent the motion of something as a function of time: f(t) = x.\n * The derivative of position gives us the velocity: f'(t)\n * The derivative of the velocity gives us the acceleration: f''(t)\n *\n * We can substitute the formula above with these values:\n *\n * f\"(t) = -k * (f(t) - 1) - c * f'(t)\n *\n * This is called a differential equation.\n *\n * We know that at t = 0, we are at x = 0 because the modal does not move: f(0) = 0\n * This means our velocity is also zero: f'(0) = 0.\n *\n * We can cheat a bit and plug the formula into Wolfram Alpha.\n * However, we need to pick stiffness and dampening values:\n * k = 0.57\n * c = 15\n *\n * I picked these as they are fairly close to native iOS's spring effect\n * with the modal.\n *\n * What we plug in is this: f(0) = 0; f'(0) = 0; f''(t) = -0.57(f(t) - 1) - 15f'(t)\n *\n * The result is a formula that lets us calculate the acceleration\n * for a given time t.\n * Note: This is the approximate form of the solution. Wolfram Alpha will\n * give you a complex differential equation too.\n */\nconst calculateSpringStep = (t) => {\n return 0.00255275 * 2.71828 ** (-14.9619 * t) - 1.00255 * 2.71828 ** (-0.0380968 * t) + 1;\n};\n\n// Defaults for the card swipe animation\nconst SwipeToCloseDefaults = {\n MIN_PRESENTING_SCALE: 0.93,\n};\nconst createSwipeToCloseGesture = (el, animation, onDismiss) => {\n /**\n * The step value at which a card modal\n * is eligible for dismissing via gesture.\n */\n const DISMISS_THRESHOLD = 0.5;\n const height = el.offsetHeight;\n let isOpen = false;\n let canDismissBlocksGesture = false;\n let contentEl = null;\n let scrollEl = null;\n const canDismissMaxStep = 0.2;\n let initialScrollY = true;\n let lastStep = 0;\n const getScrollY = () => {\n if (contentEl && isIonContent(contentEl)) {\n return contentEl.scrollY;\n /**\n * Custom scroll containers are intended to be\n * used with virtual scrolling, so we assume\n * there is scrolling in this case.\n */\n }\n else {\n return true;\n }\n };\n const canStart = (detail) => {\n const target = detail.event.target;\n if (target === null || !target.closest) {\n return true;\n }\n /**\n * If we are swiping on the content,\n * swiping should only be possible if\n * the content is scrolled all the way\n * to the top so that we do not interfere\n * with scrolling.\n *\n * We cannot assume that the `ion-content`\n * target will remain consistent between\n * swipes. For example, when using\n * ion-nav within a card modal it is\n * possible to swipe, push a view, and then\n * swipe again. The target content will not\n * be the same between swipes.\n */\n contentEl = findClosestIonContent(target);\n if (contentEl) {\n /**\n * The card should never swipe to close\n * on the content with a refresher.\n * Note: We cannot solve this by making the\n * swipeToClose gesture have a higher priority\n * than the refresher gesture as the iOS native\n * refresh gesture uses a scroll listener in\n * addition to a gesture.\n *\n * Note: Do not use getScrollElement here\n * because we need this to be a synchronous\n * operation, and getScrollElement is\n * asynchronous.\n */\n if (isIonContent(contentEl)) {\n const root = getElementRoot(contentEl);\n scrollEl = root.querySelector('.inner-scroll');\n }\n else {\n scrollEl = contentEl;\n }\n const hasRefresherInContent = !!contentEl.querySelector('ion-refresher');\n return !hasRefresherInContent && scrollEl.scrollTop === 0;\n }\n /**\n * Card should be swipeable on all\n * parts of the modal except for the footer.\n */\n const footer = target.closest('ion-footer');\n if (footer === null) {\n return true;\n }\n return false;\n };\n const onStart = (detail) => {\n const { deltaY } = detail;\n /**\n * Get the initial scrollY value so\n * that we can correctly reset the scrollY\n * prop when the gesture ends.\n */\n initialScrollY = getScrollY();\n /**\n * If canDismiss is anything other than `true`\n * then users should be able to swipe down\n * until a threshold is hit. At that point,\n * the card modal should not proceed any further.\n * TODO (FW-937)\n * Remove undefined check\n */\n canDismissBlocksGesture = el.canDismiss !== undefined && el.canDismiss !== true;\n /**\n * If we are pulling down, then\n * it is possible we are pulling on the\n * content. We do not want scrolling to\n * happen at the same time as the gesture.\n */\n if (deltaY > 0 && contentEl) {\n disableContentScrollY(contentEl);\n }\n animation.progressStart(true, isOpen ? 1 : 0);\n };\n const onMove = (detail) => {\n const { deltaY } = detail;\n /**\n * If we are pulling down, then\n * it is possible we are pulling on the\n * content. We do not want scrolling to\n * happen at the same time as the gesture.\n */\n if (deltaY > 0 && contentEl) {\n disableContentScrollY(contentEl);\n }\n /**\n * If we are swiping on the content\n * then the swipe gesture should only\n * happen if we are pulling down.\n *\n * However, if we pull up and\n * then down such that the scroll position\n * returns to 0, we should be able to swipe\n * the card.\n */\n const step = detail.deltaY / height;\n /**\n * Check if user is swiping down and\n * if we have a canDismiss value that\n * should block the gesture from\n * proceeding,\n */\n const isAttempingDismissWithCanDismiss = step >= 0 && canDismissBlocksGesture;\n /**\n * If we are blocking the gesture from dismissing,\n * set the max step value so that the sheet cannot be\n * completely hidden.\n */\n const maxStep = isAttempingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;\n /**\n * If we are blocking the gesture from\n * dismissing, calculate the spring modifier value\n * this will be added to the starting breakpoint\n * value to give the gesture a spring-like feeling.\n * Note that the starting breakpoint is always 0,\n * so we omit adding 0 to the result.\n */\n const processedStep = isAttempingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;\n const clampedStep = clamp(0.0001, processedStep, maxStep);\n animation.progressStep(clampedStep);\n /**\n * When swiping down half way, the status bar style\n * should be reset to its default value.\n *\n * We track lastStep so that we do not fire these\n * functions on every onMove, only when the user has\n * crossed a certain threshold.\n */\n if (clampedStep >= DISMISS_THRESHOLD && lastStep < DISMISS_THRESHOLD) {\n setCardStatusBarDefault();\n /**\n * However, if we swipe back up, then the\n * status bar style should be set to have light\n * text on a dark background.\n */\n }\n else if (clampedStep < DISMISS_THRESHOLD && lastStep >= DISMISS_THRESHOLD) {\n setCardStatusBarDark();\n }\n lastStep = clampedStep;\n };\n const onEnd = (detail) => {\n const velocity = detail.velocityY;\n const step = detail.deltaY / height;\n const isAttempingDismissWithCanDismiss = step >= 0 && canDismissBlocksGesture;\n const maxStep = isAttempingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;\n const processedStep = isAttempingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;\n const clampedStep = clamp(0.0001, processedStep, maxStep);\n const threshold = (detail.deltaY + velocity * 1000) / height;\n /**\n * If canDismiss blocks\n * the swipe gesture, then the\n * animation can never complete until\n * canDismiss is checked.\n */\n const shouldComplete = !isAttempingDismissWithCanDismiss && threshold >= DISMISS_THRESHOLD;\n let newStepValue = shouldComplete ? -0.001 : 0.001;\n if (!shouldComplete) {\n animation.easing('cubic-bezier(1, 0, 0.68, 0.28)');\n newStepValue += getTimeGivenProgression([0, 0], [1, 0], [0.68, 0.28], [1, 1], clampedStep)[0];\n }\n else {\n animation.easing('cubic-bezier(0.32, 0.72, 0, 1)');\n newStepValue += getTimeGivenProgression([0, 0], [0.32, 0.72], [0, 1], [1, 1], clampedStep)[0];\n }\n const duration = shouldComplete\n ? computeDuration(step * height, velocity)\n : computeDuration((1 - clampedStep) * height, velocity);\n isOpen = shouldComplete;\n gesture.enable(false);\n if (contentEl) {\n resetContentScrollY(contentEl, initialScrollY);\n }\n animation\n .onFinish(() => {\n if (!shouldComplete) {\n gesture.enable(true);\n }\n })\n .progressEnd(shouldComplete ? 1 : 0, newStepValue, duration);\n /**\n * If the canDismiss value blocked the gesture\n * from proceeding, then we should ignore whatever\n * shouldComplete is. Whether or not the modal\n * animation should complete is now determined by\n * canDismiss.\n *\n * If the user swiped >25% of the way\n * to the max step, then we should\n * check canDismiss. 25% was chosen\n * to avoid accidental swipes.\n */\n if (isAttempingDismissWithCanDismiss && clampedStep > maxStep / 4) {\n handleCanDismiss(el, animation);\n }\n else if (shouldComplete) {\n onDismiss();\n }\n };\n const gesture = createGesture({\n el,\n gestureName: 'modalSwipeToClose',\n gesturePriority: 39,\n direction: 'y',\n threshold: 10,\n canStart,\n onStart,\n onMove,\n onEnd,\n });\n return gesture;\n};\nconst computeDuration = (remaining, velocity) => {\n return clamp(400, remaining / Math.abs(velocity * 1.1), 500);\n};\n\nconst createSheetEnterAnimation = (opts) => {\n const { currentBreakpoint, backdropBreakpoint } = opts;\n /**\n * If the backdropBreakpoint is undefined, then the backdrop\n * should always fade in. If the backdropBreakpoint came before the\n * current breakpoint, then the backdrop should be fading in.\n */\n const shouldShowBackdrop = backdropBreakpoint === undefined || backdropBreakpoint < currentBreakpoint;\n const initialBackdrop = shouldShowBackdrop ? `calc(var(--backdrop-opacity) * ${currentBreakpoint})` : '0';\n const backdropAnimation = createAnimation('backdropAnimation').fromTo('opacity', 0, initialBackdrop);\n if (shouldShowBackdrop) {\n backdropAnimation\n .beforeStyles({\n 'pointer-events': 'none',\n })\n .afterClearStyles(['pointer-events']);\n }\n const wrapperAnimation = createAnimation('wrapperAnimation').keyframes([\n { offset: 0, opacity: 1, transform: 'translateY(100%)' },\n { offset: 1, opacity: 1, transform: `translateY(${100 - currentBreakpoint * 100}%)` },\n ]);\n return { wrapperAnimation, backdropAnimation };\n};\nconst createSheetLeaveAnimation = (opts) => {\n const { currentBreakpoint, backdropBreakpoint } = opts;\n /**\n * Backdrop does not always fade in from 0 to 1 if backdropBreakpoint\n * is defined, so we need to account for that offset by figuring out\n * what the current backdrop value should be.\n */\n const backdropValue = `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(currentBreakpoint, backdropBreakpoint)})`;\n const defaultBackdrop = [\n { offset: 0, opacity: backdropValue },\n { offset: 1, opacity: 0 },\n ];\n const customBackdrop = [\n { offset: 0, opacity: backdropValue },\n { offset: backdropBreakpoint, opacity: 0 },\n { offset: 1, opacity: 0 },\n ];\n const backdropAnimation = createAnimation('backdropAnimation').keyframes(backdropBreakpoint !== 0 ? customBackdrop : defaultBackdrop);\n const wrapperAnimation = createAnimation('wrapperAnimation').keyframes([\n { offset: 0, opacity: 1, transform: `translateY(${100 - currentBreakpoint * 100}%)` },\n { offset: 1, opacity: 1, transform: `translateY(100%)` },\n ]);\n return { wrapperAnimation, backdropAnimation };\n};\n\nconst createEnterAnimation$1 = () => {\n const backdropAnimation = createAnimation()\n .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')\n .beforeStyles({\n 'pointer-events': 'none',\n })\n .afterClearStyles(['pointer-events']);\n const wrapperAnimation = createAnimation().fromTo('transform', 'translateY(100vh)', 'translateY(0vh)');\n return { backdropAnimation, wrapperAnimation };\n};\n/**\n * iOS Modal Enter Animation for the Card presentation style\n */\nconst iosEnterAnimation = (baseEl, opts) => {\n const { presentingEl, currentBreakpoint } = opts;\n const root = getElementRoot(baseEl);\n const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetEnterAnimation(opts) : createEnterAnimation$1();\n backdropAnimation.addElement(root.querySelector('ion-backdrop'));\n wrapperAnimation.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow')).beforeStyles({ opacity: 1 });\n const baseAnimation = createAnimation('entering-base')\n .addElement(baseEl)\n .easing('cubic-bezier(0.32,0.72,0,1)')\n .duration(500)\n .addAnimation(wrapperAnimation);\n if (presentingEl) {\n const isMobile = window.innerWidth < 768;\n const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;\n const presentingElRoot = getElementRoot(presentingEl);\n const presentingAnimation = createAnimation().beforeStyles({\n transform: 'translateY(0)',\n 'transform-origin': 'top center',\n overflow: 'hidden',\n });\n const bodyEl = document.body;\n if (isMobile) {\n /**\n * Fallback for browsers that does not support `max()` (ex: Firefox)\n * No need to worry about statusbar padding since engines like Gecko\n * are not used as the engine for standalone Cordova/Capacitor apps\n */\n const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';\n const modalTransform = hasCardModal ? '-10px' : transformOffset;\n const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;\n const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;\n presentingAnimation\n .afterStyles({\n transform: finalTransform,\n })\n .beforeAddWrite(() => bodyEl.style.setProperty('background-color', 'black'))\n .addElement(presentingEl)\n .keyframes([\n { offset: 0, filter: 'contrast(1)', transform: 'translateY(0px) scale(1)', borderRadius: '0px' },\n { offset: 1, filter: 'contrast(0.85)', transform: finalTransform, borderRadius: '10px 10px 0 0' },\n ]);\n baseAnimation.addAnimation(presentingAnimation);\n }\n else {\n baseAnimation.addAnimation(backdropAnimation);\n if (!hasCardModal) {\n wrapperAnimation.fromTo('opacity', '0', '1');\n }\n else {\n const toPresentingScale = hasCardModal ? SwipeToCloseDefaults.MIN_PRESENTING_SCALE : 1;\n const finalTransform = `translateY(-10px) scale(${toPresentingScale})`;\n presentingAnimation\n .afterStyles({\n transform: finalTransform,\n })\n .addElement(presentingElRoot.querySelector('.modal-wrapper'))\n .keyframes([\n { offset: 0, filter: 'contrast(1)', transform: 'translateY(0) scale(1)' },\n { offset: 1, filter: 'contrast(0.85)', transform: finalTransform },\n ]);\n const shadowAnimation = createAnimation()\n .afterStyles({\n transform: finalTransform,\n })\n .addElement(presentingElRoot.querySelector('.modal-shadow'))\n .keyframes([\n { offset: 0, opacity: '1', transform: 'translateY(0) scale(1)' },\n { offset: 1, opacity: '0', transform: finalTransform },\n ]);\n baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);\n }\n }\n }\n else {\n baseAnimation.addAnimation(backdropAnimation);\n }\n return baseAnimation;\n};\n\nconst createLeaveAnimation$1 = () => {\n const backdropAnimation = createAnimation().fromTo('opacity', 'var(--backdrop-opacity)', 0);\n const wrapperAnimation = createAnimation().fromTo('transform', 'translateY(0vh)', 'translateY(100vh)');\n return { backdropAnimation, wrapperAnimation };\n};\n/**\n * iOS Modal Leave Animation\n */\nconst iosLeaveAnimation = (baseEl, opts, duration = 500) => {\n const { presentingEl, currentBreakpoint } = opts;\n const root = getElementRoot(baseEl);\n const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation$1();\n backdropAnimation.addElement(root.querySelector('ion-backdrop'));\n wrapperAnimation.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow')).beforeStyles({ opacity: 1 });\n const baseAnimation = createAnimation('leaving-base')\n .addElement(baseEl)\n .easing('cubic-bezier(0.32,0.72,0,1)')\n .duration(duration)\n .addAnimation(wrapperAnimation);\n if (presentingEl) {\n const isMobile = window.innerWidth < 768;\n const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;\n const presentingElRoot = getElementRoot(presentingEl);\n const presentingAnimation = createAnimation()\n .beforeClearStyles(['transform'])\n .afterClearStyles(['transform'])\n .onFinish((currentStep) => {\n // only reset background color if this is the last card-style modal\n if (currentStep !== 1) {\n return;\n }\n presentingEl.style.setProperty('overflow', '');\n const numModals = Array.from(bodyEl.querySelectorAll('ion-modal')).filter((m) => m.presentingElement !== undefined).length;\n if (numModals <= 1) {\n bodyEl.style.setProperty('background-color', '');\n }\n });\n const bodyEl = document.body;\n if (isMobile) {\n const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';\n const modalTransform = hasCardModal ? '-10px' : transformOffset;\n const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;\n const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;\n presentingAnimation.addElement(presentingEl).keyframes([\n { offset: 0, filter: 'contrast(0.85)', transform: finalTransform, borderRadius: '10px 10px 0 0' },\n { offset: 1, filter: 'contrast(1)', transform: 'translateY(0px) scale(1)', borderRadius: '0px' },\n ]);\n baseAnimation.addAnimation(presentingAnimation);\n }\n else {\n baseAnimation.addAnimation(backdropAnimation);\n if (!hasCardModal) {\n wrapperAnimation.fromTo('opacity', '1', '0');\n }\n else {\n const toPresentingScale = hasCardModal ? SwipeToCloseDefaults.MIN_PRESENTING_SCALE : 1;\n const finalTransform = `translateY(-10px) scale(${toPresentingScale})`;\n presentingAnimation\n .addElement(presentingElRoot.querySelector('.modal-wrapper'))\n .afterStyles({\n transform: 'translate3d(0, 0, 0)',\n })\n .keyframes([\n { offset: 0, filter: 'contrast(0.85)', transform: finalTransform },\n { offset: 1, filter: 'contrast(1)', transform: 'translateY(0) scale(1)' },\n ]);\n const shadowAnimation = createAnimation()\n .addElement(presentingElRoot.querySelector('.modal-shadow'))\n .afterStyles({\n transform: 'translateY(0) scale(1)',\n })\n .keyframes([\n { offset: 0, opacity: '0', transform: finalTransform },\n { offset: 1, opacity: '1', transform: 'translateY(0) scale(1)' },\n ]);\n baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);\n }\n }\n }\n else {\n baseAnimation.addAnimation(backdropAnimation);\n }\n return baseAnimation;\n};\n\nconst createEnterAnimation = () => {\n const backdropAnimation = createAnimation()\n .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')\n .beforeStyles({\n 'pointer-events': 'none',\n })\n .afterClearStyles(['pointer-events']);\n const wrapperAnimation = createAnimation().keyframes([\n { offset: 0, opacity: 0.01, transform: 'translateY(40px)' },\n { offset: 1, opacity: 1, transform: `translateY(0px)` },\n ]);\n return { backdropAnimation, wrapperAnimation };\n};\n/**\n * Md Modal Enter Animation\n */\nconst mdEnterAnimation = (baseEl, opts) => {\n const { currentBreakpoint } = opts;\n const root = getElementRoot(baseEl);\n const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetEnterAnimation(opts) : createEnterAnimation();\n backdropAnimation.addElement(root.querySelector('ion-backdrop'));\n wrapperAnimation.addElement(root.querySelector('.modal-wrapper'));\n return createAnimation()\n .addElement(baseEl)\n .easing('cubic-bezier(0.36,0.66,0.04,1)')\n .duration(280)\n .addAnimation([backdropAnimation, wrapperAnimation]);\n};\n\nconst createLeaveAnimation = () => {\n const backdropAnimation = createAnimation().fromTo('opacity', 'var(--backdrop-opacity)', 0);\n const wrapperAnimation = createAnimation().keyframes([\n { offset: 0, opacity: 0.99, transform: `translateY(0px)` },\n { offset: 1, opacity: 0, transform: 'translateY(40px)' },\n ]);\n return { backdropAnimation, wrapperAnimation };\n};\n/**\n * Md Modal Leave Animation\n */\nconst mdLeaveAnimation = (baseEl, opts) => {\n const { currentBreakpoint } = opts;\n const root = getElementRoot(baseEl);\n const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation();\n backdropAnimation.addElement(root.querySelector('ion-backdrop'));\n wrapperAnimation.addElement(root.querySelector('.modal-wrapper'));\n return createAnimation()\n .easing('cubic-bezier(0.47,0,0.745,0.715)')\n .duration(200)\n .addAnimation([backdropAnimation, wrapperAnimation]);\n};\n\nconst createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], getCurrentBreakpoint, onDismiss, onBreakpointChange) => {\n // Defaults for the sheet swipe animation\n const defaultBackdrop = [\n { offset: 0, opacity: 'var(--backdrop-opacity)' },\n { offset: 1, opacity: 0.01 },\n ];\n const customBackdrop = [\n { offset: 0, opacity: 'var(--backdrop-opacity)' },\n { offset: 1 - backdropBreakpoint, opacity: 0 },\n { offset: 1, opacity: 0 },\n ];\n const SheetDefaults = {\n WRAPPER_KEYFRAMES: [\n { offset: 0, transform: 'translateY(0%)' },\n { offset: 1, transform: 'translateY(100%)' },\n ],\n BACKDROP_KEYFRAMES: backdropBreakpoint !== 0 ? customBackdrop : defaultBackdrop,\n };\n const contentEl = baseEl.querySelector('ion-content');\n const height = wrapperEl.clientHeight;\n let currentBreakpoint = initialBreakpoint;\n let offset = 0;\n let canDismissBlocksGesture = false;\n const canDismissMaxStep = 0.95;\n const wrapperAnimation = animation.childAnimations.find((ani) => ani.id === 'wrapperAnimation');\n const backdropAnimation = animation.childAnimations.find((ani) => ani.id === 'backdropAnimation');\n const maxBreakpoint = breakpoints[breakpoints.length - 1];\n const minBreakpoint = breakpoints[0];\n const enableBackdrop = () => {\n baseEl.style.setProperty('pointer-events', 'auto');\n backdropEl.style.setProperty('pointer-events', 'auto');\n /**\n * When the backdrop is enabled, elements such\n * as inputs should not be focusable outside\n * the sheet.\n */\n baseEl.classList.remove('ion-disable-focus-trap');\n };\n const disableBackdrop = () => {\n baseEl.style.setProperty('pointer-events', 'none');\n backdropEl.style.setProperty('pointer-events', 'none');\n /**\n * When the backdrop is enabled, elements such\n * as inputs should not be focusable outside\n * the sheet.\n * Adding this class disables focus trapping\n * for the sheet temporarily.\n */\n baseEl.classList.add('ion-disable-focus-trap');\n };\n /**\n * After the entering animation completes,\n * we need to set the animation to go from\n * offset 0 to offset 1 so that users can\n * swipe in any direction. We then set the\n * animation offset to the current breakpoint\n * so there is no flickering.\n */\n if (wrapperAnimation && backdropAnimation) {\n wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);\n backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);\n animation.progressStart(true, 1 - currentBreakpoint);\n /**\n * If backdrop is not enabled, then content\n * behind modal should be clickable. To do this, we need\n * to remove pointer-events from ion-modal as a whole.\n * ion-backdrop and .modal-wrapper always have pointer-events: auto\n * applied, so the modal content can still be interacted with.\n */\n const shouldEnableBackdrop = currentBreakpoint > backdropBreakpoint;\n if (shouldEnableBackdrop) {\n enableBackdrop();\n }\n else {\n disableBackdrop();\n }\n }\n if (contentEl && currentBreakpoint !== maxBreakpoint) {\n contentEl.scrollY = false;\n }\n const canStart = (detail) => {\n /**\n * If the sheet is fully expanded and\n * the user is swiping on the content,\n * the gesture should not start to\n * allow for scrolling on the content.\n */\n const content = detail.event.target.closest('ion-content');\n currentBreakpoint = getCurrentBreakpoint();\n if (currentBreakpoint === 1 && content) {\n return false;\n }\n return true;\n };\n const onStart = () => {\n /**\n * If canDismiss is anything other than `true`\n * then users should be able to swipe down\n * until a threshold is hit. At that point,\n * the card modal should not proceed any further.\n *\n * canDismiss is never fired via gesture if there is\n * no 0 breakpoint. However, it can be fired if the user\n * presses Esc or the hardware back button.\n * TODO (FW-937)\n * Remove undefined check\n */\n canDismissBlocksGesture = baseEl.canDismiss !== undefined && baseEl.canDismiss !== true && minBreakpoint === 0;\n /**\n * If swiping on the content\n * we should disable scrolling otherwise\n * the sheet will expand and the content will scroll.\n */\n if (contentEl) {\n contentEl.scrollY = false;\n }\n raf(() => {\n /**\n * Dismisses the open keyboard when the sheet drag gesture is started.\n * Sets the focus onto the modal element.\n */\n baseEl.focus();\n });\n animation.progressStart(true, 1 - currentBreakpoint);\n };\n const onMove = (detail) => {\n /**\n * Given the change in gesture position on the Y axis,\n * compute where the offset of the animation should be\n * relative to where the user dragged.\n */\n const initialStep = 1 - currentBreakpoint;\n const secondToLastBreakpoint = breakpoints.length > 1 ? 1 - breakpoints[1] : undefined;\n const step = initialStep + detail.deltaY / height;\n const isAttemptingDismissWithCanDismiss = secondToLastBreakpoint !== undefined && step >= secondToLastBreakpoint && canDismissBlocksGesture;\n /**\n * If we are blocking the gesture from dismissing,\n * set the max step value so that the sheet cannot be\n * completely hidden.\n */\n const maxStep = isAttemptingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;\n /**\n * If we are blocking the gesture from\n * dismissing, calculate the spring modifier value\n * this will be added to the starting breakpoint\n * value to give the gesture a spring-like feeling.\n * Note that when isAttemptingDismissWithCanDismiss is true,\n * the modifier is always added to the breakpoint that\n * appears right after the 0 breakpoint.\n *\n * Note that this modifier is essentially the progression\n * between secondToLastBreakpoint and maxStep which is\n * why we subtract secondToLastBreakpoint. This lets us get\n * the result as a value from 0 to 1.\n */\n const processedStep = isAttemptingDismissWithCanDismiss && secondToLastBreakpoint !== undefined\n ? secondToLastBreakpoint +\n calculateSpringStep((step - secondToLastBreakpoint) / (maxStep - secondToLastBreakpoint))\n : step;\n offset = clamp(0.0001, processedStep, maxStep);\n animation.progressStep(offset);\n };\n const onEnd = (detail) => {\n /**\n * When the gesture releases, we need to determine\n * the closest breakpoint to snap to.\n */\n const velocity = detail.velocityY;\n const threshold = (detail.deltaY + velocity * 100) / height;\n const diff = currentBreakpoint - threshold;\n const closest = breakpoints.reduce((a, b) => {\n return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;\n });\n moveSheetToBreakpoint({\n breakpoint: closest,\n breakpointOffset: offset,\n canDismiss: canDismissBlocksGesture,\n });\n };\n const moveSheetToBreakpoint = (options) => {\n const { breakpoint, canDismiss, breakpointOffset } = options;\n /**\n * canDismiss should only prevent snapping\n * when users are trying to dismiss. If canDismiss\n * is present but the user is trying to swipe upwards,\n * we should allow that to happen,\n */\n const shouldPreventDismiss = canDismiss && breakpoint === 0;\n const snapToBreakpoint = shouldPreventDismiss ? currentBreakpoint : breakpoint;\n const shouldRemainOpen = snapToBreakpoint !== 0;\n currentBreakpoint = 0;\n /**\n * Update the animation so that it plays from\n * the last offset to the closest snap point.\n */\n if (wrapperAnimation && backdropAnimation) {\n wrapperAnimation.keyframes([\n { offset: 0, transform: `translateY(${breakpointOffset * 100}%)` },\n { offset: 1, transform: `translateY(${(1 - snapToBreakpoint) * 100}%)` },\n ]);\n backdropAnimation.keyframes([\n {\n offset: 0,\n opacity: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(1 - breakpointOffset, backdropBreakpoint)})`,\n },\n {\n offset: 1,\n opacity: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(snapToBreakpoint, backdropBreakpoint)})`,\n },\n ]);\n animation.progressStep(0);\n }\n /**\n * Gesture should remain disabled until the\n * snapping animation completes.\n */\n gesture.enable(false);\n if (shouldPreventDismiss) {\n handleCanDismiss(baseEl, animation);\n }\n else if (!shouldRemainOpen) {\n onDismiss();\n }\n return new Promise((resolve) => {\n animation\n .onFinish(() => {\n if (shouldRemainOpen) {\n /**\n * Once the snapping animation completes,\n * we need to reset the animation to go\n * from 0 to 1 so users can swipe in any direction.\n * We then set the animation offset to the current\n * breakpoint so that it starts at the snapped position.\n */\n if (wrapperAnimation && backdropAnimation) {\n raf(() => {\n wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);\n backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);\n animation.progressStart(true, 1 - snapToBreakpoint);\n currentBreakpoint = snapToBreakpoint;\n onBreakpointChange(currentBreakpoint);\n /**\n * If the sheet is fully expanded, we can safely\n * enable scrolling again.\n */\n if (contentEl && currentBreakpoint === breakpoints[breakpoints.length - 1]) {\n contentEl.scrollY = true;\n }\n /**\n * Backdrop should become enabled\n * after the backdropBreakpoint value\n */\n const shouldEnableBackdrop = currentBreakpoint > backdropBreakpoint;\n if (shouldEnableBackdrop) {\n enableBackdrop();\n }\n else {\n disableBackdrop();\n }\n gesture.enable(true);\n resolve();\n });\n }\n else {\n gesture.enable(true);\n resolve();\n }\n }\n else {\n resolve();\n }\n /**\n * This must be a one time callback\n * otherwise a new callback will\n * be added every time onEnd runs.\n */\n }, { oneTimeCallback: true })\n .progressEnd(1, 0, 500);\n });\n };\n const gesture = createGesture({\n el: wrapperEl,\n gestureName: 'modalSheet',\n gesturePriority: 40,\n direction: 'y',\n threshold: 10,\n canStart,\n onStart,\n onMove,\n onEnd,\n });\n return {\n gesture,\n moveSheetToBreakpoint,\n };\n};\n\nconst modalIosCss = \":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.modal-handle::before{padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\\\"\\\"}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.modal-handle::before{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: 1px){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: 1px){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-card) .modal-wrapper,:host-context([dir=rtl]).modal-card .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{-webkit-box-shadow:none;box-shadow:none}:host(.modal-card) .modal-shadow{-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-sheet) .modal-wrapper,:host-context([dir=rtl]).modal-sheet .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}\";\n\nconst modalMdCss = \":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;-webkit-transform:translateZ(0);transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.modal-handle::before{padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);content:\\\"\\\"}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.modal-handle::before{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}\";\n\nconst Modal = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.didPresent = createEvent(this, \"ionModalDidPresent\", 7);\n this.willPresent = createEvent(this, \"ionModalWillPresent\", 7);\n this.willDismiss = createEvent(this, \"ionModalWillDismiss\", 7);\n this.didDismiss = createEvent(this, \"ionModalDidDismiss\", 7);\n this.ionBreakpointDidChange = createEvent(this, \"ionBreakpointDidChange\", 7);\n this.didPresentShorthand = createEvent(this, \"didPresent\", 7);\n this.willPresentShorthand = createEvent(this, \"willPresent\", 7);\n this.willDismissShorthand = createEvent(this, \"willDismiss\", 7);\n this.didDismissShorthand = createEvent(this, \"didDismiss\", 7);\n this.modalIndex = modalIds++;\n this.coreDelegate = CoreDelegate();\n this.isSheetModal = false;\n this.inheritedAttributes = {};\n this.inline = false;\n // Whether or not modal is being dismissed via gesture\n this.gestureAnimationDismissing = false;\n this.presented = false;\n /** @internal */\n this.hasController = false;\n /**\n * If `true`, the keyboard will be automatically dismissed when the overlay is presented.\n */\n this.keyboardClose = true;\n /**\n * A decimal value between 0 and 1 that indicates the\n * point after which the backdrop will begin to fade in\n * when using a sheet modal. Prior to this point, the\n * backdrop will be hidden and the content underneath\n * the sheet can be interacted with. This value is exclusive\n * meaning the backdrop will become active after the value\n * specified.\n */\n this.backdropBreakpoint = 0;\n /**\n * The interaction behavior for the sheet modal when the handle is pressed.\n *\n * Defaults to `\"none\"`, which means the modal will not change size or position when the handle is pressed.\n * Set to `\"cycle\"` to let the modal cycle between available breakpoints when pressed.\n *\n * Handle behavior is unavailable when the `handle` property is set to `false` or\n * when the `breakpoints` property is not set (using a fullscreen or card modal).\n */\n this.handleBehavior = 'none';\n /**\n * If `true`, the modal will be dismissed when the backdrop is clicked.\n */\n this.backdropDismiss = true;\n /**\n * If `true`, a backdrop will be displayed behind the modal.\n * This property controls whether or not the backdrop\n * darkens the screen when the modal is presented.\n * It does not control whether or not the backdrop\n * is active or present in the DOM.\n */\n this.showBackdrop = true;\n /**\n * If `true`, the modal will animate.\n */\n this.animated = true;\n /**\n * If `true`, the modal can be swiped to dismiss. Only applies in iOS mode.\n * @deprecated - To prevent modals from dismissing, use canDismiss instead.\n */\n this.swipeToClose = false;\n /**\n * If `true`, the modal will open. If `false`, the modal will close.\n * Use this if you need finer grained control over presentation, otherwise\n * just use the modalController or the `trigger` property.\n * Note: `isOpen` will not automatically be set back to `false` when\n * the modal dismisses. You will need to do that in your code.\n */\n this.isOpen = false;\n /**\n * If `true`, the component passed into `ion-modal` will\n * automatically be mounted when the modal is created. The\n * component will remain mounted even when the modal is dismissed.\n * However, the component will be destroyed when the modal is\n * destroyed. This property is not reactive and should only be\n * used when initially creating a modal.\n *\n * Note: This feature only applies to inline modals in JavaScript\n * frameworks such as Angular, React, and Vue.\n */\n this.keepContentsMounted = false;\n this.configureTriggerInteraction = () => {\n const { trigger, el, destroyTriggerInteraction } = this;\n if (destroyTriggerInteraction) {\n destroyTriggerInteraction();\n }\n const triggerEl = trigger !== undefined ? document.getElementById(trigger) : null;\n if (!triggerEl) {\n return;\n }\n const configureTriggerInteraction = (trigEl, modalEl) => {\n const openModal = () => {\n modalEl.present();\n };\n trigEl.addEventListener('click', openModal);\n return () => {\n trigEl.removeEventListener('click', openModal);\n };\n };\n this.destroyTriggerInteraction = configureTriggerInteraction(triggerEl, el);\n };\n this.onHandleClick = () => {\n const { sheetTransition, handleBehavior } = this;\n if (handleBehavior !== 'cycle' || sheetTransition !== undefined) {\n /**\n * The sheet modal should not advance to the next breakpoint\n * if the handle behavior is not `cycle` or if the handle\n * is clicked while the sheet is moving to a breakpoint.\n */\n return;\n }\n this.moveToNextBreakpoint();\n };\n this.onBackdropTap = () => {\n const { sheetTransition } = this;\n if (sheetTransition !== undefined) {\n /**\n * When the handle is double clicked at the largest breakpoint,\n * it will start to move to the first breakpoint. While transitioning,\n * the backdrop will often receive the second click. We prevent the\n * backdrop from dismissing the modal while moving between breakpoints.\n */\n return;\n }\n this.dismiss(undefined, BACKDROP);\n };\n this.onLifecycle = (modalEvent) => {\n const el = this.usersElement;\n const name = LIFECYCLE_MAP[modalEvent.type];\n if (el && name) {\n const ev = new CustomEvent(name, {\n bubbles: false,\n cancelable: false,\n detail: modalEvent.detail,\n });\n el.dispatchEvent(ev);\n }\n };\n }\n onIsOpenChange(newValue, oldValue) {\n if (newValue === true && oldValue === false) {\n this.present();\n }\n else if (newValue === false && oldValue === true) {\n this.dismiss();\n }\n }\n onTriggerChange() {\n this.configureTriggerInteraction();\n }\n async swipeToCloseChanged(enable) {\n if (this.gesture) {\n this.gesture.enable(enable);\n }\n else if (enable) {\n await this.initSwipeToClose();\n }\n }\n breakpointsChanged(breakpoints) {\n if (breakpoints !== undefined) {\n this.sortedBreakpoints = breakpoints.sort((a, b) => a - b);\n }\n }\n connectedCallback() {\n prepareOverlay(this.el);\n }\n componentWillLoad() {\n const { breakpoints, initialBreakpoint, swipeToClose, el } = this;\n this.inheritedAttributes = inheritAttributes(el, ['role']);\n /**\n * If user has custom ID set then we should\n * not assign the default incrementing ID.\n */\n this.modalId = this.el.hasAttribute('id') ? this.el.getAttribute('id') : `ion-modal-${this.modalIndex}`;\n const isSheetModal = (this.isSheetModal = breakpoints !== undefined && initialBreakpoint !== undefined);\n if (isSheetModal) {\n this.currentBreakpoint = this.initialBreakpoint;\n }\n if (breakpoints !== undefined && initialBreakpoint !== undefined && !breakpoints.includes(initialBreakpoint)) {\n printIonWarning('Your breakpoints array must include the initialBreakpoint value.');\n }\n if (swipeToClose) {\n printIonWarning('swipeToClose has been deprecated in favor of canDismiss.\\n\\nIf you want a card modal to be swipeable, set canDismiss to `true`. In the next major release of Ionic, swipeToClose will be removed, and all card modals will be swipeable by default.');\n }\n }\n componentDidLoad() {\n /**\n * If modal was rendered with isOpen=\"true\"\n * then we should open modal immediately.\n */\n if (this.isOpen === true) {\n raf(() => this.present());\n }\n this.breakpointsChanged(this.breakpoints);\n this.configureTriggerInteraction();\n }\n /**\n * Determines whether or not an overlay\n * is being used inline or via a controller/JS\n * and returns the correct delegate.\n * By default, subsequent calls to getDelegate\n * will use a cached version of the delegate.\n * This is useful for calling dismiss after\n * present so that the correct delegate is given.\n */\n getDelegate(force = false) {\n if (this.workingDelegate && !force) {\n return {\n delegate: this.workingDelegate,\n inline: this.inline,\n };\n }\n /**\n * If using overlay inline\n * we potentially need to use the coreDelegate\n * so that this works in vanilla JS apps.\n * If a developer has presented this component\n * via a controller, then we can assume\n * the component is already in the\n * correct place.\n */\n const parentEl = this.el.parentNode;\n const inline = (this.inline = parentEl !== null && !this.hasController);\n const delegate = (this.workingDelegate = inline ? this.delegate || this.coreDelegate : this.delegate);\n return { inline, delegate };\n }\n /**\n * Determines whether or not the\n * modal is allowed to dismiss based\n * on the state of the canDismiss prop.\n */\n async checkCanDismiss() {\n const { canDismiss } = this;\n /**\n * TODO (FW-937) - Remove the following check in\n * the next major release of Ionic.\n */\n if (canDismiss === undefined) {\n return true;\n }\n if (typeof canDismiss === 'function') {\n return canDismiss();\n }\n return canDismiss;\n }\n /**\n * Present the modal overlay after it has been created.\n */\n async present() {\n if (this.presented) {\n return;\n }\n /**\n * When using an inline modal\n * and dismissing a modal it is possible to\n * quickly present the modal while it is\n * dismissing. We need to await any current\n * transition to allow the dismiss to finish\n * before presenting again.\n */\n if (this.currentTransition !== undefined) {\n await this.currentTransition;\n }\n /**\n * If the modal is presented multiple times (inline modals), we\n * need to reset the current breakpoint to the initial breakpoint.\n */\n this.currentBreakpoint = this.initialBreakpoint;\n const data = Object.assign(Object.assign({}, this.componentProps), { modal: this.el });\n const { inline, delegate } = this.getDelegate(true);\n this.usersElement = await attachComponent(delegate, this.el, this.component, ['ion-page'], data, inline);\n await deepReady(this.usersElement);\n writeTask(() => this.el.classList.add('show-modal'));\n this.currentTransition = present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {\n presentingEl: this.presentingElement,\n currentBreakpoint: this.initialBreakpoint,\n backdropBreakpoint: this.backdropBreakpoint,\n });\n /**\n * TODO (FW-937) - In the next major release of Ionic, all card modals\n * will be swipeable by default. canDismiss will be used to determine if the\n * modal can be dismissed. This check should change to check the presence of\n * presentingElement instead.\n *\n * If we did not do this check, then not using swipeToClose would mean you could\n * not run canDismiss on swipe as there would be no swipe gesture created.\n */\n const hasCardModal = this.swipeToClose || (this.canDismiss !== undefined && this.presentingElement !== undefined);\n /**\n * We need to change the status bar at the\n * start of the animation so that it completes\n * by the time the card animation is done.\n */\n if (hasCardModal && getIonMode(this) === 'ios') {\n setCardStatusBarDark();\n }\n await this.currentTransition;\n if (this.isSheetModal) {\n this.initSheetGesture();\n }\n else if (hasCardModal) {\n await this.initSwipeToClose();\n }\n /* tslint:disable-next-line */\n if (typeof window !== 'undefined') {\n this.keyboardOpenCallback = () => {\n if (this.gesture) {\n /**\n * When the native keyboard is opened and the webview\n * is resized, the gesture implementation will become unresponsive\n * and enter a free-scroll mode.\n *\n * When the keyboard is opened, we disable the gesture for\n * a single frame and re-enable once the contents have repositioned\n * from the keyboard placement.\n */\n this.gesture.enable(false);\n raf(() => {\n if (this.gesture) {\n this.gesture.enable(true);\n }\n });\n }\n };\n window.addEventListener(KEYBOARD_DID_OPEN, this.keyboardOpenCallback);\n }\n this.currentTransition = undefined;\n }\n initSwipeToClose() {\n if (getIonMode(this) !== 'ios') {\n return;\n }\n const { el } = this;\n // All of the elements needed for the swipe gesture\n // should be in the DOM and referenced by now, except\n // for the presenting el\n const animationBuilder = this.leaveAnimation || config.get('modalLeave', iosLeaveAnimation);\n const ani = (this.animation = animationBuilder(el, { presentingEl: this.presentingElement }));\n const contentEl = findIonContent(el);\n if (!contentEl) {\n printIonContentErrorMsg(el);\n return;\n }\n this.gesture = createSwipeToCloseGesture(el, ani, () => {\n /**\n * While the gesture animation is finishing\n * it is possible for a user to tap the backdrop.\n * This would result in the dismiss animation\n * being played again. Typically this is avoided\n * by setting `presented = false` on the overlay\n * component; however, we cannot do that here as\n * that would prevent the element from being\n * removed from the DOM.\n */\n this.gestureAnimationDismissing = true;\n this.animation.onFinish(async () => {\n await this.dismiss(undefined, 'gesture');\n this.gestureAnimationDismissing = false;\n });\n });\n this.gesture.enable(true);\n }\n initSheetGesture() {\n const { wrapperEl, initialBreakpoint, backdropBreakpoint } = this;\n if (!wrapperEl || initialBreakpoint === undefined) {\n return;\n }\n const animationBuilder = this.enterAnimation || config.get('modalEnter', iosEnterAnimation);\n const ani = (this.animation = animationBuilder(this.el, {\n presentingEl: this.presentingElement,\n currentBreakpoint: initialBreakpoint,\n backdropBreakpoint,\n }));\n ani.progressStart(true, 1);\n const { gesture, moveSheetToBreakpoint } = createSheetGesture(this.el, this.backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, ani, this.sortedBreakpoints, () => { var _a; return (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : 0; }, () => this.sheetOnDismiss(), (breakpoint) => {\n if (this.currentBreakpoint !== breakpoint) {\n this.currentBreakpoint = breakpoint;\n this.ionBreakpointDidChange.emit({ breakpoint });\n }\n });\n this.gesture = gesture;\n this.moveSheetToBreakpoint = moveSheetToBreakpoint;\n this.gesture.enable(true);\n }\n sheetOnDismiss() {\n /**\n * While the gesture animation is finishing\n * it is possible for a user to tap the backdrop.\n * This would result in the dismiss animation\n * being played again. Typically this is avoided\n * by setting `presented = false` on the overlay\n * component; however, we cannot do that here as\n * that would prevent the element from being\n * removed from the DOM.\n */\n this.gestureAnimationDismissing = true;\n this.animation.onFinish(async () => {\n this.currentBreakpoint = 0;\n this.ionBreakpointDidChange.emit({ breakpoint: this.currentBreakpoint });\n await this.dismiss(undefined, 'gesture');\n this.gestureAnimationDismissing = false;\n });\n }\n /**\n * Dismiss the modal overlay after it has been presented.\n *\n * @param data Any data to emit in the dismiss events.\n * @param role The role of the element that is dismissing the modal. For example, 'cancel' or 'backdrop'.\n */\n async dismiss(data, role) {\n if (this.gestureAnimationDismissing && role !== 'gesture') {\n return false;\n }\n /**\n * If a canDismiss handler is responsible\n * for calling the dismiss method, we should\n * not run the canDismiss check again.\n */\n if (role !== 'handler' && !(await this.checkCanDismiss())) {\n return false;\n }\n /**\n * We need to start the status bar change\n * before the animation so that the change\n * finishes when the dismiss animation does.\n * TODO (FW-937)\n */\n const hasCardModal = this.swipeToClose || (this.canDismiss !== undefined && this.presentingElement !== undefined);\n if (hasCardModal && getIonMode(this) === 'ios') {\n setCardStatusBarDefault();\n }\n /* tslint:disable-next-line */\n if (typeof window !== 'undefined' && this.keyboardOpenCallback) {\n window.removeEventListener(KEYBOARD_DID_OPEN, this.keyboardOpenCallback);\n }\n /**\n * When using an inline modal\n * and presenting a modal it is possible to\n * quickly dismiss the modal while it is\n * presenting. We need to await any current\n * transition to allow the present to finish\n * before dismissing again.\n */\n if (this.currentTransition !== undefined) {\n await this.currentTransition;\n }\n const enteringAnimation = activeAnimations.get(this) || [];\n this.currentTransition = dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {\n presentingEl: this.presentingElement,\n currentBreakpoint: this.currentBreakpoint || this.initialBreakpoint,\n backdropBreakpoint: this.backdropBreakpoint,\n });\n const dismissed = await this.currentTransition;\n if (dismissed) {\n const { delegate } = this.getDelegate();\n await detachComponent(delegate, this.usersElement);\n writeTask(() => this.el.classList.remove('show-modal'));\n if (this.animation) {\n this.animation.destroy();\n }\n if (this.gesture) {\n this.gesture.destroy();\n }\n enteringAnimation.forEach((ani) => ani.destroy());\n }\n this.currentBreakpoint = undefined;\n this.currentTransition = undefined;\n this.animation = undefined;\n return dismissed;\n }\n /**\n * Returns a promise that resolves when the modal did dismiss.\n */\n onDidDismiss() {\n return eventMethod(this.el, 'ionModalDidDismiss');\n }\n /**\n * Returns a promise that resolves when the modal will dismiss.\n */\n onWillDismiss() {\n return eventMethod(this.el, 'ionModalWillDismiss');\n }\n /**\n * Move a sheet style modal to a specific breakpoint. The breakpoint value must\n * be a value defined in your `breakpoints` array.\n */\n async setCurrentBreakpoint(breakpoint) {\n if (!this.isSheetModal) {\n printIonWarning('setCurrentBreakpoint is only supported on sheet modals.');\n return;\n }\n if (!this.breakpoints.includes(breakpoint)) {\n printIonWarning(`Attempted to set invalid breakpoint value ${breakpoint}. Please double check that the breakpoint value is part of your defined breakpoints.`);\n return;\n }\n const { currentBreakpoint, moveSheetToBreakpoint, canDismiss, breakpoints } = this;\n if (currentBreakpoint === breakpoint) {\n return;\n }\n if (moveSheetToBreakpoint) {\n this.sheetTransition = moveSheetToBreakpoint({\n breakpoint,\n breakpointOffset: 1 - currentBreakpoint,\n canDismiss: canDismiss !== undefined && canDismiss !== true && breakpoints[0] === 0,\n });\n await this.sheetTransition;\n this.sheetTransition = undefined;\n }\n }\n /**\n * Returns the current breakpoint of a sheet style modal\n */\n async getCurrentBreakpoint() {\n return this.currentBreakpoint;\n }\n async moveToNextBreakpoint() {\n const { breakpoints, currentBreakpoint } = this;\n if (!breakpoints || currentBreakpoint == null) {\n /**\n * If the modal does not have breakpoints and/or the current\n * breakpoint is not set, we can't move to the next breakpoint.\n */\n return false;\n }\n const allowedBreakpoints = breakpoints.filter((b) => b !== 0);\n const currentBreakpointIndex = allowedBreakpoints.indexOf(currentBreakpoint);\n const nextBreakpointIndex = (currentBreakpointIndex + 1) % allowedBreakpoints.length;\n const nextBreakpoint = allowedBreakpoints[nextBreakpointIndex];\n /**\n * Sets the current breakpoint to the next available breakpoint.\n * If the current breakpoint is the last breakpoint, we set the current\n * breakpoint to the first non-zero breakpoint to avoid dismissing the sheet.\n */\n await this.setCurrentBreakpoint(nextBreakpoint);\n return true;\n }\n render() {\n const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior, inheritedAttributes } = this;\n const showHandle = handle !== false && isSheetModal;\n const mode = getIonMode(this);\n const { modalId } = this;\n const isCardModal = presentingElement !== undefined && mode === 'ios';\n const isHandleCycle = handleBehavior === 'cycle';\n return (h(Host, Object.assign({ \"no-router\": true, \"aria-modal\": \"true\", role: \"dialog\", tabindex: \"-1\" }, htmlAttributes, inheritedAttributes, { style: {\n zIndex: `${20000 + this.overlayIndex}`,\n }, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, getClassMap(this.cssClass)), id: modalId, onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), h(\"ion-backdrop\", { ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: \"backdrop\" }), mode === 'ios' && h(\"div\", { class: \"modal-shadow\" }), h(\"div\", { class: \"modal-wrapper ion-overlay-wrapper\", part: \"content\", ref: (el) => (this.wrapperEl = el) }, showHandle && (h(\"button\", { class: \"modal-handle\",\n // Prevents the handle from receiving keyboard focus when it does not cycle\n tabIndex: !isHandleCycle ? -1 : 0, \"aria-label\": \"Activate to adjust the size of the dialog overlaying the screen\", onClick: isHandleCycle ? this.onHandleClick : undefined, part: \"handle\" })), h(\"slot\", null))));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"isOpen\": [\"onIsOpenChange\"],\n \"trigger\": [\"onTriggerChange\"],\n \"swipeToClose\": [\"swipeToCloseChanged\"]\n }; }\n};\nconst LIFECYCLE_MAP = {\n ionModalDidPresent: 'ionViewDidEnter',\n ionModalWillPresent: 'ionViewWillEnter',\n ionModalWillDismiss: 'ionViewWillLeave',\n ionModalDidDismiss: 'ionViewDidLeave',\n};\nlet modalIds = 0;\nModal.style = {\n ios: modalIosCss,\n md: modalMdCss\n};\n\nexport { Modal as ion_modal };\n"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,CAAC,IAAIC,gBAAd,EAAgCC,CAAC,IAAIC,WAArC,EAAkDC,CAAC,IAAIC,SAAvD,EAAkEC,CAAlE,EAAqEC,CAAC,IAAIC,IAA1E,EAAgFC,CAAC,IAAIC,UAArF,QAAuG,qBAAvG;AACA,SAASC,CAAC,IAAIC,UAAd,EAA0BR,CAAC,IAAIS,MAA/B,QAA6C,4BAA7C;AACA,SAASC,CAAC,IAAIC,qBAAd,EAAqCN,CAAC,IAAIO,YAA1C,EAAwDC,CAAC,IAAIC,qBAA7D,EAAoFlB,CAAC,IAAImB,mBAAzF,EAA8GC,CAAC,IAAIC,cAAnH,EAAmIC,CAAC,IAAIC,uBAAxI,QAAuK,qBAAvK;AACA,SAASC,CAAC,IAAIC,YAAd,EAA4BL,CAAC,IAAIM,eAAjC,EAAkDT,CAAC,IAAIU,eAAvD,QAA8E,kCAA9E;AACA,SAASC,CAAC,IAAIC,cAAd,EAA8BC,CAAC,IAAIC,KAAnC,EAA0C/B,CAAC,IAAIgC,GAA/C,EAAoDC,CAAC,IAAIC,iBAAzD,QAAkF,uBAAlF;AACA,SAASC,iBAAT,QAAkC,wBAAlC;AACA,SAASb,CAAC,IAAIc,eAAd,QAAqC,qBAArC;AACA,SAASC,CAAC,IAAIC,QAAd,EAAwBpC,CAAC,IAAIqC,cAA7B,EAA6CtB,CAAC,IAAIuB,OAAlD,EAA2DlC,CAAC,IAAImC,gBAAhE,EAAkF3B,CAAC,IAAI4B,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AmB;IAAES,KAAK,EAAEpB,KAAK,CAACqB;EAAf,CAAnB;AACD,CALD;;AAMA,MAAMC,uBAAuB,GAAG,MAAM;EACpC,IAAI,CAACvB,GAAD,IAAQA,GAAG,CAACoB,UAAJ,IAAkB,GAA1B,IAAiC,CAAClB,SAAS,CAACQ,6BAAV,EAAtC,EAAiF;IAC/E;EACD;;EACDR,SAAS,CAACU,QAAV,CAAmB;IAAES,KAAK,EAAEpB,KAAK,CAACuB;EAAf,CAAnB;AACD,CALD;;AAOA,MAAMC,gBAAgB;EAAA,6BAAG,WAAOC,EAAP,EAAWC,SAAX,EAAyB;IAChD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;IACE,IAAI,OAAOD,EAAE,CAACE,UAAV,KAAyB,UAA7B,EAAyC;MACvC;IACD;IACD;AACF;AACA;AACA;AACA;;;IACE,MAAMC,aAAa,SAASH,EAAE,CAACE,UAAH,EAA5B;;IACA,IAAI,CAACC,aAAL,EAAoB;MAClB;IACD;IACD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;IACE,IAAIF,SAAS,CAACG,SAAV,EAAJ,EAA2B;MACzBH,SAAS,CAACI,QAAV,CAAmB,MAAM;QACvBL,EAAE,CAAClC,OAAH,CAAWwC,SAAX,EAAsB,SAAtB;MACD,CAFD,EAEG;QAAEC,eAAe,EAAE;MAAnB,CAFH;IAGD,CAJD,MAKK;MACHP,EAAE,CAAClC,OAAH,CAAWwC,SAAX,EAAsB,SAAtB;IACD;EACF,CAvCqB;;EAAA,gBAAhBP,gBAAgB;IAAA;EAAA;AAAA,GAAtB;AAwCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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