; (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 < r.length; o++) s(r[o]); return s })({ 1: [ function(require, module, exports) { 'use strict'; var _interoprequirewildcard = function(obj) { return obj && obj.__esmodule ? obj : { 'default': obj } }; object.defineproperty(exports, '__esmodule', { value: true }); var _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation = require('./modules/handle-dom'); var _extend$hextorgb$isie8$logstr$colorluminance = require('./modules/utils'); var _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition = require('./modules/handle-swal-dom'); var _handlebutton$handleconfirm$handlecancel = require('./modules/handle-click'); var _handlekeydown = require('./modules/handle-key'); var _handlekeydown2 = _interoprequirewildcard(_handlekeydown); var _defaultparams = require('./modules/default-params'); var _defaultparams2 = _interoprequirewildcard(_defaultparams); var _setparameters = require('./modules/set-params'); var _setparameters2 = _interoprequirewildcard(_setparameters); var previouswindowkeydown; var lastfocusedbutton; var sweetalert, swal; exports['default'] = sweetalert = swal = function() { var customizations = arguments[0]; _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.addclass(document.body, 'stop-scrolling'); _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.resetinput(); function argumentordefault(key) { var args = customizations; return args[key] === undefined ? _defaultparams2['default'][key] : args[key] } if (customizations === undefined) { _extend$hextorgb$isie8$logstr$colorluminance.logstr('sweetalert expects at least 1 attribute!'); return false } var params = _extend$hextorgb$isie8$logstr$colorluminance.extend({}, _defaultparams2['default']); switch (typeof customizations) { case 'string': params.title = customizations; params.text = arguments[1] || ''; params.type = arguments[2] || ''; break; case 'object': if (customizations.title === undefined) { _extend$hextorgb$isie8$logstr$colorluminance.logstr('missing "title" argument!'); return false } params.title = customizations.title; for (var customname in _defaultparams2['default']) { params[customname] = argumentordefault(customname) } params.confirmbuttontext = params.showcancelbutton ? 'confirm' : _defaultparams2['default'].confirmbuttontext; params.confirmbuttontext = argumentordefault('confirmbuttontext'); params.donefunction = arguments[1] || null; break; default: _extend$hextorgb$isie8$logstr$colorluminance.logstr('unexpected type of argument! expected "string" or "object", got ' + typeof customizations); return false } _setparameters2['default'](params); _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.fixverticalposition(); _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.openmodal(arguments[1]); var modal = _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.getmodal(); var $buttons = modal.queryselectorall('button'); var buttonevents = ['onclick', 'onmouseover', 'onmouseout', 'onmousedown', 'onmouseup', 'onfocus']; var onbuttonevent = function onbuttonevent(e) { return _handlebutton$handleconfirm$handlecancel.handlebutton(e, params, modal) }; for (var btnindex = 0; btnindex < $buttons.length; btnindex++) { for (var evtindex = 0; evtindex < buttonevents.length; evtindex++) { var btnevt = buttonevents[evtindex]; $buttons[btnindex][btnevt] = onbuttonevent } } _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.getoverlay().onclick = onbuttonevent; previouswindowkeydown = window.onkeydown; var onkeyevent = function onkeyevent(e) { return _handlekeydown2['default'](e, params, modal) }; window.onkeydown = onkeyevent; window.onfocus = function() { settimeout(function() { if (lastfocusedbutton !== undefined) { lastfocusedbutton.focus(); lastfocusedbutton = undefined } }, 0) }; swal.enablebuttons() }; sweetalert.setdefaults = swal.setdefaults = function(userparams) { if (!userparams) { throw new error('userparams is required'); } if (typeof userparams !== 'object') { throw new error('userparams has to be a object'); } _extend$hextorgb$isie8$logstr$colorluminance.extend(_defaultparams2['default'], userparams) }; sweetalert.close = swal.close = function() { var modal = _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.getmodal(); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.fadeout(_sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.getoverlay(), 5); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.fadeout(modal, 5); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass(modal, 'showsweetalert'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.addclass(modal, 'hidesweetalert'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass(modal, 'visible'); var $successicon = modal.queryselector('.sa-icon.sa-success'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass($successicon, 'animate'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass($successicon.queryselector('.sa-tip'), 'animatesuccesstip'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass($successicon.queryselector('.sa-long'), 'animatesuccesslong'); var $erroricon = modal.queryselector('.sa-icon.sa-error'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass($erroricon, 'animateerroricon'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass($erroricon.queryselector('.sa-x-mark'), 'animatexmark'); var $warningicon = modal.queryselector('.sa-icon.sa-warning'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass($warningicon, 'pulsewarning'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass($warningicon.queryselector('.sa-body'), 'pulsewarningins'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass($warningicon.queryselector('.sa-dot'), 'pulsewarningins'); settimeout(function() { var customclass = modal.getattribute('data-custom-class'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass(modal, customclass) }, 300); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass(document.body, 'stop-scrolling'); window.onkeydown = previouswindowkeydown; if (window.previousactiveelement) { window.previousactiveelement.focus() } lastfocusedbutton = undefined; cleartimeout(modal.timeout); return true }; sweetalert.showinputerror = swal.showinputerror = function(errormessage) { var modal = _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.getmodal(); var $erroricon = modal.queryselector('.sa-input-error'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.addclass($erroricon, 'show'); var $errorcontainer = modal.queryselector('.sa-error-container'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.addclass($errorcontainer, 'show'); $errorcontainer.queryselector('p').innerhtml = errormessage; settimeout(function() { sweetalert.enablebuttons() }, 1); modal.queryselector('input').focus() }; sweetalert.resetinputerror = swal.resetinputerror = function(event) { if (event && event.keycode === 13) { return false } var $modal = _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.getmodal(); var $erroricon = $modal.queryselector('.sa-input-error'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass($erroricon, 'show'); var $errorcontainer = $modal.queryselector('.sa-error-container'); _hasclass$addclass$removeclass$escapehtml$_show$show$_hide$hide$isdescendant$gettopmargin$fadein$fadeout$fireclick$stopeventpropagation.removeclass($errorcontainer, 'show') }; sweetalert.disablebuttons = swal.disablebuttons = function(event) { var modal = _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.getmodal(); var $confirmbutton = modal.queryselector('button.confirm'); var $cancelbutton = modal.queryselector('button.cancel'); $confirmbutton.disabled = true; $cancelbutton.disabled = true }; sweetalert.enablebuttons = swal.enablebuttons = function(event) { var modal = _sweetalertinitialize$getmodal$getoverlay$getinput$setfocusstyle$openmodal$resetinput$fixverticalposition.getmodal(); var $confirmbutton = modal.queryselector('button.confirm'); var $cancelbutton = modal.queryselector('button.cancel'); $confirmbutton.disabled = false; $cancelbutton.disabled = false }; if (typeof window !== 'undefined') { window.sweetalert = window.swal = sweetalert } else { _extend$hextorgb$isie8$logstr$colorluminance.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 _colorluminance = require('./utils'); var _getmodal = require('./handle-swal-dom'); var _hasclass$isdescendant = require('./handle-dom'); 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 = _hasclass$isdescendant.hasclass(modal, 'visible'); var donefunctionexists = params.donefunction && modal.getattribute('data-has-done-function') === 'true'; var normalcolor, hovercolor, activecolor; if (targetedconfirm && params.confirmbuttoncolor) { normalcolor = params.confirmbuttoncolor; hovercolor = _colorluminance.colorluminance(normalcolor, -0.04); activecolor = _colorluminance.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 = _hasclass$isdescendant.isdescendant(modal, target); if (!clickedonmodal && !clickedonmodalchild && modalisvisible && !params.allowoutsideclick) { break } if (targetedconfirm && donefunctionexists && modalisvisible) { handleconfirm(modal, params) } else if (donefunctionexists && modalisvisible || targetedoverlay) { handlecancel(modal, params) } else if (_hasclass$isdescendant.isdescendant(modal, target) && target.tagname === 'button') { sweetalert.close() } break } }; var handleconfirm = function handleconfirm(modal, params) { var callbackvalue = true; if (_hasclass$isdescendant.hasclass(modal, 'show-input')) { callbackvalue = modal.queryselector('input').value; if (!callbackvalue) { callbackvalue = '' } } params.donefunction(callbackvalue); if (params.closeonconfirm) { sweetalert.close() } if (params.showloaderonconfirm) { sweetalert.disablebuttons() } }; var handlecancel = function handlecancel(modal, params) { 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') { 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) { function tick() { return _tick.apply(this, arguments) } tick.tostring = function() { return _tick.tostring() }; return tick })(function() { 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' }; var fadeout = function fadeout(elem, interval) { interval = interval || 16; elem.style.opacity = 1; var last = +new date(); var tick = (function(_tick2) { function tick() { return _tick2.apply(this, arguments) } tick.tostring = function() { return _tick2.tostring() }; return tick })(function() { 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) { if (typeof mouseevent === 'function') { var mevt = new mouseevent('click', { view: window, bubbles: false, cancelable: true }); node.dispatchevent(mevt) } else if (document.createevent) { 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) { 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 _stopeventpropagation$fireclick = require('./handle-dom'); var _setfocusstyle = 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) { return } var $targetelement = e.target || e.srcelement; var btnindex = -1; for (var i = 0; i < $modalbuttons.length; i++) { if ($targetelement === $modalbuttons[i]) { btnindex = i; break } } if (keycode === 9) { if (btnindex === -1) { $targetelement = $okbutton } else { if (btnindex === $modalbuttons.length - 1) { $targetelement = $modalbuttons[0] } else { $targetelement = $modalbuttons[btnindex + 1] } } _stopeventpropagation$fireclick.stopeventpropagation(e); $targetelement.focus(); if (params.confirmbuttoncolor) { _setfocusstyle.setfocusstyle($targetelement, params.confirmbuttoncolor) } } else { if (keycode === 13) { if ($targetelement.tagname === 'input') { $targetelement = $okbutton; $okbutton.focus() } if (btnindex === -1) { $targetelement = $okbutton } else { $targetelement = undefined } } else if (keycode === 27 && params.allowescapekey === true) { $targetelement = $cancelbutton; _stopeventpropagation$fireclick.fireclick($targetelement, e) } else { $targetelement = undefined } } }; exports['default'] = handlekeydown; module.exports = exports['default'] }, { "./handle-dom": 4, "./handle-swal-dom": 6 } ], 6: [ function(require, module, exports) { 'use strict'; var _interoprequirewildcard = function(obj) { return obj && obj.__esmodule ? obj : { 'default': obj } }; object.defineproperty(exports, '__esmodule', { value: true }); var _hextorgb = require('./utils'); var _removeclass$gettopmargin$fadein$show$addclass = require('./handle-dom'); var _defaultparams = require('./default-params'); var _defaultparams2 = _interoprequirewildcard(_defaultparams); var _injectedhtml = require('./injected-html'); var _injectedhtml2 = _interoprequirewildcard(_injectedhtml); var modalclass = '.sweet-alert'; var overlayclass = '.sweet-overlay'; var sweetalertinitialize = function sweetalertinitialize() { var sweetwrap = document.createelement('div'); sweetwrap.innerhtml = _injectedhtml2['default']; while (sweetwrap.firstchild) { document.body.appendchild(sweetwrap.firstchild) } }; var getmodal = (function(_getmodal) { function getmodal() { return _getmodal.apply(this, arguments) } getmodal.tostring = function() { return _getmodal.tostring() }; return getmodal })(function() { var $modal = document.queryselector(modalclass); if (!$modal) { sweetalertinitialize(); $modal = getmodal() } return $modal }); var getinput = function getinput() { var $modal = getmodal(); if ($modal) { return $modal.queryselector('input') } }; var getoverlay = function getoverlay() { return document.queryselector(overlayclass) }; var setfocusstyle = function setfocusstyle($button, bgcolor) { var rgbcolor = _hextorgb.hextorgb(bgcolor); $button.style.boxshadow = '0 0 2px rgba(' + rgbcolor + ', 0.8), inset 0 0 0 1px rgba(0, 0, 0, 0.05)' }; var openmodal = function openmodal(callback) { var $modal = getmodal(); _removeclass$gettopmargin$fadein$show$addclass.fadein(getoverlay(), 10); _removeclass$gettopmargin$fadein$show$addclass.show($modal); _removeclass$gettopmargin$fadein$show$addclass.addclass($modal, 'showsweetalert'); _removeclass$gettopmargin$fadein$show$addclass.removeclass($modal, 'hidesweetalert'); window.previousactiveelement = document.activeelement; var $okbutton = $modal.queryselector('button.confirm'); $okbutton.focus(); settimeout(function() { _removeclass$gettopmargin$fadein$show$addclass.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) } }; var resetinput = function resetinput() { var $modal = getmodal(); var $input = getinput(); _removeclass$gettopmargin$fadein$show$addclass.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 (event && event.keycode === 13) { return false } var $modal = getmodal(); var $erroricon = $modal.queryselector('.sa-input-error'); _removeclass$gettopmargin$fadein$show$addclass.removeclass($erroricon, 'show'); var $errorcontainer = $modal.queryselector('.sa-error-container'); _removeclass$gettopmargin$fadein$show$addclass.removeclass($errorcontainer, 'show') }; var fixverticalposition = function fixverticalposition() { var $modal = getmodal(); $modal.style.margintop = _removeclass$gettopmargin$fadein$show$addclass.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 = "
text
\nnot valid!
\n