(self["webpackChunk_core_volunteer_app"] = self["webpackChunk_core_volunteer_app"] || []).push([["vendors-node_modules_sweetalert2_dist_sweetalert2_all_js-node_modules_toggle-selection_index_-23f96a"],{ /***/ "../../../node_modules/sweetalert2/dist/sweetalert2.all.js": /*!*****************************************************************!*\ !*** ../../../node_modules/sweetalert2/dist/sweetalert2.all.js ***! \*****************************************************************/ /***/ (function(module) { /*! * sweetalert2 v11.26.3 * Released under the MIT License. */ (function (global, factory) { true ? module.exports = factory() : 0; })(this, (function () { 'use strict'; function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); } function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); } function _classPrivateFieldGet2(s, a) { return s.get(_assertClassBrand(s, a)); } function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); } function _classPrivateFieldSet2(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; } const RESTORE_FOCUS_TIMEOUT = 100; /** @type {GlobalState} */ const globalState = {}; const focusPreviousActiveElement = () => { if (globalState.previousActiveElement instanceof HTMLElement) { globalState.previousActiveElement.focus(); globalState.previousActiveElement = null; } else if (document.body) { document.body.focus(); } }; /** * Restore previous active (focused) element * * @param {boolean} returnFocus * @returns {Promise} */ const restoreActiveElement = returnFocus => { return new Promise(resolve => { if (!returnFocus) { return resolve(); } const x = window.scrollX; const y = window.scrollY; globalState.restoreFocusTimeout = setTimeout(() => { focusPreviousActiveElement(); resolve(); }, RESTORE_FOCUS_TIMEOUT); // issues/900 window.scrollTo(x, y); }); }; const swalPrefix = 'swal2-'; /** * @typedef {Record} SwalClasses */ /** * @typedef {'success' | 'warning' | 'info' | 'question' | 'error'} SwalIcon * @typedef {Record} SwalIcons */ /** @type {SwalClass[]} */ const classNames = ['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'no-transition', 'toast', 'toast-shown', 'show', 'hide', 'close', 'title', 'html-container', 'actions', 'confirm', 'deny', 'cancel', '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', 'draggable', 'dragging']; const swalClasses = classNames.reduce((acc, className) => { acc[className] = swalPrefix + className; return acc; }, /** @type {SwalClasses} */{}); /** @type {SwalIcon[]} */ const icons = ['success', 'warning', 'info', 'question', 'error']; const iconTypes = icons.reduce((acc, icon) => { acc[icon] = swalPrefix + icon; return acc; }, /** @type {SwalIcons} */{}); const consolePrefix = 'SweetAlert2:'; /** * Capitalize the first letter of a string * * @param {string} str * @returns {string} */ const capitalizeFirstLetter = str => str.charAt(0).toUpperCase() + str.slice(1); /** * Standardize console warnings * * @param {string | string[]} message */ const warn = message => { console.warn(`${consolePrefix} ${typeof message === 'object' ? message.join(' ') : message}`); }; /** * Standardize console errors * * @param {string} message */ const error = message => { console.error(`${consolePrefix} ${message}`); }; /** * Private global state for `warnOnce` * * @type {string[]} * @private */ const previousWarnOnceMessages = []; /** * Show a console warning, but only if it hasn't already been shown * * @param {string} message */ const warnOnce = message => { if (!previousWarnOnceMessages.includes(message)) { previousWarnOnceMessages.push(message); warn(message); } }; /** * Show a one-time console warning about deprecated params/methods * * @param {string} deprecatedParam * @param {string?} useInstead */ const warnAboutDeprecation = (deprecatedParam, useInstead = null) => { warnOnce(`"${deprecatedParam}" is deprecated and will be removed in the next major release.${useInstead ? ` Use "${useInstead}" instead.` : ''}`); }; /** * If `arg` is a function, call it (with no arguments or context) and return the result. * Otherwise, just pass the value through * * @param {(() => *) | *} arg * @returns {*} */ const callIfFunction = arg => typeof arg === 'function' ? arg() : arg; /** * @param {*} arg * @returns {boolean} */ const hasToPromiseFn = arg => arg && typeof arg.toPromise === 'function'; /** * @param {*} arg * @returns {Promise<*>} */ const asPromise = arg => hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg); /** * @param {*} arg * @returns {boolean} */ const isPromise = arg => arg && Promise.resolve(arg) === arg; /** * Gets the popup container which contains the backdrop and the popup itself. * * @returns {HTMLElement | null} */ const getContainer = () => document.body.querySelector(`.${swalClasses.container}`); /** * @param {string} selectorString * @returns {HTMLElement | null} */ const elementBySelector = selectorString => { const container = getContainer(); return container ? container.querySelector(selectorString) : null; }; /** * @param {string} className * @returns {HTMLElement | null} */ const elementByClass = className => { return elementBySelector(`.${className}`); }; /** * @returns {HTMLElement | null} */ const getPopup = () => elementByClass(swalClasses.popup); /** * @returns {HTMLElement | null} */ const getIcon = () => elementByClass(swalClasses.icon); /** * @returns {HTMLElement | null} */ const getIconContent = () => elementByClass(swalClasses['icon-content']); /** * @returns {HTMLElement | null} */ const getTitle = () => elementByClass(swalClasses.title); /** * @returns {HTMLElement | null} */ const getHtmlContainer = () => elementByClass(swalClasses['html-container']); /** * @returns {HTMLElement | null} */ const getImage = () => elementByClass(swalClasses.image); /** * @returns {HTMLElement | null} */ const getProgressSteps = () => elementByClass(swalClasses['progress-steps']); /** * @returns {HTMLElement | null} */ const getValidationMessage = () => elementByClass(swalClasses['validation-message']); /** * @returns {HTMLButtonElement | null} */ const getConfirmButton = () => (/** @type {HTMLButtonElement} */elementBySelector(`.${swalClasses.actions} .${swalClasses.confirm}`)); /** * @returns {HTMLButtonElement | null} */ const getCancelButton = () => (/** @type {HTMLButtonElement} */elementBySelector(`.${swalClasses.actions} .${swalClasses.cancel}`)); /** * @returns {HTMLButtonElement | null} */ const getDenyButton = () => (/** @type {HTMLButtonElement} */elementBySelector(`.${swalClasses.actions} .${swalClasses.deny}`)); /** * @returns {HTMLElement | null} */ const getInputLabel = () => elementByClass(swalClasses['input-label']); /** * @returns {HTMLElement | null} */ const getLoader = () => elementBySelector(`.${swalClasses.loader}`); /** * @returns {HTMLElement | null} */ const getActions = () => elementByClass(swalClasses.actions); /** * @returns {HTMLElement | null} */ const getFooter = () => elementByClass(swalClasses.footer); /** * @returns {HTMLElement | null} */ const getTimerProgressBar = () => elementByClass(swalClasses['timer-progress-bar']); /** * @returns {HTMLElement | null} */ const getCloseButton = () => elementByClass(swalClasses.close); // https://github.com/jkup/focusable/blob/master/index.js const focusable = ` a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable], audio[controls], video[controls], summary `; /** * @returns {HTMLElement[]} */ const getFocusableElements = () => { const popup = getPopup(); if (!popup) { return []; } /** @type {NodeListOf} */ const focusableElementsWithTabindex = popup.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'); const focusableElementsWithTabindexSorted = Array.from(focusableElementsWithTabindex) // sort according to tabindex .sort((a, b) => { const tabindexA = parseInt(a.getAttribute('tabindex') || '0'); const tabindexB = parseInt(b.getAttribute('tabindex') || '0'); if (tabindexA > tabindexB) { return 1; } else if (tabindexA < tabindexB) { return -1; } return 0; }); /** @type {NodeListOf} */ const otherFocusableElements = popup.querySelectorAll(focusable); const otherFocusableElementsFiltered = Array.from(otherFocusableElements).filter(el => el.getAttribute('tabindex') !== '-1'); return [...new Set(focusableElementsWithTabindexSorted.concat(otherFocusableElementsFiltered))].filter(el => isVisible$1(el)); }; /** * @returns {boolean} */ const isModal = () => { return hasClass(document.body, swalClasses.shown) && !hasClass(document.body, swalClasses['toast-shown']) && !hasClass(document.body, swalClasses['no-backdrop']); }; /** * @returns {boolean} */ const isToast = () => { const popup = getPopup(); if (!popup) { return false; } return hasClass(popup, swalClasses.toast); }; /** * @returns {boolean} */ const isLoading = () => { const popup = getPopup(); if (!popup) { return false; } return popup.hasAttribute('data-loading'); }; /** * Securely set innerHTML of an element * https://github.com/sweetalert2/sweetalert2/issues/1926 * * @param {HTMLElement} elem * @param {string} html */ const setInnerHtml = (elem, html) => { elem.textContent = ''; if (html) { const parser = new DOMParser(); const parsed = parser.parseFromString(html, `text/html`); const head = parsed.querySelector('head'); if (head) { Array.from(head.childNodes).forEach(child => { elem.appendChild(child); }); } const body = parsed.querySelector('body'); if (body) { Array.from(body.childNodes).forEach(child => { if (child instanceof HTMLVideoElement || child instanceof HTMLAudioElement) { elem.appendChild(child.cloneNode(true)); // https://github.com/sweetalert2/sweetalert2/issues/2507 } else { elem.appendChild(child); } }); } } }; /** * @param {HTMLElement} elem * @param {string} className * @returns {boolean} */ const hasClass = (elem, className) => { if (!className) { return false; } const classList = className.split(/\s+/); for (let i = 0; i < classList.length; i++) { if (!elem.classList.contains(classList[i])) { return false; } } return true; }; /** * @param {HTMLElement} elem * @param {SweetAlertOptions} params */ const removeCustomClasses = (elem, params) => { Array.from(elem.classList).forEach(className => { if (!Object.values(swalClasses).includes(className) && !Object.values(iconTypes).includes(className) && !Object.values(params.showClass || {}).includes(className)) { elem.classList.remove(className); } }); }; /** * @param {HTMLElement} elem * @param {SweetAlertOptions} params * @param {string} className */ const applyCustomClass = (elem, params, className) => { removeCustomClasses(elem, params); if (!params.customClass) { return; } const customClass = params.customClass[(/** @type {keyof SweetAlertCustomClass} */className)]; if (!customClass) { return; } if (typeof customClass !== 'string' && !customClass.forEach) { warn(`Invalid type of customClass.${className}! Expected string or iterable object, got "${typeof customClass}"`); return; } addClass(elem, customClass); }; /** * @param {HTMLElement} popup * @param {import('./renderers/renderInput').InputClass | SweetAlertInput} inputClass * @returns {HTMLInputElement | null} */ const getInput$1 = (popup, inputClass) => { if (!inputClass) { return null; } switch (inputClass) { case 'select': case 'textarea': case 'file': return popup.querySelector(`.${swalClasses.popup} > .${swalClasses[inputClass]}`); case 'checkbox': return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.checkbox} input`); case 'radio': return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.radio} input:checked`) || popup.querySelector(`.${swalClasses.popup} > .${swalClasses.radio} input:first-child`); case 'range': return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.range} input`); default: return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.input}`); } }; /** * @param {HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement} input */ const focusInput = input => { input.focus(); // place cursor at end of text in text input if (input.type !== 'file') { // http://stackoverflow.com/a/2345915 const val = input.value; input.value = ''; input.value = val; } }; /** * @param {HTMLElement | HTMLElement[] | null} target * @param {string | string[] | readonly string[] | undefined} classList * @param {boolean} condition */ const toggleClass = (target, classList, condition) => { if (!target || !classList) { return; } if (typeof classList === 'string') { classList = classList.split(/\s+/).filter(Boolean); } classList.forEach(className => { if (Array.isArray(target)) { target.forEach(elem => { if (condition) { elem.classList.add(className); } else { elem.classList.remove(className); } }); } else { if (condition) { target.classList.add(className); } else { target.classList.remove(className); } } }); }; /** * @param {HTMLElement | HTMLElement[] | null} target * @param {string | string[] | readonly string[] | undefined} classList */ const addClass = (target, classList) => { toggleClass(target, classList, true); }; /** * @param {HTMLElement | HTMLElement[] | null} target * @param {string | string[] | readonly string[] | undefined} classList */ const removeClass = (target, classList) => { toggleClass(target, classList, false); }; /** * Get direct child of an element by class name * * @param {HTMLElement} elem * @param {string} className * @returns {HTMLElement | undefined} */ const getDirectChildByClass = (elem, className) => { const children = Array.from(elem.children); for (let i = 0; i < children.length; i++) { const child = children[i]; if (child instanceof HTMLElement && hasClass(child, className)) { return child; } } }; /** * @param {HTMLElement} elem * @param {string} property * @param {string | number | null | undefined} value */ const applyNumericalStyle = (elem, property, value) => { if (value === `${parseInt(`${value}`)}`) { value = parseInt(value); } if (value || parseInt(`${value}`) === 0) { elem.style.setProperty(property, typeof value === 'number' ? `${value}px` : value); } else { elem.style.removeProperty(property); } }; /** * @param {HTMLElement | null} elem * @param {string} display */ const show = (elem, display = 'flex') => { if (!elem) { return; } elem.style.display = display; }; /** * @param {HTMLElement | null} elem */ const hide = elem => { if (!elem) { return; } elem.style.display = 'none'; }; /** * @param {HTMLElement | null} elem * @param {string} display */ const showWhenInnerHtmlPresent = (elem, display = 'block') => { if (!elem) { return; } new MutationObserver(() => { toggle(elem, elem.innerHTML, display); }).observe(elem, { childList: true, subtree: true }); }; /** * @param {HTMLElement} parent * @param {string} selector * @param {string} property * @param {string} value */ const setStyle = (parent, selector, property, value) => { /** @type {HTMLElement | null} */ const el = parent.querySelector(selector); if (el) { el.style.setProperty(property, value); } }; /** * @param {HTMLElement} elem * @param {boolean | string | null | undefined} condition * @param {string} display */ const toggle = (elem, condition, display = 'flex') => { if (condition) { show(elem, display); } else { hide(elem); } }; /** * borrowed from jquery $(elem).is(':visible') implementation * * @param {HTMLElement | null} elem * @returns {boolean} */ const isVisible$1 = elem => !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)); /** * @returns {boolean} */ const allButtonsAreHidden = () => !isVisible$1(getConfirmButton()) && !isVisible$1(getDenyButton()) && !isVisible$1(getCancelButton()); /** * @param {HTMLElement} elem * @returns {boolean} */ const isScrollable = elem => !!(elem.scrollHeight > elem.clientHeight); /** * @param {HTMLElement} element * @param {HTMLElement} stopElement * @returns {boolean} */ const selfOrParentIsScrollable = (element, stopElement) => { let parent = element; while (parent && parent !== stopElement) { if (isScrollable(parent)) { return true; } parent = parent.parentElement; } return false; }; /** * borrowed from https://stackoverflow.com/a/46352119 * * @param {HTMLElement} elem * @returns {boolean} */ const hasCssAnimation = elem => { const style = window.getComputedStyle(elem); const animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0'); const transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0'); return animDuration > 0 || transDuration > 0; }; /** * @param {number} timer * @param {boolean} reset */ const animateTimerProgressBar = (timer, reset = false) => { const timerProgressBar = getTimerProgressBar(); if (!timerProgressBar) { return; } if (isVisible$1(timerProgressBar)) { if (reset) { timerProgressBar.style.transition = 'none'; timerProgressBar.style.width = '100%'; } setTimeout(() => { timerProgressBar.style.transition = `width ${timer / 1000}s linear`; timerProgressBar.style.width = '0%'; }, 10); } }; const stopTimerProgressBar = () => { const timerProgressBar = getTimerProgressBar(); if (!timerProgressBar) { return; } const timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width); timerProgressBar.style.removeProperty('transition'); timerProgressBar.style.width = '100%'; const timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width); const timerProgressBarPercent = timerProgressBarWidth / timerProgressBarFullWidth * 100; timerProgressBar.style.width = `${timerProgressBarPercent}%`; }; /** * Detect Node env * * @returns {boolean} */ const isNodeEnv = () => typeof window === 'undefined' || typeof document === 'undefined'; const sweetHTML = `

    `.replace(/(^|\n)\s*/g, ''); /** * @returns {boolean} */ const resetOldContainer = () => { const oldContainer = getContainer(); if (!oldContainer) { return false; } oldContainer.remove(); removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]); return true; }; const resetValidationMessage$1 = () => { globalState.currentInstance.resetValidationMessage(); }; const addInputChangeListeners = () => { const popup = getPopup(); const input = getDirectChildByClass(popup, swalClasses.input); const file = getDirectChildByClass(popup, swalClasses.file); /** @type {HTMLInputElement} */ const range = popup.querySelector(`.${swalClasses.range} input`); /** @type {HTMLOutputElement} */ const rangeOutput = popup.querySelector(`.${swalClasses.range} output`); const select = getDirectChildByClass(popup, swalClasses.select); /** @type {HTMLInputElement} */ const checkbox = popup.querySelector(`.${swalClasses.checkbox} input`); const textarea = getDirectChildByClass(popup, swalClasses.textarea); input.oninput = resetValidationMessage$1; file.onchange = resetValidationMessage$1; select.onchange = resetValidationMessage$1; checkbox.onchange = resetValidationMessage$1; textarea.oninput = resetValidationMessage$1; range.oninput = () => { resetValidationMessage$1(); rangeOutput.value = range.value; }; range.onchange = () => { resetValidationMessage$1(); rangeOutput.value = range.value; }; }; /** * @param {string | HTMLElement} target * @returns {HTMLElement} */ const getTarget = target => typeof target === 'string' ? document.querySelector(target) : target; /** * @param {SweetAlertOptions} params */ const setupAccessibility = params => { const popup = getPopup(); popup.setAttribute('role', params.toast ? 'alert' : 'dialog'); popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive'); if (!params.toast) { popup.setAttribute('aria-modal', 'true'); } }; /** * @param {HTMLElement} targetElement */ const setupRTL = targetElement => { if (window.getComputedStyle(targetElement).direction === 'rtl') { addClass(getContainer(), swalClasses.rtl); } }; /** * Add modal + backdrop to DOM * * @param {SweetAlertOptions} params */ const init = params => { // Clean up the old popup container if it exists const oldContainerExisted = resetOldContainer(); if (isNodeEnv()) { error('SweetAlert2 requires document to initialize'); return; } const container = document.createElement('div'); container.className = swalClasses.container; if (oldContainerExisted) { addClass(container, swalClasses['no-transition']); } setInnerHtml(container, sweetHTML); container.dataset['swal2Theme'] = params.theme; const targetElement = getTarget(params.target); targetElement.appendChild(container); if (params.topLayer) { container.setAttribute('popover', ''); container.showPopover(); } setupAccessibility(params); setupRTL(targetElement); addInputChangeListeners(); }; /** * @param {HTMLElement | object | string} param * @param {HTMLElement} target */ const parseHtmlToContainer = (param, target) => { // DOM element if (param instanceof HTMLElement) { target.appendChild(param); } // Object else if (typeof param === 'object') { handleObject(param, target); } // Plain string else if (param) { setInnerHtml(target, param); } }; /** * @param {object} param * @param {HTMLElement} target */ const handleObject = (param, target) => { // JQuery element(s) if (param.jquery) { handleJqueryElem(target, param); } // For other objects use their string representation else { setInnerHtml(target, param.toString()); } }; /** * @param {HTMLElement} target * @param {object} elem */ const handleJqueryElem = (target, elem) => { target.textContent = ''; if (0 in elem) { for (let i = 0; i in elem; i++) { target.appendChild(elem[i].cloneNode(true)); } } else { target.appendChild(elem.cloneNode(true)); } }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderActions = (instance, params) => { const actions = getActions(); const loader = getLoader(); if (!actions || !loader) { return; } // Actions (buttons) wrapper if (!params.showConfirmButton && !params.showDenyButton && !params.showCancelButton) { hide(actions); } else { show(actions); } // Custom class applyCustomClass(actions, params, 'actions'); // Render all the buttons renderButtons(actions, loader, params); // Loader setInnerHtml(loader, params.loaderHtml || ''); applyCustomClass(loader, params, 'loader'); }; /** * @param {HTMLElement} actions * @param {HTMLElement} loader * @param {SweetAlertOptions} params */ function renderButtons(actions, loader, params) { const confirmButton = getConfirmButton(); const denyButton = getDenyButton(); const cancelButton = getCancelButton(); if (!confirmButton || !denyButton || !cancelButton) { return; } // Render buttons renderButton(confirmButton, 'confirm', params); renderButton(denyButton, 'deny', params); renderButton(cancelButton, 'cancel', params); handleButtonsStyling(confirmButton, denyButton, cancelButton, params); if (params.reverseButtons) { if (params.toast) { actions.insertBefore(cancelButton, confirmButton); actions.insertBefore(denyButton, confirmButton); } else { actions.insertBefore(cancelButton, loader); actions.insertBefore(denyButton, loader); actions.insertBefore(confirmButton, loader); } } } /** * @param {HTMLElement} confirmButton * @param {HTMLElement} denyButton * @param {HTMLElement} cancelButton * @param {SweetAlertOptions} params */ function handleButtonsStyling(confirmButton, denyButton, cancelButton, params) { if (!params.buttonsStyling) { removeClass([confirmButton, denyButton, cancelButton], swalClasses.styled); return; } addClass([confirmButton, denyButton, cancelButton], swalClasses.styled); // Apply custom background colors to action buttons if (params.confirmButtonColor) { confirmButton.style.setProperty('--swal2-confirm-button-background-color', params.confirmButtonColor); } if (params.denyButtonColor) { denyButton.style.setProperty('--swal2-deny-button-background-color', params.denyButtonColor); } if (params.cancelButtonColor) { cancelButton.style.setProperty('--swal2-cancel-button-background-color', params.cancelButtonColor); } // Apply the outline color to action buttons applyOutlineColor(confirmButton); applyOutlineColor(denyButton); applyOutlineColor(cancelButton); } /** * @param {HTMLElement} button */ function applyOutlineColor(button) { const buttonStyle = window.getComputedStyle(button); if (buttonStyle.getPropertyValue('--swal2-action-button-focus-box-shadow')) { // If the button already has a custom outline color, no need to change it return; } const outlineColor = buttonStyle.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/, 'rgba($1, $2, $3, 0.5)'); button.style.setProperty('--swal2-action-button-focus-box-shadow', buttonStyle.getPropertyValue('--swal2-outline').replace(/ rgba\(.*/, ` ${outlineColor}`)); } /** * @param {HTMLElement} button * @param {'confirm' | 'deny' | 'cancel'} buttonType * @param {SweetAlertOptions} params */ function renderButton(button, buttonType, params) { const buttonName = /** @type {'Confirm' | 'Deny' | 'Cancel'} */capitalizeFirstLetter(buttonType); toggle(button, params[`show${buttonName}Button`], 'inline-block'); setInnerHtml(button, params[`${buttonType}ButtonText`] || ''); // Set caption text button.setAttribute('aria-label', params[`${buttonType}ButtonAriaLabel`] || ''); // ARIA label // Add buttons custom classes button.className = swalClasses[buttonType]; applyCustomClass(button, params, `${buttonType}Button`); } /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderCloseButton = (instance, params) => { const closeButton = getCloseButton(); if (!closeButton) { return; } setInnerHtml(closeButton, params.closeButtonHtml || ''); // Custom class applyCustomClass(closeButton, params, 'closeButton'); toggle(closeButton, params.showCloseButton); closeButton.setAttribute('aria-label', params.closeButtonAriaLabel || ''); }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderContainer = (instance, params) => { const container = getContainer(); if (!container) { return; } handleBackdropParam(container, params.backdrop); handlePositionParam(container, params.position); handleGrowParam(container, params.grow); // Custom class applyCustomClass(container, params, 'container'); }; /** * @param {HTMLElement} container * @param {SweetAlertOptions['backdrop']} backdrop */ function handleBackdropParam(container, backdrop) { if (typeof backdrop === 'string') { container.style.background = backdrop; } else if (!backdrop) { addClass([document.documentElement, document.body], swalClasses['no-backdrop']); } } /** * @param {HTMLElement} container * @param {SweetAlertOptions['position']} position */ function handlePositionParam(container, position) { if (!position) { return; } if (position in swalClasses) { addClass(container, swalClasses[position]); } else { warn('The "position" parameter is not valid, defaulting to "center"'); addClass(container, swalClasses.center); } } /** * @param {HTMLElement} container * @param {SweetAlertOptions['grow']} grow */ function handleGrowParam(container, grow) { if (!grow) { return; } addClass(container, swalClasses[`grow-${grow}`]); } /** * This module contains `WeakMap`s for each effectively-"private property" that a `Swal` has. * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` * This is the approach that Babel will probably take to implement private methods/fields * https://github.com/tc39/proposal-private-methods * https://github.com/babel/babel/pull/7555 * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* * then we can use that language feature. */ var privateProps = { innerParams: new WeakMap(), domCache: new WeakMap() }; /// /** @type {InputClass[]} */ const inputClasses = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea']; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderInput = (instance, params) => { const popup = getPopup(); if (!popup) { return; } const innerParams = privateProps.innerParams.get(instance); const rerender = !innerParams || params.input !== innerParams.input; inputClasses.forEach(inputClass => { const inputContainer = getDirectChildByClass(popup, swalClasses[inputClass]); if (!inputContainer) { return; } // set attributes setAttributes(inputClass, params.inputAttributes); // set class inputContainer.className = swalClasses[inputClass]; if (rerender) { hide(inputContainer); } }); if (params.input) { if (rerender) { showInput(params); } // set custom class setCustomClass(params); } }; /** * @param {SweetAlertOptions} params */ const showInput = params => { if (!params.input) { return; } if (!renderInputType[params.input]) { error(`Unexpected type of input! Expected ${Object.keys(renderInputType).join(' | ')}, got "${params.input}"`); return; } const inputContainer = getInputContainer(params.input); if (!inputContainer) { return; } const input = renderInputType[params.input](inputContainer, params); show(inputContainer); // input autofocus if (params.inputAutoFocus) { setTimeout(() => { focusInput(input); }); } }; /** * @param {HTMLInputElement} input */ const removeAttributes = input => { for (let i = 0; i < input.attributes.length; i++) { const attrName = input.attributes[i].name; if (!['id', 'type', 'value', 'style'].includes(attrName)) { input.removeAttribute(attrName); } } }; /** * @param {InputClass} inputClass * @param {SweetAlertOptions['inputAttributes']} inputAttributes */ const setAttributes = (inputClass, inputAttributes) => { const popup = getPopup(); if (!popup) { return; } const input = getInput$1(popup, inputClass); if (!input) { return; } removeAttributes(input); for (const attr in inputAttributes) { input.setAttribute(attr, inputAttributes[attr]); } }; /** * @param {SweetAlertOptions} params */ const setCustomClass = params => { if (!params.input) { return; } const inputContainer = getInputContainer(params.input); if (inputContainer) { applyCustomClass(inputContainer, params, 'input'); } }; /** * @param {HTMLInputElement | HTMLTextAreaElement} input * @param {SweetAlertOptions} params */ const setInputPlaceholder = (input, params) => { if (!input.placeholder && params.inputPlaceholder) { input.placeholder = params.inputPlaceholder; } }; /** * @param {Input} input * @param {Input} prependTo * @param {SweetAlertOptions} params */ const setInputLabel = (input, prependTo, params) => { if (params.inputLabel) { const label = document.createElement('label'); const labelClass = swalClasses['input-label']; label.setAttribute('for', input.id); label.className = labelClass; if (typeof params.customClass === 'object') { addClass(label, params.customClass.inputLabel); } label.innerText = params.inputLabel; prependTo.insertAdjacentElement('beforebegin', label); } }; /** * @param {SweetAlertInput} inputType * @returns {HTMLElement | undefined} */ const getInputContainer = inputType => { const popup = getPopup(); if (!popup) { return; } return getDirectChildByClass(popup, swalClasses[(/** @type {SwalClass} */inputType)] || swalClasses.input); }; /** * @param {HTMLInputElement | HTMLOutputElement | HTMLTextAreaElement} input * @param {SweetAlertOptions['inputValue']} inputValue */ const checkAndSetInputValue = (input, inputValue) => { if (['string', 'number'].includes(typeof inputValue)) { input.value = `${inputValue}`; } else if (!isPromise(inputValue)) { warn(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof inputValue}"`); } }; /** @type {Record Input>} */ const renderInputType = {}; /** * @param {HTMLInputElement} input * @param {SweetAlertOptions} params * @returns {HTMLInputElement} */ renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = renderInputType.search = renderInputType.date = renderInputType['datetime-local'] = renderInputType.time = renderInputType.week = renderInputType.month = /** @type {(input: Input | HTMLElement, params: SweetAlertOptions) => Input} */ (input, params) => { checkAndSetInputValue(input, params.inputValue); setInputLabel(input, input, params); setInputPlaceholder(input, params); input.type = params.input; return input; }; /** * @param {HTMLInputElement} input * @param {SweetAlertOptions} params * @returns {HTMLInputElement} */ renderInputType.file = (input, params) => { setInputLabel(input, input, params); setInputPlaceholder(input, params); return input; }; /** * @param {HTMLInputElement} range * @param {SweetAlertOptions} params * @returns {HTMLInputElement} */ renderInputType.range = (range, params) => { const rangeInput = range.querySelector('input'); const rangeOutput = range.querySelector('output'); checkAndSetInputValue(rangeInput, params.inputValue); rangeInput.type = params.input; checkAndSetInputValue(rangeOutput, params.inputValue); setInputLabel(rangeInput, range, params); return range; }; /** * @param {HTMLSelectElement} select * @param {SweetAlertOptions} params * @returns {HTMLSelectElement} */ renderInputType.select = (select, params) => { select.textContent = ''; if (params.inputPlaceholder) { const placeholder = document.createElement('option'); setInnerHtml(placeholder, params.inputPlaceholder); placeholder.value = ''; placeholder.disabled = true; placeholder.selected = true; select.appendChild(placeholder); } setInputLabel(select, select, params); return select; }; /** * @param {HTMLInputElement} radio * @returns {HTMLInputElement} */ renderInputType.radio = radio => { radio.textContent = ''; return radio; }; /** * @param {HTMLLabelElement} checkboxContainer * @param {SweetAlertOptions} params * @returns {HTMLInputElement} */ renderInputType.checkbox = (checkboxContainer, params) => { const checkbox = getInput$1(getPopup(), 'checkbox'); checkbox.value = '1'; checkbox.checked = Boolean(params.inputValue); const label = checkboxContainer.querySelector('span'); setInnerHtml(label, params.inputPlaceholder || params.inputLabel); return checkbox; }; /** * @param {HTMLTextAreaElement} textarea * @param {SweetAlertOptions} params * @returns {HTMLTextAreaElement} */ renderInputType.textarea = (textarea, params) => { checkAndSetInputValue(textarea, params.inputValue); setInputPlaceholder(textarea, params); setInputLabel(textarea, textarea, params); /** * @param {HTMLElement} el * @returns {number} */ const getMargin = el => parseInt(window.getComputedStyle(el).marginLeft) + parseInt(window.getComputedStyle(el).marginRight); // https://github.com/sweetalert2/sweetalert2/issues/2291 setTimeout(() => { // https://github.com/sweetalert2/sweetalert2/issues/1699 if ('MutationObserver' in window) { const initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width); const textareaResizeHandler = () => { // check if texarea is still in document (i.e. popup wasn't closed in the meantime) if (!document.body.contains(textarea)) { return; } const textareaWidth = textarea.offsetWidth + getMargin(textarea); if (textareaWidth > initialPopupWidth) { getPopup().style.width = `${textareaWidth}px`; } else { applyNumericalStyle(getPopup(), 'width', params.width); } }; new MutationObserver(textareaResizeHandler).observe(textarea, { attributes: true, attributeFilter: ['style'] }); } }); return textarea; }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderContent = (instance, params) => { const htmlContainer = getHtmlContainer(); if (!htmlContainer) { return; } showWhenInnerHtmlPresent(htmlContainer); applyCustomClass(htmlContainer, params, 'htmlContainer'); // Content as HTML if (params.html) { parseHtmlToContainer(params.html, htmlContainer); show(htmlContainer, 'block'); } // Content as plain text else if (params.text) { htmlContainer.textContent = params.text; show(htmlContainer, 'block'); } // No content else { hide(htmlContainer); } renderInput(instance, params); }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderFooter = (instance, params) => { const footer = getFooter(); if (!footer) { return; } showWhenInnerHtmlPresent(footer); toggle(footer, Boolean(params.footer), 'block'); if (params.footer) { parseHtmlToContainer(params.footer, footer); } // Custom class applyCustomClass(footer, params, 'footer'); }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderIcon = (instance, params) => { const innerParams = privateProps.innerParams.get(instance); const icon = getIcon(); if (!icon) { return; } // if the given icon already rendered, apply the styling without re-rendering the icon if (innerParams && params.icon === innerParams.icon) { // Custom or default content setContent(icon, params); applyStyles(icon, params); return; } if (!params.icon && !params.iconHtml) { hide(icon); return; } if (params.icon && Object.keys(iconTypes).indexOf(params.icon) === -1) { error(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${params.icon}"`); hide(icon); return; } show(icon); // Custom or default content setContent(icon, params); applyStyles(icon, params); // Animate icon addClass(icon, params.showClass && params.showClass.icon); // Re-adjust the success icon on system theme change const colorSchemeQueryList = window.matchMedia('(prefers-color-scheme: dark)'); colorSchemeQueryList.addEventListener('change', adjustSuccessIconBackgroundColor); }; /** * @param {HTMLElement} icon * @param {SweetAlertOptions} params */ const applyStyles = (icon, params) => { for (const [iconType, iconClassName] of Object.entries(iconTypes)) { if (params.icon !== iconType) { removeClass(icon, iconClassName); } } addClass(icon, params.icon && iconTypes[params.icon]); // Icon color setColor(icon, params); // Success icon background color adjustSuccessIconBackgroundColor(); // Custom class applyCustomClass(icon, params, 'icon'); }; // Adjust success icon background color to match the popup background color const adjustSuccessIconBackgroundColor = () => { const popup = getPopup(); if (!popup) { return; } const popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color'); /** @type {NodeListOf} */ const successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix'); for (let i = 0; i < successIconParts.length; i++) { successIconParts[i].style.backgroundColor = popupBackgroundColor; } }; /** * * @param {SweetAlertOptions} params * @returns {string} */ const successIconHtml = params => ` ${params.animation ? '
    ' : ''}
    ${params.animation ? '
    ' : ''} ${params.animation ? '
    ' : ''} `; const errorIconHtml = ` `; /** * @param {HTMLElement} icon * @param {SweetAlertOptions} params */ const setContent = (icon, params) => { if (!params.icon && !params.iconHtml) { return; } let oldContent = icon.innerHTML; let newContent = ''; if (params.iconHtml) { newContent = iconContent(params.iconHtml); } else if (params.icon === 'success') { newContent = successIconHtml(params); oldContent = oldContent.replace(/ style=".*?"/g, ''); // undo adjustSuccessIconBackgroundColor() } else if (params.icon === 'error') { newContent = errorIconHtml; } else if (params.icon) { const defaultIconHtml = { question: '?', warning: '!', info: 'i' }; newContent = iconContent(defaultIconHtml[params.icon]); } if (oldContent.trim() !== newContent.trim()) { setInnerHtml(icon, newContent); } }; /** * @param {HTMLElement} icon * @param {SweetAlertOptions} params */ const setColor = (icon, params) => { if (!params.iconColor) { return; } icon.style.color = params.iconColor; icon.style.borderColor = params.iconColor; for (const sel of ['.swal2-success-line-tip', '.swal2-success-line-long', '.swal2-x-mark-line-left', '.swal2-x-mark-line-right']) { setStyle(icon, sel, 'background-color', params.iconColor); } setStyle(icon, '.swal2-success-ring', 'border-color', params.iconColor); }; /** * @param {string} content * @returns {string} */ const iconContent = content => `
    ${content}
    `; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderImage = (instance, params) => { const image = getImage(); if (!image) { return; } if (!params.imageUrl) { hide(image); return; } show(image, ''); // Src, alt image.setAttribute('src', params.imageUrl); image.setAttribute('alt', params.imageAlt || ''); // Width, height applyNumericalStyle(image, 'width', params.imageWidth); applyNumericalStyle(image, 'height', params.imageHeight); // Class image.className = swalClasses.image; applyCustomClass(image, params, 'image'); }; let dragging = false; let mousedownX = 0; let mousedownY = 0; let initialX = 0; let initialY = 0; /** * @param {HTMLElement} popup */ const addDraggableListeners = popup => { popup.addEventListener('mousedown', down); document.body.addEventListener('mousemove', move); popup.addEventListener('mouseup', up); popup.addEventListener('touchstart', down); document.body.addEventListener('touchmove', move); popup.addEventListener('touchend', up); }; /** * @param {HTMLElement} popup */ const removeDraggableListeners = popup => { popup.removeEventListener('mousedown', down); document.body.removeEventListener('mousemove', move); popup.removeEventListener('mouseup', up); popup.removeEventListener('touchstart', down); document.body.removeEventListener('touchmove', move); popup.removeEventListener('touchend', up); }; /** * @param {MouseEvent | TouchEvent} event */ const down = event => { const popup = getPopup(); if (event.target === popup || getIcon().contains(/** @type {HTMLElement} */event.target)) { dragging = true; const clientXY = getClientXY(event); mousedownX = clientXY.clientX; mousedownY = clientXY.clientY; initialX = parseInt(popup.style.insetInlineStart) || 0; initialY = parseInt(popup.style.insetBlockStart) || 0; addClass(popup, 'swal2-dragging'); } }; /** * @param {MouseEvent | TouchEvent} event */ const move = event => { const popup = getPopup(); if (dragging) { let { clientX, clientY } = getClientXY(event); popup.style.insetInlineStart = `${initialX + (clientX - mousedownX)}px`; popup.style.insetBlockStart = `${initialY + (clientY - mousedownY)}px`; } }; const up = () => { const popup = getPopup(); dragging = false; removeClass(popup, 'swal2-dragging'); }; /** * @param {MouseEvent | TouchEvent} event * @returns {{ clientX: number, clientY: number }} */ const getClientXY = event => { let clientX = 0, clientY = 0; if (event.type.startsWith('mouse')) { clientX = /** @type {MouseEvent} */event.clientX; clientY = /** @type {MouseEvent} */event.clientY; } else if (event.type.startsWith('touch')) { clientX = /** @type {TouchEvent} */event.touches[0].clientX; clientY = /** @type {TouchEvent} */event.touches[0].clientY; } return { clientX, clientY }; }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderPopup = (instance, params) => { const container = getContainer(); const popup = getPopup(); if (!container || !popup) { return; } // Width // https://github.com/sweetalert2/sweetalert2/issues/2170 if (params.toast) { applyNumericalStyle(container, 'width', params.width); popup.style.width = '100%'; const loader = getLoader(); if (loader) { popup.insertBefore(loader, getIcon()); } } else { applyNumericalStyle(popup, 'width', params.width); } // Padding applyNumericalStyle(popup, 'padding', params.padding); // Color if (params.color) { popup.style.color = params.color; } // Background if (params.background) { popup.style.background = params.background; } hide(getValidationMessage()); // Classes addClasses$1(popup, params); if (params.draggable && !params.toast) { addClass(popup, swalClasses.draggable); addDraggableListeners(popup); } else { removeClass(popup, swalClasses.draggable); removeDraggableListeners(popup); } }; /** * @param {HTMLElement} popup * @param {SweetAlertOptions} params */ const addClasses$1 = (popup, params) => { const showClass = params.showClass || {}; // Default Class + showClass when updating Swal.update({}) popup.className = `${swalClasses.popup} ${isVisible$1(popup) ? showClass.popup : ''}`; if (params.toast) { addClass([document.documentElement, document.body], swalClasses['toast-shown']); addClass(popup, swalClasses.toast); } else { addClass(popup, swalClasses.modal); } // Custom class applyCustomClass(popup, params, 'popup'); // TODO: remove in the next major if (typeof params.customClass === 'string') { addClass(popup, params.customClass); } // Icon class (#1842) if (params.icon) { addClass(popup, swalClasses[`icon-${params.icon}`]); } }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderProgressSteps = (instance, params) => { const progressStepsContainer = getProgressSteps(); if (!progressStepsContainer) { return; } const { progressSteps, currentProgressStep } = params; if (!progressSteps || progressSteps.length === 0 || currentProgressStep === undefined) { hide(progressStepsContainer); return; } show(progressStepsContainer); progressStepsContainer.textContent = ''; if (currentProgressStep >= progressSteps.length) { warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)'); } progressSteps.forEach((step, index) => { const stepEl = createStepElement(step); progressStepsContainer.appendChild(stepEl); if (index === currentProgressStep) { addClass(stepEl, swalClasses['active-progress-step']); } if (index !== progressSteps.length - 1) { const lineEl = createLineElement(params); progressStepsContainer.appendChild(lineEl); } }); }; /** * @param {string} step * @returns {HTMLLIElement} */ const createStepElement = step => { const stepEl = document.createElement('li'); addClass(stepEl, swalClasses['progress-step']); setInnerHtml(stepEl, step); return stepEl; }; /** * @param {SweetAlertOptions} params * @returns {HTMLLIElement} */ const createLineElement = params => { const lineEl = document.createElement('li'); addClass(lineEl, swalClasses['progress-step-line']); if (params.progressStepsDistance) { applyNumericalStyle(lineEl, 'width', params.progressStepsDistance); } return lineEl; }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const renderTitle = (instance, params) => { const title = getTitle(); if (!title) { return; } showWhenInnerHtmlPresent(title); toggle(title, Boolean(params.title || params.titleText), 'block'); if (params.title) { parseHtmlToContainer(params.title, title); } if (params.titleText) { title.innerText = params.titleText; } // Custom class applyCustomClass(title, params, 'title'); }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const render = (instance, params) => { renderPopup(instance, params); renderContainer(instance, params); renderProgressSteps(instance, params); renderIcon(instance, params); renderImage(instance, params); renderTitle(instance, params); renderCloseButton(instance, params); renderContent(instance, params); renderActions(instance, params); renderFooter(instance, params); const popup = getPopup(); if (typeof params.didRender === 'function' && popup) { params.didRender(popup); } globalState.eventEmitter.emit('didRender', popup); }; /* * Global function to determine if SweetAlert2 popup is shown */ const isVisible = () => { return isVisible$1(getPopup()); }; /* * Global function to click 'Confirm' button */ const clickConfirm = () => { var _dom$getConfirmButton; return (_dom$getConfirmButton = getConfirmButton()) === null || _dom$getConfirmButton === void 0 ? void 0 : _dom$getConfirmButton.click(); }; /* * Global function to click 'Deny' button */ const clickDeny = () => { var _dom$getDenyButton; return (_dom$getDenyButton = getDenyButton()) === null || _dom$getDenyButton === void 0 ? void 0 : _dom$getDenyButton.click(); }; /* * Global function to click 'Cancel' button */ const clickCancel = () => { var _dom$getCancelButton; return (_dom$getCancelButton = getCancelButton()) === null || _dom$getCancelButton === void 0 ? void 0 : _dom$getCancelButton.click(); }; /** @type {Record} */ const DismissReason = Object.freeze({ cancel: 'cancel', backdrop: 'backdrop', close: 'close', esc: 'esc', timer: 'timer' }); /** * @param {GlobalState} globalState */ const removeKeydownHandler = globalState => { if (globalState.keydownTarget && globalState.keydownHandlerAdded) { globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }); globalState.keydownHandlerAdded = false; } }; /** * @param {GlobalState} globalState * @param {SweetAlertOptions} innerParams * @param {(dismiss: DismissReason) => void} dismissWith */ const addKeydownHandler = (globalState, innerParams, dismissWith) => { removeKeydownHandler(globalState); if (!innerParams.toast) { globalState.keydownHandler = e => keydownHandler(innerParams, e, dismissWith); globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup(); globalState.keydownListenerCapture = innerParams.keydownListenerCapture; globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { capture: globalState.keydownListenerCapture }); globalState.keydownHandlerAdded = true; } }; /** * @param {number} index * @param {number} increment */ const setFocus = (index, increment) => { var _dom$getPopup; const focusableElements = getFocusableElements(); // search for visible elements and select the next possible match if (focusableElements.length) { index = index + increment; // shift + tab when .swal2-popup is focused if (index === -2) { index = focusableElements.length - 1; } // rollover to first item if (index === focusableElements.length) { index = 0; // go to last item } else if (index === -1) { index = focusableElements.length - 1; } focusableElements[index].focus(); return; } // no visible focusable elements, focus the popup (_dom$getPopup = getPopup()) === null || _dom$getPopup === void 0 || _dom$getPopup.focus(); }; const arrowKeysNextButton = ['ArrowRight', 'ArrowDown']; const arrowKeysPreviousButton = ['ArrowLeft', 'ArrowUp']; /** * @param {SweetAlertOptions} innerParams * @param {KeyboardEvent} event * @param {(dismiss: DismissReason) => void} dismissWith */ const keydownHandler = (innerParams, event, dismissWith) => { if (!innerParams) { return; // This instance has already been destroyed } // Ignore keydown during IME composition // https://developer.mozilla.org/en-US/docs/Web/API/Document/keydown_event#ignoring_keydown_during_ime_composition // https://github.com/sweetalert2/sweetalert2/issues/720 // https://github.com/sweetalert2/sweetalert2/issues/2406 if (event.isComposing || event.keyCode === 229) { return; } if (innerParams.stopKeydownPropagation) { event.stopPropagation(); } // ENTER if (event.key === 'Enter') { handleEnter(event, innerParams); } // TAB else if (event.key === 'Tab') { handleTab(event); } // ARROWS - switch focus between buttons else if ([...arrowKeysNextButton, ...arrowKeysPreviousButton].includes(event.key)) { handleArrows(event.key); } // ESC else if (event.key === 'Escape') { handleEsc(event, innerParams, dismissWith); } }; /** * @param {KeyboardEvent} event * @param {SweetAlertOptions} innerParams */ const handleEnter = (event, innerParams) => { // https://github.com/sweetalert2/sweetalert2/issues/2386 if (!callIfFunction(innerParams.allowEnterKey)) { return; } const input = getInput$1(getPopup(), innerParams.input); if (event.target && input && event.target instanceof HTMLElement && event.target.outerHTML === input.outerHTML) { if (['textarea', 'file'].includes(innerParams.input)) { return; // do not submit } clickConfirm(); event.preventDefault(); } }; /** * @param {KeyboardEvent} event */ const handleTab = event => { const targetElement = event.target; const focusableElements = getFocusableElements(); let btnIndex = -1; for (let i = 0; i < focusableElements.length; i++) { if (targetElement === focusableElements[i]) { btnIndex = i; break; } } // Cycle to the next button if (!event.shiftKey) { setFocus(btnIndex, 1); } // Cycle to the prev button else { setFocus(btnIndex, -1); } event.stopPropagation(); event.preventDefault(); }; /** * @param {string} key */ const handleArrows = key => { const actions = getActions(); const confirmButton = getConfirmButton(); const denyButton = getDenyButton(); const cancelButton = getCancelButton(); if (!actions || !confirmButton || !denyButton || !cancelButton) { return; } /** @type HTMLElement[] */ const buttons = [confirmButton, denyButton, cancelButton]; if (document.activeElement instanceof HTMLElement && !buttons.includes(document.activeElement)) { return; } const sibling = arrowKeysNextButton.includes(key) ? 'nextElementSibling' : 'previousElementSibling'; let buttonToFocus = document.activeElement; if (!buttonToFocus) { return; } for (let i = 0; i < actions.children.length; i++) { buttonToFocus = buttonToFocus[sibling]; if (!buttonToFocus) { return; } if (buttonToFocus instanceof HTMLButtonElement && isVisible$1(buttonToFocus)) { break; } } if (buttonToFocus instanceof HTMLButtonElement) { buttonToFocus.focus(); } }; /** * @param {KeyboardEvent} event * @param {SweetAlertOptions} innerParams * @param {(dismiss: DismissReason) => void} dismissWith */ const handleEsc = (event, innerParams, dismissWith) => { event.preventDefault(); if (callIfFunction(innerParams.allowEscapeKey)) { dismissWith(DismissReason.esc); } }; /** * This module contains `WeakMap`s for each effectively-"private property" that a `Swal` has. * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` * This is the approach that Babel will probably take to implement private methods/fields * https://github.com/tc39/proposal-private-methods * https://github.com/babel/babel/pull/7555 * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* * then we can use that language feature. */ var privateMethods = { swalPromiseResolve: new WeakMap(), swalPromiseReject: new WeakMap() }; // From https://developer.paciellogroup.com/blog/2018/06/the-current-state-of-modal-dialog-accessibility/ // Adding aria-hidden="true" to elements outside of the active modal dialog ensures that // elements not within the active modal dialog will not be surfaced if a user opens a screen // reader’s list of elements (headings, form controls, landmarks, etc.) in the document. const setAriaHidden = () => { const container = getContainer(); const bodyChildren = Array.from(document.body.children); bodyChildren.forEach(el => { if (el.contains(container)) { return; } if (el.hasAttribute('aria-hidden')) { el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden') || ''); } el.setAttribute('aria-hidden', 'true'); }); }; const unsetAriaHidden = () => { const bodyChildren = Array.from(document.body.children); bodyChildren.forEach(el => { if (el.hasAttribute('data-previous-aria-hidden')) { el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden') || ''); el.removeAttribute('data-previous-aria-hidden'); } else { el.removeAttribute('aria-hidden'); } }); }; // @ts-ignore const isSafariOrIOS = typeof window !== 'undefined' && !!window.GestureEvent; // true for Safari desktop + all iOS browsers https://stackoverflow.com/a/70585394 /** * Fix iOS scrolling * http://stackoverflow.com/q/39626302 */ const iOSfix = () => { if (isSafariOrIOS && !hasClass(document.body, swalClasses.iosfix)) { const offset = document.body.scrollTop; document.body.style.top = `${offset * -1}px`; addClass(document.body, swalClasses.iosfix); lockBodyScroll(); } }; /** * https://github.com/sweetalert2/sweetalert2/issues/1246 */ const lockBodyScroll = () => { const container = getContainer(); if (!container) { return; } /** @type {boolean} */ let preventTouchMove; /** * @param {TouchEvent} event */ container.ontouchstart = event => { preventTouchMove = shouldPreventTouchMove(event); }; /** * @param {TouchEvent} event */ container.ontouchmove = event => { if (preventTouchMove) { event.preventDefault(); event.stopPropagation(); } }; }; /** * @param {TouchEvent} event * @returns {boolean} */ const shouldPreventTouchMove = event => { const target = event.target; const container = getContainer(); const htmlContainer = getHtmlContainer(); if (!container || !htmlContainer) { return false; } if (isStylus(event) || isZoom(event)) { return false; } if (target === container) { return true; } if (!isScrollable(container) && target instanceof HTMLElement && !selfOrParentIsScrollable(target, htmlContainer) && // #2823 target.tagName !== 'INPUT' && // #1603 target.tagName !== 'TEXTAREA' && // #2266 !(isScrollable(htmlContainer) && // #1944 htmlContainer.contains(target))) { return true; } return false; }; /** * https://github.com/sweetalert2/sweetalert2/issues/1786 * * @param {object} event * @returns {boolean} */ const isStylus = event => { return event.touches && event.touches.length && event.touches[0].touchType === 'stylus'; }; /** * https://github.com/sweetalert2/sweetalert2/issues/1891 * * @param {TouchEvent} event * @returns {boolean} */ const isZoom = event => { return event.touches && event.touches.length > 1; }; const undoIOSfix = () => { if (hasClass(document.body, swalClasses.iosfix)) { const offset = parseInt(document.body.style.top, 10); removeClass(document.body, swalClasses.iosfix); document.body.style.top = ''; document.body.scrollTop = offset * -1; } }; /** * Measure scrollbar width for padding body during modal show/hide * https://github.com/twbs/bootstrap/blob/master/js/src/modal.js * * @returns {number} */ const measureScrollbar = () => { const scrollDiv = document.createElement('div'); scrollDiv.className = swalClasses['scrollbar-measure']; document.body.appendChild(scrollDiv); const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; document.body.removeChild(scrollDiv); return scrollbarWidth; }; /** * Remember state in cases where opening and handling a modal will fiddle with it. * @type {number | null} */ let previousBodyPadding = null; /** * @param {string} initialBodyOverflow */ const replaceScrollbarWithPadding = initialBodyOverflow => { // for queues, do not do this more than once if (previousBodyPadding !== null) { return; } // if the body has overflow if (document.body.scrollHeight > window.innerHeight || initialBodyOverflow === 'scroll' // https://github.com/sweetalert2/sweetalert2/issues/2663 ) { // add padding so the content doesn't shift after removal of scrollbar previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')); document.body.style.paddingRight = `${previousBodyPadding + measureScrollbar()}px`; } }; const undoReplaceScrollbarWithPadding = () => { if (previousBodyPadding !== null) { document.body.style.paddingRight = `${previousBodyPadding}px`; previousBodyPadding = null; } }; /** * @param {SweetAlert} instance * @param {HTMLElement} container * @param {boolean} returnFocus * @param {() => void} didClose */ function removePopupAndResetState(instance, container, returnFocus, didClose) { if (isToast()) { triggerDidCloseAndDispose(instance, didClose); } else { restoreActiveElement(returnFocus).then(() => triggerDidCloseAndDispose(instance, didClose)); removeKeydownHandler(globalState); } // workaround for https://github.com/sweetalert2/sweetalert2/issues/2088 // for some reason removing the container in Safari will scroll the document to bottom if (isSafariOrIOS) { container.setAttribute('style', 'display:none !important'); container.removeAttribute('class'); container.innerHTML = ''; } else { container.remove(); } if (isModal()) { undoReplaceScrollbarWithPadding(); undoIOSfix(); unsetAriaHidden(); } removeBodyClasses(); } /** * Remove SweetAlert2 classes from body */ function removeBodyClasses() { removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown']]); } /** * Instance method to close sweetAlert * * @param {SweetAlertResult | undefined} resolveValue */ function close(resolveValue) { resolveValue = prepareResolveValue(resolveValue); const swalPromiseResolve = privateMethods.swalPromiseResolve.get(this); const didClose = triggerClosePopup(this); if (this.isAwaitingPromise) { // A swal awaiting for a promise (after a click on Confirm or Deny) cannot be dismissed anymore #2335 if (!resolveValue.isDismissed) { handleAwaitingPromise(this); swalPromiseResolve(resolveValue); } } else if (didClose) { // Resolve Swal promise swalPromiseResolve(resolveValue); } } const triggerClosePopup = instance => { const popup = getPopup(); if (!popup) { return false; } const innerParams = privateProps.innerParams.get(instance); if (!innerParams || hasClass(popup, innerParams.hideClass.popup)) { return false; } removeClass(popup, innerParams.showClass.popup); addClass(popup, innerParams.hideClass.popup); const backdrop = getContainer(); removeClass(backdrop, innerParams.showClass.backdrop); addClass(backdrop, innerParams.hideClass.backdrop); handlePopupAnimation(instance, popup, innerParams); return true; }; /** * @param {Error | string} error */ function rejectPromise(error) { const rejectPromise = privateMethods.swalPromiseReject.get(this); handleAwaitingPromise(this); if (rejectPromise) { // Reject Swal promise rejectPromise(error); } } /** * @param {SweetAlert} instance */ const handleAwaitingPromise = instance => { if (instance.isAwaitingPromise) { delete instance.isAwaitingPromise; // The instance might have been previously partly destroyed, we must resume the destroy process in this case #2335 if (!privateProps.innerParams.get(instance)) { instance._destroy(); } } }; /** * @param {SweetAlertResult | undefined} resolveValue * @returns {SweetAlertResult} */ const prepareResolveValue = resolveValue => { // When user calls Swal.close() if (typeof resolveValue === 'undefined') { return { isConfirmed: false, isDenied: false, isDismissed: true }; } return Object.assign({ isConfirmed: false, isDenied: false, isDismissed: false }, resolveValue); }; /** * @param {SweetAlert} instance * @param {HTMLElement} popup * @param {SweetAlertOptions} innerParams */ const handlePopupAnimation = (instance, popup, innerParams) => { var _globalState$eventEmi; const container = getContainer(); // If animation is supported, animate const animationIsSupported = hasCssAnimation(popup); if (typeof innerParams.willClose === 'function') { innerParams.willClose(popup); } (_globalState$eventEmi = globalState.eventEmitter) === null || _globalState$eventEmi === void 0 || _globalState$eventEmi.emit('willClose', popup); if (animationIsSupported) { animatePopup(instance, popup, container, innerParams.returnFocus, innerParams.didClose); } else { // Otherwise, remove immediately removePopupAndResetState(instance, container, innerParams.returnFocus, innerParams.didClose); } }; /** * @param {SweetAlert} instance * @param {HTMLElement} popup * @param {HTMLElement} container * @param {boolean} returnFocus * @param {() => void} didClose */ const animatePopup = (instance, popup, container, returnFocus, didClose) => { globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, returnFocus, didClose); /** * @param {AnimationEvent | TransitionEvent} e */ const swalCloseAnimationFinished = function (e) { if (e.target === popup) { var _globalState$swalClos; (_globalState$swalClos = globalState.swalCloseEventFinishedCallback) === null || _globalState$swalClos === void 0 || _globalState$swalClos.call(globalState); delete globalState.swalCloseEventFinishedCallback; popup.removeEventListener('animationend', swalCloseAnimationFinished); popup.removeEventListener('transitionend', swalCloseAnimationFinished); } }; popup.addEventListener('animationend', swalCloseAnimationFinished); popup.addEventListener('transitionend', swalCloseAnimationFinished); }; /** * @param {SweetAlert} instance * @param {() => void} didClose */ const triggerDidCloseAndDispose = (instance, didClose) => { setTimeout(() => { var _globalState$eventEmi2; if (typeof didClose === 'function') { didClose.bind(instance.params)(); } (_globalState$eventEmi2 = globalState.eventEmitter) === null || _globalState$eventEmi2 === void 0 || _globalState$eventEmi2.emit('didClose'); // instance might have been destroyed already if (instance._destroy) { instance._destroy(); } }); }; /** * Shows loader (spinner), this is useful with AJAX requests. * By default the loader be shown instead of the "Confirm" button. * * @param {HTMLButtonElement | null} [buttonToReplace] */ const showLoading = buttonToReplace => { let popup = getPopup(); if (!popup) { new Swal(); } popup = getPopup(); if (!popup) { return; } const loader = getLoader(); if (isToast()) { hide(getIcon()); } else { replaceButton(popup, buttonToReplace); } show(loader); popup.setAttribute('data-loading', 'true'); popup.setAttribute('aria-busy', 'true'); popup.focus(); }; /** * @param {HTMLElement} popup * @param {HTMLButtonElement | null} [buttonToReplace] */ const replaceButton = (popup, buttonToReplace) => { const actions = getActions(); const loader = getLoader(); if (!actions || !loader) { return; } if (!buttonToReplace && isVisible$1(getConfirmButton())) { buttonToReplace = getConfirmButton(); } show(actions); if (buttonToReplace) { hide(buttonToReplace); loader.setAttribute('data-button-to-replace', buttonToReplace.className); actions.insertBefore(loader, buttonToReplace); } addClass([popup, actions], swalClasses.loading); }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const handleInputOptionsAndValue = (instance, params) => { if (params.input === 'select' || params.input === 'radio') { handleInputOptions(instance, params); } else if (['text', 'email', 'number', 'tel', 'textarea'].some(i => i === params.input) && (hasToPromiseFn(params.inputValue) || isPromise(params.inputValue))) { showLoading(getConfirmButton()); handleInputValue(instance, params); } }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} innerParams * @returns {SweetAlertInputValue} */ const getInputValue = (instance, innerParams) => { const input = instance.getInput(); if (!input) { return null; } switch (innerParams.input) { case 'checkbox': return getCheckboxValue(input); case 'radio': return getRadioValue(input); case 'file': return getFileValue(input); default: return innerParams.inputAutoTrim ? input.value.trim() : input.value; } }; /** * @param {HTMLInputElement} input * @returns {number} */ const getCheckboxValue = input => input.checked ? 1 : 0; /** * @param {HTMLInputElement} input * @returns {string | null} */ const getRadioValue = input => input.checked ? input.value : null; /** * @param {HTMLInputElement} input * @returns {FileList | File | null} */ const getFileValue = input => input.files && input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const handleInputOptions = (instance, params) => { const popup = getPopup(); if (!popup) { return; } /** * @param {*} inputOptions */ const processInputOptions = inputOptions => { if (params.input === 'select') { populateSelectOptions(popup, formatInputOptions(inputOptions), params); } else if (params.input === 'radio') { populateRadioOptions(popup, formatInputOptions(inputOptions), params); } }; if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) { showLoading(getConfirmButton()); asPromise(params.inputOptions).then(inputOptions => { instance.hideLoading(); processInputOptions(inputOptions); }); } else if (typeof params.inputOptions === 'object') { processInputOptions(params.inputOptions); } else { error(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof params.inputOptions}`); } }; /** * @param {SweetAlert} instance * @param {SweetAlertOptions} params */ const handleInputValue = (instance, params) => { const input = instance.getInput(); if (!input) { return; } hide(input); asPromise(params.inputValue).then(inputValue => { input.value = params.input === 'number' ? `${parseFloat(inputValue) || 0}` : `${inputValue}`; show(input); input.focus(); instance.hideLoading(); }).catch(err => { error(`Error in inputValue promise: ${err}`); input.value = ''; show(input); input.focus(); instance.hideLoading(); }); }; /** * @param {HTMLElement} popup * @param {InputOptionFlattened[]} inputOptions * @param {SweetAlertOptions} params */ function populateSelectOptions(popup, inputOptions, params) { const select = getDirectChildByClass(popup, swalClasses.select); if (!select) { return; } /** * @param {HTMLElement} parent * @param {string} optionLabel * @param {string} optionValue */ const renderOption = (parent, optionLabel, optionValue) => { const option = document.createElement('option'); option.value = optionValue; setInnerHtml(option, optionLabel); option.selected = isSelected(optionValue, params.inputValue); parent.appendChild(option); }; inputOptions.forEach(inputOption => { const optionValue = inputOption[0]; const optionLabel = inputOption[1]; // spec: // https://www.w3.org/TR/html401/interact/forms.html#h-17.6 // "...all OPTGROUP elements must be specified directly within a SELECT element (i.e., groups may not be nested)..." // check whether this is a if (Array.isArray(optionLabel)) { // if it is an array, then it is an const optgroup = document.createElement('optgroup'); optgroup.label = optionValue; optgroup.disabled = false; // not configurable for now select.appendChild(optgroup); optionLabel.forEach(o => renderOption(optgroup, o[1], o[0])); } else { // case of valueFormatted = formatInputOptions(valueFormatted); } result.push([key, valueFormatted]); }); } else { Object.keys(inputOptions).forEach(key => { let valueFormatted = inputOptions[key]; if (typeof valueFormatted === 'object') { // case of valueFormatted = formatInputOptions(valueFormatted); } result.push([key, valueFormatted]); }); } return result; }; /** * @param {string} optionValue * @param {SweetAlertInputValue} inputValue * @returns {boolean} */ const isSelected = (optionValue, inputValue) => { return !!inputValue && inputValue.toString() === optionValue.toString(); }; /** * @param {SweetAlert} instance */ const handleConfirmButtonClick = instance => { const innerParams = privateProps.innerParams.get(instance); instance.disableButtons(); if (innerParams.input) { handleConfirmOrDenyWithInput(instance, 'confirm'); } else { confirm(instance, true); } }; /** * @param {SweetAlert} instance */ const handleDenyButtonClick = instance => { const innerParams = privateProps.innerParams.get(instance); instance.disableButtons(); if (innerParams.returnInputValueOnDeny) { handleConfirmOrDenyWithInput(instance, 'deny'); } else { deny(instance, false); } }; /** * @param {SweetAlert} instance * @param {(dismiss: DismissReason) => void} dismissWith */ const handleCancelButtonClick = (instance, dismissWith) => { instance.disableButtons(); dismissWith(DismissReason.cancel); }; /** * @param {SweetAlert} instance * @param {'confirm' | 'deny'} type */ const handleConfirmOrDenyWithInput = (instance, type) => { const innerParams = privateProps.innerParams.get(instance); if (!innerParams.input) { error(`The "input" parameter is needed to be set when using returnInputValueOn${capitalizeFirstLetter(type)}`); return; } const input = instance.getInput(); const inputValue = getInputValue(instance, innerParams); if (innerParams.inputValidator) { handleInputValidator(instance, inputValue, type); } else if (input && !input.checkValidity()) { instance.enableButtons(); instance.showValidationMessage(innerParams.validationMessage || input.validationMessage); } else if (type === 'deny') { deny(instance, inputValue); } else { confirm(instance, inputValue); } }; /** * @param {SweetAlert} instance * @param {SweetAlertInputValue} inputValue * @param {'confirm' | 'deny'} type */ const handleInputValidator = (instance, inputValue, type) => { const innerParams = privateProps.innerParams.get(instance); instance.disableInput(); const validationPromise = Promise.resolve().then(() => asPromise(innerParams.inputValidator(inputValue, innerParams.validationMessage))); validationPromise.then(validationMessage => { instance.enableButtons(); instance.enableInput(); if (validationMessage) { instance.showValidationMessage(validationMessage); } else if (type === 'deny') { deny(instance, inputValue); } else { confirm(instance, inputValue); } }); }; /** * @param {SweetAlert} instance * @param {*} value */ const deny = (instance, value) => { const innerParams = privateProps.innerParams.get(instance || undefined); if (innerParams.showLoaderOnDeny) { showLoading(getDenyButton()); } if (innerParams.preDeny) { instance.isAwaitingPromise = true; // Flagging the instance as awaiting a promise so it's own promise's reject/resolve methods doesn't get destroyed until the result from this preDeny's promise is received const preDenyPromise = Promise.resolve().then(() => asPromise(innerParams.preDeny(value, innerParams.validationMessage))); preDenyPromise.then(preDenyValue => { if (preDenyValue === false) { instance.hideLoading(); handleAwaitingPromise(instance); } else { instance.close(/** @type SweetAlertResult */{ isDenied: true, value: typeof preDenyValue === 'undefined' ? value : preDenyValue }); } }).catch(error => rejectWith(instance || undefined, error)); } else { instance.close(/** @type SweetAlertResult */{ isDenied: true, value }); } }; /** * @param {SweetAlert} instance * @param {*} value */ const succeedWith = (instance, value) => { instance.close(/** @type SweetAlertResult */{ isConfirmed: true, value }); }; /** * * @param {SweetAlert} instance * @param {string} error */ const rejectWith = (instance, error) => { instance.rejectPromise(error); }; /** * * @param {SweetAlert} instance * @param {*} value */ const confirm = (instance, value) => { const innerParams = privateProps.innerParams.get(instance || undefined); if (innerParams.showLoaderOnConfirm) { showLoading(); } if (innerParams.preConfirm) { instance.resetValidationMessage(); instance.isAwaitingPromise = true; // Flagging the instance as awaiting a promise so it's own promise's reject/resolve methods doesn't get destroyed until the result from this preConfirm's promise is received const preConfirmPromise = Promise.resolve().then(() => asPromise(innerParams.preConfirm(value, innerParams.validationMessage))); preConfirmPromise.then(preConfirmValue => { if (isVisible$1(getValidationMessage()) || preConfirmValue === false) { instance.hideLoading(); handleAwaitingPromise(instance); } else { succeedWith(instance, typeof preConfirmValue === 'undefined' ? value : preConfirmValue); } }).catch(error => rejectWith(instance || undefined, error)); } else { succeedWith(instance, value); } }; /** * Hides loader and shows back the button which was hidden by .showLoading() */ function hideLoading() { // do nothing if popup is closed const innerParams = privateProps.innerParams.get(this); if (!innerParams) { return; } const domCache = privateProps.domCache.get(this); hide(domCache.loader); if (isToast()) { if (innerParams.icon) { show(getIcon()); } } else { showRelatedButton(domCache); } removeClass([domCache.popup, domCache.actions], swalClasses.loading); domCache.popup.removeAttribute('aria-busy'); domCache.popup.removeAttribute('data-loading'); domCache.confirmButton.disabled = false; domCache.denyButton.disabled = false; domCache.cancelButton.disabled = false; } const showRelatedButton = domCache => { const buttonToReplace = domCache.popup.getElementsByClassName(domCache.loader.getAttribute('data-button-to-replace')); if (buttonToReplace.length) { show(buttonToReplace[0], 'inline-block'); } else if (allButtonsAreHidden()) { hide(domCache.actions); } }; /** * Gets the input DOM node, this method works with input parameter. * * @returns {HTMLInputElement | null} */ function getInput() { const innerParams = privateProps.innerParams.get(this); const domCache = privateProps.domCache.get(this); if (!domCache) { return null; } return getInput$1(domCache.popup, innerParams.input); } /** * @param {SweetAlert} instance * @param {string[]} buttons * @param {boolean} disabled */ function setButtonsDisabled(instance, buttons, disabled) { const domCache = privateProps.domCache.get(instance); buttons.forEach(button => { domCache[button].disabled = disabled; }); } /** * @param {HTMLInputElement | null} input * @param {boolean} disabled */ function setInputDisabled(input, disabled) { const popup = getPopup(); if (!popup || !input) { return; } if (input.type === 'radio') { /** @type {NodeListOf} */ const radios = popup.querySelectorAll(`[name="${swalClasses.radio}"]`); for (let i = 0; i < radios.length; i++) { radios[i].disabled = disabled; } } else { input.disabled = disabled; } } /** * Enable all the buttons * @this {SweetAlert} */ function enableButtons() { setButtonsDisabled(this, ['confirmButton', 'denyButton', 'cancelButton'], false); } /** * Disable all the buttons * @this {SweetAlert} */ function disableButtons() { setButtonsDisabled(this, ['confirmButton', 'denyButton', 'cancelButton'], true); } /** * Enable the input field * @this {SweetAlert} */ function enableInput() { setInputDisabled(this.getInput(), false); } /** * Disable the input field * @this {SweetAlert} */ function disableInput() { setInputDisabled(this.getInput(), true); } /** * Show block with validation message * * @param {string} error * @this {SweetAlert} */ function showValidationMessage(error) { const domCache = privateProps.domCache.get(this); const params = privateProps.innerParams.get(this); setInnerHtml(domCache.validationMessage, error); domCache.validationMessage.className = swalClasses['validation-message']; if (params.customClass && params.customClass.validationMessage) { addClass(domCache.validationMessage, params.customClass.validationMessage); } show(domCache.validationMessage); const input = this.getInput(); if (input) { input.setAttribute('aria-invalid', 'true'); input.setAttribute('aria-describedby', swalClasses['validation-message']); focusInput(input); addClass(input, swalClasses.inputerror); } } /** * Hide block with validation message * * @this {SweetAlert} */ function resetValidationMessage() { const domCache = privateProps.domCache.get(this); if (domCache.validationMessage) { hide(domCache.validationMessage); } const input = this.getInput(); if (input) { input.removeAttribute('aria-invalid'); input.removeAttribute('aria-describedby'); removeClass(input, swalClasses.inputerror); } } const defaultParams = { title: '', titleText: '', text: '', html: '', footer: '', icon: undefined, iconColor: undefined, iconHtml: undefined, template: undefined, toast: false, draggable: false, animation: true, theme: 'light', showClass: { popup: 'swal2-show', backdrop: 'swal2-backdrop-show', icon: 'swal2-icon-show' }, hideClass: { popup: 'swal2-hide', backdrop: 'swal2-backdrop-hide', icon: 'swal2-icon-hide' }, customClass: {}, target: 'body', color: undefined, backdrop: true, heightAuto: true, allowOutsideClick: true, allowEscapeKey: true, allowEnterKey: true, stopKeydownPropagation: true, keydownListenerCapture: false, showConfirmButton: true, showDenyButton: false, showCancelButton: false, preConfirm: undefined, preDeny: undefined, confirmButtonText: 'OK', confirmButtonAriaLabel: '', confirmButtonColor: undefined, denyButtonText: 'No', denyButtonAriaLabel: '', denyButtonColor: undefined, cancelButtonText: 'Cancel', cancelButtonAriaLabel: '', cancelButtonColor: undefined, buttonsStyling: true, reverseButtons: false, focusConfirm: true, focusDeny: false, focusCancel: false, returnFocus: true, showCloseButton: false, closeButtonHtml: '×', closeButtonAriaLabel: 'Close this dialog', loaderHtml: '', showLoaderOnConfirm: false, showLoaderOnDeny: false, imageUrl: undefined, imageWidth: undefined, imageHeight: undefined, imageAlt: '', timer: undefined, timerProgressBar: false, width: undefined, padding: undefined, background: undefined, input: undefined, inputPlaceholder: '', inputLabel: '', inputValue: '', inputOptions: {}, inputAutoFocus: true, inputAutoTrim: true, inputAttributes: {}, inputValidator: undefined, returnInputValueOnDeny: false, validationMessage: undefined, grow: false, position: 'center', progressSteps: [], currentProgressStep: undefined, progressStepsDistance: undefined, willOpen: undefined, didOpen: undefined, didRender: undefined, willClose: undefined, didClose: undefined, didDestroy: undefined, scrollbarPadding: true, topLayer: false }; const updatableParams = ['allowEscapeKey', 'allowOutsideClick', 'background', 'buttonsStyling', 'cancelButtonAriaLabel', 'cancelButtonColor', 'cancelButtonText', 'closeButtonAriaLabel', 'closeButtonHtml', 'color', 'confirmButtonAriaLabel', 'confirmButtonColor', 'confirmButtonText', 'currentProgressStep', 'customClass', 'denyButtonAriaLabel', 'denyButtonColor', 'denyButtonText', 'didClose', 'didDestroy', 'draggable', 'footer', 'hideClass', 'html', 'icon', 'iconColor', 'iconHtml', 'imageAlt', 'imageHeight', 'imageUrl', 'imageWidth', 'preConfirm', 'preDeny', 'progressSteps', 'returnFocus', 'reverseButtons', 'showCancelButton', 'showCloseButton', 'showConfirmButton', 'showDenyButton', 'text', 'title', 'titleText', 'theme', 'willClose']; /** @type {Record} */ const deprecatedParams = { allowEnterKey: undefined }; const toastIncompatibleParams = ['allowOutsideClick', 'allowEnterKey', 'backdrop', 'draggable', 'focusConfirm', 'focusDeny', 'focusCancel', 'returnFocus', 'heightAuto', 'keydownListenerCapture']; /** * Is valid parameter * * @param {string} paramName * @returns {boolean} */ const isValidParameter = paramName => { return Object.prototype.hasOwnProperty.call(defaultParams, paramName); }; /** * Is valid parameter for Swal.update() method * * @param {string} paramName * @returns {boolean} */ const isUpdatableParameter = paramName => { return updatableParams.indexOf(paramName) !== -1; }; /** * Is deprecated parameter * * @param {string} paramName * @returns {string | undefined} */ const isDeprecatedParameter = paramName => { return deprecatedParams[paramName]; }; /** * @param {string} param */ const checkIfParamIsValid = param => { if (!isValidParameter(param)) { warn(`Unknown parameter "${param}"`); } }; /** * @param {string} param */ const checkIfToastParamIsValid = param => { if (toastIncompatibleParams.includes(param)) { warn(`The parameter "${param}" is incompatible with toasts`); } }; /** * @param {string} param */ const checkIfParamIsDeprecated = param => { const isDeprecated = isDeprecatedParameter(param); if (isDeprecated) { warnAboutDeprecation(param, isDeprecated); } }; /** * Show relevant warnings for given params * * @param {SweetAlertOptions} params */ const showWarningsForParams = params => { if (params.backdrop === false && params.allowOutsideClick) { warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'); } if (params.theme && !['light', 'dark', 'auto', 'minimal', 'borderless', 'bootstrap-4', 'bootstrap-4-light', 'bootstrap-4-dark', 'bootstrap-5', 'bootstrap-5-light', 'bootstrap-5-dark', 'material-ui', 'material-ui-light', 'material-ui-dark', 'embed-iframe', 'bulma', 'bulma-light', 'bulma-dark'].includes(params.theme)) { warn(`Invalid theme "${params.theme}"`); } for (const param in params) { checkIfParamIsValid(param); if (params.toast) { checkIfToastParamIsValid(param); } checkIfParamIsDeprecated(param); } }; /** * Updates popup parameters. * * @param {SweetAlertOptions} params */ function update(params) { const container = getContainer(); const popup = getPopup(); const innerParams = privateProps.innerParams.get(this); if (!popup || hasClass(popup, innerParams.hideClass.popup)) { warn(`You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.`); return; } const validUpdatableParams = filterValidParams(params); const updatedParams = Object.assign({}, innerParams, validUpdatableParams); showWarningsForParams(updatedParams); container.dataset['swal2Theme'] = updatedParams.theme; render(this, updatedParams); privateProps.innerParams.set(this, updatedParams); Object.defineProperties(this, { params: { value: Object.assign({}, this.params, params), writable: false, enumerable: true } }); } /** * @param {SweetAlertOptions} params * @returns {SweetAlertOptions} */ const filterValidParams = params => { const validUpdatableParams = {}; Object.keys(params).forEach(param => { if (isUpdatableParameter(param)) { validUpdatableParams[param] = params[param]; } else { warn(`Invalid parameter to update: ${param}`); } }); return validUpdatableParams; }; /** * Dispose the current SweetAlert2 instance */ function _destroy() { const domCache = privateProps.domCache.get(this); const innerParams = privateProps.innerParams.get(this); if (!innerParams) { disposeWeakMaps(this); // The WeakMaps might have been partly destroyed, we must recall it to dispose any remaining WeakMaps #2335 return; // This instance has already been destroyed } // Check if there is another Swal closing if (domCache.popup && globalState.swalCloseEventFinishedCallback) { globalState.swalCloseEventFinishedCallback(); delete globalState.swalCloseEventFinishedCallback; } if (typeof innerParams.didDestroy === 'function') { innerParams.didDestroy(); } globalState.eventEmitter.emit('didDestroy'); disposeSwal(this); } /** * @param {SweetAlert} instance */ const disposeSwal = instance => { disposeWeakMaps(instance); // Unset this.params so GC will dispose it (#1569) delete instance.params; // Unset globalState props so GC will dispose globalState (#1569) delete globalState.keydownHandler; delete globalState.keydownTarget; // Unset currentInstance delete globalState.currentInstance; }; /** * @param {SweetAlert} instance */ const disposeWeakMaps = instance => { // If the current instance is awaiting a promise result, we keep the privateMethods to call them once the promise result is retrieved #2335 if (instance.isAwaitingPromise) { unsetWeakMaps(privateProps, instance); instance.isAwaitingPromise = true; } else { unsetWeakMaps(privateMethods, instance); unsetWeakMaps(privateProps, instance); delete instance.isAwaitingPromise; // Unset instance methods delete instance.disableButtons; delete instance.enableButtons; delete instance.getInput; delete instance.disableInput; delete instance.enableInput; delete instance.hideLoading; delete instance.disableLoading; delete instance.showValidationMessage; delete instance.resetValidationMessage; delete instance.close; delete instance.closePopup; delete instance.closeModal; delete instance.closeToast; delete instance.rejectPromise; delete instance.update; delete instance._destroy; } }; /** * @param {object} obj * @param {SweetAlert} instance */ const unsetWeakMaps = (obj, instance) => { for (const i in obj) { obj[i].delete(instance); } }; var instanceMethods = /*#__PURE__*/Object.freeze({ __proto__: null, _destroy: _destroy, close: close, closeModal: close, closePopup: close, closeToast: close, disableButtons: disableButtons, disableInput: disableInput, disableLoading: hideLoading, enableButtons: enableButtons, enableInput: enableInput, getInput: getInput, handleAwaitingPromise: handleAwaitingPromise, hideLoading: hideLoading, rejectPromise: rejectPromise, resetValidationMessage: resetValidationMessage, showValidationMessage: showValidationMessage, update: update }); /** * @param {SweetAlertOptions} innerParams * @param {DomCache} domCache * @param {(dismiss: DismissReason) => void} dismissWith */ const handlePopupClick = (innerParams, domCache, dismissWith) => { if (innerParams.toast) { handleToastClick(innerParams, domCache, dismissWith); } else { // Ignore click events that had mousedown on the popup but mouseup on the container // This can happen when the user drags a slider handleModalMousedown(domCache); // Ignore click events that had mousedown on the container but mouseup on the popup handleContainerMousedown(domCache); handleModalClick(innerParams, domCache, dismissWith); } }; /** * @param {SweetAlertOptions} innerParams * @param {DomCache} domCache * @param {(dismiss: DismissReason) => void} dismissWith */ const handleToastClick = (innerParams, domCache, dismissWith) => { // Closing toast by internal click domCache.popup.onclick = () => { if (innerParams && (isAnyButtonShown(innerParams) || innerParams.timer || innerParams.input)) { return; } dismissWith(DismissReason.close); }; }; /** * @param {SweetAlertOptions} innerParams * @returns {boolean} */ const isAnyButtonShown = innerParams => { return !!(innerParams.showConfirmButton || innerParams.showDenyButton || innerParams.showCancelButton || innerParams.showCloseButton); }; let ignoreOutsideClick = false; /** * @param {DomCache} domCache */ const handleModalMousedown = domCache => { domCache.popup.onmousedown = () => { domCache.container.onmouseup = function (e) { domCache.container.onmouseup = () => {}; // We only check if the mouseup target is the container because usually it doesn't // have any other direct children aside of the popup if (e.target === domCache.container) { ignoreOutsideClick = true; } }; }; }; /** * @param {DomCache} domCache */ const handleContainerMousedown = domCache => { domCache.container.onmousedown = e => { // prevent the modal text from being selected on double click on the container (allowOutsideClick: false) if (e.target === domCache.container) { e.preventDefault(); } domCache.popup.onmouseup = function (e) { domCache.popup.onmouseup = () => {}; // We also need to check if the mouseup target is a child of the popup if (e.target === domCache.popup || e.target instanceof HTMLElement && domCache.popup.contains(e.target)) { ignoreOutsideClick = true; } }; }; }; /** * @param {SweetAlertOptions} innerParams * @param {DomCache} domCache * @param {(dismiss: DismissReason) => void} dismissWith */ const handleModalClick = (innerParams, domCache, dismissWith) => { domCache.container.onclick = e => { if (ignoreOutsideClick) { ignoreOutsideClick = false; return; } if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) { dismissWith(DismissReason.backdrop); } }; }; const isJqueryElement = elem => typeof elem === 'object' && elem.jquery; const isElement = elem => elem instanceof Element || isJqueryElement(elem); const argsToParams = args => { const params = {}; if (typeof args[0] === 'object' && !isElement(args[0])) { Object.assign(params, args[0]); } else { ['title', 'html', 'icon'].forEach((name, index) => { const arg = args[index]; if (typeof arg === 'string' || isElement(arg)) { params[name] = arg; } else if (arg !== undefined) { error(`Unexpected type of ${name}! Expected "string" or "Element", got ${typeof arg}`); } }); } return params; }; /** * Main method to create a new SweetAlert2 popup * * @param {...SweetAlertOptions} args * @returns {Promise} */ function fire(...args) { return new this(...args); } /** * Returns an extended version of `Swal` containing `params` as defaults. * Useful for reusing Swal configuration. * * For example: * * Before: * const textPromptOptions = { input: 'text', showCancelButton: true } * const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' }) * const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' }) * * After: * const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true }) * const {value: firstName} = await TextPrompt('What is your first name?') * const {value: lastName} = await TextPrompt('What is your last name?') * * @param {SweetAlertOptions} mixinParams * @returns {SweetAlert} */ function mixin(mixinParams) { class MixinSwal extends this { _main(params, priorityMixinParams) { return super._main(params, Object.assign({}, mixinParams, priorityMixinParams)); } } // @ts-ignore return MixinSwal; } /** * If `timer` parameter is set, returns number of milliseconds of timer remained. * Otherwise, returns undefined. * * @returns {number | undefined} */ const getTimerLeft = () => { return globalState.timeout && globalState.timeout.getTimerLeft(); }; /** * Stop timer. Returns number of milliseconds of timer remained. * If `timer` parameter isn't set, returns undefined. * * @returns {number | undefined} */ const stopTimer = () => { if (globalState.timeout) { stopTimerProgressBar(); return globalState.timeout.stop(); } }; /** * Resume timer. Returns number of milliseconds of timer remained. * If `timer` parameter isn't set, returns undefined. * * @returns {number | undefined} */ const resumeTimer = () => { if (globalState.timeout) { const remaining = globalState.timeout.start(); animateTimerProgressBar(remaining); return remaining; } }; /** * Resume timer. Returns number of milliseconds of timer remained. * If `timer` parameter isn't set, returns undefined. * * @returns {number | undefined} */ const toggleTimer = () => { const timer = globalState.timeout; return timer && (timer.running ? stopTimer() : resumeTimer()); }; /** * Increase timer. Returns number of milliseconds of an updated timer. * If `timer` parameter isn't set, returns undefined. * * @param {number} ms * @returns {number | undefined} */ const increaseTimer = ms => { if (globalState.timeout) { const remaining = globalState.timeout.increase(ms); animateTimerProgressBar(remaining, true); return remaining; } }; /** * Check if timer is running. Returns true if timer is running * or false if timer is paused or stopped. * If `timer` parameter isn't set, returns undefined * * @returns {boolean} */ const isTimerRunning = () => { return !!(globalState.timeout && globalState.timeout.isRunning()); }; let bodyClickListenerAdded = false; const clickHandlers = {}; /** * @param {string} attr */ function bindClickHandler(attr = 'data-swal-template') { clickHandlers[attr] = this; if (!bodyClickListenerAdded) { document.body.addEventListener('click', bodyClickListener); bodyClickListenerAdded = true; } } const bodyClickListener = event => { for (let el = event.target; el && el !== document; el = el.parentNode) { for (const attr in clickHandlers) { const template = el.getAttribute(attr); if (template) { clickHandlers[attr].fire({ template }); return; } } } }; // Source: https://gist.github.com/mudge/5830382?permalink_comment_id=2691957#gistcomment-2691957 class EventEmitter { constructor() { /** @type {Events} */ this.events = {}; } /** * @param {string} eventName * @returns {EventHandlers} */ _getHandlersByEventName(eventName) { if (typeof this.events[eventName] === 'undefined') { // not Set because we need to keep the FIFO order // https://github.com/sweetalert2/sweetalert2/pull/2763#discussion_r1748990334 this.events[eventName] = []; } return this.events[eventName]; } /** * @param {string} eventName * @param {EventHandler} eventHandler */ on(eventName, eventHandler) { const currentHandlers = this._getHandlersByEventName(eventName); if (!currentHandlers.includes(eventHandler)) { currentHandlers.push(eventHandler); } } /** * @param {string} eventName * @param {EventHandler} eventHandler */ once(eventName, eventHandler) { /** * @param {Array} args */ const onceFn = (...args) => { this.removeListener(eventName, onceFn); eventHandler.apply(this, args); }; this.on(eventName, onceFn); } /** * @param {string} eventName * @param {Array} args */ emit(eventName, ...args) { this._getHandlersByEventName(eventName).forEach( /** * @param {EventHandler} eventHandler */ eventHandler => { try { eventHandler.apply(this, args); } catch (error) { console.error(error); } }); } /** * @param {string} eventName * @param {EventHandler} eventHandler */ removeListener(eventName, eventHandler) { const currentHandlers = this._getHandlersByEventName(eventName); const index = currentHandlers.indexOf(eventHandler); if (index > -1) { currentHandlers.splice(index, 1); } } /** * @param {string} eventName */ removeAllListeners(eventName) { if (this.events[eventName] !== undefined) { // https://github.com/sweetalert2/sweetalert2/pull/2763#discussion_r1749239222 this.events[eventName].length = 0; } } reset() { this.events = {}; } } globalState.eventEmitter = new EventEmitter(); /** * @param {string} eventName * @param {EventHandler} eventHandler */ const on = (eventName, eventHandler) => { globalState.eventEmitter.on(eventName, eventHandler); }; /** * @param {string} eventName * @param {EventHandler} eventHandler */ const once = (eventName, eventHandler) => { globalState.eventEmitter.once(eventName, eventHandler); }; /** * @param {string} [eventName] * @param {EventHandler} [eventHandler] */ const off = (eventName, eventHandler) => { // Remove all handlers for all events if (!eventName) { globalState.eventEmitter.reset(); return; } if (eventHandler) { // Remove a specific handler globalState.eventEmitter.removeListener(eventName, eventHandler); } else { // Remove all handlers for a specific event globalState.eventEmitter.removeAllListeners(eventName); } }; var staticMethods = /*#__PURE__*/Object.freeze({ __proto__: null, argsToParams: argsToParams, bindClickHandler: bindClickHandler, clickCancel: clickCancel, clickConfirm: clickConfirm, clickDeny: clickDeny, enableLoading: showLoading, fire: fire, getActions: getActions, getCancelButton: getCancelButton, getCloseButton: getCloseButton, getConfirmButton: getConfirmButton, getContainer: getContainer, getDenyButton: getDenyButton, getFocusableElements: getFocusableElements, getFooter: getFooter, getHtmlContainer: getHtmlContainer, getIcon: getIcon, getIconContent: getIconContent, getImage: getImage, getInputLabel: getInputLabel, getLoader: getLoader, getPopup: getPopup, getProgressSteps: getProgressSteps, getTimerLeft: getTimerLeft, getTimerProgressBar: getTimerProgressBar, getTitle: getTitle, getValidationMessage: getValidationMessage, increaseTimer: increaseTimer, isDeprecatedParameter: isDeprecatedParameter, isLoading: isLoading, isTimerRunning: isTimerRunning, isUpdatableParameter: isUpdatableParameter, isValidParameter: isValidParameter, isVisible: isVisible, mixin: mixin, off: off, on: on, once: once, resumeTimer: resumeTimer, showLoading: showLoading, stopTimer: stopTimer, toggleTimer: toggleTimer }); class Timer { /** * @param {() => void} callback * @param {number} delay */ constructor(callback, delay) { this.callback = callback; this.remaining = delay; this.running = false; this.start(); } /** * @returns {number} */ start() { if (!this.running) { this.running = true; this.started = new Date(); this.id = setTimeout(this.callback, this.remaining); } return this.remaining; } /** * @returns {number} */ stop() { if (this.started && this.running) { this.running = false; clearTimeout(this.id); this.remaining -= new Date().getTime() - this.started.getTime(); } return this.remaining; } /** * @param {number} n * @returns {number} */ increase(n) { const running = this.running; if (running) { this.stop(); } this.remaining += n; if (running) { this.start(); } return this.remaining; } /** * @returns {number} */ getTimerLeft() { if (this.running) { this.stop(); this.start(); } return this.remaining; } /** * @returns {boolean} */ isRunning() { return this.running; } } const swalStringParams = ['swal-title', 'swal-html', 'swal-footer']; /** * @param {SweetAlertOptions} params * @returns {SweetAlertOptions} */ const getTemplateParams = params => { const template = typeof params.template === 'string' ? (/** @type {HTMLTemplateElement} */document.querySelector(params.template)) : params.template; if (!template) { return {}; } /** @type {DocumentFragment} */ const templateContent = template.content; showWarningsForElements(templateContent); const result = Object.assign(getSwalParams(templateContent), getSwalFunctionParams(templateContent), getSwalButtons(templateContent), getSwalImage(templateContent), getSwalIcon(templateContent), getSwalInput(templateContent), getSwalStringParams(templateContent, swalStringParams)); return result; }; /** * @param {DocumentFragment} templateContent * @returns {Record} */ const getSwalParams = templateContent => { /** @type {Record} */ const result = {}; /** @type {HTMLElement[]} */ const swalParams = Array.from(templateContent.querySelectorAll('swal-param')); swalParams.forEach(param => { showWarningsForAttributes(param, ['name', 'value']); const paramName = /** @type {keyof SweetAlertOptions} */param.getAttribute('name'); const value = param.getAttribute('value'); if (!paramName || !value) { return; } if (typeof defaultParams[paramName] === 'boolean') { result[paramName] = value !== 'false'; } else if (typeof defaultParams[paramName] === 'object') { result[paramName] = JSON.parse(value); } else { result[paramName] = value; } }); return result; }; /** * @param {DocumentFragment} templateContent * @returns {Record void>} */ const getSwalFunctionParams = templateContent => { /** @type {Record void>} */ const result = {}; /** @type {HTMLElement[]} */ const swalFunctions = Array.from(templateContent.querySelectorAll('swal-function-param')); swalFunctions.forEach(param => { const paramName = /** @type {keyof SweetAlertOptions} */param.getAttribute('name'); const value = param.getAttribute('value'); if (!paramName || !value) { return; } result[paramName] = new Function(`return ${value}`)(); }); return result; }; /** * @param {DocumentFragment} templateContent * @returns {Record} */ const getSwalButtons = templateContent => { /** @type {Record} */ const result = {}; /** @type {HTMLElement[]} */ const swalButtons = Array.from(templateContent.querySelectorAll('swal-button')); swalButtons.forEach(button => { showWarningsForAttributes(button, ['type', 'color', 'aria-label']); const type = button.getAttribute('type'); if (!type || !['confirm', 'cancel', 'deny'].includes(type)) { return; } result[`${type}ButtonText`] = button.innerHTML; result[`show${capitalizeFirstLetter(type)}Button`] = true; if (button.hasAttribute('color')) { result[`${type}ButtonColor`] = button.getAttribute('color'); } if (button.hasAttribute('aria-label')) { result[`${type}ButtonAriaLabel`] = button.getAttribute('aria-label'); } }); return result; }; /** * @param {DocumentFragment} templateContent * @returns {Pick} */ const getSwalImage = templateContent => { const result = {}; /** @type {HTMLElement | null} */ const image = templateContent.querySelector('swal-image'); if (image) { showWarningsForAttributes(image, ['src', 'width', 'height', 'alt']); if (image.hasAttribute('src')) { result.imageUrl = image.getAttribute('src') || undefined; } if (image.hasAttribute('width')) { result.imageWidth = image.getAttribute('width') || undefined; } if (image.hasAttribute('height')) { result.imageHeight = image.getAttribute('height') || undefined; } if (image.hasAttribute('alt')) { result.imageAlt = image.getAttribute('alt') || undefined; } } return result; }; /** * @param {DocumentFragment} templateContent * @returns {object} */ const getSwalIcon = templateContent => { const result = {}; /** @type {HTMLElement | null} */ const icon = templateContent.querySelector('swal-icon'); if (icon) { showWarningsForAttributes(icon, ['type', 'color']); if (icon.hasAttribute('type')) { result.icon = icon.getAttribute('type'); } if (icon.hasAttribute('color')) { result.iconColor = icon.getAttribute('color'); } result.iconHtml = icon.innerHTML; } return result; }; /** * @param {DocumentFragment} templateContent * @returns {object} */ const getSwalInput = templateContent => { /** @type {object} */ const result = {}; /** @type {HTMLElement | null} */ const input = templateContent.querySelector('swal-input'); if (input) { showWarningsForAttributes(input, ['type', 'label', 'placeholder', 'value']); result.input = input.getAttribute('type') || 'text'; if (input.hasAttribute('label')) { result.inputLabel = input.getAttribute('label'); } if (input.hasAttribute('placeholder')) { result.inputPlaceholder = input.getAttribute('placeholder'); } if (input.hasAttribute('value')) { result.inputValue = input.getAttribute('value'); } } /** @type {HTMLElement[]} */ const inputOptions = Array.from(templateContent.querySelectorAll('swal-input-option')); if (inputOptions.length) { result.inputOptions = {}; inputOptions.forEach(option => { showWarningsForAttributes(option, ['value']); const optionValue = option.getAttribute('value'); if (!optionValue) { return; } const optionName = option.innerHTML; result.inputOptions[optionValue] = optionName; }); } return result; }; /** * @param {DocumentFragment} templateContent * @param {string[]} paramNames * @returns {Record} */ const getSwalStringParams = (templateContent, paramNames) => { /** @type {Record} */ const result = {}; for (const i in paramNames) { const paramName = paramNames[i]; /** @type {HTMLElement | null} */ const tag = templateContent.querySelector(paramName); if (tag) { showWarningsForAttributes(tag, []); result[paramName.replace(/^swal-/, '')] = tag.innerHTML.trim(); } } return result; }; /** * @param {DocumentFragment} templateContent */ const showWarningsForElements = templateContent => { const allowedElements = swalStringParams.concat(['swal-param', 'swal-function-param', 'swal-button', 'swal-image', 'swal-icon', 'swal-input', 'swal-input-option']); Array.from(templateContent.children).forEach(el => { const tagName = el.tagName.toLowerCase(); if (!allowedElements.includes(tagName)) { warn(`Unrecognized element <${tagName}>`); } }); }; /** * @param {HTMLElement} el * @param {string[]} allowedAttributes */ const showWarningsForAttributes = (el, allowedAttributes) => { Array.from(el.attributes).forEach(attribute => { if (allowedAttributes.indexOf(attribute.name) === -1) { warn([`Unrecognized attribute "${attribute.name}" on <${el.tagName.toLowerCase()}>.`, `${allowedAttributes.length ? `Allowed attributes are: ${allowedAttributes.join(', ')}` : 'To set the value, use HTML within the element.'}`]); } }); }; const SHOW_CLASS_TIMEOUT = 10; /** * Open popup, add necessary classes and styles, fix scrollbar * * @param {SweetAlertOptions} params */ const openPopup = params => { const container = getContainer(); const popup = getPopup(); if (typeof params.willOpen === 'function') { params.willOpen(popup); } globalState.eventEmitter.emit('willOpen', popup); const bodyStyles = window.getComputedStyle(document.body); const initialBodyOverflow = bodyStyles.overflowY; addClasses(container, popup, params); // scrolling is 'hidden' until animation is done, after that 'auto' setTimeout(() => { setScrollingVisibility(container, popup); }, SHOW_CLASS_TIMEOUT); if (isModal()) { fixScrollContainer(container, params.scrollbarPadding, initialBodyOverflow); setAriaHidden(); } if (!isToast() && !globalState.previousActiveElement) { globalState.previousActiveElement = document.activeElement; } if (typeof params.didOpen === 'function') { setTimeout(() => params.didOpen(popup)); } globalState.eventEmitter.emit('didOpen', popup); }; /** * @param {AnimationEvent} event */ const swalOpenAnimationFinished = event => { const popup = getPopup(); if (event.target !== popup) { return; } const container = getContainer(); popup.removeEventListener('animationend', swalOpenAnimationFinished); popup.removeEventListener('transitionend', swalOpenAnimationFinished); container.style.overflowY = 'auto'; // no-transition is added in init() in case one swal is opened right after another removeClass(container, swalClasses['no-transition']); }; /** * @param {HTMLElement} container * @param {HTMLElement} popup */ const setScrollingVisibility = (container, popup) => { if (hasCssAnimation(popup)) { container.style.overflowY = 'hidden'; popup.addEventListener('animationend', swalOpenAnimationFinished); popup.addEventListener('transitionend', swalOpenAnimationFinished); } else { container.style.overflowY = 'auto'; } }; /** * @param {HTMLElement} container * @param {boolean} scrollbarPadding * @param {string} initialBodyOverflow */ const fixScrollContainer = (container, scrollbarPadding, initialBodyOverflow) => { iOSfix(); if (scrollbarPadding && initialBodyOverflow !== 'hidden') { replaceScrollbarWithPadding(initialBodyOverflow); } // sweetalert2/issues/1247 setTimeout(() => { container.scrollTop = 0; }); }; /** * @param {HTMLElement} container * @param {HTMLElement} popup * @param {SweetAlertOptions} params */ const addClasses = (container, popup, params) => { addClass(container, params.showClass.backdrop); if (params.animation) { // this workaround with opacity is needed for https://github.com/sweetalert2/sweetalert2/issues/2059 popup.style.setProperty('opacity', '0', 'important'); show(popup, 'grid'); setTimeout(() => { // Animate popup right after showing it addClass(popup, params.showClass.popup); // and remove the opacity workaround popup.style.removeProperty('opacity'); }, SHOW_CLASS_TIMEOUT); // 10ms in order to fix #2062 } else { show(popup, 'grid'); } addClass([document.documentElement, document.body], swalClasses.shown); if (params.heightAuto && params.backdrop && !params.toast) { addClass([document.documentElement, document.body], swalClasses['height-auto']); } }; var defaultInputValidators = { /** * @param {string} string * @param {string} [validationMessage] * @returns {Promise} */ email: (string, validationMessage) => { return /^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid email address'); }, /** * @param {string} string * @param {string} [validationMessage] * @returns {Promise} */ url: (string, validationMessage) => { // taken from https://stackoverflow.com/a/3809435 with a small change from #1306 and #2013 return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid URL'); } }; /** * @param {SweetAlertOptions} params */ function setDefaultInputValidators(params) { // Use default `inputValidator` for supported input types if not provided if (params.inputValidator) { return; } if (params.input === 'email') { params.inputValidator = defaultInputValidators['email']; } if (params.input === 'url') { params.inputValidator = defaultInputValidators['url']; } } /** * @param {SweetAlertOptions} params */ function validateCustomTargetElement(params) { // Determine if the custom target element is valid if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) { warn('Target parameter is not valid, defaulting to "body"'); params.target = 'body'; } } /** * Set type, text and actions on popup * * @param {SweetAlertOptions} params */ function setParameters(params) { setDefaultInputValidators(params); // showLoaderOnConfirm && preConfirm if (params.showLoaderOnConfirm && !params.preConfirm) { warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + 'https://sweetalert2.github.io/#ajax-request'); } validateCustomTargetElement(params); // Replace newlines with
    in title if (typeof params.title === 'string') { params.title = params.title.split('\n').join('
    '); } init(params); } /** @type {SweetAlert} */ let currentInstance; var _promise = /*#__PURE__*/new WeakMap(); class SweetAlert { /** * @param {...(SweetAlertOptions | string)} args * @this {SweetAlert} */ constructor(...args) { /** * @type {Promise} */ _classPrivateFieldInitSpec(this, _promise, void 0); // Prevent run in Node env if (typeof window === 'undefined') { return; } currentInstance = this; // @ts-ignore const outerParams = Object.freeze(this.constructor.argsToParams(args)); /** @type {Readonly} */ this.params = outerParams; /** @type {boolean} */ this.isAwaitingPromise = false; _classPrivateFieldSet2(_promise, this, this._main(currentInstance.params)); } _main(userParams, mixinParams = {}) { showWarningsForParams(Object.assign({}, mixinParams, userParams)); if (globalState.currentInstance) { const swalPromiseResolve = privateMethods.swalPromiseResolve.get(globalState.currentInstance); const { isAwaitingPromise } = globalState.currentInstance; globalState.currentInstance._destroy(); if (!isAwaitingPromise) { swalPromiseResolve({ isDismissed: true }); } if (isModal()) { unsetAriaHidden(); } } globalState.currentInstance = currentInstance; const innerParams = prepareParams(userParams, mixinParams); setParameters(innerParams); Object.freeze(innerParams); // clear the previous timer if (globalState.timeout) { globalState.timeout.stop(); delete globalState.timeout; } // clear the restore focus timeout clearTimeout(globalState.restoreFocusTimeout); const domCache = populateDomCache(currentInstance); render(currentInstance, innerParams); privateProps.innerParams.set(currentInstance, innerParams); return swalPromise(currentInstance, domCache, innerParams); } // `catch` cannot be the name of a module export, so we define our thenable methods here instead then(onFulfilled) { return _classPrivateFieldGet2(_promise, this).then(onFulfilled); } finally(onFinally) { return _classPrivateFieldGet2(_promise, this).finally(onFinally); } } /** * @param {SweetAlert} instance * @param {DomCache} domCache * @param {SweetAlertOptions} innerParams * @returns {Promise} */ const swalPromise = (instance, domCache, innerParams) => { return new Promise((resolve, reject) => { // functions to handle all closings/dismissals /** * @param {DismissReason} dismiss */ const dismissWith = dismiss => { instance.close({ isDismissed: true, dismiss, isConfirmed: false, isDenied: false }); }; privateMethods.swalPromiseResolve.set(instance, resolve); privateMethods.swalPromiseReject.set(instance, reject); domCache.confirmButton.onclick = () => { handleConfirmButtonClick(instance); }; domCache.denyButton.onclick = () => { handleDenyButtonClick(instance); }; domCache.cancelButton.onclick = () => { handleCancelButtonClick(instance, dismissWith); }; domCache.closeButton.onclick = () => { dismissWith(DismissReason.close); }; handlePopupClick(innerParams, domCache, dismissWith); addKeydownHandler(globalState, innerParams, dismissWith); handleInputOptionsAndValue(instance, innerParams); openPopup(innerParams); setupTimer(globalState, innerParams, dismissWith); initFocus(domCache, innerParams); // Scroll container to top on open (#1247, #1946) setTimeout(() => { domCache.container.scrollTop = 0; }); }); }; /** * @param {SweetAlertOptions} userParams * @param {SweetAlertOptions} mixinParams * @returns {SweetAlertOptions} */ const prepareParams = (userParams, mixinParams) => { const templateParams = getTemplateParams(userParams); const params = Object.assign({}, defaultParams, mixinParams, templateParams, userParams); // precedence is described in #2131 params.showClass = Object.assign({}, defaultParams.showClass, params.showClass); params.hideClass = Object.assign({}, defaultParams.hideClass, params.hideClass); if (params.animation === false) { params.showClass = { backdrop: 'swal2-noanimation' }; params.hideClass = {}; } return params; }; /** * @param {SweetAlert} instance * @returns {DomCache} */ const populateDomCache = instance => { const domCache = { popup: getPopup(), container: getContainer(), actions: getActions(), confirmButton: getConfirmButton(), denyButton: getDenyButton(), cancelButton: getCancelButton(), loader: getLoader(), closeButton: getCloseButton(), validationMessage: getValidationMessage(), progressSteps: getProgressSteps() }; privateProps.domCache.set(instance, domCache); return domCache; }; /** * @param {GlobalState} globalState * @param {SweetAlertOptions} innerParams * @param {(dismiss: DismissReason) => void} dismissWith */ const setupTimer = (globalState, innerParams, dismissWith) => { const timerProgressBar = getTimerProgressBar(); hide(timerProgressBar); if (innerParams.timer) { globalState.timeout = new Timer(() => { dismissWith('timer'); delete globalState.timeout; }, innerParams.timer); if (innerParams.timerProgressBar) { show(timerProgressBar); applyCustomClass(timerProgressBar, innerParams, 'timerProgressBar'); setTimeout(() => { if (globalState.timeout && globalState.timeout.running) { // timer can be already stopped or unset at this point animateTimerProgressBar(innerParams.timer); } }); } } }; /** * Initialize focus in the popup: * * 1. If `toast` is `true`, don't steal focus from the document. * 2. Else if there is an [autofocus] element, focus it. * 3. Else if `focusConfirm` is `true` and confirm button is visible, focus it. * 4. Else if `focusDeny` is `true` and deny button is visible, focus it. * 5. Else if `focusCancel` is `true` and cancel button is visible, focus it. * 6. Else focus the first focusable element in a popup (if any). * * @param {DomCache} domCache * @param {SweetAlertOptions} innerParams */ const initFocus = (domCache, innerParams) => { if (innerParams.toast) { return; } // TODO: this is dumb, remove `allowEnterKey` param in the next major version if (!callIfFunction(innerParams.allowEnterKey)) { warnAboutDeprecation('allowEnterKey'); blurActiveElement(); return; } if (focusAutofocus(domCache)) { return; } if (focusButton(domCache, innerParams)) { return; } setFocus(-1, 1); }; /** * @param {DomCache} domCache * @returns {boolean} */ const focusAutofocus = domCache => { const autofocusElements = Array.from(domCache.popup.querySelectorAll('[autofocus]')); for (const autofocusElement of autofocusElements) { if (autofocusElement instanceof HTMLElement && isVisible$1(autofocusElement)) { autofocusElement.focus(); return true; } } return false; }; /** * @param {DomCache} domCache * @param {SweetAlertOptions} innerParams * @returns {boolean} */ const focusButton = (domCache, innerParams) => { if (innerParams.focusDeny && isVisible$1(domCache.denyButton)) { domCache.denyButton.focus(); return true; } if (innerParams.focusCancel && isVisible$1(domCache.cancelButton)) { domCache.cancelButton.focus(); return true; } if (innerParams.focusConfirm && isVisible$1(domCache.confirmButton)) { domCache.confirmButton.focus(); return true; } return false; }; const blurActiveElement = () => { if (document.activeElement instanceof HTMLElement && typeof document.activeElement.blur === 'function') { document.activeElement.blur(); } }; // Assign instance methods from src/instanceMethods/*.js to prototype SweetAlert.prototype.disableButtons = disableButtons; SweetAlert.prototype.enableButtons = enableButtons; SweetAlert.prototype.getInput = getInput; SweetAlert.prototype.disableInput = disableInput; SweetAlert.prototype.enableInput = enableInput; SweetAlert.prototype.hideLoading = hideLoading; SweetAlert.prototype.disableLoading = hideLoading; SweetAlert.prototype.showValidationMessage = showValidationMessage; SweetAlert.prototype.resetValidationMessage = resetValidationMessage; SweetAlert.prototype.close = close; SweetAlert.prototype.closePopup = close; SweetAlert.prototype.closeModal = close; SweetAlert.prototype.closeToast = close; SweetAlert.prototype.rejectPromise = rejectPromise; SweetAlert.prototype.update = update; SweetAlert.prototype._destroy = _destroy; // Assign static methods from src/staticMethods/*.js to constructor Object.assign(SweetAlert, staticMethods); // Proxy to instance methods to constructor, for now, for backwards compatibility Object.keys(instanceMethods).forEach(key => { /** * @param {...(SweetAlertOptions | string | undefined)} args * @returns {SweetAlertResult | Promise | undefined} */ SweetAlert[key] = function (...args) { if (currentInstance && currentInstance[key]) { return currentInstance[key](...args); } return null; }; }); SweetAlert.DismissReason = DismissReason; SweetAlert.version = '11.26.3'; const Swal = SweetAlert; // @ts-ignore Swal.default = Swal; return Swal; })); if (typeof this !== 'undefined' && this.Sweetalert2){this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2} "undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,":root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-icon-animations: true;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:\"top-start top top-end\" \"center-start center center-end\" \"bottom-start bottom-center bottom-end\";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem;container-name:swal2-popup}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}@container swal2-popup style(--swal2-icon-animations:true){.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}"); /***/ }), /***/ "../../../node_modules/throttle-debounce/cjs/index.js": /*!************************************************************!*\ !*** ../../../node_modules/throttle-debounce/cjs/index.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); /* eslint-disable no-undefined,no-param-reassign,no-shadow */ /** * Throttle execution of a function. Especially useful for rate limiting * execution of handlers on events like resize and scroll. * * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) * are most useful. * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, * as-is, to `callback` when the throttled-function is executed. * @param {object} [options] - An object to configure options. * @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds * while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed * one final time after the last throttled-function call. (After the throttled-function has not been called for * `delay` milliseconds, the internal counter is reset). * @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback * immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that * callback will never executed if both noLeading = true and noTrailing = true. * @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is * false (at end), schedule `callback` to execute after `delay` ms. * * @returns {Function} A new, throttled, function. */ function throttle (delay, callback, options) { var _ref = options || {}, _ref$noTrailing = _ref.noTrailing, noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing, _ref$noLeading = _ref.noLeading, noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading, _ref$debounceMode = _ref.debounceMode, debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode; /* * After wrapper has stopped being called, this timeout ensures that * `callback` is executed at the proper times in `throttle` and `end` * debounce modes. */ var timeoutID; var cancelled = false; // Keep track of the last time `callback` was executed. var lastExec = 0; // Function to clear existing timeout function clearExistingTimeout() { if (timeoutID) { clearTimeout(timeoutID); } } // Function to cancel next exec function cancel(options) { var _ref2 = options || {}, _ref2$upcomingOnly = _ref2.upcomingOnly, upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly; clearExistingTimeout(); cancelled = !upcomingOnly; } /* * The `wrapper` function encapsulates all of the throttling / debouncing * functionality and when executed will limit the rate at which `callback` * is executed. */ function wrapper() { for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) { arguments_[_key] = arguments[_key]; } var self = this; var elapsed = Date.now() - lastExec; if (cancelled) { return; } // Execute `callback` and update the `lastExec` timestamp. function exec() { lastExec = Date.now(); callback.apply(self, arguments_); } /* * If `debounceMode` is true (at begin) this is used to clear the flag * to allow future `callback` executions. */ function clear() { timeoutID = undefined; } if (!noLeading && debounceMode && !timeoutID) { /* * Since `wrapper` is being called for the first time and * `debounceMode` is true (at begin), execute `callback` * and noLeading != true. */ exec(); } clearExistingTimeout(); if (debounceMode === undefined && elapsed > delay) { if (noLeading) { /* * In throttle mode with noLeading, if `delay` time has * been exceeded, update `lastExec` and schedule `callback` * to execute after `delay` ms. */ lastExec = Date.now(); if (!noTrailing) { timeoutID = setTimeout(debounceMode ? clear : exec, delay); } } else { /* * In throttle mode without noLeading, if `delay` time has been exceeded, execute * `callback`. */ exec(); } } else if (noTrailing !== true) { /* * In trailing throttle mode, since `delay` time has not been * exceeded, schedule `callback` to execute `delay` ms after most * recent execution. * * If `debounceMode` is true (at begin), schedule `clear` to execute * after `delay` ms. * * If `debounceMode` is false (at end), schedule `callback` to * execute after `delay` ms. */ timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay); } } wrapper.cancel = cancel; // Return the wrapper function. return wrapper; } /* eslint-disable no-undefined */ /** * Debounce execution of a function. Debouncing, unlike throttling, * guarantees that a function is only executed a single time, either at the * very beginning of a series of calls, or at the very end. * * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful. * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is, * to `callback` when the debounced-function is executed. * @param {object} [options] - An object to configure options. * @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call. * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset). * * @returns {Function} A new, debounced function. */ function debounce (delay, callback, options) { var _ref = options || {}, _ref$atBegin = _ref.atBegin, atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin; return throttle(delay, callback, { debounceMode: atBegin !== false }); } exports.debounce = debounce; exports.throttle = throttle; //# sourceMappingURL=index.js.map /***/ }), /***/ "../../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js": /*!***********************************************************************!*\ !*** ../../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js ***! \***********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ invariant) /* harmony export */ }); var isProduction = "development" === 'production'; var prefix = 'Invariant failed'; function invariant(condition, message) { if (condition) { return; } if (isProduction) { throw new Error(prefix); } var provided = typeof message === 'function' ? message() : message; var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix; throw new Error(value); } /***/ }), /***/ "../../../node_modules/toggle-selection/index.js": /*!*******************************************************!*\ !*** ../../../node_modules/toggle-selection/index.js ***! \*******************************************************/ /***/ ((module) => { module.exports = function () { var selection = document.getSelection(); if (!selection.rangeCount) { return function () {}; } var active = document.activeElement; var ranges = []; for (var i = 0; i < selection.rangeCount; i++) { ranges.push(selection.getRangeAt(i)); } switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML case 'INPUT': case 'TEXTAREA': active.blur(); break; default: active = null; break; } selection.removeAllRanges(); return function () { selection.type === 'Caret' && selection.removeAllRanges(); if (!selection.rangeCount) { ranges.forEach(function(range) { selection.addRange(range); }); } active && active.focus(); }; }; /***/ }), /***/ "../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js": /*!**************************************************************************************************************!*\ !*** ../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js ***! \**************************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /** * @license React * use-sync-external-store-with-selector.development.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ true && (function () { function is(x, y) { return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); } "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); var React = __webpack_require__(/*! react */ "../../../node_modules/react/index.js"), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore = React.useSyncExternalStore, useRef = React.useRef, useEffect = React.useEffect, useMemo = React.useMemo, useDebugValue = React.useDebugValue; exports.useSyncExternalStoreWithSelector = function ( subscribe, getSnapshot, getServerSnapshot, selector, isEqual ) { var instRef = useRef(null); if (null === instRef.current) { var inst = { hasValue: !1, value: null }; instRef.current = inst; } else inst = instRef.current; instRef = useMemo( function () { function memoizedSelector(nextSnapshot) { if (!hasMemo) { hasMemo = !0; memoizedSnapshot = nextSnapshot; nextSnapshot = selector(nextSnapshot); if (void 0 !== isEqual && inst.hasValue) { var currentSelection = inst.value; if (isEqual(currentSelection, nextSnapshot)) return (memoizedSelection = currentSelection); } return (memoizedSelection = nextSnapshot); } currentSelection = memoizedSelection; if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; var nextSelection = selector(nextSnapshot); if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) return (memoizedSnapshot = nextSnapshot), currentSelection; memoizedSnapshot = nextSnapshot; return (memoizedSelection = nextSelection); } var hasMemo = !1, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; return [ function () { return memoizedSelector(getSnapshot()); }, null === maybeGetServerSnapshot ? void 0 : function () { return memoizedSelector(maybeGetServerSnapshot()); } ]; }, [getSnapshot, getServerSnapshot, selector, isEqual] ); var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]); useEffect( function () { inst.hasValue = !0; inst.value = value; }, [value] ); useDebugValue(value); return value; }; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); })(); /***/ }), /***/ "../../../node_modules/use-sync-external-store/with-selector.js": /*!**********************************************************************!*\ !*** ../../../node_modules/use-sync-external-store/with-selector.js ***! \**********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) // removed by dead control flow {} else { module.exports = __webpack_require__(/*! ./cjs/use-sync-external-store-with-selector.development.js */ "../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js"); } /***/ }), /***/ "../../../node_modules/victory-vendor/es/d3-scale.js": /*!***********************************************************!*\ !*** ../../../node_modules/victory-vendor/es/d3-scale.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ scaleBand: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleBand), /* harmony export */ scaleDiverging: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleDiverging), /* harmony export */ scaleDivergingLog: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleDivergingLog), /* harmony export */ scaleDivergingPow: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleDivergingPow), /* harmony export */ scaleDivergingSqrt: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleDivergingSqrt), /* harmony export */ scaleDivergingSymlog: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleDivergingSymlog), /* harmony export */ scaleIdentity: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleIdentity), /* harmony export */ scaleImplicit: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleImplicit), /* harmony export */ scaleLinear: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleLinear), /* harmony export */ scaleLog: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleLog), /* harmony export */ scaleOrdinal: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleOrdinal), /* harmony export */ scalePoint: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scalePoint), /* harmony export */ scalePow: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scalePow), /* harmony export */ scaleQuantile: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleQuantile), /* harmony export */ scaleQuantize: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleQuantize), /* harmony export */ scaleRadial: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleRadial), /* harmony export */ scaleSequential: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleSequential), /* harmony export */ scaleSequentialLog: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleSequentialLog), /* harmony export */ scaleSequentialPow: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleSequentialPow), /* harmony export */ scaleSequentialQuantile: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleSequentialQuantile), /* harmony export */ scaleSequentialSqrt: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleSequentialSqrt), /* harmony export */ scaleSequentialSymlog: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleSequentialSymlog), /* harmony export */ scaleSqrt: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleSqrt), /* harmony export */ scaleSymlog: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleSymlog), /* harmony export */ scaleThreshold: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleThreshold), /* harmony export */ scaleTime: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleTime), /* harmony export */ scaleUtc: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.scaleUtc), /* harmony export */ tickFormat: () => (/* reexport safe */ d3_scale__WEBPACK_IMPORTED_MODULE_0__.tickFormat) /* harmony export */ }); /* harmony import */ var d3_scale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-scale */ "../../../node_modules/d3-scale/src/index.js"); // `victory-vendor/d3-scale` (ESM) // See upstream license: https://github.com/d3/d3-scale/blob/main/LICENSE // // Our ESM package uses the underlying installed dependencies of `node_modules/d3-scale` /***/ }), /***/ "../../../node_modules/victory-vendor/es/d3-shape.js": /*!***********************************************************!*\ !*** ../../../node_modules/victory-vendor/es/d3-shape.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ arc: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.arc), /* harmony export */ area: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.area), /* harmony export */ areaRadial: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.areaRadial), /* harmony export */ curveBasis: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveBasis), /* harmony export */ curveBasisClosed: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveBasisClosed), /* harmony export */ curveBasisOpen: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveBasisOpen), /* harmony export */ curveBumpX: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveBumpX), /* harmony export */ curveBumpY: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveBumpY), /* harmony export */ curveBundle: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveBundle), /* harmony export */ curveCardinal: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveCardinal), /* harmony export */ curveCardinalClosed: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveCardinalClosed), /* harmony export */ curveCardinalOpen: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveCardinalOpen), /* harmony export */ curveCatmullRom: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveCatmullRom), /* harmony export */ curveCatmullRomClosed: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveCatmullRomClosed), /* harmony export */ curveCatmullRomOpen: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveCatmullRomOpen), /* harmony export */ curveLinear: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveLinear), /* harmony export */ curveLinearClosed: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveLinearClosed), /* harmony export */ curveMonotoneX: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveMonotoneX), /* harmony export */ curveMonotoneY: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveMonotoneY), /* harmony export */ curveNatural: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveNatural), /* harmony export */ curveStep: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveStep), /* harmony export */ curveStepAfter: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveStepAfter), /* harmony export */ curveStepBefore: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.curveStepBefore), /* harmony export */ line: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.line), /* harmony export */ lineRadial: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.lineRadial), /* harmony export */ link: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.link), /* harmony export */ linkHorizontal: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.linkHorizontal), /* harmony export */ linkRadial: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.linkRadial), /* harmony export */ linkVertical: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.linkVertical), /* harmony export */ pie: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.pie), /* harmony export */ pointRadial: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.pointRadial), /* harmony export */ radialArea: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.radialArea), /* harmony export */ radialLine: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.radialLine), /* harmony export */ stack: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stack), /* harmony export */ stackOffsetDiverging: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOffsetDiverging), /* harmony export */ stackOffsetExpand: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOffsetExpand), /* harmony export */ stackOffsetNone: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOffsetNone), /* harmony export */ stackOffsetSilhouette: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOffsetSilhouette), /* harmony export */ stackOffsetWiggle: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOffsetWiggle), /* harmony export */ stackOrderAppearance: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOrderAppearance), /* harmony export */ stackOrderAscending: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOrderAscending), /* harmony export */ stackOrderDescending: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOrderDescending), /* harmony export */ stackOrderInsideOut: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOrderInsideOut), /* harmony export */ stackOrderNone: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOrderNone), /* harmony export */ stackOrderReverse: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.stackOrderReverse), /* harmony export */ symbol: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbol), /* harmony export */ symbolAsterisk: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolAsterisk), /* harmony export */ symbolCircle: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolCircle), /* harmony export */ symbolCross: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolCross), /* harmony export */ symbolDiamond: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolDiamond), /* harmony export */ symbolDiamond2: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolDiamond2), /* harmony export */ symbolPlus: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolPlus), /* harmony export */ symbolSquare: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolSquare), /* harmony export */ symbolSquare2: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolSquare2), /* harmony export */ symbolStar: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolStar), /* harmony export */ symbolTimes: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolTimes), /* harmony export */ symbolTriangle: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolTriangle), /* harmony export */ symbolTriangle2: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolTriangle2), /* harmony export */ symbolWye: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolWye), /* harmony export */ symbolX: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolX), /* harmony export */ symbols: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbols), /* harmony export */ symbolsFill: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolsFill), /* harmony export */ symbolsStroke: () => (/* reexport safe */ d3_shape__WEBPACK_IMPORTED_MODULE_0__.symbolsStroke) /* harmony export */ }); /* harmony import */ var d3_shape__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-shape */ "../../../node_modules/d3-shape/src/index.js"); // `victory-vendor/d3-shape` (ESM) // See upstream license: https://github.com/d3/d3-shape/blob/main/LICENSE // // Our ESM package uses the underlying installed dependencies of `node_modules/d3-shape` /***/ }) }]); //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianMvdmVuZG9ycy1ub2RlX21vZHVsZXNfc3dlZXRhbGVydDJfZGlzdF9zd2VldGFsZXJ0Ml9hbGxfanMtbm9kZV9tb2R1bGVzX3RvZ2dsZS1zZWxlY3Rpb25faW5kZXhfLTIzZjk2YS52b2x1bnRlZXJhcGkuMWY3M2FkNjBiNTkyNWQyZGI0N2MuYnVuZGxlLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEVBQUUsS0FBNEQ7QUFDOUQsRUFBRSxDQUMwRztBQUM1RyxDQUFDLHVCQUF1Qjs7QUFFeEI7QUFDQTtBQUNBO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gICAgICAgIGF0dHJpYnV0ZUZpbHRlcjogWydzdHlsZSddXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH0pO1xuICAgIHJldHVybiB0ZXh0YXJlYTtcbiAgfTtcblxuICAvKipcbiAgICogQHBhcmFtIHtTd2VldEFsZXJ0fSBpbnN0YW5jZVxuICAgKiBAcGFyYW0ge1N3ZWV0QWxlcnRPcHRpb25zfSBwYXJhbXNcbiAgICovXG4gIGNvbnN0IHJlbmRlckNvbnRlbnQgPSAoaW5zdGFuY2UsIHBhcmFtcykgPT4ge1xuICAgIGNvbnN0IGh0bWxDb250YWluZXIgPSBnZXRIdG1sQ29udGFpbmVyKCk7XG4gICAgaWYgKCFodG1sQ29udGFpbmVyKSB7XG4gICAgICByZXR1cm47XG4gICAgfVxuICAgIHNob3dXaGVuSW5uZXJIdG1sUHJlc2VudChodG1sQ29udGFpbmVyKTtcbiAgICBhcHBseUN1c3RvbUNsYXNzKGh0bWxDb250YWluZXIsIHBhcmFtcywgJ2h0bWxDb250YWluZXInKTtcblxuICAgIC8vIENvbnRlbnQgYXMgSFRNTFxuICAgIGlmIChwYXJhbXMuaHRtbCkge1xuICAgICAgcGFyc2VIdG1sVG9Db250YWluZXIocGFyYW1zLmh0bWwsIGh0bWxDb250YWluZXIpO1xuICAgICAgc2hvdyhodG1sQ29udGFpbmVyLCAnYmxvY2snKTtcbiAgICB9XG5cbiAgICAvLyBDb250ZW50IGFzIHBsYWluIHRleHRcbiAgICBlbHNlIGlmIChwYXJhbXMudGV4dCkge1xuICAgICAgaHRtbENvbnRhaW5lci50ZXh0Q29udGVudCA9IHBhcmFtcy50ZXh0O1xuICAgICAgc2hvdyhodG1sQ29udGFpbmVyLCAnYmxvY2snKTtcbiAgICB9XG5cbiAgICAvLyBObyBjb250ZW50XG4gICAgZWxzZSB7XG4gICAgICBoaWRlKGh0bWxDb250YWluZXIpO1xuICAgIH1cbiAgICByZW5kZXJJbnB1dChpbnN0YW5jZSwgcGFyYW1zKTtc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CAwICE9PSBpc0VxdWFsICYmIGluc3QuaGFzVmFsdWUpIHtcbiAgICAgICAgICAgICAgICB2YXIgY3VycmVudFNlbGVjdGlvbiA9IGluc3QudmFsdWU7XG4gICAgICAgICAgICAgICAgaWYgKGlzRXF1YWwoY3VycmVudFNlbGVjdGlvbiwgbmV4dFNuYXBzaG90KSlcbiAgICAgICAgICAgICAgICAgIHJldHVybiAobWVtb2l6ZWRTZWxlY3Rpb24gPSBjdXJyZW50U2VsZWN0aW9uKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICByZXR1cm4gKG1lbW9pemVkU2VsZWN0aW9uID0gbmV4dFNuYXBzaG90KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGN1cnJlbnRTZWxlY3Rpb24gPSBtZW1vaXplZFNlbGVjdGlvbjtcbiAgICAgICAgICAgIGlmIChvYmplY3RJcyhtZW1vaXplZFNuYXBzaG90LCBuZXh0U25hcHNob3QpKVxuICAgICAgICAgICAgICByZXR1cm4gY3VycmVudFNlbGVjdGlvbjtcbiAgICAgICAgICAgIHZhciBuZXh0U2VsZWN0aW9uID0gc2VsZWN0b3IobmV4dFNuYXBzaG90KTtcbiAgICAgICAgICAgIGlmICh2b2lkIDAgIT09IGlzRXF1YWwgJiYgaXNFcXVhbChjdXJyZW50U2VsZWN0aW9uLCBuZXh0U2VsZWN0aW9uKSlcbiAgICAgICAgICAgICAgcmV0dXJuIChtZW1vaXplZFNuYXBzaG90ID0gbmV4dFNuYXBzaG90KSwgY3VycmVudFNlbGVjdGlvbjtcbiAgICAgICAgICAgIG1lbW9pemVkU25hcHNob3QgPSBuZXh0U25hcHNob3Q7XG4gICAgICAgICAgICByZXR1cm4gKG1lbW9pemVkU2VsZWN0aW9uID0gbmV4dFNlbGVjdGlvbik7XG4gICAgICAgICAgfVxuICAgICAgICAgIHZhciBoYXNNZW1vID0gITEsXG4gICAgICAgICAgICBtZW1vaXplZFNuYXBzaG90LFxuICAgICAgICAgICAgbWVt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