jplan-pack 0.6.724 → 0.6.726

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.
@@ -8,7 +8,7 @@ Only state can be modified.`);c[0]="$state",ua=!1,r.set(a,c,r.state.value),ua=!0
8
8
  state: () => new MyClass()
9
9
  Found in store "${M.$id}".`),C&&a&&t.hydrate&&t.hydrate(M.$state,C),m=!0,g=!0,M}/*! #__NO_SIDE_EFFECTS__ */function o0(n,e,t){let r,o;if(typeof n=="string")r=n,o=e;else if(o=n,r=n.id,process.env.NODE_ENV!=="production"&&typeof r!="string")throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');function a(c,d){const h=l.hasInjectionContext();if(c=(process.env.NODE_ENV==="test"&&rs&&rs._testing?null:c)||(h?l.inject(Dy,null):null),c&&Cs(c),process.env.NODE_ENV!=="production"&&!rs)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
10
10
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
11
- This will fail in production.`);c=rs,c._s.has(r)||(f_(r,o,c),process.env.NODE_ENV!=="production"&&(a._pinia=c));const m=c._s.get(r);if(process.env.NODE_ENV!=="production"&&d){const g="__hot:"+r,v=f_(g,er({},o),c,!0);d._hotUpdate(v),delete c.state.value[g],c._s.delete(g)}if(process.env.NODE_ENV!=="production"&&di){const g=l.getCurrentInstance();if(g&&g.proxy&&!d){const v=g.proxy,p="_pStores"in v?v._pStores:v._pStores={};p[r]=m}}return m}return a.$id=r,a}const i0=o0({id:"customizer",state:()=>({Sidebar_drawer:!0,Customizer_drawer:!1,mini_sidebar:!1,setHorizontalLayout:!1,actTheme:"DarkJPLANTheme",fontTheme:"Roboto",inputBg:!1,boxed:!1}),getters:{},actions:{SET_SIDEBAR_DRAWER(){this.Sidebar_drawer=!this.Sidebar_drawer},SET_MINI_SIDEBAR(n){this.mini_sidebar=n},SET_CUSTOMIZER_DRAWER(n){this.Customizer_drawer=n},SET_LAYOUT(n){this.setHorizontalLayout=n},SET_THEME(n){this.actTheme=n},SET_FONT(n){this.fontTheme=n}}}),zi=l.ref({}),Ms=n=>{const e=l.computed(()=>n?zi.value[n]||!1:zi.value.default||!1),t=()=>{n?zi.value[n]=!0:zi.value.default=!0},r=()=>{n?zi.value[n]=!1:zi.value.default=!1};return l.onUnmounted(()=>{r()}),l.onMounted(()=>{r()}),{isDialogActive:e,openDialog:t,closeDialog:r}};var a0=Object.defineProperty,m_=Object.getOwnPropertySymbols,s0=Object.prototype.hasOwnProperty,c0=Object.prototype.propertyIsEnumerable,g_=(n,e,t)=>e in n?a0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,zy=(n,e)=>{for(var t in e||(e={}))s0.call(e,t)&&g_(n,t,e[t]);if(m_)for(var t of m_(e))c0.call(e,t)&&g_(n,t,e[t]);return n},Fl=n=>typeof n=="function",Vl=n=>typeof n=="string",Gy=n=>Vl(n)&&n.trim().length>0,l0=n=>typeof n=="number",hi=n=>typeof n>"u",Es=n=>typeof n=="object"&&n!==null,u0=n=>Hr(n,"tag")&&Gy(n.tag),qy=n=>window.TouchEvent&&n instanceof TouchEvent,jy=n=>Hr(n,"component")&&Yy(n.component),d0=n=>Fl(n)||Es(n),Yy=n=>!hi(n)&&(Vl(n)||d0(n)||jy(n)),p_=n=>Es(n)&&["height","width","right","left","top","bottom"].every(e=>l0(n[e])),Hr=(n,e)=>(Es(n)||Fl(n))&&e in n,h0=(n=>()=>n++)(0);function xd(n){return qy(n)?n.targetTouches[0].clientX:n.clientX}function __(n){return qy(n)?n.targetTouches[0].clientY:n.clientY}var f0=n=>{hi(n.remove)?n.parentNode&&n.parentNode.removeChild(n):n.remove()},Ds=n=>jy(n)?Ds(n.component):u0(n)?l.defineComponent({render(){return n}}):typeof n=="string"?n:l.toRaw(l.unref(n)),m0=n=>{if(typeof n=="string")return n;const e=Hr(n,"props")&&Es(n.props)?n.props:{},t=Hr(n,"listeners")&&Es(n.listeners)?n.listeners:{};return{component:Ds(n),props:e,listeners:t}},g0=()=>typeof window<"u",Hl=class{constructor(){this.allHandlers={}}getHandlers(n){return this.allHandlers[n]||[]}on(n,e){const t=this.getHandlers(n);t.push(e),this.allHandlers[n]=t}off(n,e){const t=this.getHandlers(n);t.splice(t.indexOf(e)>>>0,1)}emit(n,e){this.getHandlers(n).forEach(r=>r(e))}},p0=n=>["on","off","emit"].every(e=>Hr(n,e)&&Fl(n[e]));exports.TYPE=void 0;(function(n){n.SUCCESS="success",n.ERROR="error",n.WARNING="warning",n.INFO="info",n.DEFAULT="default"})(exports.TYPE||(exports.TYPE={}));exports.POSITION=void 0;(function(n){n.TOP_LEFT="top-left",n.TOP_CENTER="top-center",n.TOP_RIGHT="top-right",n.BOTTOM_LEFT="bottom-left",n.BOTTOM_CENTER="bottom-center",n.BOTTOM_RIGHT="bottom-right"})(exports.POSITION||(exports.POSITION={}));var Ln;(function(n){n.ADD="add",n.DISMISS="dismiss",n.UPDATE="update",n.CLEAR="clear",n.UPDATE_DEFAULTS="update_defaults"})(Ln||(Ln={}));var pr="Vue-Toastification",gr={type:{type:String,default:exports.TYPE.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},Jy={type:gr.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},ol={component:{type:[String,Object,Function,Boolean],default:"button"},classNames:gr.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:"close"}},wh={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},Qy={transition:{type:[Object,String],default:`${pr}__bounce`}},_0={position:{type:String,default:exports.POSITION.TOP_RIGHT},draggable:gr.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:gr.trueBoolean,pauseOnHover:gr.trueBoolean,closeOnClick:gr.trueBoolean,timeout:wh.timeout,hideProgressBar:wh.hideProgressBar,toastClassName:gr.classNames,bodyClassName:gr.classNames,icon:Jy.customIcon,closeButton:ol.component,closeButtonClassName:ol.classNames,showCloseButtonOnHover:ol.showOnHover,accessibility:{type:Object,default:()=>({toastRole:"alert",closeButtonLabel:"close"})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new Hl}},v0={id:{type:[String,Number],required:!0,default:0},type:gr.type,content:{type:[String,Object,Function],required:!0,default:""},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},y0={container:{type:[Object,Function],default:()=>document.body},newestOnTop:gr.trueBoolean,maxToasts:{type:Number,default:20},transition:Qy.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:n=>n},filterToasts:{type:Function,default:n=>n},containerClassName:gr.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},uo={CORE_TOAST:_0,TOAST:v0,CONTAINER:y0,PROGRESS_BAR:wh,ICON:Jy,TRANSITION:Qy,CLOSE_BUTTON:ol},Xy=l.defineComponent({name:"VtProgressBar",props:uo.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?"running":"paused",opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${pr}__progress-bar`:""}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener("animationend",this.animationEnded)},beforeUnmount(){this.$el.removeEventListener("animationend",this.animationEnded)},methods:{animationEnded(){this.$emit("close-toast")}}});function C0(n,e){return l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(n.style),class:l.normalizeClass(n.cpClass)},null,6)}Xy.render=C0;var E0=Xy,Zy=l.defineComponent({name:"VtCloseButton",props:uo.CLOSE_BUTTON,computed:{buttonComponent(){return this.component!==!1?Ds(this.component):"button"},classes(){const n=[`${pr}__close-button`];return this.showOnHover&&n.push("show-on-hover"),n.concat(this.classNames)}}}),w0=l.createTextVNode(" × ");function T0(n,e){return l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.buttonComponent),l.mergeProps({"aria-label":n.ariaLabel,class:n.classes},n.$attrs),{default:l.withCtx(()=>[w0]),_:1},16,["aria-label","class"])}Zy.render=T0;var b0=Zy,eC={},I0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"check-circle",class:"svg-inline--fa fa-check-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},S0=l.createElementVNode("path",{fill:"currentColor",d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},null,-1),A0=[S0];function k0(n,e){return l.openBlock(),l.createElementBlock("svg",I0,A0)}eC.render=k0;var N0=eC,tC={},R0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"info-circle",class:"svg-inline--fa fa-info-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},O0=l.createElementVNode("path",{fill:"currentColor",d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},null,-1),P0=[O0];function M0(n,e){return l.openBlock(),l.createElementBlock("svg",R0,P0)}tC.render=M0;var v_=tC,nC={},D0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-circle",class:"svg-inline--fa fa-exclamation-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},L0=l.createElementVNode("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),x0=[L0];function U0(n,e){return l.openBlock(),l.createElementBlock("svg",D0,x0)}nC.render=U0;var B0=nC,rC={},F0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-triangle",class:"svg-inline--fa fa-exclamation-triangle fa-w-18",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},V0=l.createElementVNode("path",{fill:"currentColor",d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),H0=[V0];function $0(n,e){return l.openBlock(),l.createElementBlock("svg",F0,H0)}rC.render=$0;var K0=rC,oC=l.defineComponent({name:"VtIcon",props:uo.ICON,computed:{customIconChildren(){return Hr(this.customIcon,"iconChildren")?this.trimValue(this.customIcon.iconChildren):""},customIconClass(){return Vl(this.customIcon)?this.trimValue(this.customIcon):Hr(this.customIcon,"iconClass")?this.trimValue(this.customIcon.iconClass):""},customIconTag(){return Hr(this.customIcon,"iconTag")?this.trimValue(this.customIcon.iconTag,"i"):"i"},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:Yy(this.customIcon)?Ds(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[exports.TYPE.DEFAULT]:v_,[exports.TYPE.INFO]:v_,[exports.TYPE.SUCCESS]:N0,[exports.TYPE.ERROR]:K0,[exports.TYPE.WARNING]:B0}[this.type]},iconClasses(){const n=[`${pr}__icon`];return this.hasCustomIcon?n.concat(this.customIconClass):n}},methods:{trimValue(n,e=""){return Gy(n)?n.trim():e}}});function W0(n,e){return l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.component),{class:l.normalizeClass(n.iconClasses)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.customIconChildren),1)]),_:1},8,["class"])}oC.render=W0;var z0=oC,iC=l.defineComponent({name:"VtToast",components:{ProgressBar:E0,CloseButton:b0,Icon:z0},inheritAttrs:!1,props:Object.assign({},uo.CORE_TOAST,uo.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){const n=[`${pr}__toast`,`${pr}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&n.push("disable-transition"),this.rtl&&n.push(`${pr}__toast--rtl`),n},bodyClasses(){return[`${pr}__toast-${Vl(this.content)?"body":"component-body"}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:"transform 0.2s, opacity 0.2s",transform:"translateX(0)",opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return p_(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:Hr,getVueComponentFromObj:Ds,closeToast(){this.eventBus.emit(Ln.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener("blur",this.focusPause),addEventListener("focus",this.focusPlay)},focusCleanup(){removeEventListener("blur",this.focusPause),removeEventListener("focus",this.focusPlay)},draggableSetup(){const n=this.$el;n.addEventListener("touchstart",this.onDragStart,{passive:!0}),n.addEventListener("mousedown",this.onDragStart),addEventListener("touchmove",this.onDragMove,{passive:!1}),addEventListener("mousemove",this.onDragMove),addEventListener("touchend",this.onDragEnd),addEventListener("mouseup",this.onDragEnd)},draggableCleanup(){const n=this.$el;n.removeEventListener("touchstart",this.onDragStart),n.removeEventListener("mousedown",this.onDragStart),removeEventListener("touchmove",this.onDragMove),removeEventListener("mousemove",this.onDragMove),removeEventListener("touchend",this.onDragEnd),removeEventListener("mouseup",this.onDragEnd)},onDragStart(n){this.beingDragged=!0,this.dragPos={x:xd(n),y:__(n)},this.dragStart=xd(n),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(n){this.beingDragged&&(n.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:xd(n),y:__(n)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,p_(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),G0=["role"];function q0(n,e){const t=l.resolveComponent("Icon"),r=l.resolveComponent("CloseButton"),o=l.resolveComponent("ProgressBar");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(n.classes),style:l.normalizeStyle(n.draggableStyle),onClick:e[0]||(e[0]=(...a)=>n.clickHandler&&n.clickHandler(...a)),onMouseenter:e[1]||(e[1]=(...a)=>n.hoverPause&&n.hoverPause(...a)),onMouseleave:e[2]||(e[2]=(...a)=>n.hoverPlay&&n.hoverPlay(...a))},[n.icon?(l.openBlock(),l.createBlock(t,{key:0,"custom-icon":n.icon,type:n.type},null,8,["custom-icon","type"])):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{role:n.accessibility.toastRole||"alert",class:l.normalizeClass(n.bodyClasses)},[typeof n.content=="string"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(n.content),1)],2112)):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.getVueComponentFromObj(n.content)),l.mergeProps({key:1,"toast-id":n.id},n.hasProp(n.content,"props")?n.content.props:{},l.toHandlers(n.hasProp(n.content,"listeners")?n.content.listeners:{}),{onCloseToast:n.closeToast}),null,16,["toast-id","onCloseToast"]))],10,G0),n.closeButton?(l.openBlock(),l.createBlock(r,{key:1,component:n.closeButton,"class-names":n.closeButtonClassName,"show-on-hover":n.showCloseButtonOnHover,"aria-label":n.accessibility.closeButtonLabel,onClick:l.withModifiers(n.closeToast,["stop"])},null,8,["component","class-names","show-on-hover","aria-label","onClick"])):l.createCommentVNode("v-if",!0),n.timeout?(l.openBlock(),l.createBlock(o,{key:2,"is-running":n.isRunning,"hide-progress-bar":n.hideProgressBar,timeout:n.timeout,onCloseToast:n.timeoutHandler},null,8,["is-running","hide-progress-bar","timeout","onCloseToast"])):l.createCommentVNode("v-if",!0)],38)}iC.render=q0;var j0=iC,aC=l.defineComponent({name:"VtTransition",props:uo.TRANSITION,emits:["leave"],methods:{hasProp:Hr,leave(n){n instanceof HTMLElement&&(n.style.left=n.offsetLeft+"px",n.style.top=n.offsetTop+"px",n.style.width=getComputedStyle(n).width,n.style.position="absolute")}}});function Y0(n,e){return l.openBlock(),l.createBlock(l.TransitionGroup,{tag:"div","enter-active-class":n.transition.enter?n.transition.enter:`${n.transition}-enter-active`,"move-class":n.transition.move?n.transition.move:`${n.transition}-move`,"leave-active-class":n.transition.leave?n.transition.leave:`${n.transition}-leave-active`,onLeave:n.leave},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"default")]),_:3},8,["enter-active-class","move-class","leave-active-class","onLeave"])}aC.render=Y0;var J0=aC,sC=l.defineComponent({name:"VueToastification",devtools:{hide:!0},components:{Toast:j0,VtTransition:J0},props:Object.assign({},uo.CORE_TOAST,uo.CONTAINER,uo.TRANSITION),data(){return{count:0,positions:Object.values(exports.POSITION),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){const n=this.eventBus;n.on(Ln.ADD,this.addToast),n.on(Ln.CLEAR,this.clearToasts),n.on(Ln.DISMISS,this.dismissToast),n.on(Ln.UPDATE,this.updateToast),n.on(Ln.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(n){Fl(n)&&(n=await n()),f0(this.$el),n.appendChild(this.$el)},setToast(n){hi(n.id)||(this.toasts[n.id]=n)},addToast(n){n.content=m0(n.content);const e=Object.assign({},this.defaults,n.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[n.type],n),t=this.defaults.filterBeforeCreate(e,this.toastArray);t&&this.setToast(t)},dismissToast(n){const e=this.toasts[n];!hi(e)&&!hi(e.onClose)&&e.onClose(),delete this.toasts[n]},clearToasts(){Object.keys(this.toasts).forEach(n=>{this.dismissToast(n)})},getPositionToasts(n){const e=this.filteredToasts.filter(t=>t.position===n).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?e.reverse():e},updateDefaults(n){hi(n.container)||this.setup(n.container),this.defaults=Object.assign({},this.defaults,n)},updateToast({id:n,options:e,create:t}){this.toasts[n]?(e.timeout&&e.timeout===this.toasts[n].timeout&&e.timeout++,this.setToast(Object.assign({},this.toasts[n],e))):t&&this.addToast(Object.assign({},{id:n},e))},getClasses(n){return[`${pr}__container`,n].concat(this.defaults.containerClassName)}}});function Q0(n,e){const t=l.resolveComponent("Toast"),r=l.resolveComponent("VtTransition");return l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.positions,o=>(l.openBlock(),l.createElementBlock("div",{key:o},[l.createVNode(r,{transition:n.defaults.transition,class:l.normalizeClass(n.getClasses(o))},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.getPositionToasts(o),a=>(l.openBlock(),l.createBlock(t,l.mergeProps({key:a.id},a),null,16))),128))]),_:2},1032,["transition","class"])]))),128))])}sC.render=Q0;var X0=sC,y_=(n={},e=!0)=>{const t=n.eventBus=n.eventBus||new Hl;e&&l.nextTick(()=>{const a=l.createApp(X0,zy({},n)),c=a.mount(document.createElement("div")),d=n.onMounted;if(hi(d)||d(c,a),n.shareAppContext){const h=n.shareAppContext;h===!0?console.warn(`[${pr}] App to share context with was not provided.`):(a._context.components=h._context.components,a._context.directives=h._context.directives,a._context.mixins=h._context.mixins,a._context.provides=h._context.provides,a.config.globalProperties=h.config.globalProperties)}});const r=(a,c)=>{const d=Object.assign({},{id:h0(),type:exports.TYPE.DEFAULT},c,{content:a});return t.emit(Ln.ADD,d),d.id};r.clear=()=>t.emit(Ln.CLEAR,void 0),r.updateDefaults=a=>{t.emit(Ln.UPDATE_DEFAULTS,a)},r.dismiss=a=>{t.emit(Ln.DISMISS,a)};function o(a,{content:c,options:d},h=!1){const m=Object.assign({},d,{content:c});t.emit(Ln.UPDATE,{id:a,options:m,create:h})}return r.update=o,r.success=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.SUCCESS})),r.info=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.INFO})),r.error=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.ERROR})),r.warning=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.WARNING})),r},Z0=()=>{const n=()=>console.warn(`[${pr}] This plugin does not support SSR!`);return new Proxy(n,{get(){return n}})};function ws(n){return g0()?p0(n)?y_({eventBus:n},!1):y_(n,!0):Z0()}var $l=Symbol("VueToastification"),yf=new Hl,eP=(n,e)=>{(e==null?void 0:e.shareAppContext)===!0&&(e.shareAppContext=n);const t=ws(zy({eventBus:yf},e));n.provide($l,t)},tP=n=>{const e=ws(n);l.getCurrentInstance()&&l.provide($l,e)},wr=n=>{if(n)return ws(n);const e=l.getCurrentInstance()?l.inject($l,void 0):void 0;return e||ws(yf)},nP=eP;const ve=l.ref(!1);var rP={name:"CircleOffIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-circle-off",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M20.042 16.045a9 9 0 0 0 -12.087 -12.087m-2.318 1.677a9 9 0 1 0 12.725 12.73"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 3l18 18"},null),l.createTextVNode(" ")])}},oP={name:"DotsVerticalIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-dots-vertical",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},iP={name:"DotsIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-dots",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},aP={name:"EraserIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-eraser",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M18 13.3l-6.3 -6.3"},null),l.createTextVNode(" ")])}},cC={name:"ExclamationCircleIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-exclamation-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 9v4"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 16v.01"},null),l.createTextVNode(" ")])}},sP={name:"FilterIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-filter",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null),l.createTextVNode(" ")])}},cP={name:"GripVerticalIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-grip-vertical",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},lP={name:"HierarchyIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-hierarchy",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M6.5 17.5l5.5 -4.5l5.5 4.5"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 7l0 6"},null),l.createTextVNode(" ")])}},uP={name:"LayoutSidebarRightCollapseIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-layout-sidebar-right-collapse",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 4v16"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 10l2 2l-2 2"},null),l.createTextVNode(" ")])}},dP={name:"RefreshIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-refresh",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null),l.createTextVNode(" ")])}},hP={name:"SearchIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-search",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M21 21l-6 -6"},null),l.createTextVNode(" ")])}},fP={name:"TableIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-table",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 10h18"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M10 3v18"},null),l.createTextVNode(" ")])}};const mP={class:"d-flex align-center"},gP={key:1},pP={class:"ms-auto"},Ls=l.defineComponent({__name:"JDialog",props:{ddId:{},variant:{default:"global"},title:{},text:{},width:{default:"500"},reference:{type:Boolean},buttons:{type:Boolean,default:!0},scrim:{default:"background"}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=n,r=e,o=l.ref(!1),{isDialogActive:a,closeDialog:c}=Ms(t.ddId);async function d(){try{await r("onCancel")}catch(m){console.error(m)}c()}async function h(){o.value=!0;try{await r("onSave")}catch(m){console.error(m)}o.value=!1,c()}return(m,g)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[m.variant==="global"?(l.openBlock(),l.createBlock(Zc.VDialog,{key:0,scrim:t.scrim,width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[0]||(g[0]=v=>l.isRef(a)?a.value=v:null),"onClick:outside":d},{default:l.withCtx(()=>[l.createVNode(xt.VCard,{rounded:"",loading:o.value},{default:l.withCtx(()=>[l.createVNode(xt.VCardTitle,{class:"mt-2 px-5 d-flex"},{default:l.withCtx(()=>[l.createElementVNode("div",mP,[m.$slots.title?l.renderSlot(m.$slots,"title",{key:0}):(l.openBlock(),l.createElementBlock("div",gP,l.toDisplayString(t.title),1))]),l.createElementVNode("div",pP,[l.renderSlot(m.$slots,"heading-actions"),l.createVNode(it.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:d,variant:"plain"})])]),_:3}),l.createVNode(pi.VDivider,{class:"mx-5"}),l.createVNode(xt.VCardText,{class:"overflow-y-scroll"},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"default")]),_:3}),m.$slots.footer?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(pi.VDivider,{class:"mx-5 mt-2"}),l.createVNode(xt.VCardActions,null,{default:l.withCtx(()=>[l.renderSlot(m.$slots,"footer")]),_:3})],64)):l.createCommentVNode("",!0),t.buttons?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createVNode(pi.VDivider,{class:"mx-5 mt-2"}),l.createVNode(xt.VCardActions,null,{default:l.withCtx(()=>[m.$slots.metadata?(l.openBlock(),l.createBlock(Qe.VCol,{key:0,cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis ma-0 pa-0"},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"metadata")]),_:3})):l.createCommentVNode("",!0),l.createVNode(Qe.VSpacer),l.createVNode(it.VBtn,{class:"j-btn-form",variant:"outlined",color:"secondary",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.cancel")),1)]),_:1}),l.createVNode(it.VBtn,{class:"j-btn-form",variant:"flat",color:"secondary",onClick:h,loading:o.value},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.save")),1)]),_:1},8,["loading"])]),_:3})],64)):l.createCommentVNode("",!0)]),_:3},8,["loading"])]),_:3},8,["scrim","width","modelValue"])):l.createCommentVNode("",!0),m.variant==="confirm"?(l.openBlock(),l.createBlock(Zc.VDialog,{key:1,scrim:"background",width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[1]||(g[1]=v=>l.isRef(a)?a.value=v:null),"onClick:outside":d},{default:l.withCtx(()=>[l.createVNode(xt.VCard,{loading:o.value,title:t.title,rounded:"","min-height":"300"},{prepend:l.withCtx(()=>[l.createVNode(l.unref(cC),{color:"rgb(var(--v-theme-secondary))"})]),append:l.withCtx(()=>[l.createVNode(it.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:d,variant:"plain"})]),default:l.withCtx(()=>[l.createVNode(xt.VCardText,{class:"text-center mt-7"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.text),1)]),_:1}),l.createVNode(xt.VCardActions,{class:"d-flex"},{default:l.withCtx(()=>[l.createVNode(it.VBtn,{class:"flex-grow-1",variant:"outlined",color:"secondary",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.cancel")),1)]),_:1}),l.createVNode(it.VBtn,{class:"flex-grow-1",variant:"flat",color:"secondary",onClick:h},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.confirm")),1)]),_:1})]),_:1})]),_:1},8,["loading","title"])]),_:1},8,["width","modelValue"])):l.createCommentVNode("",!0),m.variant==="empty"?(l.openBlock(),l.createBlock(Zc.VDialog,{key:2,scrim:t.scrim,width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[2]||(g[2]=v=>l.isRef(a)?a.value=v:null),"onClick:outside":d},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"default")]),_:3},8,["scrim","width","modelValue"])):l.createCommentVNode("",!0)],64))}}),Cf=l.defineComponent({__name:"DeleteAllBtn",emits:["removeAll"],setup(n,{emit:e}){const{openDialog:t}=Ms("delete-all-__J"),r=e;return(o,a)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(Ls,{"dd-id":"delete-all-__J",variant:"confirm",title:"Confirm delete",text:"Are you sure you want to delete all selected items?","on-save":()=>r("removeAll")},null,8,["on-save"]),l.createVNode(it.VBtn,{onClick:l.unref(t),variant:"plain",color:"secondary","prepend-icon":"mdi-delete"},{default:l.withCtx(()=>a[0]||(a[0]=[l.createTextVNode(" Delete")])),_:1},8,["onClick"])],64))}}),lC=l.defineComponent({__name:"EditButton",emits:["editAll"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(it.VBtn,{onClick:o[0]||(o[0]=a=>t("editAll")),variant:"plain",color:"secondary","prepend-icon":"mdi-pencil"},{default:l.withCtx(()=>o[1]||(o[1]=[l.createTextVNode(" Edit")])),_:1}))}}),uC=l.defineComponent({__name:"DotsMenu",props:{variant:{default:"text"},color:{},orientation:{},size:{}},setup(n){return(e,t)=>(l.openBlock(),l.createBlock(l.unref(Vo.VMenu),{"close-on-content-click":!0},{activator:l.withCtx(({props:r})=>[l.createVNode(l.unref(Vo.VBtn),l.mergeProps({variant:e.variant},r,{icon:""}),{default:l.withCtx(()=>[e.orientation==="y"?(l.openBlock(),l.createBlock(l.unref(oP),{key:0,size:e.size,color:`rgb(var(--v-theme-${e.color}))`,class:"cursor-pointer"},null,8,["size","color"])):(l.openBlock(),l.createBlock(l.unref(iP),{key:1,size:e.size,color:`rgb(var(--v-theme-${e.color}))`,class:"cursor-pointer"},null,8,["size","color"]))]),_:2},1040,["variant"])]),default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3}))}}),Kl=l.defineComponent({__name:"ParentCard",props:{title:{},height:{default:"100%"},loading:{type:Boolean}},setup(n){const e=n;return(t,r)=>(l.openBlock(),l.createBlock(xt.VCard,{"min-height":t.height,height:t.height,loading:t.loading,class:"bg-surface rounded-sm pa-5"},{default:l.withCtx(()=>[e.title?(l.openBlock(),l.createBlock(xt.VCardTitle,{key:0,class:"pa-0"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(e.title),1)]),_:1})):l.createCommentVNode("",!0),l.renderSlot(t.$slots,"default")]),_:3},8,["min-height","height","loading"]))}}),dC=l.defineComponent({__name:"ConfirmDialog",props:{title:{},text:{},width:{},loading:{type:Boolean}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=n,r=l.ref(!1),o=l.ref(!1);l.onUnmounted(()=>{r.value=!1});const a=e;async function c(){try{await a("onCancel")}catch(h){console.error(h)}r.value=!1}async function d(){o.value=!0;try{await a("onSave")}catch(h){console.error(h)}o.value=!1,r.value=!1}return(h,m)=>(l.openBlock(),l.createBlock(Zc.VDialog,{scrim:"rgb(0,0,0,100)",width:t.width},{activator:l.withCtx(({isActive:g,props:v})=>[l.renderSlot(h.$slots,"button",l.normalizeProps(l.guardReactiveProps({isActive:g,props:v})))]),default:l.withCtx(({isActive:g})=>[l.createVNode(xt.VCard,{loading:o.value,title:t.title,rounded:"","min-height":"300"},{prepend:l.withCtx(()=>[l.createVNode(l.unref(cC),{color:"rgb(var(--v-theme-secondary))"})]),append:l.withCtx(()=>[l.createVNode(it.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:c,variant:"plain"})]),default:l.withCtx(()=>[l.createVNode(xt.VCardText,{class:"text-center mt-7"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.text),1)]),_:1}),l.createVNode(xt.VCardActions,{class:"d-flex"},{default:l.withCtx(()=>[l.createVNode(it.VBtn,{class:"flex-grow-1",variant:"outlined",color:"secondary",onClick:c},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.$t("actions.cancel")),1)]),_:1}),l.createVNode(it.VBtn,{class:"flex-grow-1",variant:"flat",color:"secondary",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.$t("actions.confirm")),1)]),_:1})]),_:1})]),_:1},8,["loading","title"])]),_:3},8,["width"]))}}),Ud="https://app-files.jplan.com.br/pub/resources/profile-placeholder.svg",hC=l.defineComponent({__name:"JAvatar",props:{src:{}},setup(n){const e=n,t=l.ref(e.src),r=l.computed(()=>t.value||Ud);function o(){t.value=Ud}return(a,c)=>(l.openBlock(),l.createBlock(ky.VAvatar,{size:"50"},{default:l.withCtx(()=>[l.createVNode(mf.VImg,{src:r.value,"lazy-src":Ud,onError:o,width:"50",alt:"profile-placeholder"},null,8,["src"])]),_:1}))}}),Bd="https://app-files.jplan.com.br/pub/resources/profile-placeholder.svg",fC=l.defineComponent({__name:"AvatarPicture",props:{img:{},size:{}},setup(n){const e=n,t=l.ref(e.img),r=l.computed(()=>t.value||Bd);function o(){t.value=Bd}return(a,c)=>(l.openBlock(),l.createBlock(ky.VAvatar,{size:a.size},{default:l.withCtx(()=>[l.createVNode(mf.VImg,{src:r.value,"lazy-src":Bd,onError:o,width:"40",alt:"Avatar"},null,8,["src"])]),_:1},8,["size"]))}}),_P=l.defineComponent({__name:"ContextMenu",setup(n){const e=l.ref(!1),t=l.ref({x:0,y:0}),r=a=>{a.preventDefault(),t.value={x:a.clientX,y:a.clientY},e.value=!0},o=()=>{e.value=!1};return l.onMounted(()=>{document.addEventListener("click",o)}),l.onUnmounted(()=>{document.removeEventListener("click",o)}),(a,c)=>(l.openBlock(),l.createElementBlock("div",{onContextmenu:l.withModifiers(r,["right"]),class:"relative w-full h-full"},[l.renderSlot(a.$slots,"default",{},void 0,!0),l.createVNode(gf.VMenu,{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=d=>e.value=d),style:l.normalizeStyle({top:`${t.value.y}px`,left:`${t.value.x}px`,position:"absolute"})},{default:l.withCtx(()=>[l.createVNode(Qt.VList,{onClick:o},{default:l.withCtx(()=>[l.renderSlot(a.$slots,"actions",{},void 0,!0)]),_:3})]),_:3},8,["modelValue","style"])],32))}}),Sa=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},mC=Sa(_P,[["__scopeId","data-v-ad4e4a5d"]]),vP={class:"d-inline-flex"},gC=l.defineComponent({__name:"UiTable",props:l.mergeModels({headers:{},items:{default:()=>[]},actions:{},loading:{type:Boolean},columns:{default:()=>[]},sortBy:{}},{selection:{},selectionModifiers:{}}),emits:["update:selection"],setup(n){const e=n,t=l.computed(()=>{var o;if(e.headers)return e.headers;if(e.columns)return(o=e.columns)==null?void 0:o.filter(a=>a.checked)}),r=l.useModel(n,"selection");return(o,a)=>(l.openBlock(),l.createBlock(Ny.VDataTable,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=c=>r.value=c),"fixed-header":"","fixed-footer":"","items-per-page":"10",headers:t.value,items:o.items,"items-length":o.items.length,loading:o.loading||!1,"item-value":"_id","return-object":"","show-select":"","sort-by":o.sortBy,height:"calc(100vh - 320px)",class:"customize-table"},{top:l.withCtx(()=>a[1]||(a[1]=[l.createElementVNode("span",{class:"mt-5"},null,-1)])),"item.avatar":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"avatar",{item:c})]),"item.active":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"active",{item:c})]),"item.image":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"image",{item:c})]),"item.picture":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"picture",{item:c})]),"item.icon":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"icon",{item:c})]),"item.actions":l.withCtx(({item:c})=>[l.createElementVNode("div",vP,[l.renderSlot(o.$slots,"actions",{item:c})])]),"no-data":l.withCtx(()=>[!o.loading&&o.items.length===0?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(" This table is empty.")],64)):l.createCommentVNode("",!0)]),_:3},8,["modelValue","headers","items","items-length","loading","sort-by"]))}}),pC=6048e5,yP=864e5,C_=Symbol.for("constructDateFrom");function $o(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&C_ in n?n[C_](e):n instanceof Date?new n.constructor(e):new Date(e)}function Tr(n,e){return $o(e||n,n)}let CP={};function Wl(){return CP}function Ts(n,e){var d,h,m,g;const t=Wl(),r=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??t.weekStartsOn??((g=(m=t.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,o=Tr(n,e==null?void 0:e.in),a=o.getDay(),c=(a<r?7:0)+a-r;return o.setDate(o.getDate()-c),o.setHours(0,0,0,0),o}function vl(n,e){return Ts(n,{...e,weekStartsOn:1})}function _C(n,e){const t=Tr(n,e==null?void 0:e.in),r=t.getFullYear(),o=$o(t,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=vl(o),c=$o(t,0);c.setFullYear(r,0,4),c.setHours(0,0,0,0);const d=vl(c);return t.getTime()>=a.getTime()?r+1:t.getTime()>=d.getTime()?r:r-1}function E_(n){const e=Tr(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function EP(n,...e){const t=$o.bind(null,e.find(r=>typeof r=="object"));return e.map(t)}function w_(n,e){const t=Tr(n,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function wP(n,e,t){const[r,o]=EP(t==null?void 0:t.in,n,e),a=w_(r),c=w_(o),d=+a-E_(a),h=+c-E_(c);return Math.round((d-h)/yP)}function TP(n,e){const t=_C(n,e),r=$o(n,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),vl(r)}function bP(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function IP(n){return!(!bP(n)&&typeof n!="number"||isNaN(+Tr(n)))}function SP(n,e){const t=Tr(n,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const AP={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},kP=(n,e,t)=>{let r;const o=AP[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r};function or(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const NP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},RP={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},OP={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},PP={date:or({formats:NP,defaultWidth:"full"}),time:or({formats:RP,defaultWidth:"full"}),dateTime:or({formats:OP,defaultWidth:"full"})},MP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},DP=(n,e,t,r)=>MP[n];function Tt(n){return(e,t)=>{const r=t!=null&&t.context?String(t.context):"standalone";let o;if(r==="formatting"&&n.formattingValues){const c=n.defaultFormattingWidth||n.defaultWidth,d=t!=null&&t.width?String(t.width):c;o=n.formattingValues[d]||n.formattingValues[c]}else{const c=n.defaultWidth,d=t!=null&&t.width?String(t.width):n.defaultWidth;o=n.values[d]||n.values[c]}const a=n.argumentCallback?n.argumentCallback(e):e;return o[a]}}const LP={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xP={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},UP={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},BP={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},FP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},VP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},HP=(n,e)=>{const t=Number(n),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},$P={ordinalNumber:HP,era:Tt({values:LP,defaultWidth:"wide"}),quarter:Tt({values:xP,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Tt({values:UP,defaultWidth:"wide"}),day:Tt({values:BP,defaultWidth:"wide"}),dayPeriod:Tt({values:FP,defaultWidth:"wide",formattingValues:VP,defaultFormattingWidth:"wide"})};function bt(n){return(e,t={})=>{const r=t.width,o=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],a=e.match(o);if(!a)return null;const c=a[0],d=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],h=Array.isArray(d)?WP(d,v=>v.test(c)):KP(d,v=>v.test(c));let m;m=n.valueCallback?n.valueCallback(h):h,m=t.valueCallback?t.valueCallback(m):m;const g=e.slice(c.length);return{value:m,rest:g}}}function KP(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function WP(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function zl(n){return(e,t={})=>{const r=e.match(n.matchPattern);if(!r)return null;const o=r[0],a=e.match(n.parsePattern);if(!a)return null;let c=n.valueCallback?n.valueCallback(a[0]):a[0];c=t.valueCallback?t.valueCallback(c):c;const d=e.slice(o.length);return{value:c,rest:d}}}const zP=/^(\d+)(th|st|nd|rd)?/i,GP=/\d+/i,qP={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jP={any:[/^b/i,/^(a|c)/i]},YP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},JP={any:[/1/i,/2/i,/3/i,/4/i]},QP={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},XP={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ZP={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},e1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},t1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},n1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},r1={ordinalNumber:zl({matchPattern:zP,parsePattern:GP,valueCallback:n=>parseInt(n,10)}),era:bt({matchPatterns:qP,defaultMatchWidth:"wide",parsePatterns:jP,defaultParseWidth:"any"}),quarter:bt({matchPatterns:YP,defaultMatchWidth:"wide",parsePatterns:JP,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bt({matchPatterns:QP,defaultMatchWidth:"wide",parsePatterns:XP,defaultParseWidth:"any"}),day:bt({matchPatterns:ZP,defaultMatchWidth:"wide",parsePatterns:e1,defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:t1,defaultMatchWidth:"any",parsePatterns:n1,defaultParseWidth:"any"})},Ef={code:"en-US",formatDistance:kP,formatLong:PP,formatRelative:DP,localize:$P,match:r1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function o1(n,e){const t=Tr(n,e==null?void 0:e.in);return wP(t,SP(t))+1}function i1(n,e){const t=Tr(n,e==null?void 0:e.in),r=+vl(t)-+TP(t);return Math.round(r/pC)+1}function vC(n,e){var g,v,p,w;const t=Tr(n,e==null?void 0:e.in),r=t.getFullYear(),o=Wl(),a=(e==null?void 0:e.firstWeekContainsDate)??((v=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??o.firstWeekContainsDate??((w=(p=o.locale)==null?void 0:p.options)==null?void 0:w.firstWeekContainsDate)??1,c=$o((e==null?void 0:e.in)||n,0);c.setFullYear(r+1,0,a),c.setHours(0,0,0,0);const d=Ts(c,e),h=$o((e==null?void 0:e.in)||n,0);h.setFullYear(r,0,a),h.setHours(0,0,0,0);const m=Ts(h,e);return+t>=+d?r+1:+t>=+m?r:r-1}function a1(n,e){var d,h,m,g;const t=Wl(),r=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??t.firstWeekContainsDate??((g=(m=t.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,o=vC(n,e),a=$o((e==null?void 0:e.in)||n,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Ts(a,e)}function s1(n,e){const t=Tr(n,e==null?void 0:e.in),r=+Ts(t,e)-+a1(t,e);return Math.round(r/pC)+1}function We(n,e){const t=n<0?"-":"",r=Math.abs(n).toString().padStart(e,"0");return t+r}const Ro={y(n,e){const t=n.getFullYear(),r=t>0?t:1-t;return We(e==="yy"?r%100:r,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):We(t+1,2)},d(n,e){return We(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,e){return We(n.getHours()%12||12,e.length)},H(n,e){return We(n.getHours(),e.length)},m(n,e){return We(n.getMinutes(),e.length)},s(n,e){return We(n.getSeconds(),e.length)},S(n,e){const t=e.length,r=n.getMilliseconds(),o=Math.trunc(r*Math.pow(10,t-3));return We(o,e.length)}},Gi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},T_={G:function(n,e,t){const r=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(r,{width:"abbreviated"});case"GGGGG":return t.era(r,{width:"narrow"});case"GGGG":default:return t.era(r,{width:"wide"})}},y:function(n,e,t){if(e==="yo"){const r=n.getFullYear(),o=r>0?r:1-r;return t.ordinalNumber(o,{unit:"year"})}return Ro.y(n,e)},Y:function(n,e,t,r){const o=vC(n,r),a=o>0?o:1-o;if(e==="YY"){const c=a%100;return We(c,2)}return e==="Yo"?t.ordinalNumber(a,{unit:"year"}):We(a,e.length)},R:function(n,e){const t=_C(n);return We(t,e.length)},u:function(n,e){const t=n.getFullYear();return We(t,e.length)},Q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return We(r,2);case"Qo":return t.ordinalNumber(r,{unit:"quarter"});case"QQQ":return t.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return We(r,2);case"qo":return t.ordinalNumber(r,{unit:"quarter"});case"qqq":return t.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,e,t){const r=n.getMonth();switch(e){case"M":case"MM":return Ro.M(n,e);case"Mo":return t.ordinalNumber(r+1,{unit:"month"});case"MMM":return t.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(r,{width:"wide",context:"formatting"})}},L:function(n,e,t){const r=n.getMonth();switch(e){case"L":return String(r+1);case"LL":return We(r+1,2);case"Lo":return t.ordinalNumber(r+1,{unit:"month"});case"LLL":return t.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(r,{width:"wide",context:"standalone"})}},w:function(n,e,t,r){const o=s1(n,r);return e==="wo"?t.ordinalNumber(o,{unit:"week"}):We(o,e.length)},I:function(n,e,t){const r=i1(n);return e==="Io"?t.ordinalNumber(r,{unit:"week"}):We(r,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):Ro.d(n,e)},D:function(n,e,t){const r=o1(n);return e==="Do"?t.ordinalNumber(r,{unit:"dayOfYear"}):We(r,e.length)},E:function(n,e,t){const r=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(r,{width:"short",context:"formatting"});case"EEEE":default:return t.day(r,{width:"wide",context:"formatting"})}},e:function(n,e,t,r){const o=n.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return We(a,2);case"eo":return t.ordinalNumber(a,{unit:"day"});case"eee":return t.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(o,{width:"short",context:"formatting"});case"eeee":default:return t.day(o,{width:"wide",context:"formatting"})}},c:function(n,e,t,r){const o=n.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return We(a,e.length);case"co":return t.ordinalNumber(a,{unit:"day"});case"ccc":return t.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(o,{width:"narrow",context:"standalone"});case"cccccc":return t.day(o,{width:"short",context:"standalone"});case"cccc":default:return t.day(o,{width:"wide",context:"standalone"})}},i:function(n,e,t){const r=n.getDay(),o=r===0?7:r;switch(e){case"i":return String(o);case"ii":return We(o,e.length);case"io":return t.ordinalNumber(o,{unit:"day"});case"iii":return t.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(r,{width:"short",context:"formatting"});case"iiii":default:return t.day(r,{width:"wide",context:"formatting"})}},a:function(n,e,t){const o=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,e,t){const r=n.getHours();let o;switch(r===12?o=Gi.noon:r===0?o=Gi.midnight:o=r/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,e,t){const r=n.getHours();let o;switch(r>=17?o=Gi.evening:r>=12?o=Gi.afternoon:r>=4?o=Gi.morning:o=Gi.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,e,t){if(e==="ho"){let r=n.getHours()%12;return r===0&&(r=12),t.ordinalNumber(r,{unit:"hour"})}return Ro.h(n,e)},H:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):Ro.H(n,e)},K:function(n,e,t){const r=n.getHours()%12;return e==="Ko"?t.ordinalNumber(r,{unit:"hour"}):We(r,e.length)},k:function(n,e,t){let r=n.getHours();return r===0&&(r=24),e==="ko"?t.ordinalNumber(r,{unit:"hour"}):We(r,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ro.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):Ro.s(n,e)},S:function(n,e){return Ro.S(n,e)},X:function(n,e,t){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return I_(r);case"XXXX":case"XX":return li(r);case"XXXXX":case"XXX":default:return li(r,":")}},x:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"x":return I_(r);case"xxxx":case"xx":return li(r);case"xxxxx":case"xxx":default:return li(r,":")}},O:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+b_(r,":");case"OOOO":default:return"GMT"+li(r,":")}},z:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+b_(r,":");case"zzzz":default:return"GMT"+li(r,":")}},t:function(n,e,t){const r=Math.trunc(+n/1e3);return We(r,e.length)},T:function(n,e,t){return We(+n,e.length)}};function b_(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),o=Math.trunc(r/60),a=r%60;return a===0?t+String(o):t+String(o)+e+We(a,2)}function I_(n,e){return n%60===0?(n>0?"-":"+")+We(Math.abs(n)/60,2):li(n,e)}function li(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),o=We(Math.trunc(r/60),2),a=We(r%60,2);return t+o+e+a}const S_=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},yC=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},c1=(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],r=t[1],o=t[2];if(!o)return S_(n,e);let a;switch(r){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;case"PPPP":default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",S_(r,e)).replace("{{time}}",yC(o,e))},l1={p:yC,P:c1},u1=/^D+$/,d1=/^Y+$/,h1=["D","DD","YY","YYYY"];function f1(n){return u1.test(n)}function m1(n){return d1.test(n)}function g1(n,e,t){const r=p1(n,e,t);if(console.warn(r),h1.includes(n))throw new RangeError(r)}function p1(n,e,t){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const _1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,v1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,y1=/^'([^]*?)'?$/,C1=/''/g,E1=/[a-zA-Z]/;function w1(n,e,t){var g,v,p,w,C,T,k,I;const r=Wl(),o=(t==null?void 0:t.locale)??r.locale??Ef,a=(t==null?void 0:t.firstWeekContainsDate)??((v=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((w=(p=r.locale)==null?void 0:p.options)==null?void 0:w.firstWeekContainsDate)??1,c=(t==null?void 0:t.weekStartsOn)??((T=(C=t==null?void 0:t.locale)==null?void 0:C.options)==null?void 0:T.weekStartsOn)??r.weekStartsOn??((I=(k=r.locale)==null?void 0:k.options)==null?void 0:I.weekStartsOn)??0,d=Tr(n,t==null?void 0:t.in);if(!IP(d))throw new RangeError("Invalid time value");let h=e.match(v1).map(N=>{const D=N[0];if(D==="p"||D==="P"){const L=l1[D];return L(N,o.formatLong)}return N}).join("").match(_1).map(N=>{if(N==="''")return{isToken:!1,value:"'"};const D=N[0];if(D==="'")return{isToken:!1,value:T1(N)};if(T_[D])return{isToken:!0,value:N};if(D.match(E1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:N}});o.localize.preprocessor&&(h=o.localize.preprocessor(d,h));const m={firstWeekContainsDate:a,weekStartsOn:c,locale:o};return h.map(N=>{if(!N.isToken)return N.value;const D=N.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&m1(D)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&f1(D))&&g1(D,e,String(n));const L=T_[D[0]];return L(d,D,o.localize,m)}).join("")}function T1(n){const e=n.match(y1);return e?e[1].replace(C1,"'"):n}const A_={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},b1=(n,e,t)=>{let r;const o=t!=null&&t.addSuffix?A_[n].withPreposition:A_[n].standalone;return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:"vor "+r:r},I1={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},S1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},A1={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},k1={date:or({formats:I1,defaultWidth:"full"}),time:or({formats:S1,defaultWidth:"full"}),dateTime:or({formats:A1,defaultWidth:"full"})},N1={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},R1=(n,e,t,r)=>N1[n],O1={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},P1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},Th={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},M1={narrow:Th.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:Th.wide},D1={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},L1={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},x1={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},U1=n=>Number(n)+".",B1={ordinalNumber:U1,era:Tt({values:O1,defaultWidth:"wide"}),quarter:Tt({values:P1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Tt({values:Th,formattingValues:M1,defaultWidth:"wide"}),day:Tt({values:D1,defaultWidth:"wide"}),dayPeriod:Tt({values:L1,defaultWidth:"wide",formattingValues:x1,defaultFormattingWidth:"wide"})},F1=/^(\d+)(\.)?/i,V1=/\d+/i,H1={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},$1={any:[/^v/i,/^n/i]},K1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},W1={any:[/1/i,/2/i,/3/i,/4/i]},z1={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},G1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},q1={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},j1={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},Y1={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},J1={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},Q1={ordinalNumber:zl({matchPattern:F1,parsePattern:V1,valueCallback:n=>parseInt(n)}),era:bt({matchPatterns:H1,defaultMatchWidth:"wide",parsePatterns:$1,defaultParseWidth:"any"}),quarter:bt({matchPatterns:K1,defaultMatchWidth:"wide",parsePatterns:W1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bt({matchPatterns:z1,defaultMatchWidth:"wide",parsePatterns:G1,defaultParseWidth:"any"}),day:bt({matchPatterns:q1,defaultMatchWidth:"wide",parsePatterns:j1,defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:Y1,defaultMatchWidth:"wide",parsePatterns:J1,defaultParseWidth:"any"})},X1={code:"de",formatDistance:b1,formatLong:k1,formatRelative:R1,localize:B1,match:Q1,options:{weekStartsOn:1,firstWeekContainsDate:4}},Z1={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},eM=(n,e,t)=>{let r;const o=Z1[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"dans "+r:"il y a "+r:r},tM={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},nM={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},rM={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},oM={date:or({formats:tM,defaultWidth:"full"}),time:or({formats:nM,defaultWidth:"full"}),dateTime:or({formats:rM,defaultWidth:"full"})},iM={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},aM=(n,e,t,r)=>iM[n],sM={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},cM={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},lM={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},uM={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},dM={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},hM=(n,e)=>{const t=Number(n),r=e==null?void 0:e.unit;if(t===0)return"0";const o=["year","week","hour","minute","second"];let a;return t===1?a=r&&o.includes(r)?"ère":"er":a="ème",t+a},fM=["MMM","MMMM"],mM={preprocessor:(n,e)=>n.getDate()===1||!e.some(r=>r.isToken&&fM.includes(r.value))?e:e.map(r=>r.isToken&&r.value==="do"?{isToken:!0,value:"d"}:r),ordinalNumber:hM,era:Tt({values:sM,defaultWidth:"wide"}),quarter:Tt({values:cM,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Tt({values:lM,defaultWidth:"wide"}),day:Tt({values:uM,defaultWidth:"wide"}),dayPeriod:Tt({values:dM,defaultWidth:"wide"})},gM=/^(\d+)(ième|ère|ème|er|e)?/i,pM=/\d+/i,_M={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},vM={any:[/^av/i,/^ap/i]},yM={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},CM={any:[/1/i,/2/i,/3/i,/4/i]},EM={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},wM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},TM={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},bM={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},IM={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},SM={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},AM={ordinalNumber:zl({matchPattern:gM,parsePattern:pM,valueCallback:n=>parseInt(n)}),era:bt({matchPatterns:_M,defaultMatchWidth:"wide",parsePatterns:vM,defaultParseWidth:"any"}),quarter:bt({matchPatterns:yM,defaultMatchWidth:"wide",parsePatterns:CM,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bt({matchPatterns:EM,defaultMatchWidth:"wide",parsePatterns:wM,defaultParseWidth:"any"}),day:bt({matchPatterns:TM,defaultMatchWidth:"wide",parsePatterns:bM,defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:IM,defaultMatchWidth:"any",parsePatterns:SM,defaultParseWidth:"any"})},kM={code:"fr",formatDistance:eM,formatLong:oM,formatRelative:aM,localize:mM,match:AM,options:{weekStartsOn:1,firstWeekContainsDate:4}},NM={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},RM=(n,e,t)=>{let r;const o=NM[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"em "+r:"há "+r:r},OM={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},PM={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},MM={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},DM={date:or({formats:OM,defaultWidth:"full"}),time:or({formats:PM,defaultWidth:"full"}),dateTime:or({formats:MM,defaultWidth:"full"})},LM={lastWeek:n=>{const e=n.getDay();return"'"+(e===0||e===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},xM=(n,e,t,r)=>{const o=LM[n];return typeof o=="function"?o(e):o},UM={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},BM={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},FM={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},VM={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},HM={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},$M={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},KM=(n,e)=>{const t=Number(n);return(e==null?void 0:e.unit)==="week"?t+"ª":t+"º"},WM={ordinalNumber:KM,era:Tt({values:UM,defaultWidth:"wide"}),quarter:Tt({values:BM,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Tt({values:FM,defaultWidth:"wide"}),day:Tt({values:VM,defaultWidth:"wide"}),dayPeriod:Tt({values:HM,defaultWidth:"wide",formattingValues:$M,defaultFormattingWidth:"wide"})},zM=/^(\d+)[ºªo]?/i,GM=/\d+/i,qM={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},jM={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},YM={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},JM={any:[/1/i,/2/i,/3/i,/4/i]},QM={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},XM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},ZM={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},eD={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},tD={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},nD={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},rD={ordinalNumber:zl({matchPattern:zM,parsePattern:GM,valueCallback:n=>parseInt(n,10)}),era:bt({matchPatterns:qM,defaultMatchWidth:"wide",parsePatterns:jM,defaultParseWidth:"any"}),quarter:bt({matchPatterns:YM,defaultMatchWidth:"wide",parsePatterns:JM,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bt({matchPatterns:QM,defaultMatchWidth:"wide",parsePatterns:XM,defaultParseWidth:"any"}),day:bt({matchPatterns:ZM,defaultMatchWidth:"wide",parsePatterns:eD,defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:tD,defaultMatchWidth:"any",parsePatterns:nD,defaultParseWidth:"any"})},oD={code:"pt-BR",formatDistance:RM,formatLong:DM,formatRelative:xM,localize:WM,match:rD,options:{weekStartsOn:0,firstWeekContainsDate:1}};/*!
11
+ This will fail in production.`);c=rs,c._s.has(r)||(f_(r,o,c),process.env.NODE_ENV!=="production"&&(a._pinia=c));const m=c._s.get(r);if(process.env.NODE_ENV!=="production"&&d){const g="__hot:"+r,v=f_(g,er({},o),c,!0);d._hotUpdate(v),delete c.state.value[g],c._s.delete(g)}if(process.env.NODE_ENV!=="production"&&di){const g=l.getCurrentInstance();if(g&&g.proxy&&!d){const v=g.proxy,p="_pStores"in v?v._pStores:v._pStores={};p[r]=m}}return m}return a.$id=r,a}const i0=o0({id:"customizer",state:()=>({Sidebar_drawer:!0,Customizer_drawer:!1,mini_sidebar:!1,setHorizontalLayout:!1,actTheme:"DarkJPLANTheme",fontTheme:"Roboto",inputBg:!1,boxed:!1}),getters:{},actions:{SET_SIDEBAR_DRAWER(){this.Sidebar_drawer=!this.Sidebar_drawer},SET_MINI_SIDEBAR(n){this.mini_sidebar=n},SET_CUSTOMIZER_DRAWER(n){this.Customizer_drawer=n},SET_LAYOUT(n){this.setHorizontalLayout=n},SET_THEME(n){this.actTheme=n},SET_FONT(n){this.fontTheme=n}}}),zi=l.ref({}),Ms=n=>{const e=l.computed(()=>n?zi.value[n]||!1:zi.value.default||!1),t=()=>{n?zi.value[n]=!0:zi.value.default=!0},r=()=>{n?zi.value[n]=!1:zi.value.default=!1};return l.onUnmounted(()=>{r()}),l.onMounted(()=>{r()}),{isDialogActive:e,openDialog:t,closeDialog:r}};var a0=Object.defineProperty,m_=Object.getOwnPropertySymbols,s0=Object.prototype.hasOwnProperty,c0=Object.prototype.propertyIsEnumerable,g_=(n,e,t)=>e in n?a0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,zy=(n,e)=>{for(var t in e||(e={}))s0.call(e,t)&&g_(n,t,e[t]);if(m_)for(var t of m_(e))c0.call(e,t)&&g_(n,t,e[t]);return n},Fl=n=>typeof n=="function",Vl=n=>typeof n=="string",Gy=n=>Vl(n)&&n.trim().length>0,l0=n=>typeof n=="number",hi=n=>typeof n>"u",Es=n=>typeof n=="object"&&n!==null,u0=n=>Hr(n,"tag")&&Gy(n.tag),qy=n=>window.TouchEvent&&n instanceof TouchEvent,jy=n=>Hr(n,"component")&&Yy(n.component),d0=n=>Fl(n)||Es(n),Yy=n=>!hi(n)&&(Vl(n)||d0(n)||jy(n)),p_=n=>Es(n)&&["height","width","right","left","top","bottom"].every(e=>l0(n[e])),Hr=(n,e)=>(Es(n)||Fl(n))&&e in n,h0=(n=>()=>n++)(0);function xd(n){return qy(n)?n.targetTouches[0].clientX:n.clientX}function __(n){return qy(n)?n.targetTouches[0].clientY:n.clientY}var f0=n=>{hi(n.remove)?n.parentNode&&n.parentNode.removeChild(n):n.remove()},Ds=n=>jy(n)?Ds(n.component):u0(n)?l.defineComponent({render(){return n}}):typeof n=="string"?n:l.toRaw(l.unref(n)),m0=n=>{if(typeof n=="string")return n;const e=Hr(n,"props")&&Es(n.props)?n.props:{},t=Hr(n,"listeners")&&Es(n.listeners)?n.listeners:{};return{component:Ds(n),props:e,listeners:t}},g0=()=>typeof window<"u",Hl=class{constructor(){this.allHandlers={}}getHandlers(n){return this.allHandlers[n]||[]}on(n,e){const t=this.getHandlers(n);t.push(e),this.allHandlers[n]=t}off(n,e){const t=this.getHandlers(n);t.splice(t.indexOf(e)>>>0,1)}emit(n,e){this.getHandlers(n).forEach(r=>r(e))}},p0=n=>["on","off","emit"].every(e=>Hr(n,e)&&Fl(n[e]));exports.TYPE=void 0;(function(n){n.SUCCESS="success",n.ERROR="error",n.WARNING="warning",n.INFO="info",n.DEFAULT="default"})(exports.TYPE||(exports.TYPE={}));exports.POSITION=void 0;(function(n){n.TOP_LEFT="top-left",n.TOP_CENTER="top-center",n.TOP_RIGHT="top-right",n.BOTTOM_LEFT="bottom-left",n.BOTTOM_CENTER="bottom-center",n.BOTTOM_RIGHT="bottom-right"})(exports.POSITION||(exports.POSITION={}));var Ln;(function(n){n.ADD="add",n.DISMISS="dismiss",n.UPDATE="update",n.CLEAR="clear",n.UPDATE_DEFAULTS="update_defaults"})(Ln||(Ln={}));var pr="Vue-Toastification",gr={type:{type:String,default:exports.TYPE.DEFAULT},classNames:{type:[String,Array],default:()=>[]},trueBoolean:{type:Boolean,default:!0}},Jy={type:gr.type,customIcon:{type:[String,Boolean,Object,Function],default:!0}},ol={component:{type:[String,Object,Function,Boolean],default:"button"},classNames:gr.classNames,showOnHover:{type:Boolean,default:!1},ariaLabel:{type:String,default:"close"}},wh={timeout:{type:[Number,Boolean],default:5e3},hideProgressBar:{type:Boolean,default:!1},isRunning:{type:Boolean,default:!1}},Qy={transition:{type:[Object,String],default:`${pr}__bounce`}},_0={position:{type:String,default:exports.POSITION.TOP_RIGHT},draggable:gr.trueBoolean,draggablePercent:{type:Number,default:.6},pauseOnFocusLoss:gr.trueBoolean,pauseOnHover:gr.trueBoolean,closeOnClick:gr.trueBoolean,timeout:wh.timeout,hideProgressBar:wh.hideProgressBar,toastClassName:gr.classNames,bodyClassName:gr.classNames,icon:Jy.customIcon,closeButton:ol.component,closeButtonClassName:ol.classNames,showCloseButtonOnHover:ol.showOnHover,accessibility:{type:Object,default:()=>({toastRole:"alert",closeButtonLabel:"close"})},rtl:{type:Boolean,default:!1},eventBus:{type:Object,required:!1,default:()=>new Hl}},v0={id:{type:[String,Number],required:!0,default:0},type:gr.type,content:{type:[String,Object,Function],required:!0,default:""},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0}},y0={container:{type:[Object,Function],default:()=>document.body},newestOnTop:gr.trueBoolean,maxToasts:{type:Number,default:20},transition:Qy.transition,toastDefaults:Object,filterBeforeCreate:{type:Function,default:n=>n},filterToasts:{type:Function,default:n=>n},containerClassName:gr.classNames,onMounted:Function,shareAppContext:[Boolean,Object]},uo={CORE_TOAST:_0,TOAST:v0,CONTAINER:y0,PROGRESS_BAR:wh,ICON:Jy,TRANSITION:Qy,CLOSE_BUTTON:ol},Xy=l.defineComponent({name:"VtProgressBar",props:uo.PROGRESS_BAR,data(){return{hasClass:!0}},computed:{style(){return{animationDuration:`${this.timeout}ms`,animationPlayState:this.isRunning?"running":"paused",opacity:this.hideProgressBar?0:1}},cpClass(){return this.hasClass?`${pr}__progress-bar`:""}},watch:{timeout(){this.hasClass=!1,this.$nextTick(()=>this.hasClass=!0)}},mounted(){this.$el.addEventListener("animationend",this.animationEnded)},beforeUnmount(){this.$el.removeEventListener("animationend",this.animationEnded)},methods:{animationEnded(){this.$emit("close-toast")}}});function C0(n,e){return l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(n.style),class:l.normalizeClass(n.cpClass)},null,6)}Xy.render=C0;var E0=Xy,Zy=l.defineComponent({name:"VtCloseButton",props:uo.CLOSE_BUTTON,computed:{buttonComponent(){return this.component!==!1?Ds(this.component):"button"},classes(){const n=[`${pr}__close-button`];return this.showOnHover&&n.push("show-on-hover"),n.concat(this.classNames)}}}),w0=l.createTextVNode(" × ");function T0(n,e){return l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.buttonComponent),l.mergeProps({"aria-label":n.ariaLabel,class:n.classes},n.$attrs),{default:l.withCtx(()=>[w0]),_:1},16,["aria-label","class"])}Zy.render=T0;var b0=Zy,eC={},I0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"check-circle",class:"svg-inline--fa fa-check-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},S0=l.createElementVNode("path",{fill:"currentColor",d:"M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"},null,-1),A0=[S0];function k0(n,e){return l.openBlock(),l.createElementBlock("svg",I0,A0)}eC.render=k0;var N0=eC,tC={},R0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"info-circle",class:"svg-inline--fa fa-info-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},O0=l.createElementVNode("path",{fill:"currentColor",d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},null,-1),P0=[O0];function M0(n,e){return l.openBlock(),l.createElementBlock("svg",R0,P0)}tC.render=M0;var v_=tC,nC={},D0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-circle",class:"svg-inline--fa fa-exclamation-circle fa-w-16",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},L0=l.createElementVNode("path",{fill:"currentColor",d:"M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),x0=[L0];function U0(n,e){return l.openBlock(),l.createElementBlock("svg",D0,x0)}nC.render=U0;var B0=nC,rC={},F0={"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"exclamation-triangle",class:"svg-inline--fa fa-exclamation-triangle fa-w-18",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512"},V0=l.createElementVNode("path",{fill:"currentColor",d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},null,-1),H0=[V0];function $0(n,e){return l.openBlock(),l.createElementBlock("svg",F0,H0)}rC.render=$0;var K0=rC,oC=l.defineComponent({name:"VtIcon",props:uo.ICON,computed:{customIconChildren(){return Hr(this.customIcon,"iconChildren")?this.trimValue(this.customIcon.iconChildren):""},customIconClass(){return Vl(this.customIcon)?this.trimValue(this.customIcon):Hr(this.customIcon,"iconClass")?this.trimValue(this.customIcon.iconClass):""},customIconTag(){return Hr(this.customIcon,"iconTag")?this.trimValue(this.customIcon.iconTag,"i"):"i"},hasCustomIcon(){return this.customIconClass.length>0},component(){return this.hasCustomIcon?this.customIconTag:Yy(this.customIcon)?Ds(this.customIcon):this.iconTypeComponent},iconTypeComponent(){return{[exports.TYPE.DEFAULT]:v_,[exports.TYPE.INFO]:v_,[exports.TYPE.SUCCESS]:N0,[exports.TYPE.ERROR]:K0,[exports.TYPE.WARNING]:B0}[this.type]},iconClasses(){const n=[`${pr}__icon`];return this.hasCustomIcon?n.concat(this.customIconClass):n}},methods:{trimValue(n,e=""){return Gy(n)?n.trim():e}}});function W0(n,e){return l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.component),{class:l.normalizeClass(n.iconClasses)},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(n.customIconChildren),1)]),_:1},8,["class"])}oC.render=W0;var z0=oC,iC=l.defineComponent({name:"VtToast",components:{ProgressBar:E0,CloseButton:b0,Icon:z0},inheritAttrs:!1,props:Object.assign({},uo.CORE_TOAST,uo.TOAST),data(){return{isRunning:!0,disableTransitions:!1,beingDragged:!1,dragStart:0,dragPos:{x:0,y:0},dragRect:{}}},computed:{classes(){const n=[`${pr}__toast`,`${pr}__toast--${this.type}`,`${this.position}`].concat(this.toastClassName);return this.disableTransitions&&n.push("disable-transition"),this.rtl&&n.push(`${pr}__toast--rtl`),n},bodyClasses(){return[`${pr}__toast-${Vl(this.content)?"body":"component-body"}`].concat(this.bodyClassName)},draggableStyle(){return this.dragStart===this.dragPos.x?{}:this.beingDragged?{transform:`translateX(${this.dragDelta}px)`,opacity:1-Math.abs(this.dragDelta/this.removalDistance)}:{transition:"transform 0.2s, opacity 0.2s",transform:"translateX(0)",opacity:1}},dragDelta(){return this.beingDragged?this.dragPos.x-this.dragStart:0},removalDistance(){return p_(this.dragRect)?(this.dragRect.right-this.dragRect.left)*this.draggablePercent:0}},mounted(){this.draggable&&this.draggableSetup(),this.pauseOnFocusLoss&&this.focusSetup()},beforeUnmount(){this.draggable&&this.draggableCleanup(),this.pauseOnFocusLoss&&this.focusCleanup()},methods:{hasProp:Hr,getVueComponentFromObj:Ds,closeToast(){this.eventBus.emit(Ln.DISMISS,this.id)},clickHandler(){this.onClick&&this.onClick(this.closeToast),this.closeOnClick&&(!this.beingDragged||this.dragStart===this.dragPos.x)&&this.closeToast()},timeoutHandler(){this.closeToast()},hoverPause(){this.pauseOnHover&&(this.isRunning=!1)},hoverPlay(){this.pauseOnHover&&(this.isRunning=!0)},focusPause(){this.isRunning=!1},focusPlay(){this.isRunning=!0},focusSetup(){addEventListener("blur",this.focusPause),addEventListener("focus",this.focusPlay)},focusCleanup(){removeEventListener("blur",this.focusPause),removeEventListener("focus",this.focusPlay)},draggableSetup(){const n=this.$el;n.addEventListener("touchstart",this.onDragStart,{passive:!0}),n.addEventListener("mousedown",this.onDragStart),addEventListener("touchmove",this.onDragMove,{passive:!1}),addEventListener("mousemove",this.onDragMove),addEventListener("touchend",this.onDragEnd),addEventListener("mouseup",this.onDragEnd)},draggableCleanup(){const n=this.$el;n.removeEventListener("touchstart",this.onDragStart),n.removeEventListener("mousedown",this.onDragStart),removeEventListener("touchmove",this.onDragMove),removeEventListener("mousemove",this.onDragMove),removeEventListener("touchend",this.onDragEnd),removeEventListener("mouseup",this.onDragEnd)},onDragStart(n){this.beingDragged=!0,this.dragPos={x:xd(n),y:__(n)},this.dragStart=xd(n),this.dragRect=this.$el.getBoundingClientRect()},onDragMove(n){this.beingDragged&&(n.preventDefault(),this.isRunning&&(this.isRunning=!1),this.dragPos={x:xd(n),y:__(n)})},onDragEnd(){this.beingDragged&&(Math.abs(this.dragDelta)>=this.removalDistance?(this.disableTransitions=!0,this.$nextTick(()=>this.closeToast())):setTimeout(()=>{this.beingDragged=!1,p_(this.dragRect)&&this.pauseOnHover&&this.dragRect.bottom>=this.dragPos.y&&this.dragPos.y>=this.dragRect.top&&this.dragRect.left<=this.dragPos.x&&this.dragPos.x<=this.dragRect.right?this.isRunning=!1:this.isRunning=!0}))}}}),G0=["role"];function q0(n,e){const t=l.resolveComponent("Icon"),r=l.resolveComponent("CloseButton"),o=l.resolveComponent("ProgressBar");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(n.classes),style:l.normalizeStyle(n.draggableStyle),onClick:e[0]||(e[0]=(...a)=>n.clickHandler&&n.clickHandler(...a)),onMouseenter:e[1]||(e[1]=(...a)=>n.hoverPause&&n.hoverPause(...a)),onMouseleave:e[2]||(e[2]=(...a)=>n.hoverPlay&&n.hoverPlay(...a))},[n.icon?(l.openBlock(),l.createBlock(t,{key:0,"custom-icon":n.icon,type:n.type},null,8,["custom-icon","type"])):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{role:n.accessibility.toastRole||"alert",class:l.normalizeClass(n.bodyClasses)},[typeof n.content=="string"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(n.content),1)],2112)):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(n.getVueComponentFromObj(n.content)),l.mergeProps({key:1,"toast-id":n.id},n.hasProp(n.content,"props")?n.content.props:{},l.toHandlers(n.hasProp(n.content,"listeners")?n.content.listeners:{}),{onCloseToast:n.closeToast}),null,16,["toast-id","onCloseToast"]))],10,G0),n.closeButton?(l.openBlock(),l.createBlock(r,{key:1,component:n.closeButton,"class-names":n.closeButtonClassName,"show-on-hover":n.showCloseButtonOnHover,"aria-label":n.accessibility.closeButtonLabel,onClick:l.withModifiers(n.closeToast,["stop"])},null,8,["component","class-names","show-on-hover","aria-label","onClick"])):l.createCommentVNode("v-if",!0),n.timeout?(l.openBlock(),l.createBlock(o,{key:2,"is-running":n.isRunning,"hide-progress-bar":n.hideProgressBar,timeout:n.timeout,onCloseToast:n.timeoutHandler},null,8,["is-running","hide-progress-bar","timeout","onCloseToast"])):l.createCommentVNode("v-if",!0)],38)}iC.render=q0;var j0=iC,aC=l.defineComponent({name:"VtTransition",props:uo.TRANSITION,emits:["leave"],methods:{hasProp:Hr,leave(n){n instanceof HTMLElement&&(n.style.left=n.offsetLeft+"px",n.style.top=n.offsetTop+"px",n.style.width=getComputedStyle(n).width,n.style.position="absolute")}}});function Y0(n,e){return l.openBlock(),l.createBlock(l.TransitionGroup,{tag:"div","enter-active-class":n.transition.enter?n.transition.enter:`${n.transition}-enter-active`,"move-class":n.transition.move?n.transition.move:`${n.transition}-move`,"leave-active-class":n.transition.leave?n.transition.leave:`${n.transition}-leave-active`,onLeave:n.leave},{default:l.withCtx(()=>[l.renderSlot(n.$slots,"default")]),_:3},8,["enter-active-class","move-class","leave-active-class","onLeave"])}aC.render=Y0;var J0=aC,sC=l.defineComponent({name:"VueToastification",devtools:{hide:!0},components:{Toast:j0,VtTransition:J0},props:Object.assign({},uo.CORE_TOAST,uo.CONTAINER,uo.TRANSITION),data(){return{count:0,positions:Object.values(exports.POSITION),toasts:{},defaults:{}}},computed:{toastArray(){return Object.values(this.toasts)},filteredToasts(){return this.defaults.filterToasts(this.toastArray)}},beforeMount(){const n=this.eventBus;n.on(Ln.ADD,this.addToast),n.on(Ln.CLEAR,this.clearToasts),n.on(Ln.DISMISS,this.dismissToast),n.on(Ln.UPDATE,this.updateToast),n.on(Ln.UPDATE_DEFAULTS,this.updateDefaults),this.defaults=this.$props},mounted(){this.setup(this.container)},methods:{async setup(n){Fl(n)&&(n=await n()),f0(this.$el),n.appendChild(this.$el)},setToast(n){hi(n.id)||(this.toasts[n.id]=n)},addToast(n){n.content=m0(n.content);const e=Object.assign({},this.defaults,n.type&&this.defaults.toastDefaults&&this.defaults.toastDefaults[n.type],n),t=this.defaults.filterBeforeCreate(e,this.toastArray);t&&this.setToast(t)},dismissToast(n){const e=this.toasts[n];!hi(e)&&!hi(e.onClose)&&e.onClose(),delete this.toasts[n]},clearToasts(){Object.keys(this.toasts).forEach(n=>{this.dismissToast(n)})},getPositionToasts(n){const e=this.filteredToasts.filter(t=>t.position===n).slice(0,this.defaults.maxToasts);return this.defaults.newestOnTop?e.reverse():e},updateDefaults(n){hi(n.container)||this.setup(n.container),this.defaults=Object.assign({},this.defaults,n)},updateToast({id:n,options:e,create:t}){this.toasts[n]?(e.timeout&&e.timeout===this.toasts[n].timeout&&e.timeout++,this.setToast(Object.assign({},this.toasts[n],e))):t&&this.addToast(Object.assign({},{id:n},e))},getClasses(n){return[`${pr}__container`,n].concat(this.defaults.containerClassName)}}});function Q0(n,e){const t=l.resolveComponent("Toast"),r=l.resolveComponent("VtTransition");return l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.positions,o=>(l.openBlock(),l.createElementBlock("div",{key:o},[l.createVNode(r,{transition:n.defaults.transition,class:l.normalizeClass(n.getClasses(o))},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(n.getPositionToasts(o),a=>(l.openBlock(),l.createBlock(t,l.mergeProps({key:a.id},a),null,16))),128))]),_:2},1032,["transition","class"])]))),128))])}sC.render=Q0;var X0=sC,y_=(n={},e=!0)=>{const t=n.eventBus=n.eventBus||new Hl;e&&l.nextTick(()=>{const a=l.createApp(X0,zy({},n)),c=a.mount(document.createElement("div")),d=n.onMounted;if(hi(d)||d(c,a),n.shareAppContext){const h=n.shareAppContext;h===!0?console.warn(`[${pr}] App to share context with was not provided.`):(a._context.components=h._context.components,a._context.directives=h._context.directives,a._context.mixins=h._context.mixins,a._context.provides=h._context.provides,a.config.globalProperties=h.config.globalProperties)}});const r=(a,c)=>{const d=Object.assign({},{id:h0(),type:exports.TYPE.DEFAULT},c,{content:a});return t.emit(Ln.ADD,d),d.id};r.clear=()=>t.emit(Ln.CLEAR,void 0),r.updateDefaults=a=>{t.emit(Ln.UPDATE_DEFAULTS,a)},r.dismiss=a=>{t.emit(Ln.DISMISS,a)};function o(a,{content:c,options:d},h=!1){const m=Object.assign({},d,{content:c});t.emit(Ln.UPDATE,{id:a,options:m,create:h})}return r.update=o,r.success=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.SUCCESS})),r.info=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.INFO})),r.error=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.ERROR})),r.warning=(a,c)=>r(a,Object.assign({},c,{type:exports.TYPE.WARNING})),r},Z0=()=>{const n=()=>console.warn(`[${pr}] This plugin does not support SSR!`);return new Proxy(n,{get(){return n}})};function ws(n){return g0()?p0(n)?y_({eventBus:n},!1):y_(n,!0):Z0()}var $l=Symbol("VueToastification"),yf=new Hl,eP=(n,e)=>{(e==null?void 0:e.shareAppContext)===!0&&(e.shareAppContext=n);const t=ws(zy({eventBus:yf},e));n.provide($l,t)},tP=n=>{const e=ws(n);l.getCurrentInstance()&&l.provide($l,e)},wr=n=>{if(n)return ws(n);const e=l.getCurrentInstance()?l.inject($l,void 0):void 0;return e||ws(yf)},nP=eP;const ve=l.ref(!1);var rP={name:"CircleOffIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-circle-off",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M20.042 16.045a9 9 0 0 0 -12.087 -12.087m-2.318 1.677a9 9 0 1 0 12.725 12.73"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 3l18 18"},null),l.createTextVNode(" ")])}},oP={name:"DotsVerticalIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-dots-vertical",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},iP={name:"DotsIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-dots",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},aP={name:"EraserIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-eraser",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M18 13.3l-6.3 -6.3"},null),l.createTextVNode(" ")])}},cC={name:"ExclamationCircleIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-exclamation-circle",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 9v4"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 16v.01"},null),l.createTextVNode(" ")])}},sP={name:"FilterIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-filter",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null),l.createTextVNode(" ")])}},cP={name:"GripVerticalIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-grip-vertical",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null),l.createTextVNode(" ")])}},lP={name:"HierarchyIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-hierarchy",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M5 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M19 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M6.5 17.5l5.5 -4.5l5.5 4.5"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M12 7l0 6"},null),l.createTextVNode(" ")])}},uP={name:"LayoutSidebarRightCollapseIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-layout-sidebar-right-collapse",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M15 4v16"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M9 10l2 2l-2 2"},null),l.createTextVNode(" ")])}},dP={name:"RefreshIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-refresh",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null),l.createTextVNode(" ")])}},hP={name:"SearchIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-search",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M21 21l-6 -6"},null),l.createTextVNode(" ")])}},fP={name:"TableIcon",props:{size:{type:[Number,String],default:24}},render(){const n=this.$props.size+"px",e=this.$data.attrs||{},t={width:e.width||n,height:e.height||n};return l.createVNode("svg",l.mergeProps({xmlns:"http://www.w3.org/2000/svg",class:"icon-tabler icon-tabler-table",width:"24",height:"24",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},t),[l.createTextVNode(" "),l.createVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M3 10h18"},null),l.createTextVNode(" "),l.createVNode("path",{d:"M10 3v18"},null),l.createTextVNode(" ")])}};const mP={class:"d-flex align-center"},gP={key:1},pP={class:"ms-auto"},Ls=l.defineComponent({__name:"JDialog",props:{ddId:{},variant:{default:"global"},title:{},text:{},width:{default:"500"},reference:{type:Boolean},buttons:{type:Boolean,default:!0},scrim:{default:"background"}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=n,r=e,o=l.ref(!1),{isDialogActive:a,closeDialog:c}=Ms(t.ddId);async function d(){try{await r("onCancel")}catch(m){console.error(m)}c()}async function h(){o.value=!0;try{await r("onSave")}catch(m){console.error(m)}o.value=!1,c()}return(m,g)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[m.variant==="global"?(l.openBlock(),l.createBlock(Zc.VDialog,{key:0,scrim:t.scrim,width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[0]||(g[0]=v=>l.isRef(a)?a.value=v:null),"onClick:outside":d},{default:l.withCtx(()=>[l.createVNode(xt.VCard,{rounded:"",loading:o.value},{default:l.withCtx(()=>[l.createVNode(xt.VCardTitle,{class:"mt-2 px-5 d-flex"},{default:l.withCtx(()=>[l.createElementVNode("div",mP,[m.$slots.title?l.renderSlot(m.$slots,"title",{key:0}):(l.openBlock(),l.createElementBlock("div",gP,l.toDisplayString(t.title),1))]),l.createElementVNode("div",pP,[l.renderSlot(m.$slots,"heading-actions"),l.createVNode(it.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:d,variant:"plain"})])]),_:3}),l.createVNode(pi.VDivider,{class:"mx-5"}),l.createVNode(xt.VCardText,{class:"overflow-y-scroll"},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"default")]),_:3}),m.$slots.footer?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(pi.VDivider,{class:"mx-5 mt-2"}),l.createVNode(xt.VCardActions,null,{default:l.withCtx(()=>[l.renderSlot(m.$slots,"footer")]),_:3})],64)):l.createCommentVNode("",!0),t.buttons?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createVNode(pi.VDivider,{class:"mx-5 mt-2"}),l.createVNode(xt.VCardActions,null,{default:l.withCtx(()=>[m.$slots.metadata?(l.openBlock(),l.createBlock(Qe.VCol,{key:0,cols:"auto",class:"text-sm-subtitle-2 text-medium-emphasis ma-0 pa-0"},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"metadata")]),_:3})):l.createCommentVNode("",!0),l.createVNode(Qe.VSpacer),l.createVNode(it.VBtn,{class:"j-btn-form",variant:"outlined",color:"secondary",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.cancel")),1)]),_:1}),l.createVNode(it.VBtn,{class:"j-btn-form",variant:"flat",color:"secondary",onClick:h,loading:o.value},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.save")),1)]),_:1},8,["loading"])]),_:3})],64)):l.createCommentVNode("",!0)]),_:3},8,["loading"])]),_:3},8,["scrim","width","modelValue"])):l.createCommentVNode("",!0),m.variant==="confirm"?(l.openBlock(),l.createBlock(Zc.VDialog,{key:1,scrim:"background",width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[1]||(g[1]=v=>l.isRef(a)?a.value=v:null),"onClick:outside":d},{default:l.withCtx(()=>[l.createVNode(xt.VCard,{loading:o.value,title:t.title,rounded:"","min-height":"300"},{prepend:l.withCtx(()=>[l.createVNode(l.unref(cC),{color:"rgb(var(--v-theme-secondary))"})]),append:l.withCtx(()=>[l.createVNode(it.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:d,variant:"plain"})]),default:l.withCtx(()=>[l.createVNode(xt.VCardText,{class:"text-center mt-7"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.text),1)]),_:1}),l.createVNode(xt.VCardActions,{class:"d-flex"},{default:l.withCtx(()=>[l.createVNode(it.VBtn,{class:"flex-grow-1",variant:"outlined",color:"secondary",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.cancel")),1)]),_:1}),l.createVNode(it.VBtn,{class:"flex-grow-1",variant:"flat",color:"secondary",onClick:h},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(m.$t("actions.confirm")),1)]),_:1})]),_:1})]),_:1},8,["loading","title"])]),_:1},8,["width","modelValue"])):l.createCommentVNode("",!0),m.variant==="empty"?(l.openBlock(),l.createBlock(Zc.VDialog,{key:2,scrim:t.scrim,width:t.width,modelValue:l.unref(a),"onUpdate:modelValue":g[2]||(g[2]=v=>l.isRef(a)?a.value=v:null),"onClick:outside":d},{default:l.withCtx(()=>[l.renderSlot(m.$slots,"default")]),_:3},8,["scrim","width","modelValue"])):l.createCommentVNode("",!0)],64))}}),Cf=l.defineComponent({__name:"DeleteAllBtn",emits:["removeAll"],setup(n,{emit:e}){const{openDialog:t}=Ms("delete-all-__J"),r=e;return(o,a)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(Ls,{"dd-id":"delete-all-__J",variant:"confirm",title:"Confirm delete",text:"Are you sure you want to delete all selected items?",onOnSave:a[0]||(a[0]=()=>r("removeAll"))}),l.createVNode(it.VBtn,{onClick:l.unref(t),variant:"plain",color:"secondary","prepend-icon":"mdi-delete"},{default:l.withCtx(()=>a[1]||(a[1]=[l.createTextVNode(" Delete")])),_:1},8,["onClick"])],64))}}),lC=l.defineComponent({__name:"EditButton",emits:["editAll"],setup(n,{emit:e}){const t=e;return(r,o)=>(l.openBlock(),l.createBlock(it.VBtn,{onClick:o[0]||(o[0]=a=>t("editAll")),variant:"plain",color:"secondary","prepend-icon":"mdi-pencil"},{default:l.withCtx(()=>o[1]||(o[1]=[l.createTextVNode(" Edit")])),_:1}))}}),uC=l.defineComponent({__name:"DotsMenu",props:{variant:{default:"text"},color:{},orientation:{},size:{}},setup(n){return(e,t)=>(l.openBlock(),l.createBlock(l.unref(Vo.VMenu),{"close-on-content-click":!0},{activator:l.withCtx(({props:r})=>[l.createVNode(l.unref(Vo.VBtn),l.mergeProps({variant:e.variant},r,{icon:""}),{default:l.withCtx(()=>[e.orientation==="y"?(l.openBlock(),l.createBlock(l.unref(oP),{key:0,size:e.size,color:`rgb(var(--v-theme-${e.color}))`,class:"cursor-pointer"},null,8,["size","color"])):(l.openBlock(),l.createBlock(l.unref(iP),{key:1,size:e.size,color:`rgb(var(--v-theme-${e.color}))`,class:"cursor-pointer"},null,8,["size","color"]))]),_:2},1040,["variant"])]),default:l.withCtx(()=>[l.renderSlot(e.$slots,"default")]),_:3}))}}),Kl=l.defineComponent({__name:"ParentCard",props:{title:{},height:{default:"100%"},loading:{type:Boolean}},setup(n){const e=n;return(t,r)=>(l.openBlock(),l.createBlock(xt.VCard,{"min-height":t.height,height:t.height,loading:t.loading,class:"bg-surface rounded-sm pa-5"},{default:l.withCtx(()=>[e.title?(l.openBlock(),l.createBlock(xt.VCardTitle,{key:0,class:"pa-0"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(e.title),1)]),_:1})):l.createCommentVNode("",!0),l.renderSlot(t.$slots,"default")]),_:3},8,["min-height","height","loading"]))}}),dC=l.defineComponent({__name:"ConfirmDialog",props:{title:{},text:{},width:{},loading:{type:Boolean}},emits:["onSave","onCancel"],setup(n,{emit:e}){const t=n,r=l.ref(!1),o=l.ref(!1);l.onUnmounted(()=>{r.value=!1});const a=e;async function c(){try{await a("onCancel")}catch(h){console.error(h)}r.value=!1}async function d(){o.value=!0;try{await a("onSave")}catch(h){console.error(h)}o.value=!1,r.value=!1}return(h,m)=>(l.openBlock(),l.createBlock(Zc.VDialog,{scrim:"rgb(0,0,0,100)",width:t.width},{activator:l.withCtx(({isActive:g,props:v})=>[l.renderSlot(h.$slots,"button",l.normalizeProps(l.guardReactiveProps({isActive:g,props:v})))]),default:l.withCtx(({isActive:g})=>[l.createVNode(xt.VCard,{loading:o.value,title:t.title,rounded:"","min-height":"300"},{prepend:l.withCtx(()=>[l.createVNode(l.unref(cC),{color:"rgb(var(--v-theme-secondary))"})]),append:l.withCtx(()=>[l.createVNode(it.VBtn,{class:"ms-auto",icon:"mdi-window-close",onClick:c,variant:"plain"})]),default:l.withCtx(()=>[l.createVNode(xt.VCardText,{class:"text-center mt-7"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(t.text),1)]),_:1}),l.createVNode(xt.VCardActions,{class:"d-flex"},{default:l.withCtx(()=>[l.createVNode(it.VBtn,{class:"flex-grow-1",variant:"outlined",color:"secondary",onClick:c},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.$t("actions.cancel")),1)]),_:1}),l.createVNode(it.VBtn,{class:"flex-grow-1",variant:"flat",color:"secondary",onClick:d},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.$t("actions.confirm")),1)]),_:1})]),_:1})]),_:1},8,["loading","title"])]),_:3},8,["width"]))}}),Ud="https://app-files.jplan.com.br/pub/resources/profile-placeholder.svg",hC=l.defineComponent({__name:"JAvatar",props:{src:{}},setup(n){const e=n,t=l.ref(e.src),r=l.computed(()=>t.value||Ud);function o(){t.value=Ud}return(a,c)=>(l.openBlock(),l.createBlock(ky.VAvatar,{size:"50"},{default:l.withCtx(()=>[l.createVNode(mf.VImg,{src:r.value,"lazy-src":Ud,onError:o,width:"50",alt:"profile-placeholder"},null,8,["src"])]),_:1}))}}),Bd="https://app-files.jplan.com.br/pub/resources/profile-placeholder.svg",fC=l.defineComponent({__name:"AvatarPicture",props:{img:{},size:{}},setup(n){const e=n,t=l.ref(e.img),r=l.computed(()=>t.value||Bd);function o(){t.value=Bd}return(a,c)=>(l.openBlock(),l.createBlock(ky.VAvatar,{size:a.size},{default:l.withCtx(()=>[l.createVNode(mf.VImg,{src:r.value,"lazy-src":Bd,onError:o,width:"40",alt:"Avatar"},null,8,["src"])]),_:1},8,["size"]))}}),_P=l.defineComponent({__name:"ContextMenu",setup(n){const e=l.ref(!1),t=l.ref({x:0,y:0}),r=a=>{a.preventDefault(),t.value={x:a.clientX,y:a.clientY},e.value=!0},o=()=>{e.value=!1};return l.onMounted(()=>{document.addEventListener("click",o)}),l.onUnmounted(()=>{document.removeEventListener("click",o)}),(a,c)=>(l.openBlock(),l.createElementBlock("div",{onContextmenu:l.withModifiers(r,["right"]),class:"relative w-full h-full"},[l.renderSlot(a.$slots,"default",{},void 0,!0),l.createVNode(gf.VMenu,{modelValue:e.value,"onUpdate:modelValue":c[0]||(c[0]=d=>e.value=d),style:l.normalizeStyle({top:`${t.value.y}px`,left:`${t.value.x}px`,position:"absolute"})},{default:l.withCtx(()=>[l.createVNode(Qt.VList,{onClick:o},{default:l.withCtx(()=>[l.renderSlot(a.$slots,"actions",{},void 0,!0)]),_:3})]),_:3},8,["modelValue","style"])],32))}}),Sa=(n,e)=>{const t=n.__vccOpts||n;for(const[r,o]of e)t[r]=o;return t},mC=Sa(_P,[["__scopeId","data-v-ad4e4a5d"]]),vP={class:"d-inline-flex"},gC=l.defineComponent({__name:"UiTable",props:l.mergeModels({headers:{},items:{default:()=>[]},actions:{},loading:{type:Boolean},columns:{default:()=>[]},sortBy:{}},{selection:{},selectionModifiers:{}}),emits:["update:selection"],setup(n){const e=n,t=l.computed(()=>{var o;if(e.headers)return e.headers;if(e.columns)return(o=e.columns)==null?void 0:o.filter(a=>a.checked)}),r=l.useModel(n,"selection");return(o,a)=>(l.openBlock(),l.createBlock(Ny.VDataTable,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=c=>r.value=c),"fixed-header":"","fixed-footer":"","items-per-page":"10",headers:t.value,items:o.items,"items-length":o.items.length,loading:o.loading||!1,"item-value":"_id","return-object":"","show-select":"","sort-by":o.sortBy,height:"calc(100vh - 320px)",class:"customize-table"},{top:l.withCtx(()=>a[1]||(a[1]=[l.createElementVNode("span",{class:"mt-5"},null,-1)])),"item.avatar":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"avatar",{item:c})]),"item.active":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"active",{item:c})]),"item.image":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"image",{item:c})]),"item.picture":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"picture",{item:c})]),"item.icon":l.withCtx(({item:c})=>[l.renderSlot(o.$slots,"icon",{item:c})]),"item.actions":l.withCtx(({item:c})=>[l.createElementVNode("div",vP,[l.renderSlot(o.$slots,"actions",{item:c})])]),"no-data":l.withCtx(()=>[!o.loading&&o.items.length===0?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(" This table is empty.")],64)):l.createCommentVNode("",!0)]),_:3},8,["modelValue","headers","items","items-length","loading","sort-by"]))}}),pC=6048e5,yP=864e5,C_=Symbol.for("constructDateFrom");function $o(n,e){return typeof n=="function"?n(e):n&&typeof n=="object"&&C_ in n?n[C_](e):n instanceof Date?new n.constructor(e):new Date(e)}function Tr(n,e){return $o(e||n,n)}let CP={};function Wl(){return CP}function Ts(n,e){var d,h,m,g;const t=Wl(),r=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??t.weekStartsOn??((g=(m=t.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,o=Tr(n,e==null?void 0:e.in),a=o.getDay(),c=(a<r?7:0)+a-r;return o.setDate(o.getDate()-c),o.setHours(0,0,0,0),o}function vl(n,e){return Ts(n,{...e,weekStartsOn:1})}function _C(n,e){const t=Tr(n,e==null?void 0:e.in),r=t.getFullYear(),o=$o(t,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const a=vl(o),c=$o(t,0);c.setFullYear(r,0,4),c.setHours(0,0,0,0);const d=vl(c);return t.getTime()>=a.getTime()?r+1:t.getTime()>=d.getTime()?r:r-1}function E_(n){const e=Tr(n),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+n-+t}function EP(n,...e){const t=$o.bind(null,e.find(r=>typeof r=="object"));return e.map(t)}function w_(n,e){const t=Tr(n,e==null?void 0:e.in);return t.setHours(0,0,0,0),t}function wP(n,e,t){const[r,o]=EP(t==null?void 0:t.in,n,e),a=w_(r),c=w_(o),d=+a-E_(a),h=+c-E_(c);return Math.round((d-h)/yP)}function TP(n,e){const t=_C(n,e),r=$o(n,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),vl(r)}function bP(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function IP(n){return!(!bP(n)&&typeof n!="number"||isNaN(+Tr(n)))}function SP(n,e){const t=Tr(n,e==null?void 0:e.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}const AP={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},kP=(n,e,t)=>{let r;const o=AP[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:r+" ago":r};function or(n){return(e={})=>{const t=e.width?String(e.width):n.defaultWidth;return n.formats[t]||n.formats[n.defaultWidth]}}const NP={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},RP={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},OP={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},PP={date:or({formats:NP,defaultWidth:"full"}),time:or({formats:RP,defaultWidth:"full"}),dateTime:or({formats:OP,defaultWidth:"full"})},MP={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},DP=(n,e,t,r)=>MP[n];function Tt(n){return(e,t)=>{const r=t!=null&&t.context?String(t.context):"standalone";let o;if(r==="formatting"&&n.formattingValues){const c=n.defaultFormattingWidth||n.defaultWidth,d=t!=null&&t.width?String(t.width):c;o=n.formattingValues[d]||n.formattingValues[c]}else{const c=n.defaultWidth,d=t!=null&&t.width?String(t.width):n.defaultWidth;o=n.values[d]||n.values[c]}const a=n.argumentCallback?n.argumentCallback(e):e;return o[a]}}const LP={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xP={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},UP={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},BP={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},FP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},VP={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},HP=(n,e)=>{const t=Number(n),r=t%100;if(r>20||r<10)switch(r%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},$P={ordinalNumber:HP,era:Tt({values:LP,defaultWidth:"wide"}),quarter:Tt({values:xP,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Tt({values:UP,defaultWidth:"wide"}),day:Tt({values:BP,defaultWidth:"wide"}),dayPeriod:Tt({values:FP,defaultWidth:"wide",formattingValues:VP,defaultFormattingWidth:"wide"})};function bt(n){return(e,t={})=>{const r=t.width,o=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],a=e.match(o);if(!a)return null;const c=a[0],d=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],h=Array.isArray(d)?WP(d,v=>v.test(c)):KP(d,v=>v.test(c));let m;m=n.valueCallback?n.valueCallback(h):h,m=t.valueCallback?t.valueCallback(m):m;const g=e.slice(c.length);return{value:m,rest:g}}}function KP(n,e){for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&e(n[t]))return t}function WP(n,e){for(let t=0;t<n.length;t++)if(e(n[t]))return t}function zl(n){return(e,t={})=>{const r=e.match(n.matchPattern);if(!r)return null;const o=r[0],a=e.match(n.parsePattern);if(!a)return null;let c=n.valueCallback?n.valueCallback(a[0]):a[0];c=t.valueCallback?t.valueCallback(c):c;const d=e.slice(o.length);return{value:c,rest:d}}}const zP=/^(\d+)(th|st|nd|rd)?/i,GP=/\d+/i,qP={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},jP={any:[/^b/i,/^(a|c)/i]},YP={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},JP={any:[/1/i,/2/i,/3/i,/4/i]},QP={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},XP={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ZP={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},e1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},t1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},n1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},r1={ordinalNumber:zl({matchPattern:zP,parsePattern:GP,valueCallback:n=>parseInt(n,10)}),era:bt({matchPatterns:qP,defaultMatchWidth:"wide",parsePatterns:jP,defaultParseWidth:"any"}),quarter:bt({matchPatterns:YP,defaultMatchWidth:"wide",parsePatterns:JP,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bt({matchPatterns:QP,defaultMatchWidth:"wide",parsePatterns:XP,defaultParseWidth:"any"}),day:bt({matchPatterns:ZP,defaultMatchWidth:"wide",parsePatterns:e1,defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:t1,defaultMatchWidth:"any",parsePatterns:n1,defaultParseWidth:"any"})},Ef={code:"en-US",formatDistance:kP,formatLong:PP,formatRelative:DP,localize:$P,match:r1,options:{weekStartsOn:0,firstWeekContainsDate:1}};function o1(n,e){const t=Tr(n,e==null?void 0:e.in);return wP(t,SP(t))+1}function i1(n,e){const t=Tr(n,e==null?void 0:e.in),r=+vl(t)-+TP(t);return Math.round(r/pC)+1}function vC(n,e){var g,v,p,w;const t=Tr(n,e==null?void 0:e.in),r=t.getFullYear(),o=Wl(),a=(e==null?void 0:e.firstWeekContainsDate)??((v=(g=e==null?void 0:e.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??o.firstWeekContainsDate??((w=(p=o.locale)==null?void 0:p.options)==null?void 0:w.firstWeekContainsDate)??1,c=$o((e==null?void 0:e.in)||n,0);c.setFullYear(r+1,0,a),c.setHours(0,0,0,0);const d=Ts(c,e),h=$o((e==null?void 0:e.in)||n,0);h.setFullYear(r,0,a),h.setHours(0,0,0,0);const m=Ts(h,e);return+t>=+d?r+1:+t>=+m?r:r-1}function a1(n,e){var d,h,m,g;const t=Wl(),r=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??t.firstWeekContainsDate??((g=(m=t.locale)==null?void 0:m.options)==null?void 0:g.firstWeekContainsDate)??1,o=vC(n,e),a=$o((e==null?void 0:e.in)||n,0);return a.setFullYear(o,0,r),a.setHours(0,0,0,0),Ts(a,e)}function s1(n,e){const t=Tr(n,e==null?void 0:e.in),r=+Ts(t,e)-+a1(t,e);return Math.round(r/pC)+1}function We(n,e){const t=n<0?"-":"",r=Math.abs(n).toString().padStart(e,"0");return t+r}const Ro={y(n,e){const t=n.getFullYear(),r=t>0?t:1-t;return We(e==="yy"?r%100:r,e.length)},M(n,e){const t=n.getMonth();return e==="M"?String(t+1):We(t+1,2)},d(n,e){return We(n.getDate(),e.length)},a(n,e){const t=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(n,e){return We(n.getHours()%12||12,e.length)},H(n,e){return We(n.getHours(),e.length)},m(n,e){return We(n.getMinutes(),e.length)},s(n,e){return We(n.getSeconds(),e.length)},S(n,e){const t=e.length,r=n.getMilliseconds(),o=Math.trunc(r*Math.pow(10,t-3));return We(o,e.length)}},Gi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},T_={G:function(n,e,t){const r=n.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(r,{width:"abbreviated"});case"GGGGG":return t.era(r,{width:"narrow"});case"GGGG":default:return t.era(r,{width:"wide"})}},y:function(n,e,t){if(e==="yo"){const r=n.getFullYear(),o=r>0?r:1-r;return t.ordinalNumber(o,{unit:"year"})}return Ro.y(n,e)},Y:function(n,e,t,r){const o=vC(n,r),a=o>0?o:1-o;if(e==="YY"){const c=a%100;return We(c,2)}return e==="Yo"?t.ordinalNumber(a,{unit:"year"}):We(a,e.length)},R:function(n,e){const t=_C(n);return We(t,e.length)},u:function(n,e){const t=n.getFullYear();return We(t,e.length)},Q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return We(r,2);case"Qo":return t.ordinalNumber(r,{unit:"quarter"});case"QQQ":return t.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(r,{width:"wide",context:"formatting"})}},q:function(n,e,t){const r=Math.ceil((n.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return We(r,2);case"qo":return t.ordinalNumber(r,{unit:"quarter"});case"qqq":return t.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(r,{width:"wide",context:"standalone"})}},M:function(n,e,t){const r=n.getMonth();switch(e){case"M":case"MM":return Ro.M(n,e);case"Mo":return t.ordinalNumber(r+1,{unit:"month"});case"MMM":return t.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(r,{width:"wide",context:"formatting"})}},L:function(n,e,t){const r=n.getMonth();switch(e){case"L":return String(r+1);case"LL":return We(r+1,2);case"Lo":return t.ordinalNumber(r+1,{unit:"month"});case"LLL":return t.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(r,{width:"wide",context:"standalone"})}},w:function(n,e,t,r){const o=s1(n,r);return e==="wo"?t.ordinalNumber(o,{unit:"week"}):We(o,e.length)},I:function(n,e,t){const r=i1(n);return e==="Io"?t.ordinalNumber(r,{unit:"week"}):We(r,e.length)},d:function(n,e,t){return e==="do"?t.ordinalNumber(n.getDate(),{unit:"date"}):Ro.d(n,e)},D:function(n,e,t){const r=o1(n);return e==="Do"?t.ordinalNumber(r,{unit:"dayOfYear"}):We(r,e.length)},E:function(n,e,t){const r=n.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(r,{width:"short",context:"formatting"});case"EEEE":default:return t.day(r,{width:"wide",context:"formatting"})}},e:function(n,e,t,r){const o=n.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return We(a,2);case"eo":return t.ordinalNumber(a,{unit:"day"});case"eee":return t.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(o,{width:"short",context:"formatting"});case"eeee":default:return t.day(o,{width:"wide",context:"formatting"})}},c:function(n,e,t,r){const o=n.getDay(),a=(o-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return We(a,e.length);case"co":return t.ordinalNumber(a,{unit:"day"});case"ccc":return t.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(o,{width:"narrow",context:"standalone"});case"cccccc":return t.day(o,{width:"short",context:"standalone"});case"cccc":default:return t.day(o,{width:"wide",context:"standalone"})}},i:function(n,e,t){const r=n.getDay(),o=r===0?7:r;switch(e){case"i":return String(o);case"ii":return We(o,e.length);case"io":return t.ordinalNumber(o,{unit:"day"});case"iii":return t.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(r,{width:"short",context:"formatting"});case"iiii":default:return t.day(r,{width:"wide",context:"formatting"})}},a:function(n,e,t){const o=n.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(n,e,t){const r=n.getHours();let o;switch(r===12?o=Gi.noon:r===0?o=Gi.midnight:o=r/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(n,e,t){const r=n.getHours();let o;switch(r>=17?o=Gi.evening:r>=12?o=Gi.afternoon:r>=4?o=Gi.morning:o=Gi.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(n,e,t){if(e==="ho"){let r=n.getHours()%12;return r===0&&(r=12),t.ordinalNumber(r,{unit:"hour"})}return Ro.h(n,e)},H:function(n,e,t){return e==="Ho"?t.ordinalNumber(n.getHours(),{unit:"hour"}):Ro.H(n,e)},K:function(n,e,t){const r=n.getHours()%12;return e==="Ko"?t.ordinalNumber(r,{unit:"hour"}):We(r,e.length)},k:function(n,e,t){let r=n.getHours();return r===0&&(r=24),e==="ko"?t.ordinalNumber(r,{unit:"hour"}):We(r,e.length)},m:function(n,e,t){return e==="mo"?t.ordinalNumber(n.getMinutes(),{unit:"minute"}):Ro.m(n,e)},s:function(n,e,t){return e==="so"?t.ordinalNumber(n.getSeconds(),{unit:"second"}):Ro.s(n,e)},S:function(n,e){return Ro.S(n,e)},X:function(n,e,t){const r=n.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return I_(r);case"XXXX":case"XX":return li(r);case"XXXXX":case"XXX":default:return li(r,":")}},x:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"x":return I_(r);case"xxxx":case"xx":return li(r);case"xxxxx":case"xxx":default:return li(r,":")}},O:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+b_(r,":");case"OOOO":default:return"GMT"+li(r,":")}},z:function(n,e,t){const r=n.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+b_(r,":");case"zzzz":default:return"GMT"+li(r,":")}},t:function(n,e,t){const r=Math.trunc(+n/1e3);return We(r,e.length)},T:function(n,e,t){return We(+n,e.length)}};function b_(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),o=Math.trunc(r/60),a=r%60;return a===0?t+String(o):t+String(o)+e+We(a,2)}function I_(n,e){return n%60===0?(n>0?"-":"+")+We(Math.abs(n)/60,2):li(n,e)}function li(n,e=""){const t=n>0?"-":"+",r=Math.abs(n),o=We(Math.trunc(r/60),2),a=We(r%60,2);return t+o+e+a}const S_=(n,e)=>{switch(n){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},yC=(n,e)=>{switch(n){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},c1=(n,e)=>{const t=n.match(/(P+)(p+)?/)||[],r=t[1],o=t[2];if(!o)return S_(n,e);let a;switch(r){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;case"PPPP":default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",S_(r,e)).replace("{{time}}",yC(o,e))},l1={p:yC,P:c1},u1=/^D+$/,d1=/^Y+$/,h1=["D","DD","YY","YYYY"];function f1(n){return u1.test(n)}function m1(n){return d1.test(n)}function g1(n,e,t){const r=p1(n,e,t);if(console.warn(r),h1.includes(n))throw new RangeError(r)}function p1(n,e,t){const r=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${e}\`) for formatting ${r} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const _1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,v1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,y1=/^'([^]*?)'?$/,C1=/''/g,E1=/[a-zA-Z]/;function w1(n,e,t){var g,v,p,w,C,T,k,I;const r=Wl(),o=(t==null?void 0:t.locale)??r.locale??Ef,a=(t==null?void 0:t.firstWeekContainsDate)??((v=(g=t==null?void 0:t.locale)==null?void 0:g.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((w=(p=r.locale)==null?void 0:p.options)==null?void 0:w.firstWeekContainsDate)??1,c=(t==null?void 0:t.weekStartsOn)??((T=(C=t==null?void 0:t.locale)==null?void 0:C.options)==null?void 0:T.weekStartsOn)??r.weekStartsOn??((I=(k=r.locale)==null?void 0:k.options)==null?void 0:I.weekStartsOn)??0,d=Tr(n,t==null?void 0:t.in);if(!IP(d))throw new RangeError("Invalid time value");let h=e.match(v1).map(N=>{const D=N[0];if(D==="p"||D==="P"){const L=l1[D];return L(N,o.formatLong)}return N}).join("").match(_1).map(N=>{if(N==="''")return{isToken:!1,value:"'"};const D=N[0];if(D==="'")return{isToken:!1,value:T1(N)};if(T_[D])return{isToken:!0,value:N};if(D.match(E1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:N}});o.localize.preprocessor&&(h=o.localize.preprocessor(d,h));const m={firstWeekContainsDate:a,weekStartsOn:c,locale:o};return h.map(N=>{if(!N.isToken)return N.value;const D=N.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&m1(D)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&f1(D))&&g1(D,e,String(n));const L=T_[D[0]];return L(d,D,o.localize,m)}).join("")}function T1(n){const e=n.match(y1);return e?e[1].replace(C1,"'"):n}const A_={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},b1=(n,e,t)=>{let r;const o=t!=null&&t.addSuffix?A_[n].withPreposition:A_[n].standalone;return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+r:"vor "+r:r},I1={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},S1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},A1={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},k1={date:or({formats:I1,defaultWidth:"full"}),time:or({formats:S1,defaultWidth:"full"}),dateTime:or({formats:A1,defaultWidth:"full"})},N1={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},R1=(n,e,t,r)=>N1[n],O1={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},P1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},Th={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},M1={narrow:Th.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:Th.wide},D1={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},L1={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},x1={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},U1=n=>Number(n)+".",B1={ordinalNumber:U1,era:Tt({values:O1,defaultWidth:"wide"}),quarter:Tt({values:P1,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Tt({values:Th,formattingValues:M1,defaultWidth:"wide"}),day:Tt({values:D1,defaultWidth:"wide"}),dayPeriod:Tt({values:L1,defaultWidth:"wide",formattingValues:x1,defaultFormattingWidth:"wide"})},F1=/^(\d+)(\.)?/i,V1=/\d+/i,H1={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},$1={any:[/^v/i,/^n/i]},K1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},W1={any:[/1/i,/2/i,/3/i,/4/i]},z1={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},G1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},q1={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},j1={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},Y1={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},J1={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},Q1={ordinalNumber:zl({matchPattern:F1,parsePattern:V1,valueCallback:n=>parseInt(n)}),era:bt({matchPatterns:H1,defaultMatchWidth:"wide",parsePatterns:$1,defaultParseWidth:"any"}),quarter:bt({matchPatterns:K1,defaultMatchWidth:"wide",parsePatterns:W1,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bt({matchPatterns:z1,defaultMatchWidth:"wide",parsePatterns:G1,defaultParseWidth:"any"}),day:bt({matchPatterns:q1,defaultMatchWidth:"wide",parsePatterns:j1,defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:Y1,defaultMatchWidth:"wide",parsePatterns:J1,defaultParseWidth:"any"})},X1={code:"de",formatDistance:b1,formatLong:k1,formatRelative:R1,localize:B1,match:Q1,options:{weekStartsOn:1,firstWeekContainsDate:4}},Z1={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},eM=(n,e,t)=>{let r;const o=Z1[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"dans "+r:"il y a "+r:r},tM={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},nM={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},rM={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},oM={date:or({formats:tM,defaultWidth:"full"}),time:or({formats:nM,defaultWidth:"full"}),dateTime:or({formats:rM,defaultWidth:"full"})},iM={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},aM=(n,e,t,r)=>iM[n],sM={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},cM={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},lM={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},uM={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},dM={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},hM=(n,e)=>{const t=Number(n),r=e==null?void 0:e.unit;if(t===0)return"0";const o=["year","week","hour","minute","second"];let a;return t===1?a=r&&o.includes(r)?"ère":"er":a="ème",t+a},fM=["MMM","MMMM"],mM={preprocessor:(n,e)=>n.getDate()===1||!e.some(r=>r.isToken&&fM.includes(r.value))?e:e.map(r=>r.isToken&&r.value==="do"?{isToken:!0,value:"d"}:r),ordinalNumber:hM,era:Tt({values:sM,defaultWidth:"wide"}),quarter:Tt({values:cM,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Tt({values:lM,defaultWidth:"wide"}),day:Tt({values:uM,defaultWidth:"wide"}),dayPeriod:Tt({values:dM,defaultWidth:"wide"})},gM=/^(\d+)(ième|ère|ème|er|e)?/i,pM=/\d+/i,_M={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},vM={any:[/^av/i,/^ap/i]},yM={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},CM={any:[/1/i,/2/i,/3/i,/4/i]},EM={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},wM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},TM={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},bM={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},IM={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},SM={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},AM={ordinalNumber:zl({matchPattern:gM,parsePattern:pM,valueCallback:n=>parseInt(n)}),era:bt({matchPatterns:_M,defaultMatchWidth:"wide",parsePatterns:vM,defaultParseWidth:"any"}),quarter:bt({matchPatterns:yM,defaultMatchWidth:"wide",parsePatterns:CM,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bt({matchPatterns:EM,defaultMatchWidth:"wide",parsePatterns:wM,defaultParseWidth:"any"}),day:bt({matchPatterns:TM,defaultMatchWidth:"wide",parsePatterns:bM,defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:IM,defaultMatchWidth:"any",parsePatterns:SM,defaultParseWidth:"any"})},kM={code:"fr",formatDistance:eM,formatLong:oM,formatRelative:aM,localize:mM,match:AM,options:{weekStartsOn:1,firstWeekContainsDate:4}},NM={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},RM=(n,e,t)=>{let r;const o=NM[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"em "+r:"há "+r:r},OM={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},PM={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},MM={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},DM={date:or({formats:OM,defaultWidth:"full"}),time:or({formats:PM,defaultWidth:"full"}),dateTime:or({formats:MM,defaultWidth:"full"})},LM={lastWeek:n=>{const e=n.getDay();return"'"+(e===0||e===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},xM=(n,e,t,r)=>{const o=LM[n];return typeof o=="function"?o(e):o},UM={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},BM={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},FM={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},VM={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},HM={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},$M={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},KM=(n,e)=>{const t=Number(n);return(e==null?void 0:e.unit)==="week"?t+"ª":t+"º"},WM={ordinalNumber:KM,era:Tt({values:UM,defaultWidth:"wide"}),quarter:Tt({values:BM,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Tt({values:FM,defaultWidth:"wide"}),day:Tt({values:VM,defaultWidth:"wide"}),dayPeriod:Tt({values:HM,defaultWidth:"wide",formattingValues:$M,defaultFormattingWidth:"wide"})},zM=/^(\d+)[ºªo]?/i,GM=/\d+/i,qM={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},jM={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},YM={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},JM={any:[/1/i,/2/i,/3/i,/4/i]},QM={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},XM={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},ZM={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},eD={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},tD={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},nD={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},rD={ordinalNumber:zl({matchPattern:zM,parsePattern:GM,valueCallback:n=>parseInt(n,10)}),era:bt({matchPatterns:qM,defaultMatchWidth:"wide",parsePatterns:jM,defaultParseWidth:"any"}),quarter:bt({matchPatterns:YM,defaultMatchWidth:"wide",parsePatterns:JM,defaultParseWidth:"any",valueCallback:n=>n+1}),month:bt({matchPatterns:QM,defaultMatchWidth:"wide",parsePatterns:XM,defaultParseWidth:"any"}),day:bt({matchPatterns:ZM,defaultMatchWidth:"wide",parsePatterns:eD,defaultParseWidth:"any"}),dayPeriod:bt({matchPatterns:tD,defaultMatchWidth:"any",parsePatterns:nD,defaultParseWidth:"any"})},oD={code:"pt-BR",formatDistance:RM,formatLong:DM,formatRelative:xM,localize:WM,match:rD,options:{weekStartsOn:0,firstWeekContainsDate:1}};/*!
12
12
  * shared v11.1.3
13
13
  * (c) 2025 kazuya kawaguchi
14
14
  * Released under the MIT License.
@@ -110,4 +110,4 @@ Error Description: ${a.errorMessage}`);else{const c=a;this.logger.error(`A non-M
110
110
  Error: ${c.name}
111
111
  Error Description: ${c.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=Xt.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>t&&De.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let r;if(t&&t.azureCloudInstance!==Xf.None){const o=t.tenant?t.tenant:F.DEFAULT_COMMON_TENANT;r=`${t.azureCloudInstance}/${o}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return F.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Y(ao)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Pw.has(e)}static isPublicCloudAuthority(e){return F.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,r){const o=new De(e);o.validateAsUri();const a=o.getUrlComponents();let c=`${t}.${a.HostNameAndPort}`;this.isPublicCloudAuthority(a.HostNameAndPort)&&(c=`${t}.${F.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const d=De.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:c}).urlString;return r?`${d}?${r}`:d}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=Xt.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=Xt.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=Xt.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let t=e;const o=new De(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(F.CIAM_AUTH_URL)){const a=o.HostNameAndPort.split(".")[0];t=`${t}${a}${F.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}Xt.reservedTenantDomains=new Set(["{tenant}","{tenantid}",Ho.COMMON,Ho.CONSUMERS,Ho.ORGANIZATIONS]);function y2(n){var o;const r=(o=new De(n).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:o.toLowerCase();switch(r){case Ho.COMMON:case Ho.ORGANIZATIONS:case Ho.CONSUMERS:return;default:return r}}function xw(n){return n.endsWith(F.FORWARD_SLASH)?n:`${n}${F.FORWARD_SLASH}`}function C2(n){const e=n.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw Xe(nm)}return{canonicalAuthority:n.authority?xw(n.authority):void 0,knownAuthorities:n.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v14.16.0 2024-11-05 */async function Uw(n,e,t,r,o,a,c){c==null||c.addQueueMeasurement(x.AuthorityFactoryCreateDiscoveredInstance,a);const d=Xt.transformCIAMAuthority(xw(n)),h=new Xt(d,e,t,r,o,a,c);try{return await Q(h.resolveEndpointsAsync.bind(h),x.AuthorityResolveEndpointsAsync,o,c,a)(),h}catch{throw Y(ao)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class Wo extends lt{constructor(e,t,r,o,a){super(e,t,r),this.name="ServerError",this.errorNo=o,this.status=a,Object.setPrototypeOf(this,Wo.prototype)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class Ur{static generateThrottlingStorageKey(e){return`${_s.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){var a;const r=Ur.generateThrottlingStorageKey(t),o=e.getThrottlingCache(r);if(o){if(o.throttleTime<Date.now()){e.removeItem(r);return}throw new Wo(((a=o.errorCodes)==null?void 0:a.join(" "))||F.EMPTY_STRING,o.errorMessage,o.subError)}}static postProcess(e,t,r){if(Ur.checkResponseStatus(r)||Ur.checkResponseForRetryAfter(r)){const o={throttleTime:Ur.calculateThrottleTime(parseInt(r.headers[dn.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(Ur.generateThrottlingStorageKey(t),o)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(dn.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(t||_s.DEFAULT_THROTTLE_TIME_SECONDS),r+_s.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,t,r,o){const a={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:o,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},c=this.generateThrottlingStorageKey(a);e.removeItem(c)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class uu extends lt{constructor(e,t,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,uu.prototype),this.name="NetworkError",this.error=e,this.httpStatus=t,this.responseHeaders=r}}function Zv(n,e,t){return new uu(n,e,t)}/*! @azure/msal-common v14.16.0 2024-11-05 */class lm{constructor(e,t){this.config=RV(e),this.logger=new Ko(this.config.loggerOptions,hw,Qf),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[dn.CONTENT_TYPE]=F.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Bn.HOME_ACCOUNT_ID:try{const r=fa(e.credential);t[dn.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case Bn.UPN:t[dn.CCS_HEADER]=`UPN: ${e.credential}`;break}return t}async executePostToTokenEndpoint(e,t,r,o,a,c){var h;c&&((h=this.performanceClient)==null||h.addQueueMeasurement(c,a));const d=await this.sendPostRequest(o,e,{body:t,headers:r},a);return this.config.serverTelemetryManager&&d.status<500&&d.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),d}async sendPostRequest(e,t,r,o){var c,d,h;Ur.preProcess(this.cacheManager,e);let a;try{a=await Q(this.networkClient.sendPostRequestAsync.bind(this.networkClient),x.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,o)(t,r);const m=a.headers||{};(d=this.performanceClient)==null||d.addFields({refreshTokenSize:((c=a.body.refresh_token)==null?void 0:c.length)||0,httpVerToken:m[dn.X_MS_HTTP_VERSION]||"",requestId:m[dn.X_MS_REQUEST_ID]||""},o)}catch(m){if(m instanceof uu){const g=m.responseHeaders;throw g&&((h=this.performanceClient)==null||h.addFields({httpVerToken:g[dn.X_MS_HTTP_VERSION]||"",requestId:g[dn.X_MS_REQUEST_ID]||"",contentTypeHeader:g[dn.CONTENT_TYPE]||void 0,contentLengthHeader:g[dn.CONTENT_LENGTH]||void 0,httpStatus:m.httpStatus},o)),m.error}throw m instanceof lt?m:Y(QE)}return Ur.postProcess(this.cacheManager,e,a),a}async updateAuthority(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.UpdateTokenEndpointAuthority,t);const r=`https://${e}/${this.authority.tenant}/`,o=await Uw(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=o}createTokenQueryParameters(e){const t=new vs(e.correlationId,this.performanceClient);return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.addCorrelationId(e.correlationId),t.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */const Dl="no_tokens_found",Bw="native_account_unavailable",um="refresh_token_expired",E2="interaction_required",w2="consent_required",T2="login_required",du="bad_token";/*! @azure/msal-common v14.16.0 2024-11-05 */const ey=[E2,w2,T2,du],b2=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],I2={[Dl]:"No refresh token found in the cache. Please sign-in.",[Bw]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[um]:"Refresh token has expired.",[du]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class Er extends lt{constructor(e,t,r,o,a,c,d,h){super(e,t,r),Object.setPrototypeOf(this,Er.prototype),this.timestamp=o||F.EMPTY_STRING,this.traceId=a||F.EMPTY_STRING,this.correlationId=c||F.EMPTY_STRING,this.claims=d||F.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=h}}function ty(n,e,t){const r=!!n&&ey.indexOf(n)>-1,o=!!t&&b2.indexOf(t)>-1,a=!!e&&ey.some(c=>e.indexOf(c)>-1);return r||a||o}function tf(n){return new Er(n,I2[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class yr{static setRequestState(e,t,r){const o=yr.generateLibraryState(e,r);return t?`${o}${F.RESOURCE_DELIM}${t}`:o}static generateLibraryState(e,t){if(!e)throw Y(Jh);const r={id:e.createNewGuid()};t&&(r.meta=t);const o=JSON.stringify(r);return e.base64Encode(o)}static parseRequestState(e,t){if(!e)throw Y(Jh);if(!t)throw Y(wa);try{const r=t.split(F.RESOURCE_DELIM),o=r[0],a=r.length>1?r.slice(1).join(F.RESOURCE_DELIM):F.EMPTY_STRING,c=e.base64Decode(o),d=JSON.parse(c);return{userRequestState:a||F.EMPTY_STRING,libraryState:d}}catch{throw Y(wa)}}}/*! @azure/msal-common v14.16.0 2024-11-05 */const S2={SW:"sw",UHW:"uhw"};class ba{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.PopTokenGenerateCnf,e.correlationId);const r=await Q(this.generateKid.bind(this),x.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:o}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(x.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:S2.SW}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,o){const{resourceRequestMethod:a,resourceRequestUri:c,shrClaims:d,shrNonce:h,shrOptions:m}=r,g=c?new De(c):void 0,v=g==null?void 0:g.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:zr(),m:a==null?void 0:a.toUpperCase(),u:v==null?void 0:v.HostNameAndPort,nonce:h||this.cryptoUtils.createNewGuid(),p:v==null?void 0:v.AbsolutePath,q:v!=null&&v.QueryString?[[],v.QueryString]:void 0,client_claims:d||void 0,...o},t,m,r.correlationId)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class A2{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v14.16.0 2024-11-05 */function k2(n){var r,o;const e="code=",t=(r=n.error_uri)==null?void 0:r.lastIndexOf(e);return t&&t>=0?(o=n.error_uri)==null?void 0:o.substring(t+e.length):void 0}class Ti{constructor(e,t,r,o,a,c,d){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=o,this.serializableCache=a,this.persistencePlugin=c,this.performanceClient=d}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?Y(kl,"Cached State"):Y(kl,"Server State");let r,o;try{r=decodeURIComponent(e.state)}catch{throw Y(wa,e.state)}try{o=decodeURIComponent(t)}catch{throw Y(wa,e.state)}if(r!==o)throw Y(ew);if(e.error||e.error_description||e.suberror){const a=k2(e);throw ty(e.error,e.error_description,e.suberror)?new Er(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",a):new Wo(e.error||"",e.error_description,e.suberror,a)}}validateTokenResponse(e,t){var r;if(e.error||e.error_description||e.suberror){const o=`Error(s): ${e.error_codes||F.NOT_AVAILABLE} - Timestamp: ${e.timestamp||F.NOT_AVAILABLE} - Description: ${e.error_description||F.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||F.NOT_AVAILABLE} - Trace ID: ${e.trace_id||F.NOT_AVAILABLE}`,a=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,c=new Wo(e.error,o,e.suberror,a,e.status);if(t&&e.status&&e.status>=$c.SERVER_ERROR_RANGE_START&&e.status<=$c.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
112
112
  ${c}`);return}else if(t&&e.status&&e.status>=$c.CLIENT_ERROR_RANGE_START&&e.status<=$c.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
113
- ${c}`);return}throw ty(e.error,e.error_description,e.suberror)?new Er(e.error,e.error_description,e.suberror,e.timestamp||F.EMPTY_STRING,e.trace_id||F.EMPTY_STRING,e.correlation_id||F.EMPTY_STRING,e.claims||F.EMPTY_STRING,a):c}}async handleServerTokenResponse(e,t,r,o,a,c,d,h,m){var C;(C=this.performanceClient)==null||C.addQueueMeasurement(x.HandleServerTokenResponse,e.correlation_id);let g;if(e.id_token){if(g=Si(e.id_token||F.EMPTY_STRING,this.cryptoObj.base64Decode),a&&a.nonce&&g.nonce!==a.nonce)throw Y(tw);if(o.maxAge||o.maxAge===0){const T=g.auth_time;if(!T)throw Y(qf);fw(T,o.maxAge)}}this.homeAccountIdentifier=Pt.generateHomeAccountId(e.client_info||F.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,g);let v;a&&a.state&&(v=yr.parseRequestState(this.cryptoObj,a.state)),e.key_id=e.key_id||o.sshKid||void 0;const p=this.generateCacheRecord(e,t,r,o,g,c,a);let w;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),w=new A2(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(w)),d&&!h&&p.account){const T=p.account.generateAccountKey();if(!this.cacheStorage.getAccount(T,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Ti.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,v,void 0,m)}await this.cacheStorage.saveCacheRecord(p,o.storeInCache,o.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&w&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(w))}return Ti.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,v,e,m)}generateCacheRecord(e,t,r,o,a,c,d){const h=t.getPreferredCache();if(!h)throw Y(Yf);const m=Nw(a);let g,v;e.id_token&&a&&(g=au(this.homeAccountIdentifier,h,e.id_token,this.clientId,m||""),v=dm(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,a,e.client_info,h,m,d,void 0,this.logger));let p=null;if(e.access_token){const T=e.scope?vt.fromString(e.scope):new vt(o.scopes||[]),k=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,I=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,N=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,D=r+k,L=D+I,K=N&&N>0?r+N:void 0;p=su(this.homeAccountIdentifier,h,e.access_token,this.clientId,m||t.tenant||"",T.printScopes(),D,L,this.cryptoObj.base64Decode,K,e.token_type,c,e.key_id,o.claims,o.requestedClaimsHash)}let w=null;if(e.refresh_token){let T;if(e.refresh_token_expires_in){const k=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;T=r+k}w=mw(this.homeAccountIdentifier,h,e.refresh_token,this.clientId,e.foci,c,T)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:h,familyId:e.foci}),{account:v,idToken:g,accessToken:p,refreshToken:w,appMetadata:C}}static async generateAuthenticationResult(e,t,r,o,a,c,d,h,m){var D,L,K,q,M;let g=F.EMPTY_STRING,v=[],p=null,w,C,T=F.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===Ge.POP&&!a.popKid){const ce=new ba(e),{secret:ae,keyId:X}=r.accessToken;if(!X)throw Y(Jf);g=await ce.signPopToken(ae,X,a)}else g=r.accessToken.secret;v=vt.fromString(r.accessToken.target).asArray(),p=new Date(Number(r.accessToken.expiresOn)*1e3),w=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),r.accessToken.refreshOn&&(C=new Date(Number(r.accessToken.refreshOn)*1e3))}r.appMetadata&&(T=r.appMetadata.familyId===ps?ps:"");const k=(c==null?void 0:c.oid)||(c==null?void 0:c.sub)||"",I=(c==null?void 0:c.tid)||"";h!=null&&h.spa_accountid&&r.account&&(r.account.nativeAccountId=h==null?void 0:h.spa_accountid);const N=r.account?im(r.account.getAccountInfo(),void 0,c,(D=r.idToken)==null?void 0:D.secret):null;return{authority:t.canonicalAuthority,uniqueId:k,tenantId:I,scopes:v,account:N,idToken:((L=r==null?void 0:r.idToken)==null?void 0:L.secret)||"",idTokenClaims:c||{},accessToken:g,fromCache:o,expiresOn:p,extExpiresOn:w,refreshOn:C,correlationId:a.correlationId,requestId:m||F.EMPTY_STRING,familyId:T,tokenType:((K=r.accessToken)==null?void 0:K.tokenType)||F.EMPTY_STRING,state:d?d.userRequestState:F.EMPTY_STRING,cloudGraphHostName:((q=r.account)==null?void 0:q.cloudGraphHostName)||F.EMPTY_STRING,msGraphHost:((M=r.account)==null?void 0:M.msGraphHost)||F.EMPTY_STRING,code:h==null?void 0:h.spa_code,fromNativeBroker:!1}}}function dm(n,e,t,r,o,a,c,d,h,m,g){g==null||g.verbose("setCachedAccount called");const p=n.getAccountKeys().find(I=>I.startsWith(t));let w=null;p&&(w=n.getAccount(p,g));const C=w||Pt.createAccount({homeAccountId:t,idTokenClaims:o,clientInfo:a,environment:c,cloudGraphHostName:h==null?void 0:h.cloud_graph_host_name,msGraphHost:h==null?void 0:h.msgraph_host,nativeAccountId:m},e,r),T=C.tenantProfiles||[],k=d||C.realm;if(k&&!T.find(I=>I.tenantId===k)){const I=om(t,C.localAccountId,k,o);T.push(I)}return C.tenantProfiles=T,C}/*! @azure/msal-common v14.16.0 2024-11-05 */async function Fw(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.0 2024-11-05 */class Vw extends lm{constructor(e,t){var r;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async getAuthCodeUrl(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(x.GetAuthCodeUrl,e.correlationId);const t=await Q(this.createAuthCodeUrlQueryString.bind(this),x.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return De.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var d,h;if((d=this.performanceClient)==null||d.addQueueMeasurement(x.AuthClientAcquireToken,e.correlationId),!e.code)throw Y(ow);const r=zr(),o=await Q(this.executeTokenRequest.bind(this),x.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),a=(h=o.headers)==null?void 0:h[dn.X_MS_REQUEST_ID],c=new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return c.validateTokenResponse(o.body),Q(c.handleServerTokenResponse.bind(c),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,t,void 0,void 0,void 0,a)}handleFragmentResponse(e,t){if(new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw Y(lw);return e}getLogoutUri(e){if(!e)throw Xe(Ew);const t=this.createLogoutUrlQueryString(e);return De.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var m,g;(m=this.performanceClient)==null||m.addQueueMeasurement(x.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),o=De.appendQueryString(e.tokenEndpoint,r),a=await Q(this.createTokenRequestBody.bind(this),x.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let c;if(t.clientInfo)try{const v=Rl(t.clientInfo,this.cryptoUtils.base64Decode);c={credential:`${v.uid}${tn.CLIENT_INFO_SEPARATOR}${v.utid}`,type:Bn.HOME_ACCOUNT_ID}}catch(v){this.logger.verbose("Could not parse client info for CCS Header: "+v)}const d=this.createTokenRequestHeaders(c||t.ccsCredential),h={clientId:((g=t.tokenBodyParameters)==null?void 0:g.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return Q(this.executePostToTokenEndpoint.bind(this),x.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(o,a,d,h,t.correlationId,x.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement(x.AuthClientCreateTokenRequestBody,e.correlationId);const t=new vs(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[wi])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):ia.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Zh(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const c=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await Fw(c.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(c.assertionType)}if(t.addGrantType(qE.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Ge.POP){const c=new ba(this.cryptoUtils,this.performanceClient);let d;e.popKid?d=this.cryptoUtils.encodeKid(e.popKid):d=(await Q(c.generateCnf.bind(c),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(d)}else if(e.authenticationScheme===Ge.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw Xe(cu);(!vr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const c=Rl(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${c.uid}${tn.CLIENT_INFO_SEPARATOR}${c.utid}`,type:Bn.HOME_ACCOUNT_ID}}catch(c){this.logger.verbose("Could not parse client info for CCS Header: "+c)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Bn.HOME_ACCOUNT_ID:try{const c=fa(r.credential);t.addCcsOid(c)}catch(c){this.logger.verbose("Could not parse home account ID for CCS Header: "+c)}break;case Bn.UPN:t.addCcsUpn(r.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Xv])&&t.addExtraQueryParameters({[Xv]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var a,c;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(a=this.performanceClient)==null||a.addQueueMeasurement(x.AuthClientCreateQueryString,t);const r=new vs(t,this.performanceClient);r.addClientId(e.embeddedClientId||((c=e.extraQueryParameters)==null?void 0:c[wi])||this.config.authOptions.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(r.addScopes(o,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri),r.addCorrelationId(t),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),Zh(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==Bt.SELECT_ACCOUNT)if(e.sid&&e.prompt===Bt.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){const d=this.extractAccountSid(e.account);let h=this.extractLoginHint(e.account);if(h&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),h=null),h){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(h);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(d&&e.prompt===Bt.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(d);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,r),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===Ge.POP)){const d=new ba(this.cryptoUtils);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await Q(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}return r.createQueryString()}createLogoutUrlQueryString(e){const t=new vs(e.correlationId,this.performanceClient);return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.16.0 2024-11-05 */const N2=300;class nf extends lm{constructor(e,t){super(e,t)}async acquireToken(e){var c,d;(c=this.performanceClient)==null||c.addQueueMeasurement(x.RefreshTokenClientAcquireToken,e.correlationId);const t=zr(),r=await Q(this.executeTokenRequest.bind(this),x.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(d=r.headers)==null?void 0:d[dn.X_MS_REQUEST_ID],a=new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(r.body),Q(a.handleServerTokenResponse.bind(a),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw Xe(Cw);if((r=this.performanceClient)==null||r.addQueueMeasurement(x.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw Y(jf);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const a=o instanceof Er&&o.errorCode===Dl,c=o instanceof Wo&&o.errorCode===Bv.INVALID_GRANT_ERROR&&o.subError===Bv.CLIENT_MISMATCH_ERROR;if(a||c)return Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=Ai(this.cacheManager.getRefreshToken.bind(this.cacheManager),x.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!r)throw tf(Dl);if(r.expiresOn&&Xh(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||N2))throw tf(um);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||Ge.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Bn.HOME_ACCOUNT_ID}};try{return await Q(this.acquireToken.bind(this),x.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(c){if(c instanceof Er&&c.subError===du){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const d=ha(r);this.cacheManager.removeRefreshToken(d)}throw c}}async executeTokenRequest(e,t){var h,m;(h=this.performanceClient)==null||h.addQueueMeasurement(x.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=De.appendQueryString(t.tokenEndpoint,r),a=await Q(this.createTokenRequestBody.bind(this),x.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),c=this.createTokenRequestHeaders(e.ccsCredential),d={clientId:((m=e.tokenBodyParameters)==null?void 0:m.clientId)||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return Q(this.executePostToTokenEndpoint.bind(this),x.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,a,c,d,e.correlationId,x.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a,c;(o=this.performanceClient)==null||o.addQueueMeasurement(x.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,r=new vs(t,this.performanceClient);if(r.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[wi])||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,(c=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:c.defaultScopes),r.addGrantType(qE.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!Zh(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const d=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await Fw(d.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(d.assertionType)}if(e.authenticationScheme===Ge.POP){const d=new ba(this.cryptoUtils,this.performanceClient);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await Q(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}else if(e.authenticationScheme===Ge.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw Xe(cu);if((!vr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Bn.HOME_ACCOUNT_ID:try{const d=fa(e.ccsCredential.credential);r.addCcsOid(d)}catch(d){this.logger.verbose("Could not parse home account ID for CCS Header: "+d)}break;case Bn.UPN:r.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */class R2 extends lm{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[r,o]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...Pa]});return o===Mo.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new nf(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof iu&&r.errorCode===co)return new nf(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){var h;(h=this.performanceClient)==null||h.addQueueMeasurement(x.SilentFlowClientAcquireCachedToken,e.correlationId);let t=Mo.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!vr.isEmptyObj(e.claims))throw this.setCacheOutcome(Mo.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Y(co);if(!e.account)throw Y(jf);const r=e.account.tenantId||y2(e.authority),o=this.cacheManager.getTokenKeys(),a=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient,e.correlationId);if(a){if(iV(a.cachedAt)||Xh(a.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Mo.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Y(co);a.refreshOn&&Xh(a.refreshOn,0)&&(t=Mo.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Mo.NO_CACHED_ACCESS_TOKEN,e.correlationId),Y(co);const c=e.authority||this.authority.getPreferredCache(),d={account:this.cacheManager.readAccountFromCache(e.account),accessToken:a,idToken:this.cacheManager.getIdToken(e.account,o,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Q(this.generateResultFromCacheRecord.bind(this),x.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(d,e),t]}setCacheOutcome(e,t){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},t),e!==Mo.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(x.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let r;if(e.idToken&&(r=Si(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const a=r==null?void 0:r.auth_time;if(!a)throw Y(qf);fw(a,t.maxAge)}return Ti.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const O2={sendGetRequestAsync:()=>Promise.reject(Y(Ae)),sendPostRequestAsync:()=>Promise.reject(Y(Ae))};/*! @azure/msal-common v14.16.0 2024-11-05 */const ny=",",Hw="|";function P2(n){const{skus:e,libraryName:t,libraryVersion:r,extensionName:o,extensionVersion:a}=n,c=new Map([[0,[t,r]],[2,[o,a]]]);let d=[];if(e!=null&&e.length){if(d=e.split(ny),d.length<4)return e}else d=Array.from({length:4},()=>Hw);return c.forEach((h,m)=>{var g,v;h.length===2&&((g=h[0])!=null&&g.length)&&((v=h[1])!=null&&v.length)&&M2({skuArr:d,index:m,skuName:h[0],skuVersion:h[1]})}),d.join(ny)}function M2(n){const{skuArr:e,index:t,skuName:r,skuVersion:o}=n;t>=e.length||(e[t]=[r,o].join(Hw))}class Os{constructor(e,t){this.cacheOutcome=Mo.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||F.EMPTY_STRING,this.wrapperVer=e.wrapperVer||F.EMPTY_STRING,this.telemetryCacheKey=Wt.CACHE_KEY+tn.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Wt.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&t.push(`broker_error=${r}`);const o=t.join(Wt.VALUE_SEPARATOR),a=this.getRegionDiscoveryFields(),c=[e,a].join(Wt.VALUE_SEPARATOR);return[Wt.SCHEMA_VERSION,c,o].join(Wt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=Os.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(Wt.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(Wt.VALUE_SEPARATOR),a=e.errors.length,c=t<a?Wt.OVERFLOW_TRUE:Wt.OVERFLOW_FALSE,d=[a,c].join(Wt.VALUE_SEPARATOR);return[Wt.SCHEMA_VERSION,e.cacheHits,r,o,d].join(Wt.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=Wt.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof lt?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(Wt.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=Os.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey);else{const o={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o)}}static maxErrorsToSend(e){let t,r=0,o=0;const a=e.errors.length;for(t=0;t<a;t++){const c=e.failedRequests[2*t]||F.EMPTY_STRING,d=e.failedRequests[2*t+1]||F.EMPTY_STRING,h=e.errors[t]||F.EMPTY_STRING;if(o+=c.toString().length+d.toString().length+h.length+3,o<Wt.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||F.EMPTY_STRING),e.push(this.regionSource||F.EMPTY_STRING),e.push(this.regionOutcome||F.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return P2(e)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const $w="missing_kid_error",Kw="missing_alg_error";/*! @azure/msal-common v14.16.0 2024-11-05 */const D2={[$w]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[Kw]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class hm extends lt{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,hm.prototype)}}function ry(n){return new hm(n,D2[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class fm{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw ry($w);if(!e.alg)throw ry(Kw);const t=new fm({typ:e.typ||KF.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class oy{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class L2{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:v2.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new oy}}startPerformanceMeasurement(){return new oy}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const mm="pkce_not_created",rf="crypto_nonexistent",hu="empty_navigate_uri",Ww="hash_empty_error",gm="no_state_in_hash",zw="hash_does_not_contain_known_properties",Gw="unable_to_parse_state",qw="state_interaction_type_mismatch",jw="interaction_in_progress",Yw="popup_window_error",Jw="empty_window_error",bi="user_cancelled",x2="monitor_popup_timeout",Qw="monitor_window_timeout",Xw="redirect_in_iframe",Zw="block_iframe_reload",eT="block_nested_popups",U2="iframe_closed_prematurely",fu="silent_logout_unsupported",tT="no_account_error",B2="silent_prompt_value_error",nT="no_token_request_cache_error",rT="unable_to_parse_token_request_cache_error",pm="no_cached_authority_error",F2="auth_request_not_set_error",V2="invalid_cache_type",mu="non_browser_environment",aa="database_not_open",Ll="no_network_connectivity",oT="post_request_failed",iT="get_request_failed",of="failed_to_parse_response",aT="unable_to_load_token",_m="crypto_key_not_found",sT="auth_code_required",cT="auth_code_or_nativeAccountId_required",lT="spa_code_and_nativeAccountId_present",vm="database_unavailable",uT="unable_to_acquire_token_from_native_platform",dT="native_handshake_timeout",hT="native_extension_not_installed",Ks="native_connection_not_established",fT="uninitialized_public_client_application",mT="native_prompt_not_supported",gT="invalid_base64_string",pT="invalid_pop_token_request",_T="failed_to_build_headers",vT="failed_to_parse_headers";/*! @azure/msal-browser v3.28.1 2025-01-14 */const io="For more visit: aka.ms/msaljs/browser-errors",H2={[mm]:"The PKCE code challenge and verifier could not be generated.",[rf]:"The crypto object or function is not available.",[hu]:"Navigation URI is empty. Please check stack trace for more info.",[Ww]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${io}`,[gm]:"Hash does not contain state. Please verify that the request originated from msal.",[zw]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${io}`,[Gw]:"Unable to parse state. Please verify that the request originated from msal.",[qw]:"Hash contains state but the interaction type does not match the caller.",[jw]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${io}`,[Yw]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Jw]:"window.open returned null or undefined window object.",[bi]:"User cancelled the flow.",[x2]:`Token acquisition in popup failed due to timeout. ${io}`,[Qw]:`Token acquisition in iframe failed due to timeout. ${io}`,[Xw]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[Zw]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${io}`,[eT]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[U2]:"The iframe being monitored was closed prematurely.",[fu]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[tT]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[B2]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[nT]:"No token request found in cache.",[rT]:"The cached token request could not be parsed.",[pm]:"No cached authority found.",[F2]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[V2]:"Invalid cache type",[mu]:"Login and token requests are not supported in non-browser environments.",[aa]:"Database is not open!",[Ll]:"No network connectivity. Check your internet connection.",[oT]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[iT]:"Network request failed. Please check the network trace to determine root cause.",[of]:"Failed to parse network response. Check network trace.",[aT]:"Error loading token to cache.",[_m]:"Cryptographic Key or Keypair not found in browser storage.",[sT]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[cT]:"An authorization code or nativeAccountId must be provided to this flow.",[lT]:"Request cannot contain both spa code and native account id.",[vm]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[uT]:`Unable to acquire token from native platform. ${io}`,[dT]:"Timed out while attempting to establish connection to browser extension",[hT]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Ks]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${io}`,[fT]:`You must call and await the initialize function before attempting to call any other MSAL API. ${io}`,[mT]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[gT]:"Invalid base64 encoded string.",[pT]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[_T]:"Failed to build request headers object.",[vT]:"Failed to parse response headers"};class Ws extends lt{constructor(e,t){super(e,H2[e],t),Object.setPrototypeOf(this,Ws.prototype),this.name="BrowserAuthError"}}function ie(n,e){return new Ws(n,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Dn={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},ma={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},gi={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},vn={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},iy={GET:"GET",POST:"POST"},Ke={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},Po={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},qc={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},ot={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var le;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(le||(le={}));const ay={scopes:Pa},yT="jwk",af="msal.db",$2=1,K2=`${af}.keys`,Pn={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},W2=[Pn.Default,Pn.Skip,Pn.RefreshTokenAndNetwork],z2="msal.browser.log.level",G2="msal.browser.log.pii";/*! @azure/msal-browser v3.28.1 2025-01-14 */function jc(n){return encodeURIComponent(ym(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function gu(n){return CT(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ym(n){return CT(new TextEncoder().encode(n))}function CT(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const q2="RSASSA-PKCS1-v1_5",ET="SHA-256",j2=2048,Y2=new Uint8Array([1,0,1]),sy="0123456789abcdef",cy=new Uint32Array(1),J2="crypto_subtle_undefined",Cm={name:q2,hash:ET,modulusLength:j2,publicExponent:Y2};function Q2(n){if(!window)throw ie(mu);if(!window.crypto)throw ie(rf);if(!n&&!window.crypto.subtle)throw ie(rf,J2)}async function wT(n,e,t){e==null||e.addQueueMeasurement(x.Sha256Digest,t);const o=new TextEncoder().encode(n);return window.crypto.subtle.digest(ET,o)}function X2(n){return window.crypto.getRandomValues(n)}function sh(){return window.crypto.getRandomValues(cy),cy[0]}function go(){const n=Date.now(),e=sh()*1024+(sh()&1023),t=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,a=sh();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|r>>>8,t[7]=r,t[8]=128|o>>>24,t[9]=o>>>16,t[10]=o>>>8,t[11]=o,t[12]=a>>>24,t[13]=a>>>16,t[14]=a>>>8,t[15]=a;let c="";for(let d=0;d<t.length;d++)c+=sy.charAt(t[d]>>>4),c+=sy.charAt(t[d]&15),(d===3||d===5||d===7||d===9)&&(c+="-");return c}async function Z2(n,e){return window.crypto.subtle.generateKey(Cm,n,e)}async function ch(n){return window.crypto.subtle.exportKey(yT,n)}async function eH(n,e,t){return window.crypto.subtle.importKey(yT,n,Cm,e,t)}async function tH(n,e){return window.crypto.subtle.sign(Cm,n,e)}async function TT(n){const e=await wT(n),t=new Uint8Array(e);return gu(t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Ps="storage_not_supported",sf="stubbed_public_client_application_called",xl="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.28.1 2025-01-14 */const gl={[Ps]:"Given storage configuration option was not supported.",[sf]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[xl]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};gl[Ps],gl[sf],gl[xl];class Em extends lt{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Em.prototype)}}function wm(n){return new Em(n,gl[n])}/*! @azure/msal-browser v3.28.1 2025-01-14 */function nH(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function rH(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Tm(){return window.parent!==window}function oH(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Dn.POPUP_NAME_PREFIX}.`)===0}function lo(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function iH(){const e=new De(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function aH(){if(De.hashContainsKnownProperties(window.location.hash)&&Tm())throw ie(Zw)}function sH(n){if(Tm()&&!n)throw ie(Xw)}function cH(){if(oH())throw ie(eT)}function bT(){if(typeof window>"u")throw ie(mu)}function IT(n){if(!n)throw ie(fT)}function bm(n){bT(),aH(),cH(),IT(n)}function ly(n,e){if(bm(n),sH(e.system.allowRedirectInIframe),e.cache.cacheLocation===vn.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw wm(xl)}function ST(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function lH(){return go()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ul{navigateInternal(e,t){return Ul.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Ul.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},t.timeout)})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class uH{async sendGetRequestAsync(e,t){let r,o={},a=0;const c=uy(t);try{r=await fetch(e,{method:iy.GET,headers:c})}catch{throw ie(window.navigator.onLine?iT:Ll)}o=dy(r.headers);try{return a=r.status,{headers:o,body:await r.json(),status:a}}catch{throw Zv(ie(of),a,o)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",o=uy(t);let a,c=0,d={};try{a=await fetch(e,{method:iy.POST,headers:o,body:r})}catch{throw ie(window.navigator.onLine?oT:Ll)}d=dy(a.headers);try{return c=a.status,{headers:d,body:await a.json(),status:c}}catch{throw Zv(ie(of),c,d)}}}function uy(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw ie(_T)}}function dy(n){try{const e={};return n.forEach((t,r)=>{e[r]=t}),e}catch{throw ie(vT)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const dH=6e4,cf=1e4,hH=3e4,fH=2e3;function mH({auth:n,cache:e,system:t,telemetry:r},o){const a={clientId:F.EMPTY_STRING,authority:`${F.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:F.EMPTY_STRING,authorityMetadata:F.EMPTY_STRING,redirectUri:typeof window<"u"?lo():"",postLogoutRedirectUri:F.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:fo.AAD,OIDCOptions:{serverResponseType:$s.FRAGMENT,defaultScopes:[F.OPENID_SCOPE,F.PROFILE_SCOPE,F.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:Xf.None,tenant:F.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},c={cacheLocation:vn.SessionStorage,temporaryCacheLocation:vn.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===vn.LocalStorage),claimsBasedCachingEnabled:!1},d={loggerCallback:()=>{},logLevel:tt.Info,piiLoggingEnabled:!1},m={...{...Dw,loggerOptions:d,networkClient:o?new uH:O2,navigationClient:new Ul,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||dH,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||cf,navigateFrameWait:0,redirectNavigationTimeout:hH,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||fH,pollIntervalMilliseconds:Dn.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||d},g={application:{appName:F.EMPTY_STRING,appVersion:F.EMPTY_STRING},client:new L2};if((n==null?void 0:n.protocolMode)!==fo.OIDC&&(n!=null&&n.OIDCOptions)&&new Ko(m.loggerOptions).warning(JSON.stringify(Xe(Sw))),n!=null&&n.protocolMode&&n.protocolMode!==fo.AAD&&(m!=null&&m.allowNativeBroker))throw Xe(Aw);return{auth:{...a,...n,OIDCOptions:{...a.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...c,...e},system:m,telemetry:{...g,...r}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const gH="@azure/msal-browser",pu="3.28.1";/*! @azure/msal-browser v3.28.1 2025-01-14 */class Im{static loggerCallback(e,t){switch(e){case tt.Error:console.error(t);return;case tt.Info:console.info(t);return;case tt.Verbose:console.debug(t);return;case tt.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var h;this.browserEnvironment=typeof window<"u",this.config=mH(e,this.browserEnvironment);let t;try{t=window[vn.SessionStorage]}catch{}const r=t==null?void 0:t.getItem(z2),o=(h=t==null?void 0:t.getItem(G2))==null?void 0:h.toLowerCase(),a=o==="true"?!0:o==="false"?!1:void 0,c={...this.config.system.loggerOptions},d=r&&Object.keys(tt).includes(r)?tt[r]:void 0;d&&(c.loggerCallback=Im.loggerCallback,c.logLevel=d),a!==void 0&&(c.piiLoggingEnabled=a),this.logger=new Ko(c,gH,pu),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ii extends Im{getModuleName(){return Ii.MODULE_NAME}getId(){return Ii.ID}async initialize(){return this.available=typeof window<"u",this.available}}Ii.MODULE_NAME="";Ii.ID="StandardOperatingContext";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Kr(n){return new TextDecoder().decode(pH(n))}function pH(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw ie(gT)}const t=atob(e);return Uint8Array.from(t,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class _H{constructor(){this.dbName=af,this.version=$2,this.tableName=K2,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const a=o;this.db=a.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>t(ie(vm)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(ie(aa));const d=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);d.addEventListener("success",()=>{this.closeConnection(),r()}),d.addEventListener("error",h=>{this.closeConnection(),o(h)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);c.addEventListener("success",()=>{this.closeConnection(),t()}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(ie(aa));const a=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();a.addEventListener("success",c=>{const d=c;this.closeConnection(),e(d.target.result)}),a.addEventListener("error",c=>{this.closeConnection(),t(c)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result===1)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const r=window.indexedDB.deleteDatabase(af),o=setTimeout(()=>t(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),t(!1)))})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class lf{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class vH{constructor(e){this.inMemoryCache=new lf,this.indexedDBCache=new _H,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Ws&&e.errorCode===vm)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ia{constructor(e,t,r){this.logger=e,Q2(r??!1),this.cache=new vH(this.logger),this.performanceClient=t}createNewGuid(){return go()}base64Encode(e){return ym(e)}base64Decode(e){return Kr(e)}base64UrlEncode(e){return jc(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var g;const t=(g=this.performanceClient)==null?void 0:g.startMeasurement(x.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await Z2(Ia.EXTRACTABLE,Ia.POP_KEY_USAGES),o=await ch(r.publicKey),a={e:o.e,kty:o.kty,n:o.n},c=hy(a),d=await this.hashString(c),h=await ch(r.privateKey),m=await eH(h,!1,["sign"]);return await this.cache.setItem(d,{privateKey:m,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),d}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,o){var D;const a=(D=this.performanceClient)==null?void 0:D.startMeasurement(x.CryptoOptsSignJwt,o),c=await this.cache.getItem(t);if(!c)throw ie(_m);const d=await ch(c.publicKey),h=hy(d),m=jc(JSON.stringify({kid:t})),g=fm.getShrHeaderString({...r==null?void 0:r.header,alg:d.alg,kid:m}),v=jc(g);e.cnf={jwk:JSON.parse(h)};const p=jc(JSON.stringify(e)),w=`${v}.${p}`,T=new TextEncoder().encode(w),k=await tH(c.privateKey,T),I=gu(new Uint8Array(k)),N=`${w}.${I}`;return a&&a.end({success:!0}),N}async hashString(e){return TT(e)}}Ia.POP_KEY_USAGES=["sign","verify"];Ia.EXTRACTABLE=!0;function hy(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.28.1 2025-01-14 */class yH{constructor(){if(!window.localStorage)throw wm(Ps)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class CH{constructor(){if(!window.sessionStorage)throw wm(Ps)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function AT(n,e){if(!e)return null;try{return yr.parseRequestState(n,e).libraryState.meta}catch{throw Y(wa)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const EH=24*60*60*1e3;class wH{getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const a=r[o],[c,...d]=decodeURIComponent(a).trim().split("="),h=d.join("=");if(c===t)return h}return""}setItem(e,t,r,o=!0){let a=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(r){const c=TH(r);a+=`expires=${c};`}o&&(a+="Secure;"),document.cookie=a}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");t.push(o[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function TH(n){const e=new Date;return new Date(e.getTime()+n*EH).toUTCString()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class uf extends Ta{constructor(e,t,r,o,a,c){super(e,r,o,a),this.cacheConfig=t,this.logger=o,this.internalStorage=new lf,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new wH,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=c}setupBrowserStorage(e){try{switch(e){case vn.LocalStorage:return new yH;case vn.SessionStorage:return new CH;case vn.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=vn.MemoryStorage,new lf}migrateCacheEntries(){const e=`${F.CACHE_PREFIX}.${Lt.ID_TOKEN}`,t=`${F.CACHE_PREFIX}.${Lt.CLIENT_INFO}`,r=`${F.CACHE_PREFIX}.${Lt.ERROR}`,o=`${F.CACHE_PREFIX}.${Lt.ERROR_DESC}`,a=this.browserStorage.getItem(e),c=this.browserStorage.getItem(t),d=this.browserStorage.getItem(r),h=this.browserStorage.getItem(o),m=[a,c,d,h];[Lt.ID_TOKEN,Lt.CLIENT_INFO,Lt.ERROR,Lt.ERROR_DESC].forEach((v,p)=>{const w=m[p];w&&this.setTemporaryCache(v,w,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Po.ACCOUNT_KEYS),t=this.getItem(`${Po.TOKEN_KEYS}.${this.clientId}`);if(e&&t){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(o=>{if(this.isCredentialKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);if(c&&c.hasOwnProperty("credentialType"))switch(c.credentialType){case ge.ID_TOKEN:if(Kv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.ID_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${o}`);break;case ge.ACCESS_TOKEN:case ge.ACCESS_TOKEN_WITH_AUTH_SCHEME:if($v(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.ACCESS_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${o}`);break;case ge.REFRESH_TOKEN:if(Wv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.REFRESH_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${o}`);break}}}if(this.isAccountKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);c&&Pt.isAccountEntity(c)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${o} found, saving key to account key map`),this.addAccountKeyToMap(o))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,r,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const r=this.validateAndParseJson(t);return!r||!Pt.isAccountEntity(r)?(this.removeAccountKeyFromMap(e),null):Ta.toObject(new Pt,r)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(Po.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();t.indexOf(e)===-1?(t.push(e),this.setItem(Po.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.setItem(Po.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,ge.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,ge.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,ge.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Po.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const r=this.getTokenKeys();switch(t){case ge.ID_TOKEN:r.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case ge.ACCESS_TOKEN:r.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case ge.REFRESH_TOKEN:r.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),Y(Qh)}this.setItem(`${Po.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const r=this.getTokenKeys();switch(t){case ge.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const o=r.idToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case ge.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const a=r.accessToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ge.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const c=r.refreshToken.indexOf(e);c>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(c,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),Y(Qh)}this.setItem(`${Po.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ID_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Kv(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),r)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ACCESS_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!$v(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),r)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.REFRESH_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Wv(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),r)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!mV(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=fV(e);this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!dV(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&gV(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(qc.WRAPPER_SKU,e),this.internalStorage.setItem(qc.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(qc.WRAPPER_SKU)||F.EMPTY_STRING,t=this.internalStorage.getItem(qc.WRAPPER_VER)||F.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(Lt.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const o=this.generateCacheKey(Lt.ACTIVE_ACCOUNT),a=this.getItem(o);if(!a)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const c=this.getAccountInfoFilteredBy({localAccountId:a});return c?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(c),c):null}const r=this.validateAndParseJson(t);return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:r.homeAccountId,localAccountId:r.localAccountId,tenantId:r.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(Lt.ACTIVE_ACCOUNT_FILTERS),r=this.generateCacheKey(Lt.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const o={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(o)),this.browserStorage.setItem(r,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(r)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!hV(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const a=this.cookieStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),a}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===vn.LocalStorage){const a=this.browserStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,t,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(F.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(F.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(x.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys(),o=[];r.accessToken.forEach(a=>{const c=this.getAccessTokenCredential(a);c!=null&&c.requestedClaimsHash&&a.includes(c.requestedClaimsHash.toLowerCase())&&o.push(this.removeAccessToken(a))}),await Promise.all(o),o.length>0&&this.logger.warning(`${o.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):vr.startsWith(e,F.CACHE_PREFIX)||vr.startsWith(e,Lt.ADAL_ID_TOKEN)?e:`${F.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=yr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=yr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=yr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;const o=this.generateAuthorityKey(r);return this.getTemporaryCache(o)}updateCacheEntries(e,t,r,o,a){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const c=this.generateStateKey(e);this.setTemporaryCache(c,e,!1);const d=this.generateNonceKey(e);this.setTemporaryCache(d,t,!1);const h=this.generateAuthorityKey(e);if(this.setTemporaryCache(h,r,!1),a){const m={credential:a.homeAccountId,type:Bn.HOME_ACCOUNT_ID};this.setTemporaryCache(Ke.CCS_CREDENTIAL,JSON.stringify(m),!0)}else if(o){const m={credential:o,type:Bn.UPN};this.setTemporaryCache(Ke.CCS_CREDENTIAL,JSON.stringify(m),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(Ke.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Ke.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Ke.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Ke.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(Ke.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(Ke.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||F.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf(Ke.REQUEST_STATE)===-1)return;const r=this.temporaryCacheStorage.getItem(t);if(!r)return;const o=AT(this.cryptoImpl,r);o&&o.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=ym(JSON.stringify(e));this.setTemporaryCache(Ke.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(Ke.REQUEST_PARAMS,!0);if(!t)throw ie(nT);let r;try{r=JSON.parse(Kr(t))}catch(o){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${o}`),ie(rT)}if(this.removeTemporaryItem(this.generateCacheKey(Ke.REQUEST_PARAMS)),!r.authority){const o=this.generateAuthorityKey(e),a=this.getTemporaryCache(o);if(!a)throw ie(pm);r.authority=a}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Ke.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${F.CACHE_PREFIX}.${Ke.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${F.CACHE_PREFIX}.${Ke.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw ie(jw);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(Lt.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(Lt.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(Lt.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(Lt.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=t||e;if(r){const o=Si(r,Kr);if(o.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.preferred_username;if(o.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const r=ha(t);if(e!==r){const o=this.getItem(e);if(o)return this.browserStorage.removeItem(e),this.setItem(r,o),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),r;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){var d,h,m;const r=au((d=e.account)==null?void 0:d.homeAccountId,(h=e.account)==null?void 0:h.environment,e.idToken,this.clientId,e.tenantId);let o;t.claims&&(o=await this.cryptoImpl.hashString(t.claims));const a=su((m=e.account)==null?void 0:m.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,Kr,void 0,e.tokenType,void 0,t.sshKid,t.claims,o),c={idToken:r,accessToken:a};return this.saveCacheRecord(c)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(o){if(o instanceof pa&&this.performanceClient&&r)try{const a=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:a.refreshToken.length,cacheIdCount:a.idToken.length,cacheAtCount:a.accessToken.length},r)}catch{}throw o}}}const bH=(n,e)=>{const t={cacheLocation:vn.MemoryStorage,temporaryCacheLocation:vn.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new uf(n,t,Nl,e)};/*! @azure/msal-browser v3.28.1 2025-01-14 */function IH(n,e,t,r){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(r):[]}function SH(n,e,t){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const r=t.getAccountInfoFilteredBy(n);return r?(e.verbose("getAccount: Account matching provided filter found, returning"),r):(e.verbose("getAccount: No matching account found, returning null"),null)}function AH(n,e,t){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const r=t.getAccountInfoFilteredBy({username:n});return r?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),r):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function kH(n,e,t){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const r=t.getAccountInfoFilteredBy({homeAccountId:n});return r?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),r):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function NH(n,e,t){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const r=t.getAccountInfoFilteredBy({localAccountId:n});return r?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),r):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function RH(n,e){e.setActiveAccount(n)}function OH(n){return n.getActiveAccount()}/*! @azure/msal-browser v3.28.1 2025-01-14 */const me={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.28.1 2025-01-14 */class PH{constructor(e){this.eventCallbacks=new Map,this.logger=e||new Ko({})}addEventCallback(e,t,r){if(typeof window<"u"){const o=r||lH();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,o){if(typeof window<"u"){const a={eventType:e,interactionType:t||null,payload:r||null,error:o||null,timestamp:Date.now()};this.eventCallbacks.forEach(([c,d],h)=>{(d.length===0||d.includes(e))&&(this.logger.verbose(`Emitting event to callback ${h}: ${e}`),c.apply(null,[a]))})}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class kT{constructor(e,t,r,o,a,c,d,h,m){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=a,this.navigationClient=c,this.nativeMessageHandler=h,this.correlationId=m||go(),this.logger=o.clone(Dn.MSAL_SKU,pu,this.correlationId),this.performanceClient=d}async clearCacheOnLogout(e){if(e){Pt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(Pt.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return De.getAbsoluteUrl(t,lo())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Os(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.requestAuthority||this.config.auth.authority,c=r!=null&&r.length?r==="true":this.config.auth.instanceAware,d=t&&c?this.config.auth.authority.replace(De.getDomainFromUrl(a),t.environment):a,h=Xt.generateAuthority(d,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),m=await Q(Uw,x.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(h,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(t&&!m.isAlias(t.environment))throw Xe(kw);return m}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const MH=32;async function DH(n,e,t){n.addQueueMeasurement(x.GeneratePkceCodes,t);const r=Ai(LH,x.GenerateCodeVerifier,e,n,t)(n,e,t),o=await Q(xH,x.GenerateCodeChallengeFromVerifier,e,n,t)(r,n,e,t);return{verifier:r,challenge:o}}function LH(n,e,t){try{const r=new Uint8Array(MH);return Ai(X2,x.GetRandomValues,e,n,t)(r),gu(r)}catch{throw ie(mm)}}async function xH(n,e,t,r){e.addQueueMeasurement(x.GenerateCodeChallengeFromVerifier,r);try{const o=await Q(wT,x.Sha256Digest,t,e,r)(n,e,r);return gu(new Uint8Array(o))}catch{throw ie(mm)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function Sm(n,e,t,r){t.addQueueMeasurement(x.InitializeBaseRequest,n.correlationId);const o=n.authority||e.auth.authority,a=[...n&&n.scopes||[]],c={...n,correlationId:n.correlationId,authority:o,scopes:a};if(!c.authenticationScheme)c.authenticationScheme=Ge.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(c.authenticationScheme===Ge.SSH){if(!n.sshJwk)throw Xe(cu);if(!n.sshKid)throw Xe(Iw)}r.verbose(`Authentication Scheme set to "${c.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!vr.isEmptyObj(n.claims)&&(c.requestedClaimsHash=await TT(n.claims)),c}async function UH(n,e,t,r,o){r.addQueueMeasurement(x.InitializeSilentRequest,n.correlationId);const a=await Q(Sm,x.InitializeBaseRequest,o,r,n.correlationId)(n,t,r,o);return{...n,...a,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ma extends kT{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await Q(DH,x.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:F.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=F.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||go(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(e.postLogoutRedirectUri,lo())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,lo())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(lo(),lo())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Vw(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}=e;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetClientConfiguration,this.correlationId);const d=await Q(this.getDiscoveredAuthority.bind(this),x.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}),h=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:d,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:h.loggerCallback,piiLoggingEnabled:h.piiLoggingEnabled,logLevel:h.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Dn.MSAL_SKU,version:pu,cpu:F.EMPTY_STRING,os:F.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:t},a=yr.setRequestState(this.browserCrypto,e&&e.state||F.EMPTY_STRING,o),d={...await Q(Sm,x.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:a,nonce:e.nonce||go(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return d;const h=e.account||this.browserStorage.getActiveAccount();if(h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${h.homeAccountId}`,this.correlationId),d.account=h),!d.loginHint&&!h){const m=this.browserStorage.getLegacyLoginHint();m&&(d.loginHint=m)}return d}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const BH="ContentError",NT="user_switch";/*! @azure/msal-browser v3.28.1 2025-01-14 */const FH="USER_INTERACTION_REQUIRED",VH="USER_CANCEL",HH="NO_NETWORK",$H="PERSISTENT_ERROR",KH="DISABLED",WH="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.28.1 2025-01-14 */const zH=-2147186943,GH={[NT]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Br extends lt{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,Br.prototype),this.name="NativeAuthError",this.ext=r}}function sa(n){if(n.ext&&n.ext.status&&(n.ext.status===$H||n.ext.status===KH)||n.ext&&n.ext.error&&n.ext.error===zH)return!0;switch(n.errorCode){case BH:return!0;default:return!1}}function df(n,e,t){if(t&&t.status)switch(t.status){case WH:return tf(Bw);case FH:return new Er(n,e);case VH:return ie(bi);case HH:return ie(Ll)}return new Br(n,GH[n]||e,t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class RT extends Ma{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(ot.acquireTokenSilent_silentFlow),r=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new R2(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const c=(await Q(o.acquireCachedToken.bind(o),x.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),c}catch(a){throw a instanceof Ws&&a.errorCode===_m&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),a}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class _a extends kT{constructor(e,t,r,o,a,c,d,h,m,g,v,p){var C;super(e,t,r,o,a,c,h,m,p),this.apiId=d,this.accountId=g,this.nativeMessageHandler=m,this.nativeStorageManager=v,this.silentCacheClient=new RT(e,this.nativeStorageManager,r,o,a,c,h,m,p),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const w=this.nativeMessageHandler.getExtensionId()===ma.PREFERRED_EXTENSION_ID?"chrome":(C=this.nativeMessageHandler.getExtensionId())!=null&&C.length?"unknown":void 0;this.skus=Os.makeExtraSkuString({libraryName:Dn.MSAL_SKU,libraryVersion:pu,extensionName:w,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[f2]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),r=zr();try{const o=await this.initializeNativeRequest(e);try{const m=await this.acquireTokensFromCache(this.accountId,o);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),m}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...a}=o,c={method:gi.GetToken,request:a},d=await this.nativeMessageHandler.sendMessage(c),h=this.validateNativeResponse(d);return await this.handleNativeResponse(h,o,r).then(m=>(t.end({success:!0,isNativeBroker:!0,requestId:m.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),m)).catch(m=>{throw t.end({success:!1,errorCode:m.errorCode,subErrorCode:m.subError,isNativeBroker:!0}),m})}catch(o){throw o instanceof Br&&this.serverTelemetryManager.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:vt.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),Y(Yh);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!r)throw Y(Yh);try{const o=this.createSilentCacheRequest(t,r),a=await this.silentCacheClient.acquireToken(o),c={...r,idTokenClaims:a==null?void 0:a.idTokenClaims,idToken:a==null?void 0:a.idToken};return{...a,account:c}}catch(o){throw o}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),a={method:gi.GetToken,request:o};try{const h=await this.nativeMessageHandler.sendMessage(a);this.validateNativeResponse(h)}catch(h){if(h instanceof Br&&(this.serverTelemetryManager.setNativeBrokerErrorCode(h.errorCode),sa(h)))throw h}this.browserStorage.setTemporaryCache(Ke.NATIVE_REQUEST,JSON.stringify(o),!0);const c={apiId:ot.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(d,c)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:o,...a}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ke.NATIVE_REQUEST));const c={method:gi.GetToken,request:a},d=zr();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const h=await this.nativeMessageHandler.sendMessage(c);this.validateNativeResponse(h);const m=this.handleNativeResponse(h,a,d);this.browserStorage.setInteractionInProgress(!1);const g=await m;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),g}catch(h){throw this.browserStorage.setInteractionInProgress(!1),h}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){var g;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Si(e.id_token,Kr),a=this.createHomeAccountIdentifier(e,o),c=(g=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:g.homeAccountId;if(a!==c&&e.account.id!==t.accountId)throw df(NT);const d=await this.getDiscoveredAuthority({requestAuthority:t.authority}),h=dm(this.browserStorage,d,a,Kr,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger),m=await this.generateAuthenticationResult(e,t,o,h,d.canonicalAuthority,r);return this.cacheAccount(h),this.cacheNativeTokens(e,t,a,o,e.access_token,m.tenantId,r),m}createHomeAccountIdentifier(e,t){return Pt.generateHomeAccountId(e.client_info||F.EMPTY_STRING,mr.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?vt.fromString(e.scope):vt.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Ge.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new ba(this.browserCrypto),o={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw Y(Jf);return r.signPopToken(e.access_token,t.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,t,r,o,a,c){const d=this.addTelemetryFromNativeResponse(e),h=e.scope?vt.fromString(e.scope):vt.fromString(t.scope),m=e.account.properties||{},g=m.UID||r.oid||r.sub||F.EMPTY_STRING,v=m.TenantId||r.tid||F.EMPTY_STRING,p=im(o.getAccountInfo(),void 0,r,e.id_token);p.nativeAccountId!==e.account.id&&(p.nativeAccountId=e.account.id);const w=await this.generatePopAccessToken(e,t),C=t.tokenType===Ge.POP?Ge.POP:Ge.BEARER;return{authority:a,uniqueId:g,tenantId:v,scopes:h.asArray(),account:p,idToken:e.id_token,idTokenClaims:r,accessToken:w,fromCache:d?this.isResponseFromCache(d):!1,expiresOn:new Date(Number(c+e.expires_in)*1e3),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,r,o,a,c,d){const h=au(r,t.authority,e.id_token||"",t.clientId,o.tid||""),m=t.tokenType===Ge.POP?F.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,g=d+m,v=this.generateScopes(e,t),p=su(r,t.authority,a,t.clientId,o.tid||c,v.printScopes(),g,0,Kr,void 0,t.tokenType,void 0,t.keyId),w={idToken:h,accessToken:p};this.nativeStorageManager.saveCacheRecord(w,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw jE(Wf,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new De(t);r.validateAsUri();const{scopes:o,...a}=e,c=new vt(o||[]);c.appendScopes(Pa);const d=()=>{switch(this.apiId){case ot.ssoSilent:case ot.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Bt.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case Bt.NONE:case Bt.CONSENT:case Bt.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),ie(mT)}},h={...a,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:c.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:d(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(h.signPopToken&&e.popKid)throw ie(pT);if(this.handleExtraBrokerParams(h),h.extraParameters=h.extraParameters||{},h.extraParameters.telemetry=ma.MATS_TELEMETRY,e.authenticationScheme===Ge.POP){const m={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},g=new ba(this.browserCrypto);let v;if(h.keyId)v=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:h.keyId})),h.signPopToken=!1;else{const p=await Q(g.generateCnf.bind(g),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(m,this.logger);v=p.reqCnfString,h.keyId=p.kid,h.signPopToken=!0}h.reqCnf=v}return this.addRequestSKUs(h),h}handleExtraBrokerParams(e){var a;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(cm)&&e.extraParameters.hasOwnProperty(ef)&&e.extraParameters.hasOwnProperty(wi);if(!e.embeddedClientId&&!t)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[ef],r=e.extraParameters[wi]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(a=this.performanceClient)==null||a.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Fr{constructor(e,t,r,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(x.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:ma.CHANNEL_ID,extensionId:this.extensionId,responseId:go(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((r,o)=>{this.resolvers.set(t.responseId,{resolve:r,reject:o})})}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new Fr(e,t,r,ma.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const a=new Fr(e,t,r);return await a.sendHandshakeRequest(),a}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:ma.CHANNEL_ID,extensionId:this.extensionId,responseId:go(),body:{method:gi.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(ie(dT)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==ma.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===gi.HandshakeRequest){const r=this.handshakeResolvers.get(t.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(ie(hT))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),o=this.handshakeResolvers.get(t.responseId);try{const a=t.body.method;if(a===gi.Response){if(!r)return;const c=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(c)}`),c.status!=="Success")r.reject(df(c.code,c.description,c.ext));else if(c.result)c.result.code&&c.result.description?r.reject(df(c.result.code,c.result.description,c.result.ext)):r.resolve(c.result);else throw jE(Wf,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(a===gi.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(a){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${a}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(a):o&&o.reject(a)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,r,o){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case Ge.BEARER:case Ge.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Am{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(x.HandleCodeResponse,t.correlationId);let r;try{r=this.authModule.handleFragmentResponse(e,t.state)}catch(o){throw o instanceof Wo&&o.subError===bi?ie(bi):o}return Q(this.handleCodeResponseFromServer.bind(this),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(x.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await Q(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const a=this.createCcsCredentials(t);a&&(this.authCodeRequest.ccsCredential=a)}return await Q(this.authModule.acquireToken.bind(this.authModule),x.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Bn.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Bn.UPN}:null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function OT(n,e,t){const r=Pl(n);if(!r)throw Rw(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),ie(zw)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),ie(Ww));return r}function qH(n,e,t){if(!n.state)throw ie(gm);const r=AT(e,n.state);if(!r)throw ie(Gw);if(r.interactionType!==t)throw ie(qw)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class jH extends Ma{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=h}acquireToken(e){try{const r={popupName:this.generatePopupName(e.scopes||Pa,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,a=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,o,a)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,o,a))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var a;this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(ot.acquireTokenPopup),o=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,le.Popup);ST(o.authority);try{const c=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),d=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),h=Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let m;h&&(m=this.performanceClient.startMeasurement(x.FetchAccountIdWithNativeBroker,e.correlationId));const g=await d.getAuthCodeUrl({...o,nativeBroker:h}),v=new Am(d,this.browserStorage,c,this.logger,this.performanceClient),p=this.initiateAuthRequest(g,t);this.eventHandler.emitEvent(me.POPUP_OPENED,le.Popup,{popupWindow:p},null);const w=await this.monitorPopupForHash(p,t.popupWindowParent),C=Ai(OT,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(w,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Ur.removeThrottle(this.browserStorage,this.config.auth.clientId,c),C.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),m&&m.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw ie(Ks);const k=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,C.accountId,this.nativeStorage,o.correlationId),{userRequestState:I}=yr.parseRequestState(this.browserCrypto,o.state);return await k.acquireToken({...o,state:I,prompt:void 0})}return await v.handleCodeResponse(C,o)}catch(c){throw(a=t.popup)==null||a.close(),c instanceof lt&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),c}}async logoutPopupAsync(e,t,r,o){var c,d,h,m;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(me.LOGOUT_START,le.Popup,e);const a=this.initializeServerTelemetryManager(ot.logoutPopup);try{await this.clearCacheOnLogout(e.account);const g=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:a,requestAuthority:r,account:e.account||void 0});try{g.authority.endSessionEndpoint}catch{if((c=e.account)!=null&&c.homeAccountId&&e.postLogoutRedirectUri&&g.authority.protocolMode===fo.OIDC){if(this.browserStorage.removeAccount((d=e.account)==null?void 0:d.homeAccountId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Popup,e),o){const w={apiId:ot.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=De.getAbsoluteUrl(o,lo());await this.navigationClient.navigateInternal(C,w)}(h=t.popup)==null||h.close();return}}const v=g.getLogoutUri(e);this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Popup,e);const p=this.openPopup(v,t);if(this.eventHandler.emitEvent(me.POPUP_OPENED,le.Popup,{popupWindow:p},null),await this.monitorPopupForHash(p,t.popupWindowParent).catch(()=>{}),o){const w={apiId:ot.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=De.getAbsoluteUrl(o,lo());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${C}`),await this.navigationClient.navigateInternal(C,w)}else this.logger.verbose("No main window navigation requested")}catch(g){throw(m=t.popup)==null||m.close(),g instanceof lt&&(g.setCorrelationId(this.correlationId),a.cacheFailedRequest(g)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,le.Popup,null,g),this.eventHandler.emitEvent(me.LOGOUT_END,le.Popup),g}this.eventHandler.emitEvent(me.LOGOUT_END,le.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),ie(hu)}monitorPopupForHash(e,t){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const a=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(a),o(ie(bi));return}let c="";try{c=e.location.href}catch{}if(!c||c==="about:blank")return;clearInterval(a);let d="";const h=this.config.auth.OIDCOptions.serverResponseType;e&&(h===$s.QUERY?d=e.location.search:d=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(d)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw ie(Jw);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),this.browserStorage.setInteractionInProgress(!1),ie(Yw)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:o}){var w,C,T,k;const a=o.screenLeft?o.screenLeft:o.screenX,c=o.screenTop?o.screenTop:o.screenY,d=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let m=(w=r.popupSize)==null?void 0:w.width,g=(C=r.popupSize)==null?void 0:C.height,v=(T=r.popupPosition)==null?void 0:T.top,p=(k=r.popupPosition)==null?void 0:k.left;return(!m||m<0||m>d)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),m=Dn.POPUP_WIDTH),(!g||g<0||g>h)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),g=Dn.POPUP_HEIGHT),(!v||v<0||v>h)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),v=Math.max(0,h/2-Dn.POPUP_HEIGHT/2+c)),(!p||p<0||p>d)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),p=Math.max(0,d/2-Dn.POPUP_WIDTH/2+a)),o.open(e,t,`width=${m}, height=${g}, top=${v}, left=${p}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(le.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Dn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Dn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class fy{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Ke.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Ke.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:ot.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),ie(hu)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(t),o=this.browserStorage.getTemporaryCache(r);if(!o)throw Y(kl,"Cached State");let a;try{a=this.authModule.handleFragmentResponse(e,o)}catch(m){throw m instanceof Wo&&m.subError===bi?ie(bi):m}const c=this.browserStorage.generateNonceKey(o),d=this.browserStorage.getTemporaryCache(c);if(this.authCodeRequest.code=a.code,a.cloud_instance_host_name&&await Q(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(a.cloud_instance_host_name,this.authCodeRequest.correlationId),a.nonce=d||void 0,a.state=o,a.client_info)this.authCodeRequest.clientInfo=a.client_info;else{const m=this.checkCcsCredentials();m&&(this.authCodeRequest.ccsCredential=m)}const h=await this.authModule.acquireToken(this.authCodeRequest,a);return this.browserStorage.cleanRequestByState(t),h}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(Ke.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function YH(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class JH extends Ma{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.nativeStorage=h}async acquireToken(e){const t=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,le.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const r=this.initializeServerTelemetryManager(ot.acquireTokenRedirect),o=a=>{a.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(me.RESTORE_FROM_BFCACHE,le.Redirect))};try{const a=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),c=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),d=new fy(c,this.browserStorage,a,this.logger,this.performanceClient),h=await c.getAuthCodeUrl({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),m=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${m}`),window.addEventListener("pageshow",o),await d.initiateAuthRequest(h,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:m,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(a){throw a instanceof lt&&(a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(t.state),a}}async handleRedirectPromise(e="",t){const r=this.initializeServerTelemetryManager(ot.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[o,a]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(le.Redirect),YH()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const c=this.browserStorage.getTemporaryCache(Ke.ORIGIN_URI,!0)||F.EMPTY_STRING,d=De.removeHashFromUrl(c),h=De.removeHashFromUrl(window.location.href);if(d===h&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),c.indexOf("#")>-1&&rH(c),await this.handleResponse(o,r);if(this.config.auth.navigateToLoginRequestUrl){if(!Tm()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Ke.URL_HASH,a,!0);const m={apiId:ot.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let g=!0;if(!c||c==="null"){const v=iH();this.browserStorage.setTemporaryCache(Ke.ORIGIN_URI,v,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),g=await this.navigationClient.navigateInternal(v,m)}else this.logger.verbose(`Navigating to loginRequestUrl: ${c}`),g=await this.navigationClient.navigateInternal(c,m);if(!g)return await this.handleResponse(o,r)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,r);return null}catch(o){throw o instanceof lt&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.browserStorage.cleanRequestByInteractionType(le.Redirect),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===$s.QUERY?t=window.location.search:t=window.location.hash);let r=Pl(t);if(r){try{qH(r,this.browserCrypto,le.Redirect)}catch(a){return a instanceof lt&&this.logger.error(`Interaction type validation failed due to ${a.errorCode}: ${a.errorMessage}`),[null,""]}return nH(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}const o=this.browserStorage.getTemporaryCache(Ke.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ke.URL_HASH)),o&&(r=Pl(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,t){const r=e.state;if(!r)throw ie(gm);const o=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw ie(Ks);const h=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,o.correlationId),{userRequestState:m}=yr.parseRequestState(this.browserCrypto,r);return h.acquireToken({...o,state:m,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(r)})}const a=this.browserStorage.getCachedAuthority(r);if(!a)throw ie(pm);const c=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:a});return Ur.removeThrottle(this.browserStorage,this.config.auth.clientId,o),new fy(c,this.browserStorage,o,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){var o,a;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(ot.logout);try{this.eventHandler.emitEvent(me.LOGOUT_START,le.Redirect,e),await this.clearCacheOnLogout(t.account);const c={apiId:ot.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(d.authority.protocolMode===fo.OIDC)try{d.authority.endSessionEndpoint}catch{if((o=t.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((a=t.account)==null?void 0:a.homeAccountId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Redirect,t);return}}const h=d.getLogoutUri(t);if(this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(h)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}}catch(c){throw c instanceof lt&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,le.Redirect,null,c),this.eventHandler.emitEvent(me.LOGOUT_END,le.Redirect),c}this.eventHandler.emitEvent(me.LOGOUT_END,le.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return De.getAbsoluteUrl(t,lo())}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function QH(n,e,t,r,o){if(e.addQueueMeasurement(x.SilentHandlerInitiateAuthRequest,r),!n)throw t.info("Navigate url is empty"),ie(hu);return o?Q(ZH,x.SilentHandlerLoadFrame,t,e,r)(n,o,e,r):Ai(e$,x.SilentHandlerLoadFrameSync,t,e,r)(n)}async function XH(n,e,t,r,o,a,c){return r.addQueueMeasurement(x.SilentHandlerMonitorIframeForHash,a),new Promise((d,h)=>{e<cf&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${cf}ms). This may result in timeouts.`);const m=window.setTimeout(()=>{window.clearInterval(g),h(ie(Qw))},e),g=window.setInterval(()=>{let v="";const p=n.contentWindow;try{v=p?p.location.href:""}catch{}if(!v||v==="about:blank")return;let w="";p&&(c===$s.QUERY?w=p.location.search:w=p.location.hash),window.clearTimeout(m),window.clearInterval(g),d(w)},t)}).finally(()=>{Ai(t$,x.RemoveHiddenIframe,o,r,a)(n)})}function ZH(n,e,t,r){return t.addQueueMeasurement(x.SilentHandlerLoadFrame,r),new Promise((o,a)=>{const c=PT();window.setTimeout(()=>{if(!c){a("Unable to load iframe");return}c.src=n,o(c)},e)})}function e$(n){const e=PT();return e.src=n,e}function PT(){const n=document.createElement("iframe");return n.className="msalSilentIframe",n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(n),n}function t$(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class n$ extends Ma{constructor(e,t,r,o,a,c,d,h,m,g,v){super(e,t,r,o,a,c,h,g,v),this.apiId=d,this.nativeStorage=m}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==Bt.NONE&&t.prompt!==Bt.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${Bt.NONE}`),t.prompt=Bt.NONE):t.prompt=Bt.NONE;const r=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,le.Silent);ST(r.authority);const o=this.initializeServerTelemetryManager(this.apiId);let a;try{return a=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await Q(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(a,r)}catch(c){if(c instanceof lt&&(c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c)),!a||!(c instanceof lt)||c.errorCode!==Dn.INVALID_GRANT_ERROR)throw c;this.performanceClient.addFields({retryError:c.errorCode},this.correlationId);const d=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,le.Silent);return await Q(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(a,d)}}logout(){return Promise.reject(ie(fu))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(x.SilentIframeClientTokenHelper,r);const o=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(t),a=await Q(e.getAuthCodeUrl.bind(e),x.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),c=new Am(e,this.browserStorage,o,this.logger,this.performanceClient),d=await Q(QH,x.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(a,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),h=this.config.auth.OIDCOptions.serverResponseType,m=await Q(XH,x.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(d,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,h),g=Ai(OT,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(m,h,this.logger);if(g.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw ie(Ks);const v=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,g.accountId,this.browserStorage,r),{userRequestState:p}=yr.parseRequestState(this.browserCrypto,t.state);return Q(v.acquireToken.bind(v),x.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...t,state:p,prompt:t.prompt||Bt.NONE})}return Q(c.handleCodeResponse.bind(c),x.HandleCodeResponse,this.logger,this.performanceClient,r)(g,t)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class r$ extends Ma{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentRefreshClientAcquireToken,e.correlationId);const t=await Q(Sm,x.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(ot.acquireTokenSilent_silentFlow),a=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return Q(a.acquireTokenByRefreshToken.bind(a),x.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(c=>{throw c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c),c})}logout(){return Promise.reject(ie(fu))}async createRefreshTokenClient(e){const t=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new nf(t,this.performanceClient)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class o${constructor(e,t,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw ie(mu);const o=t.id_token?Si(t.id_token,Kr):void 0,a={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},c=e.authority?new Xt(Xt.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,a,this.logger,e.correlationId||go()):void 0,d=this.loadAccount(e,r.clientInfo||t.client_info||"",o,c),h=this.loadIdToken(t,d.homeAccountId,d.environment,d.realm),m=this.loadAccessToken(e,t,d.homeAccountId,d.environment,d.realm,r),g=this.loadRefreshToken(t,d.homeAccountId,d.environment);return this.generateAuthenticationResult(e,{account:d,idToken:h,accessToken:m,refreshToken:g},o,c)}loadAccount(e,t,r,o){if(this.logger.verbose("TokenCache - loading account"),e.account){const h=Pt.createFromAccountInfo(e.account);return this.storage.setAccount(h),h}else if(!o||!t&&!r)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),ie(aT);const a=Pt.generateHomeAccountId(t,o.authorityType,this.logger,this.cryptoObj,r),c=r==null?void 0:r.tid,d=dm(this.storage,o,a,Kr,r,t,o.hostnameAndPort,c,void 0,void 0,this.logger);return this.storage.setAccount(d),d}loadIdToken(e,t,r,o){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const a=au(t,r,e.id_token,this.config.auth.clientId,o);return this.storage.setIdTokenCredential(a),a}loadAccessToken(e,t,r,o,a,c){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const d=t.scope?vt.fromString(t.scope):new vt(e.scopes),h=c.expiresOn||t.expires_in+new Date().getTime()/1e3,m=c.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,g=su(r,o,t.access_token,this.config.auth.clientId,a,d.printScopes(),h,m,Kr);return this.storage.setAccessTokenCredential(g),g}loadRefreshToken(e,t,r){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const o=mw(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(o),o}generateAuthenticationResult(e,t,r,o){var g,v,p;let a="",c=[],d=null,h;t!=null&&t.accessToken&&(a=t.accessToken.secret,c=vt.fromString(t.accessToken.target).asArray(),d=new Date(Number(t.accessToken.expiresOn)*1e3),h=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const m=t.account;return{authority:o?o.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:c,account:m.getAccountInfo(),idToken:((g=t.idToken)==null?void 0:g.secret)||"",idTokenClaims:r||{},accessToken:a,fromCache:!0,expiresOn:d,correlationId:e.correlationId||"",requestId:"",extExpiresOn:h,familyId:((v=t.refreshToken)==null?void 0:v.familyId)||"",tokenType:((p=t==null?void 0:t.accessToken)==null?void 0:p.tokenType)||"",state:e.state||"",cloudGraphHostName:m.cloudGraphHostName||"",msGraphHost:m.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class i$ extends Vw{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class a$ extends Ma{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,h,m,g),this.apiId=d}async acquireToken(e){if(!e.code)throw ie(sT);const t=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,le.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...t,code:e.code},a=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),c=new i$(a);this.logger.verbose("Auth code client created");const d=new Am(c,this.browserStorage,o,this.logger,this.performanceClient);return await Q(d.handleCodeResponseFromServer.bind(d),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(o){throw o instanceof lt&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(ie(fu))}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function Dr(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function Yc(n,e){try{bm(n)}catch(t){throw e.end({success:!1},t),t}}class _u{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ia(this.logger,this.performanceClient):Nl,this.eventHandler=new PH(this.logger),this.browserStorage=this.isBrowserEnvironment?new uf(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,C2(this.config.auth),this.performanceClient):bH(this.config.auth.clientId,this.logger);const t={cacheLocation:vn.MemoryStorage,temporaryCacheLocation:vn.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new uf(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new o$(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const r=new _u(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,o=this.performanceClient.startMeasurement(x.InitializeClientApplication,t);if(this.eventHandler.emitEvent(me.INITIALIZE_START),r)try{this.nativeExtensionProvider=await Fr.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(a){this.logger.verbose(a)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await Q(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),x.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END),o.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),IT(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,a=o?r==null?void 0:r.correlationId:this.browserStorage.getTemporaryCache(Ke.CORRELATION_ID,!0)||"",c=this.performanceClient.startMeasurement(x.AcquireTokenRedirect,a);this.eventHandler.emitEvent(me.HANDLE_REDIRECT_START,le.Redirect);let d;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const h=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);d=Q(h.handleRedirectPromise.bind(h),x.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(this.performanceClient,c.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const h=this.createRedirectClient(a);d=Q(h.handleRedirectPromise.bind(h),x.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(e,c)}return d.then(h=>(h?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(me.LOGIN_SUCCESS,le.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),c.end({success:!0,accountType:Dr(h.account)})):c.event.errorCode?c.end({success:!1}):c.discard(),this.eventHandler.emitEvent(me.HANDLE_REDIRECT_END,le.Redirect),h)).catch(h=>{const m=h;throw t.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Redirect,null,m):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Redirect,null,m),this.eventHandler.emitEvent(me.HANDLE_REDIRECT_END,le.Redirect),c.end({success:!1},m),h})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenPreRedirect,t);r.add({accountType:Dr(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=c=>{const d=typeof o=="function"?o(c):void 0;return d!==!1?r.end({success:!0}):r.discard(),d};else{const c=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=d=>{const h=typeof c=="function"?c(d):void 0;return h!==!1?r.end({success:!0}):r.discard(),h}}const a=this.getAllAccounts().length>0;try{ly(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),a?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Redirect,e):this.eventHandler.emitEvent(me.LOGIN_START,le.Redirect,e);let c;return this.nativeExtensionProvider&&this.canUseNative(e)?c=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch(h=>{if(h instanceof Br&&sa(h))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(h instanceof Er)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),h}):c=this.createRedirectClient(t).acquireToken(e),await c}catch(c){throw r.end({success:!1},c),a?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Redirect,null,c):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Redirect,null,c),c}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:Dr(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),Yc(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(c){return Promise.reject(c)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Popup,e):this.eventHandler.emitEvent(me.LOGIN_START,le.Popup,e);let a;return this.canUseNative(e)?a=this.acquireTokenNative({...e,correlationId:t},ot.acquireTokenPopup).then(c=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,accountType:Dr(c.account)}),c)).catch(c=>{if(c instanceof Br&&sa(c))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(c instanceof Er)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),c}):a=this.createPopupClient(t).acquireToken(e),a.then(c=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(me.LOGIN_SUCCESS,le.Popup,c):this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Popup,c),r.end({success:!0,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Dr(c.account)}),c)).catch(c=>(o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Popup,null,c):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Popup,null,c),r.end({success:!1},c),Promise.reject(c)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var a,c;const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(x.SsoSilent,t),(a=this.ssoSilentMeasurement)==null||a.add({scenarioId:e.scenarioId,accountType:Dr(e.account)}),Yc(this.initialized,this.ssoSilentMeasurement),(c=this.ssoSilentMeasurement)==null||c.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(me.SSO_SILENT_START,le.Silent,r);let o;return this.canUseNative(r)?o=this.acquireTokenNative(r,ot.ssoSilent).catch(d=>{if(d instanceof Br&&sa(d))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw d}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(d=>{var h;return this.eventHandler.emitEvent(me.SSO_SILENT_SUCCESS,le.Silent,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,isNativeBroker:d.fromNativeBroker,accessTokenSize:d.accessToken.length,idTokenSize:d.idToken.length,accountType:Dr(d.account)}),d}).catch(d=>{var h;throw this.eventHandler.emitEvent(me.SSO_SILENT_FAILURE,le.Silent,null,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!1},d),d}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenByCode,t);Yc(this.initialized,r),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_START,le.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw ie(lT);if(e.code){const o=e.code;let a=this.hybridAuthCodeResponses.get(o);return a?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),a=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(c=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_SUCCESS,le.Silent,c),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:c.fromNativeBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Dr(c.account)}),c)).catch(c=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,le.Silent,null,c),r.end({success:!1},c),c}),this.hybridAuthCodeResponses.set(o,a)),await a}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:t},ot.acquireTokenByCode,e.nativeAccountId).catch(a=>{throw a instanceof Br&&sa(a)&&(this.nativeExtensionProvider=void 0),a});return r.end({accountType:Dr(o.account),success:!0}),o}else throw ie(uT);else throw ie(cT)}catch(o){throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,le.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(x.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(a=>{var c;return(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!0,fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker}),a}).catch(a=>{var c;throw(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenFromCache,e.correlationId),t){case Pn.Default:case Pn.AccessToken:case Pn.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return Q(r.acquireToken.bind(r),x.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(co)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenByRefreshToken,e.correlationId),t){case Pn.Default:case Pn.AccessTokenAndRefreshToken:case Pn.RefreshToken:case Pn.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return Q(r.acquireToken.bind(r),x.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(co)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(x.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return Q(t.acquireToken.bind(t),x.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return ly(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return bm(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return IH(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return SH(e,this.logger,this.browserStorage)}getAccountByUsername(e){return AH(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return kH(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return NH(e,this.logger,this.browserStorage)}setActiveAccount(e){RH(e,this.browserStorage)}getActiveAccount(){return OH(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=Pt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw ie(Ks);return new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Bt.NONE:case Bt.CONSENT:case Bt.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new jH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new JH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new n$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new RT(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new r$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new a$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return bT(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){var t;try{(t=e.key)!=null&&t.includes(Lt.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(me.ACTIVE_ACCOUNT_CHANGED);const r=e.newValue||e.oldValue;if(!r)return;const o=JSON.parse(r);if(typeof o!="object"||!Pt.isAccountEntity(o))return;const c=Ta.toObject(new Pt,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_ADDED,void 0,c)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_REMOVED,void 0,c))}catch{return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?go():F.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||ay})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||ay})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Yc(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw ie(tT);r.add({accountType:Dr(o)});const a={clientId:this.config.auth.clientId,authority:e.authority||F.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},c=JSON.stringify(a),d=this.activeSilentTokenRequests.get(c);if(typeof d>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const h=Q(this.acquireTokenSilentAsync.bind(this),x.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},o).then(m=>(this.activeSilentTokenRequests.delete(c),r.end({success:!0,fromCache:m.fromCache,isNativeBroker:m.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:m.accessToken.length,idTokenSize:m.idToken.length}),m)).catch(m=>{throw this.activeSilentTokenRequests.delete(c),r.end({success:!1},m),m});return this.activeSilentTokenRequests.set(c,h),{...await h,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.discard(),{...await d,state:e.state}}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(x.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await Q(UH,x.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),a=e.cacheLookupPolicy||Pn.Default;return this.acquireTokenSilentNoIframe(o,a).catch(async d=>{if(s$(d,a))if(this.activeIframeRequest)if(a!==Pn.Skip){const[m,g]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${g}`,o.correlationId);const v=this.performanceClient.startMeasurement(x.AwaitConcurrentIframe,o.correlationId);v.add({awaitIframeCorrelationId:g});const p=await m;if(v.end({success:p}),p)return this.logger.verbose(`Parallel iframe request with correlationId: ${g} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,a);throw this.logger.info(`Iframe request with correlationId: ${g} failed. Interaction is required.`),d}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),Q(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let m;return this.activeIframeRequest=[new Promise(g=>{m=g}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),Q(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(g=>(m(!0),g)).catch(g=>{throw m(!1),g}).finally(()=>{this.activeIframeRequest=void 0})}else throw d}).then(d=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Silent,d),e.correlationId&&this.performanceClient.addFields({fromCache:d.fromCache,isNativeBroker:d.fromNativeBroker},e.correlationId),d)).catch(d=>{throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Silent,null,d),d}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,t){return Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,ot.acquireTokenSilent_silentFlow).catch(async r=>{throw r instanceof Br&&sa(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,Y(co)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),Q(this.acquireTokenFromCache.bind(this),x.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(r=>{if(t===Pn.AccessToken)throw r;return this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_NETWORK_START,le.Silent,e),Q(this.acquireTokenByRefreshToken.bind(this),x.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function s$(n,e){const t=!(n instanceof Er&&n.subError!==du),r=n.errorCode===Dn.INVALID_GRANT_ERROR||n.errorCode===co,o=t&&r||n.errorCode===Dl||n.errorCode===um,a=W2.includes(e);return o&&a}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function c$(n,e){const t=new Ii(n);return await t.initialize(),_u.createController(t,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class km{static async createPublicClientApplication(e){const t=await c$(e);return new km(e,t)}constructor(e,t){this.controller=t||new _u(new Ii(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const lh=process.env.JPLAN_WEBAPP__APP_PROXY_TENANT_NAME??"",l$=process.env.JPLAN_WEBAPP__APP_PROXY_CLIENT_ID??"",u$=process.env.JPLAN_WEBAPP__APP_PROXY_USER_FLOW??"",hf=process.env.JPLAN_WEBAPP__URL_AUTH??process.env.JPLAN_WEBAPP__URL_BASE??"",d$={auth:{clientId:l$,authority:`https://${lh}.b2clogin.com/${lh}.onmicrosoft.com/${u$}`,knownAuthorities:[`${lh}.b2clogin.com`],redirectUri:process.env.JPLAN_AUTOMATION_ENVIRONMENT?`${hf}/_/dashboard`:hf},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(n,e)=>{n===tt.Error&&console.error(e)},logLevel:tt.Warning}}},MT=(n,e)=>({scopes:["https://graph.microsoft.com/.default","openid","profile"],redirectStartPage:`${hf}${n}`,extraQueryParameters:e}),Gt=new km(d$),my=l.ref(null);function DT(){async function n(e){var t;if(e)try{const r=e.idTokenClaims;if(!(r!=null&&r.aud))throw new Error("User audience (aud) is missing in ID token claims");const o=localStorage.getItem(`msal.token.keys.${r.aud}`);if(!o)throw new Error(`Token keys para ${r.aud} não encontrados no localStorage`);const a=JSON.parse(o),c=(t=a==null?void 0:a.idToken)==null?void 0:t[0];if(!c)throw new Error("idToken não encontrado nos token keys");const d=localStorage.getItem(c);if(!d)throw new Error(`Dados do token para ID ${c} não encontrados no localStorage`);const h=JSON.parse(d),m=h==null?void 0:h.secret;if(!m)throw new Error("Secret não encontrado nos dados do token");sessionStorage.setItem("isAuthenticated","true"),my.value=m}catch(r){console.error("Erro ao obter token de acesso:",r)}}return{jToken:my,setJToken:n}}let Jc=null;const tr=l.ref(null),Ji=l.ref(null),LT=l.ref(Math.floor(Date.now()/1e3));ff.useIntervalFn(()=>h$(),1e3);function h$(){var r,o;if(!((o=(r=tr.value)==null?void 0:r.idTokenClaims)!=null&&o.exp))return;const n=Math.floor(Date.now()/1e3),e=300,t=tr.value.idTokenClaims.exp;LT.value=t-n-e}function Nm(){if(Jc)return Jc;const{setJToken:n,jToken:e}=DT(),t=l.computed(()=>!!tr.value),r=l.computed(()=>tr.value);let o;async function a(p,w){if(!t.value)switch(p){case"redirect":if(w){o=w,await h();break}case"tab":default:await c();break}}const c=async()=>new Promise((p,w)=>{try{localStorage.clear();const C=process.env.JPLAN_WEBAPP__URL_AUTH,T=window.open(C);if(!T){console.error("Failed to open authentication window"),w("Failed to open authentication window");return}const k=Date.now(),I=6e4,N=setInterval(()=>{if(Date.now()-k>I||T.closed){clearInterval(N),console.error("Authentication canceled or timeout reached."),w("Authentication canceled or timeout reached.");return}Object.keys(localStorage).some(L=>L.startsWith("msal.account.keys"))&&(clearInterval(N),d(),T.close(),p())},500)}catch(C){console.error("Error in handleRedirect:",C),w(C)}}),d=async()=>{try{await Gt.initialize();const p=Gt.getActiveAccount();if(p)tr.value=p;else{const w=await Gt.handleRedirectPromise();w?(Gt.setActiveAccount(w.account),tr.value=Gt.getActiveAccount()):console.error("Falha na autenticação")}}catch(p){console.error("Erro no processo de autenticação:",p)}tr.value&&await n(tr.value)},h=async()=>{try{await Gt.initialize();const p=await Gt.handleRedirectPromise();if(!p||Gt.getAllAccounts().length===0){const w=MT(o);await Gt.loginRedirect(w);return}Gt.setActiveAccount(p.account),tr.value=Gt.getActiveAccount(),tr.value&&await n(tr.value),Ji.value="updated"}catch(p){console.error("handleRedirect failed",p)}};async function m(){ve.value=!0,Ji.value="updating";try{const p=await Gt.acquireTokenSilent({scopes:["https://graph.microsoft.com/.default","openid","profile"]});Gt.setActiveAccount(p.account),await n(tr.value),Ji.value="updated"}catch(p){console.error("Failed to refresh token, forcing new login.",p),Ji.value="error",localStorage.clear(),window.location.reload()}ve.value=!1}const g=async()=>{try{await Gt.initialize(),localStorage.clear(),await Gt.logoutRedirect({postLogoutRedirectUri:"/"})}catch(p){console.error("Logout error",p)}};l.watch(LT,async p=>{p<=0&&Ji.value==="updated"&&await m()});const v=l.computed(()=>e.value);return Jc={isAuthenticated:t,authState:Ji,account:r,token:v,refreshToken:m,handleRedirect:a,logout:g},Jc}const{jToken:gy}=DT(),Rm=()=>{const n=dt.create({headers:{"Content-Type":"application/json"}});l.watch(gy,o=>{n.interceptors.request.use(a=>(o&&(a.headers.Authorization=`Bearer ${o}`),a))},{immediate:!0});let e=1;n.interceptors.response.use(async o=>o,async o=>{var a;if(o.config&&o.config.headers){const c=o.config;if(((a=o.response)==null?void 0:a.status)===401&&e>0){e--;try{return c.headers.Authorization=`Bearer ${gy.value}`,await n(c)}catch(d){return Promise.reject(d)}}}return Promise.reject(o)});async function t({url:o,method:a,header:c={},body:d,baseURL:h}){try{return h&&(n.defaults.baseURL=h),(await n({url:o,method:a,headers:c,data:d})).data}catch(m){if(console.error(`Request error [${a} ${o}]:`,m),dt.isAxiosError(m)){const{response:g,message:v}=m;throw new Error(`Axios error: ${v}, Status: ${g==null?void 0:g.status}, URL: ${o}`)}throw m}}async function r({url:o,method:a,header:c,body:d,baseURL:h}){try{h&&(n.defaults.baseURL=h);const m=await n({url:o,method:a,headers:c,data:d});return{status:m.status,header:m.headers,body:m.data}}catch(m){if(dt.isAxiosError(m)){const{response:g,message:v}=m;console.error(`Raw Request Error: ${v}, Status: ${g==null?void 0:g.status}`)}return Promise.reject(m)}}return Object.assign(n,{_request:t,rawRequest:r})},{request:py}=Rm(),_y=l.ref(null),vy=l.ref("default"),uh=l.ref(null),dh=l.ref({scope_type:"org"});function vu(){var v,p;const{handleRedirect:n,account:e,logout:t}=Nm();(p=(v=e.value)==null?void 0:v.idTokenClaims)==null||p.domain;const r=l.computed(()=>{var w,C;return{domain:(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.domain,environment:vy.value,...dh.value}}),o=l.computed(()=>dh.value);async function a(){var w;(!e.value||!((w=e.value.idTokenClaims)!=null&&w.email))&&await n();try{await c(),await d()}catch{}}async function c(){var w,C;try{const T=(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.email;if(!T)throw new Error("Email is undefined");const k=await py({url:`https://api.jplan.com.br/platform/user/profile/?email=${T}`,method:"GET"});uh.value=k.data??null}catch(T){console.error("Failed to fetch user profile:",T)}}async function d(){var w;try{if(!((w=uh.value)!=null&&w.email))throw new Error("User email is undefined");const C=await py({url:"https://api.jplan.com.br/platform/user/domain/",method:"GET"});_y.value=C.data.data??[]}catch(C){console.error("Failed to fetch user domains:",C)}}function h(w){dh.value=w}function m(w){vy.value=w,h(r.value)}async function g(w,C){const T=MT(w,{request_domain:C});await Gt.loginRedirect(T)}return{__init__:a,user:uh,userDomains:_y,setEnv:m,setScope:h,changeDomain:g,session:r,scope:o,logout:t}}const f$={path:"/_/dashboard",component:()=>Promise.resolve().then(()=>require("./AuthRoute-B-o0KMOq.js")),meta:{requiresAuth:!1}},m$={path:"/jplan-auth-fail",component:()=>Promise.resolve().then(()=>require("./AuthFailRoute-DHl-IhUQ.js")),meta:{requiresAuth:!1}},{isAuthenticated:yy,handleRedirect:g$}=Nm(),p$=vu();function _$(n,e){n.addRoute(f$),n.addRoute(m$),n.beforeEach(async(t,r,o)=>{function a(d){return d.matched.some(h=>h.meta.requiresAuth)}if(!a(t))return o();if(!yy.value){ve.value=!0;try{await g$(e,t.fullPath),await p$.__init__()}catch(d){console.error("Fail to authenticate",d),await n.push("/jplan-auth-fail")}ve.value=!1}if(yy.value){if(localStorage.getItem("returnRoute")&&localStorage.getItem("returnRoute")!==null){const d=localStorage.getItem("returnRoute")??"/";console.log("trying to go to saved route:",d),o(d),localStorage.removeItem("returnRoute");return}o()}})}const{scope:Cy}=vu();function v$(){const n=Rm(),e=l.ref({scope_type:"org"});async function t(r){e.value=r}return l.watch(Cy,()=>{n.interceptors.request.use(r=>{const o=r.headers,a=o.Authorization;a&&(o.Authorization=a);const c=Cy.value;return c&&(c.scope_type&&(o["j-scope-type"]=c.scope_type,c.organization&&(o["j-scope-organization"]=c.organization),c.team&&(o["j-scope-team"]=c.team)),c.environment&&(o["j-scope-environment"]=c.environment)),r})},{immediate:!0}),Object.assign(n,{setScope:t,scope:e})}function Da(n){const e=v$();e.defaults.baseURL=n;const t=l.ref({scope_type:"org"});async function r(o){t.value=o}return l.watch(t,()=>{e.interceptors.request.use(o=>{const a=t.value;return delete o.headers["j-scope-type"],delete o.headers["j-scope-organization"],delete o.headers["j-scope-team"],a!=null&&a.scope_type&&(o.headers["j-scope-type"]=a.scope_type),a!=null&&a.organization&&(o.headers["j-scope-organization"]=a.organization),a!=null&&a.team&&(o.headers["j-scope-team"]=a.team),o})},{immediate:!0}),Object.assign(e,{setScope:r,scope:t})}const Ey={enUS:{widget:"widget",spacer:"spacer"},ptBr:{widget:"widget",spacer:"Espaçador"}},Om={"pt-BR":{placeholders:{selectFilter:"Selecionar filtro",visualize:"Visualizar",actions:"Ações",search:"Pesquisar"},dialogs:{columnSettings:{title:"Configurações de coluna"},scope:{title:"Escopo",unknown:"Desconhecido",domain:"Domínio",environment:"Ambiente",organizational:"Organizacional",organization:"Organização",team:"Time",user:"Usuário",none:"Nenhum",selectOrganization:"Selecione uma Organização",selectTeam:"Selecione um Time"}},actions:{save:"Salvar",cancel:"Cancelar",edit:"Editar",delete:"Apagar",disable:"Desabilitar",confirm:"Confirmar",back:"Voltar"},forms:{metadata:{created:"Criado",updated:"Atualizado",modified:"Modificado",delegated:"Delegado"}},$vuetify:{dataFooter:{itemsPerPageAll:"Todos",itemsPerPageText:"Itens por página:",pageText:"{0}-{1} de {2}"}},toast:{error:{create_failed:"Falha ao criar {entity}",update_failed:"Falha ao atualizar {entity}",delete_failed:"Falha ao apagar {entity}",fetch_failed:"Falha ao buscar {entity}",activate_failed:"Falha ao ativar {entity}",deactivate_failed:"Falha ao desativar {entity}",link_failed:"Falha ao vincular {entity}",unlink_failed:"Falha ao desvincular {entity}"},success:{create_success:"{entity} criado com sucesso",update_success:"{entity} atualizado com sucesso",delete_success:"{entity} apagado com sucesso",activate_success:"{entity} ativado com sucesso",deactivate_success:"{entity} desativado com sucesso",link_success:"{entity} vinculado com sucesso",unlink_success:"{entity} desvinculado com sucesso"},info:{already_linked:"{entity} já está vinculado",select_valid_item:"Selecione um item válido"}},app:{widget:Ey.ptBr}},"en-US":{placeholders:{selectFilter:"Select a filter",visualize:"Visualize",actions:"Actions",search:"Search"},dialogs:{columnSettings:{title:"Column Settings"},scope:{title:"Scope",unknown:"Unknown",domain:"Domain",environment:"Environment",organizational:"Organizational",organization:"Organization",team:"Team",user:"User",none:"None",selectOrganization:"Select a organization",selectTeam:"Select a Team"}},actions:{save:"Save",cancel:"Cancel",edit:"Edit",delete:"Delete",disable:"Disable",back:"Back",confirm:"Confirm"},forms:{metadata:{created:"Created",updated:"Updated",modified:"Modified",delegated:"Delegated"}},$vuetify:{dataFooter:{itemsPerPageAll:"All",itemsPerPageText:"Items per page:",pageText:"{0}-{1} of {2}"}},toast:{error:{create_failed:"Failed to create {entity}",update_failed:"Failed to update {entity}",delete_failed:"Failed to delete {entity}",fetch_failed:"Failed to fetch {entity}",activate_failed:"Failed to activate {entity}",deactivate_failed:"Failed to deactivate {entity}",link_failed:"Failed to link {entity}",unlink_failed:"Failed to unlink {entity}"},success:{create_success:"{entity} created successfully",update_success:"{entity} updated successfully",delete_success:"{entity} deleted successfully",activate_success:"{entity} activated successfully",deactivate_success:"{entity} deactivated successfully",link_success:"{entity} linked successfully",unlink_success:"{entity} unlinked successfully"},info:{already_linked:"{entity} is already linked",select_valid_item:"Please select a valid item"}},app:{widget:Ey.ptBr}}},y$=Object.keys(Om),wy=navigator.language,C$=y$.includes(wy)?wy:"pt-BR",$=yx({locale:C$,fallbackLocale:"en-US",messages:Om});function E$(){const n=Da("https://api.jplan.com.br/management/organization"),{error:e}=wr();return{async getOrgList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Organization"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getOrgList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Organization"}));return}},async createOrg(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Organization"})),a}},async updateOrg(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"Organization"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Organization"})),a}},async getOrg(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Organization"})),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Organization"})),a}},async activateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Organization"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Organization"})),a}},async deactivateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Organization"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Organization"})),a}}}}const xo=E$();function w$(){const n=Da("https://api.jplan.com.br/management/branch/"),{error:e}=wr();return{async getBranchList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error){e($.global.t("toast.error.fetch_failed",{entity:"Branch"}));return}return o.data.data}catch(r){console.error("Error in getBranchList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Branch"}))}},async createBranch(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){console.error("Error in createBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Branch"}))}},async updateBranch(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error){e(a.data.error||$.global.t("toast.error.update_failed",{entity:"Branch"}));return}return a}catch(a){console.error("Error in updateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Branch"}))}},async getBranch(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error){e(a.data.error||$.global.t("toast.error.fetch_failed",{entity:"Branch"}));return}return a.data}catch(a){console.error("Error in getBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Branch"}))}},async activateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error){e(a.data.error||$.global.t("toast.error.activate_failed",{entity:"Branch"}));return}}catch(a){console.error("Error in activateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Branch"}))}},async deactivateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error){e(a.data.error||$.global.t("toast.error.deactivate_failed",{entity:"Branch"}));return}}catch(a){console.error("Error in deactivateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Branch"}))}}}}const Uo=w$();function T$(){const n=Da("https://api.jplan.com.br/management/team"),{error:e}=wr();return{async getTeamList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Team"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getTeamList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Team"}));return}},async createTeam(t){var r,o;try{const a=await n.post("/item",t);if(a.data.error)throw e($.global.t("toast.error.create_failed",{entity:"Team"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in createTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Team"})),a}},async updateTeam(t){var r,o;try{const a=await n.patch("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in updateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Team"})),a}},async getTeam(t){var r,o;try{const a=await n.get(`/item/${t}`);return a.data.error&&e($.global.t("toast.error.fetch_failed",{entity:"Team"})),a.data}catch(a){console.error("Error in getTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Team"}));return}},async activateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Team"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Team"})),a}},async deactivateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Team"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Team"})),a}},async getTeamUserList(t,r){try{const o=r?`?filter_query=${r}`:"",a=await n.get(`/item/${t}/user/list/${o}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(a.data.error);return a.data.data}catch(o){console.error("Error in getTeamUserList:",o),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async linkManageUser(t,r){try{const o=await n.post(`/item/${t}/user/item/`,r);if(o.data.error)throw e($.global.t("toast.error.link_failed",{entity:"User"})),new Error(o.data.error);return o.data}catch(o){console.error("Error in link User:",o),e($.global.t("toast.error.link_failed",{entity:"User"}));return}},async updateManageUser(t,r){try{const o=await n.patch(`/item/${t}/user/item/`,r);if(o.data.error)throw e($.global.t("toast.error.update_failed",{entity:"User"})),new Error(o.data.error);return o.data.data}catch(o){throw console.error("Error in update User:",o),e($.global.t("toast.error.update_failed",{entity:"User"})),o}},async getManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"",c=await n.get(`/item/${t}/user/item/${r}/${a}`);if(c.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(c.data.error);return c.data.data}catch(a){console.error("Error in getUser:",a),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async unlinkManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"";await n.delete(`/item/${t}/user/item/${r}/${a}`)}catch(a){throw console.error("Error in unlink User:",a),e($.global.t("toast.error.unlink_failed",{entity:"User"})),a}}}}const Mn=T$();let Qc=!1;const hh=l.ref(!1),jn=l.ref([]),Ty=l.ref([]),ft=l.ref(null),Qi=l.ref([]),Xi=l.ref([]),xT=()=>{const n=wr(),e=async C=>{hh.value=!0;const T=C?`_active eq true and ${C}`:"_active eq true",k=await xo.getOrgList(T);k&&(jn.value=k,Qc=!0),hh.value=!1},t=async C=>{var T;return(T=jn.value)!=null&&T.length||await e(C),jn.value};function r(C){if(!jn.value)throw new Error("Data not stored yet");const T=Oa(jn.value,C,["name","description"]);return C!==""?T:jn.value}const o=C=>{Ty.value=C},a=C=>{ft.value=Ra.cloneDeep(C)},c=async C=>await xo.getOrg(C),d=async()=>{if(ft.value!=null){const C=await xo.createOrg(ft.value);return C!=null&&C.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Organization"})),Qc&&jn.value.push(C.data)),C==null?void 0:C.data}},h=async()=>{if(ve.value=!0,ft.value&&ft.value.__id){const C=await xo.updateOrg(ft.value);if(Qc&&(C!=null&&C.data.__id)){const T=jn.value.findIndex(k=>k.__id===C.data.__id);return T!==-1?(jn.value[T]=C.data,n.success($.global.t("toast.success.update_success",{entity:"Organization"}))):n.error($.global.t("toast.error.update_failed",{entity:"Organization"})),ve.value=!1,C.data}}else ve.value=!1,n.error($.global.t("toast.error.update_failed",{entity:"Organization"}))},m=async()=>{if(ve.value=!0,ft.value&&ft.value.created_at){if(await xo.deactivateOrg(ft.value.__id),Qc){const C=jn.value.findIndex(T=>{var k;return T.__id===((k=ft.value)==null?void 0:k.__id)});if(C!==-1)return jn.value.splice(C,1),ft.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Organization"}))}ve.value=!1}};async function g(C){ve.value=!0;try{if(ft.value&&ft.value.__id){const T={...C,organization:ft.value.__id};if(!await Uo.updateBranch(T)){ve.value=!1;return}if(Qi.value.findIndex(N=>N.__id===C.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Branch"})),Qi.value.push(T),T;n.info($.global.t("toast.info.already_linked",{entity:"Branch"}))}}catch(T){console.error(T)}finally{ve.value=!1}}async function v(C){if(ve.value=!0,ft.value&&ft.value.__id){const T={...C,organization:null};if(!await Uo.updateBranch(T)){ve.value=!1;return}const I=Qi.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Qi.value.splice(I,1),ve.value=!1,Qi.value;throw new Error("Item not found to remove")}ve.value=!1}async function p(C){ve.value=!0;try{if(ft.value&&ft.value.__id){const T={...C,organization:ft.value.__id};if(!await Mn.updateTeam(T)){ve.value=!1;return}if(Xi.value.findIndex(N=>N.__id===C.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Team"})),Xi.value.push(T),T;n.info($.global.t("toast.info.already_linked",{entity:"Team"}))}}catch(T){console.error(T)}finally{ve.value=!1}}async function w(C){if(ve.value=!0,ft.value&&ft.value.__id){const T={...C,organization:null};if(!await Mn.updateTeam(T)){ve.value=!1;return}const I=Xi.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Xi.value.splice(I,1),ve.value=!1,Xi.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:jn,loading:hh,columns:Ty,item:ft,filterData:r,__init__:e,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgBranches:Qi,orgTeams:Xi,linkBranch:g,unlinkBranch:v,linkTeam:p,unlinkTeam:w}};let Xc=!1;const Yn=l.ref([]),by=l.ref([]),Nt=l.ref(null),fh=l.ref(!1),Zi=l.ref([]),UT=()=>{const n=wr(),e=async p=>{fh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await Mn.getTeamList(w);C&&(Yn.value=C,Xc=!0),fh.value=!1},t=async p=>(Yn.value.length||await e(p),Yn.value);function r(p){if(!Yn.value)throw new Error("Data not stored yet");const w=Oa(Yn.value,p,["name","description"]);return p!==""?w:Yn.value}const o=p=>{by.value=p},a=p=>{Nt.value=Ra.cloneDeep(p)},c=async p=>await Mn.getTeam(p),d=async()=>{if(Nt.value!=null){const p=await Mn.createTeam(Nt.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Team"})),Xc&&Yn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(ve.value=!0,Nt.value&&Nt.value.__id){const p=await Mn.updateTeam(Nt.value);if(Xc&&(p!=null&&p.data.__id)){const w=Yn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Yn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Team"}))):n.error($.global.t("toast.error.update_failed",{entity:"Team"})),p.data}}else n.error($.global.t("toast.error.update_failed",{entity:"Team"}))},m=async()=>{if(Nt.value&&Nt.value.created_at&&(await Mn.deactivateTeam(Nt.value.__id),Xc)){const p=Yn.value.findIndex(w=>{var C;return w.__id===((C=Nt.value)==null?void 0:C.__id)});if(p!==-1)return Yn.value.splice(p,1),Nt.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Team"}))}};async function g(p){var w;if(ve.value=!0,(w=Nt.value)!=null&&w.__id)if(Zi.value.findIndex(T=>T.__id===p.__id)===-1)try{const T=await Mn.linkManageUser(Nt.value.__id,{team:Nt.value.__id,user:p.__id,role:"string",joined_at:"string",comments:"string"}),k=await Mn.getTeamUserList(Nt.value.__id);return k&&(Zi.value=k),n.success($.global.t("toast.success.link_success",{entity:"User"})),T}catch(T){console.error(T),n.error($.global.t("toast.error.link_failed",{entity:"User"}))}finally{ve.value=!1}else n.info($.global.t("toast.info.already_linked",{entity:"User"}));else console.warn("No item selected or item ID is missing."),n.info($.global.t("toast.info.select_valid_item"));ve.value=!1}async function v(p){if(ve.value=!0,Nt.value&&Nt.value.__id){const w=Zi.value.findIndex(C=>C.__id===p);if(w!==-1)return await Mn.unlinkManageUser(Nt.value.__id,p),Zi.value.splice(w,1),ve.value=!1,Zi.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:Yn,loading:fh,columns:by,item:Nt,usersTeam:Zi,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,linkUser:g,unlinkUser:v}},BT=l.defineComponent({__name:"GlobalScopeFilter",setup(n){var T,k,I;const{openDialog:e}=Ms("global-scope__J-"),{user:t,scope:r,session:o,setScope:a}=vu(),{getData:c,data:d}=xT(),{getData:h,data:m}=UT(),g=l.ref(!1);l.onBeforeMount(async()=>{g.value=!0,await c(),await h(),g.value=!1});const v=l.ref({scope_type:(T=r.value)==null?void 0:T.scope_type,organization:((k=r.value)==null?void 0:k.organization)??"org",team:(I=r.value)==null?void 0:I.team});function p(){var N,D,L;v.value={...r.value,scope_type:(N=r.value)==null?void 0:N.scope_type,organization:((D=r.value)==null?void 0:D.organization)??"",team:(L=r.value)==null?void 0:L.team},e()}const w=l.computed(()=>{var N;switch((N=r.value)==null?void 0:N.scope_type){case"user":return BF;case"org":return xF;case"team":return FF;default:return UF}});async function C(){var N;((N=r.value)==null?void 0:N.scope_type)!==""&&a(v.value)}return(N,D)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(it.VBtn,{onClick:p,icon:"",class:"text-secondary",color:"surface",rounded:"sm",size:"small",variant:"flat"},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(w.value),{size:"20"}))]),_:1}),l.createVNode(l.unref(Ls),{loading:g.value,title:l.unref($).global.t("dialogs.scope.title"),"dd-id":"global-scope__J-",onOnSave:C},{default:l.withCtx(()=>[l.createElementVNode("div",null,[l.createVNode(Qe.VRow,null,{default:l.withCtx(()=>[l.createVNode(Qe.VCol,{cols:"4",class:"d-flex flex-row align-center"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.user")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>{var L;return[l.createTextVNode(l.toDisplayString(((L=l.unref(t))==null?void 0:L.name)||l.unref($).global.t("dialogs.scope.unknownUser")),1)]}),_:1})]),_:1})]),_:1}),l.createVNode(Qe.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.environment")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).domain),1)]),_:1})]),_:1})]),_:1}),l.createVNode(Qe.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.environment")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).environment),1)]),_:1})]),_:1})]),_:1})]),_:1}),l.createVNode(IO.VBtnToggle,{density:"compact",variant:"outlined",modelValue:v.value.scope_type,"onUpdate:modelValue":D[0]||(D[0]=L=>v.value.scope_type=L),class:"d-flex justify-center my-4"},{default:l.withCtx(()=>[l.createVNode(it.VBtn,{value:"org",label:l.unref($).global.t("dialogs.scope.organizational"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.organizational")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"team",label:l.unref($).global.t("dialogs.scope.team"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.team")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"user",label:l.unref($).global.t("dialogs.scope.user"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.user")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"",label:l.unref($).global.t("dialogs.scope.none"),color:"lightext"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.none")),1)]),_:1},8,["label"])]),_:1},8,["modelValue"]),l.createElementVNode("div",null,[l.createVNode(ys.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.organization")),1)]),_:1}),l.createVNode(ls.VSelect,{items:l.unref(d),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:l.unref($).global.t("dialogs.scope.selectOrganization"),class:"min-w-50",modelValue:v.value.organization,"onUpdate:modelValue":D[1]||(D[1]=L=>v.value.organization=L),clearable:""},null,8,["items","placeholder","modelValue"]),l.createVNode(ys.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.team")),1)]),_:1}),l.createVNode(ls.VSelect,{items:l.unref(m),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:l.unref($).global.t("dialogs.scope.selectTeam"),class:"min-w-50",modelValue:v.value.team,"onUpdate:modelValue":D[2]||(D[2]=L=>v.value.team=L),clearable:""},null,8,["items","placeholder","modelValue"])])])]),_:1},8,["loading","title"])],64))}}),b$={},I$={class:"double-ring-spinner-container"};function S$(n,e){return l.openBlock(),l.createElementBlock("div",I$,e[0]||(e[0]=[l.createElementVNode("div",{class:"spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])],-1)]))}const FT=Sa(b$,[["render",S$],["__scopeId","data-v-00d7a69f"]]),A$={key:0,class:"_jspinner-overlay_jj"},VT=l.defineComponent({__name:"GlobalSpinner",setup(n){return(e,t)=>l.unref(ve)?(l.openBlock(),l.createElementBlock("div",A$,t[0]||(t[0]=[l.createElementVNode("div",{class:"j-double-ring-spinner-container"},[l.createElementVNode("div",{class:"j-global-spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])])],-1)]))):l.createCommentVNode("",!0)}}),HT=l.defineComponent({__name:"SubMenu",props:{title:{}},setup(n,{expose:e}){return e({props:n}),(r,o)=>(l.openBlock(),l.createBlock(Qt.VListItem,{onClick:o[0]||(o[0]=()=>{}),density:"compact"},{append:l.withCtx(()=>[l.createVNode(l.unref(VF))]),default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(r.title),1)]),_:1}),l.createVNode(gf.VMenu,{activator:"parent","open-on-hover":"",submenu:"",density:"compact"},{default:l.withCtx(()=>[l.renderSlot(r.$slots,"default")]),_:3})]),_:3}))}}),k$=Object.freeze(Object.defineProperty({__proto__:null,AvatarPicture:fC,ColumnSettingsDialog:Uf,ConfirmDialog:dC,ContextMenu:mC,CopyButton:Bl,DeleteAllBtn:Cf,DotsMenu:uC,EditButton:lC,FormHeadless:GE,FormMetadata:ou,GlobalScopeFilter:BT,GlobalSpinner:VT,JAvatar:hC,JBtn:Oy,JDialog:Ls,JForm:WE,JIconBtn:Ry,JSelect:VE,JTextArea:HE,JTextField:gE,ParentCard:Kl,SearchFilter:Jl,SpinnerLoader:FT,SubMenu:HT,TabFormHeader:zE,TableAdvanced:XC,TableCard:Bf,TableCardsView:fE,TableHeader:ZC,UiTable:gC},Symbol.toStringTag,{value:"Module"})),N$=e0(),R$={transition:"Vue-Toastification__fade",maxToasts:20,newestOnTop:!0};let mh=!1;const gh=l.ref(!1),Jn=l.ref([]),Iy=l.ref([]),$t=l.ref(null),ea=l.ref([]),O$=()=>{const n=wr(),e=async p=>{gh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await Uo.getBranchList(w);C&&(Jn.value=C,mh=!0),gh.value=!1},t=async p=>(Jn.value.length||await e(p),Jn.value);function r(p){if(!Jn.value)throw new Error("Data not stored yet");const w=Oa(Jn.value,p,["name","description"]);return p!==""?w:Jn.value}const o=p=>{Iy.value=p},a=p=>{$t.value=Ra.cloneDeep(p)},c=async p=>await Uo.getBranch(p),d=async()=>{if($t.value!=null){const p=await Uo.createBranch($t.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Branch"})),mh&&Jn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if($t.value&&$t.value.__id){const p=await Uo.updateBranch($t.value);if(mh&&p){const w=Jn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Jn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Branch"}))):n.error($.global.t("toast.error.update_failed",{entity:"Branch"})),p}}else n.error($.global.t("toast.error.update_failed",{entity:"Branch"}))},m=async()=>{if($t.value&&$t.value.created_at){await Uo.deactivateBranch($t.value.__id);const p=Jn.value.findIndex(w=>{var C;return w.__id===((C=$t.value)==null?void 0:C.__id)});if(p!==-1)return Jn.value.splice(p,1),$t.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Branch"}))}};async function g(p){ve.value=!0;try{if($t.value&&$t.value.__id){const w={...p,branch:$t.value.__id};if(!await Mn.updateTeam(w)){n.error($.global.t("toast.error.link_failed",{entity:"Team"}));return}if(ea.value.findIndex(k=>k.__id===p.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Team"})),ea.value.push(w),w;n.info($.global.t("toast.info.already_linked",{entity:"Team"}))}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{ve.value=!1}}async function v(p){if(ve.value=!0,$t.value&&$t.value.__id){const w={...p,branch:null};if(!await Mn.updateTeam(w))return;const T=ea.value.findIndex(k=>k.__id===p.__id);if(T!==-1)return ea.value.splice(T,1),ve.value=!1,ea.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:Jn,columns:Iy,item:$t,loading:gh,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,branchTeams:ea,linkTeam:g,unlinkTeam:v}};function P$(){const n=Da("https://api.jplan.com.br/management/division"),{error:e}=wr();return{async getDivisionList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Division"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getDivisionList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Division"}));return}},async createDivision(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Division"})),a}},async updateDivision(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"Division"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Division"})),a}},async getDivision(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Division"})),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Division"})),a}},async activateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Division"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Division"})),a}},async deactivateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Division"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Division"})),a}}}}const ca=P$();let ph=!1;const _h=l.ref(!1),Qn=l.ref([]),Sy=l.ref([]),Kt=l.ref(null),ta=l.ref([]),M$=()=>{const n=wr(),e=async p=>{_h.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await ca.getDivisionList(w);C&&(Qn.value=C,ph=!0),_h.value=!1},t=async p=>(Qn.value.length||await e(p),Qn.value);function r(p){if(!Qn.value)throw new Error("Data not stored yet");const w=Oa(Qn.value,p,["name","description"]);return p!==""?w:Qn.value}const o=p=>{Sy.value=p},a=p=>{Kt.value=Ra.cloneDeep(p)},c=async p=>await ca.getDivision(p),d=async()=>{if(Kt.value!=null){const p=await ca.createDivision(Kt.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Division"})),ph&&Qn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(ve.value=!0,Kt.value&&Kt.value.__id){const p=await ca.updateDivision(Kt.value);if(ph&&(p!=null&&p.data.__id)){const w=Qn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Qn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Division"}))):n.error($.global.t("toast.error.update_failed",{entity:"Division"})),ve.value=!1,p}}else ve.value=!1,n.error($.global.t("toast.error.update_failed",{entity:"Division"}))},m=async()=>{if(ve.value=!0,Kt.value&&Kt.value.created_at){await ca.deactivateDivision(Kt.value.__id);const p=Qn.value.findIndex(w=>{var C;return w.__id===((C=Kt.value)==null?void 0:C.__id)});if(p!==-1)return Qn.value.splice(p,1),Kt.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Division"}))}ve.value=!1};async function g(p){ve.value=!0;try{if(Kt.value&&Kt.value.__id){const w={...p,division:Kt.value.__id};return await xo.updateOrg(w)?(ta.value.findIndex(k=>k.__id===p.__id)===-1?(n.success($.global.t("toast.success.link_success",{entity:"Organization"})),ta.value.push(w)):n.info($.global.t("toast.info.already_linked",{entity:"Organization"})),w):void 0}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{ve.value=!1}}async function v(p){if(ve.value=!0,Kt.value&&Kt.value.__id){const w={...p,division:null};if(!await xo.updateOrg(w))return;const T=ta.value.findIndex(k=>k.__id===p.__id);if(T!==-1)ta.value.splice(T,1);else throw new Error("Item not found to remove")}else throw new Error("Item is not defined");return ve.value=!1,ta.value}return{data:Qn,columns:Sy,item:Kt,loading:_h,__init__:e,filterData:r,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgs:ta,linkDivision:g,unlinkDivision:v}};function D$(){const n=Da("https://api.jplan.com.br/management/user"),{error:e}=wr();return{async getManageUserList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getManageUserList:",r),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async createManageUser(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"User"})),a}},async updateManageUser(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"User"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"User"})),a}},async getManageUser(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(a.data.error);return a.data}catch(a){console.error("Error in getManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async activateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"User"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"User"})),a}},async deactivateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"User"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"User"})),a}}}}const la=D$();let vh=!1,yh=l.ref(!1);const Xn=l.ref([]),Ay=l.ref([]),Zn=l.ref(null),L$=l.ref(null),x$=l.ref([]),U$=()=>{const n=wr(),e=async g=>{yh.value=!0;const v=g?`_active eq true and ${g}`:"_active eq true",p=await la.getManageUserList(v);p&&(Xn.value=p,vh=!0),yh.value=!1},t=async g=>(Xn.value.length||await e(g),Xn.value);function r(g){if(!Xn.value)throw new Error("Data not stored yet");const v=Oa(Xn.value,g,["name","description"]);return g!==""?v:Xn.value}return{data:Xn,loading:yh,columns:Ay,item:Zn,filterData:r,__init__:e,getData:t,setColumns:g=>{Ay.value=g},setItem:g=>{Zn.value=Ra.cloneDeep(g)},getItem:async g=>await la.getManageUser(g),createItem:async()=>{if(Zn.value!=null){const g=crypto.randomUUID(),v=await la.createManageUser({...Zn.value,__id:g});return v!=null&&v.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"User"})),vh&&Xn.value.push(v.data)),v==null?void 0:v.data}},updateItem:async()=>{if(ve.value=!0,Zn.value&&Zn.value.created_at){const g=await la.updateManageUser(Zn.value);if(vh&&(g!=null&&g.data)){const v=Xn.value.findIndex(p=>p.__id===(g==null?void 0:g.data.__id));v!==-1?(Xn.value[v]=g==null?void 0:g.data,n.success($.global.t("toast.success.update_success",{entity:"User"}))):n.error($.global.t("toast.error.update_failed",{entity:"User"}))}return ve.value=!1,g==null?void 0:g.data}},removeItem:async()=>{if(Zn.value&&Zn.value.created_at){try{await la.deactivateManageUser(Zn.value.__id)}catch{n.error($.global.t("toast.error.deactivate_failed",{entity:"User"}));return}const g=Xn.value.findIndex(v=>{var p;return v.__id===((p=Zn.value)==null?void 0:p.__id)});if(g!==-1)return Xn.value.splice(g,1),n.success($.global.t("toast.success.deactivate_success",{entity:"User"})),Zn.value}},userOrg:L$,userTeams:x$}},Ch=Object.freeze({colNum:24,rowHeight:50,useCssTransforms:!0,responsive:!0,margin:[12,10]}),na=l.ref(!1),B$=l.ref([]);function F$(){const n=l.ref({...Ch,isResizable:!1,isDraggable:!1,useStyleCursor:!1,cursor:"default"});function e(){if(na.value=!na.value,n.value.isDraggable=na.value,n.value.isResizable=na.value,!na.value){n.value.useStyleCursor=!0,n.value.cursor="pointer";return}n.value.useStyleCursor=!1,n.value.cursor="move"}function t(){n.value={...Ch,isResizable:!1,isDraggable:!1,useStyleCursor:!1,cursor:"default"}}return{DEFAULT_CONFIG:Ch,config:n,layout:B$,edition:na,toggleEdit:e,resetLayout:t}}const V$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetTask-DBOPJn8Y.js"))),H$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetImage-DhplL-E6.js"))),$$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetShortcut-Dii5WJRf.js"))),K$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetSpacer-vOrBACiY.js"))),W$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetLabel-CVusUB7j.js"))),z$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetChartBar-ChMg_dbz.js"))),G$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetChartPie-C2AIgVQ2.js"))),q$={WidgetSpacer:K$,WidgetLabel:W$,WidgetTask:V$,WidgetImage:H$,WidgetShortcut:$$,WidgetChartBar:z$,WidgetChartPie:G$},j$={defaultI18n:!0},Y$=(n,e)=>{const t={...j$,...e};n.use(N$),n.use(nP,R$),t.defaultI18n&&n.use($),Object.entries(k$).forEach(([r,o])=>{n.component(r,o)}),Object.entries(AO).forEach(([r,o])=>{n.provide(r,o)})},J$={install:Y$};exports.ContextMenu=mC;exports.EmptyListImg=Lh;exports.EventBus=Hl;exports.FormHeadless=GE;exports.HttpCore=cF;exports.I18nMessages=Om;exports.SpinnerLoader=FT;exports.TableCardsView=fE;exports.TableHeader=ZC;exports.__spinner=ve;exports._export_sfc=Sa;exports._sfc_main=Ls;exports._sfc_main$1=gC;exports._sfc_main$10=Oy;exports._sfc_main$11=Cf;exports._sfc_main$12=lC;exports._sfc_main$13=Ry;exports._sfc_main$14=VE;exports._sfc_main$15=HE;exports._sfc_main$16=gE;exports._sfc_main$17=WE;exports._sfc_main$18=zE;exports._sfc_main$19=Kl;exports._sfc_main$2=XC;exports._sfc_main$20=hC;exports._sfc_main$21=fC;exports._sfc_main$22=HT;exports._sfc_main$23=BT;exports._sfc_main$24=VT;exports._sfc_main$3=Uf;exports._sfc_main$4=Bf;exports._sfc_main$5=Jl;exports._sfc_main$6=dC;exports._sfc_main$7=Bl;exports._sfc_main$8=uC;exports._sfc_main$9=ou;exports.branchInstance=Uo;exports.coreClient=Rm;exports.createToastInterface=ws;exports.dateFormat=us;exports.divisionInstance=ca;exports.filterQuery=Oa;exports.globalEventBus=yf;exports.i18n=$;exports.index=J$;exports.manageUserInstance=la;exports.msal=Gt;exports.orgInstance=xo;exports.provideToast=tP;exports.scopedClient=Da;exports.setupAuthGuard=_$;exports.teamInstance=Mn;exports.toastInjectionKey=$l;exports.useAuth=Nm;exports.useBranchStore=O$;exports.useCustomizer=i0;exports.useDashboardStore=F$;exports.useDialog=Ms;exports.useDivisionStore=M$;exports.useManageUserStore=U$;exports.useOrganizationStore=xT;exports.useSession=vu;exports.useTeamStore=UT;exports.useToast=wr;exports.widgets=q$;
113
+ ${c}`);return}throw ty(e.error,e.error_description,e.suberror)?new Er(e.error,e.error_description,e.suberror,e.timestamp||F.EMPTY_STRING,e.trace_id||F.EMPTY_STRING,e.correlation_id||F.EMPTY_STRING,e.claims||F.EMPTY_STRING,a):c}}async handleServerTokenResponse(e,t,r,o,a,c,d,h,m){var C;(C=this.performanceClient)==null||C.addQueueMeasurement(x.HandleServerTokenResponse,e.correlation_id);let g;if(e.id_token){if(g=Si(e.id_token||F.EMPTY_STRING,this.cryptoObj.base64Decode),a&&a.nonce&&g.nonce!==a.nonce)throw Y(tw);if(o.maxAge||o.maxAge===0){const T=g.auth_time;if(!T)throw Y(qf);fw(T,o.maxAge)}}this.homeAccountIdentifier=Pt.generateHomeAccountId(e.client_info||F.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,g);let v;a&&a.state&&(v=yr.parseRequestState(this.cryptoObj,a.state)),e.key_id=e.key_id||o.sshKid||void 0;const p=this.generateCacheRecord(e,t,r,o,g,c,a);let w;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),w=new A2(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(w)),d&&!h&&p.account){const T=p.account.generateAccountKey();if(!this.cacheStorage.getAccount(T,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Ti.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,v,void 0,m)}await this.cacheStorage.saveCacheRecord(p,o.storeInCache,o.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&w&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(w))}return Ti.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,v,e,m)}generateCacheRecord(e,t,r,o,a,c,d){const h=t.getPreferredCache();if(!h)throw Y(Yf);const m=Nw(a);let g,v;e.id_token&&a&&(g=au(this.homeAccountIdentifier,h,e.id_token,this.clientId,m||""),v=dm(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,a,e.client_info,h,m,d,void 0,this.logger));let p=null;if(e.access_token){const T=e.scope?vt.fromString(e.scope):new vt(o.scopes||[]),k=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,I=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,N=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,D=r+k,L=D+I,K=N&&N>0?r+N:void 0;p=su(this.homeAccountIdentifier,h,e.access_token,this.clientId,m||t.tenant||"",T.printScopes(),D,L,this.cryptoObj.base64Decode,K,e.token_type,c,e.key_id,o.claims,o.requestedClaimsHash)}let w=null;if(e.refresh_token){let T;if(e.refresh_token_expires_in){const k=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;T=r+k}w=mw(this.homeAccountIdentifier,h,e.refresh_token,this.clientId,e.foci,c,T)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:h,familyId:e.foci}),{account:v,idToken:g,accessToken:p,refreshToken:w,appMetadata:C}}static async generateAuthenticationResult(e,t,r,o,a,c,d,h,m){var D,L,K,q,M;let g=F.EMPTY_STRING,v=[],p=null,w,C,T=F.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===Ge.POP&&!a.popKid){const ce=new ba(e),{secret:ae,keyId:X}=r.accessToken;if(!X)throw Y(Jf);g=await ce.signPopToken(ae,X,a)}else g=r.accessToken.secret;v=vt.fromString(r.accessToken.target).asArray(),p=new Date(Number(r.accessToken.expiresOn)*1e3),w=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),r.accessToken.refreshOn&&(C=new Date(Number(r.accessToken.refreshOn)*1e3))}r.appMetadata&&(T=r.appMetadata.familyId===ps?ps:"");const k=(c==null?void 0:c.oid)||(c==null?void 0:c.sub)||"",I=(c==null?void 0:c.tid)||"";h!=null&&h.spa_accountid&&r.account&&(r.account.nativeAccountId=h==null?void 0:h.spa_accountid);const N=r.account?im(r.account.getAccountInfo(),void 0,c,(D=r.idToken)==null?void 0:D.secret):null;return{authority:t.canonicalAuthority,uniqueId:k,tenantId:I,scopes:v,account:N,idToken:((L=r==null?void 0:r.idToken)==null?void 0:L.secret)||"",idTokenClaims:c||{},accessToken:g,fromCache:o,expiresOn:p,extExpiresOn:w,refreshOn:C,correlationId:a.correlationId,requestId:m||F.EMPTY_STRING,familyId:T,tokenType:((K=r.accessToken)==null?void 0:K.tokenType)||F.EMPTY_STRING,state:d?d.userRequestState:F.EMPTY_STRING,cloudGraphHostName:((q=r.account)==null?void 0:q.cloudGraphHostName)||F.EMPTY_STRING,msGraphHost:((M=r.account)==null?void 0:M.msGraphHost)||F.EMPTY_STRING,code:h==null?void 0:h.spa_code,fromNativeBroker:!1}}}function dm(n,e,t,r,o,a,c,d,h,m,g){g==null||g.verbose("setCachedAccount called");const p=n.getAccountKeys().find(I=>I.startsWith(t));let w=null;p&&(w=n.getAccount(p,g));const C=w||Pt.createAccount({homeAccountId:t,idTokenClaims:o,clientInfo:a,environment:c,cloudGraphHostName:h==null?void 0:h.cloud_graph_host_name,msGraphHost:h==null?void 0:h.msgraph_host,nativeAccountId:m},e,r),T=C.tenantProfiles||[],k=d||C.realm;if(k&&!T.find(I=>I.tenantId===k)){const I=om(t,C.localAccountId,k,o);T.push(I)}return C.tenantProfiles=T,C}/*! @azure/msal-common v14.16.0 2024-11-05 */async function Fw(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.0 2024-11-05 */class Vw extends lm{constructor(e,t){var r;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async getAuthCodeUrl(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(x.GetAuthCodeUrl,e.correlationId);const t=await Q(this.createAuthCodeUrlQueryString.bind(this),x.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return De.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var d,h;if((d=this.performanceClient)==null||d.addQueueMeasurement(x.AuthClientAcquireToken,e.correlationId),!e.code)throw Y(ow);const r=zr(),o=await Q(this.executeTokenRequest.bind(this),x.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),a=(h=o.headers)==null?void 0:h[dn.X_MS_REQUEST_ID],c=new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return c.validateTokenResponse(o.body),Q(c.handleServerTokenResponse.bind(c),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,t,void 0,void 0,void 0,a)}handleFragmentResponse(e,t){if(new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw Y(lw);return e}getLogoutUri(e){if(!e)throw Xe(Ew);const t=this.createLogoutUrlQueryString(e);return De.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var m,g;(m=this.performanceClient)==null||m.addQueueMeasurement(x.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),o=De.appendQueryString(e.tokenEndpoint,r),a=await Q(this.createTokenRequestBody.bind(this),x.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let c;if(t.clientInfo)try{const v=Rl(t.clientInfo,this.cryptoUtils.base64Decode);c={credential:`${v.uid}${tn.CLIENT_INFO_SEPARATOR}${v.utid}`,type:Bn.HOME_ACCOUNT_ID}}catch(v){this.logger.verbose("Could not parse client info for CCS Header: "+v)}const d=this.createTokenRequestHeaders(c||t.ccsCredential),h={clientId:((g=t.tokenBodyParameters)==null?void 0:g.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return Q(this.executePostToTokenEndpoint.bind(this),x.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(o,a,d,h,t.correlationId,x.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement(x.AuthClientCreateTokenRequestBody,e.correlationId);const t=new vs(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[wi])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):ia.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!Zh(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const c=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await Fw(c.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(c.assertionType)}if(t.addGrantType(qE.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Ge.POP){const c=new ba(this.cryptoUtils,this.performanceClient);let d;e.popKid?d=this.cryptoUtils.encodeKid(e.popKid):d=(await Q(c.generateCnf.bind(c),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(d)}else if(e.authenticationScheme===Ge.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw Xe(cu);(!vr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const c=Rl(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${c.uid}${tn.CLIENT_INFO_SEPARATOR}${c.utid}`,type:Bn.HOME_ACCOUNT_ID}}catch(c){this.logger.verbose("Could not parse client info for CCS Header: "+c)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Bn.HOME_ACCOUNT_ID:try{const c=fa(r.credential);t.addCcsOid(c)}catch(c){this.logger.verbose("Could not parse home account ID for CCS Header: "+c)}break;case Bn.UPN:t.addCcsUpn(r.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[Xv])&&t.addExtraQueryParameters({[Xv]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var a,c;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(a=this.performanceClient)==null||a.addQueueMeasurement(x.AuthClientCreateQueryString,t);const r=new vs(t,this.performanceClient);r.addClientId(e.embeddedClientId||((c=e.extraQueryParameters)==null?void 0:c[wi])||this.config.authOptions.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(r.addScopes(o,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri),r.addCorrelationId(t),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),Zh(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==Bt.SELECT_ACCOUNT)if(e.sid&&e.prompt===Bt.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){const d=this.extractAccountSid(e.account);let h=this.extractLoginHint(e.account);if(h&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),h=null),h){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(h);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(d&&e.prompt===Bt.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(d);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,r),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===Ge.POP)){const d=new ba(this.cryptoUtils);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await Q(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}return r.createQueryString()}createLogoutUrlQueryString(e){const t=new vs(e.correlationId,this.performanceClient);return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.16.0 2024-11-05 */const N2=300;class nf extends lm{constructor(e,t){super(e,t)}async acquireToken(e){var c,d;(c=this.performanceClient)==null||c.addQueueMeasurement(x.RefreshTokenClientAcquireToken,e.correlationId);const t=zr(),r=await Q(this.executeTokenRequest.bind(this),x.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(d=r.headers)==null?void 0:d[dn.X_MS_REQUEST_ID],a=new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(r.body),Q(a.handleServerTokenResponse.bind(a),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw Xe(Cw);if((r=this.performanceClient)==null||r.addQueueMeasurement(x.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw Y(jf);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const a=o instanceof Er&&o.errorCode===Dl,c=o instanceof Wo&&o.errorCode===Bv.INVALID_GRANT_ERROR&&o.subError===Bv.CLIENT_MISMATCH_ERROR;if(a||c)return Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=Ai(this.cacheManager.getRefreshToken.bind(this.cacheManager),x.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!r)throw tf(Dl);if(r.expiresOn&&Xh(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||N2))throw tf(um);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||Ge.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Bn.HOME_ACCOUNT_ID}};try{return await Q(this.acquireToken.bind(this),x.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(c){if(c instanceof Er&&c.subError===du){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const d=ha(r);this.cacheManager.removeRefreshToken(d)}throw c}}async executeTokenRequest(e,t){var h,m;(h=this.performanceClient)==null||h.addQueueMeasurement(x.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=De.appendQueryString(t.tokenEndpoint,r),a=await Q(this.createTokenRequestBody.bind(this),x.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),c=this.createTokenRequestHeaders(e.ccsCredential),d={clientId:((m=e.tokenBodyParameters)==null?void 0:m.clientId)||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return Q(this.executePostToTokenEndpoint.bind(this),x.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,a,c,d,e.correlationId,x.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a,c;(o=this.performanceClient)==null||o.addQueueMeasurement(x.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,r=new vs(t,this.performanceClient);if(r.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[wi])||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,(c=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:c.defaultScopes),r.addGrantType(qE.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!Zh(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const d=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await Fw(d.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(d.assertionType)}if(e.authenticationScheme===Ge.POP){const d=new ba(this.cryptoUtils,this.performanceClient);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await Q(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}else if(e.authenticationScheme===Ge.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw Xe(cu);if((!vr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Bn.HOME_ACCOUNT_ID:try{const d=fa(e.ccsCredential.credential);r.addCcsOid(d)}catch(d){this.logger.verbose("Could not parse home account ID for CCS Header: "+d)}break;case Bn.UPN:r.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */class R2 extends lm{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[r,o]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...Pa]});return o===Mo.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new nf(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof iu&&r.errorCode===co)return new nf(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){var h;(h=this.performanceClient)==null||h.addQueueMeasurement(x.SilentFlowClientAcquireCachedToken,e.correlationId);let t=Mo.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!vr.isEmptyObj(e.claims))throw this.setCacheOutcome(Mo.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Y(co);if(!e.account)throw Y(jf);const r=e.account.tenantId||y2(e.authority),o=this.cacheManager.getTokenKeys(),a=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient,e.correlationId);if(a){if(iV(a.cachedAt)||Xh(a.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Mo.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Y(co);a.refreshOn&&Xh(a.refreshOn,0)&&(t=Mo.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Mo.NO_CACHED_ACCESS_TOKEN,e.correlationId),Y(co);const c=e.authority||this.authority.getPreferredCache(),d={account:this.cacheManager.readAccountFromCache(e.account),accessToken:a,idToken:this.cacheManager.getIdToken(e.account,o,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Q(this.generateResultFromCacheRecord.bind(this),x.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(d,e),t]}setCacheOutcome(e,t){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},t),e!==Mo.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(x.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let r;if(e.idToken&&(r=Si(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const a=r==null?void 0:r.auth_time;if(!a)throw Y(qf);fw(a,t.maxAge)}return Ti.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const O2={sendGetRequestAsync:()=>Promise.reject(Y(Ae)),sendPostRequestAsync:()=>Promise.reject(Y(Ae))};/*! @azure/msal-common v14.16.0 2024-11-05 */const ny=",",Hw="|";function P2(n){const{skus:e,libraryName:t,libraryVersion:r,extensionName:o,extensionVersion:a}=n,c=new Map([[0,[t,r]],[2,[o,a]]]);let d=[];if(e!=null&&e.length){if(d=e.split(ny),d.length<4)return e}else d=Array.from({length:4},()=>Hw);return c.forEach((h,m)=>{var g,v;h.length===2&&((g=h[0])!=null&&g.length)&&((v=h[1])!=null&&v.length)&&M2({skuArr:d,index:m,skuName:h[0],skuVersion:h[1]})}),d.join(ny)}function M2(n){const{skuArr:e,index:t,skuName:r,skuVersion:o}=n;t>=e.length||(e[t]=[r,o].join(Hw))}class Os{constructor(e,t){this.cacheOutcome=Mo.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||F.EMPTY_STRING,this.wrapperVer=e.wrapperVer||F.EMPTY_STRING,this.telemetryCacheKey=Wt.CACHE_KEY+tn.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Wt.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&t.push(`broker_error=${r}`);const o=t.join(Wt.VALUE_SEPARATOR),a=this.getRegionDiscoveryFields(),c=[e,a].join(Wt.VALUE_SEPARATOR);return[Wt.SCHEMA_VERSION,c,o].join(Wt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=Os.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(Wt.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(Wt.VALUE_SEPARATOR),a=e.errors.length,c=t<a?Wt.OVERFLOW_TRUE:Wt.OVERFLOW_FALSE,d=[a,c].join(Wt.VALUE_SEPARATOR);return[Wt.SCHEMA_VERSION,e.cacheHits,r,o,d].join(Wt.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=Wt.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof lt?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(Wt.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=Os.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey);else{const o={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o)}}static maxErrorsToSend(e){let t,r=0,o=0;const a=e.errors.length;for(t=0;t<a;t++){const c=e.failedRequests[2*t]||F.EMPTY_STRING,d=e.failedRequests[2*t+1]||F.EMPTY_STRING,h=e.errors[t]||F.EMPTY_STRING;if(o+=c.toString().length+d.toString().length+h.length+3,o<Wt.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||F.EMPTY_STRING),e.push(this.regionSource||F.EMPTY_STRING),e.push(this.regionOutcome||F.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return P2(e)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const $w="missing_kid_error",Kw="missing_alg_error";/*! @azure/msal-common v14.16.0 2024-11-05 */const D2={[$w]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[Kw]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class hm extends lt{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,hm.prototype)}}function ry(n){return new hm(n,D2[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class fm{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw ry($w);if(!e.alg)throw ry(Kw);const t=new fm({typ:e.typ||KF.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class oy{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class L2{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:v2.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new oy}}startPerformanceMeasurement(){return new oy}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const mm="pkce_not_created",rf="crypto_nonexistent",hu="empty_navigate_uri",Ww="hash_empty_error",gm="no_state_in_hash",zw="hash_does_not_contain_known_properties",Gw="unable_to_parse_state",qw="state_interaction_type_mismatch",jw="interaction_in_progress",Yw="popup_window_error",Jw="empty_window_error",bi="user_cancelled",x2="monitor_popup_timeout",Qw="monitor_window_timeout",Xw="redirect_in_iframe",Zw="block_iframe_reload",eT="block_nested_popups",U2="iframe_closed_prematurely",fu="silent_logout_unsupported",tT="no_account_error",B2="silent_prompt_value_error",nT="no_token_request_cache_error",rT="unable_to_parse_token_request_cache_error",pm="no_cached_authority_error",F2="auth_request_not_set_error",V2="invalid_cache_type",mu="non_browser_environment",aa="database_not_open",Ll="no_network_connectivity",oT="post_request_failed",iT="get_request_failed",of="failed_to_parse_response",aT="unable_to_load_token",_m="crypto_key_not_found",sT="auth_code_required",cT="auth_code_or_nativeAccountId_required",lT="spa_code_and_nativeAccountId_present",vm="database_unavailable",uT="unable_to_acquire_token_from_native_platform",dT="native_handshake_timeout",hT="native_extension_not_installed",Ks="native_connection_not_established",fT="uninitialized_public_client_application",mT="native_prompt_not_supported",gT="invalid_base64_string",pT="invalid_pop_token_request",_T="failed_to_build_headers",vT="failed_to_parse_headers";/*! @azure/msal-browser v3.28.1 2025-01-14 */const io="For more visit: aka.ms/msaljs/browser-errors",H2={[mm]:"The PKCE code challenge and verifier could not be generated.",[rf]:"The crypto object or function is not available.",[hu]:"Navigation URI is empty. Please check stack trace for more info.",[Ww]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${io}`,[gm]:"Hash does not contain state. Please verify that the request originated from msal.",[zw]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${io}`,[Gw]:"Unable to parse state. Please verify that the request originated from msal.",[qw]:"Hash contains state but the interaction type does not match the caller.",[jw]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${io}`,[Yw]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Jw]:"window.open returned null or undefined window object.",[bi]:"User cancelled the flow.",[x2]:`Token acquisition in popup failed due to timeout. ${io}`,[Qw]:`Token acquisition in iframe failed due to timeout. ${io}`,[Xw]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[Zw]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${io}`,[eT]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[U2]:"The iframe being monitored was closed prematurely.",[fu]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[tT]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[B2]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[nT]:"No token request found in cache.",[rT]:"The cached token request could not be parsed.",[pm]:"No cached authority found.",[F2]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[V2]:"Invalid cache type",[mu]:"Login and token requests are not supported in non-browser environments.",[aa]:"Database is not open!",[Ll]:"No network connectivity. Check your internet connection.",[oT]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[iT]:"Network request failed. Please check the network trace to determine root cause.",[of]:"Failed to parse network response. Check network trace.",[aT]:"Error loading token to cache.",[_m]:"Cryptographic Key or Keypair not found in browser storage.",[sT]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[cT]:"An authorization code or nativeAccountId must be provided to this flow.",[lT]:"Request cannot contain both spa code and native account id.",[vm]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[uT]:`Unable to acquire token from native platform. ${io}`,[dT]:"Timed out while attempting to establish connection to browser extension",[hT]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Ks]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${io}`,[fT]:`You must call and await the initialize function before attempting to call any other MSAL API. ${io}`,[mT]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[gT]:"Invalid base64 encoded string.",[pT]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[_T]:"Failed to build request headers object.",[vT]:"Failed to parse response headers"};class Ws extends lt{constructor(e,t){super(e,H2[e],t),Object.setPrototypeOf(this,Ws.prototype),this.name="BrowserAuthError"}}function ie(n,e){return new Ws(n,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Dn={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},ma={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},gi={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},vn={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},iy={GET:"GET",POST:"POST"},Ke={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},Po={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},qc={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},ot={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var le;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(le||(le={}));const ay={scopes:Pa},yT="jwk",af="msal.db",$2=1,K2=`${af}.keys`,Pn={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},W2=[Pn.Default,Pn.Skip,Pn.RefreshTokenAndNetwork],z2="msal.browser.log.level",G2="msal.browser.log.pii";/*! @azure/msal-browser v3.28.1 2025-01-14 */function jc(n){return encodeURIComponent(ym(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function gu(n){return CT(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ym(n){return CT(new TextEncoder().encode(n))}function CT(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const q2="RSASSA-PKCS1-v1_5",ET="SHA-256",j2=2048,Y2=new Uint8Array([1,0,1]),sy="0123456789abcdef",cy=new Uint32Array(1),J2="crypto_subtle_undefined",Cm={name:q2,hash:ET,modulusLength:j2,publicExponent:Y2};function Q2(n){if(!window)throw ie(mu);if(!window.crypto)throw ie(rf);if(!n&&!window.crypto.subtle)throw ie(rf,J2)}async function wT(n,e,t){e==null||e.addQueueMeasurement(x.Sha256Digest,t);const o=new TextEncoder().encode(n);return window.crypto.subtle.digest(ET,o)}function X2(n){return window.crypto.getRandomValues(n)}function sh(){return window.crypto.getRandomValues(cy),cy[0]}function go(){const n=Date.now(),e=sh()*1024+(sh()&1023),t=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,a=sh();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|r>>>8,t[7]=r,t[8]=128|o>>>24,t[9]=o>>>16,t[10]=o>>>8,t[11]=o,t[12]=a>>>24,t[13]=a>>>16,t[14]=a>>>8,t[15]=a;let c="";for(let d=0;d<t.length;d++)c+=sy.charAt(t[d]>>>4),c+=sy.charAt(t[d]&15),(d===3||d===5||d===7||d===9)&&(c+="-");return c}async function Z2(n,e){return window.crypto.subtle.generateKey(Cm,n,e)}async function ch(n){return window.crypto.subtle.exportKey(yT,n)}async function eH(n,e,t){return window.crypto.subtle.importKey(yT,n,Cm,e,t)}async function tH(n,e){return window.crypto.subtle.sign(Cm,n,e)}async function TT(n){const e=await wT(n),t=new Uint8Array(e);return gu(t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Ps="storage_not_supported",sf="stubbed_public_client_application_called",xl="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.28.1 2025-01-14 */const gl={[Ps]:"Given storage configuration option was not supported.",[sf]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[xl]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};gl[Ps],gl[sf],gl[xl];class Em extends lt{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Em.prototype)}}function wm(n){return new Em(n,gl[n])}/*! @azure/msal-browser v3.28.1 2025-01-14 */function nH(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function rH(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Tm(){return window.parent!==window}function oH(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Dn.POPUP_NAME_PREFIX}.`)===0}function lo(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function iH(){const e=new De(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function aH(){if(De.hashContainsKnownProperties(window.location.hash)&&Tm())throw ie(Zw)}function sH(n){if(Tm()&&!n)throw ie(Xw)}function cH(){if(oH())throw ie(eT)}function bT(){if(typeof window>"u")throw ie(mu)}function IT(n){if(!n)throw ie(fT)}function bm(n){bT(),aH(),cH(),IT(n)}function ly(n,e){if(bm(n),sH(e.system.allowRedirectInIframe),e.cache.cacheLocation===vn.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw wm(xl)}function ST(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function lH(){return go()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ul{navigateInternal(e,t){return Ul.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Ul.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},t.timeout)})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class uH{async sendGetRequestAsync(e,t){let r,o={},a=0;const c=uy(t);try{r=await fetch(e,{method:iy.GET,headers:c})}catch{throw ie(window.navigator.onLine?iT:Ll)}o=dy(r.headers);try{return a=r.status,{headers:o,body:await r.json(),status:a}}catch{throw Zv(ie(of),a,o)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",o=uy(t);let a,c=0,d={};try{a=await fetch(e,{method:iy.POST,headers:o,body:r})}catch{throw ie(window.navigator.onLine?oT:Ll)}d=dy(a.headers);try{return c=a.status,{headers:d,body:await a.json(),status:c}}catch{throw Zv(ie(of),c,d)}}}function uy(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw ie(_T)}}function dy(n){try{const e={};return n.forEach((t,r)=>{e[r]=t}),e}catch{throw ie(vT)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const dH=6e4,cf=1e4,hH=3e4,fH=2e3;function mH({auth:n,cache:e,system:t,telemetry:r},o){const a={clientId:F.EMPTY_STRING,authority:`${F.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:F.EMPTY_STRING,authorityMetadata:F.EMPTY_STRING,redirectUri:typeof window<"u"?lo():"",postLogoutRedirectUri:F.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:fo.AAD,OIDCOptions:{serverResponseType:$s.FRAGMENT,defaultScopes:[F.OPENID_SCOPE,F.PROFILE_SCOPE,F.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:Xf.None,tenant:F.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},c={cacheLocation:vn.SessionStorage,temporaryCacheLocation:vn.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===vn.LocalStorage),claimsBasedCachingEnabled:!1},d={loggerCallback:()=>{},logLevel:tt.Info,piiLoggingEnabled:!1},m={...{...Dw,loggerOptions:d,networkClient:o?new uH:O2,navigationClient:new Ul,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||dH,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||cf,navigateFrameWait:0,redirectNavigationTimeout:hH,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||fH,pollIntervalMilliseconds:Dn.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||d},g={application:{appName:F.EMPTY_STRING,appVersion:F.EMPTY_STRING},client:new L2};if((n==null?void 0:n.protocolMode)!==fo.OIDC&&(n!=null&&n.OIDCOptions)&&new Ko(m.loggerOptions).warning(JSON.stringify(Xe(Sw))),n!=null&&n.protocolMode&&n.protocolMode!==fo.AAD&&(m!=null&&m.allowNativeBroker))throw Xe(Aw);return{auth:{...a,...n,OIDCOptions:{...a.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...c,...e},system:m,telemetry:{...g,...r}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const gH="@azure/msal-browser",pu="3.28.1";/*! @azure/msal-browser v3.28.1 2025-01-14 */class Im{static loggerCallback(e,t){switch(e){case tt.Error:console.error(t);return;case tt.Info:console.info(t);return;case tt.Verbose:console.debug(t);return;case tt.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var h;this.browserEnvironment=typeof window<"u",this.config=mH(e,this.browserEnvironment);let t;try{t=window[vn.SessionStorage]}catch{}const r=t==null?void 0:t.getItem(z2),o=(h=t==null?void 0:t.getItem(G2))==null?void 0:h.toLowerCase(),a=o==="true"?!0:o==="false"?!1:void 0,c={...this.config.system.loggerOptions},d=r&&Object.keys(tt).includes(r)?tt[r]:void 0;d&&(c.loggerCallback=Im.loggerCallback,c.logLevel=d),a!==void 0&&(c.piiLoggingEnabled=a),this.logger=new Ko(c,gH,pu),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ii extends Im{getModuleName(){return Ii.MODULE_NAME}getId(){return Ii.ID}async initialize(){return this.available=typeof window<"u",this.available}}Ii.MODULE_NAME="";Ii.ID="StandardOperatingContext";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Kr(n){return new TextDecoder().decode(pH(n))}function pH(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw ie(gT)}const t=atob(e);return Uint8Array.from(t,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class _H{constructor(){this.dbName=af,this.version=$2,this.tableName=K2,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const a=o;this.db=a.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>t(ie(vm)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(ie(aa));const d=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);d.addEventListener("success",()=>{this.closeConnection(),r()}),d.addEventListener("error",h=>{this.closeConnection(),o(h)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);c.addEventListener("success",()=>{this.closeConnection(),t()}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(ie(aa));const a=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();a.addEventListener("success",c=>{const d=c;this.closeConnection(),e(d.target.result)}),a.addEventListener("error",c=>{this.closeConnection(),t(c)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result===1)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const r=window.indexedDB.deleteDatabase(af),o=setTimeout(()=>t(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),t(!1)))})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class lf{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class vH{constructor(e){this.inMemoryCache=new lf,this.indexedDBCache=new _H,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Ws&&e.errorCode===vm)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ia{constructor(e,t,r){this.logger=e,Q2(r??!1),this.cache=new vH(this.logger),this.performanceClient=t}createNewGuid(){return go()}base64Encode(e){return ym(e)}base64Decode(e){return Kr(e)}base64UrlEncode(e){return jc(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var g;const t=(g=this.performanceClient)==null?void 0:g.startMeasurement(x.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await Z2(Ia.EXTRACTABLE,Ia.POP_KEY_USAGES),o=await ch(r.publicKey),a={e:o.e,kty:o.kty,n:o.n},c=hy(a),d=await this.hashString(c),h=await ch(r.privateKey),m=await eH(h,!1,["sign"]);return await this.cache.setItem(d,{privateKey:m,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),d}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,o){var D;const a=(D=this.performanceClient)==null?void 0:D.startMeasurement(x.CryptoOptsSignJwt,o),c=await this.cache.getItem(t);if(!c)throw ie(_m);const d=await ch(c.publicKey),h=hy(d),m=jc(JSON.stringify({kid:t})),g=fm.getShrHeaderString({...r==null?void 0:r.header,alg:d.alg,kid:m}),v=jc(g);e.cnf={jwk:JSON.parse(h)};const p=jc(JSON.stringify(e)),w=`${v}.${p}`,T=new TextEncoder().encode(w),k=await tH(c.privateKey,T),I=gu(new Uint8Array(k)),N=`${w}.${I}`;return a&&a.end({success:!0}),N}async hashString(e){return TT(e)}}Ia.POP_KEY_USAGES=["sign","verify"];Ia.EXTRACTABLE=!0;function hy(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.28.1 2025-01-14 */class yH{constructor(){if(!window.localStorage)throw wm(Ps)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class CH{constructor(){if(!window.sessionStorage)throw wm(Ps)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function AT(n,e){if(!e)return null;try{return yr.parseRequestState(n,e).libraryState.meta}catch{throw Y(wa)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const EH=24*60*60*1e3;class wH{getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const a=r[o],[c,...d]=decodeURIComponent(a).trim().split("="),h=d.join("=");if(c===t)return h}return""}setItem(e,t,r,o=!0){let a=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(r){const c=TH(r);a+=`expires=${c};`}o&&(a+="Secure;"),document.cookie=a}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");t.push(o[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function TH(n){const e=new Date;return new Date(e.getTime()+n*EH).toUTCString()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class uf extends Ta{constructor(e,t,r,o,a,c){super(e,r,o,a),this.cacheConfig=t,this.logger=o,this.internalStorage=new lf,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new wH,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=c}setupBrowserStorage(e){try{switch(e){case vn.LocalStorage:return new yH;case vn.SessionStorage:return new CH;case vn.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=vn.MemoryStorage,new lf}migrateCacheEntries(){const e=`${F.CACHE_PREFIX}.${Lt.ID_TOKEN}`,t=`${F.CACHE_PREFIX}.${Lt.CLIENT_INFO}`,r=`${F.CACHE_PREFIX}.${Lt.ERROR}`,o=`${F.CACHE_PREFIX}.${Lt.ERROR_DESC}`,a=this.browserStorage.getItem(e),c=this.browserStorage.getItem(t),d=this.browserStorage.getItem(r),h=this.browserStorage.getItem(o),m=[a,c,d,h];[Lt.ID_TOKEN,Lt.CLIENT_INFO,Lt.ERROR,Lt.ERROR_DESC].forEach((v,p)=>{const w=m[p];w&&this.setTemporaryCache(v,w,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Po.ACCOUNT_KEYS),t=this.getItem(`${Po.TOKEN_KEYS}.${this.clientId}`);if(e&&t){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(o=>{if(this.isCredentialKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);if(c&&c.hasOwnProperty("credentialType"))switch(c.credentialType){case ge.ID_TOKEN:if(Kv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.ID_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${o}`);break;case ge.ACCESS_TOKEN:case ge.ACCESS_TOKEN_WITH_AUTH_SCHEME:if($v(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.ACCESS_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${o}`);break;case ge.REFRESH_TOKEN:if(Wv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.REFRESH_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${o}`);break}}}if(this.isAccountKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);c&&Pt.isAccountEntity(c)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${o} found, saving key to account key map`),this.addAccountKeyToMap(o))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,r,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const r=this.validateAndParseJson(t);return!r||!Pt.isAccountEntity(r)?(this.removeAccountKeyFromMap(e),null):Ta.toObject(new Pt,r)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(Po.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();t.indexOf(e)===-1?(t.push(e),this.setItem(Po.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.setItem(Po.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,ge.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,ge.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,ge.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Po.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const r=this.getTokenKeys();switch(t){case ge.ID_TOKEN:r.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case ge.ACCESS_TOKEN:r.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case ge.REFRESH_TOKEN:r.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),Y(Qh)}this.setItem(`${Po.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const r=this.getTokenKeys();switch(t){case ge.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const o=r.idToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case ge.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const a=r.accessToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ge.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const c=r.refreshToken.indexOf(e);c>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(c,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),Y(Qh)}this.setItem(`${Po.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ID_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Kv(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),r)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ACCESS_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!$v(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),r)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.REFRESH_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Wv(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),r)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!mV(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=fV(e);this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!dV(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&gV(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(qc.WRAPPER_SKU,e),this.internalStorage.setItem(qc.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(qc.WRAPPER_SKU)||F.EMPTY_STRING,t=this.internalStorage.getItem(qc.WRAPPER_VER)||F.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(Lt.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const o=this.generateCacheKey(Lt.ACTIVE_ACCOUNT),a=this.getItem(o);if(!a)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const c=this.getAccountInfoFilteredBy({localAccountId:a});return c?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(c),c):null}const r=this.validateAndParseJson(t);return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:r.homeAccountId,localAccountId:r.localAccountId,tenantId:r.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(Lt.ACTIVE_ACCOUNT_FILTERS),r=this.generateCacheKey(Lt.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const o={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(o)),this.browserStorage.setItem(r,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(r)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!hV(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const a=this.cookieStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),a}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===vn.LocalStorage){const a=this.browserStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,t,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(F.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(F.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(x.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys(),o=[];r.accessToken.forEach(a=>{const c=this.getAccessTokenCredential(a);c!=null&&c.requestedClaimsHash&&a.includes(c.requestedClaimsHash.toLowerCase())&&o.push(this.removeAccessToken(a))}),await Promise.all(o),o.length>0&&this.logger.warning(`${o.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):vr.startsWith(e,F.CACHE_PREFIX)||vr.startsWith(e,Lt.ADAL_ID_TOKEN)?e:`${F.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=yr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=yr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=yr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;const o=this.generateAuthorityKey(r);return this.getTemporaryCache(o)}updateCacheEntries(e,t,r,o,a){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const c=this.generateStateKey(e);this.setTemporaryCache(c,e,!1);const d=this.generateNonceKey(e);this.setTemporaryCache(d,t,!1);const h=this.generateAuthorityKey(e);if(this.setTemporaryCache(h,r,!1),a){const m={credential:a.homeAccountId,type:Bn.HOME_ACCOUNT_ID};this.setTemporaryCache(Ke.CCS_CREDENTIAL,JSON.stringify(m),!0)}else if(o){const m={credential:o,type:Bn.UPN};this.setTemporaryCache(Ke.CCS_CREDENTIAL,JSON.stringify(m),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(Ke.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Ke.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Ke.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Ke.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(Ke.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(Ke.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||F.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf(Ke.REQUEST_STATE)===-1)return;const r=this.temporaryCacheStorage.getItem(t);if(!r)return;const o=AT(this.cryptoImpl,r);o&&o.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=ym(JSON.stringify(e));this.setTemporaryCache(Ke.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(Ke.REQUEST_PARAMS,!0);if(!t)throw ie(nT);let r;try{r=JSON.parse(Kr(t))}catch(o){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${o}`),ie(rT)}if(this.removeTemporaryItem(this.generateCacheKey(Ke.REQUEST_PARAMS)),!r.authority){const o=this.generateAuthorityKey(e),a=this.getTemporaryCache(o);if(!a)throw ie(pm);r.authority=a}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Ke.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${F.CACHE_PREFIX}.${Ke.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${F.CACHE_PREFIX}.${Ke.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw ie(jw);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(Lt.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(Lt.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(Lt.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(Lt.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=t||e;if(r){const o=Si(r,Kr);if(o.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.preferred_username;if(o.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const r=ha(t);if(e!==r){const o=this.getItem(e);if(o)return this.browserStorage.removeItem(e),this.setItem(r,o),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),r;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){var d,h,m;const r=au((d=e.account)==null?void 0:d.homeAccountId,(h=e.account)==null?void 0:h.environment,e.idToken,this.clientId,e.tenantId);let o;t.claims&&(o=await this.cryptoImpl.hashString(t.claims));const a=su((m=e.account)==null?void 0:m.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,Kr,void 0,e.tokenType,void 0,t.sshKid,t.claims,o),c={idToken:r,accessToken:a};return this.saveCacheRecord(c)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(o){if(o instanceof pa&&this.performanceClient&&r)try{const a=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:a.refreshToken.length,cacheIdCount:a.idToken.length,cacheAtCount:a.accessToken.length},r)}catch{}throw o}}}const bH=(n,e)=>{const t={cacheLocation:vn.MemoryStorage,temporaryCacheLocation:vn.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new uf(n,t,Nl,e)};/*! @azure/msal-browser v3.28.1 2025-01-14 */function IH(n,e,t,r){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(r):[]}function SH(n,e,t){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const r=t.getAccountInfoFilteredBy(n);return r?(e.verbose("getAccount: Account matching provided filter found, returning"),r):(e.verbose("getAccount: No matching account found, returning null"),null)}function AH(n,e,t){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const r=t.getAccountInfoFilteredBy({username:n});return r?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),r):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function kH(n,e,t){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const r=t.getAccountInfoFilteredBy({homeAccountId:n});return r?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),r):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function NH(n,e,t){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const r=t.getAccountInfoFilteredBy({localAccountId:n});return r?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),r):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function RH(n,e){e.setActiveAccount(n)}function OH(n){return n.getActiveAccount()}/*! @azure/msal-browser v3.28.1 2025-01-14 */const me={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.28.1 2025-01-14 */class PH{constructor(e){this.eventCallbacks=new Map,this.logger=e||new Ko({})}addEventCallback(e,t,r){if(typeof window<"u"){const o=r||lH();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,o){if(typeof window<"u"){const a={eventType:e,interactionType:t||null,payload:r||null,error:o||null,timestamp:Date.now()};this.eventCallbacks.forEach(([c,d],h)=>{(d.length===0||d.includes(e))&&(this.logger.verbose(`Emitting event to callback ${h}: ${e}`),c.apply(null,[a]))})}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class kT{constructor(e,t,r,o,a,c,d,h,m){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=a,this.navigationClient=c,this.nativeMessageHandler=h,this.correlationId=m||go(),this.logger=o.clone(Dn.MSAL_SKU,pu,this.correlationId),this.performanceClient=d}async clearCacheOnLogout(e){if(e){Pt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(Pt.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return De.getAbsoluteUrl(t,lo())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Os(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.requestAuthority||this.config.auth.authority,c=r!=null&&r.length?r==="true":this.config.auth.instanceAware,d=t&&c?this.config.auth.authority.replace(De.getDomainFromUrl(a),t.environment):a,h=Xt.generateAuthority(d,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),m=await Q(Uw,x.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(h,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(t&&!m.isAlias(t.environment))throw Xe(kw);return m}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const MH=32;async function DH(n,e,t){n.addQueueMeasurement(x.GeneratePkceCodes,t);const r=Ai(LH,x.GenerateCodeVerifier,e,n,t)(n,e,t),o=await Q(xH,x.GenerateCodeChallengeFromVerifier,e,n,t)(r,n,e,t);return{verifier:r,challenge:o}}function LH(n,e,t){try{const r=new Uint8Array(MH);return Ai(X2,x.GetRandomValues,e,n,t)(r),gu(r)}catch{throw ie(mm)}}async function xH(n,e,t,r){e.addQueueMeasurement(x.GenerateCodeChallengeFromVerifier,r);try{const o=await Q(wT,x.Sha256Digest,t,e,r)(n,e,r);return gu(new Uint8Array(o))}catch{throw ie(mm)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function Sm(n,e,t,r){t.addQueueMeasurement(x.InitializeBaseRequest,n.correlationId);const o=n.authority||e.auth.authority,a=[...n&&n.scopes||[]],c={...n,correlationId:n.correlationId,authority:o,scopes:a};if(!c.authenticationScheme)c.authenticationScheme=Ge.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(c.authenticationScheme===Ge.SSH){if(!n.sshJwk)throw Xe(cu);if(!n.sshKid)throw Xe(Iw)}r.verbose(`Authentication Scheme set to "${c.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!vr.isEmptyObj(n.claims)&&(c.requestedClaimsHash=await TT(n.claims)),c}async function UH(n,e,t,r,o){r.addQueueMeasurement(x.InitializeSilentRequest,n.correlationId);const a=await Q(Sm,x.InitializeBaseRequest,o,r,n.correlationId)(n,t,r,o);return{...n,...a,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ma extends kT{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await Q(DH,x.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:F.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=F.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||go(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(e.postLogoutRedirectUri,lo())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,lo())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(lo(),lo())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Vw(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}=e;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetClientConfiguration,this.correlationId);const d=await Q(this.getDiscoveredAuthority.bind(this),x.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}),h=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:d,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:h.loggerCallback,piiLoggingEnabled:h.piiLoggingEnabled,logLevel:h.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Dn.MSAL_SKU,version:pu,cpu:F.EMPTY_STRING,os:F.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:t},a=yr.setRequestState(this.browserCrypto,e&&e.state||F.EMPTY_STRING,o),d={...await Q(Sm,x.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:a,nonce:e.nonce||go(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return d;const h=e.account||this.browserStorage.getActiveAccount();if(h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${h.homeAccountId}`,this.correlationId),d.account=h),!d.loginHint&&!h){const m=this.browserStorage.getLegacyLoginHint();m&&(d.loginHint=m)}return d}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const BH="ContentError",NT="user_switch";/*! @azure/msal-browser v3.28.1 2025-01-14 */const FH="USER_INTERACTION_REQUIRED",VH="USER_CANCEL",HH="NO_NETWORK",$H="PERSISTENT_ERROR",KH="DISABLED",WH="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.28.1 2025-01-14 */const zH=-2147186943,GH={[NT]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Br extends lt{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,Br.prototype),this.name="NativeAuthError",this.ext=r}}function sa(n){if(n.ext&&n.ext.status&&(n.ext.status===$H||n.ext.status===KH)||n.ext&&n.ext.error&&n.ext.error===zH)return!0;switch(n.errorCode){case BH:return!0;default:return!1}}function df(n,e,t){if(t&&t.status)switch(t.status){case WH:return tf(Bw);case FH:return new Er(n,e);case VH:return ie(bi);case HH:return ie(Ll)}return new Br(n,GH[n]||e,t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class RT extends Ma{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(ot.acquireTokenSilent_silentFlow),r=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new R2(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const c=(await Q(o.acquireCachedToken.bind(o),x.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),c}catch(a){throw a instanceof Ws&&a.errorCode===_m&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),a}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class _a extends kT{constructor(e,t,r,o,a,c,d,h,m,g,v,p){var C;super(e,t,r,o,a,c,h,m,p),this.apiId=d,this.accountId=g,this.nativeMessageHandler=m,this.nativeStorageManager=v,this.silentCacheClient=new RT(e,this.nativeStorageManager,r,o,a,c,h,m,p),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const w=this.nativeMessageHandler.getExtensionId()===ma.PREFERRED_EXTENSION_ID?"chrome":(C=this.nativeMessageHandler.getExtensionId())!=null&&C.length?"unknown":void 0;this.skus=Os.makeExtraSkuString({libraryName:Dn.MSAL_SKU,libraryVersion:pu,extensionName:w,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[f2]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),r=zr();try{const o=await this.initializeNativeRequest(e);try{const m=await this.acquireTokensFromCache(this.accountId,o);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),m}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...a}=o,c={method:gi.GetToken,request:a},d=await this.nativeMessageHandler.sendMessage(c),h=this.validateNativeResponse(d);return await this.handleNativeResponse(h,o,r).then(m=>(t.end({success:!0,isNativeBroker:!0,requestId:m.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),m)).catch(m=>{throw t.end({success:!1,errorCode:m.errorCode,subErrorCode:m.subError,isNativeBroker:!0}),m})}catch(o){throw o instanceof Br&&this.serverTelemetryManager.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:vt.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),Y(Yh);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!r)throw Y(Yh);try{const o=this.createSilentCacheRequest(t,r),a=await this.silentCacheClient.acquireToken(o),c={...r,idTokenClaims:a==null?void 0:a.idTokenClaims,idToken:a==null?void 0:a.idToken};return{...a,account:c}}catch(o){throw o}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),a={method:gi.GetToken,request:o};try{const h=await this.nativeMessageHandler.sendMessage(a);this.validateNativeResponse(h)}catch(h){if(h instanceof Br&&(this.serverTelemetryManager.setNativeBrokerErrorCode(h.errorCode),sa(h)))throw h}this.browserStorage.setTemporaryCache(Ke.NATIVE_REQUEST,JSON.stringify(o),!0);const c={apiId:ot.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(d,c)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:o,...a}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ke.NATIVE_REQUEST));const c={method:gi.GetToken,request:a},d=zr();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const h=await this.nativeMessageHandler.sendMessage(c);this.validateNativeResponse(h);const m=this.handleNativeResponse(h,a,d);this.browserStorage.setInteractionInProgress(!1);const g=await m;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),g}catch(h){throw this.browserStorage.setInteractionInProgress(!1),h}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){var g;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Si(e.id_token,Kr),a=this.createHomeAccountIdentifier(e,o),c=(g=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:g.homeAccountId;if(a!==c&&e.account.id!==t.accountId)throw df(NT);const d=await this.getDiscoveredAuthority({requestAuthority:t.authority}),h=dm(this.browserStorage,d,a,Kr,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger),m=await this.generateAuthenticationResult(e,t,o,h,d.canonicalAuthority,r);return this.cacheAccount(h),this.cacheNativeTokens(e,t,a,o,e.access_token,m.tenantId,r),m}createHomeAccountIdentifier(e,t){return Pt.generateHomeAccountId(e.client_info||F.EMPTY_STRING,mr.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?vt.fromString(e.scope):vt.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Ge.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new ba(this.browserCrypto),o={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw Y(Jf);return r.signPopToken(e.access_token,t.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,t,r,o,a,c){const d=this.addTelemetryFromNativeResponse(e),h=e.scope?vt.fromString(e.scope):vt.fromString(t.scope),m=e.account.properties||{},g=m.UID||r.oid||r.sub||F.EMPTY_STRING,v=m.TenantId||r.tid||F.EMPTY_STRING,p=im(o.getAccountInfo(),void 0,r,e.id_token);p.nativeAccountId!==e.account.id&&(p.nativeAccountId=e.account.id);const w=await this.generatePopAccessToken(e,t),C=t.tokenType===Ge.POP?Ge.POP:Ge.BEARER;return{authority:a,uniqueId:g,tenantId:v,scopes:h.asArray(),account:p,idToken:e.id_token,idTokenClaims:r,accessToken:w,fromCache:d?this.isResponseFromCache(d):!1,expiresOn:new Date(Number(c+e.expires_in)*1e3),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,r,o,a,c,d){const h=au(r,t.authority,e.id_token||"",t.clientId,o.tid||""),m=t.tokenType===Ge.POP?F.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,g=d+m,v=this.generateScopes(e,t),p=su(r,t.authority,a,t.clientId,o.tid||c,v.printScopes(),g,0,Kr,void 0,t.tokenType,void 0,t.keyId),w={idToken:h,accessToken:p};this.nativeStorageManager.saveCacheRecord(w,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw jE(Wf,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new De(t);r.validateAsUri();const{scopes:o,...a}=e,c=new vt(o||[]);c.appendScopes(Pa);const d=()=>{switch(this.apiId){case ot.ssoSilent:case ot.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Bt.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case Bt.NONE:case Bt.CONSENT:case Bt.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),ie(mT)}},h={...a,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:c.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:d(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(h.signPopToken&&e.popKid)throw ie(pT);if(this.handleExtraBrokerParams(h),h.extraParameters=h.extraParameters||{},h.extraParameters.telemetry=ma.MATS_TELEMETRY,e.authenticationScheme===Ge.POP){const m={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},g=new ba(this.browserCrypto);let v;if(h.keyId)v=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:h.keyId})),h.signPopToken=!1;else{const p=await Q(g.generateCnf.bind(g),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(m,this.logger);v=p.reqCnfString,h.keyId=p.kid,h.signPopToken=!0}h.reqCnf=v}return this.addRequestSKUs(h),h}handleExtraBrokerParams(e){var a;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(cm)&&e.extraParameters.hasOwnProperty(ef)&&e.extraParameters.hasOwnProperty(wi);if(!e.embeddedClientId&&!t)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[ef],r=e.extraParameters[wi]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(a=this.performanceClient)==null||a.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Fr{constructor(e,t,r,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(x.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:ma.CHANNEL_ID,extensionId:this.extensionId,responseId:go(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((r,o)=>{this.resolvers.set(t.responseId,{resolve:r,reject:o})})}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new Fr(e,t,r,ma.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const a=new Fr(e,t,r);return await a.sendHandshakeRequest(),a}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:ma.CHANNEL_ID,extensionId:this.extensionId,responseId:go(),body:{method:gi.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(ie(dT)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==ma.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===gi.HandshakeRequest){const r=this.handshakeResolvers.get(t.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(ie(hT))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),o=this.handshakeResolvers.get(t.responseId);try{const a=t.body.method;if(a===gi.Response){if(!r)return;const c=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(c)}`),c.status!=="Success")r.reject(df(c.code,c.description,c.ext));else if(c.result)c.result.code&&c.result.description?r.reject(df(c.result.code,c.result.description,c.result.ext)):r.resolve(c.result);else throw jE(Wf,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(a===gi.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(a){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${a}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(a):o&&o.reject(a)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,r,o){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case Ge.BEARER:case Ge.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Am{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(x.HandleCodeResponse,t.correlationId);let r;try{r=this.authModule.handleFragmentResponse(e,t.state)}catch(o){throw o instanceof Wo&&o.subError===bi?ie(bi):o}return Q(this.handleCodeResponseFromServer.bind(this),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(x.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await Q(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const a=this.createCcsCredentials(t);a&&(this.authCodeRequest.ccsCredential=a)}return await Q(this.authModule.acquireToken.bind(this.authModule),x.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Bn.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Bn.UPN}:null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function OT(n,e,t){const r=Pl(n);if(!r)throw Rw(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),ie(zw)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),ie(Ww));return r}function qH(n,e,t){if(!n.state)throw ie(gm);const r=AT(e,n.state);if(!r)throw ie(Gw);if(r.interactionType!==t)throw ie(qw)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class jH extends Ma{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=h}acquireToken(e){try{const r={popupName:this.generatePopupName(e.scopes||Pa,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,a=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,o,a)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,o,a))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var a;this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(ot.acquireTokenPopup),o=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,le.Popup);ST(o.authority);try{const c=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),d=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),h=Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let m;h&&(m=this.performanceClient.startMeasurement(x.FetchAccountIdWithNativeBroker,e.correlationId));const g=await d.getAuthCodeUrl({...o,nativeBroker:h}),v=new Am(d,this.browserStorage,c,this.logger,this.performanceClient),p=this.initiateAuthRequest(g,t);this.eventHandler.emitEvent(me.POPUP_OPENED,le.Popup,{popupWindow:p},null);const w=await this.monitorPopupForHash(p,t.popupWindowParent),C=Ai(OT,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(w,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Ur.removeThrottle(this.browserStorage,this.config.auth.clientId,c),C.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),m&&m.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw ie(Ks);const k=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,C.accountId,this.nativeStorage,o.correlationId),{userRequestState:I}=yr.parseRequestState(this.browserCrypto,o.state);return await k.acquireToken({...o,state:I,prompt:void 0})}return await v.handleCodeResponse(C,o)}catch(c){throw(a=t.popup)==null||a.close(),c instanceof lt&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),c}}async logoutPopupAsync(e,t,r,o){var c,d,h,m;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(me.LOGOUT_START,le.Popup,e);const a=this.initializeServerTelemetryManager(ot.logoutPopup);try{await this.clearCacheOnLogout(e.account);const g=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:a,requestAuthority:r,account:e.account||void 0});try{g.authority.endSessionEndpoint}catch{if((c=e.account)!=null&&c.homeAccountId&&e.postLogoutRedirectUri&&g.authority.protocolMode===fo.OIDC){if(this.browserStorage.removeAccount((d=e.account)==null?void 0:d.homeAccountId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Popup,e),o){const w={apiId:ot.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=De.getAbsoluteUrl(o,lo());await this.navigationClient.navigateInternal(C,w)}(h=t.popup)==null||h.close();return}}const v=g.getLogoutUri(e);this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Popup,e);const p=this.openPopup(v,t);if(this.eventHandler.emitEvent(me.POPUP_OPENED,le.Popup,{popupWindow:p},null),await this.monitorPopupForHash(p,t.popupWindowParent).catch(()=>{}),o){const w={apiId:ot.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=De.getAbsoluteUrl(o,lo());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${C}`),await this.navigationClient.navigateInternal(C,w)}else this.logger.verbose("No main window navigation requested")}catch(g){throw(m=t.popup)==null||m.close(),g instanceof lt&&(g.setCorrelationId(this.correlationId),a.cacheFailedRequest(g)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,le.Popup,null,g),this.eventHandler.emitEvent(me.LOGOUT_END,le.Popup),g}this.eventHandler.emitEvent(me.LOGOUT_END,le.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),ie(hu)}monitorPopupForHash(e,t){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const a=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(a),o(ie(bi));return}let c="";try{c=e.location.href}catch{}if(!c||c==="about:blank")return;clearInterval(a);let d="";const h=this.config.auth.OIDCOptions.serverResponseType;e&&(h===$s.QUERY?d=e.location.search:d=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(d)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw ie(Jw);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),this.browserStorage.setInteractionInProgress(!1),ie(Yw)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:o}){var w,C,T,k;const a=o.screenLeft?o.screenLeft:o.screenX,c=o.screenTop?o.screenTop:o.screenY,d=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let m=(w=r.popupSize)==null?void 0:w.width,g=(C=r.popupSize)==null?void 0:C.height,v=(T=r.popupPosition)==null?void 0:T.top,p=(k=r.popupPosition)==null?void 0:k.left;return(!m||m<0||m>d)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),m=Dn.POPUP_WIDTH),(!g||g<0||g>h)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),g=Dn.POPUP_HEIGHT),(!v||v<0||v>h)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),v=Math.max(0,h/2-Dn.POPUP_HEIGHT/2+c)),(!p||p<0||p>d)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),p=Math.max(0,d/2-Dn.POPUP_WIDTH/2+a)),o.open(e,t,`width=${m}, height=${g}, top=${v}, left=${p}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(le.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Dn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Dn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class fy{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Ke.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Ke.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:ot.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),ie(hu)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(t),o=this.browserStorage.getTemporaryCache(r);if(!o)throw Y(kl,"Cached State");let a;try{a=this.authModule.handleFragmentResponse(e,o)}catch(m){throw m instanceof Wo&&m.subError===bi?ie(bi):m}const c=this.browserStorage.generateNonceKey(o),d=this.browserStorage.getTemporaryCache(c);if(this.authCodeRequest.code=a.code,a.cloud_instance_host_name&&await Q(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(a.cloud_instance_host_name,this.authCodeRequest.correlationId),a.nonce=d||void 0,a.state=o,a.client_info)this.authCodeRequest.clientInfo=a.client_info;else{const m=this.checkCcsCredentials();m&&(this.authCodeRequest.ccsCredential=m)}const h=await this.authModule.acquireToken(this.authCodeRequest,a);return this.browserStorage.cleanRequestByState(t),h}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(Ke.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function YH(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class JH extends Ma{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.nativeStorage=h}async acquireToken(e){const t=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,le.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const r=this.initializeServerTelemetryManager(ot.acquireTokenRedirect),o=a=>{a.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(me.RESTORE_FROM_BFCACHE,le.Redirect))};try{const a=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),c=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),d=new fy(c,this.browserStorage,a,this.logger,this.performanceClient),h=await c.getAuthCodeUrl({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),m=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${m}`),window.addEventListener("pageshow",o),await d.initiateAuthRequest(h,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:m,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(a){throw a instanceof lt&&(a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(t.state),a}}async handleRedirectPromise(e="",t){const r=this.initializeServerTelemetryManager(ot.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[o,a]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(le.Redirect),YH()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const c=this.browserStorage.getTemporaryCache(Ke.ORIGIN_URI,!0)||F.EMPTY_STRING,d=De.removeHashFromUrl(c),h=De.removeHashFromUrl(window.location.href);if(d===h&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),c.indexOf("#")>-1&&rH(c),await this.handleResponse(o,r);if(this.config.auth.navigateToLoginRequestUrl){if(!Tm()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Ke.URL_HASH,a,!0);const m={apiId:ot.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let g=!0;if(!c||c==="null"){const v=iH();this.browserStorage.setTemporaryCache(Ke.ORIGIN_URI,v,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),g=await this.navigationClient.navigateInternal(v,m)}else this.logger.verbose(`Navigating to loginRequestUrl: ${c}`),g=await this.navigationClient.navigateInternal(c,m);if(!g)return await this.handleResponse(o,r)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,r);return null}catch(o){throw o instanceof lt&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.browserStorage.cleanRequestByInteractionType(le.Redirect),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===$s.QUERY?t=window.location.search:t=window.location.hash);let r=Pl(t);if(r){try{qH(r,this.browserCrypto,le.Redirect)}catch(a){return a instanceof lt&&this.logger.error(`Interaction type validation failed due to ${a.errorCode}: ${a.errorMessage}`),[null,""]}return nH(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}const o=this.browserStorage.getTemporaryCache(Ke.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ke.URL_HASH)),o&&(r=Pl(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,t){const r=e.state;if(!r)throw ie(gm);const o=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw ie(Ks);const h=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,o.correlationId),{userRequestState:m}=yr.parseRequestState(this.browserCrypto,r);return h.acquireToken({...o,state:m,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(r)})}const a=this.browserStorage.getCachedAuthority(r);if(!a)throw ie(pm);const c=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:a});return Ur.removeThrottle(this.browserStorage,this.config.auth.clientId,o),new fy(c,this.browserStorage,o,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){var o,a;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(ot.logout);try{this.eventHandler.emitEvent(me.LOGOUT_START,le.Redirect,e),await this.clearCacheOnLogout(t.account);const c={apiId:ot.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(d.authority.protocolMode===fo.OIDC)try{d.authority.endSessionEndpoint}catch{if((o=t.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((a=t.account)==null?void 0:a.homeAccountId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Redirect,t);return}}const h=d.getLogoutUri(t);if(this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(h)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}}catch(c){throw c instanceof lt&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,le.Redirect,null,c),this.eventHandler.emitEvent(me.LOGOUT_END,le.Redirect),c}this.eventHandler.emitEvent(me.LOGOUT_END,le.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return De.getAbsoluteUrl(t,lo())}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function QH(n,e,t,r,o){if(e.addQueueMeasurement(x.SilentHandlerInitiateAuthRequest,r),!n)throw t.info("Navigate url is empty"),ie(hu);return o?Q(ZH,x.SilentHandlerLoadFrame,t,e,r)(n,o,e,r):Ai(e$,x.SilentHandlerLoadFrameSync,t,e,r)(n)}async function XH(n,e,t,r,o,a,c){return r.addQueueMeasurement(x.SilentHandlerMonitorIframeForHash,a),new Promise((d,h)=>{e<cf&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${cf}ms). This may result in timeouts.`);const m=window.setTimeout(()=>{window.clearInterval(g),h(ie(Qw))},e),g=window.setInterval(()=>{let v="";const p=n.contentWindow;try{v=p?p.location.href:""}catch{}if(!v||v==="about:blank")return;let w="";p&&(c===$s.QUERY?w=p.location.search:w=p.location.hash),window.clearTimeout(m),window.clearInterval(g),d(w)},t)}).finally(()=>{Ai(t$,x.RemoveHiddenIframe,o,r,a)(n)})}function ZH(n,e,t,r){return t.addQueueMeasurement(x.SilentHandlerLoadFrame,r),new Promise((o,a)=>{const c=PT();window.setTimeout(()=>{if(!c){a("Unable to load iframe");return}c.src=n,o(c)},e)})}function e$(n){const e=PT();return e.src=n,e}function PT(){const n=document.createElement("iframe");return n.className="msalSilentIframe",n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(n),n}function t$(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class n$ extends Ma{constructor(e,t,r,o,a,c,d,h,m,g,v){super(e,t,r,o,a,c,h,g,v),this.apiId=d,this.nativeStorage=m}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==Bt.NONE&&t.prompt!==Bt.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${Bt.NONE}`),t.prompt=Bt.NONE):t.prompt=Bt.NONE;const r=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,le.Silent);ST(r.authority);const o=this.initializeServerTelemetryManager(this.apiId);let a;try{return a=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await Q(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(a,r)}catch(c){if(c instanceof lt&&(c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c)),!a||!(c instanceof lt)||c.errorCode!==Dn.INVALID_GRANT_ERROR)throw c;this.performanceClient.addFields({retryError:c.errorCode},this.correlationId);const d=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,le.Silent);return await Q(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(a,d)}}logout(){return Promise.reject(ie(fu))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(x.SilentIframeClientTokenHelper,r);const o=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(t),a=await Q(e.getAuthCodeUrl.bind(e),x.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),c=new Am(e,this.browserStorage,o,this.logger,this.performanceClient),d=await Q(QH,x.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(a,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),h=this.config.auth.OIDCOptions.serverResponseType,m=await Q(XH,x.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(d,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,h),g=Ai(OT,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(m,h,this.logger);if(g.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw ie(Ks);const v=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,g.accountId,this.browserStorage,r),{userRequestState:p}=yr.parseRequestState(this.browserCrypto,t.state);return Q(v.acquireToken.bind(v),x.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...t,state:p,prompt:t.prompt||Bt.NONE})}return Q(c.handleCodeResponse.bind(c),x.HandleCodeResponse,this.logger,this.performanceClient,r)(g,t)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class r$ extends Ma{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentRefreshClientAcquireToken,e.correlationId);const t=await Q(Sm,x.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(ot.acquireTokenSilent_silentFlow),a=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return Q(a.acquireTokenByRefreshToken.bind(a),x.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(c=>{throw c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c),c})}logout(){return Promise.reject(ie(fu))}async createRefreshTokenClient(e){const t=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new nf(t,this.performanceClient)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class o${constructor(e,t,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw ie(mu);const o=t.id_token?Si(t.id_token,Kr):void 0,a={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},c=e.authority?new Xt(Xt.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,a,this.logger,e.correlationId||go()):void 0,d=this.loadAccount(e,r.clientInfo||t.client_info||"",o,c),h=this.loadIdToken(t,d.homeAccountId,d.environment,d.realm),m=this.loadAccessToken(e,t,d.homeAccountId,d.environment,d.realm,r),g=this.loadRefreshToken(t,d.homeAccountId,d.environment);return this.generateAuthenticationResult(e,{account:d,idToken:h,accessToken:m,refreshToken:g},o,c)}loadAccount(e,t,r,o){if(this.logger.verbose("TokenCache - loading account"),e.account){const h=Pt.createFromAccountInfo(e.account);return this.storage.setAccount(h),h}else if(!o||!t&&!r)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),ie(aT);const a=Pt.generateHomeAccountId(t,o.authorityType,this.logger,this.cryptoObj,r),c=r==null?void 0:r.tid,d=dm(this.storage,o,a,Kr,r,t,o.hostnameAndPort,c,void 0,void 0,this.logger);return this.storage.setAccount(d),d}loadIdToken(e,t,r,o){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const a=au(t,r,e.id_token,this.config.auth.clientId,o);return this.storage.setIdTokenCredential(a),a}loadAccessToken(e,t,r,o,a,c){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const d=t.scope?vt.fromString(t.scope):new vt(e.scopes),h=c.expiresOn||t.expires_in+new Date().getTime()/1e3,m=c.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,g=su(r,o,t.access_token,this.config.auth.clientId,a,d.printScopes(),h,m,Kr);return this.storage.setAccessTokenCredential(g),g}loadRefreshToken(e,t,r){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const o=mw(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(o),o}generateAuthenticationResult(e,t,r,o){var g,v,p;let a="",c=[],d=null,h;t!=null&&t.accessToken&&(a=t.accessToken.secret,c=vt.fromString(t.accessToken.target).asArray(),d=new Date(Number(t.accessToken.expiresOn)*1e3),h=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const m=t.account;return{authority:o?o.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:c,account:m.getAccountInfo(),idToken:((g=t.idToken)==null?void 0:g.secret)||"",idTokenClaims:r||{},accessToken:a,fromCache:!0,expiresOn:d,correlationId:e.correlationId||"",requestId:"",extExpiresOn:h,familyId:((v=t.refreshToken)==null?void 0:v.familyId)||"",tokenType:((p=t==null?void 0:t.accessToken)==null?void 0:p.tokenType)||"",state:e.state||"",cloudGraphHostName:m.cloudGraphHostName||"",msGraphHost:m.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class i$ extends Vw{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class a$ extends Ma{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,h,m,g),this.apiId=d}async acquireToken(e){if(!e.code)throw ie(sT);const t=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,le.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...t,code:e.code},a=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),c=new i$(a);this.logger.verbose("Auth code client created");const d=new Am(c,this.browserStorage,o,this.logger,this.performanceClient);return await Q(d.handleCodeResponseFromServer.bind(d),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(o){throw o instanceof lt&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(ie(fu))}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function Dr(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function Yc(n,e){try{bm(n)}catch(t){throw e.end({success:!1},t),t}}class _u{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ia(this.logger,this.performanceClient):Nl,this.eventHandler=new PH(this.logger),this.browserStorage=this.isBrowserEnvironment?new uf(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,C2(this.config.auth),this.performanceClient):bH(this.config.auth.clientId,this.logger);const t={cacheLocation:vn.MemoryStorage,temporaryCacheLocation:vn.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new uf(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new o$(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const r=new _u(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,o=this.performanceClient.startMeasurement(x.InitializeClientApplication,t);if(this.eventHandler.emitEvent(me.INITIALIZE_START),r)try{this.nativeExtensionProvider=await Fr.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(a){this.logger.verbose(a)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await Q(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),x.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END),o.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),IT(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,a=o?r==null?void 0:r.correlationId:this.browserStorage.getTemporaryCache(Ke.CORRELATION_ID,!0)||"",c=this.performanceClient.startMeasurement(x.AcquireTokenRedirect,a);this.eventHandler.emitEvent(me.HANDLE_REDIRECT_START,le.Redirect);let d;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const h=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);d=Q(h.handleRedirectPromise.bind(h),x.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(this.performanceClient,c.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const h=this.createRedirectClient(a);d=Q(h.handleRedirectPromise.bind(h),x.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(e,c)}return d.then(h=>(h?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(me.LOGIN_SUCCESS,le.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),c.end({success:!0,accountType:Dr(h.account)})):c.event.errorCode?c.end({success:!1}):c.discard(),this.eventHandler.emitEvent(me.HANDLE_REDIRECT_END,le.Redirect),h)).catch(h=>{const m=h;throw t.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Redirect,null,m):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Redirect,null,m),this.eventHandler.emitEvent(me.HANDLE_REDIRECT_END,le.Redirect),c.end({success:!1},m),h})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenPreRedirect,t);r.add({accountType:Dr(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=c=>{const d=typeof o=="function"?o(c):void 0;return d!==!1?r.end({success:!0}):r.discard(),d};else{const c=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=d=>{const h=typeof c=="function"?c(d):void 0;return h!==!1?r.end({success:!0}):r.discard(),h}}const a=this.getAllAccounts().length>0;try{ly(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),a?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Redirect,e):this.eventHandler.emitEvent(me.LOGIN_START,le.Redirect,e);let c;return this.nativeExtensionProvider&&this.canUseNative(e)?c=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch(h=>{if(h instanceof Br&&sa(h))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(h instanceof Er)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),h}):c=this.createRedirectClient(t).acquireToken(e),await c}catch(c){throw r.end({success:!1},c),a?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Redirect,null,c):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Redirect,null,c),c}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:Dr(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),Yc(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(c){return Promise.reject(c)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Popup,e):this.eventHandler.emitEvent(me.LOGIN_START,le.Popup,e);let a;return this.canUseNative(e)?a=this.acquireTokenNative({...e,correlationId:t},ot.acquireTokenPopup).then(c=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,accountType:Dr(c.account)}),c)).catch(c=>{if(c instanceof Br&&sa(c))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(c instanceof Er)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),c}):a=this.createPopupClient(t).acquireToken(e),a.then(c=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(me.LOGIN_SUCCESS,le.Popup,c):this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Popup,c),r.end({success:!0,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Dr(c.account)}),c)).catch(c=>(o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Popup,null,c):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Popup,null,c),r.end({success:!1},c),Promise.reject(c)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var a,c;const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(x.SsoSilent,t),(a=this.ssoSilentMeasurement)==null||a.add({scenarioId:e.scenarioId,accountType:Dr(e.account)}),Yc(this.initialized,this.ssoSilentMeasurement),(c=this.ssoSilentMeasurement)==null||c.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(me.SSO_SILENT_START,le.Silent,r);let o;return this.canUseNative(r)?o=this.acquireTokenNative(r,ot.ssoSilent).catch(d=>{if(d instanceof Br&&sa(d))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw d}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(d=>{var h;return this.eventHandler.emitEvent(me.SSO_SILENT_SUCCESS,le.Silent,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,isNativeBroker:d.fromNativeBroker,accessTokenSize:d.accessToken.length,idTokenSize:d.idToken.length,accountType:Dr(d.account)}),d}).catch(d=>{var h;throw this.eventHandler.emitEvent(me.SSO_SILENT_FAILURE,le.Silent,null,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!1},d),d}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenByCode,t);Yc(this.initialized,r),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_START,le.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw ie(lT);if(e.code){const o=e.code;let a=this.hybridAuthCodeResponses.get(o);return a?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),a=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(c=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_SUCCESS,le.Silent,c),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:c.fromNativeBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Dr(c.account)}),c)).catch(c=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,le.Silent,null,c),r.end({success:!1},c),c}),this.hybridAuthCodeResponses.set(o,a)),await a}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:t},ot.acquireTokenByCode,e.nativeAccountId).catch(a=>{throw a instanceof Br&&sa(a)&&(this.nativeExtensionProvider=void 0),a});return r.end({accountType:Dr(o.account),success:!0}),o}else throw ie(uT);else throw ie(cT)}catch(o){throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,le.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(x.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(a=>{var c;return(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!0,fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker}),a}).catch(a=>{var c;throw(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenFromCache,e.correlationId),t){case Pn.Default:case Pn.AccessToken:case Pn.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return Q(r.acquireToken.bind(r),x.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(co)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenByRefreshToken,e.correlationId),t){case Pn.Default:case Pn.AccessTokenAndRefreshToken:case Pn.RefreshToken:case Pn.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return Q(r.acquireToken.bind(r),x.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(co)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(x.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return Q(t.acquireToken.bind(t),x.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return ly(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return bm(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return IH(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return SH(e,this.logger,this.browserStorage)}getAccountByUsername(e){return AH(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return kH(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return NH(e,this.logger,this.browserStorage)}setActiveAccount(e){RH(e,this.browserStorage)}getActiveAccount(){return OH(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=Pt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw ie(Ks);return new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Bt.NONE:case Bt.CONSENT:case Bt.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new jH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new JH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new n$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new RT(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new r$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new a$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return bT(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){var t;try{(t=e.key)!=null&&t.includes(Lt.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(me.ACTIVE_ACCOUNT_CHANGED);const r=e.newValue||e.oldValue;if(!r)return;const o=JSON.parse(r);if(typeof o!="object"||!Pt.isAccountEntity(o))return;const c=Ta.toObject(new Pt,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_ADDED,void 0,c)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_REMOVED,void 0,c))}catch{return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?go():F.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||ay})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||ay})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Yc(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw ie(tT);r.add({accountType:Dr(o)});const a={clientId:this.config.auth.clientId,authority:e.authority||F.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},c=JSON.stringify(a),d=this.activeSilentTokenRequests.get(c);if(typeof d>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const h=Q(this.acquireTokenSilentAsync.bind(this),x.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},o).then(m=>(this.activeSilentTokenRequests.delete(c),r.end({success:!0,fromCache:m.fromCache,isNativeBroker:m.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:m.accessToken.length,idTokenSize:m.idToken.length}),m)).catch(m=>{throw this.activeSilentTokenRequests.delete(c),r.end({success:!1},m),m});return this.activeSilentTokenRequests.set(c,h),{...await h,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.discard(),{...await d,state:e.state}}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(x.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await Q(UH,x.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),a=e.cacheLookupPolicy||Pn.Default;return this.acquireTokenSilentNoIframe(o,a).catch(async d=>{if(s$(d,a))if(this.activeIframeRequest)if(a!==Pn.Skip){const[m,g]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${g}`,o.correlationId);const v=this.performanceClient.startMeasurement(x.AwaitConcurrentIframe,o.correlationId);v.add({awaitIframeCorrelationId:g});const p=await m;if(v.end({success:p}),p)return this.logger.verbose(`Parallel iframe request with correlationId: ${g} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,a);throw this.logger.info(`Iframe request with correlationId: ${g} failed. Interaction is required.`),d}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),Q(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let m;return this.activeIframeRequest=[new Promise(g=>{m=g}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),Q(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(g=>(m(!0),g)).catch(g=>{throw m(!1),g}).finally(()=>{this.activeIframeRequest=void 0})}else throw d}).then(d=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Silent,d),e.correlationId&&this.performanceClient.addFields({fromCache:d.fromCache,isNativeBroker:d.fromNativeBroker},e.correlationId),d)).catch(d=>{throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Silent,null,d),d}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,t){return Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,ot.acquireTokenSilent_silentFlow).catch(async r=>{throw r instanceof Br&&sa(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,Y(co)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),Q(this.acquireTokenFromCache.bind(this),x.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(r=>{if(t===Pn.AccessToken)throw r;return this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_NETWORK_START,le.Silent,e),Q(this.acquireTokenByRefreshToken.bind(this),x.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function s$(n,e){const t=!(n instanceof Er&&n.subError!==du),r=n.errorCode===Dn.INVALID_GRANT_ERROR||n.errorCode===co,o=t&&r||n.errorCode===Dl||n.errorCode===um,a=W2.includes(e);return o&&a}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function c$(n,e){const t=new Ii(n);return await t.initialize(),_u.createController(t,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class km{static async createPublicClientApplication(e){const t=await c$(e);return new km(e,t)}constructor(e,t){this.controller=t||new _u(new Ii(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const lh=process.env.JPLAN_WEBAPP__APP_PROXY_TENANT_NAME??"",l$=process.env.JPLAN_WEBAPP__APP_PROXY_CLIENT_ID??"",u$=process.env.JPLAN_WEBAPP__APP_PROXY_USER_FLOW??"",hf=process.env.JPLAN_WEBAPP__URL_AUTH??process.env.JPLAN_WEBAPP__URL_BASE??"",d$={auth:{clientId:l$,authority:`https://${lh}.b2clogin.com/${lh}.onmicrosoft.com/${u$}`,knownAuthorities:[`${lh}.b2clogin.com`],redirectUri:process.env.JPLAN_AUTOMATION_ENVIRONMENT?`${hf}/_/dashboard`:hf},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(n,e)=>{n===tt.Error&&console.error(e)},logLevel:tt.Warning}}},MT=(n,e)=>({scopes:["https://graph.microsoft.com/.default","openid","profile"],redirectStartPage:`${hf}${n}`,extraQueryParameters:e}),Gt=new km(d$),my=l.ref(null);function DT(){async function n(e){var t;if(e)try{const r=e.idTokenClaims;if(!(r!=null&&r.aud))throw new Error("User audience (aud) is missing in ID token claims");const o=localStorage.getItem(`msal.token.keys.${r.aud}`);if(!o)throw new Error(`Token keys para ${r.aud} não encontrados no localStorage`);const a=JSON.parse(o),c=(t=a==null?void 0:a.idToken)==null?void 0:t[0];if(!c)throw new Error("idToken não encontrado nos token keys");const d=localStorage.getItem(c);if(!d)throw new Error(`Dados do token para ID ${c} não encontrados no localStorage`);const h=JSON.parse(d),m=h==null?void 0:h.secret;if(!m)throw new Error("Secret não encontrado nos dados do token");sessionStorage.setItem("isAuthenticated","true"),my.value=m}catch(r){console.error("Erro ao obter token de acesso:",r)}}return{jToken:my,setJToken:n}}let Jc=null;const tr=l.ref(null),Ji=l.ref(null),LT=l.ref(Math.floor(Date.now()/1e3));ff.useIntervalFn(()=>h$(),1e3);function h$(){var r,o;if(!((o=(r=tr.value)==null?void 0:r.idTokenClaims)!=null&&o.exp))return;const n=Math.floor(Date.now()/1e3),e=300,t=tr.value.idTokenClaims.exp;LT.value=t-n-e}function Nm(){if(Jc)return Jc;const{setJToken:n,jToken:e}=DT(),t=l.computed(()=>!!tr.value),r=l.computed(()=>tr.value);let o;async function a(p,w){if(!t.value)switch(p){case"redirect":if(w){o=w,await h();break}case"tab":default:await c();break}}const c=async()=>new Promise((p,w)=>{try{localStorage.clear();const C=process.env.JPLAN_WEBAPP__URL_AUTH,T=window.open(C);if(!T){console.error("Failed to open authentication window"),w("Failed to open authentication window");return}const k=Date.now(),I=6e4,N=setInterval(()=>{if(Date.now()-k>I||T.closed){clearInterval(N),console.error("Authentication canceled or timeout reached."),w("Authentication canceled or timeout reached.");return}Object.keys(localStorage).some(L=>L.startsWith("msal.account.keys"))&&(clearInterval(N),d(),T.close(),p())},500)}catch(C){console.error("Error in handleRedirect:",C),w(C)}}),d=async()=>{try{await Gt.initialize();const p=Gt.getActiveAccount();if(p)tr.value=p;else{const w=await Gt.handleRedirectPromise();w?(Gt.setActiveAccount(w.account),tr.value=Gt.getActiveAccount()):console.error("Falha na autenticação")}}catch(p){console.error("Erro no processo de autenticação:",p)}tr.value&&await n(tr.value)},h=async()=>{try{await Gt.initialize();const p=await Gt.handleRedirectPromise();if(!p||Gt.getAllAccounts().length===0){const w=MT(o);await Gt.loginRedirect(w);return}Gt.setActiveAccount(p.account),tr.value=Gt.getActiveAccount(),tr.value&&await n(tr.value),Ji.value="updated"}catch(p){console.error("handleRedirect failed",p)}};async function m(){ve.value=!0,Ji.value="updating";try{const p=await Gt.acquireTokenSilent({scopes:["https://graph.microsoft.com/.default","openid","profile"]});Gt.setActiveAccount(p.account),await n(tr.value),Ji.value="updated"}catch(p){console.error("Failed to refresh token, forcing new login.",p),Ji.value="error",localStorage.clear(),window.location.reload()}ve.value=!1}const g=async()=>{try{await Gt.initialize(),localStorage.clear(),await Gt.logoutRedirect({postLogoutRedirectUri:"/"})}catch(p){console.error("Logout error",p)}};l.watch(LT,async p=>{p<=0&&Ji.value==="updated"&&await m()});const v=l.computed(()=>e.value);return Jc={isAuthenticated:t,authState:Ji,account:r,token:v,refreshToken:m,handleRedirect:a,logout:g},Jc}const{jToken:gy}=DT(),Rm=()=>{const n=dt.create({headers:{"Content-Type":"application/json"}});l.watch(gy,o=>{n.interceptors.request.use(a=>(o&&(a.headers.Authorization=`Bearer ${o}`),a))},{immediate:!0});let e=1;n.interceptors.response.use(async o=>o,async o=>{var a;if(o.config&&o.config.headers){const c=o.config;if(((a=o.response)==null?void 0:a.status)===401&&e>0){e--;try{return c.headers.Authorization=`Bearer ${gy.value}`,await n(c)}catch(d){return Promise.reject(d)}}}return Promise.reject(o)});async function t({url:o,method:a,header:c={},body:d,baseURL:h}){try{return h&&(n.defaults.baseURL=h),(await n({url:o,method:a,headers:c,data:d})).data}catch(m){if(console.error(`Request error [${a} ${o}]:`,m),dt.isAxiosError(m)){const{response:g,message:v}=m;throw new Error(`Axios error: ${v}, Status: ${g==null?void 0:g.status}, URL: ${o}`)}throw m}}async function r({url:o,method:a,header:c,body:d,baseURL:h}){try{h&&(n.defaults.baseURL=h);const m=await n({url:o,method:a,headers:c,data:d});return{status:m.status,header:m.headers,body:m.data}}catch(m){if(dt.isAxiosError(m)){const{response:g,message:v}=m;console.error(`Raw Request Error: ${v}, Status: ${g==null?void 0:g.status}`)}return Promise.reject(m)}}return Object.assign(n,{_request:t,rawRequest:r})},{request:py}=Rm(),_y=l.ref(null),vy=l.ref("default"),uh=l.ref(null),dh=l.ref({scope_type:"org"});function vu(){var v,p;const{handleRedirect:n,account:e,logout:t}=Nm();(p=(v=e.value)==null?void 0:v.idTokenClaims)==null||p.domain;const r=l.computed(()=>{var w,C;return{domain:(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.domain,environment:vy.value,...dh.value}}),o=l.computed(()=>dh.value);async function a(){var w;(!e.value||!((w=e.value.idTokenClaims)!=null&&w.email))&&await n();try{await c(),await d()}catch{}}async function c(){var w,C;try{const T=(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.email;if(!T)throw new Error("Email is undefined");const k=await py({url:`https://api.jplan.com.br/platform/user/profile/?email=${T}`,method:"GET"});uh.value=k.data??null}catch(T){console.error("Failed to fetch user profile:",T)}}async function d(){var w;try{if(!((w=uh.value)!=null&&w.email))throw new Error("User email is undefined");const C=await py({url:"https://api.jplan.com.br/platform/user/domain/",method:"GET"});_y.value=C.data.data??[]}catch(C){console.error("Failed to fetch user domains:",C)}}function h(w){dh.value=w}function m(w){vy.value=w,h(r.value)}async function g(w,C){const T=MT(w,{request_domain:C});await Gt.loginRedirect(T)}return{__init__:a,user:uh,userDomains:_y,setEnv:m,setScope:h,changeDomain:g,session:r,scope:o,logout:t}}const f$={path:"/_/dashboard",component:()=>Promise.resolve().then(()=>require("./AuthRoute-ByYfzH9U.js")),meta:{requiresAuth:!1}},m$={path:"/jplan-auth-fail",component:()=>Promise.resolve().then(()=>require("./AuthFailRoute-DHl-IhUQ.js")),meta:{requiresAuth:!1}},{isAuthenticated:yy,handleRedirect:g$}=Nm(),p$=vu();function _$(n,e){n.addRoute(f$),n.addRoute(m$),n.beforeEach(async(t,r,o)=>{function a(d){return d.matched.some(h=>h.meta.requiresAuth)}if(!a(t))return o();if(!yy.value){ve.value=!0;try{await g$(e,t.fullPath),await p$.__init__()}catch(d){console.error("Fail to authenticate",d),await n.push("/jplan-auth-fail")}ve.value=!1}if(yy.value){if(localStorage.getItem("returnRoute")&&localStorage.getItem("returnRoute")!==null){const d=localStorage.getItem("returnRoute")??"/";console.log("trying to go to saved route:",d),o(d),localStorage.removeItem("returnRoute");return}o()}})}const{scope:Cy}=vu();function v$(){const n=Rm(),e=l.ref({scope_type:"org"});async function t(r){e.value=r}return l.watch(Cy,()=>{n.interceptors.request.use(r=>{const o=r.headers,a=o.Authorization;a&&(o.Authorization=a);const c=Cy.value;return c&&(c.scope_type&&(o["j-scope-type"]=c.scope_type,c.organization&&(o["j-scope-organization"]=c.organization),c.team&&(o["j-scope-team"]=c.team)),c.environment&&(o["j-scope-environment"]=c.environment)),r})},{immediate:!0}),Object.assign(n,{setScope:t,scope:e})}function Da(n){const e=v$();e.defaults.baseURL=n;const t=l.ref({scope_type:"org"});async function r(o){t.value=o}return l.watch(t,()=>{e.interceptors.request.use(o=>{const a=t.value;return delete o.headers["j-scope-type"],delete o.headers["j-scope-organization"],delete o.headers["j-scope-team"],a!=null&&a.scope_type&&(o.headers["j-scope-type"]=a.scope_type),a!=null&&a.organization&&(o.headers["j-scope-organization"]=a.organization),a!=null&&a.team&&(o.headers["j-scope-team"]=a.team),o})},{immediate:!0}),Object.assign(e,{setScope:r,scope:t})}const Ey={enUS:{widget:"widget",spacer:"spacer"},ptBr:{widget:"widget",spacer:"Espaçador"}},Om={"pt-BR":{placeholders:{selectFilter:"Selecionar filtro",visualize:"Visualizar",actions:"Ações",search:"Pesquisar"},dialogs:{columnSettings:{title:"Configurações de coluna"},scope:{title:"Escopo",unknown:"Desconhecido",domain:"Domínio",environment:"Ambiente",organizational:"Organizacional",organization:"Organização",team:"Time",user:"Usuário",none:"Nenhum",selectOrganization:"Selecione uma Organização",selectTeam:"Selecione um Time"}},actions:{save:"Salvar",cancel:"Cancelar",edit:"Editar",delete:"Apagar",disable:"Desabilitar",confirm:"Confirmar",back:"Voltar"},forms:{metadata:{created:"Criado",updated:"Atualizado",modified:"Modificado",delegated:"Delegado"}},$vuetify:{dataFooter:{itemsPerPageAll:"Todos",itemsPerPageText:"Itens por página:",pageText:"{0}-{1} de {2}"}},toast:{error:{create_failed:"Falha ao criar {entity}",update_failed:"Falha ao atualizar {entity}",delete_failed:"Falha ao apagar {entity}",fetch_failed:"Falha ao buscar {entity}",activate_failed:"Falha ao ativar {entity}",deactivate_failed:"Falha ao desativar {entity}",link_failed:"Falha ao vincular {entity}",unlink_failed:"Falha ao desvincular {entity}"},success:{create_success:"{entity} criado com sucesso",update_success:"{entity} atualizado com sucesso",delete_success:"{entity} apagado com sucesso",activate_success:"{entity} ativado com sucesso",deactivate_success:"{entity} desativado com sucesso",link_success:"{entity} vinculado com sucesso",unlink_success:"{entity} desvinculado com sucesso"},info:{already_linked:"{entity} já está vinculado",select_valid_item:"Selecione um item válido"}},app:{widget:Ey.ptBr}},"en-US":{placeholders:{selectFilter:"Select a filter",visualize:"Visualize",actions:"Actions",search:"Search"},dialogs:{columnSettings:{title:"Column Settings"},scope:{title:"Scope",unknown:"Unknown",domain:"Domain",environment:"Environment",organizational:"Organizational",organization:"Organization",team:"Team",user:"User",none:"None",selectOrganization:"Select a organization",selectTeam:"Select a Team"}},actions:{save:"Save",cancel:"Cancel",edit:"Edit",delete:"Delete",disable:"Disable",back:"Back",confirm:"Confirm"},forms:{metadata:{created:"Created",updated:"Updated",modified:"Modified",delegated:"Delegated"}},$vuetify:{dataFooter:{itemsPerPageAll:"All",itemsPerPageText:"Items per page:",pageText:"{0}-{1} of {2}"}},toast:{error:{create_failed:"Failed to create {entity}",update_failed:"Failed to update {entity}",delete_failed:"Failed to delete {entity}",fetch_failed:"Failed to fetch {entity}",activate_failed:"Failed to activate {entity}",deactivate_failed:"Failed to deactivate {entity}",link_failed:"Failed to link {entity}",unlink_failed:"Failed to unlink {entity}"},success:{create_success:"{entity} created successfully",update_success:"{entity} updated successfully",delete_success:"{entity} deleted successfully",activate_success:"{entity} activated successfully",deactivate_success:"{entity} deactivated successfully",link_success:"{entity} linked successfully",unlink_success:"{entity} unlinked successfully"},info:{already_linked:"{entity} is already linked",select_valid_item:"Please select a valid item"}},app:{widget:Ey.ptBr}}},y$=Object.keys(Om),wy=navigator.language,C$=y$.includes(wy)?wy:"pt-BR",$=yx({locale:C$,fallbackLocale:"en-US",messages:Om});function E$(){const n=Da("https://api.jplan.com.br/management/organization"),{error:e}=wr();return{async getOrgList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Organization"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getOrgList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Organization"}));return}},async createOrg(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Organization"})),a}},async updateOrg(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"Organization"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Organization"})),a}},async getOrg(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Organization"})),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Organization"})),a}},async activateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Organization"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Organization"})),a}},async deactivateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Organization"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Organization"})),a}}}}const xo=E$();function w$(){const n=Da("https://api.jplan.com.br/management/branch/"),{error:e}=wr();return{async getBranchList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error){e($.global.t("toast.error.fetch_failed",{entity:"Branch"}));return}return o.data.data}catch(r){console.error("Error in getBranchList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Branch"}))}},async createBranch(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){console.error("Error in createBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Branch"}))}},async updateBranch(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error){e(a.data.error||$.global.t("toast.error.update_failed",{entity:"Branch"}));return}return a}catch(a){console.error("Error in updateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Branch"}))}},async getBranch(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error){e(a.data.error||$.global.t("toast.error.fetch_failed",{entity:"Branch"}));return}return a.data}catch(a){console.error("Error in getBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Branch"}))}},async activateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error){e(a.data.error||$.global.t("toast.error.activate_failed",{entity:"Branch"}));return}}catch(a){console.error("Error in activateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Branch"}))}},async deactivateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error){e(a.data.error||$.global.t("toast.error.deactivate_failed",{entity:"Branch"}));return}}catch(a){console.error("Error in deactivateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Branch"}))}}}}const Uo=w$();function T$(){const n=Da("https://api.jplan.com.br/management/team"),{error:e}=wr();return{async getTeamList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Team"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getTeamList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Team"}));return}},async createTeam(t){var r,o;try{const a=await n.post("/item",t);if(a.data.error)throw e($.global.t("toast.error.create_failed",{entity:"Team"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in createTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Team"})),a}},async updateTeam(t){var r,o;try{const a=await n.patch("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in updateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Team"})),a}},async getTeam(t){var r,o;try{const a=await n.get(`/item/${t}`);return a.data.error&&e($.global.t("toast.error.fetch_failed",{entity:"Team"})),a.data}catch(a){console.error("Error in getTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Team"}));return}},async activateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Team"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Team"})),a}},async deactivateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Team"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Team"})),a}},async getTeamUserList(t,r){try{const o=r?`?filter_query=${r}`:"",a=await n.get(`/item/${t}/user/list/${o}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(a.data.error);return a.data.data}catch(o){console.error("Error in getTeamUserList:",o),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async linkManageUser(t,r){try{const o=await n.post(`/item/${t}/user/item/`,r);if(o.data.error)throw e($.global.t("toast.error.link_failed",{entity:"User"})),new Error(o.data.error);return o.data}catch(o){console.error("Error in link User:",o),e($.global.t("toast.error.link_failed",{entity:"User"}));return}},async updateManageUser(t,r){try{const o=await n.patch(`/item/${t}/user/item/`,r);if(o.data.error)throw e($.global.t("toast.error.update_failed",{entity:"User"})),new Error(o.data.error);return o.data.data}catch(o){throw console.error("Error in update User:",o),e($.global.t("toast.error.update_failed",{entity:"User"})),o}},async getManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"",c=await n.get(`/item/${t}/user/item/${r}/${a}`);if(c.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(c.data.error);return c.data.data}catch(a){console.error("Error in getUser:",a),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async unlinkManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"";await n.delete(`/item/${t}/user/item/${r}/${a}`)}catch(a){throw console.error("Error in unlink User:",a),e($.global.t("toast.error.unlink_failed",{entity:"User"})),a}}}}const Mn=T$();let Qc=!1;const hh=l.ref(!1),jn=l.ref([]),Ty=l.ref([]),ft=l.ref(null),Qi=l.ref([]),Xi=l.ref([]),xT=()=>{const n=wr(),e=async C=>{hh.value=!0;const T=C?`_active eq true and ${C}`:"_active eq true",k=await xo.getOrgList(T);k&&(jn.value=k,Qc=!0),hh.value=!1},t=async C=>{var T;return(T=jn.value)!=null&&T.length||await e(C),jn.value};function r(C){if(!jn.value)throw new Error("Data not stored yet");const T=Oa(jn.value,C,["name","description"]);return C!==""?T:jn.value}const o=C=>{Ty.value=C},a=C=>{ft.value=Ra.cloneDeep(C)},c=async C=>await xo.getOrg(C),d=async()=>{if(ft.value!=null){const C=await xo.createOrg(ft.value);return C!=null&&C.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Organization"})),Qc&&jn.value.push(C.data)),C==null?void 0:C.data}},h=async()=>{if(ve.value=!0,ft.value&&ft.value.__id){const C=await xo.updateOrg(ft.value);if(Qc&&(C!=null&&C.data.__id)){const T=jn.value.findIndex(k=>k.__id===C.data.__id);return T!==-1?(jn.value[T]=C.data,n.success($.global.t("toast.success.update_success",{entity:"Organization"}))):n.error($.global.t("toast.error.update_failed",{entity:"Organization"})),ve.value=!1,C.data}}else ve.value=!1,n.error($.global.t("toast.error.update_failed",{entity:"Organization"}))},m=async()=>{if(ve.value=!0,ft.value&&ft.value.created_at){if(await xo.deactivateOrg(ft.value.__id),Qc){const C=jn.value.findIndex(T=>{var k;return T.__id===((k=ft.value)==null?void 0:k.__id)});if(C!==-1)return jn.value.splice(C,1),ft.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Organization"}))}ve.value=!1}};async function g(C){ve.value=!0;try{if(ft.value&&ft.value.__id){const T={...C,organization:ft.value.__id};if(!await Uo.updateBranch(T)){ve.value=!1;return}if(Qi.value.findIndex(N=>N.__id===C.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Branch"})),Qi.value.push(T),T;n.info($.global.t("toast.info.already_linked",{entity:"Branch"}))}}catch(T){console.error(T)}finally{ve.value=!1}}async function v(C){if(ve.value=!0,ft.value&&ft.value.__id){const T={...C,organization:null};if(!await Uo.updateBranch(T)){ve.value=!1;return}const I=Qi.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Qi.value.splice(I,1),ve.value=!1,Qi.value;throw new Error("Item not found to remove")}ve.value=!1}async function p(C){ve.value=!0;try{if(ft.value&&ft.value.__id){const T={...C,organization:ft.value.__id};if(!await Mn.updateTeam(T)){ve.value=!1;return}if(Xi.value.findIndex(N=>N.__id===C.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Team"})),Xi.value.push(T),T;n.info($.global.t("toast.info.already_linked",{entity:"Team"}))}}catch(T){console.error(T)}finally{ve.value=!1}}async function w(C){if(ve.value=!0,ft.value&&ft.value.__id){const T={...C,organization:null};if(!await Mn.updateTeam(T)){ve.value=!1;return}const I=Xi.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Xi.value.splice(I,1),ve.value=!1,Xi.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:jn,loading:hh,columns:Ty,item:ft,filterData:r,__init__:e,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgBranches:Qi,orgTeams:Xi,linkBranch:g,unlinkBranch:v,linkTeam:p,unlinkTeam:w}};let Xc=!1;const Yn=l.ref([]),by=l.ref([]),Nt=l.ref(null),fh=l.ref(!1),Zi=l.ref([]),UT=()=>{const n=wr(),e=async p=>{fh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await Mn.getTeamList(w);C&&(Yn.value=C,Xc=!0),fh.value=!1},t=async p=>(Yn.value.length||await e(p),Yn.value);function r(p){if(!Yn.value)throw new Error("Data not stored yet");const w=Oa(Yn.value,p,["name","description"]);return p!==""?w:Yn.value}const o=p=>{by.value=p},a=p=>{Nt.value=Ra.cloneDeep(p)},c=async p=>await Mn.getTeam(p),d=async()=>{if(Nt.value!=null){const p=await Mn.createTeam(Nt.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Team"})),Xc&&Yn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(ve.value=!0,Nt.value&&Nt.value.__id){const p=await Mn.updateTeam(Nt.value);if(Xc&&(p!=null&&p.data.__id)){const w=Yn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Yn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Team"}))):n.error($.global.t("toast.error.update_failed",{entity:"Team"})),p.data}}else n.error($.global.t("toast.error.update_failed",{entity:"Team"}))},m=async()=>{if(Nt.value&&Nt.value.created_at&&(await Mn.deactivateTeam(Nt.value.__id),Xc)){const p=Yn.value.findIndex(w=>{var C;return w.__id===((C=Nt.value)==null?void 0:C.__id)});if(p!==-1)return Yn.value.splice(p,1),Nt.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Team"}))}};async function g(p){var w;if(ve.value=!0,(w=Nt.value)!=null&&w.__id)if(Zi.value.findIndex(T=>T.__id===p.__id)===-1)try{const T=await Mn.linkManageUser(Nt.value.__id,{team:Nt.value.__id,user:p.__id,role:"string",joined_at:"string",comments:"string"}),k=await Mn.getTeamUserList(Nt.value.__id);return k&&(Zi.value=k),n.success($.global.t("toast.success.link_success",{entity:"User"})),T}catch(T){console.error(T),n.error($.global.t("toast.error.link_failed",{entity:"User"}))}finally{ve.value=!1}else n.info($.global.t("toast.info.already_linked",{entity:"User"}));else console.warn("No item selected or item ID is missing."),n.info($.global.t("toast.info.select_valid_item"));ve.value=!1}async function v(p){if(ve.value=!0,Nt.value&&Nt.value.__id){const w=Zi.value.findIndex(C=>C.__id===p);if(w!==-1)return await Mn.unlinkManageUser(Nt.value.__id,p),Zi.value.splice(w,1),ve.value=!1,Zi.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:Yn,loading:fh,columns:by,item:Nt,usersTeam:Zi,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,linkUser:g,unlinkUser:v}},BT=l.defineComponent({__name:"GlobalScopeFilter",setup(n){var T,k,I;const{openDialog:e}=Ms("global-scope__J-"),{user:t,scope:r,session:o,setScope:a}=vu(),{getData:c,data:d}=xT(),{getData:h,data:m}=UT(),g=l.ref(!1);l.onBeforeMount(async()=>{g.value=!0,await c(),await h(),g.value=!1});const v=l.ref({scope_type:(T=r.value)==null?void 0:T.scope_type,organization:((k=r.value)==null?void 0:k.organization)??"org",team:(I=r.value)==null?void 0:I.team});function p(){var N,D,L;v.value={...r.value,scope_type:(N=r.value)==null?void 0:N.scope_type,organization:((D=r.value)==null?void 0:D.organization)??"",team:(L=r.value)==null?void 0:L.team},e()}const w=l.computed(()=>{var N;switch((N=r.value)==null?void 0:N.scope_type){case"user":return BF;case"org":return xF;case"team":return FF;default:return UF}});async function C(){var N;((N=r.value)==null?void 0:N.scope_type)!==""&&a(v.value)}return(N,D)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(it.VBtn,{onClick:p,icon:"",class:"text-secondary",color:"surface",rounded:"sm",size:"small",variant:"flat"},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(w.value),{size:"20"}))]),_:1}),l.createVNode(l.unref(Ls),{loading:g.value,title:l.unref($).global.t("dialogs.scope.title"),"dd-id":"global-scope__J-",onOnSave:C},{default:l.withCtx(()=>[l.createElementVNode("div",null,[l.createVNode(Qe.VRow,null,{default:l.withCtx(()=>[l.createVNode(Qe.VCol,{cols:"4",class:"d-flex flex-row align-center"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.user")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>{var L;return[l.createTextVNode(l.toDisplayString(((L=l.unref(t))==null?void 0:L.name)||l.unref($).global.t("dialogs.scope.unknownUser")),1)]}),_:1})]),_:1})]),_:1}),l.createVNode(Qe.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.environment")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).domain),1)]),_:1})]),_:1})]),_:1}),l.createVNode(Qe.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.environment")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).environment),1)]),_:1})]),_:1})]),_:1})]),_:1}),l.createVNode(IO.VBtnToggle,{density:"compact",variant:"outlined",modelValue:v.value.scope_type,"onUpdate:modelValue":D[0]||(D[0]=L=>v.value.scope_type=L),class:"d-flex justify-center my-4"},{default:l.withCtx(()=>[l.createVNode(it.VBtn,{value:"org",label:l.unref($).global.t("dialogs.scope.organizational"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.organizational")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"team",label:l.unref($).global.t("dialogs.scope.team"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.team")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"user",label:l.unref($).global.t("dialogs.scope.user"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.user")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"",label:l.unref($).global.t("dialogs.scope.none"),color:"lightext"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.none")),1)]),_:1},8,["label"])]),_:1},8,["modelValue"]),l.createElementVNode("div",null,[l.createVNode(ys.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.organization")),1)]),_:1}),l.createVNode(ls.VSelect,{items:l.unref(d),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:l.unref($).global.t("dialogs.scope.selectOrganization"),class:"min-w-50",modelValue:v.value.organization,"onUpdate:modelValue":D[1]||(D[1]=L=>v.value.organization=L),clearable:""},null,8,["items","placeholder","modelValue"]),l.createVNode(ys.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.team")),1)]),_:1}),l.createVNode(ls.VSelect,{items:l.unref(m),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:l.unref($).global.t("dialogs.scope.selectTeam"),class:"min-w-50",modelValue:v.value.team,"onUpdate:modelValue":D[2]||(D[2]=L=>v.value.team=L),clearable:""},null,8,["items","placeholder","modelValue"])])])]),_:1},8,["loading","title"])],64))}}),b$={},I$={class:"double-ring-spinner-container"};function S$(n,e){return l.openBlock(),l.createElementBlock("div",I$,e[0]||(e[0]=[l.createElementVNode("div",{class:"spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])],-1)]))}const FT=Sa(b$,[["render",S$],["__scopeId","data-v-00d7a69f"]]),A$={key:0,class:"_jspinner-overlay_jj"},VT=l.defineComponent({__name:"GlobalSpinner",setup(n){return(e,t)=>l.unref(ve)?(l.openBlock(),l.createElementBlock("div",A$,t[0]||(t[0]=[l.createElementVNode("div",{class:"j-double-ring-spinner-container"},[l.createElementVNode("div",{class:"j-global-spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])])],-1)]))):l.createCommentVNode("",!0)}}),HT=l.defineComponent({__name:"SubMenu",props:{title:{}},setup(n,{expose:e}){return e({props:n}),(r,o)=>(l.openBlock(),l.createBlock(Qt.VListItem,{onClick:o[0]||(o[0]=()=>{}),density:"compact"},{append:l.withCtx(()=>[l.createVNode(l.unref(VF))]),default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(r.title),1)]),_:1}),l.createVNode(gf.VMenu,{activator:"parent","open-on-hover":"",submenu:"",density:"compact"},{default:l.withCtx(()=>[l.renderSlot(r.$slots,"default")]),_:3})]),_:3}))}}),k$=Object.freeze(Object.defineProperty({__proto__:null,AvatarPicture:fC,ColumnSettingsDialog:Uf,ConfirmDialog:dC,ContextMenu:mC,CopyButton:Bl,DeleteAllBtn:Cf,DotsMenu:uC,EditButton:lC,FormHeadless:GE,FormMetadata:ou,GlobalScopeFilter:BT,GlobalSpinner:VT,JAvatar:hC,JBtn:Oy,JDialog:Ls,JForm:WE,JIconBtn:Ry,JSelect:VE,JTextArea:HE,JTextField:gE,ParentCard:Kl,SearchFilter:Jl,SpinnerLoader:FT,SubMenu:HT,TabFormHeader:zE,TableAdvanced:XC,TableCard:Bf,TableCardsView:fE,TableHeader:ZC,UiTable:gC},Symbol.toStringTag,{value:"Module"})),N$=e0(),R$={transition:"Vue-Toastification__fade",maxToasts:20,newestOnTop:!0};let mh=!1;const gh=l.ref(!1),Jn=l.ref([]),Iy=l.ref([]),$t=l.ref(null),ea=l.ref([]),O$=()=>{const n=wr(),e=async p=>{gh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await Uo.getBranchList(w);C&&(Jn.value=C,mh=!0),gh.value=!1},t=async p=>(Jn.value.length||await e(p),Jn.value);function r(p){if(!Jn.value)throw new Error("Data not stored yet");const w=Oa(Jn.value,p,["name","description"]);return p!==""?w:Jn.value}const o=p=>{Iy.value=p},a=p=>{$t.value=Ra.cloneDeep(p)},c=async p=>await Uo.getBranch(p),d=async()=>{if($t.value!=null){const p=await Uo.createBranch($t.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Branch"})),mh&&Jn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if($t.value&&$t.value.__id){const p=await Uo.updateBranch($t.value);if(mh&&p){const w=Jn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Jn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Branch"}))):n.error($.global.t("toast.error.update_failed",{entity:"Branch"})),p}}else n.error($.global.t("toast.error.update_failed",{entity:"Branch"}))},m=async()=>{if($t.value&&$t.value.created_at){await Uo.deactivateBranch($t.value.__id);const p=Jn.value.findIndex(w=>{var C;return w.__id===((C=$t.value)==null?void 0:C.__id)});if(p!==-1)return Jn.value.splice(p,1),$t.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Branch"}))}};async function g(p){ve.value=!0;try{if($t.value&&$t.value.__id){const w={...p,branch:$t.value.__id};if(!await Mn.updateTeam(w)){n.error($.global.t("toast.error.link_failed",{entity:"Team"}));return}if(ea.value.findIndex(k=>k.__id===p.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Team"})),ea.value.push(w),w;n.info($.global.t("toast.info.already_linked",{entity:"Team"}))}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{ve.value=!1}}async function v(p){if(ve.value=!0,$t.value&&$t.value.__id){const w={...p,branch:null};if(!await Mn.updateTeam(w))return;const T=ea.value.findIndex(k=>k.__id===p.__id);if(T!==-1)return ea.value.splice(T,1),ve.value=!1,ea.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:Jn,columns:Iy,item:$t,loading:gh,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,branchTeams:ea,linkTeam:g,unlinkTeam:v}};function P$(){const n=Da("https://api.jplan.com.br/management/division"),{error:e}=wr();return{async getDivisionList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Division"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getDivisionList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Division"}));return}},async createDivision(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Division"})),a}},async updateDivision(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"Division"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Division"})),a}},async getDivision(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Division"})),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Division"})),a}},async activateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Division"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Division"})),a}},async deactivateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Division"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Division"})),a}}}}const ca=P$();let ph=!1;const _h=l.ref(!1),Qn=l.ref([]),Sy=l.ref([]),Kt=l.ref(null),ta=l.ref([]),M$=()=>{const n=wr(),e=async p=>{_h.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await ca.getDivisionList(w);C&&(Qn.value=C,ph=!0),_h.value=!1},t=async p=>(Qn.value.length||await e(p),Qn.value);function r(p){if(!Qn.value)throw new Error("Data not stored yet");const w=Oa(Qn.value,p,["name","description"]);return p!==""?w:Qn.value}const o=p=>{Sy.value=p},a=p=>{Kt.value=Ra.cloneDeep(p)},c=async p=>await ca.getDivision(p),d=async()=>{if(Kt.value!=null){const p=await ca.createDivision(Kt.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Division"})),ph&&Qn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(ve.value=!0,Kt.value&&Kt.value.__id){const p=await ca.updateDivision(Kt.value);if(ph&&(p!=null&&p.data.__id)){const w=Qn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Qn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Division"}))):n.error($.global.t("toast.error.update_failed",{entity:"Division"})),ve.value=!1,p}}else ve.value=!1,n.error($.global.t("toast.error.update_failed",{entity:"Division"}))},m=async()=>{if(ve.value=!0,Kt.value&&Kt.value.created_at){await ca.deactivateDivision(Kt.value.__id);const p=Qn.value.findIndex(w=>{var C;return w.__id===((C=Kt.value)==null?void 0:C.__id)});if(p!==-1)return Qn.value.splice(p,1),Kt.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Division"}))}ve.value=!1};async function g(p){ve.value=!0;try{if(Kt.value&&Kt.value.__id){const w={...p,division:Kt.value.__id};return await xo.updateOrg(w)?(ta.value.findIndex(k=>k.__id===p.__id)===-1?(n.success($.global.t("toast.success.link_success",{entity:"Organization"})),ta.value.push(w)):n.info($.global.t("toast.info.already_linked",{entity:"Organization"})),w):void 0}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{ve.value=!1}}async function v(p){if(ve.value=!0,Kt.value&&Kt.value.__id){const w={...p,division:null};if(!await xo.updateOrg(w))return;const T=ta.value.findIndex(k=>k.__id===p.__id);if(T!==-1)ta.value.splice(T,1);else throw new Error("Item not found to remove")}else throw new Error("Item is not defined");return ve.value=!1,ta.value}return{data:Qn,columns:Sy,item:Kt,loading:_h,__init__:e,filterData:r,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgs:ta,linkDivision:g,unlinkDivision:v}};function D$(){const n=Da("https://api.jplan.com.br/management/user"),{error:e}=wr();return{async getManageUserList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getManageUserList:",r),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async createManageUser(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"User"})),a}},async updateManageUser(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"User"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"User"})),a}},async getManageUser(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(a.data.error);return a.data}catch(a){console.error("Error in getManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async activateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"User"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"User"})),a}},async deactivateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"User"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"User"})),a}}}}const la=D$();let vh=!1,yh=l.ref(!1);const Xn=l.ref([]),Ay=l.ref([]),Zn=l.ref(null),L$=l.ref(null),x$=l.ref([]),U$=()=>{const n=wr(),e=async g=>{yh.value=!0;const v=g?`_active eq true and ${g}`:"_active eq true",p=await la.getManageUserList(v);p&&(Xn.value=p,vh=!0),yh.value=!1},t=async g=>(Xn.value.length||await e(g),Xn.value);function r(g){if(!Xn.value)throw new Error("Data not stored yet");const v=Oa(Xn.value,g,["name","description"]);return g!==""?v:Xn.value}return{data:Xn,loading:yh,columns:Ay,item:Zn,filterData:r,__init__:e,getData:t,setColumns:g=>{Ay.value=g},setItem:g=>{Zn.value=Ra.cloneDeep(g)},getItem:async g=>await la.getManageUser(g),createItem:async()=>{if(Zn.value!=null){const g=crypto.randomUUID(),v=await la.createManageUser({...Zn.value,__id:g});return v!=null&&v.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"User"})),vh&&Xn.value.push(v.data)),v==null?void 0:v.data}},updateItem:async()=>{if(ve.value=!0,Zn.value&&Zn.value.created_at){const g=await la.updateManageUser(Zn.value);if(vh&&(g!=null&&g.data)){const v=Xn.value.findIndex(p=>p.__id===(g==null?void 0:g.data.__id));v!==-1?(Xn.value[v]=g==null?void 0:g.data,n.success($.global.t("toast.success.update_success",{entity:"User"}))):n.error($.global.t("toast.error.update_failed",{entity:"User"}))}return ve.value=!1,g==null?void 0:g.data}},removeItem:async()=>{if(Zn.value&&Zn.value.created_at){try{await la.deactivateManageUser(Zn.value.__id)}catch{n.error($.global.t("toast.error.deactivate_failed",{entity:"User"}));return}const g=Xn.value.findIndex(v=>{var p;return v.__id===((p=Zn.value)==null?void 0:p.__id)});if(g!==-1)return Xn.value.splice(g,1),n.success($.global.t("toast.success.deactivate_success",{entity:"User"})),Zn.value}},userOrg:L$,userTeams:x$}},Ch=Object.freeze({colNum:24,rowHeight:50,useCssTransforms:!0,responsive:!0,margin:[12,10]}),na=l.ref(!1),B$=l.ref([]);function F$(){const n=l.ref({...Ch,isResizable:!1,isDraggable:!1,useStyleCursor:!1,cursor:"default"});function e(){if(na.value=!na.value,n.value.isDraggable=na.value,n.value.isResizable=na.value,!na.value){n.value.useStyleCursor=!0,n.value.cursor="pointer";return}n.value.useStyleCursor=!1,n.value.cursor="move"}function t(){n.value={...Ch,isResizable:!1,isDraggable:!1,useStyleCursor:!1,cursor:"default"}}return{DEFAULT_CONFIG:Ch,config:n,layout:B$,edition:na,toggleEdit:e,resetLayout:t}}const V$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetTask-CWeGsUSO.js"))),H$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetImage-DhplL-E6.js"))),$$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetShortcut-B60P9a2F.js"))),K$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetSpacer-B_G25sJd.js"))),W$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetLabel-C1X4Ec6N.js"))),z$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetChartBar-ChMg_dbz.js"))),G$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetChartPie-C2AIgVQ2.js"))),q$={WidgetSpacer:K$,WidgetLabel:W$,WidgetTask:V$,WidgetImage:H$,WidgetShortcut:$$,WidgetChartBar:z$,WidgetChartPie:G$},j$={defaultI18n:!0},Y$=(n,e)=>{const t={...j$,...e};n.use(N$),n.use(nP,R$),t.defaultI18n&&n.use($),Object.entries(k$).forEach(([r,o])=>{n.component(r,o)}),Object.entries(AO).forEach(([r,o])=>{n.provide(r,o)})},J$={install:Y$};exports.ContextMenu=mC;exports.EmptyListImg=Lh;exports.EventBus=Hl;exports.FormHeadless=GE;exports.HttpCore=cF;exports.I18nMessages=Om;exports.SpinnerLoader=FT;exports.TableCardsView=fE;exports.TableHeader=ZC;exports.__spinner=ve;exports._export_sfc=Sa;exports._sfc_main=Ls;exports._sfc_main$1=gC;exports._sfc_main$10=Oy;exports._sfc_main$11=Cf;exports._sfc_main$12=lC;exports._sfc_main$13=Ry;exports._sfc_main$14=VE;exports._sfc_main$15=HE;exports._sfc_main$16=gE;exports._sfc_main$17=WE;exports._sfc_main$18=zE;exports._sfc_main$19=Kl;exports._sfc_main$2=XC;exports._sfc_main$20=hC;exports._sfc_main$21=fC;exports._sfc_main$22=HT;exports._sfc_main$23=BT;exports._sfc_main$24=VT;exports._sfc_main$3=Uf;exports._sfc_main$4=Bf;exports._sfc_main$5=Jl;exports._sfc_main$6=dC;exports._sfc_main$7=Bl;exports._sfc_main$8=uC;exports._sfc_main$9=ou;exports.branchInstance=Uo;exports.coreClient=Rm;exports.createToastInterface=ws;exports.dateFormat=us;exports.divisionInstance=ca;exports.filterQuery=Oa;exports.globalEventBus=yf;exports.i18n=$;exports.index=J$;exports.manageUserInstance=la;exports.msal=Gt;exports.orgInstance=xo;exports.provideToast=tP;exports.scopedClient=Da;exports.setupAuthGuard=_$;exports.teamInstance=Mn;exports.toastInjectionKey=$l;exports.useAuth=Nm;exports.useBranchStore=O$;exports.useCustomizer=i0;exports.useDashboardStore=F$;exports.useDialog=Ms;exports.useDivisionStore=M$;exports.useManageUserStore=U$;exports.useOrganizationStore=xT;exports.useSession=vu;exports.useTeamStore=UT;exports.useToast=wr;exports.widgets=q$;