|
1
|
|
-(()=>{var e={8465(e){e.exports=function(){"use strict";function e(e,t,o){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:o;throw new TypeError("Private element is not present on this object")}function t(t,o){return t.get(e(t,o))}function o(e,t,o){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,o)}const s={},n=e=>new Promise(t=>{if(!e)return t();const o=window.scrollX,n=window.scrollY;s.restoreFocusTimeout=setTimeout(()=>{s.previousActiveElement instanceof HTMLElement?(s.previousActiveElement.focus(),s.previousActiveElement=null):document.body&&document.body.focus(),t()},100),window.scrollTo(o,n)}),i="swal2-",a=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","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","draggable","dragging"].reduce((e,t)=>(e[t]=i+t,e),{}),r=["success","warning","info","question","error"].reduce((e,t)=>(e[t]=i+t,e),{}),l="SweetAlert2:",c=e=>e.charAt(0).toUpperCase()+e.slice(1),d=e=>{console.warn(`${l} ${"object"==typeof e?e.join(" "):e}`)},u=e=>{console.error(`${l} ${e}`)},w=[],m=(e,t=null)=>{var o;o=`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`,w.includes(o)||(w.push(o),d(o))},p=e=>"function"==typeof e?e():e,h=e=>e&&"function"==typeof e.toPromise,g=e=>h(e)?e.toPromise():Promise.resolve(e),b=e=>e&&Promise.resolve(e)===e,f=()=>document.body.querySelector(`.${a.container}`),v=e=>{const t=f();return t?t.querySelector(e):null},y=e=>v(`.${e}`),k=()=>y(a.popup),x=()=>y(a.icon),C=()=>y(a.title),A=()=>y(a["html-container"]),E=()=>y(a.image),B=()=>y(a["progress-steps"]),z=()=>y(a["validation-message"]),$=()=>v(`.${a.actions} .${a.confirm}`),L=()=>v(`.${a.actions} .${a.cancel}`),S=()=>v(`.${a.actions} .${a.deny}`),q=()=>v(`.${a.loader}`),_=()=>y(a.actions),P=()=>y(a.footer),T=()=>y(a["timer-progress-bar"]),M=()=>y(a.close),H=()=>{const e=k();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),o=Array.from(t).sort((e,t)=>{const o=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return o>s?1:o<s?-1:0}),s=e.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'),n=Array.from(s).filter(e=>"-1"!==e.getAttribute("tabindex"));return[...new Set(o.concat(n))].filter(e=>ee(e))},I=()=>D(document.body,a.shown)&&!D(document.body,a["toast-shown"])&&!D(document.body,a["no-backdrop"]),O=()=>{const e=k();return!!e&&D(e,a.toast)},j=(e,t)=>{if(e.textContent="",t){const o=(new DOMParser).parseFromString(t,"text/html"),s=o.querySelector("head");s&&Array.from(s.childNodes).forEach(t=>{e.appendChild(t)});const n=o.querySelector("body");n&&Array.from(n.childNodes).forEach(t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)})}},D=(e,t)=>{if(!t)return!1;const o=t.split(/\s+/);for(let t=0;t<o.length;t++)if(!e.classList.contains(o[t]))return!1;return!0},R=(e,t,o)=>{if(((e,t)=>{Array.from(e.classList).forEach(o=>{Object.values(a).includes(o)||Object.values(r).includes(o)||Object.values(t.showClass||{}).includes(o)||e.classList.remove(o)})})(e,t),!t.customClass)return;const s=t.customClass[o];s&&("string"==typeof s||s.forEach?K(e,s):d(`Invalid type of customClass.${o}! Expected string or iterable object, got "${typeof s}"`))},Q=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${a.popup} > .${a[t]}`);case"checkbox":return e.querySelector(`.${a.popup} > .${a.checkbox} input`);case"radio":return e.querySelector(`.${a.popup} > .${a.radio} input:checked`)||e.querySelector(`.${a.popup} > .${a.radio} input:first-child`);case"range":return e.querySelector(`.${a.popup} > .${a.range} input`);default:return e.querySelector(`.${a.popup} > .${a.input}`)}},N=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},V=(e,t,o)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(t=>{Array.isArray(e)?e.forEach(e=>{o?e.classList.add(t):e.classList.remove(t)}):o?e.classList.add(t):e.classList.remove(t)}))},K=(e,t)=>{V(e,t,!0)},F=(e,t)=>{V(e,t,!1)},U=(e,t)=>{const o=Array.from(e.children);for(let e=0;e<o.length;e++){const s=o[e];if(s instanceof HTMLElement&&D(s,t))return s}},Y=(e,t,o)=>{o===`${parseInt(`${o}`)}`&&(o=parseInt(o)),o||0===parseInt(`${o}`)?e.style.setProperty(t,"number"==typeof o?`${o}px`:o):e.style.removeProperty(t)},W=(e,t="flex")=>{e&&(e.style.display=t)},X=e=>{e&&(e.style.display="none")},Z=(e,t="block")=>{e&&new MutationObserver(()=>{G(e,e.innerHTML,t)}).observe(e,{childList:!0,subtree:!0})},J=(e,t,o,s)=>{const n=e.querySelector(t);n&&n.style.setProperty(o,s)},G=(e,t,o="flex")=>{t?W(e,o):X(e)},ee=e=>Boolean(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),te=e=>Boolean(e.scrollHeight>e.clientHeight),oe=e=>{const t=window.getComputedStyle(e),o=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return o>0||s>0},se=(e,t=!1)=>{const o=T();o&&ee(o)&&(t&&(o.style.transition="none",o.style.width="100%"),setTimeout(()=>{o.style.transition=`width ${e/1e3}s linear`,o.style.width="0%"},10))},ne=`\n <div aria-labelledby="${a.title}" aria-describedby="${a["html-container"]}" class="${a.popup}" tabindex="-1">\n <button type="button" class="${a.close}"></button>\n <ul class="${a["progress-steps"]}"></ul>\n <div class="${a.icon}"></div>\n <img class="${a.image}" />\n <h2 class="${a.title}" id="${a.title}"></h2>\n <div class="${a["html-container"]}" id="${a["html-container"]}"></div>\n <input class="${a.input}" id="${a.input}" />\n <input type="file" class="${a.file}" />\n <div class="${a.range}">\n <input type="range" />\n <output></output>\n </div>\n <select class="${a.select}" id="${a.select}"></select>\n <div class="${a.radio}"></div>\n <label class="${a.checkbox}">\n <input type="checkbox" id="${a.checkbox}" />\n <span class="${a.label}"></span>\n </label>\n <textarea class="${a.textarea}" id="${a.textarea}"></textarea>\n <div class="${a["validation-message"]}" id="${a["validation-message"]}"></div>\n <div class="${a.actions}">\n <div class="${a.loader}"></div>\n <button type="button" class="${a.confirm}"></button>\n <button type="button" class="${a.deny}"></button>\n <button type="button" class="${a.cancel}"></button>\n </div>\n <div class="${a.footer}"></div>\n <div class="${a["timer-progress-bar-container"]}">\n <div class="${a["timer-progress-bar"]}"></div>\n </div>\n </div>\n`.replace(/(^|\n)\s*/g,""),ie=()=>{s.currentInstance&&s.currentInstance.resetValidationMessage()},ae=e=>{const t=(()=>{const e=f();return!!e&&(e.remove(),F([document.documentElement,document.body],[a["no-backdrop"],a["toast-shown"],a["has-column"]]),!0)})();if("undefined"==typeof window||"undefined"==typeof document)return void u("SweetAlert2 requires document to initialize");const o=document.createElement("div");o.className=a.container,t&&K(o,a["no-transition"]),j(o,ne),o.dataset.swal2Theme=e.theme;const n=(e=>{if("string"==typeof e){const t=document.querySelector(e);if(!t)throw new Error(`Target element "${e}" not found`);return t}return e})(e.target||"body");n.appendChild(o),e.topLayer&&(o.setAttribute("popover",""),o.showPopover()),(e=>{const t=k();t&&(t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true"))})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&(K(f(),a.rtl),s.isRTL=!0)})(n),(()=>{const e=k();if(!e)return;const t=U(e,a.input),o=U(e,a.file),s=e.querySelector(`.${a.range} input`),n=e.querySelector(`.${a.range} output`),i=U(e,a.select),r=e.querySelector(`.${a.checkbox} input`),l=U(e,a.textarea);t&&(t.oninput=ie),o&&(o.onchange=ie),i&&(i.onchange=ie),r&&(r.onchange=ie),l&&(l.oninput=ie),s&&n&&(s.oninput=()=>{ie(),n.value=s.value},s.onchange=()=>{ie(),n.value=s.value})})()},re=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?le(e,t):e&&j(t,e)},le=(e,t)=>{"jquery"in e?ce(t,e):j(t,e.toString())},ce=(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))},de=(e,t)=>{const o=_(),s=q();o&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?W(o):X(o),R(o,t,"actions"),function(e,t,o){const s=$(),n=S(),i=L();s&&n&&i&&(we(s,"confirm",o),we(n,"deny",o),we(i,"cancel",o),function(e,t,o,s){s.buttonsStyling?(K([e,t,o],a.styled),s.confirmButtonColor&&e.style.setProperty("--swal2-confirm-button-background-color",s.confirmButtonColor),s.denyButtonColor&&t.style.setProperty("--swal2-deny-button-background-color",s.denyButtonColor),s.cancelButtonColor&&o.style.setProperty("--swal2-cancel-button-background-color",s.cancelButtonColor),ue(e),ue(t),ue(o)):F([e,t,o],a.styled)}(s,n,i,o),o.reverseButtons&&(o.toast?(e.insertBefore(i,s),e.insertBefore(n,s)):(e.insertBefore(i,t),e.insertBefore(n,t),e.insertBefore(s,t))))}(o,s,t),j(s,t.loaderHtml||""),R(s,t,"loader"))};function ue(e){const t=window.getComputedStyle(e);if(t.getPropertyValue("--swal2-action-button-focus-box-shadow"))return;const o=t.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/,"rgba($1, $2, $3, 0.5)");e.style.setProperty("--swal2-action-button-focus-box-shadow",t.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/,` ${o}`))}function we(e,t,o){const s=c(t);G(e,o[`show${s}Button`],"inline-block"),j(e,o[`${t}ButtonText`]||""),e.setAttribute("aria-label",o[`${t}ButtonAriaLabel`]||""),e.className=a[t],R(e,o,`${t}Button`)}const me=(e,t)=>{const o=f();o&&(function(e,t){"string"==typeof t?e.style.background=t:t||K([document.documentElement,document.body],a["no-backdrop"])}(o,t.backdrop),function(e,t){t&&(t in a?K(e,a[t]):(d('The "position" parameter is not valid, defaulting to "center"'),K(e,a.center)))}(o,t.position),function(e,t){t&&K(e,a[`grow-${t}`])}(o,t.grow),R(o,t,"container"))};var pe={innerParams:new WeakMap,domCache:new WeakMap};const he=["input","file","range","select","radio","checkbox","textarea"],ge=e=>{if(!e.input)return;if(!Ce[e.input])return void u(`Unexpected type of input! Expected ${Object.keys(Ce).join(" | ")}, got "${e.input}"`);const t=ke(e.input);if(!t)return;const o=Ce[e.input](t,e);W(t),e.inputAutoFocus&&setTimeout(()=>{N(o)})},be=(e,t)=>{const o=k();if(!o)return;const s=Q(o,e);if(s){(e=>{for(let t=0;t<e.attributes.length;t++){const o=e.attributes[t].name;["id","type","value","style"].includes(o)||e.removeAttribute(o)}})(s);for(const e in t)s.setAttribute(e,t[e])}},fe=e=>{if(!e.input)return;const t=ke(e.input);t&&R(t,e,"input")},ve=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},ye=(e,t,o)=>{if(o.inputLabel){const s=document.createElement("label"),n=a["input-label"];s.setAttribute("for",e.id),s.className=n,"object"==typeof o.customClass&&K(s,o.customClass.inputLabel),s.innerText=o.inputLabel,t.insertAdjacentElement("beforebegin",s)}},ke=e=>{const t=k();if(t)return U(t,a[e]||a.input)},xe=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:b(t)||d(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},Ce={};Ce.text=Ce.email=Ce.password=Ce.number=Ce.tel=Ce.url=Ce.search=Ce.date=Ce["datetime-local"]=Ce.time=Ce.week=Ce.month=(e,t)=>{const o=e;return xe(o,t.inputValue),ye(o,o,t),ve(o,t),o.type=t.input,o},Ce.file=(e,t)=>{const o=e;return ye(o,o,t),ve(o,t),o},Ce.range=(e,t)=>{const o=e,s=o.querySelector("input"),n=o.querySelector("output");return s&&(xe(s,t.inputValue),s.type=t.input,ye(s,e,t)),n&&xe(n,t.inputValue),e},Ce.select=(e,t)=>{const o=e;if(o.textContent="",t.inputPlaceholder){const e=document.createElement("option");j(e,t.inputPlaceholder),e.value="",e.disabled=!0,e.selected=!0,o.appendChild(e)}return ye(o,o,t),o},Ce.radio=e=>(e.textContent="",e),Ce.checkbox=(e,t)=>{const o=k();if(!o)throw new Error("Popup not found");const s=Q(o,"checkbox");if(!s)throw new Error("Checkbox input not found");s.value="1",s.checked=Boolean(t.inputValue);const n=e.querySelector("span");if(n){const e=t.inputPlaceholder||t.inputLabel;e&&j(n,e)}return s},Ce.textarea=(e,t)=>{const o=e;xe(o,t.inputValue),ve(o,t),ye(o,o,t);return setTimeout(()=>{if("MutationObserver"in window){const e=k();if(!e)return;const s=parseInt(window.getComputedStyle(e).width);new MutationObserver(()=>{if(!document.body.contains(o))return;const e=o.offsetWidth+(i=o,parseInt(window.getComputedStyle(i).marginLeft)+parseInt(window.getComputedStyle(i).marginRight)),n=k();var i;n&&(e>s?n.style.width=`${e}px`:Y(n,"width",t.width))}).observe(o,{attributes:!0,attributeFilter:["style"]})}}),o};const Ae=(e,t)=>{const o=A();o&&(Z(o),R(o,t,"htmlContainer"),t.html?(re(t.html,o),W(o,"block")):t.text?(o.textContent=t.text,W(o,"block")):X(o),((e,t)=>{const o=k();if(!o)return;const s=pe.innerParams.get(e),n=!s||t.input!==s.input;he.forEach(e=>{const s=U(o,a[e]);s&&(be(e,t.inputAttributes),s.className=a[e],n&&X(s))}),t.input&&(n&&ge(t),fe(t))})(e,t))},Ee=(e,t)=>{for(const[o,s]of Object.entries(r))t.icon!==o&&F(e,s);K(e,t.icon&&r[t.icon]),$e(e,t),Be(),R(e,t,"icon")},Be=()=>{const e=k();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color"),o=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<o.length;e++)o[e].style.backgroundColor=t},ze=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let o=e.innerHTML,s="";t.iconHtml?s=Le(t.iconHtml):"success"===t.icon?(s=(e=>`\n ${e.animation?'<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>\n ${e.animation?'<div class="swal2-success-fix"></div>':""}\n ${e.animation?'<div class="swal2-success-circular-line-right"></div>':""}\n`)(t),o=o.replace(/ style=".*?"/g,"")):"error"===t.icon?s='\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':t.icon&&(s=Le({question:"?",warning:"!",info:"i"}[t.icon])),o.trim()!==s.trim()&&j(e,s)},$e=(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"])J(e,o,"background-color",t.iconColor);J(e,".swal2-success-ring","border-color",t.iconColor)}},Le=e=>`<div class="${a["icon-content"]}">${e}</div>`;let Se=!1,qe=0,_e=0,Pe=0,Te=0;const Me=e=>{const t=k();if(!t)return;const o=x();if(e.target===t||o&&o.contains(e.target)){Se=!0;const o=Oe(e);qe=o.clientX,_e=o.clientY,Pe=parseInt(t.style.insetInlineStart)||0,Te=parseInt(t.style.insetBlockStart)||0,K(t,"swal2-dragging")}},He=e=>{const t=k();if(t&&Se){let{clientX:o,clientY:n}=Oe(e);const i=o-qe;t.style.insetInlineStart=`${Pe+(s.isRTL?-i:i)}px`,t.style.insetBlockStart=`${Te+(n-_e)}px`}},Ie=()=>{const e=k();Se=!1,F(e,"swal2-dragging")},Oe=e=>{let t=0,o=0;return e.type.startsWith("mouse")?(t=e.clientX,o=e.clientY):e.type.startsWith("touch")&&(t=e.touches[0].clientX,o=e.touches[0].clientY),{clientX:t,clientY:o}},je=(e,t)=>{const o=f(),s=k();if(o&&s){if(t.toast){Y(o,"width",t.width),s.style.width="100%";const e=q();e&&s.insertBefore(e,x())}else Y(s,"width",t.width);Y(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),X(z()),De(s,t),t.draggable&&!t.toast?(K(s,a.draggable),(e=>{e.addEventListener("mousedown",Me),document.body.addEventListener("mousemove",He),e.addEventListener("mouseup",Ie),e.addEventListener("touchstart",Me),document.body.addEventListener("touchmove",He),e.addEventListener("touchend",Ie)})(s)):(F(s,a.draggable),(e=>{e.removeEventListener("mousedown",Me),document.body.removeEventListener("mousemove",He),e.removeEventListener("mouseup",Ie),e.removeEventListener("touchstart",Me),document.body.removeEventListener("touchmove",He),e.removeEventListener("touchend",Ie)})(s))}},De=(e,t)=>{const o=t.showClass||{};e.className=`${a.popup} ${ee(e)?o.popup:""}`,t.toast?(K([document.documentElement,document.body],a["toast-shown"]),K(e,a.toast)):K(e,a.modal),R(e,t,"popup"),"string"==typeof t.customClass&&K(e,t.customClass),t.icon&&K(e,a[`icon-${t.icon}`])},Re=e=>{const t=document.createElement("li");return K(t,a["progress-step"]),j(t,e),t},Qe=e=>{const t=document.createElement("li");return K(t,a["progress-step-line"]),e.progressStepsDistance&&Y(t,"width",e.progressStepsDistance),t},Ne=(e,t)=>{var o;je(0,t),me(0,t),((e,t)=>{const o=B();if(!o)return;const{progressSteps:s,currentProgressStep:n}=t;s&&0!==s.length&&void 0!==n?(W(o),o.textContent="",n>=s.length&&d("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach((e,i)=>{const r=Re(e);if(o.appendChild(r),i===n&&K(r,a["active-progress-step"]),i!==s.length-1){const e=Qe(t);o.appendChild(e)}})):X(o)})(0,t),((e,t)=>{const o=pe.innerParams.get(e),s=x();if(s){if(o&&t.icon===o.icon)return ze(s,t),void Ee(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(r).indexOf(t.icon))return u(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void X(s);W(s),ze(s,t),Ee(s,t),K(s,t.showClass&&t.showClass.icon),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",Be)}else X(s)}})(e,t),((e,t)=>{const o=E();o&&(t.imageUrl?(W(o,""),o.setAttribute("src",t.imageUrl),o.setAttribute("alt",t.imageAlt||""),Y(o,"width",t.imageWidth),Y(o,"height",t.imageHeight),o.className=a.image,R(o,t,"image")):X(o))})(0,t),((e,t)=>{const o=C();o&&(Z(o),G(o,Boolean(t.title||t.titleText),"block"),t.title&&re(t.title,o),t.titleText&&(o.innerText=t.titleText),R(o,t,"title"))})(0,t),((e,t)=>{const o=M();o&&(j(o,t.closeButtonHtml||""),R(o,t,"closeButton"),G(o,t.showCloseButton),o.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),Ae(e,t),de(0,t),((e,t)=>{const o=P();o&&(Z(o),G(o,Boolean(t.footer),"block"),t.footer&&re(t.footer,o),R(o,t,"footer"))})(0,t);const n=k();"function"==typeof t.didRender&&n&&t.didRender(n),null===(o=s.eventEmitter)||void 0===o||o.emit("didRender",n)},Ve=()=>{var e;return null===(e=$())||void 0===e?void 0:e.click()},Ke=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Fe=e=>{if(e.keydownTarget&&e.keydownHandlerAdded&&e.keydownHandler){const t=e.keydownHandler;e.keydownTarget.removeEventListener("keydown",t,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1}},Ue=(e,t)=>{var o;const s=H();if(s.length)return-2===(e+=t)&&(e=s.length-1),e===s.length?e=0:-1===e&&(e=s.length-1),void s[e].focus();null===(o=k())||void 0===o||o.focus()},Ye=["ArrowRight","ArrowDown"],We=["ArrowLeft","ArrowUp"],Xe=(e,t,o)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Ze(t,e):"Tab"===t.key?Je(t):[...Ye,...We].includes(t.key)?Ge(t.key):"Escape"===t.key&&et(t,e,o)))},Ze=(e,t)=>{if(!p(t.allowEnterKey))return;const o=k();if(!o||!t.input)return;const s=Q(o,t.input);if(e.target&&s&&e.target instanceof HTMLElement&&e.target.outerHTML===s.outerHTML){if(["textarea","file"].includes(t.input))return;Ve(),e.preventDefault()}},Je=e=>{const t=e.target,o=H();let s=-1;for(let e=0;e<o.length;e++)if(t===o[e]){s=e;break}e.shiftKey?Ue(s,-1):Ue(s,1),e.stopPropagation(),e.preventDefault()},Ge=e=>{const t=_(),o=$(),s=S(),n=L();if(!(t&&o&&s&&n))return;const i=[o,s,n];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const a=Ye.includes(e)?"nextElementSibling":"previousElementSibling";let r=document.activeElement;if(r){for(let e=0;e<t.children.length;e++){if(r=r[a],!r)return;if(r instanceof HTMLButtonElement&&ee(r))break}r instanceof HTMLButtonElement&&r.focus()}},et=(e,t,o)=>{e.preventDefault(),p(t.allowEscapeKey)&&o(Ke.esc)};var tt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const ot=()=>{Array.from(document.body.children).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="undefined"!=typeof window&&Boolean(window.GestureEvent),nt=()=>{const e=f();if(!e)return;let t;e.ontouchstart=e=>{t=it(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},it=e=>{const t=e.target,o=f(),s=A();return!(!o||!s||at(e)||rt(e)||t!==o&&(te(o)||!(t instanceof HTMLElement)||((e,t)=>{let o=e;for(;o&&o!==t;){if(te(o))return!0;o=o.parentElement}return!1})(t,s)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||te(s)&&s.contains(t)))},at=e=>Boolean(e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType),rt=e=>e.touches&&e.touches.length>1;let lt=null;const ct=e=>{null===lt&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(lt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${lt+(()=>{const e=document.createElement("div");e.className=a["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)};function dt(e,t,o,i){O()?ft(e,i):(n(o).then(()=>ft(e,i)),Fe(s)),st?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),I()&&(null!==lt&&(document.body.style.paddingRight=`${lt}px`,lt=null),(()=>{if(D(document.body,a.iosfix)){const e=parseInt(document.body.style.top,10);F(document.body,a.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),ot()),F([document.documentElement,document.body],[a.shown,a["height-auto"],a["no-backdrop"],a["toast-shown"]])}function ut(e){e=ht(e);const t=tt.swalPromiseResolve.get(this),o=wt(this);this.isAwaitingPromise?e.isDismissed||(pt(this),t(e)):o&&t(e)}const wt=e=>{const t=k();if(!t)return!1;const o=pe.innerParams.get(e);if(!o||D(t,o.hideClass.popup))return!1;F(t,o.showClass.popup),K(t,o.hideClass.popup);const s=f();return F(s,o.showClass.backdrop),K(s,o.hideClass.backdrop),gt(e,t,o),!0};function mt(e){const t=tt.swalPromiseReject.get(this);pt(this),t&&t(e)}const pt=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,pe.innerParams.get(e)||e._destroy())},ht=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),gt=(e,t,o)=>{var n;const i=f(),a=oe(t);"function"==typeof o.willClose&&o.willClose(t),null===(n=s.eventEmitter)||void 0===n||n.emit("willClose",t),a&&i?bt(e,t,i,Boolean(o.returnFocus),o.didClose):i&&dt(e,i,Boolean(o.returnFocus),o.didClose)},bt=(e,t,o,n,i)=>{s.swalCloseEventFinishedCallback=dt.bind(null,e,o,n,i);const a=function(e){var o;e.target===t&&(null===(o=s.swalCloseEventFinishedCallback)||void 0===o||o.call(s),delete s.swalCloseEventFinishedCallback,t.removeEventListener("animationend",a),t.removeEventListener("transitionend",a))};t.addEventListener("animationend",a),t.addEventListener("transitionend",a)},ft=(e,t)=>{setTimeout(()=>{var o;"function"==typeof t&&t.bind(e.params)(),null===(o=s.eventEmitter)||void 0===o||o.emit("didClose"),e._destroy&&e._destroy()})},vt=e=>{let t=k();if(t||new Go,t=k(),!t)return;const o=q();O()?X(x()):yt(t,e),W(o),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},yt=(e,t)=>{const o=_(),s=q();o&&s&&(!t&&ee($())&&(t=$()),W(o),t&&(X(t),s.setAttribute("data-button-to-replace",t.className),o.insertBefore(s,t)),K([e,o],a.loading))},kt=e=>e.checked?1:0,xt=e=>e.checked?e.value:null,Ct=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,At=(e,t)=>{const o=k();if(!o)return;const s=e=>{"select"===t.input?function(e,t,o){const s=U(e,a.select);if(!s)return;const n=(e,t,s)=>{const n=document.createElement("option");n.value=s,j(n,t),n.selected=zt(s,o.inputValue),e.appendChild(n)};t.forEach(e=>{const t=e[0],o=e[1];if(Array.isArray(o)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,s.appendChild(e),o.forEach(t=>n(e,t[1],t[0]))}else n(s,o,t)}),s.focus()}(o,Bt(e),t):"radio"===t.input&&function(e,t,o){const s=U(e,a.radio);if(!s)return;t.forEach(e=>{const t=e[0],n=e[1],i=document.createElement("input"),r=document.createElement("label");i.type="radio",i.name=a.radio,i.value=t,zt(t,o.inputValue)&&(i.checked=!0);const l=document.createElement("span");j(l,n),l.className=a.label,r.appendChild(i),r.appendChild(l),s.appendChild(r)});const n=s.querySelectorAll("input");n.length&&n[0].focus()}(o,Bt(e),t)};h(t.inputOptions)||b(t.inputOptions)?(vt($()),g(t.inputOptions).then(t=>{e.hideLoading(),s(t)})):"object"==typeof t.inputOptions?s(t.inputOptions):u("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},Et=(e,t)=>{const o=e.getInput();o&&(X(o),g(t.inputValue).then(s=>{o.value="number"===t.input?`${parseFloat(s)||0}`:`${s}`,W(o),o.focus(),e.hideLoading()}).catch(t=>{u(`Error in inputValue promise: ${t}`),o.value="",W(o),o.focus(),e.hideLoading()}))};const Bt=e=>{const t=[];return e instanceof Map?e.forEach((e,o)=>{let s=e;"object"==typeof s&&(s=Bt(s)),t.push([o,s])}):Object.keys(e).forEach(o=>{let s=e[o];"object"==typeof s&&(s=Bt(s)),t.push([o,s])}),t},zt=(e,t)=>Boolean(t)&&null!=t&&t.toString()===e.toString(),$t=(e,t)=>{const o=pe.innerParams.get(e);if(!o.input)return void u(`The "input" parameter is needed to be set when using returnInputValueOn${c(t)}`);const s=e.getInput(),n=((e,t)=>{const o=e.getInput();if(!o)return null;switch(t.input){case"checkbox":return kt(o);case"radio":return xt(o);case"file":return Ct(o);default:return t.inputAutoTrim?o.value.trim():o.value}})(e,o);o.inputValidator?Lt(e,n,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(o.validationMessage||s.validationMessage)):"deny"===t?St(e,n):Pt(e,n)},Lt=(e,t,o)=>{const s=pe.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>g(s.inputValidator(t,s.validationMessage))).then(s=>{e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===o?St(e,t):Pt(e,t)})},St=(e,t)=>{const o=pe.innerParams.get(e);o.showLoaderOnDeny&&vt(S()),o.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then(()=>g(o.preDeny(t,o.validationMessage))).then(o=>{!1===o?(e.hideLoading(),pt(e)):e.close({isDenied:!0,value:void 0===o?t:o})}).catch(t=>_t(e,t))):e.close({isDenied:!0,value:t})},qt=(e,t)=>{e.close({isConfirmed:!0,value:t})},_t=(e,t)=>{e.rejectPromise(t)},Pt=(e,t)=>{const o=pe.innerParams.get(e);o.showLoaderOnConfirm&&vt(),o.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then(()=>g(o.preConfirm(t,o.validationMessage))).then(o=>{ee(z())||!1===o?(e.hideLoading(),pt(e)):qt(e,void 0===o?t:o)}).catch(t=>_t(e,t))):qt(e,t)};function Tt(){const e=pe.innerParams.get(this);if(!e)return;const t=pe.domCache.get(this);X(t.loader),O()?e.icon&&W(x()):Mt(t),F([t.popup,t.actions],a.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Mt=e=>{const t=e.loader.getAttribute("data-button-to-replace"),o=t?e.popup.getElementsByClassName(t):[];o.length?W(o[0],"inline-block"):!ee($())&&!ee(S())&&!ee(L())&&X(e.actions)};function Ht(){const e=pe.innerParams.get(this),t=pe.domCache.get(this);return t?Q(t.popup,e.input):null}function It(e,t,o){const s=pe.domCache.get(e);t.forEach(e=>{s[e].disabled=o})}function Ot(e,t){const o=k();if(o&&e)if("radio"===e.type){const e=o.querySelectorAll(`[name="${a.radio}"]`);for(let o=0;o<e.length;o++)e[o].disabled=t}else e.disabled=t}function jt(){It(this,["confirmButton","denyButton","cancelButton"],!1)}function Dt(){It(this,["confirmButton","denyButton","cancelButton"],!0)}function Rt(){Ot(this.getInput(),!1)}function Qt(){Ot(this.getInput(),!0)}function Nt(e){const t=pe.domCache.get(this),o=pe.innerParams.get(this);j(t.validationMessage,e),t.validationMessage.className=a["validation-message"],o.customClass&&o.customClass.validationMessage&&K(t.validationMessage,o.customClass.validationMessage),W(t.validationMessage);const s=this.getInput();s&&(s.setAttribute("aria-invalid","true"),s.setAttribute("aria-describedby",a["validation-message"]),N(s),K(s,a.inputerror))}function Vt(){const e=pe.domCache.get(this);e.validationMessage&&X(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),F(t,a.inputerror))}const Kt={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,theme:"light",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:"×",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:{},inputAutoFocus:!0,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,topLayer:!1},Ft=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","draggable","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","theme","willClose"],Ut={allowEnterKey:void 0},Yt=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Wt=e=>Object.prototype.hasOwnProperty.call(Kt,e),Xt=e=>-1!==Ft.indexOf(e),Zt=e=>Ut[e],Jt=e=>{Wt(e)||d(`Unknown parameter "${e}"`)},Gt=e=>{Yt.includes(e)&&d(`The parameter "${e}" is incompatible with toasts`)},eo=e=>{const t=Zt(e);t&&m(e,t)},to=e=>{!1===e.backdrop&&e.allowOutsideClick&&d('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),e.theme&&!["light","dark","auto","minimal","borderless","bootstrap-4","bootstrap-4-light","bootstrap-4-dark","bootstrap-5","bootstrap-5-light","bootstrap-5-dark","material-ui","material-ui-light","material-ui-dark","embed-iframe","bulma","bulma-light","bulma-dark"].includes(e.theme)&&d(`Invalid theme "${e.theme}"`);for(const t in e)Jt(t),e.toast&&Gt(t),eo(t)};function oo(e){const t=f(),o=k(),s=pe.innerParams.get(this);if(!o||D(o,s.hideClass.popup))return void d("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const n=so(e),i=Object.assign({},s,n);to(i),t&&(t.dataset.swal2Theme=i.theme),Ne(this,i),pe.innerParams.set(this,i),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const so=e=>{const t={};return Object.keys(e).forEach(o=>{if(Xt(o)){const s=e;t[o]=s[o]}else d(`Invalid parameter to update: ${o}`)}),t};function no(){var e;const t=pe.domCache.get(this),o=pe.innerParams.get(this);o?(t.popup&&s.swalCloseEventFinishedCallback&&(s.swalCloseEventFinishedCallback(),delete s.swalCloseEventFinishedCallback),"function"==typeof o.didDestroy&&o.didDestroy(),null===(e=s.eventEmitter)||void 0===e||e.emit("didDestroy"),io(this)):ao(this)}const io=e=>{ao(e),delete e.params,delete s.keydownHandler,delete s.keydownTarget,delete s.currentInstance},ao=e=>{e.isAwaitingPromise?(ro(pe,e),e.isAwaitingPromise=!0):(ro(tt,e),ro(pe,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},ro=(e,t)=>{for(const o in e)e[o].delete(t)};var lo=Object.freeze({__proto__:null,_destroy:no,close:ut,closeModal:ut,closePopup:ut,closeToast:ut,disableButtons:Dt,disableInput:Qt,disableLoading:Tt,enableButtons:jt,enableInput:Rt,getInput:Ht,handleAwaitingPromise:pt,hideLoading:Tt,rejectPromise:mt,resetValidationMessage:Vt,showValidationMessage:Nt,update:oo});const co=(e,t,o)=>{t.popup.onclick=()=>{e&&(uo(e)||e.timer||e.input)||o(Ke.close)}},uo=e=>Boolean(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let wo=!1;const mo=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(wo=!0)}}},po=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(wo=!0)}}},ho=(e,t,o)=>{t.container.onclick=s=>{wo?wo=!1:s.target===t.container&&p(e.allowOutsideClick)&&o(Ke.backdrop)}},go=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const bo=()=>{if(s.timeout)return(()=>{const e=T();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const o=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${o}%`})(),s.timeout.stop()},fo=()=>{if(s.timeout){const e=s.timeout.start();return se(e),e}};let vo=!1;const yo={};const ko=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in yo){const o=t.getAttribute&&t.getAttribute(e);if(o)return void yo[e].fire({template:o})}};s.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const o=this._getHandlersByEventName(e);o.includes(t)||o.push(t)}once(e,t){const o=(...s)=>{this.removeListener(e,o),t.apply(this,s)};this.on(e,o)}emit(e,...t){this._getHandlersByEventName(e).forEach(e=>{try{e.apply(this,t)}catch(e){console.error(e)}})}removeListener(e,t){const o=this._getHandlersByEventName(e),s=o.indexOf(t);s>-1&&o.splice(s,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var xo=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||go(e[0])?["title","html","icon"].forEach((o,s)=>{const n=e[s];"string"==typeof n||go(n)?t[o]=n:void 0!==n&&u(`Unexpected type of ${o}! Expected "string" or "Element", got ${typeof n}`)}):Object.assign(t,e[0]),t},bindClickHandler:function(e="data-swal-template"){yo[e]=this,vo||(document.body.addEventListener("click",ko),vo=!0)},clickCancel:()=>{var e;return null===(e=L())||void 0===e?void 0:e.click()},clickConfirm:Ve,clickDeny:()=>{var e;return null===(e=S())||void 0===e?void 0:e.click()},enableLoading:vt,fire:function(...e){return new this(...e)},getActions:_,getCancelButton:L,getCloseButton:M,getConfirmButton:$,getContainer:f,getDenyButton:S,getFocusableElements:H,getFooter:P,getHtmlContainer:A,getIcon:x,getIconContent:()=>y(a["icon-content"]),getImage:E,getInputLabel:()=>y(a["input-label"]),getLoader:q,getPopup:k,getProgressSteps:B,getTimerLeft:()=>s.timeout&&s.timeout.getTimerLeft(),getTimerProgressBar:T,getTitle:C,getValidationMessage:z,increaseTimer:e=>{if(s.timeout){const t=s.timeout.increase(e);return se(t,!0),t}},isDeprecatedParameter:Zt,isLoading:()=>{const e=k();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>Boolean(s.timeout&&s.timeout.isRunning()),isUpdatableParameter:Xt,isValidParameter:Wt,isVisible:()=>ee(k()),mixin:function(e){return class extends(this){_main(t,o){return super._main(t,Object.assign({},e,o))}}},off:(e,t)=>{s.eventEmitter&&(e?t?s.eventEmitter.removeListener(e,t):s.eventEmitter.removeAllListeners(e):s.eventEmitter.reset())},on:(e,t)=>{s.eventEmitter&&s.eventEmitter.on(e,t)},once:(e,t)=>{s.eventEmitter&&s.eventEmitter.once(e,t)},resumeTimer:fo,showLoading:vt,stopTimer:bo,toggleTimer:()=>{const e=s.timeout;return e&&(e.running?bo():fo())}});class Co{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.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const 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 Ao=["swal-title","swal-html","swal-footer"],Eo=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach(e=>{Po(e,["name","value"]);const o=e.getAttribute("name"),s=e.getAttribute("value");o&&s&&(t[o]=o in Kt&&"boolean"==typeof Kt[o]?"false"!==s:o in Kt&&"object"==typeof Kt[o]?JSON.parse(s):s)}),t},Bo=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach(e=>{const o=e.getAttribute("name"),s=e.getAttribute("value");o&&s&&(t[o]=new Function(`return ${s}`)())}),t},zo=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach(e=>{Po(e,["type","color","aria-label"]);const o=e.getAttribute("type");if(o&&["confirm","cancel","deny"].includes(o)){if(t[`${o}ButtonText`]=e.innerHTML,t[`show${c(o)}Button`]=!0,e.hasAttribute("color")){const s=e.getAttribute("color");null!==s&&(t[`${o}ButtonColor`]=s)}if(e.hasAttribute("aria-label")){const s=e.getAttribute("aria-label");null!==s&&(t[`${o}ButtonAriaLabel`]=s)}}}),t},$o=e=>{const t={},o=e.querySelector("swal-image");return o&&(Po(o,["src","width","height","alt"]),o.hasAttribute("src")&&(t.imageUrl=o.getAttribute("src")||void 0),o.hasAttribute("width")&&(t.imageWidth=o.getAttribute("width")||void 0),o.hasAttribute("height")&&(t.imageHeight=o.getAttribute("height")||void 0),o.hasAttribute("alt")&&(t.imageAlt=o.getAttribute("alt")||void 0)),t},Lo=e=>{const t={},o=e.querySelector("swal-icon");return o&&(Po(o,["type","color"]),o.hasAttribute("type")&&(t.icon=o.getAttribute("type")),o.hasAttribute("color")&&(t.iconColor=o.getAttribute("color")),t.iconHtml=o.innerHTML),t},So=e=>{const t={},o=e.querySelector("swal-input");o&&(Po(o,["type","label","placeholder","value"]),t.input=o.getAttribute("type")||"text",o.hasAttribute("label")&&(t.inputLabel=o.getAttribute("label")),o.hasAttribute("placeholder")&&(t.inputPlaceholder=o.getAttribute("placeholder")),o.hasAttribute("value")&&(t.inputValue=o.getAttribute("value")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach(e=>{Po(e,["value"]);const o=e.getAttribute("value");if(!o)return;const s=e.innerHTML;t.inputOptions[o]=s})),t},qo=(e,t)=>{const o={};for(const s in t){const n=t[s],i=e.querySelector(n);i&&(Po(i,[]),o[n.replace(/^swal-/,"")]=i.innerHTML.trim())}return o},_o=e=>{const t=Ao.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach(e=>{const o=e.tagName.toLowerCase();t.includes(o)||d(`Unrecognized element <${o}>`)})},Po=(e,t)=>{Array.from(e.attributes).forEach(o=>{-1===t.indexOf(o.name)&&d([`Unrecognized attribute "${o.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])})},To=e=>{var t,o;const n=f(),i=k();if(!n||!i)return;"function"==typeof e.willOpen&&e.willOpen(i),null===(t=s.eventEmitter)||void 0===t||t.emit("willOpen",i);const a=window.getComputedStyle(document.body).overflowY;if(Oo(n,i,e),setTimeout(()=>{Ho(n,i)},10),I()&&(Io(n,void 0!==e.scrollbarPadding&&e.scrollbarPadding,a),(()=>{const e=f();Array.from(document.body.children).forEach(t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))})})()),O()||s.previousActiveElement||(s.previousActiveElement=document.activeElement),"function"==typeof e.didOpen){const t=e.didOpen;setTimeout(()=>t(i))}null===(o=s.eventEmitter)||void 0===o||o.emit("didOpen",i)},Mo=e=>{const t=k();if(!t||e.target!==t)return;const o=f();o&&(t.removeEventListener("animationend",Mo),t.removeEventListener("transitionend",Mo),o.style.overflowY="auto",F(o,a["no-transition"]))},Ho=(e,t)=>{oe(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",Mo),t.addEventListener("transitionend",Mo)):e.style.overflowY="auto"},Io=(e,t,o)=>{(()=>{if(st&&!D(document.body,a.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",K(document.body,a.iosfix),nt()}})(),t&&"hidden"!==o&&ct(o),setTimeout(()=>{e.scrollTop=0})},Oo=(e,t,o)=>{var s;null!==(s=o.showClass)&&void 0!==s&&s.backdrop&&K(e,o.showClass.backdrop),o.animation?(t.style.setProperty("opacity","0","important"),W(t,"grid"),setTimeout(()=>{var e;null!==(e=o.showClass)&&void 0!==e&&e.popup&&K(t,o.showClass.popup),t.style.removeProperty("opacity")},10)):W(t,"grid"),K([document.documentElement,document.body],a.shown),o.heightAuto&&o.backdrop&&!o.toast&&K([document.documentElement,document.body],a["height-auto"])};var jo=(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),Do=(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 Ro(e){(function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=jo),"url"===e.input&&(e.inputValidator=Do))})(e),e.showLoaderOnConfirm&&!e.preConfirm&&d("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"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(d('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),ae(e)}let Qo;var No=new WeakMap;class Vo{constructor(...t){if(o(this,No,Promise.resolve({isConfirmed:!1,isDenied:!1,isDismissed:!0})),"undefined"==typeof window)return;Qo=this;const s=Object.freeze(this.constructor.argsToParams(t));var n,i,a;this.params=s,this.isAwaitingPromise=!1,n=No,i=this,a=this._main(Qo.params),n.set(e(n,i),a)}_main(e,t={}){if(to(Object.assign({},t,e)),s.currentInstance){const e=tt.swalPromiseResolve.get(s.currentInstance),{isAwaitingPromise:t}=s.currentInstance;s.currentInstance._destroy(),t||e({isDismissed:!0}),I()&&ot()}s.currentInstance=Qo;const o=Fo(e,t);Ro(o),Object.freeze(o),s.timeout&&(s.timeout.stop(),delete s.timeout),clearTimeout(s.restoreFocusTimeout);const n=Uo(Qo);return Ne(Qo,o),pe.innerParams.set(Qo,o),Ko(Qo,n,o)}then(e){return t(No,this).then(e)}finally(e){return t(No,this).finally(e)}}const Ko=(e,t,o)=>new Promise((n,i)=>{const a=t=>{e.close({isDismissed:!0,dismiss:t,isConfirmed:!1,isDenied:!1})};tt.swalPromiseResolve.set(e,n),tt.swalPromiseReject.set(e,i),t.confirmButton.onclick=()=>{(e=>{const t=pe.innerParams.get(e);e.disableButtons(),t.input?$t(e,"confirm"):Pt(e,!0)})(e)},t.denyButton.onclick=()=>{(e=>{const t=pe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?$t(e,"deny"):St(e,!1)})(e)},t.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Ke.cancel)})(e,a)},t.closeButton.onclick=()=>{a(Ke.close)},((e,t,o)=>{e.toast?co(e,t,o):(mo(t),po(t),ho(e,t,o))})(o,t,a),((e,t,o)=>{if(Fe(e),!t.toast){const s=e=>Xe(t,e,o);e.keydownHandler=s;const n=t.keydownListenerCapture?window:k();if(n){e.keydownTarget=n,e.keydownListenerCapture=t.keydownListenerCapture;const o=s;e.keydownTarget.addEventListener("keydown",o,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0}}})(s,o,a),((e,t)=>{"select"===t.input||"radio"===t.input?At(e,t):["text","email","number","tel","textarea"].some(e=>e===t.input)&&(h(t.inputValue)||b(t.inputValue))&&(vt($()),Et(e,t))})(e,o),To(o),Yo(s,o,a),Wo(t,o),setTimeout(()=>{t.container.scrollTop=0})}),Fo=(e,t)=>{const o=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const o=t.content;return _o(o),Object.assign(Eo(o),Bo(o),zo(o),$o(o),Lo(o),So(o),qo(o,Ao))})(e),s=Object.assign({},Kt,t,o,e);return s.showClass=Object.assign({},Kt.showClass,s.showClass),s.hideClass=Object.assign({},Kt.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},Uo=e=>{const t={popup:k(),container:f(),actions:_(),confirmButton:$(),denyButton:S(),cancelButton:L(),loader:q(),closeButton:M(),validationMessage:z(),progressSteps:B()};return pe.domCache.set(e,t),t},Yo=(e,t,o)=>{const s=T();X(s),t.timer&&(e.timeout=new Co(()=>{o("timer"),delete e.timeout},t.timer),t.timerProgressBar&&s&&(W(s),R(s,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&se(t.timer)})))},Wo=(e,t)=>{if(!t.toast)return p(t.allowEnterKey)?void(Xo(e)||Zo(e,t)||Ue(-1,1)):(m("allowEnterKey"),void Jo())},Xo=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&ee(e))return e.focus(),!0;return!1},Zo=(e,t)=>t.focusDeny&&ee(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ee(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ee(e.confirmButton)||(e.confirmButton.focus(),0)),Jo=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};Vo.prototype.disableButtons=Dt,Vo.prototype.enableButtons=jt,Vo.prototype.getInput=Ht,Vo.prototype.disableInput=Qt,Vo.prototype.enableInput=Rt,Vo.prototype.hideLoading=Tt,Vo.prototype.disableLoading=Tt,Vo.prototype.showValidationMessage=Nt,Vo.prototype.resetValidationMessage=Vt,Vo.prototype.close=ut,Vo.prototype.closePopup=ut,Vo.prototype.closeModal=ut,Vo.prototype.closeToast=ut,Vo.prototype.rejectPromise=mt,Vo.prototype.update=oo,Vo.prototype._destroy=no,Object.assign(Vo,xo),Object.keys(lo).forEach(e=>{Vo[e]=function(...t){if(Qo&&Qo[e])return Qo[e](...t)}}),Vo.DismissReason=Ke,Vo.version="11.26.17";const Go=Vo;return Go.default=Go,Go}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var o=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(o),o.styleSheet)o.styleSheet.disabled||(o.styleSheet.cssText=t);else try{o.innerHTML=t}catch(e){o.innerText=t}}(document,':root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-icon-animations: true;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem;container-name:swal2-popup}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}@container swal2-popup style(--swal2-icon-animations:true){.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}')}},t={};function o(s){var n=t[s];if(void 0!==n)return n.exports;var i=t[s]={exports:{}};return e[s].call(i.exports,i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=(e,t)=>{document.addEventListener(e,o=>{const s=o.target;let n={e:o,target:s};t.forEach(t=>{n={...n,...t},t.conditionBeforeCallBack&&!0!==t.conditionBeforeCallBack(n)||"keydown"===e&&t.checkIsEventEnter&&"Enter"!==o.key||s.closest(t.selector)&&(t.class?t.class[t.callBack](n):t.callBack(n))})})};var t=o(8465),s=o.n(t);class n{constructor(){this.config=null,this.root=null,this.elements={},this.storageKey="",this.history=[],this.activeQuizState=null,this.isRequesting=!1,this.quizHookBound=!1,this.lastQuizReviewSignature=""}static selectors={root:"#lp-ai-assistant",toggleBtn:".lp-ai-assistant__toggle",panel:".lp-ai-assistant__panel",closeBtn:".lp-ai-assistant__close-btn",clearBtn:".lp-ai-assistant__clear-btn",msgList:".lp-ai-assistant__messages",inputEl:".lp-ai-assistant__input",sendBtn:".lp-ai-assistant__send-btn",quickBtn:".lp-ai-assistant__quick-btn",quickActions:".lp-ai-assistant__quick-actions",inputArea:".lp-ai-assistant__input-area",smartReviewBtn:".lp-ai-assistant__smart-review-btn",quizCard:".lp-ai-assistant__quiz-card",quizOptionBtn:".lp-ai-assistant__quiz-option"};init(){this.validateConfig()&&(this.root=document.querySelector(n.selectors.root),this.root&&(this.cacheElements(),this.validateDOM()&&(this.storageKey=`lp_ai_chat_${this.config.context}_${this.config.itemId}`,this.applyInitialState(),this.loadHistory(),this.renderHistoryToDOM(),this.bindQuizCompletedHook(),this.events())))}validateConfig(){if("object"!=typeof window.lpAIAssistant||!window.lpAIAssistant)return!1;if(this.config=window.lpAIAssistant,!this.config.enabled)return!1;const e=["nonce","ajaxUrl"];for(const t of e)if("string"!=typeof this.config[t]||!this.config[t])return!1;const t=Number.isInteger(this.config.itemId)?this.config.itemId:this.config.lessonId;return!(!Number.isInteger(t)||t<=0||!Number.isInteger(this.config.courseId)||this.config.courseId<=0||(this.config.itemId=t,this.config.lessonId=t,this.config.context="quiz"===this.config.context?"quiz":"lesson",this.config.quizCompleted=!!this.config.quizCompleted,this.config.enabledActions={summarize:!0,explain:!0,quick_quiz:!0,smart_review:!0,...this.config.enabledActions||{}},this.config.i18n={you:this.config?.i18n?.you||"You",assistant:this.config?.i18n?.assistant||"AI Assistant",thinking:this.config?.i18n?.thinking||"Thinking...",sendError:this.config?.i18n?.sendError||"An error occurred. Please try again.",clearConfirm:this.config?.i18n?.clearConfirm||"Clear chat history?",explainPrompt:this.config?.i18n?.explainPrompt||"Explain a concept from this lesson.",quizPrompt:this.config?.i18n?.quizPrompt||"Create a quick quiz from this lesson.",summarizePrompt:this.config?.i18n?.summarizePrompt||"Summarize this lesson with key points.",smartReviewPrompt:this.config?.i18n?.smartReviewPrompt||"Give me a smart review of my quiz results.",quizCorrectTitle:this.config?.i18n?.quizCorrectTitle||"Correct!",quizWrongTitle:this.config?.i18n?.quizWrongTitle||"Not correct!"},0))}cacheElements(){this.elements.toggleBtn=document.querySelector(n.selectors.toggleBtn),this.elements.panel=this.root.querySelector(n.selectors.panel),this.elements.closeBtn=this.root.querySelector(n.selectors.closeBtn),this.elements.clearBtn=this.root.querySelector(n.selectors.clearBtn),this.elements.msgList=this.root.querySelector(n.selectors.msgList),this.elements.inputEl=this.root.querySelector(n.selectors.inputEl),this.elements.sendBtn=this.root.querySelector(n.selectors.sendBtn),this.elements.inputArea=this.root.querySelector(n.selectors.inputArea),this.elements.quickActions=this.root.querySelector(n.selectors.quickActions),this.elements.smartReviewBtn=this.root.querySelector(n.selectors.smartReviewBtn)}validateDOM(){return!!(this.elements.toggleBtn&&this.elements.panel&&this.elements.msgList)}applyInitialState(){if(this.elements.smartReviewBtn){const e="quiz"===this.config.context?this.config.quizCompleted:!!this.config.enabledActions?.smart_review;this.elements.smartReviewBtn.hidden=!e}this.setQuizInputMode(!1)}bindQuizCompletedHook(){if("quiz"===this.config.context)return;if(this.quizHookBound||!this.elements.smartReviewBtn)return;const e=window?.wp?.hooks;e&&"function"==typeof e.addAction&&(e.addAction("lp-js-quiz-answer","learnpress/ai-assistant-smart-review",(e,t)=>{"completed"===String(t||"").toLowerCase()&&(this.config.quizCompleted=!0,this.elements.smartReviewBtn.hidden=!1)}),this.quizHookBound=!0)}events(){n._loadedEvents||(n._loadedEvents=this,e("click",[{selector:n.selectors.toggleBtn,class:this,callBack:this.handleToggleClick.name},{selector:`${n.selectors.root} ${n.selectors.closeBtn}`,class:this,callBack:this.handleCloseClick.name},{selector:`${n.selectors.root} ${n.selectors.clearBtn}`,class:this,callBack:this.handleClearClick.name},{selector:`${n.selectors.root} ${n.selectors.sendBtn}`,class:this,callBack:this.handleSendClick.name},{selector:`${n.selectors.root} ${n.selectors.quickBtn}`,class:this,callBack:this.handleQuickActionClick.name},{selector:`${n.selectors.root} ${n.selectors.quizOptionBtn}`,class:this,callBack:this.handleQuizOptionClick.name}]),e("keydown",[{selector:`${n.selectors.root} ${n.selectors.inputEl}`,class:this,callBack:this.handleInputKeydown.name},{selector:"body",class:this,callBack:this.handleEscapeKeydown.name}]))}handleToggleClick(e){e.e.preventDefault(),this.elements.panel.hidden?this.openPanel():this.closePanel()}handleCloseClick(e){e.e.preventDefault(),this.closePanel()}handleClearClick(e){e.e.preventDefault(),s().fire({title:this.config.i18n.clearConfirm,icon:"warning",showCancelButton:!0,confirmButtonColor:"var(--lp-primary-color, #ffb606)"}).then(e=>{e.isConfirmed&&this.clearHistory()})}handleSendClick(e){var t;e.e.preventDefault(),this.sendMessage(null!==(t=this.elements.inputEl?.value)&&void 0!==t?t:"")}handleQuickActionClick(e){if(e.e.preventDefault(),this.activeQuizState?.is_active)return;const t=e.target.closest(n.selectors.quickBtn);if(!t)return;const o=t.dataset.lpAiAction,s={explain:this.config.i18n.explainPrompt,"quick-quiz":this.config.i18n.quizPrompt,summarize:this.config.i18n.summarizePrompt,"smart-review":this.config.i18n.smartReviewPrompt}[o];s&&(this.openPanel(),this.sendMessage(s,o))}handleQuizOptionClick(e){if(e.e.preventDefault(),this.isRequesting||!this.activeQuizState?.is_active)return;const t=e.target.closest(n.selectors.quizOptionBtn);if(!t)return;const o=(t.dataset.option||t.textContent||"").trim();o&&this.sendMessage(o)}handleInputKeydown(e){var t;this.activeQuizState?.is_active||"Enter"!==e.e.key||e.e.shiftKey||(e.e.preventDefault(),this.sendMessage(null!==(t=this.elements.inputEl?.value)&&void 0!==t?t:""))}handleEscapeKeydown(e){"Escape"===e.e.key&&this.elements.panel&&!this.elements.panel.hidden&&this.closePanel()}getAjaxHandle(){const e=window.lpAJAXG;return e&&"function"==typeof e.fetchAJAX?e:null}openPanel(){this.elements.panel.hidden=!1,this.root.setAttribute("aria-hidden","false"),this.elements.toggleBtn.setAttribute("aria-expanded","true"),this.elements.toggleBtn.classList.add("is-hidden"),this.elements.inputEl?.focus(),this.elements.msgList&&(this.elements.msgList.scrollTop=this.elements.msgList.scrollHeight)}closePanel(){this.elements.panel.hidden=!0,this.root.setAttribute("aria-hidden","true"),this.elements.toggleBtn.setAttribute("aria-expanded","false"),this.elements.toggleBtn.classList.remove("is-hidden"),this.elements.toggleBtn.focus()}setLoadingState(e){this.isRequesting=e,this.elements.sendBtn&&(this.elements.sendBtn.disabled=e),this.elements.inputEl&&(this.elements.inputEl.disabled=e)}setQuizInputMode(e){this.elements.inputArea&&this.elements.inputArea.classList.toggle("lp-ai-assistant__input-area--hidden",e),this.elements.quickActions&&this.elements.quickActions.classList.toggle("lp-ai-assistant__quick-actions--disabled",e)}loadHistory(){try{const e=localStorage.getItem(this.storageKey);this.history=e?JSON.parse(e):[],Array.isArray(this.history)||(this.history=[]);const t=[...this.history].reverse().find(e=>"quiz_review"===e?.type&&e?.review);this.lastQuizReviewSignature=t?.review?this.getQuizReviewKey(t.review):""}catch(e){this.history=[],this.lastQuizReviewSignature=""}}saveHistory(){try{localStorage.setItem(this.storageKey,JSON.stringify(this.history))}catch(e){}}clearHistory(){this.history=[],this.activeQuizState=null,this.lastQuizReviewSignature="",this.elements.msgList.innerHTML="",localStorage.removeItem(this.storageKey),this.setQuizInputMode(!1)}escHtml(e){const t=document.createElement("div");return t.appendChild(document.createTextNode(String(e))),t.innerHTML}appendMessage(e,t){const o=document.createElement("div");o.className=`lp-ai-assistant__msg lp-ai-assistant__msg--${e}`;const s="user"===e?this.config.i18n.you:this.config.i18n.assistant;return o.innerHTML=`<span class="lp-ai-assistant__msg-label">${this.escHtml(s)}</span><p class="lp-ai-assistant__msg-text">${this.escHtml(t)}</p>`,this.elements.msgList.appendChild(o),this.elements.msgList.scrollTop=this.elements.msgList.scrollHeight,o}renderHistoryToDOM(){this.elements.msgList.innerHTML="",this.history.forEach(e=>{"quiz_review"===e?.type&&e?.review?this.appendQuizReviewCard(e.review):e&&["user","assistant"].includes(e.role)&&this.appendMessage(e.role,e.content||"")}),this.renderQuizState()}getQuizReviewFromState(e){var t,o;if(!e||!e.feedback||"object"!=typeof e.feedback)return null;const s=Number.parseInt(e.current_index||0,10),n=Math.max(0,s-1),i=e.questions?.[n];if(!i||!Array.isArray(i.options))return null;const a=Number.parseInt(null!==(t=e.feedback.selected_index)&&void 0!==t?t:-1,10),r=Number.parseInt(null!==(o=e.feedback.correct_index)&&void 0!==o?o:-1,10);return{question_index:n,total:Number.parseInt(e.total||i.options.length||0,10),question:i.question||"",options:i.options,selected_index:a,correct_index:r,is_correct:!!e.feedback.is_correct,explanation:e.feedback.explanation||""}}getQuizReviewKey(e){return[e.question_index,e.total,e.selected_index,e.correct_index,e.is_correct?1:0].join("|")}pushQuizReviewToHistory(e){const t=this.getQuizReviewKey(e);return t!==this.lastQuizReviewSignature&&(this.lastQuizReviewSignature=t,this.history.push({type:"quiz_review",review:e}),this.saveHistory(),!0)}renderQuizReviewOptions(e){return(Array.isArray(e.options)?e.options:[]).map((t,o)=>{const s=String.fromCharCode(65+o),n=["lp-ai-assistant__quiz-option"];return o===e.correct_index&&n.push("is-correct-answer"),o===e.selected_index&&n.push(e.is_correct?"is-selected-correct":"is-selected-wrong"),`<button class="${n.join(" ")}" disabled>${s}. ${this.escHtml(t)}</button>`}).join("")}appendQuizReviewCard(e){const t=document.createElement("div");t.className="lp-ai-assistant__quiz-card lp-ai-assistant__quiz-card--review",t.setAttribute("data-review-key",this.getQuizReviewKey(e));const o=e.is_correct?"is-correct":"is-wrong",s=e.is_correct?this.config.i18n.quizCorrectTitle:this.config.i18n.quizWrongTitle,n=`<div class="lp-ai-assistant__quiz-feedback ${o}"><strong>${this.escHtml(s)}</strong>`+(e.explanation?`<div>${this.escHtml(e.explanation)}</div>`:"")+"</div>";t.innerHTML=`<div class="lp-ai-assistant__quiz-head">Question ${e.question_index+1}/${e.total||e.options.length}</div><div class="lp-ai-assistant__quiz-question">${this.escHtml(e.question||"")}</div><div class="lp-ai-assistant__quiz-options">${this.renderQuizReviewOptions(e)}</div>`+n,this.elements.msgList.appendChild(t)}renderQuizState(){const e=this.elements.msgList.querySelector(".lp-ai-assistant__quiz-card--active");if(e&&e.remove(),!this.activeQuizState||!this.activeQuizState.questions)return void this.setQuizInputMode(!1);const t=this.activeQuizState,o=this.getQuizReviewFromState(t);if(o&&this.pushQuizReviewToHistory(o)&&this.appendQuizReviewCard(o),!t.is_active)return void this.setQuizInputMode(!1);const s=Number.parseInt(t.current_index||0,10),n=t.questions?.[s];if(!n)return void this.setQuizInputMode(!1);const i=document.createElement("div");i.className="lp-ai-assistant__quiz-card lp-ai-assistant__quiz-card--active";const a=Array.isArray(n.options)?n.options:[],r=a.map((e,t)=>{const o=String.fromCharCode(65+t);return`<button class="lp-ai-assistant__quiz-option" data-index="${t}" data-option="${this.escHtml(e)}">${o}. ${this.escHtml(e)}</button>`}).join("");i.innerHTML=`<div class="lp-ai-assistant__quiz-head">Question ${s+1}/${t.total||a.length}</div><div class="lp-ai-assistant__quiz-question">${this.escHtml(n.question||"")}</div><div class="lp-ai-assistant__quiz-options">${r}</div>`,this.elements.msgList.appendChild(i),this.setQuizInputMode(!0)}scrollToMessageStart(e){const t=this.elements.msgList;t&&e&&t.contains(e)&&(t.scrollTop=Math.max(0,e.offsetTop-8))}sendMessage(e,t=""){const o=(e||"").trim();if(this.isRequesting||!o)return;const s=this.getAjaxHandle();if(!s)return void this.appendMessage("assistant",this.config.i18n.sendError);this.appendMessage("user",o);const n=this.history.slice();this.history.push({role:"user",content:o}),this.saveHistory(),this.elements.inputEl&&(this.elements.inputEl.value="");const i=this.appendMessage("assistant",this.config.i18n.thinking),a=i.querySelector(".lp-ai-assistant__msg-text");this.setLoadingState(!0);const r={action:"openai_assistant_chat",message:o,item_id:this.config.itemId,course_id:this.config.courseId,history:n,active_quiz_questions:this.activeQuizState||[],action_hint:"string"==typeof t?t:""},l={success:e=>{"success"===e?.status&&e?.data?(a.textContent=e.data.message||"","quiz"===e?.data?.type?(this.activeQuizState=e?.data?.quiz||null,this.renderQuizState(),(this.activeQuizState?.completed||!1===this.activeQuizState?.is_active)&&this.elements.msgList?.contains(i)&&this.elements.msgList.appendChild(i)):(this.activeQuizState=null,this.renderQuizState()),this.history.push({role:"assistant",content:e.data.message}),this.saveHistory()):(this.activeQuizState=null,this.renderQuizState(),a.textContent=e?.message||this.config.i18n.sendError)},error:()=>{this.activeQuizState=null,this.renderQuizState(),a.textContent=this.config.i18n.sendError},completed:()=>{this.setLoadingState(!1),this.scrollToMessageStart(i)}};s.fetchAJAX(r,l)}}const i=new n;((e,t)=>{const o=document.querySelector(e);if(o)return void t();const s=new MutationObserver((o,s)=>{const n=document.querySelector(e);n&&(s.disconnect(),t())});s.observe(document.documentElement,{childList:!0,subtree:!0})})(n.selectors.root,()=>{i.init()})})()})(); |
|
1
|
+(()=>{var e={8465(e){e.exports=function(){"use strict";function e(e,t,o){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:o;throw new TypeError("Private element is not present on this object")}function t(t,o){return t.get(e(t,o))}function o(e,t,o){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,o)}const s={},n=e=>new Promise(t=>{if(!e)return t();const o=window.scrollX,n=window.scrollY;s.restoreFocusTimeout=setTimeout(()=>{s.previousActiveElement instanceof HTMLElement?(s.previousActiveElement.focus(),s.previousActiveElement=null):document.body&&document.body.focus(),t()},100),window.scrollTo(o,n)}),i="swal2-",a=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","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","draggable","dragging"].reduce((e,t)=>(e[t]=i+t,e),{}),r=["success","warning","info","question","error"].reduce((e,t)=>(e[t]=i+t,e),{}),l="SweetAlert2:",c=e=>e.charAt(0).toUpperCase()+e.slice(1),d=e=>{console.warn(`${l} ${"object"==typeof e?e.join(" "):e}`)},u=e=>{console.error(`${l} ${e}`)},w=[],p=(e,t=null)=>{var o;o=`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:""}`,w.includes(o)||(w.push(o),d(o))},h=e=>"function"==typeof e?e():e,m=e=>e&&"function"==typeof e.toPromise,g=e=>m(e)?e.toPromise():Promise.resolve(e),b=e=>e&&Promise.resolve(e)===e,f=()=>document.body.querySelector(`.${a.container}`),v=e=>{const t=f();return t?t.querySelector(e):null},y=e=>v(`.${e}`),k=()=>y(a.popup),x=()=>y(a.icon),C=()=>y(a.title),A=()=>y(a["html-container"]),E=()=>y(a.image),B=()=>y(a["progress-steps"]),z=()=>y(a["validation-message"]),$=()=>v(`.${a.actions} .${a.confirm}`),S=()=>v(`.${a.actions} .${a.cancel}`),L=()=>v(`.${a.actions} .${a.deny}`),q=()=>v(`.${a.loader}`),_=()=>y(a.actions),P=()=>y(a.footer),T=()=>y(a["timer-progress-bar"]),M=()=>y(a.close),I=()=>{const e=k();if(!e)return[];const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),o=Array.from(t).sort((e,t)=>{const o=parseInt(e.getAttribute("tabindex")||"0"),s=parseInt(t.getAttribute("tabindex")||"0");return o>s?1:o<s?-1:0}),s=e.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'),n=Array.from(s).filter(e=>"-1"!==e.getAttribute("tabindex"));return[...new Set(o.concat(n))].filter(e=>ee(e))},O=()=>D(document.body,a.shown)&&!D(document.body,a["toast-shown"])&&!D(document.body,a["no-backdrop"]),H=()=>{const e=k();return!!e&&D(e,a.toast)},j=(e,t)=>{if(e.textContent="",t){const o=(new DOMParser).parseFromString(t,"text/html"),s=o.querySelector("head");s&&Array.from(s.childNodes).forEach(t=>{e.appendChild(t)});const n=o.querySelector("body");n&&Array.from(n.childNodes).forEach(t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)})}},D=(e,t)=>!!t&&t.split(/\s+/).every(t=>e.classList.contains(t)),Q=(e,t,o)=>{if(((e,t)=>{Array.from(e.classList).forEach(o=>{Object.values(a).includes(o)||Object.values(r).includes(o)||Object.values(t.showClass||{}).includes(o)||e.classList.remove(o)})})(e,t),!t.customClass)return;const s=t.customClass[o];s&&("string"==typeof s||s.forEach?F(e,s):d(`Invalid type of customClass.${o}! Expected string or iterable object, got "${typeof s}"`))},R=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(`.${a.popup} > .${a[t]}`);case"checkbox":return e.querySelector(`.${a.popup} > .${a.checkbox} input`);case"radio":return e.querySelector(`.${a.popup} > .${a.radio} input:checked`)||e.querySelector(`.${a.popup} > .${a.radio} input:first-child`);case"range":return e.querySelector(`.${a.popup} > .${a.range} input`);default:return e.querySelector(`.${a.popup} > .${a.input}`)}},V=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},N=(e,t,o)=>{if(!e||!t)return;const s="string"==typeof t?t.split(/\s+/).filter(Boolean):t;(Array.isArray(e)?e:[e]).forEach(e=>{s.forEach(t=>{o?e.classList.add(t):e.classList.remove(t)})})},F=(e,t)=>{N(e,t,!0)},K=(e,t)=>{N(e,t,!1)},U=(e,t)=>Array.from(e.children).find(e=>e instanceof HTMLElement&&D(e,t)),Y=(e,t,o)=>{o===`${parseInt(`${o}`)}`&&(o=parseInt(o)),o||0===o?e.style.setProperty(t,"number"==typeof o?`${o}px`:o):e.style.removeProperty(t)},W=(e,t="flex")=>{e&&(e.style.display=t)},X=e=>{e&&(e.style.display="none")},Z=(e,t="block")=>{e&&new MutationObserver(()=>{G(e,e.innerHTML,t)}).observe(e,{childList:!0,subtree:!0})},J=(e,t,o,s)=>{const n=e.querySelector(t);n&&n.style.setProperty(o,s)},G=(e,t,o="flex")=>{t?W(e,o):X(e)},ee=e=>Boolean(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),te=e=>Boolean(e.scrollHeight>e.clientHeight),oe=e=>{const t=window.getComputedStyle(e),o=parseFloat(t.getPropertyValue("animation-duration")||"0"),s=parseFloat(t.getPropertyValue("transition-duration")||"0");return o>0||s>0},se=(e,t=!1)=>{const o=T();o&&ee(o)&&(t&&(o.style.transition="none",o.style.width="100%"),setTimeout(()=>{o.style.transition=`width ${e/1e3}s linear`,o.style.width="0%"},10))},ne=`\n <div aria-labelledby="${a.title}" aria-describedby="${a["html-container"]}" class="${a.popup}" tabindex="-1">\n <button type="button" class="${a.close}"></button>\n <ul class="${a["progress-steps"]}"></ul>\n <div class="${a.icon}"></div>\n <img class="${a.image}" />\n <h2 class="${a.title}" id="${a.title}"></h2>\n <div class="${a["html-container"]}" id="${a["html-container"]}"></div>\n <input class="${a.input}" id="${a.input}" />\n <input type="file" class="${a.file}" />\n <div class="${a.range}">\n <input type="range" />\n <output></output>\n </div>\n <select class="${a.select}" id="${a.select}"></select>\n <div class="${a.radio}"></div>\n <label class="${a.checkbox}">\n <input type="checkbox" id="${a.checkbox}" />\n <span class="${a.label}"></span>\n </label>\n <textarea class="${a.textarea}" id="${a.textarea}"></textarea>\n <div class="${a["validation-message"]}" id="${a["validation-message"]}"></div>\n <div class="${a.actions}">\n <div class="${a.loader}"></div>\n <button type="button" class="${a.confirm}"></button>\n <button type="button" class="${a.deny}"></button>\n <button type="button" class="${a.cancel}"></button>\n </div>\n <div class="${a.footer}"></div>\n <div class="${a["timer-progress-bar-container"]}">\n <div class="${a["timer-progress-bar"]}"></div>\n </div>\n </div>\n`.replace(/(^|\n)\s*/g,""),ie=()=>{s.currentInstance&&s.currentInstance.resetValidationMessage()},ae=e=>{const t=(()=>{const e=f();return!!e&&(e.remove(),K([document.documentElement,document.body],[a["no-backdrop"],a["toast-shown"],a["has-column"]]),!0)})();if("undefined"==typeof window||"undefined"==typeof document)return void u("SweetAlert2 requires document to initialize");const o=document.createElement("div");o.className=a.container,t&&F(o,a["no-transition"]),j(o,ne),o.dataset.swal2Theme=e.theme;const n=(e=>{if("string"==typeof e){const t=document.querySelector(e);if(!t)throw new Error(`Target element "${e}" not found`);return t}return e})(e.target||"body");n.appendChild(o),e.topLayer&&(o.setAttribute("popover",""),o.showPopover()),(e=>{const t=k();t&&(t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true"))})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&(F(f(),a.rtl),s.isRTL=!0)})(n),(()=>{const e=k();if(!e)return;const t=U(e,a.input),o=U(e,a.file),s=e.querySelector(`.${a.range} input`),n=e.querySelector(`.${a.range} output`),i=U(e,a.select),r=e.querySelector(`.${a.checkbox} input`),l=U(e,a.textarea);t&&(t.oninput=ie),o&&(o.onchange=ie),i&&(i.onchange=ie),r&&(r.onchange=ie),l&&(l.oninput=ie),s&&n&&(s.oninput=()=>{ie(),n.value=s.value},s.onchange=()=>{ie(),n.value=s.value})})()},re=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?le(e,t):e&&j(t,e)},le=(e,t)=>{"jquery"in e?ce(t,e):j(t,e.toString())},ce=(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))},de=(e,t)=>{const o=_(),s=q();o&&s&&(t.showConfirmButton||t.showDenyButton||t.showCancelButton?W(o):X(o),Q(o,t,"actions"),function(e,t,o){const s=$(),n=L(),i=S();s&&n&&i&&(ue(s,"confirm",o),ue(n,"deny",o),ue(i,"cancel",o),function(e,t,o,s){s.buttonsStyling?(F([e,t,o],a.styled),[[e,"confirm",s.confirmButtonColor],[t,"deny",s.denyButtonColor],[o,"cancel",s.cancelButtonColor]].forEach(([e,t,o])=>{o&&e.style.setProperty(`--swal2-${t}-button-background-color`,o),function(e){const t=window.getComputedStyle(e);if(t.getPropertyValue("--swal2-action-button-focus-box-shadow"))return;const o=t.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/,"rgba($1, $2, $3, 0.5)");e.style.setProperty("--swal2-action-button-focus-box-shadow",t.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/,` ${o}`))}(e)})):K([e,t,o],a.styled)}(s,n,i,o),o.reverseButtons&&(o.toast?(e.insertBefore(i,s),e.insertBefore(n,s)):(e.insertBefore(i,t),e.insertBefore(n,t),e.insertBefore(s,t))))}(o,s,t),j(s,t.loaderHtml||""),Q(s,t,"loader"))};function ue(e,t,o){const s=c(t);G(e,o[`show${s}Button`],"inline-block"),j(e,o[`${t}ButtonText`]||""),e.setAttribute("aria-label",o[`${t}ButtonAriaLabel`]||""),e.className=a[t],Q(e,o,`${t}Button`)}const we=(e,t)=>{const o=f();o&&(function(e,t){"string"==typeof t?e.style.background=t:t||F([document.documentElement,document.body],a["no-backdrop"])}(o,t.backdrop),function(e,t){t&&(t in a?F(e,a[t]):(d('The "position" parameter is not valid, defaulting to "center"'),F(e,a.center)))}(o,t.position),function(e,t){t&&F(e,a[`grow-${t}`])}(o,t.grow),Q(o,t,"container"))};var pe={innerParams:new WeakMap,domCache:new WeakMap,focusedElement:new WeakMap};const he=["input","file","range","select","radio","checkbox","textarea"],me=e=>{if(!e.input)return;if(!xe[e.input])return void u(`Unexpected type of input! Expected ${Object.keys(xe).join(" | ")}, got "${e.input}"`);const t=ye(e.input);if(!t)return;const o=xe[e.input](t,e);W(t),e.inputAutoFocus&&setTimeout(()=>{V(o)})},ge=(e,t)=>{const o=k();if(!o)return;const s=R(o,e);if(s){(e=>{for(const{name:t}of Array.from(e.attributes))["id","type","value","style"].includes(t)||e.removeAttribute(t)})(s);for(const e in t)s.setAttribute(e,t[e])}},be=e=>{if(!e.input)return;const t=ye(e.input);t&&Q(t,e,"input")},fe=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},ve=(e,t,o)=>{if(o.inputLabel){const s=document.createElement("label"),n=a["input-label"];s.setAttribute("for",e.id),s.className=n,"object"==typeof o.customClass&&F(s,o.customClass.inputLabel),s.innerText=o.inputLabel,t.insertAdjacentElement("beforebegin",s)}},ye=e=>{const t=k();if(t)return U(t,a[e]||a.input)},ke=(e,t)=>{["string","number"].includes(typeof t)?e.value=`${t}`:b(t)||d(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},xe={};xe.text=xe.email=xe.password=xe.number=xe.tel=xe.url=xe.search=xe.date=xe["datetime-local"]=xe.time=xe.week=xe.month=(e,t)=>{const o=e;return ke(o,t.inputValue),ve(o,o,t),fe(o,t),o.type=t.input,o},xe.file=(e,t)=>{const o=e;return ve(o,o,t),fe(o,t),o},xe.range=(e,t)=>{const o=e,s=o.querySelector("input"),n=o.querySelector("output");return s&&(ke(s,t.inputValue),s.type=t.input,ve(s,e,t)),n&&ke(n,t.inputValue),e},xe.select=(e,t)=>{const o=e;if(o.textContent="",t.inputPlaceholder){const e=document.createElement("option");j(e,t.inputPlaceholder),e.value="",e.disabled=!0,e.selected=!0,o.appendChild(e)}return ve(o,o,t),o},xe.radio=e=>(e.textContent="",e),xe.checkbox=(e,t)=>{const o=k();if(!o)throw new Error("Popup not found");const s=R(o,"checkbox");if(!s)throw new Error("Checkbox input not found");s.value="1",s.checked=Boolean(t.inputValue);const n=e.querySelector("span");if(n){const e=t.inputPlaceholder||t.inputLabel;e&&j(n,e)}return s},xe.textarea=(e,t)=>{const o=e;ke(o,t.inputValue),fe(o,t),ve(o,o,t);return setTimeout(()=>{if("MutationObserver"in window){const e=k();if(!e)return;const s=parseInt(window.getComputedStyle(e).width);new MutationObserver(()=>{if(!document.body.contains(o))return;const e=o.offsetWidth+(i=o,parseInt(window.getComputedStyle(i).marginLeft)+parseInt(window.getComputedStyle(i).marginRight)),n=k();var i;n&&(e>s?n.style.width=`${e}px`:Y(n,"width",t.width))}).observe(o,{attributes:!0,attributeFilter:["style"]})}}),o};const Ce=(e,t)=>{const o=A();o&&(Z(o),Q(o,t,"htmlContainer"),t.html?(re(t.html,o),W(o,"block")):t.text?(o.textContent=t.text,W(o,"block")):X(o),((e,t)=>{const o=k();if(!o)return;const s=pe.innerParams.get(e),n=!s||t.input!==s.input;he.forEach(e=>{const s=U(o,a[e]);s&&(ge(e,t.inputAttributes),s.className=a[e],n&&X(s))}),t.input&&(n&&me(t),be(t))})(e,t))},Ae=(e,t)=>{for(const[o,s]of Object.entries(r))t.icon!==o&&K(e,s);F(e,t.icon&&r[t.icon]),ze(e,t),Ee(),Q(e,t,"icon")},Ee=()=>{const e=k();if(!e)return;const t=window.getComputedStyle(e).getPropertyValue("background-color");e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix").forEach(e=>{e.style.backgroundColor=t})},Be=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let o=e.innerHTML,s="";t.iconHtml?s=$e(t.iconHtml):"success"===t.icon?(s=(e=>`\n ${e.animation?'<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>\n ${e.animation?'<div class="swal2-success-fix"></div>':""}\n ${e.animation?'<div class="swal2-success-circular-line-right"></div>':""}\n`)(t),o=o.replace(/ style=".*?"/g,"")):"error"===t.icon?s='\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':t.icon&&(s=$e({question:"?",warning:"!",info:"i"}[t.icon])),o.trim()!==s.trim()&&j(e,s)},ze=(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"])J(e,o,"background-color",t.iconColor);J(e,".swal2-success-ring","border-color",t.iconColor)}},$e=e=>`<div class="${a["icon-content"]}">${e}</div>`;let Se=!1,Le=0,qe=0,_e=0,Pe=0;const Te=e=>{const t=k();if(!t)return;const o=x();if(e.target===t||o&&o.contains(e.target)){Se=!0;const o=Oe(e);Le=o.clientX,qe=o.clientY,_e=parseInt(t.style.insetInlineStart)||0,Pe=parseInt(t.style.insetBlockStart)||0,F(t,"swal2-dragging")}},Me=e=>{const t=k();if(t&&Se){let{clientX:o,clientY:n}=Oe(e);const i=o-Le;t.style.insetInlineStart=`${_e+(s.isRTL?-i:i)}px`,t.style.insetBlockStart=`${Pe+(n-qe)}px`}},Ie=()=>{const e=k();Se=!1,K(e,"swal2-dragging")},Oe=e=>{const t=e.type.startsWith("touch")?e.touches[0]:e;return{clientX:t.clientX,clientY:t.clientY}},He=(e,t)=>{const o=f(),s=k();if(o&&s){if(t.toast){Y(o,"width",t.width),s.style.width="100%";const e=q();e&&s.insertBefore(e,x())}else Y(s,"width",t.width);Y(s,"padding",t.padding),t.color&&(s.style.color=t.color),t.background&&(s.style.background=t.background),X(z()),je(s,t),t.draggable&&!t.toast?(F(s,a.draggable),(e=>{e.addEventListener("mousedown",Te),document.body.addEventListener("mousemove",Me),e.addEventListener("mouseup",Ie),e.addEventListener("touchstart",Te),document.body.addEventListener("touchmove",Me),e.addEventListener("touchend",Ie)})(s)):(K(s,a.draggable),(e=>{e.removeEventListener("mousedown",Te),document.body.removeEventListener("mousemove",Me),e.removeEventListener("mouseup",Ie),e.removeEventListener("touchstart",Te),document.body.removeEventListener("touchmove",Me),e.removeEventListener("touchend",Ie)})(s))}},je=(e,t)=>{const o=t.showClass||{};e.className=`${a.popup} ${ee(e)?o.popup:""}`,t.toast?(F([document.documentElement,document.body],a["toast-shown"]),F(e,a.toast)):F(e,a.modal),Q(e,t,"popup"),"string"==typeof t.customClass&&F(e,t.customClass),t.icon&&F(e,a[`icon-${t.icon}`])},De=e=>{const t=document.createElement("li");return F(t,a["progress-step"]),j(t,e),t},Qe=e=>{const t=document.createElement("li");return F(t,a["progress-step-line"]),e.progressStepsDistance&&Y(t,"width",e.progressStepsDistance),t},Re=(e,t)=>{var o;He(0,t),we(0,t),((e,t)=>{const o=B();if(!o)return;const{progressSteps:s,currentProgressStep:n}=t;s&&0!==s.length&&void 0!==n?(W(o),o.textContent="",n>=s.length&&d("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),s.forEach((e,i)=>{const r=De(e);if(o.appendChild(r),i===n&&F(r,a["active-progress-step"]),i!==s.length-1){const e=Qe(t);o.appendChild(e)}})):X(o)})(0,t),((e,t)=>{const o=pe.innerParams.get(e),s=x();if(s){if(o&&t.icon===o.icon)return Be(s,t),void Ae(s,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(r).indexOf(t.icon))return u(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),void X(s);W(s),Be(s,t),Ae(s,t),F(s,t.showClass&&t.showClass.icon),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",Ee)}else X(s)}})(e,t),((e,t)=>{const o=E();o&&(t.imageUrl?(W(o,""),o.setAttribute("src",t.imageUrl),o.setAttribute("alt",t.imageAlt||""),Y(o,"width",t.imageWidth),Y(o,"height",t.imageHeight),o.className=a.image,Q(o,t,"image")):X(o))})(0,t),((e,t)=>{const o=C();o&&(Z(o),G(o,Boolean(t.title||t.titleText),"block"),t.title&&re(t.title,o),t.titleText&&(o.innerText=t.titleText),Q(o,t,"title"))})(0,t),((e,t)=>{const o=M();o&&(j(o,t.closeButtonHtml||""),Q(o,t,"closeButton"),G(o,t.showCloseButton),o.setAttribute("aria-label",t.closeButtonAriaLabel||""))})(0,t),Ce(e,t),de(0,t),((e,t)=>{const o=P();o&&(Z(o),G(o,Boolean(t.footer),"block"),t.footer&&re(t.footer,o),Q(o,t,"footer"))})(0,t);const n=k();"function"==typeof t.didRender&&n&&t.didRender(n),null===(o=s.eventEmitter)||void 0===o||o.emit("didRender",n)},Ve=()=>{var e;return null===(e=$())||void 0===e?void 0:e.click()},Ne=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Fe=e=>{if(e.keydownTarget&&e.keydownHandlerAdded&&e.keydownHandler){const t=e.keydownHandler;e.keydownTarget.removeEventListener("keydown",t,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1}},Ke=(e,t)=>{var o;const s=I();return s.length?(-2===(e+=t)&&(e=s.length-1),e===s.length?e=0:-1===e&&(e=s.length-1),s[e].focus(),!(navigator.userAgent.includes("Firefox")&&s[e]instanceof HTMLIFrameElement)):(null===(o=k())||void 0===o||o.focus(),!0)},Ue=["ArrowRight","ArrowDown"],Ye=["ArrowLeft","ArrowUp"],We=(e,t,o)=>{e&&(t.isComposing||229===t.keyCode||(e.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Xe(t,e):"Tab"===t.key?Ze(t):[...Ue,...Ye].includes(t.key)?Je(t.key):"Escape"===t.key&&Ge(t,e,o)))},Xe=(e,t)=>{if(!h(t.allowEnterKey))return;const o=k();if(!o||!t.input)return;const s=R(o,t.input);if(e.target&&s&&e.target instanceof HTMLElement&&e.target.outerHTML===s.outerHTML){if(["textarea","file"].includes(t.input))return;Ve(),e.preventDefault()}},Ze=e=>{const t=e.target,o=I().findIndex(e=>e===t);let s=!0;s=e.shiftKey?Ke(o,-1):Ke(o,1),e.stopPropagation(),s&&e.preventDefault()},Je=e=>{const t=_(),o=$(),s=L(),n=S();if(!(t&&o&&s&&n))return;const i=[o,s,n];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const a=Ue.includes(e)?"nextElementSibling":"previousElementSibling";let r=document.activeElement;if(r){for(let e=0;e<t.children.length;e++){if(r=r[a],!r)return;if(r instanceof HTMLButtonElement&&ee(r))break}r instanceof HTMLButtonElement&&r.focus()}},Ge=(e,t,o)=>{e.preventDefault(),h(t.allowEscapeKey)&&o(Ne.esc)};var et={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const tt=()=>{Array.from(document.body.children).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")})},ot="undefined"!=typeof window&&Boolean(window.GestureEvent),st=ot&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,nt=()=>{const e=f();if(!e)return;let t;e.ontouchstart=e=>{t=it(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},it=e=>{const t=e.target,o=f(),s=A();return!(!o||!s||at(e)||rt(e)||t!==o&&(te(o)||!(t instanceof HTMLElement)||((e,t)=>{let o=e;for(;o&&o!==t;){if(te(o))return!0;o=o.parentElement}return!1})(t,s)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||te(s)&&s.contains(t)))},at=e=>Boolean(e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType),rt=e=>e.touches&&e.touches.length>1;let lt=null;const ct=e=>{null===lt&&(document.body.scrollHeight>window.innerHeight||"scroll"===e)&&(lt=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${lt+(()=>{const e=document.createElement("div");e.className=a["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})()}px`)};function dt(e,t,o,i){H()?ft(e,i):(n(o).then(()=>ft(e,i)),Fe(s)),ot?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),O()&&(null!==lt&&(document.body.style.paddingRight=`${lt}px`,lt=null),(()=>{if(D(document.body,a.iosfix)){const e=parseInt(document.body.style.top,10);K(document.body,a.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),tt()),K([document.documentElement,document.body],[a.shown,a["height-auto"],a["no-backdrop"],a["toast-shown"]])}function ut(e){e=mt(e);const t=et.swalPromiseResolve.get(this),o=wt(this);this.isAwaitingPromise?e.isDismissed||(ht(this),t(e)):o&&t(e)}const wt=e=>{const t=k();if(!t)return!1;const o=pe.innerParams.get(e);if(!o||D(t,o.hideClass.popup))return!1;K(t,o.showClass.popup),F(t,o.hideClass.popup);const s=f();return K(s,o.showClass.backdrop),F(s,o.hideClass.backdrop),gt(e,t,o),!0};function pt(e){const t=et.swalPromiseReject.get(this);ht(this),t&&t(e)}const ht=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,pe.innerParams.get(e)||e._destroy())},mt=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),gt=(e,t,o)=>{var n;const i=f(),a=oe(t);"function"==typeof o.willClose&&o.willClose(t),null===(n=s.eventEmitter)||void 0===n||n.emit("willClose",t),a&&i?bt(e,t,i,Boolean(o.returnFocus),o.didClose):i&&dt(e,i,Boolean(o.returnFocus),o.didClose)},bt=(e,t,o,n,i)=>{s.swalCloseEventFinishedCallback=dt.bind(null,e,o,n,i);const a=function(e){var o;e.target===t&&(null===(o=s.swalCloseEventFinishedCallback)||void 0===o||o.call(s),delete s.swalCloseEventFinishedCallback,t.removeEventListener("animationend",a),t.removeEventListener("transitionend",a))};t.addEventListener("animationend",a),t.addEventListener("transitionend",a)},ft=(e,t)=>{setTimeout(()=>{var o;"function"==typeof t&&t.bind(e.params)(),null===(o=s.eventEmitter)||void 0===o||o.emit("didClose"),e._destroy&&e._destroy()})},vt=e=>{let t=k();if(t||new Jo,t=k(),!t)return;const o=q();H()?X(x()):yt(t,e),W(o),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},yt=(e,t)=>{const o=_(),s=q();o&&s&&(!t&&ee($())&&(t=$()),W(o),t&&(X(t),s.setAttribute("data-button-to-replace",t.className),o.insertBefore(s,t)),F([e,o],a.loading))},kt=e=>e.checked?1:0,xt=e=>e.checked?e.value:null,Ct=e=>e.files&&e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,At=(e,t)=>{const o=k();if(!o)return;const s=e=>{"select"===t.input?function(e,t,o){const s=U(e,a.select);if(!s)return;const n=(e,t,s)=>{const n=document.createElement("option");n.value=s,j(n,t),n.selected=zt(s,o.inputValue),e.appendChild(n)};t.forEach(e=>{const t=e[0],o=e[1];if(Array.isArray(o)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,s.appendChild(e),o.forEach(t=>n(e,t[1],t[0]))}else n(s,o,t)}),s.focus()}(o,Bt(e),t):"radio"===t.input&&function(e,t,o){const s=U(e,a.radio);if(!s)return;t.forEach(e=>{const t=e[0],n=e[1],i=document.createElement("input"),r=document.createElement("label");i.type="radio",i.name=a.radio,i.value=t,zt(t,o.inputValue)&&(i.checked=!0);const l=document.createElement("span");j(l,n),l.className=a.label,r.appendChild(i),r.appendChild(l),s.appendChild(r)});const n=s.querySelectorAll("input");n.length&&n[0].focus()}(o,Bt(e),t)};m(t.inputOptions)||b(t.inputOptions)?(vt($()),g(t.inputOptions).then(t=>{e.hideLoading(),s(t)})):"object"==typeof t.inputOptions?s(t.inputOptions):u("Unexpected type of inputOptions! Expected object, Map or Promise, got "+typeof t.inputOptions)},Et=(e,t)=>{const o=e.getInput();o&&(X(o),g(t.inputValue).then(s=>{o.value="number"===t.input?`${parseFloat(s)||0}`:`${s}`,W(o),o.focus(),e.hideLoading()}).catch(t=>{u(`Error in inputValue promise: ${t}`),o.value="",W(o),o.focus(),e.hideLoading()}))};const Bt=e=>(e instanceof Map?Array.from(e):Object.entries(e)).map(([e,t])=>[e,"object"==typeof t?Bt(t):t]),zt=(e,t)=>Boolean(t)&&null!=t&&t.toString()===e.toString(),$t=(e,t)=>{const o=pe.innerParams.get(e);if(!o.input)return void u(`The "input" parameter is needed to be set when using returnInputValueOn${c(t)}`);const s=e.getInput(),n=((e,t)=>{const o=e.getInput();if(!o)return null;switch(t.input){case"checkbox":return kt(o);case"radio":return xt(o);case"file":return Ct(o);default:return t.inputAutoTrim?o.value.trim():o.value}})(e,o);o.inputValidator?St(e,n,t):s&&!s.checkValidity()?(e.enableButtons(),e.showValidationMessage(o.validationMessage||s.validationMessage)):"deny"===t?Lt(e,n):Pt(e,n)},St=(e,t,o)=>{const s=pe.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>g(s.inputValidator(t,s.validationMessage))).then(s=>{e.enableButtons(),e.enableInput(),s?e.showValidationMessage(s):"deny"===o?Lt(e,t):Pt(e,t)})},Lt=(e,t)=>{const o=pe.innerParams.get(e);o.showLoaderOnDeny&&vt(L()),o.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then(()=>g(o.preDeny(t,o.validationMessage))).then(o=>{!1===o?(e.hideLoading(),ht(e)):e.close({isDenied:!0,value:void 0===o?t:o})}).catch(t=>_t(e,t))):e.close({isDenied:!0,value:t})},qt=(e,t)=>{e.close({isConfirmed:!0,value:t})},_t=(e,t)=>{e.rejectPromise(t)},Pt=(e,t)=>{const o=pe.innerParams.get(e);o.showLoaderOnConfirm&&vt(),o.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then(()=>g(o.preConfirm(t,o.validationMessage))).then(o=>{ee(z())||!1===o?(e.hideLoading(),ht(e)):qt(e,void 0===o?t:o)}).catch(t=>_t(e,t))):qt(e,t)};function Tt(){const e=pe.innerParams.get(this);if(!e)return;const t=pe.domCache.get(this);X(t.loader),H()?e.icon&&W(x()):Mt(t),K([t.popup,t.actions],a.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),this.enableButtons()}const Mt=e=>{const t=e.loader.getAttribute("data-button-to-replace"),o=t?e.popup.getElementsByClassName(t):[];o.length?W(o[0],"inline-block"):!ee($())&&!ee(L())&&!ee(S())&&X(e.actions)};function It(){const e=pe.innerParams.get(this),t=pe.domCache.get(this);return t?R(t.popup,e.input):null}function Ot(e,t,o){const s=pe.domCache.get(e);t.forEach(e=>{s[e].disabled=o})}function Ht(e,t){const o=k();o&&e&&("radio"===e.type?o.querySelectorAll(`[name="${a.radio}"]`).forEach(e=>{e.disabled=t}):e.disabled=t)}function jt(){Ot(this,["confirmButton","denyButton","cancelButton"],!1);const e=pe.focusedElement.get(this);e instanceof HTMLElement&&document.activeElement===document.body&&e.focus(),pe.focusedElement.delete(this)}function Dt(){pe.focusedElement.set(this,document.activeElement),Ot(this,["confirmButton","denyButton","cancelButton"],!0)}function Qt(){Ht(this.getInput(),!1)}function Rt(){Ht(this.getInput(),!0)}function Vt(e){const t=pe.domCache.get(this),o=pe.innerParams.get(this);j(t.validationMessage,e),t.validationMessage.className=a["validation-message"],o.customClass&&o.customClass.validationMessage&&F(t.validationMessage,o.customClass.validationMessage),W(t.validationMessage);const s=this.getInput();s&&(s.setAttribute("aria-invalid","true"),s.setAttribute("aria-describedby",a["validation-message"]),V(s),F(s,a.inputerror))}function Nt(){const e=pe.domCache.get(this);e.validationMessage&&X(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),K(t,a.inputerror))}const Ft={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,theme:"light",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:"×",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:{},inputAutoFocus:!0,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,topLayer:!1},Kt=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","draggable","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","theme","willClose"],Ut={allowEnterKey:void 0},Yt=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Wt=e=>Object.prototype.hasOwnProperty.call(Ft,e),Xt=e=>-1!==Kt.indexOf(e),Zt=e=>Ut[e],Jt=e=>{Wt(e)||d(`Unknown parameter "${e}"`)},Gt=e=>{Yt.includes(e)&&d(`The parameter "${e}" is incompatible with toasts`)},eo=e=>{const t=Zt(e);t&&p(e,t)},to=e=>{!1===e.backdrop&&e.allowOutsideClick&&d('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),e.theme&&!["light","dark","auto","minimal","borderless","bootstrap-4","bootstrap-4-light","bootstrap-4-dark","bootstrap-5","bootstrap-5-light","bootstrap-5-dark","material-ui","material-ui-light","material-ui-dark","embed-iframe","bulma","bulma-light","bulma-dark"].includes(e.theme)&&d(`Invalid theme "${e.theme}"`);for(const t in e)Jt(t),e.toast&&Gt(t),eo(t)};function oo(e){const t=f(),o=k(),s=pe.innerParams.get(this);if(!o||D(o,s.hideClass.popup))return void d("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const n=so(e),i=Object.assign({},s,n);to(i),t&&(t.dataset.swal2Theme=i.theme),Re(this,i),pe.innerParams.set(this,i),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const so=e=>{const t={};return Object.keys(e).forEach(o=>{if(Xt(o)){const s=e;t[o]=s[o]}else d(`Invalid parameter to update: ${o}`)}),t};function no(){var e;const t=pe.domCache.get(this),o=pe.innerParams.get(this);o?(t.popup&&s.swalCloseEventFinishedCallback&&(s.swalCloseEventFinishedCallback(),delete s.swalCloseEventFinishedCallback),"function"==typeof o.didDestroy&&o.didDestroy(),null===(e=s.eventEmitter)||void 0===e||e.emit("didDestroy"),io(this)):ao(this)}const io=e=>{ao(e),delete e.params,delete s.keydownHandler,delete s.keydownTarget,delete s.currentInstance},ao=e=>{e.isAwaitingPromise?(ro(pe,e),e.isAwaitingPromise=!0):(ro(et,e),ro(pe,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},ro=(e,t)=>{for(const o in e)e[o].delete(t)};var lo=Object.freeze({__proto__:null,_destroy:no,close:ut,closeModal:ut,closePopup:ut,closeToast:ut,disableButtons:Dt,disableInput:Rt,disableLoading:Tt,enableButtons:jt,enableInput:Qt,getInput:It,handleAwaitingPromise:ht,hideLoading:Tt,rejectPromise:pt,resetValidationMessage:Nt,showValidationMessage:Vt,update:oo});const co=(e,t,o)=>{t.popup.onclick=()=>{e&&(uo(e)||e.timer||e.input)||o(Ne.close)}},uo=e=>Boolean(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton);let wo=!1;const po=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(wo=!0)}}},ho=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(wo=!0)}}},mo=(e,t,o)=>{t.container.onclick=s=>{wo?wo=!1:s.target===t.container&&h(e.allowOutsideClick)&&o(Ne.backdrop)}},go=e=>e instanceof Element||(e=>"object"==typeof e&&null!==e&&"jquery"in e)(e);const bo=()=>{if(s.timeout)return(()=>{const e=T();if(!e)return;const t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const o=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${o}%`})(),s.timeout.stop()},fo=()=>{if(s.timeout){const e=s.timeout.start();return se(e),e}};let vo=!1;const yo={};const ko=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in yo){const o=t.getAttribute&&t.getAttribute(e);if(o)return void yo[e].fire({template:o})}};s.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(e){return void 0===this.events[e]&&(this.events[e]=[]),this.events[e]}on(e,t){const o=this._getHandlersByEventName(e);o.includes(t)||o.push(t)}once(e,t){const o=(...s)=>{this.removeListener(e,o),t.apply(this,s)};this.on(e,o)}emit(e,...t){this._getHandlersByEventName(e).forEach(e=>{try{e.apply(this,t)}catch(e){console.error(e)}})}removeListener(e,t){const o=this._getHandlersByEventName(e),s=o.indexOf(t);s>-1&&o.splice(s,1)}removeAllListeners(e){void 0!==this.events[e]&&(this.events[e].length=0)}reset(){this.events={}}};var xo=Object.freeze({__proto__:null,argsToParams:e=>{const t={};return"object"!=typeof e[0]||go(e[0])?["title","html","icon"].forEach((o,s)=>{const n=e[s];"string"==typeof n||go(n)?t[o]=n:void 0!==n&&u(`Unexpected type of ${o}! Expected "string" or "Element", got ${typeof n}`)}):Object.assign(t,e[0]),t},bindClickHandler:function(e="data-swal-template"){yo[e]=this,vo||(document.body.addEventListener("click",ko),vo=!0)},clickCancel:()=>{var e;return null===(e=S())||void 0===e?void 0:e.click()},clickConfirm:Ve,clickDeny:()=>{var e;return null===(e=L())||void 0===e?void 0:e.click()},enableLoading:vt,fire:function(...e){return new this(...e)},getActions:_,getCancelButton:S,getCloseButton:M,getConfirmButton:$,getContainer:f,getDenyButton:L,getFocusableElements:I,getFooter:P,getHtmlContainer:A,getIcon:x,getIconContent:()=>y(a["icon-content"]),getImage:E,getInputLabel:()=>y(a["input-label"]),getLoader:q,getPopup:k,getProgressSteps:B,getTimerLeft:()=>s.timeout&&s.timeout.getTimerLeft(),getTimerProgressBar:T,getTitle:C,getValidationMessage:z,increaseTimer:e=>{if(s.timeout){const t=s.timeout.increase(e);return se(t,!0),t}},isDeprecatedParameter:Zt,isLoading:()=>{const e=k();return!!e&&e.hasAttribute("data-loading")},isTimerRunning:()=>Boolean(s.timeout&&s.timeout.isRunning()),isUpdatableParameter:Xt,isValidParameter:Wt,isVisible:()=>ee(k()),mixin:function(e){return class extends(this){_main(t,o){return super._main(t,Object.assign({},e,o))}}},off:(e,t)=>{s.eventEmitter&&(e?t?s.eventEmitter.removeListener(e,t):s.eventEmitter.removeAllListeners(e):s.eventEmitter.reset())},on:(e,t)=>{s.eventEmitter&&s.eventEmitter.on(e,t)},once:(e,t)=>{s.eventEmitter&&s.eventEmitter.once(e,t)},resumeTimer:fo,showLoading:vt,stopTimer:bo,toggleTimer:()=>{const e=s.timeout;return e&&(e.running?bo():fo())}});class Co{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.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const 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 Ao=["swal-title","swal-html","swal-footer"],Eo=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach(e=>{Po(e,["name","value"]);const o=e.getAttribute("name"),s=e.getAttribute("value");o&&s&&(t[o]=o in Ft&&"boolean"==typeof Ft[o]?"false"!==s:o in Ft&&"object"==typeof Ft[o]?JSON.parse(s):s)}),t},Bo=e=>{const t={};return Array.from(e.querySelectorAll("swal-function-param")).forEach(e=>{const o=e.getAttribute("name"),s=e.getAttribute("value");o&&s&&(t[o]=new Function(`return ${s}`)())}),t},zo=e=>{const t={};return Array.from(e.querySelectorAll("swal-button")).forEach(e=>{Po(e,["type","color","aria-label"]);const o=e.getAttribute("type");if(!o||!["confirm","cancel","deny"].includes(o))return;t[`${o}ButtonText`]=e.innerHTML,t[`show${c(o)}Button`]=!0;const s=e.getAttribute("color");null!==s&&(t[`${o}ButtonColor`]=s);const n=e.getAttribute("aria-label");null!==n&&(t[`${o}ButtonAriaLabel`]=n)}),t},$o=e=>{const t={},o=e.querySelector("swal-image");if(o){Po(o,["src","width","height","alt"]);const e=o.getAttribute("src");null!==e&&(t.imageUrl=e||void 0);const s=o.getAttribute("width");null!==s&&(t.imageWidth=s||void 0);const n=o.getAttribute("height");null!==n&&(t.imageHeight=n||void 0);const i=o.getAttribute("alt");null!==i&&(t.imageAlt=i||void 0)}return t},So=e=>{const t={},o=e.querySelector("swal-icon");return o&&(Po(o,["type","color"]),o.hasAttribute("type")&&(t.icon=o.getAttribute("type")),o.hasAttribute("color")&&(t.iconColor=o.getAttribute("color")),t.iconHtml=o.innerHTML),t},Lo=e=>{const t={},o=e.querySelector("swal-input");o&&(Po(o,["type","label","placeholder","value"]),t.input=o.getAttribute("type")||"text",o.hasAttribute("label")&&(t.inputLabel=o.getAttribute("label")),o.hasAttribute("placeholder")&&(t.inputPlaceholder=o.getAttribute("placeholder")),o.hasAttribute("value")&&(t.inputValue=o.getAttribute("value")));const s=Array.from(e.querySelectorAll("swal-input-option"));return s.length&&(t.inputOptions={},s.forEach(e=>{Po(e,["value"]);const o=e.getAttribute("value");if(!o)return;const s=e.innerHTML;t.inputOptions[o]=s})),t},qo=(e,t)=>{const o={};for(const s in t){const n=t[s],i=e.querySelector(n);i&&(Po(i,[]),o[n.replace(/^swal-/,"")]=i.innerHTML.trim())}return o},_o=e=>{const t=Ao.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach(e=>{const o=e.tagName.toLowerCase();t.includes(o)||d(`Unrecognized element <${o}>`)})},Po=(e,t)=>{Array.from(e.attributes).forEach(o=>{-1===t.indexOf(o.name)&&d([`Unrecognized attribute "${o.name}" on <${e.tagName.toLowerCase()}>.`,t.length?`Allowed attributes are: ${t.join(", ")}`:"To set the value, use HTML within the element."])})},To=e=>{var t,o;const n=f(),i=k();if(!n||!i)return;"function"==typeof e.willOpen&&e.willOpen(i),null===(t=s.eventEmitter)||void 0===t||t.emit("willOpen",i);const a=window.getComputedStyle(document.body).overflowY;if(Ho(n,i,e),setTimeout(()=>{Io(n,i)},10),O()&&(Oo(n,void 0!==e.scrollbarPadding&&e.scrollbarPadding,a),(()=>{const e=f();Array.from(document.body.children).forEach(t=>{t.contains(e)||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")||""),t.setAttribute("aria-hidden","true"))})})()),st&&!1===e.backdrop&&i.scrollHeight>n.clientHeight&&(n.style.pointerEvents="auto"),H()||s.previousActiveElement||(s.previousActiveElement=document.activeElement),"function"==typeof e.didOpen){const t=e.didOpen;setTimeout(()=>t(i))}null===(o=s.eventEmitter)||void 0===o||o.emit("didOpen",i)},Mo=e=>{const t=k();if(!t||e.target!==t)return;const o=f();o&&(t.removeEventListener("animationend",Mo),t.removeEventListener("transitionend",Mo),o.style.overflowY="auto",K(o,a["no-transition"]))},Io=(e,t)=>{oe(t)?(e.style.overflowY="hidden",t.addEventListener("animationend",Mo),t.addEventListener("transitionend",Mo)):e.style.overflowY="auto"},Oo=(e,t,o)=>{(()=>{if(ot&&!D(document.body,a.iosfix)){const e=document.body.scrollTop;document.body.style.top=-1*e+"px",F(document.body,a.iosfix),nt()}})(),t&&"hidden"!==o&&ct(o),setTimeout(()=>{e.scrollTop=0})},Ho=(e,t,o)=>{var s;null!==(s=o.showClass)&&void 0!==s&&s.backdrop&&F(e,o.showClass.backdrop),o.animation?(t.style.setProperty("opacity","0","important"),W(t,"grid"),setTimeout(()=>{var e;null!==(e=o.showClass)&&void 0!==e&&e.popup&&F(t,o.showClass.popup),t.style.removeProperty("opacity")},10)):W(t,"grid"),F([document.documentElement,document.body],a.shown),o.heightAuto&&o.backdrop&&!o.toast&&F([document.documentElement,document.body],a["height-auto"])};var jo=(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),Do=(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 Qo(e){(function(e){e.inputValidator||("email"===e.input&&(e.inputValidator=jo),"url"===e.input&&(e.inputValidator=Do))})(e),e.showLoaderOnConfirm&&!e.preConfirm&&d("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"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(d('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),ae(e)}let Ro;var Vo=new WeakMap;class No{constructor(...t){if(o(this,Vo,Promise.resolve({isConfirmed:!1,isDenied:!1,isDismissed:!0})),"undefined"==typeof window)return;Ro=this;const s=Object.freeze(this.constructor.argsToParams(t));var n,i,a;this.params=s,this.isAwaitingPromise=!1,n=Vo,i=this,a=this._main(Ro.params),n.set(e(n,i),a)}_main(e,t={}){if(to(Object.assign({},t,e)),s.currentInstance){const e=et.swalPromiseResolve.get(s.currentInstance),{isAwaitingPromise:t}=s.currentInstance;s.currentInstance._destroy(),t||e({isDismissed:!0}),O()&&tt()}s.currentInstance=Ro;const o=Ko(e,t);Qo(o),Object.freeze(o),s.timeout&&(s.timeout.stop(),delete s.timeout),clearTimeout(s.restoreFocusTimeout);const n=Uo(Ro);return Re(Ro,o),pe.innerParams.set(Ro,o),Fo(Ro,n,o)}then(e){return t(Vo,this).then(e)}finally(e){return t(Vo,this).finally(e)}}const Fo=(e,t,o)=>new Promise((n,i)=>{const a=t=>{e.close({isDismissed:!0,dismiss:t,isConfirmed:!1,isDenied:!1})};et.swalPromiseResolve.set(e,n),et.swalPromiseReject.set(e,i),t.confirmButton.onclick=()=>{(e=>{const t=pe.innerParams.get(e);e.disableButtons(),t.input?$t(e,"confirm"):Pt(e,!0)})(e)},t.denyButton.onclick=()=>{(e=>{const t=pe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?$t(e,"deny"):Lt(e,!1)})(e)},t.cancelButton.onclick=()=>{((e,t)=>{e.disableButtons(),t(Ne.cancel)})(e,a)},t.closeButton.onclick=()=>{a(Ne.close)},((e,t,o)=>{e.toast?co(e,t,o):(po(t),ho(t),mo(e,t,o))})(o,t,a),((e,t,o)=>{if(Fe(e),!t.toast){const s=e=>We(t,e,o);e.keydownHandler=s;const n=t.keydownListenerCapture?window:k();if(n){e.keydownTarget=n,e.keydownListenerCapture=t.keydownListenerCapture;const o=s;e.keydownTarget.addEventListener("keydown",o,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0}}})(s,o,a),((e,t)=>{"select"===t.input||"radio"===t.input?At(e,t):["text","email","number","tel","textarea"].some(e=>e===t.input)&&(m(t.inputValue)||b(t.inputValue))&&(vt($()),Et(e,t))})(e,o),To(o),Yo(s,o,a),Wo(t,o),setTimeout(()=>{t.container.scrollTop=0})}),Ko=(e,t)=>{const o=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const o=t.content;return _o(o),Object.assign(Eo(o),Bo(o),zo(o),$o(o),So(o),Lo(o),qo(o,Ao))})(e),s=Object.assign({},Ft,t,o,e);return s.showClass=Object.assign({},Ft.showClass,s.showClass),s.hideClass=Object.assign({},Ft.hideClass,s.hideClass),!1===s.animation&&(s.showClass={backdrop:"swal2-noanimation"},s.hideClass={}),s},Uo=e=>{const t={popup:k(),container:f(),actions:_(),confirmButton:$(),denyButton:L(),cancelButton:S(),loader:q(),closeButton:M(),validationMessage:z(),progressSteps:B()};return pe.domCache.set(e,t),t},Yo=(e,t,o)=>{const s=T();X(s),t.timer&&(e.timeout=new Co(()=>{o("timer"),delete e.timeout},t.timer),t.timerProgressBar&&s&&(W(s),Q(s,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&se(t.timer)})))},Wo=(e,t)=>{if(!t.toast)return h(t.allowEnterKey)?void(Xo(e)||Zo(e,t)||Ke(-1,1)):(p("allowEnterKey","preConfirm: () => false"),void e.popup.focus())},Xo=e=>{const t=Array.from(e.popup.querySelectorAll("[autofocus]"));for(const e of t)if(e instanceof HTMLElement&&ee(e))return e.focus(),!0;return!1},Zo=(e,t)=>t.focusDeny&&ee(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ee(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!ee(e.confirmButton)||(e.confirmButton.focus(),0));No.prototype.disableButtons=Dt,No.prototype.enableButtons=jt,No.prototype.getInput=It,No.prototype.disableInput=Rt,No.prototype.enableInput=Qt,No.prototype.hideLoading=Tt,No.prototype.disableLoading=Tt,No.prototype.showValidationMessage=Vt,No.prototype.resetValidationMessage=Nt,No.prototype.close=ut,No.prototype.closePopup=ut,No.prototype.closeModal=ut,No.prototype.closeToast=ut,No.prototype.rejectPromise=pt,No.prototype.update=oo,No.prototype._destroy=no,Object.assign(No,xo),Object.keys(lo).forEach(e=>{No[e]=function(...t){if(Ro&&Ro[e])return Ro[e](...t)}}),No.DismissReason=Ne,No.version="11.26.25";const Jo=No;return Jo.default=Jo,Jo}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var o=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(o),o.styleSheet)o.styleSheet.disabled||(o.styleSheet.cssText=t);else try{o.innerHTML=t}catch(e){o.innerText=t}}(document,':root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:auto}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:auto}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}')}};const t={};function o(s){const n=t[s];if(void 0!==n)return n.exports;const i=t[s]={exports:{}};return e[s].call(i.exports,i,i.exports,o),i.exports}o.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{if(Array.isArray(t))for(var s=0;s<t.length;){var n=t[s++],i=t[s++];o.o(e,n)?0===i&&s++:0===i?Object.defineProperty(e,n,{enumerable:!0,value:t[s++]}):Object.defineProperty(e,n,{enumerable:!0,get:i})}else for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.hasOwn(e,t),(()=>{"use strict";const e=(e,t)=>{document.addEventListener(e,o=>{const s=o.target;let n={e:o,target:s};t.forEach(t=>{n={...n,...t},t.conditionBeforeCallBack&&!0!==t.conditionBeforeCallBack(n)||"keydown"===e&&t.checkIsEventEnter&&"Enter"!==o.key||s.closest(t.selector)&&(t.class?t.class[t.callBack](n):t.callBack(n))})})};window.lpToggleEnableInit=0,window.lpFullScreenViewInit=0;var t=o(8465),s=o.n(t);class n{constructor(){this.config=null,this.root=null,this.elements={},this.storageKey="",this.history=[],this.activeQuizState=null,this.isRequesting=!1,this.quizHookBound=!1,this.lastQuizReviewSignature=""}static selectors={root:"#lp-ai-assistant",toggleBtn:".lp-ai-assistant__toggle",panel:".lp-ai-assistant__panel",closeBtn:".lp-ai-assistant__close-btn",clearBtn:".lp-ai-assistant__clear-btn",msgList:".lp-ai-assistant__messages",inputEl:".lp-ai-assistant__input",sendBtn:".lp-ai-assistant__send-btn",quickBtn:".lp-ai-assistant__quick-btn",quickActions:".lp-ai-assistant__quick-actions",inputArea:".lp-ai-assistant__input-area",smartReviewBtn:".lp-ai-assistant__smart-review-btn",quizCard:".lp-ai-assistant__quiz-card",quizOptionBtn:".lp-ai-assistant__quiz-option"};static itemTypes=["lp_lesson","lp_quiz"];init(){this.validateConfig()&&(this.root=document.querySelector(n.selectors.root),this.root&&(this.cacheElements(),this.validateDOM()&&(this.storageKey=`lp_ai_chat_${this.config.context}_${this.config.itemId}`,this.applyInitialState(),this.loadHistory(),this.renderHistoryToDOM(),this.bindQuizCompletedHook(),this.events())))}validateConfig(){if("object"!=typeof window.lpAIAssistant||!window.lpAIAssistant)return!1;if(this.config=window.lpAIAssistant,!this.config.enabled)return!1;const e=["nonce","ajaxUrl"];for(const t of e)if("string"!=typeof this.config[t]||!this.config[t])return!1;const t=Number.isInteger(this.config.itemId)?this.config.itemId:this.config.lessonId;return!(!Number.isInteger(t)||t<=0||!Number.isInteger(this.config.courseId)||this.config.courseId<=0||!n.itemTypes.includes(this.config.itemType)||(this.config.itemId=t,this.config.lessonId=t,this.config.context="quiz"===this.config.context?"quiz":"lesson",this.config.quizCompleted=!!this.config.quizCompleted,this.config.enabledActions={summarize:!0,explain:!0,quick_quiz:!0,smart_review:!0,...this.config.enabledActions||{}},this.config.i18n={you:this.config?.i18n?.you||"You",assistant:this.config?.i18n?.assistant||"AI Assistant",thinking:this.config?.i18n?.thinking||"Thinking...",sendError:this.config?.i18n?.sendError||"An error occurred. Please try again.",clearConfirm:this.config?.i18n?.clearConfirm||"Clear chat history?",explainPrompt:this.config?.i18n?.explainPrompt||"Explain a concept from this lesson.",quizPrompt:this.config?.i18n?.quizPrompt||"Create a quick quiz from this lesson.",summarizePrompt:this.config?.i18n?.summarizePrompt||"Summarize this lesson with key points.",smartReviewPrompt:this.config?.i18n?.smartReviewPrompt||"Give me a smart review of my quiz results.",quizCorrectTitle:this.config?.i18n?.quizCorrectTitle||"Correct!",quizWrongTitle:this.config?.i18n?.quizWrongTitle||"Not correct!"},0))}cacheElements(){this.elements.toggleBtn=document.querySelector(n.selectors.toggleBtn),this.elements.panel=this.root.querySelector(n.selectors.panel),this.elements.closeBtn=this.root.querySelector(n.selectors.closeBtn),this.elements.clearBtn=this.root.querySelector(n.selectors.clearBtn),this.elements.msgList=this.root.querySelector(n.selectors.msgList),this.elements.inputEl=this.root.querySelector(n.selectors.inputEl),this.elements.sendBtn=this.root.querySelector(n.selectors.sendBtn),this.elements.inputArea=this.root.querySelector(n.selectors.inputArea),this.elements.quickActions=this.root.querySelector(n.selectors.quickActions),this.elements.smartReviewBtn=this.root.querySelector(n.selectors.smartReviewBtn)}validateDOM(){return!!(this.elements.toggleBtn&&this.elements.panel&&this.elements.msgList)}applyInitialState(){if(this.elements.smartReviewBtn){const e="quiz"===this.config.context?this.config.quizCompleted:!!this.config.enabledActions?.smart_review;this.elements.smartReviewBtn.hidden=!e}this.setQuizInputMode(!1)}bindQuizCompletedHook(){if("quiz"===this.config.context)return;if(this.quizHookBound||!this.elements.smartReviewBtn)return;const e=window?.wp?.hooks;e&&"function"==typeof e.addAction&&(e.addAction("lp-js-quiz-answer","learnpress/ai-assistant-smart-review",(e,t)=>{"completed"===String(t||"").toLowerCase()&&(this.config.quizCompleted=!0,this.elements.smartReviewBtn.hidden=!1)}),this.quizHookBound=!0)}events(){n._loadedEvents||(n._loadedEvents=this,e("click",[{selector:n.selectors.toggleBtn,class:this,callBack:this.handleToggleClick.name},{selector:`${n.selectors.root} ${n.selectors.closeBtn}`,class:this,callBack:this.handleCloseClick.name},{selector:`${n.selectors.root} ${n.selectors.clearBtn}`,class:this,callBack:this.handleClearClick.name},{selector:`${n.selectors.root} ${n.selectors.sendBtn}`,class:this,callBack:this.handleSendClick.name},{selector:`${n.selectors.root} ${n.selectors.quickBtn}`,class:this,callBack:this.handleQuickActionClick.name},{selector:`${n.selectors.root} ${n.selectors.quizOptionBtn}`,class:this,callBack:this.handleQuizOptionClick.name}]),e("keydown",[{selector:`${n.selectors.root} ${n.selectors.inputEl}`,class:this,callBack:this.handleInputKeydown.name},{selector:"body",class:this,callBack:this.handleEscapeKeydown.name}]))}handleToggleClick(e){e.e.preventDefault(),this.elements.panel.hidden?this.openPanel():this.closePanel()}handleCloseClick(e){e.e.preventDefault(),this.closePanel()}handleClearClick(e){e.e.preventDefault(),s().fire({title:this.config.i18n.clearConfirm,icon:"warning",showCancelButton:!0,confirmButtonColor:"var(--lp-primary-color, #ffb606)"}).then(e=>{e.isConfirmed&&this.clearHistory()})}handleSendClick(e){var t;e.e.preventDefault(),this.sendMessage(null!==(t=this.elements.inputEl?.value)&&void 0!==t?t:"")}handleQuickActionClick(e){if(e.e.preventDefault(),this.activeQuizState?.is_active)return;const t=e.target.closest(n.selectors.quickBtn);if(!t)return;const o=t.dataset.lpAiAction,s={explain:this.config.i18n.explainPrompt,"quick-quiz":this.config.i18n.quizPrompt,summarize:this.config.i18n.summarizePrompt,"smart-review":this.config.i18n.smartReviewPrompt}[o];s&&(this.openPanel(),this.sendMessage(s,o))}handleQuizOptionClick(e){if(e.e.preventDefault(),this.isRequesting||!this.activeQuizState?.is_active)return;const t=e.target.closest(n.selectors.quizOptionBtn);if(!t)return;const o=(t.dataset.option||t.textContent||"").trim();o&&this.sendMessage(o)}handleInputKeydown(e){var t;this.activeQuizState?.is_active||"Enter"!==e.e.key||e.e.shiftKey||(e.e.preventDefault(),this.sendMessage(null!==(t=this.elements.inputEl?.value)&&void 0!==t?t:""))}handleEscapeKeydown(e){"Escape"===e.e.key&&this.elements.panel&&!this.elements.panel.hidden&&this.closePanel()}getAjaxHandle(){const e=window.lpAJAXG;return e&&"function"==typeof e.fetchAJAX?e:null}openPanel(){this.elements.panel.hidden=!1,this.root.setAttribute("aria-hidden","false"),this.elements.toggleBtn.setAttribute("aria-expanded","true"),this.elements.toggleBtn.classList.add("is-hidden"),this.elements.inputEl?.focus(),this.elements.msgList&&(this.elements.msgList.scrollTop=this.elements.msgList.scrollHeight)}closePanel(){this.elements.panel.hidden=!0,this.root.setAttribute("aria-hidden","true"),this.elements.toggleBtn.setAttribute("aria-expanded","false"),this.elements.toggleBtn.classList.remove("is-hidden"),this.elements.toggleBtn.focus()}setLoadingState(e){this.isRequesting=e,this.elements.sendBtn&&(this.elements.sendBtn.disabled=e),this.elements.inputEl&&(this.elements.inputEl.disabled=e)}setQuizInputMode(e){this.elements.inputArea&&this.elements.inputArea.classList.toggle("lp-ai-assistant__input-area--hidden",e),this.elements.quickActions&&this.elements.quickActions.classList.toggle("lp-ai-assistant__quick-actions--disabled",e)}loadHistory(){try{const e=localStorage.getItem(this.storageKey);this.history=e?JSON.parse(e):[],Array.isArray(this.history)||(this.history=[]);const t=[...this.history].reverse().find(e=>"quiz_review"===e?.type&&e?.review);this.lastQuizReviewSignature=t?.review?this.getQuizReviewKey(t.review):""}catch(e){this.history=[],this.lastQuizReviewSignature=""}}saveHistory(){try{localStorage.setItem(this.storageKey,JSON.stringify(this.history))}catch(e){}}clearHistory(){this.history=[],this.activeQuizState=null,this.lastQuizReviewSignature="",this.elements.msgList.innerHTML="",localStorage.removeItem(this.storageKey),this.setQuizInputMode(!1)}createEl(e,t,o=""){const s=document.createElement(e);return t&&(s.className=t),""!==o&&(s.textContent=String(o)),s}appendMessage(e,t){const o=this.createEl("div",`lp-ai-assistant__msg lp-ai-assistant__msg--${e}`),s="user"===e?this.config.i18n.you:this.config.i18n.assistant;return o.appendChild(this.createEl("span","lp-ai-assistant__msg-label",s)),o.appendChild(this.createEl("p","lp-ai-assistant__msg-text",t)),this.elements.msgList.appendChild(o),this.elements.msgList.scrollTop=this.elements.msgList.scrollHeight,o}renderHistoryToDOM(){this.elements.msgList.innerHTML="",this.history.forEach(e=>{"quiz_review"===e?.type&&e?.review?this.appendQuizReviewCard(e.review):e&&["user","assistant"].includes(e.role)&&this.appendMessage(e.role,e.content||"")}),this.renderQuizState()}getQuizReviewFromState(e){var t,o;if(!e||!e.feedback||"object"!=typeof e.feedback)return null;const s=Number.parseInt(e.current_index||0,10),n=Math.max(0,s-1),i=e.questions?.[n];if(!i||!Array.isArray(i.options))return null;const a=Number.parseInt(null!==(t=e.feedback.selected_index)&&void 0!==t?t:-1,10),r=Number.parseInt(null!==(o=e.feedback.correct_index)&&void 0!==o?o:-1,10);return{question_index:n,total:Number.parseInt(e.total||i.options.length||0,10),question:i.question||"",options:i.options,selected_index:a,correct_index:r,is_correct:!!e.feedback.is_correct,explanation:e.feedback.explanation||""}}getQuizReviewKey(e){return[e.question_index,e.total,e.selected_index,e.correct_index,e.is_correct?1:0].join("|")}pushQuizReviewToHistory(e){const t=this.getQuizReviewKey(e);return t!==this.lastQuizReviewSignature&&(this.lastQuizReviewSignature=t,this.history.push({type:"quiz_review",review:e}),this.saveHistory(),!0)}buildQuizOption(e,t,o=[]){const s=["lp-ai-assistant__quiz-option",...o].join(" "),n=String.fromCharCode(65+t),i=this.createEl("button",s,`${n}. ${String(e)}`);return i.type="button",i}buildQuizReviewOptions(e){return(Array.isArray(e.options)?e.options:[]).map((t,o)=>{const s=[];o===e.correct_index&&s.push("is-correct-answer"),o===e.selected_index&&s.push(e.is_correct?"is-selected-correct":"is-selected-wrong");const n=this.buildQuizOption(t,o,s);return n.disabled=!0,n})}appendQuizReviewCard(e){const t=this.createEl("div","lp-ai-assistant__quiz-card lp-ai-assistant__quiz-card--review");t.dataset.reviewKey=this.getQuizReviewKey(e);const o=Array.isArray(e.options)?e.options.length:0,s=e.total||o;t.appendChild(this.createEl("div","lp-ai-assistant__quiz-head",`Question ${e.question_index+1}/${s}`)),t.appendChild(this.createEl("div","lp-ai-assistant__quiz-question",e.question||""));const n=this.createEl("div","lp-ai-assistant__quiz-options");this.buildQuizReviewOptions(e).forEach(e=>n.appendChild(e)),t.appendChild(n);const i=e.is_correct?"is-correct":"is-wrong",a=this.createEl("div",`lp-ai-assistant__quiz-feedback ${i}`);a.appendChild(this.createEl("strong","",e.is_correct?this.config.i18n.quizCorrectTitle:this.config.i18n.quizWrongTitle)),e.explanation&&a.appendChild(this.createEl("div","",e.explanation)),t.appendChild(a),this.elements.msgList.appendChild(t)}renderQuizState(){const e=this.elements.msgList.querySelector(".lp-ai-assistant__quiz-card--active");if(e&&e.remove(),!this.activeQuizState||!this.activeQuizState.questions)return void this.setQuizInputMode(!1);const t=this.activeQuizState,o=this.getQuizReviewFromState(t);if(o&&this.pushQuizReviewToHistory(o)&&this.appendQuizReviewCard(o),!t.is_active)return void this.setQuizInputMode(!1);const s=Number.parseInt(t.current_index||0,10),n=t.questions?.[s];if(!n)return void this.setQuizInputMode(!1);const i=this.createEl("div","lp-ai-assistant__quiz-card lp-ai-assistant__quiz-card--active"),a=Array.isArray(n.options)?n.options:[];i.appendChild(this.createEl("div","lp-ai-assistant__quiz-head",`Question ${s+1}/${t.total||a.length}`)),i.appendChild(this.createEl("div","lp-ai-assistant__quiz-question",n.question||""));const r=this.createEl("div","lp-ai-assistant__quiz-options");a.forEach((e,t)=>{const o=this.buildQuizOption(e,t);o.dataset.index=String(t),o.dataset.option=String(e),r.appendChild(o)}),i.appendChild(r),this.elements.msgList.appendChild(i),this.setQuizInputMode(!0)}scrollToMessageStart(e){const t=this.elements.msgList;t&&e&&t.contains(e)&&(t.scrollTop=Math.max(0,e.offsetTop-8))}sendMessage(e,t=""){const o=(e||"").trim();if(this.isRequesting||!o)return;const s=this.getAjaxHandle();if(!s)return void this.appendMessage("assistant",this.config.i18n.sendError);this.appendMessage("user",o);const n=this.history.slice();this.history.push({role:"user",content:o}),this.saveHistory(),this.elements.inputEl&&(this.elements.inputEl.value="");const i=this.appendMessage("assistant",this.config.i18n.thinking),a=i.querySelector(".lp-ai-assistant__msg-text");this.setLoadingState(!0);const r={action:"openai_assistant_chat",message:o,course_id:this.config.courseId,item_type:this.config.itemType,item_id:this.config.itemId,history:n,active_quiz_questions:this.activeQuizState||[],action_hint:"string"==typeof t?t:""},l={success:e=>{"success"===e?.status&&e?.data?(a.textContent=e.data.message||"","quiz"===e?.data?.type?(this.activeQuizState=e?.data?.quiz||null,this.renderQuizState(),(this.activeQuizState?.completed||!1===this.activeQuizState?.is_active)&&this.elements.msgList?.contains(i)&&this.elements.msgList.appendChild(i)):(this.activeQuizState=null,this.renderQuizState()),this.history.push({role:"assistant",content:e.data.message}),this.saveHistory()):(this.activeQuizState=null,this.renderQuizState(),a.textContent=e?.message||this.config.i18n.sendError)},error:()=>{this.activeQuizState=null,this.renderQuizState(),a.textContent=this.config.i18n.sendError},completed:()=>{this.setLoadingState(!1),this.scrollToMessageStart(i)}};s.fetchAJAX(r,l)}}const i=new n;((e,t)=>{const o=document.querySelector(e);if(o)return void t();const s=new MutationObserver((o,s)=>{const n=document.querySelector(e);n&&(s.disconnect(),t())});s.observe(document.documentElement,{childList:!0,subtree:!0})})(n.selectors.root,()=>{i.init()})})()})(); |