vendor: 4,360 bytes, lines 1-181
1/*! 2 * sweetalert2 v7.24.1 3 * Released under the MIT License. 4 */ 5(function(global, factory) { 6 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 7 typeof define === 'function' && define.amd ? define(factory) : 8 (global.Sweetalert2 = factory()); 9}(this, (function() { 10 'use strict'; 11 12 var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) { 13 return typeof obj; 14 } : function(obj) { 15 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 16 }; 17 18 19 20 21 22 23 24 25 26 27 28 var classCallCheck = function(instance, Constructor) { 29 if (!(instance instanceof Constructor)) { 30 throw new TypeError("Cannot call a class as a function"); 31 } 32 }; 33 34 var createClass = function() { 35 function defineProperties(target, props) { 36 for (var i = 0; i < props.length; i++) { 37 var descriptor = props[i]; 38 descriptor.enumerable = descriptor.enumerable || false; 39 descriptor.configurable = true; 40 if ("value" in descriptor) descriptor.writable = true; 41 Object.defineProperty(target, descriptor.key, descriptor); 42 } 43 } 44 45 return function(Constructor, protoProps, staticProps) { 46 if (protoProps) defineProperties(Constructor.prototype, protoProps); 47 if (staticProps) defineProperties(Constructor, staticProps); 48 return Constructor; 49 }; 50 }(); 51 52 53 54 55 56 57 58 var _extends = Object.assign || function(target) { 59 for (var i = 1; i < arguments.length; i++) { 60 var source = arguments[i]; 61 62 for (var key in source) { 63 if (Object.prototype.hasOwnProperty.call(source, key)) { 64 target[key] = source[key]; 65 } 66 } 67 } 68 69 return target; 70 }; 71 72 var get = function get(object, property, receiver) { 73 if (object === null) object = Function.prototype; 74 var desc = Object.getOwnPropertyDescriptor(object, property); 75 76 if (desc === undefined) { 77 var parent = Object.getPrototypeOf(object); 78 79 if (parent === null) { 80 return undefined; 81 } else { 82 return get(parent, property, receiver); 83 } 84 } else if ("value" in desc) { 85 return desc.value; 86 } else { 87 var getter = desc.get; 88 89 if (getter === undefined) { 90 return undefined; 91 } 92 93 return getter.call(receiver); 94 } 95 }; 96 97 var inherits = function(subClass, superClass) { 98 if (typeof superClass !== "function" && superClass !== null) { 99 throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 100 } 101 102 subClass.prototype = Object.create(superClass && superClass.prototype, { 103 constructor: { 104 value: subClass, 105 enumerable: false, 106 writable: true, 107 configurable: true 108 } 109 }); 110 if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; 111 }; 112 113 114 115 116 117 118 119 120 121 122 123 var possibleConstructorReturn = function(self, call) { 124 if (!self) { 125 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 126 } 127 128 return call && (typeof call === "object" || typeof call === "function") ? call : self; 129 }; 130 131 132 133 134 135 var slicedToArray = function() { 136 function sliceIterator(arr, i) { 137 var _arr = []; 138 var _n = true; 139 var _d = false; 140 var _e = undefined; 141 142 try { 143 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { 144 _arr.push(_s.value); 145 146 if (i && _arr.length === i) break; 147 } 148 } catch (err) { 149 _d = true; 150 _e = err; 151 } finally { 152 try { 153 if (!_n && _i["return"]) _i["return"](); 154 } finally { 155 if (_d) throw _e; 156 } 157 } 158 159 return _arr; 160 } 161 162 return function(arr, i) { 163 if (Array.isArray(arr)) { 164 return arr; 165 } else if (Symbol.iterator in Object(arr)) { 166 return sliceIterator(arr, i); 167 } else { 168 throw new TypeError("Invalid attempt to destructure non-iterable instance"); 169 } 170 }; 171 }(); 172 173 var consolePrefix = 'SweetAlert2:'; 174 175 /** 176 * Filter the unique values into a new array 177 * @param arr 178 */ 179 var uniqueArray = function uniqueArray(arr) { 180 var result = []; 181 for (var i = 0; i < arr.length; i++) {
182 if (result.indexOf(arr[i]) === -1) { 183 result.push(arr[i]); 184 } 185 } 186 return result; 187 }; 188 189 /** 190 * Converts `inputOptions` into an array of `[value, label]`s 191 * @param inputOptions 192 */ 193 var formatInputOptions = function formatInputOptions(inputOptions) { 194 var result = []; 195 if (typeof Map !== 'undefined' && inputOptions instanceof Map) { 196 inputOptions.forEach(function(value, key) { 197 result.push([key, value]); 198 }); 199 } else { 200 Object.keys(inputOptions).forEach(function(key) { 201 result.push([key, inputOptions[key]]); 202 }); 203 } 204 return result; 205 }; 206 207 /** 208 * Standardise console warnings 209 * @param message 210 */ 211 var warn = function warn(message) { 212 console.warn(consolePrefix + ' ' + message); 213 }; 214 215 /** 216 * Standardise console errors 217 * @param message 218 */ 219 var error = function error(message) { 220 console.error(consolePrefix + ' ' + message); 221 }; 222 223 /** 224 * Private global state for `warnOnce` 225 * @type {Array} 226 * @private 227 */ 228 var previousWarnOnceMessages = []; 229 230 /** 231 * Show a console warning, but only if it hasn't already been shown 232 * @param message 233 */ 234 var warnOnce = function warnOnce(message) { 235 if (!(previousWarnOnceMessages.indexOf(message) !== -1)) { 236 previousWarnOnceMessages.push(message); 237 warn(message); 238 } 239 }; 240 241 /** 242 * If `arg` is a function, call it (with no arguments or context) and return the result. 243 * Otherwise, just pass the value through 244 * @param arg 245 */ 246 var callIfFunction = function callIfFunction(arg) { 247 return typeof arg === 'function' ? arg() : arg; 248 }; 249 250 var isThenable = function isThenable(arg) { 251 return (typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && typeof arg.then === 'function'; 252 }; 253 254 var DismissReason = Object.freeze({ 255 cancel: 'cancel', 256 backdrop: 'overlay', 257 close: 'close', 258 esc: 'esc', 259 timer: 'timer' 260 }); 261 262 var version = "7.24.1"; 263 264 var argsToParams = function argsToParams(args) { 265 var params = {}; 266 switch (_typeof(args[0])) { 267 case 'string': 268 ['title', 'html', 'type'].forEach(function(name, index) { 269 switch (_typeof(args[index])) { 270 case 'string': 271 params[name] = args[index]; 272 break; 273 case 'undefined': 274 break; 275 default: 276 error('Unexpected type of ' + name + '! Expected "string", got ' + _typeof(args[index])); 277 } 278 }); 279 break; 280 281 case 'object': 282 _extends(params, args[0]); 283 break; 284 285 default: 286 error('Unexpected type of argument! Expected "string" or "object", got ' + _typeof(args[0])); 287 return false; 288 } 289 return params; 290 }; 291 292 /** 293 * Adapt a legacy inputValidator for use with expectRejections=false 294 */ 295 var adaptInputValidator = function adaptInputValidator(legacyValidator) { 296 return function adaptedInputValidator(inputValue, extraParams) { 297 return legacyValidator.call(this, inputValue, extraParams).then(function() { 298 return undefined; 299 }, function(validationError) { 300 return validationError; 301 }); 302 }; 303 }; 304 305 var swalPrefix = 'swal2-'; 306 307 var prefix = function prefix(items) { 308 var result = {}; 309 for (var i in items) { 310 result[items[i]] = swalPrefix + items[i]; 311 } 312 return result; 313 }; 314 315 var swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'toast', 'toast-shown', 'fade', 'show', 'hide', 'noanimation', 'close', 'title', 'header', 'content', 'actions', 'confirm', 'cancel', 'footer', 'icon', 'icon-text', 'image', 'input', 'has-input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea', 'inputerror', 'validationerror', 'progresssteps', 'activeprogressstep', 'progresscircle', 'progressline', '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']); 316 317 var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']); 318 319 // Remember state in cases where opening and handling a modal will fiddle with it. 320 var states = { 321 previousBodyPadding: null 322 }; 323 324 var hasClass = function hasClass(elem, className) { 325 if (elem.classList) { 326 return elem.classList.contains(className); 327 } 328 return false;
329 }; 330 331 var focusInput = function focusInput(input) { 332 input.focus(); 333 334 // place cursor at end of text in text input 335 if (input.type !== 'file') { 336 // http://stackoverflow.com/a/2345915/1331425 337 var val = input.value; 338 input.value = ''; 339 input.value = val; 340 } 341 }; 342 343 var addOrRemoveClass = function addOrRemoveClass(target, classList, add) { 344 if (!target || !classList) { 345 return; 346 } 347 if (typeof classList === 'string') { 348 classList = classList.split(/\s+/).filter(Boolean); 349 } 350 classList.forEach(function(className) { 351 if (target.forEach) { 352 target.forEach(function(elem) { 353 add ? elem.classList.add(className) : elem.classList.remove(className); 354 }); 355 } else { 356 add ? target.classList.add(className) : target.classList.remove(className); 357 } 358 }); 359 }; 360 361 var addClass = function addClass(target, classList) { 362 addOrRemoveClass(target, classList, true); 363 }; 364 365 var removeClass = function removeClass(target, classList) { 366 addOrRemoveClass(target, classList, false); 367 }; 368 369 var getChildByClass = function getChildByClass(elem, className) { 370 for (var i = 0; i < elem.childNodes.length; i++) { 371 if (hasClass(elem.childNodes[i], className)) { 372 return elem.childNodes[i]; 373 } 374 } 375 }; 376 377 var show = function show(elem) { 378 elem.style.opacity = ''; 379 elem.style.display = elem.id === swalClasses.content ? 'block' : 'flex'; 380 }; 381 382 var hide = function hide(elem) { 383 elem.style.opacity = ''; 384 elem.style.display = 'none'; 385 }; 386 387 var empty = function empty(elem) { 388 while (elem.firstChild) { 389 elem.removeChild(elem.firstChild); 390 } 391 }; 392 393 // borrowed from jquery $(elem).is(':visible') implementation 394 var isVisible = function isVisible(elem) { 395 return elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length); 396 }; 397 398 var removeStyleProperty = function removeStyleProperty(elem, property) { 399 if (elem.style.removeProperty) { 400 elem.style.removeProperty(property); 401 } else { 402 elem.style.removeAttribute(property); 403 } 404 }; 405 406 var getContainer = function getContainer() { 407 return document.body.querySelector('.' + swalClasses.container); 408 }; 409 410 var elementByClass = function elementByClass(className) { 411 var container = getContainer(); 412 return container ? container.querySelector('.' + className) : null; 413 }; 414 415 var getPopup = function getPopup() { 416 return elementByClass(swalClasses.popup); 417 }; 418 419 var getIcons = function getIcons() { 420 var popup = getPopup(); 421 return popup.querySelectorAll('.' + swalClasses.icon); 422 }; 423 424 var getTitle = function getTitle() { 425 return elementByClass(swalClasses.title); 426 }; 427 428 var getContent = function getContent() { 429 return elementByClass(swalClasses.content); 430 }; 431 432 var getImage = function getImage() { 433 return elementByClass(swalClasses.image); 434 }; 435 436 var getProgressSteps = function getProgressSteps() { 437 return elementByClass(swalClasses.progresssteps); 438 }; 439 440 var getValidationError = function getValidationError() { 441 return elementByClass(swalClasses.validationerror); 442 }; 443 444 var getConfirmButton = function getConfirmButton() { 445 return elementByClass(swalClasses.confirm); 446 }; 447 448 var getCancelButton = function getCancelButton() { 449 return elementByClass(swalClasses.cancel); 450 }; 451 452 var getButtonsWrapper = function getButtonsWrapper() { 453 warnOnce('swal.getButtonsWrapper() is deprecated and will be removed in the next major release, use swal.getActions() instead'); 454 return elementByClass(swalClasses.actions); 455 }; 456 457 var getActions = function getActions() { 458 return elementByClass(swalClasses.actions); 459 }; 460 461 var getFooter = function getFooter() { 462 return elementByClass(swalClasses.footer); 463 }; 464 465 var getCloseButton = function getCloseButton() { 466 return elementByClass(swalClasses.close); 467 }; 468 469 var getFocusableElements = function getFocusableElements() { 470 var focusableElementsWithTabindex = Array.prototype.slice.call(getPopup().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')) 471 // sort according to tabindex 472 .sort(function(a, b) { 473 a = parseInt(a.getAttribute('tabindex')); 474 b = parseInt(b.getAttribute('tabindex')); 475 if (a > b) { 476 return 1; 477 } else if (a < b) { 478 return -1; 479 } 480 return 0; 481 }); 482 483 // https://github.com/jkup/focusable/blob/master/index.js 484 var otherFocusableElements = Array.prototype.slice.call(getPopup().querySelectorAll('a[href], area[href], input
484:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex="0"], [contenteditable], audio[controls], video[controls]')); 485 486 return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)); 487 }; 488 489 var isModal = function isModal() { 490 return !document.body.classList.contains(swalClasses['toast-shown']); 491 }; 492 493 var isToast = function isToast() { 494 return document.body.classList.contains(swalClasses['toast-shown']); 495 }; 496 497 var isLoading = function isLoading() { 498 return getPopup().hasAttribute('data-loading'); 499 }; 500 501 // Detect Node env 502 var isNodeEnv = function isNodeEnv() { 503 return typeof window === 'undefined' || typeof document === 'undefined'; 504 }; 505 506 var sweetHTML = ('\n <div aria-labelledby="' + swalClasses.title + '" aria-describedby="' + swalClasses.content + '" class="' + swalClasses.popup + '" tabindex="-1">\n <div class="' + swalClasses.header + '">\n <ul class="' + swalClasses.progresssteps + '"></ul>\n <div class="' + swalClasses.icon + ' ' + iconTypes.error + '">\n <span class="swal2-x-mark"><span class="swal2-x-mark-line-left"></span><span class="swal2-x-mark-line-right"></span></span>\n </div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.question + '">\n <span class="' + swalClasses['icon-text'] + '">?</span>\n </div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.warning + '">\n <span class="' + swalClasses['icon-text'] + '">!</span>\n </div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.info + '">\n <span class="' + swalClasses['icon-text'] + '">i</span>\n </div>\n <div class="' + swalClasses.icon + ' ' + iconTypes.success + '">\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n </div>\n <img class="' + swalClasses.image + '" />\n <h2 class="' + swalClasses.title + '" id="' + swalClasses.title + '"></h2>\n <button type="button" class="' + swalClasses.close + '">\xD7</button>\n </div>\n <div class="' + swalClasses.content + '">\n <div id="' + swalClasses.content + '"></div>\n <input class="' + swalClasses.input + '" />\n <input type="file" class="' + swalClasses.file + '" />\n <div class="' + swalClasses.range + '">\n <input type="range" />\n <output></output>\n </div>\n <select class="' + swalClasses.select + '"></select>\n <div class="' + swalClasses.radio + '"></div>\n <label for="' + swalClasses.checkbox + '" class="' + swalClasses.checkbox + '">\n <input type="checkbox" />\n </label>\n <textarea class="' + swalClasses.textarea + '"></textarea>\n <div class="' + swalClasses.validationerror + '" id="' + swalClasses.validationerror + '"></div>\n </div>\n <div class="' + swalClasses.actions + '">\n <button type="button" class="' + swalClasses.confirm + '">OK</button>\n <button type="button" class="' + swalClasses.cancel + '">Cancel</button>\n </div>\n <div class="' + swalClasses.footer + '">\n </div>\n </div>\n').replace(/(^|\n)\s*/g, ''); 507 508 /* 509 * Add modal + backdrop to DOM 510 */ 511 var init = function init(params) { 512 // Clean up the old popup if it exists 513 var c = getContainer(); 514 if (c) { 515 c.parentNode.removeChild(c); 516 removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['has-input'], swalClasses['toast-shown']]); 517 } 518 519 if (isNodeEnv()) { 520 error('SweetAlert2 requires document to initialize'); 521 return; 522 } 523 524 var container = document.createElement('div'); 525 container.className = swalClasses.container; 526 container.innerHTML = sweetHTML; 527 528 var targetElement = typeof params.target === 'string' ? document.querySelector(params.target) : params.target; 529 targetElement.appendChild(container); 530 531 var popup = getPopup(); 532 var content = getContent(); 533 var input = getChildByClass(content, swalClasses.input); 534 var file = getChildByClass(content, swalClasses.file); 535 var range = content.querySelector('.' + swalClasses.range + ' input'); 536 var rangeOutput = content.querySelector('.' + swalClasses.range + ' output'); 537 var select = getChildByClass(content, swalClasses.select); 538 var checkbox = content.querySelector('.' + swalClasses.checkbox + ' input'); 539 var textarea = getChildByClass(content, swalClasses.textarea); 540 541 // a11y 542 popup.setAttribute('role', params.toast ? 'alert' : 'dialog'); 543 popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive'); 544 if (!params.toast) { 545 popup.setAttribute('aria-modal', 'true'); 546 } 547 548 var oldInputVal = void 0; // IE11 workaround, see #1109 for details 549 var resetValidationError = function resetValidationError(e) { 550 if (Swal.isVisible() && oldInputVal !== e.target.value) { 551 Swal.resetValidationError(); 552 } 553 oldInputVal = e.target.value; 554 }; 555 556 input.oninput = resetValidationError; 557 file.onchange = resetValidationError; 558 select.onchange = resetValidationError; 559 checkbox.onchange = resetValidationError; 560 textarea.oninput = resetValidationError; 561 562 range.oninput = function(e) { 563 resetValidationError(e); 564 rangeOutput.value = range.value; 565 }; 566 567 range.onchange = function(e) { 568 resetValidationError(e); 569 range.nextSibling.value = range.value; 570 }; 571 572 return popup; 573 }; 574 575 var parseHtmlToContainer = function parseHtmlToContainer(param, target) { 576 if (!param) { 577 return hide(target); 578 } 579 580 if ((typeof param === 'undefined' ? 'undefined' : _typeof(param)) === 'object') { 581 target.innerHTML = ''; 582 if (0 in param) { 583 for (var i = 0; i in param; i++) { 584 target.appendChild(param[i].cloneNode(true)); 585 } 586 } else { 587 target.appendChild(param.cloneNode(true)); 588 } 589 } else if (param) { 590 target.innerHTML = param; 591 } else {} 592 show(target); 593 }; 594 595 var animationEndEvent = function() { 596 // Prevent run in Node env 597 if (isNodeEnv()) { 598 return false;
599 } 600 601 var testEl = document.createElement('div'); 602 var transEndEventNames = { 603 'WebkitAnimation': 'webkitAnimationEnd', 604 'OAnimation': 'oAnimationEnd oanimationend', 605 'animation': 'animationend' 606 }; 607 for (var i in transEndEventNames) { 608 if (transEndEventNames.hasOwnProperty(i) && typeof testEl.style[i] !== 'undefined') { 609 return transEndEventNames[i]; 610 } 611 } 612 613 return false; 614 }(); 615 616 // Measure width of scrollbar 617 // https://github.com/twbs/bootstrap/blob/master/js/modal.js#L279-L286 618 var measureScrollbar = function measureScrollbar() { 619 var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints; 620 if (supportsTouch) { 621 return 0; 622 } 623 var scrollDiv = document.createElement('div'); 624 scrollDiv.style.width = '50px'; 625 scrollDiv.style.height = '50px'; 626 scrollDiv.style.overflow = 'scroll'; 627 document.body.appendChild(scrollDiv); 628 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; 629 document.body.removeChild(scrollDiv); 630 return scrollbarWidth; 631 }; 632 633 var fixScrollbar = function fixScrollbar() { 634 // for queues, do not do this more than once 635 if (states.previousBodyPadding !== null) { 636 return; 637 } 638 // if the body has overflow 639 if (document.body.scrollHeight > window.innerHeight) { 640 // add padding so the content doesn't shift after removal of scrollbar 641 states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')); 642 document.body.style.paddingRight = states.previousBodyPadding + measureScrollbar() + 'px'; 643 } 644 }; 645 646 var undoScrollbar = function undoScrollbar() { 647 if (states.previousBodyPadding !== null) { 648 document.body.style.paddingRight = states.previousBodyPadding; 649 states.previousBodyPadding = null; 650 } 651 }; 652 653 // Fix iOS scrolling http://stackoverflow.com/q/39626302/1331425 654 var iOSfix = function iOSfix() { 655 var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; 656 if (iOS && !hasClass(document.body, swalClasses.iosfix)) { 657 var offset = document.body.scrollTop; 658 document.body.style.top = offset * -1 + 'px'; 659 addClass(document.body, swalClasses.iosfix); 660 } 661 }; 662 663 var undoIOSfix = function undoIOSfix() { 664 if (hasClass(document.body, swalClasses.iosfix)) { 665 var offset = parseInt(document.body.style.top, 10); 666 removeClass(document.body, swalClasses.iosfix); 667 document.body.style.top = ''; 668 document.body.scrollTop = offset * -1; 669 } 670 }; 671 672 var globalState = {}; 673 674 // Restore previous active (focused) element 675 var restoreActiveElement = function restoreActiveElement() { 676 var x = window.scrollX; 677 var y = window.scrollY; 678 globalState.restoreFocusTimeout = setTimeout(function() { 679 if (globalState.previousActiveElement && globalState.previousActiveElement.focus) { 680 globalState.previousActiveElement.focus(); 681 globalState.previousActiveElement = null; 682 } 683 }, 100); // issues/900 684 if (typeof x !== 'undefined' && typeof y !== 'undefined') { 685 // IE doesn't have scrollX/scrollY support 686 window.scrollTo(x, y); 687 } 688 }; 689 690 /* 691 * Global function to close sweetAlert 692 */ 693 var close = function close(onClose, onAfterClose) { 694 var container = getContainer(); 695 var popup = getPopup(); 696 if (!popup) { 697 return; 698 } 699 700 if (onClose !== null && typeof onClose === 'function') { 701 onClose(popup); 702 } 703 704 removeClass(popup, swalClasses.show); 705 addClass(popup, swalClasses.hide); 706 707 var removePopupAndResetState = function removePopupAndResetState() { 708 if (!isToast()) { 709 restoreActiveElement(); 710 globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { 711 capture: globalState.keydownListenerCapture 712 }); 713 globalState.keydownHandlerAdded = false; 714 } 715 716 if (container.parentNode) { 717 container.parentNode.removeChild(container); 718 } 719 removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['he
719ight-auto'], swalClasses['no-backdrop'], swalClasses['has-input'], swalClasses['toast-shown']]); 720 721 if (isModal()) { 722 undoScrollbar(); 723 undoIOSfix(); 724 } 725 726 if (onAfterClose !== null && typeof onAfterClose === 'function') { 727 setTimeout(function() { 728 onAfterClose(); 729 }); 730 } 731 }; 732 733 // If animation is supported, animate 734 if (animationEndEvent && !hasClass(popup, swalClasses.noanimation)) { 735 popup.addEventListener(animationEndEvent, function swalCloseEventFinished() { 736 popup.removeEventListener(animationEndEvent, swalCloseEventFinished); 737 if (hasClass(popup, swalClasses.hide)) { 738 removePopupAndResetState(); 739 } 740 }); 741 } else { 742 // Otherwise, remove immediately 743 removePopupAndResetState(); 744 } 745 }; 746 747 /* 748 * Global function to determine if swal2 popup is shown 749 */ 750 var isVisible$1 = function isVisible() { 751 return !!getPopup(); 752 }; 753 754 /* 755 * Global function to click 'Confirm' button 756 */ 757 var clickConfirm = function clickConfirm() { 758 return getConfirmButton().click(); 759 }; 760 761 /* 762 * Global function to click 'Cancel' button 763 */ 764 var clickCancel = function clickCancel() { 765 return getCancelButton().click(); 766 }; 767 768 function fire() { 769 var Swal = this; 770 771 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 772 args[_key] = arguments[_key]; 773 } 774 775 return new(Function.prototype.bind.apply(Swal, [null].concat(args)))(); 776 } 777 778 /** 779 * Extends a Swal class making it able to be instantiated without the `new` keyword (and thus without `Swal.fire`) 780 * @param ParentSwal 781 * @returns {NoNewKeywordSwal} 782 */ 783 function withNoNewKeyword(ParentSwal) { 784 var NoNewKeywordSwal = function NoNewKeywordSwal() { 785 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 786 args[_key] = arguments[_key]; 787 } 788 789 if (!(this instanceof NoNewKeywordSwal)) { 790 return new(Function.prototype.bind.apply(NoNewKeywordSwal, [null].concat(args)))(); 791 } 792 Object.getPrototypeOf(NoNewKeywordSwal).apply(this, args); 793 }; 794 NoNewKeywordSwal.prototype = _extends(Object.create(ParentSwal.prototype), { 795 constructor: NoNewKeywordSwal 796 }); 797 798 if (typeof Object.setPrototypeOf === 'function') { 799 Object.setPrototypeOf(NoNewKeywordSwal, ParentSwal); 800 } else { 801 // Android 4.4 802 // eslint-disable-next-line 803 NoNewKeywordSwal.__proto__ = ParentSwal; 804 } 805 return NoNewKeywordSwal; 806 } 807 808 var defaultParams = { 809 title: '', 810 titleText: '', 811 text: '', 812 html: '', 813 footer: '', 814 type: null, 815 toast: false, 816 customClass: '', 817 target: 'body', 818 backdrop: true, 819 animation: true, 820 heightAuto: true, 821 allowOutsideClick: true, 822 allowEscapeKey: true, 823 allowEnterKey: true, 824 stopKeydownPropagation: true, 825 keydownListenerCapture: false, 826 showConfirmButton: true,
827 showCancelButton: false, 828 preConfirm: null, 829 confirmButtonText: 'OK', 830 confirmButtonAriaLabel: '', 831 confirmButtonColor: null, 832 confirmButtonClass: null, 833 cancelButtonText: 'Cancel', 834 cancelButtonAriaLabel: '', 835 cancelButtonColor: null, 836 cancelButtonClass: null, 837 buttonsStyling: true, 838 reverseButtons: false, 839 focusConfirm: true, 840 focusCancel: false, 841 showCloseButton: false, 842 closeButtonAriaLabel: 'Close this dialog', 843 showLoaderOnConfirm: false, 844 imageUrl: null, 845 imageWidth: null, 846 imageHeight: null, 847 imageAlt: '', 848 imageClass: null, 849 timer: null, 850 width: null, 851 padding: null, 852 background: null, 853 input: null, 854 inputPlaceholder: '', 855 inputValue: '', 856 inputOptions: {}, 857 inputAutoTrim: true, 858 inputClass: null, 859 inputAttributes: {}, 860 inputValidator: null, 861 grow: false, 862 position: 'center', 863 progressSteps: [], 864 currentProgressStep: null, 865 progressStepsDistance: null, 866 onBeforeOpen: null, 867 onAfterClose: null, 868 onOpen: null, 869 onClose: null, 870 useRejections: false, 871 expectRejections: false 872 }; 873 874 var deprecatedParams = ['useRejections', 'expectRejections']; 875 876 /** 877 * Is valid parameter 878 * @param {String} paramName 879 */ 880 var isValidParameter = function isValidParameter(paramName) { 881 return defaultParams.hasOwnProperty(paramName) || paramName === 'extraParams'; 882 }; 883 884 /** 885 * Is deprecated parameter 886 * @param {String} paramName 887 */ 888 var isDeprecatedParameter = function isDeprecatedParameter(paramName) { 889 return deprecatedParams.indexOf(paramName) !== -1; 890 }; 891 892 /** 893 * Show relevant warnings for given params 894 * 895 * @param params 896 */ 897 var showWarningsForParams = function showWarningsForParams(params) { 898 for (var param in params) { 899 if (!isValidParameter(param)) { 900 warn('Unknown parameter "' + param + '"'); 901 } 902 if (isDeprecatedParameter(param)) { 903 warnOnce('The parameter "' + param + '" is deprecated and will be removed in the next major release.'); 904 } 905 } 906 }; 907 908 var deprecationWarning = '"setDefaults" & "resetDefaults" methods are deprecated
908in favor of "mixin" method and will be removed in the next major release. For new projects, use "mixin". For past projects already using "setDefaults", support will be provided through an additional package.'; 909 var defaults$1 = {}; 910 911 function withGlobalDefaults(ParentSwal) { 912 var SwalWithGlobalDefaults = function(_ParentSwal) { 913 inherits(SwalWithGlobalDefaults, _ParentSwal); 914 915 function SwalWithGlobalDefaults() { 916 classCallCheck(this, SwalWithGlobalDefaults); 917 return possibleConstructorReturn(this, (SwalWithGlobalDefaults.__proto__ || Object.getPrototypeOf(SwalWithGlobalDefaults)).apply(this, arguments)); 918 } 919 920 createClass(SwalWithGlobalDefaults, [{ 921 key: '_main', 922 value: function _main(params) { 923 return get(SwalWithGlobalDefaults.prototype.__proto__ || Object.getPrototypeOf(SwalWithGlobalDefaults.prototype), '_main', this).call(this, _extends({}, defaults$1, params)); 924 } 925 }], [{ 926 key: 'setDefaults', 927 value: function setDefaults(params) { 928 warnOnce(deprecationWarning); 929 if (!params || (typeof params === 'undefined' ? 'undefined' : _typeof(params)) !== 'object') { 930 throw new TypeError('SweetAlert2: The argument for setDefaults() is required and has to be a object'); 931 } 932 showWarningsForParams(params); 933 // assign valid params from `params` to `defaults` 934 Object.keys(params).forEach(function(param) { 935 if (ParentSwal.isValidParameter(param)) { 936 defaults$1[param] = params[param]; 937 } 938 }); 939 } 940 }, { 941 key: 'resetDefaults', 942 value: function resetDefaults() { 943 warnOnce(deprecationWarning); 944 defaults$1 = {}; 945 } 946 }]); 947 return SwalWithGlobalDefaults; 948 }(ParentSwal); 949 950 // Set default params if `window._swalDefaults` is an object 951 952 953 if (typeof window !== 'undefined' && _typeof(window._swalDefaults) === 'object') { 954 SwalWithGlobalDefaults.setDefaults(window._swalDefaults); 955 } 956 957 return SwalWithGlobalDefaults; 958 } 959 960 /** 961 * Returns an extended version of `Swal` containing `params` as defaults. 962 * Useful for reusing Swal configuration. 963 * 964 * For example: 965 * 966 * Before: 967 * const textPromptOptions = { input: 'text', showCancelButton: true } 968 * const {value: firstName} = await Swal({ ...textPromptOptions, title: 'What is your first name?' }) 969 * const {value: lastName} = await Swal({ ...textPromptOptions, title: 'What is your last name?' }) 970 * 971 * After: 972 * const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true }) 973 * const {value: firstName} = await TextPrompt('What is your first name?') 974 * const {value: lastName} = await TextPrompt('What is your last name?') 975 * 976 * @param mixinParams 977 */ 978 function mixin(mixinParams) { 979 var Swal = this; 980 return withNoNewKeyword(function(_Swal) { 981 inherits(MixinSwal, _Swal); 982 983 function MixinSwal() { 984 classCallCheck(this, MixinSwal); 985 return possibleConstructorReturn(this, (MixinSwal.__proto__ || Object.getPrototypeOf(MixinSwal)).apply(this, arguments)); 986 } 987 988 createClass(MixinSwal, [{ 989 key: '_main', 990 value: function _main(params) { 991 return get(MixinSwal.prototype.__proto__ || Object.getPrototypeOf(MixinSwal.prototype), '_main', this).call(this, _extends({}, mixinParams, params)); 992 } 993 }]); 994 return MixinSwal; 995 }(Swal)); 996 } 997 998 // private global state for the queue feature 999 var currentSteps = []; 1000 1001 /* 1002 * Global function for chaining sweetAlert popups 1003 */ 1004 var queue = function queue(steps) { 1005 var swal = this; 1006 currentSteps = steps; 1007 var resetQueue = function resetQueue() { 1008 currentSteps = []; 1009 document.body.removeAttribute('data-swal2-queue-step'); 1010 }; 1011 var queueResult = []; 1012 return new Promise(function(resolve, reject) { 1013 (function step(i, callback) { 1014 if (i < currentSteps.length) { 1015 document.body.setAttribute('data-swal2-queue-step', i); 1016 1017 swal(currentSteps[i]).then(function(result) { 1018 if (typeof result.value !== 'undefined') { 1019 queueResult.push(result.value); 1020 step(i + 1, callback); 1021 } else { 1022 resetQueue(); 1023 resolve({
1024 dismiss: result.dismiss 1025 }); 1026 } 1027 }); 1028 } else { 1029 resetQueue(); 1030 resolve({ 1031 value: queueResult 1032 }); 1033 } 1034 })(0); 1035 }); 1036 }; 1037 1038 /* 1039 * Global function for getting the index of current popup in queue 1040 */ 1041 var getQueueStep = function getQueueStep() { 1042 return document.body.getAttribute('data-swal2-queue-step'); 1043 }; 1044 1045 /* 1046 * Global function for inserting a popup to the queue 1047 */ 1048 var insertQueueStep = function insertQueueStep(step, index) { 1049 if (index && index < currentSteps.length) { 1050 return currentSteps.splice(index, 0, step); 1051 } 1052 return currentSteps.push(step); 1053 }; 1054 1055 /* 1056 * Global function for deleting a popup from the queue 1057 */ 1058 var deleteQueueStep = function deleteQueueStep(index) { 1059 if (typeof currentSteps[index] !== 'undefined') { 1060 currentSteps.splice(index, 1); 1061 } 1062 }; 1063 1064 /** 1065 * Show spinner instead of Confirm button and disable Cancel button 1066 */ 1067 var showLoading = function showLoading() { 1068 var popup = getPopup(); 1069 if (!popup) { 1070 Swal(''); 1071 } 1072 popup = getPopup(); 1073 var actions = getActions(); 1074 var confirmButton = getConfirmButton(); 1075 var cancelButton = getCancelButton(); 1076 1077 show(actions); 1078 show(confirmButton); 1079 addClass([popup, actions], swalClasses.loading); 1080 confirmButton.disabled = true; 1081 cancelButton.disabled = true; 1082 1083 popup.setAttribute('data-loading', true); 1084 popup.setAttribute('aria-busy', true); 1085 popup.focus(); 1086 }; 1087 1088 /** 1089 * Show spinner instead of Confirm button and disable Cancel button 1090 */ 1091 var getTimerLeft = function getTimerLeft() { 1092 return globalState.timeout && globalState.timeout.getTimerLeft(); 1093 }; 1094 1095 1096 1097 var staticMethods = Object.freeze({ 1098 isValidParameter: isValidParameter, 1099 isDeprecatedParameter: isDeprecatedParameter, 1100 argsToParams: argsToParams, 1101 adaptInputValidator: adaptInputValidator, 1102 close: close, 1103 closePopup: close, 1104 closeModal: close, 1105 closeToast: close, 1106 isVisible: isVisible$1, 1107 clickConfirm: clickConfirm, 1108 clickCancel: clickCancel, 1109 getPopup: getPopup, 1110 getTitle: getTitle, 1111 getContent: getContent, 1112 getImage: getImage, 1113 getButtonsWrapper: getButtonsWrapper, 1114 getActions: getActions, 1115 getConfirmButton: getConfirmButton, 1116 getCancelButton: getCancelButton, 1117 getFooter: getFooter, 1118 isLoading: isLoading, 1119 fire: fire, 1120 mixin: mixin, 1121 queue: queue, 1122 getQueueStep: getQueueStep, 1123 insertQueueStep: insertQueueStep, 1124 deleteQueueStep: deleteQueueStep, 1125 showLoading: showLoading, 1126 enableLoading: showLoading, 1127 getTimerLeft: getTimerLeft 1128 }); 1129 1130 // https://github.com/Riim/symbol-polyfill/blob/master/index.js 1131 1132 var _Symbol = typeof Symbol === 'function' ? Symbol : function() { 1133 var idCounter = 0; 1134 1135 function _Symbol(key) { 1136 return '__' + key + '_' + Math.floor(Math.random() * 1e9) + '_' + ++idCounter + '__'; 1137 } 1138 _Symbol.iterator = _Symbol('Symbol.iterator'); 1139 return _Symbol; 1140 }(); 1141 1142 // WeakMap polyfill, needed for Android 4.4 1143 // Related issue: https://github.com/sweetalert2/sweetalert2/issues/1071 1144 // http://webreflection.blogspot.fi/2015/04/a-weakmap-polyfill-in-20-lines-of-code.html 1145 1146 var WeakMap$1 = typeof WeakMap === 'function' ? WeakMap : function(s, dP, hOP) { 1147 function WeakMap() { 1148 dP(this, s, { 1149 value: _Symbol('WeakMap') 1150 }); 1151 } 1152 WeakMap.prototype = { 1153 'delete': function del(o) { 1154 delete o[this[s]]; 1155 }, 1156 get: function get(o) { 1157 return o[this[s]]; 1158 }, 1159 has: function has(o) { 1160 return hOP.call(o, this[s]); 1161 }, 1162 set: function set(o, v) { 1163 dP(o, this[s], { 1164 configurable: true, 1165 value: v 1166 }); 1167 } 1168 }; 1169 return WeakMap; 1170 }(_Symbol('WeakMap'), Object.defineProperty, {}.hasOwnProperty); 1171 1172 /** 1173 * This module containts `WeakMap`s for each effectively-"private property" that a `swal` has. 1174 * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` 1175 * This is the approach that Babel will probably take to implement private methods/fields 1176 * https://github.com/tc39/proposal-private-methods 1177 * https://github.com/babel/babel/pull/7555 1178 * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* 1179 * then we can use that language feature. 1180 */ 1181 1182 var privateProps = { 1183 promise: new WeakMap$1(), 1184 innerParams: new WeakMap$1(), 1185 domCache: new WeakMap$1() 1186 }; 1187 1188 /** 1189 * Show spinner instead of Confirm button and disable Cancel button 1190 */ 1191 function hideLoading() { 1192 var innerParams = privateProps.innerParams.get(this); 1193 var domCache = privateProps.domCache.get(this); 1194 if (!innerParams.showConfirmButton) { 1195 hide(domCache.confirmButton); 1196 if (!innerParams.showCancelButton) { 1197 hide(domCache.actions); 1198 } 1199 } 1200 removeClass([domCache.popup, domCache.actions], swalClasses.loading); 1201 domCache.popup.removeAttribute('aria-busy'); 1202 domCache.popup.removeAttribute('data-loading'); 1203 domCache.confirmButton.disabled = false;
1204 domCache.cancelButton.disabled = false; 1205 } 1206 1207 // Get input element by specified type or, if type isn't specified, by params.input 1208 function getInput(inputType) { 1209 var innerParams = privateProps.innerParams.get(this); 1210 var domCache = privateProps.domCache.get(this); 1211 inputType = inputType || innerParams.input; 1212 if (!inputType) { 1213 return null; 1214 } 1215 switch (inputType) { 1216 case 'select': 1217 case 'textarea': 1218 case 'file': 1219 return getChildByClass(domCache.content, swalClasses[inputType]); 1220 case 'checkbox': 1221 return domCache.popup.querySelector('.' + swalClasses.checkbox + ' input'); 1222 case 'radio': 1223 return domCache.popup.querySelector('.' + swalClasses.radio + ' input:checked') || domCache.popup.querySelector('.' + swalClasses.radio + ' input:first-child'); 1224 case 'range': 1225 return domCache.popup.querySelector('.' + swalClasses.range + ' input'); 1226 default: 1227 return getChildByClass(domCache.content, swalClasses.input); 1228 } 1229 } 1230 1231 function enableButtons() { 1232 var domCache = privateProps.domCache.get(this); 1233 domCache.confirmButton.disabled = false; 1234 domCache.cancelButton.disabled = false; 1235 } 1236 1237 function disableButtons() { 1238 var domCache = privateProps.domCache.get(this); 1239 domCache.confirmButton.disabled = true; 1240 domCache.cancelButton.disabled = true; 1241 } 1242 1243 function enableConfirmButton() { 1244 var domCache = privateProps.domCache.get(this); 1245 domCache.confirmButton.disabled = false; 1246 } 1247 1248 function disableConfirmButton() { 1249 var domCache = privateProps.domCache.get(this); 1250 domCache.confirmButton.disabled = true; 1251 } 1252 1253 function enableInput() { 1254 var input = this.getInput(); 1255 if (!input) { 1256 return false; 1257 } 1258 if (input.type === 'radio') { 1259 var radiosContainer = input.parentNode.parentNode; 1260 var radios = radiosContainer.querySelectorAll('input'); 1261 for (var i = 0; i < radios.length; i++) { 1262 radios[i].disabled = false; 1263 } 1264 } else { 1265 input.disabled = false; 1266 } 1267 } 1268 1269 function disableInput() { 1270 var input = this.getInput(); 1271 if (!input) { 1272 return false; 1273 } 1274 if (input && input.type === 'radio') { 1275 var radiosContainer = input.parentNode.parentNode; 1276 var radios = radiosContainer.querySelectorAll('input'); 1277 for (var i = 0; i < radios.length; i++) { 1278 radios[i].disabled = true; 1279 } 1280 } else { 1281 input.disabled = true; 1282 } 1283 } 1284 1285 // Show block with validation error 1286 function showValidationError(error) { 1287 var domCache = privateProps.domCache.get(this); 1288 domCache.validationError.innerHTML = error; 1289 var popupComputedStyle = window.getComputedStyle(domCache.popup); 1290 domCache.validationError.style.marginLeft = '-' + popupComputedStyle.getPropertyValue('padding-left'); 1291 domCache.validationError.style.marginRight = '-' + popupComputedStyle.getPropertyValue('padding-right'); 1292 show(domCache.validationError); 1293 1294 var input = this.getInput(); 1295 if (input) { 1296 input.setAttribute('aria-invalid', true); 1297 input.setAttribute('aria-describedBy', swalClasses.validationerror); 1298 focusInput(input); 1299 addClass(input, swalClasses.inputerror); 1300 } 1301 } 1302 1303 // Hide block with validation error 1304 function resetValidationError() { 1305 var domCache = privateProps.domCache.get(this); 1306 if (domCache.validationError) { 1307 hide(domCache.validationError); 1308 } 1309 1310 var input = this.getInput(); 1311 if (input) { 1312 input.removeAttribute('aria-invalid'); 1313 input.removeAttribute('aria-describedBy'); 1314 removeClass(input, swalClasses.inputerror); 1315 } 1316 } 1317 1318 var Timer = function Timer(callback, delay) { 1319 classCallCheck(this, Timer); 1320 1321 var id, started, running; 1322 var remaining = delay; 1323 this.start = function() { 1324 running = true; 1325 started = new Date(); 1326 id = setTimeout(callback, remaining); 1327 }; 1328 this.stop = function() { 1329 running = false; 1330 clearTimeout(id); 1331 remaining -= new Date() - started; 1332 }; 1333 this.getTimerLeft = function() { 1334 if (running) { 1335 this.stop(); 1336 this.start(); 1337 } 1338 return remaining; 1339 };
1340 this.getStateRunning = function() { 1341 return running; 1342 }; 1343 this.start(); 1344 }; 1345 1346 var defaultInputValidators = { 1347 email: function email(string, extraParams) { 1348 return (/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(string) ? Promise.resolve() : Promise.reject(extraParams && extraParams.validationMessage ? extraParams.validationMessage : 'Invalid email address')); 1349 }, 1350 url: function url(string, extraParams) { 1351 // taken from https://stackoverflow.com/a/3809435/1331425 1352 return (/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)$/.test(string) ? Promise.resolve() : Promise.reject(extraParams && extraParams.validationMessage ? extraParams.validationMessage : 'Invalid URL')); 1353 } 1354 }; 1355 1356 /** 1357 * Set type, text and actions on popup 1358 * 1359 * @param params 1360 * @returns {boolean} 1361 */ 1362 function setParameters(params) { 1363 // Use default `inputValidator` for supported input types if not provided 1364 if (!params.inputValidator) { 1365 Object.keys(defaultInputValidators).forEach(function(key) { 1366 if (params.input === key) { 1367 params.inputValidator = params.expectRejections ? defaultInputValidators[key] : Swal.adaptInputValidator(defaultInputValidators[key]); 1368 } 1369 }); 1370 } 1371 1372 // Determine if the custom target element is valid 1373 if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) { 1374 warn('Target parameter is not valid, defaulting to "body"'); 1375 params.target = 'body'; 1376 } 1377 1378 var popup = void 0; 1379 var oldPopup = getPopup(); 1380 var targetElement = typeof params.target === 'string' ? document.querySelector(params.target) : params.target; 1381 // If the model target has changed, refresh the popup 1382 if (oldPopup && targetElement && oldPopup.parentNode !== targetElement.parentNode) { 1383 popup = init(params); 1384 } else { 1385 popup = oldPopup || init(params); 1386 } 1387 1388 // Set popup width 1389 if (params.width) { 1390 popup.style.width = typeof params.width === 'number' ? params.width + 'px' : params.width; 1391 } 1392 1393 // Set popup padding 1394 if (params.padding) { 1395 popup.style.padding = typeof params.padding === 'number' ? params.padding + 'px' : params.padding; 1396 } 1397 1398 // Set popup background 1399 if (params.background) { 1400 popup.style.background = params.background; 1401 } 1402 var popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color'); 1403 var successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix'); 1404 for (var i = 0; i < successIconParts.length; i++) { 1405 successIconParts[i].style.backgroundColor = popupBackgroundColor; 1406 } 1407 1408 var container = getContainer(); 1409 var title = getTitle(); 1410 var content = getContent().querySelector('#' + swalClasses.content); 1411 var actions = getActions(); 1412 var confirmButton = getConfirmButton(); 1413 var cancelButton = getCancelButton(); 1414 var closeButton = getCloseButton(); 1415 var footer = getFooter(); 1416 1417 // Title 1418 if (params.titleText) { 1419 title.innerText = params.titleText; 1420 } else if (params.title) { 1421 title.innerHTML = params.title.split('\n').join('<br />'); 1422 } 1423 1424 if (typeof params.backdrop === 'string') { 1425 getContainer().style.background = params.backdrop; 1426 } else if (!params.backdrop) { 1427 addClass([document.documentElement, document.body], swalClasses['no-backdrop']); 1428 } 1429 1430 // Content as HTML 1431 if (params.html) { 1432 parseHtmlToContainer(params.html, content); 1433 1434 // Content as plain text 1435 } else if (params.text) { 1436 content.textContent = params.text; 1437 show(content); 1438 } else { 1439 hide(content); 1440 } 1441 1442 // Position 1443 if (params.position in swalClasses) { 1444 addClass(container, swalClasses[params.position]); 1445 } else { 1446 warn('The "position" parameter is not valid, defaulting to "center"'); 1447 addClass(container, swalClasses.center); 1448 } 1449 1450 // Grow 1451 if (params.grow && typeof params.grow === 'string') { 1452 var growClass = 'grow-' + params.grow; 1453 if (growClass in swalClasses) { 1454 addClass(container, swalClasses[growClass]); 1455 } 1456 } 1457 1458 // Animation 1459 if (typeof params.animation === 'function') { 1460 params.animation = params.animation.call(); 1461 } 1462 1463 // Close button 1464 if (params.showCloseButton) { 1465 closeButton.setAttribute('aria-label', params.closeButtonAriaLabel); 1466 show(closeButton); 1467 } else { 1468 hide(closeButton); 1469 } 1470 1471 // Default Class 1472 popup.className = swalClasses.popup; 1473 if (params.toast) { 1474 addClass([document.documentElement, document.body], swalClasses['toast-shown']); 1475 addClass(popup, swalClasses.toast); 1476 } else { 1477 addClass(popup, swalClasses.modal); 1478 } 1479 1480 // Custom Class 1481 if (params.customClass) { 1482 addClass(popup, params.customClass); 1483 } 1484 1485 // Progress steps 1486 var progressStepsContainer = getProgressSteps(); 1487 var currentProgressStep = parseInt(params.currentProgressStep === null ? Swal.getQueueStep() : params.currentProgressStep, 10); 1488 if (params.progressSteps && params.progressSteps.length) { 1489 show(progressStepsContainer); 1490 empty(progressStepsContainer); 1491 if (currentProgressStep >= params.progressSteps.length) { 1492 warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)'); 1493 } 1494 params.progressSteps.forEach(function(step, index) { 1495 var circle = document.createElement('li'); 1496 addClass(circle, swalClasses.progresscircle); 1497 circle.innerHTML = step; 1498 if (index === currentProgressStep) { 1499 addClass(circle, swalClasses.activeprogressstep); 1500 } 1501 progressStepsContainer.appendChild(circle); 1502 if (index !== params.progressSteps.length - 1) { 1503 var line = document.createElement('li'); 1504 addClass(line, swalClasses.progressline); 1505 if (params.progressStepsDistance) { 1506 line.style.width = params.progressStepsDistance; 1507 } 1508 progressStepsContainer.appendChild(line); 1509 } 1510 }); 1511 } else { 1512 hide(progressStepsContainer); 1513 } 1514 1515 // Icon 1516 var icons = getIcons(); 1517 for (var _i = 0; _i < icons.length; _i++) { 1518 hide(icons[_i]); 1519 } 1520 if (params.type) {
1521 var validType = false; 1522 for (var iconType in iconTypes) { 1523 if (params.type === iconType) { 1524 validType = true; 1525 break; 1526 } 1527 } 1528 if (!validType) { 1529 error('Unknown alert type: ' + params.type); 1530 return false; 1531 } 1532 var icon = popup.querySelector('.' + swalClasses.icon + '.' + iconTypes[params.type]); 1533 show(icon); 1534 1535 // Animate icon 1536 if (params.animation) { 1537 addClass(icon, 'swal2-animate-' + params.type + '-icon'); 1538 } 1539 } 1540 1541 // Custom image 1542 var image = getImage(); 1543 if (params.imageUrl) { 1544 image.setAttribute('src', params.imageUrl); 1545 image.setAttribute('alt', params.imageAlt); 1546 show(image); 1547 1548 if (params.imageWidth) { 1549 image.setAttribute('width', params.imageWidth); 1550 } else { 1551 image.removeAttribute('width'); 1552 } 1553 1554 if (params.imageHeight) { 1555 image.setAttribute('height', params.imageHeight); 1556 } else { 1557 image.removeAttribute('height'); 1558 } 1559 1560 image.className = swalClasses.image; 1561 if (params.imageClass) { 1562 addClass(image, params.imageClass); 1563 } 1564 } else { 1565 hide(image); 1566 } 1567 1568 // Cancel button 1569 if (params.showCancelButton) { 1570 cancelButton.style.display = 'inline-block'; 1571 } else { 1572 hide(cancelButton); 1573 } 1574 1575 // Confirm button 1576 if (params.showConfirmButton) { 1577 removeStyleProperty(confirmButton, 'display'); 1578 } else { 1579 hide(confirmButton); 1580 } 1581 1582 // Actions (buttons) wrapper 1583 if (!params.showConfirmButton && !params.showCancelButton) { 1584 hide(actions); 1585 } else { 1586 show(actions); 1587 } 1588 1589 // Edit text on confirm and cancel buttons 1590 confirmButton.innerHTML = params.confirmButtonText; 1591 cancelButton.innerHTML = params.cancelButtonText; 1592 1593 // ARIA labels for confirm and cancel buttons 1594 confirmButton.setAttribute('aria-label', params.confirmButtonAriaLabel); 1595 cancelButton.setAttribute('aria-label', params.cancelButtonAriaLabel); 1596 1597 // Add buttons custom classes 1598 confirmButton.className = swalClasses.confirm; 1599 addClass(confirmButton, params.confirmButtonClass); 1600 cancelButton.className = swalClasses.cancel; 1601 addClass(cancelButton, params.cancelButtonClass); 1602 1603 // Buttons styling 1604 if (params.buttonsStyling) { 1605 addClass([confirmButton, cancelButton], swalClasses.styled); 1606 1607 // Buttons background colors 1608 if (params.confirmButtonColor) { 1609 confirmButton.style.backgroundColor = params.confirmButtonColor; 1610 } 1611 if (params.cancelButtonColor) { 1612 cancelButton.style.backgroundColor = params.cancelButtonColor; 1613 } 1614 1615 // Loading state 1616 var confirmButtonBackgroundColor = window.getComputedStyle(confirmButton).getPropertyValue('background-color'); 1617 confirmButton.style.borderLeftColor = confirmButtonBackgroundColor; 1618 confirmButton.style.borderRightColor = confirmButtonBackgroundColor; 1619 } else { 1620 removeClass([confirmButton, cancelButton], swalClasses.styled); 1621 1622 confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = ''; 1623 cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = ''; 1624 } 1625 1626 // Footer 1627 parseHtmlToContainer(params.footer, footer); 1628 1629 // CSS animation 1630 if (params.animation === true) { 1631 removeClass(popup, swalClasses.noanimation); 1632 } else { 1633 addClass(popup, swalClasses.noanimation); 1634 } 1635 1636 // showLoaderOnConfirm && preConfirm 1637 if (params.showLoaderOnConfirm && !params.preConfirm) { 1638 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'); 1639 } 1640 } 1641 1642 /** 1643 * Open popup, add necessary classes and styles, fix scrollbar 1644 * 1645 * @param {Array} params 1646 */ 1647 var openPopup = function openPopup(params) { 1648 var container = getContainer(); 1649 var popup = getPopup(); 1650 1651 if (params.onBeforeOpen !== null && typeof params.onBeforeOpen === 'function') { 1652 params.onBeforeOpen(popup); 1653 } 1654 1655 if (params.animation) { 1656 addClass(popup, swalClasses.show); 1657 addClass(container, swalClasses.fade); 1658 removeClass(popup, swalClasses.hide); 1659 } else { 1660 removeClass(popup, swalClasses.fade); 1661 } 1662 show(popup); 1663 1664 // scrolling is 'hidden' until animation is done, after that 'auto' 1665 container.style.overflowY = 'hidden'; 1666 if (animationEndEvent && !hasClass(popup, swalClasses.noanimation)) { 1667 popup.addEventListener(animationEndEvent, function swalCloseEventFinished() { 1668 popup.removeEventListener(animationEndEvent, swalCloseEventFinished); 1669 container.style.overflowY = 'auto'; 1670 }); 1671 } else { 1672 container.style.overflowY = 'auto'; 1673 } 1674 1675 addClass([document.documentElement, document.body, container], swalClasses.shown); 1676 if (params.heightAuto && params.backdrop && !params.toast) { 1677 addClass([document.documentElement, document.body], swalClasses['he
1677ight-auto']); 1678 } 1679 1680 if (isModal()) { 1681 fixScrollbar(); 1682 iOSfix(); 1683 } 1684 if (!globalState.previousActiveElement) { 1685 globalState.previousActiveElement = document.activeElement; 1686 } 1687 if (params.onOpen !== null && typeof params.onOpen === 'function') { 1688 setTimeout(function() { 1689 params.onOpen(popup); 1690 }); 1691 } 1692 }; 1693 1694 function _main(userParams) { 1695 var _this = this; 1696 1697 showWarningsForParams(userParams); 1698 1699 var innerParams = _extends({}, defaultParams, userParams); 1700 setParameters(innerParams); 1701 Object.freeze(innerParams); 1702 privateProps.innerParams.set(this, innerParams); 1703 1704 // clear the previous timer 1705 if (globalState.timeout) { 1706 globalState.timeout.stop(); 1707 delete globalState.timeout; 1708 } 1709 1710 // clear the restore focus timeout 1711 clearTimeout(globalState.restoreFocusTimeout); 1712 1713 var domCache = { 1714 popup: getPopup(), 1715 container: getContainer(), 1716 content: getContent(), 1717 actions: getActions(), 1718 confirmButton: getConfirmButton(), 1719 cancelButton: getCancelButton(), 1720 closeButton: getCloseButton(), 1721 validationError: getValidationError(), 1722 progressSteps: getProgressSteps() 1723 }; 1724 privateProps.domCache.set(this, domCache); 1725 1726 var constructor = this.constructor; 1727 1728 return new Promise(function(resolve, reject) { 1729 // functions to handle all resolving/rejecting/settling 1730 var succeedWith = function succeedWith(value) { 1731 constructor.closePopup(innerParams.onClose, innerParams.onAfterClose); // TODO: make closePopup an *instance* method 1732 if (innerParams.useRejections) { 1733 resolve(value); 1734 } else { 1735 resolve({ 1736 value: value 1737 }); 1738 } 1739 }; 1740 var dismissWith = function dismissWith(dismiss) { 1741 constructor.closePopup(innerParams.onClose, innerParams.onAfterClose); 1742 if (innerParams.useRejections) { 1743 reject(dismiss); 1744 } else { 1745 resolve({ 1746 dismiss: dismiss 1747 }); 1748 } 1749 }; 1750 var errorWith = function errorWith(error$$1) { 1751 constructor.closePopup(innerParams.onClose, innerParams.onAfterClose); 1752 reject(error$$1); 1753 }; 1754 1755 // Close on timer 1756 if (innerParams.timer) { 1757 globalState.timeout = new Timer(function() { 1758 dismissWith('timer'); 1759 delete globalState.timeout; 1760 }, innerParams.timer); 1761 } 1762 1763 // Get the value of the popup input 1764 var getInputValue = function getInputValue() { 1765 var input = _this.getInput(); 1766 if (!input) { 1767 return null; 1768 } 1769 switch (innerParams.input) { 1770 case 'checkbox': 1771 return input.checked ? 1 : 0; 1772 case 'radio': 1773 return input.checked ? input.value : null; 1774 case 'file': 1775 return input.files.length ? input.files[0] : null; 1776 default: 1777 return innerParams.inputAutoTrim ? input.value.trim() : input.value; 1778 } 1779 }; 1780 1781 // input autofocus 1782 if (innerParams.input) { 1783 setTimeout(function() { 1784 var input = _this.getInput(); 1785 if (input) { 1786 focusInput(input); 1787 } 1788 }, 0); 1789 } 1790 1791 var confirm = function confirm(value) { 1792 if (innerParams.showLoaderOnConfirm) { 1793 constructor.showLoading(); // TODO: make showLoading an *instance* method 1794 } 1795 1796 if (innerParams.preConfirm) { 1797 _this.resetValidationError(); 1798 var preConfirmPromise = Promise.resolve().then(function() { 1799 return innerParams.preConfirm(value, innerParams.extraParams); 1800 }); 1801 if (innerParams.expectRejections) { 1802 preConfirmPromise.then(function(preConfirmValue) { 1803 return succeedWith(preConfirmValue || value); 1804 }, function(validationError) { 1805 _this.hideLoading(); 1806 if (validationError) { 1807 _this.showValidationError(validationError); 1808 } 1809 }); 1810 } else { 1811 preConfirmPromise.then(function(preConfirmValue) { 1812 if (isVisible(domCache.validationError) || preConfirmValue === false) { 1813 _this.hideLoading(); 1814 } else { 1815 succeedWith(preConfirmValue || value); 1816 } 1817 }, function(error$$1) { 1818 return errorWith(error$$1); 1819 }); 1820 } 1821 } else { 1822 succeedWith(value); 1823 } 1824 }; 1825 1826 // Mouse interactions 1827 var onButtonEvent = function onButtonEvent(event) { 1828 var e = event || window.event; 1829 var target = e.target || e.srcElement; 1830 var confirmButton = domCache.confirmButton, 1831 cancelButton = domCache.cancelButton; 1832 1833 var targetedConfirm = confirmButton && (confirmButton === target || confirmButton.contains(target)); 1834 var targetedCancel = cancelButton && (cancelButton === target || cancelButton.contains(target)); 1835 1836 switch (e.type) { 1837 case 'click': 1838 // Clicked 'confirm' 1839 if (targetedConfirm && constructor.isVisible()) { 1840 _this.disableButtons(); 1841 if (innerParams.input) { 1842 var inputValue = getInputValue(); 1843 1844 if (innerParams.inputValidator) { 1845 _this.disableInput();
1846 var validationPromise = Promise.resolve().then(function() { 1847 return innerParams.inputValidator(inputValue, innerParams.extraParams); 1848 }); 1849 if (innerParams.expectRejections) { 1850 validationPromise.then(function() { 1851 _this.enableButtons(); 1852 _this.enableInput(); 1853 confirm(inputValue); 1854 }, function(validationError) { 1855 _this.enableButtons(); 1856 _this.enableInput(); 1857 if (validationError) { 1858 _this.showValidationError(validationError); 1859 } 1860 }); 1861 } else { 1862 validationPromise.then(function(validationError) { 1863 _this.enableButtons(); 1864 _this.enableInput(); 1865 if (validationError) { 1866 _this.showValidationError(validationError); 1867 } else { 1868 confirm(inputValue); 1869 } 1870 }, function(error$$1) { 1871 return errorWith(error$$1); 1872 }); 1873 } 1874 } else { 1875 confirm(inputValue); 1876 } 1877 } else { 1878 confirm(true); 1879 } 1880 1881 // Clicked 'cancel' 1882 } else if (targetedCancel && constructor.isVisible()) { 1883 _this.disableButtons(); 1884 dismissWith(constructor.DismissReason.cancel); 1885 } 1886 break; 1887 default: 1888 } 1889 }; 1890 1891 var buttons = domCache.popup.querySelectorAll('button'); 1892 for (var i = 0; i < buttons.length; i++) { 1893 buttons[i].onclick = onButtonEvent; 1894 buttons[i].onmouseover = onButtonEvent; 1895 buttons[i].onmouseout = onButtonEvent; 1896 buttons[i].onmousedown = onButtonEvent; 1897 } 1898 1899 // Closing popup by close button 1900 domCache.closeButton.onclick = function() { 1901 dismissWith(constructor.DismissReason.close); 1902 }; 1903 1904 if (innerParams.toast) { 1905 // Closing popup by internal click 1906 domCache.popup.onclick = function(e) { 1907 if (innerParams.showConfirmButton || innerParams.showCancelButton || innerParams.showCloseButton || innerParams.input) { 1908 return; 1909 } 1910 constructor.closePopup(innerParams.onClose, innerParams.onAfterClose); 1911 dismissWith(constructor.DismissReason.close); 1912 }; 1913 } else { 1914 var ignoreOutsideClick = false; 1915 1916 // Ignore click events that had mousedown on the popup but mouseup on the container 1917 // This can happen when the user drags a slider 1918 domCache.popup.onmousedown = function() { 1919 domCache.container.onmouseup = function(e) { 1920 domCache.container.onmouseup = undefined; 1921 // We only check if the mouseup target is the container because usually it doesn't 1922 // have any other direct children aside of the popup 1923 if (e.target === domCache.container) { 1924 ignoreOutsideClick = true; 1925 } 1926 }; 1927 }; 1928 1929 // Ignore click events that had mousedown on the container but mouseup on the popup 1930 domCache.container.onmousedown = function() { 1931 domCache.popup.onmouseup = function(e) { 1932 domCache.popup.onmouseup = undefined; 1933 // We also need to check if the mouseup target is a child of the popup 1934 if (e.target === domCache.popup || domCache.popup.contains(e.target)) { 1935 ignoreOutsideClick = true; 1936 } 1937 }; 1938 }; 1939 1940 domCache.container.onclick = function(e) { 1941 if (ignoreOutsideClick) { 1942 ignoreOutsideClick = false; 1943 return; 1944 } 1945 if (e.target !== domCache.container) { 1946 return; 1947 } 1948 if (callIfFunction(innerParams.allowOutsideClick)) { 1949 dismissWith(constructor.DismissReason.backdrop); 1950 } 1951 }; 1952 } 1953 1954 // Reverse buttons (Confirm on the right side) 1955 if (innerParams.reverseButtons) { 1956 domCache.confirmButton.parentNode.insertBefore(domCache.cancelButton, domCache.confirmButton); 1957 } else { 1958 domCache.confirmButton.parentNode.insertBefore(domCache.confirmButton, domCache.cancelButton); 1959 } 1960 1961 // Focus handling 1962 var setFocus = function setFocus(index, increment) { 1963 var focusableElements = getFocusableElements(innerParams.focusCancel); 1964 // search for visible elements and select the next possible match 1965 for (var _i = 0; _i < focusableElements.length; _i++) { 1966 index = index + increment; 1967 1968 // rollover to first item 1969 if (index === focusableElements.length) { 1970 index = 0; 1971 1972 // go to last item 1973 } else if (index === -1) { 1974 index = focusableElements.length - 1; 1975 } 1976 1977 // determine if element is visible 1978 var el = focusableElements[index]; 1979 if (isVisible(el)) { 1980 return el.focus(); 1981 } 1982 } 1983 // no visible focusable elements, focus the popup 1984 domCache.popup.focus(); 1985 }; 1986
1987 var keydownHandler = function keydownHandler(e, innerParams) { 1988 if (innerParams.stopKeydownPropagation) { 1989 e.stopPropagation(); 1990 } 1991 1992 var arrowKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Left', 'Right', 'Up', 'Down' // IE11 1993 ]; 1994 1995 if (e.key === 'Enter' && !e.isComposing) { 1996 if (e.target && _this.getInput() && e.target.outerHTML === _this.getInput().outerHTML) { 1997 if (['textarea', 'file'].indexOf(innerParams.input) !== -1) { 1998 return; // do not submit 1999 } 2000 2001 constructor.clickConfirm(); 2002 e.preventDefault(); 2003 } 2004 2005 // TAB 2006 } else if (e.key === 'Tab') { 2007 var targetElement = e.target || e.srcElement; 2008 2009 var focusableElements = getFocusableElements(innerParams.focusCancel); 2010 var btnIndex = -1; // Find the button - note, this is a nodelist, not an array. 2011 for (var _i2 = 0; _i2 < focusableElements.length; _i2++) { 2012 if (targetElement === focusableElements[_i2]) { 2013 btnIndex = _i2; 2014 break; 2015 } 2016 } 2017 2018 if (!e.shiftKey) { 2019 // Cycle to the next button 2020 setFocus(btnIndex, 1); 2021 } else { 2022 // Cycle to the prev button 2023 setFocus(btnIndex, -1); 2024 } 2025 e.stopPropagation(); 2026 e.preventDefault(); 2027 2028 // ARROWS - switch focus between buttons 2029 } else if (arrowKeys.indexOf(e.key) !== -1) { 2030 // focus Cancel button if Confirm button is currently focused 2031 if (document.activeElement === domCache.confirmButton && isVisible(domCache.cancelButton)) { 2032 domCache.cancelButton.focus(); 2033 // and vice versa 2034 } else if (document.activeElement === domCache.cancelButton && isVisible(domCache.confirmButton)) { 2035 domCache.confirmButton.focus(); 2036 } 2037 2038 // ESC 2039 } else if ((e.key === 'Escape' || e.key === 'Esc') && callIfFunction(innerParams.allowEscapeKey) === true) { 2040 dismissWith(constructor.DismissReason.esc); 2041 } 2042 }; 2043 2044 if (globalState.keydownHandlerAdded) { 2045 globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { 2046 capture: globalState.keydownListenerCapture 2047 }); 2048 globalState.keydownHandlerAdded = false; 2049 } 2050 2051 if (!innerParams.toast) { 2052 globalState.keydownHandler = function(e) { 2053 return keydownHandler(e, innerParams); 2054 }; 2055 globalState.keydownTarget = innerParams.keydownListenerCapture ? window : domCache.popup; 2056 globalState.keydownListenerCapture = innerParams.keydownListenerCapture; 2057 globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { 2058 capture: globalState.keydownListenerCapture 2059 }); 2060 globalState.keydownHandlerAdded = true; 2061 } 2062 2063 _this.enableButtons(); 2064 _this.hideLoading(); 2065 _this.resetValidationError(); 2066 2067 if (innerParams.input) { 2068 addClass(document.body, swalClasses['has-input']); 2069 } 2070 2071 // inputs 2072 var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea']; 2073 var input = void 0; 2074 for (var _i3 = 0; _i3 < inputTypes.length; _i3++) { 2075 var inputClass = swalClasses[inputTypes[_i3]]; 2076 var inputContainer = getChildByClass(domCache.content, inputClass); 2077 input = _this.getInput(inputTypes[_i3]); 2078 2079 // set attributes 2080 if (input) { 2081 for (var j in input.attributes) { 2082 if (input.attributes.hasOwnProperty(j)) { 2083 var attrName = input.attributes[j].name; 2084 if (attrName !== 'type' && attrName !== 'value') { 2085 input.removeAttribute(attrName); 2086 } 2087 } 2088 } 2089 for (var attr in innerParams.inputAttributes) { 2090 input.setAttribute(attr, innerParams.inputAttributes[attr]); 2091 } 2092 } 2093 2094 // set class 2095 inputContainer.className = inputClass; 2096 if (innerParams.inputClass) { 2097 addClass(inputContainer, innerParams.inputClass); 2098 } 2099 2100 hide(inputContainer); 2101 } 2102 2103 var populateInputOptions = void 0; 2104 switch (innerParams.input) { 2105 case 'text': 2106 case 'email': 2107 case 'password': 2108 case 'number': 2109 case 'tel': 2110 case 'url': 2111 input = getChildByClass(domCache.content, swalClasses.input); 2112 input.value = innerParams.inputValue; 2113 input.placeholder = innerParams.inputPlaceholder; 2114 input.type = innerParams.input; 2115 show(input); 2116 break; 2117 case 'file': 2118 input = getChildByClass(domCache.content, swalClasses.file); 2119 input.placeholder = innerParams.inputPlaceholder; 2120 input.type = innerParams.input; 2121 show(input); 2122 break; 2123 case 'range': 2124 var range = getChildByClass(domCache.content, swalClasses.range); 2125 var rangeInput = range.querySelector('input'); 2126 var rangeOutput = range.querySelector('output'); 2127 rangeInput.value = innerParams.inputValue; 2128 rangeInput.type = innerParams.input; 2129 rangeOutput.value = innerParams.inputValue; 2130 show(range); 2131 break; 2132 case 'select': 2133 var select = getChildByClass(domCache.content, swalClasses.select); 2134 select.innerHTML = ''; 2135 if (innerParams.inputPlaceholder) { 2136 var placeholder = document.createElement('option'); 2137 placeholder.innerHTML = innerParams.inputPlaceholder; 2138 placeholder.value = ''; 2139 placeholder.disabled = true; 2140 placeholder.selected = true; 2141 select.appendChild(placeholder); 2142 } 2143 populateInputOptions = function populateInputOptions(inputOptions) { 2144 inputOptions.forEach(function(_ref) { 2145 var _ref2 = slicedToArray(_ref, 2), 2146 optionValue = _ref2[0], 2147 optionLabel = _ref2[1]; 2148 2149 var option = document.createElement('option'); 2150 option.value = optionValue; 2151 option.innerHTML = optionLabel; 2152 if (innerParams.inputValue.toString() === optionValue.toString()) { 2153 option.selected = true; 2154 } 2155 select.appendChild(option); 2156 }); 2157 show(select); 2158 select.focus(); 2159 }; 2160 break; 2161 case 'radio': 2162 var radio = getChildByClass(domCache.content, swalClasses.radio); 2163 radio.innerHTML = ''; 2164 populateInputOptions = function populateInputOptions(inputOptions) { 2165 inputOptions.forEach(function(_ref3) { 2166 var _ref4 = slicedToArray(_ref3, 2), 2167 radioValue = _ref4[0], 2168 radioLabel = _ref4[1]; 2169 2170 var radioInput = document.createElement('input'); 2171 var radioLabelElement = document.createElement('label'); 2172 radioInput.type = 'radio'; 2173 radioInput.name = swalClasses.radio; 2174 radioInput.value = radioValue; 2175 if (innerParams.inputValue.toString() === radioValue.toString()) { 2176 radioInput.checked = true; 2177 } 2178 radioLabelElement.innerHTML = radioLabel; 2179 radioLabelElement.insertBefore(radioInput, radioLabelElement.firstChild); 2180 radio.appendChild(radioLabelElement); 2181 }); 2182 show(radio); 2183 var radios = radio.querySelectorAll('input'); 2184 if (radios.length) { 2185 radios[0].focus(); 2186 } 2187 }; 2188 break; 2189 case 'checkbox': 2190 var checkbox = getChildByClass(domCache.content, swalClasses.checkbox); 2191 var checkboxInput = _this.getInput('checkbox'); 2192 checkboxInput.type = 'checkbox'; 2193 checkboxInput.value = 1; 2194 checkboxInput.id = swalClasses.checkbox; 2195 checkboxInput.checked = Boolean(innerParams.inputValue); 2196 var label = checkbox.getElementsByTagName('span'); 2197 if (label.length) { 2198 checkbox.removeChild(label[0]); 2199 } 2200 label = document.createElement('span'); 2201 label.innerHTML = innerParams.inputPlaceholder; 2202 checkbox.appendChild(label); 2203 show(checkbox); 2204 break; 2205 case 'textarea': 2206 var textarea = getChildByClass(domCache.content, swalClasses.textarea); 2207 textarea.value = innerParams.inputValue; 2208 textarea.placeholder = innerParams.inputPlaceholder; 2209 show(textarea); 2210 break; 2211 case null: 2212 break; 2213 default: 2214 error('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "' + innerParams.input + '"'); 2215 break; 2216 } 2217 2218 if (innerParams.input === 'select' || innerParams.input === 'radio') { 2219 var processInputOptions = function processInputOptions(inputOptions) { 2220 return populateInputOptions(formatInputOptions(inputOptions)); 2221 }; 2222 if (isThenable(innerParams.inputOptions)) { 2223 constructor.showLoading(); 2224 innerParams.inputOptions.then(function(inputOptions) { 2225 _this.hideLoading(); 2226 processInputOptions(inputOptions); 2227 }); 2228 } else if (_typeof(innerParams.inputOptions) === 'object') { 2229 processInputOptions(innerParams.inputOptions); 2230 } else { 2231 error('Unexpected type of inputOptions! Expected object, Map or Promise, got ' + _typeof(innerParams.inputOptions)); 2232 } 2233 } else if (['text', 'email', 'number', 'tel', 'textarea'].indexOf(innerParams.input) !== -1 && isThenable(innerParams.inputValue)) { 2234 constructor.showLoading(); 2235 hide(input); 2236 innerParams.inputValue.then(function(inputValue) { 2237 input.value = innerParams.input === 'number' ? parseFloat(inputValue) || 0 : inputValue + ''; 2238 show(input); 2239 _this.hideLoading(); 2240 }).catch(function(err) { 2241 error('Error in inputValue promise: ' + err); 2242 input.value = ''; 2243 show(input); 2244 _this.hideLoading(); 2245 }); 2246 } 2247 2248 openPopup(innerParams); 2249 2250 if (!innerParams.toast) { 2251 if (!callIfFunction(innerParams.allowEnterKey)) { 2252 if (document.activeElement) { 2253 document.activeElement.blur(); 2254 } 2255 } else if (innerParams.focusCancel && isVisible(domCache.cancelButton)) { 2256 domCache.cancelButton.focus(); 2257 } else if (innerParams.focusConfirm && isVisible(domCache.confirmButton)) { 2258 domCache.confirmButton.focus(); 2259 } else { 2260 setFocus(-1, 1); 2261 } 2262 } 2263 2264 // fix scroll 2265 domCache.container.scrollTop = 0; 2266 }); 2267 } 2268 2269 2270 2271 var instanceMethods = Object.freeze({ 2272 hideLoading: hideLoading, 2273 disableLoading: hideLoading, 2274 getInput: getInput, 2275 enableButtons: enableButtons, 2276 disableButtons: disableButtons, 2277 enableConfirmButton: enableConfirmButton, 2278 disableConfirmButton: disableConfirmButton, 2279 enableInput: enableInput, 2280 disableInput: disableInput, 2281 showValidationError: showValidationError, 2282 resetValidationError: resetValidationError, 2283 _main: _main 2284 }); 2285 2286 var currentInstance = void 0; 2287 2288 // SweetAlert constructor 2289 function SweetAlert() { 2290 // Prevent run in Node env 2291 if (typeof window === 'undefined') { 2292 return; 2293 } 2294 2295 // Check for the existence of Promise 2296 if (typeof Promise === 'undefined') { 2297 error('This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)'); 2298 } 2299 2300 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { 2301 args[_key] = arguments[_key]; 2302 } 2303 2304 if (typeof args[0] === 'undefined') { 2305 error('SweetAlert2 expects at least 1 attribute!'); 2306 return false;
2307 } 2308 2309 currentInstance = this; 2310 2311 var outerParams = Object.freeze(this.constructor.argsToParams(args)); 2312 2313 Object.defineProperties(this, { 2314 params: { 2315 value: outerParams, 2316 writable: false, 2317 enumerable: true 2318 } 2319 }); 2320 2321 var promise = this._main(this.params); 2322 privateProps.promise.set(this, promise); 2323 } 2324 2325 // `catch` cannot be the name of a module export, so we define our thenable methods here instead 2326 SweetAlert.prototype.then = function(onFulfilled, onRejected) { 2327 var promise = privateProps.promise.get(this); 2328 return promise.then(onFulfilled, onRejected); 2329 }; 2330 SweetAlert.prototype.catch = function(onRejected) { 2331 var promise = privateProps.promise.get(this); 2332 return promise.catch(onRejected); 2333 }; 2334 SweetAlert.prototype.finally = function(onFinally) { 2335 var promise = privateProps.promise.get(this); 2336 return promise.finally(onFinally); 2337 }; 2338 2339 // Assign instance methods from src/instanceMethods/*.js to prototype 2340 _extends(SweetAlert.prototype, instanceMethods); 2341 2342 // Assign static methods from src/staticMethods/*.js to constructor 2343 _extends(SweetAlert, staticMethods); 2344 2345 // Proxy to instance methods to constructor, for now, for backwards compatibility 2346 Object.keys(instanceMethods).forEach(function(key) { 2347 SweetAlert[key] = function() { 2348 if (currentInstance) { 2349 var _currentInstance; 2350 2351 return (_currentInstance = currentInstance)[key].apply(_currentInstance, arguments); 2352 } 2353 }; 2354 }); 2355 2356 SweetAlert.DismissReason = DismissReason; 2357 2358 SweetAlert.noop = function() {}; 2359 2360 SweetAlert.version = version; 2361 2362 var Swal = withNoNewKeyword(withGlobalDefaults(SweetAlert)); 2363 Swal.default = Swal; 2364 2365 return Swal; 2366 2367}))); 2368if (typeof window !== 'undefined' && window.Sweetalert2) { 2369 window.swal = window.sweetAlert = window.Swal = window.SweetAlert = window.Sweetalert2 2370} 2371 2372"undefined" != typeof document && function(e, t) { 2373 var n = e.createElement("style"); 2374 if (e.getElementsByTagName("head")[0].appendChild(n), n.styleSheet) n.styleSheet.disabled || (n.styleSheet.cssText = t); 2375 else try { 2376 n.innerHTML = t 2377 } catch (e) { 2378 n.innerText = t 2379 } 2380}(document, "@-webkit-keyframes swal2-show {\n" + 2381 " 0% {\n" + 2382 " -webkit-transform: scale(0.7);\n" + 2383 " transform: scale(0.7); }\n" + 2384 " 45% {\n" + 2385 " -webkit-transform: scale(1.05);\n" + 2386 " transform: scale(1.05); }\n" + 2387 " 80% {\n" + 2388 " -webkit-transform: scale(0.95);\n" + 2389 " transform: scale(0.95); }\n" + 2390 " 100% {\n" + 2391 " -webkit-transform: scale(1);\n" + 2392 " transform: scale(1); } }\n" + 2393 "\n" + 2394 "@keyframes swal2-show {\n" + 2395 " 0% {\n" + 2396 " -webkit-transform: scale(0.7);\n" + 2397 " transform: scale(0.7); }\n" + 2398 " 45% {\n" + 2399 " -webkit-transform: scale(1.05);\n" + 2400 " transform: scale(1.05); }\n" + 2401 " 80% {\n" + 2402 " -webkit-transform: scale(0.95);\n" + 2403 " transform: scale(0.95); }\n" + 2404 " 100% {\n" + 2405 " -webkit-transform: scale(1);\n" + 2406 " transform: scale(1); } }\n" + 2407 "\n" + 2408 "@-webkit-keyframes swal2-hide {\n" + 2409 " 0% {\n" + 2410 " -webkit-transform: scale(1);\n" + 2411 " transform: scale(1);\n" + 2412 " opacity: 1; }\n" + 2413 " 100% {\n" + 2414 " -webkit-transform: scale(0.5);\n" + 2415 " transform: scale(0.5);\n" + 2416 " opacity: 0; } }\n" + 2417 "\n" + 2418 "@keyframes swal2-hide {\n" + 2419 " 0% {\n" + 2420 " -webkit-transform: scale(1);\n" + 2421 " transform: scale(1);\n" + 2422 " opacity: 1; }\n" + 2423 " 100% {\n" + 2424 " -webkit-transform: scale(0.5);\n" + 2425 " transform: scale(0.5);\n" + 2426 " opacity: 0; } }\n" + 2427 "\n" + 2428 "@-webkit-keyframes swal2-animate-success-line-tip {\n" + 2429 " 0% {\n" + 2430 " top: 1.1875em;\n" + 2431 " left: .0625em;\n" + 2432 " width: 0; }\n" + 2433 " 54% {\n" + 2434 " top: 1.0625em;\n" + 2435 " left: .125em;\n" + 2436 " width: 0; }\n" + 2437 " 70% {\n" + 2438 " top: 2.1875em;\n" + 2439 " left: -.375em;\n" + 2440 " width: 3.125em; }\n" + 2441 " 84% {\n" + 2442 " top: 3em;\n" + 2443 " left: 1.3125em;\n" + 2444 " width: 1.0625em; }\n" + 2445 " 100% {\n" + 2446 " top: 2.8125em;\n" + 2447 " left: .875em;\n" + 2448 " width: 1.5625em; } }\n" + 2449 "\n" + 2450 "@keyframes swal2-animate-success-line-tip {\n" + 2451 " 0% {\n" + 2452 " top: 1.1875em;\n" + 2453 " left: .0625em;\n" + 2454 " width: 0; }\n" + 2455 " 54% {\n" + 2456 " top: 1.0625em;\n" + 2457 " left: .125em;\n" + 2458 " width: 0; }\n" + 2459 " 70% {\n" + 2460 " top: 2.1875em;\n" + 2461 " left: -.375em;\n" + 2462 " width: 3.125em; }\n" +
2463 " 84% {\n" + 2464 " top: 3em;\n" + 2465 " left: 1.3125em;\n" + 2466 " width: 1.0625em; }\n" + 2467 " 100% {\n" + 2468 " top: 2.8125em;\n" + 2469 " left: .875em;\n" + 2470 " width: 1.5625em; } }\n" + 2471 "\n" + 2472 "@-webkit-keyframes swal2-animate-success-line-long {\n" + 2473 " 0% {\n" + 2474 " top: 3.375em;\n" + 2475 " right: 2.875em;\n" + 2476 " width: 0; }\n" + 2477 " 65% {\n" + 2478 " top: 3.375em;\n" + 2479 " right: 2.875em;\n" + 2480 " width: 0; }\n" + 2481 " 84% {\n" + 2482 " top: 2.1875em;\n" + 2483 " right: 0;\n" + 2484 " width: 3.4375em; }\n" + 2485 " 100% {\n" + 2486 " top: 2.375em;\n" + 2487 " right: .5em;\n" + 2488 " width: 2.9375em; } }\n" + 2489 "\n" + 2490 "@keyframes swal2-animate-success-line-long {\n" + 2491 " 0% {\n" + 2492 " top: 3.375em;\n" + 2493 " right: 2.875em;\n" + 2494 " width: 0; }\n" + 2495 " 65% {\n" + 2496 " top: 3.375em;\n" + 2497 " right: 2.875em;\n" + 2498 " width: 0; }\n" + 2499 " 84% {\n" + 2500 " top: 2.1875em;\n" + 2501 " right: 0;\n" + 2502 " width: 3.4375em; }\n" + 2503 " 100% {\n" + 2504 " top: 2.375em;\n" + 2505 " right: .5em;\n" + 2506 " width: 2.9375em; } }\n" + 2507 "\n" + 2508 "@-webkit-keyframes swal2-rotate-success-circular-line {\n" + 2509 " 0% {\n" + 2510 " -webkit-transform: rotate(-45deg);\n" + 2511 " transform: rotate(-45deg); }\n" + 2512 " 5% {\n" + 2513 " -webkit-transform: rotate(-45deg);\n" + 2514 " transform: rotate(-45deg); }\n" + 2515 " 12% {\n" + 2516 " -webkit-transform: rotate(-405deg);\n" + 2517 " transform: rotate(-405deg); }\n" + 2518 " 100% {\n" + 2519 " -webkit-transform: rotate(-405deg);\n" + 2520 " transform: rotate(-405deg); } }\n" + 2521 "\n" + 2522 "@keyframes swal2-rotate-success-circular-line {\n" + 2523 " 0% {\n" + 2524 " -webkit-transform: rotate(-45deg);\n" + 2525 " transform: rotate(-45deg); }\n" + 2526 " 5% {\n" + 2527 " -webkit-transform: rotate(-45deg);\n" + 2528 " transform: rotate(-45deg); }\n" + 2529 " 12% {\n" + 2530 " -webkit-transform: rotate(-405deg);\n" + 2531 " transform: rotate(-405deg); }\n" + 2532 " 100% {\n" + 2533 " -webkit-transform: rotate(-405deg);\n" + 2534 " transform: rotate(-405deg); } }\n" + 2535 "\n" + 2536 "@-webkit-keyframes swal2-animate-error-x-mark {\n" + 2537 " 0% {\n" + 2538 " margin-top: 1.625em;\n" + 2539 " -webkit-transform: scale(0.4);\n" + 2540 " transform: scale(0.4);\n" + 2541 " opacity: 0; }\n" + 2542 " 50% {\n" + 2543 " margin-top: 1.625em;\n" + 2544 " -webkit-transform: scale(0.4);\n" + 2545 " transform: scale(0.4);\n" + 2546 " opacity: 0; }\n" + 2547 " 80% {\n" + 2548 " margin-top: -.375em;\n" + 2549 " -webkit-transform: scale(1.15);\n" + 2550 " transform: scale(1.15); }\n" + 2551 " 100% {\n" + 2552 " margin-top: 0;\n" + 2553 " -webkit-transform: scale(1);\n" + 2554 " transform: scale(1);\n" + 2555 " opacity: 1; } }\n" + 2556 "\n" + 2557 "@keyframes swal2-animate-error-x-mark {\n" + 2558 " 0% {\n" + 2559 " margin-top: 1.625em;\n" + 2560 " -webkit-transform: scale(0.4);\n" + 2561 " transform: scale(0.4);\n" + 2562 " opacity: 0; }\n" + 2563 " 50% {\n" + 2564 " margin-top: 1.625em;\n" + 2565 " -webkit-transform: scale(0.4);\n" + 2566 " transform: scale(0.4);\n" + 2567 " opacity: 0; }\n" + 2568 " 80% {\n" + 2569 " margin-top: -.375em;\n" + 2570 " -webkit-transform: scale(1.15);\n" + 2571 " transform: scale(1.15); }\n" + 2572 " 100% {\n" + 2573 " margin-top: 0;\n" + 2574 " -webkit-transform: scale(1);\n" + 2575 " transform: scale(1);\n" + 2576 " opacity: 1; } }\n" + 2577 "\n" + 2578 "@-webkit-keyframes swal2-animate-error-icon {\n" + 2579 " 0% {\n" + 2580 " -webkit-transform: rotateX(100deg);\n" + 2581 " transform: rotateX(100deg);\n" + 2582 " opacity: 0; }\n" + 2583 " 100% {\n" + 2584 " -webkit-transform: rotateX(0deg);\n" + 2585 " transform: rotateX(0deg);\n" + 2586 " opacity: 1; } }\n" + 2587 "\n" + 2588 "@keyframes swal2-animate-error-icon {\n" + 2589 " 0% {\n" + 2590 " -webkit-transform: rotateX(100deg);\n" + 2591 " transform: rotateX(100deg);\n" + 2592 " opacity: 0; }\n" + 2593 " 100% {\n" + 2594 " -webkit-transform: rotateX(0deg);\n" + 2595 " transform: rotateX(0deg);\n" + 2596 " opacity: 1; } }\n" + 2597 "\n" + 2598 "body.swal2-toast-shown.swal2-has-input > .swal2-container > .swal2-toast {\n" + 2599 " flex-direction: column;\n" + 2600 " align-items: stretch; }\n" + 2601 " body.swal2-toast-shown.swal2-has-input > .swal2-container > .swal2-toast .swal2-actions {\n" + 2602 " flex: 1;\n" + 2603 " align-self: stretch;\n" + 2604 " justify-content: flex-end;\n" + 2605 " height: 2.2em; }\n" + 2606 " body.swal2-toast-shown.swal2-has-input > .swal2-container > .swal2-toast .swal2-loading {\n" + 2607 " justify-content: center; }\n" + 2608 " body.swal2-toast-shown.swal2-has-input > .swal2-container > .swal2-toast .swal2-input {\n" + 2609 " height: 2em;\n" + 2610 " margin: .3125em auto;\n" + 2611 " font-size: 1em; }\n" + 2612 " body.swal2-toast-shown.swal2-has-input > .swal2-container > .swal2-toast .swal2-validationerror {\n" + 2613 " font-size: 1em; }\n" + 2614 "\n" + 2615 "body.swal2-toast-shown > .swal2-container {\n" + 2616 " position: fixed;\n" + 2617 " background-color: transparent; }\n" + 2618 " body.swal2-toast-shown > .swal2-container.swal2-shown {\n" + 2619 " background-color: transparent; }\n" + 2620 " body.swal2-toast-shown > .swal2-container.swal2-top {\n" + 2621 " top: 0;\n" + 2622 " right: auto;\n" + 2623 " bottom: auto;\n" + 2624 " left: 50%;\n" + 2625 " -webkit-transform: translateX(-50%);\n" + 2626 " transform: translateX(-50%); }\n" + 2627 " body.swal2-toast-shown > .swal2-container.swal2-top-end, body.swal2-toast-shown > .swal2-container.swal2-top-right {\n" + 2628 " top: 0;\n" + 2629 " right: 0;\n" + 2630 " bottom: auto;\n" + 2631 " left: auto; }\n" + 2632 " body.swal2-toast-shown > .swal2-container.swal2-top-start, body.swal2-toast-shown > .swal2-container.swal2-top-left {\n" + 2633 " top: 0;\n" + 2634 " right: auto;\n" + 2635 " bottom: auto;\n" + 2636 " left: 0; }\n" + 2637 " body.swal2-toast-shown > .swal2-container.swal2-center-start, body.swal2-toast-shown > .swal2-container.swal2-center-left {\n" + 2638 " top: 50%;\n" + 2639 " right: auto;\n" + 2640 " bottom: auto;\n" + 2641 " left: 0;\n" + 2642 " -webkit-transform: translateY(-50%);\n" + 2643 " transform: translateY(-50%); }\n" + 2644 " body.swal2-toast-shown > .swal2-container.swal2-center {\n" + 2645 " top: 50%;\n" + 2646 " right: auto;\n" + 2647 " bottom: auto;\n" + 2648 " left: 50%;\n" + 2649 " -webkit-transform: translate(-50%, -50%);\n" + 2650 " transform: translate(-50%, -50%); }\n" + 2651 " body.swal2-toast-shown > .swal2-container.swal2-center-end, body.swal2-toast-shown > .swal2-container.swal2-center-right {\n" + 2652 " top: 50%;\n" + 2653 " right: 0;\n" + 2654 " bottom: auto;\n" + 2655 " left: auto;\n" + 2656 " -webkit-transform: translateY(-50%);\n" + 2657 " transform: translateY(-50%); }\n" + 2658 " body.swal2-toast-shown > .swal2-container.swal2-bottom-start, body.swal2-toast-shown > .swal2-container.swal2-bottom-left {\n" + 2659 " top: auto;\n" + 2660 " right: auto;\n" + 2661 " bottom: 0;\n" + 2662 " left: 0; }\n" + 2663 " body.swal2-toast-shown > .swal2-container.swal2-bottom {\n" + 2664 " top: auto;\n" + 2665 " right: auto;\n" + 2666 " bottom: 0;\n" + 2667 " left: 50%;\n" + 2668 " -webkit-transform: translateX(-50%);\n" + 2669 " transform: translateX(-50%); }\n" + 2670 " body.swal2-toast-shown > .swal2-container.swal2-bottom-end, body.swal2-toast-shown > .swal2-container.swal2-bottom-right {\n" + 2671 " top: auto;\n" + 2672 " right: 0;\n" + 2673 " bottom: 0;\n" + 2674 " left: auto; }\n" + 2675 "\n" + 2676 ".swal2-popup.swal2-toast {\n" + 2677 " flex-direction: row;\n" + 2678 " align-items: center;\n" + 2679 " width: auto;\n" + 2680 " padding: 0.625em;\n" + 2681 " box-shadow: 0 0 0.625em #d9d9d9;\n" + 2682 " overflow-y: hidden; }\n" + 2683 " .swal2-popup.swal2-toast .swal2-header {\n" + 2684 " flex-direction: row; }\n" + 2685 " .swal2-popup.swal2-toast .swal2-title {\n" + 2686 " justify-content: flex-start;\n" + 2687 " margin: 0 .6em;\n" + 2688 " font-size: 1em; }\n" + 2689 " .swal2-popup.swal2-toast .swal2-close {\n" + 2690 " position: initial; }\n" + 2691 " .swal2-popup.swal2-toast .swal2-content {\n" + 2692 " justify-content: flex-start;\n" + 2693 " font-size: 1em; }\n" + 2694 " .swal2-popup.swal2-toast .swal2-icon {\n" + 2695 " width: 2em;\n" + 2696 " min-width: 2em;\n" + 2697 " height: 2em;\n" + 2698 " margin: 0; }\n" + 2699 " .swal2-popup.swal2-toast .swal2-icon-text {\n" + 2700 " font-size: 2em;\n" + 2701 " font-weight: bold;\n" + 2702 " line-height: 1em; }\n" + 2703 " .swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring {\n" + 2704 " width: 2em;\n" + 2705 " height: 2em; }\n" + 2706 " .swal2-popup.swal2-toast .swal2-icon.swal2-error [class^='swal2-x-mark-line'] {\n" + 2707 " top: .875em;\n" + 2708 " width: 1.375em; }\n" + 2709 " .swal2-popup.swal2-toast .swal2-icon.swal2-error [class^='swal2-x-mark-line'][class$='left'] {\n" + 2710 " left: .3125em; }\n" + 2711 " .swal2-popup.swal2-toast .swal2-icon.swal2-error [class^='swal2-x-mark-line'][class$='right'] {\n" + 2712 " right: .3125em; }\n" + 2713 " .swal2-popup.swal2-toast .swal2-actions {\n" + 2714 " height: auto;\n" + 2715 " margin: 0 .3125em; }\n" + 2716 " .swal2-popup.swal2-toast .swal2-styled {\n" + 2717 " margin: 0 .3125em;\n" + 2718 " padding: .3125em .625em;\n" + 2719 " font-size: 1em; }\n" + 2720 " .swal2-popup.swal2-toast .swal2-styled:focus {\n" + 2721 " box-shadow: 0 0 0 0.0625em #fff, 0 0 0 0.125em rgba(50, 100, 150, 0.4); }\n" + 2722 " .swal2-popup.swal2-toast .swal2-success {\n" + 2723 " border-color: #a5dc86; }\n" + 2724 " .swal2-popup.swal2-toast .swal2-success [class^='swal2-success-circular-line'] {\n" + 2725 " position: absolute;\n" + 2726 " width: 2em;\n" + 2727 " height: 2.8125em;\n" + 2728 " -webkit-transform: rotate(45deg);\n" + 2729 " transform: rotate(45deg);\n" + 2730 " border-radius: 50%; }\n" + 2731 " .swal2-popup.swal2-toast .swal2-success [class^='swal2-success-circular-line'][class$='left'] {\n" + 2732 " top: -.25em;\n" + 2733 " left: -.9375em;\n" + 2734 " -webkit-transform: rotate(-45deg);\n" + 2735 " transform: rotate(-45deg);\n" + 2736 " -webkit-transform-origin: 2em 2em;\n" + 2737 " transform-origin: 2em 2em;\n" + 2738 " border-radius: 4em 0 0 4em; }\n" + 2739 " .swal2-popup.swal2-toast .swal2-success [class^='swal2-success-circular-line'][class$='right'] {\n" + 2740 " top: -.25em;\n" + 2741 " left: .9375em;\n" + 2742 " -webkit-transform-origin: 0 2em;\n" + 2743 " transform-origin: 0 2em;\n" + 2744 " border-radius: 0 4em 4em 0; }\n" + 2745 " .swal2-popup.swal2-toast .swal2-success .swal2-success-ring {\n" + 2746 " width: 2em;\n" + 2747 " height: 2em; }\n" + 2748 " .swal2-popup.swal2-toast .swal2-success .swal2-success-fix {\n" + 2749 " top: 0;\n" + 2750 " left: .4375em;\n" + 2751 " width: .4375em;\n" + 2752 " height: 2.6875em; }\n" + 2753 " .swal2-popup.swal2-toast .swal2-success [class^='swal2-success-line'] {\n" + 2754 " height: .3125em; }\n" + 2755 " .swal2-popup.swal2-toast .swal2-success [class^='swal2-success-line'][class$='tip'] {\n" + 2756 " top: 1.125em;\n" + 2757 " left: .1875em;\n" + 2758 " width: .75em; }\n" + 2759 " .swal2-popup.swal2-toast .swal2-success [class^='swal2-success-line'][class$='long'] {\n" + 2760 " top: .9375em;\n" + 2761 " right: .1875em;\n" + 2762 " width: 1.375em; }\n" + 2763 " .swal2-popup.swal2-toast.swal2-show {\n" + 2764 " -webkit-animation: showSweetToast .5s;\n" + 2765 " animation: showSweetToast .5s; }\n" + 2766 " .swal2-popup.swal2-toast.swal2-hide {\n" + 2767 " -webkit-animation: hideSweetToast .2s forwards;\n" + 2768 " animation: hideSweetToast .2s forwards; }\n" + 2769 " .swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-tip {\n" + 2770 " -webkit-animation: animate-toast-success-tip .75s;\n" + 2771 " animation: animate-toast-success-tip .75s; }\n" + 2772 " .swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-long {\n" + 2773 " -webkit-animation: animate-toast-success-long .75s;\n" + 2774 " animation: animate-toast-success-long .75s; }\n" + 2775 "\n" + 2776 "@-webkit-keyframes showSweetToast {\n" + 2777 " 0% {\n" + 2778 " -webkit-transform: translateY(-0.625em) rotateZ(2deg);\n" + 2779 " transform: translateY(-0.625em) rotateZ(2deg);\n" + 2780 " opacity: 0; }\n" + 2781 " 33% {\n" + 2782 " -webkit-transform: translateY(0) rotateZ(-2deg);\n" + 2783 " transform: translateY(0) rotateZ(-2deg);\n" + 2784 " opacity: .5; }\n" + 2785 " 66% {\n" + 2786 " -webkit-transform: translateY(0.3125em) rotateZ(2deg);\n" + 2787 " transform: translateY(0.3125em) rotateZ(2deg);\n" + 2788 " opacity: .7; }\n" + 2789 " 100% {\n" + 2790 " -webkit-transform: translateY(0) rotateZ(0);\n" + 2791 " transform: translateY(0) rotateZ(0);\n" + 2792 " opacity: 1; } }\n" + 2793 "\n" + 2794 "@keyframes showSweetToast {\n" + 2795 " 0% {\n" + 2796 " -webkit-transform: translateY(-0.625em) rotateZ(2deg);\n" + 2797 " transform: translateY(-0.625em) rotateZ(2deg);\n" + 2798 " opacity: 0; }\n" + 2799 " 33% {\n" + 2800 " -webkit-transform: translateY(0) rotateZ(-2deg);\n" + 2801 " transform: translateY(0) rotateZ(-2deg);\n" + 2802 " opacity: .5; }\n" + 2803 " 66% {\n" + 2804 " -webkit-transform: translateY(0.3125em) rotateZ(2deg);\n" + 2805 " transform: translateY(0.3125em) rotateZ(2deg);\n" + 2806 " opacity: .7; }\n" + 2807 " 100% {\n" + 2808 " -webkit-transform: translateY(0) rotateZ(0);\n" + 2809 " transform: translateY(0) rotateZ(0);\n" + 2810 " opacity: 1; } }\n" + 2811 "\n" + 2812 "@-webkit-keyframes hideSweetToast {\n" + 2813 " 0% {\n" + 2814 " opacity: 1; }\n" + 2815 " 33% {\n" + 2816 " opacity: .5; }\n" + 2817 " 100% {\n" + 2818 " -webkit-transform: rotateZ(1deg);\n" + 2819 " transform: rotateZ(1deg);\n" + 2820 " opacity: 0; } }\n" + 2821 "\n" + 2822 "@keyframes hideSweetToast {\n" + 2823 " 0% {\n" + 2824 " opacity: 1; }\n" + 2825 " 33% {\n" + 2826 " opacity: .5; }\n" + 2827 " 100% {\n" + 2828 " -webkit-transform: rotateZ(1deg);\n" + 2829 " transform: rotateZ(1deg);\n" + 2830 " opacity: 0; } }\n" + 2831 "\n" + 2832 "@-webkit-keyframes animate-toast-success-tip {\n" + 2833 " 0% {\n" + 2834 " top: .5625em;\n" + 2835 " left: .0625em;\n" + 2836 " width: 0; }\n" + 2837 " 54% {\n" + 2838 " top: .125em;\n" + 2839 " left: .125em;\n" + 2840 " width: 0; }\n" + 2841 " 70% {\n" + 2842 " top: .625em;\n" + 2843 " left: -.25em;\n" + 2844 " width: 1.625em; }\n" +
2845 " 84% {\n" + 2846 " top: 1.0625em;\n" + 2847 " left: .75em;\n" + 2848 " width: .5em; }\n" + 2849 " 100% {\n" + 2850 " top: 1.125em;\n" + 2851 " left: .1875em;\n" + 2852 " width: .75em; } }\n" + 2853 "\n" + 2854 "@keyframes animate-toast-success-tip {\n" + 2855 " 0% {\n" + 2856 " top: .5625em;\n" + 2857 " left: .0625em;\n" + 2858 " width: 0; }\n" + 2859 " 54% {\n" + 2860 " top: .125em;\n" + 2861 " left: .125em;\n" + 2862 " width: 0; }\n" + 2863 " 70% {\n" + 2864 " top: .625em;\n" + 2865 " left: -.25em;\n" + 2866 " width: 1.625em; }\n" + 2867 " 84% {\n" + 2868 " top: 1.0625em;\n" + 2869 " left: .75em;\n" + 2870 " width: .5em; }\n" + 2871 " 100% {\n" + 2872 " top: 1.125em;\n" + 2873 " left: .1875em;\n" + 2874 " width: .75em; } }\n" + 2875 "\n" + 2876 "@-webkit-keyframes animate-toast-success-long {\n" + 2877 " 0% {\n" + 2878 " top: 1.625em;\n" + 2879 " right: 1.375em;\n" + 2880 " width: 0; }\n" + 2881 " 65% {\n" + 2882 " top: 1.25em;\n" + 2883 " right: .9375em;\n" + 2884 " width: 0; }\n" + 2885 " 84% {\n" + 2886 " top: .9375em;\n" + 2887 " right: 0;\n" + 2888 " width: 1.125em; }\n" + 2889 " 100% {\n" + 2890 " top: .9375em;\n" + 2891 " right: .1875em;\n" + 2892 " width: 1.375em; } }\n" + 2893 "\n" + 2894 "@keyframes animate-toast-success-long {\n" + 2895 " 0% {\n" + 2896 " top: 1.625em;\n" + 2897 " right: 1.375em;\n" + 2898 " width: 0; }\n" + 2899 " 65% {\n" + 2900 " top: 1.25em;\n" + 2901 " right: .9375em;\n" + 2902 " width: 0; }\n" + 2903 " 84% {\n" + 2904 " top: .9375em;\n" + 2905 " right: 0;\n" + 2906 " width: 1.125em; }\n" + 2907 " 100% {\n" + 2908 " top: .9375em;\n" + 2909 " right: .1875em;\n" + 2910 " width: 1.375em; } }\n" + 2911 "\n" + 2912 "body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) {\n" + 2913 " overflow-y: hidden; }\n" + 2914 "\n" + 2915 "body.swal2-height-auto {\n" + 2916 " height: auto !important; }\n" + 2917 "\n" + 2918 "body.swal2-no-backdrop .swal2-shown {\n" + 2919 " top: auto;\n" + 2920 " right: auto;\n" + 2921 " bottom: auto;\n" + 2922 " left: auto;\n" + 2923 " background-color: transparent; }\n" + 2924 " body.swal2-no-backdrop .swal2-shown > .swal2-modal {\n" + 2925 " box-shadow: 0 0 10px rgba(0, 0, 0, 0.4); }\n" + 2926 " body.swal2-no-backdrop .swal2-shown.swal2-top {\n" + 2927 " top: 0;\n" + 2928 " left: 50%;\n" + 2929 " -webkit-transform: translateX(-50%);\n" + 2930 " transform: translateX(-50%); }\n" + 2931 " body.swal2-no-backdrop .swal2-shown.swal2-top-start, body.swal2-no-backdrop .swal2-shown.swal2-top-left {\n" + 2932 " top: 0;\n" + 2933 " left: 0; }\n" + 2934 " body.swal2-no-backdrop .swal2-shown.swal2-top-end, body.swal2-no-backdrop .swal2-shown.swal2-top-right {\n" + 2935 " top: 0;\n" + 2936 " right: 0; }\n" + 2937 " body.swal2-no-backdrop .swal2-shown.swal2-center {\n" + 2938 " top: 50%;\n" + 2939 " left: 50%;\n" + 2940 " -webkit-transform: translate(-50%, -50%);\n" + 2941 " transform: translate(-50%, -50%); }\n" + 2942 " body.swal2-no-backdrop .swal2-shown.swal2-center-start, body.swal2-no-backdrop .swal2-shown.swal2-center-left {\n" + 2943 " top: 50%;\n" + 2944 " left: 0;\n" + 2945 " -webkit-transform: translateY(-50%);\n" + 2946 " transform: translateY(-50%); }\n" + 2947 " body.swal2-no-backdrop .swal2-shown.swal2-center-end, body.swal2-no-backdrop .swal2-shown.swal2-center-right {\n" + 2948 " top: 50%;\n" + 2949 " right: 0;\n" + 2950 " -webkit-transform: translateY(-50%);\n" + 2951 " transform: translateY(-50%); }\n" + 2952 " body.swal2-no-backdrop .swal2-shown.swal2-bottom {\n" + 2953 " bottom: 0;\n" + 2954 " left: 50%;\n" + 2955 " -webkit-transform: translateX(-50%);\n" + 2956 " transform: translateX(-50%); }\n" + 2957 " body.swal2-no-backdrop .swal2-shown.swal2-bottom-start, body.swal2-no-backdrop .swal2-shown.swal2-bottom-left {\n" + 2958 " bottom: 0;\n" + 2959 " left: 0; }\n" + 2960 " body.swal2-no-backdrop .swal2-shown.swal2-bottom-end, body.swal2-no-backdrop .swal2-shown.swal2-bottom-right {\n" + 2961 " right: 0;\n" + 2962 " bottom: 0; }\n" + 2963 "\n" + 2964 ".swal2-container {\n" + 2965 " display: flex;\n" + 2966 " position: fixed;\n" + 2967 " top: 0;\n" + 2968 " right: 0;\n" + 2969 " bottom: 0;\n" + 2970 " left: 0;\n" + 2971 " flex-direction: row;\n" + 2972 " align-items: center;\n" + 2973 " justify-content: center;\n" + 2974 " padding: 10px;\n" + 2975 " background-color: transparent;\n" + 2976 " z-index: 1060;\n" + 2977 " overflow-x: hidden;\n" + 2978 " -webkit-overflow-scrolling: touch; }\n" + 2979 " .swal2-container.swal2-top {\n" + 2980 " align-items: flex-start; }\n" + 2981 " .swal2-container.swal2-top-start, .swal2-container.swal2-top-left {\n" + 2982 " align-items: flex-start;\n" + 2983 " justify-content: flex-start; }\n" + 2984 " .swal2-container.swal2-top-end, .swal2-container.swal2-top-right {\n" + 2985 " align-items: flex-start;\n" + 2986 " justify-content: flex-end; }\n" + 2987 " .swal2-container.swal2-center {\n" + 2988 " align-items: center; }\n" + 2989 " .swal2-container.swal2-center-start, .swal2-container.swal2-center-left {\n" + 2990 " align-items: center;\n" + 2991 " justify-content: flex-start; }\n" + 2992 " .swal2-container.swal2-center-end, .swal2-container.swal2-center-right {\n" + 2993 " align-items: center;\n" + 2994 " justify-content: flex-end; }\n" + 2995 " .swal2-container.swal2-bottom {\n" + 2996 " align-items: flex-end; }\n" + 2997 " .swal2-container.swal2-bottom-start, .swal2-container.swal2-bottom-left {\n" + 2998 " align-items: flex-end;\n" + 2999 " justify-content: flex-start; }\n" + 3000 " .swal2-container.swal2-bottom-end, .swal2-container.swal2-bottom-right {\n" + 3001 " align-items: flex-end;\n" + 3002 " justify-content: flex-end; }\n" + 3003 " .swal2-container.swal2-grow-fullscreen > .swal2-modal {\n" + 3004 " display: flex !important;\n" + 3005 " flex: 1;\n" + 3006 " align-self: stretch;\n" + 3007 " justify-content: center; }\n" + 3008 " .swal2-container.swal2-grow-row > .swal2-modal {\n" + 3009 " display: flex !important;\n" + 3010 " flex: 1;\n" + 3011 " align-content: center;\n" + 3012 " justify-content: center; }\n" + 3013 " .swal2-container.swal2-grow-column {\n" + 3014 " flex: 1;\n" + 3015 " flex-direction: column; }\n" + 3016 " .swal2-container.swal2-grow-column.swal2-top, .swal2-container.swal2-grow-column.swal2-center, .swal2-container.swal2-grow-column.swal2-bottom {\n" + 3017 " align-items: center; }\n" + 3018 " .swal2-container.swal2-grow-column.swal2-top-start, .swal2-container.swal2-grow-column.swal2-center-start, .swal2-container.swal2-grow-column.swal2-bottom-start, .swal2-container.swal2-grow-column.swal2-top-left, .swal2-container.swal2-grow-column.swal2-center-left, .swal2-container.swal2-grow-column.swal2-bottom-left {\n" + 3019 " align-items: flex-start; }\n" + 3020 " .swal2-container.swal2-grow-column.swal2-top-end, .swal2-container.swal2-grow-column.swal2-center-end, .swal2-container.swal2-grow-column.swal2-bottom-end, .swal2-container.swal2-grow-column.swal2-top-right, .swal2-container.swal2-grow-column.swal2-center-right, .swal2-container.swal2-grow-column.swal2-bottom-right {\n" + 3021 " align-items: flex-end; }\n" + 3022 " .swal2-container.swal2-grow-column > .swal2-modal {\n" + 3023 " display: flex !important;\n" + 3024 " flex: 1;\n" + 3025 " align-content: center;\n" + 3026 " justify-content: center; }\n" + 3027 " .swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not
3027(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right) > .swal2-modal {\n" + 3028 " margin: auto; }\n" + 3029 " @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n" + 3030 " .swal2-container .swal2-modal {\n" + 3031 " margin: 0 !important; } }\n" + 3032 " .swal2-container.swal2-fade {\n" + 3033 " transition: background-color .1s; }\n" + 3034 " .swal2-container.swal2-shown {\n" + 3035 " background-color: rgba(0, 0, 0, 0.4); }\n" + 3036 "\n" + 3037 ".swal2-popup {\n" + 3038 " display: none;\n" + 3039 " position: relative;\n" + 3040 " flex-direction: column;\n" + 3041 " justify-content: center;\n" + 3042 " width: 32em;\n" + 3043 " max-width: 100%;\n" + 3044 " padding: 1.25em;\n" + 3045 " border-radius: 0.3125em;\n" + 3046 " background: #fff;\n" + 3047 " font-family: inherit;\n" + 3048 " font-size: 1rem;\n" + 3049 " box-sizing: border-box; }\n" + 3050 " .swal2-popup:focus {\n" + 3051 " outline: none; }\n" + 3052 " .swal2-popup.swal2-loading {\n" + 3053 " overflow-y: hidden; }\n" + 3054 " .swal2-popup .swal2-header {\n" + 3055 " display: flex;\n" + 3056 " flex-direction: column;\n" + 3057 " align-items: center; }\n" + 3058 " .swal2-popup .swal2-title {\n" + 3059 " display: block;\n" + 3060 " position: relative;\n" + 3061 " max-width: 100%;\n" + 3062 " margin: 0 0 0.4em;\n" + 3063 " padding: 0;\n" + 3064 " color: #595959;\n" + 3065 " font-size: 1.875em;\n" + 3066 " font-weight: 600;\n" + 3067 " text-align: center;\n" + 3068 " text-transform: none;\n" + 3069 " word-wrap: break-word; }\n" + 3070 " .swal2-popup .swal2-actions {\n" + 3071 " align-items: center;\n" + 3072 " justify-content: center;\n" + 3073 " margin: 1.25em auto 0; }\n" + 3074 " .swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled[disabled] {\n" + 3075 " opacity: .4; }\n" + 3076 " .swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:hover {\n" + 3077 " background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)); }\n" + 3078 " .swal2-popup .swal2-actions:not(.swal2-loading) .swal2-styled:active {\n" + 3079 " background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)); }\n" + 3080 " .swal2-popup .swal2-actions.swal2-loading .swal2-styled.swal2-confirm {\n" + 3081 " width: 2.5em;\n" + 3082 " height: 2.5em;\n" + 3083 " margin: .46875em;\n" + 3084 " padding: 0;\n" + 3085 " border: .25em solid transparent;\n" + 3086 " border-radius: 100%;\n" + 3087 " border-color: transparent;\n" + 3088 " background-color: transparent !important;\n" + 3089 " color: transparent;\n" + 3090 " cursor: default;\n" + 3091 " box-sizing: border-box;\n" + 3092 " -webkit-animation: swal2-rotate-loading 1.5s linear 0s infinite normal;\n" + 3093 " animation: swal2-rotate-loading 1.5s linear 0s infinite normal;\n" + 3094 " -webkit-user-select: none;\n" + 3095 " -moz-user-select: none;\n" + 3096 " -ms-user-select: none;\n" + 3097 " user-select: none; }\n" + 3098 " .swal2-popup .swal2-actions.swal2-loading .swal2-styled.swal2-cancel {\n" + 3099 " margin-right: 30px;\n" + 3100 " margin-left: 30px; }\n" + 3101 " .swal2-popup .swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after {\n" + 3102 " display: inline-block;\n" + 3103 " width: 15px;\n" + 3104 " height: 15px;\n" + 3105 " margin-left: 5px;\n" + 3106 " border: 3px solid #999999;\n" + 3107 " border-radius: 50%;\n" + 3108 " border-right-color: transparent;\n" + 3109 " box-shadow: 1px 1px 1px #fff;\n" + 3110 " content: '';\n" + 3111 " -webkit-animation: swal2-rotate-loading 1.5s linear 0s infinite normal;\n" + 3112 " animation: swal2-rotate-loading 1.5s linear 0s infinite normal; }\n" + 3113 " .swal2-popup .swal2-styled {\n" + 3114 " margin: 0 .3125em;\n" + 3115 " padding: .625em 2em;\n" + 3116 " font-weight: 500;\n" + 3117 " box-shadow: none; }\n" + 3118 " .swal2-popup .swal2-styled:not([disabled]) {\n" + 3119 " cursor: pointer; }\n" + 3120 " .swal2-popup .swal2-styled.swal2-confirm {\n" + 3121 " border: 0;\n" + 3122 " border-radius: 0.25em;\n" + 3123 " background: initial;\n" + 3124 " background-color: #3085d6;\n" + 3125 " color: #fff;\n" + 3126 " font-size: 1.0625em; }\n" + 3127 " .swal2-popup .swal2-styled.swal2-cancel {\n" + 3128 " border: 0;\n" + 3129 " border-radius: 0.25em;\n" + 3130 " background: initial;\n" + 3131 " background-color: #aaa;\n" + 3132 " color: #fff;\n" + 3133 " font-size: 1.0625em; }\n" + 3134 " .swal2-popup .swal2-styled:focus {\n" + 3135 " outline: none;\n" + 3136 " box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(50, 100, 150, 0.4); }\n" + 3137 " .swal2-popup .swal2-styled::-moz-focus-inner {\n" + 3138 " border: 0; }\n" + 3139 " .swal2-popup .swal2-footer {\n" + 3140 " justify-content: center;\n" + 3141 " margin: 1.25em 0 0;\n" + 3142 " padding-top: 1em;\n" + 3143 " border-top: 1px solid #eee;\n" + 3144 " color: #545454;\n" + 3145 " font-size: 1em; }\n" + 3146 " .swal2-popup .swal2-image {\n" + 3147 " max-width: 100%;\n" + 3148 " margin: 1.25em auto; }\n" + 3149 " .swal2-popup .swal2-close {\n" + 3150 " position: absolute;\n" + 3151 " top: 0;\n" + 3152 " right: 0;\n" + 3153 " justify-content: center;\n" + 3154 " width: 1.2em;\n" + 3155 " height: 1.2em;\n" + 3156 " padding: 0;\n" + 3157 " transition: color 0.1s ease-out;\n" + 3158 " border: none;\n" + 3159 " border-radius: 0;\n" + 3160 " background: transparent;\n" + 3161 " color: #cccccc;\n" + 3162 " font-family: serif;\n" + 3163 " font-size: 2.5em;
3163\n" + 3164 " line-height: 1.2;\n" + 3165 " cursor: pointer;\n" + 3166 " overflow: hidden; }\n" + 3167 " .swal2-popup .swal2-close:hover {\n" + 3168 " -webkit-transform: none;\n" + 3169 " transform: none;\n" + 3170 " color: #f27474; }\n" + 3171 " .swal2-popup > .swal2-input,\n" + 3172 " .swal2-popup > .swal2-file,\n" + 3173 " .swal2-popup > .swal2-textarea,\n" + 3174 " .swal2-popup > .swal2-select,\n" + 3175 " .swal2-popup > .swal2-radio,\n" + 3176 " .swal2-popup > .swal2-checkbox {\n" + 3177 " display: none; }\n" + 3178 " .swal2-popup .swal2-content {\n" + 3179 " justify-content: center;\n" + 3180 " margin: 0;\n" + 3181 " padding: 0;\n" + 3182 " color: #545454;\n" + 3183 " font-size: 1.125em;\n" + 3184 " font-weight: 300;\n" + 3185 " line-height: normal;\n" + 3186 " word-wrap: break-word; }\n" + 3187 " .swal2-popup #swal2-content {\n" + 3188 " text-align: center; }\n" + 3189 " .swal2-popup .swal2-input,\n" + 3190 " .swal2-popup .swal2-file,\n" + 3191 " .swal2-popup .swal2-textarea,\n" + 3192 " .swal2-popup .swal2-select,\n" + 3193 " .swal2-popup .swal2-radio,\n" + 3194 " .swal2-popup .swal2-checkbox {\n" + 3195 " margin: 1em auto; }\n" + 3196 " .swal2-popup .swal2-input,\n" + 3197 " .swal2-popup .swal2-file,\n" + 3198 " .swal2-popup .swal2-textarea {\n" + 3199 " width: 100%;\n" + 3200 " transition: border-color .3s, box-shadow .3s;\n" + 3201 " border: 1px solid #d9d9d9;\n" + 3202 " border-radius: 0.1875em;\n" + 3203 " font-size: 1.125em;\n" + 3204 " box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06);\n" + 3205 " box-sizing: border-box; }\n" + 3206 " .swal2-popup .swal2-input.swal2-inputerror,\n" + 3207 " .swal2-popup .swal2-file.swal2-inputerror,\n" + 3208 " .swal2-popup .swal2-textarea.swal2-inputerror {\n" + 3209 " border-color: #f27474 !important;\n" + 3210 " box-shadow: 0 0 2px #f27474 !important; }\n" + 3211 " .swal2-popup .swal2-input:focus,\n" + 3212 " .swal2-popup .swal2-file:focus,\n" + 3213 " .swal2-popup .swal2-textarea:focus {\n" + 3214 " border: 1px solid #b4dbed;\n" + 3215 " outline: none;\n" + 3216 " box-shadow: 0 0 3px #c4e6f5; }\n" + 3217 " .swal2-popup .swal2-input::-webkit-input-placeholder,\n" + 3218 " .swal2-popup .swal2-file::-webkit-input-placeholder,\n" + 3219 " .swal2-popup .swal2-textarea::-webkit-input-placeholder {\n" + 3220 " color: #cccccc; }\n" + 3221 " .swal2-popup .swal2-input:-ms-input-placeholder,\n" + 3222 " .swal2-popup .swal2-file:-ms-input-placeholder,\n" + 3223 " .swal2-popup .swal2-textarea:-ms-input-placeholder {\n" + 3224 " color: #cccccc; }\n" + 3225 " .swal2-popup .swal2-input::-ms-input-placeholder,\n" + 3226 " .swal2-popup .swal2-file::-ms-input-placeholder,\n" + 3227 " .swal2-popup .swal2-textarea::-ms-input-placeholder {\n" + 3228 " color: #cccccc; }\n" + 3229 " .swal2-popup .swal2-input::placeholder,\n" + 3230 " .swal2-popup .swal2-file::placeholder,\n" + 3231 " .swal2-popup .swal2-textarea::placeholder {\n" + 3232 " color: #cccccc; }\n" + 3233 " .swal2-popup .swal2-range input {\n" + 3234 " width: 80%; }\n" + 3235 " .swal2-popup .swal2-range output {\n" + 3236 " width: 20%;\n" + 3237 " font-weight: 600;\n" + 3238 " text-align: center; }\n" + 3239 " .swal2-popup .swal2-range input,\n" + 3240 " .swal2-popup .swal2-range output {\n" + 3241 " height: 2.625em;\n" + 3242 " margin: 1em auto;\n" + 3243 " padding: 0;\n" + 3244 " font-size: 1.125em;\n" + 3245 " line-height: 2.625em; }\n" + 3246 " .swal2-popup .swal2-input {\n" + 3247 " height: 2.625em;\n" + 3248 " padding: 0.75em; }\n" + 3249 " .swal2-popup .swal2-input[type='number'] {\n" + 3250 " max-width: 10em; }\n" + 3251 " .swal2-popup .swal2-file {\n" + 3252 " font-size: 1.125em; }\n" + 3253 " .swal2-popup .swal2-textarea {\n" + 3254 " height: 6.75em;\n" + 3255 " padding: 0.75em; }\n" + 3256 " .swal2-popup .swal2-select {\n" + 3257 " min-width: 50%;\n" + 3258 " max-width: 100%;\n" + 3259 " padding: .375em .625em;\n" + 3260 " color: #545454;\n" + 3261 " font-size: 1.125em; }\n" + 3262 " .swal2-popup .swal2-radio,\n" + 3263 " .swal2-popup .swal2-checkbox {\n" + 3264 " align-items: center;\n" + 3265 " justify-content: center; }\n" + 3266 " .swal2-popup .swal2-radio label,\n" + 3267 " .swal2-popup .swal2-checkbox label {\n" + 3268 " margin: 0 .6em;\n" + 3269 " font-size: 1.125em; }\n" + 3270 " .swal2-popup .swal2-radio input,\n" + 3271 " .swal2-popup .swal2-checkbox input {\n" + 3272 " margin: 0 .4em; }\n" + 3273 " .swal2-popup .swal2-validationerror {\n" + 3274 " display: none;\n" + 3275 " align-items: center;\n" + 3276 " justify-content: center;\n" + 3277 " padding: 0.625em;\n" + 3278 " background: #f0f0f0;\n" + 3279 " color: #666666;\n" + 3280 " font-size: 1em;\n" + 3281 " font-weight: 300;\n" + 3282 " overflow: hidden; }\n" + 3283 " .swal2-popup .swal2-validationerror::before {\n" + 3284 " display: inline-block;\n" + 3285 " width: 1.5em;\n" + 3286 " min-width: 1.5em;\n" + 3287 " height: 1.5em;\n" + 3288 " margin: 0 .625em;\n" + 3289 " border-radius: 50%;\n" + 3290 " background-color: #f27474;\n" + 3291 " color: #fff;\n" + 3292 " font-weight: 600;\n" + 3293 " line-height: 1.5em;\n" + 3294 " text-align: center;\n" + 3295 " content: '!';\n" + 3296 " zoom: normal; }\n" + 3297 "\n" + 3298 "@supports (-ms-accelerator: true) {\n" + 3299 " .swal2-range input {\n" + 3300 " width: 100% !important; }\n" + 3301 " .swal2-range output {\n" + 3302 " display: none; } }\n" + 3303 "\n" + 3304 "@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {\n" + 3305 " .swal2-range input {\n" + 3306 " width: 100% !important; }\n" + 3307 " .swal2-range output {\n" + 3308 " display: none; } }\n" + 3309 "\n" + 3310 "@-moz-document url-prefix() {\n" + 3311 " .swal2-close:focus {\n" + 3312 " outline: 2px solid rgba(50, 100, 150, 0.4); } }\n" + 3313 "\n" + 3314 ".swal2-icon {\n" + 3315 " position: relative;\n" + 3316 " justify-content: center;\n" + 3317 " width: 5em;\n" + 3318 " height: 5em;
3318\n" + 3319 " margin: 1.25em auto 1.875em;\n" + 3320 " border: .25em solid transparent;\n" + 3321 " border-radius: 50%;\n" + 3322 " line-height: 5em;\n" + 3323 " cursor: default;\n" + 3324 " box-sizing: content-box;\n" + 3325 " -webkit-user-select: none;\n" + 3326 " -moz-user-select: none;\n" + 3327 " -ms-user-select: none;\n" + 3328 " user-select: none;\n" + 3329 " zoom: normal; }\n" + 3330 " .swal2-icon-text {\n" + 3331 " font-size: 3.75em; }\n" + 3332 " .swal2-icon.swal2-error {\n" + 3333 " border-color: #f27474; }\n" + 3334 " .swal2-icon.swal2-error .swal2-x-mark {\n" + 3335 " position: relative;\n" + 3336 " flex-grow: 1; }\n" + 3337 " .swal2-icon.swal2-error [class^='swal2-x-mark-line'] {\n" + 3338 " display: block;\n" + 3339 " position: absolute;\n" + 3340 " top: 2.3125em;\n" + 3341 " width: 2.9375em;\n" + 3342 " height: .3125em;\n" + 3343 " border-radius: .125em;\n" + 3344 " background-color: #f27474; }\n" + 3345 " .swal2-icon.swal2-error [class^='swal2-x-mark-line'][class$='left'] {\n" + 3346 " left: 1.0625em;\n" + 3347 " -webkit-transform: rotate(45deg);\n" + 3348 " transform: rotate(45deg); }\n" + 3349 " .swal2-icon.swal2-error [class^='swal2-x-mark-line'][class$='right'] {\n" + 3350 " right: 1em;\n" + 3351 " -webkit-transform: rotate(-45deg);\n" + 3352 " transform: rotate(-45deg); }\n" + 3353 " .swal2-icon.swal2-warning {\n" + 3354 " border-color: #facea8;\n" + 3355 " color: #f8bb86; }\n" + 3356 " .swal2-icon.swal2-info {\n" + 3357 " border-color: #9de0f6;\n" + 3358 " color: #3fc3ee; }\n" + 3359 " .swal2-icon.swal2-question {\n" + 3360 " border-color: #c9dae1;\n" + 3361 " color: #87adbd; }\n" + 3362 " .swal2-icon.swal2-success {\n" + 3363 " border-color: #a5dc86; }\n" + 3364 " .swal2-icon.swal2-success [class^='swal2-success-circular-line'] {\n" + 3365 " position: absolute;\n" + 3366 " width: 3.75em;\n" + 3367 " height: 7.5em;\n" + 3368 " -webkit-transform: rotate(45deg);\n" + 3369 " transform: rotate(45deg);\n" + 3370 " border-radius: 50%; }\n" + 3371 " .swal2-icon.swal2-success [class^='swal2-success-circular-line'][class$='left'] {\n" + 3372 " top: -.4375em;\n" + 3373 " left: -2.0635em;\n" + 3374 " -webkit-transform: rotate(-45deg);\n" + 3375 " transform: rotate(-45deg);\n" + 3376 " -webkit-transform-origin: 3.75em 3.75em;\n" + 3377 " transform-origin: 3.75em 3.75em;\n" + 3378 " border-radius: 7.5em 0 0 7.5em; }\n" + 3379 " .swal2-icon.swal2-success [class^='swal2-success-circular-line'][class$='right'] {\n" + 3380 " top: -.6875em;\n" + 3381 " left: 1.875em;\n" + 3382 " -webkit-transform: rotate(-45deg);\n" + 3383 " transform: rotate(-45deg);\n" + 3384 " -webkit-transform-origin: 0 3.75em;\n" + 3385 " transform-origin: 0 3.75em;\n" + 3386 " border-radius: 0 7.5em 7.5em 0; }\n" + 3387 " .swal2-icon.swal2-success .swal2-success-ring {\n" + 3388 " position: absolute;\n" + 3389 " top: -.25em;\n" + 3390 " left: -.25em;\n" + 3391 " width: 100%;\n" + 3392 " height: 100%;\n" +
3393 " border: 0.25em solid rgba(165, 220, 134, 0.3);\n" + 3394 " border-radius: 50%;\n" + 3395 " z-index: 2;\n" + 3396 " box-sizing: content-box; }\n" + 3397 " .swal2-icon.swal2-success .swal2-success-fix {\n" + 3398 " position: absolute;\n" + 3399 " top: .5em;\n" + 3400 " left: 1.625em;\n" + 3401 " width: .4375em;\n" + 3402 " height: 5.625em;\n" + 3403 " -webkit-transform: rotate(-45deg);\n" + 3404 " transform: rotate(-45deg);\n" + 3405 " z-index: 1; }\n" + 3406 " .swal2-icon.swal2-success [class^='swal2-success-line'] {\n" + 3407 " display: block;\n" + 3408 " position: absolute;\n" + 3409 " height: .3125em;\n" + 3410 " border-radius: .125em;\n" + 3411 " background-color: #a5dc86;\n" + 3412 " z-index: 2; }\n" + 3413 " .swal2-icon.swal2-success [class^='swal2-success-line'][class$='tip'] {\n" + 3414 " top: 2.875em;\n" + 3415 " left: .875em;\n" + 3416 " width: 1.5625em;\n" + 3417 " -webkit-transform: rotate(45deg);\n" + 3418 " transform: rotate(45deg); }\n" + 3419 " .swal2-icon.swal2-success [class^='swal2-success-line'][class$='long'] {\n" + 3420 " top: 2.375em;\n" + 3421 " right: .5em;\n" + 3422 " width: 2.9375em;\n" + 3423 " -webkit-transform: rotate(-45deg);\n" + 3424 " transform: rotate(-45deg); }\n" + 3425 "\n" + 3426 ".swal2-progresssteps {\n" + 3427 " align-items: center;\n" + 3428 " margin: 0 0 1.25em;\n" + 3429 " padding: 0;\n" + 3430 " font-weight: 600; }\n" + 3431 " .swal2-progresssteps li {\n" + 3432 " display: inline-block;\n" + 3433 " position: relative; }\n" + 3434 " .swal2-progresssteps .swal2-progresscircle {\n" + 3435 " width: 2em;\n" + 3436 " height: 2em;\n" + 3437 " border-radius: 2em;\n" + 3438 " background: #3085d6;\n" + 3439 " color: #fff;\n" + 3440 " line-height: 2em;\n" + 3441 " text-align: center;\n" + 3442 " z-index: 20; }\n" + 3443 " .swal2-progresssteps .swal2-progresscircle:first-child {\n" + 3444 " margin-left: 0; }\n" + 3445 " .swal2-progresssteps .swal2-progresscircle:last-child {\n" + 3446 " margin-right: 0; }\n" + 3447 " .swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep {\n" + 3448 " background: #3085d6; }\n" + 3449 " .swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep ~ .swal2-progresscircle {\n" + 3450 " background: #add8e6; }\n" + 3451 " .swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep ~ .swal2-progressline {\n" + 3452 " background: #add8e6; }\n" + 3453 " .swal2-progresssteps .swal2-progressline {\n" + 3454 " width: 2.5em;\n" + 3455 " height: .4em;\n" + 3456 " margin: 0 -1px;\n" + 3457 " background: #3085d6;\n" + 3458 " z-index: 10; }\n" + 3459 "\n" + 3460 "[class^='swal2'] {\n" + 3461 " -webkit-tap-highlight-color: transparent; }\n" + 3462 "\n" + 3463 ".swal2-show {\n" + 3464 " -webkit-animation: swal2-show 0.3s;\n" + 3465 " animation: swal2-show 0.3s; }\n" + 3466 " .swal2-show.swal2-noanimation {\n" + 3467 " -webkit-animation: none;\n" + 3468 " animation: none; }\n" + 3469 "\n" + 3470 ".swal2-hide {\n" + 3471 " -webkit-animation: swal2-hide 0.15s forwards;\n" + 3472 " animation: swal2-hide 0.15s forwards; }\n" + 3473 " .swal2-hide.swal2-noanimation {\n" + 3474 " -webkit-animation: none;\n" + 3475 " animation: none; }\n" + 3476 "\n" + 3477 "[dir='rtl'] .swal2-close {\n" + 3478 " right: auto;\n" + 3479 " left: 0; }\n" + 3480 "\n" + 3481 ".swal2-animate-success-icon .swal2-success-line-tip {\n" + 3482 " -webkit-animation: swal2-animate-success-line-tip 0.75s;\n" + 3483 " animation: swal2-animate-success-line-tip 0.75s; }\n" + 3484 "\n" + 3485 ".swal2-animate-success-icon .swal2-success-line-long {\n" + 3486 " -webkit-animation: swal2-animate-success-line-long 0.75s;\n" + 3487 " animation: swal2-animate-success-line-long 0.75s; }\n" + 3488 "\n" + 3489 ".swal2-animate-success-icon .swal2-success-circular-line-right {\n" + 3490 " -webkit-animation: swal2-rotate-success-circular-line 4.25s ease-in;\n" + 3491 " animation: swal2-rotate-success-circular-line 4.25s ease-in; }\n" + 3492 "\n" + 3493 ".swal2-animate-error-icon {\n" + 3494 " -webkit-animation: swal2-animate-error-icon 0.5s;\n" + 3495 " animation: swal2-animate-error-icon 0.5s; }\n" + 3496 " .swal2-animate-error-icon .swal2-x-mark {\n" + 3497 " -webkit-animation: swal2-animate-error-x-mark 0.5s;\n" + 3498 " animation: swal2-animate-error-x-mark 0.5s; }\n" + 3499 "\n" + 3500 "@-webkit-keyframes swal2-rotate-loading {\n" + 3501 " 0% {\n" + 3502 " -webkit-transform: rotate(0deg);\n" + 3503 " transform: rotate(0deg); }\n" + 3504 " 100% {\n" + 3505 " -webkit-transform: rotate(360deg);\n" + 3506 " transform: rotate(360deg); } }\n" + 3507 "\n" + 3508 "@keyframes swal2-rotate-loading {\n" + 3509 " 0% {\n" + 3510 " -webkit-transform: rotate(0deg);\n" + 3511 " transform: rotate(0deg); }\n" + 3512 " 100% {\n" + 3513 " -webkit-transform: rotate(360deg);\n" + 3514 " transform: rotate(360deg); } }");
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.