@luizleon/sf.prefeiturasp.vuecomponents 0.0.7 → 0.0.9
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/common/appResult.d.ts +10 -0
- package/dist/index.d.ts +2 -1
- package/dist/keycloak.d.ts +671 -0
- package/dist/lib.es.js +1643 -1556
- package/dist/lib.es.js.map +1 -1
- package/dist/lib.umd.js +37 -37
- package/dist/lib.umd.js.map +1 -1
- package/dist/services/authService.d.ts +1 -1
- package/package.json +4 -2
- package/src/common/appResult.ts +22 -0
- package/src/index.ts +2 -0
- package/src/keycloak.d.ts +671 -0
- package/src/keycloak.js +1729 -0
- package/src/services/authService.ts +1 -2
package/dist/lib.umd.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(W,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(W=typeof globalThis<"u"?globalThis:W||self,c(W.Lib={},W.Vue))})(this,function(W,c){"use strict";var Ns=Object.defineProperty;var Hs=(W,c,Se)=>c in W?Ns(W,c,{enumerable:!0,configurable:!0,writable:!0,value:Se}):W[c]=Se;var $e=(W,c,Se)=>(Hs(W,typeof c!="symbol"?c+"":c,Se),Se);class Se{constructor(){$e(this,"_visible",c.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 rn=new Se,Xe=()=>rn;var Ze=(l=>(l.Primary="primary",l.Secondary="secondary",l.Info="info",l.Success="success",l.Help="help",l.Warn="warn",l.Error="error",l))(Ze||{}),Pe=(l=>(l.Pequeno="sm",l.Medio="md",l.Grande="lg",l))(Pe||{});const mt=(l,o)=>{const h=l.__vccOpts||l;for(const[k,U]of o)h[k]=U;return h},sn={},an={class:"sf-loading-circle"},cn=[c.createElementVNode("div",null,[c.createElementVNode("svg",{viewBox:"25 25 50 50"},[c.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})])],-1)];function ln(l,o){return c.openBlock(),c.createElementBlock("div",an,cn)}const un=mt(sn,[["render",ln]]);class Oe{constructor(o){$e(this,"retorno");this.retorno=o??""}Concat(o){return o&&o.trim().length&&(this.retorno+=` ${o}`),this}AddClass(o,h=!0){return h?this.Concat(o):this}Build(){return this.retorno.trim()}}const dn=["disabled","tabindex"],fn=["data-color"],Ge=c.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:Pe.Medio},dot:{type:Boolean},dotColor:{default:Ze.Error},buttonProps:{}},setup(l){const o=l;function h(){return new Oe(`${o.class} sf-icon`).AddClass("sf-component-loading",o.loading).AddClass("sf-component-disabled",o.disabled).AddClass("sf-icon-button",o.button).AddClass("sf-icon-small",o.tamanho===Pe.Pequeno).AddClass("sf-icon-medium",o.tamanho===Pe.Medio).AddClass("sf-icon-large",o.tamanho===Pe.Grande).AddClass("sf-ripple",o.button===!0).Build()}return(k,U)=>(c.openBlock(),c.createElementBlock("div",{style:c.normalizeStyle(o.style),class:c.normalizeClass(h())},[c.createElementVNode("button",c.mergeProps({class:"material-symbols-outlined",disabled:o.disabled||o.loading},o.buttonProps,{tabindex:o.button?void 0:-1}),[o.loading?(c.openBlock(),c.createBlock(un,{key:0})):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createTextVNode(c.toDisplayString(o.icone),1)],64))],16,dn),o.dot?(c.openBlock(),c.createElementBlock("span",{key:0,"data-color":o.dotColor},null,8,fn)):c.createCommentVNode("",!0)],6))}});var ke=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gt(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function hn(l){if(l.__esModule)return l;var o=l.default;if(typeof o=="function"){var h=function k(){return this instanceof k?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};h.prototype=o.prototype}else h={};return Object.defineProperty(h,"__esModule",{value:!0}),Object.keys(l).forEach(function(k){var U=Object.getOwnPropertyDescriptor(l,k);Object.defineProperty(h,k,U.get?U:{enumerable:!0,get:function(){return l[k]}})}),h}var qe={};qe.byteLength=gn,qe.toByteArray=wn,qe.fromByteArray=kn;for(var be=[],de=[],pn=typeof Uint8Array<"u"?Uint8Array:Array,Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Be=0,mn=Qe.length;Be<mn;++Be)be[Be]=Qe[Be],de[Qe.charCodeAt(Be)]=Be;de["-".charCodeAt(0)]=62,de["_".charCodeAt(0)]=63;function bt(l){var o=l.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=l.indexOf("=");h===-1&&(h=o);var k=h===o?0:4-h%4;return[h,k]}function gn(l){var o=bt(l),h=o[0],k=o[1];return(h+k)*3/4-k}function bn(l,o,h){return(o+h)*3/4-h}function wn(l){var o,h=bt(l),k=h[0],U=h[1],x=new pn(bn(l,k,U)),I=0,O=U>0?k-4:k,p;for(p=0;p<O;p+=4)o=de[l.charCodeAt(p)]<<18|de[l.charCodeAt(p+1)]<<12|de[l.charCodeAt(p+2)]<<6|de[l.charCodeAt(p+3)],x[I++]=o>>16&255,x[I++]=o>>8&255,x[I++]=o&255;return U===2&&(o=de[l.charCodeAt(p)]<<2|de[l.charCodeAt(p+1)]>>4,x[I++]=o&255),U===1&&(o=de[l.charCodeAt(p)]<<10|de[l.charCodeAt(p+1)]<<4|de[l.charCodeAt(p+2)]>>2,x[I++]=o>>8&255,x[I++]=o&255),x}function yn(l){return be[l>>18&63]+be[l>>12&63]+be[l>>6&63]+be[l&63]}function vn(l,o,h){for(var k,U=[],x=o;x<h;x+=3)k=(l[x]<<16&16711680)+(l[x+1]<<8&65280)+(l[x+2]&255),U.push(yn(k));return U.join("")}function kn(l){for(var o,h=l.length,k=h%3,U=[],x=16383,I=0,O=h-k;I<O;I+=x)U.push(vn(l,I,I+x>O?O:I+x));return k===1?(o=l[h-1],U.push(be[o>>2]+be[o<<4&63]+"==")):k===2&&(o=(l[h-2]<<8)+l[h-1],U.push(be[o>>10]+be[o>>4&63]+be[o<<2&63]+"=")),U.join("")}var wt={exports:{}};const yt=hn(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
|
-
* @version 0.
|
|
4
|
+
* @version 0.10.1
|
|
5
5
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
6
|
-
* @copyright Chen, Yi-Cyuan 2014-
|
|
6
|
+
* @copyright Chen, Yi-Cyuan 2014-2023
|
|
7
7
|
* @license MIT
|
|
8
|
-
*/(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(s){return typeof s=="object"&&s.buffer&&s.buffer.constructor===ArrayBuffer});var createOutputMethod=function(s,o){return function(u){return new Sha256(o,!0).update(u)[s]()}},createMethod=function(s){var o=createOutputMethod("hex",s);NODE_JS&&(o=nodeWrap(o,s)),o.create=function(){return new Sha256(s)},o.update=function(k){return o.create().update(k)};for(var u=0;u<OUTPUT_TYPES.length;++u){var f=OUTPUT_TYPES[u];o[f]=createOutputMethod(f,s)}return o},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(s){if(typeof s=="string")return crypto.createHash(algorithm).update(s,"utf8").digest("hex");if(s==null)throw new Error(ERROR);return s.constructor===ArrayBuffer&&(s=new Uint8Array(s)),Array.isArray(s)||ArrayBuffer.isView(s)||s.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(s)).digest("hex"):method(s)};return nodeMethod},createHmacOutputMethod=function(s,o){return function(u,f){return new HmacSha256(u,o,!0).update(f)[s]()}},createHmacMethod=function(s){var o=createHmacOutputMethod("hex",s);o.create=function(k){return new HmacSha256(k,s)},o.update=function(k,l){return o.create(k).update(l)};for(var u=0;u<OUTPUT_TYPES.length;++u){var f=OUTPUT_TYPES[u];o[f]=createHmacOutputMethod(f,s)}return o};function Sha256(s,o){o?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s?(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=s}Sha256.prototype.update=function(s){if(!this.finalized){var o,u=typeof s;if(u!=="string"){if(u==="object"){if(s===null)throw new Error(ERROR);if(ARRAY_BUFFER&&s.constructor===ArrayBuffer)s=new Uint8Array(s);else if(!Array.isArray(s)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(s)))throw new Error(ERROR)}else throw new Error(ERROR);o=!0}for(var f,k=0,l,y=s.length,h=this.blocks;k<y;){if(this.hashed&&(this.hashed=!1,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),o)for(l=this.start;k<y&&l<64;++k)h[l>>2]|=s[k]<<SHIFT[l++&3];else for(l=this.start;k<y&&l<64;++k)f=s.charCodeAt(k),f<128?h[l>>2]|=f<<SHIFT[l++&3]:f<2048?(h[l>>2]|=(192|f>>6)<<SHIFT[l++&3],h[l>>2]|=(128|f&63)<<SHIFT[l++&3]):f<55296||f>=57344?(h[l>>2]|=(224|f>>12)<<SHIFT[l++&3],h[l>>2]|=(128|f>>6&63)<<SHIFT[l++&3],h[l>>2]|=(128|f&63)<<SHIFT[l++&3]):(f=65536+((f&1023)<<10|s.charCodeAt(++k)&1023),h[l>>2]|=(240|f>>18)<<SHIFT[l++&3],h[l>>2]|=(128|f>>12&63)<<SHIFT[l++&3],h[l>>2]|=(128|f>>6&63)<<SHIFT[l++&3],h[l>>2]|=(128|f&63)<<SHIFT[l++&3]);this.lastByteIndex=l,this.bytes+=l-this.start,l>=64?(this.block=h[16],this.start=l-64,this.hash(),this.hashed=!0):this.start=l}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var s=this.blocks,o=this.lastByteIndex;s[16]=this.block,s[o>>2]|=EXTRA[o&3],this.block=s[16],o>=56&&(this.hashed||this.hash(),s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),s[14]=this.hBytes<<3|this.bytes>>>29,s[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var s=this.h0,o=this.h1,u=this.h2,f=this.h3,k=this.h4,l=this.h5,y=this.h6,h=this.h7,x=this.blocks,B,U,R,V,T,J,D,j,he,Q,ie;for(B=16;B<64;++B)T=x[B-15],U=(T>>>7|T<<25)^(T>>>18|T<<14)^T>>>3,T=x[B-2],R=(T>>>17|T<<15)^(T>>>19|T<<13)^T>>>10,x[B]=x[B-16]+U+x[B-7]+R<<0;for(ie=o&u,B=0;B<64;B+=4)this.first?(this.is224?(j=300032,T=x[0]-1413257819,h=T-150054599<<0,f=T+24177077<<0):(j=704751109,T=x[0]-210244248,h=T-1521486534<<0,f=T+143694565<<0),this.first=!1):(U=(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10),R=(k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7),j=s&o,V=j^s&u^ie,D=k&l^~k&y,T=h+R+D+K[B]+x[B],J=U+V,h=f+T<<0,f=T+J<<0),U=(f>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),R=(h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7),he=f&s,V=he^f&o^j,D=h&k^~h&l,T=y+R+D+K[B+1]+x[B+1],J=U+V,y=u+T<<0,u=T+J<<0,U=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),R=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),Q=u&f,V=Q^u&s^he,D=y&h^~y&k,T=l+R+D+K[B+2]+x[B+2],J=U+V,l=o+T<<0,o=T+J<<0,U=(o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10),R=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),ie=o&u,V=ie^o&f^Q,D=l&y^~l&h,T=k+R+D+K[B+3]+x[B+3],J=U+V,k=s+T<<0,s=T+J<<0;this.h0=this.h0+s<<0,this.h1=this.h1+o<<0,this.h2=this.h2+u<<0,this.h3=this.h3+f<<0,this.h4=this.h4+k<<0,this.h5=this.h5+l<<0,this.h6=this.h6+y<<0,this.h7=this.h7+h<<0},Sha256.prototype.hex=function(){this.finalize();var s=this.h0,o=this.h1,u=this.h2,f=this.h3,k=this.h4,l=this.h5,y=this.h6,h=this.h7,x=HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]+HEX_CHARS[u>>28&15]+HEX_CHARS[u>>24&15]+HEX_CHARS[u>>20&15]+HEX_CHARS[u>>16&15]+HEX_CHARS[u>>12&15]+HEX_CHARS[u>>8&15]+HEX_CHARS[u>>4&15]+HEX_CHARS[u&15]+HEX_CHARS[f>>28&15]+HEX_CHARS[f>>24&15]+HEX_CHARS[f>>20&15]+HEX_CHARS[f>>16&15]+HEX_CHARS[f>>12&15]+HEX_CHARS[f>>8&15]+HEX_CHARS[f>>4&15]+HEX_CHARS[f&15]+HEX_CHARS[k>>28&15]+HEX_CHARS[k>>24&15]+HEX_CHARS[k>>20&15]+HEX_CHARS[k>>16&15]+HEX_CHARS[k>>12&15]+HEX_CHARS[k>>8&15]+HEX_CHARS[k>>4&15]+HEX_CHARS[k&15]+HEX_CHARS[l>>28&15]+HEX_CHARS[l>>24&15]+HEX_CHARS[l>>20&15]+HEX_CHARS[l>>16&15]+HEX_CHARS[l>>12&15]+HEX_CHARS[l>>8&15]+HEX_CHARS[l>>4&15]+HEX_CHARS[l&15]+HEX_CHARS[y>>28&15]+HEX_CHARS[y>>24&15]+HEX_CHARS[y>>20&15]+HEX_CHARS[y>>16&15]+HEX_CHARS[y>>12&15]+HEX_CHARS[y>>8&15]+HEX_CHARS[y>>4&15]+HEX_CHARS[y&15];return this.is224||(x+=HEX_CHARS[h>>28&15]+HEX_CHARS[h>>24&15]+HEX_CHARS[h>>20&15]+HEX_CHARS[h>>16&15]+HEX_CHARS[h>>12&15]+HEX_CHARS[h>>8&15]+HEX_CHARS[h>>4&15]+HEX_CHARS[h&15]),x},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var s=this.h0,o=this.h1,u=this.h2,f=this.h3,k=this.h4,l=this.h5,y=this.h6,h=this.h7,x=[s>>24&255,s>>16&255,s>>8&255,s&255,o>>24&255,o>>16&255,o>>8&255,o&255,u>>24&255,u>>16&255,u>>8&255,u&255,f>>24&255,f>>16&255,f>>8&255,f&255,k>>24&255,k>>16&255,k>>8&255,k&255,l>>24&255,l>>16&255,l>>8&255,l&255,y>>24&255,y>>16&255,y>>8&255,y&255];return this.is224||x.push(h>>24&255,h>>16&255,h>>8&255,h&255),x},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var s=new ArrayBuffer(this.is224?28:32),o=new DataView(s);return o.setUint32(0,this.h0),o.setUint32(4,this.h1),o.setUint32(8,this.h2),o.setUint32(12,this.h3),o.setUint32(16,this.h4),o.setUint32(20,this.h5),o.setUint32(24,this.h6),this.is224||o.setUint32(28,this.h7),s};function HmacSha256(s,o,u){var f,k=typeof s;if(k==="string"){var l=[],y=s.length,h=0,x;for(f=0;f<y;++f)x=s.charCodeAt(f),x<128?l[h++]=x:x<2048?(l[h++]=192|x>>6,l[h++]=128|x&63):x<55296||x>=57344?(l[h++]=224|x>>12,l[h++]=128|x>>6&63,l[h++]=128|x&63):(x=65536+((x&1023)<<10|s.charCodeAt(++f)&1023),l[h++]=240|x>>18,l[h++]=128|x>>12&63,l[h++]=128|x>>6&63,l[h++]=128|x&63);s=l}else if(k==="object"){if(s===null)throw new Error(ERROR);if(ARRAY_BUFFER&&s.constructor===ArrayBuffer)s=new Uint8Array(s);else if(!Array.isArray(s)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(s)))throw new Error(ERROR)}else throw new Error(ERROR);s.length>64&&(s=new Sha256(o,!0).update(s).array());var B=[],U=[];for(f=0;f<64;++f){var R=s[f]||0;B[f]=92^R,U[f]=54^R}Sha256.call(this,o,u),this.update(U),this.oKeyPad=B,this.inner=!0,this.sharedMemory=u}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var s=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(s),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224)})()})(sha256$1);var sha256Exports=sha256$1.exports;const sha256=getDefaultExportFromCjs(sha256Exports);if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function Keycloak(s){if(!(this instanceof Keycloak))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var o=this,u,f=[],k,l={enable:!0,callbackList:[],interval:5},y=document.getElementsByTagName("script"),h=0;h<y.length;h++)(y[h].src.indexOf("keycloak.js")!==-1||y[h].src.indexOf("keycloak.min.js")!==-1)&&y[h].src.indexOf("version=")!==-1&&(o.iframeVersion=y[h].src.substring(y[h].src.indexOf("version=")+8).split("&")[0]);var x=!0,B=Ae(console.info),U=Ae(console.warn);o.init=function(a){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");o.didInitialize=!0,o.authenticated=!1,k=be();var c=["default","cordova","cordova-native"];if(a&&c.indexOf(a.adapter)>-1?u=I(a.adapter):a&&typeof a.adapter=="object"?u=a.adapter:window.Cordova||window.cordova?u=I("cordova"):u=I(),a){if(typeof a.useNonce<"u"&&(x=a.useNonce),typeof a.checkLoginIframe<"u"&&(l.enable=a.checkLoginIframe),a.checkLoginIframeInterval&&(l.interval=a.checkLoginIframeInterval),a.onLoad==="login-required"&&(o.loginRequired=!0),a.responseMode)if(a.responseMode==="query"||a.responseMode==="fragment")o.responseMode=a.responseMode;else throw"Invalid value for responseMode";if(a.flow){switch(a.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=a.flow}if(a.timeSkew!=null&&(o.timeSkew=a.timeSkew),a.redirectUri&&(o.redirectUri=a.redirectUri),a.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=a.silentCheckSsoRedirectUri),typeof a.silentCheckSsoFallback=="boolean"?o.silentCheckSsoFallback=a.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,a.pkceMethod){if(a.pkceMethod!=="S256")throw"Invalid value for pkceMethod";o.pkceMethod=a.pkceMethod}typeof a.enableLogging=="boolean"?o.enableLogging=a.enableLogging:o.enableLogging=!1,typeof a.scope=="string"&&(o.scope=a.scope),typeof a.messageReceiveTimeout=="number"&&a.messageReceiveTimeout>0?o.messageReceiveTimeout=a.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var g=M(),w=M();w.promise.then(function(){o.onReady&&o.onReady(o.authenticated),g.setSuccess(o.authenticated)}).catch(function(_){g.setError(_)});var m=ie();function C(){var _=function(L){L||(E.prompt="none"),a&&a.locale&&(E.locale=a.locale),o.login(E).then(function(){w.setSuccess()}).catch(function(G){w.setError(G)})},S=function(){var L=document.createElement("iframe"),G=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});L.setAttribute("src",G),L.setAttribute("sandbox","allow-scripts allow-same-origin"),L.setAttribute("title","keycloak-silent-check-sso"),L.style.display="none",document.body.appendChild(L);var ne=function($){if(!($.origin!==window.location.origin||L.contentWindow!==$.source)){var pe=ae($.data);Q(pe,w),document.body.removeChild(L),window.removeEventListener("message",ne)}};window.addEventListener("message",ne)},E={};switch(a.onLoad){case"check-sso":l.enable?ce().then(function(){re().then(function(L){L?w.setSuccess():o.silentCheckSsoRedirectUri?S():_(!1)}).catch(function(L){w.setError(L)})}):o.silentCheckSsoRedirectUri?S():_(!1);break;case"login-required":_(!0);break;default:throw"Invalid value for onLoad"}}function v(){var _=ae(window.location.href);if(_&&window.history.replaceState(window.history.state,null,_.newUrl),_&&_.valid)return ce().then(function(){Q(_,w)}).catch(function(S){w.setError(S)});a?a.token&&a.refreshToken?(de(a.token,a.refreshToken,a.idToken),l.enable?ce().then(function(){re().then(function(S){S?(o.onAuthSuccess&&o.onAuthSuccess(),w.setSuccess(),N()):w.setSuccess()}).catch(function(S){w.setError(S)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),w.setSuccess()}).catch(function(S){o.onAuthError&&o.onAuthError(),a.onLoad?C():w.setError(S)})):a.onLoad?C():w.setSuccess():w.setSuccess()}function b(){var _=M(),S=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",S),_.setSuccess())};return document.addEventListener("readystatechange",S),S(),_.promise}return m.then(function(){b().then(Y).then(v).catch(function(_){g.setError(_)})}),m.catch(function(_){g.setError(_)}),g.promise},o.login=function(a){return u.login(a)};function R(a){var c=null,g=window.crypto||window.msCrypto;if(g&&g.getRandomValues&&window.Uint8Array)return c=new Uint8Array(a),g.getRandomValues(c),c;c=new Array(a);for(var w=0;w<c.length;w++)c[w]=Math.floor(256*Math.random());return c}function V(a){return T(a,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function T(a,c){for(var g=R(a),w=new Array(a),m=0;m<a;m++)w[m]=c.charCodeAt(g[m]%c.length);return String.fromCharCode.apply(null,w)}function J(a,c){switch(a){case"S256":var g=new Uint8Array(sha256.arrayBuffer(c)),w=base64Js.fromByteArray(g).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return w;default:throw"Invalid value for pkceMethod"}}function D(a){var c={id_token:{acr:a}};return JSON.stringify(c)}o.createLoginUrl=function(a){var c=Ie(),g=Ie(),w=u.redirectUri(a),m={state:c,nonce:g,redirectUri:encodeURIComponent(w)};a&&a.prompt&&(m.prompt=a.prompt);var C;a&&a.action=="register"?C=o.endpoints.register():C=o.endpoints.authorize();var v=a&&a.scope||o.scope;v?v.indexOf("openid")===-1&&(v="openid "+v):v="openid";var b=C+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(w)+"&state="+encodeURIComponent(c)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(v);if(x&&(b=b+"&nonce="+encodeURIComponent(g)),a&&a.prompt&&(b+="&prompt="+encodeURIComponent(a.prompt)),a&&a.maxAge&&(b+="&max_age="+encodeURIComponent(a.maxAge)),a&&a.loginHint&&(b+="&login_hint="+encodeURIComponent(a.loginHint)),a&&a.idpHint&&(b+="&kc_idp_hint="+encodeURIComponent(a.idpHint)),a&&a.action&&a.action!="register"&&(b+="&kc_action="+encodeURIComponent(a.action)),a&&a.locale&&(b+="&ui_locales="+encodeURIComponent(a.locale)),a&&a.acr){var _=D(a.acr);b+="&claims="+encodeURIComponent(_)}if(o.pkceMethod){var S=V(96);m.pkceCodeVerifier=S;var E=J(o.pkceMethod,S);b+="&code_challenge="+E,b+="&code_challenge_method="+o.pkceMethod}return k.add(m),b},o.logout=function(a){return u.logout(a)},o.createLogoutUrl=function(a){var c=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(u.redirectUri(a,!1));return o.idToken&&(c+="&id_token_hint="+encodeURIComponent(o.idToken)),c},o.register=function(a){return u.register(a)},o.createRegisterUrl=function(a){return a||(a={}),a.action="register",o.createLoginUrl(a)},o.createAccountUrl=function(a){var c=j(),g=void 0;return typeof c<"u"&&(g=c+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(u.redirectUri(a))),g},o.accountManagement=function(){return u.accountManagement()},o.hasRealmRole=function(a){var c=o.realmAccess;return!!c&&c.roles.indexOf(a)>=0},o.hasResourceRole=function(a,c){if(!o.resourceAccess)return!1;var g=o.resourceAccess[c||o.clientId];return!!g&&g.roles.indexOf(a)>=0},o.loadUserProfile=function(){var a=j()+"/account",c=new XMLHttpRequest;c.open("GET",a,!0),c.setRequestHeader("Accept","application/json"),c.setRequestHeader("Authorization","bearer "+o.token);var g=M();return c.onreadystatechange=function(){c.readyState==4&&(c.status==200?(o.profile=JSON.parse(c.responseText),g.setSuccess(o.profile)):g.setError())},c.send(),g.promise},o.loadUserInfo=function(){var a=o.endpoints.userinfo(),c=new XMLHttpRequest;c.open("GET",a,!0),c.setRequestHeader("Accept","application/json"),c.setRequestHeader("Authorization","bearer "+o.token);var g=M();return c.onreadystatechange=function(){c.readyState==4&&(c.status==200?(o.userInfo=JSON.parse(c.responseText),g.setSuccess(o.userInfo)):g.setError())},c.send(),g.promise},o.isTokenExpired=function(a){if(!o.tokenParsed||!o.refreshToken&&o.flow!="implicit")throw"Not authenticated";if(o.timeSkew==null)return B("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var c=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(a){if(isNaN(a))throw"Invalid minValidity";c-=a}return c<0},o.updateToken=function(a){var c=M();if(!o.refreshToken)return c.setError(),c.promise;a=a||5;var g=function(){var m=!1;if(a==-1?(m=!0,B("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(a))&&(m=!0,B("[KEYCLOAK] Refreshing token: token expired")),!m)c.setSuccess(!1);else{var C="grant_type=refresh_token&refresh_token="+o.refreshToken,v=o.endpoints.token();if(f.push(c),f.length==1){var b=new XMLHttpRequest;b.open("POST",v,!0),b.setRequestHeader("Content-type","application/x-www-form-urlencoded"),b.withCredentials=!0,C+="&client_id="+encodeURIComponent(o.clientId);var _=new Date().getTime();b.onreadystatechange=function(){if(b.readyState==4)if(b.status==200){B("[KEYCLOAK] Token refreshed"),_=(_+new Date().getTime())/2;var S=JSON.parse(b.responseText);de(S.access_token,S.refresh_token,S.id_token,_),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var E=f.pop();E!=null;E=f.pop())E.setSuccess(!0)}else{U("[KEYCLOAK] Failed to refresh token"),b.status==400&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var E=f.pop();E!=null;E=f.pop())E.setError(!0)}},b.send(C)}}};if(l.enable){var w=re();w.then(function(){g()}).catch(function(m){c.setError(m)})}else g();return c.promise},o.clearToken=function(){o.token&&(de(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())};function j(){if(typeof o.authServerUrl<"u")return o.authServerUrl.charAt(o.authServerUrl.length-1)=="/"?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function he(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function Q(a,c){var g=a.code,w=a.error,m=a.prompt,C=new Date().getTime();if(a.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(a.kc_action_status),w){if(m!="none"){var v={error:w,error_description:a.error_description};o.onAuthError&&o.onAuthError(v),c&&c.setError(v)}else c&&c.setSuccess();return}else o.flow!="standard"&&(a.access_token||a.id_token)&&E(a.access_token,null,a.id_token,!0);if(o.flow!="implicit"&&g){var b="code="+g+"&grant_type=authorization_code",_=o.endpoints.token(),S=new XMLHttpRequest;S.open("POST",_,!0),S.setRequestHeader("Content-type","application/x-www-form-urlencoded"),b+="&client_id="+encodeURIComponent(o.clientId),b+="&redirect_uri="+a.redirectUri,a.pkceCodeVerifier&&(b+="&code_verifier="+a.pkceCodeVerifier),S.withCredentials=!0,S.onreadystatechange=function(){if(S.readyState==4)if(S.status==200){var L=JSON.parse(S.responseText);E(L.access_token,L.refresh_token,L.id_token,o.flow==="standard"),N()}else o.onAuthError&&o.onAuthError(),c&&c.setError()},S.send(b)}function E(L,G,ne,$){C=(C+new Date().getTime())/2,de(L,G,ne,C),x&&(o.tokenParsed&&o.tokenParsed.nonce!=a.storedNonce||o.refreshTokenParsed&&o.refreshTokenParsed.nonce!=a.storedNonce||o.idTokenParsed&&o.idTokenParsed.nonce!=a.storedNonce)?(B("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),c&&c.setError()):$&&(o.onAuthSuccess&&o.onAuthSuccess(),c&&c.setSuccess())}}function ie(a){var c=M(),g;s?typeof s=="string"&&(g=s):g="keycloak.json";function w(S){S?o.endpoints={authorize:function(){return S.authorization_endpoint},token:function(){return S.token_endpoint},logout:function(){if(!S.end_session_endpoint)throw"Not supported by the OIDC server";return S.end_session_endpoint},checkSessionIframe:function(){if(!S.check_session_iframe)throw"Not supported by the OIDC server";return S.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!S.userinfo_endpoint)throw"Not supported by the OIDC server";return S.userinfo_endpoint}}:o.endpoints={authorize:function(){return j()+"/protocol/openid-connect/auth"},token:function(){return j()+"/protocol/openid-connect/token"},logout:function(){return j()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var E=j()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(E=E+"?version="+o.iframeVersion),E},thirdPartyCookiesIframe:function(){var E=j()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(E=E+"?version="+o.iframeVersion),E},register:function(){return j()+"/protocol/openid-connect/registrations"},userinfo:function(){return j()+"/protocol/openid-connect/userinfo"}}}if(g){var m=new XMLHttpRequest;m.open("GET",g,!0),m.setRequestHeader("Accept","application/json"),m.onreadystatechange=function(){if(m.readyState==4)if(m.status==200||Se(m)){var S=JSON.parse(m.responseText);o.authServerUrl=S["auth-server-url"],o.realm=S.realm,o.clientId=S.resource,w(null),c.setSuccess()}else c.setError()},m.send()}else{if(!s.clientId)throw"clientId missing";o.clientId=s.clientId;var C=s.oidcProvider;if(C)if(typeof C=="string"){var _;C.charAt(C.length-1)=="/"?_=C+".well-known/openid-configuration":_=C+"/.well-known/openid-configuration";var m=new XMLHttpRequest;m.open("GET",_,!0),m.setRequestHeader("Accept","application/json"),m.onreadystatechange=function(){if(m.readyState==4)if(m.status==200||Se(m)){var E=JSON.parse(m.responseText);w(E),c.setSuccess()}else c.setError()},m.send()}else w(C),c.setSuccess();else{if(!s.url){for(var v=document.getElementsByTagName("script"),b=0;b<v.length;b++)if(v[b].src.match(/.*keycloak\.js/)){s.url=v[b].src.substr(0,v[b].src.indexOf("/js/keycloak.js"));break}}if(!s.realm)throw"realm missing";o.authServerUrl=s.url,o.realm=s.realm,w(null),c.setSuccess()}}return c.promise}function Se(a){return a.status==0&&a.responseText&&a.responseURL.startsWith("file:")}function de(a,c,g,w){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),c?(o.refreshToken=c,o.refreshTokenParsed=_e(c)):(delete o.refreshToken,delete o.refreshTokenParsed),g?(o.idToken=g,o.idTokenParsed=_e(g)):(delete o.idToken,delete o.idTokenParsed),a){if(o.token=a,o.tokenParsed=_e(a),o.sessionId=o.tokenParsed.session_state,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,w&&(o.timeSkew=Math.floor(w/1e3)-o.tokenParsed.iat),o.timeSkew!=null&&(B("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var m=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;B("[KEYCLOAK] Token expires in "+Math.round(m/1e3)+" s"),m<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,m)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function _e(a){switch(a=a.split(".")[1],a=a.replace(/-/g,"+"),a=a.replace(/_/g,"/"),a.length%4){case 0:break;case 2:a+="==";break;case 3:a+="=";break;default:throw"Invalid token"}return a=decodeURIComponent(escape(atob(a))),a=JSON.parse(a),a}function Ie(){var a="0123456789abcdef",c=T(36,a).split("");c[14]="4",c[19]=a.substr(c[19]&3|8,1),c[8]=c[13]=c[18]=c[23]="-";var g=c.join("");return g}function ae(a){var c=Oe(a);if(c){var g=k.get(c.state);return g&&(c.valid=!0,c.redirectUri=g.redirectUri,c.storedNonce=g.nonce,c.prompt=g.prompt,c.pkceCodeVerifier=g.pkceCodeVerifier),c}}function Oe(a){var c;switch(o.flow){case"standard":c=["code","state","session_state","kc_action_status","iss"];break;case"implicit":c=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":c=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}c.push("error"),c.push("error_description"),c.push("error_uri");var g=a.indexOf("?"),w=a.indexOf("#"),m,C;if(o.responseMode==="query"&&g!==-1?(m=a.substring(0,g),C=Fe(a.substring(g+1,w!==-1?w:a.length),c),C.paramsString!==""&&(m+="?"+C.paramsString),w!==-1&&(m+=a.substring(w))):o.responseMode==="fragment"&&w!==-1&&(m=a.substring(0,w),C=Fe(a.substring(w+1),c),C.paramsString!==""&&(m+="#"+C.paramsString)),C&&C.oauthParams){if(o.flow==="standard"||o.flow==="hybrid"){if((C.oauthParams.code||C.oauthParams.error)&&C.oauthParams.state)return C.oauthParams.newUrl=m,C.oauthParams}else if(o.flow==="implicit"&&(C.oauthParams.access_token||C.oauthParams.error)&&C.oauthParams.state)return C.oauthParams.newUrl=m,C.oauthParams}}function Fe(a,c){for(var g=a.split("&"),w={paramsString:"",oauthParams:{}},m=0;m<g.length;m++){var C=g[m].indexOf("="),v=g[m].slice(0,C);c.indexOf(v)!==-1?w.oauthParams[v]=g[m].slice(C+1):(w.paramsString!==""&&(w.paramsString+="&"),w.paramsString+=g[m])}return w}function M(){var a={setSuccess:function(c){a.resolve(c)},setError:function(c){a.reject(c)}};return a.promise=new Promise(function(c,g){a.resolve=c,a.reject=g}),a}function d(a,c,g){var w=null,m=new Promise(function(C,v){w=setTimeout(function(){v({error:g||"Promise is not settled within timeout of "+c+"ms"})},c)});return Promise.race([a,m]).finally(function(){clearTimeout(w)})}function ce(){var a=M();if(!l.enable||l.iframe)return a.setSuccess(),a.promise;var c=document.createElement("iframe");l.iframe=c,c.onload=function(){var m=o.endpoints.authorize();m.charAt(0)==="/"?l.iframeOrigin=he():l.iframeOrigin=m.substring(0,m.indexOf("/",8)),a.setSuccess()};var g=o.endpoints.checkSessionIframe();c.setAttribute("src",g),c.setAttribute("sandbox","allow-scripts allow-same-origin"),c.setAttribute("title","keycloak-session-iframe"),c.style.display="none",document.body.appendChild(c);var w=function(m){if(!(m.origin!==l.iframeOrigin||l.iframe.contentWindow!==m.source)&&(m.data=="unchanged"||m.data=="changed"||m.data=="error")){m.data!="unchanged"&&o.clearToken();for(var C=l.callbackList.splice(0,l.callbackList.length),v=C.length-1;v>=0;--v){var b=C[v];m.data=="error"?b.setError():b.setSuccess(m.data=="unchanged")}}};return window.addEventListener("message",w,!1),a.promise}function N(){l.enable&&o.token&&setTimeout(function(){re().then(function(a){a&&N()})},l.interval*1e3)}function re(){var a=M();if(l.iframe&&l.iframeOrigin){var c=o.clientId+" "+(o.sessionId?o.sessionId:"");l.callbackList.push(a);var g=l.iframeOrigin;l.callbackList.length==1&&l.iframe.contentWindow.postMessage(c,g)}else a.setSuccess();return a.promise}function Y(){var a=M();if(l.enable||o.silentCheckSsoRedirectUri){var c=document.createElement("iframe");c.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),c.setAttribute("sandbox","allow-scripts allow-same-origin"),c.setAttribute("title","keycloak-3p-check-iframe"),c.style.display="none",document.body.appendChild(c);var g=function(w){c.contentWindow===w.source&&(w.data!=="supported"&&w.data!=="unsupported"||(w.data==="unsupported"&&(U(`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
8
|
+
*/(function(l){(function(){var o="input is invalid type",h=typeof window=="object",k=h?window:{};k.JS_SHA256_NO_WINDOW&&(h=!1);var U=!h&&typeof self=="object",x=!k.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;x?k=ke:U&&(k=self);var I=!k.JS_SHA256_NO_COMMON_JS&&!0&&l.exports,O=!k.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",p="0123456789abcdef".split(""),K=[-2147483648,8388608,32768,128],z=[24,16,8,0],X=[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],ae=["hex","array","digest","arrayBuffer"],j=[];(k.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(d){return Object.prototype.toString.call(d)==="[object Array]"}),O&&(k.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(d){return typeof d=="object"&&d.buffer&&d.buffer.constructor===ArrayBuffer});var Ce=function(d,C){return function(L){return new J(C,!0).update(L)[d]()}},ge=function(d){var C=Ce("hex",d);x&&(C=ce(C,d)),C.create=function(){return new J(d)},C.update=function(E){return C.create().update(E)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Ce(A,d)}return C},ce=function(d,C){var L=yt,A=yt.Buffer,E=C?"sha224":"sha256",v;A.from&&!k.JS_SHA256_NO_BUFFER_FROM?v=A.from:v=function(g){return new A(g)};var i=function(g){if(typeof g=="string")return L.createHash(E).update(g,"utf8").digest("hex");if(g==null)throw new Error(o);return g.constructor===ArrayBuffer&&(g=new Uint8Array(g)),Array.isArray(g)||ArrayBuffer.isView(g)||g.constructor===A?L.createHash(E).update(v(g)).digest("hex"):d(g)};return i},Te=function(d,C){return function(L,A){return new we(L,C,!0).update(A)[d]()}},fe=function(d){var C=Te("hex",d);C.create=function(E){return new we(E,d)},C.update=function(E,v){return C.create(E).update(v)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Te(A,d)}return C};function J(d,C){C?(j[0]=j[16]=j[1]=j[2]=j[3]=j[4]=j[5]=j[6]=j[7]=j[8]=j[9]=j[10]=j[11]=j[12]=j[13]=j[14]=j[15]=0,this.blocks=j):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d?(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=d}J.prototype.update=function(d){if(!this.finalized){var C,L=typeof d;if(L!=="string"){if(L==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);C=!0}for(var A,E=0,v,i=d.length,g=this.blocks;E<i;){if(this.hashed&&(this.hashed=!1,g[0]=this.block,g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0),C)for(v=this.start;E<i&&v<64;++E)g[v>>2]|=d[E]<<z[v++&3];else for(v=this.start;E<i&&v<64;++E)A=d.charCodeAt(E),A<128?g[v>>2]|=A<<z[v++&3]:A<2048?(g[v>>2]|=(192|A>>6)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]):A<55296||A>=57344?(g[v>>2]|=(224|A>>12)<<z[v++&3],g[v>>2]|=(128|A>>6&63)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]):(A=65536+((A&1023)<<10|d.charCodeAt(++E)&1023),g[v>>2]|=(240|A>>18)<<z[v++&3],g[v>>2]|=(128|A>>12&63)<<z[v++&3],g[v>>2]|=(128|A>>6&63)<<z[v++&3],g[v>>2]|=(128|A&63)<<z[v++&3]);this.lastByteIndex=v,this.bytes+=v-this.start,v>=64?(this.block=g[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}},J.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var d=this.blocks,C=this.lastByteIndex;d[16]=this.block,d[C>>2]|=K[C&3],this.block=d[16],C>=56&&(this.hashed||this.hash(),d[0]=this.block,d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0),d[14]=this.hBytes<<3|this.bytes>>>29,d[15]=this.bytes<<3,this.hash()}},J.prototype.hash=function(){var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=this.blocks,$,q,F,G,N,te,s,a,m,b,u;for($=16;$<64;++$)N=T[$-15],q=(N>>>7|N<<25)^(N>>>18|N<<14)^N>>>3,N=T[$-2],F=(N>>>17|N<<15)^(N>>>19|N<<13)^N>>>10,T[$]=T[$-16]+q+T[$-7]+F<<0;for(u=C&L,$=0;$<64;$+=4)this.first?(this.is224?(a=300032,N=T[0]-1413257819,g=N-150054599<<0,A=N+24177077<<0):(a=704751109,N=T[0]-210244248,g=N-1521486534<<0,A=N+143694565<<0),this.first=!1):(q=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),F=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),a=d&C,G=a^d&L^u,s=E&v^~E&i,N=g+F+s+X[$]+T[$],te=q+G,g=A+N<<0,A=N+te<<0),q=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),F=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),m=A&d,G=m^A&C^a,s=g&E^~g&v,N=i+F+s+X[$+1]+T[$+1],te=q+G,i=L+N<<0,L=N+te<<0,q=(L>>>2|L<<30)^(L>>>13|L<<19)^(L>>>22|L<<10),F=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),b=L&A,G=b^L&d^m,s=i&g^~i&E,N=v+F+s+X[$+2]+T[$+2],te=q+G,v=C+N<<0,C=N+te<<0,q=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),F=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),u=C&L,G=u^C&A^b,s=v&i^~v&g,N=E+F+s+X[$+3]+T[$+3],te=q+G,E=d+N<<0,d=N+te<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+d<<0,this.h1=this.h1+C<<0,this.h2=this.h2+L<<0,this.h3=this.h3+A<<0,this.h4=this.h4+E<<0,this.h5=this.h5+v<<0,this.h6=this.h6+i<<0,this.h7=this.h7+g<<0},J.prototype.hex=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=p[d>>28&15]+p[d>>24&15]+p[d>>20&15]+p[d>>16&15]+p[d>>12&15]+p[d>>8&15]+p[d>>4&15]+p[d&15]+p[C>>28&15]+p[C>>24&15]+p[C>>20&15]+p[C>>16&15]+p[C>>12&15]+p[C>>8&15]+p[C>>4&15]+p[C&15]+p[L>>28&15]+p[L>>24&15]+p[L>>20&15]+p[L>>16&15]+p[L>>12&15]+p[L>>8&15]+p[L>>4&15]+p[L&15]+p[A>>28&15]+p[A>>24&15]+p[A>>20&15]+p[A>>16&15]+p[A>>12&15]+p[A>>8&15]+p[A>>4&15]+p[A&15]+p[E>>28&15]+p[E>>24&15]+p[E>>20&15]+p[E>>16&15]+p[E>>12&15]+p[E>>8&15]+p[E>>4&15]+p[E&15]+p[v>>28&15]+p[v>>24&15]+p[v>>20&15]+p[v>>16&15]+p[v>>12&15]+p[v>>8&15]+p[v>>4&15]+p[v&15]+p[i>>28&15]+p[i>>24&15]+p[i>>20&15]+p[i>>16&15]+p[i>>12&15]+p[i>>8&15]+p[i>>4&15]+p[i&15];return this.is224||(T+=p[g>>28&15]+p[g>>24&15]+p[g>>20&15]+p[g>>16&15]+p[g>>12&15]+p[g>>8&15]+p[g>>4&15]+p[g&15]),T},J.prototype.toString=J.prototype.hex,J.prototype.digest=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,v=this.h5,i=this.h6,g=this.h7,T=[d>>24&255,d>>16&255,d>>8&255,d&255,C>>24&255,C>>16&255,C>>8&255,C&255,L>>24&255,L>>16&255,L>>8&255,L&255,A>>24&255,A>>16&255,A>>8&255,A&255,E>>24&255,E>>16&255,E>>8&255,E&255,v>>24&255,v>>16&255,v>>8&255,v&255,i>>24&255,i>>16&255,i>>8&255,i&255];return this.is224||T.push(g>>24&255,g>>16&255,g>>8&255,g&255),T},J.prototype.array=J.prototype.digest,J.prototype.arrayBuffer=function(){this.finalize();var d=new ArrayBuffer(this.is224?28:32),C=new DataView(d);return C.setUint32(0,this.h0),C.setUint32(4,this.h1),C.setUint32(8,this.h2),C.setUint32(12,this.h3),C.setUint32(16,this.h4),C.setUint32(20,this.h5),C.setUint32(24,this.h6),this.is224||C.setUint32(28,this.h7),d};function we(d,C,L){var A,E=typeof d;if(E==="string"){var v=[],i=d.length,g=0,T;for(A=0;A<i;++A)T=d.charCodeAt(A),T<128?v[g++]=T:T<2048?(v[g++]=192|T>>6,v[g++]=128|T&63):T<55296||T>=57344?(v[g++]=224|T>>12,v[g++]=128|T>>6&63,v[g++]=128|T&63):(T=65536+((T&1023)<<10|d.charCodeAt(++A)&1023),v[g++]=240|T>>18,v[g++]=128|T>>12&63,v[g++]=128|T>>6&63,v[g++]=128|T&63);d=v}else if(E==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);d.length>64&&(d=new J(C,!0).update(d).array());var $=[],q=[];for(A=0;A<64;++A){var F=d[A]||0;$[A]=92^F,q[A]=54^F}J.call(this,C,L),this.update(q),this.oKeyPad=$,this.inner=!0,this.sharedMemory=L}we.prototype=new J,we.prototype.finalize=function(){if(J.prototype.finalize.call(this),this.inner){this.inner=!1;var d=this.array();J.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(d),J.prototype.finalize.call(this)}};var Z=ge();Z.sha256=Z,Z.sha224=ge(!0),Z.sha256.hmac=fe(),Z.sha224.hmac=fe(!0),I?l.exports=Z:(k.sha256=Z.sha256,k.sha224=Z.sha224)})()})(wt);var xn=wt.exports;const Cn=gt(xn);class Ve extends Error{}Ve.prototype.name="InvalidTokenError";function An(l){return decodeURIComponent(atob(l).replace(/(.)/g,(o,h)=>{let k=h.charCodeAt(0).toString(16).toUpperCase();return k.length<2&&(k="0"+k),"%"+k}))}function Sn(l){let o=l.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return An(o)}catch{return atob(o)}}function et(l,o){if(typeof l!="string")throw new Ve("Invalid token specified: must be a string");o||(o={});const h=o.header===!0?0:1,k=l.split(".")[h];if(typeof k!="string")throw new Ve(`Invalid token specified: missing part #${h+1}`);let U;try{U=Sn(k)}catch(x){throw new Ve(`Invalid token specified: invalid base64 for part #${h+1} (${x.message})`)}try{return JSON.parse(U)}catch(x){throw new Ve(`Invalid token specified: invalid json for part #${h+1} (${x.message})`)}}if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function vt(l){if(!(this instanceof vt))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var o=this,h,k=[],U,x={enable:!0,callbackList:[],interval:5},I=document.getElementsByTagName("script"),O=0;O<I.length;O++)(I[O].src.indexOf("keycloak.js")!==-1||I[O].src.indexOf("keycloak.min.js")!==-1)&&I[O].src.indexOf("version=")!==-1&&(o.iframeVersion=I[O].src.substring(I[O].src.indexOf("version=")+8).split("&")[0]);var p=!0,K=te(console.info),z=te(console.warn);o.init=function(s){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");o.didInitialize=!0,o.authenticated=!1,U=N();var a=["default","cordova","cordova-native"];if(s&&a.indexOf(s.adapter)>-1?h=q(s.adapter):s&&typeof s.adapter=="object"?h=s.adapter:window.Cordova||window.cordova?h=q("cordova"):h=q(),s){if(typeof s.useNonce<"u"&&(p=s.useNonce),typeof s.checkLoginIframe<"u"&&(x.enable=s.checkLoginIframe),s.checkLoginIframeInterval&&(x.interval=s.checkLoginIframeInterval),s.onLoad==="login-required"&&(o.loginRequired=!0),s.responseMode)if(s.responseMode==="query"||s.responseMode==="fragment")o.responseMode=s.responseMode;else throw"Invalid value for responseMode";if(s.flow){switch(s.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=s.flow}if(s.timeSkew!=null&&(o.timeSkew=s.timeSkew),s.redirectUri&&(o.redirectUri=s.redirectUri),s.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=s.silentCheckSsoRedirectUri),typeof s.silentCheckSsoFallback=="boolean"?o.silentCheckSsoFallback=s.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,s.pkceMethod){if(s.pkceMethod!=="S256")throw"Invalid value for pkceMethod";o.pkceMethod=s.pkceMethod}typeof s.enableLogging=="boolean"?o.enableLogging=s.enableLogging:o.enableLogging=!1,typeof s.scope=="string"&&(o.scope=s.scope),typeof s.acrValues=="string"&&(o.acrValues=s.acrValues),typeof s.messageReceiveTimeout=="number"&&s.messageReceiveTimeout>0?o.messageReceiveTimeout=s.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var m=E(),b=E();b.promise.then(function(){o.onReady&&o.onReady(o.authenticated),m.setSuccess(o.authenticated)}).catch(function(_){m.setError(_)});var u=J();function S(){var _=function(H){H||(M.prompt="none"),s&&s.locale&&(M.locale=s.locale),o.login(M).then(function(){b.setSuccess()}).catch(function(he){b.setError(he)})},P=function(){var H=document.createElement("iframe"),he=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});H.setAttribute("src",he),H.setAttribute("sandbox","allow-scripts allow-same-origin"),H.setAttribute("title","keycloak-silent-check-sso"),H.style.display="none",document.body.appendChild(H);var pe=function(ne){if(!(ne.origin!==window.location.origin||H.contentWindow!==ne.source)){var ye=C(ne.data);fe(ye,b),document.body.removeChild(H),window.removeEventListener("message",pe)}};window.addEventListener("message",pe)},M={};switch(s.onLoad){case"check-sso":x.enable?i().then(function(){T().then(function(H){H?b.setSuccess():o.silentCheckSsoRedirectUri?P():_(!1)}).catch(function(H){b.setError(H)})}):o.silentCheckSsoRedirectUri?P():_(!1);break;case"login-required":_(!0);break;default:throw"Invalid value for onLoad"}}function w(){var _=C(window.location.href);if(_&&window.history.replaceState(window.history.state,null,_.newUrl),_&&_.valid)return i().then(function(){fe(_,b)}).catch(function(P){b.setError(P)});s?s.token&&s.refreshToken?(Z(s.token,s.refreshToken,s.idToken),x.enable?i().then(function(){T().then(function(P){P?(o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess(),g()):b.setSuccess()}).catch(function(P){b.setError(P)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess()}).catch(function(P){o.onAuthError&&o.onAuthError(),s.onLoad?S():b.setError(P)})):s.onLoad?S():b.setSuccess():b.setSuccess()}function y(){var _=E(),P=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",P),_.setSuccess())};return document.addEventListener("readystatechange",P),P(),_.promise}return u.then(function(){y().then($).then(w).catch(function(_){m.setError(_)})}),u.catch(function(_){m.setError(_)}),m.promise},o.login=function(s){return h.login(s)};function X(s){var a=null,m=window.crypto||window.msCrypto;if(m&&m.getRandomValues&&window.Uint8Array)return a=new Uint8Array(s),m.getRandomValues(a),a;a=new Array(s);for(var b=0;b<a.length;b++)a[b]=Math.floor(256*Math.random());return a}function ae(s){return j(s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function j(s,a){for(var m=X(s),b=new Array(s),u=0;u<s;u++)b[u]=a.charCodeAt(m[u]%a.length);return String.fromCharCode.apply(null,b)}function Ce(s,a){switch(s){case"S256":var m=new Uint8Array(Cn.arrayBuffer(a)),b=qe.fromByteArray(m).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function ge(s){var a={id_token:{acr:s}};return JSON.stringify(a)}o.createLoginUrl=function(s){var a=d(),m=d(),b=h.redirectUri(s),u={state:a,nonce:m,redirectUri:encodeURIComponent(b)};s&&s.prompt&&(u.prompt=s.prompt);var S;s&&s.action=="register"?S=o.endpoints.register():S=o.endpoints.authorize();var w=s&&s.scope||o.scope;w?w.indexOf("openid")===-1&&(w="openid "+w):w="openid";var y=S+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(b)+"&state="+encodeURIComponent(a)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(w);if(p&&(y=y+"&nonce="+encodeURIComponent(m)),s&&s.prompt&&(y+="&prompt="+encodeURIComponent(s.prompt)),s&&s.maxAge&&(y+="&max_age="+encodeURIComponent(s.maxAge)),s&&s.loginHint&&(y+="&login_hint="+encodeURIComponent(s.loginHint)),s&&s.idpHint&&(y+="&kc_idp_hint="+encodeURIComponent(s.idpHint)),s&&s.action&&s.action!="register"&&(y+="&kc_action="+encodeURIComponent(s.action)),s&&s.locale&&(y+="&ui_locales="+encodeURIComponent(s.locale)),s&&s.acr){var _=ge(s.acr);y+="&claims="+encodeURIComponent(_)}if((s&&s.acrValues||o.acrValues)&&(y+="&acr_values="+encodeURIComponent(s.acrValues||o.acrValues)),o.pkceMethod){var P=ae(96);u.pkceCodeVerifier=P;var M=Ce(o.pkceMethod,P);y+="&code_challenge="+M,y+="&code_challenge_method="+o.pkceMethod}return U.add(u),y},o.logout=function(s){return h.logout(s)},o.createLogoutUrl=function(s){var a=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(h.redirectUri(s,!1));return o.idToken&&(a+="&id_token_hint="+encodeURIComponent(o.idToken)),a},o.register=function(s){return h.register(s)},o.createRegisterUrl=function(s){return s||(s={}),s.action="register",o.createLoginUrl(s)},o.createAccountUrl=function(s){var a=ce(),m=void 0;return typeof a<"u"&&(m=a+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(h.redirectUri(s))),m},o.accountManagement=function(){return h.accountManagement()},o.hasRealmRole=function(s){var a=o.realmAccess;return!!a&&a.roles.indexOf(s)>=0},o.hasResourceRole=function(s,a){if(!o.resourceAccess)return!1;var m=o.resourceAccess[a||o.clientId];return!!m&&m.roles.indexOf(s)>=0},o.loadUserProfile=function(){var s=ce()+"/account",a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.profile=JSON.parse(a.responseText),m.setSuccess(o.profile)):m.setError())},a.send(),m.promise},o.loadUserInfo=function(){var s=o.endpoints.userinfo(),a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.userInfo=JSON.parse(a.responseText),m.setSuccess(o.userInfo)):m.setError())},a.send(),m.promise},o.isTokenExpired=function(s){if(!o.tokenParsed||!o.refreshToken&&o.flow!="implicit")throw"Not authenticated";if(o.timeSkew==null)return K("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var a=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(s){if(isNaN(s))throw"Invalid minValidity";a-=s}return a<0},o.updateToken=function(s){var a=E();if(!o.refreshToken)return a.setError(),a.promise;s=s||5;var m=function(){var u=!1;if(s==-1?(u=!0,K("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(s))&&(u=!0,K("[KEYCLOAK] Refreshing token: token expired")),!u)a.setSuccess(!1);else{var S="grant_type=refresh_token&refresh_token="+o.refreshToken,w=o.endpoints.token();if(k.push(a),k.length==1){var y=new XMLHttpRequest;y.open("POST",w,!0),y.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y.withCredentials=!0,S+="&client_id="+encodeURIComponent(o.clientId);var _=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){K("[KEYCLOAK] Token refreshed"),_=(_+new Date().getTime())/2;var P=JSON.parse(y.responseText);Z(P.access_token,P.refresh_token,P.id_token,_),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var M=k.pop();M!=null;M=k.pop())M.setSuccess(!0)}else{z("[KEYCLOAK] Failed to refresh token"),y.status==400&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var M=k.pop();M!=null;M=k.pop())M.setError(!0)}},y.send(S)}}};if(x.enable){var b=T();b.then(function(){m()}).catch(function(u){a.setError(u)})}else m();return a.promise},o.clearToken=function(){o.token&&(Z(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())},o.setToken=Z;function ce(){if(typeof o.authServerUrl<"u")return o.authServerUrl.charAt(o.authServerUrl.length-1)=="/"?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function Te(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function fe(s,a){var m=s.code,b=s.error,u=s.prompt,S=new Date().getTime();if(s.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(s.kc_action_status),b){if(u!="none"){var w={error:b,error_description:s.error_description};o.onAuthError&&o.onAuthError(w),a&&a.setError(w)}else a&&a.setSuccess();return}else o.flow!="standard"&&(s.access_token||s.id_token)&&M(s.access_token,null,s.id_token,!0);if(o.flow!="implicit"&&m){var y="code="+m+"&grant_type=authorization_code",_=o.endpoints.token(),P=new XMLHttpRequest;P.open("POST",_,!0),P.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y+="&client_id="+encodeURIComponent(o.clientId),y+="&redirect_uri="+s.redirectUri,s.pkceCodeVerifier&&(y+="&code_verifier="+s.pkceCodeVerifier),P.withCredentials=!0,P.onreadystatechange=function(){if(P.readyState==4)if(P.status==200){var H=JSON.parse(P.responseText);M(H.access_token,H.refresh_token,H.id_token,o.flow==="standard"),g()}else o.onAuthError&&o.onAuthError(),a&&a.setError()},P.send(y)}function M(H,he,pe,ne){S=(S+new Date().getTime())/2,Z(H,he,pe,S),p&&(o.tokenParsed&&o.tokenParsed.nonce!=s.storedNonce||o.refreshTokenParsed&&o.refreshTokenParsed.nonce!=s.storedNonce||o.idTokenParsed&&o.idTokenParsed.nonce!=s.storedNonce)?(K("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),a&&a.setError()):ne&&(o.onAuthSuccess&&o.onAuthSuccess(),a&&a.setSuccess())}}function J(s){var a=E(),m;l?typeof l=="string"&&(m=l):m="keycloak.json";function b(P){P?o.endpoints={authorize:function(){return P.authorization_endpoint},token:function(){return P.token_endpoint},logout:function(){if(!P.end_session_endpoint)throw"Not supported by the OIDC server";return P.end_session_endpoint},checkSessionIframe:function(){if(!P.check_session_iframe)throw"Not supported by the OIDC server";return P.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!P.userinfo_endpoint)throw"Not supported by the OIDC server";return P.userinfo_endpoint}}:o.endpoints={authorize:function(){return ce()+"/protocol/openid-connect/auth"},token:function(){return ce()+"/protocol/openid-connect/token"},logout:function(){return ce()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var M=ce()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},thirdPartyCookiesIframe:function(){var M=ce()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},register:function(){return ce()+"/protocol/openid-connect/registrations"},userinfo:function(){return ce()+"/protocol/openid-connect/userinfo"}}}if(m){var u=new XMLHttpRequest;u.open("GET",m,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var P=JSON.parse(u.responseText);o.authServerUrl=P["auth-server-url"],o.realm=P.realm,o.clientId=P.resource,b(null),a.setSuccess()}else a.setError()},u.send()}else{if(!l.clientId)throw"clientId missing";o.clientId=l.clientId;var S=l.oidcProvider;if(S)if(typeof S=="string"){var _;S.charAt(S.length-1)=="/"?_=S+".well-known/openid-configuration":_=S+"/.well-known/openid-configuration";var u=new XMLHttpRequest;u.open("GET",_,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var M=JSON.parse(u.responseText);b(M),a.setSuccess()}else a.setError()},u.send()}else b(S),a.setSuccess();else{if(!l.url){for(var w=document.getElementsByTagName("script"),y=0;y<w.length;y++)if(w[y].src.match(/.*keycloak\.js/)){l.url=w[y].src.substr(0,w[y].src.indexOf("/js/keycloak.js"));break}}if(!l.realm)throw"realm missing";o.authServerUrl=l.url,o.realm=l.realm,b(null),a.setSuccess()}}return a.promise}function we(s){return s.status==0&&s.responseText&&s.responseURL.startsWith("file:")}function Z(s,a,m,b){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),a?(o.refreshToken=a,o.refreshTokenParsed=et(a)):(delete o.refreshToken,delete o.refreshTokenParsed),m?(o.idToken=m,o.idTokenParsed=et(m)):(delete o.idToken,delete o.idTokenParsed),s){if(o.token=s,o.tokenParsed=et(s),o.sessionId=o.tokenParsed.session_state,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,b&&(o.timeSkew=Math.floor(b/1e3)-o.tokenParsed.iat),o.timeSkew!=null&&(K("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var u=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;K("[KEYCLOAK] Token expires in "+Math.round(u/1e3)+" s"),u<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,u)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function d(){var s="0123456789abcdef",a=j(36,s).split("");a[14]="4",a[19]=s.substr(a[19]&3|8,1),a[8]=a[13]=a[18]=a[23]="-";var m=a.join("");return m}function C(s){var a=L(s);if(a){var m=U.get(a.state);return m&&(a.valid=!0,a.redirectUri=m.redirectUri,a.storedNonce=m.nonce,a.prompt=m.prompt,a.pkceCodeVerifier=m.pkceCodeVerifier),a}}function L(s){var a;switch(o.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 m=s.indexOf("?"),b=s.indexOf("#"),u,S;if(o.responseMode==="query"&&m!==-1?(u=s.substring(0,m),S=A(s.substring(m+1,b!==-1?b:s.length),a),S.paramsString!==""&&(u+="?"+S.paramsString),b!==-1&&(u+=s.substring(b))):o.responseMode==="fragment"&&b!==-1&&(u=s.substring(0,b),S=A(s.substring(b+1),a),S.paramsString!==""&&(u+="#"+S.paramsString)),S&&S.oauthParams){if(o.flow==="standard"||o.flow==="hybrid"){if((S.oauthParams.code||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}else if(o.flow==="implicit"&&(S.oauthParams.access_token||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}}function A(s,a){for(var m=s.split("&"),b={paramsString:"",oauthParams:{}},u=0;u<m.length;u++){var S=m[u].indexOf("="),w=m[u].slice(0,S);a.indexOf(w)!==-1?b.oauthParams[w]=m[u].slice(S+1):(b.paramsString!==""&&(b.paramsString+="&"),b.paramsString+=m[u])}return b}function E(){var s={setSuccess:function(a){s.resolve(a)},setError:function(a){s.reject(a)}};return s.promise=new Promise(function(a,m){s.resolve=a,s.reject=m}),s}function v(s,a,m){var b=null,u=new Promise(function(S,w){b=setTimeout(function(){w({error:m||"Promise is not settled within timeout of "+a+"ms"})},a)});return Promise.race([s,u]).finally(function(){clearTimeout(b)})}function i(){var s=E();if(!x.enable||x.iframe)return s.setSuccess(),s.promise;var a=document.createElement("iframe");x.iframe=a,a.onload=function(){var u=o.endpoints.authorize();u.charAt(0)==="/"?x.iframeOrigin=Te():x.iframeOrigin=u.substring(0,u.indexOf("/",8)),s.setSuccess()};var m=o.endpoints.checkSessionIframe();a.setAttribute("src",m),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(u){if(!(u.origin!==x.iframeOrigin||x.iframe.contentWindow!==u.source)&&(u.data=="unchanged"||u.data=="changed"||u.data=="error")){u.data!="unchanged"&&o.clearToken();for(var S=x.callbackList.splice(0,x.callbackList.length),w=S.length-1;w>=0;--w){var y=S[w];u.data=="error"?y.setError():y.setSuccess(u.data=="unchanged")}}};return window.addEventListener("message",b,!1),s.promise}function g(){x.enable&&o.token&&setTimeout(function(){T().then(function(s){s&&g()})},x.interval*1e3)}function T(){var s=E();if(x.iframe&&x.iframeOrigin){var a=o.clientId+" "+(o.sessionId?o.sessionId:"");x.callbackList.push(s);var m=x.iframeOrigin;x.callbackList.length==1&&x.iframe.contentWindow.postMessage(a,m)}else s.setSuccess();return s.promise}function $(){var s=E();if(x.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.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 m=function(b){a.contentWindow===b.source&&(b.data!=="supported"&&b.data!=="unsupported"||(b.data==="unsupported"&&(z(`[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`),
|
|
13
|
+
For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`),x.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",m),s.setSuccess()))};window.addEventListener("message",m,!1)}else s.setSuccess();return v(s.promise,o.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function q(s){if(!s||s=="default")return{login:function(w){return window.location.assign(o.createLoginUrl(w)),E().promise},logout:function(w){return window.location.replace(o.createLogoutUrl(w)),E().promise},register:function(w){return window.location.assign(o.createRegisterUrl(w)),E().promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u")window.location.href=w;else throw"Not supported by the OIDC server";return E().promise},redirectUri:function(w,y){return w&&w.redirectUri?w.redirectUri:o.redirectUri?o.redirectUri:location.href}};if(s=="cordova"){x.enable=!1;var a=function(w,y,_){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(w,y,_):window.open(w,y,_)},m=function(w){return w&&w.cordovaOptions?Object.keys(w.cordovaOptions).reduce(function(y,_){return y[_]=w.cordovaOptions[_],y},{}):{}},b=function(w){return Object.keys(w).reduce(function(y,_){return y.push(_+"="+w[_]),y},[]).join(",")},u=function(w){var y=m(w);return y.location="no",w&&w.prompt=="none"&&(y.hidden="yes"),b(y)},S=function(){return o.redirectUri||"http://localhost"};return{login:function(w){var y=E(),_=u(w),P=o.createLoginUrl(w),M=a(P,"_blank",_),H=!1,he=!1,pe=function(){he=!0,M.close()};return M.addEventListener("loadstart",function(ne){if(ne.url.indexOf(S())==0){var ye=C(ne.url);fe(ye,y),pe(),H=!0}}),M.addEventListener("loaderror",function(ne){if(!H)if(ne.url.indexOf(S())==0){var ye=C(ne.url);fe(ye,y),pe(),H=!0}else y.setError(),pe()}),M.addEventListener("exit",function(ne){he||y.setError({reason:"closed_by_user"})}),y.promise},logout:function(w){var y=E(),_=o.createLogoutUrl(w),P=a(_,"_blank","location=no,hidden=yes,clearcache=yes"),M;return P.addEventListener("loadstart",function(H){H.url.indexOf(S())==0&&P.close()}),P.addEventListener("loaderror",function(H){H.url.indexOf(S())==0||(M=!0),P.close()}),P.addEventListener("exit",function(H){M?y.setError():(o.clearToken(),y.setSuccess())}),y.promise},register:function(w){var y=E(),_=o.createRegisterUrl(),P=u(w),M=a(_,"_blank",P);return M.addEventListener("loadstart",function(H){if(H.url.indexOf(S())==0){M.close();var he=C(H.url);fe(he,y)}}),y.promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u"){var y=a(w,"_blank","location=no");y.addEventListener("loadstart",function(_){_.url.indexOf(S())==0&&y.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(w){return S()}}}if(s=="cordova-native")return x.enable=!1,{login:function(w){var y=E(),_=o.createLoginUrl(w);return universalLinks.subscribe("keycloak",function(P){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var M=C(P.url);fe(M,y)}),window.cordova.plugins.browsertab.openUrl(_),y.promise},logout:function(w){var y=E(),_=o.createLogoutUrl(w);return universalLinks.subscribe("keycloak",function(P){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),y.setSuccess()}),window.cordova.plugins.browsertab.openUrl(_),y.promise},register:function(w){var y=E(),_=o.createRegisterUrl(w);return universalLinks.subscribe("keycloak",function(P){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var M=C(P.url);fe(M,y)}),window.cordova.plugins.browsertab.openUrl(_),y.promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u")window.cordova.plugins.browsertab.openUrl(w);else throw"Not supported by the OIDC server"},redirectUri:function(w){return w&&w.redirectUri?w.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+s}var F=function(){if(!(this instanceof F))return new F;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var s=this;function a(){for(var m=new Date().getTime(),b=0;b<localStorage.length;b++){var u=localStorage.key(b);if(u&&u.indexOf("kc-callback-")==0){var S=localStorage.getItem(u);if(S)try{var w=JSON.parse(S).expires;(!w||w<m)&&localStorage.removeItem(u)}catch{localStorage.removeItem(u)}}}}s.get=function(m){if(m){var b="kc-callback-"+m,u=localStorage.getItem(b);return u&&(localStorage.removeItem(b),u=JSON.parse(u)),a(),u}},s.add=function(m){a();var b="kc-callback-"+m.state;m.expires=new Date().getTime()+60*60*1e3,localStorage.setItem(b,JSON.stringify(m))}},G=function(){if(!(this instanceof G))return new G;var s=this;s.get=function(u){if(u){var S=m("kc-callback-"+u);if(b("kc-callback-"+u,"",a(-100)),S)return JSON.parse(S)}},s.add=function(u){b("kc-callback-"+u.state,JSON.stringify(u),a(60))},s.removeItem=function(u){b(u,"",a(-100))};var a=function(u){var S=new Date;return S.setTime(S.getTime()+u*60*1e3),S},m=function(u){for(var S=u+"=",w=document.cookie.split(";"),y=0;y<w.length;y++){for(var _=w[y];_.charAt(0)==" ";)_=_.substring(1);if(_.indexOf(S)==0)return _.substring(S.length,_.length)}return""},b=function(u,S,w){var y=u+"="+S+"; expires="+w.toUTCString()+"; ";document.cookie=y}};function N(){try{return new F}catch{}return new G}function te(s){return function(){o.enableLogging&&s.apply(console,Array.prototype.slice.call(arguments))}}}const ze=new vt,En=(l,o)=>{ze.init({onLoad:"login-required"}).then(async h=>{h&&await _n(),l()}).catch(h=>{o(h)})},_n=async()=>{const l=await ze.loadUserInfo();ee.User.email=l.email??"",ee.User.emailVerified=l.email_verified===!0,ee.User.firstName=l.given_name??"",ee.User.lastName=l.family_name??"",ee.User.name=l.name??"",ee.User.sub=l.sub??"",ee.User.username=l.preferred_username??"",ee.User.roles=[...l.role??[]],ee.User.groups=[...l.group??[]],ee.User.IsInRole=o=>ee.User.roles.includes(o)},ee={Instance:ze,User:{},CallLogin:En,CallLogout:()=>{ze.logout({redirectUri:location.origin}).then(()=>{sessionStorage.removeItem("user-info")})}};var kt={exports:{}};/*!
|
|
14
14
|
* sweetalert2 v11.4.8
|
|
15
15
|
* Released under the MIT License.
|
|
16
|
-
*/(function(
|
|
16
|
+
*/(function(l,o){(function(h,k){l.exports=k()})(ke,function(){const h="SweetAlert2:",k=e=>{const t=[];for(let n=0;n<e.length;n++)t.indexOf(e[n])===-1&&t.push(e[n]);return t},U=e=>e.charAt(0).toUpperCase()+e.slice(1),x=e=>Array.prototype.slice.call(e),I=e=>{console.warn("".concat(h," ").concat(typeof e=="object"?e.join(" "):e))},O=e=>{console.error("".concat(h," ").concat(e))},p=[],K=e=>{p.includes(e)||(p.push(e),I(e))},z=(e,t)=>{K('"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'))},X=e=>typeof e=="function"?e():e,ae=e=>e&&typeof e.toPromise=="function",j=e=>ae(e)?e.toPromise():Promise.resolve(e),Ce=e=>e&&Promise.resolve(e)===e,ge={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},ce=["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"],Te={},fe=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],J=e=>Object.prototype.hasOwnProperty.call(ge,e),we=e=>ce.indexOf(e)!==-1,Z=e=>Te[e],d=e=>{J(e)||I('Unknown parameter "'.concat(e,'"'))},C=e=>{fe.includes(e)&&I('The parameter "'.concat(e,'" is incompatible with toasts'))},L=e=>{Z(e)&&z(e,Z(e))},A=e=>{!e.backdrop&&e.allowOutsideClick&&I('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)d(t),e.toast&&C(t),L(t)},E="swal2-",v=e=>{const t={};for(const n in e)t[e[n]]=E+e[n];return t},i=v(["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"]),g=v(["success","warning","info","question","error"]),T=()=>document.body.querySelector(".".concat(i.container)),$=e=>{const t=T();return t?t.querySelector(e):null},q=e=>$(".".concat(e)),F=()=>q(i.popup),G=()=>q(i.icon),N=()=>q(i.title),te=()=>q(i["html-container"]),s=()=>q(i.image),a=()=>q(i["progress-steps"]),m=()=>q(i["validation-message"]),b=()=>$(".".concat(i.actions," .").concat(i.confirm)),u=()=>$(".".concat(i.actions," .").concat(i.deny)),S=()=>q(i["input-label"]),w=()=>$(".".concat(i.loader)),y=()=>$(".".concat(i.actions," .").concat(i.cancel)),_=()=>q(i.actions),P=()=>q(i.footer),M=()=>q(i["timer-progress-bar"]),H=()=>q(i.close),he=`
|
|
17
17
|
a[href],
|
|
18
18
|
area[href],
|
|
19
19
|
input:not([disabled]),
|
|
@@ -28,53 +28,53 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
|
|
|
28
28
|
audio[controls],
|
|
29
29
|
video[controls],
|
|
30
30
|
summary
|
|
31
|
-
`,
|
|
32
|
-
<div aria-labelledby="`.concat(
|
|
33
|
-
<button type="button" class="`).concat(
|
|
34
|
-
<ul class="`).concat(
|
|
35
|
-
<div class="`).concat(
|
|
36
|
-
<img class="`).concat(
|
|
37
|
-
<h2 class="`).concat(
|
|
38
|
-
<div class="`).concat(
|
|
39
|
-
<input class="`).concat(
|
|
40
|
-
<input type="file" class="`).concat(
|
|
41
|
-
<div class="`).concat(
|
|
31
|
+
`,pe=()=>{const e=x(F().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((n,r)=>{const f=parseInt(n.getAttribute("tabindex")),B=parseInt(r.getAttribute("tabindex"));return f>B?1:f<B?-1:0}),t=x(F().querySelectorAll(he)).filter(n=>n.getAttribute("tabindex")!=="-1");return k(e.concat(t)).filter(n=>le(n))},ne=()=>xe(document.body,i.shown)&&!xe(document.body,i["toast-shown"])&&!xe(document.body,i["no-backdrop"]),ye=()=>F()&&xe(F(),i.toast),co=()=>F().hasAttribute("data-loading"),Ie={previousBodyPadding:null},oe=(e,t)=>{if(e.textContent="",t){const r=new DOMParser().parseFromString(t,"text/html");x(r.querySelector("head").childNodes).forEach(f=>{e.appendChild(f)}),x(r.querySelector("body").childNodes).forEach(f=>{e.appendChild(f)})}},xe=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let r=0;r<n.length;r++)if(!e.classList.contains(n[r]))return!1;return!0},lo=(e,t)=>{x(e.classList).forEach(n=>{!Object.values(i).includes(n)&&!Object.values(g).includes(n)&&!Object.values(t.showClass).includes(n)&&e.classList.remove(n)})},me=(e,t,n)=>{if(lo(e,t),t.customClass&&t.customClass[n]){if(typeof t.customClass[n]!="string"&&!t.customClass[n].forEach)return I("Invalid type of customClass.".concat(n,'! Expected string or iterable object, got "').concat(typeof t.customClass[n],'"'));D(e,t.customClass[n])}},nt=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(i.popup," > .").concat(i[t]));case"checkbox":return e.querySelector(".".concat(i.popup," > .").concat(i.checkbox," input"));case"radio":return e.querySelector(".".concat(i.popup," > .").concat(i.radio," input:checked"))||e.querySelector(".".concat(i.popup," > .").concat(i.radio," input:first-child"));case"range":return e.querySelector(".".concat(i.popup," > .").concat(i.range," input"));default:return e.querySelector(".".concat(i.popup," > .").concat(i.input))}},At=e=>{if(e.focus(),e.type!=="file"){const t=e.value;e.value="",e.value=t}},St=(e,t,n)=>{!e||!t||(typeof t=="string"&&(t=t.split(/\s+/).filter(Boolean)),t.forEach(r=>{Array.isArray(e)?e.forEach(f=>{n?f.classList.add(r):f.classList.remove(r)}):n?e.classList.add(r):e.classList.remove(r)}))},D=(e,t)=>{St(e,t,!0)},ve=(e,t)=>{St(e,t,!1)},Ae=(e,t)=>{const n=x(e.childNodes);for(let r=0;r<n.length;r++)if(xe(n[r],t))return n[r]},Re=(e,t,n)=>{n==="".concat(parseInt(n))&&(n=parseInt(n)),n||parseInt(n)===0?e.style[t]=typeof n=="number"?"".concat(n,"px"):n:e.style.removeProperty(t)},Q=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"flex";e.style.display=t},re=e=>{e.style.display="none"},Et=(e,t,n,r)=>{const f=e.querySelector(t);f&&(f.style[n]=r)},We=(e,t,n)=>{t?Q(e,n):re(e)},le=e=>!!(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),uo=()=>!le(b())&&!le(u())&&!le(y()),_t=e=>e.scrollHeight>e.clientHeight,Pt=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),r=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||r>0},ot=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const n=M();le(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"},10))},fo=()=>{const e=M(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=parseInt(window.getComputedStyle(e).width),r=t/n*100;e.style.removeProperty("transition"),e.style.width="".concat(r,"%")},Bt=()=>typeof window>"u"||typeof document>"u",ho=100,V={},po=()=>{V.previousActiveElement&&V.previousActiveElement.focus?(V.previousActiveElement.focus(),V.previousActiveElement=null):document.body&&document.body.focus()},mo=e=>new Promise(t=>{if(!e)return t();const n=window.scrollX,r=window.scrollY;V.restoreFocusTimeout=setTimeout(()=>{po(),t()},ho),window.scrollTo(n,r)}),go=`
|
|
32
|
+
<div aria-labelledby="`.concat(i.title,'" aria-describedby="').concat(i["html-container"],'" class="').concat(i.popup,`" tabindex="-1">
|
|
33
|
+
<button type="button" class="`).concat(i.close,`"></button>
|
|
34
|
+
<ul class="`).concat(i["progress-steps"],`"></ul>
|
|
35
|
+
<div class="`).concat(i.icon,`"></div>
|
|
36
|
+
<img class="`).concat(i.image,`" />
|
|
37
|
+
<h2 class="`).concat(i.title,'" id="').concat(i.title,`"></h2>
|
|
38
|
+
<div class="`).concat(i["html-container"],'" id="').concat(i["html-container"],`"></div>
|
|
39
|
+
<input class="`).concat(i.input,`" />
|
|
40
|
+
<input type="file" class="`).concat(i.file,`" />
|
|
41
|
+
<div class="`).concat(i.range,`">
|
|
42
42
|
<input type="range" />
|
|
43
43
|
<output></output>
|
|
44
44
|
</div>
|
|
45
|
-
<select class="`).concat(
|
|
46
|
-
<div class="`).concat(
|
|
47
|
-
<label for="`).concat(
|
|
45
|
+
<select class="`).concat(i.select,`"></select>
|
|
46
|
+
<div class="`).concat(i.radio,`"></div>
|
|
47
|
+
<label for="`).concat(i.checkbox,'" class="').concat(i.checkbox,`">
|
|
48
48
|
<input type="checkbox" />
|
|
49
|
-
<span class="`).concat(
|
|
49
|
+
<span class="`).concat(i.label,`"></span>
|
|
50
50
|
</label>
|
|
51
|
-
<textarea class="`).concat(
|
|
52
|
-
<div class="`).concat(
|
|
53
|
-
<div class="`).concat(
|
|
54
|
-
<div class="`).concat(
|
|
55
|
-
<button type="button" class="`).concat(
|
|
56
|
-
<button type="button" class="`).concat(
|
|
57
|
-
<button type="button" class="`).concat(
|
|
51
|
+
<textarea class="`).concat(i.textarea,`"></textarea>
|
|
52
|
+
<div class="`).concat(i["validation-message"],'" id="').concat(i["validation-message"],`"></div>
|
|
53
|
+
<div class="`).concat(i.actions,`">
|
|
54
|
+
<div class="`).concat(i.loader,`"></div>
|
|
55
|
+
<button type="button" class="`).concat(i.confirm,`"></button>
|
|
56
|
+
<button type="button" class="`).concat(i.deny,`"></button>
|
|
57
|
+
<button type="button" class="`).concat(i.cancel,`"></button>
|
|
58
58
|
</div>
|
|
59
|
-
<div class="`).concat(
|
|
60
|
-
<div class="`).concat(
|
|
61
|
-
<div class="`).concat(
|
|
59
|
+
<div class="`).concat(i.footer,`"></div>
|
|
60
|
+
<div class="`).concat(i["timer-progress-bar-container"],`">
|
|
61
|
+
<div class="`).concat(i["timer-progress-bar"],`"></div>
|
|
62
62
|
</div>
|
|
63
63
|
</div>
|
|
64
|
-
`).replace(/(^|\n)\s*/g,""),
|
|
64
|
+
`).replace(/(^|\n)\s*/g,""),bo=()=>{const e=T();return e?(e.remove(),ve([document.documentElement,document.body],[i["no-backdrop"],i["toast-shown"],i["has-column"]]),!0):!1},Ee=()=>{V.currentInstance.resetValidationMessage()},wo=()=>{const e=F(),t=Ae(e,i.input),n=Ae(e,i.file),r=e.querySelector(".".concat(i.range," input")),f=e.querySelector(".".concat(i.range," output")),B=Ae(e,i.select),Y=e.querySelector(".".concat(i.checkbox," input")),ue=Ae(e,i.textarea);t.oninput=Ee,n.onchange=Ee,B.onchange=Ee,Y.onchange=Ee,ue.oninput=Ee,r.oninput=()=>{Ee(),f.value=r.value},r.onchange=()=>{Ee(),r.nextSibling.value=r.value}},yo=e=>typeof e=="string"?document.querySelector(e):e,vo=e=>{const t=F();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")},ko=e=>{window.getComputedStyle(e).direction==="rtl"&&D(T(),i.rtl)},xo=e=>{const t=bo();if(Bt()){O("SweetAlert2 requires document to initialize");return}const n=document.createElement("div");n.className=i.container,t&&D(n,i["no-transition"]),oe(n,go);const r=yo(e.target);r.appendChild(n),vo(e),ko(r),wo()},rt=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):typeof e=="object"?Co(e,t):e&&oe(t,e)},Co=(e,t)=>{e.jquery?Ao(t,e):oe(t,e.toString())},Ao=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Ne=(()=>{if(Bt())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&typeof e.style[n]<"u")return t[n];return!1})(),So=()=>{const e=document.createElement("div");e.className=i["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},Eo=(e,t)=>{const n=_(),r=w();!t.showConfirmButton&&!t.showDenyButton&&!t.showCancelButton?re(n):Q(n),me(n,t,"actions"),_o(n,r,t),oe(r,t.loaderHtml),me(r,t,"loader")};function _o(e,t,n){const r=b(),f=u(),B=y();st(r,"confirm",n),st(f,"deny",n),st(B,"cancel",n),Po(r,f,B,n),n.reverseButtons&&(n.toast?(e.insertBefore(B,r),e.insertBefore(f,r)):(e.insertBefore(B,t),e.insertBefore(f,t),e.insertBefore(r,t)))}function Po(e,t,n,r){if(!r.buttonsStyling)return ve([e,t,n],i.styled);D([e,t,n],i.styled),r.confirmButtonColor&&(e.style.backgroundColor=r.confirmButtonColor,D(e,i["default-outline"])),r.denyButtonColor&&(t.style.backgroundColor=r.denyButtonColor,D(t,i["default-outline"])),r.cancelButtonColor&&(n.style.backgroundColor=r.cancelButtonColor,D(n,i["default-outline"]))}function st(e,t,n){We(e,n["show".concat(U(t),"Button")],"inline-block"),oe(e,n["".concat(t,"ButtonText")]),e.setAttribute("aria-label",n["".concat(t,"ButtonAriaLabel")]),e.className=i[t],me(e,n,"".concat(t,"Button")),D(e,n["".concat(t,"ButtonClass")])}function Bo(e,t){typeof t=="string"?e.style.background=t:t||D([document.documentElement,document.body],i["no-backdrop"])}function To(e,t){t in i?D(e,i[t]):(I('The "position" parameter is not valid, defaulting to "center"'),D(e,i.center))}function Io(e,t){if(t&&typeof t=="string"){const n="grow-".concat(t);n in i&&D(e,i[n])}}const Lo=(e,t)=>{const n=T();n&&(Bo(n,t.backdrop),To(n,t.position),Io(n,t.grow),me(n,t,"container"))};var R={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const Fo=["input","file","range","select","radio","checkbox","textarea"],Uo=(e,t)=>{const n=F(),r=R.innerParams.get(e),f=!r||t.input!==r.input;Fo.forEach(B=>{const Y=i[B],ue=Ae(n,Y);Vo(B,t.inputAttributes),ue.className=Y,f&&re(ue)}),t.input&&(f&&Mo(t),Ro(t))},Mo=e=>{if(!ie[e.input])return O('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=Tt(e.input),n=ie[e.input](t,e);Q(n),setTimeout(()=>{At(n)})},Oo=e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["type","value","style"].includes(n)||e.removeAttribute(n)}},Vo=(e,t)=>{const n=nt(F(),e);if(n){Oo(n);for(const r in t)n.setAttribute(r,t[r])}},Ro=e=>{const t=Tt(e.input);e.customClass&&D(t,e.customClass.input)},it=(e,t)=>{(!e.placeholder||t.inputPlaceholder)&&(e.placeholder=t.inputPlaceholder)},He=(e,t,n)=>{if(n.inputLabel){e.id=i.input;const r=document.createElement("label"),f=i["input-label"];r.setAttribute("for",e.id),r.className=f,D(r,n.customClass.inputLabel),r.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",r)}},Tt=e=>{const t=i[e]?i[e]:i.input;return Ae(F(),t)},ie={};ie.text=ie.email=ie.password=ie.number=ie.tel=ie.url=(e,t)=>(typeof t.inputValue=="string"||typeof t.inputValue=="number"?e.value=t.inputValue:Ce(t.inputValue)||I('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t.inputValue,'"')),He(e,e,t),it(e,t),e.type=t.input,e),ie.file=(e,t)=>(He(e,e,t),it(e,t),e),ie.range=(e,t)=>{const n=e.querySelector("input"),r=e.querySelector("output");return n.value=t.inputValue,n.type=t.input,r.value=t.inputValue,He(n,e,t),e},ie.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");oe(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return He(e,e,t),e},ie.radio=e=>(e.textContent="",e),ie.checkbox=(e,t)=>{const n=nt(F(),"checkbox");n.value="1",n.id=i.checkbox,n.checked=!!t.inputValue;const r=e.querySelector("span");return oe(r,t.inputPlaceholder),e},ie.textarea=(e,t)=>{e.value=t.inputValue,it(e,t),He(e,e,t);const n=r=>parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight);return setTimeout(()=>{if("MutationObserver"in window){const r=parseInt(window.getComputedStyle(F()).width),f=()=>{const B=e.offsetWidth+n(e);B>r?F().style.width="".concat(B,"px"):F().style.width=null};new MutationObserver(f).observe(e,{attributes:!0,attributeFilter:["style"]})}}),e};const No=(e,t)=>{const n=te();me(n,t,"htmlContainer"),t.html?(rt(t.html,n),Q(n,"block")):t.text?(n.textContent=t.text,Q(n,"block")):re(n),Uo(e,t)},Ho=(e,t)=>{const n=P();We(n,t.footer),t.footer&&rt(t.footer,n),me(n,t,"footer")},Do=(e,t)=>{const n=H();oe(n,t.closeButtonHtml),me(n,t,"closeButton"),We(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)},jo=(e,t)=>{const n=R.innerParams.get(e),r=G();if(n&&t.icon===n.icon){Lt(r,t),It(r,t);return}if(!t.icon&&!t.iconHtml)return re(r);if(t.icon&&Object.keys(g).indexOf(t.icon)===-1)return O('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),re(r);Q(r),Lt(r,t),It(r,t),D(r,t.showClass.icon)},It=(e,t)=>{for(const n in g)t.icon!==n&&ve(e,g[n]);D(e,g[t.icon]),Wo(e,t),$o(),me(e,t,"icon")},$o=()=>{const e=F(),t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let r=0;r<n.length;r++)n[r].style.backgroundColor=t},qo=`
|
|
65
65
|
<div class="swal2-success-circular-line-left"></div>
|
|
66
66
|
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
67
67
|
<div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
|
|
68
68
|
<div class="swal2-success-circular-line-right"></div>
|
|
69
|
-
`,
|
|
69
|
+
`,zo=`
|
|
70
70
|
<span class="swal2-x-mark">
|
|
71
71
|
<span class="swal2-x-mark-line-left"></span>
|
|
72
72
|
<span class="swal2-x-mark-line-right"></span>
|
|
73
73
|
</span>
|
|
74
|
-
`,
|
|
74
|
+
`,Lt=(e,t)=>{e.textContent="",t.iconHtml?oe(e,Ft(t.iconHtml)):t.icon==="success"?oe(e,qo):t.icon==="error"?oe(e,zo):oe(e,Ft({question:"?",warning:"!",info:"i"}[t.icon]))},Wo=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])Et(e,n,"backgroundColor",t.iconColor);Et(e,".swal2-success-ring","borderColor",t.iconColor)}},Ft=e=>'<div class="'.concat(i["icon-content"],'">').concat(e,"</div>"),Ko=(e,t)=>{const n=s();if(!t.imageUrl)return re(n);Q(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),Re(n,"width",t.imageWidth),Re(n,"height",t.imageHeight),n.className=i.image,me(n,t,"image")},Jo=e=>{const t=document.createElement("li");return D(t,i["progress-step"]),oe(t,e),t},Yo=e=>{const t=document.createElement("li");return D(t,i["progress-step-line"]),e.progressStepsDistance&&(t.style.width=e.progressStepsDistance),t},Xo=(e,t)=>{const n=a();if(!t.progressSteps||t.progressSteps.length===0)return re(n);Q(n),n.textContent="",t.currentProgressStep>=t.progressSteps.length&&I("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach((r,f)=>{const B=Jo(r);if(n.appendChild(B),f===t.currentProgressStep&&D(B,i["active-progress-step"]),f!==t.progressSteps.length-1){const Y=Yo(t);n.appendChild(Y)}})},Zo=(e,t)=>{const n=N();We(n,t.title||t.titleText,"block"),t.title&&rt(t.title,n),t.titleText&&(n.innerText=t.titleText),me(n,t,"title")},Go=(e,t)=>{const n=T(),r=F();t.toast?(Re(n,"width",t.width),r.style.width="100%",r.insertBefore(w(),G())):Re(r,"width",t.width),Re(r,"padding",t.padding),t.color&&(r.style.color=t.color),t.background&&(r.style.background=t.background),re(m()),Qo(r,t)},Qo=(e,t)=>{e.className="".concat(i.popup," ").concat(le(e)?t.showClass.popup:""),t.toast?(D([document.documentElement,document.body],i["toast-shown"]),D(e,i.toast)):D(e,i.modal),me(e,t,"popup"),typeof t.customClass=="string"&&D(e,t.customClass),t.icon&&D(e,i["icon-".concat(t.icon)])},Ut=(e,t)=>{Go(e,t),Lo(e,t),Xo(e,t),jo(e,t),Ko(e,t),Zo(e,t),Do(e,t),No(e,t),Eo(e,t),Ho(e,t),typeof t.didRender=="function"&&t.didRender(F())},Le=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),er=()=>{x(document.body.children).forEach(t=>{t===T()||t.contains(T())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))})},Mt=()=>{x(document.body.children).forEach(t=>{t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})},Ot=["swal-title","swal-html","swal-footer"],tr=e=>{const t=typeof e.template=="string"?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return cr(n),Object.assign(nr(n),or(n),rr(n),sr(n),ir(n),ar(n,Ot))},nr=e=>{const t={};return x(e.querySelectorAll("swal-param")).forEach(n=>{_e(n,["name","value"]);const r=n.getAttribute("name"),f=n.getAttribute("value");typeof ge[r]=="boolean"&&f==="false"&&(t[r]=!1),typeof ge[r]=="object"&&(t[r]=JSON.parse(f))}),t},or=e=>{const t={};return x(e.querySelectorAll("swal-button")).forEach(n=>{_e(n,["type","color","aria-label"]);const r=n.getAttribute("type");t["".concat(r,"ButtonText")]=n.innerHTML,t["show".concat(U(r),"Button")]=!0,n.hasAttribute("color")&&(t["".concat(r,"ButtonColor")]=n.getAttribute("color")),n.hasAttribute("aria-label")&&(t["".concat(r,"ButtonAriaLabel")]=n.getAttribute("aria-label"))}),t},rr=e=>{const t={},n=e.querySelector("swal-image");return n&&(_e(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},sr=e=>{const t={},n=e.querySelector("swal-icon");return n&&(_e(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},ir=e=>{const t={},n=e.querySelector("swal-input");n&&(_e(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const r=e.querySelectorAll("swal-input-option");return r.length&&(t.inputOptions={},x(r).forEach(f=>{_e(f,["value"]);const B=f.getAttribute("value"),Y=f.innerHTML;t.inputOptions[B]=Y})),t},ar=(e,t)=>{const n={};for(const r in t){const f=t[r],B=e.querySelector(f);B&&(_e(B,[]),n[f.replace(/^swal-/,"")]=B.innerHTML.trim())}return n},cr=e=>{const t=Ot.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);x(e.children).forEach(n=>{const r=n.tagName.toLowerCase();t.indexOf(r)===-1&&I("Unrecognized element <".concat(r,">"))})},_e=(e,t)=>{x(e.attributes).forEach(n=>{t.indexOf(n.name)===-1&&I(['Unrecognized attribute "'.concat(n.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])})};var Vt={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function lr(e){e.inputValidator||Object.keys(Vt).forEach(t=>{e.input===t&&(e.inputValidator=Vt[t])})}function ur(e){(!e.target||typeof e.target=="string"&&!document.querySelector(e.target)||typeof e.target!="string"&&!e.target.appendChild)&&(I('Target parameter is not valid, defaulting to "body"'),e.target="body")}function dr(e){lr(e),e.showLoaderOnConfirm&&!e.preConfirm&&I(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
|
75
75
|
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
76
|
-
https://sweetalert2.github.io/#ajax-request`),
|
|
77
|
-
`).join("<br />")),qt(e)}class Un{constructor(t,n){this.callback=t,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(t){const n=this.running;return n&&this.stop(),this.remaining+=t,n&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const Mn=()=>{we.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(we.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(we.previousBodyPadding+Kt(),"px"))},On=()=>{we.previousBodyPadding!==null&&(document.body.style.paddingRight="".concat(we.previousBodyPadding,"px"),we.previousBodyPadding=null)},Nn=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!ue(document.body,d.iosfix)){const t=document.body.scrollTop;document.body.style.top="".concat(t*-1,"px"),F(document.body,d.iosfix),Dn(),Vn()}},Vn=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);t&&n&&!e.match(/CriOS/i)&&I().scrollHeight>window.innerHeight-44&&(N().style.paddingBottom="".concat(44,"px"))},Dn=()=>{const e=N();let t;e.ontouchstart=n=>{t=jn(n)},e.ontouchmove=n=>{t&&(n.preventDefault(),n.stopPropagation())}},jn=e=>{const t=e.target,n=N();return $n(e)||Xn(e)?!1:t===n||!nt(n)&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&!(nt(be())&&be().contains(t))},$n=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus",Xn=e=>e.touches&&e.touches.length>1,qn=()=>{if(ue(document.body,d.iosfix)){const e=parseInt(document.body.style.top,10);se(document.body,d.iosfix),document.body.style.top="",document.body.scrollTop=e*-1}},ht=10,zn=e=>{const t=N(),n=I();typeof e.willOpen=="function"&&e.willOpen(n);const p=window.getComputedStyle(document.body).overflowY;Jn(t,n,e),setTimeout(()=>{Wn(t,n)},ht),ne()&&(Kn(t,e.scrollbarPadding,p),Sn()),!$()&&!P.previousActiveElement&&(P.previousActiveElement=document.activeElement),typeof e.didOpen=="function"&&setTimeout(()=>e.didOpen(n)),se(t,d["no-transition"])},pt=e=>{const t=I();if(e.target!==t)return;const n=N();t.removeEventListener(Be,pt),n.style.overflowY="auto"},Wn=(e,t)=>{Be&&ot(t)?(e.style.overflowY="hidden",t.addEventListener(Be,pt)):e.style.overflowY="auto"},Kn=(e,t,n)=>{Nn(),t&&n!=="hidden"&&Mn(),setTimeout(()=>{e.scrollTop=0})},Jn=(e,t,n)=>{F(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),X(t,"grid"),setTimeout(()=>{F(t,n.showClass.popup),t.style.removeProperty("opacity")},ht),F([document.documentElement,document.body],d.shown),n.heightAuto&&n.backdrop&&!n.toast&&F([document.documentElement,document.body],d["height-auto"])},ke=e=>{let t=I();t||new Me,t=I();const n=C();$()?z(le()):Yn(t,e),X(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Yn=(e,t)=>{const n=b(),r=C();!t&&ee(g())&&(t=g()),X(n),t&&(z(t),r.setAttribute("data-button-to-replace",t.className)),r.parentNode.insertBefore(r,t),F([e,n],d.loading)},Gn=(e,t)=>{t.input==="select"||t.input==="radio"?no(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(V(t.inputValue)||J(t.inputValue))&&(ke(g()),oo(e,t))},Zn=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Qn(n);case"radio":return eo(n);case"file":return to(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Qn=e=>e.checked?1:0,eo=e=>e.checked?e.value:null,to=e=>e.files.length?e.getAttribute("multiple")!==null?e.files:e.files[0]:null,no=(e,t)=>{const n=I(),r=p=>ro[t.input](n,Xe(p),t);V(t.inputOptions)||J(t.inputOptions)?(ke(g()),T(t.inputOptions).then(p=>{e.hideLoading(),r(p)})):typeof t.inputOptions=="object"?r(t.inputOptions):h("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},oo=(e,t)=>{const n=e.getInput();z(n),T(t.inputValue).then(r=>{n.value=t.input==="number"?parseFloat(r)||0:"".concat(r),X(n),n.focus(),e.hideLoading()}).catch(r=>{h("Error in inputValue promise: ".concat(r)),n.value="",X(n),n.focus(),e.hideLoading()})},ro={select:(e,t,n)=>{const r=fe(e,d.select),p=(A,O,te)=>{const W=document.createElement("option");W.value=te,q(W,O),W.selected=mt(te,n.inputValue),A.appendChild(W)};t.forEach(A=>{const O=A[0],te=A[1];if(Array.isArray(te)){const W=document.createElement("optgroup");W.label=O,W.disabled=!1,r.appendChild(W),te.forEach(xe=>p(W,xe[1],xe[0]))}else p(r,te,O)}),r.focus()},radio:(e,t,n)=>{const r=fe(e,d.radio);t.forEach(A=>{const O=A[0],te=A[1],W=document.createElement("input"),xe=document.createElement("label");W.type="radio",W.name=d.radio,W.value=O,mt(O,n.inputValue)&&(W.checked=!0);const Ge=document.createElement("span");q(Ge,te),Ge.className=d.label,xe.appendChild(W),xe.appendChild(Ge),r.appendChild(xe)});const p=r.querySelectorAll("input");p.length&&p[0].focus()}},Xe=e=>{const t=[];return typeof Map<"u"&&e instanceof Map?e.forEach((n,r)=>{let p=n;typeof p=="object"&&(p=Xe(p)),t.push([r,p])}):Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&(r=Xe(r)),t.push([n,r])}),t},mt=(e,t)=>t&&t.toString()===e.toString();function gt(){const e=H.innerParams.get(this);if(!e)return;const t=H.domCache.get(this);z(t.loader),$()?e.icon&&X(le()):so(t),se([t.popup,t.actions],d.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const so=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?X(t[0],"inline-block"):Lt()&&z(e.actions)};function io(e){const t=H.innerParams.get(e||this),n=H.domCache.get(e||this);return n?Ne(n.popup,t.input):null}var Pe={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const ao=()=>ee(I()),vt=()=>g()&&g().click(),co=()=>w()&&w().click(),lo=()=>v()&&v().click(),bt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},uo=(e,t,n,r)=>{bt(t),n.toast||(t.keydownHandler=p=>ho(e,p,r),t.keydownTarget=n.keydownListenerCapture?window:I(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},qe=(e,t,n)=>{const r=G();if(r.length)return t=t+n,t===r.length?t=0:t===-1&&(t=r.length-1),r[t].focus();I().focus()},wt=["ArrowRight","ArrowDown"],fo=["ArrowLeft","ArrowUp"],ho=(e,t,n)=>{const r=H.innerParams.get(e);r&&(t.isComposing||t.keyCode===229||(r.stopKeydownPropagation&&t.stopPropagation(),t.key==="Enter"?po(e,t,r):t.key==="Tab"?mo(t,r):[...wt,...fo].includes(t.key)?go(t.key):t.key==="Escape"&&vo(t,r,n)))},po=(e,t,n)=>{if(R(n.allowEnterKey)&&t.target&&e.getInput()&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;vt(),t.preventDefault()}},mo=(e,t)=>{const n=e.target,r=G();let p=-1;for(let A=0;A<r.length;A++)if(n===r[A]){p=A;break}e.shiftKey?qe(t,p,-1):qe(t,p,1),e.stopPropagation(),e.preventDefault()},go=e=>{const t=g(),n=w(),r=v();if(![t,n,r].includes(document.activeElement))return;const p=wt.includes(e)?"nextElementSibling":"previousElementSibling";let A=document.activeElement;for(let O=0;O<b().children.length;O++){if(A=A[p],!A)return;if(ee(A)&&A instanceof HTMLButtonElement)break}A instanceof HTMLButtonElement&&A.focus()},vo=(e,t,n)=>{R(t.allowEscapeKey)&&(e.preventDefault(),n(ye.esc))};function yt(e,t,n,r){$()?kt(e,r):(Ot(n).then(()=>kt(e,r)),bt(P)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ne()&&(On(),qn(),ut()),bo()}function bo(){se([document.documentElement,document.body],[d.shown,d["height-auto"],d["no-backdrop"],d["toast-shown"]])}function Re(e){e=Co(e);const t=Pe.swalPromiseResolve.get(this),n=yo(this);this.isAwaitingPromise()?e.isDismissed||(He(this),t(e)):n&&t(e)}function wo(){return!!H.awaitingPromise.get(this)}const yo=e=>{const t=I();if(!t)return!1;const n=H.innerParams.get(e);if(!n||ue(t,n.hideClass.popup))return!1;se(t,n.showClass.popup),F(t,n.hideClass.popup);const r=N();return se(r,n.showClass.backdrop),F(r,n.hideClass.backdrop),xo(e,t,n),!0};function ko(e){const t=Pe.swalPromiseReject.get(this);He(this),t&&t(e)}const He=e=>{e.isAwaitingPromise()&&(H.awaitingPromise.delete(e),H.innerParams.get(e)||e._destroy())},Co=e=>typeof e>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),xo=(e,t,n)=>{const r=N(),p=Be&&ot(t);typeof n.willClose=="function"&&n.willClose(t),p?So(e,t,r,n.returnFocus,n.didClose):yt(e,r,n.returnFocus,n.didClose)},So=(e,t,n,r,p)=>{P.swalCloseEventFinishedCallback=yt.bind(null,e,n,r,p),t.addEventListener(Be,function(A){A.target===t&&(P.swalCloseEventFinishedCallback(),delete P.swalCloseEventFinishedCallback)})},kt=(e,t)=>{setTimeout(()=>{typeof t=="function"&&t.bind(e.params)(),e._destroy()})};function Ct(e,t,n){const r=H.domCache.get(e);t.forEach(p=>{r[p].disabled=n})}function xt(e,t){if(!e)return!1;if(e.type==="radio"){const r=e.parentNode.parentNode.querySelectorAll("input");for(let p=0;p<r.length;p++)r[p].disabled=t}else e.disabled=t}function _o(){Ct(this,["confirmButton","denyButton","cancelButton"],!1)}function Ao(){Ct(this,["confirmButton","denyButton","cancelButton"],!0)}function Eo(){return xt(this.getInput(),!1)}function Bo(){return xt(this.getInput(),!0)}function To(e){const t=H.domCache.get(this),n=H.innerParams.get(this);q(t.validationMessage,e),t.validationMessage.className=d["validation-message"],n.customClass&&n.customClass.validationMessage&&F(t.validationMessage,n.customClass.validationMessage),X(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid",!0),r.setAttribute("aria-describedby",d["validation-message"]),Qe(r),F(r,d.inputerror))}function Po(){const e=H.domCache.get(this);e.validationMessage&&z(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),se(t,d.inputerror))}function Ho(){return H.domCache.get(this).progressSteps}function Io(e){const t=I(),n=H.innerParams.get(this);if(!t||ue(t,n.hideClass.popup))return y("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 r=Fo(e),p=Object.assign({},n,r);lt(this,p),H.innerParams.set(this,p),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const Fo=e=>{const t={};return Object.keys(e).forEach(n=>{Se(n)?t[n]=e[n]:y('Invalid parameter to update: "'.concat(n,`". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
|
|
76
|
+
https://sweetalert2.github.io/#ajax-request`),ur(e),typeof e.title=="string"&&(e.title=e.title.split(`
|
|
77
|
+
`).join("<br />")),xo(e)}class fr{constructor(t,n){this.callback=t,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(t){const n=this.running;return n&&this.stop(),this.remaining+=t,n&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const hr=()=>{Ie.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(Ie.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(Ie.previousBodyPadding+So(),"px"))},pr=()=>{Ie.previousBodyPadding!==null&&(document.body.style.paddingRight="".concat(Ie.previousBodyPadding,"px"),Ie.previousBodyPadding=null)},mr=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!xe(document.body,i.iosfix)){const t=document.body.scrollTop;document.body.style.top="".concat(t*-1,"px"),D(document.body,i.iosfix),br(),gr()}},gr=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);t&&n&&!e.match(/CriOS/i)&&F().scrollHeight>window.innerHeight-44&&(T().style.paddingBottom="".concat(44,"px"))},br=()=>{const e=T();let t;e.ontouchstart=n=>{t=wr(n)},e.ontouchmove=n=>{t&&(n.preventDefault(),n.stopPropagation())}},wr=e=>{const t=e.target,n=T();return yr(e)||vr(e)?!1:t===n||!_t(n)&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&!(_t(te())&&te().contains(t))},yr=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus",vr=e=>e.touches&&e.touches.length>1,kr=()=>{if(xe(document.body,i.iosfix)){const e=parseInt(document.body.style.top,10);ve(document.body,i.iosfix),document.body.style.top="",document.body.scrollTop=e*-1}},Rt=10,xr=e=>{const t=T(),n=F();typeof e.willOpen=="function"&&e.willOpen(n);const f=window.getComputedStyle(document.body).overflowY;Sr(t,n,e),setTimeout(()=>{Cr(t,n)},Rt),ne()&&(Ar(t,e.scrollbarPadding,f),er()),!ye()&&!V.previousActiveElement&&(V.previousActiveElement=document.activeElement),typeof e.didOpen=="function"&&setTimeout(()=>e.didOpen(n)),ve(t,i["no-transition"])},Nt=e=>{const t=F();if(e.target!==t)return;const n=T();t.removeEventListener(Ne,Nt),n.style.overflowY="auto"},Cr=(e,t)=>{Ne&&Pt(t)?(e.style.overflowY="hidden",t.addEventListener(Ne,Nt)):e.style.overflowY="auto"},Ar=(e,t,n)=>{mr(),t&&n!=="hidden"&&hr(),setTimeout(()=>{e.scrollTop=0})},Sr=(e,t,n)=>{D(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),Q(t,"grid"),setTimeout(()=>{D(t,n.showClass.popup),t.style.removeProperty("opacity")},Rt),D([document.documentElement,document.body],i.shown),n.heightAuto&&n.backdrop&&!n.toast&&D([document.documentElement,document.body],i["height-auto"])},Fe=e=>{let t=F();t||new Ye,t=F();const n=w();ye()?re(G()):Er(t,e),Q(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Er=(e,t)=>{const n=_(),r=w();!t&&le(b())&&(t=b()),Q(n),t&&(re(t),r.setAttribute("data-button-to-replace",t.className)),r.parentNode.insertBefore(r,t),D([e,n],i.loading)},_r=(e,t)=>{t.input==="select"||t.input==="radio"?Lr(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(ae(t.inputValue)||Ce(t.inputValue))&&(Fe(b()),Fr(e,t))},Pr=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Br(n);case"radio":return Tr(n);case"file":return Ir(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Br=e=>e.checked?1:0,Tr=e=>e.checked?e.value:null,Ir=e=>e.files.length?e.getAttribute("multiple")!==null?e.files:e.files[0]:null,Lr=(e,t)=>{const n=F(),r=f=>Ur[t.input](n,at(f),t);ae(t.inputOptions)||Ce(t.inputOptions)?(Fe(b()),j(t.inputOptions).then(f=>{e.hideLoading(),r(f)})):typeof t.inputOptions=="object"?r(t.inputOptions):O("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},Fr=(e,t)=>{const n=e.getInput();re(n),j(t.inputValue).then(r=>{n.value=t.input==="number"?parseFloat(r)||0:"".concat(r),Q(n),n.focus(),e.hideLoading()}).catch(r=>{O("Error in inputValue promise: ".concat(r)),n.value="",Q(n),n.focus(),e.hideLoading()})},Ur={select:(e,t,n)=>{const r=Ae(e,i.select),f=(B,Y,ue)=>{const se=document.createElement("option");se.value=ue,oe(se,Y),se.selected=Ht(ue,n.inputValue),B.appendChild(se)};t.forEach(B=>{const Y=B[0],ue=B[1];if(Array.isArray(ue)){const se=document.createElement("optgroup");se.label=Y,se.disabled=!1,r.appendChild(se),ue.forEach(Me=>f(se,Me[1],Me[0]))}else f(r,ue,Y)}),r.focus()},radio:(e,t,n)=>{const r=Ae(e,i.radio);t.forEach(B=>{const Y=B[0],ue=B[1],se=document.createElement("input"),Me=document.createElement("label");se.type="radio",se.name=i.radio,se.value=Y,Ht(Y,n.inputValue)&&(se.checked=!0);const pt=document.createElement("span");oe(pt,ue),pt.className=i.label,Me.appendChild(se),Me.appendChild(pt),r.appendChild(Me)});const f=r.querySelectorAll("input");f.length&&f[0].focus()}},at=e=>{const t=[];return typeof Map<"u"&&e instanceof Map?e.forEach((n,r)=>{let f=n;typeof f=="object"&&(f=at(f)),t.push([r,f])}):Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&(r=at(r)),t.push([n,r])}),t},Ht=(e,t)=>t&&t.toString()===e.toString();function Dt(){const e=R.innerParams.get(this);if(!e)return;const t=R.domCache.get(this);re(t.loader),ye()?e.icon&&Q(G()):Mr(t),ve([t.popup,t.actions],i.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Mr=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Q(t[0],"inline-block"):uo()&&re(e.actions)};function Or(e){const t=R.innerParams.get(e||this),n=R.domCache.get(e||this);return n?nt(n.popup,t.input):null}var De={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Vr=()=>le(F()),jt=()=>b()&&b().click(),Rr=()=>u()&&u().click(),Nr=()=>y()&&y().click(),$t=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},Hr=(e,t,n,r)=>{$t(t),n.toast||(t.keydownHandler=f=>jr(e,f,r),t.keydownTarget=n.keydownListenerCapture?window:F(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},ct=(e,t,n)=>{const r=pe();if(r.length)return t=t+n,t===r.length?t=0:t===-1&&(t=r.length-1),r[t].focus();F().focus()},qt=["ArrowRight","ArrowDown"],Dr=["ArrowLeft","ArrowUp"],jr=(e,t,n)=>{const r=R.innerParams.get(e);r&&(t.isComposing||t.keyCode===229||(r.stopKeydownPropagation&&t.stopPropagation(),t.key==="Enter"?$r(e,t,r):t.key==="Tab"?qr(t,r):[...qt,...Dr].includes(t.key)?zr(t.key):t.key==="Escape"&&Wr(t,r,n)))},$r=(e,t,n)=>{if(X(n.allowEnterKey)&&t.target&&e.getInput()&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;jt(),t.preventDefault()}},qr=(e,t)=>{const n=e.target,r=pe();let f=-1;for(let B=0;B<r.length;B++)if(n===r[B]){f=B;break}e.shiftKey?ct(t,f,-1):ct(t,f,1),e.stopPropagation(),e.preventDefault()},zr=e=>{const t=b(),n=u(),r=y();if(![t,n,r].includes(document.activeElement))return;const f=qt.includes(e)?"nextElementSibling":"previousElementSibling";let B=document.activeElement;for(let Y=0;Y<_().children.length;Y++){if(B=B[f],!B)return;if(le(B)&&B instanceof HTMLButtonElement)break}B instanceof HTMLButtonElement&&B.focus()},Wr=(e,t,n)=>{X(t.allowEscapeKey)&&(e.preventDefault(),n(Le.esc))};function zt(e,t,n,r){ye()?Wt(e,r):(mo(n).then(()=>Wt(e,r)),$t(V)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ne()&&(pr(),kr(),Mt()),Kr()}function Kr(){ve([document.documentElement,document.body],[i.shown,i["height-auto"],i["no-backdrop"],i["toast-shown"]])}function Ke(e){e=Zr(e);const t=De.swalPromiseResolve.get(this),n=Yr(this);this.isAwaitingPromise()?e.isDismissed||(je(this),t(e)):n&&t(e)}function Jr(){return!!R.awaitingPromise.get(this)}const Yr=e=>{const t=F();if(!t)return!1;const n=R.innerParams.get(e);if(!n||xe(t,n.hideClass.popup))return!1;ve(t,n.showClass.popup),D(t,n.hideClass.popup);const r=T();return ve(r,n.showClass.backdrop),D(r,n.hideClass.backdrop),Gr(e,t,n),!0};function Xr(e){const t=De.swalPromiseReject.get(this);je(this),t&&t(e)}const je=e=>{e.isAwaitingPromise()&&(R.awaitingPromise.delete(e),R.innerParams.get(e)||e._destroy())},Zr=e=>typeof e>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Gr=(e,t,n)=>{const r=T(),f=Ne&&Pt(t);typeof n.willClose=="function"&&n.willClose(t),f?Qr(e,t,r,n.returnFocus,n.didClose):zt(e,r,n.returnFocus,n.didClose)},Qr=(e,t,n,r,f)=>{V.swalCloseEventFinishedCallback=zt.bind(null,e,n,r,f),t.addEventListener(Ne,function(B){B.target===t&&(V.swalCloseEventFinishedCallback(),delete V.swalCloseEventFinishedCallback)})},Wt=(e,t)=>{setTimeout(()=>{typeof t=="function"&&t.bind(e.params)(),e._destroy()})};function Kt(e,t,n){const r=R.domCache.get(e);t.forEach(f=>{r[f].disabled=n})}function Jt(e,t){if(!e)return!1;if(e.type==="radio"){const r=e.parentNode.parentNode.querySelectorAll("input");for(let f=0;f<r.length;f++)r[f].disabled=t}else e.disabled=t}function es(){Kt(this,["confirmButton","denyButton","cancelButton"],!1)}function ts(){Kt(this,["confirmButton","denyButton","cancelButton"],!0)}function ns(){return Jt(this.getInput(),!1)}function os(){return Jt(this.getInput(),!0)}function rs(e){const t=R.domCache.get(this),n=R.innerParams.get(this);oe(t.validationMessage,e),t.validationMessage.className=i["validation-message"],n.customClass&&n.customClass.validationMessage&&D(t.validationMessage,n.customClass.validationMessage),Q(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid",!0),r.setAttribute("aria-describedby",i["validation-message"]),At(r),D(r,i.inputerror))}function ss(){const e=R.domCache.get(this);e.validationMessage&&re(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),ve(t,i.inputerror))}function is(){return R.domCache.get(this).progressSteps}function as(e){const t=F(),n=R.innerParams.get(this);if(!t||xe(t,n.hideClass.popup))return I("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 r=cs(e),f=Object.assign({},n,r);Ut(this,f),R.innerParams.set(this,f),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const cs=e=>{const t={};return Object.keys(e).forEach(n=>{we(n)?t[n]=e[n]:I('Invalid parameter to update: "'.concat(n,`". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
|
|
78
78
|
|
|
79
|
-
If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`))}),t};function Lo(){const e=H.domCache.get(this),t=H.innerParams.get(this);if(!t){St(this);return}e.popup&&P.swalCloseEventFinishedCallback&&(P.swalCloseEventFinishedCallback(),delete P.swalCloseEventFinishedCallback),P.deferDisposalTimer&&(clearTimeout(P.deferDisposalTimer),delete P.deferDisposalTimer),typeof t.didDestroy=="function"&&t.didDestroy(),Ro(this)}const Ro=e=>{St(e),delete e.params,delete P.keydownHandler,delete P.keydownTarget,delete P.currentInstance},St=e=>{e.isAwaitingPromise()?(ze(H,e),H.awaitingPromise.set(e,!0)):(ze(Pe,e),ze(H,e))},ze=(e,t)=>{for(const n in e)e[n].delete(t)};var _t=Object.freeze({hideLoading:gt,disableLoading:gt,getInput:io,close:Re,isAwaitingPromise:wo,rejectPromise:ko,handleAwaitingPromise:He,closePopup:Re,closeModal:Re,closeToast:Re,enableButtons:_o,disableButtons:Ao,enableInput:Eo,disableInput:Bo,showValidationMessage:To,resetValidationMessage:Po,getProgressSteps:Ho,update:Io,_destroy:Lo});const Uo=e=>{const t=H.innerParams.get(e);e.disableButtons(),t.input?At(e,"confirm"):Ke(e,!0)},Mo=e=>{const t=H.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?At(e,"deny"):We(e,!1)},Oo=(e,t)=>{e.disableButtons(),t(ye.cancel)},At=(e,t)=>{const n=H.innerParams.get(e);if(!n.input)return h('The "input" parameter is needed to be set when using returnInputValueOn'.concat(k(t)));const r=Zn(e,n);n.inputValidator?No(e,r,t):e.getInput().checkValidity()?t==="deny"?We(e,r):Ke(e,r):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},No=(e,t,n)=>{const r=H.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>T(r.inputValidator(t,r.validationMessage))).then(A=>{e.enableButtons(),e.enableInput(),A?e.showValidationMessage(A):n==="deny"?We(e,t):Ke(e,t)})},We=(e,t)=>{const n=H.innerParams.get(e||void 0);n.showLoaderOnDeny&&ke(w()),n.preDeny?(H.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>T(n.preDeny(t,n.validationMessage))).then(p=>{p===!1?(e.hideLoading(),He(e)):e.closePopup({isDenied:!0,value:typeof p>"u"?t:p})}).catch(p=>Bt(e||void 0,p))):e.closePopup({isDenied:!0,value:t})},Et=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},Bt=(e,t)=>{e.rejectPromise(t)},Ke=(e,t)=>{const n=H.innerParams.get(e||void 0);n.showLoaderOnConfirm&&ke(),n.preConfirm?(e.resetValidationMessage(),H.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>T(n.preConfirm(t,n.validationMessage))).then(p=>{ee(c())||p===!1?(e.hideLoading(),He(e)):Et(e,typeof p>"u"?t:p)}).catch(p=>Bt(e||void 0,p))):Et(e,t)},Vo=(e,t,n)=>{H.innerParams.get(e).toast?Do(e,t,n):($o(t),Xo(t),qo(e,t,n))},Do=(e,t,n)=>{t.popup.onclick=()=>{const r=H.innerParams.get(e);r&&(jo(r)||r.timer||r.input)||n(ye.close)}},jo=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Ue=!1;const $o=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Ue=!0)}}},Xo=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Ue=!0)}}},qo=(e,t,n)=>{t.container.onclick=r=>{const p=H.innerParams.get(e);if(Ue){Ue=!1;return}r.target===t.container&&R(p.allowOutsideClick)&&n(ye.backdrop)}},zo=e=>typeof e=="object"&&e.jquery,Tt=e=>e instanceof Element||zo(e),Wo=e=>{const t={};return typeof e[0]=="object"&&!Tt(e[0])?Object.assign(t,e[0]):["title","html","icon"].forEach((n,r)=>{const p=e[r];typeof p=="string"||Tt(p)?t[n]=p:p!==void 0&&h("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof p))}),t};function Ko(){const e=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new e(...n)}function Jo(e){class t extends this{_main(r,p){return super._main(r,Object.assign({},e,p))}}return t}const Yo=()=>P.timeout&&P.timeout.getTimerLeft(),Pt=()=>{if(P.timeout)return Rt(),P.timeout.stop()},Ht=()=>{if(P.timeout){const e=P.timeout.start();return Ve(e),e}},Go=()=>{const e=P.timeout;return e&&(e.running?Pt():Ht())},Zo=e=>{if(P.timeout){const t=P.timeout.increase(e);return Ve(t,!0),t}},Qo=()=>P.timeout&&P.timeout.isRunning();let It=!1;const Je={};function er(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";Je[e]=this,It||(document.body.addEventListener("click",tr),It=!0)}const tr=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const n in Je){const r=t.getAttribute(n);if(r){Je[n].fire({template:r});return}}};var nr=Object.freeze({isValidParameter:ie,isUpdatableParameter:Se,isDeprecatedParameter:de,argsToParams:Wo,isVisible:ao,clickConfirm:vt,clickDeny:co,clickCancel:lo,getContainer:N,getPopup:I,getTitle:ve,getHtmlContainer:be,getImage:Ae,getIcon:le,getInputLabel:m,getCloseButton:E,getActions:b,getConfirmButton:g,getDenyButton:w,getCancelButton:v,getLoader:C,getFooter:_,getTimerProgressBar:S,getFocusableElements:G,getValidationMessage:c,isLoading:pe,fire:Ko,mixin:Jo,showLoading:ke,enableLoading:ke,getTimerLeft:Yo,stopTimer:Pt,resumeTimer:Ht,toggleTimer:Go,increaseTimer:Zo,isTimerRunning:Qo,bindClickHandler:er});let Ye;class Ce{constructor(){if(typeof window>"u")return;Ye=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const p=Object.freeze(this.constructor.argsToParams(n));Object.defineProperties(this,{params:{value:p,writable:!1,enumerable:!0,configurable:!0}});const A=this._main(this.params);H.promise.set(this,A)}_main(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Oe(Object.assign({},n,t)),P.currentInstance&&(P.currentInstance._destroy(),ne()&&ut()),P.currentInstance=this;const r=rr(t,n);Rn(r),Object.freeze(r),P.timeout&&(P.timeout.stop(),delete P.timeout),clearTimeout(P.restoreFocusTimeout);const p=sr(this);return lt(this,r),H.innerParams.set(this,r),or(this,p,r)}then(t){return H.promise.get(this).then(t)}finally(t){return H.promise.get(this).finally(t)}}const or=(e,t,n)=>new Promise((r,p)=>{const A=O=>{e.closePopup({isDismissed:!0,dismiss:O})};Pe.swalPromiseResolve.set(e,r),Pe.swalPromiseReject.set(e,p),t.confirmButton.onclick=()=>Uo(e),t.denyButton.onclick=()=>Mo(e),t.cancelButton.onclick=()=>Oo(e,A),t.closeButton.onclick=()=>A(ye.close),Vo(e,t,A),uo(e,P,n,A),Gn(e,n),zn(n),ir(P,n,A),ar(t,n),setTimeout(()=>{t.container.scrollTop=0})}),rr=(e,t)=>{const n=_n(e),r=Object.assign({},D,t,n,e);return r.showClass=Object.assign({},D.showClass,r.showClass),r.hideClass=Object.assign({},D.hideClass,r.hideClass),r},sr=e=>{const t={popup:I(),container:N(),actions:b(),confirmButton:g(),denyButton:w(),cancelButton:v(),loader:C(),closeButton:E(),validationMessage:c(),progressSteps:a()};return H.domCache.set(e,t),t},ir=(e,t,n)=>{const r=S();z(r),t.timer&&(e.timeout=new Un(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(X(r),oe(r,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&Ve(t.timer)})))},ar=(e,t)=>{if(!t.toast){if(!R(t.allowEnterKey))return lr();cr(e,t)||qe(t,-1,1)}},cr=(e,t)=>t.focusDeny&&ee(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&ee(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&ee(e.confirmButton)?(e.confirmButton.focus(),!0):!1,lr=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(Ce.prototype,_t),Object.assign(Ce,nr),Object.keys(_t).forEach(e=>{Ce[e]=function(){if(Ye)return Ye[e](...arguments)}}),Ce.DismissReason=ye,Ce.version="11.4.8";const Me=Ce;return Me.default=Me,Me}),typeof commonjsGlobal<"u"&&commonjsGlobal.Sweetalert2&&(commonjsGlobal.swal=commonjsGlobal.sweetAlert=commonjsGlobal.Swal=commonjsGlobal.SweetAlert=commonjsGlobal.Sweetalert2)})(sweetalert2);var sweetalert2Exports=sweetalert2.exports;const Swal=getDefaultExportFromCjs(sweetalert2Exports);class DialogService{get IsVisible(){return Swal.isVisible()}async ConfirmAsync(o){return new Promise(u=>{Swal.fire({showCancelButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,icon:"question",title:o.header,html:o.message,confirmButtonText:o.confirmLabel??"confirmar",cancelButtonText:o.rejectLabel??"cancelar"}).then(f=>{u(f.isConfirmed===!0)})})}}const service=new DialogService,UseDialogService=()=>service,_hoisted_1$5=["data-cor"],_sfc_main$7=vue.defineComponent({__name:"HeaderAvatar",setup(s){const o=UseDialogService(),u=k();async function f(){await o.ConfirmAsync({message:`${AuthService.User.username} - ${AuthService.User.name}.<br /><br />Você deseja sair da conta?`,confirmLabel:"sair"})&&AuthService.CallLogout()}function k(){const y=AuthService.User.name;let h="?";if(!y)return h;const x=y.split(" ").filter(U=>U.length>0).map(U=>U[0].toUpperCase()),B=Math.min(2,x.length);return h=x.slice(0,B).join(""),h.length>0?h:"?"}function l(){const y=u[0],h=y==="?"?0:(y.charCodeAt(0)-64)%19;return Math.max(h,0)}return(y,h)=>(vue.openBlock(),vue.createElementBlock("div",{id:"sf-header-avatar","data-cor":l(),onClick:f},vue.toDisplayString(vue.unref(u)),9,_hoisted_1$5))}}),_sfc_main$6={},_hoisted_1$4={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},_hoisted_2$4=vue.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),_hoisted_3$2=[_hoisted_2$4];function _sfc_render(s,o){return vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$4,_hoisted_3$2)}const MenuIcon=_export_sfc(_sfc_main$6,[["render",_sfc_render]]);class ThemeToggle{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 ThemeToggleBase=(()=>new ThemeToggle)(),_hoisted_1$3=vue.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),_hoisted_2$3=[_hoisted_1$3],_sfc_main$5=vue.defineComponent({__name:"ThemeToggle",setup(s){return(o,u)=>(vue.openBlock(),vue.createElementBlock("button",{id:"sf-theme-toggle",onClick:u[0]||(u[0]=(...f)=>vue.unref(ThemeToggleBase).Toggle&&vue.unref(ThemeToggleBase).Toggle(...f))},_hoisted_2$3))}}),_hoisted_1$2={id:"sf-layout"},_hoisted_2$2=vue.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),_hoisted_3$1={class:"title"},_hoisted_4$1={class:"sf-layout-nav-header"},_hoisted_5$1=vue.createElementVNode("span",null,"Menu",-1),_hoisted_6$1={class:"sf-layout-nav-content"},_hoisted_7$1=vue.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),_hoisted_8={id:"sf-layout-content"},_sfc_main$4=vue.defineComponent({__name:"Layout",setup(s){const o=UseNavMenuService();return(u,f)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$2,[vue.createElementVNode("header",null,[vue.createElementVNode("div",{class:vue.normalizeClass(["sf-layout-menu-toggler",{invert:vue.unref(o).IsVisible}]),onClick:f[0]||(f[0]=k=>vue.unref(o).Toggle())},[_hoisted_2$2,vue.createVNode(MenuIcon)],2),vue.createElementVNode("div",_hoisted_3$1,[vue.renderSlot(u.$slots,"title")]),vue.renderSlot(u.$slots,"action"),vue.createVNode(_sfc_main$5),vue.createVNode(_sfc_main$7)]),vue.createElementVNode("nav",{class:vue.normalizeClass({visible:vue.unref(o).IsVisible})},[vue.createElementVNode("div",_hoisted_4$1,[_hoisted_5$1,vue.createVNode(_sfc_main$8,{icone:"close",button:"",onClick:f[1]||(f[1]=k=>vue.unref(o).Close())})]),vue.createElementVNode("div",_hoisted_6$1,[vue.renderSlot(u.$slots,"menu")])],2),vue.createElementVNode("main",{class:vue.normalizeClass({"menu-visible":vue.unref(o).IsVisible})},[_hoisted_7$1,vue.createElementVNode("section",_hoisted_8,[vue.renderSlot(u.$slots,"content")])],2)]))}}),_hoisted_1$1=["href","data-active","onClick"],_hoisted_2$1={class:"sf-navmenulink-text"},_sfc_main$3=vue.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{}},setup(s){const o=s,u=UseNavMenuService();function f(k,l){k.preventDefault();const h=k.target.closest(".sf-layout-nav-content");l(),h&&h.clientWidth+10>document.body.clientWidth&&u.Close()}return(k,l)=>{const y=vue.resolveComponent("router-link");return vue.openBlock(),vue.createBlock(y,{to:o.href,custom:""},{default:vue.withCtx(({href:h,navigate:x,isExactActive:B})=>[vue.createElementVNode("a",{class:"sf-navmenulink",href:h,"data-active":B,onClick:U=>f(U,x)},[o.icon?(vue.openBlock(),vue.createBlock(_sfc_main$8,{key:0,icone:o.icon,"button-props":{tabindex:-1}},null,8,["icone"])):vue.createCommentVNode("",!0),vue.createElementVNode("span",_hoisted_2$1,vue.toDisplayString(o.text),1)],8,_hoisted_1$1)]),_:1},8,["to"])}}}),_sfc_main$2=vue.defineComponent({__name:"ScrollToTop",setup(s){const o=vue.ref(!1),u=`--${+new Date}`;let f=null;function k(){f==null||f.scrollTo(0,0)}return vue.onMounted(()=>{var l;f=((l=document.getElementById(u))==null?void 0:l.parentElement)??null,f&&f.addEventListener("scroll",function(){o.value=this.scrollTop-this.clientHeight>0})}),(l,y)=>(vue.openBlock(),vue.createElementBlock("button",{id:u,class:vue.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":o.value}]),onClick:k},null,2))}}),_sfc_main$1=vue.defineComponent({__name:"Content",props:{class:{},style:{},disableBodyPadding:{type:Boolean},disableHeaderPadding:{type:Boolean},disableFooterPadding:{type:Boolean}},setup(s){const o=s;function u(){return new CssClassBuilder("sf-content").AddClass(o.class,!!o.class).Build()}function f(){return new CssClassBuilder("sf-content-body").AddClass("sf-content-no-padding",o.disableBodyPadding).Build()}function k(){return new CssClassBuilder("sf-content-header").AddClass("sf-content-no-padding",o.disableHeaderPadding).Build()}function l(){return new CssClassBuilder("sf-content-footer").AddClass("sf-content-no-padding",o.disableFooterPadding).Build()}return(y,h)=>(vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass(u()),style:vue.normalizeStyle(o.style)},[vue.createElementVNode("div",{class:vue.normalizeClass(k())},[vue.renderSlot(y.$slots,"header")],2),vue.createElementVNode("div",{class:vue.normalizeClass(f())},[vue.renderSlot(y.$slots,"default"),vue.createVNode(_sfc_main$2)],2),vue.createElementVNode("div",{class:vue.normalizeClass(l())},[vue.renderSlot(y.$slots,"footer")],2)],6))}}),_hoisted_1={class:"sf-tab-navigation"},_hoisted_2=vue.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"},[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1),_hoisted_3=[_hoisted_2],_hoisted_4=["data-active"],_hoisted_5=["href","onClick"],_hoisted_6=vue.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"},[vue.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})],-1),_hoisted_7=[_hoisted_6],_sfc_main=vue.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(s){const o=s,u=vue.ref(null),f=new ResizeObserver(x=>{h()}),k=vue.ref(!1),l=vue.ref(!1);function y(x=!1){const B=u.value.clientWidth;u.value.scrollLeft+=x?-B:B}function h(){const x=u.value.scrollWidth-u.value.clientWidth;k.value=u.value.scrollLeft>10,l.value=u.value.scrollLeft<x-10}return vue.onMounted(()=>{u.value.addEventListener("scroll",h),f.observe(u.value)}),vue.onBeforeUnmount(()=>{var x;try{(x=u.value)==null||x.removeEventListener("scroll",h),f.unobserve(u.value),f.disconnect()}catch{}}),(x,B)=>{const U=vue.resolveComponent("RouterLink");return vue.openBlock(),vue.createElementBlock("div",_hoisted_1,[vue.createElementVNode("div",{class:vue.normalizeClass(["left-arrow",{active:k.value}]),onClick:B[0]||(B[0]=R=>y(!0))},_hoisted_3,2),vue.createElementVNode("ul",{ref_key:"trackerContainer",ref:u},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(o.tabs,R=>(vue.openBlock(),vue.createBlock(U,{to:R.route,custom:!0},{default:vue.withCtx(({navigate:V,isActive:T})=>[vue.createElementVNode("li",{"data-active":T},[vue.renderSlot(x.$slots,"item",{item:R,navigate:V,isActive:T},()=>[vue.createElementVNode("a",{href:R.route,class:vue.normalizeClass({active:T}),onClick:V},vue.toDisplayString(R.text),11,_hoisted_5)])],8,_hoisted_4)]),_:2},1032,["to"]))),256))],512),vue.createElementVNode("div",{class:vue.normalizeClass(["right-arrow",{active:l.value}]),onClick:B[1]||(B[1]=R=>y())},_hoisted_7,2)])}}}),tema="",componentes="";(()=>{function s(){vue.nextTick(()=>{setTimeout(()=>{var u;const o=document.querySelector(":root");o&&o.style.setProperty("--window-height",`${((u=window.visualViewport)==null?void 0:u.height)??window.innerHeight}px`)},1)})}s(),window.addEventListener("resize",s)})(),ThemeToggleBase.SetInitialTheme(),exports.AuthService=AuthService,exports.Cor=Cor,exports.SfContent=_sfc_main$1,exports.SfIcon=_sfc_main$8,exports.SfLayout=_sfc_main$4,exports.SfNavMenuLink=_sfc_main$3,exports.SfTabNavigation=_sfc_main,exports.Tamanho=Tamanho,exports.UseDialogService=UseDialogService,exports.UseNavMenuService=UseNavMenuService,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|
|
79
|
+
If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`))}),t};function ls(){const e=R.domCache.get(this),t=R.innerParams.get(this);if(!t){Yt(this);return}e.popup&&V.swalCloseEventFinishedCallback&&(V.swalCloseEventFinishedCallback(),delete V.swalCloseEventFinishedCallback),V.deferDisposalTimer&&(clearTimeout(V.deferDisposalTimer),delete V.deferDisposalTimer),typeof t.didDestroy=="function"&&t.didDestroy(),us(this)}const us=e=>{Yt(e),delete e.params,delete V.keydownHandler,delete V.keydownTarget,delete V.currentInstance},Yt=e=>{e.isAwaitingPromise()?(lt(R,e),R.awaitingPromise.set(e,!0)):(lt(De,e),lt(R,e))},lt=(e,t)=>{for(const n in e)e[n].delete(t)};var Xt=Object.freeze({hideLoading:Dt,disableLoading:Dt,getInput:Or,close:Ke,isAwaitingPromise:Jr,rejectPromise:Xr,handleAwaitingPromise:je,closePopup:Ke,closeModal:Ke,closeToast:Ke,enableButtons:es,disableButtons:ts,enableInput:ns,disableInput:os,showValidationMessage:rs,resetValidationMessage:ss,getProgressSteps:is,update:as,_destroy:ls});const ds=e=>{const t=R.innerParams.get(e);e.disableButtons(),t.input?Zt(e,"confirm"):dt(e,!0)},fs=e=>{const t=R.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Zt(e,"deny"):ut(e,!1)},hs=(e,t)=>{e.disableButtons(),t(Le.cancel)},Zt=(e,t)=>{const n=R.innerParams.get(e);if(!n.input)return O('The "input" parameter is needed to be set when using returnInputValueOn'.concat(U(t)));const r=Pr(e,n);n.inputValidator?ps(e,r,t):e.getInput().checkValidity()?t==="deny"?ut(e,r):dt(e,r):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},ps=(e,t,n)=>{const r=R.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>j(r.inputValidator(t,r.validationMessage))).then(B=>{e.enableButtons(),e.enableInput(),B?e.showValidationMessage(B):n==="deny"?ut(e,t):dt(e,t)})},ut=(e,t)=>{const n=R.innerParams.get(e||void 0);n.showLoaderOnDeny&&Fe(u()),n.preDeny?(R.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>j(n.preDeny(t,n.validationMessage))).then(f=>{f===!1?(e.hideLoading(),je(e)):e.closePopup({isDenied:!0,value:typeof f>"u"?t:f})}).catch(f=>Qt(e||void 0,f))):e.closePopup({isDenied:!0,value:t})},Gt=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},Qt=(e,t)=>{e.rejectPromise(t)},dt=(e,t)=>{const n=R.innerParams.get(e||void 0);n.showLoaderOnConfirm&&Fe(),n.preConfirm?(e.resetValidationMessage(),R.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>j(n.preConfirm(t,n.validationMessage))).then(f=>{le(m())||f===!1?(e.hideLoading(),je(e)):Gt(e,typeof f>"u"?t:f)}).catch(f=>Qt(e||void 0,f))):Gt(e,t)},ms=(e,t,n)=>{R.innerParams.get(e).toast?gs(e,t,n):(ws(t),ys(t),vs(e,t,n))},gs=(e,t,n)=>{t.popup.onclick=()=>{const r=R.innerParams.get(e);r&&(bs(r)||r.timer||r.input)||n(Le.close)}},bs=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Je=!1;const ws=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Je=!0)}}},ys=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Je=!0)}}},vs=(e,t,n)=>{t.container.onclick=r=>{const f=R.innerParams.get(e);if(Je){Je=!1;return}r.target===t.container&&X(f.allowOutsideClick)&&n(Le.backdrop)}},ks=e=>typeof e=="object"&&e.jquery,en=e=>e instanceof Element||ks(e),xs=e=>{const t={};return typeof e[0]=="object"&&!en(e[0])?Object.assign(t,e[0]):["title","html","icon"].forEach((n,r)=>{const f=e[r];typeof f=="string"||en(f)?t[n]=f:f!==void 0&&O("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof f))}),t};function Cs(){const e=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new e(...n)}function As(e){class t extends this{_main(r,f){return super._main(r,Object.assign({},e,f))}}return t}const Ss=()=>V.timeout&&V.timeout.getTimerLeft(),tn=()=>{if(V.timeout)return fo(),V.timeout.stop()},nn=()=>{if(V.timeout){const e=V.timeout.start();return ot(e),e}},Es=()=>{const e=V.timeout;return e&&(e.running?tn():nn())},_s=e=>{if(V.timeout){const t=V.timeout.increase(e);return ot(t,!0),t}},Ps=()=>V.timeout&&V.timeout.isRunning();let on=!1;const ft={};function Bs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";ft[e]=this,on||(document.body.addEventListener("click",Ts),on=!0)}const Ts=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const n in ft){const r=t.getAttribute(n);if(r){ft[n].fire({template:r});return}}};var Is=Object.freeze({isValidParameter:J,isUpdatableParameter:we,isDeprecatedParameter:Z,argsToParams:xs,isVisible:Vr,clickConfirm:jt,clickDeny:Rr,clickCancel:Nr,getContainer:T,getPopup:F,getTitle:N,getHtmlContainer:te,getImage:s,getIcon:G,getInputLabel:S,getCloseButton:H,getActions:_,getConfirmButton:b,getDenyButton:u,getCancelButton:y,getLoader:w,getFooter:P,getTimerProgressBar:M,getFocusableElements:pe,getValidationMessage:m,isLoading:co,fire:Cs,mixin:As,showLoading:Fe,enableLoading:Fe,getTimerLeft:Ss,stopTimer:tn,resumeTimer:nn,toggleTimer:Es,increaseTimer:_s,isTimerRunning:Ps,bindClickHandler:Bs});let ht;class Ue{constructor(){if(typeof window>"u")return;ht=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const f=Object.freeze(this.constructor.argsToParams(n));Object.defineProperties(this,{params:{value:f,writable:!1,enumerable:!0,configurable:!0}});const B=this._main(this.params);R.promise.set(this,B)}_main(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A(Object.assign({},n,t)),V.currentInstance&&(V.currentInstance._destroy(),ne()&&Mt()),V.currentInstance=this;const r=Fs(t,n);dr(r),Object.freeze(r),V.timeout&&(V.timeout.stop(),delete V.timeout),clearTimeout(V.restoreFocusTimeout);const f=Us(this);return Ut(this,r),R.innerParams.set(this,r),Ls(this,f,r)}then(t){return R.promise.get(this).then(t)}finally(t){return R.promise.get(this).finally(t)}}const Ls=(e,t,n)=>new Promise((r,f)=>{const B=Y=>{e.closePopup({isDismissed:!0,dismiss:Y})};De.swalPromiseResolve.set(e,r),De.swalPromiseReject.set(e,f),t.confirmButton.onclick=()=>ds(e),t.denyButton.onclick=()=>fs(e),t.cancelButton.onclick=()=>hs(e,B),t.closeButton.onclick=()=>B(Le.close),ms(e,t,B),Hr(e,V,n,B),_r(e,n),xr(n),Ms(V,n,B),Os(t,n),setTimeout(()=>{t.container.scrollTop=0})}),Fs=(e,t)=>{const n=tr(e),r=Object.assign({},ge,t,n,e);return r.showClass=Object.assign({},ge.showClass,r.showClass),r.hideClass=Object.assign({},ge.hideClass,r.hideClass),r},Us=e=>{const t={popup:F(),container:T(),actions:_(),confirmButton:b(),denyButton:u(),cancelButton:y(),loader:w(),closeButton:H(),validationMessage:m(),progressSteps:a()};return R.domCache.set(e,t),t},Ms=(e,t,n)=>{const r=M();re(r),t.timer&&(e.timeout=new fr(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(Q(r),me(r,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&ot(t.timer)})))},Os=(e,t)=>{if(!t.toast){if(!X(t.allowEnterKey))return Rs();Vs(e,t)||ct(t,-1,1)}},Vs=(e,t)=>t.focusDeny&&le(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&le(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&le(e.confirmButton)?(e.confirmButton.focus(),!0):!1,Rs=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(Ue.prototype,Xt),Object.assign(Ue,Is),Object.keys(Xt).forEach(e=>{Ue[e]=function(){if(ht)return ht[e](...arguments)}}),Ue.DismissReason=Le,Ue.version="11.4.8";const Ye=Ue;return Ye.default=Ye,Ye}),typeof ke<"u"&&ke.Sweetalert2&&(ke.swal=ke.sweetAlert=ke.Swal=ke.SweetAlert=ke.Sweetalert2)})(kt);var Pn=kt.exports;const xt=gt(Pn);class Bn{get IsVisible(){return xt.isVisible()}async ConfirmAsync(o){return new Promise(h=>{xt.fire({showCancelButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,icon:"question",title:o.header,html:o.message,confirmButtonText:o.confirmLabel??"confirmar",cancelButtonText:o.rejectLabel??"cancelar"}).then(k=>{h(k.isConfirmed===!0)})})}}const Tn=new Bn,Ct=()=>Tn,In=["data-cor"],Ln=c.defineComponent({__name:"HeaderAvatar",setup(l){const o=Ct(),h=U();async function k(){await o.ConfirmAsync({message:`${ee.User.username} - ${ee.User.name}.<br /><br />Você deseja sair da conta?`,confirmLabel:"sair"})&&ee.CallLogout()}function U(){const I=ee.User.name;let O="?";if(!I)return O;const p=I.split(" ").filter(z=>z.length>0).map(z=>z[0].toUpperCase()),K=Math.min(2,p.length);return O=p.slice(0,K).join(""),O.length>0?O:"?"}function x(){const I=h[0],O=I==="?"?0:(I.charCodeAt(0)-64)%19;return Math.max(O,0)}return(I,O)=>(c.openBlock(),c.createElementBlock("div",{id:"sf-header-avatar","data-cor":x(),onClick:k},c.toDisplayString(c.unref(h)),9,In))}}),Fn={},Un={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},Mn=[c.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 On(l,o){return c.openBlock(),c.createElementBlock("svg",Un,Mn)}const Vn=mt(Fn,[["render",On]]);class Rn{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 tt=(()=>new Rn)(),Nn=[c.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)],Hn=c.defineComponent({__name:"ThemeToggle",setup(l){return(o,h)=>(c.openBlock(),c.createElementBlock("button",{id:"sf-theme-toggle",onClick:h[0]||(h[0]=(...k)=>c.unref(tt).Toggle&&c.unref(tt).Toggle(...k))},Nn))}}),Dn={id:"sf-layout"},jn=c.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),$n={class:"title"},qn={class:"sf-layout-nav-header"},zn=c.createElementVNode("span",null,"Menu",-1),Wn={class:"sf-layout-nav-content"},Kn=c.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),Jn={id:"sf-layout-content"},Yn=c.defineComponent({__name:"Layout",setup(l){const o=Xe();return(h,k)=>(c.openBlock(),c.createElementBlock("div",Dn,[c.createElementVNode("header",null,[c.createElementVNode("div",{class:c.normalizeClass(["sf-layout-menu-toggler",{invert:c.unref(o).IsVisible}]),onClick:k[0]||(k[0]=U=>c.unref(o).Toggle())},[jn,c.createVNode(Vn)],2),c.createElementVNode("div",$n,[c.renderSlot(h.$slots,"title")]),c.renderSlot(h.$slots,"action"),c.createVNode(Hn),c.createVNode(Ln)]),c.createElementVNode("nav",{class:c.normalizeClass({visible:c.unref(o).IsVisible})},[c.createElementVNode("div",qn,[zn,c.createVNode(Ge,{icone:"close",button:"",onClick:k[1]||(k[1]=U=>c.unref(o).Close())})]),c.createElementVNode("div",Wn,[c.renderSlot(h.$slots,"menu")])],2),c.createElementVNode("main",{class:c.normalizeClass({"menu-visible":c.unref(o).IsVisible})},[Kn,c.createElementVNode("section",Jn,[c.renderSlot(h.$slots,"content")])],2)]))}}),Xn=["href","data-active","onClick"],Zn={class:"sf-navmenulink-text"},Gn=c.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{}},setup(l){const o=l,h=Xe();function k(U,x){U.preventDefault();const O=U.target.closest(".sf-layout-nav-content");x(),O&&O.clientWidth+10>document.body.clientWidth&&h.Close()}return(U,x)=>{const I=c.resolveComponent("router-link");return c.openBlock(),c.createBlock(I,{to:o.href,custom:""},{default:c.withCtx(({href:O,navigate:p,isExactActive:K})=>[c.createElementVNode("a",{class:"sf-navmenulink",href:O,"data-active":K,onClick:z=>k(z,p)},[o.icon?(c.openBlock(),c.createBlock(Ge,{key:0,icone:o.icon,"button-props":{tabindex:-1}},null,8,["icone"])):c.createCommentVNode("",!0),c.createElementVNode("span",Zn,c.toDisplayString(o.text),1)],8,Xn)]),_:1},8,["to"])}}}),Qn=c.defineComponent({__name:"ScrollToTop",setup(l){const o=c.ref(!1),h=`--${+new Date}`;let k=null;function U(){k==null||k.scrollTo(0,0)}return c.onMounted(()=>{var x;k=((x=document.getElementById(h))==null?void 0:x.parentElement)??null,k&&k.addEventListener("scroll",function(){o.value=this.scrollTop-this.clientHeight>0})}),(x,I)=>(c.openBlock(),c.createElementBlock("button",{id:h,class:c.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":o.value}]),onClick:U},null,2))}}),eo=c.defineComponent({__name:"Content",props:{class:{},style:{},disableBodyPadding:{type:Boolean},disableHeaderPadding:{type:Boolean},disableFooterPadding:{type:Boolean}},setup(l){const o=l;function h(){return new Oe("sf-content").AddClass(o.class,!!o.class).Build()}function k(){return new Oe("sf-content-body").AddClass("sf-content-no-padding",o.disableBodyPadding).Build()}function U(){return new Oe("sf-content-header").AddClass("sf-content-no-padding",o.disableHeaderPadding).Build()}function x(){return new Oe("sf-content-footer").AddClass("sf-content-no-padding",o.disableFooterPadding).Build()}return(I,O)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(h()),style:c.normalizeStyle(o.style)},[c.createElementVNode("div",{class:c.normalizeClass(U())},[c.renderSlot(I.$slots,"header")],2),c.createElementVNode("div",{class:c.normalizeClass(k())},[c.renderSlot(I.$slots,"default"),c.createVNode(Qn)],2),c.createElementVNode("div",{class:c.normalizeClass(x())},[c.renderSlot(I.$slots,"footer")],2)],6))}}),to={class:"sf-tab-navigation"},no=[c.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"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)],oo=["data-active"],ro=["href","onClick"],so=[c.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"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})],-1)],io=c.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(l){const o=l,h=c.ref(null),k=new ResizeObserver(p=>{O()}),U=c.ref(!1),x=c.ref(!1);function I(p=!1){const K=h.value.clientWidth;h.value.scrollLeft+=p?-K:K}function O(){const p=h.value.scrollWidth-h.value.clientWidth;U.value=h.value.scrollLeft>10,x.value=h.value.scrollLeft<p-10}return c.onMounted(()=>{h.value.addEventListener("scroll",O),k.observe(h.value)}),c.onBeforeUnmount(()=>{var p;try{(p=h.value)==null||p.removeEventListener("scroll",O),k.unobserve(h.value),k.disconnect()}catch{}}),(p,K)=>{const z=c.resolveComponent("RouterLink");return c.openBlock(),c.createElementBlock("div",to,[c.createElementVNode("div",{class:c.normalizeClass(["left-arrow",{active:U.value}]),onClick:K[0]||(K[0]=X=>I(!0))},no,2),c.createElementVNode("ul",{ref_key:"trackerContainer",ref:h},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.tabs,X=>(c.openBlock(),c.createBlock(z,{to:X.route,custom:!0},{default:c.withCtx(({navigate:ae,isActive:j})=>[c.createElementVNode("li",{"data-active":j},[c.renderSlot(p.$slots,"item",{item:X,navigate:ae,isActive:j},()=>[c.createElementVNode("a",{href:X.route,class:c.normalizeClass({active:j}),onClick:ae},c.toDisplayString(X.text),11,ro)])],8,oo)]),_:2},1032,["to"]))),256))],512),c.createElementVNode("div",{class:c.normalizeClass(["right-arrow",{active:x.value}]),onClick:K[1]||(K[1]=X=>I())},so,2)])}}});class ao{constructor(o=null){$e(this,"errors",[]);$e(this,"_value",null);this._value=o}get value(){return this._value}set value(o){this._value=o}get hasSuccess(){return!this.hasError}get hasError(){return this.errors.length>0}WithError(o){this.errors.push(o)}}const Ys="",Xs="";(()=>{function l(){c.nextTick(()=>{setTimeout(()=>{var h;const o=document.querySelector(":root");o&&o.style.setProperty("--window-height",`${((h=window.visualViewport)==null?void 0:h.height)??window.innerHeight}px`)},1)})}l(),window.addEventListener("resize",l)})(),tt.SetInitialTheme(),W.AppResult=ao,W.AuthService=ee,W.Cor=Ze,W.SfContent=eo,W.SfIcon=Ge,W.SfLayout=Yn,W.SfNavMenuLink=Gn,W.SfTabNavigation=io,W.Tamanho=Pe,W.UseDialogService=Ct,W.UseNavMenuService=Xe,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
|
|
80
80
|
//# sourceMappingURL=lib.umd.js.map
|