;(function(window, document, undefined) { "use strict"; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o call showInputError with errorMessage */ sweetAlert.showInputError = swal.showInputError = function (errorMessage) { var modal = (0, _modulesHandleSwalDom.getModal)(); var $errorIcon = modal.querySelector('.sa-input-error'); (0, _modulesHandleDom.addClass)($errorIcon, 'show'); var $errorContainer = modal.querySelector('.sa-error-container'); (0, _modulesHandleDom.addClass)($errorContainer, 'show'); $errorContainer.querySelector('p').innerHTML = errorMessage; setTimeout(function () { sweetAlert.enableButtons(); }, 1); modal.querySelector('input').focus(); }; /* * Reset input error DOM elements */ sweetAlert.resetInputError = swal.resetInputError = function (event) { // If press enter => ignore if (event && event.keyCode === 13) { return false; } var $modal = (0, _modulesHandleSwalDom.getModal)(); var $errorIcon = $modal.querySelector('.sa-input-error'); (0, _modulesHandleDom.removeClass)($errorIcon, 'show'); var $errorContainer = $modal.querySelector('.sa-error-container'); (0, _modulesHandleDom.removeClass)($errorContainer, 'show'); }; /* * Disable confirm and cancel buttons */ sweetAlert.disableButtons = swal.disableButtons = function (event) { var modal = (0, _modulesHandleSwalDom.getModal)(); var $confirmButton = modal.querySelector('button.confirm'); var $cancelButton = modal.querySelector('button.cancel'); $confirmButton.disabled = true; $cancelButton.disabled = true; }; /* * Enable confirm and cancel buttons */ sweetAlert.enableButtons = swal.enableButtons = function (event) { var modal = (0, _modulesHandleSwalDom.getModal)(); var $confirmButton = modal.querySelector('button.confirm'); var $cancelButton = modal.querySelector('button.cancel'); $confirmButton.disabled = false; $cancelButton.disabled = false; }; if (typeof window !== 'undefined') { // The 'handle-click' module requires // that 'sweetAlert' was set as global. window.sweetAlert = window.swal = sweetAlert; } else { (0, _modulesUtils.logStr)('SweetAlert is a frontend module!'); } module.exports = exports['default']; },{"./modules/default-params":2,"./modules/handle-click":3,"./modules/handle-dom":4,"./modules/handle-key":5,"./modules/handle-swal-dom":6,"./modules/set-params":8,"./modules/utils":9}],2:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var defaultParams = { title: '', text: '', type: null, allowOutsideClick: false, showConfirmButton: true, showCancelButton: false, closeOnConfirm: true, closeOnCancel: true, confirmButtonText: 'OK', confirmButtonColor: '#8CD4F5', cancelButtonText: 'Cancel', imageUrl: null, imageSize: null, timer: null, customClass: '', html: false, animation: true, allowEscapeKey: true, inputType: 'text', inputPlaceholder: '', inputValue: '', showLoaderOnConfirm: false }; exports['default'] = defaultParams; module.exports = exports['default']; },{}],3:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _utils = require('./utils'); var _handleSwalDom = require('./handle-swal-dom'); var _handleDom = require('./handle-dom'); /* * User clicked on "Confirm"/"OK" or "Cancel" */ var handleButton = function handleButton(event, params, modal) { var e = event || window.event; var target = e.target || e.srcElement; var targetedConfirm = target.className.indexOf('confirm') !== -1; var targetedOverlay = target.className.indexOf('sweet-overlay') !== -1; var modalIsVisible = (0, _handleDom.hasClass)(modal, 'visible'); var doneFunctionExists = params.doneFunction && modal.getAttribute('data-has-done-function') === 'true'; // Since the user can change the background-color of the confirm button programmatically, // we must calculate what the color should be on hover/active var normalColor, hoverColor, activeColor; if (targetedConfirm && params.confirmButtonColor) { normalColor = params.confirmButtonColor; hoverColor = (0, _utils.colorLuminance)(normalColor, -0.04); activeColor = (0, _utils.colorLuminance)(normalColor, -0.14); } function shouldSetConfirmButtonColor(color) { if (targetedConfirm && params.confirmButtonColor) { target.style.backgroundColor = color; } } switch (e.type) { case 'mouseover': shouldSetConfirmButtonColor(hoverColor); break; case 'mouseout': shouldSetConfirmButtonColor(normalColor); break; case 'mousedown': shouldSetConfirmButtonColor(activeColor); break; case 'mouseup': shouldSetConfirmButtonColor(hoverColor); break; case 'focus': var $confirmButton = modal.querySelector('button.confirm'); var $cancelButton = modal.querySelector('button.cancel'); if (targetedConfirm) { $cancelButton.style.boxShadow = 'none'; } else { $confirmButton.style.boxShadow = 'none'; } break; case 'click': var clickedOnModal = modal === target; var clickedOnModalChild = (0, _handleDom.isDescendant)(modal, target); // Ignore click outside if allowOutsideClick is false if (!clickedOnModal && !clickedOnModalChild && modalIsVisible && !params.allowOutsideClick) { break; } if (targetedConfirm && doneFunctionExists && modalIsVisible) { handleConfirm(modal, params); } else if (doneFunctionExists && modalIsVisible || targetedOverlay) { handleCancel(modal, params); } else if ((0, _handleDom.isDescendant)(modal, target) && target.tagName === 'BUTTON') { sweetAlert.close(); } break; } }; /* * User clicked on "Confirm"/"OK" */ var handleConfirm = function handleConfirm(modal, params) { var callbackValue = true; if ((0, _handleDom.hasClass)(modal, 'show-input')) { callbackValue = modal.querySelector('input').value; if (!callbackValue) { callbackValue = ''; } } params.doneFunction(callbackValue); if (params.closeOnConfirm) { sweetAlert.close(); } // Disable cancel and confirm button if the parameter is true if (params.showLoaderOnConfirm) { sweetAlert.disableButtons(); } }; /* * User clicked on "Cancel" */ var handleCancel = function handleCancel(modal, params) { // Check if callback function expects a parameter (to track cancel actions) var functionAsStr = String(params.doneFunction).replace(/\s/g, ''); var functionHandlesCancel = functionAsStr.substring(0, 9) === 'function(' && functionAsStr.substring(9, 10) !== ')'; if (functionHandlesCancel) { params.doneFunction(false); } if (params.closeOnCancel) { sweetAlert.close(); } }; exports['default'] = { handleButton: handleButton, handleConfirm: handleConfirm, handleCancel: handleCancel }; module.exports = exports['default']; },{"./handle-dom":4,"./handle-swal-dom":6,"./utils":9}],4:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var hasClass = function hasClass(elem, className) { return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' '); }; var addClass = function addClass(elem, className) { if (!hasClass(elem, className)) { elem.className += ' ' + className; } }; var removeClass = function removeClass(elem, className) { var newClass = ' ' + elem.className.replace(/[\t\r\n]/g, ' ') + ' '; if (hasClass(elem, className)) { while (newClass.indexOf(' ' + className + ' ') >= 0) { newClass = newClass.replace(' ' + className + ' ', ' '); } elem.className = newClass.replace(/^\s+|\s+$/g, ''); } }; var escapeHtml = function escapeHtml(str) { var div = document.createElement('div'); div.appendChild(document.createTextNode(str)); return div.innerHTML; }; var _show = function _show(elem) { elem.style.opacity = ''; elem.style.display = 'block'; }; var show = function show(elems) { if (elems && !elems.length) { return _show(elems); } for (var i = 0; i < elems.length; ++i) { _show(elems[i]); } }; var _hide = function _hide(elem) { elem.style.opacity = ''; elem.style.display = 'none'; }; var hide = function hide(elems) { if (elems && !elems.length) { return _hide(elems); } for (var i = 0; i < elems.length; ++i) { _hide(elems[i]); } }; var isDescendant = function isDescendant(parent, child) { var node = child.parentNode; while (node !== null) { if (node === parent) { return true; } node = node.parentNode; } return false; }; var getTopMargin = function getTopMargin(elem) { elem.style.left = '-9999px'; elem.style.display = 'block'; var height = elem.clientHeight, padding; if (typeof getComputedStyle !== "undefined") { // IE 8 padding = parseInt(getComputedStyle(elem).getPropertyValue('padding-top'), 10); } else { padding = parseInt(elem.currentStyle.padding); } elem.style.left = ''; elem.style.display = 'none'; return '-' + parseInt((height + padding) / 2) + 'px'; }; var fadeIn = function fadeIn(elem, interval) { if (+elem.style.opacity < 1) { interval = interval || 16; elem.style.opacity = 0; elem.style.display = 'block'; var last = +new Date(); var tick = function tick() { elem.style.opacity = +elem.style.opacity + (new Date() - last) / 100; last = +new Date(); if (+elem.style.opacity < 1) { setTimeout(tick, interval); } }; tick(); } elem.style.display = 'block'; //fallback IE8 }; var fadeOut = function fadeOut(elem, interval) { interval = interval || 16; elem.style.opacity = 1; var last = +new Date(); var tick = function tick() { elem.style.opacity = +elem.style.opacity - (new Date() - last) / 100; last = +new Date(); if (+elem.style.opacity > 0) { setTimeout(tick, interval); } else { elem.style.display = 'none'; } }; tick(); }; var fireClick = function fireClick(node) { // Taken from http://www.nonobtrusive.com/2011/11/29/programatically-fire-crossbrowser-click-event-with-javascript/ // Then fixed for today's Chrome browser. if (typeof MouseEvent === 'function') { // Up-to-date approach var mevt = new MouseEvent('click', { view: window, bubbles: false, cancelable: true }); node.dispatchEvent(mevt); } else if (document.createEvent) { // Fallback var evt = document.createEvent('MouseEvents'); evt.initEvent('click', false, false); node.dispatchEvent(evt); } else if (document.createEventObject) { node.fireEvent('onclick'); } else if (typeof node.onclick === 'function') { node.onclick(); } }; var stopEventPropagation = function stopEventPropagation(e) { // In particular, make sure the space bar doesn't scroll the main window. if (typeof e.stopPropagation === 'function') { e.stopPropagation(); e.preventDefault(); } else if (window.event && window.event.hasOwnProperty('cancelBubble')) { window.event.cancelBubble = true; } }; exports.hasClass = hasClass; exports.addClass = addClass; exports.removeClass = removeClass; exports.escapeHtml = escapeHtml; exports._show = _show; exports.show = show; exports._hide = _hide; exports.hide = hide; exports.isDescendant = isDescendant; exports.getTopMargin = getTopMargin; exports.fadeIn = fadeIn; exports.fadeOut = fadeOut; exports.fireClick = fireClick; exports.stopEventPropagation = stopEventPropagation; },{}],5:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _handleDom = require('./handle-dom'); var _handleSwalDom = require('./handle-swal-dom'); var handleKeyDown = function handleKeyDown(event, params, modal) { var e = event || window.event; var keyCode = e.keyCode || e.which; var $okButton = modal.querySelector('button.confirm'); var $cancelButton = modal.querySelector('button.cancel'); var $modalButtons = modal.querySelectorAll('button[tabindex]'); if ([9, 13, 32, 27].indexOf(keyCode) === -1) { // Don't do work on keys we don't care about. return; } var $targetElement = e.target || e.srcElement; var btnIndex = -1; // Find the button - note, this is a nodelist, not an array. for (var i = 0; i < $modalButtons.length; i++) { if ($targetElement === $modalButtons[i]) { btnIndex = i; break; } } if (keyCode === 9) { // TAB if (btnIndex === -1) { // No button focused. Jump to the confirm button. $targetElement = $okButton; } else { // Cycle to the next button if (btnIndex === $modalButtons.length - 1) { $targetElement = $modalButtons[0]; } else { $targetElement = $modalButtons[btnIndex + 1]; } } (0, _handleDom.stopEventPropagation)(e); $targetElement.focus(); if (params.confirmButtonColor) { (0, _handleSwalDom.setFocusStyle)($targetElement, params.confirmButtonColor); } } else { if (keyCode === 13) { if ($targetElement.tagName === 'INPUT') { $targetElement = $okButton; $okButton.focus(); } if (btnIndex === -1) { // ENTER/SPACE clicked outside of a button. $targetElement = $okButton; } else { // Do nothing - let the browser handle it. $targetElement = undefined; } } else if (keyCode === 27 && params.allowEscapeKey === true) { $targetElement = $cancelButton; (0, _handleDom.fireClick)($targetElement, e); } else { // Fallback - let the browser handle it. $targetElement = undefined; } } }; exports['default'] = handleKeyDown; module.exports = exports['default']; },{"./handle-dom":4,"./handle-swal-dom":6}],6:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _utils = require('./utils'); var _handleDom = require('./handle-dom'); var _defaultParams = require('./default-params'); var _defaultParams2 = _interopRequireDefault(_defaultParams); /* * Add modal + overlay to DOM */ var _injectedHtml = require('./injected-html'); var _injectedHtml2 = _interopRequireDefault(_injectedHtml); var modalClass = '.sweet-alert'; var overlayClass = '.sweet-overlay'; var sweetAlertInitialize = function sweetAlertInitialize() { var sweetWrap = document.createElement('div'); sweetWrap.innerHTML = _injectedHtml2['default']; // Append elements to body while (sweetWrap.firstChild) { document.body.appendChild(sweetWrap.firstChild); } }; /* * Get DOM element of modal */ var getModal = function getModal() { var $modal = document.querySelector(modalClass); if (!$modal) { sweetAlertInitialize(); $modal = getModal(); } return $modal; }; /* * Get DOM element of input (in modal) */ var getInput = function getInput() { var $modal = getModal(); if ($modal) { return $modal.querySelector('input'); } }; /* * Get DOM element of overlay */ var getOverlay = function getOverlay() { return document.querySelector(overlayClass); }; /* * Add box-shadow style to button (depending on its chosen bg-color) */ var setFocusStyle = function setFocusStyle($button, bgColor) { var rgbColor = (0, _utils.hexToRgb)(bgColor); $button.style.boxShadow = '0 0 2px rgba(' + rgbColor + ', 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)'; }; /* * Animation when opening modal */ var openModal = function openModal(callback) { var $modal = getModal(); (0, _handleDom.fadeIn)(getOverlay(), 10); (0, _handleDom.show)($modal); (0, _handleDom.addClass)($modal, 'showSweetAlert'); (0, _handleDom.removeClass)($modal, 'hideSweetAlert'); window.previousActiveElement = document.activeElement; var $okButton = $modal.querySelector('button.confirm'); $okButton.focus(); setTimeout(function () { (0, _handleDom.addClass)($modal, 'visible'); }, 500); var timer = $modal.getAttribute('data-timer'); if (timer !== 'null' && timer !== '') { var timerCallback = callback; $modal.timeout = setTimeout(function () { var doneFunctionExists = (timerCallback || null) && $modal.getAttribute('data-has-done-function') === 'true'; if (doneFunctionExists) { timerCallback(null); } else { sweetAlert.close(); } }, timer); } }; /* * Reset the styling of the input * (for example if errors have been shown) */ var resetInput = function resetInput() { var $modal = getModal(); var $input = getInput(); (0, _handleDom.removeClass)($modal, 'show-input'); $input.value = _defaultParams2['default'].inputValue; $input.setAttribute('type', _defaultParams2['default'].inputType); $input.setAttribute('placeholder', _defaultParams2['default'].inputPlaceholder); resetInputError(); }; var resetInputError = function resetInputError(event) { // If press enter => ignore if (event && event.keyCode === 13) { return false; } var $modal = getModal(); var $errorIcon = $modal.querySelector('.sa-input-error'); (0, _handleDom.removeClass)($errorIcon, 'show'); var $errorContainer = $modal.querySelector('.sa-error-container'); (0, _handleDom.removeClass)($errorContainer, 'show'); }; /* * Set "margin-top"-property on modal based on its computed height */ var fixVerticalPosition = function fixVerticalPosition() { var $modal = getModal(); $modal.style.marginTop = (0, _handleDom.getTopMargin)(getModal()); }; exports.sweetAlertInitialize = sweetAlertInitialize; exports.getModal = getModal; exports.getOverlay = getOverlay; exports.getInput = getInput; exports.setFocusStyle = setFocusStyle; exports.openModal = openModal; exports.resetInput = resetInput; exports.resetInputError = resetInputError; exports.fixVerticalPosition = fixVerticalPosition; },{"./default-params":2,"./handle-dom":4,"./injected-html":7,"./utils":9}],7:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var injectedHTML = // Dark overlay "
" + // Modal "
" + // Error icon "
\n \n \n \n \n
" + // Warning icon "
\n \n \n
" + // Info icon "
" + // Success icon "
\n \n \n\n
\n
\n
" + "
" + // Title, text and input "

Title

\n

Text

\n
\n \n
\n
" + // Input errors "
\n
!
\n

Not valid!

\n
" + // Cancel and confirm buttons "
\n \n
\n " + // Loading animation "
\n
\n
\n
\n
\n
\n
" + // End of modal "
"; exports["default"] = injectedHTML; module.exports = exports["default"]; },{}],8:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _utils = require('./utils'); var _handleSwalDom = require('./handle-swal-dom'); var _handleDom = require('./handle-dom'); /* * Set type, text and actions on modal */ var alertTypes = ['error', 'warning', 'info', 'success', 'input', 'prompt']; var setParameters = function setParameters(params) { var modal = (0, _handleSwalDom.getModal)(); var $title = modal.querySelector('h2'); var $text = modal.querySelector('p'); var $cancelBtn = modal.querySelector('button.cancel'); var $confirmBtn = modal.querySelector('button.confirm'); /* * Title */ $title.innerHTML = params.html ? params.title : (0, _handleDom.escapeHtml)(params.title).split('\n').join('
'); /* * Text */ $text.innerHTML = params.html ? params.text : (0, _handleDom.escapeHtml)(params.text || '').split('\n').join('
'); if (params.text) (0, _handleDom.show)($text); /* * Custom class */ if (params.customClass) { (0, _handleDom.addClass)(modal, params.customClass); modal.setAttribute('data-custom-class', params.customClass); } else { // Find previously set classes and remove them var customClass = modal.getAttribute('data-custom-class'); (0, _handleDom.removeClass)(modal, customClass); modal.setAttribute('data-custom-class', ''); } /* * Icon */ (0, _handleDom.hide)(modal.querySelectorAll('.sa-icon')); if (params.type && !(0, _utils.isIE8)()) { var _ret = (function () { var validType = false; for (var i = 0; i < alertTypes.length; i++) { if (params.type === alertTypes[i]) { validType = true; break; } } if (!validType) { logStr('Unknown alert type: ' + params.type); return { v: false }; } var typesWithIcons = ['success', 'error', 'warning', 'info']; var $icon = undefined; if (typesWithIcons.indexOf(params.type) !== -1) { $icon = modal.querySelector('.sa-icon.' + 'sa-' + params.type); (0, _handleDom.show)($icon); } var $input = (0, _handleSwalDom.getInput)(); // Animate icon switch (params.type) { case 'success': (0, _handleDom.addClass)($icon, 'animate'); (0, _handleDom.addClass)($icon.querySelector('.sa-tip'), 'animateSuccessTip'); (0, _handleDom.addClass)($icon.querySelector('.sa-long'), 'animateSuccessLong'); break; case 'error': (0, _handleDom.addClass)($icon, 'animateErrorIcon'); (0, _handleDom.addClass)($icon.querySelector('.sa-x-mark'), 'animateXMark'); break; case 'warning': (0, _handleDom.addClass)($icon, 'pulseWarning'); (0, _handleDom.addClass)($icon.querySelector('.sa-body'), 'pulseWarningIns'); (0, _handleDom.addClass)($icon.querySelector('.sa-dot'), 'pulseWarningIns'); break; case 'input': case 'prompt': $input.setAttribute('type', params.inputType); $input.value = params.inputValue; $input.setAttribute('placeholder', params.inputPlaceholder); (0, _handleDom.addClass)(modal, 'show-input'); setTimeout(function () { $input.focus(); $input.addEventListener('keyup', swal.resetInputError); }, 400); break; } })(); if (typeof _ret === 'object') return _ret.v; } /* * Custom image */ if (params.imageUrl) { var $customIcon = modal.querySelector('.sa-icon.sa-custom'); $customIcon.style.backgroundImage = 'url(' + params.imageUrl + ')'; (0, _handleDom.show)($customIcon); var _imgWidth = 80; var _imgHeight = 80; if (params.imageSize) { var dimensions = params.imageSize.toString().split('x'); var imgWidth = dimensions[0]; var imgHeight = dimensions[1]; if (!imgWidth || !imgHeight) { logStr('Parameter imageSize expects value with format WIDTHxHEIGHT, got ' + params.imageSize); } else { _imgWidth = imgWidth; _imgHeight = imgHeight; } } $customIcon.setAttribute('style', $customIcon.getAttribute('style') + 'width:' + _imgWidth + 'px; height:' + _imgHeight + 'px'); } /* * Show cancel button? */ modal.setAttribute('data-has-cancel-button', params.showCancelButton); if (params.showCancelButton) { $cancelBtn.style.display = 'inline-block'; } else { (0, _handleDom.hide)($cancelBtn); } /* * Show confirm button? */ modal.setAttribute('data-has-confirm-button', params.showConfirmButton); if (params.showConfirmButton) { $confirmBtn.style.display = 'inline-block'; } else { (0, _handleDom.hide)($confirmBtn); } /* * Custom text on cancel/confirm buttons */ if (params.cancelButtonText) { $cancelBtn.innerHTML = (0, _handleDom.escapeHtml)(params.cancelButtonText); } if (params.confirmButtonText) { $confirmBtn.innerHTML = (0, _handleDom.escapeHtml)(params.confirmButtonText); } /* * Custom color on confirm button */ if (params.confirmButtonColor) { // Set confirm button to selected background color $confirmBtn.style.backgroundColor = params.confirmButtonColor; // Set the confirm button color to the loading ring $confirmBtn.style.borderLeftColor = params.confirmLoadingButtonColor; $confirmBtn.style.borderRightColor = params.confirmLoadingButtonColor; // Set box-shadow to default focused button (0, _handleSwalDom.setFocusStyle)($confirmBtn, params.confirmButtonColor); } /* * Allow outside click */ modal.setAttribute('data-allow-outside-click', params.allowOutsideClick); /* * Callback function */ var hasDoneFunction = params.doneFunction ? true : false; modal.setAttribute('data-has-done-function', hasDoneFunction); /* * Animation */ if (!params.animation) { modal.setAttribute('data-animation', 'none'); } else if (typeof params.animation === 'string') { modal.setAttribute('data-animation', params.animation); // Custom animation } else { modal.setAttribute('data-animation', 'pop'); } /* * Timer */ modal.setAttribute('data-timer', params.timer); }; exports['default'] = setParameters; module.exports = exports['default']; },{"./handle-dom":4,"./handle-swal-dom":6,"./utils":9}],9:[function(require,module,exports){ /* * Allow user to pass their own params */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var extend = function extend(a, b) { for (var key in b) { if (b.hasOwnProperty(key)) { a[key] = b[key]; } } return a; }; /* * Convert HEX codes to RGB values (#000000 -> rgb(0,0,0)) */ var hexToRgb = function hexToRgb(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? parseInt(result[1], 16) + ', ' + parseInt(result[2], 16) + ', ' + parseInt(result[3], 16) : null; }; /* * Check if the user is using Internet Explorer 8 (for fallbacks) */ var isIE8 = function isIE8() { return window.attachEvent && !window.addEventListener; }; /* * IE compatible logging for developers */ var logStr = function logStr(string) { if (typeof window !== 'undefined' && window.console) { // IE... window.console.log('SweetAlert: ' + string); } }; /* * Set hover, active and focus-states for buttons * (source: http://www.sitepoint.com/javascript-generate-lighter-darker-color) */ var colorLuminance = function colorLuminance(hex, lum) { // Validate hex string hex = String(hex).replace(/[^0-9a-f]/gi, ''); if (hex.length < 6) { hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; } lum = lum || 0; // Convert to decimal and change luminosity var rgb = '#'; var c; var i; for (i = 0; i < 3; i++) { c = parseInt(hex.substr(i * 2, 2), 16); c = Math.round(Math.min(Math.max(0, c + c * lum), 255)).toString(16); rgb += ('00' + c).substr(c.length); } return rgb; }; exports.extend = extend; exports.hexToRgb = hexToRgb; exports.isIE8 = isIE8; exports.logStr = logStr; exports.colorLuminance = colorLuminance; },{}]},{},[1]) //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCIvVXNlcnMvemh1c2hpeWEvUHJvamVjdHMvbm9kZS9zd2VldGFsZXJ0L2Rldi9zd2VldGFsZXJ0LmVzNi5qcyIsIi9Vc2Vycy96aHVzaGl5YS9Qcm9qZWN0cy9ub2RlL3N3ZWV0YWxlcnQvZGV2L21vZHVsZXMvZGVmYXVsdC1wYXJhbXMuanMiLCIvVXNlcnMvemh1c2hpeWEvUHJvamVjdHMvbm9kZS9zd2VldGFsZXJ0L2Rldi9tb2R1bGVzL2hhbmRsZS1jbGljay5qcyIsIi9Vc2Vycy96aHVzaGl5YS9Qcm9qZWN0cy9ub2RlL3N3ZWV0YWxlcnQvZGV2L21vZHVsZXMvaGFuZGxlLWRvbS5qcyIsIi9Vc2Vycy96aHVzaGl5YS9Qcm9q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yaXB0LWdlbmVyYXRlLWxpZ2h0ZXItZGFya2VyLWNvbG9yKVxuICovXG52YXIgY29sb3JMdW1pbmFuY2UgPSBmdW5jdGlvbihoZXgsIGx1bSkge1xuICAvLyBWYWxpZGF0ZSBoZXggc3RyaW5nXG4gIGhleCA9IFN0cmluZyhoZXgpLnJlcGxhY2UoL1teMC05YS1mXS9naSwgJycpO1xuICBpZiAoaGV4Lmxlbmd0aCA8IDYpIHtcbiAgICBoZXggPSBoZXhbMF0gKyBoZXhbMF0gKyBoZXhbMV0gKyBoZXhbMV0gKyBoZXhbMl0gKyBoZXhbMl07XG4gIH1cbiAgbHVtID0gbHVtIHx8IDA7XG5cbiAgLy8gQ29udmVydCB0byBkZWNpbWFsIGFuZCBjaGFuZ2UgbHVtaW5vc2l0eVxuICB2YXIgcmdiID0gJyMnO1xuICB2YXIgYztcbiAgdmFyIGk7XG5cbiAgZm9yIChpID0gMDsgaSA8IDM7IGkrKykge1xuICAgIGMgPSBwYXJzZUludChoZXguc3Vic3RyKGkgKiAyLCAyKSwgMTYpO1xuICAgIGMgPSBNYXRoLnJvdW5kKE1hdGgubWluKE1hdGgubWF4KDAsIGMgKyBjICogbHVtKSwgMjU1KSkudG9TdHJpbmcoMTYpO1xuICAgIHJnYiArPSAoJzAwJyArIGMpLnN1YnN0cihjLmxlbmd0aCk7XG4gIH1cblxuICByZXR1cm4gcmdiO1xufTtcblxuXG5leHBvcnQge1xuICBleHRlbmQsXG4gIGhleFRvUmdiLFxuICBpc0lFOCxcbiAgbG9nU3RyLFxuICBjb2xvckx1bWluYW5jZVxufTtcbiJdfQ== /* * Use SweetAlert with RequireJS */ if (typeof define === 'function' && define.amd) { define(function () { return sweetAlert; }); } else if (typeof module !== 'undefined' && module.exports) { module.exports = sweetAlert; } })(window, document);