sweetalert2 11.3.1 → 11.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Sweetalert2=t()}(this,function(){"use strict";const t="SweetAlert2:",o=e=>e.charAt(0).toUpperCase()+e.slice(1),a=e=>Array.prototype.slice.call(e),s=e=>{console.warn("".concat(t," ").concat("object"==typeof e?e.join(" "):e))},r=e=>{console.error("".concat(t," ").concat(e))},n=[],i=(e,t)=>{t='"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'),n.includes(t)||(n.push(t),s(t))},c=e=>"function"==typeof e?e():e,l=e=>e&&"function"==typeof e.toPromise,u=e=>l(e)?e.toPromise():Promise.resolve(e),d=e=>e&&Promise.resolve(e)===e,p={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},m=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],g={},h=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],f=e=>Object.prototype.hasOwnProperty.call(p,e);const b=e=>g[e],y=e=>{!e.backdrop&&e.allowOutsideClick&&s('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const o in e)n=o,f(n)||s('Unknown parameter "'.concat(n,'"')),e.toast&&(t=o,h.includes(t)&&s('The parameter "'.concat(t,'" is incompatible with toasts'))),t=o,b(t)&&i(t,b(t));var t,n};var e=e=>{const t={};for(const n in e)t[e[n]]="swal2-"+e[n];return t};const v=e(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),w=e(["success","warning","info","question","error"]),C=()=>document.body.querySelector(".".concat(v.container)),k=e=>{const t=C();return t?t.querySelector(e):null},A=e=>k(".".concat(e)),P=()=>A(v.popup),B=()=>A(v.icon),x=()=>A(v.title),E=()=>A(v["html-container"]),S=()=>A(v.image),T=()=>A(v["progress-steps"]),O=()=>A(v["validation-message"]),L=()=>k(".".concat(v.actions," .").concat(v.confirm)),j=()=>k(".".concat(v.actions," .").concat(v.deny));const D=()=>k(".".concat(v.loader)),M=()=>k(".".concat(v.actions," .").concat(v.cancel)),I=()=>A(v.actions),H=()=>A(v.footer),q=()=>A(v["timer-progress-bar"]),V=()=>A(v.close),N=()=>{const e=a(P().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((e,t)=>(e=parseInt(e.getAttribute("tabindex")),(t=parseInt(t.getAttribute("tabindex")))<e?1:e<t?-1:0));var t=a(P().querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n')).filter(e=>"-1"!==e.getAttribute("tabindex"));return(t=>{const n=[];for(let e=0;e<t.length;e++)-1===n.indexOf(t[e])&&n.push(t[e]);return n})(e.concat(t)).filter(e=>ie(e))},U=()=>!_(document.body,v["toast-shown"])&&!_(document.body,v["no-backdrop"]),F=()=>P()&&_(P(),v.toast);function R(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];const n=q();ie(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"},10))}const z={previousBodyPadding:null},W=(t,e)=>{if(t.textContent="",e){const n=new DOMParser,o=n.parseFromString(e,"text/html");a(o.querySelector("head").childNodes).forEach(e=>{t.appendChild(e)}),a(o.querySelector("body").childNodes).forEach(e=>{t.appendChild(e)})}},_=(t,e)=>{if(!e)return!1;var n=e.split(/\s+/);for(let e=0;e<n.length;e++)if(!t.classList.contains(n[e]))return!1;return!0},K=(e,t,n)=>{var o,i;if(o=e,i=t,a(o.classList).forEach(e=>{Object.values(v).includes(e)||Object.values(w).includes(e)||Object.values(i.showClass).includes(e)||o.classList.remove(e)}),t.customClass&&t.customClass[n]){if("string"!=typeof t.customClass[n]&&!t.customClass[n].forEach)return s("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(typeof t.customClass[n],'"'));X(e,t.customClass[n])}},Y=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return G(e,v[t]);case"checkbox":return e.querySelector(".".concat(v.checkbox," input"));case"radio":return e.querySelector(".".concat(v.radio," input:checked"))||e.querySelector(".".concat(v.radio," input:first-child"));case"range":return e.querySelector(".".concat(v.range," input"));default:return G(e,v.input)}},Z=e=>{var t;e.focus(),"file"!==e.type&&(t=e.value,e.value="",e.value=t)},J=(e,t,n)=>{e&&t&&(t="string"==typeof t?t.split(/\s+/).filter(Boolean):t).forEach(t=>{e.forEach?e.forEach(e=>{n?e.classList.add(t):e.classList.remove(t)}):n?e.classList.add(t):e.classList.remove(t)})},X=(e,t)=>{J(e,t,!0)},$=(e,t)=>{J(e,t,!1)},G=(t,n)=>{for(let e=0;e<t.childNodes.length;e++)if(_(t.childNodes[e],n))return t.childNodes[e]},Q=(e,t,n)=>{(n=n==="".concat(parseInt(n))?parseInt(n):n)||0===parseInt(n)?e.style[t]="number"==typeof n?"".concat(n,"px"):n:e.style.removeProperty(t)},ee=function(e){e.style.display=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"flex"},te=e=>{e.style.display="none"},ne=(e,t,n,o)=>{const i=e.querySelector(t);i&&(i.style[n]=o)},oe=(e,t,n)=>{t?ee(e,n):te(e)},ie=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),ae=()=>!ie(L())&&!ie(j())&&!ie(M()),se=e=>!!(e.scrollHeight>e.clientHeight),re=e=>{const t=window.getComputedStyle(e);var n=parseFloat(t.getPropertyValue("animation-duration")||"0"),e=parseFloat(t.getPropertyValue("transition-duration")||"0");return 0<n||0<e},ce=()=>"undefined"==typeof window||"undefined"==typeof document,le='\n <div aria-labelledby="'.concat(v.title,'" aria-describedby="').concat(v["html-container"],'" class="').concat(v.popup,'" tabindex="-1">\n <button type="button" class="').concat(v.close,'"></button>\n <ul class="').concat(v["progress-steps"],'"></ul>\n <div class="').concat(v.icon,'"></div>\n <img class="').concat(v.image,'" />\n <h2 class="').concat(v.title,'" id="').concat(v.title,'"></h2>\n <div class="').concat(v["html-container"],'" id="').concat(v["html-container"],'"></div>\n <input class="').concat(v.input,'" />\n <input type="file" class="').concat(v.file,'" />\n <div class="').concat(v.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(v.select,'"></select>\n <div class="').concat(v.radio,'"></div>\n <label for="').concat(v.checkbox,'" class="').concat(v.checkbox,'">\n <input type="checkbox" />\n <span class="').concat(v.label,'"></span>\n </label>\n <textarea class="').concat(v.textarea,'"></textarea>\n <div class="').concat(v["validation-message"],'" id="').concat(v["validation-message"],'"></div>\n <div class="').concat(v.actions,'">\n <div class="').concat(v.loader,'"></div>\n <button type="button" class="').concat(v.confirm,'"></button>\n <button type="button" class="').concat(v.deny,'"></button>\n <button type="button" class="').concat(v.cancel,'"></button>\n </div>\n <div class="').concat(v.footer,'"></div>\n <div class="').concat(v["timer-progress-bar-container"],'">\n <div class="').concat(v["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),ue=()=>{const e=C();return!!e&&(e.remove(),$([document.documentElement,document.body],[v["no-backdrop"],v["toast-shown"],v["has-column"]]),!0)},de=()=>{hn.isVisible()&&hn.resetValidationMessage()},pe=()=>{const e=P(),t=G(e,v.input),n=G(e,v.file),o=e.querySelector(".".concat(v.range," input")),i=e.querySelector(".".concat(v.range," output")),a=G(e,v.select),s=e.querySelector(".".concat(v.checkbox," input")),r=G(e,v.textarea);t.oninput=de,n.onchange=de,a.onchange=de,s.onchange=de,r.oninput=de,o.oninput=()=>{de(),i.value=o.value},o.onchange=()=>{de(),o.nextSibling.value=o.value}},me=e=>"string"==typeof e?document.querySelector(e):e,ge=e=>{const t=P();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},he=e=>{"rtl"===window.getComputedStyle(e).direction&&X(C(),v.rtl)},fe=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?((e,t)=>{if(e.jquery)be(t,e);else W(t,e.toString())})(e,t):e&&W(t,e)},be=(t,n)=>{if(t.textContent="",0 in n)for(let e=0;e in n;e++)t.appendChild(n[e].cloneNode(!0));else t.appendChild(n.cloneNode(!0))},ye=(()=>{if(ce())return!1;var e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),ve=(e,t)=>{var n,o,i,a,s,r=I(),c=D();(t.showConfirmButton||t.showDenyButton||t.showCancelButton?ee:te)(r),K(r,t,"actions"),n=r,o=c,i=t,a=L(),s=j(),r=M(),we(a,"confirm",i),we(s,"deny",i),we(r,"cancel",i),function(e,t,n,o){if(!o.buttonsStyling)return $([e,t,n],v.styled);X([e,t,n],v.styled),o.confirmButtonColor&&(e.style.backgroundColor=o.confirmButtonColor,X(e,v["default-outline"]));o.denyButtonColor&&(t.style.backgroundColor=o.denyButtonColor,X(t,v["default-outline"]));o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,X(n,v["default-outline"]))}(a,s,r,i),i.reverseButtons&&(i.toast?(n.insertBefore(r,a),n.insertBefore(s,a)):(n.insertBefore(r,o),n.insertBefore(s,o),n.insertBefore(a,o))),W(c,t.loaderHtml),K(c,t,"loader")};function we(e,t,n){oe(e,n["show".concat(o(t),"Button")],"inline-block"),W(e,n["".concat(t,"ButtonText")]),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]),e.className=v[t],K(e,n,"".concat(t,"Button")),X(e,n["".concat(t,"ButtonClass")])}const Ce=(e,t)=>{var n,o,i=C();i&&(o=i,"string"==typeof(n=t.backdrop)?o.style.background=n:n||X([document.documentElement,document.body],v["no-backdrop"]),o=i,(n=t.position)in v?X(o,v[n]):(s('The "position" parameter is not valid, defaulting to "center"'),X(o,v.center)),n=i,!(o=t.grow)||"string"!=typeof o||(o="grow-".concat(o))in v&&X(n,v[o]),K(i,t,"container"))};var ke={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const Ae=["input","file","range","select","radio","checkbox","textarea"],Pe=(e,o)=>{const i=P();e=ke.innerParams.get(e);const a=!e||o.input!==e.input;Ae.forEach(e=>{var t=v[e];const n=G(i,t);((e,t)=>{const n=Y(P(),e);if(n){Be(n);for(const o in t)n.setAttribute(o,t[o])}})(e,o.inputAttributes),n.className=t,a&&te(n)}),o.input&&(a&&(e=>{if(!Te[e.input])return r('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=Se(e.input),n=Te[e.input](t,e);ee(n),setTimeout(()=>{Z(n)})})(o),(e=>{const t=Se(e.input);if(e.customClass)X(t,e.customClass.input)})(o))},Be=t=>{for(let e=0;e<t.attributes.length;e++){var n=t.attributes[e].name;["type","value","style"].includes(n)||t.removeAttribute(n)}},xe=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},Ee=(e,t,n)=>{if(n.inputLabel){e.id=v.input;const i=document.createElement("label");var o=v["input-label"];i.setAttribute("for",e.id),i.className=o,X(i,n.customClass.inputLabel),i.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",i)}},Se=e=>{e=v[e]||v.input;return G(P(),e)},Te={};Te.text=Te.email=Te.password=Te.number=Te.tel=Te.url=(e,t)=>("string"==typeof t.inputValue||"number"==typeof t.inputValue?e.value=t.inputValue:d(t.inputValue)||s('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t.inputValue,'"')),Ee(e,e,t),xe(e,t),e.type=t.input,e),Te.file=(e,t)=>(Ee(e,e,t),xe(e,t),e),Te.range=(e,t)=>{const n=e.querySelector("input"),o=e.querySelector("output");return n.value=t.inputValue,n.type=t.input,o.value=t.inputValue,Ee(n,e,t),e},Te.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");W(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return Ee(e,e,t),e},Te.radio=e=>(e.textContent="",e),Te.checkbox=(e,t)=>{const n=Y(P(),"checkbox");n.value=1,n.id=v.checkbox,n.checked=Boolean(t.inputValue);var o=e.querySelector("span");return W(o,t.inputPlaceholder),e},Te.textarea=(n,e)=>{n.value=e.inputValue,xe(n,e),Ee(n,n,e);return setTimeout(()=>{if("MutationObserver"in window){const t=parseInt(window.getComputedStyle(P()).width);new MutationObserver(()=>{var e,e=n.offsetWidth+(e=n,parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight));e>t?P().style.width="".concat(e,"px"):P().style.width=null}).observe(n,{attributes:!0,attributeFilter:["style"]})}}),n};const Oe=(e,t)=>{const n=E();K(n,t,"htmlContainer"),t.html?(fe(t.html,n),ee(n,"block")):t.text?(n.textContent=t.text,ee(n,"block")):te(n),Pe(e,t)},Le=(e,t)=>{var n=H();oe(n,t.footer),t.footer&&fe(t.footer,n),K(n,t,"footer")},je=(e,t)=>{const n=V();W(n,t.closeButtonHtml),K(n,t,"closeButton"),oe(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)},De=(e,t)=>{var n=ke.innerParams.get(e),e=B();return n&&t.icon===n.icon?(He(e,t),void Me(e,t)):t.icon||t.iconHtml?t.icon&&-1===Object.keys(w).indexOf(t.icon)?(r('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),te(e)):(ee(e),He(e,t),Me(e,t),void X(e,t.showClass.icon)):te(e)},Me=(e,t)=>{for(const n in w)t.icon!==n&&$(e,w[n]);X(e,w[t.icon]),qe(e,t),Ie(),K(e,t,"icon")},Ie=()=>{const e=P();var t=window.getComputedStyle(e).getPropertyValue("background-color");const n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<n.length;e++)n[e].style.backgroundColor=t},He=(e,t)=>{var n;e.textContent="",t.iconHtml?W(e,Ve(t.iconHtml)):"success"===t.icon?W(e,'\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 '):"error"===t.icon?W(e,'\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n '):(n={question:"?",warning:"!",info:"i"},W(e,Ve(n[t.icon])))},qe=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])ne(e,n,"backgroundColor",t.iconColor);ne(e,".swal2-success-ring","borderColor",t.iconColor)}},Ve=e=>'<div class="'.concat(v["icon-content"],'">').concat(e,"</div>"),Ne=(e,t)=>{const n=S();if(!t.imageUrl)return te(n);ee(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),Q(n,"width",t.imageWidth),Q(n,"height",t.imageHeight),n.className=v.image,K(n,t,"image")},Ue=(e,o)=>{const i=T();if(!o.progressSteps||0===o.progressSteps.length)return te(i);ee(i),i.textContent="",o.currentProgressStep>=o.progressSteps.length&&s("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.progressSteps.forEach((e,t)=>{var n,e=(n=e,e=document.createElement("li"),X(e,v["progress-step"]),W(e,n),e);i.appendChild(e),t===o.currentProgressStep&&X(e,v["active-progress-step"]),t!==o.progressSteps.length-1&&(t=(e=>{const t=document.createElement("li");return X(t,v["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t})(o),i.appendChild(t))})},Fe=(e,t)=>{const n=x();oe(n,t.title||t.titleText,"block"),t.title&&fe(t.title,n),t.titleText&&(n.innerText=t.titleText),K(n,t,"title")},Re=(e,t)=>{var n=C();const o=P();t.toast?(Q(n,"width",t.width),o.style.width="100%",o.insertBefore(D(),B())):Q(o,"width",t.width),Q(o,"padding",t.padding),t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background),te(O()),((e,t)=>{if(e.className="".concat(v.popup," ").concat(ie(e)?t.showClass.popup:""),t.toast){X([document.documentElement,document.body],v["toast-shown"]);X(e,v.toast)}else X(e,v.modal);if(K(e,t,"popup"),typeof t.customClass==="string")X(e,t.customClass);if(t.icon)X(e,v["icon-".concat(t.icon)])})(o,t)},ze=(e,t)=>{Re(e,t),Ce(e,t),Ue(e,t),De(e,t),Ne(e,t),Fe(e,t),je(e,t),Oe(e,t),ve(e,t),Le(e,t),"function"==typeof t.didRender&&t.didRender(P())},We=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),_e=()=>{const e=a(document.body.children);e.forEach(e=>{e===C()||e.contains(C())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))})},Ke=()=>{const e=a(document.body.children);e.forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},Ye=["swal-title","swal-html","swal-footer"],Ze=e=>{const o={};return a(e.querySelectorAll("swal-param")).forEach(e=>{tt(e,["name","value"]);var t=e.getAttribute("name");let n=e.getAttribute("value");"boolean"==typeof p[t]&&"false"===n&&(n=!1),"object"==typeof p[t]&&(n=JSON.parse(n)),o[t]=n}),o},Je=e=>{const n={};return a(e.querySelectorAll("swal-button")).forEach(e=>{tt(e,["type","color","aria-label"]);var t=e.getAttribute("type");n["".concat(t,"ButtonText")]=e.innerHTML,n["show".concat(o(t),"Button")]=!0,e.hasAttribute("color")&&(n["".concat(t,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(n["".concat(t,"ButtonAriaLabel")]=e.getAttribute("aria-label"))}),n},Xe=e=>{const t={},n=e.querySelector("swal-image");return n&&(tt(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},$e=e=>{const t={},n=e.querySelector("swal-icon");return n&&(tt(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Ge=e=>{const n={},t=e.querySelector("swal-input");t&&(tt(t,["type","label","placeholder","value"]),n.input=t.getAttribute("type")||"text",t.hasAttribute("label")&&(n.inputLabel=t.getAttribute("label")),t.hasAttribute("placeholder")&&(n.inputPlaceholder=t.getAttribute("placeholder")),t.hasAttribute("value")&&(n.inputValue=t.getAttribute("value")));e=e.querySelectorAll("swal-input-option");return e.length&&(n.inputOptions={},a(e).forEach(e=>{tt(e,["value"]);var t=e.getAttribute("value"),e=e.innerHTML;n.inputOptions[t]=e})),n},Qe=(e,t)=>{const n={};for(const o in t){const i=t[o],a=e.querySelector(i);a&&(tt(a,[]),n[i.replace(/^swal-/,"")]=a.innerHTML.trim())}return n},et=e=>{const t=Ye.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);a(e.children).forEach(e=>{e=e.tagName.toLowerCase();-1===t.indexOf(e)&&s("Unrecognized element <".concat(e,">"))})},tt=(t,n)=>{a(t.attributes).forEach(e=>{-1===n.indexOf(e.name)&&s(['Unrecognized attribute "'.concat(e.name,'" on <').concat(t.tagName.toLowerCase(),">."),"".concat(n.length?"Allowed attributes are: ".concat(n.join(", ")):"To set the value, use HTML within the element.")])})};var nt={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function ot(e){var t,n;(t=e).inputValidator||Object.keys(nt).forEach(e=>{t.input===e&&(t.inputValidator=nt[e])}),e.showLoaderOnConfirm&&!e.preConfirm&&s("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),(n=e).target&&("string"!=typeof n.target||document.querySelector(n.target))&&("string"==typeof n.target||n.target.appendChild)||(s('Target parameter is not valid, defaulting to "body"'),n.target="body"),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),(e=>{var t=ue();if(ce())r("SweetAlert2 requires document to initialize");else{const n=document.createElement("div");n.className=v.container,t&&X(n,v["no-transition"]),W(n,le);const o=me(e.target);o.appendChild(n),ge(e),he(o),pe()}})(e)}class it{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date-this.started),this.remaining}increase(e){var t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const at=()=>{null===z.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(z.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(z.previousBodyPadding+(()=>{const e=document.createElement("div");e.className=v["scrollbar-measure"],document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})(),"px"))},st=()=>{null!==z.previousBodyPadding&&(document.body.style.paddingRight="".concat(z.previousBodyPadding,"px"),z.previousBodyPadding=null)},rt=()=>{var e;(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints)&&!_(document.body,v.iosfix)&&(e=document.body.scrollTop,document.body.style.top="".concat(-1*e,"px"),X(document.body,v.iosfix),(()=>{const e=C();let t;e.ontouchstart=e=>{t=ct(e)},e.ontouchmove=e=>{if(t){e.preventDefault();e.stopPropagation()}}})(),(()=>{const e=!navigator.userAgent.match(/(CriOS|FxiOS|EdgiOS|YaBrowser|UCBrowser)/i);if(e){const t=44;if(P().scrollHeight>window.innerHeight-t)C().style.paddingBottom="".concat(t,"px")}})())},ct=e=>{var t,n=e.target,o=C();return!((t=e).touches&&t.touches.length&&"stylus"===t.touches[0].touchType||(e=e).touches&&1<e.touches.length)&&(n===o||!(se(o)||"INPUT"===n.tagName||"TEXTAREA"===n.tagName||se(E())&&E().contains(n)))},lt=()=>{var e;_(document.body,v.iosfix)&&(e=parseInt(document.body.style.top,10),$(document.body,v.iosfix),document.body.style.top="",document.body.scrollTop=-1*e)},ut=100,dt={},pt=()=>{dt.previousActiveElement&&dt.previousActiveElement.focus?(dt.previousActiveElement.focus(),dt.previousActiveElement=null):document.body&&document.body.focus()},mt=o=>new Promise(e=>{if(!o)return e();var t=window.scrollX,n=window.scrollY;dt.restoreFocusTimeout=setTimeout(()=>{pt(),e()},ut),window.scrollTo(t,n)}),gt=10,ht=e=>{const t=P();if(e.target===t){const n=C();t.removeEventListener(ye,ht),n.style.overflowY="auto"}},ft=(e,t)=>{ye&&re(t)?(e.style.overflowY="hidden",t.addEventListener(ye,ht)):e.style.overflowY="auto"},bt=(e,t,n)=>{rt(),t&&"hidden"!==n&&at(),setTimeout(()=>{e.scrollTop=0})},yt=(e,t,n)=>{X(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),ee(t,"grid"),setTimeout(()=>{X(t,n.showClass.popup),t.style.removeProperty("opacity")},gt),X([document.documentElement,document.body],v.shown),n.heightAuto&&n.backdrop&&!n.toast&&X([document.documentElement,document.body],v["height-auto"])},vt=e=>{let t=P();t||hn.fire(),t=P();var n=D();F()?te(B()):((e,t)=>{const n=I(),o=D();if(!t&&ie(L()))t=L();if(ee(n),t){te(t);o.setAttribute("data-button-to-replace",t.className)}o.parentNode.insertBefore(o,t),X([e,n],v.loading)})(t,e),ee(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},wt=(t,n)=>{const o=P(),i=e=>kt[n.input](o,At(e),n);l(n.inputOptions)||d(n.inputOptions)?(vt(L()),u(n.inputOptions).then(e=>{t.hideLoading(),i(e)})):"object"==typeof n.inputOptions?i(n.inputOptions):r("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof n.inputOptions))},Ct=(t,n)=>{const o=t.getInput();te(o),u(n.inputValue).then(e=>{o.value="number"===n.input?parseFloat(e)||0:"".concat(e),ee(o),o.focus(),t.hideLoading()}).catch(e=>{r("Error in inputValue promise: ".concat(e)),o.value="",ee(o),o.focus(),t.hideLoading()})},kt={select:(e,t,i)=>{const a=G(e,v.select),s=(e,t,n)=>{const o=document.createElement("option");o.value=n,W(o,t),o.selected=Pt(n,i.inputValue),e.appendChild(o)};t.forEach(e=>{var t=e[0];const n=e[1];if(Array.isArray(n)){const o=document.createElement("optgroup");o.label=t,o.disabled=!1,a.appendChild(o),n.forEach(e=>s(o,e[1],e[0]))}else s(a,n,t)}),a.focus()},radio:(e,t,a)=>{const s=G(e,v.radio);t.forEach(e=>{var t=e[0],e=e[1];const n=document.createElement("input"),o=document.createElement("label");n.type="radio",n.name=v.radio,n.value=t,Pt(t,a.inputValue)&&(n.checked=!0);const i=document.createElement("span");W(i,e),i.className=v.label,o.appendChild(n),o.appendChild(i),s.appendChild(o)});const n=s.querySelectorAll("input");n.length&&n[0].focus()}},At=n=>{const o=[];return"undefined"!=typeof Map&&n instanceof Map?n.forEach((e,t)=>{let n=e;"object"==typeof n&&(n=At(n)),o.push([t,n])}):Object.keys(n).forEach(e=>{let t=n[e];"object"==typeof t&&(t=At(t)),o.push([e,t])}),o},Pt=(e,t)=>t&&t.toString()===e.toString(),Bt=(e,t)=>{var n=ke.innerParams.get(e),o=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return n.checked?1:0;case"radio":return(o=n).checked?o.value:null;case"file":return(o=n).files.length?null!==o.getAttribute("multiple")?o.files:o.files[0]:null;default:return t.inputAutoTrim?n.value.trim():n.value}var o})(e,n);n.inputValidator?((t,n,o)=>{const e=ke.innerParams.get(t);t.disableInput();const i=Promise.resolve().then(()=>u(e.inputValidator(n,e.validationMessage)));i.then(e=>{t.enableButtons();t.enableInput();if(e)t.showValidationMessage(e);else if(o==="deny")xt(t,n);else Tt(t,n)})})(e,o,t):e.getInput().checkValidity()?("deny"===t?xt:Tt)(e,o):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},xt=(t,n)=>{const e=ke.innerParams.get(t||void 0);if(e.showLoaderOnDeny&&vt(j()),e.preDeny){ke.awaitingPromise.set(t||void 0,!0);const o=Promise.resolve().then(()=>u(e.preDeny(n,e.validationMessage)));o.then(e=>{!1===e?t.hideLoading():t.closePopup({isDenied:!0,value:void 0===e?n:e})}).catch(e=>St(t||void 0,e))}else t.closePopup({isDenied:!0,value:n})},Et=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},St=(e,t)=>{e.rejectPromise(t)},Tt=(t,n)=>{const e=ke.innerParams.get(t||void 0);if(e.showLoaderOnConfirm&&vt(),e.preConfirm){t.resetValidationMessage(),ke.awaitingPromise.set(t||void 0,!0);const o=Promise.resolve().then(()=>u(e.preConfirm(n,e.validationMessage)));o.then(e=>{ie(O())||!1===e?t.hideLoading():Et(t,void 0===e?n:e)}).catch(e=>St(t||void 0,e))}else Et(t,n)},Ot=(t,e,n)=>{e.popup.onclick=()=>{var e=ke.innerParams.get(t);e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton||e.timer||e.input||n(We.close)}};let Lt=!1;const jt=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(Lt=!0)}}},Dt=t=>{t.container.onmousedown=()=>{t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,e.target!==t.popup&&!t.popup.contains(e.target)||(Lt=!0)}}},Mt=(n,o,i)=>{o.container.onclick=e=>{var t=ke.innerParams.get(n);Lt?Lt=!1:e.target===o.container&&c(t.allowOutsideClick)&&i(We.backdrop)}};const It=()=>L()&&L().click();const Ht=(e,t,n)=>{const o=N();if(o.length)return(t+=n)===o.length?t=0:-1===t&&(t=o.length-1),o[t].focus();P().focus()},qt=["ArrowRight","ArrowDown"],Vt=["ArrowLeft","ArrowUp"],Nt=(e,t,n)=>{var o,i,a=ke.innerParams.get(e);a&&(a.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?(o=e,i=a,(e=t).isComposing||e.target&&o.getInput()&&e.target.outerHTML===o.getInput().outerHTML&&(["textarea","file"].includes(i.input)||(It(),e.preventDefault()))):"Tab"===t.key?((e,t)=>{const n=e.target,o=N();let i=-1;for(let e=0;e<o.length;e++)if(n===o[e]){i=e;break}if(!e.shiftKey)Ht(t,i,1);else Ht(t,i,-1);e.stopPropagation(),e.preventDefault()})(t,a):[...qt,...Vt].includes(t.key)?(e=>{const t=L(),n=j(),o=M();if([t,n,o].includes(document.activeElement)){var i=qt.includes(e)?"nextElementSibling":"previousElementSibling";const a=document.activeElement[i];a&&a.focus()}})(t.key):"Escape"===t.key&&((e,t,n)=>{if(c(t.allowEscapeKey)){e.preventDefault();n(We.esc)}})(t,a,n))},Ut=e=>"object"==typeof e&&e.jquery,Ft=e=>e instanceof Element||Ut(e);const Rt=()=>{if(dt.timeout)return(()=>{const e=q();var t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";var n=parseInt(window.getComputedStyle(e).width),n=parseInt(t/n*100);e.style.removeProperty("transition"),e.style.width="".concat(n,"%")})(),dt.timeout.stop()},zt=()=>{if(dt.timeout){var e=dt.timeout.start();return R(e),e}};let Wt=!1;const _t={};const Kt=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const o in _t){var n=e.getAttribute(o);if(n)return void _t[o].fire({template:n})}};var Yt=Object.freeze({isValidParameter:f,isUpdatableParameter:e=>-1!==m.indexOf(e),isDeprecatedParameter:b,argsToParams:n=>{const o={};return"object"!=typeof n[0]||Ft(n[0])?["title","html","icon"].forEach((e,t)=>{t=n[t];"string"==typeof t||Ft(t)?o[e]=t:void 0!==t&&r("Unexpected type of ".concat(e,'! Expected "string" or "Element", got ').concat(typeof t))}):Object.assign(o,n[0]),o},isVisible:()=>ie(P()),clickConfirm:It,clickDeny:()=>j()&&j().click(),clickCancel:()=>M()&&M().click(),getContainer:C,getPopup:P,getTitle:x,getHtmlContainer:E,getImage:S,getIcon:B,getInputLabel:()=>A(v["input-label"]),getCloseButton:V,getActions:I,getConfirmButton:L,getDenyButton:j,getCancelButton:M,getLoader:D,getFooter:H,getTimerProgressBar:q,getFocusableElements:N,getValidationMessage:O,isLoading:()=>P().hasAttribute("data-loading"),fire:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new this(...t)},mixin:function(n){class e extends this{_main(e,t){return super._main(e,Object.assign({},n,t))}}return e},showLoading:vt,enableLoading:vt,getTimerLeft:()=>dt.timeout&&dt.timeout.getTimerLeft(),stopTimer:Rt,resumeTimer:zt,toggleTimer:()=>{var e=dt.timeout;return e&&(e.running?Rt:zt)()},increaseTimer:e=>{if(dt.timeout){e=dt.timeout.increase(e);return R(e,!0),e}},isTimerRunning:()=>dt.timeout&&dt.timeout.isRunning(),bindClickHandler:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"data-swal-template";_t[e]=this,Wt||(document.body.addEventListener("click",Kt),Wt=!0)}});function Zt(){var e=ke.innerParams.get(this);if(e){const t=ke.domCache.get(this);te(t.loader),F()?e.icon&&ee(B()):(e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));if(t.length)ee(t[0],"inline-block");else if(ae())te(e.actions)})(t),$([t.popup,t.actions],v.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}}var Jt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};function Xt(e,t,n,o){F()?en(e,o):(mt(n).then(()=>en(e,o)),dt.keydownTarget.removeEventListener("keydown",dt.keydownHandler,{capture:dt.keydownListenerCapture}),dt.keydownHandlerAdded=!1),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),U()&&(st(),lt(),Ke()),$([document.documentElement,document.body],[v.shown,v["height-auto"],v["no-backdrop"],v["toast-shown"]])}function $t(e){e=void 0!==(n=e)?Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},n):{isConfirmed:!1,isDenied:!1,isDismissed:!0};const t=Jt.swalPromiseResolve.get(this);var n=(e=>{const t=P();if(!t)return false;const n=ke.innerParams.get(e);if(!n||_(t,n.hideClass.popup))return false;$(t,n.showClass.popup),X(t,n.hideClass.popup);const o=C();return $(o,n.showClass.backdrop),X(o,n.hideClass.backdrop),Qt(e,t,n),true})(this);this.isAwaitingPromise()?e.isDismissed||(Gt(this),t(e)):n&&t(e)}const Gt=e=>{e.isAwaitingPromise()&&(ke.awaitingPromise.delete(e),ke.innerParams.get(e)||e._destroy())},Qt=(e,t,n)=>{var o,i,a,s=C(),r=ye&&re(t);"function"==typeof n.willClose&&n.willClose(t),r?(o=e,i=t,a=s,r=n.returnFocus,t=n.didClose,dt.swalCloseEventFinishedCallback=Xt.bind(null,o,a,r,t),i.addEventListener(ye,function(e){e.target===i&&(dt.swalCloseEventFinishedCallback(),delete dt.swalCloseEventFinishedCallback)})):Xt(e,s,n.returnFocus,n.didClose)},en=(e,t)=>{setTimeout(()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy()})};function tn(e,t,n){const o=ke.domCache.get(e);t.forEach(e=>{o[e].disabled=n})}function nn(e,t){if(!e)return!1;if("radio"===e.type){const n=e.parentNode.parentNode,o=n.querySelectorAll("input");for(let e=0;e<o.length;e++)o[e].disabled=t}else e.disabled=t}const on=e=>{e.isAwaitingPromise()?(an(ke,e),ke.awaitingPromise.set(e,!0)):(an(Jt,e),an(ke,e))},an=(e,t)=>{for(const n in e)e[n].delete(t)};e=Object.freeze({hideLoading:Zt,disableLoading:Zt,getInput:function(e){var t=ke.innerParams.get(e||this);return(e=ke.domCache.get(e||this))?Y(e.popup,t.input):null},close:$t,isAwaitingPromise:function(){return!!ke.awaitingPromise.get(this)},rejectPromise:function(e){const t=Jt.swalPromiseReject.get(this);Gt(this),t&&t(e)},closePopup:$t,closeModal:$t,closeToast:$t,enableButtons:function(){tn(this,["confirmButton","denyButton","cancelButton"],!1)},disableButtons:function(){tn(this,["confirmButton","denyButton","cancelButton"],!0)},enableInput:function(){return nn(this.getInput(),!1)},disableInput:function(){return nn(this.getInput(),!0)},showValidationMessage:function(e){const t=ke.domCache.get(this);var n=ke.innerParams.get(this);W(t.validationMessage,e),t.validationMessage.className=v["validation-message"],n.customClass&&n.customClass.validationMessage&&X(t.validationMessage,n.customClass.validationMessage),ee(t.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedby",v["validation-message"]),Z(o),X(o,v.inputerror))},resetValidationMessage:function(){var e=ke.domCache.get(this);e.validationMessage&&te(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),$(t,v.inputerror))},getProgressSteps:function(){return ke.domCache.get(this).progressSteps},update:function(t){var e=P(),n=ke.innerParams.get(this);if(!e||_(e,n.hideClass.popup))return s("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const o={};Object.keys(t).forEach(e=>{hn.isUpdatableParameter(e)?o[e]=t[e]:s('Invalid parameter to update: "'.concat(e,'". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md'))}),n=Object.assign({},n,o),ze(this,n),ke.innerParams.set(this,n),Object.defineProperties(this,{params:{value:Object.assign({},this.params,t),writable:!1,enumerable:!0}})},_destroy:function(){var e=ke.domCache.get(this);const t=ke.innerParams.get(this);t?(e.popup&&dt.swalCloseEventFinishedCallback&&(dt.swalCloseEventFinishedCallback(),delete dt.swalCloseEventFinishedCallback),dt.deferDisposalTimer&&(clearTimeout(dt.deferDisposalTimer),delete dt.deferDisposalTimer),"function"==typeof t.didDestroy&&t.didDestroy(),e=this,on(e),delete e.params,delete dt.keydownHandler,delete dt.keydownTarget,delete dt.currentInstance):on(this)}});let sn;class rn{constructor(){if("undefined"!=typeof window){sn=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=Object.freeze(this.constructor.argsToParams(t));Object.defineProperties(this,{params:{value:o,writable:!1,enumerable:!0,configurable:!0}});o=this._main(this.params);ke.promise.set(this,o)}}_main(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};y(Object.assign({},t,e)),dt.currentInstance&&(dt.currentInstance._destroy(),U()&&Ke()),dt.currentInstance=this;e=ln(e,t);ot(e),Object.freeze(e),dt.timeout&&(dt.timeout.stop(),delete dt.timeout),clearTimeout(dt.restoreFocusTimeout);t=un(this);return ze(this,e),ke.innerParams.set(this,e),cn(this,t,e)}then(e){const t=ke.promise.get(this);return t.then(e)}finally(e){const t=ke.promise.get(this);return t.finally(e)}}const cn=(s,r,c)=>new Promise((e,t)=>{const n=e=>{s.closePopup({isDismissed:!0,dismiss:e})};var o,i,a;Jt.swalPromiseResolve.set(s,e),Jt.swalPromiseReject.set(s,t),r.confirmButton.onclick=()=>(e=>{var t=ke.innerParams.get(e);e.disableButtons(),t.input?Bt(e,"confirm"):Tt(e,!0)})(s),r.denyButton.onclick=()=>(e=>{var t=ke.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Bt(e,"deny"):xt(e,!1)})(s),r.cancelButton.onclick=()=>((e,t)=>{e.disableButtons(),t(We.cancel)})(s,n),r.closeButton.onclick=()=>n(We.close),o=s,e=r,t=n,ke.innerParams.get(o).toast?Ot(o,e,t):(jt(e),Dt(e),Mt(o,e,t)),i=s,e=dt,t=c,a=n,e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1),t.toast||(e.keydownHandler=e=>Nt(i,e,a),e.keydownTarget=t.keydownListenerCapture?window:P(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0),t=s,"select"===(e=c).input||"radio"===e.input?wt(t,e):["text","email","number","tel","textarea"].includes(e.input)&&(l(e.inputValue)||d(e.inputValue))&&(vt(L()),Ct(t,e)),(e=>{const t=C(),n=P();"function"==typeof e.willOpen&&e.willOpen(n);var o=window.getComputedStyle(document.body).overflowY;yt(t,n,e),setTimeout(()=>{ft(t,n)},gt),U()&&(bt(t,e.scrollbarPadding,o),_e()),F()||dt.previousActiveElement||(dt.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout(()=>e.didOpen(n)),$(t,v["no-transition"])})(c),dn(dt,c,n),pn(r,c),setTimeout(()=>{r.container.scrollTop=0})}),ln=(e,t)=>{var n=(e=>{e="string"==typeof e.template?document.querySelector(e.template):e.template;if(!e)return{};e=e.content;return et(e),Object.assign(Ze(e),Je(e),Xe(e),$e(e),Ge(e),Qe(e,Ye))})(e);const o=Object.assign({},p,t,n,e);return o.showClass=Object.assign({},p.showClass,o.showClass),o.hideClass=Object.assign({},p.hideClass,o.hideClass),o},un=e=>{var t={popup:P(),container:C(),actions:I(),confirmButton:L(),denyButton:j(),cancelButton:M(),loader:D(),closeButton:V(),validationMessage:O(),progressSteps:T()};return ke.domCache.set(e,t),t},dn=(e,t,n)=>{var o=q();te(o),t.timer&&(e.timeout=new it(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(ee(o),setTimeout(()=>{e.timeout&&e.timeout.running&&R(t.timer)})))},pn=(e,t)=>{if(!t.toast)return c(t.allowEnterKey)?void(mn(e,t)||Ht(t,-1,1)):gn()},mn=(e,t)=>t.focusDeny&&ie(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ie(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ie(e.confirmButton))&&(e.confirmButton.focus(),!0),gn=()=>{document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};Object.assign(rn.prototype,e),Object.assign(rn,Yt),Object.keys(e).forEach(e=>{rn[e]=function(){if(sn)return sn[e](...arguments)}}),rn.DismissReason=We,rn.version="11.3.1";const hn=rn;return hn.default=hn,hn}),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2);
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Sweetalert2=t()}(this,function(){"use strict";const t="SweetAlert2:",o=e=>e.charAt(0).toUpperCase()+e.slice(1),a=e=>Array.prototype.slice.call(e),r=e=>{console.warn("".concat(t," ").concat("object"==typeof e?e.join(" "):e))},s=e=>{console.error("".concat(t," ").concat(e))},n=[],i=(e,t)=>{t='"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'),n.includes(t)||(n.push(t),r(t))},c=e=>"function"==typeof e?e():e,l=e=>e&&"function"==typeof e.toPromise,u=e=>l(e)?e.toPromise():Promise.resolve(e),d=e=>e&&Promise.resolve(e)===e,p={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},m=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],g={},h=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],f=e=>Object.prototype.hasOwnProperty.call(p,e),b=e=>-1!==m.indexOf(e),y=e=>g[e],v=e=>{!e.backdrop&&e.allowOutsideClick&&r('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const o in e)n=o,f(n)||r('Unknown parameter "'.concat(n,'"')),e.toast&&(t=o,h.includes(t)&&r('The parameter "'.concat(t,'" is incompatible with toasts'))),t=o,y(t)&&i(t,y(t));var t,n};var e=e=>{const t={};for(const n in e)t[e[n]]="swal2-"+e[n];return t};const w=e(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),C=e(["success","warning","info","question","error"]),A=()=>document.body.querySelector(".".concat(w.container)),k=e=>{const t=A();return t?t.querySelector(e):null},B=e=>k(".".concat(e)),P=()=>B(w.popup),x=()=>B(w.icon),E=()=>B(w.title),S=()=>B(w["html-container"]),T=()=>B(w.image),L=()=>B(w["progress-steps"]),O=()=>B(w["validation-message"]),j=()=>k(".".concat(w.actions," .").concat(w.confirm)),M=()=>k(".".concat(w.actions," .").concat(w.deny));const D=()=>k(".".concat(w.loader)),H=()=>k(".".concat(w.actions," .").concat(w.cancel)),I=()=>B(w.actions),q=()=>B(w.footer),V=()=>B(w["timer-progress-bar"]),N=()=>B(w.close),F=()=>{const e=a(P().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((e,t)=>(e=parseInt(e.getAttribute("tabindex")),(t=parseInt(t.getAttribute("tabindex")))<e?1:e<t?-1:0));var t=a(P().querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n')).filter(e=>"-1"!==e.getAttribute("tabindex"));return(t=>{const n=[];for(let e=0;e<t.length;e++)-1===n.indexOf(t[e])&&n.push(t[e]);return n})(e.concat(t)).filter(e=>ae(e))},R=()=>!K(document.body,w["toast-shown"])&&!K(document.body,w["no-backdrop"]),U=()=>P()&&K(P(),w.toast);function z(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];const n=V();ae(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"},10))}const W={previousBodyPadding:null},_=(t,e)=>{if(t.textContent="",e){const n=new DOMParser,o=n.parseFromString(e,"text/html");a(o.querySelector("head").childNodes).forEach(e=>{t.appendChild(e)}),a(o.querySelector("body").childNodes).forEach(e=>{t.appendChild(e)})}},K=(t,e)=>{if(!e)return!1;var n=e.split(/\s+/);for(let e=0;e<n.length;e++)if(!t.classList.contains(n[e]))return!1;return!0},Y=(e,t,n)=>{var o,i;if(o=e,i=t,a(o.classList).forEach(e=>{Object.values(w).includes(e)||Object.values(C).includes(e)||Object.values(i.showClass).includes(e)||o.classList.remove(e)}),t.customClass&&t.customClass[n]){if("string"!=typeof t.customClass[n]&&!t.customClass[n].forEach)return r("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(typeof t.customClass[n],'"'));$(e,t.customClass[n])}},Z=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(w[t]));case"checkbox":return e.querySelector(".".concat(w.checkbox," input"));case"radio":return e.querySelector(".".concat(w.radio," input:checked"))||e.querySelector(".".concat(w.radio," input:first-child"));case"range":return e.querySelector(".".concat(w.range," input"));default:return e.querySelector(".".concat(w.input))}},J=e=>{var t;e.focus(),"file"!==e.type&&(t=e.value,e.value="",e.value=t)},X=(e,t,n)=>{e&&t&&(t="string"==typeof t?t.split(/\s+/).filter(Boolean):t).forEach(t=>{Array.isArray(e)?e.forEach(e=>{n?e.classList.add(t):e.classList.remove(t)}):n?e.classList.add(t):e.classList.remove(t)})},$=(e,t)=>{X(e,t,!0)},G=(e,t)=>{X(e,t,!1)},Q=(e,t)=>{var n=a(e.childNodes);for(let e=0;e<n.length;e++)if(K(n[e],t))return n[e]},ee=(e,t,n)=>{(n=n==="".concat(parseInt(n))?parseInt(n):n)||0===parseInt(n)?e.style[t]="number"==typeof n?"".concat(n,"px"):n:e.style.removeProperty(t)},te=function(e){e.style.display=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"flex"},ne=e=>{e.style.display="none"},oe=(e,t,n,o)=>{const i=e.querySelector(t);i&&(i.style[n]=o)},ie=(e,t,n)=>{t?te(e,n):ne(e)},ae=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),re=()=>!ae(j())&&!ae(M())&&!ae(H()),se=e=>!!(e.scrollHeight>e.clientHeight),ce=e=>{const t=window.getComputedStyle(e);var n=parseFloat(t.getPropertyValue("animation-duration")||"0"),e=parseFloat(t.getPropertyValue("transition-duration")||"0");return 0<n||0<e},le=()=>"undefined"==typeof window||"undefined"==typeof document,ue=100,de={},pe=()=>{de.previousActiveElement&&de.previousActiveElement.focus?(de.previousActiveElement.focus(),de.previousActiveElement=null):document.body&&document.body.focus()},me=o=>new Promise(e=>{if(!o)return e();var t=window.scrollX,n=window.scrollY;de.restoreFocusTimeout=setTimeout(()=>{pe(),e()},ue),window.scrollTo(t,n)}),ge='\n <div aria-labelledby="'.concat(w.title,'" aria-describedby="').concat(w["html-container"],'" class="').concat(w.popup,'" tabindex="-1">\n <button type="button" class="').concat(w.close,'"></button>\n <ul class="').concat(w["progress-steps"],'"></ul>\n <div class="').concat(w.icon,'"></div>\n <img class="').concat(w.image,'" />\n <h2 class="').concat(w.title,'" id="').concat(w.title,'"></h2>\n <div class="').concat(w["html-container"],'" id="').concat(w["html-container"],'"></div>\n <input class="').concat(w.input,'" />\n <input type="file" class="').concat(w.file,'" />\n <div class="').concat(w.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(w.select,'"></select>\n <div class="').concat(w.radio,'"></div>\n <label for="').concat(w.checkbox,'" class="').concat(w.checkbox,'">\n <input type="checkbox" />\n <span class="').concat(w.label,'"></span>\n </label>\n <textarea class="').concat(w.textarea,'"></textarea>\n <div class="').concat(w["validation-message"],'" id="').concat(w["validation-message"],'"></div>\n <div class="').concat(w.actions,'">\n <div class="').concat(w.loader,'"></div>\n <button type="button" class="').concat(w.confirm,'"></button>\n <button type="button" class="').concat(w.deny,'"></button>\n <button type="button" class="').concat(w.cancel,'"></button>\n </div>\n <div class="').concat(w.footer,'"></div>\n <div class="').concat(w["timer-progress-bar-container"],'">\n <div class="').concat(w["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),he=()=>{const e=A();return!!e&&(e.remove(),G([document.documentElement,document.body],[w["no-backdrop"],w["toast-shown"],w["has-column"]]),!0)},fe=()=>{de.currentInstance.resetValidationMessage()},be=()=>{const e=P(),t=Q(e,w.input),n=Q(e,w.file),o=e.querySelector(".".concat(w.range," input")),i=e.querySelector(".".concat(w.range," output")),a=Q(e,w.select),r=e.querySelector(".".concat(w.checkbox," input")),s=Q(e,w.textarea);t.oninput=fe,n.onchange=fe,a.onchange=fe,r.onchange=fe,s.oninput=fe,o.oninput=()=>{fe(),i.value=o.value},o.onchange=()=>{fe(),o.nextSibling.value=o.value}},ye=e=>"string"==typeof e?document.querySelector(e):e,ve=e=>{const t=P();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},we=e=>{"rtl"===window.getComputedStyle(e).direction&&$(A(),w.rtl)},Ce=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?((e,t)=>{if(e.jquery)Ae(t,e);else _(t,e.toString())})(e,t):e&&_(t,e)},Ae=(t,n)=>{if(t.textContent="",0 in n)for(let e=0;e in n;e++)t.appendChild(n[e].cloneNode(!0));else t.appendChild(n.cloneNode(!0))},ke=(()=>{if(le())return!1;var e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),Be=(e,t)=>{var n,o,i,a,r,s=I(),c=D();(t.showConfirmButton||t.showDenyButton||t.showCancelButton?te:ne)(s),Y(s,t,"actions"),n=s,o=c,i=t,a=j(),r=M(),s=H(),Pe(a,"confirm",i),Pe(r,"deny",i),Pe(s,"cancel",i),function(e,t,n,o){if(!o.buttonsStyling)return G([e,t,n],w.styled);$([e,t,n],w.styled),o.confirmButtonColor&&(e.style.backgroundColor=o.confirmButtonColor,$(e,w["default-outline"]));o.denyButtonColor&&(t.style.backgroundColor=o.denyButtonColor,$(t,w["default-outline"]));o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,$(n,w["default-outline"]))}(a,r,s,i),i.reverseButtons&&(i.toast?(n.insertBefore(s,a),n.insertBefore(r,a)):(n.insertBefore(s,o),n.insertBefore(r,o),n.insertBefore(a,o))),_(c,t.loaderHtml),Y(c,t,"loader")};function Pe(e,t,n){ie(e,n["show".concat(o(t),"Button")],"inline-block"),_(e,n["".concat(t,"ButtonText")]),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]),e.className=w[t],Y(e,n,"".concat(t,"Button")),$(e,n["".concat(t,"ButtonClass")])}const xe=(e,t)=>{var n,o,i=A();i&&(o=i,"string"==typeof(n=t.backdrop)?o.style.background=n:n||$([document.documentElement,document.body],w["no-backdrop"]),o=i,(n=t.position)in w?$(o,w[n]):(r('The "position" parameter is not valid, defaulting to "center"'),$(o,w.center)),n=i,!(o=t.grow)||"string"!=typeof o||(o="grow-".concat(o))in w&&$(n,w[o]),Y(i,t,"container"))};var Ee={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const Se=["input","file","range","select","radio","checkbox","textarea"],Te=(e,o)=>{const i=P();e=Ee.innerParams.get(e);const a=!e||o.input!==e.input;Se.forEach(e=>{var t=w[e];const n=Q(i,t);((e,t)=>{const n=Z(P(),e);if(n){Le(n);for(const o in t)n.setAttribute(o,t[o])}})(e,o.inputAttributes),n.className=t,a&&ne(n)}),o.input&&(a&&(e=>{if(!De[e.input])return s('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=Me(e.input),n=De[e.input](t,e);te(n),setTimeout(()=>{J(n)})})(o),(e=>{const t=Me(e.input);if(e.customClass)$(t,e.customClass.input)})(o))},Le=t=>{for(let e=0;e<t.attributes.length;e++){var n=t.attributes[e].name;["type","value","style"].includes(n)||t.removeAttribute(n)}},Oe=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},je=(e,t,n)=>{if(n.inputLabel){e.id=w.input;const i=document.createElement("label");var o=w["input-label"];i.setAttribute("for",e.id),i.className=o,$(i,n.customClass.inputLabel),i.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",i)}},Me=e=>{e=w[e]||w.input;return Q(P(),e)},De={};De.text=De.email=De.password=De.number=De.tel=De.url=(e,t)=>("string"==typeof t.inputValue||"number"==typeof t.inputValue?e.value=t.inputValue:d(t.inputValue)||r('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t.inputValue,'"')),je(e,e,t),Oe(e,t),e.type=t.input,e),De.file=(e,t)=>(je(e,e,t),Oe(e,t),e),De.range=(e,t)=>{const n=e.querySelector("input"),o=e.querySelector("output");return n.value=t.inputValue,n.type=t.input,o.value=t.inputValue,je(n,e,t),e},De.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");_(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return je(e,e,t),e},De.radio=e=>(e.textContent="",e),De.checkbox=(e,t)=>{const n=Z(P(),"checkbox");n.value="1",n.id=w.checkbox,n.checked=Boolean(t.inputValue);var o=e.querySelector("span");return _(o,t.inputPlaceholder),e},De.textarea=(n,e)=>{n.value=e.inputValue,Oe(n,e),je(n,n,e);return setTimeout(()=>{if("MutationObserver"in window){const t=parseInt(window.getComputedStyle(P()).width);new MutationObserver(()=>{var e,e=n.offsetWidth+(e=n,parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight));e>t?P().style.width="".concat(e,"px"):P().style.width=null}).observe(n,{attributes:!0,attributeFilter:["style"]})}}),n};const He=(e,t)=>{const n=S();Y(n,t,"htmlContainer"),t.html?(Ce(t.html,n),te(n,"block")):t.text?(n.textContent=t.text,te(n,"block")):ne(n),Te(e,t)},Ie=(e,t)=>{var n=q();ie(n,t.footer),t.footer&&Ce(t.footer,n),Y(n,t,"footer")},qe=(e,t)=>{const n=N();_(n,t.closeButtonHtml),Y(n,t,"closeButton"),ie(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)},Ve=(e,t)=>{var n=Ee.innerParams.get(e),e=x();return n&&t.icon===n.icon?(Re(e,t),void Ne(e,t)):t.icon||t.iconHtml?t.icon&&-1===Object.keys(C).indexOf(t.icon)?(s('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),ne(e)):(te(e),Re(e,t),Ne(e,t),void $(e,t.showClass.icon)):ne(e)},Ne=(e,t)=>{for(const n in C)t.icon!==n&&G(e,C[n]);$(e,C[t.icon]),Ue(e,t),Fe(),Y(e,t,"icon")},Fe=()=>{const e=P();var t=window.getComputedStyle(e).getPropertyValue("background-color");const n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<n.length;e++)n[e].style.backgroundColor=t},Re=(e,t)=>{var n;e.textContent="",t.iconHtml?_(e,ze(t.iconHtml)):"success"===t.icon?_(e,'\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 '):"error"===t.icon?_(e,'\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n '):(n={question:"?",warning:"!",info:"i"},_(e,ze(n[t.icon])))},Ue=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])oe(e,n,"backgroundColor",t.iconColor);oe(e,".swal2-success-ring","borderColor",t.iconColor)}},ze=e=>'<div class="'.concat(w["icon-content"],'">').concat(e,"</div>"),We=(e,t)=>{const n=T();if(!t.imageUrl)return ne(n);te(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),ee(n,"width",t.imageWidth),ee(n,"height",t.imageHeight),n.className=w.image,Y(n,t,"image")},_e=(e,o)=>{const i=L();if(!o.progressSteps||0===o.progressSteps.length)return ne(i);te(i),i.textContent="",o.currentProgressStep>=o.progressSteps.length&&r("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.progressSteps.forEach((e,t)=>{var n,e=(n=e,e=document.createElement("li"),$(e,w["progress-step"]),_(e,n),e);i.appendChild(e),t===o.currentProgressStep&&$(e,w["active-progress-step"]),t!==o.progressSteps.length-1&&(t=(e=>{const t=document.createElement("li");return $(t,w["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t})(o),i.appendChild(t))})},Ke=(e,t)=>{const n=E();ie(n,t.title||t.titleText,"block"),t.title&&Ce(t.title,n),t.titleText&&(n.innerText=t.titleText),Y(n,t,"title")},Ye=(e,t)=>{var n=A();const o=P();t.toast?(ee(n,"width",t.width),o.style.width="100%",o.insertBefore(D(),x())):ee(o,"width",t.width),ee(o,"padding",t.padding),t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background),ne(O()),((e,t)=>{if(e.className="".concat(w.popup," ").concat(ae(e)?t.showClass.popup:""),t.toast){$([document.documentElement,document.body],w["toast-shown"]);$(e,w.toast)}else $(e,w.modal);if(Y(e,t,"popup"),typeof t.customClass==="string")$(e,t.customClass);if(t.icon)$(e,w["icon-".concat(t.icon)])})(o,t)},Ze=(e,t)=>{Ye(e,t),xe(e,t),_e(e,t),Ve(e,t),We(e,t),Ke(e,t),qe(e,t),He(e,t),Be(e,t),Ie(e,t),"function"==typeof t.didRender&&t.didRender(P())},Je=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Xe=()=>{const e=a(document.body.children);e.forEach(e=>{e===A()||e.contains(A())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))})},$e=()=>{const e=a(document.body.children);e.forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},Ge=["swal-title","swal-html","swal-footer"],Qe=e=>{const o={};return a(e.querySelectorAll("swal-param")).forEach(e=>{rt(e,["name","value"]);var t=e.getAttribute("name");let n=e.getAttribute("value");"boolean"==typeof p[t]&&"false"===n&&(n=!1),"object"==typeof p[t]&&(n=JSON.parse(n)),o[t]=n}),o},et=e=>{const n={};return a(e.querySelectorAll("swal-button")).forEach(e=>{rt(e,["type","color","aria-label"]);var t=e.getAttribute("type");n["".concat(t,"ButtonText")]=e.innerHTML,n["show".concat(o(t),"Button")]=!0,e.hasAttribute("color")&&(n["".concat(t,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(n["".concat(t,"ButtonAriaLabel")]=e.getAttribute("aria-label"))}),n},tt=e=>{const t={},n=e.querySelector("swal-image");return n&&(rt(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},nt=e=>{const t={},n=e.querySelector("swal-icon");return n&&(rt(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},ot=e=>{const n={},t=e.querySelector("swal-input");t&&(rt(t,["type","label","placeholder","value"]),n.input=t.getAttribute("type")||"text",t.hasAttribute("label")&&(n.inputLabel=t.getAttribute("label")),t.hasAttribute("placeholder")&&(n.inputPlaceholder=t.getAttribute("placeholder")),t.hasAttribute("value")&&(n.inputValue=t.getAttribute("value")));e=e.querySelectorAll("swal-input-option");return e.length&&(n.inputOptions={},a(e).forEach(e=>{rt(e,["value"]);var t=e.getAttribute("value"),e=e.innerHTML;n.inputOptions[t]=e})),n},it=(e,t)=>{const n={};for(const o in t){const i=t[o],a=e.querySelector(i);a&&(rt(a,[]),n[i.replace(/^swal-/,"")]=a.innerHTML.trim())}return n},at=e=>{const t=Ge.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);a(e.children).forEach(e=>{e=e.tagName.toLowerCase();-1===t.indexOf(e)&&r("Unrecognized element <".concat(e,">"))})},rt=(t,n)=>{a(t.attributes).forEach(e=>{-1===n.indexOf(e.name)&&r(['Unrecognized attribute "'.concat(e.name,'" on <').concat(t.tagName.toLowerCase(),">."),"".concat(n.length?"Allowed attributes are: ".concat(n.join(", ")):"To set the value, use HTML within the element.")])})};var st={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function ct(e){var t,n;(t=e).inputValidator||Object.keys(st).forEach(e=>{t.input===e&&(t.inputValidator=st[e])}),e.showLoaderOnConfirm&&!e.preConfirm&&r("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),(n=e).target&&("string"!=typeof n.target||document.querySelector(n.target))&&("string"==typeof n.target||n.target.appendChild)||(r('Target parameter is not valid, defaulting to "body"'),n.target="body"),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),(e=>{var t=he();if(le())s("SweetAlert2 requires document to initialize");else{const n=document.createElement("div");n.className=w.container,t&&$(n,w["no-transition"]),_(n,ge);const o=ye(e.target);o.appendChild(n),ve(e),we(o),be()}})(e)}class lt{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){var t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const ut=()=>{null===W.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(W.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(W.previousBodyPadding+(()=>{const e=document.createElement("div");e.className=w["scrollbar-measure"],document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})(),"px"))},dt=()=>{null!==W.previousBodyPadding&&(document.body.style.paddingRight="".concat(W.previousBodyPadding,"px"),W.previousBodyPadding=null)},pt=()=>{var e;(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints)&&!K(document.body,w.iosfix)&&(e=document.body.scrollTop,document.body.style.top="".concat(-1*e,"px"),$(document.body,w.iosfix),(()=>{const e=A();let t;e.ontouchstart=e=>{t=mt(e)},e.ontouchmove=e=>{if(t){e.preventDefault();e.stopPropagation()}}})(),(()=>{const e=!navigator.userAgent.match(/(CriOS|FxiOS|EdgiOS|YaBrowser|UCBrowser)/i);if(e){const t=44;if(P().scrollHeight>window.innerHeight-t)A().style.paddingBottom="".concat(t,"px")}})())},mt=e=>{var t,n=e.target,o=A();return!((t=e).touches&&t.touches.length&&"stylus"===t.touches[0].touchType||(e=e).touches&&1<e.touches.length)&&(n===o||!(se(o)||"INPUT"===n.tagName||"TEXTAREA"===n.tagName||se(S())&&S().contains(n)))},gt=()=>{var e;K(document.body,w.iosfix)&&(e=parseInt(document.body.style.top,10),G(document.body,w.iosfix),document.body.style.top="",document.body.scrollTop=-1*e)},ht=10,ft=e=>{const t=P();if(e.target===t){const n=A();t.removeEventListener(ke,ft),n.style.overflowY="auto"}},bt=(e,t)=>{ke&&ce(t)?(e.style.overflowY="hidden",t.addEventListener(ke,ft)):e.style.overflowY="auto"},yt=(e,t,n)=>{pt(),t&&"hidden"!==n&&ut(),setTimeout(()=>{e.scrollTop=0})},vt=(e,t,n)=>{$(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),te(t,"grid"),setTimeout(()=>{$(t,n.showClass.popup),t.style.removeProperty("opacity")},ht),$([document.documentElement,document.body],w.shown),n.heightAuto&&n.backdrop&&!n.toast&&$([document.documentElement,document.body],w["height-auto"])},wt=e=>{let t=P();t||new fn,t=P();var n=D();U()?ne(x()):((e,t)=>{const n=I(),o=D();if(!t&&ae(j()))t=j();if(te(n),t){ne(t);o.setAttribute("data-button-to-replace",t.className)}o.parentNode.insertBefore(o,t),$([e,n],w.loading)})(t,e),te(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Ct=(t,n)=>{const o=P(),i=e=>kt[n.input](o,Bt(e),n);l(n.inputOptions)||d(n.inputOptions)?(wt(j()),u(n.inputOptions).then(e=>{t.hideLoading(),i(e)})):"object"==typeof n.inputOptions?i(n.inputOptions):s("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof n.inputOptions))},At=(t,n)=>{const o=t.getInput();ne(o),u(n.inputValue).then(e=>{o.value="number"===n.input?parseFloat(e)||0:"".concat(e),te(o),o.focus(),t.hideLoading()}).catch(e=>{s("Error in inputValue promise: ".concat(e)),o.value="",te(o),o.focus(),t.hideLoading()})},kt={select:(e,t,i)=>{const a=Q(e,w.select),r=(e,t,n)=>{const o=document.createElement("option");o.value=n,_(o,t),o.selected=Pt(n,i.inputValue),e.appendChild(o)};t.forEach(e=>{var t=e[0];const n=e[1];if(Array.isArray(n)){const o=document.createElement("optgroup");o.label=t,o.disabled=!1,a.appendChild(o),n.forEach(e=>r(o,e[1],e[0]))}else r(a,n,t)}),a.focus()},radio:(e,t,a)=>{const r=Q(e,w.radio);t.forEach(e=>{var t=e[0],e=e[1];const n=document.createElement("input"),o=document.createElement("label");n.type="radio",n.name=w.radio,n.value=t,Pt(t,a.inputValue)&&(n.checked=!0);const i=document.createElement("span");_(i,e),i.className=w.label,o.appendChild(n),o.appendChild(i),r.appendChild(o)});const n=r.querySelectorAll("input");n.length&&n[0].focus()}},Bt=n=>{const o=[];return"undefined"!=typeof Map&&n instanceof Map?n.forEach((e,t)=>{let n=e;"object"==typeof n&&(n=Bt(n)),o.push([t,n])}):Object.keys(n).forEach(e=>{let t=n[e];"object"==typeof t&&(t=Bt(t)),o.push([e,t])}),o},Pt=(e,t)=>t&&t.toString()===e.toString(),xt=(e,t)=>{var n=Ee.innerParams.get(e),o=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return n.checked?1:0;case"radio":return(o=n).checked?o.value:null;case"file":return(o=n).files.length?null!==o.getAttribute("multiple")?o.files:o.files[0]:null;default:return t.inputAutoTrim?n.value.trim():n.value}var o})(e,n);n.inputValidator?((t,n,o)=>{const e=Ee.innerParams.get(t);t.disableInput();const i=Promise.resolve().then(()=>u(e.inputValidator(n,e.validationMessage)));i.then(e=>{t.enableButtons();t.enableInput();if(e)t.showValidationMessage(e);else if(o==="deny")Et(t,n);else Lt(t,n)})})(e,o,t):e.getInput().checkValidity()?("deny"===t?Et:Lt)(e,o):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},Et=(t,n)=>{const e=Ee.innerParams.get(t||void 0);if(e.showLoaderOnDeny&&wt(M()),e.preDeny){Ee.awaitingPromise.set(t||void 0,!0);const o=Promise.resolve().then(()=>u(e.preDeny(n,e.validationMessage)));o.then(e=>{!1===e?t.hideLoading():t.closePopup({isDenied:!0,value:void 0===e?n:e})}).catch(e=>Tt(t||void 0,e))}else t.closePopup({isDenied:!0,value:n})},St=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},Tt=(e,t)=>{e.rejectPromise(t)},Lt=(t,n)=>{const e=Ee.innerParams.get(t||void 0);if(e.showLoaderOnConfirm&&wt(),e.preConfirm){t.resetValidationMessage(),Ee.awaitingPromise.set(t||void 0,!0);const o=Promise.resolve().then(()=>u(e.preConfirm(n,e.validationMessage)));o.then(e=>{ae(O())||!1===e?t.hideLoading():St(t,void 0===e?n:e)}).catch(e=>Tt(t||void 0,e))}else St(t,n)},Ot=(n,e,o)=>{e.popup.onclick=()=>{var e,t=Ee.innerParams.get(n);t&&((e=t).showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton||t.timer||t.input)||o(Je.close)}};let jt=!1;const Mt=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(jt=!0)}}},Dt=t=>{t.container.onmousedown=()=>{t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,e.target!==t.popup&&!t.popup.contains(e.target)||(jt=!0)}}},Ht=(n,o,i)=>{o.container.onclick=e=>{var t=Ee.innerParams.get(n);jt?jt=!1:e.target===o.container&&c(t.allowOutsideClick)&&i(Je.backdrop)}};const It=()=>j()&&j().click();const qt=(e,t,n)=>{const o=F();if(o.length)return(t+=n)===o.length?t=0:-1===t&&(t=o.length-1),o[t].focus();P().focus()},Vt=["ArrowRight","ArrowDown"],Nt=["ArrowLeft","ArrowUp"],Ft=(e,t,n)=>{var o,i,a=Ee.innerParams.get(e);a&&(a.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?(o=e,i=a,(e=t).isComposing||e.target&&o.getInput()&&e.target.outerHTML===o.getInput().outerHTML&&(["textarea","file"].includes(i.input)||(It(),e.preventDefault()))):"Tab"===t.key?((e,t)=>{const n=e.target,o=F();let i=-1;for(let e=0;e<o.length;e++)if(n===o[e]){i=e;break}if(!e.shiftKey)qt(t,i,1);else qt(t,i,-1);e.stopPropagation(),e.preventDefault()})(t,a):[...Vt,...Nt].includes(t.key)?(e=>{const t=j(),n=M(),o=H();if([t,n,o].includes(document.activeElement)){var i=Vt.includes(e)?"nextElementSibling":"previousElementSibling";const a=document.activeElement[i];a instanceof HTMLElement&&a.focus()}})(t.key):"Escape"===t.key&&((e,t,n)=>{if(c(t.allowEscapeKey)){e.preventDefault();n(Je.esc)}})(t,a,n))},Rt=e=>"object"==typeof e&&e.jquery,Ut=e=>e instanceof Element||Rt(e);const zt=()=>{if(de.timeout)return(()=>{const e=V();var t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";t=t/parseInt(window.getComputedStyle(e).width)*100;e.style.removeProperty("transition"),e.style.width="".concat(t,"%")})(),de.timeout.stop()},Wt=()=>{if(de.timeout){var e=de.timeout.start();return z(e),e}};let _t=!1;const Kt={};const Yt=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const o in Kt){var n=e.getAttribute(o);if(n)return void Kt[o].fire({template:n})}};var Zt=Object.freeze({isValidParameter:f,isUpdatableParameter:b,isDeprecatedParameter:y,argsToParams:n=>{const o={};return"object"!=typeof n[0]||Ut(n[0])?["title","html","icon"].forEach((e,t)=>{t=n[t];"string"==typeof t||Ut(t)?o[e]=t:void 0!==t&&s("Unexpected type of ".concat(e,'! Expected "string" or "Element", got ').concat(typeof t))}):Object.assign(o,n[0]),o},isVisible:()=>ae(P()),clickConfirm:It,clickDeny:()=>M()&&M().click(),clickCancel:()=>H()&&H().click(),getContainer:A,getPopup:P,getTitle:E,getHtmlContainer:S,getImage:T,getIcon:x,getInputLabel:()=>B(w["input-label"]),getCloseButton:N,getActions:I,getConfirmButton:j,getDenyButton:M,getCancelButton:H,getLoader:D,getFooter:q,getTimerProgressBar:V,getFocusableElements:F,getValidationMessage:O,isLoading:()=>P().hasAttribute("data-loading"),fire:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new this(...t)},mixin:function(n){class e extends this{_main(e,t){return super._main(e,Object.assign({},n,t))}}return e},showLoading:wt,enableLoading:wt,getTimerLeft:()=>de.timeout&&de.timeout.getTimerLeft(),stopTimer:zt,resumeTimer:Wt,toggleTimer:()=>{var e=de.timeout;return e&&(e.running?zt:Wt)()},increaseTimer:e=>{if(de.timeout){e=de.timeout.increase(e);return z(e,!0),e}},isTimerRunning:()=>de.timeout&&de.timeout.isRunning(),bindClickHandler:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"data-swal-template";Kt[e]=this,_t||(document.body.addEventListener("click",Yt),_t=!0)}});function Jt(){var e=Ee.innerParams.get(this);if(e){const t=Ee.domCache.get(this);ne(t.loader),U()?e.icon&&te(x()):(e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));if(t.length)te(t[0],"inline-block");else if(re())ne(e.actions)})(t),G([t.popup,t.actions],w.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}}var Xt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};function $t(e,t,n,o){U()?tn(e,o):(me(n).then(()=>tn(e,o)),de.keydownTarget.removeEventListener("keydown",de.keydownHandler,{capture:de.keydownListenerCapture}),de.keydownHandlerAdded=!1),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),R()&&(dt(),gt(),$e()),G([document.documentElement,document.body],[w.shown,w["height-auto"],w["no-backdrop"],w["toast-shown"]])}function Gt(e){e=void 0!==(n=e)?Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},n):{isConfirmed:!1,isDenied:!1,isDismissed:!0};const t=Xt.swalPromiseResolve.get(this);var n=(e=>{const t=P();if(!t)return false;const n=Ee.innerParams.get(e);if(!n||K(t,n.hideClass.popup))return false;G(t,n.showClass.popup),$(t,n.hideClass.popup);const o=A();return G(o,n.showClass.backdrop),$(o,n.hideClass.backdrop),en(e,t,n),true})(this);this.isAwaitingPromise()?e.isDismissed||(Qt(this),t(e)):n&&t(e)}const Qt=e=>{e.isAwaitingPromise()&&(Ee.awaitingPromise.delete(e),Ee.innerParams.get(e)||e._destroy())},en=(e,t,n)=>{var o,i,a,r=A(),s=ke&&ce(t);"function"==typeof n.willClose&&n.willClose(t),s?(o=e,i=t,a=r,s=n.returnFocus,t=n.didClose,de.swalCloseEventFinishedCallback=$t.bind(null,o,a,s,t),i.addEventListener(ke,function(e){e.target===i&&(de.swalCloseEventFinishedCallback(),delete de.swalCloseEventFinishedCallback)})):$t(e,r,n.returnFocus,n.didClose)},tn=(e,t)=>{setTimeout(()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy()})};function nn(e,t,n){const o=Ee.domCache.get(e);t.forEach(e=>{o[e].disabled=n})}function on(e,t){if(!e)return!1;if("radio"===e.type){const n=e.parentNode.parentNode,o=n.querySelectorAll("input");for(let e=0;e<o.length;e++)o[e].disabled=t}else e.disabled=t}const an=e=>{e.isAwaitingPromise()?(rn(Ee,e),Ee.awaitingPromise.set(e,!0)):(rn(Xt,e),rn(Ee,e))},rn=(e,t)=>{for(const n in e)e[n].delete(t)};e=Object.freeze({hideLoading:Jt,disableLoading:Jt,getInput:function(e){var t=Ee.innerParams.get(e||this);return(e=Ee.domCache.get(e||this))?Z(e.popup,t.input):null},close:Gt,isAwaitingPromise:function(){return!!Ee.awaitingPromise.get(this)},rejectPromise:function(e){const t=Xt.swalPromiseReject.get(this);Qt(this),t&&t(e)},closePopup:Gt,closeModal:Gt,closeToast:Gt,enableButtons:function(){nn(this,["confirmButton","denyButton","cancelButton"],!1)},disableButtons:function(){nn(this,["confirmButton","denyButton","cancelButton"],!0)},enableInput:function(){return on(this.getInput(),!1)},disableInput:function(){return on(this.getInput(),!0)},showValidationMessage:function(e){const t=Ee.domCache.get(this);var n=Ee.innerParams.get(this);_(t.validationMessage,e),t.validationMessage.className=w["validation-message"],n.customClass&&n.customClass.validationMessage&&$(t.validationMessage,n.customClass.validationMessage),te(t.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedby",w["validation-message"]),J(o),$(o,w.inputerror))},resetValidationMessage:function(){var e=Ee.domCache.get(this);e.validationMessage&&ne(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),G(t,w.inputerror))},getProgressSteps:function(){return Ee.domCache.get(this).progressSteps},update:function(t){var e=P(),n=Ee.innerParams.get(this);if(!e||K(e,n.hideClass.popup))return r("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const o={};Object.keys(t).forEach(e=>{b(e)?o[e]=t[e]:r('Invalid parameter to update: "'.concat(e,'". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md'))}),n=Object.assign({},n,o),Ze(this,n),Ee.innerParams.set(this,n),Object.defineProperties(this,{params:{value:Object.assign({},this.params,t),writable:!1,enumerable:!0}})},_destroy:function(){var e=Ee.domCache.get(this);const t=Ee.innerParams.get(this);t?(e.popup&&de.swalCloseEventFinishedCallback&&(de.swalCloseEventFinishedCallback(),delete de.swalCloseEventFinishedCallback),de.deferDisposalTimer&&(clearTimeout(de.deferDisposalTimer),delete de.deferDisposalTimer),"function"==typeof t.didDestroy&&t.didDestroy(),e=this,an(e),delete e.params,delete de.keydownHandler,delete de.keydownTarget,delete de.currentInstance):an(this)}});let sn;class cn{constructor(){if("undefined"!=typeof window){sn=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o=Object.freeze(this.constructor.argsToParams(t));Object.defineProperties(this,{params:{value:o,writable:!1,enumerable:!0,configurable:!0}});o=this._main(this.params);Ee.promise.set(this,o)}}_main(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};v(Object.assign({},t,e)),de.currentInstance&&(de.currentInstance._destroy(),R()&&$e()),de.currentInstance=this;e=un(e,t);ct(e),Object.freeze(e),de.timeout&&(de.timeout.stop(),delete de.timeout),clearTimeout(de.restoreFocusTimeout);t=dn(this);return Ze(this,e),Ee.innerParams.set(this,e),ln(this,t,e)}then(e){const t=Ee.promise.get(this);return t.then(e)}finally(e){const t=Ee.promise.get(this);return t.finally(e)}}const ln=(r,s,c)=>new Promise((e,t)=>{const n=e=>{r.closePopup({isDismissed:!0,dismiss:e})};var o,i,a;Xt.swalPromiseResolve.set(r,e),Xt.swalPromiseReject.set(r,t),s.confirmButton.onclick=()=>(e=>{var t=Ee.innerParams.get(e);e.disableButtons(),t.input?xt(e,"confirm"):Lt(e,!0)})(r),s.denyButton.onclick=()=>(e=>{var t=Ee.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?xt(e,"deny"):Et(e,!1)})(r),s.cancelButton.onclick=()=>((e,t)=>{e.disableButtons(),t(Je.cancel)})(r,n),s.closeButton.onclick=()=>n(Je.close),o=r,e=s,t=n,Ee.innerParams.get(o).toast?Ot(o,e,t):(Mt(e),Dt(e),Ht(o,e,t)),i=r,e=de,t=c,a=n,e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1),t.toast||(e.keydownHandler=e=>Ft(i,e,a),e.keydownTarget=t.keydownListenerCapture?window:P(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0),t=r,"select"===(e=c).input||"radio"===e.input?Ct(t,e):["text","email","number","tel","textarea"].includes(e.input)&&(l(e.inputValue)||d(e.inputValue))&&(wt(j()),At(t,e)),(e=>{const t=A(),n=P();"function"==typeof e.willOpen&&e.willOpen(n);var o=window.getComputedStyle(document.body).overflowY;vt(t,n,e),setTimeout(()=>{bt(t,n)},ht),R()&&(yt(t,e.scrollbarPadding,o),Xe()),U()||de.previousActiveElement||(de.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout(()=>e.didOpen(n)),G(t,w["no-transition"])})(c),pn(de,c,n),mn(s,c),setTimeout(()=>{s.container.scrollTop=0})}),un=(e,t)=>{var n=(e=>{e="string"==typeof e.template?document.querySelector(e.template):e.template;if(!e)return{};e=e.content;return at(e),Object.assign(Qe(e),et(e),tt(e),nt(e),ot(e),it(e,Ge))})(e);const o=Object.assign({},p,t,n,e);return o.showClass=Object.assign({},p.showClass,o.showClass),o.hideClass=Object.assign({},p.hideClass,o.hideClass),o},dn=e=>{var t={popup:P(),container:A(),actions:I(),confirmButton:j(),denyButton:M(),cancelButton:H(),loader:D(),closeButton:N(),validationMessage:O(),progressSteps:L()};return Ee.domCache.set(e,t),t},pn=(e,t,n)=>{var o=V();ne(o),t.timer&&(e.timeout=new lt(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(te(o),setTimeout(()=>{e.timeout&&e.timeout.running&&z(t.timer)})))},mn=(e,t)=>{if(!t.toast)return c(t.allowEnterKey)?void(gn(e,t)||qt(t,-1,1)):hn()},gn=(e,t)=>t.focusDeny&&ae(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ae(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ae(e.confirmButton))&&(e.confirmButton.focus(),!0),hn=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};Object.assign(cn.prototype,e),Object.assign(cn,Zt),Object.keys(e).forEach(e=>{cn[e]=function(){if(sn)return sn[e](...arguments)}}),cn.DismissReason=Je,cn.version="11.3.2";const fn=cn;return fn.default=fn,fn}),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sweetalert2",
3
- "version": "11.3.1",
3
+ "version": "11.3.2",
4
4
  "repository": "sweetalert2/sweetalert2",
5
5
  "homepage": "https://sweetalert2.github.io/",
6
6
  "description": "A beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes, supported fork of sweetalert",
@@ -78,6 +78,7 @@
78
78
  "lint": "stylelint src/**/*.scss && eslint src test cypress tools *.js *.ts",
79
79
  "build": "gulp build",
80
80
  "test": "cypress run --headless",
81
+ "check-types": "tsc --noEmit -p jsconfig.json",
81
82
  "cypress:open": "cypress open"
82
83
  },
83
84
  "funding": {
package/src/SweetAlert.js CHANGED
@@ -28,6 +28,7 @@ class SweetAlert {
28
28
 
29
29
  currentInstance = this
30
30
 
31
+ // @ts-ignore
31
32
  const outerParams = Object.freeze(this.constructor.argsToParams(args))
32
33
 
33
34
  Object.defineProperties(this, {
@@ -39,6 +40,7 @@ class SweetAlert {
39
40
  }
40
41
  })
41
42
 
43
+ // @ts-ignore
42
44
  const promise = this._main(this.params)
43
45
  privateProps.promise.set(this, promise)
44
46
  }
@@ -202,7 +204,7 @@ const focusButton = (domCache, innerParams) => {
202
204
  }
203
205
 
204
206
  const blurActiveElement = () => {
205
- if (document.activeElement && typeof document.activeElement.blur === 'function') {
207
+ if (document.activeElement instanceof HTMLElement && typeof document.activeElement.blur === 'function') {
206
208
  document.activeElement.blur()
207
209
  }
208
210
  }
@@ -224,6 +226,6 @@ Object.keys(instanceMethods).forEach(key => {
224
226
 
225
227
  SweetAlert.DismissReason = DismissReason
226
228
 
227
- SweetAlert.version = '11.3.1'
229
+ SweetAlert.version = '11.3.2'
228
230
 
229
231
  export default SweetAlert
@@ -1,7 +1,10 @@
1
1
  import * as dom from '../utils/dom/index.js'
2
2
  import privateProps from '../privateProps.js'
3
3
 
4
- // Get input element by specified type or, if type isn't specified, by params.input
4
+ /**
5
+ * Gets the input DOM node, this method works with input parameter.
6
+ * @returns {HTMLElement | null}
7
+ */
5
8
  export function getInput (instance) {
6
9
  const innerParams = privateProps.innerParams.get(instance || this)
7
10
  const domCache = privateProps.domCache.get(instance || this)
@@ -1,7 +1,7 @@
1
1
  import * as dom from '../../src/utils/dom/index.js'
2
2
  import { warn } from '../../src/utils/utils.js'
3
- import sweetAlert from '../sweetalert2.js'
4
3
  import privateProps from '../privateProps.js'
4
+ import { isUpdatableParameter } from '../../src/utils/params.js'
5
5
 
6
6
  /**
7
7
  * Updates popup parameters.
@@ -18,7 +18,7 @@ export function update (params) {
18
18
 
19
19
  // assign valid params from `params` to `defaults`
20
20
  Object.keys(params).forEach(param => {
21
- if (sweetAlert.isUpdatableParameter(param)) {
21
+ if (isUpdatableParameter(param)) {
22
22
  validUpdatableParams[param] = params[param]
23
23
  } else {
24
24
  warn(`Invalid parameter to update: "${param}". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js\n\nIf you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`)
@@ -126,7 +126,7 @@ const handleArrows = (key) => {
126
126
  }
127
127
  const sibling = arrowKeysNextButton.includes(key) ? 'nextElementSibling' : 'previousElementSibling'
128
128
  const buttonToFocus = document.activeElement[sibling]
129
- if (buttonToFocus) {
129
+ if (buttonToFocus instanceof HTMLElement) {
130
130
  buttonToFocus.focus()
131
131
  }
132
132
  }
@@ -22,20 +22,24 @@ const handleToastClick = (instance, domCache, dismissWith) => {
22
22
  // Closing toast by internal click
23
23
  domCache.popup.onclick = () => {
24
24
  const innerParams = privateProps.innerParams.get(instance)
25
- if (
26
- innerParams.showConfirmButton ||
27
- innerParams.showDenyButton ||
28
- innerParams.showCancelButton ||
29
- innerParams.showCloseButton ||
30
- innerParams.timer ||
31
- innerParams.input
32
- ) {
25
+ if (innerParams && (isAnyButtonShown(innerParams) || innerParams.timer || innerParams.input)) {
33
26
  return
34
27
  }
35
28
  dismissWith(DismissReason.close)
36
29
  }
37
30
  }
38
31
 
32
+ /**
33
+ * @param {*} innerParams
34
+ * @returns {boolean}
35
+ */
36
+ const isAnyButtonShown = (innerParams) => {
37
+ return innerParams.showConfirmButton ||
38
+ innerParams.showDenyButton ||
39
+ innerParams.showCancelButton ||
40
+ innerParams.showCloseButton
41
+ }
42
+
39
43
  let ignoreOutsideClick = false
40
44
 
41
45
  const handleModalMousedown = (domCache) => {
@@ -9,7 +9,7 @@ import { swalClasses } from '../utils/classes.js'
9
9
  const showLoading = (buttonToReplace) => {
10
10
  let popup = dom.getPopup()
11
11
  if (!popup) {
12
- Swal.fire()
12
+ new Swal() // eslint-disable-line no-new
13
13
  }
14
14
  popup = dom.getPopup()
15
15
  const loader = dom.getLoader()
@@ -1,6 +1,7 @@
1
1
  import SweetAlert from './SweetAlert.js'
2
2
 
3
3
  const Swal = SweetAlert
4
+ // @ts-ignore
4
5
  Swal.default = Swal
5
6
 
6
7
  export default Swal
@@ -20,7 +20,7 @@ export default class Timer {
20
20
  if (this.running) {
21
21
  this.running = false
22
22
  clearTimeout(this.id)
23
- this.remaining -= new Date() - this.started
23
+ this.remaining -= new Date().getTime() - this.started.getTime()
24
24
  }
25
25
  return this.remaining
26
26
  }
@@ -7,7 +7,14 @@ export const states = {
7
7
  previousBodyPadding: null
8
8
  }
9
9
 
10
- export const setInnerHtml = (elem, html) => { // #1926
10
+ /**
11
+ * Securely set innerHTML of an element
12
+ * https://github.com/sweetalert2/sweetalert2/issues/1926
13
+ *
14
+ * @param {HTMLElement} elem
15
+ * @param {string} html
16
+ */
17
+ export const setInnerHtml = (elem, html) => {
11
18
  elem.textContent = ''
12
19
  if (html) {
13
20
  const parser = new DOMParser()
@@ -21,6 +28,11 @@ export const setInnerHtml = (elem, html) => { // #1926
21
28
  }
22
29
  }
23
30
 
31
+ /**
32
+ * @param {HTMLElement} elem
33
+ * @param {string} className
34
+ * @returns {boolean}
35
+ */
24
36
  export const hasClass = (elem, className) => {
25
37
  if (!className) {
26
38
  return false
@@ -58,6 +70,11 @@ export const applyCustomClass = (elem, params, className) => {
58
70
  }
59
71
  }
60
72
 
73
+ /**
74
+ * @param {HTMLElement} popup
75
+ * @param {string} inputType
76
+ * @returns {HTMLInputElement | null}
77
+ */
61
78
  export const getInput = (popup, inputType) => {
62
79
  if (!inputType) {
63
80
  return null
@@ -66,7 +83,7 @@ export const getInput = (popup, inputType) => {
66
83
  case 'select':
67
84
  case 'textarea':
68
85
  case 'file':
69
- return getChildByClass(popup, swalClasses[inputType])
86
+ return popup.querySelector(`.${swalClasses[inputType]}`)
70
87
  case 'checkbox':
71
88
  return popup.querySelector(`.${swalClasses.checkbox} input`)
72
89
  case 'radio':
@@ -75,10 +92,13 @@ export const getInput = (popup, inputType) => {
75
92
  case 'range':
76
93
  return popup.querySelector(`.${swalClasses.range} input`)
77
94
  default:
78
- return getChildByClass(popup, swalClasses.input)
95
+ return popup.querySelector(`.${swalClasses.input}`)
79
96
  }
80
97
  }
81
98
 
99
+ /**
100
+ * @param {HTMLInputElement} input
101
+ */
82
102
  export const focusInput = (input) => {
83
103
  input.focus()
84
104
 
@@ -91,6 +111,11 @@ export const focusInput = (input) => {
91
111
  }
92
112
  }
93
113
 
114
+ /**
115
+ * @param {HTMLElement | HTMLElement[] | null} target
116
+ * @param {string | string[]} classList
117
+ * @param {boolean} condition
118
+ */
94
119
  export const toggleClass = (target, classList, condition) => {
95
120
  if (!target || !classList) {
96
121
  return
@@ -99,7 +124,7 @@ export const toggleClass = (target, classList, condition) => {
99
124
  classList = classList.split(/\s+/).filter(Boolean)
100
125
  }
101
126
  classList.forEach((className) => {
102
- if (target.forEach) {
127
+ if (Array.isArray(target)) {
103
128
  target.forEach((elem) => {
104
129
  condition ? elem.classList.add(className) : elem.classList.remove(className)
105
130
  })
@@ -109,22 +134,41 @@ export const toggleClass = (target, classList, condition) => {
109
134
  })
110
135
  }
111
136
 
137
+ /**
138
+ * @param {HTMLElement | HTMLElement[] | null} target
139
+ * @param {string | string[]} classList
140
+ */
112
141
  export const addClass = (target, classList) => {
113
142
  toggleClass(target, classList, true)
114
143
  }
115
144
 
145
+ /**
146
+ * @param {HTMLElement | HTMLElement[] | null} target
147
+ * @param {string | string[]} classList
148
+ */
116
149
  export const removeClass = (target, classList) => {
117
150
  toggleClass(target, classList, false)
118
151
  }
119
152
 
153
+ /**
154
+ * @param {HTMLElement} elem
155
+ * @param {string} className
156
+ * @returns {HTMLElement | null}
157
+ */
120
158
  export const getChildByClass = (elem, className) => {
121
- for (let i = 0; i < elem.childNodes.length; i++) {
122
- if (hasClass(elem.childNodes[i], className)) {
123
- return elem.childNodes[i]
159
+ const childNodes = toArray(elem.childNodes)
160
+ for (let i = 0; i < childNodes.length; i++) {
161
+ if (hasClass(childNodes[i], className)) {
162
+ return childNodes[i]
124
163
  }
125
164
  }
126
165
  }
127
166
 
167
+ /**
168
+ * @param {HTMLElement} elem
169
+ * @param {string} property
170
+ * @param {*} value
171
+ */
128
172
  export const applyNumericalStyle = (elem, property, value) => {
129
173
  if (value === `${parseInt(value)}`) {
130
174
  value = parseInt(value)
@@ -136,10 +180,17 @@ export const applyNumericalStyle = (elem, property, value) => {
136
180
  }
137
181
  }
138
182
 
183
+ /**
184
+ * @param {HTMLElement} elem
185
+ * @param {string} display
186
+ */
139
187
  export const show = (elem, display = 'flex') => {
140
188
  elem.style.display = display
141
189
  }
142
190
 
191
+ /**
192
+ * @param {HTMLElement} elem
193
+ */
143
194
  export const hide = (elem) => {
144
195
  elem.style.display = 'none'
145
196
  }
@@ -192,7 +243,7 @@ export const stopTimerProgressBar = () => {
192
243
  timerProgressBar.style.removeProperty('transition')
193
244
  timerProgressBar.style.width = '100%'
194
245
  const timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width)
195
- const timerProgressBarPercent = parseInt(timerProgressBarWidth / timerProgressBarFullWidth * 100)
246
+ const timerProgressBarPercent = timerProgressBarWidth / timerProgressBarFullWidth * 100
196
247
  timerProgressBar.style.removeProperty('transition')
197
248
  timerProgressBar.style.width = `${timerProgressBarPercent}%`
198
249
  }
@@ -2,6 +2,11 @@ import { swalClasses } from '../classes.js'
2
2
  import { uniqueArray, toArray } from '../utils.js'
3
3
  import { isVisible, hasClass } from './domUtils.js'
4
4
 
5
+ /**
6
+ * Gets the popup container which contains the backdrop and the popup itself.
7
+ *
8
+ * @returns {HTMLElement | null}
9
+ */
5
10
  export const getContainer = () => document.body.querySelector(`.${swalClasses.container}`)
6
11
 
7
12
  export const elementBySelector = (selectorString) => {
@@ -3,7 +3,7 @@ import { getContainer, getPopup } from './getters.js'
3
3
  import { addClass, removeClass, getChildByClass, setInnerHtml } from './domUtils.js'
4
4
  import { isNodeEnv } from '../isNodeEnv.js'
5
5
  import { error } from '../utils.js'
6
- import sweetAlert from '../../sweetalert2.js'
6
+ import globalState from '../../globalState.js'
7
7
 
8
8
  const sweetHTML = `
9
9
  <div aria-labelledby="${swalClasses.title}" aria-describedby="${swalClasses['html-container']}" class="${swalClasses.popup}" tabindex="-1">
@@ -60,9 +60,7 @@ const resetOldContainer = () => {
60
60
  }
61
61
 
62
62
  const resetValidationMessage = () => {
63
- if (sweetAlert.isVisible()) {
64
- sweetAlert.resetValidationMessage()
65
- }
63
+ globalState.currentInstance.resetValidationMessage()
66
64
  }
67
65
 
68
66
  const addInputChangeListeners = () => {
@@ -157,8 +157,9 @@ renderInputType.radio = (radio) => {
157
157
  }
158
158
 
159
159
  renderInputType.checkbox = (checkboxContainer, params) => {
160
+ /** @type {HTMLInputElement} */
160
161
  const checkbox = dom.getInput(dom.getPopup(), 'checkbox')
161
- checkbox.value = 1
162
+ checkbox.value = '1'
162
163
  checkbox.id = swalClasses.checkbox
163
164
  checkbox.checked = Boolean(params.inputValue)
164
165
  const label = checkboxContainer.querySelector('span')
@@ -5,6 +5,7 @@ import { swalClasses } from '../utils/classes.js'
5
5
  // Fix iOS scrolling http://stackoverflow.com/q/39626302
6
6
 
7
7
  export const iOSfix = () => {
8
+ // @ts-ignore
8
9
  const iOS = (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)
9
10
  if (iOS && !dom.hasClass(document.body, swalClasses.iosfix)) {
10
11
  const offset = document.body.scrollTop
@@ -152,7 +152,7 @@ const toastIncompatibleParams = [
152
152
 
153
153
  /**
154
154
  * Is valid parameter
155
- * @param {String} paramName
155
+ * @param {string} paramName
156
156
  */
157
157
  export const isValidParameter = (paramName) => {
158
158
  return Object.prototype.hasOwnProperty.call(defaultParams, paramName)
@@ -160,7 +160,7 @@ export const isValidParameter = (paramName) => {
160
160
 
161
161
  /**
162
162
  * Is valid parameter for Swal.update() method
163
- * @param {String} paramName
163
+ * @param {string} paramName
164
164
  */
165
165
  export const isUpdatableParameter = (paramName) => {
166
166
  return updatableParams.indexOf(paramName) !== -1
@@ -168,7 +168,7 @@ export const isUpdatableParameter = (paramName) => {
168
168
 
169
169
  /**
170
170
  * Is deprecated parameter
171
- * @param {String} paramName
171
+ * @param {string} paramName
172
172
  */
173
173
  export const isDeprecatedParameter = (paramName) => {
174
174
  return deprecatedParams[paramName]