@sabrenski/spire-ui 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(E,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(E=typeof globalThis<"u"?globalThis:E||self,i(E.SpireUI={},E.Vue))})(this,(function(E,i){"use strict";var _0=Object.defineProperty;var y0=(E,i,Et)=>i in E?_0(E,i,{enumerable:!0,configurable:!0,writable:!0,value:Et}):E[i]=Et;var W=(E,i,Et)=>y0(E,typeof i!="symbol"?i+"":i,Et);var Ro;const Et=Symbol("accordion"),Mi=Symbol("accordion-item"),ql=i.defineComponent({__name:"AccordionRoot",props:{modelValue:{},collapsible:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},variant:{default:"contained"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(n.modelValue);i.watch(()=>n.modelValue,c=>{a.value=c});const s=i.computed(()=>n.modelValue!==void 0),l=i.computed(()=>{const c=s.value?n.modelValue:a.value;return c===void 0?new Set:Array.isArray(c)?new Set(c):new Set([c])});function r(c){const d=l.value.has(c);let u;if(d){if(!n.collapsible&&l.value.size===1)return;if(n.multiple){const h=new Set(l.value);h.delete(c),u=Array.from(h)}else u=void 0}else if(n.multiple){const h=new Set(l.value);h.add(c),u=Array.from(h)}else u=c;a.value=u,o("update:modelValue",u)}return i.provide(Et,{openItems:l,toggle:r,collapsible:i.toRef(n,"collapsible"),multiple:i.toRef(n,"multiple"),variant:i.toRef(n,"variant")}),(c,d)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-accordion",[`ui-accordion--${t.variant}`]])},[i.renderSlot(c.$slots,"default",{},void 0,!0)],2))}}),O=(t,e)=>{const n=t.__vccOpts||t;for(const[o,a]of e)n[o]=a;return n},Gl=O(ql,[["__scopeId","data-v-93a5c4e6"]]);function Jl(t,e){const n=o=>{const a=o.target;!t.value||t.value.contains(a)||e()};i.onMounted(()=>{document.addEventListener("mousedown",n),document.addEventListener("touchstart",n)}),i.onUnmounted(()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)})}function Zl(t=2e3){const e=i.ref(!1);let n=null;return{copy:async a=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard API not supported"),!1;try{return await navigator.clipboard.writeText(a),e.value=!0,n&&clearTimeout(n),n=setTimeout(()=>{e.value=!1},t),!0}catch(s){return console.error("Failed to copy:",s),e.value=!1,!1}},copied:e}}function Ql(t,e,n,o){const a=l=>{l==null||l.addEventListener(e,n,o)},s=l=>{l==null||l.removeEventListener(e,n,o)};i.isRef(t)?i.watch(t,(l,r)=>{r&&s(r),l&&a(l)},{immediate:!0}):i.onMounted(()=>a(t)),i.onUnmounted(()=>s(i.unref(t)))}const Oo=["a[href]","button:not([disabled])","input:not([disabled])","textarea:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function er(t,e){const n=o=>{if(!e.value||!t.value||o.key!=="Tab")return;const a=t.value.querySelectorAll(Oo);if(a.length===0)return;const s=a[0],l=a[a.length-1];o.shiftKey?document.activeElement===s&&(o.preventDefault(),l.focus()):document.activeElement===l&&(o.preventDefault(),s.focus())};i.watch(e,async o=>{var a;if(o){await i.nextTick();const s=(a=t.value)==null?void 0:a.querySelector(Oo);s==null||s.focus(),window.addEventListener("keydown",n)}else window.removeEventListener("keydown",n)}),i.onUnmounted(()=>{window.removeEventListener("keydown",n)})}function tr(t,e={}){const{size:n,opacity:o}=e;let a=!1,s=null;function l(u){if(!t.value)return;const h=t.value.getBoundingClientRect(),f=(u.clientX-h.left)/h.width*100,m=(u.clientY-h.top)/h.height*100;t.value.style.setProperty("--mouse-x",`${f}%`),t.value.style.setProperty("--mouse-y",`${m}%`),n!==void 0&&t.value.style.setProperty("--effect-hover-reveal-size",`${n}px`),o!==void 0&&t.value.style.setProperty("--effect-hover-reveal-opacity",`${o}`)}function r(){t.value&&(t.value.style.removeProperty("--mouse-x"),t.value.style.removeProperty("--mouse-y"))}function c(u){a&&s===u||(d(),s=u,a=!0,u.setAttribute("data-hover-reveal",""),u.addEventListener("mousemove",l),u.addEventListener("mouseleave",r))}function d(){s&&(s.removeEventListener("mousemove",l),s.removeEventListener("mouseleave",r),s.style.removeProperty("--mouse-x"),s.style.removeProperty("--mouse-y")),a=!1,s=null}i.watch(t,u=>{u?c(u):d()},{immediate:!0}),i.onUnmounted(()=>{d()})}let nr=0;function ye(t="ui"){return`${t}-${++nr}`}function ir(t,e={}){const{strength:n=.2,radius:o=100,ease:a=.15}=e,s=i.ref(0),l=i.ref(0),r=i.ref(!1),c=i.ref({});let d=null,u=0,h=0,f=0,m=0,p=!1,g=null;function b(x,S,w){return x+(S-x)*w}function _(){f=b(f,u,a),m=b(m,h,a);const x=Math.abs(f-u),S=Math.abs(m-h);x<.01&&S<.01&&(f=u,m=h),s.value=f,l.value=m,c.value={transform:`translate(${f}px, ${m}px)`,transition:"none"},r.value||f!==0||m!==0?d=requestAnimationFrame(_):(d=null,c.value={transform:"translate(0, 0)",transition:"transform var(--duration-normal, 200ms) var(--ease-out, ease-out)"})}function k(x){if(!t.value)return;const S=t.value.getBoundingClientRect(),w=S.left+S.width/2,M=S.top+S.height/2,N=x.clientX-w,T=x.clientY-M,$=Math.sqrt(N**2+T**2);if($<o){r.value=!0;const K=1-$/o;u=N*n*K,h=T*n*K,d||(d=requestAnimationFrame(_))}else r.value&&B()}function B(){r.value=!1,u=0,h=0,d||(d=requestAnimationFrame(_))}function C(x){p&&g===x||(y(),g=x,p=!0,document.addEventListener("mousemove",k),x.addEventListener("mouseleave",B))}function y(){document.removeEventListener("mousemove",k),g&&g.removeEventListener("mouseleave",B),d&&(cancelAnimationFrame(d),d=null),p=!1,g=null}return i.watch(t,x=>{x?C(x):y()},{immediate:!0}),i.onUnmounted(()=>{y()}),{x:s,y:l,isHovering:r,style:c}}function Fo(t,e,n,o){const a=t.getBoundingClientRect(),s=e.offsetWidth,l=e.offsetHeight,r={width:window.innerWidth||1024,height:window.innerHeight||768},c=a.left+a.width/2,d=a.top+a.height/2;function u(_){switch(_){case"top":return{top:a.top-l-o,left:c-s/2};case"bottom":return{top:a.bottom+o,left:c-s/2};case"left":return{top:d-l/2,left:a.left-s-o};case"right":return{top:d-l/2,left:a.right+o}}}const h={top:"bottom",bottom:"top",left:"right",right:"left"};let f=n,m=u(f);const p={top:m.top<0,bottom:m.top+l>r.height,left:m.left<0,right:m.left+s>r.width};(f==="top"&&p.top||f==="bottom"&&p.bottom||f==="left"&&p.left||f==="right"&&p.right)&&(f=h[f],m=u(f));const g=Math.max(o,Math.min(m.top,r.height-l-o)),b=Math.max(o,Math.min(m.left,r.width-s-o));return{top:g,left:b,actualPlacement:f}}function Wo(t,e,n="top",o=8){const a=i.ref({top:0,left:0,actualPlacement:"top"});function s(){return typeof n=="string"?n:typeof n=="function"?n():n.value}function l(){!t.value||!e.value||(a.value=Fo(t.value,e.value,s(),o))}return i.onMounted(()=>{window.addEventListener("resize",l),window.addEventListener("scroll",l,!0)}),i.onUnmounted(()=>{window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0)}),{coords:a,updatePosition:l,getPlacement:s}}function or(t,e={}){const{color:n="var(--effect-ripple-color, white)",opacity:o=.25,duration:a=800,disabled:s=!1}=e;let l=!1,r=null,c=null;function d(){return typeof s=="boolean"?s:s.value}function u(){document.querySelector("style[data-ripple-keyframes]")||(c=document.createElement("style"),c.setAttribute("data-ripple-keyframes",""),c.textContent=`
1
+ (function(E,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(E=typeof globalThis<"u"?globalThis:E||self,i(E.SpireUI={},E.Vue))})(this,(function(E,i){"use strict";var b0=Object.defineProperty;var _0=(E,i,Et)=>i in E?b0(E,i,{enumerable:!0,configurable:!0,writable:!0,value:Et}):E[i]=Et;var W=(E,i,Et)=>_0(E,typeof i!="symbol"?i+"":i,Et);var Ro;const Et=Symbol("accordion"),Mi=Symbol("accordion-item"),ql=i.defineComponent({__name:"AccordionRoot",props:{modelValue:{},collapsible:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},variant:{default:"contained"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(n.modelValue);i.watch(()=>n.modelValue,c=>{a.value=c});const s=i.computed(()=>n.modelValue!==void 0),l=i.computed(()=>{const c=s.value?n.modelValue:a.value;return c===void 0?new Set:Array.isArray(c)?new Set(c):new Set([c])});function r(c){const d=l.value.has(c);let u;if(d){if(!n.collapsible&&l.value.size===1)return;if(n.multiple){const h=new Set(l.value);h.delete(c),u=Array.from(h)}else u=void 0}else if(n.multiple){const h=new Set(l.value);h.add(c),u=Array.from(h)}else u=c;a.value=u,o("update:modelValue",u)}return i.provide(Et,{openItems:l,toggle:r,collapsible:i.toRef(n,"collapsible"),multiple:i.toRef(n,"multiple"),variant:i.toRef(n,"variant")}),(c,d)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-accordion",[`ui-accordion--${t.variant}`]])},[i.renderSlot(c.$slots,"default",{},void 0,!0)],2))}}),O=(t,e)=>{const n=t.__vccOpts||t;for(const[o,a]of e)n[o]=a;return n},Gl=O(ql,[["__scopeId","data-v-93a5c4e6"]]);function Jl(t,e){const n=o=>{const a=o.target;!t.value||t.value.contains(a)||e()};i.onMounted(()=>{document.addEventListener("mousedown",n),document.addEventListener("touchstart",n)}),i.onUnmounted(()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)})}function Zl(t=2e3){const e=i.ref(!1);let n=null;return{copy:async a=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard API not supported"),!1;try{return await navigator.clipboard.writeText(a),e.value=!0,n&&clearTimeout(n),n=setTimeout(()=>{e.value=!1},t),!0}catch(s){return console.error("Failed to copy:",s),e.value=!1,!1}},copied:e}}function Ql(t,e,n,o){const a=l=>{l==null||l.addEventListener(e,n,o)},s=l=>{l==null||l.removeEventListener(e,n,o)};i.isRef(t)?i.watch(t,(l,r)=>{r&&s(r),l&&a(l)},{immediate:!0}):i.onMounted(()=>a(t)),i.onUnmounted(()=>s(i.unref(t)))}const Oo=["a[href]","button:not([disabled])","input:not([disabled])","textarea:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function er(t,e){const n=o=>{if(!e.value||!t.value||o.key!=="Tab")return;const a=t.value.querySelectorAll(Oo);if(a.length===0)return;const s=a[0],l=a[a.length-1];o.shiftKey?document.activeElement===s&&(o.preventDefault(),l.focus()):document.activeElement===l&&(o.preventDefault(),s.focus())};i.watch(e,async o=>{var a;if(o){await i.nextTick();const s=(a=t.value)==null?void 0:a.querySelector(Oo);s==null||s.focus(),window.addEventListener("keydown",n)}else window.removeEventListener("keydown",n)}),i.onUnmounted(()=>{window.removeEventListener("keydown",n)})}function tr(t,e={}){const{size:n,opacity:o}=e;let a=!1,s=null;function l(u){if(!t.value)return;const h=t.value.getBoundingClientRect(),f=(u.clientX-h.left)/h.width*100,m=(u.clientY-h.top)/h.height*100;t.value.style.setProperty("--mouse-x",`${f}%`),t.value.style.setProperty("--mouse-y",`${m}%`),n!==void 0&&t.value.style.setProperty("--effect-hover-reveal-size",`${n}px`),o!==void 0&&t.value.style.setProperty("--effect-hover-reveal-opacity",`${o}`)}function r(){t.value&&(t.value.style.removeProperty("--mouse-x"),t.value.style.removeProperty("--mouse-y"))}function c(u){a&&s===u||(d(),s=u,a=!0,u.setAttribute("data-hover-reveal",""),u.addEventListener("mousemove",l),u.addEventListener("mouseleave",r))}function d(){s&&(s.removeEventListener("mousemove",l),s.removeEventListener("mouseleave",r),s.style.removeProperty("--mouse-x"),s.style.removeProperty("--mouse-y")),a=!1,s=null}i.watch(t,u=>{u?c(u):d()},{immediate:!0}),i.onUnmounted(()=>{d()})}let nr=0;function ye(t="ui"){return`${t}-${++nr}`}function ir(t,e={}){const{strength:n=.2,radius:o=100,ease:a=.15}=e,s=i.ref(0),l=i.ref(0),r=i.ref(!1),c=i.ref({});let d=null,u=0,h=0,f=0,m=0,p=!1,g=null;function b(x,S,w){return x+(S-x)*w}function _(){f=b(f,u,a),m=b(m,h,a);const x=Math.abs(f-u),S=Math.abs(m-h);x<.01&&S<.01&&(f=u,m=h),s.value=f,l.value=m,c.value={transform:`translate(${f}px, ${m}px)`,transition:"none"},r.value||f!==0||m!==0?d=requestAnimationFrame(_):(d=null,c.value={transform:"translate(0, 0)",transition:"transform var(--duration-normal, 200ms) var(--ease-out, ease-out)"})}function k(x){if(!t.value)return;const S=t.value.getBoundingClientRect(),w=S.left+S.width/2,M=S.top+S.height/2,N=x.clientX-w,T=x.clientY-M,$=Math.sqrt(N**2+T**2);if($<o){r.value=!0;const K=1-$/o;u=N*n*K,h=T*n*K,d||(d=requestAnimationFrame(_))}else r.value&&B()}function B(){r.value=!1,u=0,h=0,d||(d=requestAnimationFrame(_))}function C(x){p&&g===x||(y(),g=x,p=!0,document.addEventListener("mousemove",k),x.addEventListener("mouseleave",B))}function y(){document.removeEventListener("mousemove",k),g&&g.removeEventListener("mouseleave",B),d&&(cancelAnimationFrame(d),d=null),p=!1,g=null}return i.watch(t,x=>{x?C(x):y()},{immediate:!0}),i.onUnmounted(()=>{y()}),{x:s,y:l,isHovering:r,style:c}}function Fo(t,e,n,o){const a=t.getBoundingClientRect(),s=e.offsetWidth,l=e.offsetHeight,r={width:window.innerWidth||1024,height:window.innerHeight||768},c=a.left+a.width/2,d=a.top+a.height/2;function u(_){switch(_){case"top":return{top:a.top-l-o,left:c-s/2};case"bottom":return{top:a.bottom+o,left:c-s/2};case"left":return{top:d-l/2,left:a.left-s-o};case"right":return{top:d-l/2,left:a.right+o}}}const h={top:"bottom",bottom:"top",left:"right",right:"left"};let f=n,m=u(f);const p={top:m.top<0,bottom:m.top+l>r.height,left:m.left<0,right:m.left+s>r.width};(f==="top"&&p.top||f==="bottom"&&p.bottom||f==="left"&&p.left||f==="right"&&p.right)&&(f=h[f],m=u(f));const g=Math.max(o,Math.min(m.top,r.height-l-o)),b=Math.max(o,Math.min(m.left,r.width-s-o));return{top:g,left:b,actualPlacement:f}}function Wo(t,e,n="top",o=8){const a=i.ref({top:0,left:0,actualPlacement:"top"});function s(){return typeof n=="string"?n:typeof n=="function"?n():n.value}function l(){!t.value||!e.value||(a.value=Fo(t.value,e.value,s(),o))}return i.onMounted(()=>{window.addEventListener("resize",l),window.addEventListener("scroll",l,!0)}),i.onUnmounted(()=>{window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0)}),{coords:a,updatePosition:l,getPlacement:s}}function or(t,e={}){const{color:n="var(--effect-ripple-color, white)",opacity:o=.25,duration:a=800,disabled:s=!1}=e;let l=!1,r=null,c=null;function d(){return typeof s=="boolean"?s:s.value}function u(){document.querySelector("style[data-ripple-keyframes]")||(c=document.createElement("style"),c.setAttribute("data-ripple-keyframes",""),c.textContent=`
2
2
  @keyframes ui-ripple-expand {
3
3
  0% {
4
4
  opacity: 0;
@@ -42,4 +42,4 @@
42
42
  * Released under the MIT License
43
43
  */class nh{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,o,a){const s=n.listeners[a],l=n.duration;s.forEach(r=>r({chart:e,initial:n.initial,numSteps:l,currentStep:Math.min(o-n.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=Ca.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((o,a)=>{if(!o.running||!o.items.length)return;const s=o.items;let l=s.length-1,r=!1,c;for(;l>=0;--l)c=s[l],c._active?(c._total>o.duration&&(o.duration=c._total),c.tick(e),r=!0):(s[l]=s[s.length-1],s.pop());r&&(a.draw(),this._notify(a,o,e,"progress")),s.length||(o.running=!1,this._notify(a,o,e,"complete"),o.initial=!1),n+=s.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let o=n.get(e);return o||(o={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,o)),o}listen(e,n,o){this._getAnims(e).listeners[n].push(o)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((o,a)=>Math.max(o,a._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const o=n.items;let a=o.length-1;for(;a>=0;--a)o[a].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var dt=new nh;const es="transparent",ih={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const o=Va(t||es),a=o.valid&&Va(e||es);return a&&a.valid?a.mix(o,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class oh{constructor(e,n,o,a){const s=n[o];a=fn([e.to,a,s,e.from]);const l=fn([e.from,s,a]);this._active=!0,this._fn=e.fn||ih[e.type||typeof l],this._easing=cn[e.easing]||cn.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=o,this._from=l,this._to=a,this._promises=void 0}active(){return this._active}update(e,n,o){if(this._active){this._notify(!1);const a=this._target[this._prop],s=o-this._start,l=this._duration-s;this._start=o,this._duration=Math.floor(Math.max(l,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=fn([e.to,n,a,e.from]),this._from=fn([e.from,a,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,o=this._duration,a=this._prop,s=this._from,l=this._loop,r=this._to;let c;if(this._active=s!==r&&(l||n<o),!this._active){this._target[a]=r,this._notify(!0);return}if(n<0){this._target[a]=s;return}c=n/o%2,c=l&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,r,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,o)=>{e.push({res:n,rej:o})})}_notify(e){const n=e?"res":"rej",o=this._promises||[];for(let a=0;a<o.length;a++)o[a][n]()}}class ts{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!se(e))return;const n=Object.keys(Ee.animation),o=this._properties;Object.getOwnPropertyNames(e).forEach(a=>{const s=e[a];if(!se(s))return;const l={};for(const r of n)l[r]=s[r];(Se(s.properties)&&s.properties||[a]).forEach(r=>{(r===a||!o.has(r))&&o.set(r,l)})})}_animateOptions(e,n){const o=n.options,a=sh(e,o);if(!a)return[];const s=this._createAnimations(a,o);return o.$shared&&ah(e.options.$animations,o).then(()=>{e.options=o},()=>{}),s}_createAnimations(e,n){const o=this._properties,a=[],s=e.$animations||(e.$animations={}),l=Object.keys(n),r=Date.now();let c;for(c=l.length-1;c>=0;--c){const d=l[c];if(d.charAt(0)==="$")continue;if(d==="options"){a.push(...this._animateOptions(e,n));continue}const u=n[d];let h=s[d];const f=o.get(d);if(h)if(f&&h.active()){h.update(f,u,r);continue}else h.cancel();if(!f||!f.duration){e[d]=u;continue}s[d]=h=new oh(f,e,d,u),a.push(h)}return a}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const o=this._createAnimations(e,n);if(o.length)return dt.add(this._chart,o),!0}}function ah(t,e){const n=[],o=Object.keys(e);for(let a=0;a<o.length;a++){const s=t[o[a]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function sh(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function ns(t,e){const n=t&&t.options||{},o=n.reverse,a=n.min===void 0?e:0,s=n.max===void 0?e:0;return{start:o?s:a,end:o?a:s}}function lh(t,e,n){if(n===!1)return!1;const o=ns(t,n),a=ns(e,n);return{top:a.end,right:o.end,bottom:a.start,left:o.start}}function rh(t){let e,n,o,a;return se(t)?(e=t.top,n=t.right,o=t.bottom,a=t.left):e=n=o=a=t,{top:e,right:n,bottom:o,left:a,disabled:t===!1}}function is(t,e){const n=[],o=t._getSortedDatasetMetas(e);let a,s;for(a=0,s=o.length;a<s;++a)n.push(o[a].index);return n}function os(t,e,n,o={}){const a=t.keys,s=o.mode==="single";let l,r,c,d;if(e===null)return;let u=!1;for(l=0,r=a.length;l<r;++l){if(c=+a[l],c===n){if(u=!0,o.all)continue;break}d=t.values[c],Me(d)&&(s||e===0||nt(e)===nt(d))&&(e+=d)}return!u&&!o.all?0:e}function ch(t,e){const{iScale:n,vScale:o}=e,a=n.axis==="x"?"x":"y",s=o.axis==="x"?"x":"y",l=Object.keys(t),r=new Array(l.length);let c,d,u;for(c=0,d=l.length;c<d;++c)u=l[c],r[c]={[a]:u,[s]:t[u]};return r}function io(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function dh(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function uh(t){const{min:e,max:n,minDefined:o,maxDefined:a}=t.getUserBounds();return{min:o?e:Number.NEGATIVE_INFINITY,max:a?n:Number.POSITIVE_INFINITY}}function hh(t,e,n){const o=t[e]||(t[e]={});return o[n]||(o[n]={})}function as(t,e,n,o){for(const a of e.getMatchingVisibleMetas(o).reverse()){const s=t[a.index];if(n&&s>0||!n&&s<0)return a.index}return null}function ss(t,e){const{chart:n,_cachedMeta:o}=t,a=n._stacks||(n._stacks={}),{iScale:s,vScale:l,index:r}=o,c=s.axis,d=l.axis,u=dh(s,l,o),h=e.length;let f;for(let m=0;m<h;++m){const p=e[m],{[c]:g,[d]:b}=p,_=p._stacks||(p._stacks={});f=_[d]=hh(a,u,g),f[r]=b,f._top=as(f,l,!0,o.type),f._bottom=as(f,l,!1,o.type);const k=f._visualValues||(f._visualValues={});k[r]=b}}function oo(t,e){const n=t.scales;return Object.keys(n).filter(o=>n[o].axis===e).shift()}function fh(t,e){return kt(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function mh(t,e,n){return kt(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function mn(t,e){const n=t.controller.index,o=t.vScale&&t.vScale.axis;if(o){e=e||t._parsed;for(const a of e){const s=a._stacks;if(!s||s[o]===void 0||s[o][n]===void 0)return;delete s[o][n],s[o]._visualValues!==void 0&&s[o]._visualValues[n]!==void 0&&delete s[o]._visualValues[n]}}}const ao=t=>t==="reset"||t==="none",ls=(t,e)=>e?t:Object.assign({},t),ph=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:is(n,!0),values:null};class Qe{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=io(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&mn(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,o=this.getDataset(),a=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,s=n.xAxisID=ie(o.xAxisID,oo(e,"x")),l=n.yAxisID=ie(o.yAxisID,oo(e,"y")),r=n.rAxisID=ie(o.rAxisID,oo(e,"r")),c=n.indexAxis,d=n.iAxisID=a(c,s,l,r),u=n.vAxisID=a(c,l,s,r);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(l),n.rScale=this.getScaleForId(r),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&xa(this._data,this),e._stacked&&mn(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),o=this._data;if(se(n)){const a=this._cachedMeta;this._data=ch(n,a)}else if(o!==n){if(o){xa(o,this);const a=this._cachedMeta;mn(a),a._parsed=[]}n&&Object.isExtensible(n)&&Qd(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,o=this.getDataset();let a=!1;this._dataCheck();const s=n._stacked;n._stacked=io(n.vScale,n),n.stack!==o.stack&&(a=!0,mn(n),n.stack=o.stack),this._resyncElements(e),(a||s!==n._stacked)&&(ss(this,n._parsed),n._stacked=io(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),o=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(o,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:o,_data:a}=this,{iScale:s,_stacked:l}=o,r=s.axis;let c=e===0&&n===a.length?!0:o._sorted,d=e>0&&o._parsed[e-1],u,h,f;if(this._parsing===!1)o._parsed=a,o._sorted=!0,f=a;else{Se(a[e])?f=this.parseArrayData(o,a,e,n):se(a[e])?f=this.parseObjectData(o,a,e,n):f=this.parsePrimitiveData(o,a,e,n);const m=()=>h[r]===null||d&&h[r]<d[r];for(u=0;u<n;++u)o._parsed[u+e]=h=f[u],c&&(m()&&(c=!1),d=h);o._sorted=c}l&&ss(this,f)}parsePrimitiveData(e,n,o,a){const{iScale:s,vScale:l}=e,r=s.axis,c=l.axis,d=s.getLabels(),u=s===l,h=new Array(a);let f,m,p;for(f=0,m=a;f<m;++f)p=f+o,h[f]={[r]:u||s.parse(d[p],p),[c]:l.parse(n[p],p)};return h}parseArrayData(e,n,o,a){const{xScale:s,yScale:l}=e,r=new Array(a);let c,d,u,h;for(c=0,d=a;c<d;++c)u=c+o,h=n[u],r[c]={x:s.parse(h[0],u),y:l.parse(h[1],u)};return r}parseObjectData(e,n,o,a){const{xScale:s,yScale:l}=e,{xAxisKey:r="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,h,f,m;for(u=0,h=a;u<h;++u)f=u+o,m=n[f],d[u]={x:s.parse(bt(m,r),f),y:l.parse(bt(m,c),f)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,o){const a=this.chart,s=this._cachedMeta,l=n[e.axis],r={keys:is(a,!0),values:n._stacks[e.axis]._visualValues};return os(r,l,s.index,{mode:o})}updateRangeFromParsed(e,n,o,a){const s=o[n.axis];let l=s===null?NaN:s;const r=a&&o._stacks[n.axis];a&&r&&(a.values=r,l=os(a,s,this._cachedMeta.index)),e.min=Math.min(e.min,l),e.max=Math.max(e.max,l)}getMinMax(e,n){const o=this._cachedMeta,a=o._parsed,s=o._sorted&&e===o.iScale,l=a.length,r=this._getOtherScale(e),c=ph(n,o,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=uh(r);let f,m;function p(){m=a[f];const g=m[r.axis];return!Me(m[e.axis])||u>g||h<g}for(f=0;f<l&&!(!p()&&(this.updateRangeFromParsed(d,e,m,c),s));++f);if(s){for(f=l-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(d,e,m,c);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,o=[];let a,s,l;for(a=0,s=n.length;a<s;++a)l=n[a][e.axis],Me(l)&&o.push(l);return o}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,o=n.iScale,a=n.vScale,s=this.getParsed(e);return{label:o?""+o.getLabelForValue(s[o.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=rh(ie(this.options.clip,lh(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,o=this._cachedMeta,a=o.data||[],s=n.chartArea,l=[],r=this._drawStart||0,c=this._drawCount||a.length-r,d=this.options.drawActiveElementsOnTop;let u;for(o.dataset&&o.dataset.draw(e,s,r,c),u=r;u<r+c;++u){const h=a[u];h.hidden||(h.active&&d?l.push(h):h.draw(e,s))}for(u=0;u<l.length;++u)l[u].draw(e,s)}getStyle(e,n){const o=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(o):this.resolveDataElementOptions(e||0,o)}getContext(e,n,o){const a=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const l=this._cachedMeta.data[e];s=l.$context||(l.$context=mh(this.getContext(),e,l)),s.parsed=this.getParsed(e),s.raw=a.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=fh(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=o,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",o){const a=n==="active",s=this._cachedDataOpts,l=e+"-"+n,r=s[l],c=this.enableOptionSharing&&sn(o);if(r)return ls(r,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),h=a?[`${e}Hover`,"hover",e,""]:[e,""],f=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Ee.elements[e]),p=()=>this.getContext(o,a,n),g=d.resolveNamedOptions(f,m,p,h);return g.$shared&&(g.$shared=c,s[l]=Object.freeze(ls(g,c))),g}_resolveAnimations(e,n,o){const a=this.chart,s=this._cachedDataOpts,l=`animation-${n}`,r=s[l];if(r)return r;let c;if(a.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),h);c=u.createResolver(f,this.getContext(e,o,n))}const d=new ts(a,c&&c.animations);return c&&c._cacheable&&(s[l]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||ao(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const o=this.resolveDataElementOptions(e,n),a=this._sharedOptions,s=this.getSharedOptions(o),l=this.includeOptions(n,s)||s!==a;return this.updateSharedOptions(s,n,o),{sharedOptions:s,includeOptions:l}}updateElement(e,n,o,a){ao(a)?Object.assign(e,o):this._resolveAnimations(n,a).update(e,o)}updateSharedOptions(e,n,o){e&&!ao(n)&&this._resolveAnimations(void 0,n).update(e,o)}_setStyle(e,n,o,a){e.active=a;const s=this.getStyle(n,a);this._resolveAnimations(n,o,a).update(e,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(e,n,o){this._setStyle(e,o,"active",!1)}setHoverStyle(e,n,o){this._setStyle(e,o,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=this._data,o=this._cachedMeta.data;for(const[r,c,d]of this._syncList)this[r](c,d);this._syncList=[];const a=o.length,s=n.length,l=Math.min(s,a);l&&this.parse(0,l),s>a?this._insertElements(a,s-a,e):s<a&&this._removeElements(s,a-s)}_insertElements(e,n,o=!0){const a=this._cachedMeta,s=a.data,l=e+n;let r;const c=d=>{for(d.length+=n,r=d.length-1;r>=l;r--)d[r]=d[r-n]};for(c(s),r=e;r<l;++r)s[r]=new this.dataElementType;this._parsing&&c(a._parsed),this.parse(e,n),o&&this.updateElements(s,e,n,"reset")}updateElements(e,n,o,a){}_removeElements(e,n){const o=this._cachedMeta;if(this._parsing){const a=o._parsed.splice(e,n);o._stacked&&mn(o,a)}o.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,o,a]=e;this[n](o,a)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const o=arguments.length-2;o&&this._sync(["_insertElements",e,o])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}W(Qe,"defaults",{}),W(Qe,"datasetElementType",null),W(Qe,"dataElementType",null);function gh(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let o=[];for(let a=0,s=n.length;a<s;a++)o=o.concat(n[a].controller.getAllParsedValues(t));t._cache.$bar=wa(o.sort((a,s)=>a-s))}return t._cache.$bar}function bh(t){const e=t.iScale,n=gh(e,t.type);let o=e._length,a,s,l,r;const c=()=>{l===32767||l===-32768||(sn(r)&&(o=Math.min(o,Math.abs(l-r)||o)),r=l)};for(a=0,s=n.length;a<s;++a)l=e.getPixelForValue(n[a]),c();for(r=void 0,a=0,s=e.ticks.length;a<s;++a)l=e.getPixelForTick(a),c();return o}function _h(t,e,n,o){const a=n.barThickness;let s,l;return ae(a)?(s=e.min*n.categoryPercentage,l=n.barPercentage):(s=a*o,l=1),{chunk:s/o,ratio:l,start:e.pixels[t]-s/2}}function yh(t,e,n,o){const a=e.pixels,s=a[t];let l=t>0?a[t-1]:null,r=t<a.length-1?a[t+1]:null;const c=n.categoryPercentage;l===null&&(l=s-(r===null?e.end-e.start:r-s)),r===null&&(r=s+s-l);const d=s-(s-Math.min(l,r))/2*c;return{chunk:Math.abs(r-l)/2*c/o,ratio:n.barPercentage,start:d}}function kh(t,e,n,o){const a=n.parse(t[0],o),s=n.parse(t[1],o),l=Math.min(a,s),r=Math.max(a,s);let c=l,d=r;Math.abs(l)>Math.abs(r)&&(c=r,d=l),e[n.axis]=d,e._custom={barStart:c,barEnd:d,start:a,end:s,min:l,max:r}}function rs(t,e,n,o){return Se(t)?kh(t,e,n,o):e[n.axis]=n.parse(t,o),e}function cs(t,e,n,o){const a=t.iScale,s=t.vScale,l=a.getLabels(),r=a===s,c=[];let d,u,h,f;for(d=n,u=n+o;d<u;++d)f=e[d],h={},h[a.axis]=r||a.parse(l[d],d),c.push(rs(f,h,s,d));return c}function so(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function xh(t,e,n){return t!==0?nt(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function wh(t){let e,n,o,a,s;return t.horizontal?(e=t.base>t.x,n="left",o="right"):(e=t.base<t.y,n="bottom",o="top"),e?(a="end",s="start"):(a="start",s="end"),{start:n,end:o,reverse:e,top:a,bottom:s}}function Ch(t,e,n,o){let a=e.borderSkipped;const s={};if(!a){t.borderSkipped=s;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:l,end:r,reverse:c,top:d,bottom:u}=wh(t);a==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===o?a=d:(n._bottom||0)===o?a=u:(s[ds(u,l,r,c)]=!0,a=d)),s[ds(a,l,r,c)]=!0,t.borderSkipped=s}function ds(t,e,n,o){return o?(t=Bh(t,e,n),t=us(t,n,e)):t=us(t,e,n),t}function Bh(t,e,n){return t===e?n:t===n?e:t}function us(t,e,n){return t==="start"?e:t==="end"?n:t}function Sh(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class Zn extends Qe{parsePrimitiveData(e,n,o,a){return cs(e,n,o,a)}parseArrayData(e,n,o,a){return cs(e,n,o,a)}parseObjectData(e,n,o,a){const{iScale:s,vScale:l}=e,{xAxisKey:r="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?r:c,u=l.axis==="x"?r:c,h=[];let f,m,p,g;for(f=o,m=o+a;f<m;++f)g=n[f],p={},p[s.axis]=s.parse(bt(g,d),f),h.push(rs(bt(g,u),p,l,f));return h}updateRangeFromParsed(e,n,o,a){super.updateRangeFromParsed(e,n,o,a);const s=o._custom;s&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,s.min),e.max=Math.max(e.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:o,vScale:a}=n,s=this.getParsed(e),l=s._custom,r=so(l)?"["+l.start+", "+l.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+o.getLabelForValue(s[o.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,o,a){const s=a==="reset",{index:l,_cachedMeta:{vScale:r}}=this,c=r.getBasePixel(),d=r.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,a);for(let m=n;m<n+o;m++){const p=this.getParsed(m),g=s||ae(p[r.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,u),_=(p._stacks||{})[r.axis],k={horizontal:d,base:g.base,enableBorderRadius:!_||so(p._custom)||l===_._top||l===_._bottom,x:d?g.head:b.center,y:d?b.center:g.head,height:d?b.size:Math.abs(g.size),width:d?Math.abs(g.size):b.size};f&&(k.options=h||this.resolveDataElementOptions(m,e[m].active?"active":a));const B=k.options||e[m].options;Ch(k,B,_,l),Sh(k,B,u.ratio),this.updateElement(e[m],m,k,a)}}_getStacks(e,n){const{iScale:o}=this._cachedMeta,a=o.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=o.options.stacked,l=[],r=this._cachedMeta.controller.getParsed(n),c=r&&r[o.axis],d=u=>{const h=u._parsed.find(m=>m[o.axis]===c),f=h&&h[u.vScale.axis];if(ae(f)||isNaN(f))return!0};for(const u of a)if(!(n!==void 0&&d(u))&&((s===!1||l.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&l.push(u.stack),u.index===e))break;return l.length||l.push(void 0),l}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(o=>e[o].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const o of this.chart.data.datasets)e[ie(this.chart.options.indexAxis==="x"?o.xAxisID:o.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,o){const a=this._getStacks(e,o),s=n!==void 0?a.indexOf(n):-1;return s===-1?a.length-1:s}_getRuler(){const e=this.options,n=this._cachedMeta,o=n.iScale,a=[];let s,l;for(s=0,l=n.data.length;s<l;++s)a.push(o.getPixelForValue(this.getParsed(s)[o.axis],s));const r=e.barThickness;return{min:r||bh(n),pixels:a,start:o._startPixel,end:o._endPixel,stackCount:this._getStackCount(),scale:o,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:o,index:a},options:{base:s,minBarLength:l}}=this,r=s||0,c=this.getParsed(e),d=c._custom,u=so(d);let h=c[n.axis],f=0,m=o?this.applyStack(n,c,o):h,p,g;m!==h&&(f=m-h,m=h),u&&(h=d.barStart,m=d.barEnd-d.barStart,h!==0&&nt(h)!==nt(d.barEnd)&&(f=0),f+=h);const b=!ae(s)&&!u?s:f;let _=n.getPixelForValue(b);if(this.chart.getDataVisibility(e)?p=n.getPixelForValue(f+m):p=_,g=p-_,Math.abs(g)<l){g=xh(g,n,r)*l,h===r&&(_-=g/2);const k=n.getPixelForDecimal(0),B=n.getPixelForDecimal(1),C=Math.min(k,B),y=Math.max(k,B);_=Math.max(Math.min(_,y),C),p=_+g,o&&!u&&(c._stacks[n.axis]._visualValues[a]=n.getValueForPixel(p)-n.getValueForPixel(_))}if(_===n.getPixelForValue(r)){const k=nt(g)*n.getLineWidthForValue(r)/2;_+=k,g-=k}return{size:g,base:_,head:p,center:p+g/2}}_calculateBarIndexPixels(e,n){const o=n.scale,a=this.options,s=a.skipNull,l=ie(a.maxBarThickness,1/0);let r,c;const d=this._getAxisCount();if(n.grouped){const u=s?this._getStackCount(e):n.stackCount,h=a.barThickness==="flex"?yh(e,n,a,u*d):_h(e,n,a,u*d),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(ie(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0)+m;r=h.start+h.chunk*p+h.chunk/2,c=Math.min(l,h.chunk*h.ratio)}else r=o.getPixelForValue(this.getParsed(e)[o.axis],e),c=Math.min(l,n.min*n.ratio);return{base:r-c/2,head:r+c/2,center:r,size:c}}draw(){const e=this._cachedMeta,n=e.vScale,o=e.data,a=o.length;let s=0;for(;s<a;++s)this.getParsed(s)[n.axis]!==null&&!o[s].hidden&&o[s].draw(this._ctx)}}W(Zn,"id","bar"),W(Zn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),W(Zn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Qn extends Qe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,n,o,a){const s=super.parsePrimitiveData(e,n,o,a);for(let l=0;l<s.length;l++)s[l]._custom=this.resolveDataElementOptions(l+o).radius;return s}parseArrayData(e,n,o,a){const s=super.parseArrayData(e,n,o,a);for(let l=0;l<s.length;l++){const r=n[o+l];s[l]._custom=ie(r[2],this.resolveDataElementOptions(l+o).radius)}return s}parseObjectData(e,n,o,a){const s=super.parseObjectData(e,n,o,a);for(let l=0;l<s.length;l++){const r=n[o+l];s[l]._custom=ie(r&&r.r&&+r.r,this.resolveDataElementOptions(l+o).radius)}return s}getMaxOverflow(){const e=this._cachedMeta.data;let n=0;for(let o=e.length-1;o>=0;--o)n=Math.max(n,e[o].size(this.resolveDataElementOptions(o))/2);return n>0&&n}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart.data.labels||[],{xScale:a,yScale:s}=n,l=this.getParsed(e),r=a.getLabelForValue(l.x),c=s.getLabelForValue(l.y),d=l._custom;return{label:o[e]||"",value:"("+r+", "+c+(d?", "+d:"")+")"}}update(e){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,e)}updateElements(e,n,o,a){const s=a==="reset",{iScale:l,vScale:r}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(n,a),u=l.axis,h=r.axis;for(let f=n;f<n+o;f++){const m=e[f],p=!s&&this.getParsed(f),g={},b=g[u]=s?l.getPixelForDecimal(.5):l.getPixelForValue(p[u]),_=g[h]=s?r.getBasePixel():r.getPixelForValue(p[h]);g.skip=isNaN(b)||isNaN(_),d&&(g.options=c||this.resolveDataElementOptions(f,m.active?"active":a),s&&(g.options.radius=0)),this.updateElement(m,f,g,a)}}resolveDataElementOptions(e,n){const o=this.getParsed(e);let a=super.resolveDataElementOptions(e,n);a.$shared&&(a=Object.assign({},a,{$shared:!1}));const s=a.radius;return n!=="active"&&(a.radius=0),a.radius+=ie(o&&o._custom,s),a}}W(Qn,"id","bubble"),W(Qn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),W(Qn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Eh(t,e,n){let o=1,a=1,s=0,l=0;if(e<Ce){const r=t,c=r+e,d=Math.cos(r),u=Math.sin(r),h=Math.cos(c),f=Math.sin(c),m=(B,C,y)=>rn(B,r,c,!0)?1:Math.max(C,C*n,y,y*n),p=(B,C,y)=>rn(B,r,c,!0)?-1:Math.min(C,C*n,y,y*n),g=m(0,d,h),b=m(Ve,u,f),_=p(de,d,h),k=p(de+Ve,u,f);o=(g-_)/2,a=(b-k)/2,s=-(g+_)/2,l=-(b+k)/2}return{ratioX:o,ratioY:a,offsetX:s,offsetY:l}}class zt extends Qe{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const o=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=o;else{let s=c=>+o[c];if(se(o[e])){const{key:c="value"}=this._parsing;s=d=>+bt(o[d],c)}let l,r;for(l=e,r=e+n;l<r;++l)a._parsed[l]=s(l)}}_getRotation(){return Ze(this.options.rotation-90)}_getCircumference(){return Ze(this.options.circumference)}_getRotationExtents(){let e=Ce,n=-Ce;for(let o=0;o<this.chart.data.datasets.length;++o)if(this.chart.isDatasetVisible(o)&&this.chart.getDatasetMeta(o).type===this._type){const a=this.chart.getDatasetMeta(o).controller,s=a._getRotation(),l=a._getCircumference();e=Math.min(e,s),n=Math.max(n,s+l)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:o}=n,a=this._cachedMeta,s=a.data,l=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,r=Math.max((Math.min(o.width,o.height)-l)/2,0),c=Math.min(Ad(this.options.cutout,r),1),d=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:g}=Eh(h,u,c),b=(o.width-l)/f,_=(o.height-l)/m,k=Math.max(Math.min(b,_)/2,0),B=ua(this.options.radius,k),C=Math.max(B*c,0),y=(B-C)/this._getVisibleDatasetWeightTotal();this.offsetX=p*B,this.offsetY=g*B,a.total=this.calculateTotal(),this.outerRadius=B-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*d,0),this.updateElements(s,0,s.length,e)}_circumference(e,n){const o=this.options,a=this._cachedMeta,s=this._getCircumference();return n&&o.animation.animateRotate||!this.chart.getDataVisibility(e)||a._parsed[e]===null||a.data[e].hidden?0:this.calculateCircumference(a._parsed[e]*s/Ce)}updateElements(e,n,o,a){const s=a==="reset",l=this.chart,r=l.chartArea,d=l.options.animation,u=(r.left+r.right)/2,h=(r.top+r.bottom)/2,f=s&&d.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(n,a);let _=this._getRotation(),k;for(k=0;k<n;++k)_+=this._circumference(k,s);for(k=n;k<n+o;++k){const B=this._circumference(k,s),C=e[k],y={x:u+this.offsetX,y:h+this.offsetY,startAngle:_,endAngle:_+B,circumference:B,outerRadius:p,innerRadius:m};b&&(y.options=g||this.resolveDataElementOptions(k,C.active?"active":a)),_+=B,this.updateElement(C,k,y,a)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let o=0,a;for(a=0;a<n.length;a++){const s=e._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!n[a].hidden&&(o+=Math.abs(s))}return o}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?Ce*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,a=o.data.labels||[],s=dn(n._parsed[e],o.options.locale);return{label:a[e]||"",value:s}}getMaxBorderWidth(e){let n=0;const o=this.chart;let a,s,l,r,c;if(!e){for(a=0,s=o.data.datasets.length;a<s;++a)if(o.isDatasetVisible(a)){l=o.getDatasetMeta(a),e=l.data,r=l.controller;break}}if(!e)return 0;for(a=0,s=e.length;a<s;++a)c=r.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let o=0,a=e.length;o<a;++o){const s=this.resolveDataElementOptions(o);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let o=0;o<e;++o)this.chart.isDatasetVisible(o)&&(n+=this._getRingWeight(o));return n}_getRingWeight(e){return Math.max(ie(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}W(zt,"id","doughnut"),W(zt,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),W(zt,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),W(zt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data,{labels:{pointStyle:o,textAlign:a,color:s,useBorderRadius:l,borderRadius:r}}=e.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,d)=>{const h=e.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:h.backgroundColor,fontColor:s,hidden:!e.getDataVisibility(d),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:a,pointStyle:o,borderRadius:l&&(r||h.borderRadius),index:d}}):[]}},onClick(e,n,o){o.chart.toggleDataVisibility(n.index),o.chart.update()}}}});class ei extends Qe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:o,data:a=[],_dataset:s}=n,l=this.chart._animationsDisabled;let{start:r,count:c}=Sa(n,a,l);this._drawStart=r,this._drawCount=c,Ea(n)&&(r=0,c=a.length),o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!s._decimated,o.points=a;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(o,void 0,{animated:!l,options:d},e),this.updateElements(a,r,c,e)}updateElements(e,n,o,a){const s=a==="reset",{iScale:l,vScale:r,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,a),f=l.axis,m=r.axis,{spanGaps:p,segment:g}=this.options,b=jt(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||s||a==="none",k=n+o,B=e.length;let C=n>0&&this.getParsed(n-1);for(let y=0;y<B;++y){const x=e[y],S=_?x:{};if(y<n||y>=k){S.skip=!0;continue}const w=this.getParsed(y),M=ae(w[m]),N=S[f]=l.getPixelForValue(w[f],y),T=S[m]=s||M?r.getBasePixel():r.getPixelForValue(c?this.applyStack(r,w,c):w[m],y);S.skip=isNaN(N)||isNaN(T)||M,S.stop=y>0&&Math.abs(w[f]-C[f])>b,g&&(S.parsed=w,S.raw=d.data[y]),h&&(S.options=u||this.resolveDataElementOptions(y,x.active?"active":a)),_||this.updateElement(x,y,S,a),C=w}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,o=n.options&&n.options.borderWidth||0,a=e.data||[];if(!a.length)return o;const s=a[0].size(this.resolveDataElementOptions(0)),l=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(o,s,l)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}W(ei,"id","line"),W(ei,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),W(ei,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class pn extends Qe{constructor(e,n){super(e,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const n=this._cachedMeta,o=this.chart,a=o.data.labels||[],s=dn(n._parsed[e].r,o.options.locale);return{label:a[e]||"",value:s}}parseObjectData(e,n,o,a){return Fa.bind(this)(e,n,o,a)}update(e){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,e)}getMinMax(){const e=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((o,a)=>{const s=this.getParsed(a).r;!isNaN(s)&&this.chart.getDataVisibility(a)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const e=this.chart,n=e.chartArea,o=e.options,a=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(a/2,0),l=Math.max(o.cutoutPercentage?s/100*o.cutoutPercentage:1,0),r=(s-l)/e.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,n,o,a){const s=a==="reset",l=this.chart,c=l.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,h=d.yCenter,f=d.getIndexAngle(0)-.5*de;let m=f,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,a,g);for(p=n;p<n+o;p++){const b=e[p];let _=m,k=m+this._computeAngle(p,a,g),B=l.getDataVisibility(p)?d.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=k,s&&(c.animateScale&&(B=0),c.animateRotate&&(_=k=f));const C={x:u,y:h,innerRadius:0,outerRadius:B,startAngle:_,endAngle:k,options:this.resolveDataElementOptions(p,b.active?"active":a)};this.updateElement(b,p,C,a)}}countVisibleElements(){const e=this._cachedMeta;let n=0;return e.data.forEach((o,a)=>{!isNaN(this.getParsed(a).r)&&this.chart.getDataVisibility(a)&&n++}),n}_computeAngle(e,n,o){return this.chart.getDataVisibility(e)?Ze(this.resolveDataElementOptions(e,n).angle||o):0}}W(pn,"id","polarArea"),W(pn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),W(pn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:o,color:a}}=e.legend.options;return n.labels.map((s,l)=>{const c=e.getDatasetMeta(0).controller.getStyle(l);return{text:s,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:a,lineWidth:c.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(l),index:l}})}return[]}},onClick(e,n,o){o.chart.toggleDataVisibility(n.index),o.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class lo extends zt{}W(lo,"id","pie"),W(lo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ti extends Qe{getLabelAndValue(e){const n=this._cachedMeta.vScale,o=this.getParsed(e);return{label:n.getLabels()[e],value:""+n.getLabelForValue(o[n.axis])}}parseObjectData(e,n,o,a){return Fa.bind(this)(e,n,o,a)}update(e){const n=this._cachedMeta,o=n.dataset,a=n.data||[],s=n.iScale.getLabels();if(o.points=a,e!=="resize"){const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0);const r={_loop:!0,_fullLoop:s.length===a.length,options:l};this.updateElement(o,void 0,r,e)}this.updateElements(a,0,a.length,e)}updateElements(e,n,o,a){const s=this._cachedMeta.rScale,l=a==="reset";for(let r=n;r<n+o;r++){const c=e[r],d=this.resolveDataElementOptions(r,c.active?"active":a),u=s.getPointPositionForValue(r,this.getParsed(r).r),h=l?s.xCenter:u.x,f=l?s.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:d};this.updateElement(c,r,m,a)}}}W(ti,"id","radar"),W(ti,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),W(ti,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ni extends Qe{getLabelAndValue(e){const n=this._cachedMeta,o=this.chart.data.labels||[],{xScale:a,yScale:s}=n,l=this.getParsed(e),r=a.getLabelForValue(l.x),c=s.getLabelForValue(l.y);return{label:o[e]||"",value:"("+r+", "+c+")"}}update(e){const n=this._cachedMeta,{data:o=[]}=n,a=this.chart._animationsDisabled;let{start:s,count:l}=Sa(n,o,a);if(this._drawStart=s,this._drawCount=l,Ea(n)&&(s=0,l=o.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:c}=n;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!c._decimated,r.points=o;const d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:d},e)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(o,s,l,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,n,o,a){const s=a==="reset",{iScale:l,vScale:r,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(n,a),h=this.getSharedOptions(u),f=this.includeOptions(a,h),m=l.axis,p=r.axis,{spanGaps:g,segment:b}=this.options,_=jt(g)?g:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||s||a==="none";let B=n>0&&this.getParsed(n-1);for(let C=n;C<n+o;++C){const y=e[C],x=this.getParsed(C),S=k?y:{},w=ae(x[p]),M=S[m]=l.getPixelForValue(x[m],C),N=S[p]=s||w?r.getBasePixel():r.getPixelForValue(c?this.applyStack(r,x,c):x[p],C);S.skip=isNaN(M)||isNaN(N)||w,S.stop=C>0&&Math.abs(x[m]-B[m])>_,b&&(S.parsed=x,S.raw=d.data[C]),f&&(S.options=h||this.resolveDataElementOptions(C,y.active?"active":a)),k||this.updateElement(y,C,S,a),B=x}this.updateSharedOptions(h,a,u)}getMaxOverflow(){const e=this._cachedMeta,n=e.data||[];if(!this.options.showLine){let r=0;for(let c=n.length-1;c>=0;--c)r=Math.max(r,n[c].size(this.resolveDataElementOptions(c))/2);return r>0&&r}const o=e.dataset,a=o.options&&o.options.borderWidth||0;if(!n.length)return a;const s=n[0].size(this.resolveDataElementOptions(0)),l=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(a,s,l)/2}}W(ni,"id","scatter"),W(ni,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),W(ni,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Mh=Object.freeze({__proto__:null,BarController:Zn,BubbleController:Qn,DoughnutController:zt,LineController:ei,PieController:lo,PolarAreaController:pn,RadarController:ti,ScatterController:ni});function Nt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ro{constructor(e){W(this,"options");this.options=e||{}}static override(e){Object.assign(ro.prototype,e)}init(){}formats(){return Nt()}parse(){return Nt()}format(){return Nt()}add(){return Nt()}diff(){return Nt()}startOf(){return Nt()}endOf(){return Nt()}}var vh={_date:ro};function Vh(t,e,n,o){const{controller:a,data:s,_sorted:l}=t,r=a._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(r&&e===r.axis&&e!=="r"&&l&&s.length){const d=r._reversePixels?Jd:rt;if(o){if(a._sharedOptions){const u=s[0],h=typeof u.getRange=="function"&&u.getRange(e);if(h){const f=d(s,e,n-h),m=d(s,e,n+h);return{lo:f.lo,hi:m.hi}}}}else{const u=d(s,e,n);if(c){const{vScale:h}=a._cachedMeta,{_parsed:f}=t,m=f.slice(0,u.lo+1).reverse().findIndex(g=>!ae(g[h.axis]));u.lo-=Math.max(0,m);const p=f.slice(u.hi).findIndex(g=>!ae(g[h.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:s.length-1}}function ii(t,e,n,o,a){const s=t.getSortedVisibleDatasetMetas(),l=n[e];for(let r=0,c=s.length;r<c;++r){const{index:d,data:u}=s[r],{lo:h,hi:f}=Vh(s[r],e,l,a);for(let m=h;m<=f;++m){const p=u[m];p.skip||o(p,d,m)}}}function Dh(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(o,a){const s=e?Math.abs(o.x-a.x):0,l=n?Math.abs(o.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(l,2))}}function co(t,e,n,o,a){const s=[];return!a&&!t.isPointInArea(e)||ii(t,n,e,function(r,c,d){!a&&!ct(r,t.chartArea,0)||r.inRange(e.x,e.y,o)&&s.push({element:r,datasetIndex:c,index:d})},!0),s}function $h(t,e,n,o){let a=[];function s(l,r,c){const{startAngle:d,endAngle:u}=l.getProps(["startAngle","endAngle"],o),{angle:h}=ya(l,{x:e.x,y:e.y});rn(h,d,u)&&a.push({element:l,datasetIndex:r,index:c})}return ii(t,n,e,s),a}function Th(t,e,n,o,a,s){let l=[];const r=Dh(n);let c=Number.POSITIVE_INFINITY;function d(u,h,f){const m=u.inRange(e.x,e.y,a);if(o&&!m)return;const p=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(p))&&!m)return;const b=r(e,p);b<c?(l=[{element:u,datasetIndex:h,index:f}],c=b):b===c&&l.push({element:u,datasetIndex:h,index:f})}return ii(t,n,e,d),l}function uo(t,e,n,o,a,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!o?$h(t,e,n,a):Th(t,e,n,o,a,s)}function hs(t,e,n,o,a){const s=[],l=n==="x"?"inXRange":"inYRange";let r=!1;return ii(t,n,e,(c,d,u)=>{c[l]&&c[l](e[n],a)&&(s.push({element:c,datasetIndex:d,index:u}),r=r||c.inRange(e.x,e.y,a))}),o&&!r?[]:s}var Ih={modes:{index(t,e,n,o){const a=It(e,t),s=n.axis||"x",l=n.includeInvisible||!1,r=n.intersect?co(t,a,s,o,l):uo(t,a,s,!1,o,l),c=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=r[0].index,h=d.data[u];h&&!h.skip&&c.push({element:h,datasetIndex:d.index,index:u})}),c):[]},dataset(t,e,n,o){const a=It(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;let r=n.intersect?co(t,a,s,o,l):uo(t,a,s,!1,o,l);if(r.length>0){const c=r[0].datasetIndex,d=t.getDatasetMeta(c).data;r=[];for(let u=0;u<d.length;++u)r.push({element:d[u],datasetIndex:c,index:u})}return r},point(t,e,n,o){const a=It(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;return co(t,a,s,o,l)},nearest(t,e,n,o){const a=It(e,t),s=n.axis||"xy",l=n.includeInvisible||!1;return uo(t,a,s,n.intersect,o,l)},x(t,e,n,o){const a=It(e,t);return hs(t,a,"x",n.intersect,o)},y(t,e,n,o){const a=It(e,t);return hs(t,a,"y",n.intersect,o)}}};const fs=["left","top","right","bottom"];function gn(t,e){return t.filter(n=>n.pos===e)}function ms(t,e){return t.filter(n=>fs.indexOf(n.pos)===-1&&n.box.axis===e)}function bn(t,e){return t.sort((n,o)=>{const a=e?o:n,s=e?n:o;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function Lh(t){const e=[];let n,o,a,s,l,r;for(n=0,o=(t||[]).length;n<o;++n)a=t[n],{position:s,options:{stack:l,stackWeight:r=1}}=a,e.push({index:n,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:l&&s+l,stackWeight:r});return e}function zh(t){const e={};for(const n of t){const{stack:o,pos:a,stackWeight:s}=n;if(!o||!fs.includes(a))continue;const l=e[o]||(e[o]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=s}return e}function Nh(t,e){const n=zh(t),{vBoxMaxWidth:o,hBoxMaxHeight:a}=e;let s,l,r;for(s=0,l=t.length;s<l;++s){r=t[s];const{fullSize:c}=r.box,d=n[r.stack],u=d&&r.stackWeight/d.weight;r.horizontal?(r.width=u?u*o:c&&e.availableWidth,r.height=a):(r.width=o,r.height=u?u*a:c&&e.availableHeight)}return n}function Ph(t){const e=Lh(t),n=bn(e.filter(d=>d.box.fullSize),!0),o=bn(gn(e,"left"),!0),a=bn(gn(e,"right")),s=bn(gn(e,"top"),!0),l=bn(gn(e,"bottom")),r=ms(e,"x"),c=ms(e,"y");return{fullSize:n,leftAndTop:o.concat(s),rightAndBottom:a.concat(c).concat(l).concat(r),chartArea:gn(e,"chartArea"),vertical:o.concat(a).concat(c),horizontal:s.concat(l).concat(r)}}function ps(t,e,n,o){return Math.max(t[n],e[n])+Math.max(t[o],e[o])}function gs(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Ah(t,e,n,o){const{pos:a,box:s}=n,l=t.maxPadding;if(!se(a)){n.size&&(t[a]-=n.size);const h=o[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?s.height:s.width),n.size=h.size/h.count,t[a]+=n.size}s.getPadding&&gs(l,s.getPadding());const r=Math.max(0,e.outerWidth-ps(l,t,"left","right")),c=Math.max(0,e.outerHeight-ps(l,t,"top","bottom")),d=r!==t.w,u=c!==t.h;return t.w=r,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function Rh(t){const e=t.maxPadding;function n(o){const a=Math.max(e[o]-t[o],0);return t[o]+=a,a}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function Oh(t,e){const n=e.maxPadding;function o(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(l=>{s[l]=Math.max(e[l],n[l])}),s}return o(t?["left","right"]:["top","bottom"])}function _n(t,e,n,o){const a=[];let s,l,r,c,d,u;for(s=0,l=t.length,d=0;s<l;++s){r=t[s],c=r.box,c.update(r.width||e.w,r.height||e.h,Oh(r.horizontal,e));const{same:h,other:f}=Ah(e,n,r,o);d|=h&&a.length,u=u||f,c.fullSize||a.push(r)}return d&&_n(a,e,n,o)||u}function oi(t,e,n,o,a){t.top=n,t.left=e,t.right=e+o,t.bottom=n+a,t.width=o,t.height=a}function bs(t,e,n,o){const a=n.padding;let{x:s,y:l}=e;for(const r of t){const c=r.box,d=o[r.stack]||{placed:0,weight:1},u=r.stackWeight/d.weight||1;if(r.horizontal){const h=e.w*u,f=d.size||c.height;sn(d.start)&&(l=d.start),c.fullSize?oi(c,a.left,l,n.outerWidth-a.right-a.left,f):oi(c,e.left+d.placed,l,h,f),d.start=l,d.placed+=h,l=c.bottom}else{const h=e.h*u,f=d.size||c.width;sn(d.start)&&(s=d.start),c.fullSize?oi(c,s,a.top,f,n.outerHeight-a.bottom-a.top):oi(c,s,e.top+d.placed,f,h),d.start=s,d.placed+=h,s=c.right}}e.x=s,e.y=l}var He={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,o){if(!t)return;const a=We(t.options.layout.padding),s=Math.max(e-a.width,0),l=Math.max(n-a.height,0),r=Ph(t.boxes),c=r.vertical,d=r.horizontal;pe(t.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=c.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:a,availableWidth:s,availableHeight:l,vBoxMaxWidth:s/2/u,hBoxMaxHeight:l/2}),f=Object.assign({},a);gs(f,We(o));const m=Object.assign({maxPadding:f,w:s,h:l,x:a.left,y:a.top},a),p=Nh(c.concat(d),h);_n(r.fullSize,m,h,p),_n(c,m,h,p),_n(d,m,h,p)&&_n(c,m,h,p),Rh(m),bs(r.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,bs(r.rightAndBottom,m,h,p),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},pe(r.chartArea,g=>{const b=g.box;Object.assign(b,t.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class _s{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,o){}removeEventListener(e,n,o){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,o,a){return n=Math.max(0,n||e.width),o=o||e.height,{width:n,height:Math.max(0,a?Math.floor(n/a):o)}}isAttached(e){return!0}updateConfig(e){}}class Fh extends _s{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ai="$chartjs",Wh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ys=t=>t===null||t==="";function Hh(t,e){const n=t.style,o=t.getAttribute("height"),a=t.getAttribute("width");if(t[ai]={initial:{height:o,width:a,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ys(a)){const s=ja(t,"width");s!==void 0&&(t.width=s)}if(ys(o))if(t.style.height==="")t.height=t.width/(e||2);else{const s=ja(t,"height");s!==void 0&&(t.height=s)}return t}const ks=ju?{passive:!0}:!1;function jh(t,e,n){t&&t.addEventListener(e,n,ks)}function Yh(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,ks)}function Uh(t,e){const n=Wh[t.type]||t.type,{x:o,y:a}=It(t,e);return{type:n,chart:e,native:t,x:o!==void 0?o:null,y:a!==void 0?a:null}}function si(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Xh(t,e,n){const o=t.canvas,a=new MutationObserver(s=>{let l=!1;for(const r of s)l=l||si(r.addedNodes,o),l=l&&!si(r.removedNodes,o);l&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}function Kh(t,e,n){const o=t.canvas,a=new MutationObserver(s=>{let l=!1;for(const r of s)l=l||si(r.removedNodes,o),l=l&&!si(r.addedNodes,o);l&&n()});return a.observe(document,{childList:!0,subtree:!0}),a}const yn=new Map;let xs=0;function ws(){const t=window.devicePixelRatio;t!==xs&&(xs=t,yn.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function qh(t,e){yn.size||window.addEventListener("resize",ws),yn.set(t,e)}function Gh(t){yn.delete(t),yn.size||window.removeEventListener("resize",ws)}function Jh(t,e,n){const o=t.canvas,a=o&&no(o);if(!a)return;const s=Ba((r,c)=>{const d=a.clientWidth;n(r,c),d<a.clientWidth&&n()},window),l=new ResizeObserver(r=>{const c=r[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return l.observe(a),qh(t,s),l}function ho(t,e,n){n&&n.disconnect(),e==="resize"&&Gh(t)}function Zh(t,e,n){const o=t.canvas,a=Ba(s=>{t.ctx!==null&&n(Uh(s,t))},t);return jh(o,e,a),a}class Qh extends _s{acquireContext(e,n){const o=e&&e.getContext&&e.getContext("2d");return o&&o.canvas===e?(Hh(e,n),o):null}releaseContext(e){const n=e.canvas;if(!n[ai])return!1;const o=n[ai].initial;["height","width"].forEach(s=>{const l=o[s];ae(l)?n.removeAttribute(s):n.setAttribute(s,l)});const a=o.style||{};return Object.keys(a).forEach(s=>{n.style[s]=a[s]}),n.width=n.width,delete n[ai],!0}addEventListener(e,n,o){this.removeEventListener(e,n);const a=e.$proxies||(e.$proxies={}),l={attach:Xh,detach:Kh,resize:Jh}[n]||Zh;a[n]=l(e,n,o)}removeEventListener(e,n){const o=e.$proxies||(e.$proxies={}),a=o[n];if(!a)return;({attach:ho,detach:ho,resize:ho}[n]||Yh)(e,n,a),o[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,o,a){return Hu(e,n,o,a)}isAttached(e){const n=e&&no(e);return!!(n&&n.isConnected)}}function ef(t){return!to()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?Fh:Qh}class et{constructor(){W(this,"x");W(this,"y");W(this,"active",!1);W(this,"options");W(this,"$animations")}tooltipPosition(e){const{x:n,y:o}=this.getProps(["x","y"],e);return{x:n,y:o}}hasValue(){return jt(this.x)&&jt(this.y)}getProps(e,n){const o=this.$animations;if(!n||!o)return this;const a={};return e.forEach(s=>{a[s]=o[s]&&o[s].active()?o[s]._to:this[s]}),a}}W(et,"defaults",{}),W(et,"defaultRoutes");function tf(t,e){const n=t.options.ticks,o=nf(t),a=Math.min(n.maxTicksLimit||o,o),s=n.major.enabled?af(e):[],l=s.length,r=s[0],c=s[l-1],d=[];if(l>a)return sf(e,d,s,l/a),d;const u=of(s,e,a);if(l>0){let h,f;const m=l>1?Math.round((c-r)/(l-1)):null;for(li(e,d,u,ae(m)?0:r-m,r),h=0,f=l-1;h<f;h++)li(e,d,u,s[h],s[h+1]);return li(e,d,u,c,ae(m)?e.length:c+m),d}return li(e,d,u),d}function nf(t){const e=t.options.offset,n=t._tickSize(),o=t._length/n+(e?0:1),a=t._maxLength/n;return Math.floor(Math.min(o,a))}function of(t,e,n){const o=lf(t),a=e.length/n;if(!o)return Math.max(a,1);const s=Ud(o);for(let l=0,r=s.length-1;l<r;l++){const c=s[l];if(c>a)return c}return Math.max(a,1)}function af(t){const e=[];let n,o;for(n=0,o=t.length;n<o;n++)t[n].major&&e.push(n);return e}function sf(t,e,n,o){let a=0,s=n[0],l;for(o=Math.ceil(o),l=0;l<t.length;l++)l===s&&(e.push(t[l]),a++,s=n[a*o])}function li(t,e,n,o,a){const s=ie(o,0),l=Math.min(ie(a,t.length),t.length);let r=0,c,d,u;for(n=Math.ceil(n),a&&(c=a-o,n=c/Math.floor(c/n)),u=s;u<0;)r++,u=Math.round(s+r*n);for(d=Math.max(s,0);d<l;d++)d===u&&(e.push(t[d]),r++,u=Math.round(s+r*n))}function lf(t){const e=t.length;let n,o;if(e<2)return!1;for(o=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==o)return!1;return o}const rf=t=>t==="left"?"right":t==="right"?"left":t,Cs=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,Bs=(t,e)=>Math.min(e||t,t);function Ss(t,e){const n=[],o=t.length/e,a=t.length;let s=0;for(;s<a;s+=o)n.push(t[Math.floor(s)]);return n}function cf(t,e,n){const o=t.ticks.length,a=Math.min(e,o-1),s=t._startPixel,l=t._endPixel,r=1e-6;let c=t.getPixelForTick(a),d;if(!(n&&(o===1?d=Math.max(c-s,l-c):e===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(a-1))/2,c+=a<e?d:-d,c<s-r||c>l+r)))return c}function df(t,e){pe(t,n=>{const o=n.gc,a=o.length/2;let s;if(a>e){for(s=0;s<a;++s)delete n.data[o[s]];o.splice(0,a)}})}function kn(t){return t.drawTicks?t.tickLength:0}function Es(t,e){if(!t.display)return 0;const n=$e(t.font,e),o=We(t.padding);return(Se(t.text)?t.text.length:1)*n.lineHeight+o.height}function uf(t,e){return kt(t,{scale:e,type:"scale"})}function hf(t,e,n){return kt(t,{tick:n,index:e,type:"tick"})}function ff(t,e,n){let o=Yi(t);return(n&&e!=="right"||!n&&e==="right")&&(o=rf(o)),o}function mf(t,e,n,o){const{top:a,left:s,bottom:l,right:r,chart:c}=t,{chartArea:d,scales:u}=c;let h=0,f,m,p;const g=l-a,b=r-s;if(t.isHorizontal()){if(m=Fe(o,s,r),se(n)){const _=Object.keys(n)[0],k=n[_];p=u[_].getPixelForValue(k)+g-e}else n==="center"?p=(d.bottom+d.top)/2+g-e:p=Cs(t,n,e);f=r-s}else{if(se(n)){const _=Object.keys(n)[0],k=n[_];m=u[_].getPixelForValue(k)-b+e}else n==="center"?m=(d.left+d.right)/2-b+e:m=Cs(t,n,e);p=Fe(o,l,a),h=n==="left"?-Ve:Ve}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class Pt extends et{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:o,_suggestedMax:a}=this;return e=qe(e,Number.POSITIVE_INFINITY),n=qe(n,Number.NEGATIVE_INFINITY),o=qe(o,Number.POSITIVE_INFINITY),a=qe(a,Number.NEGATIVE_INFINITY),{min:qe(e,o),max:qe(n,a),minDefined:Me(e),maxDefined:Me(n)}}getMinMax(e){let{min:n,max:o,minDefined:a,maxDefined:s}=this.getUserBounds(),l;if(a&&s)return{min:n,max:o};const r=this.getMatchingVisibleMetas();for(let c=0,d=r.length;c<d;++c)l=r[c].controller.getMinMax(this,e),a||(n=Math.min(n,l.min)),s||(o=Math.max(o,l.max));return n=s&&n>o?o:n,o=a&&n>o?n:o,{min:qe(n,qe(o,n)),max:qe(o,qe(n,o))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ke(this.options.beforeUpdate,[this])}update(e,n,o){const{beginAtZero:a,grace:s,ticks:l}=this.options,r=l.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,this._margins=o=Object.assign({left:0,right:0,top:0,bottom:0},o),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+o.left+o.right:this.height+o.top+o.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=xu(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=r<this.ticks.length;this._convertTicksToLabels(c?Ss(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),l.display&&(l.autoSkip||l.source==="auto")&&(this.ticks=tf(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,o;this.isHorizontal()?(n=this.left,o=this.right):(n=this.top,o=this.bottom,e=!e),this._startPixel=n,this._endPixel=o,this._reversePixels=e,this._length=o-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ke(this.options.afterUpdate,[this])}beforeSetDimensions(){ke(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){ke(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ke(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ke(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let o,a,s;for(o=0,a=e.length;o<a;o++)s=e[o],s.label=ke(n.callback,[s.value,o,e],this)}afterTickToLabelConversion(){ke(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ke(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,o=Bs(this.ticks.length,e.ticks.maxTicksLimit),a=n.minRotation||0,s=n.maxRotation;let l=a,r,c,d;if(!this._isVisible()||!n.display||a>=s||o<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Ie(this.chart.width-h,0,this.maxWidth);r=e.offset?this.maxWidth/o:m/(o-1),h+6>r&&(r=m/(o-(e.offset?.5:1)),c=this.maxHeight-kn(e.grid)-n.padding-Es(e.title,this.chart.options.font),d=Math.sqrt(h*h+f*f),l=Wi(Math.min(Math.asin(Ie((u.highest.height+6)/r,-1,1)),Math.asin(Ie(c/d,-1,1))-Math.asin(Ie(f/d,-1,1)))),l=Math.max(a,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){ke(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ke(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:o,title:a,grid:s}}=this,l=this._isVisible(),r=this.isHorizontal();if(l){const c=Es(a,n.options.font);if(r?(e.width=this.maxWidth,e.height=kn(s)+c):(e.height=this.maxHeight,e.width=kn(s)+c),o.display&&this.ticks.length){const{first:d,last:u,widest:h,highest:f}=this._getLabelSizes(),m=o.padding*2,p=Ze(this.labelRotation),g=Math.cos(p),b=Math.sin(p);if(r){const _=o.mirror?0:b*h.width+g*f.height;e.height=Math.min(this.maxHeight,e.height+_+m)}else{const _=o.mirror?0:g*h.width+b*f.height;e.width=Math.min(this.maxWidth,e.width+_+m)}this._calculatePadding(d,u,b,g)}}this._handleMargins(),r?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,o,a){const{ticks:{align:s,padding:l},position:r}=this.options,c=this.labelRotation!==0,d=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;c?d?(f=a*e.width,m=o*n.height):(f=o*e.height,m=a*n.width):s==="start"?m=n.width:s==="end"?f=e.width:s!=="inner"&&(f=e.width/2,m=n.width/2),this.paddingLeft=Math.max((f-u+l)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+l)*this.width/(this.width-h),0)}else{let u=n.height/2,h=e.height/2;s==="start"?(u=0,h=e.height):s==="end"&&(u=n.height,h=0),this.paddingTop=u+l,this.paddingBottom=h+l}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ke(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,o;for(n=0,o=e.length;n<o;n++)ae(e[n].label)&&(e.splice(n,1),o--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let o=this.ticks;n<o.length&&(o=Ss(o,n)),this._labelSizes=e=this._computeLabelSizes(o,o.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,o){const{ctx:a,_longestTextCache:s}=this,l=[],r=[],c=Math.floor(n/Bs(n,o));let d=0,u=0,h,f,m,p,g,b,_,k,B,C,y;for(h=0;h<n;h+=c){if(p=e[h].label,g=this._resolveTickFontOptions(h),a.font=b=g.string,_=s[b]=s[b]||{data:{},gc:[]},k=g.lineHeight,B=C=0,!ae(p)&&!Se(p))B=Yn(a,_.data,_.gc,B,p),C=k;else if(Se(p))for(f=0,m=p.length;f<m;++f)y=p[f],!ae(y)&&!Se(y)&&(B=Yn(a,_.data,_.gc,B,y),C+=k);l.push(B),r.push(C),d=Math.max(B,d),u=Math.max(C,u)}df(s,n);const x=l.indexOf(d),S=r.indexOf(u),w=M=>({width:l[M]||0,height:r[M]||0});return{first:w(0),last:w(n-1),widest:w(x),highest:w(S),widths:l,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return Gd(this._alignToPixels?Vt(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const o=n[e];return o.$context||(o.$context=hf(this.getContext(),e,o))}return this.$context||(this.$context=uf(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=Ze(this.labelRotation),o=Math.abs(Math.cos(n)),a=Math.abs(Math.sin(n)),s=this._getLabelSizes(),l=e.autoSkipPadding||0,r=s?s.widest.width+l:0,c=s?s.highest.height+l:0;return this.isHorizontal()?c*o>r*a?r/o:c/a:c*a<r*o?c/o:r/a}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=this.axis,o=this.chart,a=this.options,{grid:s,position:l,border:r}=a,c=s.offset,d=this.isHorizontal(),h=this.ticks.length+(c?1:0),f=kn(s),m=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,b=g/2,_=function(R){return Vt(o,R,g)};let k,B,C,y,x,S,w,M,N,T,$,K;if(l==="top")k=_(this.bottom),S=this.bottom-f,M=k-b,T=_(e.top)+b,K=e.bottom;else if(l==="bottom")k=_(this.top),T=e.top,K=_(e.bottom)-b,S=k+b,M=this.top+f;else if(l==="left")k=_(this.right),x=this.right-f,w=k-b,N=_(e.left)+b,$=e.right;else if(l==="right")k=_(this.left),N=e.left,$=_(e.right)-b,x=k+b,w=this.left+f;else if(n==="x"){if(l==="center")k=_((e.top+e.bottom)/2+.5);else if(se(l)){const R=Object.keys(l)[0],q=l[R];k=_(this.chart.scales[R].getPixelForValue(q))}T=e.top,K=e.bottom,S=k+b,M=S+f}else if(n==="y"){if(l==="center")k=_((e.left+e.right)/2);else if(se(l)){const R=Object.keys(l)[0],q=l[R];k=_(this.chart.scales[R].getPixelForValue(q))}x=k-b,w=x-f,N=e.left,$=e.right}const P=ie(a.ticks.maxTicksLimit,h),A=Math.max(1,Math.ceil(h/P));for(B=0;B<h;B+=A){const R=this.getContext(B),q=s.setContext(R),Q=r.setContext(R),ee=q.lineWidth,ge=q.color,fe=Q.dash||[],be=Q.dashOffset,xe=q.tickWidth,F=q.tickColor,v=q.tickBorderDash||[],D=q.tickBorderDashOffset;C=cf(this,B,c),C!==void 0&&(y=Vt(o,C,ee),d?x=w=N=$=y:S=M=T=K=y,m.push({tx1:x,ty1:S,tx2:w,ty2:M,x1:N,y1:T,x2:$,y2:K,width:ee,color:ge,borderDash:fe,borderDashOffset:be,tickWidth:xe,tickColor:F,tickBorderDash:v,tickBorderDashOffset:D}))}return this._ticksLength=h,this._borderValue=k,m}_computeLabelItems(e){const n=this.axis,o=this.options,{position:a,ticks:s}=o,l=this.isHorizontal(),r=this.ticks,{align:c,crossAlign:d,padding:u,mirror:h}=s,f=kn(o.grid),m=f+u,p=h?-u:m,g=-Ze(this.labelRotation),b=[];let _,k,B,C,y,x,S,w,M,N,T,$,K="middle";if(a==="top")x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(a==="bottom")x=this.top+p,S=this._getXAxisLabelAlignment();else if(a==="left"){const A=this._getYAxisLabelAlignment(f);S=A.textAlign,y=A.x}else if(a==="right"){const A=this._getYAxisLabelAlignment(f);S=A.textAlign,y=A.x}else if(n==="x"){if(a==="center")x=(e.top+e.bottom)/2+m;else if(se(a)){const A=Object.keys(a)[0],R=a[A];x=this.chart.scales[A].getPixelForValue(R)+m}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(a==="center")y=(e.left+e.right)/2-m;else if(se(a)){const A=Object.keys(a)[0],R=a[A];y=this.chart.scales[A].getPixelForValue(R)}S=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(c==="start"?K="top":c==="end"&&(K="bottom"));const P=this._getLabelSizes();for(_=0,k=r.length;_<k;++_){B=r[_],C=B.label;const A=s.setContext(this.getContext(_));w=this.getPixelForTick(_)+s.labelOffset,M=this._resolveTickFontOptions(_),N=M.lineHeight,T=Se(C)?C.length:1;const R=T/2,q=A.color,Q=A.textStrokeColor,ee=A.textStrokeWidth;let ge=S;l?(y=w,S==="inner"&&(_===k-1?ge=this.options.reverse?"left":"right":_===0?ge=this.options.reverse?"right":"left":ge="center"),a==="top"?d==="near"||g!==0?$=-T*N+N/2:d==="center"?$=-P.highest.height/2-R*N+N:$=-P.highest.height+N/2:d==="near"||g!==0?$=N/2:d==="center"?$=P.highest.height/2-R*N:$=P.highest.height-T*N,h&&($*=-1),g!==0&&!A.showLabelBackdrop&&(y+=N/2*Math.sin(g))):(x=w,$=(1-T)*N/2);let fe;if(A.showLabelBackdrop){const be=We(A.backdropPadding),xe=P.heights[_],F=P.widths[_];let v=$-be.top,D=0-be.left;switch(K){case"middle":v-=xe/2;break;case"bottom":v-=xe;break}switch(S){case"center":D-=F/2;break;case"right":D-=F;break;case"inner":_===k-1?D-=F:_>0&&(D-=F/2);break}fe={left:D,top:v,width:F+be.width,height:xe+be.height,color:A.backdropColor}}b.push({label:C,font:M,textOffset:$,options:{rotation:g,color:q,strokeColor:Q,strokeWidth:ee,textAlign:ge,textBaseline:K,translation:[y,x],backdrop:fe}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-Ze(this.labelRotation))return e==="top"?"left":"right";let a="center";return n.align==="start"?a="left":n.align==="end"?a="right":n.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:o,mirror:a,padding:s}}=this.options,l=this._getLabelSizes(),r=e+s,c=l.widest.width;let d,u;return n==="left"?a?(u=this.right+s,o==="near"?d="left":o==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-r,o==="near"?d="right":o==="center"?(d="center",u-=c/2):(d="left",u=this.left)):n==="right"?a?(u=this.left+s,o==="near"?d="right":o==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+r,o==="near"?d="left":o==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:o,top:a,width:s,height:l}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(o,a,s,l),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const a=this.ticks.findIndex(s=>s.value===e);return a>=0?n.setContext(this.getContext(a)).lineWidth:0}drawGrid(e){const n=this.options.grid,o=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,l;const r=(c,d,u)=>{!u.width||!u.color||(o.save(),o.lineWidth=u.width,o.strokeStyle=u.color,o.setLineDash(u.borderDash||[]),o.lineDashOffset=u.borderDashOffset,o.beginPath(),o.moveTo(c.x,c.y),o.lineTo(d.x,d.y),o.stroke(),o.restore())};if(n.display)for(s=0,l=a.length;s<l;++s){const c=a[s];n.drawOnChartArea&&r({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&r({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:n,options:{border:o,grid:a}}=this,s=o.setContext(this.getContext()),l=o.display?s.width:0;if(!l)return;const r=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,h,f;this.isHorizontal()?(d=Vt(e,this.left,l)-l/2,u=Vt(e,this.right,r)+r/2,h=f=c):(h=Vt(e,this.top,l)-l/2,f=Vt(e,this.bottom,r)+r/2,d=u=c),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(d,h),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const o=this.ctx,a=this._computeLabelArea();a&&Un(o,a);const s=this.getLabelItems(e);for(const l of s){const r=l.options,c=l.font,d=l.label,u=l.textOffset;Dt(o,d,0,u,c,r)}a&&Xn(o)}drawTitle(){const{ctx:e,options:{position:n,title:o,reverse:a}}=this;if(!o.display)return;const s=$e(o.font),l=We(o.padding),r=o.align;let c=s.lineHeight/2;n==="bottom"||n==="center"||se(n)?(c+=l.bottom,Se(o.text)&&(c+=s.lineHeight*(o.text.length-1))):c+=l.top;const{titleX:d,titleY:u,maxWidth:h,rotation:f}=mf(this,c,n,r);Dt(e,o.text,0,0,s,{color:o.color,maxWidth:h,rotation:f,textAlign:ff(r,n,a),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,o=ie(e.grid&&e.grid.z,-1),a=ie(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Pt.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:o,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),o=this.axis+"AxisID",a=[];let s,l;for(s=0,l=n.length;s<l;++s){const r=n[s];r[o]===this.id&&(!e||r.type===e)&&a.push(r)}return a}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return $e(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ri{constructor(e,n,o){this.type=e,this.scope=n,this.override=o,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let o;bf(n)&&(o=this.register(n));const a=this.items,s=e.id,l=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in a||(a[s]=e,pf(e,l,o),this.override&&Ee.override(e.id,e.overrides)),l}get(e){return this.items[e]}unregister(e){const n=this.items,o=e.id,a=this.scope;o in n&&delete n[o],a&&o in Ee[a]&&(delete Ee[a][o],this.override&&delete vt[o])}}function pf(t,e,n){const o=on(Object.create(null),[n?Ee.get(n):{},Ee.get(e),t.defaults]);Ee.set(e,o),t.defaultRoutes&&gf(e,t.defaultRoutes),t.descriptors&&Ee.describe(e,t.descriptors)}function gf(t,e){Object.keys(e).forEach(n=>{const o=n.split("."),a=o.pop(),s=[t].concat(o).join("."),l=e[n].split("."),r=l.pop(),c=l.join(".");Ee.route(s,a,c,r)})}function bf(t){return"id"in t&&"defaults"in t}class _f{constructor(){this.controllers=new ri(Qe,"datasets",!0),this.elements=new ri(et,"elements"),this.plugins=new ri(Object,"plugins"),this.scales=new ri(Pt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,o){[...n].forEach(a=>{const s=o||this._getRegistryForType(a);o||s.isForType(a)||s===this.plugins&&a.id?this._exec(e,s,a):pe(a,l=>{const r=o||this._getRegistryForType(l);this._exec(e,r,l)})})}_exec(e,n,o){const a=Fi(e);ke(o["before"+a],[],o),n[e](o),ke(o["after"+a],[],o)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const o=this._typedRegistries[n];if(o.isForType(e))return o}return this.plugins}_get(e,n,o){const a=n.get(e);if(a===void 0)throw new Error('"'+e+'" is not a registered '+o+".");return a}}var it=new _f;class yf{constructor(){this._init=void 0}notify(e,n,o,a){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const s=a?this._descriptors(e).filter(a):this._descriptors(e),l=this._notify(s,e,n,o);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),l}_notify(e,n,o,a){a=a||{};for(const s of e){const l=s.plugin,r=l[o],c=[n,a,s.options];if(ke(r,c,l)===!1&&a.cancelable)return!1}return!0}invalidate(){ae(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const o=e&&e.config,a=ie(o.options&&o.options.plugins,{}),s=kf(o);return a===!1&&!n?[]:wf(e,s,a,n)}_notifyStateChanges(e){const n=this._oldCache||[],o=this._cache,a=(s,l)=>s.filter(r=>!l.some(c=>r.plugin.id===c.plugin.id));this._notify(a(n,o),e,"stop"),this._notify(a(o,n),e,"start")}}function kf(t){const e={},n=[],o=Object.keys(it.plugins.items);for(let s=0;s<o.length;s++)n.push(it.getPlugin(o[s]));const a=t.plugins||[];for(let s=0;s<a.length;s++){const l=a[s];n.indexOf(l)===-1&&(n.push(l),e[l.id]=!0)}return{plugins:n,localIds:e}}function xf(t,e){return!e&&t===!1?null:t===!0?{}:t}function wf(t,{plugins:e,localIds:n},o,a){const s=[],l=t.getContext();for(const r of e){const c=r.id,d=xf(o[c],a);d!==null&&s.push({plugin:r,options:Cf(t.config,{plugin:r,local:n[c]},d,l)})}return s}function Cf(t,{plugin:e,local:n},o,a){const s=t.pluginScopeKeys(e),l=t.getOptionScopes(o,s);return n&&e.defaults&&l.push(e.defaults),t.createResolver(l,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function fo(t,e){const n=Ee.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Bf(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function Sf(t,e){return t===e?"_index_":"_value_"}function Ms(t){if(t==="x"||t==="y"||t==="r")return t}function Ef(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function mo(t,...e){if(Ms(t))return t;for(const n of e){const o=n.axis||Ef(n.position)||t.length>1&&Ms(t[0].toLowerCase());if(o)return o}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function vs(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function Mf(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(o=>o.xAxisID===t||o.yAxisID===t);if(n.length)return vs(t,"x",n[0])||vs(t,"y",n[0])}return{}}function vf(t,e){const n=vt[t.type]||{scales:{}},o=e.scales||{},a=fo(t.type,e),s=Object.create(null);return Object.keys(o).forEach(l=>{const r=o[l];if(!se(r))return console.error(`Invalid scale configuration for scale: ${l}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const c=mo(l,r,Mf(l,t),Ee.scales[r.type]),d=Sf(c,a),u=n.scales||{};s[l]=an(Object.create(null),[{axis:c},r,u[c],u[d]])}),t.data.datasets.forEach(l=>{const r=l.type||t.type,c=l.indexAxis||fo(r,e),u=(vt[r]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Bf(h,c),m=l[f+"AxisID"]||f;s[m]=s[m]||Object.create(null),an(s[m],[{axis:f},o[m],u[h]])})}),Object.keys(s).forEach(l=>{const r=s[l];an(r,[Ee.scales[r.type],Ee.scale])}),s}function Vs(t){const e=t.options||(t.options={});e.plugins=ie(e.plugins,{}),e.scales=vf(t,e)}function Ds(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Vf(t){return t=t||{},t.data=Ds(t.data),Vs(t),t}const $s=new Map,Ts=new Set;function ci(t,e){let n=$s.get(t);return n||(n=e(),$s.set(t,n),Ts.add(n)),n}const xn=(t,e,n)=>{const o=bt(e,n);o!==void 0&&t.add(o)};class Df{constructor(e){this._config=Vf(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Ds(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Vs(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ci(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return ci(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return ci(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,o=this.type;return ci(`${o}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const o=this._scopeCache;let a=o.get(e);return(!a||n)&&(a=new Map,o.set(e,a)),a}getOptionScopes(e,n,o){const{options:a,type:s}=this,l=this._cachedScopes(e,o),r=l.get(n);if(r)return r;const c=new Set;n.forEach(u=>{e&&(c.add(e),u.forEach(h=>xn(c,e,h))),u.forEach(h=>xn(c,a,h)),u.forEach(h=>xn(c,vt[s]||{},h)),u.forEach(h=>xn(c,Ee,h)),u.forEach(h=>xn(c,Ki,h))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Ts.has(n)&&l.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,vt[n]||{},Ee.datasets[n]||{},{type:n},Ee,Ki]}resolveNamedOptions(e,n,o,a=[""]){const s={$shared:!0},{resolver:l,subPrefixes:r}=Is(this._resolverCache,e,a);let c=l;if(Tf(l,n)){s.$shared=!1,o=_t(o)?o():o;const d=this.createResolver(e,o,r);c=Yt(l,o,d)}for(const d of n)s[d]=c[d];return s}createResolver(e,n,o=[""],a){const{resolver:s}=Is(this._resolverCache,e,o);return se(n)?Yt(s,n,void 0,a):s}}function Is(t,e,n){let o=t.get(e);o||(o=new Map,t.set(e,o));const a=n.join();let s=o.get(a);return s||(s={resolver:Zi(e,n),subPrefixes:n.filter(r=>!r.toLowerCase().includes("hover"))},o.set(a,s)),s}const $f=t=>se(t)&&Object.getOwnPropertyNames(t).some(e=>_t(t[e]));function Tf(t,e){const{isScriptable:n,isIndexable:o}=za(t);for(const a of e){const s=n(a),l=o(a),r=(l||s)&&t[a];if(s&&(_t(r)||$f(r))||l&&Se(r))return!0}return!1}var If="4.5.1";const Lf=["top","bottom","left","right","chartArea"];function Ls(t,e){return t==="top"||t==="bottom"||Lf.indexOf(t)===-1&&e==="x"}function zs(t,e){return function(n,o){return n[t]===o[t]?n[e]-o[e]:n[t]-o[t]}}function Ns(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),ke(n&&n.onComplete,[t],e)}function zf(t){const e=t.chart,n=e.options.animation;ke(n&&n.onProgress,[t],e)}function Ps(t){return to()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const di={},As=t=>{const e=Ps(t);return Object.values(di).filter(n=>n.canvas===e).pop()};function Nf(t,e,n){const o=Object.keys(t);for(const a of o){const s=+a;if(s>=e){const l=t[a];delete t[a],(n>0||s>e)&&(t[s+n]=l)}}}function Pf(t,e,n,o){return!n||t.type==="mouseout"?null:o?e:t}class ut{static register(...e){it.add(...e),Rs()}static unregister(...e){it.remove(...e),Rs()}constructor(e,n){const o=this.config=new Df(n),a=Ps(e),s=As(a);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const l=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||ef(a)),this.platform.updateConfig(o);const r=this.platform.acquireContext(a,l.aspectRatio),c=r&&r.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Pd(),this.ctx=r,this.canvas=c,this.width=u,this.height=d,this._options=l,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new yf,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=eu(h=>this.update(h),l.resizeDelay||0),this._dataChanges=[],di[this.id]=this,!r||!c){console.error("Failed to create chart: can't acquire context from the given item");return}dt.listen(this,"complete",Ns),dt.listen(this,"progress",zf),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:o,height:a,_aspectRatio:s}=this;return ae(e)?n&&s?s:a?o/a:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return it}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ha(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ta(this.canvas,this.ctx),this}stop(){return dt.stop(this),this}resize(e,n){dt.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const o=this.options,a=this.canvas,s=o.maintainAspectRatio&&this.aspectRatio,l=this.platform.getMaximumSize(a,e,n,s),r=o.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=l.width,this.height=l.height,this._aspectRatio=this.aspectRatio,Ha(this,r,!0)&&(this.notifyPlugins("resize",{size:l}),ke(o.onResize,[this,l],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};pe(n,(o,a)=>{o.id=a})}buildOrUpdateScales(){const e=this.options,n=e.scales,o=this.scales,a=Object.keys(o).reduce((l,r)=>(l[r]=!1,l),{});let s=[];n&&(s=s.concat(Object.keys(n).map(l=>{const r=n[l],c=mo(l,r),d=c==="r",u=c==="x";return{options:r,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),pe(s,l=>{const r=l.options,c=r.id,d=mo(c,r),u=ie(r.type,l.dtype);(r.position===void 0||Ls(r.position,d)!==Ls(l.dposition))&&(r.position=l.dposition),a[c]=!0;let h=null;if(c in o&&o[c].type===u)h=o[c];else{const f=it.getScale(u);h=new f({id:c,type:u,ctx:this.ctx,chart:this}),o[h.id]=h}h.init(r,e)}),pe(a,(l,r)=>{l||delete o[r]}),pe(o,l=>{He.configure(this,l,l.options),He.addBox(this,l)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,o=e.length;if(e.sort((a,s)=>a.index-s.index),o>n){for(let a=n;a<o;++a)this._destroyDatasetMeta(a);e.splice(n,o-n)}this._sortedMetasets=e.slice(0).sort(zs("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((o,a)=>{n.filter(s=>s===o._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let o,a;for(this._removeUnreferencedMetasets(),o=0,a=n.length;o<a;o++){const s=n[o];let l=this.getDatasetMeta(o);const r=s.type||this.config.type;if(l.type&&l.type!==r&&(this._destroyDatasetMeta(o),l=this.getDatasetMeta(o)),l.type=r,l.indexAxis=s.indexAxis||fo(r,this.options),l.order=s.order||0,l.index=o,l.label=""+s.label,l.visible=this.isDatasetVisible(o),l.controller)l.controller.updateIndex(o),l.controller.linkScales();else{const c=it.getController(r),{datasetElementType:d,dataElementType:u}=Ee.datasets[r];Object.assign(c,{dataElementType:it.getElement(u),datasetElementType:d&&it.getElement(d)}),l.controller=new c(this,o),e.push(l.controller)}}return this._updateMetasets(),e}_resetElements(){pe(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const o=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!o.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let l=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:h}=this.getDatasetMeta(d),f=!a&&s.indexOf(h)===-1;h.buildOrUpdateElements(f),l=Math.max(+h.getMaxOverflow(),l)}l=this._minPadding=o.layout.autoPadding?l:0,this._updateLayout(l),a||pe(s,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(zs("z","_idx"));const{_active:r,_lastEvent:c}=this;c?this._eventHandler(c,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){pe(this.scales,e=>{He.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),o=new Set(e.events);(!ma(n,o)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:o,start:a,count:s}of n){const l=o==="_removeElements"?-s:s;Nf(e,a,l)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,o=s=>new Set(e.filter(l=>l[0]===s).map((l,r)=>r+","+l.splice(1).join(","))),a=o(0);for(let s=1;s<n;s++)if(!ma(a,o(s)))return;return Array.from(a).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;He.update(this,this.width,this.height,e);const n=this.chartArea,o=n.width<=0||n.height<=0;this._layers=[],pe(this.boxes,a=>{o&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,o=this.data.datasets.length;n<o;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,o=this.data.datasets.length;n<o;++n)this._updateDataset(n,_t(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const o=this.getDatasetMeta(e),a={meta:o,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(o.controller._update(n),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(dt.has(this)?this.attached&&!dt.running(this)&&dt.start(this):(this.draw(),Ns({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:o,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(o,a)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,o=[];let a,s;for(a=0,s=n.length;a<s;++a){const l=n[a];(!e||l.visible)&&o.push(l)}return o}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,o={meta:e,index:e.index,cancelable:!0},a=Qa(this,e);this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(a&&Un(n,a),e.controller.draw(),a&&Xn(n),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ct(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,o,a){const s=Ih.modes[n];return typeof s=="function"?s(this,e,o,a):[]}getDatasetMeta(e){const n=this.data.datasets[e],o=this._metasets;let a=o.filter(s=>s&&s._dataset===n).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_parsed:[],_sorted:!1},o.push(a)),a}getContext(){return this.$context||(this.$context=kt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const n=this.data.datasets[e];if(!n)return!1;const o=this.getDatasetMeta(e);return typeof o.hidden=="boolean"?!o.hidden:!n.hidden}setDatasetVisibility(e,n){const o=this.getDatasetMeta(e);o.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,o){const a=o?"show":"hide",s=this.getDatasetMeta(e),l=s.controller._resolveAnimations(void 0,a);sn(n)?(s.data[n].hidden=!o,this.update()):(this.setDatasetVisibility(e,o),l.update(s,{visible:o}),this.update(r=>r.datasetIndex===e?a:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),dt.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Ta(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete di[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,o=(s,l)=>{n.addEventListener(this,s,l),e[s]=l},a=(s,l,r)=>{s.offsetX=l,s.offsetY=r,this._eventHandler(s)};pe(this.options.events,s=>o(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,o=(c,d)=>{n.addEventListener(this,c,d),e[c]=d},a=(c,d)=>{e[c]&&(n.removeEventListener(this,c,d),delete e[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let l;const r=()=>{a("attach",r),this.attached=!0,this.resize(),o("resize",s),o("detach",l)};l=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),o("attach",r)},n.isAttached(this.canvas)?r():l()}unbindEvents(){pe(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},pe(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,o){const a=o?"set":"remove";let s,l,r,c;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),r=0,c=e.length;r<c;++r){l=e[r];const d=l&&this.getDatasetMeta(l.datasetIndex).controller;d&&d[a+"HoverStyle"](l.element,l.datasetIndex,l.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],o=e.map(({datasetIndex:s,index:l})=>{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[l],index:l}});!On(o,n)&&(this._active=o,this._lastEvent=null,this._updateHoverStyles(o,n))}notifyPlugins(e,n,o){return this._plugins.notify(this,e,n,o)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,o){const a=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),l=s(n,e),r=o?e:s(e,n);l.length&&this.updateHoverStyle(l,a.mode,!1),r.length&&a.mode&&this.updateHoverStyle(r,a.mode,!0)}_eventHandler(e,n){const o={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},a=l=>(l.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",o,a)===!1)return;const s=this._handleEvent(e,n,o.inChartArea);return o.cancelable=!1,this.notifyPlugins("afterEvent",o,a),(s||o.changed)&&this.render(),this}_handleEvent(e,n,o){const{_active:a=[],options:s}=this,l=n,r=this._getActiveElements(e,a,o,l),c=Hd(e),d=Pf(e,this._lastEvent,o,c);o&&(this._lastEvent=null,ke(s.onHover,[e,r,this],this),c&&ke(s.onClick,[e,r,this],this));const u=!On(r,a);return(u||n)&&(this._active=r,this._updateHoverStyles(r,a,n)),this._lastEvent=d,u}_getActiveElements(e,n,o,a){if(e.type==="mouseout")return[];if(!o)return n;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,a)}}W(ut,"defaults",Ee),W(ut,"instances",di),W(ut,"overrides",vt),W(ut,"registry",it),W(ut,"version",If),W(ut,"getChart",As);function Rs(){return pe(ut.instances,t=>t._plugins.invalidate())}function Af(t,e,n){const{startAngle:o,x:a,y:s,outerRadius:l,innerRadius:r,options:c}=e,{borderWidth:d,borderJoinStyle:u}=c,h=Math.min(d/l,Oe(o-n));if(t.beginPath(),t.arc(a,s,l-d/2,o+h/2,n-h/2),r>0){const f=Math.min(d/r,Oe(o-n));t.arc(a,s,r+d/2,n-f/2,o+f/2,!0)}else{const f=Math.min(d/2,l*Oe(o-n));if(u==="round")t.arc(a,s,f,n-de/2,o+de/2,!0);else if(u==="bevel"){const m=2*f*f,p=-m*Math.cos(n+de/2)+a,g=-m*Math.sin(n+de/2)+s,b=m*Math.cos(o+de/2)+a,_=m*Math.sin(o+de/2)+s;t.lineTo(p,g),t.lineTo(b,_)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function Rf(t,e,n){const{startAngle:o,pixelMargin:a,x:s,y:l,outerRadius:r,innerRadius:c}=e;let d=a/r;t.beginPath(),t.arc(s,l,r,o-d,n+d),c>a?(d=a/c,t.arc(s,l,c,n+d,o-d,!0)):t.arc(s,l,a,n+Ve,o-Ve),t.closePath(),t.clip()}function Of(t){return Ji(t,["outerStart","outerEnd","innerStart","innerEnd"])}function Ff(t,e,n,o){const a=Of(t.options.borderRadius),s=(n-e)/2,l=Math.min(s,o*e/2),r=c=>{const d=(n-Math.min(s,c))*o/2;return Ie(c,0,Math.min(s,d))};return{outerStart:r(a.outerStart),outerEnd:r(a.outerEnd),innerStart:Ie(a.innerStart,0,l),innerEnd:Ie(a.innerEnd,0,l)}}function Kt(t,e,n,o){return{x:n+t*Math.cos(e),y:o+t*Math.sin(e)}}function ui(t,e,n,o,a,s){const{x:l,y:r,startAngle:c,pixelMargin:d,innerRadius:u}=e,h=Math.max(e.outerRadius+o+n-d,0),f=u>0?u+o+n+d:0;let m=0;const p=a-c;if(o){const A=u>0?u-o:0,R=h>0?h-o:0,q=(A+R)/2,Q=q!==0?p*q/(q+o):p;m=(p-Q)/2}const g=Math.max(.001,p*h-n/de)/h,b=(p-g)/2,_=c+b+m,k=a-b-m,{outerStart:B,outerEnd:C,innerStart:y,innerEnd:x}=Ff(e,f,h,k-_),S=h-B,w=h-C,M=_+B/S,N=k-C/w,T=f+y,$=f+x,K=_+y/T,P=k-x/$;if(t.beginPath(),s){const A=(M+N)/2;if(t.arc(l,r,h,M,A),t.arc(l,r,h,A,N),C>0){const ee=Kt(w,N,l,r);t.arc(ee.x,ee.y,C,N,k+Ve)}const R=Kt($,k,l,r);if(t.lineTo(R.x,R.y),x>0){const ee=Kt($,P,l,r);t.arc(ee.x,ee.y,x,k+Ve,P+Math.PI)}const q=(k-x/f+(_+y/f))/2;if(t.arc(l,r,f,k-x/f,q,!0),t.arc(l,r,f,q,_+y/f,!0),y>0){const ee=Kt(T,K,l,r);t.arc(ee.x,ee.y,y,K+Math.PI,_-Ve)}const Q=Kt(S,_,l,r);if(t.lineTo(Q.x,Q.y),B>0){const ee=Kt(S,M,l,r);t.arc(ee.x,ee.y,B,_-Ve,M)}}else{t.moveTo(l,r);const A=Math.cos(M)*h+l,R=Math.sin(M)*h+r;t.lineTo(A,R);const q=Math.cos(N)*h+l,Q=Math.sin(N)*h+r;t.lineTo(q,Q)}t.closePath()}function Wf(t,e,n,o,a){const{fullCircles:s,startAngle:l,circumference:r}=e;let c=e.endAngle;if(s){ui(t,e,n,o,c,a);for(let d=0;d<s;++d)t.fill();isNaN(r)||(c=l+(r%Ce||Ce))}return ui(t,e,n,o,c,a),t.fill(),c}function Hf(t,e,n,o,a){const{fullCircles:s,startAngle:l,circumference:r,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=c,p=c.borderAlign==="inner";if(!d)return;t.setLineDash(h||[]),t.lineDashOffset=f,p?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let g=e.endAngle;if(s){ui(t,e,n,o,g,a);for(let b=0;b<s;++b)t.stroke();isNaN(r)||(g=l+(r%Ce||Ce))}p&&Rf(t,e,g),c.selfJoin&&g-l>=de&&m===0&&u!=="miter"&&Af(t,e,g),s||(ui(t,e,n,o,g,a),t.stroke())}class wn extends et{constructor(n){super();W(this,"circumference");W(this,"endAngle");W(this,"fullCircles");W(this,"innerRadius");W(this,"outerRadius");W(this,"pixelMargin");W(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,o,a){const s=this.getProps(["x","y"],a),{angle:l,distance:r}=ya(s,{x:n,y:o}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),m=(this.options.spacing+this.options.borderWidth)/2,p=ie(f,d-c),g=rn(l,c,d)&&c!==d,b=p>=Ce||g,_=lt(r,u+m,h+m);return b&&_}getCenterPoint(n){const{x:o,y:a,startAngle:s,endAngle:l,innerRadius:r,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:d,spacing:u}=this.options,h=(s+l)/2,f=(r+c+u+d)/2;return{x:o+Math.cos(h)*f,y:a+Math.sin(h)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:o,circumference:a}=this,s=(o.offset||0)/4,l=(o.spacing||0)/2,r=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=a>Ce?Math.floor(a/Ce):0,a===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(de,a||0)),u=s*d;n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,Wf(n,this,u,l,r),Hf(n,this,u,l,r),n.restore()}}W(wn,"id","arc"),W(wn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),W(wn,"defaultRoutes",{backgroundColor:"backgroundColor"}),W(wn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Os(t,e,n=e){t.lineCap=ie(n.borderCapStyle,e.borderCapStyle),t.setLineDash(ie(n.borderDash,e.borderDash)),t.lineDashOffset=ie(n.borderDashOffset,e.borderDashOffset),t.lineJoin=ie(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=ie(n.borderWidth,e.borderWidth),t.strokeStyle=ie(n.borderColor,e.borderColor)}function jf(t,e,n){t.lineTo(n.x,n.y)}function Yf(t){return t.stepped?hu:t.tension||t.cubicInterpolationMode==="monotone"?fu:jf}function Fs(t,e,n={}){const o=t.length,{start:a=0,end:s=o-1}=n,{start:l,end:r}=e,c=Math.max(a,l),d=Math.min(s,r),u=a<l&&s<l||a>r&&s>r;return{count:o,start:c,loop:e.loop,ilen:d<c&&!u?o+d-c:d-c}}function Uf(t,e,n,o){const{points:a,options:s}=e,{count:l,start:r,loop:c,ilen:d}=Fs(a,n,o),u=Yf(s);let{move:h=!0,reverse:f}=o||{},m,p,g;for(m=0;m<=d;++m)p=a[(r+(f?d-m:m))%l],!p.skip&&(h?(t.moveTo(p.x,p.y),h=!1):u(t,g,p,f,s.stepped),g=p);return c&&(p=a[(r+(f?d:0))%l],u(t,g,p,f,s.stepped)),!!c}function Xf(t,e,n,o){const a=e.points,{count:s,start:l,ilen:r}=Fs(a,n,o),{move:c=!0,reverse:d}=o||{};let u=0,h=0,f,m,p,g,b,_;const k=C=>(l+(d?r-C:C))%s,B=()=>{g!==b&&(t.lineTo(u,b),t.lineTo(u,g),t.lineTo(u,_))};for(c&&(m=a[k(0)],t.moveTo(m.x,m.y)),f=0;f<=r;++f){if(m=a[k(f)],m.skip)continue;const C=m.x,y=m.y,x=C|0;x===p?(y<g?g=y:y>b&&(b=y),u=(h*u+C)/++h):(B(),t.lineTo(C,y),p=x,h=0,g=b=y),_=y}B()}function po(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?Xf:Uf}function Kf(t){return t.stepped?Yu:t.tension||t.cubicInterpolationMode==="monotone"?Uu:Lt}function qf(t,e,n,o){let a=e._path;a||(a=e._path=new Path2D,e.path(a,n,o)&&a.closePath()),Os(t,e.options),t.stroke(a)}function Gf(t,e,n,o){const{segments:a,options:s}=e,l=po(e);for(const r of a)Os(t,s,r.style),t.beginPath(),l(t,e,r,{start:n,end:n+o-1})&&t.closePath(),t.stroke()}const Jf=typeof Path2D=="function";function Zf(t,e,n,o){Jf&&!e.options.segment?qf(t,e,n,o):Gf(t,e,n,o)}class wt extends et{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,n){const o=this.options;if((o.tension||o.cubicInterpolationMode==="monotone")&&!o.stepped&&!this._pointsUpdated){const a=o.spanGaps?this._loop:this._fullLoop;Pu(this._points,o,e,a,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Zu(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,o=e.length;return o&&n[e[o-1].end]}interpolate(e,n){const o=this.options,a=e[n],s=this.points,l=Ga(this,{property:n,start:a,end:a});if(!l.length)return;const r=[],c=Kf(o);let d,u;for(d=0,u=l.length;d<u;++d){const{start:h,end:f}=l[d],m=s[h],p=s[f];if(m===p){r.push(m);continue}const g=Math.abs((a-m[n])/(p[n]-m[n])),b=c(m,p,g,o.stepped);b[n]=e[n],r.push(b)}return r.length===1?r[0]:r}pathSegment(e,n,o){return po(this)(e,this,n,o)}path(e,n,o){const a=this.segments,s=po(this);let l=this._loop;n=n||0,o=o||this.points.length-n;for(const r of a)l&=s(e,this,r,{start:n,end:n+o-1});return!!l}draw(e,n,o,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),Zf(e,this,o,a),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}W(wt,"id","line"),W(wt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),W(wt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),W(wt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Ws(t,e,n,o){const a=t.options,{[n]:s}=t.getProps([n],o);return Math.abs(e-s)<a.radius+a.hitRadius}class hi extends et{constructor(n){super();W(this,"parsed");W(this,"skip");W(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,o,a){const s=this.options,{x:l,y:r}=this.getProps(["x","y"],a);return Math.pow(n-l,2)+Math.pow(o-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,o){return Ws(this,n,"x",o)}inYRange(n,o){return Ws(this,n,"y",o)}getCenterPoint(n){const{x:o,y:a}=this.getProps(["x","y"],n);return{x:o,y:a}}size(n){n=n||this.options||{};let o=n.radius||0;o=Math.max(o,o&&n.hoverRadius||0);const a=o&&n.borderWidth||0;return(o+a)*2}draw(n,o){const a=this.options;this.skip||a.radius<.1||!ct(this,o,this.size(a)/2)||(n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.fillStyle=a.backgroundColor,Gi(n,a,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}W(hi,"id","point"),W(hi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),W(hi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hs(t,e){const{x:n,y:o,base:a,width:s,height:l}=t.getProps(["x","y","base","width","height"],e);let r,c,d,u,h;return t.horizontal?(h=l/2,r=Math.min(n,a),c=Math.max(n,a),d=o-h,u=o+h):(h=s/2,r=n-h,c=n+h,d=Math.min(o,a),u=Math.max(o,a)),{left:r,top:d,right:c,bottom:u}}function Ct(t,e,n,o){return t?0:Ie(e,n,o)}function Qf(t,e,n){const o=t.options.borderWidth,a=t.borderSkipped,s=La(o);return{t:Ct(a.top,s.top,0,n),r:Ct(a.right,s.right,0,e),b:Ct(a.bottom,s.bottom,0,n),l:Ct(a.left,s.left,0,e)}}function em(t,e,n){const{enableBorderRadius:o}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=$t(a),l=Math.min(e,n),r=t.borderSkipped,c=o||se(a);return{topLeft:Ct(!c||r.top||r.left,s.topLeft,0,l),topRight:Ct(!c||r.top||r.right,s.topRight,0,l),bottomLeft:Ct(!c||r.bottom||r.left,s.bottomLeft,0,l),bottomRight:Ct(!c||r.bottom||r.right,s.bottomRight,0,l)}}function tm(t){const e=Hs(t),n=e.right-e.left,o=e.bottom-e.top,a=Qf(t,n/2,o/2),s=em(t,n/2,o/2);return{outer:{x:e.left,y:e.top,w:n,h:o,radius:s},inner:{x:e.left+a.l,y:e.top+a.t,w:n-a.l-a.r,h:o-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function go(t,e,n,o){const a=e===null,s=n===null,r=t&&!(a&&s)&&Hs(t,o);return r&&(a||lt(e,r.left,r.right))&&(s||lt(n,r.top,r.bottom))}function nm(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function im(t,e){t.rect(e.x,e.y,e.w,e.h)}function bo(t,e,n={}){const o=t.x!==n.x?-e:0,a=t.y!==n.y?-e:0,s=(t.x+t.w!==n.x+n.w?e:0)-o,l=(t.y+t.h!==n.y+n.h?e:0)-a;return{x:t.x+o,y:t.y+a,w:t.w+s,h:t.h+l,radius:t.radius}}class fi extends et{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:o,backgroundColor:a}}=this,{inner:s,outer:l}=tm(this),r=nm(l.radius)?hn:im;e.save(),(l.w!==s.w||l.h!==s.h)&&(e.beginPath(),r(e,bo(l,n,s)),e.clip(),r(e,bo(s,-n,l)),e.fillStyle=o,e.fill("evenodd")),e.beginPath(),r(e,bo(s,n)),e.fillStyle=a,e.fill(),e.restore()}inRange(e,n,o){return go(this,e,n,o)}inXRange(e,n){return go(this,e,null,n)}inYRange(e,n){return go(this,null,e,n)}getCenterPoint(e){const{x:n,y:o,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(n+a)/2:n,y:s?o:(o+a)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}W(fi,"id","bar"),W(fi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),W(fi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var om=Object.freeze({__proto__:null,ArcElement:wn,BarElement:fi,LineElement:wt,PointElement:hi});const _o=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],js=_o.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ys(t){return _o[t%_o.length]}function Us(t){return js[t%js.length]}function am(t,e){return t.borderColor=Ys(e),t.backgroundColor=Us(e),++e}function sm(t,e){return t.backgroundColor=t.data.map(()=>Ys(e++)),e}function lm(t,e){return t.backgroundColor=t.data.map(()=>Us(e++)),e}function rm(t){let e=0;return(n,o)=>{const a=t.getDatasetMeta(o).controller;a instanceof zt?e=sm(n,e):a instanceof pn?e=lm(n,e):a&&(e=am(n,e))}}function Xs(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function cm(t){return t&&(t.borderColor||t.backgroundColor)}function dm(){return Ee.borderColor!=="rgba(0,0,0,0.1)"||Ee.backgroundColor!=="rgba(0,0,0,0.1)"}var um={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,n){if(!n.enabled)return;const{data:{datasets:o},options:a}=t.config,{elements:s}=a,l=Xs(o)||cm(a)||s&&Xs(s)||dm();if(!n.forceOverride&&l)return;const r=rm(t);o.forEach(r)}};function hm(t,e,n,o,a){const s=a.samples||o;if(s>=n)return t.slice(e,e+n);const l=[],r=(n-2)/(s-2);let c=0;const d=e+n-1;let u=e,h,f,m,p,g;for(l[c++]=t[u],h=0;h<s-2;h++){let b=0,_=0,k;const B=Math.floor((h+1)*r)+1+e,C=Math.min(Math.floor((h+2)*r)+1,n)+e,y=C-B;for(k=B;k<C;k++)b+=t[k].x,_+=t[k].y;b/=y,_/=y;const x=Math.floor(h*r)+1+e,S=Math.min(Math.floor((h+1)*r)+1,n)+e,{x:w,y:M}=t[u];for(m=p=-1,k=x;k<S;k++)p=.5*Math.abs((w-b)*(t[k].y-M)-(w-t[k].x)*(_-M)),p>m&&(m=p,f=t[k],g=k);l[c++]=f,u=g}return l[c++]=t[d],l}function fm(t,e,n,o){let a=0,s=0,l,r,c,d,u,h,f,m,p,g;const b=[],_=e+n-1,k=t[e].x,C=t[_].x-k;for(l=e;l<e+n;++l){r=t[l],c=(r.x-k)/C*o,d=r.y;const y=c|0;if(y===u)d<p?(p=d,h=l):d>g&&(g=d,f=l),a=(s*a+r.x)/++s;else{const x=l-1;if(!ae(h)&&!ae(f)){const S=Math.min(h,f),w=Math.max(h,f);S!==m&&S!==x&&b.push({...t[S],x:a}),w!==m&&w!==x&&b.push({...t[w],x:a})}l>0&&x!==m&&b.push(t[x]),b.push(r),u=y,s=0,p=g=d,h=f=m=l}}return b}function Ks(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function qs(t){t.data.datasets.forEach(e=>{Ks(e)})}function mm(t,e){const n=e.length;let o=0,a;const{iScale:s}=t,{min:l,max:r,minDefined:c,maxDefined:d}=s.getUserBounds();return c&&(o=Ie(rt(e,s.axis,l).lo,0,n-1)),d?a=Ie(rt(e,s.axis,r).hi+1,o,n)-o:a=n-o,{start:o,count:a}}var pm={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled){qs(t);return}const o=t.width;t.data.datasets.forEach((a,s)=>{const{_data:l,indexAxis:r}=a,c=t.getDatasetMeta(s),d=l||a.data;if(fn([r,t.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=t.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:h,count:f}=mm(c,d);const m=n.threshold||4*o;if(f<=m){Ks(a);return}ae(l)&&(a._data=d,delete a.data,Object.defineProperty(a,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=hm(d,h,f,o,n);break;case"min-max":p=fm(d,h,f,o);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}a._decimated=p})},destroy(t){qs(t)}};function gm(t,e,n){const o=t.segments,a=t.points,s=e.points,l=[];for(const r of o){let{start:c,end:d}=r;d=mi(c,d,a);const u=yo(n,a[c],a[d],r.loop);if(!e.segments){l.push({source:r,target:u,start:a[c],end:a[d]});continue}const h=Ga(e,u);for(const f of h){const m=yo(n,s[f.start],s[f.end],f.loop),p=qa(r,a,m);for(const g of p)l.push({source:g,target:f,start:{[n]:Gs(u,m,"start",Math.max)},end:{[n]:Gs(u,m,"end",Math.min)}})}}return l}function yo(t,e,n,o){if(o)return;let a=e[t],s=n[t];return t==="angle"&&(a=Oe(a),s=Oe(s)),{property:t,start:a,end:s}}function bm(t,e){const{x:n=null,y:o=null}=t||{},a=e.points,s=[];return e.segments.forEach(({start:l,end:r})=>{r=mi(l,r,a);const c=a[l],d=a[r];o!==null?(s.push({x:c.x,y:o}),s.push({x:d.x,y:o})):n!==null&&(s.push({x:n,y:c.y}),s.push({x:n,y:d.y}))}),s}function mi(t,e,n){for(;e>t;e--){const o=n[e];if(!isNaN(o.x)&&!isNaN(o.y))break}return e}function Gs(t,e,n,o){return t&&e?o(t[n],e[n]):t?t[n]:e?e[n]:0}function Js(t,e){let n=[],o=!1;return Se(t)?(o=!0,n=t):n=bm(t,e),n.length?new wt({points:n,options:{tension:0},_loop:o,_fullLoop:o}):null}function Zs(t){return t&&t.fill!==!1}function _m(t,e,n){let a=t[e].fill;const s=[e];let l;if(!n)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!Me(a))return a;if(l=t[a],!l)return!1;if(l.visible)return a;s.push(a),a=l.fill}return!1}function ym(t,e,n){const o=Cm(t);if(se(o))return isNaN(o.value)?!1:o;let a=parseFloat(o);return Me(a)&&Math.floor(a)===a?km(o[0],e,a,n):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}function km(t,e,n,o){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=o?!1:n}function xm(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:se(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function wm(t,e,n){let o;return t==="start"?o=n:t==="end"?o=e.options.reverse?e.min:e.max:se(t)?o=t.value:o=e.getBaseValue(),o}function Cm(t){const e=t.options,n=e.fill;let o=ie(n&&n.target,n);return o===void 0&&(o=!!e.backgroundColor),o===!1||o===null?!1:o===!0?"origin":o}function Bm(t){const{scale:e,index:n,line:o}=t,a=[],s=o.segments,l=o.points,r=Sm(e,n);r.push(Js({x:null,y:e.bottom},o));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)Em(a,l[u],r)}return new wt({points:a,options:{}})}function Sm(t,e){const n=[],o=t.getMatchingVisibleMetas("line");for(let a=0;a<o.length;a++){const s=o[a];if(s.index===e)break;s.hidden||n.unshift(s.dataset)}return n}function Em(t,e,n){const o=[];for(let a=0;a<n.length;a++){const s=n[a],{first:l,last:r,point:c}=Mm(s,e,"x");if(!(!c||l&&r)){if(l)o.unshift(c);else if(t.push(c),!r)break}}t.push(...o)}function Mm(t,e,n){const o=t.interpolate(e,n);if(!o)return{};const a=o[n],s=t.segments,l=t.points;let r=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],h=l[u.start][n],f=l[u.end][n];if(lt(a,h,f)){r=a===h,c=a===f;break}}return{first:r,last:c,point:o}}class Qs{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,o){const{x:a,y:s,radius:l}=this;return n=n||{start:0,end:Ce},e.arc(a,s,l,n.end,n.start,!0),!o.bounds}interpolate(e){const{x:n,y:o,radius:a}=this,s=e.angle;return{x:n+Math.cos(s)*a,y:o+Math.sin(s)*a,angle:s}}}function vm(t){const{chart:e,fill:n,line:o}=t;if(Me(n))return Vm(e,n);if(n==="stack")return Bm(t);if(n==="shape")return!0;const a=Dm(t);return a instanceof Qs?a:Js(a,o)}function Vm(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function Dm(t){return(t.scale||{}).getPointPositionForValue?Tm(t):$m(t)}function $m(t){const{scale:e={},fill:n}=t,o=xm(n,e);if(Me(o)){const a=e.isHorizontal();return{x:a?o:null,y:a?null:o}}return null}function Tm(t){const{scale:e,fill:n}=t,o=e.options,a=e.getLabels().length,s=o.reverse?e.max:e.min,l=wm(n,e,s),r=[];if(o.grid.circular){const c=e.getPointPositionForValue(0,s);return new Qs({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(l)})}for(let c=0;c<a;++c)r.push(e.getPointPositionForValue(c,l));return r}function ko(t,e,n){const o=vm(e),{chart:a,index:s,line:l,scale:r,axis:c}=e,d=l.options,u=d.fill,h=d.backgroundColor,{above:f=h,below:m=h}=u||{},p=a.getDatasetMeta(s),g=Qa(a,p);o&&l.points.length&&(Un(t,n),Im(t,{line:l,target:o,above:f,below:m,area:n,scale:r,axis:c,clip:g}),Xn(t))}function Im(t,e){const{line:n,target:o,above:a,below:s,area:l,scale:r,clip:c}=e,d=n._loop?"angle":e.axis;t.save();let u=s;s!==a&&(d==="x"?(el(t,o,l.top),xo(t,{line:n,target:o,color:a,scale:r,property:d,clip:c}),t.restore(),t.save(),el(t,o,l.bottom)):d==="y"&&(tl(t,o,l.left),xo(t,{line:n,target:o,color:s,scale:r,property:d,clip:c}),t.restore(),t.save(),tl(t,o,l.right),u=a)),xo(t,{line:n,target:o,color:u,scale:r,property:d,clip:c}),t.restore()}function el(t,e,n){const{segments:o,points:a}=e;let s=!0,l=!1;t.beginPath();for(const r of o){const{start:c,end:d}=r,u=a[c],h=a[mi(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),l=!!e.pathSegment(t,r,{move:l}),l?t.closePath():t.lineTo(h.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function tl(t,e,n){const{segments:o,points:a}=e;let s=!0,l=!1;t.beginPath();for(const r of o){const{start:c,end:d}=r,u=a[c],h=a[mi(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(n,u.y),t.lineTo(u.x,u.y)),l=!!e.pathSegment(t,r,{move:l}),l?t.closePath():t.lineTo(n,h.y)}t.lineTo(n,e.first().y),t.closePath(),t.clip()}function xo(t,e){const{line:n,target:o,property:a,color:s,scale:l,clip:r}=e,c=gm(n,o,a);for(const{source:d,target:u,start:h,end:f}of c){const{style:{backgroundColor:m=s}={}}=d,p=o!==!0;t.save(),t.fillStyle=m,Lm(t,l,r,p&&yo(a,h,f)),t.beginPath();const g=!!n.pathSegment(t,d);let b;if(p){g?t.closePath():nl(t,o,f,a);const _=!!o.pathSegment(t,u,{move:g,reverse:!0});b=g&&_,b||nl(t,o,h,a)}t.closePath(),t.fill(b?"evenodd":"nonzero"),t.restore()}}function Lm(t,e,n,o){const a=e.chart.chartArea,{property:s,start:l,end:r}=o||{};if(s==="x"||s==="y"){let c,d,u,h;s==="x"?(c=l,d=a.top,u=r,h=a.bottom):(c=a.left,d=l,u=a.right,h=r),t.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),d=Math.max(d,n.top),h=Math.min(h,n.bottom)),t.rect(c,d,u-c,h-d),t.clip()}}function nl(t,e,n,o){const a=e.interpolate(n,o);a&&t.lineTo(a.x,a.y)}var zm={id:"filler",afterDatasetsUpdate(t,e,n){const o=(t.data.datasets||[]).length,a=[];let s,l,r,c;for(l=0;l<o;++l)s=t.getDatasetMeta(l),r=s.dataset,c=null,r&&r.options&&r instanceof wt&&(c={visible:t.isDatasetVisible(l),index:l,fill:ym(r,l,o),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:r}),s.$filler=c,a.push(c);for(l=0;l<o;++l)c=a[l],!(!c||c.fill===!1)&&(c.fill=_m(a,l,n.propagate))},beforeDraw(t,e,n){const o=n.drawTime==="beforeDraw",a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let l=a.length-1;l>=0;--l){const r=a[l].$filler;r&&(r.line.updateControlPoints(s,r.axis),o&&r.fill&&ko(t.ctx,r,s))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const o=t.getSortedVisibleDatasetMetas();for(let a=o.length-1;a>=0;--a){const s=o[a].$filler;Zs(s)&&ko(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,e,n){const o=e.meta.$filler;!Zs(o)||n.drawTime!=="beforeDatasetDraw"||ko(t.ctx,o,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const il=(t,e)=>{let{boxHeight:n=e,boxWidth:o=e}=t;return t.usePointStyle&&(n=Math.min(n,e),o=t.pointStyleWidth||Math.min(o,e)),{boxWidth:o,boxHeight:n,itemHeight:Math.max(e,n)}},Nm=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class ol extends et{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n,o){this.maxWidth=e,this.maxHeight=n,this._margins=o,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let n=ke(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(o=>e.filter(o,this.chart.data))),e.sort&&(n=n.sort((o,a)=>e.sort(o,a,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const o=e.labels,a=$e(o.font),s=a.size,l=this._computeTitleHeight(),{boxWidth:r,itemHeight:c}=il(o,s);let d,u;n.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(l,s,r,c)+10):(u=this.maxHeight,d=this._fitCols(l,a,r,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,o,a){const{ctx:s,maxWidth:l,options:{labels:{padding:r}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+r;let h=e;s.textAlign="left",s.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((p,g)=>{const b=o+n/2+s.measureText(p.text).width;(g===0||d[d.length-1]+b+2*r>l)&&(h+=u,d[d.length-(g>0?0:1)]=0,m+=u,f++),c[g]={left:0,top:m,row:f,width:b,height:a},d[d.length-1]+=b+r}),h}_fitCols(e,n,o,a){const{ctx:s,maxHeight:l,options:{labels:{padding:r}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=l-e;let h=r,f=0,m=0,p=0,g=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:k,itemHeight:B}=Pm(o,n,s,b,a);_>0&&m+B+2*r>u&&(h+=f+r,d.push({width:f,height:m}),p+=f+r,g++,f=m=0),c[_]={left:p,top:m,col:g,width:k,height:B},f=Math.max(f,k),m+=B+r}),h+=f,d.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:o,labels:{padding:a},rtl:s}}=this,l=Xt(s,this.left,this.width);if(this.isHorizontal()){let r=0,c=Fe(o,this.left+a,this.right-this.lineWidths[r]);for(const d of n)r!==d.row&&(r=d.row,c=Fe(o,this.left+a,this.right-this.lineWidths[r])),d.top+=this.top+e+a,d.left=l.leftForLtr(l.x(c),d.width),c+=d.width+a}else{let r=0,c=Fe(o,this.top+e+a,this.bottom-this.columnSizes[r].height);for(const d of n)d.col!==r&&(r=d.col,c=Fe(o,this.top+e+a,this.bottom-this.columnSizes[r].height)),d.top=c,d.left+=this.left+a,d.left=l.leftForLtr(l.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Un(e,this),this._draw(),Xn(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:o,ctx:a}=this,{align:s,labels:l}=e,r=Ee.color,c=Xt(e.rtl,this.left,this.width),d=$e(l.font),{padding:u}=l,h=d.size,f=h/2;let m;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:p,boxHeight:g,itemHeight:b}=il(l,h),_=function(x,S,w){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;a.save();const M=ie(w.lineWidth,1);if(a.fillStyle=ie(w.fillStyle,r),a.lineCap=ie(w.lineCap,"butt"),a.lineDashOffset=ie(w.lineDashOffset,0),a.lineJoin=ie(w.lineJoin,"miter"),a.lineWidth=M,a.strokeStyle=ie(w.strokeStyle,r),a.setLineDash(ie(w.lineDash,[])),l.usePointStyle){const N={radius:g*Math.SQRT2/2,pointStyle:w.pointStyle,rotation:w.rotation,borderWidth:M},T=c.xPlus(x,p/2),$=S+f;Ia(a,N,T,$,l.pointStyleWidth&&p)}else{const N=S+Math.max((h-g)/2,0),T=c.leftForLtr(x,p),$=$t(w.borderRadius);a.beginPath(),Object.values($).some(K=>K!==0)?hn(a,{x:T,y:N,w:p,h:g,radius:$}):a.rect(T,N,p,g),a.fill(),M!==0&&a.stroke()}a.restore()},k=function(x,S,w){Dt(a,w.text,x,S+b/2,d,{strikethrough:w.hidden,textAlign:c.textAlign(w.textAlign)})},B=this.isHorizontal(),C=this._computeTitleHeight();B?m={x:Fe(s,this.left+u,this.right-o[0]),y:this.top+u+C,line:0}:m={x:this.left+u,y:Fe(s,this.top+C+u,this.bottom-n[0].height),line:0},Ya(this.ctx,e.textDirection);const y=b+u;this.legendItems.forEach((x,S)=>{a.strokeStyle=x.fontColor,a.fillStyle=x.fontColor;const w=a.measureText(x.text).width,M=c.textAlign(x.textAlign||(x.textAlign=l.textAlign)),N=p+f+w;let T=m.x,$=m.y;c.setWidth(this.width),B?S>0&&T+N+u>this.right&&($=m.y+=y,m.line++,T=m.x=Fe(s,this.left+u,this.right-o[m.line])):S>0&&$+y>this.bottom&&(T=m.x=T+n[m.line].width+u,m.line++,$=m.y=Fe(s,this.top+C+u,this.bottom-n[m.line].height));const K=c.x(T);if(_(K,$,x),T=tu(M,T+p+f,B?T+N:this.right,e.rtl),k(c.x(T),$,x),B)m.x+=N+u;else if(typeof x.text!="string"){const P=d.lineHeight;m.y+=al(x,P)+u}else m.y+=y}),Ua(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,o=$e(n.font),a=We(n.padding);if(!n.display)return;const s=Xt(e.rtl,this.left,this.width),l=this.ctx,r=n.position,c=o.size/2,d=a.top+c;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+d,h=Fe(e.align,h,this.right-f);else{const p=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);u=d+Fe(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=Fe(r,h,h+f);l.textAlign=s.textAlign(Yi(r)),l.textBaseline="middle",l.strokeStyle=n.color,l.fillStyle=n.color,l.font=o.string,Dt(l,n.text,m,u,o)}_computeTitleHeight(){const e=this.options.title,n=$e(e.font),o=We(e.padding);return e.display?n.lineHeight+o.height:0}_getLegendItemAt(e,n){let o,a,s;if(lt(e,this.left,this.right)&&lt(n,this.top,this.bottom)){for(s=this.legendHitBoxes,o=0;o<s.length;++o)if(a=s[o],lt(e,a.left,a.left+a.width)&&lt(n,a.top,a.top+a.height))return this.legendItems[o]}return null}handleEvent(e){const n=this.options;if(!Om(e.type,n))return;const o=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const a=this._hoveredItem,s=Nm(a,o);a&&!s&&ke(n.onLeave,[e,a,this],this),this._hoveredItem=o,o&&!s&&ke(n.onHover,[e,o,this],this)}else o&&ke(n.onClick,[e,o,this],this)}}function Pm(t,e,n,o,a){const s=Am(o,t,e,n),l=Rm(a,o,e.lineHeight);return{itemWidth:s,itemHeight:l}}function Am(t,e,n,o){let a=t.text;return a&&typeof a!="string"&&(a=a.reduce((s,l)=>s.length>l.length?s:l)),e+n.size/2+o.measureText(a).width}function Rm(t,e,n){let o=t;return typeof e.text!="string"&&(o=al(e,n)),o}function al(t,e){const n=t.text?t.text.length:0;return e*n}function Om(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var Fm={id:"legend",_element:ol,start(t,e,n){const o=t.legend=new ol({ctx:t.ctx,options:n,chart:t});He.configure(t,o,n),He.addBox(t,o)},stop(t){He.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const o=t.legend;He.configure(t,o,n),o.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const o=e.datasetIndex,a=n.chart;a.isDatasetVisible(o)?(a.hide(o),e.hidden=!0):(a.show(o),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:o,textAlign:a,color:s,useBorderRadius:l,borderRadius:r}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(n?0:void 0),u=We(d.borderWidth);return{text:e[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:o||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:l&&(r||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class wo extends et{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,n){const o=this.options;if(this.left=0,this.top=0,!o.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=n;const a=Se(o.text)?o.text.length:1;this._padding=We(o.padding);const s=a*$e(o.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:o,bottom:a,right:s,options:l}=this,r=l.align;let c=0,d,u,h;return this.isHorizontal()?(u=Fe(r,o,s),h=n+e,d=s-o):(l.position==="left"?(u=o+e,h=Fe(r,a,n),c=de*-.5):(u=s-e,h=Fe(r,n,a),c=de*.5),d=a-n),{titleX:u,titleY:h,maxWidth:d,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const o=$e(n.font),s=o.lineHeight/2+this._padding.top,{titleX:l,titleY:r,maxWidth:c,rotation:d}=this._drawArgs(s);Dt(e,n.text,0,0,o,{color:n.color,maxWidth:c,rotation:d,textAlign:Yi(n.align),textBaseline:"middle",translation:[l,r]})}}function Wm(t,e){const n=new wo({ctx:t.ctx,options:e,chart:t});He.configure(t,n,e),He.addBox(t,n),t.titleBlock=n}var Hm={id:"title",_element:wo,start(t,e,n){Wm(t,n)},stop(t){const e=t.titleBlock;He.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const o=t.titleBlock;He.configure(t,o,n),o.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const pi=new WeakMap;var jm={id:"subtitle",start(t,e,n){const o=new wo({ctx:t.ctx,options:n,chart:t});He.configure(t,o,n),He.addBox(t,o),pi.set(t,o)},stop(t){He.removeBox(t,pi.get(t)),pi.delete(t)},beforeUpdate(t,e,n){const o=pi.get(t);He.configure(t,o,n),o.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Cn={average(t){if(!t.length)return!1;let e,n,o=new Set,a=0,s=0;for(e=0,n=t.length;e<n;++e){const r=t[e].element;if(r&&r.hasValue()){const c=r.tooltipPosition();o.add(c.x),a+=c.y,++s}}return s===0||o.size===0?!1:{x:[...o].reduce((r,c)=>r+c)/o.size,y:a/s}},nearest(t,e){if(!t.length)return!1;let n=e.x,o=e.y,a=Number.POSITIVE_INFINITY,s,l,r;for(s=0,l=t.length;s<l;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Hi(e,d);u<a&&(a=u,r=c)}}if(r){const c=r.tooltipPosition();n=c.x,o=c.y}return{x:n,y:o}}};function ot(t,e){return e&&(Se(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function ht(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
44
44
  `)>-1?t.split(`
45
- `):t}function Ym(t,e){const{element:n,datasetIndex:o,index:a}=e,s=t.getDatasetMeta(o).controller,{label:l,value:r}=s.getLabelAndValue(a);return{chart:t,label:l,parsed:s.getParsed(a),raw:t.data.datasets[o].data[a],formattedValue:r,dataset:s.getDataset(),dataIndex:a,datasetIndex:o,element:n}}function sl(t,e){const n=t.chart.ctx,{body:o,footer:a,title:s}=t,{boxWidth:l,boxHeight:r}=e,c=$e(e.bodyFont),d=$e(e.titleFont),u=$e(e.footerFont),h=s.length,f=a.length,m=o.length,p=We(e.padding);let g=p.height,b=0,_=o.reduce((C,y)=>C+y.before.length+y.lines.length+y.after.length,0);if(_+=t.beforeBody.length+t.afterBody.length,h&&(g+=h*d.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),_){const C=e.displayColors?Math.max(r,c.lineHeight):c.lineHeight;g+=m*C+(_-m)*c.lineHeight+(_-1)*e.bodySpacing}f&&(g+=e.footerMarginTop+f*u.lineHeight+(f-1)*e.footerSpacing);let k=0;const B=function(C){b=Math.max(b,n.measureText(C).width+k)};return n.save(),n.font=d.string,pe(t.title,B),n.font=c.string,pe(t.beforeBody.concat(t.afterBody),B),k=e.displayColors?l+2+e.boxPadding:0,pe(o,C=>{pe(C.before,B),pe(C.lines,B),pe(C.after,B)}),k=0,n.font=u.string,pe(t.footer,B),n.restore(),b+=p.width,{width:b,height:g}}function Um(t,e){const{y:n,height:o}=e;return n<o/2?"top":n>t.height-o/2?"bottom":"center"}function Xm(t,e,n,o){const{x:a,width:s}=o,l=n.caretSize+n.caretPadding;if(t==="left"&&a+s+l>e.width||t==="right"&&a-s-l<0)return!0}function Km(t,e,n,o){const{x:a,width:s}=n,{width:l,chartArea:{left:r,right:c}}=t;let d="center";return o==="center"?d=a<=(r+c)/2?"left":"right":a<=s/2?d="left":a>=l-s/2&&(d="right"),Xm(d,t,e,n)&&(d="center"),d}function ll(t,e,n){const o=n.yAlign||e.yAlign||Um(t,n);return{xAlign:n.xAlign||e.xAlign||Km(t,e,n,o),yAlign:o}}function qm(t,e){let{x:n,width:o}=t;return e==="right"?n-=o:e==="center"&&(n-=o/2),n}function Gm(t,e,n){let{y:o,height:a}=t;return e==="top"?o+=n:e==="bottom"?o-=a+n:o-=a/2,o}function rl(t,e,n,o){const{caretSize:a,caretPadding:s,cornerRadius:l}=t,{xAlign:r,yAlign:c}=n,d=a+s,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=$t(l);let p=qm(e,r);const g=Gm(e,c,d);return c==="center"?r==="left"?p+=d:r==="right"&&(p-=d):r==="left"?p-=Math.max(u,f)+a:r==="right"&&(p+=Math.max(h,m)+a),{x:Ie(p,0,o.width-e.width),y:Ie(g,0,o.height-e.height)}}function gi(t,e,n){const o=We(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-o.right:t.x+o.left}function cl(t){return ot([],ht(t))}function Jm(t,e,n){return kt(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function dl(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const ul={beforeTitle:st,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,o=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(o>0&&e.dataIndex<o)return n[e.dataIndex]}return""},afterTitle:st,beforeBody:st,beforeLabel:st,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return ae(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:st,afterBody:st,beforeFooter:st,footer:st,afterFooter:st};function Xe(t,e,n,o){const a=t[e].call(n,o);return typeof a>"u"?ul[e].call(n,o):a}let hl=(Ro=class extends et{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,o=this.options.setContext(this.getContext()),a=o.enabled&&n.options.animation&&o.animations,s=new ts(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Jm(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:o}=n,a=Xe(o,"beforeTitle",this,e),s=Xe(o,"title",this,e),l=Xe(o,"afterTitle",this,e);let r=[];return r=ot(r,ht(a)),r=ot(r,ht(s)),r=ot(r,ht(l)),r}getBeforeBody(e,n){return cl(Xe(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:o}=n,a=[];return pe(e,s=>{const l={before:[],lines:[],after:[]},r=dl(o,s);ot(l.before,ht(Xe(r,"beforeLabel",this,s))),ot(l.lines,Xe(r,"label",this,s)),ot(l.after,ht(Xe(r,"afterLabel",this,s))),a.push(l)}),a}getAfterBody(e,n){return cl(Xe(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:o}=n,a=Xe(o,"beforeFooter",this,e),s=Xe(o,"footer",this,e),l=Xe(o,"afterFooter",this,e);let r=[];return r=ot(r,ht(a)),r=ot(r,ht(s)),r=ot(r,ht(l)),r}_createItems(e){const n=this._active,o=this.chart.data,a=[],s=[],l=[];let r=[],c,d;for(c=0,d=n.length;c<d;++c)r.push(Ym(this.chart,n[c]));return e.filter&&(r=r.filter((u,h,f)=>e.filter(u,h,f,o))),e.itemSort&&(r=r.sort((u,h)=>e.itemSort(u,h,o))),pe(r,u=>{const h=dl(e.callbacks,u);a.push(Xe(h,"labelColor",this,u)),s.push(Xe(h,"labelPointStyle",this,u)),l.push(Xe(h,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=l,this.dataPoints=r,r}update(e,n){const o=this.options.setContext(this.getContext()),a=this._active;let s,l=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const r=Cn[o.position].call(this,a,this._eventPosition);l=this._createItems(o),this.title=this.getTitle(l,o),this.beforeBody=this.getBeforeBody(l,o),this.body=this.getBody(l,o),this.afterBody=this.getAfterBody(l,o),this.footer=this.getFooter(l,o);const c=this._size=sl(this,o),d=Object.assign({},r,c),u=ll(this.chart,o,d),h=rl(o,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:r.x,caretY:r.y}}this._tooltipItems=l,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&o.external&&o.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,o,a){const s=this.getCaretPosition(e,o,a);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(e,n,o){const{xAlign:a,yAlign:s}=this,{caretSize:l,cornerRadius:r}=o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:h}=$t(r),{x:f,y:m}=e,{width:p,height:g}=n;let b,_,k,B,C,y;return s==="center"?(C=m+g/2,a==="left"?(b=f,_=b-l,B=C+l,y=C-l):(b=f+p,_=b+l,B=C-l,y=C+l),k=b):(a==="left"?_=f+Math.max(c,u)+l:a==="right"?_=f+p-Math.max(d,h)-l:_=this.caretX,s==="top"?(B=m,C=B-l,b=_-l,k=_+l):(B=m+g,C=B+l,b=_+l,k=_-l),y=B),{x1:b,x2:_,x3:k,y1:B,y2:C,y3:y}}drawTitle(e,n,o){const a=this.title,s=a.length;let l,r,c;if(s){const d=Xt(o.rtl,this.x,this.width);for(e.x=gi(this,o.titleAlign,o),n.textAlign=d.textAlign(o.titleAlign),n.textBaseline="middle",l=$e(o.titleFont),r=o.titleSpacing,n.fillStyle=o.titleColor,n.font=l.string,c=0;c<s;++c)n.fillText(a[c],d.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+r,c+1===s&&(e.y+=o.titleMarginBottom-r)}}_drawColorBox(e,n,o,a,s){const l=this.labelColors[o],r=this.labelPointStyles[o],{boxHeight:c,boxWidth:d}=s,u=$e(s.bodyFont),h=gi(this,"left",s),f=a.x(h),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+m;if(s.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=a.leftForLtr(f,d)+d/2,_=p+c/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Gi(e,g,b,_),e.strokeStyle=l.borderColor,e.fillStyle=l.backgroundColor,Gi(e,g,b,_)}else{e.lineWidth=se(l.borderWidth)?Math.max(...Object.values(l.borderWidth)):l.borderWidth||1,e.strokeStyle=l.borderColor,e.setLineDash(l.borderDash||[]),e.lineDashOffset=l.borderDashOffset||0;const g=a.leftForLtr(f,d),b=a.leftForLtr(a.xPlus(f,1),d-2),_=$t(l.borderRadius);Object.values(_).some(k=>k!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,hn(e,{x:g,y:p,w:d,h:c,radius:_}),e.fill(),e.stroke(),e.fillStyle=l.backgroundColor,e.beginPath(),hn(e,{x:b,y:p+1,w:d-2,h:c-2,radius:_}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(g,p,d,c),e.strokeRect(g,p,d,c),e.fillStyle=l.backgroundColor,e.fillRect(b,p+1,d-2,c-2))}e.fillStyle=this.labelTextColors[o]}drawBody(e,n,o){const{body:a}=this,{bodySpacing:s,bodyAlign:l,displayColors:r,boxHeight:c,boxWidth:d,boxPadding:u}=o,h=$e(o.bodyFont);let f=h.lineHeight,m=0;const p=Xt(o.rtl,this.x,this.width),g=function(w){n.fillText(w,p.x(e.x+m),e.y+f/2),e.y+=f+s},b=p.textAlign(l);let _,k,B,C,y,x,S;for(n.textAlign=l,n.textBaseline="middle",n.font=h.string,e.x=gi(this,b,o),n.fillStyle=o.bodyColor,pe(this.beforeBody,g),m=r&&b!=="right"?l==="center"?d/2+u:d+2+u:0,C=0,x=a.length;C<x;++C){for(_=a[C],k=this.labelTextColors[C],n.fillStyle=k,pe(_.before,g),B=_.lines,r&&B.length&&(this._drawColorBox(n,e,C,p,o),f=Math.max(h.lineHeight,c)),y=0,S=B.length;y<S;++y)g(B[y]),f=h.lineHeight;pe(_.after,g)}m=0,f=h.lineHeight,pe(this.afterBody,g),e.y-=s}drawFooter(e,n,o){const a=this.footer,s=a.length;let l,r;if(s){const c=Xt(o.rtl,this.x,this.width);for(e.x=gi(this,o.footerAlign,o),e.y+=o.footerMarginTop,n.textAlign=c.textAlign(o.footerAlign),n.textBaseline="middle",l=$e(o.footerFont),n.fillStyle=o.footerColor,n.font=l.string,r=0;r<s;++r)n.fillText(a[r],c.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+o.footerSpacing}}drawBackground(e,n,o,a){const{xAlign:s,yAlign:l}=this,{x:r,y:c}=e,{width:d,height:u}=o,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=$t(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(r+h,c),l==="top"&&this.drawCaret(e,n,o,a),n.lineTo(r+d-f,c),n.quadraticCurveTo(r+d,c,r+d,c+f),l==="center"&&s==="right"&&this.drawCaret(e,n,o,a),n.lineTo(r+d,c+u-p),n.quadraticCurveTo(r+d,c+u,r+d-p,c+u),l==="bottom"&&this.drawCaret(e,n,o,a),n.lineTo(r+m,c+u),n.quadraticCurveTo(r,c+u,r,c+u-m),l==="center"&&s==="left"&&this.drawCaret(e,n,o,a),n.lineTo(r,c+h),n.quadraticCurveTo(r,c,r+h,c),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,o=this.$animations,a=o&&o.x,s=o&&o.y;if(a||s){const l=Cn[e.position].call(this,this._active,this._eventPosition);if(!l)return;const r=this._size=sl(this,e),c=Object.assign({},l,this._size),d=ll(n,e,c),u=rl(e,c,d,n);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=r.width,this.height=r.height,this.caretX=l.x,this.caretY=l.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let o=this.opacity;if(!o)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};o=Math.abs(o)<.001?0:o;const l=We(n.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&r&&(e.save(),e.globalAlpha=o,this.drawBackground(s,e,a,n),Ya(e,n.textDirection),s.y+=l.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),Ua(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const o=this._active,a=e.map(({datasetIndex:r,index:c})=>{const d=this.chart.getDatasetMeta(r);if(!d)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:d.data[c],index:c}}),s=!On(o,a),l=this._positionChanged(a,n);(s||l)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,o=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],l=this._getActiveElements(e,s,n,o),r=this._positionChanged(l,e),c=n||!On(l,s)||r;return c&&(this._active=l,(a.enabled||a.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,o,a){const s=this.options;if(e.type==="mouseout")return[];if(!a)return n.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const l=this.chart.getElementsAtEventForMode(e,s.mode,s,o);return s.reverse&&l.reverse(),l}_positionChanged(e,n){const{caretX:o,caretY:a,options:s}=this,l=Cn[s.position].call(this,e,n);return l!==!1&&(o!==l.x||a!==l.y)}},W(Ro,"positioners",Cn),Ro);var Zm={id:"tooltip",_element:hl,positioners:Cn,afterInit(t,e,n){n&&(t.tooltip=new hl({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ul},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Qm=Object.freeze({__proto__:null,Colors:um,Decimation:pm,Filler:zm,Legend:Fm,SubTitle:jm,Title:Hm,Tooltip:Zm});const ep=(t,e,n,o)=>(typeof e=="string"?(n=t.push(e)-1,o.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function tp(t,e,n,o){const a=t.indexOf(e);if(a===-1)return ep(t,e,n,o);const s=t.lastIndexOf(e);return a!==s?n:a}const np=(t,e)=>t===null?null:Ie(Math.round(t),0,e);function fl(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Co extends Pt{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const o=this.getLabels();for(const{index:a,label:s}of n)o[a]===s&&o.splice(a,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(ae(e))return null;const o=this.getLabels();return n=isFinite(n)&&o[n]===e?n:tp(o,e,ie(n,e),this._addedLabels),np(n,o.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:o,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(o=0),n||(a=this.getLabels().length-1)),this.min=o,this.max=a}buildTicks(){const e=this.min,n=this.max,o=this.options.offset,a=[];let s=this.getLabels();s=e===0&&n===s.length-1?s:s.slice(e,n+1),this._valueRange=Math.max(s.length-(o?0:1),1),this._startValue=this.min-(o?.5:0);for(let l=e;l<=n;l++)a.push({value:l});return a}getLabelForValue(e){return fl.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}W(Co,"id","category"),W(Co,"defaults",{ticks:{callback:fl}});function ip(t,e){const n=[],{bounds:a,step:s,min:l,max:r,precision:c,count:d,maxTicks:u,maxDigits:h,includeBounds:f}=t,m=s||1,p=u-1,{min:g,max:b}=e,_=!ae(l),k=!ae(r),B=!ae(d),C=(b-g)/(h+1);let y=ga((b-g)/p/m)*m,x,S,w,M;if(y<1e-14&&!_&&!k)return[{value:g},{value:b}];M=Math.ceil(b/y)-Math.floor(g/y),M>p&&(y=ga(M*y/p/m)*m),ae(c)||(x=Math.pow(10,c),y=Math.ceil(y*x)/x),a==="ticks"?(S=Math.floor(g/y)*y,w=Math.ceil(b/y)*y):(S=g,w=b),_&&k&&s&&Kd((r-l)/s,y/1e3)?(M=Math.round(Math.min((r-l)/y,u)),y=(r-l)/M,S=l,w=r):B?(S=_?l:S,w=k?r:w,M=d-1,y=(w-S)/M):(M=(w-S)/y,ln(M,Math.round(M),y/1e3)?M=Math.round(M):M=Math.ceil(M));const N=Math.max(_a(y),_a(S));x=Math.pow(10,ae(c)?N:c),S=Math.round(S*x)/x,w=Math.round(w*x)/x;let T=0;for(_&&(f&&S!==l?(n.push({value:l}),S<l&&T++,ln(Math.round((S+T*y)*x)/x,l,ml(l,C,t))&&T++):S<l&&T++);T<M;++T){const $=Math.round((S+T*y)*x)/x;if(k&&$>r)break;n.push({value:$})}return k&&f&&w!==r?n.length&&ln(n[n.length-1].value,r,ml(r,C,t))?n[n.length-1].value=r:n.push({value:r}):(!k||w===r)&&n.push({value:w}),n}function ml(t,e,{horizontal:n,minRotation:o}){const a=Ze(o),s=(n?Math.sin(a):Math.cos(a))||.001,l=.75*e*(""+t).length;return Math.min(e/s,l)}class bi extends Pt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return ae(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:a,max:s}=this;const l=c=>a=n?a:c,r=c=>s=o?s:c;if(e){const c=nt(a),d=nt(s);c<0&&d<0?r(0):c>0&&d>0&&l(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);r(s+c),e||l(a-c)}this.min=a,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:o}=e,a;return o?(a=Math.ceil(this.max/o)-Math.floor(this.min/o)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${o} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let o=this.getTickLimit();o=Math.max(2,o);const a={maxTicks:o,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,l=ip(a,s);return e.bounds==="ticks"&&ba(l,this,"value"),e.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}configure(){const e=this.ticks;let n=this.min,o=this.max;if(super.configure(),this.options.offset&&e.length){const a=(o-n)/Math.max(e.length-1,1)/2;n-=a,o+=a}this._startValue=n,this._endValue=o,this._valueRange=o-n}getLabelForValue(e){return dn(e,this.chart.options.locale,this.options.ticks.format)}}class Bo extends bi{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Me(e)?e:0,this.max=Me(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,o=Ze(this.options.ticks.minRotation),a=(e?Math.sin(o):Math.cos(o))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/a))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}W(Bo,"id","linear"),W(Bo,"defaults",{ticks:{callback:jn.formatters.numeric}});const Bn=t=>Math.floor(yt(t)),At=(t,e)=>Math.pow(10,Bn(t)+e);function pl(t){return t/Math.pow(10,Bn(t))===1}function gl(t,e,n){const o=Math.pow(10,n),a=Math.floor(t/o);return Math.ceil(e/o)-a}function op(t,e){const n=e-t;let o=Bn(n);for(;gl(t,e,o)>10;)o++;for(;gl(t,e,o)<10;)o--;return Math.min(o,Bn(t))}function ap(t,{min:e,max:n}){e=qe(t.min,e);const o=[],a=Bn(e);let s=op(e,n),l=s<0?Math.pow(10,Math.abs(s)):1;const r=Math.pow(10,s),c=a>s?Math.pow(10,a):0,d=Math.round((e-c)*l)/l,u=Math.floor((e-c)/r/10)*r*10;let h=Math.floor((d-u)/Math.pow(10,s)),f=qe(t.min,Math.round((c+u+h*Math.pow(10,s))*l)/l);for(;f<n;)o.push({value:f,major:pl(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(s++,h=2,l=s>=0?1:l),f=Math.round((c+u+h*Math.pow(10,s))*l)/l;const m=qe(t.max,f);return o.push({value:m,major:pl(m),significand:h}),o}class So extends Pt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const o=bi.prototype.parse.apply(this,[e,n]);if(o===0){this._zero=!0;return}return Me(o)&&o>0?o:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Me(e)?Math.max(0,e):null,this.max=Me(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Me(this._userMin)&&(this.min=e===At(this.min,0)?At(this.min,-1):At(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let o=this.min,a=this.max;const s=r=>o=e?o:r,l=r=>a=n?a:r;o===a&&(o<=0?(s(1),l(10)):(s(At(o,-1)),l(At(a,1)))),o<=0&&s(At(a,-1)),a<=0&&l(At(o,1)),this.min=o,this.max=a}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},o=ap(n,this);return e.bounds==="ticks"&&ba(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}getLabelForValue(e){return e===void 0?"0":dn(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=yt(e),this._valueRange=yt(this.max)-yt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(yt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}W(So,"id","logarithmic"),W(So,"defaults",{ticks:{callback:jn.formatters.logarithmic,major:{enabled:!0}}});function Eo(t){const e=t.ticks;if(e.display&&t.display){const n=We(e.backdropPadding);return ie(e.font&&e.font.size,Ee.font.size)+n.height}return 0}function sp(t,e,n){return n=Se(n)?n:[n],{w:uu(t,e.string,n),h:n.length*e.lineHeight}}function bl(t,e,n,o,a){return t===o||t===a?{start:e-n/2,end:e+n/2}:t<o||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function lp(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),o=[],a=[],s=t._pointLabels.length,l=t.options.pointLabels,r=l.centerPointLabels?de/s:0;for(let c=0;c<s;c++){const d=l.setContext(t.getPointLabelContext(c));a[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+a[c],r),h=$e(d.font),f=sp(t.ctx,h,t._pointLabels[c]);o[c]=f;const m=Oe(t.getIndexAngle(c)+r),p=Math.round(Wi(m)),g=bl(p,u.x,f.w,0,180),b=bl(p,u.y,f.h,90,270);rp(n,e,m,g,b)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=up(t,o,a)}function rp(t,e,n,o,a){const s=Math.abs(Math.sin(n)),l=Math.abs(Math.cos(n));let r=0,c=0;o.start<e.l?(r=(e.l-o.start)/s,t.l=Math.min(t.l,e.l-r)):o.end>e.r&&(r=(o.end-e.r)/s,t.r=Math.max(t.r,e.r+r)),a.start<e.t?(c=(e.t-a.start)/l,t.t=Math.min(t.t,e.t-c)):a.end>e.b&&(c=(a.end-e.b)/l,t.b=Math.max(t.b,e.b+c))}function cp(t,e,n){const o=t.drawingArea,{extra:a,additionalAngle:s,padding:l,size:r}=n,c=t.getPointPosition(e,o+a+l,s),d=Math.round(Wi(Oe(c.angle+Ve))),u=mp(c.y,r.h,d),h=hp(d),f=fp(c.x,r.w,h);return{visible:!0,x:c.x,y:u,textAlign:h,left:f,top:u,right:f+r.w,bottom:u+r.h}}function dp(t,e){if(!e)return!0;const{left:n,top:o,right:a,bottom:s}=t;return!(ct({x:n,y:o},e)||ct({x:n,y:s},e)||ct({x:a,y:o},e)||ct({x:a,y:s},e))}function up(t,e,n){const o=[],a=t._pointLabels.length,s=t.options,{centerPointLabels:l,display:r}=s.pointLabels,c={extra:Eo(s)/2,additionalAngle:l?de/a:0};let d;for(let u=0;u<a;u++){c.padding=n[u],c.size=e[u];const h=cp(t,u,c);o.push(h),r==="auto"&&(h.visible=dp(h,d),h.visible&&(d=h))}return o}function hp(t){return t===0||t===180?"center":t<180?"left":"right"}function fp(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function mp(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function pp(t,e,n){const{left:o,top:a,right:s,bottom:l}=n,{backdropColor:r}=e;if(!ae(r)){const c=$t(e.borderRadius),d=We(e.backdropPadding);t.fillStyle=r;const u=o-d.left,h=a-d.top,f=s-o+d.width,m=l-a+d.height;Object.values(c).some(p=>p!==0)?(t.beginPath(),hn(t,{x:u,y:h,w:f,h:m,radius:c}),t.fill()):t.fillRect(u,h,f,m)}}function gp(t,e){const{ctx:n,options:{pointLabels:o}}=t;for(let a=e-1;a>=0;a--){const s=t._pointLabelItems[a];if(!s.visible)continue;const l=o.setContext(t.getPointLabelContext(a));pp(n,l,s);const r=$e(l.font),{x:c,y:d,textAlign:u}=s;Dt(n,t._pointLabels[a],c,d+r.lineHeight/2,r,{color:l.color,textAlign:u,textBaseline:"middle"})}}function _l(t,e,n,o){const{ctx:a}=t;if(n)a.arc(t.xCenter,t.yCenter,e,0,Ce);else{let s=t.getPointPosition(0,e);a.moveTo(s.x,s.y);for(let l=1;l<o;l++)s=t.getPointPosition(l,e),a.lineTo(s.x,s.y)}}function bp(t,e,n,o,a){const s=t.ctx,l=e.circular,{color:r,lineWidth:c}=e;!l&&!o||!r||!c||n<0||(s.save(),s.strokeStyle=r,s.lineWidth=c,s.setLineDash(a.dash||[]),s.lineDashOffset=a.dashOffset,s.beginPath(),_l(t,n,l,o),s.closePath(),s.stroke(),s.restore())}function _p(t,e,n){return kt(t,{label:n,index:e,type:"pointLabel"})}class Sn extends bi{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=We(Eo(this.options)/2),n=this.width=this.maxWidth-e.width,o=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+o/2+e.top),this.drawingArea=Math.floor(Math.min(n,o)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=Me(e)&&!isNaN(e)?e:0,this.max=Me(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Eo(this.options))}generateTickLabels(e){bi.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,o)=>{const a=ke(this.options.pointLabels.callback,[n,o],this);return a||a===0?a:""}).filter((n,o)=>this.chart.getDataVisibility(o))}fit(){const e=this.options;e.display&&e.pointLabels.display?lp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,o,a){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((o-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,o,a))}getIndexAngle(e){const n=Ce/(this._pointLabels.length||1),o=this.options.startAngle||0;return Oe(e*n+Ze(o))}getDistanceFromCenterForValue(e){if(ae(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(ae(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const o=n[e];return _p(this.getContext(),e,o)}}getPointPosition(e,n,o=0){const a=this.getIndexAngle(e)-Ve+o;return{x:Math.cos(a)*n+this.xCenter,y:Math.sin(a)*n+this.yCenter,angle:a}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:o,right:a,bottom:s}=this._pointLabelItems[e];return{left:n,top:o,right:a,bottom:s}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const o=this.ctx;o.save(),o.beginPath(),_l(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),o.closePath(),o.fillStyle=e,o.fill(),o.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:o,grid:a,border:s}=n,l=this._pointLabels.length;let r,c,d;if(n.pointLabels.display&&gp(this,l),a.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=a.setContext(f),p=s.setContext(f);bp(this,m,c,l,p)}}),o.display){for(e.save(),r=l-1;r>=0;r--){const u=o.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:f}=u;!f||!h||(e.lineWidth=f,e.strokeStyle=h,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),d=this.getPointPosition(r,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,o=n.ticks;if(!o.display)return;const a=this.getIndexAngle(0);let s,l;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const d=o.setContext(this.getContext(c)),u=$e(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,l=e.measureText(r.label).width,e.fillStyle=d.backdropColor;const h=We(d.backdropPadding);e.fillRect(-l/2-h.left,-s-u.size/2-h.top,l+h.width,u.size+h.height)}Dt(e,r.label,0,-s,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}W(Sn,"id","radialLinear"),W(Sn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:jn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),W(Sn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),W(Sn,"descriptors",{angleLines:{_fallback:"grid"}});const _i={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ke=Object.keys(_i);function yl(t,e){return t-e}function kl(t,e){if(ae(e))return null;const n=t._adapter,{parser:o,round:a,isoWeekday:s}=t._parseOpts;let l=e;return typeof o=="function"&&(l=o(l)),Me(l)||(l=typeof o=="string"?n.parse(l,o):n.parse(l)),l===null?null:(a&&(l=a==="week"&&(jt(s)||s===!0)?n.startOf(l,"isoWeek",s):n.startOf(l,a)),+l)}function xl(t,e,n,o){const a=Ke.length;for(let s=Ke.indexOf(t);s<a-1;++s){const l=_i[Ke[s]],r=l.steps?l.steps:Number.MAX_SAFE_INTEGER;if(l.common&&Math.ceil((n-e)/(r*l.size))<=o)return Ke[s]}return Ke[a-1]}function yp(t,e,n,o,a){for(let s=Ke.length-1;s>=Ke.indexOf(n);s--){const l=Ke[s];if(_i[l].common&&t._adapter.diff(a,o,l)>=e-1)return l}return Ke[n?Ke.indexOf(n):0]}function kp(t){for(let e=Ke.indexOf(t)+1,n=Ke.length;e<n;++e)if(_i[Ke[e]].common)return Ke[e]}function wl(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:o,hi:a}=ji(n,e),s=n[o]>=e?n[o]:n[a];t[s]=!0}}function xp(t,e,n,o){const a=t._adapter,s=+a.startOf(e[0].value,o),l=e[e.length-1].value;let r,c;for(r=s;r<=l;r=+a.add(r,1,o))c=n[r],c>=0&&(e[c].major=!0);return e}function Cl(t,e,n){const o=[],a={},s=e.length;let l,r;for(l=0;l<s;++l)r=e[l],a[r]=l,o.push({value:r,major:!1});return s===0||!n?o:xp(t,o,a,n)}class En extends Pt{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const o=e.time||(e.time={}),a=this._adapter=new vh._date(e.adapters.date);a.init(n),an(o.displayFormats,a.formats()),this._parseOpts={parser:o.parser,round:o.round,isoWeekday:o.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:kl(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,o=e.time.unit||"day";let{min:a,max:s,minDefined:l,maxDefined:r}=this.getUserBounds();function c(d){!l&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!r&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!l||!r)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=Me(a)&&!isNaN(a)?a:+n.startOf(Date.now(),o),s=Me(s)&&!isNaN(s)?s:+n.endOf(Date.now(),o)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],o=e[e.length-1]),{min:n,max:o}}buildTicks(){const e=this.options,n=e.time,o=e.ticks,a=o.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,l=this.max,r=Zd(a,s,l);return this._unit=n.unit||(o.autoSkip?xl(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):yp(this,r.length,n.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:kp(this._unit),this.initOffsets(a),e.reverse&&r.reverse(),Cl(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,o=0,a,s;this.options.offset&&e.length&&(a=this.getDecimalForValue(e[0]),e.length===1?n=1-a:n=(this.getDecimalForValue(e[1])-a)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?o=s:o=(s-this.getDecimalForValue(e[e.length-2]))/2);const l=e.length<3?.5:.25;n=Ie(n,0,l),o=Ie(o,0,l),this._offsets={start:n,end:o,factor:1/(n+1+o)}}_generate(){const e=this._adapter,n=this.min,o=this.max,a=this.options,s=a.time,l=s.unit||xl(s.minUnit,n,o,this._getLabelCapacity(n)),r=ie(a.ticks.stepSize,1),c=l==="week"?s.isoWeekday:!1,d=jt(c)||c===!0,u={};let h=n,f,m;if(d&&(h=+e.startOf(h,"isoWeek",c)),h=+e.startOf(h,d?"day":l),e.diff(o,n,l)>1e5*r)throw new Error(n+" and "+o+" are too far apart with stepSize of "+r+" "+l);const p=a.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<o;f=+e.add(f,r,l),m++)wl(u,f,p);return(f===o||a.bounds==="ticks"||m===1)&&wl(u,f,p),Object.keys(u).sort(yl).map(g=>+g)}getLabelForValue(e){const n=this._adapter,o=this.options.time;return o.tooltipFormat?n.format(e,o.tooltipFormat):n.format(e,o.displayFormats.datetime)}format(e,n){const a=this.options.time.displayFormats,s=this._unit,l=n||a[s];return this._adapter.format(e,l)}_tickFormatFunction(e,n,o,a){const s=this.options,l=s.ticks.callback;if(l)return ke(l,[e,n,o],this);const r=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&r[c],h=d&&r[d],f=o[n],m=d&&h&&f&&f.major;return this._adapter.format(e,a||(m?h:u))}generateTickLabels(e){let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n],a.label=this._tickFormatFunction(a.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,o=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+o)*n.factor)}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+o*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,o=this.ctx.measureText(e).width,a=Ze(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(a),l=Math.sin(a),r=this._resolveTickFontOptions(0).size;return{w:o*s+r*l,h:o*l+r*s}}_getLabelCapacity(e){const n=this.options.time,o=n.displayFormats,a=o[n.unit]||o.millisecond,s=this._tickFormatFunction(e,0,Cl(this,[e],this._majorUnit),a),l=this._getLabelSize(s),r=Math.floor(this.isHorizontal()?this.width/l.w:this.height/l.h)-1;return r>0?r:1}getDataTimestamps(){let e=this._cache.data||[],n,o;if(e.length)return e;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,o=a.length;n<o;++n)e=e.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,o;if(e.length)return e;const a=this.getLabels();for(n=0,o=a.length;n<o;++n)e.push(kl(this,a[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return wa(e.sort(yl))}}W(En,"id","time"),W(En,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function yi(t,e,n){let o=0,a=t.length-1,s,l,r,c;n?(e>=t[o].pos&&e<=t[a].pos&&({lo:o,hi:a}=rt(t,"pos",e)),{pos:s,time:r}=t[o],{pos:l,time:c}=t[a]):(e>=t[o].time&&e<=t[a].time&&({lo:o,hi:a}=rt(t,"time",e)),{time:s,pos:r}=t[o],{time:l,pos:c}=t[a]);const d=l-s;return d?r+(c-r)*(e-s)/d:r}class Mo extends En{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=yi(n,this.min),this._tableRange=yi(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:o}=this,a=[],s=[];let l,r,c,d,u;for(l=0,r=e.length;l<r;++l)d=e[l],d>=n&&d<=o&&a.push(d);if(a.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(l=0,r=a.length;l<r;++l)u=a[l+1],c=a[l-1],d=a[l],Math.round((u+c)/2)!==d&&s.push({time:d,pos:l/(r-1)});return s}_generate(){const e=this.min,n=this.max;let o=super.getDataTimestamps();return(!o.includes(e)||!o.length)&&o.splice(0,0,e),(!o.includes(n)||o.length===1)&&o.push(n),o.sort((a,s)=>a-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),o=this.getLabelTimestamps();return n.length&&o.length?e=this.normalize(n.concat(o)):e=n.length?n:o,e=this._cache.all=e,e}getDecimalForValue(e){return(yi(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return yi(this._table,o*this._tableRange+this._minPos,!0)}}W(Mo,"id","timeseries"),W(Mo,"defaults",En.defaults);var wp=Object.freeze({__proto__:null,CategoryScale:Co,LinearScale:Bo,LogarithmicScale:So,RadialLinearScale:Sn,TimeScale:En,TimeSeriesScale:Mo});const Cp=[Mh,om,Qm,wp];function ue(t){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(t).trim()}function Bl(){const t={primary:ue("--chart-1")||ue("--action-primary")||"#6366f1",success:ue("--chart-2")||ue("--status-success")||"#14b8a6",warning:ue("--chart-3")||ue("--status-warning")||"#f59e0b",error:ue("--chart-4")||ue("--status-error")||"#f87171",info:ue("--chart-5")||ue("--status-info")||"#3b82f6",text:ue("--chart-text")||ue("--text-primary")||"#1c1917",textMuted:ue("--chart-text-muted")||ue("--text-secondary")||"#78716c",gridLines:ue("--chart-grid")||ue("--border-default")||"#e7e5e4",tooltipBg:ue("--chart-tooltip-bg")||ue("--tooltip-bg")||"#1c1917",tooltipText:ue("--chart-tooltip-text")||ue("--tooltip-text")||"#fafaf9",tooltipBorder:ue("--chart-tooltip-border")||"transparent",legendText:ue("--chart-legend-text")||ue("--text-secondary")||"#78716c"},e=ue("--font-sans")||"system-ui, -apple-system, sans-serif",n=[ue("--chart-1")||t.primary,ue("--chart-2")||t.success,ue("--chart-3")||t.warning,ue("--chart-4")||t.error,ue("--chart-5")||t.info,ue("--chart-6")||"#8b5cf6",ue("--chart-7")||"#ec4899",ue("--chart-8")||"#06b6d4"];return{colors:t,fontFamily:e,palette:n}}function Mn(){const t=i.ref(Bl()),e=i.ref(0);let n=null;function o(){t.value=Bl(),e.value++}i.onMounted(()=>{o();let u=null;n=new MutationObserver(h=>{for(const f of h)if(f.type==="attributes"&&(f.attributeName==="data-theme"||f.attributeName==="class")){u!==null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{requestAnimationFrame(()=>{o(),u=null})});break}}),n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]})}),i.onUnmounted(()=>{n==null||n.disconnect()});const a=i.computed(()=>t.value.colors.gridLines),s=i.computed(()=>t.value.colors.text),l=i.computed(()=>t.value.colors.textMuted);function r(){return{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{grid:{display:!1},border:{display:!1},ticks:{color:t.value.colors.textMuted,font:{family:t.value.fontFamily,size:12}}},y:{grid:{color:t.value.colors.gridLines},border:{display:!1},ticks:{color:t.value.colors.textMuted,font:{family:t.value.fontFamily,size:12}}}}}}function c(u){return t.value.palette[u%t.value.palette.length]}function d(u,h){const f=c(u);if(f.startsWith("oklch")||f.startsWith("rgb"))return f.replace(")",` / ${h})`).replace("rgb(","rgba(").replace("oklch(","oklch(");if(f.startsWith("#")){const m=f.slice(1),p=parseInt(m.slice(0,2),16),g=parseInt(m.slice(2,4),16),b=parseInt(m.slice(4,6),16);return`rgba(${p}, ${g}, ${b}, ${h})`}return f}return{theme:t,themeVersion:e,gridColor:a,textColor:s,mutedTextColor:l,getDefaultOptions:r,getColor:c,getColorWithOpacity:d,updateTheme:o}}const Bp=["aria-label"],Sp={class:"ui-chart__sr-table"},Ep={scope:"row"},Mp={key:0,class:"ui-chart__tooltip-title"},vp={class:"ui-chart__tooltip-label"},Vp={class:"ui-chart__tooltip-value"},ki=O(i.defineComponent({__name:"BaseChart",props:{type:{},data:{},options:{},height:{default:300},ariaLabel:{}},emits:["legendClick","pointClick"],setup(t,{expose:e,emit:n}){ut.register(...Cp);const o=t,a=n,s=i.ref(null),l=i.ref(null),r=i.shallowRef(null),{theme:c,themeVersion:d,getDefaultOptions:u}=Mn(),h=i.ref(null),f=i.ref([]),m=i.computed(()=>typeof o.height=="number"?`${o.height}px`:o.height);function p(){if(!r.value)return[];const x=r.value;return x.data.datasets.map((w,M)=>({label:w.label||`Dataset ${M+1}`,color:Array.isArray(w.backgroundColor)?w.backgroundColor[0]:w.backgroundColor||w.borderColor||c.value.palette[M],hidden:!x.isDatasetVisible(M),datasetIndex:M}))}function g(x){if(!r.value)return;const S=r.value,w=S.isDatasetVisible(x);S.setDatasetVisibility(x,!w),S.update(),f.value=p(),a("legendClick",f.value[x],x)}function b(x){var T,$;const{chart:S,tooltip:w}=x;if(w.opacity===0||!((T=w.dataPoints)!=null&&T.length)){h.value=null;return}const M=S.canvas.getBoundingClientRect(),N=w.dataPoints.map(K=>({label:K.dataset.label||"",value:String(K.formattedValue),color:K.dataset.borderColor||(Array.isArray(K.dataset.backgroundColor)?K.dataset.backgroundColor[K.dataIndex]:K.dataset.backgroundColor)||""}));h.value={title:(($=w.title)==null?void 0:$[0])||"",items:N,x:M.left+w.caretX,y:M.top+w.caretY}}function _(x){if(!r.value||!s.value)return;const S=r.value,w=S.getElementsAtEventForMode(x,"nearest",{intersect:!0},!1);if(w.length>0){const M=w[0],N=M.datasetIndex,T=M.index,$=S.data.datasets[N],K=S.data.labels||[],P=(Array.isArray($.data[T]),$.data[T]);a("pointClick",{datasetIndex:N,index:T,label:String(K[T]||""),value:P,datasetLabel:$.label||""})}}function k(){const x=u(),S=o.options||{},w=x.plugins||{},M=S.plugins||{},N={...x,...S,plugins:{...w,...M,tooltip:{enabled:!1,external:b,mode:"index",intersect:!1,animation:!1,...M.tooltip||{}}},interaction:{mode:"index",intersect:!1,...S.interaction||{}}};return o.type!=="doughnut"&&o.type!=="pie"&&(N.scales={...x.scales||{},...S.scales||{}}),N}function B(){s.value&&(r.value&&r.value.destroy(),r.value=new ut(s.value,{type:o.type,data:o.data,options:k()}),f.value=p())}function C(){r.value&&(r.value.data=o.data,r.value.options=k(),r.value.update(),f.value=p())}let y=null;return i.onMounted(()=>{B(),l.value&&(y=new ResizeObserver(()=>{var x;(x=r.value)==null||x.resize()}),y.observe(l.value))}),i.onUnmounted(()=>{var x;y==null||y.disconnect(),(x=r.value)==null||x.destroy(),r.value=null}),i.watch(()=>o.data,C,{deep:!0}),i.watch(()=>o.type,B),i.watch(d,()=>{i.nextTick(C)}),e({chart:r,toggleDataset:g,legendItems:f}),(x,S)=>(i.openBlock(),i.createElementBlock("div",{class:"ui-chart",ref_key:"containerRef",ref:l},[i.renderSlot(x.$slots,"legend",{items:f.value,toggle:g},void 0,!0),i.createElementVNode("div",{class:"ui-chart__canvas-container",style:i.normalizeStyle({height:m.value})},[i.createElementVNode("canvas",{ref_key:"canvasRef",ref:s,"aria-label":t.ariaLabel,role:"img",onClick:_},[i.renderSlot(x.$slots,"fallback",{},()=>[i.createElementVNode("table",Sp,[i.createElementVNode("caption",null,i.toDisplayString(t.ariaLabel||"Chart data"),1),i.createElementVNode("thead",null,[i.createElementVNode("tr",null,[S[0]||(S[0]=i.createElementVNode("th",{scope:"col"},"Label",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.data.datasets||[],(w,M)=>(i.openBlock(),i.createElementBlock("th",{key:M,scope:"col"},i.toDisplayString(w.label||`Series ${M+1}`),1))),128))])]),i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.data.labels||[],(w,M)=>(i.openBlock(),i.createElementBlock("tr",{key:M},[i.createElementVNode("th",Ep,i.toDisplayString(w),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.data.datasets||[],(N,T)=>{var $;return i.openBlock(),i.createElementBlock("td",{key:T},i.toDisplayString(($=N.data)==null?void 0:$[M]),1)}),128))]))),128))])])],!0)],8,Bp)],4),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.renderSlot(x.$slots,"tooltip",{data:h.value},()=>[h.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-chart__tooltip",style:i.normalizeStyle({left:`${h.value.x}px`,top:`${h.value.y}px`})},[h.value.title?(i.openBlock(),i.createElementBlock("div",Mp,i.toDisplayString(h.value.title),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value.items,(w,M)=>(i.openBlock(),i.createElementBlock("div",{key:M,class:"ui-chart__tooltip-item"},[i.createElementVNode("span",{class:"ui-chart__tooltip-color",style:i.normalizeStyle({backgroundColor:w.color})},null,4),i.createElementVNode("span",vp,i.toDisplayString(w.label),1),i.createElementVNode("span",Vp,i.toDisplayString(w.value),1)]))),128))],4)):i.createCommentVNode("",!0)],!0)]))],512))}}),[["__scopeId","data-v-b70ab7bc"]]),Dp={class:"ui-line-chart__legend"},$p=["onClick"],Tp={class:"ui-line-chart__legend-label"},Ip=O(i.defineComponent({__name:"LineChart",props:{labels:{},series:{},height:{default:300},fill:{type:Boolean,default:!1},tension:{default:.4},showPoints:{type:Boolean,default:!0},pointRadius:{default:4},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},ariaLabel:{},showLegend:{type:Boolean,default:!0}},emits:["pointClick"],setup(t,{emit:e}){const n=t,o=e,{theme:a,getColor:s,getColorWithOpacity:l}=Mn(),r=i.computed(()=>({labels:n.labels,datasets:n.series.map((d,u)=>({label:d.name,data:d.data,borderColor:s(u),backgroundColor:n.fill?l(u,.1):"transparent",borderWidth:2,fill:n.fill,tension:n.tension,pointRadius:n.showPoints?n.pointRadius:0,pointHoverRadius:n.showPoints?n.pointRadius+2:4,pointBackgroundColor:s(u),pointBorderColor:a.value.colors.tooltipText,pointBorderWidth:2}))})),c=i.computed(()=>({scales:{x:{display:n.showXAxis,grid:{display:!1},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}},y:{display:n.showYAxis,grid:{display:n.showGrid,color:a.value.colors.gridLines},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}}},interaction:{mode:"index",intersect:!1}}));return(d,u)=>(i.openBlock(),i.createBlock(ki,{type:"line",data:r.value,options:c.value,height:t.height,"aria-label":t.ariaLabel,onPointClick:u[0]||(u[0]=h=>o("pointClick",h))},i.createSlots({tooltip:i.withCtx(({data:h})=>[i.renderSlot(d.$slots,"tooltip",{data:h},void 0,!0)]),_:2},[t.showLegend||d.$slots.legend?{name:"legend",fn:i.withCtx(({items:h,toggle:f})=>[i.renderSlot(d.$slots,"legend",{items:h,toggle:f},()=>[i.createElementVNode("div",Dp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h,(m,p)=>(i.openBlock(),i.createElementBlock("button",{key:p,type:"button",class:i.normalizeClass(["ui-line-chart__legend-item",{"ui-line-chart__legend-item--hidden":m.hidden}]),onClick:g=>f(p)},[i.createElementVNode("span",{class:"ui-line-chart__legend-color",style:i.normalizeStyle({backgroundColor:m.color})},null,4),i.createElementVNode("span",Tp,i.toDisplayString(m.label),1)],10,$p))),128))])],!0)]),key:"0"}:void 0]),1032,["data","options","height","aria-label"]))}}),[["__scopeId","data-v-2e8f34b7"]]),Lp={class:"ui-bar-chart__legend"},zp=["onClick"],Np={class:"ui-bar-chart__legend-label"},Pp=O(i.defineComponent({__name:"BarChart",props:{labels:{},series:{},height:{default:300},horizontal:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},borderRadius:{default:4},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},ariaLabel:{},showLegend:{type:Boolean,default:!0}},emits:["pointClick"],setup(t,{emit:e}){const n=t,o=e,{theme:a,getColor:s}=Mn(),l=i.computed(()=>({labels:n.labels,datasets:n.series.map((c,d)=>({label:c.name,data:c.data,backgroundColor:s(d),borderColor:"transparent",borderWidth:0,borderRadius:n.borderRadius,borderSkipped:!1}))})),r=i.computed(()=>({indexAxis:n.horizontal?"y":"x",scales:{x:{display:n.showXAxis,stacked:n.stacked,grid:{display:n.horizontal?n.showGrid:!1,color:a.value.colors.gridLines},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}},y:{display:n.showYAxis,stacked:n.stacked,grid:{display:n.horizontal?!1:n.showGrid,color:a.value.colors.gridLines},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}}},interaction:{mode:"index",axis:n.horizontal?"y":"x",intersect:!1}}));return(c,d)=>(i.openBlock(),i.createBlock(ki,{type:"bar",data:l.value,options:r.value,height:t.height,"aria-label":t.ariaLabel,onPointClick:d[0]||(d[0]=u=>o("pointClick",u))},i.createSlots({tooltip:i.withCtx(({data:u})=>[i.renderSlot(c.$slots,"tooltip",{data:u},void 0,!0)]),_:2},[t.showLegend||c.$slots.legend?{name:"legend",fn:i.withCtx(({items:u,toggle:h})=>[i.renderSlot(c.$slots,"legend",{items:u,toggle:h},()=>[i.createElementVNode("div",Lp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u,(f,m)=>(i.openBlock(),i.createElementBlock("button",{key:m,type:"button",class:i.normalizeClass(["ui-bar-chart__legend-item",{"ui-bar-chart__legend-item--hidden":f.hidden}]),onClick:p=>h(m)},[i.createElementVNode("span",{class:"ui-bar-chart__legend-color",style:i.normalizeStyle({backgroundColor:f.color})},null,4),i.createElementVNode("span",Np,i.toDisplayString(f.label),1)],10,zp))),128))])],!0)]),key:"0"}:void 0]),1032,["data","options","height","aria-label"]))}}),[["__scopeId","data-v-bdd7ef89"]]),Ap={class:"ui-donut-chart__legend"},Rp={class:"ui-donut-chart__legend-label"},Op={class:"ui-donut-chart__legend-value"},Fp={class:"ui-donut-chart__container"},Wp={key:0,class:"ui-donut-chart__center"},Hp={key:0,class:"ui-donut-chart__center-value"},jp={key:1,class:"ui-donut-chart__center-label"},Yp={class:"ui-donut-chart__legend"},Up={class:"ui-donut-chart__legend-label"},Xp={class:"ui-donut-chart__legend-value"},Kp=O(i.defineComponent({__name:"DonutChart",props:{segments:{},height:{default:300},cutout:{default:65},ariaLabel:{},showLegend:{type:Boolean,default:!0},legendPosition:{default:"right"},centerLabel:{},centerValue:{}},emits:["segmentClick"],setup(t,{emit:e}){const n=t,o=e,{getColor:a}=Mn(),s=i.computed(()=>({labels:n.segments.map(h=>h.label),datasets:[{data:n.segments.map(h=>h.value),backgroundColor:n.segments.map((h,f)=>h.color||a(f)),borderWidth:0,hoverOffset:4}]})),l=i.computed(()=>({cutout:`${n.cutout}%`,plugins:{legend:{display:!1}},interaction:{mode:"nearest",intersect:!0}})),r=i.computed(()=>n.segments.reduce((h,f)=>h+f.value,0)),c=i.computed(()=>n.segments.map((h,f)=>({label:h.label,color:h.color||a(f),hidden:!1,datasetIndex:f})));function d(h){return`${Math.round(h/r.value*100)}%`}function u(h){const f=h.index,m=n.segments[f];m&&o("segmentClick",{segment:m,index:f,percentage:Math.round(m.value/r.value*100)})}return(h,f)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-donut-chart",[`ui-donut-chart--legend-${t.legendPosition}`]])},[t.showLegend&&(t.legendPosition==="top"||t.legendPosition==="left")?i.renderSlot(h.$slots,"legend",{key:0,items:c.value,toggle:()=>{}},()=>[i.createElementVNode("div",Ap,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.segments,(m,p)=>(i.openBlock(),i.createElementBlock("div",{key:p,class:"ui-donut-chart__legend-item"},[i.createElementVNode("span",{class:"ui-donut-chart__legend-color",style:i.normalizeStyle({backgroundColor:m.color||i.unref(a)(p)})},null,4),i.createElementVNode("span",Rp,i.toDisplayString(m.label),1),i.createElementVNode("span",Op,i.toDisplayString(d(m.value)),1)]))),128))])],!0):i.createCommentVNode("",!0),i.createElementVNode("div",Fp,[i.createVNode(ki,{type:"doughnut",data:s.value,options:l.value,height:t.height,"aria-label":t.ariaLabel,onPointClick:u},{legend:i.withCtx(()=>[...f[0]||(f[0]=[])]),tooltip:i.withCtx(({data:m})=>[i.renderSlot(h.$slots,"tooltip",{data:m},void 0,!0)]),_:3},8,["data","options","height","aria-label"]),t.centerLabel||t.centerValue||h.$slots.center?(i.openBlock(),i.createElementBlock("div",Wp,[i.renderSlot(h.$slots,"center",{},()=>[t.centerValue?(i.openBlock(),i.createElementBlock("div",Hp,i.toDisplayString(t.centerValue),1)):i.createCommentVNode("",!0),t.centerLabel?(i.openBlock(),i.createElementBlock("div",jp,i.toDisplayString(t.centerLabel),1)):i.createCommentVNode("",!0)],!0)])):i.createCommentVNode("",!0)]),t.showLegend&&(t.legendPosition==="bottom"||t.legendPosition==="right")?i.renderSlot(h.$slots,"legend",{key:1,items:c.value,toggle:()=>{}},()=>[i.createElementVNode("div",Yp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.segments,(m,p)=>(i.openBlock(),i.createElementBlock("div",{key:p,class:"ui-donut-chart__legend-item"},[i.createElementVNode("span",{class:"ui-donut-chart__legend-color",style:i.normalizeStyle({backgroundColor:m.color||i.unref(a)(p)})},null,4),i.createElementVNode("span",Up,i.toDisplayString(m.label),1),i.createElementVNode("span",Xp,i.toDisplayString(d(m.value)),1)]))),128))])],!0):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-1af3565d"]]);function Le(t,e="0 0 24 24"){return n=>i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:e,fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",class:n.class},t.map(o=>i.h("path",{d:o})))}function qp(t,e="0 0 24 24"){return n=>i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:e,fill:"currentColor",class:n.class},t.map(o=>i.h("path",{d:o})))}const Sl={sortAsc:Le(["M4 10l4-4 4 4"],"0 0 16 16"),sortDesc:Le(["M4 6l4 4 4-4"],"0 0 16 16"),sortNeutral:Le(["M4 6l4-3 4 3","M4 10l4 3 4-3"],"0 0 16 16"),expand:Le(["M6 9l6 6 6-6"]),collapse:Le(["M18 15l-6-6-6 6"]),close:Le(["M18 6L6 18","M6 6l12 12"]),search:Le(["M11 19a8 8 0 100-16 8 8 0 000 16z","M21 21l-4.35-4.35"]),check:Le(["M20 6L9 17l-5-5"]),info:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M12 16v-4","M12 8h.01"]),success:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M9 12l2 2 4-4"]),warning:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M12 8v4","M12 16h.01"]),error:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M15 9l-6 6","M9 9l6 6"]),emptyData:Le(["M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"]),emptySearch:Le(["M11 19a8 8 0 100-16 8 8 0 000 16z","M21 21l-4.35-4.35"]),calendar:Le(["M8 2v4","M16 2v4","M3 10h18","M5 4h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2z"]),chevronLeft:Le(["M15 18l-6-6 6-6"]),chevronRight:Le(["M9 18l6-6-6-6"]),star:Le(["M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"]),starFilled:qp(["M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"])},xi=i.shallowRef({...Sl});function Gp(t){xi.value={...xi.value,...t}}function Jp(){xi.value={...Sl}}function ve(t){return xi.value[t]}const Zp={class:"ui-empty-state__content"},Qp={key:0,class:"ui-empty-state__icon"},eg={key:1,class:"ui-empty-state__icon ui-empty-state__icon--default"},tg={key:2,class:"ui-empty-state__title"},ng={key:3,class:"ui-empty-state__description"},ig={key:4,class:"ui-empty-state__action"},El=O(i.defineComponent({__name:"EmptyState",props:{title:{},description:{},icon:{},variant:{default:"default"},compact:{type:Boolean,default:!1}},setup(t){const e=t,n=i.useSlots(),o=i.computed(()=>{if(e.icon)return null;switch(e.variant){case"search":return ve("emptySearch");case"error":return ve("error");default:return ve("emptyData")}}),a=i.computed(()=>!!e.icon),s=i.computed(()=>!!e.title),l=i.computed(()=>!!e.description),r=i.computed(()=>!!n.default);return(c,d)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-empty-state",[`ui-empty-state--${t.variant}`,{"ui-empty-state--compact":t.compact}]])},[i.createElementVNode("div",Zp,[a.value?(i.openBlock(),i.createElementBlock("div",Qp,[i.createVNode(je,{icon:t.icon,size:"48px"},null,8,["icon"])])):(i.openBlock(),i.createElementBlock("div",eg,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(o.value),{class:"ui-empty-state__icon-svg"}))])),s.value?(i.openBlock(),i.createElementBlock("div",tg,i.toDisplayString(t.title),1)):i.createCommentVNode("",!0),l.value?(i.openBlock(),i.createElementBlock("div",ng,i.toDisplayString(t.description),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("div",ig,[i.renderSlot(c.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-ef3bb591"]]),wi=O(i.defineComponent({__name:"Skeleton",props:{variant:{default:"text"},width:{},height:{},animation:{default:"shimmer"}},setup(t){const e=t,n=a=>{if(a!==void 0)return typeof a=="number"?`${a}px`:/^\d+(\.\d+)?$/.test(a)?`${a}px`:a},o=i.computed(()=>({width:n(e.width),height:n(e.height)}));return(a,s)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass(["ui-skeleton",[`ui-skeleton--${t.variant}`,`ui-skeleton--${t.animation}`]]),style:i.normalizeStyle(o.value),"aria-hidden":"true"},null,6))}}),[["__scopeId","data-v-656e0ee8"]]);function Ml(t,e,n=1,o=!0){if(e<=0)return[];if(e===1)return[1];const a=Math.max(1,Math.min(t,e)),s=Math.max(a-n,1),l=Math.min(a+n,e);if(!o){const m=[],p=s>1,g=l<e;p&&m.push("ellipsis");for(let b=s;b<=l;b++)m.push(b);return g&&m.push("ellipsis"),m}const r=n*2+5;if(e<=r){const m=[];for(let p=1;p<=e;p++)m.push(p);return m}const c=s>2,d=l<e-1,u=[];u.push(1),c&&u.push("ellipsis");const h=c?s:2,f=d?l:e-1;for(let m=h;m<=f;m++)u.push(m);return d&&u.push("ellipsis"),e>1&&u.push(e),u}const og={class:"ui-pagination__list",role:"list"},ag={key:0,class:"ui-pagination__ellipsis","aria-hidden":"true"},vl=O(i.defineComponent({__name:"Pagination",props:{modelValue:{},total:{},pageSize:{default:10},siblingCount:{default:1},showEdges:{type:Boolean,default:!0},size:{default:"md"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=ve("chevronLeft"),o=ve("chevronRight"),a=t,s=e,l=i.computed(()=>a.total<=0||a.pageSize<=0?0:Math.ceil(a.total/a.pageSize)),r=i.computed(()=>Math.max(1,Math.min(a.modelValue,l.value))),c=i.computed(()=>Ml(r.value,l.value,a.siblingCount,a.showEdges)),d=i.computed(()=>r.value<=1),u=i.computed(()=>r.value>=l.value);function h(g){if(a.disabled)return;const b=Math.max(1,Math.min(g,l.value));b!==a.modelValue&&s("update:modelValue",b)}function f(){d.value||h(r.value-1)}function m(){u.value||h(r.value+1)}const p=i.computed(()=>a.size==="sm"?"xs":a.size==="lg"?"md":"sm");return(g,b)=>(i.openBlock(),i.createElementBlock("nav",{class:i.normalizeClass(["ui-pagination",[`ui-pagination--${t.size}`,{"ui-pagination--disabled":t.disabled}]]),role:"navigation","aria-label":"Pagination"},[i.createVNode(Je,{variant:"ghost",size:p.value,disabled:t.disabled||d.value,"icon-left":i.unref(n),"aria-label":"Go to previous page",onClick:f},null,8,["size","disabled","icon-left"]),i.createElementVNode("ul",og,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,(_,k)=>(i.openBlock(),i.createElementBlock("li",{key:_==="ellipsis"?`ellipsis-${k}`:_,class:"ui-pagination__item"},[_==="ellipsis"?(i.openBlock(),i.createElementBlock("span",ag," … ")):(i.openBlock(),i.createBlock(Je,{key:1,variant:_===r.value?"secondary":"ghost",size:p.value,disabled:t.disabled,"aria-label":`Go to page ${_}`,"aria-current":_===r.value?"page":void 0,class:i.normalizeClass(["ui-pagination__button",{"ui-pagination__button--current":_===r.value}]),onClick:B=>h(_)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(_),1)]),_:2},1032,["variant","size","disabled","aria-label","aria-current","class","onClick"]))]))),128))]),i.createVNode(Je,{variant:"ghost",size:p.value,disabled:t.disabled||u.value,"icon-left":i.unref(o),"aria-label":"Go to next page",onClick:m},null,8,["size","disabled","icon-left"])],2))}}),[["__scopeId","data-v-686c5710"]]),sg=["for"],lg={key:0,class:"ui-select__required","aria-hidden":"true"},rg=["id","disabled","aria-expanded","aria-controls","aria-activedescendant","aria-invalid","aria-describedby","aria-required"],cg={class:"ui-select__value"},dg=["name","value","required","disabled"],ug={value:"",disabled:""},hg=["value","disabled"],fg=["id","aria-labelledby"],mg=["id","aria-selected","aria-disabled","onMouseenter","onClick"],pg={key:0,class:"ui-select__check",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},gg=["id"],bg=["id"],Vl=O(i.defineComponent({__name:"Select",props:{modelValue:{default:null},options:{},label:{},placeholder:{default:"Select an option"},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},block:{type:Boolean,default:!1},id:{},name:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(null),s=i.ref(null),l=i.ref(!1),r=i.ref(-1),c=ye("select"),d=i.computed(()=>n.id||c),u=i.computed(()=>`${d.value}-listbox`),h=i.computed(()=>`${d.value}-hint`),f=i.computed(()=>`${d.value}-error`);function m(P){return`${d.value}-option-${P}`}const p=i.computed(()=>{if(n.error)return f.value;if(n.hint)return h.value}),g=i.computed(()=>n.options.find(P=>P.value===n.modelValue)),b=i.computed(()=>{var P;return((P=g.value)==null?void 0:P.label)||""}),_=i.computed(()=>{if(!(!l.value||r.value<0))return m(r.value)}),k=i.ref({});function B(){if(!a.value)return;const P=a.value.getBoundingClientRect();k.value={position:"fixed",top:`${P.bottom+4}px`,left:`${P.left}px`,minWidth:`${P.width}px`,maxWidth:`${Math.max(P.width,300)}px`}}function C(){if(n.disabled||l.value)return;l.value=!0,B();const P=n.options.findIndex(A=>A.value===n.modelValue);P>=0&&!n.options[P].disabled?r.value=P:r.value=n.options.findIndex(A=>!A.disabled),i.nextTick(()=>{M()}),document.addEventListener("mousedown",S),window.addEventListener("resize",y),window.addEventListener("scroll",B,!0)}function y(){l.value&&(l.value=!1,r.value=-1,document.removeEventListener("mousedown",S),window.removeEventListener("resize",y),window.removeEventListener("scroll",B,!0))}function x(){l.value?y():C()}function S(P){var R,q;const A=P.target;(R=a.value)!=null&&R.contains(A)||(q=s.value)!=null&&q.contains(A)||y()}function w(P){var A;P.disabled||(o("update:modelValue",P.value),o("change",P.value),y(),(A=a.value)==null||A.focus())}function M(){if(!s.value||r.value<0)return;const P=s.value.children[r.value];P&&P.scrollIntoView({block:"nearest"})}function N(P){const A=n.options.length;let R=r.value;do R=(R+P+A)%A;while(n.options[R].disabled&&R!==r.value);n.options[R].disabled||(r.value=R,i.nextTick(M))}function T(P){switch(P.key){case"Enter":case" ":P.preventDefault(),l.value&&r.value>=0?w(n.options[r.value]):C();break;case"ArrowDown":P.preventDefault(),l.value?N(1):C();break;case"ArrowUp":P.preventDefault(),l.value?N(-1):C();break;case"Home":P.preventDefault(),l.value&&(r.value=n.options.findIndex(A=>!A.disabled),i.nextTick(M));break;case"End":if(P.preventDefault(),l.value){for(let A=n.options.length-1;A>=0;A--)if(!n.options[A].disabled){r.value=A;break}i.nextTick(M)}break;case"Escape":P.preventDefault(),y();break;case"Tab":y();break}}function $(P){n.options[P].disabled||(r.value=P)}function K(P,A){A.preventDefault(),w(P)}return i.onBeforeUnmount(()=>{document.removeEventListener("mousedown",S),window.removeEventListener("resize",y),window.removeEventListener("scroll",B,!0)}),(P,A)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-select",[`ui-select--${t.size}`,{"ui-select--block":t.block,"ui-select--disabled":t.disabled,"ui-select--error":t.error,"ui-select--open":l.value}]])},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:d.value,class:"ui-select__label"},[i.createTextVNode(i.toDisplayString(t.label)+" ",1),t.required?(i.openBlock(),i.createElementBlock("span",lg,"*")):i.createCommentVNode("",!0)],8,sg)):i.createCommentVNode("",!0),i.createElementVNode("button",{id:d.value,ref_key:"triggerRef",ref:a,type:"button",role:"combobox",class:i.normalizeClass(["ui-select__trigger",[`ui-select__trigger--${t.size}`,{"ui-select__trigger--error":t.error,"ui-select__trigger--placeholder":!g.value}]]),disabled:t.disabled,"aria-expanded":l.value,"aria-controls":u.value,"aria-activedescendant":_.value,"aria-invalid":t.error?"true":void 0,"aria-describedby":p.value,"aria-required":t.required,"aria-haspopup":"listbox",onClick:x,onKeydown:T},[i.createElementVNode("span",cg,i.toDisplayString(b.value||t.placeholder),1),(i.openBlock(),i.createElementBlock("svg",{class:i.normalizeClass(["ui-select__chevron",{"ui-select__chevron--open":l.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...A[0]||(A[0]=[i.createElementVNode("path",{d:"M6 9l6 6 6-6"},null,-1)])],2))],42,rg),t.name?(i.openBlock(),i.createElementBlock("select",{key:1,name:t.name,value:t.modelValue??"",required:t.required,disabled:t.disabled,class:"ui-select__native",tabindex:"-1","aria-hidden":"true"},[i.createElementVNode("option",ug,i.toDisplayString(t.placeholder),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.options,R=>(i.openBlock(),i.createElementBlock("option",{key:R.value,value:R.value,disabled:R.disabled},i.toDisplayString(R.label),9,hg))),128))],8,dg)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-select-menu"},{default:i.withCtx(()=>[l.value?(i.openBlock(),i.createElementBlock("ul",{key:0,id:u.value,ref_key:"listboxRef",ref:s,role:"listbox",class:"ui-select__listbox",style:i.normalizeStyle(k.value),"aria-labelledby":d.value},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.options,(R,q)=>(i.openBlock(),i.createElementBlock("li",{key:R.value,id:m(q),role:"option",class:i.normalizeClass(["ui-select__option",{"ui-select__option--selected":R.value===t.modelValue,"ui-select__option--highlighted":q===r.value,"ui-select__option--disabled":R.disabled}]),"aria-selected":R.value===t.modelValue,"aria-disabled":R.disabled,onMouseenter:Q=>$(q),onClick:Q=>K(R,Q)},[i.createTextVNode(i.toDisplayString(R.label)+" ",1),R.value===t.modelValue?(i.openBlock(),i.createElementBlock("svg",pg,[...A[1]||(A[1]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):i.createCommentVNode("",!0)],42,mg))),128))],12,fg)):i.createCommentVNode("",!0)]),_:1})])),t.error?(i.openBlock(),i.createElementBlock("p",{key:2,id:f.value,class:"ui-select__message ui-select__message--error",role:"alert"},i.toDisplayString(t.error),9,gg)):t.hint?(i.openBlock(),i.createElementBlock("p",{key:3,id:h.value,class:"ui-select__message ui-select__message--hint"},i.toDisplayString(t.hint),9,bg)):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1f24efa"]]),vo=O(i.defineComponent({__name:"Text",props:{as:{default:"p"},size:{default:"base"},weight:{default:"regular"},align:{default:"left"},muted:{type:Boolean},truncate:{type:Boolean},clamp:{}},setup(t){const e=t,n=i.computed(()=>["ui-text",`ui-text--${e.size}`,`ui-text--${e.weight}`,`ui-text--${e.align}`,{"ui-text--muted":e.muted,"ui-text--truncate":e.truncate&&!e.clamp,"ui-text--clamp":e.clamp}]),o=i.computed(()=>e.clamp?{WebkitLineClamp:e.clamp}:void 0);return(a,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(n.value),style:i.normalizeStyle(o.value)},{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-17686709"]]);function Dl(t,e){if(e)return e.split(".").reduce((n,o)=>{if(n&&typeof n=="object"&&Object.hasOwn(n,o))return n[o]},t)}const _g={key:0,class:"ui-table__toolbar"},yg={class:"ui-table__search"},kg={class:"ui-table__wrapper"},xg=["aria-busy"],wg={class:"ui-table__header"},Cg={class:"ui-table__header-row"},Bg={key:0,class:"ui-table__header-cell ui-table__header-cell--expand"},Sg={key:1,class:"ui-table__header-cell ui-table__header-cell--checkbox"},Eg=["aria-sort","tabindex","role","onClick","onKeydown"],Mg={class:"ui-table__header-content"},vg={class:"ui-table__header-text"},Vg=["onMousedown"],Dg={key:0,class:"ui-table__filter-row"},$g={key:0,class:"ui-table__filter-cell"},Tg={key:1,class:"ui-table__filter-cell"},Ig={class:"ui-table__body"},Lg={key:0,class:"ui-table__cell ui-table__cell--expand"},zg={key:1,class:"ui-table__cell ui-table__cell--checkbox"},Ng={key:1,class:"ui-table__row ui-table__row--empty"},Pg=["colspan"],Ag=["onClick"],Rg=["aria-expanded","aria-label","onClick"],Og=["data-label"],Fg=["colspan"],Wg={class:"ui-table__expansion-content"},Hg={key:1,class:"ui-table__footer"},jg={class:"ui-table__footer-summary"},Yg={class:"ui-table__footer-controls"},Ug={class:"ui-table__page-size"},Xg=O(i.defineComponent({__name:"DataTable",props:{data:{},columns:{},selectable:{type:Boolean,default:!1},selectedIds:{default:()=>[]},rowKey:{default:"id"},loading:{type:Boolean,default:!1},skeletonRows:{default:5},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},size:{default:"md"},emptyMessage:{default:"No data available"},bordered:{type:Boolean,default:!1},stickyHeader:{type:Boolean,default:!1},pagination:{type:[Boolean,Object],default:!1},page:{default:1},pageSize:{default:10},total:{},serverSide:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},search:{default:""},searchPlaceholder:{default:"Search..."},filterable:{type:Boolean,default:!1},filters:{default:()=>({})},resizable:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},expandedIds:{default:()=>[]}},emits:["update:selectedIds","sort-change","row-click","update:page","update:pageSize","pagination-change","update:search","update:filters","filter-change","update:expandedIds","row-expand","column-resize"],setup(t,{emit:e}){const n=["60%","75%","90%","70%","85%","65%","80%","55%"];function o(I,U){return n[(I*3+U)%n.length]}const a=ve("sortAsc"),s=ve("sortDesc"),l=ve("sortNeutral"),r=ve("expand"),c=ve("collapse"),d=ve("search"),u=ve("close"),h=t,f=e,m=i.ref({key:null,direction:null}),p=ye("datatable"),g=i.computed(()=>!!h.pagination),b=i.computed(()=>typeof h.pagination=="object"?h.pagination:{}),_=[10,20,50,100],k=i.computed(()=>b.value.pageSizeOptions||_),B=i.ref(h.page),C=i.ref(b.value.pageSize||h.pageSize);i.watch(()=>h.page,I=>{B.value=I}),i.watch(()=>h.pageSize,I=>{C.value=I});const y=i.computed(()=>h.serverSide&&h.total!==void 0?h.total:me.value.length),x=i.computed(()=>y.value<=0||C.value<=0?0:Math.ceil(y.value/C.value));function S(I){B.value=I,f("update:page",I),f("pagination-change",{page:I,pageSize:C.value})}function w(I){if(I===null)return;const U=typeof I=="string"?parseInt(I,10):I;C.value=U,B.value=1,f("update:pageSize",U),f("update:page",1),f("pagination-change",{page:1,pageSize:U})}const M=i.computed(()=>k.value.map(I=>({label:String(I),value:I}))),N=i.computed(()=>y.value===0?0:(B.value-1)*C.value+1),T=i.computed(()=>Math.min(B.value*C.value,y.value));function $(I){const U=I[h.rowKey];return typeof U=="string"||typeof U=="number"?U:(console.warn(`DataTable: Row key "${h.rowKey}" must be string or number`),String(U))}function K(I,U){return Dl(I,U)}const P=i.computed(()=>h.data.length===0?!1:h.data.every(I=>h.selectedIds.includes($(I)))),A=i.computed(()=>h.data.length===0?!1:h.selectedIds.length>0&&!P.value);function R(I){if(I){const U=h.data.map(H=>$(H));f("update:selectedIds",U)}else f("update:selectedIds",[])}function q(I,U){const H=$(I);U?f("update:selectedIds",[...h.selectedIds,H]):f("update:selectedIds",h.selectedIds.filter(re=>re!==H))}function Q(I){return h.selectedIds.includes($(I))}function ee(I){if(!I.sortable)return;let U;if(m.value.key!==I.key)U="asc";else{const H=[null,"asc","desc"],re=H.indexOf(m.value.direction);U=H[(re+1)%3]}m.value={key:U?I.key:null,direction:U},f("sort-change",m.value)}function ge(I,U){(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),ee(U))}const fe=i.ref(h.search),be=i.ref({...h.filters});i.watch(()=>h.search,I=>{fe.value=I}),i.watch(()=>h.filters,I=>{be.value={...I}},{deep:!0});function xe(I){const U=I===null?"":String(I);fe.value=U,B.value=1,f("update:search",U),f("update:page",1),f("filter-change",{search:U,filters:be.value})}function F(){xe("")}function v(I,U){const H={...be.value,[I]:U};U||delete H[I],be.value=H,B.value=1,f("update:filters",H),f("update:page",1),f("filter-change",{search:fe.value,filters:H})}function D(I,U){return U?String(I??"").toLowerCase().includes(U.toLowerCase()):!0}const G=i.computed(()=>fe.value!==""||Object.keys(be.value).length>0),ce=i.computed(()=>h.filterable?h.columns.filter(I=>I.filterable!==!1):[]),ze=i.ref({}),L=i.ref(null),j=i.ref(0),X=i.ref(0),ne=i.ref(null);function he(I){return ze.value[I.key]?`${ze.value[I.key]}px`:I.width}function Ae(I,U){if(!h.resizable||U.resizable===!1)return;I.preventDefault(),L.value=U.key,j.value=I.clientX;const H=I.target.closest("th");H&&(X.value=H.offsetWidth),document.addEventListener("mousemove",Re),document.addEventListener("mouseup",Ye),document.body.style.cursor="col-resize",document.body.style.userSelect="none"}function Re(I){if(!L.value)return;const U=h.columns.find(Pe=>Pe.key===L.value),H=U!=null&&U.minWidth?parseInt(U.minWidth):50,re=I.clientX-j.value,te=Math.max(H,X.value+re);ze.value={...ze.value,[L.value]:te}}function Ye(){L.value&&f("column-resize",L.value,ze.value[L.value]),L.value=null,document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Ye),document.body.style.cursor="",document.body.style.userSelect=""}i.onUnmounted(()=>{document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Ye)});function V(I){return h.expandedIds.includes($(I))}function Z(I){const U=$(I),H=h.expandedIds.includes(U);H?f("update:expandedIds",h.expandedIds.filter(re=>re!==U)):f("update:expandedIds",[...h.expandedIds,U]),f("row-expand",I,!H)}function Te(I){return I==null?4:typeof I=="number"?1:typeof I=="string"?2:typeof I=="boolean"?3:5}const me=i.computed(()=>{if(h.serverSide)return h.data;let I=[...h.data];if(fe.value){const U=fe.value.toLowerCase();I=I.filter(H=>h.columns.some(re=>{const te=K(H,re.key);return String(te??"").toLowerCase().includes(U)}))}return Object.keys(be.value).length>0&&(I=I.filter(U=>Object.entries(be.value).every(([H,re])=>{if(!re)return!0;const te=h.columns.find(Ft=>Ft.key===H),Pe=K(U,H);return((te==null?void 0:te.filterFn)||D)(Pe,re,U)}))),I}),we=i.computed(()=>{if(!m.value.key||!m.value.direction)return me.value;const I=m.value.key,U=m.value.direction==="asc"?1:-1;return[...me.value].sort((H,re)=>{const te=K(H,I),Pe=K(re,I),$n=Te(te),Ft=Te(Pe);return $n!==Ft?($n-Ft)*U:te==null&&Pe==null?0:typeof te=="string"&&typeof Pe=="string"?te.localeCompare(Pe)*U:typeof te=="number"&&typeof Pe=="number"?(te-Pe)*U:typeof te=="boolean"&&typeof Pe=="boolean"?(te===Pe?0:te?-1:1)*U:(String(te)<String(Pe)?-1:String(te)>String(Pe)?1:0)*U})}),le=i.computed(()=>{if(!g.value||h.serverSide)return we.value;const I=(B.value-1)*C.value,U=I+C.value;return we.value.slice(I,U)});function Ne(I,U){f("row-click",I,U)}const De=i.computed(()=>{let I=h.columns.length;return h.selectable&&I++,h.expandable&&I++,I});i.computed(()=>h.serverSide&&h.total!==void 0?h.total:me.value.length);const tt=i.computed(()=>Array.from({length:h.skeletonRows}));return(I,U)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"tableRef",ref:ne,class:i.normalizeClass(["ui-table",[`ui-table--${t.size}`,{"ui-table--striped":t.striped,"ui-table--hoverable":t.hoverable,"ui-table--bordered":t.bordered,"ui-table--loading":t.loading,"ui-table--sticky-header":t.stickyHeader,"ui-table--resizable":t.resizable,"ui-table--resizing":L.value!==null}]])},[t.searchable?(i.openBlock(),i.createElementBlock("div",_g,[i.createElementVNode("div",yg,[i.createVNode(Jt,{"model-value":fe.value,placeholder:t.searchPlaceholder,size:"sm",type:"search","onUpdate:modelValue":xe},i.createSlots({left:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(d)),{class:"ui-table__search-icon"}))]),_:2},[fe.value?{name:"right",fn:i.withCtx(()=>[i.createElementVNode("button",{type:"button",class:"ui-table__search-clear","aria-label":"Clear search",onClick:F},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(u)),{class:"ui-table__search-clear-icon"}))])]),key:"0"}:void 0]),1032,["model-value","placeholder"])]),i.renderSlot(I.$slots,"toolbar",{},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",kg,[i.createElementVNode("table",{class:"ui-table__table","aria-busy":t.loading||void 0},[i.createElementVNode("thead",wg,[i.createElementVNode("tr",Cg,[t.expandable?(i.openBlock(),i.createElementBlock("th",Bg,[...U[2]||(U[2]=[i.createElementVNode("span",{class:"ui-table__header-text sr-only"},"Expand",-1)])])):i.createCommentVNode("",!0),t.selectable?(i.openBlock(),i.createElementBlock("th",Sg,[i.createVNode(Vi,{"model-value":P.value,indeterminate:A.value,size:"sm","aria-label":"Select all rows","onUpdate:modelValue":R},null,8,["model-value","indeterminate"])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.columns,(H,re)=>(i.openBlock(),i.createElementBlock("th",{key:H.key,class:i.normalizeClass(["ui-table__header-cell",[`ui-table__header-cell--${H.align||"left"}`,{"ui-table__header-cell--sortable":H.sortable,"ui-table__header-cell--sorted":m.value.key===H.key,"ui-table__header-cell--resizable":t.resizable&&H.resizable!==!1}]]),style:i.normalizeStyle(he(H)?{width:he(H)}:void 0),"aria-sort":H.sortable?m.value.key===H.key?m.value.direction==="asc"?"ascending":m.value.direction==="desc"?"descending":"none":"none":void 0,tabindex:H.sortable?0:void 0,role:H.sortable?"button":void 0,onClick:te=>ee(H),onKeydown:te=>ge(te,H)},[i.createElementVNode("div",Mg,[i.renderSlot(I.$slots,`header-${H.key}`,{column:H},()=>[i.createElementVNode("span",vg,i.toDisplayString(H.label),1)],!0),H.sortable?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["ui-table__sort-icon",{"ui-table__sort-icon--asc":m.value.key===H.key&&m.value.direction==="asc","ui-table__sort-icon--desc":m.value.key===H.key&&m.value.direction==="desc"}]),"aria-hidden":"true"},[m.value.key!==H.key||!m.value.direction?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(l)),{key:0,class:"ui-table__sort-svg ui-table__sort-svg--neutral"})):m.value.direction==="asc"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(a)),{key:1,class:"ui-table__sort-svg"})):(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(s)),{key:2,class:"ui-table__sort-svg"}))],2)):i.createCommentVNode("",!0)]),t.resizable&&H.resizable!==!1&&re<t.columns.length-1?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-table__resize-handle",onMousedown:te=>Ae(te,H)},null,40,Vg)):i.createCommentVNode("",!0)],46,Eg))),128))]),t.filterable&&ce.value.length>0?(i.openBlock(),i.createElementBlock("tr",Dg,[t.expandable?(i.openBlock(),i.createElementBlock("th",$g)):i.createCommentVNode("",!0),t.selectable?(i.openBlock(),i.createElementBlock("th",Tg)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.columns,H=>(i.openBlock(),i.createElementBlock("th",{key:`filter-${H.key}`,class:"ui-table__filter-cell"},[H.filterable!==!1?(i.openBlock(),i.createBlock(Jt,{key:0,"model-value":be.value[H.key]||"",placeholder:`Filter ${H.label}...`,size:"sm","onUpdate:modelValue":re=>v(H.key,String(re??""))},null,8,["model-value","placeholder","onUpdate:modelValue"])):i.createCommentVNode("",!0)]))),128))])):i.createCommentVNode("",!0)]),i.createElementVNode("tbody",Ig,[t.loading?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(tt.value,(H,re)=>(i.openBlock(),i.createElementBlock("tr",{key:`skeleton-${re}`,class:"ui-table__row ui-table__row--skeleton"},[t.expandable?(i.openBlock(),i.createElementBlock("td",Lg,[i.createVNode(wi,{variant:"rect",width:16,height:16})])):i.createCommentVNode("",!0),t.selectable?(i.openBlock(),i.createElementBlock("td",zg,[i.createVNode(wi,{variant:"rect",width:16,height:16})])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.columns,(te,Pe)=>(i.openBlock(),i.createElementBlock("td",{key:te.key,class:i.normalizeClass(["ui-table__cell",[`ui-table__cell--${te.align||"left"}`]])},[i.createVNode(wi,{variant:"text",width:o(re,Pe),height:16},null,8,["width"])],2))),128))]))),128)):le.value.length===0?(i.openBlock(),i.createElementBlock("tr",Ng,[i.createElementVNode("td",{colspan:De.value,class:"ui-table__cell ui-table__cell--empty"},[i.renderSlot(I.$slots,"empty",{},()=>[i.createVNode(El,{title:G.value?"No matching results":t.emptyMessage,description:G.value?"Try adjusting your search or filters":void 0,compact:""},null,8,["title","description"])],!0)],8,Pg)])):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:2},i.renderList(le.value,(H,re)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:$(H)},[i.createElementVNode("tr",{class:i.normalizeClass(["ui-table__row",{"ui-table__row--selected":Q(H),"ui-table__row--clickable":I.$attrs.onRowClick,"ui-table__row--expanded":t.expandable&&V(H)}]),onClick:te=>Ne(H,re)},[t.expandable?(i.openBlock(),i.createElementBlock("td",{key:0,class:"ui-table__cell ui-table__cell--expand",onClick:U[0]||(U[0]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("button",{type:"button",class:i.normalizeClass(["ui-table__expand-button",{"ui-table__expand-button--expanded":V(H)}]),"aria-expanded":V(H),"aria-label":V(H)?"Collapse row":"Expand row",onClick:te=>Z(H)},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(V(H)?i.unref(c):i.unref(r)),{class:"ui-table__expand-icon"}))],10,Rg)])):i.createCommentVNode("",!0),t.selectable?(i.openBlock(),i.createElementBlock("td",{key:1,class:"ui-table__cell ui-table__cell--checkbox",onClick:U[1]||(U[1]=i.withModifiers(()=>{},["stop"]))},[i.createVNode(Vi,{"model-value":Q(H),size:"sm","aria-label":`Select row ${re+1}`,"onUpdate:modelValue":te=>q(H,te)},null,8,["model-value","aria-label","onUpdate:modelValue"])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.columns,te=>(i.openBlock(),i.createElementBlock("td",{key:te.key,class:i.normalizeClass(["ui-table__cell",[`ui-table__cell--${te.align||"left"}`]]),"data-label":te.label,style:i.normalizeStyle(he(te)?{width:he(te)}:void 0)},[i.renderSlot(I.$slots,`cell-${te.key}`,{value:K(H,te.key),row:H,column:te,index:re},()=>[i.createTextVNode(i.toDisplayString(K(H,te.key)??""),1)],!0)],14,Og))),128))],10,Ag),t.expandable&&V(H)?(i.openBlock(),i.createElementBlock("tr",{key:`expanded-${$(H)}`,class:"ui-table__row ui-table__row--expansion"},[i.createElementVNode("td",{colspan:De.value,class:"ui-table__cell ui-table__cell--expansion"},[i.renderSlot(I.$slots,"expanded",{row:H,index:re},()=>[i.createElementVNode("div",Wg,[i.createElementVNode("pre",null,i.toDisplayString(JSON.stringify(H,null,2)),1)])],!0)],8,Fg)])):i.createCommentVNode("",!0)],64))),128))])],8,xg)]),g.value&&x.value>0?(i.openBlock(),i.createElementBlock("div",Hg,[i.createElementVNode("div",jg,[i.createVNode(vo,{size:"sm",muted:""},{default:i.withCtx(()=>[i.createTextVNode(" Showing "+i.toDisplayString(N.value)+" to "+i.toDisplayString(T.value)+" of "+i.toDisplayString(y.value)+" results ",1)]),_:1})]),i.createElementVNode("div",Yg,[i.createElementVNode("div",Ug,[i.createVNode(vo,{size:"sm",muted:"",as:"label",for:`${i.unref(p)}-page-size`},{default:i.withCtx(()=>[...U[3]||(U[3]=[i.createTextVNode(" Rows per page ",-1)])]),_:1},8,["for"]),i.createVNode(Vl,{id:`${i.unref(p)}-page-size`,"model-value":C.value,options:M.value,size:"sm","onUpdate:modelValue":w},null,8,["id","model-value","options"])]),i.createVNode(vl,{"model-value":B.value,total:y.value,"page-size":C.value,"sibling-count":b.value.siblingCount??1,"show-edges":b.value.showEdges??!0,size:t.size==="lg"?"lg":t.size==="sm"?"sm":"md","onUpdate:modelValue":S},null,8,["model-value","total","page-size","sibling-count","show-edges","size"])])])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-7c8fff0a"]]);function $l(t,e){const n=[],a=new Date(t,e,1).getDay(),s=new Date(t,e,1-a);for(let l=0;l<42;l++){const r=new Date(s);r.setDate(s.getDate()+l),n.push({date:r,day:r.getDate(),currentMonth:r.getMonth()===e})}return n}function Kg(t,e){return new Date(t,e+1,0).getDate()}function Bt(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${o}`}function ft(t){if(!t||!/^\d{4}-\d{2}-\d{2}$/.test(t))return null;const[e,n,o]=t.split("-").map(Number),a=new Date(e,n-1,o);return a.getFullYear()!==e||a.getMonth()!==n-1||a.getDate()!==o?null:a}function mt(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Tl(t,e){const n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),o=new Date(e.getFullYear(),e.getMonth(),e.getDate());return n.getTime()<o.getTime()}function Il(t,e){const n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),o=new Date(e.getFullYear(),e.getMonth(),e.getDate());return n.getTime()>o.getTime()}function Ll(t,e){return new Date(2e3,t,1).toLocaleDateString(e,{month:"long"})}function zl(t){const e=[],n=new Date(2024,0,7);for(let o=0;o<7;o++){const a=new Date(n);a.setDate(n.getDate()+o),e.push(a.toLocaleDateString(t,{weekday:"short"}))}return e}function Ci(t,e,n){return!(e&&Tl(t,e)||n&&Il(t,n))}function qg(t,e,n){if(!e||!n)return!1;const o=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),a=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),s=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime();return o>Math.min(a,s)&&o<Math.max(a,s)}function Vo(t,e,n,o){if(!e)return null;const a=n||o;if(!a)return mt(t,e)?"start":null;const s=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),l=new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime(),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),c=Math.min(s,l),d=Math.max(s,l);return r===c?"start":r===d?"end":r>c&&r<d?"in-range":null}function Do(t,e){const n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),o=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();return n<=o?[t,e]:[e,t]}function Nl(t){const e=[];for(let n=0;n<12;n++){const o=new Date(2e3,n,1);e.push(o.toLocaleDateString(t,{month:"short"}))}return e}function Pl(t){const e=Math.floor(t/20)*20;return Array.from({length:20},(n,o)=>e+o)}function Gg(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate());switch(t){case"today":return[n,n];case"yesterday":{const o=new Date(n);return o.setDate(o.getDate()-1),[o,o]}case"last7days":{const o=new Date(n);return o.setDate(o.getDate()-6),[o,n]}case"last30days":{const o=new Date(n);return o.setDate(o.getDate()-29),[o,n]}case"thisMonth":{const o=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,0);return[o,a]}case"lastMonth":{const o=new Date(e.getFullYear(),e.getMonth()-1,1),a=new Date(e.getFullYear(),e.getMonth(),0);return[o,a]}case"thisYear":{const o=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),11,31);return[o,a]}default:return[n,n]}}const Jg=["for"],Zg={key:0,class:"ui-datepicker-field__required","aria-hidden":"true"},Qg=["id","value","placeholder","disabled","aria-describedby","aria-invalid"],eb=["id","aria-controls","aria-describedby","aria-invalid","aria-disabled"],tb={class:"ui-datepicker-trigger__value"},nb=["name","value","required"],ib=["name","value"],ob=["name","value"],ab={key:0,class:"ui-datepicker-sidebar"},sb={class:"ui-datepicker",role:"application","aria-label":"Date picker"},lb={class:"ui-datepicker__header"},rb={key:0,class:"ui-datepicker__year-grid"},cb=["disabled","onClick"],db={key:1,class:"ui-datepicker__month-grid"},ub=["disabled","onClick"],hb={class:"ui-datepicker__weekdays",role:"row"},fb=["abbr"],mb=["id","aria-label"],pb=["disabled","aria-selected","aria-current","aria-disabled","tabindex","onClick","onMouseenter"],gb={key:0,class:"ui-datepicker__hint"},bb=["id","aria-expanded","aria-controls","aria-describedby","aria-invalid","aria-disabled"],_b={class:"ui-datepicker-trigger__value"},yb=["name","value","required"],kb=["name","value"],xb=["name","value"],wb={class:"ui-datepicker-sheet",role:"dialog","aria-modal":"true","aria-label":"Date picker"},Cb={class:"ui-datepicker-sheet__header"},Bb={class:"ui-datepicker-sheet__title"},Sb={key:0,class:"ui-datepicker-sheet__presets"},Eb={class:"ui-datepicker ui-datepicker--mobile"},Mb={class:"ui-datepicker__header"},vb={key:0,class:"ui-datepicker__year-grid ui-datepicker__year-grid--mobile"},Vb=["disabled","onClick"],Db={key:1,class:"ui-datepicker__month-grid ui-datepicker__month-grid--mobile"},$b=["disabled","onClick"],Tb={class:"ui-datepicker__weekdays",role:"row"},Ib=["abbr"],Lb=["id","aria-label"],zb=["disabled","aria-selected","aria-current","aria-disabled","tabindex","onClick"],Nb={key:0,class:"ui-datepicker__hint"},Pb=["id"],Ab=["id"],Rb=O(i.defineComponent({__name:"DatePicker",props:{modelValue:{},mode:{default:"single"},min:{},max:{},label:{},placeholder:{default:"Select date"},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},id:{},name:{},block:{type:Boolean,default:!1},locale:{},formatDisplay:{},formatRangeDisplay:{}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=i.ref(null),l=i.ref(null),r=i.ref(null),c=i.ref(null),d=ye("datepicker"),u=i.computed(()=>o.id||d),h=i.computed(()=>`${u.value}-hint`),f=i.computed(()=>`${u.value}-error`),m=i.computed(()=>`${u.value}-grid`),p=i.computed(()=>{if(o.error)return f.value;if(o.hint)return h.value}),g=ve("calendar"),b=ve("chevronLeft"),_=ve("chevronRight"),k=ve("close"),B=i.ref(!1),C=i.ref(!1),y=i.ref(!1),x=i.ref(""),S=i.ref("");function w(){typeof window>"u"||(B.value=window.matchMedia("(max-width: 640px)").matches,C.value=window.matchMedia("(any-hover: hover)").matches)}w(),i.onMounted(()=>{window.addEventListener("resize",w)}),i.onUnmounted(()=>{window.removeEventListener("resize",w)});const M=i.ref(new Date),N=new Date,T=i.ref("day"),$=i.ref("idle"),K=i.ref(null),P=i.ref(null),A=i.computed(()=>o.mode==="range"?null:ft(o.modelValue||"")),R=i.computed(()=>{if(o.mode!=="range")return{start:null,end:null};const z=o.modelValue;return!z||!Array.isArray(z)?{start:null,end:null}:{start:ft(z[0]||""),end:ft(z[1]||"")}}),q=i.computed(()=>ft(o.min||"")),Q=i.computed(()=>ft(o.max||"")),ee=i.computed(()=>M.value.getFullYear()),ge=i.computed(()=>M.value.getMonth()),fe=i.computed(()=>Ll(ge.value,o.locale)),be=i.computed(()=>zl(o.locale)),xe=i.computed(()=>Nl(o.locale)),F=i.computed(()=>Pl(ee.value)),v=i.computed(()=>{const z=F.value;return`${z[0]}–${z[z.length-1]}`}),D=i.computed(()=>$l(ee.value,ge.value)),G=i.computed(()=>{if(o.mode==="range"){const{start:z,end:Y}=R.value;if(!z||!Y)return"";if(o.formatRangeDisplay)return o.formatRangeDisplay(z,Y);const oe={month:"short",day:"numeric"},_e=z.toLocaleDateString(o.locale,oe),J=Y.toLocaleDateString(o.locale,{...oe,year:"numeric"});return`${_e} – ${J}`}return A.value?o.formatDisplay?o.formatDisplay(A.value):A.value.toLocaleDateString(o.locale,{year:"numeric",month:"short",day:"numeric"}):""}),ce=i.computed(()=>o.mode==="range"?R.value.start!==null&&R.value.end!==null:A.value!==null),ze=i.computed(()=>{if(T.value==="year")return!0;if(T.value==="month")return q.value?ee.value>q.value.getFullYear():!0;if(!q.value)return!0;const z=new Date(ee.value,ge.value,1),Y=new Date(q.value.getFullYear(),q.value.getMonth(),1);return z>Y}),L=i.computed(()=>{if(T.value==="year")return!0;if(T.value==="month")return Q.value?ee.value<Q.value.getFullYear():!0;if(!Q.value)return!0;const z=new Date(ee.value,ge.value,1),Y=new Date(Q.value.getFullYear(),Q.value.getMonth(),1);return z<Y});i.watch(()=>o.modelValue,z=>{if(o.mode==="range"){const Y=z;if(Y&&Array.isArray(Y)&&Y[0]){const oe=ft(Y[0]);oe&&(M.value=new Date(oe))}}else{const Y=ft(z||"");Y&&(M.value=new Date(Y))}},{immediate:!0});function j(z){const Y=new Date(M.value);Y.setMonth(Y.getMonth()+z),M.value=Y}function X(z){const Y=new Date(M.value);Y.setFullYear(Y.getFullYear()+z),M.value=Y}function ne(z){const Y=new Date(M.value);Y.setFullYear(Y.getFullYear()+z*20),M.value=Y}function he(){ze.value&&(T.value==="year"?ne(-1):T.value==="month"?X(-1):j(-1))}function Ae(){L.value&&(T.value==="year"?ne(1):T.value==="month"?X(1):j(1))}function Re(){T.value==="day"?T.value="year":(T.value,T.value="day")}function Ye(z){M.value=new Date(z,ge.value,1),T.value="month"}function V(z){M.value=new Date(ee.value,z,1),T.value="day"}function Z(z){return!!(q.value&&z<q.value.getFullYear()||Q.value&&z>Q.value.getFullYear())}function Te(z){return!!(q.value&&(ee.value<q.value.getFullYear()||ee.value===q.value.getFullYear()&&z<q.value.getMonth())||Q.value&&(ee.value>Q.value.getFullYear()||ee.value===Q.value.getFullYear()&&z>Q.value.getMonth()))}function me(z){if(Ci(z.date,q.value,Q.value))if(o.mode==="range")if($.value==="idle")$.value="selecting",K.value=z.date;else{const[Y,oe]=Do(K.value,z.date);a("update:modelValue",[Bt(Y),Bt(oe)]),$.value="idle",K.value=null,P.value=null,te()}else a("update:modelValue",Bt(z.date)),te()}function we(z,Y){if(o.mode==="range"){const[oe,_e]=Do(z,Y);a("update:modelValue",[Bt(oe),Bt(_e)]),te()}}function le(z){o.mode==="range"&&$.value==="selecting"&&(P.value=z.date)}function Ne(){o.mode==="range"&&(P.value=null)}function De(z){return!Ci(z.date,q.value,Q.value)}function tt(z){if(o.mode==="range"){const{start:Y,end:oe}=R.value;return mt(z.date,Y)||mt(z.date,oe)}return mt(z.date,A.value)}function I(z){return mt(z.date,N)}function U(z){if(o.mode!=="range")return null;if($.value==="selecting"&&K.value)return Vo(z.date,K.value,null,P.value);const{start:Y,end:oe}=R.value;return Vo(z.date,Y,oe,null)}function H(z){if(!l.value||T.value!=="day")return;const Y=Array.from(l.value.querySelectorAll(".ui-datepicker__day:not([disabled])")),oe=Y.findIndex(J=>J===document.activeElement);if(oe===-1)return;let _e=-1;switch(z.key){case"ArrowLeft":z.preventDefault(),_e=oe>0?oe-1:Y.length-1;break;case"ArrowRight":z.preventDefault(),_e=oe<Y.length-1?oe+1:0;break;case"ArrowUp":for(z.preventDefault(),_e=oe>=7?oe-7:oe+35;_e>=Y.length;)_e-=7;break;case"ArrowDown":for(z.preventDefault(),_e=oe+7<Y.length?oe+7:oe-35;_e<0;)_e+=7;break;case"Home":z.preventDefault(),_e=0;break;case"End":z.preventDefault(),_e=Y.length-1;break;case"Escape":z.preventDefault(),te();return}_e>=0&&_e<Y.length&&Y[_e].focus()}function re(){var z;if(!o.disabled){if(T.value="day",$.value="idle",K.value=null,P.value=null,S.value="",o.mode==="range"){const{start:Y}=R.value;M.value=Y?new Date(Y):new Date,x.value=""}else M.value=A.value?new Date(A.value):new Date,x.value=A.value?Bt(A.value):"";B.value?(y.value=!0,document.body.style.overflow="hidden",i.nextTick(()=>Ft())):(z=s.value)==null||z.open()}}function te(){var z,Y;T.value="day",$.value="idle",K.value=null,P.value=null,S.value="",B.value?(y.value=!1,document.body.style.overflow="",(z=r.value)==null||z.focus()):(Y=s.value)==null||Y.close()}function Pe(){i.nextTick(()=>Ft())}function $n(){T.value="day",$.value="idle",K.value=null,P.value=null,S.value=""}function Ft(){var _e,J,Be,Wt;if(T.value!=="day")return;const z=(_e=l.value)==null?void 0:_e.querySelector(".ui-datepicker__day--selected, .ui-datepicker__day--range-start"),Y=(J=l.value)==null?void 0:J.querySelector(".ui-datepicker__day--today"),oe=(Be=l.value)==null?void 0:Be.querySelector(".ui-datepicker__day:not([disabled])");(Wt=z||Y||oe)==null||Wt.focus()}function u0(z){z.target.classList.contains("ui-datepicker-sheet__overlay")&&te()}function h0(){y.value?te():re()}function jl(z){(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),re())}function f0(){y.value||re()}function m0(z){const Y=z.target;x.value=Y.value}function p0(z){var _e;const Y=z.relatedTarget,oe=(_e=l.value)==null?void 0:_e.closest(".ui-popover__content");oe&&Y&&oe.contains(Y)||Yl(!1)}function g0(z){z.key==="Enter"?(z.preventDefault(),Yl(!0)):z.key==="Escape"&&(z.preventDefault(),te())}function Yl(z){if(!x.value){S.value="";return}const Y=ft(x.value);if(!Y){S.value="Invalid date format (use YYYY-MM-DD)";return}if(!Ci(Y,q.value,Q.value)){S.value="Date is outside allowed range";return}S.value="",a("update:modelValue",Bt(Y)),M.value=new Date(Y),z&&te()}const b0={xs:"var(--text-xs)",sm:"var(--text-sm)",md:"var(--text-md)",lg:"var(--text-lg)",xl:"var(--text-xl)"},Ul=i.computed(()=>b0[o.size]);function Xl(){if(o.mode==="range"){const{start:Y}=R.value;if(Y){const oe=D.value.findIndex(_e=>mt(_e.date,Y));if(oe!==-1)return oe}}else if(A.value){const Y=D.value.findIndex(oe=>mt(oe.date,A.value));if(Y!==-1)return Y}const z=D.value.findIndex(Y=>mt(Y.date,N));return z!==-1?z:D.value.findIndex(Y=>Y.currentMonth)}const Kl=i.computed(()=>T.value==="year"?v.value:T.value==="month"?String(ee.value):`${fe.value} ${ee.value}`);return e({open:re,close:te,toggle:()=>y.value||s.value?te():re(),applyPreset:we}),(z,Y)=>{var oe,_e;return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-datepicker-field",[`ui-datepicker-field--${t.size}`,{"ui-datepicker-field--block":t.block,"ui-datepicker-field--disabled":t.disabled,"ui-datepicker-field--error":t.error||S.value}]])},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:u.value,class:"ui-datepicker-field__label"},[i.createTextVNode(i.toDisplayString(t.label)+" ",1),t.required?(i.openBlock(),i.createElementBlock("span",Zg,"*")):i.createCommentVNode("",!0)],8,Jg)):i.createCommentVNode("",!0),B.value?(i.openBlock(),i.createElementBlock("div",{key:2,ref_key:"triggerRef",ref:r,id:u.value,class:i.normalizeClass(["ui-datepicker-trigger",[`ui-datepicker-trigger--${t.size}`,{"ui-datepicker-trigger--disabled":t.disabled,"ui-datepicker-trigger--error":t.error,"ui-datepicker-trigger--has-value":ce.value}]]),role:"combobox","aria-haspopup":"dialog","aria-expanded":y.value,"aria-controls":m.value,"aria-describedby":p.value,"aria-invalid":t.error?"true":void 0,"aria-disabled":t.disabled,tabindex:"0",onClick:h0,onKeydown:jl},[i.createElementVNode("span",_b,i.toDisplayString(G.value||t.placeholder),1),i.createVNode(je,{icon:i.unref(g),size:Ul.value,class:"ui-datepicker-trigger__icon"},null,8,["icon","size"]),t.mode==="single"?(i.openBlock(),i.createElementBlock("input",{key:0,type:"hidden",name:t.name,value:t.modelValue,required:t.required},null,8,yb)):t.name?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("input",{type:"hidden",name:`${t.name}[0]`,value:((oe=t.modelValue)==null?void 0:oe[0])||""},null,8,kb),i.createElementVNode("input",{type:"hidden",name:`${t.name}[1]`,value:((_e=t.modelValue)==null?void 0:_e[1])||""},null,8,xb)],64)):i.createCommentVNode("",!0)],42,bb)):(i.openBlock(),i.createBlock(Ln,{key:1,ref_key:"popoverRef",ref:s,placement:"bottom-start",disabled:t.disabled,width:t.mode==="range"?"auto":308,"close-on-escape":!0,"close-on-click-outside":!0,"trap-focus":!0,onOpen:Pe,onClose:$n},{trigger:i.withCtx(()=>{var J,Be;return[i.createElementVNode("div",{ref_key:"triggerRef",ref:r,class:i.normalizeClass(["ui-datepicker-trigger",[`ui-datepicker-trigger--${t.size}`,{"ui-datepicker-trigger--disabled":t.disabled,"ui-datepicker-trigger--error":t.error||S.value,"ui-datepicker-trigger--has-value":ce.value}]])},[C.value&&t.mode==="single"?(i.openBlock(),i.createElementBlock("input",{key:0,ref_key:"inputRef",ref:c,id:u.value,type:"text",class:"ui-datepicker-trigger__input",value:x.value||G.value,placeholder:t.placeholder,disabled:t.disabled,"aria-describedby":p.value,"aria-invalid":t.error||S.value?"true":void 0,autocomplete:"off",onClick:Y[0]||(Y[0]=i.withModifiers(()=>{},["stop"])),onFocus:f0,onInput:m0,onBlur:p0,onKeydown:g0},null,40,Qg)):(i.openBlock(),i.createElementBlock("div",{key:1,id:u.value,role:"combobox","aria-haspopup":"grid","aria-expanded":!1,"aria-controls":m.value,"aria-describedby":p.value,"aria-invalid":t.error||S.value?"true":void 0,"aria-disabled":t.disabled,tabindex:"0",class:"ui-datepicker-trigger__value-wrapper",onClick:i.withModifiers(re,["stop"]),onKeydown:jl},[i.createElementVNode("span",tb,i.toDisplayString(G.value||t.placeholder),1)],40,eb)),i.createVNode(je,{icon:i.unref(g),size:Ul.value,class:"ui-datepicker-trigger__icon",onClick:i.withModifiers(re,["stop"])},null,8,["icon","size"]),t.mode==="single"?(i.openBlock(),i.createElementBlock("input",{key:2,type:"hidden",name:t.name,value:t.modelValue,required:t.required},null,8,nb)):t.name?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createElementVNode("input",{type:"hidden",name:`${t.name}[0]`,value:((J=t.modelValue)==null?void 0:J[0])||""},null,8,ib),i.createElementVNode("input",{type:"hidden",name:`${t.name}[1]`,value:((Be=t.modelValue)==null?void 0:Be[1])||""},null,8,ob)],64)):i.createCommentVNode("",!0)],2)]}),default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["ui-datepicker-content",{"ui-datepicker-content--with-sidebar":t.mode==="range"&&z.$slots.sidebar}])},[t.mode==="range"&&z.$slots.sidebar?(i.openBlock(),i.createElementBlock("div",ab,[i.renderSlot(z.$slots,"sidebar",{applyPreset:we},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",sb,[i.createElementVNode("div",lb,[i.createVNode(Je,{variant:"ghost",size:"sm","icon-left":i.unref(b),disabled:!ze.value,"aria-label":"Previous",onClick:he},null,8,["icon-left","disabled"]),i.createElementVNode("button",{type:"button",class:"ui-datepicker__title-btn","aria-live":"polite",onClick:Re},i.toDisplayString(Kl.value),1),i.createVNode(Je,{variant:"ghost",size:"sm","icon-left":i.unref(_),disabled:!L.value,"aria-label":"Next",onClick:Ae},null,8,["icon-left","disabled"])]),T.value==="year"?(i.openBlock(),i.createElementBlock("div",rb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(F.value,J=>(i.openBlock(),i.createElementBlock("button",{key:J,type:"button",class:i.normalizeClass(["ui-datepicker__year",{"ui-datepicker__year--selected":J===ee.value,"ui-datepicker__year--current":J===i.unref(N).getFullYear()}]),disabled:Z(J),onClick:Be=>Ye(J)},i.toDisplayString(J),11,cb))),128))])):T.value==="month"?(i.openBlock(),i.createElementBlock("div",db,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(xe.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__month",{"ui-datepicker__month--selected":Be===ge.value,"ui-datepicker__month--current":Be===i.unref(N).getMonth()&&ee.value===i.unref(N).getFullYear()}]),disabled:Te(Be),onClick:Wt=>V(Be)},i.toDisplayString(J),11,ub))),128))])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",hb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(be.value,J=>(i.openBlock(),i.createElementBlock("span",{key:J,class:"ui-datepicker__weekday",role:"columnheader",abbr:J},i.toDisplayString(J),9,fb))),128))]),i.createElementVNode("div",{ref_key:"calendarRef",ref:l,id:m.value,class:"ui-datepicker__grid",role:"grid","aria-label":`${fe.value} ${ee.value}`,onKeydown:H},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(D.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__day",[{"ui-datepicker__day--other-month":!J.currentMonth,"ui-datepicker__day--selected":tt(J),"ui-datepicker__day--today":I(J),"ui-datepicker__day--disabled":De(J)},U(J)?`ui-datepicker__day--range-${U(J)}`:""]]),role:"gridcell",disabled:De(J),"aria-selected":tt(J)||void 0,"aria-current":I(J)?"date":void 0,"aria-disabled":De(J)||void 0,tabindex:Be===Xl()?0:-1,onClick:Wt=>me(J),onMouseenter:Wt=>le(J),onMouseleave:Ne},i.toDisplayString(J.day),43,pb))),128))],40,mb),t.mode==="range"&&$.value==="selecting"?(i.openBlock(),i.createElementBlock("div",gb," Select end date ")):i.createCommentVNode("",!0)],64))])],2)]),_:3},8,["disabled","width"])),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-datepicker-sheet"},{default:i.withCtx(()=>[B.value&&y.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-datepicker-sheet__overlay",onClick:u0},[i.createElementVNode("div",wb,[i.createElementVNode("div",Cb,[i.createElementVNode("span",Bb,i.toDisplayString(t.label||(t.mode==="range"?"Select dates":"Select date")),1),i.createVNode(Je,{variant:"ghost",size:"sm","icon-left":i.unref(k),"aria-label":"Close",onClick:te},null,8,["icon-left"])]),t.mode==="range"&&z.$slots.sidebar?(i.openBlock(),i.createElementBlock("div",Sb,[i.renderSlot(z.$slots,"sidebar",{applyPreset:we},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",Eb,[i.createElementVNode("div",Mb,[i.createVNode(Je,{variant:"ghost",size:"md","icon-left":i.unref(b),disabled:!ze.value,"aria-label":"Previous",onClick:he},null,8,["icon-left","disabled"]),i.createElementVNode("button",{type:"button",class:"ui-datepicker__title-btn","aria-live":"polite",onClick:Re},i.toDisplayString(Kl.value),1),i.createVNode(Je,{variant:"ghost",size:"md","icon-left":i.unref(_),disabled:!L.value,"aria-label":"Next",onClick:Ae},null,8,["icon-left","disabled"])]),T.value==="year"?(i.openBlock(),i.createElementBlock("div",vb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(F.value,J=>(i.openBlock(),i.createElementBlock("button",{key:J,type:"button",class:i.normalizeClass(["ui-datepicker__year",{"ui-datepicker__year--selected":J===ee.value,"ui-datepicker__year--current":J===i.unref(N).getFullYear()}]),disabled:Z(J),onClick:Be=>Ye(J)},i.toDisplayString(J),11,Vb))),128))])):T.value==="month"?(i.openBlock(),i.createElementBlock("div",Db,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(xe.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__month",{"ui-datepicker__month--selected":Be===ge.value,"ui-datepicker__month--current":Be===i.unref(N).getMonth()&&ee.value===i.unref(N).getFullYear()}]),disabled:Te(Be),onClick:Wt=>V(Be)},i.toDisplayString(J),11,$b))),128))])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",Tb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(be.value,J=>(i.openBlock(),i.createElementBlock("span",{key:J,class:"ui-datepicker__weekday",role:"columnheader",abbr:J},i.toDisplayString(J),9,Ib))),128))]),i.createElementVNode("div",{ref_key:"calendarRef",ref:l,id:m.value,class:"ui-datepicker__grid",role:"grid","aria-label":`${fe.value} ${ee.value}`,onKeydown:H},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(D.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__day",[{"ui-datepicker__day--other-month":!J.currentMonth,"ui-datepicker__day--selected":tt(J),"ui-datepicker__day--today":I(J),"ui-datepicker__day--disabled":De(J)},U(J)?`ui-datepicker__day--range-${U(J)}`:""]]),role:"gridcell",disabled:De(J),"aria-selected":tt(J)||void 0,"aria-current":I(J)?"date":void 0,"aria-disabled":De(J)||void 0,tabindex:Be===Xl()?0:-1,onClick:Wt=>me(J)},i.toDisplayString(J.day),11,zb))),128))],40,Lb),t.mode==="range"&&$.value==="selecting"?(i.openBlock(),i.createElementBlock("div",Nb," Select end date ")):i.createCommentVNode("",!0)],64))])])])):i.createCommentVNode("",!0)]),_:3})])),t.error||S.value?(i.openBlock(),i.createElementBlock("p",{key:3,id:f.value,class:"ui-datepicker-field__message ui-datepicker-field__message--error",role:"alert"},i.toDisplayString(t.error||S.value),9,Pb)):t.hint?(i.openBlock(),i.createElementBlock("p",{key:4,id:h.value,class:"ui-datepicker-field__message ui-datepicker-field__message--hint"},i.toDisplayString(t.hint),9,Ab)):i.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-4075d941"]]),Ob=["id","aria-labelledby"],Fb={key:0,class:"ui-drawer__header"},Wb=["id"],Hb={class:"ui-drawer__body"},jb={key:1,class:"ui-drawer__footer"},Al='a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Yb=O(i.defineComponent({__name:"Drawer",props:{modelValue:{type:Boolean,default:!1},title:{},variant:{default:"default"},placement:{default:"right"},size:{default:"md"},maskClosable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},forcePlacement:{type:Boolean,default:!1}},emits:["update:modelValue","open","close"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=i.ref(null),l=ye("drawer"),r=ye("drawer-title"),c=i.computed({get:()=>o.modelValue,set:x=>a("update:modelValue",x)}),d=i.ref(!1);function u(){d.value=window.innerWidth<640}i.onMounted(()=>{u(),window.addEventListener("resize",u)}),i.onUnmounted(()=>{window.removeEventListener("resize",u)});const h=i.computed(()=>o.forcePlacement?o.placement:d.value?"bottom":o.placement),f=i.computed(()=>c.value);Tn(f);function m(x){if(!s.value||x.key!=="Tab")return;const S=s.value.querySelectorAll(Al);if(S.length===0)return;const w=S[0],M=S[S.length-1];x.shiftKey?document.activeElement===w&&(x.preventDefault(),M.focus()):document.activeElement===M&&(x.preventDefault(),w.focus())}function p(){s.value&&i.nextTick(()=>{var S;const x=(S=s.value)==null?void 0:S.querySelector(Al);x==null||x.focus()})}let g=null;function b(){g=document.activeElement,a("open"),i.nextTick(()=>{p(),window.addEventListener("keydown",m)})}function _(){c.value=!1,window.removeEventListener("keydown",m),a("close"),i.nextTick(()=>{g==null||g.focus()})}function k(){o.maskClosable&&_()}function B(x){x.key==="Escape"&&o.closeOnEscape&&(x.preventDefault(),_())}i.watch(c,x=>{x&&b()}),i.onUnmounted(()=>{window.removeEventListener("keydown",m)});const C=i.computed(()=>["ui-drawer__panel",`ui-drawer__panel--${h.value}`,`ui-drawer__panel--${o.variant}`,`ui-drawer__panel--${o.size}`,{"ui-drawer__panel--mobile":d.value&&!o.forcePlacement}]),y=i.computed(()=>`ui-drawer-${h.value}`);return e({close:_}),(x,S)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:y.value},{default:i.withCtx(()=>[c.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ui-drawer",{"ui-drawer--force-placement":t.forcePlacement}]),onKeydown:B},[i.createElementVNode("div",{class:"ui-drawer__backdrop",onClick:k}),i.createElementVNode("div",{ref_key:"drawerRef",ref:s,class:i.normalizeClass(C.value),id:i.unref(l),role:"dialog","aria-modal":"true","aria-labelledby":t.title?i.unref(r):void 0},[t.title||t.showClose||x.$slots.header?(i.openBlock(),i.createElementBlock("header",Fb,[i.renderSlot(x.$slots,"header",{},()=>[t.title?(i.openBlock(),i.createElementBlock("h2",{key:0,id:i.unref(r),class:"ui-drawer__title"},i.toDisplayString(t.title),9,Wb)):i.createCommentVNode("",!0)],!0),t.showClose?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"ui-drawer__close","aria-label":"Close drawer",onClick:_},[...S[0]||(S[0]=[i.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",Hb,[i.renderSlot(x.$slots,"default",{},void 0,!0)]),x.$slots.footer?(i.openBlock(),i.createElementBlock("footer",jb,[i.renderSlot(x.$slots,"footer",{close:_},void 0,!0)])):i.createCommentVNode("",!0)],10,Ob)],34)):i.createCommentVNode("",!0)]),_:3},8,["name"])]))}}),[["__scopeId","data-v-1116a63c"]]),Ub=["for"],Xb={key:0,class:"ui-combobox__required","aria-hidden":"true"},Kb=["onClick"],qb={key:0,class:"ui-combobox__overflow"},Gb=["id","value","placeholder","disabled","aria-expanded","aria-controls","aria-activedescendant","aria-invalid","aria-describedby","aria-required"],Jb=["name","multiple","required","disabled"],Zb={key:0,value:"",disabled:""},Qb=["value","selected","disabled"],e_=["id","aria-labelledby","aria-multiselectable"],t_={key:0,class:"ui-combobox__empty"},n_=["id","aria-selected","aria-disabled","onMouseenter","onClick"],i_={key:0,class:"ui-combobox__checkbox"},o_={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},a_=["innerHTML"],s_={key:1,class:"ui-combobox__check",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},l_=["id"],r_=["id"],c_=O(i.defineComponent({__name:"Combobox",props:{modelValue:{default:null},options:{},multiple:{type:Boolean,default:!1},label:{},placeholder:{default:"Search..."},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},block:{type:Boolean,default:!1},allowCreate:{type:Boolean,default:!1},maxDisplayedChips:{default:3},id:{},name:{}},emits:["update:modelValue","create"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(null),s=i.ref(null),l=i.ref(null),r=i.ref(!1),c=i.ref(""),d=i.ref(-1),u=i.ref(-1),h=ye("combobox"),f=i.computed(()=>n.id||h),m=i.computed(()=>`${f.value}-listbox`),p=i.computed(()=>`${f.value}-hint`),g=i.computed(()=>`${f.value}-error`);function b(F){return`${f.value}-option-${F}`}const _=i.computed(()=>{if(n.error)return g.value;if(n.hint)return p.value}),k=i.computed(()=>n.modelValue===null||n.modelValue===void 0?[]:Array.isArray(n.modelValue)?n.modelValue:[n.modelValue]),B=i.computed(()=>k.value.map(F=>n.options.find(v=>v.value===F)).filter(F=>F!==void 0)),C=i.computed(()=>{const F=c.value.toLowerCase().trim();return F?n.options.filter(v=>v.label.toLowerCase().includes(F)):n.options}),y=i.computed(()=>{if(!n.allowCreate)return!1;const F=c.value.trim();return F?!n.options.some(D=>D.label.toLowerCase()===F.toLowerCase()):!1}),x=i.computed(()=>{if(!(!r.value||d.value<0))return b(d.value)}),S=i.ref({});function w(){if(!a.value)return;const F=a.value.getBoundingClientRect();S.value={position:"fixed",top:`${F.bottom+4}px`,left:`${F.left}px`,minWidth:`${F.width}px`,maxWidth:`${Math.max(F.width,300)}px`}}function M(){n.disabled||r.value||(r.value=!0,w(),d.value=C.value.findIndex(F=>!F.disabled),u.value=-1,document.addEventListener("mousedown",T),window.addEventListener("resize",N),window.addEventListener("scroll",w,!0))}function N(){r.value&&(r.value=!1,d.value=-1,u.value=-1,!n.multiple&&B.value.length>0?c.value=B.value[0].label:n.multiple||(c.value=""),document.removeEventListener("mousedown",T),window.removeEventListener("resize",N),window.removeEventListener("scroll",w,!0))}function T(F){var D,G;const v=F.target;(D=a.value)!=null&&D.contains(v)||(G=l.value)!=null&&G.contains(v)||N()}function $(F){const v=F.target;c.value=v.value,u.value=-1,r.value?(d.value=C.value.findIndex(D=>!D.disabled),i.nextTick(q)):M()}function K(){var F;(F=s.value)==null||F.select(),!r.value&&!n.disabled&&M()}function P(F){var v;if(!F.disabled)if(n.multiple){const D=[...k.value],G=D.indexOf(F.value);G>=0?D.splice(G,1):D.push(F.value),o("update:modelValue",D),c.value="",(v=s.value)==null||v.focus()}else o("update:modelValue",F.value),c.value=F.label,N()}function A(F,v){var G;v==null||v.stopPropagation();const D=k.value.filter(ce=>ce!==F);o("update:modelValue",D.length>0?D:null),(G=s.value)==null||G.focus()}function R(){const F=c.value.trim();F&&(o("create",F),c.value="",n.multiple||N())}function q(){if(!l.value||d.value<0)return;const F=l.value.children[d.value];F==null||F.scrollIntoView({block:"nearest"})}function Q(F){var G,ce;const v=C.value.length;if(v===0)return;let D=d.value;do D=(D+F+v)%v;while((G=C.value[D])!=null&&G.disabled&&D!==d.value);(ce=C.value[D])!=null&&ce.disabled||(d.value=D,i.nextTick(q))}function ee(F){switch(F.key){case"ArrowDown":F.preventDefault(),r.value?Q(1):M();break;case"ArrowUp":F.preventDefault(),r.value?Q(-1):M();break;case"Enter":F.preventDefault(),r.value&&d.value>=0&&C.value[d.value]?P(C.value[d.value]):y.value&&R();break;case"Escape":F.preventDefault(),N();break;case"Backspace":if(n.multiple&&c.value===""&&k.value.length>0){F.preventDefault();const v=k.value.length-1;u.value===v?(A(k.value[v]),u.value=-1):u.value=v}break;case"Home":r.value&&(F.preventDefault(),d.value=C.value.findIndex(v=>!v.disabled),i.nextTick(q));break;case"End":if(r.value){F.preventDefault();for(let v=C.value.length-1;v>=0;v--)if(!C.value[v].disabled){d.value=v;break}i.nextTick(q)}break;case"Tab":N();break}}function ge(F){const v=c.value.trim();if(!v)return F;const D=new RegExp(`(${v.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return F.replace(D,"<mark>$1</mark>")}function fe(F){return k.value.includes(F)}const be=i.computed(()=>n.multiple?B.value.slice(0,n.maxDisplayedChips):[]),xe=i.computed(()=>n.multiple?Math.max(0,B.value.length-n.maxDisplayedChips):0);return i.watch(()=>n.modelValue,F=>{if(!n.multiple&&F!==null&&F!==void 0){const v=n.options.find(D=>D.value===F);v&&(c.value=v.label)}},{immediate:!0}),i.onBeforeUnmount(()=>{document.removeEventListener("mousedown",T),window.removeEventListener("resize",N),window.removeEventListener("scroll",w,!0)}),(F,v)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-combobox",[`ui-combobox--${t.size}`,{"ui-combobox--block":t.block,"ui-combobox--disabled":t.disabled,"ui-combobox--error":t.error,"ui-combobox--open":r.value,"ui-combobox--multiple":t.multiple}]])},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:f.value,class:"ui-combobox__label"},[i.createTextVNode(i.toDisplayString(t.label)+" ",1),t.required?(i.openBlock(),i.createElementBlock("span",Xb,"*")):i.createCommentVNode("",!0)],8,Ub)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"containerRef",ref:a,class:i.normalizeClass(["ui-combobox__trigger",[`ui-combobox__trigger--${t.size}`,{"ui-combobox__trigger--error":t.error,"ui-combobox__trigger--multiple":t.multiple}]]),onClick:v[0]||(v[0]=D=>{var G;return(G=s.value)==null?void 0:G.focus()})},[t.multiple?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(be.value,(D,G)=>(i.openBlock(),i.createElementBlock("span",{key:D.value,class:i.normalizeClass(["ui-combobox__chip",{"ui-combobox__chip--marked":u.value===k.value.indexOf(D.value)}])},[i.createTextVNode(i.toDisplayString(D.label)+" ",1),i.createElementVNode("button",{type:"button",class:"ui-combobox__chip-remove",tabindex:"-1","aria-label":"Remove",onClick:ce=>A(D.value,ce)},[...v[1]||(v[1]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[i.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Kb)],2))),128)),xe.value>0?(i.openBlock(),i.createElementBlock("span",qb," +"+i.toDisplayString(xe.value),1)):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),i.createElementVNode("input",{id:f.value,ref_key:"inputRef",ref:s,type:"text",role:"combobox",class:"ui-combobox__input",value:c.value,placeholder:t.multiple&&k.value.length>0?"":t.placeholder,disabled:t.disabled,"aria-expanded":r.value,"aria-controls":m.value,"aria-activedescendant":x.value,"aria-invalid":t.error?"true":void 0,"aria-describedby":_.value,"aria-required":t.required,"aria-autocomplete":"list",autocomplete:"off",onInput:$,onFocus:K,onKeydown:ee},null,40,Gb),(i.openBlock(),i.createElementBlock("svg",{class:i.normalizeClass(["ui-combobox__chevron",{"ui-combobox__chevron--open":r.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[...v[2]||(v[2]=[i.createElementVNode("path",{d:"M6 9l6 6 6-6"},null,-1)])],2))],2),t.name?(i.openBlock(),i.createElementBlock("select",{key:1,name:t.name,multiple:t.multiple,required:t.required,disabled:t.disabled,class:"ui-combobox__native",tabindex:"-1","aria-hidden":"true"},[t.multiple?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",Zb,i.toDisplayString(t.placeholder),1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.options,D=>(i.openBlock(),i.createElementBlock("option",{key:D.value,value:D.value,selected:fe(D.value),disabled:D.disabled},i.toDisplayString(D.label),9,Qb))),128))],8,Jb)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-combobox-menu"},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("ul",{key:0,id:m.value,ref_key:"listboxRef",ref:l,role:"listbox",class:i.normalizeClass(["ui-combobox__listbox",{"ui-combobox__listbox--multi":t.multiple}]),style:i.normalizeStyle(S.value),"aria-labelledby":f.value,"aria-multiselectable":t.multiple},[C.value.length===0&&!y.value?(i.openBlock(),i.createElementBlock("li",t_," No results found ")):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(C.value,(D,G)=>(i.openBlock(),i.createElementBlock("li",{key:D.value,id:b(G),role:"option",class:i.normalizeClass(["ui-combobox__option",{"ui-combobox__option--selected":fe(D.value),"ui-combobox__option--highlighted":G===d.value,"ui-combobox__option--disabled":D.disabled}]),"aria-selected":fe(D.value),"aria-disabled":D.disabled,onMouseenter:ce=>!D.disabled&&(d.value=G),onClick:ce=>P(D)},[t.multiple?(i.openBlock(),i.createElementBlock("span",i_,[fe(D.value)?(i.openBlock(),i.createElementBlock("svg",o_,[...v[3]||(v[3]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:"ui-combobox__option-label",innerHTML:ge(D.label)},null,8,a_),!t.multiple&&fe(D.value)?(i.openBlock(),i.createElementBlock("svg",s_,[...v[4]||(v[4]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):i.createCommentVNode("",!0)],42,n_))),128)),y.value?(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass(["ui-combobox__option ui-combobox__option--create",{"ui-combobox__option--highlighted":C.value.length===0}]),onClick:R},[v[5]||(v[5]=i.createTextVNode(' Create "',-1)),i.createElementVNode("strong",null,i.toDisplayString(c.value.trim()),1),v[6]||(v[6]=i.createTextVNode('" ',-1))],2)):i.createCommentVNode("",!0)],14,e_)):i.createCommentVNode("",!0)]),_:1})])),t.error?(i.openBlock(),i.createElementBlock("p",{key:2,id:g.value,class:"ui-combobox__message ui-combobox__message--error",role:"alert"},i.toDisplayString(t.error),9,l_)):t.hint?(i.openBlock(),i.createElementBlock("p",{key:3,id:p.value,class:"ui-combobox__message ui-combobox__message--hint"},i.toDisplayString(t.hint),9,r_)):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1b692de"]]),d_=["id","checked","disabled"],u_={class:"ui-choice-chip__label"},h_=O(i.defineComponent({__name:"ChoiceChip",props:{modelValue:{type:Boolean},value:{},label:{},icon:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=i.inject("choiceChipGroup",null),s=i.computed(()=>a!==null&&n.value!==void 0),l=i.computed(()=>n.disabled||(a==null?void 0:a.disabled)),r=i.computed(()=>{if(s.value&&a&&n.value!==void 0){const u=a.modelValue.value;return Array.isArray(u)?u.includes(n.value):u===n.value}return n.modelValue??!1}),c=ye("chip");function d(){if(!l.value)if(s.value&&a&&n.value!==void 0)a.toggle(n.value);else{const u=!n.modelValue;o("update:modelValue",u),o("change",u)}}return(u,h)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ui-choice-chip",{"ui-choice-chip--selected":r.value,"ui-choice-chip--disabled":l.value}])},[i.createElementVNode("input",{id:i.unref(c),type:"checkbox",checked:r.value,disabled:l.value,class:"ui-choice-chip__input",onChange:d},null,40,d_),h[0]||(h[0]=i.createElementVNode("span",{class:"ui-choice-chip__check","aria-hidden":"true"},[i.createElementVNode("svg",{class:"ui-choice-chip__check-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{d:"M3.5 8.5L6.5 11L12.5 5"})])],-1)),t.icon?(i.openBlock(),i.createBlock(je,{key:0,icon:t.icon,class:"ui-choice-chip__icon"},null,8,["icon"])):i.createCommentVNode("",!0),i.createElementVNode("span",u_,i.toDisplayString(t.label),1)],2))}}),[["__scopeId","data-v-f6532f10"]]),f_=["aria-label","aria-disabled"],m_=O(i.defineComponent({__name:"ChoiceChipGroup",props:{modelValue:{},type:{default:"multiple"},disabled:{type:Boolean,default:!1},label:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e;function a(s){if(n.type==="single"){const l=n.modelValue===s?void 0:s;o("update:modelValue",l),o("change",l)}else{const l=Array.isArray(n.modelValue)?n.modelValue:[],r=l.includes(s)?l.filter(c=>c!==s):[...l,s];o("update:modelValue",r),o("change",r)}}return i.provide("choiceChipGroup",{modelValue:i.toRef(n,"modelValue"),toggle:a,type:n.type,disabled:n.disabled}),(s,l)=>(i.openBlock(),i.createElementBlock("div",{role:"group","aria-label":t.label,"aria-disabled":t.disabled||void 0,class:i.normalizeClass(["ui-choice-chip-group",{"ui-choice-chip-group--disabled":t.disabled}])},[i.renderSlot(s.$slots,"default",{},void 0,!0)],10,f_))}}),[["__scopeId","data-v-3bf6d709"]]),p_=["for"],g_=["aria-disabled","aria-describedby"],b_=["id","accept","multiple","disabled"],__={class:"ui-file-upload__content"},y_={class:"ui-file-upload__text"},k_={key:0,class:"ui-file-upload__drop-text"},x_={key:0,class:"ui-file-upload__secondary-text"},w_={key:0,class:"ui-file-upload__paste-indicator"},C_={key:1,class:"ui-file-upload__list",role:"list"},B_={class:"ui-file-upload__file-preview"},S_=["src","alt"],E_=["data-type"],M_={class:"ui-file-upload__file-info"},v_={class:"ui-file-upload__file-name"},V_={class:"ui-file-upload__file-meta"},D_={class:"ui-file-upload__file-error"},$_={key:0,class:"ui-file-upload__progress"},T_={class:"ui-file-upload__file-status"},I_={key:0,class:"ui-file-upload__status-icon ui-file-upload__status-icon--success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},L_={key:1,class:"ui-file-upload__status-icon ui-file-upload__status-icon--error",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},z_={key:2,class:"ui-file-upload__spinner"},N_={key:0,class:"ui-file-upload__actions"},P_=["id"],A_=["id"],R_=O(i.defineComponent({__name:"FileUpload",props:{modelValue:{default:()=>[]},accept:{},multiple:{type:Boolean,default:!1},maxSize:{},maxFiles:{},disabled:{type:Boolean,default:!1},label:{},hint:{},error:{},showPreviews:{type:Boolean,default:!0},compact:{type:Boolean,default:!1},allowPaste:{type:Boolean,default:!0}},emits:["update:modelValue","files-added","file-removed","file-rejected","files-pasted","file-replaced"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=i.ref(null),l=i.ref(null),r=i.ref(null),c=i.ref(!1),d=i.ref(0),u=i.ref(!1),h=i.ref(!1),f=i.ref(!1),m=ye("file-upload"),p=i.computed(()=>m),g=i.computed(()=>`${m}-hint`),b=i.computed(()=>`${m}-error`),_=i.computed(()=>{if(o.error)return b.value;if(o.hint)return g.value}),k=i.ref(new Map);function B(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function C(L){if(L===0)return"0 B";const j=1024,X=["B","KB","MB","GB"],ne=Math.floor(Math.log(L)/Math.log(j));return`${parseFloat((L/Math.pow(j,ne)).toFixed(1))} ${X[ne]}`}function y(L){if(!o.accept)return!0;const j=o.accept.split(",").map(X=>X.trim().toLowerCase());for(const X of j){if(X===L.type.toLowerCase())return!0;if(X.endsWith("/*")){const ne=X.slice(0,-2);if(L.type.toLowerCase().startsWith(ne+"/"))return!0}if(X.startsWith(".")&&L.name.toLowerCase().slice(L.name.lastIndexOf("."))===X)return!0}return!1}function x(L){return y(L)?o.maxSize&&L.size>o.maxSize?`File exceeds maximum size of ${C(o.maxSize)}`:null:`File type "${L.type||"unknown"}" is not accepted`}function S(L){return!o.showPreviews||!L.type.startsWith("image/")?void 0:URL.createObjectURL(L)}function w(L){const j=Array.from(L),X=o.modelValue.length,ne=[];for(const he of j){if(o.maxFiles&&X+ne.length>=o.maxFiles){a("file-rejected",he,`Maximum ${o.maxFiles} files allowed`);continue}const Ae=x(he);if(Ae){a("file-rejected",he,Ae);continue}const Re=B(),Ye=S(he);Ye&&k.value.set(Re,Ye),ne.push({id:Re,file:he,name:he.name,size:he.size,type:he.type,preview:Ye,progress:0,status:"pending"})}if(ne.length>0){const he=o.multiple?[...o.modelValue,...ne]:ne.slice(0,1);a("update:modelValue",he),a("files-added",ne)}return ne}function M(L){const j=L.target;j.files&&j.files.length>0&&(r.value?N(j.files[0]):w(j.files)),j.value="",r.value=null}function N(L){if(!r.value)return;const j=o.modelValue.findIndex(Z=>Z.id===r.value);if(j===-1)return;const X=o.modelValue[j],ne=x(L);if(ne){a("file-rejected",L,ne);return}const he=k.value.get(X.id);he&&(URL.revokeObjectURL(he),k.value.delete(X.id));const Ae=B(),Re=S(L);Re&&k.value.set(Ae,Re);const Ye={id:Ae,file:L,name:L.name,size:L.size,type:L.type,preview:Re,progress:0,status:"pending"},V=[...o.modelValue];V[j]=Ye,a("update:modelValue",V),a("file-replaced",X,Ye)}function T(L){const j=k.value.get(L.id);j&&(URL.revokeObjectURL(j),k.value.delete(L.id));const X=o.modelValue.filter(ne=>ne.id!==L.id);a("update:modelValue",X),a("file-removed",L)}function $(L){var j;o.disabled||(r.value=L.id,(j=s.value)==null||j.click())}function K(){var L;o.disabled||(L=s.value)==null||L.click()}function P(L){(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),K())}function A(L){L.preventDefault(),!o.disabled&&(d.value++,c.value=!0)}function R(L){L.preventDefault()}function q(L){L.preventDefault(),!o.disabled&&(d.value--,d.value===0&&(c.value=!1))}function Q(L){var j;L.preventDefault(),!o.disabled&&(d.value=0,c.value=!1,(j=L.dataTransfer)!=null&&j.files&&L.dataTransfer.files.length>0&&w(L.dataTransfer.files))}function ee(){h.value=!0}function ge(){h.value=!1}function fe(){f.value=!0}function be(){f.value=!1}function xe(L){var ne;if(!o.allowPaste||o.disabled||!h.value&&!f.value)return;const j=(ne=L.clipboardData)==null?void 0:ne.items;if(!j)return;const X=[];for(const he of Array.from(j))if(he.kind==="file"){const Ae=he.getAsFile();Ae&&X.push(Ae)}if(X.length>0){const he=w(X);he.length>0&&(u.value=!0,setTimeout(()=>{u.value=!1},1500),a("files-pasted",he))}}function F(L,j){const X=o.modelValue.find(ne=>ne.id===L);X&&(X.progress=Math.min(100,Math.max(0,j)),X.status==="pending"&&(X.status="uploading"))}function v(L){const j=o.modelValue.find(X=>X.id===L);j&&(j.progress=100,j.status="success")}function D(L,j){const X=o.modelValue.find(ne=>ne.id===L);X&&(X.status="error",X.error=j)}function G(){for(const L of k.value.values())URL.revokeObjectURL(L);k.value.clear(),a("update:modelValue",[])}e({updateProgress:F,markSuccess:v,markError:D,clearAll:G,triggerInput:K,replaceFile:$}),i.onMounted(()=>{o.allowPaste&&document.addEventListener("paste",xe)}),i.watch(()=>o.allowPaste,L=>{L?document.addEventListener("paste",xe):document.removeEventListener("paste",xe)}),i.onBeforeUnmount(()=>{document.removeEventListener("paste",xe);for(const L of k.value.values())URL.revokeObjectURL(L);k.value.clear()}),i.watch(()=>o.modelValue,(L,j)=>{if(!j)return;const X=new Set(L.map(ne=>ne.id));for(const ne of j)if(!X.has(ne.id)){const he=k.value.get(ne.id);he&&(URL.revokeObjectURL(he),k.value.delete(ne.id))}},{deep:!0});const ce=i.computed(()=>o.modelValue.length>0);i.computed(()=>o.modelValue.some(L=>L.status==="uploading"));function ze(L){return L.startsWith("image/")?"image":L.startsWith("video/")?"video":L.startsWith("audio/")?"audio":L==="application/pdf"?"pdf":L.includes("spreadsheet")||L.includes("excel")?"spreadsheet":L.includes("document")||L.includes("word")?"document":L.includes("zip")||L.includes("compressed")?"archive":"file"}return(L,j)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-file-upload",{"ui-file-upload--disabled":t.disabled,"ui-file-upload--error":t.error,"ui-file-upload--compact":t.compact}])},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:p.value,class:"ui-file-upload__label"},i.toDisplayString(t.label),9,p_)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"dropzoneRef",ref:l,class:i.normalizeClass(["ui-file-upload__dropzone",{"ui-file-upload__dropzone--active":c.value,"ui-file-upload__dropzone--disabled":t.disabled,"ui-file-upload__dropzone--error":t.error,"ui-file-upload__dropzone--has-files":ce.value&&!t.compact}]),role:"button",tabindex:"0","aria-disabled":t.disabled,"aria-describedby":_.value,onClick:K,onKeydown:P,onDragenter:A,onDragover:R,onDragleave:q,onDrop:Q,onMouseenter:ee,onMouseleave:ge,onFocus:fe,onBlur:be},[i.createElementVNode("input",{id:p.value,ref_key:"inputRef",ref:s,type:"file",class:"ui-file-upload__input",accept:t.accept,multiple:t.multiple,disabled:t.disabled,tabindex:"-1",onChange:M},null,40,b_),i.createElementVNode("div",__,[j[1]||(j[1]=i.createElementVNode("div",{class:"ui-file-upload__icon","aria-hidden":"true"},[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[i.createElementVNode("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4","stroke-linecap":"round","stroke-linejoin":"round"}),i.createElementVNode("path",{d:"M3 15v4a2 2 0 002 2h14a2 2 0 002-2v-4","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),i.createElementVNode("div",y_,[c.value?(i.openBlock(),i.createElementBlock("span",k_," Drop files here ")):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[j[0]||(j[0]=i.createElementVNode("span",{class:"ui-file-upload__primary-text"},[i.createElementVNode("span",{class:"ui-file-upload__link"},"Click to upload"),i.createTextVNode(" or drag and drop ")],-1)),t.accept||t.maxSize||t.allowPaste?(i.openBlock(),i.createElementBlock("span",x_,[t.accept?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(i.toDisplayString(t.accept),1)],64)):i.createCommentVNode("",!0),t.accept&&(t.maxSize||t.allowPaste)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(" · ")],64)):i.createCommentVNode("",!0),t.maxSize?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createTextVNode("Max "+i.toDisplayString(C(t.maxSize)),1)],64)):i.createCommentVNode("",!0),t.maxSize&&t.allowPaste?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createTextVNode(" · ")],64)):i.createCommentVNode("",!0),t.allowPaste?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[i.createTextVNode("Paste (Ctrl+V)")],64)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],64))])]),i.createVNode(i.Transition,{name:"ui-file-upload-fade"},{default:i.withCtx(()=>[u.value?(i.openBlock(),i.createElementBlock("div",w_,[...j[2]||(j[2]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[i.createElementVNode("path",{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2"}),i.createElementVNode("rect",{x:"9",y:"3",width:"6",height:"4",rx:"1"})],-1),i.createElementVNode("span",null,"Files pasted",-1)])])):i.createCommentVNode("",!0)]),_:1})],42,g_),ce.value?(i.openBlock(),i.createElementBlock("ul",C_,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.modelValue,X=>(i.openBlock(),i.createElementBlock("li",{key:X.id,class:i.normalizeClass(["ui-file-upload__file",{"ui-file-upload__file--uploading":X.status==="uploading","ui-file-upload__file--success":X.status==="success","ui-file-upload__file--error":X.status==="error"}])},[i.createElementVNode("div",B_,[X.preview?(i.openBlock(),i.createElementBlock("img",{key:0,src:X.preview,alt:X.name,class:"ui-file-upload__file-image"},null,8,S_)):(i.openBlock(),i.createElementBlock("div",{key:1,class:"ui-file-upload__file-icon","data-type":ze(X.type)},[...j[3]||(j[3]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[i.createElementVNode("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),i.createElementVNode("polyline",{points:"14 2 14 8 20 8"})],-1)])],8,E_))]),i.createElementVNode("div",M_,[i.createElementVNode("span",v_,i.toDisplayString(X.name),1),i.createElementVNode("span",V_,[i.createTextVNode(i.toDisplayString(C(X.size))+" ",1),X.status==="error"&&X.error?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[j[4]||(j[4]=i.createTextVNode(" · ",-1)),i.createElementVNode("span",D_,i.toDisplayString(X.error),1)],64)):X.status==="success"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[j[5]||(j[5]=i.createTextVNode(" · ",-1)),j[6]||(j[6]=i.createElementVNode("span",{class:"ui-file-upload__file-success"},"Uploaded",-1))],64)):i.createCommentVNode("",!0)]),X.status==="uploading"?(i.openBlock(),i.createElementBlock("div",$_,[i.createElementVNode("div",{class:"ui-file-upload__progress-bar",style:i.normalizeStyle({width:`${X.progress}%`})},null,4)])):i.createCommentVNode("",!0)]),i.createElementVNode("div",T_,[X.status==="success"?(i.openBlock(),i.createElementBlock("svg",I_,[...j[7]||(j[7]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):X.status==="error"?(i.openBlock(),i.createElementBlock("svg",L_,[...j[8]||(j[8]=[i.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),i.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"12"},null,-1),i.createElementVNode("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"},null,-1)])])):X.status==="uploading"?(i.openBlock(),i.createElementBlock("div",z_)):i.createCommentVNode("",!0)]),X.status!=="uploading"?(i.openBlock(),i.createElementBlock("div",N_,[i.createVNode(Je,{variant:"ghost",size:"xs","aria-label":`Replace ${X.name}`,onClick:i.withModifiers(ne=>$(X),["stop"])},{default:i.withCtx(()=>[...j[9]||(j[9]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16"},[i.createElementVNode("path",{d:"M4 12v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l4 4m0 0l-4 4m4-4H9","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),_:1},8,["aria-label","onClick"]),i.createVNode(Je,{variant:"ghost",size:"xs",class:"ui-file-upload__remove-btn","aria-label":`Remove ${X.name}`,onClick:i.withModifiers(ne=>T(X),["stop"])},{default:i.withCtx(()=>[...j[10]||(j[10]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16"},[i.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),_:1},8,["aria-label","onClick"])])):i.createCommentVNode("",!0)],2))),128))])):i.createCommentVNode("",!0),t.error?(i.openBlock(),i.createElementBlock("p",{key:2,id:b.value,class:"ui-file-upload__message ui-file-upload__message--error",role:"alert"},i.toDisplayString(t.error),9,P_)):t.hint?(i.openBlock(),i.createElementBlock("p",{key:3,id:g.value,class:"ui-file-upload__message ui-file-upload__message--hint"},i.toDisplayString(t.hint),9,A_)):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-d7977cee"]]),O_=O(i.defineComponent({__name:"Heading",props:{as:{default:"h2"},size:{default:"2xl"},align:{default:"left"},truncate:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>["ui-heading",`ui-heading--${e.size}`,`ui-heading--${e.align}`,{"ui-heading--truncate":e.truncate}]);return(o,a)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(n.value)},{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-e911d31f"]]),F_={class:"ui-modal__box"},W_={key:0,class:"ui-modal__header"},H_={class:"ui-modal__title"},j_={class:"ui-modal__body"},Y_={key:1,class:"ui-modal__footer"},U_=O(i.defineComponent({__name:"Modal",props:{modelValue:{type:Boolean,default:!1},title:{},size:{default:"md"},persistent:{type:Boolean,default:!1}},emits:["update:modelValue","close"],setup(t,{emit:e}){const n=t,o=e,a=i.useSlots(),s=i.ref(null),l=i.computed(()=>n.modelValue);Tn(l);function r(){o("update:modelValue",!1)}function c(m){n.persistent||m.target===s.value&&r()}function d(m){if(n.persistent){m.preventDefault();return}o("update:modelValue",!1)}function u(){o("update:modelValue",!1),o("close")}function h(m){const p=s.value;p&&(m&&!p.open?p.showModal():!m&&p.open&&p.close())}i.onMounted(()=>{n.modelValue&&h(!0)}),i.watch(()=>n.modelValue,m=>{h(m)});const f=()=>n.title||a.header;return(m,p)=>(i.openBlock(),i.createElementBlock("dialog",{ref_key:"dialogRef",ref:s,class:i.normalizeClass(["ui-modal",[`ui-modal--${t.size}`]]),onClick:c,onCancel:d,onClose:u},[i.createElementVNode("div",F_,[f()?(i.openBlock(),i.createElementBlock("header",W_,[i.renderSlot(m.$slots,"header",{},()=>[i.createElementVNode("h3",H_,i.toDisplayString(t.title),1)],!0),i.createElementVNode("button",{type:"button",class:"ui-modal__close","aria-label":"Close modal",onClick:r},[...p[0]||(p[0]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12"})],-1)])])])):i.createCommentVNode("",!0),i.createElementVNode("div",j_,[i.renderSlot(m.$slots,"default",{},void 0,!0)]),m.$slots.footer?(i.openBlock(),i.createElementBlock("footer",Y_,[i.renderSlot(m.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)])],34))}}),[["__scopeId","data-v-527b557c"]]),X_={class:"ui-progress-linear__track"},K_={key:0,class:"ui-progress-linear__value"},q_=["width","height","viewBox"],G_=["cx","cy","r","stroke-width"],J_=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],Z_={key:0,class:"ui-progress-circular__value"},Q_=O(i.defineComponent({__name:"Progress",props:{value:{default:0},variant:{default:"linear"},size:{default:"md"},color:{default:"primary"},indeterminate:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1},showValue:{type:Boolean,default:!1},label:{},strokeWidth:{}},setup(t){const e=t,n=i.computed(()=>Math.min(100,Math.max(0,e.value))),o=i.computed(()=>["ui-progress-linear",`ui-progress-linear--${e.size}`,`ui-progress-linear--${e.color}`,{"ui-progress-linear--indeterminate":e.indeterminate,"ui-progress-linear--striped":e.striped&&!e.indeterminate,"ui-progress-linear--animated":e.animated&&e.striped&&!e.indeterminate}]),a=i.computed(()=>["ui-progress-circular",`ui-progress-circular--${e.size}`,`ui-progress-circular--${e.color}`,{"ui-progress-circular--indeterminate":e.indeterminate}]),s=i.computed(()=>({sm:32,md:48,lg:64})[e.size]),l=i.computed(()=>e.strokeWidth?e.strokeWidth:{sm:3,md:4,lg:5}[e.size]),r=i.computed(()=>(s.value-l.value)/2),c=i.computed(()=>2*Math.PI*r.value),d=i.computed(()=>c.value-n.value/100*c.value),u=i.computed(()=>{const f={role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-label":e.label};return e.indeterminate||(f["aria-valuenow"]=n.value),f}),h=i.computed(()=>({width:`${n.value}%`}));return(f,m)=>t.variant==="linear"?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,class:o.value},u.value),[i.createElementVNode("div",X_,[i.createElementVNode("div",{class:"ui-progress-linear__indicator",style:i.normalizeStyle(t.indeterminate?void 0:h.value)},null,4)]),t.showValue&&!t.indeterminate?(i.openBlock(),i.createElementBlock("span",K_,i.toDisplayString(n.value)+"% ",1)):i.createCommentVNode("",!0)],16)):(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:1,class:a.value},u.value),[(i.openBlock(),i.createElementBlock("svg",{width:s.value,height:s.value,viewBox:`0 0 ${s.value} ${s.value}`,class:"ui-progress-circular__svg"},[i.createElementVNode("circle",{class:"ui-progress-circular__track",cx:s.value/2,cy:s.value/2,r:r.value,fill:"none","stroke-width":l.value},null,8,G_),i.createElementVNode("circle",{class:"ui-progress-circular__indicator",cx:s.value/2,cy:s.value/2,r:r.value,fill:"none","stroke-width":l.value,"stroke-dasharray":c.value,"stroke-dashoffset":t.indeterminate?c.value*.75:d.value,"stroke-linecap":"round"},null,8,J_)],8,q_)),t.showValue&&!t.indeterminate?(i.openBlock(),i.createElementBlock("span",Z_,i.toDisplayString(n.value)+"% ",1)):i.createCommentVNode("",!0)],16))}}),[["__scopeId","data-v-3da63736"]]),ey=["id","checked","disabled","name","value"],ty={class:"ui-radio__box","aria-hidden":"true"},ny={key:0,class:"ui-radio__dot"},iy={key:0,class:"ui-radio__content"},oy={key:0,class:"ui-radio__label"},ay={key:1,class:"ui-radio__description"},sy=O(i.defineComponent({__name:"Radio",props:{modelValue:{type:[String,Number,Boolean]},value:{type:[String,Number,Boolean]},size:{default:"md"},disabled:{type:Boolean,default:!1},label:{},description:{},name:{},id:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=ye("radio"),s=i.computed(()=>n.id||a),l=i.computed(()=>n.modelValue===n.value);function r(){n.disabled||(o("update:modelValue",n.value),o("change",n.value))}return(c,d)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ui-radio",[`ui-radio--${t.size}`,{"ui-radio--disabled":t.disabled,"ui-radio--checked":l.value}]])},[i.createElementVNode("input",{id:s.value,type:"radio",checked:l.value,disabled:t.disabled,name:t.name,value:t.value,class:"ui-radio__input",onChange:r},null,40,ey),i.createElementVNode("span",ty,[l.value?(i.openBlock(),i.createElementBlock("span",ny)):i.createCommentVNode("",!0)]),t.label||t.description?(i.openBlock(),i.createElementBlock("span",iy,[t.label?(i.openBlock(),i.createElementBlock("span",oy,i.toDisplayString(t.label),1)):i.createCommentVNode("",!0),t.description?(i.openBlock(),i.createElementBlock("span",ay,i.toDisplayString(t.description),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-bc19dbee"]]),ly=["aria-label","aria-valuemax","aria-valuenow","aria-readonly","tabindex"],ry=["onMousemove","onClick"],cy=O(i.defineComponent({__name:"Rating",props:{modelValue:{},max:{default:5},readonly:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},size:{default:"md"},label:{default:"Rating"}},emits:["update:modelValue","hover"],setup(t,{emit:e}){const n=ve("star"),o=ve("starFilled"),a=t,s=e,l=i.ref(null),r=i.computed(()=>l.value??a.modelValue);function c(p){const g=r.value;return g>=p?"full":a.allowHalf&&g>=p-.5?"half":"empty"}function d(p,g){if(a.readonly)return;const _=p.currentTarget.getBoundingClientRect(),B=p.clientX-_.left<_.width/2;let C;a.allowHalf&&B?C=g-.5:C=g,l.value=C,s("hover",C)}function u(){l.value=null,s("hover",null)}function h(p,g){if(a.readonly)return;const _=p.currentTarget.getBoundingClientRect(),B=p.clientX-_.left<_.width/2;let C;a.allowHalf&&B?C=g-.5:C=g,s("update:modelValue",C)}function f(p){if(a.readonly)return;const g=a.allowHalf?.5:1;let b=a.modelValue;switch(p.key){case"ArrowRight":case"ArrowUp":p.preventDefault(),b=Math.min(a.modelValue+g,a.max);break;case"ArrowLeft":case"ArrowDown":p.preventDefault(),b=Math.max(a.modelValue-g,0);break;case"Home":p.preventDefault(),b=0;break;case"End":p.preventDefault(),b=a.max;break;default:return}b!==a.modelValue&&s("update:modelValue",b)}const m=i.computed(()=>{switch(a.size){case"sm":return"16px";case"lg":return"28px";default:return"22px"}});return(p,g)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-rating",[`ui-rating--${t.size}`,{"ui-rating--readonly":t.readonly}]]),role:"slider","aria-label":t.label,"aria-valuemin":0,"aria-valuemax":t.max,"aria-valuenow":t.modelValue,"aria-readonly":t.readonly||void 0,tabindex:t.readonly?-1:0,onMouseleave:u,onKeydown:f},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.max,b=>(i.openBlock(),i.createElementBlock("span",{key:b,class:i.normalizeClass(["ui-rating__star",[`ui-rating__star--${c(b)}`]]),onMousemove:_=>d(_,b),onClick:_=>h(_,b)},[i.createVNode(je,{icon:i.unref(n),size:m.value,class:"ui-rating__icon ui-rating__icon--empty"},null,8,["icon","size"]),i.createVNode(je,{icon:i.unref(o),size:m.value,class:"ui-rating__icon ui-rating__icon--filled"},null,8,["icon","size"])],42,ry))),128))],42,ly))}}),[["__scopeId","data-v-200913f2"]]),dy=["id","aria-label","aria-disabled"],uy=["aria-checked","disabled","tabindex","onClick","onKeydown"],hy=["name","value"],fy=O(i.defineComponent({__name:"SegmentedControl",props:{options:{},modelValue:{},size:{default:"md"},disabled:{type:Boolean,default:!1},label:{},name:{},id:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(null),s=i.ref([]),l=ye("segmented"),r=i.computed(()=>n.id||l),c=i.ref({transform:"translateX(0px)",width:"0px",opacity:0}),d=i.computed(()=>n.options.findIndex(p=>p.value===n.modelValue));function u(){const p=d.value;if(p===-1||!s.value[p]){c.value.opacity=0;return}const g=s.value[p],b=a.value;if(!b)return;const _=b.getBoundingClientRect(),B=g.getBoundingClientRect().left-_.left,C=g.offsetWidth;c.value={transform:`translateX(${B}px)`,width:`${C}px`,opacity:1}}i.watch(()=>n.modelValue,()=>{i.nextTick(u)}),i.watch(()=>n.options,()=>{i.nextTick(u)},{deep:!0}),i.onMounted(()=>{requestAnimationFrame(()=>{u()})});function h(p){n.disabled||p.disabled||(o("update:modelValue",p.value),o("change",p.value))}function f(p,g){const b=n.options.map((B,C)=>({opt:B,i:C})).filter(({opt:B})=>!B.disabled),_=b.findIndex(({i:B})=>B===g);if(_===-1)return;let k=-1;switch(p.key){case"ArrowRight":case"ArrowDown":p.preventDefault(),k=b[(_+1)%b.length].i;break;case"ArrowLeft":case"ArrowUp":p.preventDefault(),k=b[(_-1+b.length)%b.length].i;break;case"Home":p.preventDefault(),k=b[0].i;break;case"End":p.preventDefault(),k=b[b.length-1].i;break}k!==-1&&s.value[k]&&(s.value[k].focus(),h(n.options[k]))}function m(p,g){p&&(s.value[g]=p)}return(p,g)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"containerRef",ref:a,id:r.value,role:"radiogroup","aria-label":t.label,"aria-disabled":t.disabled||void 0,class:i.normalizeClass(["ui-segmented",[`ui-segmented--${t.size}`,{"ui-segmented--disabled":t.disabled}]])},[i.createElementVNode("div",{class:"ui-segmented__glider",style:i.normalizeStyle(c.value),"aria-hidden":"true"},null,4),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.options,(b,_)=>(i.openBlock(),i.createElementBlock("button",{key:b.value,ref_for:!0,ref:k=>m(k,_),type:"button",role:"radio","aria-checked":t.modelValue===b.value,disabled:t.disabled||b.disabled,tabindex:t.modelValue===b.value?0:-1,class:i.normalizeClass(["ui-segmented__item",{"ui-segmented__item--selected":t.modelValue===b.value,"ui-segmented__item--disabled":b.disabled}]),onClick:k=>h(b),onKeydown:k=>f(k,_)},i.toDisplayString(b.label),43,uy))),128)),t.name?(i.openBlock(),i.createElementBlock("input",{key:0,type:"hidden",name:t.name,value:t.modelValue},null,8,hy)):i.createCommentVNode("",!0)],10,dy))}}),[["__scopeId","data-v-d2d81e0b"]]);function $o(t,e,n){return n===e?0:(t-e)/(n-e)*100}function my(t,e,n){return t/100*(n-e)+e}function vn(t,e,n){const o=t-n;return Math.round(o/e)*e+n}function Rt(t,e,n){return Math.min(Math.max(t,e),n)}function Rl(t,e,n,o,a){const s=(t-e.left)/e.width*100,l=Rt(s,0,100),r=my(l,n,o);return Rt(vn(r,a,n),n,o)}function py(t,e,n){const o=Math.abs(t-e),a=Math.abs(t-n);return o<=a?"min":"max"}const gy={key:0,class:"ui-slider__ticks"},by=["aria-valuemin","aria-valuemax","aria-valuenow","aria-disabled"],_y={key:0,class:"ui-slider__tooltip"},yy=["aria-valuemin","aria-valuemax","aria-valuenow","aria-disabled","aria-label"],ky={key:0,class:"ui-slider__tooltip"},xy=O(i.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},showTicks:{type:Boolean,default:!1},size:{default:"md"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(null),s=i.ref(!1),l=i.ref(null),r=i.computed(()=>Array.isArray(n.modelValue)),c=i.computed(()=>r.value?n.modelValue[0]:n.modelValue),d=i.computed(()=>r.value?n.modelValue[1]:n.modelValue),u=i.computed(()=>r.value?$o(c.value,n.min,n.max):0),h=i.computed(()=>$o(d.value,n.min,n.max)),f=i.computed(()=>r.value?{left:`${u.value}%`,right:`${100-h.value}%`}:{left:"0%",right:`${100-h.value}%`}),m=i.computed(()=>{if(!n.showTicks||n.step<=0)return[];const y=[],x=n.max-n.min,S=Math.floor(x/n.step);if(S>100||S<2)return[];for(let w=1;w<S;w++){const M=n.min+w*n.step;y.push($o(M,n.min,n.max))}return y});function p(y,x){r.value?o("update:modelValue",[y,x]):o("update:modelValue",x)}function g(y,x){r.value?o("change",[y,x]):o("change",x)}function b(y,x){if(n.disabled)return;y.preventDefault();const S=a.value;if(!S)return;const w=S.getBoundingClientRect(),M=Rl(y.clientX,w,n.min,n.max,n.step);x?l.value=x:r.value?l.value=py(M,c.value,d.value):l.value="max",s.value=!0,B(M),document.addEventListener("pointermove",_),document.addEventListener("pointerup",k)}function _(y){if(!s.value||!a.value)return;const x=a.value.getBoundingClientRect(),S=Rl(y.clientX,x,n.min,n.max,n.step);B(S)}function k(){s.value&&g(c.value,d.value),s.value=!1,l.value=null,document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",k)}function B(y){if(r.value)if(l.value==="min"){const x=Rt(y,n.min,d.value);p(x,d.value)}else{const x=Rt(y,c.value,n.max);p(c.value,x)}else p(n.min,y)}function C(y,x){if(n.disabled)return;const S=x==="min"?c.value:d.value;let w=S;switch(y.key){case"ArrowRight":case"ArrowUp":y.preventDefault(),w=vn(S+n.step,n.step,n.min);break;case"ArrowLeft":case"ArrowDown":y.preventDefault(),w=vn(S-n.step,n.step,n.min);break;case"Home":y.preventDefault(),w=n.min;break;case"End":y.preventDefault(),w=n.max;break;case"PageUp":y.preventDefault(),w=vn(S+n.step*10,n.step,n.min);break;case"PageDown":y.preventDefault(),w=vn(S-n.step*10,n.step,n.min);break;default:return}r.value?x==="min"?(w=Rt(w,n.min,d.value),p(w,d.value)):(w=Rt(w,c.value,n.max),p(c.value,w)):(w=Rt(w,n.min,n.max),p(n.min,w)),g(c.value,d.value)}return i.onUnmounted(()=>{document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",k)}),(y,x)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-slider",[`ui-slider--${t.size}`,{"ui-slider--disabled":t.disabled,"ui-slider--dragging":s.value,"ui-slider--range":r.value}]])},[i.createElementVNode("div",{ref_key:"trackRef",ref:a,class:"ui-slider__track",onPointerdown:x[4]||(x[4]=S=>b(S))},[i.createElementVNode("div",{class:"ui-slider__range",style:i.normalizeStyle(f.value)},null,4),t.showTicks?(i.openBlock(),i.createElementBlock("div",gy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(m.value,(S,w)=>(i.openBlock(),i.createElementBlock("span",{key:w,class:"ui-slider__tick",style:i.normalizeStyle({left:`${S}%`})},null,4))),128))])):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["ui-slider__thumb",{"ui-slider__thumb--active":l.value==="min"}]),style:i.normalizeStyle({left:`${u.value}%`}),role:"slider",tabindex:"0","aria-valuemin":t.min,"aria-valuemax":d.value,"aria-valuenow":c.value,"aria-disabled":t.disabled||void 0,"aria-label":"Minimum value",onPointerdown:x[0]||(x[0]=i.withModifiers(S=>b(S,"min"),["stop"])),onKeydown:x[1]||(x[1]=S=>C(S,"min"))},[t.showTooltip&&s.value&&l.value==="min"?(i.openBlock(),i.createElementBlock("div",_y,i.toDisplayString(c.value),1)):i.createCommentVNode("",!0)],46,by)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ui-slider__thumb",{"ui-slider__thumb--active":l.value==="max"}]),style:i.normalizeStyle({left:`${h.value}%`}),role:"slider",tabindex:"0","aria-valuemin":r.value?c.value:t.min,"aria-valuemax":t.max,"aria-valuenow":d.value,"aria-disabled":t.disabled||void 0,"aria-label":r.value?"Maximum value":"Value",onPointerdown:x[2]||(x[2]=i.withModifiers(S=>b(S,"max"),["stop"])),onKeydown:x[3]||(x[3]=S=>C(S,"max"))},[t.showTooltip&&s.value&&l.value==="max"?(i.openBlock(),i.createElementBlock("div",ky,i.toDisplayString(d.value),1)):i.createCommentVNode("",!0)],46,yy)],544)],2))}}),[["__scopeId","data-v-55435b60"]]),wy={class:"ui-sidebar-layout__main"},Cy=O(i.defineComponent({__name:"SidebarLayout",props:{sidebarPosition:{default:"left"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-sidebar-layout",[`ui-sidebar-layout--${t.sidebarPosition}`]])},[i.renderSlot(e.$slots,"sidebar",{},void 0,!0),i.createElementVNode("main",wy,[i.renderSlot(e.$slots,"default",{},void 0,!0)])],2))}}),[["__scopeId","data-v-12f99250"]]),Bi=Symbol("sidebar"),Ol=Symbol("sidebar-group"),By={key:0,class:"ui-sidebar__header"},Sy={class:"ui-sidebar__nav"},Ey={key:1,class:"ui-sidebar__footer"},My=O(i.defineComponent({__name:"SidebarRoot",props:{modelValue:{type:Boolean,default:!1},expandedWidth:{default:"240px"},collapsedWidth:{default:"64px"}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=i.ref(o.modelValue);i.watch(()=>o.modelValue,u=>{s.value=u});const l=i.computed(()=>o.modelValue!==void 0),r=i.computed(()=>l.value?o.modelValue:s.value),c=i.computed(()=>r.value?o.collapsedWidth:o.expandedWidth);function d(){const u=!r.value;s.value=u,a("update:modelValue",u)}return i.provide(Bi,{collapsed:r,expandedWidth:i.toRef(o,"expandedWidth"),collapsedWidth:i.toRef(o,"collapsedWidth")}),e({toggle:d,collapsed:r}),(u,h)=>(i.openBlock(),i.createElementBlock("aside",{class:i.normalizeClass(["ui-sidebar",{"ui-sidebar--collapsed":r.value}]),style:i.normalizeStyle({"--sidebar-current-width":c.value}),role:"navigation"},[u.$slots.header?(i.openBlock(),i.createElementBlock("div",By,[i.renderSlot(u.$slots,"header",{},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("nav",Sy,[i.renderSlot(u.$slots,"default",{},void 0,!0)]),u.$slots.footer?(i.openBlock(),i.createElementBlock("div",Ey,[i.renderSlot(u.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-765b4324"]]),vy=["aria-describedby"],Vy=["id"],Fl=O(i.defineComponent({__name:"Tooltip",props:{text:{},placement:{default:"top"},delay:{default:200},offset:{default:8},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=ye("tooltip"),o=i.ref(null),a=i.ref(null),s=i.ref(!1);let l=null,r=null;const{coords:c,updatePosition:d,getPlacement:u}=Wo(o,a,()=>e.placement,e.offset);function h(_){if(!o.value)return;const k=Fo(o.value,_,u(),e.offset);c.value=k}const f=i.computed(()=>({top:`${c.value.top}px`,left:`${c.value.left}px`})),m=i.computed(()=>`ui-tooltip__arrow--${c.value.actualPlacement}`);function p(){e.disabled||(r&&(clearTimeout(r),r=null),l&&clearTimeout(l),l=setTimeout(()=>{s.value=!0},e.delay))}function g(){l&&(clearTimeout(l),l=null),r=setTimeout(()=>{s.value=!1},50)}function b(_){_.key==="Escape"&&s.value&&g()}return i.onUnmounted(()=>{l&&clearTimeout(l),r&&clearTimeout(r)}),(_,k)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",{ref_key:"triggerRef",ref:o,class:"ui-tooltip-trigger","aria-describedby":s.value?i.unref(n):void 0,onMouseenter:p,onMouseleave:g,onFocusin:p,onFocusout:g,onKeydown:b},[i.renderSlot(_.$slots,"default",{},void 0,!0)],40,vy),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:`ui-tooltip-${i.unref(c).actualPlacement}`,onEnter:h},{default:i.withCtx(()=>[s.value&&!t.disabled?(i.openBlock(),i.createElementBlock("div",{key:0,id:i.unref(n),ref_key:"contentRef",ref:a,role:"tooltip",class:"ui-tooltip",style:i.normalizeStyle(f.value)},[i.createTextVNode(i.toDisplayString(t.text)+" ",1),i.createElementVNode("span",{class:i.normalizeClass(["ui-tooltip__arrow",m.value])},null,2)],12,Vy)):i.createCommentVNode("",!0)]),_:1},8,["name"])]))],64))}}),[["__scopeId","data-v-46895466"]]),Dy={key:0,class:"ui-sidebar-item__icon","aria-hidden":"true"},$y={class:"ui-sidebar-item__label"},Ty={key:1,class:"ui-sidebar-item__badge"},Iy=O(i.defineComponent({__name:"SidebarItem",props:{label:{},icon:{},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},as:{default:"button"},href:{},target:{},to:{}},setup(t){const e=t,n=i.inject(Bi);if(!n)throw new Error("SidebarItem must be used within SidebarRoot");const o=i.computed(()=>n.collapsed.value),a=i.computed(()=>["ui-sidebar-item",{"ui-sidebar-item--active":e.active,"ui-sidebar-item--disabled":e.disabled,"ui-sidebar-item--collapsed":o.value}]),s=i.computed(()=>{const l={class:a.value,disabled:e.disabled||void 0,"aria-current":e.active?"page":void 0,"aria-label":o.value?e.label:void 0};return e.href&&(l.href=e.disabled?void 0:e.href,l.target=e.target),e.to&&(l.to=e.disabled?void 0:e.to),l});return(l,r)=>(i.openBlock(),i.createBlock(Fl,{text:t.label,disabled:!o.value,placement:"right"},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),i.normalizeProps(i.guardReactiveProps(s.value)),{default:i.withCtx(()=>[t.icon?(i.openBlock(),i.createElementBlock("span",Dy,[i.createVNode(je,{icon:t.icon,size:"md"},null,8,["icon"])])):i.createCommentVNode("",!0),i.createElementVNode("span",$y,i.toDisplayString(t.label),1),l.$slots.badge?(i.openBlock(),i.createElementBlock("span",Ty,[i.renderSlot(l.$slots,"badge",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3},16))]),_:3},8,["text","disabled"]))}}),[["__scopeId","data-v-07758eb1"]]),Ly=["id"],zy=["aria-labelledby"],Ny=O(i.defineComponent({__name:"SidebarGroup",props:{label:{},showSeparator:{type:Boolean,default:!0}},setup(t){const e=t,n=i.inject(Bi);if(!n)throw new Error("SidebarGroup must be used within SidebarRoot");const o=ye("sidebar-group"),a=i.computed(()=>n.collapsed.value);i.provide(Ol,{groupId:o});const s=i.computed(()=>["ui-sidebar-group",{"ui-sidebar-group--collapsed":a.value,"ui-sidebar-group--separator":e.showSeparator&&a.value}]);return(l,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(s.value)},[t.label?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-sidebar-group__label",id:i.unref(o)},i.toDisplayString(t.label),9,Ly)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"ui-sidebar-group__content","aria-labelledby":t.label?i.unref(o):void 0,role:"group"},[i.renderSlot(l.$slots,"default",{},void 0,!0)],8,zy)],2))}}),[["__scopeId","data-v-de5bdf6e"]]),qt=Symbol("stepper"),Vn=Symbol("stepper-item"),Py=["aria-orientation"],Ay=O(i.defineComponent({__name:"StepperRoot",props:{modelValue:{default:0},orientation:{default:"horizontal"},linear:{type:Boolean,default:!1},errorSteps:{default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(n.modelValue),s=i.ref(0),l=i.ref(new Set);i.watch(()=>n.modelValue,m=>{a.value=m});const r=i.computed(()=>n.modelValue!==void 0),c=i.computed(()=>r.value?n.modelValue:a.value);function d(m){h(m)&&(a.value=m,o("update:modelValue",m))}function u(m){return n.errorSteps.includes(m)?"error":m<c.value?"completed":m===c.value?"current":"pending"}function h(m){return n.linear?m<=c.value+1:!0}function f(m){l.value.add(m),s.value=l.value.size}return i.provide(qt,{orientation:i.toRef(n,"orientation"),linear:i.toRef(n,"linear"),currentStep:c,goToStep:d,getStepState:u,canNavigateTo:h,registerStep:f,stepCount:s}),(m,p)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-stepper",[`ui-stepper--${t.orientation}`]]),role:"tablist","aria-orientation":t.orientation},[i.renderSlot(m.$slots,"default",{},void 0,!0)],10,Py))}}),[["__scopeId","data-v-947638ec"]]),Ry=["data-state"],Oy=O(i.defineComponent({__name:"StepperItem",props:{index:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=i.inject(qt);if(!n)throw new Error("StepperItem must be used within StepperRoot");const o=n,a=ye("stepper-trigger"),s=ye("stepper-content"),l=i.computed(()=>o.getStepState(e.index)),r=i.computed(()=>e.disabled||!o.canNavigateTo(e.index));function c(){r.value||o.goToStep(e.index)}i.onMounted(()=>{o.registerStep(e.index)}),i.provide(Vn,{index:e.index,state:l,isDisabled:r,triggerId:a,contentId:s,goToStep:c});const d=i.computed(()=>["ui-stepper__item",`ui-stepper__item--${o.orientation.value}`,`ui-stepper__item--${l.value}`,{"ui-stepper__item--disabled":r.value}]);return(u,h)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(d.value),"data-state":l.value},[i.renderSlot(u.$slots,"default",{},void 0,!0)],10,Ry))}}),[["__scopeId","data-v-0f21dabd"]]),Fy=["id","aria-selected","aria-controls","aria-disabled","disabled","tabindex"],Wy={class:"ui-stepper__label"},Hy=O(i.defineComponent({__name:"StepperTrigger",props:{icon:{}},setup(t){const e=i.inject(qt),n=i.inject(Vn);if(!e||!n)throw new Error("StepperTrigger must be used within StepperItem");const o=ve("check"),a=i.computed(()=>["ui-stepper__trigger",`ui-stepper__trigger--${n.state.value}`]),s=i.computed(()=>["ui-stepper__indicator",`ui-stepper__indicator--${n.state.value}`]);return(l,r)=>(i.openBlock(),i.createElementBlock("button",{id:i.unref(n).triggerId,class:i.normalizeClass(a.value),type:"button",role:"tab","aria-selected":i.unref(n).state.value==="current","aria-controls":i.unref(n).contentId,"aria-disabled":i.unref(n).isDisabled.value,disabled:i.unref(n).isDisabled.value,tabindex:i.unref(n).state.value==="current"?0:-1,onClick:r[0]||(r[0]=(...c)=>i.unref(n).goToStep&&i.unref(n).goToStep(...c))},[i.createElementVNode("span",{class:i.normalizeClass(s.value)},[i.renderSlot(l.$slots,"indicator",{},()=>[i.unref(n).state.value==="completed"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(o)),{key:0,class:"ui-stepper__check-icon"})):t.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.icon),{key:1,class:"ui-stepper__custom-icon"})):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createTextVNode(i.toDisplayString(i.unref(n).index+1),1)],64))],!0)],2),i.createElementVNode("span",Wy,[i.renderSlot(l.$slots,"default",{},void 0,!0)])],10,Fy))}}),[["__scopeId","data-v-6d18e954"]]),jy=["id","aria-labelledby","aria-hidden"],Yy=O(i.defineComponent({__name:"StepperContent",setup(t){const e=i.inject(qt),n=i.inject(Vn);if(!e||!n)throw new Error("StepperContent must be used within StepperItem");const o=i.computed(()=>n.state.value==="current"),a=i.computed(()=>["ui-stepper__content",`ui-stepper__content--${e.orientation.value}`,{"ui-stepper__content--active":o.value}]);return(s,l)=>i.withDirectives((i.openBlock(),i.createElementBlock("div",{id:i.unref(n).contentId,class:i.normalizeClass(a.value),role:"tabpanel","aria-labelledby":i.unref(n).triggerId,"aria-hidden":!o.value},[i.renderSlot(s.$slots,"default",{},void 0,!0)],10,jy)),[[i.vShow,o.value]])}}),[["__scopeId","data-v-6e79a9a5"]]),Uy=O(i.defineComponent({__name:"StepperSeparator",setup(t){const e=i.inject(qt),n=i.inject(Vn);if(!e||!n)throw new Error("StepperSeparator must be used within StepperItem");const o=i.computed(()=>n.state.value==="completed"),a=i.computed(()=>["ui-stepper__separator",`ui-stepper__separator--${e.orientation.value}`,{"ui-stepper__separator--completed":o.value}]);return(s,l)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(a.value),"aria-hidden":"true"},null,2))}}),[["__scopeId","data-v-b9092a20"]]),Xy=["id","aria-checked","aria-label","disabled"],Ky={class:"ui-switch__track","aria-hidden":"true"},qy={class:"ui-switch__thumb"},Gy=["name","checked","disabled"],Jy=O(i.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean,default:!1},size:{default:"md"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},label:{},name:{},id:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=ye("switch"),s=i.computed(()=>n.id||a),l=i.computed(()=>n.disabled||n.loading);function r(){if(l.value)return;const h=!n.modelValue;o("update:modelValue",h),o("change",h)}function c(h){h.key==="Enter"&&(h.preventDefault(),r())}const d={sm:"0.625rem",md:"0.75rem",lg:"0.875rem"},u=i.computed(()=>d[n.size]);return(h,f)=>(i.openBlock(),i.createElementBlock("button",{id:s.value,type:"button",role:"switch","aria-checked":t.modelValue,"aria-label":t.label,disabled:l.value,class:i.normalizeClass(["ui-switch",[`ui-switch--${t.size}`,{"ui-switch--checked":t.modelValue,"ui-switch--disabled":l.value,"ui-switch--loading":t.loading}]]),onClick:r,onKeydown:c},[i.createElementVNode("span",Ky,[i.createElementVNode("span",qy,[t.loading?(i.openBlock(),i.createBlock(In,{key:0,size:u.value,class:"ui-switch__spinner"},null,8,["size"])):i.createCommentVNode("",!0)])]),t.name?(i.openBlock(),i.createElementBlock("input",{key:0,type:"checkbox",name:t.name,checked:t.modelValue,disabled:t.disabled,class:"ui-switch__input",tabindex:"-1","aria-hidden":"true"},null,8,Gy)):i.createCommentVNode("",!0)],42,Xy))}}),[["__scopeId","data-v-8f7786c9"]]),Zy={class:"ui-tabs"},Qy=["aria-selected","aria-controls","disabled","tabindex","onClick","onKeydown"],ek={class:"ui-tabs__panels"},tk=["id"],nk=O(i.defineComponent({__name:"Tabs",props:{modelValue:{},items:{},variant:{default:"line"},block:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(null),s=i.ref([]),l=i.ref({width:"0px",transform:"translateX(0px)"});let r=null;function c(){const f=n.items.findIndex(b=>b.value===n.modelValue);if(f===-1||!s.value[f])return;const m=s.value[f],p=m.offsetWidth,g=m.offsetLeft;l.value={width:`${p}px`,transform:`translateX(${g}px)`}}function d(f){f.disabled||o("update:modelValue",f.value)}function u(f,m){var C;const p=f.key==="ArrowRight",g=f.key==="ArrowLeft",b=f.key==="Home",_=f.key==="End";if(!p&&!g&&!b&&!_)return;f.preventDefault();let k;if(b)k=n.items.findIndex(y=>!y.disabled);else if(_)k=n.items.length-1-[...n.items].reverse().findIndex(y=>!y.disabled);else{const y=p?1:-1;k=m;do k=(k+y+n.items.length)%n.items.length;while(n.items[k].disabled&&k!==m)}const B=n.items[k];B.disabled||((C=s.value[k])==null||C.focus(),o("update:modelValue",B.value))}function h(f,m){f&&(s.value[m]=f)}return i.watch(()=>n.modelValue,async()=>{await i.nextTick(),c()}),i.onMounted(()=>{c(),r=new ResizeObserver(()=>{c()}),a.value&&r.observe(a.value),window.addEventListener("resize",c)}),i.onBeforeUnmount(()=>{r==null||r.disconnect(),window.removeEventListener("resize",c)}),(f,m)=>(i.openBlock(),i.createElementBlock("div",Zy,[i.createElementVNode("div",{ref_key:"tabListRef",ref:a,class:i.normalizeClass(["ui-tabs__list",[`ui-tabs__list--${t.variant}`,{"ui-tabs__list--block":t.block}]]),role:"tablist"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.items,(p,g)=>(i.openBlock(),i.createElementBlock("button",{key:p.value,ref_for:!0,ref:b=>h(b,g),type:"button",role:"tab",class:i.normalizeClass(["ui-tabs__tab",{"ui-tabs__tab--active":t.modelValue===p.value}]),"aria-selected":t.modelValue===p.value,"aria-controls":`tabpanel-${p.value}`,disabled:p.disabled,tabindex:t.modelValue===p.value?0:-1,onClick:b=>d(p),onKeydown:b=>u(b,g)},[p.icon?(i.openBlock(),i.createBlock(je,{key:0,icon:p.icon,size:"sm",class:"ui-tabs__icon"},null,8,["icon"])):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(p.label),1)],42,Qy))),128)),i.createElementVNode("div",{class:"ui-tabs__indicator",style:i.normalizeStyle(l.value),"aria-hidden":"true"},null,4)],2),i.createElementVNode("div",ek,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.items,p=>i.withDirectives((i.openBlock(),i.createElementBlock("div",{key:p.value,id:`tabpanel-${p.value}`,role:"tabpanel",class:"ui-tabs__panel",tabindex:0},[i.renderSlot(f.$slots,p.value,{},void 0,!0)],8,tk)),[[i.vShow,t.modelValue===p.value]])),128))])]))}}),[["__scopeId","data-v-937bd79d"]]),ik=["for"],ok={key:0,class:"ui-textarea-field__required","aria-hidden":"true"},ak={key:0,class:"ui-textarea-wrapper__addon ui-textarea-wrapper__addon--left"},sk=["id","value","name","placeholder","disabled","readonly","required","rows","maxlength","aria-invalid","aria-describedby"],lk={class:"ui-textarea-field__footer"},rk={class:"ui-textarea-field__messages"},ck=["id"],dk=["id"],uk=["id"],hk=O(i.defineComponent({__name:"Textarea",props:{modelValue:{},label:{},placeholder:{},hint:{},error:{},rows:{default:3},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},autosize:{type:Boolean,default:!1},maxHeight:{},maxLength:{},showCount:{type:Boolean,default:!1},iconLeft:{},id:{},name:{},block:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=i.useSlots(),l=i.ref(null),r=ye("textarea"),c=i.computed(()=>o.id||r),d=i.computed(()=>`${c.value}-hint`),u=i.computed(()=>`${c.value}-error`),h=i.computed(()=>`${c.value}-counter`),f=i.computed(()=>{const S=[];return o.error?S.push(u.value):o.hint&&S.push(d.value),o.showCount&&o.maxLength&&S.push(h.value),S.length>0?S.join(" "):void 0}),m=i.computed(()=>o.iconLeft||s.left),p=i.computed(()=>(o.modelValue??"").length),g=i.computed(()=>o.maxLength?p.value>o.maxLength:!1),b=i.computed(()=>o.maxLength?p.value>=o.maxLength*.9:!1),_=i.computed(()=>o.maxLength?`${p.value} / ${o.maxLength}`:`${p.value}`),k=i.computed(()=>g.value?"error":b.value?"warning":"default");function B(){if(!o.autosize||!l.value)return;const S=l.value;S.style.height="auto";let w=S.scrollHeight;o.maxHeight&&w>o.maxHeight?(w=o.maxHeight,S.style.overflowY="auto"):S.style.overflowY="hidden",S.style.height=`${w}px`}function C(S){const w=S.target;a("update:modelValue",w.value),o.autosize&&B()}function y(S){a("focus",S)}function x(S){a("blur",S)}return i.watch(()=>o.modelValue,()=>{o.autosize&&i.nextTick(B)}),i.onMounted(()=>{o.autosize&&i.nextTick(B)}),e({focus:()=>{var S;return(S=l.value)==null?void 0:S.focus()},blur:()=>{var S;return(S=l.value)==null?void 0:S.blur()},select:()=>{var S;return(S=l.value)==null?void 0:S.select()}}),(S,w)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-textarea-field",{"ui-textarea-field--block":t.block,"ui-textarea-field--disabled":t.disabled,"ui-textarea-field--error":t.error||g.value,"ui-textarea-field--readonly":t.readonly}])},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:c.value,class:"ui-textarea-field__label"},[i.createTextVNode(i.toDisplayString(t.label)+" ",1),t.required?(i.openBlock(),i.createElementBlock("span",ok,"*")):i.createCommentVNode("",!0)],8,ik)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ui-textarea-wrapper",{"ui-textarea-wrapper--disabled":t.disabled,"ui-textarea-wrapper--error":t.error||g.value,"ui-textarea-wrapper--readonly":t.readonly,"ui-textarea-wrapper--has-left":m.value,"ui-textarea-wrapper--autosize":t.autosize}])},[m.value?(i.openBlock(),i.createElementBlock("span",ak,[i.renderSlot(S.$slots,"left",{},()=>[t.iconLeft?(i.openBlock(),i.createBlock(je,{key:0,icon:t.iconLeft,size:"var(--text-md)"},null,8,["icon"])):i.createCommentVNode("",!0)],!0)])):i.createCommentVNode("",!0),i.createElementVNode("textarea",{id:c.value,ref_key:"textareaRef",ref:l,value:t.modelValue,name:t.name,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,required:t.required,rows:t.rows,maxlength:t.maxLength,"aria-invalid":t.error||g.value?"true":void 0,"aria-describedby":f.value,class:i.normalizeClass(["ui-textarea-wrapper__textarea",{"ui-textarea-wrapper__textarea--autosize":t.autosize}]),onInput:C,onFocus:y,onBlur:x},null,42,sk)],2),i.createElementVNode("div",lk,[i.createElementVNode("div",rk,[t.error?(i.openBlock(),i.createElementBlock("p",{key:0,id:u.value,class:"ui-textarea-field__message ui-textarea-field__message--error",role:"alert"},i.toDisplayString(t.error),9,ck)):t.hint?(i.openBlock(),i.createElementBlock("p",{key:1,id:d.value,class:"ui-textarea-field__message ui-textarea-field__message--hint"},i.toDisplayString(t.hint),9,dk)):i.createCommentVNode("",!0)]),t.showCount?(i.openBlock(),i.createElementBlock("span",{key:0,id:h.value,class:i.normalizeClass(["ui-textarea-field__counter",`ui-textarea-field__counter--${k.value}`]),"aria-live":"polite"},i.toDisplayString(_.value),11,uk)):i.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-65afca71"]]),To=Symbol("timeline"),fk=O(i.defineComponent({__name:"Timeline",props:{align:{default:"left"},lineStyle:{default:"solid"}},setup(t){const e=t,n=i.ref(0);let o=0;i.onBeforeUpdate(()=>{o=0});function a(){const l=o++;return n.value=Math.max(n.value,l+1),l}i.provide(To,{align:i.toRef(e,"align"),lineStyle:i.toRef(e,"lineStyle"),registerItem:a,itemCount:n});const s=i.computed(()=>["ui-timeline",`ui-timeline--${e.align}`,`ui-timeline--line-${e.lineStyle}`]);return(l,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(s.value),role:"list"},[i.renderSlot(l.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-23e1c9a4"]]),mk={class:"ui-timeline__content"},pk={key:0,class:"ui-timeline__opposite"},gk=O(i.defineComponent({__name:"TimelineItem",props:{dotColor:{default:"primary"},dotIcon:{}},setup(t){const e=t,n=i.inject(To);if(!n)throw new Error("TimelineItem must be used within Timeline");const o=i.ref(-1);i.onMounted(()=>{o.value=n.registerItem()});const a=i.computed(()=>o.value===0),s=i.computed(()=>o.value===n.itemCount.value-1),l=i.computed(()=>n.align.value==="alternate"?o.value%2===0?"left":"right":n.align.value),r=i.computed(()=>["ui-timeline__item",`ui-timeline__item--${n.align.value}`,`ui-timeline__item--position-${l.value}`,{"ui-timeline__item--first":a.value,"ui-timeline__item--last":s.value}]),c=i.computed(()=>["ui-timeline__dot",`ui-timeline__dot--${e.dotColor}`]);return(d,u)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(r.value),role:"listitem"},[i.createElementVNode("div",{class:i.normalizeClass(c.value)},[i.renderSlot(d.$slots,"dot",{},()=>[t.dotIcon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.dotIcon),{key:0,class:"ui-timeline__dot-icon"})):i.createCommentVNode("",!0)],!0)],2),i.createElementVNode("div",mk,[i.renderSlot(d.$slots,"default",{},void 0,!0)]),i.unref(n).align.value==="alternate"?(i.openBlock(),i.createElementBlock("div",pk,[i.renderSlot(d.$slots,"opposite",{},void 0,!0)])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-276adb4d"]]);function Io(t){if(!t||typeof t!="string")return null;const e=t.toLowerCase().replace(/\s+/g,"").trim();if(!e)return null;const n=/p|pm$/.test(e),o=/a|am$/.test(e),a=e.replace(/[ap]m?$/i,"");let s=0,l=0;if(a.includes(":")){const r=a.split(":");s=parseInt(r[0],10),l=parseInt(r[1],10)||0}else{const r=parseInt(a,10);if(isNaN(r))return null;if(r<=12)s=r,l=0;else if(r<=99)s=Math.floor(r/10),l=r%10*10;else if(r<=2359)s=Math.floor(r/100),l=r%100;else return null}return isNaN(s)||isNaN(l)?null:(n&&s<12?s+=12:o&&s===12&&(s=0),s=Math.max(0,Math.min(23,s)),l=Math.max(0,Math.min(59,l)),{hours:s,minutes:l})}function Lo(t,e,n="24h"){const o=Math.max(0,Math.min(23,t)),a=Math.max(0,Math.min(59,e));if(n==="24h")return`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;const s=o>=12?"PM":"AM";return`${(o===0?12:o>12?o-12:o).toString().padStart(2,"0")}:${a.toString().padStart(2,"0")} ${s}`}function Si(t,e,n=1){const o=[];for(let a=t;a<=e;a+=n)o.push(a);return o}function zo(t){const e=t>=12?"PM":"AM";let n=t%12;return n===0&&(n=12),{hour:n,period:e}}function No(t,e){return e==="AM"?t===12?0:t:t===12?12:t+12}function Wl(t){if(!t||typeof t!="string")return!1;const e=t.match(/^(\d{1,2}):(\d{2})$/);if(!e)return!1;const n=parseInt(e[1],10),o=parseInt(e[2],10);return n>=0&&n<=23&&o>=0&&o<=59}const bk={class:"ui-timepicker__panel"},_k={class:"ui-timepicker__columns"},yk=["data-value","onClick"],kk=["data-value","onClick"],xk=["data-value","onClick"],Po=40,wk=5,Ck=O(i.defineComponent({__name:"TimePicker",props:{modelValue:{},format:{default:"12h"},minuteStep:{default:1},label:{},placeholder:{},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},id:{},name:{},block:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!0}},emits:["update:modelValue","focus","blur"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=ye("timepicker"),l=i.computed(()=>o.id||s),r=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(""),f=i.ref(12),m=i.ref(0),p=i.ref("AM"),g=i.ref(!1),b=i.ref(null),_=ve("calendar"),k=i.computed(()=>o.format==="12h"?Si(1,12):Si(0,23)),B=i.computed(()=>Si(0,59,o.minuteStep)),C=["AM","PM"],y=Po*wk;function x(){if(o.modelValue&&Wl(o.modelValue)){const v=Io(o.modelValue);if(v){if(o.format==="12h"){const D=zo(v.hours);f.value=D.hour,p.value=D.period}else f.value=v.hours;m.value=S(v.minutes),w()}}}function S(v){return B.value.reduce((G,ce)=>Math.abs(ce-v)<Math.abs(G-v)?ce:G)}function w(){const v=o.format==="12h"?No(f.value,p.value):f.value;h.value=Lo(v,m.value,o.format)}function M(){const v=o.format==="12h"?No(f.value,p.value):f.value,D=Lo(v,m.value,"24h");a("update:modelValue",D)}function N(v){const D=String(v);h.value=D;const G=Io(D);if(G){if(o.format==="12h"){const ce=zo(G.hours);f.value=ce.hour,p.value=ce.period}else f.value=G.hours;m.value=S(G.minutes),M(),K()}}function T(v){w(),a("blur",v)}function $(v){a("focus",v)}function K(){i.nextTick(()=>{P(c.value,f.value,k.value),P(d.value,m.value,B.value),o.format==="12h"&&u.value&&P(u.value,p.value,C)})}function P(v,D,G){if(!v)return;const ce=G.indexOf(D);if(ce===-1)return;const ze=ce*Po;v.scrollTop=ze}function A(v,D,G){if(!v)return()=>{};const ce=v.querySelectorAll("[data-value]");if(ce.length===0)return()=>{};const ze=new IntersectionObserver(L=>{if(!g.value){for(const j of L)if(j.isIntersecting&&j.intersectionRatio>=.5){const X=j.target.getAttribute("data-value");if(X!==null){const ne=isNaN(Number(X))?X:Number(X);G(ne)}}}},{root:v,rootMargin:`-${y/2-Po/2}px 0px`,threshold:.5});return ce.forEach(L=>ze.observe(L)),()=>ze.disconnect()}let R=()=>{},q=()=>{},Q=()=>{};function ee(){R(),q(),Q(),R=A(c.value,k.value,v=>{f.value=v,w(),M()}),q=A(d.value,B.value,v=>{m.value=v,w(),M()}),o.format==="12h"&&(Q=A(u.value,C,v=>{p.value=v,w(),M()}))}function ge(){g.value=!0,b.value&&clearTimeout(b.value),b.value=window.setTimeout(()=>{g.value=!1},150)}function fe(v,D){var G;v==="hour"?(f.value=D,P(c.value,D,k.value)):v==="minute"?(m.value=D,P(d.value,D,B.value)):v==="period"&&(p.value=D,P(u.value,D,C)),w(),M(),o.closeOnSelect&&v==="minute"&&((G=r.value)==null||G.close())}function be(){i.nextTick(()=>{K(),ee()})}function xe(){R(),q(),Q()}function F(v){return v.toString().padStart(2,"0")}return i.watch(()=>o.modelValue,()=>{x()},{immediate:!0}),i.onMounted(()=>{x()}),i.onUnmounted(()=>{R(),q(),Q(),b.value&&clearTimeout(b.value)}),e({open:()=>{var v;return(v=r.value)==null?void 0:v.open()},close:()=>{var v;return(v=r.value)==null?void 0:v.close()},toggle:()=>{var v;return(v=r.value)==null?void 0:v.toggle()}}),(v,D)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-timepicker",[`ui-timepicker--${t.size}`,{"ui-timepicker--block":t.block,"ui-timepicker--disabled":t.disabled}]])},[i.createVNode(Ln,{ref_key:"popoverRef",ref:r,placement:"bottom-start",disabled:t.disabled,"close-on-click-outside":!0,"close-on-escape":!0,"trap-focus":!0,onOpen:be,onClose:xe},{trigger:i.withCtx(()=>[i.createVNode(Jt,{id:l.value,modelValue:h.value,"onUpdate:modelValue":[D[0]||(D[0]=G=>h.value=G),N],label:t.label,placeholder:t.placeholder||(t.format==="12h"?"hh:mm AM/PM":"HH:mm"),hint:t.hint,error:t.error,size:t.size,disabled:t.disabled,required:t.required,name:t.name,block:t.block,"icon-right":i.unref(_),autocomplete:"off",onBlur:T,onFocus:$},null,8,["id","modelValue","label","placeholder","hint","error","size","disabled","required","name","block","icon-right"])]),default:i.withCtx(()=>[i.createElementVNode("div",bk,[i.createElementVNode("div",_k,[D[7]||(D[7]=i.createElementVNode("div",{class:"ui-timepicker__highlight"},null,-1)),i.createElementVNode("div",{ref_key:"hourColumnRef",ref:c,class:"ui-timepicker__column",onScroll:ge},[D[1]||(D[1]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(k.value,G=>(i.openBlock(),i.createElementBlock("div",{key:G,"data-value":G,class:i.normalizeClass(["ui-timepicker__item",{"ui-timepicker__item--selected":G===f.value}]),onClick:ce=>fe("hour",G)},i.toDisplayString(F(G)),11,yk))),128)),D[2]||(D[2]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1))],544),D[8]||(D[8]=i.createElementVNode("div",{class:"ui-timepicker__separator"},":",-1)),i.createElementVNode("div",{ref_key:"minuteColumnRef",ref:d,class:"ui-timepicker__column",onScroll:ge},[D[3]||(D[3]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(B.value,G=>(i.openBlock(),i.createElementBlock("div",{key:G,"data-value":G,class:i.normalizeClass(["ui-timepicker__item",{"ui-timepicker__item--selected":G===m.value}]),onClick:ce=>fe("minute",G)},i.toDisplayString(F(G)),11,kk))),128)),D[4]||(D[4]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1))],544),t.format==="12h"?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"periodColumnRef",ref:u,class:"ui-timepicker__column ui-timepicker__column--period",onScroll:ge},[D[5]||(D[5]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1)),(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(C,G=>i.createElementVNode("div",{key:G,"data-value":G,class:i.normalizeClass(["ui-timepicker__item",{"ui-timepicker__item--selected":G===p.value}]),onClick:ce=>fe("period",G)},i.toDisplayString(G),11,xk)),64)),D[6]||(D[6]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1))],544)):i.createCommentVNode("",!0)])])]),_:1},8,["disabled"])],2))}}),[["__scopeId","data-v-7c4d962e"]]),Bk=["aria-pressed","aria-label","disabled"],Sk={key:1,class:"ui-toggle-button__label"},Ek=O(i.defineComponent({__name:"ToggleButton",props:{modelValue:{type:Boolean},value:{},size:{default:"md"},disabled:{type:Boolean,default:!1},icon:{},label:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=i.inject("toggleGroup",null),s=i.computed(()=>a!==null&&n.value!==void 0),l=i.computed(()=>(a==null?void 0:a.size)||n.size),r=i.computed(()=>n.disabled||(a==null?void 0:a.disabled)),c=i.computed(()=>{if(s.value&&a&&n.value!==void 0){const h=a.modelValue.value;return Array.isArray(h)?h.includes(n.value):h===n.value}return n.modelValue??!1});function d(){if(!r.value)if(s.value&&a&&n.value!==void 0)a.toggle(n.value);else{const h=!n.modelValue;o("update:modelValue",h),o("change",h)}}const u=i.computed(()=>n.icon&&!n.label);return(h,f)=>(i.openBlock(),i.createElementBlock("button",{type:"button","aria-pressed":c.value,"aria-label":u.value?t.label:void 0,disabled:r.value,class:i.normalizeClass(["ui-toggle-button",[`ui-toggle-button--${l.value}`,{"ui-toggle-button--pressed":c.value,"ui-toggle-button--disabled":r.value,"ui-toggle-button--icon-only":u.value}]]),onClick:d},[t.icon?(i.openBlock(),i.createBlock(je,{key:0,icon:t.icon,class:"ui-toggle-button__icon"},null,8,["icon"])):i.createCommentVNode("",!0),t.label&&!u.value?(i.openBlock(),i.createElementBlock("span",Sk,i.toDisplayString(t.label),1)):i.createCommentVNode("",!0),!t.icon&&!t.label?i.renderSlot(h.$slots,"default",{key:2},void 0,!0):i.createCommentVNode("",!0)],10,Bk))}}),[["__scopeId","data-v-1f682975"]]),Mk=["role","aria-label","aria-orientation","aria-disabled"],vk=O(i.defineComponent({__name:"ToggleGroup",props:{modelValue:{},type:{default:"single"},size:{default:"md"},disabled:{type:Boolean,default:!1},label:{},orientation:{default:"horizontal"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e;function a(l){if(n.type==="single"){const r=n.modelValue===l?void 0:l;o("update:modelValue",r),o("change",r)}else{const r=Array.isArray(n.modelValue)?n.modelValue:[],c=r.includes(l)?r.filter(d=>d!==l):[...r,l];o("update:modelValue",c),o("change",c)}}i.provide("toggleGroup",{modelValue:i.toRef(n,"modelValue"),toggle:a,type:n.type,size:n.size,disabled:n.disabled});const s=i.computed(()=>n.type==="single"?"radiogroup":"group");return(l,r)=>(i.openBlock(),i.createElementBlock("div",{role:s.value,"aria-label":t.label,"aria-orientation":t.orientation,"aria-disabled":t.disabled||void 0,class:i.normalizeClass(["ui-toggle-group",[`ui-toggle-group--${t.orientation}`,{"ui-toggle-group--disabled":t.disabled}]])},[i.renderSlot(l.$slots,"default")],10,Mk))}}),[["__scopeId","data-v-aa1233fc"]]),Vk=5,Dk=5e3,$k=8e3;let Tk=0;function Ik(){return`toast-${++Tk}-${Date.now().toString(36)}`}const St=i.reactive({toasts:[]});function Dn(t){const e=Ik(),n=t.action?$k:Dk,o={id:e,title:t.title,message:t.message,variant:t.variant,duration:t.duration??n,createdAt:Date.now(),action:t.action,onClick:t.onClick,avatar:t.avatar};for(St.toasts.push(o);St.toasts.length>Vk;)St.toasts.shift();return e}function Lk(t){const e=St.toasts.findIndex(n=>n.id===t);e!==-1&&St.toasts.splice(e,1)}function zk(){St.toasts.splice(0,St.toasts.length)}function Nk(t,e){return Dn({...e,title:t,variant:"success"})}function Pk(t,e){return Dn({...e,title:t,variant:"error"})}function Ak(t,e){return Dn({...e,title:t,variant:"warning"})}function Rk(t,e){return Dn({...e,title:t,variant:"info"})}const Ok=i.readonly(St).toasts,Ot={add:Dn,remove:Lk,clear:zk,success:Nk,error:Pk,warning:Ak,info:Rk},Fk=["role","aria-live"],Wk={key:0,class:"ui-toast__avatar"},Hk={key:1,class:"ui-toast__icon","aria-hidden":"true"},jk={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Yk=["d"],Uk={class:"ui-toast__content"},Xk={key:0,class:"ui-toast__title"},Kk={key:1,class:"ui-toast__message"},Hl=O(i.defineComponent({__name:"ToastItem",props:{toast:{}},emits:["dismiss"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(!1),s=i.ref(n.toast.duration);let l=null,r=0;const c=i.computed(()=>!!n.toast.onClick),d=i.computed(()=>!!n.toast.avatar),u=i.computed(()=>n.toast.variant==="error"?"alert":"status"),h=i.computed(()=>n.toast.variant==="error"?"assertive":"polite");function f(){n.toast.duration<=0||s.value<=0||(r=Date.now(),l=setTimeout(()=>{o("dismiss",n.toast.id)},s.value))}function m(){if(l){clearTimeout(l),l=null;const C=Date.now()-r;s.value=Math.max(0,s.value-C)}}function p(){a.value=!0,m()}function g(){a.value=!1,f()}function b(C){C.stopPropagation(),o("dismiss",n.toast.id)}function _(){n.toast.onClick&&(n.toast.onClick(),o("dismiss",n.toast.id))}function k(C){C.stopPropagation(),n.toast.action&&(n.toast.action.onClick(),o("dismiss",n.toast.id))}i.onMounted(()=>{f()}),i.onUnmounted(()=>{l&&clearTimeout(l)});const B={success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"};return(C,y)=>{var x,S;return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-toast",[`ui-toast--${t.toast.variant}`,{"ui-toast--clickable":c.value}]]),role:u.value,"aria-live":h.value,onMouseenter:p,onMouseleave:g,onClick:_},[d.value?(i.openBlock(),i.createElementBlock("div",Wk,[i.createVNode(Yo,{src:(x=t.toast.avatar)==null?void 0:x.src,name:(S=t.toast.avatar)==null?void 0:S.name,size:"sm"},null,8,["src","name"])])):(i.openBlock(),i.createElementBlock("div",Hk,[(i.openBlock(),i.createElementBlock("svg",jk,[i.createElementVNode("path",{d:B[t.toast.variant]},null,8,Yk)]))])),i.createElementVNode("div",Uk,[t.toast.title?(i.openBlock(),i.createElementBlock("div",Xk,i.toDisplayString(t.toast.title),1)):i.createCommentVNode("",!0),t.toast.message?(i.openBlock(),i.createElementBlock("div",Kk,i.toDisplayString(t.toast.message),1)):i.createCommentVNode("",!0),t.toast.action?(i.openBlock(),i.createElementBlock("button",{key:2,type:"button",class:"ui-toast__action",onClick:k},i.toDisplayString(t.toast.action.label),1)):i.createCommentVNode("",!0)]),i.createElementVNode("button",{type:"button",class:"ui-toast__close","aria-label":"Dismiss notification",onClick:b},[...y[0]||(y[0]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12"})],-1)])]),t.toast.duration>0?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["ui-toast__progress",{"ui-toast__progress--paused":a.value}]),style:i.normalizeStyle({"--toast-duration":`${t.toast.duration}ms`})},null,6)):i.createCommentVNode("",!0)],42,Fk)}}}),[["__scopeId","data-v-4a2866d8"]]),qk=O(i.defineComponent({__name:"ToastProvider",props:{position:{default:"top-right"}},setup(t){function e(n){Ot.remove(n)}return(n,o)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createElementVNode("div",{class:i.normalizeClass(["ui-toast-provider",[`ui-toast-provider--${t.position}`]]),role:"region","aria-label":"Notifications"},[i.createVNode(i.TransitionGroup,{name:"toast"},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Ok),a=>(i.openBlock(),i.createBlock(Hl,{key:a.id,toast:a,onDismiss:e},null,8,["toast"]))),128))]),_:1})],2)]))}}),[["__scopeId","data-v-69fc4e70"]]);function Gk(){return{success:Ot.success,error:Ot.error,warning:Ot.warning,info:Ot.info,dismiss:Ot.remove,clear:Ot.clear}}const Ao=Symbol("treeview"),Ei=Symbol("treeview-item"),Jk=["aria-multiselectable"],Zk=O(i.defineComponent({__name:"TreeView",props:{data:{},modelValue:{},expandedIds:{default:()=>[]},multiSelect:{type:Boolean,default:!1},loadChildren:{}},emits:["update:modelValue","update:expandedIds"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(new Set),s=i.ref(new Set(n.expandedIds)),l=i.ref(null),r=i.ref(new Set),c=i.ref(new Map),d=i.ref(new Map);i.watch(()=>n.modelValue,y=>{y===void 0?a.value=new Set:Array.isArray(y)?a.value=new Set(y):a.value=new Set([y])},{immediate:!0}),i.watch(()=>n.expandedIds,y=>{s.value=new Set(y)},{immediate:!0});const u=i.computed(()=>a.value),h=i.computed(()=>s.value);function f(y){if(n.multiSelect){const x=new Set(a.value);x.has(y)?x.delete(y):x.add(y),a.value=x,o("update:modelValue",Array.from(x))}else a.value.has(y)?(a.value=new Set,o("update:modelValue",void 0)):(a.value=new Set([y]),o("update:modelValue",y))}function m(y){const x=new Set(s.value);x.has(y)?x.delete(y):x.add(y),s.value=x,o("update:expandedIds",Array.from(x))}function p(y){l.value=y}function g(y,x,S){c.value.set(y,{parentId:x,hasChildren:S}),d.value.has(x)||d.value.set(x,[]);const w=d.value.get(x);w.includes(y)||w.push(y)}function b(y){var x;return((x=c.value.get(y))==null?void 0:x.parentId)??null}function _(y){return d.value.get(y)??[]}function k(y){var x;return((x=c.value.get(y))==null?void 0:x.hasChildren)??!1}function B(){const y=[];function x(S,w){for(const M of S)y.push(M.id),M.children&&h.value.has(M.id)&&x(M.children)}return x(n.data),y}function C(y){const x=B(),S=l.value?x.indexOf(l.value):-1;switch(y.key){case"ArrowDown":{y.preventDefault();const w=S<x.length-1?S+1:0;l.value=x[w];break}case"ArrowUp":{y.preventDefault();const w=S>0?S-1:x.length-1;l.value=x[w];break}case"ArrowRight":{if(y.preventDefault(),l.value&&k(l.value))if(!h.value.has(l.value))m(l.value);else{const w=_(l.value);w.length>0&&(l.value=w[0])}break}case"ArrowLeft":{if(y.preventDefault(),l.value)if(h.value.has(l.value))m(l.value);else{const w=b(l.value);w&&(l.value=w)}break}case"Home":{y.preventDefault(),x.length>0&&(l.value=x[0]);break}case"End":{y.preventDefault(),x.length>0&&(l.value=x[x.length-1]);break}case"Enter":case" ":{y.preventDefault(),l.value&&f(l.value);break}}}return i.provide(Ao,{selectedIds:u,expandedIds:h,focusedId:l,multiSelect:i.toRef(n,"multiSelect"),selectNode:f,toggleExpand:m,setFocusedId:p,loadChildren:n.loadChildren??null,loadingIds:r,registerNode:g,getVisibleNodes:B,getParentId:b,getChildIds:_,hasChildren:k}),i.provide(Ei,{depth:0,parentId:null}),(y,x)=>(i.openBlock(),i.createElementBlock("div",{class:"ui-treeview",role:"tree","aria-multiselectable":t.multiSelect,tabindex:"0",onKeydown:C,onFocus:x[0]||(x[0]=()=>{!l.value&&t.data.length>0&&(l.value=t.data[0].id)})},[i.renderSlot(y.$slots,"default",{},void 0,!0)],40,Jk))}}),[["__scopeId","data-v-1a85f707"]]),Qk=["aria-selected","aria-expanded","aria-disabled","data-focused"],e0=["aria-label"],t0={key:1,class:"ui-treeview__chevron-placeholder"},n0={key:2,class:"ui-treeview__spinner"},i0={class:"ui-treeview__label"},o0={key:0,class:"ui-treeview__children",role:"group"},a0=O(i.defineComponent({__name:"TreeViewItem",props:{node:{}},setup(t){const e=t,n=i.inject(Ao),o=i.inject(Ei);if(!n||!o)throw new Error("TreeViewItem must be used within TreeView");const a=n,s=o,l=s.depth,r=s.parentId,c=ve("expand"),d=ve("collapse"),u=i.ref(e.node.children),h=i.computed(()=>a.loadingIds.value.has(e.node.id)),f=i.computed(()=>a.selectedIds.value.has(e.node.id)),m=i.computed(()=>a.expandedIds.value.has(e.node.id)),p=i.computed(()=>a.focusedId.value===e.node.id),g=i.computed(()=>e.node.isLeaf?!1:!!(u.value&&u.value.length>0||a.loadChildren&&!e.node.isLeaf));i.onMounted(()=>{a.registerNode(e.node.id,r,g.value)}),i.watch(g,x=>{a.registerNode(e.node.id,r,x)});async function b(){var x;if(g.value){if(!m.value&&a.loadChildren&&!((x=u.value)!=null&&x.length)){a.loadingIds.value.add(e.node.id);try{u.value=await a.loadChildren(e.node)}finally{a.loadingIds.value.delete(e.node.id)}}a.toggleExpand(e.node.id)}}function _(){e.node.disabled||a.selectNode(e.node.id)}function k(){a.setFocusedId(e.node.id),_()}function B(x){x.stopPropagation(),a.setFocusedId(e.node.id),b()}i.provide(Ei,{depth:l+1,parentId:e.node.id});const C=i.computed(()=>["ui-treeview__item",{"ui-treeview__item--selected":f.value,"ui-treeview__item--focused":p.value,"ui-treeview__item--disabled":e.node.disabled,"ui-treeview__item--loading":h.value}]),y=i.computed(()=>({paddingLeft:`calc(var(--tree-indent) * ${l})`}));return(x,S)=>{const w=i.resolveComponent("TreeViewItem",!0);return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(C.value),role:"treeitem","aria-selected":f.value,"aria-expanded":g.value?m.value:void 0,"aria-disabled":t.node.disabled,"data-focused":p.value},[i.createElementVNode("div",{class:"ui-treeview__content",style:i.normalizeStyle(y.value),onClick:k},[g.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["ui-treeview__chevron",{"ui-treeview__chevron--expanded":m.value}]),type:"button",tabindex:"-1","aria-label":m.value?"Collapse":"Expand",onClick:B},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(m.value?i.unref(d):i.unref(c)),{class:"ui-treeview__chevron-icon"}))],10,e0)):(i.openBlock(),i.createElementBlock("span",t0)),h.value?(i.openBlock(),i.createElementBlock("span",n0)):i.createCommentVNode("",!0),t.node.icon&&!h.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.node.icon),{key:3,class:"ui-treeview__icon"})):i.createCommentVNode("",!0),i.createElementVNode("span",i0,[i.renderSlot(x.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(t.node.label),1)],!0)])],4),i.createVNode(i.Transition,{name:"ui-treeview-expand"},{default:i.withCtx(()=>[g.value&&m.value&&u.value?(i.openBlock(),i.createElementBlock("div",o0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.value,M=>(i.openBlock(),i.createBlock(w,{key:M.id,node:M},null,8,["node"]))),128))])):i.createCommentVNode("",!0)]),_:1})],10,Qk)}}}),[["__scopeId","data-v-b483e83c"]]),s0=O(i.defineComponent({__name:"Container",props:{fluid:{type:Boolean,default:!1},centered:{type:Boolean,default:!0},as:{default:"div"}},setup(t){const e=t,n=i.computed(()=>["ui-container",{"ui-container--fluid":e.fluid,"ui-container--centered":e.centered}]);return(o,a)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(n.value)},{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-2f68ccaa"]]),l0=O(i.defineComponent({__name:"Stack",props:{direction:{default:"column"},gap:{default:0},align:{default:"stretch"},justify:{default:"start"},wrap:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},as:{default:"div"}},setup(t){const e=t,n=i.computed(()=>["ui-stack",`ui-stack--${e.direction}`,`ui-stack--align-${e.align}`,`ui-stack--justify-${e.justify}`,{"ui-stack--wrap":e.wrap,"ui-stack--inline":e.inline}]),o=i.computed(()=>({"--stack-gap":`var(--space-${e.gap})`}));return(a,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(n.value),style:i.normalizeStyle(o.value)},{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-3d1c3188"]]),r0=Symbol("Grid"),c0=O(i.defineComponent({__name:"Grid",props:{columns:{default:1},gap:{default:4},gapX:{},gapY:{},as:{default:"div"}},setup(t){const e=t,n=i.computed(()=>typeof e.columns=="object"),o=i.computed(()=>{const s=["ui-grid"];if(n.value){const l=e.columns;l.default&&s.push(`ui-grid--cols-${l.default}`),l.sm&&s.push(`ui-grid--cols-sm-${l.sm}`),l.md&&s.push(`ui-grid--cols-md-${l.md}`),l.lg&&s.push(`ui-grid--cols-lg-${l.lg}`),l.xl&&s.push(`ui-grid--cols-xl-${l.xl}`)}else s.push(`ui-grid--cols-${e.columns}`);return s}),a=i.computed(()=>{const s={"--grid-gap":`var(--space-${e.gap})`};return e.gapX!==void 0&&(s["--grid-gap-x"]=`var(--space-${e.gapX})`),e.gapY!==void 0&&(s["--grid-gap-y"]=`var(--space-${e.gapY})`),s});return i.provide(r0,{gap:i.toRef(e,"gap")}),(s,l)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(o.value),style:i.normalizeStyle(a.value)},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-f4881c4d"]]),d0=O(i.defineComponent({__name:"GridItem",props:{span:{default:1},start:{},end:{},rowSpan:{},as:{default:"div"}},setup(t){const e=t,n=i.computed(()=>typeof e.span=="object"),o=i.computed(()=>{const s=["ui-grid-item"];if(n.value){const l=e.span;l.default&&s.push(`ui-grid-item--span-${l.default}`),l.sm&&s.push(`ui-grid-item--span-sm-${l.sm}`),l.md&&s.push(`ui-grid-item--span-md-${l.md}`),l.lg&&s.push(`ui-grid-item--span-lg-${l.lg}`),l.xl&&s.push(`ui-grid-item--span-xl-${l.xl}`)}else s.push(`ui-grid-item--span-${e.span}`);return s}),a=i.computed(()=>{const s={};return e.start!==void 0&&(s["grid-column-start"]=e.start),e.end!==void 0&&(s["grid-column-end"]=e.end),e.rowSpan!==void 0&&(s["grid-row"]=`span ${e.rowSpan} / span ${e.rowSpan}`),s});return(s,l)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(o.value),style:i.normalizeStyle(a.value)},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-835ed31a"]]);E.AccordionContent=yr,E.AccordionItem=cr,E.AccordionRoot=Gl,E.AccordionTrigger=mr,E.Avatar=Yo,E.Badge=Sr,E.BadgeContainer=Mr,E.BarChart=Pp,E.BaseChart=ki,E.BreadcrumbEllipsis=hc,E.BreadcrumbItem=Pr,E.BreadcrumbLink=Ar,E.BreadcrumbList=Ir,E.BreadcrumbPage=Wr,E.BreadcrumbRoot=Vr,E.BreadcrumbSeparator=jr,E.Button=Je,E.Callout=Vc,E.Card=$c,E.CardContent=Pc,E.CardFooter=Ac,E.CardHeader=Nc,E.CardImage=Oc,E.Checkbox=Vi,E.ChoiceChip=h_,E.ChoiceChipGroup=m_,E.ColorArea=ia,E.ColorPicker=md,E.ColorSlider=zi,E.Combobox=c_,E.Container=s0,E.DataTable=Xg,E.DatePicker=Rb,E.DonutChart=Kp,E.Drawer=Yb,E.Dropdown=Xo,E.DropdownItem=Ko,E.DropdownSeparator=nc,E.DropdownSub=oc,E.DropdownSubContent=cc,E.DropdownSubTrigger=rc,E.EmptyState=El,E.FileUpload=R_,E.Grid=c0,E.GridItem=d0,E.Heading=O_,E.Icon=je,E.Input=Jt,E.LineChart=Ip,E.Modal=U_,E.Pagination=vl,E.Popover=Ln,E.Progress=Q_,E.Radio=sy,E.Rating=cy,E.SegmentedControl=fy,E.Select=Vl,E.SidebarGroup=Ny,E.SidebarGroupKey=Ol,E.SidebarItem=Iy,E.SidebarKey=Bi,E.SidebarLayout=Cy,E.SidebarRoot=My,E.Skeleton=wi,E.Slider=xy,E.Spinner=In,E.SpireProvider=ar,E.Stack=l0,E.StepperContent=Yy,E.StepperItem=Oy,E.StepperItemKey=Vn,E.StepperKey=qt,E.StepperRoot=Ay,E.StepperSeparator=Uy,E.StepperTrigger=Hy,E.Switch=Jy,E.Tabs=nk,E.Text=vo,E.Textarea=hk,E.TimePicker=Ck,E.Timeline=fk,E.TimelineItem=gk,E.TimelineKey=To,E.ToastItem=Hl,E.ToastProvider=qk,E.ToggleButton=Ek,E.ToggleGroup=vk,E.Tooltip=Fl,E.TreeView=Zk,E.TreeViewItem=a0,E.TreeViewItemKey=Ei,E.TreeViewKey=Ao,E.configureIcons=Gp,E.formatColor=Li,E.formatDate=Bt,E.formatOklch=na,E.formatRgb=Ii,E.formatTime=Lo,E.generateCalendarGrid=$l,E.generatePageRange=Ml,E.generateRange=Si,E.generateYearGrid=Pl,E.getDaysInMonth=Kg,E.getInitials=jo,E.getMonthName=Ll,E.getMonthNamesShort=Nl,E.getNestedValue=Dl,E.getPresetRange=Gg,E.getRangeClass=Vo,E.getStaggerStyle=lr,E.getWeekdayNames=zl,E.hexToHsv=Di,E.hexToRgb=Go,E.hsvToHex=Nn,E.hsvToOklch=ea,E.hsvToRgb=Zt,E.isDateAfter=Il,E.isDateBefore=Tl,E.isDateBetween=qg,E.isDateInRange=Ci,E.isSameDate=mt,E.isValidTimeString=Wl,E.normalizeRange=Do,E.oklchToHsv=ta,E.oklchToRgb=Zo,E.parseColorString=Qt,E.parseDate=ft,E.parseTime=Io,E.resetIcons=Jp,E.rgbToHex=Jo,E.rgbToHsv=zn,E.rgbToOklch=Qo,E.spireConfigKey=Ho,E.to12Hour=zo,E.to24Hour=No,E.useChartTheme=Mn,E.useClickOutside=Jl,E.useClipboard=Zl,E.useEventListener=Ql,E.useFocusTrap=er,E.useHoverReveal=tr,E.useId=ye,E.useMagnetic=ir,E.useRelativePosition=Wo,E.useRipple=or,E.useScrollLock=Tn,E.useStagger=sr,E.useToast=Gk,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}));
45
+ `):t}function Ym(t,e){const{element:n,datasetIndex:o,index:a}=e,s=t.getDatasetMeta(o).controller,{label:l,value:r}=s.getLabelAndValue(a);return{chart:t,label:l,parsed:s.getParsed(a),raw:t.data.datasets[o].data[a],formattedValue:r,dataset:s.getDataset(),dataIndex:a,datasetIndex:o,element:n}}function sl(t,e){const n=t.chart.ctx,{body:o,footer:a,title:s}=t,{boxWidth:l,boxHeight:r}=e,c=$e(e.bodyFont),d=$e(e.titleFont),u=$e(e.footerFont),h=s.length,f=a.length,m=o.length,p=We(e.padding);let g=p.height,b=0,_=o.reduce((C,y)=>C+y.before.length+y.lines.length+y.after.length,0);if(_+=t.beforeBody.length+t.afterBody.length,h&&(g+=h*d.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),_){const C=e.displayColors?Math.max(r,c.lineHeight):c.lineHeight;g+=m*C+(_-m)*c.lineHeight+(_-1)*e.bodySpacing}f&&(g+=e.footerMarginTop+f*u.lineHeight+(f-1)*e.footerSpacing);let k=0;const B=function(C){b=Math.max(b,n.measureText(C).width+k)};return n.save(),n.font=d.string,pe(t.title,B),n.font=c.string,pe(t.beforeBody.concat(t.afterBody),B),k=e.displayColors?l+2+e.boxPadding:0,pe(o,C=>{pe(C.before,B),pe(C.lines,B),pe(C.after,B)}),k=0,n.font=u.string,pe(t.footer,B),n.restore(),b+=p.width,{width:b,height:g}}function Um(t,e){const{y:n,height:o}=e;return n<o/2?"top":n>t.height-o/2?"bottom":"center"}function Xm(t,e,n,o){const{x:a,width:s}=o,l=n.caretSize+n.caretPadding;if(t==="left"&&a+s+l>e.width||t==="right"&&a-s-l<0)return!0}function Km(t,e,n,o){const{x:a,width:s}=n,{width:l,chartArea:{left:r,right:c}}=t;let d="center";return o==="center"?d=a<=(r+c)/2?"left":"right":a<=s/2?d="left":a>=l-s/2&&(d="right"),Xm(d,t,e,n)&&(d="center"),d}function ll(t,e,n){const o=n.yAlign||e.yAlign||Um(t,n);return{xAlign:n.xAlign||e.xAlign||Km(t,e,n,o),yAlign:o}}function qm(t,e){let{x:n,width:o}=t;return e==="right"?n-=o:e==="center"&&(n-=o/2),n}function Gm(t,e,n){let{y:o,height:a}=t;return e==="top"?o+=n:e==="bottom"?o-=a+n:o-=a/2,o}function rl(t,e,n,o){const{caretSize:a,caretPadding:s,cornerRadius:l}=t,{xAlign:r,yAlign:c}=n,d=a+s,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=$t(l);let p=qm(e,r);const g=Gm(e,c,d);return c==="center"?r==="left"?p+=d:r==="right"&&(p-=d):r==="left"?p-=Math.max(u,f)+a:r==="right"&&(p+=Math.max(h,m)+a),{x:Ie(p,0,o.width-e.width),y:Ie(g,0,o.height-e.height)}}function gi(t,e,n){const o=We(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-o.right:t.x+o.left}function cl(t){return ot([],ht(t))}function Jm(t,e,n){return kt(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function dl(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const ul={beforeTitle:st,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,o=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(o>0&&e.dataIndex<o)return n[e.dataIndex]}return""},afterTitle:st,beforeBody:st,beforeLabel:st,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return ae(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:st,afterBody:st,beforeFooter:st,footer:st,afterFooter:st};function Xe(t,e,n,o){const a=t[e].call(n,o);return typeof a>"u"?ul[e].call(n,o):a}let hl=(Ro=class extends et{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,o=this.options.setContext(this.getContext()),a=o.enabled&&n.options.animation&&o.animations,s=new ts(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Jm(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:o}=n,a=Xe(o,"beforeTitle",this,e),s=Xe(o,"title",this,e),l=Xe(o,"afterTitle",this,e);let r=[];return r=ot(r,ht(a)),r=ot(r,ht(s)),r=ot(r,ht(l)),r}getBeforeBody(e,n){return cl(Xe(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:o}=n,a=[];return pe(e,s=>{const l={before:[],lines:[],after:[]},r=dl(o,s);ot(l.before,ht(Xe(r,"beforeLabel",this,s))),ot(l.lines,Xe(r,"label",this,s)),ot(l.after,ht(Xe(r,"afterLabel",this,s))),a.push(l)}),a}getAfterBody(e,n){return cl(Xe(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:o}=n,a=Xe(o,"beforeFooter",this,e),s=Xe(o,"footer",this,e),l=Xe(o,"afterFooter",this,e);let r=[];return r=ot(r,ht(a)),r=ot(r,ht(s)),r=ot(r,ht(l)),r}_createItems(e){const n=this._active,o=this.chart.data,a=[],s=[],l=[];let r=[],c,d;for(c=0,d=n.length;c<d;++c)r.push(Ym(this.chart,n[c]));return e.filter&&(r=r.filter((u,h,f)=>e.filter(u,h,f,o))),e.itemSort&&(r=r.sort((u,h)=>e.itemSort(u,h,o))),pe(r,u=>{const h=dl(e.callbacks,u);a.push(Xe(h,"labelColor",this,u)),s.push(Xe(h,"labelPointStyle",this,u)),l.push(Xe(h,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=l,this.dataPoints=r,r}update(e,n){const o=this.options.setContext(this.getContext()),a=this._active;let s,l=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const r=Cn[o.position].call(this,a,this._eventPosition);l=this._createItems(o),this.title=this.getTitle(l,o),this.beforeBody=this.getBeforeBody(l,o),this.body=this.getBody(l,o),this.afterBody=this.getAfterBody(l,o),this.footer=this.getFooter(l,o);const c=this._size=sl(this,o),d=Object.assign({},r,c),u=ll(this.chart,o,d),h=rl(o,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:r.x,caretY:r.y}}this._tooltipItems=l,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&o.external&&o.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,o,a){const s=this.getCaretPosition(e,o,a);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(e,n,o){const{xAlign:a,yAlign:s}=this,{caretSize:l,cornerRadius:r}=o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:h}=$t(r),{x:f,y:m}=e,{width:p,height:g}=n;let b,_,k,B,C,y;return s==="center"?(C=m+g/2,a==="left"?(b=f,_=b-l,B=C+l,y=C-l):(b=f+p,_=b+l,B=C-l,y=C+l),k=b):(a==="left"?_=f+Math.max(c,u)+l:a==="right"?_=f+p-Math.max(d,h)-l:_=this.caretX,s==="top"?(B=m,C=B-l,b=_-l,k=_+l):(B=m+g,C=B+l,b=_+l,k=_-l),y=B),{x1:b,x2:_,x3:k,y1:B,y2:C,y3:y}}drawTitle(e,n,o){const a=this.title,s=a.length;let l,r,c;if(s){const d=Xt(o.rtl,this.x,this.width);for(e.x=gi(this,o.titleAlign,o),n.textAlign=d.textAlign(o.titleAlign),n.textBaseline="middle",l=$e(o.titleFont),r=o.titleSpacing,n.fillStyle=o.titleColor,n.font=l.string,c=0;c<s;++c)n.fillText(a[c],d.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+r,c+1===s&&(e.y+=o.titleMarginBottom-r)}}_drawColorBox(e,n,o,a,s){const l=this.labelColors[o],r=this.labelPointStyles[o],{boxHeight:c,boxWidth:d}=s,u=$e(s.bodyFont),h=gi(this,"left",s),f=a.x(h),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+m;if(s.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=a.leftForLtr(f,d)+d/2,_=p+c/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Gi(e,g,b,_),e.strokeStyle=l.borderColor,e.fillStyle=l.backgroundColor,Gi(e,g,b,_)}else{e.lineWidth=se(l.borderWidth)?Math.max(...Object.values(l.borderWidth)):l.borderWidth||1,e.strokeStyle=l.borderColor,e.setLineDash(l.borderDash||[]),e.lineDashOffset=l.borderDashOffset||0;const g=a.leftForLtr(f,d),b=a.leftForLtr(a.xPlus(f,1),d-2),_=$t(l.borderRadius);Object.values(_).some(k=>k!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,hn(e,{x:g,y:p,w:d,h:c,radius:_}),e.fill(),e.stroke(),e.fillStyle=l.backgroundColor,e.beginPath(),hn(e,{x:b,y:p+1,w:d-2,h:c-2,radius:_}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(g,p,d,c),e.strokeRect(g,p,d,c),e.fillStyle=l.backgroundColor,e.fillRect(b,p+1,d-2,c-2))}e.fillStyle=this.labelTextColors[o]}drawBody(e,n,o){const{body:a}=this,{bodySpacing:s,bodyAlign:l,displayColors:r,boxHeight:c,boxWidth:d,boxPadding:u}=o,h=$e(o.bodyFont);let f=h.lineHeight,m=0;const p=Xt(o.rtl,this.x,this.width),g=function(w){n.fillText(w,p.x(e.x+m),e.y+f/2),e.y+=f+s},b=p.textAlign(l);let _,k,B,C,y,x,S;for(n.textAlign=l,n.textBaseline="middle",n.font=h.string,e.x=gi(this,b,o),n.fillStyle=o.bodyColor,pe(this.beforeBody,g),m=r&&b!=="right"?l==="center"?d/2+u:d+2+u:0,C=0,x=a.length;C<x;++C){for(_=a[C],k=this.labelTextColors[C],n.fillStyle=k,pe(_.before,g),B=_.lines,r&&B.length&&(this._drawColorBox(n,e,C,p,o),f=Math.max(h.lineHeight,c)),y=0,S=B.length;y<S;++y)g(B[y]),f=h.lineHeight;pe(_.after,g)}m=0,f=h.lineHeight,pe(this.afterBody,g),e.y-=s}drawFooter(e,n,o){const a=this.footer,s=a.length;let l,r;if(s){const c=Xt(o.rtl,this.x,this.width);for(e.x=gi(this,o.footerAlign,o),e.y+=o.footerMarginTop,n.textAlign=c.textAlign(o.footerAlign),n.textBaseline="middle",l=$e(o.footerFont),n.fillStyle=o.footerColor,n.font=l.string,r=0;r<s;++r)n.fillText(a[r],c.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+o.footerSpacing}}drawBackground(e,n,o,a){const{xAlign:s,yAlign:l}=this,{x:r,y:c}=e,{width:d,height:u}=o,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=$t(a.cornerRadius);n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,n.lineWidth=a.borderWidth,n.beginPath(),n.moveTo(r+h,c),l==="top"&&this.drawCaret(e,n,o,a),n.lineTo(r+d-f,c),n.quadraticCurveTo(r+d,c,r+d,c+f),l==="center"&&s==="right"&&this.drawCaret(e,n,o,a),n.lineTo(r+d,c+u-p),n.quadraticCurveTo(r+d,c+u,r+d-p,c+u),l==="bottom"&&this.drawCaret(e,n,o,a),n.lineTo(r+m,c+u),n.quadraticCurveTo(r,c+u,r,c+u-m),l==="center"&&s==="left"&&this.drawCaret(e,n,o,a),n.lineTo(r,c+h),n.quadraticCurveTo(r,c,r+h,c),n.closePath(),n.fill(),a.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,o=this.$animations,a=o&&o.x,s=o&&o.y;if(a||s){const l=Cn[e.position].call(this,this._active,this._eventPosition);if(!l)return;const r=this._size=sl(this,e),c=Object.assign({},l,this._size),d=ll(n,e,c),u=rl(e,c,d,n);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=r.width,this.height=r.height,this.caretX=l.x,this.caretY=l.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const n=this.options.setContext(this.getContext());let o=this.opacity;if(!o)return;this._updateAnimationTarget(n);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};o=Math.abs(o)<.001?0:o;const l=We(n.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&r&&(e.save(),e.globalAlpha=o,this.drawBackground(s,e,a,n),Ya(e,n.textDirection),s.y+=l.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),Ua(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const o=this._active,a=e.map(({datasetIndex:r,index:c})=>{const d=this.chart.getDatasetMeta(r);if(!d)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:d.data[c],index:c}}),s=!On(o,a),l=this._positionChanged(a,n);(s||l)&&(this._active=a,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,o=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],l=this._getActiveElements(e,s,n,o),r=this._positionChanged(l,e),c=n||!On(l,s)||r;return c&&(this._active=l,(a.enabled||a.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,o,a){const s=this.options;if(e.type==="mouseout")return[];if(!a)return n.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const l=this.chart.getElementsAtEventForMode(e,s.mode,s,o);return s.reverse&&l.reverse(),l}_positionChanged(e,n){const{caretX:o,caretY:a,options:s}=this,l=Cn[s.position].call(this,e,n);return l!==!1&&(o!==l.x||a!==l.y)}},W(Ro,"positioners",Cn),Ro);var Zm={id:"tooltip",_element:hl,positioners:Cn,afterInit(t,e,n){n&&(t.tooltip=new hl({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ul},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Qm=Object.freeze({__proto__:null,Colors:um,Decimation:pm,Filler:zm,Legend:Fm,SubTitle:jm,Title:Hm,Tooltip:Zm});const ep=(t,e,n,o)=>(typeof e=="string"?(n=t.push(e)-1,o.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function tp(t,e,n,o){const a=t.indexOf(e);if(a===-1)return ep(t,e,n,o);const s=t.lastIndexOf(e);return a!==s?n:a}const np=(t,e)=>t===null?null:Ie(Math.round(t),0,e);function fl(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class Co extends Pt{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const o=this.getLabels();for(const{index:a,label:s}of n)o[a]===s&&o.splice(a,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(ae(e))return null;const o=this.getLabels();return n=isFinite(n)&&o[n]===e?n:tp(o,e,ie(n,e),this._addedLabels),np(n,o.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:o,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(o=0),n||(a=this.getLabels().length-1)),this.min=o,this.max=a}buildTicks(){const e=this.min,n=this.max,o=this.options.offset,a=[];let s=this.getLabels();s=e===0&&n===s.length-1?s:s.slice(e,n+1),this._valueRange=Math.max(s.length-(o?0:1),1),this._startValue=this.min-(o?.5:0);for(let l=e;l<=n;l++)a.push({value:l});return a}getLabelForValue(e){return fl.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}W(Co,"id","category"),W(Co,"defaults",{ticks:{callback:fl}});function ip(t,e){const n=[],{bounds:a,step:s,min:l,max:r,precision:c,count:d,maxTicks:u,maxDigits:h,includeBounds:f}=t,m=s||1,p=u-1,{min:g,max:b}=e,_=!ae(l),k=!ae(r),B=!ae(d),C=(b-g)/(h+1);let y=ga((b-g)/p/m)*m,x,S,w,M;if(y<1e-14&&!_&&!k)return[{value:g},{value:b}];M=Math.ceil(b/y)-Math.floor(g/y),M>p&&(y=ga(M*y/p/m)*m),ae(c)||(x=Math.pow(10,c),y=Math.ceil(y*x)/x),a==="ticks"?(S=Math.floor(g/y)*y,w=Math.ceil(b/y)*y):(S=g,w=b),_&&k&&s&&Kd((r-l)/s,y/1e3)?(M=Math.round(Math.min((r-l)/y,u)),y=(r-l)/M,S=l,w=r):B?(S=_?l:S,w=k?r:w,M=d-1,y=(w-S)/M):(M=(w-S)/y,ln(M,Math.round(M),y/1e3)?M=Math.round(M):M=Math.ceil(M));const N=Math.max(_a(y),_a(S));x=Math.pow(10,ae(c)?N:c),S=Math.round(S*x)/x,w=Math.round(w*x)/x;let T=0;for(_&&(f&&S!==l?(n.push({value:l}),S<l&&T++,ln(Math.round((S+T*y)*x)/x,l,ml(l,C,t))&&T++):S<l&&T++);T<M;++T){const $=Math.round((S+T*y)*x)/x;if(k&&$>r)break;n.push({value:$})}return k&&f&&w!==r?n.length&&ln(n[n.length-1].value,r,ml(r,C,t))?n[n.length-1].value=r:n.push({value:r}):(!k||w===r)&&n.push({value:w}),n}function ml(t,e,{horizontal:n,minRotation:o}){const a=Ze(o),s=(n?Math.sin(a):Math.cos(a))||.001,l=.75*e*(""+t).length;return Math.min(e/s,l)}class bi extends Pt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return ae(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:a,max:s}=this;const l=c=>a=n?a:c,r=c=>s=o?s:c;if(e){const c=nt(a),d=nt(s);c<0&&d<0?r(0):c>0&&d>0&&l(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);r(s+c),e||l(a-c)}this.min=a,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:o}=e,a;return o?(a=Math.ceil(this.max/o)-Math.floor(this.min/o)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${o} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),n=n||11),n&&(a=Math.min(n,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let o=this.getTickLimit();o=Math.max(2,o);const a={maxTicks:o,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,l=ip(a,s);return e.bounds==="ticks"&&ba(l,this,"value"),e.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}configure(){const e=this.ticks;let n=this.min,o=this.max;if(super.configure(),this.options.offset&&e.length){const a=(o-n)/Math.max(e.length-1,1)/2;n-=a,o+=a}this._startValue=n,this._endValue=o,this._valueRange=o-n}getLabelForValue(e){return dn(e,this.chart.options.locale,this.options.ticks.format)}}class Bo extends bi{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Me(e)?e:0,this.max=Me(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,o=Ze(this.options.ticks.minRotation),a=(e?Math.sin(o):Math.cos(o))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/a))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}W(Bo,"id","linear"),W(Bo,"defaults",{ticks:{callback:jn.formatters.numeric}});const Bn=t=>Math.floor(yt(t)),At=(t,e)=>Math.pow(10,Bn(t)+e);function pl(t){return t/Math.pow(10,Bn(t))===1}function gl(t,e,n){const o=Math.pow(10,n),a=Math.floor(t/o);return Math.ceil(e/o)-a}function op(t,e){const n=e-t;let o=Bn(n);for(;gl(t,e,o)>10;)o++;for(;gl(t,e,o)<10;)o--;return Math.min(o,Bn(t))}function ap(t,{min:e,max:n}){e=qe(t.min,e);const o=[],a=Bn(e);let s=op(e,n),l=s<0?Math.pow(10,Math.abs(s)):1;const r=Math.pow(10,s),c=a>s?Math.pow(10,a):0,d=Math.round((e-c)*l)/l,u=Math.floor((e-c)/r/10)*r*10;let h=Math.floor((d-u)/Math.pow(10,s)),f=qe(t.min,Math.round((c+u+h*Math.pow(10,s))*l)/l);for(;f<n;)o.push({value:f,major:pl(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(s++,h=2,l=s>=0?1:l),f=Math.round((c+u+h*Math.pow(10,s))*l)/l;const m=qe(t.max,f);return o.push({value:m,major:pl(m),significand:h}),o}class So extends Pt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,n){const o=bi.prototype.parse.apply(this,[e,n]);if(o===0){this._zero=!0;return}return Me(o)&&o>0?o:null}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Me(e)?Math.max(0,e):null,this.max=Me(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Me(this._userMin)&&(this.min=e===At(this.min,0)?At(this.min,-1):At(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let o=this.min,a=this.max;const s=r=>o=e?o:r,l=r=>a=n?a:r;o===a&&(o<=0?(s(1),l(10)):(s(At(o,-1)),l(At(a,1)))),o<=0&&s(At(a,-1)),a<=0&&l(At(o,1)),this.min=o,this.max=a}buildTicks(){const e=this.options,n={min:this._userMin,max:this._userMax},o=ap(n,this);return e.bounds==="ticks"&&ba(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}getLabelForValue(e){return e===void 0?"0":dn(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=yt(e),this._valueRange=yt(this.max)-yt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(yt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const n=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+n*this._valueRange)}}W(So,"id","logarithmic"),W(So,"defaults",{ticks:{callback:jn.formatters.logarithmic,major:{enabled:!0}}});function Eo(t){const e=t.ticks;if(e.display&&t.display){const n=We(e.backdropPadding);return ie(e.font&&e.font.size,Ee.font.size)+n.height}return 0}function sp(t,e,n){return n=Se(n)?n:[n],{w:uu(t,e.string,n),h:n.length*e.lineHeight}}function bl(t,e,n,o,a){return t===o||t===a?{start:e-n/2,end:e+n/2}:t<o||t>a?{start:e-n,end:e}:{start:e,end:e+n}}function lp(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},n=Object.assign({},e),o=[],a=[],s=t._pointLabels.length,l=t.options.pointLabels,r=l.centerPointLabels?de/s:0;for(let c=0;c<s;c++){const d=l.setContext(t.getPointLabelContext(c));a[c]=d.padding;const u=t.getPointPosition(c,t.drawingArea+a[c],r),h=$e(d.font),f=sp(t.ctx,h,t._pointLabels[c]);o[c]=f;const m=Oe(t.getIndexAngle(c)+r),p=Math.round(Wi(m)),g=bl(p,u.x,f.w,0,180),b=bl(p,u.y,f.h,90,270);rp(n,e,m,g,b)}t.setCenterPoint(e.l-n.l,n.r-e.r,e.t-n.t,n.b-e.b),t._pointLabelItems=up(t,o,a)}function rp(t,e,n,o,a){const s=Math.abs(Math.sin(n)),l=Math.abs(Math.cos(n));let r=0,c=0;o.start<e.l?(r=(e.l-o.start)/s,t.l=Math.min(t.l,e.l-r)):o.end>e.r&&(r=(o.end-e.r)/s,t.r=Math.max(t.r,e.r+r)),a.start<e.t?(c=(e.t-a.start)/l,t.t=Math.min(t.t,e.t-c)):a.end>e.b&&(c=(a.end-e.b)/l,t.b=Math.max(t.b,e.b+c))}function cp(t,e,n){const o=t.drawingArea,{extra:a,additionalAngle:s,padding:l,size:r}=n,c=t.getPointPosition(e,o+a+l,s),d=Math.round(Wi(Oe(c.angle+Ve))),u=mp(c.y,r.h,d),h=hp(d),f=fp(c.x,r.w,h);return{visible:!0,x:c.x,y:u,textAlign:h,left:f,top:u,right:f+r.w,bottom:u+r.h}}function dp(t,e){if(!e)return!0;const{left:n,top:o,right:a,bottom:s}=t;return!(ct({x:n,y:o},e)||ct({x:n,y:s},e)||ct({x:a,y:o},e)||ct({x:a,y:s},e))}function up(t,e,n){const o=[],a=t._pointLabels.length,s=t.options,{centerPointLabels:l,display:r}=s.pointLabels,c={extra:Eo(s)/2,additionalAngle:l?de/a:0};let d;for(let u=0;u<a;u++){c.padding=n[u],c.size=e[u];const h=cp(t,u,c);o.push(h),r==="auto"&&(h.visible=dp(h,d),h.visible&&(d=h))}return o}function hp(t){return t===0||t===180?"center":t<180?"left":"right"}function fp(t,e,n){return n==="right"?t-=e:n==="center"&&(t-=e/2),t}function mp(t,e,n){return n===90||n===270?t-=e/2:(n>270||n<90)&&(t-=e),t}function pp(t,e,n){const{left:o,top:a,right:s,bottom:l}=n,{backdropColor:r}=e;if(!ae(r)){const c=$t(e.borderRadius),d=We(e.backdropPadding);t.fillStyle=r;const u=o-d.left,h=a-d.top,f=s-o+d.width,m=l-a+d.height;Object.values(c).some(p=>p!==0)?(t.beginPath(),hn(t,{x:u,y:h,w:f,h:m,radius:c}),t.fill()):t.fillRect(u,h,f,m)}}function gp(t,e){const{ctx:n,options:{pointLabels:o}}=t;for(let a=e-1;a>=0;a--){const s=t._pointLabelItems[a];if(!s.visible)continue;const l=o.setContext(t.getPointLabelContext(a));pp(n,l,s);const r=$e(l.font),{x:c,y:d,textAlign:u}=s;Dt(n,t._pointLabels[a],c,d+r.lineHeight/2,r,{color:l.color,textAlign:u,textBaseline:"middle"})}}function _l(t,e,n,o){const{ctx:a}=t;if(n)a.arc(t.xCenter,t.yCenter,e,0,Ce);else{let s=t.getPointPosition(0,e);a.moveTo(s.x,s.y);for(let l=1;l<o;l++)s=t.getPointPosition(l,e),a.lineTo(s.x,s.y)}}function bp(t,e,n,o,a){const s=t.ctx,l=e.circular,{color:r,lineWidth:c}=e;!l&&!o||!r||!c||n<0||(s.save(),s.strokeStyle=r,s.lineWidth=c,s.setLineDash(a.dash||[]),s.lineDashOffset=a.dashOffset,s.beginPath(),_l(t,n,l,o),s.closePath(),s.stroke(),s.restore())}function _p(t,e,n){return kt(t,{label:n,index:e,type:"pointLabel"})}class Sn extends bi{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=We(Eo(this.options)/2),n=this.width=this.maxWidth-e.width,o=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+n/2+e.left),this.yCenter=Math.floor(this.top+o/2+e.top),this.drawingArea=Math.floor(Math.min(n,o)/2)}determineDataLimits(){const{min:e,max:n}=this.getMinMax(!1);this.min=Me(e)&&!isNaN(e)?e:0,this.max=Me(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Eo(this.options))}generateTickLabels(e){bi.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((n,o)=>{const a=ke(this.options.pointLabels.callback,[n,o],this);return a||a===0?a:""}).filter((n,o)=>this.chart.getDataVisibility(o))}fit(){const e=this.options;e.display&&e.pointLabels.display?lp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,n,o,a){this.xCenter+=Math.floor((e-n)/2),this.yCenter+=Math.floor((o-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,n,o,a))}getIndexAngle(e){const n=Ce/(this._pointLabels.length||1),o=this.options.startAngle||0;return Oe(e*n+Ze(o))}getDistanceFromCenterForValue(e){if(ae(e))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*n:(e-this.min)*n}getValueForDistanceFromCenter(e){if(ae(e))return NaN;const n=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(e){const n=this._pointLabels||[];if(e>=0&&e<n.length){const o=n[e];return _p(this.getContext(),e,o)}}getPointPosition(e,n,o=0){const a=this.getIndexAngle(e)-Ve+o;return{x:Math.cos(a)*n+this.xCenter,y:Math.sin(a)*n+this.yCenter,angle:a}}getPointPositionForValue(e,n){return this.getPointPosition(e,this.getDistanceFromCenterForValue(n))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:n,top:o,right:a,bottom:s}=this._pointLabelItems[e];return{left:n,top:o,right:a,bottom:s}}drawBackground(){const{backgroundColor:e,grid:{circular:n}}=this.options;if(e){const o=this.ctx;o.save(),o.beginPath(),_l(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),o.closePath(),o.fillStyle=e,o.fill(),o.restore()}}drawGrid(){const e=this.ctx,n=this.options,{angleLines:o,grid:a,border:s}=n,l=this._pointLabels.length;let r,c,d;if(n.pointLabels.display&&gp(this,l),a.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=a.setContext(f),p=s.setContext(f);bp(this,m,c,l,p)}}),o.display){for(e.save(),r=l-1;r>=0;r--){const u=o.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:f}=u;!f||!h||(e.lineWidth=f,e.strokeStyle=h,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),d=this.getPointPosition(r,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,n=this.options,o=n.ticks;if(!o.display)return;const a=this.getIndexAngle(0);let s,l;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const d=o.setContext(this.getContext(c)),u=$e(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,l=e.measureText(r.label).width,e.fillStyle=d.backdropColor;const h=We(d.backdropPadding);e.fillRect(-l/2-h.left,-s-u.size/2-h.top,l+h.width,u.size+h.height)}Dt(e,r.label,0,-s,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}W(Sn,"id","radialLinear"),W(Sn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:jn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),W(Sn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),W(Sn,"descriptors",{angleLines:{_fallback:"grid"}});const _i={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ke=Object.keys(_i);function yl(t,e){return t-e}function kl(t,e){if(ae(e))return null;const n=t._adapter,{parser:o,round:a,isoWeekday:s}=t._parseOpts;let l=e;return typeof o=="function"&&(l=o(l)),Me(l)||(l=typeof o=="string"?n.parse(l,o):n.parse(l)),l===null?null:(a&&(l=a==="week"&&(jt(s)||s===!0)?n.startOf(l,"isoWeek",s):n.startOf(l,a)),+l)}function xl(t,e,n,o){const a=Ke.length;for(let s=Ke.indexOf(t);s<a-1;++s){const l=_i[Ke[s]],r=l.steps?l.steps:Number.MAX_SAFE_INTEGER;if(l.common&&Math.ceil((n-e)/(r*l.size))<=o)return Ke[s]}return Ke[a-1]}function yp(t,e,n,o,a){for(let s=Ke.length-1;s>=Ke.indexOf(n);s--){const l=Ke[s];if(_i[l].common&&t._adapter.diff(a,o,l)>=e-1)return l}return Ke[n?Ke.indexOf(n):0]}function kp(t){for(let e=Ke.indexOf(t)+1,n=Ke.length;e<n;++e)if(_i[Ke[e]].common)return Ke[e]}function wl(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:o,hi:a}=ji(n,e),s=n[o]>=e?n[o]:n[a];t[s]=!0}}function xp(t,e,n,o){const a=t._adapter,s=+a.startOf(e[0].value,o),l=e[e.length-1].value;let r,c;for(r=s;r<=l;r=+a.add(r,1,o))c=n[r],c>=0&&(e[c].major=!0);return e}function Cl(t,e,n){const o=[],a={},s=e.length;let l,r;for(l=0;l<s;++l)r=e[l],a[r]=l,o.push({value:r,major:!1});return s===0||!n?o:xp(t,o,a,n)}class En extends Pt{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const o=e.time||(e.time={}),a=this._adapter=new vh._date(e.adapters.date);a.init(n),an(o.displayFormats,a.formats()),this._parseOpts={parser:o.parser,round:o.round,isoWeekday:o.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:kl(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,o=e.time.unit||"day";let{min:a,max:s,minDefined:l,maxDefined:r}=this.getUserBounds();function c(d){!l&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!r&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!l||!r)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=Me(a)&&!isNaN(a)?a:+n.startOf(Date.now(),o),s=Me(s)&&!isNaN(s)?s:+n.endOf(Date.now(),o)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],o=e[e.length-1]),{min:n,max:o}}buildTicks(){const e=this.options,n=e.time,o=e.ticks,a=o.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,l=this.max,r=Zd(a,s,l);return this._unit=n.unit||(o.autoSkip?xl(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):yp(this,r.length,n.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:kp(this._unit),this.initOffsets(a),e.reverse&&r.reverse(),Cl(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,o=0,a,s;this.options.offset&&e.length&&(a=this.getDecimalForValue(e[0]),e.length===1?n=1-a:n=(this.getDecimalForValue(e[1])-a)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?o=s:o=(s-this.getDecimalForValue(e[e.length-2]))/2);const l=e.length<3?.5:.25;n=Ie(n,0,l),o=Ie(o,0,l),this._offsets={start:n,end:o,factor:1/(n+1+o)}}_generate(){const e=this._adapter,n=this.min,o=this.max,a=this.options,s=a.time,l=s.unit||xl(s.minUnit,n,o,this._getLabelCapacity(n)),r=ie(a.ticks.stepSize,1),c=l==="week"?s.isoWeekday:!1,d=jt(c)||c===!0,u={};let h=n,f,m;if(d&&(h=+e.startOf(h,"isoWeek",c)),h=+e.startOf(h,d?"day":l),e.diff(o,n,l)>1e5*r)throw new Error(n+" and "+o+" are too far apart with stepSize of "+r+" "+l);const p=a.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<o;f=+e.add(f,r,l),m++)wl(u,f,p);return(f===o||a.bounds==="ticks"||m===1)&&wl(u,f,p),Object.keys(u).sort(yl).map(g=>+g)}getLabelForValue(e){const n=this._adapter,o=this.options.time;return o.tooltipFormat?n.format(e,o.tooltipFormat):n.format(e,o.displayFormats.datetime)}format(e,n){const a=this.options.time.displayFormats,s=this._unit,l=n||a[s];return this._adapter.format(e,l)}_tickFormatFunction(e,n,o,a){const s=this.options,l=s.ticks.callback;if(l)return ke(l,[e,n,o],this);const r=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&r[c],h=d&&r[d],f=o[n],m=d&&h&&f&&f.major;return this._adapter.format(e,a||(m?h:u))}generateTickLabels(e){let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n],a.label=this._tickFormatFunction(a.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,o=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+o)*n.factor)}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+o*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,o=this.ctx.measureText(e).width,a=Ze(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(a),l=Math.sin(a),r=this._resolveTickFontOptions(0).size;return{w:o*s+r*l,h:o*l+r*s}}_getLabelCapacity(e){const n=this.options.time,o=n.displayFormats,a=o[n.unit]||o.millisecond,s=this._tickFormatFunction(e,0,Cl(this,[e],this._majorUnit),a),l=this._getLabelSize(s),r=Math.floor(this.isHorizontal()?this.width/l.w:this.height/l.h)-1;return r>0?r:1}getDataTimestamps(){let e=this._cache.data||[],n,o;if(e.length)return e;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(n=0,o=a.length;n<o;++n)e=e.concat(a[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,o;if(e.length)return e;const a=this.getLabels();for(n=0,o=a.length;n<o;++n)e.push(kl(this,a[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return wa(e.sort(yl))}}W(En,"id","time"),W(En,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function yi(t,e,n){let o=0,a=t.length-1,s,l,r,c;n?(e>=t[o].pos&&e<=t[a].pos&&({lo:o,hi:a}=rt(t,"pos",e)),{pos:s,time:r}=t[o],{pos:l,time:c}=t[a]):(e>=t[o].time&&e<=t[a].time&&({lo:o,hi:a}=rt(t,"time",e)),{time:s,pos:r}=t[o],{time:l,pos:c}=t[a]);const d=l-s;return d?r+(c-r)*(e-s)/d:r}class Mo extends En{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=yi(n,this.min),this._tableRange=yi(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:o}=this,a=[],s=[];let l,r,c,d,u;for(l=0,r=e.length;l<r;++l)d=e[l],d>=n&&d<=o&&a.push(d);if(a.length<2)return[{time:n,pos:0},{time:o,pos:1}];for(l=0,r=a.length;l<r;++l)u=a[l+1],c=a[l-1],d=a[l],Math.round((u+c)/2)!==d&&s.push({time:d,pos:l/(r-1)});return s}_generate(){const e=this.min,n=this.max;let o=super.getDataTimestamps();return(!o.includes(e)||!o.length)&&o.splice(0,0,e),(!o.includes(n)||o.length===1)&&o.push(n),o.sort((a,s)=>a-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),o=this.getLabelTimestamps();return n.length&&o.length?e=this.normalize(n.concat(o)):e=n.length?n:o,e=this._cache.all=e,e}getDecimalForValue(e){return(yi(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,o=this.getDecimalForPixel(e)/n.factor-n.end;return yi(this._table,o*this._tableRange+this._minPos,!0)}}W(Mo,"id","timeseries"),W(Mo,"defaults",En.defaults);var wp=Object.freeze({__proto__:null,CategoryScale:Co,LinearScale:Bo,LogarithmicScale:So,RadialLinearScale:Sn,TimeScale:En,TimeSeriesScale:Mo});const Cp=[Mh,om,Qm,wp];function ue(t){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(t).trim()}function Bl(){const t={primary:ue("--chart-1")||ue("--action-primary")||"#6366f1",success:ue("--chart-2")||ue("--status-success")||"#14b8a6",warning:ue("--chart-3")||ue("--status-warning")||"#f59e0b",error:ue("--chart-4")||ue("--status-error")||"#f87171",info:ue("--chart-5")||ue("--status-info")||"#3b82f6",text:ue("--chart-text")||ue("--text-primary")||"#1c1917",textMuted:ue("--chart-text-muted")||ue("--text-secondary")||"#78716c",gridLines:ue("--chart-grid")||ue("--border-default")||"#e7e5e4",tooltipBg:ue("--chart-tooltip-bg")||ue("--tooltip-bg")||"#1c1917",tooltipText:ue("--chart-tooltip-text")||ue("--tooltip-text")||"#fafaf9",tooltipBorder:ue("--chart-tooltip-border")||"transparent",legendText:ue("--chart-legend-text")||ue("--text-secondary")||"#78716c"},e=ue("--font-sans")||"system-ui, -apple-system, sans-serif",n=[ue("--chart-1")||t.primary,ue("--chart-2")||t.success,ue("--chart-3")||t.warning,ue("--chart-4")||t.error,ue("--chart-5")||t.info,ue("--chart-6")||"#8b5cf6",ue("--chart-7")||"#ec4899",ue("--chart-8")||"#06b6d4"];return{colors:t,fontFamily:e,palette:n}}function Mn(){const t=i.ref(Bl()),e=i.ref(0);let n=null;function o(){t.value=Bl(),e.value++}i.onMounted(()=>{o();let u=null;n=new MutationObserver(h=>{for(const f of h)if(f.type==="attributes"&&(f.attributeName==="data-theme"||f.attributeName==="class")){u!==null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{requestAnimationFrame(()=>{o(),u=null})});break}}),n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]})}),i.onUnmounted(()=>{n==null||n.disconnect()});const a=i.computed(()=>t.value.colors.gridLines),s=i.computed(()=>t.value.colors.text),l=i.computed(()=>t.value.colors.textMuted);function r(){return{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{grid:{display:!1},border:{display:!1},ticks:{color:t.value.colors.textMuted,font:{family:t.value.fontFamily,size:12}}},y:{grid:{color:t.value.colors.gridLines},border:{display:!1},ticks:{color:t.value.colors.textMuted,font:{family:t.value.fontFamily,size:12}}}}}}function c(u){return t.value.palette[u%t.value.palette.length]}function d(u,h){const f=c(u);if(f.startsWith("oklch")||f.startsWith("rgb"))return f.replace(")",` / ${h})`).replace("rgb(","rgba(").replace("oklch(","oklch(");if(f.startsWith("#")){const m=f.slice(1),p=parseInt(m.slice(0,2),16),g=parseInt(m.slice(2,4),16),b=parseInt(m.slice(4,6),16);return`rgba(${p}, ${g}, ${b}, ${h})`}return f}return{theme:t,themeVersion:e,gridColor:a,textColor:s,mutedTextColor:l,getDefaultOptions:r,getColor:c,getColorWithOpacity:d,updateTheme:o}}const Bp=["aria-label"],Sp={class:"ui-chart__sr-table"},Ep={scope:"row"},Mp={key:0,class:"ui-chart__tooltip-title"},vp={class:"ui-chart__tooltip-label"},Vp={class:"ui-chart__tooltip-value"},ki=O(i.defineComponent({__name:"BaseChart",props:{type:{},data:{},options:{},height:{default:300},ariaLabel:{}},emits:["legendClick","pointClick"],setup(t,{expose:e,emit:n}){ut.register(...Cp);const o=t,a=n,s=i.ref(null),l=i.ref(null),r=i.shallowRef(null),{theme:c,themeVersion:d,getDefaultOptions:u}=Mn(),h=i.ref(null),f=i.ref([]),m=i.computed(()=>typeof o.height=="number"?`${o.height}px`:o.height);function p(){if(!r.value)return[];const x=r.value;return x.data.datasets.map((w,M)=>({label:w.label||`Dataset ${M+1}`,color:Array.isArray(w.backgroundColor)?w.backgroundColor[0]:w.backgroundColor||w.borderColor||c.value.palette[M],hidden:!x.isDatasetVisible(M),datasetIndex:M}))}function g(x){if(!r.value)return;const S=r.value,w=S.isDatasetVisible(x);S.setDatasetVisibility(x,!w),S.update(),f.value=p(),a("legendClick",f.value[x],x)}function b(x){var T,$;const{chart:S,tooltip:w}=x;if(w.opacity===0||!((T=w.dataPoints)!=null&&T.length)){h.value=null;return}const M=S.canvas.getBoundingClientRect(),N=w.dataPoints.map(K=>({label:K.dataset.label||"",value:String(K.formattedValue),color:K.dataset.borderColor||(Array.isArray(K.dataset.backgroundColor)?K.dataset.backgroundColor[K.dataIndex]:K.dataset.backgroundColor)||""}));h.value={title:(($=w.title)==null?void 0:$[0])||"",items:N,x:M.left+w.caretX,y:M.top+w.caretY}}function _(x){if(!r.value||!s.value)return;const S=r.value,w=S.getElementsAtEventForMode(x,"nearest",{intersect:!0},!1);if(w.length>0){const M=w[0],N=M.datasetIndex,T=M.index,$=S.data.datasets[N],K=S.data.labels||[],P=(Array.isArray($.data[T]),$.data[T]);a("pointClick",{datasetIndex:N,index:T,label:String(K[T]||""),value:P,datasetLabel:$.label||""})}}function k(){const x=u(),S=o.options||{},w=x.plugins||{},M=S.plugins||{},N={...x,...S,plugins:{...w,...M,tooltip:{enabled:!1,external:b,mode:"index",intersect:!1,animation:!1,...M.tooltip||{}}},interaction:{mode:"index",intersect:!1,...S.interaction||{}}};return o.type!=="doughnut"&&o.type!=="pie"&&(N.scales={...x.scales||{},...S.scales||{}}),N}function B(){s.value&&(r.value&&r.value.destroy(),r.value=new ut(s.value,{type:o.type,data:o.data,options:k()}),f.value=p())}function C(){r.value&&(r.value.data=o.data,r.value.options=k(),r.value.update(),f.value=p())}let y=null;return i.onMounted(()=>{B(),l.value&&(y=new ResizeObserver(()=>{var x;(x=r.value)==null||x.resize()}),y.observe(l.value))}),i.onUnmounted(()=>{var x;y==null||y.disconnect(),(x=r.value)==null||x.destroy(),r.value=null}),i.watch(()=>o.data,C,{deep:!0}),i.watch(()=>o.type,B),i.watch(d,()=>{i.nextTick(C)}),e({chart:r,toggleDataset:g,legendItems:f}),(x,S)=>(i.openBlock(),i.createElementBlock("div",{class:"ui-chart",ref_key:"containerRef",ref:l},[i.renderSlot(x.$slots,"legend",{items:f.value,toggle:g},void 0,!0),i.createElementVNode("div",{class:"ui-chart__canvas-container",style:i.normalizeStyle({height:m.value})},[i.createElementVNode("canvas",{ref_key:"canvasRef",ref:s,"aria-label":t.ariaLabel,role:"img",onClick:_},[i.renderSlot(x.$slots,"fallback",{},()=>[i.createElementVNode("table",Sp,[i.createElementVNode("caption",null,i.toDisplayString(t.ariaLabel||"Chart data"),1),i.createElementVNode("thead",null,[i.createElementVNode("tr",null,[S[0]||(S[0]=i.createElementVNode("th",{scope:"col"},"Label",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.data.datasets||[],(w,M)=>(i.openBlock(),i.createElementBlock("th",{key:M,scope:"col"},i.toDisplayString(w.label||`Series ${M+1}`),1))),128))])]),i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.data.labels||[],(w,M)=>(i.openBlock(),i.createElementBlock("tr",{key:M},[i.createElementVNode("th",Ep,i.toDisplayString(w),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.data.datasets||[],(N,T)=>{var $;return i.openBlock(),i.createElementBlock("td",{key:T},i.toDisplayString(($=N.data)==null?void 0:$[M]),1)}),128))]))),128))])])],!0)],8,Bp)],4),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.renderSlot(x.$slots,"tooltip",{data:h.value},()=>[h.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-chart__tooltip",style:i.normalizeStyle({left:`${h.value.x}px`,top:`${h.value.y}px`})},[h.value.title?(i.openBlock(),i.createElementBlock("div",Mp,i.toDisplayString(h.value.title),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value.items,(w,M)=>(i.openBlock(),i.createElementBlock("div",{key:M,class:"ui-chart__tooltip-item"},[i.createElementVNode("span",{class:"ui-chart__tooltip-color",style:i.normalizeStyle({backgroundColor:w.color})},null,4),i.createElementVNode("span",vp,i.toDisplayString(w.label),1),i.createElementVNode("span",Vp,i.toDisplayString(w.value),1)]))),128))],4)):i.createCommentVNode("",!0)],!0)]))],512))}}),[["__scopeId","data-v-b70ab7bc"]]),Dp={class:"ui-line-chart__legend"},$p=["onClick"],Tp={class:"ui-line-chart__legend-label"},Ip=O(i.defineComponent({__name:"LineChart",props:{labels:{},series:{},height:{default:300},fill:{type:Boolean,default:!1},tension:{default:.4},showPoints:{type:Boolean,default:!0},pointRadius:{default:4},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},ariaLabel:{},showLegend:{type:Boolean,default:!0}},emits:["pointClick"],setup(t,{emit:e}){const n=t,o=e,{theme:a,getColor:s,getColorWithOpacity:l}=Mn(),r=i.computed(()=>({labels:n.labels,datasets:n.series.map((d,u)=>({label:d.name,data:d.data,borderColor:s(u),backgroundColor:n.fill?l(u,.1):"transparent",borderWidth:2,fill:n.fill,tension:n.tension,pointRadius:n.showPoints?n.pointRadius:0,pointHoverRadius:n.showPoints?n.pointRadius+2:4,pointBackgroundColor:s(u),pointBorderColor:a.value.colors.tooltipText,pointBorderWidth:2}))})),c=i.computed(()=>({scales:{x:{display:n.showXAxis,grid:{display:!1},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}},y:{display:n.showYAxis,grid:{display:n.showGrid,color:a.value.colors.gridLines},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}}},interaction:{mode:"index",intersect:!1}}));return(d,u)=>(i.openBlock(),i.createBlock(ki,{type:"line",data:r.value,options:c.value,height:t.height,"aria-label":t.ariaLabel,onPointClick:u[0]||(u[0]=h=>o("pointClick",h))},i.createSlots({tooltip:i.withCtx(({data:h})=>[i.renderSlot(d.$slots,"tooltip",{data:h},void 0,!0)]),_:2},[t.showLegend||d.$slots.legend?{name:"legend",fn:i.withCtx(({items:h,toggle:f})=>[i.renderSlot(d.$slots,"legend",{items:h,toggle:f},()=>[i.createElementVNode("div",Dp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h,(m,p)=>(i.openBlock(),i.createElementBlock("button",{key:p,type:"button",class:i.normalizeClass(["ui-line-chart__legend-item",{"ui-line-chart__legend-item--hidden":m.hidden}]),onClick:g=>f(p)},[i.createElementVNode("span",{class:"ui-line-chart__legend-color",style:i.normalizeStyle({backgroundColor:m.color})},null,4),i.createElementVNode("span",Tp,i.toDisplayString(m.label),1)],10,$p))),128))])],!0)]),key:"0"}:void 0]),1032,["data","options","height","aria-label"]))}}),[["__scopeId","data-v-2e8f34b7"]]),Lp={class:"ui-bar-chart__legend"},zp=["onClick"],Np={class:"ui-bar-chart__legend-label"},Pp=O(i.defineComponent({__name:"BarChart",props:{labels:{},series:{},height:{default:300},horizontal:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},borderRadius:{default:4},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},ariaLabel:{},showLegend:{type:Boolean,default:!0}},emits:["pointClick"],setup(t,{emit:e}){const n=t,o=e,{theme:a,getColor:s}=Mn(),l=i.computed(()=>({labels:n.labels,datasets:n.series.map((c,d)=>({label:c.name,data:c.data,backgroundColor:s(d),borderColor:"transparent",borderWidth:0,borderRadius:n.borderRadius,borderSkipped:!1}))})),r=i.computed(()=>({indexAxis:n.horizontal?"y":"x",scales:{x:{display:n.showXAxis,stacked:n.stacked,grid:{display:n.horizontal?n.showGrid:!1,color:a.value.colors.gridLines},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}},y:{display:n.showYAxis,stacked:n.stacked,grid:{display:n.horizontal?!1:n.showGrid,color:a.value.colors.gridLines},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}}},interaction:{mode:"index",axis:n.horizontal?"y":"x",intersect:!1}}));return(c,d)=>(i.openBlock(),i.createBlock(ki,{type:"bar",data:l.value,options:r.value,height:t.height,"aria-label":t.ariaLabel,onPointClick:d[0]||(d[0]=u=>o("pointClick",u))},i.createSlots({tooltip:i.withCtx(({data:u})=>[i.renderSlot(c.$slots,"tooltip",{data:u},void 0,!0)]),_:2},[t.showLegend||c.$slots.legend?{name:"legend",fn:i.withCtx(({items:u,toggle:h})=>[i.renderSlot(c.$slots,"legend",{items:u,toggle:h},()=>[i.createElementVNode("div",Lp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u,(f,m)=>(i.openBlock(),i.createElementBlock("button",{key:m,type:"button",class:i.normalizeClass(["ui-bar-chart__legend-item",{"ui-bar-chart__legend-item--hidden":f.hidden}]),onClick:p=>h(m)},[i.createElementVNode("span",{class:"ui-bar-chart__legend-color",style:i.normalizeStyle({backgroundColor:f.color})},null,4),i.createElementVNode("span",Np,i.toDisplayString(f.label),1)],10,zp))),128))])],!0)]),key:"0"}:void 0]),1032,["data","options","height","aria-label"]))}}),[["__scopeId","data-v-bdd7ef89"]]),Ap={class:"ui-donut-chart__legend"},Rp={class:"ui-donut-chart__legend-label"},Op={class:"ui-donut-chart__legend-value"},Fp={class:"ui-donut-chart__container"},Wp={key:0,class:"ui-donut-chart__center"},Hp={key:0,class:"ui-donut-chart__center-value"},jp={key:1,class:"ui-donut-chart__center-label"},Yp={class:"ui-donut-chart__legend"},Up={class:"ui-donut-chart__legend-label"},Xp={class:"ui-donut-chart__legend-value"},Kp=O(i.defineComponent({__name:"DonutChart",props:{segments:{},height:{default:300},cutout:{default:65},ariaLabel:{},showLegend:{type:Boolean,default:!0},legendPosition:{default:"right"},centerLabel:{},centerValue:{}},emits:["segmentClick"],setup(t,{emit:e}){const n=t,o=e,{getColor:a}=Mn(),s=i.computed(()=>({labels:n.segments.map(h=>h.label),datasets:[{data:n.segments.map(h=>h.value),backgroundColor:n.segments.map((h,f)=>h.color||a(f)),borderWidth:0,hoverOffset:4}]})),l=i.computed(()=>({cutout:`${n.cutout}%`,plugins:{legend:{display:!1}},interaction:{mode:"nearest",intersect:!0}})),r=i.computed(()=>n.segments.reduce((h,f)=>h+f.value,0)),c=i.computed(()=>n.segments.map((h,f)=>({label:h.label,color:h.color||a(f),hidden:!1,datasetIndex:f})));function d(h){return`${Math.round(h/r.value*100)}%`}function u(h){const f=h.index,m=n.segments[f];m&&o("segmentClick",{segment:m,index:f,percentage:Math.round(m.value/r.value*100)})}return(h,f)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-donut-chart",[`ui-donut-chart--legend-${t.legendPosition}`]])},[t.showLegend&&(t.legendPosition==="top"||t.legendPosition==="left")?i.renderSlot(h.$slots,"legend",{key:0,items:c.value,toggle:()=>{}},()=>[i.createElementVNode("div",Ap,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.segments,(m,p)=>(i.openBlock(),i.createElementBlock("div",{key:p,class:"ui-donut-chart__legend-item"},[i.createElementVNode("span",{class:"ui-donut-chart__legend-color",style:i.normalizeStyle({backgroundColor:m.color||i.unref(a)(p)})},null,4),i.createElementVNode("span",Rp,i.toDisplayString(m.label),1),i.createElementVNode("span",Op,i.toDisplayString(d(m.value)),1)]))),128))])],!0):i.createCommentVNode("",!0),i.createElementVNode("div",Fp,[i.createVNode(ki,{type:"doughnut",data:s.value,options:l.value,height:t.height,"aria-label":t.ariaLabel,onPointClick:u},{legend:i.withCtx(()=>[...f[0]||(f[0]=[])]),tooltip:i.withCtx(({data:m})=>[i.renderSlot(h.$slots,"tooltip",{data:m},void 0,!0)]),_:3},8,["data","options","height","aria-label"]),t.centerLabel||t.centerValue||h.$slots.center?(i.openBlock(),i.createElementBlock("div",Wp,[i.renderSlot(h.$slots,"center",{},()=>[t.centerValue?(i.openBlock(),i.createElementBlock("div",Hp,i.toDisplayString(t.centerValue),1)):i.createCommentVNode("",!0),t.centerLabel?(i.openBlock(),i.createElementBlock("div",jp,i.toDisplayString(t.centerLabel),1)):i.createCommentVNode("",!0)],!0)])):i.createCommentVNode("",!0)]),t.showLegend&&(t.legendPosition==="bottom"||t.legendPosition==="right")?i.renderSlot(h.$slots,"legend",{key:1,items:c.value,toggle:()=>{}},()=>[i.createElementVNode("div",Yp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.segments,(m,p)=>(i.openBlock(),i.createElementBlock("div",{key:p,class:"ui-donut-chart__legend-item"},[i.createElementVNode("span",{class:"ui-donut-chart__legend-color",style:i.normalizeStyle({backgroundColor:m.color||i.unref(a)(p)})},null,4),i.createElementVNode("span",Up,i.toDisplayString(m.label),1),i.createElementVNode("span",Xp,i.toDisplayString(d(m.value)),1)]))),128))])],!0):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-1af3565d"]]);function Le(t,e="0 0 24 24"){return n=>i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:e,fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",class:n.class},t.map(o=>i.h("path",{d:o})))}function qp(t,e="0 0 24 24"){return n=>i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:e,fill:"currentColor",class:n.class},t.map(o=>i.h("path",{d:o})))}const Sl={sortAsc:Le(["M4 10l4-4 4 4"],"0 0 16 16"),sortDesc:Le(["M4 6l4 4 4-4"],"0 0 16 16"),sortNeutral:Le(["M4 6l4-3 4 3","M4 10l4 3 4-3"],"0 0 16 16"),expand:Le(["M6 9l6 6 6-6"]),collapse:Le(["M18 15l-6-6-6 6"]),close:Le(["M18 6L6 18","M6 6l12 12"]),search:Le(["M11 19a8 8 0 100-16 8 8 0 000 16z","M21 21l-4.35-4.35"]),check:Le(["M20 6L9 17l-5-5"]),info:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M12 16v-4","M12 8h.01"]),success:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M9 12l2 2 4-4"]),warning:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M12 8v4","M12 16h.01"]),error:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M15 9l-6 6","M9 9l6 6"]),emptyData:Le(["M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"]),emptySearch:Le(["M11 19a8 8 0 100-16 8 8 0 000 16z","M21 21l-4.35-4.35"]),calendar:Le(["M8 2v4","M16 2v4","M3 10h18","M5 4h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2z"]),chevronLeft:Le(["M15 18l-6-6 6-6"]),chevronRight:Le(["M9 18l6-6-6-6"]),star:Le(["M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"]),starFilled:qp(["M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"])},xi=i.shallowRef({...Sl});function Gp(t){xi.value={...xi.value,...t}}function Jp(){xi.value={...Sl}}function ve(t){return xi.value[t]}const Zp={class:"ui-empty-state__content"},Qp={key:0,class:"ui-empty-state__icon"},eg={key:1,class:"ui-empty-state__icon ui-empty-state__icon--default"},tg={key:2,class:"ui-empty-state__title"},ng={key:3,class:"ui-empty-state__description"},ig={key:4,class:"ui-empty-state__action"},El=O(i.defineComponent({__name:"EmptyState",props:{title:{},description:{},icon:{},variant:{default:"default"},compact:{type:Boolean,default:!1}},setup(t){const e=t,n=i.useSlots(),o=i.computed(()=>{if(e.icon)return null;switch(e.variant){case"search":return ve("emptySearch");case"error":return ve("error");default:return ve("emptyData")}}),a=i.computed(()=>!!e.icon),s=i.computed(()=>!!e.title),l=i.computed(()=>!!e.description),r=i.computed(()=>!!n.default);return(c,d)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-empty-state",[`ui-empty-state--${t.variant}`,{"ui-empty-state--compact":t.compact}]])},[i.createElementVNode("div",Zp,[a.value?(i.openBlock(),i.createElementBlock("div",Qp,[i.createVNode(je,{icon:t.icon,size:"48px"},null,8,["icon"])])):(i.openBlock(),i.createElementBlock("div",eg,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(o.value),{class:"ui-empty-state__icon-svg"}))])),s.value?(i.openBlock(),i.createElementBlock("div",tg,i.toDisplayString(t.title),1)):i.createCommentVNode("",!0),l.value?(i.openBlock(),i.createElementBlock("div",ng,i.toDisplayString(t.description),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("div",ig,[i.renderSlot(c.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-ef3bb591"]]),wi=O(i.defineComponent({__name:"Skeleton",props:{variant:{default:"text"},width:{},height:{},animation:{default:"shimmer"}},setup(t){const e=t,n=a=>{if(a!==void 0)return typeof a=="number"?`${a}px`:/^\d+(\.\d+)?$/.test(a)?`${a}px`:a},o=i.computed(()=>({width:n(e.width),height:n(e.height)}));return(a,s)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass(["ui-skeleton",[`ui-skeleton--${t.variant}`,`ui-skeleton--${t.animation}`]]),style:i.normalizeStyle(o.value),"aria-hidden":"true"},null,6))}}),[["__scopeId","data-v-656e0ee8"]]);function Ml(t,e,n=1,o=!0){if(e<=0)return[];if(e===1)return[1];const a=Math.max(1,Math.min(t,e)),s=Math.max(a-n,1),l=Math.min(a+n,e);if(!o){const m=[],p=s>1,g=l<e;p&&m.push("ellipsis");for(let b=s;b<=l;b++)m.push(b);return g&&m.push("ellipsis"),m}const r=n*2+5;if(e<=r){const m=[];for(let p=1;p<=e;p++)m.push(p);return m}const c=s>2,d=l<e-1,u=[];u.push(1),c&&u.push("ellipsis");const h=c?s:2,f=d?l:e-1;for(let m=h;m<=f;m++)u.push(m);return d&&u.push("ellipsis"),e>1&&u.push(e),u}const og={class:"ui-pagination__list",role:"list"},ag={key:0,class:"ui-pagination__ellipsis","aria-hidden":"true"},vl=O(i.defineComponent({__name:"Pagination",props:{modelValue:{},total:{},pageSize:{default:10},siblingCount:{default:1},showEdges:{type:Boolean,default:!0},size:{default:"md"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=ve("chevronLeft"),o=ve("chevronRight"),a=t,s=e,l=i.computed(()=>a.total<=0||a.pageSize<=0?0:Math.ceil(a.total/a.pageSize)),r=i.computed(()=>Math.max(1,Math.min(a.modelValue,l.value))),c=i.computed(()=>Ml(r.value,l.value,a.siblingCount,a.showEdges)),d=i.computed(()=>r.value<=1),u=i.computed(()=>r.value>=l.value);function h(g){if(a.disabled)return;const b=Math.max(1,Math.min(g,l.value));b!==a.modelValue&&s("update:modelValue",b)}function f(){d.value||h(r.value-1)}function m(){u.value||h(r.value+1)}const p=i.computed(()=>a.size==="sm"?"xs":a.size==="lg"?"md":"sm");return(g,b)=>(i.openBlock(),i.createElementBlock("nav",{class:i.normalizeClass(["ui-pagination",[`ui-pagination--${t.size}`,{"ui-pagination--disabled":t.disabled}]]),role:"navigation","aria-label":"Pagination"},[i.createVNode(Je,{variant:"ghost",size:p.value,disabled:t.disabled||d.value,"icon-left":i.unref(n),"aria-label":"Go to previous page",onClick:f},null,8,["size","disabled","icon-left"]),i.createElementVNode("ul",og,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,(_,k)=>(i.openBlock(),i.createElementBlock("li",{key:_==="ellipsis"?`ellipsis-${k}`:_,class:"ui-pagination__item"},[_==="ellipsis"?(i.openBlock(),i.createElementBlock("span",ag," … ")):(i.openBlock(),i.createBlock(Je,{key:1,variant:_===r.value?"secondary":"ghost",size:p.value,disabled:t.disabled,"aria-label":`Go to page ${_}`,"aria-current":_===r.value?"page":void 0,class:i.normalizeClass(["ui-pagination__button",{"ui-pagination__button--current":_===r.value}]),onClick:B=>h(_)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(_),1)]),_:2},1032,["variant","size","disabled","aria-label","aria-current","class","onClick"]))]))),128))]),i.createVNode(Je,{variant:"ghost",size:p.value,disabled:t.disabled||u.value,"icon-left":i.unref(o),"aria-label":"Go to next page",onClick:m},null,8,["size","disabled","icon-left"])],2))}}),[["__scopeId","data-v-686c5710"]]),sg=["for"],lg={key:0,class:"ui-select__required","aria-hidden":"true"},rg=["id","disabled","aria-expanded","aria-controls","aria-activedescendant","aria-invalid","aria-describedby","aria-required"],cg={class:"ui-select__value"},dg=["name","value","required","disabled"],ug={value:"",disabled:""},hg=["value","disabled"],fg=["id","aria-labelledby"],mg=["id","aria-selected","aria-disabled","onMouseenter","onClick"],pg={key:0,class:"ui-select__check",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},gg=["id"],bg=["id"],Vl=O(i.defineComponent({__name:"Select",props:{modelValue:{default:null},options:{},label:{},placeholder:{default:"Select an option"},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},block:{type:Boolean,default:!1},id:{},name:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(null),s=i.ref(null),l=i.ref(!1),r=i.ref(-1),c=ye("select"),d=i.computed(()=>n.id||c),u=i.computed(()=>`${d.value}-listbox`),h=i.computed(()=>`${d.value}-hint`),f=i.computed(()=>`${d.value}-error`);function m(P){return`${d.value}-option-${P}`}const p=i.computed(()=>{if(n.error)return f.value;if(n.hint)return h.value}),g=i.computed(()=>n.options.find(P=>P.value===n.modelValue)),b=i.computed(()=>{var P;return((P=g.value)==null?void 0:P.label)||""}),_=i.computed(()=>{if(!(!l.value||r.value<0))return m(r.value)}),k=i.ref({});function B(){if(!a.value)return;const P=a.value.getBoundingClientRect();k.value={position:"fixed",top:`${P.bottom+4}px`,left:`${P.left}px`,minWidth:`${P.width}px`,maxWidth:`${Math.max(P.width,300)}px`}}function C(){if(n.disabled||l.value)return;l.value=!0,B();const P=n.options.findIndex(A=>A.value===n.modelValue);P>=0&&!n.options[P].disabled?r.value=P:r.value=n.options.findIndex(A=>!A.disabled),i.nextTick(()=>{M()}),document.addEventListener("mousedown",S),window.addEventListener("resize",y),window.addEventListener("scroll",B,!0)}function y(){l.value&&(l.value=!1,r.value=-1,document.removeEventListener("mousedown",S),window.removeEventListener("resize",y),window.removeEventListener("scroll",B,!0))}function x(){l.value?y():C()}function S(P){var R,q;const A=P.target;(R=a.value)!=null&&R.contains(A)||(q=s.value)!=null&&q.contains(A)||y()}function w(P){var A;P.disabled||(o("update:modelValue",P.value),o("change",P.value),y(),(A=a.value)==null||A.focus())}function M(){if(!s.value||r.value<0)return;const P=s.value.children[r.value];P&&P.scrollIntoView({block:"nearest"})}function N(P){const A=n.options.length;let R=r.value;do R=(R+P+A)%A;while(n.options[R].disabled&&R!==r.value);n.options[R].disabled||(r.value=R,i.nextTick(M))}function T(P){switch(P.key){case"Enter":case" ":P.preventDefault(),l.value&&r.value>=0?w(n.options[r.value]):C();break;case"ArrowDown":P.preventDefault(),l.value?N(1):C();break;case"ArrowUp":P.preventDefault(),l.value?N(-1):C();break;case"Home":P.preventDefault(),l.value&&(r.value=n.options.findIndex(A=>!A.disabled),i.nextTick(M));break;case"End":if(P.preventDefault(),l.value){for(let A=n.options.length-1;A>=0;A--)if(!n.options[A].disabled){r.value=A;break}i.nextTick(M)}break;case"Escape":P.preventDefault(),y();break;case"Tab":y();break}}function $(P){n.options[P].disabled||(r.value=P)}function K(P,A){A.preventDefault(),w(P)}return i.onBeforeUnmount(()=>{document.removeEventListener("mousedown",S),window.removeEventListener("resize",y),window.removeEventListener("scroll",B,!0)}),(P,A)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-select",[`ui-select--${t.size}`,{"ui-select--block":t.block,"ui-select--disabled":t.disabled,"ui-select--error":t.error,"ui-select--open":l.value}]])},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:d.value,class:"ui-select__label"},[i.createTextVNode(i.toDisplayString(t.label)+" ",1),t.required?(i.openBlock(),i.createElementBlock("span",lg,"*")):i.createCommentVNode("",!0)],8,sg)):i.createCommentVNode("",!0),i.createElementVNode("button",{id:d.value,ref_key:"triggerRef",ref:a,type:"button",role:"combobox",class:i.normalizeClass(["ui-select__trigger",[`ui-select__trigger--${t.size}`,{"ui-select__trigger--error":t.error,"ui-select__trigger--placeholder":!g.value}]]),disabled:t.disabled,"aria-expanded":l.value,"aria-controls":u.value,"aria-activedescendant":_.value,"aria-invalid":t.error?"true":void 0,"aria-describedby":p.value,"aria-required":t.required,"aria-haspopup":"listbox",onClick:x,onKeydown:T},[i.createElementVNode("span",cg,i.toDisplayString(b.value||t.placeholder),1),(i.openBlock(),i.createElementBlock("svg",{class:i.normalizeClass(["ui-select__chevron",{"ui-select__chevron--open":l.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...A[0]||(A[0]=[i.createElementVNode("path",{d:"M6 9l6 6 6-6"},null,-1)])],2))],42,rg),t.name?(i.openBlock(),i.createElementBlock("select",{key:1,name:t.name,value:t.modelValue??"",required:t.required,disabled:t.disabled,class:"ui-select__native",tabindex:"-1","aria-hidden":"true"},[i.createElementVNode("option",ug,i.toDisplayString(t.placeholder),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.options,R=>(i.openBlock(),i.createElementBlock("option",{key:R.value,value:R.value,disabled:R.disabled},i.toDisplayString(R.label),9,hg))),128))],8,dg)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-select-menu"},{default:i.withCtx(()=>[l.value?(i.openBlock(),i.createElementBlock("ul",{key:0,id:u.value,ref_key:"listboxRef",ref:s,role:"listbox",class:"ui-select__listbox",style:i.normalizeStyle(k.value),"aria-labelledby":d.value},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.options,(R,q)=>(i.openBlock(),i.createElementBlock("li",{key:R.value,id:m(q),role:"option",class:i.normalizeClass(["ui-select__option",{"ui-select__option--selected":R.value===t.modelValue,"ui-select__option--highlighted":q===r.value,"ui-select__option--disabled":R.disabled}]),"aria-selected":R.value===t.modelValue,"aria-disabled":R.disabled,onMouseenter:Q=>$(q),onClick:Q=>K(R,Q)},[i.createTextVNode(i.toDisplayString(R.label)+" ",1),R.value===t.modelValue?(i.openBlock(),i.createElementBlock("svg",pg,[...A[1]||(A[1]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):i.createCommentVNode("",!0)],42,mg))),128))],12,fg)):i.createCommentVNode("",!0)]),_:1})])),t.error?(i.openBlock(),i.createElementBlock("p",{key:2,id:f.value,class:"ui-select__message ui-select__message--error",role:"alert"},i.toDisplayString(t.error),9,gg)):t.hint?(i.openBlock(),i.createElementBlock("p",{key:3,id:h.value,class:"ui-select__message ui-select__message--hint"},i.toDisplayString(t.hint),9,bg)):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1f24efa"]]),vo=O(i.defineComponent({__name:"Text",props:{as:{default:"p"},size:{default:"base"},weight:{default:"regular"},align:{default:"left"},muted:{type:Boolean},truncate:{type:Boolean},clamp:{}},setup(t){const e=t,n=i.computed(()=>["ui-text",`ui-text--${e.size}`,`ui-text--${e.weight}`,`ui-text--${e.align}`,{"ui-text--muted":e.muted,"ui-text--truncate":e.truncate&&!e.clamp,"ui-text--clamp":e.clamp}]),o=i.computed(()=>e.clamp?{WebkitLineClamp:e.clamp}:void 0);return(a,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(n.value),style:i.normalizeStyle(o.value)},{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-17686709"]]);function Dl(t,e){if(e)return e.split(".").reduce((n,o)=>{if(n&&typeof n=="object"&&Object.hasOwn(n,o))return n[o]},t)}const _g={key:0,class:"ui-table__toolbar"},yg={class:"ui-table__search"},kg={class:"ui-table__wrapper"},xg=["aria-busy"],wg={class:"ui-table__header"},Cg={class:"ui-table__header-row"},Bg={key:0,class:"ui-table__header-cell ui-table__header-cell--expand"},Sg={key:1,class:"ui-table__header-cell ui-table__header-cell--checkbox"},Eg=["aria-sort","tabindex","role","onClick","onKeydown"],Mg={class:"ui-table__header-content"},vg={class:"ui-table__header-text"},Vg=["onMousedown"],Dg={key:0,class:"ui-table__filter-row"},$g={key:0,class:"ui-table__filter-cell"},Tg={key:1,class:"ui-table__filter-cell"},Ig={class:"ui-table__body"},Lg={key:0,class:"ui-table__cell ui-table__cell--expand"},zg={key:1,class:"ui-table__cell ui-table__cell--checkbox"},Ng={key:1,class:"ui-table__row ui-table__row--empty"},Pg=["colspan"],Ag=["onClick"],Rg=["aria-expanded","aria-label","onClick"],Og=["data-label"],Fg=["colspan"],Wg={class:"ui-table__expansion-content"},Hg={key:1,class:"ui-table__footer"},jg={class:"ui-table__footer-summary"},Yg={class:"ui-table__footer-controls"},Ug={class:"ui-table__page-size"},Xg=O(i.defineComponent({__name:"DataTable",props:{data:{},columns:{},selectable:{type:Boolean,default:!1},selectedIds:{default:()=>[]},rowKey:{default:"id"},loading:{type:Boolean,default:!1},skeletonRows:{default:5},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},size:{default:"md"},emptyMessage:{default:"No data available"},bordered:{type:Boolean,default:!1},stickyHeader:{type:Boolean,default:!1},pagination:{type:[Boolean,Object],default:!1},page:{default:1},pageSize:{default:10},total:{},serverSide:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},search:{default:""},searchPlaceholder:{default:"Search..."},filterable:{type:Boolean,default:!1},filters:{default:()=>({})},resizable:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},expandedIds:{default:()=>[]}},emits:["update:selectedIds","sort-change","row-click","update:page","update:pageSize","pagination-change","update:search","update:filters","filter-change","update:expandedIds","row-expand","column-resize"],setup(t,{emit:e}){const n=["60%","75%","90%","70%","85%","65%","80%","55%"];function o(I,U){return n[(I*3+U)%n.length]}const a=ve("sortAsc"),s=ve("sortDesc"),l=ve("sortNeutral"),r=ve("expand"),c=ve("collapse"),d=ve("search"),u=ve("close"),h=t,f=e,m=i.ref({key:null,direction:null}),p=ye("datatable"),g=i.computed(()=>!!h.pagination),b=i.computed(()=>typeof h.pagination=="object"?h.pagination:{}),_=[10,20,50,100],k=i.computed(()=>b.value.pageSizeOptions||_),B=i.ref(h.page),C=i.ref(b.value.pageSize||h.pageSize);i.watch(()=>h.page,I=>{B.value=I}),i.watch(()=>h.pageSize,I=>{C.value=I});const y=i.computed(()=>h.serverSide&&h.total!==void 0?h.total:me.value.length),x=i.computed(()=>y.value<=0||C.value<=0?0:Math.ceil(y.value/C.value));function S(I){B.value=I,f("update:page",I),f("pagination-change",{page:I,pageSize:C.value})}function w(I){if(I===null)return;const U=typeof I=="string"?parseInt(I,10):I;C.value=U,B.value=1,f("update:pageSize",U),f("update:page",1),f("pagination-change",{page:1,pageSize:U})}const M=i.computed(()=>k.value.map(I=>({label:String(I),value:I}))),N=i.computed(()=>y.value===0?0:(B.value-1)*C.value+1),T=i.computed(()=>Math.min(B.value*C.value,y.value));function $(I){const U=I[h.rowKey];return typeof U=="string"||typeof U=="number"?U:(console.warn(`DataTable: Row key "${h.rowKey}" must be string or number`),String(U))}function K(I,U){return Dl(I,U)}const P=i.computed(()=>h.data.length===0?!1:h.data.every(I=>h.selectedIds.includes($(I)))),A=i.computed(()=>h.data.length===0?!1:h.selectedIds.length>0&&!P.value);function R(I){if(I){const U=h.data.map(H=>$(H));f("update:selectedIds",U)}else f("update:selectedIds",[])}function q(I,U){const H=$(I);U?f("update:selectedIds",[...h.selectedIds,H]):f("update:selectedIds",h.selectedIds.filter(re=>re!==H))}function Q(I){return h.selectedIds.includes($(I))}function ee(I){if(!I.sortable)return;let U;if(m.value.key!==I.key)U="asc";else{const H=[null,"asc","desc"],re=H.indexOf(m.value.direction);U=H[(re+1)%3]}m.value={key:U?I.key:null,direction:U},f("sort-change",m.value)}function ge(I,U){(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),ee(U))}const fe=i.ref(h.search),be=i.ref({...h.filters});i.watch(()=>h.search,I=>{fe.value=I}),i.watch(()=>h.filters,I=>{be.value={...I}},{deep:!0});function xe(I){const U=I===null?"":String(I);fe.value=U,B.value=1,f("update:search",U),f("update:page",1),f("filter-change",{search:U,filters:be.value})}function F(){xe("")}function v(I,U){const H={...be.value,[I]:U};U||delete H[I],be.value=H,B.value=1,f("update:filters",H),f("update:page",1),f("filter-change",{search:fe.value,filters:H})}function D(I,U){return U?String(I??"").toLowerCase().includes(U.toLowerCase()):!0}const G=i.computed(()=>fe.value!==""||Object.keys(be.value).length>0),ce=i.computed(()=>h.filterable?h.columns.filter(I=>I.filterable!==!1):[]),ze=i.ref({}),L=i.ref(null),j=i.ref(0),X=i.ref(0),ne=i.ref(null);function he(I){return ze.value[I.key]?`${ze.value[I.key]}px`:I.width}function Ae(I,U){if(!h.resizable||U.resizable===!1)return;I.preventDefault(),L.value=U.key,j.value=I.clientX;const H=I.target.closest("th");H&&(X.value=H.offsetWidth),document.addEventListener("mousemove",Re),document.addEventListener("mouseup",Ye),document.body.style.cursor="col-resize",document.body.style.userSelect="none"}function Re(I){if(!L.value)return;const U=h.columns.find(Pe=>Pe.key===L.value),H=U!=null&&U.minWidth?parseInt(U.minWidth):50,re=I.clientX-j.value,te=Math.max(H,X.value+re);ze.value={...ze.value,[L.value]:te}}function Ye(){L.value&&f("column-resize",L.value,ze.value[L.value]),L.value=null,document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Ye),document.body.style.cursor="",document.body.style.userSelect=""}i.onUnmounted(()=>{document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Ye)});function V(I){return h.expandedIds.includes($(I))}function Z(I){const U=$(I),H=h.expandedIds.includes(U);H?f("update:expandedIds",h.expandedIds.filter(re=>re!==U)):f("update:expandedIds",[...h.expandedIds,U]),f("row-expand",I,!H)}function Te(I){return I==null?4:typeof I=="number"?1:typeof I=="string"?2:typeof I=="boolean"?3:5}const me=i.computed(()=>{if(h.serverSide)return h.data;let I=[...h.data];if(fe.value){const U=fe.value.toLowerCase();I=I.filter(H=>h.columns.some(re=>{const te=K(H,re.key);return String(te??"").toLowerCase().includes(U)}))}return Object.keys(be.value).length>0&&(I=I.filter(U=>Object.entries(be.value).every(([H,re])=>{if(!re)return!0;const te=h.columns.find(Ft=>Ft.key===H),Pe=K(U,H);return((te==null?void 0:te.filterFn)||D)(Pe,re,U)}))),I}),we=i.computed(()=>{if(!m.value.key||!m.value.direction)return me.value;const I=m.value.key,U=m.value.direction==="asc"?1:-1;return[...me.value].sort((H,re)=>{const te=K(H,I),Pe=K(re,I),$n=Te(te),Ft=Te(Pe);return $n!==Ft?($n-Ft)*U:te==null&&Pe==null?0:typeof te=="string"&&typeof Pe=="string"?te.localeCompare(Pe)*U:typeof te=="number"&&typeof Pe=="number"?(te-Pe)*U:typeof te=="boolean"&&typeof Pe=="boolean"?(te===Pe?0:te?-1:1)*U:(String(te)<String(Pe)?-1:String(te)>String(Pe)?1:0)*U})}),le=i.computed(()=>{if(!g.value||h.serverSide)return we.value;const I=(B.value-1)*C.value,U=I+C.value;return we.value.slice(I,U)});function Ne(I,U){f("row-click",I,U)}const De=i.computed(()=>{let I=h.columns.length;return h.selectable&&I++,h.expandable&&I++,I});i.computed(()=>h.serverSide&&h.total!==void 0?h.total:me.value.length);const tt=i.computed(()=>Array.from({length:h.skeletonRows}));return(I,U)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"tableRef",ref:ne,class:i.normalizeClass(["ui-table",[`ui-table--${t.size}`,{"ui-table--striped":t.striped,"ui-table--hoverable":t.hoverable,"ui-table--bordered":t.bordered,"ui-table--loading":t.loading,"ui-table--sticky-header":t.stickyHeader,"ui-table--resizable":t.resizable,"ui-table--resizing":L.value!==null}]])},[t.searchable?(i.openBlock(),i.createElementBlock("div",_g,[i.createElementVNode("div",yg,[i.createVNode(Jt,{"model-value":fe.value,placeholder:t.searchPlaceholder,size:"sm",type:"search","onUpdate:modelValue":xe},i.createSlots({left:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(d)),{class:"ui-table__search-icon"}))]),_:2},[fe.value?{name:"right",fn:i.withCtx(()=>[i.createElementVNode("button",{type:"button",class:"ui-table__search-clear","aria-label":"Clear search",onClick:F},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(u)),{class:"ui-table__search-clear-icon"}))])]),key:"0"}:void 0]),1032,["model-value","placeholder"])]),i.renderSlot(I.$slots,"toolbar",{},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",kg,[i.createElementVNode("table",{class:"ui-table__table","aria-busy":t.loading||void 0},[i.createElementVNode("thead",wg,[i.createElementVNode("tr",Cg,[t.expandable?(i.openBlock(),i.createElementBlock("th",Bg,[...U[2]||(U[2]=[i.createElementVNode("span",{class:"ui-table__header-text sr-only"},"Expand",-1)])])):i.createCommentVNode("",!0),t.selectable?(i.openBlock(),i.createElementBlock("th",Sg,[i.createVNode(Vi,{"model-value":P.value,indeterminate:A.value,size:"sm","aria-label":"Select all rows","onUpdate:modelValue":R},null,8,["model-value","indeterminate"])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.columns,(H,re)=>(i.openBlock(),i.createElementBlock("th",{key:H.key,class:i.normalizeClass(["ui-table__header-cell",[`ui-table__header-cell--${H.align||"left"}`,{"ui-table__header-cell--sortable":H.sortable,"ui-table__header-cell--sorted":m.value.key===H.key,"ui-table__header-cell--resizable":t.resizable&&H.resizable!==!1}]]),style:i.normalizeStyle(he(H)?{width:he(H)}:void 0),"aria-sort":H.sortable?m.value.key===H.key?m.value.direction==="asc"?"ascending":m.value.direction==="desc"?"descending":"none":"none":void 0,tabindex:H.sortable?0:void 0,role:H.sortable?"button":void 0,onClick:te=>ee(H),onKeydown:te=>ge(te,H)},[i.createElementVNode("div",Mg,[i.renderSlot(I.$slots,`header-${H.key}`,{column:H},()=>[i.createElementVNode("span",vg,i.toDisplayString(H.label),1)],!0),H.sortable?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["ui-table__sort-icon",{"ui-table__sort-icon--asc":m.value.key===H.key&&m.value.direction==="asc","ui-table__sort-icon--desc":m.value.key===H.key&&m.value.direction==="desc"}]),"aria-hidden":"true"},[m.value.key!==H.key||!m.value.direction?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(l)),{key:0,class:"ui-table__sort-svg ui-table__sort-svg--neutral"})):m.value.direction==="asc"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(a)),{key:1,class:"ui-table__sort-svg"})):(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(s)),{key:2,class:"ui-table__sort-svg"}))],2)):i.createCommentVNode("",!0)]),t.resizable&&H.resizable!==!1&&re<t.columns.length-1?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-table__resize-handle",onMousedown:te=>Ae(te,H)},null,40,Vg)):i.createCommentVNode("",!0)],46,Eg))),128))]),t.filterable&&ce.value.length>0?(i.openBlock(),i.createElementBlock("tr",Dg,[t.expandable?(i.openBlock(),i.createElementBlock("th",$g)):i.createCommentVNode("",!0),t.selectable?(i.openBlock(),i.createElementBlock("th",Tg)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.columns,H=>(i.openBlock(),i.createElementBlock("th",{key:`filter-${H.key}`,class:"ui-table__filter-cell"},[H.filterable!==!1?(i.openBlock(),i.createBlock(Jt,{key:0,"model-value":be.value[H.key]||"",placeholder:`Filter ${H.label}...`,size:"sm","onUpdate:modelValue":re=>v(H.key,String(re??""))},null,8,["model-value","placeholder","onUpdate:modelValue"])):i.createCommentVNode("",!0)]))),128))])):i.createCommentVNode("",!0)]),i.createElementVNode("tbody",Ig,[t.loading?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(tt.value,(H,re)=>(i.openBlock(),i.createElementBlock("tr",{key:`skeleton-${re}`,class:"ui-table__row ui-table__row--skeleton"},[t.expandable?(i.openBlock(),i.createElementBlock("td",Lg,[i.createVNode(wi,{variant:"rect",width:16,height:16})])):i.createCommentVNode("",!0),t.selectable?(i.openBlock(),i.createElementBlock("td",zg,[i.createVNode(wi,{variant:"rect",width:16,height:16})])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.columns,(te,Pe)=>(i.openBlock(),i.createElementBlock("td",{key:te.key,class:i.normalizeClass(["ui-table__cell",[`ui-table__cell--${te.align||"left"}`]])},[i.createVNode(wi,{variant:"text",width:o(re,Pe),height:16},null,8,["width"])],2))),128))]))),128)):le.value.length===0?(i.openBlock(),i.createElementBlock("tr",Ng,[i.createElementVNode("td",{colspan:De.value,class:"ui-table__cell ui-table__cell--empty"},[i.renderSlot(I.$slots,"empty",{},()=>[i.createVNode(El,{title:G.value?"No matching results":t.emptyMessage,description:G.value?"Try adjusting your search or filters":void 0,compact:""},null,8,["title","description"])],!0)],8,Pg)])):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:2},i.renderList(le.value,(H,re)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:$(H)},[i.createElementVNode("tr",{class:i.normalizeClass(["ui-table__row",{"ui-table__row--selected":Q(H),"ui-table__row--clickable":I.$attrs.onRowClick,"ui-table__row--expanded":t.expandable&&V(H)}]),onClick:te=>Ne(H,re)},[t.expandable?(i.openBlock(),i.createElementBlock("td",{key:0,class:"ui-table__cell ui-table__cell--expand",onClick:U[0]||(U[0]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("button",{type:"button",class:i.normalizeClass(["ui-table__expand-button",{"ui-table__expand-button--expanded":V(H)}]),"aria-expanded":V(H),"aria-label":V(H)?"Collapse row":"Expand row",onClick:te=>Z(H)},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(V(H)?i.unref(c):i.unref(r)),{class:"ui-table__expand-icon"}))],10,Rg)])):i.createCommentVNode("",!0),t.selectable?(i.openBlock(),i.createElementBlock("td",{key:1,class:"ui-table__cell ui-table__cell--checkbox",onClick:U[1]||(U[1]=i.withModifiers(()=>{},["stop"]))},[i.createVNode(Vi,{"model-value":Q(H),size:"sm","aria-label":`Select row ${re+1}`,"onUpdate:modelValue":te=>q(H,te)},null,8,["model-value","aria-label","onUpdate:modelValue"])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.columns,te=>(i.openBlock(),i.createElementBlock("td",{key:te.key,class:i.normalizeClass(["ui-table__cell",[`ui-table__cell--${te.align||"left"}`]]),"data-label":te.label,style:i.normalizeStyle(he(te)?{width:he(te)}:void 0)},[i.renderSlot(I.$slots,`cell-${te.key}`,{value:K(H,te.key),row:H,column:te,index:re},()=>[i.createTextVNode(i.toDisplayString(K(H,te.key)??""),1)],!0)],14,Og))),128))],10,Ag),t.expandable&&V(H)?(i.openBlock(),i.createElementBlock("tr",{key:`expanded-${$(H)}`,class:"ui-table__row ui-table__row--expansion"},[i.createElementVNode("td",{colspan:De.value,class:"ui-table__cell ui-table__cell--expansion"},[i.renderSlot(I.$slots,"expanded",{row:H,index:re},()=>[i.createElementVNode("div",Wg,[i.createElementVNode("pre",null,i.toDisplayString(JSON.stringify(H,null,2)),1)])],!0)],8,Fg)])):i.createCommentVNode("",!0)],64))),128))])],8,xg)]),g.value&&x.value>0?(i.openBlock(),i.createElementBlock("div",Hg,[i.createElementVNode("div",jg,[i.createVNode(vo,{size:"sm",muted:""},{default:i.withCtx(()=>[i.createTextVNode(" Showing "+i.toDisplayString(N.value)+" to "+i.toDisplayString(T.value)+" of "+i.toDisplayString(y.value)+" results ",1)]),_:1})]),i.createElementVNode("div",Yg,[i.createElementVNode("div",Ug,[i.createVNode(vo,{size:"sm",muted:"",as:"label",for:`${i.unref(p)}-page-size`},{default:i.withCtx(()=>[...U[3]||(U[3]=[i.createTextVNode(" Rows per page ",-1)])]),_:1},8,["for"]),i.createVNode(Vl,{id:`${i.unref(p)}-page-size`,"model-value":C.value,options:M.value,size:"sm","onUpdate:modelValue":w},null,8,["id","model-value","options"])]),i.createVNode(vl,{"model-value":B.value,total:y.value,"page-size":C.value,"sibling-count":b.value.siblingCount??1,"show-edges":b.value.showEdges??!0,size:t.size==="lg"?"lg":t.size==="sm"?"sm":"md","onUpdate:modelValue":S},null,8,["model-value","total","page-size","sibling-count","show-edges","size"])])])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-7c8fff0a"]]);function $l(t,e){const n=[],a=new Date(t,e,1).getDay(),s=new Date(t,e,1-a);for(let l=0;l<42;l++){const r=new Date(s);r.setDate(s.getDate()+l),n.push({date:r,day:r.getDate(),currentMonth:r.getMonth()===e})}return n}function Kg(t,e){return new Date(t,e+1,0).getDate()}function Bt(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${o}`}function ft(t){if(!t||!/^\d{4}-\d{2}-\d{2}$/.test(t))return null;const[e,n,o]=t.split("-").map(Number),a=new Date(e,n-1,o);return a.getFullYear()!==e||a.getMonth()!==n-1||a.getDate()!==o?null:a}function mt(t,e){return!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}function Tl(t,e){const n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),o=new Date(e.getFullYear(),e.getMonth(),e.getDate());return n.getTime()<o.getTime()}function Il(t,e){const n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),o=new Date(e.getFullYear(),e.getMonth(),e.getDate());return n.getTime()>o.getTime()}function Ll(t,e){return new Date(2e3,t,1).toLocaleDateString(e,{month:"long"})}function zl(t){const e=[],n=new Date(2024,0,7);for(let o=0;o<7;o++){const a=new Date(n);a.setDate(n.getDate()+o),e.push(a.toLocaleDateString(t,{weekday:"short"}))}return e}function Ci(t,e,n){return!(e&&Tl(t,e)||n&&Il(t,n))}function qg(t,e,n){if(!e||!n)return!1;const o=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),a=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),s=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime();return o>Math.min(a,s)&&o<Math.max(a,s)}function Vo(t,e,n,o){if(!e)return null;const a=n||o;if(!a)return mt(t,e)?"start":null;const s=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),l=new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime(),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),c=Math.min(s,l),d=Math.max(s,l);return r===c?"start":r===d?"end":r>c&&r<d?"in-range":null}function Do(t,e){const n=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime(),o=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();return n<=o?[t,e]:[e,t]}function Nl(t){const e=[];for(let n=0;n<12;n++){const o=new Date(2e3,n,1);e.push(o.toLocaleDateString(t,{month:"short"}))}return e}function Pl(t){const e=Math.floor(t/20)*20;return Array.from({length:20},(n,o)=>e+o)}function Gg(t){const e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate());switch(t){case"today":return[n,n];case"yesterday":{const o=new Date(n);return o.setDate(o.getDate()-1),[o,o]}case"last7days":{const o=new Date(n);return o.setDate(o.getDate()-6),[o,n]}case"last30days":{const o=new Date(n);return o.setDate(o.getDate()-29),[o,n]}case"thisMonth":{const o=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,0);return[o,a]}case"lastMonth":{const o=new Date(e.getFullYear(),e.getMonth()-1,1),a=new Date(e.getFullYear(),e.getMonth(),0);return[o,a]}case"thisYear":{const o=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),11,31);return[o,a]}default:return[n,n]}}const Jg=["for"],Zg={key:0,class:"ui-datepicker-field__required","aria-hidden":"true"},Qg=["id","value","placeholder","disabled","aria-describedby","aria-invalid"],eb=["id","aria-controls","aria-describedby","aria-invalid","aria-disabled"],tb={class:"ui-datepicker-trigger__value"},nb=["name","value","required"],ib=["name","value"],ob=["name","value"],ab={key:0,class:"ui-datepicker-sidebar"},sb={class:"ui-datepicker",role:"application","aria-label":"Date picker"},lb={class:"ui-datepicker__header"},rb={key:0,class:"ui-datepicker__year-grid"},cb=["disabled","onClick"],db={key:1,class:"ui-datepicker__month-grid"},ub=["disabled","onClick"],hb={class:"ui-datepicker__weekdays",role:"row"},fb=["abbr"],mb=["id","aria-label"],pb=["disabled","aria-selected","aria-current","aria-disabled","tabindex","onClick","onMouseenter"],gb={key:0,class:"ui-datepicker__hint"},bb=["id","aria-expanded","aria-controls","aria-describedby","aria-invalid","aria-disabled"],_b={class:"ui-datepicker-trigger__value"},yb=["name","value","required"],kb=["name","value"],xb=["name","value"],wb={class:"ui-datepicker-sheet",role:"dialog","aria-modal":"true","aria-label":"Date picker"},Cb={class:"ui-datepicker-sheet__header"},Bb={class:"ui-datepicker-sheet__title"},Sb={key:0,class:"ui-datepicker-sheet__presets"},Eb={class:"ui-datepicker ui-datepicker--mobile"},Mb={class:"ui-datepicker__header"},vb={key:0,class:"ui-datepicker__year-grid ui-datepicker__year-grid--mobile"},Vb=["disabled","onClick"],Db={key:1,class:"ui-datepicker__month-grid ui-datepicker__month-grid--mobile"},$b=["disabled","onClick"],Tb={class:"ui-datepicker__weekdays",role:"row"},Ib=["abbr"],Lb=["id","aria-label"],zb=["disabled","aria-selected","aria-current","aria-disabled","tabindex","onClick"],Nb={key:0,class:"ui-datepicker__hint"},Pb=["id"],Ab=["id"],Rb=O(i.defineComponent({__name:"DatePicker",props:{modelValue:{},mode:{default:"single"},min:{},max:{},label:{},placeholder:{default:"Select date"},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},id:{},name:{},block:{type:Boolean,default:!1},locale:{},formatDisplay:{},formatRangeDisplay:{}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=i.ref(null),l=i.ref(null),r=i.ref(null),c=i.ref(null),d=ye("datepicker"),u=i.computed(()=>o.id||d),h=i.computed(()=>`${u.value}-hint`),f=i.computed(()=>`${u.value}-error`),m=i.computed(()=>`${u.value}-grid`),p=i.computed(()=>{if(o.error)return f.value;if(o.hint)return h.value}),g=ve("calendar"),b=ve("chevronLeft"),_=ve("chevronRight"),k=ve("close"),B=i.ref(!1),C=i.ref(!1),y=i.ref(!1),x=i.ref(""),S=i.ref("");function w(){typeof window>"u"||(B.value=window.matchMedia("(max-width: 640px)").matches,C.value=window.matchMedia("(any-hover: hover)").matches)}w(),i.onMounted(()=>{window.addEventListener("resize",w)}),i.onUnmounted(()=>{window.removeEventListener("resize",w)});const M=i.ref(new Date),N=new Date,T=i.ref("day"),$=i.ref("idle"),K=i.ref(null),P=i.ref(null),A=i.computed(()=>o.mode==="range"?null:ft(o.modelValue||"")),R=i.computed(()=>{if(o.mode!=="range")return{start:null,end:null};const z=o.modelValue;return!z||!Array.isArray(z)?{start:null,end:null}:{start:ft(z[0]||""),end:ft(z[1]||"")}}),q=i.computed(()=>ft(o.min||"")),Q=i.computed(()=>ft(o.max||"")),ee=i.computed(()=>M.value.getFullYear()),ge=i.computed(()=>M.value.getMonth()),fe=i.computed(()=>Ll(ge.value,o.locale)),be=i.computed(()=>zl(o.locale)),xe=i.computed(()=>Nl(o.locale)),F=i.computed(()=>Pl(ee.value)),v=i.computed(()=>{const z=F.value;return`${z[0]}–${z[z.length-1]}`}),D=i.computed(()=>$l(ee.value,ge.value)),G=i.computed(()=>{if(o.mode==="range"){const{start:z,end:Y}=R.value;if(!z||!Y)return"";if(o.formatRangeDisplay)return o.formatRangeDisplay(z,Y);const oe={month:"short",day:"numeric"},_e=z.toLocaleDateString(o.locale,oe),J=Y.toLocaleDateString(o.locale,{...oe,year:"numeric"});return`${_e} – ${J}`}return A.value?o.formatDisplay?o.formatDisplay(A.value):A.value.toLocaleDateString(o.locale,{year:"numeric",month:"short",day:"numeric"}):""}),ce=i.computed(()=>o.mode==="range"?R.value.start!==null&&R.value.end!==null:A.value!==null),ze=i.computed(()=>{if(T.value==="year")return!0;if(T.value==="month")return q.value?ee.value>q.value.getFullYear():!0;if(!q.value)return!0;const z=new Date(ee.value,ge.value,1),Y=new Date(q.value.getFullYear(),q.value.getMonth(),1);return z>Y}),L=i.computed(()=>{if(T.value==="year")return!0;if(T.value==="month")return Q.value?ee.value<Q.value.getFullYear():!0;if(!Q.value)return!0;const z=new Date(ee.value,ge.value,1),Y=new Date(Q.value.getFullYear(),Q.value.getMonth(),1);return z<Y});i.watch(()=>o.modelValue,z=>{if(o.mode==="range"){const Y=z;if(Y&&Array.isArray(Y)&&Y[0]){const oe=ft(Y[0]);oe&&(M.value=new Date(oe))}}else{const Y=ft(z||"");Y&&(M.value=new Date(Y))}},{immediate:!0});function j(z){const Y=new Date(M.value);Y.setMonth(Y.getMonth()+z),M.value=Y}function X(z){const Y=new Date(M.value);Y.setFullYear(Y.getFullYear()+z),M.value=Y}function ne(z){const Y=new Date(M.value);Y.setFullYear(Y.getFullYear()+z*20),M.value=Y}function he(){ze.value&&(T.value==="year"?ne(-1):T.value==="month"?X(-1):j(-1))}function Ae(){L.value&&(T.value==="year"?ne(1):T.value==="month"?X(1):j(1))}function Re(){T.value==="day"?T.value="year":(T.value,T.value="day")}function Ye(z){M.value=new Date(z,ge.value,1),T.value="month"}function V(z){M.value=new Date(ee.value,z,1),T.value="day"}function Z(z){return!!(q.value&&z<q.value.getFullYear()||Q.value&&z>Q.value.getFullYear())}function Te(z){return!!(q.value&&(ee.value<q.value.getFullYear()||ee.value===q.value.getFullYear()&&z<q.value.getMonth())||Q.value&&(ee.value>Q.value.getFullYear()||ee.value===Q.value.getFullYear()&&z>Q.value.getMonth()))}function me(z){if(Ci(z.date,q.value,Q.value))if(o.mode==="range")if($.value==="idle")$.value="selecting",K.value=z.date;else{const[Y,oe]=Do(K.value,z.date);a("update:modelValue",[Bt(Y),Bt(oe)]),$.value="idle",K.value=null,P.value=null,te()}else a("update:modelValue",Bt(z.date)),te()}function we(z,Y){if(o.mode==="range"){const[oe,_e]=Do(z,Y);a("update:modelValue",[Bt(oe),Bt(_e)]),te()}}function le(z){o.mode==="range"&&$.value==="selecting"&&(P.value=z.date)}function Ne(){o.mode==="range"&&(P.value=null)}function De(z){return!Ci(z.date,q.value,Q.value)}function tt(z){if(o.mode==="range"){const{start:Y,end:oe}=R.value;return mt(z.date,Y)||mt(z.date,oe)}return mt(z.date,A.value)}function I(z){return mt(z.date,N)}function U(z){if(o.mode!=="range")return null;if($.value==="selecting"&&K.value)return Vo(z.date,K.value,null,P.value);const{start:Y,end:oe}=R.value;return Vo(z.date,Y,oe,null)}function H(z){if(!l.value||T.value!=="day")return;const Y=Array.from(l.value.querySelectorAll(".ui-datepicker__day:not([disabled])")),oe=Y.findIndex(J=>J===document.activeElement);if(oe===-1)return;let _e=-1;switch(z.key){case"ArrowLeft":z.preventDefault(),_e=oe>0?oe-1:Y.length-1;break;case"ArrowRight":z.preventDefault(),_e=oe<Y.length-1?oe+1:0;break;case"ArrowUp":for(z.preventDefault(),_e=oe>=7?oe-7:oe+35;_e>=Y.length;)_e-=7;break;case"ArrowDown":for(z.preventDefault(),_e=oe+7<Y.length?oe+7:oe-35;_e<0;)_e+=7;break;case"Home":z.preventDefault(),_e=0;break;case"End":z.preventDefault(),_e=Y.length-1;break;case"Escape":z.preventDefault(),te();return}_e>=0&&_e<Y.length&&Y[_e].focus()}function re(){var z;if(!o.disabled){if(T.value="day",$.value="idle",K.value=null,P.value=null,S.value="",o.mode==="range"){const{start:Y}=R.value;M.value=Y?new Date(Y):new Date,x.value=""}else M.value=A.value?new Date(A.value):new Date,x.value=A.value?Bt(A.value):"";B.value?(y.value=!0,document.body.style.overflow="hidden",i.nextTick(()=>Ft())):(z=s.value)==null||z.open()}}function te(){var z,Y;T.value="day",$.value="idle",K.value=null,P.value=null,S.value="",B.value?(y.value=!1,document.body.style.overflow="",(z=r.value)==null||z.focus()):(Y=s.value)==null||Y.close()}function Pe(){i.nextTick(()=>Ft())}function $n(){T.value="day",$.value="idle",K.value=null,P.value=null,S.value=""}function Ft(){var _e,J,Be,Wt;if(T.value!=="day")return;const z=(_e=l.value)==null?void 0:_e.querySelector(".ui-datepicker__day--selected, .ui-datepicker__day--range-start"),Y=(J=l.value)==null?void 0:J.querySelector(".ui-datepicker__day--today"),oe=(Be=l.value)==null?void 0:Be.querySelector(".ui-datepicker__day:not([disabled])");(Wt=z||Y||oe)==null||Wt.focus()}function d0(z){z.target.classList.contains("ui-datepicker-sheet__overlay")&&te()}function u0(){y.value?te():re()}function jl(z){(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),re())}function h0(){y.value||re()}function f0(z){const Y=z.target;x.value=Y.value}function m0(z){var _e;const Y=z.relatedTarget,oe=(_e=l.value)==null?void 0:_e.closest(".ui-popover__content");oe&&Y&&oe.contains(Y)||Yl(!1)}function p0(z){z.key==="Enter"?(z.preventDefault(),Yl(!0)):z.key==="Escape"&&(z.preventDefault(),te())}function Yl(z){if(!x.value){S.value="";return}const Y=ft(x.value);if(!Y){S.value="Invalid date format (use YYYY-MM-DD)";return}if(!Ci(Y,q.value,Q.value)){S.value="Date is outside allowed range";return}S.value="",a("update:modelValue",Bt(Y)),M.value=new Date(Y),z&&te()}const g0={xs:"var(--text-xs)",sm:"var(--text-sm)",md:"var(--text-md)",lg:"var(--text-lg)",xl:"var(--text-xl)"},Ul=i.computed(()=>g0[o.size]);function Xl(){if(o.mode==="range"){const{start:Y}=R.value;if(Y){const oe=D.value.findIndex(_e=>mt(_e.date,Y));if(oe!==-1)return oe}}else if(A.value){const Y=D.value.findIndex(oe=>mt(oe.date,A.value));if(Y!==-1)return Y}const z=D.value.findIndex(Y=>mt(Y.date,N));return z!==-1?z:D.value.findIndex(Y=>Y.currentMonth)}const Kl=i.computed(()=>T.value==="year"?v.value:T.value==="month"?String(ee.value):`${fe.value} ${ee.value}`);return e({open:re,close:te,toggle:()=>y.value||s.value?te():re(),applyPreset:we}),(z,Y)=>{var oe,_e;return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-datepicker-field",[`ui-datepicker-field--${t.size}`,{"ui-datepicker-field--block":t.block,"ui-datepicker-field--disabled":t.disabled,"ui-datepicker-field--error":t.error||S.value}]])},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:u.value,class:"ui-datepicker-field__label"},[i.createTextVNode(i.toDisplayString(t.label)+" ",1),t.required?(i.openBlock(),i.createElementBlock("span",Zg,"*")):i.createCommentVNode("",!0)],8,Jg)):i.createCommentVNode("",!0),B.value?(i.openBlock(),i.createElementBlock("div",{key:2,ref_key:"triggerRef",ref:r,id:u.value,class:i.normalizeClass(["ui-datepicker-trigger",[`ui-datepicker-trigger--${t.size}`,{"ui-datepicker-trigger--disabled":t.disabled,"ui-datepicker-trigger--error":t.error,"ui-datepicker-trigger--has-value":ce.value}]]),role:"combobox","aria-haspopup":"dialog","aria-expanded":y.value,"aria-controls":m.value,"aria-describedby":p.value,"aria-invalid":t.error?"true":void 0,"aria-disabled":t.disabled,tabindex:"0",onClick:u0,onKeydown:jl},[i.createElementVNode("span",_b,i.toDisplayString(G.value||t.placeholder),1),i.createVNode(je,{icon:i.unref(g),size:Ul.value,class:"ui-datepicker-trigger__icon"},null,8,["icon","size"]),t.mode==="single"?(i.openBlock(),i.createElementBlock("input",{key:0,type:"hidden",name:t.name,value:t.modelValue,required:t.required},null,8,yb)):t.name?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("input",{type:"hidden",name:`${t.name}[0]`,value:((oe=t.modelValue)==null?void 0:oe[0])||""},null,8,kb),i.createElementVNode("input",{type:"hidden",name:`${t.name}[1]`,value:((_e=t.modelValue)==null?void 0:_e[1])||""},null,8,xb)],64)):i.createCommentVNode("",!0)],42,bb)):(i.openBlock(),i.createBlock(Ln,{key:1,ref_key:"popoverRef",ref:s,placement:"bottom-start",disabled:t.disabled,width:t.mode==="range"?"auto":308,"close-on-escape":!0,"close-on-click-outside":!0,"trap-focus":!0,onOpen:Pe,onClose:$n},{trigger:i.withCtx(()=>{var J,Be;return[i.createElementVNode("div",{ref_key:"triggerRef",ref:r,class:i.normalizeClass(["ui-datepicker-trigger",[`ui-datepicker-trigger--${t.size}`,{"ui-datepicker-trigger--disabled":t.disabled,"ui-datepicker-trigger--error":t.error||S.value,"ui-datepicker-trigger--has-value":ce.value}]])},[C.value&&t.mode==="single"?(i.openBlock(),i.createElementBlock("input",{key:0,ref_key:"inputRef",ref:c,id:u.value,type:"text",class:"ui-datepicker-trigger__input",value:x.value||G.value,placeholder:t.placeholder,disabled:t.disabled,"aria-describedby":p.value,"aria-invalid":t.error||S.value?"true":void 0,autocomplete:"off",onClick:Y[0]||(Y[0]=i.withModifiers(()=>{},["stop"])),onFocus:h0,onInput:f0,onBlur:m0,onKeydown:p0},null,40,Qg)):(i.openBlock(),i.createElementBlock("div",{key:1,id:u.value,role:"combobox","aria-haspopup":"grid","aria-expanded":!1,"aria-controls":m.value,"aria-describedby":p.value,"aria-invalid":t.error||S.value?"true":void 0,"aria-disabled":t.disabled,tabindex:"0",class:"ui-datepicker-trigger__value-wrapper",onClick:i.withModifiers(re,["stop"]),onKeydown:jl},[i.createElementVNode("span",tb,i.toDisplayString(G.value||t.placeholder),1)],40,eb)),i.createVNode(je,{icon:i.unref(g),size:Ul.value,class:"ui-datepicker-trigger__icon",onClick:i.withModifiers(re,["stop"])},null,8,["icon","size"]),t.mode==="single"?(i.openBlock(),i.createElementBlock("input",{key:2,type:"hidden",name:t.name,value:t.modelValue,required:t.required},null,8,nb)):t.name?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createElementVNode("input",{type:"hidden",name:`${t.name}[0]`,value:((J=t.modelValue)==null?void 0:J[0])||""},null,8,ib),i.createElementVNode("input",{type:"hidden",name:`${t.name}[1]`,value:((Be=t.modelValue)==null?void 0:Be[1])||""},null,8,ob)],64)):i.createCommentVNode("",!0)],2)]}),default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["ui-datepicker-content",{"ui-datepicker-content--with-sidebar":t.mode==="range"&&z.$slots.sidebar}])},[t.mode==="range"&&z.$slots.sidebar?(i.openBlock(),i.createElementBlock("div",ab,[i.renderSlot(z.$slots,"sidebar",{applyPreset:we},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",sb,[i.createElementVNode("div",lb,[i.createVNode(Je,{variant:"ghost",size:"sm","icon-left":i.unref(b),disabled:!ze.value,"aria-label":"Previous",onClick:he},null,8,["icon-left","disabled"]),i.createElementVNode("button",{type:"button",class:"ui-datepicker__title-btn","aria-live":"polite",onClick:Re},i.toDisplayString(Kl.value),1),i.createVNode(Je,{variant:"ghost",size:"sm","icon-left":i.unref(_),disabled:!L.value,"aria-label":"Next",onClick:Ae},null,8,["icon-left","disabled"])]),T.value==="year"?(i.openBlock(),i.createElementBlock("div",rb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(F.value,J=>(i.openBlock(),i.createElementBlock("button",{key:J,type:"button",class:i.normalizeClass(["ui-datepicker__year",{"ui-datepicker__year--selected":J===ee.value,"ui-datepicker__year--current":J===i.unref(N).getFullYear()}]),disabled:Z(J),onClick:Be=>Ye(J)},i.toDisplayString(J),11,cb))),128))])):T.value==="month"?(i.openBlock(),i.createElementBlock("div",db,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(xe.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__month",{"ui-datepicker__month--selected":Be===ge.value,"ui-datepicker__month--current":Be===i.unref(N).getMonth()&&ee.value===i.unref(N).getFullYear()}]),disabled:Te(Be),onClick:Wt=>V(Be)},i.toDisplayString(J),11,ub))),128))])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",hb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(be.value,J=>(i.openBlock(),i.createElementBlock("span",{key:J,class:"ui-datepicker__weekday",role:"columnheader",abbr:J},i.toDisplayString(J),9,fb))),128))]),i.createElementVNode("div",{ref_key:"calendarRef",ref:l,id:m.value,class:"ui-datepicker__grid",role:"grid","aria-label":`${fe.value} ${ee.value}`,onKeydown:H},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(D.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__day",[{"ui-datepicker__day--other-month":!J.currentMonth,"ui-datepicker__day--selected":tt(J),"ui-datepicker__day--today":I(J),"ui-datepicker__day--disabled":De(J)},U(J)?`ui-datepicker__day--range-${U(J)}`:""]]),role:"gridcell",disabled:De(J),"aria-selected":tt(J)||void 0,"aria-current":I(J)?"date":void 0,"aria-disabled":De(J)||void 0,tabindex:Be===Xl()?0:-1,onClick:Wt=>me(J),onMouseenter:Wt=>le(J),onMouseleave:Ne},i.toDisplayString(J.day),43,pb))),128))],40,mb),t.mode==="range"&&$.value==="selecting"?(i.openBlock(),i.createElementBlock("div",gb," Select end date ")):i.createCommentVNode("",!0)],64))])],2)]),_:3},8,["disabled","width"])),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-datepicker-sheet"},{default:i.withCtx(()=>[B.value&&y.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-datepicker-sheet__overlay",onClick:d0},[i.createElementVNode("div",wb,[i.createElementVNode("div",Cb,[i.createElementVNode("span",Bb,i.toDisplayString(t.label||(t.mode==="range"?"Select dates":"Select date")),1),i.createVNode(Je,{variant:"ghost",size:"sm","icon-left":i.unref(k),"aria-label":"Close",onClick:te},null,8,["icon-left"])]),t.mode==="range"&&z.$slots.sidebar?(i.openBlock(),i.createElementBlock("div",Sb,[i.renderSlot(z.$slots,"sidebar",{applyPreset:we},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",Eb,[i.createElementVNode("div",Mb,[i.createVNode(Je,{variant:"ghost",size:"md","icon-left":i.unref(b),disabled:!ze.value,"aria-label":"Previous",onClick:he},null,8,["icon-left","disabled"]),i.createElementVNode("button",{type:"button",class:"ui-datepicker__title-btn","aria-live":"polite",onClick:Re},i.toDisplayString(Kl.value),1),i.createVNode(Je,{variant:"ghost",size:"md","icon-left":i.unref(_),disabled:!L.value,"aria-label":"Next",onClick:Ae},null,8,["icon-left","disabled"])]),T.value==="year"?(i.openBlock(),i.createElementBlock("div",vb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(F.value,J=>(i.openBlock(),i.createElementBlock("button",{key:J,type:"button",class:i.normalizeClass(["ui-datepicker__year",{"ui-datepicker__year--selected":J===ee.value,"ui-datepicker__year--current":J===i.unref(N).getFullYear()}]),disabled:Z(J),onClick:Be=>Ye(J)},i.toDisplayString(J),11,Vb))),128))])):T.value==="month"?(i.openBlock(),i.createElementBlock("div",Db,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(xe.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__month",{"ui-datepicker__month--selected":Be===ge.value,"ui-datepicker__month--current":Be===i.unref(N).getMonth()&&ee.value===i.unref(N).getFullYear()}]),disabled:Te(Be),onClick:Wt=>V(Be)},i.toDisplayString(J),11,$b))),128))])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",Tb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(be.value,J=>(i.openBlock(),i.createElementBlock("span",{key:J,class:"ui-datepicker__weekday",role:"columnheader",abbr:J},i.toDisplayString(J),9,Ib))),128))]),i.createElementVNode("div",{ref_key:"calendarRef",ref:l,id:m.value,class:"ui-datepicker__grid",role:"grid","aria-label":`${fe.value} ${ee.value}`,onKeydown:H},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(D.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__day",[{"ui-datepicker__day--other-month":!J.currentMonth,"ui-datepicker__day--selected":tt(J),"ui-datepicker__day--today":I(J),"ui-datepicker__day--disabled":De(J)},U(J)?`ui-datepicker__day--range-${U(J)}`:""]]),role:"gridcell",disabled:De(J),"aria-selected":tt(J)||void 0,"aria-current":I(J)?"date":void 0,"aria-disabled":De(J)||void 0,tabindex:Be===Xl()?0:-1,onClick:Wt=>me(J)},i.toDisplayString(J.day),11,zb))),128))],40,Lb),t.mode==="range"&&$.value==="selecting"?(i.openBlock(),i.createElementBlock("div",Nb," Select end date ")):i.createCommentVNode("",!0)],64))])])])):i.createCommentVNode("",!0)]),_:3})])),t.error||S.value?(i.openBlock(),i.createElementBlock("p",{key:3,id:f.value,class:"ui-datepicker-field__message ui-datepicker-field__message--error",role:"alert"},i.toDisplayString(t.error||S.value),9,Pb)):t.hint?(i.openBlock(),i.createElementBlock("p",{key:4,id:h.value,class:"ui-datepicker-field__message ui-datepicker-field__message--hint"},i.toDisplayString(t.hint),9,Ab)):i.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-4075d941"]]),Ob=["id","aria-labelledby"],Fb={key:0,class:"ui-drawer__header"},Wb=["id"],Hb={key:1,class:"ui-drawer__footer"},Al='a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',jb=O(i.defineComponent({__name:"Drawer",props:{modelValue:{type:Boolean,default:!1},title:{},variant:{default:"default"},placement:{default:"right"},size:{default:"md"},maskClosable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},forcePlacement:{type:Boolean,default:!1},flush:{type:Boolean,default:!1}},emits:["update:modelValue","open","close"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=i.ref(null),l=ye("drawer"),r=ye("drawer-title"),c=i.computed({get:()=>o.modelValue,set:x=>a("update:modelValue",x)}),d=i.ref(!1);function u(){d.value=window.innerWidth<640}i.onMounted(()=>{u(),window.addEventListener("resize",u)}),i.onUnmounted(()=>{window.removeEventListener("resize",u)});const h=i.computed(()=>o.forcePlacement?o.placement:d.value?"bottom":o.placement),f=i.computed(()=>c.value);Tn(f);function m(x){if(!s.value||x.key!=="Tab")return;const S=s.value.querySelectorAll(Al);if(S.length===0)return;const w=S[0],M=S[S.length-1];x.shiftKey?document.activeElement===w&&(x.preventDefault(),M.focus()):document.activeElement===M&&(x.preventDefault(),w.focus())}function p(){s.value&&i.nextTick(()=>{var S;const x=(S=s.value)==null?void 0:S.querySelector(Al);x==null||x.focus()})}let g=null;function b(){g=document.activeElement,a("open"),i.nextTick(()=>{p(),window.addEventListener("keydown",m)})}function _(){c.value=!1,window.removeEventListener("keydown",m),a("close"),i.nextTick(()=>{g==null||g.focus()})}function k(){o.maskClosable&&_()}function B(x){x.key==="Escape"&&o.closeOnEscape&&(x.preventDefault(),_())}i.watch(c,x=>{x&&b()}),i.onUnmounted(()=>{window.removeEventListener("keydown",m)});const C=i.computed(()=>["ui-drawer__panel",`ui-drawer__panel--${h.value}`,`ui-drawer__panel--${o.variant}`,`ui-drawer__panel--${o.size}`,{"ui-drawer__panel--mobile":d.value&&!o.forcePlacement}]),y=i.computed(()=>`ui-drawer-${h.value}`);return e({close:_}),(x,S)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:y.value},{default:i.withCtx(()=>[c.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ui-drawer",{"ui-drawer--force-placement":t.forcePlacement}]),onKeydown:B},[i.createElementVNode("div",{class:"ui-drawer__backdrop",onClick:k}),i.createElementVNode("div",{ref_key:"drawerRef",ref:s,class:i.normalizeClass(C.value),id:i.unref(l),role:"dialog","aria-modal":"true","aria-labelledby":t.title?i.unref(r):void 0},[t.title||t.showClose||x.$slots.header?(i.openBlock(),i.createElementBlock("header",Fb,[i.renderSlot(x.$slots,"header",{},()=>[t.title?(i.openBlock(),i.createElementBlock("h2",{key:0,id:i.unref(r),class:"ui-drawer__title"},i.toDisplayString(t.title),9,Wb)):i.createCommentVNode("",!0)],!0),t.showClose?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"ui-drawer__close","aria-label":"Close drawer",onClick:_},[...S[0]||(S[0]=[i.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ui-drawer__body",{"ui-drawer__body--flush":t.flush}])},[i.renderSlot(x.$slots,"default",{},void 0,!0)],2),x.$slots.footer?(i.openBlock(),i.createElementBlock("footer",Hb,[i.renderSlot(x.$slots,"footer",{close:_},void 0,!0)])):i.createCommentVNode("",!0)],10,Ob)],34)):i.createCommentVNode("",!0)]),_:3},8,["name"])]))}}),[["__scopeId","data-v-1d7d01d1"]]),Yb=["for"],Ub={key:0,class:"ui-combobox__required","aria-hidden":"true"},Xb=["onClick"],Kb={key:0,class:"ui-combobox__overflow"},qb=["id","value","placeholder","disabled","aria-expanded","aria-controls","aria-activedescendant","aria-invalid","aria-describedby","aria-required"],Gb=["name","multiple","required","disabled"],Jb={key:0,value:"",disabled:""},Zb=["value","selected","disabled"],Qb=["id","aria-labelledby","aria-multiselectable"],e_={key:0,class:"ui-combobox__empty"},t_=["id","aria-selected","aria-disabled","onMouseenter","onClick"],n_={key:0,class:"ui-combobox__checkbox"},i_={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},o_=["innerHTML"],a_={key:1,class:"ui-combobox__check",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},s_=["id"],l_=["id"],r_=O(i.defineComponent({__name:"Combobox",props:{modelValue:{default:null},options:{},multiple:{type:Boolean,default:!1},label:{},placeholder:{default:"Search..."},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},block:{type:Boolean,default:!1},allowCreate:{type:Boolean,default:!1},maxDisplayedChips:{default:3},id:{},name:{}},emits:["update:modelValue","create"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(null),s=i.ref(null),l=i.ref(null),r=i.ref(!1),c=i.ref(""),d=i.ref(-1),u=i.ref(-1),h=ye("combobox"),f=i.computed(()=>n.id||h),m=i.computed(()=>`${f.value}-listbox`),p=i.computed(()=>`${f.value}-hint`),g=i.computed(()=>`${f.value}-error`);function b(F){return`${f.value}-option-${F}`}const _=i.computed(()=>{if(n.error)return g.value;if(n.hint)return p.value}),k=i.computed(()=>n.modelValue===null||n.modelValue===void 0?[]:Array.isArray(n.modelValue)?n.modelValue:[n.modelValue]),B=i.computed(()=>k.value.map(F=>n.options.find(v=>v.value===F)).filter(F=>F!==void 0)),C=i.computed(()=>{const F=c.value.toLowerCase().trim();return F?n.options.filter(v=>v.label.toLowerCase().includes(F)):n.options}),y=i.computed(()=>{if(!n.allowCreate)return!1;const F=c.value.trim();return F?!n.options.some(D=>D.label.toLowerCase()===F.toLowerCase()):!1}),x=i.computed(()=>{if(!(!r.value||d.value<0))return b(d.value)}),S=i.ref({});function w(){if(!a.value)return;const F=a.value.getBoundingClientRect();S.value={position:"fixed",top:`${F.bottom+4}px`,left:`${F.left}px`,minWidth:`${F.width}px`,maxWidth:`${Math.max(F.width,300)}px`}}function M(){n.disabled||r.value||(r.value=!0,w(),d.value=C.value.findIndex(F=>!F.disabled),u.value=-1,document.addEventListener("mousedown",T),window.addEventListener("resize",N),window.addEventListener("scroll",w,!0))}function N(){r.value&&(r.value=!1,d.value=-1,u.value=-1,!n.multiple&&B.value.length>0?c.value=B.value[0].label:n.multiple||(c.value=""),document.removeEventListener("mousedown",T),window.removeEventListener("resize",N),window.removeEventListener("scroll",w,!0))}function T(F){var D,G;const v=F.target;(D=a.value)!=null&&D.contains(v)||(G=l.value)!=null&&G.contains(v)||N()}function $(F){const v=F.target;c.value=v.value,u.value=-1,r.value?(d.value=C.value.findIndex(D=>!D.disabled),i.nextTick(q)):M()}function K(){var F;(F=s.value)==null||F.select(),!r.value&&!n.disabled&&M()}function P(F){var v;if(!F.disabled)if(n.multiple){const D=[...k.value],G=D.indexOf(F.value);G>=0?D.splice(G,1):D.push(F.value),o("update:modelValue",D),c.value="",(v=s.value)==null||v.focus()}else o("update:modelValue",F.value),c.value=F.label,N()}function A(F,v){var G;v==null||v.stopPropagation();const D=k.value.filter(ce=>ce!==F);o("update:modelValue",D.length>0?D:null),(G=s.value)==null||G.focus()}function R(){const F=c.value.trim();F&&(o("create",F),c.value="",n.multiple||N())}function q(){if(!l.value||d.value<0)return;const F=l.value.children[d.value];F==null||F.scrollIntoView({block:"nearest"})}function Q(F){var G,ce;const v=C.value.length;if(v===0)return;let D=d.value;do D=(D+F+v)%v;while((G=C.value[D])!=null&&G.disabled&&D!==d.value);(ce=C.value[D])!=null&&ce.disabled||(d.value=D,i.nextTick(q))}function ee(F){switch(F.key){case"ArrowDown":F.preventDefault(),r.value?Q(1):M();break;case"ArrowUp":F.preventDefault(),r.value?Q(-1):M();break;case"Enter":F.preventDefault(),r.value&&d.value>=0&&C.value[d.value]?P(C.value[d.value]):y.value&&R();break;case"Escape":F.preventDefault(),N();break;case"Backspace":if(n.multiple&&c.value===""&&k.value.length>0){F.preventDefault();const v=k.value.length-1;u.value===v?(A(k.value[v]),u.value=-1):u.value=v}break;case"Home":r.value&&(F.preventDefault(),d.value=C.value.findIndex(v=>!v.disabled),i.nextTick(q));break;case"End":if(r.value){F.preventDefault();for(let v=C.value.length-1;v>=0;v--)if(!C.value[v].disabled){d.value=v;break}i.nextTick(q)}break;case"Tab":N();break}}function ge(F){const v=c.value.trim();if(!v)return F;const D=new RegExp(`(${v.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return F.replace(D,"<mark>$1</mark>")}function fe(F){return k.value.includes(F)}const be=i.computed(()=>n.multiple?B.value.slice(0,n.maxDisplayedChips):[]),xe=i.computed(()=>n.multiple?Math.max(0,B.value.length-n.maxDisplayedChips):0);return i.watch(()=>n.modelValue,F=>{if(!n.multiple&&F!==null&&F!==void 0){const v=n.options.find(D=>D.value===F);v&&(c.value=v.label)}},{immediate:!0}),i.onBeforeUnmount(()=>{document.removeEventListener("mousedown",T),window.removeEventListener("resize",N),window.removeEventListener("scroll",w,!0)}),(F,v)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-combobox",[`ui-combobox--${t.size}`,{"ui-combobox--block":t.block,"ui-combobox--disabled":t.disabled,"ui-combobox--error":t.error,"ui-combobox--open":r.value,"ui-combobox--multiple":t.multiple}]])},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:f.value,class:"ui-combobox__label"},[i.createTextVNode(i.toDisplayString(t.label)+" ",1),t.required?(i.openBlock(),i.createElementBlock("span",Ub,"*")):i.createCommentVNode("",!0)],8,Yb)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"containerRef",ref:a,class:i.normalizeClass(["ui-combobox__trigger",[`ui-combobox__trigger--${t.size}`,{"ui-combobox__trigger--error":t.error,"ui-combobox__trigger--multiple":t.multiple}]]),onClick:v[0]||(v[0]=D=>{var G;return(G=s.value)==null?void 0:G.focus()})},[t.multiple?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(be.value,(D,G)=>(i.openBlock(),i.createElementBlock("span",{key:D.value,class:i.normalizeClass(["ui-combobox__chip",{"ui-combobox__chip--marked":u.value===k.value.indexOf(D.value)}])},[i.createTextVNode(i.toDisplayString(D.label)+" ",1),i.createElementVNode("button",{type:"button",class:"ui-combobox__chip-remove",tabindex:"-1","aria-label":"Remove",onClick:ce=>A(D.value,ce)},[...v[1]||(v[1]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[i.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Xb)],2))),128)),xe.value>0?(i.openBlock(),i.createElementBlock("span",Kb," +"+i.toDisplayString(xe.value),1)):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),i.createElementVNode("input",{id:f.value,ref_key:"inputRef",ref:s,type:"text",role:"combobox",class:"ui-combobox__input",value:c.value,placeholder:t.multiple&&k.value.length>0?"":t.placeholder,disabled:t.disabled,"aria-expanded":r.value,"aria-controls":m.value,"aria-activedescendant":x.value,"aria-invalid":t.error?"true":void 0,"aria-describedby":_.value,"aria-required":t.required,"aria-autocomplete":"list",autocomplete:"off",onInput:$,onFocus:K,onKeydown:ee},null,40,qb),(i.openBlock(),i.createElementBlock("svg",{class:i.normalizeClass(["ui-combobox__chevron",{"ui-combobox__chevron--open":r.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[...v[2]||(v[2]=[i.createElementVNode("path",{d:"M6 9l6 6 6-6"},null,-1)])],2))],2),t.name?(i.openBlock(),i.createElementBlock("select",{key:1,name:t.name,multiple:t.multiple,required:t.required,disabled:t.disabled,class:"ui-combobox__native",tabindex:"-1","aria-hidden":"true"},[t.multiple?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",Jb,i.toDisplayString(t.placeholder),1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.options,D=>(i.openBlock(),i.createElementBlock("option",{key:D.value,value:D.value,selected:fe(D.value),disabled:D.disabled},i.toDisplayString(D.label),9,Zb))),128))],8,Gb)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-combobox-menu"},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("ul",{key:0,id:m.value,ref_key:"listboxRef",ref:l,role:"listbox",class:i.normalizeClass(["ui-combobox__listbox",{"ui-combobox__listbox--multi":t.multiple}]),style:i.normalizeStyle(S.value),"aria-labelledby":f.value,"aria-multiselectable":t.multiple},[C.value.length===0&&!y.value?(i.openBlock(),i.createElementBlock("li",e_," No results found ")):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(C.value,(D,G)=>(i.openBlock(),i.createElementBlock("li",{key:D.value,id:b(G),role:"option",class:i.normalizeClass(["ui-combobox__option",{"ui-combobox__option--selected":fe(D.value),"ui-combobox__option--highlighted":G===d.value,"ui-combobox__option--disabled":D.disabled}]),"aria-selected":fe(D.value),"aria-disabled":D.disabled,onMouseenter:ce=>!D.disabled&&(d.value=G),onClick:ce=>P(D)},[t.multiple?(i.openBlock(),i.createElementBlock("span",n_,[fe(D.value)?(i.openBlock(),i.createElementBlock("svg",i_,[...v[3]||(v[3]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:"ui-combobox__option-label",innerHTML:ge(D.label)},null,8,o_),!t.multiple&&fe(D.value)?(i.openBlock(),i.createElementBlock("svg",a_,[...v[4]||(v[4]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):i.createCommentVNode("",!0)],42,t_))),128)),y.value?(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass(["ui-combobox__option ui-combobox__option--create",{"ui-combobox__option--highlighted":C.value.length===0}]),onClick:R},[v[5]||(v[5]=i.createTextVNode(' Create "',-1)),i.createElementVNode("strong",null,i.toDisplayString(c.value.trim()),1),v[6]||(v[6]=i.createTextVNode('" ',-1))],2)):i.createCommentVNode("",!0)],14,Qb)):i.createCommentVNode("",!0)]),_:1})])),t.error?(i.openBlock(),i.createElementBlock("p",{key:2,id:g.value,class:"ui-combobox__message ui-combobox__message--error",role:"alert"},i.toDisplayString(t.error),9,s_)):t.hint?(i.openBlock(),i.createElementBlock("p",{key:3,id:p.value,class:"ui-combobox__message ui-combobox__message--hint"},i.toDisplayString(t.hint),9,l_)):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1b692de"]]),c_=["id","checked","disabled"],d_={class:"ui-choice-chip__label"},u_=O(i.defineComponent({__name:"ChoiceChip",props:{modelValue:{type:Boolean},value:{},label:{},icon:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=i.inject("choiceChipGroup",null),s=i.computed(()=>a!==null&&n.value!==void 0),l=i.computed(()=>n.disabled||(a==null?void 0:a.disabled)),r=i.computed(()=>{if(s.value&&a&&n.value!==void 0){const u=a.modelValue.value;return Array.isArray(u)?u.includes(n.value):u===n.value}return n.modelValue??!1}),c=ye("chip");function d(){if(!l.value)if(s.value&&a&&n.value!==void 0)a.toggle(n.value);else{const u=!n.modelValue;o("update:modelValue",u),o("change",u)}}return(u,h)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ui-choice-chip",{"ui-choice-chip--selected":r.value,"ui-choice-chip--disabled":l.value}])},[i.createElementVNode("input",{id:i.unref(c),type:"checkbox",checked:r.value,disabled:l.value,class:"ui-choice-chip__input",onChange:d},null,40,c_),h[0]||(h[0]=i.createElementVNode("span",{class:"ui-choice-chip__check","aria-hidden":"true"},[i.createElementVNode("svg",{class:"ui-choice-chip__check-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{d:"M3.5 8.5L6.5 11L12.5 5"})])],-1)),t.icon?(i.openBlock(),i.createBlock(je,{key:0,icon:t.icon,class:"ui-choice-chip__icon"},null,8,["icon"])):i.createCommentVNode("",!0),i.createElementVNode("span",d_,i.toDisplayString(t.label),1)],2))}}),[["__scopeId","data-v-f6532f10"]]),h_=["aria-label","aria-disabled"],f_=O(i.defineComponent({__name:"ChoiceChipGroup",props:{modelValue:{},type:{default:"multiple"},disabled:{type:Boolean,default:!1},label:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e;function a(s){if(n.type==="single"){const l=n.modelValue===s?void 0:s;o("update:modelValue",l),o("change",l)}else{const l=Array.isArray(n.modelValue)?n.modelValue:[],r=l.includes(s)?l.filter(c=>c!==s):[...l,s];o("update:modelValue",r),o("change",r)}}return i.provide("choiceChipGroup",{modelValue:i.toRef(n,"modelValue"),toggle:a,type:n.type,disabled:n.disabled}),(s,l)=>(i.openBlock(),i.createElementBlock("div",{role:"group","aria-label":t.label,"aria-disabled":t.disabled||void 0,class:i.normalizeClass(["ui-choice-chip-group",{"ui-choice-chip-group--disabled":t.disabled}])},[i.renderSlot(s.$slots,"default",{},void 0,!0)],10,h_))}}),[["__scopeId","data-v-3bf6d709"]]),m_=["for"],p_=["aria-disabled","aria-describedby"],g_=["id","accept","multiple","disabled"],b_={class:"ui-file-upload__content"},__={class:"ui-file-upload__text"},y_={key:0,class:"ui-file-upload__drop-text"},k_={key:0,class:"ui-file-upload__secondary-text"},x_={key:0,class:"ui-file-upload__paste-indicator"},w_={key:1,class:"ui-file-upload__list",role:"list"},C_={class:"ui-file-upload__file-preview"},B_=["src","alt"],S_=["data-type"],E_={class:"ui-file-upload__file-info"},M_={class:"ui-file-upload__file-name"},v_={class:"ui-file-upload__file-meta"},V_={class:"ui-file-upload__file-error"},D_={key:0,class:"ui-file-upload__progress"},$_={class:"ui-file-upload__file-status"},T_={key:0,class:"ui-file-upload__status-icon ui-file-upload__status-icon--success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},I_={key:1,class:"ui-file-upload__status-icon ui-file-upload__status-icon--error",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},L_={key:2,class:"ui-file-upload__spinner"},z_={key:0,class:"ui-file-upload__actions"},N_=["id"],P_=["id"],A_=O(i.defineComponent({__name:"FileUpload",props:{modelValue:{default:()=>[]},accept:{},multiple:{type:Boolean,default:!1},maxSize:{},maxFiles:{},disabled:{type:Boolean,default:!1},label:{},hint:{},error:{},showPreviews:{type:Boolean,default:!0},compact:{type:Boolean,default:!1},allowPaste:{type:Boolean,default:!0}},emits:["update:modelValue","files-added","file-removed","file-rejected","files-pasted","file-replaced"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=i.ref(null),l=i.ref(null),r=i.ref(null),c=i.ref(!1),d=i.ref(0),u=i.ref(!1),h=i.ref(!1),f=i.ref(!1),m=ye("file-upload"),p=i.computed(()=>m),g=i.computed(()=>`${m}-hint`),b=i.computed(()=>`${m}-error`),_=i.computed(()=>{if(o.error)return b.value;if(o.hint)return g.value}),k=i.ref(new Map);function B(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function C(L){if(L===0)return"0 B";const j=1024,X=["B","KB","MB","GB"],ne=Math.floor(Math.log(L)/Math.log(j));return`${parseFloat((L/Math.pow(j,ne)).toFixed(1))} ${X[ne]}`}function y(L){if(!o.accept)return!0;const j=o.accept.split(",").map(X=>X.trim().toLowerCase());for(const X of j){if(X===L.type.toLowerCase())return!0;if(X.endsWith("/*")){const ne=X.slice(0,-2);if(L.type.toLowerCase().startsWith(ne+"/"))return!0}if(X.startsWith(".")&&L.name.toLowerCase().slice(L.name.lastIndexOf("."))===X)return!0}return!1}function x(L){return y(L)?o.maxSize&&L.size>o.maxSize?`File exceeds maximum size of ${C(o.maxSize)}`:null:`File type "${L.type||"unknown"}" is not accepted`}function S(L){return!o.showPreviews||!L.type.startsWith("image/")?void 0:URL.createObjectURL(L)}function w(L){const j=Array.from(L),X=o.modelValue.length,ne=[];for(const he of j){if(o.maxFiles&&X+ne.length>=o.maxFiles){a("file-rejected",he,`Maximum ${o.maxFiles} files allowed`);continue}const Ae=x(he);if(Ae){a("file-rejected",he,Ae);continue}const Re=B(),Ye=S(he);Ye&&k.value.set(Re,Ye),ne.push({id:Re,file:he,name:he.name,size:he.size,type:he.type,preview:Ye,progress:0,status:"pending"})}if(ne.length>0){const he=o.multiple?[...o.modelValue,...ne]:ne.slice(0,1);a("update:modelValue",he),a("files-added",ne)}return ne}function M(L){const j=L.target;j.files&&j.files.length>0&&(r.value?N(j.files[0]):w(j.files)),j.value="",r.value=null}function N(L){if(!r.value)return;const j=o.modelValue.findIndex(Z=>Z.id===r.value);if(j===-1)return;const X=o.modelValue[j],ne=x(L);if(ne){a("file-rejected",L,ne);return}const he=k.value.get(X.id);he&&(URL.revokeObjectURL(he),k.value.delete(X.id));const Ae=B(),Re=S(L);Re&&k.value.set(Ae,Re);const Ye={id:Ae,file:L,name:L.name,size:L.size,type:L.type,preview:Re,progress:0,status:"pending"},V=[...o.modelValue];V[j]=Ye,a("update:modelValue",V),a("file-replaced",X,Ye)}function T(L){const j=k.value.get(L.id);j&&(URL.revokeObjectURL(j),k.value.delete(L.id));const X=o.modelValue.filter(ne=>ne.id!==L.id);a("update:modelValue",X),a("file-removed",L)}function $(L){var j;o.disabled||(r.value=L.id,(j=s.value)==null||j.click())}function K(){var L;o.disabled||(L=s.value)==null||L.click()}function P(L){(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),K())}function A(L){L.preventDefault(),!o.disabled&&(d.value++,c.value=!0)}function R(L){L.preventDefault()}function q(L){L.preventDefault(),!o.disabled&&(d.value--,d.value===0&&(c.value=!1))}function Q(L){var j;L.preventDefault(),!o.disabled&&(d.value=0,c.value=!1,(j=L.dataTransfer)!=null&&j.files&&L.dataTransfer.files.length>0&&w(L.dataTransfer.files))}function ee(){h.value=!0}function ge(){h.value=!1}function fe(){f.value=!0}function be(){f.value=!1}function xe(L){var ne;if(!o.allowPaste||o.disabled||!h.value&&!f.value)return;const j=(ne=L.clipboardData)==null?void 0:ne.items;if(!j)return;const X=[];for(const he of Array.from(j))if(he.kind==="file"){const Ae=he.getAsFile();Ae&&X.push(Ae)}if(X.length>0){const he=w(X);he.length>0&&(u.value=!0,setTimeout(()=>{u.value=!1},1500),a("files-pasted",he))}}function F(L,j){const X=o.modelValue.find(ne=>ne.id===L);X&&(X.progress=Math.min(100,Math.max(0,j)),X.status==="pending"&&(X.status="uploading"))}function v(L){const j=o.modelValue.find(X=>X.id===L);j&&(j.progress=100,j.status="success")}function D(L,j){const X=o.modelValue.find(ne=>ne.id===L);X&&(X.status="error",X.error=j)}function G(){for(const L of k.value.values())URL.revokeObjectURL(L);k.value.clear(),a("update:modelValue",[])}e({updateProgress:F,markSuccess:v,markError:D,clearAll:G,triggerInput:K,replaceFile:$}),i.onMounted(()=>{o.allowPaste&&document.addEventListener("paste",xe)}),i.watch(()=>o.allowPaste,L=>{L?document.addEventListener("paste",xe):document.removeEventListener("paste",xe)}),i.onBeforeUnmount(()=>{document.removeEventListener("paste",xe);for(const L of k.value.values())URL.revokeObjectURL(L);k.value.clear()}),i.watch(()=>o.modelValue,(L,j)=>{if(!j)return;const X=new Set(L.map(ne=>ne.id));for(const ne of j)if(!X.has(ne.id)){const he=k.value.get(ne.id);he&&(URL.revokeObjectURL(he),k.value.delete(ne.id))}},{deep:!0});const ce=i.computed(()=>o.modelValue.length>0);i.computed(()=>o.modelValue.some(L=>L.status==="uploading"));function ze(L){return L.startsWith("image/")?"image":L.startsWith("video/")?"video":L.startsWith("audio/")?"audio":L==="application/pdf"?"pdf":L.includes("spreadsheet")||L.includes("excel")?"spreadsheet":L.includes("document")||L.includes("word")?"document":L.includes("zip")||L.includes("compressed")?"archive":"file"}return(L,j)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-file-upload",{"ui-file-upload--disabled":t.disabled,"ui-file-upload--error":t.error,"ui-file-upload--compact":t.compact}])},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:p.value,class:"ui-file-upload__label"},i.toDisplayString(t.label),9,m_)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"dropzoneRef",ref:l,class:i.normalizeClass(["ui-file-upload__dropzone",{"ui-file-upload__dropzone--active":c.value,"ui-file-upload__dropzone--disabled":t.disabled,"ui-file-upload__dropzone--error":t.error,"ui-file-upload__dropzone--has-files":ce.value&&!t.compact}]),role:"button",tabindex:"0","aria-disabled":t.disabled,"aria-describedby":_.value,onClick:K,onKeydown:P,onDragenter:A,onDragover:R,onDragleave:q,onDrop:Q,onMouseenter:ee,onMouseleave:ge,onFocus:fe,onBlur:be},[i.createElementVNode("input",{id:p.value,ref_key:"inputRef",ref:s,type:"file",class:"ui-file-upload__input",accept:t.accept,multiple:t.multiple,disabled:t.disabled,tabindex:"-1",onChange:M},null,40,g_),i.createElementVNode("div",b_,[j[1]||(j[1]=i.createElementVNode("div",{class:"ui-file-upload__icon","aria-hidden":"true"},[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[i.createElementVNode("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4","stroke-linecap":"round","stroke-linejoin":"round"}),i.createElementVNode("path",{d:"M3 15v4a2 2 0 002 2h14a2 2 0 002-2v-4","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),i.createElementVNode("div",__,[c.value?(i.openBlock(),i.createElementBlock("span",y_," Drop files here ")):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[j[0]||(j[0]=i.createElementVNode("span",{class:"ui-file-upload__primary-text"},[i.createElementVNode("span",{class:"ui-file-upload__link"},"Click to upload"),i.createTextVNode(" or drag and drop ")],-1)),t.accept||t.maxSize||t.allowPaste?(i.openBlock(),i.createElementBlock("span",k_,[t.accept?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(i.toDisplayString(t.accept),1)],64)):i.createCommentVNode("",!0),t.accept&&(t.maxSize||t.allowPaste)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(" · ")],64)):i.createCommentVNode("",!0),t.maxSize?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createTextVNode("Max "+i.toDisplayString(C(t.maxSize)),1)],64)):i.createCommentVNode("",!0),t.maxSize&&t.allowPaste?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createTextVNode(" · ")],64)):i.createCommentVNode("",!0),t.allowPaste?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[i.createTextVNode("Paste (Ctrl+V)")],64)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],64))])]),i.createVNode(i.Transition,{name:"ui-file-upload-fade"},{default:i.withCtx(()=>[u.value?(i.openBlock(),i.createElementBlock("div",x_,[...j[2]||(j[2]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[i.createElementVNode("path",{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2"}),i.createElementVNode("rect",{x:"9",y:"3",width:"6",height:"4",rx:"1"})],-1),i.createElementVNode("span",null,"Files pasted",-1)])])):i.createCommentVNode("",!0)]),_:1})],42,p_),ce.value?(i.openBlock(),i.createElementBlock("ul",w_,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.modelValue,X=>(i.openBlock(),i.createElementBlock("li",{key:X.id,class:i.normalizeClass(["ui-file-upload__file",{"ui-file-upload__file--uploading":X.status==="uploading","ui-file-upload__file--success":X.status==="success","ui-file-upload__file--error":X.status==="error"}])},[i.createElementVNode("div",C_,[X.preview?(i.openBlock(),i.createElementBlock("img",{key:0,src:X.preview,alt:X.name,class:"ui-file-upload__file-image"},null,8,B_)):(i.openBlock(),i.createElementBlock("div",{key:1,class:"ui-file-upload__file-icon","data-type":ze(X.type)},[...j[3]||(j[3]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[i.createElementVNode("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),i.createElementVNode("polyline",{points:"14 2 14 8 20 8"})],-1)])],8,S_))]),i.createElementVNode("div",E_,[i.createElementVNode("span",M_,i.toDisplayString(X.name),1),i.createElementVNode("span",v_,[i.createTextVNode(i.toDisplayString(C(X.size))+" ",1),X.status==="error"&&X.error?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[j[4]||(j[4]=i.createTextVNode(" · ",-1)),i.createElementVNode("span",V_,i.toDisplayString(X.error),1)],64)):X.status==="success"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[j[5]||(j[5]=i.createTextVNode(" · ",-1)),j[6]||(j[6]=i.createElementVNode("span",{class:"ui-file-upload__file-success"},"Uploaded",-1))],64)):i.createCommentVNode("",!0)]),X.status==="uploading"?(i.openBlock(),i.createElementBlock("div",D_,[i.createElementVNode("div",{class:"ui-file-upload__progress-bar",style:i.normalizeStyle({width:`${X.progress}%`})},null,4)])):i.createCommentVNode("",!0)]),i.createElementVNode("div",$_,[X.status==="success"?(i.openBlock(),i.createElementBlock("svg",T_,[...j[7]||(j[7]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):X.status==="error"?(i.openBlock(),i.createElementBlock("svg",I_,[...j[8]||(j[8]=[i.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),i.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"12"},null,-1),i.createElementVNode("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"},null,-1)])])):X.status==="uploading"?(i.openBlock(),i.createElementBlock("div",L_)):i.createCommentVNode("",!0)]),X.status!=="uploading"?(i.openBlock(),i.createElementBlock("div",z_,[i.createVNode(Je,{variant:"ghost",size:"xs","aria-label":`Replace ${X.name}`,onClick:i.withModifiers(ne=>$(X),["stop"])},{default:i.withCtx(()=>[...j[9]||(j[9]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16"},[i.createElementVNode("path",{d:"M4 12v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l4 4m0 0l-4 4m4-4H9","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),_:1},8,["aria-label","onClick"]),i.createVNode(Je,{variant:"ghost",size:"xs",class:"ui-file-upload__remove-btn","aria-label":`Remove ${X.name}`,onClick:i.withModifiers(ne=>T(X),["stop"])},{default:i.withCtx(()=>[...j[10]||(j[10]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16"},[i.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),_:1},8,["aria-label","onClick"])])):i.createCommentVNode("",!0)],2))),128))])):i.createCommentVNode("",!0),t.error?(i.openBlock(),i.createElementBlock("p",{key:2,id:b.value,class:"ui-file-upload__message ui-file-upload__message--error",role:"alert"},i.toDisplayString(t.error),9,N_)):t.hint?(i.openBlock(),i.createElementBlock("p",{key:3,id:g.value,class:"ui-file-upload__message ui-file-upload__message--hint"},i.toDisplayString(t.hint),9,P_)):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-d7977cee"]]),R_=O(i.defineComponent({__name:"Heading",props:{as:{default:"h2"},size:{default:"2xl"},align:{default:"left"},truncate:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>["ui-heading",`ui-heading--${e.size}`,`ui-heading--${e.align}`,{"ui-heading--truncate":e.truncate}]);return(o,a)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(n.value)},{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-e911d31f"]]),O_={class:"ui-modal__box"},F_={key:0,class:"ui-modal__header"},W_={class:"ui-modal__title"},H_={class:"ui-modal__body"},j_={key:1,class:"ui-modal__footer"},Y_=O(i.defineComponent({__name:"Modal",props:{modelValue:{type:Boolean,default:!1},title:{},size:{default:"md"},persistent:{type:Boolean,default:!1}},emits:["update:modelValue","close"],setup(t,{emit:e}){const n=t,o=e,a=i.useSlots(),s=i.ref(null),l=i.computed(()=>n.modelValue);Tn(l);function r(){o("update:modelValue",!1)}function c(m){n.persistent||m.target===s.value&&r()}function d(m){if(n.persistent){m.preventDefault();return}o("update:modelValue",!1)}function u(){o("update:modelValue",!1),o("close")}function h(m){const p=s.value;p&&(m&&!p.open?p.showModal():!m&&p.open&&p.close())}i.onMounted(()=>{n.modelValue&&h(!0)}),i.watch(()=>n.modelValue,m=>{h(m)});const f=()=>n.title||a.header;return(m,p)=>(i.openBlock(),i.createElementBlock("dialog",{ref_key:"dialogRef",ref:s,class:i.normalizeClass(["ui-modal",[`ui-modal--${t.size}`]]),onClick:c,onCancel:d,onClose:u},[i.createElementVNode("div",O_,[f()?(i.openBlock(),i.createElementBlock("header",F_,[i.renderSlot(m.$slots,"header",{},()=>[i.createElementVNode("h3",W_,i.toDisplayString(t.title),1)],!0),i.createElementVNode("button",{type:"button",class:"ui-modal__close","aria-label":"Close modal",onClick:r},[...p[0]||(p[0]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12"})],-1)])])])):i.createCommentVNode("",!0),i.createElementVNode("div",H_,[i.renderSlot(m.$slots,"default",{},void 0,!0)]),m.$slots.footer?(i.openBlock(),i.createElementBlock("footer",j_,[i.renderSlot(m.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)])],34))}}),[["__scopeId","data-v-527b557c"]]),U_={class:"ui-progress-linear__track"},X_={key:0,class:"ui-progress-linear__value"},K_=["width","height","viewBox"],q_=["cx","cy","r","stroke-width"],G_=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],J_={key:0,class:"ui-progress-circular__value"},Z_=O(i.defineComponent({__name:"Progress",props:{value:{default:0},variant:{default:"linear"},size:{default:"md"},color:{default:"primary"},indeterminate:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1},showValue:{type:Boolean,default:!1},label:{},strokeWidth:{}},setup(t){const e=t,n=i.computed(()=>Math.min(100,Math.max(0,e.value))),o=i.computed(()=>["ui-progress-linear",`ui-progress-linear--${e.size}`,`ui-progress-linear--${e.color}`,{"ui-progress-linear--indeterminate":e.indeterminate,"ui-progress-linear--striped":e.striped&&!e.indeterminate,"ui-progress-linear--animated":e.animated&&e.striped&&!e.indeterminate}]),a=i.computed(()=>["ui-progress-circular",`ui-progress-circular--${e.size}`,`ui-progress-circular--${e.color}`,{"ui-progress-circular--indeterminate":e.indeterminate}]),s=i.computed(()=>({sm:32,md:48,lg:64})[e.size]),l=i.computed(()=>e.strokeWidth?e.strokeWidth:{sm:3,md:4,lg:5}[e.size]),r=i.computed(()=>(s.value-l.value)/2),c=i.computed(()=>2*Math.PI*r.value),d=i.computed(()=>c.value-n.value/100*c.value),u=i.computed(()=>{const f={role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-label":e.label};return e.indeterminate||(f["aria-valuenow"]=n.value),f}),h=i.computed(()=>({width:`${n.value}%`}));return(f,m)=>t.variant==="linear"?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,class:o.value},u.value),[i.createElementVNode("div",U_,[i.createElementVNode("div",{class:"ui-progress-linear__indicator",style:i.normalizeStyle(t.indeterminate?void 0:h.value)},null,4)]),t.showValue&&!t.indeterminate?(i.openBlock(),i.createElementBlock("span",X_,i.toDisplayString(n.value)+"% ",1)):i.createCommentVNode("",!0)],16)):(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:1,class:a.value},u.value),[(i.openBlock(),i.createElementBlock("svg",{width:s.value,height:s.value,viewBox:`0 0 ${s.value} ${s.value}`,class:"ui-progress-circular__svg"},[i.createElementVNode("circle",{class:"ui-progress-circular__track",cx:s.value/2,cy:s.value/2,r:r.value,fill:"none","stroke-width":l.value},null,8,q_),i.createElementVNode("circle",{class:"ui-progress-circular__indicator",cx:s.value/2,cy:s.value/2,r:r.value,fill:"none","stroke-width":l.value,"stroke-dasharray":c.value,"stroke-dashoffset":t.indeterminate?c.value*.75:d.value,"stroke-linecap":"round"},null,8,G_)],8,K_)),t.showValue&&!t.indeterminate?(i.openBlock(),i.createElementBlock("span",J_,i.toDisplayString(n.value)+"% ",1)):i.createCommentVNode("",!0)],16))}}),[["__scopeId","data-v-3da63736"]]),Q_=["id","checked","disabled","name","value"],ey={class:"ui-radio__box","aria-hidden":"true"},ty={key:0,class:"ui-radio__dot"},ny={key:0,class:"ui-radio__content"},iy={key:0,class:"ui-radio__label"},oy={key:1,class:"ui-radio__description"},ay=O(i.defineComponent({__name:"Radio",props:{modelValue:{type:[String,Number,Boolean]},value:{type:[String,Number,Boolean]},size:{default:"md"},disabled:{type:Boolean,default:!1},label:{},description:{},name:{},id:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=ye("radio"),s=i.computed(()=>n.id||a),l=i.computed(()=>n.modelValue===n.value);function r(){n.disabled||(o("update:modelValue",n.value),o("change",n.value))}return(c,d)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ui-radio",[`ui-radio--${t.size}`,{"ui-radio--disabled":t.disabled,"ui-radio--checked":l.value}]])},[i.createElementVNode("input",{id:s.value,type:"radio",checked:l.value,disabled:t.disabled,name:t.name,value:t.value,class:"ui-radio__input",onChange:r},null,40,Q_),i.createElementVNode("span",ey,[l.value?(i.openBlock(),i.createElementBlock("span",ty)):i.createCommentVNode("",!0)]),t.label||t.description?(i.openBlock(),i.createElementBlock("span",ny,[t.label?(i.openBlock(),i.createElementBlock("span",iy,i.toDisplayString(t.label),1)):i.createCommentVNode("",!0),t.description?(i.openBlock(),i.createElementBlock("span",oy,i.toDisplayString(t.description),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-bc19dbee"]]),sy=["aria-label","aria-valuemax","aria-valuenow","aria-readonly","tabindex"],ly=["onMousemove","onClick"],ry=O(i.defineComponent({__name:"Rating",props:{modelValue:{},max:{default:5},readonly:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},size:{default:"md"},label:{default:"Rating"}},emits:["update:modelValue","hover"],setup(t,{emit:e}){const n=ve("star"),o=ve("starFilled"),a=t,s=e,l=i.ref(null),r=i.computed(()=>l.value??a.modelValue);function c(p){const g=r.value;return g>=p?"full":a.allowHalf&&g>=p-.5?"half":"empty"}function d(p,g){if(a.readonly)return;const _=p.currentTarget.getBoundingClientRect(),B=p.clientX-_.left<_.width/2;let C;a.allowHalf&&B?C=g-.5:C=g,l.value=C,s("hover",C)}function u(){l.value=null,s("hover",null)}function h(p,g){if(a.readonly)return;const _=p.currentTarget.getBoundingClientRect(),B=p.clientX-_.left<_.width/2;let C;a.allowHalf&&B?C=g-.5:C=g,s("update:modelValue",C)}function f(p){if(a.readonly)return;const g=a.allowHalf?.5:1;let b=a.modelValue;switch(p.key){case"ArrowRight":case"ArrowUp":p.preventDefault(),b=Math.min(a.modelValue+g,a.max);break;case"ArrowLeft":case"ArrowDown":p.preventDefault(),b=Math.max(a.modelValue-g,0);break;case"Home":p.preventDefault(),b=0;break;case"End":p.preventDefault(),b=a.max;break;default:return}b!==a.modelValue&&s("update:modelValue",b)}const m=i.computed(()=>{switch(a.size){case"sm":return"16px";case"lg":return"28px";default:return"22px"}});return(p,g)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-rating",[`ui-rating--${t.size}`,{"ui-rating--readonly":t.readonly}]]),role:"slider","aria-label":t.label,"aria-valuemin":0,"aria-valuemax":t.max,"aria-valuenow":t.modelValue,"aria-readonly":t.readonly||void 0,tabindex:t.readonly?-1:0,onMouseleave:u,onKeydown:f},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.max,b=>(i.openBlock(),i.createElementBlock("span",{key:b,class:i.normalizeClass(["ui-rating__star",[`ui-rating__star--${c(b)}`]]),onMousemove:_=>d(_,b),onClick:_=>h(_,b)},[i.createVNode(je,{icon:i.unref(n),size:m.value,class:"ui-rating__icon ui-rating__icon--empty"},null,8,["icon","size"]),i.createVNode(je,{icon:i.unref(o),size:m.value,class:"ui-rating__icon ui-rating__icon--filled"},null,8,["icon","size"])],42,ly))),128))],42,sy))}}),[["__scopeId","data-v-200913f2"]]),cy=["id","aria-label","aria-disabled"],dy=["aria-checked","disabled","tabindex","onClick","onKeydown"],uy=["name","value"],hy=O(i.defineComponent({__name:"SegmentedControl",props:{options:{},modelValue:{},size:{default:"md"},disabled:{type:Boolean,default:!1},label:{},name:{},id:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(null),s=i.ref([]),l=ye("segmented"),r=i.computed(()=>n.id||l),c=i.ref({transform:"translateX(0px)",width:"0px",opacity:0}),d=i.computed(()=>n.options.findIndex(p=>p.value===n.modelValue));function u(){const p=d.value;if(p===-1||!s.value[p]){c.value.opacity=0;return}const g=s.value[p],b=a.value;if(!b)return;const _=b.getBoundingClientRect(),B=g.getBoundingClientRect().left-_.left,C=g.offsetWidth;c.value={transform:`translateX(${B}px)`,width:`${C}px`,opacity:1}}i.watch(()=>n.modelValue,()=>{i.nextTick(u)}),i.watch(()=>n.options,()=>{i.nextTick(u)},{deep:!0}),i.onMounted(()=>{requestAnimationFrame(()=>{u()})});function h(p){n.disabled||p.disabled||(o("update:modelValue",p.value),o("change",p.value))}function f(p,g){const b=n.options.map((B,C)=>({opt:B,i:C})).filter(({opt:B})=>!B.disabled),_=b.findIndex(({i:B})=>B===g);if(_===-1)return;let k=-1;switch(p.key){case"ArrowRight":case"ArrowDown":p.preventDefault(),k=b[(_+1)%b.length].i;break;case"ArrowLeft":case"ArrowUp":p.preventDefault(),k=b[(_-1+b.length)%b.length].i;break;case"Home":p.preventDefault(),k=b[0].i;break;case"End":p.preventDefault(),k=b[b.length-1].i;break}k!==-1&&s.value[k]&&(s.value[k].focus(),h(n.options[k]))}function m(p,g){p&&(s.value[g]=p)}return(p,g)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"containerRef",ref:a,id:r.value,role:"radiogroup","aria-label":t.label,"aria-disabled":t.disabled||void 0,class:i.normalizeClass(["ui-segmented",[`ui-segmented--${t.size}`,{"ui-segmented--disabled":t.disabled}]])},[i.createElementVNode("div",{class:"ui-segmented__glider",style:i.normalizeStyle(c.value),"aria-hidden":"true"},null,4),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.options,(b,_)=>(i.openBlock(),i.createElementBlock("button",{key:b.value,ref_for:!0,ref:k=>m(k,_),type:"button",role:"radio","aria-checked":t.modelValue===b.value,disabled:t.disabled||b.disabled,tabindex:t.modelValue===b.value?0:-1,class:i.normalizeClass(["ui-segmented__item",{"ui-segmented__item--selected":t.modelValue===b.value,"ui-segmented__item--disabled":b.disabled}]),onClick:k=>h(b),onKeydown:k=>f(k,_)},i.toDisplayString(b.label),43,dy))),128)),t.name?(i.openBlock(),i.createElementBlock("input",{key:0,type:"hidden",name:t.name,value:t.modelValue},null,8,uy)):i.createCommentVNode("",!0)],10,cy))}}),[["__scopeId","data-v-d2d81e0b"]]);function $o(t,e,n){return n===e?0:(t-e)/(n-e)*100}function fy(t,e,n){return t/100*(n-e)+e}function vn(t,e,n){const o=t-n;return Math.round(o/e)*e+n}function Rt(t,e,n){return Math.min(Math.max(t,e),n)}function Rl(t,e,n,o,a){const s=(t-e.left)/e.width*100,l=Rt(s,0,100),r=fy(l,n,o);return Rt(vn(r,a,n),n,o)}function my(t,e,n){const o=Math.abs(t-e),a=Math.abs(t-n);return o<=a?"min":"max"}const py={key:0,class:"ui-slider__ticks"},gy=["aria-valuemin","aria-valuemax","aria-valuenow","aria-disabled"],by={key:0,class:"ui-slider__tooltip"},_y=["aria-valuemin","aria-valuemax","aria-valuenow","aria-disabled","aria-label"],yy={key:0,class:"ui-slider__tooltip"},ky=O(i.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},showTicks:{type:Boolean,default:!1},size:{default:"md"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(null),s=i.ref(!1),l=i.ref(null),r=i.computed(()=>Array.isArray(n.modelValue)),c=i.computed(()=>r.value?n.modelValue[0]:n.modelValue),d=i.computed(()=>r.value?n.modelValue[1]:n.modelValue),u=i.computed(()=>r.value?$o(c.value,n.min,n.max):0),h=i.computed(()=>$o(d.value,n.min,n.max)),f=i.computed(()=>r.value?{left:`${u.value}%`,right:`${100-h.value}%`}:{left:"0%",right:`${100-h.value}%`}),m=i.computed(()=>{if(!n.showTicks||n.step<=0)return[];const y=[],x=n.max-n.min,S=Math.floor(x/n.step);if(S>100||S<2)return[];for(let w=1;w<S;w++){const M=n.min+w*n.step;y.push($o(M,n.min,n.max))}return y});function p(y,x){r.value?o("update:modelValue",[y,x]):o("update:modelValue",x)}function g(y,x){r.value?o("change",[y,x]):o("change",x)}function b(y,x){if(n.disabled)return;y.preventDefault();const S=a.value;if(!S)return;const w=S.getBoundingClientRect(),M=Rl(y.clientX,w,n.min,n.max,n.step);x?l.value=x:r.value?l.value=my(M,c.value,d.value):l.value="max",s.value=!0,B(M),document.addEventListener("pointermove",_),document.addEventListener("pointerup",k)}function _(y){if(!s.value||!a.value)return;const x=a.value.getBoundingClientRect(),S=Rl(y.clientX,x,n.min,n.max,n.step);B(S)}function k(){s.value&&g(c.value,d.value),s.value=!1,l.value=null,document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",k)}function B(y){if(r.value)if(l.value==="min"){const x=Rt(y,n.min,d.value);p(x,d.value)}else{const x=Rt(y,c.value,n.max);p(c.value,x)}else p(n.min,y)}function C(y,x){if(n.disabled)return;const S=x==="min"?c.value:d.value;let w=S;switch(y.key){case"ArrowRight":case"ArrowUp":y.preventDefault(),w=vn(S+n.step,n.step,n.min);break;case"ArrowLeft":case"ArrowDown":y.preventDefault(),w=vn(S-n.step,n.step,n.min);break;case"Home":y.preventDefault(),w=n.min;break;case"End":y.preventDefault(),w=n.max;break;case"PageUp":y.preventDefault(),w=vn(S+n.step*10,n.step,n.min);break;case"PageDown":y.preventDefault(),w=vn(S-n.step*10,n.step,n.min);break;default:return}r.value?x==="min"?(w=Rt(w,n.min,d.value),p(w,d.value)):(w=Rt(w,c.value,n.max),p(c.value,w)):(w=Rt(w,n.min,n.max),p(n.min,w)),g(c.value,d.value)}return i.onUnmounted(()=>{document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",k)}),(y,x)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-slider",[`ui-slider--${t.size}`,{"ui-slider--disabled":t.disabled,"ui-slider--dragging":s.value,"ui-slider--range":r.value}]])},[i.createElementVNode("div",{ref_key:"trackRef",ref:a,class:"ui-slider__track",onPointerdown:x[4]||(x[4]=S=>b(S))},[i.createElementVNode("div",{class:"ui-slider__range",style:i.normalizeStyle(f.value)},null,4),t.showTicks?(i.openBlock(),i.createElementBlock("div",py,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(m.value,(S,w)=>(i.openBlock(),i.createElementBlock("span",{key:w,class:"ui-slider__tick",style:i.normalizeStyle({left:`${S}%`})},null,4))),128))])):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["ui-slider__thumb",{"ui-slider__thumb--active":l.value==="min"}]),style:i.normalizeStyle({left:`${u.value}%`}),role:"slider",tabindex:"0","aria-valuemin":t.min,"aria-valuemax":d.value,"aria-valuenow":c.value,"aria-disabled":t.disabled||void 0,"aria-label":"Minimum value",onPointerdown:x[0]||(x[0]=i.withModifiers(S=>b(S,"min"),["stop"])),onKeydown:x[1]||(x[1]=S=>C(S,"min"))},[t.showTooltip&&s.value&&l.value==="min"?(i.openBlock(),i.createElementBlock("div",by,i.toDisplayString(c.value),1)):i.createCommentVNode("",!0)],46,gy)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ui-slider__thumb",{"ui-slider__thumb--active":l.value==="max"}]),style:i.normalizeStyle({left:`${h.value}%`}),role:"slider",tabindex:"0","aria-valuemin":r.value?c.value:t.min,"aria-valuemax":t.max,"aria-valuenow":d.value,"aria-disabled":t.disabled||void 0,"aria-label":r.value?"Maximum value":"Value",onPointerdown:x[2]||(x[2]=i.withModifiers(S=>b(S,"max"),["stop"])),onKeydown:x[3]||(x[3]=S=>C(S,"max"))},[t.showTooltip&&s.value&&l.value==="max"?(i.openBlock(),i.createElementBlock("div",yy,i.toDisplayString(d.value),1)):i.createCommentVNode("",!0)],46,_y)],544)],2))}}),[["__scopeId","data-v-55435b60"]]),xy={class:"ui-sidebar-layout__main"},wy=O(i.defineComponent({__name:"SidebarLayout",props:{sidebarPosition:{default:"left"}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-sidebar-layout",[`ui-sidebar-layout--${t.sidebarPosition}`]])},[i.renderSlot(e.$slots,"sidebar",{},void 0,!0),i.createElementVNode("main",xy,[i.renderSlot(e.$slots,"default",{},void 0,!0)])],2))}}),[["__scopeId","data-v-12f99250"]]),Bi=Symbol("sidebar"),Ol=Symbol("sidebar-group"),Cy={key:0,class:"ui-sidebar__header"},By={class:"ui-sidebar__nav"},Sy={key:1,class:"ui-sidebar__footer"},Ey=O(i.defineComponent({__name:"SidebarRoot",props:{modelValue:{type:Boolean,default:!1},expandedWidth:{default:"240px"},collapsedWidth:{default:"64px"}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=i.ref(o.modelValue);i.watch(()=>o.modelValue,u=>{s.value=u});const l=i.computed(()=>o.modelValue!==void 0),r=i.computed(()=>l.value?o.modelValue:s.value),c=i.computed(()=>r.value?o.collapsedWidth:o.expandedWidth);function d(){const u=!r.value;s.value=u,a("update:modelValue",u)}return i.provide(Bi,{collapsed:r,expandedWidth:i.toRef(o,"expandedWidth"),collapsedWidth:i.toRef(o,"collapsedWidth")}),e({toggle:d,collapsed:r}),(u,h)=>(i.openBlock(),i.createElementBlock("aside",{class:i.normalizeClass(["ui-sidebar",{"ui-sidebar--collapsed":r.value}]),style:i.normalizeStyle({"--sidebar-current-width":c.value}),role:"navigation"},[u.$slots.header?(i.openBlock(),i.createElementBlock("div",Cy,[i.renderSlot(u.$slots,"header",{},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("nav",By,[i.renderSlot(u.$slots,"default",{},void 0,!0)]),u.$slots.footer?(i.openBlock(),i.createElementBlock("div",Sy,[i.renderSlot(u.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-765b4324"]]),My=["aria-describedby"],vy=["id"],Fl=O(i.defineComponent({__name:"Tooltip",props:{text:{},placement:{default:"top"},delay:{default:200},offset:{default:8},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=ye("tooltip"),o=i.ref(null),a=i.ref(null),s=i.ref(!1);let l=null,r=null;const{coords:c,updatePosition:d,getPlacement:u}=Wo(o,a,()=>e.placement,e.offset);function h(_){if(!o.value)return;const k=Fo(o.value,_,u(),e.offset);c.value=k}const f=i.computed(()=>({top:`${c.value.top}px`,left:`${c.value.left}px`})),m=i.computed(()=>`ui-tooltip__arrow--${c.value.actualPlacement}`);function p(){e.disabled||(r&&(clearTimeout(r),r=null),l&&clearTimeout(l),l=setTimeout(()=>{s.value=!0},e.delay))}function g(){l&&(clearTimeout(l),l=null),r=setTimeout(()=>{s.value=!1},50)}function b(_){_.key==="Escape"&&s.value&&g()}return i.onUnmounted(()=>{l&&clearTimeout(l),r&&clearTimeout(r)}),(_,k)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",{ref_key:"triggerRef",ref:o,class:"ui-tooltip-trigger","aria-describedby":s.value?i.unref(n):void 0,onMouseenter:p,onMouseleave:g,onFocusin:p,onFocusout:g,onKeydown:b},[i.renderSlot(_.$slots,"default",{},void 0,!0)],40,My),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:`ui-tooltip-${i.unref(c).actualPlacement}`,onEnter:h},{default:i.withCtx(()=>[s.value&&!t.disabled?(i.openBlock(),i.createElementBlock("div",{key:0,id:i.unref(n),ref_key:"contentRef",ref:a,role:"tooltip",class:"ui-tooltip",style:i.normalizeStyle(f.value)},[i.createTextVNode(i.toDisplayString(t.text)+" ",1),i.createElementVNode("span",{class:i.normalizeClass(["ui-tooltip__arrow",m.value])},null,2)],12,vy)):i.createCommentVNode("",!0)]),_:1},8,["name"])]))],64))}}),[["__scopeId","data-v-46895466"]]),Vy={key:0,class:"ui-sidebar-item__icon","aria-hidden":"true"},Dy={class:"ui-sidebar-item__label"},$y={key:1,class:"ui-sidebar-item__badge"},Ty=O(i.defineComponent({__name:"SidebarItem",props:{label:{},icon:{},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},as:{default:"button"},href:{},target:{},to:{}},setup(t){const e=t,n=i.inject(Bi);if(!n)throw new Error("SidebarItem must be used within SidebarRoot");const o=i.computed(()=>n.collapsed.value),a=i.computed(()=>["ui-sidebar-item",{"ui-sidebar-item--active":e.active,"ui-sidebar-item--disabled":e.disabled,"ui-sidebar-item--collapsed":o.value}]),s=i.computed(()=>{const l={class:a.value,disabled:e.disabled||void 0,"aria-current":e.active?"page":void 0,"aria-label":o.value?e.label:void 0};return e.href&&(l.href=e.disabled?void 0:e.href,l.target=e.target),e.to&&(l.to=e.disabled?void 0:e.to),l});return(l,r)=>(i.openBlock(),i.createBlock(Fl,{text:t.label,disabled:!o.value,placement:"right"},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),i.normalizeProps(i.guardReactiveProps(s.value)),{default:i.withCtx(()=>[t.icon?(i.openBlock(),i.createElementBlock("span",Vy,[i.createVNode(je,{icon:t.icon,size:"md"},null,8,["icon"])])):i.createCommentVNode("",!0),i.createElementVNode("span",Dy,i.toDisplayString(t.label),1),l.$slots.badge?(i.openBlock(),i.createElementBlock("span",$y,[i.renderSlot(l.$slots,"badge",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3},16))]),_:3},8,["text","disabled"]))}}),[["__scopeId","data-v-07758eb1"]]),Iy=["id"],Ly=["aria-labelledby"],zy=O(i.defineComponent({__name:"SidebarGroup",props:{label:{},showSeparator:{type:Boolean,default:!0}},setup(t){const e=t,n=i.inject(Bi);if(!n)throw new Error("SidebarGroup must be used within SidebarRoot");const o=ye("sidebar-group"),a=i.computed(()=>n.collapsed.value);i.provide(Ol,{groupId:o});const s=i.computed(()=>["ui-sidebar-group",{"ui-sidebar-group--collapsed":a.value,"ui-sidebar-group--separator":e.showSeparator&&a.value}]);return(l,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(s.value)},[t.label?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-sidebar-group__label",id:i.unref(o)},i.toDisplayString(t.label),9,Iy)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"ui-sidebar-group__content","aria-labelledby":t.label?i.unref(o):void 0,role:"group"},[i.renderSlot(l.$slots,"default",{},void 0,!0)],8,Ly)],2))}}),[["__scopeId","data-v-de5bdf6e"]]),qt=Symbol("stepper"),Vn=Symbol("stepper-item"),Ny=["aria-orientation"],Py=O(i.defineComponent({__name:"StepperRoot",props:{modelValue:{default:0},orientation:{default:"horizontal"},linear:{type:Boolean,default:!1},errorSteps:{default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(n.modelValue),s=i.ref(0),l=i.ref(new Set);i.watch(()=>n.modelValue,m=>{a.value=m});const r=i.computed(()=>n.modelValue!==void 0),c=i.computed(()=>r.value?n.modelValue:a.value);function d(m){h(m)&&(a.value=m,o("update:modelValue",m))}function u(m){return n.errorSteps.includes(m)?"error":m<c.value?"completed":m===c.value?"current":"pending"}function h(m){return n.linear?m<=c.value+1:!0}function f(m){l.value.add(m),s.value=l.value.size}return i.provide(qt,{orientation:i.toRef(n,"orientation"),linear:i.toRef(n,"linear"),currentStep:c,goToStep:d,getStepState:u,canNavigateTo:h,registerStep:f,stepCount:s}),(m,p)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-stepper",[`ui-stepper--${t.orientation}`]]),role:"tablist","aria-orientation":t.orientation},[i.renderSlot(m.$slots,"default",{},void 0,!0)],10,Ny))}}),[["__scopeId","data-v-947638ec"]]),Ay=["data-state"],Ry=O(i.defineComponent({__name:"StepperItem",props:{index:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=i.inject(qt);if(!n)throw new Error("StepperItem must be used within StepperRoot");const o=n,a=ye("stepper-trigger"),s=ye("stepper-content"),l=i.computed(()=>o.getStepState(e.index)),r=i.computed(()=>e.disabled||!o.canNavigateTo(e.index));function c(){r.value||o.goToStep(e.index)}i.onMounted(()=>{o.registerStep(e.index)}),i.provide(Vn,{index:e.index,state:l,isDisabled:r,triggerId:a,contentId:s,goToStep:c});const d=i.computed(()=>["ui-stepper__item",`ui-stepper__item--${o.orientation.value}`,`ui-stepper__item--${l.value}`,{"ui-stepper__item--disabled":r.value}]);return(u,h)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(d.value),"data-state":l.value},[i.renderSlot(u.$slots,"default",{},void 0,!0)],10,Ay))}}),[["__scopeId","data-v-0f21dabd"]]),Oy=["id","aria-selected","aria-controls","aria-disabled","disabled","tabindex"],Fy={class:"ui-stepper__label"},Wy=O(i.defineComponent({__name:"StepperTrigger",props:{icon:{}},setup(t){const e=i.inject(qt),n=i.inject(Vn);if(!e||!n)throw new Error("StepperTrigger must be used within StepperItem");const o=ve("check"),a=i.computed(()=>["ui-stepper__trigger",`ui-stepper__trigger--${n.state.value}`]),s=i.computed(()=>["ui-stepper__indicator",`ui-stepper__indicator--${n.state.value}`]);return(l,r)=>(i.openBlock(),i.createElementBlock("button",{id:i.unref(n).triggerId,class:i.normalizeClass(a.value),type:"button",role:"tab","aria-selected":i.unref(n).state.value==="current","aria-controls":i.unref(n).contentId,"aria-disabled":i.unref(n).isDisabled.value,disabled:i.unref(n).isDisabled.value,tabindex:i.unref(n).state.value==="current"?0:-1,onClick:r[0]||(r[0]=(...c)=>i.unref(n).goToStep&&i.unref(n).goToStep(...c))},[i.createElementVNode("span",{class:i.normalizeClass(s.value)},[i.renderSlot(l.$slots,"indicator",{},()=>[i.unref(n).state.value==="completed"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(o)),{key:0,class:"ui-stepper__check-icon"})):t.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.icon),{key:1,class:"ui-stepper__custom-icon"})):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createTextVNode(i.toDisplayString(i.unref(n).index+1),1)],64))],!0)],2),i.createElementVNode("span",Fy,[i.renderSlot(l.$slots,"default",{},void 0,!0)])],10,Oy))}}),[["__scopeId","data-v-6d18e954"]]),Hy=["id","aria-labelledby","aria-hidden"],jy=O(i.defineComponent({__name:"StepperContent",setup(t){const e=i.inject(qt),n=i.inject(Vn);if(!e||!n)throw new Error("StepperContent must be used within StepperItem");const o=i.computed(()=>n.state.value==="current"),a=i.computed(()=>["ui-stepper__content",`ui-stepper__content--${e.orientation.value}`,{"ui-stepper__content--active":o.value}]);return(s,l)=>i.withDirectives((i.openBlock(),i.createElementBlock("div",{id:i.unref(n).contentId,class:i.normalizeClass(a.value),role:"tabpanel","aria-labelledby":i.unref(n).triggerId,"aria-hidden":!o.value},[i.renderSlot(s.$slots,"default",{},void 0,!0)],10,Hy)),[[i.vShow,o.value]])}}),[["__scopeId","data-v-6e79a9a5"]]),Yy=O(i.defineComponent({__name:"StepperSeparator",setup(t){const e=i.inject(qt),n=i.inject(Vn);if(!e||!n)throw new Error("StepperSeparator must be used within StepperItem");const o=i.computed(()=>n.state.value==="completed"),a=i.computed(()=>["ui-stepper__separator",`ui-stepper__separator--${e.orientation.value}`,{"ui-stepper__separator--completed":o.value}]);return(s,l)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(a.value),"aria-hidden":"true"},null,2))}}),[["__scopeId","data-v-b9092a20"]]),Uy=["id","aria-checked","aria-label","disabled"],Xy={class:"ui-switch__track","aria-hidden":"true"},Ky={class:"ui-switch__thumb"},qy=["name","checked","disabled"],Gy=O(i.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean,default:!1},size:{default:"md"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},label:{},name:{},id:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=ye("switch"),s=i.computed(()=>n.id||a),l=i.computed(()=>n.disabled||n.loading);function r(){if(l.value)return;const h=!n.modelValue;o("update:modelValue",h),o("change",h)}function c(h){h.key==="Enter"&&(h.preventDefault(),r())}const d={sm:"0.625rem",md:"0.75rem",lg:"0.875rem"},u=i.computed(()=>d[n.size]);return(h,f)=>(i.openBlock(),i.createElementBlock("button",{id:s.value,type:"button",role:"switch","aria-checked":t.modelValue,"aria-label":t.label,disabled:l.value,class:i.normalizeClass(["ui-switch",[`ui-switch--${t.size}`,{"ui-switch--checked":t.modelValue,"ui-switch--disabled":l.value,"ui-switch--loading":t.loading}]]),onClick:r,onKeydown:c},[i.createElementVNode("span",Xy,[i.createElementVNode("span",Ky,[t.loading?(i.openBlock(),i.createBlock(In,{key:0,size:u.value,class:"ui-switch__spinner"},null,8,["size"])):i.createCommentVNode("",!0)])]),t.name?(i.openBlock(),i.createElementBlock("input",{key:0,type:"checkbox",name:t.name,checked:t.modelValue,disabled:t.disabled,class:"ui-switch__input",tabindex:"-1","aria-hidden":"true"},null,8,qy)):i.createCommentVNode("",!0)],42,Uy))}}),[["__scopeId","data-v-8f7786c9"]]),Jy={class:"ui-tabs"},Zy=["aria-selected","aria-controls","disabled","tabindex","onClick","onKeydown"],Qy={class:"ui-tabs__panels"},ek=["id"],tk=O(i.defineComponent({__name:"Tabs",props:{modelValue:{},items:{},variant:{default:"line"},block:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(null),s=i.ref([]),l=i.ref({width:"0px",transform:"translateX(0px)"});let r=null;function c(){const f=n.items.findIndex(b=>b.value===n.modelValue);if(f===-1||!s.value[f])return;const m=s.value[f],p=m.offsetWidth,g=m.offsetLeft;l.value={width:`${p}px`,transform:`translateX(${g}px)`}}function d(f){f.disabled||o("update:modelValue",f.value)}function u(f,m){var C;const p=f.key==="ArrowRight",g=f.key==="ArrowLeft",b=f.key==="Home",_=f.key==="End";if(!p&&!g&&!b&&!_)return;f.preventDefault();let k;if(b)k=n.items.findIndex(y=>!y.disabled);else if(_)k=n.items.length-1-[...n.items].reverse().findIndex(y=>!y.disabled);else{const y=p?1:-1;k=m;do k=(k+y+n.items.length)%n.items.length;while(n.items[k].disabled&&k!==m)}const B=n.items[k];B.disabled||((C=s.value[k])==null||C.focus(),o("update:modelValue",B.value))}function h(f,m){f&&(s.value[m]=f)}return i.watch(()=>n.modelValue,async()=>{await i.nextTick(),c()}),i.onMounted(()=>{c(),r=new ResizeObserver(()=>{c()}),a.value&&r.observe(a.value),window.addEventListener("resize",c)}),i.onBeforeUnmount(()=>{r==null||r.disconnect(),window.removeEventListener("resize",c)}),(f,m)=>(i.openBlock(),i.createElementBlock("div",Jy,[i.createElementVNode("div",{ref_key:"tabListRef",ref:a,class:i.normalizeClass(["ui-tabs__list",[`ui-tabs__list--${t.variant}`,{"ui-tabs__list--block":t.block}]]),role:"tablist"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.items,(p,g)=>(i.openBlock(),i.createElementBlock("button",{key:p.value,ref_for:!0,ref:b=>h(b,g),type:"button",role:"tab",class:i.normalizeClass(["ui-tabs__tab",{"ui-tabs__tab--active":t.modelValue===p.value}]),"aria-selected":t.modelValue===p.value,"aria-controls":`tabpanel-${p.value}`,disabled:p.disabled,tabindex:t.modelValue===p.value?0:-1,onClick:b=>d(p),onKeydown:b=>u(b,g)},[p.icon?(i.openBlock(),i.createBlock(je,{key:0,icon:p.icon,size:"sm",class:"ui-tabs__icon"},null,8,["icon"])):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(p.label),1)],42,Zy))),128)),i.createElementVNode("div",{class:"ui-tabs__indicator",style:i.normalizeStyle(l.value),"aria-hidden":"true"},null,4)],2),i.createElementVNode("div",Qy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.items,p=>i.withDirectives((i.openBlock(),i.createElementBlock("div",{key:p.value,id:`tabpanel-${p.value}`,role:"tabpanel",class:"ui-tabs__panel",tabindex:0},[i.renderSlot(f.$slots,p.value,{},void 0,!0)],8,ek)),[[i.vShow,t.modelValue===p.value]])),128))])]))}}),[["__scopeId","data-v-937bd79d"]]),nk=["for"],ik={key:0,class:"ui-textarea-field__required","aria-hidden":"true"},ok={key:0,class:"ui-textarea-wrapper__addon ui-textarea-wrapper__addon--left"},ak=["id","value","name","placeholder","disabled","readonly","required","rows","maxlength","aria-invalid","aria-describedby"],sk={class:"ui-textarea-field__footer"},lk={class:"ui-textarea-field__messages"},rk=["id"],ck=["id"],dk=["id"],uk=O(i.defineComponent({__name:"Textarea",props:{modelValue:{},label:{},placeholder:{},hint:{},error:{},rows:{default:3},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},autosize:{type:Boolean,default:!1},maxHeight:{},maxLength:{},showCount:{type:Boolean,default:!1},iconLeft:{},id:{},name:{},block:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=i.useSlots(),l=i.ref(null),r=ye("textarea"),c=i.computed(()=>o.id||r),d=i.computed(()=>`${c.value}-hint`),u=i.computed(()=>`${c.value}-error`),h=i.computed(()=>`${c.value}-counter`),f=i.computed(()=>{const S=[];return o.error?S.push(u.value):o.hint&&S.push(d.value),o.showCount&&o.maxLength&&S.push(h.value),S.length>0?S.join(" "):void 0}),m=i.computed(()=>o.iconLeft||s.left),p=i.computed(()=>(o.modelValue??"").length),g=i.computed(()=>o.maxLength?p.value>o.maxLength:!1),b=i.computed(()=>o.maxLength?p.value>=o.maxLength*.9:!1),_=i.computed(()=>o.maxLength?`${p.value} / ${o.maxLength}`:`${p.value}`),k=i.computed(()=>g.value?"error":b.value?"warning":"default");function B(){if(!o.autosize||!l.value)return;const S=l.value;S.style.height="auto";let w=S.scrollHeight;o.maxHeight&&w>o.maxHeight?(w=o.maxHeight,S.style.overflowY="auto"):S.style.overflowY="hidden",S.style.height=`${w}px`}function C(S){const w=S.target;a("update:modelValue",w.value),o.autosize&&B()}function y(S){a("focus",S)}function x(S){a("blur",S)}return i.watch(()=>o.modelValue,()=>{o.autosize&&i.nextTick(B)}),i.onMounted(()=>{o.autosize&&i.nextTick(B)}),e({focus:()=>{var S;return(S=l.value)==null?void 0:S.focus()},blur:()=>{var S;return(S=l.value)==null?void 0:S.blur()},select:()=>{var S;return(S=l.value)==null?void 0:S.select()}}),(S,w)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-textarea-field",{"ui-textarea-field--block":t.block,"ui-textarea-field--disabled":t.disabled,"ui-textarea-field--error":t.error||g.value,"ui-textarea-field--readonly":t.readonly}])},[t.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:c.value,class:"ui-textarea-field__label"},[i.createTextVNode(i.toDisplayString(t.label)+" ",1),t.required?(i.openBlock(),i.createElementBlock("span",ik,"*")):i.createCommentVNode("",!0)],8,nk)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ui-textarea-wrapper",{"ui-textarea-wrapper--disabled":t.disabled,"ui-textarea-wrapper--error":t.error||g.value,"ui-textarea-wrapper--readonly":t.readonly,"ui-textarea-wrapper--has-left":m.value,"ui-textarea-wrapper--autosize":t.autosize}])},[m.value?(i.openBlock(),i.createElementBlock("span",ok,[i.renderSlot(S.$slots,"left",{},()=>[t.iconLeft?(i.openBlock(),i.createBlock(je,{key:0,icon:t.iconLeft,size:"var(--text-md)"},null,8,["icon"])):i.createCommentVNode("",!0)],!0)])):i.createCommentVNode("",!0),i.createElementVNode("textarea",{id:c.value,ref_key:"textareaRef",ref:l,value:t.modelValue,name:t.name,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,required:t.required,rows:t.rows,maxlength:t.maxLength,"aria-invalid":t.error||g.value?"true":void 0,"aria-describedby":f.value,class:i.normalizeClass(["ui-textarea-wrapper__textarea",{"ui-textarea-wrapper__textarea--autosize":t.autosize}]),onInput:C,onFocus:y,onBlur:x},null,42,ak)],2),i.createElementVNode("div",sk,[i.createElementVNode("div",lk,[t.error?(i.openBlock(),i.createElementBlock("p",{key:0,id:u.value,class:"ui-textarea-field__message ui-textarea-field__message--error",role:"alert"},i.toDisplayString(t.error),9,rk)):t.hint?(i.openBlock(),i.createElementBlock("p",{key:1,id:d.value,class:"ui-textarea-field__message ui-textarea-field__message--hint"},i.toDisplayString(t.hint),9,ck)):i.createCommentVNode("",!0)]),t.showCount?(i.openBlock(),i.createElementBlock("span",{key:0,id:h.value,class:i.normalizeClass(["ui-textarea-field__counter",`ui-textarea-field__counter--${k.value}`]),"aria-live":"polite"},i.toDisplayString(_.value),11,dk)):i.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-65afca71"]]),To=Symbol("timeline"),hk=O(i.defineComponent({__name:"Timeline",props:{align:{default:"left"},lineStyle:{default:"solid"}},setup(t){const e=t,n=i.ref(0);let o=0;i.onBeforeUpdate(()=>{o=0});function a(){const l=o++;return n.value=Math.max(n.value,l+1),l}i.provide(To,{align:i.toRef(e,"align"),lineStyle:i.toRef(e,"lineStyle"),registerItem:a,itemCount:n});const s=i.computed(()=>["ui-timeline",`ui-timeline--${e.align}`,`ui-timeline--line-${e.lineStyle}`]);return(l,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(s.value),role:"list"},[i.renderSlot(l.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-23e1c9a4"]]),fk={class:"ui-timeline__content"},mk={key:0,class:"ui-timeline__opposite"},pk=O(i.defineComponent({__name:"TimelineItem",props:{dotColor:{default:"primary"},dotIcon:{}},setup(t){const e=t,n=i.inject(To);if(!n)throw new Error("TimelineItem must be used within Timeline");const o=i.ref(-1);i.onMounted(()=>{o.value=n.registerItem()});const a=i.computed(()=>o.value===0),s=i.computed(()=>o.value===n.itemCount.value-1),l=i.computed(()=>n.align.value==="alternate"?o.value%2===0?"left":"right":n.align.value),r=i.computed(()=>["ui-timeline__item",`ui-timeline__item--${n.align.value}`,`ui-timeline__item--position-${l.value}`,{"ui-timeline__item--first":a.value,"ui-timeline__item--last":s.value}]),c=i.computed(()=>["ui-timeline__dot",`ui-timeline__dot--${e.dotColor}`]);return(d,u)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(r.value),role:"listitem"},[i.createElementVNode("div",{class:i.normalizeClass(c.value)},[i.renderSlot(d.$slots,"dot",{},()=>[t.dotIcon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.dotIcon),{key:0,class:"ui-timeline__dot-icon"})):i.createCommentVNode("",!0)],!0)],2),i.createElementVNode("div",fk,[i.renderSlot(d.$slots,"default",{},void 0,!0)]),i.unref(n).align.value==="alternate"?(i.openBlock(),i.createElementBlock("div",mk,[i.renderSlot(d.$slots,"opposite",{},void 0,!0)])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-276adb4d"]]);function Io(t){if(!t||typeof t!="string")return null;const e=t.toLowerCase().replace(/\s+/g,"").trim();if(!e)return null;const n=/p|pm$/.test(e),o=/a|am$/.test(e),a=e.replace(/[ap]m?$/i,"");let s=0,l=0;if(a.includes(":")){const r=a.split(":");s=parseInt(r[0],10),l=parseInt(r[1],10)||0}else{const r=parseInt(a,10);if(isNaN(r))return null;if(r<=12)s=r,l=0;else if(r<=99)s=Math.floor(r/10),l=r%10*10;else if(r<=2359)s=Math.floor(r/100),l=r%100;else return null}return isNaN(s)||isNaN(l)?null:(n&&s<12?s+=12:o&&s===12&&(s=0),s=Math.max(0,Math.min(23,s)),l=Math.max(0,Math.min(59,l)),{hours:s,minutes:l})}function Lo(t,e,n="24h"){const o=Math.max(0,Math.min(23,t)),a=Math.max(0,Math.min(59,e));if(n==="24h")return`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;const s=o>=12?"PM":"AM";return`${(o===0?12:o>12?o-12:o).toString().padStart(2,"0")}:${a.toString().padStart(2,"0")} ${s}`}function Si(t,e,n=1){const o=[];for(let a=t;a<=e;a+=n)o.push(a);return o}function zo(t){const e=t>=12?"PM":"AM";let n=t%12;return n===0&&(n=12),{hour:n,period:e}}function No(t,e){return e==="AM"?t===12?0:t:t===12?12:t+12}function Wl(t){if(!t||typeof t!="string")return!1;const e=t.match(/^(\d{1,2}):(\d{2})$/);if(!e)return!1;const n=parseInt(e[1],10),o=parseInt(e[2],10);return n>=0&&n<=23&&o>=0&&o<=59}const gk={class:"ui-timepicker__panel"},bk={class:"ui-timepicker__columns"},_k=["data-value","onClick"],yk=["data-value","onClick"],kk=["data-value","onClick"],Po=40,xk=5,wk=O(i.defineComponent({__name:"TimePicker",props:{modelValue:{},format:{default:"12h"},minuteStep:{default:1},label:{},placeholder:{},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},id:{},name:{},block:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!0}},emits:["update:modelValue","focus","blur"],setup(t,{expose:e,emit:n}){const o=t,a=n,s=ye("timepicker"),l=i.computed(()=>o.id||s),r=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(""),f=i.ref(12),m=i.ref(0),p=i.ref("AM"),g=i.ref(!1),b=i.ref(null),_=ve("calendar"),k=i.computed(()=>o.format==="12h"?Si(1,12):Si(0,23)),B=i.computed(()=>Si(0,59,o.minuteStep)),C=["AM","PM"],y=Po*xk;function x(){if(o.modelValue&&Wl(o.modelValue)){const v=Io(o.modelValue);if(v){if(o.format==="12h"){const D=zo(v.hours);f.value=D.hour,p.value=D.period}else f.value=v.hours;m.value=S(v.minutes),w()}}}function S(v){return B.value.reduce((G,ce)=>Math.abs(ce-v)<Math.abs(G-v)?ce:G)}function w(){const v=o.format==="12h"?No(f.value,p.value):f.value;h.value=Lo(v,m.value,o.format)}function M(){const v=o.format==="12h"?No(f.value,p.value):f.value,D=Lo(v,m.value,"24h");a("update:modelValue",D)}function N(v){const D=String(v);h.value=D;const G=Io(D);if(G){if(o.format==="12h"){const ce=zo(G.hours);f.value=ce.hour,p.value=ce.period}else f.value=G.hours;m.value=S(G.minutes),M(),K()}}function T(v){w(),a("blur",v)}function $(v){a("focus",v)}function K(){i.nextTick(()=>{P(c.value,f.value,k.value),P(d.value,m.value,B.value),o.format==="12h"&&u.value&&P(u.value,p.value,C)})}function P(v,D,G){if(!v)return;const ce=G.indexOf(D);if(ce===-1)return;const ze=ce*Po;v.scrollTop=ze}function A(v,D,G){if(!v)return()=>{};const ce=v.querySelectorAll("[data-value]");if(ce.length===0)return()=>{};const ze=new IntersectionObserver(L=>{if(!g.value){for(const j of L)if(j.isIntersecting&&j.intersectionRatio>=.5){const X=j.target.getAttribute("data-value");if(X!==null){const ne=isNaN(Number(X))?X:Number(X);G(ne)}}}},{root:v,rootMargin:`-${y/2-Po/2}px 0px`,threshold:.5});return ce.forEach(L=>ze.observe(L)),()=>ze.disconnect()}let R=()=>{},q=()=>{},Q=()=>{};function ee(){R(),q(),Q(),R=A(c.value,k.value,v=>{f.value=v,w(),M()}),q=A(d.value,B.value,v=>{m.value=v,w(),M()}),o.format==="12h"&&(Q=A(u.value,C,v=>{p.value=v,w(),M()}))}function ge(){g.value=!0,b.value&&clearTimeout(b.value),b.value=window.setTimeout(()=>{g.value=!1},150)}function fe(v,D){var G;v==="hour"?(f.value=D,P(c.value,D,k.value)):v==="minute"?(m.value=D,P(d.value,D,B.value)):v==="period"&&(p.value=D,P(u.value,D,C)),w(),M(),o.closeOnSelect&&v==="minute"&&((G=r.value)==null||G.close())}function be(){i.nextTick(()=>{K(),ee()})}function xe(){R(),q(),Q()}function F(v){return v.toString().padStart(2,"0")}return i.watch(()=>o.modelValue,()=>{x()},{immediate:!0}),i.onMounted(()=>{x()}),i.onUnmounted(()=>{R(),q(),Q(),b.value&&clearTimeout(b.value)}),e({open:()=>{var v;return(v=r.value)==null?void 0:v.open()},close:()=>{var v;return(v=r.value)==null?void 0:v.close()},toggle:()=>{var v;return(v=r.value)==null?void 0:v.toggle()}}),(v,D)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-timepicker",[`ui-timepicker--${t.size}`,{"ui-timepicker--block":t.block,"ui-timepicker--disabled":t.disabled}]])},[i.createVNode(Ln,{ref_key:"popoverRef",ref:r,placement:"bottom-start",disabled:t.disabled,"close-on-click-outside":!0,"close-on-escape":!0,"trap-focus":!0,onOpen:be,onClose:xe},{trigger:i.withCtx(()=>[i.createVNode(Jt,{id:l.value,modelValue:h.value,"onUpdate:modelValue":[D[0]||(D[0]=G=>h.value=G),N],label:t.label,placeholder:t.placeholder||(t.format==="12h"?"hh:mm AM/PM":"HH:mm"),hint:t.hint,error:t.error,size:t.size,disabled:t.disabled,required:t.required,name:t.name,block:t.block,"icon-right":i.unref(_),autocomplete:"off",onBlur:T,onFocus:$},null,8,["id","modelValue","label","placeholder","hint","error","size","disabled","required","name","block","icon-right"])]),default:i.withCtx(()=>[i.createElementVNode("div",gk,[i.createElementVNode("div",bk,[D[7]||(D[7]=i.createElementVNode("div",{class:"ui-timepicker__highlight"},null,-1)),i.createElementVNode("div",{ref_key:"hourColumnRef",ref:c,class:"ui-timepicker__column",onScroll:ge},[D[1]||(D[1]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(k.value,G=>(i.openBlock(),i.createElementBlock("div",{key:G,"data-value":G,class:i.normalizeClass(["ui-timepicker__item",{"ui-timepicker__item--selected":G===f.value}]),onClick:ce=>fe("hour",G)},i.toDisplayString(F(G)),11,_k))),128)),D[2]||(D[2]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1))],544),D[8]||(D[8]=i.createElementVNode("div",{class:"ui-timepicker__separator"},":",-1)),i.createElementVNode("div",{ref_key:"minuteColumnRef",ref:d,class:"ui-timepicker__column",onScroll:ge},[D[3]||(D[3]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(B.value,G=>(i.openBlock(),i.createElementBlock("div",{key:G,"data-value":G,class:i.normalizeClass(["ui-timepicker__item",{"ui-timepicker__item--selected":G===m.value}]),onClick:ce=>fe("minute",G)},i.toDisplayString(F(G)),11,yk))),128)),D[4]||(D[4]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1))],544),t.format==="12h"?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"periodColumnRef",ref:u,class:"ui-timepicker__column ui-timepicker__column--period",onScroll:ge},[D[5]||(D[5]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1)),(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(C,G=>i.createElementVNode("div",{key:G,"data-value":G,class:i.normalizeClass(["ui-timepicker__item",{"ui-timepicker__item--selected":G===p.value}]),onClick:ce=>fe("period",G)},i.toDisplayString(G),11,kk)),64)),D[6]||(D[6]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1))],544)):i.createCommentVNode("",!0)])])]),_:1},8,["disabled"])],2))}}),[["__scopeId","data-v-7c4d962e"]]),Ck=["aria-pressed","aria-label","disabled"],Bk={key:1,class:"ui-toggle-button__label"},Sk=O(i.defineComponent({__name:"ToggleButton",props:{modelValue:{type:Boolean},value:{},size:{default:"md"},disabled:{type:Boolean,default:!1},icon:{},label:{}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,a=i.inject("toggleGroup",null),s=i.computed(()=>a!==null&&n.value!==void 0),l=i.computed(()=>(a==null?void 0:a.size)||n.size),r=i.computed(()=>n.disabled||(a==null?void 0:a.disabled)),c=i.computed(()=>{if(s.value&&a&&n.value!==void 0){const h=a.modelValue.value;return Array.isArray(h)?h.includes(n.value):h===n.value}return n.modelValue??!1});function d(){if(!r.value)if(s.value&&a&&n.value!==void 0)a.toggle(n.value);else{const h=!n.modelValue;o("update:modelValue",h),o("change",h)}}const u=i.computed(()=>n.icon&&!n.label);return(h,f)=>(i.openBlock(),i.createElementBlock("button",{type:"button","aria-pressed":c.value,"aria-label":u.value?t.label:void 0,disabled:r.value,class:i.normalizeClass(["ui-toggle-button",[`ui-toggle-button--${l.value}`,{"ui-toggle-button--pressed":c.value,"ui-toggle-button--disabled":r.value,"ui-toggle-button--icon-only":u.value}]]),onClick:d},[t.icon?(i.openBlock(),i.createBlock(je,{key:0,icon:t.icon,class:"ui-toggle-button__icon"},null,8,["icon"])):i.createCommentVNode("",!0),t.label&&!u.value?(i.openBlock(),i.createElementBlock("span",Bk,i.toDisplayString(t.label),1)):i.createCommentVNode("",!0),!t.icon&&!t.label?i.renderSlot(h.$slots,"default",{key:2},void 0,!0):i.createCommentVNode("",!0)],10,Ck))}}),[["__scopeId","data-v-1f682975"]]),Ek=["role","aria-label","aria-orientation","aria-disabled"],Mk=O(i.defineComponent({__name:"ToggleGroup",props:{modelValue:{},type:{default:"single"},size:{default:"md"},disabled:{type:Boolean,default:!1},label:{},orientation:{default:"horizontal"}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e;function a(l){if(n.type==="single"){const r=n.modelValue===l?void 0:l;o("update:modelValue",r),o("change",r)}else{const r=Array.isArray(n.modelValue)?n.modelValue:[],c=r.includes(l)?r.filter(d=>d!==l):[...r,l];o("update:modelValue",c),o("change",c)}}i.provide("toggleGroup",{modelValue:i.toRef(n,"modelValue"),toggle:a,type:n.type,size:n.size,disabled:n.disabled});const s=i.computed(()=>n.type==="single"?"radiogroup":"group");return(l,r)=>(i.openBlock(),i.createElementBlock("div",{role:s.value,"aria-label":t.label,"aria-orientation":t.orientation,"aria-disabled":t.disabled||void 0,class:i.normalizeClass(["ui-toggle-group",[`ui-toggle-group--${t.orientation}`,{"ui-toggle-group--disabled":t.disabled}]])},[i.renderSlot(l.$slots,"default")],10,Ek))}}),[["__scopeId","data-v-aa1233fc"]]),vk=5,Vk=5e3,Dk=8e3;let $k=0;function Tk(){return`toast-${++$k}-${Date.now().toString(36)}`}const St=i.reactive({toasts:[]});function Dn(t){const e=Tk(),n=t.action?Dk:Vk,o={id:e,title:t.title,message:t.message,variant:t.variant,duration:t.duration??n,createdAt:Date.now(),action:t.action,onClick:t.onClick,avatar:t.avatar};for(St.toasts.push(o);St.toasts.length>vk;)St.toasts.shift();return e}function Ik(t){const e=St.toasts.findIndex(n=>n.id===t);e!==-1&&St.toasts.splice(e,1)}function Lk(){St.toasts.splice(0,St.toasts.length)}function zk(t,e){return Dn({...e,title:t,variant:"success"})}function Nk(t,e){return Dn({...e,title:t,variant:"error"})}function Pk(t,e){return Dn({...e,title:t,variant:"warning"})}function Ak(t,e){return Dn({...e,title:t,variant:"info"})}const Rk=i.readonly(St).toasts,Ot={add:Dn,remove:Ik,clear:Lk,success:zk,error:Nk,warning:Pk,info:Ak},Ok=["role","aria-live"],Fk={key:0,class:"ui-toast__avatar"},Wk={key:1,class:"ui-toast__icon","aria-hidden":"true"},Hk={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},jk=["d"],Yk={class:"ui-toast__content"},Uk={key:0,class:"ui-toast__title"},Xk={key:1,class:"ui-toast__message"},Hl=O(i.defineComponent({__name:"ToastItem",props:{toast:{}},emits:["dismiss"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(!1),s=i.ref(n.toast.duration);let l=null,r=0;const c=i.computed(()=>!!n.toast.onClick),d=i.computed(()=>!!n.toast.avatar),u=i.computed(()=>n.toast.variant==="error"?"alert":"status"),h=i.computed(()=>n.toast.variant==="error"?"assertive":"polite");function f(){n.toast.duration<=0||s.value<=0||(r=Date.now(),l=setTimeout(()=>{o("dismiss",n.toast.id)},s.value))}function m(){if(l){clearTimeout(l),l=null;const C=Date.now()-r;s.value=Math.max(0,s.value-C)}}function p(){a.value=!0,m()}function g(){a.value=!1,f()}function b(C){C.stopPropagation(),o("dismiss",n.toast.id)}function _(){n.toast.onClick&&(n.toast.onClick(),o("dismiss",n.toast.id))}function k(C){C.stopPropagation(),n.toast.action&&(n.toast.action.onClick(),o("dismiss",n.toast.id))}i.onMounted(()=>{f()}),i.onUnmounted(()=>{l&&clearTimeout(l)});const B={success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"};return(C,y)=>{var x,S;return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-toast",[`ui-toast--${t.toast.variant}`,{"ui-toast--clickable":c.value}]]),role:u.value,"aria-live":h.value,onMouseenter:p,onMouseleave:g,onClick:_},[d.value?(i.openBlock(),i.createElementBlock("div",Fk,[i.createVNode(Yo,{src:(x=t.toast.avatar)==null?void 0:x.src,name:(S=t.toast.avatar)==null?void 0:S.name,size:"sm"},null,8,["src","name"])])):(i.openBlock(),i.createElementBlock("div",Wk,[(i.openBlock(),i.createElementBlock("svg",Hk,[i.createElementVNode("path",{d:B[t.toast.variant]},null,8,jk)]))])),i.createElementVNode("div",Yk,[t.toast.title?(i.openBlock(),i.createElementBlock("div",Uk,i.toDisplayString(t.toast.title),1)):i.createCommentVNode("",!0),t.toast.message?(i.openBlock(),i.createElementBlock("div",Xk,i.toDisplayString(t.toast.message),1)):i.createCommentVNode("",!0),t.toast.action?(i.openBlock(),i.createElementBlock("button",{key:2,type:"button",class:"ui-toast__action",onClick:k},i.toDisplayString(t.toast.action.label),1)):i.createCommentVNode("",!0)]),i.createElementVNode("button",{type:"button",class:"ui-toast__close","aria-label":"Dismiss notification",onClick:b},[...y[0]||(y[0]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12"})],-1)])]),t.toast.duration>0?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["ui-toast__progress",{"ui-toast__progress--paused":a.value}]),style:i.normalizeStyle({"--toast-duration":`${t.toast.duration}ms`})},null,6)):i.createCommentVNode("",!0)],42,Ok)}}}),[["__scopeId","data-v-4a2866d8"]]),Kk=O(i.defineComponent({__name:"ToastProvider",props:{position:{default:"top-right"}},setup(t){function e(n){Ot.remove(n)}return(n,o)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createElementVNode("div",{class:i.normalizeClass(["ui-toast-provider",[`ui-toast-provider--${t.position}`]]),role:"region","aria-label":"Notifications"},[i.createVNode(i.TransitionGroup,{name:"toast"},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Rk),a=>(i.openBlock(),i.createBlock(Hl,{key:a.id,toast:a,onDismiss:e},null,8,["toast"]))),128))]),_:1})],2)]))}}),[["__scopeId","data-v-69fc4e70"]]);function qk(){return{success:Ot.success,error:Ot.error,warning:Ot.warning,info:Ot.info,dismiss:Ot.remove,clear:Ot.clear}}const Ao=Symbol("treeview"),Ei=Symbol("treeview-item"),Gk=["aria-multiselectable"],Jk=O(i.defineComponent({__name:"TreeView",props:{data:{},modelValue:{},expandedIds:{default:()=>[]},multiSelect:{type:Boolean,default:!1},loadChildren:{}},emits:["update:modelValue","update:expandedIds"],setup(t,{emit:e}){const n=t,o=e,a=i.ref(new Set),s=i.ref(new Set(n.expandedIds)),l=i.ref(null),r=i.ref(new Set),c=i.ref(new Map),d=i.ref(new Map);i.watch(()=>n.modelValue,y=>{y===void 0?a.value=new Set:Array.isArray(y)?a.value=new Set(y):a.value=new Set([y])},{immediate:!0}),i.watch(()=>n.expandedIds,y=>{s.value=new Set(y)},{immediate:!0});const u=i.computed(()=>a.value),h=i.computed(()=>s.value);function f(y){if(n.multiSelect){const x=new Set(a.value);x.has(y)?x.delete(y):x.add(y),a.value=x,o("update:modelValue",Array.from(x))}else a.value.has(y)?(a.value=new Set,o("update:modelValue",void 0)):(a.value=new Set([y]),o("update:modelValue",y))}function m(y){const x=new Set(s.value);x.has(y)?x.delete(y):x.add(y),s.value=x,o("update:expandedIds",Array.from(x))}function p(y){l.value=y}function g(y,x,S){c.value.set(y,{parentId:x,hasChildren:S}),d.value.has(x)||d.value.set(x,[]);const w=d.value.get(x);w.includes(y)||w.push(y)}function b(y){var x;return((x=c.value.get(y))==null?void 0:x.parentId)??null}function _(y){return d.value.get(y)??[]}function k(y){var x;return((x=c.value.get(y))==null?void 0:x.hasChildren)??!1}function B(){const y=[];function x(S,w){for(const M of S)y.push(M.id),M.children&&h.value.has(M.id)&&x(M.children)}return x(n.data),y}function C(y){const x=B(),S=l.value?x.indexOf(l.value):-1;switch(y.key){case"ArrowDown":{y.preventDefault();const w=S<x.length-1?S+1:0;l.value=x[w];break}case"ArrowUp":{y.preventDefault();const w=S>0?S-1:x.length-1;l.value=x[w];break}case"ArrowRight":{if(y.preventDefault(),l.value&&k(l.value))if(!h.value.has(l.value))m(l.value);else{const w=_(l.value);w.length>0&&(l.value=w[0])}break}case"ArrowLeft":{if(y.preventDefault(),l.value)if(h.value.has(l.value))m(l.value);else{const w=b(l.value);w&&(l.value=w)}break}case"Home":{y.preventDefault(),x.length>0&&(l.value=x[0]);break}case"End":{y.preventDefault(),x.length>0&&(l.value=x[x.length-1]);break}case"Enter":case" ":{y.preventDefault(),l.value&&f(l.value);break}}}return i.provide(Ao,{selectedIds:u,expandedIds:h,focusedId:l,multiSelect:i.toRef(n,"multiSelect"),selectNode:f,toggleExpand:m,setFocusedId:p,loadChildren:n.loadChildren??null,loadingIds:r,registerNode:g,getVisibleNodes:B,getParentId:b,getChildIds:_,hasChildren:k}),i.provide(Ei,{depth:0,parentId:null}),(y,x)=>(i.openBlock(),i.createElementBlock("div",{class:"ui-treeview",role:"tree","aria-multiselectable":t.multiSelect,tabindex:"0",onKeydown:C,onFocus:x[0]||(x[0]=()=>{!l.value&&t.data.length>0&&(l.value=t.data[0].id)})},[i.renderSlot(y.$slots,"default",{},void 0,!0)],40,Gk))}}),[["__scopeId","data-v-1a85f707"]]),Zk=["aria-selected","aria-expanded","aria-disabled","data-focused"],Qk=["aria-label"],e0={key:1,class:"ui-treeview__chevron-placeholder"},t0={key:2,class:"ui-treeview__spinner"},n0={class:"ui-treeview__label"},i0={key:0,class:"ui-treeview__children",role:"group"},o0=O(i.defineComponent({__name:"TreeViewItem",props:{node:{}},setup(t){const e=t,n=i.inject(Ao),o=i.inject(Ei);if(!n||!o)throw new Error("TreeViewItem must be used within TreeView");const a=n,s=o,l=s.depth,r=s.parentId,c=ve("expand"),d=ve("collapse"),u=i.ref(e.node.children),h=i.computed(()=>a.loadingIds.value.has(e.node.id)),f=i.computed(()=>a.selectedIds.value.has(e.node.id)),m=i.computed(()=>a.expandedIds.value.has(e.node.id)),p=i.computed(()=>a.focusedId.value===e.node.id),g=i.computed(()=>e.node.isLeaf?!1:!!(u.value&&u.value.length>0||a.loadChildren&&!e.node.isLeaf));i.onMounted(()=>{a.registerNode(e.node.id,r,g.value)}),i.watch(g,x=>{a.registerNode(e.node.id,r,x)});async function b(){var x;if(g.value){if(!m.value&&a.loadChildren&&!((x=u.value)!=null&&x.length)){a.loadingIds.value.add(e.node.id);try{u.value=await a.loadChildren(e.node)}finally{a.loadingIds.value.delete(e.node.id)}}a.toggleExpand(e.node.id)}}function _(){e.node.disabled||a.selectNode(e.node.id)}function k(){a.setFocusedId(e.node.id),_()}function B(x){x.stopPropagation(),a.setFocusedId(e.node.id),b()}i.provide(Ei,{depth:l+1,parentId:e.node.id});const C=i.computed(()=>["ui-treeview__item",{"ui-treeview__item--selected":f.value,"ui-treeview__item--focused":p.value,"ui-treeview__item--disabled":e.node.disabled,"ui-treeview__item--loading":h.value}]),y=i.computed(()=>({paddingLeft:`calc(var(--tree-indent) * ${l})`}));return(x,S)=>{const w=i.resolveComponent("TreeViewItem",!0);return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(C.value),role:"treeitem","aria-selected":f.value,"aria-expanded":g.value?m.value:void 0,"aria-disabled":t.node.disabled,"data-focused":p.value},[i.createElementVNode("div",{class:"ui-treeview__content",style:i.normalizeStyle(y.value),onClick:k},[g.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["ui-treeview__chevron",{"ui-treeview__chevron--expanded":m.value}]),type:"button",tabindex:"-1","aria-label":m.value?"Collapse":"Expand",onClick:B},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(m.value?i.unref(d):i.unref(c)),{class:"ui-treeview__chevron-icon"}))],10,Qk)):(i.openBlock(),i.createElementBlock("span",e0)),h.value?(i.openBlock(),i.createElementBlock("span",t0)):i.createCommentVNode("",!0),t.node.icon&&!h.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.node.icon),{key:3,class:"ui-treeview__icon"})):i.createCommentVNode("",!0),i.createElementVNode("span",n0,[i.renderSlot(x.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(t.node.label),1)],!0)])],4),i.createVNode(i.Transition,{name:"ui-treeview-expand"},{default:i.withCtx(()=>[g.value&&m.value&&u.value?(i.openBlock(),i.createElementBlock("div",i0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.value,M=>(i.openBlock(),i.createBlock(w,{key:M.id,node:M},null,8,["node"]))),128))])):i.createCommentVNode("",!0)]),_:1})],10,Zk)}}}),[["__scopeId","data-v-b483e83c"]]),a0=O(i.defineComponent({__name:"Container",props:{fluid:{type:Boolean,default:!1},centered:{type:Boolean,default:!0},as:{default:"div"}},setup(t){const e=t,n=i.computed(()=>["ui-container",{"ui-container--fluid":e.fluid,"ui-container--centered":e.centered}]);return(o,a)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(n.value)},{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-2f68ccaa"]]),s0=O(i.defineComponent({__name:"Stack",props:{direction:{default:"column"},gap:{default:0},align:{default:"stretch"},justify:{default:"start"},wrap:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},as:{default:"div"}},setup(t){const e=t,n=i.computed(()=>["ui-stack",`ui-stack--${e.direction}`,`ui-stack--align-${e.align}`,`ui-stack--justify-${e.justify}`,{"ui-stack--wrap":e.wrap,"ui-stack--inline":e.inline}]),o=i.computed(()=>({"--stack-gap":`var(--space-${e.gap})`}));return(a,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(n.value),style:i.normalizeStyle(o.value)},{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-3d1c3188"]]),l0=Symbol("Grid"),r0=O(i.defineComponent({__name:"Grid",props:{columns:{default:1},gap:{default:4},gapX:{},gapY:{},as:{default:"div"}},setup(t){const e=t,n=i.computed(()=>typeof e.columns=="object"),o=i.computed(()=>{const s=["ui-grid"];if(n.value){const l=e.columns;l.default&&s.push(`ui-grid--cols-${l.default}`),l.sm&&s.push(`ui-grid--cols-sm-${l.sm}`),l.md&&s.push(`ui-grid--cols-md-${l.md}`),l.lg&&s.push(`ui-grid--cols-lg-${l.lg}`),l.xl&&s.push(`ui-grid--cols-xl-${l.xl}`)}else s.push(`ui-grid--cols-${e.columns}`);return s}),a=i.computed(()=>{const s={"--grid-gap":`var(--space-${e.gap})`};return e.gapX!==void 0&&(s["--grid-gap-x"]=`var(--space-${e.gapX})`),e.gapY!==void 0&&(s["--grid-gap-y"]=`var(--space-${e.gapY})`),s});return i.provide(l0,{gap:i.toRef(e,"gap")}),(s,l)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(o.value),style:i.normalizeStyle(a.value)},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-f4881c4d"]]),c0=O(i.defineComponent({__name:"GridItem",props:{span:{default:1},start:{},end:{},rowSpan:{},as:{default:"div"}},setup(t){const e=t,n=i.computed(()=>typeof e.span=="object"),o=i.computed(()=>{const s=["ui-grid-item"];if(n.value){const l=e.span;l.default&&s.push(`ui-grid-item--span-${l.default}`),l.sm&&s.push(`ui-grid-item--span-sm-${l.sm}`),l.md&&s.push(`ui-grid-item--span-md-${l.md}`),l.lg&&s.push(`ui-grid-item--span-lg-${l.lg}`),l.xl&&s.push(`ui-grid-item--span-xl-${l.xl}`)}else s.push(`ui-grid-item--span-${e.span}`);return s}),a=i.computed(()=>{const s={};return e.start!==void 0&&(s["grid-column-start"]=e.start),e.end!==void 0&&(s["grid-column-end"]=e.end),e.rowSpan!==void 0&&(s["grid-row"]=`span ${e.rowSpan} / span ${e.rowSpan}`),s});return(s,l)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.as),{class:i.normalizeClass(o.value),style:i.normalizeStyle(a.value)},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-835ed31a"]]);E.AccordionContent=yr,E.AccordionItem=cr,E.AccordionRoot=Gl,E.AccordionTrigger=mr,E.Avatar=Yo,E.Badge=Sr,E.BadgeContainer=Mr,E.BarChart=Pp,E.BaseChart=ki,E.BreadcrumbEllipsis=hc,E.BreadcrumbItem=Pr,E.BreadcrumbLink=Ar,E.BreadcrumbList=Ir,E.BreadcrumbPage=Wr,E.BreadcrumbRoot=Vr,E.BreadcrumbSeparator=jr,E.Button=Je,E.Callout=Vc,E.Card=$c,E.CardContent=Pc,E.CardFooter=Ac,E.CardHeader=Nc,E.CardImage=Oc,E.Checkbox=Vi,E.ChoiceChip=u_,E.ChoiceChipGroup=f_,E.ColorArea=ia,E.ColorPicker=md,E.ColorSlider=zi,E.Combobox=r_,E.Container=a0,E.DataTable=Xg,E.DatePicker=Rb,E.DonutChart=Kp,E.Drawer=jb,E.Dropdown=Xo,E.DropdownItem=Ko,E.DropdownSeparator=nc,E.DropdownSub=oc,E.DropdownSubContent=cc,E.DropdownSubTrigger=rc,E.EmptyState=El,E.FileUpload=A_,E.Grid=r0,E.GridItem=c0,E.Heading=R_,E.Icon=je,E.Input=Jt,E.LineChart=Ip,E.Modal=Y_,E.Pagination=vl,E.Popover=Ln,E.Progress=Z_,E.Radio=ay,E.Rating=ry,E.SegmentedControl=hy,E.Select=Vl,E.SidebarGroup=zy,E.SidebarGroupKey=Ol,E.SidebarItem=Ty,E.SidebarKey=Bi,E.SidebarLayout=wy,E.SidebarRoot=Ey,E.Skeleton=wi,E.Slider=ky,E.Spinner=In,E.SpireProvider=ar,E.Stack=s0,E.StepperContent=jy,E.StepperItem=Ry,E.StepperItemKey=Vn,E.StepperKey=qt,E.StepperRoot=Py,E.StepperSeparator=Yy,E.StepperTrigger=Wy,E.Switch=Gy,E.Tabs=tk,E.Text=vo,E.Textarea=uk,E.TimePicker=wk,E.Timeline=hk,E.TimelineItem=pk,E.TimelineKey=To,E.ToastItem=Hl,E.ToastProvider=Kk,E.ToggleButton=Sk,E.ToggleGroup=Mk,E.Tooltip=Fl,E.TreeView=Jk,E.TreeViewItem=o0,E.TreeViewItemKey=Ei,E.TreeViewKey=Ao,E.configureIcons=Gp,E.formatColor=Li,E.formatDate=Bt,E.formatOklch=na,E.formatRgb=Ii,E.formatTime=Lo,E.generateCalendarGrid=$l,E.generatePageRange=Ml,E.generateRange=Si,E.generateYearGrid=Pl,E.getDaysInMonth=Kg,E.getInitials=jo,E.getMonthName=Ll,E.getMonthNamesShort=Nl,E.getNestedValue=Dl,E.getPresetRange=Gg,E.getRangeClass=Vo,E.getStaggerStyle=lr,E.getWeekdayNames=zl,E.hexToHsv=Di,E.hexToRgb=Go,E.hsvToHex=Nn,E.hsvToOklch=ea,E.hsvToRgb=Zt,E.isDateAfter=Il,E.isDateBefore=Tl,E.isDateBetween=qg,E.isDateInRange=Ci,E.isSameDate=mt,E.isValidTimeString=Wl,E.normalizeRange=Do,E.oklchToHsv=ta,E.oklchToRgb=Zo,E.parseColorString=Qt,E.parseDate=ft,E.parseTime=Io,E.resetIcons=Jp,E.rgbToHex=Jo,E.rgbToHsv=zn,E.rgbToOklch=Qo,E.spireConfigKey=Ho,E.to12Hour=zo,E.to24Hour=No,E.useChartTheme=Mn,E.useClickOutside=Jl,E.useClipboard=Zl,E.useEventListener=Ql,E.useFocusTrap=er,E.useHoverReveal=tr,E.useId=ye,E.useMagnetic=ir,E.useRelativePosition=Wo,E.useRipple=or,E.useScrollLock=Tn,E.useStagger=sr,E.useToast=qk,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}));