jm-expense-vue-ts/assets/Logs.28852302.js

65 lines
48 KiB
JavaScript
Raw Normal View History

2022-04-24 05:11:48 +00:00
import{g as je}from"./dateFormat.a9df66b7.js";import{r as Dt}from"./record.727acb18.js";import{S as It}from"./Spinner.9807c4e4.js";import{_ as Lt}from"./index.6b72a0c0.js";import{e as Ot,x as le,f as Mt,o as g,g as m,h as c,F as O,k as ce,n as Ve,t as p,m as J,P as H,p as Ft,A as Ht,B as jt,l as P}from"./vendor.961f4417.js";var et="/jm-expense-vue-ts/assets/favicon.90f8b31e.ico",tt="/jm-expense-vue-ts/assets/karol.27263ac1.png";const ot="SweetAlert2:",Vt=e=>{const t=[];for(let o=0;o<e.length;o++)t.indexOf(e[o])===-1&&t.push(e[o]);return t},_e=e=>e.charAt(0).toUpperCase()+e.slice(1),S=e=>Array.prototype.slice.call(e),A=e=>{console.warn(`${ot} ${typeof e=="object"?e.join(" "):e}`)},W=e=>{console.error(`${ot} ${e}`)},qe=[],qt=e=>{qe.includes(e)||(qe.push(e),A(e))},Wt=(e,t)=>{qt(`"${e}" is deprecated and will be removed in the next major release. Please use "${t}" instead.`)},pe=e=>typeof e=="function"?e():e,Ae=e=>e&&typeof e.toPromise=="function",te=e=>Ae(e)?e.toPromise():Promise.resolve(e),Ee=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},Nt=["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"],Rt={},Ut=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],nt=e=>Object.prototype.hasOwnProperty.call(R,e),st=e=>Nt.indexOf(e)!==-1,ve=e=>Rt[e],zt=e=>{nt(e)||A(`Unknown parameter "${e}"`)},Kt=e=>{Ut.includes(e)&&A(`The parameter "${e}" is incompatible with toasts`)},Yt=e=>{ve(e)&&Wt(e,ve(e))},Zt=e=>{!e.backdrop&&e.allowOutsideClick&&A('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)zt(t),e.toast&&Kt(t),Yt(t)},Jt="swal2-",it=e=>{const t={};for(const o in e)t[e[o]]=Jt+e[o];return t},s=it(["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-o
2022-04-16 13:28:48 +00:00
a[href],
area[href],
input:not([disabled]),
select:not([disabled]),
textarea:not([disabled]),
button:not([disabled]),
iframe,
object,
embed,
[tabindex="0"],
[contenteditable],
audio[controls],
video[controls],
summary
2022-04-24 05:11:48 +00:00
`,xe=()=>{const e=S(f().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((o,n)=>{const i=parseInt(o.getAttribute("tabindex")),r=parseInt(n.getAttribute("tabindex"));return i>r?1:i<r?-1:0}),t=S(f().querySelectorAll(Gt)).filter(o=>o.getAttribute("tabindex")!=="-1");return Vt(e.concat(t)).filter(o=>E(o))},$e=()=>L(document.body,s.shown)&&!L(document.body,s["toast-shown"])&&!L(document.body,s["no-backdrop"]),me=()=>f()&&L(f(),s.toast),Qt=()=>f().hasAttribute("data-loading"),U={previousBodyPadding:null},v=(e,t)=>{if(e.textContent="",t){const n=new DOMParser().parseFromString(t,"text/html");S(n.querySelector("head").childNodes).forEach(i=>{e.appendChild(i)}),S(n.querySelector("body").childNodes).forEach(i=>{e.appendChild(i)})}},L=(e,t)=>{if(!t)return!1;const o=t.split(/\s+/);for(let n=0;n<o.length;n++)if(!e.classList.contains(o[n]))return!1;return!0},eo=(e,t)=>{S(e.classList).forEach(o=>{!Object.values(s).includes(o)&&!Object.values(X).includes(o)&&!Object.values(t.showClass).includes(o)&&e.classList.remove(o)})},x=(e,t,o)=>{if(eo(e,t),t.customClass&&t.customClass[o]){if(typeof t.customClass[o]!="string"&&!t.customClass[o].forEach)return A(`Invalid type of customClass.${o}! Expected string or iterable object, got "${typeof t.customClass[o]}"`);d(e,t.customClass[o])}},Te=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${s.popup} > .${s[t]}`);case"checkbox":return e.querySelector(`.${s.popup} > .${s.checkbox} input`);case"radio":return e.querySelector(`.${s.popup} > .${s.radio} input:checked`)||e.querySelector(`.${s.popup} > .${s.radio} input:first-child`);case"range":return e.querySelector(`.${s.popup} > .${s.range} input`);default:return e.querySelector(`.${s.popup} > .${s.input}`)}},ut=e=>{if(e.focus(),e.type!=="file"){const t=e.value;e.value="",e.value=t}},dt=(e,t,o)=>{!e||!t||(typeof t=="string"&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(n=>{Array.isArray(e)?e.forEach(i=>{o?i.classList.add(n):i.classList.remove(n)}):o?e.classList.add(n):e.classList.remove(n)}))},d=(e,t)=>{dt(e,t,!0)},I=(e,t)=>{dt(e,t,!1)},M=(e,t)=>{const o=S(e.childNodes);for(let n=0;n<o.length;n++)if(L(o[n],t))return o[n]},G=(e,t,o)=>{o===`${parseInt(o)}`&&(o=parseInt(o)),o||parseInt(o)===0?e.style[t]=typeof o=="number"?`${o}px`:o:e.style.removeProperty(t)},y=(e,t="flex")=>{e.style.display=t},k=e=>{e.style.display="none"},We=(e,t,o,n)=>{const i=e.querySelector(t);i&&(i.style[o]=n)},be=(e,t,o)=>{t?y(e,o):k(e)},E=e=>!!(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),to=()=>!E(T())&&!E(F())&&!E(V()),Ne=e=>e.scrollHeight>e.clientHeight,ft=e=>{const t=window.getComputedStyle(e),o=parseFloat(t.getPropertyValue("animation-duration")||"0"),n=parseFloat(t.getPropertyValue("transition-duration")||"0");return o>0||n>0},De=(e,t=!1)=>{const o=ge();E(o)&&(t&&(o.style.transition="none",o.style.width="100%"),setTimeout(()=>{o.style.transition=`width ${e/1e3}s linear`,o.style.width="0%"},10))},oo=()=>{const e=ge(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const o=parseInt(window.getComputedStyle(e).width),n=t/o*100;e.style.removeProperty("transition"),e.style.width=`${n}%`},pt=()=>typeof window=="undefined"||typeof document=="undefined",no=100,a={},so=()=>{a.previousActiveElement&&a.previousActiveElement.focus?(a.previousActiveElement.focus(),a.previousActiveElement=null):document.body&&document.body.focus()},io=e=>new Promise(t=>{if(!e)return t();const o=window.scrollX,n=window.scrollY;a.restoreFocusTimeout=setTimeout(()=>{so(),t()},no),window.scrollTo(o,n)}),ro=`
2022-04-16 13:28:48 +00:00
<div aria-labelledby="${s.title}" aria-describedby="${s["html-container"]}" class="${s.popup}" tabindex="-1">
<button type="button" class="${s.close}"></button>
<ul class="${s["progress-steps"]}"></ul>
<div class="${s.icon}"></div>
<img class="${s.image}" />
<h2 class="${s.title}" id="${s.title}"></h2>
<div class="${s["html-container"]}" id="${s["html-container"]}"></div>
<input class="${s.input}" />
<input type="file" class="${s.file}" />
<div class="${s.range}">
<input type="range" />
<output></output>
</div>
<select class="${s.select}"></select>
<div class="${s.radio}"></div>
<label for="${s.checkbox}" class="${s.checkbox}">
<input type="checkbox" />
<span class="${s.label}"></span>
</label>
<textarea class="${s.textarea}"></textarea>
<div class="${s["validation-message"]}" id="${s["validation-message"]}"></div>
<div class="${s.actions}">
<div class="${s.loader}"></div>
<button type="button" class="${s.confirm}"></button>
<button type="button" class="${s.deny}"></button>
<button type="button" class="${s.cancel}"></button>
</div>
<div class="${s.footer}"></div>
<div class="${s["timer-progress-bar-container"]}">
<div class="${s["timer-progress-bar"]}"></div>
</div>
</div>
2022-04-24 05:11:48 +00:00
`.replace(/(^|\n)\s*/g,""),lo=()=>{const e=C();return e?(e.remove(),I([document.documentElement,document.body],[s["no-backdrop"],s["toast-shown"],s["has-column"]]),!0):!1},j=()=>{a.currentInstance.resetValidationMessage()},co=()=>{const e=f(),t=M(e,s.input),o=M(e,s.file),n=e.querySelector(`.${s.range} input`),i=e.querySelector(`.${s.range} output`),r=M(e,s.select),h=e.querySelector(`.${s.checkbox} input`),B=M(e,s.textarea);t.oninput=j,o.onchange=j,r.onchange=j,h.onchange=j,B.oninput=j,n.oninput=()=>{j(),i.value=n.value},n.onchange=()=>{j(),n.nextSibling.value=n.value}},ao=e=>typeof e=="string"?document.querySelector(e):e,uo=e=>{const t=f();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},fo=e=>{window.getComputedStyle(e).direction==="rtl"&&d(C(),s.rtl)},po=e=>{const t=lo();if(pt()){W("SweetAlert2 requires document to initialize");return}const o=document.createElement("div");o.className=s.container,t&&d(o,s["no-transition"]),v(o,ro);const n=ao(e.target);n.appendChild(o),uo(e),fo(n),co()},Ie=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):typeof e=="object"?ho(e,t):e&&v(t,e)},ho=(e,t)=>{e.jquery?go(t,e):v(t,e.toString())},go=(e,t)=>{if(e.textContent="",0 in t)for(let o=0;o in t;o++)e.appendChild(t[o].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Q=(()=>{if(pt())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&typeof e.style[o]!="undefined")return t[o];return!1})(),mo=()=>{const e=document.createElement("div");e.className=s["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},bo=(e,t)=>{const o=se(),n=K();!t.showConfirmButton&&!t.showDenyButton&&!t.showCancelButton?k(o):y(o),x(o,t,"actions"),yo(o,n,t),v(n,t.loaderHtml),x(n,t,"loader")};function yo(e,t,o){const n=T(),i=F(),r=V();ye(n,"confirm",o),ye(i,"deny",o),ye(r,"cancel",o),wo(n,i,r,o),o.reverseButtons&&(o.toast?(e.insertBefore(r,n),e.insertBefore(i,n)):(e.insertBefore(r,t),e.insertBefore(i,t),e.insertBefore(n,t)))}function wo(e,t,o,n){if(!n.buttonsStyling)return I([e,t,o],s.styled);d([e,t,o],s.styled),n.confirmButtonColor&&(e.style.backgroundColor=n.confirmButtonColor,d(e,s["default-outline"])),n.denyButtonColor&&(t.style.backgroundColor=n.denyButtonColor,d(t,s["default-outline"])),n.cancelButtonColor&&(o.style.backgroundColor=n.cancelButtonColor,d(o,s["default-outline"]))}function ye(e,t,o){be(e,o[`show${_e(t)}Button`],"inline-block"),v(e,o[`${t}ButtonText`]),e.setAttribute("aria-label",o[`${t}ButtonAriaLabel`]),e.className=s[t],x(e,o,`${t}Button`),d(e,o[`${t}ButtonClass`])}function vo(e,t){typeof t=="string"?e.style.background=t:t||d([document.documentElement,document.body],s["no-backdrop"])}function Co(e,t){t in s?d(e,s[t]):(A('The "position" parameter is not valid, defaulting to "center"'),d(e,s.center))}function ko(e,t){if(t&&typeof t=="string"){const o=`grow-${t}`;o in s&&d(e,s[o])}}const Po=(e,t)=>{const o=C();!o||(vo(o,t.backdrop),Co(o,t.position),ko(o,t.grow),x(o,t,"container"))};var u={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const Bo=["input","file","range","select","radio","checkbox","textarea"],_o=(e,t)=>{const o=f(),n=u.innerParams.get(e),i=!n||t.input!==n.input;Bo.forEach(r=>{const h=s[r],B=M(o,h);So(r,t.inputAttributes),B.className=h,i&&k(B)}),t.input&&(i&&Ao(t),xo(t))},Ao=e=>{if(!_[e.input])return W(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${e.input}"`);const t=ht(e.input),o=_[e.input](t,e);y(o),setTimeout(()=>{ut(o)})},Eo=e=>{for(let t=0;t<e.attributes.length;t++){const o=e.attributes[t].name;["type","value","style"].includes(o)||e.removeAttribute(o)}},So=(e,t)=>{const o=Te(f(),e);if(!!o){Eo(o);for(const n in t)o.setAttribute(n,t[n])}},xo=e=>{const t=ht(e.input);e.customClas
2022-04-16 13:28:48 +00:00
<div class="swal2-success-circular-line-left"></div>
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
<div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
<div class="swal2-success-circular-line-right"></div>
`,Mo=`
<span class="swal2-x-mark">
<span class="swal2-x-mark-line-left"></span>
<span class="swal2-x-mark-line-right"></span>
</span>
2022-04-24 05:11:48 +00:00
`,Ue=(e,t)=>{e.textContent="",t.iconHtml?v(e,ze(t.iconHtml)):t.icon==="success"?v(e,Oo):t.icon==="error"?v(e,Mo):v(e,ze({question:"?",warning:"!",info:"i"}[t.icon]))},Fo=(e,t)=>{if(!!t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const o of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])We(e,o,"backgroundColor",t.iconColor);We(e,".swal2-success-ring","borderColor",t.iconColor)}},ze=e=>`<div class="${s["icon-content"]}">${e}</div>`,Ho=(e,t)=>{const o=lt();if(!t.imageUrl)return k(o);y(o,""),o.setAttribute("src",t.imageUrl),o.setAttribute("alt",t.imageAlt),G(o,"width",t.imageWidth),G(o,"height",t.imageHeight),o.className=s.image,x(o,t,"image")},jo=e=>{const t=document.createElement("li");return d(t,s["progress-step"]),v(t,e),t},Vo=e=>{const t=document.createElement("li");return d(t,s["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t},qo=(e,t)=>{const o=ct();if(!t.progressSteps||t.progressSteps.length===0)return k(o);y(o),o.textContent="",t.currentProgressStep>=t.progressSteps.length&&A("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach((n,i)=>{const r=jo(n);if(o.appendChild(r),i===t.currentProgressStep&&d(r,s["active-progress-step"]),i!==t.progressSteps.length-1){const h=Vo(t);o.appendChild(h)}})},Wo=(e,t)=>{const o=rt();be(o,t.title||t.titleText,"block"),t.title&&Ie(t.title,o),t.titleText&&(o.innerText=t.titleText),x(o,t,"title")},No=(e,t)=>{const o=C(),n=f();t.toast?(G(o,"width",t.width),n.style.width="100%",n.insertBefore(K(),ne())):G(n,"width",t.width),G(n,"padding",t.padding),t.color&&(n.style.color=t.color),t.background&&(n.style.background=t.background),k(he()),Ro(n,t)},Ro=(e,t)=>{e.className=`${s.popup} ${E(e)?t.showClass.popup:""}`,t.toast?(d([document.documentElement,document.body],s["toast-shown"]),d(e,s.toast)):d(e,s.modal),x(e,t,"popup"),typeof t.customClass=="string"&&d(e,t.customClass),t.icon&&d(e,s[`icon-${t.icon}`])},gt=(e,t)=>{No(e,t),Po(e,t),qo(e,t),Io(e,t),Ho(e,t),Wo(e,t),Do(e,t),$o(e,t),bo(e,t),To(e,t),typeof t.didRender=="function"&&t.didRender(f())},Y=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Uo=()=>{S(document.body.children).forEach(t=>{t===C()||t.contains(C())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))})},mt=()=>{S(document.body.children).forEach(t=>{t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})},bt=["swal-title","swal-html","swal-footer"],zo=e=>{const t=typeof e.template=="string"?document.querySelector(e.template):e.template;if(!t)return{};const o=t.content;return Qo(o),Object.assign(Ko(o),Yo(o),Zo(o),Jo(o),Xo(o),Go(o,bt))},Ko=e=>{const t={};return S(e.querySelectorAll("swal-param")).forEach(o=>{q(o,["name","value"]);const n=o.getAttribute("name"),i=o.getAttribute("value");typeof R[n]=="boolean"&&i==="false"&&(t[n]=!1),typeof R[n]=="object"&&(t[n]=JSON.parse(i))}),t},Yo=e=>{const t={};return S(e.querySelectorAll("swal-button")).forEach(o=>{q(o,["type","color","aria-label"]);const n=o.getAttribute("type");t[`${n}ButtonText`]=o.innerHTML,t[`show${_e(n)}Button`]=!0,o.hasAttribute("color")&&(t[`${n}ButtonColor`]=o.getAttribute("color")),o.hasAttribute("aria-label")&&(t[`${n}ButtonAriaLabel`]=o.getAttribute("aria-label"))}),t},Zo=e=>{const t={},o=e.querySelector("swal-image");return o&&(q(o,["src","width","height","alt"]),o.hasAttribute("src")&&(t.imageUrl=o.getAttribute("src")),o.hasAttribute("width")&&(t.imageWidth=o.getAttribute("width")),o.hasAttribute("height")&&(t.imageHeight=o.getAttribute("height")),o.hasAttribute("alt")&&(t.imageAlt=o.getAttribute("alt"))),t},Jo=e=>{const t={},o=e.querySelector("swal-icon");return o&&(q(o,["type","color"]),o.hasAttribute("ty
2022-04-16 13:28:48 +00:00
showLoaderOnConfirm should be used together with preConfirm, see usage example:
https://sweetalert2.github.io/#ajax-request`),tn(e),typeof e.title=="string"&&(e.title=e.title.split(`
2022-04-24 05:11:48 +00:00
`).join("<br />")),po(e)}class nn{constructor(t,o){this.callback=t,this.remaining=o,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(t){const o=this.running;return o&&this.stop(),this.remaining+=t,o&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const sn=()=>{U.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(U.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${U.previousBodyPadding+mo()}px`)},rn=()=>{U.previousBodyPadding!==null&&(document.body.style.paddingRight=`${U.previousBodyPadding}px`,U.previousBodyPadding=null)},ln=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!L(document.body,s.iosfix)){const t=document.body.scrollTop;document.body.style.top=`${t*-1}px`,d(document.body,s.iosfix),an(),cn()}},cn=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),o=!!e.match(/WebKit/i);t&&o&&!e.match(/CriOS/i)&&f().scrollHeight>window.innerHeight-44&&(C().style.paddingBottom=`${44}px`)},an=()=>{const e=C();let t;e.ontouchstart=o=>{t=un(o)},e.ontouchmove=o=>{t&&(o.preventDefault(),o.stopPropagation())}},un=e=>{const t=e.target,o=C();return dn(e)||fn(e)?!1:t===o||!Ne(o)&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&!(Ne(ue())&&ue().contains(t))},dn=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus",fn=e=>e.touches&&e.touches.length>1,pn=()=>{if(L(document.body,s.iosfix)){const e=parseInt(document.body.style.top,10);I(document.body,s.iosfix),document.body.style.top="",document.body.scrollTop=e*-1}},yt=10,hn=e=>{const t=C(),o=f();typeof e.willOpen=="function"&&e.willOpen(o);const i=window.getComputedStyle(document.body).overflowY;bn(t,o,e),setTimeout(()=>{gn(t,o)},yt),$e()&&(mn(t,e.scrollbarPadding,i),Uo()),!me()&&!a.previousActiveElement&&(a.previousActiveElement=document.activeElement),typeof e.didOpen=="function"&&setTimeout(()=>e.didOpen(o)),I(t,s["no-transition"])},wt=e=>{const t=f();if(e.target!==t)return;const o=C();t.removeEventListener(Q,wt),o.style.overflowY="auto"},gn=(e,t)=>{Q&&ft(t)?(e.style.overflowY="hidden",t.addEventListener(Q,wt)):e.style.overflowY="auto"},mn=(e,t,o)=>{ln(),t&&o!=="hidden"&&sn(),setTimeout(()=>{e.scrollTop=0})},bn=(e,t,o)=>{d(e,o.showClass.backdrop),t.style.setProperty("opacity","0","important"),y(t,"grid"),setTimeout(()=>{d(t,o.showClass.popup),t.style.removeProperty("opacity")},yt),d([document.documentElement,document.body],s.shown),o.heightAuto&&o.backdrop&&!o.toast&&d([document.documentElement,document.body],s["height-auto"])},z=e=>{let t=f();t||new fe,t=f();const o=K();me()?k(ne()):yn(t,e),y(o),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},yn=(e,t)=>{const o=se(),n=K();!t&&E(T())&&(t=T()),y(o),t&&(k(t),n.setAttribute("data-button-to-replace",t.className)),n.parentNode.insertBefore(n,t),d([e,o],s.loading)},wn=(e,t)=>{t.input==="select"||t.input==="radio"?Bn(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(Ae(t.inputValue)||Ee(t.inputValue))&&(z(T()),_n(e,t))},vn=(e,t)=>{const o=e.getInput();if(!o)return null;switch(t.input){case"checkbox":return Cn(o);case"radio":return kn(o);case"file":return Pn(o);default:return t.inputAutoTrim?o.value.trim():o.value}},Cn=e=>e.checked?1:0,kn=e=>e.checked?e.value:null,Pn=e=>e.files.length?e.getAttribute("multiple")!==null?e.files:e.files[0]:null,Bn=(e,t)=>{const o=f(),n=i=>An[t.input](o,Ce(i),t);Ae(t.inputOptions)||Ee(t.inputOptions)?(z(T()),te(t.inputOptions).then(i=>{e.hideLoading(),n(i)})):typeof t.inputOptions=="object"?n(t.inputOptions):W(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof
2022-04-16 13:28:48 +00:00
2022-04-24 05:11:48 +00:00
If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`)}),t};function ts(){const e=u.domCache.get(this),t=u.innerParams.get(this);if(!t){At(this);return}e.popup&&a.swalCloseEventFinishedCallback&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback),a.deferDisposalTimer&&(clearTimeout(a.deferDisposalTimer),delete a.deferDisposalTimer),typeof t.didDestroy=="function"&&t.didDestroy(),os(this)}const os=e=>{At(e),delete e.params,delete a.keydownHandler,delete a.keydownTarget,delete a.currentInstance},At=e=>{e.isAwaitingPromise()?(we(u,e),u.awaitingPromise.set(e,!0)):(we(ee,e),we(u,e))},we=(e,t)=>{for(const o in e)e[o].delete(t)};var Et=Object.freeze(Object.defineProperty({__proto__:null,hideLoading:Ze,disableLoading:Ze,getInput:Sn,close:ae,isAwaitingPromise:Vn,rejectPromise:Wn,handleAwaitingPromise:re,closePopup:ae,closeModal:ae,closeToast:ae,enableButtons:zn,disableButtons:Kn,enableInput:Yn,disableInput:Zn,showValidationMessage:Jn,resetValidationMessage:Xn,getProgressSteps:Gn,update:Qn,_destroy:ts},Symbol.toStringTag,{value:"Module"}));const ns=e=>{const t=u.innerParams.get(e);e.disableButtons(),t.input?St(e,"confirm"):Me(e,!0)},ss=e=>{const t=u.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?St(e,"deny"):Oe(e,!1)},is=(e,t)=>{e.disableButtons(),t(Y.cancel)},St=(e,t)=>{const o=u.innerParams.get(e);if(!o.input)return W(`The "input" parameter is needed to be set when using returnInputValueOn${_e(t)}`);const n=vn(e,o);o.inputValidator?rs(e,n,t):e.getInput().checkValidity()?t==="deny"?Oe(e,n):Me(e,n):(e.enableButtons(),e.showValidationMessage(o.validationMessage))},rs=(e,t,o)=>{const n=u.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>te(n.inputValidator(t,n.validationMessage))).then(r=>{e.enableButtons(),e.enableInput(),r?e.showValidationMessage(r):o==="deny"?Oe(e,t):Me(e,t)})},Oe=(e,t)=>{const o=u.innerParams.get(e||globalThis);o.showLoaderOnDeny&&z(F()),o.preDeny?(u.awaitingPromise.set(e||globalThis,!0),Promise.resolve().then(()=>te(o.preDeny(t,o.validationMessage))).then(i=>{i===!1?(e.hideLoading(),re(e)):e.closePopup({isDenied:!0,value:typeof i=="undefined"?t:i})}).catch(i=>xt(e||globalThis,i))):e.closePopup({isDenied:!0,value:t})},Xe=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},xt=(e,t)=>{e.rejectPromise(t)},Me=(e,t)=>{const o=u.innerParams.get(e||globalThis);o.showLoaderOnConfirm&&z(),o.preConfirm?(e.resetValidationMessage(),u.awaitingPromise.set(e||globalThis,!0),Promise.resolve().then(()=>te(o.preConfirm(t,o.validationMessage))).then(i=>{E(he())||i===!1?(e.hideLoading(),re(e)):Xe(e,typeof i=="undefined"?t:i)}).catch(i=>xt(e||globalThis,i))):Xe(e,t)},ls=(e,t,o)=>{u.innerParams.get(e).toast?cs(e,t,o):(us(t),ds(t),fs(e,t,o))},cs=(e,t,o)=>{t.popup.onclick=()=>{const n=u.innerParams.get(e);n&&(as(n)||n.timer||n.input)||o(Y.close)}},as=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let de=!1;const us=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(de=!0)}}},ds=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(de=!0)}}},fs=(e,t,o)=>{t.container.onclick=n=>{const i=u.innerParams.get(e);if(de){de=!1;return}n.target===t.container&&pe(i.allowOutsideClick)&&o(Y.backdrop)}},ps=e=>typeof e=="object"&&e.jquery,Ge=e=>e instanceof Element||ps(e),hs=e=>{const t={};return typeof e[0]=="object"&&!Ge(e[0])?Object.assign(t,e[0]):["title","html","icon"].forEach((o,n)=>{const i=e[n];typeof i=="string"||Ge(i)?t[o]=i:i!==void 0&&W(`Unexpected type of ${o}! Expected "string" or "Element", got ${typeof i}`)}),t};function gs(...e){const t=this;return new t(...e)}function ms(e){class t extends this{_main(n,i){return super._main(n,Object.assign({},e,i))}}return t}const bs=()=>a.timeout&&a.timeout.getTimerLeft(),$t=()=>{if(a.timeout)return oo(),a.timeout.stop()},Tt=()=>{if(a.timeout){const e=a.timeout.start();ret