{"version":3,"file":"sweetalert2.a6de33ca.js","sources":["../../../node_modules/sweetalert2/dist/sweetalert2.all.js"],"sourcesContent":["/*!\n* sweetalert2 v11.4.35\n* Released under the MIT License.\n*/\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Sweetalert2 = factory());\n}(this, function () { 'use strict';\n\n /**\n * This module contains `WeakMap`s for each effectively-\"private property\" that a `Swal` has.\n * For example, to set the private property \"foo\" of `this` to \"bar\", you can `privateProps.foo.set(this, 'bar')`\n * This is the approach that Babel will probably take to implement private methods/fields\n * https://github.com/tc39/proposal-private-methods\n * https://github.com/babel/babel/pull/7555\n * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*\n * then we can use that language feature.\n */\n var privateProps = {\n awaitingPromise: new WeakMap(),\n promise: new WeakMap(),\n innerParams: new WeakMap(),\n domCache: new WeakMap()\n };\n\n const swalPrefix = 'swal2-';\n /**\n * @param {string[]} items\n * @returns {object}\n */\n\n const prefix = items => {\n const result = {};\n\n for (const i in items) {\n result[items[i]] = swalPrefix + items[i];\n }\n\n return result;\n };\n const swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'no-transition', 'toast', 'toast-shown', 'show', 'hide', 'close', 'title', 'html-container', 'actions', 'confirm', 'deny', 'cancel', 'default-outline', 'footer', 'icon', 'icon-content', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'input-label', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loader', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl', 'timer-progress-bar', 'timer-progress-bar-container', 'scrollbar-measure', 'icon-success', 'icon-warning', 'icon-info', 'icon-question', 'icon-error', 'no-war']);\n const iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']);\n\n const consolePrefix = 'SweetAlert2:';\n /**\n * Filter the unique values into a new array\n *\n * @param {Array} arr\n * @returns {Array}\n */\n\n const uniqueArray = arr => {\n const result = [];\n\n for (let i = 0; i < arr.length; i++) {\n if (result.indexOf(arr[i]) === -1) {\n result.push(arr[i]);\n }\n }\n\n return result;\n };\n /**\n * Capitalize the first letter of a string\n *\n * @param {string} str\n * @returns {string}\n */\n\n const capitalizeFirstLetter = str => str.charAt(0).toUpperCase() + str.slice(1);\n /**\n * Standardize console warnings\n *\n * @param {string | Array} message\n */\n\n const warn = message => {\n console.warn(\"\".concat(consolePrefix, \" \").concat(typeof message === 'object' ? message.join(' ') : message));\n };\n /**\n * Standardize console errors\n *\n * @param {string} message\n */\n\n const error = message => {\n console.error(\"\".concat(consolePrefix, \" \").concat(message));\n };\n /**\n * Private global state for `warnOnce`\n *\n * @type {Array}\n * @private\n */\n\n const previousWarnOnceMessages = [];\n /**\n * Show a console warning, but only if it hasn't already been shown\n *\n * @param {string} message\n */\n\n const warnOnce = message => {\n if (!previousWarnOnceMessages.includes(message)) {\n previousWarnOnceMessages.push(message);\n warn(message);\n }\n };\n /**\n * Show a one-time console warning about deprecated params/methods\n *\n * @param {string} deprecatedParam\n * @param {string} useInstead\n */\n\n const warnAboutDeprecation = (deprecatedParam, useInstead) => {\n warnOnce(\"\\\"\".concat(deprecatedParam, \"\\\" is deprecated and will be removed in the next major release. Please use \\\"\").concat(useInstead, \"\\\" instead.\"));\n };\n /**\n * If `arg` is a function, call it (with no arguments or context) and return the result.\n * Otherwise, just pass the value through\n *\n * @param {Function | any} arg\n * @returns {any}\n */\n\n const callIfFunction = arg => typeof arg === 'function' ? arg() : arg;\n /**\n * @param {any} arg\n * @returns {boolean}\n */\n\n const hasToPromiseFn = arg => arg && typeof arg.toPromise === 'function';\n /**\n * @param {any} arg\n * @returns {Promise}\n */\n\n const asPromise = arg => hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg);\n /**\n * @param {any} arg\n * @returns {boolean}\n */\n\n const isPromise = arg => arg && Promise.resolve(arg) === arg;\n /**\n * @param {Array} arr\n * @returns {any}\n */\n\n const getRandomElement = arr => arr[Math.floor(Math.random() * arr.length)];\n\n /**\n * Gets the popup container which contains the backdrop and the popup itself.\n *\n * @returns {HTMLElement | null}\n */\n\n const getContainer = () => document.body.querySelector(\".\".concat(swalClasses.container));\n /**\n * @param {string} selectorString\n * @returns {HTMLElement | null}\n */\n\n const elementBySelector = selectorString => {\n const container = getContainer();\n return container ? container.querySelector(selectorString) : null;\n };\n /**\n * @param {string} className\n * @returns {HTMLElement | null}\n */\n\n const elementByClass = className => {\n return elementBySelector(\".\".concat(className));\n };\n /**\n * @returns {HTMLElement | null}\n */\n\n\n const getPopup = () => elementByClass(swalClasses.popup);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getIcon = () => elementByClass(swalClasses.icon);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getTitle = () => elementByClass(swalClasses.title);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getHtmlContainer = () => elementByClass(swalClasses['html-container']);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getImage = () => elementByClass(swalClasses.image);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getProgressSteps = () => elementByClass(swalClasses['progress-steps']);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getValidationMessage = () => elementByClass(swalClasses['validation-message']);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getConfirmButton = () => elementBySelector(\".\".concat(swalClasses.actions, \" .\").concat(swalClasses.confirm));\n /**\n * @returns {HTMLElement | null}\n */\n\n const getDenyButton = () => elementBySelector(\".\".concat(swalClasses.actions, \" .\").concat(swalClasses.deny));\n /**\n * @returns {HTMLElement | null}\n */\n\n const getInputLabel = () => elementByClass(swalClasses['input-label']);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getLoader = () => elementBySelector(\".\".concat(swalClasses.loader));\n /**\n * @returns {HTMLElement | null}\n */\n\n const getCancelButton = () => elementBySelector(\".\".concat(swalClasses.actions, \" .\").concat(swalClasses.cancel));\n /**\n * @returns {HTMLElement | null}\n */\n\n const getActions = () => elementByClass(swalClasses.actions);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getFooter = () => elementByClass(swalClasses.footer);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getTimerProgressBar = () => elementByClass(swalClasses['timer-progress-bar']);\n /**\n * @returns {HTMLElement | null}\n */\n\n const getCloseButton = () => elementByClass(swalClasses.close); // https://github.com/jkup/focusable/blob/master/index.js\n\n const focusable = \"\\n a[href],\\n area[href],\\n input:not([disabled]),\\n select:not([disabled]),\\n textarea:not([disabled]),\\n button:not([disabled]),\\n iframe,\\n object,\\n embed,\\n [tabindex=\\\"0\\\"],\\n [contenteditable],\\n audio[controls],\\n video[controls],\\n summary\\n\";\n /**\n * @returns {HTMLElement[]}\n */\n\n const getFocusableElements = () => {\n const focusableElementsWithTabindex = Array.from(getPopup().querySelectorAll('[tabindex]:not([tabindex=\"-1\"]):not([tabindex=\"0\"])')) // sort according to tabindex\n .sort((a, b) => {\n const tabindexA = parseInt(a.getAttribute('tabindex'));\n const tabindexB = parseInt(b.getAttribute('tabindex'));\n\n if (tabindexA > tabindexB) {\n return 1;\n } else if (tabindexA < tabindexB) {\n return -1;\n }\n\n return 0;\n });\n const otherFocusableElements = Array.from(getPopup().querySelectorAll(focusable)).filter(el => el.getAttribute('tabindex') !== '-1');\n return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(el => isVisible(el));\n };\n /**\n * @returns {boolean}\n */\n\n const isModal = () => {\n return hasClass(document.body, swalClasses.shown) && !hasClass(document.body, swalClasses['toast-shown']) && !hasClass(document.body, swalClasses['no-backdrop']);\n };\n /**\n * @returns {boolean}\n */\n\n const isToast = () => {\n return getPopup() && hasClass(getPopup(), swalClasses.toast);\n };\n /**\n * @returns {boolean}\n */\n\n const isLoading = () => {\n return getPopup().hasAttribute('data-loading');\n };\n\n const states = {\n previousBodyPadding: null\n };\n /**\n * Securely set innerHTML of an element\n * https://github.com/sweetalert2/sweetalert2/issues/1926\n *\n * @param {HTMLElement} elem\n * @param {string} html\n */\n\n const setInnerHtml = (elem, html) => {\n elem.textContent = '';\n\n if (html) {\n const parser = new DOMParser();\n const parsed = parser.parseFromString(html, \"text/html\");\n Array.from(parsed.querySelector('head').childNodes).forEach(child => {\n elem.appendChild(child);\n });\n Array.from(parsed.querySelector('body').childNodes).forEach(child => {\n elem.appendChild(child);\n });\n }\n };\n /**\n * @param {HTMLElement} elem\n * @param {string} className\n * @returns {boolean}\n */\n\n const hasClass = (elem, className) => {\n if (!className) {\n return false;\n }\n\n const classList = className.split(/\\s+/);\n\n for (let i = 0; i < classList.length; i++) {\n if (!elem.classList.contains(classList[i])) {\n return false;\n }\n }\n\n return true;\n };\n /**\n * @param {HTMLElement} elem\n * @param {SweetAlertOptions} params\n */\n\n const removeCustomClasses = (elem, params) => {\n Array.from(elem.classList).forEach(className => {\n if (!Object.values(swalClasses).includes(className) && !Object.values(iconTypes).includes(className) && !Object.values(params.showClass).includes(className)) {\n elem.classList.remove(className);\n }\n });\n };\n /**\n * @param {HTMLElement} elem\n * @param {SweetAlertOptions} params\n * @param {string} className\n */\n\n\n const applyCustomClass = (elem, params, className) => {\n removeCustomClasses(elem, params);\n\n if (params.customClass && params.customClass[className]) {\n if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) {\n return warn(\"Invalid type of customClass.\".concat(className, \"! Expected string or iterable object, got \\\"\").concat(typeof params.customClass[className], \"\\\"\"));\n }\n\n addClass(elem, params.customClass[className]);\n }\n };\n /**\n * @param {HTMLElement} popup\n * @param {import('./renderers/renderInput').InputClass} inputClass\n * @returns {HTMLInputElement | null}\n */\n\n const getInput = (popup, inputClass) => {\n if (!inputClass) {\n return null;\n }\n\n switch (inputClass) {\n case 'select':\n case 'textarea':\n case 'file':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses[inputClass]));\n\n case 'checkbox':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.checkbox, \" input\"));\n\n case 'radio':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.radio, \" input:checked\")) || popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.radio, \" input:first-child\"));\n\n case 'range':\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.range, \" input\"));\n\n default:\n return popup.querySelector(\".\".concat(swalClasses.popup, \" > .\").concat(swalClasses.input));\n }\n };\n /**\n * @param {HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement} input\n */\n\n const focusInput = input => {\n input.focus(); // place cursor at end of text in text input\n\n if (input.type !== 'file') {\n // http://stackoverflow.com/a/2345915\n const val = input.value;\n input.value = '';\n input.value = val;\n }\n };\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[] | readonly string[]} classList\n * @param {boolean} condition\n */\n\n const toggleClass = (target, classList, condition) => {\n if (!target || !classList) {\n return;\n }\n\n if (typeof classList === 'string') {\n classList = classList.split(/\\s+/).filter(Boolean);\n }\n\n classList.forEach(className => {\n if (Array.isArray(target)) {\n target.forEach(elem => {\n condition ? elem.classList.add(className) : elem.classList.remove(className);\n });\n } else {\n condition ? target.classList.add(className) : target.classList.remove(className);\n }\n });\n };\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[] | readonly string[]} classList\n */\n\n const addClass = (target, classList) => {\n toggleClass(target, classList, true);\n };\n /**\n * @param {HTMLElement | HTMLElement[] | null} target\n * @param {string | string[] | readonly string[]} classList\n */\n\n const removeClass = (target, classList) => {\n toggleClass(target, classList, false);\n };\n /**\n * Get direct child of an element by class name\n *\n * @param {HTMLElement} elem\n * @param {string} className\n * @returns {HTMLElement | null}\n */\n\n const getDirectChildByClass = (elem, className) => {\n const children = Array.from(elem.children);\n\n for (let i = 0; i < children.length; i++) {\n const child = children[i];\n\n if (child instanceof HTMLElement && hasClass(child, className)) {\n return child;\n }\n }\n };\n /**\n * @param {HTMLElement} elem\n * @param {string} property\n * @param {*} value\n */\n\n const applyNumericalStyle = (elem, property, value) => {\n if (value === \"\".concat(parseInt(value))) {\n value = parseInt(value);\n }\n\n if (value || parseInt(value) === 0) {\n elem.style[property] = typeof value === 'number' ? \"\".concat(value, \"px\") : value;\n } else {\n elem.style.removeProperty(property);\n }\n };\n /**\n * @param {HTMLElement} elem\n * @param {string} display\n */\n\n const show = function (elem) {\n let display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex';\n elem.style.display = display;\n };\n /**\n * @param {HTMLElement} elem\n */\n\n const hide = elem => {\n elem.style.display = 'none';\n };\n /**\n * @param {HTMLElement} parent\n * @param {string} selector\n * @param {string} property\n * @param {string} value\n */\n\n const setStyle = (parent, selector, property, value) => {\n /** @type {HTMLElement} */\n const el = parent.querySelector(selector);\n\n if (el) {\n el.style[property] = value;\n }\n };\n /**\n * @param {HTMLElement} elem\n * @param {any} condition\n * @param {string} display\n */\n\n const toggle = function (elem, condition) {\n let display = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'flex';\n condition ? show(elem, display) : hide(elem);\n };\n /**\n * borrowed from jquery $(elem).is(':visible') implementation\n *\n * @param {HTMLElement} elem\n * @returns {boolean}\n */\n\n const isVisible = elem => !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length));\n /**\n * @returns {boolean}\n */\n\n const allButtonsAreHidden = () => !isVisible(getConfirmButton()) && !isVisible(getDenyButton()) && !isVisible(getCancelButton());\n /**\n * @returns {boolean}\n */\n\n const isScrollable = elem => !!(elem.scrollHeight > elem.clientHeight);\n /**\n * borrowed from https://stackoverflow.com/a/46352119\n *\n * @param {HTMLElement} elem\n * @returns {boolean}\n */\n\n const hasCssAnimation = elem => {\n const style = window.getComputedStyle(elem);\n const animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0');\n const transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0');\n return animDuration > 0 || transDuration > 0;\n };\n /**\n * @param {number} timer\n * @param {boolean} reset\n */\n\n const animateTimerProgressBar = function (timer) {\n let reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n const timerProgressBar = getTimerProgressBar();\n\n if (isVisible(timerProgressBar)) {\n if (reset) {\n timerProgressBar.style.transition = 'none';\n timerProgressBar.style.width = '100%';\n }\n\n setTimeout(() => {\n timerProgressBar.style.transition = \"width \".concat(timer / 1000, \"s linear\");\n timerProgressBar.style.width = '0%';\n }, 10);\n }\n };\n const stopTimerProgressBar = () => {\n const timerProgressBar = getTimerProgressBar();\n const timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width);\n timerProgressBar.style.removeProperty('transition');\n timerProgressBar.style.width = '100%';\n const timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width);\n const timerProgressBarPercent = timerProgressBarWidth / timerProgressBarFullWidth * 100;\n timerProgressBar.style.removeProperty('transition');\n timerProgressBar.style.width = \"\".concat(timerProgressBarPercent, \"%\");\n };\n\n const RESTORE_FOCUS_TIMEOUT = 100;\n\n /** @type {GlobalState} */\n\n const globalState = {};\n\n const focusPreviousActiveElement = () => {\n if (globalState.previousActiveElement instanceof HTMLElement) {\n globalState.previousActiveElement.focus();\n globalState.previousActiveElement = null;\n } else if (document.body) {\n document.body.focus();\n }\n };\n /**\n * Restore previous active (focused) element\n *\n * @param {boolean} returnFocus\n * @returns {Promise}\n */\n\n\n const restoreActiveElement = returnFocus => {\n return new Promise(resolve => {\n if (!returnFocus) {\n return resolve();\n }\n\n const x = window.scrollX;\n const y = window.scrollY;\n globalState.restoreFocusTimeout = setTimeout(() => {\n focusPreviousActiveElement();\n resolve();\n }, RESTORE_FOCUS_TIMEOUT); // issues/900\n\n window.scrollTo(x, y);\n });\n };\n\n /**\n * Detect Node env\n *\n * @returns {boolean}\n */\n const isNodeEnv = () => typeof window === 'undefined' || typeof document === 'undefined';\n\n const sweetHTML = \"\\n