@luizleon/sf.prefeiturasp.vuecomponents 0.0.25 → 0.0.26
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 +251 -242
- package/dist/lib.es.js.map +1 -1
- package/dist/lib.umd.js +10 -10
- package/dist/lib.umd.js.map +1 -1
- package/dist/services/authService.d.ts +3 -0
- package/package.json +1 -1
- package/src/services/authService.ts +9 -0
package/dist/lib.umd.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
(function(G,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(G=typeof globalThis<"u"?globalThis:G||self,l(G.Lib={},G.Vue))})(this,function(G,l){"use strict";var xl=Object.defineProperty;var
|
|
1
|
+
(function(G,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(G=typeof globalThis<"u"?globalThis:G||self,l(G.Lib={},G.Vue))})(this,function(G,l){"use strict";var xl=Object.defineProperty;var Sl=(G,l,De)=>l in G?xl(G,l,{enumerable:!0,configurable:!0,writable:!0,value:De}):G[l]=De;var dt=(G,l,De)=>(Sl(G,typeof l!="symbol"?l+"":l,De),De);class De{constructor(){dt(this,"_visible",l.ref(!1))}get IsVisible(){return this._visible.value===!0}Toggle(){this._visible.value=!this._visible.value}Close(){this._visible.value=!1}Open(){this._visible.value=!0}}const rr=new De,Wt=()=>rr;var qt=(t=>(t.Primary="primary",t.Secondary="secondary",t.Info="info",t.Success="success",t.Help="help",t.Warn="warn",t.Error="error",t))(qt||{}),Ge=(t=>(t.Pequeno="sm",t.Medio="md",t.Grande="lg",t))(Ge||{});const In=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},sr={},ir={class:"sf-loading-circle"},ar=[l.createElementVNode("div",null,[l.createElementVNode("svg",{viewBox:"25 25 50 50"},[l.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})])],-1)];function lr(t,e){return l.openBlock(),l.createElementBlock("div",ir,ar)}const cr=In(sr,[["render",lr]]);class Ye{constructor(e){dt(this,"retorno");this.retorno=e??""}Concat(e){return e&&e.trim().length&&(this.retorno+=` ${e}`),this}AddClass(e,n=!0){return n?this.Concat(e):this}Build(){return this.retorno.trim()}}const ur=["disabled","tabindex"],dr=["data-color"],ft=l.defineComponent({__name:"Icon",props:{icone:{},visible:{type:Boolean,default:!0},class:{default:""},style:{default:""},disabled:{type:Boolean},loading:{type:Boolean},button:{type:Boolean},tamanho:{default:Ge.Medio},dot:{type:Boolean},dotColor:{default:qt.Error},buttonProps:{}},setup(t){const e=t;function n(){return new Ye(`${e.class} sf-icon`).AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).AddClass("sf-icon-button",e.button).AddClass("sf-icon-small",e.tamanho===Ge.Pequeno).AddClass("sf-icon-medium",e.tamanho===Ge.Medio).AddClass("sf-icon-large",e.tamanho===Ge.Grande).AddClass("sf-ripple",e.button===!0).Build()}return(o,i)=>(l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(e.style),class:l.normalizeClass(n())},[l.createElementVNode("button",l.mergeProps({class:"material-symbols-outlined",disabled:e.disabled||e.loading},e.buttonProps,{tabindex:e.button?void 0:-1}),[e.loading?(l.openBlock(),l.createBlock(cr,{key:0})):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(e.icone),1)],64))],16,ur),e.dot?(l.openBlock(),l.createElementBlock("span",{key:0,"data-color":e.dotColor},null,8,dr)):l.createCommentVNode("",!0)],6))}});var fr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function pr(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 i=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,i.get?i:{enumerable:!0,get:function(){return t[o]}})}),n}var Lt={};Lt.byteLength=br,Lt.toByteArray=wr,Lt.fromByteArray=_r;for(var Ie=[],Ce=[],mr=typeof Uint8Array<"u"?Uint8Array:Array,Kt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Je=0,gr=Kt.length;Je<gr;++Je)Ie[Je]=Kt[Je],Ce[Kt.charCodeAt(Je)]=Je;Ce["-".charCodeAt(0)]=62,Ce["_".charCodeAt(0)]=63;function Pn(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 br(t){var e=Pn(t),n=e[0],o=e[1];return(n+o)*3/4-o}function yr(t,e,n){return(e+n)*3/4-n}function wr(t){var e,n=Pn(t),o=n[0],i=n[1],c=new mr(yr(t,o,i)),E=0,I=i>0?o-4:o,d;for(d=0;d<I;d+=4)e=Ce[t.charCodeAt(d)]<<18|Ce[t.charCodeAt(d+1)]<<12|Ce[t.charCodeAt(d+2)]<<6|Ce[t.charCodeAt(d+3)],c[E++]=e>>16&255,c[E++]=e>>8&255,c[E++]=e&255;return i===2&&(e=Ce[t.charCodeAt(d)]<<2|Ce[t.charCodeAt(d+1)]>>4,c[E++]=e&255),i===1&&(e=Ce[t.charCodeAt(d)]<<10|Ce[t.charCodeAt(d+1)]<<4|Ce[t.charCodeAt(d+2)]>>2,c[E++]=e>>8&255,c[E++]=e&255),c}function vr(t){return Ie[t>>18&63]+Ie[t>>12&63]+Ie[t>>6&63]+Ie[t&63]}function kr(t,e,n){for(var o,i=[],c=e;c<n;c+=3)o=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(t[c+2]&255),i.push(vr(o));return i.join("")}function _r(t){for(var e,n=t.length,o=n%3,i=[],c=16383,E=0,I=n-o;E<I;E+=c)i.push(kr(t,E,E+c>I?I:E+c));return o===1?(e=t[n-1],i.push(Ie[e>>2]+Ie[e<<4&63]+"==")):o===2&&(e=(t[n-2]<<8)+t[n-1],i.push(Ie[e>>10]+Ie[e>>4&63]+Ie[e<<2&63]+"=")),i.join("")}var Bn={exports:{}};const Rn=pr(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));/**
|
|
2
2
|
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
3
3
|
*
|
|
4
4
|
* @version 0.10.1
|
|
5
5
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
6
6
|
* @copyright Chen, Yi-Cyuan 2014-2023
|
|
7
7
|
* @license MIT
|
|
8
|
-
*/(function(t){(function(){var e="input is invalid type",n=typeof window=="object",o=n?window:{};o.JS_SHA256_NO_WINDOW&&(n=!1);var i=!n&&typeof self=="object",c=!o.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;c?o=fr:i&&(o=self);var E=!o.JS_SHA256_NO_COMMON_JS&&!0&&t.exports,I=!o.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",d="0123456789abcdef".split(""),V=[-2147483648,8388608,32768,128],W=[24,16,8,0],ee=[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 Oe=function(h,_){return function(P){return new D(_,!0).update(P)[h]()}},rt=function(h){var _=Oe("hex",h);c&&(_=ke(_,h)),_.create=function(){return new D(h)},_.update=function(k){return _.create().update(k)};for(var P=0;P<Le.length;++P){var C=Le[P];_[C]=Oe(C,h)}return _},ke=function(h,_){var P=Rn,C=Rn.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},st=function(h,_){return function(P,C){return new _e(P,_,!0).update(C)[h]()}},he=function(h){var _=st("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]=st(C,h)}return _};function D(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}D.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}},D.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var h=this.blocks,_=this.lastByteIndex;h[16]=this.block,h[_>>2]|=V[_&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()}},D.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,J,Y,ce,B,pe,r,a,f,b,p;for(q=16;q<64;++q)B=F[q-15],J=(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]+J+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):(J=(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+ee[q]+F[q],pe=J+ce,m=C+B<<0,C=B+pe<<0),J=(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+ee[q+1]+F[q+1],pe=J+ce,O=P+B<<0,P=B+pe<<0,J=(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+ee[q+2]+F[q+2],pe=J+ce,v=_+B<<0,_=B+pe<<0,J=(_>>>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+ee[q+3]+F[q+3],pe=J+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},D.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},D.prototype.toString=D.prototype.hex,D.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},D.prototype.array=D.prototype.digest,D.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 D(_,!0).update(h).array());var q=[],J=[];for(C=0;C<64;++C){var Y=h[C]||0;q[C]=92^Y,J[C]=54^Y}D.call(this,_,P),this.update(J),this.oKeyPad=q,this.inner=!0,this.sharedMemory=P}_e.prototype=new D,_e.prototype.finalize=function(){if(D.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();D.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(h),D.prototype.finalize.call(this)}};var X=rt();X.sha256=X,X.sha224=rt(!0),X.sha256.hmac=he(),X.sha224.hmac=he(!0),E?t.exports=X:(o.sha256=X.sha256,o.sha224=X.sha224)})()})(Bn);var Cr=Bn.exports;const Ar=hr(Cr);class ft extends Error{}ft.prototype.name="InvalidTokenError";function Er(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 xr(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 Er(e)}catch{return atob(e)}}function Gt(t,e){if(typeof t!="string")throw new ft("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 ft(`Invalid token specified: missing part #${n+1}`);let i;try{i=xr(o)}catch(c){throw new ft(`Invalid token specified: invalid base64 for part #${n+1} (${c.message})`)}try{return JSON.parse(i)}catch(c){throw new ft(`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 On(t){if(!(this instanceof On))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var e=this,n,o=[],i,c={enable:!0,callbackList:[],interval:5},E=document.getElementsByTagName("script"),I=0;I<E.length;I++)(E[I].src.indexOf("keycloak.js")!==-1||E[I].src.indexOf("keycloak.min.js")!==-1)&&E[I].src.indexOf("version=")!==-1&&(e.iframeVersion=E[I].src.substring(E[I].src.indexOf("version=")+8).split("&")[0]);var d=!0,V=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,i=B();var a=["default","cordova","cordova-native"];if(r&&a.indexOf(r.adapter)>-1?n=J(r.adapter):r&&typeof r.adapter=="object"?n=r.adapter:window.Cordova||window.cordova?n=J("cordova"):n=J(),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(T){f.setError(T)});var p=D();function A(){var T=function($){$||(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 $=document.createElement("iframe"),me=e.createLoginUrl({prompt:"none",redirectUri:e.silentCheckSsoRedirectUri});$.setAttribute("src",me),$.setAttribute("sandbox","allow-scripts allow-same-origin"),$.setAttribute("title","keycloak-silent-check-sso"),$.style.display="none",document.body.appendChild($);var ue=function(te){if(!(te.origin!==window.location.origin||$.contentWindow!==te.source)){var Be=_(te.data);he(Be,b),document.body.removeChild($),window.removeEventListener("message",ue)}};window.addEventListener("message",ue)},R={};switch(r.onLoad){case"check-sso":c.enable?O().then(function(){F().then(function($){$?b.setSuccess():e.silentCheckSsoRedirectUri?x():T(!1)}).catch(function($){b.setError($)})}):e.silentCheckSsoRedirectUri?x():T(!1);break;case"login-required":T(!0);break;default:throw"Invalid value for onLoad"}}function g(){var T=_(window.location.href);if(T&&window.history.replaceState(window.history.state,null,T.newUrl),T&&T.valid)return O().then(function(){he(T,b)}).catch(function(x){b.setError(x)});r?r.token&&r.refreshToken?(X(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?A():b.setError(x)})):r.onLoad?A():b.setSuccess():b.setSuccess()}function y(){var T=k(),x=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",x),T.setSuccess())};return document.addEventListener("readystatechange",x),x(),T.promise}return p.then(function(){y().then(q).then(g).catch(function(T){f.setError(T)})}),p.catch(function(T){f.setError(T)}),f.promise},e.login=function(r){return n.login(r)};function ee(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=ee(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 Oe(r,a){switch(r){case"S256":var f=new Uint8Array(Ar.arrayBuffer(a)),b=St.fromByteArray(f).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function rt(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 A;r&&r.action=="register"?A=e.endpoints.register():A=e.endpoints.authorize();var g=r&&r.scope||e.scope;g?g.indexOf("openid")===-1&&(g="openid "+g):g="openid";var y=A+"?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 T=rt(r.acr);y+="&claims="+encodeURIComponent(T)}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=Oe(e.pkceMethod,x);y+="&code_challenge="+R,y+="&code_challenge_method="+e.pkceMethod}return i.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 V("[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,V("[KEYCLOAK] Refreshing token: forced refresh")):(!e.tokenParsed||e.isTokenExpired(r))&&(p=!0,V("[KEYCLOAK] Refreshing token: token expired")),!p)a.setSuccess(!1);else{var A="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,A+="&client_id="+encodeURIComponent(e.clientId);var T=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){V("[KEYCLOAK] Token refreshed"),T=(T+new Date().getTime())/2;var x=JSON.parse(y.responseText);X(x.access_token,x.refresh_token,x.id_token,T),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(A)}}};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&&(X(null,null,null),e.onAuthLogout&&e.onAuthLogout(),e.loginRequired&&e.login())},e.setToken=X;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 st(){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,A=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",T=e.endpoints.token(),x=new XMLHttpRequest;x.open("POST",T,!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 $=JSON.parse(x.responseText);R($.access_token,$.refresh_token,$.id_token,e.flow==="standard"),m()}else e.onAuthError&&e.onAuthError(),a&&a.setError()},x.send(y)}function R($,me,ue,te){A=(A+new Date().getTime())/2,X($,me,ue,A),d&&(e.tokenParsed&&e.tokenParsed.nonce!=r.storedNonce||e.refreshTokenParsed&&e.refreshTokenParsed.nonce!=r.storedNonce||e.idTokenParsed&&e.idTokenParsed.nonce!=r.storedNonce)?(V("[KEYCLOAK] Invalid nonce, clearing token"),e.clearToken(),a&&a.setError()):te&&(e.onAuthSuccess&&e.onAuthSuccess(),a&&a.setSuccess())}}function D(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 A=t.oidcProvider;if(A)if(typeof A=="string"){var T;A.charAt(A.length-1)=="/"?T=A+".well-known/openid-configuration":T=A+"/.well-known/openid-configuration";var p=new XMLHttpRequest;p.open("GET",T,!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(A),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 X(r,a,f,b){if(e.tokenTimeoutHandle&&(clearTimeout(e.tokenTimeoutHandle),e.tokenTimeoutHandle=null),a?(e.refreshToken=a,e.refreshTokenParsed=Gt(a)):(delete e.refreshToken,delete e.refreshTokenParsed),f?(e.idToken=f,e.idTokenParsed=Gt(f)):(delete e.idToken,delete e.idTokenParsed),r){if(e.token=r,e.tokenParsed=Gt(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&&(V("[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;V("[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=i.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,A;if(e.responseMode==="query"&&f!==-1?(p=r.substring(0,f),A=C(r.substring(f+1,b!==-1?b:r.length),a),A.paramsString!==""&&(p+="?"+A.paramsString),b!==-1&&(p+=r.substring(b))):e.responseMode==="fragment"&&b!==-1&&(p=r.substring(0,b),A=C(r.substring(b+1),a),A.paramsString!==""&&(p+="#"+A.paramsString)),A&&A.oauthParams){if(e.flow==="standard"||e.flow==="hybrid"){if((A.oauthParams.code||A.oauthParams.error)&&A.oauthParams.state)return A.oauthParams.newUrl=p,A.oauthParams}else if(e.flow==="implicit"&&(A.oauthParams.access_token||A.oauthParams.error)&&A.oauthParams.state)return A.oauthParams.newUrl=p,A.oauthParams}}function C(r,a){for(var f=r.split("&"),b={paramsString:"",oauthParams:{}},p=0;p<f.length;p++){var A=f[p].indexOf("="),g=f[p].slice(0,A);a.indexOf(g)!==-1?b.oauthParams[g]=f[p].slice(A+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(A,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=st():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 A=c.callbackList.splice(0,c.callbackList.length),g=A.length-1;g>=0;--g){var y=A[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:
|
|
8
|
+
*/(function(t){(function(){var e="input is invalid type",n=typeof window=="object",o=n?window:{};o.JS_SHA256_NO_WINDOW&&(n=!1);var i=!n&&typeof self=="object",c=!o.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;c?o=fr:i&&(o=self);var E=!o.JS_SHA256_NO_COMMON_JS&&!0&&t.exports,I=!o.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",d="0123456789abcdef".split(""),V=[-2147483648,8388608,32768,128],W=[24,16,8,0],ee=[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 Oe=function(h,_){return function(P){return new D(_,!0).update(P)[h]()}},st=function(h){var _=Oe("hex",h);c&&(_=ke(_,h)),_.create=function(){return new D(h)},_.update=function(k){return _.create().update(k)};for(var P=0;P<Le.length;++P){var C=Le[P];_[C]=Oe(C,h)}return _},ke=function(h,_){var P=Rn,C=Rn.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},it=function(h,_){return function(P,C){return new _e(P,_,!0).update(C)[h]()}},he=function(h){var _=it("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]=it(C,h)}return _};function D(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}D.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}},D.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var h=this.blocks,_=this.lastByteIndex;h[16]=this.block,h[_>>2]|=V[_&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()}},D.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,J,Y,ce,B,pe,r,a,f,b,p;for(q=16;q<64;++q)B=F[q-15],J=(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]+J+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):(J=(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+ee[q]+F[q],pe=J+ce,m=C+B<<0,C=B+pe<<0),J=(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+ee[q+1]+F[q+1],pe=J+ce,O=P+B<<0,P=B+pe<<0,J=(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+ee[q+2]+F[q+2],pe=J+ce,v=_+B<<0,_=B+pe<<0,J=(_>>>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+ee[q+3]+F[q+3],pe=J+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},D.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},D.prototype.toString=D.prototype.hex,D.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},D.prototype.array=D.prototype.digest,D.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 D(_,!0).update(h).array());var q=[],J=[];for(C=0;C<64;++C){var Y=h[C]||0;q[C]=92^Y,J[C]=54^Y}D.call(this,_,P),this.update(J),this.oKeyPad=q,this.inner=!0,this.sharedMemory=P}_e.prototype=new D,_e.prototype.finalize=function(){if(D.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();D.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(h),D.prototype.finalize.call(this)}};var X=st();X.sha256=X,X.sha224=st(!0),X.sha256.hmac=he(),X.sha224.hmac=he(!0),E?t.exports=X:(o.sha256=X.sha256,o.sha224=X.sha224)})()})(Bn);var Cr=Bn.exports;const Ar=hr(Cr);class ht extends Error{}ht.prototype.name="InvalidTokenError";function Er(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 xr(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 Er(e)}catch{return atob(e)}}function Gt(t,e){if(typeof t!="string")throw new ht("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 ht(`Invalid token specified: missing part #${n+1}`);let i;try{i=xr(o)}catch(c){throw new ht(`Invalid token specified: invalid base64 for part #${n+1} (${c.message})`)}try{return JSON.parse(i)}catch(c){throw new ht(`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 On(t){if(!(this instanceof On))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var e=this,n,o=[],i,c={enable:!0,callbackList:[],interval:5},E=document.getElementsByTagName("script"),I=0;I<E.length;I++)(E[I].src.indexOf("keycloak.js")!==-1||E[I].src.indexOf("keycloak.min.js")!==-1)&&E[I].src.indexOf("version=")!==-1&&(e.iframeVersion=E[I].src.substring(E[I].src.indexOf("version=")+8).split("&")[0]);var d=!0,V=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,i=B();var a=["default","cordova","cordova-native"];if(r&&a.indexOf(r.adapter)>-1?n=J(r.adapter):r&&typeof r.adapter=="object"?n=r.adapter:window.Cordova||window.cordova?n=J("cordova"):n=J(),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=D();function A(){var S=function($){$||(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 $=document.createElement("iframe"),me=e.createLoginUrl({prompt:"none",redirectUri:e.silentCheckSsoRedirectUri});$.setAttribute("src",me),$.setAttribute("sandbox","allow-scripts allow-same-origin"),$.setAttribute("title","keycloak-silent-check-sso"),$.style.display="none",document.body.appendChild($);var ue=function(te){if(!(te.origin!==window.location.origin||$.contentWindow!==te.source)){var Be=_(te.data);he(Be,b),document.body.removeChild($),window.removeEventListener("message",ue)}};window.addEventListener("message",ue)},R={};switch(r.onLoad){case"check-sso":c.enable?O().then(function(){F().then(function($){$?b.setSuccess():e.silentCheckSsoRedirectUri?x():S(!1)}).catch(function($){b.setError($)})}):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?(X(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?A():b.setError(x)})):r.onLoad?A():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 ee(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=ee(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 Oe(r,a){switch(r){case"S256":var f=new Uint8Array(Ar.arrayBuffer(a)),b=Lt.fromByteArray(f).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function st(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 A;r&&r.action=="register"?A=e.endpoints.register():A=e.endpoints.authorize();var g=r&&r.scope||e.scope;g?g.indexOf("openid")===-1&&(g="openid "+g):g="openid";var y=A+"?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=st(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=Oe(e.pkceMethod,x);y+="&code_challenge="+R,y+="&code_challenge_method="+e.pkceMethod}return i.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 V("[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,V("[KEYCLOAK] Refreshing token: forced refresh")):(!e.tokenParsed||e.isTokenExpired(r))&&(p=!0,V("[KEYCLOAK] Refreshing token: token expired")),!p)a.setSuccess(!1);else{var A="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,A+="&client_id="+encodeURIComponent(e.clientId);var S=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){V("[KEYCLOAK] Token refreshed"),S=(S+new Date().getTime())/2;var x=JSON.parse(y.responseText);X(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(A)}}};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&&(X(null,null,null),e.onAuthLogout&&e.onAuthLogout(),e.loginRequired&&e.login())},e.setToken=X;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 it(){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,A=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 $=JSON.parse(x.responseText);R($.access_token,$.refresh_token,$.id_token,e.flow==="standard"),m()}else e.onAuthError&&e.onAuthError(),a&&a.setError()},x.send(y)}function R($,me,ue,te){A=(A+new Date().getTime())/2,X($,me,ue,A),d&&(e.tokenParsed&&e.tokenParsed.nonce!=r.storedNonce||e.refreshTokenParsed&&e.refreshTokenParsed.nonce!=r.storedNonce||e.idTokenParsed&&e.idTokenParsed.nonce!=r.storedNonce)?(V("[KEYCLOAK] Invalid nonce, clearing token"),e.clearToken(),a&&a.setError()):te&&(e.onAuthSuccess&&e.onAuthSuccess(),a&&a.setSuccess())}}function D(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 A=t.oidcProvider;if(A)if(typeof A=="string"){var S;A.charAt(A.length-1)=="/"?S=A+".well-known/openid-configuration":S=A+"/.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(A),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 X(r,a,f,b){if(e.tokenTimeoutHandle&&(clearTimeout(e.tokenTimeoutHandle),e.tokenTimeoutHandle=null),a?(e.refreshToken=a,e.refreshTokenParsed=Gt(a)):(delete e.refreshToken,delete e.refreshTokenParsed),f?(e.idToken=f,e.idTokenParsed=Gt(f)):(delete e.idToken,delete e.idTokenParsed),r){if(e.token=r,e.tokenParsed=Gt(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&&(V("[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;V("[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=i.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,A;if(e.responseMode==="query"&&f!==-1?(p=r.substring(0,f),A=C(r.substring(f+1,b!==-1?b:r.length),a),A.paramsString!==""&&(p+="?"+A.paramsString),b!==-1&&(p+=r.substring(b))):e.responseMode==="fragment"&&b!==-1&&(p=r.substring(0,b),A=C(r.substring(b+1),a),A.paramsString!==""&&(p+="#"+A.paramsString)),A&&A.oauthParams){if(e.flow==="standard"||e.flow==="hybrid"){if((A.oauthParams.code||A.oauthParams.error)&&A.oauthParams.state)return A.oauthParams.newUrl=p,A.oauthParams}else if(e.flow==="implicit"&&(A.oauthParams.access_token||A.oauthParams.error)&&A.oauthParams.state)return A.oauthParams.newUrl=p,A.oauthParams}}function C(r,a){for(var f=r.split("&"),b={paramsString:"",oauthParams:{}},p=0;p<f.length;p++){var A=f[p].indexOf("="),g=f[p].slice(0,A);a.indexOf(g)!==-1?b.oauthParams[g]=f[p].slice(A+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(A,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=it():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 A=c.callbackList.splice(0,c.callbackList.length),g=A.length-1;g>=0;--g){var y=A[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:
|
|
9
9
|
|
|
10
10
|
- It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
|
|
11
11
|
- It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
|
|
12
12
|
|
|
13
|
-
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 J(r){if(!r||r=="default")return{login:function(g){return window.location.assign(e.createLoginUrl(g)),k().promise},logout:function(g){return window.location.replace(e.createLogoutUrl(g)),k().promise},register:function(g){return window.location.assign(e.createRegisterUrl(g)),k().promise},accountManagement:function(){var g=e.createAccountUrl();if(typeof g<"u")window.location.href=g;else throw"Not supported by the OIDC server";return k().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,T){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(g,y,T):window.open(g,y,T)},f=function(g){return g&&g.cordovaOptions?Object.keys(g.cordovaOptions).reduce(function(y,T){return y[T]=g.cordovaOptions[T],y},{}):{}},b=function(g){return Object.keys(g).reduce(function(y,T){return y.push(T+"="+g[T]),y},[]).join(",")},p=function(g){var y=f(g);return y.location="no",g&&g.prompt=="none"&&(y.hidden="yes"),b(y)},A=function(){return e.redirectUri||"http://localhost"};return{login:function(g){var y=k(),T=p(g),x=e.createLoginUrl(g),R=a(x,"_blank",T),$=!1,me=!1,ue=function(){me=!0,R.close()};return R.addEventListener("loadstart",function(te){if(te.url.indexOf(A())==0){var Be=_(te.url);he(Be,y),ue(),$=!0}}),R.addEventListener("loaderror",function(te){if(!$)if(te.url.indexOf(A())==0){var Be=_(te.url);he(Be,y),ue(),$=!0}else y.setError(),ue()}),R.addEventListener("exit",function(te){me||y.setError({reason:"closed_by_user"})}),y.promise},logout:function(g){var y=k(),T=e.createLogoutUrl(g),x=a(T,"_blank","location=no,hidden=yes,clearcache=yes"),R;return x.addEventListener("loadstart",function($){$.url.indexOf(A())==0&&x.close()}),x.addEventListener("loaderror",function($){$.url.indexOf(A())==0||(R=!0),x.close()}),x.addEventListener("exit",function($){R?y.setError():(e.clearToken(),y.setSuccess())}),y.promise},register:function(g){var y=k(),T=e.createRegisterUrl(),x=p(g),R=a(T,"_blank",x);return R.addEventListener("loadstart",function($){if($.url.indexOf(A())==0){R.close();var me=_($.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(T){T.url.indexOf(A())==0&&y.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(g){return A()}}}if(r=="cordova-native")return c.enable=!1,{login:function(g){var y=k(),T=e.createLoginUrl(g);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var R=_(x.url);he(R,y)}),window.cordova.plugins.browsertab.openUrl(T),y.promise},logout:function(g){var y=k(),T=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(T),y.promise},register:function(g){var y=k(),T=e.createRegisterUrl(g);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var R=_(x.url);he(R,y)}),window.cordova.plugins.browsertab.openUrl(T),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 A=localStorage.getItem(p);if(A)try{var g=JSON.parse(A).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 A=f("kc-callback-"+p);if(b("kc-callback-"+p,"",a(-100)),A)return JSON.parse(A)}},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 A=new Date;return A.setTime(A.getTime()+p*60*1e3),A},f=function(p){for(var A=p+"=",g=document.cookie.split(";"),y=0;y<g.length;y++){for(var T=g[y];T.charAt(0)==" ";)T=T.substring(1);if(T.indexOf(A)==0)return T.substring(A.length,T.length)}return""},b=function(p,A,g){var y=p+"="+A+"; 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))}}}const Lt=new On,Tr=(t,e)=>{Lt.init({onLoad:"login-required"}).then(async n=>{n&&await Sr(),t()}).catch(n=>{e(n)})},Sr=async()=>{const t=await Lt.loadUserInfo();ne.User.email=t.email??"",ne.User.emailVerified=t.email_verified===!0,ne.User.firstName=t.given_name??"",ne.User.lastName=t.family_name??"",ne.User.name=t.name??"",ne.User.sub=t.sub??"",ne.User.username=t.preferred_username??"",ne.User.roles=[...t.role??[]],ne.User.groups=[...t.group??[]],ne.User.IsInRole=e=>ne.User.roles.includes(e)},ne={Instance:Lt,User:{},CallLogin:Tr,CallLogout:()=>{Lt.logout({redirectUri:location.origin}).then(()=>{sessionStorage.removeItem("user-info")})}},Fn="SweetAlert2:",Lr=t=>{const e=[];for(let n=0;n<t.length;n++)e.indexOf(t[n])===-1&&e.push(t[n]);return e},Yt=t=>t.charAt(0).toUpperCase()+t.slice(1),ye=t=>Array.prototype.slice.call(t),de=t=>{console.warn(`${Fn} ${typeof t=="object"?t.join(" "):t}`)},$e=t=>{console.error(`${Fn} ${t}`)},Mn=[],Ir=t=>{Mn.includes(t)||(Mn.push(t),de(t))},Pr=(t,e)=>{Ir(`"${t}" is deprecated and will be removed in the next major release. Please use "${e}" instead.`)},It=t=>typeof t=="function"?t():t,Jt=t=>t&&typeof t.toPromise=="function",ht=t=>Jt(t)?t.toPromise():Promise.resolve(t),Xt=t=>t&&Promise.resolve(t)===t,Je={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},Br=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],Rr={},Or=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Nn=t=>Object.prototype.hasOwnProperty.call(Je,t),Un=t=>Br.indexOf(t)!==-1,Zt=t=>Rr[t],Fr=t=>{Nn(t)||de(`Unknown parameter "${t}"`)},Mr=t=>{Or.includes(t)&&de(`The parameter "${t}" is incompatible with toasts`)},Nr=t=>{Zt(t)&&Pr(t,Zt(t))},Ur=t=>{!t.backdrop&&t.allowOutsideClick&&de('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const e in t)Fr(e),t.toast&&Mr(e),Nr(e)},Dr="swal2-",Dn=t=>{const e={};for(const n in t)e[t[n]]=Dr+t[n];return e},u=Dn(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),pt=Dn(["success","warning","info","question","error"]),oe=()=>document.body.querySelector(`.${u.container}`),mt=t=>{const e=oe();return e?e.querySelector(t):null},Ae=t=>mt(`.${t}`),j=()=>Ae(u.popup),gt=()=>Ae(u.icon),$n=()=>Ae(u.title),Pt=()=>Ae(u["html-container"]),Hn=()=>Ae(u.image),Vn=()=>Ae(u["progress-steps"]),Bt=()=>Ae(u["validation-message"]),Te=()=>mt(`.${u.actions} .${u.confirm}`),Ne=()=>mt(`.${u.actions} .${u.deny}`),$r=()=>Ae(u["input-label"]),Xe=()=>mt(`.${u.loader}`),He=()=>mt(`.${u.actions} .${u.cancel}`),bt=()=>Ae(u.actions),jn=()=>Ae(u.footer),Rt=()=>Ae(u["timer-progress-bar"]),Qt=()=>Ae(u.close),Hr=`
|
|
13
|
+
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 J(r){if(!r||r=="default")return{login:function(g){return window.location.assign(e.createLoginUrl(g)),k().promise},logout:function(g){return window.location.replace(e.createLogoutUrl(g)),k().promise},register:function(g){return window.location.assign(e.createRegisterUrl(g)),k().promise},accountManagement:function(){var g=e.createAccountUrl();if(typeof g<"u")window.location.href=g;else throw"Not supported by the OIDC server";return k().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)},A=function(){return e.redirectUri||"http://localhost"};return{login:function(g){var y=k(),S=p(g),x=e.createLoginUrl(g),R=a(x,"_blank",S),$=!1,me=!1,ue=function(){me=!0,R.close()};return R.addEventListener("loadstart",function(te){if(te.url.indexOf(A())==0){var Be=_(te.url);he(Be,y),ue(),$=!0}}),R.addEventListener("loaderror",function(te){if(!$)if(te.url.indexOf(A())==0){var Be=_(te.url);he(Be,y),ue(),$=!0}else y.setError(),ue()}),R.addEventListener("exit",function(te){me||y.setError({reason:"closed_by_user"})}),y.promise},logout:function(g){var y=k(),S=e.createLogoutUrl(g),x=a(S,"_blank","location=no,hidden=yes,clearcache=yes"),R;return x.addEventListener("loadstart",function($){$.url.indexOf(A())==0&&x.close()}),x.addEventListener("loaderror",function($){$.url.indexOf(A())==0||(R=!0),x.close()}),x.addEventListener("exit",function($){R?y.setError():(e.clearToken(),y.setSuccess())}),y.promise},register:function(g){var y=k(),S=e.createRegisterUrl(),x=p(g),R=a(S,"_blank",x);return R.addEventListener("loadstart",function($){if($.url.indexOf(A())==0){R.close();var me=_($.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(A())==0&&y.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(g){return A()}}}if(r=="cordova-native")return c.enable=!1,{login:function(g){var y=k(),S=e.createLoginUrl(g);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var R=_(x.url);he(R,y)}),window.cordova.plugins.browsertab.openUrl(S),y.promise},logout:function(g){var y=k(),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=k(),S=e.createRegisterUrl(g);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var R=_(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 A=localStorage.getItem(p);if(A)try{var g=JSON.parse(A).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 A=f("kc-callback-"+p);if(b("kc-callback-"+p,"",a(-100)),A)return JSON.parse(A)}},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 A=new Date;return A.setTime(A.getTime()+p*60*1e3),A},f=function(p){for(var A=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(A)==0)return S.substring(A.length,S.length)}return""},b=function(p,A,g){var y=p+"="+A+"; 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))}}}const $e=new On,Sr=(t,e)=>{$e.init({onLoad:"login-required"}).then(async n=>{n&&await Tr(),t()}).catch(n=>{e(n)})},Tr=async()=>{const t=await $e.loadUserInfo();ne.User.email=t.email??"",ne.User.emailVerified=t.email_verified===!0,ne.User.firstName=t.given_name??"",ne.User.lastName=t.family_name??"",ne.User.name=t.name??"",ne.User.sub=t.sub??"",ne.User.username=t.preferred_username??"",ne.User.roles=[...t.role??[]],ne.User.groups=[...t.group??[]],ne.User.IsInRole=e=>ne.User.roles.includes(e)},ne={Instance:$e,User:{},SetUrl:t=>{$e.authServerUrl=t},SetRealm:t=>{$e.realm=t},SetClientId:t=>{$e.clientId=t},CallLogin:Sr,CallLogout:()=>{$e.logout({redirectUri:location.origin}).then(()=>{sessionStorage.removeItem("user-info")})}},Fn="SweetAlert2:",Lr=t=>{const e=[];for(let n=0;n<t.length;n++)e.indexOf(t[n])===-1&&e.push(t[n]);return e},Yt=t=>t.charAt(0).toUpperCase()+t.slice(1),ye=t=>Array.prototype.slice.call(t),de=t=>{console.warn(`${Fn} ${typeof t=="object"?t.join(" "):t}`)},He=t=>{console.error(`${Fn} ${t}`)},Mn=[],Ir=t=>{Mn.includes(t)||(Mn.push(t),de(t))},Pr=(t,e)=>{Ir(`"${t}" is deprecated and will be removed in the next major release. Please use "${e}" instead.`)},It=t=>typeof t=="function"?t():t,Jt=t=>t&&typeof t.toPromise=="function",pt=t=>Jt(t)?t.toPromise():Promise.resolve(t),Xt=t=>t&&Promise.resolve(t)===t,Xe={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},Br=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],Rr={},Or=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Nn=t=>Object.prototype.hasOwnProperty.call(Xe,t),Un=t=>Br.indexOf(t)!==-1,Zt=t=>Rr[t],Fr=t=>{Nn(t)||de(`Unknown parameter "${t}"`)},Mr=t=>{Or.includes(t)&&de(`The parameter "${t}" is incompatible with toasts`)},Nr=t=>{Zt(t)&&Pr(t,Zt(t))},Ur=t=>{!t.backdrop&&t.allowOutsideClick&&de('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const e in t)Fr(e),t.toast&&Mr(e),Nr(e)},Dr="swal2-",Dn=t=>{const e={};for(const n in t)e[t[n]]=Dr+t[n];return e},u=Dn(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),mt=Dn(["success","warning","info","question","error"]),oe=()=>document.body.querySelector(`.${u.container}`),gt=t=>{const e=oe();return e?e.querySelector(t):null},Ae=t=>gt(`.${t}`),j=()=>Ae(u.popup),bt=()=>Ae(u.icon),$n=()=>Ae(u.title),Pt=()=>Ae(u["html-container"]),Hn=()=>Ae(u.image),Vn=()=>Ae(u["progress-steps"]),Bt=()=>Ae(u["validation-message"]),Se=()=>gt(`.${u.actions} .${u.confirm}`),Ne=()=>gt(`.${u.actions} .${u.deny}`),$r=()=>Ae(u["input-label"]),Ze=()=>gt(`.${u.loader}`),Ve=()=>gt(`.${u.actions} .${u.cancel}`),yt=()=>Ae(u.actions),jn=()=>Ae(u.footer),Rt=()=>Ae(u["timer-progress-bar"]),Qt=()=>Ae(u.close),Hr=`
|
|
14
14
|
a[href],
|
|
15
15
|
area[href],
|
|
16
16
|
input:not([disabled]),
|
|
@@ -25,7 +25,7 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
|
|
|
25
25
|
audio[controls],
|
|
26
26
|
video[controls],
|
|
27
27
|
summary
|
|
28
|
-
`,en=()=>{const t=ye(j().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((n,o)=>{const i=parseInt(n.getAttribute("tabindex")),c=parseInt(o.getAttribute("tabindex"));return i>c?1:i<c?-1:0}),e=ye(j().querySelectorAll(Hr)).filter(n=>n.getAttribute("tabindex")!=="-1");return Lr(t.concat(e)).filter(n=>we(n))},tn=()=>Re(document.body,u.shown)&&!Re(document.body,u["toast-shown"])&&!Re(document.body,u["no-backdrop"]),Ot=()=>j()&&Re(j(),u.toast),Vr=()=>j().hasAttribute("data-loading"),
|
|
28
|
+
`,en=()=>{const t=ye(j().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((n,o)=>{const i=parseInt(n.getAttribute("tabindex")),c=parseInt(o.getAttribute("tabindex"));return i>c?1:i<c?-1:0}),e=ye(j().querySelectorAll(Hr)).filter(n=>n.getAttribute("tabindex")!=="-1");return Lr(t.concat(e)).filter(n=>we(n))},tn=()=>Re(document.body,u.shown)&&!Re(document.body,u["toast-shown"])&&!Re(document.body,u["no-backdrop"]),Ot=()=>j()&&Re(j(),u.toast),Vr=()=>j().hasAttribute("data-loading"),Qe={previousBodyPadding:null},re=(t,e)=>{if(t.textContent="",e){const o=new DOMParser().parseFromString(e,"text/html");ye(o.querySelector("head").childNodes).forEach(i=>{t.appendChild(i)}),ye(o.querySelector("body").childNodes).forEach(i=>{t.appendChild(i)})}},Re=(t,e)=>{if(!e)return!1;const n=e.split(/\s+/);for(let o=0;o<n.length;o++)if(!t.classList.contains(n[o]))return!1;return!0},jr=(t,e)=>{ye(t.classList).forEach(n=>{!Object.values(u).includes(n)&&!Object.values(mt).includes(n)&&!Object.values(e.showClass).includes(n)&&t.classList.remove(n)})},Ee=(t,e,n)=>{if(jr(t,e),e.customClass&&e.customClass[n]){if(typeof e.customClass[n]!="string"&&!e.customClass[n].forEach)return de(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof e.customClass[n]}"`);H(t,e.customClass[n])}},nn=(t,e)=>{if(!e)return null;switch(e){case"select":case"textarea":case"file":return t.querySelector(`.${u.popup} > .${u[e]}`);case"checkbox":return t.querySelector(`.${u.popup} > .${u.checkbox} input`);case"radio":return t.querySelector(`.${u.popup} > .${u.radio} input:checked`)||t.querySelector(`.${u.popup} > .${u.radio} input:first-child`);case"range":return t.querySelector(`.${u.popup} > .${u.range} input`);default:return t.querySelector(`.${u.popup} > .${u.input}`)}},zn=t=>{if(t.focus(),t.type!=="file"){const e=t.value;t.value="",t.value=e}},Wn=(t,e,n)=>{!t||!e||(typeof e=="string"&&(e=e.split(/\s+/).filter(Boolean)),e.forEach(o=>{Array.isArray(t)?t.forEach(i=>{n?i.classList.add(o):i.classList.remove(o)}):n?t.classList.add(o):t.classList.remove(o)}))},H=(t,e)=>{Wn(t,e,!0)},Pe=(t,e)=>{Wn(t,e,!1)},Ue=(t,e)=>{const n=ye(t.childNodes);for(let o=0;o<n.length;o++)if(Re(n[o],e))return n[o]},wt=(t,e,n)=>{n===`${parseInt(n)}`&&(n=parseInt(n)),n||parseInt(n)===0?t.style[e]=typeof n=="number"?`${n}px`:n:t.style.removeProperty(e)},Q=(t,e="flex")=>{t.style.display=e},se=t=>{t.style.display="none"},qn=(t,e,n,o)=>{const i=t.querySelector(e);i&&(i.style[n]=o)},Ft=(t,e,n)=>{e?Q(t,n):se(t)},we=t=>!!(t&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)),zr=()=>!we(Se())&&!we(Ne())&&!we(Ve()),Kn=t=>t.scrollHeight>t.clientHeight,Gn=t=>{const e=window.getComputedStyle(t),n=parseFloat(e.getPropertyValue("animation-duration")||"0"),o=parseFloat(e.getPropertyValue("transition-duration")||"0");return n>0||o>0},on=(t,e=!1)=>{const n=Rt();we(n)&&(e&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition=`width ${t/1e3}s linear`,n.style.width="0%"},10))},Wr=()=>{const t=Rt(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";const n=parseInt(window.getComputedStyle(t).width),o=e/n*100;t.style.removeProperty("transition"),t.style.width=`${o}%`},Yn=()=>typeof window>"u"||typeof document>"u",qr=100,M={},Kr=()=>{M.previousActiveElement&&M.previousActiveElement.focus?(M.previousActiveElement.focus(),M.previousActiveElement=null):document.body&&document.body.focus()},Gr=t=>new Promise(e=>{if(!t)return e();const n=window.scrollX,o=window.scrollY;M.restoreFocusTimeout=setTimeout(()=>{Kr(),e()},qr),window.scrollTo(n,o)}),Yr=`
|
|
29
29
|
<div aria-labelledby="${u.title}" aria-describedby="${u["html-container"]}" class="${u.popup}" tabindex="-1">
|
|
30
30
|
<button type="button" class="${u.close}"></button>
|
|
31
31
|
<ul class="${u["progress-steps"]}"></ul>
|
|
@@ -58,7 +58,7 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
|
|
|
58
58
|
<div class="${u["timer-progress-bar"]}"></div>
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
61
|
-
`.replace(/(^|\n)\s*/g,""),Jr=()=>{const t=oe();return t?(t.remove(),Pe([document.documentElement,document.body],[u["no-backdrop"],u["toast-shown"],u["has-column"]]),!0):!1},
|
|
61
|
+
`.replace(/(^|\n)\s*/g,""),Jr=()=>{const t=oe();return t?(t.remove(),Pe([document.documentElement,document.body],[u["no-backdrop"],u["toast-shown"],u["has-column"]]),!0):!1},je=()=>{M.currentInstance.resetValidationMessage()},Xr=()=>{const t=j(),e=Ue(t,u.input),n=Ue(t,u.file),o=t.querySelector(`.${u.range} input`),i=t.querySelector(`.${u.range} output`),c=Ue(t,u.select),E=t.querySelector(`.${u.checkbox} input`),I=Ue(t,u.textarea);e.oninput=je,n.onchange=je,c.onchange=je,E.onchange=je,I.oninput=je,o.oninput=()=>{je(),i.value=o.value},o.onchange=()=>{je(),o.nextSibling.value=o.value}},Zr=t=>typeof t=="string"?document.querySelector(t):t,Qr=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")},es=t=>{window.getComputedStyle(t).direction==="rtl"&&H(oe(),u.rtl)},ts=t=>{const e=Jr();if(Yn()){He("SweetAlert2 requires document to initialize");return}const n=document.createElement("div");n.className=u.container,e&&H(n,u["no-transition"]),re(n,Yr);const o=Zr(t.target);o.appendChild(n),Qr(t),es(o),Xr()},rn=(t,e)=>{t instanceof HTMLElement?e.appendChild(t):typeof t=="object"?ns(t,e):t&&re(e,t)},ns=(t,e)=>{t.jquery?os(e,t):re(e,t.toString())},os=(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))},vt=(()=>{if(Yn())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})(),rs=()=>{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},ss=(t,e)=>{const n=yt(),o=Ze();!e.showConfirmButton&&!e.showDenyButton&&!e.showCancelButton?se(n):Q(n),Ee(n,e,"actions"),is(n,o,e),re(o,e.loaderHtml),Ee(o,e,"loader")};function is(t,e,n){const o=Se(),i=Ne(),c=Ve();sn(o,"confirm",n),sn(i,"deny",n),sn(c,"cancel",n),as(o,i,c,n),n.reverseButtons&&(n.toast?(t.insertBefore(c,o),t.insertBefore(i,o)):(t.insertBefore(c,e),t.insertBefore(i,e),t.insertBefore(o,e)))}function as(t,e,n,o){if(!o.buttonsStyling)return Pe([t,e,n],u.styled);H([t,e,n],u.styled),o.confirmButtonColor&&(t.style.backgroundColor=o.confirmButtonColor,H(t,u["default-outline"])),o.denyButtonColor&&(e.style.backgroundColor=o.denyButtonColor,H(e,u["default-outline"])),o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,H(n,u["default-outline"]))}function sn(t,e,n){Ft(t,n[`show${Yt(e)}Button`],"inline-block"),re(t,n[`${e}ButtonText`]),t.setAttribute("aria-label",n[`${e}ButtonAriaLabel`]),t.className=u[e],Ee(t,n,`${e}Button`),H(t,n[`${e}ButtonClass`])}function ls(t,e){typeof e=="string"?t.style.background=e:e||H([document.documentElement,document.body],u["no-backdrop"])}function cs(t,e){e in u?H(t,u[e]):(de('The "position" parameter is not valid, defaulting to "center"'),H(t,u.center))}function us(t,e){if(e&&typeof e=="string"){const n=`grow-${e}`;n in u&&H(t,u[n])}}const ds=(t,e)=>{const n=oe();n&&(ls(n,e.backdrop),cs(n,e.position),us(n,e.grow),Ee(n,e,"container"))},U={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},fs=["input","file","range","select","radio","checkbox","textarea"],hs=(t,e)=>{const n=j(),o=U.innerParams.get(t),i=!o||e.input!==o.input;fs.forEach(c=>{const E=u[c],I=Ue(n,E);gs(c,e.inputAttributes),I.className=E,i&&se(I)}),e.input&&(i&&ps(e),bs(e))},ps=t=>{if(!fe[t.input])return He(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${t.input}"`);const e=Jn(t.input),n=fe[t.input](e,t);Q(n),setTimeout(()=>{zn(n)})},ms=t=>{for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].name;["type","value","style"].includes(n)||t.removeAttribute(n)}},gs=(t,e)=>{const n=nn(j(),t);if(n){ms(n);for(const o in e)n.setAttribute(o,e[o])}},bs=t=>{const e=Jn(t.input);t.customClass&&H(e,t.customClass.input)},an=(t,e)=>{(!t.placeholder||e.inputPlaceholder)&&(t.placeholder=e.inputPlaceholder)},kt=(t,e,n)=>{if(n.inputLabel){t.id=u.input;const o=document.createElement("label"),i=u["input-label"];o.setAttribute("for",t.id),o.className=i,H(o,n.customClass.inputLabel),o.innerText=n.inputLabel,e.insertAdjacentElement("beforebegin",o)}},Jn=t=>{const e=u[t]?u[t]:u.input;return Ue(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:Xt(e.inputValue)||de(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof e.inputValue}"`),kt(t,t,e),an(t,e),t.type=e.input,t),fe.file=(t,e)=>(kt(t,t,e),an(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,kt(n,t,e),t},fe.select=(t,e)=>{if(t.textContent="",e.inputPlaceholder){const n=document.createElement("option");re(n,e.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,t.appendChild(n)}return kt(t,t,e),t},fe.radio=t=>(t.textContent="",t),fe.checkbox=(t,e)=>{const n=nn(j(),"checkbox");n.value="1",n.id=u.checkbox,n.checked=!!e.inputValue;const o=t.querySelector("span");return re(o,e.inputPlaceholder),t},fe.textarea=(t,e)=>{t.value=e.inputValue,an(t,e),kt(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),i=()=>{const c=t.offsetWidth+n(t);c>o?j().style.width=`${c}px`:j().style.width=null};new MutationObserver(i).observe(t,{attributes:!0,attributeFilter:["style"]})}}),t};const ys=(t,e)=>{const n=Pt();Ee(n,e,"htmlContainer"),e.html?(rn(e.html,n),Q(n,"block")):e.text?(n.textContent=e.text,Q(n,"block")):se(n),hs(t,e)},ws=(t,e)=>{const n=jn();Ft(n,e.footer),e.footer&&rn(e.footer,n),Ee(n,e,"footer")},vs=(t,e)=>{const n=Qt();re(n,e.closeButtonHtml),Ee(n,e,"closeButton"),Ft(n,e.showCloseButton),n.setAttribute("aria-label",e.closeButtonAriaLabel)},ks=(t,e)=>{const n=U.innerParams.get(t),o=bt();if(n&&e.icon===n.icon){Zn(o,e),Xn(o,e);return}if(!e.icon&&!e.iconHtml)return se(o);if(e.icon&&Object.keys(mt).indexOf(e.icon)===-1)return He(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${e.icon}"`),se(o);Q(o),Zn(o,e),Xn(o,e),H(o,e.showClass.icon)},Xn=(t,e)=>{for(const n in mt)e.icon!==n&&Pe(t,mt[n]);H(t,mt[e.icon]),Es(t,e),_s(),Ee(t,e,"icon")},_s=()=>{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},Cs=`
|
|
62
62
|
<div class="swal2-success-circular-line-left"></div>
|
|
63
63
|
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
64
64
|
<div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
|
|
@@ -68,13 +68,13 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
|
|
|
68
68
|
<span class="swal2-x-mark-line-left"></span>
|
|
69
69
|
<span class="swal2-x-mark-line-right"></span>
|
|
70
70
|
</span>
|
|
71
|
-
`,Zn=(t,e)=>{t.textContent="",e.iconHtml?re(t,Qn(e.iconHtml)):e.icon==="success"?re(t,Cs):e.icon==="error"?re(t,As):re(t,Qn({question:"?",warning:"!",info:"i"}[e.icon]))},Es=(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"])qn(t,n,"backgroundColor",e.iconColor);qn(t,".swal2-success-ring","borderColor",e.iconColor)}},Qn=t=>`<div class="${u["icon-content"]}">${t}</div>`,xs=(t,e)=>{const n=Hn();if(!e.imageUrl)return se(n);Q(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt),
|
|
71
|
+
`,Zn=(t,e)=>{t.textContent="",e.iconHtml?re(t,Qn(e.iconHtml)):e.icon==="success"?re(t,Cs):e.icon==="error"?re(t,As):re(t,Qn({question:"?",warning:"!",info:"i"}[e.icon]))},Es=(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"])qn(t,n,"backgroundColor",e.iconColor);qn(t,".swal2-success-ring","borderColor",e.iconColor)}},Qn=t=>`<div class="${u["icon-content"]}">${t}</div>`,xs=(t,e)=>{const n=Hn();if(!e.imageUrl)return se(n);Q(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt),wt(n,"width",e.imageWidth),wt(n,"height",e.imageHeight),n.className=u.image,Ee(n,e,"image")},Ss=t=>{const e=document.createElement("li");return H(e,u["progress-step"]),re(e,t),e},Ts=t=>{const e=document.createElement("li");return H(e,u["progress-step-line"]),t.progressStepsDistance&&(e.style.width=t.progressStepsDistance),e},Ls=(t,e)=>{const n=Vn();if(!e.progressSteps||e.progressSteps.length===0)return se(n);Q(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,i)=>{const c=Ss(o);if(n.appendChild(c),i===e.currentProgressStep&&H(c,u["active-progress-step"]),i!==e.progressSteps.length-1){const E=Ts(e);n.appendChild(E)}})},Is=(t,e)=>{const n=$n();Ft(n,e.title||e.titleText,"block"),e.title&&rn(e.title,n),e.titleText&&(n.innerText=e.titleText),Ee(n,e,"title")},Ps=(t,e)=>{const n=oe(),o=j();e.toast?(wt(n,"width",e.width),o.style.width="100%",o.insertBefore(Ze(),bt())):wt(o,"width",e.width),wt(o,"padding",e.padding),e.color&&(o.style.color=e.color),e.background&&(o.style.background=e.background),se(Bt()),Bs(o,e)},Bs=(t,e)=>{t.className=`${u.popup} ${we(t)?e.showClass.popup:""}`,e.toast?(H([document.documentElement,document.body],u["toast-shown"]),H(t,u.toast)):H(t,u.modal),Ee(t,e,"popup"),typeof e.customClass=="string"&&H(t,e.customClass),e.icon&&H(t,u[`icon-${e.icon}`])},eo=(t,e)=>{Ps(t,e),ds(t,e),Ls(t,e),ks(t,e),xs(t,e),Is(t,e),vs(t,e),ys(t,e),ss(t,e),ws(t,e),typeof e.didRender=="function"&&e.didRender(j())},et=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Rs=()=>{ye(document.body.children).forEach(e=>{e===oe()||e.contains(oe())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))})},to=()=>{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")})},no=["swal-title","swal-html","swal-footer"],Os=t=>{const e=typeof t.template=="string"?document.querySelector(t.template):t.template;if(!e)return{};const n=e.content;return Hs(n),Object.assign(Fs(n),Ms(n),Ns(n),Us(n),Ds(n),$s(n,no))},Fs=t=>{const e={};return ye(t.querySelectorAll("swal-param")).forEach(n=>{ze(n,["name","value"]);const o=n.getAttribute("name"),i=n.getAttribute("value");typeof Xe[o]=="boolean"&&i==="false"&&(e[o]=!1),typeof Xe[o]=="object"&&(e[o]=JSON.parse(i))}),e},Ms=t=>{const e={};return ye(t.querySelectorAll("swal-button")).forEach(n=>{ze(n,["type","color","aria-label"]);const o=n.getAttribute("type");e[`${o}ButtonText`]=n.innerHTML,e[`show${Yt(o)}Button`]=!0,n.hasAttribute("color")&&(e[`${o}ButtonColor`]=n.getAttribute("color")),n.hasAttribute("aria-label")&&(e[`${o}ButtonAriaLabel`]=n.getAttribute("aria-label"))}),e},Ns=t=>{const e={},n=t.querySelector("swal-image");return n&&(ze(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},Us=t=>{const e={},n=t.querySelector("swal-icon");return n&&(ze(n,["type","color"]),n.hasAttribute("type")&&(e.icon=n.getAttribute("type")),n.hasAttribute("color")&&(e.iconColor=n.getAttribute("color")),e.iconHtml=n.innerHTML),e},Ds=t=>{const e={},n=t.querySelector("swal-input");n&&(ze(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(i=>{ze(i,["value"]);const c=i.getAttribute("value"),E=i.innerHTML;e.inputOptions[c]=E})),e},$s=(t,e)=>{const n={};for(const o in e){const i=e[o],c=t.querySelector(i);c&&(ze(c,[]),n[i.replace(/^swal-/,"")]=c.innerHTML.trim())}return n},Hs=t=>{const e=no.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}>`)})},ze=(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."}`])})},oo={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 Vs(t){t.inputValidator||Object.keys(oo).forEach(e=>{t.input===e&&(t.inputValidator=oo[e])})}function js(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 zs(t){Vs(t),t.showLoaderOnConfirm&&!t.preConfirm&&de(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
|
72
72
|
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
73
73
|
https://sweetalert2.github.io/#ajax-request`),js(t),typeof t.title=="string"&&(t.title=t.title.split(`
|
|
74
|
-
`).join("<br />")),ts(t)}class Ws{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 qs=()=>{Ze.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(Ze.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Ze.previousBodyPadding+rs()}px`)},Ks=()=>{Ze.previousBodyPadding!==null&&(document.body.style.paddingRight=`${Ze.previousBodyPadding}px`,Ze.previousBodyPadding=null)},Gs=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!Re(document.body,u.iosfix)){const e=document.body.scrollTop;document.body.style.top=`${e*-1}px`,H(document.body,u.iosfix),Js(),Ys()}},Ys=()=>{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&&(oe().style.paddingBottom="44px")},Js=()=>{const t=oe();let e;t.ontouchstart=n=>{e=Xs(n)},t.ontouchmove=n=>{e&&(n.preventDefault(),n.stopPropagation())}},Xs=t=>{const e=t.target,n=oe();return Zs(t)||Qs(t)?!1:e===n||!Kn(n)&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"&&!(Kn(Pt())&&Pt().contains(e))},Zs=t=>t.touches&&t.touches.length&&t.touches[0].touchType==="stylus",Qs=t=>t.touches&&t.touches.length>1,ei=()=>{if(Re(document.body,u.iosfix)){const t=parseInt(document.body.style.top,10);Pe(document.body,u.iosfix),document.body.style.top="",document.body.scrollTop=t*-1}},ro=10,ti=t=>{const e=oe(),n=j();typeof t.willOpen=="function"&&t.willOpen(n);const i=window.getComputedStyle(document.body).overflowY;ri(e,n,t),setTimeout(()=>{ni(e,n)},ro),tn()&&(oi(e,t.scrollbarPadding,i),Rs()),!Ot()&&!M.previousActiveElement&&(M.previousActiveElement=document.activeElement),typeof t.didOpen=="function"&&setTimeout(()=>t.didOpen(n)),Pe(e,u["no-transition"])},so=t=>{const e=j();if(t.target!==e)return;const n=oe();e.removeEventListener(wt,so),n.style.overflowY="auto"},ni=(t,e)=>{wt&&Gn(e)?(t.style.overflowY="hidden",e.addEventListener(wt,so)):t.style.overflowY="auto"},oi=(t,e,n)=>{Gs(),e&&n!=="hidden"&&qs(),setTimeout(()=>{t.scrollTop=0})},ri=(t,e,n)=>{H(t,n.showClass.backdrop),e.style.setProperty("opacity","0","important"),Q(e,"grid"),setTimeout(()=>{H(e,n.showClass.popup),e.style.removeProperty("opacity")},ro),H([document.documentElement,document.body],u.shown),n.heightAuto&&n.backdrop&&!n.toast&&H([document.documentElement,document.body],u["height-auto"])},et=t=>{let e=j();e||new nt,e=j();const n=Xe();Ot()?se(gt()):si(e,t),Q(n),e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},si=(t,e)=>{const n=bt(),o=Xe();!e&&we(Te())&&(e=Te()),Q(n),e&&(se(e),o.setAttribute("data-button-to-replace",e.className)),o.parentNode.insertBefore(o,e),H([t,n],u.loading)},ii=(t,e)=>{e.input==="select"||e.input==="radio"?di(t,e):["text","email","number","tel","textarea"].includes(e.input)&&(Jt(e.inputValue)||Xt(e.inputValue))&&(et(Te()),fi(t,e))},ai=(t,e)=>{const n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return li(n);case"radio":return ci(n);case"file":return ui(n);default:return e.inputAutoTrim?n.value.trim():n.value}},li=t=>t.checked?1:0,ci=t=>t.checked?t.value:null,ui=t=>t.files.length?t.getAttribute("multiple")!==null?t.files:t.files[0]:null,di=(t,e)=>{const n=j(),o=i=>hi[e.input](n,ln(i),e);Jt(e.inputOptions)||Xt(e.inputOptions)?(et(Te()),ht(e.inputOptions).then(i=>{t.hideLoading(),o(i)})):typeof e.inputOptions=="object"?o(e.inputOptions):$e(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`)},fi=(t,e)=>{const n=t.getInput();se(n),ht(e.inputValue).then(o=>{n.value=e.input==="number"?parseFloat(o)||0:`${o}`,Q(n),n.focus(),t.hideLoading()}).catch(o=>{$e(`Error in inputValue promise: ${o}`),n.value="",Q(n),n.focus(),t.hideLoading()})},hi={select:(t,e,n)=>{const o=Ue(t,u.select),i=(c,E,I)=>{const d=document.createElement("option");d.value=I,re(d,E),d.selected=io(I,n.inputValue),c.appendChild(d)};e.forEach(c=>{const E=c[0],I=c[1];if(Array.isArray(I)){const d=document.createElement("optgroup");d.label=E,d.disabled=!1,o.appendChild(d),I.forEach(V=>i(d,V[1],V[0]))}else i(o,I,E)}),o.focus()},radio:(t,e,n)=>{const o=Ue(t,u.radio);e.forEach(c=>{const E=c[0],I=c[1],d=document.createElement("input"),V=document.createElement("label");d.type="radio",d.name=u.radio,d.value=E,io(E,n.inputValue)&&(d.checked=!0);const W=document.createElement("span");re(W,I),W.className=u.label,V.appendChild(d),V.appendChild(W),o.appendChild(V)});const i=o.querySelectorAll("input");i.length&&i[0].focus()}},ln=t=>{const e=[];return typeof Map<"u"&&t instanceof Map?t.forEach((n,o)=>{let i=n;typeof i=="object"&&(i=ln(i)),e.push([o,i])}):Object.keys(t).forEach(n=>{let o=t[n];typeof o=="object"&&(o=ln(o)),e.push([n,o])}),e},io=(t,e)=>e&&e.toString()===t.toString();function ao(){const t=U.innerParams.get(this);if(!t)return;const e=U.domCache.get(this);se(e.loader),Ot()?t.icon&&Q(gt()):pi(e),Pe([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 pi=t=>{const e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?Q(e[0],"inline-block"):zr()&&se(t.actions)};function mi(t){const e=U.innerParams.get(t||this),n=U.domCache.get(t||this);return n?nn(n.popup,e.input):null}const kt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap},gi=()=>we(j()),lo=()=>Te()&&Te().click(),bi=()=>Ne()&&Ne().click(),yi=()=>He()&&He().click(),co=t=>{t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},wi=(t,e,n,o)=>{co(e),n.toast||(e.keydownHandler=i=>ki(t,i,o),e.keydownTarget=n.keydownListenerCapture?window:j(),e.keydownListenerCapture=n.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},cn=(t,e,n)=>{const o=en();if(o.length)return e=e+n,e===o.length?e=0:e===-1&&(e=o.length-1),o[e].focus();j().focus()},uo=["ArrowRight","ArrowDown"],vi=["ArrowLeft","ArrowUp"],ki=(t,e,n)=>{const o=U.innerParams.get(t);o&&(e.isComposing||e.keyCode===229||(o.stopKeydownPropagation&&e.stopPropagation(),e.key==="Enter"?_i(t,e,o):e.key==="Tab"?Ci(e,o):[...uo,...vi].includes(e.key)?Ai(e.key):e.key==="Escape"&&Ei(e,o,n)))},_i=(t,e,n)=>{if(It(n.allowEnterKey)&&e.target&&t.getInput()&&e.target.outerHTML===t.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;lo(),e.preventDefault()}},Ci=(t,e)=>{const n=t.target,o=en();let i=-1;for(let c=0;c<o.length;c++)if(n===o[c]){i=c;break}t.shiftKey?cn(e,i,-1):cn(e,i,1),t.stopPropagation(),t.preventDefault()},Ai=t=>{const e=Te(),n=Ne(),o=He();if(![e,n,o].includes(document.activeElement))return;const i=uo.includes(t)?"nextElementSibling":"previousElementSibling";let c=document.activeElement;for(let E=0;E<bt().children.length;E++){if(c=c[i],!c)return;if(we(c)&&c instanceof HTMLButtonElement)break}c instanceof HTMLButtonElement&&c.focus()},Ei=(t,e,n)=>{It(e.allowEscapeKey)&&(t.preventDefault(),n(Qe.esc))};function fo(t,e,n,o){Ot()?ho(t,o):(Gr(n).then(()=>ho(t,o)),co(M)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),tn()&&(Ks(),ei(),to()),xi()}function xi(){Pe([document.documentElement,document.body],[u.shown,u["height-auto"],u["no-backdrop"],u["toast-shown"]])}function Mt(t){t=Ii(t);const e=kt.swalPromiseResolve.get(this),n=Si(this);this.isAwaitingPromise()?t.isDismissed||(_t(this),e(t)):n&&e(t)}function Ti(){return!!U.awaitingPromise.get(this)}const Si=t=>{const e=j();if(!e)return!1;const n=U.innerParams.get(t);if(!n||Re(e,n.hideClass.popup))return!1;Pe(e,n.showClass.popup),H(e,n.hideClass.popup);const o=oe();return Pe(o,n.showClass.backdrop),H(o,n.hideClass.backdrop),Pi(t,e,n),!0};function Li(t){const e=kt.swalPromiseReject.get(this);_t(this),e&&e(t)}const _t=t=>{t.isAwaitingPromise()&&(U.awaitingPromise.delete(t),U.innerParams.get(t)||t._destroy())},Ii=t=>typeof t>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t),Pi=(t,e,n)=>{const o=oe(),i=wt&&Gn(e);typeof n.willClose=="function"&&n.willClose(e),i?Bi(t,e,o,n.returnFocus,n.didClose):fo(t,o,n.returnFocus,n.didClose)},Bi=(t,e,n,o,i)=>{M.swalCloseEventFinishedCallback=fo.bind(null,t,n,o,i),e.addEventListener(wt,function(c){c.target===e&&(M.swalCloseEventFinishedCallback(),delete M.swalCloseEventFinishedCallback)})},ho=(t,e)=>{setTimeout(()=>{typeof e=="function"&&e.bind(t.params)(),t._destroy()})};function po(t,e,n){const o=U.domCache.get(t);e.forEach(i=>{o[i].disabled=n})}function mo(t,e){if(!t)return!1;if(t.type==="radio"){const o=t.parentNode.parentNode.querySelectorAll("input");for(let i=0;i<o.length;i++)o[i].disabled=e}else t.disabled=e}function Ri(){po(this,["confirmButton","denyButton","cancelButton"],!1)}function Oi(){po(this,["confirmButton","denyButton","cancelButton"],!0)}function Fi(){return mo(this.getInput(),!1)}function Mi(){return mo(this.getInput(),!0)}function Ni(t){const e=U.domCache.get(this),n=U.innerParams.get(this);re(e.validationMessage,t),e.validationMessage.className=u["validation-message"],n.customClass&&n.customClass.validationMessage&&H(e.validationMessage,n.customClass.validationMessage),Q(e.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedby",u["validation-message"]),zn(o),H(o,u.inputerror))}function Ui(){const t=U.domCache.get(this);t.validationMessage&&se(t.validationMessage);const e=this.getInput();e&&(e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedby"),Pe(e,u.inputerror))}function Di(){return U.domCache.get(this).progressSteps}function $i(t){const e=j(),n=U.innerParams.get(this);if(!e||Re(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=Hi(t),i=Object.assign({},n,o);eo(this,i),U.innerParams.set(this,i),Object.defineProperties(this,{params:{value:Object.assign({},this.params,t),writable:!1,enumerable:!0}})}const Hi=t=>{const e={};return Object.keys(t).forEach(n=>{Un(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
|
|
74
|
+
`).join("<br />")),ts(t)}class Ws{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 qs=()=>{Qe.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(Qe.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Qe.previousBodyPadding+rs()}px`)},Ks=()=>{Qe.previousBodyPadding!==null&&(document.body.style.paddingRight=`${Qe.previousBodyPadding}px`,Qe.previousBodyPadding=null)},Gs=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!Re(document.body,u.iosfix)){const e=document.body.scrollTop;document.body.style.top=`${e*-1}px`,H(document.body,u.iosfix),Js(),Ys()}},Ys=()=>{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&&(oe().style.paddingBottom="44px")},Js=()=>{const t=oe();let e;t.ontouchstart=n=>{e=Xs(n)},t.ontouchmove=n=>{e&&(n.preventDefault(),n.stopPropagation())}},Xs=t=>{const e=t.target,n=oe();return Zs(t)||Qs(t)?!1:e===n||!Kn(n)&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"&&!(Kn(Pt())&&Pt().contains(e))},Zs=t=>t.touches&&t.touches.length&&t.touches[0].touchType==="stylus",Qs=t=>t.touches&&t.touches.length>1,ei=()=>{if(Re(document.body,u.iosfix)){const t=parseInt(document.body.style.top,10);Pe(document.body,u.iosfix),document.body.style.top="",document.body.scrollTop=t*-1}},ro=10,ti=t=>{const e=oe(),n=j();typeof t.willOpen=="function"&&t.willOpen(n);const i=window.getComputedStyle(document.body).overflowY;ri(e,n,t),setTimeout(()=>{ni(e,n)},ro),tn()&&(oi(e,t.scrollbarPadding,i),Rs()),!Ot()&&!M.previousActiveElement&&(M.previousActiveElement=document.activeElement),typeof t.didOpen=="function"&&setTimeout(()=>t.didOpen(n)),Pe(e,u["no-transition"])},so=t=>{const e=j();if(t.target!==e)return;const n=oe();e.removeEventListener(vt,so),n.style.overflowY="auto"},ni=(t,e)=>{vt&&Gn(e)?(t.style.overflowY="hidden",e.addEventListener(vt,so)):t.style.overflowY="auto"},oi=(t,e,n)=>{Gs(),e&&n!=="hidden"&&qs(),setTimeout(()=>{t.scrollTop=0})},ri=(t,e,n)=>{H(t,n.showClass.backdrop),e.style.setProperty("opacity","0","important"),Q(e,"grid"),setTimeout(()=>{H(e,n.showClass.popup),e.style.removeProperty("opacity")},ro),H([document.documentElement,document.body],u.shown),n.heightAuto&&n.backdrop&&!n.toast&&H([document.documentElement,document.body],u["height-auto"])},tt=t=>{let e=j();e||new ot,e=j();const n=Ze();Ot()?se(bt()):si(e,t),Q(n),e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},si=(t,e)=>{const n=yt(),o=Ze();!e&&we(Se())&&(e=Se()),Q(n),e&&(se(e),o.setAttribute("data-button-to-replace",e.className)),o.parentNode.insertBefore(o,e),H([t,n],u.loading)},ii=(t,e)=>{e.input==="select"||e.input==="radio"?di(t,e):["text","email","number","tel","textarea"].includes(e.input)&&(Jt(e.inputValue)||Xt(e.inputValue))&&(tt(Se()),fi(t,e))},ai=(t,e)=>{const n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return li(n);case"radio":return ci(n);case"file":return ui(n);default:return e.inputAutoTrim?n.value.trim():n.value}},li=t=>t.checked?1:0,ci=t=>t.checked?t.value:null,ui=t=>t.files.length?t.getAttribute("multiple")!==null?t.files:t.files[0]:null,di=(t,e)=>{const n=j(),o=i=>hi[e.input](n,ln(i),e);Jt(e.inputOptions)||Xt(e.inputOptions)?(tt(Se()),pt(e.inputOptions).then(i=>{t.hideLoading(),o(i)})):typeof e.inputOptions=="object"?o(e.inputOptions):He(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`)},fi=(t,e)=>{const n=t.getInput();se(n),pt(e.inputValue).then(o=>{n.value=e.input==="number"?parseFloat(o)||0:`${o}`,Q(n),n.focus(),t.hideLoading()}).catch(o=>{He(`Error in inputValue promise: ${o}`),n.value="",Q(n),n.focus(),t.hideLoading()})},hi={select:(t,e,n)=>{const o=Ue(t,u.select),i=(c,E,I)=>{const d=document.createElement("option");d.value=I,re(d,E),d.selected=io(I,n.inputValue),c.appendChild(d)};e.forEach(c=>{const E=c[0],I=c[1];if(Array.isArray(I)){const d=document.createElement("optgroup");d.label=E,d.disabled=!1,o.appendChild(d),I.forEach(V=>i(d,V[1],V[0]))}else i(o,I,E)}),o.focus()},radio:(t,e,n)=>{const o=Ue(t,u.radio);e.forEach(c=>{const E=c[0],I=c[1],d=document.createElement("input"),V=document.createElement("label");d.type="radio",d.name=u.radio,d.value=E,io(E,n.inputValue)&&(d.checked=!0);const W=document.createElement("span");re(W,I),W.className=u.label,V.appendChild(d),V.appendChild(W),o.appendChild(V)});const i=o.querySelectorAll("input");i.length&&i[0].focus()}},ln=t=>{const e=[];return typeof Map<"u"&&t instanceof Map?t.forEach((n,o)=>{let i=n;typeof i=="object"&&(i=ln(i)),e.push([o,i])}):Object.keys(t).forEach(n=>{let o=t[n];typeof o=="object"&&(o=ln(o)),e.push([n,o])}),e},io=(t,e)=>e&&e.toString()===t.toString();function ao(){const t=U.innerParams.get(this);if(!t)return;const e=U.domCache.get(this);se(e.loader),Ot()?t.icon&&Q(bt()):pi(e),Pe([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 pi=t=>{const e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?Q(e[0],"inline-block"):zr()&&se(t.actions)};function mi(t){const e=U.innerParams.get(t||this),n=U.domCache.get(t||this);return n?nn(n.popup,e.input):null}const _t={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap},gi=()=>we(j()),lo=()=>Se()&&Se().click(),bi=()=>Ne()&&Ne().click(),yi=()=>Ve()&&Ve().click(),co=t=>{t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},wi=(t,e,n,o)=>{co(e),n.toast||(e.keydownHandler=i=>ki(t,i,o),e.keydownTarget=n.keydownListenerCapture?window:j(),e.keydownListenerCapture=n.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},cn=(t,e,n)=>{const o=en();if(o.length)return e=e+n,e===o.length?e=0:e===-1&&(e=o.length-1),o[e].focus();j().focus()},uo=["ArrowRight","ArrowDown"],vi=["ArrowLeft","ArrowUp"],ki=(t,e,n)=>{const o=U.innerParams.get(t);o&&(e.isComposing||e.keyCode===229||(o.stopKeydownPropagation&&e.stopPropagation(),e.key==="Enter"?_i(t,e,o):e.key==="Tab"?Ci(e,o):[...uo,...vi].includes(e.key)?Ai(e.key):e.key==="Escape"&&Ei(e,o,n)))},_i=(t,e,n)=>{if(It(n.allowEnterKey)&&e.target&&t.getInput()&&e.target.outerHTML===t.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;lo(),e.preventDefault()}},Ci=(t,e)=>{const n=t.target,o=en();let i=-1;for(let c=0;c<o.length;c++)if(n===o[c]){i=c;break}t.shiftKey?cn(e,i,-1):cn(e,i,1),t.stopPropagation(),t.preventDefault()},Ai=t=>{const e=Se(),n=Ne(),o=Ve();if(![e,n,o].includes(document.activeElement))return;const i=uo.includes(t)?"nextElementSibling":"previousElementSibling";let c=document.activeElement;for(let E=0;E<yt().children.length;E++){if(c=c[i],!c)return;if(we(c)&&c instanceof HTMLButtonElement)break}c instanceof HTMLButtonElement&&c.focus()},Ei=(t,e,n)=>{It(e.allowEscapeKey)&&(t.preventDefault(),n(et.esc))};function fo(t,e,n,o){Ot()?ho(t,o):(Gr(n).then(()=>ho(t,o)),co(M)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),tn()&&(Ks(),ei(),to()),xi()}function xi(){Pe([document.documentElement,document.body],[u.shown,u["height-auto"],u["no-backdrop"],u["toast-shown"]])}function Mt(t){t=Ii(t);const e=_t.swalPromiseResolve.get(this),n=Ti(this);this.isAwaitingPromise()?t.isDismissed||(Ct(this),e(t)):n&&e(t)}function Si(){return!!U.awaitingPromise.get(this)}const Ti=t=>{const e=j();if(!e)return!1;const n=U.innerParams.get(t);if(!n||Re(e,n.hideClass.popup))return!1;Pe(e,n.showClass.popup),H(e,n.hideClass.popup);const o=oe();return Pe(o,n.showClass.backdrop),H(o,n.hideClass.backdrop),Pi(t,e,n),!0};function Li(t){const e=_t.swalPromiseReject.get(this);Ct(this),e&&e(t)}const Ct=t=>{t.isAwaitingPromise()&&(U.awaitingPromise.delete(t),U.innerParams.get(t)||t._destroy())},Ii=t=>typeof t>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t),Pi=(t,e,n)=>{const o=oe(),i=vt&&Gn(e);typeof n.willClose=="function"&&n.willClose(e),i?Bi(t,e,o,n.returnFocus,n.didClose):fo(t,o,n.returnFocus,n.didClose)},Bi=(t,e,n,o,i)=>{M.swalCloseEventFinishedCallback=fo.bind(null,t,n,o,i),e.addEventListener(vt,function(c){c.target===e&&(M.swalCloseEventFinishedCallback(),delete M.swalCloseEventFinishedCallback)})},ho=(t,e)=>{setTimeout(()=>{typeof e=="function"&&e.bind(t.params)(),t._destroy()})};function po(t,e,n){const o=U.domCache.get(t);e.forEach(i=>{o[i].disabled=n})}function mo(t,e){if(!t)return!1;if(t.type==="radio"){const o=t.parentNode.parentNode.querySelectorAll("input");for(let i=0;i<o.length;i++)o[i].disabled=e}else t.disabled=e}function Ri(){po(this,["confirmButton","denyButton","cancelButton"],!1)}function Oi(){po(this,["confirmButton","denyButton","cancelButton"],!0)}function Fi(){return mo(this.getInput(),!1)}function Mi(){return mo(this.getInput(),!0)}function Ni(t){const e=U.domCache.get(this),n=U.innerParams.get(this);re(e.validationMessage,t),e.validationMessage.className=u["validation-message"],n.customClass&&n.customClass.validationMessage&&H(e.validationMessage,n.customClass.validationMessage),Q(e.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedby",u["validation-message"]),zn(o),H(o,u.inputerror))}function Ui(){const t=U.domCache.get(this);t.validationMessage&&se(t.validationMessage);const e=this.getInput();e&&(e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedby"),Pe(e,u.inputerror))}function Di(){return U.domCache.get(this).progressSteps}function $i(t){const e=j(),n=U.innerParams.get(this);if(!e||Re(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=Hi(t),i=Object.assign({},n,o);eo(this,i),U.innerParams.set(this,i),Object.defineProperties(this,{params:{value:Object.assign({},this.params,t),writable:!1,enumerable:!0}})}const Hi=t=>{const e={};return Object.keys(t).forEach(n=>{Un(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
|
|
75
75
|
|
|
76
|
-
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 Vi(){const t=U.domCache.get(this),e=U.innerParams.get(this);if(!e){go(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(),ji(this)}const ji=t=>{go(t),delete t.params,delete M.keydownHandler,delete M.keydownTarget,delete M.currentInstance},go=t=>{t.isAwaitingPromise()?(un(U,t),U.awaitingPromise.set(t,!0)):(un(kt,t),un(U,t))},un=(t,e)=>{for(const n in t)t[n].delete(e)},bo=Object.freeze(Object.defineProperty({__proto__:null,_destroy:Vi,close:Mt,closeModal:Mt,closePopup:Mt,closeToast:Mt,disableButtons:Oi,disableInput:Mi,disableLoading:ao,enableButtons:Ri,enableInput:Fi,getInput:mi,getProgressSteps:Di,handleAwaitingPromise:_t,hideLoading:ao,isAwaitingPromise:Ti,rejectPromise:Li,resetValidationMessage:Ui,showValidationMessage:Ni,update:$i},Symbol.toStringTag,{value:"Module"})),zi=t=>{const e=U.innerParams.get(t);t.disableButtons(),e.input?yo(t,"confirm"):fn(t,!0)},Wi=t=>{const e=U.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?yo(t,"deny"):dn(t,!1)},qi=(t,e)=>{t.disableButtons(),e(Qe.cancel)},yo=(t,e)=>{const n=U.innerParams.get(t);if(!n.input)return $e(`The "input" parameter is needed to be set when using returnInputValueOn${Yt(e)}`);const o=ai(t,n);n.inputValidator?Ki(t,o,e):t.getInput().checkValidity()?e==="deny"?dn(t,o):fn(t,o):(t.enableButtons(),t.showValidationMessage(n.validationMessage))},Ki=(t,e,n)=>{const o=U.innerParams.get(t);t.disableInput(),Promise.resolve().then(()=>ht(o.inputValidator(e,o.validationMessage))).then(c=>{t.enableButtons(),t.enableInput(),c?t.showValidationMessage(c):n==="deny"?dn(t,e):fn(t,e)})},dn=(t,e)=>{const n=U.innerParams.get(t||globalThis);n.showLoaderOnDeny&&et(Ne()),n.preDeny?(U.awaitingPromise.set(t||globalThis,!0),Promise.resolve().then(()=>ht(n.preDeny(e,n.validationMessage))).then(i=>{i===!1?(t.hideLoading(),_t(t)):t.closePopup({isDenied:!0,value:typeof i>"u"?e:i})}).catch(i=>vo(t||globalThis,i))):t.closePopup({isDenied:!0,value:e})},wo=(t,e)=>{t.closePopup({isConfirmed:!0,value:e})},vo=(t,e)=>{t.rejectPromise(e)},fn=(t,e)=>{const n=U.innerParams.get(t||globalThis);n.showLoaderOnConfirm&&et(),n.preConfirm?(t.resetValidationMessage(),U.awaitingPromise.set(t||globalThis,!0),Promise.resolve().then(()=>ht(n.preConfirm(e,n.validationMessage))).then(i=>{we(Bt())||i===!1?(t.hideLoading(),_t(t)):wo(t,typeof i>"u"?e:i)}).catch(i=>vo(t||globalThis,i))):wo(t,e)},Gi=(t,e,n)=>{U.innerParams.get(t).toast?Yi(t,e,n):(Xi(e),Zi(e),Qi(t,e,n))},Yi=(t,e,n)=>{e.popup.onclick=()=>{const o=U.innerParams.get(t);o&&(Ji(o)||o.timer||o.input)||n(Qe.close)}},Ji=t=>t.showConfirmButton||t.showDenyButton||t.showCancelButton||t.showCloseButton;let Nt=!1;const Xi=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(Nt=!0)}}},Zi=t=>{t.container.onmousedown=()=>{t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,(e.target===t.popup||t.popup.contains(e.target))&&(Nt=!0)}}},Qi=(t,e,n)=>{e.container.onclick=o=>{const i=U.innerParams.get(t);if(Nt){Nt=!1;return}o.target===e.container&&It(i.allowOutsideClick)&&n(Qe.backdrop)}},ea=t=>typeof t=="object"&&t.jquery,ko=t=>t instanceof Element||ea(t),ta=t=>{const e={};return typeof t[0]=="object"&&!ko(t[0])?Object.assign(e,t[0]):["title","html","icon"].forEach((n,o)=>{const i=t[o];typeof i=="string"||ko(i)?e[n]=i:i!==void 0&&$e(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`)}),e};function na(...t){const e=this;return new e(...t)}function oa(t){class e extends this{_main(o,i){return super._main(o,Object.assign({},t,i))}}return e}const ra=()=>M.timeout&&M.timeout.getTimerLeft(),_o=()=>{if(M.timeout)return Wr(),M.timeout.stop()},Co=()=>{if(M.timeout){const t=M.timeout.start();return on(t),t}},sa=()=>{const t=M.timeout;return t&&(t.running?_o():Co())},ia=t=>{if(M.timeout){const e=M.timeout.increase(t);return on(e,!0),e}},aa=()=>M.timeout&&M.timeout.isRunning();let Ao=!1;const hn={};function la(t="data-swal-template"){hn[t]=this,Ao||(document.body.addEventListener("click",ca),Ao=!0)}const ca=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const n in hn){const o=e.getAttribute(n);if(o){hn[n].fire({template:o});return}}},ua=Object.freeze(Object.defineProperty({__proto__:null,argsToParams:ta,bindClickHandler:la,clickCancel:yi,clickConfirm:lo,clickDeny:bi,enableLoading:et,fire:na,getActions:bt,getCancelButton:He,getCloseButton:Qt,getConfirmButton:Te,getContainer:oe,getDenyButton:Ne,getFocusableElements:en,getFooter:jn,getHtmlContainer:Pt,getIcon:gt,getImage:Hn,getInputLabel:$r,getLoader:Xe,getPopup:j,getTimerLeft:ra,getTimerProgressBar:Rt,getTitle:$n,getValidationMessage:Bt,increaseTimer:ia,isDeprecatedParameter:Zt,isLoading:Vr,isTimerRunning:aa,isUpdatableParameter:Un,isValidParameter:Nn,isVisible:gi,mixin:oa,resumeTimer:Co,showLoading:et,stopTimer:_o,toggleTimer:sa},Symbol.toStringTag,{value:"Module"}));let pn;class tt{constructor(...e){if(typeof window>"u")return;pn=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);U.promise.set(this,o)}_main(e,n={}){Ur(Object.assign({},n,e)),M.currentInstance&&(M.currentInstance._destroy(),tn()&&to()),M.currentInstance=this;const o=fa(e,n);zs(o),Object.freeze(o),M.timeout&&(M.timeout.stop(),delete M.timeout),clearTimeout(M.restoreFocusTimeout);const i=ha(this);return eo(this,o),U.innerParams.set(this,o),da(this,i,o)}then(e){return U.promise.get(this).then(e)}finally(e){return U.promise.get(this).finally(e)}}const da=(t,e,n)=>new Promise((o,i)=>{const c=E=>{t.closePopup({isDismissed:!0,dismiss:E})};kt.swalPromiseResolve.set(t,o),kt.swalPromiseReject.set(t,i),e.confirmButton.onclick=()=>zi(t),e.denyButton.onclick=()=>Wi(t),e.cancelButton.onclick=()=>qi(t,c),e.closeButton.onclick=()=>c(Qe.close),Gi(t,e,c),wi(t,M,n,c),ii(t,n),ti(n),pa(M,n,c),ma(e,n),setTimeout(()=>{e.container.scrollTop=0})}),fa=(t,e)=>{const n=Os(t),o=Object.assign({},Je,e,n,t);return o.showClass=Object.assign({},Je.showClass,o.showClass),o.hideClass=Object.assign({},Je.hideClass,o.hideClass),o},ha=t=>{const e={popup:j(),container:oe(),actions:bt(),confirmButton:Te(),denyButton:Ne(),cancelButton:He(),loader:Xe(),closeButton:Qt(),validationMessage:Bt(),progressSteps:Vn()};return U.domCache.set(t,e),e},pa=(t,e,n)=>{const o=Rt();se(o),e.timer&&(t.timeout=new Ws(()=>{n("timer"),delete t.timeout},e.timer),e.timerProgressBar&&(Q(o),Ee(o,e,"timerProgressBar"),setTimeout(()=>{t.timeout&&t.timeout.running&&on(e.timer)})))},ma=(t,e)=>{if(!e.toast){if(!It(e.allowEnterKey))return ba();ga(t,e)||cn(e,-1,1)}},ga=(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,ba=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(tt.prototype,bo),Object.assign(tt,ua),Object.keys(bo).forEach(t=>{tt[t]=function(...e){if(pn)return pn[t](...e)}}),tt.DismissReason=Qe,tt.version="11.4.8";const nt=tt;nt.default=nt;/*! @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:Eo,setPrototypeOf:xo,isFrozen:ya,getPrototypeOf:wa,getOwnPropertyDescriptor:To}=Object;let{freeze:le,seal:Se,create:So}=Object,{apply:mn,construct:gn}=typeof Reflect<"u"&&Reflect;le||(le=function(e){return e}),Se||(Se=function(e){return e}),mn||(mn=function(e,n,o){return e.apply(n,o)}),gn||(gn=function(e,n){return new e(...n)});const Ut=xe(Array.prototype.forEach),Lo=xe(Array.prototype.pop),Ct=xe(Array.prototype.push),Dt=xe(String.prototype.toLowerCase),bn=xe(String.prototype.toString),va=xe(String.prototype.match),At=xe(String.prototype.replace),ka=xe(String.prototype.indexOf),_a=xe(String.prototype.trim),ve=xe(RegExp.prototype.test),Et=Ca(TypeError);function xe(t){return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return mn(t,e,o)}}function Ca(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return gn(t,n)}}function N(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dt;xo&&xo(t,null);let o=e.length;for(;o--;){let i=e[o];if(typeof i=="string"){const c=n(i);c!==i&&(ya(e)||(e[o]=c),i=c)}t[i]=!0}return t}function ot(t){const e=So(null);for(const[n,o]of Eo(t))To(t,n)!==void 0&&(e[n]=o);return e}function $t(t,e){for(;t!==null;){const o=To(t,e);if(o){if(o.get)return xe(o.get);if(typeof o.value=="function")return xe(o.value)}t=wa(t)}function n(o){return console.warn("fallback value for",o),null}return n}const Io=le(["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"]),yn=le(["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"]),wn=le(["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"]),Aa=le(["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"]),vn=le(["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"]),Ea=le(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Po=le(["#text"]),Bo=le(["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"]),kn=le(["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"]),Ro=le(["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"]),Ht=le(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xa=Se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ta=Se(/<%[\w\W]*|[\w\W]*%>/gm),Sa=Se(/\${[\w\W]*}/gm),La=Se(/^data-[\-\w.\u00B7-\uFFFF]/),Ia=Se(/^aria-[\-\w]+$/),Oo=Se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pa=Se(/^(?:\w+script|data):/i),Ba=Se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fo=Se(/^html$/i);var Mo=Object.freeze({__proto__:null,MUSTACHE_EXPR:xa,ERB_EXPR:Ta,TMPLIT_EXPR:Sa,DATA_ATTR:La,ARIA_ATTR:Ia,IS_ALLOWED_URI:Oo,IS_SCRIPT_OR_DATA:Pa,ATTR_WHITESPACE:Ba,DOCTYPE_NAME:Fo});const Ra=function(){return typeof window>"u"?null:window},Oa=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(o=n.getAttribute(i));const c="dompurify"+(o?"#"+o:"");try{return e.createPolicy(c,{createHTML(E){return E},createScriptURL(E){return E}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}};function No(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ra();const e=L=>No(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,i=o.currentScript,{DocumentFragment:c,HTMLTemplateElement:E,Node:I,Element:d,NodeFilter:V,NamedNodeMap:W=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:ee,DOMParser:Le,trustedTypes:z}=t,Oe=d.prototype,rt=$t(Oe,"cloneNode"),ke=$t(Oe,"nextSibling"),st=$t(Oe,"childNodes"),he=$t(Oe,"parentNode");if(typeof E=="function"){const L=n.createElement("template");L.content&&L.content.ownerDocument&&(n=L.content.ownerDocument)}let D,_e="";const{implementation:X,createNodeIterator:h,createDocumentFragment:_,getElementsByTagName:P}=n,{importNode:C}=o;let k={};e.isSupported=typeof Eo=="function"&&typeof he=="function"&&X&&X.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:v,ERB_EXPR:O,TMPLIT_EXPR:m,DATA_ATTR:F,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:Y}=Mo;let{IS_ALLOWED_URI:ce}=Mo,B=null;const pe=N({},[...Io,...yn,...wn,...vn,...Po]);let r=null;const a=N({},[...Bo,...kn,...Ro,...Ht]);let f=Object.seal(So(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,A=!0,g=!0,y=!1,T=!0,x=!1,R=!1,$=!1,me=!1,ue=!1,te=!1,Be=!1,$o=!0,Ho=!1;const bl="user-content-";let Cn=!0,xt=!1,it={},at=null;const Vo=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 jo=null;const zo=N({},["audio","video","img","source","image","track"]);let An=null;const Wo=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Vt="http://www.w3.org/1998/Math/MathML",jt="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml";let lt=Fe,En=!1,xn=null;const yl=N({},[Vt,jt,Fe],bn);let ze=null;const wl=["application/xhtml+xml","text/html"],vl="text/html";let Z=null,ct=null;const kl=n.createElement("form"),qo=function(s){return s instanceof RegExp||s instanceof Function},Tn=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ct&&ct===s)){if((!s||typeof s!="object")&&(s={}),s=ot(s),ze=wl.indexOf(s.PARSER_MEDIA_TYPE)===-1?ze=vl:ze=s.PARSER_MEDIA_TYPE,Z=ze==="application/xhtml+xml"?bn:Dt,B="ALLOWED_TAGS"in s?N({},s.ALLOWED_TAGS,Z):pe,r="ALLOWED_ATTR"in s?N({},s.ALLOWED_ATTR,Z):a,xn="ALLOWED_NAMESPACES"in s?N({},s.ALLOWED_NAMESPACES,bn):yl,An="ADD_URI_SAFE_ATTR"in s?N(ot(Wo),s.ADD_URI_SAFE_ATTR,Z):Wo,jo="ADD_DATA_URI_TAGS"in s?N(ot(zo),s.ADD_DATA_URI_TAGS,Z):zo,at="FORBID_CONTENTS"in s?N({},s.FORBID_CONTENTS,Z):Vo,b="FORBID_TAGS"in s?N({},s.FORBID_TAGS,Z):{},p="FORBID_ATTR"in s?N({},s.FORBID_ATTR,Z):{},it="USE_PROFILES"in s?s.USE_PROFILES:!1,A=s.ALLOW_ARIA_ATTR!==!1,g=s.ALLOW_DATA_ATTR!==!1,y=s.ALLOW_UNKNOWN_PROTOCOLS||!1,T=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,x=s.SAFE_FOR_TEMPLATES||!1,R=s.WHOLE_DOCUMENT||!1,ue=s.RETURN_DOM||!1,te=s.RETURN_DOM_FRAGMENT||!1,Be=s.RETURN_TRUSTED_TYPE||!1,me=s.FORCE_BODY||!1,$o=s.SANITIZE_DOM!==!1,Ho=s.SANITIZE_NAMED_PROPS||!1,Cn=s.KEEP_CONTENT!==!1,xt=s.IN_PLACE||!1,ce=s.ALLOWED_URI_REGEXP||Oo,lt=s.NAMESPACE||Fe,f=s.CUSTOM_ELEMENT_HANDLING||{},s.CUSTOM_ELEMENT_HANDLING&&qo(s.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=s.CUSTOM_ELEMENT_HANDLING.tagNameCheck),s.CUSTOM_ELEMENT_HANDLING&&qo(s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),x&&(g=!1),te&&(ue=!0),it&&(B=N({},[...Po]),r=[],it.html===!0&&(N(B,Io),N(r,Bo)),it.svg===!0&&(N(B,yn),N(r,kn),N(r,Ht)),it.svgFilters===!0&&(N(B,wn),N(r,kn),N(r,Ht)),it.mathMl===!0&&(N(B,vn),N(r,Ro),N(r,Ht))),s.ADD_TAGS&&(B===pe&&(B=ot(B)),N(B,s.ADD_TAGS,Z)),s.ADD_ATTR&&(r===a&&(r=ot(r)),N(r,s.ADD_ATTR,Z)),s.ADD_URI_SAFE_ATTR&&N(An,s.ADD_URI_SAFE_ATTR,Z),s.FORBID_CONTENTS&&(at===Vo&&(at=ot(at)),N(at,s.FORBID_CONTENTS,Z)),Cn&&(B["#text"]=!0),R&&N(B,["html","head","body"]),B.table&&(N(B,["tbody"]),delete b.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw Et('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Et('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');D=s.TRUSTED_TYPES_POLICY,_e=D.createHTML("")}else D===void 0&&(D=Oa(z,i)),D!==null&&typeof _e=="string"&&(_e=D.createHTML(""));le&&le(s),ct=s}},Ko=N({},["mi","mo","mn","ms","mtext"]),Go=N({},["foreignobject","desc","title","annotation-xml"]),_l=N({},["title","style","font","a","script"]),zt=N({},yn);N(zt,wn),N(zt,Aa);const Sn=N({},vn);N(Sn,Ea);const Cl=function(s){let w=he(s);(!w||!w.tagName)&&(w={namespaceURI:lt,tagName:"template"});const S=Dt(s.tagName),K=Dt(w.tagName);return xn[s.namespaceURI]?s.namespaceURI===jt?w.namespaceURI===Fe?S==="svg":w.namespaceURI===Vt?S==="svg"&&(K==="annotation-xml"||Ko[K]):!!zt[S]:s.namespaceURI===Vt?w.namespaceURI===Fe?S==="math":w.namespaceURI===jt?S==="math"&&Go[K]:!!Sn[S]:s.namespaceURI===Fe?w.namespaceURI===jt&&!Go[K]||w.namespaceURI===Vt&&!Ko[K]?!1:!Sn[S]&&(_l[S]||!zt[S]):!!(ze==="application/xhtml+xml"&&xn[s.namespaceURI]):!1},We=function(s){Ct(e.removed,{element:s});try{s.parentNode.removeChild(s)}catch{s.remove()}},Ln=function(s,w){try{Ct(e.removed,{attribute:w.getAttributeNode(s),from:w})}catch{Ct(e.removed,{attribute:null,from:w})}if(w.removeAttribute(s),s==="is"&&!r[s])if(ue||te)try{We(w)}catch{}else try{w.setAttribute(s,"")}catch{}},Yo=function(s){let w=null,S=null;if(me)s="<remove></remove>"+s;else{const ae=va(s,/^[\r\n\t ]+/);S=ae&&ae[0]}ze==="application/xhtml+xml"&<===Fe&&(s='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+s+"</body></html>");const K=D?D.createHTML(s):s;if(lt===Fe)try{w=new Le().parseFromString(K,ze)}catch{}if(!w||!w.documentElement){w=X.createDocument(lt,"template",null);try{w.documentElement.innerHTML=En?_e:K}catch{}}const ie=w.body||w.documentElement;return s&&S&&ie.insertBefore(n.createTextNode(S),ie.childNodes[0]||null),lt===Fe?P.call(w,R?"html":"body")[0]:R?w.documentElement:ie},Jo=function(s){return h.call(s.ownerDocument||s,s,V.SHOW_ELEMENT|V.SHOW_COMMENT|V.SHOW_TEXT,null)},Al=function(s){return s instanceof ee&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof W)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},Xo=function(s){return typeof I=="function"&&s instanceof I},Me=function(s,w,S){k[s]&&Ut(k[s],K=>{K.call(e,w,S,ct)})},Zo=function(s){let w=null;if(Me("beforeSanitizeElements",s,null),Al(s))return We(s),!0;const S=Z(s.nodeName);if(Me("uponSanitizeElement",s,{tagName:S,allowedTags:B}),s.hasChildNodes()&&!Xo(s.firstElementChild)&&ve(/<[/\w]/g,s.innerHTML)&&ve(/<[/\w]/g,s.textContent))return We(s),!0;if(!B[S]||b[S]){if(!b[S]&&er(S)&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,S)||f.tagNameCheck instanceof Function&&f.tagNameCheck(S)))return!1;if(Cn&&!at[S]){const K=he(s)||s.parentNode,ie=st(s)||s.childNodes;if(ie&&K){const ae=ie.length;for(let ge=ae-1;ge>=0;--ge)K.insertBefore(rt(ie[ge],!0),ke(s))}}return We(s),!0}return s instanceof d&&!Cl(s)||(S==="noscript"||S==="noembed"||S==="noframes")&&ve(/<\/no(script|embed|frames)/i,s.innerHTML)?(We(s),!0):(x&&s.nodeType===3&&(w=s.textContent,Ut([v,O,m],K=>{w=At(w,K," ")}),s.textContent!==w&&(Ct(e.removed,{element:s.cloneNode()}),s.textContent=w)),Me("afterSanitizeElements",s,null),!1)},Qo=function(s,w,S){if($o&&(w==="id"||w==="name")&&(S in n||S in kl))return!1;if(!(g&&!p[w]&&ve(F,w))){if(!(A&&ve(q,w))){if(!r[w]||p[w]){if(!(er(s)&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,s)||f.tagNameCheck instanceof Function&&f.tagNameCheck(s))&&(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,S)||f.tagNameCheck instanceof Function&&f.tagNameCheck(S))))return!1}else if(!An[w]){if(!ve(ce,At(S,Y,""))){if(!((w==="src"||w==="xlink:href"||w==="href")&&s!=="script"&&ka(S,"data:")===0&&jo[s])){if(!(y&&!ve(J,At(S,Y,"")))){if(S)return!1}}}}}}return!0},er=function(s){return s.indexOf("-")>0},tr=function(s){Me("beforeSanitizeAttributes",s,null);const{attributes:w}=s;if(!w)return;const S={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:r};let K=w.length;for(;K--;){const ie=w[K],{name:ae,namespaceURI:ge,value:qe}=ie,Tt=Z(ae);let be=ae==="value"?qe:_a(qe);if(S.attrName=Tt,S.attrValue=be,S.keepAttr=!0,S.forceKeepAttr=void 0,Me("uponSanitizeAttribute",s,S),be=S.attrValue,S.forceKeepAttr||(Ln(ae,s),!S.keepAttr))continue;if(!T&&ve(/\/>/i,be)){Ln(ae,s);continue}x&&Ut([v,O,m],or=>{be=At(be,or," ")});const nr=Z(s.nodeName);if(Qo(nr,Tt,be)){if(Ho&&(Tt==="id"||Tt==="name")&&(Ln(ae,s),be=bl+be),D&&typeof z=="object"&&typeof z.getAttributeType=="function"&&!ge)switch(z.getAttributeType(nr,Tt)){case"TrustedHTML":{be=D.createHTML(be);break}case"TrustedScriptURL":{be=D.createScriptURL(be);break}}try{ge?s.setAttributeNS(ge,ae,be):s.setAttribute(ae,be),Lo(e.removed)}catch{}}}Me("afterSanitizeAttributes",s,null)},El=function L(s){let w=null;const S=Jo(s);for(Me("beforeSanitizeShadowDOM",s,null);w=S.nextNode();)Me("uponSanitizeShadowNode",w,null),!Zo(w)&&(w.content instanceof c&&L(w.content),tr(w));Me("afterSanitizeShadowDOM",s,null)};return e.sanitize=function(L){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=null,S=null,K=null,ie=null;if(En=!L,En&&(L="<!-->"),typeof L!="string"&&!Xo(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw Et("dirty is not a string, aborting")}else throw Et("toString is not a function");if(!e.isSupported)return L;if($||Tn(s),e.removed=[],typeof L=="string"&&(xt=!1),xt){if(L.nodeName){const qe=Z(L.nodeName);if(!B[qe]||b[qe])throw Et("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof I)w=Yo("<!---->"),S=w.ownerDocument.importNode(L,!0),S.nodeType===1&&S.nodeName==="BODY"||S.nodeName==="HTML"?w=S:w.appendChild(S);else{if(!ue&&!x&&!R&&L.indexOf("<")===-1)return D&&Be?D.createHTML(L):L;if(w=Yo(L),!w)return ue?null:Be?_e:""}w&&me&&We(w.firstChild);const ae=Jo(xt?L:w);for(;K=ae.nextNode();)Zo(K)||(K.content instanceof c&&El(K.content),tr(K));if(xt)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(Fo,w.ownerDocument.doctype.name)&&(ge="<!DOCTYPE "+w.ownerDocument.doctype.name+`>
|
|
77
|
-
`+ge),x&&Ut([v,O,m],
|
|
76
|
+
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 Vi(){const t=U.domCache.get(this),e=U.innerParams.get(this);if(!e){go(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(),ji(this)}const ji=t=>{go(t),delete t.params,delete M.keydownHandler,delete M.keydownTarget,delete M.currentInstance},go=t=>{t.isAwaitingPromise()?(un(U,t),U.awaitingPromise.set(t,!0)):(un(_t,t),un(U,t))},un=(t,e)=>{for(const n in t)t[n].delete(e)},bo=Object.freeze(Object.defineProperty({__proto__:null,_destroy:Vi,close:Mt,closeModal:Mt,closePopup:Mt,closeToast:Mt,disableButtons:Oi,disableInput:Mi,disableLoading:ao,enableButtons:Ri,enableInput:Fi,getInput:mi,getProgressSteps:Di,handleAwaitingPromise:Ct,hideLoading:ao,isAwaitingPromise:Si,rejectPromise:Li,resetValidationMessage:Ui,showValidationMessage:Ni,update:$i},Symbol.toStringTag,{value:"Module"})),zi=t=>{const e=U.innerParams.get(t);t.disableButtons(),e.input?yo(t,"confirm"):fn(t,!0)},Wi=t=>{const e=U.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?yo(t,"deny"):dn(t,!1)},qi=(t,e)=>{t.disableButtons(),e(et.cancel)},yo=(t,e)=>{const n=U.innerParams.get(t);if(!n.input)return He(`The "input" parameter is needed to be set when using returnInputValueOn${Yt(e)}`);const o=ai(t,n);n.inputValidator?Ki(t,o,e):t.getInput().checkValidity()?e==="deny"?dn(t,o):fn(t,o):(t.enableButtons(),t.showValidationMessage(n.validationMessage))},Ki=(t,e,n)=>{const o=U.innerParams.get(t);t.disableInput(),Promise.resolve().then(()=>pt(o.inputValidator(e,o.validationMessage))).then(c=>{t.enableButtons(),t.enableInput(),c?t.showValidationMessage(c):n==="deny"?dn(t,e):fn(t,e)})},dn=(t,e)=>{const n=U.innerParams.get(t||globalThis);n.showLoaderOnDeny&&tt(Ne()),n.preDeny?(U.awaitingPromise.set(t||globalThis,!0),Promise.resolve().then(()=>pt(n.preDeny(e,n.validationMessage))).then(i=>{i===!1?(t.hideLoading(),Ct(t)):t.closePopup({isDenied:!0,value:typeof i>"u"?e:i})}).catch(i=>vo(t||globalThis,i))):t.closePopup({isDenied:!0,value:e})},wo=(t,e)=>{t.closePopup({isConfirmed:!0,value:e})},vo=(t,e)=>{t.rejectPromise(e)},fn=(t,e)=>{const n=U.innerParams.get(t||globalThis);n.showLoaderOnConfirm&&tt(),n.preConfirm?(t.resetValidationMessage(),U.awaitingPromise.set(t||globalThis,!0),Promise.resolve().then(()=>pt(n.preConfirm(e,n.validationMessage))).then(i=>{we(Bt())||i===!1?(t.hideLoading(),Ct(t)):wo(t,typeof i>"u"?e:i)}).catch(i=>vo(t||globalThis,i))):wo(t,e)},Gi=(t,e,n)=>{U.innerParams.get(t).toast?Yi(t,e,n):(Xi(e),Zi(e),Qi(t,e,n))},Yi=(t,e,n)=>{e.popup.onclick=()=>{const o=U.innerParams.get(t);o&&(Ji(o)||o.timer||o.input)||n(et.close)}},Ji=t=>t.showConfirmButton||t.showDenyButton||t.showCancelButton||t.showCloseButton;let Nt=!1;const Xi=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(Nt=!0)}}},Zi=t=>{t.container.onmousedown=()=>{t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,(e.target===t.popup||t.popup.contains(e.target))&&(Nt=!0)}}},Qi=(t,e,n)=>{e.container.onclick=o=>{const i=U.innerParams.get(t);if(Nt){Nt=!1;return}o.target===e.container&&It(i.allowOutsideClick)&&n(et.backdrop)}},ea=t=>typeof t=="object"&&t.jquery,ko=t=>t instanceof Element||ea(t),ta=t=>{const e={};return typeof t[0]=="object"&&!ko(t[0])?Object.assign(e,t[0]):["title","html","icon"].forEach((n,o)=>{const i=t[o];typeof i=="string"||ko(i)?e[n]=i:i!==void 0&&He(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`)}),e};function na(...t){const e=this;return new e(...t)}function oa(t){class e extends this{_main(o,i){return super._main(o,Object.assign({},t,i))}}return e}const ra=()=>M.timeout&&M.timeout.getTimerLeft(),_o=()=>{if(M.timeout)return Wr(),M.timeout.stop()},Co=()=>{if(M.timeout){const t=M.timeout.start();return on(t),t}},sa=()=>{const t=M.timeout;return t&&(t.running?_o():Co())},ia=t=>{if(M.timeout){const e=M.timeout.increase(t);return on(e,!0),e}},aa=()=>M.timeout&&M.timeout.isRunning();let Ao=!1;const hn={};function la(t="data-swal-template"){hn[t]=this,Ao||(document.body.addEventListener("click",ca),Ao=!0)}const ca=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const n in hn){const o=e.getAttribute(n);if(o){hn[n].fire({template:o});return}}},ua=Object.freeze(Object.defineProperty({__proto__:null,argsToParams:ta,bindClickHandler:la,clickCancel:yi,clickConfirm:lo,clickDeny:bi,enableLoading:tt,fire:na,getActions:yt,getCancelButton:Ve,getCloseButton:Qt,getConfirmButton:Se,getContainer:oe,getDenyButton:Ne,getFocusableElements:en,getFooter:jn,getHtmlContainer:Pt,getIcon:bt,getImage:Hn,getInputLabel:$r,getLoader:Ze,getPopup:j,getTimerLeft:ra,getTimerProgressBar:Rt,getTitle:$n,getValidationMessage:Bt,increaseTimer:ia,isDeprecatedParameter:Zt,isLoading:Vr,isTimerRunning:aa,isUpdatableParameter:Un,isValidParameter:Nn,isVisible:gi,mixin:oa,resumeTimer:Co,showLoading:tt,stopTimer:_o,toggleTimer:sa},Symbol.toStringTag,{value:"Module"}));let pn;class nt{constructor(...e){if(typeof window>"u")return;pn=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);U.promise.set(this,o)}_main(e,n={}){Ur(Object.assign({},n,e)),M.currentInstance&&(M.currentInstance._destroy(),tn()&&to()),M.currentInstance=this;const o=fa(e,n);zs(o),Object.freeze(o),M.timeout&&(M.timeout.stop(),delete M.timeout),clearTimeout(M.restoreFocusTimeout);const i=ha(this);return eo(this,o),U.innerParams.set(this,o),da(this,i,o)}then(e){return U.promise.get(this).then(e)}finally(e){return U.promise.get(this).finally(e)}}const da=(t,e,n)=>new Promise((o,i)=>{const c=E=>{t.closePopup({isDismissed:!0,dismiss:E})};_t.swalPromiseResolve.set(t,o),_t.swalPromiseReject.set(t,i),e.confirmButton.onclick=()=>zi(t),e.denyButton.onclick=()=>Wi(t),e.cancelButton.onclick=()=>qi(t,c),e.closeButton.onclick=()=>c(et.close),Gi(t,e,c),wi(t,M,n,c),ii(t,n),ti(n),pa(M,n,c),ma(e,n),setTimeout(()=>{e.container.scrollTop=0})}),fa=(t,e)=>{const n=Os(t),o=Object.assign({},Xe,e,n,t);return o.showClass=Object.assign({},Xe.showClass,o.showClass),o.hideClass=Object.assign({},Xe.hideClass,o.hideClass),o},ha=t=>{const e={popup:j(),container:oe(),actions:yt(),confirmButton:Se(),denyButton:Ne(),cancelButton:Ve(),loader:Ze(),closeButton:Qt(),validationMessage:Bt(),progressSteps:Vn()};return U.domCache.set(t,e),e},pa=(t,e,n)=>{const o=Rt();se(o),e.timer&&(t.timeout=new Ws(()=>{n("timer"),delete t.timeout},e.timer),e.timerProgressBar&&(Q(o),Ee(o,e,"timerProgressBar"),setTimeout(()=>{t.timeout&&t.timeout.running&&on(e.timer)})))},ma=(t,e)=>{if(!e.toast){if(!It(e.allowEnterKey))return ba();ga(t,e)||cn(e,-1,1)}},ga=(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,ba=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(nt.prototype,bo),Object.assign(nt,ua),Object.keys(bo).forEach(t=>{nt[t]=function(...e){if(pn)return pn[t](...e)}}),nt.DismissReason=et,nt.version="11.4.8";const ot=nt;ot.default=ot;/*! @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:Eo,setPrototypeOf:xo,isFrozen:ya,getPrototypeOf:wa,getOwnPropertyDescriptor:So}=Object;let{freeze:le,seal:Te,create:To}=Object,{apply:mn,construct:gn}=typeof Reflect<"u"&&Reflect;le||(le=function(e){return e}),Te||(Te=function(e){return e}),mn||(mn=function(e,n,o){return e.apply(n,o)}),gn||(gn=function(e,n){return new e(...n)});const Ut=xe(Array.prototype.forEach),Lo=xe(Array.prototype.pop),At=xe(Array.prototype.push),Dt=xe(String.prototype.toLowerCase),bn=xe(String.prototype.toString),va=xe(String.prototype.match),Et=xe(String.prototype.replace),ka=xe(String.prototype.indexOf),_a=xe(String.prototype.trim),ve=xe(RegExp.prototype.test),xt=Ca(TypeError);function xe(t){return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return mn(t,e,o)}}function Ca(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return gn(t,n)}}function N(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dt;xo&&xo(t,null);let o=e.length;for(;o--;){let i=e[o];if(typeof i=="string"){const c=n(i);c!==i&&(ya(e)||(e[o]=c),i=c)}t[i]=!0}return t}function rt(t){const e=To(null);for(const[n,o]of Eo(t))So(t,n)!==void 0&&(e[n]=o);return e}function $t(t,e){for(;t!==null;){const o=So(t,e);if(o){if(o.get)return xe(o.get);if(typeof o.value=="function")return xe(o.value)}t=wa(t)}function n(o){return console.warn("fallback value for",o),null}return n}const Io=le(["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"]),yn=le(["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"]),wn=le(["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"]),Aa=le(["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"]),vn=le(["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"]),Ea=le(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Po=le(["#text"]),Bo=le(["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"]),kn=le(["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"]),Ro=le(["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"]),Ht=le(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xa=Te(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Sa=Te(/<%[\w\W]*|[\w\W]*%>/gm),Ta=Te(/\${[\w\W]*}/gm),La=Te(/^data-[\-\w.\u00B7-\uFFFF]/),Ia=Te(/^aria-[\-\w]+$/),Oo=Te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pa=Te(/^(?:\w+script|data):/i),Ba=Te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fo=Te(/^html$/i);var Mo=Object.freeze({__proto__:null,MUSTACHE_EXPR:xa,ERB_EXPR:Sa,TMPLIT_EXPR:Ta,DATA_ATTR:La,ARIA_ATTR:Ia,IS_ALLOWED_URI:Oo,IS_SCRIPT_OR_DATA:Pa,ATTR_WHITESPACE:Ba,DOCTYPE_NAME:Fo});const Ra=function(){return typeof window>"u"?null:window},Oa=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(o=n.getAttribute(i));const c="dompurify"+(o?"#"+o:"");try{return e.createPolicy(c,{createHTML(E){return E},createScriptURL(E){return E}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}};function No(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ra();const e=L=>No(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,i=o.currentScript,{DocumentFragment:c,HTMLTemplateElement:E,Node:I,Element:d,NodeFilter:V,NamedNodeMap:W=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:ee,DOMParser:Le,trustedTypes:z}=t,Oe=d.prototype,st=$t(Oe,"cloneNode"),ke=$t(Oe,"nextSibling"),it=$t(Oe,"childNodes"),he=$t(Oe,"parentNode");if(typeof E=="function"){const L=n.createElement("template");L.content&&L.content.ownerDocument&&(n=L.content.ownerDocument)}let D,_e="";const{implementation:X,createNodeIterator:h,createDocumentFragment:_,getElementsByTagName:P}=n,{importNode:C}=o;let k={};e.isSupported=typeof Eo=="function"&&typeof he=="function"&&X&&X.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:v,ERB_EXPR:O,TMPLIT_EXPR:m,DATA_ATTR:F,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:Y}=Mo;let{IS_ALLOWED_URI:ce}=Mo,B=null;const pe=N({},[...Io,...yn,...wn,...vn,...Po]);let r=null;const a=N({},[...Bo,...kn,...Ro,...Ht]);let f=Object.seal(To(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,A=!0,g=!0,y=!1,S=!0,x=!1,R=!1,$=!1,me=!1,ue=!1,te=!1,Be=!1,$o=!0,Ho=!1;const bl="user-content-";let Cn=!0,St=!1,at={},lt=null;const Vo=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 jo=null;const zo=N({},["audio","video","img","source","image","track"]);let An=null;const Wo=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Vt="http://www.w3.org/1998/Math/MathML",jt="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml";let ct=Fe,En=!1,xn=null;const yl=N({},[Vt,jt,Fe],bn);let We=null;const wl=["application/xhtml+xml","text/html"],vl="text/html";let Z=null,ut=null;const kl=n.createElement("form"),qo=function(s){return s instanceof RegExp||s instanceof Function},Sn=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ut&&ut===s)){if((!s||typeof s!="object")&&(s={}),s=rt(s),We=wl.indexOf(s.PARSER_MEDIA_TYPE)===-1?We=vl:We=s.PARSER_MEDIA_TYPE,Z=We==="application/xhtml+xml"?bn:Dt,B="ALLOWED_TAGS"in s?N({},s.ALLOWED_TAGS,Z):pe,r="ALLOWED_ATTR"in s?N({},s.ALLOWED_ATTR,Z):a,xn="ALLOWED_NAMESPACES"in s?N({},s.ALLOWED_NAMESPACES,bn):yl,An="ADD_URI_SAFE_ATTR"in s?N(rt(Wo),s.ADD_URI_SAFE_ATTR,Z):Wo,jo="ADD_DATA_URI_TAGS"in s?N(rt(zo),s.ADD_DATA_URI_TAGS,Z):zo,lt="FORBID_CONTENTS"in s?N({},s.FORBID_CONTENTS,Z):Vo,b="FORBID_TAGS"in s?N({},s.FORBID_TAGS,Z):{},p="FORBID_ATTR"in s?N({},s.FORBID_ATTR,Z):{},at="USE_PROFILES"in s?s.USE_PROFILES:!1,A=s.ALLOW_ARIA_ATTR!==!1,g=s.ALLOW_DATA_ATTR!==!1,y=s.ALLOW_UNKNOWN_PROTOCOLS||!1,S=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,x=s.SAFE_FOR_TEMPLATES||!1,R=s.WHOLE_DOCUMENT||!1,ue=s.RETURN_DOM||!1,te=s.RETURN_DOM_FRAGMENT||!1,Be=s.RETURN_TRUSTED_TYPE||!1,me=s.FORCE_BODY||!1,$o=s.SANITIZE_DOM!==!1,Ho=s.SANITIZE_NAMED_PROPS||!1,Cn=s.KEEP_CONTENT!==!1,St=s.IN_PLACE||!1,ce=s.ALLOWED_URI_REGEXP||Oo,ct=s.NAMESPACE||Fe,f=s.CUSTOM_ELEMENT_HANDLING||{},s.CUSTOM_ELEMENT_HANDLING&&qo(s.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=s.CUSTOM_ELEMENT_HANDLING.tagNameCheck),s.CUSTOM_ELEMENT_HANDLING&&qo(s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),x&&(g=!1),te&&(ue=!0),at&&(B=N({},[...Po]),r=[],at.html===!0&&(N(B,Io),N(r,Bo)),at.svg===!0&&(N(B,yn),N(r,kn),N(r,Ht)),at.svgFilters===!0&&(N(B,wn),N(r,kn),N(r,Ht)),at.mathMl===!0&&(N(B,vn),N(r,Ro),N(r,Ht))),s.ADD_TAGS&&(B===pe&&(B=rt(B)),N(B,s.ADD_TAGS,Z)),s.ADD_ATTR&&(r===a&&(r=rt(r)),N(r,s.ADD_ATTR,Z)),s.ADD_URI_SAFE_ATTR&&N(An,s.ADD_URI_SAFE_ATTR,Z),s.FORBID_CONTENTS&&(lt===Vo&&(lt=rt(lt)),N(lt,s.FORBID_CONTENTS,Z)),Cn&&(B["#text"]=!0),R&&N(B,["html","head","body"]),B.table&&(N(B,["tbody"]),delete b.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw xt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');D=s.TRUSTED_TYPES_POLICY,_e=D.createHTML("")}else D===void 0&&(D=Oa(z,i)),D!==null&&typeof _e=="string"&&(_e=D.createHTML(""));le&&le(s),ut=s}},Ko=N({},["mi","mo","mn","ms","mtext"]),Go=N({},["foreignobject","desc","title","annotation-xml"]),_l=N({},["title","style","font","a","script"]),zt=N({},yn);N(zt,wn),N(zt,Aa);const Tn=N({},vn);N(Tn,Ea);const Cl=function(s){let w=he(s);(!w||!w.tagName)&&(w={namespaceURI:ct,tagName:"template"});const T=Dt(s.tagName),K=Dt(w.tagName);return xn[s.namespaceURI]?s.namespaceURI===jt?w.namespaceURI===Fe?T==="svg":w.namespaceURI===Vt?T==="svg"&&(K==="annotation-xml"||Ko[K]):!!zt[T]:s.namespaceURI===Vt?w.namespaceURI===Fe?T==="math":w.namespaceURI===jt?T==="math"&&Go[K]:!!Tn[T]:s.namespaceURI===Fe?w.namespaceURI===jt&&!Go[K]||w.namespaceURI===Vt&&!Ko[K]?!1:!Tn[T]&&(_l[T]||!zt[T]):!!(We==="application/xhtml+xml"&&xn[s.namespaceURI]):!1},qe=function(s){At(e.removed,{element:s});try{s.parentNode.removeChild(s)}catch{s.remove()}},Ln=function(s,w){try{At(e.removed,{attribute:w.getAttributeNode(s),from:w})}catch{At(e.removed,{attribute:null,from:w})}if(w.removeAttribute(s),s==="is"&&!r[s])if(ue||te)try{qe(w)}catch{}else try{w.setAttribute(s,"")}catch{}},Yo=function(s){let w=null,T=null;if(me)s="<remove></remove>"+s;else{const ae=va(s,/^[\r\n\t ]+/);T=ae&&ae[0]}We==="application/xhtml+xml"&&ct===Fe&&(s='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+s+"</body></html>");const K=D?D.createHTML(s):s;if(ct===Fe)try{w=new Le().parseFromString(K,We)}catch{}if(!w||!w.documentElement){w=X.createDocument(ct,"template",null);try{w.documentElement.innerHTML=En?_e:K}catch{}}const ie=w.body||w.documentElement;return s&&T&&ie.insertBefore(n.createTextNode(T),ie.childNodes[0]||null),ct===Fe?P.call(w,R?"html":"body")[0]:R?w.documentElement:ie},Jo=function(s){return h.call(s.ownerDocument||s,s,V.SHOW_ELEMENT|V.SHOW_COMMENT|V.SHOW_TEXT,null)},Al=function(s){return s instanceof ee&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof W)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},Xo=function(s){return typeof I=="function"&&s instanceof I},Me=function(s,w,T){k[s]&&Ut(k[s],K=>{K.call(e,w,T,ut)})},Zo=function(s){let w=null;if(Me("beforeSanitizeElements",s,null),Al(s))return qe(s),!0;const T=Z(s.nodeName);if(Me("uponSanitizeElement",s,{tagName:T,allowedTags:B}),s.hasChildNodes()&&!Xo(s.firstElementChild)&&ve(/<[/\w]/g,s.innerHTML)&&ve(/<[/\w]/g,s.textContent))return qe(s),!0;if(!B[T]||b[T]){if(!b[T]&&er(T)&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,T)||f.tagNameCheck instanceof Function&&f.tagNameCheck(T)))return!1;if(Cn&&!lt[T]){const K=he(s)||s.parentNode,ie=it(s)||s.childNodes;if(ie&&K){const ae=ie.length;for(let ge=ae-1;ge>=0;--ge)K.insertBefore(st(ie[ge],!0),ke(s))}}return qe(s),!0}return s instanceof d&&!Cl(s)||(T==="noscript"||T==="noembed"||T==="noframes")&&ve(/<\/no(script|embed|frames)/i,s.innerHTML)?(qe(s),!0):(x&&s.nodeType===3&&(w=s.textContent,Ut([v,O,m],K=>{w=Et(w,K," ")}),s.textContent!==w&&(At(e.removed,{element:s.cloneNode()}),s.textContent=w)),Me("afterSanitizeElements",s,null),!1)},Qo=function(s,w,T){if($o&&(w==="id"||w==="name")&&(T in n||T in kl))return!1;if(!(g&&!p[w]&&ve(F,w))){if(!(A&&ve(q,w))){if(!r[w]||p[w]){if(!(er(s)&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,s)||f.tagNameCheck instanceof Function&&f.tagNameCheck(s))&&(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(!An[w]){if(!ve(ce,Et(T,Y,""))){if(!((w==="src"||w==="xlink:href"||w==="href")&&s!=="script"&&ka(T,"data:")===0&&jo[s])){if(!(y&&!ve(J,Et(T,Y,"")))){if(T)return!1}}}}}}return!0},er=function(s){return s.indexOf("-")>0},tr=function(s){Me("beforeSanitizeAttributes",s,null);const{attributes:w}=s;if(!w)return;const T={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:r};let K=w.length;for(;K--;){const ie=w[K],{name:ae,namespaceURI:ge,value:Ke}=ie,Tt=Z(ae);let be=ae==="value"?Ke:_a(Ke);if(T.attrName=Tt,T.attrValue=be,T.keepAttr=!0,T.forceKeepAttr=void 0,Me("uponSanitizeAttribute",s,T),be=T.attrValue,T.forceKeepAttr||(Ln(ae,s),!T.keepAttr))continue;if(!S&&ve(/\/>/i,be)){Ln(ae,s);continue}x&&Ut([v,O,m],or=>{be=Et(be,or," ")});const nr=Z(s.nodeName);if(Qo(nr,Tt,be)){if(Ho&&(Tt==="id"||Tt==="name")&&(Ln(ae,s),be=bl+be),D&&typeof z=="object"&&typeof z.getAttributeType=="function"&&!ge)switch(z.getAttributeType(nr,Tt)){case"TrustedHTML":{be=D.createHTML(be);break}case"TrustedScriptURL":{be=D.createScriptURL(be);break}}try{ge?s.setAttributeNS(ge,ae,be):s.setAttribute(ae,be),Lo(e.removed)}catch{}}}Me("afterSanitizeAttributes",s,null)},El=function L(s){let w=null;const T=Jo(s);for(Me("beforeSanitizeShadowDOM",s,null);w=T.nextNode();)Me("uponSanitizeShadowNode",w,null),!Zo(w)&&(w.content instanceof c&&L(w.content),tr(w));Me("afterSanitizeShadowDOM",s,null)};return e.sanitize=function(L){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=null,T=null,K=null,ie=null;if(En=!L,En&&(L="<!-->"),typeof L!="string"&&!Xo(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw xt("dirty is not a string, aborting")}else throw xt("toString is not a function");if(!e.isSupported)return L;if($||Sn(s),e.removed=[],typeof L=="string"&&(St=!1),St){if(L.nodeName){const Ke=Z(L.nodeName);if(!B[Ke]||b[Ke])throw xt("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof I)w=Yo("<!---->"),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 D&&Be?D.createHTML(L):L;if(w=Yo(L),!w)return ue?null:Be?_e:""}w&&me&&qe(w.firstChild);const ae=Jo(St?L:w);for(;K=ae.nextNode();)Zo(K)||(K.content instanceof c&&El(K.content),tr(K));if(St)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(Fo,w.ownerDocument.doctype.name)&&(ge="<!DOCTYPE "+w.ownerDocument.doctype.name+`>
|
|
77
|
+
`+ge),x&&Ut([v,O,m],Ke=>{ge=Et(ge,Ke," ")}),D&&Be?D.createHTML(ge):ge},e.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Sn(L),$=!0},e.clearConfig=function(){ut=null,$=!1},e.isValidAttribute=function(L,s,w){ut||Sn({});const T=Z(L),K=Z(s);return Qo(T,K,w)},e.addHook=function(L,s){typeof s=="function"&&(k[L]=k[L]||[],At(k[L],s))},e.removeHook=function(L){if(k[L])return Lo(k[L])},e.removeHooks=function(L){k[L]&&(k[L]=[])},e.removeAllHooks=function(){k={}},e}var Uo=No();class Fa{get IsVisible(){return ot.isVisible()}async ConfirmAsync(e){return new Promise(n=>{ot.fire({showCancelButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,icon:"question",title:e.title,html:Uo.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">
|
|
78
78
|
${e.text.join("<br />")}
|
|
79
|
-
</div>`:o=e.text,new Promise(i=>{nt.fire({allowEscapeKey:!1,allowOutsideClick:!1,icon:n,title:e.title,html:Uo.sanitize(o)}).then(()=>i(!0))})}}const Ma=new Fa,Do=()=>Ma,Na=["data-cor"],Ua=l.defineComponent({__name:"HeaderAvatar",setup(t){const e=Do(),n=i();async function o(){await e.ConfirmAsync({text:`${ne.User.username} - ${ne.User.name}.<br /><br />Você deseja sair da conta?`,confirmLabel:"sair"})&&ne.CallLogout()}function i(){const E=ne.User.name;let I="?";if(!E)return I;const d=E.split(" ").filter(W=>W.length>0).map(W=>W[0].toUpperCase()),V=Math.min(2,d.length);return I=d.slice(0,V).join(""),I.length>0?I:"?"}function c(){const E=n[0],I=E==="?"?0:(E.charCodeAt(0)-64)%19;return Math.max(I,0)}return(E,I)=>(l.openBlock(),l.createElementBlock("div",{id:"sf-header-avatar","data-cor":c(),onClick:o},l.toDisplayString(l.unref(n)),9,Na))}}),Da={},$a={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},Ha=[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 Va(t,e){return l.openBlock(),l.createElementBlock("svg",$a,Ha)}const ja=In(Da,[["render",Va]]);class za{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 _n=(()=>new za)(),Wa=[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)],qa=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(_n).Toggle&&l.unref(_n).Toggle(...o))},Wa))}}),Ka={id:"sf-layout"},Ga=l.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),Ya={class:"title"},Ja={class:"sf-layout-nav-header"},Xa=l.createElementVNode("span",null,"Menu",-1),Za={class:"sf-layout-nav-content"},Qa=l.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),el={id:"sf-layout-content"},tl=l.defineComponent({__name:"Layout",setup(t){const e=Wt();return(n,o)=>(l.openBlock(),l.createElementBlock("div",Ka,[l.createElementVNode("header",null,[l.createElementVNode("div",{class:l.normalizeClass(["sf-layout-menu-toggler",{invert:l.unref(e).IsVisible}]),onClick:o[0]||(o[0]=i=>l.unref(e).Toggle())},[Ga,l.createVNode(ja)],2),l.createElementVNode("div",Ya,[l.renderSlot(n.$slots,"title")]),l.renderSlot(n.$slots,"action"),l.createVNode(qa),l.createVNode(Ua)]),l.createElementVNode("nav",{class:l.normalizeClass({visible:l.unref(e).IsVisible})},[l.createElementVNode("div",Ja,[Xa,l.createVNode(dt,{icone:"close",button:"",onClick:o[1]||(o[1]=i=>l.unref(e).Close())})]),l.createElementVNode("div",Za,[l.renderSlot(n.$slots,"menu")])],2),l.createElementVNode("main",{class:l.normalizeClass({"menu-visible":l.unref(e).IsVisible})},[Qa,l.createElementVNode("section",el,[l.renderSlot(n.$slots,"content")])],2)]))}}),nl=["href","data-active","onClick"],ol={class:"sf-navmenulink-text"},rl=l.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{},exact:{type:Boolean}},setup(t){const e=t,n=Wt();function o(i,c){i.preventDefault();const I=i.target.closest(".sf-layout-nav-content");c(),I&&I.clientWidth+10>document.body.clientWidth&&n.Close()}return(i,c)=>{const E=l.resolveComponent("router-link");return l.openBlock(),l.createBlock(E,{to:e.href,custom:""},{default:l.withCtx(({href:I,navigate:d,isExactActive:V,isActive:W})=>[l.createElementVNode("a",{class:"sf-navmenulink",href:I,"data-active":e.exact?V:W,onClick:ee=>o(ee,d)},[e.icon?(l.openBlock(),l.createBlock(dt,{key:0,icone:e.icon,"button-props":{tabindex:-1}},null,8,["icone"])):l.createCommentVNode("",!0),l.createElementVNode("span",ol,l.toDisplayString(e.text),1)],8,nl)]),_:1},8,["to"])}}}),sl=l.defineComponent({__name:"ScrollToTop",setup(t){const e=l.ref(!1),n=`--${+new Date}`;let o=null;function i(){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,E)=>(l.openBlock(),l.createElementBlock("button",{id:n,class:l.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":e.value}]),onClick:i},null,2))}}),il=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 Ge("sf-content").AddClass(e.class,!!e.class).Build()}function o(){return new Ge("sf-content-body").AddClass("sf-content-no-padding",e.disableBodyPadding).Build()}function i(){return new Ge("sf-content-header").AddClass("sf-content-no-padding",e.disableHeaderPadding).Build()}function c(){return new Ge("sf-content-footer").AddClass("sf-content-no-padding",e.disableFooterPadding).Build()}return(E,I)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(n()),style:l.normalizeStyle(e.style)},[l.createElementVNode("div",{class:l.normalizeClass(i())},[l.renderSlot(E.$slots,"header")],2),l.createElementVNode("div",{class:l.normalizeClass(o())},[l.renderSlot(E.$slots,"default"),l.createVNode(sl)],2),l.createElementVNode("div",{class:l.normalizeClass(c())},[l.renderSlot(E.$slots,"footer")],2)],6))}}),al={class:"sf-tab-navigation"},ll=[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)],cl=["data-active"],ul=["href","onClick"],dl=[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)],fl=l.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(t){const e=t,n=l.ref(null),o=new ResizeObserver(d=>{I()}),i=l.ref(!1),c=l.ref(!1);function E(d=!1){const V=n.value.clientWidth;n.value.scrollLeft+=d?-V:V}function I(){const d=n.value.scrollWidth-n.value.clientWidth;i.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,V)=>{const W=l.resolveComponent("RouterLink");return l.openBlock(),l.createElementBlock("div",al,[l.createElementVNode("div",{class:l.normalizeClass(["left-arrow",{active:i.value}]),onClick:V[0]||(V[0]=ee=>E(!0))},ll,2),l.createElementVNode("ul",{ref_key:"trackerContainer",ref:n},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.tabs,ee=>(l.openBlock(),l.createBlock(W,{to:ee.route,custom:!0},{default:l.withCtx(({navigate:Le,isActive:z})=>[l.createElementVNode("li",{"data-active":z},[l.renderSlot(d.$slots,"item",{item:ee,navigate:Le,isActive:z},()=>[l.createElementVNode("a",{href:ee.route,class:l.normalizeClass({active:z}),onClick:Le},l.toDisplayString(ee.text),11,ul)])],8,cl)]),_:2},1032,["to"]))),256))],512),l.createElementVNode("div",{class:l.normalizeClass(["right-arrow",{active:c.value}]),onClick:V[1]||(V[1]=ee=>E())},dl,2)])}}}),hl=["id","name","disabled","data-color","form","type"],pl={class:"sf-button-label"},ml=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 Ge(`${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,i)=>(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(dt,{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(dt,{key:1,loading:!0,size:e.size,"button-props":{tabindex:-1}},null,8,["size"])):l.createCommentVNode("",!0),l.createElementVNode("span",pl,[l.renderSlot(o.$slots,"default")])],14,hl))}});class gl{constructor(e=null){ut(this,"errors",[]);ut(this,"_value",null);ut(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 Ml="",Nl="";(()=>{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)})(),_n.SetInitialTheme(),G.AppResult=gl,G.AuthService=ne,G.Cor=qt,G.SfButton=ml,G.SfContent=il,G.SfIcon=dt,G.SfLayout=tl,G.SfNavMenuLink=rl,G.SfTabNavigation=fl,G.Tamanho=Ke,G.UseDialogService=Do,G.UseNavMenuService=Wt,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});
|
|
79
|
+
</div>`:o=e.text,new Promise(i=>{ot.fire({allowEscapeKey:!1,allowOutsideClick:!1,icon:n,title:e.title,html:Uo.sanitize(o)}).then(()=>i(!0))})}}const Ma=new Fa,Do=()=>Ma,Na=["data-cor"],Ua=l.defineComponent({__name:"HeaderAvatar",setup(t){const e=Do(),n=i();async function o(){await e.ConfirmAsync({text:`${ne.User.username} - ${ne.User.name}.<br /><br />Você deseja sair da conta?`,confirmLabel:"sair"})&&ne.CallLogout()}function i(){const E=ne.User.name;let I="?";if(!E)return I;const d=E.split(" ").filter(W=>W.length>0).map(W=>W[0].toUpperCase()),V=Math.min(2,d.length);return I=d.slice(0,V).join(""),I.length>0?I:"?"}function c(){const E=n[0],I=E==="?"?0:(E.charCodeAt(0)-64)%19;return Math.max(I,0)}return(E,I)=>(l.openBlock(),l.createElementBlock("div",{id:"sf-header-avatar","data-cor":c(),onClick:o},l.toDisplayString(l.unref(n)),9,Na))}}),Da={},$a={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},Ha=[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 Va(t,e){return l.openBlock(),l.createElementBlock("svg",$a,Ha)}const ja=In(Da,[["render",Va]]);class za{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 _n=(()=>new za)(),Wa=[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)],qa=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(_n).Toggle&&l.unref(_n).Toggle(...o))},Wa))}}),Ka={id:"sf-layout"},Ga=l.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),Ya={class:"title"},Ja={class:"sf-layout-nav-header"},Xa=l.createElementVNode("span",null,"Menu",-1),Za={class:"sf-layout-nav-content"},Qa=l.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),el={id:"sf-layout-content"},tl=l.defineComponent({__name:"Layout",setup(t){const e=Wt();return(n,o)=>(l.openBlock(),l.createElementBlock("div",Ka,[l.createElementVNode("header",null,[l.createElementVNode("div",{class:l.normalizeClass(["sf-layout-menu-toggler",{invert:l.unref(e).IsVisible}]),onClick:o[0]||(o[0]=i=>l.unref(e).Toggle())},[Ga,l.createVNode(ja)],2),l.createElementVNode("div",Ya,[l.renderSlot(n.$slots,"title")]),l.renderSlot(n.$slots,"action"),l.createVNode(qa),l.createVNode(Ua)]),l.createElementVNode("nav",{class:l.normalizeClass({visible:l.unref(e).IsVisible})},[l.createElementVNode("div",Ja,[Xa,l.createVNode(ft,{icone:"close",button:"",onClick:o[1]||(o[1]=i=>l.unref(e).Close())})]),l.createElementVNode("div",Za,[l.renderSlot(n.$slots,"menu")])],2),l.createElementVNode("main",{class:l.normalizeClass({"menu-visible":l.unref(e).IsVisible})},[Qa,l.createElementVNode("section",el,[l.renderSlot(n.$slots,"content")])],2)]))}}),nl=["href","data-active","onClick"],ol={class:"sf-navmenulink-text"},rl=l.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{},exact:{type:Boolean}},setup(t){const e=t,n=Wt();function o(i,c){i.preventDefault();const I=i.target.closest(".sf-layout-nav-content");c(),I&&I.clientWidth+10>document.body.clientWidth&&n.Close()}return(i,c)=>{const E=l.resolveComponent("router-link");return l.openBlock(),l.createBlock(E,{to:e.href,custom:""},{default:l.withCtx(({href:I,navigate:d,isExactActive:V,isActive:W})=>[l.createElementVNode("a",{class:"sf-navmenulink",href:I,"data-active":e.exact?V:W,onClick:ee=>o(ee,d)},[e.icon?(l.openBlock(),l.createBlock(ft,{key:0,icone:e.icon,"button-props":{tabindex:-1}},null,8,["icone"])):l.createCommentVNode("",!0),l.createElementVNode("span",ol,l.toDisplayString(e.text),1)],8,nl)]),_:1},8,["to"])}}}),sl=l.defineComponent({__name:"ScrollToTop",setup(t){const e=l.ref(!1),n=`--${+new Date}`;let o=null;function i(){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,E)=>(l.openBlock(),l.createElementBlock("button",{id:n,class:l.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":e.value}]),onClick:i},null,2))}}),il=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 Ye("sf-content").AddClass(e.class,!!e.class).Build()}function o(){return new Ye("sf-content-body").AddClass("sf-content-no-padding",e.disableBodyPadding).Build()}function i(){return new Ye("sf-content-header").AddClass("sf-content-no-padding",e.disableHeaderPadding).Build()}function c(){return new Ye("sf-content-footer").AddClass("sf-content-no-padding",e.disableFooterPadding).Build()}return(E,I)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(n()),style:l.normalizeStyle(e.style)},[l.createElementVNode("div",{class:l.normalizeClass(i())},[l.renderSlot(E.$slots,"header")],2),l.createElementVNode("div",{class:l.normalizeClass(o())},[l.renderSlot(E.$slots,"default"),l.createVNode(sl)],2),l.createElementVNode("div",{class:l.normalizeClass(c())},[l.renderSlot(E.$slots,"footer")],2)],6))}}),al={class:"sf-tab-navigation"},ll=[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)],cl=["data-active"],ul=["href","onClick"],dl=[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)],fl=l.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(t){const e=t,n=l.ref(null),o=new ResizeObserver(d=>{I()}),i=l.ref(!1),c=l.ref(!1);function E(d=!1){const V=n.value.clientWidth;n.value.scrollLeft+=d?-V:V}function I(){const d=n.value.scrollWidth-n.value.clientWidth;i.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,V)=>{const W=l.resolveComponent("RouterLink");return l.openBlock(),l.createElementBlock("div",al,[l.createElementVNode("div",{class:l.normalizeClass(["left-arrow",{active:i.value}]),onClick:V[0]||(V[0]=ee=>E(!0))},ll,2),l.createElementVNode("ul",{ref_key:"trackerContainer",ref:n},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.tabs,ee=>(l.openBlock(),l.createBlock(W,{to:ee.route,custom:!0},{default:l.withCtx(({navigate:Le,isActive:z})=>[l.createElementVNode("li",{"data-active":z},[l.renderSlot(d.$slots,"item",{item:ee,navigate:Le,isActive:z},()=>[l.createElementVNode("a",{href:ee.route,class:l.normalizeClass({active:z}),onClick:Le},l.toDisplayString(ee.text),11,ul)])],8,cl)]),_:2},1032,["to"]))),256))],512),l.createElementVNode("div",{class:l.normalizeClass(["right-arrow",{active:c.value}]),onClick:V[1]||(V[1]=ee=>E())},dl,2)])}}}),hl=["id","name","disabled","data-color","form","type"],pl={class:"sf-button-label"},ml=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 Ye(`${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,i)=>(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(ft,{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(ft,{key:1,loading:!0,size:e.size,"button-props":{tabindex:-1}},null,8,["size"])):l.createCommentVNode("",!0),l.createElementVNode("span",pl,[l.renderSlot(o.$slots,"default")])],14,hl))}});class gl{constructor(e=null){dt(this,"errors",[]);dt(this,"_value",null);dt(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 Ml="",Nl="";(()=>{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)})(),_n.SetInitialTheme(),G.AppResult=gl,G.AuthService=ne,G.Cor=qt,G.SfButton=ml,G.SfContent=il,G.SfIcon=ft,G.SfLayout=tl,G.SfNavMenuLink=rl,G.SfTabNavigation=fl,G.Tamanho=Ge,G.UseDialogService=Do,G.UseNavMenuService=Wt,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});
|
|
80
80
|
//# sourceMappingURL=lib.umd.js.map
|