@luizleon/sf.prefeiturasp.vuecomponents 0.0.30 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.es.js +153 -152
- package/dist/lib.es.js.map +1 -1
- package/dist/lib.umd.js +8 -8
- package/dist/lib.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/internal/HeaderAvatar.vue +1 -1
- package/src/components/layout/Layout.vue +5 -1
package/dist/lib.umd.js
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<div class="${u["timer-progress-bar"]}"></div>
|
|
47
47
|
</div>
|
|
48
48
|
</div>
|
|
49
|
-
`.replace(/(^|\n)\s*/g,""),Pr=()=>{const t=ne();return t?(t.remove(),Le([document.documentElement,document.body],[u["no-backdrop"],u["toast-shown"],u["has-column"]]),!0):!1},He=()=>{M.currentInstance.resetValidationMessage()},Br=()=>{const t=j(),e=Ne(t,u.input),n=Ne(t,u.file),o=t.querySelector(`.${u.range} input`),s=t.querySelector(`.${u.range} output`),c=Ne(t,u.select),
|
|
49
|
+
`.replace(/(^|\n)\s*/g,""),Pr=()=>{const t=ne();return t?(t.remove(),Le([document.documentElement,document.body],[u["no-backdrop"],u["toast-shown"],u["has-column"]]),!0):!1},He=()=>{M.currentInstance.resetValidationMessage()},Br=()=>{const t=j(),e=Ne(t,u.input),n=Ne(t,u.file),o=t.querySelector(`.${u.range} input`),s=t.querySelector(`.${u.range} output`),c=Ne(t,u.select),k=t.querySelector(`.${u.checkbox} input`),I=Ne(t,u.textarea);e.oninput=He,n.onchange=He,c.onchange=He,k.onchange=He,I.oninput=He,o.oninput=()=>{He(),s.value=o.value},o.onchange=()=>{He(),o.nextSibling.value=o.value}},Rr=t=>typeof t=="string"?document.querySelector(t):t,Or=t=>{const e=j();e.setAttribute("role",t.toast?"alert":"dialog"),e.setAttribute("aria-live",t.toast?"polite":"assertive"),t.toast||e.setAttribute("aria-modal","true")},Fr=t=>{window.getComputedStyle(t).direction==="rtl"&&V(ne(),u.rtl)},Mr=t=>{const e=Pr();if(jn()){Ue("SweetAlert2 requires document to initialize");return}const n=document.createElement("div");n.className=u.container,e&&V(n,u["no-transition"]),oe(n,Ir);const o=Rr(t.target);o.appendChild(n),Or(t),Fr(o),Br()},en=(t,e)=>{t instanceof HTMLElement?e.appendChild(t):typeof t=="object"?Nr(t,e):t&&oe(e,t)},Nr=(t,e)=>{t.jquery?Dr(e,t):oe(e,t.toString())},Dr=(t,e)=>{if(t.textContent="",0 in e)for(let n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},bt=(()=>{if(jn())return!1;const t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&typeof t.style[n]<"u")return e[n];return!1})(),Ur=()=>{const t=document.createElement("div");t.className=u["scrollbar-measure"],document.body.appendChild(t);const e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},$r=(t,e)=>{const n=mt(),o=Ye();!e.showConfirmButton&&!e.showDenyButton&&!e.showCancelButton?re(n):ee(n),Ce(n,e,"actions"),Hr(n,o,e),oe(o,e.loaderHtml),Ce(o,e,"loader")};function Hr(t,e,n){const o=Se(),s=Me(),c=$e();tn(o,"confirm",n),tn(s,"deny",n),tn(c,"cancel",n),Vr(o,s,c,n),n.reverseButtons&&(n.toast?(t.insertBefore(c,o),t.insertBefore(s,o)):(t.insertBefore(c,e),t.insertBefore(s,e),t.insertBefore(o,e)))}function Vr(t,e,n,o){if(!o.buttonsStyling)return Le([t,e,n],u.styled);V([t,e,n],u.styled),o.confirmButtonColor&&(t.style.backgroundColor=o.confirmButtonColor,V(t,u["default-outline"])),o.denyButtonColor&&(e.style.backgroundColor=o.denyButtonColor,V(e,u["default-outline"])),o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,V(n,u["default-outline"]))}function tn(t,e,n){Bt(t,n[`show${Wt(e)}Button`],"inline-block"),oe(t,n[`${e}ButtonText`]),t.setAttribute("aria-label",n[`${e}ButtonAriaLabel`]),t.className=u[e],Ce(t,n,`${e}Button`),V(t,n[`${e}ButtonClass`])}function jr(t,e){typeof e=="string"?t.style.background=e:e||V([document.documentElement,document.body],u["no-backdrop"])}function zr(t,e){e in u?V(t,u[e]):(de('The "position" parameter is not valid, defaulting to "center"'),V(t,u.center))}function Wr(t,e){if(e&&typeof e=="string"){const n=`grow-${e}`;n in u&&V(t,u[n])}}const qr=(t,e)=>{const n=ne();n&&(jr(n,e.backdrop),zr(n,e.position),Wr(n,e.grow),Ce(n,e,"container"))},D={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},Kr=["input","file","range","select","radio","checkbox","textarea"],Gr=(t,e)=>{const n=j(),o=D.innerParams.get(t),s=!o||e.input!==o.input;Kr.forEach(c=>{const k=u[c],I=Ne(n,k);Xr(c,e.inputAttributes),I.className=k,s&&re(I)}),e.input&&(s&&Yr(e),Zr(e))},Yr=t=>{if(!fe[t.input])return Ue(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${t.input}"`);const e=zn(t.input),n=fe[t.input](e,t);ee(n),setTimeout(()=>{Dn(n)})},Jr=t=>{for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].name;["type","value","style"].includes(n)||t.removeAttribute(n)}},Xr=(t,e)=>{const n=Zt(j(),t);if(n){Jr(n);for(const o in e)n.setAttribute(o,e[o])}},Zr=t=>{const e=zn(t.input);t.customClass&&V(e,t.customClass.input)},nn=(t,e)=>{(!t.placeholder||e.inputPlaceholder)&&(t.placeholder=e.inputPlaceholder)},yt=(t,e,n)=>{if(n.inputLabel){t.id=u.input;const o=document.createElement("label"),s=u["input-label"];o.setAttribute("for",t.id),o.className=s,V(o,n.customClass.inputLabel),o.innerText=n.inputLabel,e.insertAdjacentElement("beforebegin",o)}},zn=t=>{const e=u[t]?u[t]:u.input;return Ne(j(),e)},fe={};fe.text=fe.email=fe.password=fe.number=fe.tel=fe.url=(t,e)=>(typeof e.inputValue=="string"||typeof e.inputValue=="number"?t.value=e.inputValue:Kt(e.inputValue)||de(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof e.inputValue}"`),yt(t,t,e),nn(t,e),t.type=e.input,t),fe.file=(t,e)=>(yt(t,t,e),nn(t,e),t),fe.range=(t,e)=>{const n=t.querySelector("input"),o=t.querySelector("output");return n.value=e.inputValue,n.type=e.input,o.value=e.inputValue,yt(n,t,e),t},fe.select=(t,e)=>{if(t.textContent="",e.inputPlaceholder){const n=document.createElement("option");oe(n,e.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,t.appendChild(n)}return yt(t,t,e),t},fe.radio=t=>(t.textContent="",t),fe.checkbox=(t,e)=>{const n=Zt(j(),"checkbox");n.value="1",n.id=u.checkbox,n.checked=!!e.inputValue;const o=t.querySelector("span");return oe(o,e.inputPlaceholder),t},fe.textarea=(t,e)=>{t.value=e.inputValue,nn(t,e),yt(t,t,e);const n=o=>parseInt(window.getComputedStyle(o).marginLeft)+parseInt(window.getComputedStyle(o).marginRight);return setTimeout(()=>{if("MutationObserver"in window){const o=parseInt(window.getComputedStyle(j()).width),s=()=>{const c=t.offsetWidth+n(t);c>o?j().style.width=`${c}px`:j().style.width=null};new MutationObserver(s).observe(t,{attributes:!0,attributeFilter:["style"]})}}),t};const Qr=(t,e)=>{const n=Tt();Ce(n,e,"htmlContainer"),e.html?(en(e.html,n),ee(n,"block")):e.text?(n.textContent=e.text,ee(n,"block")):re(n),Gr(t,e)},ei=(t,e)=>{const n=Nn();Bt(n,e.footer),e.footer&&en(e.footer,n),Ce(n,e,"footer")},ti=(t,e)=>{const n=Yt();oe(n,e.closeButtonHtml),Ce(n,e,"closeButton"),Bt(n,e.showCloseButton),n.setAttribute("aria-label",e.closeButtonAriaLabel)},ni=(t,e)=>{const n=D.innerParams.get(t),o=pt();if(n&&e.icon===n.icon){qn(o,e),Wn(o,e);return}if(!e.icon&&!e.iconHtml)return re(o);if(e.icon&&Object.keys(ft).indexOf(e.icon)===-1)return Ue(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${e.icon}"`),re(o);ee(o),qn(o,e),Wn(o,e),V(o,e.showClass.icon)},Wn=(t,e)=>{for(const n in ft)e.icon!==n&&Le(t,ft[n]);V(t,ft[e.icon]),si(t,e),oi(),Ce(t,e,"icon")},oi=()=>{const t=j(),e=window.getComputedStyle(t).getPropertyValue("background-color"),n=t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let o=0;o<n.length;o++)n[o].style.backgroundColor=e},ri=`
|
|
50
50
|
<div class="swal2-success-circular-line-left"></div>
|
|
51
51
|
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
52
52
|
<div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
|
|
@@ -56,25 +56,25 @@
|
|
|
56
56
|
<span class="swal2-x-mark-line-left"></span>
|
|
57
57
|
<span class="swal2-x-mark-line-right"></span>
|
|
58
58
|
</span>
|
|
59
|
-
`,qn=(t,e)=>{t.textContent="",e.iconHtml?oe(t,Kn(e.iconHtml)):e.icon==="success"?oe(t,ri):e.icon==="error"?oe(t,ii):oe(t,Kn({question:"?",warning:"!",info:"i"}[e.icon]))},si=(t,e)=>{if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])$n(t,n,"backgroundColor",e.iconColor);$n(t,".swal2-success-ring","borderColor",e.iconColor)}},Kn=t=>`<div class="${u["icon-content"]}">${t}</div>`,ai=(t,e)=>{const n=Fn();if(!e.imageUrl)return re(n);ee(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt),gt(n,"width",e.imageWidth),gt(n,"height",e.imageHeight),n.className=u.image,Ce(n,e,"image")},li=t=>{const e=document.createElement("li");return V(e,u["progress-step"]),oe(e,t),e},ci=t=>{const e=document.createElement("li");return V(e,u["progress-step-line"]),t.progressStepsDistance&&(e.style.width=t.progressStepsDistance),e},ui=(t,e)=>{const n=Mn();if(!e.progressSteps||e.progressSteps.length===0)return re(n);ee(n),n.textContent="",e.currentProgressStep>=e.progressSteps.length&&de("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),e.progressSteps.forEach((o,s)=>{const c=li(o);if(n.appendChild(c),s===e.currentProgressStep&&V(c,u["active-progress-step"]),s!==e.progressSteps.length-1){const
|
|
59
|
+
`,qn=(t,e)=>{t.textContent="",e.iconHtml?oe(t,Kn(e.iconHtml)):e.icon==="success"?oe(t,ri):e.icon==="error"?oe(t,ii):oe(t,Kn({question:"?",warning:"!",info:"i"}[e.icon]))},si=(t,e)=>{if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])$n(t,n,"backgroundColor",e.iconColor);$n(t,".swal2-success-ring","borderColor",e.iconColor)}},Kn=t=>`<div class="${u["icon-content"]}">${t}</div>`,ai=(t,e)=>{const n=Fn();if(!e.imageUrl)return re(n);ee(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt),gt(n,"width",e.imageWidth),gt(n,"height",e.imageHeight),n.className=u.image,Ce(n,e,"image")},li=t=>{const e=document.createElement("li");return V(e,u["progress-step"]),oe(e,t),e},ci=t=>{const e=document.createElement("li");return V(e,u["progress-step-line"]),t.progressStepsDistance&&(e.style.width=t.progressStepsDistance),e},ui=(t,e)=>{const n=Mn();if(!e.progressSteps||e.progressSteps.length===0)return re(n);ee(n),n.textContent="",e.currentProgressStep>=e.progressSteps.length&&de("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),e.progressSteps.forEach((o,s)=>{const c=li(o);if(n.appendChild(c),s===e.currentProgressStep&&V(c,u["active-progress-step"]),s!==e.progressSteps.length-1){const k=ci(e);n.appendChild(k)}})},di=(t,e)=>{const n=On();Bt(n,e.title||e.titleText,"block"),e.title&&en(e.title,n),e.titleText&&(n.innerText=e.titleText),Ce(n,e,"title")},fi=(t,e)=>{const n=ne(),o=j();e.toast?(gt(n,"width",e.width),o.style.width="100%",o.insertBefore(Ye(),pt())):gt(o,"width",e.width),gt(o,"padding",e.padding),e.color&&(o.style.color=e.color),e.background&&(o.style.background=e.background),re(Lt()),hi(o,e)},hi=(t,e)=>{t.className=`${u.popup} ${we(t)?e.showClass.popup:""}`,e.toast?(V([document.documentElement,document.body],u["toast-shown"]),V(t,u.toast)):V(t,u.modal),Ce(t,e,"popup"),typeof e.customClass=="string"&&V(t,e.customClass),e.icon&&V(t,u[`icon-${e.icon}`])},Gn=(t,e)=>{fi(t,e),qr(t,e),ui(t,e),ni(t,e),ai(t,e),di(t,e),ti(t,e),Qr(t,e),$r(t,e),ei(t,e),typeof e.didRender=="function"&&e.didRender(j())},Xe=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),pi=()=>{ye(document.body.children).forEach(e=>{e===ne()||e.contains(ne())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))})},Yn=()=>{ye(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")})},Jn=["swal-title","swal-html","swal-footer"],mi=t=>{const e=typeof t.template=="string"?document.querySelector(t.template):t.template;if(!e)return{};const n=e.content;return _i(n),Object.assign(gi(n),bi(n),yi(n),wi(n),vi(n),ki(n,Jn))},gi=t=>{const e={};return ye(t.querySelectorAll("swal-param")).forEach(n=>{Ve(n,["name","value"]);const o=n.getAttribute("name"),s=n.getAttribute("value");typeof Ge[o]=="boolean"&&s==="false"&&(e[o]=!1),typeof Ge[o]=="object"&&(e[o]=JSON.parse(s))}),e},bi=t=>{const e={};return ye(t.querySelectorAll("swal-button")).forEach(n=>{Ve(n,["type","color","aria-label"]);const o=n.getAttribute("type");e[`${o}ButtonText`]=n.innerHTML,e[`show${Wt(o)}Button`]=!0,n.hasAttribute("color")&&(e[`${o}ButtonColor`]=n.getAttribute("color")),n.hasAttribute("aria-label")&&(e[`${o}ButtonAriaLabel`]=n.getAttribute("aria-label"))}),e},yi=t=>{const e={},n=t.querySelector("swal-image");return n&&(Ve(n,["src","width","height","alt"]),n.hasAttribute("src")&&(e.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(e.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(e.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(e.imageAlt=n.getAttribute("alt"))),e},wi=t=>{const e={},n=t.querySelector("swal-icon");return n&&(Ve(n,["type","color"]),n.hasAttribute("type")&&(e.icon=n.getAttribute("type")),n.hasAttribute("color")&&(e.iconColor=n.getAttribute("color")),e.iconHtml=n.innerHTML),e},vi=t=>{const e={},n=t.querySelector("swal-input");n&&(Ve(n,["type","label","placeholder","value"]),e.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(e.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(e.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(e.inputValue=n.getAttribute("value")));const o=t.querySelectorAll("swal-input-option");return o.length&&(e.inputOptions={},ye(o).forEach(s=>{Ve(s,["value"]);const c=s.getAttribute("value"),k=s.innerHTML;e.inputOptions[c]=k})),e},ki=(t,e)=>{const n={};for(const o in e){const s=e[o],c=t.querySelector(s);c&&(Ve(c,[]),n[s.replace(/^swal-/,"")]=c.innerHTML.trim())}return n},_i=t=>{const e=Jn.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);ye(t.children).forEach(n=>{const o=n.tagName.toLowerCase();e.indexOf(o)===-1&&de(`Unrecognized element <${o}>`)})},Ve=(t,e)=>{ye(t.attributes).forEach(n=>{e.indexOf(n.name)===-1&&de([`Unrecognized attribute "${n.name}" on <${t.tagName.toLowerCase()}>.`,`${e.length?`Allowed attributes are: ${e.join(", ")}`:"To set the value, use HTML within the element."}`])})},Xn={email:(t,e)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address"),url:(t,e)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")};function Ai(t){t.inputValidator||Object.keys(Xn).forEach(e=>{t.input===e&&(t.inputValidator=Xn[e])})}function Ci(t){(!t.target||typeof t.target=="string"&&!document.querySelector(t.target)||typeof t.target!="string"&&!t.target.appendChild)&&(de('Target parameter is not valid, defaulting to "body"'),t.target="body")}function Ei(t){Ai(t),t.showLoaderOnConfirm&&!t.preConfirm&&de(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
|
60
60
|
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
61
61
|
https://sweetalert2.github.io/#ajax-request`),Ci(t),typeof t.title=="string"&&(t.title=t.title.split(`
|
|
62
|
-
`).join("<br />")),Mr(t)}class xi{constructor(e,n){this.callback=e,this.remaining=n,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(e){const n=this.running;return n&&this.stop(),this.remaining+=e,n&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const Si=()=>{Je.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(Je.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Je.previousBodyPadding+Ur()}px`)},Ti=()=>{Je.previousBodyPadding!==null&&(document.body.style.paddingRight=`${Je.previousBodyPadding}px`,Je.previousBodyPadding=null)},Li=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!Be(document.body,u.iosfix)){const e=document.body.scrollTop;document.body.style.top=`${e*-1}px`,V(document.body,u.iosfix),Pi(),Ii()}},Ii=()=>{const t=navigator.userAgent,e=!!t.match(/iPad/i)||!!t.match(/iPhone/i),n=!!t.match(/WebKit/i);e&&n&&!t.match(/CriOS/i)&&j().scrollHeight>window.innerHeight-44&&(ne().style.paddingBottom="44px")},Pi=()=>{const t=ne();let e;t.ontouchstart=n=>{e=Bi(n)},t.ontouchmove=n=>{e&&(n.preventDefault(),n.stopPropagation())}},Bi=t=>{const e=t.target,n=ne();return Ri(t)||Oi(t)?!1:e===n||!Hn(n)&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"&&!(Hn(Tt())&&Tt().contains(e))},Ri=t=>t.touches&&t.touches.length&&t.touches[0].touchType==="stylus",Oi=t=>t.touches&&t.touches.length>1,Fi=()=>{if(Be(document.body,u.iosfix)){const t=parseInt(document.body.style.top,10);Le(document.body,u.iosfix),document.body.style.top="",document.body.scrollTop=t*-1}},Zn=10,Mi=t=>{const e=ne(),n=j();typeof t.willOpen=="function"&&t.willOpen(n);const s=window.getComputedStyle(document.body).overflowY;Ui(e,n,t),setTimeout(()=>{Ni(e,n)},Zn),Xt()&&(Di(e,t.scrollbarPadding,s),pi()),!Pt()&&!M.previousActiveElement&&(M.previousActiveElement=document.activeElement),typeof t.didOpen=="function"&&setTimeout(()=>t.didOpen(n)),Le(e,u["no-transition"])},Qn=t=>{const e=j();if(t.target!==e)return;const n=ne();e.removeEventListener(bt,Qn),n.style.overflowY="auto"},Ni=(t,e)=>{bt&&Vn(e)?(t.style.overflowY="hidden",e.addEventListener(bt,Qn)):t.style.overflowY="auto"},Di=(t,e,n)=>{Li(),e&&n!=="hidden"&&Si(),setTimeout(()=>{t.scrollTop=0})},Ui=(t,e,n)=>{V(t,n.showClass.backdrop),e.style.setProperty("opacity","0","important"),ee(e,"grid"),setTimeout(()=>{V(e,n.showClass.popup),e.style.removeProperty("opacity")},Zn),V([document.documentElement,document.body],u.shown),n.heightAuto&&n.backdrop&&!n.toast&&V([document.documentElement,document.body],u["height-auto"])},Ze=t=>{let e=j();e||new et,e=j();const n=Ye();Pt()?re(pt()):$i(e,t),ee(n),e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},$i=(t,e)=>{const n=mt(),o=Ye();!e&&we(Se())&&(e=Se()),ee(n),e&&(re(e),o.setAttribute("data-button-to-replace",e.className)),o.parentNode.insertBefore(o,e),V([t,n],u.loading)},Hi=(t,e)=>{e.input==="select"||e.input==="radio"?qi(t,e):["text","email","number","tel","textarea"].includes(e.input)&&(qt(e.inputValue)||Kt(e.inputValue))&&(Ze(Se()),Ki(t,e))},Vi=(t,e)=>{const n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return ji(n);case"radio":return zi(n);case"file":return Wi(n);default:return e.inputAutoTrim?n.value.trim():n.value}},ji=t=>t.checked?1:0,zi=t=>t.checked?t.value:null,Wi=t=>t.files.length?t.getAttribute("multiple")!==null?t.files:t.files[0]:null,qi=(t,e)=>{const n=j(),o=s=>Gi[e.input](n,on(s),e);qt(e.inputOptions)||Kt(e.inputOptions)?(Ze(Se()),dt(e.inputOptions).then(s=>{t.hideLoading(),o(s)})):typeof e.inputOptions=="object"?o(e.inputOptions):Ue(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`)},Ki=(t,e)=>{const n=t.getInput();re(n),dt(e.inputValue).then(o=>{n.value=e.input==="number"?parseFloat(o)||0:`${o}`,ee(n),n.focus(),t.hideLoading()}).catch(o=>{Ue(`Error in inputValue promise: ${o}`),n.value="",ee(n),n.focus(),t.hideLoading()})},Gi={select:(t,e,n)=>{const o=Ne(t,u.select),s=(c,A,I)=>{const d=document.createElement("option");d.value=I,oe(d,A),d.selected=eo(I,n.inputValue),c.appendChild(d)};e.forEach(c=>{const A=c[0],I=c[1];if(Array.isArray(I)){const d=document.createElement("optgroup");d.label=A,d.disabled=!1,o.appendChild(d),I.forEach(U=>s(d,U[1],U[0]))}else s(o,I,A)}),o.focus()},radio:(t,e,n)=>{const o=Ne(t,u.radio);e.forEach(c=>{const A=c[0],I=c[1],d=document.createElement("input"),U=document.createElement("label");d.type="radio",d.name=u.radio,d.value=A,eo(A,n.inputValue)&&(d.checked=!0);const W=document.createElement("span");oe(W,I),W.className=u.label,U.appendChild(d),U.appendChild(W),o.appendChild(U)});const s=o.querySelectorAll("input");s.length&&s[0].focus()}},on=t=>{const e=[];return typeof Map<"u"&&t instanceof Map?t.forEach((n,o)=>{let s=n;typeof s=="object"&&(s=on(s)),e.push([o,s])}):Object.keys(t).forEach(n=>{let o=t[n];typeof o=="object"&&(o=on(o)),e.push([n,o])}),e},eo=(t,e)=>e&&e.toString()===t.toString();function to(){const t=D.innerParams.get(this);if(!t)return;const e=D.domCache.get(this);re(e.loader),Pt()?t.icon&&ee(pt()):Yi(e),Le([e.popup,e.actions],u.loading),e.popup.removeAttribute("aria-busy"),e.popup.removeAttribute("data-loading"),e.confirmButton.disabled=!1,e.denyButton.disabled=!1,e.cancelButton.disabled=!1}const Yi=t=>{const e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?ee(e[0],"inline-block"):Er()&&re(t.actions)};function Ji(t){const e=D.innerParams.get(t||this),n=D.domCache.get(t||this);return n?Zt(n.popup,e.input):null}const wt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap},Xi=()=>we(j()),no=()=>Se()&&Se().click(),Zi=()=>Me()&&Me().click(),Qi=()=>$e()&&$e().click(),oo=t=>{t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},es=(t,e,n,o)=>{oo(e),n.toast||(e.keydownHandler=s=>ns(t,s,o),e.keydownTarget=n.keydownListenerCapture?window:j(),e.keydownListenerCapture=n.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},rn=(t,e,n)=>{const o=Jt();if(o.length)return e=e+n,e===o.length?e=0:e===-1&&(e=o.length-1),o[e].focus();j().focus()},ro=["ArrowRight","ArrowDown"],ts=["ArrowLeft","ArrowUp"],ns=(t,e,n)=>{const o=D.innerParams.get(t);o&&(e.isComposing||e.keyCode===229||(o.stopKeydownPropagation&&e.stopPropagation(),e.key==="Enter"?os(t,e,o):e.key==="Tab"?rs(e,o):[...ro,...ts].includes(e.key)?is(e.key):e.key==="Escape"&&ss(e,o,n)))},os=(t,e,n)=>{if(St(n.allowEnterKey)&&e.target&&t.getInput()&&e.target.outerHTML===t.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;no(),e.preventDefault()}},rs=(t,e)=>{const n=t.target,o=Jt();let s=-1;for(let c=0;c<o.length;c++)if(n===o[c]){s=c;break}t.shiftKey?rn(e,s,-1):rn(e,s,1),t.stopPropagation(),t.preventDefault()},is=t=>{const e=Se(),n=Me(),o=$e();if(![e,n,o].includes(document.activeElement))return;const s=ro.includes(t)?"nextElementSibling":"previousElementSibling";let c=document.activeElement;for(let A=0;A<mt().children.length;A++){if(c=c[s],!c)return;if(we(c)&&c instanceof HTMLButtonElement)break}c instanceof HTMLButtonElement&&c.focus()},ss=(t,e,n)=>{St(e.allowEscapeKey)&&(t.preventDefault(),n(Xe.esc))};function io(t,e,n,o){Pt()?so(t,o):(Lr(n).then(()=>so(t,o)),oo(M)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),Xt()&&(Ti(),Fi(),Yn()),as()}function as(){Le([document.documentElement,document.body],[u.shown,u["height-auto"],u["no-backdrop"],u["toast-shown"]])}function Rt(t){t=ds(t);const e=wt.swalPromiseResolve.get(this),n=cs(this);this.isAwaitingPromise()?t.isDismissed||(vt(this),e(t)):n&&e(t)}function ls(){return!!D.awaitingPromise.get(this)}const cs=t=>{const e=j();if(!e)return!1;const n=D.innerParams.get(t);if(!n||Be(e,n.hideClass.popup))return!1;Le(e,n.showClass.popup),V(e,n.hideClass.popup);const o=ne();return Le(o,n.showClass.backdrop),V(o,n.hideClass.backdrop),fs(t,e,n),!0};function us(t){const e=wt.swalPromiseReject.get(this);vt(this),e&&e(t)}const vt=t=>{t.isAwaitingPromise()&&(D.awaitingPromise.delete(t),D.innerParams.get(t)||t._destroy())},ds=t=>typeof t>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t),fs=(t,e,n)=>{const o=ne(),s=bt&&Vn(e);typeof n.willClose=="function"&&n.willClose(e),s?hs(t,e,o,n.returnFocus,n.didClose):io(t,o,n.returnFocus,n.didClose)},hs=(t,e,n,o,s)=>{M.swalCloseEventFinishedCallback=io.bind(null,t,n,o,s),e.addEventListener(bt,function(c){c.target===e&&(M.swalCloseEventFinishedCallback(),delete M.swalCloseEventFinishedCallback)})},so=(t,e)=>{setTimeout(()=>{typeof e=="function"&&e.bind(t.params)(),t._destroy()})};function ao(t,e,n){const o=D.domCache.get(t);e.forEach(s=>{o[s].disabled=n})}function lo(t,e){if(!t)return!1;if(t.type==="radio"){const o=t.parentNode.parentNode.querySelectorAll("input");for(let s=0;s<o.length;s++)o[s].disabled=e}else t.disabled=e}function ps(){ao(this,["confirmButton","denyButton","cancelButton"],!1)}function ms(){ao(this,["confirmButton","denyButton","cancelButton"],!0)}function gs(){return lo(this.getInput(),!1)}function bs(){return lo(this.getInput(),!0)}function ys(t){const e=D.domCache.get(this),n=D.innerParams.get(this);oe(e.validationMessage,t),e.validationMessage.className=u["validation-message"],n.customClass&&n.customClass.validationMessage&&V(e.validationMessage,n.customClass.validationMessage),ee(e.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedby",u["validation-message"]),Dn(o),V(o,u.inputerror))}function ws(){const t=D.domCache.get(this);t.validationMessage&&re(t.validationMessage);const e=this.getInput();e&&(e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedby"),Le(e,u.inputerror))}function vs(){return D.domCache.get(this).progressSteps}function ks(t){const e=j(),n=D.innerParams.get(this);if(!e||Be(e,n.hideClass.popup))return de("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const o=_s(t),s=Object.assign({},n,o);Gn(this,s),D.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,t),writable:!1,enumerable:!0}})}const _s=t=>{const e={};return Object.keys(t).forEach(n=>{Bn(n)?e[n]=t[n]:de(`Invalid parameter to update: "${n}". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
|
|
62
|
+
`).join("<br />")),Mr(t)}class xi{constructor(e,n){this.callback=e,this.remaining=n,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(e){const n=this.running;return n&&this.stop(),this.remaining+=e,n&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const Si=()=>{Je.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(Je.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Je.previousBodyPadding+Ur()}px`)},Ti=()=>{Je.previousBodyPadding!==null&&(document.body.style.paddingRight=`${Je.previousBodyPadding}px`,Je.previousBodyPadding=null)},Li=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!Be(document.body,u.iosfix)){const e=document.body.scrollTop;document.body.style.top=`${e*-1}px`,V(document.body,u.iosfix),Pi(),Ii()}},Ii=()=>{const t=navigator.userAgent,e=!!t.match(/iPad/i)||!!t.match(/iPhone/i),n=!!t.match(/WebKit/i);e&&n&&!t.match(/CriOS/i)&&j().scrollHeight>window.innerHeight-44&&(ne().style.paddingBottom="44px")},Pi=()=>{const t=ne();let e;t.ontouchstart=n=>{e=Bi(n)},t.ontouchmove=n=>{e&&(n.preventDefault(),n.stopPropagation())}},Bi=t=>{const e=t.target,n=ne();return Ri(t)||Oi(t)?!1:e===n||!Hn(n)&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"&&!(Hn(Tt())&&Tt().contains(e))},Ri=t=>t.touches&&t.touches.length&&t.touches[0].touchType==="stylus",Oi=t=>t.touches&&t.touches.length>1,Fi=()=>{if(Be(document.body,u.iosfix)){const t=parseInt(document.body.style.top,10);Le(document.body,u.iosfix),document.body.style.top="",document.body.scrollTop=t*-1}},Zn=10,Mi=t=>{const e=ne(),n=j();typeof t.willOpen=="function"&&t.willOpen(n);const s=window.getComputedStyle(document.body).overflowY;Ui(e,n,t),setTimeout(()=>{Ni(e,n)},Zn),Xt()&&(Di(e,t.scrollbarPadding,s),pi()),!Pt()&&!M.previousActiveElement&&(M.previousActiveElement=document.activeElement),typeof t.didOpen=="function"&&setTimeout(()=>t.didOpen(n)),Le(e,u["no-transition"])},Qn=t=>{const e=j();if(t.target!==e)return;const n=ne();e.removeEventListener(bt,Qn),n.style.overflowY="auto"},Ni=(t,e)=>{bt&&Vn(e)?(t.style.overflowY="hidden",e.addEventListener(bt,Qn)):t.style.overflowY="auto"},Di=(t,e,n)=>{Li(),e&&n!=="hidden"&&Si(),setTimeout(()=>{t.scrollTop=0})},Ui=(t,e,n)=>{V(t,n.showClass.backdrop),e.style.setProperty("opacity","0","important"),ee(e,"grid"),setTimeout(()=>{V(e,n.showClass.popup),e.style.removeProperty("opacity")},Zn),V([document.documentElement,document.body],u.shown),n.heightAuto&&n.backdrop&&!n.toast&&V([document.documentElement,document.body],u["height-auto"])},Ze=t=>{let e=j();e||new et,e=j();const n=Ye();Pt()?re(pt()):$i(e,t),ee(n),e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},$i=(t,e)=>{const n=mt(),o=Ye();!e&&we(Se())&&(e=Se()),ee(n),e&&(re(e),o.setAttribute("data-button-to-replace",e.className)),o.parentNode.insertBefore(o,e),V([t,n],u.loading)},Hi=(t,e)=>{e.input==="select"||e.input==="radio"?qi(t,e):["text","email","number","tel","textarea"].includes(e.input)&&(qt(e.inputValue)||Kt(e.inputValue))&&(Ze(Se()),Ki(t,e))},Vi=(t,e)=>{const n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return ji(n);case"radio":return zi(n);case"file":return Wi(n);default:return e.inputAutoTrim?n.value.trim():n.value}},ji=t=>t.checked?1:0,zi=t=>t.checked?t.value:null,Wi=t=>t.files.length?t.getAttribute("multiple")!==null?t.files:t.files[0]:null,qi=(t,e)=>{const n=j(),o=s=>Gi[e.input](n,on(s),e);qt(e.inputOptions)||Kt(e.inputOptions)?(Ze(Se()),dt(e.inputOptions).then(s=>{t.hideLoading(),o(s)})):typeof e.inputOptions=="object"?o(e.inputOptions):Ue(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`)},Ki=(t,e)=>{const n=t.getInput();re(n),dt(e.inputValue).then(o=>{n.value=e.input==="number"?parseFloat(o)||0:`${o}`,ee(n),n.focus(),t.hideLoading()}).catch(o=>{Ue(`Error in inputValue promise: ${o}`),n.value="",ee(n),n.focus(),t.hideLoading()})},Gi={select:(t,e,n)=>{const o=Ne(t,u.select),s=(c,k,I)=>{const d=document.createElement("option");d.value=I,oe(d,k),d.selected=eo(I,n.inputValue),c.appendChild(d)};e.forEach(c=>{const k=c[0],I=c[1];if(Array.isArray(I)){const d=document.createElement("optgroup");d.label=k,d.disabled=!1,o.appendChild(d),I.forEach(U=>s(d,U[1],U[0]))}else s(o,I,k)}),o.focus()},radio:(t,e,n)=>{const o=Ne(t,u.radio);e.forEach(c=>{const k=c[0],I=c[1],d=document.createElement("input"),U=document.createElement("label");d.type="radio",d.name=u.radio,d.value=k,eo(k,n.inputValue)&&(d.checked=!0);const W=document.createElement("span");oe(W,I),W.className=u.label,U.appendChild(d),U.appendChild(W),o.appendChild(U)});const s=o.querySelectorAll("input");s.length&&s[0].focus()}},on=t=>{const e=[];return typeof Map<"u"&&t instanceof Map?t.forEach((n,o)=>{let s=n;typeof s=="object"&&(s=on(s)),e.push([o,s])}):Object.keys(t).forEach(n=>{let o=t[n];typeof o=="object"&&(o=on(o)),e.push([n,o])}),e},eo=(t,e)=>e&&e.toString()===t.toString();function to(){const t=D.innerParams.get(this);if(!t)return;const e=D.domCache.get(this);re(e.loader),Pt()?t.icon&&ee(pt()):Yi(e),Le([e.popup,e.actions],u.loading),e.popup.removeAttribute("aria-busy"),e.popup.removeAttribute("data-loading"),e.confirmButton.disabled=!1,e.denyButton.disabled=!1,e.cancelButton.disabled=!1}const Yi=t=>{const e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?ee(e[0],"inline-block"):Er()&&re(t.actions)};function Ji(t){const e=D.innerParams.get(t||this),n=D.domCache.get(t||this);return n?Zt(n.popup,e.input):null}const wt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap},Xi=()=>we(j()),no=()=>Se()&&Se().click(),Zi=()=>Me()&&Me().click(),Qi=()=>$e()&&$e().click(),oo=t=>{t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},es=(t,e,n,o)=>{oo(e),n.toast||(e.keydownHandler=s=>ns(t,s,o),e.keydownTarget=n.keydownListenerCapture?window:j(),e.keydownListenerCapture=n.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},rn=(t,e,n)=>{const o=Jt();if(o.length)return e=e+n,e===o.length?e=0:e===-1&&(e=o.length-1),o[e].focus();j().focus()},ro=["ArrowRight","ArrowDown"],ts=["ArrowLeft","ArrowUp"],ns=(t,e,n)=>{const o=D.innerParams.get(t);o&&(e.isComposing||e.keyCode===229||(o.stopKeydownPropagation&&e.stopPropagation(),e.key==="Enter"?os(t,e,o):e.key==="Tab"?rs(e,o):[...ro,...ts].includes(e.key)?is(e.key):e.key==="Escape"&&ss(e,o,n)))},os=(t,e,n)=>{if(St(n.allowEnterKey)&&e.target&&t.getInput()&&e.target.outerHTML===t.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;no(),e.preventDefault()}},rs=(t,e)=>{const n=t.target,o=Jt();let s=-1;for(let c=0;c<o.length;c++)if(n===o[c]){s=c;break}t.shiftKey?rn(e,s,-1):rn(e,s,1),t.stopPropagation(),t.preventDefault()},is=t=>{const e=Se(),n=Me(),o=$e();if(![e,n,o].includes(document.activeElement))return;const s=ro.includes(t)?"nextElementSibling":"previousElementSibling";let c=document.activeElement;for(let k=0;k<mt().children.length;k++){if(c=c[s],!c)return;if(we(c)&&c instanceof HTMLButtonElement)break}c instanceof HTMLButtonElement&&c.focus()},ss=(t,e,n)=>{St(e.allowEscapeKey)&&(t.preventDefault(),n(Xe.esc))};function io(t,e,n,o){Pt()?so(t,o):(Lr(n).then(()=>so(t,o)),oo(M)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),Xt()&&(Ti(),Fi(),Yn()),as()}function as(){Le([document.documentElement,document.body],[u.shown,u["height-auto"],u["no-backdrop"],u["toast-shown"]])}function Rt(t){t=ds(t);const e=wt.swalPromiseResolve.get(this),n=cs(this);this.isAwaitingPromise()?t.isDismissed||(vt(this),e(t)):n&&e(t)}function ls(){return!!D.awaitingPromise.get(this)}const cs=t=>{const e=j();if(!e)return!1;const n=D.innerParams.get(t);if(!n||Be(e,n.hideClass.popup))return!1;Le(e,n.showClass.popup),V(e,n.hideClass.popup);const o=ne();return Le(o,n.showClass.backdrop),V(o,n.hideClass.backdrop),fs(t,e,n),!0};function us(t){const e=wt.swalPromiseReject.get(this);vt(this),e&&e(t)}const vt=t=>{t.isAwaitingPromise()&&(D.awaitingPromise.delete(t),D.innerParams.get(t)||t._destroy())},ds=t=>typeof t>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t),fs=(t,e,n)=>{const o=ne(),s=bt&&Vn(e);typeof n.willClose=="function"&&n.willClose(e),s?hs(t,e,o,n.returnFocus,n.didClose):io(t,o,n.returnFocus,n.didClose)},hs=(t,e,n,o,s)=>{M.swalCloseEventFinishedCallback=io.bind(null,t,n,o,s),e.addEventListener(bt,function(c){c.target===e&&(M.swalCloseEventFinishedCallback(),delete M.swalCloseEventFinishedCallback)})},so=(t,e)=>{setTimeout(()=>{typeof e=="function"&&e.bind(t.params)(),t._destroy()})};function ao(t,e,n){const o=D.domCache.get(t);e.forEach(s=>{o[s].disabled=n})}function lo(t,e){if(!t)return!1;if(t.type==="radio"){const o=t.parentNode.parentNode.querySelectorAll("input");for(let s=0;s<o.length;s++)o[s].disabled=e}else t.disabled=e}function ps(){ao(this,["confirmButton","denyButton","cancelButton"],!1)}function ms(){ao(this,["confirmButton","denyButton","cancelButton"],!0)}function gs(){return lo(this.getInput(),!1)}function bs(){return lo(this.getInput(),!0)}function ys(t){const e=D.domCache.get(this),n=D.innerParams.get(this);oe(e.validationMessage,t),e.validationMessage.className=u["validation-message"],n.customClass&&n.customClass.validationMessage&&V(e.validationMessage,n.customClass.validationMessage),ee(e.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedby",u["validation-message"]),Dn(o),V(o,u.inputerror))}function ws(){const t=D.domCache.get(this);t.validationMessage&&re(t.validationMessage);const e=this.getInput();e&&(e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedby"),Le(e,u.inputerror))}function vs(){return D.domCache.get(this).progressSteps}function ks(t){const e=j(),n=D.innerParams.get(this);if(!e||Be(e,n.hideClass.popup))return de("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const o=_s(t),s=Object.assign({},n,o);Gn(this,s),D.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,t),writable:!1,enumerable:!0}})}const _s=t=>{const e={};return Object.keys(t).forEach(n=>{Bn(n)?e[n]=t[n]:de(`Invalid parameter to update: "${n}". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
|
|
63
63
|
|
|
64
|
-
If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`)}),e};function As(){const t=D.domCache.get(this),e=D.innerParams.get(this);if(!e){co(this);return}t.popup&&M.swalCloseEventFinishedCallback&&(M.swalCloseEventFinishedCallback(),delete M.swalCloseEventFinishedCallback),M.deferDisposalTimer&&(clearTimeout(M.deferDisposalTimer),delete M.deferDisposalTimer),typeof e.didDestroy=="function"&&e.didDestroy(),Cs(this)}const Cs=t=>{co(t),delete t.params,delete M.keydownHandler,delete M.keydownTarget,delete M.currentInstance},co=t=>{t.isAwaitingPromise()?(sn(D,t),D.awaitingPromise.set(t,!0)):(sn(wt,t),sn(D,t))},sn=(t,e)=>{for(const n in t)t[n].delete(e)},uo=Object.freeze(Object.defineProperty({__proto__:null,_destroy:As,close:Rt,closeModal:Rt,closePopup:Rt,closeToast:Rt,disableButtons:ms,disableInput:bs,disableLoading:to,enableButtons:ps,enableInput:gs,getInput:Ji,getProgressSteps:vs,handleAwaitingPromise:vt,hideLoading:to,isAwaitingPromise:ls,rejectPromise:us,resetValidationMessage:ws,showValidationMessage:ys,update:ks},Symbol.toStringTag,{value:"Module"})),Es=t=>{const e=D.innerParams.get(t);t.disableButtons(),e.input?fo(t,"confirm"):ln(t,!0)},xs=t=>{const e=D.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?fo(t,"deny"):an(t,!1)},Ss=(t,e)=>{t.disableButtons(),e(Xe.cancel)},fo=(t,e)=>{const n=D.innerParams.get(t);if(!n.input)return Ue(`The "input" parameter is needed to be set when using returnInputValueOn${Wt(e)}`);const o=Vi(t,n);n.inputValidator?Ts(t,o,e):t.getInput().checkValidity()?e==="deny"?an(t,o):ln(t,o):(t.enableButtons(),t.showValidationMessage(n.validationMessage))},Ts=(t,e,n)=>{const o=D.innerParams.get(t);t.disableInput(),Promise.resolve().then(()=>dt(o.inputValidator(e,o.validationMessage))).then(c=>{t.enableButtons(),t.enableInput(),c?t.showValidationMessage(c):n==="deny"?an(t,e):ln(t,e)})},an=(t,e)=>{const n=D.innerParams.get(t||globalThis);n.showLoaderOnDeny&&Ze(Me()),n.preDeny?(D.awaitingPromise.set(t||globalThis,!0),Promise.resolve().then(()=>dt(n.preDeny(e,n.validationMessage))).then(s=>{s===!1?(t.hideLoading(),vt(t)):t.closePopup({isDenied:!0,value:typeof s>"u"?e:s})}).catch(s=>po(t||globalThis,s))):t.closePopup({isDenied:!0,value:e})},ho=(t,e)=>{t.closePopup({isConfirmed:!0,value:e})},po=(t,e)=>{t.rejectPromise(e)},ln=(t,e)=>{const n=D.innerParams.get(t||globalThis);n.showLoaderOnConfirm&&Ze(),n.preConfirm?(t.resetValidationMessage(),D.awaitingPromise.set(t||globalThis,!0),Promise.resolve().then(()=>dt(n.preConfirm(e,n.validationMessage))).then(s=>{we(Lt())||s===!1?(t.hideLoading(),vt(t)):ho(t,typeof s>"u"?e:s)}).catch(s=>po(t||globalThis,s))):ho(t,e)},Ls=(t,e,n)=>{D.innerParams.get(t).toast?Is(t,e,n):(Bs(e),Rs(e),Os(t,e,n))},Is=(t,e,n)=>{e.popup.onclick=()=>{const o=D.innerParams.get(t);o&&(Ps(o)||o.timer||o.input)||n(Xe.close)}},Ps=t=>t.showConfirmButton||t.showDenyButton||t.showCancelButton||t.showCloseButton;let Ot=!1;const Bs=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(Ot=!0)}}},Rs=t=>{t.container.onmousedown=()=>{t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,(e.target===t.popup||t.popup.contains(e.target))&&(Ot=!0)}}},Os=(t,e,n)=>{e.container.onclick=o=>{const s=D.innerParams.get(t);if(Ot){Ot=!1;return}o.target===e.container&&St(s.allowOutsideClick)&&n(Xe.backdrop)}},Fs=t=>typeof t=="object"&&t.jquery,mo=t=>t instanceof Element||Fs(t),Ms=t=>{const e={};return typeof t[0]=="object"&&!mo(t[0])?Object.assign(e,t[0]):["title","html","icon"].forEach((n,o)=>{const s=t[o];typeof s=="string"||mo(s)?e[n]=s:s!==void 0&&Ue(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof s}`)}),e};function Ns(...t){const e=this;return new e(...t)}function Ds(t){class e extends this{_main(o,s){return super._main(o,Object.assign({},t,s))}}return e}const Us=()=>M.timeout&&M.timeout.getTimerLeft(),go=()=>{if(M.timeout)return xr(),M.timeout.stop()},bo=()=>{if(M.timeout){const t=M.timeout.start();return Qt(t),t}},$s=()=>{const t=M.timeout;return t&&(t.running?go():bo())},Hs=t=>{if(M.timeout){const e=M.timeout.increase(t);return Qt(e,!0),e}},Vs=()=>M.timeout&&M.timeout.isRunning();let yo=!1;const cn={};function js(t="data-swal-template"){cn[t]=this,yo||(document.body.addEventListener("click",zs),yo=!0)}const zs=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const n in cn){const o=e.getAttribute(n);if(o){cn[n].fire({template:o});return}}},Ws=Object.freeze(Object.defineProperty({__proto__:null,argsToParams:Ms,bindClickHandler:js,clickCancel:Qi,clickConfirm:no,clickDeny:Zi,enableLoading:Ze,fire:Ns,getActions:mt,getCancelButton:$e,getCloseButton:Yt,getConfirmButton:Se,getContainer:ne,getDenyButton:Me,getFocusableElements:Jt,getFooter:Nn,getHtmlContainer:Tt,getIcon:pt,getImage:Fn,getInputLabel:kr,getLoader:Ye,getPopup:j,getTimerLeft:Us,getTimerProgressBar:It,getTitle:On,getValidationMessage:Lt,increaseTimer:Hs,isDeprecatedParameter:Gt,isLoading:Ar,isTimerRunning:Vs,isUpdatableParameter:Bn,isValidParameter:Pn,isVisible:Xi,mixin:Ds,resumeTimer:bo,showLoading:Ze,stopTimer:go,toggleTimer:$s},Symbol.toStringTag,{value:"Module"}));let un;class Qe{constructor(...e){if(typeof window>"u")return;un=this;const n=Object.freeze(this.constructor.argsToParams(e));Object.defineProperties(this,{params:{value:n,writable:!1,enumerable:!0,configurable:!0}});const o=this._main(this.params);D.promise.set(this,o)}_main(e,n={}){wr(Object.assign({},n,e)),M.currentInstance&&(M.currentInstance._destroy(),Xt()&&Yn()),M.currentInstance=this;const o=Ks(e,n);Ei(o),Object.freeze(o),M.timeout&&(M.timeout.stop(),delete M.timeout),clearTimeout(M.restoreFocusTimeout);const s=Gs(this);return Gn(this,o),D.innerParams.set(this,o),qs(this,s,o)}then(e){return D.promise.get(this).then(e)}finally(e){return D.promise.get(this).finally(e)}}const qs=(t,e,n)=>new Promise((o,s)=>{const c=A=>{t.closePopup({isDismissed:!0,dismiss:A})};wt.swalPromiseResolve.set(t,o),wt.swalPromiseReject.set(t,s),e.confirmButton.onclick=()=>Es(t),e.denyButton.onclick=()=>xs(t),e.cancelButton.onclick=()=>Ss(t,c),e.closeButton.onclick=()=>c(Xe.close),Ls(t,e,c),es(t,M,n,c),Hi(t,n),Mi(n),Ys(M,n,c),Js(e,n),setTimeout(()=>{e.container.scrollTop=0})}),Ks=(t,e)=>{const n=mi(t),o=Object.assign({},Ge,e,n,t);return o.showClass=Object.assign({},Ge.showClass,o.showClass),o.hideClass=Object.assign({},Ge.hideClass,o.hideClass),o},Gs=t=>{const e={popup:j(),container:ne(),actions:mt(),confirmButton:Se(),denyButton:Me(),cancelButton:$e(),loader:Ye(),closeButton:Yt(),validationMessage:Lt(),progressSteps:Mn()};return D.domCache.set(t,e),e},Ys=(t,e,n)=>{const o=It();re(o),e.timer&&(t.timeout=new xi(()=>{n("timer"),delete t.timeout},e.timer),e.timerProgressBar&&(ee(o),Ce(o,e,"timerProgressBar"),setTimeout(()=>{t.timeout&&t.timeout.running&&Qt(e.timer)})))},Js=(t,e)=>{if(!e.toast){if(!St(e.allowEnterKey))return Zs();Xs(t,e)||rn(e,-1,1)}},Xs=(t,e)=>e.focusDeny&&we(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&we(t.cancelButton)?(t.cancelButton.focus(),!0):e.focusConfirm&&we(t.confirmButton)?(t.confirmButton.focus(),!0):!1,Zs=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(Qe.prototype,uo),Object.assign(Qe,Ws),Object.keys(uo).forEach(t=>{Qe[t]=function(...e){if(un)return un[t](...e)}}),Qe.DismissReason=Xe,Qe.version="11.4.8";const et=Qe;et.default=et;/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:wo,setPrototypeOf:vo,isFrozen:Qs,getPrototypeOf:ea,getOwnPropertyDescriptor:ko}=Object;let{freeze:ae,seal:Te,create:_o}=Object,{apply:dn,construct:fn}=typeof Reflect<"u"&&Reflect;ae||(ae=function(e){return e}),Te||(Te=function(e){return e}),dn||(dn=function(e,n,o){return e.apply(n,o)}),fn||(fn=function(e,n){return new e(...n)});const Ft=Ee(Array.prototype.forEach),Ao=Ee(Array.prototype.pop),kt=Ee(Array.prototype.push),Mt=Ee(String.prototype.toLowerCase),hn=Ee(String.prototype.toString),ta=Ee(String.prototype.match),_t=Ee(String.prototype.replace),na=Ee(String.prototype.indexOf),oa=Ee(String.prototype.trim),ve=Ee(RegExp.prototype.test),At=ra(TypeError);function Ee(t){return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];return dn(t,e,o)}}function ra(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return fn(t,n)}}function N(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Mt;vo&&vo(t,null);let o=e.length;for(;o--;){let s=e[o];if(typeof s=="string"){const c=n(s);c!==s&&(Qs(e)||(e[o]=c),s=c)}t[s]=!0}return t}function tt(t){const e=_o(null);for(const[n,o]of wo(t))ko(t,n)!==void 0&&(e[n]=o);return e}function Nt(t,e){for(;t!==null;){const o=ko(t,e);if(o){if(o.get)return Ee(o.get);if(typeof o.value=="function")return Ee(o.value)}t=ea(t)}function n(o){return console.warn("fallback value for",o),null}return n}const Co=ae(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),pn=ae(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),mn=ae(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ia=ae(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),gn=ae(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),sa=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Eo=ae(["#text"]),xo=ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),bn=ae(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),So=ae(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Dt=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),aa=Te(/\{\{[\w\W]*|[\w\W]*\}\}/gm),la=Te(/<%[\w\W]*|[\w\W]*%>/gm),ca=Te(/\${[\w\W]*}/gm),ua=Te(/^data-[\-\w.\u00B7-\uFFFF]/),da=Te(/^aria-[\-\w]+$/),To=Te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fa=Te(/^(?:\w+script|data):/i),ha=Te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Lo=Te(/^html$/i);var Io=Object.freeze({__proto__:null,MUSTACHE_EXPR:aa,ERB_EXPR:la,TMPLIT_EXPR:ca,DATA_ATTR:ua,ARIA_ATTR:da,IS_ALLOWED_URI:To,IS_SCRIPT_OR_DATA:fa,ATTR_WHITESPACE:ha,DOCTYPE_NAME:Lo});const pa=function(){return typeof window>"u"?null:window},ma=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(o=n.getAttribute(s));const c="dompurify"+(o?"#"+o:"");try{return e.createPolicy(c,{createHTML(A){return A},createScriptURL(A){return A}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}};function Po(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pa();const e=L=>Po(L);if(e.version="3.0.6",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;let{document:n}=t;const o=n,s=o.currentScript,{DocumentFragment:c,HTMLTemplateElement:A,Node:I,Element:d,NodeFilter:U,NamedNodeMap:W=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:J,DOMParser:le,trustedTypes:z}=t,Re=d.prototype,ot=Nt(Re,"cloneNode"),ke=Nt(Re,"nextSibling"),rt=Nt(Re,"childNodes"),he=Nt(Re,"parentNode");if(typeof A=="function"){const L=n.createElement("template");L.content&&L.content.ownerDocument&&(n=L.content.ownerDocument)}let $,_e="";const{implementation:Z,createNodeIterator:h,createDocumentFragment:_,getElementsByTagName:P}=n,{importNode:C}=o;let k={};e.isSupported=typeof wo=="function"&&typeof he=="function"&&Z&&Z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:v,ERB_EXPR:O,TMPLIT_EXPR:m,DATA_ATTR:F,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:Y}=Io;let{IS_ALLOWED_URI:ce}=Io,B=null;const pe=N({},[...Co,...pn,...mn,...gn,...Eo]);let r=null;const a=N({},[...xo,...bn,...So,...Dt]);let f=Object.seal(_o(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),b=null,p=null,E=!0,g=!0,y=!1,S=!0,x=!1,R=!1,H=!1,me=!1,ue=!1,te=!1,Pe=!1,Do=!0,Uo=!1;const ml="user-content-";let kn=!0,Et=!1,it={},st=null;const $o=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ho=null;const Vo=N({},["audio","video","img","source","image","track"]);let _n=null;const jo=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$t="http://www.w3.org/1998/Math/MathML",Ht="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml";let at=Oe,An=!1,Cn=null;const gl=N({},[$t,Ht,Oe],hn);let je=null;const bl=["application/xhtml+xml","text/html"],yl="text/html";let Q=null,lt=null;const wl=n.createElement("form"),zo=function(i){return i instanceof RegExp||i instanceof Function},En=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(lt&<===i)){if((!i||typeof i!="object")&&(i={}),i=tt(i),je=bl.indexOf(i.PARSER_MEDIA_TYPE)===-1?je=yl:je=i.PARSER_MEDIA_TYPE,Q=je==="application/xhtml+xml"?hn:Mt,B="ALLOWED_TAGS"in i?N({},i.ALLOWED_TAGS,Q):pe,r="ALLOWED_ATTR"in i?N({},i.ALLOWED_ATTR,Q):a,Cn="ALLOWED_NAMESPACES"in i?N({},i.ALLOWED_NAMESPACES,hn):gl,_n="ADD_URI_SAFE_ATTR"in i?N(tt(jo),i.ADD_URI_SAFE_ATTR,Q):jo,Ho="ADD_DATA_URI_TAGS"in i?N(tt(Vo),i.ADD_DATA_URI_TAGS,Q):Vo,st="FORBID_CONTENTS"in i?N({},i.FORBID_CONTENTS,Q):$o,b="FORBID_TAGS"in i?N({},i.FORBID_TAGS,Q):{},p="FORBID_ATTR"in i?N({},i.FORBID_ATTR,Q):{},it="USE_PROFILES"in i?i.USE_PROFILES:!1,E=i.ALLOW_ARIA_ATTR!==!1,g=i.ALLOW_DATA_ATTR!==!1,y=i.ALLOW_UNKNOWN_PROTOCOLS||!1,S=i.ALLOW_SELF_CLOSE_IN_ATTR!==!1,x=i.SAFE_FOR_TEMPLATES||!1,R=i.WHOLE_DOCUMENT||!1,ue=i.RETURN_DOM||!1,te=i.RETURN_DOM_FRAGMENT||!1,Pe=i.RETURN_TRUSTED_TYPE||!1,me=i.FORCE_BODY||!1,Do=i.SANITIZE_DOM!==!1,Uo=i.SANITIZE_NAMED_PROPS||!1,kn=i.KEEP_CONTENT!==!1,Et=i.IN_PLACE||!1,ce=i.ALLOWED_URI_REGEXP||To,at=i.NAMESPACE||Oe,f=i.CUSTOM_ELEMENT_HANDLING||{},i.CUSTOM_ELEMENT_HANDLING&&zo(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=i.CUSTOM_ELEMENT_HANDLING.tagNameCheck),i.CUSTOM_ELEMENT_HANDLING&&zo(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),i.CUSTOM_ELEMENT_HANDLING&&typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),x&&(g=!1),te&&(ue=!0),it&&(B=N({},[...Eo]),r=[],it.html===!0&&(N(B,Co),N(r,xo)),it.svg===!0&&(N(B,pn),N(r,bn),N(r,Dt)),it.svgFilters===!0&&(N(B,mn),N(r,bn),N(r,Dt)),it.mathMl===!0&&(N(B,gn),N(r,So),N(r,Dt))),i.ADD_TAGS&&(B===pe&&(B=tt(B)),N(B,i.ADD_TAGS,Q)),i.ADD_ATTR&&(r===a&&(r=tt(r)),N(r,i.ADD_ATTR,Q)),i.ADD_URI_SAFE_ATTR&&N(_n,i.ADD_URI_SAFE_ATTR,Q),i.FORBID_CONTENTS&&(st===$o&&(st=tt(st)),N(st,i.FORBID_CONTENTS,Q)),kn&&(B["#text"]=!0),R&&N(B,["html","head","body"]),B.table&&(N(B,["tbody"]),delete b.tbody),i.TRUSTED_TYPES_POLICY){if(typeof i.TRUSTED_TYPES_POLICY.createHTML!="function")throw At('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof i.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw At('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');$=i.TRUSTED_TYPES_POLICY,_e=$.createHTML("")}else $===void 0&&($=ma(z,s)),$!==null&&typeof _e=="string"&&(_e=$.createHTML(""));ae&&ae(i),lt=i}},Wo=N({},["mi","mo","mn","ms","mtext"]),qo=N({},["foreignobject","desc","title","annotation-xml"]),vl=N({},["title","style","font","a","script"]),Vt=N({},pn);N(Vt,mn),N(Vt,ia);const xn=N({},gn);N(xn,sa);const kl=function(i){let w=he(i);(!w||!w.tagName)&&(w={namespaceURI:at,tagName:"template"});const T=Mt(i.tagName),K=Mt(w.tagName);return Cn[i.namespaceURI]?i.namespaceURI===Ht?w.namespaceURI===Oe?T==="svg":w.namespaceURI===$t?T==="svg"&&(K==="annotation-xml"||Wo[K]):!!Vt[T]:i.namespaceURI===$t?w.namespaceURI===Oe?T==="math":w.namespaceURI===Ht?T==="math"&&qo[K]:!!xn[T]:i.namespaceURI===Oe?w.namespaceURI===Ht&&!qo[K]||w.namespaceURI===$t&&!Wo[K]?!1:!xn[T]&&(vl[T]||!Vt[T]):!!(je==="application/xhtml+xml"&&Cn[i.namespaceURI]):!1},ze=function(i){kt(e.removed,{element:i});try{i.parentNode.removeChild(i)}catch{i.remove()}},Sn=function(i,w){try{kt(e.removed,{attribute:w.getAttributeNode(i),from:w})}catch{kt(e.removed,{attribute:null,from:w})}if(w.removeAttribute(i),i==="is"&&!r[i])if(ue||te)try{ze(w)}catch{}else try{w.setAttribute(i,"")}catch{}},Ko=function(i){let w=null,T=null;if(me)i="<remove></remove>"+i;else{const se=ta(i,/^[\r\n\t ]+/);T=se&&se[0]}je==="application/xhtml+xml"&&at===Oe&&(i='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+i+"</body></html>");const K=$?$.createHTML(i):i;if(at===Oe)try{w=new le().parseFromString(K,je)}catch{}if(!w||!w.documentElement){w=Z.createDocument(at,"template",null);try{w.documentElement.innerHTML=An?_e:K}catch{}}const ie=w.body||w.documentElement;return i&&T&&ie.insertBefore(n.createTextNode(T),ie.childNodes[0]||null),at===Oe?P.call(w,R?"html":"body")[0]:R?w.documentElement:ie},Go=function(i){return h.call(i.ownerDocument||i,i,U.SHOW_ELEMENT|U.SHOW_COMMENT|U.SHOW_TEXT,null)},_l=function(i){return i instanceof J&&(typeof i.nodeName!="string"||typeof i.textContent!="string"||typeof i.removeChild!="function"||!(i.attributes instanceof W)||typeof i.removeAttribute!="function"||typeof i.setAttribute!="function"||typeof i.namespaceURI!="string"||typeof i.insertBefore!="function"||typeof i.hasChildNodes!="function")},Yo=function(i){return typeof I=="function"&&i instanceof I},Fe=function(i,w,T){k[i]&&Ft(k[i],K=>{K.call(e,w,T,lt)})},Jo=function(i){let w=null;if(Fe("beforeSanitizeElements",i,null),_l(i))return ze(i),!0;const T=Q(i.nodeName);if(Fe("uponSanitizeElement",i,{tagName:T,allowedTags:B}),i.hasChildNodes()&&!Yo(i.firstElementChild)&&ve(/<[/\w]/g,i.innerHTML)&&ve(/<[/\w]/g,i.textContent))return ze(i),!0;if(!B[T]||b[T]){if(!b[T]&&Zo(T)&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,T)||f.tagNameCheck instanceof Function&&f.tagNameCheck(T)))return!1;if(kn&&!st[T]){const K=he(i)||i.parentNode,ie=rt(i)||i.childNodes;if(ie&&K){const se=ie.length;for(let ge=se-1;ge>=0;--ge)K.insertBefore(ot(ie[ge],!0),ke(i))}}return ze(i),!0}return i instanceof d&&!kl(i)||(T==="noscript"||T==="noembed"||T==="noframes")&&ve(/<\/no(script|embed|frames)/i,i.innerHTML)?(ze(i),!0):(x&&i.nodeType===3&&(w=i.textContent,Ft([v,O,m],K=>{w=_t(w,K," ")}),i.textContent!==w&&(kt(e.removed,{element:i.cloneNode()}),i.textContent=w)),Fe("afterSanitizeElements",i,null),!1)},Xo=function(i,w,T){if(Do&&(w==="id"||w==="name")&&(T in n||T in wl))return!1;if(!(g&&!p[w]&&ve(F,w))){if(!(E&&ve(q,w))){if(!r[w]||p[w]){if(!(Zo(i)&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,i)||f.tagNameCheck instanceof Function&&f.tagNameCheck(i))&&(f.attributeNameCheck instanceof RegExp&&ve(f.attributeNameCheck,w)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(w))||w==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,T)||f.tagNameCheck instanceof Function&&f.tagNameCheck(T))))return!1}else if(!_n[w]){if(!ve(ce,_t(T,Y,""))){if(!((w==="src"||w==="xlink:href"||w==="href")&&i!=="script"&&na(T,"data:")===0&&Ho[i])){if(!(y&&!ve(X,_t(T,Y,"")))){if(T)return!1}}}}}}return!0},Zo=function(i){return i.indexOf("-")>0},Qo=function(i){Fe("beforeSanitizeAttributes",i,null);const{attributes:w}=i;if(!w)return;const T={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:r};let K=w.length;for(;K--;){const ie=w[K],{name:se,namespaceURI:ge,value:We}=ie,xt=Q(se);let be=se==="value"?We:oa(We);if(T.attrName=xt,T.attrValue=be,T.keepAttr=!0,T.forceKeepAttr=void 0,Fe("uponSanitizeAttribute",i,T),be=T.attrValue,T.forceKeepAttr||(Sn(se,i),!T.keepAttr))continue;if(!S&&ve(/\/>/i,be)){Sn(se,i);continue}x&&Ft([v,O,m],tr=>{be=_t(be,tr," ")});const er=Q(i.nodeName);if(Xo(er,xt,be)){if(Uo&&(xt==="id"||xt==="name")&&(Sn(se,i),be=ml+be),$&&typeof z=="object"&&typeof z.getAttributeType=="function"&&!ge)switch(z.getAttributeType(er,xt)){case"TrustedHTML":{be=$.createHTML(be);break}case"TrustedScriptURL":{be=$.createScriptURL(be);break}}try{ge?i.setAttributeNS(ge,se,be):i.setAttribute(se,be),Ao(e.removed)}catch{}}}Fe("afterSanitizeAttributes",i,null)},Al=function L(i){let w=null;const T=Go(i);for(Fe("beforeSanitizeShadowDOM",i,null);w=T.nextNode();)Fe("uponSanitizeShadowNode",w,null),!Jo(w)&&(w.content instanceof c&&L(w.content),Qo(w));Fe("afterSanitizeShadowDOM",i,null)};return e.sanitize=function(L){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=null,T=null,K=null,ie=null;if(An=!L,An&&(L="<!-->"),typeof L!="string"&&!Yo(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw At("dirty is not a string, aborting")}else throw At("toString is not a function");if(!e.isSupported)return L;if(H||En(i),e.removed=[],typeof L=="string"&&(Et=!1),Et){if(L.nodeName){const We=Q(L.nodeName);if(!B[We]||b[We])throw At("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof I)w=Ko("<!---->"),T=w.ownerDocument.importNode(L,!0),T.nodeType===1&&T.nodeName==="BODY"||T.nodeName==="HTML"?w=T:w.appendChild(T);else{if(!ue&&!x&&!R&&L.indexOf("<")===-1)return $&&Pe?$.createHTML(L):L;if(w=Ko(L),!w)return ue?null:Pe?_e:""}w&&me&&ze(w.firstChild);const se=Go(Et?L:w);for(;K=se.nextNode();)Jo(K)||(K.content instanceof c&&Al(K.content),Qo(K));if(Et)return L;if(ue){if(te)for(ie=_.call(w.ownerDocument);w.firstChild;)ie.appendChild(w.firstChild);else ie=w;return(r.shadowroot||r.shadowrootmode)&&(ie=C.call(o,ie,!0)),ie}let ge=R?w.outerHTML:w.innerHTML;return R&&B["!doctype"]&&w.ownerDocument&&w.ownerDocument.doctype&&w.ownerDocument.doctype.name&&ve(Lo,w.ownerDocument.doctype.name)&&(ge="<!DOCTYPE "+w.ownerDocument.doctype.name+`>
|
|
65
|
-
`+ge),x&&Ft([v,O,m],We=>{ge=_t(ge,We," ")}),$&&Pe?$.createHTML(ge):ge},e.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};En(L),H=!0},e.clearConfig=function(){lt=null,H=!1},e.isValidAttribute=function(L,i,w){lt||En({});const T=Q(L),K=Q(i);return Xo(T,K,w)},e.addHook=function(L,i){typeof i=="function"&&(
|
|
64
|
+
If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`)}),e};function As(){const t=D.domCache.get(this),e=D.innerParams.get(this);if(!e){co(this);return}t.popup&&M.swalCloseEventFinishedCallback&&(M.swalCloseEventFinishedCallback(),delete M.swalCloseEventFinishedCallback),M.deferDisposalTimer&&(clearTimeout(M.deferDisposalTimer),delete M.deferDisposalTimer),typeof e.didDestroy=="function"&&e.didDestroy(),Cs(this)}const Cs=t=>{co(t),delete t.params,delete M.keydownHandler,delete M.keydownTarget,delete M.currentInstance},co=t=>{t.isAwaitingPromise()?(sn(D,t),D.awaitingPromise.set(t,!0)):(sn(wt,t),sn(D,t))},sn=(t,e)=>{for(const n in t)t[n].delete(e)},uo=Object.freeze(Object.defineProperty({__proto__:null,_destroy:As,close:Rt,closeModal:Rt,closePopup:Rt,closeToast:Rt,disableButtons:ms,disableInput:bs,disableLoading:to,enableButtons:ps,enableInput:gs,getInput:Ji,getProgressSteps:vs,handleAwaitingPromise:vt,hideLoading:to,isAwaitingPromise:ls,rejectPromise:us,resetValidationMessage:ws,showValidationMessage:ys,update:ks},Symbol.toStringTag,{value:"Module"})),Es=t=>{const e=D.innerParams.get(t);t.disableButtons(),e.input?fo(t,"confirm"):ln(t,!0)},xs=t=>{const e=D.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?fo(t,"deny"):an(t,!1)},Ss=(t,e)=>{t.disableButtons(),e(Xe.cancel)},fo=(t,e)=>{const n=D.innerParams.get(t);if(!n.input)return Ue(`The "input" parameter is needed to be set when using returnInputValueOn${Wt(e)}`);const o=Vi(t,n);n.inputValidator?Ts(t,o,e):t.getInput().checkValidity()?e==="deny"?an(t,o):ln(t,o):(t.enableButtons(),t.showValidationMessage(n.validationMessage))},Ts=(t,e,n)=>{const o=D.innerParams.get(t);t.disableInput(),Promise.resolve().then(()=>dt(o.inputValidator(e,o.validationMessage))).then(c=>{t.enableButtons(),t.enableInput(),c?t.showValidationMessage(c):n==="deny"?an(t,e):ln(t,e)})},an=(t,e)=>{const n=D.innerParams.get(t||globalThis);n.showLoaderOnDeny&&Ze(Me()),n.preDeny?(D.awaitingPromise.set(t||globalThis,!0),Promise.resolve().then(()=>dt(n.preDeny(e,n.validationMessage))).then(s=>{s===!1?(t.hideLoading(),vt(t)):t.closePopup({isDenied:!0,value:typeof s>"u"?e:s})}).catch(s=>po(t||globalThis,s))):t.closePopup({isDenied:!0,value:e})},ho=(t,e)=>{t.closePopup({isConfirmed:!0,value:e})},po=(t,e)=>{t.rejectPromise(e)},ln=(t,e)=>{const n=D.innerParams.get(t||globalThis);n.showLoaderOnConfirm&&Ze(),n.preConfirm?(t.resetValidationMessage(),D.awaitingPromise.set(t||globalThis,!0),Promise.resolve().then(()=>dt(n.preConfirm(e,n.validationMessage))).then(s=>{we(Lt())||s===!1?(t.hideLoading(),vt(t)):ho(t,typeof s>"u"?e:s)}).catch(s=>po(t||globalThis,s))):ho(t,e)},Ls=(t,e,n)=>{D.innerParams.get(t).toast?Is(t,e,n):(Bs(e),Rs(e),Os(t,e,n))},Is=(t,e,n)=>{e.popup.onclick=()=>{const o=D.innerParams.get(t);o&&(Ps(o)||o.timer||o.input)||n(Xe.close)}},Ps=t=>t.showConfirmButton||t.showDenyButton||t.showCancelButton||t.showCloseButton;let Ot=!1;const Bs=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(Ot=!0)}}},Rs=t=>{t.container.onmousedown=()=>{t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,(e.target===t.popup||t.popup.contains(e.target))&&(Ot=!0)}}},Os=(t,e,n)=>{e.container.onclick=o=>{const s=D.innerParams.get(t);if(Ot){Ot=!1;return}o.target===e.container&&St(s.allowOutsideClick)&&n(Xe.backdrop)}},Fs=t=>typeof t=="object"&&t.jquery,mo=t=>t instanceof Element||Fs(t),Ms=t=>{const e={};return typeof t[0]=="object"&&!mo(t[0])?Object.assign(e,t[0]):["title","html","icon"].forEach((n,o)=>{const s=t[o];typeof s=="string"||mo(s)?e[n]=s:s!==void 0&&Ue(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof s}`)}),e};function Ns(...t){const e=this;return new e(...t)}function Ds(t){class e extends this{_main(o,s){return super._main(o,Object.assign({},t,s))}}return e}const Us=()=>M.timeout&&M.timeout.getTimerLeft(),go=()=>{if(M.timeout)return xr(),M.timeout.stop()},bo=()=>{if(M.timeout){const t=M.timeout.start();return Qt(t),t}},$s=()=>{const t=M.timeout;return t&&(t.running?go():bo())},Hs=t=>{if(M.timeout){const e=M.timeout.increase(t);return Qt(e,!0),e}},Vs=()=>M.timeout&&M.timeout.isRunning();let yo=!1;const cn={};function js(t="data-swal-template"){cn[t]=this,yo||(document.body.addEventListener("click",zs),yo=!0)}const zs=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const n in cn){const o=e.getAttribute(n);if(o){cn[n].fire({template:o});return}}},Ws=Object.freeze(Object.defineProperty({__proto__:null,argsToParams:Ms,bindClickHandler:js,clickCancel:Qi,clickConfirm:no,clickDeny:Zi,enableLoading:Ze,fire:Ns,getActions:mt,getCancelButton:$e,getCloseButton:Yt,getConfirmButton:Se,getContainer:ne,getDenyButton:Me,getFocusableElements:Jt,getFooter:Nn,getHtmlContainer:Tt,getIcon:pt,getImage:Fn,getInputLabel:kr,getLoader:Ye,getPopup:j,getTimerLeft:Us,getTimerProgressBar:It,getTitle:On,getValidationMessage:Lt,increaseTimer:Hs,isDeprecatedParameter:Gt,isLoading:Ar,isTimerRunning:Vs,isUpdatableParameter:Bn,isValidParameter:Pn,isVisible:Xi,mixin:Ds,resumeTimer:bo,showLoading:Ze,stopTimer:go,toggleTimer:$s},Symbol.toStringTag,{value:"Module"}));let un;class Qe{constructor(...e){if(typeof window>"u")return;un=this;const n=Object.freeze(this.constructor.argsToParams(e));Object.defineProperties(this,{params:{value:n,writable:!1,enumerable:!0,configurable:!0}});const o=this._main(this.params);D.promise.set(this,o)}_main(e,n={}){wr(Object.assign({},n,e)),M.currentInstance&&(M.currentInstance._destroy(),Xt()&&Yn()),M.currentInstance=this;const o=Ks(e,n);Ei(o),Object.freeze(o),M.timeout&&(M.timeout.stop(),delete M.timeout),clearTimeout(M.restoreFocusTimeout);const s=Gs(this);return Gn(this,o),D.innerParams.set(this,o),qs(this,s,o)}then(e){return D.promise.get(this).then(e)}finally(e){return D.promise.get(this).finally(e)}}const qs=(t,e,n)=>new Promise((o,s)=>{const c=k=>{t.closePopup({isDismissed:!0,dismiss:k})};wt.swalPromiseResolve.set(t,o),wt.swalPromiseReject.set(t,s),e.confirmButton.onclick=()=>Es(t),e.denyButton.onclick=()=>xs(t),e.cancelButton.onclick=()=>Ss(t,c),e.closeButton.onclick=()=>c(Xe.close),Ls(t,e,c),es(t,M,n,c),Hi(t,n),Mi(n),Ys(M,n,c),Js(e,n),setTimeout(()=>{e.container.scrollTop=0})}),Ks=(t,e)=>{const n=mi(t),o=Object.assign({},Ge,e,n,t);return o.showClass=Object.assign({},Ge.showClass,o.showClass),o.hideClass=Object.assign({},Ge.hideClass,o.hideClass),o},Gs=t=>{const e={popup:j(),container:ne(),actions:mt(),confirmButton:Se(),denyButton:Me(),cancelButton:$e(),loader:Ye(),closeButton:Yt(),validationMessage:Lt(),progressSteps:Mn()};return D.domCache.set(t,e),e},Ys=(t,e,n)=>{const o=It();re(o),e.timer&&(t.timeout=new xi(()=>{n("timer"),delete t.timeout},e.timer),e.timerProgressBar&&(ee(o),Ce(o,e,"timerProgressBar"),setTimeout(()=>{t.timeout&&t.timeout.running&&Qt(e.timer)})))},Js=(t,e)=>{if(!e.toast){if(!St(e.allowEnterKey))return Zs();Xs(t,e)||rn(e,-1,1)}},Xs=(t,e)=>e.focusDeny&&we(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&we(t.cancelButton)?(t.cancelButton.focus(),!0):e.focusConfirm&&we(t.confirmButton)?(t.confirmButton.focus(),!0):!1,Zs=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(Qe.prototype,uo),Object.assign(Qe,Ws),Object.keys(uo).forEach(t=>{Qe[t]=function(...e){if(un)return un[t](...e)}}),Qe.DismissReason=Xe,Qe.version="11.4.8";const et=Qe;et.default=et;/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:wo,setPrototypeOf:vo,isFrozen:Qs,getPrototypeOf:ea,getOwnPropertyDescriptor:ko}=Object;let{freeze:ae,seal:Te,create:_o}=Object,{apply:dn,construct:fn}=typeof Reflect<"u"&&Reflect;ae||(ae=function(e){return e}),Te||(Te=function(e){return e}),dn||(dn=function(e,n,o){return e.apply(n,o)}),fn||(fn=function(e,n){return new e(...n)});const Ft=Ee(Array.prototype.forEach),Ao=Ee(Array.prototype.pop),kt=Ee(Array.prototype.push),Mt=Ee(String.prototype.toLowerCase),hn=Ee(String.prototype.toString),ta=Ee(String.prototype.match),_t=Ee(String.prototype.replace),na=Ee(String.prototype.indexOf),oa=Ee(String.prototype.trim),ve=Ee(RegExp.prototype.test),At=ra(TypeError);function Ee(t){return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];return dn(t,e,o)}}function ra(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return fn(t,n)}}function N(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Mt;vo&&vo(t,null);let o=e.length;for(;o--;){let s=e[o];if(typeof s=="string"){const c=n(s);c!==s&&(Qs(e)||(e[o]=c),s=c)}t[s]=!0}return t}function tt(t){const e=_o(null);for(const[n,o]of wo(t))ko(t,n)!==void 0&&(e[n]=o);return e}function Nt(t,e){for(;t!==null;){const o=ko(t,e);if(o){if(o.get)return Ee(o.get);if(typeof o.value=="function")return Ee(o.value)}t=ea(t)}function n(o){return console.warn("fallback value for",o),null}return n}const Co=ae(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),pn=ae(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),mn=ae(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ia=ae(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),gn=ae(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),sa=ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Eo=ae(["#text"]),xo=ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),bn=ae(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),So=ae(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Dt=ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),aa=Te(/\{\{[\w\W]*|[\w\W]*\}\}/gm),la=Te(/<%[\w\W]*|[\w\W]*%>/gm),ca=Te(/\${[\w\W]*}/gm),ua=Te(/^data-[\-\w.\u00B7-\uFFFF]/),da=Te(/^aria-[\-\w]+$/),To=Te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fa=Te(/^(?:\w+script|data):/i),ha=Te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Lo=Te(/^html$/i);var Io=Object.freeze({__proto__:null,MUSTACHE_EXPR:aa,ERB_EXPR:la,TMPLIT_EXPR:ca,DATA_ATTR:ua,ARIA_ATTR:da,IS_ALLOWED_URI:To,IS_SCRIPT_OR_DATA:fa,ATTR_WHITESPACE:ha,DOCTYPE_NAME:Lo});const pa=function(){return typeof window>"u"?null:window},ma=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(o=n.getAttribute(s));const c="dompurify"+(o?"#"+o:"");try{return e.createPolicy(c,{createHTML(k){return k},createScriptURL(k){return k}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}};function Po(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pa();const e=L=>Po(L);if(e.version="3.0.6",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;let{document:n}=t;const o=n,s=o.currentScript,{DocumentFragment:c,HTMLTemplateElement:k,Node:I,Element:d,NodeFilter:U,NamedNodeMap:W=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:J,DOMParser:le,trustedTypes:z}=t,Re=d.prototype,ot=Nt(Re,"cloneNode"),ke=Nt(Re,"nextSibling"),rt=Nt(Re,"childNodes"),he=Nt(Re,"parentNode");if(typeof k=="function"){const L=n.createElement("template");L.content&&L.content.ownerDocument&&(n=L.content.ownerDocument)}let $,_e="";const{implementation:Z,createNodeIterator:h,createDocumentFragment:A,getElementsByTagName:P}=n,{importNode:C}=o;let _={};e.isSupported=typeof wo=="function"&&typeof he=="function"&&Z&&Z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:v,ERB_EXPR:O,TMPLIT_EXPR:m,DATA_ATTR:F,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:Y}=Io;let{IS_ALLOWED_URI:ce}=Io,B=null;const pe=N({},[...Co,...pn,...mn,...gn,...Eo]);let r=null;const a=N({},[...xo,...bn,...So,...Dt]);let f=Object.seal(_o(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),b=null,p=null,E=!0,g=!0,y=!1,S=!0,x=!1,R=!1,H=!1,me=!1,ue=!1,te=!1,Pe=!1,Do=!0,Uo=!1;const ml="user-content-";let kn=!0,Et=!1,it={},st=null;const $o=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ho=null;const Vo=N({},["audio","video","img","source","image","track"]);let _n=null;const jo=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$t="http://www.w3.org/1998/Math/MathML",Ht="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml";let at=Oe,An=!1,Cn=null;const gl=N({},[$t,Ht,Oe],hn);let je=null;const bl=["application/xhtml+xml","text/html"],yl="text/html";let Q=null,lt=null;const wl=n.createElement("form"),zo=function(i){return i instanceof RegExp||i instanceof Function},En=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(lt&<===i)){if((!i||typeof i!="object")&&(i={}),i=tt(i),je=bl.indexOf(i.PARSER_MEDIA_TYPE)===-1?je=yl:je=i.PARSER_MEDIA_TYPE,Q=je==="application/xhtml+xml"?hn:Mt,B="ALLOWED_TAGS"in i?N({},i.ALLOWED_TAGS,Q):pe,r="ALLOWED_ATTR"in i?N({},i.ALLOWED_ATTR,Q):a,Cn="ALLOWED_NAMESPACES"in i?N({},i.ALLOWED_NAMESPACES,hn):gl,_n="ADD_URI_SAFE_ATTR"in i?N(tt(jo),i.ADD_URI_SAFE_ATTR,Q):jo,Ho="ADD_DATA_URI_TAGS"in i?N(tt(Vo),i.ADD_DATA_URI_TAGS,Q):Vo,st="FORBID_CONTENTS"in i?N({},i.FORBID_CONTENTS,Q):$o,b="FORBID_TAGS"in i?N({},i.FORBID_TAGS,Q):{},p="FORBID_ATTR"in i?N({},i.FORBID_ATTR,Q):{},it="USE_PROFILES"in i?i.USE_PROFILES:!1,E=i.ALLOW_ARIA_ATTR!==!1,g=i.ALLOW_DATA_ATTR!==!1,y=i.ALLOW_UNKNOWN_PROTOCOLS||!1,S=i.ALLOW_SELF_CLOSE_IN_ATTR!==!1,x=i.SAFE_FOR_TEMPLATES||!1,R=i.WHOLE_DOCUMENT||!1,ue=i.RETURN_DOM||!1,te=i.RETURN_DOM_FRAGMENT||!1,Pe=i.RETURN_TRUSTED_TYPE||!1,me=i.FORCE_BODY||!1,Do=i.SANITIZE_DOM!==!1,Uo=i.SANITIZE_NAMED_PROPS||!1,kn=i.KEEP_CONTENT!==!1,Et=i.IN_PLACE||!1,ce=i.ALLOWED_URI_REGEXP||To,at=i.NAMESPACE||Oe,f=i.CUSTOM_ELEMENT_HANDLING||{},i.CUSTOM_ELEMENT_HANDLING&&zo(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=i.CUSTOM_ELEMENT_HANDLING.tagNameCheck),i.CUSTOM_ELEMENT_HANDLING&&zo(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),i.CUSTOM_ELEMENT_HANDLING&&typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),x&&(g=!1),te&&(ue=!0),it&&(B=N({},[...Eo]),r=[],it.html===!0&&(N(B,Co),N(r,xo)),it.svg===!0&&(N(B,pn),N(r,bn),N(r,Dt)),it.svgFilters===!0&&(N(B,mn),N(r,bn),N(r,Dt)),it.mathMl===!0&&(N(B,gn),N(r,So),N(r,Dt))),i.ADD_TAGS&&(B===pe&&(B=tt(B)),N(B,i.ADD_TAGS,Q)),i.ADD_ATTR&&(r===a&&(r=tt(r)),N(r,i.ADD_ATTR,Q)),i.ADD_URI_SAFE_ATTR&&N(_n,i.ADD_URI_SAFE_ATTR,Q),i.FORBID_CONTENTS&&(st===$o&&(st=tt(st)),N(st,i.FORBID_CONTENTS,Q)),kn&&(B["#text"]=!0),R&&N(B,["html","head","body"]),B.table&&(N(B,["tbody"]),delete b.tbody),i.TRUSTED_TYPES_POLICY){if(typeof i.TRUSTED_TYPES_POLICY.createHTML!="function")throw At('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof i.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw At('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');$=i.TRUSTED_TYPES_POLICY,_e=$.createHTML("")}else $===void 0&&($=ma(z,s)),$!==null&&typeof _e=="string"&&(_e=$.createHTML(""));ae&&ae(i),lt=i}},Wo=N({},["mi","mo","mn","ms","mtext"]),qo=N({},["foreignobject","desc","title","annotation-xml"]),vl=N({},["title","style","font","a","script"]),Vt=N({},pn);N(Vt,mn),N(Vt,ia);const xn=N({},gn);N(xn,sa);const kl=function(i){let w=he(i);(!w||!w.tagName)&&(w={namespaceURI:at,tagName:"template"});const T=Mt(i.tagName),K=Mt(w.tagName);return Cn[i.namespaceURI]?i.namespaceURI===Ht?w.namespaceURI===Oe?T==="svg":w.namespaceURI===$t?T==="svg"&&(K==="annotation-xml"||Wo[K]):!!Vt[T]:i.namespaceURI===$t?w.namespaceURI===Oe?T==="math":w.namespaceURI===Ht?T==="math"&&qo[K]:!!xn[T]:i.namespaceURI===Oe?w.namespaceURI===Ht&&!qo[K]||w.namespaceURI===$t&&!Wo[K]?!1:!xn[T]&&(vl[T]||!Vt[T]):!!(je==="application/xhtml+xml"&&Cn[i.namespaceURI]):!1},ze=function(i){kt(e.removed,{element:i});try{i.parentNode.removeChild(i)}catch{i.remove()}},Sn=function(i,w){try{kt(e.removed,{attribute:w.getAttributeNode(i),from:w})}catch{kt(e.removed,{attribute:null,from:w})}if(w.removeAttribute(i),i==="is"&&!r[i])if(ue||te)try{ze(w)}catch{}else try{w.setAttribute(i,"")}catch{}},Ko=function(i){let w=null,T=null;if(me)i="<remove></remove>"+i;else{const se=ta(i,/^[\r\n\t ]+/);T=se&&se[0]}je==="application/xhtml+xml"&&at===Oe&&(i='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+i+"</body></html>");const K=$?$.createHTML(i):i;if(at===Oe)try{w=new le().parseFromString(K,je)}catch{}if(!w||!w.documentElement){w=Z.createDocument(at,"template",null);try{w.documentElement.innerHTML=An?_e:K}catch{}}const ie=w.body||w.documentElement;return i&&T&&ie.insertBefore(n.createTextNode(T),ie.childNodes[0]||null),at===Oe?P.call(w,R?"html":"body")[0]:R?w.documentElement:ie},Go=function(i){return h.call(i.ownerDocument||i,i,U.SHOW_ELEMENT|U.SHOW_COMMENT|U.SHOW_TEXT,null)},_l=function(i){return i instanceof J&&(typeof i.nodeName!="string"||typeof i.textContent!="string"||typeof i.removeChild!="function"||!(i.attributes instanceof W)||typeof i.removeAttribute!="function"||typeof i.setAttribute!="function"||typeof i.namespaceURI!="string"||typeof i.insertBefore!="function"||typeof i.hasChildNodes!="function")},Yo=function(i){return typeof I=="function"&&i instanceof I},Fe=function(i,w,T){_[i]&&Ft(_[i],K=>{K.call(e,w,T,lt)})},Jo=function(i){let w=null;if(Fe("beforeSanitizeElements",i,null),_l(i))return ze(i),!0;const T=Q(i.nodeName);if(Fe("uponSanitizeElement",i,{tagName:T,allowedTags:B}),i.hasChildNodes()&&!Yo(i.firstElementChild)&&ve(/<[/\w]/g,i.innerHTML)&&ve(/<[/\w]/g,i.textContent))return ze(i),!0;if(!B[T]||b[T]){if(!b[T]&&Zo(T)&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,T)||f.tagNameCheck instanceof Function&&f.tagNameCheck(T)))return!1;if(kn&&!st[T]){const K=he(i)||i.parentNode,ie=rt(i)||i.childNodes;if(ie&&K){const se=ie.length;for(let ge=se-1;ge>=0;--ge)K.insertBefore(ot(ie[ge],!0),ke(i))}}return ze(i),!0}return i instanceof d&&!kl(i)||(T==="noscript"||T==="noembed"||T==="noframes")&&ve(/<\/no(script|embed|frames)/i,i.innerHTML)?(ze(i),!0):(x&&i.nodeType===3&&(w=i.textContent,Ft([v,O,m],K=>{w=_t(w,K," ")}),i.textContent!==w&&(kt(e.removed,{element:i.cloneNode()}),i.textContent=w)),Fe("afterSanitizeElements",i,null),!1)},Xo=function(i,w,T){if(Do&&(w==="id"||w==="name")&&(T in n||T in wl))return!1;if(!(g&&!p[w]&&ve(F,w))){if(!(E&&ve(q,w))){if(!r[w]||p[w]){if(!(Zo(i)&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,i)||f.tagNameCheck instanceof Function&&f.tagNameCheck(i))&&(f.attributeNameCheck instanceof RegExp&&ve(f.attributeNameCheck,w)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(w))||w==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,T)||f.tagNameCheck instanceof Function&&f.tagNameCheck(T))))return!1}else if(!_n[w]){if(!ve(ce,_t(T,Y,""))){if(!((w==="src"||w==="xlink:href"||w==="href")&&i!=="script"&&na(T,"data:")===0&&Ho[i])){if(!(y&&!ve(X,_t(T,Y,"")))){if(T)return!1}}}}}}return!0},Zo=function(i){return i.indexOf("-")>0},Qo=function(i){Fe("beforeSanitizeAttributes",i,null);const{attributes:w}=i;if(!w)return;const T={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:r};let K=w.length;for(;K--;){const ie=w[K],{name:se,namespaceURI:ge,value:We}=ie,xt=Q(se);let be=se==="value"?We:oa(We);if(T.attrName=xt,T.attrValue=be,T.keepAttr=!0,T.forceKeepAttr=void 0,Fe("uponSanitizeAttribute",i,T),be=T.attrValue,T.forceKeepAttr||(Sn(se,i),!T.keepAttr))continue;if(!S&&ve(/\/>/i,be)){Sn(se,i);continue}x&&Ft([v,O,m],tr=>{be=_t(be,tr," ")});const er=Q(i.nodeName);if(Xo(er,xt,be)){if(Uo&&(xt==="id"||xt==="name")&&(Sn(se,i),be=ml+be),$&&typeof z=="object"&&typeof z.getAttributeType=="function"&&!ge)switch(z.getAttributeType(er,xt)){case"TrustedHTML":{be=$.createHTML(be);break}case"TrustedScriptURL":{be=$.createScriptURL(be);break}}try{ge?i.setAttributeNS(ge,se,be):i.setAttribute(se,be),Ao(e.removed)}catch{}}}Fe("afterSanitizeAttributes",i,null)},Al=function L(i){let w=null;const T=Go(i);for(Fe("beforeSanitizeShadowDOM",i,null);w=T.nextNode();)Fe("uponSanitizeShadowNode",w,null),!Jo(w)&&(w.content instanceof c&&L(w.content),Qo(w));Fe("afterSanitizeShadowDOM",i,null)};return e.sanitize=function(L){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=null,T=null,K=null,ie=null;if(An=!L,An&&(L="<!-->"),typeof L!="string"&&!Yo(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw At("dirty is not a string, aborting")}else throw At("toString is not a function");if(!e.isSupported)return L;if(H||En(i),e.removed=[],typeof L=="string"&&(Et=!1),Et){if(L.nodeName){const We=Q(L.nodeName);if(!B[We]||b[We])throw At("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof I)w=Ko("<!---->"),T=w.ownerDocument.importNode(L,!0),T.nodeType===1&&T.nodeName==="BODY"||T.nodeName==="HTML"?w=T:w.appendChild(T);else{if(!ue&&!x&&!R&&L.indexOf("<")===-1)return $&&Pe?$.createHTML(L):L;if(w=Ko(L),!w)return ue?null:Pe?_e:""}w&&me&&ze(w.firstChild);const se=Go(Et?L:w);for(;K=se.nextNode();)Jo(K)||(K.content instanceof c&&Al(K.content),Qo(K));if(Et)return L;if(ue){if(te)for(ie=A.call(w.ownerDocument);w.firstChild;)ie.appendChild(w.firstChild);else ie=w;return(r.shadowroot||r.shadowrootmode)&&(ie=C.call(o,ie,!0)),ie}let ge=R?w.outerHTML:w.innerHTML;return R&&B["!doctype"]&&w.ownerDocument&&w.ownerDocument.doctype&&w.ownerDocument.doctype.name&&ve(Lo,w.ownerDocument.doctype.name)&&(ge="<!DOCTYPE "+w.ownerDocument.doctype.name+`>
|
|
65
|
+
`+ge),x&&Ft([v,O,m],We=>{ge=_t(ge,We," ")}),$&&Pe?$.createHTML(ge):ge},e.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};En(L),H=!0},e.clearConfig=function(){lt=null,H=!1},e.isValidAttribute=function(L,i,w){lt||En({});const T=Q(L),K=Q(i);return Xo(T,K,w)},e.addHook=function(L,i){typeof i=="function"&&(_[L]=_[L]||[],kt(_[L],i))},e.removeHook=function(L){if(_[L])return Ao(_[L])},e.removeHooks=function(L){_[L]&&(_[L]=[])},e.removeAllHooks=function(){_={}},e}var Bo=Po();class ga{get IsVisible(){return et.isVisible()}async ConfirmAsync(e){return new Promise(n=>{et.fire({showCancelButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,icon:"question",title:e.title,html:Bo.sanitize(e.text),confirmButtonText:e.confirmLabel??"confirmar",cancelButtonText:e.rejectLabel??"cancelar"}).then(o=>{n(o.isConfirmed===!0)})})}async AlertAsync(e){const n=e.icon??"info";let o;return Array.isArray(e.text)?o=`<div style="max-height: 50vh; overflow: auto">
|
|
66
66
|
${e.text.join("<br />")}
|
|
67
|
-
</div>`:o=e.text,new Promise(s=>{et.fire({allowEscapeKey:!1,allowOutsideClick:!1,icon:n,title:e.title,html:Bo.sanitize(o)}).then(()=>s(!0))})}}const ba=new ga,Ro=()=>ba,ya=["data-cor"],wa=l.defineComponent({__name:"HeaderAvatar",emits:["logout"],setup(t,{emit:e}){const n=Ro(),o=l.ref(""),s=e;async function c(){await n.ConfirmAsync({text:"Você deseja sair da conta?",confirmLabel:"sair"})&&s("logout")}function A(){const d=sessionStorage.getItem("name");let U="?";if(!d)return U;const W=d.split(" ").filter(le=>le.length>0).map(le=>le[0].toUpperCase()),J=Math.min(2,W.length);return U=W.slice(0,J).join(""),U.length>0?U:"?"}const I=l.computed(()=>{const d=o.value[0],U=d==="?"?0:(d.charCodeAt(0)-64)%19;return Math.max(U,0)});return l.onMounted(()=>{o.value=A()}),(d,U)=>(l.openBlock(),l.createElementBlock("div",{id:"sf-header-avatar","data-cor":I.value,onClick:c},l.toDisplayString(o.value),9,ya))}}),va={},ka={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},_a=[l.createElementVNode("path",{d:"m307.231-83.463-54.999-55.23 343.923-343.922-343.923-343.539 54.999-54.614 398.153 398.153L307.231-83.462Z"},null,-1)];function Aa(t,e){return l.openBlock(),l.createElementBlock("svg",ka,_a)}const Ca=Tn(va,[["render",Aa]]);class Ea{get storedTheme(){return localStorage.getItem("color-scheme")}get IsDark(){return document.documentElement.classList.contains("dark")}Toggle(){this.IsDark?this.EnableLightMode():this.EnableDarkMode()}EnableDarkMode(){document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),localStorage.setItem("color-scheme","dark")}EnableLightMode(){document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"),localStorage.setItem("color-scheme","light")}SetInitialTheme(){if(this.storedTheme==="light")return this.EnableLightMode();if(this.storedTheme==="dark")return this.EnableDarkMode();if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return this.EnableDarkMode();this.EnableLightMode()}}const yn=(()=>new Ea)(),xa=[l.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="472.39" height="472.39" viewBox="0 0 472.39 472.39"><g class="toggle-sun"><path d="M403.21,167V69.18H305.38L236.2,0,167,69.18H69.18V167L0,236.2l69.18,69.18v97.83H167l69.18,69.18,69.18-69.18h97.83V305.38l69.18-69.18Zm-167,198.17a129,129,0,1,1,129-129A129,129,0,0,1,236.2,365.19Z"></path></g><g class="toggle-circle"><circle class="cls-1" cx="236.2" cy="236.2" r="103.78"></circle></g></svg>',1)],Sa=l.defineComponent({__name:"ThemeToggle",setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("button",{id:"sf-theme-toggle",onClick:n[0]||(n[0]=(...o)=>l.unref(yn).Toggle&&l.unref(yn).Toggle(...o))},xa))}}),Ta={id:"sf-layout"},La=l.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),Ia={class:"title"},Pa={class:"sf-layout-nav-header"},Ba=l.createElementVNode("span",null,"Menu",-1),Ra={class:"sf-layout-nav-content"},Oa=l.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),Fa={id:"sf-layout-content"},Ma=l.defineComponent({__name:"Layout",emits:["mounted","logout"],setup(t,{emit:e}){const n=jt(),o=e;return l.onMounted(()=>{o("mounted")}),(s,c)=>(l.openBlock(),l.createElementBlock("div",Ta,[l.createElementVNode("header",null,[l.createElementVNode("div",{class:l.normalizeClass(["sf-layout-menu-toggler",{invert:l.unref(n).IsVisible}]),onClick:c[0]||(c[0]=A=>l.unref(n).Toggle())},[La,l.createVNode(Ca)],2),l.createElementVNode("div",Ia,[l.renderSlot(s.$slots,"title")]),l.renderSlot(s.$slots,"action"),l.createVNode(Sa),l.createVNode(wa,{onLogout:c[1]||(c[1]=A=>o("logout"))})]),l.createElementVNode("nav",{class:l.normalizeClass({visible:l.unref(n).IsVisible})},[l.createElementVNode("div",Pa,[Ba,l.createVNode(ut,{icone:"close",button:"",onClick:c[2]||(c[2]=A=>l.unref(n).Close())})]),l.createElementVNode("div",Ra,[l.renderSlot(s.$slots,"menu")])],2),l.createElementVNode("main",{class:l.normalizeClass({"menu-visible":l.unref(n).IsVisible})},[Oa,l.createElementVNode("section",Fa,[l.renderSlot(s.$slots,"content")])],2)]))}}),Na=["href","data-active","onClick"],Da={class:"sf-navmenulink-text"},Ua=l.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{},exact:{type:Boolean}},setup(t){const e=t,n=jt();function o(s,c){s.preventDefault();const I=s.target.closest(".sf-layout-nav-content");c(),I&&I.clientWidth+10>document.body.clientWidth&&n.Close()}return(s,c)=>{const A=l.resolveComponent("router-link");return l.openBlock(),l.createBlock(A,{to:e.href,custom:""},{default:l.withCtx(({href:I,navigate:d,isExactActive:U,isActive:W})=>[l.createElementVNode("a",{class:"sf-navmenulink",href:I,"data-active":e.exact?U:W,onClick:J=>o(J,d)},[e.icon?(l.openBlock(),l.createBlock(ut,{key:0,icone:e.icon,"button-props":{tabindex:-1}},null,8,["icone"])):l.createCommentVNode("",!0),l.createElementVNode("span",Da,l.toDisplayString(e.text),1)],8,Na)]),_:1},8,["to"])}}}),$a=l.defineComponent({__name:"ScrollToTop",setup(t){const e=l.ref(!1),n=`--${+new Date}`;let o=null;function s(){o==null||o.scrollTo(0,0)}return l.onMounted(()=>{var c;o=((c=document.getElementById(n))==null?void 0:c.parentElement)??null,o&&o.addEventListener("scroll",function(){e.value=this.scrollTop-this.clientHeight>0})}),(c,A)=>(l.openBlock(),l.createElementBlock("button",{id:n,class:l.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":e.value}]),onClick:s},null,2))}}),Ha=l.defineComponent({__name:"Content",props:{class:{},style:{},disableBodyPadding:{type:Boolean},disableHeaderPadding:{type:Boolean},disableFooterPadding:{type:Boolean}},setup(t){const e=t;function n(){return new Ke("sf-content").AddClass(e.class,!!e.class).Build()}function o(){return new Ke("sf-content-body").AddClass("sf-content-no-padding",e.disableBodyPadding).Build()}function s(){return new Ke("sf-content-header").AddClass("sf-content-no-padding",e.disableHeaderPadding).Build()}function c(){return new Ke("sf-content-footer").AddClass("sf-content-no-padding",e.disableFooterPadding).Build()}return(A,I)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(n()),style:l.normalizeStyle(e.style)},[l.createElementVNode("div",{class:l.normalizeClass(s())},[l.renderSlot(A.$slots,"header")],2),l.createElementVNode("div",{class:l.normalizeClass(o())},[l.renderSlot(A.$slots,"default"),l.createVNode($a)],2),l.createElementVNode("div",{class:l.normalizeClass(c())},[l.renderSlot(A.$slots,"footer")],2)],6))}}),Va={class:"sf-tab-navigation"},ja=[l.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)],za=["data-active"],Wa=["href","onClick"],qa=[l.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})],-1)],Ka=l.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(t){const e=t,n=l.ref(null),o=new ResizeObserver(d=>{I()}),s=l.ref(!1),c=l.ref(!1);function A(d=!1){const U=n.value.clientWidth;n.value.scrollLeft+=d?-U:U}function I(){const d=n.value.scrollWidth-n.value.clientWidth;s.value=n.value.scrollLeft>10,c.value=n.value.scrollLeft<d-10}return l.onMounted(()=>{n.value.addEventListener("scroll",I),o.observe(n.value)}),l.onBeforeUnmount(()=>{var d;try{(d=n.value)==null||d.removeEventListener("scroll",I),o.unobserve(n.value),o.disconnect()}catch{}}),(d,U)=>{const W=l.resolveComponent("RouterLink");return l.openBlock(),l.createElementBlock("div",Va,[l.createElementVNode("div",{class:l.normalizeClass(["left-arrow",{active:s.value}]),onClick:U[0]||(U[0]=J=>A(!0))},ja,2),l.createElementVNode("ul",{ref_key:"trackerContainer",ref:n},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.tabs,J=>(l.openBlock(),l.createBlock(W,{to:J.route,custom:!0},{default:l.withCtx(({navigate:le,isActive:z})=>[l.createElementVNode("li",{"data-active":z},[l.renderSlot(d.$slots,"item",{item:J,navigate:le,isActive:z},()=>[l.createElementVNode("a",{href:J.route,class:l.normalizeClass({active:z}),onClick:le},l.toDisplayString(J.text),11,Wa)])],8,za)]),_:2},1032,["to"]))),256))],512),l.createElementVNode("div",{class:l.normalizeClass(["right-arrow",{active:c.value}]),onClick:U[1]||(U[1]=J=>A())},qa,2)])}}}),Ga=["id","name","disabled","data-color","form","type"],Ya={class:"sf-button-label"},Ja=l.defineComponent({__name:"Button",props:{icon:{},visible:{type:Boolean,default:!0},class:{},style:{},disabled:{type:Boolean},loading:{type:Boolean},color:{default:"primary"},size:{default:"md"},variant:{default:"filled"},autofocus:{type:Boolean},form:{},name:{},id:{},type:{default:"button"},value:{}},setup(t){const e=t;function n(){return new Ke(`${e.class??""} sf-button`).AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).AddClass("sf-button-small",e.size==="sm").AddClass("sf-button-medium",e.size==="md").AddClass("sf-button-large",e.size==="lg").AddClass("sf-button-filled",e.variant==="filled").AddClass("sf-button-text",e.variant==="text").AddClass("sf-button-outlined",e.variant==="outlined").AddClass("sf-button-with-icon",!!e.icon).AddClass("sf-ripple").Build()}return(o,s)=>(l.openBlock(),l.createElementBlock("button",{id:e.id,name:e.name,class:l.normalizeClass(n()),style:l.normalizeStyle(e.style),disabled:e.disabled||e.loading,"data-color":e.color,form:e.form,type:e.type},[e.icon?(l.openBlock(),l.createBlock(ut,{key:0,icone:e.icon,loading:e.loading,size:e.size,"button-props":{tabindex:-1}},null,8,["icone","loading","size"])):e.loading?(l.openBlock(),l.createBlock(ut,{key:1,loading:!0,size:e.size,"button-props":{tabindex:-1}},null,8,["size"])):l.createCommentVNode("",!0),l.createElementVNode("span",Ya,[l.renderSlot(o.$slots,"default")])],14,Ga))}});var Xa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Za(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Qa(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function o(){return this instanceof o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:function(){return t[o]}})}),n}var Ut={};Ut.byteLength=nl,Ut.toByteArray=rl,Ut.fromByteArray=al;for(var Ie=[],xe=[],el=typeof Uint8Array<"u"?Uint8Array:Array,wn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nt=0,tl=wn.length;nt<tl;++nt)Ie[nt]=wn[nt],xe[wn.charCodeAt(nt)]=nt;xe["-".charCodeAt(0)]=62,xe["_".charCodeAt(0)]=63;function Oo(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var o=n===e?0:4-n%4;return[n,o]}function nl(t){var e=Oo(t),n=e[0],o=e[1];return(n+o)*3/4-o}function ol(t,e,n){return(e+n)*3/4-n}function rl(t){var e,n=Oo(t),o=n[0],s=n[1],c=new el(ol(t,o,s)),A=0,I=s>0?o-4:o,d;for(d=0;d<I;d+=4)e=xe[t.charCodeAt(d)]<<18|xe[t.charCodeAt(d+1)]<<12|xe[t.charCodeAt(d+2)]<<6|xe[t.charCodeAt(d+3)],c[A++]=e>>16&255,c[A++]=e>>8&255,c[A++]=e&255;return s===2&&(e=xe[t.charCodeAt(d)]<<2|xe[t.charCodeAt(d+1)]>>4,c[A++]=e&255),s===1&&(e=xe[t.charCodeAt(d)]<<10|xe[t.charCodeAt(d+1)]<<4|xe[t.charCodeAt(d+2)]>>2,c[A++]=e>>8&255,c[A++]=e&255),c}function il(t){return Ie[t>>18&63]+Ie[t>>12&63]+Ie[t>>6&63]+Ie[t&63]}function sl(t,e,n){for(var o,s=[],c=e;c<n;c+=3)o=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(t[c+2]&255),s.push(il(o));return s.join("")}function al(t){for(var e,n=t.length,o=n%3,s=[],c=16383,A=0,I=n-o;A<I;A+=c)s.push(sl(t,A,A+c>I?I:A+c));return o===1?(e=t[n-1],s.push(Ie[e>>2]+Ie[e<<4&63]+"==")):o===2&&(e=(t[n-2]<<8)+t[n-1],s.push(Ie[e>>10]+Ie[e>>4&63]+Ie[e<<2&63]+"=")),s.join("")}var Fo={exports:{}};const Mo=Qa(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));/**
|
|
67
|
+
</div>`:o=e.text,new Promise(s=>{et.fire({allowEscapeKey:!1,allowOutsideClick:!1,icon:n,title:e.title,html:Bo.sanitize(o)}).then(()=>s(!0))})}}const ba=new ga,Ro=()=>ba,ya=["data-cor"],wa=l.defineComponent({__name:"HeaderAvatar",emits:["logout"],setup(t,{emit:e}){const n=Ro(),o=l.ref("?"),s=e;async function c(){await n.ConfirmAsync({text:"Você deseja sair da conta?",confirmLabel:"sair"})&&s("logout")}function k(){const d=sessionStorage.getItem("name");let U="?";if(!d)return U;const W=d.split(" ").filter(le=>le.length>0).map(le=>le[0].toUpperCase()),J=Math.min(2,W.length);return U=W.slice(0,J).join(""),U.length>0?U:"?"}const I=l.computed(()=>{const d=o.value[0],U=d==="?"?0:(d.charCodeAt(0)-64)%19;return Math.max(U,0)});return l.onMounted(()=>{o.value=k()}),(d,U)=>(l.openBlock(),l.createElementBlock("div",{id:"sf-header-avatar","data-cor":I.value,onClick:c},l.toDisplayString(o.value),9,ya))}}),va={},ka={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},_a=[l.createElementVNode("path",{d:"m307.231-83.463-54.999-55.23 343.923-343.922-343.923-343.539 54.999-54.614 398.153 398.153L307.231-83.462Z"},null,-1)];function Aa(t,e){return l.openBlock(),l.createElementBlock("svg",ka,_a)}const Ca=Tn(va,[["render",Aa]]);class Ea{get storedTheme(){return localStorage.getItem("color-scheme")}get IsDark(){return document.documentElement.classList.contains("dark")}Toggle(){this.IsDark?this.EnableLightMode():this.EnableDarkMode()}EnableDarkMode(){document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),localStorage.setItem("color-scheme","dark")}EnableLightMode(){document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"),localStorage.setItem("color-scheme","light")}SetInitialTheme(){if(this.storedTheme==="light")return this.EnableLightMode();if(this.storedTheme==="dark")return this.EnableDarkMode();if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return this.EnableDarkMode();this.EnableLightMode()}}const yn=(()=>new Ea)(),xa=[l.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="472.39" height="472.39" viewBox="0 0 472.39 472.39"><g class="toggle-sun"><path d="M403.21,167V69.18H305.38L236.2,0,167,69.18H69.18V167L0,236.2l69.18,69.18v97.83H167l69.18,69.18,69.18-69.18h97.83V305.38l69.18-69.18Zm-167,198.17a129,129,0,1,1,129-129A129,129,0,0,1,236.2,365.19Z"></path></g><g class="toggle-circle"><circle class="cls-1" cx="236.2" cy="236.2" r="103.78"></circle></g></svg>',1)],Sa=l.defineComponent({__name:"ThemeToggle",setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("button",{id:"sf-theme-toggle",onClick:n[0]||(n[0]=(...o)=>l.unref(yn).Toggle&&l.unref(yn).Toggle(...o))},xa))}}),Ta={id:"sf-layout"},La=l.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),Ia={class:"title"},Pa={class:"sf-layout-nav-header"},Ba=l.createElementVNode("span",null,"Menu",-1),Ra={class:"sf-layout-nav-content"},Oa=l.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),Fa={id:"sf-layout-content"},Ma=l.defineComponent({__name:"Layout",emits:["mounted","logout"],setup(t,{emit:e}){const n=jt(),o=e;function s(){o("logout")}return l.onMounted(()=>{o("mounted")}),(c,k)=>(l.openBlock(),l.createElementBlock("div",Ta,[l.createElementVNode("header",null,[l.createElementVNode("div",{class:l.normalizeClass(["sf-layout-menu-toggler",{invert:l.unref(n).IsVisible}]),onClick:k[0]||(k[0]=I=>l.unref(n).Toggle())},[La,l.createVNode(Ca)],2),l.createElementVNode("div",Ia,[l.renderSlot(c.$slots,"title")]),l.renderSlot(c.$slots,"action"),l.createVNode(Sa),l.createVNode(wa,{onLogout:s})]),l.createElementVNode("nav",{class:l.normalizeClass({visible:l.unref(n).IsVisible})},[l.createElementVNode("div",Pa,[Ba,l.createVNode(ut,{icone:"close",button:"",onClick:k[1]||(k[1]=I=>l.unref(n).Close())})]),l.createElementVNode("div",Ra,[l.renderSlot(c.$slots,"menu")])],2),l.createElementVNode("main",{class:l.normalizeClass({"menu-visible":l.unref(n).IsVisible})},[Oa,l.createElementVNode("section",Fa,[l.renderSlot(c.$slots,"content")])],2)]))}}),Na=["href","data-active","onClick"],Da={class:"sf-navmenulink-text"},Ua=l.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{},exact:{type:Boolean}},setup(t){const e=t,n=jt();function o(s,c){s.preventDefault();const I=s.target.closest(".sf-layout-nav-content");c(),I&&I.clientWidth+10>document.body.clientWidth&&n.Close()}return(s,c)=>{const k=l.resolveComponent("router-link");return l.openBlock(),l.createBlock(k,{to:e.href,custom:""},{default:l.withCtx(({href:I,navigate:d,isExactActive:U,isActive:W})=>[l.createElementVNode("a",{class:"sf-navmenulink",href:I,"data-active":e.exact?U:W,onClick:J=>o(J,d)},[e.icon?(l.openBlock(),l.createBlock(ut,{key:0,icone:e.icon,"button-props":{tabindex:-1}},null,8,["icone"])):l.createCommentVNode("",!0),l.createElementVNode("span",Da,l.toDisplayString(e.text),1)],8,Na)]),_:1},8,["to"])}}}),$a=l.defineComponent({__name:"ScrollToTop",setup(t){const e=l.ref(!1),n=`--${+new Date}`;let o=null;function s(){o==null||o.scrollTo(0,0)}return l.onMounted(()=>{var c;o=((c=document.getElementById(n))==null?void 0:c.parentElement)??null,o&&o.addEventListener("scroll",function(){e.value=this.scrollTop-this.clientHeight>0})}),(c,k)=>(l.openBlock(),l.createElementBlock("button",{id:n,class:l.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":e.value}]),onClick:s},null,2))}}),Ha=l.defineComponent({__name:"Content",props:{class:{},style:{},disableBodyPadding:{type:Boolean},disableHeaderPadding:{type:Boolean},disableFooterPadding:{type:Boolean}},setup(t){const e=t;function n(){return new Ke("sf-content").AddClass(e.class,!!e.class).Build()}function o(){return new Ke("sf-content-body").AddClass("sf-content-no-padding",e.disableBodyPadding).Build()}function s(){return new Ke("sf-content-header").AddClass("sf-content-no-padding",e.disableHeaderPadding).Build()}function c(){return new Ke("sf-content-footer").AddClass("sf-content-no-padding",e.disableFooterPadding).Build()}return(k,I)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(n()),style:l.normalizeStyle(e.style)},[l.createElementVNode("div",{class:l.normalizeClass(s())},[l.renderSlot(k.$slots,"header")],2),l.createElementVNode("div",{class:l.normalizeClass(o())},[l.renderSlot(k.$slots,"default"),l.createVNode($a)],2),l.createElementVNode("div",{class:l.normalizeClass(c())},[l.renderSlot(k.$slots,"footer")],2)],6))}}),Va={class:"sf-tab-navigation"},ja=[l.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)],za=["data-active"],Wa=["href","onClick"],qa=[l.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})],-1)],Ka=l.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(t){const e=t,n=l.ref(null),o=new ResizeObserver(d=>{I()}),s=l.ref(!1),c=l.ref(!1);function k(d=!1){const U=n.value.clientWidth;n.value.scrollLeft+=d?-U:U}function I(){const d=n.value.scrollWidth-n.value.clientWidth;s.value=n.value.scrollLeft>10,c.value=n.value.scrollLeft<d-10}return l.onMounted(()=>{n.value.addEventListener("scroll",I),o.observe(n.value)}),l.onBeforeUnmount(()=>{var d;try{(d=n.value)==null||d.removeEventListener("scroll",I),o.unobserve(n.value),o.disconnect()}catch{}}),(d,U)=>{const W=l.resolveComponent("RouterLink");return l.openBlock(),l.createElementBlock("div",Va,[l.createElementVNode("div",{class:l.normalizeClass(["left-arrow",{active:s.value}]),onClick:U[0]||(U[0]=J=>k(!0))},ja,2),l.createElementVNode("ul",{ref_key:"trackerContainer",ref:n},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.tabs,J=>(l.openBlock(),l.createBlock(W,{to:J.route,custom:!0},{default:l.withCtx(({navigate:le,isActive:z})=>[l.createElementVNode("li",{"data-active":z},[l.renderSlot(d.$slots,"item",{item:J,navigate:le,isActive:z},()=>[l.createElementVNode("a",{href:J.route,class:l.normalizeClass({active:z}),onClick:le},l.toDisplayString(J.text),11,Wa)])],8,za)]),_:2},1032,["to"]))),256))],512),l.createElementVNode("div",{class:l.normalizeClass(["right-arrow",{active:c.value}]),onClick:U[1]||(U[1]=J=>k())},qa,2)])}}}),Ga=["id","name","disabled","data-color","form","type"],Ya={class:"sf-button-label"},Ja=l.defineComponent({__name:"Button",props:{icon:{},visible:{type:Boolean,default:!0},class:{},style:{},disabled:{type:Boolean},loading:{type:Boolean},color:{default:"primary"},size:{default:"md"},variant:{default:"filled"},autofocus:{type:Boolean},form:{},name:{},id:{},type:{default:"button"},value:{}},setup(t){const e=t;function n(){return new Ke(`${e.class??""} sf-button`).AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).AddClass("sf-button-small",e.size==="sm").AddClass("sf-button-medium",e.size==="md").AddClass("sf-button-large",e.size==="lg").AddClass("sf-button-filled",e.variant==="filled").AddClass("sf-button-text",e.variant==="text").AddClass("sf-button-outlined",e.variant==="outlined").AddClass("sf-button-with-icon",!!e.icon).AddClass("sf-ripple").Build()}return(o,s)=>(l.openBlock(),l.createElementBlock("button",{id:e.id,name:e.name,class:l.normalizeClass(n()),style:l.normalizeStyle(e.style),disabled:e.disabled||e.loading,"data-color":e.color,form:e.form,type:e.type},[e.icon?(l.openBlock(),l.createBlock(ut,{key:0,icone:e.icon,loading:e.loading,size:e.size,"button-props":{tabindex:-1}},null,8,["icone","loading","size"])):e.loading?(l.openBlock(),l.createBlock(ut,{key:1,loading:!0,size:e.size,"button-props":{tabindex:-1}},null,8,["size"])):l.createCommentVNode("",!0),l.createElementVNode("span",Ya,[l.renderSlot(o.$slots,"default")])],14,Ga))}});var Xa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Za(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Qa(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function o(){return this instanceof o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:function(){return t[o]}})}),n}var Ut={};Ut.byteLength=nl,Ut.toByteArray=rl,Ut.fromByteArray=al;for(var Ie=[],xe=[],el=typeof Uint8Array<"u"?Uint8Array:Array,wn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",nt=0,tl=wn.length;nt<tl;++nt)Ie[nt]=wn[nt],xe[wn.charCodeAt(nt)]=nt;xe["-".charCodeAt(0)]=62,xe["_".charCodeAt(0)]=63;function Oo(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var o=n===e?0:4-n%4;return[n,o]}function nl(t){var e=Oo(t),n=e[0],o=e[1];return(n+o)*3/4-o}function ol(t,e,n){return(e+n)*3/4-n}function rl(t){var e,n=Oo(t),o=n[0],s=n[1],c=new el(ol(t,o,s)),k=0,I=s>0?o-4:o,d;for(d=0;d<I;d+=4)e=xe[t.charCodeAt(d)]<<18|xe[t.charCodeAt(d+1)]<<12|xe[t.charCodeAt(d+2)]<<6|xe[t.charCodeAt(d+3)],c[k++]=e>>16&255,c[k++]=e>>8&255,c[k++]=e&255;return s===2&&(e=xe[t.charCodeAt(d)]<<2|xe[t.charCodeAt(d+1)]>>4,c[k++]=e&255),s===1&&(e=xe[t.charCodeAt(d)]<<10|xe[t.charCodeAt(d+1)]<<4|xe[t.charCodeAt(d+2)]>>2,c[k++]=e>>8&255,c[k++]=e&255),c}function il(t){return Ie[t>>18&63]+Ie[t>>12&63]+Ie[t>>6&63]+Ie[t&63]}function sl(t,e,n){for(var o,s=[],c=e;c<n;c+=3)o=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(t[c+2]&255),s.push(il(o));return s.join("")}function al(t){for(var e,n=t.length,o=n%3,s=[],c=16383,k=0,I=n-o;k<I;k+=c)s.push(sl(t,k,k+c>I?I:k+c));return o===1?(e=t[n-1],s.push(Ie[e>>2]+Ie[e<<4&63]+"==")):o===2&&(e=(t[n-2]<<8)+t[n-1],s.push(Ie[e>>10]+Ie[e>>4&63]+Ie[e<<2&63]+"=")),s.join("")}var Fo={exports:{}};const Mo=Qa(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));/**
|
|
68
68
|
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
69
69
|
*
|
|
70
70
|
* @version 0.10.1
|
|
71
71
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
72
72
|
* @copyright Chen, Yi-Cyuan 2014-2023
|
|
73
73
|
* @license MIT
|
|
74
|
-
*/(function(t){(function(){var e="input is invalid type",n=typeof window=="object",o=n?window:{};o.JS_SHA256_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",c=!o.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;c?o=Xa:s&&(o=self);var A=!o.JS_SHA256_NO_COMMON_JS&&!0&&t.exports,I=!o.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",d="0123456789abcdef".split(""),U=[-2147483648,8388608,32768,128],W=[24,16,8,0],J=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],le=["hex","array","digest","arrayBuffer"],z=[];(o.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(h){return Object.prototype.toString.call(h)==="[object Array]"}),I&&(o.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(h){return typeof h=="object"&&h.buffer&&h.buffer.constructor===ArrayBuffer});var Re=function(h,_){return function(P){return new $(_,!0).update(P)[h]()}},ot=function(h){var _=Re("hex",h);c&&(_=ke(_,h)),_.create=function(){return new $(h)},_.update=function(k){return _.create().update(k)};for(var P=0;P<le.length;++P){var C=le[P];_[C]=Re(C,h)}return _},ke=function(h,_){var P=Mo,C=Mo.Buffer,k=_?"sha224":"sha256",v;C.from&&!o.JS_SHA256_NO_BUFFER_FROM?v=C.from:v=function(m){return new C(m)};var O=function(m){if(typeof m=="string")return P.createHash(k).update(m,"utf8").digest("hex");if(m==null)throw new Error(e);return m.constructor===ArrayBuffer&&(m=new Uint8Array(m)),Array.isArray(m)||ArrayBuffer.isView(m)||m.constructor===C?P.createHash(k).update(v(m)).digest("hex"):h(m)};return O},rt=function(h,_){return function(P,C){return new _e(P,_,!0).update(C)[h]()}},he=function(h){var _=rt("hex",h);_.create=function(k){return new _e(k,h)},_.update=function(k,v){return _.create(k).update(v)};for(var P=0;P<le.length;++P){var C=le[P];_[C]=rt(C,h)}return _};function $(h,_){_?(z[0]=z[16]=z[1]=z[2]=z[3]=z[4]=z[5]=z[6]=z[7]=z[8]=z[9]=z[10]=z[11]=z[12]=z[13]=z[14]=z[15]=0,this.blocks=z):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=h}$.prototype.update=function(h){if(!this.finalized){var _,P=typeof h;if(P!=="string"){if(P==="object"){if(h===null)throw new Error(e);if(I&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!Array.isArray(h)&&(!I||!ArrayBuffer.isView(h)))throw new Error(e)}else throw new Error(e);_=!0}for(var C,k=0,v,O=h.length,m=this.blocks;k<O;){if(this.hashed&&(this.hashed=!1,m[0]=this.block,m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0),_)for(v=this.start;k<O&&v<64;++k)m[v>>2]|=h[k]<<W[v++&3];else for(v=this.start;k<O&&v<64;++k)C=h.charCodeAt(k),C<128?m[v>>2]|=C<<W[v++&3]:C<2048?(m[v>>2]|=(192|C>>6)<<W[v++&3],m[v>>2]|=(128|C&63)<<W[v++&3]):C<55296||C>=57344?(m[v>>2]|=(224|C>>12)<<W[v++&3],m[v>>2]|=(128|C>>6&63)<<W[v++&3],m[v>>2]|=(128|C&63)<<W[v++&3]):(C=65536+((C&1023)<<10|h.charCodeAt(++k)&1023),m[v>>2]|=(240|C>>18)<<W[v++&3],m[v>>2]|=(128|C>>12&63)<<W[v++&3],m[v>>2]|=(128|C>>6&63)<<W[v++&3],m[v>>2]|=(128|C&63)<<W[v++&3]);this.lastByteIndex=v,this.bytes+=v-this.start,v>=64?(this.block=m[16],this.start=v-64,this.hash(),this.hashed=!0):this.start=v}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},$.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var h=this.blocks,_=this.lastByteIndex;h[16]=this.block,h[_>>2]|=U[_&3],this.block=h[16],_>=56&&(this.hashed||this.hash(),h[0]=this.block,h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),h[14]=this.hBytes<<3|this.bytes>>>29,h[15]=this.bytes<<3,this.hash()}},$.prototype.hash=function(){var h=this.h0,_=this.h1,P=this.h2,C=this.h3,k=this.h4,v=this.h5,O=this.h6,m=this.h7,F=this.blocks,q,X,Y,ce,B,pe,r,a,f,b,p;for(q=16;q<64;++q)B=F[q-15],X=(B>>>7|B<<25)^(B>>>18|B<<14)^B>>>3,B=F[q-2],Y=(B>>>17|B<<15)^(B>>>19|B<<13)^B>>>10,F[q]=F[q-16]+X+F[q-7]+Y<<0;for(p=_&P,q=0;q<64;q+=4)this.first?(this.is224?(a=300032,B=F[0]-1413257819,m=B-150054599<<0,C=B+24177077<<0):(a=704751109,B=F[0]-210244248,m=B-1521486534<<0,C=B+143694565<<0),this.first=!1):(X=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),Y=(k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7),a=h&_,ce=a^h&P^p,r=k&v^~k&O,B=m+Y+r+J[q]+F[q],pe=X+ce,m=C+B<<0,C=B+pe<<0),X=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),Y=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),f=C&h,ce=f^C&_^a,r=m&k^~m&v,B=O+Y+r+J[q+1]+F[q+1],pe=X+ce,O=P+B<<0,P=B+pe<<0,X=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),Y=(O>>>6|O<<26)^(O>>>11|O<<21)^(O>>>25|O<<7),b=P&C,ce=b^P&h^f,r=O&m^~O&k,B=v+Y+r+J[q+2]+F[q+2],pe=X+ce,v=_+B<<0,_=B+pe<<0,X=(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10),Y=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),p=_&P,ce=p^_&C^b,r=v&O^~v&m,B=k+Y+r+J[q+3]+F[q+3],pe=X+ce,k=h+B<<0,h=B+pe<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+h<<0,this.h1=this.h1+_<<0,this.h2=this.h2+P<<0,this.h3=this.h3+C<<0,this.h4=this.h4+k<<0,this.h5=this.h5+v<<0,this.h6=this.h6+O<<0,this.h7=this.h7+m<<0},$.prototype.hex=function(){this.finalize();var h=this.h0,_=this.h1,P=this.h2,C=this.h3,k=this.h4,v=this.h5,O=this.h6,m=this.h7,F=d[h>>28&15]+d[h>>24&15]+d[h>>20&15]+d[h>>16&15]+d[h>>12&15]+d[h>>8&15]+d[h>>4&15]+d[h&15]+d[_>>28&15]+d[_>>24&15]+d[_>>20&15]+d[_>>16&15]+d[_>>12&15]+d[_>>8&15]+d[_>>4&15]+d[_&15]+d[P>>28&15]+d[P>>24&15]+d[P>>20&15]+d[P>>16&15]+d[P>>12&15]+d[P>>8&15]+d[P>>4&15]+d[P&15]+d[C>>28&15]+d[C>>24&15]+d[C>>20&15]+d[C>>16&15]+d[C>>12&15]+d[C>>8&15]+d[C>>4&15]+d[C&15]+d[k>>28&15]+d[k>>24&15]+d[k>>20&15]+d[k>>16&15]+d[k>>12&15]+d[k>>8&15]+d[k>>4&15]+d[k&15]+d[v>>28&15]+d[v>>24&15]+d[v>>20&15]+d[v>>16&15]+d[v>>12&15]+d[v>>8&15]+d[v>>4&15]+d[v&15]+d[O>>28&15]+d[O>>24&15]+d[O>>20&15]+d[O>>16&15]+d[O>>12&15]+d[O>>8&15]+d[O>>4&15]+d[O&15];return this.is224||(F+=d[m>>28&15]+d[m>>24&15]+d[m>>20&15]+d[m>>16&15]+d[m>>12&15]+d[m>>8&15]+d[m>>4&15]+d[m&15]),F},$.prototype.toString=$.prototype.hex,$.prototype.digest=function(){this.finalize();var h=this.h0,_=this.h1,P=this.h2,C=this.h3,k=this.h4,v=this.h5,O=this.h6,m=this.h7,F=[h>>24&255,h>>16&255,h>>8&255,h&255,_>>24&255,_>>16&255,_>>8&255,_&255,P>>24&255,P>>16&255,P>>8&255,P&255,C>>24&255,C>>16&255,C>>8&255,C&255,k>>24&255,k>>16&255,k>>8&255,k&255,v>>24&255,v>>16&255,v>>8&255,v&255,O>>24&255,O>>16&255,O>>8&255,O&255];return this.is224||F.push(m>>24&255,m>>16&255,m>>8&255,m&255),F},$.prototype.array=$.prototype.digest,$.prototype.arrayBuffer=function(){this.finalize();var h=new ArrayBuffer(this.is224?28:32),_=new DataView(h);return _.setUint32(0,this.h0),_.setUint32(4,this.h1),_.setUint32(8,this.h2),_.setUint32(12,this.h3),_.setUint32(16,this.h4),_.setUint32(20,this.h5),_.setUint32(24,this.h6),this.is224||_.setUint32(28,this.h7),h};function _e(h,_,P){var C,k=typeof h;if(k==="string"){var v=[],O=h.length,m=0,F;for(C=0;C<O;++C)F=h.charCodeAt(C),F<128?v[m++]=F:F<2048?(v[m++]=192|F>>6,v[m++]=128|F&63):F<55296||F>=57344?(v[m++]=224|F>>12,v[m++]=128|F>>6&63,v[m++]=128|F&63):(F=65536+((F&1023)<<10|h.charCodeAt(++C)&1023),v[m++]=240|F>>18,v[m++]=128|F>>12&63,v[m++]=128|F>>6&63,v[m++]=128|F&63);h=v}else if(k==="object"){if(h===null)throw new Error(e);if(I&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!Array.isArray(h)&&(!I||!ArrayBuffer.isView(h)))throw new Error(e)}else throw new Error(e);h.length>64&&(h=new $(_,!0).update(h).array());var q=[],X=[];for(C=0;C<64;++C){var Y=h[C]||0;q[C]=92^Y,X[C]=54^Y}$.call(this,_,P),this.update(X),this.oKeyPad=q,this.inner=!0,this.sharedMemory=P}_e.prototype=new $,_e.prototype.finalize=function(){if($.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();$.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(h),$.prototype.finalize.call(this)}};var Z=ot();Z.sha256=Z,Z.sha224=ot(!0),Z.sha256.hmac=he(),Z.sha224.hmac=he(!0),A?t.exports=Z:(o.sha256=Z.sha256,o.sha224=Z.sha224)})()})(Fo);var ll=Fo.exports;const cl=Za(ll);class Ct extends Error{}Ct.prototype.name="InvalidTokenError";function ul(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let o=n.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function dl(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ul(e)}catch{return atob(e)}}function vn(t,e){if(typeof t!="string")throw new Ct("Invalid token specified: must be a string");e||(e={});const n=e.header===!0?0:1,o=t.split(".")[n];if(typeof o!="string")throw new Ct(`Invalid token specified: missing part #${n+1}`);let s;try{s=dl(o)}catch(c){throw new Ct(`Invalid token specified: invalid base64 for part #${n+1} (${c.message})`)}try{return JSON.parse(s)}catch(c){throw new Ct(`Invalid token specified: invalid json for part #${n+1} (${c.message})`)}}if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function No(t){if(!(this instanceof No))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var e=this,n,o=[],s,c={enable:!0,callbackList:[],interval:5},A=document.getElementsByTagName("script"),I=0;I<A.length;I++)(A[I].src.indexOf("keycloak.js")!==-1||A[I].src.indexOf("keycloak.min.js")!==-1)&&A[I].src.indexOf("version=")!==-1&&(e.iframeVersion=A[I].src.substring(A[I].src.indexOf("version=")+8).split("&")[0]);var d=!0,U=pe(console.info),W=pe(console.warn);e.init=function(r){if(e.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");e.didInitialize=!0,e.authenticated=!1,s=B();var a=["default","cordova","cordova-native"];if(r&&a.indexOf(r.adapter)>-1?n=X(r.adapter):r&&typeof r.adapter=="object"?n=r.adapter:window.Cordova||window.cordova?n=X("cordova"):n=X(),r){if(typeof r.useNonce<"u"&&(d=r.useNonce),typeof r.checkLoginIframe<"u"&&(c.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(c.interval=r.checkLoginIframeInterval),r.onLoad==="login-required"&&(e.loginRequired=!0),r.responseMode)if(r.responseMode==="query"||r.responseMode==="fragment")e.responseMode=r.responseMode;else throw"Invalid value for responseMode";if(r.flow){switch(r.flow){case"standard":e.responseType="code";break;case"implicit":e.responseType="id_token token";break;case"hybrid":e.responseType="code id_token token";break;default:throw"Invalid value for flow"}e.flow=r.flow}if(r.timeSkew!=null&&(e.timeSkew=r.timeSkew),r.redirectUri&&(e.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(e.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),typeof r.silentCheckSsoFallback=="boolean"?e.silentCheckSsoFallback=r.silentCheckSsoFallback:e.silentCheckSsoFallback=!0,r.pkceMethod){if(r.pkceMethod!=="S256")throw"Invalid value for pkceMethod";e.pkceMethod=r.pkceMethod}typeof r.enableLogging=="boolean"?e.enableLogging=r.enableLogging:e.enableLogging=!1,typeof r.scope=="string"&&(e.scope=r.scope),typeof r.acrValues=="string"&&(e.acrValues=r.acrValues),typeof r.messageReceiveTimeout=="number"&&r.messageReceiveTimeout>0?e.messageReceiveTimeout=r.messageReceiveTimeout:e.messageReceiveTimeout=1e4}e.responseMode||(e.responseMode="fragment"),e.responseType||(e.responseType="code",e.flow="standard");var f=k(),b=k();b.promise.then(function(){e.onReady&&e.onReady(e.authenticated),f.setSuccess(e.authenticated)}).catch(function(S){f.setError(S)});var p=$();function E(){var S=function(H){H||(R.prompt="none"),r&&r.locale&&(R.locale=r.locale),e.login(R).then(function(){b.setSuccess()}).catch(function(me){b.setError(me)})},x=function(){var H=document.createElement("iframe"),me=e.createLoginUrl({prompt:"none",redirectUri:e.silentCheckSsoRedirectUri});H.setAttribute("src",me),H.setAttribute("sandbox","allow-scripts allow-same-origin"),H.setAttribute("title","keycloak-silent-check-sso"),H.style.display="none",document.body.appendChild(H);var ue=function(te){if(!(te.origin!==window.location.origin||H.contentWindow!==te.source)){var Pe=_(te.data);he(Pe,b),document.body.removeChild(H),window.removeEventListener("message",ue)}};window.addEventListener("message",ue)},R={};switch(r.onLoad){case"check-sso":c.enable?O().then(function(){F().then(function(H){H?b.setSuccess():e.silentCheckSsoRedirectUri?x():S(!1)}).catch(function(H){b.setError(H)})}):e.silentCheckSsoRedirectUri?x():S(!1);break;case"login-required":S(!0);break;default:throw"Invalid value for onLoad"}}function g(){var S=_(window.location.href);if(S&&window.history.replaceState(window.history.state,null,S.newUrl),S&&S.valid)return O().then(function(){he(S,b)}).catch(function(x){b.setError(x)});r?r.token&&r.refreshToken?(Z(r.token,r.refreshToken,r.idToken),c.enable?O().then(function(){F().then(function(x){x?(e.onAuthSuccess&&e.onAuthSuccess(),b.setSuccess(),m()):b.setSuccess()}).catch(function(x){b.setError(x)})}):e.updateToken(-1).then(function(){e.onAuthSuccess&&e.onAuthSuccess(),b.setSuccess()}).catch(function(x){e.onAuthError&&e.onAuthError(),r.onLoad?E():b.setError(x)})):r.onLoad?E():b.setSuccess():b.setSuccess()}function y(){var S=k(),x=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",x),S.setSuccess())};return document.addEventListener("readystatechange",x),x(),S.promise}return p.then(function(){y().then(q).then(g).catch(function(S){f.setError(S)})}),p.catch(function(S){f.setError(S)}),f.promise},e.login=function(r){return n.login(r)};function J(r){var a=null,f=window.crypto||window.msCrypto;if(f&&f.getRandomValues&&window.Uint8Array)return a=new Uint8Array(r),f.getRandomValues(a),a;a=new Array(r);for(var b=0;b<a.length;b++)a[b]=Math.floor(256*Math.random());return a}function le(r){return z(r,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function z(r,a){for(var f=J(r),b=new Array(r),p=0;p<r;p++)b[p]=a.charCodeAt(f[p]%a.length);return String.fromCharCode.apply(null,b)}function Re(r,a){switch(r){case"S256":var f=new Uint8Array(cl.arrayBuffer(a)),b=Ut.fromByteArray(f).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function ot(r){var a={id_token:{acr:r}};return JSON.stringify(a)}e.createLoginUrl=function(r){var a=h(),f=h(),b=n.redirectUri(r),p={state:a,nonce:f,redirectUri:encodeURIComponent(b)};r&&r.prompt&&(p.prompt=r.prompt);var E;r&&r.action=="register"?E=e.endpoints.register():E=e.endpoints.authorize();var g=r&&r.scope||e.scope;g?g.indexOf("openid")===-1&&(g="openid "+g):g="openid";var y=E+"?client_id="+encodeURIComponent(e.clientId)+"&redirect_uri="+encodeURIComponent(b)+"&state="+encodeURIComponent(a)+"&response_mode="+encodeURIComponent(e.responseMode)+"&response_type="+encodeURIComponent(e.responseType)+"&scope="+encodeURIComponent(g);if(d&&(y=y+"&nonce="+encodeURIComponent(f)),r&&r.prompt&&(y+="&prompt="+encodeURIComponent(r.prompt)),r&&r.maxAge&&(y+="&max_age="+encodeURIComponent(r.maxAge)),r&&r.loginHint&&(y+="&login_hint="+encodeURIComponent(r.loginHint)),r&&r.idpHint&&(y+="&kc_idp_hint="+encodeURIComponent(r.idpHint)),r&&r.action&&r.action!="register"&&(y+="&kc_action="+encodeURIComponent(r.action)),r&&r.locale&&(y+="&ui_locales="+encodeURIComponent(r.locale)),r&&r.acr){var S=ot(r.acr);y+="&claims="+encodeURIComponent(S)}if((r&&r.acrValues||e.acrValues)&&(y+="&acr_values="+encodeURIComponent(r.acrValues||e.acrValues)),e.pkceMethod){var x=le(96);p.pkceCodeVerifier=x;var R=Re(e.pkceMethod,x);y+="&code_challenge="+R,y+="&code_challenge_method="+e.pkceMethod}return s.add(p),y},e.logout=function(r){return n.logout(r)},e.createLogoutUrl=function(r){var a=e.endpoints.logout()+"?client_id="+encodeURIComponent(e.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(n.redirectUri(r,!1));return e.idToken&&(a+="&id_token_hint="+encodeURIComponent(e.idToken)),a},e.register=function(r){return n.register(r)},e.createRegisterUrl=function(r){return r||(r={}),r.action="register",e.createLoginUrl(r)},e.createAccountUrl=function(r){var a=ke(),f=void 0;return typeof a<"u"&&(f=a+"/account?referrer="+encodeURIComponent(e.clientId)+"&referrer_uri="+encodeURIComponent(n.redirectUri(r))),f},e.accountManagement=function(){return n.accountManagement()},e.hasRealmRole=function(r){var a=e.realmAccess;return!!a&&a.roles.indexOf(r)>=0},e.hasResourceRole=function(r,a){if(!e.resourceAccess)return!1;var f=e.resourceAccess[a||e.clientId];return!!f&&f.roles.indexOf(r)>=0},e.loadUserProfile=function(){var r=ke()+"/account",a=new XMLHttpRequest;a.open("GET",r,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+e.token);var f=k();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(e.profile=JSON.parse(a.responseText),f.setSuccess(e.profile)):f.setError())},a.send(),f.promise},e.loadUserInfo=function(){var r=e.endpoints.userinfo(),a=new XMLHttpRequest;a.open("GET",r,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+e.token);var f=k();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(e.userInfo=JSON.parse(a.responseText),f.setSuccess(e.userInfo)):f.setError())},a.send(),f.promise},e.isTokenExpired=function(r){if(!e.tokenParsed||!e.refreshToken&&e.flow!="implicit")throw"Not authenticated";if(e.timeSkew==null)return U("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var a=e.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+e.timeSkew;if(r){if(isNaN(r))throw"Invalid minValidity";a-=r}return a<0},e.updateToken=function(r){var a=k();if(!e.refreshToken)return a.setError(),a.promise;r=r||5;var f=function(){var p=!1;if(r==-1?(p=!0,U("[KEYCLOAK] Refreshing token: forced refresh")):(!e.tokenParsed||e.isTokenExpired(r))&&(p=!0,U("[KEYCLOAK] Refreshing token: token expired")),!p)a.setSuccess(!1);else{var E="grant_type=refresh_token&refresh_token="+e.refreshToken,g=e.endpoints.token();if(o.push(a),o.length==1){var y=new XMLHttpRequest;y.open("POST",g,!0),y.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y.withCredentials=!0,E+="&client_id="+encodeURIComponent(e.clientId);var S=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){U("[KEYCLOAK] Token refreshed"),S=(S+new Date().getTime())/2;var x=JSON.parse(y.responseText);Z(x.access_token,x.refresh_token,x.id_token,S),e.onAuthRefreshSuccess&&e.onAuthRefreshSuccess();for(var R=o.pop();R!=null;R=o.pop())R.setSuccess(!0)}else{W("[KEYCLOAK] Failed to refresh token"),y.status==400&&e.clearToken(),e.onAuthRefreshError&&e.onAuthRefreshError();for(var R=o.pop();R!=null;R=o.pop())R.setError(!0)}},y.send(E)}}};if(c.enable){var b=F();b.then(function(){f()}).catch(function(p){a.setError(p)})}else f();return a.promise},e.clearToken=function(){e.token&&(Z(null,null,null),e.onAuthLogout&&e.onAuthLogout(),e.loginRequired&&e.login())},e.setToken=Z;function ke(){if(typeof e.authServerUrl<"u")return e.authServerUrl.charAt(e.authServerUrl.length-1)=="/"?e.authServerUrl+"realms/"+encodeURIComponent(e.realm):e.authServerUrl+"/realms/"+encodeURIComponent(e.realm)}function rt(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function he(r,a){var f=r.code,b=r.error,p=r.prompt,E=new Date().getTime();if(r.kc_action_status&&e.onActionUpdate&&e.onActionUpdate(r.kc_action_status),b){if(p!="none"){var g={error:b,error_description:r.error_description};e.onAuthError&&e.onAuthError(g),a&&a.setError(g)}else a&&a.setSuccess();return}else e.flow!="standard"&&(r.access_token||r.id_token)&&R(r.access_token,null,r.id_token,!0);if(e.flow!="implicit"&&f){var y="code="+f+"&grant_type=authorization_code",S=e.endpoints.token(),x=new XMLHttpRequest;x.open("POST",S,!0),x.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y+="&client_id="+encodeURIComponent(e.clientId),y+="&redirect_uri="+r.redirectUri,r.pkceCodeVerifier&&(y+="&code_verifier="+r.pkceCodeVerifier),x.withCredentials=!0,x.onreadystatechange=function(){if(x.readyState==4)if(x.status==200){var H=JSON.parse(x.responseText);R(H.access_token,H.refresh_token,H.id_token,e.flow==="standard"),m()}else e.onAuthError&&e.onAuthError(),a&&a.setError()},x.send(y)}function R(H,me,ue,te){E=(E+new Date().getTime())/2,Z(H,me,ue,E),d&&(e.tokenParsed&&e.tokenParsed.nonce!=r.storedNonce||e.refreshTokenParsed&&e.refreshTokenParsed.nonce!=r.storedNonce||e.idTokenParsed&&e.idTokenParsed.nonce!=r.storedNonce)?(U("[KEYCLOAK] Invalid nonce, clearing token"),e.clearToken(),a&&a.setError()):te&&(e.onAuthSuccess&&e.onAuthSuccess(),a&&a.setSuccess())}}function $(r){var a=k(),f;t?typeof t=="string"&&(f=t):f=location.origin+"/keycloak.json";function b(x){x?e.endpoints={authorize:function(){return x.authorization_endpoint},token:function(){return x.token_endpoint},logout:function(){if(!x.end_session_endpoint)throw"Not supported by the OIDC server";return x.end_session_endpoint},checkSessionIframe:function(){if(!x.check_session_iframe)throw"Not supported by the OIDC server";return x.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!x.userinfo_endpoint)throw"Not supported by the OIDC server";return x.userinfo_endpoint}}:e.endpoints={authorize:function(){return ke()+"/protocol/openid-connect/auth"},token:function(){return ke()+"/protocol/openid-connect/token"},logout:function(){return ke()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var R=ke()+"/protocol/openid-connect/login-status-iframe.html";return e.iframeVersion&&(R=R+"?version="+e.iframeVersion),R},thirdPartyCookiesIframe:function(){var R=ke()+"/protocol/openid-connect/3p-cookies/step1.html";return e.iframeVersion&&(R=R+"?version="+e.iframeVersion),R},register:function(){return ke()+"/protocol/openid-connect/registrations"},userinfo:function(){return ke()+"/protocol/openid-connect/userinfo"}}}if(f){var p=new XMLHttpRequest;p.open("GET",f,!0),p.setRequestHeader("Accept","application/json"),p.onreadystatechange=function(){if(p.readyState==4)if(p.status==200||_e(p)){var x=JSON.parse(p.responseText);e.authServerUrl=x["auth-server-url"],e.realm=x.realm,e.clientId=x.resource,b(null),a.setSuccess()}else a.setError()},p.send()}else{if(!t.clientId)throw"clientId missing";e.clientId=t.clientId;var E=t.oidcProvider;if(E)if(typeof E=="string"){var S;E.charAt(E.length-1)=="/"?S=E+".well-known/openid-configuration":S=E+"/.well-known/openid-configuration";var p=new XMLHttpRequest;p.open("GET",S,!0),p.setRequestHeader("Accept","application/json"),p.onreadystatechange=function(){if(p.readyState==4)if(p.status==200||_e(p)){var R=JSON.parse(p.responseText);b(R),a.setSuccess()}else a.setError()},p.send()}else b(E),a.setSuccess();else{if(!t.url){for(var g=document.getElementsByTagName("script"),y=0;y<g.length;y++)if(g[y].src.match(/.*keycloak\.js/)){t.url=g[y].src.substr(0,g[y].src.indexOf("/js/keycloak.js"));break}}if(!t.realm)throw"realm missing";e.authServerUrl=t.url,e.realm=t.realm,b(null),a.setSuccess()}}return a.promise}function _e(r){return r.status==0&&r.responseText&&r.responseURL.startsWith("file:")}function Z(r,a,f,b){if(e.tokenTimeoutHandle&&(clearTimeout(e.tokenTimeoutHandle),e.tokenTimeoutHandle=null),a?(e.refreshToken=a,e.refreshTokenParsed=vn(a)):(delete e.refreshToken,delete e.refreshTokenParsed),f?(e.idToken=f,e.idTokenParsed=vn(f)):(delete e.idToken,delete e.idTokenParsed),r){if(e.token=r,e.tokenParsed=vn(r),e.sessionId=e.tokenParsed.session_state,e.authenticated=!0,e.subject=e.tokenParsed.sub,e.realmAccess=e.tokenParsed.realm_access,e.resourceAccess=e.tokenParsed.resource_access,b&&(e.timeSkew=Math.floor(b/1e3)-e.tokenParsed.iat),e.timeSkew!=null&&(U("[KEYCLOAK] Estimated time difference between browser and server is "+e.timeSkew+" seconds"),e.onTokenExpired)){var p=(e.tokenParsed.exp-new Date().getTime()/1e3+e.timeSkew)*1e3;U("[KEYCLOAK] Token expires in "+Math.round(p/1e3)+" s"),p<=0?e.onTokenExpired():e.tokenTimeoutHandle=setTimeout(e.onTokenExpired,p)}}else delete e.token,delete e.tokenParsed,delete e.subject,delete e.realmAccess,delete e.resourceAccess,e.authenticated=!1}function h(){var r="0123456789abcdef",a=z(36,r).split("");a[14]="4",a[19]=r.substr(a[19]&3|8,1),a[8]=a[13]=a[18]=a[23]="-";var f=a.join("");return f}function _(r){var a=P(r);if(a){var f=s.get(a.state);return f&&(a.valid=!0,a.redirectUri=f.redirectUri,a.storedNonce=f.nonce,a.prompt=f.prompt,a.pkceCodeVerifier=f.pkceCodeVerifier),a}}function P(r){var a;switch(e.flow){case"standard":a=["code","state","session_state","kc_action_status","iss"];break;case"implicit":a=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":a=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}a.push("error"),a.push("error_description"),a.push("error_uri");var f=r.indexOf("?"),b=r.indexOf("#"),p,E;if(e.responseMode==="query"&&f!==-1?(p=r.substring(0,f),E=C(r.substring(f+1,b!==-1?b:r.length),a),E.paramsString!==""&&(p+="?"+E.paramsString),b!==-1&&(p+=r.substring(b))):e.responseMode==="fragment"&&b!==-1&&(p=r.substring(0,b),E=C(r.substring(b+1),a),E.paramsString!==""&&(p+="#"+E.paramsString)),E&&E.oauthParams){if(e.flow==="standard"||e.flow==="hybrid"){if((E.oauthParams.code||E.oauthParams.error)&&E.oauthParams.state)return E.oauthParams.newUrl=p,E.oauthParams}else if(e.flow==="implicit"&&(E.oauthParams.access_token||E.oauthParams.error)&&E.oauthParams.state)return E.oauthParams.newUrl=p,E.oauthParams}}function C(r,a){for(var f=r.split("&"),b={paramsString:"",oauthParams:{}},p=0;p<f.length;p++){var E=f[p].indexOf("="),g=f[p].slice(0,E);a.indexOf(g)!==-1?b.oauthParams[g]=f[p].slice(E+1):(b.paramsString!==""&&(b.paramsString+="&"),b.paramsString+=f[p])}return b}function k(){var r={setSuccess:function(a){r.resolve(a)},setError:function(a){r.reject(a)}};return r.promise=new Promise(function(a,f){r.resolve=a,r.reject=f}),r}function v(r,a,f){var b=null,p=new Promise(function(E,g){b=setTimeout(function(){g({error:f||"Promise is not settled within timeout of "+a+"ms"})},a)});return Promise.race([r,p]).finally(function(){clearTimeout(b)})}function O(){var r=k();if(!c.enable||c.iframe)return r.setSuccess(),r.promise;var a=document.createElement("iframe");c.iframe=a,a.onload=function(){var p=e.endpoints.authorize();p.charAt(0)==="/"?c.iframeOrigin=rt():c.iframeOrigin=p.substring(0,p.indexOf("/",8)),r.setSuccess()};var f=e.endpoints.checkSessionIframe();a.setAttribute("src",f),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-session-iframe"),a.style.display="none",document.body.appendChild(a);var b=function(p){if(!(p.origin!==c.iframeOrigin||c.iframe.contentWindow!==p.source)&&(p.data=="unchanged"||p.data=="changed"||p.data=="error")){p.data!="unchanged"&&e.clearToken();for(var E=c.callbackList.splice(0,c.callbackList.length),g=E.length-1;g>=0;--g){var y=E[g];p.data=="error"?y.setError():y.setSuccess(p.data=="unchanged")}}};return window.addEventListener("message",b,!1),r.promise}function m(){c.enable&&e.token&&setTimeout(function(){F().then(function(r){r&&m()})},c.interval*1e3)}function F(){var r=k();if(c.iframe&&c.iframeOrigin){var a=e.clientId+" "+(e.sessionId?e.sessionId:"");c.callbackList.push(r);var f=c.iframeOrigin;c.callbackList.length==1&&c.iframe.contentWindow.postMessage(a,f)}else r.setSuccess();return r.promise}function q(){var r=k();if(c.enable||e.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",e.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var f=function(b){a.contentWindow===b.source&&(b.data!=="supported"&&b.data!=="unsupported"||(b.data==="unsupported"&&(W(`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
74
|
+
*/(function(t){(function(){var e="input is invalid type",n=typeof window=="object",o=n?window:{};o.JS_SHA256_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",c=!o.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;c?o=Xa:s&&(o=self);var k=!o.JS_SHA256_NO_COMMON_JS&&!0&&t.exports,I=!o.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",d="0123456789abcdef".split(""),U=[-2147483648,8388608,32768,128],W=[24,16,8,0],J=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],le=["hex","array","digest","arrayBuffer"],z=[];(o.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(h){return Object.prototype.toString.call(h)==="[object Array]"}),I&&(o.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(h){return typeof h=="object"&&h.buffer&&h.buffer.constructor===ArrayBuffer});var Re=function(h,A){return function(P){return new $(A,!0).update(P)[h]()}},ot=function(h){var A=Re("hex",h);c&&(A=ke(A,h)),A.create=function(){return new $(h)},A.update=function(_){return A.create().update(_)};for(var P=0;P<le.length;++P){var C=le[P];A[C]=Re(C,h)}return A},ke=function(h,A){var P=Mo,C=Mo.Buffer,_=A?"sha224":"sha256",v;C.from&&!o.JS_SHA256_NO_BUFFER_FROM?v=C.from:v=function(m){return new C(m)};var O=function(m){if(typeof m=="string")return P.createHash(_).update(m,"utf8").digest("hex");if(m==null)throw new Error(e);return m.constructor===ArrayBuffer&&(m=new Uint8Array(m)),Array.isArray(m)||ArrayBuffer.isView(m)||m.constructor===C?P.createHash(_).update(v(m)).digest("hex"):h(m)};return O},rt=function(h,A){return function(P,C){return new _e(P,A,!0).update(C)[h]()}},he=function(h){var A=rt("hex",h);A.create=function(_){return new _e(_,h)},A.update=function(_,v){return A.create(_).update(v)};for(var P=0;P<le.length;++P){var C=le[P];A[C]=rt(C,h)}return A};function $(h,A){A?(z[0]=z[16]=z[1]=z[2]=z[3]=z[4]=z[5]=z[6]=z[7]=z[8]=z[9]=z[10]=z[11]=z[12]=z[13]=z[14]=z[15]=0,this.blocks=z):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=h}$.prototype.update=function(h){if(!this.finalized){var A,P=typeof h;if(P!=="string"){if(P==="object"){if(h===null)throw new Error(e);if(I&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!Array.isArray(h)&&(!I||!ArrayBuffer.isView(h)))throw new Error(e)}else throw new Error(e);A=!0}for(var C,_=0,v,O=h.length,m=this.blocks;_<O;){if(this.hashed&&(this.hashed=!1,m[0]=this.block,m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0),A)for(v=this.start;_<O&&v<64;++_)m[v>>2]|=h[_]<<W[v++&3];else for(v=this.start;_<O&&v<64;++_)C=h.charCodeAt(_),C<128?m[v>>2]|=C<<W[v++&3]:C<2048?(m[v>>2]|=(192|C>>6)<<W[v++&3],m[v>>2]|=(128|C&63)<<W[v++&3]):C<55296||C>=57344?(m[v>>2]|=(224|C>>12)<<W[v++&3],m[v>>2]|=(128|C>>6&63)<<W[v++&3],m[v>>2]|=(128|C&63)<<W[v++&3]):(C=65536+((C&1023)<<10|h.charCodeAt(++_)&1023),m[v>>2]|=(240|C>>18)<<W[v++&3],m[v>>2]|=(128|C>>12&63)<<W[v++&3],m[v>>2]|=(128|C>>6&63)<<W[v++&3],m[v>>2]|=(128|C&63)<<W[v++&3]);this.lastByteIndex=v,this.bytes+=v-this.start,v>=64?(this.block=m[16],this.start=v-64,this.hash(),this.hashed=!0):this.start=v}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},$.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var h=this.blocks,A=this.lastByteIndex;h[16]=this.block,h[A>>2]|=U[A&3],this.block=h[16],A>=56&&(this.hashed||this.hash(),h[0]=this.block,h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),h[14]=this.hBytes<<3|this.bytes>>>29,h[15]=this.bytes<<3,this.hash()}},$.prototype.hash=function(){var h=this.h0,A=this.h1,P=this.h2,C=this.h3,_=this.h4,v=this.h5,O=this.h6,m=this.h7,F=this.blocks,q,X,Y,ce,B,pe,r,a,f,b,p;for(q=16;q<64;++q)B=F[q-15],X=(B>>>7|B<<25)^(B>>>18|B<<14)^B>>>3,B=F[q-2],Y=(B>>>17|B<<15)^(B>>>19|B<<13)^B>>>10,F[q]=F[q-16]+X+F[q-7]+Y<<0;for(p=A&P,q=0;q<64;q+=4)this.first?(this.is224?(a=300032,B=F[0]-1413257819,m=B-150054599<<0,C=B+24177077<<0):(a=704751109,B=F[0]-210244248,m=B-1521486534<<0,C=B+143694565<<0),this.first=!1):(X=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),Y=(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7),a=h&A,ce=a^h&P^p,r=_&v^~_&O,B=m+Y+r+J[q]+F[q],pe=X+ce,m=C+B<<0,C=B+pe<<0),X=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),Y=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),f=C&h,ce=f^C&A^a,r=m&_^~m&v,B=O+Y+r+J[q+1]+F[q+1],pe=X+ce,O=P+B<<0,P=B+pe<<0,X=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),Y=(O>>>6|O<<26)^(O>>>11|O<<21)^(O>>>25|O<<7),b=P&C,ce=b^P&h^f,r=O&m^~O&_,B=v+Y+r+J[q+2]+F[q+2],pe=X+ce,v=A+B<<0,A=B+pe<<0,X=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),Y=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),p=A&P,ce=p^A&C^b,r=v&O^~v&m,B=_+Y+r+J[q+3]+F[q+3],pe=X+ce,_=h+B<<0,h=B+pe<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+h<<0,this.h1=this.h1+A<<0,this.h2=this.h2+P<<0,this.h3=this.h3+C<<0,this.h4=this.h4+_<<0,this.h5=this.h5+v<<0,this.h6=this.h6+O<<0,this.h7=this.h7+m<<0},$.prototype.hex=function(){this.finalize();var h=this.h0,A=this.h1,P=this.h2,C=this.h3,_=this.h4,v=this.h5,O=this.h6,m=this.h7,F=d[h>>28&15]+d[h>>24&15]+d[h>>20&15]+d[h>>16&15]+d[h>>12&15]+d[h>>8&15]+d[h>>4&15]+d[h&15]+d[A>>28&15]+d[A>>24&15]+d[A>>20&15]+d[A>>16&15]+d[A>>12&15]+d[A>>8&15]+d[A>>4&15]+d[A&15]+d[P>>28&15]+d[P>>24&15]+d[P>>20&15]+d[P>>16&15]+d[P>>12&15]+d[P>>8&15]+d[P>>4&15]+d[P&15]+d[C>>28&15]+d[C>>24&15]+d[C>>20&15]+d[C>>16&15]+d[C>>12&15]+d[C>>8&15]+d[C>>4&15]+d[C&15]+d[_>>28&15]+d[_>>24&15]+d[_>>20&15]+d[_>>16&15]+d[_>>12&15]+d[_>>8&15]+d[_>>4&15]+d[_&15]+d[v>>28&15]+d[v>>24&15]+d[v>>20&15]+d[v>>16&15]+d[v>>12&15]+d[v>>8&15]+d[v>>4&15]+d[v&15]+d[O>>28&15]+d[O>>24&15]+d[O>>20&15]+d[O>>16&15]+d[O>>12&15]+d[O>>8&15]+d[O>>4&15]+d[O&15];return this.is224||(F+=d[m>>28&15]+d[m>>24&15]+d[m>>20&15]+d[m>>16&15]+d[m>>12&15]+d[m>>8&15]+d[m>>4&15]+d[m&15]),F},$.prototype.toString=$.prototype.hex,$.prototype.digest=function(){this.finalize();var h=this.h0,A=this.h1,P=this.h2,C=this.h3,_=this.h4,v=this.h5,O=this.h6,m=this.h7,F=[h>>24&255,h>>16&255,h>>8&255,h&255,A>>24&255,A>>16&255,A>>8&255,A&255,P>>24&255,P>>16&255,P>>8&255,P&255,C>>24&255,C>>16&255,C>>8&255,C&255,_>>24&255,_>>16&255,_>>8&255,_&255,v>>24&255,v>>16&255,v>>8&255,v&255,O>>24&255,O>>16&255,O>>8&255,O&255];return this.is224||F.push(m>>24&255,m>>16&255,m>>8&255,m&255),F},$.prototype.array=$.prototype.digest,$.prototype.arrayBuffer=function(){this.finalize();var h=new ArrayBuffer(this.is224?28:32),A=new DataView(h);return A.setUint32(0,this.h0),A.setUint32(4,this.h1),A.setUint32(8,this.h2),A.setUint32(12,this.h3),A.setUint32(16,this.h4),A.setUint32(20,this.h5),A.setUint32(24,this.h6),this.is224||A.setUint32(28,this.h7),h};function _e(h,A,P){var C,_=typeof h;if(_==="string"){var v=[],O=h.length,m=0,F;for(C=0;C<O;++C)F=h.charCodeAt(C),F<128?v[m++]=F:F<2048?(v[m++]=192|F>>6,v[m++]=128|F&63):F<55296||F>=57344?(v[m++]=224|F>>12,v[m++]=128|F>>6&63,v[m++]=128|F&63):(F=65536+((F&1023)<<10|h.charCodeAt(++C)&1023),v[m++]=240|F>>18,v[m++]=128|F>>12&63,v[m++]=128|F>>6&63,v[m++]=128|F&63);h=v}else if(_==="object"){if(h===null)throw new Error(e);if(I&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!Array.isArray(h)&&(!I||!ArrayBuffer.isView(h)))throw new Error(e)}else throw new Error(e);h.length>64&&(h=new $(A,!0).update(h).array());var q=[],X=[];for(C=0;C<64;++C){var Y=h[C]||0;q[C]=92^Y,X[C]=54^Y}$.call(this,A,P),this.update(X),this.oKeyPad=q,this.inner=!0,this.sharedMemory=P}_e.prototype=new $,_e.prototype.finalize=function(){if($.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();$.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(h),$.prototype.finalize.call(this)}};var Z=ot();Z.sha256=Z,Z.sha224=ot(!0),Z.sha256.hmac=he(),Z.sha224.hmac=he(!0),k?t.exports=Z:(o.sha256=Z.sha256,o.sha224=Z.sha224)})()})(Fo);var ll=Fo.exports;const cl=Za(ll);class Ct extends Error{}Ct.prototype.name="InvalidTokenError";function ul(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let o=n.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function dl(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return ul(e)}catch{return atob(e)}}function vn(t,e){if(typeof t!="string")throw new Ct("Invalid token specified: must be a string");e||(e={});const n=e.header===!0?0:1,o=t.split(".")[n];if(typeof o!="string")throw new Ct(`Invalid token specified: missing part #${n+1}`);let s;try{s=dl(o)}catch(c){throw new Ct(`Invalid token specified: invalid base64 for part #${n+1} (${c.message})`)}try{return JSON.parse(s)}catch(c){throw new Ct(`Invalid token specified: invalid json for part #${n+1} (${c.message})`)}}if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function No(t){if(!(this instanceof No))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var e=this,n,o=[],s,c={enable:!0,callbackList:[],interval:5},k=document.getElementsByTagName("script"),I=0;I<k.length;I++)(k[I].src.indexOf("keycloak.js")!==-1||k[I].src.indexOf("keycloak.min.js")!==-1)&&k[I].src.indexOf("version=")!==-1&&(e.iframeVersion=k[I].src.substring(k[I].src.indexOf("version=")+8).split("&")[0]);var d=!0,U=pe(console.info),W=pe(console.warn);e.init=function(r){if(e.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");e.didInitialize=!0,e.authenticated=!1,s=B();var a=["default","cordova","cordova-native"];if(r&&a.indexOf(r.adapter)>-1?n=X(r.adapter):r&&typeof r.adapter=="object"?n=r.adapter:window.Cordova||window.cordova?n=X("cordova"):n=X(),r){if(typeof r.useNonce<"u"&&(d=r.useNonce),typeof r.checkLoginIframe<"u"&&(c.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(c.interval=r.checkLoginIframeInterval),r.onLoad==="login-required"&&(e.loginRequired=!0),r.responseMode)if(r.responseMode==="query"||r.responseMode==="fragment")e.responseMode=r.responseMode;else throw"Invalid value for responseMode";if(r.flow){switch(r.flow){case"standard":e.responseType="code";break;case"implicit":e.responseType="id_token token";break;case"hybrid":e.responseType="code id_token token";break;default:throw"Invalid value for flow"}e.flow=r.flow}if(r.timeSkew!=null&&(e.timeSkew=r.timeSkew),r.redirectUri&&(e.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(e.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),typeof r.silentCheckSsoFallback=="boolean"?e.silentCheckSsoFallback=r.silentCheckSsoFallback:e.silentCheckSsoFallback=!0,r.pkceMethod){if(r.pkceMethod!=="S256")throw"Invalid value for pkceMethod";e.pkceMethod=r.pkceMethod}typeof r.enableLogging=="boolean"?e.enableLogging=r.enableLogging:e.enableLogging=!1,typeof r.scope=="string"&&(e.scope=r.scope),typeof r.acrValues=="string"&&(e.acrValues=r.acrValues),typeof r.messageReceiveTimeout=="number"&&r.messageReceiveTimeout>0?e.messageReceiveTimeout=r.messageReceiveTimeout:e.messageReceiveTimeout=1e4}e.responseMode||(e.responseMode="fragment"),e.responseType||(e.responseType="code",e.flow="standard");var f=_(),b=_();b.promise.then(function(){e.onReady&&e.onReady(e.authenticated),f.setSuccess(e.authenticated)}).catch(function(S){f.setError(S)});var p=$();function E(){var S=function(H){H||(R.prompt="none"),r&&r.locale&&(R.locale=r.locale),e.login(R).then(function(){b.setSuccess()}).catch(function(me){b.setError(me)})},x=function(){var H=document.createElement("iframe"),me=e.createLoginUrl({prompt:"none",redirectUri:e.silentCheckSsoRedirectUri});H.setAttribute("src",me),H.setAttribute("sandbox","allow-scripts allow-same-origin"),H.setAttribute("title","keycloak-silent-check-sso"),H.style.display="none",document.body.appendChild(H);var ue=function(te){if(!(te.origin!==window.location.origin||H.contentWindow!==te.source)){var Pe=A(te.data);he(Pe,b),document.body.removeChild(H),window.removeEventListener("message",ue)}};window.addEventListener("message",ue)},R={};switch(r.onLoad){case"check-sso":c.enable?O().then(function(){F().then(function(H){H?b.setSuccess():e.silentCheckSsoRedirectUri?x():S(!1)}).catch(function(H){b.setError(H)})}):e.silentCheckSsoRedirectUri?x():S(!1);break;case"login-required":S(!0);break;default:throw"Invalid value for onLoad"}}function g(){var S=A(window.location.href);if(S&&window.history.replaceState(window.history.state,null,S.newUrl),S&&S.valid)return O().then(function(){he(S,b)}).catch(function(x){b.setError(x)});r?r.token&&r.refreshToken?(Z(r.token,r.refreshToken,r.idToken),c.enable?O().then(function(){F().then(function(x){x?(e.onAuthSuccess&&e.onAuthSuccess(),b.setSuccess(),m()):b.setSuccess()}).catch(function(x){b.setError(x)})}):e.updateToken(-1).then(function(){e.onAuthSuccess&&e.onAuthSuccess(),b.setSuccess()}).catch(function(x){e.onAuthError&&e.onAuthError(),r.onLoad?E():b.setError(x)})):r.onLoad?E():b.setSuccess():b.setSuccess()}function y(){var S=_(),x=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",x),S.setSuccess())};return document.addEventListener("readystatechange",x),x(),S.promise}return p.then(function(){y().then(q).then(g).catch(function(S){f.setError(S)})}),p.catch(function(S){f.setError(S)}),f.promise},e.login=function(r){return n.login(r)};function J(r){var a=null,f=window.crypto||window.msCrypto;if(f&&f.getRandomValues&&window.Uint8Array)return a=new Uint8Array(r),f.getRandomValues(a),a;a=new Array(r);for(var b=0;b<a.length;b++)a[b]=Math.floor(256*Math.random());return a}function le(r){return z(r,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function z(r,a){for(var f=J(r),b=new Array(r),p=0;p<r;p++)b[p]=a.charCodeAt(f[p]%a.length);return String.fromCharCode.apply(null,b)}function Re(r,a){switch(r){case"S256":var f=new Uint8Array(cl.arrayBuffer(a)),b=Ut.fromByteArray(f).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function ot(r){var a={id_token:{acr:r}};return JSON.stringify(a)}e.createLoginUrl=function(r){var a=h(),f=h(),b=n.redirectUri(r),p={state:a,nonce:f,redirectUri:encodeURIComponent(b)};r&&r.prompt&&(p.prompt=r.prompt);var E;r&&r.action=="register"?E=e.endpoints.register():E=e.endpoints.authorize();var g=r&&r.scope||e.scope;g?g.indexOf("openid")===-1&&(g="openid "+g):g="openid";var y=E+"?client_id="+encodeURIComponent(e.clientId)+"&redirect_uri="+encodeURIComponent(b)+"&state="+encodeURIComponent(a)+"&response_mode="+encodeURIComponent(e.responseMode)+"&response_type="+encodeURIComponent(e.responseType)+"&scope="+encodeURIComponent(g);if(d&&(y=y+"&nonce="+encodeURIComponent(f)),r&&r.prompt&&(y+="&prompt="+encodeURIComponent(r.prompt)),r&&r.maxAge&&(y+="&max_age="+encodeURIComponent(r.maxAge)),r&&r.loginHint&&(y+="&login_hint="+encodeURIComponent(r.loginHint)),r&&r.idpHint&&(y+="&kc_idp_hint="+encodeURIComponent(r.idpHint)),r&&r.action&&r.action!="register"&&(y+="&kc_action="+encodeURIComponent(r.action)),r&&r.locale&&(y+="&ui_locales="+encodeURIComponent(r.locale)),r&&r.acr){var S=ot(r.acr);y+="&claims="+encodeURIComponent(S)}if((r&&r.acrValues||e.acrValues)&&(y+="&acr_values="+encodeURIComponent(r.acrValues||e.acrValues)),e.pkceMethod){var x=le(96);p.pkceCodeVerifier=x;var R=Re(e.pkceMethod,x);y+="&code_challenge="+R,y+="&code_challenge_method="+e.pkceMethod}return s.add(p),y},e.logout=function(r){return n.logout(r)},e.createLogoutUrl=function(r){var a=e.endpoints.logout()+"?client_id="+encodeURIComponent(e.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(n.redirectUri(r,!1));return e.idToken&&(a+="&id_token_hint="+encodeURIComponent(e.idToken)),a},e.register=function(r){return n.register(r)},e.createRegisterUrl=function(r){return r||(r={}),r.action="register",e.createLoginUrl(r)},e.createAccountUrl=function(r){var a=ke(),f=void 0;return typeof a<"u"&&(f=a+"/account?referrer="+encodeURIComponent(e.clientId)+"&referrer_uri="+encodeURIComponent(n.redirectUri(r))),f},e.accountManagement=function(){return n.accountManagement()},e.hasRealmRole=function(r){var a=e.realmAccess;return!!a&&a.roles.indexOf(r)>=0},e.hasResourceRole=function(r,a){if(!e.resourceAccess)return!1;var f=e.resourceAccess[a||e.clientId];return!!f&&f.roles.indexOf(r)>=0},e.loadUserProfile=function(){var r=ke()+"/account",a=new XMLHttpRequest;a.open("GET",r,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+e.token);var f=_();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(e.profile=JSON.parse(a.responseText),f.setSuccess(e.profile)):f.setError())},a.send(),f.promise},e.loadUserInfo=function(){var r=e.endpoints.userinfo(),a=new XMLHttpRequest;a.open("GET",r,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+e.token);var f=_();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(e.userInfo=JSON.parse(a.responseText),f.setSuccess(e.userInfo)):f.setError())},a.send(),f.promise},e.isTokenExpired=function(r){if(!e.tokenParsed||!e.refreshToken&&e.flow!="implicit")throw"Not authenticated";if(e.timeSkew==null)return U("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var a=e.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+e.timeSkew;if(r){if(isNaN(r))throw"Invalid minValidity";a-=r}return a<0},e.updateToken=function(r){var a=_();if(!e.refreshToken)return a.setError(),a.promise;r=r||5;var f=function(){var p=!1;if(r==-1?(p=!0,U("[KEYCLOAK] Refreshing token: forced refresh")):(!e.tokenParsed||e.isTokenExpired(r))&&(p=!0,U("[KEYCLOAK] Refreshing token: token expired")),!p)a.setSuccess(!1);else{var E="grant_type=refresh_token&refresh_token="+e.refreshToken,g=e.endpoints.token();if(o.push(a),o.length==1){var y=new XMLHttpRequest;y.open("POST",g,!0),y.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y.withCredentials=!0,E+="&client_id="+encodeURIComponent(e.clientId);var S=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){U("[KEYCLOAK] Token refreshed"),S=(S+new Date().getTime())/2;var x=JSON.parse(y.responseText);Z(x.access_token,x.refresh_token,x.id_token,S),e.onAuthRefreshSuccess&&e.onAuthRefreshSuccess();for(var R=o.pop();R!=null;R=o.pop())R.setSuccess(!0)}else{W("[KEYCLOAK] Failed to refresh token"),y.status==400&&e.clearToken(),e.onAuthRefreshError&&e.onAuthRefreshError();for(var R=o.pop();R!=null;R=o.pop())R.setError(!0)}},y.send(E)}}};if(c.enable){var b=F();b.then(function(){f()}).catch(function(p){a.setError(p)})}else f();return a.promise},e.clearToken=function(){e.token&&(Z(null,null,null),e.onAuthLogout&&e.onAuthLogout(),e.loginRequired&&e.login())},e.setToken=Z;function ke(){if(typeof e.authServerUrl<"u")return e.authServerUrl.charAt(e.authServerUrl.length-1)=="/"?e.authServerUrl+"realms/"+encodeURIComponent(e.realm):e.authServerUrl+"/realms/"+encodeURIComponent(e.realm)}function rt(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function he(r,a){var f=r.code,b=r.error,p=r.prompt,E=new Date().getTime();if(r.kc_action_status&&e.onActionUpdate&&e.onActionUpdate(r.kc_action_status),b){if(p!="none"){var g={error:b,error_description:r.error_description};e.onAuthError&&e.onAuthError(g),a&&a.setError(g)}else a&&a.setSuccess();return}else e.flow!="standard"&&(r.access_token||r.id_token)&&R(r.access_token,null,r.id_token,!0);if(e.flow!="implicit"&&f){var y="code="+f+"&grant_type=authorization_code",S=e.endpoints.token(),x=new XMLHttpRequest;x.open("POST",S,!0),x.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y+="&client_id="+encodeURIComponent(e.clientId),y+="&redirect_uri="+r.redirectUri,r.pkceCodeVerifier&&(y+="&code_verifier="+r.pkceCodeVerifier),x.withCredentials=!0,x.onreadystatechange=function(){if(x.readyState==4)if(x.status==200){var H=JSON.parse(x.responseText);R(H.access_token,H.refresh_token,H.id_token,e.flow==="standard"),m()}else e.onAuthError&&e.onAuthError(),a&&a.setError()},x.send(y)}function R(H,me,ue,te){E=(E+new Date().getTime())/2,Z(H,me,ue,E),d&&(e.tokenParsed&&e.tokenParsed.nonce!=r.storedNonce||e.refreshTokenParsed&&e.refreshTokenParsed.nonce!=r.storedNonce||e.idTokenParsed&&e.idTokenParsed.nonce!=r.storedNonce)?(U("[KEYCLOAK] Invalid nonce, clearing token"),e.clearToken(),a&&a.setError()):te&&(e.onAuthSuccess&&e.onAuthSuccess(),a&&a.setSuccess())}}function $(r){var a=_(),f;t?typeof t=="string"&&(f=t):f=location.origin+"/keycloak.json";function b(x){x?e.endpoints={authorize:function(){return x.authorization_endpoint},token:function(){return x.token_endpoint},logout:function(){if(!x.end_session_endpoint)throw"Not supported by the OIDC server";return x.end_session_endpoint},checkSessionIframe:function(){if(!x.check_session_iframe)throw"Not supported by the OIDC server";return x.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!x.userinfo_endpoint)throw"Not supported by the OIDC server";return x.userinfo_endpoint}}:e.endpoints={authorize:function(){return ke()+"/protocol/openid-connect/auth"},token:function(){return ke()+"/protocol/openid-connect/token"},logout:function(){return ke()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var R=ke()+"/protocol/openid-connect/login-status-iframe.html";return e.iframeVersion&&(R=R+"?version="+e.iframeVersion),R},thirdPartyCookiesIframe:function(){var R=ke()+"/protocol/openid-connect/3p-cookies/step1.html";return e.iframeVersion&&(R=R+"?version="+e.iframeVersion),R},register:function(){return ke()+"/protocol/openid-connect/registrations"},userinfo:function(){return ke()+"/protocol/openid-connect/userinfo"}}}if(f){var p=new XMLHttpRequest;p.open("GET",f,!0),p.setRequestHeader("Accept","application/json"),p.onreadystatechange=function(){if(p.readyState==4)if(p.status==200||_e(p)){var x=JSON.parse(p.responseText);e.authServerUrl=x["auth-server-url"],e.realm=x.realm,e.clientId=x.resource,b(null),a.setSuccess()}else a.setError()},p.send()}else{if(!t.clientId)throw"clientId missing";e.clientId=t.clientId;var E=t.oidcProvider;if(E)if(typeof E=="string"){var S;E.charAt(E.length-1)=="/"?S=E+".well-known/openid-configuration":S=E+"/.well-known/openid-configuration";var p=new XMLHttpRequest;p.open("GET",S,!0),p.setRequestHeader("Accept","application/json"),p.onreadystatechange=function(){if(p.readyState==4)if(p.status==200||_e(p)){var R=JSON.parse(p.responseText);b(R),a.setSuccess()}else a.setError()},p.send()}else b(E),a.setSuccess();else{if(!t.url){for(var g=document.getElementsByTagName("script"),y=0;y<g.length;y++)if(g[y].src.match(/.*keycloak\.js/)){t.url=g[y].src.substr(0,g[y].src.indexOf("/js/keycloak.js"));break}}if(!t.realm)throw"realm missing";e.authServerUrl=t.url,e.realm=t.realm,b(null),a.setSuccess()}}return a.promise}function _e(r){return r.status==0&&r.responseText&&r.responseURL.startsWith("file:")}function Z(r,a,f,b){if(e.tokenTimeoutHandle&&(clearTimeout(e.tokenTimeoutHandle),e.tokenTimeoutHandle=null),a?(e.refreshToken=a,e.refreshTokenParsed=vn(a)):(delete e.refreshToken,delete e.refreshTokenParsed),f?(e.idToken=f,e.idTokenParsed=vn(f)):(delete e.idToken,delete e.idTokenParsed),r){if(e.token=r,e.tokenParsed=vn(r),e.sessionId=e.tokenParsed.session_state,e.authenticated=!0,e.subject=e.tokenParsed.sub,e.realmAccess=e.tokenParsed.realm_access,e.resourceAccess=e.tokenParsed.resource_access,b&&(e.timeSkew=Math.floor(b/1e3)-e.tokenParsed.iat),e.timeSkew!=null&&(U("[KEYCLOAK] Estimated time difference between browser and server is "+e.timeSkew+" seconds"),e.onTokenExpired)){var p=(e.tokenParsed.exp-new Date().getTime()/1e3+e.timeSkew)*1e3;U("[KEYCLOAK] Token expires in "+Math.round(p/1e3)+" s"),p<=0?e.onTokenExpired():e.tokenTimeoutHandle=setTimeout(e.onTokenExpired,p)}}else delete e.token,delete e.tokenParsed,delete e.subject,delete e.realmAccess,delete e.resourceAccess,e.authenticated=!1}function h(){var r="0123456789abcdef",a=z(36,r).split("");a[14]="4",a[19]=r.substr(a[19]&3|8,1),a[8]=a[13]=a[18]=a[23]="-";var f=a.join("");return f}function A(r){var a=P(r);if(a){var f=s.get(a.state);return f&&(a.valid=!0,a.redirectUri=f.redirectUri,a.storedNonce=f.nonce,a.prompt=f.prompt,a.pkceCodeVerifier=f.pkceCodeVerifier),a}}function P(r){var a;switch(e.flow){case"standard":a=["code","state","session_state","kc_action_status","iss"];break;case"implicit":a=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":a=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}a.push("error"),a.push("error_description"),a.push("error_uri");var f=r.indexOf("?"),b=r.indexOf("#"),p,E;if(e.responseMode==="query"&&f!==-1?(p=r.substring(0,f),E=C(r.substring(f+1,b!==-1?b:r.length),a),E.paramsString!==""&&(p+="?"+E.paramsString),b!==-1&&(p+=r.substring(b))):e.responseMode==="fragment"&&b!==-1&&(p=r.substring(0,b),E=C(r.substring(b+1),a),E.paramsString!==""&&(p+="#"+E.paramsString)),E&&E.oauthParams){if(e.flow==="standard"||e.flow==="hybrid"){if((E.oauthParams.code||E.oauthParams.error)&&E.oauthParams.state)return E.oauthParams.newUrl=p,E.oauthParams}else if(e.flow==="implicit"&&(E.oauthParams.access_token||E.oauthParams.error)&&E.oauthParams.state)return E.oauthParams.newUrl=p,E.oauthParams}}function C(r,a){for(var f=r.split("&"),b={paramsString:"",oauthParams:{}},p=0;p<f.length;p++){var E=f[p].indexOf("="),g=f[p].slice(0,E);a.indexOf(g)!==-1?b.oauthParams[g]=f[p].slice(E+1):(b.paramsString!==""&&(b.paramsString+="&"),b.paramsString+=f[p])}return b}function _(){var r={setSuccess:function(a){r.resolve(a)},setError:function(a){r.reject(a)}};return r.promise=new Promise(function(a,f){r.resolve=a,r.reject=f}),r}function v(r,a,f){var b=null,p=new Promise(function(E,g){b=setTimeout(function(){g({error:f||"Promise is not settled within timeout of "+a+"ms"})},a)});return Promise.race([r,p]).finally(function(){clearTimeout(b)})}function O(){var r=_();if(!c.enable||c.iframe)return r.setSuccess(),r.promise;var a=document.createElement("iframe");c.iframe=a,a.onload=function(){var p=e.endpoints.authorize();p.charAt(0)==="/"?c.iframeOrigin=rt():c.iframeOrigin=p.substring(0,p.indexOf("/",8)),r.setSuccess()};var f=e.endpoints.checkSessionIframe();a.setAttribute("src",f),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-session-iframe"),a.style.display="none",document.body.appendChild(a);var b=function(p){if(!(p.origin!==c.iframeOrigin||c.iframe.contentWindow!==p.source)&&(p.data=="unchanged"||p.data=="changed"||p.data=="error")){p.data!="unchanged"&&e.clearToken();for(var E=c.callbackList.splice(0,c.callbackList.length),g=E.length-1;g>=0;--g){var y=E[g];p.data=="error"?y.setError():y.setSuccess(p.data=="unchanged")}}};return window.addEventListener("message",b,!1),r.promise}function m(){c.enable&&e.token&&setTimeout(function(){F().then(function(r){r&&m()})},c.interval*1e3)}function F(){var r=_();if(c.iframe&&c.iframeOrigin){var a=e.clientId+" "+(e.sessionId?e.sessionId:"");c.callbackList.push(r);var f=c.iframeOrigin;c.callbackList.length==1&&c.iframe.contentWindow.postMessage(a,f)}else r.setSuccess();return r.promise}function q(){var r=_();if(c.enable||e.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",e.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var f=function(b){a.contentWindow===b.source&&(b.data!=="supported"&&b.data!=="unsupported"||(b.data==="unsupported"&&(W(`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
75
75
|
|
|
76
76
|
- It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
|
|
77
77
|
- It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
|
|
78
78
|
|
|
79
|
-
For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`),c.enable=!1,e.silentCheckSsoFallback&&(e.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",f),r.setSuccess()))};window.addEventListener("message",f,!1)}else r.setSuccess();return v(r.promise,e.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function X(r){if(!r||r=="default")return{login:function(g){return window.location.assign(e.createLoginUrl(g)),
|
|
79
|
+
For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`),c.enable=!1,e.silentCheckSsoFallback&&(e.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",f),r.setSuccess()))};window.addEventListener("message",f,!1)}else r.setSuccess();return v(r.promise,e.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function X(r){if(!r||r=="default")return{login:function(g){return window.location.assign(e.createLoginUrl(g)),_().promise},logout:function(g){return window.location.replace(e.createLogoutUrl(g)),_().promise},register:function(g){return window.location.assign(e.createRegisterUrl(g)),_().promise},accountManagement:function(){var g=e.createAccountUrl();if(typeof g<"u")window.location.href=g;else throw"Not supported by the OIDC server";return _().promise},redirectUri:function(g,y){return g&&g.redirectUri?g.redirectUri:e.redirectUri?e.redirectUri:location.href}};if(r=="cordova"){c.enable=!1;var a=function(g,y,S){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(g,y,S):window.open(g,y,S)},f=function(g){return g&&g.cordovaOptions?Object.keys(g.cordovaOptions).reduce(function(y,S){return y[S]=g.cordovaOptions[S],y},{}):{}},b=function(g){return Object.keys(g).reduce(function(y,S){return y.push(S+"="+g[S]),y},[]).join(",")},p=function(g){var y=f(g);return y.location="no",g&&g.prompt=="none"&&(y.hidden="yes"),b(y)},E=function(){return e.redirectUri||"http://localhost"};return{login:function(g){var y=_(),S=p(g),x=e.createLoginUrl(g),R=a(x,"_blank",S),H=!1,me=!1,ue=function(){me=!0,R.close()};return R.addEventListener("loadstart",function(te){if(te.url.indexOf(E())==0){var Pe=A(te.url);he(Pe,y),ue(),H=!0}}),R.addEventListener("loaderror",function(te){if(!H)if(te.url.indexOf(E())==0){var Pe=A(te.url);he(Pe,y),ue(),H=!0}else y.setError(),ue()}),R.addEventListener("exit",function(te){me||y.setError({reason:"closed_by_user"})}),y.promise},logout:function(g){var y=_(),S=e.createLogoutUrl(g),x=a(S,"_blank","location=no,hidden=yes,clearcache=yes"),R;return x.addEventListener("loadstart",function(H){H.url.indexOf(E())==0&&x.close()}),x.addEventListener("loaderror",function(H){H.url.indexOf(E())==0||(R=!0),x.close()}),x.addEventListener("exit",function(H){R?y.setError():(e.clearToken(),y.setSuccess())}),y.promise},register:function(g){var y=_(),S=e.createRegisterUrl(),x=p(g),R=a(S,"_blank",x);return R.addEventListener("loadstart",function(H){if(H.url.indexOf(E())==0){R.close();var me=A(H.url);he(me,y)}}),y.promise},accountManagement:function(){var g=e.createAccountUrl();if(typeof g<"u"){var y=a(g,"_blank","location=no");y.addEventListener("loadstart",function(S){S.url.indexOf(E())==0&&y.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(g){return E()}}}if(r=="cordova-native")return c.enable=!1,{login:function(g){var y=_(),S=e.createLoginUrl(g);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var R=A(x.url);he(R,y)}),window.cordova.plugins.browsertab.openUrl(S),y.promise},logout:function(g){var y=_(),S=e.createLogoutUrl(g);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),e.clearToken(),y.setSuccess()}),window.cordova.plugins.browsertab.openUrl(S),y.promise},register:function(g){var y=_(),S=e.createRegisterUrl(g);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var R=A(x.url);he(R,y)}),window.cordova.plugins.browsertab.openUrl(S),y.promise},accountManagement:function(){var g=e.createAccountUrl();if(typeof g<"u")window.cordova.plugins.browsertab.openUrl(g);else throw"Not supported by the OIDC server"},redirectUri:function(g){return g&&g.redirectUri?g.redirectUri:e.redirectUri?e.redirectUri:"http://localhost"}};throw"invalid adapter type: "+r}var Y=function(){if(!(this instanceof Y))return new Y;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var r=this;function a(){for(var f=new Date().getTime(),b=0;b<localStorage.length;b++){var p=localStorage.key(b);if(p&&p.indexOf("kc-callback-")==0){var E=localStorage.getItem(p);if(E)try{var g=JSON.parse(E).expires;(!g||g<f)&&localStorage.removeItem(p)}catch{localStorage.removeItem(p)}}}}r.get=function(f){if(f){var b="kc-callback-"+f,p=localStorage.getItem(b);return p&&(localStorage.removeItem(b),p=JSON.parse(p)),a(),p}},r.add=function(f){a();var b="kc-callback-"+f.state;f.expires=new Date().getTime()+60*60*1e3,localStorage.setItem(b,JSON.stringify(f))}},ce=function(){if(!(this instanceof ce))return new ce;var r=this;r.get=function(p){if(p){var E=f("kc-callback-"+p);if(b("kc-callback-"+p,"",a(-100)),E)return JSON.parse(E)}},r.add=function(p){b("kc-callback-"+p.state,JSON.stringify(p),a(60))},r.removeItem=function(p){b(p,"",a(-100))};var a=function(p){var E=new Date;return E.setTime(E.getTime()+p*60*1e3),E},f=function(p){for(var E=p+"=",g=document.cookie.split(";"),y=0;y<g.length;y++){for(var S=g[y];S.charAt(0)==" ";)S=S.substring(1);if(S.indexOf(E)==0)return S.substring(E.length,S.length)}return""},b=function(p,E,g){var y=p+"="+E+"; expires="+g.toUTCString()+"; ";document.cookie=y}};function B(){try{return new Y}catch{}return new ce}function pe(r){return function(){e.enableLogging&&r.apply(console,Array.prototype.slice.call(arguments))}}}function fl(t){const e=new No(t),n={},o=(k,I)=>{e.init({onLoad:"login-required"}).then(async d=>{d&&await s(),k()}).catch(d=>{I(d)})},s=async()=>{const k=await e.loadUserInfo();n.email=k.email??"",n.emailVerified=k.email_verified===!0,n.firstName=k.given_name??"",n.lastName=k.family_name??"",n.name=k.name??"",n.sub=k.sub??"",n.username=k.preferred_username??"",n.roles=[...k.role??[]],n.groups=[...k.group??[]],n.IsInRole=I=>n.roles.includes(I),sessionStorage.setItem("name",n.name)};return{Instance:e,User:n,CallLogin:o,CallLogout:()=>{e.logout({redirectUri:location.origin}).then(()=>{sessionStorage.removeItem("name")})}}}const hl=t=>fl(t);class pl{constructor(e=null){ct(this,"errors",[]);ct(this,"_value",null);ct(this,"_httpStatusCode");this._value=e,this._httpStatusCode=200}get value(){return this._value}set value(e){this._value=e}get hasSuccess(){return!this.hasError}get hasError(){return this.errors.length>0}get httpStatusCode(){return this._httpStatusCode}set httpStatusCode(e){this._httpStatusCode=e}WithError(e){this.errors.push(e),this._httpStatusCode===200&&(this._httpStatusCode=400)}WithErrors(e){e.forEach(n=>this.WithError(n))}}const Rl="",Ol="";(()=>{function t(){l.nextTick(()=>{setTimeout(()=>{var n;const e=document.querySelector(":root");e&&e.style.setProperty("--window-height",`${((n=window.visualViewport)==null?void 0:n.height)??window.innerHeight}px`)},1)})}t(),window.addEventListener("resize",t)})(),yn.SetInitialTheme(),G.AppResult=pl,G.Cor=zt,G.SfButton=Ja,G.SfContent=Ha,G.SfIcon=ut,G.SfLayout=Ma,G.SfNavMenuLink=Ua,G.SfTabNavigation=Ka,G.Tamanho=qe,G.UseAuthService=hl,G.UseDialogService=Ro,G.UseNavMenuService=jt,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});
|
|
80
80
|
//# sourceMappingURL=lib.umd.js.map
|