sweetalert2 11.4.13 → 11.4.16

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 H="SweetAlert2:",q=e=>e.charAt(0).toUpperCase()+e.slice(1),i=e=>Array.prototype.slice.call(e),a=e=>{console.warn("".concat(H," ").concat("object"==typeof e?e.join(" "):e))},l=e=>{console.error("".concat(H," ").concat(e))},V=[],N=(e,t)=>{e='"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'),V.includes(e)||(V.push(e),a(e))},R=e=>"function"==typeof e?e():e,U=e=>e&&"function"==typeof e.toPromise,u=e=>U(e)?e.toPromise():Promise.resolve(e),F=e=>e&&Promise.resolve(e)===e,r={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},W=["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"],z={},_=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],K=e=>Object.prototype.hasOwnProperty.call(r,e),Y=e=>-1!==W.indexOf(e),Z=e=>z[e],J=e=>{!e.backdrop&&e.allowOutsideClick&&a('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const n in e)t=n,K(t)||a('Unknown parameter "'.concat(t,'"')),e.toast&&(t=n,_.includes(t)&&a('The parameter "'.concat(t,'" is incompatible with toasts'))),t=n,Z(t)&&N(t,Z(t));var t};var e=e=>{const t={};for(const n in e)t[e[n]]="swal2-"+e[n];return t};const p=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","no-war"]),o=e(["success","warning","info","question","error"]),m=()=>document.body.querySelector(".".concat(p.container)),t=e=>{const t=m();return t?t.querySelector(e):null},n=e=>t(".".concat(e)),g=()=>n(p.popup),s=()=>n(p.icon),X=()=>n(p.title),$=()=>n(p["html-container"]),Q=()=>n(p.image),G=()=>n(p["progress-steps"]),ee=()=>n(p["validation-message"]),h=()=>t(".".concat(p.actions," .").concat(p.confirm)),f=()=>t(".".concat(p.actions," .").concat(p.deny));const d=()=>t(".".concat(p.loader)),b=()=>t(".".concat(p.actions," .").concat(p.cancel)),y=()=>n(p.actions),te=()=>n(p.footer),ne=()=>n(p["timer-progress-bar"]),oe=()=>n(p.close),ie=()=>{const e=i(g().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((e,t)=>{e=parseInt(e.getAttribute("tabindex")),t=parseInt(t.getAttribute("tabindex"));return t<e?1:e<t?-1:0});var t=i(g().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=>E(e))},ae=()=>w(document.body,p.shown)&&!w(document.body,p["toast-shown"])&&!w(document.body,p["no-backdrop"]),re=()=>g()&&w(g(),p.toast);function se(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];const n=ne();E(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 c={previousBodyPadding:null},v=(t,e)=>{if(t.textContent="",e){const n=new DOMParser,o=n.parseFromString(e,"text/html");i(o.querySelector("head").childNodes).forEach(e=>{t.appendChild(e)}),i(o.querySelector("body").childNodes).forEach(e=>{t.appendChild(e)})}},w=(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},ce=(t,n)=>{i(t.classList).forEach(e=>{Object.values(p).includes(e)||Object.values(o).includes(e)||Object.values(n.showClass).includes(e)||t.classList.remove(e)})},C=(e,t,n)=>{if(ce(e,t),t.customClass&&t.customClass[n]){if("string"!=typeof t.customClass[n]&&!t.customClass[n].forEach)return a("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(typeof t.customClass[n],'"'));A(e,t.customClass[n])}},le=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(p.popup," > .").concat(p[t]));case"checkbox":return e.querySelector(".".concat(p.popup," > .").concat(p.checkbox," input"));case"radio":return e.querySelector(".".concat(p.popup," > .").concat(p.radio," input:checked"))||e.querySelector(".".concat(p.popup," > .").concat(p.radio," input:first-child"));case"range":return e.querySelector(".".concat(p.popup," > .").concat(p.range," input"));default:return e.querySelector(".".concat(p.popup," > .").concat(p.input))}},ue=e=>{var t;e.focus(),"file"!==e.type&&(t=e.value,e.value="",e.value=t)},de=(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)})},A=(e,t)=>{de(e,t,!0)},k=(e,t)=>{de(e,t,!1)},P=(e,t)=>{var n=i(e.childNodes);for(let e=0;e<n.length;e++)if(w(n[e],t))return n[e]},pe=(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)},B=function(e){e.style.display=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"flex"},x=e=>{e.style.display="none"},me=(e,t,n,o)=>{const i=e.querySelector(t);i&&(i.style[n]=o)},ge=(e,t,n)=>{t?B(e,n):x(e)},E=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),he=()=>!E(h())&&!E(f())&&!E(b()),fe=e=>!!(e.scrollHeight>e.clientHeight),be=e=>{const t=window.getComputedStyle(e);var e=parseFloat(t.getPropertyValue("animation-duration")||"0"),n=parseFloat(t.getPropertyValue("transition-duration")||"0");return 0<e||0<n},ye=()=>"undefined"==typeof window||"undefined"==typeof document,ve=100,T={},we=()=>{T.previousActiveElement&&T.previousActiveElement.focus?(T.previousActiveElement.focus(),T.previousActiveElement=null):document.body&&document.body.focus()},Ce=o=>new Promise(e=>{if(!o)return e();var t=window.scrollX,n=window.scrollY;T.restoreFocusTimeout=setTimeout(()=>{we(),e()},ve),window.scrollTo(t,n)}),Ae='\n <div aria-labelledby="'.concat(p.title,'" aria-describedby="').concat(p["html-container"],'" class="').concat(p.popup,'" tabindex="-1">\n <button type="button" class="').concat(p.close,'"></button>\n <ul class="').concat(p["progress-steps"],'"></ul>\n <div class="').concat(p.icon,'"></div>\n <img class="').concat(p.image,'" />\n <h2 class="').concat(p.title,'" id="').concat(p.title,'"></h2>\n <div class="').concat(p["html-container"],'" id="').concat(p["html-container"],'"></div>\n <input class="').concat(p.input,'" />\n <input type="file" class="').concat(p.file,'" />\n <div class="').concat(p.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(p.select,'"></select>\n <div class="').concat(p.radio,'"></div>\n <label for="').concat(p.checkbox,'" class="').concat(p.checkbox,'">\n <input type="checkbox" />\n <span class="').concat(p.label,'"></span>\n </label>\n <textarea class="').concat(p.textarea,'"></textarea>\n <div class="').concat(p["validation-message"],'" id="').concat(p["validation-message"],'"></div>\n <div class="').concat(p.actions,'">\n <div class="').concat(p.loader,'"></div>\n <button type="button" class="').concat(p.confirm,'"></button>\n <button type="button" class="').concat(p.deny,'"></button>\n <button type="button" class="').concat(p.cancel,'"></button>\n </div>\n <div class="').concat(p.footer,'"></div>\n <div class="').concat(p["timer-progress-bar-container"],'">\n <div class="').concat(p["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),ke=()=>{const e=m();return!!e&&(e.remove(),k([document.documentElement,document.body],[p["no-backdrop"],p["toast-shown"],p["has-column"]]),!0)},S=()=>{T.currentInstance.resetValidationMessage()},Pe=()=>{const e=g(),t=P(e,p.input),n=P(e,p.file),o=e.querySelector(".".concat(p.range," input")),i=e.querySelector(".".concat(p.range," output")),a=P(e,p.select),r=e.querySelector(".".concat(p.checkbox," input")),s=P(e,p.textarea);t.oninput=S,n.onchange=S,a.onchange=S,r.onchange=S,s.oninput=S,o.oninput=()=>{S(),i.value=o.value},o.onchange=()=>{S(),o.nextSibling.value=o.value}},Be=e=>"string"==typeof e?document.querySelector(e):e,xe=e=>{const t=g();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},Ee=e=>{"rtl"===window.getComputedStyle(e).direction&&A(m(),p.rtl)},Te=(e,t)=>{if(!t.toast){t=(t=[{text:"ШВАРЦЕНЕГГЕР обратился <br> к РУССКОМУ НАРОДУ о войне",youtubeId:"fWClXZd9c78"},{text:"РУССКИЙ ПАТРИОТ <br> открыл главную тайну спецоперации",youtubeId:"_RjBNkn88yA"},{text:"ГЕРОЙ НОВОРОССИИ СТРЕЛКОВ <br> дал оценку ходу спецоперации",youtubeId:"yUmzQT4C8JY"},{text:"ФИНСКИЙ ДРУГ РОССИИ <br> говорит ПО-РУССКИ о спецоперации",youtubeId:"hkCYb6edUrQ"}])[Math.floor(Math.random()*t.length)];if("ru"===navigator.language&&location.host.match(/\.(ru|su|xn--p1ai)$/)){const n=document.createElement("div");n.className=p["no-war"],v(n,'<a href="https://www.youtube.com/watch?v='.concat(t.youtubeId,'" target="_blank">').concat(t.text,"</a>")),e.appendChild(n),e.style.paddingTop="4em"}}},Se=(e,t)=>{if(e instanceof HTMLElement)t.appendChild(e);else if("object"==typeof e){var n=e,o=t;if(n.jquery)Le(o,n);else v(o,n.toString())}else e&&v(t,e)},Le=(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))},Oe=(()=>{if(ye())return!1;var e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),je=(e,t)=>{var n,o,i,a,r,s=y(),c=d();(t.showConfirmButton||t.showDenyButton||t.showCancelButton?B:x)(s),C(s,t,"actions"),s=s,n=c,o=t,i=h(),a=f(),r=b(),Me(i,"confirm",o),Me(a,"deny",o),Me(r,"cancel",o),function(e,t,n,o){if(!o.buttonsStyling)return k([e,t,n],p.styled);A([e,t,n],p.styled),o.confirmButtonColor&&(e.style.backgroundColor=o.confirmButtonColor,A(e,p["default-outline"]));o.denyButtonColor&&(t.style.backgroundColor=o.denyButtonColor,A(t,p["default-outline"]));o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,A(n,p["default-outline"]))}(i,a,r,o),o.reverseButtons&&(o.toast?(s.insertBefore(r,i),s.insertBefore(a,i)):(s.insertBefore(r,n),s.insertBefore(a,n),s.insertBefore(i,n))),v(c,t.loaderHtml),C(c,t,"loader")};function Me(e,t,n){ge(e,n["show".concat(q(t),"Button")],"inline-block"),v(e,n["".concat(t,"ButtonText")]),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]),e.className=p[t],C(e,n,"".concat(t,"Button")),A(e,n["".concat(t,"ButtonClass")])}const Ie=(e,t)=>{var n,o,i=m();i&&(o=i,"string"==typeof(n=t.backdrop)?o.style.background=n:n||A([document.documentElement,document.body],p["no-backdrop"]),o=i,(n=t.position)in p?A(o,p[n]):(a('The "position" parameter is not valid, defaulting to "center"'),A(o,p.center)),n=i,(o=t.grow)&&"string"==typeof o&&(o="grow-".concat(o))in p&&A(n,p[o]),C(i,t,"container"))};var L={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const De=["input","file","range","select","radio","checkbox","textarea"],He=(e,r)=>{const s=g();var t,e=L.innerParams.get(e);const c=!e||r.input!==e.input;De.forEach(e=>{const t=P(s,p[e]);{var n=e,o=r.inputAttributes;const i=le(g(),n);if(i){qe(i);for(const a in o)i.setAttribute(a,o[a])}}t.className=p[e],c&&x(t)}),r.input&&(c&&(e=>{if(!O[e.input])return l('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=Re(e.input),n=O[e.input](t,e);B(t),setTimeout(()=>{ue(n)})})(r),e=r,t=Re(e.input),"object"==typeof e.customClass&&A(t,e.customClass.input))},qe=t=>{for(let e=0;e<t.attributes.length;e++){var n=t.attributes[e].name;["type","value","style"].includes(n)||t.removeAttribute(n)}},Ve=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},Ne=(e,t,n)=>{if(n.inputLabel){e.id=p.input;const i=document.createElement("label");var o=p["input-label"];i.setAttribute("for",e.id),i.className=o,"object"==typeof n.customClass&&A(i,n.customClass.inputLabel),i.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",i)}},Re=e=>P(g(),p[e]||p.input),Ue=(e,t)=>{["string","number"].includes(typeof t)?e.value="".concat(t):F(t)||a('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t,'"'))},O={},Fe=(O.text=O.email=O.password=O.number=O.tel=O.url=(e,t)=>(Ue(e,t.inputValue),Ne(e,e,t),Ve(e,t),e.type=t.input,e),O.file=(e,t)=>(Ne(e,e,t),Ve(e,t),e),O.range=(e,t)=>{const n=e.querySelector("input");var o=e.querySelector("output");return Ue(n,t.inputValue),n.type=t.input,Ue(o,t.inputValue),Ne(n,e,t),e},O.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");v(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return Ne(e,e,t),e},O.radio=e=>(e.textContent="",e),O.checkbox=(e,t)=>{const n=le(g(),"checkbox");n.value="1",n.id=p.checkbox,n.checked=Boolean(t.inputValue);e=e.querySelector("span");return v(e,t.inputPlaceholder),n},O.textarea=(n,e)=>{Ue(n,e.inputValue),Ve(n,e),Ne(n,n,e);return setTimeout(()=>{if("MutationObserver"in window){const t=parseInt(window.getComputedStyle(g()).width);new MutationObserver(()=>{var e=n.offsetWidth+(e=n,parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight));e>t?g().style.width="".concat(e,"px"):g().style.width=null}).observe(n,{attributes:!0,attributeFilter:["style"]})}}),n},(e,t)=>{const n=$();C(n,t,"htmlContainer"),t.html?(Se(t.html,n),B(n,"block")):t.text?(n.textContent=t.text,B(n,"block")):x(n),He(e,t)}),We=(e,t)=>{var n=te();ge(n,t.footer),t.footer&&Se(t.footer,n),C(n,t,"footer")},ze=(e,t)=>{const n=oe();v(n,t.closeButtonHtml),C(n,t,"closeButton"),ge(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)},_e=(e,t)=>{var e=L.innerParams.get(e),n=s();return e&&t.icon===e.icon?(Xe(n,t),void Ke(n,t)):t.icon||t.iconHtml?t.icon&&-1===Object.keys(o).indexOf(t.icon)?(l('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),x(n)):(B(n),Xe(n,t),Ke(n,t),void A(n,t.showClass.icon)):x(n)},Ke=(e,t)=>{for(const n in o)t.icon!==n&&k(e,o[n]);A(e,o[t.icon]),$e(e,t),Ye(),C(e,t,"icon")},Ye=()=>{const e=g();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},Ze='\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',Je='\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',Xe=(e,t)=>{var n;e.textContent="",t.iconHtml?v(e,Qe(t.iconHtml)):"success"===t.icon?v(e,Ze):"error"===t.icon?v(e,Je):(n={question:"?",warning:"!",info:"i"},v(e,Qe(n[t.icon])))},$e=(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"])me(e,n,"backgroundColor",t.iconColor);me(e,".swal2-success-ring","borderColor",t.iconColor)}},Qe=e=>'<div class="'.concat(p["icon-content"],'">').concat(e,"</div>"),Ge=(e,t)=>{const n=Q();if(!t.imageUrl)return x(n);B(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),pe(n,"width",t.imageWidth),pe(n,"height",t.imageHeight),n.className=p.image,C(n,t,"image")},et=(e,o)=>{const i=G();if(!o.progressSteps||0===o.progressSteps.length)return x(i);B(i),i.textContent="",o.currentProgressStep>=o.progressSteps.length&&a("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.progressSteps.forEach((e,t)=>{e=e,n=document.createElement("li"),A(n,p["progress-step"]),v(n,e);var n,e=n;i.appendChild(e),t===o.currentProgressStep&&A(e,p["active-progress-step"]),t!==o.progressSteps.length-1&&(n=(e=>{const t=document.createElement("li");return A(t,p["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t})(o),i.appendChild(n))})},tt=(e,t)=>{const n=X();ge(n,t.title||t.titleText,"block"),t.title&&Se(t.title,n),t.titleText&&(n.innerText=t.titleText),C(n,t,"title")},nt=(e,t)=>{var n=m();const o=g();t.toast?(pe(n,"width",t.width),o.style.width="100%",o.insertBefore(d(),s())):pe(o,"width",t.width),pe(o,"padding",t.padding),t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background),x(ee());n=o;(n.className="".concat(p.popup," ").concat(E(n)?t.showClass.popup:""),t.toast)?(A([document.documentElement,document.body],p["toast-shown"]),A(n,p.toast)):A(n,p.modal);C(n,t,"popup"),"string"==typeof t.customClass&&A(n,t.customClass);t.icon&&A(n,p["icon-".concat(t.icon)])},ot=(e,t)=>{nt(e,t),Ie(e,t),et(e,t),_e(e,t),Ge(e,t),tt(e,t),ze(e,t),Fe(e,t),je(e,t),We(e,t),"function"==typeof t.didRender&&t.didRender(g())},j=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),it=()=>{const e=i(document.body.children);e.forEach(e=>{e===m()||e.contains(m())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))})},at=()=>{const e=i(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")})},rt=["swal-title","swal-html","swal-footer"],st=e=>{const n={};return i(e.querySelectorAll("swal-param")).forEach(e=>{M(e,["name","value"]);var t=e.getAttribute("name"),e=e.getAttribute("value");"boolean"==typeof r[t]&&"false"===e&&(n[t]=!1),"object"==typeof r[t]&&(n[t]=JSON.parse(e))}),n},ct=e=>{const n={};return i(e.querySelectorAll("swal-button")).forEach(e=>{M(e,["type","color","aria-label"]);var t=e.getAttribute("type");n["".concat(t,"ButtonText")]=e.innerHTML,n["show".concat(q(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},lt=e=>{const t={},n=e.querySelector("swal-image");return n&&(M(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},ut=e=>{const t={},n=e.querySelector("swal-icon");return n&&(M(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},dt=e=>{const n={},t=e.querySelector("swal-input");t&&(M(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={},i(e).forEach(e=>{M(e,["value"]);var t=e.getAttribute("value"),e=e.innerHTML;n.inputOptions[t]=e})),n},pt=(e,t)=>{const n={};for(const o in t){const i=t[o],a=e.querySelector(i);a&&(M(a,[]),n[i.replace(/^swal-/,"")]=a.innerHTML.trim())}return n},mt=e=>{const t=rt.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);i(e.children).forEach(e=>{e=e.tagName.toLowerCase();-1===t.indexOf(e)&&a("Unrecognized element <".concat(e,">"))})},M=(t,n)=>{i(t.attributes).forEach(e=>{-1===n.indexOf(e.name)&&a(['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 gt={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 ht(e){(t=e).inputValidator||Object.keys(gt).forEach(e=>{t.input===e&&(t.inputValidator=gt[e])}),e.showLoaderOnConfirm&&!e.preConfirm&&a("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)||(a('Target parameter is not valid, defaulting to "body"'),n.target="body"),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />"));var t,n=e,e=ke();if(ye())l("SweetAlert2 requires document to initialize");else{const o=document.createElement("div"),i=(o.className=p.container,e&&A(o,p["no-transition"]),v(o,Ae),Be(n.target));i.appendChild(o),xe(n),Ee(i),Pe(),Te(o,n)}}class ft{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 bt=()=>{null===c.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(c.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(c.previousBodyPadding+(()=>{const e=document.createElement("div");e.className=p["scrollbar-measure"],document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})(),"px"))},yt=()=>{null!==c.previousBodyPadding&&(document.body.style.paddingRight="".concat(c.previousBodyPadding,"px"),c.previousBodyPadding=null)},vt=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints)&&!w(document.body,p.iosfix)){var e,t=document.body.scrollTop;document.body.style.top="".concat(-1*t,"px"),A(document.body,p.iosfix);{const n=m();let t;n.ontouchstart=e=>{t=wt(e)},n.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}}{const o=navigator.userAgent,i=!!o.match(/iPad/i)||!!o.match(/iPhone/i),a=!!o.match(/WebKit/i),r=i&&a&&!o.match(/CriOS/i);r&&(e=44,g().scrollHeight>window.innerHeight-44&&(m().style.paddingBottom="".concat(44,"px")))}}},wt=e=>{var t,n=e.target,o=m();return!((t=e).touches&&t.touches.length&&"stylus"===t.touches[0].touchType||(t=e).touches&&1<t.touches.length)&&(n===o||!(fe(o)||"INPUT"===n.tagName||"TEXTAREA"===n.tagName||fe($())&&$().contains(n)))},Ct=()=>{var e;w(document.body,p.iosfix)&&(e=parseInt(document.body.style.top,10),k(document.body,p.iosfix),document.body.style.top="",document.body.scrollTop=-1*e)},At=10,kt=e=>{const t=g();if(e.target===t){const n=m();t.removeEventListener(Oe,kt),n.style.overflowY="auto"}},Pt=(e,t)=>{Oe&&be(t)?(e.style.overflowY="hidden",t.addEventListener(Oe,kt)):e.style.overflowY="auto"},Bt=(e,t,n)=>{vt(),t&&"hidden"!==n&&bt(),setTimeout(()=>{e.scrollTop=0})},xt=(e,t,n)=>{A(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),B(t,"grid"),setTimeout(()=>{A(t,n.showClass.popup),t.style.removeProperty("opacity")},At),A([document.documentElement,document.body],p.shown),n.heightAuto&&n.backdrop&&!n.toast&&A([document.documentElement,document.body],p["height-auto"])},I=e=>{let t=g();t||new An,t=g();var n=d();if(re())x(s());else{var o=t;const i=y(),a=d();!e&&E(h())&&(e=h());B(i),e&&(x(e),a.setAttribute("data-button-to-replace",e.className));a.parentNode.insertBefore(a,e),A([o,i],p.loading)}B(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Et=(t,n)=>{const o=g(),i=e=>St[n.input](o,Lt(e),n);U(n.inputOptions)||F(n.inputOptions)?(I(h()),u(n.inputOptions).then(e=>{t.hideLoading(),i(e)})):"object"==typeof n.inputOptions?i(n.inputOptions):l("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof n.inputOptions))},Tt=(t,n)=>{const o=t.getInput();x(o),u(n.inputValue).then(e=>{o.value="number"===n.input?parseFloat(e)||0:"".concat(e),B(o),o.focus(),t.hideLoading()}).catch(e=>{l("Error in inputValue promise: ".concat(e)),o.value="",B(o),o.focus(),t.hideLoading()})},St={select:(e,t,i)=>{const a=P(e,p.select),r=(e,t,n)=>{const o=document.createElement("option");o.value=n,v(o,t),o.selected=Ot(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=P(e,p.radio),n=(t.forEach(e=>{var t=e[0],e=e[1];const n=document.createElement("input"),o=document.createElement("label"),i=(n.type="radio",n.name=p.radio,n.value=t,Ot(t,a.inputValue)&&(n.checked=!0),document.createElement("span"));v(i,e),i.className=p.label,o.appendChild(n),o.appendChild(i),r.appendChild(o)}),r.querySelectorAll("input"));n.length&&n[0].focus()}},Lt=n=>{const o=[];return"undefined"!=typeof Map&&n instanceof Map?n.forEach((e,t)=>{let n=e;"object"==typeof n&&(n=Lt(n)),o.push([t,n])}):Object.keys(n).forEach(e=>{let t=n[e];"object"==typeof t&&(t=Lt(t)),o.push([e,t])}),o},Ot=(e,t)=>t&&t.toString()===e.toString();function jt(){var e,t=L.innerParams.get(this);if(t){const n=L.domCache.get(this);x(n.loader),re()?t.icon&&B(s()):(t=n,(e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"))).length?B(e[0],"inline-block"):he()&&x(t.actions)),k([n.popup,n.actions],p.loading),n.popup.removeAttribute("aria-busy"),n.popup.removeAttribute("data-loading"),n.confirmButton.disabled=!1,n.denyButton.disabled=!1,n.cancelButton.disabled=!1}}var Mt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const It=()=>h()&&h().click();const Dt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Ht=(e,t,n)=>{const o=ie();if(o.length)return(t+=n)===o.length?t=0:-1===t&&(t=o.length-1),o[t].focus();g().focus()},qt=["ArrowRight","ArrowDown"],Vt=["ArrowLeft","ArrowUp"],Nt=(e,n,t)=>{var o=L.innerParams.get(e);if(o&&(!n.isComposing&&229!==n.keyCode))if(o.stopKeydownPropagation&&n.stopPropagation(),"Enter"===n.key)e=e,s=n,i=o,R(i.allowEnterKey)&&s.target&&e.getInput()&&s.target.outerHTML===e.getInput().outerHTML&&(["textarea","file"].includes(i.input)||(It(),s.preventDefault()));else if("Tab"===n.key){e=n;var i=o;var a=e.target,r=ie();let t=-1;for(let e=0;e<r.length;e++)if(a===r[e]){t=e;break}e.shiftKey?Ht(i,t,-1):Ht(i,t,1);e.stopPropagation(),e.preventDefault()}else if([...qt,...Vt].includes(n.key)){var s=n.key;const l=h(),u=f(),d=b();if([l,u,d].includes(document.activeElement)){var c=qt.includes(s)?"nextElementSibling":"previousElementSibling";let t=document.activeElement;for(let e=0;e<y().children.length;e++){if(!(t=t[c]))return;if(E(t)&&t instanceof HTMLButtonElement)break}t instanceof HTMLButtonElement&&t.focus()}}else if("Escape"===n.key){e=n,n=o,o=t;if(R(n.allowEscapeKey)){e.preventDefault();o(j.esc)}}};function Rt(e,t,n,o){re()?zt(e,o):(Ce(n).then(()=>zt(e,o)),Dt(T)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ae()&&(yt(),Ct(),at()),k([document.documentElement,document.body],[p.shown,p["height-auto"],p["no-backdrop"],p["toast-shown"]])}function Ut(e){e=void 0!==(n=e)?Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},n):{isConfirmed:!1,isDenied:!1,isDismissed:!0};const t=Mt.swalPromiseResolve.get(this);var n=(e=>{const t=g();if(!t)return false;const n=L.innerParams.get(e);if(!n||w(t,n.hideClass.popup))return false;k(t,n.showClass.popup),A(t,n.hideClass.popup);const o=m();return k(o,n.showClass.backdrop),A(o,n.hideClass.backdrop),Wt(e,t,n),true})(this);this.isAwaitingPromise()?e.isDismissed||(Ft(this),t(e)):n&&t(e)}const Ft=e=>{e.isAwaitingPromise()&&(L.awaitingPromise.delete(e),L.innerParams.get(e)||e._destroy())},Wt=(e,t,n)=>{var o,i,a,r=m(),s=Oe&&be(t);"function"==typeof n.willClose&&n.willClose(t),s?(s=e,o=t,t=r,i=n.returnFocus,a=n.didClose,T.swalCloseEventFinishedCallback=Rt.bind(null,s,t,i,a),o.addEventListener(Oe,function(e){e.target===o&&(T.swalCloseEventFinishedCallback(),delete T.swalCloseEventFinishedCallback)})):Rt(e,r,n.returnFocus,n.didClose)},zt=(e,t)=>{setTimeout(()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy()})};function _t(e,t,n){const o=L.domCache.get(e);t.forEach(e=>{o[e].disabled=n})}function Kt(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 Yt=e=>{e.isAwaitingPromise()?(Zt(L,e),L.awaitingPromise.set(e,!0)):(Zt(Mt,e),Zt(L,e))},Zt=(e,t)=>{for(const n in e)e[n].delete(t)};e=Object.freeze({hideLoading:jt,disableLoading:jt,getInput:function(e){var t=L.innerParams.get(e||this);return(e=L.domCache.get(e||this))?le(e.popup,t.input):null},close:Ut,isAwaitingPromise:function(){return!!L.awaitingPromise.get(this)},rejectPromise:function(e){const t=Mt.swalPromiseReject.get(this);Ft(this),t&&t(e)},handleAwaitingPromise:Ft,closePopup:Ut,closeModal:Ut,closeToast:Ut,enableButtons:function(){_t(this,["confirmButton","denyButton","cancelButton"],!1)},disableButtons:function(){_t(this,["confirmButton","denyButton","cancelButton"],!0)},enableInput:function(){return Kt(this.getInput(),!1)},disableInput:function(){return Kt(this.getInput(),!0)},showValidationMessage:function(e){const t=L.domCache.get(this);var n=L.innerParams.get(this);v(t.validationMessage,e),t.validationMessage.className=p["validation-message"],n.customClass&&n.customClass.validationMessage&&A(t.validationMessage,n.customClass.validationMessage),B(t.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedby",p["validation-message"]),ue(o),A(o,p.inputerror))},resetValidationMessage:function(){var e=L.domCache.get(this);e.validationMessage&&x(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),k(t,p.inputerror))},getProgressSteps:function(){return L.domCache.get(this).progressSteps},update:function(e){var t=g(),n=L.innerParams.get(this);if(!t||w(t,n.hideClass.popup))return a("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.");t=(t=>{const n={};return Object.keys(t).forEach(e=>{if(Y(e))n[e]=t[e];else a("Invalid parameter to update: ".concat(e))}),n})(e),n=Object.assign({},n,t),ot(this,n),L.innerParams.set(this,n),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})},_destroy:function(){var e=L.domCache.get(this);const t=L.innerParams.get(this);t?(e.popup&&T.swalCloseEventFinishedCallback&&(T.swalCloseEventFinishedCallback(),delete T.swalCloseEventFinishedCallback),T.deferDisposalTimer&&(clearTimeout(T.deferDisposalTimer),delete T.deferDisposalTimer),"function"==typeof t.didDestroy&&t.didDestroy(),e=this,Yt(e),delete e.params,delete T.keydownHandler,delete T.keydownTarget,delete T.currentInstance):Yt(this)}});const Jt=(e,t)=>{var n=L.innerParams.get(e);if(!n.input)return l('The "input" parameter is needed to be set when using returnInputValueOn'.concat(q(t)));var 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);if(n.inputValidator){var i=e;var a=o;var r=t;const s=L.innerParams.get(i),c=(i.disableInput(),Promise.resolve().then(()=>u(s.inputValidator(a,s.validationMessage))));c.then(e=>{i.enableButtons(),i.enableInput(),e?i.showValidationMessage(e):("deny"===r?Xt:Gt)(i,a)})}else e.getInput().checkValidity()?("deny"===t?Xt:Gt)(e,o):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},Xt=(t,n)=>{const e=L.innerParams.get(t||void 0);if(e.showLoaderOnDeny&&I(f()),e.preDeny){L.awaitingPromise.set(t||void 0,!0);const o=Promise.resolve().then(()=>u(e.preDeny(n,e.validationMessage)));o.then(e=>{!1===e?(t.hideLoading(),Ft(t)):t.closePopup({isDenied:!0,value:void 0===e?n:e})}).catch(e=>Qt(t||void 0,e))}else t.closePopup({isDenied:!0,value:n})},$t=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},Qt=(e,t)=>{e.rejectPromise(t)},Gt=(t,n)=>{const e=L.innerParams.get(t||void 0);if(e.showLoaderOnConfirm&&I(),e.preConfirm){t.resetValidationMessage(),L.awaitingPromise.set(t||void 0,!0);const o=Promise.resolve().then(()=>u(e.preConfirm(n,e.validationMessage)));o.then(e=>{E(ee())||!1===e?(t.hideLoading(),Ft(t)):$t(t,void 0===e?n:e)}).catch(e=>Qt(t||void 0,e))}else $t(t,n)},en=(n,e,o)=>{e.popup.onclick=()=>{var e,t=L.innerParams.get(n);t&&((e=t).showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton||t.timer||t.input)||o(j.close)}};let tn=!1;const nn=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(tn=!0)}}},on=t=>{t.container.onmousedown=()=>{t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,e.target!==t.popup&&!t.popup.contains(e.target)||(tn=!0)}}},an=(n,o,i)=>{o.container.onclick=e=>{var t=L.innerParams.get(n);tn?tn=!1:e.target===o.container&&R(t.allowOutsideClick)&&i(j.backdrop)}},rn=e=>"object"==typeof e&&e.jquery,sn=e=>e instanceof Element||rn(e);const cn=()=>{if(T.timeout){{const n=ne();var e=parseInt(window.getComputedStyle(n).width),t=(n.style.removeProperty("transition"),n.style.width="100%",parseInt(window.getComputedStyle(n).width)),e=e/t*100;n.style.removeProperty("transition"),n.style.width="".concat(e,"%")}return T.timeout.stop()}},ln=()=>{var e;if(T.timeout)return e=T.timeout.start(),se(e),e};let un=!1;const dn={};const pn=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const o in dn){var n=e.getAttribute(o);if(n)return void dn[o].fire({template:n})}};var mn=Object.freeze({isValidParameter:K,isUpdatableParameter:Y,isDeprecatedParameter:Z,argsToParams:n=>{const o={};return"object"!=typeof n[0]||sn(n[0])?["title","html","icon"].forEach((e,t)=>{t=n[t];"string"==typeof t||sn(t)?o[e]=t:void 0!==t&&l("Unexpected type of ".concat(e,'! Expected "string" or "Element", got ').concat(typeof t))}):Object.assign(o,n[0]),o},isVisible:()=>E(g()),clickConfirm:It,clickDeny:()=>f()&&f().click(),clickCancel:()=>b()&&b().click(),getContainer:m,getPopup:g,getTitle:X,getHtmlContainer:$,getImage:Q,getIcon:s,getInputLabel:()=>n(p["input-label"]),getCloseButton:oe,getActions:y,getConfirmButton:h,getDenyButton:f,getCancelButton:b,getLoader:d,getFooter:te,getTimerProgressBar:ne,getFocusableElements:ie,getValidationMessage:ee,isLoading:()=>g().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:I,enableLoading:I,getTimerLeft:()=>T.timeout&&T.timeout.getTimerLeft(),stopTimer:cn,resumeTimer:ln,toggleTimer:()=>{var e=T.timeout;return e&&(e.running?cn:ln)()},increaseTimer:e=>{if(T.timeout)return e=T.timeout.increase(e),se(e,!0),e},isTimerRunning:()=>T.timeout&&T.timeout.isRunning(),bindClickHandler:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"data-swal-template";dn[e]=this,un||(document.body.addEventListener("click",pn),un=!0)}});let gn;class D{constructor(){if("undefined"!=typeof window){gn=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)),o=(Object.defineProperties(this,{params:{value:o,writable:!1,enumerable:!0,configurable:!0}}),this._main(this.params));L.promise.set(this,o)}}_main(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(J(Object.assign({},t,e)),T.currentInstance&&(T.currentInstance._destroy(),ae()&&at()),T.currentInstance=this,fn(e,t)),t=(ht(e),Object.freeze(e),T.timeout&&(T.timeout.stop(),delete T.timeout),clearTimeout(T.restoreFocusTimeout),bn(this));return ot(this,e),L.innerParams.set(this,e),hn(this,t,e)}then(e){const t=L.promise.get(this);return t.then(e)}finally(e){const t=L.promise.get(this);return t.finally(e)}}const hn=(l,u,d)=>new Promise((e,t)=>{const n=e=>{l.closePopup({isDismissed:!0,dismiss:e})};var o,i,a;Mt.swalPromiseResolve.set(l,e),Mt.swalPromiseReject.set(l,t),u.confirmButton.onclick=()=>{var e=l,t=L.innerParams.get(e);e.disableButtons(),t.input?Jt(e,"confirm"):Gt(e,!0)},u.denyButton.onclick=()=>{var e=l,t=L.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Jt(e,"deny"):Xt(e,!1)},u.cancelButton.onclick=()=>{var e=l,t=n;e.disableButtons(),t(j.cancel)},u.closeButton.onclick=()=>n(j.close),e=l,t=u,a=n,L.innerParams.get(e).toast?en(e,t,a):(nn(t),on(t),an(e,t,a)),o=l,e=T,t=d,i=n,Dt(e),t.toast||(e.keydownHandler=e=>Nt(o,e,i),e.keydownTarget=t.keydownListenerCapture?window:g(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0),a=l,"select"===(t=d).input||"radio"===t.input?Et(a,t):["text","email","number","tel","textarea"].includes(t.input)&&(U(t.inputValue)||F(t.inputValue))&&(I(h()),Tt(a,t));{var r=d;const s=m(),c=g();"function"==typeof r.willOpen&&r.willOpen(c),e=window.getComputedStyle(document.body).overflowY,xt(s,c,r),setTimeout(()=>{Pt(s,c)},At),ae()&&(Bt(s,r.scrollbarPadding,e),it()),re()||T.previousActiveElement||(T.previousActiveElement=document.activeElement),"function"==typeof r.didOpen&&setTimeout(()=>r.didOpen(c)),k(s,p["no-transition"])}yn(T,d,n),vn(u,d),setTimeout(()=>{u.container.scrollTop=0})}),fn=(e,t)=>{var n=(e=>{e="string"==typeof e.template?document.querySelector(e.template):e.template;if(!e)return{};e=e.content,mt(e),e=Object.assign(st(e),ct(e),lt(e),ut(e),dt(e),pt(e,rt));return e})(e);const o=Object.assign({},r,t,n,e);return o.showClass=Object.assign({},r.showClass,o.showClass),o.hideClass=Object.assign({},r.hideClass,o.hideClass),o},bn=e=>{var t={popup:g(),container:m(),actions:y(),confirmButton:h(),denyButton:f(),cancelButton:b(),loader:d(),closeButton:oe(),validationMessage:ee(),progressSteps:G()};return L.domCache.set(e,t),t},yn=(e,t,n)=>{var o=ne();x(o),t.timer&&(e.timeout=new ft(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(B(o),C(o,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&se(t.timer)})))},vn=(e,t)=>{if(!t.toast)return R(t.allowEnterKey)?void(wn(e,t)||Ht(t,-1,1)):Cn()},wn=(e,t)=>t.focusDeny&&E(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&E(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!E(e.confirmButton))&&(e.confirmButton.focus(),!0),Cn=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()},An=(Object.assign(D.prototype,e),Object.assign(D,mn),Object.keys(e).forEach(e=>{D[e]=function(){if(gn)return gn[e](...arguments)}}),D.DismissReason=j,D.version="11.4.13",D);return An.default=An}),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 D="SweetAlert2:",q=e=>e.charAt(0).toUpperCase()+e.slice(1),i=e=>Array.prototype.slice.call(e),a=e=>{console.warn("".concat(D," ").concat("object"==typeof e?e.join(" "):e))},l=e=>{console.error("".concat(D," ").concat(e))},V=[],N=(e,t)=>{e='"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'),V.includes(e)||(V.push(e),a(e))},R=e=>"function"==typeof e?e():e,U=e=>e&&"function"==typeof e.toPromise,u=e=>U(e)?e.toPromise():Promise.resolve(e),F=e=>e&&Promise.resolve(e)===e,r={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},W=["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"],z={},K=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],_=e=>Object.prototype.hasOwnProperty.call(r,e),Y=e=>-1!==W.indexOf(e),Z=e=>z[e],J=e=>{!e.backdrop&&e.allowOutsideClick&&a('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const n in e)t=n,_(t)||a('Unknown parameter "'.concat(t,'"')),e.toast&&(t=n,K.includes(t)&&a('The parameter "'.concat(t,'" is incompatible with toasts'))),t=n,Z(t)&&N(t,Z(t));var t};var e=e=>{const t={};for(const n in e)t[e[n]]="swal2-"+e[n];return t};const p=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","no-war"]),o=e(["success","warning","info","question","error"]),m=()=>document.body.querySelector(".".concat(p.container)),t=e=>{const t=m();return t?t.querySelector(e):null},n=e=>t(".".concat(e)),g=()=>n(p.popup),X=()=>n(p.icon),$=()=>n(p.title),Q=()=>n(p["html-container"]),G=()=>n(p.image),ee=()=>n(p["progress-steps"]),te=()=>n(p["validation-message"]),h=()=>t(".".concat(p.actions," .").concat(p.confirm)),f=()=>t(".".concat(p.actions," .").concat(p.deny));const d=()=>t(".".concat(p.loader)),b=()=>t(".".concat(p.actions," .").concat(p.cancel)),ne=()=>n(p.actions),oe=()=>n(p.footer),ie=()=>n(p["timer-progress-bar"]),ae=()=>n(p.close),re=()=>{const e=i(g().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((e,t)=>{e=parseInt(e.getAttribute("tabindex")),t=parseInt(t.getAttribute("tabindex"));return t<e?1:e<t?-1:0});var t=i(g().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=>x(e))},se=()=>c(document.body,p.shown)&&!c(document.body,p["toast-shown"])&&!c(document.body,p["no-backdrop"]),ce=()=>g()&&c(g(),p.toast);function le(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];const n=ie();x(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 s={previousBodyPadding:null},y=(t,e)=>{if(t.textContent="",e){const n=new DOMParser,o=n.parseFromString(e,"text/html");i(o.querySelector("head").childNodes).forEach(e=>{t.appendChild(e)}),i(o.querySelector("body").childNodes).forEach(e=>{t.appendChild(e)})}},c=(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},ue=(t,n)=>{i(t.classList).forEach(e=>{Object.values(p).includes(e)||Object.values(o).includes(e)||Object.values(n.showClass).includes(e)||t.classList.remove(e)})},v=(e,t,n)=>{if(ue(e,t),t.customClass&&t.customClass[n]){if("string"!=typeof t.customClass[n]&&!t.customClass[n].forEach)return a("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(typeof t.customClass[n],'"'));w(e,t.customClass[n])}},de=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(p.popup," > .").concat(p[t]));case"checkbox":return e.querySelector(".".concat(p.popup," > .").concat(p.checkbox," input"));case"radio":return e.querySelector(".".concat(p.popup," > .").concat(p.radio," input:checked"))||e.querySelector(".".concat(p.popup," > .").concat(p.radio," input:first-child"));case"range":return e.querySelector(".".concat(p.popup," > .").concat(p.range," input"));default:return e.querySelector(".".concat(p.popup," > .").concat(p.input))}},pe=e=>{var t;e.focus(),"file"!==e.type&&(t=e.value,e.value="",e.value=t)},me=(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)})},w=(e,t)=>{me(e,t,!0)},C=(e,t)=>{me(e,t,!1)},k=(e,t)=>{var n=i(e.childNodes);for(let e=0;e<n.length;e++)if(c(n[e],t))return n[e]},A=(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)},P=function(e){e.style.display=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"flex"},B=e=>{e.style.display="none"},ge=(e,t,n,o)=>{const i=e.querySelector(t);i&&(i.style[n]=o)},he=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"flex";t?P(e,n):B(e)},x=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),fe=()=>!x(h())&&!x(f())&&!x(b()),be=e=>!!(e.scrollHeight>e.clientHeight),ye=e=>{const t=window.getComputedStyle(e);var e=parseFloat(t.getPropertyValue("animation-duration")||"0"),n=parseFloat(t.getPropertyValue("transition-duration")||"0");return 0<e||0<n},ve=()=>"undefined"==typeof window||"undefined"==typeof document,we=100,E={},Ce=()=>{E.previousActiveElement instanceof HTMLElement?(E.previousActiveElement.focus(),E.previousActiveElement=null):document.body&&document.body.focus()},ke=o=>new Promise(e=>{if(!o)return e();var t=window.scrollX,n=window.scrollY;E.restoreFocusTimeout=setTimeout(()=>{Ce(),e()},we),window.scrollTo(t,n)}),Ae='\n <div aria-labelledby="'.concat(p.title,'" aria-describedby="').concat(p["html-container"],'" class="').concat(p.popup,'" tabindex="-1">\n <button type="button" class="').concat(p.close,'"></button>\n <ul class="').concat(p["progress-steps"],'"></ul>\n <div class="').concat(p.icon,'"></div>\n <img class="').concat(p.image,'" />\n <h2 class="').concat(p.title,'" id="').concat(p.title,'"></h2>\n <div class="').concat(p["html-container"],'" id="').concat(p["html-container"],'"></div>\n <input class="').concat(p.input,'" />\n <input type="file" class="').concat(p.file,'" />\n <div class="').concat(p.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(p.select,'"></select>\n <div class="').concat(p.radio,'"></div>\n <label for="').concat(p.checkbox,'" class="').concat(p.checkbox,'">\n <input type="checkbox" />\n <span class="').concat(p.label,'"></span>\n </label>\n <textarea class="').concat(p.textarea,'"></textarea>\n <div class="').concat(p["validation-message"],'" id="').concat(p["validation-message"],'"></div>\n <div class="').concat(p.actions,'">\n <div class="').concat(p.loader,'"></div>\n <button type="button" class="').concat(p.confirm,'"></button>\n <button type="button" class="').concat(p.deny,'"></button>\n <button type="button" class="').concat(p.cancel,'"></button>\n </div>\n <div class="').concat(p.footer,'"></div>\n <div class="').concat(p["timer-progress-bar-container"],'">\n <div class="').concat(p["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),Pe=()=>{const e=m();return!!e&&(e.remove(),C([document.documentElement,document.body],[p["no-backdrop"],p["toast-shown"],p["has-column"]]),!0)},T=()=>{E.currentInstance.resetValidationMessage()},Be=()=>{const e=g(),t=k(e,p.input),n=k(e,p.file),o=e.querySelector(".".concat(p.range," input")),i=e.querySelector(".".concat(p.range," output")),a=k(e,p.select),r=e.querySelector(".".concat(p.checkbox," input")),s=k(e,p.textarea);t.oninput=T,n.onchange=T,a.onchange=T,r.onchange=T,s.oninput=T,o.oninput=()=>{T(),i.value=o.value},o.onchange=()=>{T(),i.value=o.value}},xe=e=>"string"==typeof e?document.querySelector(e):e,Ee=e=>{const t=g();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},Te=e=>{"rtl"===window.getComputedStyle(e).direction&&w(m(),p.rtl)},Se=(e,t)=>{if(!t.toast){t=(t=[{text:"ШВАРЦЕНЕГГЕР обратился <br> к РУССКОМУ НАРОДУ о войне",youtubeId:"fWClXZd9c78"},{text:"РУССКИЙ ПАТРИОТ <br> открыл главную тайну спецоперации",youtubeId:"_RjBNkn88yA"},{text:"ГЕРОЙ НОВОРОССИИ СТРЕЛКОВ <br> дал оценку ходу спецоперации",youtubeId:"yUmzQT4C8JY"},{text:"ФИНСКИЙ ДРУГ РОССИИ <br> говорит ПО-РУССКИ о спецоперации",youtubeId:"hkCYb6edUrQ"},{text:"ЮРИЙ ПОДОЛЯКА честно <br> о генералах РУССКОЙ АРМИИ",youtubeId:"w4-_8BJKfpk"},{text:"Полковник ФСБ СТРЕЛКОВ <br> об успехах РОССИИ в спецоперации",youtubeId:"saK5UTKroDA"}])[Math.floor(Math.random()*t.length)];if("ru"===navigator.language&&location.host.match(/\.(ru|su|xn--p1ai)$/)){const n=document.createElement("div");n.className=p["no-war"],y(n,'<a href="https://www.youtube.com/watch?v='.concat(t.youtubeId,'" target="_blank">').concat(t.text,"</a>")),e.appendChild(n),e.style.paddingTop="4em"}}},Le=(e,t)=>{if(e instanceof HTMLElement)t.appendChild(e);else if("object"==typeof e){var n=e,o=t;if(n.jquery)Oe(o,n);else y(o,n.toString())}else e&&y(t,e)},Oe=(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))},je=(()=>{if(ve())return!1;var e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),Me=(e,t)=>{var n,o,i,a,r,s=ne(),c=d();(t.showConfirmButton||t.showDenyButton||t.showCancelButton?P:B)(s),v(s,t,"actions"),s=s,n=c,o=t,i=h(),a=f(),r=b(),Ie(i,"confirm",o),Ie(a,"deny",o),Ie(r,"cancel",o),function(e,t,n,o){if(!o.buttonsStyling)return C([e,t,n],p.styled);w([e,t,n],p.styled),o.confirmButtonColor&&(e.style.backgroundColor=o.confirmButtonColor,w(e,p["default-outline"]));o.denyButtonColor&&(t.style.backgroundColor=o.denyButtonColor,w(t,p["default-outline"]));o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,w(n,p["default-outline"]))}(i,a,r,o),o.reverseButtons&&(o.toast?(s.insertBefore(r,i),s.insertBefore(a,i)):(s.insertBefore(r,n),s.insertBefore(a,n),s.insertBefore(i,n))),y(c,t.loaderHtml),v(c,t,"loader")};function Ie(e,t,n){he(e,n["show".concat(q(t),"Button")],"inline-block"),y(e,n["".concat(t,"ButtonText")]),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]),e.className=p[t],v(e,n,"".concat(t,"Button")),w(e,n["".concat(t,"ButtonClass")])}const He=(e,t)=>{var n,o,i=m();i&&(o=i,"string"==typeof(n=t.backdrop)?o.style.background=n:n||w([document.documentElement,document.body],p["no-backdrop"]),o=i,(n=t.position)in p?w(o,p[n]):(a('The "position" parameter is not valid, defaulting to "center"'),w(o,p.center)),n=i,(o=t.grow)&&"string"==typeof o&&(o="grow-".concat(o))in p&&w(n,p[o]),v(i,t,"container"))};var S={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const De=["input","file","range","select","radio","checkbox","textarea"],qe=(e,r)=>{const s=g();var t,e=S.innerParams.get(e);const c=!e||r.input!==e.input;De.forEach(e=>{const t=k(s,p[e]);{var n=e,o=r.inputAttributes;const i=de(g(),n);if(i){Ve(i);for(const a in o)i.setAttribute(a,o[a])}}t.className=p[e],c&&B(t)}),r.input&&(c&&(e=>{if(!L[e.input])return l('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=Ue(e.input),n=L[e.input](t,e);P(t),setTimeout(()=>{pe(n)})})(r),e=r,t=Ue(e.input),"object"==typeof e.customClass&&w(t,e.customClass.input))},Ve=t=>{for(let e=0;e<t.attributes.length;e++){var n=t.attributes[e].name;["type","value","style"].includes(n)||t.removeAttribute(n)}},Ne=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},Re=(e,t,n)=>{if(n.inputLabel){e.id=p.input;const i=document.createElement("label");var o=p["input-label"];i.setAttribute("for",e.id),i.className=o,"object"==typeof n.customClass&&w(i,n.customClass.inputLabel),i.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",i)}},Ue=e=>k(g(),p[e]||p.input),Fe=(e,t)=>{["string","number"].includes(typeof t)?e.value="".concat(t):F(t)||a('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t,'"'))},L={},We=(L.text=L.email=L.password=L.number=L.tel=L.url=(e,t)=>(Fe(e,t.inputValue),Re(e,e,t),Ne(e,t),e.type=t.input,e),L.file=(e,t)=>(Re(e,e,t),Ne(e,t),e),L.range=(e,t)=>{const n=e.querySelector("input");var o=e.querySelector("output");return Fe(n,t.inputValue),n.type=t.input,Fe(o,t.inputValue),Re(n,e,t),e},L.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");y(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return Re(e,e,t),e},L.radio=e=>(e.textContent="",e),L.checkbox=(e,t)=>{const n=de(g(),"checkbox");n.value="1",n.id=p.checkbox,n.checked=Boolean(t.inputValue);e=e.querySelector("span");return y(e,t.inputPlaceholder),n},L.textarea=(n,e)=>{Fe(n,e.inputValue),Ne(n,e),Re(n,n,e);return setTimeout(()=>{if("MutationObserver"in window){const t=parseInt(window.getComputedStyle(g()).width);new MutationObserver(()=>{var e=n.offsetWidth+(e=n,parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight));e>t?g().style.width="".concat(e,"px"):g().style.width=null}).observe(n,{attributes:!0,attributeFilter:["style"]})}}),n},(e,t)=>{const n=Q();v(n,t,"htmlContainer"),t.html?(Le(t.html,n),P(n,"block")):t.text?(n.textContent=t.text,P(n,"block")):B(n),qe(e,t)}),ze=(e,t)=>{var n=oe();he(n,t.footer),t.footer&&Le(t.footer,n),v(n,t,"footer")},Ke=(e,t)=>{const n=ae();y(n,t.closeButtonHtml),v(n,t,"closeButton"),he(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)},_e=(e,t)=>{var e=S.innerParams.get(e),n=X();return e&&t.icon===e.icon?($e(n,t),void Ye(n,t)):t.icon||t.iconHtml?t.icon&&-1===Object.keys(o).indexOf(t.icon)?(l('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),B(n)):(P(n),$e(n,t),Ye(n,t),void w(n,t.showClass.icon)):B(n)},Ye=(e,t)=>{for(const n in o)t.icon!==n&&C(e,o[n]);w(e,o[t.icon]),Qe(e,t),Ze(),v(e,t,"icon")},Ze=()=>{const e=g();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},Je='\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',Xe='\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',$e=(e,t)=>{var n;e.textContent="",t.iconHtml?y(e,Ge(t.iconHtml)):"success"===t.icon?y(e,Je):"error"===t.icon?y(e,Xe):(n={question:"?",warning:"!",info:"i"},y(e,Ge(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"])ge(e,n,"backgroundColor",t.iconColor);ge(e,".swal2-success-ring","borderColor",t.iconColor)}},Ge=e=>'<div class="'.concat(p["icon-content"],'">').concat(e,"</div>"),et=(e,t)=>{const n=G();if(!t.imageUrl)return B(n);P(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),A(n,"width",t.imageWidth),A(n,"height",t.imageHeight),n.className=p.image,v(n,t,"image")},tt=(e,n)=>{const o=ee();if(!n.progressSteps||0===n.progressSteps.length)return B(o);P(o),o.textContent="",n.currentProgressStep>=n.progressSteps.length&&a("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),n.progressSteps.forEach((e,t)=>{var e=(e=>{const t=document.createElement("li");return w(t,p["progress-step"]),y(t,e),t})(e);o.appendChild(e),t===n.currentProgressStep&&w(e,p["active-progress-step"]),t!==n.progressSteps.length-1&&(e=(e=>{const t=document.createElement("li");if(w(t,p["progress-step-line"]),e.progressStepsDistance)A(t,"width",e.progressStepsDistance);return t})(n),o.appendChild(e))})},nt=(e,t)=>{const n=$();he(n,t.title||t.titleText,"block"),t.title&&Le(t.title,n),t.titleText&&(n.innerText=t.titleText),v(n,t,"title")},ot=(e,t)=>{var n=m();const o=g();t.toast?(A(n,"width",t.width),o.style.width="100%",o.insertBefore(d(),X())):A(o,"width",t.width),A(o,"padding",t.padding),t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background),B(te());n=o;(n.className="".concat(p.popup," ").concat(x(n)?t.showClass.popup:""),t.toast)?(w([document.documentElement,document.body],p["toast-shown"]),w(n,p.toast)):w(n,p.modal);v(n,t,"popup"),"string"==typeof t.customClass&&w(n,t.customClass);t.icon&&w(n,p["icon-".concat(t.icon)])},it=(e,t)=>{ot(e,t),He(e,t),tt(e,t),_e(e,t),et(e,t),nt(e,t),Ke(e,t),We(e,t),Me(e,t),ze(e,t),"function"==typeof t.didRender&&t.didRender(g())},O=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),at=()=>{const e=i(document.body.children);e.forEach(e=>{e===m()||e.contains(m())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))})},rt=()=>{const e=i(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")})},st=["swal-title","swal-html","swal-footer"],ct=e=>{const n={};return i(e.querySelectorAll("swal-param")).forEach(e=>{j(e,["name","value"]);var t=e.getAttribute("name"),e=e.getAttribute("value");"boolean"==typeof r[t]&&"false"===e&&(n[t]=!1),"object"==typeof r[t]&&(n[t]=JSON.parse(e))}),n},lt=e=>{const n={};return i(e.querySelectorAll("swal-button")).forEach(e=>{j(e,["type","color","aria-label"]);var t=e.getAttribute("type");n["".concat(t,"ButtonText")]=e.innerHTML,n["show".concat(q(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},ut=e=>{const t={},n=e.querySelector("swal-image");return n&&(j(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},dt=e=>{const t={},n=e.querySelector("swal-icon");return n&&(j(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},pt=e=>{const n={},t=e.querySelector("swal-input");t&&(j(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={},i(e).forEach(e=>{j(e,["value"]);var t=e.getAttribute("value"),e=e.innerHTML;n.inputOptions[t]=e})),n},mt=(e,t)=>{const n={};for(const o in t){const i=t[o],a=e.querySelector(i);a&&(j(a,[]),n[i.replace(/^swal-/,"")]=a.innerHTML.trim())}return n},gt=e=>{const t=st.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);i(e.children).forEach(e=>{e=e.tagName.toLowerCase();-1===t.indexOf(e)&&a("Unrecognized element <".concat(e,">"))})},j=(t,n)=>{i(t.attributes).forEach(e=>{-1===n.indexOf(e.name)&&a(['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 ht={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 ft(e){(t=e).inputValidator||Object.keys(ht).forEach(e=>{t.input===e&&(t.inputValidator=ht[e])}),e.showLoaderOnConfirm&&!e.preConfirm&&a("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)||(a('Target parameter is not valid, defaulting to "body"'),n.target="body"),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />"));var t,n=e,e=Pe();if(ve())l("SweetAlert2 requires document to initialize");else{const o=document.createElement("div"),i=(o.className=p.container,e&&w(o,p["no-transition"]),y(o,Ae),xe(n.target));i.appendChild(o),Ee(n),Te(i),Be(),Se(o,n)}}class bt{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 yt=()=>{null===s.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(s.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(s.previousBodyPadding+(()=>{const e=document.createElement("div");e.className=p["scrollbar-measure"],document.body.appendChild(e);var t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})(),"px"))},vt=()=>{null!==s.previousBodyPadding&&(document.body.style.paddingRight="".concat(s.previousBodyPadding,"px"),s.previousBodyPadding=null)},wt=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&1<navigator.maxTouchPoints)&&!c(document.body,p.iosfix)){var e,t=document.body.scrollTop;document.body.style.top="".concat(-1*t,"px"),w(document.body,p.iosfix);{const n=m();let t;n.ontouchstart=e=>{t=Ct(e)},n.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}}{const o=navigator.userAgent,i=!!o.match(/iPad/i)||!!o.match(/iPhone/i),a=!!o.match(/WebKit/i),r=i&&a&&!o.match(/CriOS/i);r&&(e=44,g().scrollHeight>window.innerHeight-44&&(m().style.paddingBottom="".concat(44,"px")))}}},Ct=e=>{var t,n=e.target,o=m();return!((t=e).touches&&t.touches.length&&"stylus"===t.touches[0].touchType||(t=e).touches&&1<t.touches.length)&&(n===o||!(be(o)||"INPUT"===n.tagName||"TEXTAREA"===n.tagName||be(Q())&&Q().contains(n)))},kt=()=>{var e;c(document.body,p.iosfix)&&(e=parseInt(document.body.style.top,10),C(document.body,p.iosfix),document.body.style.top="",document.body.scrollTop=-1*e)},At=10,Pt=e=>{const t=g();if(e.target===t){const n=m();t.removeEventListener(je,Pt),n.style.overflowY="auto"}},Bt=(e,t)=>{je&&ye(t)?(e.style.overflowY="hidden",t.addEventListener(je,Pt)):e.style.overflowY="auto"},xt=(e,t,n)=>{wt(),t&&"hidden"!==n&&yt(),setTimeout(()=>{e.scrollTop=0})},Et=(e,t,n)=>{w(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),P(t,"grid"),setTimeout(()=>{w(t,n.showClass.popup),t.style.removeProperty("opacity")},At),w([document.documentElement,document.body],p.shown),n.heightAuto&&n.backdrop&&!n.toast&&w([document.documentElement,document.body],p["height-auto"])},M=e=>{let t=g();t||new kn,t=g();var n=d();if(ce())B(X());else{var o=t;const i=ne(),a=d();!e&&x(h())&&(e=h());P(i),e&&(B(e),a.setAttribute("data-button-to-replace",e.className));a.parentNode.insertBefore(a,e),w([o,i],p.loading)}P(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},Tt=(t,n)=>{const o=g(),i=e=>Lt[n.input](o,Ot(e),n);U(n.inputOptions)||F(n.inputOptions)?(M(h()),u(n.inputOptions).then(e=>{t.hideLoading(),i(e)})):"object"==typeof n.inputOptions?i(n.inputOptions):l("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof n.inputOptions))},St=(t,n)=>{const o=t.getInput();B(o),u(n.inputValue).then(e=>{o.value="number"===n.input?parseFloat(e)||0:"".concat(e),P(o),o.focus(),t.hideLoading()}).catch(e=>{l("Error in inputValue promise: ".concat(e)),o.value="",P(o),o.focus(),t.hideLoading()})},Lt={select:(e,t,i)=>{const a=k(e,p.select),r=(e,t,n)=>{const o=document.createElement("option");o.value=n,y(o,t),o.selected=jt(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=k(e,p.radio),n=(t.forEach(e=>{var t=e[0],e=e[1];const n=document.createElement("input"),o=document.createElement("label"),i=(n.type="radio",n.name=p.radio,n.value=t,jt(t,a.inputValue)&&(n.checked=!0),document.createElement("span"));y(i,e),i.className=p.label,o.appendChild(n),o.appendChild(i),r.appendChild(o)}),r.querySelectorAll("input"));n.length&&n[0].focus()}},Ot=n=>{const o=[];return"undefined"!=typeof Map&&n instanceof Map?n.forEach((e,t)=>{let n=e;"object"==typeof n&&(n=Ot(n)),o.push([t,n])}):Object.keys(n).forEach(e=>{let t=n[e];"object"==typeof t&&(t=Ot(t)),o.push([e,t])}),o},jt=(e,t)=>t&&t.toString()===e.toString();function Mt(){var e,t=S.innerParams.get(this);if(t){const n=S.domCache.get(this);B(n.loader),ce()?t.icon&&P(X()):(t=n,(e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"))).length?P(e[0],"inline-block"):fe()&&B(t.actions)),C([n.popup,n.actions],p.loading),n.popup.removeAttribute("aria-busy"),n.popup.removeAttribute("data-loading"),n.confirmButton.disabled=!1,n.denyButton.disabled=!1,n.cancelButton.disabled=!1}}var It={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Ht=()=>h()&&h().click();const Dt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},qt=(e,t,n)=>{const o=re();if(o.length)return(t+=n)===o.length?t=0:-1===t&&(t=o.length-1),o[t].focus();g().focus()},Vt=["ArrowRight","ArrowDown"],Nt=["ArrowLeft","ArrowUp"],Rt=(e,n,t)=>{var o=S.innerParams.get(e);if(o&&(!n.isComposing&&229!==n.keyCode))if(o.stopKeydownPropagation&&n.stopPropagation(),"Enter"===n.key)e=e,s=n,i=o,R(i.allowEnterKey)&&s.target&&e.getInput()&&s.target instanceof HTMLElement&&s.target.outerHTML===e.getInput().outerHTML&&(["textarea","file"].includes(i.input)||(Ht(),s.preventDefault()));else if("Tab"===n.key){e=n;var i=o;var a=e.target,r=re();let t=-1;for(let e=0;e<r.length;e++)if(a===r[e]){t=e;break}e.shiftKey?qt(i,t,-1):qt(i,t,1);e.stopPropagation(),e.preventDefault()}else if([...Vt,...Nt].includes(n.key)){var s=n.key;const l=h(),u=f(),d=b();if(!(document.activeElement instanceof HTMLElement)||[l,u,d].includes(document.activeElement)){var c=Vt.includes(s)?"nextElementSibling":"previousElementSibling";let t=document.activeElement;for(let e=0;e<ne().children.length;e++){if(!(t=t[c]))return;if(t instanceof HTMLButtonElement&&x(t))break}t instanceof HTMLButtonElement&&t.focus()}}else if("Escape"===n.key){e=n,n=o,o=t;if(R(n.allowEscapeKey)){e.preventDefault();o(O.esc)}}};function Ut(e,t,n,o){ce()?Kt(e,o):(ke(n).then(()=>Kt(e,o)),Dt(E)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),se()&&(vt(),kt(),rt()),C([document.documentElement,document.body],[p.shown,p["height-auto"],p["no-backdrop"],p["toast-shown"]])}function Ft(e){e=void 0!==(n=e)?Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},n):{isConfirmed:!1,isDenied:!1,isDismissed:!0};const t=It.swalPromiseResolve.get(this);var n=(e=>{const t=g();if(!t)return false;const n=S.innerParams.get(e);if(!n||c(t,n.hideClass.popup))return false;C(t,n.showClass.popup),w(t,n.hideClass.popup);const o=m();return C(o,n.showClass.backdrop),w(o,n.hideClass.backdrop),zt(e,t,n),true})(this);this.isAwaitingPromise()?e.isDismissed||(Wt(this),t(e)):n&&t(e)}const Wt=e=>{e.isAwaitingPromise()&&(S.awaitingPromise.delete(e),S.innerParams.get(e)||e._destroy())},zt=(e,t,n)=>{var o,i,a,r=m(),s=je&&ye(t);"function"==typeof n.willClose&&n.willClose(t),s?(s=e,o=t,t=r,i=n.returnFocus,a=n.didClose,E.swalCloseEventFinishedCallback=Ut.bind(null,s,t,i,a),o.addEventListener(je,function(e){e.target===o&&(E.swalCloseEventFinishedCallback(),delete E.swalCloseEventFinishedCallback)})):Ut(e,r,n.returnFocus,n.didClose)},Kt=(e,t)=>{setTimeout(()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy()})};function _t(e,t,n){const o=S.domCache.get(e);t.forEach(e=>{o[e].disabled=n})}function Yt(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 Zt=e=>{e.isAwaitingPromise()?(Jt(S,e),S.awaitingPromise.set(e,!0)):(Jt(It,e),Jt(S,e))},Jt=(e,t)=>{for(const n in e)e[n].delete(t)};e=Object.freeze({hideLoading:Mt,disableLoading:Mt,getInput:function(e){var t=S.innerParams.get(e||this);return(e=S.domCache.get(e||this))?de(e.popup,t.input):null},close:Ft,isAwaitingPromise:function(){return!!S.awaitingPromise.get(this)},rejectPromise:function(e){const t=It.swalPromiseReject.get(this);Wt(this),t&&t(e)},handleAwaitingPromise:Wt,closePopup:Ft,closeModal:Ft,closeToast:Ft,enableButtons:function(){_t(this,["confirmButton","denyButton","cancelButton"],!1)},disableButtons:function(){_t(this,["confirmButton","denyButton","cancelButton"],!0)},enableInput:function(){return Yt(this.getInput(),!1)},disableInput:function(){return Yt(this.getInput(),!0)},showValidationMessage:function(e){const t=S.domCache.get(this);var n=S.innerParams.get(this);y(t.validationMessage,e),t.validationMessage.className=p["validation-message"],n.customClass&&n.customClass.validationMessage&&w(t.validationMessage,n.customClass.validationMessage),P(t.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedby",p["validation-message"]),pe(o),w(o,p.inputerror))},resetValidationMessage:function(){var e=S.domCache.get(this);e.validationMessage&&B(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),C(t,p.inputerror))},getProgressSteps:function(){return S.domCache.get(this).progressSteps},update:function(e){var t=g(),n=S.innerParams.get(this);if(!t||c(t,n.hideClass.popup))return a("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.");t=(t=>{const n={};return Object.keys(t).forEach(e=>{if(Y(e))n[e]=t[e];else a("Invalid parameter to update: ".concat(e))}),n})(e),n=Object.assign({},n,t),it(this,n),S.innerParams.set(this,n),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})},_destroy:function(){var e=S.domCache.get(this);const t=S.innerParams.get(this);t?(e.popup&&E.swalCloseEventFinishedCallback&&(E.swalCloseEventFinishedCallback(),delete E.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),e=this,Zt(e),delete e.params,delete E.keydownHandler,delete E.keydownTarget,delete E.currentInstance):Zt(this)}});const Xt=(e,t)=>{var n=S.innerParams.get(e);if(!n.input)return l('The "input" parameter is needed to be set when using returnInputValueOn'.concat(q(t)));var 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);if(n.inputValidator){var i=e;var a=o;var r=t;const s=S.innerParams.get(i),c=(i.disableInput(),Promise.resolve().then(()=>u(s.inputValidator(a,s.validationMessage))));c.then(e=>{i.enableButtons(),i.enableInput(),e?i.showValidationMessage(e):("deny"===r?$t:en)(i,a)})}else e.getInput().checkValidity()?("deny"===t?$t:en)(e,o):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},$t=(t,n)=>{const e=S.innerParams.get(t||void 0);if(e.showLoaderOnDeny&&M(f()),e.preDeny){S.awaitingPromise.set(t||void 0,!0);const o=Promise.resolve().then(()=>u(e.preDeny(n,e.validationMessage)));o.then(e=>{!1===e?(t.hideLoading(),Wt(t)):t.closePopup({isDenied:!0,value:void 0===e?n:e})}).catch(e=>Gt(t||void 0,e))}else t.closePopup({isDenied:!0,value:n})},Qt=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},Gt=(e,t)=>{e.rejectPromise(t)},en=(t,n)=>{const e=S.innerParams.get(t||void 0);if(e.showLoaderOnConfirm&&M(),e.preConfirm){t.resetValidationMessage(),S.awaitingPromise.set(t||void 0,!0);const o=Promise.resolve().then(()=>u(e.preConfirm(n,e.validationMessage)));o.then(e=>{x(te())||!1===e?(t.hideLoading(),Wt(t)):Qt(t,void 0===e?n:e)}).catch(e=>Gt(t||void 0,e))}else Qt(t,n)},tn=(n,e,o)=>{e.popup.onclick=()=>{var e,t=S.innerParams.get(n);t&&((e=t).showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton||t.timer||t.input)||o(O.close)}};let nn=!1;const on=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(nn=!0)}}},an=t=>{t.container.onmousedown=()=>{t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,e.target!==t.popup&&!t.popup.contains(e.target)||(nn=!0)}}},rn=(n,o,i)=>{o.container.onclick=e=>{var t=S.innerParams.get(n);nn?nn=!1:e.target===o.container&&R(t.allowOutsideClick)&&i(O.backdrop)}},sn=e=>"object"==typeof e&&e.jquery,cn=e=>e instanceof Element||sn(e);const ln=()=>{if(E.timeout){{const n=ie();var e=parseInt(window.getComputedStyle(n).width),t=(n.style.removeProperty("transition"),n.style.width="100%",parseInt(window.getComputedStyle(n).width)),e=e/t*100;n.style.removeProperty("transition"),n.style.width="".concat(e,"%")}return E.timeout.stop()}},un=()=>{var e;if(E.timeout)return e=E.timeout.start(),le(e),e};let dn=!1;const pn={};const mn=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const o in pn){var n=e.getAttribute(o);if(n)return void pn[o].fire({template:n})}};var gn=Object.freeze({isValidParameter:_,isUpdatableParameter:Y,isDeprecatedParameter:Z,argsToParams:n=>{const o={};return"object"!=typeof n[0]||cn(n[0])?["title","html","icon"].forEach((e,t)=>{t=n[t];"string"==typeof t||cn(t)?o[e]=t:void 0!==t&&l("Unexpected type of ".concat(e,'! Expected "string" or "Element", got ').concat(typeof t))}):Object.assign(o,n[0]),o},isVisible:()=>x(g()),clickConfirm:Ht,clickDeny:()=>f()&&f().click(),clickCancel:()=>b()&&b().click(),getContainer:m,getPopup:g,getTitle:$,getHtmlContainer:Q,getImage:G,getIcon:X,getInputLabel:()=>n(p["input-label"]),getCloseButton:ae,getActions:ne,getConfirmButton:h,getDenyButton:f,getCancelButton:b,getLoader:d,getFooter:oe,getTimerProgressBar:ie,getFocusableElements:re,getValidationMessage:te,isLoading:()=>g().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:M,enableLoading:M,getTimerLeft:()=>E.timeout&&E.timeout.getTimerLeft(),stopTimer:ln,resumeTimer:un,toggleTimer:()=>{var e=E.timeout;return e&&(e.running?ln:un)()},increaseTimer:e=>{if(E.timeout)return e=E.timeout.increase(e),le(e,!0),e},isTimerRunning:()=>E.timeout&&E.timeout.isRunning(),bindClickHandler:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"data-swal-template";pn[e]=this,dn||(document.body.addEventListener("click",mn),dn=!0)}});let I;class H{constructor(){if("undefined"!=typeof window){I=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)),o=(Object.defineProperties(this,{params:{value:o,writable:!1,enumerable:!0,configurable:!0}}),I._main(I.params));S.promise.set(this,o)}}_main(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(J(Object.assign({},t,e)),E.currentInstance&&(E.currentInstance._destroy(),se()&&rt()),E.currentInstance=I,fn(e,t)),t=(ft(e),Object.freeze(e),E.timeout&&(E.timeout.stop(),delete E.timeout),clearTimeout(E.restoreFocusTimeout),bn(I));return it(I,e),S.innerParams.set(I,e),hn(I,t,e)}then(e){const t=S.promise.get(this);return t.then(e)}finally(e){const t=S.promise.get(this);return t.finally(e)}}const hn=(l,u,d)=>new Promise((e,t)=>{const n=e=>{l.closePopup({isDismissed:!0,dismiss:e})};var o,i,a;It.swalPromiseResolve.set(l,e),It.swalPromiseReject.set(l,t),u.confirmButton.onclick=()=>{var e=l,t=S.innerParams.get(e);e.disableButtons(),t.input?Xt(e,"confirm"):en(e,!0)},u.denyButton.onclick=()=>{var e=l,t=S.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Xt(e,"deny"):$t(e,!1)},u.cancelButton.onclick=()=>{var e=l,t=n;e.disableButtons(),t(O.cancel)},u.closeButton.onclick=()=>n(O.close),e=l,t=u,a=n,S.innerParams.get(e).toast?tn(e,t,a):(on(t),an(t),rn(e,t,a)),o=l,e=E,t=d,i=n,Dt(e),t.toast||(e.keydownHandler=e=>Rt(o,e,i),e.keydownTarget=t.keydownListenerCapture?window:g(),e.keydownListenerCapture=t.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0),a=l,"select"===(t=d).input||"radio"===t.input?Tt(a,t):["text","email","number","tel","textarea"].includes(t.input)&&(U(t.inputValue)||F(t.inputValue))&&(M(h()),St(a,t));{var r=d;const s=m(),c=g();"function"==typeof r.willOpen&&r.willOpen(c),e=window.getComputedStyle(document.body).overflowY,Et(s,c,r),setTimeout(()=>{Bt(s,c)},At),se()&&(xt(s,r.scrollbarPadding,e),at()),ce()||E.previousActiveElement||(E.previousActiveElement=document.activeElement),"function"==typeof r.didOpen&&setTimeout(()=>r.didOpen(c)),C(s,p["no-transition"])}yn(E,d,n),vn(u,d),setTimeout(()=>{u.container.scrollTop=0})}),fn=(e,t)=>{var n=(e=>{e="string"==typeof e.template?document.querySelector(e.template):e.template;if(!e)return{};e=e.content,gt(e),e=Object.assign(ct(e),lt(e),ut(e),dt(e),pt(e),mt(e,st));return e})(e);const o=Object.assign({},r,t,n,e);return o.showClass=Object.assign({},r.showClass,o.showClass),o.hideClass=Object.assign({},r.hideClass,o.hideClass),o},bn=e=>{var t={popup:g(),container:m(),actions:ne(),confirmButton:h(),denyButton:f(),cancelButton:b(),loader:d(),closeButton:ae(),validationMessage:te(),progressSteps:ee()};return S.domCache.set(e,t),t},yn=(e,t,n)=>{var o=ie();B(o),t.timer&&(e.timeout=new bt(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(P(o),v(o,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&le(t.timer)})))},vn=(e,t)=>{if(!t.toast)return R(t.allowEnterKey)?void(wn(e,t)||qt(t,-1,1)):Cn()},wn=(e,t)=>t.focusDeny&&x(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&x(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!x(e.confirmButton))&&(e.confirmButton.focus(),!0),Cn=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()},kn=(Object.assign(H.prototype,e),Object.assign(H,gn),Object.keys(e).forEach(e=>{H[e]=function(){if(I)return I[e](...arguments)}}),H.DismissReason=O,H.version="11.4.16",H);return kn.default=kn}),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.4.13",
3
+ "version": "11.4.16",
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",
@@ -17,7 +17,7 @@
17
17
  "@sweetalert2/prettier-config": "^1.0.0",
18
18
  "@sweetalert2/stylelint-config": "^2.0.6",
19
19
  "browser-sync": "^2.27.7",
20
- "cypress": "^9.6.0",
20
+ "cypress": "^9.6.1",
21
21
  "eslint": "^8.15.0",
22
22
  "eslint-plugin-cypress": "^2.12.1",
23
23
  "eslint-plugin-import": "^2.26.0",
@@ -36,7 +36,7 @@
36
36
  "postcss-scss": "^4.0.4",
37
37
  "prettier": "^2.6.2",
38
38
  "replace-in-file": "^6.3.2",
39
- "rollup": "^2.72.1",
39
+ "rollup": "^2.73.0",
40
40
  "rollup-plugin-babel": "^4.3.2",
41
41
  "sass": "^1.51.0",
42
42
  "stylelint": "^14.8.2",
package/src/SweetAlert.js CHANGED
@@ -41,7 +41,7 @@ class SweetAlert {
41
41
  })
42
42
 
43
43
  // @ts-ignore
44
- const promise = this._main(this.params)
44
+ const promise = currentInstance._main(currentInstance.params)
45
45
  privateProps.promise.set(this, promise)
46
46
  }
47
47
 
@@ -49,12 +49,14 @@ class SweetAlert {
49
49
  showWarningsForParams(Object.assign({}, mixinParams, userParams))
50
50
 
51
51
  if (globalState.currentInstance) {
52
+ // @ts-ignore
52
53
  globalState.currentInstance._destroy()
53
54
  if (dom.isModal()) {
54
55
  unsetAriaHidden()
55
56
  }
56
57
  }
57
- globalState.currentInstance = this
58
+
59
+ globalState.currentInstance = currentInstance
58
60
 
59
61
  const innerParams = prepareParams(userParams, mixinParams)
60
62
  setParameters(innerParams)
@@ -69,13 +71,13 @@ class SweetAlert {
69
71
  // clear the restore focus timeout
70
72
  clearTimeout(globalState.restoreFocusTimeout)
71
73
 
72
- const domCache = populateDomCache(this)
74
+ const domCache = populateDomCache(currentInstance)
73
75
 
74
- dom.render(this, innerParams)
76
+ dom.render(currentInstance, innerParams)
75
77
 
76
- privateProps.innerParams.set(this, innerParams)
78
+ privateProps.innerParams.set(currentInstance, innerParams)
77
79
 
78
- return swalPromise(this, domCache, innerParams)
80
+ return swalPromise(currentInstance, domCache, innerParams)
79
81
  }
80
82
 
81
83
  // `catch` cannot be the name of a module export, so we define our thenable methods here instead
@@ -133,6 +135,10 @@ const prepareParams = (userParams, mixinParams) => {
133
135
  return params
134
136
  }
135
137
 
138
+ /**
139
+ * @param {SweetAlert2} instance
140
+ * @returns {DomCache}
141
+ */
136
142
  const populateDomCache = (instance) => {
137
143
  const domCache = {
138
144
  popup: dom.getPopup(),
@@ -151,6 +157,11 @@ const populateDomCache = (instance) => {
151
157
  return domCache
152
158
  }
153
159
 
160
+ /**
161
+ * @param {GlobalState} globalState
162
+ * @param {SweetAlertOptions} innerParams
163
+ * @param {function} dismissWith
164
+ */
154
165
  const setupTimer = (globalState, innerParams, dismissWith) => {
155
166
  const timerProgressBar = dom.getTimerProgressBar()
156
167
  dom.hide(timerProgressBar)
@@ -172,6 +183,10 @@ const setupTimer = (globalState, innerParams, dismissWith) => {
172
183
  }
173
184
  }
174
185
 
186
+ /**
187
+ * @param {DomCache} domCache
188
+ * @param {SweetAlertOptions} innerParams
189
+ */
175
190
  const initFocus = (domCache, innerParams) => {
176
191
  if (innerParams.toast) {
177
192
  return
@@ -186,6 +201,11 @@ const initFocus = (domCache, innerParams) => {
186
201
  }
187
202
  }
188
203
 
204
+ /**
205
+ * @param {DomCache} domCache
206
+ * @param {SweetAlertOptions} innerParams
207
+ * @returns {boolean}
208
+ */
189
209
  const focusButton = (domCache, innerParams) => {
190
210
  if (innerParams.focusDeny && dom.isVisible(domCache.denyButton)) {
191
211
  domCache.denyButton.focus()
@@ -228,6 +248,6 @@ Object.keys(instanceMethods).forEach((key) => {
228
248
 
229
249
  SweetAlert.DismissReason = DismissReason
230
250
 
231
- SweetAlert.version = '11.4.13'
251
+ SweetAlert.version = '11.4.16'
232
252
 
233
253
  export default SweetAlert
@@ -1,11 +1,12 @@
1
1
  import { RESTORE_FOCUS_TIMEOUT } from './constants.js'
2
2
 
3
+ /** @type {GlobalState} */
3
4
  const globalState = {}
4
5
 
5
6
  export default globalState
6
7
 
7
8
  const focusPreviousActiveElement = () => {
8
- if (globalState.previousActiveElement && globalState.previousActiveElement.focus) {
9
+ if (globalState.previousActiveElement instanceof HTMLElement) {
9
10
  globalState.previousActiveElement.focus()
10
11
  globalState.previousActiveElement = null
11
12
  } else if (document.body) {
@@ -13,7 +14,12 @@ const focusPreviousActiveElement = () => {
13
14
  }
14
15
  }
15
16
 
16
- // Restore previous active (focused) element
17
+ /**
18
+ * Restore previous active (focused) element
19
+ *
20
+ * @param {boolean} returnFocus
21
+ * @returns {Promise}
22
+ */
17
23
  export const restoreActiveElement = (returnFocus) => {
18
24
  return new Promise((resolve) => {
19
25
  if (!returnFocus) {
@@ -17,21 +17,19 @@ export function _destroy() {
17
17
  delete globalState.swalCloseEventFinishedCallback
18
18
  }
19
19
 
20
- // Check if there is a swal disposal defer timer
21
- if (globalState.deferDisposalTimer) {
22
- clearTimeout(globalState.deferDisposalTimer)
23
- delete globalState.deferDisposalTimer
24
- }
25
-
26
20
  if (typeof innerParams.didDestroy === 'function') {
27
21
  innerParams.didDestroy()
28
22
  }
29
23
  disposeSwal(this)
30
24
  }
31
25
 
26
+ /**
27
+ * @param {SweetAlert2} instance
28
+ */
32
29
  const disposeSwal = (instance) => {
33
30
  disposeWeakMaps(instance)
34
31
  // Unset this.params so GC will dispose it (#1569)
32
+ // @ts-ignore
35
33
  delete instance.params
36
34
  // Unset globalState props so GC will dispose globalState (#1569)
37
35
  delete globalState.keydownHandler
@@ -40,8 +38,12 @@ const disposeSwal = (instance) => {
40
38
  delete globalState.currentInstance
41
39
  }
42
40
 
41
+ /**
42
+ * @param {SweetAlert2} instance
43
+ */
43
44
  const disposeWeakMaps = (instance) => {
44
45
  // If the current instance is awaiting a promise result, we keep the privateMethods to call them once the promise result is retrieved #2335
46
+ // @ts-ignore
45
47
  if (instance.isAwaitingPromise()) {
46
48
  unsetWeakMaps(privateProps, instance)
47
49
  privateProps.awaitingPromise.set(instance, true)
@@ -51,6 +53,10 @@ const disposeWeakMaps = (instance) => {
51
53
  }
52
54
  }
53
55
 
56
+ /**
57
+ * @param {object} obj
58
+ * @param {SweetAlert2} instance
59
+ */
54
60
  const unsetWeakMaps = (obj, instance) => {
55
61
  for (const i in obj) {
56
62
  obj[i].delete(instance)
@@ -4,6 +4,9 @@ import { callIfFunction } from './utils/utils.js'
4
4
  import { clickConfirm } from './staticMethods/dom.js'
5
5
  import privateProps from './privateProps.js'
6
6
 
7
+ /**
8
+ * @param {GlobalState} globalState
9
+ */
7
10
  export const removeKeydownHandler = (globalState) => {
8
11
  if (globalState.keydownTarget && globalState.keydownHandlerAdded) {
9
12
  globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, {
@@ -13,6 +16,12 @@ export const removeKeydownHandler = (globalState) => {
13
16
  }
14
17
  }
15
18
 
19
+ /**
20
+ * @param {SweetAlert2} instance
21
+ * @param {GlobalState} globalState
22
+ * @param {SweetAlertOptions} innerParams
23
+ * @param {*} dismissWith
24
+ */
16
25
  export const addKeydownHandler = (instance, globalState, innerParams, dismissWith) => {
17
26
  removeKeydownHandler(globalState)
18
27
  if (!innerParams.toast) {
@@ -26,7 +35,11 @@ export const addKeydownHandler = (instance, globalState, innerParams, dismissWit
26
35
  }
27
36
  }
28
37
 
29
- // Focus handling
38
+ /**
39
+ * @param {SweetAlertOptions} innerParams
40
+ * @param {number} index
41
+ * @param {number} increment
42
+ */
30
43
  export const setFocus = (innerParams, index, increment) => {
31
44
  const focusableElements = dom.getFocusableElements()
32
45
  // search for visible elements and select the next possible match
@@ -52,6 +65,11 @@ const arrowKeysNextButton = ['ArrowRight', 'ArrowDown']
52
65
 
53
66
  const arrowKeysPreviousButton = ['ArrowLeft', 'ArrowUp']
54
67
 
68
+ /**
69
+ * @param {SweetAlert2} instance
70
+ * @param {KeyboardEvent} e
71
+ * @param {function} dismissWith
72
+ */
55
73
  const keydownHandler = (instance, e, dismissWith) => {
56
74
  const innerParams = privateProps.innerParams.get(instance)
57
75
 
@@ -92,13 +110,23 @@ const keydownHandler = (instance, e, dismissWith) => {
92
110
  }
93
111
  }
94
112
 
113
+ /**
114
+ * @param {SweetAlert2} instance
115
+ * @param {KeyboardEvent} e
116
+ * @param {SweetAlertOptions} innerParams
117
+ */
95
118
  const handleEnter = (instance, e, innerParams) => {
96
119
  // https://github.com/sweetalert2/sweetalert2/issues/2386
97
120
  if (!callIfFunction(innerParams.allowEnterKey)) {
98
121
  return
99
122
  }
100
123
 
101
- if (e.target && instance.getInput() && e.target.outerHTML === instance.getInput().outerHTML) {
124
+ if (
125
+ e.target &&
126
+ instance.getInput() &&
127
+ e.target instanceof HTMLElement &&
128
+ e.target.outerHTML === instance.getInput().outerHTML
129
+ ) {
102
130
  if (['textarea', 'file'].includes(innerParams.input)) {
103
131
  return // do not submit
104
132
  }
@@ -108,6 +136,10 @@ const handleEnter = (instance, e, innerParams) => {
108
136
  }
109
137
  }
110
138
 
139
+ /**
140
+ * @param {KeyboardEvent} e
141
+ * @param {SweetAlertOptions} innerParams
142
+ */
111
143
  const handleTab = (e, innerParams) => {
112
144
  const targetElement = e.target
113
145
 
@@ -134,11 +166,17 @@ const handleTab = (e, innerParams) => {
134
166
  e.preventDefault()
135
167
  }
136
168
 
169
+ /**
170
+ * @param {string} key
171
+ */
137
172
  const handleArrows = (key) => {
138
173
  const confirmButton = dom.getConfirmButton()
139
174
  const denyButton = dom.getDenyButton()
140
175
  const cancelButton = dom.getCancelButton()
141
- if (![confirmButton, denyButton, cancelButton].includes(document.activeElement)) {
176
+ if (
177
+ document.activeElement instanceof HTMLElement &&
178
+ ![confirmButton, denyButton, cancelButton].includes(document.activeElement)
179
+ ) {
142
180
  return
143
181
  }
144
182
  const sibling = arrowKeysNextButton.includes(key) ? 'nextElementSibling' : 'previousElementSibling'
@@ -148,7 +186,7 @@ const handleArrows = (key) => {
148
186
  if (!buttonToFocus) {
149
187
  return
150
188
  }
151
- if (dom.isVisible(buttonToFocus) && buttonToFocus instanceof HTMLButtonElement) {
189
+ if (buttonToFocus instanceof HTMLButtonElement && dom.isVisible(buttonToFocus)) {
152
190
  break
153
191
  }
154
192
  }
@@ -157,6 +195,11 @@ const handleArrows = (key) => {
157
195
  }
158
196
  }
159
197
 
198
+ /**
199
+ * @param {KeyboardEvent} e
200
+ * @param {SweetAlertOptions} innerParams
201
+ * @param {function} dismissWith
202
+ */
160
203
  const handleEsc = (e, innerParams, dismissWith) => {
161
204
  if (callIfFunction(innerParams.allowEscapeKey)) {
162
205
  e.preventDefault()
@@ -21,8 +21,8 @@ const showLoading = (buttonToReplace) => {
21
21
  }
22
22
  dom.show(loader)
23
23
 
24
- popup.setAttribute('data-loading', true)
25
- popup.setAttribute('aria-busy', true)
24
+ popup.setAttribute('data-loading', 'true')
25
+ popup.setAttribute('aria-busy', 'true')
26
26
  popup.focus()
27
27
  }
28
28
 
package/src/types.js ADDED
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @typedef { import('sweetalert2').default } SweetAlert2
3
+ * @typedef { import('sweetalert2').SweetAlertOptions } SweetAlertOptions
4
+ */
5
+
6
+ /**
7
+ * @typedef { import('./utils/Timer').default } Timer
8
+ */
9
+
10
+ /**
11
+ * @typedef GlobalState
12
+ * @prop {SweetAlert2} [currentInstance]
13
+ * @prop {Element} [previousActiveElement]
14
+ * @prop {Timer} [timeout]
15
+ * @prop {NodeJS.Timeout} [restoreFocusTimeout]
16
+ * @prop {(this: HTMLElement, event: KeyboardEvent) => any} [keydownHandler]
17
+ * @prop {HTMLElement | (Window & typeof globalThis)} [keydownTarget]
18
+ * @prop {boolean} [keydownHandlerAdded]
19
+ * @prop {boolean} [keydownListenerCapture]
20
+ * @prop {function} [swalCloseEventFinishedCallback]
21
+ */
22
+
23
+ /**
24
+ * @typedef DomCache
25
+ * @prop {HTMLElement} popup
26
+ * @prop {HTMLElement} container
27
+ * @prop {HTMLElement} actions
28
+ * @prop {HTMLElement} confirmButton
29
+ * @prop {HTMLElement} denyButton
30
+ * @prop {HTMLElement} cancelButton
31
+ * @prop {HTMLElement} loader
32
+ * @prop {HTMLElement} closeButton
33
+ * @prop {HTMLElement} validationMessage
34
+ * @prop {HTMLElement} progressSteps
35
+ */
@@ -1,5 +1,8 @@
1
1
  import { isNodeEnv } from '../isNodeEnv.js'
2
2
 
3
+ /**
4
+ * @returns {'webkitAnimationEnd' | 'animationend' | false}
5
+ */
3
6
  export const animationEndEvent = (() => {
4
7
  // Prevent run in Node env
5
8
  /* istanbul ignore if */