@deskhero/dh_ui 2.22.0 → 2.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dh_ui.umd.js CHANGED
@@ -9,14 +9,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
9
9
  * https://www.chartjs.org
10
10
  * (c) 2024 Chart.js Contributors
11
11
  * Released under the MIT License
12
- */function ai(){}const vx=(()=>{let i=0;return()=>i++})();function be(i){return i===null||typeof i>"u"}function Se(i){if(Array.isArray&&Array.isArray(i))return!0;const e=Object.prototype.toString.call(i);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function pe(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function Ze(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Dt(i,e){return Ze(i)?i:e}function xe(i,e){return typeof i>"u"?e:i}const Qx=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*e:+i;function Ve(i,e,t){if(i&&typeof i.call=="function")return i.apply(t,e)}function Oe(i,e,t,n){let o,r,a;if(Se(i))if(r=i.length,n)for(o=r-1;o>=0;o--)e.call(t,i[o],o);else for(o=0;o<r;o++)e.call(t,i[o],o);else if(pe(i))for(a=Object.keys(i),r=a.length,o=0;o<r;o++)e.call(t,i[a[o]],a[o])}function ja(i,e){let t,n,o,r;if(!i||!e||i.length!==e.length)return!1;for(t=0,n=i.length;t<n;++t)if(o=i[t],r=e[t],o.datasetIndex!==r.datasetIndex||o.index!==r.index)return!1;return!0}function ya(i){if(Se(i))return i.map(ya);if(pe(i)){const e=Object.create(null),t=Object.keys(i),n=t.length;let o=0;for(;o<n;++o)e[t[o]]=ya(i[t[o]]);return e}return i}function xd(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Yx(i,e,t,n){if(!xd(i))return;const o=e[i],r=t[i];pe(o)&&pe(r)?Fn(o,r,n):e[i]=ya(r)}function Fn(i,e,t){const n=Se(e)?e:[e],o=n.length;if(!pe(i))return i;t=t||{};const r=t.merger||Yx;let a;for(let l=0;l<o;++l){if(a=n[l],!pe(a))continue;const M=Object.keys(a);for(let c=0,u=M.length;c<u;++c)r(M[c],i,a,t)}return i}function $n(i,e){return Fn(i,e,{merger:Ux})}function Ux(i,e,t){if(!xd(i))return;const n=e[i],o=t[i];pe(n)&&pe(o)?$n(n,o):Object.prototype.hasOwnProperty.call(e,i)||(e[i]=ya(o))}const Ld={"":i=>i,x:i=>i.x,y:i=>i.y};function _x(i){const e=i.split("."),t=[];let n="";for(const o of e)n+=o,n.endsWith("\\")?n=n.slice(0,-1)+".":(t.push(n),n="");return t}function Bx(i){const e=_x(i);return t=>{for(const n of e){if(n==="")break;t=t&&t[n]}return t}}function Dn(i,e){return(Ld[e]||(Ld[e]=Bx(e)))(i)}function gM(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Jn=i=>typeof i<"u",pi=i=>typeof i=="function",Ed=(i,e)=>{if(i.size!==e.size)return!1;for(const t of i)if(!e.has(t))return!1;return!0};function Px(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const Xe=Math.PI,ft=2*Xe,Rx=ft+Xe,Ia=Number.POSITIVE_INFINITY,Zx=Xe/180,pt=Xe/2,Gi=Xe/4,bd=Xe*2/3,zi=Math.log10,$t=Math.sign;function Xn(i,e,t){return Math.abs(i-e)<t}function Od(i){const e=Math.round(i);i=Xn(i,e,i/1e3)?e:i;const t=Math.pow(10,Math.floor(zi(i))),n=i/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t}function Vx(i){const e=[],t=Math.sqrt(i);let n;for(n=1;n<t;n++)i%n===0&&(e.push(n),e.push(i/n));return t===(t|0)&&e.push(t),e.sort((o,r)=>o-r).pop(),e}function Kn(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Gx(i,e){const t=Math.round(i);return t-e<=i&&t+e>=i}function Cd(i,e,t){let n,o,r;for(n=0,o=i.length;n<o;n++)r=i[n][t],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function mi(i){return i*(Xe/180)}function dM(i){return i*(180/Xe)}function wd(i){if(!Ze(i))return;let e=1,t=0;for(;Math.round(i*e)/e!==i;)e*=10,t++;return t}function Wx(i,e){const t=e.x-i.x,n=e.y-i.y,o=Math.sqrt(t*t+n*n);let r=Math.atan2(n,t);return r<-.5*Xe&&(r+=ft),{angle:r,distance:o}}function NM(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function Hx(i,e){return(i-e+Rx)%ft-Xe}function zt(i){return(i%ft+ft)%ft}function Sd(i,e,t,n){const o=zt(i),r=zt(e),a=zt(t),l=zt(r-o),M=zt(a-o),c=zt(o-r),u=zt(o-a);return o===r||o===a||n&&r===a||l>M&&c<u}function mt(i,e,t){return Math.max(e,Math.min(t,i))}function Fx(i){return mt(i,-32768,32767)}function ha(i,e,t,n=1e-6){return i>=Math.min(e,t)-n&&i<=Math.max(e,t)+n}function jM(i,e,t){t=t||(a=>i[a]<e);let n=i.length-1,o=0,r;for(;n-o>1;)r=o+n>>1,t(r)?o=r:n=r;return{lo:o,hi:n}}const Wi=(i,e,t,n)=>jM(i,t,n?o=>{const r=i[o][e];return r<t||r===t&&i[o+1][e]===t}:o=>i[o][e]<t),$x=(i,e,t)=>jM(i,t,n=>i[n][e]>=t);function Jx(i,e,t){let n=0,o=i.length;for(;n<o&&i[n]<e;)n++;for(;o>n&&i[o-1]>t;)o--;return n>0||o<i.length?i.slice(n,o):i}const kd=["push","pop","shift","splice","unshift"];function Xx(i,e){if(i._chartjs){i._chartjs.listeners.push(e);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),kd.forEach(t=>{const n="_onData"+gM(t),o=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...r){const a=o.apply(this,r);return i._chartjs.listeners.forEach(l=>{typeof l[n]=="function"&&l[n](...r)}),a}})})}function vd(i,e){const t=i._chartjs;if(!t)return;const n=t.listeners,o=n.indexOf(e);o!==-1&&n.splice(o,1),!(n.length>0)&&(kd.forEach(r=>{delete i[r]}),delete i._chartjs)}function Qd(i){const e=new Set(i);return e.size===i.length?i:Array.from(e)}const Yd=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Ud(i,e){let t=[],n=!1;return function(...o){t=o,n||(n=!0,Yd.call(window,()=>{n=!1,i.apply(e,t)}))}}function Kx(i,e){let t;return function(...n){return e?(clearTimeout(t),t=setTimeout(i,e,n)):i.apply(this,n),e}}const _d=i=>i==="start"?"left":i==="end"?"right":"center",qn=(i,e,t)=>i==="start"?e:i==="end"?t:(e+t)/2;function qx(i,e,t){const n=e.length;let o=0,r=n;if(i._sorted){const{iScale:a,_parsed:l}=i,M=a.axis,{min:c,max:u,minDefined:g,maxDefined:d}=a.getUserBounds();g&&(o=mt(Math.min(Wi(l,M,c).lo,t?n:Wi(e,M,a.getPixelForValue(c)).lo),0,n-1)),d?r=mt(Math.max(Wi(l,a.axis,u,!0).hi+1,t?0:Wi(e,M,a.getPixelForValue(u),!0).hi+1),o,n)-o:r=n-o}return{start:o,count:r}}function eL(i){const{xScale:e,yScale:t,_scaleRanges:n}=i,o={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!n)return i._scaleRanges=o,!0;const r=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==t.min||n.ymax!==t.max;return Object.assign(n,o),r}const Da=i=>i===0||i===1,Bd=(i,e,t)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-e)*ft/t)),Pd=(i,e,t)=>Math.pow(2,-10*i)*Math.sin((i-e)*ft/t)+1,eo={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*pt)+1,easeOutSine:i=>Math.sin(i*pt),easeInOutSine:i=>-.5*(Math.cos(Xe*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Da(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Da(i)?i:Bd(i,.075,.3),easeOutElastic:i=>Da(i)?i:Pd(i,.075,.3),easeInOutElastic(i){return Da(i)?i:i<.5?.5*Bd(i*2,.1125,.45):.5+.5*Pd(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let e=1.70158;return(i/=.5)<1?.5*(i*i*(((e*=1.525)+1)*i-e)):.5*((i-=2)*i*(((e*=1.525)+1)*i+e)+2)},easeInBounce:i=>1-eo.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?eo.easeInBounce(i*2)*.5:eo.easeOutBounce(i*2-1)*.5+.5};function yM(i){if(i&&typeof i=="object"){const e=i.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Rd(i){return yM(i)?i:new Hn(i)}function IM(i){return yM(i)?i:new Hn(i).saturate(.5).darken(.1).hexString()}const tL=["x","y","borderWidth","radius","tension"],iL=["color","borderColor","backgroundColor"];function nL(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),i.set("animations",{colors:{type:"color",properties:iL},numbers:{type:"number",properties:tL}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function oL(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Zd=new Map;function rL(i,e){e=e||{};const t=i+JSON.stringify(e);let n=Zd.get(t);return n||(n=new Intl.NumberFormat(i,e),Zd.set(t,n)),n}function hM(i,e,t){return rL(e,t).format(i)}const Vd={values(i){return Se(i)?i:""+i},numeric(i,e,t){if(i===0)return"0";const n=this.chart.options.locale;let o,r=i;if(t.length>1){const c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(o="scientific"),r=aL(i,t)}const a=zi(Math.abs(r)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),M={notation:o,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(M,this.options.ticks.format),hM(i,n,M)},logarithmic(i,e,t){if(i===0)return"0";const n=t[e].significand||i/Math.pow(10,Math.floor(zi(i)));return[1,2,3,5,10,15].includes(n)||e>.8*t.length?Vd.numeric.call(this,i,e,t):""}};function aL(i,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&i!==Math.floor(i)&&(t=i-Math.floor(i)),t}var fa={formatters:Vd};function sL(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:fa.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Hi=Object.create(null),DM=Object.create(null);function to(i,e){if(!e)return i;const t=e.split(".");for(let n=0,o=t.length;n<o;++n){const r=t[n];i=i[r]||(i[r]=Object.create(null))}return i}function fM(i,e,t){return typeof e=="string"?Fn(to(i,e),t):Fn(to(i,""),e)}class lL{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=n=>n.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,o)=>IM(o.backgroundColor),this.hoverBorderColor=(n,o)=>IM(o.borderColor),this.hoverColor=(n,o)=>IM(o.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return fM(this,e,t)}get(e){return to(this,e)}describe(e,t){return fM(DM,e,t)}override(e,t){return fM(Hi,e,t)}route(e,t,n,o){const r=to(this,e),a=to(this,n),l="_"+t;Object.defineProperties(r,{[l]:{value:r[t],writable:!0},[t]:{enumerable:!0,get(){const M=this[l],c=a[o];return pe(M)?Object.assign({},c,M):xe(M,c)},set(M){this[l]=M}}})}apply(e){e.forEach(t=>t(this))}}var Fe=new lL({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[nL,oL,sL]);function ML(i){return!i||be(i.size)||be(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function pa(i,e,t,n,o){let r=e[o];return r||(r=e[o]=i.measureText(o).width,t.push(o)),r>n&&(n=r),n}function cL(i,e,t,n){n=n||{};let o=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(o=n.data={},r=n.garbageCollect=[],n.font=e),i.save(),i.font=e;let a=0;const l=t.length;let M,c,u,g,d;for(M=0;M<l;M++)if(g=t[M],g!=null&&!Se(g))a=pa(i,o,r,a,g);else if(Se(g))for(c=0,u=g.length;c<u;c++)d=g[c],d!=null&&!Se(d)&&(a=pa(i,o,r,a,d));i.restore();const y=r.length/2;if(y>t.length){for(M=0;M<y;M++)delete o[r[M]];r.splice(0,y)}return a}function Fi(i,e,t){const n=i.currentDevicePixelRatio,o=t!==0?Math.max(t/2,.5):0;return Math.round((e-o)*n)/n+o}function Gd(i,e){e=e||i.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,i.width,i.height),e.restore()}function pM(i,e,t,n){uL(i,e,t,n,null)}function uL(i,e,t,n,o){let r,a,l,M,c,u,g,d;const y=e.pointStyle,j=e.rotation,D=e.radius;let I=(j||0)*Zx;if(y&&typeof y=="object"&&(r=y.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){i.save(),i.translate(t,n),i.rotate(I),i.drawImage(y,-y.width/2,-y.height/2,y.width,y.height),i.restore();return}if(!(isNaN(D)||D<=0)){switch(i.beginPath(),y){default:o?i.ellipse(t,n,o/2,D,0,0,ft):i.arc(t,n,D,0,ft),i.closePath();break;case"triangle":u=o?o/2:D,i.moveTo(t+Math.sin(I)*u,n-Math.cos(I)*D),I+=bd,i.lineTo(t+Math.sin(I)*u,n-Math.cos(I)*D),I+=bd,i.lineTo(t+Math.sin(I)*u,n-Math.cos(I)*D),i.closePath();break;case"rectRounded":c=D*.516,M=D-c,a=Math.cos(I+Gi)*M,g=Math.cos(I+Gi)*(o?o/2-c:M),l=Math.sin(I+Gi)*M,d=Math.sin(I+Gi)*(o?o/2-c:M),i.arc(t-g,n-l,c,I-Xe,I-pt),i.arc(t+d,n-a,c,I-pt,I),i.arc(t+g,n+l,c,I,I+pt),i.arc(t-d,n+a,c,I+pt,I+Xe),i.closePath();break;case"rect":if(!j){M=Math.SQRT1_2*D,u=o?o/2:M,i.rect(t-u,n-M,2*u,2*M);break}I+=Gi;case"rectRot":g=Math.cos(I)*(o?o/2:D),a=Math.cos(I)*D,l=Math.sin(I)*D,d=Math.sin(I)*(o?o/2:D),i.moveTo(t-g,n-l),i.lineTo(t+d,n-a),i.lineTo(t+g,n+l),i.lineTo(t-d,n+a),i.closePath();break;case"crossRot":I+=Gi;case"cross":g=Math.cos(I)*(o?o/2:D),a=Math.cos(I)*D,l=Math.sin(I)*D,d=Math.sin(I)*(o?o/2:D),i.moveTo(t-g,n-l),i.lineTo(t+g,n+l),i.moveTo(t+d,n-a),i.lineTo(t-d,n+a);break;case"star":g=Math.cos(I)*(o?o/2:D),a=Math.cos(I)*D,l=Math.sin(I)*D,d=Math.sin(I)*(o?o/2:D),i.moveTo(t-g,n-l),i.lineTo(t+g,n+l),i.moveTo(t+d,n-a),i.lineTo(t-d,n+a),I+=Gi,g=Math.cos(I)*(o?o/2:D),a=Math.cos(I)*D,l=Math.sin(I)*D,d=Math.sin(I)*(o?o/2:D),i.moveTo(t-g,n-l),i.lineTo(t+g,n+l),i.moveTo(t+d,n-a),i.lineTo(t-d,n+a);break;case"line":a=o?o/2:Math.cos(I)*D,l=Math.sin(I)*D,i.moveTo(t-a,n-l),i.lineTo(t+a,n+l);break;case"dash":i.moveTo(t,n),i.lineTo(t+Math.cos(I)*(o?o/2:D),n+Math.sin(I)*D);break;case!1:i.closePath();break}i.fill(),e.borderWidth>0&&i.stroke()}}function si(i,e,t){return t=t||.5,!e||i&&i.x>e.left-t&&i.x<e.right+t&&i.y>e.top-t&&i.y<e.bottom+t}function zM(i,e){i.save(),i.beginPath(),i.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),i.clip()}function mM(i){i.restore()}function gL(i,e,t,n,o){if(!e)return i.lineTo(t.x,t.y);if(o==="middle"){const r=(e.x+t.x)/2;i.lineTo(r,e.y),i.lineTo(r,t.y)}else o==="after"!=!!n?i.lineTo(e.x,t.y):i.lineTo(t.x,e.y);i.lineTo(t.x,t.y)}function dL(i,e,t,n){if(!e)return i.lineTo(t.x,t.y);i.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?t.cp2x:t.cp1x,n?t.cp2y:t.cp1y,t.x,t.y)}function NL(i,e){e.translation&&i.translate(e.translation[0],e.translation[1]),be(e.rotation)||i.rotate(e.rotation),e.color&&(i.fillStyle=e.color),e.textAlign&&(i.textAlign=e.textAlign),e.textBaseline&&(i.textBaseline=e.textBaseline)}function jL(i,e,t,n,o){if(o.strikethrough||o.underline){const r=i.measureText(n),a=e-r.actualBoundingBoxLeft,l=e+r.actualBoundingBoxRight,M=t-r.actualBoundingBoxAscent,c=t+r.actualBoundingBoxDescent,u=o.strikethrough?(M+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=o.decorationWidth||2,i.moveTo(a,u),i.lineTo(l,u),i.stroke()}}function yL(i,e){const t=i.fillStyle;i.fillStyle=e.color,i.fillRect(e.left,e.top,e.width,e.height),i.fillStyle=t}function io(i,e,t,n,o,r={}){const a=Se(e)?e:[e],l=r.strokeWidth>0&&r.strokeColor!=="";let M,c;for(i.save(),i.font=o.string,NL(i,r),M=0;M<a.length;++M)c=a[M],r.backdrop&&yL(i,r.backdrop),l&&(r.strokeColor&&(i.strokeStyle=r.strokeColor),be(r.strokeWidth)||(i.lineWidth=r.strokeWidth),i.strokeText(c,t,n,r.maxWidth)),i.fillText(c,t,n,r.maxWidth),jL(i,t,n,c,r),n+=Number(o.lineHeight);i.restore()}function za(i,e){const{x:t,y:n,w:o,h:r,radius:a}=e;i.arc(t+a.topLeft,n+a.topLeft,a.topLeft,1.5*Xe,Xe,!0),i.lineTo(t,n+r-a.bottomLeft),i.arc(t+a.bottomLeft,n+r-a.bottomLeft,a.bottomLeft,Xe,pt,!0),i.lineTo(t+o-a.bottomRight,n+r),i.arc(t+o-a.bottomRight,n+r-a.bottomRight,a.bottomRight,pt,0,!0),i.lineTo(t+o,n+a.topRight),i.arc(t+o-a.topRight,n+a.topRight,a.topRight,0,-pt,!0),i.lineTo(t+a.topLeft,n)}const IL=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,hL=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function DL(i,e){const t=(""+i).match(IL);if(!t||t[1]==="normal")return e*1.2;switch(i=+t[2],t[3]){case"px":return i;case"%":i/=100;break}return e*i}const fL=i=>+i||0;function Wd(i,e){const t={},n=pe(e),o=n?Object.keys(e):e,r=pe(i)?n?a=>xe(i[a],i[e[a]]):a=>i[a]:()=>i;for(const a of o)t[a]=fL(r(a));return t}function Hd(i){return Wd(i,{top:"y",right:"x",bottom:"y",left:"x"})}function fn(i){return Wd(i,["topLeft","topRight","bottomLeft","bottomRight"])}function At(i){const e=Hd(i);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ut(i,e){i=i||{},e=e||Fe.font;let t=xe(i.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let n=xe(i.style,e.style);n&&!(""+n).match(hL)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const o={family:xe(i.family,e.family),lineHeight:DL(xe(i.lineHeight,e.lineHeight),t),size:t,style:n,weight:xe(i.weight,e.weight),string:""};return o.string=ML(o),o}function ma(i,e,t,n){let o=!0,r,a,l;for(r=0,a=i.length;r<a;++r)if(l=i[r],l!==void 0&&(e!==void 0&&typeof l=="function"&&(l=l(e),o=!1),t!==void 0&&Se(l)&&(l=l[t%l.length],o=!1),l!==void 0))return n&&!o&&(n.cacheable=!1),l}function pL(i,e,t){const{min:n,max:o}=i,r=Qx(e,(o-n)/2),a=(l,M)=>t&&l===0?0:l+M;return{min:a(n,-Math.abs(r)),max:a(o,r)}}function Ai(i,e){return Object.assign(Object.create(i),e)}function AM(i,e=[""],t,n,o=()=>i[0]){const r=t||i;typeof n>"u"&&(n=Kd("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:r,_fallback:n,_getTarget:o,override:l=>AM([l,...i],e,r,n)};return new Proxy(a,{deleteProperty(l,M){return delete l[M],delete l._keys,delete i[0][M],!0},get(l,M){return $d(l,M,()=>bL(M,e,i,l))},getOwnPropertyDescriptor(l,M){return Reflect.getOwnPropertyDescriptor(l._scopes[0],M)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(l,M){return qd(l).includes(M)},ownKeys(l){return qd(l)},set(l,M,c){const u=l._storage||(l._storage=o());return l[M]=u[M]=c,delete l._keys,!0}})}function pn(i,e,t,n){const o={_cacheable:!1,_proxy:i,_context:e,_subProxy:t,_stack:new Set,_descriptors:Fd(i,n),setContext:r=>pn(i,r,t,n),override:r=>pn(i.override(r),e,t,n)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete i[a],!0},get(r,a,l){return $d(r,a,()=>mL(r,a,l))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(r,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(r,a,l){return i[a]=l,delete r[a],!0}})}function Fd(i,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:n=e.indexable,_allKeys:o=e.allKeys}=i;return{allKeys:o,scriptable:t,indexable:n,isScriptable:pi(t)?t:()=>t,isIndexable:pi(n)?n:()=>n}}const zL=(i,e)=>i?i+gM(e):e,TM=(i,e)=>pe(e)&&i!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function $d(i,e,t){if(Object.prototype.hasOwnProperty.call(i,e))return i[e];const n=t();return i[e]=n,n}function mL(i,e,t){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=i;let l=n[e];return pi(l)&&a.isScriptable(e)&&(l=AL(e,l,i,t)),Se(l)&&l.length&&(l=TL(e,l,i,a.isIndexable)),TM(e,l)&&(l=pn(l,o,r&&r[e],a)),l}function AL(i,e,t,n){const{_proxy:o,_context:r,_subProxy:a,_stack:l}=t;if(l.has(i))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+i);l.add(i);let M=e(r,a||n);return l.delete(i),TM(i,M)&&(M=xM(o._scopes,o,i,M)),M}function TL(i,e,t,n){const{_proxy:o,_context:r,_subProxy:a,_descriptors:l}=t;if(typeof r.index<"u"&&n(i))return e[r.index%e.length];if(pe(e[0])){const M=e,c=o._scopes.filter(u=>u!==M);e=[];for(const u of M){const g=xM(c,o,i,u);e.push(pn(g,r,a&&a[i],l))}}return e}function Jd(i,e,t){return pi(i)?i(e,t):i}const xL=(i,e)=>i===!0?e:typeof i=="string"?Dn(e,i):void 0;function LL(i,e,t,n,o){for(const r of e){const a=xL(t,r);if(a){i.add(a);const l=Jd(a._fallback,t,o);if(typeof l<"u"&&l!==t&&l!==n)return l}else if(a===!1&&typeof n<"u"&&t!==n)return null}return!1}function xM(i,e,t,n){const o=e._rootScopes,r=Jd(e._fallback,t,n),a=[...i,...o],l=new Set;l.add(n);let M=Xd(l,a,t,r||t,n);return M===null||typeof r<"u"&&r!==t&&(M=Xd(l,a,r,M,n),M===null)?!1:AM(Array.from(l),[""],o,r,()=>EL(e,t,n))}function Xd(i,e,t,n,o){for(;t;)t=LL(i,e,t,n,o);return t}function EL(i,e,t){const n=i._getTarget();e in n||(n[e]={});const o=n[e];return Se(o)&&pe(t)?t:o||{}}function bL(i,e,t,n){let o;for(const r of e)if(o=Kd(zL(r,i),t),typeof o<"u")return TM(i,o)?xM(t,n,i,o):o}function Kd(i,e){for(const t of e){if(!t)continue;const n=t[i];if(typeof n<"u")return n}}function qd(i){let e=i._keys;return e||(e=i._keys=OL(i._scopes)),e}function OL(i){const e=new Set;for(const t of i)for(const n of Object.keys(t).filter(o=>!o.startsWith("_")))e.add(n);return Array.from(e)}const CL=Number.EPSILON||1e-14,zn=(i,e)=>e<i.length&&!i[e].skip&&i[e],eN=i=>i==="x"?"y":"x";function wL(i,e,t,n){const o=i.skip?e:i,r=e,a=t.skip?e:t,l=NM(r,o),M=NM(a,r);let c=l/(l+M),u=M/(l+M);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const g=n*c,d=n*u;return{previous:{x:r.x-g*(a.x-o.x),y:r.y-g*(a.y-o.y)},next:{x:r.x+d*(a.x-o.x),y:r.y+d*(a.y-o.y)}}}function SL(i,e,t){const n=i.length;let o,r,a,l,M,c=zn(i,0);for(let u=0;u<n-1;++u)if(M=c,c=zn(i,u+1),!(!M||!c)){if(Xn(e[u],0,CL)){t[u]=t[u+1]=0;continue}o=t[u]/e[u],r=t[u+1]/e[u],l=Math.pow(o,2)+Math.pow(r,2),!(l<=9)&&(a=3/Math.sqrt(l),t[u]=o*a*e[u],t[u+1]=r*a*e[u])}}function kL(i,e,t="x"){const n=eN(t),o=i.length;let r,a,l,M=zn(i,0);for(let c=0;c<o;++c){if(a=l,l=M,M=zn(i,c+1),!l)continue;const u=l[t],g=l[n];a&&(r=(u-a[t])/3,l[`cp1${t}`]=u-r,l[`cp1${n}`]=g-r*e[c]),M&&(r=(M[t]-u)/3,l[`cp2${t}`]=u+r,l[`cp2${n}`]=g+r*e[c])}}function vL(i,e="x"){const t=eN(e),n=i.length,o=Array(n).fill(0),r=Array(n);let a,l,M,c=zn(i,0);for(a=0;a<n;++a)if(l=M,M=c,c=zn(i,a+1),!!M){if(c){const u=c[e]-M[e];o[a]=u!==0?(c[t]-M[t])/u:0}r[a]=l?c?$t(o[a-1])!==$t(o[a])?0:(o[a-1]+o[a])/2:o[a-1]:o[a]}SL(i,o,r),kL(i,r,e)}function Aa(i,e,t){return Math.max(Math.min(i,t),e)}function QL(i,e){let t,n,o,r,a,l=si(i[0],e);for(t=0,n=i.length;t<n;++t)a=r,r=l,l=t<n-1&&si(i[t+1],e),r&&(o=i[t],a&&(o.cp1x=Aa(o.cp1x,e.left,e.right),o.cp1y=Aa(o.cp1y,e.top,e.bottom)),l&&(o.cp2x=Aa(o.cp2x,e.left,e.right),o.cp2y=Aa(o.cp2y,e.top,e.bottom)))}function YL(i,e,t,n,o){let r,a,l,M;if(e.spanGaps&&(i=i.filter(c=>!c.skip)),e.cubicInterpolationMode==="monotone")vL(i,o);else{let c=n?i[i.length-1]:i[0];for(r=0,a=i.length;r<a;++r)l=i[r],M=wL(c,l,i[Math.min(r+1,a-(n?0:1))%a],e.tension),l.cp1x=M.previous.x,l.cp1y=M.previous.y,l.cp2x=M.next.x,l.cp2y=M.next.y,c=l}e.capBezierPoints&&QL(i,t)}function LM(){return typeof window<"u"&&typeof document<"u"}function EM(i){let e=i.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Ta(i,e,t){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*e.parentNode[t])):n=i,n}const xa=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function UL(i,e){return xa(i).getPropertyValue(e)}const _L=["top","right","bottom","left"];function $i(i,e,t){const n={};t=t?"-"+t:"";for(let o=0;o<4;o++){const r=_L[o];n[r]=parseFloat(i[e+"-"+r+t])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const BL=(i,e,t)=>(i>0||e>0)&&(!t||!t.shadowRoot);function PL(i,e){const t=i.touches,n=t&&t.length?t[0]:i,{offsetX:o,offsetY:r}=n;let a=!1,l,M;if(BL(o,r,i.target))l=o,M=r;else{const c=e.getBoundingClientRect();l=n.clientX-c.left,M=n.clientY-c.top,a=!0}return{x:l,y:M,box:a}}function Ji(i,e){if("native"in i)return i;const{canvas:t,currentDevicePixelRatio:n}=e,o=xa(t),r=o.boxSizing==="border-box",a=$i(o,"padding"),l=$i(o,"border","width"),{x:M,y:c,box:u}=PL(i,t),g=a.left+(u&&l.left),d=a.top+(u&&l.top);let{width:y,height:j}=e;return r&&(y-=a.width+l.width,j-=a.height+l.height),{x:Math.round((M-g)/y*t.width/n),y:Math.round((c-d)/j*t.height/n)}}function RL(i,e,t){let n,o;if(e===void 0||t===void 0){const r=EM(i);if(!r)e=i.clientWidth,t=i.clientHeight;else{const a=r.getBoundingClientRect(),l=xa(r),M=$i(l,"border","width"),c=$i(l,"padding");e=a.width-c.width-M.width,t=a.height-c.height-M.height,n=Ta(l.maxWidth,r,"clientWidth"),o=Ta(l.maxHeight,r,"clientHeight")}}return{width:e,height:t,maxWidth:n||Ia,maxHeight:o||Ia}}const La=i=>Math.round(i*10)/10;function ZL(i,e,t,n){const o=xa(i),r=$i(o,"margin"),a=Ta(o.maxWidth,i,"clientWidth")||Ia,l=Ta(o.maxHeight,i,"clientHeight")||Ia,M=RL(i,e,t);let{width:c,height:u}=M;if(o.boxSizing==="content-box"){const d=$i(o,"border","width"),y=$i(o,"padding");c-=y.width+d.width,u-=y.height+d.height}return c=Math.max(0,c-r.width),u=Math.max(0,n?c/n:u-r.height),c=La(Math.min(c,a,M.maxWidth)),u=La(Math.min(u,l,M.maxHeight)),c&&!u&&(u=La(c/2)),(e!==void 0||t!==void 0)&&n&&M.height&&u>M.height&&(u=M.height,c=La(Math.floor(u*n))),{width:c,height:u}}function tN(i,e,t){const n=e||1,o=Math.floor(i.height*n),r=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(t||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==o||a.width!==r?(i.currentDevicePixelRatio=n,a.height=o,a.width=r,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const VL=function(){let i=!1;try{const e={get passive(){return i=!0,!1}};LM()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return i}();function iN(i,e){const t=UL(i,e),n=t&&t.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Xi(i,e,t,n){return{x:i.x+t*(e.x-i.x),y:i.y+t*(e.y-i.y)}}function GL(i,e,t,n){return{x:i.x+t*(e.x-i.x),y:n==="middle"?t<.5?i.y:e.y:n==="after"?t<1?i.y:e.y:t>0?e.y:i.y}}function WL(i,e,t,n){const o={x:i.cp2x,y:i.cp2y},r={x:e.cp1x,y:e.cp1y},a=Xi(i,o,t),l=Xi(o,r,t),M=Xi(r,e,t),c=Xi(a,l,t),u=Xi(l,M,t);return Xi(c,u,t)}const HL=function(i,e){return{x(t){return i+i+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,n){return t-n},leftForLtr(t,n){return t-n}}},FL=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,e){return i+e},leftForLtr(i,e){return i}}};function bM(i,e,t){return i?HL(e,t):FL()}function $L(i,e){let t,n;(e==="ltr"||e==="rtl")&&(t=i.canvas.style,n=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),i.prevTextDirection=n)}function JL(i,e){e!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",e[0],e[1]))}function nN(i){return i==="angle"?{between:Sd,compare:Hx,normalize:zt}:{between:ha,compare:(e,t)=>e-t,normalize:e=>e}}function oN({start:i,end:e,count:t,loop:n,style:o}){return{start:i%t,end:e%t,loop:n&&(e-i+1)%t===0,style:o}}function XL(i,e,t){const{property:n,start:o,end:r}=t,{between:a,normalize:l}=nN(n),M=e.length;let{start:c,end:u,loop:g}=i,d,y;if(g){for(c+=M,u+=M,d=0,y=M;d<y&&a(l(e[c%M][n]),o,r);++d)c--,u--;c%=M,u%=M}return u<c&&(u+=M),{start:c,end:u,loop:g,style:i.style}}function rN(i,e,t){if(!t)return[i];const{property:n,start:o,end:r}=t,a=e.length,{compare:l,between:M,normalize:c}=nN(n),{start:u,end:g,loop:d,style:y}=XL(i,e,t),j=[];let D=!1,I=null,N,m,b;const C=()=>M(o,b,N)&&l(o,b)!==0,E=()=>l(r,N)===0||M(r,b,N),A=()=>D||C(),O=()=>!D||E();for(let f=u,z=u;f<=g;++f)m=e[f%a],!m.skip&&(N=c(m[n]),N!==b&&(D=M(N,o,r),I===null&&A()&&(I=l(N,o)===0?f:z),I!==null&&O()&&(j.push(oN({start:I,end:f,loop:d,count:a,style:y})),I=null),z=f,b=N));return I!==null&&j.push(oN({start:I,end:g,loop:d,count:a,style:y})),j}function aN(i,e){const t=[],n=i.segments;for(let o=0;o<n.length;o++){const r=rN(n[o],i.points,e);r.length&&t.push(...r)}return t}function KL(i,e,t,n){let o=0,r=e-1;if(t&&!n)for(;o<e&&!i[o].skip;)o++;for(;o<e&&i[o].skip;)o++;for(o%=e,t&&(r+=o);r>o&&i[r%e].skip;)r--;return r%=e,{start:o,end:r}}function qL(i,e,t,n){const o=i.length,r=[];let a=e,l=i[e],M;for(M=e+1;M<=t;++M){const c=i[M%o];c.skip||c.stop?l.skip||(n=!1,r.push({start:e%o,end:(M-1)%o,loop:n}),e=a=c.stop?M:null):(a=M,l.skip&&(e=M)),l=c}return a!==null&&r.push({start:e%o,end:a%o,loop:n}),r}function e1(i,e){const t=i.points,n=i.options.spanGaps,o=t.length;if(!o)return[];const r=!!i._loop,{start:a,end:l}=KL(t,o,r,n);if(n===!0)return sN(i,[{start:a,end:l,loop:r}],t,e);const M=l<a?l+o:l,c=!!i._fullLoop&&a===0&&l===o-1;return sN(i,qL(t,a,M,c),t,e)}function sN(i,e,t,n){return!n||!n.setContext||!t?e:t1(i,e,t,n)}function t1(i,e,t,n){const o=i._chart.getContext(),r=lN(i.options),{_datasetIndex:a,options:{spanGaps:l}}=i,M=t.length,c=[];let u=r,g=e[0].start,d=g;function y(j,D,I,N){const m=l?-1:1;if(j!==D){for(j+=M;t[j%M].skip;)j-=m;for(;t[D%M].skip;)D+=m;j%M!==D%M&&(c.push({start:j%M,end:D%M,loop:I,style:N}),u=N,g=D%M)}}for(const j of e){g=l?g:j.start;let D=t[g%M],I;for(d=g+1;d<=j.end;d++){const N=t[d%M];I=lN(n.setContext(Ai(o,{type:"segment",p0:D,p1:N,p0DataIndex:(d-1)%M,p1DataIndex:d%M,datasetIndex:a}))),i1(I,u)&&y(g,d-1,j.loop,u),D=N,u=I}g<d-1&&y(g,d-1,j.loop,u)}return c}function lN(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function i1(i,e){if(!e)return!1;const t=[],n=function(o,r){return yM(r)?(t.includes(r)||t.push(r),t.indexOf(r)):r};return JSON.stringify(i,n)!==JSON.stringify(e,n)}/*!
12
+ */function ai(){}const vx=(()=>{let i=0;return()=>i++})();function be(i){return i===null||typeof i>"u"}function Se(i){if(Array.isArray&&Array.isArray(i))return!0;const e=Object.prototype.toString.call(i);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function pe(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function Ze(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Dt(i,e){return Ze(i)?i:e}function xe(i,e){return typeof i>"u"?e:i}const Qx=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*e:+i;function Ve(i,e,t){if(i&&typeof i.call=="function")return i.apply(t,e)}function Oe(i,e,t,n){let o,r,a;if(Se(i))if(r=i.length,n)for(o=r-1;o>=0;o--)e.call(t,i[o],o);else for(o=0;o<r;o++)e.call(t,i[o],o);else if(pe(i))for(a=Object.keys(i),r=a.length,o=0;o<r;o++)e.call(t,i[a[o]],a[o])}function ja(i,e){let t,n,o,r;if(!i||!e||i.length!==e.length)return!1;for(t=0,n=i.length;t<n;++t)if(o=i[t],r=e[t],o.datasetIndex!==r.datasetIndex||o.index!==r.index)return!1;return!0}function ya(i){if(Se(i))return i.map(ya);if(pe(i)){const e=Object.create(null),t=Object.keys(i),n=t.length;let o=0;for(;o<n;++o)e[t[o]]=ya(i[t[o]]);return e}return i}function xd(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Yx(i,e,t,n){if(!xd(i))return;const o=e[i],r=t[i];pe(o)&&pe(r)?Fn(o,r,n):e[i]=ya(r)}function Fn(i,e,t){const n=Se(e)?e:[e],o=n.length;if(!pe(i))return i;t=t||{};const r=t.merger||Yx;let a;for(let l=0;l<o;++l){if(a=n[l],!pe(a))continue;const M=Object.keys(a);for(let c=0,u=M.length;c<u;++c)r(M[c],i,a,t)}return i}function $n(i,e){return Fn(i,e,{merger:Ux})}function Ux(i,e,t){if(!xd(i))return;const n=e[i],o=t[i];pe(n)&&pe(o)?$n(n,o):Object.prototype.hasOwnProperty.call(e,i)||(e[i]=ya(o))}const Ld={"":i=>i,x:i=>i.x,y:i=>i.y};function _x(i){const e=i.split("."),t=[];let n="";for(const o of e)n+=o,n.endsWith("\\")?n=n.slice(0,-1)+".":(t.push(n),n="");return t}function Bx(i){const e=_x(i);return t=>{for(const n of e){if(n==="")break;t=t&&t[n]}return t}}function Dn(i,e){return(Ld[e]||(Ld[e]=Bx(e)))(i)}function gM(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Jn=i=>typeof i<"u",pi=i=>typeof i=="function",Ed=(i,e)=>{if(i.size!==e.size)return!1;for(const t of i)if(!e.has(t))return!1;return!0};function Px(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const Xe=Math.PI,ft=2*Xe,Rx=ft+Xe,Ia=Number.POSITIVE_INFINITY,Zx=Xe/180,pt=Xe/2,Gi=Xe/4,bd=Xe*2/3,zi=Math.log10,$t=Math.sign;function Xn(i,e,t){return Math.abs(i-e)<t}function Od(i){const e=Math.round(i);i=Xn(i,e,i/1e3)?e:i;const t=Math.pow(10,Math.floor(zi(i))),n=i/t;return(n<=1?1:n<=2?2:n<=5?5:10)*t}function Vx(i){const e=[],t=Math.sqrt(i);let n;for(n=1;n<t;n++)i%n===0&&(e.push(n),e.push(i/n));return t===(t|0)&&e.push(t),e.sort((o,r)=>o-r).pop(),e}function Kn(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Gx(i,e){const t=Math.round(i);return t-e<=i&&t+e>=i}function Cd(i,e,t){let n,o,r;for(n=0,o=i.length;n<o;n++)r=i[n][t],isNaN(r)||(e.min=Math.min(e.min,r),e.max=Math.max(e.max,r))}function mi(i){return i*(Xe/180)}function dM(i){return i*(180/Xe)}function wd(i){if(!Ze(i))return;let e=1,t=0;for(;Math.round(i*e)/e!==i;)e*=10,t++;return t}function Wx(i,e){const t=e.x-i.x,n=e.y-i.y,o=Math.sqrt(t*t+n*n);let r=Math.atan2(n,t);return r<-.5*Xe&&(r+=ft),{angle:r,distance:o}}function NM(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function Hx(i,e){return(i-e+Rx)%ft-Xe}function zt(i){return(i%ft+ft)%ft}function Sd(i,e,t,n){const o=zt(i),r=zt(e),a=zt(t),l=zt(r-o),M=zt(a-o),c=zt(o-r),u=zt(o-a);return o===r||o===a||n&&r===a||l>M&&c<u}function mt(i,e,t){return Math.max(e,Math.min(t,i))}function Fx(i){return mt(i,-32768,32767)}function ha(i,e,t,n=1e-6){return i>=Math.min(e,t)-n&&i<=Math.max(e,t)+n}function jM(i,e,t){t=t||(a=>i[a]<e);let n=i.length-1,o=0,r;for(;n-o>1;)r=o+n>>1,t(r)?o=r:n=r;return{lo:o,hi:n}}const Wi=(i,e,t,n)=>jM(i,t,n?o=>{const r=i[o][e];return r<t||r===t&&i[o+1][e]===t}:o=>i[o][e]<t),$x=(i,e,t)=>jM(i,t,n=>i[n][e]>=t);function Jx(i,e,t){let n=0,o=i.length;for(;n<o&&i[n]<e;)n++;for(;o>n&&i[o-1]>t;)o--;return n>0||o<i.length?i.slice(n,o):i}const kd=["push","pop","shift","splice","unshift"];function Xx(i,e){if(i._chartjs){i._chartjs.listeners.push(e);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),kd.forEach(t=>{const n="_onData"+gM(t),o=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...r){const a=o.apply(this,r);return i._chartjs.listeners.forEach(l=>{typeof l[n]=="function"&&l[n](...r)}),a}})})}function vd(i,e){const t=i._chartjs;if(!t)return;const n=t.listeners,o=n.indexOf(e);o!==-1&&n.splice(o,1),!(n.length>0)&&(kd.forEach(r=>{delete i[r]}),delete i._chartjs)}function Qd(i){const e=new Set(i);return e.size===i.length?i:Array.from(e)}const Yd=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Ud(i,e){let t=[],n=!1;return function(...o){t=o,n||(n=!0,Yd.call(window,()=>{n=!1,i.apply(e,t)}))}}function Kx(i,e){let t;return function(...n){return e?(clearTimeout(t),t=setTimeout(i,e,n)):i.apply(this,n),e}}const _d=i=>i==="start"?"left":i==="end"?"right":"center",qn=(i,e,t)=>i==="start"?e:i==="end"?t:(e+t)/2;function qx(i,e,t){const n=e.length;let o=0,r=n;if(i._sorted){const{iScale:a,_parsed:l}=i,M=a.axis,{min:c,max:u,minDefined:g,maxDefined:d}=a.getUserBounds();g&&(o=mt(Math.min(Wi(l,M,c).lo,t?n:Wi(e,M,a.getPixelForValue(c)).lo),0,n-1)),d?r=mt(Math.max(Wi(l,a.axis,u,!0).hi+1,t?0:Wi(e,M,a.getPixelForValue(u),!0).hi+1),o,n)-o:r=n-o}return{start:o,count:r}}function eL(i){const{xScale:e,yScale:t,_scaleRanges:n}=i,o={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!n)return i._scaleRanges=o,!0;const r=n.xmin!==e.min||n.xmax!==e.max||n.ymin!==t.min||n.ymax!==t.max;return Object.assign(n,o),r}const Da=i=>i===0||i===1,Bd=(i,e,t)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-e)*ft/t)),Pd=(i,e,t)=>Math.pow(2,-10*i)*Math.sin((i-e)*ft/t)+1,eo={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*pt)+1,easeOutSine:i=>Math.sin(i*pt),easeInOutSine:i=>-.5*(Math.cos(Xe*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Da(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Da(i)?i:Bd(i,.075,.3),easeOutElastic:i=>Da(i)?i:Pd(i,.075,.3),easeInOutElastic(i){return Da(i)?i:i<.5?.5*Bd(i*2,.1125,.45):.5+.5*Pd(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let e=1.70158;return(i/=.5)<1?.5*(i*i*(((e*=1.525)+1)*i-e)):.5*((i-=2)*i*(((e*=1.525)+1)*i+e)+2)},easeInBounce:i=>1-eo.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?eo.easeInBounce(i*2)*.5:eo.easeOutBounce(i*2-1)*.5+.5};function yM(i){if(i&&typeof i=="object"){const e=i.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Rd(i){return yM(i)?i:new Hn(i)}function IM(i){return yM(i)?i:new Hn(i).saturate(.5).darken(.1).hexString()}const tL=["x","y","borderWidth","radius","tension"],iL=["color","borderColor","backgroundColor"];function nL(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),i.set("animations",{colors:{type:"color",properties:iL},numbers:{type:"number",properties:tL}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function oL(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Zd=new Map;function rL(i,e){e=e||{};const t=i+JSON.stringify(e);let n=Zd.get(t);return n||(n=new Intl.NumberFormat(i,e),Zd.set(t,n)),n}function hM(i,e,t){return rL(e,t).format(i)}const Vd={values(i){return Se(i)?i:""+i},numeric(i,e,t){if(i===0)return"0";const n=this.chart.options.locale;let o,r=i;if(t.length>1){const c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(o="scientific"),r=aL(i,t)}const a=zi(Math.abs(r)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),M={notation:o,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(M,this.options.ticks.format),hM(i,n,M)},logarithmic(i,e,t){if(i===0)return"0";const n=t[e].significand||i/Math.pow(10,Math.floor(zi(i)));return[1,2,3,5,10,15].includes(n)||e>.8*t.length?Vd.numeric.call(this,i,e,t):""}};function aL(i,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&i!==Math.floor(i)&&(t=i-Math.floor(i)),t}var fa={formatters:Vd};function sL(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:fa.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const Hi=Object.create(null),DM=Object.create(null);function to(i,e){if(!e)return i;const t=e.split(".");for(let n=0,o=t.length;n<o;++n){const r=t[n];i=i[r]||(i[r]=Object.create(null))}return i}function fM(i,e,t){return typeof e=="string"?Fn(to(i,e),t):Fn(to(i,""),e)}class lL{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=n=>n.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(n,o)=>IM(o.backgroundColor),this.hoverBorderColor=(n,o)=>IM(o.borderColor),this.hoverColor=(n,o)=>IM(o.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return fM(this,e,t)}get(e){return to(this,e)}describe(e,t){return fM(DM,e,t)}override(e,t){return fM(Hi,e,t)}route(e,t,n,o){const r=to(this,e),a=to(this,n),l="_"+t;Object.defineProperties(r,{[l]:{value:r[t],writable:!0},[t]:{enumerable:!0,get(){const M=this[l],c=a[o];return pe(M)?Object.assign({},c,M):xe(M,c)},set(M){this[l]=M}}})}apply(e){e.forEach(t=>t(this))}}var Fe=new lL({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[nL,oL,sL]);function ML(i){return!i||be(i.size)||be(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function pa(i,e,t,n,o){let r=e[o];return r||(r=e[o]=i.measureText(o).width,t.push(o)),r>n&&(n=r),n}function cL(i,e,t,n){n=n||{};let o=n.data=n.data||{},r=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(o=n.data={},r=n.garbageCollect=[],n.font=e),i.save(),i.font=e;let a=0;const l=t.length;let M,c,u,g,d;for(M=0;M<l;M++)if(g=t[M],g!=null&&!Se(g))a=pa(i,o,r,a,g);else if(Se(g))for(c=0,u=g.length;c<u;c++)d=g[c],d!=null&&!Se(d)&&(a=pa(i,o,r,a,d));i.restore();const y=r.length/2;if(y>t.length){for(M=0;M<y;M++)delete o[r[M]];r.splice(0,y)}return a}function Fi(i,e,t){const n=i.currentDevicePixelRatio,o=t!==0?Math.max(t/2,.5):0;return Math.round((e-o)*n)/n+o}function Gd(i,e){e=e||i.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,i.width,i.height),e.restore()}function pM(i,e,t,n){uL(i,e,t,n,null)}function uL(i,e,t,n,o){let r,a,l,M,c,u,g,d;const y=e.pointStyle,j=e.rotation,D=e.radius;let I=(j||0)*Zx;if(y&&typeof y=="object"&&(r=y.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){i.save(),i.translate(t,n),i.rotate(I),i.drawImage(y,-y.width/2,-y.height/2,y.width,y.height),i.restore();return}if(!(isNaN(D)||D<=0)){switch(i.beginPath(),y){default:o?i.ellipse(t,n,o/2,D,0,0,ft):i.arc(t,n,D,0,ft),i.closePath();break;case"triangle":u=o?o/2:D,i.moveTo(t+Math.sin(I)*u,n-Math.cos(I)*D),I+=bd,i.lineTo(t+Math.sin(I)*u,n-Math.cos(I)*D),I+=bd,i.lineTo(t+Math.sin(I)*u,n-Math.cos(I)*D),i.closePath();break;case"rectRounded":c=D*.516,M=D-c,a=Math.cos(I+Gi)*M,g=Math.cos(I+Gi)*(o?o/2-c:M),l=Math.sin(I+Gi)*M,d=Math.sin(I+Gi)*(o?o/2-c:M),i.arc(t-g,n-l,c,I-Xe,I-pt),i.arc(t+d,n-a,c,I-pt,I),i.arc(t+g,n+l,c,I,I+pt),i.arc(t-d,n+a,c,I+pt,I+Xe),i.closePath();break;case"rect":if(!j){M=Math.SQRT1_2*D,u=o?o/2:M,i.rect(t-u,n-M,2*u,2*M);break}I+=Gi;case"rectRot":g=Math.cos(I)*(o?o/2:D),a=Math.cos(I)*D,l=Math.sin(I)*D,d=Math.sin(I)*(o?o/2:D),i.moveTo(t-g,n-l),i.lineTo(t+d,n-a),i.lineTo(t+g,n+l),i.lineTo(t-d,n+a),i.closePath();break;case"crossRot":I+=Gi;case"cross":g=Math.cos(I)*(o?o/2:D),a=Math.cos(I)*D,l=Math.sin(I)*D,d=Math.sin(I)*(o?o/2:D),i.moveTo(t-g,n-l),i.lineTo(t+g,n+l),i.moveTo(t+d,n-a),i.lineTo(t-d,n+a);break;case"star":g=Math.cos(I)*(o?o/2:D),a=Math.cos(I)*D,l=Math.sin(I)*D,d=Math.sin(I)*(o?o/2:D),i.moveTo(t-g,n-l),i.lineTo(t+g,n+l),i.moveTo(t+d,n-a),i.lineTo(t-d,n+a),I+=Gi,g=Math.cos(I)*(o?o/2:D),a=Math.cos(I)*D,l=Math.sin(I)*D,d=Math.sin(I)*(o?o/2:D),i.moveTo(t-g,n-l),i.lineTo(t+g,n+l),i.moveTo(t+d,n-a),i.lineTo(t-d,n+a);break;case"line":a=o?o/2:Math.cos(I)*D,l=Math.sin(I)*D,i.moveTo(t-a,n-l),i.lineTo(t+a,n+l);break;case"dash":i.moveTo(t,n),i.lineTo(t+Math.cos(I)*(o?o/2:D),n+Math.sin(I)*D);break;case!1:i.closePath();break}i.fill(),e.borderWidth>0&&i.stroke()}}function si(i,e,t){return t=t||.5,!e||i&&i.x>e.left-t&&i.x<e.right+t&&i.y>e.top-t&&i.y<e.bottom+t}function zM(i,e){i.save(),i.beginPath(),i.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),i.clip()}function mM(i){i.restore()}function gL(i,e,t,n,o){if(!e)return i.lineTo(t.x,t.y);if(o==="middle"){const r=(e.x+t.x)/2;i.lineTo(r,e.y),i.lineTo(r,t.y)}else o==="after"!=!!n?i.lineTo(e.x,t.y):i.lineTo(t.x,e.y);i.lineTo(t.x,t.y)}function dL(i,e,t,n){if(!e)return i.lineTo(t.x,t.y);i.bezierCurveTo(n?e.cp1x:e.cp2x,n?e.cp1y:e.cp2y,n?t.cp2x:t.cp1x,n?t.cp2y:t.cp1y,t.x,t.y)}function NL(i,e){e.translation&&i.translate(e.translation[0],e.translation[1]),be(e.rotation)||i.rotate(e.rotation),e.color&&(i.fillStyle=e.color),e.textAlign&&(i.textAlign=e.textAlign),e.textBaseline&&(i.textBaseline=e.textBaseline)}function jL(i,e,t,n,o){if(o.strikethrough||o.underline){const r=i.measureText(n),a=e-r.actualBoundingBoxLeft,l=e+r.actualBoundingBoxRight,M=t-r.actualBoundingBoxAscent,c=t+r.actualBoundingBoxDescent,u=o.strikethrough?(M+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=o.decorationWidth||2,i.moveTo(a,u),i.lineTo(l,u),i.stroke()}}function yL(i,e){const t=i.fillStyle;i.fillStyle=e.color,i.fillRect(e.left,e.top,e.width,e.height),i.fillStyle=t}function io(i,e,t,n,o,r={}){const a=Se(e)?e:[e],l=r.strokeWidth>0&&r.strokeColor!=="";let M,c;for(i.save(),i.font=o.string,NL(i,r),M=0;M<a.length;++M)c=a[M],r.backdrop&&yL(i,r.backdrop),l&&(r.strokeColor&&(i.strokeStyle=r.strokeColor),be(r.strokeWidth)||(i.lineWidth=r.strokeWidth),i.strokeText(c,t,n,r.maxWidth)),i.fillText(c,t,n,r.maxWidth),jL(i,t,n,c,r),n+=Number(o.lineHeight);i.restore()}function za(i,e){const{x:t,y:n,w:o,h:r,radius:a}=e;i.arc(t+a.topLeft,n+a.topLeft,a.topLeft,1.5*Xe,Xe,!0),i.lineTo(t,n+r-a.bottomLeft),i.arc(t+a.bottomLeft,n+r-a.bottomLeft,a.bottomLeft,Xe,pt,!0),i.lineTo(t+o-a.bottomRight,n+r),i.arc(t+o-a.bottomRight,n+r-a.bottomRight,a.bottomRight,pt,0,!0),i.lineTo(t+o,n+a.topRight),i.arc(t+o-a.topRight,n+a.topRight,a.topRight,0,-pt,!0),i.lineTo(t+a.topLeft,n)}const IL=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,hL=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function DL(i,e){const t=(""+i).match(IL);if(!t||t[1]==="normal")return e*1.2;switch(i=+t[2],t[3]){case"px":return i;case"%":i/=100;break}return e*i}const fL=i=>+i||0;function Wd(i,e){const t={},n=pe(e),o=n?Object.keys(e):e,r=pe(i)?n?a=>xe(i[a],i[e[a]]):a=>i[a]:()=>i;for(const a of o)t[a]=fL(r(a));return t}function Hd(i){return Wd(i,{top:"y",right:"x",bottom:"y",left:"x"})}function fn(i){return Wd(i,["topLeft","topRight","bottomLeft","bottomRight"])}function At(i){const e=Hd(i);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ut(i,e){i=i||{},e=e||Fe.font;let t=xe(i.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let n=xe(i.style,e.style);n&&!(""+n).match(hL)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const o={family:xe(i.family,e.family),lineHeight:DL(xe(i.lineHeight,e.lineHeight),t),size:t,style:n,weight:xe(i.weight,e.weight),string:""};return o.string=ML(o),o}function ma(i,e,t,n){let o=!0,r,a,l;for(r=0,a=i.length;r<a;++r)if(l=i[r],l!==void 0&&(e!==void 0&&typeof l=="function"&&(l=l(e),o=!1),t!==void 0&&Se(l)&&(l=l[t%l.length],o=!1),l!==void 0))return n&&!o&&(n.cacheable=!1),l}function pL(i,e,t){const{min:n,max:o}=i,r=Qx(e,(o-n)/2),a=(l,M)=>t&&l===0?0:l+M;return{min:a(n,-Math.abs(r)),max:a(o,r)}}function Ai(i,e){return Object.assign(Object.create(i),e)}function AM(i,e=[""],t,n,o=()=>i[0]){const r=t||i;typeof n>"u"&&(n=Kd("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:r,_fallback:n,_getTarget:o,override:l=>AM([l,...i],e,r,n)};return new Proxy(a,{deleteProperty(l,M){return delete l[M],delete l._keys,delete i[0][M],!0},get(l,M){return $d(l,M,()=>bL(M,e,i,l))},getOwnPropertyDescriptor(l,M){return Reflect.getOwnPropertyDescriptor(l._scopes[0],M)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(l,M){return qd(l).includes(M)},ownKeys(l){return qd(l)},set(l,M,c){const u=l._storage||(l._storage=o());return l[M]=u[M]=c,delete l._keys,!0}})}function pn(i,e,t,n){const o={_cacheable:!1,_proxy:i,_context:e,_subProxy:t,_stack:new Set,_descriptors:Fd(i,n),setContext:r=>pn(i,r,t,n),override:r=>pn(i.override(r),e,t,n)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete i[a],!0},get(r,a,l){return $d(r,a,()=>mL(r,a,l))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(r,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(r,a,l){return i[a]=l,delete r[a],!0}})}function Fd(i,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:n=e.indexable,_allKeys:o=e.allKeys}=i;return{allKeys:o,scriptable:t,indexable:n,isScriptable:pi(t)?t:()=>t,isIndexable:pi(n)?n:()=>n}}const zL=(i,e)=>i?i+gM(e):e,TM=(i,e)=>pe(e)&&i!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function $d(i,e,t){if(Object.prototype.hasOwnProperty.call(i,e))return i[e];const n=t();return i[e]=n,n}function mL(i,e,t){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=i;let l=n[e];return pi(l)&&a.isScriptable(e)&&(l=AL(e,l,i,t)),Se(l)&&l.length&&(l=TL(e,l,i,a.isIndexable)),TM(e,l)&&(l=pn(l,o,r&&r[e],a)),l}function AL(i,e,t,n){const{_proxy:o,_context:r,_subProxy:a,_stack:l}=t;if(l.has(i))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+i);l.add(i);let M=e(r,a||n);return l.delete(i),TM(i,M)&&(M=xM(o._scopes,o,i,M)),M}function TL(i,e,t,n){const{_proxy:o,_context:r,_subProxy:a,_descriptors:l}=t;if(typeof r.index<"u"&&n(i))return e[r.index%e.length];if(pe(e[0])){const M=e,c=o._scopes.filter(u=>u!==M);e=[];for(const u of M){const g=xM(c,o,i,u);e.push(pn(g,r,a&&a[i],l))}}return e}function Jd(i,e,t){return pi(i)?i(e,t):i}const xL=(i,e)=>i===!0?e:typeof i=="string"?Dn(e,i):void 0;function LL(i,e,t,n,o){for(const r of e){const a=xL(t,r);if(a){i.add(a);const l=Jd(a._fallback,t,o);if(typeof l<"u"&&l!==t&&l!==n)return l}else if(a===!1&&typeof n<"u"&&t!==n)return null}return!1}function xM(i,e,t,n){const o=e._rootScopes,r=Jd(e._fallback,t,n),a=[...i,...o],l=new Set;l.add(n);let M=Xd(l,a,t,r||t,n);return M===null||typeof r<"u"&&r!==t&&(M=Xd(l,a,r,M,n),M===null)?!1:AM(Array.from(l),[""],o,r,()=>EL(e,t,n))}function Xd(i,e,t,n,o){for(;t;)t=LL(i,e,t,n,o);return t}function EL(i,e,t){const n=i._getTarget();e in n||(n[e]={});const o=n[e];return Se(o)&&pe(t)?t:o||{}}function bL(i,e,t,n){let o;for(const r of e)if(o=Kd(zL(r,i),t),typeof o<"u")return TM(i,o)?xM(t,n,i,o):o}function Kd(i,e){for(const t of e){if(!t)continue;const n=t[i];if(typeof n<"u")return n}}function qd(i){let e=i._keys;return e||(e=i._keys=OL(i._scopes)),e}function OL(i){const e=new Set;for(const t of i)for(const n of Object.keys(t).filter(o=>!o.startsWith("_")))e.add(n);return Array.from(e)}const CL=Number.EPSILON||1e-14,zn=(i,e)=>e<i.length&&!i[e].skip&&i[e],eN=i=>i==="x"?"y":"x";function wL(i,e,t,n){const o=i.skip?e:i,r=e,a=t.skip?e:t,l=NM(r,o),M=NM(a,r);let c=l/(l+M),u=M/(l+M);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const g=n*c,d=n*u;return{previous:{x:r.x-g*(a.x-o.x),y:r.y-g*(a.y-o.y)},next:{x:r.x+d*(a.x-o.x),y:r.y+d*(a.y-o.y)}}}function SL(i,e,t){const n=i.length;let o,r,a,l,M,c=zn(i,0);for(let u=0;u<n-1;++u)if(M=c,c=zn(i,u+1),!(!M||!c)){if(Xn(e[u],0,CL)){t[u]=t[u+1]=0;continue}o=t[u]/e[u],r=t[u+1]/e[u],l=Math.pow(o,2)+Math.pow(r,2),!(l<=9)&&(a=3/Math.sqrt(l),t[u]=o*a*e[u],t[u+1]=r*a*e[u])}}function kL(i,e,t="x"){const n=eN(t),o=i.length;let r,a,l,M=zn(i,0);for(let c=0;c<o;++c){if(a=l,l=M,M=zn(i,c+1),!l)continue;const u=l[t],g=l[n];a&&(r=(u-a[t])/3,l[`cp1${t}`]=u-r,l[`cp1${n}`]=g-r*e[c]),M&&(r=(M[t]-u)/3,l[`cp2${t}`]=u+r,l[`cp2${n}`]=g+r*e[c])}}function vL(i,e="x"){const t=eN(e),n=i.length,o=Array(n).fill(0),r=Array(n);let a,l,M,c=zn(i,0);for(a=0;a<n;++a)if(l=M,M=c,c=zn(i,a+1),!!M){if(c){const u=c[e]-M[e];o[a]=u!==0?(c[t]-M[t])/u:0}r[a]=l?c?$t(o[a-1])!==$t(o[a])?0:(o[a-1]+o[a])/2:o[a-1]:o[a]}SL(i,o,r),kL(i,r,e)}function Aa(i,e,t){return Math.max(Math.min(i,t),e)}function QL(i,e){let t,n,o,r,a,l=si(i[0],e);for(t=0,n=i.length;t<n;++t)a=r,r=l,l=t<n-1&&si(i[t+1],e),r&&(o=i[t],a&&(o.cp1x=Aa(o.cp1x,e.left,e.right),o.cp1y=Aa(o.cp1y,e.top,e.bottom)),l&&(o.cp2x=Aa(o.cp2x,e.left,e.right),o.cp2y=Aa(o.cp2y,e.top,e.bottom)))}function YL(i,e,t,n,o){let r,a,l,M;if(e.spanGaps&&(i=i.filter(c=>!c.skip)),e.cubicInterpolationMode==="monotone")vL(i,o);else{let c=n?i[i.length-1]:i[0];for(r=0,a=i.length;r<a;++r)l=i[r],M=wL(c,l,i[Math.min(r+1,a-(n?0:1))%a],e.tension),l.cp1x=M.previous.x,l.cp1y=M.previous.y,l.cp2x=M.next.x,l.cp2y=M.next.y,c=l}e.capBezierPoints&&QL(i,t)}function LM(){return typeof window<"u"&&typeof document<"u"}function EM(i){let e=i.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Ta(i,e,t){let n;return typeof i=="string"?(n=parseInt(i,10),i.indexOf("%")!==-1&&(n=n/100*e.parentNode[t])):n=i,n}const xa=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function UL(i,e){return xa(i).getPropertyValue(e)}const _L=["top","right","bottom","left"];function $i(i,e,t){const n={};t=t?"-"+t:"";for(let o=0;o<4;o++){const r=_L[o];n[r]=parseFloat(i[e+"-"+r+t])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const BL=(i,e,t)=>(i>0||e>0)&&(!t||!t.shadowRoot);function PL(i,e){const t=i.touches,n=t&&t.length?t[0]:i,{offsetX:o,offsetY:r}=n;let a=!1,l,M;if(BL(o,r,i.target))l=o,M=r;else{const c=e.getBoundingClientRect();l=n.clientX-c.left,M=n.clientY-c.top,a=!0}return{x:l,y:M,box:a}}function Ji(i,e){if("native"in i)return i;const{canvas:t,currentDevicePixelRatio:n}=e,o=xa(t),r=o.boxSizing==="border-box",a=$i(o,"padding"),l=$i(o,"border","width"),{x:M,y:c,box:u}=PL(i,t),g=a.left+(u&&l.left),d=a.top+(u&&l.top);let{width:y,height:j}=e;return r&&(y-=a.width+l.width,j-=a.height+l.height),{x:Math.round((M-g)/y*t.width/n),y:Math.round((c-d)/j*t.height/n)}}function RL(i,e,t){let n,o;if(e===void 0||t===void 0){const r=EM(i);if(!r)e=i.clientWidth,t=i.clientHeight;else{const a=r.getBoundingClientRect(),l=xa(r),M=$i(l,"border","width"),c=$i(l,"padding");e=a.width-c.width-M.width,t=a.height-c.height-M.height,n=Ta(l.maxWidth,r,"clientWidth"),o=Ta(l.maxHeight,r,"clientHeight")}}return{width:e,height:t,maxWidth:n||Ia,maxHeight:o||Ia}}const La=i=>Math.round(i*10)/10;function ZL(i,e,t,n){const o=xa(i),r=$i(o,"margin"),a=Ta(o.maxWidth,i,"clientWidth")||Ia,l=Ta(o.maxHeight,i,"clientHeight")||Ia,M=RL(i,e,t);let{width:c,height:u}=M;if(o.boxSizing==="content-box"){const d=$i(o,"border","width"),y=$i(o,"padding");c-=y.width+d.width,u-=y.height+d.height}return c=Math.max(0,c-r.width),u=Math.max(0,n?c/n:u-r.height),c=La(Math.min(c,a,M.maxWidth)),u=La(Math.min(u,l,M.maxHeight)),c&&!u&&(u=La(c/2)),(e!==void 0||t!==void 0)&&n&&M.height&&u>M.height&&(u=M.height,c=La(Math.floor(u*n))),{width:c,height:u}}function tN(i,e,t){const n=e||1,o=Math.floor(i.height*n),r=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(t||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||a.height!==o||a.width!==r?(i.currentDevicePixelRatio=n,a.height=o,a.width=r,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const VL=function(){let i=!1;try{const e={get passive(){return i=!0,!1}};LM()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return i}();function iN(i,e){const t=UL(i,e),n=t&&t.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Xi(i,e,t,n){return{x:i.x+t*(e.x-i.x),y:i.y+t*(e.y-i.y)}}function GL(i,e,t,n){return{x:i.x+t*(e.x-i.x),y:n==="middle"?t<.5?i.y:e.y:n==="after"?t<1?i.y:e.y:t>0?e.y:i.y}}function WL(i,e,t,n){const o={x:i.cp2x,y:i.cp2y},r={x:e.cp1x,y:e.cp1y},a=Xi(i,o,t),l=Xi(o,r,t),M=Xi(r,e,t),c=Xi(a,l,t),u=Xi(l,M,t);return Xi(c,u,t)}const HL=function(i,e){return{x(t){return i+i+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,n){return t-n},leftForLtr(t,n){return t-n}}},FL=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,e){return i+e},leftForLtr(i,e){return i}}};function bM(i,e,t){return i?HL(e,t):FL()}function $L(i,e){let t,n;(e==="ltr"||e==="rtl")&&(t=i.canvas.style,n=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),i.prevTextDirection=n)}function JL(i,e){e!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",e[0],e[1]))}function nN(i){return i==="angle"?{between:Sd,compare:Hx,normalize:zt}:{between:ha,compare:(e,t)=>e-t,normalize:e=>e}}function oN({start:i,end:e,count:t,loop:n,style:o}){return{start:i%t,end:e%t,loop:n&&(e-i+1)%t===0,style:o}}function XL(i,e,t){const{property:n,start:o,end:r}=t,{between:a,normalize:l}=nN(n),M=e.length;let{start:c,end:u,loop:g}=i,d,y;if(g){for(c+=M,u+=M,d=0,y=M;d<y&&a(l(e[c%M][n]),o,r);++d)c--,u--;c%=M,u%=M}return u<c&&(u+=M),{start:c,end:u,loop:g,style:i.style}}function rN(i,e,t){if(!t)return[i];const{property:n,start:o,end:r}=t,a=e.length,{compare:l,between:M,normalize:c}=nN(n),{start:u,end:g,loop:d,style:y}=XL(i,e,t),j=[];let D=!1,I=null,N,m,b;const C=()=>M(o,b,N)&&l(o,b)!==0,E=()=>l(r,N)===0||M(r,b,N),A=()=>D||C(),O=()=>!D||E();for(let f=u,z=u;f<=g;++f)m=e[f%a],!m.skip&&(N=c(m[n]),N!==b&&(D=M(N,o,r),I===null&&A()&&(I=l(N,o)===0?f:z),I!==null&&O()&&(j.push(oN({start:I,end:f,loop:d,count:a,style:y})),I=null),z=f,b=N));return I!==null&&j.push(oN({start:I,end:g,loop:d,count:a,style:y})),j}function aN(i,e){const t=[],n=i.segments;for(let o=0;o<n.length;o++){const r=rN(n[o],i.points,e);r.length&&t.push(...r)}return t}function KL(i,e,t,n){let o=0,r=e-1;if(t&&!n)for(;o<e&&!i[o].skip;)o++;for(;o<e&&i[o].skip;)o++;for(o%=e,t&&(r+=o);r>o&&i[r%e].skip;)r--;return r%=e,{start:o,end:r}}function qL(i,e,t,n){const o=i.length,r=[];let a=e,l=i[e],M;for(M=e+1;M<=t;++M){const c=i[M%o];c.skip||c.stop?l.skip||(n=!1,r.push({start:e%o,end:(M-1)%o,loop:n}),e=a=c.stop?M:null):(a=M,l.skip&&(e=M)),l=c}return a!==null&&r.push({start:e%o,end:a%o,loop:n}),r}function eE(i,e){const t=i.points,n=i.options.spanGaps,o=t.length;if(!o)return[];const r=!!i._loop,{start:a,end:l}=KL(t,o,r,n);if(n===!0)return sN(i,[{start:a,end:l,loop:r}],t,e);const M=l<a?l+o:l,c=!!i._fullLoop&&a===0&&l===o-1;return sN(i,qL(t,a,M,c),t,e)}function sN(i,e,t,n){return!n||!n.setContext||!t?e:tE(i,e,t,n)}function tE(i,e,t,n){const o=i._chart.getContext(),r=lN(i.options),{_datasetIndex:a,options:{spanGaps:l}}=i,M=t.length,c=[];let u=r,g=e[0].start,d=g;function y(j,D,I,N){const m=l?-1:1;if(j!==D){for(j+=M;t[j%M].skip;)j-=m;for(;t[D%M].skip;)D+=m;j%M!==D%M&&(c.push({start:j%M,end:D%M,loop:I,style:N}),u=N,g=D%M)}}for(const j of e){g=l?g:j.start;let D=t[g%M],I;for(d=g+1;d<=j.end;d++){const N=t[d%M];I=lN(n.setContext(Ai(o,{type:"segment",p0:D,p1:N,p0DataIndex:(d-1)%M,p1DataIndex:d%M,datasetIndex:a}))),iE(I,u)&&y(g,d-1,j.loop,u),D=N,u=I}g<d-1&&y(g,d-1,j.loop,u)}return c}function lN(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function iE(i,e){if(!e)return!1;const t=[],n=function(o,r){return yM(r)?(t.includes(r)||t.push(r),t.indexOf(r)):r};return JSON.stringify(i,n)!==JSON.stringify(e,n)}/*!
13
13
  * Chart.js v4.4.2
14
14
  * https://www.chartjs.org
15
15
  * (c) 2024 Chart.js Contributors
16
16
  * Released under the MIT License
17
- */class n1{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,o){const r=t.listeners[o],a=t.duration;r.forEach(l=>l({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Yd.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,o)=>{if(!n.running||!n.items.length)return;const r=n.items;let a=r.length-1,l=!1,M;for(;a>=0;--a)M=r[a],M._active?(M._total>n.duration&&(n.duration=M._total),M.tick(e),l=!0):(r[a]=r[r.length-1],r.pop());l&&(o.draw(),this._notify(o,n,e,"progress")),r.length||(n.running=!1,this._notify(o,n,e,"complete"),n.initial=!1),t+=r.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((n,o)=>Math.max(n,o._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const n=t.items;let o=n.length-1;for(;o>=0;--o)n[o].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var li=new n1;const MN="transparent",o1={boolean(i,e,t){return t>.5?e:i},color(i,e,t){const n=Rd(i||MN),o=n.valid&&Rd(e||MN);return o&&o.valid?o.mix(n,t).hexString():e},number(i,e,t){return i+(e-i)*t}};class r1{constructor(e,t,n,o){const r=t[n];o=ma([e.to,o,r,e.from]);const a=ma([e.from,r,o]);this._active=!0,this._fn=e.fn||o1[e.type||typeof a],this._easing=eo[e.easing]||eo.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=o,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const o=this._target[this._prop],r=n-this._start,a=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=ma([e.to,t,o,e.from]),this._from=ma([e.from,o,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,o=this._prop,r=this._from,a=this._loop,l=this._to;let M;if(this._active=r!==l&&(a||t<n),!this._active){this._target[o]=l,this._notify(!0);return}if(t<0){this._target[o]=r;return}M=t/n%2,M=a&&M>1?2-M:M,M=this._easing(Math.min(1,Math.max(0,M))),this._target[o]=this._fn(r,l,M)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let o=0;o<n.length;o++)n[o][t]()}}class cN{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!pe(e))return;const t=Object.keys(Fe.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(o=>{const r=e[o];if(!pe(r))return;const a={};for(const l of t)a[l]=r[l];(Se(r.properties)&&r.properties||[o]).forEach(l=>{(l===o||!n.has(l))&&n.set(l,a)})})}_animateOptions(e,t){const n=t.options,o=s1(e,n);if(!o)return[];const r=this._createAnimations(o,n);return n.$shared&&a1(e.options.$animations,n).then(()=>{e.options=n},()=>{}),r}_createAnimations(e,t){const n=this._properties,o=[],r=e.$animations||(e.$animations={}),a=Object.keys(t),l=Date.now();let M;for(M=a.length-1;M>=0;--M){const c=a[M];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(e,t));continue}const u=t[c];let g=r[c];const d=n.get(c);if(g)if(d&&g.active()){g.update(d,u,l);continue}else g.cancel();if(!d||!d.duration){e[c]=u;continue}r[c]=g=new r1(d,e,c,u),o.push(g)}return o}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const n=this._createAnimations(e,t);if(n.length)return li.add(this._chart,n),!0}}function a1(i,e){const t=[],n=Object.keys(e);for(let o=0;o<n.length;o++){const r=i[n[o]];r&&r.active()&&t.push(r.wait())}return Promise.all(t)}function s1(i,e){if(!e)return;let t=i.options;if(!t){i.options=e;return}return t.$shared&&(i.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function uN(i,e){const t=i&&i.options||{},n=t.reverse,o=t.min===void 0?e:0,r=t.max===void 0?e:0;return{start:n?r:o,end:n?o:r}}function l1(i,e,t){if(t===!1)return!1;const n=uN(i,t),o=uN(e,t);return{top:o.end,right:n.end,bottom:o.start,left:n.start}}function M1(i){let e,t,n,o;return pe(i)?(e=i.top,t=i.right,n=i.bottom,o=i.left):e=t=n=o=i,{top:e,right:t,bottom:n,left:o,disabled:i===!1}}function gN(i,e){const t=[],n=i._getSortedDatasetMetas(e);let o,r;for(o=0,r=n.length;o<r;++o)t.push(n[o].index);return t}function dN(i,e,t,n={}){const o=i.keys,r=n.mode==="single";let a,l,M,c;if(e!==null){for(a=0,l=o.length;a<l;++a){if(M=+o[a],M===t){if(n.all)continue;break}c=i.values[M],Ze(c)&&(r||e===0||$t(e)===$t(c))&&(e+=c)}return e}}function c1(i){const e=Object.keys(i),t=new Array(e.length);let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n],t[n]={x:r,y:i[r]};return t}function NN(i,e){const t=i&&i.options.stacked;return t||t===void 0&&e.stack!==void 0}function u1(i,e,t){return`${i.id}.${e.id}.${t.stack||t.type}`}function g1(i){const{min:e,max:t,minDefined:n,maxDefined:o}=i.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:o?t:Number.POSITIVE_INFINITY}}function d1(i,e,t){const n=i[e]||(i[e]={});return n[t]||(n[t]={})}function jN(i,e,t,n){for(const o of e.getMatchingVisibleMetas(n).reverse()){const r=i[o.index];if(t&&r>0||!t&&r<0)return o.index}return null}function yN(i,e){const{chart:t,_cachedMeta:n}=i,o=t._stacks||(t._stacks={}),{iScale:r,vScale:a,index:l}=n,M=r.axis,c=a.axis,u=u1(r,a,n),g=e.length;let d;for(let y=0;y<g;++y){const j=e[y],{[M]:D,[c]:I}=j,N=j._stacks||(j._stacks={});d=N[c]=d1(o,u,D),d[l]=I,d._top=jN(d,a,!0,n.type),d._bottom=jN(d,a,!1,n.type);const m=d._visualValues||(d._visualValues={});m[l]=I}}function OM(i,e){const t=i.scales;return Object.keys(t).filter(n=>t[n].axis===e).shift()}function N1(i,e){return Ai(i,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function j1(i,e,t){return Ai(i,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function no(i,e){const t=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){e=e||i._parsed;for(const o of e){const r=o._stacks;if(!r||r[n]===void 0||r[n][t]===void 0)return;delete r[n][t],r[n]._visualValues!==void 0&&r[n]._visualValues[t]!==void 0&&delete r[n]._visualValues[t]}}}const CM=i=>i==="reset"||i==="none",IN=(i,e)=>e?i:Object.assign({},i),y1=(i,e,t)=>i&&!e.hidden&&e._stacked&&{keys:gN(t,!0),values:null};class mn{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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=NN(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&&no(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,n=this.getDataset(),o=(g,d,y,j)=>g==="x"?d:g==="r"?j:y,r=t.xAxisID=xe(n.xAxisID,OM(e,"x")),a=t.yAxisID=xe(n.yAxisID,OM(e,"y")),l=t.rAxisID=xe(n.rAxisID,OM(e,"r")),M=t.indexAxis,c=t.iAxisID=o(M,r,a,l),u=t.vAxisID=o(M,a,r,l);t.xScale=this.getScaleForId(r),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(l),t.iScale=this.getScaleForId(c),t.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 t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&vd(this._data,this),e._stacked&&no(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(pe(t))this._data=c1(t);else if(n!==t){if(n){vd(n,this);const o=this._cachedMeta;no(o),o._parsed=[]}t&&Object.isExtensible(t)&&Xx(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,n=this.getDataset();let o=!1;this._dataCheck();const r=t._stacked;t._stacked=NN(t.vScale,t),t.stack!==n.stack&&(o=!0,no(t),t.stack=n.stack),this._resyncElements(e),(o||r!==t._stacked)&&yN(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:n,_data:o}=this,{iScale:r,_stacked:a}=n,l=r.axis;let M=e===0&&t===o.length?!0:n._sorted,c=e>0&&n._parsed[e-1],u,g,d;if(this._parsing===!1)n._parsed=o,n._sorted=!0,d=o;else{Se(o[e])?d=this.parseArrayData(n,o,e,t):pe(o[e])?d=this.parseObjectData(n,o,e,t):d=this.parsePrimitiveData(n,o,e,t);const y=()=>g[l]===null||c&&g[l]<c[l];for(u=0;u<t;++u)n._parsed[u+e]=g=d[u],M&&(y()&&(M=!1),c=g);n._sorted=M}a&&yN(this,d)}parsePrimitiveData(e,t,n,o){const{iScale:r,vScale:a}=e,l=r.axis,M=a.axis,c=r.getLabels(),u=r===a,g=new Array(o);let d,y,j;for(d=0,y=o;d<y;++d)j=d+n,g[d]={[l]:u||r.parse(c[j],j),[M]:a.parse(t[j],j)};return g}parseArrayData(e,t,n,o){const{xScale:r,yScale:a}=e,l=new Array(o);let M,c,u,g;for(M=0,c=o;M<c;++M)u=M+n,g=t[u],l[M]={x:r.parse(g[0],u),y:a.parse(g[1],u)};return l}parseObjectData(e,t,n,o){const{xScale:r,yScale:a}=e,{xAxisKey:l="x",yAxisKey:M="y"}=this._parsing,c=new Array(o);let u,g,d,y;for(u=0,g=o;u<g;++u)d=u+n,y=t[d],c[u]={x:r.parse(Dn(y,l),d),y:a.parse(Dn(y,M),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){const o=this.chart,r=this._cachedMeta,a=t[e.axis],l={keys:gN(o,!0),values:t._stacks[e.axis]._visualValues};return dN(l,a,r.index,{mode:n})}updateRangeFromParsed(e,t,n,o){const r=n[t.axis];let a=r===null?NaN:r;const l=o&&n._stacks[t.axis];o&&l&&(o.values=l,a=dN(o,r,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){const n=this._cachedMeta,o=n._parsed,r=n._sorted&&e===n.iScale,a=o.length,l=this._getOtherScale(e),M=y1(t,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:g}=g1(l);let d,y;function j(){y=o[d];const D=y[l.axis];return!Ze(y[e.axis])||u>D||g<D}for(d=0;d<a&&!(!j()&&(this.updateRangeFromParsed(c,e,y,M),r));++d);if(r){for(d=a-1;d>=0;--d)if(!j()){this.updateRangeFromParsed(c,e,y,M);break}}return c}getAllParsedValues(e){const t=this._cachedMeta._parsed,n=[];let o,r,a;for(o=0,r=t.length;o<r;++o)a=t[o][e.axis],Ze(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,n=t.iScale,o=t.vScale,r=this.getParsed(e);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:o?""+o.getLabelForValue(r[o.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=M1(xe(this.options.clip,l1(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,n=this._cachedMeta,o=n.data||[],r=t.chartArea,a=[],l=this._drawStart||0,M=this._drawCount||o.length-l,c=this.options.drawActiveElementsOnTop;let u;for(n.dataset&&n.dataset.draw(e,r,l,M),u=l;u<l+M;++u){const g=o[u];g.hidden||(g.active&&c?a.push(g):g.draw(e,r))}for(u=0;u<a.length;++u)a[u].draw(e,r)}getStyle(e,t){const n=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){const o=this.getDataset();let r;if(e>=0&&e<this._cachedMeta.data.length){const a=this._cachedMeta.data[e];r=a.$context||(a.$context=j1(this.getContext(),e,a)),r.parsed=this.getParsed(e),r.raw=o.data[e],r.index=r.dataIndex=e}else r=this.$context||(this.$context=N1(this.chart.getContext(),this.index)),r.dataset=o,r.index=r.datasetIndex=this.index;return r.active=!!t,r.mode=n,r}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",n){const o=t==="active",r=this._cachedDataOpts,a=e+"-"+t,l=r[a],M=this.enableOptionSharing&&Jn(n);if(l)return IN(l,M);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,e),g=o?[`${e}Hover`,"hover",e,""]:[e,""],d=c.getOptionScopes(this.getDataset(),u),y=Object.keys(Fe.elements[e]),j=()=>this.getContext(n,o,t),D=c.resolveNamedOptions(d,y,j,g);return D.$shared&&(D.$shared=M,r[a]=Object.freeze(IN(D,M))),D}_resolveAnimations(e,t,n){const o=this.chart,r=this._cachedDataOpts,a=`animation-${t}`,l=r[a];if(l)return l;let M;if(o.options.animation!==!1){const u=this.chart.config,g=u.datasetAnimationScopeKeys(this._type,t),d=u.getOptionScopes(this.getDataset(),g);M=u.createResolver(d,this.getContext(e,n,t))}const c=new cN(o,M&&M.animations);return M&&M._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||CM(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const n=this.resolveDataElementOptions(e,t),o=this._sharedOptions,r=this.getSharedOptions(n),a=this.includeOptions(t,r)||r!==o;return this.updateSharedOptions(r,t,n),{sharedOptions:r,includeOptions:a}}updateElement(e,t,n,o){CM(o)?Object.assign(e,n):this._resolveAnimations(t,o).update(e,n)}updateSharedOptions(e,t,n){e&&!CM(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,o){e.active=o;const r=this.getStyle(t,o);this._resolveAnimations(t,n,o).update(e,{options:!o&&this.getSharedOptions(r)||r})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"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 t=this._data,n=this._cachedMeta.data;for(const[l,M,c]of this._syncList)this[l](M,c);this._syncList=[];const o=n.length,r=t.length,a=Math.min(r,o);a&&this.parse(0,a),r>o?this._insertElements(o,r-o,e):r<o&&this._removeElements(r,o-r)}_insertElements(e,t,n=!0){const o=this._cachedMeta,r=o.data,a=e+t;let l;const M=c=>{for(c.length+=t,l=c.length-1;l>=a;l--)c[l]=c[l-t]};for(M(r),l=e;l<a;++l)r[l]=new this.dataElementType;this._parsing&&M(o._parsed),this.parse(e,t),n&&this.updateElements(r,e,t,"reset")}updateElements(e,t,n,o){}_removeElements(e,t){const n=this._cachedMeta;if(this._parsing){const o=n._parsed.splice(e,t);n._stacked&&no(n,o)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,n,o]=e;this[t](n,o)}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,t){t&&this._sync(["_removeElements",e,t]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ae(mn,"defaults",{}),ae(mn,"datasetElementType",null),ae(mn,"dataElementType",null);function I1(i,e){if(!i._cache.$bar){const t=i.getMatchingVisibleMetas(e);let n=[];for(let o=0,r=t.length;o<r;o++)n=n.concat(t[o].controller.getAllParsedValues(i));i._cache.$bar=Qd(n.sort((o,r)=>o-r))}return i._cache.$bar}function h1(i){const e=i.iScale,t=I1(e,i.type);let n=e._length,o,r,a,l;const M=()=>{a===32767||a===-32768||(Jn(l)&&(n=Math.min(n,Math.abs(a-l)||n)),l=a)};for(o=0,r=t.length;o<r;++o)a=e.getPixelForValue(t[o]),M();for(l=void 0,o=0,r=e.ticks.length;o<r;++o)a=e.getPixelForTick(o),M();return n}function D1(i,e,t,n){const o=t.barThickness;let r,a;return be(o)?(r=e.min*t.categoryPercentage,a=t.barPercentage):(r=o*n,a=1),{chunk:r/n,ratio:a,start:e.pixels[i]-r/2}}function f1(i,e,t,n){const o=e.pixels,r=o[i];let a=i>0?o[i-1]:null,l=i<o.length-1?o[i+1]:null;const M=t.categoryPercentage;a===null&&(a=r-(l===null?e.end-e.start:l-r)),l===null&&(l=r+r-a);const c=r-(r-Math.min(a,l))/2*M;return{chunk:Math.abs(l-a)/2*M/n,ratio:t.barPercentage,start:c}}function p1(i,e,t,n){const o=t.parse(i[0],n),r=t.parse(i[1],n),a=Math.min(o,r),l=Math.max(o,r);let M=a,c=l;Math.abs(a)>Math.abs(l)&&(M=l,c=a),e[t.axis]=c,e._custom={barStart:M,barEnd:c,start:o,end:r,min:a,max:l}}function hN(i,e,t,n){return Se(i)?p1(i,e,t,n):e[t.axis]=t.parse(i,n),e}function DN(i,e,t,n){const o=i.iScale,r=i.vScale,a=o.getLabels(),l=o===r,M=[];let c,u,g,d;for(c=t,u=t+n;c<u;++c)d=e[c],g={},g[o.axis]=l||o.parse(a[c],c),M.push(hN(d,g,r,c));return M}function wM(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function z1(i,e,t){return i!==0?$t(i):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function m1(i){let e,t,n,o,r;return i.horizontal?(e=i.base>i.x,t="left",n="right"):(e=i.base<i.y,t="bottom",n="top"),e?(o="end",r="start"):(o="start",r="end"),{start:t,end:n,reverse:e,top:o,bottom:r}}function A1(i,e,t,n){let o=e.borderSkipped;const r={};if(!o){i.borderSkipped=r;return}if(o===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:M,top:c,bottom:u}=m1(i);o==="middle"&&t&&(i.enableBorderRadius=!0,(t._top||0)===n?o=c:(t._bottom||0)===n?o=u:(r[fN(u,a,l,M)]=!0,o=c)),r[fN(o,a,l,M)]=!0,i.borderSkipped=r}function fN(i,e,t,n){return n?(i=T1(i,e,t),i=pN(i,t,e)):i=pN(i,e,t),i}function T1(i,e,t){return i===e?t:i===t?e:i}function pN(i,e,t){return i==="start"?e:i==="end"?t:i}function x1(i,{inflateAmount:e},t){i.inflateAmount=e==="auto"?t===1?.33:0:e}class Ea extends mn{parsePrimitiveData(e,t,n,o){return DN(e,t,n,o)}parseArrayData(e,t,n,o){return DN(e,t,n,o)}parseObjectData(e,t,n,o){const{iScale:r,vScale:a}=e,{xAxisKey:l="x",yAxisKey:M="y"}=this._parsing,c=r.axis==="x"?l:M,u=a.axis==="x"?l:M,g=[];let d,y,j,D;for(d=n,y=n+o;d<y;++d)D=t[d],j={},j[r.axis]=r.parse(Dn(D,c),d),g.push(hN(Dn(D,u),j,a,d));return g}updateRangeFromParsed(e,t,n,o){super.updateRangeFromParsed(e,t,n,o);const r=n._custom;r&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:n,vScale:o}=t,r=this.getParsed(e),a=r._custom,l=wM(a)?"["+a.start+", "+a.end+"]":""+o.getLabelForValue(r[o.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,o){const r=o==="reset",{index:a,_cachedMeta:{vScale:l}}=this,M=l.getBasePixel(),c=l.isHorizontal(),u=this._getRuler(),{sharedOptions:g,includeOptions:d}=this._getSharedOptions(t,o);for(let y=t;y<t+n;y++){const j=this.getParsed(y),D=r||be(j[l.axis])?{base:M,head:M}:this._calculateBarValuePixels(y),I=this._calculateBarIndexPixels(y,u),N=(j._stacks||{})[l.axis],m={horizontal:c,base:D.base,enableBorderRadius:!N||wM(j._custom)||a===N._top||a===N._bottom,x:c?D.head:I.center,y:c?I.center:D.head,height:c?I.size:Math.abs(D.size),width:c?Math.abs(D.size):I.size};d&&(m.options=g||this.resolveDataElementOptions(y,e[y].active?"active":o));const b=m.options||e[y].options;A1(m,b,N,a),x1(m,b,u.ratio),this.updateElement(e[y],y,m,o)}}_getStacks(e,t){const{iScale:n}=this._cachedMeta,o=n.getMatchingVisibleMetas(this._type).filter(M=>M.controller.options.grouped),r=n.options.stacked,a=[],l=M=>{const c=M.controller.getParsed(t),u=c&&c[M.vScale.axis];if(be(u)||isNaN(u))return!0};for(const M of o)if(!(t!==void 0&&l(M))&&((r===!1||a.indexOf(M.stack)===-1||r===void 0&&M.stack===void 0)&&a.push(M.stack),M.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,n){const o=this._getStacks(e,n),r=t!==void 0?o.indexOf(t):-1;return r===-1?o.length-1:r}_getRuler(){const e=this.options,t=this._cachedMeta,n=t.iScale,o=[];let r,a;for(r=0,a=t.data.length;r<a;++r)o.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));const l=e.barThickness;return{min:l||h1(t),pixels:o,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:n,index:o},options:{base:r,minBarLength:a}}=this,l=r||0,M=this.getParsed(e),c=M._custom,u=wM(c);let g=M[t.axis],d=0,y=n?this.applyStack(t,M,n):g,j,D;y!==g&&(d=y-g,y=g),u&&(g=c.barStart,y=c.barEnd-c.barStart,g!==0&&$t(g)!==$t(c.barEnd)&&(d=0),d+=g);const I=!be(r)&&!u?r:d;let N=t.getPixelForValue(I);if(this.chart.getDataVisibility(e)?j=t.getPixelForValue(d+y):j=N,D=j-N,Math.abs(D)<a){D=z1(D,t,l)*a,g===l&&(N-=D/2);const m=t.getPixelForDecimal(0),b=t.getPixelForDecimal(1),C=Math.min(m,b),E=Math.max(m,b);N=Math.max(Math.min(N,E),C),j=N+D,n&&!u&&(M._stacks[t.axis]._visualValues[o]=t.getValueForPixel(j)-t.getValueForPixel(N))}if(N===t.getPixelForValue(l)){const m=$t(D)*t.getLineWidthForValue(l)/2;N+=m,D-=m}return{size:D,base:N,head:j,center:j+D/2}}_calculateBarIndexPixels(e,t){const n=t.scale,o=this.options,r=o.skipNull,a=xe(o.maxBarThickness,1/0);let l,M;if(t.grouped){const c=r?this._getStackCount(e):t.stackCount,u=o.barThickness==="flex"?f1(e,t,o,c):D1(e,t,o,c),g=this._getStackIndex(this.index,this._cachedMeta.stack,r?e:void 0);l=u.start+u.chunk*g+u.chunk/2,M=Math.min(a,u.chunk*u.ratio)}else l=n.getPixelForValue(this.getParsed(e)[n.axis],e),M=Math.min(a,t.min*t.ratio);return{base:l-M/2,head:l+M/2,center:l,size:M}}draw(){const e=this._cachedMeta,t=e.vScale,n=e.data,o=n.length;let r=0;for(;r<o;++r)this.getParsed(r)[t.axis]!==null&&n[r].draw(this._ctx)}}ae(Ea,"id","bar"),ae(Ea,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ae(Ea,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ba extends mn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:n,data:o=[],_dataset:r}=t,a=this.chart._animationsDisabled;let{start:l,count:M}=qx(t,o,a);this._drawStart=l,this._drawCount=M,eL(t)&&(l=0,M=o.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=o;const c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},e),this.updateElements(o,l,M,e)}updateElements(e,t,n,o){const r=o==="reset",{iScale:a,vScale:l,_stacked:M,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:g}=this._getSharedOptions(t,o),d=a.axis,y=l.axis,{spanGaps:j,segment:D}=this.options,I=Kn(j)?j:Number.POSITIVE_INFINITY,N=this.chart._animationsDisabled||r||o==="none",m=t+n,b=e.length;let C=t>0&&this.getParsed(t-1);for(let E=0;E<b;++E){const A=e[E],O=N?A:{};if(E<t||E>=m){O.skip=!0;continue}const f=this.getParsed(E),z=be(f[y]),L=O[d]=a.getPixelForValue(f[d],E),p=O[y]=r||z?l.getBasePixel():l.getPixelForValue(M?this.applyStack(l,f,M):f[y],E);O.skip=isNaN(L)||isNaN(p)||z,O.stop=E>0&&Math.abs(f[d]-C[d])>I,D&&(O.parsed=f,O.raw=c.data[E]),g&&(O.options=u||this.resolveDataElementOptions(E,A.active?"active":o)),N||this.updateElement(A,E,O,o),C=f}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,o=e.data||[];if(!o.length)return n;const r=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(n,r,a)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}ae(ba,"id","line"),ae(ba,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ae(ba,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Ki(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class SM{constructor(e){ae(this,"options");this.options=e||{}}static override(e){Object.assign(SM.prototype,e)}init(){}formats(){return Ki()}parse(){return Ki()}format(){return Ki()}add(){return Ki()}diff(){return Ki()}startOf(){return Ki()}endOf(){return Ki()}}var L1={_date:SM};function E1(i,e,t,n){const{controller:o,data:r,_sorted:a}=i,l=o._cachedMeta.iScale;if(l&&e===l.axis&&e!=="r"&&a&&r.length){const M=l._reversePixels?$x:Wi;if(n){if(o._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(e);if(u){const g=M(r,e,t-u),d=M(r,e,t+u);return{lo:g.lo,hi:d.hi}}}}else return M(r,e,t)}return{lo:0,hi:r.length-1}}function oo(i,e,t,n,o){const r=i.getSortedVisibleDatasetMetas(),a=t[e];for(let l=0,M=r.length;l<M;++l){const{index:c,data:u}=r[l],{lo:g,hi:d}=E1(r[l],e,a,o);for(let y=g;y<=d;++y){const j=u[y];j.skip||n(j,c,y)}}}function b1(i){const e=i.indexOf("x")!==-1,t=i.indexOf("y")!==-1;return function(n,o){const r=e?Math.abs(n.x-o.x):0,a=t?Math.abs(n.y-o.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function kM(i,e,t,n,o){const r=[];return!o&&!i.isPointInArea(e)||oo(i,t,e,function(l,M,c){!o&&!si(l,i.chartArea,0)||l.inRange(e.x,e.y,n)&&r.push({element:l,datasetIndex:M,index:c})},!0),r}function O1(i,e,t,n){let o=[];function r(a,l,M){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],n),{angle:g}=Wx(a,{x:e.x,y:e.y});Sd(g,c,u)&&o.push({element:a,datasetIndex:l,index:M})}return oo(i,t,e,r),o}function C1(i,e,t,n,o,r){let a=[];const l=b1(t);let M=Number.POSITIVE_INFINITY;function c(u,g,d){const y=u.inRange(e.x,e.y,o);if(n&&!y)return;const j=u.getCenterPoint(o);if(!(!!r||i.isPointInArea(j))&&!y)return;const I=l(e,j);I<M?(a=[{element:u,datasetIndex:g,index:d}],M=I):I===M&&a.push({element:u,datasetIndex:g,index:d})}return oo(i,t,e,c),a}function vM(i,e,t,n,o,r){return!r&&!i.isPointInArea(e)?[]:t==="r"&&!n?O1(i,e,t,o):C1(i,e,t,n,o,r)}function zN(i,e,t,n,o){const r=[],a=t==="x"?"inXRange":"inYRange";let l=!1;return oo(i,t,e,(M,c,u)=>{M[a](e[t],o)&&(r.push({element:M,datasetIndex:c,index:u}),l=l||M.inRange(e.x,e.y,o))}),n&&!l?[]:r}var w1={evaluateInteractionItems:oo,modes:{index(i,e,t,n){const o=Ji(e,i),r=t.axis||"x",a=t.includeInvisible||!1,l=t.intersect?kM(i,o,r,n,a):vM(i,o,r,!1,n,a),M=[];return l.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const u=l[0].index,g=c.data[u];g&&!g.skip&&M.push({element:g,datasetIndex:c.index,index:u})}),M):[]},dataset(i,e,t,n){const o=Ji(e,i),r=t.axis||"xy",a=t.includeInvisible||!1;let l=t.intersect?kM(i,o,r,n,a):vM(i,o,r,!1,n,a);if(l.length>0){const M=l[0].datasetIndex,c=i.getDatasetMeta(M).data;l=[];for(let u=0;u<c.length;++u)l.push({element:c[u],datasetIndex:M,index:u})}return l},point(i,e,t,n){const o=Ji(e,i),r=t.axis||"xy",a=t.includeInvisible||!1;return kM(i,o,r,n,a)},nearest(i,e,t,n){const o=Ji(e,i),r=t.axis||"xy",a=t.includeInvisible||!1;return vM(i,o,r,t.intersect,n,a)},x(i,e,t,n){const o=Ji(e,i);return zN(i,o,"x",t.intersect,n)},y(i,e,t,n){const o=Ji(e,i);return zN(i,o,"y",t.intersect,n)}}};const mN=["left","top","right","bottom"];function ro(i,e){return i.filter(t=>t.pos===e)}function AN(i,e){return i.filter(t=>mN.indexOf(t.pos)===-1&&t.box.axis===e)}function ao(i,e){return i.sort((t,n)=>{const o=e?n:t,r=e?t:n;return o.weight===r.weight?o.index-r.index:o.weight-r.weight})}function S1(i){const e=[];let t,n,o,r,a,l;for(t=0,n=(i||[]).length;t<n;++t)o=i[t],{position:r,options:{stack:a,stackWeight:l=1}}=o,e.push({index:t,box:o,pos:r,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&r+a,stackWeight:l});return e}function k1(i){const e={};for(const t of i){const{stack:n,pos:o,stackWeight:r}=t;if(!n||!mN.includes(o))continue;const a=e[n]||(e[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return e}function v1(i,e){const t=k1(i),{vBoxMaxWidth:n,hBoxMaxHeight:o}=e;let r,a,l;for(r=0,a=i.length;r<a;++r){l=i[r];const{fullSize:M}=l.box,c=t[l.stack],u=c&&l.stackWeight/c.weight;l.horizontal?(l.width=u?u*n:M&&e.availableWidth,l.height=o):(l.width=n,l.height=u?u*o:M&&e.availableHeight)}return t}function Q1(i){const e=S1(i),t=ao(e.filter(c=>c.box.fullSize),!0),n=ao(ro(e,"left"),!0),o=ao(ro(e,"right")),r=ao(ro(e,"top"),!0),a=ao(ro(e,"bottom")),l=AN(e,"x"),M=AN(e,"y");return{fullSize:t,leftAndTop:n.concat(r),rightAndBottom:o.concat(M).concat(a).concat(l),chartArea:ro(e,"chartArea"),vertical:n.concat(o).concat(M),horizontal:r.concat(a).concat(l)}}function TN(i,e,t,n){return Math.max(i[t],e[t])+Math.max(i[n],e[n])}function xN(i,e){i.top=Math.max(i.top,e.top),i.left=Math.max(i.left,e.left),i.bottom=Math.max(i.bottom,e.bottom),i.right=Math.max(i.right,e.right)}function Y1(i,e,t,n){const{pos:o,box:r}=t,a=i.maxPadding;if(!pe(o)){t.size&&(i[o]-=t.size);const g=n[t.stack]||{size:0,count:1};g.size=Math.max(g.size,t.horizontal?r.height:r.width),t.size=g.size/g.count,i[o]+=t.size}r.getPadding&&xN(a,r.getPadding());const l=Math.max(0,e.outerWidth-TN(a,i,"left","right")),M=Math.max(0,e.outerHeight-TN(a,i,"top","bottom")),c=l!==i.w,u=M!==i.h;return i.w=l,i.h=M,t.horizontal?{same:c,other:u}:{same:u,other:c}}function U1(i){const e=i.maxPadding;function t(n){const o=Math.max(e[n]-i[n],0);return i[n]+=o,o}i.y+=t("top"),i.x+=t("left"),t("right"),t("bottom")}function _1(i,e){const t=e.maxPadding;function n(o){const r={left:0,top:0,right:0,bottom:0};return o.forEach(a=>{r[a]=Math.max(e[a],t[a])}),r}return n(i?["left","right"]:["top","bottom"])}function so(i,e,t,n){const o=[];let r,a,l,M,c,u;for(r=0,a=i.length,c=0;r<a;++r){l=i[r],M=l.box,M.update(l.width||e.w,l.height||e.h,_1(l.horizontal,e));const{same:g,other:d}=Y1(e,t,l,n);c|=g&&o.length,u=u||d,M.fullSize||o.push(l)}return c&&so(o,e,t,n)||u}function Oa(i,e,t,n,o){i.top=t,i.left=e,i.right=e+n,i.bottom=t+o,i.width=n,i.height=o}function LN(i,e,t,n){const o=t.padding;let{x:r,y:a}=e;for(const l of i){const M=l.box,c=n[l.stack]||{count:1,placed:0,weight:1},u=l.stackWeight/c.weight||1;if(l.horizontal){const g=e.w*u,d=c.size||M.height;Jn(c.start)&&(a=c.start),M.fullSize?Oa(M,o.left,a,t.outerWidth-o.right-o.left,d):Oa(M,e.left+c.placed,a,g,d),c.start=a,c.placed+=g,a=M.bottom}else{const g=e.h*u,d=c.size||M.width;Jn(c.start)&&(r=c.start),M.fullSize?Oa(M,r,o.top,d,t.outerHeight-o.bottom-o.top):Oa(M,r,e.top+c.placed,d,g),c.start=r,c.placed+=g,r=M.right}}e.x=r,e.y=a}var Ti={addBox(i,e){i.boxes||(i.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(t){e.draw(t)}}]},i.boxes.push(e)},removeBox(i,e){const t=i.boxes?i.boxes.indexOf(e):-1;t!==-1&&i.boxes.splice(t,1)},configure(i,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(i,e,t,n){if(!i)return;const o=At(i.options.layout.padding),r=Math.max(e-o.width,0),a=Math.max(t-o.height,0),l=Q1(i.boxes),M=l.vertical,c=l.horizontal;Oe(i.boxes,D=>{typeof D.beforeLayout=="function"&&D.beforeLayout()});const u=M.reduce((D,I)=>I.box.options&&I.box.options.display===!1?D:D+1,0)||1,g=Object.freeze({outerWidth:e,outerHeight:t,padding:o,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/u,hBoxMaxHeight:a/2}),d=Object.assign({},o);xN(d,At(n));const y=Object.assign({maxPadding:d,w:r,h:a,x:o.left,y:o.top},o),j=v1(M.concat(c),g);so(l.fullSize,y,g,j),so(M,y,g,j),so(c,y,g,j)&&so(M,y,g,j),U1(y),LN(l.leftAndTop,y,g,j),y.x+=y.w,y.y+=y.h,LN(l.rightAndBottom,y,g,j),i.chartArea={left:y.left,top:y.top,right:y.left+y.w,bottom:y.top+y.h,height:y.h,width:y.w},Oe(l.chartArea,D=>{const I=D.box;Object.assign(I,i.chartArea),I.update(y.w,y.h,{left:0,top:0,right:0,bottom:0})})}};class EN{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,o){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,o?Math.floor(t/o):n)}}isAttached(e){return!0}updateConfig(e){}}class B1 extends EN{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Ca="$chartjs",P1={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bN=i=>i===null||i==="";function R1(i,e){const t=i.style,n=i.getAttribute("height"),o=i.getAttribute("width");if(i[Ca]={initial:{height:n,width:o,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",bN(o)){const r=iN(i,"width");r!==void 0&&(i.width=r)}if(bN(n))if(i.style.height==="")i.height=i.width/(e||2);else{const r=iN(i,"height");r!==void 0&&(i.height=r)}return i}const ON=VL?{passive:!0}:!1;function Z1(i,e,t){i&&i.addEventListener(e,t,ON)}function V1(i,e,t){i&&i.canvas&&i.canvas.removeEventListener(e,t,ON)}function G1(i,e){const t=P1[i.type]||i.type,{x:n,y:o}=Ji(i,e);return{type:t,chart:e,native:i,x:n!==void 0?n:null,y:o!==void 0?o:null}}function wa(i,e){for(const t of i)if(t===e||t.contains(e))return!0}function W1(i,e,t){const n=i.canvas,o=new MutationObserver(r=>{let a=!1;for(const l of r)a=a||wa(l.addedNodes,n),a=a&&!wa(l.removedNodes,n);a&&t()});return o.observe(document,{childList:!0,subtree:!0}),o}function H1(i,e,t){const n=i.canvas,o=new MutationObserver(r=>{let a=!1;for(const l of r)a=a||wa(l.removedNodes,n),a=a&&!wa(l.addedNodes,n);a&&t()});return o.observe(document,{childList:!0,subtree:!0}),o}const lo=new Map;let CN=0;function wN(){const i=window.devicePixelRatio;i!==CN&&(CN=i,lo.forEach((e,t)=>{t.currentDevicePixelRatio!==i&&e()}))}function F1(i,e){lo.size||window.addEventListener("resize",wN),lo.set(i,e)}function $1(i){lo.delete(i),lo.size||window.removeEventListener("resize",wN)}function J1(i,e,t){const n=i.canvas,o=n&&EM(n);if(!o)return;const r=Ud((l,M)=>{const c=o.clientWidth;t(l,M),c<o.clientWidth&&t()},window),a=new ResizeObserver(l=>{const M=l[0],c=M.contentRect.width,u=M.contentRect.height;c===0&&u===0||r(c,u)});return a.observe(o),F1(i,r),a}function QM(i,e,t){t&&t.disconnect(),e==="resize"&&$1(i)}function X1(i,e,t){const n=i.canvas,o=Ud(r=>{i.ctx!==null&&t(G1(r,i))},i);return Z1(n,e,o),o}class K1 extends EN{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(R1(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t[Ca])return!1;const n=t[Ca].initial;["height","width"].forEach(r=>{const a=n[r];be(a)?t.removeAttribute(r):t.setAttribute(r,a)});const o=n.style||{};return Object.keys(o).forEach(r=>{t.style[r]=o[r]}),t.width=t.width,delete t[Ca],!0}addEventListener(e,t,n){this.removeEventListener(e,t);const o=e.$proxies||(e.$proxies={}),a={attach:W1,detach:H1,resize:J1}[t]||X1;o[t]=a(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),o=n[t];if(!o)return;({attach:QM,detach:QM,resize:QM}[t]||V1)(e,t,o),n[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,o){return ZL(e,t,n,o)}isAttached(e){const t=EM(e);return!!(t&&t.isConnected)}}function q1(i){return!LM()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?B1:K1}let qi=(os=class{constructor(){ae(this,"x");ae(this,"y");ae(this,"active",!1);ae(this,"options");ae(this,"$animations")}tooltipPosition(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return Kn(this.x)&&Kn(this.y)}getProps(e,t){const n=this.$animations;if(!t||!n)return this;const o={};return e.forEach(r=>{o[r]=n[r]&&n[r].active()?n[r]._to:this[r]}),o}},ae(os,"defaults",{}),ae(os,"defaultRoutes"),os);function eE(i,e){const t=i.options.ticks,n=tE(i),o=Math.min(t.maxTicksLimit||n,n),r=t.major.enabled?nE(e):[],a=r.length,l=r[0],M=r[a-1],c=[];if(a>o)return oE(e,c,r,a/o),c;const u=iE(r,e,o);if(a>0){let g,d;const y=a>1?Math.round((M-l)/(a-1)):null;for(Sa(e,c,u,be(y)?0:l-y,l),g=0,d=a-1;g<d;g++)Sa(e,c,u,r[g],r[g+1]);return Sa(e,c,u,M,be(y)?e.length:M+y),c}return Sa(e,c,u),c}function tE(i){const e=i.options.offset,t=i._tickSize(),n=i._length/t+(e?0:1),o=i._maxLength/t;return Math.floor(Math.min(n,o))}function iE(i,e,t){const n=rE(i),o=e.length/t;if(!n)return Math.max(o,1);const r=Vx(n);for(let a=0,l=r.length-1;a<l;a++){const M=r[a];if(M>o)return M}return Math.max(o,1)}function nE(i){const e=[];let t,n;for(t=0,n=i.length;t<n;t++)i[t].major&&e.push(t);return e}function oE(i,e,t,n){let o=0,r=t[0],a;for(n=Math.ceil(n),a=0;a<i.length;a++)a===r&&(e.push(i[a]),o++,r=t[o*n])}function Sa(i,e,t,n,o){const r=xe(n,0),a=Math.min(xe(o,i.length),i.length);let l=0,M,c,u;for(t=Math.ceil(t),o&&(M=o-n,t=M/Math.floor(M/t)),u=r;u<0;)l++,u=Math.round(r+l*t);for(c=Math.max(r,0);c<a;c++)c===u&&(e.push(i[c]),l++,u=Math.round(r+l*t))}function rE(i){const e=i.length;let t,n;if(e<2)return!1;for(n=i[0],t=1;t<e;++t)if(i[t]-i[t-1]!==n)return!1;return n}const aE=i=>i==="left"?"right":i==="right"?"left":i,SN=(i,e,t)=>e==="top"||e==="left"?i[e]+t:i[e]-t,kN=(i,e)=>Math.min(e||i,i);function vN(i,e){const t=[],n=i.length/e,o=i.length;let r=0;for(;r<o;r+=n)t.push(i[Math.floor(r)]);return t}function sE(i,e,t){const n=i.ticks.length,o=Math.min(e,n-1),r=i._startPixel,a=i._endPixel,l=1e-6;let M=i.getPixelForTick(o),c;if(!(t&&(n===1?c=Math.max(M-r,a-M):e===0?c=(i.getPixelForTick(1)-M)/2:c=(M-i.getPixelForTick(o-1))/2,M+=o<e?c:-c,M<r-l||M>a+l)))return M}function lE(i,e){Oe(i,t=>{const n=t.gc,o=n.length/2;let r;if(o>e){for(r=0;r<o;++r)delete t.data[n[r]];n.splice(0,o)}})}function Mo(i){return i.drawTicks?i.tickLength:0}function QN(i,e){if(!i.display)return 0;const t=ut(i.font,e),n=At(i.padding);return(Se(i.text)?i.text.length:1)*t.lineHeight+n.height}function ME(i,e){return Ai(i,{scale:e,type:"scale"})}function cE(i,e,t){return Ai(i,{tick:t,index:e,type:"tick"})}function uE(i,e,t){let n=_d(i);return(t&&e!=="right"||!t&&e==="right")&&(n=aE(n)),n}function gE(i,e,t,n){const{top:o,left:r,bottom:a,right:l,chart:M}=i,{chartArea:c,scales:u}=M;let g=0,d,y,j;const D=a-o,I=l-r;if(i.isHorizontal()){if(y=qn(n,r,l),pe(t)){const N=Object.keys(t)[0],m=t[N];j=u[N].getPixelForValue(m)+D-e}else t==="center"?j=(c.bottom+c.top)/2+D-e:j=SN(i,t,e);d=l-r}else{if(pe(t)){const N=Object.keys(t)[0],m=t[N];y=u[N].getPixelForValue(m)-I+e}else t==="center"?y=(c.left+c.right)/2-I+e:y=SN(i,t,e);j=qn(n,a,o),g=t==="left"?-pt:pt}return{titleX:y,titleY:j,maxWidth:d,rotation:g}}class en extends qi{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,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:o}=this;return e=Dt(e,Number.POSITIVE_INFINITY),t=Dt(t,Number.NEGATIVE_INFINITY),n=Dt(n,Number.POSITIVE_INFINITY),o=Dt(o,Number.NEGATIVE_INFINITY),{min:Dt(e,n),max:Dt(t,o),minDefined:Ze(e),maxDefined:Ze(t)}}getMinMax(e){let{min:t,max:n,minDefined:o,maxDefined:r}=this.getUserBounds(),a;if(o&&r)return{min:t,max:n};const l=this.getMatchingVisibleMetas();for(let M=0,c=l.length;M<c;++M)a=l[M].controller.getMinMax(this,e),o||(t=Math.min(t,a.min)),r||(n=Math.max(n,a.max));return t=r&&t>n?n:t,n=o&&t>n?t:n,{min:Dt(t,Dt(n,t)),max:Dt(n,Dt(t,n))}}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(){Ve(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:o,grace:r,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=pL(this,r,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const M=l<this.ticks.length;this._convertTicksToLabels(M?vN(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=eE(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),M&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ve(this.options.afterUpdate,[this])}beforeSetDimensions(){Ve(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(){Ve(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Ve(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ve(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let n,o,r;for(n=0,o=e.length;n<o;n++)r=e[n],r.label=Ve(t.callback,[r.value,n,e],this)}afterTickToLabelConversion(){Ve(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ve(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,n=kN(this.ticks.length,e.ticks.maxTicksLimit),o=t.minRotation||0,r=t.maxRotation;let a=o,l,M,c;if(!this._isVisible()||!t.display||o>=r||n<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),g=u.widest.width,d=u.highest.height,y=mt(this.chart.width-g,0,this.maxWidth);l=e.offset?this.maxWidth/n:y/(n-1),g+6>l&&(l=y/(n-(e.offset?.5:1)),M=this.maxHeight-Mo(e.grid)-t.padding-QN(e.title,this.chart.options.font),c=Math.sqrt(g*g+d*d),a=dM(Math.min(Math.asin(mt((u.highest.height+6)/l,-1,1)),Math.asin(mt(M/c,-1,1))-Math.asin(mt(d/c,-1,1)))),a=Math.max(o,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){Ve(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ve(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:o,grid:r}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const M=QN(o,t.options.font);if(l?(e.width=this.maxWidth,e.height=Mo(r)+M):(e.height=this.maxHeight,e.width=Mo(r)+M),n.display&&this.ticks.length){const{first:c,last:u,widest:g,highest:d}=this._getLabelSizes(),y=n.padding*2,j=mi(this.labelRotation),D=Math.cos(j),I=Math.sin(j);if(l){const N=n.mirror?0:I*g.width+D*d.height;e.height=Math.min(this.maxHeight,e.height+N+y)}else{const N=n.mirror?0:D*g.width+I*d.height;e.width=Math.min(this.maxWidth,e.width+N+y)}this._calculatePadding(c,u,I,D)}}this._handleMargins(),l?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,o){const{ticks:{align:r,padding:a},position:l}=this.options,M=this.labelRotation!==0,c=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,y=0;M?c?(d=o*e.width,y=n*t.height):(d=n*e.height,y=o*t.width):r==="start"?y=t.width:r==="end"?d=e.width:r!=="inner"&&(d=e.width/2,y=t.width/2),this.paddingLeft=Math.max((d-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((y-g+a)*this.width/(this.width-g),0)}else{let u=t.height/2,g=e.height/2;r==="start"?(u=0,g=e.height):r==="end"&&(u=t.height,g=0),this.paddingTop=u+a,this.paddingBottom=g+a}}_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(){Ve(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t<n;t++)be(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let n=this.ticks;t<n.length&&(n=vN(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){const{ctx:o,_longestTextCache:r}=this,a=[],l=[],M=Math.floor(t/kN(t,n));let c=0,u=0,g,d,y,j,D,I,N,m,b,C,E;for(g=0;g<t;g+=M){if(j=e[g].label,D=this._resolveTickFontOptions(g),o.font=I=D.string,N=r[I]=r[I]||{data:{},gc:[]},m=D.lineHeight,b=C=0,!be(j)&&!Se(j))b=pa(o,N.data,N.gc,b,j),C=m;else if(Se(j))for(d=0,y=j.length;d<y;++d)E=j[d],!be(E)&&!Se(E)&&(b=pa(o,N.data,N.gc,b,E),C+=m);a.push(b),l.push(C),c=Math.max(b,c),u=Math.max(C,u)}lE(r,t);const A=a.indexOf(c),O=l.indexOf(u),f=z=>({width:a[z]||0,height:l[z]||0});return{first:f(0),last:f(t-1),widest:f(A),highest:f(O),widths:a,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return Fx(this._alignToPixels?Fi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const n=t[e];return n.$context||(n.$context=cE(this.getContext(),e,n))}return this.$context||(this.$context=ME(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=mi(this.labelRotation),n=Math.abs(Math.cos(t)),o=Math.abs(Math.sin(t)),r=this._getLabelSizes(),a=e.autoSkipPadding||0,l=r?r.widest.width+a:0,M=r?r.highest.height+a:0;return this.isHorizontal()?M*n>l*o?l/n:M/o:M*o<l*n?M/n:l/o}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,n=this.chart,o=this.options,{grid:r,position:a,border:l}=o,M=r.offset,c=this.isHorizontal(),g=this.ticks.length+(M?1:0),d=Mo(r),y=[],j=l.setContext(this.getContext()),D=j.display?j.width:0,I=D/2,N=function(S){return Fi(n,S,D)};let m,b,C,E,A,O,f,z,L,p,h,T;if(a==="top")m=N(this.bottom),O=this.bottom-d,z=m-I,p=N(e.top)+I,T=e.bottom;else if(a==="bottom")m=N(this.top),p=e.top,T=N(e.bottom)-I,O=m+I,z=this.top+d;else if(a==="left")m=N(this.right),A=this.right-d,f=m-I,L=N(e.left)+I,h=e.right;else if(a==="right")m=N(this.left),L=e.left,h=N(e.right)-I,A=m+I,f=this.left+d;else if(t==="x"){if(a==="center")m=N((e.top+e.bottom)/2+.5);else if(pe(a)){const S=Object.keys(a)[0],v=a[S];m=N(this.chart.scales[S].getPixelForValue(v))}p=e.top,T=e.bottom,O=m+I,z=O+d}else if(t==="y"){if(a==="center")m=N((e.left+e.right)/2);else if(pe(a)){const S=Object.keys(a)[0],v=a[S];m=N(this.chart.scales[S].getPixelForValue(v))}A=m-I,f=A-d,L=e.left,h=e.right}const w=xe(o.ticks.maxTicksLimit,g),x=Math.max(1,Math.ceil(g/w));for(b=0;b<g;b+=x){const S=this.getContext(b),v=r.setContext(S),k=l.setContext(S),P=v.lineWidth,W=v.color,Q=k.dash||[],_=k.dashOffset,$=v.tickWidth,ne=v.tickColor,ie=v.tickBorderDash||[],F=v.tickBorderDashOffset;C=sE(this,b,M),C!==void 0&&(E=Fi(n,C,P),c?A=f=L=h=E:O=z=p=T=E,y.push({tx1:A,ty1:O,tx2:f,ty2:z,x1:L,y1:p,x2:h,y2:T,width:P,color:W,borderDash:Q,borderDashOffset:_,tickWidth:$,tickColor:ne,tickBorderDash:ie,tickBorderDashOffset:F}))}return this._ticksLength=g,this._borderValue=m,y}_computeLabelItems(e){const t=this.axis,n=this.options,{position:o,ticks:r}=n,a=this.isHorizontal(),l=this.ticks,{align:M,crossAlign:c,padding:u,mirror:g}=r,d=Mo(n.grid),y=d+u,j=g?-u:y,D=-mi(this.labelRotation),I=[];let N,m,b,C,E,A,O,f,z,L,p,h,T="middle";if(o==="top")A=this.bottom-j,O=this._getXAxisLabelAlignment();else if(o==="bottom")A=this.top+j,O=this._getXAxisLabelAlignment();else if(o==="left"){const x=this._getYAxisLabelAlignment(d);O=x.textAlign,E=x.x}else if(o==="right"){const x=this._getYAxisLabelAlignment(d);O=x.textAlign,E=x.x}else if(t==="x"){if(o==="center")A=(e.top+e.bottom)/2+y;else if(pe(o)){const x=Object.keys(o)[0],S=o[x];A=this.chart.scales[x].getPixelForValue(S)+y}O=this._getXAxisLabelAlignment()}else if(t==="y"){if(o==="center")E=(e.left+e.right)/2-y;else if(pe(o)){const x=Object.keys(o)[0],S=o[x];E=this.chart.scales[x].getPixelForValue(S)}O=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(M==="start"?T="top":M==="end"&&(T="bottom"));const w=this._getLabelSizes();for(N=0,m=l.length;N<m;++N){b=l[N],C=b.label;const x=r.setContext(this.getContext(N));f=this.getPixelForTick(N)+r.labelOffset,z=this._resolveTickFontOptions(N),L=z.lineHeight,p=Se(C)?C.length:1;const S=p/2,v=x.color,k=x.textStrokeColor,P=x.textStrokeWidth;let W=O;a?(E=f,O==="inner"&&(N===m-1?W=this.options.reverse?"left":"right":N===0?W=this.options.reverse?"right":"left":W="center"),o==="top"?c==="near"||D!==0?h=-p*L+L/2:c==="center"?h=-w.highest.height/2-S*L+L:h=-w.highest.height+L/2:c==="near"||D!==0?h=L/2:c==="center"?h=w.highest.height/2-S*L:h=w.highest.height-p*L,g&&(h*=-1),D!==0&&!x.showLabelBackdrop&&(E+=L/2*Math.sin(D))):(A=f,h=(1-p)*L/2);let Q;if(x.showLabelBackdrop){const _=At(x.backdropPadding),$=w.heights[N],ne=w.widths[N];let ie=h-_.top,F=0-_.left;switch(T){case"middle":ie-=$/2;break;case"bottom":ie-=$;break}switch(O){case"center":F-=ne/2;break;case"right":F-=ne;break;case"inner":N===m-1?F-=ne:N>0&&(F-=ne/2);break}Q={left:F,top:ie,width:ne+_.width,height:$+_.height,color:x.backdropColor}}I.push({label:C,font:z,textOffset:h,options:{rotation:D,color:v,strokeColor:k,strokeWidth:P,textAlign:W,textBaseline:T,translation:[E,A],backdrop:Q}})}return I}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-mi(this.labelRotation))return e==="top"?"left":"right";let o="center";return t.align==="start"?o="left":t.align==="end"?o="right":t.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:n,mirror:o,padding:r}}=this.options,a=this._getLabelSizes(),l=e+r,M=a.widest.width;let c,u;return t==="left"?o?(u=this.right+r,n==="near"?c="left":n==="center"?(c="center",u+=M/2):(c="right",u+=M)):(u=this.right-l,n==="near"?c="right":n==="center"?(c="center",u-=M/2):(c="left",u=this.left)):t==="right"?o?(u=this.left+r,n==="near"?c="right":n==="center"?(c="center",u-=M/2):(c="left",u-=M)):(u=this.left+l,n==="near"?c="left":n==="center"?(c="center",u+=M/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:n,top:o,width:r,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,o,r,a),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const o=this.ticks.findIndex(r=>r.value===e);return o>=0?t.setContext(this.getContext(o)).lineWidth:0}drawGrid(e){const t=this.options.grid,n=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let r,a;const l=(M,c,u)=>{!u.width||!u.color||(n.save(),n.lineWidth=u.width,n.strokeStyle=u.color,n.setLineDash(u.borderDash||[]),n.lineDashOffset=u.borderDashOffset,n.beginPath(),n.moveTo(M.x,M.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(t.display)for(r=0,a=o.length;r<a;++r){const M=o[r];t.drawOnChartArea&&l({x:M.x1,y:M.y1},{x:M.x2,y:M.y2},M),t.drawTicks&&l({x:M.tx1,y:M.ty1},{x:M.tx2,y:M.ty2},{color:M.tickColor,width:M.tickWidth,borderDash:M.tickBorderDash,borderDashOffset:M.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:n,grid:o}}=this,r=n.setContext(this.getContext()),a=n.display?r.width:0;if(!a)return;const l=o.setContext(this.getContext(0)).lineWidth,M=this._borderValue;let c,u,g,d;this.isHorizontal()?(c=Fi(e,this.left,a)-a/2,u=Fi(e,this.right,l)+l/2,g=d=M):(g=Fi(e,this.top,a)-a/2,d=Fi(e,this.bottom,l)+l/2,c=u=M),t.save(),t.lineWidth=r.width,t.strokeStyle=r.color,t.beginPath(),t.moveTo(c,g),t.lineTo(u,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const n=this.ctx,o=this._computeLabelArea();o&&zM(n,o);const r=this.getLabelItems(e);for(const a of r){const l=a.options,M=a.font,c=a.label,u=a.textOffset;io(n,c,0,u,M,l)}o&&mM(n)}drawTitle(){const{ctx:e,options:{position:t,title:n,reverse:o}}=this;if(!n.display)return;const r=ut(n.font),a=At(n.padding),l=n.align;let M=r.lineHeight/2;t==="bottom"||t==="center"||pe(t)?(M+=a.bottom,Se(n.text)&&(M+=r.lineHeight*(n.text.length-1))):M+=a.top;const{titleX:c,titleY:u,maxWidth:g,rotation:d}=gE(this,M,t,l);io(e,n.text,0,0,r,{color:n.color,maxWidth:g,rotation:d,textAlign:uE(l,t,o),textBaseline:"middle",translation:[c,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,n=xe(e.grid&&e.grid.z,-1),o=xe(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==en.prototype.draw?[{z:t,draw:r=>{this.draw(r)}}]:[{z:n,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:t,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",o=[];let r,a;for(r=0,a=t.length;r<a;++r){const l=t[r];l[n]===this.id&&(!e||l.type===e)&&o.push(l)}return o}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return ut(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ka{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let n;jE(t)&&(n=this.register(t));const o=this.items,r=e.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+e);return r in o||(o[r]=e,dE(e,a,n),this.override&&Fe.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,o=this.scope;n in t&&delete t[n],o&&n in Fe[o]&&(delete Fe[o][n],this.override&&delete Hi[n])}}function dE(i,e,t){const n=Fn(Object.create(null),[t?Fe.get(t):{},Fe.get(e),i.defaults]);Fe.set(e,n),i.defaultRoutes&&NE(e,i.defaultRoutes),i.descriptors&&Fe.describe(e,i.descriptors)}function NE(i,e){Object.keys(e).forEach(t=>{const n=t.split("."),o=n.pop(),r=[i].concat(n).join("."),a=e[t].split("."),l=a.pop(),M=a.join(".");Fe.route(r,o,M,l)})}function jE(i){return"id"in i&&"defaults"in i}class yE{constructor(){this.controllers=new ka(mn,"datasets",!0),this.elements=new ka(qi,"elements"),this.plugins=new ka(Object,"plugins"),this.scales=new ka(en,"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,t,n){[...t].forEach(o=>{const r=n||this._getRegistryForType(o);n||r.isForType(o)||r===this.plugins&&o.id?this._exec(e,r,o):Oe(o,a=>{const l=n||this._getRegistryForType(a);this._exec(e,l,a)})})}_exec(e,t,n){const o=gM(e);Ve(n["before"+o],[],n),t[e](n),Ve(n["after"+o],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){const o=t.get(e);if(o===void 0)throw new Error('"'+e+'" is not a registered '+n+".");return o}}var Jt=new yE;class IE{constructor(){this._init=[]}notify(e,t,n,o){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const r=o?this._descriptors(e).filter(o):this._descriptors(e),a=this._notify(r,e,t,n);return t==="afterDestroy"&&(this._notify(r,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,t,n,o){o=o||{};for(const r of e){const a=r.plugin,l=a[n],M=[t,o,r.options];if(Ve(l,M,a)===!1&&o.cancelable)return!1}return!0}invalidate(){be(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,o=xe(n.options&&n.options.plugins,{}),r=hE(n);return o===!1&&!t?[]:fE(e,r,o,t)}_notifyStateChanges(e){const t=this._oldCache||[],n=this._cache,o=(r,a)=>r.filter(l=>!a.some(M=>l.plugin.id===M.plugin.id));this._notify(o(t,n),e,"stop"),this._notify(o(n,t),e,"start")}}function hE(i){const e={},t=[],n=Object.keys(Jt.plugins.items);for(let r=0;r<n.length;r++)t.push(Jt.getPlugin(n[r]));const o=i.plugins||[];for(let r=0;r<o.length;r++){const a=o[r];t.indexOf(a)===-1&&(t.push(a),e[a.id]=!0)}return{plugins:t,localIds:e}}function DE(i,e){return!e&&i===!1?null:i===!0?{}:i}function fE(i,{plugins:e,localIds:t},n,o){const r=[],a=i.getContext();for(const l of e){const M=l.id,c=DE(n[M],o);c!==null&&r.push({plugin:l,options:pE(i.config,{plugin:l,local:t[M]},c,a)})}return r}function pE(i,{plugin:e,local:t},n,o){const r=i.pluginScopeKeys(e),a=i.getOptionScopes(n,r);return t&&e.defaults&&a.push(e.defaults),i.createResolver(a,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function YM(i,e){const t=Fe.datasets[i]||{};return((e.datasets||{})[i]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function zE(i,e){let t=i;return i==="_index_"?t=e:i==="_value_"&&(t=e==="x"?"y":"x"),t}function mE(i,e){return i===e?"_index_":"_value_"}function YN(i){if(i==="x"||i==="y"||i==="r")return i}function AE(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function UM(i,...e){if(YN(i))return i;for(const t of e){const n=t.axis||AE(t.position)||i.length>1&&YN(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function UN(i,e,t){if(t[e+"AxisID"]===i)return{axis:e}}function TE(i,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(t.length)return UN(i,"x",t[0])||UN(i,"y",t[0])}return{}}function xE(i,e){const t=Hi[i.type]||{scales:{}},n=e.scales||{},o=YM(i.type,e),r=Object.create(null);return Object.keys(n).forEach(a=>{const l=n[a];if(!pe(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const M=UM(a,l,TE(a,i),Fe.scales[l.type]),c=mE(M,o),u=t.scales||{};r[a]=$n(Object.create(null),[{axis:M},l,u[M],u[c]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,M=a.indexAxis||YM(l,e),u=(Hi[l]||{}).scales||{};Object.keys(u).forEach(g=>{const d=zE(g,M),y=a[d+"AxisID"]||d;r[y]=r[y]||Object.create(null),$n(r[y],[{axis:d},n[y],u[g]])})}),Object.keys(r).forEach(a=>{const l=r[a];$n(l,[Fe.scales[l.type],Fe.scale])}),r}function _N(i){const e=i.options||(i.options={});e.plugins=xe(e.plugins,{}),e.scales=xE(i,e)}function BN(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function LE(i){return i=i||{},i.data=BN(i.data),_N(i),i}const PN=new Map,RN=new Set;function va(i,e){let t=PN.get(i);return t||(t=e(),PN.set(i,t),RN.add(t)),t}const co=(i,e,t)=>{const n=Dn(e,t);n!==void 0&&i.add(n)};class EE{constructor(e){this._config=LE(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=BN(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(),_N(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return va(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return va(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return va(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,n=this.type;return va(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const n=this._scopeCache;let o=n.get(e);return(!o||t)&&(o=new Map,n.set(e,o)),o}getOptionScopes(e,t,n){const{options:o,type:r}=this,a=this._cachedScopes(e,n),l=a.get(t);if(l)return l;const M=new Set;t.forEach(u=>{e&&(M.add(e),u.forEach(g=>co(M,e,g))),u.forEach(g=>co(M,o,g)),u.forEach(g=>co(M,Hi[r]||{},g)),u.forEach(g=>co(M,Fe,g)),u.forEach(g=>co(M,DM,g))});const c=Array.from(M);return c.length===0&&c.push(Object.create(null)),RN.has(t)&&a.set(t,c),c}chartOptionScopes(){const{options:e,type:t}=this;return[e,Hi[t]||{},Fe.datasets[t]||{},{type:t},Fe,DM]}resolveNamedOptions(e,t,n,o=[""]){const r={$shared:!0},{resolver:a,subPrefixes:l}=ZN(this._resolverCache,e,o);let M=a;if(OE(a,t)){r.$shared=!1,n=pi(n)?n():n;const c=this.createResolver(e,n,l);M=pn(a,n,c)}for(const c of t)r[c]=M[c];return r}createResolver(e,t,n=[""],o){const{resolver:r}=ZN(this._resolverCache,e,n);return pe(t)?pn(r,t,void 0,o):r}}function ZN(i,e,t){let n=i.get(e);n||(n=new Map,i.set(e,n));const o=t.join();let r=n.get(o);return r||(r={resolver:AM(e,t),subPrefixes:t.filter(l=>!l.toLowerCase().includes("hover"))},n.set(o,r)),r}const bE=i=>pe(i)&&Object.getOwnPropertyNames(i).some(e=>pi(i[e]));function OE(i,e){const{isScriptable:t,isIndexable:n}=Fd(i);for(const o of e){const r=t(o),a=n(o),l=(a||r)&&i[o];if(r&&(pi(l)||bE(l))||a&&Se(l))return!0}return!1}var CE="4.4.2";const wE=["top","bottom","left","right","chartArea"];function VN(i,e){return i==="top"||i==="bottom"||wE.indexOf(i)===-1&&e==="x"}function GN(i,e){return function(t,n){return t[i]===n[i]?t[e]-n[e]:t[i]-n[i]}}function WN(i){const e=i.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Ve(t&&t.onComplete,[i],e)}function SE(i){const e=i.chart,t=e.options.animation;Ve(t&&t.onProgress,[i],e)}function HN(i){return LM()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Qa={},FN=i=>{const e=HN(i);return Object.values(Qa).filter(t=>t.canvas===e).pop()};function kE(i,e,t){const n=Object.keys(i);for(const o of n){const r=+o;if(r>=e){const a=i[o];delete i[o],(t>0||r>e)&&(i[r+t]=a)}}}function vE(i,e,t,n){return!t||i.type==="mouseout"?null:n?e:i}function Ya(i,e,t){return i.options.clip?i[t]:e[t]}function QE(i,e){const{xScale:t,yScale:n}=i;return t&&n?{left:Ya(t,e,"left"),right:Ya(t,e,"right"),top:Ya(n,e,"top"),bottom:Ya(n,e,"bottom")}:e}let uo=(Si=class{static register(...e){Jt.add(...e),$N()}static unregister(...e){Jt.remove(...e),$N()}constructor(e,t){const n=this.config=new EE(t),o=HN(e),r=FN(o);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||q1(o)),this.platform.updateConfig(n);const l=this.platform.acquireContext(o,a.aspectRatio),M=l&&l.canvas,c=M&&M.height,u=M&&M.width;if(this.id=vx(),this.ctx=l,this.canvas=M,this.width=u,this.height=c,this._options=a,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 IE,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Kx(g=>this.update(g),a.resizeDelay||0),this._dataChanges=[],Qa[this.id]=this,!l||!M){console.error("Failed to create chart: can't acquire context from the given item");return}li.listen(this,"complete",WN),li.listen(this,"progress",SE),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:o,_aspectRatio:r}=this;return be(e)?t&&r?r:o?n/o: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 Jt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tN(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Gd(this.canvas,this.ctx),this}stop(){return li.stop(this),this}resize(e,t){li.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,o=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(o,e,t,r),l=n.devicePixelRatio||this.platform.getDevicePixelRatio(),M=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,tN(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Ve(n.onResize,[this,a],this),this.attached&&this._doResize(M)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};Oe(t,(n,o)=>{n.id=o})}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,o=Object.keys(n).reduce((a,l)=>(a[l]=!1,a),{});let r=[];t&&(r=r.concat(Object.keys(t).map(a=>{const l=t[a],M=UM(a,l),c=M==="r",u=M==="x";return{options:l,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Oe(r,a=>{const l=a.options,M=l.id,c=UM(M,l),u=xe(l.type,a.dtype);(l.position===void 0||VN(l.position,c)!==VN(a.dposition))&&(l.position=a.dposition),o[M]=!0;let g=null;if(M in n&&n[M].type===u)g=n[M];else{const d=Jt.getScale(u);g=new d({id:M,type:u,ctx:this.ctx,chart:this}),n[g.id]=g}g.init(l,e)}),Oe(o,(a,l)=>{a||delete n[l]}),Oe(n,a=>{Ti.configure(this,a,a.options),Ti.addBox(this,a)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((o,r)=>o.index-r.index),n>t){for(let o=t;o<n;++o)this._destroyDatasetMeta(o);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(GN("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((n,o)=>{t.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,o;for(this._removeUnreferencedMetasets(),n=0,o=t.length;n<o;n++){const r=t[n];let a=this.getDatasetMeta(n);const l=r.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=l,a.indexAxis=r.indexAxis||YM(l,this.options),a.order=r.order||0,a.index=n,a.label=""+r.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{const M=Jt.getController(l),{datasetElementType:c,dataElementType:u}=Fe.datasets[l];Object.assign(M,{dataElementType:Jt.getElement(u),datasetElementType:c&&Jt.getElement(c)}),a.controller=new M(this,n),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){Oe(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:g}=this.getDatasetMeta(c),d=!o&&r.indexOf(g)===-1;g.buildOrUpdateElements(d),a=Math.max(+g.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),o||Oe(r,c=>{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(GN("z","_idx"));const{_active:l,_lastEvent:M}=this;M?this._eventHandler(M,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Oe(this.scales,e=>{Ti.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);(!Ed(t,n)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:o,count:r}of t){const a=n==="_removeElements"?-r:r;kE(e,o,a)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=r=>new Set(e.filter(a=>a[0]===r).map((a,l)=>l+","+a.splice(1).join(","))),o=n(0);for(let r=1;r<t;r++)if(!Ed(o,n(r)))return;return Array.from(o).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ti.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],Oe(this.boxes,o=>{n&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,r)=>{o._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,n=this.data.datasets.length;t<n;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,pi(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const n=this.getDatasetMeta(e),o={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(n.controller._update(t),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(li.has(this)?this.attached&&!li.running(this)&&li.start(this):(this.draw(),WN({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:n,height:o}=this._resizeBeforeDraw;this._resize(n,o),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,n=[];let o,r;for(o=0,r=t.length;o<r;++o){const a=t[o];(!e||a.visible)&&n.push(a)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n=e._clip,o=!n.disabled,r=QE(e,this.chartArea),a={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(o&&zM(t,{left:n.left===!1?0:r.left-n.left,right:n.right===!1?this.width:r.right+n.right,top:n.top===!1?0:r.top-n.top,bottom:n.bottom===!1?this.height:r.bottom+n.bottom}),e.controller.draw(),o&&mM(t),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return si(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,o){const r=w1.modes[t];return typeof r=="function"?r(this,e,n,o):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let o=n.filter(r=>r&&r._dataset===t).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(o)),o}getContext(){return this.$context||(this.$context=Ai(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return typeof n.hidden=="boolean"?!n.hidden:!t.hidden}setDatasetVisibility(e,t){const n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const o=n?"show":"hide",r=this.getDatasetMeta(e),a=r.controller._resolveAnimations(void 0,o);Jn(t)?(r.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(r,{visible:n}),this.update(l=>l.datasetIndex===e?o:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),li.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Gd(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Qa[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,t=this.platform,n=(r,a)=>{t.addEventListener(this,r,a),e[r]=a},o=(r,a,l)=>{r.offsetX=a,r.offsetY=l,this._eventHandler(r)};Oe(this.options.events,r=>n(r,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(M,c)=>{t.addEventListener(this,M,c),e[M]=c},o=(M,c)=>{e[M]&&(t.removeEventListener(this,M,c),delete e[M])},r=(M,c)=>{this.canvas&&this.resize(M,c)};let a;const l=()=>{o("attach",l),this.attached=!0,this.resize(),n("resize",r),n("detach",a)};a=()=>{this.attached=!1,o("resize",r),this._stop(),this._resize(0,0),n("attach",l)},t.isAttached(this.canvas)?l():a()}unbindEvents(){Oe(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Oe(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const o=n?"set":"remove";let r,a,l,M;for(t==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+o+"DatasetHoverStyle"]()),l=0,M=e.length;l<M;++l){a=e[l];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[o+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],n=e.map(({datasetIndex:r,index:a})=>{const l=this.getDatasetMeta(r);if(!l)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:l.data[a],index:a}});!ja(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){const o=this.options.hover,r=(M,c)=>M.filter(u=>!c.some(g=>u.datasetIndex===g.datasetIndex&&u.index===g.index)),a=r(t,e),l=n?e:r(e,t);a.length&&this.updateHoverStyle(a,o.mode,!1),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},o=a=>(a.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",n,o)===!1)return;const r=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,o),(r||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:o=[],options:r}=this,a=t,l=this._getActiveElements(e,o,n,a),M=Px(e),c=vE(e,this._lastEvent,n,M);n&&(this._lastEvent=null,Ve(r.onHover,[e,l,this],this),M&&Ve(r.onClick,[e,l,this],this));const u=!ja(l,o);return(u||t)&&(this._active=l,this._updateHoverStyles(l,o,t)),this._lastEvent=c,u}_getActiveElements(e,t,n,o){if(e.type==="mouseout")return[];if(!n)return t;const r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,o)}},ae(Si,"defaults",Fe),ae(Si,"instances",Qa),ae(Si,"overrides",Hi),ae(Si,"registry",Jt),ae(Si,"version",CE),ae(Si,"getChart",FN),Si);function $N(){return Oe(uo.instances,i=>i._plugins.invalidate())}function JN(i,e,t=e){i.lineCap=xe(t.borderCapStyle,e.borderCapStyle),i.setLineDash(xe(t.borderDash,e.borderDash)),i.lineDashOffset=xe(t.borderDashOffset,e.borderDashOffset),i.lineJoin=xe(t.borderJoinStyle,e.borderJoinStyle),i.lineWidth=xe(t.borderWidth,e.borderWidth),i.strokeStyle=xe(t.borderColor,e.borderColor)}function YE(i,e,t){i.lineTo(t.x,t.y)}function UE(i){return i.stepped?gL:i.tension||i.cubicInterpolationMode==="monotone"?dL:YE}function XN(i,e,t={}){const n=i.length,{start:o=0,end:r=n-1}=t,{start:a,end:l}=e,M=Math.max(o,a),c=Math.min(r,l),u=o<a&&r<a||o>l&&r>l;return{count:n,start:M,loop:e.loop,ilen:c<M&&!u?n+c-M:c-M}}function _E(i,e,t,n){const{points:o,options:r}=e,{count:a,start:l,loop:M,ilen:c}=XN(o,t,n),u=UE(r);let{move:g=!0,reverse:d}=n||{},y,j,D;for(y=0;y<=c;++y)j=o[(l+(d?c-y:y))%a],!j.skip&&(g?(i.moveTo(j.x,j.y),g=!1):u(i,D,j,d,r.stepped),D=j);return M&&(j=o[(l+(d?c:0))%a],u(i,D,j,d,r.stepped)),!!M}function BE(i,e,t,n){const o=e.points,{count:r,start:a,ilen:l}=XN(o,t,n),{move:M=!0,reverse:c}=n||{};let u=0,g=0,d,y,j,D,I,N;const m=C=>(a+(c?l-C:C))%r,b=()=>{D!==I&&(i.lineTo(u,I),i.lineTo(u,D),i.lineTo(u,N))};for(M&&(y=o[m(0)],i.moveTo(y.x,y.y)),d=0;d<=l;++d){if(y=o[m(d)],y.skip)continue;const C=y.x,E=y.y,A=C|0;A===j?(E<D?D=E:E>I&&(I=E),u=(g*u+C)/++g):(b(),i.lineTo(C,E),j=A,g=0,D=I=E),N=E}b()}function _M(i){const e=i.options,t=e.borderDash&&e.borderDash.length;return!i._decimated&&!i._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?BE:_E}function PE(i){return i.stepped?GL:i.tension||i.cubicInterpolationMode==="monotone"?WL:Xi}function RE(i,e,t,n){let o=e._path;o||(o=e._path=new Path2D,e.path(o,t,n)&&o.closePath()),JN(i,e.options),i.stroke(o)}function ZE(i,e,t,n){const{segments:o,options:r}=e,a=_M(e);for(const l of o)JN(i,r,l.style),i.beginPath(),a(i,e,l,{start:t,end:t+n-1})&&i.closePath(),i.stroke()}const VE=typeof Path2D=="function";function GE(i,e,t,n){VE&&!e.options.segment?RE(i,e,t,n):ZE(i,e,t,n)}class xi extends qi{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,t){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const o=n.spanGaps?this._loop:this._fullLoop;YL(this._points,n,e,o,t),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=e1(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){const n=this.options,o=e[t],r=this.points,a=aN(this,{property:t,start:o,end:o});if(!a.length)return;const l=[],M=PE(n);let c,u;for(c=0,u=a.length;c<u;++c){const{start:g,end:d}=a[c],y=r[g],j=r[d];if(y===j){l.push(y);continue}const D=Math.abs((o-y[t])/(j[t]-y[t])),I=M(y,j,D,n.stepped);I[t]=e[t],l.push(I)}return l.length===1?l[0]:l}pathSegment(e,t,n){return _M(this)(e,this,t,n)}path(e,t,n){const o=this.segments,r=_M(this);let a=this._loop;t=t||0,n=n||this.points.length-t;for(const l of o)a&=r(e,this,l,{start:t,end:t+n-1});return!!a}draw(e,t,n,o){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(e.save(),GE(e,this,n,o),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ae(xi,"id","line"),ae(xi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ae(xi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ae(xi,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function KN(i,e,t,n){const o=i.options,{[t]:r}=i.getProps([t],n);return Math.abs(e-r)<o.radius+o.hitRadius}class Ua extends qi{constructor(t){super();ae(this,"parsed");ae(this,"skip");ae(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,o){const r=this.options,{x:a,y:l}=this.getProps(["x","y"],o);return Math.pow(t-a,2)+Math.pow(n-l,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,n){return KN(this,t,"x",n)}inYRange(t,n){return KN(this,t,"y",n)}getCenterPoint(t){const{x:n,y:o}=this.getProps(["x","y"],t);return{x:n,y:o}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const o=n&&t.borderWidth||0;return(n+o)*2}draw(t,n){const o=this.options;this.skip||o.radius<.1||!si(this,n,this.size(o)/2)||(t.strokeStyle=o.borderColor,t.lineWidth=o.borderWidth,t.fillStyle=o.backgroundColor,pM(t,o,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}ae(Ua,"id","point"),ae(Ua,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ae(Ua,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function qN(i,e){const{x:t,y:n,base:o,width:r,height:a}=i.getProps(["x","y","base","width","height"],e);let l,M,c,u,g;return i.horizontal?(g=a/2,l=Math.min(t,o),M=Math.max(t,o),c=n-g,u=n+g):(g=r/2,l=t-g,M=t+g,c=Math.min(n,o),u=Math.max(n,o)),{left:l,top:c,right:M,bottom:u}}function Li(i,e,t,n){return i?0:mt(e,t,n)}function WE(i,e,t){const n=i.options.borderWidth,o=i.borderSkipped,r=Hd(n);return{t:Li(o.top,r.top,0,t),r:Li(o.right,r.right,0,e),b:Li(o.bottom,r.bottom,0,t),l:Li(o.left,r.left,0,e)}}function HE(i,e,t){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),o=i.options.borderRadius,r=fn(o),a=Math.min(e,t),l=i.borderSkipped,M=n||pe(o);return{topLeft:Li(!M||l.top||l.left,r.topLeft,0,a),topRight:Li(!M||l.top||l.right,r.topRight,0,a),bottomLeft:Li(!M||l.bottom||l.left,r.bottomLeft,0,a),bottomRight:Li(!M||l.bottom||l.right,r.bottomRight,0,a)}}function FE(i){const e=qN(i),t=e.right-e.left,n=e.bottom-e.top,o=WE(i,t/2,n/2),r=HE(i,t/2,n/2);return{outer:{x:e.left,y:e.top,w:t,h:n,radius:r},inner:{x:e.left+o.l,y:e.top+o.t,w:t-o.l-o.r,h:n-o.t-o.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,r.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(o.b,o.r))}}}}function BM(i,e,t,n){const o=e===null,r=t===null,l=i&&!(o&&r)&&qN(i,n);return l&&(o||ha(e,l.left,l.right))&&(r||ha(t,l.top,l.bottom))}function $E(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function JE(i,e){i.rect(e.x,e.y,e.w,e.h)}function PM(i,e,t={}){const n=i.x!==t.x?-e:0,o=i.y!==t.y?-e:0,r=(i.x+i.w!==t.x+t.w?e:0)-n,a=(i.y+i.h!==t.y+t.h?e:0)-o;return{x:i.x+n,y:i.y+o,w:i.w+r,h:i.h+a,radius:i.radius}}class _a extends qi{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:t,options:{borderColor:n,backgroundColor:o}}=this,{inner:r,outer:a}=FE(this),l=$E(a.radius)?za:JE;e.save(),(a.w!==r.w||a.h!==r.h)&&(e.beginPath(),l(e,PM(a,t,r)),e.clip(),l(e,PM(r,-t,a)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),l(e,PM(r,t)),e.fillStyle=o,e.fill(),e.restore()}inRange(e,t,n){return BM(this,e,t,n)}inXRange(e,t){return BM(this,e,null,t)}inYRange(e,t){return BM(this,null,e,t)}getCenterPoint(e){const{x:t,y:n,base:o,horizontal:r}=this.getProps(["x","y","base","horizontal"],e);return{x:r?(t+o)/2:t,y:r?n:(n+o)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}ae(_a,"id","bar"),ae(_a,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ae(_a,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function XE(i,e,t){const n=i.segments,o=i.points,r=e.points,a=[];for(const l of n){let{start:M,end:c}=l;c=ZM(M,c,o);const u=RM(t,o[M],o[c],l.loop);if(!e.segments){a.push({source:l,target:u,start:o[M],end:o[c]});continue}const g=aN(e,u);for(const d of g){const y=RM(t,r[d.start],r[d.end],d.loop),j=rN(l,o,y);for(const D of j)a.push({source:D,target:d,start:{[t]:ej(u,y,"start",Math.max)},end:{[t]:ej(u,y,"end",Math.min)}})}}return a}function RM(i,e,t,n){if(n)return;let o=e[i],r=t[i];return i==="angle"&&(o=zt(o),r=zt(r)),{property:i,start:o,end:r}}function KE(i,e){const{x:t=null,y:n=null}=i||{},o=e.points,r=[];return e.segments.forEach(({start:a,end:l})=>{l=ZM(a,l,o);const M=o[a],c=o[l];n!==null?(r.push({x:M.x,y:n}),r.push({x:c.x,y:n})):t!==null&&(r.push({x:t,y:M.y}),r.push({x:t,y:c.y}))}),r}function ZM(i,e,t){for(;e>i;e--){const n=t[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function ej(i,e,t,n){return i&&e?n(i[t],e[t]):i?i[t]:e?e[t]:0}function tj(i,e){let t=[],n=!1;return Se(i)?(n=!0,t=i):t=KE(i,e),t.length?new xi({points:t,options:{tension:0},_loop:n,_fullLoop:n}):null}function ij(i){return i&&i.fill!==!1}function qE(i,e,t){let o=i[e].fill;const r=[e];let a;if(!t)return o;for(;o!==!1&&r.indexOf(o)===-1;){if(!Ze(o))return o;if(a=i[o],!a)return!1;if(a.visible)return o;r.push(o),o=a.fill}return!1}function eb(i,e,t){const n=ob(i);if(pe(n))return isNaN(n.value)?!1:n;let o=parseFloat(n);return Ze(o)&&Math.floor(o)===o?tb(n[0],e,o,t):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function tb(i,e,t,n){return(i==="-"||i==="+")&&(t=e+t),t===e||t<0||t>=n?!1:t}function ib(i,e){let t=null;return i==="start"?t=e.bottom:i==="end"?t=e.top:pe(i)?t=e.getPixelForValue(i.value):e.getBasePixel&&(t=e.getBasePixel()),t}function nb(i,e,t){let n;return i==="start"?n=t:i==="end"?n=e.options.reverse?e.min:e.max:pe(i)?n=i.value:n=e.getBaseValue(),n}function ob(i){const e=i.options,t=e.fill;let n=xe(t&&t.target,t);return n===void 0&&(n=!!e.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function rb(i){const{scale:e,index:t,line:n}=i,o=[],r=n.segments,a=n.points,l=ab(e,t);l.push(tj({x:null,y:e.bottom},n));for(let M=0;M<r.length;M++){const c=r[M];for(let u=c.start;u<=c.end;u++)sb(o,a[u],l)}return new xi({points:o,options:{}})}function ab(i,e){const t=[],n=i.getMatchingVisibleMetas("line");for(let o=0;o<n.length;o++){const r=n[o];if(r.index===e)break;r.hidden||t.unshift(r.dataset)}return t}function sb(i,e,t){const n=[];for(let o=0;o<t.length;o++){const r=t[o],{first:a,last:l,point:M}=lb(r,e,"x");if(!(!M||a&&l)){if(a)n.unshift(M);else if(i.push(M),!l)break}}i.push(...n)}function lb(i,e,t){const n=i.interpolate(e,t);if(!n)return{};const o=n[t],r=i.segments,a=i.points;let l=!1,M=!1;for(let c=0;c<r.length;c++){const u=r[c],g=a[u.start][t],d=a[u.end][t];if(ha(o,g,d)){l=o===g,M=o===d;break}}return{first:l,last:M,point:n}}class nj{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){const{x:o,y:r,radius:a}=this;return t=t||{start:0,end:ft},e.arc(o,r,a,t.end,t.start,!0),!n.bounds}interpolate(e){const{x:t,y:n,radius:o}=this,r=e.angle;return{x:t+Math.cos(r)*o,y:n+Math.sin(r)*o,angle:r}}}function Mb(i){const{chart:e,fill:t,line:n}=i;if(Ze(t))return cb(e,t);if(t==="stack")return rb(i);if(t==="shape")return!0;const o=ub(i);return o instanceof nj?o:tj(o,n)}function cb(i,e){const t=i.getDatasetMeta(e);return t&&i.isDatasetVisible(e)?t.dataset:null}function ub(i){return(i.scale||{}).getPointPositionForValue?db(i):gb(i)}function gb(i){const{scale:e={},fill:t}=i,n=ib(t,e);if(Ze(n)){const o=e.isHorizontal();return{x:o?n:null,y:o?null:n}}return null}function db(i){const{scale:e,fill:t}=i,n=e.options,o=e.getLabels().length,r=n.reverse?e.max:e.min,a=nb(t,e,r),l=[];if(n.grid.circular){const M=e.getPointPositionForValue(0,r);return new nj({x:M.x,y:M.y,radius:e.getDistanceFromCenterForValue(a)})}for(let M=0;M<o;++M)l.push(e.getPointPositionForValue(M,a));return l}function VM(i,e,t){const n=Mb(e),{line:o,scale:r,axis:a}=e,l=o.options,M=l.fill,c=l.backgroundColor,{above:u=c,below:g=c}=M||{};n&&o.points.length&&(zM(i,t),Nb(i,{line:o,target:n,above:u,below:g,area:t,scale:r,axis:a}),mM(i))}function Nb(i,e){const{line:t,target:n,above:o,below:r,area:a,scale:l}=e,M=t._loop?"angle":e.axis;i.save(),M==="x"&&r!==o&&(oj(i,n,a.top),rj(i,{line:t,target:n,color:o,scale:l,property:M}),i.restore(),i.save(),oj(i,n,a.bottom)),rj(i,{line:t,target:n,color:r,scale:l,property:M}),i.restore()}function oj(i,e,t){const{segments:n,points:o}=e;let r=!0,a=!1;i.beginPath();for(const l of n){const{start:M,end:c}=l,u=o[M],g=o[ZM(M,c,o)];r?(i.moveTo(u.x,u.y),r=!1):(i.lineTo(u.x,t),i.lineTo(u.x,u.y)),a=!!e.pathSegment(i,l,{move:a}),a?i.closePath():i.lineTo(g.x,t)}i.lineTo(e.first().x,t),i.closePath(),i.clip()}function rj(i,e){const{line:t,target:n,property:o,color:r,scale:a}=e,l=XE(t,n,o);for(const{source:M,target:c,start:u,end:g}of l){const{style:{backgroundColor:d=r}={}}=M,y=n!==!0;i.save(),i.fillStyle=d,jb(i,a,y&&RM(o,u,g)),i.beginPath();const j=!!t.pathSegment(i,M);let D;if(y){j?i.closePath():aj(i,n,g,o);const I=!!n.pathSegment(i,c,{move:j,reverse:!0});D=j&&I,D||aj(i,n,u,o)}i.closePath(),i.fill(D?"evenodd":"nonzero"),i.restore()}}function jb(i,e,t){const{top:n,bottom:o}=e.chart.chartArea,{property:r,start:a,end:l}=t||{};r==="x"&&(i.beginPath(),i.rect(a,n,l-a,o-n),i.clip())}function aj(i,e,t,n){const o=e.interpolate(t,n);o&&i.lineTo(o.x,o.y)}var yb={id:"filler",afterDatasetsUpdate(i,e,t){const n=(i.data.datasets||[]).length,o=[];let r,a,l,M;for(a=0;a<n;++a)r=i.getDatasetMeta(a),l=r.dataset,M=null,l&&l.options&&l instanceof xi&&(M={visible:i.isDatasetVisible(a),index:a,fill:eb(l,a,n),chart:i,axis:r.controller.options.indexAxis,scale:r.vScale,line:l}),r.$filler=M,o.push(M);for(a=0;a<n;++a)M=o[a],!(!M||M.fill===!1)&&(M.fill=qE(o,a,t.propagate))},beforeDraw(i,e,t){const n=t.drawTime==="beforeDraw",o=i.getSortedVisibleDatasetMetas(),r=i.chartArea;for(let a=o.length-1;a>=0;--a){const l=o[a].$filler;l&&(l.line.updateControlPoints(r,l.axis),n&&l.fill&&VM(i.ctx,l,r))}},beforeDatasetsDraw(i,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let o=n.length-1;o>=0;--o){const r=n[o].$filler;ij(r)&&VM(i.ctx,r,i.chartArea)}},beforeDatasetDraw(i,e,t){const n=e.meta.$filler;!ij(n)||t.drawTime!=="beforeDatasetDraw"||VM(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};class sj extends qi{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,t){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;const o=Se(n.text)?n.text.length:1;this._padding=At(n.padding);const r=o*ut(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:t,left:n,bottom:o,right:r,options:a}=this,l=a.align;let M=0,c,u,g;return this.isHorizontal()?(u=qn(l,n,r),g=t+e,c=r-n):(a.position==="left"?(u=n+e,g=qn(l,o,t),M=Xe*-.5):(u=r-e,g=qn(l,t,o),M=Xe*.5),c=o-t),{titleX:u,titleY:g,maxWidth:c,rotation:M}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=ut(t.font),r=n.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:M,rotation:c}=this._drawArgs(r);io(e,t.text,0,0,n,{color:t.color,maxWidth:M,rotation:c,textAlign:_d(t.align),textBaseline:"middle",translation:[a,l]})}}function Ib(i,e){const t=new sj({ctx:i.ctx,options:e,chart:i});Ti.configure(i,t,e),Ti.addBox(i,t),i.titleBlock=t}var hb={id:"title",_element:sj,start(i,e,t){Ib(i,t)},stop(i){const e=i.titleBlock;Ti.removeBox(i,e),delete i.titleBlock},beforeUpdate(i,e,t){const n=i.titleBlock;Ti.configure(i,n,t),n.options=t},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 go={average(i){if(!i.length)return!1;let e,t,n=new Set,o=0,r=0;for(e=0,t=i.length;e<t;++e){const l=i[e].element;if(l&&l.hasValue()){const M=l.tooltipPosition();n.add(M.x),o+=M.y,++r}}return{x:[...n].reduce((l,M)=>l+M)/n.size,y:o/r}},nearest(i,e){if(!i.length)return!1;let t=e.x,n=e.y,o=Number.POSITIVE_INFINITY,r,a,l;for(r=0,a=i.length;r<a;++r){const M=i[r].element;if(M&&M.hasValue()){const c=M.getCenterPoint(),u=NM(e,c);u<o&&(o=u,l=M)}}if(l){const M=l.tooltipPosition();t=M.x,n=M.y}return{x:t,y:n}}};function Xt(i,e){return e&&(Se(e)?Array.prototype.push.apply(i,e):i.push(e)),i}function Mi(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
17
+ */class nE{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,o){const r=t.listeners[o],a=t.duration;r.forEach(l=>l({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Yd.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,o)=>{if(!n.running||!n.items.length)return;const r=n.items;let a=r.length-1,l=!1,M;for(;a>=0;--a)M=r[a],M._active?(M._total>n.duration&&(n.duration=M._total),M.tick(e),l=!0):(r[a]=r[r.length-1],r.pop());l&&(o.draw(),this._notify(o,n,e,"progress")),r.length||(n.running=!1,this._notify(o,n,e,"complete"),n.initial=!1),t+=r.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((n,o)=>Math.max(n,o._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const n=t.items;let o=n.length-1;for(;o>=0;--o)n[o].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var li=new nE;const MN="transparent",oE={boolean(i,e,t){return t>.5?e:i},color(i,e,t){const n=Rd(i||MN),o=n.valid&&Rd(e||MN);return o&&o.valid?o.mix(n,t).hexString():e},number(i,e,t){return i+(e-i)*t}};class rE{constructor(e,t,n,o){const r=t[n];o=ma([e.to,o,r,e.from]);const a=ma([e.from,r,o]);this._active=!0,this._fn=e.fn||oE[e.type||typeof a],this._easing=eo[e.easing]||eo.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=o,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const o=this._target[this._prop],r=n-this._start,a=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=r,this._loop=!!e.loop,this._to=ma([e.to,t,o,e.from]),this._from=ma([e.from,o,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,o=this._prop,r=this._from,a=this._loop,l=this._to;let M;if(this._active=r!==l&&(a||t<n),!this._active){this._target[o]=l,this._notify(!0);return}if(t<0){this._target[o]=r;return}M=t/n%2,M=a&&M>1?2-M:M,M=this._easing(Math.min(1,Math.max(0,M))),this._target[o]=this._fn(r,l,M)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let o=0;o<n.length;o++)n[o][t]()}}class cN{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!pe(e))return;const t=Object.keys(Fe.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach(o=>{const r=e[o];if(!pe(r))return;const a={};for(const l of t)a[l]=r[l];(Se(r.properties)&&r.properties||[o]).forEach(l=>{(l===o||!n.has(l))&&n.set(l,a)})})}_animateOptions(e,t){const n=t.options,o=sE(e,n);if(!o)return[];const r=this._createAnimations(o,n);return n.$shared&&aE(e.options.$animations,n).then(()=>{e.options=n},()=>{}),r}_createAnimations(e,t){const n=this._properties,o=[],r=e.$animations||(e.$animations={}),a=Object.keys(t),l=Date.now();let M;for(M=a.length-1;M>=0;--M){const c=a[M];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(e,t));continue}const u=t[c];let g=r[c];const d=n.get(c);if(g)if(d&&g.active()){g.update(d,u,l);continue}else g.cancel();if(!d||!d.duration){e[c]=u;continue}r[c]=g=new rE(d,e,c,u),o.push(g)}return o}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const n=this._createAnimations(e,t);if(n.length)return li.add(this._chart,n),!0}}function aE(i,e){const t=[],n=Object.keys(e);for(let o=0;o<n.length;o++){const r=i[n[o]];r&&r.active()&&t.push(r.wait())}return Promise.all(t)}function sE(i,e){if(!e)return;let t=i.options;if(!t){i.options=e;return}return t.$shared&&(i.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function uN(i,e){const t=i&&i.options||{},n=t.reverse,o=t.min===void 0?e:0,r=t.max===void 0?e:0;return{start:n?r:o,end:n?o:r}}function lE(i,e,t){if(t===!1)return!1;const n=uN(i,t),o=uN(e,t);return{top:o.end,right:n.end,bottom:o.start,left:n.start}}function ME(i){let e,t,n,o;return pe(i)?(e=i.top,t=i.right,n=i.bottom,o=i.left):e=t=n=o=i,{top:e,right:t,bottom:n,left:o,disabled:i===!1}}function gN(i,e){const t=[],n=i._getSortedDatasetMetas(e);let o,r;for(o=0,r=n.length;o<r;++o)t.push(n[o].index);return t}function dN(i,e,t,n={}){const o=i.keys,r=n.mode==="single";let a,l,M,c;if(e!==null){for(a=0,l=o.length;a<l;++a){if(M=+o[a],M===t){if(n.all)continue;break}c=i.values[M],Ze(c)&&(r||e===0||$t(e)===$t(c))&&(e+=c)}return e}}function cE(i){const e=Object.keys(i),t=new Array(e.length);let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n],t[n]={x:r,y:i[r]};return t}function NN(i,e){const t=i&&i.options.stacked;return t||t===void 0&&e.stack!==void 0}function uE(i,e,t){return`${i.id}.${e.id}.${t.stack||t.type}`}function gE(i){const{min:e,max:t,minDefined:n,maxDefined:o}=i.getUserBounds();return{min:n?e:Number.NEGATIVE_INFINITY,max:o?t:Number.POSITIVE_INFINITY}}function dE(i,e,t){const n=i[e]||(i[e]={});return n[t]||(n[t]={})}function jN(i,e,t,n){for(const o of e.getMatchingVisibleMetas(n).reverse()){const r=i[o.index];if(t&&r>0||!t&&r<0)return o.index}return null}function yN(i,e){const{chart:t,_cachedMeta:n}=i,o=t._stacks||(t._stacks={}),{iScale:r,vScale:a,index:l}=n,M=r.axis,c=a.axis,u=uE(r,a,n),g=e.length;let d;for(let y=0;y<g;++y){const j=e[y],{[M]:D,[c]:I}=j,N=j._stacks||(j._stacks={});d=N[c]=dE(o,u,D),d[l]=I,d._top=jN(d,a,!0,n.type),d._bottom=jN(d,a,!1,n.type);const m=d._visualValues||(d._visualValues={});m[l]=I}}function OM(i,e){const t=i.scales;return Object.keys(t).filter(n=>t[n].axis===e).shift()}function NE(i,e){return Ai(i,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function jE(i,e,t){return Ai(i,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function no(i,e){const t=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){e=e||i._parsed;for(const o of e){const r=o._stacks;if(!r||r[n]===void 0||r[n][t]===void 0)return;delete r[n][t],r[n]._visualValues!==void 0&&r[n]._visualValues[t]!==void 0&&delete r[n]._visualValues[t]}}}const CM=i=>i==="reset"||i==="none",IN=(i,e)=>e?i:Object.assign({},i),yE=(i,e,t)=>i&&!e.hidden&&e._stacked&&{keys:gN(t,!0),values:null};class mn{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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=NN(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&&no(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,n=this.getDataset(),o=(g,d,y,j)=>g==="x"?d:g==="r"?j:y,r=t.xAxisID=xe(n.xAxisID,OM(e,"x")),a=t.yAxisID=xe(n.yAxisID,OM(e,"y")),l=t.rAxisID=xe(n.rAxisID,OM(e,"r")),M=t.indexAxis,c=t.iAxisID=o(M,r,a,l),u=t.vAxisID=o(M,a,r,l);t.xScale=this.getScaleForId(r),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(l),t.iScale=this.getScaleForId(c),t.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 t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&vd(this._data,this),e._stacked&&no(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(pe(t))this._data=cE(t);else if(n!==t){if(n){vd(n,this);const o=this._cachedMeta;no(o),o._parsed=[]}t&&Object.isExtensible(t)&&Xx(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,n=this.getDataset();let o=!1;this._dataCheck();const r=t._stacked;t._stacked=NN(t.vScale,t),t.stack!==n.stack&&(o=!0,no(t),t.stack=n.stack),this._resyncElements(e),(o||r!==t._stacked)&&yN(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:n,_data:o}=this,{iScale:r,_stacked:a}=n,l=r.axis;let M=e===0&&t===o.length?!0:n._sorted,c=e>0&&n._parsed[e-1],u,g,d;if(this._parsing===!1)n._parsed=o,n._sorted=!0,d=o;else{Se(o[e])?d=this.parseArrayData(n,o,e,t):pe(o[e])?d=this.parseObjectData(n,o,e,t):d=this.parsePrimitiveData(n,o,e,t);const y=()=>g[l]===null||c&&g[l]<c[l];for(u=0;u<t;++u)n._parsed[u+e]=g=d[u],M&&(y()&&(M=!1),c=g);n._sorted=M}a&&yN(this,d)}parsePrimitiveData(e,t,n,o){const{iScale:r,vScale:a}=e,l=r.axis,M=a.axis,c=r.getLabels(),u=r===a,g=new Array(o);let d,y,j;for(d=0,y=o;d<y;++d)j=d+n,g[d]={[l]:u||r.parse(c[j],j),[M]:a.parse(t[j],j)};return g}parseArrayData(e,t,n,o){const{xScale:r,yScale:a}=e,l=new Array(o);let M,c,u,g;for(M=0,c=o;M<c;++M)u=M+n,g=t[u],l[M]={x:r.parse(g[0],u),y:a.parse(g[1],u)};return l}parseObjectData(e,t,n,o){const{xScale:r,yScale:a}=e,{xAxisKey:l="x",yAxisKey:M="y"}=this._parsing,c=new Array(o);let u,g,d,y;for(u=0,g=o;u<g;++u)d=u+n,y=t[d],c[u]={x:r.parse(Dn(y,l),d),y:a.parse(Dn(y,M),d)};return c}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){const o=this.chart,r=this._cachedMeta,a=t[e.axis],l={keys:gN(o,!0),values:t._stacks[e.axis]._visualValues};return dN(l,a,r.index,{mode:n})}updateRangeFromParsed(e,t,n,o){const r=n[t.axis];let a=r===null?NaN:r;const l=o&&n._stacks[t.axis];o&&l&&(o.values=l,a=dN(o,r,this._cachedMeta.index)),e.min=Math.min(e.min,a),e.max=Math.max(e.max,a)}getMinMax(e,t){const n=this._cachedMeta,o=n._parsed,r=n._sorted&&e===n.iScale,a=o.length,l=this._getOtherScale(e),M=yE(t,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:g}=gE(l);let d,y;function j(){y=o[d];const D=y[l.axis];return!Ze(y[e.axis])||u>D||g<D}for(d=0;d<a&&!(!j()&&(this.updateRangeFromParsed(c,e,y,M),r));++d);if(r){for(d=a-1;d>=0;--d)if(!j()){this.updateRangeFromParsed(c,e,y,M);break}}return c}getAllParsedValues(e){const t=this._cachedMeta._parsed,n=[];let o,r,a;for(o=0,r=t.length;o<r;++o)a=t[o][e.axis],Ze(a)&&n.push(a);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,n=t.iScale,o=t.vScale,r=this.getParsed(e);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:o?""+o.getLabelForValue(r[o.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=ME(xe(this.options.clip,lE(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,n=this._cachedMeta,o=n.data||[],r=t.chartArea,a=[],l=this._drawStart||0,M=this._drawCount||o.length-l,c=this.options.drawActiveElementsOnTop;let u;for(n.dataset&&n.dataset.draw(e,r,l,M),u=l;u<l+M;++u){const g=o[u];g.hidden||(g.active&&c?a.push(g):g.draw(e,r))}for(u=0;u<a.length;++u)a[u].draw(e,r)}getStyle(e,t){const n=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){const o=this.getDataset();let r;if(e>=0&&e<this._cachedMeta.data.length){const a=this._cachedMeta.data[e];r=a.$context||(a.$context=jE(this.getContext(),e,a)),r.parsed=this.getParsed(e),r.raw=o.data[e],r.index=r.dataIndex=e}else r=this.$context||(this.$context=NE(this.chart.getContext(),this.index)),r.dataset=o,r.index=r.datasetIndex=this.index;return r.active=!!t,r.mode=n,r}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",n){const o=t==="active",r=this._cachedDataOpts,a=e+"-"+t,l=r[a],M=this.enableOptionSharing&&Jn(n);if(l)return IN(l,M);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,e),g=o?[`${e}Hover`,"hover",e,""]:[e,""],d=c.getOptionScopes(this.getDataset(),u),y=Object.keys(Fe.elements[e]),j=()=>this.getContext(n,o,t),D=c.resolveNamedOptions(d,y,j,g);return D.$shared&&(D.$shared=M,r[a]=Object.freeze(IN(D,M))),D}_resolveAnimations(e,t,n){const o=this.chart,r=this._cachedDataOpts,a=`animation-${t}`,l=r[a];if(l)return l;let M;if(o.options.animation!==!1){const u=this.chart.config,g=u.datasetAnimationScopeKeys(this._type,t),d=u.getOptionScopes(this.getDataset(),g);M=u.createResolver(d,this.getContext(e,n,t))}const c=new cN(o,M&&M.animations);return M&&M._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||CM(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const n=this.resolveDataElementOptions(e,t),o=this._sharedOptions,r=this.getSharedOptions(n),a=this.includeOptions(t,r)||r!==o;return this.updateSharedOptions(r,t,n),{sharedOptions:r,includeOptions:a}}updateElement(e,t,n,o){CM(o)?Object.assign(e,n):this._resolveAnimations(t,o).update(e,n)}updateSharedOptions(e,t,n){e&&!CM(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,o){e.active=o;const r=this.getStyle(t,o);this._resolveAnimations(t,n,o).update(e,{options:!o&&this.getSharedOptions(r)||r})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"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 t=this._data,n=this._cachedMeta.data;for(const[l,M,c]of this._syncList)this[l](M,c);this._syncList=[];const o=n.length,r=t.length,a=Math.min(r,o);a&&this.parse(0,a),r>o?this._insertElements(o,r-o,e):r<o&&this._removeElements(r,o-r)}_insertElements(e,t,n=!0){const o=this._cachedMeta,r=o.data,a=e+t;let l;const M=c=>{for(c.length+=t,l=c.length-1;l>=a;l--)c[l]=c[l-t]};for(M(r),l=e;l<a;++l)r[l]=new this.dataElementType;this._parsing&&M(o._parsed),this.parse(e,t),n&&this.updateElements(r,e,t,"reset")}updateElements(e,t,n,o){}_removeElements(e,t){const n=this._cachedMeta;if(this._parsing){const o=n._parsed.splice(e,t);n._stacked&&no(n,o)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,n,o]=e;this[t](n,o)}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,t){t&&this._sync(["_removeElements",e,t]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ae(mn,"defaults",{}),ae(mn,"datasetElementType",null),ae(mn,"dataElementType",null);function IE(i,e){if(!i._cache.$bar){const t=i.getMatchingVisibleMetas(e);let n=[];for(let o=0,r=t.length;o<r;o++)n=n.concat(t[o].controller.getAllParsedValues(i));i._cache.$bar=Qd(n.sort((o,r)=>o-r))}return i._cache.$bar}function hE(i){const e=i.iScale,t=IE(e,i.type);let n=e._length,o,r,a,l;const M=()=>{a===32767||a===-32768||(Jn(l)&&(n=Math.min(n,Math.abs(a-l)||n)),l=a)};for(o=0,r=t.length;o<r;++o)a=e.getPixelForValue(t[o]),M();for(l=void 0,o=0,r=e.ticks.length;o<r;++o)a=e.getPixelForTick(o),M();return n}function DE(i,e,t,n){const o=t.barThickness;let r,a;return be(o)?(r=e.min*t.categoryPercentage,a=t.barPercentage):(r=o*n,a=1),{chunk:r/n,ratio:a,start:e.pixels[i]-r/2}}function fE(i,e,t,n){const o=e.pixels,r=o[i];let a=i>0?o[i-1]:null,l=i<o.length-1?o[i+1]:null;const M=t.categoryPercentage;a===null&&(a=r-(l===null?e.end-e.start:l-r)),l===null&&(l=r+r-a);const c=r-(r-Math.min(a,l))/2*M;return{chunk:Math.abs(l-a)/2*M/n,ratio:t.barPercentage,start:c}}function pE(i,e,t,n){const o=t.parse(i[0],n),r=t.parse(i[1],n),a=Math.min(o,r),l=Math.max(o,r);let M=a,c=l;Math.abs(a)>Math.abs(l)&&(M=l,c=a),e[t.axis]=c,e._custom={barStart:M,barEnd:c,start:o,end:r,min:a,max:l}}function hN(i,e,t,n){return Se(i)?pE(i,e,t,n):e[t.axis]=t.parse(i,n),e}function DN(i,e,t,n){const o=i.iScale,r=i.vScale,a=o.getLabels(),l=o===r,M=[];let c,u,g,d;for(c=t,u=t+n;c<u;++c)d=e[c],g={},g[o.axis]=l||o.parse(a[c],c),M.push(hN(d,g,r,c));return M}function wM(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function zE(i,e,t){return i!==0?$t(i):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function mE(i){let e,t,n,o,r;return i.horizontal?(e=i.base>i.x,t="left",n="right"):(e=i.base<i.y,t="bottom",n="top"),e?(o="end",r="start"):(o="start",r="end"),{start:t,end:n,reverse:e,top:o,bottom:r}}function AE(i,e,t,n){let o=e.borderSkipped;const r={};if(!o){i.borderSkipped=r;return}if(o===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:M,top:c,bottom:u}=mE(i);o==="middle"&&t&&(i.enableBorderRadius=!0,(t._top||0)===n?o=c:(t._bottom||0)===n?o=u:(r[fN(u,a,l,M)]=!0,o=c)),r[fN(o,a,l,M)]=!0,i.borderSkipped=r}function fN(i,e,t,n){return n?(i=TE(i,e,t),i=pN(i,t,e)):i=pN(i,e,t),i}function TE(i,e,t){return i===e?t:i===t?e:i}function pN(i,e,t){return i==="start"?e:i==="end"?t:i}function xE(i,{inflateAmount:e},t){i.inflateAmount=e==="auto"?t===1?.33:0:e}class Ea extends mn{parsePrimitiveData(e,t,n,o){return DN(e,t,n,o)}parseArrayData(e,t,n,o){return DN(e,t,n,o)}parseObjectData(e,t,n,o){const{iScale:r,vScale:a}=e,{xAxisKey:l="x",yAxisKey:M="y"}=this._parsing,c=r.axis==="x"?l:M,u=a.axis==="x"?l:M,g=[];let d,y,j,D;for(d=n,y=n+o;d<y;++d)D=t[d],j={},j[r.axis]=r.parse(Dn(D,c),d),g.push(hN(Dn(D,u),j,a,d));return g}updateRangeFromParsed(e,t,n,o){super.updateRangeFromParsed(e,t,n,o);const r=n._custom;r&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,r.min),e.max=Math.max(e.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:n,vScale:o}=t,r=this.getParsed(e),a=r._custom,l=wM(a)?"["+a.start+", "+a.end+"]":""+o.getLabelForValue(r[o.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,o){const r=o==="reset",{index:a,_cachedMeta:{vScale:l}}=this,M=l.getBasePixel(),c=l.isHorizontal(),u=this._getRuler(),{sharedOptions:g,includeOptions:d}=this._getSharedOptions(t,o);for(let y=t;y<t+n;y++){const j=this.getParsed(y),D=r||be(j[l.axis])?{base:M,head:M}:this._calculateBarValuePixels(y),I=this._calculateBarIndexPixels(y,u),N=(j._stacks||{})[l.axis],m={horizontal:c,base:D.base,enableBorderRadius:!N||wM(j._custom)||a===N._top||a===N._bottom,x:c?D.head:I.center,y:c?I.center:D.head,height:c?I.size:Math.abs(D.size),width:c?Math.abs(D.size):I.size};d&&(m.options=g||this.resolveDataElementOptions(y,e[y].active?"active":o));const b=m.options||e[y].options;AE(m,b,N,a),xE(m,b,u.ratio),this.updateElement(e[y],y,m,o)}}_getStacks(e,t){const{iScale:n}=this._cachedMeta,o=n.getMatchingVisibleMetas(this._type).filter(M=>M.controller.options.grouped),r=n.options.stacked,a=[],l=M=>{const c=M.controller.getParsed(t),u=c&&c[M.vScale.axis];if(be(u)||isNaN(u))return!0};for(const M of o)if(!(t!==void 0&&l(M))&&((r===!1||a.indexOf(M.stack)===-1||r===void 0&&M.stack===void 0)&&a.push(M.stack),M.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,n){const o=this._getStacks(e,n),r=t!==void 0?o.indexOf(t):-1;return r===-1?o.length-1:r}_getRuler(){const e=this.options,t=this._cachedMeta,n=t.iScale,o=[];let r,a;for(r=0,a=t.data.length;r<a;++r)o.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));const l=e.barThickness;return{min:l||hE(t),pixels:o,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:n,index:o},options:{base:r,minBarLength:a}}=this,l=r||0,M=this.getParsed(e),c=M._custom,u=wM(c);let g=M[t.axis],d=0,y=n?this.applyStack(t,M,n):g,j,D;y!==g&&(d=y-g,y=g),u&&(g=c.barStart,y=c.barEnd-c.barStart,g!==0&&$t(g)!==$t(c.barEnd)&&(d=0),d+=g);const I=!be(r)&&!u?r:d;let N=t.getPixelForValue(I);if(this.chart.getDataVisibility(e)?j=t.getPixelForValue(d+y):j=N,D=j-N,Math.abs(D)<a){D=zE(D,t,l)*a,g===l&&(N-=D/2);const m=t.getPixelForDecimal(0),b=t.getPixelForDecimal(1),C=Math.min(m,b),E=Math.max(m,b);N=Math.max(Math.min(N,E),C),j=N+D,n&&!u&&(M._stacks[t.axis]._visualValues[o]=t.getValueForPixel(j)-t.getValueForPixel(N))}if(N===t.getPixelForValue(l)){const m=$t(D)*t.getLineWidthForValue(l)/2;N+=m,D-=m}return{size:D,base:N,head:j,center:j+D/2}}_calculateBarIndexPixels(e,t){const n=t.scale,o=this.options,r=o.skipNull,a=xe(o.maxBarThickness,1/0);let l,M;if(t.grouped){const c=r?this._getStackCount(e):t.stackCount,u=o.barThickness==="flex"?fE(e,t,o,c):DE(e,t,o,c),g=this._getStackIndex(this.index,this._cachedMeta.stack,r?e:void 0);l=u.start+u.chunk*g+u.chunk/2,M=Math.min(a,u.chunk*u.ratio)}else l=n.getPixelForValue(this.getParsed(e)[n.axis],e),M=Math.min(a,t.min*t.ratio);return{base:l-M/2,head:l+M/2,center:l,size:M}}draw(){const e=this._cachedMeta,t=e.vScale,n=e.data,o=n.length;let r=0;for(;r<o;++r)this.getParsed(r)[t.axis]!==null&&n[r].draw(this._ctx)}}ae(Ea,"id","bar"),ae(Ea,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ae(Ea,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ba extends mn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:n,data:o=[],_dataset:r}=t,a=this.chart._animationsDisabled;let{start:l,count:M}=qx(t,o,a);this._drawStart=l,this._drawCount=M,eL(t)&&(l=0,M=o.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=o;const c=this.resolveDatasetElementOptions(e);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!a,options:c},e),this.updateElements(o,l,M,e)}updateElements(e,t,n,o){const r=o==="reset",{iScale:a,vScale:l,_stacked:M,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:g}=this._getSharedOptions(t,o),d=a.axis,y=l.axis,{spanGaps:j,segment:D}=this.options,I=Kn(j)?j:Number.POSITIVE_INFINITY,N=this.chart._animationsDisabled||r||o==="none",m=t+n,b=e.length;let C=t>0&&this.getParsed(t-1);for(let E=0;E<b;++E){const A=e[E],O=N?A:{};if(E<t||E>=m){O.skip=!0;continue}const f=this.getParsed(E),z=be(f[y]),L=O[d]=a.getPixelForValue(f[d],E),p=O[y]=r||z?l.getBasePixel():l.getPixelForValue(M?this.applyStack(l,f,M):f[y],E);O.skip=isNaN(L)||isNaN(p)||z,O.stop=E>0&&Math.abs(f[d]-C[d])>I,D&&(O.parsed=f,O.raw=c.data[E]),g&&(O.options=u||this.resolveDataElementOptions(E,A.active?"active":o)),N||this.updateElement(A,E,O,o),C=f}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,o=e.data||[];if(!o.length)return n;const r=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(n,r,a)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}ae(ba,"id","line"),ae(ba,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ae(ba,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Ki(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class SM{constructor(e){ae(this,"options");this.options=e||{}}static override(e){Object.assign(SM.prototype,e)}init(){}formats(){return Ki()}parse(){return Ki()}format(){return Ki()}add(){return Ki()}diff(){return Ki()}startOf(){return Ki()}endOf(){return Ki()}}var LE={_date:SM};function EE(i,e,t,n){const{controller:o,data:r,_sorted:a}=i,l=o._cachedMeta.iScale;if(l&&e===l.axis&&e!=="r"&&a&&r.length){const M=l._reversePixels?$x:Wi;if(n){if(o._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(e);if(u){const g=M(r,e,t-u),d=M(r,e,t+u);return{lo:g.lo,hi:d.hi}}}}else return M(r,e,t)}return{lo:0,hi:r.length-1}}function oo(i,e,t,n,o){const r=i.getSortedVisibleDatasetMetas(),a=t[e];for(let l=0,M=r.length;l<M;++l){const{index:c,data:u}=r[l],{lo:g,hi:d}=EE(r[l],e,a,o);for(let y=g;y<=d;++y){const j=u[y];j.skip||n(j,c,y)}}}function bE(i){const e=i.indexOf("x")!==-1,t=i.indexOf("y")!==-1;return function(n,o){const r=e?Math.abs(n.x-o.x):0,a=t?Math.abs(n.y-o.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function kM(i,e,t,n,o){const r=[];return!o&&!i.isPointInArea(e)||oo(i,t,e,function(l,M,c){!o&&!si(l,i.chartArea,0)||l.inRange(e.x,e.y,n)&&r.push({element:l,datasetIndex:M,index:c})},!0),r}function OE(i,e,t,n){let o=[];function r(a,l,M){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],n),{angle:g}=Wx(a,{x:e.x,y:e.y});Sd(g,c,u)&&o.push({element:a,datasetIndex:l,index:M})}return oo(i,t,e,r),o}function CE(i,e,t,n,o,r){let a=[];const l=bE(t);let M=Number.POSITIVE_INFINITY;function c(u,g,d){const y=u.inRange(e.x,e.y,o);if(n&&!y)return;const j=u.getCenterPoint(o);if(!(!!r||i.isPointInArea(j))&&!y)return;const I=l(e,j);I<M?(a=[{element:u,datasetIndex:g,index:d}],M=I):I===M&&a.push({element:u,datasetIndex:g,index:d})}return oo(i,t,e,c),a}function vM(i,e,t,n,o,r){return!r&&!i.isPointInArea(e)?[]:t==="r"&&!n?OE(i,e,t,o):CE(i,e,t,n,o,r)}function zN(i,e,t,n,o){const r=[],a=t==="x"?"inXRange":"inYRange";let l=!1;return oo(i,t,e,(M,c,u)=>{M[a](e[t],o)&&(r.push({element:M,datasetIndex:c,index:u}),l=l||M.inRange(e.x,e.y,o))}),n&&!l?[]:r}var wE={evaluateInteractionItems:oo,modes:{index(i,e,t,n){const o=Ji(e,i),r=t.axis||"x",a=t.includeInvisible||!1,l=t.intersect?kM(i,o,r,n,a):vM(i,o,r,!1,n,a),M=[];return l.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const u=l[0].index,g=c.data[u];g&&!g.skip&&M.push({element:g,datasetIndex:c.index,index:u})}),M):[]},dataset(i,e,t,n){const o=Ji(e,i),r=t.axis||"xy",a=t.includeInvisible||!1;let l=t.intersect?kM(i,o,r,n,a):vM(i,o,r,!1,n,a);if(l.length>0){const M=l[0].datasetIndex,c=i.getDatasetMeta(M).data;l=[];for(let u=0;u<c.length;++u)l.push({element:c[u],datasetIndex:M,index:u})}return l},point(i,e,t,n){const o=Ji(e,i),r=t.axis||"xy",a=t.includeInvisible||!1;return kM(i,o,r,n,a)},nearest(i,e,t,n){const o=Ji(e,i),r=t.axis||"xy",a=t.includeInvisible||!1;return vM(i,o,r,t.intersect,n,a)},x(i,e,t,n){const o=Ji(e,i);return zN(i,o,"x",t.intersect,n)},y(i,e,t,n){const o=Ji(e,i);return zN(i,o,"y",t.intersect,n)}}};const mN=["left","top","right","bottom"];function ro(i,e){return i.filter(t=>t.pos===e)}function AN(i,e){return i.filter(t=>mN.indexOf(t.pos)===-1&&t.box.axis===e)}function ao(i,e){return i.sort((t,n)=>{const o=e?n:t,r=e?t:n;return o.weight===r.weight?o.index-r.index:o.weight-r.weight})}function SE(i){const e=[];let t,n,o,r,a,l;for(t=0,n=(i||[]).length;t<n;++t)o=i[t],{position:r,options:{stack:a,stackWeight:l=1}}=o,e.push({index:t,box:o,pos:r,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&r+a,stackWeight:l});return e}function kE(i){const e={};for(const t of i){const{stack:n,pos:o,stackWeight:r}=t;if(!n||!mN.includes(o))continue;const a=e[n]||(e[n]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return e}function vE(i,e){const t=kE(i),{vBoxMaxWidth:n,hBoxMaxHeight:o}=e;let r,a,l;for(r=0,a=i.length;r<a;++r){l=i[r];const{fullSize:M}=l.box,c=t[l.stack],u=c&&l.stackWeight/c.weight;l.horizontal?(l.width=u?u*n:M&&e.availableWidth,l.height=o):(l.width=n,l.height=u?u*o:M&&e.availableHeight)}return t}function QE(i){const e=SE(i),t=ao(e.filter(c=>c.box.fullSize),!0),n=ao(ro(e,"left"),!0),o=ao(ro(e,"right")),r=ao(ro(e,"top"),!0),a=ao(ro(e,"bottom")),l=AN(e,"x"),M=AN(e,"y");return{fullSize:t,leftAndTop:n.concat(r),rightAndBottom:o.concat(M).concat(a).concat(l),chartArea:ro(e,"chartArea"),vertical:n.concat(o).concat(M),horizontal:r.concat(a).concat(l)}}function TN(i,e,t,n){return Math.max(i[t],e[t])+Math.max(i[n],e[n])}function xN(i,e){i.top=Math.max(i.top,e.top),i.left=Math.max(i.left,e.left),i.bottom=Math.max(i.bottom,e.bottom),i.right=Math.max(i.right,e.right)}function YE(i,e,t,n){const{pos:o,box:r}=t,a=i.maxPadding;if(!pe(o)){t.size&&(i[o]-=t.size);const g=n[t.stack]||{size:0,count:1};g.size=Math.max(g.size,t.horizontal?r.height:r.width),t.size=g.size/g.count,i[o]+=t.size}r.getPadding&&xN(a,r.getPadding());const l=Math.max(0,e.outerWidth-TN(a,i,"left","right")),M=Math.max(0,e.outerHeight-TN(a,i,"top","bottom")),c=l!==i.w,u=M!==i.h;return i.w=l,i.h=M,t.horizontal?{same:c,other:u}:{same:u,other:c}}function UE(i){const e=i.maxPadding;function t(n){const o=Math.max(e[n]-i[n],0);return i[n]+=o,o}i.y+=t("top"),i.x+=t("left"),t("right"),t("bottom")}function _E(i,e){const t=e.maxPadding;function n(o){const r={left:0,top:0,right:0,bottom:0};return o.forEach(a=>{r[a]=Math.max(e[a],t[a])}),r}return n(i?["left","right"]:["top","bottom"])}function so(i,e,t,n){const o=[];let r,a,l,M,c,u;for(r=0,a=i.length,c=0;r<a;++r){l=i[r],M=l.box,M.update(l.width||e.w,l.height||e.h,_E(l.horizontal,e));const{same:g,other:d}=YE(e,t,l,n);c|=g&&o.length,u=u||d,M.fullSize||o.push(l)}return c&&so(o,e,t,n)||u}function Oa(i,e,t,n,o){i.top=t,i.left=e,i.right=e+n,i.bottom=t+o,i.width=n,i.height=o}function LN(i,e,t,n){const o=t.padding;let{x:r,y:a}=e;for(const l of i){const M=l.box,c=n[l.stack]||{count:1,placed:0,weight:1},u=l.stackWeight/c.weight||1;if(l.horizontal){const g=e.w*u,d=c.size||M.height;Jn(c.start)&&(a=c.start),M.fullSize?Oa(M,o.left,a,t.outerWidth-o.right-o.left,d):Oa(M,e.left+c.placed,a,g,d),c.start=a,c.placed+=g,a=M.bottom}else{const g=e.h*u,d=c.size||M.width;Jn(c.start)&&(r=c.start),M.fullSize?Oa(M,r,o.top,d,t.outerHeight-o.bottom-o.top):Oa(M,r,e.top+c.placed,d,g),c.start=r,c.placed+=g,r=M.right}}e.x=r,e.y=a}var Ti={addBox(i,e){i.boxes||(i.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(t){e.draw(t)}}]},i.boxes.push(e)},removeBox(i,e){const t=i.boxes?i.boxes.indexOf(e):-1;t!==-1&&i.boxes.splice(t,1)},configure(i,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(i,e,t,n){if(!i)return;const o=At(i.options.layout.padding),r=Math.max(e-o.width,0),a=Math.max(t-o.height,0),l=QE(i.boxes),M=l.vertical,c=l.horizontal;Oe(i.boxes,D=>{typeof D.beforeLayout=="function"&&D.beforeLayout()});const u=M.reduce((D,I)=>I.box.options&&I.box.options.display===!1?D:D+1,0)||1,g=Object.freeze({outerWidth:e,outerHeight:t,padding:o,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/u,hBoxMaxHeight:a/2}),d=Object.assign({},o);xN(d,At(n));const y=Object.assign({maxPadding:d,w:r,h:a,x:o.left,y:o.top},o),j=vE(M.concat(c),g);so(l.fullSize,y,g,j),so(M,y,g,j),so(c,y,g,j)&&so(M,y,g,j),UE(y),LN(l.leftAndTop,y,g,j),y.x+=y.w,y.y+=y.h,LN(l.rightAndBottom,y,g,j),i.chartArea={left:y.left,top:y.top,right:y.left+y.w,bottom:y.top+y.h,height:y.h,width:y.w},Oe(l.chartArea,D=>{const I=D.box;Object.assign(I,i.chartArea),I.update(y.w,y.h,{left:0,top:0,right:0,bottom:0})})}};class EN{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,o){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,o?Math.floor(t/o):n)}}isAttached(e){return!0}updateConfig(e){}}class BE extends EN{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Ca="$chartjs",PE={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bN=i=>i===null||i==="";function RE(i,e){const t=i.style,n=i.getAttribute("height"),o=i.getAttribute("width");if(i[Ca]={initial:{height:n,width:o,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",bN(o)){const r=iN(i,"width");r!==void 0&&(i.width=r)}if(bN(n))if(i.style.height==="")i.height=i.width/(e||2);else{const r=iN(i,"height");r!==void 0&&(i.height=r)}return i}const ON=VL?{passive:!0}:!1;function ZE(i,e,t){i&&i.addEventListener(e,t,ON)}function VE(i,e,t){i&&i.canvas&&i.canvas.removeEventListener(e,t,ON)}function GE(i,e){const t=PE[i.type]||i.type,{x:n,y:o}=Ji(i,e);return{type:t,chart:e,native:i,x:n!==void 0?n:null,y:o!==void 0?o:null}}function wa(i,e){for(const t of i)if(t===e||t.contains(e))return!0}function WE(i,e,t){const n=i.canvas,o=new MutationObserver(r=>{let a=!1;for(const l of r)a=a||wa(l.addedNodes,n),a=a&&!wa(l.removedNodes,n);a&&t()});return o.observe(document,{childList:!0,subtree:!0}),o}function HE(i,e,t){const n=i.canvas,o=new MutationObserver(r=>{let a=!1;for(const l of r)a=a||wa(l.removedNodes,n),a=a&&!wa(l.addedNodes,n);a&&t()});return o.observe(document,{childList:!0,subtree:!0}),o}const lo=new Map;let CN=0;function wN(){const i=window.devicePixelRatio;i!==CN&&(CN=i,lo.forEach((e,t)=>{t.currentDevicePixelRatio!==i&&e()}))}function FE(i,e){lo.size||window.addEventListener("resize",wN),lo.set(i,e)}function $E(i){lo.delete(i),lo.size||window.removeEventListener("resize",wN)}function JE(i,e,t){const n=i.canvas,o=n&&EM(n);if(!o)return;const r=Ud((l,M)=>{const c=o.clientWidth;t(l,M),c<o.clientWidth&&t()},window),a=new ResizeObserver(l=>{const M=l[0],c=M.contentRect.width,u=M.contentRect.height;c===0&&u===0||r(c,u)});return a.observe(o),FE(i,r),a}function QM(i,e,t){t&&t.disconnect(),e==="resize"&&$E(i)}function XE(i,e,t){const n=i.canvas,o=Ud(r=>{i.ctx!==null&&t(GE(r,i))},i);return ZE(n,e,o),o}class KE extends EN{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(RE(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t[Ca])return!1;const n=t[Ca].initial;["height","width"].forEach(r=>{const a=n[r];be(a)?t.removeAttribute(r):t.setAttribute(r,a)});const o=n.style||{};return Object.keys(o).forEach(r=>{t.style[r]=o[r]}),t.width=t.width,delete t[Ca],!0}addEventListener(e,t,n){this.removeEventListener(e,t);const o=e.$proxies||(e.$proxies={}),a={attach:WE,detach:HE,resize:JE}[t]||XE;o[t]=a(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),o=n[t];if(!o)return;({attach:QM,detach:QM,resize:QM}[t]||VE)(e,t,o),n[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,o){return ZL(e,t,n,o)}isAttached(e){const t=EM(e);return!!(t&&t.isConnected)}}function qE(i){return!LM()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?BE:KE}let qi=(os=class{constructor(){ae(this,"x");ae(this,"y");ae(this,"active",!1);ae(this,"options");ae(this,"$animations")}tooltipPosition(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return Kn(this.x)&&Kn(this.y)}getProps(e,t){const n=this.$animations;if(!t||!n)return this;const o={};return e.forEach(r=>{o[r]=n[r]&&n[r].active()?n[r]._to:this[r]}),o}},ae(os,"defaults",{}),ae(os,"defaultRoutes"),os);function e1(i,e){const t=i.options.ticks,n=t1(i),o=Math.min(t.maxTicksLimit||n,n),r=t.major.enabled?n1(e):[],a=r.length,l=r[0],M=r[a-1],c=[];if(a>o)return o1(e,c,r,a/o),c;const u=i1(r,e,o);if(a>0){let g,d;const y=a>1?Math.round((M-l)/(a-1)):null;for(Sa(e,c,u,be(y)?0:l-y,l),g=0,d=a-1;g<d;g++)Sa(e,c,u,r[g],r[g+1]);return Sa(e,c,u,M,be(y)?e.length:M+y),c}return Sa(e,c,u),c}function t1(i){const e=i.options.offset,t=i._tickSize(),n=i._length/t+(e?0:1),o=i._maxLength/t;return Math.floor(Math.min(n,o))}function i1(i,e,t){const n=r1(i),o=e.length/t;if(!n)return Math.max(o,1);const r=Vx(n);for(let a=0,l=r.length-1;a<l;a++){const M=r[a];if(M>o)return M}return Math.max(o,1)}function n1(i){const e=[];let t,n;for(t=0,n=i.length;t<n;t++)i[t].major&&e.push(t);return e}function o1(i,e,t,n){let o=0,r=t[0],a;for(n=Math.ceil(n),a=0;a<i.length;a++)a===r&&(e.push(i[a]),o++,r=t[o*n])}function Sa(i,e,t,n,o){const r=xe(n,0),a=Math.min(xe(o,i.length),i.length);let l=0,M,c,u;for(t=Math.ceil(t),o&&(M=o-n,t=M/Math.floor(M/t)),u=r;u<0;)l++,u=Math.round(r+l*t);for(c=Math.max(r,0);c<a;c++)c===u&&(e.push(i[c]),l++,u=Math.round(r+l*t))}function r1(i){const e=i.length;let t,n;if(e<2)return!1;for(n=i[0],t=1;t<e;++t)if(i[t]-i[t-1]!==n)return!1;return n}const a1=i=>i==="left"?"right":i==="right"?"left":i,SN=(i,e,t)=>e==="top"||e==="left"?i[e]+t:i[e]-t,kN=(i,e)=>Math.min(e||i,i);function vN(i,e){const t=[],n=i.length/e,o=i.length;let r=0;for(;r<o;r+=n)t.push(i[Math.floor(r)]);return t}function s1(i,e,t){const n=i.ticks.length,o=Math.min(e,n-1),r=i._startPixel,a=i._endPixel,l=1e-6;let M=i.getPixelForTick(o),c;if(!(t&&(n===1?c=Math.max(M-r,a-M):e===0?c=(i.getPixelForTick(1)-M)/2:c=(M-i.getPixelForTick(o-1))/2,M+=o<e?c:-c,M<r-l||M>a+l)))return M}function l1(i,e){Oe(i,t=>{const n=t.gc,o=n.length/2;let r;if(o>e){for(r=0;r<o;++r)delete t.data[n[r]];n.splice(0,o)}})}function Mo(i){return i.drawTicks?i.tickLength:0}function QN(i,e){if(!i.display)return 0;const t=ut(i.font,e),n=At(i.padding);return(Se(i.text)?i.text.length:1)*t.lineHeight+n.height}function M1(i,e){return Ai(i,{scale:e,type:"scale"})}function c1(i,e,t){return Ai(i,{tick:t,index:e,type:"tick"})}function u1(i,e,t){let n=_d(i);return(t&&e!=="right"||!t&&e==="right")&&(n=a1(n)),n}function g1(i,e,t,n){const{top:o,left:r,bottom:a,right:l,chart:M}=i,{chartArea:c,scales:u}=M;let g=0,d,y,j;const D=a-o,I=l-r;if(i.isHorizontal()){if(y=qn(n,r,l),pe(t)){const N=Object.keys(t)[0],m=t[N];j=u[N].getPixelForValue(m)+D-e}else t==="center"?j=(c.bottom+c.top)/2+D-e:j=SN(i,t,e);d=l-r}else{if(pe(t)){const N=Object.keys(t)[0],m=t[N];y=u[N].getPixelForValue(m)-I+e}else t==="center"?y=(c.left+c.right)/2-I+e:y=SN(i,t,e);j=qn(n,a,o),g=t==="left"?-pt:pt}return{titleX:y,titleY:j,maxWidth:d,rotation:g}}class en extends qi{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,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:o}=this;return e=Dt(e,Number.POSITIVE_INFINITY),t=Dt(t,Number.NEGATIVE_INFINITY),n=Dt(n,Number.POSITIVE_INFINITY),o=Dt(o,Number.NEGATIVE_INFINITY),{min:Dt(e,n),max:Dt(t,o),minDefined:Ze(e),maxDefined:Ze(t)}}getMinMax(e){let{min:t,max:n,minDefined:o,maxDefined:r}=this.getUserBounds(),a;if(o&&r)return{min:t,max:n};const l=this.getMatchingVisibleMetas();for(let M=0,c=l.length;M<c;++M)a=l[M].controller.getMinMax(this,e),o||(t=Math.min(t,a.min)),r||(n=Math.max(n,a.max));return t=r&&t>n?n:t,n=o&&t>n?t:n,{min:Dt(t,Dt(n,t)),max:Dt(n,Dt(t,n))}}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(){Ve(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:o,grace:r,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=pL(this,r,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const M=l<this.ticks.length;this._convertTicksToLabels(M?vN(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=e1(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),M&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,n;this.isHorizontal()?(t=this.left,n=this.right):(t=this.top,n=this.bottom,e=!e),this._startPixel=t,this._endPixel=n,this._reversePixels=e,this._length=n-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ve(this.options.afterUpdate,[this])}beforeSetDimensions(){Ve(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(){Ve(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Ve(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ve(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let n,o,r;for(n=0,o=e.length;n<o;n++)r=e[n],r.label=Ve(t.callback,[r.value,n,e],this)}afterTickToLabelConversion(){Ve(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ve(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,n=kN(this.ticks.length,e.ticks.maxTicksLimit),o=t.minRotation||0,r=t.maxRotation;let a=o,l,M,c;if(!this._isVisible()||!t.display||o>=r||n<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),g=u.widest.width,d=u.highest.height,y=mt(this.chart.width-g,0,this.maxWidth);l=e.offset?this.maxWidth/n:y/(n-1),g+6>l&&(l=y/(n-(e.offset?.5:1)),M=this.maxHeight-Mo(e.grid)-t.padding-QN(e.title,this.chart.options.font),c=Math.sqrt(g*g+d*d),a=dM(Math.min(Math.asin(mt((u.highest.height+6)/l,-1,1)),Math.asin(mt(M/c,-1,1))-Math.asin(mt(d/c,-1,1)))),a=Math.max(o,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){Ve(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ve(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:o,grid:r}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const M=QN(o,t.options.font);if(l?(e.width=this.maxWidth,e.height=Mo(r)+M):(e.height=this.maxHeight,e.width=Mo(r)+M),n.display&&this.ticks.length){const{first:c,last:u,widest:g,highest:d}=this._getLabelSizes(),y=n.padding*2,j=mi(this.labelRotation),D=Math.cos(j),I=Math.sin(j);if(l){const N=n.mirror?0:I*g.width+D*d.height;e.height=Math.min(this.maxHeight,e.height+N+y)}else{const N=n.mirror?0:D*g.width+I*d.height;e.width=Math.min(this.maxWidth,e.width+N+y)}this._calculatePadding(c,u,I,D)}}this._handleMargins(),l?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,o){const{ticks:{align:r,padding:a},position:l}=this.options,M=this.labelRotation!==0,c=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,g=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,y=0;M?c?(d=o*e.width,y=n*t.height):(d=n*e.height,y=o*t.width):r==="start"?y=t.width:r==="end"?d=e.width:r!=="inner"&&(d=e.width/2,y=t.width/2),this.paddingLeft=Math.max((d-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((y-g+a)*this.width/(this.width-g),0)}else{let u=t.height/2,g=e.height/2;r==="start"?(u=0,g=e.height):r==="end"&&(u=t.height,g=0),this.paddingTop=u+a,this.paddingBottom=g+a}}_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(){Ve(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t<n;t++)be(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let n=this.ticks;t<n.length&&(n=vN(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){const{ctx:o,_longestTextCache:r}=this,a=[],l=[],M=Math.floor(t/kN(t,n));let c=0,u=0,g,d,y,j,D,I,N,m,b,C,E;for(g=0;g<t;g+=M){if(j=e[g].label,D=this._resolveTickFontOptions(g),o.font=I=D.string,N=r[I]=r[I]||{data:{},gc:[]},m=D.lineHeight,b=C=0,!be(j)&&!Se(j))b=pa(o,N.data,N.gc,b,j),C=m;else if(Se(j))for(d=0,y=j.length;d<y;++d)E=j[d],!be(E)&&!Se(E)&&(b=pa(o,N.data,N.gc,b,E),C+=m);a.push(b),l.push(C),c=Math.max(b,c),u=Math.max(C,u)}l1(r,t);const A=a.indexOf(c),O=l.indexOf(u),f=z=>({width:a[z]||0,height:l[z]||0});return{first:f(0),last:f(t-1),widest:f(A),highest:f(O),widths:a,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return Fx(this._alignToPixels?Fi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const n=t[e];return n.$context||(n.$context=c1(this.getContext(),e,n))}return this.$context||(this.$context=M1(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=mi(this.labelRotation),n=Math.abs(Math.cos(t)),o=Math.abs(Math.sin(t)),r=this._getLabelSizes(),a=e.autoSkipPadding||0,l=r?r.widest.width+a:0,M=r?r.highest.height+a:0;return this.isHorizontal()?M*n>l*o?l/n:M/o:M*o<l*n?M/n:l/o}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,n=this.chart,o=this.options,{grid:r,position:a,border:l}=o,M=r.offset,c=this.isHorizontal(),g=this.ticks.length+(M?1:0),d=Mo(r),y=[],j=l.setContext(this.getContext()),D=j.display?j.width:0,I=D/2,N=function(S){return Fi(n,S,D)};let m,b,C,E,A,O,f,z,L,p,h,T;if(a==="top")m=N(this.bottom),O=this.bottom-d,z=m-I,p=N(e.top)+I,T=e.bottom;else if(a==="bottom")m=N(this.top),p=e.top,T=N(e.bottom)-I,O=m+I,z=this.top+d;else if(a==="left")m=N(this.right),A=this.right-d,f=m-I,L=N(e.left)+I,h=e.right;else if(a==="right")m=N(this.left),L=e.left,h=N(e.right)-I,A=m+I,f=this.left+d;else if(t==="x"){if(a==="center")m=N((e.top+e.bottom)/2+.5);else if(pe(a)){const S=Object.keys(a)[0],v=a[S];m=N(this.chart.scales[S].getPixelForValue(v))}p=e.top,T=e.bottom,O=m+I,z=O+d}else if(t==="y"){if(a==="center")m=N((e.left+e.right)/2);else if(pe(a)){const S=Object.keys(a)[0],v=a[S];m=N(this.chart.scales[S].getPixelForValue(v))}A=m-I,f=A-d,L=e.left,h=e.right}const w=xe(o.ticks.maxTicksLimit,g),x=Math.max(1,Math.ceil(g/w));for(b=0;b<g;b+=x){const S=this.getContext(b),v=r.setContext(S),k=l.setContext(S),P=v.lineWidth,W=v.color,Q=k.dash||[],_=k.dashOffset,$=v.tickWidth,ne=v.tickColor,ie=v.tickBorderDash||[],F=v.tickBorderDashOffset;C=s1(this,b,M),C!==void 0&&(E=Fi(n,C,P),c?A=f=L=h=E:O=z=p=T=E,y.push({tx1:A,ty1:O,tx2:f,ty2:z,x1:L,y1:p,x2:h,y2:T,width:P,color:W,borderDash:Q,borderDashOffset:_,tickWidth:$,tickColor:ne,tickBorderDash:ie,tickBorderDashOffset:F}))}return this._ticksLength=g,this._borderValue=m,y}_computeLabelItems(e){const t=this.axis,n=this.options,{position:o,ticks:r}=n,a=this.isHorizontal(),l=this.ticks,{align:M,crossAlign:c,padding:u,mirror:g}=r,d=Mo(n.grid),y=d+u,j=g?-u:y,D=-mi(this.labelRotation),I=[];let N,m,b,C,E,A,O,f,z,L,p,h,T="middle";if(o==="top")A=this.bottom-j,O=this._getXAxisLabelAlignment();else if(o==="bottom")A=this.top+j,O=this._getXAxisLabelAlignment();else if(o==="left"){const x=this._getYAxisLabelAlignment(d);O=x.textAlign,E=x.x}else if(o==="right"){const x=this._getYAxisLabelAlignment(d);O=x.textAlign,E=x.x}else if(t==="x"){if(o==="center")A=(e.top+e.bottom)/2+y;else if(pe(o)){const x=Object.keys(o)[0],S=o[x];A=this.chart.scales[x].getPixelForValue(S)+y}O=this._getXAxisLabelAlignment()}else if(t==="y"){if(o==="center")E=(e.left+e.right)/2-y;else if(pe(o)){const x=Object.keys(o)[0],S=o[x];E=this.chart.scales[x].getPixelForValue(S)}O=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(M==="start"?T="top":M==="end"&&(T="bottom"));const w=this._getLabelSizes();for(N=0,m=l.length;N<m;++N){b=l[N],C=b.label;const x=r.setContext(this.getContext(N));f=this.getPixelForTick(N)+r.labelOffset,z=this._resolveTickFontOptions(N),L=z.lineHeight,p=Se(C)?C.length:1;const S=p/2,v=x.color,k=x.textStrokeColor,P=x.textStrokeWidth;let W=O;a?(E=f,O==="inner"&&(N===m-1?W=this.options.reverse?"left":"right":N===0?W=this.options.reverse?"right":"left":W="center"),o==="top"?c==="near"||D!==0?h=-p*L+L/2:c==="center"?h=-w.highest.height/2-S*L+L:h=-w.highest.height+L/2:c==="near"||D!==0?h=L/2:c==="center"?h=w.highest.height/2-S*L:h=w.highest.height-p*L,g&&(h*=-1),D!==0&&!x.showLabelBackdrop&&(E+=L/2*Math.sin(D))):(A=f,h=(1-p)*L/2);let Q;if(x.showLabelBackdrop){const _=At(x.backdropPadding),$=w.heights[N],ne=w.widths[N];let ie=h-_.top,F=0-_.left;switch(T){case"middle":ie-=$/2;break;case"bottom":ie-=$;break}switch(O){case"center":F-=ne/2;break;case"right":F-=ne;break;case"inner":N===m-1?F-=ne:N>0&&(F-=ne/2);break}Q={left:F,top:ie,width:ne+_.width,height:$+_.height,color:x.backdropColor}}I.push({label:C,font:z,textOffset:h,options:{rotation:D,color:v,strokeColor:k,strokeWidth:P,textAlign:W,textBaseline:T,translation:[E,A],backdrop:Q}})}return I}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-mi(this.labelRotation))return e==="top"?"left":"right";let o="center";return t.align==="start"?o="left":t.align==="end"?o="right":t.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:n,mirror:o,padding:r}}=this.options,a=this._getLabelSizes(),l=e+r,M=a.widest.width;let c,u;return t==="left"?o?(u=this.right+r,n==="near"?c="left":n==="center"?(c="center",u+=M/2):(c="right",u+=M)):(u=this.right-l,n==="near"?c="right":n==="center"?(c="center",u-=M/2):(c="left",u=this.left)):t==="right"?o?(u=this.left+r,n==="near"?c="right":n==="center"?(c="center",u-=M/2):(c="left",u-=M)):(u=this.left+l,n==="near"?c="left":n==="center"?(c="center",u+=M/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:n,top:o,width:r,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,o,r,a),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const o=this.ticks.findIndex(r=>r.value===e);return o>=0?t.setContext(this.getContext(o)).lineWidth:0}drawGrid(e){const t=this.options.grid,n=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let r,a;const l=(M,c,u)=>{!u.width||!u.color||(n.save(),n.lineWidth=u.width,n.strokeStyle=u.color,n.setLineDash(u.borderDash||[]),n.lineDashOffset=u.borderDashOffset,n.beginPath(),n.moveTo(M.x,M.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(t.display)for(r=0,a=o.length;r<a;++r){const M=o[r];t.drawOnChartArea&&l({x:M.x1,y:M.y1},{x:M.x2,y:M.y2},M),t.drawTicks&&l({x:M.tx1,y:M.ty1},{x:M.tx2,y:M.ty2},{color:M.tickColor,width:M.tickWidth,borderDash:M.tickBorderDash,borderDashOffset:M.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:n,grid:o}}=this,r=n.setContext(this.getContext()),a=n.display?r.width:0;if(!a)return;const l=o.setContext(this.getContext(0)).lineWidth,M=this._borderValue;let c,u,g,d;this.isHorizontal()?(c=Fi(e,this.left,a)-a/2,u=Fi(e,this.right,l)+l/2,g=d=M):(g=Fi(e,this.top,a)-a/2,d=Fi(e,this.bottom,l)+l/2,c=u=M),t.save(),t.lineWidth=r.width,t.strokeStyle=r.color,t.beginPath(),t.moveTo(c,g),t.lineTo(u,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const n=this.ctx,o=this._computeLabelArea();o&&zM(n,o);const r=this.getLabelItems(e);for(const a of r){const l=a.options,M=a.font,c=a.label,u=a.textOffset;io(n,c,0,u,M,l)}o&&mM(n)}drawTitle(){const{ctx:e,options:{position:t,title:n,reverse:o}}=this;if(!n.display)return;const r=ut(n.font),a=At(n.padding),l=n.align;let M=r.lineHeight/2;t==="bottom"||t==="center"||pe(t)?(M+=a.bottom,Se(n.text)&&(M+=r.lineHeight*(n.text.length-1))):M+=a.top;const{titleX:c,titleY:u,maxWidth:g,rotation:d}=g1(this,M,t,l);io(e,n.text,0,0,r,{color:n.color,maxWidth:g,rotation:d,textAlign:u1(l,t,o),textBaseline:"middle",translation:[c,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,n=xe(e.grid&&e.grid.z,-1),o=xe(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==en.prototype.draw?[{z:t,draw:r=>{this.draw(r)}}]:[{z:n,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:t,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",o=[];let r,a;for(r=0,a=t.length;r<a;++r){const l=t[r];l[n]===this.id&&(!e||l.type===e)&&o.push(l)}return o}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return ut(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ka{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let n;j1(t)&&(n=this.register(t));const o=this.items,r=e.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+e);return r in o||(o[r]=e,d1(e,a,n),this.override&&Fe.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,o=this.scope;n in t&&delete t[n],o&&n in Fe[o]&&(delete Fe[o][n],this.override&&delete Hi[n])}}function d1(i,e,t){const n=Fn(Object.create(null),[t?Fe.get(t):{},Fe.get(e),i.defaults]);Fe.set(e,n),i.defaultRoutes&&N1(e,i.defaultRoutes),i.descriptors&&Fe.describe(e,i.descriptors)}function N1(i,e){Object.keys(e).forEach(t=>{const n=t.split("."),o=n.pop(),r=[i].concat(n).join("."),a=e[t].split("."),l=a.pop(),M=a.join(".");Fe.route(r,o,M,l)})}function j1(i){return"id"in i&&"defaults"in i}class y1{constructor(){this.controllers=new ka(mn,"datasets",!0),this.elements=new ka(qi,"elements"),this.plugins=new ka(Object,"plugins"),this.scales=new ka(en,"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,t,n){[...t].forEach(o=>{const r=n||this._getRegistryForType(o);n||r.isForType(o)||r===this.plugins&&o.id?this._exec(e,r,o):Oe(o,a=>{const l=n||this._getRegistryForType(a);this._exec(e,l,a)})})}_exec(e,t,n){const o=gM(e);Ve(n["before"+o],[],n),t[e](n),Ve(n["after"+o],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){const o=t.get(e);if(o===void 0)throw new Error('"'+e+'" is not a registered '+n+".");return o}}var Jt=new y1;class I1{constructor(){this._init=[]}notify(e,t,n,o){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const r=o?this._descriptors(e).filter(o):this._descriptors(e),a=this._notify(r,e,t,n);return t==="afterDestroy"&&(this._notify(r,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,t,n,o){o=o||{};for(const r of e){const a=r.plugin,l=a[n],M=[t,o,r.options];if(Ve(l,M,a)===!1&&o.cancelable)return!1}return!0}invalidate(){be(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,o=xe(n.options&&n.options.plugins,{}),r=h1(n);return o===!1&&!t?[]:f1(e,r,o,t)}_notifyStateChanges(e){const t=this._oldCache||[],n=this._cache,o=(r,a)=>r.filter(l=>!a.some(M=>l.plugin.id===M.plugin.id));this._notify(o(t,n),e,"stop"),this._notify(o(n,t),e,"start")}}function h1(i){const e={},t=[],n=Object.keys(Jt.plugins.items);for(let r=0;r<n.length;r++)t.push(Jt.getPlugin(n[r]));const o=i.plugins||[];for(let r=0;r<o.length;r++){const a=o[r];t.indexOf(a)===-1&&(t.push(a),e[a.id]=!0)}return{plugins:t,localIds:e}}function D1(i,e){return!e&&i===!1?null:i===!0?{}:i}function f1(i,{plugins:e,localIds:t},n,o){const r=[],a=i.getContext();for(const l of e){const M=l.id,c=D1(n[M],o);c!==null&&r.push({plugin:l,options:p1(i.config,{plugin:l,local:t[M]},c,a)})}return r}function p1(i,{plugin:e,local:t},n,o){const r=i.pluginScopeKeys(e),a=i.getOptionScopes(n,r);return t&&e.defaults&&a.push(e.defaults),i.createResolver(a,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function YM(i,e){const t=Fe.datasets[i]||{};return((e.datasets||{})[i]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function z1(i,e){let t=i;return i==="_index_"?t=e:i==="_value_"&&(t=e==="x"?"y":"x"),t}function m1(i,e){return i===e?"_index_":"_value_"}function YN(i){if(i==="x"||i==="y"||i==="r")return i}function A1(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function UM(i,...e){if(YN(i))return i;for(const t of e){const n=t.axis||A1(t.position)||i.length>1&&YN(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function UN(i,e,t){if(t[e+"AxisID"]===i)return{axis:e}}function T1(i,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(t.length)return UN(i,"x",t[0])||UN(i,"y",t[0])}return{}}function x1(i,e){const t=Hi[i.type]||{scales:{}},n=e.scales||{},o=YM(i.type,e),r=Object.create(null);return Object.keys(n).forEach(a=>{const l=n[a];if(!pe(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const M=UM(a,l,T1(a,i),Fe.scales[l.type]),c=m1(M,o),u=t.scales||{};r[a]=$n(Object.create(null),[{axis:M},l,u[M],u[c]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,M=a.indexAxis||YM(l,e),u=(Hi[l]||{}).scales||{};Object.keys(u).forEach(g=>{const d=z1(g,M),y=a[d+"AxisID"]||d;r[y]=r[y]||Object.create(null),$n(r[y],[{axis:d},n[y],u[g]])})}),Object.keys(r).forEach(a=>{const l=r[a];$n(l,[Fe.scales[l.type],Fe.scale])}),r}function _N(i){const e=i.options||(i.options={});e.plugins=xe(e.plugins,{}),e.scales=x1(i,e)}function BN(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function L1(i){return i=i||{},i.data=BN(i.data),_N(i),i}const PN=new Map,RN=new Set;function va(i,e){let t=PN.get(i);return t||(t=e(),PN.set(i,t),RN.add(t)),t}const co=(i,e,t)=>{const n=Dn(e,t);n!==void 0&&i.add(n)};class E1{constructor(e){this._config=L1(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=BN(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(),_N(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return va(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return va(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return va(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,n=this.type;return va(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const n=this._scopeCache;let o=n.get(e);return(!o||t)&&(o=new Map,n.set(e,o)),o}getOptionScopes(e,t,n){const{options:o,type:r}=this,a=this._cachedScopes(e,n),l=a.get(t);if(l)return l;const M=new Set;t.forEach(u=>{e&&(M.add(e),u.forEach(g=>co(M,e,g))),u.forEach(g=>co(M,o,g)),u.forEach(g=>co(M,Hi[r]||{},g)),u.forEach(g=>co(M,Fe,g)),u.forEach(g=>co(M,DM,g))});const c=Array.from(M);return c.length===0&&c.push(Object.create(null)),RN.has(t)&&a.set(t,c),c}chartOptionScopes(){const{options:e,type:t}=this;return[e,Hi[t]||{},Fe.datasets[t]||{},{type:t},Fe,DM]}resolveNamedOptions(e,t,n,o=[""]){const r={$shared:!0},{resolver:a,subPrefixes:l}=ZN(this._resolverCache,e,o);let M=a;if(O1(a,t)){r.$shared=!1,n=pi(n)?n():n;const c=this.createResolver(e,n,l);M=pn(a,n,c)}for(const c of t)r[c]=M[c];return r}createResolver(e,t,n=[""],o){const{resolver:r}=ZN(this._resolverCache,e,n);return pe(t)?pn(r,t,void 0,o):r}}function ZN(i,e,t){let n=i.get(e);n||(n=new Map,i.set(e,n));const o=t.join();let r=n.get(o);return r||(r={resolver:AM(e,t),subPrefixes:t.filter(l=>!l.toLowerCase().includes("hover"))},n.set(o,r)),r}const b1=i=>pe(i)&&Object.getOwnPropertyNames(i).some(e=>pi(i[e]));function O1(i,e){const{isScriptable:t,isIndexable:n}=Fd(i);for(const o of e){const r=t(o),a=n(o),l=(a||r)&&i[o];if(r&&(pi(l)||b1(l))||a&&Se(l))return!0}return!1}var C1="4.4.2";const w1=["top","bottom","left","right","chartArea"];function VN(i,e){return i==="top"||i==="bottom"||w1.indexOf(i)===-1&&e==="x"}function GN(i,e){return function(t,n){return t[i]===n[i]?t[e]-n[e]:t[i]-n[i]}}function WN(i){const e=i.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Ve(t&&t.onComplete,[i],e)}function S1(i){const e=i.chart,t=e.options.animation;Ve(t&&t.onProgress,[i],e)}function HN(i){return LM()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Qa={},FN=i=>{const e=HN(i);return Object.values(Qa).filter(t=>t.canvas===e).pop()};function k1(i,e,t){const n=Object.keys(i);for(const o of n){const r=+o;if(r>=e){const a=i[o];delete i[o],(t>0||r>e)&&(i[r+t]=a)}}}function v1(i,e,t,n){return!t||i.type==="mouseout"?null:n?e:i}function Ya(i,e,t){return i.options.clip?i[t]:e[t]}function Q1(i,e){const{xScale:t,yScale:n}=i;return t&&n?{left:Ya(t,e,"left"),right:Ya(t,e,"right"),top:Ya(n,e,"top"),bottom:Ya(n,e,"bottom")}:e}let uo=(Si=class{static register(...e){Jt.add(...e),$N()}static unregister(...e){Jt.remove(...e),$N()}constructor(e,t){const n=this.config=new E1(t),o=HN(e),r=FN(o);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||qE(o)),this.platform.updateConfig(n);const l=this.platform.acquireContext(o,a.aspectRatio),M=l&&l.canvas,c=M&&M.height,u=M&&M.width;if(this.id=vx(),this.ctx=l,this.canvas=M,this.width=u,this.height=c,this._options=a,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 I1,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Kx(g=>this.update(g),a.resizeDelay||0),this._dataChanges=[],Qa[this.id]=this,!l||!M){console.error("Failed to create chart: can't acquire context from the given item");return}li.listen(this,"complete",WN),li.listen(this,"progress",S1),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:o,_aspectRatio:r}=this;return be(e)?t&&r?r:o?n/o: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 Jt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tN(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Gd(this.canvas,this.ctx),this}stop(){return li.stop(this),this}resize(e,t){li.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,o=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(o,e,t,r),l=n.devicePixelRatio||this.platform.getDevicePixelRatio(),M=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,tN(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),Ve(n.onResize,[this,a],this),this.attached&&this._doResize(M)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};Oe(t,(n,o)=>{n.id=o})}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,o=Object.keys(n).reduce((a,l)=>(a[l]=!1,a),{});let r=[];t&&(r=r.concat(Object.keys(t).map(a=>{const l=t[a],M=UM(a,l),c=M==="r",u=M==="x";return{options:l,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Oe(r,a=>{const l=a.options,M=l.id,c=UM(M,l),u=xe(l.type,a.dtype);(l.position===void 0||VN(l.position,c)!==VN(a.dposition))&&(l.position=a.dposition),o[M]=!0;let g=null;if(M in n&&n[M].type===u)g=n[M];else{const d=Jt.getScale(u);g=new d({id:M,type:u,ctx:this.ctx,chart:this}),n[g.id]=g}g.init(l,e)}),Oe(o,(a,l)=>{a||delete n[l]}),Oe(n,a=>{Ti.configure(this,a,a.options),Ti.addBox(this,a)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((o,r)=>o.index-r.index),n>t){for(let o=t;o<n;++o)this._destroyDatasetMeta(o);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(GN("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((n,o)=>{t.filter(r=>r===n._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,o;for(this._removeUnreferencedMetasets(),n=0,o=t.length;n<o;n++){const r=t[n];let a=this.getDatasetMeta(n);const l=r.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(n),a=this.getDatasetMeta(n)),a.type=l,a.indexAxis=r.indexAxis||YM(l,this.options),a.order=r.order||0,a.index=n,a.label=""+r.label,a.visible=this.isDatasetVisible(n),a.controller)a.controller.updateIndex(n),a.controller.linkScales();else{const M=Jt.getController(l),{datasetElementType:c,dataElementType:u}=Fe.datasets[l];Object.assign(M,{dataElementType:Jt.getElement(u),datasetElementType:c&&Jt.getElement(c)}),a.controller=new M(this,n),e.push(a.controller)}}return this._updateMetasets(),e}_resetElements(){Oe(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:g}=this.getDatasetMeta(c),d=!o&&r.indexOf(g)===-1;g.buildOrUpdateElements(d),a=Math.max(+g.getMaxOverflow(),a)}a=this._minPadding=n.layout.autoPadding?a:0,this._updateLayout(a),o||Oe(r,c=>{c.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(GN("z","_idx"));const{_active:l,_lastEvent:M}=this;M?this._eventHandler(M,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Oe(this.scales,e=>{Ti.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);(!Ed(t,n)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:o,count:r}of t){const a=n==="_removeElements"?-r:r;k1(e,o,a)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=r=>new Set(e.filter(a=>a[0]===r).map((a,l)=>l+","+a.splice(1).join(","))),o=n(0);for(let r=1;r<t;r++)if(!Ed(o,n(r)))return;return Array.from(o).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ti.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],Oe(this.boxes,o=>{n&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,r)=>{o._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,n=this.data.datasets.length;t<n;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,pi(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const n=this.getDatasetMeta(e),o={meta:n,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(n.controller._update(t),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(li.has(this)?this.attached&&!li.running(this)&&li.start(this):(this.draw(),WN({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:n,height:o}=this._resizeBeforeDraw;this._resize(n,o),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,n=[];let o,r;for(o=0,r=t.length;o<r;++o){const a=t[o];(!e||a.visible)&&n.push(a)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n=e._clip,o=!n.disabled,r=Q1(e,this.chartArea),a={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(o&&zM(t,{left:n.left===!1?0:r.left-n.left,right:n.right===!1?this.width:r.right+n.right,top:n.top===!1?0:r.top-n.top,bottom:n.bottom===!1?this.height:r.bottom+n.bottom}),e.controller.draw(),o&&mM(t),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return si(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,o){const r=wE.modes[t];return typeof r=="function"?r(this,e,n,o):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let o=n.filter(r=>r&&r._dataset===t).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(o)),o}getContext(){return this.$context||(this.$context=Ai(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return typeof n.hidden=="boolean"?!n.hidden:!t.hidden}setDatasetVisibility(e,t){const n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const o=n?"show":"hide",r=this.getDatasetMeta(e),a=r.controller._resolveAnimations(void 0,o);Jn(t)?(r.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(r,{visible:n}),this.update(l=>l.datasetIndex===e?o:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),li.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Gd(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Qa[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,t=this.platform,n=(r,a)=>{t.addEventListener(this,r,a),e[r]=a},o=(r,a,l)=>{r.offsetX=a,r.offsetY=l,this._eventHandler(r)};Oe(this.options.events,r=>n(r,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(M,c)=>{t.addEventListener(this,M,c),e[M]=c},o=(M,c)=>{e[M]&&(t.removeEventListener(this,M,c),delete e[M])},r=(M,c)=>{this.canvas&&this.resize(M,c)};let a;const l=()=>{o("attach",l),this.attached=!0,this.resize(),n("resize",r),n("detach",a)};a=()=>{this.attached=!1,o("resize",r),this._stop(),this._resize(0,0),n("attach",l)},t.isAttached(this.canvas)?l():a()}unbindEvents(){Oe(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Oe(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const o=n?"set":"remove";let r,a,l,M;for(t==="dataset"&&(r=this.getDatasetMeta(e[0].datasetIndex),r.controller["_"+o+"DatasetHoverStyle"]()),l=0,M=e.length;l<M;++l){a=e[l];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[o+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],n=e.map(({datasetIndex:r,index:a})=>{const l=this.getDatasetMeta(r);if(!l)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:l.data[a],index:a}});!ja(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){const o=this.options.hover,r=(M,c)=>M.filter(u=>!c.some(g=>u.datasetIndex===g.datasetIndex&&u.index===g.index)),a=r(t,e),l=n?e:r(e,t);a.length&&this.updateHoverStyle(a,o.mode,!1),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},o=a=>(a.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",n,o)===!1)return;const r=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,o),(r||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:o=[],options:r}=this,a=t,l=this._getActiveElements(e,o,n,a),M=Px(e),c=v1(e,this._lastEvent,n,M);n&&(this._lastEvent=null,Ve(r.onHover,[e,l,this],this),M&&Ve(r.onClick,[e,l,this],this));const u=!ja(l,o);return(u||t)&&(this._active=l,this._updateHoverStyles(l,o,t)),this._lastEvent=c,u}_getActiveElements(e,t,n,o){if(e.type==="mouseout")return[];if(!n)return t;const r=this.options.hover;return this.getElementsAtEventForMode(e,r.mode,r,o)}},ae(Si,"defaults",Fe),ae(Si,"instances",Qa),ae(Si,"overrides",Hi),ae(Si,"registry",Jt),ae(Si,"version",C1),ae(Si,"getChart",FN),Si);function $N(){return Oe(uo.instances,i=>i._plugins.invalidate())}function JN(i,e,t=e){i.lineCap=xe(t.borderCapStyle,e.borderCapStyle),i.setLineDash(xe(t.borderDash,e.borderDash)),i.lineDashOffset=xe(t.borderDashOffset,e.borderDashOffset),i.lineJoin=xe(t.borderJoinStyle,e.borderJoinStyle),i.lineWidth=xe(t.borderWidth,e.borderWidth),i.strokeStyle=xe(t.borderColor,e.borderColor)}function Y1(i,e,t){i.lineTo(t.x,t.y)}function U1(i){return i.stepped?gL:i.tension||i.cubicInterpolationMode==="monotone"?dL:Y1}function XN(i,e,t={}){const n=i.length,{start:o=0,end:r=n-1}=t,{start:a,end:l}=e,M=Math.max(o,a),c=Math.min(r,l),u=o<a&&r<a||o>l&&r>l;return{count:n,start:M,loop:e.loop,ilen:c<M&&!u?n+c-M:c-M}}function _1(i,e,t,n){const{points:o,options:r}=e,{count:a,start:l,loop:M,ilen:c}=XN(o,t,n),u=U1(r);let{move:g=!0,reverse:d}=n||{},y,j,D;for(y=0;y<=c;++y)j=o[(l+(d?c-y:y))%a],!j.skip&&(g?(i.moveTo(j.x,j.y),g=!1):u(i,D,j,d,r.stepped),D=j);return M&&(j=o[(l+(d?c:0))%a],u(i,D,j,d,r.stepped)),!!M}function B1(i,e,t,n){const o=e.points,{count:r,start:a,ilen:l}=XN(o,t,n),{move:M=!0,reverse:c}=n||{};let u=0,g=0,d,y,j,D,I,N;const m=C=>(a+(c?l-C:C))%r,b=()=>{D!==I&&(i.lineTo(u,I),i.lineTo(u,D),i.lineTo(u,N))};for(M&&(y=o[m(0)],i.moveTo(y.x,y.y)),d=0;d<=l;++d){if(y=o[m(d)],y.skip)continue;const C=y.x,E=y.y,A=C|0;A===j?(E<D?D=E:E>I&&(I=E),u=(g*u+C)/++g):(b(),i.lineTo(C,E),j=A,g=0,D=I=E),N=E}b()}function _M(i){const e=i.options,t=e.borderDash&&e.borderDash.length;return!i._decimated&&!i._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?B1:_1}function P1(i){return i.stepped?GL:i.tension||i.cubicInterpolationMode==="monotone"?WL:Xi}function R1(i,e,t,n){let o=e._path;o||(o=e._path=new Path2D,e.path(o,t,n)&&o.closePath()),JN(i,e.options),i.stroke(o)}function Z1(i,e,t,n){const{segments:o,options:r}=e,a=_M(e);for(const l of o)JN(i,r,l.style),i.beginPath(),a(i,e,l,{start:t,end:t+n-1})&&i.closePath(),i.stroke()}const V1=typeof Path2D=="function";function G1(i,e,t,n){V1&&!e.options.segment?R1(i,e,t,n):Z1(i,e,t,n)}class xi extends qi{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,t){const n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const o=n.spanGaps?this._loop:this._fullLoop;YL(this._points,n,e,o,t),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=eE(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){const n=this.options,o=e[t],r=this.points,a=aN(this,{property:t,start:o,end:o});if(!a.length)return;const l=[],M=P1(n);let c,u;for(c=0,u=a.length;c<u;++c){const{start:g,end:d}=a[c],y=r[g],j=r[d];if(y===j){l.push(y);continue}const D=Math.abs((o-y[t])/(j[t]-y[t])),I=M(y,j,D,n.stepped);I[t]=e[t],l.push(I)}return l.length===1?l[0]:l}pathSegment(e,t,n){return _M(this)(e,this,t,n)}path(e,t,n){const o=this.segments,r=_M(this);let a=this._loop;t=t||0,n=n||this.points.length-t;for(const l of o)a&=r(e,this,l,{start:t,end:t+n-1});return!!a}draw(e,t,n,o){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(e.save(),G1(e,this,n,o),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ae(xi,"id","line"),ae(xi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ae(xi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ae(xi,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function KN(i,e,t,n){const o=i.options,{[t]:r}=i.getProps([t],n);return Math.abs(e-r)<o.radius+o.hitRadius}class Ua extends qi{constructor(t){super();ae(this,"parsed");ae(this,"skip");ae(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,o){const r=this.options,{x:a,y:l}=this.getProps(["x","y"],o);return Math.pow(t-a,2)+Math.pow(n-l,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(t,n){return KN(this,t,"x",n)}inYRange(t,n){return KN(this,t,"y",n)}getCenterPoint(t){const{x:n,y:o}=this.getProps(["x","y"],t);return{x:n,y:o}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const o=n&&t.borderWidth||0;return(n+o)*2}draw(t,n){const o=this.options;this.skip||o.radius<.1||!si(this,n,this.size(o)/2)||(t.strokeStyle=o.borderColor,t.lineWidth=o.borderWidth,t.fillStyle=o.backgroundColor,pM(t,o,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}ae(Ua,"id","point"),ae(Ua,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ae(Ua,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function qN(i,e){const{x:t,y:n,base:o,width:r,height:a}=i.getProps(["x","y","base","width","height"],e);let l,M,c,u,g;return i.horizontal?(g=a/2,l=Math.min(t,o),M=Math.max(t,o),c=n-g,u=n+g):(g=r/2,l=t-g,M=t+g,c=Math.min(n,o),u=Math.max(n,o)),{left:l,top:c,right:M,bottom:u}}function Li(i,e,t,n){return i?0:mt(e,t,n)}function W1(i,e,t){const n=i.options.borderWidth,o=i.borderSkipped,r=Hd(n);return{t:Li(o.top,r.top,0,t),r:Li(o.right,r.right,0,e),b:Li(o.bottom,r.bottom,0,t),l:Li(o.left,r.left,0,e)}}function H1(i,e,t){const{enableBorderRadius:n}=i.getProps(["enableBorderRadius"]),o=i.options.borderRadius,r=fn(o),a=Math.min(e,t),l=i.borderSkipped,M=n||pe(o);return{topLeft:Li(!M||l.top||l.left,r.topLeft,0,a),topRight:Li(!M||l.top||l.right,r.topRight,0,a),bottomLeft:Li(!M||l.bottom||l.left,r.bottomLeft,0,a),bottomRight:Li(!M||l.bottom||l.right,r.bottomRight,0,a)}}function F1(i){const e=qN(i),t=e.right-e.left,n=e.bottom-e.top,o=W1(i,t/2,n/2),r=H1(i,t/2,n/2);return{outer:{x:e.left,y:e.top,w:t,h:n,radius:r},inner:{x:e.left+o.l,y:e.top+o.t,w:t-o.l-o.r,h:n-o.t-o.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,r.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(o.b,o.r))}}}}function BM(i,e,t,n){const o=e===null,r=t===null,l=i&&!(o&&r)&&qN(i,n);return l&&(o||ha(e,l.left,l.right))&&(r||ha(t,l.top,l.bottom))}function $1(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function J1(i,e){i.rect(e.x,e.y,e.w,e.h)}function PM(i,e,t={}){const n=i.x!==t.x?-e:0,o=i.y!==t.y?-e:0,r=(i.x+i.w!==t.x+t.w?e:0)-n,a=(i.y+i.h!==t.y+t.h?e:0)-o;return{x:i.x+n,y:i.y+o,w:i.w+r,h:i.h+a,radius:i.radius}}class _a extends qi{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:t,options:{borderColor:n,backgroundColor:o}}=this,{inner:r,outer:a}=F1(this),l=$1(a.radius)?za:J1;e.save(),(a.w!==r.w||a.h!==r.h)&&(e.beginPath(),l(e,PM(a,t,r)),e.clip(),l(e,PM(r,-t,a)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),l(e,PM(r,t)),e.fillStyle=o,e.fill(),e.restore()}inRange(e,t,n){return BM(this,e,t,n)}inXRange(e,t){return BM(this,e,null,t)}inYRange(e,t){return BM(this,null,e,t)}getCenterPoint(e){const{x:t,y:n,base:o,horizontal:r}=this.getProps(["x","y","base","horizontal"],e);return{x:r?(t+o)/2:t,y:r?n:(n+o)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}ae(_a,"id","bar"),ae(_a,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ae(_a,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function X1(i,e,t){const n=i.segments,o=i.points,r=e.points,a=[];for(const l of n){let{start:M,end:c}=l;c=ZM(M,c,o);const u=RM(t,o[M],o[c],l.loop);if(!e.segments){a.push({source:l,target:u,start:o[M],end:o[c]});continue}const g=aN(e,u);for(const d of g){const y=RM(t,r[d.start],r[d.end],d.loop),j=rN(l,o,y);for(const D of j)a.push({source:D,target:d,start:{[t]:ej(u,y,"start",Math.max)},end:{[t]:ej(u,y,"end",Math.min)}})}}return a}function RM(i,e,t,n){if(n)return;let o=e[i],r=t[i];return i==="angle"&&(o=zt(o),r=zt(r)),{property:i,start:o,end:r}}function K1(i,e){const{x:t=null,y:n=null}=i||{},o=e.points,r=[];return e.segments.forEach(({start:a,end:l})=>{l=ZM(a,l,o);const M=o[a],c=o[l];n!==null?(r.push({x:M.x,y:n}),r.push({x:c.x,y:n})):t!==null&&(r.push({x:t,y:M.y}),r.push({x:t,y:c.y}))}),r}function ZM(i,e,t){for(;e>i;e--){const n=t[e];if(!isNaN(n.x)&&!isNaN(n.y))break}return e}function ej(i,e,t,n){return i&&e?n(i[t],e[t]):i?i[t]:e?e[t]:0}function tj(i,e){let t=[],n=!1;return Se(i)?(n=!0,t=i):t=K1(i,e),t.length?new xi({points:t,options:{tension:0},_loop:n,_fullLoop:n}):null}function ij(i){return i&&i.fill!==!1}function q1(i,e,t){let o=i[e].fill;const r=[e];let a;if(!t)return o;for(;o!==!1&&r.indexOf(o)===-1;){if(!Ze(o))return o;if(a=i[o],!a)return!1;if(a.visible)return o;r.push(o),o=a.fill}return!1}function eb(i,e,t){const n=ob(i);if(pe(n))return isNaN(n.value)?!1:n;let o=parseFloat(n);return Ze(o)&&Math.floor(o)===o?tb(n[0],e,o,t):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function tb(i,e,t,n){return(i==="-"||i==="+")&&(t=e+t),t===e||t<0||t>=n?!1:t}function ib(i,e){let t=null;return i==="start"?t=e.bottom:i==="end"?t=e.top:pe(i)?t=e.getPixelForValue(i.value):e.getBasePixel&&(t=e.getBasePixel()),t}function nb(i,e,t){let n;return i==="start"?n=t:i==="end"?n=e.options.reverse?e.min:e.max:pe(i)?n=i.value:n=e.getBaseValue(),n}function ob(i){const e=i.options,t=e.fill;let n=xe(t&&t.target,t);return n===void 0&&(n=!!e.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function rb(i){const{scale:e,index:t,line:n}=i,o=[],r=n.segments,a=n.points,l=ab(e,t);l.push(tj({x:null,y:e.bottom},n));for(let M=0;M<r.length;M++){const c=r[M];for(let u=c.start;u<=c.end;u++)sb(o,a[u],l)}return new xi({points:o,options:{}})}function ab(i,e){const t=[],n=i.getMatchingVisibleMetas("line");for(let o=0;o<n.length;o++){const r=n[o];if(r.index===e)break;r.hidden||t.unshift(r.dataset)}return t}function sb(i,e,t){const n=[];for(let o=0;o<t.length;o++){const r=t[o],{first:a,last:l,point:M}=lb(r,e,"x");if(!(!M||a&&l)){if(a)n.unshift(M);else if(i.push(M),!l)break}}i.push(...n)}function lb(i,e,t){const n=i.interpolate(e,t);if(!n)return{};const o=n[t],r=i.segments,a=i.points;let l=!1,M=!1;for(let c=0;c<r.length;c++){const u=r[c],g=a[u.start][t],d=a[u.end][t];if(ha(o,g,d)){l=o===g,M=o===d;break}}return{first:l,last:M,point:n}}class nj{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){const{x:o,y:r,radius:a}=this;return t=t||{start:0,end:ft},e.arc(o,r,a,t.end,t.start,!0),!n.bounds}interpolate(e){const{x:t,y:n,radius:o}=this,r=e.angle;return{x:t+Math.cos(r)*o,y:n+Math.sin(r)*o,angle:r}}}function Mb(i){const{chart:e,fill:t,line:n}=i;if(Ze(t))return cb(e,t);if(t==="stack")return rb(i);if(t==="shape")return!0;const o=ub(i);return o instanceof nj?o:tj(o,n)}function cb(i,e){const t=i.getDatasetMeta(e);return t&&i.isDatasetVisible(e)?t.dataset:null}function ub(i){return(i.scale||{}).getPointPositionForValue?db(i):gb(i)}function gb(i){const{scale:e={},fill:t}=i,n=ib(t,e);if(Ze(n)){const o=e.isHorizontal();return{x:o?n:null,y:o?null:n}}return null}function db(i){const{scale:e,fill:t}=i,n=e.options,o=e.getLabels().length,r=n.reverse?e.max:e.min,a=nb(t,e,r),l=[];if(n.grid.circular){const M=e.getPointPositionForValue(0,r);return new nj({x:M.x,y:M.y,radius:e.getDistanceFromCenterForValue(a)})}for(let M=0;M<o;++M)l.push(e.getPointPositionForValue(M,a));return l}function VM(i,e,t){const n=Mb(e),{line:o,scale:r,axis:a}=e,l=o.options,M=l.fill,c=l.backgroundColor,{above:u=c,below:g=c}=M||{};n&&o.points.length&&(zM(i,t),Nb(i,{line:o,target:n,above:u,below:g,area:t,scale:r,axis:a}),mM(i))}function Nb(i,e){const{line:t,target:n,above:o,below:r,area:a,scale:l}=e,M=t._loop?"angle":e.axis;i.save(),M==="x"&&r!==o&&(oj(i,n,a.top),rj(i,{line:t,target:n,color:o,scale:l,property:M}),i.restore(),i.save(),oj(i,n,a.bottom)),rj(i,{line:t,target:n,color:r,scale:l,property:M}),i.restore()}function oj(i,e,t){const{segments:n,points:o}=e;let r=!0,a=!1;i.beginPath();for(const l of n){const{start:M,end:c}=l,u=o[M],g=o[ZM(M,c,o)];r?(i.moveTo(u.x,u.y),r=!1):(i.lineTo(u.x,t),i.lineTo(u.x,u.y)),a=!!e.pathSegment(i,l,{move:a}),a?i.closePath():i.lineTo(g.x,t)}i.lineTo(e.first().x,t),i.closePath(),i.clip()}function rj(i,e){const{line:t,target:n,property:o,color:r,scale:a}=e,l=X1(t,n,o);for(const{source:M,target:c,start:u,end:g}of l){const{style:{backgroundColor:d=r}={}}=M,y=n!==!0;i.save(),i.fillStyle=d,jb(i,a,y&&RM(o,u,g)),i.beginPath();const j=!!t.pathSegment(i,M);let D;if(y){j?i.closePath():aj(i,n,g,o);const I=!!n.pathSegment(i,c,{move:j,reverse:!0});D=j&&I,D||aj(i,n,u,o)}i.closePath(),i.fill(D?"evenodd":"nonzero"),i.restore()}}function jb(i,e,t){const{top:n,bottom:o}=e.chart.chartArea,{property:r,start:a,end:l}=t||{};r==="x"&&(i.beginPath(),i.rect(a,n,l-a,o-n),i.clip())}function aj(i,e,t,n){const o=e.interpolate(t,n);o&&i.lineTo(o.x,o.y)}var yb={id:"filler",afterDatasetsUpdate(i,e,t){const n=(i.data.datasets||[]).length,o=[];let r,a,l,M;for(a=0;a<n;++a)r=i.getDatasetMeta(a),l=r.dataset,M=null,l&&l.options&&l instanceof xi&&(M={visible:i.isDatasetVisible(a),index:a,fill:eb(l,a,n),chart:i,axis:r.controller.options.indexAxis,scale:r.vScale,line:l}),r.$filler=M,o.push(M);for(a=0;a<n;++a)M=o[a],!(!M||M.fill===!1)&&(M.fill=q1(o,a,t.propagate))},beforeDraw(i,e,t){const n=t.drawTime==="beforeDraw",o=i.getSortedVisibleDatasetMetas(),r=i.chartArea;for(let a=o.length-1;a>=0;--a){const l=o[a].$filler;l&&(l.line.updateControlPoints(r,l.axis),n&&l.fill&&VM(i.ctx,l,r))}},beforeDatasetsDraw(i,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let o=n.length-1;o>=0;--o){const r=n[o].$filler;ij(r)&&VM(i.ctx,r,i.chartArea)}},beforeDatasetDraw(i,e,t){const n=e.meta.$filler;!ij(n)||t.drawTime!=="beforeDatasetDraw"||VM(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};class sj extends qi{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,t){const n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;const o=Se(n.text)?n.text.length:1;this._padding=At(n.padding);const r=o*ut(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:t,left:n,bottom:o,right:r,options:a}=this,l=a.align;let M=0,c,u,g;return this.isHorizontal()?(u=qn(l,n,r),g=t+e,c=r-n):(a.position==="left"?(u=n+e,g=qn(l,o,t),M=Xe*-.5):(u=r-e,g=qn(l,t,o),M=Xe*.5),c=o-t),{titleX:u,titleY:g,maxWidth:c,rotation:M}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=ut(t.font),r=n.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:M,rotation:c}=this._drawArgs(r);io(e,t.text,0,0,n,{color:t.color,maxWidth:M,rotation:c,textAlign:_d(t.align),textBaseline:"middle",translation:[a,l]})}}function Ib(i,e){const t=new sj({ctx:i.ctx,options:e,chart:i});Ti.configure(i,t,e),Ti.addBox(i,t),i.titleBlock=t}var hb={id:"title",_element:sj,start(i,e,t){Ib(i,t)},stop(i){const e=i.titleBlock;Ti.removeBox(i,e),delete i.titleBlock},beforeUpdate(i,e,t){const n=i.titleBlock;Ti.configure(i,n,t),n.options=t},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 go={average(i){if(!i.length)return!1;let e,t,n=new Set,o=0,r=0;for(e=0,t=i.length;e<t;++e){const l=i[e].element;if(l&&l.hasValue()){const M=l.tooltipPosition();n.add(M.x),o+=M.y,++r}}return{x:[...n].reduce((l,M)=>l+M)/n.size,y:o/r}},nearest(i,e){if(!i.length)return!1;let t=e.x,n=e.y,o=Number.POSITIVE_INFINITY,r,a,l;for(r=0,a=i.length;r<a;++r){const M=i[r].element;if(M&&M.hasValue()){const c=M.getCenterPoint(),u=NM(e,c);u<o&&(o=u,l=M)}}if(l){const M=l.tooltipPosition();t=M.x,n=M.y}return{x:t,y:n}}};function Xt(i,e){return e&&(Se(e)?Array.prototype.push.apply(i,e):i.push(e)),i}function Mi(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
18
18
  `)>-1?i.split(`
19
- `):i}function Db(i,e){const{element:t,datasetIndex:n,index:o}=e,r=i.getDatasetMeta(n).controller,{label:a,value:l}=r.getLabelAndValue(o);return{chart:i,label:a,parsed:r.getParsed(o),raw:i.data.datasets[n].data[o],formattedValue:l,dataset:r.getDataset(),dataIndex:o,datasetIndex:n,element:t}}function lj(i,e){const t=i.chart.ctx,{body:n,footer:o,title:r}=i,{boxWidth:a,boxHeight:l}=e,M=ut(e.bodyFont),c=ut(e.titleFont),u=ut(e.footerFont),g=r.length,d=o.length,y=n.length,j=At(e.padding);let D=j.height,I=0,N=n.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(N+=i.beforeBody.length+i.afterBody.length,g&&(D+=g*c.lineHeight+(g-1)*e.titleSpacing+e.titleMarginBottom),N){const C=e.displayColors?Math.max(l,M.lineHeight):M.lineHeight;D+=y*C+(N-y)*M.lineHeight+(N-1)*e.bodySpacing}d&&(D+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let m=0;const b=function(C){I=Math.max(I,t.measureText(C).width+m)};return t.save(),t.font=c.string,Oe(i.title,b),t.font=M.string,Oe(i.beforeBody.concat(i.afterBody),b),m=e.displayColors?a+2+e.boxPadding:0,Oe(n,C=>{Oe(C.before,b),Oe(C.lines,b),Oe(C.after,b)}),m=0,t.font=u.string,Oe(i.footer,b),t.restore(),I+=j.width,{width:I,height:D}}function fb(i,e){const{y:t,height:n}=e;return t<n/2?"top":t>i.height-n/2?"bottom":"center"}function pb(i,e,t,n){const{x:o,width:r}=n,a=t.caretSize+t.caretPadding;if(i==="left"&&o+r+a>e.width||i==="right"&&o-r-a<0)return!0}function zb(i,e,t,n){const{x:o,width:r}=t,{width:a,chartArea:{left:l,right:M}}=i;let c="center";return n==="center"?c=o<=(l+M)/2?"left":"right":o<=r/2?c="left":o>=a-r/2&&(c="right"),pb(c,i,e,t)&&(c="center"),c}function Mj(i,e,t){const n=t.yAlign||e.yAlign||fb(i,t);return{xAlign:t.xAlign||e.xAlign||zb(i,e,t,n),yAlign:n}}function mb(i,e){let{x:t,width:n}=i;return e==="right"?t-=n:e==="center"&&(t-=n/2),t}function Ab(i,e,t){let{y:n,height:o}=i;return e==="top"?n+=t:e==="bottom"?n-=o+t:n-=o/2,n}function cj(i,e,t,n){const{caretSize:o,caretPadding:r,cornerRadius:a}=i,{xAlign:l,yAlign:M}=t,c=o+r,{topLeft:u,topRight:g,bottomLeft:d,bottomRight:y}=fn(a);let j=mb(e,l);const D=Ab(e,M,c);return M==="center"?l==="left"?j+=c:l==="right"&&(j-=c):l==="left"?j-=Math.max(u,d)+o:l==="right"&&(j+=Math.max(g,y)+o),{x:mt(j,0,n.width-e.width),y:mt(D,0,n.height-e.height)}}function Ba(i,e,t){const n=At(t.padding);return e==="center"?i.x+i.width/2:e==="right"?i.x+i.width-n.right:i.x+n.left}function uj(i){return Xt([],Mi(i))}function Tb(i,e,t){return Ai(i,{tooltip:e,tooltipItems:t,type:"tooltip"})}function gj(i,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?i.override(t):i}const dj={beforeTitle:ai,title(i){if(i.length>0){const e=i[0],t=e.chart.data.labels,n=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return t[e.dataIndex]}return""},afterTitle:ai,beforeBody:ai,beforeLabel:ai,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let e=i.dataset.label||"";e&&(e+=": ");const t=i.formattedValue;return be(t)||(e+=t),e},labelColor(i){const t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:ai,afterBody:ai,beforeFooter:ai,footer:ai,afterFooter:ai};function dt(i,e,t,n){const o=i[e].call(t,n);return typeof o>"u"?dj[e].call(t,n):o}let Nj=(Zc=class extends qi{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 t=this.chart,n=this.options.setContext(this.getContext()),o=n.enabled&&t.options.animation&&n.animations,r=new cN(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Tb(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:n}=t,o=dt(n,"beforeTitle",this,e),r=dt(n,"title",this,e),a=dt(n,"afterTitle",this,e);let l=[];return l=Xt(l,Mi(o)),l=Xt(l,Mi(r)),l=Xt(l,Mi(a)),l}getBeforeBody(e,t){return uj(dt(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:n}=t,o=[];return Oe(e,r=>{const a={before:[],lines:[],after:[]},l=gj(n,r);Xt(a.before,Mi(dt(l,"beforeLabel",this,r))),Xt(a.lines,dt(l,"label",this,r)),Xt(a.after,Mi(dt(l,"afterLabel",this,r))),o.push(a)}),o}getAfterBody(e,t){return uj(dt(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:n}=t,o=dt(n,"beforeFooter",this,e),r=dt(n,"footer",this,e),a=dt(n,"afterFooter",this,e);let l=[];return l=Xt(l,Mi(o)),l=Xt(l,Mi(r)),l=Xt(l,Mi(a)),l}_createItems(e){const t=this._active,n=this.chart.data,o=[],r=[],a=[];let l=[],M,c;for(M=0,c=t.length;M<c;++M)l.push(Db(this.chart,t[M]));return e.filter&&(l=l.filter((u,g,d)=>e.filter(u,g,d,n))),e.itemSort&&(l=l.sort((u,g)=>e.itemSort(u,g,n))),Oe(l,u=>{const g=gj(e.callbacks,u);o.push(dt(g,"labelColor",this,u)),r.push(dt(g,"labelPointStyle",this,u)),a.push(dt(g,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=l,l}update(e,t){const n=this.options.setContext(this.getContext()),o=this._active;let r,a=[];if(!o.length)this.opacity!==0&&(r={opacity:0});else{const l=go[n.position].call(this,o,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const M=this._size=lj(this,n),c=Object.assign({},l,M),u=Mj(this.chart,n,c),g=cj(n,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:g.x,y:g.y,width:M.width,height:M.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,o){const r=this.getCaretPosition(e,n,o);t.lineTo(r.x1,r.y1),t.lineTo(r.x2,r.y2),t.lineTo(r.x3,r.y3)}getCaretPosition(e,t,n){const{xAlign:o,yAlign:r}=this,{caretSize:a,cornerRadius:l}=n,{topLeft:M,topRight:c,bottomLeft:u,bottomRight:g}=fn(l),{x:d,y}=e,{width:j,height:D}=t;let I,N,m,b,C,E;return r==="center"?(C=y+D/2,o==="left"?(I=d,N=I-a,b=C+a,E=C-a):(I=d+j,N=I+a,b=C-a,E=C+a),m=I):(o==="left"?N=d+Math.max(M,u)+a:o==="right"?N=d+j-Math.max(c,g)-a:N=this.caretX,r==="top"?(b=y,C=b-a,I=N-a,m=N+a):(b=y+D,C=b+a,I=N+a,m=N-a),E=b),{x1:I,x2:N,x3:m,y1:b,y2:C,y3:E}}drawTitle(e,t,n){const o=this.title,r=o.length;let a,l,M;if(r){const c=bM(n.rtl,this.x,this.width);for(e.x=Ba(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline="middle",a=ut(n.titleFont),l=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,M=0;M<r;++M)t.fillText(o[M],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,M+1===r&&(e.y+=n.titleMarginBottom-l)}}_drawColorBox(e,t,n,o,r){const a=this.labelColors[n],l=this.labelPointStyles[n],{boxHeight:M,boxWidth:c}=r,u=ut(r.bodyFont),g=Ba(this,"left",r),d=o.x(g),y=M<u.lineHeight?(u.lineHeight-M)/2:0,j=t.y+y;if(r.usePointStyle){const D={radius:Math.min(c,M)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},I=o.leftForLtr(d,c)+c/2,N=j+M/2;e.strokeStyle=r.multiKeyBackground,e.fillStyle=r.multiKeyBackground,pM(e,D,I,N),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,pM(e,D,I,N)}else{e.lineWidth=pe(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const D=o.leftForLtr(d,c),I=o.leftForLtr(o.xPlus(d,1),c-2),N=fn(a.borderRadius);Object.values(N).some(m=>m!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,za(e,{x:D,y:j,w:c,h:M,radius:N}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),za(e,{x:I,y:j+1,w:c-2,h:M-2,radius:N}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(D,j,c,M),e.strokeRect(D,j,c,M),e.fillStyle=a.backgroundColor,e.fillRect(I,j+1,c-2,M-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){const{body:o}=this,{bodySpacing:r,bodyAlign:a,displayColors:l,boxHeight:M,boxWidth:c,boxPadding:u}=n,g=ut(n.bodyFont);let d=g.lineHeight,y=0;const j=bM(n.rtl,this.x,this.width),D=function(f){t.fillText(f,j.x(e.x+y),e.y+d/2),e.y+=d+r},I=j.textAlign(a);let N,m,b,C,E,A,O;for(t.textAlign=a,t.textBaseline="middle",t.font=g.string,e.x=Ba(this,I,n),t.fillStyle=n.bodyColor,Oe(this.beforeBody,D),y=l&&I!=="right"?a==="center"?c/2+u:c+2+u:0,C=0,A=o.length;C<A;++C){for(N=o[C],m=this.labelTextColors[C],t.fillStyle=m,Oe(N.before,D),b=N.lines,l&&b.length&&(this._drawColorBox(t,e,C,j,n),d=Math.max(g.lineHeight,M)),E=0,O=b.length;E<O;++E)D(b[E]),d=g.lineHeight;Oe(N.after,D)}y=0,d=g.lineHeight,Oe(this.afterBody,D),e.y-=r}drawFooter(e,t,n){const o=this.footer,r=o.length;let a,l;if(r){const M=bM(n.rtl,this.x,this.width);for(e.x=Ba(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=M.textAlign(n.footerAlign),t.textBaseline="middle",a=ut(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,l=0;l<r;++l)t.fillText(o[l],M.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,o){const{xAlign:r,yAlign:a}=this,{x:l,y:M}=e,{width:c,height:u}=n,{topLeft:g,topRight:d,bottomLeft:y,bottomRight:j}=fn(o.cornerRadius);t.fillStyle=o.backgroundColor,t.strokeStyle=o.borderColor,t.lineWidth=o.borderWidth,t.beginPath(),t.moveTo(l+g,M),a==="top"&&this.drawCaret(e,t,n,o),t.lineTo(l+c-d,M),t.quadraticCurveTo(l+c,M,l+c,M+d),a==="center"&&r==="right"&&this.drawCaret(e,t,n,o),t.lineTo(l+c,M+u-j),t.quadraticCurveTo(l+c,M+u,l+c-j,M+u),a==="bottom"&&this.drawCaret(e,t,n,o),t.lineTo(l+y,M+u),t.quadraticCurveTo(l,M+u,l,M+u-y),a==="center"&&r==="left"&&this.drawCaret(e,t,n,o),t.lineTo(l,M+g),t.quadraticCurveTo(l,M,l+g,M),t.closePath(),t.fill(),o.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,n=this.$animations,o=n&&n.x,r=n&&n.y;if(o||r){const a=go[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=lj(this,e),M=Object.assign({},a,this._size),c=Mj(t,e,M),u=cj(e,M,c,t);(o._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(t);const o={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=At(t.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&l&&(e.save(),e.globalAlpha=n,this.drawBackground(r,e,o,t),$L(e,t.textDirection),r.y+=a.top,this.drawTitle(r,e,t),this.drawBody(r,e,t),this.drawFooter(r,e,t),JL(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const n=this._active,o=e.map(({datasetIndex:l,index:M})=>{const c=this.chart.getDatasetMeta(l);if(!c)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:c.data[M],index:M}}),r=!ja(n,o),a=this._positionChanged(o,t);(r||a)&&(this._active=o,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,r=this._active||[],a=this._getActiveElements(e,r,t,n),l=this._positionChanged(a,e),M=t||!ja(a,r)||l;return M&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),M}_getActiveElements(e,t,n,o){const r=this.options;if(e.type==="mouseout")return[];if(!o)return t.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,r.mode,r,n);return r.reverse&&a.reverse(),a}_positionChanged(e,t){const{caretX:n,caretY:o,options:r}=this,a=go[r.position].call(this,e,t);return a!==!1&&(n!==a.x||o!==a.y)}},ae(Zc,"positioners",go),Zc);var jj={id:"tooltip",_element:Nj,positioners:go,afterInit(i,e,t){t&&(i.tooltip=new Nj({chart:i,options:t}))},beforeUpdate(i,e,t){i.tooltip&&i.tooltip.initialize(t)},reset(i,e,t){i.tooltip&&i.tooltip.initialize(t)},afterDraw(i){const e=i.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(i.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",t)}},afterEvent(i,e){if(i.tooltip){const t=e.replay;i.tooltip.handleEvent(e.event,t,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:(i,e)=>e.bodyFont.size,boxWidth:(i,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:dj},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const xb=(i,e,t,n)=>(typeof e=="string"?(t=i.push(e)-1,n.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function Lb(i,e,t,n){const o=i.indexOf(e);if(o===-1)return xb(i,e,t,n);const r=i.lastIndexOf(e);return o!==r?t:o}const Eb=(i,e)=>i===null?null:mt(Math.round(i),0,e);function yj(i){const e=this.getLabels();return i>=0&&i<e.length?e[i]:i}class Pa extends en{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const n=this.getLabels();for(const{index:o,label:r}of t)n[o]===r&&n.splice(o,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(be(e))return null;const n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:Lb(n,e,xe(t,e),this._addedLabels),Eb(t,n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(n=0),t||(o=this.getLabels().length-1)),this.min=n,this.max=o}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,o=[];let r=this.getLabels();r=e===0&&t===r.length-1?r:r.slice(e,t+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=e;a<=t;a++)o.push({value:a});return o}getLabelForValue(e){return yj.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 t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}ae(Pa,"id","category"),ae(Pa,"defaults",{ticks:{callback:yj}});function bb(i,e){const t=[],{bounds:o,step:r,min:a,max:l,precision:M,count:c,maxTicks:u,maxDigits:g,includeBounds:d}=i,y=r||1,j=u-1,{min:D,max:I}=e,N=!be(a),m=!be(l),b=!be(c),C=(I-D)/(g+1);let E=Od((I-D)/j/y)*y,A,O,f,z;if(E<1e-14&&!N&&!m)return[{value:D},{value:I}];z=Math.ceil(I/E)-Math.floor(D/E),z>j&&(E=Od(z*E/j/y)*y),be(M)||(A=Math.pow(10,M),E=Math.ceil(E*A)/A),o==="ticks"?(O=Math.floor(D/E)*E,f=Math.ceil(I/E)*E):(O=D,f=I),N&&m&&r&&Gx((l-a)/r,E/1e3)?(z=Math.round(Math.min((l-a)/E,u)),E=(l-a)/z,O=a,f=l):b?(O=N?a:O,f=m?l:f,z=c-1,E=(f-O)/z):(z=(f-O)/E,Xn(z,Math.round(z),E/1e3)?z=Math.round(z):z=Math.ceil(z));const L=Math.max(wd(E),wd(O));A=Math.pow(10,be(M)?L:M),O=Math.round(O*A)/A,f=Math.round(f*A)/A;let p=0;for(N&&(d&&O!==a?(t.push({value:a}),O<a&&p++,Xn(Math.round((O+p*E)*A)/A,a,Ij(a,C,i))&&p++):O<a&&p++);p<z;++p){const h=Math.round((O+p*E)*A)/A;if(m&&h>l)break;t.push({value:h})}return m&&d&&f!==l?t.length&&Xn(t[t.length-1].value,l,Ij(l,C,i))?t[t.length-1].value=l:t.push({value:l}):(!m||f===l)&&t.push({value:f}),t}function Ij(i,e,{horizontal:t,minRotation:n}){const o=mi(n),r=(t?Math.sin(o):Math.cos(o))||.001,a=.75*e*(""+i).length;return Math.min(e/r,a)}class Ra extends en{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,t){return be(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:o,max:r}=this;const a=M=>o=t?o:M,l=M=>r=n?r:M;if(e){const M=$t(o),c=$t(r);M<0&&c<0?l(0):M>0&&c>0&&a(0)}if(o===r){let M=r===0?1:Math.abs(r*.05);l(r+M),e||a(o-M)}this.min=o,this.max=r}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:n}=e,o;return n?(o=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),t=t||11),t&&(o=Math.min(t,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const o={maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},r=this._range||this,a=bb(o,r);return e.bounds==="ticks"&&Cd(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const o=(n-t)/Math.max(e.length-1,1)/2;t-=o,n+=o}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return hM(e,this.chart.options.locale,this.options.ticks.format)}}class Za extends Ra{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ze(e)?e:0,this.max=Ze(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,n=mi(this.options.ticks.minRotation),o=(e?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,r.lineHeight/o))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}ae(Za,"id","linear"),ae(Za,"defaults",{ticks:{callback:fa.formatters.numeric}});const No=i=>Math.floor(zi(i)),tn=(i,e)=>Math.pow(10,No(i)+e);function hj(i){return i/Math.pow(10,No(i))===1}function Dj(i,e,t){const n=Math.pow(10,t),o=Math.floor(i/n);return Math.ceil(e/n)-o}function Ob(i,e){const t=e-i;let n=No(t);for(;Dj(i,e,n)>10;)n++;for(;Dj(i,e,n)<10;)n--;return Math.min(n,No(i))}function Cb(i,{min:e,max:t}){e=Dt(i.min,e);const n=[],o=No(e);let r=Ob(e,t),a=r<0?Math.pow(10,Math.abs(r)):1;const l=Math.pow(10,r),M=o>r?Math.pow(10,o):0,c=Math.round((e-M)*a)/a,u=Math.floor((e-M)/l/10)*l*10;let g=Math.floor((c-u)/Math.pow(10,r)),d=Dt(i.min,Math.round((M+u+g*Math.pow(10,r))*a)/a);for(;d<t;)n.push({value:d,major:hj(d),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(r++,g=2,a=r>=0?1:a),d=Math.round((M+u+g*Math.pow(10,r))*a)/a;const y=Dt(i.max,d);return n.push({value:y,major:hj(y),significand:g}),n}class fj extends en{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const n=Ra.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return Ze(n)&&n>0?n:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ze(e)?Math.max(0,e):null,this.max=Ze(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Ze(this._userMin)&&(this.min=e===tn(this.min,0)?tn(this.min,-1):tn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let n=this.min,o=this.max;const r=l=>n=e?n:l,a=l=>o=t?o:l;n===o&&(n<=0?(r(1),a(10)):(r(tn(n,-1)),a(tn(o,1)))),n<=0&&r(tn(o,-1)),o<=0&&a(tn(n,1)),this.min=n,this.max=o}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},n=Cb(t,this);return e.bounds==="ticks"&&Cd(n,this,"value"),e.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(e){return e===void 0?"0":hM(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=zi(e),this._valueRange=zi(this.max)-zi(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(zi(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}ae(fj,"id","logarithmic"),ae(fj,"defaults",{ticks:{callback:fa.formatters.logarithmic,major:{enabled:!0}}});function GM(i){const e=i.ticks;if(e.display&&i.display){const t=At(e.backdropPadding);return xe(e.font&&e.font.size,Fe.font.size)+t.height}return 0}function wb(i,e,t){return t=Se(t)?t:[t],{w:cL(i,e.string,t),h:t.length*e.lineHeight}}function pj(i,e,t,n,o){return i===n||i===o?{start:e-t/2,end:e+t/2}:i<n||i>o?{start:e-t,end:e}:{start:e,end:e+t}}function Sb(i){const e={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},t=Object.assign({},e),n=[],o=[],r=i._pointLabels.length,a=i.options.pointLabels,l=a.centerPointLabels?Xe/r:0;for(let M=0;M<r;M++){const c=a.setContext(i.getPointLabelContext(M));o[M]=c.padding;const u=i.getPointPosition(M,i.drawingArea+o[M],l),g=ut(c.font),d=wb(i.ctx,g,i._pointLabels[M]);n[M]=d;const y=zt(i.getIndexAngle(M)+l),j=Math.round(dM(y)),D=pj(j,u.x,d.w,0,180),I=pj(j,u.y,d.h,90,270);kb(t,e,y,D,I)}i.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),i._pointLabelItems=Yb(i,n,o)}function kb(i,e,t,n,o){const r=Math.abs(Math.sin(t)),a=Math.abs(Math.cos(t));let l=0,M=0;n.start<e.l?(l=(e.l-n.start)/r,i.l=Math.min(i.l,e.l-l)):n.end>e.r&&(l=(n.end-e.r)/r,i.r=Math.max(i.r,e.r+l)),o.start<e.t?(M=(e.t-o.start)/a,i.t=Math.min(i.t,e.t-M)):o.end>e.b&&(M=(o.end-e.b)/a,i.b=Math.max(i.b,e.b+M))}function vb(i,e,t){const n=i.drawingArea,{extra:o,additionalAngle:r,padding:a,size:l}=t,M=i.getPointPosition(e,n+o+a,r),c=Math.round(dM(zt(M.angle+pt))),u=Bb(M.y,l.h,c),g=Ub(c),d=_b(M.x,l.w,g);return{visible:!0,x:M.x,y:u,textAlign:g,left:d,top:u,right:d+l.w,bottom:u+l.h}}function Qb(i,e){if(!e)return!0;const{left:t,top:n,right:o,bottom:r}=i;return!(si({x:t,y:n},e)||si({x:t,y:r},e)||si({x:o,y:n},e)||si({x:o,y:r},e))}function Yb(i,e,t){const n=[],o=i._pointLabels.length,r=i.options,{centerPointLabels:a,display:l}=r.pointLabels,M={extra:GM(r)/2,additionalAngle:a?Xe/o:0};let c;for(let u=0;u<o;u++){M.padding=t[u],M.size=e[u];const g=vb(i,u,M);n.push(g),l==="auto"&&(g.visible=Qb(g,c),g.visible&&(c=g))}return n}function Ub(i){return i===0||i===180?"center":i<180?"left":"right"}function _b(i,e,t){return t==="right"?i-=e:t==="center"&&(i-=e/2),i}function Bb(i,e,t){return t===90||t===270?i-=e/2:(t>270||t<90)&&(i-=e),i}function Pb(i,e,t){const{left:n,top:o,right:r,bottom:a}=t,{backdropColor:l}=e;if(!be(l)){const M=fn(e.borderRadius),c=At(e.backdropPadding);i.fillStyle=l;const u=n-c.left,g=o-c.top,d=r-n+c.width,y=a-o+c.height;Object.values(M).some(j=>j!==0)?(i.beginPath(),za(i,{x:u,y:g,w:d,h:y,radius:M}),i.fill()):i.fillRect(u,g,d,y)}}function Rb(i,e){const{ctx:t,options:{pointLabels:n}}=i;for(let o=e-1;o>=0;o--){const r=i._pointLabelItems[o];if(!r.visible)continue;const a=n.setContext(i.getPointLabelContext(o));Pb(t,a,r);const l=ut(a.font),{x:M,y:c,textAlign:u}=r;io(t,i._pointLabels[o],M,c+l.lineHeight/2,l,{color:a.color,textAlign:u,textBaseline:"middle"})}}function zj(i,e,t,n){const{ctx:o}=i;if(t)o.arc(i.xCenter,i.yCenter,e,0,ft);else{let r=i.getPointPosition(0,e);o.moveTo(r.x,r.y);for(let a=1;a<n;a++)r=i.getPointPosition(a,e),o.lineTo(r.x,r.y)}}function Zb(i,e,t,n,o){const r=i.ctx,a=e.circular,{color:l,lineWidth:M}=e;!a&&!n||!l||!M||t<0||(r.save(),r.strokeStyle=l,r.lineWidth=M,r.setLineDash(o.dash),r.lineDashOffset=o.dashOffset,r.beginPath(),zj(i,t,a,n),r.closePath(),r.stroke(),r.restore())}function Vb(i,e,t){return Ai(i,{label:t,index:e,type:"pointLabel"})}class Va extends Ra{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=At(GM(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=Ze(e)&&!isNaN(e)?e:0,this.max=Ze(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/GM(this.options))}generateTickLabels(e){Ra.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,n)=>{const o=Ve(this.options.pointLabels.callback,[t,n],this);return o||o===0?o:""}).filter((t,n)=>this.chart.getDataVisibility(n))}fit(){const e=this.options;e.display&&e.pointLabels.display?Sb(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,o){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,o))}getIndexAngle(e){const t=ft/(this._pointLabels.length||1),n=this.options.startAngle||0;return zt(e*t+mi(n))}getDistanceFromCenterForValue(e){if(be(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(be(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const n=t[e];return Vb(this.getContext(),e,n)}}getPointPosition(e,t,n=0){const o=this.getIndexAngle(e)-pt+n;return{x:Math.cos(o)*t+this.xCenter,y:Math.sin(o)*t+this.yCenter,angle:o}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:n,right:o,bottom:r}=this._pointLabelItems[e];return{left:t,top:n,right:o,bottom:r}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const n=this.ctx;n.save(),n.beginPath(),zj(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:n,grid:o,border:r}=t,a=this._pointLabels.length;let l,M,c;if(t.pointLabels.display&&Rb(this,a),o.display&&this.ticks.forEach((u,g)=>{if(g!==0||g===0&&this.min<0){M=this.getDistanceFromCenterForValue(u.value);const d=this.getContext(g),y=o.setContext(d),j=r.setContext(d);Zb(this,y,M,a,j)}}),n.display){for(e.save(),l=a-1;l>=0;l--){const u=n.setContext(this.getPointLabelContext(l)),{color:g,lineWidth:d}=u;!d||!g||(e.lineWidth=d,e.strokeStyle=g,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,M=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),c=this.getPointPosition(l,M),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;const o=this.getIndexAngle(0);let r,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,M)=>{if(M===0&&this.min>=0&&!t.reverse)return;const c=n.setContext(this.getContext(M)),u=ut(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[M].value),c.showLabelBackdrop){e.font=u.string,a=e.measureText(l.label).width,e.fillStyle=c.backdropColor;const g=At(c.backdropPadding);e.fillRect(-a/2-g.left,-r-u.size/2-g.top,a+g.width,u.size+g.height)}io(e,l.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}}ae(Va,"id","radialLinear"),ae(Va,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:fa.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),ae(Va,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ae(Va,"descriptors",{angleLines:{_fallback:"grid"}});const Ga={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}},Nt=Object.keys(Ga);function mj(i,e){return i-e}function Aj(i,e){if(be(e))return null;const t=i._adapter,{parser:n,round:o,isoWeekday:r}=i._parseOpts;let a=e;return typeof n=="function"&&(a=n(a)),Ze(a)||(a=typeof n=="string"?t.parse(a,n):t.parse(a)),a===null?null:(o&&(a=o==="week"&&(Kn(r)||r===!0)?t.startOf(a,"isoWeek",r):t.startOf(a,o)),+a)}function Tj(i,e,t,n){const o=Nt.length;for(let r=Nt.indexOf(i);r<o-1;++r){const a=Ga[Nt[r]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((t-e)/(l*a.size))<=n)return Nt[r]}return Nt[o-1]}function Gb(i,e,t,n,o){for(let r=Nt.length-1;r>=Nt.indexOf(t);r--){const a=Nt[r];if(Ga[a].common&&i._adapter.diff(o,n,a)>=e-1)return a}return Nt[t?Nt.indexOf(t):0]}function Wb(i){for(let e=Nt.indexOf(i)+1,t=Nt.length;e<t;++e)if(Ga[Nt[e]].common)return Nt[e]}function xj(i,e,t){if(!t)i[e]=!0;else if(t.length){const{lo:n,hi:o}=jM(t,e),r=t[n]>=e?t[n]:t[o];i[r]=!0}}function Hb(i,e,t,n){const o=i._adapter,r=+o.startOf(e[0].value,n),a=e[e.length-1].value;let l,M;for(l=r;l<=a;l=+o.add(l,1,n))M=t[l],M>=0&&(e[M].major=!0);return e}function Lj(i,e,t){const n=[],o={},r=e.length;let a,l;for(a=0;a<r;++a)l=e[a],o[l]=a,n.push({value:l,major:!1});return r===0||!t?n:Hb(i,n,o,t)}class Wa extends en{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,t={}){const n=e.time||(e.time={}),o=this._adapter=new L1._date(e.adapters.date);o.init(t),$n(n.displayFormats,o.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Aj(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,n=e.time.unit||"day";let{min:o,max:r,minDefined:a,maxDefined:l}=this.getUserBounds();function M(c){!a&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!l&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!l)&&(M(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&M(this.getMinMax(!1))),o=Ze(o)&&!isNaN(o)?o:+t.startOf(Date.now(),n),r=Ze(r)&&!isNaN(r)?r:+t.endOf(Date.now(),n)+1,this.min=Math.min(o,r-1),this.max=Math.max(o+1,r)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){const e=this.options,t=e.time,n=e.ticks,o=n.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const r=this.min,a=this.max,l=Jx(o,r,a);return this._unit=t.unit||(n.autoSkip?Tj(t.minUnit,this.min,this.max,this._getLabelCapacity(r)):Gb(this,l.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Wb(this._unit),this.initOffsets(o),e.reverse&&l.reverse(),Lj(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,n=0,o,r;this.options.offset&&e.length&&(o=this.getDecimalForValue(e[0]),e.length===1?t=1-o:t=(this.getDecimalForValue(e[1])-o)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?n=r:n=(r-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;t=mt(t,0,a),n=mt(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){const e=this._adapter,t=this.min,n=this.max,o=this.options,r=o.time,a=r.unit||Tj(r.minUnit,t,n,this._getLabelCapacity(t)),l=xe(o.ticks.stepSize,1),M=a==="week"?r.isoWeekday:!1,c=Kn(M)||M===!0,u={};let g=t,d,y;if(c&&(g=+e.startOf(g,"isoWeek",M)),g=+e.startOf(g,c?"day":a),e.diff(n,t,a)>1e5*l)throw new Error(t+" and "+n+" are too far apart with stepSize of "+l+" "+a);const j=o.ticks.source==="data"&&this.getDataTimestamps();for(d=g,y=0;d<n;d=+e.add(d,l,a),y++)xj(u,d,j);return(d===n||o.bounds==="ticks"||y===1)&&xj(u,d,j),Object.keys(u).sort(mj).map(D=>+D)}getLabelForValue(e){const t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){const o=this.options.time.displayFormats,r=this._unit,a=t||o[r];return this._adapter.format(e,a)}_tickFormatFunction(e,t,n,o){const r=this.options,a=r.ticks.callback;if(a)return Ve(a,[e,t,n],this);const l=r.time.displayFormats,M=this._unit,c=this._majorUnit,u=M&&l[M],g=c&&l[c],d=n[t],y=c&&g&&d&&d.major;return this._adapter.format(e,o||(y?g:u))}generateTickLabels(e){let t,n,o;for(t=0,n=e.length;t<n;++t)o=e[t],o.label=this._tickFormatFunction(o.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,n=this.ctx.measureText(e).width,o=mi(this.isHorizontal()?t.maxRotation:t.minRotation),r=Math.cos(o),a=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:n*r+l*a,h:n*a+l*r}}_getLabelCapacity(e){const t=this.options.time,n=t.displayFormats,o=n[t.unit]||n.millisecond,r=this._tickFormatFunction(e,0,Lj(this,[e],this._majorUnit),o),a=this._getLabelSize(r),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(t=0,n=o.length;t<n;++t)e=e.concat(o[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,n;if(e.length)return e;const o=this.getLabels();for(t=0,n=o.length;t<n;++t)e.push(Aj(this,o[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Qd(e.sort(mj))}}ae(Wa,"id","time"),ae(Wa,"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 Ha(i,e,t){let n=0,o=i.length-1,r,a,l,M;t?(e>=i[n].pos&&e<=i[o].pos&&({lo:n,hi:o}=Wi(i,"pos",e)),{pos:r,time:l}=i[n],{pos:a,time:M}=i[o]):(e>=i[n].time&&e<=i[o].time&&({lo:n,hi:o}=Wi(i,"time",e)),{time:r,pos:l}=i[n],{time:a,pos:M}=i[o]);const c=a-r;return c?l+(M-l)*(e-r)/c:l}class Ej extends Wa{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Ha(t,this.min),this._tableRange=Ha(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,o=[],r=[];let a,l,M,c,u;for(a=0,l=e.length;a<l;++a)c=e[a],c>=t&&c<=n&&o.push(c);if(o.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,l=o.length;a<l;++a)u=o[a+1],M=o[a-1],c=o[a],Math.round((u+M)/2)!==c&&r.push({time:c,pos:a/(l-1)});return r}_generate(){const e=this.min,t=this.max;let n=super.getDataTimestamps();return(!n.includes(e)||!n.length)&&n.splice(0,0,e),(!n.includes(t)||n.length===1)&&n.push(t),n.sort((o,r)=>o-r)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),n=this.getLabelTimestamps();return t.length&&n.length?e=this.normalize(t.concat(n)):e=t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Ha(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Ha(this._table,n*this._tableRange+this._minPos,!0)}}ae(Ej,"id","timeseries"),ae(Ej,"defaults",Wa.defaults);const bj={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Fb={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...bj,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},$b=s.version[0]==="2"?(i,e)=>Object.assign(i,{attrs:e}):(i,e)=>Object.assign(i,e);function An(i){return s.isProxy(i)?s.toRaw(i):i}function Jb(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return s.isProxy(e)?new Proxy(i,{}):i}function Xb(i,e){const t=i.options;t&&e&&Object.assign(t,e)}function Oj(i,e){i.labels=e}function Cj(i,e,t){const n=[];i.datasets=e.map(o=>{const r=i.datasets.find(a=>a[t]===o[t]);return!r||!o.data||n.includes(r)?{...o}:(n.push(r),Object.assign(r,o),r)})}function Kb(i,e){const t={labels:[],datasets:[]};return Oj(t,i.labels),Cj(t,i.datasets,e),t}const qb=s.defineComponent({props:Fb,setup(i,e){let{expose:t,slots:n}=e;const o=s.ref(null),r=s.shallowRef(null);t({chart:r});const a=()=>{if(!o.value)return;const{type:c,data:u,options:g,plugins:d,datasetIdKey:y}=i,j=Kb(u,y),D=Jb(j,u);r.value=new uo(o.value,{type:c,data:D,options:{...g},plugins:d})},l=()=>{const c=s.toRaw(r.value);c&&(i.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},i.destroyDelay):(c.destroy(),r.value=null))},M=c=>{c.update(i.updateMode)};return s.onMounted(a),s.onUnmounted(l),s.watch([()=>i.options,()=>i.data],(c,u)=>{let[g,d]=c,[y,j]=u;const D=s.toRaw(r.value);if(!D)return;let I=!1;if(g){const N=An(g),m=An(y);N&&N!==m&&(Xb(D,N),I=!0)}if(d){const N=An(d.labels),m=An(j.labels),b=An(d.datasets),C=An(j.datasets);N!==m&&(Oj(D.config.data,N),I=!0),b&&b!==C&&(Cj(D.config.data,b,i.datasetIdKey),I=!0)}I&&s.nextTick(()=>{M(D)})},{deep:!0}),()=>s.h("canvas",{role:"img",ariaLabel:i.ariaLabel,ariaDescribedby:i.ariaDescribedby,ref:o},[s.h("p",{},[n.default?n.default():""])])}});function wj(i,e){return uo.register(e),s.defineComponent({props:bj,setup(t,n){let{expose:o}=n;const r=s.shallowRef(null),a=l=>{r.value=l==null?void 0:l.chart};return o({chart:r}),()=>s.h(qb,$b({ref:a},{type:i,...t}))}})}const eO=wj("bar",Ea),tO=wj("line",ba),A3="",iO={name:"MultiRangeSlider",props:{baseClassName:{type:String,default:"multi-range-slider"},min:{type:Number},max:{type:Number},minValue:{type:Number},maxValue:{type:Number},step:{type:Number,default:1},preventWheel:{type:Boolean,default:!1},ruler:{type:Boolean,default:!0},label:{type:Boolean,default:!0},labels:{type:Array},minCaption:{type:String},maxCaption:{type:String},rangeMargin:{type:Number}},data(){let i=this.labels||[],e=this.min===void 0?0:this.min,t=i.length?i.length-1:100,n=this.max===void 0?t:this.max,o=this.minValue===void 0?25:this.minValue;i.length&&this.minValue===void 0&&(o=1);let r=this.maxValue||75;if(i.length&&this.maxValue===void 0&&(r=i.length-2),n<=e)throw new Error("Invalid props min or max");if(o>r)throw new Error("Invalid props minValue or maxValue");let a=this.rangeMargin===void 0?this.step:this.rangeMargin,l=a%this.step;return l&&(a=a+this.step-l),{valueMin:o<e?e:o,valueMax:r>n?n:r,interVal:null,startX:null,mouseMoveCounter:null,barBox:null,barValue:0,rangeMarginValue:a}},methods:{onBarLeftClick(){this.valueMin-this.step>=this.minimum?this.valueMin-=this.step:this.valueMin=this.minimum},onInnerBarLeftClick(){this.valueMin+this.rangeMarginValue<this.valueMax&&(this.valueMin+=this.step)},onBarRightClick(){this.valueMax+this.step<=this.maximum?this.valueMax+=this.step:this.valueMax=this.maximum},onInnerBarRightClick(){this.valueMax-this.rangeMarginValue>this.valueMin&&(this.valueMax-=this.step)},onInputMinChange(i){let e=parseFloat(i.target.value);e<=this.valueMax-this.rangeMarginValue&&e>=this.minimum?this.valueMin=e:i.target.value=this.valueMin},onInputMaxChange(i){let e=parseFloat(i.target.value);e>=this.valueMin+this.rangeMarginValue&&e<=this.maximum?this.valueMax=e:i.target.value=this.valueMax},onLeftThumbMousedown(i){if(i.preventDefault(),this.startX=i.clientX,i.type==="touchstart")if(i.touches.length===1)this.startX=i.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMin,this.barBox=i.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onLeftThumbMousemove),document.addEventListener("mouseup",this.onLeftThumbMouseup),document.addEventListener("touchmove",this.onLeftThumbMousemove),document.addEventListener("touchend",this.onLeftThumbMouseup)},onLeftThumbMousemove(i){this.mouseMoveCounter++;let e=i.clientX;i.type==="touchmove"&&(e=i.touches[0].clientX);let n=(e-this.startX)/this.barBox.width,o=this.barValue+(this.maximum-this.minimum)*n,r=o%this.step;o-=r,o<this.minimum?o=this.minimum:o>this.valueMax-this.rangeMarginValue&&(o=this.valueMax-this.rangeMarginValue),this.valueMin=o},onLeftThumbMouseup(){document.removeEventListener("mousemove",this.onLeftThumbMousemove),document.removeEventListener("mouseup",this.onLeftThumbMouseup),document.removeEventListener("touchmove",this.onLeftThumbMousemove),document.removeEventListener("touchend",this.onLeftThumbMouseup)},onRightThumbMousedown(i){if(i.preventDefault(),this.startX=i.clientX,i.type==="touchstart")if(i.touches.length===1)this.startX=i.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMax,this.barBox=i.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onRightThumbMousemove),document.addEventListener("mouseup",this.onRightThumbMouseup),document.addEventListener("touchmove",this.onRightThumbMousemove),document.addEventListener("touchend",this.onRightThumbMouseup)},onRightThumbMousemove(i){this.mouseMoveCounter++;let e=i.clientX;i.type==="touchmove"&&(e=i.touches[0].clientX);let n=(e-this.startX)/this.barBox.width,o=this.barValue+(this.maximum-this.minimum)*n,r=o%this.step;o-=r,o<this.valueMin+this.rangeMarginValue?o=this.valueMin+this.rangeMarginValue:o>this.maximum&&(o=this.maximum),this.valueMax=o},onRightThumbMouseup(){document.removeEventListener("mousemove",this.onRightThumbMousemove),document.removeEventListener("mouseup",this.onRightThumbMouseup),document.removeEventListener("touchmove",this.onRightThumbMousemove),document.removeEventListener("touchend",this.onRightThumbMouseup)},onMouseWheel(i){if(this.preventWheel===!0||!i.shiftKey&&!i.ctrlKey)return;let e=this.step;i.deltaY<0&&(e=-e),i.shiftKey&&i.ctrlKey?this.valueMin+e>=this.minimum&&this.valueMax+e<=this.maximum&&(this.valueMin=this.valueMin+e,this.valueMax=this.valueMax+e):i.ctrlKey?(e=this.valueMax+e,e<this.valueMin+this.rangeMarginValue?e=this.valueMin+this.rangeMarginValue:e>this.maximum&&(e=this.maximum),this.valueMax=e):i.shiftKey&&(e=this.valueMin+e,e<this.minimum?e=this.minimum:e>this.valueMax-this.rangeMarginValue&&(e=this.valueMax-this.rangeMarginValue),this.valueMin=e)},triggerInput(){let i=0;this.step.toString().includes(".")&&(i=2);let e={min:this.minimum,max:this.maximum,minValue:parseFloat(this.valueMin.toFixed(i)),maxValue:parseFloat(this.valueMax.toFixed(i))};this.$emit("input",e)}},computed:{minimum(){return this.min===void 0?0:this.min},maximum(){let i=this.labels||[],e=i.length?i.length-1:100;return this.max===void 0?e:this.max},stepCount(){let i=this.labels||[];return i.length?i.length-1:Math.floor((this.maximum-this.minimum)/this.step)},subStepCount(){return(this.labels||[]).length&&this.step>1?(this.maximum-this.minimum)/this.step:0},barMin(){return(this.valueMin-this.minimum)/(this.maximum-this.minimum)*100},barMax(){return 100-(this.valueMax-this.minimum)/(this.maximum-this.minimum)*100},barMinVal(){let i=0;return this.step.toString().includes(".")&&(i=2),(this.valueMin||0).toFixed(i)},barMaxVal(){let i=0;return this.step.toString().includes(".")&&(i=2),(this.valueMax||100).toFixed(i)},scaleLabels(){let i=this.labels||[];return i.length===0&&(i=[],i.push(this.minimum),i.push(this.maximum)),i}},watch:{valueMin(){this.triggerInput()},valueMax(){this.triggerInput()},minValue(i){this.valueMin=i<this.minimum?this.minimum:i},maxValue(i){this.valueMax=i>this.maximum?this.maximum:i}},mounted(){}},nO={class:"bar"},oO=["min","max","step","value"],rO={class:"caption"},aO={class:"min-caption"},sO={class:"bar-inner"},lO=["min","max","step","value"],MO={class:"caption"},cO={class:"max-caption"},uO={key:0,class:"ruler"},gO={key:1,class:"sub-ruler"},dO={key:2,class:"labels"};function NO(i,e,t,n,o,r){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([t.baseClassName,o.rangeMarginValue===0?"zero-ranage-margin":""]),onMousewheel:e[10]||(e[10]=s.withModifiers((...a)=>r.onMouseWheel&&r.onMouseWheel(...a),["prevent","stop"]))},[s.createElementVNode("div",nO,[s.createElementVNode("div",{class:"bar-left",style:s.normalizeStyle({width:r.barMin+"%"}),onClick:e[0]||(e[0]=(...a)=>r.onBarLeftClick&&r.onBarLeftClick(...a))},null,4),s.createElementVNode("input",{class:"input-type-range input-type-range-min",type:"range",min:r.minimum,max:r.maximum,step:t.step,value:o.valueMin,onInput:e[1]||(e[1]=s.withModifiers((...a)=>r.onInputMinChange&&r.onInputMinChange(...a),["stop","prevent"]))},null,40,oO),s.createElementVNode("div",{class:"thumb thumb-left",onMousedown:e[2]||(e[2]=(...a)=>r.onLeftThumbMousedown&&r.onLeftThumbMousedown(...a)),onTouchstart:e[3]||(e[3]=(...a)=>r.onLeftThumbMousedown&&r.onLeftThumbMousedown(...a))},[s.createElementVNode("div",rO,[s.createElementVNode("span",aO,s.toDisplayString(t.minCaption||r.barMinVal),1)])],32),s.createElementVNode("div",sO,[s.createElementVNode("div",{class:"bar-inner-left",onClick:e[4]||(e[4]=(...a)=>r.onInnerBarLeftClick&&r.onInnerBarLeftClick(...a))}),s.createElementVNode("div",{class:"bar-inner-right",onClick:e[5]||(e[5]=(...a)=>r.onInnerBarRightClick&&r.onInnerBarRightClick(...a))})]),s.createElementVNode("input",{class:"input-type-range input-type-range-max",type:"range",min:r.minimum,max:r.maximum,step:t.step,value:o.valueMax,onInput:e[6]||(e[6]=s.withModifiers((...a)=>r.onInputMaxChange&&r.onInputMaxChange(...a),["stop","prevent"]))},null,40,lO),s.createElementVNode("div",{class:"thumb thumb-right",onMousedown:e[7]||(e[7]=(...a)=>r.onRightThumbMousedown&&r.onRightThumbMousedown(...a)),onTouchstart:e[8]||(e[8]=(...a)=>r.onRightThumbMousedown&&r.onRightThumbMousedown(...a))},[s.createElementVNode("div",MO,[s.createElementVNode("span",cO,s.toDisplayString(t.maxCaption||r.barMaxVal),1)])],32),s.createElementVNode("div",{class:"bar-right",style:s.normalizeStyle({width:r.barMax+"%"}),onClick:e[9]||(e[9]=(...a)=>r.onBarRightClick&&r.onBarRightClick(...a))},null,4)]),t.ruler?(s.openBlock(),s.createElementBlock("div",uO,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.stepCount,a=>(s.openBlock(),s.createElementBlock("div",{key:a,class:"ruler-rule"}))),128))])):s.createCommentVNode("",!0),r.subStepCount?(s.openBlock(),s.createElementBlock("div",gO,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.subStepCount,a=>(s.openBlock(),s.createElementBlock("div",{key:a,class:"ruler-sub-rule"}))),128))])):s.createCommentVNode("",!0),t.label?(s.openBlock(),s.createElementBlock("div",dO,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.scaleLabels,a=>(s.openBlock(),s.createElementBlock("div",{class:"label",key:a},s.toDisplayString(a),1))),128))])):s.createCommentVNode("",!0)],34)}const jO=He(iO,[["render",NO]]),T3="";uo.register(jj,_a,Pa,Za);const yO=s.defineComponent({components:{Bar:eO,MultiRangeSlider:jO},emits:["update","update:model-value"],props:{numberRange:{type:Array,default:()=>[{key:0,count:10}]},width:{type:Number,default:200},height:{type:Number,default:50},chartId:{type:String,default:"bar-chart"},datasetIdKey:{type:String,default:"label"},includeForm:{type:Boolean,default:!1},isMatch:{type:Boolean,default:!0},isExclude:{type:Boolean,default:!1},isDisable:{type:Boolean,default:!1},modelValue:{type:Object,required:!1,default:null}},data(){return{chartData:{labels:[],datasets:[{labels:"",data:[],backgroundColor:["#5ea9e5"],borderRadius:1,hoverBackgroundColor:"#e0e0e0"}]},chartOptions:{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{display:!1,grid:{display:!1},ticks:{display:!0}},y:{display:!1,grid:{display:!1},ticks:{display:!1}}}},min:0,max:this.numberRange.length-1,validated:!1,activeColor:"#5ea9e5",inactiveColor:"#e0e0e0"}},computed:{getRangeLength(){return this.numberRange.length},getFirstKey(){return this.numberRange[0].key},getLastKey(){return this.numberRange[this.getRangeLength-1].key},getMinKey(){return this.numberRange[this.min].key},getMinCaption(){return`${this.getMinKey}`},getMaxCaption(){return`${this.getMaxKey}`},getMaxKey(){return this.numberRange[this.max].key},getLastIndex(){return this.numberRange.length-1}},watch:{modelValue(i){this.max=this.numberRange.findIndex(e=>e.key==i.maxKey),this.min=this.numberRange.findIndex(e=>e.key==i.minKey)}},mounted(){this.setChartData(this.numberRange),this.isDisable&&this.missingFilter(),this.$props.modelValue&&(this.max=this.numberRange.findIndex(i=>i.key===this.$props.modelValue.maxKey),this.min=this.numberRange.findIndex(i=>i.key===this.$props.modelValue.minKey)),this.triggerChartDataUpdate()},methods:{updateRange(){const i=this.getMinKey,e=this.getMaxKey;this.$props.modelValue&&this.$emit("update:model-value",{minKey:i,maxKey:e}),this.$emit("update",{minKey:i,maxKey:e})},updateBarChart(i){const{minValue:e,maxValue:t}=i;this.min=e,this.max=t,this.isDisable||(this.isExclude?this.excludeFilter():this.matchFilter())},matchFilter(){if(!this.isDisable){var i=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<=i.length;e++)e>=this.min&&e<=this.max?this.chartData.datasets[0].backgroundColor.push(this.activeColor):this.chartData.datasets[0].backgroundColor.push(this.inactiveColor);this.triggerChartDataUpdate()}},excludeFilter(){if(!this.isDisable){var i=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<i.length;e++)e>=this.min&&e<=this.max?this.chartData.datasets[0].backgroundColor.push(this.inactiveColor):this.chartData.datasets[0].backgroundColor.push(this.activeColor);this.triggerChartDataUpdate()}},missingFilter(){this.validated=!this.validated;var i=this.chartData.datasets[0].data;if(this.chartData.datasets[0].backgroundColor=[],this.validated)for(let e=1;e<=i.length;e++)this.chartData.datasets[0].backgroundColor.push(this.inactiveColor);else this.isMatch&&this.matchFilter(),this.isExclude&&this.excludeFilter()},changeMin(i){let e=parseInt(i.target.value);this.min=e||0,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},changeMax(i){let e=parseInt(i.target.value);this.max=e,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},setChartData(i){let e=this.chartData.labels,t=[];for(let n=0;n<i.length;n++)e.push(i[n].key),t.push(i[n].count);this.chartData.datasets[0].data=t},triggerChartDataUpdate(){this.$nextTick(()=>{this.chartData={...this.chartData,datasets:[...this.chartData.datasets]}})}}}),x3="",IO={class:"dh-range-container"},hO={class:"bar-chart"},DO={key:0,class:"input-group-section"},fO={class:"input-group sb-input"},pO=["disabled","max","value"],zO={class:"input-group sb-input"},mO=["disabled","max","min","value"];function AO(i,e,t,n,o,r){const a=s.resolveComponent("Bar"),l=s.resolveComponent("MultiRangeSlider");return s.openBlock(),s.createElementBlock("div",IO,[s.createElementVNode("div",hO,[s.createElementVNode("div",null,[s.createVNode(a,{"chart-id":i.chartId,data:i.chartData,"dataset-id-key":i.datasetIdKey,height:i.height,options:i.chartOptions,width:i.width},null,8,["chart-id","data","dataset-id-key","height","options","width"])]),s.createVNode(l,{"base-class-name":`multi-range-slider range-slider ${i.isDisable}`,label:!1,max:i.getLastIndex,"max-caption":i.getMaxCaption,"max-value":i.max,min:0,"min-caption":i.getMinCaption,"min-value":i.min,"range-margin":0,ruler:!1,step:1,onInput:i.updateBarChart},null,8,["base-class-name","max","max-caption","max-value","min-caption","min-value","onInput"])]),i.includeForm?(s.openBlock(),s.createElementBlock("div",DO,[s.createElementVNode("div",fO,[s.createElementVNode("label",{class:s.normalizeClass(`dh-body-2 input-to ${i.validated?"disable":""}`)}," From ",2),s.createElementVNode("input",{class:"form-input text",disabled:i.validated,max:i.max,min:"1",placeholder:"From",type:"number",value:i.getMinKey,onInput:e[0]||(e[0]=M=>i.changeMin(M))},null,40,pO)]),s.createElementVNode("div",zO,[s.createElementVNode("label",{class:s.normalizeClass(`dh-body-2 input-to ${i.validated?"disable":""}`)}," To ",2),s.createElementVNode("input",{class:"form-input text",disabled:i.validated,max:i.max,min:i.min,placeholder:"To",type:"number",value:i.getMaxKey,onInput:e[1]||(e[1]=M=>i.changeMax(M))},null,40,mO)])])):s.createCommentVNode("",!0),s.renderSlot(i.$slots,"input",{},void 0,!0),s.createElementVNode("button",{class:"btn",onClick:e[2]||(e[2]=M=>i.updateRange())},"Apply")])}const Sj=He(yO,[["render",AO],["__scopeId","data-v-d1698d5f"]]),L3="",E3="",kj=i=>(s.pushScopeId("data-v-3dba4cb5"),i=i(),s.popScopeId(),i),TO={id:"dp-container"},xO=kj(()=>s.createElementVNode("div",{class:"dp__calendar_range"},[s.createElementVNode("p",null,"From"),s.createElementVNode("p",null,"To")],-1)),LO={class:"dp__multi"},EO=["value"],bO=["value"],OO=["onClick"],CO=["onClick"],wO=["onClick"],SO=["onClick"],kO=["onClick"],vO=["onClick"],QO=["onClick"],YO=["onClick"],UO=kj(()=>s.createElementVNode("div",{id:"tags",class:"dp__calendar_tags"},null,-1)),_O=He({__name:"AdvancedDatePicker",props:{numberRange:{type:Array,required:!0}},emits:["update"],setup(i,{emit:e}){const t=s.ref(["",""]),n=s.ref(null),o=s.ref(null),r=s.ref(null),a=s.ref(!1),l=s.ref([{label:"Today",range:[new Date,new Date],slot:"today"},{label:"Previous week",range:[Yg(Qg(new Date)),Qg(new Date)],slot:"previousWeek"},{label:"This week",range:[Yg(new Date),gz(new Date)],slot:"week"},{label:"Next week",range:[Nz(new Date),dz(new Date().setDate(new Date().getDate()+7))],slot:"nextWeek"},{label:"This month",range:[Qo(new Date),vo(new Date)],slot:"currentMonth"},{label:"Previous month",range:[Qo(Et(new Date,1)),vo(Et(new Date,1))],slot:"previousMonth"},{label:"Last 3 months",range:[Qo(Et(new Date,3)),vo(Et(new Date,1))],slot:"threeMonths"},{label:"Last 6 months",range:[Qo(Et(new Date,6)),vo(Et(new Date,1))],slot:"sixMonths"},{label:"Last year",range:[vI(new Date),kI(new Date)],slot:"yearly"}]),M=d=>{t.value=d,console.log(t.value),e("update",t.value)};function c(d){o.value=d.target.value,t.value=[d.target.value,n.value]}function u(d){n.value=d.target.value,t.value=[o.value,d.target.value]}s.onMounted(()=>{r.value.openMenu()});function g(){r.value.openMenu()}return(d,y)=>(s.openBlock(),s.createElementBlock("div",TO,[xO,s.createVNode(s.unref(ua),{ref_key:"datePicker",ref:r,modelValue:t.value,"onUpdate:modelValue":[y[2]||(y[2]=j=>t.value=j),M],"auto-apply":"","day-names":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"enable-time-picker":!1,"model-type":"dd/MM/yyyy","multi-calendars":"","multi-calendars-solo":"","multi-static":!1,offset:12,position:"left","preset-ranges":l.value,range:"","select-text":"Apply","text-input":"",uid:"advanced",onClosed:g},{"dp-input":s.withCtx(()=>[s.createElementVNode("div",LO,[s.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:o.value?o.value:t.value[0],onInput:y[0]||(y[0]=j=>c(j))},null,40,EO),s.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:n.value?n.value:t.value[1],onInput:y[1]||(y[1]=j=>u(j))},null,40,bO)])]),"arrow-left":s.withCtx(()=>[s.createVNode(de,{"icon-name":"previous",size:20})]),"arrow-right":s.withCtx(()=>[s.createVNode(de,{"icon-name":"next",size:20})]),"calendar-icon":s.withCtx(()=>[s.createTextVNode(" Back ")]),"clear-icon":s.withCtx(()=>[]),"action-preview":s.withCtx(()=>[]),"action-select":s.withCtx(()=>[]),previousWeek:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,OO)]))]),week:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,CO)]))]),nextWeek:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,wO)]))]),currentMonth:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,SO)]))]),previousMonth:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,kO)]))]),threeMonths:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,vO)]))]),sixMonths:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,QO)]))]),yearly:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,YO)]))]),_:1},8,["modelValue","preset-ranges"]),s.createVNode(Sj,{class:"dp__calendar_range_number","number-range":i.numberRange,steps:1},{input:s.withCtx(()=>[UO]),filter:s.withCtx(()=>[s.createVNode(hd,{data:a.value,label:"Include time",onChange:y[3]||(y[3]=j=>a.value=j)},null,8,["data"])]),_:1},8,["number-range"])]))}},[["__scopeId","data-v-3dba4cb5"]]),BO=s.defineComponent({components:{DhIcon:de},props:{mainText:{type:String,default:"Advanced"},filterMissingText:{type:String,default:"Filter Missing"},matchText:{type:String,default:"Match"},excludeText:{type:String,default:"Exclude"}},data(){return{activeFilter:!1,isFilterMissing:!1,isMatch:!1,isExclude:!1}},emits:["match","exclude","filter_missing"],mounted(){this.isMatch=!0},methods:{toggleFilter(){this.activeFilter=!this.activeFilter},matchFilter(){this.isMatch=!0,this.isExclude=!1,this.$emit("match",this.isMatch)},excludeFilter(){this.isMatch=!1,this.isExclude=!0,this.$emit("exclude",this.isExclude)},missingFilter(){this.isFilterMissing=!this.isFilterMissing,this.$emit("filter_missing",this.isFilterMissing),this.isFilterMissing&&this.isMatch?this.matchFilter():this.isFilterMissing&&this.isExclude&&this.excludeFilter()}}}),PO={class:"dh-advanced-filter-container"},RO={class:"advance_section"},ZO={key:0},VO={class:"list-none"},GO=["checked"],WO=["checked"],HO=["checked"];function FO(i,e,t,n,o,r){const a=s.resolveComponent("dh-icon");return s.openBlock(),s.createElementBlock("div",PO,[s.createElementVNode("div",RO,[s.createElementVNode("span",{class:"toggle-icon",onClick:e[0]||(e[0]=l=>i.toggleFilter())},[s.createTextVNode(s.toDisplayString(i.mainText)+" ",1),s.createVNode(a,{"icon-name":i.activeFilter?"arrow-up":"arrow-down",size:20},null,8,["icon-name"])]),i.activeFilter?(s.openBlock(),s.createElementBlock("div",ZO,[s.renderSlot(i.$slots,"default"),s.createElementVNode("ul",VO,[s.createElementVNode("li",null,[s.createElementVNode("label",null,[s.createElementVNode("input",{checked:i.isFilterMissing,name:"number_filter",type:"checkbox",onChange:e[1]||(e[1]=l=>i.missingFilter())},null,40,GO),s.createTextVNode(" "+s.toDisplayString(i.filterMissingText),1)])]),s.createElementVNode("li",null,[s.createElementVNode("label",null,[s.createElementVNode("input",{checked:i.isMatch,name:"number_filter",type:"radio",onChange:e[2]||(e[2]=l=>i.matchFilter())},null,40,WO),s.createTextVNode(" "+s.toDisplayString(i.matchText),1)]),s.createElementVNode("label",null,[s.createElementVNode("input",{checked:i.isExclude,name:"number_filter",type:"radio",onChange:e[3]||(e[3]=l=>i.excludeFilter())},null,40,HO),s.createTextVNode(" "+s.toDisplayString(i.excludeText),1)])])])])):s.createCommentVNode("",!0)])])}const $O=He(BO,[["render",FO]]),JO=["disabled"],XO={key:1,class:"prepend-icon"},KO={class:"append-icon"},qO=s.defineComponent({__name:"Button",props:{size:{type:String,required:!1,default:""},color:{type:String,required:!1,default:""},disabled:{type:Boolean,required:!1,default:!1},loading:{type:Boolean,required:!1,default:!1},icon:{type:String,required:!1,default:""}},setup(i){const e=i,t=s.computed(()=>e.size==="large"),n=s.computed(()=>e.size==="small"),o=s.computed(()=>e.color==="primary"),r=s.computed(()=>e.color==="secondary"),a=s.computed(()=>e.color==="danger"),l=s.computed(()=>e.color==="success"),M=s.computed(()=>e.color==="ghost");return(c,u)=>(s.openBlock(),s.createElementBlock("button",{class:s.normalizeClass({"dh-btn":!0,"dh-btn-primary":o.value,"dh-btn-secondary":r.value,"dh-btn-danger":a.value,"dh-btn-success":l.value,"dh-btn-ghost":M.value,"dh-btn-large":t.value,"dh-btn-small":n.value,"dh-btn-icon":i.icon,disabled:i.disabled}),disabled:i.disabled||i.loading},[i.loading?(s.openBlock(),s.createBlock(de,{key:0,class:s.normalizeClass({"loading-spinner":!0,"loading-spinner-danger":a.value,"loading-spinner-success":l.value,"loading-spinner-secondary":r.value||M.value}),"icon-name":"loader"},null,8,["class"])):s.createCommentVNode("",!0),i.loading?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",XO,[s.renderSlot(c.$slots,"prepend-icon",{},void 0,!0)])),i.icon?s.createCommentVNode("",!0):s.renderSlot(c.$slots,"default",{key:2},void 0,!0),i.icon&&!i.loading?(s.openBlock(),s.createBlock(de,{key:3,"icon-name":i.icon,size:24},null,8,["icon-name"])):s.createCommentVNode("",!0),s.createElementVNode("div",KO,[s.renderSlot(c.$slots,"append-icon",{},void 0,!0)])],10,JO))}}),O3="",WM=He(qO,[["__scopeId","data-v-5455ff32"]]),eC=["innerHTML"],tC=s.defineComponent({__name:"Tooltip",props:{trigger:{type:String,required:!1,default:"hover"},placement:{type:String,default:()=>"bottom",required:!1},tooltipText:{type:String,required:!0,default:()=>""},followCursor:{type:Boolean,required:!1,default:!1},offsetX:{type:Number,required:!1,default:0},offsetY:{type:Number,required:!1,default:0}},setup(i){const e=i,t=s.ref(null),n=s.ref(null),o=s.ref(!1),r=s.reactive({x:0,y:0}),a=d=>({x:d.left+window.scrollX,y:d.top+window.scrollY}),l=d=>{!t.value||!n.value||!e.tooltipText||(e.followCursor?c(d):M(),o.value=!0)},M=()=>{const d=t.value.getBoundingClientRect(),y=n.value.getBoundingClientRect();let j=a(d);switch(e.placement){case"bottom":r.x=j.x-y.width/2+d.width/2+e.offsetX,r.y=j.y+d.height+e.offsetY;break;case"top":r.x=j.x-y.width/2+d.width/2+e.offsetX,r.y=j.y-y.height-e.offsetY;break;case"left":r.x=j.x-y.width-e.offsetX,r.y=j.y+d.height/2-y.height/2-e.offsetY;break;case"right":r.x=j.x+d.width+e.offsetX,r.y=j.y+d.height/2-y.height/2-e.offsetY;break}},c=d=>{if(!n.value||!e.followCursor)return;const y=n.value.getBoundingClientRect();let j=d.clientX+window.scrollX,D=d.clientY+window.scrollY;switch(e.placement){case"bottom":r.x=j-y.width/2+e.offsetX,r.y=D+e.offsetY+25;break;case"top":r.x=j-y.width/2+e.offsetX,r.y=D-y.height-e.offsetY-15;break;case"left":r.x=j-y.width-e.offsetX-15,r.y=D-y.height/2+e.offsetY/2;break;case"right":r.x=j+e.offsetX+15,r.y=D-y.height/2+e.offsetY/2;break;default:r.x=j+e.offsetX,r.y=D+e.offsetY}},u=()=>{o.value=!1},g=s.computed(()=>({position:"absolute",left:`${r.x}px`,top:`${r.y}px`,zIndex:1e4}));return(d,y)=>{var j;return s.openBlock(),s.createElementBlock("div",{ref_key:"triggerElement",ref:t,class:"tooltip-wrapper",tabindex:"0",onClick:y[0]||(y[0]=D=>i.trigger==="click"?l(D):null),onFocusin:y[1]||(y[1]=D=>i.trigger==="focus"?l(D):null),onFocusout:y[2]||(y[2]=D=>i.trigger==="focus"?u():null),onMouseenter:y[3]||(y[3]=D=>i.trigger==="hover"?l(D):null),onMouseleave:y[4]||(y[4]=D=>i.trigger!=="focus"?u():null),onMousemove:c},[s.renderSlot(d.$slots,"default",{},void 0,!0),(s.openBlock(),s.createBlock(s.Teleport,{to:"body"},[s.createElementVNode("div",{ref_key:"tooltipElement",ref:n,class:s.normalizeClass(["tooltip",{visible:o.value,left:i.placement==="left",right:i.placement==="right",top:i.placement==="top"}]),innerHTML:(j=i.tooltipText)==null?void 0:j.replace(/\\n/g,"<br>"),style:s.normalizeStyle(g.value)},null,14,eC)]))],544)}}}),C3="",vj=He(tC,[["__scopeId","data-v-fd463e21"]]),w3="",iC={class:"copy__text"},nC=["readonly"],oC={__name:"Copiable",props:{text:{type:String,required:!0},placement:{type:String,default:"bottom"},readonly:{type:Boolean,default:!0}},setup(i){const e=i,t=s.ref(""),n=s.ref("copy text");function o(a){navigator.clipboard.writeText(a),n.value="copied !"}function r(){n.value="copy text"}return s.onMounted(()=>{t.value=e.text}),(a,l)=>(s.openBlock(),s.createElementBlock("span",iC,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=M=>t.value=M),readonly:i.readonly,type:"text",onInput:r},null,40,nC),[[s.vModelText,t.value]]),s.createVNode(vj,{placement:i.placement,target:"tooltiptext","tooltip-text":n.value,trigger:"hover",onClick:l[1]||(l[1]=M=>o(t.value))},{default:s.withCtx(()=>[s.createVNode(de,{class:"copy__text_icon","icon-name":"copy",size:18})]),_:1},8,["placement","tooltip-text"])]))}},S3="",rC=s.createElementVNode("div",null,"today",-1),aC={__name:"DatePicker",props:{inline:{type:Boolean,default:!0},multiCalendars:{type:Boolean,default:!1},multiCalendarsSolo:{type:Boolean,default:!1},range:{type:Boolean,default:!1},enableTimePicker:{type:Boolean,default:!1}},emits:["update"],setup(i,{emit:e}){const t=s.ref(),n=s.ref(null),o=a=>{t.value=a,e("update",t.value)},r=s.ref([{date:ni(new Date,0),type:"dot",tooltip:[{text:"Dot with tooltip",color:"blue"}]}]);return(a,l)=>(s.openBlock(),s.createElementBlock("div",null,[s.createVNode(s.unref(ua),{ref_key:"datePicker",ref:n,modelValue:t.value,"onUpdate:modelValue":[l[0]||(l[0]=M=>t.value=M),o],"day-names":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"enable-time-picker":i.enableTimePicker,format:"MM/dd/yyyy",inline:i.inline,markers:r.value,"month-name-format":"short","multi-calendars":i.multiCalendars,"multi-calendars-solo":i.multiCalendars&i.multiCalendarsSolo,offset:12,placeholder:"MM/DD/YYYY",range:i.range||i.multiCalendars,"select-text":"Apply","text-input":"",uid:"base"},{"arrow-left":s.withCtx(()=>[s.createVNode(de,{"icon-name":"previous",size:20})]),"arrow-right":s.withCtx(()=>[s.createVNode(de,{"icon-name":"next",size:20})]),"calendar-icon":s.withCtx(()=>[s.createTextVNode(" Back ")]),"clear-icon":s.withCtx(()=>[]),"action-preview":s.withCtx(()=>[]),"marker-tooltip":s.withCtx(()=>[rC]),_:1},8,["modelValue","enable-time-picker","inline","markers","multi-calendars","multi-calendars-solo","range"])]))}},sC=["src"],lC={key:3,class:"menu-item-text-wrapper"},MC=s.defineComponent({__name:"DropdownMenuItem",props:{item:{type:Object,required:!0},textEllipsisStyle:{type:String,required:!1,default:"none",validator:i=>["none","ellipsis","fit-content"].includes(i)},iconSize:{type:Number,required:!1,default:24},maxWidth:{type:String,required:!1,default:"15rem"}},setup(i){const e=i;s.useCssVars(o=>({"2c811a7a":i.maxWidth}));const t=s.ref(e.item);function n(){t.value.iconUrl=void 0,t.value.iconName="deskHeroLogo"}return(o,r)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[t.value.iconUrl?(s.openBlock(),s.createElementBlock("img",{key:0,alt:"icon image",class:"icon icon-url",src:t.value.iconUrl,onError:n},null,40,sC)):s.createCommentVNode("",!0),!t.value.iconUrl&&t.value.iconName?(s.openBlock(),s.createBlock(de,s.mergeProps({key:1,class:"icon"},{...t.value,size:e.iconSize}),null,16)):s.createCommentVNode("",!0),t.value.subText?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(["dh-body-2",i.textEllipsisStyle])},s.toDisplayString(t.value.text),3)),t.value.subText?(s.openBlock(),s.createElementBlock("div",lC,[s.createElementVNode("span",{class:s.normalizeClass(["dh-body-1",i.textEllipsisStyle])},s.toDisplayString(t.value.text),3),s.createElementVNode("span",{class:s.normalizeClass(["dh-body-4-medium",i.textEllipsisStyle])},s.toDisplayString(t.value.subText),3)])):s.createCommentVNode("",!0),t.value.isSelected?(s.openBlock(),s.createBlock(de,{key:4,class:"icon-blue icon-accept","icon-name":"accept",size:16})):s.createCommentVNode("",!0)],64))}}),k3="",Qj=He(MC,[["__scopeId","data-v-f6001491"]]),cC=["data-e2e","onClick"],uC=s.defineComponent({__name:"DropdownMenu",props:{items:{type:Object,required:!0},textEllipsisStyle:{type:String,required:!1,default:"none",validator:i=>["none","ellipsis","fit-content"].includes(i)},iconSize:{type:Number,required:!1,default:24},closeOnClickOutside:{type:Boolean,required:!1,default:!0},zIndex:{type:Number,required:!1,default:100},closeOnItemSelected:{type:Boolean,required:!1,default:!0},width:{type:String,required:!1,default:"100%"},minWidth:{type:String,required:!1,default:"10rem"},maxWidth:{type:String,required:!1,default:"15rem"}},emits:["itemSelected","close"],setup(i,{emit:e}){const t=i;s.useCssVars(r=>({"6b3ce24d":i.minWidth,"206ac8ad":i.width})),s.onMounted(()=>{document.addEventListener("click",r=>{n(r)})});function n(r){const a=r.target,l=document.querySelector("[data-id='dropdown-menu']");l&&!l.contains(r.target)&&!a.classList.contains("dropdown-toggle")&&t.closeOnClickOutside&&e("close")}function o(r){e("itemSelected",r),t.closeOnItemSelected&&e("close")}return(r,a)=>{const l=s.resolveComponent("router-link");return s.openBlock(),s.createElementBlock("div",{class:"dropdown-menu","data-id":"dropdown-menu",style:s.normalizeStyle({"z-index":t.zIndex})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.items,M=>(s.openBlock(),s.createElementBlock("div",{key:M.iconName,class:"menu-item","data-e2e":M.dataE2eTag,onClick:c=>o(M)},[M.url?(s.openBlock(),s.createBlock(l,{key:0,class:s.normalizeClass({"center-vertical":!0,disabled:M.disabled}),to:{path:M.url}},{default:s.withCtx(()=>[s.createVNode(Qj,{"icon-size":i.iconSize,item:M,"max-width":i.maxWidth,"text-ellipsis-style":i.textEllipsisStyle},null,8,["icon-size","item","max-width","text-ellipsis-style"])]),_:2},1032,["class","to"])):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass({"center-vertical":!0,disabled:M.disabled})},[s.createVNode(Qj,{"icon-size":i.iconSize,item:M,"max-width":i.maxWidth,"text-ellipsis-style":i.textEllipsisStyle},null,8,["icon-size","item","max-width","text-ellipsis-style"])],2))],8,cC))),128))],4)}}}),v3="",gC=He(uC,[["__scopeId","data-v-4ffac438"]]),dC={key:0,class:"invalid-feedback"},NC=s.defineComponent({__name:"Error",props:{errors:{type:Object,required:!1,default:void 0}},setup(i){const e=i;return(t,n)=>{var o;return s.unref(e).errors&&((o=s.unref(e).errors)==null?void 0:o.length)>0?(s.openBlock(),s.createElementBlock("div",dC,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.errors,r=>(s.openBlock(),s.createElementBlock("span",{key:r},s.toDisplayString(r),1))),128))])):s.createCommentVNode("",!0)}}}),Q3="",jC={class:"dh-body-1-medium"},yC={key:1,class:"wrapper"},IC={class:"dh-body-1-medium"},hC={class:"panel-icon-wrapper"},DC=s.defineComponent({__name:"ExpansionPanel",props:{title:{type:String,default:"Advanced"},isAdvancedSettingsOpen:{type:Boolean,default:!1},type:{type:String,default:"mini"}},setup(i){const e=i,t=s.ref(!1),n=s.ref(null),o=s.ref(0);s.watch(()=>e.isAdvancedSettingsOpen,l=>{t.value!==l&&r()});function r(){if(e.type==="regular"){a();return}t.value=!t.value}function a(){t.value?(o.value=0,setTimeout(()=>{t.value=!1},300)):(t.value=!0,s.nextTick(()=>{n.value&&(o.value=n.value.scrollHeight)}))}return s.onMounted(()=>{t.value!==e.isAdvancedSettingsOpen&&r()}),(l,M)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[e.type==="mini"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("div",{class:s.normalizeClass(["advanced-panel-header clickable",{opened:t.value,closed:!t.value}]),"data-e2e":"expansion-panel-button",onClick:M[0]||(M[0]=c=>r())},[s.createElementVNode("h4",jC,s.toDisplayString(i.title),1),s.createVNode(de,{class:"icon","icon-name":t.value?"arrow-up":"arrow-down",size:24},null,8,["icon-name"])],2),t.value?s.renderSlot(l.$slots,"content",{key:0},()=>[s.createTextVNode(" Content ")],!0):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0),e.type==="regular"?(s.openBlock(),s.createElementBlock("div",yC,[s.createElementVNode("button",{class:"panel-button",onClick:M[1]||(M[1]=c=>r())},[s.createElementVNode("h4",IC,s.toDisplayString(i.title),1),s.createElementVNode("div",hC,[s.createVNode(de,{class:"panel-icon","icon-name":t.value?"minus":"plus",size:24},null,8,["icon-name"])])]),t.value?(s.openBlock(),s.createElementBlock("div",{key:0,ref_key:"contentRef",ref:n,class:"panel",style:s.normalizeStyle({height:o.value>0?o.value+"px":0})},[s.renderSlot(l.$slots,"content",{},void 0,!0)],4)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],64))}}),Y3="",fC=He(DC,[["__scopeId","data-v-b1a45cd3"]]),U3="",pC=s.createElementVNode("label",{for:"upload_pdf"},[s.createTextVNode(" Drag and drop file or "),s.createElementVNode("span",{id:"upload"},"browse")],-1),zC={key:0,class:"file__upload_items"},mC={class:"file__upload_list_item"},AC={class:"file__upload_list_item_label"},TC=["title"],xC=s.createElementVNode("br",null,null,-1),LC=["href"],EC={key:1,class:"file__upload_items"},bC={class:"file__upload_list_item"},OC={class:"file__upload_list_item_label"},CC=["title"],wC={key:0,class:"label__antivirus"},SC={key:1,class:"label__antivirus label__antivirus--failed"},kC={key:2,class:"label__antivirus label__antivirus--detected"},vC=s.createElementVNode("br",null,null,-1),QC={key:3},YC={key:4},UC={key:0},_C=["value"],BC=["href"],PC={key:2,class:"file__upload_placeholder"},RC={key:3,class:"file__upload_action"},ZC=s.createElementVNode("button",{class:"file__upload_action_cancel"},"Cancel",-1),VC={__name:"FileUpload",props:{fileList:{type:Array,required:!1,default:()=>[]},fileFormats:{type:Array,required:!1,default:()=>[".pdf",".csv",".doc",".jpeg",".jpg",".mp4",".png",".txt",".xls"]},uploadProgress:{type:Array,required:!0},errorOccurred:{type:Array,required:!0},virusCheck:{type:Array,required:!0},modelValue:{type:FileList,required:!1,default:void 0},inline:{type:Boolean,required:!1,default:!1},large:{type:Boolean,required:!1,default:!1},errorMessage:{type:String,required:!1,default:"an error occurred while uploading"},fileSaved:{type:Boolean,required:!1,default:!1},virusCheckText:{type:String,required:!1,default:"Antivirus check ..."},virusCheckFailedText:{type:String,required:!1,default:"Antivirus check failed"},virusDetectedText:{type:String,required:!1,default:"Virus detected"},deleteConfirmationText:{type:String,required:!1,default:"Are you sure you want to delete it permanently? this action will be irreversible"},zIndex:{type:Number,required:!1,default:99},fieldIndex:{type:Number,required:!1,default:0}},emits:["update:modelValue","reload"],setup(i,{emit:e}){const t=i;s.watch(t.uploadProgress,async A=>{if(t.inline){const O=r.value.length;A.slice(0,O).every(f=>f==100)&&e("update:modelValue",r.value,a.value)}});const n=s.ref(null),o=s.ref(!1),r=s.ref([]),a=s.ref([]),l=s.ref([".pdf",".csv",".doc",".jpeg",".jpg",".mp4",".png",".txt",".xls"]);function M(A,O=2){if(!+A)return"0 Bytes";const f=1024,z=O<0?0:O,L=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],p=Math.floor(Math.log(A)/Math.log(f));return`${parseFloat((A/Math.pow(f,p)).toFixed(z))} ${L[p]}`}function c(A,O=2){if(!+A)return"0 KB";const f=1024,z=O<0?0:O,L=["KB","MB","GB","TB","PB","EB","ZB","YB"],p=Math.floor(Math.log(A)/Math.log(f));return`${parseFloat((A/Math.pow(f,p)).toFixed(z))} ${L[p]}`}function u(A){return l.value.includes(d(A))?d(A).slice(1):"unknown"}function g(A){const O=A.lastIndexOf(".");let f=A.slice(0,O);return f.length<=19?f:f.slice(0,20)+"... "}function d(A){return A.replace(/.*(?=\.)/g,"")}function y(A){A.stopPropagation();for(let O=0;O<n.value.files.length;O++){const f=n.value.files[O];r.value.push(f)}r.value&&(o.value=!0),e("update:modelValue",r.value,a.value,t.fieldIndex)}function j(A){A.stopPropagation(),A.dataTransfer.dropEffect="copy"}function D(A){A.stopPropagation(),o.value=!0;for(let O=0;O<A.dataTransfer.files.length;O++){const f=A.dataTransfer.files[O];r.value.push(f)}e("update:modelValue",r.value,a.value,t.fieldIndex)}function I(A){window.confirm(t.deleteConfirmationText)&&b(A)}function N(A){window.confirm(t.deleteConfirmationText)&&m(A)}function m(A){a.value.push(A),e("update:modelValue",r.value,a.value,t.fieldIndex)}function b(A){const O=new DataTransfer;for(let f=0;f<r.value.length;f++){const z=r.value[f];A!==f&&O.items.add(z)}r.value=O.files,r.value.length==0&&(o.value=!1)}function C(A){return URL.createObjectURL(A)}function E(A){A.preventDefault(),e("reload")}return(A,O)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["file__upload",{file__upload_box:!i.inline,file__upload_large:i.large&&i.inline}])},[s.createElementVNode("div",{class:"file__upload_btn",onDragover:O[1]||(O[1]=s.withModifiers(f=>j(f),["prevent"])),onDrop:O[2]||(O[2]=s.withModifiers(f=>D(f),["prevent"]))},[s.createVNode(de,{class:"file__upload_btn_icon","icon-name":"upload",size:24}),pC,s.createElementVNode("input",{id:"upload_pdf",ref_key:"upload",ref:n,enctype:"multipart/form-data",multiple:"",name:"file",type:"file",onInput:O[0]||(O[0]=f=>y(f))},null,544)],32),i.fileList.length?(s.openBlock(),s.createElementBlock("div",zC,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.fileList,f=>(s.openBlock(),s.createElementBlock("div",{key:f.id,class:s.normalizeClass(["file__upload_list",i.inline?"":"file__upload_list_box"])},[s.createVNode(de,{"icon-name":"file-"+u(f.label),size:40},null,8,["icon-name"]),s.createElementVNode("div",mC,[s.createElementVNode("div",AC,[s.createElementVNode("div",null,[s.createElementVNode("span",{title:f.label},s.toDisplayString(g(f.label))+s.toDisplayString(d(f.label)),9,TC),xC,s.createElementVNode("span",null,s.toDisplayString(c(f.size_kb)),1)])])]),s.createElementVNode("a",{class:"file__upload_list_download",href:f.download_url,target:"_blank"},[s.createVNode(de,{class:"file__upload_list_download_icon","icon-name":"download",size:24})],8,LC),s.createVNode(de,{class:"file__upload_list_delete","icon-name":"delete",size:24,onClick:z=>N(f.id)},null,8,["onClick"])],2))),128))])):s.createCommentVNode("",!0),o.value?(s.openBlock(),s.createElementBlock("div",EC,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.value,(f,z)=>(s.openBlock(),s.createElementBlock("div",{key:z,class:s.normalizeClass(["file__upload_list",i.inline?"":"file__upload_list_box"])},[s.createVNode(de,{class:s.normalizeClass(i.errorOccurred[z]?"file__upload_list_icon":""),"icon-name":"file-"+u(f.name),size:40},null,8,["class","icon-name"]),t.uploadProgress[z]==100&&i.fileSaved&&!i.errorOccurred[z]&&i.virusCheck[z]=="loading"?(s.openBlock(),s.createBlock(de,{key:0,class:"file__upload_list_icon_sub file__upload_list_icon_sub--loading","icon-name":"states",size:20,style:s.normalizeStyle({"z-index":t.zIndex})},null,8,["style"])):s.createCommentVNode("",!0),t.uploadProgress[z]==100&&i.fileSaved&&i.virusCheck[z]=="failed"?(s.openBlock(),s.createBlock(de,{key:1,class:"file__upload_list_icon_sub","icon-name":"warning",size:20,style:s.normalizeStyle({"z-index":t.zIndex})},null,8,["style"])):s.createCommentVNode("",!0),t.uploadProgress[z]==100&&i.fileSaved&&i.virusCheck[z]=="detected"?(s.openBlock(),s.createBlock(de,{key:2,class:"file__upload_list_icon_sub","icon-name":"danger",size:20,style:s.normalizeStyle({"z-index":t.zIndex})},null,8,["style"])):s.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[z]?(s.openBlock(),s.createBlock(de,{key:3,class:"file__upload_list_icon_sub","icon-name":"error",size:20,style:s.normalizeStyle({"z-index":t.zIndex})},null,8,["style"])):s.createCommentVNode("",!0),s.createElementVNode("div",bC,[s.createElementVNode("div",OC,[s.createElementVNode("div",null,[s.createElementVNode("span",{title:f.name},s.toDisplayString(g(f.name))+s.toDisplayString(d(f.name)),9,CC),t.uploadProgress[z]==100&&i.fileSaved&&!i.errorOccurred[z]&&i.virusCheck[z]=="loading"?(s.openBlock(),s.createElementBlock("span",wC,[s.createTextVNode(s.toDisplayString(i.virusCheckText)+" ",1),s.createVNode(de,{class:"file__upload_list_icon_sub--loading","icon-name":"processing",size:18})])):s.createCommentVNode("",!0),t.uploadProgress[z]==100&&i.fileSaved&&i.virusCheck[z]=="failed"?(s.openBlock(),s.createElementBlock("span",SC,s.toDisplayString(i.virusCheckFailedText),1)):s.createCommentVNode("",!0),t.uploadProgress[z]==100&&i.fileSaved&&i.virusCheck[z]=="detected"?(s.openBlock(),s.createElementBlock("span",kC,s.toDisplayString(i.virusDetectedText),1)):s.createCommentVNode("",!0),vC,i.fileSaved&&!i.errorOccurred[z]||!i.errorOccurred[z]&&i.virusCheck[z]?(s.openBlock(),s.createElementBlock("span",QC,s.toDisplayString(M(f.size)),1)):s.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[z]?(s.openBlock(),s.createElementBlock("span",YC,s.toDisplayString(i.errorMessage),1)):s.createCommentVNode("",!0)]),i.fileSaved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",UC,s.toDisplayString(t.uploadProgress[z])+"%",1))]),i.fileSaved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("progress",{key:0,id:"file",max:"100",value:t.uploadProgress[z]},s.toDisplayString(t.uploadProgress[z])+"% ",9,_C))]),i.fileSaved&&!i.virusCheck[z]&&!i.errorOccurred[z]?(s.openBlock(),s.createElementBlock("a",{key:4,class:"file__upload_list_download",href:C(f),target:"_blank"},[s.createVNode(de,{class:"file__upload_list_download_icon","icon-name":"download",size:24})],8,BC)):s.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[z]?(s.openBlock(),s.createElementBlock("a",{key:5,class:"file__upload_list_retry",onClick:O[3]||(O[3]=L=>E(L))},[s.createVNode(de,{class:"file__upload_list_retry_icon","icon-name":"retry",size:24})])):s.createCommentVNode("",!0),t.uploadProgress[z]!==100?(s.openBlock(),s.createBlock(de,{key:6,class:"file__upload_list_delete","icon-name":"close",size:24,onClick:L=>b(z)},null,8,["onClick"])):(s.openBlock(),s.createBlock(de,{key:7,class:"file__upload_list_delete","icon-name":"delete",size:24,onClick:L=>I(z)},null,8,["onClick"]))],2))),128))])):s.createCommentVNode("",!0),!o.value&&!i.inline&&!i.fileList.length?(s.openBlock(),s.createElementBlock("div",PC," No file selected ")):s.createCommentVNode("",!0),!i.inline&&!i.fileSaved?(s.openBlock(),s.createElementBlock("div",RC,[ZC,s.createElementVNode("button",{class:s.normalizeClass(["file__upload_action_done",o.value&&!i.fileSaved?"file__upload_action_done--active":""]),onClick:O[4]||(O[4]=(...f)=>A.saveFile&&A.saveFile(...f))}," Done ",2)])):s.createCommentVNode("",!0)],2))}},GC=s.defineComponent({components:{DhIcon:de},props:{title:{type:String,required:!1,default:""},iconName:{type:String,required:!1,default:"default"},iconUrl:{type:String,required:!1,default:""},text:{type:String,required:!0},textPosition:{type:String,default:"right",validator:i=>["right","left"].includes(i)},labelKlass:{type:String,required:!1,default:"dh-body-2"},size:{type:Number,required:!1,default:18},hideText:{type:Boolean,required:!1,default:!1},hasBackground:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1,default:!1},activeOnHover:{type:Boolean,required:!1,default:!1},textEllipsis:{type:Boolean,required:!1,default:!1},isDanger:{type:Boolean,required:!1,default:!1}},emits:["error"],methods:{emitError(){this.$emit("error")}}}),_3="",WC=["src","title"];function HC(i,e,t,n,o,r){const a=s.resolveComponent("DhIcon");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["icon-with-text",{"active-hover":i.activeOnHover,active:i.active,danger:i.isDanger,"no-background":!i.hasBackground,reverse:i.textPosition==="left"}])},[i.iconUrl?(s.openBlock(),s.createElementBlock("img",{key:0,alt:"icon image",class:"icon-with-text-icon icon-url",src:i.iconUrl,title:i.title,onError:e[0]||(e[0]=l=>i.emitError())},null,40,WC)):s.createCommentVNode("",!0),i.iconUrl?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(a,s.mergeProps({key:1,class:"icon-with-text-icon icon-3"},{iconName:i.iconName,size:i.size,title:i.title}),null,16)),i.hideText?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(["",`icon-with-text-label ${i.labelKlass} ${i.textEllipsis?"text-ellipsis":""}`])},s.toDisplayString(i.text),3))],2)}const Yj=He(GC,[["render",HC],["__scopeId","data-v-857fab4c"]]),FC=["placeholder","value"],$C=s.defineComponent({__name:"Input",props:{placeholder:{type:String,required:!1,default:"Placeholder"},error:{type:Boolean,required:!1,default:!1},success:{type:Boolean,required:!1,default:!1},modelValue:{type:String,required:!1,default:""}},emits:["update:modelValue"],setup(i,{emit:e}){function t(n){const o=n.target,r=o==null?void 0:o.value;e("update:modelValue",r)}return(n,o)=>(s.openBlock(),s.createElementBlock("input",{class:s.normalizeClass(["form-input",{error:i.error,success:i.success}]),placeholder:i.placeholder,value:i.modelValue,onInput:o[0]||(o[0]=r=>t(r))},null,42,FC))}}),B3="",JC=He($C,[["__scopeId","data-v-9fa01020"]]),P3="",XC={class:"input__dropdown"},KC=["placeholder","value"],qC={class:"input__dropdown_second"},ew=["tabindex"],tw=["onClick"],iw=["onClick"],nw={key:2,class:"button__clear"},Uj={__name:"InputDropdown",props:{options:{type:Array,required:!0},labelProp:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"id"},icon:{type:String,required:!0},placeholderInput:{type:String,required:!1,default:"Enter value"},tabindex:{type:Number,required:!1,default:0},inputValue:{type:String,required:!1,default:""},inputWidth:{type:String,required:!1,default:"75%"},selectedOption:{type:Object,required:!1,default:null},isClearable:{type:Boolean,required:!1,default:!1}},emits:["update","clear"],setup(i,{emit:e}){const t=i,n=s.ref(0),o=s.ref(""),r=s.ref(!1),a=s.ref(""),l=s.computed(()=>o.value.length>20?o.value.substring(0,17)+"...":o.value);s.onMounted(()=>{t.inputValue&&(a.value.value=t.inputValue),t.selectedOption&&(n.value=g(t.selectedOption)),u()}),s.watch(()=>t.selectedOption,d=>{d?n.value=g(d):n.value=0,u()},{deep:!0});function M(){e("update",a.value.value,t.options[n.value])}function c(){e("clear")}function u(){o.value=t.options[n.value][t.labelProp]}function g(d){return t.options.findIndex(y=>y[t.valueProp]===d[t.valueProp])}return(d,y)=>(s.openBlock(),s.createElementBlock("div",XC,[s.createElementVNode("input",{ref_key:"name",ref:a,class:"input__dropdown_text",placeholder:i.placeholderInput,style:s.normalizeStyle({width:i.inputWidth}),type:"text",value:i.inputValue,onInput:M},null,44,KC),s.createElementVNode("div",qC,[s.createVNode(de,{"icon-name":i.icon,size:18},null,8,["icon-name"]),s.createElementVNode("div",{class:"custom__select",tabindex:i.tabindex,onBlur:y[1]||(y[1]=j=>r.value=!1)},[s.createElementVNode("div",{class:s.normalizeClass(["custom__select_selected",{"custom__select--open":r.value}]),onClick:y[0]||(y[0]=j=>r.value=!r.value)},s.toDisplayString(l.value),3),typeof i.options[0]=="object"?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["custom__select_items",{"custom__select--hide":!r.value}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.options,(j,D)=>(s.openBlock(),s.createElementBlock("div",{key:D,onClick:I=>{o.value=j[i.labelProp],n.value=D,r.value=!1,M()}},s.toDisplayString(j[i.labelProp]),9,tw))),128))],2)):s.createCommentVNode("",!0),typeof i.options[0]=="string"?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["custom__select_items",{"custom__select--hide":!r.value}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.options,(j,D)=>(s.openBlock(),s.createElementBlock("div",{key:D,onClick:I=>{o.value=j,n.value=D,r.value=!1,M()}},s.toDisplayString(j),9,iw))),128))],2)):s.createCommentVNode("",!0),t.isClearable?(s.openBlock(),s.createElementBlock("div",nw,[s.createVNode(WM,{color:"ghost",icon:"close",onClick:c})])):s.createCommentVNode("",!0)],40,ew)])]))}},R3="",ow={class:"input-group-multiple"},rw={class:"input-label"},aw={__name:"InputDropdownMultiple",props:{title:{type:String,required:!1,default:"label"},labelProp:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"id"},icon:{type:String,required:!0},placeholderInput:{type:String,required:!1,default:"Enter value"},tabindex:{type:Number,required:!1,default:0},inputWidth:{type:String,required:!1,default:"75%"},value:{type:Array,required:!0},options:{type:Array,required:!0}},emits:["update"],setup(i,{emit:e}){const t=i,n=s.reactive(t.value);function o(l,M,c){n&&(n[l].input=M,n[l].selectedOption=c,e("update",n))}function r(l){n.length>1&&(n.splice(l,1),e("update",n))}function a(){n&&n.push({input:null,selectedOption:null})}return(l,M)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",ow,[s.createElementVNode("label",rw,s.toDisplayString(i.title),1),s.createElementVNode("button",{class:"btn btn-secondary btn-multiple",onClick:a},[s.createVNode(de,{"icon-name":"plus",size:24})])]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n,(c,u)=>(s.openBlock(),s.createBlock(Uj,{key:u,icon:t.icon,"input-value":c.input,"input-width":t.inputWidth,"is-clearable":"","label-prop":t.labelProp,options:t.options,"placeholder-input":t.placeholderInput,"selected-option":c.selectedOption,tabindex:t.tabindex,"value-prop":t.valueProp,onClear:g=>r(u),onUpdate:(g,d,y)=>o(u,g,d)},null,8,["icon","input-value","input-width","label-prop","options","placeholder-input","selected-option","tabindex","value-prop","onClear","onUpdate"]))),128))],64))}},Z3="",sw=["data-e2e","placeholder","value"],lw={key:1,class:"input__group_content"},Mw=["data-e2e","placeholder","value"],cw={key:2,class:"input__group"},uw=["data-e2e","placeholder","type","value"],gw={__name:"InputGroup",props:{modelValue:{type:[String,Number],default:""},inputType:{type:String,default:"text",required:!0},iconName:{type:String,required:!1,default:""},sideContent:{type:String,required:!1,default:""},widthProp:{type:String,default:"200px",required:!1},heightProp:{type:String,default:"30px",required:!1},direction:{type:String,default:"right",required:!1},placeholder:{type:String,default:"type here",required:!1},e2e:{type:String,default:"",required:!1}},emits:["update:modelValue"],setup(i){const e=i;s.useCssVars(n=>({"52c3921b":t.value,"1745b0d0":i.widthProp,ec9c60fa:i.heightProp}));const t=s.ref("row");return s.onMounted(()=>{e.direction=="left"&&(t.value="row-reverse")}),(n,o)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[i.inputType=="multi-line"?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["text__area",i.direction=="left"?"text__area--left":"text__area--right"])},[s.createElementVNode("textarea",{class:"text__area_field",cols:"30","data-e2e":i.e2e,placeholder:i.placeholder,rows:"10",value:i.modelValue,onInput:o[0]||(o[0]=r=>n.$emit("update:modelValue",r.target.value))},null,40,sw),i.direction=="left"&&i.iconName?(s.openBlock(),s.createBlock(de,{key:0,class:"text__area_icon text__area_icon--left","icon-name":i.iconName},null,8,["icon-name"])):s.createCommentVNode("",!0),i.direction=="right"&&i.iconName?(s.openBlock(),s.createBlock(de,{key:1,class:"text__area_icon text__area_icon--right","icon-name":i.iconName},null,8,["icon-name"])):s.createCommentVNode("",!0)],2)):s.createCommentVNode("",!0),i.inputType=="text"&&i.sideContent?(s.openBlock(),s.createElementBlock("div",lw,[s.createElementVNode("input",{class:s.normalizeClass(["form-input",i.direction=="left"?"form-input--left":"form-input--right"]),"data-e2e":i.e2e,placeholder:i.placeholder,value:i.modelValue,onInput:o[1]||(o[1]=r=>n.$emit("update:modelValue",r.target.value))},null,42,Mw),s.createElementVNode("span",{class:s.normalizeClass(["form-span",i.direction=="left"?"form-span--left":"form-span--right"])},s.toDisplayString(i.sideContent),3)])):i.inputType!=="multi-line"?(s.openBlock(),s.createElementBlock("div",cw,[s.createElementVNode("input",{class:"input__group_field","data-e2e":i.e2e,placeholder:i.placeholder,type:i.inputType,value:i.modelValue,onInput:o[2]||(o[2]=r=>n.$emit("update:modelValue",r.target.value))},null,40,uw),i.iconName?(s.openBlock(),s.createBlock(de,{key:0,class:"input__group_icon","icon-name":i.iconName},null,8,["icon-name"])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],64))}};function Kt(i){return[null,void 0].indexOf(i)!==-1}function dw(i,e,t){const{object:n,valueProp:o,mode:r}=s.toRefs(i),a=s.getCurrentInstance().proxy,l=t.iv,M=(g,d=!0)=>{l.value=u(g);const y=c(g);e.emit("change",y,a),d&&(e.emit("input",y),e.emit("update:modelValue",y))},c=g=>n.value||Kt(g)?g:Array.isArray(g)?g.map(d=>d[o.value]):g[o.value],u=g=>Kt(g)?r.value==="single"?{}:[]:g;return{update:M}}function Nw(i,e){const{value:t,modelValue:n,mode:o,valueProp:r}=s.toRefs(i),a=s.ref(o.value!=="single"?[]:{}),l=n&&n.value!==void 0?n:t,M=s.computed(()=>o.value==="single"?a.value[r.value]:a.value.map(u=>u[r.value])),c=s.computed(()=>o.value!=="single"?a.value.map(u=>u[r.value]).join(","):a.value[r.value]);return{iv:a,internalValue:a,ev:l,externalValue:l,textValue:c,plainValue:M}}function jw(i,e,t){const{regex:n}=s.toRefs(i),o=s.getCurrentInstance().proxy,r=t.isOpen,a=t.open,l=s.ref(null),M=s.ref(null),c=()=>{l.value=""},u=y=>{l.value=y.target.value},g=y=>{if(n&&n.value){let j=n.value;typeof j=="string"&&(j=new RegExp(j)),y.key.match(j)||y.preventDefault()}},d=y=>{if(n&&n.value){let D=(y.clipboardData||window.clipboardData).getData("Text"),I=n.value;typeof I=="string"&&(I=new RegExp(I)),D.split("").every(N=>!!N.match(I))||y.preventDefault()}e.emit("paste",y,o)};return s.watch(l,y=>{!r.value&&y&&a(),e.emit("search-change",y,o)}),{search:l,input:M,clearSearch:c,handleSearchInput:u,handleKeypress:g,handlePaste:d}}function yw(i,e,t){const{groupSelect:n,mode:o,groups:r,disabledProp:a}=s.toRefs(i),l=s.ref(null),M=u=>{u===void 0||u!==null&&u[a.value]||r.value&&u&&u.group&&(o.value==="single"||!n.value)||(l.value=u)};return{pointer:l,setPointer:M,clearPointer:()=>{M(null)}}}function HM(i,e=!0){return e?String(i).toLowerCase().trim():String(i).toLowerCase().normalize("NFD").trim().replace(new RegExp(/æ/g),"ae").replace(new RegExp(/œ/g),"oe").replace(new RegExp(/ø/g),"o").replace(/\p{Diacritic}/gu,"")}function Iw(i){return Object.prototype.toString.call(i)==="[object Object]"}function hw(i,e){const t=e.slice().sort();return i.length===e.length&&i.slice().sort().every(function(n,o){return n===t[o]})}function Dw(i,e,t){const{options:n,mode:o,trackBy:r,limit:a,hideSelected:l,createTag:M,createOption:c,label:u,appendNewTag:g,appendNewOption:d,multipleLabel:y,object:j,loading:D,delay:I,resolveOnLoad:N,minChars:m,filterResults:b,clearOnSearch:C,clearOnSelect:E,valueProp:A,allowAbsent:O,groupLabel:f,canDeselect:z,max:L,strict:p,closeOnSelect:h,closeOnDeselect:T,groups:w,reverse:x,infinite:S,groupOptions:v,groupHideEmpty:k,groupSelect:P,onCreate:W,disabledProp:Q,searchStart:_,searchFilter:$}=s.toRefs(i),ne=s.getCurrentInstance().proxy,ie=t.iv,F=t.ev,B=t.search,V=t.clearSearch,H=t.update,q=t.pointer,X=t.clearPointer,Ie=t.focus,Le=t.deactivate,me=t.close,R=t.localize,Ne=s.ref([]),he=s.ref([]),_e=s.ref(!1),Zt=s.ref(null),Mn=s.ref(S.value&&a.value===-1?10:a.value),cn=s.computed(()=>M.value||c.value||!1),Y=s.computed(()=>g.value!==void 0?g.value:d.value!==void 0?d.value:!0),J=s.computed(()=>{if(w.value){let U=qe.value||[],K=[];return U.forEach(fe=>{Jc(fe[v.value]).forEach(Je=>{K.push(Object.assign({},Je,fe[Q.value]?{[Q.value]:!0}:{}))})}),K}else{let U=Jc(he.value||[]);return Ne.value.length&&(U=U.concat(Ne.value)),U}}),ee=s.computed(()=>{let U=J.value;return x.value&&(U=U.reverse()),vi.value.length&&(U=vi.value.concat(U)),$c(U)}),ue=s.computed(()=>{let U=ee.value;return Mn.value>0&&(U=U.slice(0,Mn.value)),U}),qe=s.computed(()=>{if(!w.value)return[];let U=[],K=he.value||[];return Ne.value.length&&U.push({[f.value]:" ",[v.value]:[...Ne.value],__CREATE__:!0}),U.concat(K)}),Ct=s.computed(()=>{let U=[...qe.value].map(K=>({...K}));return vi.value.length&&(U[0]&&U[0].__CREATE__?U[0][v.value]=[...vi.value,...U[0][v.value]]:U=[{[f.value]:" ",[v.value]:[...vi.value],__CREATE__:!0}].concat(U)),U}),Lt=s.computed(()=>{if(!w.value)return[];let U=Ct.value;return y3((U||[]).map((K,fe)=>{const Je=Jc(K[v.value]);return{...K,index:fe,group:!0,[v.value]:$c(Je,!1).map(bo=>Object.assign({},bo,K[Q.value]?{[Q.value]:!0}:{})),__VISIBLE__:$c(Je).map(bo=>Object.assign({},bo,K[Q.value]?{[Q.value]:!0}:{}))}}))}),ki=s.computed(()=>{switch(o.value){case"single":return!Kt(ie.value[A.value]);case"multiple":case"tags":return!Kt(ie.value)&&ie.value.length>0}}),ii=s.computed(()=>y!==void 0&&y.value!==void 0?y.value(ie.value,ne):ie.value&&ie.value.length>1?`${ie.value.length} options selected`:"1 option selected"),Vc=s.computed(()=>!J.value.length&&!_e.value&&!vi.value.length),Gc=s.computed(()=>J.value.length>0&&ue.value.length==0&&(B.value&&w.value||!w.value)),vi=s.computed(()=>cn.value===!1||!B.value?[]:ss(B.value)!==-1?[]:[{[A.value]:B.value,[wt.value]:B.value,[u.value]:B.value,__CREATE__:!0}]),wt=s.computed(()=>r.value||u.value),Wc=s.computed(()=>{switch(o.value){case"single":return null;case"multiple":case"tags":return[]}}),Hc=s.computed(()=>D.value||_e.value),St=U=>{switch(typeof U!="object"&&(U=vt(U)),o.value){case"single":H(U);break;case"multiple":case"tags":H(ie.value.concat(U));break}e.emit("select",rs(U),U,ne)},Qi=U=>{switch(typeof U!="object"&&(U=vt(U)),o.value){case"single":Yn();break;case"tags":case"multiple":H(Array.isArray(U)?ie.value.filter(K=>U.map(fe=>fe[A.value]).indexOf(K[A.value])===-1):ie.value.filter(K=>K[A.value]!=U[A.value]));break}e.emit("deselect",rs(U),U,ne)},rs=U=>j.value?U:U[A.value],as=U=>{Qi(U)},Fc=(U,K)=>{if(K.button!==0){K.preventDefault();return}as(U)},Yn=()=>{e.emit("clear",ne),H(Wc.value)},kt=U=>{if(U.group!==void 0)return o.value==="single"?!1:di(U[v.value])&&U[v.value].length;switch(o.value){case"single":return!Kt(ie.value)&&ie.value[A.value]==U[A.value];case"tags":case"multiple":return!Kt(ie.value)&&ie.value.map(K=>K[A.value]).indexOf(U[A.value])!==-1}},Yi=U=>U[Q.value]===!0,Eo=()=>L===void 0||L.value===-1||!ki.value&&L.value>0?!1:ie.value.length>=L.value,G=U=>{if(!Yi(U)){if(W&&W.value&&!kt(U)&&U.__CREATE__&&(U={...U},delete U.__CREATE__,U=W.value(U,ne),U instanceof Promise)){_e.value=!0,U.then(K=>{_e.value=!1,Me(K)});return}Me(U)}},Me=U=>{switch(U.__CREATE__&&(U={...U},delete U.__CREATE__),o.value){case"single":if(U&&kt(U)){z.value&&Qi(U),T.value&&(X(),me());return}U&&ge(U),E.value&&V(),h.value&&(X(),me()),U&&St(U);break;case"multiple":if(U&&kt(U)){Qi(U),T.value&&(X(),me());return}if(Eo()){e.emit("max",ne);return}U&&(ge(U),St(U)),E.value&&V(),l.value&&X(),h.value&&me();break;case"tags":if(U&&kt(U)){Qi(U),T.value&&(X(),me());return}if(Eo()){e.emit("max",ne);return}U&&ge(U),E.value&&V(),U&&St(U),l.value&&X(),h.value&&me();break}h.value||Ie()},oe=U=>{if(!(Yi(U)||o.value==="single"||!P.value)){switch(o.value){case"multiple":case"tags":un(U[v.value])?Qi(U[v.value]):St(U[v.value].filter(K=>ie.value.map(fe=>fe[A.value]).indexOf(K[A.value])===-1).filter(K=>!K[Q.value]).filter((K,fe)=>ie.value.length+1+fe<=L.value||L.value===-1));break}h.value&&Le()}},ge=U=>{vt(U[A.value])===void 0&&cn.value&&(e.emit("tag",U[A.value],ne),e.emit("option",U[A.value],ne),e.emit("create",U[A.value],ne),Y.value&&Ms(U),V())},ye=()=>{o.value!=="single"&&St(ue.value.filter(U=>!U.disabled&&!kt(U)))},un=U=>U.find(K=>!kt(K)&&!K[Q.value])===void 0,di=U=>U.find(K=>!kt(K))===void 0,vt=U=>J.value[J.value.map(K=>String(K[A.value])).indexOf(String(U))],ss=(U,K=!0)=>J.value.map(fe=>parseInt(fe[wt.value])==fe[wt.value]?parseInt(fe[wt.value]):fe[wt.value]).indexOf(parseInt(U)==U?parseInt(U):U),ls=U=>["tags","multiple"].indexOf(o.value)!==-1&&l.value&&kt(U),Ms=U=>{Ne.value.push(U)},y3=U=>k.value?U.filter(K=>B.value?K.__VISIBLE__.length:K[v.value].length):U.filter(K=>B.value?K.__VISIBLE__.length:!0),$c=(U,K=!0)=>{let fe=U;if(B.value&&b.value){let Je=$.value;Je||(Je=(bo,MQ)=>{let AI=HM(R(bo[wt.value]),p.value);return _.value?AI.startsWith(HM(B.value,p.value)):AI.indexOf(HM(B.value,p.value))!==-1}),fe=fe.filter(Je)}return l.value&&K&&(fe=fe.filter(Je=>!ls(Je))),fe},Jc=U=>{let K=U;return Iw(K)&&(K=Object.keys(K).map(fe=>{let Je=K[fe];return{[A.value]:fe,[wt.value]:Je,[u.value]:Je}})),K=K.map(fe=>typeof fe=="object"?fe:{[A.value]:fe,[wt.value]:fe,[u.value]:fe}),K},cs=()=>{Kt(F.value)||(ie.value=gs(F.value))},us=U=>(_e.value=!0,new Promise((K,fe)=>{n.value(B.value,ne).then(Je=>{he.value=Je||[],typeof U=="function"&&U(Je),_e.value=!1}).catch(Je=>{console.error(Je),he.value=[],_e.value=!1}).finally(()=>{K()})})),Xc=()=>{if(ki.value)if(o.value==="single"){let U=vt(ie.value[A.value]);if(U!==void 0){let K=U[u.value];ie.value[u.value]=K,j.value&&(F.value[u.value]=K)}}else ie.value.forEach((U,K)=>{let fe=vt(ie.value[K][A.value]);if(fe!==void 0){let Je=fe[u.value];ie.value[K][u.value]=Je,j.value&&(F.value[K][u.value]=Je)}})},I3=U=>{us(U)},gs=U=>Kt(U)?o.value==="single"?{}:[]:j.value?U:o.value==="single"?vt(U)||(O.value?{[u.value]:U,[A.value]:U,[wt.value]:U}:{}):U.filter(K=>!!vt(K)||O.value).map(K=>vt(K)||{[u.value]:K,[A.value]:K,[wt.value]:K}),mI=()=>{Zt.value=s.watch(B,U=>{U.length<m.value||!U&&m.value!==0||(_e.value=!0,C.value&&(he.value=[]),setTimeout(()=>{U==B.value&&n.value(B.value,ne).then(K=>{(U==B.value||!B.value)&&(he.value=K,q.value=ue.value.filter(fe=>fe[Q.value]!==!0)[0]||null,_e.value=!1)}).catch(K=>{console.error(K)})},I.value))},{flush:"sync"})};if(o.value!=="single"&&!Kt(F.value)&&!Array.isArray(F.value))throw new Error(`v-model must be an array when using "${o.value}" mode`);return n&&typeof n.value=="function"?N.value?us(cs):j.value==!0&&cs():(he.value=n.value,cs()),I.value>-1&&mI(),s.watch(I,(U,K)=>{Zt.value&&Zt.value(),U>=0&&mI()}),s.watch(F,U=>{if(Kt(U)){H(gs(U),!1);return}switch(o.value){case"single":(j.value?U[A.value]!=ie.value[A.value]:U!=ie.value[A.value])&&H(gs(U),!1);break;case"multiple":case"tags":hw(j.value?U.map(K=>K[A.value]):U,ie.value.map(K=>K[A.value]))||H(gs(U),!1);break}},{deep:!0}),s.watch(n,(U,K)=>{typeof i.options=="function"?N.value&&(!K||U&&U.toString()!==K.toString())&&us():(he.value=i.options,Object.keys(ie.value).length||cs(),Xc())}),s.watch(u,Xc),{pfo:ee,fo:ue,filteredOptions:ue,hasSelected:ki,multipleLabelText:ii,eo:J,extendedOptions:J,eg:qe,extendedGroups:qe,fg:Lt,filteredGroups:Lt,noOptions:Vc,noResults:Gc,resolving:_e,busy:Hc,offset:Mn,select:St,deselect:Qi,remove:as,selectAll:ye,clear:Yn,isSelected:kt,isDisabled:Yi,isMax:Eo,getOption:vt,handleOptionClick:G,handleGroupClick:oe,handleTagRemove:Fc,refreshOptions:I3,resolveOptions:us,refreshLabels:Xc}}function fw(i,e,t){const{valueProp:n,showOptions:o,searchable:r,groupLabel:a,groups:l,mode:M,groupSelect:c,disabledProp:u,groupOptions:g}=s.toRefs(i),d=t.fo,y=t.fg,j=t.handleOptionClick,D=t.handleGroupClick,I=t.search,N=t.pointer,m=t.setPointer,b=t.clearPointer,C=t.multiselect,E=t.isOpen,A=s.computed(()=>d.value.filter(F=>!F[u.value])),O=s.computed(()=>y.value.filter(F=>!F[u.value])),f=s.computed(()=>M.value!=="single"&&c.value),z=s.computed(()=>N.value&&N.value.group),L=s.computed(()=>ne(N.value)),p=s.computed(()=>{const F=z.value?N.value:ne(N.value),B=O.value.map(H=>H[a.value]).indexOf(F[a.value]);let V=O.value[B-1];return V===void 0&&(V=T.value),V}),h=s.computed(()=>{let F=O.value.map(B=>B.label).indexOf(z.value?N.value[a.value]:ne(N.value)[a.value])+1;return O.value.length<=F&&(F=0),O.value[F]}),T=s.computed(()=>[...O.value].slice(-1)[0]),w=s.computed(()=>N.value.__VISIBLE__.filter(F=>!F[u.value])[0]),x=s.computed(()=>{const F=L.value.__VISIBLE__.filter(B=>!B[u.value]);return F[F.map(B=>B[n.value]).indexOf(N.value[n.value])-1]}),S=s.computed(()=>{const F=ne(N.value).__VISIBLE__.filter(B=>!B[u.value]);return F[F.map(B=>B[n.value]).indexOf(N.value[n.value])+1]}),v=s.computed(()=>[...p.value.__VISIBLE__.filter(F=>!F[u.value])].slice(-1)[0]),k=s.computed(()=>[...T.value.__VISIBLE__.filter(F=>!F[u.value])].slice(-1)[0]),P=F=>N.value&&(!F.group&&N.value[n.value]===F[n.value]||F.group!==void 0&&N.value[a.value]===F[a.value])?!0:void 0,W=()=>{m(A.value[0]||null)},Q=()=>{!N.value||N.value[u.value]===!0||(z.value?D(N.value):j(N.value))},_=()=>{if(N.value===null)m((l.value&&f.value?O.value[0].__CREATE__?A.value[0]:O.value[0]:A.value[0])||null);else if(l.value&&f.value){let F=z.value?w.value:S.value;F===void 0&&(F=h.value,F.__CREATE__&&(F=F[g.value][0])),m(F||null)}else{let F=A.value.map(B=>B[n.value]).indexOf(N.value[n.value])+1;A.value.length<=F&&(F=0),m(A.value[F]||null)}s.nextTick(()=>{ie()})},$=()=>{if(N.value===null){let F=A.value[A.value.length-1];l.value&&f.value&&(F=k.value,F===void 0&&(F=T.value)),m(F||null)}else if(l.value&&f.value){let F=z.value?v.value:x.value;F===void 0&&(F=z.value?p.value:L.value,F.__CREATE__&&(F=v.value,F===void 0&&(F=p.value))),m(F||null)}else{let F=A.value.map(B=>B[n.value]).indexOf(N.value[n.value])-1;F<0&&(F=A.value.length-1),m(A.value[F]||null)}s.nextTick(()=>{ie()})},ne=F=>O.value.find(B=>B.__VISIBLE__.map(V=>V[n.value]).indexOf(F[n.value])!==-1),ie=()=>{let F=C.value.querySelector("[data-pointed]");if(!F)return;let B=F.parentElement.parentElement;l.value&&(B=z.value?F.parentElement.parentElement.parentElement:F.parentElement.parentElement.parentElement.parentElement),F.offsetTop+F.offsetHeight>B.clientHeight+B.scrollTop&&(B.scrollTop=F.offsetTop+F.offsetHeight-B.clientHeight),F.offsetTop<B.scrollTop&&(B.scrollTop=F.offsetTop)};return s.watch(I,F=>{r.value&&(F.length&&o.value?W():b())}),s.watch(E,F=>{if(F){let B=C.value.querySelectorAll("[data-selected]")[0];if(!B)return;let V=B.parentElement.parentElement;s.nextTick(()=>{V.scrollTop>0||(V.scrollTop=B.offsetTop)})}}),{pointer:N,canPointGroups:f,isPointed:P,setPointerFirst:W,selectPointer:Q,forwardPointer:_,backwardPointer:$}}function pw(i,e,t){const{disabled:n}=s.toRefs(i),o=s.getCurrentInstance().proxy,r=s.ref(!1);return{isOpen:r,open:()=>{r.value||n.value||(r.value=!0,e.emit("open",o))},close:()=>{r.value&&(r.value=!1,e.emit("close",o))}}}function zw(i,e,t){const{searchable:n,disabled:o,clearOnBlur:r}=s.toRefs(i),a=t.input,l=t.open,M=t.close,c=t.clearSearch,u=t.isOpen,g=s.ref(null),d=s.ref(null),y=s.ref(null),j=s.ref(!1),D=s.ref(!1),I=s.computed(()=>n.value||o.value?-1:0),N=()=>{n.value&&a.value.blur(),d.value.blur()},m=()=>{n.value&&!o.value&&a.value.focus()},b=(z=!0)=>{o.value||(j.value=!0,z&&l())},C=()=>{j.value=!1,setTimeout(()=>{j.value||(M(),r.value&&c())},1)};return{multiselect:g,wrapper:d,tags:y,tabindex:I,isActive:j,mouseClicked:D,blur:N,focus:m,activate:b,deactivate:C,handleFocusIn:z=>{z.target.closest("[data-tags]")&&z.target.nodeName!=="INPUT"||z.target.closest("[data-clear]")||b(D.value)},handleFocusOut:()=>{C()},handleCaretClick:()=>{C(),N()},handleMousedown:z=>{D.value=!0,u.value&&(z.target.isEqualNode(d.value)||z.target.isEqualNode(y.value))?setTimeout(()=>{C()},0):document.activeElement.isEqualNode(d.value)&&!u.value&&b(),setTimeout(()=>{D.value=!1},0)}}}function mw(i,e,t){const{mode:n,addTagOn:o,openDirection:r,searchable:a,showOptions:l,valueProp:M,groups:c,addOptionOn:u,createTag:g,createOption:d,reverse:y}=s.toRefs(i),j=s.getCurrentInstance().proxy,D=t.iv,I=t.update,N=t.search,m=t.setPointer,b=t.selectPointer,C=t.backwardPointer,E=t.forwardPointer,A=t.multiselect,O=t.wrapper,f=t.tags,z=t.isOpen,L=t.open,p=t.blur,h=t.fo,T=s.computed(()=>g.value||d.value||!1),w=s.computed(()=>o.value!==void 0?o.value:u.value!==void 0?u.value:["enter"]),x=()=>{n.value==="tags"&&!l.value&&T.value&&a.value&&!c.value&&m(h.value[h.value.map(P=>P[M.value]).indexOf(N.value)])},S=P=>{let W=P.length-1;for(;W>=0&&(P[W].remove===!1||P[W].disabled);)W--;return W<0||P.splice(W,1),P};return{handleKeydown:P=>{e.emit("keydown",P,j);let W,Q;switch(["ArrowLeft","ArrowRight","Enter"].indexOf(P.key)!==-1&&n.value==="tags"&&(W=[...A.value.querySelectorAll("[data-tags] > *")].filter(_=>_!==f.value),Q=W.findIndex(_=>_===document.activeElement)),P.key){case"Backspace":if(n.value==="single"||a.value&&[null,""].indexOf(N.value)===-1||D.value.length===0)return;I(S([...D.value]));break;case"Enter":if(P.preventDefault(),P.keyCode===229)return;if(Q!==-1&&Q!==void 0){I([...D.value].filter((_,$)=>$!==Q)),Q===W.length-1&&(W.length-1?W[W.length-2].focus():a.value?f.value.querySelector("input").focus():O.value.focus());return}if(w.value.indexOf("enter")===-1&&T.value)return;x(),b();break;case" ":if(!T.value&&!a.value){P.preventDefault(),x(),b();return}if(!T.value)return!1;if(w.value.indexOf("space")===-1&&T.value)return;P.preventDefault(),x(),b();break;case"Tab":case";":case",":if(w.value.indexOf(P.key.toLowerCase())===-1||!T.value)return;x(),b(),P.preventDefault();break;case"Escape":p();break;case"ArrowUp":if(P.preventDefault(),!l.value)return;z.value||L(),C();break;case"ArrowDown":if(P.preventDefault(),!l.value)return;z.value||L(),E();break;case"ArrowLeft":if(a.value&&f.value&&f.value.querySelector("input").selectionStart||P.shiftKey||n.value!=="tags"||!D.value||!D.value.length)return;P.preventDefault(),Q===-1?W[W.length-1].focus():Q>0&&W[Q-1].focus();break;case"ArrowRight":if(Q===-1||P.shiftKey||n.value!=="tags"||!D.value||!D.value.length)return;P.preventDefault(),W.length>Q+1?W[Q+1].focus():a.value?f.value.querySelector("input").focus():a.value||O.value.focus();break}},handleKeyup:P=>{e.emit("keyup",P,j)},preparePointer:x}}function Aw(i,e,t){const{classes:n,disabled:o,openDirection:r,showOptions:a}=s.toRefs(i),l=t.isOpen,M=t.isPointed,c=t.isSelected,u=t.isDisabled,g=t.isActive,d=t.canPointGroups,y=t.resolving,j=t.fo,D=s.computed(()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...n.value})),I=s.computed(()=>!!(l.value&&a.value&&(!y.value||y.value&&j.value.length)));return{classList:s.computed(()=>{const m=D.value;return{container:[m.container].concat(o.value?m.containerDisabled:[]).concat(I.value&&r.value==="top"?m.containerOpenTop:[]).concat(I.value&&r.value!=="top"?m.containerOpen:[]).concat(g.value?m.containerActive:[]),wrapper:m.wrapper,spacer:m.spacer,singleLabel:m.singleLabel,singleLabelText:m.singleLabelText,multipleLabel:m.multipleLabel,search:m.search,tags:m.tags,tag:[m.tag].concat(o.value?m.tagDisabled:[]),tagDisabled:m.tagDisabled,tagRemove:m.tagRemove,tagRemoveIcon:m.tagRemoveIcon,tagsSearchWrapper:m.tagsSearchWrapper,tagsSearch:m.tagsSearch,tagsSearchCopy:m.tagsSearchCopy,placeholder:m.placeholder,caret:[m.caret].concat(l.value?m.caretOpen:[]),clear:m.clear,clearIcon:m.clearIcon,spinner:m.spinner,inifinite:m.inifinite,inifiniteSpinner:m.inifiniteSpinner,dropdown:[m.dropdown].concat(r.value==="top"?m.dropdownTop:[]).concat(!l.value||!a.value||!I.value?m.dropdownHidden:[]),options:[m.options].concat(r.value==="top"?m.optionsTop:[]),group:m.group,groupLabel:b=>{let C=[m.groupLabel];return M(b)?C.push(c(b)?m.groupLabelSelectedPointed:m.groupLabelPointed):c(b)&&d.value?C.push(u(b)?m.groupLabelSelectedDisabled:m.groupLabelSelected):u(b)&&C.push(m.groupLabelDisabled),d.value&&C.push(m.groupLabelPointable),C},groupOptions:m.groupOptions,option:(b,C)=>{let E=[m.option];return M(b)?E.push(c(b)?m.optionSelectedPointed:m.optionPointed):c(b)?E.push(u(b)?m.optionSelectedDisabled:m.optionSelected):(u(b)||C&&u(C))&&E.push(m.optionDisabled),E},noOptions:m.noOptions,noResults:m.noResults,assist:m.assist,fakeInput:m.fakeInput}}),showDropdown:I}}function Tw(i,e,t){const{limit:n,infinite:o}=s.toRefs(i),r=t.isOpen,a=t.offset,l=t.search,M=t.pfo,c=t.eo,u=s.ref(null),g=s.ref(null),d=s.computed(()=>a.value<M.value.length),y=D=>{const{isIntersecting:I,target:N}=D[0];if(I){const m=N.offsetParent,b=m.scrollTop;a.value+=n.value==-1?10:n.value,s.nextTick(()=>{m.scrollTop=b})}},j=()=>{r.value&&a.value<M.value.length?u.value.observe(g.value):!r.value&&u.value&&u.value.disconnect()};return s.watch(r,()=>{o.value&&j()}),s.watch(l,()=>{o.value&&(a.value=n.value,j())},{flush:"post"}),s.watch(c,()=>{o.value&&j()},{immediate:!1,flush:"post"}),s.onMounted(()=>{window&&window.IntersectionObserver&&(u.value=new IntersectionObserver(y))}),{hasMore:d,infiniteLoader:g}}function xw(i,e,t){const{placeholder:n,id:o,valueProp:r,label:a,mode:l,groupLabel:M,aria:c,searchable:u}=s.toRefs(i),g=t.pointer,d=t.iv,y=t.hasSelected,j=t.multipleLabelText,D=s.ref(null),I=s.computed(()=>{let h=[];return o&&o.value&&h.push(o.value),h.push("assist"),h.join("-")}),N=s.computed(()=>{let h=[];return o&&o.value&&h.push(o.value),h.push("multiselect-options"),h.join("-")}),m=s.computed(()=>{let h=[];if(o&&o.value&&h.push(o.value),g.value)return h.push(g.value.group?"multiselect-group":"multiselect-option"),h.push(g.value.group?g.value.index:g.value[r.value]),h.join("-")}),b=s.computed(()=>n.value),C=s.computed(()=>l.value!=="single"),E=s.computed(()=>{let h="";return l.value==="single"&&y.value&&(h+=d.value[a.value]),l.value==="multiple"&&y.value&&(h+=j.value),l.value==="tags"&&y.value&&(h+=d.value.map(T=>T[a.value]).join(", ")),h}),A=s.computed(()=>{let h={...c.value};return u.value&&(h["aria-labelledby"]=h["aria-labelledby"]?`${I.value} ${h["aria-labelledby"]}`:I.value,E.value&&h["aria-label"]&&(h["aria-label"]=`${E.value}, ${h["aria-label"]}`)),h}),O=h=>{let T=[];return o&&o.value&&T.push(o.value),T.push("multiselect-option"),T.push(h[r.value]),T.join("-")},f=h=>{let T=[];return o&&o.value&&T.push(o.value),T.push("multiselect-group"),T.push(h.index),T.join("-")},z=h=>{let T=[];return T.push(h),T.join(" ")},L=h=>{let T=[];return T.push(h),T.join(" ")},p=h=>`${h} ❎`;return s.onMounted(()=>{if(o&&o.value&&document&&document.querySelector){let h=document.querySelector(`[for="${o.value}"]`);D.value=h?h.innerText:null}}),{arias:A,ariaLabel:E,ariaAssist:I,ariaControls:N,ariaPlaceholder:b,ariaMultiselectable:C,ariaActiveDescendant:m,ariaOptionId:O,ariaOptionLabel:z,ariaGroupId:f,ariaGroupLabel:L,ariaTagLabel:p}}function Lw(i,e,t){const{locale:n,fallbackLocale:o}=s.toRefs(i);return{localize:a=>!a||typeof a!="object"?a:a&&a[n.value]?a[n.value]:a&&n.value&&a[n.value.toUpperCase()]?a[n.value.toUpperCase()]:a&&a[o.value]?a[o.value]:a&&o.value&&a[o.value.toUpperCase()]?a[o.value.toUpperCase()]:a&&Object.keys(a)[0]?a[Object.keys(a)[0]]:""}}function Ew(i,e,t,n={}){return t.forEach(o=>{o&&(n={...n,...o(i,e,n)})}),n}var FM={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1}},setup(i,e){return Ew(i,e,[Lw,Nw,yw,pw,jw,dw,zw,Dw,Tw,fw,mw,Aw,xw])}};const bw=["id","dir"],Ow=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],Cw=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],ww=["onKeyup","aria-label"],Sw=["onClick"],kw=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],vw=["innerHTML"],Qw=["id"],Yw=["id","aria-label","aria-selected"],Uw=["data-pointed","onMouseenter","onClick"],_w=["innerHTML"],Bw=["aria-label"],Pw=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],Rw=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],Zw=["innerHTML"],Vw=["innerHTML"],Gw=["value"],Ww=["name","value"],Hw=["name","value"],Fw=["id"];function $w(i,e,t,n,o,r){return s.openBlock(),s.createElementBlock("div",{ref:"multiselect",class:s.normalizeClass(i.classList.container),id:t.searchable?void 0:t.id,dir:t.rtl?"rtl":void 0,onFocusin:e[10]||(e[10]=(...a)=>i.handleFocusIn&&i.handleFocusIn(...a)),onFocusout:e[11]||(e[11]=(...a)=>i.handleFocusOut&&i.handleFocusOut(...a)),onKeyup:e[12]||(e[12]=(...a)=>i.handleKeyup&&i.handleKeyup(...a)),onKeydown:e[13]||(e[13]=(...a)=>i.handleKeydown&&i.handleKeydown(...a))},[s.createElementVNode("div",s.mergeProps({class:i.classList.wrapper,onMousedown:e[9]||(e[9]=(...a)=>i.handleMousedown&&i.handleMousedown(...a)),ref:"wrapper",tabindex:i.tabindex,"aria-controls":t.searchable?void 0:i.ariaControls,"aria-placeholder":t.searchable?void 0:i.ariaPlaceholder,"aria-expanded":t.searchable?void 0:i.isOpen,"aria-activedescendant":t.searchable?void 0:i.ariaActiveDescendant,"aria-multiselectable":t.searchable?void 0:i.ariaMultiselectable,role:t.searchable?void 0:"combobox"},t.searchable?{}:i.arias),[s.createCommentVNode(" Search "),t.mode!=="tags"&&t.searchable&&!t.disabled?(s.openBlock(),s.createElementBlock("input",s.mergeProps({key:0,type:t.inputType,modelValue:i.search,value:i.search,class:i.classList.search,autocomplete:t.autocomplete,id:t.searchable?t.id:void 0,onInput:e[0]||(e[0]=(...a)=>i.handleSearchInput&&i.handleSearchInput(...a)),onKeypress:e[1]||(e[1]=(...a)=>i.handleKeypress&&i.handleKeypress(...a)),onPaste:e[2]||(e[2]=s.withModifiers((...a)=>i.handlePaste&&i.handlePaste(...a),["stop"])),ref:"input","aria-controls":i.ariaControls,"aria-placeholder":i.ariaPlaceholder,"aria-expanded":i.isOpen,"aria-activedescendant":i.ariaActiveDescendant,"aria-multiselectable":i.ariaMultiselectable,role:"combobox"},{...t.attrs,...i.arias}),null,16,Cw)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Tags (with search) "),t.mode=="tags"?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(i.classList.tags),"data-tags":""},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.iv,(a,l,M)=>s.renderSlot(i.$slots,"tag",{option:a,handleTagRemove:i.handleTagRemove,disabled:t.disabled},()=>[(s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass([i.classList.tag,a.disabled?i.classList.tagDisabled:null]),tabindex:"-1",onKeyup:s.withKeys(c=>i.handleTagRemove(a,c),["enter"]),key:M,"aria-label":i.ariaTagLabel(i.localize(a[t.label]))},[s.createTextVNode(s.toDisplayString(i.localize(a[t.label]))+" ",1),!t.disabled&&!a.disabled?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(i.classList.tagRemove),onClick:s.withModifiers(c=>i.handleTagRemove(a,c),["stop"])},[s.createElementVNode("span",{class:s.normalizeClass(i.classList.tagRemoveIcon)},null,2)],10,Sw)):s.createCommentVNode("v-if",!0)],42,ww))])),256)),s.createElementVNode("div",{class:s.normalizeClass(i.classList.tagsSearchWrapper),ref:"tags"},[s.createCommentVNode(" Used for measuring search width "),s.createElementVNode("span",{class:s.normalizeClass(i.classList.tagsSearchCopy)},s.toDisplayString(i.search),3),s.createCommentVNode(" Actual search input "),t.searchable&&!t.disabled?(s.openBlock(),s.createElementBlock("input",s.mergeProps({key:0,type:t.inputType,modelValue:i.search,value:i.search,class:i.classList.tagsSearch,id:t.searchable?t.id:void 0,autocomplete:t.autocomplete,onInput:e[3]||(e[3]=(...a)=>i.handleSearchInput&&i.handleSearchInput(...a)),onKeypress:e[4]||(e[4]=(...a)=>i.handleKeypress&&i.handleKeypress(...a)),onPaste:e[5]||(e[5]=s.withModifiers((...a)=>i.handlePaste&&i.handlePaste(...a),["stop"])),ref:"input","aria-controls":i.ariaControls,"aria-placeholder":i.ariaPlaceholder,"aria-expanded":i.isOpen,"aria-activedescendant":i.ariaActiveDescendant,"aria-multiselectable":i.ariaMultiselectable,role:"combobox"},{...t.attrs,...i.arias}),null,16,kw)):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Single label "),t.mode=="single"&&i.hasSelected&&!i.search&&i.iv?s.renderSlot(i.$slots,"singlelabel",{key:2,value:i.iv},()=>[s.createElementVNode("div",{class:s.normalizeClass(i.classList.singleLabel)},[s.createElementVNode("span",{class:s.normalizeClass(i.classList.singleLabelText)},s.toDisplayString(i.localize(i.iv[t.label])),3)],2)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Multiple label "),t.mode=="multiple"&&i.hasSelected&&!i.search?s.renderSlot(i.$slots,"multiplelabel",{key:3,values:i.iv},()=>[s.createElementVNode("div",{class:s.normalizeClass(i.classList.multipleLabel),innerHTML:i.multipleLabelText},null,10,vw)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Placeholder "),t.placeholder&&!i.hasSelected&&!i.search?s.renderSlot(i.$slots,"placeholder",{key:4},()=>[s.createElementVNode("div",{class:s.normalizeClass(i.classList.placeholder),"aria-hidden":"true"},s.toDisplayString(t.placeholder),3)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Spinner "),t.loading||i.resolving?s.renderSlot(i.$slots,"spinner",{key:5},()=>[s.createElementVNode("span",{class:s.normalizeClass(i.classList.spinner),"aria-hidden":"true"},null,2)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Clear "),i.hasSelected&&!t.disabled&&t.canClear&&!i.busy?s.renderSlot(i.$slots,"clear",{key:6,clear:i.clear},()=>[s.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:s.normalizeClass(i.classList.clear),onClick:e[6]||(e[6]=(...a)=>i.clear&&i.clear(...a)),onKeyup:e[7]||(e[7]=s.withKeys((...a)=>i.clear&&i.clear(...a),["enter"]))},[s.createElementVNode("span",{class:s.normalizeClass(i.classList.clearIcon)},null,2)],34)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Caret "),t.caret&&t.showOptions?s.renderSlot(i.$slots,"caret",{key:7},()=>[s.createElementVNode("span",{class:s.normalizeClass(i.classList.caret),onClick:e[8]||(e[8]=(...a)=>i.handleCaretClick&&i.handleCaretClick(...a)),"aria-hidden":"true"},null,2)]):s.createCommentVNode("v-if",!0)],16,Ow),s.createCommentVNode(" Options "),s.createElementVNode("div",{class:s.normalizeClass(i.classList.dropdown),tabindex:"-1"},[s.renderSlot(i.$slots,"beforelist",{options:i.fo}),s.createElementVNode("ul",{class:s.normalizeClass(i.classList.options),id:i.ariaControls,role:"listbox"},[t.groups?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(i.fg,(a,l,M)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(i.classList.group),key:M,id:i.ariaGroupId(a),"aria-label":i.ariaGroupLabel(i.localize(a[t.groupLabel])),"aria-selected":i.isSelected(a),role:"option"},[a.__CREATE__?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(i.classList.groupLabel(a)),"data-pointed":i.isPointed(a),onMouseenter:c=>i.setPointer(a,l),onClick:c=>i.handleGroupClick(a)},[s.renderSlot(i.$slots,"grouplabel",{group:a,isSelected:i.isSelected,isPointed:i.isPointed},()=>[s.createElementVNode("span",{innerHTML:i.localize(a[t.groupLabel])},null,8,_w)])],42,Uw)),s.createElementVNode("ul",{class:s.normalizeClass(i.classList.groupOptions),"aria-label":i.ariaGroupLabel(i.localize(a[t.groupLabel])),role:"group"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.__VISIBLE__,(c,u,g)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(i.classList.option(c,a)),"data-pointed":i.isPointed(c),"data-selected":i.isSelected(c)||void 0,key:g,onMouseenter:d=>i.setPointer(c),onClick:d=>i.handleOptionClick(c),id:i.ariaOptionId(c),"aria-selected":i.isSelected(c),"aria-label":i.ariaOptionLabel(i.localize(c[t.label])),role:"option"},[s.renderSlot(i.$slots,"option",{option:c,isSelected:i.isSelected,isPointed:i.isPointed,search:i.search},()=>[s.createElementVNode("span",null,s.toDisplayString(i.localize(c[t.label])),1)])],42,Pw))),128))],10,Bw)],10,Yw))),128)):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(i.fo,(a,l,M)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(i.classList.option(a)),"data-pointed":i.isPointed(a),"data-selected":i.isSelected(a)||void 0,key:M,onMouseenter:c=>i.setPointer(a),onClick:c=>i.handleOptionClick(a),id:i.ariaOptionId(a),"aria-selected":i.isSelected(a),"aria-label":i.ariaOptionLabel(i.localize(a[t.label])),role:"option"},[s.renderSlot(i.$slots,"option",{option:a,isSelected:i.isSelected,isPointed:i.isPointed,search:i.search},()=>[s.createElementVNode("span",null,s.toDisplayString(i.localize(a[t.label])),1)])],42,Rw))),128))],10,Qw),i.noOptions?s.renderSlot(i.$slots,"nooptions",{key:0},()=>[s.createElementVNode("div",{class:s.normalizeClass(i.classList.noOptions),innerHTML:i.localize(t.noOptionsText)},null,10,Zw)]):s.createCommentVNode("v-if",!0),i.noResults?s.renderSlot(i.$slots,"noresults",{key:1},()=>[s.createElementVNode("div",{class:s.normalizeClass(i.classList.noResults),innerHTML:i.localize(t.noResultsText)},null,10,Vw)]):s.createCommentVNode("v-if",!0),t.infinite&&i.hasMore?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(i.classList.inifinite),ref:"infiniteLoader"},[s.renderSlot(i.$slots,"infinite",{},()=>[s.createElementVNode("span",{class:s.normalizeClass(i.classList.inifiniteSpinner)},null,2)])],2)):s.createCommentVNode("v-if",!0),s.renderSlot(i.$slots,"afterlist",{options:i.fo})],2),s.createCommentVNode(" Hacky input element to show HTML5 required warning "),t.required?(s.openBlock(),s.createElementBlock("input",{key:0,class:s.normalizeClass(i.classList.fakeInput),tabindex:"-1",value:i.textValue,required:""},null,10,Gw)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Native input support "),t.nativeSupport?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[t.mode=="single"?(s.openBlock(),s.createElementBlock("input",{key:0,type:"hidden",name:t.name,value:i.plainValue!==void 0?i.plainValue:""},null,8,Ww)):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(i.plainValue,(a,l)=>(s.openBlock(),s.createElementBlock("input",{type:"hidden",name:`${t.name}[]`,value:a,key:l},null,8,Hw))),128))],64)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Screen reader assistive text "),t.searchable&&i.hasSelected?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(i.classList.assist),id:i.ariaAssist,"aria-hidden":"true"},s.toDisplayString(i.ariaLabel),11,Fw)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Create height for empty input "),s.createElementVNode("div",{class:s.normalizeClass(i.classList.spacer)},null,2)],42,bw)}FM.render=$w,FM.__file="src/Multiselect.vue";const V3="",G3="",Jw=["src"],Xw={class:"list__item_text"},Kw={__name:"InputList",props:{layout:{type:String,default:"inline"},list:{type:Array,required:!0},maxHeight:{type:String,default:"200px"},labelProp:{type:String,default:"label"},valueProp:{type:String,default:"id"},canClear:{type:Boolean,required:!1,default:!0},placeholder:{type:String,required:!1,default:"Start typing..."},modelValue:{type:[Object,Array],required:!1,default:null},showAvatar:{type:Boolean,required:!1,default:!0}},emits:["update","select","deselect","clear"],setup(i,{emit:e}){const t=i;s.useCssVars(u=>({"6ec64d59":i.maxHeight}));const n=s.computed({get(){return t.modelValue},set(){}}),o=s.computed(()=>t.layout==="falldown"?"multiselect-layout-wrapper":"");function r(u){e("select",u)}function a(u){e("deselect",u)}function l(u){e("update",u)}function M(){e("clear")}function c(u){return u.profile_pic?u.profile_pic:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAR2SURBVHgBlVVdaFtlGH6+LydJ89OYtHVbf+YyhoPK5uK2G3/oIlTYhRctKApebAiCXowtDLzxIi3sUqnBiiBerF6osGl7J0idqWyD4WSZF3PzZ4tt7Y/NmnRN0yYn5/t8z9e0Ne35Wnwg5Jzzvt/7vO/7vT8MO6BnYDEuPP4TXMi4kIgyxqOrElEAZEZKZLhVHhpJBDPb2WE6wcsDZtwwXEkJGd9G7T9WRJqZ+f6RxONprUp9BDIs3CLJJM7tSLAJkg5xIT6EVSTCSEFLdPKT5ai36hqWzBVj8v+R1IFVM8y0ekcSvuwWop6BfFgaoR8kY0RSf04qRUriSh6l/AzcDY3wRtpgmWUSUhSewFYuITMFwV9MJ5iKzFgTCHfITtcWEhvW/H38NfYpViZ+UZ7Jmn920B3dZxDuPLnljOQsFmYiSY8J+53Xook734nE4v1r+P2rBMoTt1VUqzRC/ThFU85P2m7CCYKxc3bVrhNZRjDpdPHmoxnMXBmErFbgDIncza+RuzGE1QTXQ1k0fElF9OpAJcaZK+5kZuHuKCqlAraDbWzmxmWUJm5pXEH89Y8W49w0cNrBGYWlqTvbFvjTna1oigQoLQKP/ryq0eIooSFOxcCP6AxJaWkkDAEfw/uJ52GaJt658D1yhSmdGdJmJ+iOZEyrQaFeOPss9u3xKXUVHlXN8UO78U2qFx0tbuxv9eOzZDepCr0ZGlsGdUFYR3L04C50H4ugt2s/HkwXsVgqoyXUgLbdQeITtgFFEPK58VR7iFKk81dEuU7m5yWkXmtEo98Ao0jeS12FWeVo3+WnZhT48edJvNl3RTkU8nN8fKoJAWNJE5HdsJJl6SG6WVZhbsyZfuxVlSLwwbtd2NMcUM/2wReOP4Enoy2rVuhbQTRhpep25pGiwBmvZJ2EVcuD8/fewGwloIy1NftUdUlqUkn7glPKWpsblO7flTDO330FFjyORKSd4bBcY9CCYboUXFe3S9UmYmuvNeTJGRrEziTM1q/eJieLaWhAnuDbiQO12cZgLa0Ay1UI+7eyUfqjMwehWymMHHNXqxc57Y003W5aR3YrfwCXsp3KkCvgAfd7wX3073PRLAOGxztxbWqfrudtpC/R9uWrrGa/1KjS6MSXfxzFFxNdsJhXxUmOQbj8+Py35zB07xilh2kyAoom328/K6KRM740mUxtHoz2fRTmBKYfMMxXaP+wCMzcAsyHCyQLomRElayQs+y1tAVUAKnLtdW+3ke8avSRILNGZpPMjlsozlMBUI6u36Ebaz8M+OjiPUHwvc9g9KeyWkqLD13ITdpkG9OBPmcQNPrW3uti7hlYjkq3Z5iSH8vPEslCfSV1Ha7g1EucSt/Exe8krv/qrzMQeMxCUyu3d1WGutt5lW+QyXDZLPf9M26cldAODkfY99zSUU4FvL6+kdoK1xKt4dDbc3G3EUmSQhw7EDLqFSFZmvZtf2bQvm8HHeyA2FvFGPd6TlN0R0iZJj0Lq2NSZiWsLGNsjKOYvjlIbbIN/gUK8Nn86IrnuAAAAABJRU5ErkJggg==",self.location).href}return(u,g)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(o.value)},[s.createVNode(s.unref(FM),{modelValue:n.value,"onUpdate:modelValue":g[0]||(g[0]=d=>n.value=d),"can-clear":t.canClear,label:i.labelProp,mode:"tags",native:!1,object:!0,options:i.list,placeholder:t.placeholder,searchable:!0,"value-prop":i.valueProp,onChange:g[1]||(g[1]=d=>l(d)),onClear:g[2]||(g[2]=d=>M()),onDeselect:g[3]||(g[3]=d=>a(d)),onSelect:g[4]||(g[4]=d=>r(d))},{tag:s.withCtx(({option:d,handleTagRemove:y,disabled:j})=>[s.createElementVNode("div",{class:s.normalizeClass(["list__item",{"is-disabled":j}])},[t.showAvatar?(s.openBlock(),s.createElementBlock("img",{key:0,alt:"",class:"list__item_thumb",src:c(d)},null,8,Jw)):s.createCommentVNode("",!0),s.createElementVNode("p",Xw,s.toDisplayString(d[i.labelProp]),1),s.createVNode(de,{class:"list__item_icon","icon-name":"delete",size:24,onMousedown:s.withModifiers(D=>y(d,D),["prevent"])},null,8,["onMousedown"]),s.renderSlot(u.$slots,"default")],2)]),_:3},8,["modelValue","can-clear","label","options","placeholder","value-prop"])],2))}},$M=s.defineComponent({components:{DhIcon:de},props:{hasCloseButton:{type:Boolean,default:!0},hasSideBar:{type:Boolean,default:!0},hasSideBarButtonBottom:{type:Boolean,default:!0},hasHeader:{type:Boolean,default:!0},hasFooter:{type:Boolean,default:!0},hasFooterButtonRight:{type:Boolean,default:!0},hasBodyScrolling:{type:Boolean,default:!0},sideBarPosition:{type:String,default:"left"},hasCloseConfirmation:{type:Boolean,default:!1},bodyClass:{type:String,default:""},fitContent:{type:Boolean,default:!1},minHeight:{type:String,default:"600px"}},emits:["close"],mounted(){document.body.classList.add("modal-open")},unmounted(){document.body.classList.remove("modal-open")},methods:{closed(){this.$emit("close",this.hasCloseConfirmation),document.body.classList.remove("modal-open")}}}),_j=()=>{s.useCssVars(i=>({"2e7b1246":i.minHeight}))},Bj=$M.setup;$M.setup=Bj?(i,e)=>(_j(),Bj(i,e)):_j;const W3="",qw={class:"modal-content"},eS={key:0,id:"modal-sidebar",class:"modal-sidebar"},tS={key:0,id:"modalTitle",class:"modal-header"},iS={class:"modal-footer"};function nS(i,e,t,n,o,r){const a=s.resolveComponent("dh-icon");return s.openBlock(),s.createBlock(s.Transition,{name:"modal-fade"},{default:s.withCtx(()=>[s.createElementVNode("div",{class:"modal-backdrop",onMousedown:e[2]||(e[2]=(...l)=>i.closed&&i.closed(...l))},[s.createElementVNode("div",{"aria-describedby":"modalDescription","aria-labelledby":"modalTitle",class:s.normalizeClass(`
19
+ `):i}function Db(i,e){const{element:t,datasetIndex:n,index:o}=e,r=i.getDatasetMeta(n).controller,{label:a,value:l}=r.getLabelAndValue(o);return{chart:i,label:a,parsed:r.getParsed(o),raw:i.data.datasets[n].data[o],formattedValue:l,dataset:r.getDataset(),dataIndex:o,datasetIndex:n,element:t}}function lj(i,e){const t=i.chart.ctx,{body:n,footer:o,title:r}=i,{boxWidth:a,boxHeight:l}=e,M=ut(e.bodyFont),c=ut(e.titleFont),u=ut(e.footerFont),g=r.length,d=o.length,y=n.length,j=At(e.padding);let D=j.height,I=0,N=n.reduce((C,E)=>C+E.before.length+E.lines.length+E.after.length,0);if(N+=i.beforeBody.length+i.afterBody.length,g&&(D+=g*c.lineHeight+(g-1)*e.titleSpacing+e.titleMarginBottom),N){const C=e.displayColors?Math.max(l,M.lineHeight):M.lineHeight;D+=y*C+(N-y)*M.lineHeight+(N-1)*e.bodySpacing}d&&(D+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let m=0;const b=function(C){I=Math.max(I,t.measureText(C).width+m)};return t.save(),t.font=c.string,Oe(i.title,b),t.font=M.string,Oe(i.beforeBody.concat(i.afterBody),b),m=e.displayColors?a+2+e.boxPadding:0,Oe(n,C=>{Oe(C.before,b),Oe(C.lines,b),Oe(C.after,b)}),m=0,t.font=u.string,Oe(i.footer,b),t.restore(),I+=j.width,{width:I,height:D}}function fb(i,e){const{y:t,height:n}=e;return t<n/2?"top":t>i.height-n/2?"bottom":"center"}function pb(i,e,t,n){const{x:o,width:r}=n,a=t.caretSize+t.caretPadding;if(i==="left"&&o+r+a>e.width||i==="right"&&o-r-a<0)return!0}function zb(i,e,t,n){const{x:o,width:r}=t,{width:a,chartArea:{left:l,right:M}}=i;let c="center";return n==="center"?c=o<=(l+M)/2?"left":"right":o<=r/2?c="left":o>=a-r/2&&(c="right"),pb(c,i,e,t)&&(c="center"),c}function Mj(i,e,t){const n=t.yAlign||e.yAlign||fb(i,t);return{xAlign:t.xAlign||e.xAlign||zb(i,e,t,n),yAlign:n}}function mb(i,e){let{x:t,width:n}=i;return e==="right"?t-=n:e==="center"&&(t-=n/2),t}function Ab(i,e,t){let{y:n,height:o}=i;return e==="top"?n+=t:e==="bottom"?n-=o+t:n-=o/2,n}function cj(i,e,t,n){const{caretSize:o,caretPadding:r,cornerRadius:a}=i,{xAlign:l,yAlign:M}=t,c=o+r,{topLeft:u,topRight:g,bottomLeft:d,bottomRight:y}=fn(a);let j=mb(e,l);const D=Ab(e,M,c);return M==="center"?l==="left"?j+=c:l==="right"&&(j-=c):l==="left"?j-=Math.max(u,d)+o:l==="right"&&(j+=Math.max(g,y)+o),{x:mt(j,0,n.width-e.width),y:mt(D,0,n.height-e.height)}}function Ba(i,e,t){const n=At(t.padding);return e==="center"?i.x+i.width/2:e==="right"?i.x+i.width-n.right:i.x+n.left}function uj(i){return Xt([],Mi(i))}function Tb(i,e,t){return Ai(i,{tooltip:e,tooltipItems:t,type:"tooltip"})}function gj(i,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?i.override(t):i}const dj={beforeTitle:ai,title(i){if(i.length>0){const e=i[0],t=e.chart.data.labels,n=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(n>0&&e.dataIndex<n)return t[e.dataIndex]}return""},afterTitle:ai,beforeBody:ai,beforeLabel:ai,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let e=i.dataset.label||"";e&&(e+=": ");const t=i.formattedValue;return be(t)||(e+=t),e},labelColor(i){const t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:ai,afterBody:ai,beforeFooter:ai,footer:ai,afterFooter:ai};function dt(i,e,t,n){const o=i[e].call(t,n);return typeof o>"u"?dj[e].call(t,n):o}let Nj=(Zc=class extends qi{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 t=this.chart,n=this.options.setContext(this.getContext()),o=n.enabled&&t.options.animation&&n.animations,r=new cN(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=Tb(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:n}=t,o=dt(n,"beforeTitle",this,e),r=dt(n,"title",this,e),a=dt(n,"afterTitle",this,e);let l=[];return l=Xt(l,Mi(o)),l=Xt(l,Mi(r)),l=Xt(l,Mi(a)),l}getBeforeBody(e,t){return uj(dt(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:n}=t,o=[];return Oe(e,r=>{const a={before:[],lines:[],after:[]},l=gj(n,r);Xt(a.before,Mi(dt(l,"beforeLabel",this,r))),Xt(a.lines,dt(l,"label",this,r)),Xt(a.after,Mi(dt(l,"afterLabel",this,r))),o.push(a)}),o}getAfterBody(e,t){return uj(dt(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:n}=t,o=dt(n,"beforeFooter",this,e),r=dt(n,"footer",this,e),a=dt(n,"afterFooter",this,e);let l=[];return l=Xt(l,Mi(o)),l=Xt(l,Mi(r)),l=Xt(l,Mi(a)),l}_createItems(e){const t=this._active,n=this.chart.data,o=[],r=[],a=[];let l=[],M,c;for(M=0,c=t.length;M<c;++M)l.push(Db(this.chart,t[M]));return e.filter&&(l=l.filter((u,g,d)=>e.filter(u,g,d,n))),e.itemSort&&(l=l.sort((u,g)=>e.itemSort(u,g,n))),Oe(l,u=>{const g=gj(e.callbacks,u);o.push(dt(g,"labelColor",this,u)),r.push(dt(g,"labelPointStyle",this,u)),a.push(dt(g,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=l,l}update(e,t){const n=this.options.setContext(this.getContext()),o=this._active;let r,a=[];if(!o.length)this.opacity!==0&&(r={opacity:0});else{const l=go[n.position].call(this,o,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);const M=this._size=lj(this,n),c=Object.assign({},l,M),u=Mj(this.chart,n,c),g=cj(n,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:g.x,y:g.y,width:M.width,height:M.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,r&&this._resolveAnimations().update(this,r),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,o){const r=this.getCaretPosition(e,n,o);t.lineTo(r.x1,r.y1),t.lineTo(r.x2,r.y2),t.lineTo(r.x3,r.y3)}getCaretPosition(e,t,n){const{xAlign:o,yAlign:r}=this,{caretSize:a,cornerRadius:l}=n,{topLeft:M,topRight:c,bottomLeft:u,bottomRight:g}=fn(l),{x:d,y}=e,{width:j,height:D}=t;let I,N,m,b,C,E;return r==="center"?(C=y+D/2,o==="left"?(I=d,N=I-a,b=C+a,E=C-a):(I=d+j,N=I+a,b=C-a,E=C+a),m=I):(o==="left"?N=d+Math.max(M,u)+a:o==="right"?N=d+j-Math.max(c,g)-a:N=this.caretX,r==="top"?(b=y,C=b-a,I=N-a,m=N+a):(b=y+D,C=b+a,I=N+a,m=N-a),E=b),{x1:I,x2:N,x3:m,y1:b,y2:C,y3:E}}drawTitle(e,t,n){const o=this.title,r=o.length;let a,l,M;if(r){const c=bM(n.rtl,this.x,this.width);for(e.x=Ba(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline="middle",a=ut(n.titleFont),l=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,M=0;M<r;++M)t.fillText(o[M],c.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+l,M+1===r&&(e.y+=n.titleMarginBottom-l)}}_drawColorBox(e,t,n,o,r){const a=this.labelColors[n],l=this.labelPointStyles[n],{boxHeight:M,boxWidth:c}=r,u=ut(r.bodyFont),g=Ba(this,"left",r),d=o.x(g),y=M<u.lineHeight?(u.lineHeight-M)/2:0,j=t.y+y;if(r.usePointStyle){const D={radius:Math.min(c,M)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},I=o.leftForLtr(d,c)+c/2,N=j+M/2;e.strokeStyle=r.multiKeyBackground,e.fillStyle=r.multiKeyBackground,pM(e,D,I,N),e.strokeStyle=a.borderColor,e.fillStyle=a.backgroundColor,pM(e,D,I,N)}else{e.lineWidth=pe(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,e.strokeStyle=a.borderColor,e.setLineDash(a.borderDash||[]),e.lineDashOffset=a.borderDashOffset||0;const D=o.leftForLtr(d,c),I=o.leftForLtr(o.xPlus(d,1),c-2),N=fn(a.borderRadius);Object.values(N).some(m=>m!==0)?(e.beginPath(),e.fillStyle=r.multiKeyBackground,za(e,{x:D,y:j,w:c,h:M,radius:N}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),za(e,{x:I,y:j+1,w:c-2,h:M-2,radius:N}),e.fill()):(e.fillStyle=r.multiKeyBackground,e.fillRect(D,j,c,M),e.strokeRect(D,j,c,M),e.fillStyle=a.backgroundColor,e.fillRect(I,j+1,c-2,M-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){const{body:o}=this,{bodySpacing:r,bodyAlign:a,displayColors:l,boxHeight:M,boxWidth:c,boxPadding:u}=n,g=ut(n.bodyFont);let d=g.lineHeight,y=0;const j=bM(n.rtl,this.x,this.width),D=function(f){t.fillText(f,j.x(e.x+y),e.y+d/2),e.y+=d+r},I=j.textAlign(a);let N,m,b,C,E,A,O;for(t.textAlign=a,t.textBaseline="middle",t.font=g.string,e.x=Ba(this,I,n),t.fillStyle=n.bodyColor,Oe(this.beforeBody,D),y=l&&I!=="right"?a==="center"?c/2+u:c+2+u:0,C=0,A=o.length;C<A;++C){for(N=o[C],m=this.labelTextColors[C],t.fillStyle=m,Oe(N.before,D),b=N.lines,l&&b.length&&(this._drawColorBox(t,e,C,j,n),d=Math.max(g.lineHeight,M)),E=0,O=b.length;E<O;++E)D(b[E]),d=g.lineHeight;Oe(N.after,D)}y=0,d=g.lineHeight,Oe(this.afterBody,D),e.y-=r}drawFooter(e,t,n){const o=this.footer,r=o.length;let a,l;if(r){const M=bM(n.rtl,this.x,this.width);for(e.x=Ba(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=M.textAlign(n.footerAlign),t.textBaseline="middle",a=ut(n.footerFont),t.fillStyle=n.footerColor,t.font=a.string,l=0;l<r;++l)t.fillText(o[l],M.x(e.x),e.y+a.lineHeight/2),e.y+=a.lineHeight+n.footerSpacing}}drawBackground(e,t,n,o){const{xAlign:r,yAlign:a}=this,{x:l,y:M}=e,{width:c,height:u}=n,{topLeft:g,topRight:d,bottomLeft:y,bottomRight:j}=fn(o.cornerRadius);t.fillStyle=o.backgroundColor,t.strokeStyle=o.borderColor,t.lineWidth=o.borderWidth,t.beginPath(),t.moveTo(l+g,M),a==="top"&&this.drawCaret(e,t,n,o),t.lineTo(l+c-d,M),t.quadraticCurveTo(l+c,M,l+c,M+d),a==="center"&&r==="right"&&this.drawCaret(e,t,n,o),t.lineTo(l+c,M+u-j),t.quadraticCurveTo(l+c,M+u,l+c-j,M+u),a==="bottom"&&this.drawCaret(e,t,n,o),t.lineTo(l+y,M+u),t.quadraticCurveTo(l,M+u,l,M+u-y),a==="center"&&r==="left"&&this.drawCaret(e,t,n,o),t.lineTo(l,M+g),t.quadraticCurveTo(l,M,l+g,M),t.closePath(),t.fill(),o.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,n=this.$animations,o=n&&n.x,r=n&&n.y;if(o||r){const a=go[e.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=lj(this,e),M=Object.assign({},a,this._size),c=Mj(t,e,M),u=cj(e,M,c,t);(o._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=l.width,this.height=l.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(t);const o={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const a=At(t.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&l&&(e.save(),e.globalAlpha=n,this.drawBackground(r,e,o,t),$L(e,t.textDirection),r.y+=a.top,this.drawTitle(r,e,t),this.drawBody(r,e,t),this.drawFooter(r,e,t),JL(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const n=this._active,o=e.map(({datasetIndex:l,index:M})=>{const c=this.chart.getDatasetMeta(l);if(!c)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:c.data[M],index:M}}),r=!ja(n,o),a=this._positionChanged(o,t);(r||a)&&(this._active=o,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,r=this._active||[],a=this._getActiveElements(e,r,t,n),l=this._positionChanged(a,e),M=t||!ja(a,r)||l;return M&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),M}_getActiveElements(e,t,n,o){const r=this.options;if(e.type==="mouseout")return[];if(!o)return t.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const a=this.chart.getElementsAtEventForMode(e,r.mode,r,n);return r.reverse&&a.reverse(),a}_positionChanged(e,t){const{caretX:n,caretY:o,options:r}=this,a=go[r.position].call(this,e,t);return a!==!1&&(n!==a.x||o!==a.y)}},ae(Zc,"positioners",go),Zc);var jj={id:"tooltip",_element:Nj,positioners:go,afterInit(i,e,t){t&&(i.tooltip=new Nj({chart:i,options:t}))},beforeUpdate(i,e,t){i.tooltip&&i.tooltip.initialize(t)},reset(i,e,t){i.tooltip&&i.tooltip.initialize(t)},afterDraw(i){const e=i.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(i.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",t)}},afterEvent(i,e){if(i.tooltip){const t=e.replay;i.tooltip.handleEvent(e.event,t,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:(i,e)=>e.bodyFont.size,boxWidth:(i,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:dj},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const xb=(i,e,t,n)=>(typeof e=="string"?(t=i.push(e)-1,n.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function Lb(i,e,t,n){const o=i.indexOf(e);if(o===-1)return xb(i,e,t,n);const r=i.lastIndexOf(e);return o!==r?t:o}const Eb=(i,e)=>i===null?null:mt(Math.round(i),0,e);function yj(i){const e=this.getLabels();return i>=0&&i<e.length?e[i]:i}class Pa extends en{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const n=this.getLabels();for(const{index:o,label:r}of t)n[o]===r&&n.splice(o,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(be(e))return null;const n=this.getLabels();return t=isFinite(t)&&n[t]===e?t:Lb(n,e,xe(t,e),this._addedLabels),Eb(t,n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(n=0),t||(o=this.getLabels().length-1)),this.min=n,this.max=o}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,o=[];let r=this.getLabels();r=e===0&&t===r.length-1?r:r.slice(e,t+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let a=e;a<=t;a++)o.push({value:a});return o}getLabelForValue(e){return yj.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 t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}ae(Pa,"id","category"),ae(Pa,"defaults",{ticks:{callback:yj}});function bb(i,e){const t=[],{bounds:o,step:r,min:a,max:l,precision:M,count:c,maxTicks:u,maxDigits:g,includeBounds:d}=i,y=r||1,j=u-1,{min:D,max:I}=e,N=!be(a),m=!be(l),b=!be(c),C=(I-D)/(g+1);let E=Od((I-D)/j/y)*y,A,O,f,z;if(E<1e-14&&!N&&!m)return[{value:D},{value:I}];z=Math.ceil(I/E)-Math.floor(D/E),z>j&&(E=Od(z*E/j/y)*y),be(M)||(A=Math.pow(10,M),E=Math.ceil(E*A)/A),o==="ticks"?(O=Math.floor(D/E)*E,f=Math.ceil(I/E)*E):(O=D,f=I),N&&m&&r&&Gx((l-a)/r,E/1e3)?(z=Math.round(Math.min((l-a)/E,u)),E=(l-a)/z,O=a,f=l):b?(O=N?a:O,f=m?l:f,z=c-1,E=(f-O)/z):(z=(f-O)/E,Xn(z,Math.round(z),E/1e3)?z=Math.round(z):z=Math.ceil(z));const L=Math.max(wd(E),wd(O));A=Math.pow(10,be(M)?L:M),O=Math.round(O*A)/A,f=Math.round(f*A)/A;let p=0;for(N&&(d&&O!==a?(t.push({value:a}),O<a&&p++,Xn(Math.round((O+p*E)*A)/A,a,Ij(a,C,i))&&p++):O<a&&p++);p<z;++p){const h=Math.round((O+p*E)*A)/A;if(m&&h>l)break;t.push({value:h})}return m&&d&&f!==l?t.length&&Xn(t[t.length-1].value,l,Ij(l,C,i))?t[t.length-1].value=l:t.push({value:l}):(!m||f===l)&&t.push({value:f}),t}function Ij(i,e,{horizontal:t,minRotation:n}){const o=mi(n),r=(t?Math.sin(o):Math.cos(o))||.001,a=.75*e*(""+i).length;return Math.min(e/r,a)}class Ra extends en{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,t){return be(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:o,max:r}=this;const a=M=>o=t?o:M,l=M=>r=n?r:M;if(e){const M=$t(o),c=$t(r);M<0&&c<0?l(0):M>0&&c>0&&a(0)}if(o===r){let M=r===0?1:Math.abs(r*.05);l(r+M),e||a(o-M)}this.min=o,this.max=r}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:n}=e,o;return n?(o=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),t=t||11),t&&(o=Math.min(t,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const o={maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},r=this._range||this,a=bb(o,r);return e.bounds==="ticks"&&Cd(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const e=this.ticks;let t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const o=(n-t)/Math.max(e.length-1,1)/2;t-=o,n+=o}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return hM(e,this.chart.options.locale,this.options.ticks.format)}}class Za extends Ra{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ze(e)?e:0,this.max=Ze(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,n=mi(this.options.ticks.minRotation),o=(e?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,r.lineHeight/o))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}ae(Za,"id","linear"),ae(Za,"defaults",{ticks:{callback:fa.formatters.numeric}});const No=i=>Math.floor(zi(i)),tn=(i,e)=>Math.pow(10,No(i)+e);function hj(i){return i/Math.pow(10,No(i))===1}function Dj(i,e,t){const n=Math.pow(10,t),o=Math.floor(i/n);return Math.ceil(e/n)-o}function Ob(i,e){const t=e-i;let n=No(t);for(;Dj(i,e,n)>10;)n++;for(;Dj(i,e,n)<10;)n--;return Math.min(n,No(i))}function Cb(i,{min:e,max:t}){e=Dt(i.min,e);const n=[],o=No(e);let r=Ob(e,t),a=r<0?Math.pow(10,Math.abs(r)):1;const l=Math.pow(10,r),M=o>r?Math.pow(10,o):0,c=Math.round((e-M)*a)/a,u=Math.floor((e-M)/l/10)*l*10;let g=Math.floor((c-u)/Math.pow(10,r)),d=Dt(i.min,Math.round((M+u+g*Math.pow(10,r))*a)/a);for(;d<t;)n.push({value:d,major:hj(d),significand:g}),g>=10?g=g<15?15:20:g++,g>=20&&(r++,g=2,a=r>=0?1:a),d=Math.round((M+u+g*Math.pow(10,r))*a)/a;const y=Dt(i.max,d);return n.push({value:y,major:hj(y),significand:g}),n}class fj extends en{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const n=Ra.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return Ze(n)&&n>0?n:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Ze(e)?Math.max(0,e):null,this.max=Ze(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Ze(this._userMin)&&(this.min=e===tn(this.min,0)?tn(this.min,-1):tn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let n=this.min,o=this.max;const r=l=>n=e?n:l,a=l=>o=t?o:l;n===o&&(n<=0?(r(1),a(10)):(r(tn(n,-1)),a(tn(o,1)))),n<=0&&r(tn(o,-1)),o<=0&&a(tn(n,1)),this.min=n,this.max=o}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},n=Cb(t,this);return e.bounds==="ticks"&&Cd(n,this,"value"),e.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(e){return e===void 0?"0":hM(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=zi(e),this._valueRange=zi(this.max)-zi(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(zi(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}ae(fj,"id","logarithmic"),ae(fj,"defaults",{ticks:{callback:fa.formatters.logarithmic,major:{enabled:!0}}});function GM(i){const e=i.ticks;if(e.display&&i.display){const t=At(e.backdropPadding);return xe(e.font&&e.font.size,Fe.font.size)+t.height}return 0}function wb(i,e,t){return t=Se(t)?t:[t],{w:cL(i,e.string,t),h:t.length*e.lineHeight}}function pj(i,e,t,n,o){return i===n||i===o?{start:e-t/2,end:e+t/2}:i<n||i>o?{start:e-t,end:e}:{start:e,end:e+t}}function Sb(i){const e={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},t=Object.assign({},e),n=[],o=[],r=i._pointLabels.length,a=i.options.pointLabels,l=a.centerPointLabels?Xe/r:0;for(let M=0;M<r;M++){const c=a.setContext(i.getPointLabelContext(M));o[M]=c.padding;const u=i.getPointPosition(M,i.drawingArea+o[M],l),g=ut(c.font),d=wb(i.ctx,g,i._pointLabels[M]);n[M]=d;const y=zt(i.getIndexAngle(M)+l),j=Math.round(dM(y)),D=pj(j,u.x,d.w,0,180),I=pj(j,u.y,d.h,90,270);kb(t,e,y,D,I)}i.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),i._pointLabelItems=Yb(i,n,o)}function kb(i,e,t,n,o){const r=Math.abs(Math.sin(t)),a=Math.abs(Math.cos(t));let l=0,M=0;n.start<e.l?(l=(e.l-n.start)/r,i.l=Math.min(i.l,e.l-l)):n.end>e.r&&(l=(n.end-e.r)/r,i.r=Math.max(i.r,e.r+l)),o.start<e.t?(M=(e.t-o.start)/a,i.t=Math.min(i.t,e.t-M)):o.end>e.b&&(M=(o.end-e.b)/a,i.b=Math.max(i.b,e.b+M))}function vb(i,e,t){const n=i.drawingArea,{extra:o,additionalAngle:r,padding:a,size:l}=t,M=i.getPointPosition(e,n+o+a,r),c=Math.round(dM(zt(M.angle+pt))),u=Bb(M.y,l.h,c),g=Ub(c),d=_b(M.x,l.w,g);return{visible:!0,x:M.x,y:u,textAlign:g,left:d,top:u,right:d+l.w,bottom:u+l.h}}function Qb(i,e){if(!e)return!0;const{left:t,top:n,right:o,bottom:r}=i;return!(si({x:t,y:n},e)||si({x:t,y:r},e)||si({x:o,y:n},e)||si({x:o,y:r},e))}function Yb(i,e,t){const n=[],o=i._pointLabels.length,r=i.options,{centerPointLabels:a,display:l}=r.pointLabels,M={extra:GM(r)/2,additionalAngle:a?Xe/o:0};let c;for(let u=0;u<o;u++){M.padding=t[u],M.size=e[u];const g=vb(i,u,M);n.push(g),l==="auto"&&(g.visible=Qb(g,c),g.visible&&(c=g))}return n}function Ub(i){return i===0||i===180?"center":i<180?"left":"right"}function _b(i,e,t){return t==="right"?i-=e:t==="center"&&(i-=e/2),i}function Bb(i,e,t){return t===90||t===270?i-=e/2:(t>270||t<90)&&(i-=e),i}function Pb(i,e,t){const{left:n,top:o,right:r,bottom:a}=t,{backdropColor:l}=e;if(!be(l)){const M=fn(e.borderRadius),c=At(e.backdropPadding);i.fillStyle=l;const u=n-c.left,g=o-c.top,d=r-n+c.width,y=a-o+c.height;Object.values(M).some(j=>j!==0)?(i.beginPath(),za(i,{x:u,y:g,w:d,h:y,radius:M}),i.fill()):i.fillRect(u,g,d,y)}}function Rb(i,e){const{ctx:t,options:{pointLabels:n}}=i;for(let o=e-1;o>=0;o--){const r=i._pointLabelItems[o];if(!r.visible)continue;const a=n.setContext(i.getPointLabelContext(o));Pb(t,a,r);const l=ut(a.font),{x:M,y:c,textAlign:u}=r;io(t,i._pointLabels[o],M,c+l.lineHeight/2,l,{color:a.color,textAlign:u,textBaseline:"middle"})}}function zj(i,e,t,n){const{ctx:o}=i;if(t)o.arc(i.xCenter,i.yCenter,e,0,ft);else{let r=i.getPointPosition(0,e);o.moveTo(r.x,r.y);for(let a=1;a<n;a++)r=i.getPointPosition(a,e),o.lineTo(r.x,r.y)}}function Zb(i,e,t,n,o){const r=i.ctx,a=e.circular,{color:l,lineWidth:M}=e;!a&&!n||!l||!M||t<0||(r.save(),r.strokeStyle=l,r.lineWidth=M,r.setLineDash(o.dash),r.lineDashOffset=o.dashOffset,r.beginPath(),zj(i,t,a,n),r.closePath(),r.stroke(),r.restore())}function Vb(i,e,t){return Ai(i,{label:t,index:e,type:"pointLabel"})}class Va extends Ra{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=At(GM(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=Ze(e)&&!isNaN(e)?e:0,this.max=Ze(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/GM(this.options))}generateTickLabels(e){Ra.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,n)=>{const o=Ve(this.options.pointLabels.callback,[t,n],this);return o||o===0?o:""}).filter((t,n)=>this.chart.getDataVisibility(n))}fit(){const e=this.options;e.display&&e.pointLabels.display?Sb(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,o){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,o))}getIndexAngle(e){const t=ft/(this._pointLabels.length||1),n=this.options.startAngle||0;return zt(e*t+mi(n))}getDistanceFromCenterForValue(e){if(be(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(be(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const n=t[e];return Vb(this.getContext(),e,n)}}getPointPosition(e,t,n=0){const o=this.getIndexAngle(e)-pt+n;return{x:Math.cos(o)*t+this.xCenter,y:Math.sin(o)*t+this.yCenter,angle:o}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:n,right:o,bottom:r}=this._pointLabelItems[e];return{left:t,top:n,right:o,bottom:r}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const n=this.ctx;n.save(),n.beginPath(),zj(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:n,grid:o,border:r}=t,a=this._pointLabels.length;let l,M,c;if(t.pointLabels.display&&Rb(this,a),o.display&&this.ticks.forEach((u,g)=>{if(g!==0||g===0&&this.min<0){M=this.getDistanceFromCenterForValue(u.value);const d=this.getContext(g),y=o.setContext(d),j=r.setContext(d);Zb(this,y,M,a,j)}}),n.display){for(e.save(),l=a-1;l>=0;l--){const u=n.setContext(this.getPointLabelContext(l)),{color:g,lineWidth:d}=u;!d||!g||(e.lineWidth=d,e.strokeStyle=g,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,M=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),c=this.getPointPosition(l,M),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;const o=this.getIndexAngle(0);let r,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((l,M)=>{if(M===0&&this.min>=0&&!t.reverse)return;const c=n.setContext(this.getContext(M)),u=ut(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[M].value),c.showLabelBackdrop){e.font=u.string,a=e.measureText(l.label).width,e.fillStyle=c.backdropColor;const g=At(c.backdropPadding);e.fillRect(-a/2-g.left,-r-u.size/2-g.top,a+g.width,u.size+g.height)}io(e,l.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}}ae(Va,"id","radialLinear"),ae(Va,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:fa.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),ae(Va,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ae(Va,"descriptors",{angleLines:{_fallback:"grid"}});const Ga={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}},Nt=Object.keys(Ga);function mj(i,e){return i-e}function Aj(i,e){if(be(e))return null;const t=i._adapter,{parser:n,round:o,isoWeekday:r}=i._parseOpts;let a=e;return typeof n=="function"&&(a=n(a)),Ze(a)||(a=typeof n=="string"?t.parse(a,n):t.parse(a)),a===null?null:(o&&(a=o==="week"&&(Kn(r)||r===!0)?t.startOf(a,"isoWeek",r):t.startOf(a,o)),+a)}function Tj(i,e,t,n){const o=Nt.length;for(let r=Nt.indexOf(i);r<o-1;++r){const a=Ga[Nt[r]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((t-e)/(l*a.size))<=n)return Nt[r]}return Nt[o-1]}function Gb(i,e,t,n,o){for(let r=Nt.length-1;r>=Nt.indexOf(t);r--){const a=Nt[r];if(Ga[a].common&&i._adapter.diff(o,n,a)>=e-1)return a}return Nt[t?Nt.indexOf(t):0]}function Wb(i){for(let e=Nt.indexOf(i)+1,t=Nt.length;e<t;++e)if(Ga[Nt[e]].common)return Nt[e]}function xj(i,e,t){if(!t)i[e]=!0;else if(t.length){const{lo:n,hi:o}=jM(t,e),r=t[n]>=e?t[n]:t[o];i[r]=!0}}function Hb(i,e,t,n){const o=i._adapter,r=+o.startOf(e[0].value,n),a=e[e.length-1].value;let l,M;for(l=r;l<=a;l=+o.add(l,1,n))M=t[l],M>=0&&(e[M].major=!0);return e}function Lj(i,e,t){const n=[],o={},r=e.length;let a,l;for(a=0;a<r;++a)l=e[a],o[l]=a,n.push({value:l,major:!1});return r===0||!t?n:Hb(i,n,o,t)}class Wa extends en{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,t={}){const n=e.time||(e.time={}),o=this._adapter=new LE._date(e.adapters.date);o.init(t),$n(n.displayFormats,o.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:Aj(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,n=e.time.unit||"day";let{min:o,max:r,minDefined:a,maxDefined:l}=this.getUserBounds();function M(c){!a&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!l&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!l)&&(M(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&M(this.getMinMax(!1))),o=Ze(o)&&!isNaN(o)?o:+t.startOf(Date.now(),n),r=Ze(r)&&!isNaN(r)?r:+t.endOf(Date.now(),n)+1,this.min=Math.min(o,r-1),this.max=Math.max(o+1,r)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){const e=this.options,t=e.time,n=e.ticks,o=n.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const r=this.min,a=this.max,l=Jx(o,r,a);return this._unit=t.unit||(n.autoSkip?Tj(t.minUnit,this.min,this.max,this._getLabelCapacity(r)):Gb(this,l.length,t.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Wb(this._unit),this.initOffsets(o),e.reverse&&l.reverse(),Lj(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,n=0,o,r;this.options.offset&&e.length&&(o=this.getDecimalForValue(e[0]),e.length===1?t=1-o:t=(this.getDecimalForValue(e[1])-o)/2,r=this.getDecimalForValue(e[e.length-1]),e.length===1?n=r:n=(r-this.getDecimalForValue(e[e.length-2]))/2);const a=e.length<3?.5:.25;t=mt(t,0,a),n=mt(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){const e=this._adapter,t=this.min,n=this.max,o=this.options,r=o.time,a=r.unit||Tj(r.minUnit,t,n,this._getLabelCapacity(t)),l=xe(o.ticks.stepSize,1),M=a==="week"?r.isoWeekday:!1,c=Kn(M)||M===!0,u={};let g=t,d,y;if(c&&(g=+e.startOf(g,"isoWeek",M)),g=+e.startOf(g,c?"day":a),e.diff(n,t,a)>1e5*l)throw new Error(t+" and "+n+" are too far apart with stepSize of "+l+" "+a);const j=o.ticks.source==="data"&&this.getDataTimestamps();for(d=g,y=0;d<n;d=+e.add(d,l,a),y++)xj(u,d,j);return(d===n||o.bounds==="ticks"||y===1)&&xj(u,d,j),Object.keys(u).sort(mj).map(D=>+D)}getLabelForValue(e){const t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){const o=this.options.time.displayFormats,r=this._unit,a=t||o[r];return this._adapter.format(e,a)}_tickFormatFunction(e,t,n,o){const r=this.options,a=r.ticks.callback;if(a)return Ve(a,[e,t,n],this);const l=r.time.displayFormats,M=this._unit,c=this._majorUnit,u=M&&l[M],g=c&&l[c],d=n[t],y=c&&g&&d&&d.major;return this._adapter.format(e,o||(y?g:u))}generateTickLabels(e){let t,n,o;for(t=0,n=e.length;t<n;++t)o=e[t],o.label=this._tickFormatFunction(o.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,n=this.ctx.measureText(e).width,o=mi(this.isHorizontal()?t.maxRotation:t.minRotation),r=Math.cos(o),a=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:n*r+l*a,h:n*a+l*r}}_getLabelCapacity(e){const t=this.options.time,n=t.displayFormats,o=n[t.unit]||n.millisecond,r=this._tickFormatFunction(e,0,Lj(this,[e],this._majorUnit),o),a=this._getLabelSize(r),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(t=0,n=o.length;t<n;++t)e=e.concat(o[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,n;if(e.length)return e;const o=this.getLabels();for(t=0,n=o.length;t<n;++t)e.push(Aj(this,o[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Qd(e.sort(mj))}}ae(Wa,"id","time"),ae(Wa,"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 Ha(i,e,t){let n=0,o=i.length-1,r,a,l,M;t?(e>=i[n].pos&&e<=i[o].pos&&({lo:n,hi:o}=Wi(i,"pos",e)),{pos:r,time:l}=i[n],{pos:a,time:M}=i[o]):(e>=i[n].time&&e<=i[o].time&&({lo:n,hi:o}=Wi(i,"time",e)),{time:r,pos:l}=i[n],{time:a,pos:M}=i[o]);const c=a-r;return c?l+(M-l)*(e-r)/c:l}class Ej extends Wa{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Ha(t,this.min),this._tableRange=Ha(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,o=[],r=[];let a,l,M,c,u;for(a=0,l=e.length;a<l;++a)c=e[a],c>=t&&c<=n&&o.push(c);if(o.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,l=o.length;a<l;++a)u=o[a+1],M=o[a-1],c=o[a],Math.round((u+M)/2)!==c&&r.push({time:c,pos:a/(l-1)});return r}_generate(){const e=this.min,t=this.max;let n=super.getDataTimestamps();return(!n.includes(e)||!n.length)&&n.splice(0,0,e),(!n.includes(t)||n.length===1)&&n.push(t),n.sort((o,r)=>o-r)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),n=this.getLabelTimestamps();return t.length&&n.length?e=this.normalize(t.concat(n)):e=t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Ha(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Ha(this._table,n*this._tableRange+this._minPos,!0)}}ae(Ej,"id","timeseries"),ae(Ej,"defaults",Wa.defaults);const bj={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Fb={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...bj,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},$b=s.version[0]==="2"?(i,e)=>Object.assign(i,{attrs:e}):(i,e)=>Object.assign(i,e);function An(i){return s.isProxy(i)?s.toRaw(i):i}function Jb(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i;return s.isProxy(e)?new Proxy(i,{}):i}function Xb(i,e){const t=i.options;t&&e&&Object.assign(t,e)}function Oj(i,e){i.labels=e}function Cj(i,e,t){const n=[];i.datasets=e.map(o=>{const r=i.datasets.find(a=>a[t]===o[t]);return!r||!o.data||n.includes(r)?{...o}:(n.push(r),Object.assign(r,o),r)})}function Kb(i,e){const t={labels:[],datasets:[]};return Oj(t,i.labels),Cj(t,i.datasets,e),t}const qb=s.defineComponent({props:Fb,setup(i,e){let{expose:t,slots:n}=e;const o=s.ref(null),r=s.shallowRef(null);t({chart:r});const a=()=>{if(!o.value)return;const{type:c,data:u,options:g,plugins:d,datasetIdKey:y}=i,j=Kb(u,y),D=Jb(j,u);r.value=new uo(o.value,{type:c,data:D,options:{...g},plugins:d})},l=()=>{const c=s.toRaw(r.value);c&&(i.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},i.destroyDelay):(c.destroy(),r.value=null))},M=c=>{c.update(i.updateMode)};return s.onMounted(a),s.onUnmounted(l),s.watch([()=>i.options,()=>i.data],(c,u)=>{let[g,d]=c,[y,j]=u;const D=s.toRaw(r.value);if(!D)return;let I=!1;if(g){const N=An(g),m=An(y);N&&N!==m&&(Xb(D,N),I=!0)}if(d){const N=An(d.labels),m=An(j.labels),b=An(d.datasets),C=An(j.datasets);N!==m&&(Oj(D.config.data,N),I=!0),b&&b!==C&&(Cj(D.config.data,b,i.datasetIdKey),I=!0)}I&&s.nextTick(()=>{M(D)})},{deep:!0}),()=>s.h("canvas",{role:"img",ariaLabel:i.ariaLabel,ariaDescribedby:i.ariaDescribedby,ref:o},[s.h("p",{},[n.default?n.default():""])])}});function wj(i,e){return uo.register(e),s.defineComponent({props:bj,setup(t,n){let{expose:o}=n;const r=s.shallowRef(null),a=l=>{r.value=l==null?void 0:l.chart};return o({chart:r}),()=>s.h(qb,$b({ref:a},{type:i,...t}))}})}const eO=wj("bar",Ea),tO=wj("line",ba),A3="",iO={name:"MultiRangeSlider",props:{baseClassName:{type:String,default:"multi-range-slider"},min:{type:Number},max:{type:Number},minValue:{type:Number},maxValue:{type:Number},step:{type:Number,default:1},preventWheel:{type:Boolean,default:!1},ruler:{type:Boolean,default:!0},label:{type:Boolean,default:!0},labels:{type:Array},minCaption:{type:String},maxCaption:{type:String},rangeMargin:{type:Number}},data(){let i=this.labels||[],e=this.min===void 0?0:this.min,t=i.length?i.length-1:100,n=this.max===void 0?t:this.max,o=this.minValue===void 0?25:this.minValue;i.length&&this.minValue===void 0&&(o=1);let r=this.maxValue||75;if(i.length&&this.maxValue===void 0&&(r=i.length-2),n<=e)throw new Error("Invalid props min or max");if(o>r)throw new Error("Invalid props minValue or maxValue");let a=this.rangeMargin===void 0?this.step:this.rangeMargin,l=a%this.step;return l&&(a=a+this.step-l),{valueMin:o<e?e:o,valueMax:r>n?n:r,interVal:null,startX:null,mouseMoveCounter:null,barBox:null,barValue:0,rangeMarginValue:a}},methods:{onBarLeftClick(){this.valueMin-this.step>=this.minimum?this.valueMin-=this.step:this.valueMin=this.minimum},onInnerBarLeftClick(){this.valueMin+this.rangeMarginValue<this.valueMax&&(this.valueMin+=this.step)},onBarRightClick(){this.valueMax+this.step<=this.maximum?this.valueMax+=this.step:this.valueMax=this.maximum},onInnerBarRightClick(){this.valueMax-this.rangeMarginValue>this.valueMin&&(this.valueMax-=this.step)},onInputMinChange(i){let e=parseFloat(i.target.value);e<=this.valueMax-this.rangeMarginValue&&e>=this.minimum?this.valueMin=e:i.target.value=this.valueMin},onInputMaxChange(i){let e=parseFloat(i.target.value);e>=this.valueMin+this.rangeMarginValue&&e<=this.maximum?this.valueMax=e:i.target.value=this.valueMax},onLeftThumbMousedown(i){if(i.preventDefault(),this.startX=i.clientX,i.type==="touchstart")if(i.touches.length===1)this.startX=i.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMin,this.barBox=i.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onLeftThumbMousemove),document.addEventListener("mouseup",this.onLeftThumbMouseup),document.addEventListener("touchmove",this.onLeftThumbMousemove),document.addEventListener("touchend",this.onLeftThumbMouseup)},onLeftThumbMousemove(i){this.mouseMoveCounter++;let e=i.clientX;i.type==="touchmove"&&(e=i.touches[0].clientX);let n=(e-this.startX)/this.barBox.width,o=this.barValue+(this.maximum-this.minimum)*n,r=o%this.step;o-=r,o<this.minimum?o=this.minimum:o>this.valueMax-this.rangeMarginValue&&(o=this.valueMax-this.rangeMarginValue),this.valueMin=o},onLeftThumbMouseup(){document.removeEventListener("mousemove",this.onLeftThumbMousemove),document.removeEventListener("mouseup",this.onLeftThumbMouseup),document.removeEventListener("touchmove",this.onLeftThumbMousemove),document.removeEventListener("touchend",this.onLeftThumbMouseup)},onRightThumbMousedown(i){if(i.preventDefault(),this.startX=i.clientX,i.type==="touchstart")if(i.touches.length===1)this.startX=i.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMax,this.barBox=i.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onRightThumbMousemove),document.addEventListener("mouseup",this.onRightThumbMouseup),document.addEventListener("touchmove",this.onRightThumbMousemove),document.addEventListener("touchend",this.onRightThumbMouseup)},onRightThumbMousemove(i){this.mouseMoveCounter++;let e=i.clientX;i.type==="touchmove"&&(e=i.touches[0].clientX);let n=(e-this.startX)/this.barBox.width,o=this.barValue+(this.maximum-this.minimum)*n,r=o%this.step;o-=r,o<this.valueMin+this.rangeMarginValue?o=this.valueMin+this.rangeMarginValue:o>this.maximum&&(o=this.maximum),this.valueMax=o},onRightThumbMouseup(){document.removeEventListener("mousemove",this.onRightThumbMousemove),document.removeEventListener("mouseup",this.onRightThumbMouseup),document.removeEventListener("touchmove",this.onRightThumbMousemove),document.removeEventListener("touchend",this.onRightThumbMouseup)},onMouseWheel(i){if(this.preventWheel===!0||!i.shiftKey&&!i.ctrlKey)return;let e=this.step;i.deltaY<0&&(e=-e),i.shiftKey&&i.ctrlKey?this.valueMin+e>=this.minimum&&this.valueMax+e<=this.maximum&&(this.valueMin=this.valueMin+e,this.valueMax=this.valueMax+e):i.ctrlKey?(e=this.valueMax+e,e<this.valueMin+this.rangeMarginValue?e=this.valueMin+this.rangeMarginValue:e>this.maximum&&(e=this.maximum),this.valueMax=e):i.shiftKey&&(e=this.valueMin+e,e<this.minimum?e=this.minimum:e>this.valueMax-this.rangeMarginValue&&(e=this.valueMax-this.rangeMarginValue),this.valueMin=e)},triggerInput(){let i=0;this.step.toString().includes(".")&&(i=2);let e={min:this.minimum,max:this.maximum,minValue:parseFloat(this.valueMin.toFixed(i)),maxValue:parseFloat(this.valueMax.toFixed(i))};this.$emit("input",e)}},computed:{minimum(){return this.min===void 0?0:this.min},maximum(){let i=this.labels||[],e=i.length?i.length-1:100;return this.max===void 0?e:this.max},stepCount(){let i=this.labels||[];return i.length?i.length-1:Math.floor((this.maximum-this.minimum)/this.step)},subStepCount(){return(this.labels||[]).length&&this.step>1?(this.maximum-this.minimum)/this.step:0},barMin(){return(this.valueMin-this.minimum)/(this.maximum-this.minimum)*100},barMax(){return 100-(this.valueMax-this.minimum)/(this.maximum-this.minimum)*100},barMinVal(){let i=0;return this.step.toString().includes(".")&&(i=2),(this.valueMin||0).toFixed(i)},barMaxVal(){let i=0;return this.step.toString().includes(".")&&(i=2),(this.valueMax||100).toFixed(i)},scaleLabels(){let i=this.labels||[];return i.length===0&&(i=[],i.push(this.minimum),i.push(this.maximum)),i}},watch:{valueMin(){this.triggerInput()},valueMax(){this.triggerInput()},minValue(i){this.valueMin=i<this.minimum?this.minimum:i},maxValue(i){this.valueMax=i>this.maximum?this.maximum:i}},mounted(){}},nO={class:"bar"},oO=["min","max","step","value"],rO={class:"caption"},aO={class:"min-caption"},sO={class:"bar-inner"},lO=["min","max","step","value"],MO={class:"caption"},cO={class:"max-caption"},uO={key:0,class:"ruler"},gO={key:1,class:"sub-ruler"},dO={key:2,class:"labels"};function NO(i,e,t,n,o,r){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([t.baseClassName,o.rangeMarginValue===0?"zero-ranage-margin":""]),onMousewheel:e[10]||(e[10]=s.withModifiers((...a)=>r.onMouseWheel&&r.onMouseWheel(...a),["prevent","stop"]))},[s.createElementVNode("div",nO,[s.createElementVNode("div",{class:"bar-left",style:s.normalizeStyle({width:r.barMin+"%"}),onClick:e[0]||(e[0]=(...a)=>r.onBarLeftClick&&r.onBarLeftClick(...a))},null,4),s.createElementVNode("input",{class:"input-type-range input-type-range-min",type:"range",min:r.minimum,max:r.maximum,step:t.step,value:o.valueMin,onInput:e[1]||(e[1]=s.withModifiers((...a)=>r.onInputMinChange&&r.onInputMinChange(...a),["stop","prevent"]))},null,40,oO),s.createElementVNode("div",{class:"thumb thumb-left",onMousedown:e[2]||(e[2]=(...a)=>r.onLeftThumbMousedown&&r.onLeftThumbMousedown(...a)),onTouchstart:e[3]||(e[3]=(...a)=>r.onLeftThumbMousedown&&r.onLeftThumbMousedown(...a))},[s.createElementVNode("div",rO,[s.createElementVNode("span",aO,s.toDisplayString(t.minCaption||r.barMinVal),1)])],32),s.createElementVNode("div",sO,[s.createElementVNode("div",{class:"bar-inner-left",onClick:e[4]||(e[4]=(...a)=>r.onInnerBarLeftClick&&r.onInnerBarLeftClick(...a))}),s.createElementVNode("div",{class:"bar-inner-right",onClick:e[5]||(e[5]=(...a)=>r.onInnerBarRightClick&&r.onInnerBarRightClick(...a))})]),s.createElementVNode("input",{class:"input-type-range input-type-range-max",type:"range",min:r.minimum,max:r.maximum,step:t.step,value:o.valueMax,onInput:e[6]||(e[6]=s.withModifiers((...a)=>r.onInputMaxChange&&r.onInputMaxChange(...a),["stop","prevent"]))},null,40,lO),s.createElementVNode("div",{class:"thumb thumb-right",onMousedown:e[7]||(e[7]=(...a)=>r.onRightThumbMousedown&&r.onRightThumbMousedown(...a)),onTouchstart:e[8]||(e[8]=(...a)=>r.onRightThumbMousedown&&r.onRightThumbMousedown(...a))},[s.createElementVNode("div",MO,[s.createElementVNode("span",cO,s.toDisplayString(t.maxCaption||r.barMaxVal),1)])],32),s.createElementVNode("div",{class:"bar-right",style:s.normalizeStyle({width:r.barMax+"%"}),onClick:e[9]||(e[9]=(...a)=>r.onBarRightClick&&r.onBarRightClick(...a))},null,4)]),t.ruler?(s.openBlock(),s.createElementBlock("div",uO,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.stepCount,a=>(s.openBlock(),s.createElementBlock("div",{key:a,class:"ruler-rule"}))),128))])):s.createCommentVNode("",!0),r.subStepCount?(s.openBlock(),s.createElementBlock("div",gO,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.subStepCount,a=>(s.openBlock(),s.createElementBlock("div",{key:a,class:"ruler-sub-rule"}))),128))])):s.createCommentVNode("",!0),t.label?(s.openBlock(),s.createElementBlock("div",dO,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.scaleLabels,a=>(s.openBlock(),s.createElementBlock("div",{class:"label",key:a},s.toDisplayString(a),1))),128))])):s.createCommentVNode("",!0)],34)}const jO=He(iO,[["render",NO]]),T3="";uo.register(jj,_a,Pa,Za);const yO=s.defineComponent({components:{Bar:eO,MultiRangeSlider:jO},emits:["update","update:model-value"],props:{numberRange:{type:Array,default:()=>[{key:0,count:10}]},width:{type:Number,default:200},height:{type:Number,default:50},chartId:{type:String,default:"bar-chart"},datasetIdKey:{type:String,default:"label"},includeForm:{type:Boolean,default:!1},isMatch:{type:Boolean,default:!0},isExclude:{type:Boolean,default:!1},isDisable:{type:Boolean,default:!1},modelValue:{type:Object,required:!1,default:null}},data(){return{chartData:{labels:[],datasets:[{labels:"",data:[],backgroundColor:["#5ea9e5"],borderRadius:1,hoverBackgroundColor:"#e0e0e0"}]},chartOptions:{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{display:!1,grid:{display:!1},ticks:{display:!0}},y:{display:!1,grid:{display:!1},ticks:{display:!1}}}},min:0,max:this.numberRange.length-1,validated:!1,activeColor:"#5ea9e5",inactiveColor:"#e0e0e0"}},computed:{getRangeLength(){return this.numberRange.length},getFirstKey(){return this.numberRange[0].key},getLastKey(){return this.numberRange[this.getRangeLength-1].key},getMinKey(){return this.numberRange[this.min].key},getMinCaption(){return`${this.getMinKey}`},getMaxCaption(){return`${this.getMaxKey}`},getMaxKey(){return this.numberRange[this.max].key},getLastIndex(){return this.numberRange.length-1}},watch:{modelValue(i){this.max=this.numberRange.findIndex(e=>e.key==i.maxKey),this.min=this.numberRange.findIndex(e=>e.key==i.minKey)}},mounted(){this.setChartData(this.numberRange),this.isDisable&&this.missingFilter(),this.$props.modelValue&&(this.max=this.numberRange.findIndex(i=>i.key===this.$props.modelValue.maxKey),this.min=this.numberRange.findIndex(i=>i.key===this.$props.modelValue.minKey)),this.triggerChartDataUpdate()},methods:{updateRange(){const i=this.getMinKey,e=this.getMaxKey;this.$props.modelValue&&this.$emit("update:model-value",{minKey:i,maxKey:e}),this.$emit("update",{minKey:i,maxKey:e})},updateBarChart(i){const{minValue:e,maxValue:t}=i;this.min=e,this.max=t,this.isDisable||(this.isExclude?this.excludeFilter():this.matchFilter())},matchFilter(){if(!this.isDisable){var i=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<=i.length;e++)e>=this.min&&e<=this.max?this.chartData.datasets[0].backgroundColor.push(this.activeColor):this.chartData.datasets[0].backgroundColor.push(this.inactiveColor);this.triggerChartDataUpdate()}},excludeFilter(){if(!this.isDisable){var i=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let e=0;e<i.length;e++)e>=this.min&&e<=this.max?this.chartData.datasets[0].backgroundColor.push(this.inactiveColor):this.chartData.datasets[0].backgroundColor.push(this.activeColor);this.triggerChartDataUpdate()}},missingFilter(){this.validated=!this.validated;var i=this.chartData.datasets[0].data;if(this.chartData.datasets[0].backgroundColor=[],this.validated)for(let e=1;e<=i.length;e++)this.chartData.datasets[0].backgroundColor.push(this.inactiveColor);else this.isMatch&&this.matchFilter(),this.isExclude&&this.excludeFilter()},changeMin(i){let e=parseInt(i.target.value);this.min=e||0,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},changeMax(i){let e=parseInt(i.target.value);this.max=e,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},setChartData(i){let e=this.chartData.labels,t=[];for(let n=0;n<i.length;n++)e.push(i[n].key),t.push(i[n].count);this.chartData.datasets[0].data=t},triggerChartDataUpdate(){this.$nextTick(()=>{this.chartData={...this.chartData,datasets:[...this.chartData.datasets]}})}}}),x3="",IO={class:"dh-range-container"},hO={class:"bar-chart"},DO={key:0,class:"input-group-section"},fO={class:"input-group sb-input"},pO=["disabled","max","value"],zO={class:"input-group sb-input"},mO=["disabled","max","min","value"];function AO(i,e,t,n,o,r){const a=s.resolveComponent("Bar"),l=s.resolveComponent("MultiRangeSlider");return s.openBlock(),s.createElementBlock("div",IO,[s.createElementVNode("div",hO,[s.createElementVNode("div",null,[s.createVNode(a,{"chart-id":i.chartId,data:i.chartData,"dataset-id-key":i.datasetIdKey,height:i.height,options:i.chartOptions,width:i.width},null,8,["chart-id","data","dataset-id-key","height","options","width"])]),s.createVNode(l,{"base-class-name":`multi-range-slider range-slider ${i.isDisable}`,label:!1,max:i.getLastIndex,"max-caption":i.getMaxCaption,"max-value":i.max,min:0,"min-caption":i.getMinCaption,"min-value":i.min,"range-margin":0,ruler:!1,step:1,onInput:i.updateBarChart},null,8,["base-class-name","max","max-caption","max-value","min-caption","min-value","onInput"])]),i.includeForm?(s.openBlock(),s.createElementBlock("div",DO,[s.createElementVNode("div",fO,[s.createElementVNode("label",{class:s.normalizeClass(`dh-body-2 input-to ${i.validated?"disable":""}`)}," From ",2),s.createElementVNode("input",{class:"form-input text",disabled:i.validated,max:i.max,min:"1",placeholder:"From",type:"number",value:i.getMinKey,onInput:e[0]||(e[0]=M=>i.changeMin(M))},null,40,pO)]),s.createElementVNode("div",zO,[s.createElementVNode("label",{class:s.normalizeClass(`dh-body-2 input-to ${i.validated?"disable":""}`)}," To ",2),s.createElementVNode("input",{class:"form-input text",disabled:i.validated,max:i.max,min:i.min,placeholder:"To",type:"number",value:i.getMaxKey,onInput:e[1]||(e[1]=M=>i.changeMax(M))},null,40,mO)])])):s.createCommentVNode("",!0),s.renderSlot(i.$slots,"input",{},void 0,!0),s.createElementVNode("button",{class:"btn",onClick:e[2]||(e[2]=M=>i.updateRange())},"Apply")])}const Sj=He(yO,[["render",AO],["__scopeId","data-v-d1698d5f"]]),L3="",E3="",kj=i=>(s.pushScopeId("data-v-3dba4cb5"),i=i(),s.popScopeId(),i),TO={id:"dp-container"},xO=kj(()=>s.createElementVNode("div",{class:"dp__calendar_range"},[s.createElementVNode("p",null,"From"),s.createElementVNode("p",null,"To")],-1)),LO={class:"dp__multi"},EO=["value"],bO=["value"],OO=["onClick"],CO=["onClick"],wO=["onClick"],SO=["onClick"],kO=["onClick"],vO=["onClick"],QO=["onClick"],YO=["onClick"],UO=kj(()=>s.createElementVNode("div",{id:"tags",class:"dp__calendar_tags"},null,-1)),_O=He({__name:"AdvancedDatePicker",props:{numberRange:{type:Array,required:!0}},emits:["update"],setup(i,{emit:e}){const t=s.ref(["",""]),n=s.ref(null),o=s.ref(null),r=s.ref(null),a=s.ref(!1),l=s.ref([{label:"Today",range:[new Date,new Date],slot:"today"},{label:"Previous week",range:[Yg(Qg(new Date)),Qg(new Date)],slot:"previousWeek"},{label:"This week",range:[Yg(new Date),gz(new Date)],slot:"week"},{label:"Next week",range:[Nz(new Date),dz(new Date().setDate(new Date().getDate()+7))],slot:"nextWeek"},{label:"This month",range:[Qo(new Date),vo(new Date)],slot:"currentMonth"},{label:"Previous month",range:[Qo(Et(new Date,1)),vo(Et(new Date,1))],slot:"previousMonth"},{label:"Last 3 months",range:[Qo(Et(new Date,3)),vo(Et(new Date,1))],slot:"threeMonths"},{label:"Last 6 months",range:[Qo(Et(new Date,6)),vo(Et(new Date,1))],slot:"sixMonths"},{label:"Last year",range:[vI(new Date),kI(new Date)],slot:"yearly"}]),M=d=>{t.value=d,console.log(t.value),e("update",t.value)};function c(d){o.value=d.target.value,t.value=[d.target.value,n.value]}function u(d){n.value=d.target.value,t.value=[o.value,d.target.value]}s.onMounted(()=>{r.value.openMenu()});function g(){r.value.openMenu()}return(d,y)=>(s.openBlock(),s.createElementBlock("div",TO,[xO,s.createVNode(s.unref(ua),{ref_key:"datePicker",ref:r,modelValue:t.value,"onUpdate:modelValue":[y[2]||(y[2]=j=>t.value=j),M],"auto-apply":"","day-names":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"enable-time-picker":!1,"model-type":"dd/MM/yyyy","multi-calendars":"","multi-calendars-solo":"","multi-static":!1,offset:12,position:"left","preset-ranges":l.value,range:"","select-text":"Apply","text-input":"",uid:"advanced",onClosed:g},{"dp-input":s.withCtx(()=>[s.createElementVNode("div",LO,[s.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:o.value?o.value:t.value[0],onInput:y[0]||(y[0]=j=>c(j))},null,40,EO),s.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:n.value?n.value:t.value[1],onInput:y[1]||(y[1]=j=>u(j))},null,40,bO)])]),"arrow-left":s.withCtx(()=>[s.createVNode(de,{"icon-name":"previous",size:20})]),"arrow-right":s.withCtx(()=>[s.createVNode(de,{"icon-name":"next",size:20})]),"calendar-icon":s.withCtx(()=>[s.createTextVNode(" Back ")]),"clear-icon":s.withCtx(()=>[]),"action-preview":s.withCtx(()=>[]),"action-select":s.withCtx(()=>[]),previousWeek:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,OO)]))]),week:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,CO)]))]),nextWeek:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,wO)]))]),currentMonth:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,SO)]))]),previousMonth:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,kO)]))]),threeMonths:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,vO)]))]),sixMonths:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,QO)]))]),yearly:s.withCtx(({label:j,range:D,presetDateRange:I})=>[(s.openBlock(),s.createBlock(s.Teleport,{to:"#tags"},[s.createElementVNode("span",{onClick:N=>I(D)},s.toDisplayString(j),9,YO)]))]),_:1},8,["modelValue","preset-ranges"]),s.createVNode(Sj,{class:"dp__calendar_range_number","number-range":i.numberRange,steps:1},{input:s.withCtx(()=>[UO]),filter:s.withCtx(()=>[s.createVNode(hd,{data:a.value,label:"Include time",onChange:y[3]||(y[3]=j=>a.value=j)},null,8,["data"])]),_:1},8,["number-range"])]))}},[["__scopeId","data-v-3dba4cb5"]]),BO=s.defineComponent({components:{DhIcon:de},props:{mainText:{type:String,default:"Advanced"},filterMissingText:{type:String,default:"Filter Missing"},matchText:{type:String,default:"Match"},excludeText:{type:String,default:"Exclude"}},data(){return{activeFilter:!1,isFilterMissing:!1,isMatch:!1,isExclude:!1}},emits:["match","exclude","filter_missing"],mounted(){this.isMatch=!0},methods:{toggleFilter(){this.activeFilter=!this.activeFilter},matchFilter(){this.isMatch=!0,this.isExclude=!1,this.$emit("match",this.isMatch)},excludeFilter(){this.isMatch=!1,this.isExclude=!0,this.$emit("exclude",this.isExclude)},missingFilter(){this.isFilterMissing=!this.isFilterMissing,this.$emit("filter_missing",this.isFilterMissing),this.isFilterMissing&&this.isMatch?this.matchFilter():this.isFilterMissing&&this.isExclude&&this.excludeFilter()}}}),PO={class:"dh-advanced-filter-container"},RO={class:"advance_section"},ZO={key:0},VO={class:"list-none"},GO=["checked"],WO=["checked"],HO=["checked"];function FO(i,e,t,n,o,r){const a=s.resolveComponent("dh-icon");return s.openBlock(),s.createElementBlock("div",PO,[s.createElementVNode("div",RO,[s.createElementVNode("span",{class:"toggle-icon",onClick:e[0]||(e[0]=l=>i.toggleFilter())},[s.createTextVNode(s.toDisplayString(i.mainText)+" ",1),s.createVNode(a,{"icon-name":i.activeFilter?"arrow-up":"arrow-down",size:20},null,8,["icon-name"])]),i.activeFilter?(s.openBlock(),s.createElementBlock("div",ZO,[s.renderSlot(i.$slots,"default"),s.createElementVNode("ul",VO,[s.createElementVNode("li",null,[s.createElementVNode("label",null,[s.createElementVNode("input",{checked:i.isFilterMissing,name:"number_filter",type:"checkbox",onChange:e[1]||(e[1]=l=>i.missingFilter())},null,40,GO),s.createTextVNode(" "+s.toDisplayString(i.filterMissingText),1)])]),s.createElementVNode("li",null,[s.createElementVNode("label",null,[s.createElementVNode("input",{checked:i.isMatch,name:"number_filter",type:"radio",onChange:e[2]||(e[2]=l=>i.matchFilter())},null,40,WO),s.createTextVNode(" "+s.toDisplayString(i.matchText),1)]),s.createElementVNode("label",null,[s.createElementVNode("input",{checked:i.isExclude,name:"number_filter",type:"radio",onChange:e[3]||(e[3]=l=>i.excludeFilter())},null,40,HO),s.createTextVNode(" "+s.toDisplayString(i.excludeText),1)])])])])):s.createCommentVNode("",!0)])])}const $O=He(BO,[["render",FO]]),JO=["disabled"],XO={key:1,class:"prepend-icon"},KO={class:"append-icon"},qO=s.defineComponent({__name:"Button",props:{size:{type:String,required:!1,default:""},color:{type:String,required:!1,default:""},disabled:{type:Boolean,required:!1,default:!1},loading:{type:Boolean,required:!1,default:!1},icon:{type:String,required:!1,default:""}},setup(i){const e=i,t=s.computed(()=>e.size==="large"),n=s.computed(()=>e.size==="small"),o=s.computed(()=>e.color==="primary"),r=s.computed(()=>e.color==="secondary"),a=s.computed(()=>e.color==="danger"),l=s.computed(()=>e.color==="success"),M=s.computed(()=>e.color==="ghost");return(c,u)=>(s.openBlock(),s.createElementBlock("button",{class:s.normalizeClass({"dh-btn":!0,"dh-btn-primary":o.value,"dh-btn-secondary":r.value,"dh-btn-danger":a.value,"dh-btn-success":l.value,"dh-btn-ghost":M.value,"dh-btn-large":t.value,"dh-btn-small":n.value,"dh-btn-icon":i.icon,disabled:i.disabled}),disabled:i.disabled||i.loading},[i.loading?(s.openBlock(),s.createBlock(de,{key:0,class:s.normalizeClass({"loading-spinner":!0,"loading-spinner-danger":a.value,"loading-spinner-success":l.value,"loading-spinner-secondary":r.value||M.value}),"icon-name":"loader"},null,8,["class"])):s.createCommentVNode("",!0),i.loading?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("div",XO,[s.renderSlot(c.$slots,"prepend-icon",{},void 0,!0)])),i.icon?s.createCommentVNode("",!0):s.renderSlot(c.$slots,"default",{key:2},void 0,!0),i.icon&&!i.loading?(s.openBlock(),s.createBlock(de,{key:3,"icon-name":i.icon,size:24},null,8,["icon-name"])):s.createCommentVNode("",!0),s.createElementVNode("div",KO,[s.renderSlot(c.$slots,"append-icon",{},void 0,!0)])],10,JO))}}),O3="",WM=He(qO,[["__scopeId","data-v-5455ff32"]]),eC=["innerHTML"],tC=s.defineComponent({__name:"Tooltip",props:{trigger:{type:String,required:!1,default:"hover"},placement:{type:String,default:()=>"bottom",required:!1},tooltipText:{type:String,required:!0,default:()=>""},followCursor:{type:Boolean,required:!1,default:!1},offsetX:{type:Number,required:!1,default:0},offsetY:{type:Number,required:!1,default:0}},setup(i){const e=i,t=s.ref(null),n=s.ref(null),o=s.ref(!1),r=s.reactive({x:0,y:0}),a=d=>({x:d.left+window.scrollX,y:d.top+window.scrollY}),l=d=>{!t.value||!n.value||!e.tooltipText||(e.followCursor?c(d):M(),o.value=!0)},M=()=>{const d=t.value.getBoundingClientRect(),y=n.value.getBoundingClientRect();let j=a(d);switch(e.placement){case"bottom":r.x=j.x-y.width/2+d.width/2+e.offsetX,r.y=j.y+d.height+e.offsetY;break;case"top":r.x=j.x-y.width/2+d.width/2+e.offsetX,r.y=j.y-y.height-e.offsetY;break;case"left":r.x=j.x-y.width-e.offsetX,r.y=j.y+d.height/2-y.height/2-e.offsetY;break;case"right":r.x=j.x+d.width+e.offsetX,r.y=j.y+d.height/2-y.height/2-e.offsetY;break}},c=d=>{if(!n.value||!e.followCursor)return;const y=n.value.getBoundingClientRect();let j=d.clientX+window.scrollX,D=d.clientY+window.scrollY;switch(e.placement){case"bottom":r.x=j-y.width/2+e.offsetX,r.y=D+e.offsetY+25;break;case"top":r.x=j-y.width/2+e.offsetX,r.y=D-y.height-e.offsetY-15;break;case"left":r.x=j-y.width-e.offsetX-15,r.y=D-y.height/2+e.offsetY/2;break;case"right":r.x=j+e.offsetX+15,r.y=D-y.height/2+e.offsetY/2;break;default:r.x=j+e.offsetX,r.y=D+e.offsetY}},u=()=>{o.value=!1},g=s.computed(()=>({position:"absolute",left:`${r.x}px`,top:`${r.y}px`,zIndex:1e4}));return(d,y)=>{var j;return s.openBlock(),s.createElementBlock("div",{ref_key:"triggerElement",ref:t,class:"tooltip-wrapper",tabindex:"0",onClick:y[0]||(y[0]=D=>i.trigger==="click"?l(D):null),onFocusin:y[1]||(y[1]=D=>i.trigger==="focus"?l(D):null),onFocusout:y[2]||(y[2]=D=>i.trigger==="focus"?u():null),onMouseenter:y[3]||(y[3]=D=>i.trigger==="hover"?l(D):null),onMouseleave:y[4]||(y[4]=D=>i.trigger!=="focus"?u():null),onMousemove:c},[s.renderSlot(d.$slots,"default",{},void 0,!0),(s.openBlock(),s.createBlock(s.Teleport,{to:"body"},[s.createElementVNode("div",{ref_key:"tooltipElement",ref:n,class:s.normalizeClass(["tooltip",{visible:o.value,left:i.placement==="left",right:i.placement==="right",top:i.placement==="top"}]),innerHTML:(j=i.tooltipText)==null?void 0:j.replace(/\\n/g,"<br>"),style:s.normalizeStyle(g.value)},null,14,eC)]))],544)}}}),C3="",vj=He(tC,[["__scopeId","data-v-fd463e21"]]),w3="",iC={class:"copy__text"},nC=["readonly"],oC={__name:"Copiable",props:{text:{type:String,required:!0},placement:{type:String,default:"bottom"},readonly:{type:Boolean,default:!0}},setup(i){const e=i,t=s.ref(""),n=s.ref("copy text");function o(a){navigator.clipboard.writeText(a),n.value="copied !"}function r(){n.value="copy text"}return s.onMounted(()=>{t.value=e.text}),(a,l)=>(s.openBlock(),s.createElementBlock("span",iC,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":l[0]||(l[0]=M=>t.value=M),readonly:i.readonly,type:"text",onInput:r},null,40,nC),[[s.vModelText,t.value]]),s.createVNode(vj,{placement:i.placement,target:"tooltiptext","tooltip-text":n.value,trigger:"hover",onClick:l[1]||(l[1]=M=>o(t.value))},{default:s.withCtx(()=>[s.createVNode(de,{class:"copy__text_icon","icon-name":"copy",size:18})]),_:1},8,["placement","tooltip-text"])]))}},S3="",rC=s.createElementVNode("div",null,"today",-1),aC={__name:"DatePicker",props:{inline:{type:Boolean,default:!0},multiCalendars:{type:Boolean,default:!1},multiCalendarsSolo:{type:Boolean,default:!1},range:{type:Boolean,default:!1},enableTimePicker:{type:Boolean,default:!1}},emits:["update"],setup(i,{emit:e}){const t=s.ref(),n=s.ref(null),o=a=>{t.value=a,e("update",t.value)},r=s.ref([{date:ni(new Date,0),type:"dot",tooltip:[{text:"Dot with tooltip",color:"blue"}]}]);return(a,l)=>(s.openBlock(),s.createElementBlock("div",null,[s.createVNode(s.unref(ua),{ref_key:"datePicker",ref:n,modelValue:t.value,"onUpdate:modelValue":[l[0]||(l[0]=M=>t.value=M),o],"day-names":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"enable-time-picker":i.enableTimePicker,format:"MM/dd/yyyy",inline:i.inline,markers:r.value,"month-name-format":"short","multi-calendars":i.multiCalendars,"multi-calendars-solo":i.multiCalendars&i.multiCalendarsSolo,offset:12,placeholder:"MM/DD/YYYY",range:i.range||i.multiCalendars,"select-text":"Apply","text-input":"",uid:"base"},{"arrow-left":s.withCtx(()=>[s.createVNode(de,{"icon-name":"previous",size:20})]),"arrow-right":s.withCtx(()=>[s.createVNode(de,{"icon-name":"next",size:20})]),"calendar-icon":s.withCtx(()=>[s.createTextVNode(" Back ")]),"clear-icon":s.withCtx(()=>[]),"action-preview":s.withCtx(()=>[]),"marker-tooltip":s.withCtx(()=>[rC]),_:1},8,["modelValue","enable-time-picker","inline","markers","multi-calendars","multi-calendars-solo","range"])]))}},sC=["src"],lC={key:3,class:"menu-item-text-wrapper"},MC=s.defineComponent({__name:"DropdownMenuItem",props:{item:{type:Object,required:!0},textEllipsisStyle:{type:String,required:!1,default:"none",validator:i=>["none","ellipsis","fit-content"].includes(i)},iconSize:{type:Number,required:!1,default:24},maxWidth:{type:String,required:!1,default:"15rem"}},setup(i){const e=i;s.useCssVars(o=>({"2c811a7a":i.maxWidth}));const t=s.ref(e.item);function n(){t.value.iconUrl=void 0,t.value.iconName="deskHeroLogo"}return(o,r)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[t.value.iconUrl?(s.openBlock(),s.createElementBlock("img",{key:0,alt:"icon image",class:"icon icon-url",src:t.value.iconUrl,onError:n},null,40,sC)):s.createCommentVNode("",!0),!t.value.iconUrl&&t.value.iconName?(s.openBlock(),s.createBlock(de,s.mergeProps({key:1,class:"icon"},{...t.value,size:e.iconSize}),null,16)):s.createCommentVNode("",!0),t.value.subText?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(["dh-body-2",i.textEllipsisStyle])},s.toDisplayString(t.value.text),3)),t.value.subText?(s.openBlock(),s.createElementBlock("div",lC,[s.createElementVNode("span",{class:s.normalizeClass(["dh-body-1",i.textEllipsisStyle])},s.toDisplayString(t.value.text),3),s.createElementVNode("span",{class:s.normalizeClass(["dh-body-4-medium",i.textEllipsisStyle])},s.toDisplayString(t.value.subText),3)])):s.createCommentVNode("",!0),t.value.isSelected?(s.openBlock(),s.createBlock(de,{key:4,class:"icon-blue icon-accept","icon-name":"accept",size:16})):s.createCommentVNode("",!0)],64))}}),k3="",Qj=He(MC,[["__scopeId","data-v-f6001491"]]),cC=["data-e2e","onClick"],uC=s.defineComponent({__name:"DropdownMenu",props:{items:{type:Object,required:!0},textEllipsisStyle:{type:String,required:!1,default:"none",validator:i=>["none","ellipsis","fit-content"].includes(i)},iconSize:{type:Number,required:!1,default:24},closeOnClickOutside:{type:Boolean,required:!1,default:!0},zIndex:{type:Number,required:!1,default:100},closeOnItemSelected:{type:Boolean,required:!1,default:!0},width:{type:String,required:!1,default:"100%"},minWidth:{type:String,required:!1,default:"10rem"},maxWidth:{type:String,required:!1,default:"15rem"}},emits:["itemSelected","close"],setup(i,{emit:e}){const t=i;s.useCssVars(r=>({"6b3ce24d":i.minWidth,"206ac8ad":i.width})),s.onMounted(()=>{document.addEventListener("click",r=>{n(r)})});function n(r){const a=r.target,l=document.querySelector("[data-id='dropdown-menu']");l&&!l.contains(r.target)&&!a.classList.contains("dropdown-toggle")&&t.closeOnClickOutside&&e("close")}function o(r){e("itemSelected",r),t.closeOnItemSelected&&e("close")}return(r,a)=>{const l=s.resolveComponent("router-link");return s.openBlock(),s.createElementBlock("div",{class:"dropdown-menu","data-id":"dropdown-menu",style:s.normalizeStyle({"z-index":t.zIndex})},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.items,M=>(s.openBlock(),s.createElementBlock("div",{key:M.iconName,class:"menu-item","data-e2e":M.dataE2eTag,onClick:c=>o(M)},[M.url?(s.openBlock(),s.createBlock(l,{key:0,class:s.normalizeClass({"center-vertical":!0,disabled:M.disabled}),to:{path:M.url}},{default:s.withCtx(()=>[s.createVNode(Qj,{"icon-size":i.iconSize,item:M,"max-width":i.maxWidth,"text-ellipsis-style":i.textEllipsisStyle},null,8,["icon-size","item","max-width","text-ellipsis-style"])]),_:2},1032,["class","to"])):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass({"center-vertical":!0,disabled:M.disabled})},[s.createVNode(Qj,{"icon-size":i.iconSize,item:M,"max-width":i.maxWidth,"text-ellipsis-style":i.textEllipsisStyle},null,8,["icon-size","item","max-width","text-ellipsis-style"])],2))],8,cC))),128))],4)}}}),v3="",gC=He(uC,[["__scopeId","data-v-4ffac438"]]),dC={key:0,class:"invalid-feedback"},NC=s.defineComponent({__name:"Error",props:{errors:{type:Object,required:!1,default:void 0}},setup(i){const e=i;return(t,n)=>{var o;return s.unref(e).errors&&((o=s.unref(e).errors)==null?void 0:o.length)>0?(s.openBlock(),s.createElementBlock("div",dC,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.errors,r=>(s.openBlock(),s.createElementBlock("span",{key:r},s.toDisplayString(r),1))),128))])):s.createCommentVNode("",!0)}}}),Q3="",jC={class:"dh-body-1-medium"},yC={key:1,class:"wrapper"},IC={class:"dh-body-1-medium"},hC={class:"panel-icon-wrapper"},DC=s.defineComponent({__name:"ExpansionPanel",props:{title:{type:String,default:"Advanced"},isAdvancedSettingsOpen:{type:Boolean,default:!1},type:{type:String,default:"mini"}},setup(i){const e=i,t=s.ref(!1),n=s.ref(null),o=s.ref(0);s.watch(()=>e.isAdvancedSettingsOpen,l=>{t.value!==l&&r()});function r(){if(e.type==="regular"){a();return}t.value=!t.value}function a(){t.value?(o.value=0,setTimeout(()=>{t.value=!1},300)):(t.value=!0,s.nextTick(()=>{n.value&&(o.value=n.value.scrollHeight)}))}return s.onMounted(()=>{t.value!==e.isAdvancedSettingsOpen&&r()}),(l,M)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[e.type==="mini"?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[s.createElementVNode("div",{class:s.normalizeClass(["advanced-panel-header clickable",{opened:t.value,closed:!t.value}]),"data-e2e":"expansion-panel-button",onClick:M[0]||(M[0]=c=>r())},[s.createElementVNode("h4",jC,s.toDisplayString(i.title),1),s.createVNode(de,{class:"icon","icon-name":t.value?"arrow-up":"arrow-down",size:24},null,8,["icon-name"])],2),t.value?s.renderSlot(l.$slots,"content",{key:0},()=>[s.createTextVNode(" Content ")],!0):s.createCommentVNode("",!0)],64)):s.createCommentVNode("",!0),e.type==="regular"?(s.openBlock(),s.createElementBlock("div",yC,[s.createElementVNode("button",{class:"panel-button",onClick:M[1]||(M[1]=c=>r())},[s.createElementVNode("h4",IC,s.toDisplayString(i.title),1),s.createElementVNode("div",hC,[s.createVNode(de,{class:"panel-icon","icon-name":t.value?"minus":"plus",size:24},null,8,["icon-name"])])]),t.value?(s.openBlock(),s.createElementBlock("div",{key:0,ref_key:"contentRef",ref:n,class:"panel",style:s.normalizeStyle({height:o.value>0?o.value+"px":0})},[s.renderSlot(l.$slots,"content",{},void 0,!0)],4)):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],64))}}),Y3="",fC=He(DC,[["__scopeId","data-v-b1a45cd3"]]),U3="",pC=s.createElementVNode("label",{for:"upload_pdf"},[s.createTextVNode(" Drag and drop file or "),s.createElementVNode("span",{id:"upload"},"browse")],-1),zC={key:0,class:"file__upload_items"},mC={class:"file__upload_list_item"},AC={class:"file__upload_list_item_label"},TC=["title"],xC=s.createElementVNode("br",null,null,-1),LC=["href"],EC={key:1,class:"file__upload_items"},bC={class:"file__upload_list_item"},OC={class:"file__upload_list_item_label"},CC=["title"],wC={key:0,class:"label__antivirus"},SC={key:1,class:"label__antivirus label__antivirus--failed"},kC={key:2,class:"label__antivirus label__antivirus--detected"},vC=s.createElementVNode("br",null,null,-1),QC={key:3},YC={key:4},UC={key:0},_C=["value"],BC=["href"],PC={key:2,class:"file__upload_placeholder"},RC={key:3,class:"file__upload_action"},ZC=s.createElementVNode("button",{class:"file__upload_action_cancel"},"Cancel",-1),VC={__name:"FileUpload",props:{fileList:{type:Array,required:!1,default:()=>[]},fileFormats:{type:Array,required:!1,default:()=>[".pdf",".csv",".doc",".jpeg",".jpg",".mp4",".png",".txt",".xls"]},uploadProgress:{type:Array,required:!0},errorOccurred:{type:Array,required:!0},virusCheck:{type:Array,required:!0},modelValue:{type:FileList,required:!1,default:void 0},inline:{type:Boolean,required:!1,default:!1},large:{type:Boolean,required:!1,default:!1},errorMessage:{type:String,required:!1,default:"an error occurred while uploading"},fileSaved:{type:Boolean,required:!1,default:!1},virusCheckText:{type:String,required:!1,default:"Antivirus check ..."},virusCheckFailedText:{type:String,required:!1,default:"Antivirus check failed"},virusDetectedText:{type:String,required:!1,default:"Virus detected"},deleteConfirmationText:{type:String,required:!1,default:"Are you sure you want to delete it permanently? this action will be irreversible"},zIndex:{type:Number,required:!1,default:99},fieldIndex:{type:Number,required:!1,default:0}},emits:["update:modelValue","reload"],setup(i,{emit:e}){const t=i;s.watch(t.uploadProgress,async A=>{if(t.inline){const O=r.value.length;A.slice(0,O).every(f=>f==100)&&e("update:modelValue",r.value,a.value)}});const n=s.ref(null),o=s.ref(!1),r=s.ref([]),a=s.ref([]),l=s.ref([".pdf",".csv",".doc",".jpeg",".jpg",".mp4",".png",".txt",".xls"]);function M(A,O=2){if(!+A)return"0 Bytes";const f=1024,z=O<0?0:O,L=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],p=Math.floor(Math.log(A)/Math.log(f));return`${parseFloat((A/Math.pow(f,p)).toFixed(z))} ${L[p]}`}function c(A,O=2){if(!+A)return"0 KB";const f=1024,z=O<0?0:O,L=["KB","MB","GB","TB","PB","EB","ZB","YB"],p=Math.floor(Math.log(A)/Math.log(f));return`${parseFloat((A/Math.pow(f,p)).toFixed(z))} ${L[p]}`}function u(A){return l.value.includes(d(A))?d(A).slice(1):"unknown"}function g(A){const O=A.lastIndexOf(".");let f=A.slice(0,O);return f.length<=19?f:f.slice(0,20)+"... "}function d(A){return A.replace(/.*(?=\.)/g,"")}function y(A){A.stopPropagation();for(let O=0;O<n.value.files.length;O++){const f=n.value.files[O];r.value.push(f)}r.value&&(o.value=!0),e("update:modelValue",r.value,a.value,t.fieldIndex)}function j(A){A.stopPropagation(),A.dataTransfer.dropEffect="copy"}function D(A){A.stopPropagation(),o.value=!0;for(let O=0;O<A.dataTransfer.files.length;O++){const f=A.dataTransfer.files[O];r.value.push(f)}e("update:modelValue",r.value,a.value,t.fieldIndex)}function I(A){window.confirm(t.deleteConfirmationText)&&b(A)}function N(A){window.confirm(t.deleteConfirmationText)&&m(A)}function m(A){a.value.push(A),e("update:modelValue",r.value,a.value,t.fieldIndex)}function b(A){const O=new DataTransfer;for(let f=0;f<r.value.length;f++){const z=r.value[f];A!==f&&O.items.add(z)}r.value=O.files,r.value.length==0&&(o.value=!1)}function C(A){return URL.createObjectURL(A)}function E(A){A.preventDefault(),e("reload")}return(A,O)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["file__upload",{file__upload_box:!i.inline,file__upload_large:i.large&&i.inline}])},[s.createElementVNode("div",{class:"file__upload_btn",onDragover:O[1]||(O[1]=s.withModifiers(f=>j(f),["prevent"])),onDrop:O[2]||(O[2]=s.withModifiers(f=>D(f),["prevent"]))},[s.createVNode(de,{class:"file__upload_btn_icon","icon-name":"upload",size:24}),pC,s.createElementVNode("input",{id:"upload_pdf",ref_key:"upload",ref:n,enctype:"multipart/form-data",multiple:"",name:"file",type:"file",onInput:O[0]||(O[0]=f=>y(f))},null,544)],32),i.fileList.length?(s.openBlock(),s.createElementBlock("div",zC,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.fileList,f=>(s.openBlock(),s.createElementBlock("div",{key:f.id,class:s.normalizeClass(["file__upload_list",i.inline?"":"file__upload_list_box"])},[s.createVNode(de,{"icon-name":"file-"+u(f.label),size:40},null,8,["icon-name"]),s.createElementVNode("div",mC,[s.createElementVNode("div",AC,[s.createElementVNode("div",null,[s.createElementVNode("span",{title:f.label},s.toDisplayString(g(f.label))+s.toDisplayString(d(f.label)),9,TC),xC,s.createElementVNode("span",null,s.toDisplayString(c(f.size_kb)),1)])])]),s.createElementVNode("a",{class:"file__upload_list_download",href:f.download_url,target:"_blank"},[s.createVNode(de,{class:"file__upload_list_download_icon","icon-name":"download",size:24})],8,LC),s.createVNode(de,{class:"file__upload_list_delete","icon-name":"delete",size:24,onClick:z=>N(f.id)},null,8,["onClick"])],2))),128))])):s.createCommentVNode("",!0),o.value?(s.openBlock(),s.createElementBlock("div",EC,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(r.value,(f,z)=>(s.openBlock(),s.createElementBlock("div",{key:z,class:s.normalizeClass(["file__upload_list",i.inline?"":"file__upload_list_box"])},[s.createVNode(de,{class:s.normalizeClass(i.errorOccurred[z]?"file__upload_list_icon":""),"icon-name":"file-"+u(f.name),size:40},null,8,["class","icon-name"]),t.uploadProgress[z]==100&&i.fileSaved&&!i.errorOccurred[z]&&i.virusCheck[z]=="loading"?(s.openBlock(),s.createBlock(de,{key:0,class:"file__upload_list_icon_sub file__upload_list_icon_sub--loading","icon-name":"states",size:20,style:s.normalizeStyle({"z-index":t.zIndex})},null,8,["style"])):s.createCommentVNode("",!0),t.uploadProgress[z]==100&&i.fileSaved&&i.virusCheck[z]=="failed"?(s.openBlock(),s.createBlock(de,{key:1,class:"file__upload_list_icon_sub","icon-name":"warning",size:20,style:s.normalizeStyle({"z-index":t.zIndex})},null,8,["style"])):s.createCommentVNode("",!0),t.uploadProgress[z]==100&&i.fileSaved&&i.virusCheck[z]=="detected"?(s.openBlock(),s.createBlock(de,{key:2,class:"file__upload_list_icon_sub","icon-name":"danger",size:20,style:s.normalizeStyle({"z-index":t.zIndex})},null,8,["style"])):s.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[z]?(s.openBlock(),s.createBlock(de,{key:3,class:"file__upload_list_icon_sub","icon-name":"error",size:20,style:s.normalizeStyle({"z-index":t.zIndex})},null,8,["style"])):s.createCommentVNode("",!0),s.createElementVNode("div",bC,[s.createElementVNode("div",OC,[s.createElementVNode("div",null,[s.createElementVNode("span",{title:f.name},s.toDisplayString(g(f.name))+s.toDisplayString(d(f.name)),9,CC),t.uploadProgress[z]==100&&i.fileSaved&&!i.errorOccurred[z]&&i.virusCheck[z]=="loading"?(s.openBlock(),s.createElementBlock("span",wC,[s.createTextVNode(s.toDisplayString(i.virusCheckText)+" ",1),s.createVNode(de,{class:"file__upload_list_icon_sub--loading","icon-name":"processing",size:18})])):s.createCommentVNode("",!0),t.uploadProgress[z]==100&&i.fileSaved&&i.virusCheck[z]=="failed"?(s.openBlock(),s.createElementBlock("span",SC,s.toDisplayString(i.virusCheckFailedText),1)):s.createCommentVNode("",!0),t.uploadProgress[z]==100&&i.fileSaved&&i.virusCheck[z]=="detected"?(s.openBlock(),s.createElementBlock("span",kC,s.toDisplayString(i.virusDetectedText),1)):s.createCommentVNode("",!0),vC,i.fileSaved&&!i.errorOccurred[z]||!i.errorOccurred[z]&&i.virusCheck[z]?(s.openBlock(),s.createElementBlock("span",QC,s.toDisplayString(M(f.size)),1)):s.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[z]?(s.openBlock(),s.createElementBlock("span",YC,s.toDisplayString(i.errorMessage),1)):s.createCommentVNode("",!0)]),i.fileSaved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",UC,s.toDisplayString(t.uploadProgress[z])+"%",1))]),i.fileSaved?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("progress",{key:0,id:"file",max:"100",value:t.uploadProgress[z]},s.toDisplayString(t.uploadProgress[z])+"% ",9,_C))]),i.fileSaved&&!i.virusCheck[z]&&!i.errorOccurred[z]?(s.openBlock(),s.createElementBlock("a",{key:4,class:"file__upload_list_download",href:C(f),target:"_blank"},[s.createVNode(de,{class:"file__upload_list_download_icon","icon-name":"download",size:24})],8,BC)):s.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[z]?(s.openBlock(),s.createElementBlock("a",{key:5,class:"file__upload_list_retry",onClick:O[3]||(O[3]=L=>E(L))},[s.createVNode(de,{class:"file__upload_list_retry_icon","icon-name":"retry",size:24})])):s.createCommentVNode("",!0),t.uploadProgress[z]!==100?(s.openBlock(),s.createBlock(de,{key:6,class:"file__upload_list_delete","icon-name":"close",size:24,onClick:L=>b(z)},null,8,["onClick"])):(s.openBlock(),s.createBlock(de,{key:7,class:"file__upload_list_delete","icon-name":"delete",size:24,onClick:L=>I(z)},null,8,["onClick"]))],2))),128))])):s.createCommentVNode("",!0),!o.value&&!i.inline&&!i.fileList.length?(s.openBlock(),s.createElementBlock("div",PC," No file selected ")):s.createCommentVNode("",!0),!i.inline&&!i.fileSaved?(s.openBlock(),s.createElementBlock("div",RC,[ZC,s.createElementVNode("button",{class:s.normalizeClass(["file__upload_action_done",o.value&&!i.fileSaved?"file__upload_action_done--active":""]),onClick:O[4]||(O[4]=(...f)=>A.saveFile&&A.saveFile(...f))}," Done ",2)])):s.createCommentVNode("",!0)],2))}},GC=s.defineComponent({components:{DhIcon:de},props:{title:{type:String,required:!1,default:""},iconName:{type:String,required:!1,default:"default"},iconUrl:{type:String,required:!1,default:""},text:{type:String,required:!0},textPosition:{type:String,default:"right",validator:i=>["right","left"].includes(i)},labelKlass:{type:String,required:!1,default:"dh-body-2"},size:{type:Number,required:!1,default:18},hideText:{type:Boolean,required:!1,default:!1},hasBackground:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1,default:!1},activeOnHover:{type:Boolean,required:!1,default:!1},textEllipsis:{type:Boolean,required:!1,default:!1},isDanger:{type:Boolean,required:!1,default:!1}},emits:["error"],methods:{emitError(){this.$emit("error")}}}),_3="",WC=["src","title"];function HC(i,e,t,n,o,r){const a=s.resolveComponent("DhIcon");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["icon-with-text",{"active-hover":i.activeOnHover,active:i.active,danger:i.isDanger,"no-background":!i.hasBackground,reverse:i.textPosition==="left"}])},[i.iconUrl?(s.openBlock(),s.createElementBlock("img",{key:0,alt:"icon image",class:"icon-with-text-icon icon-url",src:i.iconUrl,title:i.title,onError:e[0]||(e[0]=l=>i.emitError())},null,40,WC)):s.createCommentVNode("",!0),i.iconUrl?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(a,s.mergeProps({key:1,class:"icon-with-text-icon icon-3"},{iconName:i.iconName,size:i.size,title:i.title}),null,16)),i.hideText?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",{key:2,class:s.normalizeClass(["",`icon-with-text-label ${i.labelKlass} ${i.textEllipsis?"text-ellipsis":""}`])},s.toDisplayString(i.text),3))],2)}const Yj=He(GC,[["render",HC],["__scopeId","data-v-857fab4c"]]),FC=["placeholder","value"],$C=s.defineComponent({__name:"Input",props:{placeholder:{type:String,required:!1,default:"Placeholder"},error:{type:Boolean,required:!1,default:!1},success:{type:Boolean,required:!1,default:!1},modelValue:{type:String,required:!1,default:""}},emits:["update:modelValue"],setup(i,{emit:e}){function t(n){const o=n.target,r=o==null?void 0:o.value;e("update:modelValue",r)}return(n,o)=>(s.openBlock(),s.createElementBlock("input",{class:s.normalizeClass(["form-input",{error:i.error,success:i.success}]),placeholder:i.placeholder,value:i.modelValue,onInput:o[0]||(o[0]=r=>t(r))},null,42,FC))}}),B3="",JC=He($C,[["__scopeId","data-v-9fa01020"]]),P3="",XC={class:"input__dropdown"},KC=["placeholder","value"],qC={class:"input__dropdown_second"},ew=["tabindex"],tw=["onClick"],iw=["onClick"],nw={key:2,class:"button__clear"},Uj={__name:"InputDropdown",props:{options:{type:Array,required:!0},labelProp:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"id"},icon:{type:String,required:!0},placeholderInput:{type:String,required:!1,default:"Enter value"},tabindex:{type:Number,required:!1,default:0},inputValue:{type:String,required:!1,default:""},inputWidth:{type:String,required:!1,default:"75%"},selectedOption:{type:Object,required:!1,default:null},isClearable:{type:Boolean,required:!1,default:!1}},emits:["update","clear"],setup(i,{emit:e}){const t=i,n=s.ref(0),o=s.ref(""),r=s.ref(!1),a=s.ref(""),l=s.computed(()=>o.value.length>20?o.value.substring(0,17)+"...":o.value);s.onMounted(()=>{t.inputValue&&(a.value.value=t.inputValue),t.selectedOption&&(n.value=g(t.selectedOption)),u()}),s.watch(()=>t.selectedOption,d=>{d?n.value=g(d):n.value=0,u()},{deep:!0});function M(){e("update",a.value.value,t.options[n.value])}function c(){e("clear")}function u(){o.value=t.options[n.value][t.labelProp]}function g(d){return t.options.findIndex(y=>y[t.valueProp]===d[t.valueProp])}return(d,y)=>(s.openBlock(),s.createElementBlock("div",XC,[s.createElementVNode("input",{ref_key:"name",ref:a,class:"input__dropdown_text",placeholder:i.placeholderInput,style:s.normalizeStyle({width:i.inputWidth}),type:"text",value:i.inputValue,onInput:M},null,44,KC),s.createElementVNode("div",qC,[s.createVNode(de,{"icon-name":i.icon,size:18},null,8,["icon-name"]),s.createElementVNode("div",{class:"custom__select",tabindex:i.tabindex,onBlur:y[1]||(y[1]=j=>r.value=!1)},[s.createElementVNode("div",{class:s.normalizeClass(["custom__select_selected",{"custom__select--open":r.value}]),onClick:y[0]||(y[0]=j=>r.value=!r.value)},s.toDisplayString(l.value),3),typeof i.options[0]=="object"?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["custom__select_items",{"custom__select--hide":!r.value}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.options,(j,D)=>(s.openBlock(),s.createElementBlock("div",{key:D,onClick:I=>{o.value=j[i.labelProp],n.value=D,r.value=!1,M()}},s.toDisplayString(j[i.labelProp]),9,tw))),128))],2)):s.createCommentVNode("",!0),typeof i.options[0]=="string"?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["custom__select_items",{"custom__select--hide":!r.value}])},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.options,(j,D)=>(s.openBlock(),s.createElementBlock("div",{key:D,onClick:I=>{o.value=j,n.value=D,r.value=!1,M()}},s.toDisplayString(j),9,iw))),128))],2)):s.createCommentVNode("",!0),t.isClearable?(s.openBlock(),s.createElementBlock("div",nw,[s.createVNode(WM,{color:"ghost",icon:"close",onClick:c})])):s.createCommentVNode("",!0)],40,ew)])]))}},R3="",ow={class:"input-group-multiple"},rw={class:"input-label"},aw={__name:"InputDropdownMultiple",props:{title:{type:String,required:!1,default:"label"},labelProp:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"id"},icon:{type:String,required:!0},placeholderInput:{type:String,required:!1,default:"Enter value"},tabindex:{type:Number,required:!1,default:0},inputWidth:{type:String,required:!1,default:"75%"},value:{type:Array,required:!0},options:{type:Array,required:!0}},emits:["update"],setup(i,{emit:e}){const t=i,n=s.reactive(t.value);function o(l,M,c){n&&(n[l].input=M,n[l].selectedOption=c,e("update",n))}function r(l){n.length>1&&(n.splice(l,1),e("update",n))}function a(){n&&n.push({input:null,selectedOption:null})}return(l,M)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",ow,[s.createElementVNode("label",rw,s.toDisplayString(i.title),1),s.createElementVNode("button",{class:"btn btn-secondary btn-multiple",onClick:a},[s.createVNode(de,{"icon-name":"plus",size:24})])]),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n,(c,u)=>(s.openBlock(),s.createBlock(Uj,{key:u,icon:t.icon,"input-value":c.input,"input-width":t.inputWidth,"is-clearable":"","label-prop":t.labelProp,options:t.options,"placeholder-input":t.placeholderInput,"selected-option":c.selectedOption,tabindex:t.tabindex,"value-prop":t.valueProp,onClear:g=>r(u),onUpdate:(g,d,y)=>o(u,g,d)},null,8,["icon","input-value","input-width","label-prop","options","placeholder-input","selected-option","tabindex","value-prop","onClear","onUpdate"]))),128))],64))}},Z3="",sw=["data-e2e","placeholder","value"],lw={key:1,class:"input__group_content"},Mw=["data-e2e","placeholder","value"],cw={key:2,class:"input__group"},uw=["data-e2e","placeholder","type","value"],gw={__name:"InputGroup",props:{modelValue:{type:[String,Number],default:""},inputType:{type:String,default:"text",required:!0},iconName:{type:String,required:!1,default:""},sideContent:{type:String,required:!1,default:""},widthProp:{type:String,default:"200px",required:!1},heightProp:{type:String,default:"30px",required:!1},direction:{type:String,default:"right",required:!1},placeholder:{type:String,default:"type here",required:!1},e2e:{type:String,default:"",required:!1}},emits:["update:modelValue"],setup(i){const e=i;s.useCssVars(n=>({"52c3921b":t.value,"1745b0d0":i.widthProp,ec9c60fa:i.heightProp}));const t=s.ref("row");return s.onMounted(()=>{e.direction=="left"&&(t.value="row-reverse")}),(n,o)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[i.inputType=="multi-line"?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["text__area",i.direction=="left"?"text__area--left":"text__area--right"])},[s.createElementVNode("textarea",{class:"text__area_field",cols:"30","data-e2e":i.e2e,placeholder:i.placeholder,rows:"10",value:i.modelValue,onInput:o[0]||(o[0]=r=>n.$emit("update:modelValue",r.target.value))},null,40,sw),i.direction=="left"&&i.iconName?(s.openBlock(),s.createBlock(de,{key:0,class:"text__area_icon text__area_icon--left","icon-name":i.iconName},null,8,["icon-name"])):s.createCommentVNode("",!0),i.direction=="right"&&i.iconName?(s.openBlock(),s.createBlock(de,{key:1,class:"text__area_icon text__area_icon--right","icon-name":i.iconName},null,8,["icon-name"])):s.createCommentVNode("",!0)],2)):s.createCommentVNode("",!0),i.inputType=="text"&&i.sideContent?(s.openBlock(),s.createElementBlock("div",lw,[s.createElementVNode("input",{class:s.normalizeClass(["form-input",i.direction=="left"?"form-input--left":"form-input--right"]),"data-e2e":i.e2e,placeholder:i.placeholder,value:i.modelValue,onInput:o[1]||(o[1]=r=>n.$emit("update:modelValue",r.target.value))},null,42,Mw),s.createElementVNode("span",{class:s.normalizeClass(["form-span",i.direction=="left"?"form-span--left":"form-span--right"])},s.toDisplayString(i.sideContent),3)])):i.inputType!=="multi-line"?(s.openBlock(),s.createElementBlock("div",cw,[s.createElementVNode("input",{class:"input__group_field","data-e2e":i.e2e,placeholder:i.placeholder,type:i.inputType,value:i.modelValue,onInput:o[2]||(o[2]=r=>n.$emit("update:modelValue",r.target.value))},null,40,uw),i.iconName?(s.openBlock(),s.createBlock(de,{key:0,class:"input__group_icon","icon-name":i.iconName},null,8,["icon-name"])):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)],64))}};function Kt(i){return[null,void 0].indexOf(i)!==-1}function dw(i,e,t){const{object:n,valueProp:o,mode:r}=s.toRefs(i),a=s.getCurrentInstance().proxy,l=t.iv,M=(g,d=!0)=>{l.value=u(g);const y=c(g);e.emit("change",y,a),d&&(e.emit("input",y),e.emit("update:modelValue",y))},c=g=>n.value||Kt(g)?g:Array.isArray(g)?g.map(d=>d[o.value]):g[o.value],u=g=>Kt(g)?r.value==="single"?{}:[]:g;return{update:M}}function Nw(i,e){const{value:t,modelValue:n,mode:o,valueProp:r}=s.toRefs(i),a=s.ref(o.value!=="single"?[]:{}),l=n&&n.value!==void 0?n:t,M=s.computed(()=>o.value==="single"?a.value[r.value]:a.value.map(u=>u[r.value])),c=s.computed(()=>o.value!=="single"?a.value.map(u=>u[r.value]).join(","):a.value[r.value]);return{iv:a,internalValue:a,ev:l,externalValue:l,textValue:c,plainValue:M}}function jw(i,e,t){const{regex:n}=s.toRefs(i),o=s.getCurrentInstance().proxy,r=t.isOpen,a=t.open,l=s.ref(null),M=s.ref(null),c=()=>{l.value=""},u=y=>{l.value=y.target.value},g=y=>{if(n&&n.value){let j=n.value;typeof j=="string"&&(j=new RegExp(j)),y.key.match(j)||y.preventDefault()}},d=y=>{if(n&&n.value){let D=(y.clipboardData||window.clipboardData).getData("Text"),I=n.value;typeof I=="string"&&(I=new RegExp(I)),D.split("").every(N=>!!N.match(I))||y.preventDefault()}e.emit("paste",y,o)};return s.watch(l,y=>{!r.value&&y&&a(),e.emit("search-change",y,o)}),{search:l,input:M,clearSearch:c,handleSearchInput:u,handleKeypress:g,handlePaste:d}}function yw(i,e,t){const{groupSelect:n,mode:o,groups:r,disabledProp:a}=s.toRefs(i),l=s.ref(null),M=u=>{u===void 0||u!==null&&u[a.value]||r.value&&u&&u.group&&(o.value==="single"||!n.value)||(l.value=u)};return{pointer:l,setPointer:M,clearPointer:()=>{M(null)}}}function HM(i,e=!0){return e?String(i).toLowerCase().trim():String(i).toLowerCase().normalize("NFD").trim().replace(new RegExp(/æ/g),"ae").replace(new RegExp(/œ/g),"oe").replace(new RegExp(/ø/g),"o").replace(/\p{Diacritic}/gu,"")}function Iw(i){return Object.prototype.toString.call(i)==="[object Object]"}function hw(i,e){const t=e.slice().sort();return i.length===e.length&&i.slice().sort().every(function(n,o){return n===t[o]})}function Dw(i,e,t){const{options:n,mode:o,trackBy:r,limit:a,hideSelected:l,createTag:M,createOption:c,label:u,appendNewTag:g,appendNewOption:d,multipleLabel:y,object:j,loading:D,delay:I,resolveOnLoad:N,minChars:m,filterResults:b,clearOnSearch:C,clearOnSelect:E,valueProp:A,allowAbsent:O,groupLabel:f,canDeselect:z,max:L,strict:p,closeOnSelect:h,closeOnDeselect:T,groups:w,reverse:x,infinite:S,groupOptions:v,groupHideEmpty:k,groupSelect:P,onCreate:W,disabledProp:Q,searchStart:_,searchFilter:$}=s.toRefs(i),ne=s.getCurrentInstance().proxy,ie=t.iv,F=t.ev,B=t.search,V=t.clearSearch,H=t.update,q=t.pointer,X=t.clearPointer,Ie=t.focus,Le=t.deactivate,me=t.close,R=t.localize,Ne=s.ref([]),he=s.ref([]),_e=s.ref(!1),Zt=s.ref(null),Mn=s.ref(S.value&&a.value===-1?10:a.value),cn=s.computed(()=>M.value||c.value||!1),Y=s.computed(()=>g.value!==void 0?g.value:d.value!==void 0?d.value:!0),J=s.computed(()=>{if(w.value){let U=qe.value||[],K=[];return U.forEach(fe=>{Jc(fe[v.value]).forEach(Je=>{K.push(Object.assign({},Je,fe[Q.value]?{[Q.value]:!0}:{}))})}),K}else{let U=Jc(he.value||[]);return Ne.value.length&&(U=U.concat(Ne.value)),U}}),ee=s.computed(()=>{let U=J.value;return x.value&&(U=U.reverse()),vi.value.length&&(U=vi.value.concat(U)),$c(U)}),ue=s.computed(()=>{let U=ee.value;return Mn.value>0&&(U=U.slice(0,Mn.value)),U}),qe=s.computed(()=>{if(!w.value)return[];let U=[],K=he.value||[];return Ne.value.length&&U.push({[f.value]:" ",[v.value]:[...Ne.value],__CREATE__:!0}),U.concat(K)}),Ct=s.computed(()=>{let U=[...qe.value].map(K=>({...K}));return vi.value.length&&(U[0]&&U[0].__CREATE__?U[0][v.value]=[...vi.value,...U[0][v.value]]:U=[{[f.value]:" ",[v.value]:[...vi.value],__CREATE__:!0}].concat(U)),U}),Lt=s.computed(()=>{if(!w.value)return[];let U=Ct.value;return y3((U||[]).map((K,fe)=>{const Je=Jc(K[v.value]);return{...K,index:fe,group:!0,[v.value]:$c(Je,!1).map(bo=>Object.assign({},bo,K[Q.value]?{[Q.value]:!0}:{})),__VISIBLE__:$c(Je).map(bo=>Object.assign({},bo,K[Q.value]?{[Q.value]:!0}:{}))}}))}),ki=s.computed(()=>{switch(o.value){case"single":return!Kt(ie.value[A.value]);case"multiple":case"tags":return!Kt(ie.value)&&ie.value.length>0}}),ii=s.computed(()=>y!==void 0&&y.value!==void 0?y.value(ie.value,ne):ie.value&&ie.value.length>1?`${ie.value.length} options selected`:"1 option selected"),Vc=s.computed(()=>!J.value.length&&!_e.value&&!vi.value.length),Gc=s.computed(()=>J.value.length>0&&ue.value.length==0&&(B.value&&w.value||!w.value)),vi=s.computed(()=>cn.value===!1||!B.value?[]:ss(B.value)!==-1?[]:[{[A.value]:B.value,[wt.value]:B.value,[u.value]:B.value,__CREATE__:!0}]),wt=s.computed(()=>r.value||u.value),Wc=s.computed(()=>{switch(o.value){case"single":return null;case"multiple":case"tags":return[]}}),Hc=s.computed(()=>D.value||_e.value),St=U=>{switch(typeof U!="object"&&(U=vt(U)),o.value){case"single":H(U);break;case"multiple":case"tags":H(ie.value.concat(U));break}e.emit("select",rs(U),U,ne)},Qi=U=>{switch(typeof U!="object"&&(U=vt(U)),o.value){case"single":Yn();break;case"tags":case"multiple":H(Array.isArray(U)?ie.value.filter(K=>U.map(fe=>fe[A.value]).indexOf(K[A.value])===-1):ie.value.filter(K=>K[A.value]!=U[A.value]));break}e.emit("deselect",rs(U),U,ne)},rs=U=>j.value?U:U[A.value],as=U=>{Qi(U)},Fc=(U,K)=>{if(K.button!==0){K.preventDefault();return}as(U)},Yn=()=>{e.emit("clear",ne),H(Wc.value)},kt=U=>{if(U.group!==void 0)return o.value==="single"?!1:di(U[v.value])&&U[v.value].length;switch(o.value){case"single":return!Kt(ie.value)&&ie.value[A.value]==U[A.value];case"tags":case"multiple":return!Kt(ie.value)&&ie.value.map(K=>K[A.value]).indexOf(U[A.value])!==-1}},Yi=U=>U[Q.value]===!0,Eo=()=>L===void 0||L.value===-1||!ki.value&&L.value>0?!1:ie.value.length>=L.value,G=U=>{if(!Yi(U)){if(W&&W.value&&!kt(U)&&U.__CREATE__&&(U={...U},delete U.__CREATE__,U=W.value(U,ne),U instanceof Promise)){_e.value=!0,U.then(K=>{_e.value=!1,Me(K)});return}Me(U)}},Me=U=>{switch(U.__CREATE__&&(U={...U},delete U.__CREATE__),o.value){case"single":if(U&&kt(U)){z.value&&Qi(U),T.value&&(X(),me());return}U&&ge(U),E.value&&V(),h.value&&(X(),me()),U&&St(U);break;case"multiple":if(U&&kt(U)){Qi(U),T.value&&(X(),me());return}if(Eo()){e.emit("max",ne);return}U&&(ge(U),St(U)),E.value&&V(),l.value&&X(),h.value&&me();break;case"tags":if(U&&kt(U)){Qi(U),T.value&&(X(),me());return}if(Eo()){e.emit("max",ne);return}U&&ge(U),E.value&&V(),U&&St(U),l.value&&X(),h.value&&me();break}h.value||Ie()},oe=U=>{if(!(Yi(U)||o.value==="single"||!P.value)){switch(o.value){case"multiple":case"tags":un(U[v.value])?Qi(U[v.value]):St(U[v.value].filter(K=>ie.value.map(fe=>fe[A.value]).indexOf(K[A.value])===-1).filter(K=>!K[Q.value]).filter((K,fe)=>ie.value.length+1+fe<=L.value||L.value===-1));break}h.value&&Le()}},ge=U=>{vt(U[A.value])===void 0&&cn.value&&(e.emit("tag",U[A.value],ne),e.emit("option",U[A.value],ne),e.emit("create",U[A.value],ne),Y.value&&Ms(U),V())},ye=()=>{o.value!=="single"&&St(ue.value.filter(U=>!U.disabled&&!kt(U)))},un=U=>U.find(K=>!kt(K)&&!K[Q.value])===void 0,di=U=>U.find(K=>!kt(K))===void 0,vt=U=>J.value[J.value.map(K=>String(K[A.value])).indexOf(String(U))],ss=(U,K=!0)=>J.value.map(fe=>parseInt(fe[wt.value])==fe[wt.value]?parseInt(fe[wt.value]):fe[wt.value]).indexOf(parseInt(U)==U?parseInt(U):U),ls=U=>["tags","multiple"].indexOf(o.value)!==-1&&l.value&&kt(U),Ms=U=>{Ne.value.push(U)},y3=U=>k.value?U.filter(K=>B.value?K.__VISIBLE__.length:K[v.value].length):U.filter(K=>B.value?K.__VISIBLE__.length:!0),$c=(U,K=!0)=>{let fe=U;if(B.value&&b.value){let Je=$.value;Je||(Je=(bo,MQ)=>{let AI=HM(R(bo[wt.value]),p.value);return _.value?AI.startsWith(HM(B.value,p.value)):AI.indexOf(HM(B.value,p.value))!==-1}),fe=fe.filter(Je)}return l.value&&K&&(fe=fe.filter(Je=>!ls(Je))),fe},Jc=U=>{let K=U;return Iw(K)&&(K=Object.keys(K).map(fe=>{let Je=K[fe];return{[A.value]:fe,[wt.value]:Je,[u.value]:Je}})),K=K.map(fe=>typeof fe=="object"?fe:{[A.value]:fe,[wt.value]:fe,[u.value]:fe}),K},cs=()=>{Kt(F.value)||(ie.value=gs(F.value))},us=U=>(_e.value=!0,new Promise((K,fe)=>{n.value(B.value,ne).then(Je=>{he.value=Je||[],typeof U=="function"&&U(Je),_e.value=!1}).catch(Je=>{console.error(Je),he.value=[],_e.value=!1}).finally(()=>{K()})})),Xc=()=>{if(ki.value)if(o.value==="single"){let U=vt(ie.value[A.value]);if(U!==void 0){let K=U[u.value];ie.value[u.value]=K,j.value&&(F.value[u.value]=K)}}else ie.value.forEach((U,K)=>{let fe=vt(ie.value[K][A.value]);if(fe!==void 0){let Je=fe[u.value];ie.value[K][u.value]=Je,j.value&&(F.value[K][u.value]=Je)}})},I3=U=>{us(U)},gs=U=>Kt(U)?o.value==="single"?{}:[]:j.value?U:o.value==="single"?vt(U)||(O.value?{[u.value]:U,[A.value]:U,[wt.value]:U}:{}):U.filter(K=>!!vt(K)||O.value).map(K=>vt(K)||{[u.value]:K,[A.value]:K,[wt.value]:K}),mI=()=>{Zt.value=s.watch(B,U=>{U.length<m.value||!U&&m.value!==0||(_e.value=!0,C.value&&(he.value=[]),setTimeout(()=>{U==B.value&&n.value(B.value,ne).then(K=>{(U==B.value||!B.value)&&(he.value=K,q.value=ue.value.filter(fe=>fe[Q.value]!==!0)[0]||null,_e.value=!1)}).catch(K=>{console.error(K)})},I.value))},{flush:"sync"})};if(o.value!=="single"&&!Kt(F.value)&&!Array.isArray(F.value))throw new Error(`v-model must be an array when using "${o.value}" mode`);return n&&typeof n.value=="function"?N.value?us(cs):j.value==!0&&cs():(he.value=n.value,cs()),I.value>-1&&mI(),s.watch(I,(U,K)=>{Zt.value&&Zt.value(),U>=0&&mI()}),s.watch(F,U=>{if(Kt(U)){H(gs(U),!1);return}switch(o.value){case"single":(j.value?U[A.value]!=ie.value[A.value]:U!=ie.value[A.value])&&H(gs(U),!1);break;case"multiple":case"tags":hw(j.value?U.map(K=>K[A.value]):U,ie.value.map(K=>K[A.value]))||H(gs(U),!1);break}},{deep:!0}),s.watch(n,(U,K)=>{typeof i.options=="function"?N.value&&(!K||U&&U.toString()!==K.toString())&&us():(he.value=i.options,Object.keys(ie.value).length||cs(),Xc())}),s.watch(u,Xc),{pfo:ee,fo:ue,filteredOptions:ue,hasSelected:ki,multipleLabelText:ii,eo:J,extendedOptions:J,eg:qe,extendedGroups:qe,fg:Lt,filteredGroups:Lt,noOptions:Vc,noResults:Gc,resolving:_e,busy:Hc,offset:Mn,select:St,deselect:Qi,remove:as,selectAll:ye,clear:Yn,isSelected:kt,isDisabled:Yi,isMax:Eo,getOption:vt,handleOptionClick:G,handleGroupClick:oe,handleTagRemove:Fc,refreshOptions:I3,resolveOptions:us,refreshLabels:Xc}}function fw(i,e,t){const{valueProp:n,showOptions:o,searchable:r,groupLabel:a,groups:l,mode:M,groupSelect:c,disabledProp:u,groupOptions:g}=s.toRefs(i),d=t.fo,y=t.fg,j=t.handleOptionClick,D=t.handleGroupClick,I=t.search,N=t.pointer,m=t.setPointer,b=t.clearPointer,C=t.multiselect,E=t.isOpen,A=s.computed(()=>d.value.filter(F=>!F[u.value])),O=s.computed(()=>y.value.filter(F=>!F[u.value])),f=s.computed(()=>M.value!=="single"&&c.value),z=s.computed(()=>N.value&&N.value.group),L=s.computed(()=>ne(N.value)),p=s.computed(()=>{const F=z.value?N.value:ne(N.value),B=O.value.map(H=>H[a.value]).indexOf(F[a.value]);let V=O.value[B-1];return V===void 0&&(V=T.value),V}),h=s.computed(()=>{let F=O.value.map(B=>B.label).indexOf(z.value?N.value[a.value]:ne(N.value)[a.value])+1;return O.value.length<=F&&(F=0),O.value[F]}),T=s.computed(()=>[...O.value].slice(-1)[0]),w=s.computed(()=>N.value.__VISIBLE__.filter(F=>!F[u.value])[0]),x=s.computed(()=>{const F=L.value.__VISIBLE__.filter(B=>!B[u.value]);return F[F.map(B=>B[n.value]).indexOf(N.value[n.value])-1]}),S=s.computed(()=>{const F=ne(N.value).__VISIBLE__.filter(B=>!B[u.value]);return F[F.map(B=>B[n.value]).indexOf(N.value[n.value])+1]}),v=s.computed(()=>[...p.value.__VISIBLE__.filter(F=>!F[u.value])].slice(-1)[0]),k=s.computed(()=>[...T.value.__VISIBLE__.filter(F=>!F[u.value])].slice(-1)[0]),P=F=>N.value&&(!F.group&&N.value[n.value]===F[n.value]||F.group!==void 0&&N.value[a.value]===F[a.value])?!0:void 0,W=()=>{m(A.value[0]||null)},Q=()=>{!N.value||N.value[u.value]===!0||(z.value?D(N.value):j(N.value))},_=()=>{if(N.value===null)m((l.value&&f.value?O.value[0].__CREATE__?A.value[0]:O.value[0]:A.value[0])||null);else if(l.value&&f.value){let F=z.value?w.value:S.value;F===void 0&&(F=h.value,F.__CREATE__&&(F=F[g.value][0])),m(F||null)}else{let F=A.value.map(B=>B[n.value]).indexOf(N.value[n.value])+1;A.value.length<=F&&(F=0),m(A.value[F]||null)}s.nextTick(()=>{ie()})},$=()=>{if(N.value===null){let F=A.value[A.value.length-1];l.value&&f.value&&(F=k.value,F===void 0&&(F=T.value)),m(F||null)}else if(l.value&&f.value){let F=z.value?v.value:x.value;F===void 0&&(F=z.value?p.value:L.value,F.__CREATE__&&(F=v.value,F===void 0&&(F=p.value))),m(F||null)}else{let F=A.value.map(B=>B[n.value]).indexOf(N.value[n.value])-1;F<0&&(F=A.value.length-1),m(A.value[F]||null)}s.nextTick(()=>{ie()})},ne=F=>O.value.find(B=>B.__VISIBLE__.map(V=>V[n.value]).indexOf(F[n.value])!==-1),ie=()=>{let F=C.value.querySelector("[data-pointed]");if(!F)return;let B=F.parentElement.parentElement;l.value&&(B=z.value?F.parentElement.parentElement.parentElement:F.parentElement.parentElement.parentElement.parentElement),F.offsetTop+F.offsetHeight>B.clientHeight+B.scrollTop&&(B.scrollTop=F.offsetTop+F.offsetHeight-B.clientHeight),F.offsetTop<B.scrollTop&&(B.scrollTop=F.offsetTop)};return s.watch(I,F=>{r.value&&(F.length&&o.value?W():b())}),s.watch(E,F=>{if(F){let B=C.value.querySelectorAll("[data-selected]")[0];if(!B)return;let V=B.parentElement.parentElement;s.nextTick(()=>{V.scrollTop>0||(V.scrollTop=B.offsetTop)})}}),{pointer:N,canPointGroups:f,isPointed:P,setPointerFirst:W,selectPointer:Q,forwardPointer:_,backwardPointer:$}}function pw(i,e,t){const{disabled:n}=s.toRefs(i),o=s.getCurrentInstance().proxy,r=s.ref(!1);return{isOpen:r,open:()=>{r.value||n.value||(r.value=!0,e.emit("open",o))},close:()=>{r.value&&(r.value=!1,e.emit("close",o))}}}function zw(i,e,t){const{searchable:n,disabled:o,clearOnBlur:r}=s.toRefs(i),a=t.input,l=t.open,M=t.close,c=t.clearSearch,u=t.isOpen,g=s.ref(null),d=s.ref(null),y=s.ref(null),j=s.ref(!1),D=s.ref(!1),I=s.computed(()=>n.value||o.value?-1:0),N=()=>{n.value&&a.value.blur(),d.value.blur()},m=()=>{n.value&&!o.value&&a.value.focus()},b=(z=!0)=>{o.value||(j.value=!0,z&&l())},C=()=>{j.value=!1,setTimeout(()=>{j.value||(M(),r.value&&c())},1)};return{multiselect:g,wrapper:d,tags:y,tabindex:I,isActive:j,mouseClicked:D,blur:N,focus:m,activate:b,deactivate:C,handleFocusIn:z=>{z.target.closest("[data-tags]")&&z.target.nodeName!=="INPUT"||z.target.closest("[data-clear]")||b(D.value)},handleFocusOut:()=>{C()},handleCaretClick:()=>{C(),N()},handleMousedown:z=>{D.value=!0,u.value&&(z.target.isEqualNode(d.value)||z.target.isEqualNode(y.value))?setTimeout(()=>{C()},0):document.activeElement.isEqualNode(d.value)&&!u.value&&b(),setTimeout(()=>{D.value=!1},0)}}}function mw(i,e,t){const{mode:n,addTagOn:o,openDirection:r,searchable:a,showOptions:l,valueProp:M,groups:c,addOptionOn:u,createTag:g,createOption:d,reverse:y}=s.toRefs(i),j=s.getCurrentInstance().proxy,D=t.iv,I=t.update,N=t.search,m=t.setPointer,b=t.selectPointer,C=t.backwardPointer,E=t.forwardPointer,A=t.multiselect,O=t.wrapper,f=t.tags,z=t.isOpen,L=t.open,p=t.blur,h=t.fo,T=s.computed(()=>g.value||d.value||!1),w=s.computed(()=>o.value!==void 0?o.value:u.value!==void 0?u.value:["enter"]),x=()=>{n.value==="tags"&&!l.value&&T.value&&a.value&&!c.value&&m(h.value[h.value.map(P=>P[M.value]).indexOf(N.value)])},S=P=>{let W=P.length-1;for(;W>=0&&(P[W].remove===!1||P[W].disabled);)W--;return W<0||P.splice(W,1),P};return{handleKeydown:P=>{e.emit("keydown",P,j);let W,Q;switch(["ArrowLeft","ArrowRight","Enter"].indexOf(P.key)!==-1&&n.value==="tags"&&(W=[...A.value.querySelectorAll("[data-tags] > *")].filter(_=>_!==f.value),Q=W.findIndex(_=>_===document.activeElement)),P.key){case"Backspace":if(n.value==="single"||a.value&&[null,""].indexOf(N.value)===-1||D.value.length===0)return;I(S([...D.value]));break;case"Enter":if(P.preventDefault(),P.keyCode===229)return;if(Q!==-1&&Q!==void 0){I([...D.value].filter((_,$)=>$!==Q)),Q===W.length-1&&(W.length-1?W[W.length-2].focus():a.value?f.value.querySelector("input").focus():O.value.focus());return}if(w.value.indexOf("enter")===-1&&T.value)return;x(),b();break;case" ":if(!T.value&&!a.value){P.preventDefault(),x(),b();return}if(!T.value)return!1;if(w.value.indexOf("space")===-1&&T.value)return;P.preventDefault(),x(),b();break;case"Tab":case";":case",":if(w.value.indexOf(P.key.toLowerCase())===-1||!T.value)return;x(),b(),P.preventDefault();break;case"Escape":p();break;case"ArrowUp":if(P.preventDefault(),!l.value)return;z.value||L(),C();break;case"ArrowDown":if(P.preventDefault(),!l.value)return;z.value||L(),E();break;case"ArrowLeft":if(a.value&&f.value&&f.value.querySelector("input").selectionStart||P.shiftKey||n.value!=="tags"||!D.value||!D.value.length)return;P.preventDefault(),Q===-1?W[W.length-1].focus():Q>0&&W[Q-1].focus();break;case"ArrowRight":if(Q===-1||P.shiftKey||n.value!=="tags"||!D.value||!D.value.length)return;P.preventDefault(),W.length>Q+1?W[Q+1].focus():a.value?f.value.querySelector("input").focus():a.value||O.value.focus();break}},handleKeyup:P=>{e.emit("keyup",P,j)},preparePointer:x}}function Aw(i,e,t){const{classes:n,disabled:o,openDirection:r,showOptions:a}=s.toRefs(i),l=t.isOpen,M=t.isPointed,c=t.isSelected,u=t.isDisabled,g=t.isActive,d=t.canPointGroups,y=t.resolving,j=t.fo,D=s.computed(()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...n.value})),I=s.computed(()=>!!(l.value&&a.value&&(!y.value||y.value&&j.value.length)));return{classList:s.computed(()=>{const m=D.value;return{container:[m.container].concat(o.value?m.containerDisabled:[]).concat(I.value&&r.value==="top"?m.containerOpenTop:[]).concat(I.value&&r.value!=="top"?m.containerOpen:[]).concat(g.value?m.containerActive:[]),wrapper:m.wrapper,spacer:m.spacer,singleLabel:m.singleLabel,singleLabelText:m.singleLabelText,multipleLabel:m.multipleLabel,search:m.search,tags:m.tags,tag:[m.tag].concat(o.value?m.tagDisabled:[]),tagDisabled:m.tagDisabled,tagRemove:m.tagRemove,tagRemoveIcon:m.tagRemoveIcon,tagsSearchWrapper:m.tagsSearchWrapper,tagsSearch:m.tagsSearch,tagsSearchCopy:m.tagsSearchCopy,placeholder:m.placeholder,caret:[m.caret].concat(l.value?m.caretOpen:[]),clear:m.clear,clearIcon:m.clearIcon,spinner:m.spinner,inifinite:m.inifinite,inifiniteSpinner:m.inifiniteSpinner,dropdown:[m.dropdown].concat(r.value==="top"?m.dropdownTop:[]).concat(!l.value||!a.value||!I.value?m.dropdownHidden:[]),options:[m.options].concat(r.value==="top"?m.optionsTop:[]),group:m.group,groupLabel:b=>{let C=[m.groupLabel];return M(b)?C.push(c(b)?m.groupLabelSelectedPointed:m.groupLabelPointed):c(b)&&d.value?C.push(u(b)?m.groupLabelSelectedDisabled:m.groupLabelSelected):u(b)&&C.push(m.groupLabelDisabled),d.value&&C.push(m.groupLabelPointable),C},groupOptions:m.groupOptions,option:(b,C)=>{let E=[m.option];return M(b)?E.push(c(b)?m.optionSelectedPointed:m.optionPointed):c(b)?E.push(u(b)?m.optionSelectedDisabled:m.optionSelected):(u(b)||C&&u(C))&&E.push(m.optionDisabled),E},noOptions:m.noOptions,noResults:m.noResults,assist:m.assist,fakeInput:m.fakeInput}}),showDropdown:I}}function Tw(i,e,t){const{limit:n,infinite:o}=s.toRefs(i),r=t.isOpen,a=t.offset,l=t.search,M=t.pfo,c=t.eo,u=s.ref(null),g=s.ref(null),d=s.computed(()=>a.value<M.value.length),y=D=>{const{isIntersecting:I,target:N}=D[0];if(I){const m=N.offsetParent,b=m.scrollTop;a.value+=n.value==-1?10:n.value,s.nextTick(()=>{m.scrollTop=b})}},j=()=>{r.value&&a.value<M.value.length?u.value.observe(g.value):!r.value&&u.value&&u.value.disconnect()};return s.watch(r,()=>{o.value&&j()}),s.watch(l,()=>{o.value&&(a.value=n.value,j())},{flush:"post"}),s.watch(c,()=>{o.value&&j()},{immediate:!1,flush:"post"}),s.onMounted(()=>{window&&window.IntersectionObserver&&(u.value=new IntersectionObserver(y))}),{hasMore:d,infiniteLoader:g}}function xw(i,e,t){const{placeholder:n,id:o,valueProp:r,label:a,mode:l,groupLabel:M,aria:c,searchable:u}=s.toRefs(i),g=t.pointer,d=t.iv,y=t.hasSelected,j=t.multipleLabelText,D=s.ref(null),I=s.computed(()=>{let h=[];return o&&o.value&&h.push(o.value),h.push("assist"),h.join("-")}),N=s.computed(()=>{let h=[];return o&&o.value&&h.push(o.value),h.push("multiselect-options"),h.join("-")}),m=s.computed(()=>{let h=[];if(o&&o.value&&h.push(o.value),g.value)return h.push(g.value.group?"multiselect-group":"multiselect-option"),h.push(g.value.group?g.value.index:g.value[r.value]),h.join("-")}),b=s.computed(()=>n.value),C=s.computed(()=>l.value!=="single"),E=s.computed(()=>{let h="";return l.value==="single"&&y.value&&(h+=d.value[a.value]),l.value==="multiple"&&y.value&&(h+=j.value),l.value==="tags"&&y.value&&(h+=d.value.map(T=>T[a.value]).join(", ")),h}),A=s.computed(()=>{let h={...c.value};return u.value&&(h["aria-labelledby"]=h["aria-labelledby"]?`${I.value} ${h["aria-labelledby"]}`:I.value,E.value&&h["aria-label"]&&(h["aria-label"]=`${E.value}, ${h["aria-label"]}`)),h}),O=h=>{let T=[];return o&&o.value&&T.push(o.value),T.push("multiselect-option"),T.push(h[r.value]),T.join("-")},f=h=>{let T=[];return o&&o.value&&T.push(o.value),T.push("multiselect-group"),T.push(h.index),T.join("-")},z=h=>{let T=[];return T.push(h),T.join(" ")},L=h=>{let T=[];return T.push(h),T.join(" ")},p=h=>`${h} ❎`;return s.onMounted(()=>{if(o&&o.value&&document&&document.querySelector){let h=document.querySelector(`[for="${o.value}"]`);D.value=h?h.innerText:null}}),{arias:A,ariaLabel:E,ariaAssist:I,ariaControls:N,ariaPlaceholder:b,ariaMultiselectable:C,ariaActiveDescendant:m,ariaOptionId:O,ariaOptionLabel:z,ariaGroupId:f,ariaGroupLabel:L,ariaTagLabel:p}}function Lw(i,e,t){const{locale:n,fallbackLocale:o}=s.toRefs(i);return{localize:a=>!a||typeof a!="object"?a:a&&a[n.value]?a[n.value]:a&&n.value&&a[n.value.toUpperCase()]?a[n.value.toUpperCase()]:a&&a[o.value]?a[o.value]:a&&o.value&&a[o.value.toUpperCase()]?a[o.value.toUpperCase()]:a&&Object.keys(a)[0]?a[Object.keys(a)[0]]:""}}function Ew(i,e,t,n={}){return t.forEach(o=>{o&&(n={...n,...o(i,e,n)})}),n}var FM={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup","max","create"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:[String,Object],required:!1,default:"The list is empty"},noResultsText:{type:[String,Object],required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},closeOnDeselect:{type:Boolean,required:!1,default:!1},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})},clearOnBlur:{required:!1,type:Boolean,default:!0},locale:{required:!1,type:String,default:null},fallbackLocale:{required:!1,type:String,default:"en"},searchFilter:{required:!1,type:Function,default:null},allowAbsent:{required:!1,type:Boolean,default:!1}},setup(i,e){return Ew(i,e,[Lw,Nw,yw,pw,jw,dw,zw,Dw,Tw,fw,mw,Aw,xw])}};const bw=["id","dir"],Ow=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],Cw=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],ww=["onKeyup","aria-label"],Sw=["onClick"],kw=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],vw=["innerHTML"],Qw=["id"],Yw=["id","aria-label","aria-selected"],Uw=["data-pointed","onMouseenter","onClick"],_w=["innerHTML"],Bw=["aria-label"],Pw=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],Rw=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],Zw=["innerHTML"],Vw=["innerHTML"],Gw=["value"],Ww=["name","value"],Hw=["name","value"],Fw=["id"];function $w(i,e,t,n,o,r){return s.openBlock(),s.createElementBlock("div",{ref:"multiselect",class:s.normalizeClass(i.classList.container),id:t.searchable?void 0:t.id,dir:t.rtl?"rtl":void 0,onFocusin:e[10]||(e[10]=(...a)=>i.handleFocusIn&&i.handleFocusIn(...a)),onFocusout:e[11]||(e[11]=(...a)=>i.handleFocusOut&&i.handleFocusOut(...a)),onKeyup:e[12]||(e[12]=(...a)=>i.handleKeyup&&i.handleKeyup(...a)),onKeydown:e[13]||(e[13]=(...a)=>i.handleKeydown&&i.handleKeydown(...a))},[s.createElementVNode("div",s.mergeProps({class:i.classList.wrapper,onMousedown:e[9]||(e[9]=(...a)=>i.handleMousedown&&i.handleMousedown(...a)),ref:"wrapper",tabindex:i.tabindex,"aria-controls":t.searchable?void 0:i.ariaControls,"aria-placeholder":t.searchable?void 0:i.ariaPlaceholder,"aria-expanded":t.searchable?void 0:i.isOpen,"aria-activedescendant":t.searchable?void 0:i.ariaActiveDescendant,"aria-multiselectable":t.searchable?void 0:i.ariaMultiselectable,role:t.searchable?void 0:"combobox"},t.searchable?{}:i.arias),[s.createCommentVNode(" Search "),t.mode!=="tags"&&t.searchable&&!t.disabled?(s.openBlock(),s.createElementBlock("input",s.mergeProps({key:0,type:t.inputType,modelValue:i.search,value:i.search,class:i.classList.search,autocomplete:t.autocomplete,id:t.searchable?t.id:void 0,onInput:e[0]||(e[0]=(...a)=>i.handleSearchInput&&i.handleSearchInput(...a)),onKeypress:e[1]||(e[1]=(...a)=>i.handleKeypress&&i.handleKeypress(...a)),onPaste:e[2]||(e[2]=s.withModifiers((...a)=>i.handlePaste&&i.handlePaste(...a),["stop"])),ref:"input","aria-controls":i.ariaControls,"aria-placeholder":i.ariaPlaceholder,"aria-expanded":i.isOpen,"aria-activedescendant":i.ariaActiveDescendant,"aria-multiselectable":i.ariaMultiselectable,role:"combobox"},{...t.attrs,...i.arias}),null,16,Cw)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Tags (with search) "),t.mode=="tags"?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(i.classList.tags),"data-tags":""},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(i.iv,(a,l,M)=>s.renderSlot(i.$slots,"tag",{option:a,handleTagRemove:i.handleTagRemove,disabled:t.disabled},()=>[(s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass([i.classList.tag,a.disabled?i.classList.tagDisabled:null]),tabindex:"-1",onKeyup:s.withKeys(c=>i.handleTagRemove(a,c),["enter"]),key:M,"aria-label":i.ariaTagLabel(i.localize(a[t.label]))},[s.createTextVNode(s.toDisplayString(i.localize(a[t.label]))+" ",1),!t.disabled&&!a.disabled?(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass(i.classList.tagRemove),onClick:s.withModifiers(c=>i.handleTagRemove(a,c),["stop"])},[s.createElementVNode("span",{class:s.normalizeClass(i.classList.tagRemoveIcon)},null,2)],10,Sw)):s.createCommentVNode("v-if",!0)],42,ww))])),256)),s.createElementVNode("div",{class:s.normalizeClass(i.classList.tagsSearchWrapper),ref:"tags"},[s.createCommentVNode(" Used for measuring search width "),s.createElementVNode("span",{class:s.normalizeClass(i.classList.tagsSearchCopy)},s.toDisplayString(i.search),3),s.createCommentVNode(" Actual search input "),t.searchable&&!t.disabled?(s.openBlock(),s.createElementBlock("input",s.mergeProps({key:0,type:t.inputType,modelValue:i.search,value:i.search,class:i.classList.tagsSearch,id:t.searchable?t.id:void 0,autocomplete:t.autocomplete,onInput:e[3]||(e[3]=(...a)=>i.handleSearchInput&&i.handleSearchInput(...a)),onKeypress:e[4]||(e[4]=(...a)=>i.handleKeypress&&i.handleKeypress(...a)),onPaste:e[5]||(e[5]=s.withModifiers((...a)=>i.handlePaste&&i.handlePaste(...a),["stop"])),ref:"input","aria-controls":i.ariaControls,"aria-placeholder":i.ariaPlaceholder,"aria-expanded":i.isOpen,"aria-activedescendant":i.ariaActiveDescendant,"aria-multiselectable":i.ariaMultiselectable,role:"combobox"},{...t.attrs,...i.arias}),null,16,kw)):s.createCommentVNode("v-if",!0)],2)],2)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Single label "),t.mode=="single"&&i.hasSelected&&!i.search&&i.iv?s.renderSlot(i.$slots,"singlelabel",{key:2,value:i.iv},()=>[s.createElementVNode("div",{class:s.normalizeClass(i.classList.singleLabel)},[s.createElementVNode("span",{class:s.normalizeClass(i.classList.singleLabelText)},s.toDisplayString(i.localize(i.iv[t.label])),3)],2)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Multiple label "),t.mode=="multiple"&&i.hasSelected&&!i.search?s.renderSlot(i.$slots,"multiplelabel",{key:3,values:i.iv},()=>[s.createElementVNode("div",{class:s.normalizeClass(i.classList.multipleLabel),innerHTML:i.multipleLabelText},null,10,vw)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Placeholder "),t.placeholder&&!i.hasSelected&&!i.search?s.renderSlot(i.$slots,"placeholder",{key:4},()=>[s.createElementVNode("div",{class:s.normalizeClass(i.classList.placeholder),"aria-hidden":"true"},s.toDisplayString(t.placeholder),3)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Spinner "),t.loading||i.resolving?s.renderSlot(i.$slots,"spinner",{key:5},()=>[s.createElementVNode("span",{class:s.normalizeClass(i.classList.spinner),"aria-hidden":"true"},null,2)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Clear "),i.hasSelected&&!t.disabled&&t.canClear&&!i.busy?s.renderSlot(i.$slots,"clear",{key:6,clear:i.clear},()=>[s.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:s.normalizeClass(i.classList.clear),onClick:e[6]||(e[6]=(...a)=>i.clear&&i.clear(...a)),onKeyup:e[7]||(e[7]=s.withKeys((...a)=>i.clear&&i.clear(...a),["enter"]))},[s.createElementVNode("span",{class:s.normalizeClass(i.classList.clearIcon)},null,2)],34)]):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Caret "),t.caret&&t.showOptions?s.renderSlot(i.$slots,"caret",{key:7},()=>[s.createElementVNode("span",{class:s.normalizeClass(i.classList.caret),onClick:e[8]||(e[8]=(...a)=>i.handleCaretClick&&i.handleCaretClick(...a)),"aria-hidden":"true"},null,2)]):s.createCommentVNode("v-if",!0)],16,Ow),s.createCommentVNode(" Options "),s.createElementVNode("div",{class:s.normalizeClass(i.classList.dropdown),tabindex:"-1"},[s.renderSlot(i.$slots,"beforelist",{options:i.fo}),s.createElementVNode("ul",{class:s.normalizeClass(i.classList.options),id:i.ariaControls,role:"listbox"},[t.groups?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(i.fg,(a,l,M)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(i.classList.group),key:M,id:i.ariaGroupId(a),"aria-label":i.ariaGroupLabel(i.localize(a[t.groupLabel])),"aria-selected":i.isSelected(a),role:"option"},[a.__CREATE__?s.createCommentVNode("v-if",!0):(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(i.classList.groupLabel(a)),"data-pointed":i.isPointed(a),onMouseenter:c=>i.setPointer(a,l),onClick:c=>i.handleGroupClick(a)},[s.renderSlot(i.$slots,"grouplabel",{group:a,isSelected:i.isSelected,isPointed:i.isPointed},()=>[s.createElementVNode("span",{innerHTML:i.localize(a[t.groupLabel])},null,8,_w)])],42,Uw)),s.createElementVNode("ul",{class:s.normalizeClass(i.classList.groupOptions),"aria-label":i.ariaGroupLabel(i.localize(a[t.groupLabel])),role:"group"},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.__VISIBLE__,(c,u,g)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(i.classList.option(c,a)),"data-pointed":i.isPointed(c),"data-selected":i.isSelected(c)||void 0,key:g,onMouseenter:d=>i.setPointer(c),onClick:d=>i.handleOptionClick(c),id:i.ariaOptionId(c),"aria-selected":i.isSelected(c),"aria-label":i.ariaOptionLabel(i.localize(c[t.label])),role:"option"},[s.renderSlot(i.$slots,"option",{option:c,isSelected:i.isSelected,isPointed:i.isPointed,search:i.search},()=>[s.createElementVNode("span",null,s.toDisplayString(i.localize(c[t.label])),1)])],42,Pw))),128))],10,Bw)],10,Yw))),128)):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(i.fo,(a,l,M)=>(s.openBlock(),s.createElementBlock("li",{class:s.normalizeClass(i.classList.option(a)),"data-pointed":i.isPointed(a),"data-selected":i.isSelected(a)||void 0,key:M,onMouseenter:c=>i.setPointer(a),onClick:c=>i.handleOptionClick(a),id:i.ariaOptionId(a),"aria-selected":i.isSelected(a),"aria-label":i.ariaOptionLabel(i.localize(a[t.label])),role:"option"},[s.renderSlot(i.$slots,"option",{option:a,isSelected:i.isSelected,isPointed:i.isPointed,search:i.search},()=>[s.createElementVNode("span",null,s.toDisplayString(i.localize(a[t.label])),1)])],42,Rw))),128))],10,Qw),i.noOptions?s.renderSlot(i.$slots,"nooptions",{key:0},()=>[s.createElementVNode("div",{class:s.normalizeClass(i.classList.noOptions),innerHTML:i.localize(t.noOptionsText)},null,10,Zw)]):s.createCommentVNode("v-if",!0),i.noResults?s.renderSlot(i.$slots,"noresults",{key:1},()=>[s.createElementVNode("div",{class:s.normalizeClass(i.classList.noResults),innerHTML:i.localize(t.noResultsText)},null,10,Vw)]):s.createCommentVNode("v-if",!0),t.infinite&&i.hasMore?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(i.classList.inifinite),ref:"infiniteLoader"},[s.renderSlot(i.$slots,"infinite",{},()=>[s.createElementVNode("span",{class:s.normalizeClass(i.classList.inifiniteSpinner)},null,2)])],2)):s.createCommentVNode("v-if",!0),s.renderSlot(i.$slots,"afterlist",{options:i.fo})],2),s.createCommentVNode(" Hacky input element to show HTML5 required warning "),t.required?(s.openBlock(),s.createElementBlock("input",{key:0,class:s.normalizeClass(i.classList.fakeInput),tabindex:"-1",value:i.textValue,required:""},null,10,Gw)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Native input support "),t.nativeSupport?(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[t.mode=="single"?(s.openBlock(),s.createElementBlock("input",{key:0,type:"hidden",name:t.name,value:i.plainValue!==void 0?i.plainValue:""},null,8,Ww)):(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:1},s.renderList(i.plainValue,(a,l)=>(s.openBlock(),s.createElementBlock("input",{type:"hidden",name:`${t.name}[]`,value:a,key:l},null,8,Hw))),128))],64)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Screen reader assistive text "),t.searchable&&i.hasSelected?(s.openBlock(),s.createElementBlock("div",{key:2,class:s.normalizeClass(i.classList.assist),id:i.ariaAssist,"aria-hidden":"true"},s.toDisplayString(i.ariaLabel),11,Fw)):s.createCommentVNode("v-if",!0),s.createCommentVNode(" Create height for empty input "),s.createElementVNode("div",{class:s.normalizeClass(i.classList.spacer)},null,2)],42,bw)}FM.render=$w,FM.__file="src/Multiselect.vue";const V3="",G3="",Jw=["src"],Xw={class:"list__item_text"},Kw={__name:"InputList",props:{layout:{type:String,default:"inline"},list:{type:Array,required:!0},maxHeight:{type:String,default:"200px"},labelProp:{type:String,default:"label"},valueProp:{type:String,default:"id"},canClear:{type:Boolean,required:!1,default:!0},placeholder:{type:String,required:!1,default:"Start typing..."},modelValue:{type:[Object,Array],required:!1,default:null},showAvatar:{type:Boolean,required:!1,default:!0}},emits:["update","select","deselect","clear"],setup(i,{emit:e}){const t=i;s.useCssVars(u=>({"6ec64d59":i.maxHeight}));const n=s.computed({get(){return t.modelValue},set(){}}),o=s.computed(()=>t.layout==="falldown"?"multiselect-layout-wrapper":"");function r(u){e("select",u)}function a(u){e("deselect",u)}function l(u){e("update",u)}function M(){e("clear")}function c(u){return u.profile_pic?u.profile_pic:new URL("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAR2SURBVHgBlVVdaFtlGH6+LydJ89OYtHVbf+YyhoPK5uK2G3/oIlTYhRctKApebAiCXowtDLzxIi3sUqnBiiBerF6osGl7J0idqWyD4WSZF3PzZ4tt7Y/NmnRN0yYn5/t8z9e0Ne35Wnwg5Jzzvt/7vO/7vT8MO6BnYDEuPP4TXMi4kIgyxqOrElEAZEZKZLhVHhpJBDPb2WE6wcsDZtwwXEkJGd9G7T9WRJqZ+f6RxONprUp9BDIs3CLJJM7tSLAJkg5xIT6EVSTCSEFLdPKT5ai36hqWzBVj8v+R1IFVM8y0ekcSvuwWop6BfFgaoR8kY0RSf04qRUriSh6l/AzcDY3wRtpgmWUSUhSewFYuITMFwV9MJ5iKzFgTCHfITtcWEhvW/H38NfYpViZ+UZ7Jmn920B3dZxDuPLnljOQsFmYiSY8J+53Xook734nE4v1r+P2rBMoTt1VUqzRC/ThFU85P2m7CCYKxc3bVrhNZRjDpdPHmoxnMXBmErFbgDIncza+RuzGE1QTXQ1k0fElF9OpAJcaZK+5kZuHuKCqlAraDbWzmxmWUJm5pXEH89Y8W49w0cNrBGYWlqTvbFvjTna1oigQoLQKP/ryq0eIooSFOxcCP6AxJaWkkDAEfw/uJ52GaJt658D1yhSmdGdJmJ+iOZEyrQaFeOPss9u3xKXUVHlXN8UO78U2qFx0tbuxv9eOzZDepCr0ZGlsGdUFYR3L04C50H4ugt2s/HkwXsVgqoyXUgLbdQeITtgFFEPK58VR7iFKk81dEuU7m5yWkXmtEo98Ao0jeS12FWeVo3+WnZhT48edJvNl3RTkU8nN8fKoJAWNJE5HdsJJl6SG6WVZhbsyZfuxVlSLwwbtd2NMcUM/2wReOP4Enoy2rVuhbQTRhpep25pGiwBmvZJ2EVcuD8/fewGwloIy1NftUdUlqUkn7glPKWpsblO7flTDO330FFjyORKSd4bBcY9CCYboUXFe3S9UmYmuvNeTJGRrEziTM1q/eJieLaWhAnuDbiQO12cZgLa0Ay1UI+7eyUfqjMwehWymMHHNXqxc57Y003W5aR3YrfwCXsp3KkCvgAfd7wX3073PRLAOGxztxbWqfrudtpC/R9uWrrGa/1KjS6MSXfxzFFxNdsJhXxUmOQbj8+Py35zB07xilh2kyAoom328/K6KRM740mUxtHoz2fRTmBKYfMMxXaP+wCMzcAsyHCyQLomRElayQs+y1tAVUAKnLtdW+3ke8avSRILNGZpPMjlsozlMBUI6u36Ebaz8M+OjiPUHwvc9g9KeyWkqLD13ITdpkG9OBPmcQNPrW3uti7hlYjkq3Z5iSH8vPEslCfSV1Ha7g1EucSt/Exe8krv/qrzMQeMxCUyu3d1WGutt5lW+QyXDZLPf9M26cldAODkfY99zSUU4FvL6+kdoK1xKt4dDbc3G3EUmSQhw7EDLqFSFZmvZtf2bQvm8HHeyA2FvFGPd6TlN0R0iZJj0Lq2NSZiWsLGNsjKOYvjlIbbIN/gUK8Nn86IrnuAAAAABJRU5ErkJggg==",self.location).href}return(u,g)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(o.value)},[s.createVNode(s.unref(FM),{modelValue:n.value,"onUpdate:modelValue":g[0]||(g[0]=d=>n.value=d),"can-clear":t.canClear,label:i.labelProp,mode:"tags",native:!1,object:!0,options:i.list,placeholder:t.placeholder,searchable:!0,"value-prop":i.valueProp,onChange:g[1]||(g[1]=d=>l(d)),onClear:g[2]||(g[2]=d=>M()),onDeselect:g[3]||(g[3]=d=>a(d)),onSelect:g[4]||(g[4]=d=>r(d))},{tag:s.withCtx(({option:d,handleTagRemove:y,disabled:j})=>[s.createElementVNode("div",{class:s.normalizeClass(["list__item",{"is-disabled":j}])},[t.showAvatar?(s.openBlock(),s.createElementBlock("img",{key:0,alt:"",class:"list__item_thumb",src:c(d)},null,8,Jw)):s.createCommentVNode("",!0),s.createElementVNode("p",Xw,s.toDisplayString(d[i.labelProp]),1),s.createVNode(de,{class:"list__item_icon","icon-name":"delete",size:24,onMousedown:s.withModifiers(D=>y(d,D),["prevent"])},null,8,["onMousedown"]),s.renderSlot(u.$slots,"default")],2)]),_:3},8,["modelValue","can-clear","label","options","placeholder","value-prop"])],2))}},$M=s.defineComponent({components:{DhIcon:de},props:{hasCloseButton:{type:Boolean,default:!0},hasSideBar:{type:Boolean,default:!0},hasSideBarButtonBottom:{type:Boolean,default:!0},hasHeader:{type:Boolean,default:!0},hasFooter:{type:Boolean,default:!0},hasFooterButtonRight:{type:Boolean,default:!0},hasBodyScrolling:{type:Boolean,default:!0},sideBarPosition:{type:String,default:"left"},hasCloseConfirmation:{type:Boolean,default:!1},bodyClass:{type:String,default:""},fitContent:{type:Boolean,default:!1},minHeight:{type:String,default:"600px"}},emits:["close"],mounted(){document.body.classList.add("modal-open")},unmounted(){document.body.classList.remove("modal-open")},methods:{closed(){this.$emit("close",this.hasCloseConfirmation),document.body.classList.remove("modal-open")}}}),_j=()=>{s.useCssVars(i=>({"2e7b1246":i.minHeight}))},Bj=$M.setup;$M.setup=Bj?(i,e)=>(_j(),Bj(i,e)):_j;const W3="",qw={class:"modal-content"},eS={key:0,id:"modal-sidebar",class:"modal-sidebar"},tS={key:0,id:"modalTitle",class:"modal-header"},iS={class:"modal-footer"};function nS(i,e,t,n,o,r){const a=s.resolveComponent("dh-icon");return s.openBlock(),s.createBlock(s.Transition,{name:"modal-fade"},{default:s.withCtx(()=>[s.createElementVNode("div",{class:"modal-backdrop",onMousedown:e[2]||(e[2]=(...l)=>i.closed&&i.closed(...l))},[s.createElementVNode("div",{"aria-describedby":"modalDescription","aria-labelledby":"modalTitle",class:s.normalizeClass(`
20
20
  ${i.hasSideBar?i.sideBarPosition:""}
21
21
  ${i.hasBodyScrolling?"":"modal-auto-height"}
22
22
  ${i.fitContent?"modal modal-fit-content":"modal"}
@@ -418,4 +418,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
418
418
  *
419
419
  * Date: 2023-09-17T03:44:19.860Z
420
420
  */function Gy(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(i,o).enumerable})),t.push.apply(t,n)}return t}function Wy(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Gy(Object(t),!0).forEach(function(n){Av(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Gy(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function xc(i){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xc(i)}function zv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Hy(i,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,$y(n.key),n)}}function mv(i,e,t){return e&&Hy(i.prototype,e),t&&Hy(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function Av(i,e,t){return e=$y(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Fy(i){return Tv(i)||xv(i)||Lv(i)||Ev()}function Tv(i){if(Array.isArray(i))return Lc(i)}function xv(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Lv(i,e){if(i){if(typeof i=="string")return Lc(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Lc(i,e)}}function Lc(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=i[t];return n}function Ev(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
421
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bv(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function $y(i){var e=bv(i,"string");return typeof e=="symbol"?e:String(e)}var es=typeof window<"u"&&typeof window.document<"u",ei=es?window:{},Ec=es&&ei.document.documentElement?"ontouchstart"in ei.document.documentElement:!1,bc=es?"PointerEvent"in ei:!1,Ye="cropper",Oc="all",Jy="crop",Xy="move",Ky="zoom",an="e",sn="w",wn="s",Oi="n",po="ne",zo="nw",mo="se",Ao="sw",Cc="".concat(Ye,"-crop"),qy="".concat(Ye,"-disabled"),It="".concat(Ye,"-hidden"),eI="".concat(Ye,"-hide"),Ov="".concat(Ye,"-invisible"),ts="".concat(Ye,"-modal"),wc="".concat(Ye,"-move"),To="".concat(Ye,"Action"),is="".concat(Ye,"Preview"),Sc="crop",tI="move",iI="none",kc="crop",vc="cropend",Qc="cropmove",Yc="cropstart",nI="dblclick",Cv=Ec?"touchstart":"mousedown",wv=Ec?"touchmove":"mousemove",Sv=Ec?"touchend touchcancel":"mouseup",oI=bc?"pointerdown":Cv,rI=bc?"pointermove":wv,aI=bc?"pointerup pointercancel":Sv,sI="ready",lI="resize",MI="wheel",Uc="zoom",cI="image/jpeg",kv=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,vv=/^data:/,Qv=/^data:image\/jpeg;base64,/,Yv=/^img|canvas$/i,uI=200,gI=100,dI={viewMode:0,dragMode:Sc,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:uI,minContainerHeight:gI,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Uv='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',_v=Number.isNaN||ei.isNaN;function De(i){return typeof i=="number"&&!_v(i)}var NI=function(e){return e>0&&e<1/0};function _c(i){return typeof i>"u"}function ln(i){return xc(i)==="object"&&i!==null}var Bv=Object.prototype.hasOwnProperty;function Sn(i){if(!ln(i))return!1;try{var e=i.constructor,t=e.prototype;return e&&t&&Bv.call(t,"isPrototypeOf")}catch{return!1}}function ht(i){return typeof i=="function"}var Pv=Array.prototype.slice;function jI(i){return Array.from?Array.from(i):Pv.call(i)}function Ke(i,e){return i&&ht(e)&&(Array.isArray(i)||De(i.length)?jI(i).forEach(function(t,n){e.call(i,t,n,i)}):ln(i)&&Object.keys(i).forEach(function(t){e.call(i,i[t],t,i)})),i}var Ue=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return ln(e)&&n.length>0&&n.forEach(function(r){ln(r)&&Object.keys(r).forEach(function(a){e[a]=r[a]})}),e},Rv=/\.\d*(?:0|9){12}\d*$/;function kn(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Rv.test(i)?Math.round(i*e)/e:i}var Zv=/^width|height|left|top|marginLeft|marginTop$/;function Ci(i,e){var t=i.style;Ke(e,function(n,o){Zv.test(o)&&De(n)&&(n="".concat(n,"px")),t[o]=n})}function Vv(i,e){return i.classList?i.classList.contains(e):i.className.indexOf(e)>-1}function tt(i,e){if(e){if(De(i.length)){Ke(i,function(n){tt(n,e)});return}if(i.classList){i.classList.add(e);return}var t=i.className.trim();t?t.indexOf(e)<0&&(i.className="".concat(t," ").concat(e)):i.className=e}}function ti(i,e){if(e){if(De(i.length)){Ke(i,function(t){ti(t,e)});return}if(i.classList){i.classList.remove(e);return}i.className.indexOf(e)>=0&&(i.className=i.className.replace(e,""))}}function vn(i,e,t){if(e){if(De(i.length)){Ke(i,function(n){vn(n,e,t)});return}t?tt(i,e):ti(i,e)}}var Gv=/([a-z\d])([A-Z])/g;function Bc(i){return i.replace(Gv,"$1-$2").toLowerCase()}function Pc(i,e){return ln(i[e])?i[e]:i.dataset?i.dataset[e]:i.getAttribute("data-".concat(Bc(e)))}function xo(i,e,t){ln(t)?i[e]=t:i.dataset?i.dataset[e]=t:i.setAttribute("data-".concat(Bc(e)),t)}function Wv(i,e){if(ln(i[e]))try{delete i[e]}catch{i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch{i.dataset[e]=void 0}else i.removeAttribute("data-".concat(Bc(e)))}var yI=/\s\s*/,II=function(){var i=!1;if(es){var e=!1,t=function(){},n=Object.defineProperty({},"once",{get:function(){return i=!0,e},set:function(r){e=r}});ei.addEventListener("test",t,n),ei.removeEventListener("test",t,n)}return i}();function Rt(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=t;e.trim().split(yI).forEach(function(r){if(!II){var a=i.listeners;a&&a[r]&&a[r][t]&&(o=a[r][t],delete a[r][t],Object.keys(a[r]).length===0&&delete a[r],Object.keys(a).length===0&&delete i.listeners)}i.removeEventListener(r,o,n)})}function Ot(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=t;e.trim().split(yI).forEach(function(r){if(n.once&&!II){var a=i.listeners,l=a===void 0?{}:a;o=function(){delete l[r][t],i.removeEventListener(r,o,n);for(var c=arguments.length,u=new Array(c),g=0;g<c;g++)u[g]=arguments[g];t.apply(i,u)},l[r]||(l[r]={}),l[r][t]&&i.removeEventListener(r,l[r][t],n),l[r][t]=o,i.listeners=l}i.addEventListener(r,o,n)})}function Qn(i,e,t){var n;return ht(Event)&&ht(CustomEvent)?n=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!0,!0,t)),i.dispatchEvent(n)}function hI(i){var e=i.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var Rc=ei.location,Hv=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function DI(i){var e=i.match(Hv);return e!==null&&(e[1]!==Rc.protocol||e[2]!==Rc.hostname||e[3]!==Rc.port)}function fI(i){var e="timestamp=".concat(new Date().getTime());return i+(i.indexOf("?")===-1?"?":"&")+e}function Lo(i){var e=i.rotate,t=i.scaleX,n=i.scaleY,o=i.translateX,r=i.translateY,a=[];De(o)&&o!==0&&a.push("translateX(".concat(o,"px)")),De(r)&&r!==0&&a.push("translateY(".concat(r,"px)")),De(e)&&e!==0&&a.push("rotate(".concat(e,"deg)")),De(t)&&t!==1&&a.push("scaleX(".concat(t,")")),De(n)&&n!==1&&a.push("scaleY(".concat(n,")"));var l=a.length?a.join(" "):"none";return{WebkitTransform:l,msTransform:l,transform:l}}function Fv(i){var e=Wy({},i),t=0;return Ke(i,function(n,o){delete e[o],Ke(e,function(r){var a=Math.abs(n.startX-r.startX),l=Math.abs(n.startY-r.startY),M=Math.abs(n.endX-r.endX),c=Math.abs(n.endY-r.endY),u=Math.sqrt(a*a+l*l),g=Math.sqrt(M*M+c*c),d=(g-u)/u;Math.abs(d)>Math.abs(t)&&(t=d)})}),t}function ns(i,e){var t=i.pageX,n=i.pageY,o={endX:t,endY:n};return e?o:Wy({startX:t,startY:n},o)}function $v(i){var e=0,t=0,n=0;return Ke(i,function(o){var r=o.startX,a=o.startY;e+=r,t+=a,n+=1}),e/=n,t/=n,{pageX:e,pageY:t}}function wi(i){var e=i.aspectRatio,t=i.height,n=i.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=NI(n),a=NI(t);if(r&&a){var l=t*e;o==="contain"&&l>n||o==="cover"&&l<n?t=n/e:n=t*e}else r?t=n/e:a&&(n=t*e);return{width:n,height:t}}function Jv(i){var e=i.width,t=i.height,n=i.degree;if(n=Math.abs(n)%180,n===90)return{width:t,height:e};var o=n%90*Math.PI/180,r=Math.sin(o),a=Math.cos(o),l=e*a+t*r,M=e*r+t*a;return n>90?{width:M,height:l}:{width:l,height:M}}function Xv(i,e,t,n){var o=e.aspectRatio,r=e.naturalWidth,a=e.naturalHeight,l=e.rotate,M=l===void 0?0:l,c=e.scaleX,u=c===void 0?1:c,g=e.scaleY,d=g===void 0?1:g,y=t.aspectRatio,j=t.naturalWidth,D=t.naturalHeight,I=n.fillColor,N=I===void 0?"transparent":I,m=n.imageSmoothingEnabled,b=m===void 0?!0:m,C=n.imageSmoothingQuality,E=C===void 0?"low":C,A=n.maxWidth,O=A===void 0?1/0:A,f=n.maxHeight,z=f===void 0?1/0:f,L=n.minWidth,p=L===void 0?0:L,h=n.minHeight,T=h===void 0?0:h,w=document.createElement("canvas"),x=w.getContext("2d"),S=wi({aspectRatio:y,width:O,height:z}),v=wi({aspectRatio:y,width:p,height:T},"cover"),k=Math.min(S.width,Math.max(v.width,j)),P=Math.min(S.height,Math.max(v.height,D)),W=wi({aspectRatio:o,width:O,height:z}),Q=wi({aspectRatio:o,width:p,height:T},"cover"),_=Math.min(W.width,Math.max(Q.width,r)),$=Math.min(W.height,Math.max(Q.height,a)),ne=[-_/2,-$/2,_,$];return w.width=kn(k),w.height=kn(P),x.fillStyle=N,x.fillRect(0,0,k,P),x.save(),x.translate(k/2,P/2),x.rotate(M*Math.PI/180),x.scale(u,d),x.imageSmoothingEnabled=b,x.imageSmoothingQuality=E,x.drawImage.apply(x,[i].concat(Fy(ne.map(function(ie){return Math.floor(kn(ie))})))),x.restore(),w}var pI=String.fromCharCode;function Kv(i,e,t){var n="";t+=e;for(var o=e;o<t;o+=1)n+=pI(i.getUint8(o));return n}var qv=/^data:.*,/;function e3(i){var e=i.replace(qv,""),t=atob(e),n=new ArrayBuffer(t.length),o=new Uint8Array(n);return Ke(o,function(r,a){o[a]=t.charCodeAt(a)}),n}function t3(i,e){for(var t=[],n=8192,o=new Uint8Array(i);o.length>0;)t.push(pI.apply(null,jI(o.subarray(0,n)))),o=o.subarray(n);return"data:".concat(e,";base64,").concat(btoa(t.join("")))}function i3(i){var e=new DataView(i),t;try{var n,o,r;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var a=e.byteLength,l=2;l+1<a;){if(e.getUint8(l)===255&&e.getUint8(l+1)===225){o=l;break}l+=1}if(o){var M=o+4,c=o+10;if(Kv(e,M,4)==="Exif"){var u=e.getUint16(c);if(n=u===18761,(n||u===19789)&&e.getUint16(c+2,n)===42){var g=e.getUint32(c+4,n);g>=8&&(r=c+g)}}}if(r){var d=e.getUint16(r,n),y,j;for(j=0;j<d;j+=1)if(y=r+j*12+2,e.getUint16(y,n)===274){y+=8,t=e.getUint16(y,n),e.setUint16(y,1,n);break}}}catch{t=1}return t}function n3(i){var e=0,t=1,n=1;switch(i){case 2:t=-1;break;case 3:e=-180;break;case 4:n=-1;break;case 5:e=90,n=-1;break;case 6:e=90;break;case 7:e=90,t=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:t,scaleY:n}}var o3={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,n=this.container,o=this.cropper,r=Number(t.minContainerWidth),a=Number(t.minContainerHeight);tt(o,It),ti(e,It);var l={width:Math.max(n.offsetWidth,r>=0?r:uI),height:Math.max(n.offsetHeight,a>=0?a:gI)};this.containerData=l,Ci(o,{width:l.width,height:l.height}),tt(e,It),ti(o,It)},initCanvas:function(){var e=this.containerData,t=this.imageData,n=this.options.viewMode,o=Math.abs(t.rotate)%180===90,r=o?t.naturalHeight:t.naturalWidth,a=o?t.naturalWidth:t.naturalHeight,l=r/a,M=e.width,c=e.height;e.height*l>e.width?n===3?M=e.height*l:c=e.width/l:n===3?c=e.width/l:M=e.height*l;var u={aspectRatio:l,naturalWidth:r,naturalHeight:a,width:M,height:c};this.canvasData=u,this.limited=n===1||n===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(e.width-u.width)/2,u.top=(e.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=Ue({},u)},limitCanvas:function(e,t){var n=this.options,o=this.containerData,r=this.canvasData,a=this.cropBoxData,l=n.viewMode,M=r.aspectRatio,c=this.cropped&&a;if(e){var u=Number(n.minCanvasWidth)||0,g=Number(n.minCanvasHeight)||0;l>1?(u=Math.max(u,o.width),g=Math.max(g,o.height),l===3&&(g*M>u?u=g*M:g=u/M)):l>0&&(u?u=Math.max(u,c?a.width:0):g?g=Math.max(g,c?a.height:0):c&&(u=a.width,g=a.height,g*M>u?u=g*M:g=u/M));var d=wi({aspectRatio:M,width:u,height:g});u=d.width,g=d.height,r.minWidth=u,r.minHeight=g,r.maxWidth=1/0,r.maxHeight=1/0}if(t)if(l>(c?0:1)){var y=o.width-r.width,j=o.height-r.height;r.minLeft=Math.min(0,y),r.minTop=Math.min(0,j),r.maxLeft=Math.max(0,y),r.maxTop=Math.max(0,j),c&&this.limited&&(r.minLeft=Math.min(a.left,a.left+(a.width-r.width)),r.minTop=Math.min(a.top,a.top+(a.height-r.height)),r.maxLeft=a.left,r.maxTop=a.top,l===2&&(r.width>=o.width&&(r.minLeft=Math.min(0,y),r.maxLeft=Math.max(0,y)),r.height>=o.height&&(r.minTop=Math.min(0,j),r.maxTop=Math.max(0,j))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=o.width,r.maxTop=o.height},renderCanvas:function(e,t){var n=this.canvasData,o=this.imageData;if(t){var r=Jv({width:o.naturalWidth*Math.abs(o.scaleX||1),height:o.naturalHeight*Math.abs(o.scaleY||1),degree:o.rotate||0}),a=r.width,l=r.height,M=n.width*(a/n.naturalWidth),c=n.height*(l/n.naturalHeight);n.left-=(M-n.width)/2,n.top-=(c-n.height)/2,n.width=M,n.height=c,n.aspectRatio=a/l,n.naturalWidth=a,n.naturalHeight=l,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,Ci(this.canvas,Ue({width:n.width,height:n.height},Lo({translateX:n.left,translateY:n.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,n=this.imageData,o=n.naturalWidth*(t.width/t.naturalWidth),r=n.naturalHeight*(t.height/t.naturalHeight);Ue(n,{width:o,height:r,left:(t.width-o)/2,top:(t.height-r)/2}),Ci(this.image,Ue({width:n.width,height:n.height},Lo(Ue({translateX:n.left,translateY:n.top},n)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,n=e.aspectRatio||e.initialAspectRatio,o=Number(e.autoCropArea)||.8,r={width:t.width,height:t.height};n&&(t.height*n>t.width?r.height=r.width/n:r.width=r.height*n),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*o),r.height=Math.max(r.minHeight,r.height*o),r.left=t.left+(t.width-r.width)/2,r.top=t.top+(t.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=Ue({},r)},limitCropBox:function(e,t){var n=this.options,o=this.containerData,r=this.canvasData,a=this.cropBoxData,l=this.limited,M=n.aspectRatio;if(e){var c=Number(n.minCropBoxWidth)||0,u=Number(n.minCropBoxHeight)||0,g=l?Math.min(o.width,r.width,r.width+r.left,o.width-r.left):o.width,d=l?Math.min(o.height,r.height,r.height+r.top,o.height-r.top):o.height;c=Math.min(c,o.width),u=Math.min(u,o.height),M&&(c&&u?u*M>c?u=c/M:c=u*M:c?u=c/M:u&&(c=u*M),d*M>g?d=g/M:g=d*M),a.minWidth=Math.min(c,g),a.minHeight=Math.min(u,d),a.maxWidth=g,a.maxHeight=d}t&&(l?(a.minLeft=Math.max(0,r.left),a.minTop=Math.max(0,r.top),a.maxLeft=Math.min(o.width,r.left+r.width)-a.width,a.maxTop=Math.min(o.height,r.top+r.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=o.width-a.width,a.maxTop=o.height-a.height))},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,e.movable&&e.cropBoxMovable&&xo(this.face,To,n.width>=t.width&&n.height>=t.height?Xy:Oc),Ci(this.cropBox,Ue({width:n.width,height:n.height},Lo({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Qn(this.element,kc,this.getData())}},r3={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,o=t?this.crossOriginUrl:this.url,r=e.alt||"The image to preview",a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=o,a.alt=r,this.viewBox.appendChild(a),this.viewBoxImage=a,!!n){var l=n;typeof n=="string"?l=e.ownerDocument.querySelectorAll(n):n.querySelector&&(l=[n]),this.previews=l,Ke(l,function(M){var c=document.createElement("img");xo(M,is,{width:M.offsetWidth,height:M.offsetHeight,html:M.innerHTML}),t&&(c.crossOrigin=t),c.src=o,c.alt=r,c.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',M.innerHTML="",M.appendChild(c)})}},resetPreview:function(){Ke(this.previews,function(e){var t=Pc(e,is);Ci(e,{width:t.width,height:t.height}),e.innerHTML=t.html,Wv(e,is)})},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,o=n.width,r=n.height,a=e.width,l=e.height,M=n.left-t.left-e.left,c=n.top-t.top-e.top;!this.cropped||this.disabled||(Ci(this.viewBoxImage,Ue({width:a,height:l},Lo(Ue({translateX:-M,translateY:-c},e)))),Ke(this.previews,function(u){var g=Pc(u,is),d=g.width,y=g.height,j=d,D=y,I=1;o&&(I=d/o,D=r*I),r&&D>y&&(I=y/r,j=o*I,D=y),Ci(u,{width:j,height:D}),Ci(u.getElementsByTagName("img")[0],Ue({width:a*I,height:l*I},Lo(Ue({translateX:-M*I,translateY:-c*I},e))))}))}},a3={bind:function(){var e=this.element,t=this.options,n=this.cropper;ht(t.cropstart)&&Ot(e,Yc,t.cropstart),ht(t.cropmove)&&Ot(e,Qc,t.cropmove),ht(t.cropend)&&Ot(e,vc,t.cropend),ht(t.crop)&&Ot(e,kc,t.crop),ht(t.zoom)&&Ot(e,Uc,t.zoom),Ot(n,oI,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Ot(n,MI,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Ot(n,nI,this.onDblclick=this.dblclick.bind(this)),Ot(e.ownerDocument,rI,this.onCropMove=this.cropMove.bind(this)),Ot(e.ownerDocument,aI,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Ot(window,lI,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,n=this.cropper;ht(t.cropstart)&&Rt(e,Yc,t.cropstart),ht(t.cropmove)&&Rt(e,Qc,t.cropmove),ht(t.cropend)&&Rt(e,vc,t.cropend),ht(t.crop)&&Rt(e,kc,t.crop),ht(t.zoom)&&Rt(e,Uc,t.zoom),Rt(n,oI,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Rt(n,MI,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Rt(n,nI,this.onDblclick),Rt(e.ownerDocument,rI,this.onCropMove),Rt(e.ownerDocument,aI,this.onCropEnd),t.responsive&&Rt(window,lI,this.onResize)}},s3={resize:function(){if(!this.disabled){var e=this.options,t=this.container,n=this.containerData,o=t.offsetWidth/n.width,r=t.offsetHeight/n.height,a=Math.abs(o-1)>Math.abs(r-1)?o:r;if(a!==1){var l,M;e.restore&&(l=this.getCanvasData(),M=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(Ke(l,function(c,u){l[u]=c*a})),this.setCropBoxData(Ke(M,function(c,u){M[u]=c*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===iI||this.setDragMode(Vv(this.dragBox,Cc)?tI:Sc)},wheel:function(e){var t=this,n=Number(this.options.wheelZoomRatio)||.1,o=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?o=e.deltaY>0?1:-1:e.wheelDelta?o=-e.wheelDelta/120:e.detail&&(o=e.detail>0?1:-1),this.zoom(-o*n,e)))},cropStart:function(e){var t=e.buttons,n=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(De(t)&&t!==1||De(n)&&n!==0||e.ctrlKey))){var o=this.options,r=this.pointers,a;e.changedTouches?Ke(e.changedTouches,function(l){r[l.identifier]=ns(l)}):r[e.pointerId||0]=ns(e),Object.keys(r).length>1&&o.zoomable&&o.zoomOnTouch?a=Ky:a=Pc(e.target,To),kv.test(a)&&Qn(this.element,Yc,{originalEvent:e,action:a})!==!1&&(e.preventDefault(),this.action=a,this.cropping=!1,a===Jy&&(this.cropping=!0,tt(this.dragBox,ts)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var n=this.pointers;e.preventDefault(),Qn(this.element,Qc,{originalEvent:e,action:t})!==!1&&(e.changedTouches?Ke(e.changedTouches,function(o){Ue(n[o.identifier]||{},ns(o,!0))}):Ue(n[e.pointerId||0]||{},ns(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers;e.changedTouches?Ke(e.changedTouches,function(o){delete n[o.identifier]}):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,vn(this.dragBox,ts,this.cropped&&this.options.modal)),Qn(this.element,vc,{originalEvent:e,action:t}))}}},l3={change:function(e){var t=this.options,n=this.canvasData,o=this.containerData,r=this.cropBoxData,a=this.pointers,l=this.action,M=t.aspectRatio,c=r.left,u=r.top,g=r.width,d=r.height,y=c+g,j=u+d,D=0,I=0,N=o.width,m=o.height,b=!0,C;!M&&e.shiftKey&&(M=g&&d?g/d:1),this.limited&&(D=r.minLeft,I=r.minTop,N=D+Math.min(o.width,n.width,n.left+n.width),m=I+Math.min(o.height,n.height,n.top+n.height));var E=a[Object.keys(a)[0]],A={x:E.endX-E.startX,y:E.endY-E.startY},O=function(z){switch(z){case an:y+A.x>N&&(A.x=N-y);break;case sn:c+A.x<D&&(A.x=D-c);break;case Oi:u+A.y<I&&(A.y=I-u);break;case wn:j+A.y>m&&(A.y=m-j);break}};switch(l){case Oc:c+=A.x,u+=A.y;break;case an:if(A.x>=0&&(y>=N||M&&(u<=I||j>=m))){b=!1;break}O(an),g+=A.x,g<0&&(l=sn,g=-g,c-=g),M&&(d=g/M,u+=(r.height-d)/2);break;case Oi:if(A.y<=0&&(u<=I||M&&(c<=D||y>=N))){b=!1;break}O(Oi),d-=A.y,u+=A.y,d<0&&(l=wn,d=-d,u-=d),M&&(g=d*M,c+=(r.width-g)/2);break;case sn:if(A.x<=0&&(c<=D||M&&(u<=I||j>=m))){b=!1;break}O(sn),g-=A.x,c+=A.x,g<0&&(l=an,g=-g,c-=g),M&&(d=g/M,u+=(r.height-d)/2);break;case wn:if(A.y>=0&&(j>=m||M&&(c<=D||y>=N))){b=!1;break}O(wn),d+=A.y,d<0&&(l=Oi,d=-d,u-=d),M&&(g=d*M,c+=(r.width-g)/2);break;case po:if(M){if(A.y<=0&&(u<=I||y>=N)){b=!1;break}O(Oi),d-=A.y,u+=A.y,g=d*M}else O(Oi),O(an),A.x>=0?y<N?g+=A.x:A.y<=0&&u<=I&&(b=!1):g+=A.x,A.y<=0?u>I&&(d-=A.y,u+=A.y):(d-=A.y,u+=A.y);g<0&&d<0?(l=Ao,d=-d,g=-g,u-=d,c-=g):g<0?(l=zo,g=-g,c-=g):d<0&&(l=mo,d=-d,u-=d);break;case zo:if(M){if(A.y<=0&&(u<=I||c<=D)){b=!1;break}O(Oi),d-=A.y,u+=A.y,g=d*M,c+=r.width-g}else O(Oi),O(sn),A.x<=0?c>D?(g-=A.x,c+=A.x):A.y<=0&&u<=I&&(b=!1):(g-=A.x,c+=A.x),A.y<=0?u>I&&(d-=A.y,u+=A.y):(d-=A.y,u+=A.y);g<0&&d<0?(l=mo,d=-d,g=-g,u-=d,c-=g):g<0?(l=po,g=-g,c-=g):d<0&&(l=Ao,d=-d,u-=d);break;case Ao:if(M){if(A.x<=0&&(c<=D||j>=m)){b=!1;break}O(sn),g-=A.x,c+=A.x,d=g/M}else O(wn),O(sn),A.x<=0?c>D?(g-=A.x,c+=A.x):A.y>=0&&j>=m&&(b=!1):(g-=A.x,c+=A.x),A.y>=0?j<m&&(d+=A.y):d+=A.y;g<0&&d<0?(l=po,d=-d,g=-g,u-=d,c-=g):g<0?(l=mo,g=-g,c-=g):d<0&&(l=zo,d=-d,u-=d);break;case mo:if(M){if(A.x>=0&&(y>=N||j>=m)){b=!1;break}O(an),g+=A.x,d=g/M}else O(wn),O(an),A.x>=0?y<N?g+=A.x:A.y>=0&&j>=m&&(b=!1):g+=A.x,A.y>=0?j<m&&(d+=A.y):d+=A.y;g<0&&d<0?(l=zo,d=-d,g=-g,u-=d,c-=g):g<0?(l=Ao,g=-g,c-=g):d<0&&(l=po,d=-d,u-=d);break;case Xy:this.move(A.x,A.y),b=!1;break;case Ky:this.zoom(Fv(a),e),b=!1;break;case Jy:if(!A.x||!A.y){b=!1;break}C=hI(this.cropper),c=E.startX-C.left,u=E.startY-C.top,g=r.minWidth,d=r.minHeight,A.x>0?l=A.y>0?mo:po:A.x<0&&(c-=g,l=A.y>0?Ao:zo),A.y<0&&(u-=d),this.cropped||(ti(this.cropBox,It),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}b&&(r.width=g,r.height=d,r.left=c,r.top=u,this.action=l,this.renderCropBox()),Ke(a,function(f){f.startX=f.endX,f.startY=f.endY})}},M3={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&tt(this.dragBox,ts),ti(this.cropBox,It),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Ue({},this.initialImageData),this.canvasData=Ue({},this.initialCanvasData),this.cropBoxData=Ue({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Ue(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ti(this.dragBox,ts),tt(this.cropBox,It)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,Ke(this.previews,function(n){n.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,ti(this.cropper,qy)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,tt(this.cropper,qy)),this},destroy:function(){var e=this.element;return e[Ye]?(e[Ye]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,o=n.left,r=n.top;return this.moveTo(_c(e)?e:o+Number(e),_c(t)?t:r+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,o=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(De(e)&&(n.left=e,o=!0),De(t)&&(n.top=t,o=!0),o&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var o=this.options,r=this.canvasData,a=r.width,l=r.height,M=r.naturalWidth,c=r.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&o.zoomable){var u=M*e,g=c*e;if(Qn(this.element,Uc,{ratio:e,oldRatio:a/M,originalEvent:n})===!1)return this;if(n){var d=this.pointers,y=hI(this.cropper),j=d&&Object.keys(d).length?$v(d):{pageX:n.pageX,pageY:n.pageY};r.left-=(u-a)*((j.pageX-y.left-r.left)/a),r.top-=(g-l)*((j.pageY-y.top-r.top)/l)}else Sn(t)&&De(t.x)&&De(t.y)?(r.left-=(u-a)*((t.x-r.left)/a),r.top-=(g-l)*((t.y-r.top)/l)):(r.left-=(u-a)/2,r.top-=(g-l)/2);r.width=u,r.height=g,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),De(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,De(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(De(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.imageData,o=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(De(e)&&(n.scaleX=e,o=!0),De(t)&&(n.scaleY=t,o=!0),o&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,n=this.imageData,o=this.canvasData,r=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:r.left-o.left,y:r.top-o.top,width:r.width,height:r.height};var l=n.width/n.naturalWidth;if(Ke(a,function(u,g){a[g]=u/l}),e){var M=Math.round(a.y+a.height),c=Math.round(a.x+a.width);a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=c-a.x,a.height=M-a.y}}else a={x:0,y:0,width:0,height:0};return t.rotatable&&(a.rotate=n.rotate||0),t.scalable&&(a.scaleX=n.scaleX||1,a.scaleY=n.scaleY||1),a},setData:function(e){var t=this.options,n=this.imageData,o=this.canvasData,r={};if(this.ready&&!this.disabled&&Sn(e)){var a=!1;t.rotatable&&De(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,a=!0),t.scalable&&(De(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,a=!0),De(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var l=n.width/n.naturalWidth;De(e.x)&&(r.left=e.x*l+o.left),De(e.y)&&(r.top=e.y*l+o.top),De(e.width)&&(r.width=e.width*l),De(e.height)&&(r.height=e.height*l),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?Ue({},this.containerData):{}},getImageData:function(){return this.sized?Ue({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&Ke(["left","top","width","height","naturalWidth","naturalHeight"],function(n){t[n]=e[n]}),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio;return this.ready&&!this.disabled&&Sn(e)&&(De(e.left)&&(t.left=e.left),De(e.top)&&(t.top=e.top),De(e.width)?(t.width=e.width,t.height=e.width/n):De(e.height)&&(t.height=e.height,t.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,n=this.options.aspectRatio,o,r;return this.ready&&this.cropped&&!this.disabled&&Sn(e)&&(De(e.left)&&(t.left=e.left),De(e.top)&&(t.top=e.top),De(e.width)&&e.width!==t.width&&(o=!0,t.width=e.width),De(e.height)&&e.height!==t.height&&(r=!0,t.height=e.height),n&&(o?t.height=t.width/n:r&&(t.width=t.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,n=Xv(this.image,this.imageData,t,e);if(!this.cropped)return n;var o=this.getData(e.rounded),r=o.x,a=o.y,l=o.width,M=o.height,c=n.width/Math.floor(t.naturalWidth);c!==1&&(r*=c,a*=c,l*=c,M*=c);var u=l/M,g=wi({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),d=wi({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),y=wi({aspectRatio:u,width:e.width||(c!==1?n.width:l),height:e.height||(c!==1?n.height:M)}),j=y.width,D=y.height;j=Math.min(g.width,Math.max(d.width,j)),D=Math.min(g.height,Math.max(d.height,D));var I=document.createElement("canvas"),N=I.getContext("2d");I.width=kn(j),I.height=kn(D),N.fillStyle=e.fillColor||"transparent",N.fillRect(0,0,j,D);var m=e.imageSmoothingEnabled,b=m===void 0?!0:m,C=e.imageSmoothingQuality;N.imageSmoothingEnabled=b,C&&(N.imageSmoothingQuality=C);var E=n.width,A=n.height,O=r,f=a,z,L,p,h,T,w;O<=-l||O>E?(O=0,z=0,p=0,T=0):O<=0?(p=-O,O=0,z=Math.min(E,l+O),T=z):O<=E&&(p=0,z=Math.min(l,E-O),T=z),z<=0||f<=-M||f>A?(f=0,L=0,h=0,w=0):f<=0?(h=-f,f=0,L=Math.min(A,M+f),w=L):f<=A&&(h=0,L=Math.min(M,A-f),w=L);var x=[O,f,z,L];if(T>0&&w>0){var S=j/l;x.push(p*S,h*S,T*S,w*S)}return N.drawImage.apply(N,[n].concat(Fy(x.map(function(v){return Math.floor(kn(v))})))),I},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!_c(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,o=this.face;if(this.ready&&!this.disabled){var r=e===Sc,a=t.movable&&e===tI;e=r||a?e:iI,t.dragMode=e,xo(n,To,e),vn(n,Cc,r),vn(n,wc,a),t.cropBoxMovable||(xo(o,To,e),vn(o,Cc,r),vn(o,wc,a))}return this}},c3=ei.Cropper,zI=function(){function i(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(zv(this,i),!e||!Yv.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Ue({},dI,Sn(t)&&t),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return mv(i,[{key:"init",value:function(){var t=this.element,n=t.tagName.toLowerCase(),o;if(!t[Ye]){if(t[Ye]=this,n==="img"){if(this.isImg=!0,o=t.getAttribute("src")||"",this.originalUrl=o,!o)return;o=t.src}else n==="canvas"&&window.HTMLCanvasElement&&(o=t.toDataURL());this.load(o)}}},{key:"load",value:function(t){var n=this;if(t){this.url=t,this.imageData={};var o=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(vv.test(t)){Qv.test(t)?this.read(e3(t)):this.clone();return}var a=new XMLHttpRequest,l=this.clone.bind(this);this.reloading=!0,this.xhr=a,a.onabort=l,a.onerror=l,a.ontimeout=l,a.onprogress=function(){a.getResponseHeader("content-type")!==cI&&a.abort()},a.onload=function(){n.read(a.response)},a.onloadend=function(){n.reloading=!1,n.xhr=null},r.checkCrossOrigin&&DI(t)&&o.crossOrigin&&(t=fI(t)),a.open("GET",t,!0),a.responseType="arraybuffer",a.withCredentials=o.crossOrigin==="use-credentials",a.send()}}},{key:"read",value:function(t){var n=this.options,o=this.imageData,r=i3(t),a=0,l=1,M=1;if(r>1){this.url=t3(t,cI);var c=n3(r);a=c.rotate,l=c.scaleX,M=c.scaleY}n.rotatable&&(o.rotate=a),n.scalable&&(o.scaleX=l,o.scaleY=M),this.clone()}},{key:"clone",value:function(){var t=this.element,n=this.url,o=t.crossOrigin,r=n;this.options.checkCrossOrigin&&DI(n)&&(o||(o="anonymous"),r=fI(n)),this.crossOrigin=o,this.crossOriginUrl=r;var a=document.createElement("img");o&&(a.crossOrigin=o),a.src=r||n,a.alt=t.alt||"The image to crop",this.image=a,a.onload=this.start.bind(this),a.onerror=this.stop.bind(this),tt(a,eI),t.parentNode.insertBefore(a,t.nextSibling)}},{key:"start",value:function(){var t=this,n=this.image;n.onload=null,n.onerror=null,this.sizing=!0;var o=ei.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ei.navigator.userAgent),r=function(c,u){Ue(t.imageData,{naturalWidth:c,naturalHeight:u,aspectRatio:c/u}),t.initialImageData=Ue({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(n.naturalWidth&&!o){r(n.naturalWidth,n.naturalHeight);return}var a=document.createElement("img"),l=document.body||document.documentElement;this.sizingImage=a,a.onload=function(){r(a.width,a.height),o||l.removeChild(a)},a.src=n.src,o||(a.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",l.appendChild(a))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var t=this.element,n=this.options,o=this.image,r=t.parentNode,a=document.createElement("div");a.innerHTML=Uv;var l=a.querySelector(".".concat(Ye,"-container")),M=l.querySelector(".".concat(Ye,"-canvas")),c=l.querySelector(".".concat(Ye,"-drag-box")),u=l.querySelector(".".concat(Ye,"-crop-box")),g=u.querySelector(".".concat(Ye,"-face"));this.container=r,this.cropper=l,this.canvas=M,this.dragBox=c,this.cropBox=u,this.viewBox=l.querySelector(".".concat(Ye,"-view-box")),this.face=g,M.appendChild(o),tt(t,It),r.insertBefore(l,t.nextSibling),ti(o,eI),this.initPreview(),this.bind(),n.initialAspectRatio=Math.max(0,n.initialAspectRatio)||NaN,n.aspectRatio=Math.max(0,n.aspectRatio)||NaN,n.viewMode=Math.max(0,Math.min(3,Math.round(n.viewMode)))||0,tt(u,It),n.guides||tt(u.getElementsByClassName("".concat(Ye,"-dashed")),It),n.center||tt(u.getElementsByClassName("".concat(Ye,"-center")),It),n.background&&tt(l,"".concat(Ye,"-bg")),n.highlight||tt(g,Ov),n.cropBoxMovable&&(tt(g,wc),xo(g,To,Oc)),n.cropBoxResizable||(tt(u.getElementsByClassName("".concat(Ye,"-line")),It),tt(u.getElementsByClassName("".concat(Ye,"-point")),It)),this.render(),this.ready=!0,this.setDragMode(n.dragMode),n.autoCrop&&this.crop(),this.setData(n.data),ht(n.ready)&&Ot(t,sI,n.ready,{once:!0}),Qn(t,sI)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),ti(this.element,It)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=c3,i}},{key:"setDefaults",value:function(t){Ue(dI,Sn(t)&&t)}}]),i}();Ue(zI.prototype,o3,r3,a3,s3,l3,M3);const u3={class:"cropper-wrapper_div"},g3={key:0,class:"cropper-wrapper"},d3=s.defineComponent({__name:"ImageCropper",props:{image:{type:File,required:!1,default:null},width:{type:[Number],required:!1,default:360},height:{type:[Number],required:!1,default:0},showPreview:{type:Boolean,required:!1,default:!1},isRound:{type:Boolean,required:!1,default:!1}},emits:["update","sizeError"],setup(i,{emit:e}){const t=i;s.onMounted(()=>{t.image&&c(t.image)}),s.onUpdated(()=>{t.image&&c(t.image)});const n=s.ref(null),o=s.ref(null),r=s.ref(!1),a=s.ref(),l=s.ref(t.width);let M=null;function c(I){const N=new FileReader;N.onload=()=>{n.value.src=N.result,n.value.onload=async()=>{a.value||D(),u(n.value)}},N.readAsDataURL(I)}function u(I){M&&M.destroy(),M=new zI(I,{aspectRatio:1,viewMode:1})}async function g(){let I=M.getCroppedCanvas();const N=await j(I,.5);let m=null;if(t.isRound?m=d(N):m=N,!m)return;if(!await y(m)){e("sizeError");return}o.value&&(o.value.src=m.toDataURL(),r.value=!0),e("update",m)}function d(I){var N=document.createElement("canvas"),m=N.getContext("2d"),b=I.width,C=I.height;return N.width=b,N.height=C,m?(m.imageSmoothingEnabled=!0,m.drawImage(I,0,0,b,C),m.globalCompositeOperation="destination-in",m.beginPath(),m.arc(b/2,C/2,Math.min(b,C)/2,0,2*Math.PI,!0),m.fill(),N):null}async function y(I){return new Promise(N=>{I.toBlob(m=>{m&&(m.size/(1024*1024)>5?N(!1):N(!0))})})}async function j(I,N){return new Promise(m=>{const b=I.width*N,C=I.height*N,E=document.createElement("canvas");E.width=b,E.height=C;const A=E.getContext("2d");A==null||A.drawImage(I,0,0,b,C),m(E)})}function D(){const{value:I}=n,{width:N,height:m}=I,b=(t==null?void 0:t.width)??0,C=(t==null?void 0:t.height)??0,E=b/C,A=N/m,O=A>E,f=O?b:C*A,z=O?b/A:C;l.value=f,a.value=z}return(I,N)=>(s.openBlock(),s.createElementBlock("div",u3,[i.image?(s.openBlock(),s.createElementBlock("div",g3,[s.createElementVNode("div",{id:"cropper-container",class:s.normalizeClass({"rounded-crop":i.isRound}),style:s.normalizeStyle(t.height?{"max-width":l.value+"px",height:a.value+"px"}:{"max-width":i.width+"px"})},[s.createElementVNode("img",{id:"cropper-image",ref_key:"croppingImage",ref:n},null,512)],6),s.createVNode(WM,{class:"cropper-button",color:"primary",size:"small",style:s.normalizeStyle({"max-width":l.value+"px"}),width:"full",onClick:N[0]||(N[0]=s.withModifiers(m=>g(),["prevent"]))},{default:s.withCtx(()=>[s.createTextVNode(" Crop ")]),_:1},8,["style"]),i.showPreview?s.withDirectives((s.openBlock(),s.createElementBlock("img",{key:0,id:"cropper-preview",ref_key:"cropPreview",ref:o},null,512)),[[s.vShow,r.value]]):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)]))}}),aQ="",sQ="",N3={class:"dh-line-chart-container"},j3=He({__name:"LineChart",props:{dataSets:{type:Object,default:()=>({})},title:{type:String,default:""},width:{type:Number,default:40},height:{type:Number,default:20}},setup(i){const e=i;uo.register(hb,jj,xi,Ua,Za,Pa,yb);const t=s.ref(!1),n=s.ref({labels:[],datasets:[]}),o=s.computed(()=>n.value),r=s.ref({responsive:!0,maintainAspectRatio:!0,interaction:{mode:"index",intersect:!1},elements:{point:{radius:0}},stacked:!1,plugins:{title:{display:!0,text:e.title||"Line Chart",position:"top",align:"start",padding:{bottom:25},font:{weight:500,family:"'Rubik-Regular', 'Arial', 'Helvetica', 'sans-serif'",size:16}},tooltip:{callbacks:{title:()=>"",label:function(M){let c=" "+(M.dataset.label[M.dataIndex]||"");return M.parsed.y!==null&&(c+=": "+M.parsed.y),c}}},legend:{display:!1}},scales:{y:{type:"linear",display:!0,position:"left",grid:{display:!1},border:{display:!1},min:0,ticks:{beginAtZero:!0,callback:function(M){return M===this.min||M===this.max?M:""}}},x:{display:!1}}});function a(M){return c=>{const g=c.chart.ctx.createLinearGradient(0,0,0,300);return g.addColorStop(0,M),g.addColorStop(.5,"#fff"),g.addColorStop(1,M),g}}function l(){t.value=!1,Object.keys(e.dataSets).forEach((M,c)=>{const u=e.dataSets[M],g=u.data.map(y=>y.label),d=u.data.map(y=>y.value);n.value.datasets[c]={data:d,label:g,backgroundColor:a(u.backgroundColor),borderRadius:1,borderColor:u.backgroundColor,fill:!0,pointStyle:!1,tension:.1},e.dataSets[M].borderWidth&&(n.value.datasets[c].borderWidth=0),e.dataSets[M].borderWidth||(n.value.datasets[c].spanGaps=!0),n.value.labels=g,s.nextTick(()=>{t.value=!0})})}return s.onBeforeMount(()=>{l()}),s.watch(()=>e.title,M=>{r.value.plugins.title.text=M,r.value={...r.value}}),s.watch(()=>[e.dataSets],()=>{l()},{deep:!0}),(M,c)=>(s.openBlock(),s.createElementBlock("div",N3,[t.value?(s.openBlock(),s.createBlock(s.unref(tO),{key:0,data:o.value,height:i.height,options:r.value,width:i.width},null,8,["data","height","options","width"])):s.createCommentVNode("",!0)]))}},[["__scopeId","data-v-77fa8f51"]]);je.DhAdvancedDatePicker=_O,je.DhAdvancedFilter=$O,je.DhButton=WM,je.DhCopyText=oC,je.DhDatePicker=aC,je.DhDropdownMenu=gC,je.DhError=NC,je.DhExpansionPanel=fC,je.DhFileUpload=VC,je.DhIcon=de,je.DhIconWithText=Yj,je.DhImageCropper=d3,je.DhInput=JC,je.DhInputDropdown=Uj,je.DhInputDropdownMultiple=aw,je.DhInputGroup=gw,je.DhInputList=Kw,je.DhLineChart=j3,je.DhModal=oS,je.DhNotification=gS,je.DhNumberRange=Sj,je.DhPasswordField=hS,je.DhRadioBox=Zj,je.DhRadioBoxGroup=mS,je.DhSearchInput=LS,je.DhStepper=wS,je.DhSwitch=hd,je.DhTag=SS,je.DhTextEditor=gv,je.DhTooltip=vj,je.DhVerificationCode=pv,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});
421
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bv(i,e){if(typeof i!="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function $y(i){var e=bv(i,"string");return typeof e=="symbol"?e:String(e)}var es=typeof window<"u"&&typeof window.document<"u",ei=es?window:{},Ec=es&&ei.document.documentElement?"ontouchstart"in ei.document.documentElement:!1,bc=es?"PointerEvent"in ei:!1,Ye="cropper",Oc="all",Jy="crop",Xy="move",Ky="zoom",an="e",sn="w",wn="s",Oi="n",po="ne",zo="nw",mo="se",Ao="sw",Cc="".concat(Ye,"-crop"),qy="".concat(Ye,"-disabled"),It="".concat(Ye,"-hidden"),eI="".concat(Ye,"-hide"),Ov="".concat(Ye,"-invisible"),ts="".concat(Ye,"-modal"),wc="".concat(Ye,"-move"),To="".concat(Ye,"Action"),is="".concat(Ye,"Preview"),Sc="crop",tI="move",iI="none",kc="crop",vc="cropend",Qc="cropmove",Yc="cropstart",nI="dblclick",Cv=Ec?"touchstart":"mousedown",wv=Ec?"touchmove":"mousemove",Sv=Ec?"touchend touchcancel":"mouseup",oI=bc?"pointerdown":Cv,rI=bc?"pointermove":wv,aI=bc?"pointerup pointercancel":Sv,sI="ready",lI="resize",MI="wheel",Uc="zoom",cI="image/jpeg",kv=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,vv=/^data:/,Qv=/^data:image\/jpeg;base64,/,Yv=/^img|canvas$/i,uI=200,gI=100,dI={viewMode:0,dragMode:Sc,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:uI,minContainerHeight:gI,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Uv='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',_v=Number.isNaN||ei.isNaN;function De(i){return typeof i=="number"&&!_v(i)}var NI=function(e){return e>0&&e<1/0};function _c(i){return typeof i>"u"}function ln(i){return xc(i)==="object"&&i!==null}var Bv=Object.prototype.hasOwnProperty;function Sn(i){if(!ln(i))return!1;try{var e=i.constructor,t=e.prototype;return e&&t&&Bv.call(t,"isPrototypeOf")}catch{return!1}}function ht(i){return typeof i=="function"}var Pv=Array.prototype.slice;function jI(i){return Array.from?Array.from(i):Pv.call(i)}function Ke(i,e){return i&&ht(e)&&(Array.isArray(i)||De(i.length)?jI(i).forEach(function(t,n){e.call(i,t,n,i)}):ln(i)&&Object.keys(i).forEach(function(t){e.call(i,i[t],t,i)})),i}var Ue=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return ln(e)&&n.length>0&&n.forEach(function(r){ln(r)&&Object.keys(r).forEach(function(a){e[a]=r[a]})}),e},Rv=/\.\d*(?:0|9){12}\d*$/;function kn(i){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Rv.test(i)?Math.round(i*e)/e:i}var Zv=/^width|height|left|top|marginLeft|marginTop$/;function Ci(i,e){var t=i.style;Ke(e,function(n,o){Zv.test(o)&&De(n)&&(n="".concat(n,"px")),t[o]=n})}function Vv(i,e){return i.classList?i.classList.contains(e):i.className.indexOf(e)>-1}function tt(i,e){if(e){if(De(i.length)){Ke(i,function(n){tt(n,e)});return}if(i.classList){i.classList.add(e);return}var t=i.className.trim();t?t.indexOf(e)<0&&(i.className="".concat(t," ").concat(e)):i.className=e}}function ti(i,e){if(e){if(De(i.length)){Ke(i,function(t){ti(t,e)});return}if(i.classList){i.classList.remove(e);return}i.className.indexOf(e)>=0&&(i.className=i.className.replace(e,""))}}function vn(i,e,t){if(e){if(De(i.length)){Ke(i,function(n){vn(n,e,t)});return}t?tt(i,e):ti(i,e)}}var Gv=/([a-z\d])([A-Z])/g;function Bc(i){return i.replace(Gv,"$1-$2").toLowerCase()}function Pc(i,e){return ln(i[e])?i[e]:i.dataset?i.dataset[e]:i.getAttribute("data-".concat(Bc(e)))}function xo(i,e,t){ln(t)?i[e]=t:i.dataset?i.dataset[e]=t:i.setAttribute("data-".concat(Bc(e)),t)}function Wv(i,e){if(ln(i[e]))try{delete i[e]}catch{i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch{i.dataset[e]=void 0}else i.removeAttribute("data-".concat(Bc(e)))}var yI=/\s\s*/,II=function(){var i=!1;if(es){var e=!1,t=function(){},n=Object.defineProperty({},"once",{get:function(){return i=!0,e},set:function(r){e=r}});ei.addEventListener("test",t,n),ei.removeEventListener("test",t,n)}return i}();function Rt(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=t;e.trim().split(yI).forEach(function(r){if(!II){var a=i.listeners;a&&a[r]&&a[r][t]&&(o=a[r][t],delete a[r][t],Object.keys(a[r]).length===0&&delete a[r],Object.keys(a).length===0&&delete i.listeners)}i.removeEventListener(r,o,n)})}function Ot(i,e,t){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=t;e.trim().split(yI).forEach(function(r){if(n.once&&!II){var a=i.listeners,l=a===void 0?{}:a;o=function(){delete l[r][t],i.removeEventListener(r,o,n);for(var c=arguments.length,u=new Array(c),g=0;g<c;g++)u[g]=arguments[g];t.apply(i,u)},l[r]||(l[r]={}),l[r][t]&&i.removeEventListener(r,l[r][t],n),l[r][t]=o,i.listeners=l}i.addEventListener(r,o,n)})}function Qn(i,e,t){var n;return ht(Event)&&ht(CustomEvent)?n=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!0,!0,t)),i.dispatchEvent(n)}function hI(i){var e=i.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var Rc=ei.location,Hv=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function DI(i){var e=i.match(Hv);return e!==null&&(e[1]!==Rc.protocol||e[2]!==Rc.hostname||e[3]!==Rc.port)}function fI(i){var e="timestamp=".concat(new Date().getTime());return i+(i.indexOf("?")===-1?"?":"&")+e}function Lo(i){var e=i.rotate,t=i.scaleX,n=i.scaleY,o=i.translateX,r=i.translateY,a=[];De(o)&&o!==0&&a.push("translateX(".concat(o,"px)")),De(r)&&r!==0&&a.push("translateY(".concat(r,"px)")),De(e)&&e!==0&&a.push("rotate(".concat(e,"deg)")),De(t)&&t!==1&&a.push("scaleX(".concat(t,")")),De(n)&&n!==1&&a.push("scaleY(".concat(n,")"));var l=a.length?a.join(" "):"none";return{WebkitTransform:l,msTransform:l,transform:l}}function Fv(i){var e=Wy({},i),t=0;return Ke(i,function(n,o){delete e[o],Ke(e,function(r){var a=Math.abs(n.startX-r.startX),l=Math.abs(n.startY-r.startY),M=Math.abs(n.endX-r.endX),c=Math.abs(n.endY-r.endY),u=Math.sqrt(a*a+l*l),g=Math.sqrt(M*M+c*c),d=(g-u)/u;Math.abs(d)>Math.abs(t)&&(t=d)})}),t}function ns(i,e){var t=i.pageX,n=i.pageY,o={endX:t,endY:n};return e?o:Wy({startX:t,startY:n},o)}function $v(i){var e=0,t=0,n=0;return Ke(i,function(o){var r=o.startX,a=o.startY;e+=r,t+=a,n+=1}),e/=n,t/=n,{pageX:e,pageY:t}}function wi(i){var e=i.aspectRatio,t=i.height,n=i.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=NI(n),a=NI(t);if(r&&a){var l=t*e;o==="contain"&&l>n||o==="cover"&&l<n?t=n/e:n=t*e}else r?t=n/e:a&&(n=t*e);return{width:n,height:t}}function Jv(i){var e=i.width,t=i.height,n=i.degree;if(n=Math.abs(n)%180,n===90)return{width:t,height:e};var o=n%90*Math.PI/180,r=Math.sin(o),a=Math.cos(o),l=e*a+t*r,M=e*r+t*a;return n>90?{width:M,height:l}:{width:l,height:M}}function Xv(i,e,t,n){var o=e.aspectRatio,r=e.naturalWidth,a=e.naturalHeight,l=e.rotate,M=l===void 0?0:l,c=e.scaleX,u=c===void 0?1:c,g=e.scaleY,d=g===void 0?1:g,y=t.aspectRatio,j=t.naturalWidth,D=t.naturalHeight,I=n.fillColor,N=I===void 0?"transparent":I,m=n.imageSmoothingEnabled,b=m===void 0?!0:m,C=n.imageSmoothingQuality,E=C===void 0?"low":C,A=n.maxWidth,O=A===void 0?1/0:A,f=n.maxHeight,z=f===void 0?1/0:f,L=n.minWidth,p=L===void 0?0:L,h=n.minHeight,T=h===void 0?0:h,w=document.createElement("canvas"),x=w.getContext("2d"),S=wi({aspectRatio:y,width:O,height:z}),v=wi({aspectRatio:y,width:p,height:T},"cover"),k=Math.min(S.width,Math.max(v.width,j)),P=Math.min(S.height,Math.max(v.height,D)),W=wi({aspectRatio:o,width:O,height:z}),Q=wi({aspectRatio:o,width:p,height:T},"cover"),_=Math.min(W.width,Math.max(Q.width,r)),$=Math.min(W.height,Math.max(Q.height,a)),ne=[-_/2,-$/2,_,$];return w.width=kn(k),w.height=kn(P),x.fillStyle=N,x.fillRect(0,0,k,P),x.save(),x.translate(k/2,P/2),x.rotate(M*Math.PI/180),x.scale(u,d),x.imageSmoothingEnabled=b,x.imageSmoothingQuality=E,x.drawImage.apply(x,[i].concat(Fy(ne.map(function(ie){return Math.floor(kn(ie))})))),x.restore(),w}var pI=String.fromCharCode;function Kv(i,e,t){var n="";t+=e;for(var o=e;o<t;o+=1)n+=pI(i.getUint8(o));return n}var qv=/^data:.*,/;function e3(i){var e=i.replace(qv,""),t=atob(e),n=new ArrayBuffer(t.length),o=new Uint8Array(n);return Ke(o,function(r,a){o[a]=t.charCodeAt(a)}),n}function t3(i,e){for(var t=[],n=8192,o=new Uint8Array(i);o.length>0;)t.push(pI.apply(null,jI(o.subarray(0,n)))),o=o.subarray(n);return"data:".concat(e,";base64,").concat(btoa(t.join("")))}function i3(i){var e=new DataView(i),t;try{var n,o,r;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var a=e.byteLength,l=2;l+1<a;){if(e.getUint8(l)===255&&e.getUint8(l+1)===225){o=l;break}l+=1}if(o){var M=o+4,c=o+10;if(Kv(e,M,4)==="Exif"){var u=e.getUint16(c);if(n=u===18761,(n||u===19789)&&e.getUint16(c+2,n)===42){var g=e.getUint32(c+4,n);g>=8&&(r=c+g)}}}if(r){var d=e.getUint16(r,n),y,j;for(j=0;j<d;j+=1)if(y=r+j*12+2,e.getUint16(y,n)===274){y+=8,t=e.getUint16(y,n),e.setUint16(y,1,n);break}}}catch{t=1}return t}function n3(i){var e=0,t=1,n=1;switch(i){case 2:t=-1;break;case 3:e=-180;break;case 4:n=-1;break;case 5:e=90,n=-1;break;case 6:e=90;break;case 7:e=90,t=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:t,scaleY:n}}var o3={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,n=this.container,o=this.cropper,r=Number(t.minContainerWidth),a=Number(t.minContainerHeight);tt(o,It),ti(e,It);var l={width:Math.max(n.offsetWidth,r>=0?r:uI),height:Math.max(n.offsetHeight,a>=0?a:gI)};this.containerData=l,Ci(o,{width:l.width,height:l.height}),tt(e,It),ti(o,It)},initCanvas:function(){var e=this.containerData,t=this.imageData,n=this.options.viewMode,o=Math.abs(t.rotate)%180===90,r=o?t.naturalHeight:t.naturalWidth,a=o?t.naturalWidth:t.naturalHeight,l=r/a,M=e.width,c=e.height;e.height*l>e.width?n===3?M=e.height*l:c=e.width/l:n===3?c=e.width/l:M=e.height*l;var u={aspectRatio:l,naturalWidth:r,naturalHeight:a,width:M,height:c};this.canvasData=u,this.limited=n===1||n===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(e.width-u.width)/2,u.top=(e.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=Ue({},u)},limitCanvas:function(e,t){var n=this.options,o=this.containerData,r=this.canvasData,a=this.cropBoxData,l=n.viewMode,M=r.aspectRatio,c=this.cropped&&a;if(e){var u=Number(n.minCanvasWidth)||0,g=Number(n.minCanvasHeight)||0;l>1?(u=Math.max(u,o.width),g=Math.max(g,o.height),l===3&&(g*M>u?u=g*M:g=u/M)):l>0&&(u?u=Math.max(u,c?a.width:0):g?g=Math.max(g,c?a.height:0):c&&(u=a.width,g=a.height,g*M>u?u=g*M:g=u/M));var d=wi({aspectRatio:M,width:u,height:g});u=d.width,g=d.height,r.minWidth=u,r.minHeight=g,r.maxWidth=1/0,r.maxHeight=1/0}if(t)if(l>(c?0:1)){var y=o.width-r.width,j=o.height-r.height;r.minLeft=Math.min(0,y),r.minTop=Math.min(0,j),r.maxLeft=Math.max(0,y),r.maxTop=Math.max(0,j),c&&this.limited&&(r.minLeft=Math.min(a.left,a.left+(a.width-r.width)),r.minTop=Math.min(a.top,a.top+(a.height-r.height)),r.maxLeft=a.left,r.maxTop=a.top,l===2&&(r.width>=o.width&&(r.minLeft=Math.min(0,y),r.maxLeft=Math.max(0,y)),r.height>=o.height&&(r.minTop=Math.min(0,j),r.maxTop=Math.max(0,j))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=o.width,r.maxTop=o.height},renderCanvas:function(e,t){var n=this.canvasData,o=this.imageData;if(t){var r=Jv({width:o.naturalWidth*Math.abs(o.scaleX||1),height:o.naturalHeight*Math.abs(o.scaleY||1),degree:o.rotate||0}),a=r.width,l=r.height,M=n.width*(a/n.naturalWidth),c=n.height*(l/n.naturalHeight);n.left-=(M-n.width)/2,n.top-=(c-n.height)/2,n.width=M,n.height=c,n.aspectRatio=a/l,n.naturalWidth=a,n.naturalHeight=l,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,Ci(this.canvas,Ue({width:n.width,height:n.height},Lo({translateX:n.left,translateY:n.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,n=this.imageData,o=n.naturalWidth*(t.width/t.naturalWidth),r=n.naturalHeight*(t.height/t.naturalHeight);Ue(n,{width:o,height:r,left:(t.width-o)/2,top:(t.height-r)/2}),Ci(this.image,Ue({width:n.width,height:n.height},Lo(Ue({translateX:n.left,translateY:n.top},n)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,n=e.aspectRatio||e.initialAspectRatio,o=Number(e.autoCropArea)||.8,r={width:t.width,height:t.height};n&&(t.height*n>t.width?r.height=r.width/n:r.width=r.height*n),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*o),r.height=Math.max(r.minHeight,r.height*o),r.left=t.left+(t.width-r.width)/2,r.top=t.top+(t.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=Ue({},r)},limitCropBox:function(e,t){var n=this.options,o=this.containerData,r=this.canvasData,a=this.cropBoxData,l=this.limited,M=n.aspectRatio;if(e){var c=Number(n.minCropBoxWidth)||0,u=Number(n.minCropBoxHeight)||0,g=l?Math.min(o.width,r.width,r.width+r.left,o.width-r.left):o.width,d=l?Math.min(o.height,r.height,r.height+r.top,o.height-r.top):o.height;c=Math.min(c,o.width),u=Math.min(u,o.height),M&&(c&&u?u*M>c?u=c/M:c=u*M:c?u=c/M:u&&(c=u*M),d*M>g?d=g/M:g=d*M),a.minWidth=Math.min(c,g),a.minHeight=Math.min(u,d),a.maxWidth=g,a.maxHeight=d}t&&(l?(a.minLeft=Math.max(0,r.left),a.minTop=Math.max(0,r.top),a.maxLeft=Math.min(o.width,r.left+r.width)-a.width,a.maxTop=Math.min(o.height,r.top+r.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=o.width-a.width,a.maxTop=o.height-a.height))},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,e.movable&&e.cropBoxMovable&&xo(this.face,To,n.width>=t.width&&n.height>=t.height?Xy:Oc),Ci(this.cropBox,Ue({width:n.width,height:n.height},Lo({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Qn(this.element,kc,this.getData())}},r3={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,o=t?this.crossOriginUrl:this.url,r=e.alt||"The image to preview",a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=o,a.alt=r,this.viewBox.appendChild(a),this.viewBoxImage=a,!!n){var l=n;typeof n=="string"?l=e.ownerDocument.querySelectorAll(n):n.querySelector&&(l=[n]),this.previews=l,Ke(l,function(M){var c=document.createElement("img");xo(M,is,{width:M.offsetWidth,height:M.offsetHeight,html:M.innerHTML}),t&&(c.crossOrigin=t),c.src=o,c.alt=r,c.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',M.innerHTML="",M.appendChild(c)})}},resetPreview:function(){Ke(this.previews,function(e){var t=Pc(e,is);Ci(e,{width:t.width,height:t.height}),e.innerHTML=t.html,Wv(e,is)})},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,o=n.width,r=n.height,a=e.width,l=e.height,M=n.left-t.left-e.left,c=n.top-t.top-e.top;!this.cropped||this.disabled||(Ci(this.viewBoxImage,Ue({width:a,height:l},Lo(Ue({translateX:-M,translateY:-c},e)))),Ke(this.previews,function(u){var g=Pc(u,is),d=g.width,y=g.height,j=d,D=y,I=1;o&&(I=d/o,D=r*I),r&&D>y&&(I=y/r,j=o*I,D=y),Ci(u,{width:j,height:D}),Ci(u.getElementsByTagName("img")[0],Ue({width:a*I,height:l*I},Lo(Ue({translateX:-M*I,translateY:-c*I},e))))}))}},a3={bind:function(){var e=this.element,t=this.options,n=this.cropper;ht(t.cropstart)&&Ot(e,Yc,t.cropstart),ht(t.cropmove)&&Ot(e,Qc,t.cropmove),ht(t.cropend)&&Ot(e,vc,t.cropend),ht(t.crop)&&Ot(e,kc,t.crop),ht(t.zoom)&&Ot(e,Uc,t.zoom),Ot(n,oI,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Ot(n,MI,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Ot(n,nI,this.onDblclick=this.dblclick.bind(this)),Ot(e.ownerDocument,rI,this.onCropMove=this.cropMove.bind(this)),Ot(e.ownerDocument,aI,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Ot(window,lI,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,n=this.cropper;ht(t.cropstart)&&Rt(e,Yc,t.cropstart),ht(t.cropmove)&&Rt(e,Qc,t.cropmove),ht(t.cropend)&&Rt(e,vc,t.cropend),ht(t.crop)&&Rt(e,kc,t.crop),ht(t.zoom)&&Rt(e,Uc,t.zoom),Rt(n,oI,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Rt(n,MI,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Rt(n,nI,this.onDblclick),Rt(e.ownerDocument,rI,this.onCropMove),Rt(e.ownerDocument,aI,this.onCropEnd),t.responsive&&Rt(window,lI,this.onResize)}},s3={resize:function(){if(!this.disabled){var e=this.options,t=this.container,n=this.containerData,o=t.offsetWidth/n.width,r=t.offsetHeight/n.height,a=Math.abs(o-1)>Math.abs(r-1)?o:r;if(a!==1){var l,M;e.restore&&(l=this.getCanvasData(),M=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(Ke(l,function(c,u){l[u]=c*a})),this.setCropBoxData(Ke(M,function(c,u){M[u]=c*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===iI||this.setDragMode(Vv(this.dragBox,Cc)?tI:Sc)},wheel:function(e){var t=this,n=Number(this.options.wheelZoomRatio)||.1,o=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?o=e.deltaY>0?1:-1:e.wheelDelta?o=-e.wheelDelta/120:e.detail&&(o=e.detail>0?1:-1),this.zoom(-o*n,e)))},cropStart:function(e){var t=e.buttons,n=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(De(t)&&t!==1||De(n)&&n!==0||e.ctrlKey))){var o=this.options,r=this.pointers,a;e.changedTouches?Ke(e.changedTouches,function(l){r[l.identifier]=ns(l)}):r[e.pointerId||0]=ns(e),Object.keys(r).length>1&&o.zoomable&&o.zoomOnTouch?a=Ky:a=Pc(e.target,To),kv.test(a)&&Qn(this.element,Yc,{originalEvent:e,action:a})!==!1&&(e.preventDefault(),this.action=a,this.cropping=!1,a===Jy&&(this.cropping=!0,tt(this.dragBox,ts)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var n=this.pointers;e.preventDefault(),Qn(this.element,Qc,{originalEvent:e,action:t})!==!1&&(e.changedTouches?Ke(e.changedTouches,function(o){Ue(n[o.identifier]||{},ns(o,!0))}):Ue(n[e.pointerId||0]||{},ns(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers;e.changedTouches?Ke(e.changedTouches,function(o){delete n[o.identifier]}):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,vn(this.dragBox,ts,this.cropped&&this.options.modal)),Qn(this.element,vc,{originalEvent:e,action:t}))}}},l3={change:function(e){var t=this.options,n=this.canvasData,o=this.containerData,r=this.cropBoxData,a=this.pointers,l=this.action,M=t.aspectRatio,c=r.left,u=r.top,g=r.width,d=r.height,y=c+g,j=u+d,D=0,I=0,N=o.width,m=o.height,b=!0,C;!M&&e.shiftKey&&(M=g&&d?g/d:1),this.limited&&(D=r.minLeft,I=r.minTop,N=D+Math.min(o.width,n.width,n.left+n.width),m=I+Math.min(o.height,n.height,n.top+n.height));var E=a[Object.keys(a)[0]],A={x:E.endX-E.startX,y:E.endY-E.startY},O=function(z){switch(z){case an:y+A.x>N&&(A.x=N-y);break;case sn:c+A.x<D&&(A.x=D-c);break;case Oi:u+A.y<I&&(A.y=I-u);break;case wn:j+A.y>m&&(A.y=m-j);break}};switch(l){case Oc:c+=A.x,u+=A.y;break;case an:if(A.x>=0&&(y>=N||M&&(u<=I||j>=m))){b=!1;break}O(an),g+=A.x,g<0&&(l=sn,g=-g,c-=g),M&&(d=g/M,u+=(r.height-d)/2);break;case Oi:if(A.y<=0&&(u<=I||M&&(c<=D||y>=N))){b=!1;break}O(Oi),d-=A.y,u+=A.y,d<0&&(l=wn,d=-d,u-=d),M&&(g=d*M,c+=(r.width-g)/2);break;case sn:if(A.x<=0&&(c<=D||M&&(u<=I||j>=m))){b=!1;break}O(sn),g-=A.x,c+=A.x,g<0&&(l=an,g=-g,c-=g),M&&(d=g/M,u+=(r.height-d)/2);break;case wn:if(A.y>=0&&(j>=m||M&&(c<=D||y>=N))){b=!1;break}O(wn),d+=A.y,d<0&&(l=Oi,d=-d,u-=d),M&&(g=d*M,c+=(r.width-g)/2);break;case po:if(M){if(A.y<=0&&(u<=I||y>=N)){b=!1;break}O(Oi),d-=A.y,u+=A.y,g=d*M}else O(Oi),O(an),A.x>=0?y<N?g+=A.x:A.y<=0&&u<=I&&(b=!1):g+=A.x,A.y<=0?u>I&&(d-=A.y,u+=A.y):(d-=A.y,u+=A.y);g<0&&d<0?(l=Ao,d=-d,g=-g,u-=d,c-=g):g<0?(l=zo,g=-g,c-=g):d<0&&(l=mo,d=-d,u-=d);break;case zo:if(M){if(A.y<=0&&(u<=I||c<=D)){b=!1;break}O(Oi),d-=A.y,u+=A.y,g=d*M,c+=r.width-g}else O(Oi),O(sn),A.x<=0?c>D?(g-=A.x,c+=A.x):A.y<=0&&u<=I&&(b=!1):(g-=A.x,c+=A.x),A.y<=0?u>I&&(d-=A.y,u+=A.y):(d-=A.y,u+=A.y);g<0&&d<0?(l=mo,d=-d,g=-g,u-=d,c-=g):g<0?(l=po,g=-g,c-=g):d<0&&(l=Ao,d=-d,u-=d);break;case Ao:if(M){if(A.x<=0&&(c<=D||j>=m)){b=!1;break}O(sn),g-=A.x,c+=A.x,d=g/M}else O(wn),O(sn),A.x<=0?c>D?(g-=A.x,c+=A.x):A.y>=0&&j>=m&&(b=!1):(g-=A.x,c+=A.x),A.y>=0?j<m&&(d+=A.y):d+=A.y;g<0&&d<0?(l=po,d=-d,g=-g,u-=d,c-=g):g<0?(l=mo,g=-g,c-=g):d<0&&(l=zo,d=-d,u-=d);break;case mo:if(M){if(A.x>=0&&(y>=N||j>=m)){b=!1;break}O(an),g+=A.x,d=g/M}else O(wn),O(an),A.x>=0?y<N?g+=A.x:A.y>=0&&j>=m&&(b=!1):g+=A.x,A.y>=0?j<m&&(d+=A.y):d+=A.y;g<0&&d<0?(l=zo,d=-d,g=-g,u-=d,c-=g):g<0?(l=Ao,g=-g,c-=g):d<0&&(l=po,d=-d,u-=d);break;case Xy:this.move(A.x,A.y),b=!1;break;case Ky:this.zoom(Fv(a),e),b=!1;break;case Jy:if(!A.x||!A.y){b=!1;break}C=hI(this.cropper),c=E.startX-C.left,u=E.startY-C.top,g=r.minWidth,d=r.minHeight,A.x>0?l=A.y>0?mo:po:A.x<0&&(c-=g,l=A.y>0?Ao:zo),A.y<0&&(u-=d),this.cropped||(ti(this.cropBox,It),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}b&&(r.width=g,r.height=d,r.left=c,r.top=u,this.action=l,this.renderCropBox()),Ke(a,function(f){f.startX=f.endX,f.startY=f.endY})}},M3={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&tt(this.dragBox,ts),ti(this.cropBox,It),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Ue({},this.initialImageData),this.canvasData=Ue({},this.initialCanvasData),this.cropBoxData=Ue({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Ue(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ti(this.dragBox,ts),tt(this.cropBox,It)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,Ke(this.previews,function(n){n.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,ti(this.cropper,qy)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,tt(this.cropper,qy)),this},destroy:function(){var e=this.element;return e[Ye]?(e[Ye]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,o=n.left,r=n.top;return this.moveTo(_c(e)?e:o+Number(e),_c(t)?t:r+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.canvasData,o=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(De(e)&&(n.left=e,o=!0),De(t)&&(n.top=t,o=!0),o&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var o=this.options,r=this.canvasData,a=r.width,l=r.height,M=r.naturalWidth,c=r.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&o.zoomable){var u=M*e,g=c*e;if(Qn(this.element,Uc,{ratio:e,oldRatio:a/M,originalEvent:n})===!1)return this;if(n){var d=this.pointers,y=hI(this.cropper),j=d&&Object.keys(d).length?$v(d):{pageX:n.pageX,pageY:n.pageY};r.left-=(u-a)*((j.pageX-y.left-r.left)/a),r.top-=(g-l)*((j.pageY-y.top-r.top)/l)}else Sn(t)&&De(t.x)&&De(t.y)?(r.left-=(u-a)*((t.x-r.left)/a),r.top-=(g-l)*((t.y-r.top)/l)):(r.left-=(u-a)/2,r.top-=(g-l)/2);r.width=u,r.height=g,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),De(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,De(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(De(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,n=this.imageData,o=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(De(e)&&(n.scaleX=e,o=!0),De(t)&&(n.scaleY=t,o=!0),o&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,n=this.imageData,o=this.canvasData,r=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:r.left-o.left,y:r.top-o.top,width:r.width,height:r.height};var l=n.width/n.naturalWidth;if(Ke(a,function(u,g){a[g]=u/l}),e){var M=Math.round(a.y+a.height),c=Math.round(a.x+a.width);a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=c-a.x,a.height=M-a.y}}else a={x:0,y:0,width:0,height:0};return t.rotatable&&(a.rotate=n.rotate||0),t.scalable&&(a.scaleX=n.scaleX||1,a.scaleY=n.scaleY||1),a},setData:function(e){var t=this.options,n=this.imageData,o=this.canvasData,r={};if(this.ready&&!this.disabled&&Sn(e)){var a=!1;t.rotatable&&De(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,a=!0),t.scalable&&(De(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,a=!0),De(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var l=n.width/n.naturalWidth;De(e.x)&&(r.left=e.x*l+o.left),De(e.y)&&(r.top=e.y*l+o.top),De(e.width)&&(r.width=e.width*l),De(e.height)&&(r.height=e.height*l),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?Ue({},this.containerData):{}},getImageData:function(){return this.sized?Ue({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&Ke(["left","top","width","height","naturalWidth","naturalHeight"],function(n){t[n]=e[n]}),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio;return this.ready&&!this.disabled&&Sn(e)&&(De(e.left)&&(t.left=e.left),De(e.top)&&(t.top=e.top),De(e.width)?(t.width=e.width,t.height=e.width/n):De(e.height)&&(t.height=e.height,t.width=e.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,n=this.options.aspectRatio,o,r;return this.ready&&this.cropped&&!this.disabled&&Sn(e)&&(De(e.left)&&(t.left=e.left),De(e.top)&&(t.top=e.top),De(e.width)&&e.width!==t.width&&(o=!0,t.width=e.width),De(e.height)&&e.height!==t.height&&(r=!0,t.height=e.height),n&&(o?t.height=t.width/n:r&&(t.width=t.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,n=Xv(this.image,this.imageData,t,e);if(!this.cropped)return n;var o=this.getData(e.rounded),r=o.x,a=o.y,l=o.width,M=o.height,c=n.width/Math.floor(t.naturalWidth);c!==1&&(r*=c,a*=c,l*=c,M*=c);var u=l/M,g=wi({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),d=wi({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),y=wi({aspectRatio:u,width:e.width||(c!==1?n.width:l),height:e.height||(c!==1?n.height:M)}),j=y.width,D=y.height;j=Math.min(g.width,Math.max(d.width,j)),D=Math.min(g.height,Math.max(d.height,D));var I=document.createElement("canvas"),N=I.getContext("2d");I.width=kn(j),I.height=kn(D),N.fillStyle=e.fillColor||"transparent",N.fillRect(0,0,j,D);var m=e.imageSmoothingEnabled,b=m===void 0?!0:m,C=e.imageSmoothingQuality;N.imageSmoothingEnabled=b,C&&(N.imageSmoothingQuality=C);var E=n.width,A=n.height,O=r,f=a,z,L,p,h,T,w;O<=-l||O>E?(O=0,z=0,p=0,T=0):O<=0?(p=-O,O=0,z=Math.min(E,l+O),T=z):O<=E&&(p=0,z=Math.min(l,E-O),T=z),z<=0||f<=-M||f>A?(f=0,L=0,h=0,w=0):f<=0?(h=-f,f=0,L=Math.min(A,M+f),w=L):f<=A&&(h=0,L=Math.min(M,A-f),w=L);var x=[O,f,z,L];if(T>0&&w>0){var S=j/l;x.push(p*S,h*S,T*S,w*S)}return N.drawImage.apply(N,[n].concat(Fy(x.map(function(v){return Math.floor(kn(v))})))),I},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!_c(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,o=this.face;if(this.ready&&!this.disabled){var r=e===Sc,a=t.movable&&e===tI;e=r||a?e:iI,t.dragMode=e,xo(n,To,e),vn(n,Cc,r),vn(n,wc,a),t.cropBoxMovable||(xo(o,To,e),vn(o,Cc,r),vn(o,wc,a))}return this}},c3=ei.Cropper,zI=function(){function i(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(zv(this,i),!e||!Yv.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Ue({},dI,Sn(t)&&t),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return mv(i,[{key:"init",value:function(){var t=this.element,n=t.tagName.toLowerCase(),o;if(!t[Ye]){if(t[Ye]=this,n==="img"){if(this.isImg=!0,o=t.getAttribute("src")||"",this.originalUrl=o,!o)return;o=t.src}else n==="canvas"&&window.HTMLCanvasElement&&(o=t.toDataURL());this.load(o)}}},{key:"load",value:function(t){var n=this;if(t){this.url=t,this.imageData={};var o=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(vv.test(t)){Qv.test(t)?this.read(e3(t)):this.clone();return}var a=new XMLHttpRequest,l=this.clone.bind(this);this.reloading=!0,this.xhr=a,a.onabort=l,a.onerror=l,a.ontimeout=l,a.onprogress=function(){a.getResponseHeader("content-type")!==cI&&a.abort()},a.onload=function(){n.read(a.response)},a.onloadend=function(){n.reloading=!1,n.xhr=null},r.checkCrossOrigin&&DI(t)&&o.crossOrigin&&(t=fI(t)),a.open("GET",t,!0),a.responseType="arraybuffer",a.withCredentials=o.crossOrigin==="use-credentials",a.send()}}},{key:"read",value:function(t){var n=this.options,o=this.imageData,r=i3(t),a=0,l=1,M=1;if(r>1){this.url=t3(t,cI);var c=n3(r);a=c.rotate,l=c.scaleX,M=c.scaleY}n.rotatable&&(o.rotate=a),n.scalable&&(o.scaleX=l,o.scaleY=M),this.clone()}},{key:"clone",value:function(){var t=this.element,n=this.url,o=t.crossOrigin,r=n;this.options.checkCrossOrigin&&DI(n)&&(o||(o="anonymous"),r=fI(n)),this.crossOrigin=o,this.crossOriginUrl=r;var a=document.createElement("img");o&&(a.crossOrigin=o),a.src=r||n,a.alt=t.alt||"The image to crop",this.image=a,a.onload=this.start.bind(this),a.onerror=this.stop.bind(this),tt(a,eI),t.parentNode.insertBefore(a,t.nextSibling)}},{key:"start",value:function(){var t=this,n=this.image;n.onload=null,n.onerror=null,this.sizing=!0;var o=ei.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(ei.navigator.userAgent),r=function(c,u){Ue(t.imageData,{naturalWidth:c,naturalHeight:u,aspectRatio:c/u}),t.initialImageData=Ue({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(n.naturalWidth&&!o){r(n.naturalWidth,n.naturalHeight);return}var a=document.createElement("img"),l=document.body||document.documentElement;this.sizingImage=a,a.onload=function(){r(a.width,a.height),o||l.removeChild(a)},a.src=n.src,o||(a.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",l.appendChild(a))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var t=this.element,n=this.options,o=this.image,r=t.parentNode,a=document.createElement("div");a.innerHTML=Uv;var l=a.querySelector(".".concat(Ye,"-container")),M=l.querySelector(".".concat(Ye,"-canvas")),c=l.querySelector(".".concat(Ye,"-drag-box")),u=l.querySelector(".".concat(Ye,"-crop-box")),g=u.querySelector(".".concat(Ye,"-face"));this.container=r,this.cropper=l,this.canvas=M,this.dragBox=c,this.cropBox=u,this.viewBox=l.querySelector(".".concat(Ye,"-view-box")),this.face=g,M.appendChild(o),tt(t,It),r.insertBefore(l,t.nextSibling),ti(o,eI),this.initPreview(),this.bind(),n.initialAspectRatio=Math.max(0,n.initialAspectRatio)||NaN,n.aspectRatio=Math.max(0,n.aspectRatio)||NaN,n.viewMode=Math.max(0,Math.min(3,Math.round(n.viewMode)))||0,tt(u,It),n.guides||tt(u.getElementsByClassName("".concat(Ye,"-dashed")),It),n.center||tt(u.getElementsByClassName("".concat(Ye,"-center")),It),n.background&&tt(l,"".concat(Ye,"-bg")),n.highlight||tt(g,Ov),n.cropBoxMovable&&(tt(g,wc),xo(g,To,Oc)),n.cropBoxResizable||(tt(u.getElementsByClassName("".concat(Ye,"-line")),It),tt(u.getElementsByClassName("".concat(Ye,"-point")),It)),this.render(),this.ready=!0,this.setDragMode(n.dragMode),n.autoCrop&&this.crop(),this.setData(n.data),ht(n.ready)&&Ot(t,sI,n.ready,{once:!0}),Qn(t,sI)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),ti(this.element,It)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=c3,i}},{key:"setDefaults",value:function(t){Ue(dI,Sn(t)&&t)}}]),i}();Ue(zI.prototype,o3,r3,a3,s3,l3,M3);const u3={class:"cropper-wrapper_div"},g3={key:0,class:"cropper-wrapper"},d3=s.defineComponent({__name:"ImageCropper",props:{image:{type:File,required:!1,default:null},width:{type:[Number],required:!1,default:360},height:{type:[Number],required:!1,default:0},showPreview:{type:Boolean,required:!1,default:!1},isRound:{type:Boolean,required:!1,default:!1}},emits:["update","sizeError"],setup(i,{emit:e}){const t=i;s.onMounted(()=>{t.image&&c(t.image)}),s.onUpdated(()=>{t.image&&c(t.image)});const n=s.ref(null),o=s.ref(null),r=s.ref(!1),a=s.ref(),l=s.ref(t.width);let M=null;function c(I){const N=new FileReader;N.onload=()=>{n.value.src=N.result,n.value.onload=async()=>{a.value||D(),u(n.value)}},N.readAsDataURL(I)}function u(I){M&&M.destroy(),M=new zI(I,{aspectRatio:1,viewMode:1})}async function g(){let I=M.getCroppedCanvas();const N=await j(I,.5);let m=null;if(t.isRound?m=d(N):m=N,!m)return;if(!await y(m)){e("sizeError");return}o.value&&(o.value.src=m.toDataURL(),r.value=!0),e("update",m)}function d(I){var N=document.createElement("canvas"),m=N.getContext("2d"),b=I.width,C=I.height;return N.width=b,N.height=C,m?(m.imageSmoothingEnabled=!0,m.drawImage(I,0,0,b,C),m.globalCompositeOperation="destination-in",m.beginPath(),m.arc(b/2,C/2,Math.min(b,C)/2,0,2*Math.PI,!0),m.fill(),N):null}async function y(I){return new Promise(N=>{I.toBlob(m=>{m&&(m.size/(1024*1024)>5?N(!1):N(!0))})})}async function j(I,N){return new Promise(m=>{const b=I.width*N,C=I.height*N,E=document.createElement("canvas");E.width=b,E.height=C;const A=E.getContext("2d");A==null||A.drawImage(I,0,0,b,C),m(E)})}function D(){const{value:I}=n,{width:N,height:m}=I,b=(t==null?void 0:t.width)??0,C=(t==null?void 0:t.height)??0,E=b/C,A=N/m,O=A>E,f=O?b:C*A,z=O?b/A:C;l.value=f,a.value=z}return(I,N)=>(s.openBlock(),s.createElementBlock("div",u3,[i.image?(s.openBlock(),s.createElementBlock("div",g3,[s.createElementVNode("div",{id:"cropper-container",class:s.normalizeClass({"rounded-crop":i.isRound}),style:s.normalizeStyle(t.height?{"max-width":l.value+"px",height:a.value+"px"}:{"max-width":i.width+"px"})},[s.createElementVNode("img",{id:"cropper-image",ref_key:"croppingImage",ref:n},null,512)],6),s.createVNode(WM,{class:"cropper-button",color:"primary",size:"small",style:s.normalizeStyle({"max-width":l.value+"px"}),width:"full",onClick:N[0]||(N[0]=s.withModifiers(m=>g(),["prevent"]))},{default:s.withCtx(()=>[s.createTextVNode(" Crop ")]),_:1},8,["style"]),i.showPreview?s.withDirectives((s.openBlock(),s.createElementBlock("img",{key:0,id:"cropper-preview",ref_key:"cropPreview",ref:o},null,512)),[[s.vShow,r.value]]):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)]))}}),aQ="",sQ="",N3={class:"dh-line-chart-container"},j3=He({__name:"LineChart",props:{dataSets:{type:Object,default:()=>({})},title:{type:String,default:""},width:{type:Number,default:30},height:{type:Number,default:16}},setup(i){const e=i;uo.register(hb,jj,xi,Ua,Za,Pa,yb);const t=s.ref(!1),n=s.ref({labels:[],datasets:[]}),o=s.computed(()=>n.value),r=s.ref({responsive:!0,maintainAspectRatio:!0,interaction:{mode:"index",intersect:!1},elements:{point:{radius:0}},stacked:!1,plugins:{title:{display:!0,text:e.title||"Line Chart",position:"top",align:"start",padding:{bottom:25},font:{weight:500,family:"'Rubik-Regular', 'Arial', 'Helvetica', 'sans-serif'",size:16}},tooltip:{callbacks:{title:()=>"",label:function(M){let c=" "+(M.dataset.label[M.dataIndex]||"");return M.parsed.y!==null&&(c+=": "+M.parsed.y),c}}},legend:{display:!1}},scales:{y:{type:"linear",display:!0,position:"left",grid:{display:!1},border:{display:!1},min:0,ticks:{beginAtZero:!0,callback:function(M){return M===this.min||M===this.max?M:""}}},x:{display:!1}}});function a(M){return c=>{const g=c.chart.ctx.createLinearGradient(0,0,0,300);return g.addColorStop(0,M),g.addColorStop(.5,"#fff"),g.addColorStop(1,M),g}}function l(){t.value=!1,Object.keys(e.dataSets).forEach((M,c)=>{const u=e.dataSets[M],g=u.data.map(y=>y.label),d=u.data.map(y=>y.value);n.value.datasets[c]={data:d,label:g,backgroundColor:a(u.backgroundColor),borderRadius:1,borderColor:u.backgroundColor,fill:!0,pointStyle:!1,tension:.1},e.dataSets[M].borderWidth&&(n.value.datasets[c].borderWidth=0),e.dataSets[M].borderWidth||(n.value.datasets[c].spanGaps=!0),n.value.labels=g,s.nextTick(()=>{t.value=!0})})}return s.onBeforeMount(()=>{l()}),s.watch(()=>e.title,M=>{r.value.plugins.title.text=M,r.value={...r.value}}),s.watch(()=>[e.dataSets],()=>{l()},{deep:!0}),(M,c)=>(s.openBlock(),s.createElementBlock("div",N3,[t.value?(s.openBlock(),s.createBlock(s.unref(tO),{key:0,data:o.value,height:i.height,options:r.value,width:i.width},null,8,["data","height","options","width"])):s.createCommentVNode("",!0)]))}},[["__scopeId","data-v-8fab7caf"]]);je.DhAdvancedDatePicker=_O,je.DhAdvancedFilter=$O,je.DhButton=WM,je.DhCopyText=oC,je.DhDatePicker=aC,je.DhDropdownMenu=gC,je.DhError=NC,je.DhExpansionPanel=fC,je.DhFileUpload=VC,je.DhIcon=de,je.DhIconWithText=Yj,je.DhImageCropper=d3,je.DhInput=JC,je.DhInputDropdown=Uj,je.DhInputDropdownMultiple=aw,je.DhInputGroup=gw,je.DhInputList=Kw,je.DhLineChart=j3,je.DhModal=oS,je.DhNotification=gS,je.DhNumberRange=Sj,je.DhPasswordField=hS,je.DhRadioBox=Zj,je.DhRadioBoxGroup=mS,je.DhSearchInput=LS,je.DhStepper=wS,je.DhSwitch=hd,je.DhTag=SS,je.DhTextEditor=gv,je.DhTooltip=vj,je.DhVerificationCode=pv,Object.defineProperty(je,Symbol.toStringTag,{value:"Module"})});