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

1 line
54 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 { b as getIonMode, c as config } from './ionic-global-04e268e7.js';\nimport { OVERLAY_BACK_BUTTON_PRIORITY } from './hardware-back-button-490df115.js';\nimport { c as componentOnReady, f as focusElement, a as addEventListener, b as removeEventListener, g as getElementRoot } from './helpers-4d272360.js';\nlet lastId = 0;\nconst activeAnimations = new WeakMap();\n\nconst createController = tagName => {\n return {\n create(options) {\n return createOverlay(tagName, options);\n },\n\n dismiss(data, role, id) {\n return dismissOverlay(document, data, role, tagName, id);\n },\n\n getTop() {\n return _asyncToGenerator(function* () {\n return getOverlay(document, tagName);\n })();\n }\n\n };\n};\n\nconst alertController = /*@__PURE__*/createController('ion-alert');\nconst actionSheetController = /*@__PURE__*/createController('ion-action-sheet');\nconst loadingController = /*@__PURE__*/createController('ion-loading');\nconst modalController = /*@__PURE__*/createController('ion-modal');\nconst pickerController = /*@__PURE__*/createController('ion-picker');\nconst popoverController = /*@__PURE__*/createController('ion-popover');\nconst toastController = /*@__PURE__*/createController('ion-toast');\n\nconst prepareOverlay = el => {\n if (typeof document !== 'undefined') {\n connectListeners(document);\n }\n\n const overlayIndex = lastId++;\n el.overlayIndex = overlayIndex;\n\n if (!el.hasAttribute('id')) {\n el.id = `ion-overlay-${overlayIndex}`;\n }\n};\n\nconst createOverlay = (tagName, opts) => {\n if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined') {\n return window.customElements.whenDefined(tagName).then(() => {\n const element = document.createElement(tagName);\n element.classList.add('overlay-hidden');\n /**\n * Convert the passed in overlay options into props\n * that get passed down into the new overlay.\n */\n\n Object.assign(element, Object.assign(Object.assign({}, opts), {\n hasController: true\n })); // append the overlay element to the document body\n\n getAppRoot(document).appendChild(element);\n return new Promise(resolve => componentOnReady(element, resolve));\n });\n }\n\n return Promise.resolve();\n};\n\nconst focusableQueryString = '[tabindex]:not([tabindex^=\"-\"]), input:not([type=hidden]):not([tabindex^=\"-\"]), textarea:not([tabindex^=\"-\"]), button:not([tabindex^=\"-\"]), select:not([tabindex^=\"-\"]), .ion-focusable:not([tabindex^=\"-\"])';\n\nconst focusFirstDescendant = (ref, overlay) => {\n let firstInput = ref.querySelector(focusableQueryString);\n const shadowRoot = firstInput === null || firstInput === void 0 ? void 0 : firstInput.shadowRoot;\n\n if (shadowRoot) {\n // If there are no inner focusable elements, just focus the host element.\n firstInput = shadowRoot.querySelector(focusableQueryString) || firstInput;\n }\n\n if (firstInput) {\n focusElement(firstInput);\n } else {\n // Focus overlay instead of letting focus escape\n overlay.focus();\n }\n};\n\nconst isOverlayHidden = overlay => overlay.classList.contains('overlay-hidden');\n\nconst focusLastDescendant = (ref, overlay) => {\n const inputs = Array.from(ref.querySelectorAll(focusableQueryString));\n let lastInput = inputs.length > 0 ? inputs[inputs.length - 1] : null;\n const shadowRoot = lastInput === null || lastInput === void 0 ? void 0 : lastInput.shadowRoot;\n\n if (shadowRoot) {\n // If there are no inner focusable elements, just focus the host element.\n lastInput = shadowRoot.querySelector(focusableQueryString) || lastInput;\n }\n\n if (lastInput) {\n lastInput.focus();\n } else {\n // Focus overlay instead of letting focus escape\n overlay.focus();\n }\n};\n/**\n * Traps keyboard focus inside of overlay components.\n * Based on https://w3c.github.io/aria-practices/examples/dialog-modal/alertdialog.html\n * This includes the following components: Action Sheet, Alert, Loading, Modal,\n * Picker, and Popover.\n * Should NOT include: Toast\n */\n\n\nconst trapKeyboardFocus = (ev, doc) => {\n const lastOverlay = getOverlay(doc, 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover');\n const target = ev.target;\n /**\n * If no active overlay, ignore this event.\n *\n * If this component uses the shadow dom,\n * this global listener is pointless\n * since it will not catch the focus\n * traps as they are inside the shadow root.\n * We need to add a listener to the shadow root\n * itself to ensure the focus trap works.\n */\n\n if (!lastOverlay || !target) {\n return;\n }\n /**\n * If the ion-disable-focus-trap class\n * is present on an overlay, then this component\n * instance has opted out of focus trapping.\n * An example of this is when the sheet modal\n * has a backdrop that is disabled. The content\n * behind the sheet should be focusable until\n * the backdrop is enabled.\n */\n\n\n if (lastOverlay.classList.contains('ion-disable-focus-trap')) {\n return;\n }\n\n const trapScopedFocus = () => {\n /**\n * If we are focusing the overlay, clear\n * the last focused element so that hitting\n * tab activates the first focusable element\n * in the overlay wrapper.\n */\n if (lastOverlay === target) {\n lastOverlay.lastFocus = undefined;\n /**\n * Otherwise, we must be focusing an element\n * inside of the overlay. The two possible options\n * here are an input/button/etc or the ion-focus-trap\n * element. The focus trap element is used to prevent\n * the keyboard focus from leaving the overlay when\n * using Tab or screen assistants.\n */\n } else {\n /**\n * We do not want to focus the traps, so get the overlay\n * wrapper element as the traps live outside of the wrapper.\n */\n const overlayRoot = getElementRoot(lastOverlay);\n\n if (!overlayRoot.contains(target)) {\n return;\n }\n\n const overlayWrapper = overlayRoot.querySelector('.ion-overlay-wrapper');\n\n if (!overlayWrapper) {\n return;\n }\n /**\n * If the target is inside the wrapper, let the browser\n * focus as normal and keep a log of the last focused element.\n */\n\n\n if (overlayWrapper.contains(target)) {\n lastOverlay.lastFocus = target;\n } else {\n /**\n * Otherwise, we must have focused one of the focus traps.\n * We need to wrap the focus to either the first element\n * or the last element.\n */\n\n /**\n * Once we call `focusFirstDescendant` and focus the first\n * descendant, another focus event will fire which will\n * cause `lastOverlay.lastFocus` to be updated before\n * we can run the code after that. We will cache the value\n * here to avoid that.\n */\n const lastFocus = lastOverlay.lastFocus; // Focus the first element in the overlay wrapper\n\n focusFirstDescendant(overlayWrapper, lastOverlay);\n /**\n * If the cached last focused element is the\n * same as the active element, then we need\n * to wrap focus to the last descendant. This happens\n * when the first descendant is focused, and the user\n * presses Shift + Tab. The previous line will focus\n * the same descendant again (the first one), causing\n * last focus to equal the active element.\n */\n\n if (lastFocus === doc.activeElement) {\n focusLastDescendant(overlayWrapper, lastOverlay);\n }\n\n lastOverlay.lastFocus = doc.activeElement;\n }\n }\n };\n\n const trapShadowFocus = () => {\n /**\n * If the target is inside the wrapper, let the browser\n * focus as normal and keep a log of the last focused element.\n */\n if (lastOverlay.contains(target)) {\n lastOverlay.lastFocus = target;\n } else {\n /**\n * Otherwise, we are about to have focus\n * go out of the overlay. We need to wrap\n * the focus to either the first element\n * or the last element.\n */\n\n /**\n * Once we call `focusFirstDescendant` and focus the first\n * descendant, another focus event will fire which will\n * cause `lastOverlay.lastFocus` to be updated before\n * we can run the code after that. We will cache the value\n * here to avoid that.\n */\n const lastFocus = lastOverlay.lastFocus; // Focus the first element in the overlay wrapper\n\n focusFirstDescendant(lastOverlay, lastOverlay);\n /**\n * If the cached last focused element is the\n * same as the active element, then we need\n * to wrap focus to the last descendant. This happens\n * when the first descendant is focused, and the user\n * presses Shift + Tab. The previous line will focus\n * the same descendant again (the first one), causing\n * last focus to equal the active element.\n */\n\n if (lastFocus === doc.activeElement) {\n focusLastDescendant(lastOverlay, lastOverlay);\n }\n\n lastOverlay.lastFocus = doc.activeElement;\n }\n };\n\n if (lastOverlay.shadowRoot) {\n trapShadowFocus();\n } else {\n trapScopedFocus();\n }\n};\n\nconst connectListeners = doc => {\n if (lastId === 0) {\n lastId = 1;\n doc.addEventListener('focus', ev => {\n trapKeyboardFocus(ev, doc);\n }, true); // handle back-button click\n\n doc.addEventListener('ionBackButton', ev => {\n const lastOverlay = getOverlay(doc);\n\n if (lastOverlay === null || lastOverlay === void 0 ? void 0 : lastOverlay.backdropDismiss) {\n ev.detail.register(OVERLAY_BACK_BUTTON_PRIORITY, () => {\n return lastOverlay.dismiss(undefined, BACKDROP);\n });\n }\n }); // handle ESC to close overlay\n\n doc.addEventListener('keyup', ev => {\n if (ev.key === 'Escape') {\n const lastOverlay = getOverlay(doc);\n\n if (lastOverlay === null || lastOverlay === void 0 ? void 0 : lastOverlay.backdropDismiss) {\n lastOverlay.dismiss(undefined, BACKDROP);\n }\n }\n });\n }\n};\n\nconst dismissOverlay = (doc, data, role, overlayTag, id) => {\n const overlay = getOverlay(doc, overlayTag, id);\n\n if (!overlay) {\n return Promise.reject('overlay does not exist');\n }\n\n return overlay.dismiss(data, role);\n};\n\nconst getOverlays = (doc, selector) => {\n if (selector === undefined) {\n selector = 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast';\n }\n\n return Array.from(doc.querySelectorAll(selector)).filter(c => c.overlayIndex > 0);\n};\n/**\n * Returns an overlay element\n * @param doc The document to find the element within.\n * @param overlayTag The selector for the overlay, defaults to Ionic overlay components.\n * @param id The unique identifier for the overlay instance.\n * @returns The overlay element or `undefined` if no overlay element is found.\n */\n\n\nconst getOverlay = (doc, overlayTag, id) => {\n const overlays = getOverlays(doc, overlayTag).filter(o => !isOverlayHidden(o));\n return id === undefined ? overlays[overlays.length - 1] : overlays.find(o => o.id === id);\n};\n/**\n * When an overlay is presented, the main\n * focus is the overlay not the page content.\n * We need to remove the page content from the\n * accessibility tree otherwise when\n * users use \"read screen from top\" gestures with\n * TalkBack and VoiceOver, the screen reader will begin\n * to read the content underneath the overlay.\n *\n * We need a container where all page components\n * exist that is separate from where the overlays\n * are added in the DOM. For most apps, this element\n * is the top most ion-router-outlet. In the event\n * that devs are not using a router,\n * they will need to add the \"ion-view-container-root\"\n * id to the element that contains all of their views.\n *\n * TODO: If Framework supports having multiple top\n * level router outlets we would need to update this.\n * Example: One outlet for side menu and one outlet\n * for main content.\n */\n\n\nconst setRootAriaHidden = (hidden = false) => {\n const root = getAppRoot(document);\n const viewContainer = root.querySelector('ion-router-outlet, ion-nav, #ion-view-container-root');\n\n if (!viewContainer) {\n return;\n }\n\n if (hidden) {\n viewContainer.setAttribute('aria-hidden', 'true');\n } else {\n viewContainer.removeAttribute('aria-hidden');\n }\n};\n\nconst present = /*#__PURE__*/function () {\n var _ref = _asyncToGenerator(function* (overlay, name, iosEnterAnimation, mdEnterAnimation, opts) {\n var _a, _b;\n\n if (overlay.presented) {\n return;\n }\n\n setRootAriaHidden(true);\n overlay.presented = true;\n overlay.willPresent.emit();\n (_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();\n const mode = getIonMode(overlay); // get the user's animation fn if one was provided\n\n const animationBuilder = overlay.enterAnimation ? overlay.enterAnimation : config.get(name, mode === 'ios' ? iosEnterAnimation : mdEnterAnimation);\n const completed = yield overlayAnimation(overlay, animationBuilder, overlay.el, opts);\n\n if (completed) {\n overlay.didPresent.emit();\n (_b = overlay.didPresentShorthand) === null || _b === void 0 ? void 0 : _b.emit();\n }\n /**\n * When an overlay that steals focus\n * is dismissed, focus should be returned\n * to the element that was focused\n * prior to the overlay opening. Toast\n * does not steal focus and is excluded\n * from returning focus as a result.\n */\n\n\n if (overlay.el.tagName !== 'ION-TOAST') {\n focusPreviousElementOnDismiss(overlay.el);\n }\n /**\n * If the focused element is already\n * inside the overlay component then\n * focus should not be moved from that\n * to the overlay container.\n */\n\n\n if (overlay.keyboardClose && (document.activeElement === null || !overlay.el.contains(document.activeElement))) {\n overlay.el.focus();\n }\n });\n\n return function present(_x, _x2, _x3, _x4, _x5) {\n return _ref.apply(this, arguments);\n };\n}();\n/**\n * When an overlay component is dismissed,\n * focus should be returned to the element\n * that presented the overlay. Otherwise\n * focus will be set on the body which\n * means that people using screen readers\n * or tabbing will need to re-navigate\n * to where they were before they\n * opened the overlay.\n */\n\n\nconst focusPreviousElementOnDismiss = /*#__PURE__*/function () {\n var _ref2 = _asyncToGenerator(function* (overlayEl) {\n let previousElement = document.activeElement;\n\n if (!previousElement) {\n return;\n }\n\n const shadowRoot = previousElement === null || previousElement === void 0 ? void 0 : previousElement.shadowRoot;\n\n if (shadowRoot) {\n // If there are no inner focusable elements, just focus the host element.\n previousElement = shadowRoot.querySelector(focusableQueryString) || previousElement;\n }\n\n yield overlayEl.onDidDismiss();\n previousElement.focus();\n });\n\n return function focusPreviousElementOnDismiss(_x6) {\n return _ref2.apply(this, arguments);\n };\n}();\n\nconst dismiss = /*#__PURE__*/function () {\n var _ref3 = _asyncToGenerator(function* (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnimation, opts) {\n var _a, _b;\n\n if (!overlay.presented) {\n return false;\n }\n\n setRootAriaHidden(false);\n overlay.presented = false;\n\n try {\n // Overlay contents should not be clickable during dismiss\n overlay.el.style.setProperty('pointer-events', 'none');\n overlay.willDismiss.emit({\n data,\n role\n });\n (_a = overlay.willDismissShorthand) === null || _a === void 0 ? void 0 : _a.emit({\n data,\n role\n });\n const mode = getIonMode(overlay);\n const animationBuilder = overlay.leaveAnimation ? overlay.leaveAnimation : config.get(name, mode === 'ios' ? iosLeaveAnimation : mdLeaveAnimation); // If dismissed via gesture, no need to play leaving animation again\n\n if (role !== 'gesture') {\n yield overlayAnimation(overlay, animationBuilder, overlay.el, opts);\n }\n\n overlay.didDismiss.emit({\n data,\n role\n });\n (_b = overlay.didDismissShorthand) === null || _b === void 0 ? void 0 : _b.emit({\n data,\n role\n });\n activeAnimations.delete(overlay);\n /**\n * Make overlay hidden again in case it is being reused.\n * We can safely remove pointer-events: none as\n * overlay-hidden will set display: none.\n */\n\n overlay.el.classList.add('overlay-hidden');\n overlay.el.style.removeProperty('pointer-events');\n } catch (err) {\n console.error(err);\n }\n\n overlay.el.remove();\n return true;\n });\n\n return function dismiss(_x7, _x8, _x9, _x10, _x11, _x12, _x13) {\n return _ref3.apply(this, arguments);\n };\n}();\n\nconst getAppRoot = doc => {\n return doc.querySelector('ion-app') || doc.body;\n};\n\nconst overlayAnimation = /*#__PURE__*/function () {\n var _ref4 = _asyncToGenerator(function* (overlay, animationBuilder, baseEl, opts) {\n // Make overlay visible in case it's hidden\n baseEl.classList.remove('overlay-hidden');\n const aniRoot = overlay.el;\n const animation = animationBuilder(aniRoot, opts);\n\n if (!overlay.animated || !config.getBoolean('animated', true)) {\n animation.duration(0);\n }\n\n if (overlay.keyboardClose) {\n animation.beforeAddWrite(() => {\n const activeElement = baseEl.ownerDocument.activeElement;\n\n if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.matches('input,ion-input, ion-textarea')) {\n activeElement.blur();\n }\n });\n }\n\n const activeAni = activeAnimations.get(overlay) || [];\n activeAnimations.set(overlay, [...activeAni, animation]);\n yield animation.play();\n return true;\n });\n\n return function overlayAnimation(_x14, _x15, _x16, _x17) {\n return _ref4.apply(this, arguments);\n };\n}();\n\nconst eventMethod = (element, eventName) => {\n let resolve;\n const promise = new Promise(r => resolve = r);\n onceEvent(element, eventName, event => {\n resolve(event.detail);\n });\n return promise;\n};\n\nconst onceEvent = (element, eventName, callback) => {\n const handler = ev => {\n removeEventListener(element, eventName, handler);\n callback(ev);\n };\n\n addEventListener(element, eventName, handler);\n};\n\nconst isCancel = role => {\n return role === 'cancel' || role === BACKDROP;\n};\n\nconst defaultGate = h => h();\n/**\n * Calls a developer provided method while avoiding\n * Angular Zones. Since the handler is provided by\n * the developer, we should throw any errors\n * received so that developer-provided bug\n * tracking software can log it.\n */\n\n\nconst safeCall = (handler, arg) => {\n if (typeof handler === 'function') {\n const jmp = config.get('_zoneGate', defaultGate);\n return jmp(() => {\n try {\n return handler(arg);\n } catch (e) {\n throw e;\n }\n });\n }\n\n return undefined;\n};\n\nconst BACKDROP = 'backdrop';\nexport { BACKDROP as B, alertController as a, actionSheetController as b, popoverController as c, present as d, prepareOverlay as e, dismiss as f, eventMethod as g, activeAnimations as h, isCancel as i, focusFirstDescendant as j, getOverlay as k, loadingController as l, modalController as m, pickerController as p, safeCall as s, toastController as t };","map":{"version":3,"names":["b","getIonMode","c","config","OVERLAY_BACK_BUTTON_PRIORITY","componentOnReady","f","focusElement","a","addEventListener","removeEventListener","g","getElementRoot","lastId","activeAnimations","WeakMap","createController","tagName","create","options","createOverlay","dismiss","data","role","id","dismissOverlay","document","getTop","getOverlay","alertController","actionSheetController","loadingController","modalController","pickerController","popoverController","toastController","prepareOverlay","el","connectListeners","overlayIndex","hasAttribute","opts","window","customElements","whenDefined","then","element","createElement","classList","add","Object","assign","hasController","getAppRoot","appendChild","Promise","resolve","focusableQueryString","focusFirstDescendant","ref","overlay","firstInput","querySelector","shadowRoot","focus","isOverlayHidden","contains","focusLastDescendant","inputs","Array","from","querySelectorAll","lastInput","length","trapKeyboardFocus","ev","doc","lastOverlay","target","trapScopedFocus","lastFocus","undefined","overlayRoot","overlayWrapper","activeElement","trapShadowFocus","backdropDismiss","detail","register","BACKDROP","key","overlayTag","reject","getOverlays","selector","filter","overlays","o","find","setRootAriaHidden","hidden","root","viewContainer","setAttribute","removeAttribute","present","name","iosEnterAnimation","mdEnterAnimation","_a","_b","presented","willPresent","emit","willPresentShorthand","mode","animationBuilder","enterAnimation","get","completed","overlayAnimation","didPresent","didPresentShorthand","focusPreviousElementOnDismiss","keyboardClose","overlayEl","previousElement","onDidDismiss","iosLeaveAnimation","mdLeaveAnimation","style","setProperty","willDismiss","willDismissShorthand","leaveAnimation","didDismiss","didDismissShorthand","delete","removeProperty","err","console","error","remove","body","baseEl","aniRoot","animation","animated","getBoolean","duration","beforeAddWrite","ownerDocument","matches","blur","activeAni","set","play","eventMethod","eventName","promise","r","onceEvent","event","callback","handler","isCancel","defaultGate","h","safeCall","arg","jmp","e","B","d","i","j","k","l","m","p","s","t"],"sources":["D:/MobileDev/WRB/WrenchBoard2023a/node_modules/@ionic/core/dist/esm/overlays-f469834d.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { b as getIonMode, c as config } from './ionic-global-04e268e7.js';\nimport { OVERLAY_BACK_BUTTON_PRIORITY } from './hardware-back-button-490df115.js';\nimport { c as componentOnReady, f as focusElement, a as addEventListener, b as removeEventListener, g as getElementRoot } from './helpers-4d272360.js';\n\nlet lastId = 0;\nconst activeAnimations = new WeakMap();\nconst createController = (tagName) => {\n return {\n create(options) {\n return createOverlay(tagName, options);\n },\n dismiss(data, role, id) {\n return dismissOverlay(document, data, role, tagName, id);\n },\n async getTop() {\n return getOverlay(document, tagName);\n },\n };\n};\nconst alertController = /*@__PURE__*/ createController('ion-alert');\nconst actionSheetController = /*@__PURE__*/ createController('ion-action-sheet');\nconst loadingController = /*@__PURE__*/ createController('ion-loading');\nconst modalController = /*@__PURE__*/ createController('ion-modal');\nconst pickerController = /*@__PURE__*/ createController('ion-picker');\nconst popoverController = /*@__PURE__*/ createController('ion-popover');\nconst toastController = /*@__PURE__*/ createController('ion-toast');\nconst prepareOverlay = (el) => {\n if (typeof document !== 'undefined') {\n connectListeners(document);\n }\n const overlayIndex = lastId++;\n el.overlayIndex = overlayIndex;\n if (!el.hasAttribute('id')) {\n el.id = `ion-overlay-${overlayIndex}`;\n }\n};\nconst createOverlay = (tagName, opts) => {\n if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined') {\n return window.customElements.whenDefined(tagName).then(() => {\n const element = document.createElement(tagName);\n element.classList.add('overlay-hidden');\n /**\n * Convert the passed in overlay options into props\n * that get passed down into the new overlay.\n */\n Object.assign(element, Object.assign(Object.assign({}, opts), { hasController: true }));\n // append the overlay element to the document body\n getAppRoot(document).appendChild(element);\n return new Promise((resolve) => componentOnReady(element, resolve));\n });\n }\n return Promise.resolve();\n};\nconst focusableQueryString = '[tabindex]:not([tabindex^=\"-\"]), input:not([type=hidden]):not([tabindex^=\"-\"]), textarea:not([tabindex^=\"-\"]), button:not([tabindex^=\"-\"]), select:not([tabindex^=\"-\"]), .ion-focusable:not([tabindex^=\"-\"])';\nconst focusFirstDescendant = (ref, overlay) => {\n let firstInput = ref.querySelector(focusableQueryString);\n const shadowRoot = firstInput === null || firstInput === void 0 ? void 0 : firstInput.shadowRoot;\n if (shadowRoot) {\n // If there are no inner focusable elements, just focus the host element.\n firstInput = shadowRoot.querySelector(focusableQueryString) || firstInput;\n }\n if (firstInput) {\n focusElement(firstInput);\n }\n else {\n // Focus overlay instead of letting focus escape\n overlay.focus();\n }\n};\nconst isOverlayHidden = (overlay) => overlay.classList.contains('overlay-hidden');\nconst focusLastDescendant = (ref, overlay) => {\n const inputs = Array.from(ref.querySelectorAll(focusableQueryString));\n let lastInput = inputs.length > 0 ? inputs[inputs.length - 1] : null;\n const shadowRoot = lastInput === null || lastInput === void 0 ? void 0 : lastInput.shadowRoot;\n if (shadowRoot) {\n // If there are no inner focusable elements, just focus the host element.\n lastInput = shadowRoot.querySelector(focusableQueryString) || lastInput;\n }\n if (lastInput) {\n lastInput.focus();\n }\n else {\n // Focus overlay instead of letting focus escape\n overlay.focus();\n }\n};\n/**\n * Traps keyboard focus inside of overlay components.\n * Based on https://w3c.github.io/aria-practices/examples/dialog-modal/alertdialog.html\n * This includes the following components: Action Sheet, Alert, Loading, Modal,\n * Picker, and Popover.\n * Should NOT include: Toast\n */\nconst trapKeyboardFocus = (ev, doc) => {\n const lastOverlay = getOverlay(doc, 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover');\n const target = ev.target;\n /**\n * If no active overlay, ignore this event.\n *\n * If this component uses the shadow dom,\n * this global listener is pointless\n * since it will not catch the focus\n * traps as they are inside the shadow root.\n * We need to add a listener to the shadow root\n * itself to ensure the focus trap works.\n */\n if (!lastOverlay || !target) {\n return;\n }\n /**\n * If the ion-disable-focus-trap class\n * is present on an overlay, then this component\n * instance has opted out of focus trapping.\n * An example of this is when the sheet modal\n * has a backdrop that is disabled. The content\n * behind the sheet should be focusable until\n * the backdrop is enabled.\n */\n if (lastOverlay.classList.contains('ion-disable-focus-trap')) {\n return;\n }\n const trapScopedFocus = () => {\n /**\n * If we are focusing the overlay, clear\n * the last focused element so that hitting\n * tab activates the first focusable element\n * in the overlay wrapper.\n */\n if (lastOverlay === target) {\n lastOverlay.lastFocus = undefined;\n /**\n * Otherwise, we must be focusing an element\n * inside of the overlay. The two possible options\n * here are an input/button/etc or the ion-focus-trap\n * element. The focus trap element is used to prevent\n * the keyboard focus from leaving the overlay when\n * using Tab or screen assistants.\n */\n }\n else {\n /**\n * We do not want to focus the traps, so get the overlay\n * wrapper element as the traps live outside of the wrapper.\n */\n const overlayRoot = getElementRoot(lastOverlay);\n if (!overlayRoot.contains(target)) {\n return;\n }\n const overlayWrapper = overlayRoot.querySelector('.ion-overlay-wrapper');\n if (!overlayWrapper) {\n return;\n }\n /**\n * If the target is inside the wrapper, let the browser\n * focus as normal and keep a log of the last focused element.\n */\n if (overlayWrapper.contains(target)) {\n lastOverlay.lastFocus = target;\n }\n else {\n /**\n * Otherwise, we must have focused one of the focus traps.\n * We need to wrap the focus to either the first element\n * or the last element.\n */\n /**\n * Once we call `focusFirstDescendant` and focus the first\n * descendant, another focus event will fire which will\n * cause `lastOverlay.lastFocus` to be updated before\n * we can run the code after that. We will cache the value\n * here to avoid that.\n */\n const lastFocus = lastOverlay.lastFocus;\n // Focus the first element in the overlay wrapper\n focusFirstDescendant(overlayWrapper, lastOverlay);\n /**\n * If the cached last focused element is the\n * same as the active element, then we need\n * to wrap focus to the last descendant. This happens\n * when the first descendant is focused, and the user\n * presses Shift + Tab. The previous line will focus\n * the same descendant again (the first one), causing\n * last focus to equal the active element.\n */\n if (lastFocus === doc.activeElement) {\n focusLastDescendant(overlayWrapper, lastOverlay);\n }\n lastOverlay.lastFocus = doc.activeElement;\n }\n }\n };\n const trapShadowFocus = () => {\n /**\n * If the target is inside the wrapper, let the browser\n * focus as normal and keep a log of the last focused element.\n */\n if (lastOverlay.contains(target)) {\n lastOverlay.lastFocus = target;\n }\n else {\n /**\n * Otherwise, we are about to have focus\n * go out of the overlay. We need to wrap\n * the focus to either the first element\n * or the last element.\n */\n /**\n * Once we call `focusFirstDescendant` and focus the first\n * descendant, another focus event will fire which will\n * cause `lastOverlay.lastFocus` to be updated before\n * we can run the code after that. We will cache the value\n * here to avoid that.\n */\n const lastFocus = lastOverlay.lastFocus;\n // Focus the first element in the overlay wrapper\n focusFirstDescendant(lastOverlay, lastOverlay);\n /**\n * If the cached last focused element is the\n * same as the active element, then we need\n * to wrap focus to the last descendant. This happens\n * when the first descendant is focused, and the user\n * presses Shift + Tab. The previous line will focus\n * the same descendant again (the first one), causing\n * last focus to equal the active element.\n */\n if (lastFocus === doc.activeElement) {\n focusLastDescendant(lastOverlay, lastOverlay);\n }\n lastOverlay.lastFocus = doc.activeElement;\n }\n };\n if (lastOverlay.shadowRoot) {\n trapShadowFocus();\n }\n else {\n trapScopedFocus();\n }\n};\nconst connectListeners = (doc) => {\n if (lastId === 0) {\n lastId = 1;\n doc.addEventListener('focus', (ev) => {\n trapKeyboardFocus(ev, doc);\n }, true);\n // handle back-button click\n doc.addEventListener('ionBackButton', (ev) => {\n const lastOverlay = getOverlay(doc);\n if (lastOverlay === null || lastOverlay === void 0 ? void 0 : lastOverlay.backdropDismiss) {\n ev.detail.register(OVERLAY_BACK_BUTTON_PRIORITY, () => {\n return lastOverlay.dismiss(undefined, BACKDROP);\n });\n }\n });\n // handle ESC to close overlay\n doc.addEventListener('keyup', (ev) => {\n if (ev.key === 'Escape') {\n const lastOverlay = getOverlay(doc);\n if (lastOverlay === null || lastOverlay === void 0 ? void 0 : lastOverlay.backdropDismiss) {\n lastOverlay.dismiss(undefined, BACKDROP);\n }\n }\n });\n }\n};\nconst dismissOverlay = (doc, data, role, overlayTag, id) => {\n const overlay = getOverlay(doc, overlayTag, id);\n if (!overlay) {\n return Promise.reject('overlay does not exist');\n }\n return overlay.dismiss(data, role);\n};\nconst getOverlays = (doc, selector) => {\n if (selector === undefined) {\n selector = 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast';\n }\n return Array.from(doc.querySelectorAll(selector)).filter((c) => c.overlayIndex > 0);\n};\n/**\n * Returns an overlay element\n * @param doc The document to find the element within.\n * @param overlayTag The selector for the overlay, defaults to Ionic overlay components.\n * @param id The unique identifier for the overlay instance.\n * @returns The overlay element or `undefined` if no overlay element is found.\n */\nconst getOverlay = (doc, overlayTag, id) => {\n const overlays = getOverlays(doc, overlayTag).filter((o) => !isOverlayHidden(o));\n return id === undefined ? overlays[overlays.length - 1] : overlays.find((o) => o.id === id);\n};\n/**\n * When an overlay is presented, the main\n * focus is the overlay not the page content.\n * We need to remove the page content from the\n * accessibility tree otherwise when\n * users use \"read screen from top\" gestures with\n * TalkBack and VoiceOver, the screen reader will begin\n * to read the content underneath the overlay.\n *\n * We need a container where all page components\n * exist that is separate from where the overlays\n * are added in the DOM. For most apps, this element\n * is the top most ion-router-outlet. In the event\n * that devs are not using a router,\n * they will need to add the \"ion-view-container-root\"\n * id to the element that contains all of their views.\n *\n * TODO: If Framework supports having multiple top\n * level router outlets we would need to update this.\n * Example: One outlet for side menu and one outlet\n * for main content.\n */\nconst setRootAriaHidden = (hidden = false) => {\n const root = getAppRoot(document);\n const viewContainer = root.querySelector('ion-router-outlet, ion-nav, #ion-view-container-root');\n if (!viewContainer) {\n return;\n }\n if (hidden) {\n viewContainer.setAttribute('aria-hidden', 'true');\n }\n else {\n viewContainer.removeAttribute('aria-hidden');\n }\n};\nconst present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts) => {\n var _a, _b;\n if (overlay.presented) {\n return;\n }\n setRootAriaHidden(true);\n overlay.presented = true;\n overlay.willPresent.emit();\n (_a = overlay.willPresentShorthand) === null || _a === void 0 ? void 0 : _a.emit();\n const mode = getIonMode(overlay);\n // get the user's animation fn if one was provided\n const animationBuilder = overlay.enterAnimation\n ? overlay.enterAnimation\n : config.get(name, mode === 'ios' ? iosEnterAnimation : mdEnterAnimation);\n const completed = await overlayAnimation(overlay, animationBuilder, overlay.el, opts);\n if (completed) {\n overlay.didPresent.emit();\n (_b = overlay.didPresentShorthand) === null || _b === void 0 ? void 0 : _b.emit();\n }\n /**\n * When an overlay that steals focus\n * is dismissed, focus should be returned\n * to the element that was focused\n * prior to the overlay opening. Toast\n * does not steal focus and is excluded\n * from returning focus as a result.\n */\n if (overlay.el.tagName !== 'ION-TOAST') {\n focusPreviousElementOnDismiss(overlay.el);\n }\n /**\n * If the focused element is already\n * inside the overlay component then\n * focus should not be moved from that\n * to the overlay container.\n */\n if (overlay.keyboardClose && (document.activeElement === null || !overlay.el.contains(document.activeElement))) {\n overlay.el.focus();\n }\n};\n/**\n * When an overlay component is dismissed,\n * focus should be returned to the element\n * that presented the overlay. Otherwise\n * focus will be set on the body which\n * means that people using screen readers\n * or tabbing will need to re-navigate\n * to where they were before they\n * opened the overlay.\n */\nconst focusPreviousElementOnDismiss = async (overlayEl) => {\n let previousElement = document.activeElement;\n if (!previousElement) {\n return;\n }\n const shadowRoot = previousElement === null || previousElement === void 0 ? void 0 : previousElement.shadowRoot;\n if (shadowRoot) {\n // If there are no inner focusable elements, just focus the host element.\n previousElement = shadowRoot.querySelector(focusableQueryString) || previousElement;\n }\n await overlayEl.onDidDismiss();\n previousElement.focus();\n};\nconst dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnimation, opts) => {\n var _a, _b;\n if (!overlay.presented) {\n return false;\n }\n setRootAriaHidden(false);\n overlay.presented = false;\n try {\n // Overlay contents should not be clickable during dismiss\n overlay.el.style.setProperty('pointer-events', 'none');\n overlay.willDismiss.emit({ data, role });\n (_a = overlay.willDismissShorthand) === null || _a === void 0 ? void 0 : _a.emit({ data, role });\n const mode = getIonMode(overlay);\n const animationBuilder = overlay.leaveAnimation\n ? overlay.leaveAnimation\n : config.get(name, mode === 'ios' ? iosLeaveAnimation : mdLeaveAnimation);\n // If dismissed via gesture, no need to play leaving animation again\n if (role !== 'gesture') {\n await overlayAnimation(overlay, animationBuilder, overlay.el, opts);\n }\n overlay.didDismiss.emit({ data, role });\n (_b = overlay.didDismissShorthand) === null || _b === void 0 ? void 0 : _b.emit({ data, role });\n activeAnimations.delete(overlay);\n /**\n * Make overlay hidden again in case it is being reused.\n * We can safely remove pointer-events: none as\n * overlay-hidden will set display: none.\n */\n overlay.el.classList.add('overlay-hidden');\n overlay.el.style.removeProperty('pointer-events');\n }\n catch (err) {\n console.error(err);\n }\n overlay.el.remove();\n return true;\n};\nconst getAppRoot = (doc) => {\n return doc.querySelector('ion-app') || doc.body;\n};\nconst overlayAnimation = async (overlay, animationBuilder, baseEl, opts) => {\n // Make overlay visible in case it's hidden\n baseEl.classList.remove('overlay-hidden');\n const aniRoot = overlay.el;\n const animation = animationBuilder(aniRoot, opts);\n if (!overlay.animated || !config.getBoolean('animated', true)) {\n animation.duration(0);\n }\n if (overlay.keyboardClose) {\n animation.beforeAddWrite(() => {\n const activeElement = baseEl.ownerDocument.activeElement;\n if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.matches('input,ion-input, ion-textarea')) {\n activeElement.blur();\n }\n });\n }\n const activeAni = activeAnimations.get(overlay) || [];\n activeAnimations.set(overlay, [...activeAni, animation]);\n await animation.play();\n return true;\n};\nconst eventMethod = (element, eventName) => {\n let resolve;\n const promise = new Promise((r) => (resolve = r));\n onceEvent(element, eventName, (event) => {\n resolve(event.detail);\n });\n return promise;\n};\nconst onceEvent = (element, eventName, callback) => {\n const handler = (ev) => {\n removeEventListener(element, eventName, handler);\n callback(ev);\n };\n addEventListener(element, eventName, handler);\n};\nconst isCancel = (role) => {\n return role === 'cancel' || role === BACKDROP;\n};\nconst defaultGate = (h) => h();\n/**\n * Calls a developer provided method while avoiding\n * Angular Zones. Since the handler is provided by\n * the developer, we should throw any errors\n * received so that developer-provided bug\n * tracking software can log it.\n */\nconst safeCall = (handler, arg) => {\n if (typeof handler === 'function') {\n const jmp = config.get('_zoneGate', defaultGate);\n return jmp(() => {\n try {\n return handler(arg);\n }\n catch (e) {\n throw e;\n }\n });\n }\n return undefined;\n};\nconst BACKDROP = 'backdrop';\n\nexport { BACKDROP as B, alertController as a, actionSheetController as b, popoverController as c, present as d, prepareOverlay as e, dismiss as f, eventMethod as g, activeAnimations as h, isCancel as i, focusFirstDescendant as j, getOverlay as k, loadingController as l, modalController as m, pickerController as p, safeCall as s, toastController as t };\n"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,CAAC,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