!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Sweetalert2=t()}(this,function(){"use strict";var e={title:"",titleText:"",text:"",html:"",type:null,toast:!1,customClass:"",target:"body",backdrop:!0,animation:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:"#3085d6",confirmButtonClass:null,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:"#aaa",cancelButtonClass:null,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageAlt:"",imageClass:null,timer:null,width:500,padding:20,background:"#fff",input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:null,inputAttributes:{},inputValidator:null,grow:!1,position:"center",progressSteps:[],currentProgressStep:null,progressStepsDistance:"40px",onBeforeOpen:null,onOpen:null,onClose:null,useRejections:!1,expectRejections:!1},t=["useRejections","expectRejections"],n=function(e){var t={};for(var n in e)t[e[n]]="swal2-"+e[n];return t},o=n(["container","shown","iosfix","popup","modal","no-backdrop","toast","toast-shown","overlay","fade","show","hide","noanimation","close","title","header","content","actions","confirm","cancel","icon","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"]),i=n(["success","warning","info","question","error"]),r="SweetAlert2:",a=function(e,t){(e=String(e).replace(/[^0-9a-f]/gi,"")).length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;for(var n="#",o=0;o<3;o++){var i=parseInt(e.substr(2*o,2),16);n+=("00"+(i=Math.round(Math.min(Math.max(0,i+i*t),255)).toString(16))).substr(i.length)}return n},s=function(e){console.warn(r+" "+e)},l=function(e){console.error(r+" "+e)},u=[],c=function(e){-1===u.indexOf(e)&&(u.push(e),s(e))},d=function(e){return"function"==typeof e?e():e},p={previousActiveElement:null,previousBodyPadding:null},f=function(){return"undefined"==typeof window||"undefined"==typeof document},m=function(e){var t=v();t&&(t.parentNode.removeChild(t),j([document.documentElement,document.body],[o["no-backdrop"],o["has-input"],o["toast-shown"]]));{if(!f()){var n=document.createElement("div");n.className=o.container,n.innerHTML=b;("string"==typeof e.target?document.querySelector(e.target):e.target).appendChild(n);var i=g(),r=w(),a=N(r,o.input),s=N(r,o.file),u=r.querySelector("."+o.range+" input"),c=r.querySelector("."+o.range+" output"),d=N(r,o.select),p=r.querySelector("."+o.checkbox+" input"),m=N(r,o.textarea);i.setAttribute("aria-live",e.toast?"polite":"assertive");var h=function(){J.isVisible()&&J.resetValidationError()};return a.oninput=h,s.onchange=h,d.onchange=h,p.onchange=h,m.oninput=h,u.oninput=function(){h(),c.value=u.value},u.onchange=function(){h(),u.previousSibling.value=u.value},i}l("SweetAlert2 requires document to initialize")}},b=('\n \n').replace(/(^|\n)\s*/g,""),v=function(){return document.body.querySelector("."+o.container)},g=function(){return v()?v().querySelector("."+o.popup):null},h=function(e){return v()?v().querySelector("."+e):null},y=function(){return h(o.title)},w=function(){return h(o.content)},C=function(){return h(o.image)},x=function(){return h(o.progresssteps)},k=function(){return h(o.validationerror)},S=function(){return h(o.confirm)},A=function(){return h(o.cancel)},B=function(){return h(o.actions)},P=function(){return h(o.close)},E=function(){var e=Array.prototype.slice.call(g().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(function(e,t){return e=parseInt(e.getAttribute("tabindex")),t=parseInt(t.getAttribute("tabindex")),e>t?1:e"),t.backdrop||V([document.documentElement,document.body],o["no-backdrop"]),t.text||t.html){if("object"===D(t.html))if(h.innerHTML="",0 in t.html)for(var q=0;q in t.html;q++)h.appendChild(t.html[q].cloneNode(!0));else h.appendChild(t.html.cloneNode(!0));else t.html?h.innerHTML=t.html:t.text&&(h.textContent=t.text);M(h)}else H(h);if(t.position in o&&V(f,o[t.position]),t.grow&&"string"==typeof t.grow){var O="grow-"+t.grow;O in o&&V(f,o[O])}t.showCloseButton?(T.setAttribute("aria-label",t.closeButtonAriaLabel),M(T)):H(T),n.className=o.popup,t.toast?(V([document.documentElement,document.body],o["toast-shown"]),V(n,o.toast)):V(n,o.modal),t.customClass&&V(n,t.customClass);var N=x(),R=parseInt(null===t.currentProgressStep?J.getQueueStep():t.currentProgressStep,10);t.progressSteps.length?(M(N),function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}(N),R>=t.progressSteps.length&&s("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach(function(e,n){var i=document.createElement("li");if(V(i,o.progresscircle),i.innerHTML=e,n===R&&V(i,o.activeprogressstep),N.appendChild(i),n!==t.progressSteps.length-1){var r=document.createElement("li");V(r,o.progressline),r.style.width=t.progressStepsDistance,N.appendChild(r)}})):H(N);for(var I=g().querySelectorAll("."+o.icon),U=0;Uwindow.innerHeight&&(p.previousBodyPadding=document.body.style.paddingRight,document.body.style.paddingRight=function(){if("ontouchstart"in window||navigator.msMaxTouchPoints)return 0;var e=document.createElement("div");e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e);var t=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),t}()+"px")},$=function(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&!T(document.body,o.iosfix)){var e=document.body.scrollTop;document.body.style.top=-1*e+"px",V(document.body,o.iosfix)}},J=function e(){for(var t=arguments.length,n=Array(t),i=0;i