@luizleon/sf.prefeiturasp.vuecomponents 4.1.9 → 4.1.11

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.
@@ -1,7 +1,7 @@
1
1
  import { AxiosInstance, AxiosResponse } from 'axios';
2
2
  import { AppResult } from '../common/appResult';
3
3
  declare class ApiClient {
4
- constructor();
4
+ constructor(baseUrl?: string);
5
5
  private axios;
6
6
  private authService;
7
7
  /**
@@ -28,5 +28,12 @@ declare class ApiClient {
28
28
  HandleCatch<T>(e: any): AppResult<T>;
29
29
  private ParsedResponse;
30
30
  }
31
- declare const UseApiClient: () => ApiClient;
31
+ /**
32
+ * Retorna uma instância de ApiClient.
33
+ * Por padrão, a URL base é a URL onde a aplicação está hospedada + '/api'.
34
+ * Para alterar a URL base, passe a URL como parâmetro.
35
+ * @param baseURL
36
+ * @returns
37
+ */
38
+ declare const UseApiClient: (baseURL?: string) => ApiClient;
32
39
  export { ApiClient, UseApiClient };
@@ -1,4 +1,4 @@
1
- "use strict";var Ea=Object.defineProperty;var Ta=(t,e,n)=>e in t?Ea(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Se=(t,e,n)=>Ta(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue");class Aa{constructor(){Se(this,"_visible",l.ref(!1))}get IsVisible(){return this._visible.value===!0}Toggle(){this._visible.value=!this._visible.value}Close(){this._visible.value=!1}Open(){this._visible.value=!0}}const Pa=new Aa,Vr=()=>Pa;class tt{constructor(e){Se(this,"retorno");this.retorno=e??""}Concat(e){return e&&e.trim().length&&(this.retorno+=` ${e}`),this}AddClass(e,n=!0){return n?this.Concat(e):this}Build(){return this.retorno.trim()}}function Us(t=[]){let e="body > *:not(script):not(style)";for(const r of t)e+=`, ${r}`;const n=Math.max(...Array.from(document.querySelectorAll(e)).map(r=>{const o=getComputedStyle(r).zIndex;return+o==+o?+o:0}));return n>=100?n:100}let Ia=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");const Vn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},xa={},Oa={class:"sf-loading-circle"},La=l.createElementVNode("div",null,[l.createElementVNode("svg",{viewBox:"25 25 50 50"},[l.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})])],-1),$a=[La];function Ra(t,e){return l.openBlock(),l.createElementBlock("div",Oa,$a)}const Na=Vn(xa,[["render",Ra]]),jr=l.defineComponent({__name:"Tooltip",props:{text:{}},setup(t){const e=t;class n{constructor(){Se(this,"zIndex");Se(this,"wrapper");Se(this,"inner");this.zIndex=Us()+1,this.Render()}Render(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("sf-tooltip-wrapper"),this.wrapper.style.zIndex=`${this.zIndex??0}`,this.inner=document.createElement("div"),this.inner.classList.add("sf-tooltip-inner"),this.wrapper.appendChild(this.inner)}Show(s){this.inner.textContent=e.text;const i=s.target;document.body.appendChild(this.wrapper),this.Position(i.getBoundingClientRect()),this.wrapper.classList.add("visible")}Hide(){this.wrapper.classList.remove("visible"),this.wrapper.remove()}Position(s){this.FixWidth();const i=10,a=s.top,c=s.bottom,u=s.left,d=s.right,m=this.wrapper;m.style.top=`${c+i}px`,m.style.left=`${u}px`,this.OutOfBottom()&&(m.style.top=`${a-m.clientHeight-i}px`,m.classList.add("top")),this.OutOfRight()&&(m.style.left=`${d-m.clientWidth}px`,m.classList.add("left"))}FixWidth(){this.wrapper.style.width="fit-content",this.wrapper.style.wordBreak="normal",this.wrapper.style.whiteSpace="nowrap";const s=window.innerWidth/2;this.wrapper.clientWidth>s&&(this.wrapper.style.width=`${s}px`,this.wrapper.style.wordBreak="break-word",this.wrapper.style.whiteSpace="normal")}OutOfBottom(){return this.wrapper.getBoundingClientRect().bottom>(window.innerHeight||document.documentElement.clientHeight)}OutOfRight(){return this.wrapper.getBoundingClientRect().right>(window.innerWidth||document.documentElement.clientWidth)-10}}const r=new n;return l.onBeforeUnmount(()=>{r.Hide()}),(o,s)=>(l.openBlock(),l.createElementBlock("div",{class:"sf-tooltip-anchor",onMouseenter:s[0]||(s[0]=(...i)=>l.unref(r).Show&&l.unref(r).Show(...i)),onMouseleave:s[1]||(s[1]=(...i)=>l.unref(r).Hide&&l.unref(r).Hide(...i)),onMousedown:s[2]||(s[2]=(...i)=>l.unref(r).Hide&&l.unref(r).Hide(...i))},[l.renderSlot(o.$slots,"default")],32))}}),Ba=["disabled","tabindex"],Da=["data-color"],Ma=l.defineComponent({__name:"Icon",props:{icon:{},visible:{type:Boolean,default:!0},class:{default:""},style:{default:""},disabled:{type:Boolean},loading:{type:Boolean},button:{type:Boolean},size:{default:"md"},dot:{type:Boolean},dotColor:{default:"error"},filled:{type:Boolean},buttonProps:{},tooltip:{},color:{default:"inherit"}},setup(t){const e=t,n=l.computed(()=>e.tooltip?jr:"div"),r=l.computed(()=>new tt(e.tooltip?"":"display-content").AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).Build()),o=l.computed(()=>new tt(`${e.class} sf-icon`).AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).AddClass("sf-icon-button",e.button).AddClass("sf-icon-small",e.size==="sm").AddClass("sf-icon-medium",e.size==="md").AddClass("sf-icon-large",e.size==="lg").AddClass("sf-icon-xlarge",e.size==="xl").AddClass("sf-icon-2xlarge",e.size==="2xl").AddClass("sf-icon-3xlarge",e.size==="3xl").AddClass("sf-ripple",e.button===!0).AddClass(`${e.color}-color`,!!e.color&&e.color!=="inherit").Build());return(s,i)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.value),{text:e.tooltip,class:l.normalizeClass(r.value)},{default:l.withCtx(()=>[e.visible?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle(e.style),class:l.normalizeClass(o.value)},[l.createElementVNode("button",l.mergeProps({class:["material-symbols-outlined",{"icon-filled":!!e.filled}],disabled:e.disabled||e.loading},e.buttonProps,{tabindex:e.button?void 0:-1}),[e.loading?(l.openBlock(),l.createBlock(Na,{key:0})):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(e.icon),1)],64))],16,Ba),e.dot?(l.openBlock(),l.createElementBlock("span",{key:0,"data-color":e.dotColor},null,8,Da)):l.createCommentVNode("",!0)],6)):l.createCommentVNode("",!0)]),_:1},8,["text","class"]))}}),Ln=Vn(Ma,[["__scopeId","data-v-7ffc3790"]]),Ua=["id","onClick"],Ha={class:"sf-drawer-header"},Va={class:"sf-drawer-title"},ja={class:"sf-drawer-content"},Fa={key:0,class:"sf-drawer-footer"},Hs=l.defineComponent({__name:"Drawer",props:{visible:{type:Boolean,default:!1},position:{default:"left"},style:{}},emits:["update:visible","open","before-close"],setup(t,{emit:e}){const n=t,r=e,o=l.useSlots(),s=l.ref(n.visible),i=l.ref(!1),a=l.ref(0),c=Ia();function u(){s.value=!1}function d(w){(w.key==="Escape"||w.code==="Escape")&&u()}function m(){r("open"),window.document.addEventListener("keydown",d,!0)}function g(w){a.value=Us(),w.style.zIndex=`${a.value}`}function _(w){var B;r("before-close"),(B=w==null?void 0:w.parentElement)==null||B.classList.add("sf-mask-overlay-leave")}function v(){window.document.removeEventListener("keydown",d,!0),i.value=!1}function T(){return new tt("sf-mask sf-mask-overlay").AddClass("right",n.position==="right").AddClass("bottom",n.position==="bottom").AddClass("full",n.position==="full").AddClass("sf-mask-overlay-enter",n.visible===!0).Build()}return l.watch(()=>n.visible,w=>{s.value=w}),l.watch(()=>s.value,w=>{r("update:visible",w),w&&(i.value=!0)}),(w,B)=>(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[i.value?(l.openBlock(),l.createElementBlock("div",{key:0,id:l.unref(c),class:l.normalizeClass(T()),style:l.normalizeStyle({zIndex:a.value-1}),onClick:l.withModifiers(u,["stop"])},[l.createVNode(l.Transition,{name:"sf-drawer",appear:"",onBeforeEnter:g,onEnter:m,onBeforeLeave:_,onAfterLeave:v},{default:l.withCtx(()=>[s.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["sf-drawer",{"sf-drawer-with-footer":!!l.unref(o).footer}]),style:l.normalizeStyle(n.style),role:"dialog",onClick:B[0]||(B[0]=l.withModifiers(C=>w.void,["stop"]))},[l.createElementVNode("div",Ha,[l.createElementVNode("span",Va,[l.renderSlot(w.$slots,"title")]),l.createVNode(Ln,{button:!0,icon:"close",onClick:l.withModifiers(u,["stop"])},null,8,["onClick"])]),l.createElementVNode("div",ja,[l.renderSlot(w.$slots,"default")]),l.unref(o).footer?(l.openBlock(),l.createElementBlock("div",Fa,[l.renderSlot(w.$slots,"footer")])):l.createCommentVNode("",!0)],6)):l.createCommentVNode("",!0)]),_:3})],14,Ua)):l.createCommentVNode("",!0)]))}}),za=["id","name","disabled","data-color","form","type"],Ka={class:"sf-button-label"},Vs=l.defineComponent({__name:"Button",props:{icon:{},visible:{type:Boolean,default:!0},class:{},style:{},disabled:{type:Boolean},loading:{type:Boolean},color:{default:"primary"},size:{default:"md"},variant:{default:"filled"},autofocus:{type:Boolean},form:{},name:{},id:{},type:{default:"button"},value:{},iconFilled:{type:Boolean}},setup(t){const e=t;function n(){return new tt(`${e.class??""} sf-button`).AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).AddClass("sf-button-small",e.size==="sm").AddClass("sf-button-medium",e.size==="md").AddClass("sf-button-large",e.size==="lg").AddClass("sf-button-filled",e.variant==="filled").AddClass("sf-button-text",e.variant==="text").AddClass("sf-button-outlined",e.variant==="outlined").AddClass("sf-button-with-icon",!!e.icon).AddClass("sf-ripple").Build()}return(r,o)=>e.visible?(l.openBlock(),l.createElementBlock("button",{key:0,id:e.id,name:e.name,class:l.normalizeClass(n()),style:l.normalizeStyle(e.style),disabled:e.disabled||e.loading,"data-color":e.color,form:e.form,type:e.type},[e.icon?(l.openBlock(),l.createBlock(Ln,{key:0,icon:e.icon,loading:e.loading,size:e.size,color:void 0,"button-props":{tabindex:-1},filled:e.iconFilled},null,8,["icon","loading","size","filled"])):e.loading?(l.openBlock(),l.createBlock(Ln,{key:1,loading:!0,size:e.size,"button-props":{tabindex:-1}},null,8,["size"])):l.createCommentVNode("",!0),l.createElementVNode("span",Ka,[l.renderSlot(r.$slots,"default")])],14,za)):l.createCommentVNode("",!0)}}),js="SweetAlert2:",Wa=t=>{const e=[];for(let n=0;n<t.length;n++)e.indexOf(t[n])===-1&&e.push(t[n]);return e},Fr=t=>t.charAt(0).toUpperCase()+t.slice(1),Oe=t=>Array.prototype.slice.call(t),Ee=t=>{console.warn(`${js} ${typeof t=="object"?t.join(" "):t}`)},kt=t=>{console.error(`${js} ${t}`)},Ro=[],qa=t=>{Ro.includes(t)||(Ro.push(t),Ee(t))},Ga=(t,e)=>{qa(`"${t}" is deprecated and will be removed in the next major release. Please use "${e}" instead.`)},jn=t=>typeof t=="function"?t():t,zr=t=>t&&typeof t.toPromise=="function",fn=t=>zr(t)?t.toPromise():Promise.resolve(t),Kr=t=>t&&Promise.resolve(t)===t,It={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},Ya=["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"],Ja={},Xa=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Fs=t=>Object.prototype.hasOwnProperty.call(It,t),zs=t=>Ya.indexOf(t)!==-1,kr=t=>Ja[t],Za=t=>{Fs(t)||Ee(`Unknown parameter "${t}"`)},Qa=t=>{Xa.includes(t)&&Ee(`The parameter "${t}" is incompatible with toasts`)},el=t=>{kr(t)&&Ga(t,kr(t))},tl=t=>{!t.backdrop&&t.allowOutsideClick&&Ee('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const e in t)Za(e),t.toast&&Qa(e),el(e)},nl="swal2-",Ks=t=>{const e={};for(const n in t)e[t[n]]=nl+t[n];return e},b=Ks(["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"]),Xt=Ks(["success","warning","info","question","error"]),fe=()=>document.body.querySelector(`.${b.container}`),mn=t=>{const e=fe();return e?e.querySelector(t):null},Be=t=>mn(`.${t}`),Y=()=>Be(b.popup),pn=()=>Be(b.icon),Ws=()=>Be(b.title),$n=()=>Be(b["html-container"]),qs=()=>Be(b.image),Gs=()=>Be(b["progress-steps"]),Fn=()=>Be(b["validation-message"]),Ke=()=>mn(`.${b.actions} .${b.confirm}`),ut=()=>mn(`.${b.actions} .${b.deny}`),rl=()=>Be(b["input-label"]),$t=()=>mn(`.${b.loader}`),bt=()=>mn(`.${b.actions} .${b.cancel}`),hn=()=>Be(b.actions),Ys=()=>Be(b.footer),zn=()=>Be(b["timer-progress-bar"]),Wr=()=>Be(b.close),ol=`
1
+ "use strict";var Ea=Object.defineProperty;var Ta=(t,e,n)=>e in t?Ea(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Se=(t,e,n)=>Ta(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue");class Aa{constructor(){Se(this,"_visible",l.ref(!1))}get IsVisible(){return this._visible.value===!0}Toggle(){this._visible.value=!this._visible.value}Close(){this._visible.value=!1}Open(){this._visible.value=!0}}const Pa=new Aa,Vr=()=>Pa;class tt{constructor(e){Se(this,"retorno");this.retorno=e??""}Concat(e){return e&&e.trim().length&&(this.retorno+=` ${e}`),this}AddClass(e,n=!0){return n?this.Concat(e):this}Build(){return this.retorno.trim()}}function Us(t=[]){let e="body > *:not(script):not(style)";for(const r of t)e+=`, ${r}`;const n=Math.max(...Array.from(document.querySelectorAll(e)).map(r=>{const o=getComputedStyle(r).zIndex;return+o==+o?+o:0}));return n>=100?n:100}let Ia=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,n)=>(n&=63,n<36?e+=n.toString(36):n<62?e+=(n-26).toString(36).toUpperCase():n>62?e+="-":e+="_",e),"");const Vn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},xa={},Oa={class:"sf-loading-circle"},La=l.createElementVNode("div",null,[l.createElementVNode("svg",{viewBox:"25 25 50 50"},[l.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})])],-1),$a=[La];function Ra(t,e){return l.openBlock(),l.createElementBlock("div",Oa,$a)}const Na=Vn(xa,[["render",Ra]]),jr=l.defineComponent({__name:"Tooltip",props:{text:{}},setup(t){const e=t;class n{constructor(){Se(this,"zIndex");Se(this,"wrapper");Se(this,"inner");this.zIndex=Us()+1,this.Render()}Render(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("sf-tooltip-wrapper"),this.wrapper.style.zIndex=`${this.zIndex??0}`,this.inner=document.createElement("div"),this.inner.classList.add("sf-tooltip-inner"),this.wrapper.appendChild(this.inner)}Show(s){this.inner.textContent=e.text,document.body.appendChild(this.wrapper),this.Position(s),this.wrapper.classList.add("visible")}Hide(){this.wrapper.classList.remove("visible"),this.wrapper.remove()}Position(s){const a=s.currentTarget.getBoundingClientRect();this.FixWidth();const c=this.wrapper,u=10;c.style.top=`${a.bottom-u}px`,c.style.left=`${a.right-u}px`,this.OutOfBottom()&&(c.style.top=`${a.top-c.clientHeight+u}px`),this.OutOfRight()&&(c.style.left=`${a.left-c.clientWidth+u}px`)}FixWidth(){this.wrapper.style.width="fit-content",this.wrapper.style.wordBreak="normal",this.wrapper.style.whiteSpace="nowrap";const s=window.innerWidth/2;this.wrapper.clientWidth>s&&(this.wrapper.style.width=`${s}px`,this.wrapper.style.wordBreak="break-word",this.wrapper.style.whiteSpace="normal")}OutOfBottom(){return this.wrapper.getBoundingClientRect().bottom>(window.innerHeight||document.documentElement.clientHeight)}OutOfRight(){return this.wrapper.getBoundingClientRect().right>(window.innerWidth||document.documentElement.clientWidth)-10}}const r=new n;return l.onBeforeUnmount(()=>{r.Hide()}),(o,s)=>(l.openBlock(),l.createElementBlock("div",{class:"sf-tooltip-anchor",onMouseenter:s[0]||(s[0]=(...i)=>l.unref(r).Show&&l.unref(r).Show(...i)),onMouseleave:s[1]||(s[1]=(...i)=>l.unref(r).Hide&&l.unref(r).Hide(...i)),onMousedown:s[2]||(s[2]=(...i)=>l.unref(r).Hide&&l.unref(r).Hide(...i))},[l.renderSlot(o.$slots,"default")],32))}}),Ba=["disabled","tabindex"],Da=["data-color"],Ma=l.defineComponent({__name:"Icon",props:{icon:{},visible:{type:Boolean,default:!0},class:{default:""},style:{default:""},disabled:{type:Boolean},loading:{type:Boolean},button:{type:Boolean},size:{default:"md"},dot:{type:Boolean},dotColor:{default:"error"},filled:{type:Boolean},buttonProps:{},tooltip:{},color:{default:"inherit"}},setup(t){const e=t,n=l.computed(()=>e.tooltip?jr:"div"),r=l.computed(()=>new tt(e.tooltip?"":"display-content").AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).Build()),o=l.computed(()=>new tt(`${e.class} sf-icon`).AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).AddClass("sf-icon-button",e.button).AddClass("sf-icon-small",e.size==="sm").AddClass("sf-icon-medium",e.size==="md").AddClass("sf-icon-large",e.size==="lg").AddClass("sf-icon-xlarge",e.size==="xl").AddClass("sf-icon-2xlarge",e.size==="2xl").AddClass("sf-icon-3xlarge",e.size==="3xl").AddClass("sf-ripple",e.button===!0).AddClass(`${e.color}-color`,!!e.color&&e.color!=="inherit").Build());return(s,i)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.value),{text:e.tooltip,class:l.normalizeClass(r.value)},{default:l.withCtx(()=>[e.visible?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle(e.style),class:l.normalizeClass(o.value)},[l.createElementVNode("button",l.mergeProps({class:["material-symbols-outlined",{"icon-filled":!!e.filled}],disabled:e.disabled||e.loading},e.buttonProps,{tabindex:e.button?void 0:-1}),[e.loading?(l.openBlock(),l.createBlock(Na,{key:0})):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(e.icon),1)],64))],16,Ba),e.dot?(l.openBlock(),l.createElementBlock("span",{key:0,"data-color":e.dotColor},null,8,Da)):l.createCommentVNode("",!0)],6)):l.createCommentVNode("",!0)]),_:1},8,["text","class"]))}}),Ln=Vn(Ma,[["__scopeId","data-v-7ffc3790"]]),Ua=["id","onClick"],Ha={class:"sf-drawer-header"},Va={class:"sf-drawer-title"},ja={class:"sf-drawer-content"},Fa={key:0,class:"sf-drawer-footer"},Hs=l.defineComponent({__name:"Drawer",props:{visible:{type:Boolean,default:!1},position:{default:"left"},style:{}},emits:["update:visible","open","before-close"],setup(t,{emit:e}){const n=t,r=e,o=l.useSlots(),s=l.ref(n.visible),i=l.ref(!1),a=l.ref(0),c=Ia();function u(){s.value=!1}function d(w){(w.key==="Escape"||w.code==="Escape")&&u()}function m(){r("open"),window.document.addEventListener("keydown",d,!0)}function g(w){a.value=Us(),w.style.zIndex=`${a.value}`}function _(w){var B;r("before-close"),(B=w==null?void 0:w.parentElement)==null||B.classList.add("sf-mask-overlay-leave")}function v(){window.document.removeEventListener("keydown",d,!0),i.value=!1}function T(){return new tt("sf-mask sf-mask-overlay").AddClass("right",n.position==="right").AddClass("bottom",n.position==="bottom").AddClass("full",n.position==="full").AddClass("sf-mask-overlay-enter",n.visible===!0).Build()}return l.watch(()=>n.visible,w=>{s.value=w}),l.watch(()=>s.value,w=>{r("update:visible",w),w&&(i.value=!0)}),(w,B)=>(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[i.value?(l.openBlock(),l.createElementBlock("div",{key:0,id:l.unref(c),class:l.normalizeClass(T()),style:l.normalizeStyle({zIndex:a.value-1}),onClick:l.withModifiers(u,["stop"])},[l.createVNode(l.Transition,{name:"sf-drawer",appear:"",onBeforeEnter:g,onEnter:m,onBeforeLeave:_,onAfterLeave:v},{default:l.withCtx(()=>[s.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["sf-drawer",{"sf-drawer-with-footer":!!l.unref(o).footer}]),style:l.normalizeStyle(n.style),role:"dialog",onClick:B[0]||(B[0]=l.withModifiers(C=>w.void,["stop"]))},[l.createElementVNode("div",Ha,[l.createElementVNode("span",Va,[l.renderSlot(w.$slots,"title")]),l.createVNode(Ln,{button:!0,icon:"close",onClick:l.withModifiers(u,["stop"])},null,8,["onClick"])]),l.createElementVNode("div",ja,[l.renderSlot(w.$slots,"default")]),l.unref(o).footer?(l.openBlock(),l.createElementBlock("div",Fa,[l.renderSlot(w.$slots,"footer")])):l.createCommentVNode("",!0)],6)):l.createCommentVNode("",!0)]),_:3})],14,Ua)):l.createCommentVNode("",!0)]))}}),za=["id","name","disabled","data-color","form","type"],Ka={class:"sf-button-label"},Vs=l.defineComponent({__name:"Button",props:{icon:{},visible:{type:Boolean,default:!0},class:{},style:{},disabled:{type:Boolean},loading:{type:Boolean},color:{default:"primary"},size:{default:"md"},variant:{default:"filled"},autofocus:{type:Boolean},form:{},name:{},id:{},type:{default:"button"},value:{},iconFilled:{type:Boolean}},setup(t){const e=t;function n(){return new tt(`${e.class??""} sf-button`).AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).AddClass("sf-button-small",e.size==="sm").AddClass("sf-button-medium",e.size==="md").AddClass("sf-button-large",e.size==="lg").AddClass("sf-button-filled",e.variant==="filled").AddClass("sf-button-text",e.variant==="text").AddClass("sf-button-outlined",e.variant==="outlined").AddClass("sf-button-with-icon",!!e.icon).AddClass("sf-ripple").Build()}return(r,o)=>e.visible?(l.openBlock(),l.createElementBlock("button",{key:0,id:e.id,name:e.name,class:l.normalizeClass(n()),style:l.normalizeStyle(e.style),disabled:e.disabled||e.loading,"data-color":e.color,form:e.form,type:e.type},[e.icon?(l.openBlock(),l.createBlock(Ln,{key:0,icon:e.icon,loading:e.loading,size:e.size,color:void 0,"button-props":{tabindex:-1},filled:e.iconFilled},null,8,["icon","loading","size","filled"])):e.loading?(l.openBlock(),l.createBlock(Ln,{key:1,loading:!0,size:e.size,"button-props":{tabindex:-1}},null,8,["size"])):l.createCommentVNode("",!0),l.createElementVNode("span",Ka,[l.renderSlot(r.$slots,"default")])],14,za)):l.createCommentVNode("",!0)}}),js="SweetAlert2:",Wa=t=>{const e=[];for(let n=0;n<t.length;n++)e.indexOf(t[n])===-1&&e.push(t[n]);return e},Fr=t=>t.charAt(0).toUpperCase()+t.slice(1),Oe=t=>Array.prototype.slice.call(t),Ee=t=>{console.warn(`${js} ${typeof t=="object"?t.join(" "):t}`)},kt=t=>{console.error(`${js} ${t}`)},Ro=[],qa=t=>{Ro.includes(t)||(Ro.push(t),Ee(t))},Ga=(t,e)=>{qa(`"${t}" is deprecated and will be removed in the next major release. Please use "${e}" instead.`)},jn=t=>typeof t=="function"?t():t,zr=t=>t&&typeof t.toPromise=="function",fn=t=>zr(t)?t.toPromise():Promise.resolve(t),Kr=t=>t&&Promise.resolve(t)===t,It={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"&times;",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},Ya=["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"],Ja={},Xa=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Fs=t=>Object.prototype.hasOwnProperty.call(It,t),zs=t=>Ya.indexOf(t)!==-1,kr=t=>Ja[t],Za=t=>{Fs(t)||Ee(`Unknown parameter "${t}"`)},Qa=t=>{Xa.includes(t)&&Ee(`The parameter "${t}" is incompatible with toasts`)},el=t=>{kr(t)&&Ga(t,kr(t))},tl=t=>{!t.backdrop&&t.allowOutsideClick&&Ee('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const e in t)Za(e),t.toast&&Qa(e),el(e)},nl="swal2-",Ks=t=>{const e={};for(const n in t)e[t[n]]=nl+t[n];return e},b=Ks(["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"]),Xt=Ks(["success","warning","info","question","error"]),fe=()=>document.body.querySelector(`.${b.container}`),mn=t=>{const e=fe();return e?e.querySelector(t):null},Be=t=>mn(`.${t}`),Y=()=>Be(b.popup),pn=()=>Be(b.icon),Ws=()=>Be(b.title),$n=()=>Be(b["html-container"]),qs=()=>Be(b.image),Gs=()=>Be(b["progress-steps"]),Fn=()=>Be(b["validation-message"]),Ke=()=>mn(`.${b.actions} .${b.confirm}`),ut=()=>mn(`.${b.actions} .${b.deny}`),rl=()=>Be(b["input-label"]),$t=()=>mn(`.${b.loader}`),bt=()=>mn(`.${b.actions} .${b.cancel}`),hn=()=>Be(b.actions),Ys=()=>Be(b.footer),zn=()=>Be(b["timer-progress-bar"]),Wr=()=>Be(b.close),ol=`
2
2
  a[href],
3
3
  area[href],
4
4
  input:not([disabled]),
@@ -412,5 +412,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
412
412
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[xs]=this[xs]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Wt(i);r[a]||(sh(o,i),r[a]=!0)}return y.isArray(e)?e.forEach(s):s(e),this}}Ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);y.reduceDescriptors(Ce.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});y.freezeMethods(Ce);function Sr(t,e){const n=this||bn,r=e||n,o=Ce.from(r.headers);let s=r.data;return y.forEach(t,function(a){s=a.call(n,s,o.normalize(),e?e.status:void 0)}),o.normalize(),s}function oa(t){return!!(t&&t.__CANCEL__)}function Dt(t,e,n){M.call(this,t??"canceled",M.ERR_CANCELED,e,n),this.name="CanceledError"}y.inherits(Dt,M,{__CANCEL__:!0});function sa(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new M("Request failed with status code "+n.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ih(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ah(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,s=0,i;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=r[s];i||(i=u),n[o]=c,r[o]=u;let m=s,g=0;for(;m!==o;)g+=n[m++],m=m%t;if(o=(o+1)%t,o===s&&(s=(s+1)%t),u-i<e)return;const _=d&&u-d;return _?Math.round(g*1e3/_):void 0}}function lh(t,e){let n=0,r=1e3/e,o,s;const i=(u,d=Date.now())=>{n=d,o=null,s&&(clearTimeout(s),s=null),t.apply(null,u)};return[(...u)=>{const d=Date.now(),m=d-n;m>=r?i(u,d):(o=u,s||(s=setTimeout(()=>{s=null,i(o)},r-m)))},()=>o&&i(o)]}const Mn=(t,e,n=3)=>{let r=0;const o=ah(50,250);return lh(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,c=i-r,u=o(c),d=i<=a;r=i;const m={loaded:i,total:a,progress:a?i/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-i)/u:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(m)},n)},Os=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Ls=t=>(...e)=>y.asap(()=>t(...e)),ch=ze.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(s){let i=s;return e&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(i){const a=y.isString(i)?o(i):i;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),uh=ze.hasStandardBrowserEnv?{write(t,e,n,r,o,s){const i=[t+"="+encodeURIComponent(e)];y.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),y.isString(r)&&i.push("path="+r),y.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function dh(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function fh(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ia(t,e){return t&&!dh(e)?fh(t,e):e}const $s=t=>t instanceof Ce?{...t}:t;function _t(t,e){e=e||{};const n={};function r(u,d,m){return y.isPlainObject(u)&&y.isPlainObject(d)?y.merge.call({caseless:m},u,d):y.isPlainObject(d)?y.merge({},d):y.isArray(d)?d.slice():d}function o(u,d,m){if(y.isUndefined(d)){if(!y.isUndefined(u))return r(void 0,u,m)}else return r(u,d,m)}function s(u,d){if(!y.isUndefined(d))return r(void 0,d)}function i(u,d){if(y.isUndefined(d)){if(!y.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function a(u,d,m){if(m in e)return r(u,d);if(m in t)return r(void 0,u)}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,d)=>o($s(u),$s(d),!0)};return y.forEach(Object.keys(Object.assign({},t,e)),function(d){const m=c[d]||o,g=m(t[d],e[d],d);y.isUndefined(g)&&m!==a||(n[d]=g)}),n}const aa=t=>{const e=_t({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=e;e.headers=i=Ce.from(i),e.url=ta(ia(e.baseURL,e.url),t.params,t.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(y.isFormData(n)){if(ze.hasStandardBrowserEnv||ze.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((c=i.getContentType())!==!1){const[u,...d]=c?c.split(";").map(m=>m.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...d].join("; "))}}if(ze.hasStandardBrowserEnv&&(r&&y.isFunction(r)&&(r=r(e)),r||r!==!1&&ch(e.url))){const u=o&&s&&uh.read(s);u&&i.set(o,u)}return e},mh=typeof XMLHttpRequest<"u",ph=mh&&function(t){return new Promise(function(n,r){const o=aa(t);let s=o.data;const i=Ce.from(o.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=o,d,m,g,_,v;function T(){_&&_(),v&&v(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function B(){if(!w)return;const A=Ce.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),X={data:!a||a==="text"||a==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:A,config:t,request:w};sa(function(J){n(J),T()},function(J){r(J),T()},X),w=null}"onloadend"in w?w.onloadend=B:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(B)},w.onabort=function(){w&&(r(new M("Request aborted",M.ECONNABORTED,t,w)),w=null)},w.onerror=function(){r(new M("Network Error",M.ERR_NETWORK,t,w)),w=null},w.ontimeout=function(){let j=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const X=o.transitional||na;o.timeoutErrorMessage&&(j=o.timeoutErrorMessage),r(new M(j,X.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,t,w)),w=null},s===void 0&&i.setContentType(null),"setRequestHeader"in w&&y.forEach(i.toJSON(),function(j,X){w.setRequestHeader(X,j)}),y.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),a&&a!=="json"&&(w.responseType=o.responseType),u&&([g,v]=Mn(u,!0),w.addEventListener("progress",g)),c&&w.upload&&([m,_]=Mn(c),w.upload.addEventListener("progress",m),w.upload.addEventListener("loadend",_)),(o.cancelToken||o.signal)&&(d=A=>{w&&(r(!A||A.type?new Dt(null,t,w):A),w.abort(),w=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const C=ih(o.url);if(C&&ze.protocols.indexOf(C)===-1){r(new M("Unsupported protocol "+C+":",M.ERR_BAD_REQUEST,t));return}w.send(s||null)})},hh=(t,e)=>{let n=new AbortController,r;const o=function(c){if(!r){r=!0,i();const u=c instanceof Error?c:this.reason;n.abort(u instanceof M?u:new Dt(u instanceof Error?u.message:u))}};let s=e&&setTimeout(()=>{o(new M(`timeout ${e} of ms exceeded`,M.ETIMEDOUT))},e);const i=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(c=>{c&&(c.removeEventListener?c.removeEventListener("abort",o):c.unsubscribe(o))}),t=null)};t.forEach(c=>c&&c.addEventListener&&c.addEventListener("abort",o));const{signal:a}=n;return a.unsubscribe=i,[a,()=>{s&&clearTimeout(s),s=null}]},gh=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let r=0,o;for(;r<n;)o=r+e,yield t.slice(r,o),r=o},yh=async function*(t,e,n){for await(const r of t)yield*gh(ArrayBuffer.isView(r)?r:await n(String(r)),e)},Rs=(t,e,n,r,o)=>{const s=yh(t,e,o);let i=0,a,c=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:d,value:m}=await s.next();if(d){c(),u.close();return}let g=m.byteLength;if(n){let _=i+=g;n(_)}u.enqueue(new Uint8Array(m))}catch(d){throw c(d),d}},cancel(u){return c(u),s.return()}},{highWaterMark:2})},Qn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",la=Qn&&typeof ReadableStream=="function",Br=Qn&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),ca=(t,...e)=>{try{return!!t(...e)}catch{return!1}},vh=la&&ca(()=>{let t=!1;const e=new Request(ze.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ns=64*1024,Dr=la&&ca(()=>y.isReadableStream(new Response("").body)),Un={stream:Dr&&(t=>t.body)};Qn&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Un[e]&&(Un[e]=y.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new M(`Response type '${e}' is not supported`,M.ERR_NOT_SUPPORT,r)})})})(new Response);const bh=async t=>{if(t==null)return 0;if(y.isBlob(t))return t.size;if(y.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(y.isArrayBufferView(t)||y.isArrayBuffer(t))return t.byteLength;if(y.isURLSearchParams(t)&&(t=t+""),y.isString(t))return(await Br(t)).byteLength},wh=async(t,e)=>{const n=y.toFiniteNumber(t.getContentLength());return n??bh(e)},Sh=Qn&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:c,responseType:u,headers:d,withCredentials:m="same-origin",fetchOptions:g}=aa(t);u=u?(u+"").toLowerCase():"text";let[_,v]=o||s||i?hh([o,s],i):[],T,w;const B=()=>{!T&&setTimeout(()=>{_&&_.unsubscribe()}),T=!0};let C;try{if(c&&vh&&n!=="get"&&n!=="head"&&(C=await wh(d,r))!==0){let ne=new Request(e,{method:"POST",body:r,duplex:"half"}),J;if(y.isFormData(r)&&(J=ne.headers.get("content-type"))&&d.setContentType(J),ne.body){const[pe,se]=Os(C,Mn(Ls(c)));r=Rs(ne.body,Ns,pe,se,Br)}}y.isString(m)||(m=m?"include":"omit"),w=new Request(e,{...g,signal:_,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:m});let A=await fetch(w);const j=Dr&&(u==="stream"||u==="response");if(Dr&&(a||j)){const ne={};["status","statusText","headers"].forEach(U=>{ne[U]=A[U]});const J=y.toFiniteNumber(A.headers.get("content-length")),[pe,se]=a&&Os(J,Mn(Ls(a),!0))||[];A=new Response(Rs(A.body,Ns,pe,()=>{se&&se(),j&&B()},Br),ne)}u=u||"text";let X=await Un[y.findKey(Un,u)||"text"](A,t);return!j&&B(),v&&v(),await new Promise((ne,J)=>{sa(ne,J,{data:X,headers:Ce.from(A.headers),status:A.status,statusText:A.statusText,config:t,request:w})})}catch(A){throw B(),A&&A.name==="TypeError"&&/fetch/i.test(A.message)?Object.assign(new M("Network Error",M.ERR_NETWORK,t,w),{cause:A.cause||A}):M.from(A,A&&A.code,t,w)}}),Mr={http:Mp,xhr:ph,fetch:Sh};y.forEach(Mr,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Bs=t=>`- ${t}`,_h=t=>y.isFunction(t)||t===null||t===!1,ua={getAdapter:t=>{t=y.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let s=0;s<e;s++){n=t[s];let i;if(r=n,!_h(n)&&(r=Mr[(i=String(n)).toLowerCase()],r===void 0))throw new M(`Unknown adapter '${i}'`);if(r)break;o[i||"#"+s]=r}if(!r){const s=Object.entries(o).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let i=e?s.length>1?`since :
413
413
  `+s.map(Bs).join(`
414
414
  `):" "+Bs(s[0]):"as no adapter specified";throw new M("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Mr};function _r(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Dt(null,t)}function Ds(t){return _r(t),t.headers=Ce.from(t.headers),t.data=Sr.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),ua.getAdapter(t.adapter||bn.adapter)(t).then(function(r){return _r(t),r.data=Sr.call(t,t.transformResponse,r),r.headers=Ce.from(r.headers),r},function(r){return oa(r)||(_r(t),r&&r.response&&(r.response.data=Sr.call(t,t.transformResponse,r.response),r.response.headers=Ce.from(r.response.headers))),Promise.reject(r)})}const da="1.7.4",fo={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{fo[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Ms={};fo.transitional=function(e,n,r){function o(s,i){return"[Axios v"+da+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(e===!1)throw new M(o(i," has been removed"+(n?" in "+n:"")),M.ERR_DEPRECATED);return n&&!Ms[i]&&(Ms[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,i,a):!0}};function kh(t,e,n){if(typeof t!="object")throw new M("options must be an object",M.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const s=r[o],i=e[s];if(i){const a=t[s],c=a===void 0||i(a,s,t);if(c!==!0)throw new M("option "+s+" must be "+c,M.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new M("Unknown option "+s,M.ERR_BAD_OPTION)}}const Ur={assertOptions:kh,validators:fo},at=Ur.validators;class vt{constructor(e){this.defaults=e,this.interceptors={request:new Is,response:new Is}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
415
- `+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=_t(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Ur.assertOptions(r,{silentJSONParsing:at.transitional(at.boolean),forcedJSONParsing:at.transitional(at.boolean),clarifyTimeoutError:at.transitional(at.boolean)},!1),o!=null&&(y.isFunction(o)?n.paramsSerializer={serialize:o}:Ur.assertOptions(o,{encode:at.function,serialize:at.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&y.merge(s.common,s[n.method]);s&&y.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=Ce.concat(i,s);const a=[];let c=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(c=c&&T.synchronous,a.unshift(T.fulfilled,T.rejected))});const u=[];this.interceptors.response.forEach(function(T){u.push(T.fulfilled,T.rejected)});let d,m=0,g;if(!c){const v=[Ds.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,u),g=v.length,d=Promise.resolve(n);m<g;)d=d.then(v[m++],v[m++]);return d}g=a.length;let _=n;for(m=0;m<g;){const v=a[m++],T=a[m++];try{_=v(_)}catch(w){T.call(this,w);break}}try{d=Ds.call(this,_)}catch(v){return Promise.reject(v)}for(m=0,g=u.length;m<g;)d=d.then(u[m++],u[m++]);return d}getUri(e){e=_t(this.defaults,e);const n=ia(e.baseURL,e.url);return ta(n,e.params,e.paramsSerializer)}}y.forEach(["delete","get","head","options"],function(e){vt.prototype[e]=function(n,r){return this.request(_t(r||{},{method:e,url:n,data:(r||{}).data}))}});y.forEach(["post","put","patch"],function(e){function n(r){return function(s,i,a){return this.request(_t(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}vt.prototype[e]=n(),vt.prototype[e+"Form"]=n(!0)});class mo{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},e(function(s,i,a){r.reason||(r.reason=new Dt(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new mo(function(o){e=o}),cancel:e}}}function Ch(t){return function(n){return t.apply(null,n)}}function Eh(t){return y.isObject(t)&&t.isAxiosError===!0}const Hr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Hr).forEach(([t,e])=>{Hr[e]=t});function fa(t){const e=new vt(t),n=Fi(vt.prototype.request,e);return y.extend(n,vt.prototype,e,{allOwnKeys:!0}),y.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return fa(_t(t,o))},n}const re=fa(bn);re.Axios=vt;re.CanceledError=Dt;re.CancelToken=mo;re.isCancel=oa;re.VERSION=da;re.toFormData=Zn;re.AxiosError=M;re.Cancel=re.CanceledError;re.all=function(e){return Promise.all(e)};re.spread=Ch;re.isAxiosError=Eh;re.mergeConfig=_t;re.AxiosHeaders=Ce;re.formToJSON=t=>ra(y.isHTMLForm(t)?new FormData(t):t);re.getAdapter=ua.getAdapter;re.HttpStatusCode=Hr;re.default=re;class ma{constructor(e,n){Se(this,"keycloak");Se(this,"axios");Se(this,"fileName","silent-login.html");this.keycloak=e,this.axios=re.create(),this.axios.defaults.baseURL=n,this.axios.defaults.headers.common["content-type"]="application/json",this.axios.defaults.timeout=1e3*60*5,this.axios.interceptors.request.use(async r=>{await this.SilentLogin();const o=this.keycloak.token;return r.headers.Authorization=`Bearer ${o}`,r})}ParseAppResult(e){try{const n=typeof e.hasSuccess=="boolean",r=typeof e.hasError=="boolean",o=typeof e.httpStatusCode=="number",s=Array.isArray(e.errors);return n&&r&&o&&s?e:null}catch{return null}}HandleThen(e){const n=new un,r=this.ParseAppResult(e.data);return r===null?(n.value=e.data,n):r.hasError?(r.errors.forEach(o=>n.WithError(o)),n.httpStatusCode=r.httpStatusCode,n):(n.value=e.data.value,n)}HandleCatch(e){var o;const n=new un,r=this.ParseAppResult((o=e.response)==null?void 0:o.data);return r===null?n.WithError(e.message):(n.WithErrors(r.errors),n.httpStatusCode=r.httpStatusCode),n}async SilentLogin(){return new Promise(async e=>{if(!this.isTokenExpired){e(!0);return}const n=this.GenerateIframe(),r=o=>{if(document.body.removeChild(n),window.removeEventListener("message",r),o.origin!==location.origin){e(!1);return}const s=o.data.action,i=o.data.code,a=o.data.state,c=o.data.error;if(s!=="silent-login-iframe-result"||c==="login_required"||!i){e(!1);return}const u=new XMLHttpRequest;u.open("POST",this.tokenExchangeUrl,!0),u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),u.onreadystatechange=()=>{if(u.readyState===4){if(u.status===200){const d=JSON.parse(u.responseText);this.keycloak.setToken(d.access_token,null,d.id_token,new Date().getTime()),e(!0);return}e(!1)}},u.send(this.TokenExchangeParams(i,a))};window.addEventListener("message",r)}).then(e=>(e||(this.keycloak.clearToken(),this.keycloak.login()),e))}GetCodeVerifierFromState(e){const n=`kc-callback-${e}`,r=localStorage.getItem(n);if(r)return localStorage.removeItem(n),JSON.parse(r).pkceCodeVerifier}TokenExchangeParams(e,n){let r=`code=${e}&grant_type=authorization_code`;return r+=`&client_id=${encodeURIComponent(this.keycloak.clientId)}`,r+=`&redirect_uri=${this.silentLoginRedirectUrl}`,r+=`&code_verifier=${this.GetCodeVerifierFromState(n)}`,r}GenerateIframe(){const e=document.createElement("iframe");return e.src=this.keycloak.createLoginUrl({prompt:"none",redirectUri:this.silentLoginRedirectUrl})??"",document.body.appendChild(e),e}get silentLoginRedirectUrl(){return`${location.origin}/${this.fileName}`}get tokenExchangeUrl(){return`${this.keycloak.authServerUrl}/realms/${this.keycloak.realm}/protocol/openid-connect/token`}get isTokenExpired(){const e=this.keycloak.tokenParsed,n=e?e.exp:null;return!e||!n?!0:n-Math.ceil(new Date().getTime()/1e3)+(this.keycloak.timeSkew??0)<10}}const Th=(t,e)=>new ma(t,e);class pa{constructor(){Se(this,"axios");Se(this,"authService",no());this.axios=re.create(),this.axios.defaults.baseURL=window.location.origin+"/api",this.axios.defaults.headers.common["content-type"]="application/json",this.axios.defaults.timeout=1e3*60*5,this.axios.interceptors.request.use(async e=>{const n=await this.GetAccessToken();return e.headers.Authorization=n?`Bearer ${n}`:void 0,e})}GetAxios(e=!0){return e?this.axios:re.create()}async GetAccessToken(){return await this.authService.Instance.getAccessTokenAsync()}async GetAsync(e){return this.GetAxios().get(e).then(n=>this.HandleThen(n)).catch(n=>this.HandleCatch(n))}async PostAsync(e,n){return this.GetAxios().post(e,n).then(r=>this.HandleThen(r)).catch(r=>this.HandleCatch(r))}async PutAsync(e,n){return this.GetAxios().put(e,n).then(r=>this.HandleThen(r)).catch(r=>this.HandleCatch(r))}async DeleteAsync(e){return this.GetAxios().delete(e).then(n=>this.HandleThen(n)).catch(n=>this.HandleCatch(n))}HandleThen(e){const n=new un,r=this.ParsedResponse(e.data);return r===null?(n.httpStatusCode=e.status,n.value=e.data,n):(n.httpStatusCode=r.httpStatusCode,r.hasError?(n.WithErrors(r.errors),n):(n.value=r.value,n))}HandleCatch(e){var o;const n=new un,r=this.ParsedResponse((o=e.response)==null?void 0:o.data);return r===null?(n.WithError(e.message),n):(n.httpStatusCode=r.httpStatusCode,n.WithErrors(r.errors),n)}ParsedResponse(e){try{const n=typeof e.hasSuccess=="boolean",r=typeof e.hasError=="boolean",o=typeof e.httpStatusCode=="number",s=Array.isArray(e.errors);return n&&r&&o&&s?e:null}catch{return null}}}const Ah=()=>new pa;class Hn{static get IsTouch(){return window.matchMedia("(pointer: coarse)").matches}static GetMaxZindex(e=[]){let n="body > *:not(script):not(style)";for(const o of e)n+=`, ${o}`;const r=Math.max(...Array.from(document.querySelectorAll(n)).map(o=>{const s=getComputedStyle(o).zIndex;return+s==+s?+s:0}));return r>=100?r:100}static AjustarFuso(e){const n=e.getTimezoneOffset()/60;e.setHours(e.getHours()-n)}static Mask(e,n){let r=0,o=e.toString();return n.replace(/#/g,()=>o[r++]||"")}static MaskCpf(e){return Hn.Mask(e.padStart(11,"0"),"###.###.###-##")}static MaskCnpj(e){return Hn.Mask(e.padStart(14,"0"),"##.###.###/####-##")}static async DelayAsync(e){return new Promise(n=>setTimeout(n,e))}}function Ph(){document.documentElement.classList.add("app-mounted")}function ha(){St.SetInitialTheme()}function Ih(){St.Toggle()}function xh(){St.EnableDarkMode()}function Oh(){St.EnableLightMode()}function Lh(){St.ClearStoredTheme()}ha();exports.ApiClient=pa;exports.AppResult=un;exports.AxiosClient=ma;exports.ClearStoredTheme=Lh;exports.EnableDarkMode=xh;exports.EnableLightMode=Oh;exports.Keycloak=to;exports.RemovePreloader=Ph;exports.SetInitialTheme=ha;exports.SfButton=Vs;exports.SfContent=Fd;exports.SfDrawer=Hs;exports.SfIcon=Ln;exports.SfLayout=Vd;exports.SfMessage=Qd;exports.SfNavMenu=Zm;exports.SfTabNavigation=Xd;exports.SfTooltip=jr;exports.StartAuthService=wd;exports.ToggleTheme=Ih;exports.UseAlertService=nd;exports.UseApiClient=Ah;exports.UseAuthService=no;exports.UseAxiosClient=Th;exports.UseConfirmService=Ei;exports.UseNavMenuService=Vr;exports.Utilities=Hn;
415
+ `+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=_t(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Ur.assertOptions(r,{silentJSONParsing:at.transitional(at.boolean),forcedJSONParsing:at.transitional(at.boolean),clarifyTimeoutError:at.transitional(at.boolean)},!1),o!=null&&(y.isFunction(o)?n.paramsSerializer={serialize:o}:Ur.assertOptions(o,{encode:at.function,serialize:at.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&y.merge(s.common,s[n.method]);s&&y.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),n.headers=Ce.concat(i,s);const a=[];let c=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(c=c&&T.synchronous,a.unshift(T.fulfilled,T.rejected))});const u=[];this.interceptors.response.forEach(function(T){u.push(T.fulfilled,T.rejected)});let d,m=0,g;if(!c){const v=[Ds.bind(this),void 0];for(v.unshift.apply(v,a),v.push.apply(v,u),g=v.length,d=Promise.resolve(n);m<g;)d=d.then(v[m++],v[m++]);return d}g=a.length;let _=n;for(m=0;m<g;){const v=a[m++],T=a[m++];try{_=v(_)}catch(w){T.call(this,w);break}}try{d=Ds.call(this,_)}catch(v){return Promise.reject(v)}for(m=0,g=u.length;m<g;)d=d.then(u[m++],u[m++]);return d}getUri(e){e=_t(this.defaults,e);const n=ia(e.baseURL,e.url);return ta(n,e.params,e.paramsSerializer)}}y.forEach(["delete","get","head","options"],function(e){vt.prototype[e]=function(n,r){return this.request(_t(r||{},{method:e,url:n,data:(r||{}).data}))}});y.forEach(["post","put","patch"],function(e){function n(r){return function(s,i,a){return this.request(_t(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}vt.prototype[e]=n(),vt.prototype[e+"Form"]=n(!0)});class mo{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},e(function(s,i,a){r.reason||(r.reason=new Dt(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new mo(function(o){e=o}),cancel:e}}}function Ch(t){return function(n){return t.apply(null,n)}}function Eh(t){return y.isObject(t)&&t.isAxiosError===!0}const Hr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Hr).forEach(([t,e])=>{Hr[e]=t});function fa(t){const e=new vt(t),n=Fi(vt.prototype.request,e);return y.extend(n,vt.prototype,e,{allOwnKeys:!0}),y.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return fa(_t(t,o))},n}const re=fa(bn);re.Axios=vt;re.CanceledError=Dt;re.CancelToken=mo;re.isCancel=oa;re.VERSION=da;re.toFormData=Zn;re.AxiosError=M;re.Cancel=re.CanceledError;re.all=function(e){return Promise.all(e)};re.spread=Ch;re.isAxiosError=Eh;re.mergeConfig=_t;re.AxiosHeaders=Ce;re.formToJSON=t=>ra(y.isHTMLForm(t)?new FormData(t):t);re.getAdapter=ua.getAdapter;re.HttpStatusCode=Hr;re.default=re;class ma{constructor(e,n){Se(this,"keycloak");Se(this,"axios");Se(this,"fileName","silent-login.html");this.keycloak=e,this.axios=re.create(),this.axios.defaults.baseURL=n,this.axios.defaults.headers.common["content-type"]="application/json",this.axios.defaults.timeout=1e3*60*5,this.axios.interceptors.request.use(async r=>{await this.SilentLogin();const o=this.keycloak.token;return r.headers.Authorization=`Bearer ${o}`,r})}ParseAppResult(e){try{const n=typeof e.hasSuccess=="boolean",r=typeof e.hasError=="boolean",o=typeof e.httpStatusCode=="number",s=Array.isArray(e.errors);return n&&r&&o&&s?e:null}catch{return null}}HandleThen(e){const n=new un,r=this.ParseAppResult(e.data);return r===null?(n.value=e.data,n):r.hasError?(r.errors.forEach(o=>n.WithError(o)),n.httpStatusCode=r.httpStatusCode,n):(n.value=e.data.value,n)}HandleCatch(e){var o;const n=new un,r=this.ParseAppResult((o=e.response)==null?void 0:o.data);return r===null?n.WithError(e.message):(n.WithErrors(r.errors),n.httpStatusCode=r.httpStatusCode),n}async SilentLogin(){return new Promise(async e=>{if(!this.isTokenExpired){e(!0);return}const n=this.GenerateIframe(),r=o=>{if(document.body.removeChild(n),window.removeEventListener("message",r),o.origin!==location.origin){e(!1);return}const s=o.data.action,i=o.data.code,a=o.data.state,c=o.data.error;if(s!=="silent-login-iframe-result"||c==="login_required"||!i){e(!1);return}const u=new XMLHttpRequest;u.open("POST",this.tokenExchangeUrl,!0),u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),u.onreadystatechange=()=>{if(u.readyState===4){if(u.status===200){const d=JSON.parse(u.responseText);this.keycloak.setToken(d.access_token,null,d.id_token,new Date().getTime()),e(!0);return}e(!1)}},u.send(this.TokenExchangeParams(i,a))};window.addEventListener("message",r)}).then(e=>(e||(this.keycloak.clearToken(),this.keycloak.login()),e))}GetCodeVerifierFromState(e){const n=`kc-callback-${e}`,r=localStorage.getItem(n);if(r)return localStorage.removeItem(n),JSON.parse(r).pkceCodeVerifier}TokenExchangeParams(e,n){let r=`code=${e}&grant_type=authorization_code`;return r+=`&client_id=${encodeURIComponent(this.keycloak.clientId)}`,r+=`&redirect_uri=${this.silentLoginRedirectUrl}`,r+=`&code_verifier=${this.GetCodeVerifierFromState(n)}`,r}GenerateIframe(){const e=document.createElement("iframe");return e.src=this.keycloak.createLoginUrl({prompt:"none",redirectUri:this.silentLoginRedirectUrl})??"",document.body.appendChild(e),e}get silentLoginRedirectUrl(){return`${location.origin}/${this.fileName}`}get tokenExchangeUrl(){return`${this.keycloak.authServerUrl}/realms/${this.keycloak.realm}/protocol/openid-connect/token`}get isTokenExpired(){const e=this.keycloak.tokenParsed,n=e?e.exp:null;return!e||!n?!0:n-Math.ceil(new Date().getTime()/1e3)+(this.keycloak.timeSkew??0)<10}}const Th=(t,e)=>new ma(t,e);class pa{constructor(e){Se(this,"axios");Se(this,"authService",no());this.axios=re.create(),this.axios.defaults.baseURL=e??window.location.origin+"/api",this.axios.defaults.headers.common["content-type"]="application/json",this.axios.defaults.timeout=1e3*60*5,this.axios.interceptors.request.use(async n=>{const r=await this.GetAccessToken();return n.headers.Authorization=r?`Bearer ${r}`:void 0,n})}GetAxios(e=!0){return e?this.axios:re.create()}async GetAccessToken(){return await this.authService.Instance.getAccessTokenAsync()}async GetAsync(e){return this.GetAxios().get(e).then(n=>this.HandleThen(n)).catch(n=>this.HandleCatch(n))}async PostAsync(e,n){return this.GetAxios().post(e,n).then(r=>this.HandleThen(r)).catch(r=>this.HandleCatch(r))}async PutAsync(e,n){return this.GetAxios().put(e,n).then(r=>this.HandleThen(r)).catch(r=>this.HandleCatch(r))}async DeleteAsync(e){return this.GetAxios().delete(e).then(n=>this.HandleThen(n)).catch(n=>this.HandleCatch(n))}HandleThen(e){const n=new un,r=this.ParsedResponse(e.data);return r===null?(n.httpStatusCode=e.status,n.value=e.data,n):(n.httpStatusCode=r.httpStatusCode,r.hasError?(n.WithErrors(r.errors),n):(n.value=r.value,n))}HandleCatch(e){var o;const n=new un,r=this.ParsedResponse((o=e.response)==null?void 0:o.data);return r===null?(n.WithError(e.message),n):(n.httpStatusCode=r.httpStatusCode,n.WithErrors(r.errors),n)}ParsedResponse(e){try{const n=typeof e.hasSuccess=="boolean",r=typeof e.hasError=="boolean",o=typeof e.httpStatusCode=="number",s=Array.isArray(e.errors);return n&&r&&o&&s?e:null}catch{return null}}}const Ah=t=>new pa(t);class Hn{static get IsTouch(){return window.matchMedia("(pointer: coarse)").matches}static GetMaxZindex(e=[]){let n="body > *:not(script):not(style)";for(const o of e)n+=`, ${o}`;const r=Math.max(...Array.from(document.querySelectorAll(n)).map(o=>{const s=getComputedStyle(o).zIndex;return+s==+s?+s:0}));return r>=100?r:100}static AjustarFuso(e){const n=e.getTimezoneOffset()/60;e.setHours(e.getHours()-n)}static Mask(e,n){let r=0,o=e.toString();return n.replace(/#/g,()=>o[r++]||"")}static MaskCpf(e){return Hn.Mask(e.padStart(11,"0"),"###.###.###-##")}static MaskCnpj(e){return Hn.Mask(e.padStart(14,"0"),"##.###.###/####-##")}static async DelayAsync(e){return new Promise(n=>setTimeout(n,e))}}function Ph(){document.documentElement.classList.add("app-mounted")}function ha(){St.SetInitialTheme()}function Ih(){St.Toggle()}function xh(){St.EnableDarkMode()}function Oh(){St.EnableLightMode()}function Lh(){St.ClearStoredTheme()}ha();exports.ApiClient=pa;exports.AppResult=un;exports.AxiosClient=ma;exports.ClearStoredTheme=Lh;exports.EnableDarkMode=xh;exports.EnableLightMode=Oh;exports.Keycloak=to;exports.RemovePreloader=Ph;exports.SetInitialTheme=ha;exports.SfButton=Vs;exports.SfContent=Fd;exports.SfDrawer=Hs;exports.SfIcon=Ln;exports.SfLayout=Vd;exports.SfMessage=Qd;exports.SfNavMenu=Zm;exports.SfTabNavigation=Xd;exports.SfTooltip=jr;exports.StartAuthService=wd;exports.ToggleTheme=Ih;exports.UseAlertService=nd;exports.UseApiClient=Ah;exports.UseAuthService=no;exports.UseAxiosClient=Th;exports.UseConfirmService=Ei;exports.UseNavMenuService=Vr;exports.Utilities=Hn;
416
416
  //# sourceMappingURL=sf.prefeiturasp.vuecomponents.cjs.map