vendor: 33,214 bytes, lines 1-10
1var Wa=Object.defineProperty;var Ha=(i,t,e)=>t in i?Wa(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var C=(i,t,e)=>Ha(i,typeof t!="symbol"?t+"":t,e);import{r as L,j as v}from"./app-DP13319Q.js";/*! 2 * Cropper.js v1.6.2 3 * https://fengyuanchen.github.io/cropperjs 4 * 5 * Copyright 2015-present Chen Fengyuan 6 * Released under the MIT license 7 * 8 * Date: 2024-04-21T07:43:05.335Z 9 */function Gs(i,t){var e=Object.keys(i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(i);t&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),e.push.apply(e,s)}return e}function Do(i){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Gs(Object(e),!0).forEach(function(s){Xa(i,s,e[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)):Gs(Object(e)).forEach(function(s){Object.defineProperty(i,s,Object.getOwnPropertyDescriptor(e,s))})}return i}function Va(i,t){if(typeof i!="object"||!i)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var s=e.call(i,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}function Co(i){var t=Va(i,"string");return typeof t=="symbol"?t:t+""}function os(i){"@babel/helpers - typeof";return os=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},os(i)}function Ya(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}function qs(i,t){for(var e=0;e<t.length;e++){var s=t[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,Co(s.key),s)}}function $a(i,t,e){return t&&qs(i.prototype,t),e&&qs(i,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function Xa(i,t,e){return t=Co(t),t in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function Oo(i){return Ua(i)||Ka(i)||Ga(i)||qa()}function Ua(i){if(Array.isArray(i))return as(i)}function Ka(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}function Ga(i,t){if(i){if(typeof i=="string")return as(i,t);var e=Object.prototype.toString.call(i).slice(8,-1);if(e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set")return Array.from(i);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return as(i,t)}}function as(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,s=new Array(t);e<t;e++)s[e]=i[e];return s}function qa(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 10In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ni=typeof window<"u"&&typeof window.document<"u",Ot=Ni?window:{},Ds=Ni&&Ot.document.documentElement?"ontouchstart"in Ot.document.documentElement:!1,Cs=Ni?"PointerEvent"in Ot:!1,U="cropper",Os="all",To="crop",Ao="move",Po="zoom",Zt="e",Jt="w",ge="s",Bt="n",Oe="ne",Te="nw",Ae="se",Pe="sw",rs="".concat(U,"-crop"),Zs="".concat(U,"-disabled"),rt="".concat(U,"-hidden"),Js="".concat(U,"-hide"),Za="".concat(U,"-invisible"),Di="".concat(U,"-modal"),ls="".concat(U,"-move"),Ke="".concat(U,"Action"),oi="".concat(U,"Preview"),Ts="crop",Ro="move",Eo="none",cs="crop",hs="cropend",ds="cropmove",fs="cropstart",Qs="dblclick",Ja=Ds?"touchstart":"mousedown",Qa=Ds?"touchmove":"mousemove",tr=Ds?"touchend touchcancel":"mouseup",tn=Cs?"pointerdown":Ja,en=Cs?"pointermove":Qa,sn=Cs?"pointerup pointercancel":tr,nn="ready",on="resize",an="wheel",us="zoom",rn="image/jpeg",er=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,ir=/^data:/,sr=/^data:image\/jpeg;base64,/,nr=/^img|canvas$/i,Lo=200,Io=100,ln={viewMode:0,dragMode:Ts,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:Lo,minContainerHeight:Io,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},or='<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>',ar=Number.isNaN||Ot.isNaN;function I(i){return typeof i=="number"&&!ar(i)}var cn=function(t){return t>0&&t<1/0};function $i(i){return typeof i>"u"}function re(i){return os(i)==="object"&&i!==null}var rr=Object.prototype.hasOwnProperty;function be(i){if(!re(i))return!1;try{var t=i.constructor,e=t.prototype;return t&&e&&rr.call(e,"isPrototypeOf")}catch{return!1}}function at(i){return typeof i=="function"}var lr=Array.prototype.slice;function No(i){return Array.from?Array.from(i):lr.call(i)}function J(i,t){return i&&at(t)&&(Array.isArray(i)||I(i.length)?No(i).forEach(function(e,s){t.call(i,e,s,i)}):re(i)&&Object.keys(i).forEach(function(e){t.call(i,i[e],e,i)})),i}var K=Object.assign||function(t){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return re(t)&&s.length>0&&s.forEach(function(o){re(o)&&Object.keys(o).forEach(function(a){t[a]=o[a]})}),t},cr=/\.\d*(?:0|9){12}\d*$/;function ye(i){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return cr.test(i)?Math.round(i*t)/t:i}var hr=/^width|height|left|top|marginLeft|marginTop$/;function Ft(i,t){var e=i.style;J(t,function(s,n){hr.test(n)&&I(s)&&(s="".concat(s,"px")),e[n]=s})}function dr(i,t){return i.classList?i.classList.contains(t):i.className.indexOf(t)>-1}function tt(i,t){if(t){if(I(i.length)){J(i,function(s){tt(s,t)});return}if(i.classList){i.classList.add(t);return}var e=i.className.trim();e?e.indexOf(t)<0&&(i.className="".concat(e," ").concat(t)):i.className=t}}function Dt(i,t){if(t){if(I(i.length)){J(i,function(e){Dt(e,t)});return}if(i.classList){i.classList.remove(t);return}i.className.indexOf(t)>=0&&(i.className=i.className.replace(t,""))}}function xe(i,t,e){if(t){if(I(i.length)){J(i,function(s){xe(s,t,e)});return}e?tt(i,t):Dt(i,t)}}var fr=/([a-z\d])([A-Z])/g;function As(i){return i.replace(fr,"$1-$2").toLowerCase()}function gs(i,t){return re(i[t])?i[t]:i.dataset?i.dataset[t]:i.getAttribute("data-".concat(As(t)))}function Ge(i,t,e){re(e)?i[t]=e:i.dataset?i.dataset[t]=e:i.setAttribute("data-".concat(As(t)),e)}function ur(i,t){if(re(i[t]))try{delete i[t]}catch{i[t]=void 0}else if(i.dataset)try{delete i.dataset[t]}catch{i.dataset[t]=void 0}else i.removeAttribute("data-".concat(As(t)))}var zo=/\s\s*/,jo=(function(){var i=!1;if(Ni){var t=!1,e=function(){},s=Object.defineProperty({},"once",{get:function(){return i=!0,t},set:function(o){t=o}});Ot.addEventListener("test",e,s),Ot.removeEventListener("test",e,s)}return i})();function yt(i,t,e){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=e;t.trim().split(zo).forEach(function(o){if(!jo){var a=i.listeners;a&&a[o]&&a[o][e]&&(n=a[o][e],delete a[o][e],Object.keys(a[o]).length===0&&delete a[o],Object.keys(a).length===0&&delete i.listeners)}i.removeEventListener(o,n,s)})}function pt(i,t,e){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},n=e;t.trim().split(zo).forEach(function(o){if(s.once&&!jo){var a=i.listeners,r=a===void 0?{}:a;n=function(){delete r[o][e],i.removeEventListener(o,n,s);for(var c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];e.apply(i,h)},r[o]||(r[o]={}),r[o][e]&&i.removeEventListener(o,r[o][e],s),r[o][e]=n,i.listeners=r}i.addEventListener(o,n,s)})}function ve(i,t,e){var s;return at(Event)&&at(CustomEvent)?s=new CustomEvent(t,{detail:e,bubbles:!0,cancelable:!0}):(s=document.createEvent("CustomEvent"),s.initCustomEvent(t,!0,!0,e)),i.dispatchEvent(s)}function Bo(i){var t=i.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Xi=Ot.location,gr=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function hn(i){var t=i.match(gr);return t!==null&&(t[1]!==Xi.protocol||t[2]!==Xi.hostname||t[3]!==Xi.port)}function dn(i){var t="timestamp=".concat(new Date().getTime());return i+(i.indexOf("?")===-1?"?":"&")+t}function Ve(i){var t=i.rotate,e=i.scaleX,s=i.scaleY,n=i.translateX,o=i.translateY,a=[];I(n)&&n!==0&&a.push("translateX(".concat(n,"px)")),I(o)&&o!==0&&a.push("translateY(".concat(o,"px)")),I(t)&&t!==0&&a.push("rotate(".concat(t,"deg)")),I(e)&&e!==1&&a.push("scaleX(".concat(e,")")),I(s)&&s!==1&&a.push("scaleY(".concat(s,")"));var r=a.length?a.join(" "):"none";return{WebkitTransform:r,msTransform:r,transform:r}}function pr(i){var t=Do({},i),e=0;return J(i,function(s,n){delete t[n],J(t,function(o){var a=Math.abs(s.startX-o.startX),r=Math.abs(s.startY-o.startY),l=Math.abs(s.endX-o.endX),c=Math.abs(s.endY-o.endY),h=Math.sqrt(a*a+r*r),d=Math.sqrt(l*l+c*c),f=(d-h)/h;Math.abs(f)>Math.abs(e)&&(e=f)})}),e}function ai(i,t){var e=i.pageX,s=i.pageY,n={endX:e,endY:s};return t?n:Do({startX:e,startY:s},n)}function mr(i){var t=0,e=0,s=0;return J(i,function(n){var o=n.startX,a=n.startY;t+=o,e+=a,s+=1}),t/=s,e/=s,{pageX:t,pageY:e}}function Wt(i){var t=i.aspectRatio,e=i.height,s=i.width,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=cn(s),a=cn(e);if(o&&a){var r=e*t;n==="contain"&&r>s||n==="cover"&&r<s?e=s/t:s=e*t}else o?e=s/t:a&&(s=e*t);return{width:s,height:e}}function br(i){var t=i.width,e=i.height,s=i.degree;if(s=Math.abs(s)%180,s===90)return{width:e,height:t};var n=s%90*Math.PI/180,o=Math.sin(n),a=Math.cos(n),r=t*a+e*o,l=t*o+e*a;return s>90?{width:l,height:r}:{width:r,height:l}}function xr(i,t,e,s){var n=t.aspectRatio,o=t.naturalWidth,a=t.naturalHeight,r=t.rotate,l=r===void 0?0:r,c=t.scaleX,h=c===void 0?1:c,d=t.scaleY,f=d===void 0?1:d,u=e.aspectRatio,p=e.naturalWidth,g=e.naturalHeight,m=s.fillColor,b=m===void 0?"transparent":m,y=s.imageSmoothingEnabled,w=y===void 0?!0:y,k=s.imageSmoothingQuality,_=k===void 0?"low":k,x=s.maxWidth,M=x===void 0?1/0:x,S=s.maxHeight,D=S===void 0?1/0:S,T=s.minWidth,O=T===void 0?0:T,R=s.minHeight,F=R===void 0?0:R,Y=document.createElement("canvas"),P=Y.getContext("2d"),N=Wt({aspectRatio:u,width:M,height:D}),B=Wt({aspectRatio:u,width:O,height:F},"cover"),it=Math.min(N.width,Math.max(B.width,p)),G=Math.min(N.height,Math.max(B.height,g)),dt=Wt({aspectRatio:n,width:M,height:D}),bt=Wt({aspectRatio:n,width:O,height:F},"cover"),ft=Math.min(dt.width,Math.max(bt.width,o)),xt=Math.min(dt.height,Math.max(bt.height,a)),X=[-ft/2,-xt/2,ft,xt];return Y.width=ye(it),Y.height=ye(G),P.fillStyle=b,P.fillRect(0,0,it,G),P.save(),P.translate(it/2,G/2),P.rotate(l*Math.PI/180),P.scale(h,f),P.imageSmoothingEnabled=w,P.imageSmoothingQuality=_,P.drawImage.apply(P,[i].concat(Oo(X.map(function(ut){return Math.floor(ye(ut))})))),P.restore(),Y}var Fo=String.fromCharCode;function yr(i,t,e){var s="";e+=t;for(var n=t;n<e;n+=1)s+=Fo(i.getUint8(n));return s}var vr=/^data:.*,/;function _r(i){var t=i.replace(vr,""),e=atob(t),s=new ArrayBuffer(e.length),n=new Uint8Array(s);return J(n,function(o,a){n[a]=e.charCodeAt(a)}),s}function wr(i,t){for(var e=[],s=8192,n=new Uint8Array(i);n.length>0;)e.push(Fo.apply(null,No(n.subarray(0,s)))),n=n.subarray(s);return"data:".concat(t,";base64,").concat(btoa(e.join("")))}function Mr(i){var t=new DataView(i),e;try{var s,n,o;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var a=t.byteLength,r=2;r+1<a;){if(t.getUint8(r)===255&&t.getUint8(r+1)===225){n=r;break}r+=1}if(n){var l=n+4,c=n+10;if(yr(t,l,4)==="Exif"){var h=t.getUint16(c);if(s=h===18761,(s||h===19789)&&t.getUint16(c+2,s)===42){var d=t.getUint32(c+4,s);d>=8&&(o=c+d)}}}if(o){var f=t.getUint16(o,s),u,p;for(p=0;p<f;p+=1)if(u=o+p*12+2,t.getUint16(u,s)===274){u+=8,e=t.getUint16(u,s),t.setUint16(u,1,s);break}}}catch{e=1}return e}function kr(i){var t=0,e=1,s=1;switch(i){case 2:e=-1;break;case 3:t=-180;break;case 4:s=-1;break;case 5:t=90,s=-1;break;case 6:t=90;break;case 7:t=90,e=-1;break;case 8:t=-90;break}return{rotate:t,scaleX:e,scaleY:s}}var Sr={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,s=this.container,n=this.cropper,o=Number(e.minContainerWidth),a=Number(e.minContainerHeight);tt(n,rt),Dt(t,rt);var r={width:Math.max(s.offsetWidth,o>=0?o:Lo),height:Math.max(s.offsetHeight,a>=0?a:Io)};this.containerData=r,Ft(n,{width:r.width,height:r.height}),tt(t,rt),Dt(n,rt)},initCanvas:function(){var t=this.containerData,e=this.imageData,s=this.options.viewMode,n=Math.abs(e.rotate)%180===90,o=n?e.naturalHeight:e.naturalWidth,a=n?e.naturalWidth:e.naturalHeight,r=o/a,l=t.width,c=t.height;t.height*r>t.width?s===3?l=t.height*r:c=t.width/r:s===3?c=t.width/r:l=t.height*r;var h={aspectRatio:r,naturalWidth:o,naturalHeight:a,width:l,height:c};this.canvasData=h,this.limited=s===1||s===2,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(t.width-h.width)/2,h.top=(t.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=K({},h)},limitCanvas:function(t,e){var s=this.options,n=this.containerData,o=this.canvasData,a=this.cropBoxData,r=s.viewMode,l=o.aspectRatio,c=this.cropped&&a;if(t){var h=Number(s.minCanvasWidth)||0,d=Number(s.minCanvasHeight)||0;r>1?(h=Math.max(h,n.width),d=Math.max(d,n.height),r===3&&(d*l>h?h=d*l:d=h/l)):r>0&&(h?h=Math.max(h,c?a.width:0):d?d=Math.max(d,c?a.height:0):c&&(h=a.width,d=a.height,d*l>h?h=d*l:d=h/l));var f=Wt({aspectRatio:l,width:h,height:d});h=f.width,d=f.height,o.minWidth=h,o.minHeight=d,o.maxWidth=1/0,o.maxHeight=1/0}if(e)if(r>(c?0:1)){var u=n.width-o.width,p=n.height-o.height;o.minLeft=Math.min(0,u),o.minTop=Math.min(0,p),o.maxLeft=Math.max(0,u),o.maxTop=Math.max(0,p),c&&this.limited&&(o.minLeft=Math.min(a.left,a.left+(a.width-o.width)),o.minTop=Math.min(a.top,a.top+(a.height-o.height)),o.maxLeft=a.left,o.maxTop=a.top,r===2&&(o.width>=n.width&&(o.minLeft=Math.min(0,u),o.maxLeft=Math.max(0,u)),o.height>=n.height&&(o.minTop=Math.min(0,p),o.maxTop=Math.max(0,p))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=n.width,o.maxTop=n.height},renderCanvas:function(t,e){var s=this.canvasData,n=this.imageData;if(e){var o=br({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),a=o.width,r=o.height,l=s.width*(a/s.naturalWidth),c=s.height*(r/s.naturalHeight);s.left-=(l-s.width)/2,s.top-=(c-s.height)/2,s.width=l,s.height=c,s.aspectRatio=a/r,s.naturalWidth=a,s.naturalHeight=r,this.limitCanvas(!0,!1)}(s.width>s.maxWidth||s.width<s.minWidth)&&(s.left=s.oldLeft),(s.height>s.maxHeight||s.height<s.minHeight)&&(s.top=s.oldTop),s.width=Math.min(Math.max(s.width,s.minWidth),s.maxWidth),s.height=Math.min(Math.max(s.height,s.minHeight),s.maxHeight),this.limitCanvas(!1,!0),s.left=Math.min(Math.max(s.left,s.minLeft),s.maxLeft),s.top=Math.min(Math.max(s.top,s.minTop),s.maxTop),s.oldLeft=s.left,s.oldTop=s.top,Ft(this.canvas,K({width:s.width,height:s.height},Ve({translateX:s.left,translateY:s.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,s=this.imageData,n=s.naturalWidth*(e.width/e.naturalWidth),o=s.naturalHeight*(e.height/e.naturalHeight);K(s,{width:n,height:o,left:(e.width-n)/2,top:(e.height-o)/2}),Ft(this.image,K({width:s.width,height:s.height},Ve(K({translateX:s.left,translateY:s.top},s)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,s=t.aspectRatio||t.initialAspectRatio,n=Number(t.autoCropArea)||.8,o={width:e.width,height:e.height};s&&(e.height*s>e.width?o.height=o.width/s:o.width=o.height*s),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*n),o.height=Math.max(o.minHeight,o.height*n),o.left=e.left+(e.width-o.width)/2,o.top=e.top+(e.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=K({},o)},limitCropBox:function(t,e){var s=this.options,n=this.containerData,o=this.canvasData,a=this.cropBoxData,r=this.limited,l=s.aspectRatio;if(t){var c=Number(s.minCropBoxWidth)||0,h=Number(s.minCropBoxHeight)||0,d=r?Math.min(n.width,o.width,o.width+o.left,n.width-o.left):n.width,f=r?Math.min(n.height,o.height,o.height+o.top,n.height-o.top):n.height;c=Math.min(c,n.width),h=Math.min(h,n.height),l&&(c&&h?h*l>c?h=c/l:c=h*l:c?h=c/l:h&&(c=h*l),f*l>d?f=d/l:d=f*l),a.minWidth=Math.min(c,d),a.minHeight=Math.min(h,f),a.maxWidth=d,a.maxHeight=f}e&&(r?(a.minLeft=Math.max(0,o.left),a.minTop=Math.max(0,o.top),a.maxLeft=Math.min(n.width,o.left+o.width)-a.width,a.maxTop=Math.min(n.height,o.top+o.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=n.width-a.width,a.maxTop=n.height-a.height))},renderCropBox:function(){var t=this.options,e=this.containerData,s=this.cropBoxData;(s.width>s.maxWidth||s.width<s.minWidth)&&(s.left=s.oldLeft),(s.height>s.maxHeight||s.height<s.minHeight)&&(s.top=s.oldTop),s.width=Math.min(Math.max(s.width,s.minWidth),s.maxWidth),s.height=Math.min(Math.max(s.height,s.minHeight),s.maxHeight),this.limitCropBox(!1,!0),s.left=Math.min(Math.max(s.left,s.minLeft),s.maxLeft),s.top=Math.min(Math.max(s.top,s.minTop),s.maxTop),s.oldLeft=s.left,s.oldTop=s.top,t.movable&&t.cropBoxMovable&&Ge(this.face,Ke,s.width>=e.width&&s.height>=e.height?Ao:Os),Ft(this.cropBox,K({width:s.width,height:s.height},Ve({translateX:s.left,translateY:s.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ve(this.element,cs,this.getData())}},Dr={initPreview:function(){var t=this.element,e=this.crossOrigin,s=this.options.preview,n=e?this.crossOriginUrl:this.url,o=t.alt||"The image to preview",a=document.createElement("img");if(e&&(a.crossOrigin=e),a.src=n,a.alt=o,this.viewBox.appendChild(a),this.viewBoxImage=a,!!s){var r=s;typeof s=="string"?r=t.ownerDocument.querySelectorAll(s):s.querySelector&&(r=[s]),this.previews=r,J(r,function(l){var c=document.createElement("img");Ge(l,oi,{width:l.offsetWidth,height:l.offsetHeight,html:l.innerHTML}),e&&(c.crossOrigin=e),c.src=n,c.alt=o,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;"',l.innerHTML="",l.appendChild(c)})}},resetPreview:function(){J(this.previews,function(t){var e=gs(t,oi);Ft(t,{width:e.width,height:e.height}),t.innerHTML=e.html,ur(t,oi)})},preview:function(){var t=this.imageData,e=this.canvasData,s=this.cropBoxData,n=s.width,o=s.height,a=t.width,r=t.height,l=s.left-e.left-t.left,c=s.top-e.top-t.top;!this.cropped||this.disabled||(Ft(this.viewBoxImage,K({width:a,height:r},Ve(K({translateX:-l,translateY:-c},t)))),J(this.previews,function(h){var d=gs(h,oi),f=d.width,u=d.height,p=f,g=u,m=1;n&&(m=f/n,g=o*m),o&&g>u&&(m=u/o,p=n*m,g=u),Ft(h,{width:p,height:g}),Ft(h.getElementsByTagName("img")[0],K({width:a*m,height:r*m},Ve(K({translateX:-l*m,translateY:-c*m},t))))}))}},Cr={bind:function(){var t=this.element,e=this.options,s=this.cropper;at(e.cropstart)&&pt(t,fs,e.cropstart),at(e.cropmove)&&pt(t,ds,e.cropmove),at(e.cropend)&&pt(t,hs,e.cropend),at(e.crop)&&pt(t,cs,e.crop),at(e.zoom)&&pt(t,us,e.zoom),pt(s,tn,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&pt(s,an,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&pt(s,Qs,this.onDblclick=this.dblclick.bind(this)),pt(t.ownerDocument,en,this.onCropMove=this.cropMove.bind(this)),pt(t.ownerDocument,sn,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&pt(window,on,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,s=this.cropper;at(e.cropstart)&&yt(t,fs,e.cropstart),at(e.cropmove)&&yt(t,ds,e.cropmove),at(e.cropend)&&yt(t,hs,e.cropend),at(e.crop)&&yt(t,cs,e.crop),at(e.zoom)&&yt(t,us,e.zoom),yt(s,tn,this.onCropStart),e.zoomable&&e.zoomOnWheel&&yt(s,an,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&yt(s,Qs,this.onDblclick),yt(t.ownerDocument,en,this.onCropMove),yt(t.ownerDocument,sn,this.onCropEnd),e.responsive&&yt(window,on,this.onResize)}},Or={resize:function(){if(!this.disabled){var t=this.options,e=this.container,s=this.containerData,n=e.offsetWidth/s.width,o=e.offsetHeight/s.height,a=Math.abs(n-1)>Math.abs(o-1)?n:o;if(a!==1){var r,l;t.restore&&(r=this.getCanvasData(),l=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(J(r,function(c,h){r[h]=c*a})),this.setCropBoxData(J(l,function(c,h){l[h]=c*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===Eo||this.setDragMode(dr(this.dragBox,rs)?Ro:Ts)},wheel:function(t){var e=this,s=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){e.wheeling=!1},50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*s,t)))},cropStart:function(t){var e=t.buttons,s=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(I(e)&&e!==1||I(s)&&s!==0||t.ctrlKey))){var n=this.options,o=this.pointers,a;t.changedTouches?J(t.changedTouches,function(r){o[r.identifier]=ai(r)}):o[t.pointerId||0]=ai(t),Object.keys(o).length>1&&n.zoomable&&n.zoomOnTouch?a=Po:a=gs(t.target,Ke),er.test(a)&&ve(this.element,fs,{originalEvent:t,action:a})!==!1&&(t.preventDefault(),this.action=a,this.cropping=!1,a===To&&(this.cropping=!0,tt(this.dragBox,Di)))}},cropMove:function(t){var e=this.action;if(!(this.disabled||!e)){var s=this.pointers;t.preventDefault(),ve(this.element,ds,{originalEvent:t,action:e})!==!1&&(t.changedTouches?J(t.changedTouches,function(n){K(s[n.identifier]||{},ai(n,!0))}):K(s[t.pointerId||0]||{},ai(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,s=this.pointers;t.changedTouches?J(t.changedTouches,function(n){delete s[n.identifier]}):delete s[t.pointerId||0],e&&(t.preventDefault(),Object.keys(s).length||(this.action=""),this.cropping&&(this.cropping=!1,xe(this.dragBox,Di,this.cropped&&this.options.modal)),ve(this.element,hs,{originalEvent:t,action:e}))}}},Tr={change:function(t){var e=this.options,s=this.canvasData,n=this.containerData,o=this.cropBoxData,a=this.pointers,r=this.action,l=e.aspectRatio,c=o.left,h=o.top,d=o.width,f=o.height,u=c+d,p=h+f,g=0,m=0,b=n.width,y=n.height,w=!0,k;!l&&t.shiftKey&&(l=d&&f?d/f:1),this.limited&&(g=o.minLeft,m=o.minTop,b=g+Math.min(n.width,s.width,s.left+s.width),y=m+Math.min(n.height,s.height,s.top+s.height));var _=a[Object.keys(a)[0]],x={x:_.endX-_.startX,y:_.endY-_.startY},M=function(D){switch(D){case Zt:u+x.x>b&&(x.x=b-u);break;case Jt:c+x.x<g&&(x.x=g-c);break;case Bt:h+x.y<m&&(x.y=m-h);break;case ge:p+x.y>y&&(x.y=y-p);break}};switch(r){case Os:c+=x.x,h+=x.y;break;case Zt:if(x.x>=0&&(u>=b||l&&(h<=m||p>=y))){w=!1;break}M(Zt),d+=x.x,d<0&&(r=Jt,d=-d,c-=d),l&&(f=d/l,h+=(o.height-f)/2);break;case Bt:if(x.y<=0&&(h<=m||l&&(c<=g||u>=b))){w=!1;break}M(Bt),f-=x.y,h+=x.y,f<0&&(r=ge,f=-f,h-=f),l&&(d=f*l,c+=(o.width-d)/2);break;case Jt:if(x.x<=0&&(c<=g||l&&(h<=m||p>=y))){w=!1;break}M(Jt),d-=x.x,c+=x.x,d<0&&(r=Zt,d=-d,c-=d),l&&(f=d/l,h+=(o.height-f)/2);break;case ge:if(x.y>=0&&(p>=y||l&&(c<=g||u>=b))){w=!1;break}M(ge),f+=x.y,f<0&&(r=Bt,f=-f,h-=f),l&&(d=f*l,c+=(o.width-d)/2);break;case Oe:if(l){if(x.y<=0&&(h<=m||u>=b)){w=!1;break}M(Bt),f-=x.y,h+=x.y,d=f*l}else M(Bt),M(Zt),x.x>=0?u<b?d+=x.x:x.y<=0&&h<=m&&(w=!1):d+=x.x,x.y<=0?h>m&&(f-=x.y,h+=x.y):(f-=x.y,h+=x.y);d<0&&f<0?(r=Pe,f=-f,d=-d,h-=f,c-=d):d<0?(r=Te,d=-d,c-=d):f<0&&(r=Ae,f=-f,h-=f);break;case Te:if(l){if(x.y<=0&&(h<=m||c<=g)){w=!1;break}M(Bt),f-=x.y,h+=x.y,d=f*l,c+=o.width-d}else M(Bt),M(Jt),x.x<=0?c>g?(d-=x.x,c+=x.x):x.y<=0&&h<=m&&(w=!1):(d-=x.x,c+=x.x),x.y<=0?h>m&&(f-=x.y,h+=x.y):(f-=x.y,h+=x.y);d<0&&f<0?(r=Ae,f=-f,d=-d,h-=f,c-=d):d<0?(r=Oe,d=-d,c-=d):f<0&&(r=Pe,f=-f,h-=f);break;case Pe:if(l){if(x.x<=0&&(c<=g||p>=y)){w=!1;break}M(Jt),d-=x.x,c+=x.x,f=d/l}else M(ge),M(Jt),x.x<=0?c>g?(d-=x.x,c+=x.x):x.y>=0&&p>=y&&(w=!1):(d-=x.x,c+=x.x),x.y>=0?p<y&&(f+=x.y):f+=x.y;d<0&&f<0?(r=Oe,f=-f,d=-d,h-=f,c-=d):d<0?(r=Ae,d=-d,c-=d):f<0&&(r=Te,f=-f,h-=f);break;case Ae:if(l){if(x.x>=0&&(u>=b||p>=y)){w=!1;break}M(Zt),d+=x.x,f=d/l}else M(ge),M(Zt),x.x>=0?u<b?d+=x.x:x.y>=0&&p>=y&&(w=!1):d+=x.x,x.y>=0?p<y&&(f+=x.y):f+=x.y;d<0&&f<0?(r=Te,f=-f,d=-d,h-=f,c-=d):d<0?(r=Pe,d=-d,c-=d):f<0&&(r=Oe,f=-f,h-=f);break;case Ao:this.move(x.x,x.y),w=!1;break;case Po:this.zoom(pr(a),t),w=!1;break;case To:if(!x.x||!x.y){w=!1;break}k=Bo(this.cropper),c=_.startX-k.left,h=_.startY-k.top,d=o.minWidth,f=o.minHeight,x.x>0?r=x.y>0?Ae:Oe:x.x<0&&(c-=d,r=x.y>0?Pe:Te),x.y<0&&(h-=f),this.cropped||(Dt(this.cropBox,rt),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}w&&(o.width=d,o.height=f,o.left=c,o.top=h,this.action=r,this.renderCropBox()),J(a,function(S){S.startX=S.endX,S.startY=S.endY})}},Ar={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&tt(this.dragBox,Di),Dt(this.cropBox,rt),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=K({},this.initialImageData),this.canvasData=K({},this.initialCanvasData),this.cropBoxData=K({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(K(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Dt(this.dragBox,Di),tt(this.cropBox,rt)),this},replace:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,J(this.previews,function(s){s.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,Dt(this.cropper,Zs)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,tt(this.cropper,Zs)),this},destroy:function(){var t=this.element;return t[U]?(t[U]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,s=this.canvasData,n=s.left,o=s.top;return this.moveTo($i(t)?t:n+Number(t),$i(e)?e:o+Number(e))},moveTo:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,s=this.canvasData,n=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(I(t)&&(s.left=t,n=!0),I(e)&&(s.top=e,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,e){var s=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(s.width*t/s.naturalWidth,null,e)},zoomTo:function(t,e,s){var n=this.options,o=this.canvasData,a=o.width,r=o.height,l=o.naturalWidth,c=o.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&n.zoomable){var h=l*t,d=c*t;if(ve(this.element,us,{ratio:t,oldRatio:a/l,originalEvent:s})===!1)return this;if(s){var f=this.pointers,u=Bo(this.cropper),p=f&&Object.keys(f).length?mr(f):{pageX:s.pageX,pageY:s.pageY};o.left-=(h-a)*((p.pageX-u.left-o.left)/a),o.top-=(d-r)*((p.pageY-u.top-o.top)/r)}else be(e)&&I(e.x)&&I(e.y)?(o.left-=(h-a)*((e.x-o.left)/a),o.top-=(d-r)*((e.y-o.top)/r)):(o.left-=(h-a)/2,o.top-=(d-r)/2);o.width=h,o.height=d,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),I(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,I(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(I(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,s=this.imageData,n=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(I(t)&&(s.scaleX=t,n=!0),I(e)&&(s.scaleY=e,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.options,s=this.imageData,n=this.canvasData,o=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:o.left-n.left,y:o.top-n.top,width:o.width,height:o.height};var r=s.width/s.naturalWidth;if(J(a,function(h,d){a[d]=h/r}),t){var l=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=l-a.y}}else a={x:0,y:0,width:0,height:0};return e.rotatable&&(a.rotate=s.rotate||0),e.scalable&&(a.scaleX=s.scaleX||1,a.scaleY=s.scaleY||1),a},setData:function(t){var e=this.options,s=this.imageData,n=this.canvasData,o={};if(this.ready&&!this.disabled&&be(t)){var a=!1;e.rotatable&&I(t.rotate)&&t.rotate!==s.rotate&&(s.rotate=t.rotate,a=!0),e.scalable&&(I(t.scaleX)&&t.scaleX!==s.scaleX&&(s.scaleX=t.scaleX,a=!0),I(t.scaleY)&&t.scaleY!==s.scaleY&&(s.scaleY=t.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var r=s.width/s.naturalWidth;I(t.x)&&(o.left=t.x*r+n.left),I(t.y)&&(o.top=t.y*r+n.top),I(t.width)&&(o.width=t.width*r),I(t.height)&&(o.height=t.height*r),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?K({},this.containerData):{}},getImageData:function(){return this.sized?K({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&J(["left","top","width","height","naturalWidth","naturalHeight"],function(s){e[s]=t[s]}),e},setCanvasData:function(t){var e=this.canvasData,s=e.aspectRatio;return this.ready&&!this.disabled&&be(t)&&(I(t.left)&&(e.left=t.left),I(t.top)&&(e.top=t.top),I(t.width)?(e.width=t.width,e.height=t.width/s):I(t.height)&&(e.height=t.height,e.width=t.height*s),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,e;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(t){var e=this.cropBoxData,s=this.options.aspectRatio,n,o;return this.ready&&this.cropped&&!this.disabled&&be(t)&&(I(t.left)&&(e.left=t.left),I(t.top)&&(e.top=t.top),I(t.width)&&t.width!==e.width&&(n=!0,e.width=t.width),I(t.height)&&t.height!==e.height&&(o=!0,e.height=t.height),s&&(n?e.height=e.width/s:o&&(e.width=e.height*s)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,s=xr(this.image,this.imageData,e,t);if(!this.cropped)return s;var n=this.getData(t.rounded),o=n.x,a=n.y,r=n.width,l=n.height,c=s.width/Math.floor(e.naturalWidth);c!==1&&(o*=c,a*=c,r*=c,l*=c);var h=r/l,d=Wt({aspectRatio:h,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),f=Wt({aspectRatio:h,width:t.minWidth||0,height:t.minHeight||0},"cover"),u=Wt({aspectRatio:h,width:t.width||(c!==1?s.width:r),height:t.height||(c!==1?s.height:l)}),p=u.width,g=u.height;p=Math.min(d.width,Math.max(f.width,p)),g=Math.min(d.height,Math.max(f.height,g));var m=document.createElement("canvas"),b=m.getContext("2d");m.width=ye(p),m.height=ye(g),b.fillStyle=t.fillColor||"transparent",b.fillRect(0,0,p,g);var y=t.imageSmoothingEnabled,w=y===void 0?!0:y,k=t.imageSmoothingQuality;b.imageSmoothingEnabled=w,k&&(b.imageSmoothingQuality=k);var _=s.width,x=s.height,M=o,S=a,D,T,O,R,F,Y;M<=-r||M>_?(M=0,D=0,O=0,F=0):M<=0?(O=-M,M=0,D=Math.min(_,r+M),F=D):M<=_&&(O=0,D=Math.min(r,_-M),F=D),D<=0||S<=-l||S>x?(S=0,T=0,R=0,Y=0):S<=0?(R=-S,S=0,T=Math.min(x,l+S),Y=T):S<=x&&(R=0,T=Math.min(l,x-S),Y=T);var P=[M,S,D,T];if(F>0&&Y>0){var N=p/r;P.push(O*N,R*N,F*N,Y*N)}return b.drawImage.apply(b,[s].concat(Oo(P.map(function(B){return Math.floor(ye(B))}
10)))),m},setAspectRatio:function(t){var e=this.options;return!this.disabled&&!$i(t)&&(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,s=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var o=t===Ts,a=e.movable&&t===Ro;t=o||a?t:Eo,e.dragMode=t,Ge(s,Ke,t),xe(s,rs,o),xe(s,ls,a),e.cropBoxMovable||(Ge(n,Ke,t),xe(n,rs,o),xe(n,ls,a))}return this}},Pr=Ot.Cropper,Wo=(function(){function i(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ya(this,i),!t||!nr.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=K({},ln,be(e)&&e),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 $a(i,[{key:"init",value:function(){var e=this.element,s=e.tagName.toLowerCase(),n;if(!e[U]){if(e[U]=this,s==="img"){if(this.isImg=!0,n=e.getAttribute("src")||"",this.originalUrl=n,!n)return;n=e.src}else s==="canvas"&&window.HTMLCanvasElement&&(n=e.toDataURL());this.load(n)}}},{key:"load",value:function(e){var s=this;if(e){this.url=e,this.imageData={};var n=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(ir.test(e)){sr.test(e)?this.read(_r(e)):this.clone();return}var a=new XMLHttpRequest,r=this.clone.bind(this);this.reloading=!0,this.xhr=a,a.onabort=r,a.onerror=r,a.ontimeout=r,a.onprogress=function(){a.getResponseHeader("content-type")!==rn&&a.abort()},a.onload=function(){s.read(a.response)},a.onloadend=function(){s.reloading=!1,s.xhr=null},o.checkCrossOrigin&&hn(e)&&n.crossOrigin&&(e=dn(e)),a.open("GET",e,!0),a.responseType="arraybuffer",a.withCredentials=n.crossOrigin==="use-credentials",a.send()}}},{key:"read",value:function(e){var s=this.options,n=this.imageData,o=Mr(e),a=0,r=1,l=1;if(o>1){this.url=wr(e,rn);var c=kr(o);a=c.rotate,r=c.scaleX,l=c.scaleY}s.rotatable&&(n.rotate=a),s.scalable&&(n.scaleX=r,n.scaleY=l),this.clone()}},{key:"clone",value:function(){var e=this.element,s=this.url,n=e.crossOrigin,o=s;this.options.checkCrossOrigin&&hn(s)&&(n||(n="anonymous"),o=dn(s)),this.crossOrigin=n,this.crossOriginUrl=o;var a=document.createElement("img");n&&(a.crossOrigin=n),a.src=o||s,a.alt=e.alt||"The image to crop",this.image=a,a.onload=this.start.bind(this),a.onerror=this.stop.bind(this),tt(a,Js),e.parentNode.insertBefore(a,e.nextSibling)}},{key:"start",value:function(){var e=this,s=this.image;s.onload=null,s.onerror=null,this.sizing=!0;var n=Ot.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Ot.navigator.userAgent),o=function(c,h){K(e.imageData,{naturalWidth:c,naturalHeight:h,aspectRatio:c/h}),e.initialImageData=K({},e.imageData),e.sizing=!1,e.sized=!0,e.build()};if(s.naturalWidth&&!n){o(s.naturalWidth,s.naturalHeight);return}var a=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=a,a.onload=function(){o(a.width,a.height),n||r.removeChild(a)},a.src=s.src,n||(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;",r.appendChild(a))}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var e=this.element,s=this.options,n=this.image,o=e.parentNode,a=document.createElement("div");a.innerHTML=or;var r=a.querySelector(".".concat(U,"-container")),l=r.querySelector(".".concat(U,"-canvas")),c=r.querySelector(".".concat(U,"-drag-box")),h=r.querySelector(".".concat(U,"-crop-box")),d=h.querySelector(".".concat(U,"-face"));this.container=o,this.cropper=r,this.canvas=l,this.dragBox=c,this.cropBox=h,this.viewBox=r.querySelector(".".concat(U,"-view-box")),this.face=d,l.appendChild(n),tt(e,rt),o.insertBefore(r,e.nextSibling),Dt(n,Js),this.initPreview(),this.bind(),s.initialAspectRatio=Math.max(0,s.initialAspectRatio)||NaN,s.aspectRatio=Math.max(0,s.aspectRatio)||NaN,s.viewMode=Math.max(0,Math.min(3,Math.round(s.viewMode)))||0,tt(h,rt),s.guides||tt(h.getElementsByClassName("".concat(U,"-dashed")),rt),s.center||tt(h.getElementsByClassName("".concat(U,"-center")),rt),s.background&&tt(r,"".concat(U,"-bg")),s.highlight||tt(d,Za),s.cropBoxMovable&&(tt(d,ls),Ge(d,Ke,Os)),s.cropBoxResizable||(tt(h.getElementsByClassName("".concat(U,"-line")),rt),tt(h.getElementsByClassName("".concat(U,"-point")),rt)),this.render(),this.ready=!0,this.setDragMode(s.dragMode),s.autoCrop&&this.crop(),this.setData(s.data),at(s.ready)&&pt(e,nn,s.ready,{once:!0}),ve(e,nn)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var e=this.cropper.parentNode;e&&e.removeChild(this.cropper),Dt(this.element,rt)}}},{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=Pr,i}},{key:"setDefaults",value:function(e){K(ln,be(e)&&e)}}])})();K(Wo.prototype,Sr,Dr,Cr,Or,Tr,Ar);/*! 11 * @kurkle/color v0.3.4 12 * https://github.com/kurkle/color#readme 13 * (c) 2024 Jukka Kurkela 14 * Released under the MIT License 15 */function si(i){return i+.5|0}const Ht=(i,t,e)=>Math.max(Math.min(i,e),t);function ze(i){return Ht(si(i*2.55),0,255)}function Ut(i){return Ht(si(i*255),0,255)}function Lt(i){return Ht(si(i/2.55)/100,0,1)}function fn(i){return Ht(si(i*100),0,100)}const gt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ps=[..."0123456789ABCDEF"],Rr=i=>ps[i&15],Er=i=>ps[(i&240)>>4]+ps[i&15],ri=i=>(i&240)>>4===(i&15),Lr=i=>ri(i.r)&&ri(i.g)&&ri(i.b)&&ri(i.a);function Ir(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255>[i[1]]*17,g:255>[i[2]]*17,b:255>[i[3]]*17,a:t===5?gt[i[4]]*17:255}:(t===7||t===9)&&(e={r:gt[i[1]]<<4|gt[i[2]],g:gt[i[3]]<<4|gt[i[4]],b:gt[i[5]]<<4|gt[i[6]],a:t===9?gt[i[7]]<<4|gt[i[8]]:255})),e}const Nr=(i,t)=>i<255?t(i):"";function zr(i){var t=Lr(i)?Rr:Er;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Nr(i.a,t):void 0}const jr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ho(i,t,e){const s=t*Math.min(e,1-e),n=(o,a=(o+i/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function Br(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Fr(i,t,e){const s=Ho(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Wr(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Ps(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),a=Math.min(e,s,n),r=(o+a)/2;let l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=Wr(e,s,n,h,o),l=l*60+.5),[l|0,c||0,r]}function Rs(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Ut)}function Es(i,t,e){return Rs(Ho,i,t,e)}function Hr(i,t,e){return Rs(Fr,i,t,e)}function Vr(i,t,e){return Rs(Br,i,t,e)}function Vo(i){return(i%360+360)%360}function Yr(i){const t=jr.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?ze(+t[5]):Ut(+t[5]));const n=Vo(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=Hr(n,o,a):t[1]==="hsv"?s=Vr(n,o,a):s=Es(n,o,a),{r:s[0],g:s[1],b:s[2],a:e}}function $r(i,t){var e=Ps(i);e[0]=Vo(e[0]+t),e=Es(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Xr(i){if(!i)return;const t=Ps(i),e=t[0],s=fn(t[1]),n=fn(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${Lt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const un={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},gn={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",K
vendor: 5,184 bytes, lines 15-20
15ocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Ur(){const i={},t=Object.keys(gn),e=Object.keys(un);let s,n,o,a,r;for(s=0;s<t.length;s++){for(a=r=t[s],n=0;n<e.length;n++)o=e[n],r=r.replace(o,un[o]);o=parseInt(gn[a],16),i[r]=[o>>16&255,o>>8&255,o&255]}return i}let li;function Kr(i){li||(li=Ur(),li.transparent=[0,0,0,0]);const t=li[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Gr=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function qr(i){const t=Gr.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const a=+t[7];e=t[8]?ze(a):Ht(a*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?ze(s):Ht(s,0,255)),n=255&(t[4]?ze(n):Ht(n,0,255)),o=255&(t[6]?ze(o):Ht(o,0,255)),{r:s,g:n,b:o,a:e}}}function Zr(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Lt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ui=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,pe=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Jr(i,t,e){const s=pe(Lt(i.r)),n=pe(Lt(i.g)),o=pe(Lt(i.b));return{r:Ut(Ui(s+e*(pe(Lt(t.r))-s))),g:Ut(Ui(n+e*(pe(Lt(t.g))-n))),b:Ut(Ui(o+e*(pe(Lt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ci(i,t,e){if(i){let s=Ps(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Es(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function Yo(i,t){return i&&Object.assign(t||{},i)}function pn(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Ut(i[3]))):(t=Yo(i,{r:0,g:0,b:0,a:1}),t.a=Ut(t.a)),t}function Qr(i){return i.charAt(0)==="r"?qr(i):Yr(i)}class qe{constructor(t){if(t instanceof qe)return t;const e=typeof t;let s;e==="object"?s=pn(t):e==="string"&&(s=Ir(t)||Kr(t)||Qr(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=Yo(this._rgb);return t&&(t.a=Lt(t.a)),t}set rgb(t){this._rgb=pn(t)}rgbString(){return this._valid?Zr(this._rgb):void 0}hexString(){return this._valid?zr(this._rgb):void 0}hslString(){return this._valid?Xr(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=s.a-n.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=a*s.a+(1-a)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Jr(this._rgb,t._rgb,e)),this}clone(){return new qe(this.rgb)}alpha(t){return this._rgb.a=Ut(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=si(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ci(this._rgb,2,t),this}darken(t){return ci(this._rgb,2,-t),this}saturate(t){return ci(this._rgb,1,t),this}desaturate(t){return ci(this._rgb,1,-t),this}rotate(t){return $r(this._rgb,t),this}}/*! 16 * Chart.js v4.5.1 17 * https://www.chartjs.org 18 * (c) 2025 Chart.js Contributors 19 * Released under the MIT License 20 */function Pt(){}const tl=(()=>{let i=0;return()=>i++})();function W(i){return i==null}function et(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);
vendor: 3,949 bytes, line 20
20return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function j(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function mt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Mt(i,t){return mt(i)?i:t}function E(i,t){return typeof i>"u"?t:i}const el=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,$o=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function $(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function H(i,t,e,s){let n,o,a;if(et(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(j(i))for(a=Object.keys(i),o=a.length,n=0;n<o;n++)t.call(e,i[a[n]],a[n])}function Ci(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Oi(i){if(et(i))return i.map(Oi);if(j(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=Oi(i[e[n]]);return t}return i}function Xo(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function il(i,t,e,s){if(!Xo(i))return;const n=t[i],o=e[i];j(n)&&j(o)?Ze(n,o,s):t[i]=Oi(o)}function Ze(i,t,e){const s=et(t)?t:[t],n=s.length;if(!j(i))return i;e=e||{};const o=e.merger||il;let a;for(let r=0;r<n;++r){if(a=s[r],!j(a))continue;const l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],i,a,e)}return i}function Ye(i,t){return Ze(i,t,{merger:sl})}function sl(i,t,e){if(!Xo(i))return;const s=t[i],n=e[i];j(s)&&j(n)?Ye(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Oi(n))}const mn={"":i=>i,x:i=>i.x,y:i=>i.y};function nl(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function ol(i){const t=nl(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function le(i,t){return(mn[t]||(mn[t]=ol(t)))(i)}function Ls(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Je=i=>typeof i<"u",Kt=i=>typeof i=="function",bn=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function al(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const V=Math.PI,q=2*V,rl=q+V,Ti=Number.POSITIVE_INFINITY,ll=V/180,Q=V/2,Qt=V/4,xn=V*2/3,Uo=Math.log10,Ct=Math.sign;function $e(i,t,e){return Math.abs(i-t)<e}function yn(i){const t=Math.round(i);i=$e(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Uo(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function cl(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function hl(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Qe(i){return!hl(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function dl(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function fl(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Nt(i){return i*(V/180)}function ul(i){return i*(180/V)}function vn(i){if(!mt(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function Ko(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*V&&(o+=q),{angle:o,distance:n}}function ms(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function gl(i,t){return(i-t+rl)%q-V}function vt(i){return(i%q+q)%q}function ti(i,t,e,s){const n=vt(i),o=vt(t),a=vt(e),r=vt(o-n),l=vt(a-n),c=vt(n-o),h=vt(n-a);return n===o||n===a||s&&o===a||r>l&&c<h}function nt(i,t,e){return Math.max(t,Math.min(e,i))}function pl(i){return nt(i,-32768,32767)}function Vt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Is(i,t,e){e=e||(a=>i[a]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const ne=(i,t,e,s)=>Is(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),ml=(i,t,e)=>
vendor: 7,647 bytes, line 20
20Is(i,e,s=>i[s][t]>=e);function bl(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const Go=["push","pop","shift","splice","unshift"];function xl(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Go.forEach(e=>{const s="_onData"+Ls(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=n.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})})}function _n(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Go.forEach(o=>{delete i[o]}),delete i._chartjs)}function qo(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Zo=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Jo(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Zo.call(window,()=>{s=!1,i.apply(t,e)}))}}function yl(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Qo=i=>i==="start"?"left":i==="end"?"right":"center",ht=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,vl=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function _l(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:a,vScale:r,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=a.axis,{min:d,max:f,minDefined:u,maxDefined:p}=a.getUserBounds();if(u){if(n=Math.min(ne(l,h,d).lo,e?s:ne(t,h,a.getPixelForValue(d)).lo),c){const g=l.slice(0,n+1).reverse().findIndex(m=>!W(m[r.axis]));n-=Math.max(0,g)}n=nt(n,0,s-1)}if(p){let g=Math.max(ne(l,a.axis,f,!0).hi+1,e?0:ne(t,h,a.getPixelForValue(f),!0).hi+1);if(c){const m=l.slice(g-1).findIndex(b=>!W(b[r.axis]));g+=Math.max(0,m)}o=nt(g,n,s)-n}else o=s-n}return{start:n,count:o}}function wl(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const hi=i=>i===0||i===1,wn=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*q/e)),Mn=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*q/e)+1,Xe={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*Q)+1,easeOutSine:i=>Math.sin(i*Q),easeInOutSine:i=>-.5*(Math.cos(V*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=>hi(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=>hi(i)?i:wn(i,.075,.3),easeOutElastic:i=>hi(i)?i:Mn(i,.075,.3),easeInOutElastic(i){return hi(i)?i:i<.5?.5*wn(i*2,.1125,.45):.5+.5*Mn(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 t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Xe.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?Xe.easeInBounce(i*2)*.5:Xe.easeOutBounce(i*2-1)*.5+.5};function Ns(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function kn(i){return Ns(i)?i:new qe(i)}function Ki(i){return Ns(i)?i:new qe(i).saturate(.5).darken(.1).hexString()}const Ml=["x","y","borderWidth","radius","tension"],kl=["color","borderColor","backgroundColor"];function Sl(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:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:kl},numbers:{type:"number",properties:Ml}}),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:t=>t|0}}}})}function Dl(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Sn=new Map;function Cl(i,t){t=t||{};const e=i+JSON.stringify(t);let s=Sn.get(e);return s||(s=new Intl.NumberFormat(i,t),Sn.set(e,s)),s}function zs(i,t,e){return Cl(t,e).format(i)}const Ol={values(i){return et(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Tl(i,e)}const a=Uo(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),zs(i,s,l)}};function Tl(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var ta={formatters:Ol};function Al(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:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.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:ta.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:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ce=Object.create(null),bs=Object.create(null);function Ue(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Gi(i,t,e){return typeof t=="string"?Ze(Ue(i,t),e):Ze(Ue(i,""),t)}class Pl{constructor(t,e){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=s=>s.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={}
vendor: 50,338 bytes, lines 20-25
20,this.hoverBackgroundColor=(s,n)=>Ki(n.backgroundColor),this.hoverBorderColor=(s,n)=>Ki(n.borderColor),this.hoverColor=(s,n)=>Ki(n.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(t),this.apply(e)}set(t,e){return Gi(this,t,e)}get(t){return Ue(this,t)}describe(t,e){return Gi(bs,t,e)}override(t,e){return Gi(ce,t,e)}route(t,e,s,n){const o=Ue(this,t),a=Ue(this,s),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[n];return j(l)?Object.assign({},c,l):E(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new Pl({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Sl,Dl,Al]);function Rl(i){return!i||W(i.size)||W(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Dn(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function te(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function Cn(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function xs(i,t,e,s){ea(i,t,e,s,null)}function ea(i,t,e,s,n){let o,a,r,l,c,h,d,f;const u=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*ll;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(m),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),u){default:n?i.ellipse(e,s,n/2,g,0,0,q):i.arc(e,s,g,0,q),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=xn,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=xn,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,a=Math.cos(m+Qt)*l,d=Math.cos(m+Qt)*(n?n/2-c:l),r=Math.sin(m+Qt)*l,f=Math.sin(m+Qt)*(n?n/2-c:l),i.arc(e-d,s-r,c,m-V,m-Q),i.arc(e+f,s-a,c,m-Q,m),i.arc(e+d,s+r,c,m,m+Q),i.arc(e-f,s+a,c,m+Q,m+V),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}m+=Qt;case"rectRot":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-r),i.lineTo(e+f,s-a),i.lineTo(e+d,s+r),i.lineTo(e-f,s+a),i.closePath();break;case"crossRot":m+=Qt;case"cross":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+f,s-a),i.lineTo(e-f,s+a);break;case"star":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+f,s-a),i.lineTo(e-f,s+a),m+=Qt,d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+f,s-a),i.lineTo(e-f,s+a);break;case"line":a=n?n/2:Math.cos(m)*g,r=Math.sin(m)*g,i.moveTo(e-a,s-r),i.lineTo(e+a,s+r);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function ei(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function js(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Bs(i){i.restore()}function El(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function Ll(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function Il(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),W(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function Nl(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(a,h),i.lineTo(r,h),i.stroke()}}function zl(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Ai(i,t,e,s,n,o={}){const a=et(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Il(i,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&zl(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),W(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),Nl(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function Pi(i,t){const{x:e,y:s,w:n,h:o,radius:a}=t;i.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*V,V,!0),i.lineTo(e,s+o-a.bottomLeft),i.arc(e+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,V,Q,!0),i.lineTo(e+n-a.bottomRight,s+o),i.arc(e+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,Q,0,!0),i.lineTo(e+n,s+a.topRight),i.arc(e+n-a.topRight,s+a.topRight,a.topRight,0,-Q,!0),i.lineTo(e+a.topLeft,s)}const jl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Bl=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Fl(i,t){const e=(""+i).match(jl);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const Wl=i=>+i||0;function Fs(i,t){const e={},s=j(t),n=s?Object.keys(t):t,o=j(i)?s?a=>E(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of n)e[a]=Wl(o(a));return e}function ia(i){return Fs(i,{top:"y",right:"x",bottom:"y",left:"x"})}function _e(i){return Fs(i,["topLeft","topRight","bottomLeft","bottomRight"])}function _t(i){const t=ia(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ct(i,t){i=i||{},t=t||Z.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=E(i.style,t.style);s&&!(""+s).match(Bl)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:E(i.family,t.family),lineHeight:Fl(E(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:E(i.weight,t.weight),string:""};return n.string=Rl(n),n}function di(i,t,e,s){let n,o,a;for(n=0,o=i.length;n<o;++n)if(a=i[n],a!==void 0&&a!==void 0)return a}function Hl(i,t,e){const{min:s,max:n}=i,o=$o(t,(n-s)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function he(i,t){return Object.assign(Object.create(i),t)}function Ws(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=aa("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:r=>Ws([r,...i],t,o,s)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return na(r,l,()=>ql(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return Tn(r).includes(l)},ownKeys(r){return Tn(r)},set(r,l,c){const h=r._storage||(r._storage=n());return r[l]=h[l]=c,delete r._keys,!0}})}function Me(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:sa(i,s),setContext:o=>Me(i,o,e,s),override:o=>Me(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return na(o,a,()=>Yl(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function sa(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Kt(e)?e:()=>e,isIndexable:Kt(s)?s:()=>s}}const Vl=(i,t)=>i?i+Ls(t):t,Hs=(i,t)=>j(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function na(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function Yl(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=i;let r=s[t];return Kt(r)&&a.isScriptable(t)&&(r=$l(t,r,i,e)),et(r)&&r.length&&(r=Xl(t,r,i,a.isIndexable)),Hs(t,r)&&(r=Me(r,n,o&&o[t],a)),r}function $l(i,t,e,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||s);return r.delete(i),Hs(i,l)&&(l=Vs(n._scopes,n,i,l)),l}function Xl(i,t,e,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(j(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Vs(c,n,i,h);t.push(Me(d,o,a&&a[i],r))}}return t}function oa(i,t,e){return Kt(i)?i(t,e):i}const Ul=(i,t)=>i===!0?t:typeof i=="string"?le(t,i):void 0;function Kl(i,t,e,s,n){for(const o of t){const a=Ul(e,o);if(a){i.add(a);const r=oa(a._fallback,e,n);if(typeof r<"u"&&r!==e&&r!==s)return r}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function Vs(i,t,e,s){const n=t._rootScopes,o=oa(t._fallback,e,s),a=[...i,...n],r=new Set;r.add(s);let l=On(r,a,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=On(r,a,o,l,s),l===null)?!1:Ws(Array.from(r),[""],n,o,()=>Gl(t,e,s))}function On(i,t,e,s,n){for(;e;)e=Kl(i,t,e,s,n);return e}function Gl(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return et(n)&&j(e)?e:n||{}}function ql(i,t,e,s){let n;for(const o of t)if(n=aa(Vl(o,i),e),typeof n<"u")return Hs(i,n)?Vs(e,s,i,n):n}function aa(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Tn(i){let t=i._keys;return t||(t=i._keys=Zl(i._scopes)),t}function Zl(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const Jl=Number.EPSILON||1e-14,ke=(i,t)=>t<i.length&&!i[t].skip&&i[t],ra=i=>i==="x"?"y":"x";function Ql(i,t,e,s){const n=i.skip?t:i,o=t,a=e.skip?t:e,r=ms(o,n),l=ms(a,o);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,f=s*h;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+f*(a.x-n.x),y:o.y+f*(a.y-n.y)}}}function tc(i,t,e){const s=i.length;let n,o,a,r,l,c=ke(i,0);for(let h=0;h<s-1;++h)if(l=c,c=ke(i,h+1),!(!l||!c)){if($e(t[h],0,Jl)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],r=Math.pow(n,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[h]=n*a*t[h],e[h+1]=o*a*t[h])}}function ec(i,t,e="x"){const s=ra(e),n=i.length;let o,a,r,l=ke(i,0);for(let c=0;c<n;++c){if(a=r,r=l,l=ke(i,c+1),!r)continue;const h=r[e],d=r[s];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${s}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${s}`]=d+o*t[c])}}function ic(i,t="x"){const e=ra(t),s=i.length,n=Array(s).fill(0),o=Array(s);let a,r,l,c=ke(i,0);for(a=0;a<s;++a)if(r=l,l=c,c=ke(i,a+1),!!l){if(c){const h=c[t]-l[t];n[a]=h!==0?(c[e]-l[e])/h:0}o[a]=r?c?Ct(n[a-1])!==Ct(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}tc(i,n,o),ec(i,o,t)}function fi(i,t,e){return Math.max(Math.min(i,e),t)}function sc(i,t){let e,s,n,o,a,r=ei(i[0],t);for(e=0,s=i.length;e<s;++e)a=o,o=r,r=e<s-1&&ei(i[e+1],t),o&&(n=i[e],a&&(n.cp1x=fi(n.cp1x,t.left,t.right),n.cp1y=fi(n.cp1y,t.top,t.bottom)),r&&(n.cp2x=fi(n.cp2x,t.left,t.right),n.cp2y=fi(n.cp2y,t.top,t.bottom)))}function nc(i,t,e,s,n){let o,a,r,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")ic(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],l=Ql(c,r,i[Math.min(o+1,a-(s?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&sc(i,e)}function Ys(){return typeof window<"u"&&typeof document<"u"}function $s(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ri(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const zi=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function oc(i,t){return zi(i).getPropertyValue(t)}const ac=["top","right","bottom","left"];function oe(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=ac[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const rc=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function lc(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let a=!1,r,l;if(rc(n,o,i.target))r=n,l=o;else{const c=t.getBoundingClientRect();r=s.clientX-c.left,l=s.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function ie(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=zi(e),o=n.boxSizing==="border-box",a=oe(n,"padding"),r=oe(n,"border","width"),{x:l,y:c,box:h}=lc(i,e),d=a.left+(h&&r.left),f=a.top+(h&&r.top);let{width:u,height:p}=t;return o&&(u-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-d)/u*e.width/s),y:Math.round((c-f)/p*e.height/s)}}function cc(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&$s(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=zi(o),l=oe(r,"border","width"),c=oe(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,s=Ri(r.maxWidth,o,"clientWidth"),n=Ri(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Ti,maxHeight:n||Ti}}const Yt=i=>Math.round(i*10)/10;function hc(i,t,e,s){const n=zi(i),o=oe(n,"margin"),a=Ri(n.maxWidth,i,"clientWidth")||Ti,r=Ri(n.maxHeight,i,"clientHeight")||Ti,l=cc(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const f=oe(n,"border","width"),u=oe(n,"padding");c-=u.width+f.width,h-=u.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=Yt(Math.min(c,a,l.maxWidth)),h=Yt(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Yt(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=Yt(Math.floor(h*s))),{width:c,height:h}}function An(i,t,e){const s=t||1,n=Yt(i.height*s),o=Yt(i.width*s);i.height=Yt(i.height),i.width=Yt(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||a.height!==n||a.width!==o?(i.currentDevicePixelRatio=s,a.height=n,a.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const dc=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Ys()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function Pn(i,t){const e=oc(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function se(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function fc(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function uc(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=se(i,n,e),r=se(n,o,e),l=se(o,t,e),c=se(a,r,e),h=se(r,l,e);return se(c,h,e)}const gc=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},pc=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function we(i,t,e){return i?gc(t,e):pc()}function la(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function ca(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function ha(i){return i==="angle"?{between:ti,compare:gl,normalize:vt}:{between:Vt,compare:(t,e)=>t-e,normalize:t=>t}}function Rn({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function mc(i,t,e){const{property:s,start:n,end:o}=e,{between:a,normalize:r}=ha(s),l=t.length;let{start:c,end:h,loop:d}=i,f,u;if(d){for(c+=l,h+=l,f=0,u=l;f<u&&a(r(t[c%l][s]),n,o);++f)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function bc(i,t,e){if(!e)return[i];const{property:s,start:n,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=ha(s),{start:h,end:d,loop:f,style:u}=mc(i,t,e),p=[];let g=!1,m=null,b,y,w;const k=()=>l(n,w,b)&&r(n,w)!==0,_=()=>r(o,b)===0||l(o,w,b),x=()=>g||k(),M=()=>!g||_();for(let S=h,D=h;S<=d;++S)y=t[S%a],!y.skip&&(b=c(y[s]),b!==w&&(g=l(b,n,o),m===null&&x()&&(m=r(b,n)===0?S:D),m!==null&&M()&&(p.push(Rn({start:m,end:S,loop:f,count:a,style:u})),m=null),D=S,w=b));return m!==null&&p.push(Rn({start:m,end:d,loop:f,count:a,style:u})),p}function xc(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const o=bc(s[n],i.points,t);o.length&&e.push(...o)}return e}function yc(i,t,e,s){let n=0,o=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function vc(i,t,e,s){const n=i.length,o=[];let a=t,r=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?r.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%n,end:a%n,loop:s}),o}function _c(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:a,end:r}=yc(e,n,o,s);if(s===!0)return En(i,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+n:r,c=!!i._fullLoop&&a===0&&r===n-1;return En(i,vc(e,a,l,c),e,t)}function En(i,t,e,s){return!s||!s.setContext||!e?t:wc(i,t,e,s)}function wc(i,t,e,s){const n=i._chart.getContext(),o=Ln(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,l=e.length,c=[];let h=o,d=t[0].start,f=d;function u(p,g,m,b){const y=r?-1:1;if(p!==g){for(p+=l;e[p%l].skip;)p-=y;for(;e[g%l].skip;)g+=y;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:b}),h=b,d=g%l)}}for(const p of t){d=r?d:p.start;let g=e[d%l],m;for(f=d+1;f<=p.end;f++){const b=e[f%l];m=Ln(s.setContext(he(n,{type:"segment",p0:g,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),Mc(m,h)&&u(d,f-1,p.loop,h),g=b,h=m}d<f-1&&u(d,f-1,p.loop,h)}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 Mc(i,t){if(!t)return!1;const e=[],s=function(n,o){return Ns(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}function ui(i,t,e){return i.options.clip?i[e]:t[e]}function kc(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:ui(e,t,"left"),right:ui(e,t,"right"),top:ui(s,t,"top"),bottom:ui(s,t,"bottom")}:t}function Sc(i,t){const e=t._clip;if(e.disabled)return!1;const s=kc(t,i.chartArea);return{left:e.left===!1?0:s.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:s.right+(e.right===!0?0:e.right),top:e.top===!1?0:s.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:s.bottom+(e.bottom===!0?0:e.bottom)}}/*! 21 * Chart.js v4.5.1 22 * https://www.chartjs.org 23 * (c) 2025 Chart.js Contributors 24 * Released under the MIT License 25 */class Dc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Zo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Rt=new Dc;const In="transparent",Cc={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=kn(i||In),n=s.valid&&kn(t||In);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Oc{constructor(t,e,s,n){const o=e[s];n=di([t.to,n,o,t.from]);const a=di([t.from,o,n]);this._active=!0,this._fn=t.fn||Cc[t.type||typeof a],this._easing=Xe[t.easing]||Xe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=di([t.to,e,n,t.from]),this._from=di([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<s),!this._active){this._target[n]=r,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class da{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!j(t))return;const e=Object.keys(Z.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!j(o))return;const a={};for(const r of e)a[r]=o[r];(et(o.properties)&&o.properties||[n]).forEach(r=>{(r===n||!s.has(r))&&s.set(r,a)})})}_animateOptions(t,e){const s=e.options,n=Ac(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Tc(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=s.get(c);if(d)if(f&&d.active()){d.update(f,h,r);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new Oc(f,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Rt.add(this._chart,s),!0}}function Tc(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Ac(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Nn(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function Pc(i,t,e){if(e===!1)return!1;const s=Nn(i,e),n=Nn(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function Rc(i){let t,e,s,n;return j(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function fa(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function zn(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let a,r,l,c;if(t===null)return;let h=!1;for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===e){if(h=!0,s.all)continue;break}c=i.values[l],mt(c)&&(o||t===0||Ct(t)===Ct(c))&&(t+=c)}return!h&&!s.all?0:t}function Ec(i,t){const{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",a=Object.keys(i),r=new Array(a.length);let l,c,h;for(l=0,c=a.length;l<c;++l)h=a[l],r[l]={[n]:h,[o]:i[h]};return r}function qi(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Lc(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Ic(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function Nc(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function jn(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Bn(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,c=a.axis,h=Lc(o,a,s),d=t.length;let f;for(let u=0;u<d;++u){const p=t[u],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});f=b[c]=Nc(n,h,g),f[r]=m,f._top=jn(f,a,!0,s.type),f._bottom=jn(f,a,!1,s.type);const y=f._visualValues||(f._visualValues={});y[r]=m}}function Zi(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function zc(i,t){return he(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function jc(i,t,e){return he(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Re(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const Ji=i=>i==="reset"||i==="none",Fn=(i,t)=>t?i:Object.assign({},i),Bc=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:fa(e,!0),values:null};class ae{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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 t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=qi(t.vScale,t),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(t){this.index!==t&&Re(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,f,u,p)=>d==="x"?f:d==="r"?p:u,o=e.xAxisID=E(s.xAxisID,Zi(t,"x")),a=e.yAxisID=E(s.yAxisID,Zi(t,"y")),r=e.rAxisID=E(s.rAxisID,Zi(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,a,r),h=e.vAxisID=n(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_n(this._data,this),t._stacked&&Re(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(j(e)){const n=this._cachedMeta;this._data=Ec(e,n)}else if(s!==e){if(s){_n(s,this);const n=this._cachedMeta;Re(n),n._parsed=[]}e&&Object.isExtensible(e)&&xl(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=qi(e.vScale,e),e.stack!==s.stack&&(n=!0,Re(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(Bn(this,e._parsed),e._stacked=qi(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:a}=s,r=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,f;if(this._parsing===!1)s._parsed=n,s._sorted=!0,f=n;else{et(n[t])?f=this.parseArrayData(s,n,t,e):j(n[t])?f=this.parseObjectData(s,n,t,e):f=this.parsePrimitiveData(s,n,t,e);const u=()=>d[r]===null||c&&d[r]<c[r];for(h=0;h<e;++h)s._parsed[h+t]=d=f[h],l&&(u()&&(l=!1),c=d);s._sorted=l}a&&Bn(this,f)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,d=new Array(n);let f,u,p;for(f=0,u=n;f<u;++f)p=f+s,d[f]={[r]:h||o.parse(c[p],p),[l]:a.parse(e[p],p)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:a}=t,r=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],r[l]={x:o.parse(d[0],h),y:a.parse(d[1],h)};return r}parseObjectData(t,e,s,n){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,f,u;for(h=0,d=n;h<d;++h)f=h+s,u=e[f],c[h]={x:o.parse(le(u,r),f),y:a.parse(le(u,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:fa(n,!0),values:e._stacks[t.axis]._visualValues};return zn(r,a,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let a=o===null?NaN:o;const r=n&&s._stacks[e.axis];n&&r&&(n.values=r,a=zn(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,a=n.length,r=this._getOtherScale(t),l=Bc(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=Ic(r);let f,u;function p(){u=n[f];const g=u[r.axis];return!mt(u[t.axis])||h>g||d<g}for(f=0;f<a&&!(!p()&&(this.updateRangeFromParsed(c,t,u,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],mt(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Rc(E(this.options.clip,Pc(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||n.length-r,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const d=n[h];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=jc(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=zc(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&Je(s);if(r)return Fn(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),u=Object.keys(Z.elements[t]),p=()=>this.getContext(s,n,e),g=c.resolveNamedOptions(f,u,p,d);return g.$shared&&(g.$shared=l,o[a]=Object.freeze(Fn(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,s,e))}const c=new da(n,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ji(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,n){Ji(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Ji(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const n=s.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&Re(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}C(ae,"defaults",{}),C(ae,"datasetElementType",null),C(ae,"dataElementType",null);function Fc(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let s=[];for(let n=0,o=e.length;n<o;n++)s=s.concat(e[n].controller.getAllParsedValues(i));i._cache.$bar=qo(s.sort((n,o)=>n-o))}return i._cache.$bar}function Wc(i){const t=i.iScale,e=Fc(t,i.type);let s=t._length,n,o,a,r;const l=()=>{a===32767||a===-32768||(Je(r)&&(s=Math.min(s,Math.abs(a-r)||s)),r=a)};for(n=0,o=e.length;n<o;++n)a=t.getPixelForValue(e[n]),l();for(r=void 0,n=0,o=t.ticks.length;n<o;++n)a=t.getPixelForTick(n),l();return s}function Hc(i,t,e,s){const n=e.barThickness;let o,a;return W(n)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:t.pixels[i]-o/2}}function Vc(i,t,e,s){const n=t.pixels,o=n[i];let a=i>0?n[i-1]:null,r=i<n.length-1?n[i+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/s,ratio:e.barPercentage,start:c}}function Yc(i,t,e,s){const n=e.parse(i[0],s),o=e.parse(i[1],s),a=Math.min(n,o),r=Math.max(n,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:a,max:r}}function ua(i,t,e,s){return et(i)?Yc(i,t,e,s):t[e.axis]=e.parse(i,s),t}function Wn(i,t,e,s){const n=i.iScale,o=i.vScale,a=n.getLabels(),r=n===o,l=[];let c,h,d,f;for(c=e,h=e+s;c<h;++c)f=t[c],d={},d[n.axis]=r||n.parse(a[c],c),l.push(ua(f,d,o,c));return l}function Qi(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function $c(i,t,e){return i!==0?Ct(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Xc(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base<i.y,e="bottom",s="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:s,reverse:t,top:n,bottom:o}}function Uc(i,t,e,s){let n=t.borderSkipped;const o={};if(!n){i.borderSkipped=o;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:h}=Xc(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=h:(o[Hn(h,a,r,l)]=!0,n=c)),o[Hn(n,a,r,l)]=!0,i.borderSkipped=o}function Hn(i,t,e,s){return s?(i=Kc(i,t,e),i=Vn(i,e,t)):i=Vn(i,t,e),i}function Kc(i,t,e){return i===t?e:i===e?t:i}function Vn(i,t,e){return i==="start"?t:i==="end"?e:i}function Gc(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class vi extends ae{parsePrimitiveData(t,e,s,n){return Wn(t,e,s,n)}parseArrayData(t,e,s,n){return Wn(t,e,s,n)}parseObjectData(t,e,s,n){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,h=a.axis==="x"?r:l,d=[];let f,u,p,g;for(f=s,u=s+n;f<u;++f)g=e[f],p={},p[o.axis]=o.parse(le(g,c),f),d.push(ua(le(g,h),p,a,f));return d}updateRangeFromParsed(t,e,s,n){super.updateRangeFromParsed(t,e,s,n);const o=s._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:n}=e,o=this.getParsed(t),a=o._custom,r=Qi(a)?"["+a.start+", "+a.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,n){const o=n==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,n);for(let u=e;u<e+s;u++){const p=this.getParsed(u),g=o||W(p[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(u),m=this._calculateBarIndexPixels(u,h),b=(p._stacks||{})[r.axis],y={horizontal:c,base:g.base,enableBorderRadius:!b||Qi(p._custom)||a===b._top||a===b._bottom,x:c?g.head:m.center,y:c?m.center:g.head,height:c?m.size:Math.abs(g.size),width:c?Math.abs(g.size):m.size};f&&(y.options=d||this.resolveDataElementOptions(u,t[u].active?"active":n));const w=y.options||t[u].options;Uc(y,w,b,a),Gc(y,w,h.ratio),this.updateElement(t[u],u,y,n)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=s.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[s.axis],c=h=>{const d=h._parsed.find(u=>u[s.axis]===l),f=d&&d[h.vScale.axis];if(W(f)||isNaN(f))return!0};for(const h of n)if(!(e!==void 0&&c(h))&&((o===!1||a.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&a.push(h.stack),h.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(s=>t[s].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const s of this.chart.data.datasets)t[E(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,a;for(o=0,a=e.data.length;o<a;++o)n.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const r=t.barThickness;return{min:r||Wc(e),pixels:n,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:n},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=Qi(c);let d=l[e.axis],f=0,u=s?this.applyStack(e,l,s):d,p,g;u!==d&&(f=u-d,u=d),h&&(d=c.barStart,u=c.barEnd-c.barStart,d!==0&&Ct(d)!==Ct(c.barEnd)&&(f=0),f+=d);const m=!W(o)&&!h?o:f;let b=e.getPixelForValue(m);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+u):p=b,g=p-b,Math.abs(g)<a){g=$c(g,e,r)*a,d===r&&(b-=g/2);const y=e.getPixelForDecimal(0),w=e.getPixelForDecimal(1),k=Math.min(y,w),_=Math.max(y,w);b=Math.max(Math.min(b,_),k),p=b+g,s&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(p)-e.getValueForPixel(b))}if(b===e.getPixelForValue(r)){const y=Ct(g)*e.getLineWidthForValue(r)/2;b+=y,g-=y}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(t,e){const s=e.scale,n=this.options,o=n.skipNull,a=E(n.maxBarThickness,1/0);let r,l;const c=this._getAxisCount();if(e.grouped){const h=o?this._getStackCount(t):e.stackCount,d=n.barThickness==="flex"?Vc(t,e,n,h*c):Hc(t,e,n,h*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,u=this._getAxis().indexOf(E(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+u;r=d.start+d.chunk*p+d.chunk/2,l=Math.min(a,d.chunk*d.ratio)}else r=s.getPixelForValue(this.getParsed(t)[s.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,n=s.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&!s[o].hidden&&s[o].draw(this._ctx)}}C(vi,"id","bar"),C(vi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),C(vi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function qc(i,t,e){let s=1,n=1,o=0,a=0;if(t<q){const r=i,l=r+t,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),f=Math.sin(l),u=(w,k,_)=>ti(w,r,l,!0)?1:Math.max(k,k*e,_,_*e),p=(w,k,_)=>ti(w,r,l,!0)?-1:Math.min(k,k*e,_,_*e),g=u(0,c,d),m=u(Q,h,f),b=p(V,c,d),y=p(V+Q,h,f);s=(g-b)/2,n=(m-y)/2,o=-(g+b)/2,a=-(m+y)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}class je extends ae{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(j(s[t])){const{key:l="value"}=this._parsing;o=c=>+le(s[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)n._parsed[a]=o(a)}}_getRotation(){return Nt(this.options.rotation-90)}_getCircumference(){return Nt(this.options.circumference)}_getRotationExtents(){let t=q,e=-q;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const n=this.chart.getDatasetMeta(s).controller,o=n._getRotation(),a=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,n=this._cachedMeta,o=n.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(s.width,s.height)-a)/2,0),l=Math.min(el(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:u,offsetX:p,offsetY:g}=qc(d,h,l),m=(s.width-a)/f,b=(s.height-a)/u,y=Math.max(Math.min(m,b)/2,0),w=$o(this.options.radius,y),k=Math.max(w*l,0),_=(w-k)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=g*w,n.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const s=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/q)}updateElements(t,e,s,n){const o=n==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,h=(r.left+r.right)/2,d=(r.top+r.bottom)/2,f=o&&c.animateScale,u=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:g,includeOptions:m}=this._getSharedOptions(e,n);let b=this._getRotation(),y;for(y=0;y<e;++y)b+=this._circumference(y,o);for(y=e;y<e+s;++y){const w=this._circumference(y,o),k=t[y],_={x:h+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:p,innerRadius:u};m&&(_.options=g||this.resolveDataElementOptions(y,k.active?"active":n)),b+=w,this.updateElement(k,y,_,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,n;for(n=0;n<e.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?q*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=zs(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,a,r,l;if(!t){for(n=0,o=s.data.datasets.length;n<o;++n)if(s.isDatasetVisible(n)){a=s.getDatasetMeta(n),t=a.data,r=a.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)l=r.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,n=t.length;s<n;++s){const o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}C(je,"id","doughnut"),C(je,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),C(je,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),C(je,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:n,pointStyle:s,borderRadius:a&&(r||d.borderRadius),index:c}}):[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});class _i extends ae{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=_l(e,n,a);this._drawStart=r,this._drawCount=l,wl(e)&&(r=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:c},t),this.updateElements(n,r,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),f=a.axis,u=r.axis,{spanGaps:p,segment:g}=this.options,m=Qe(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none",y=e+s,w=t.length;let k=e>0&&this.getParsed(e-1);for(let _=0;_<w;++_){const x=t[_],M=b?x:{};if(_<e||_>=y){M.skip=!0;continue}const S=this.getParsed(_),D=W(S[u]),T=M[f]=a.getPixelForValue(S[f],_),O=M[u]=o||D?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,S,l):S[u],_);M.skip=isNaN(T)||isNaN(O)||D,M.stop=_>0&&Math.abs(S[f]-k[f])>m,g&&(M.parsed=S,M.raw=c.data[_]),d&&(M.options=h||this.resolveDataElementOptions(_,x.active?"active":n)),b||this.updateElement(x,_,M,n),k=S}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}C(_i,"id","line"),C(_i,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),C(_i,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ys extends je{}
vendor: 4,444 bytes, line 25
25C(ys,"id","pie"),C(ys,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function ee(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xs{constructor(t){C(this,"options");this.options=t||{}}static override(t){Object.assign(Xs.prototype,t)}init(){}formats(){return ee()}parse(){return ee()}format(){return ee()}add(){return ee()}diff(){return ee()}startOf(){return ee()}endOf(){return ee()}}var Zc={_date:Xs};function Jc(i,t,e,s){const{controller:n,data:o,_sorted:a}=i,r=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const c=r._reversePixels?ml:ne;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const f=c(o,t,e-d),u=c(o,t,e+d);return{lo:f.lo,hi:u.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:f}=i,u=f.slice(0,h.lo+1).reverse().findIndex(g=>!W(g[d.axis]));h.lo-=Math.max(0,u);const p=f.slice(h.hi).findIndex(g=>!W(g[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function ji(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:h}=o[r],{lo:d,hi:f}=Jc(o[r],t,a,n);for(let u=d;u<=f;++u){const p=h[u];p.skip||s(p,c,u)}}}function Qc(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,a=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function ts(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||ji(i,e,t,function(r,l,c){!n&&!ei(r,i.chartArea,0)||r.inRange(t.x,t.y,s)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function th(i,t,e,s){let n=[];function o(a,r,l){const{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],s),{angle:d}=Ko(a,{x:t.x,y:t.y});ti(d,c,h)&&n.push({element:a,datasetIndex:r,index:l})}return ji(i,e,t,o),n}function eh(i,t,e,s,n,o){let a=[];const r=Qc(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const u=h.inRange(t.x,t.y,n);if(s&&!u)return;const p=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(p))&&!u)return;const m=r(t,p);m<l?(a=[{element:h,datasetIndex:d,index:f}],l=m):m===l&&a.push({element:h,datasetIndex:d,index:f})}return ji(i,e,t,c),a}function es(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?th(i,t,e,n):eh(i,t,e,s,n,o)}function Yn(i,t,e,s,n){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return ji(i,e,t,(l,c,h)=>{l[a]&&l[a](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,n))}),s&&!r?[]:o}var ih={modes:{index(i,t,e,s){const n=ie(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?ts(i,n,o,s,a):es(i,n,o,!1,s,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?ts(i,n,o,s,a):es(i,n,o,!1,s,a);if(r.length>0){const l=r[0].datasetIndex,c=i.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point(i,t,e,s){const n=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return ts(i,n,o,s,a)},nearest(i,t,e,s){const n=ie(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return es(i,n,o,e.intersect,s,a)},x(i,t,e,s){const n=ie(t,i);return Yn(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=ie(t,i);return Yn(i,n,"y",e.intersect,s)}}};const ga=["left","top","right","bottom"];function Ee(i,t){return i.filter(e=>e.pos===t)}function $n(i,t){return i.filter(e=>ga.indexOf(e.pos)===-1&&e.box.axis===t)}function Le(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function sh(i){const t=[];let e,s,n,o,a,r;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return t}function nh(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!ga.includes(n))continue;const a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function oh(i,t){const e=nh(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];const{fullSize:l}=r.box,c=e[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*s:l&&t.availableWidth,r.height=n):(r.width=s,r.he
vendor: 4,096 bytes, line 25
25ight=h?h*n:l&&t.availableHeight)}return e}function ah(i){const t=sh(i),e=Le(t.filter(c=>c.box.fullSize),!0),s=Le(Ee(t,"left"),!0),n=Le(Ee(t,"right")),o=Le(Ee(t,"top"),!0),a=Le(Ee(t,"bottom")),r=$n(t,"x"),l=$n(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:Ee(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}function Xn(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function pa(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function rh(i,t,e,s){const{pos:n,box:o}=e,a=i.maxPadding;if(!j(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&pa(a,o.getPadding());const r=Math.max(0,t.outerWidth-Xn(a,i,"left","right")),l=Math.max(0,t.outerHeight-Xn(a,i,"top","bottom")),c=r!==i.w,h=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function lh(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function ch(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return s(i?["left","right"]:["top","bottom"])}function Be(i,t,e,s){const n=[];let o,a,r,l,c,h;for(o=0,a=i.length,c=0;o<a;++o){r=i[o],l=r.box,l.update(r.width||t.w,r.height||t.h,ch(r.horizontal,t));const{same:d,other:f}=rh(t,e,r,s);c|=d&&n.length,h=h||f,l.fullSize||n.push(r)}return c&&Be(n,t,e,s)||h}function gi(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function Un(i,t,e,s){const n=e.padding;let{x:o,y:a}=t;for(const r of i){const l=r.box,c=s[r.stack]||{placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){const d=t.w*h,f=c.size||l.height;Je(c.start)&&(a=c.start),l.fullSize?gi(l,n.left,a,e.outerWidth-n.right-n.left,f):gi(l,t.left+c.placed,a,d,f),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*h,f=c.size||l.width;Je(c.start)&&(o=c.start),l.fullSize?gi(l,o,n.top,f,e.outerHeight-n.bottom-n.top):gi(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var $t={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=_t(i.options.layout.padding),o=Math.max(t-n.width,0),a=Math.max(e-n.height,0),r=ah(i.boxes),l=r.vertical,c=r.horizontal;H(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),f=Object.assign({},n);pa(f,_t(s));const u=Object.assign({maxPadding:f,w:o,h:a,x:n.left,y:n.top},n),p=oh(l.concat(c),d);Be(r.fullSize,u,d,p),Be(l,u,d,p),Be(c,u,d,p)&&Be(l,u,d,p),lh(u),Un(r.leftAndTop,u,d,p),u.x+=u.w,u.y+=u.h,Un(r.rightAndBottom,u,d,p),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},H(r.chartArea,g=>{const m=g.box;Object.assign(m,i.chartArea),m.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class ma{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class hh extends ma{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const wi="$chartjs",dh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mou
25semove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Kn=i=>i===null||i==="";function fh(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[wi]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Kn(n)){const o=Pn(i,"width");o!==void 0&&(i.width=o)}if(Kn(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Pn(i,"height");o!==void 0&&(i.height=o)}return i}const ba=dc?{passive:!0}:!1;function uh(i,t,e){i&&i.addEventListener(t,e,ba)}function gh(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,ba)}function ph(i,t){const e=dh[i.type]||i.type,{x:s,y:n}=ie(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Ei(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function mh(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Ei(r.addedNodes,s),a=a&&!Ei(r.removedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function bh(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Ei(r.removedNodes,s),a=a&&!Ei(r.addedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const ii=new Map;let Gn=0;function xa(){const i=window.devicePixelRatio;i!==Gn&&(Gn=i,ii.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function xh(i,t){ii.size||window.addEventListener("resize",xa),ii.set(i,t)}function yh(i){ii.delete(i),ii.size||window.removeEventListener("resize",xa)}function vh(i,t,e){const s=i.canvas,n=s&&$s(s);if(!n)return;const o=Jo((r,l)=>{const c=n.clientWidth;e(r,l),c<n.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(n),xh(i,o),a}function is(i,t,e){e&&e.disconnect(),t==="resize"&&yh(i)}function _h(i,t,e){const s=i.canvas,n=Jo(o=>{i.ctx!==null&&e(ph(o,i))},i);return uh(s,t,n),n}class wh extends ma{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(fh(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[wi])return!1;const s=e[wi].initial;["height","width"].forEach(o=>{const a=s[o];W(a)?e.removeAttribute(o):e.setAttribute(o,a)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[wi],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:mh,detach:bh,resize:vh}[e]||_h;n[e]=a(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:is,detach:is,resize:is}[e]||gh)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return hc(t,e,s,n)}isAttached(t){const e=t&&$s(t);return!!(e&&e.isConnected)}}function Mh(i){return!Ys()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?hh:wh}class Tt{constructor(){C(this,"x");C(this,"y");C(this,"active",!1);C(this,"options");C(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return Qe(this.x)&&Qe(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}C(Tt,"defaults",{}),C(Tt,"defaultRoutes");function kh(i,t){const e=i.options.ticks,s=Sh(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Ch(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>n)return Oh(t,c,o,a/n),c;const h=Dh(o,t,n);if(a>0){let d,f;const u=a>1?Math.round((l-r)/(a-1)):null;for(pi(t,c,h,W(u)?0:r-u,r),d=0,f=a-1;d<f;d++)pi(t,c,h,o[d],o[d+1]);return pi(t,c,h,l,W(u)?t.length:l+u),c}return pi(t,c,h),c}function Sh(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Dh(i,t,e){const s=Th(i),n=t.length/e;if(!s)return Math.max(n,1);const o=cl(s);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>n)return l}return Math.max(n,1)}function Ch(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Oh(i,t,e,s){let n=0,o=e[0],a;for(s=Math.ceil(s),a=0;a<i.length;a++)a===o&&(t.push(i[a]),n++,o=e[n*s])}function pi(i,t,e,s,n){const o=E(s,0),a=Math.min(E(n,i.length),i.length);let r=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===h&&(t.push(i[c]),r++,h=Math.round(o+r*e))}function Th(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const Ah=i=>
vendor: 41,436 bytes, line 25
25i==="left"?"right":i==="right"?"left":i,qn=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Zn=(i,t)=>Math.min(t||i,i);function Jn(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function Ph(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,a=i._endPixel,r=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,a-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-r||l>a+r)))return l}function Rh(i,t){H(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Ie(i){return i.drawTicks?i.tickLength:0}function Qn(i,t){if(!i.display)return 0;const e=ct(i.font,t),s=_t(i.padding);return(et(i.text)?i.text.length:1)*e.lineHeight+s.height}function Eh(i,t){return he(i,{scale:t,type:"scale"})}function Lh(i,t,e){return he(i,{tick:e,index:t,type:"tick"})}function Ih(i,t,e){let s=Qo(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Ah(s)),s}function Nh(i,t,e,s){const{top:n,left:o,bottom:a,right:r,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,u,p;const g=a-n,m=r-o;if(i.isHorizontal()){if(u=ht(s,o,r),j(e)){const b=Object.keys(e)[0],y=e[b];p=h[b].getPixelForValue(y)+g-t}else e==="center"?p=(c.bottom+c.top)/2+g-t:p=qn(i,e,t);f=r-o}else{if(j(e)){const b=Object.keys(e)[0],y=e[b];u=h[b].getPixelForValue(y)-m+t}else e==="center"?u=(c.left+c.right)/2-m+t:u=qn(i,e,t);p=ht(s,a,n),d=e==="left"?-Q:Q}return{titleX:u,titleY:p,maxWidth:f,rotation:d}}class Se extends Tt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.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(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=Mt(t,Number.POSITIVE_INFINITY),e=Mt(e,Number.NEGATIVE_INFINITY),s=Mt(s,Number.POSITIVE_INFINITY),n=Mt(n,Number.NEGATIVE_INFINITY),{min:Mt(t,s),max:Mt(e,n),minDefined:mt(t),maxDefined:mt(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),a;if(n&&o)return{min:e,max:s};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),n||(e=Math.min(e,a.min)),o||(s=Math.max(s,a.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:Mt(e,Mt(s,e)),max:Mt(s,Mt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Hl(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?Jn(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=kh(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){$(this.options.afterUpdate,[this])}beforeSetDimensions(){$(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(){$(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),$(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){$(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=$(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){$(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){$(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Zn(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let a=n,r,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=nt(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/s:u/(s-1),d+6>r&&(r=u/(s-(t.offset?.5:1)),l=this.maxHeight-Ie(t.grid)-e.padding-Qn(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),a=ul(Math.min(Math.asin(nt((h.highest.height+6)/r,-1,1)),Math.asin(nt(l/c,-1,1))-Math.asin(nt(f/c,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){$(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Qn(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ie(o)+l):(t.height=this.maxHeight,t.width=Ie(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,p=Nt(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(r){const b=s.mirror?0:m*d.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+b+u)}else{const b=s.mirror?0:g*d.width+m*f.height;t.width=Math.min(this.maxWidth,t.width+b+u)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,u=0;l?c?(f=n*t.width,u=s*e.height):(f=s*t.height,u=n*e.width):o==="start"?u=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,u=e.width/2),this.paddingLeft=Math.max((f-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+a)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+a,this.paddingBottom=d+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(){$(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)W(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Jn(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Zn(e,s));let c=0,h=0,d,f,u,p,g,m,b,y,w,k,_;for(d=0;d<e;d+=l){if(p=t[d].label,g=this._resolveTickFontOptions(d),n.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},y=g.lineHeight,w=k=0,!W(p)&&!et(p))w=Dn(n,b.data,b.gc,w,p),k=y;else if(et(p))for(f=0,u=p.length;f<u;++f)_=p[f],!W(_)&&!et(_)&&(w=Dn(n,b.data,b.gc,w,_),k+=y);a.push(w),r.push(k),c=Math.max(w,c),h=Math.max(k,h)}Rh(o,e);const x=a.indexOf(c),M=r.indexOf(h),S=D=>({width:a[D]||0,height:r[D]||0});return{first:S(0),last:S(e-1),widest:S(x),highest:S(M),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return pl(this._alignToPixels?te(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Lh(this.getContext(),t,s))}return this.$context||(this.$context=Eh(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Nt(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*s>r*n?r/s:l/n:l*n<r*s?l/s:r/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:a,border:r}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ie(o),u=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(N){return te(s,N,g)};let y,w,k,_,x,M,S,D,T,O,R,F;if(a==="top")y=b(this.bottom),M=this.bottom-f,D=y-m,O=b(t.top)+m,F=t.bottom;else if(a==="bottom")y=b(this.top),O=t.top,F=b(t.bottom)-m,M=y+m,D=this.top+f;else if(a==="left")y=b(this.right),x=this.right-f,S=y-m,T=b(t.left)+m,R=t.right;else if(a==="right")y=b(this.left),T=t.left,R=b(t.right)-m,x=y+m,S=this.left+f;else if(e==="x"){if(a==="center")y=b((t.top+t.bottom)/2+.5);else if(j(a)){const N=Object.keys(a)[0],B=a[N];y=b(this.chart.scales[N].getPixelForValue(B))}O=t.top,F=t.bottom,M=y+m,D=M+f}else if(e==="y"){if(a==="center")y=b((t.left+t.right)/2);else if(j(a)){const N=Object.keys(a)[0],B=a[N];y=b(this.chart.scales[N].getPixelForValue(B))}x=y-m,S=x-f,T=t.left,R=t.right}const Y=E(n.ticks.maxTicksLimit,d),P=Math.max(1,Math.ceil(d/Y));for(w=0;w<d;w+=P){const N=this.getContext(w),B=o.setContext(N),it=r.setContext(N),G=B.lineWidth,dt=B.color,bt=it.dash||[],ft=it.dashOffset,xt=B.tickWidth,X=B.tickColor,ut=B.tickBorderDash||[],st=B.tickBorderDashOffset;k=Ph(this,w,l),k!==void 0&&(_=te(s,k,G),c?x=S=T=R=_:M=D=O=F=_,u.push({tx1:x,ty1:M,tx2:S,ty2:D,x1:T,y1:O,x2:R,y2:F,width:G,color:dt,borderDash:bt,borderDashOffset:ft,tickWidth:xt,tickColor:X,tickBorderDash:ut,tickBorderDashOffset:st}))}return this._ticksLength=d,this._borderValue=y,u}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=Ie(s.grid),u=f+h,p=d?-h:u,g=-Nt(this.labelRotation),m=[];let b,y,w,k,_,x,M,S,D,T,O,R,F="middle";if(n==="top")x=this.bottom-p,M=this._getXAxisLabelAlignment();else if(n==="bottom")x=this.top+p,M=this._getXAxisLabelAlignment();else if(n==="left"){const P=this._getYAxisLabelAlignment(f);M=P.textAlign,_=P.x}else if(n==="right"){const P=this._getYAxisLabelAlignment(f);M=P.textAlign,_=P.x}else if(e==="x"){if(n==="center")x=(t.top+t.bottom)/2+u;else if(j(n)){const P=Object.keys(n)[0],N=n[P];x=this.chart.scales[P].getPixelForValue(N)+u}M=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")_=(t.left+t.right)/2-u;else if(j(n)){const P=Object.keys(n)[0],N=n[P];_=this.chart.scales[P].getPixelForValue(N)}M=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const Y=this._getLabelSizes();for(b=0,y=r.length;b<y;++b){w=r[b],k=w.label;const P=o.setContext(this.getContext(b));S=this.getPixelForTick(b)+o.labelOffset,D=this._resolveTickFontOptions(b),T=D.lineHeight,O=et(k)?k.length:1;const N=O/2,B=P.color,it=P.textStrokeColor,G=P.textStrokeWidth;let dt=M;a?(_=S,M==="inner"&&(b===y-1?dt=this.options.reverse?"left":"right":b===0?dt=this.options.reverse?"right":"left":dt="center"),n==="top"?c==="near"||g!==0?R=-O*T+T/2:c==="center"?R=-Y.highest.height/2-N*T+T:R=-Y.highest.height+T/2:c==="near"||g!==0?R=T/2:c==="center"?R=Y.highest.height/2-N*T:R=Y.highest.height-O*T,d&&(R*=-1),g!==0&&!P.showLabelBackdrop&&(_+=T/2*Math.sin(g))):(x=S,R=(1-O)*T/2);let bt;if(P.showLabelBackdrop){const ft=_t(P.backdropPadding),xt=Y.heights[b],X=Y.widths[b];let ut=R-ft.top,st=0-ft.left;switch(F){case"middle":ut-=xt/2;break;case"bottom":ut-=xt;break}switch(M){case"center":st-=X/2;break;case"right":st-=X;break;case"inner":b===y-1?st-=X:b>0&&(st-=X/2);break}bt={left:st,top:ut,width:X+ft.width,height:xt+ft.height,color:P.backdropColor}}m.push({label:k,font:D,textOffset:R,options:{rotation:g,color:B,strokeColor:it,strokeWidth:G,textAlign:dt,textBaseline:F,translation:[_,x],backdrop:bt}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Nt(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=n.length;o<a;++o){const l=n[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;const r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,f;this.isHorizontal()?(c=te(t,this.left,a)-a/2,h=te(t,this.right,r)+r/2,d=f=l):(d=te(t,this.top,a)-a/2,f=te(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&js(s,n);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,h=a.textOffset;Ai(s,c,0,h,l,r)}n&&Bs(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=ct(s.font),a=_t(s.padding),r=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||j(e)?(l+=a.bottom,et(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=Nh(this,l,e,r);Ai(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:f,textAlign:Ih(r,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=E(t.grid&&t.grid.z,-1),n=E(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Se.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[s]===this.id&&(!t||r.type===t)&&n.push(r)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return ct(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class mi{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;Bh(e)&&(s=this.register(e));const n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,zh(t,a,s),this.override&&Z.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in Z[n]&&(delete Z[n][s],this.override&&delete ce[s])}}function zh(i,t,e){const s=Ze(Object.create(null),[e?Z.get(e):{},Z.get(t),i.defaults]);Z.set(t,s),i.defaultRoutes&&jh(t,i.defaultRoutes),i.descriptors&&Z.describe(t,i.descriptors)}function jh(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");Z.route(o,n,l,r)})}function Bh(i){return"id"in i&&"defaults"in i}class Fh{constructor(){this.controllers=new mi(ae,"datasets",!0),this.elements=new mi(Tt,"elements"),this.plugins=new mi(Object,"plugins"),this.scales=new mi(Se,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):H(n,a=>{const r=s||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,s){const n=Ls(t);$(s["before"+n],[],s),e[t](s),$(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var St=new Fh;class Wh{constructor(){this._init=void 0}notify(t,e,s,n){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=n?this._descriptors(t).filter(n):this._descriptors(t),a=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,s,n){n=n||{};for(const o of t){const a=o.plugin,r=a[s],l=[e,n,o.options];if($(r,l,a)===!1&&n.cancelable)return!1}return!0}invalidate(){W(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=E(s.options&&s.options.plugins,{}),o=Hh(s);return n===!1&&!e?[]:Yh(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Hh(i){const t={},e=[],s=Object.keys(St.plugins.items);for(let o=0;o<s.length;o++)e.push(St.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const a=n[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Vh(i,t){return!t&&i===!1?null:i===!0?{}:i}function Yh(i,{plugins:t,localIds:e},s,n){const o=[],a=i.getContext();for(const r of t){const l=r.id,c=Vh(s[l],n);c!==null&&o.push({plugin:r,options:$h(i.config,{plugin:r,local:e[l]},c,a)})}return o}function $h(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(s,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function vs(i,t){const e=Z.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Xh(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Uh(i,t){return i===t?"_index_":"_value_"}function to(i){if(i==="x"||i==="y"||i==="r")return i}function Kh(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function _s(i,...t){if(to(i))return i;for(const e of t){const s=e.axis||Kh(e.position)||i.length>1&&to(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function eo(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Gh(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return eo(i,"x",e[0])||eo(i,"y",e[0])}return{}}function qh(i,t){const e=ce[i.type]||{scales:{}},s=t.scales||{},n=vs(i.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{const r=s[a];if(!j(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=_s(a,r,Gh(a,i),Z.scales[r.type]),c=Uh(l,n),h=e.scales||{};o[a]=Ye(Object.create(null),[{axis:l},r,h[l],h[c]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||vs(r,t),h=(ce[r]||{}).scales||{};Object.keys(h).forEach(d=>{const f=Xh(d,l),u=a[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Ye(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(a=>{const r=o[a];Ye(r,[Z.scales[r.type],Z.scale])}),o}function ya(i){const t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=qh(i,t)}function va(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Zh(i){return i=i||{},i.data=va(i.data),ya(i),i}const io=new Map,_a=new Set;function bi(i,t){let e=io.get(i);return e||(e=t(),io.set(i,e),_a.add(e)),e}const Ne=(i,t,e)=>{const s=le(t,e);s!==void 0&&i.add(s)};class Jh{constructor(t){this._config=Zh(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=va(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ya(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return bi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return bi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return bi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return bi(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,a=this._cachedScopes(t,s),r=a.get(e);if(r)return r;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Ne(l,t,d))),h.forEach(d=>Ne(l,n,d)),h.forEach(d=>Ne(l,ce[o]||{},d)),h.forEach(d=>Ne(l,Z,d)),h.forEach(d=>Ne(l,bs,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),_a.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,ce[e]||{},Z.datasets[e]||{},{type:e},Z,bs]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=so(this._resolverCache,t,n);let l=a;if(td(a,e)){o.$shared=!1,s=Kt(s)?s():s;const c=this.createResolver(t,s,r);l=Me(a,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=so(this._resolverCache,t,s);return j(e)?Me(o,e,void 0,n):o}}function so(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Ws(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},s.set(n,o)),o}const Qh=i=>j(i)&&Object.getOwnPropertyNames(i).some(t=>Kt(i[t]));function td(i,t){const{isScriptable:e,isIndexable:s}=sa(i);for(const n of t){const o=e(n),a=s(n),r=(a||o)&&i[n];if(o&&(Kt(r)||Qh(r))||a&&et(r))return!0}return!1}var ed="4.5.1";const id=["top","bottom","left","right","chartArea"];function no(i,t){return i==="top"||i==="bottom"||id.indexOf(i)===-1&&t==="x"}function oo(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function ao(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),$(e&&e.onComplete,[i],t)}function sd(i){const t=i.chart,e=t.options.animation;$(e&&e.onProgress,[i],t)}function wa(i){return Ys()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Mi={},ro=i=>{const t=wa(i);return Object.values(Mi).filter(e=>e.canvas===t).pop()};function nd(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const a=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=a)}}}function od(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}class It{static register(...t){St.add(...t),lo()}static unregister(...t){St.remove(...t),lo()}constructor(t,e){const s=this.config=new Jh(e),n=wa(t),o=ro(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Mh(n)),this.platform.updateConfig(s);const r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=tl(),this.ctx=r,this.canvas=l,this.width=h,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 Wh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=yl(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],Mi[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Rt.listen(this,"complete",ao),Rt.listen(this,"progress",sd),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return W(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return St}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():An(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Cn(this.canvas,this.ctx),this}stop(){return Rt.stop(this),this}resize(t,e){Rt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,An(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),$(s.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};H(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=_s(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),H(o,a=>{const r=a.options,l=r.id,c=_s(l,r),h=E(r.type,a.dtype);(r.position===void 0||no(r.position,c)!==no(a.dposition))&&(r.position=a.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const f=St.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(r,t)}),H(n,(a,r)=>{a||delete s[r]}),H(s,a=>{$t.configure(this,a,a.options),$t.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(oo("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let a=this.getDatasetMeta(s);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=r,a.indexAxis=o.indexAxis||vs(r,this.options),a.order=o.order||0,a.index=s,a.label=""+o.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{const l=St.getController(r),{datasetElementType:c,dataElementType:h}=Z.datasets[r];Object.assign(l,{dataElementType:St.getElement(h),datasetElementType:c&&St.getElement(c)}),a.controller=new l(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){H(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),f=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),n||H(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(oo("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){H(this.scales,t=>{$t.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!bn(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const a=s==="_removeElements"?-o:o;nd(t,n,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!bn(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;$t.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],H(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,Kt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Rt.has(this)?this.attached&&!Rt.running(this)&&Rt.start(this):(this.draw(),ao({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const a=e[n];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s={meta:t,index:t.index,cancelable:!0},n=Sc(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&js(e,n),t.controller.draw(),n&&Bs(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ei(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=ih.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=he(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);Je(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(r=>r.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Rt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Cn(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Mi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},n=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};H(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{n("attach",r),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){H(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},H(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[n+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!Ci(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),a=o(e,t),r=s?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,s,a),l=al(t),c=od(t,this._lastEvent,s,l);s&&(this._lastEvent=null,$(o.onHover,[t,r,this],this),l&&$(o.onClick,[t,r,this],this));const h=!Ci(r,n);
vendor: 4,903 bytes, line 25
25return(h||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}C(It,"defaults",Z),C(It,"instances",Mi),C(It,"overrides",ce),C(It,"registry",St),C(It,"version",ed),C(It,"getChart",ro);function lo(){return H(It.instances,i=>i._plugins.invalidate())}function ad(i,t,e){const{startAngle:s,x:n,y:o,outerRadius:a,innerRadius:r,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/a,vt(s-e));if(i.beginPath(),i.arc(n,o,a-c/2,s+d/2,e-d/2),r>0){const f=Math.min(c/r,vt(s-e));i.arc(n,o,r+c/2,e-f/2,s+f/2,!0)}else{const f=Math.min(c/2,a*vt(s-e));if(h==="round")i.arc(n,o,f,e-V/2,s+V/2,!0);else if(h==="bevel"){const u=2*f*f,p=-u*Math.cos(e+V/2)+n,g=-u*Math.sin(e+V/2)+o,m=u*Math.cos(s+V/2)+n,b=u*Math.sin(s+V/2)+o;i.lineTo(p,g),i.lineTo(m,b)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function rd(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=n/r;i.beginPath(),i.arc(o,a,r,s-c,e+c),l>n?(c=n/l,i.arc(o,a,l,e+c,s-c,!0)):i.arc(o,a,n,e+Q,s-Q),i.closePath(),i.clip()}function ld(i){return Fs(i,["outerStart","outerEnd","innerStart","innerEnd"])}function cd(i,t,e,s){const n=ld(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,s*t/2),r=l=>{const c=(e-Math.min(o,l))*s/2;return nt(l,0,Math.min(o,c))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:nt(n.innerStart,0,a),innerEnd:nt(n.innerEnd,0,a)}}function me(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function Li(i,t,e,s,n,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),f=h>0?h+s+e+c:0;let u=0;const p=n-l;if(s){const P=h>0?h-s:0,N=d>0?d-s:0,B=(P+N)/2,it=B!==0?p*B/(B+s):p;u=(p-it)/2}const g=Math.max(.001,p*d-e/V)/d,m=(p-g)/2,b=l+m+u,y=n-m-u,{outerStart:w,outerEnd:k,innerStart:_,innerEnd:x}=cd(t,f,d,y-b),M=d-w,S=d-k,D=b+w/M,T=y-k/S,O=f+_,R=f+x,F=b+_/O,Y=y-x/R;if(i.beginPath(),o){const P=(D+T)/2;if(i.arc(a,r,d,D,P),i.arc(a,r,d,P,T),k>0){const G=me(S,T,a,r);i.arc(G.x,G.y,k,T,y+Q)}const N=me(R,y,a,r);if(i.lineTo(N.x,N.y),x>0){const G=me(R,Y,a,r);i.arc(G.x,G.y,x,y+Q,Y+Math.PI)}const B=(y-x/f+(b+_/f))/2;if(i.arc(a,r,f,y-x/f,B,!0),i.arc(a,r,f,B,b+_/f,!0),_>0){const G=me(O,F,a,r);i.arc(G.x,G.y,_,F+Math.PI,b-Q)}const it=me(M,b,a,r);if(i.lineTo(it.x,it.y),w>0){const G=me(M,D,a,r);i.arc(G.x,G.y,w,b-Q,D)}}else{i.moveTo(a,r);const P=Math.cos(D)*d+a,N=Math.sin(D)*d+r;i.lineTo(P,N);const B=Math.cos(T)*d+a,it=Math.sin(T)*d+r;i.lineTo(B,it)}i.closePath()}function hd(i,t,e,s,n){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Li(i,t,e,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(r)||(l=a+(r%q||q))}return Li(i,t,e,s,l,n),i.fill(),l}function dd(i,t,e,s,n){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:f,borderRadius:u}=l,p=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=f,p?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let g=t.endAngle;if(o){Li(i,t,e,s,g,n);for(let m=0;m<o;++m)i.stroke();isNaN(r)||(g=a+(r%q||q))}p&&rd(i,t,g),l.selfJoin&&g-a>=V&&u===0&&h!=="miter"&&ad(i,t,g),o||(Li(i,t,e,s,g,n),i.stroke())}class Fe extends Tt{constructor(e){super();C(this,"circumference");C(this,"endAngle");C(this,"fullCircles");C(this,"innerRadius");C(this,"outerRadius");C(this,"pixelMargin");C(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.getProps(["x","y"],n),{angle:a,distance:r}=Ko(o,{x:e,y:s}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),u=(this.options.spacing+this.options.borderWidth)/2,p=E(f,c-l),g=ti(a,l,c)&&l!==c,m=p>=q||g,b=Vt(r,h+u,d+u);return m&&b}getCenterPoint(e){const{x:s,y:n,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,d=(o+a)/2,f=(r+l+h+c)/2;return{x:s+Math.cos(d)*f,y:n+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:s,circumference:n}=this,o=(s.offset||0)/4,a=(s.spacing||0)/2,r=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=n>q?Math.floor(n/q):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(V,n||0)),h=o*c;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,hd(e,this,h,a,r),dd(e,this,h,a,r),e.restore(
vendor: 39,709 bytes, lines 25-27
25)}}C(Fe,"id","arc"),C(Fe,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),C(Fe,"defaultRoutes",{backgroundColor:"backgroundColor"}),C(Fe,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Ma(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function fd(i,t,e){i.lineTo(e.x,e.y)}function ud(i){return i.stepped?El:i.tension||i.cubicInterpolationMode==="monotone"?Ll:fd}function ka(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:a,end:r}=t,l=Math.max(n,a),c=Math.min(o,r),h=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function gd(i,t,e,s){const{points:n,options:o}=t,{count:a,start:r,loop:l,ilen:c}=ka(n,e,s),h=ud(o);let{move:d=!0,reverse:f}=s||{},u,p,g;for(u=0;u<=c;++u)p=n[(r+(f?c-u:u))%a],!p.skip&&(d?(i.moveTo(p.x,p.y),d=!1):h(i,g,p,f,o.stepped),g=p);return l&&(p=n[(r+(f?c:0))%a],h(i,g,p,f,o.stepped)),!!l}function pd(i,t,e,s){const n=t.points,{count:o,start:a,ilen:r}=ka(n,e,s),{move:l=!0,reverse:c}=s||{};let h=0,d=0,f,u,p,g,m,b;const y=k=>(a+(c?r-k:k))%o,w=()=>{g!==m&&(i.lineTo(h,m),i.lineTo(h,g),i.lineTo(h,b))};for(l&&(u=n[y(0)],i.moveTo(u.x,u.y)),f=0;f<=r;++f){if(u=n[y(f)],u.skip)continue;const k=u.x,_=u.y,x=k|0;x===p?(_<g?g=_:_>m&&(m=_),h=(d*h+k)/++d):(w(),i.lineTo(k,_),p=x,d=0,g=m=_),b=_}w()}function ws(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?pd:gd}function md(i){return i.stepped?fc:i.tension||i.cubicInterpolationMode==="monotone"?uc:se}function bd(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Ma(i,t.options),i.stroke(n)}function xd(i,t,e,s){const{segments:n,options:o}=t,a=ws(t);for(const r of n)Ma(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const yd=typeof Path2D=="function";function vd(i,t,e,s){yd&&!t.options.segment?bd(i,t,e,s):xd(i,t,e,s)}class We extends Tt{constructor(t){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,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;nc(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_c(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,a=xc(this,{property:e,start:n,end:n});if(!a.length)return;const r=[],l=md(s);let c,h;for(c=0,h=a.length;c<h;++c){const{start:d,end:f}=a[c],u=o[d],p=o[f];if(u===p){r.push(u);continue}const g=Math.abs((n-u[e])/(p[e]-u[e])),m=l(u,p,g,s.stepped);m[e]=t[e],r.push(m)}return r.length===1?r[0]:r}pathSegment(t,e,s){return ws(this)(t,this,e,s)}path(t,e,s){const n=this.segments,o=ws(this);let a=this._loop;e=e||0,s=s||this.points.length-e;for(const r of n)a&=o(t,this,r,{start:e,end:e+s-1});return!!a}draw(t,e,s,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),vd(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}C(We,"id","line"),C(We,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),C(We,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),C(We,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function co(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class ki extends Tt{constructor(e){super();C(this,"parsed");C(this,"skip");C(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],n);return Math.pow(e-a,2)+Math.pow(s-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,s){return co(this,e,"x",s)}inYRange(e,s){return co(this,e,"y",s)}getCenterPoint(e){const{x:s,y:n}=this.getProps(["x","y"],e);return{x:s,y:n}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const n=s&&e.borderWidth||0;return(s+n)*2}draw(e,s){const n=this.options;this.skip||n.radius<.1||!ei(this,s,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,xs(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}C(ki,"id","point"),C(ki,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),C(ki,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Sa(i,t){const{x:e,y:s,base:n,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,l,c,h,d;return i.horizontal?(d=a/2,r=Math.min(e,n),l=Math.max(e,n),c=s-d,h=s+d):(d=o/2,r=e-d,l=e+d,c=Math.min(s,n),h=Math.max(s,n)),{left:r,top:c,right:l,bottom:h}}function Xt(i,t,e,s){return i?0:nt(t,e,s)}function _d(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,o=ia(s);return{t:Xt(n.top,o.top,0,e),r:Xt(n.right,o.right,0,t),b:Xt(n.bottom,o.bottom,0,e),l:Xt(n.left,o.left,0,t)}}function wd(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=_e(n),a=Math.min(t,e),r=i.borderSkipped,l=s||j(n);return{topLeft:Xt(!l||r.top||r.left,o.topLeft,0,a),topRight:Xt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Xt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Xt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Md(i){const t=Sa(i),e=t.right-t.left,s=t.bottom-t.top,n=_d(i,e/2,s/2),o=wd(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function ss(i,t,e,s){const n=t===null,o=e===null,r=i&&!(n&&o)&&Sa(i,s);return r&&(n||Vt(t,r.left,r.right))&&(o||Vt(e,r.top,r.bottom))}function kd(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Sd(i,t){i.rect(t.x,t.y,t.w,t.h)}function ns(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,a=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+a,radius:i.radius}}class Si extends Tt{constructor(t){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,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:a}=Md(this),r=kd(a.radius)?Pi:Sd;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,ns(a,e,o)),t.clip(),r(t,ns(o,-e,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),r(t,ns(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return ss(this,t,e,s)}inXRange(t,e){return ss(this,t,null,e)}inYRange(t,e){return ss(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}C(Si,"id","bar"),C(Si,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),C(Si,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const ho=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},Dd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class fo extends Tt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=$(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=ct(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=ho(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,n,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+r;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((p,g)=>{const m=s+e/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*r>a)&&(d+=h,c[c.length-(g>0?0:1)]=0,u+=h,f++),l[g]={left:0,top:u,row:f,width:m,height:n},c[c.length-1]+=m+r}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t;let d=r,f=0,u=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:y,itemHeight:w}=Cd(s,e,o,m,n);b>0&&u+w+2*r>h&&(d+=f+r,c.push({width:f,height:u}),p+=f+r,g++,f=u=0),l[b]={left:p,top:u,col:g,width:y,height:w},f=Math.max(f,y),u+=w+r}),d+=f,c.push({width:f,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,a=we(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=ht(s,this.left+n,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=ht(s,this.left+n,this.right-this.lineWidths[r])),c.top+=this.top+t+n,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+n}else{let r=0,l=ht(s,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=ht(s,this.top+t+n,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+n,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;js(t,this),this._draw(),Bs(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:a}=t,r=Z.color,l=we(t.rtl,this.left,this.width),c=ct(a.font),{padding:h}=a,d=c.size,f=d/2;let u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=ho(a,d),b=function(x,M,S){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const D=E(S.lineWidth,1);if(n.fillStyle=E(S.fillStyle,r),n.lineCap=E(S.lineCap,"butt"),n.lineDashOffset=E(S.lineDashOffset,0),n.lineJoin=E(S.lineJoin,"miter"),n.lineWidth=D,n.strokeStyle=E(S.strokeStyle,r),n.setLineDash(E(S.lineDash,[])),a.usePointStyle){const T={radius:g*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:D},O=l.xPlus(x,p/2),R=M+f;ea(n,T,O,R,a.pointStyleWidth&&p)}else{const T=M+Math.max((d-g)/2,0),O=l.leftForLtr(x,p),R=_e(S.borderRadius);n.beginPath(),Object.values(R).some(F=>F!==0)?Pi(n,{x:O,y:T,w:p,h:g,radius:R}):n.rect(O,T,p,g),n.fill(),D!==0&&n.stroke()}n.restore()},y=function(x,M,S){Ai(n,S.text,x,M+m/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},w=this.isHorizontal(),k=this._computeTitleHeight();w?u={x:ht(o,this.left+h,this.right-s[0]),y:this.top+h+k,line:0}:u={x:this.left+h,y:ht(o,this.top+k+h,this.bottom-e[0].height),line:0},la(this.ctx,t.textDirection);const _=m+h;this.legendItems.forEach((x,M)=>{n.strokeStyle=x.fontColor,n.fillStyle=x.fontColor;const S=n.measureText(x.text).width,D=l.textAlign(x.textAlign||(x.textAlign=a.textAlign)),T=p+f+S;let O=u.x,R=u.y;l.setWidth(this.width),w?M>0&&O+T+h>this.right&&(R=u.y+=_,u.line++,O=u.x=ht(o,this.left+h,this.right-s[u.line])):M>0&&R+_>this.bottom&&(O=u.x=O+e[u.line].width+h,u.line++,R=u.y=ht(o,this.top+k+h,this.bottom-e[u.line].height));const F=l.x(O);if(b(F,R,x),O=vl(D,O+p+f,w?O+T:this.right,t.rtl),y(l.x(O),R,x),w)u.x+=T+h;else if(typeof x.text!="string"){const Y=c.lineHeight;u.y+=Da(x,Y)+h}else u.y+=_}),ca(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=ct(e.font),n=_t(e.padding);if(!e.display)return;const o=we(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=ht(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+ht(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const u=ht(r,d,d+f);a.textAlign=o.textAlign(Qo(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,Ai(a,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title,e=ct(t.font),s=_t(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Vt(t,this.left,this.right)&&Vt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Vt(t,n.left,n.left+n.width)&&Vt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!Ad(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=Dd(n,s);n&&!o&&$(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&$(e.onHover,[t,s,this],this)}else s&&$(e.onClick,[t,s,this],this)}}function Cd(i,t,e,s,n){const o=Od(s,i,t,e),a=Td(n,s,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Od(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+s.measureText(n).width}function Td(i,t,e){let s=i;return typeof t.text!="string"&&(s=Da(t,e)),s}function Da(i,t){const e=i.text?i.text.length:0;return t*e}function Ad(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Pd={id:"legend",_element:fo,start(i,t,e){const s=i.legend=new fo({ctx:i.ctx,options:e,chart:i});$t.configure(i,s,e),$t.addBox(i,s)},stop(i){$t.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;$t.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=_t(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};const He={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){const r=i[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((r,l)=>r+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=ms(t,c);h<n&&(n=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function kt(i,t){return t&&(et(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function Et(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(` 26`)>-1?i.split(` 27`):i}function Rd(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:i,label:a,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function uo(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=ct(t.bodyFont),c=ct(t.titleFont),h=ct(t.footerFont),d=o.length,f=n.length,u=s.length,p=_t(t.padding);let g=p.height,m=0,b=s.reduce((k,_)=>k+_.before.length+_.lines.length+_.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const k=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=u*k+(b-u)*l.lineHeight+(b-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let y=0;const w=function(k){m=Math.max(m,e.measureText(k).width+y)};return e.save(),e.font=c.string,H(i.title,w),e.font=l.string,H(i.beforeBody.concat(i.afterBody),w),y=t.displayColors?a+2+t.boxPadding:0,H(s,k=>{H(k.before,w),H(k.lines,w),H(k.after,w)}),y=0,e.font=h.string,H(i.footer,w),e.restore(),m+=p.width,{width:m,height:g}}function Ed(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Ld(i,t,e,s){const{x:n,width:o}=s,a=e.caretSize+e.caretPadding;if(i==="left"&&n+o+a>t.width||i==="right"&&n-o-a<0)return!0}function Id(i,t,e,s){const{x:n,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i;let c="center";return s==="center"?c=n<=(r+l)/2?"left":"right":n<=o/2?c="left":n>=a-o/2&&(c="right"),Ld(c,i,t,e)&&(c="center"),c}function go(i,t,e){const s=e.yAlign||t.yAlign||Ed(i,e);return{xAlign:e.xAlign||t.xAlign||Id(i,t,e,s),yAlign:s}}function Nd(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function zd(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function po(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:u}=_e(a);let p=Nd(t,r);const g=zd(t,l,c);return l==="center"?r==="left"?p+=c:r==="right"&&(p-=c):r==="left"?p-=Math.max(h,f)+n:r==="right"&&(p+=Math.max(d,u)+n),{x:nt(p,0,s.width-t.width),y:nt(g,0,s.height-t.height)}}function xi(i,t,e){const s=_t(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function mo(i){return kt([],Et(i))}function jd(i,t,e){return he(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function bo(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Ca={beforeTitle:Pt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:Pt,beforeBody:Pt,beforeLabel:Pt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return W(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Pt,afterBody:Pt,beforeFooter:Pt,footer:Pt,afterFooter:Pt};function ot(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?Ca[t].call(e,s):n}class Ms extends Tt{constructor(t){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=t.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new da(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=jd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=ot(s,"beforeTitle",this,t),o=ot(s,"title",this,t),a=ot(s,"afterTitle",this,t);let r=[];return r=kt(r,Et(n)),r=kt(r,Et(o)),r=kt(r,Et(a)),r}getBeforeBody(t,e){return mo(ot(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return H(t,o=>{const a={before:[],lines:[],after:[]},r=bo(s,o);kt(a.before,Et(ot(r,"beforeLabel",this,o))),kt(a.lines,ot(r,"label",this,o)),kt(a.after,Et(ot(r,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return mo(ot(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=ot(s,"beforeFooter",this,t),o=ot(s,"footer",this,t),a=ot(s,"afterFooter",this,t);let r=[];return r=kt(r,Et(n)),r=kt(r,Et(o)),r=kt(r,Et(a)),r}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(Rd(this.chart,e[l]));return t.filter&&(r=r.filter((h,d,f)=>t.filter(h,d,f,s))),t.itemSort&&(r=r.sort((h,d)=>t.itemSort(h,d,s))),H(r,h=>{const d=bo(t.callbacks,h);n.push(ot(d,"labelColor",this,h)),o.push(ot(d,"labelPointStyle",this,h)),a.push(ot(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,a=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const r=He[s.position].call(this,n,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const l=this._size=uo(this,s),c=Object.assign({},r,l),h=go(this.chart,s,c),d=po(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=_e(r),{x:f,y:u}=t,{width:p,height:g}=e;let m,b,y,w,k,_;return o==="center"?(k=u+g/2,n==="left"?(m=f,b=m-a,w=k+a,_=k-a):(m=f+p,b=m+a,w=k-a,_=k+a),y=m):(n==="left"?b=f+Math.max(l,h)+a:n==="right"?b=f+p-Math.max(c,d)-a:b=this.caretX,o==="top"?(w=u,k=w-a,m=b-a,y=b+a):(w=u+g,k=w+a,m=b+a,y=b-a),_=w),{x1:m,x2:b,x3:y,y1:w,y2:k,y3:_}}drawTitle(t,e,s){const n=this.title,o=n.length;let a,r,l;if(o){const c=we(s.rtl,this.x,this.width);for(t.x=xi(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",a=ct(s.titleFont),r=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=s.titleMarginBottom-r)}}_drawColorBox(t,e,s,n,o){const a=this.labelColors[s],r=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=ct(o.bodyFont),d=xi(this,"left",o),f=n.x(d),u=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+u;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},m=n.leftForLtr(f,c)+c/2,b=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,xs(t,g,m,b),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,xs(t,g,m,b)}else{t.lineWidth=j(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const g=n.leftForLtr(f,c),m=n.leftForLtr(n.xPlus(f,1),c-2),b=_e(a.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Pi(t,{x:g,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Pi(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=ct(s.bodyFont);let f=d.lineHeight,u=0;const p=we(s.rtl,this.x,this.width),g=function(S){e.fillText(S,p.x(t.x+u),t.y+f/2),t.y+=f+o},m=p.textAlign(a);let b,y,w,k,_,x,M;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=xi(this,m,s),e.fillStyle=s.bodyColor,H(this.beforeBody,g),u=r&&m!=="right"?a==="center"?c/2+h:c+2+h:0,k=0,x=n.length;k<x;++k){for(b=n[k],y=this.labelTextColors[k],e.fillStyle=y,H(b.before,g),w=b.lines,r&&w.length&&(this._drawColorBox(e,t,k,p,s),f=Math.max(d.lineHeight,l)),_=0,M=w.length;_<M;++_)g(w[_]),f=d.lineHeight;H(b.after,g)}u=0,f=d.lineHeight,H(this.afterBody,g),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let a,r;if(o){const l=we(s.rtl,this.x,this.width);for(t.x=xi(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",a=ct(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:p}=_e(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+d,l),a==="top"&&this.drawCaret(t,e,s,n),e.lineTo(r+c-f,l),e.quadraticCurveTo(r+c,l,r+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(r+c,l+h-p),e.quadraticCurveTo(r+c,l+h,r+c-p,l+h),a==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(r+u,l+h),e.quadraticCurveTo(r,l+h,r,l+h-u),a==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(r,l+d),e.quadraticCurveTo(r,l,r+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const a=He[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=uo(this,t),l=Object.assign({},a,this._size),c=go(e,t,l),h=po(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=_t(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),la(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),ca(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!Ci(s,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),r=this._positionChanged(a,t),l=e||!Ci(a,o)||r;return l&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,a=He[o.position].call(this,t,e);return a!==!1&&(s!==a.x||n!==a.y)}}C(Ms,"positioners",He);var Bd={id:"tooltip",_element:Ms,positioners:He,afterInit(i,t,e){e&&(i.tooltip=new Ms({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.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,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.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:Ca},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 Fd=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Wd(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Fd(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Hd=(i,t)=>i===null?null:nt(Math.round(i),0,t);function xo(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class ks extends Se{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(W(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Wd(s,t,E(e,t),this._addedLabels),Hd(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)n.push({value:a});return n}getLabelForValue(t){return xo.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}C(ks,"id","category"),C(ks,"defaults",{ticks:{callback:xo}});function Vd(i,t){const e=[],{bounds:n,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=i,u=o||1,p=h-1,{min:g,max:m}=t,b=!W(a),y=!W(r),w=!W(c),k=(m-g)/(d+1);let _=yn((m-g)/p/u)*u,x,M,S,D;if(_<1e-14&&!b&&!y)return[{value:g},{value:m}];D=Math.ceil(m/_)-Math.floor(g/_),D>p&&(_=yn(D*_/p/u)*u),W(l)||(x=Math.pow(10,l),_=Math.ceil(_*x)/x),n==="ticks"?(M=Math.floor(g/_)*_,S=Math.ceil(m/_)*_):(M=g,S=m),b&&y&&o&&dl((r-a)/o,_/1e3)?(D=Math.round(Math.min((r-a)/_,h)),_=(r-a)/D,M=a,S=r):w?(M=b?a:M,S=y?r:S,D=c-1,_=(S-M)/D):(D=(S-M)/_,$e(D,Math.round(D),_/1e3)?D=Math.round(D):D=Math.ceil(D));const T=Math.max(vn(_),vn(M));x=Math.pow(10,W(l)?T:l),M=Math.round(M*x)/x,S=Math.round(S*x)/x;let O=0;for(b&&(f&&M!==a?(e.push({value:a}),M<a&&O++,$e(Math.round((M+O*_)*x)/x,a,yo(a,k,i))&&O++):M<a&&O++);O<D;++O){const R=Math.round((M+O*_)*x)/x;if(y&&R>r)break;e.push({value:R})}return y&&f&&S!==r?e.length&&$e(e[e.length-1].value,r,yo(r,k,i))?e[e.length-1].value=r:e.push({value:r}):(!y||S===r)&&e.push({value:S}),e}function yo(i,t,{horizontal:e,minRotation:s}){const n=Nt(s),o=(e?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class Yd extends Se{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return W(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const a=l=>n=e?n:l,r=l=>o=s?o:l;if(t){const l=Ct(n),c=Ct(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=Vd(n,o);return t.bounds==="ticks"&&fl(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return zs(t,this.chart.options.locale,this.options.ticks.format)}}class Ss extends Yd{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=mt(t)?t:0,this.max=mt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=Nt(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}C(Ss,"id","linear"),C(Ss,"defaults",{ticks:{callback:ta.formatters.numeric}});const Bi={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}},lt=Object.keys(Bi);function vo(i,t){return i-t}function _o(i,t){if(W(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let a=t;return typeof s=="function"&&(a=s(a)),mt(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(n&&(a=n==="week"&&(Qe(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,n)),+a)}function wo(i,t,e,s){const n=lt.length;for(let o=lt.indexOf(i);o<n-1;++o){const a=Bi[lt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=s)return lt[o]}return lt[n-1]}function $d(i,t,e,s,n){for(let o=lt.length-1;o>=lt.indexOf(e);o--){const a=lt[o];if(Bi[a].common&&i._adapter.diff(n,s,a)>=t-1)return a}return lt[e?lt.indexOf(e):0]}function Xd(i){for(let t=lt.indexOf(i)+1,e=lt.length;t<e;++t)if(Bi[lt[t]].common)return lt[t]}function Mo(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Is(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Ud(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=e[r],l>=0&&(t[l].major=!0);return t}function ko(i,t,e){const s=[],n={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],n[r]=a,s.push({value:r,major:!1});return o===0||!e?s:Ud(i,s,n,e)}class Ii extends Se{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new Zc._date(t.adapters.date);n.init(e),Ye(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:_o(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}
vendor: 7,582 bytes, line 27
27(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=mt(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=mt(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,a=this.max,r=bl(n,o,a);return this._unit=e.unit||(s.autoSkip?wo(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):$d(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Xd(this._unit),this.initOffsets(n),t.reverse&&r.reverse(),ko(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=nt(e,0,a),s=nt(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,a=o.unit||wo(o.minUnit,e,s,this._getLabelCapacity(e)),r=E(n.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Qe(l)||l===!0,h={};let d=e,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(s,e,a)>1e5*r)throw new Error(e+" and "+s+" are too far apart with stepSize of "+r+" "+a);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f<s;f=+t.add(f,r,a),u++)Mo(h,f,p);return(f===s||n.bounds==="ticks"||u===1)&&Mo(h,f,p),Object.keys(h).sort(vo).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,a=e||n[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,n){const o=this.options,a=o.ticks.callback;if(a)return $(a,[t,e,s],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&r[l],d=c&&r[c],f=s[e],u=c&&d&&f&&f.major;return this._adapter.format(t,n||(u?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=Nt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),a=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:s*o+r*a,h:s*a+r*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,ko(this,[t],this._majorUnit),n),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(_o(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return qo(t.sort(vo))}}C(Ii,"id","time"),C(Ii,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function yi(i,t,e){let s=0,n=i.length-1,o,a,r,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=ne(i,"pos",t)),{pos:o,time:r}=i[s],{pos:a,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=ne(i,"time",t)),{time:o,pos:r}=i[s],{time:a,pos:l}=i[n]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class So extends Ii{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=yi(e,this.min),this._tableRange=yi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let a,r,l,c,h;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,r=n.length;a<r;++a)h=n[a+1],l=n[a-1],c=n[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(yi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return yi(this._table,s*this._tableRange+this._minPos,!0)}}C(So,"id","timeseries"),C(So,"defaults",Ii.defaults);It.register(vi,_i,ys,Si,We,ki,Fe,ks,Ss,Bd,Pd);const qd=({onPost:i,onUpdate:t,initialContent:e="",initialMediaFiles:s=[],initialCW:n=null,maxChars:o,className:a="",conversationId:r=null,messageSlug:l=null,isEditMode:c=!1,contentFormat:h,initialFormat:d})=>{const f=h||d||"markdown",[u,p]=L.useState(e),[g,m]=L.useState(s),[b,y]=L.useState(!!n),[w,k]=L.useState(n||""),[_,x]=L.useState(!1),[M,S]=L.useState(!1),[D,T]=L.useState(!1),[O,R]=L.useState(null),[F,Y]=L.useState("A, B, C, D"),[P,N]=L.useState("10, 40, 20, 30"),[B,it]=L.useState("bar"),[G,dt]=L.useState(!1),[bt,ft]=L.useState({}),[xt,X]=L.useState(null),ut=L.useRef(null),st=L.useRef(null),De=L.useRef(null),Ce=L.useRef(null),Fi=L.useRef(null),Wi=L.useRef(null),Hi=L.useRef(null),zt=L.useRef(null),Oa=["ð","ð","ð","ð","ð","ð
","ð","ð¤£","ð","ð","ð","ð","ð","ð","ð","ð¥°","ð","ð","ð","ð","ð","ð","ð","ð","ð¤ª","ð¤¨","ð§","ð¤","ð","ð¤©","ð¥³","ð","ð","ð","ð","ð","ð","ð","â¹ï¸","ð®","ð¯","ð²","ð³","ð¥º","ð¦","ð§","ð¨","ð°","ð¥","ð¢","ð","ð±","ð","ð£","ð","ð","ð©","ð«","ð¥±","ð¤","ð¡","ð ","ð¤¬","ð","ð¿","ð","â ï¸","ð©","ð¤¡","ð¹","ðº","ð»","ð½","ð¾","ð¤","ð","â¨","ð","ð«","â","ð¥","ð§","ð","âï¸","ð","â","ð","ð","ð","â¤ï¸","ð§¡","ð","ð","ð","ð","ð¤","ð¤","ð¤","ð","â£ï¸","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð¤","âï¸","ð¤","ð¤","ð¤","ð","ð","ð","ð","ð","âï¸","â","ð¤","ðï¸","ð","ð","ð¤","ðª","ð¦¾","ð¦¿","ð¦µ","ð¦¶","ð","ð¦»","ð","ð§ ","ð¦·","ð¦´","ð","ðï¸","ð
","ð"],de=u.length,fe=o?de>o:!1,Us=o?o-de<=50&&o-de>
270:!1,Gt=g.length>=4,Ta=()=>o?`${o-de}`:"â";L.useEffect(()=>{c&&(p(e),m(s),y(!!n),k(n||""))},[e,s,n,c]),L.useEffect(()=>{zt.current&&(zt.current.style.height="auto",zt.current.style.height=`${zt.current.scrollHeight}px`)},[u]);const Aa=L.useCallback(A=>{const z=A.target.files;if(!z)return;const At=4-g.length;Array.from(z).slice(0,At).forEach(wt=>{if(!wt.type.startsWith("image/")){X("Only image files are allowed");return}if(wt.size>100*1024*1024){X("Each image must be less than 100MB");return}const Yi=new FileReader,Ks=`${wt.name}_${Date.now()}`;Yi.onload=ue=>{var ni;(ni=ue.target)!=null&&ni.result&&(m(qt=>qt.length<4?[...qt,ue.target.result]:qt),ft(qt=>({...qt,[Ks]:100})))},Yi.onprogress=ue=>{if(ue.lengthComputable){const ni=ue.loaded/ue.total*100;ft(qt=>({...qt,[Ks]:ni}))}},Yi.readAsDataURL(wt)}),ut.current&&(ut.current.value=""),setTimeout(()=>X(null),3e3)},[g.length]),Pa=L.useCallback(A=>{m(z=>z.filter((At,jt)=>jt!==A))},[]),Ra=L.useCallback(A=>{R(A),T(!0)},[]);L.useEffect(()=>(D&&De.current&&O!==null&&(De.current.src=g[O],setTimeout(()=>{st.current&&st.current.destroy(),De.current&&(st.current=new Wo(De.current,{viewMode:2,background:!1,aspectRatio:NaN,autoCropArea:.8,movable:!0,zoomable:!0,rotatable:!0,scalable:!0}))},100)),()=>{st.current&&(st.current.destroy(),st.current=null)}),[D,O,g]);const Ea=L.useCallback(()=>{if(st.current&&O!==null){const A=st.current.getCroppedCanvas();if(A){const z=A.toDataURL("image/jpeg",.9);m(At=>At.map((jt,wt)=>wt===O?z:jt))}T(!1)}},[O]),Vi=L.useCallback(()=>{if(!Ce.current)return;const A=Ce.current.getContext("2d");if(!A)return;Fi.current&&Fi.current.destroy();const z=F.split(",").map(wt=>wt.trim()),At=P.split(",").map(Number),jt={type:B,data:{labels:z,datasets:[{label:"Data",data:At,backgroundColor:["#4f46e5","#818cf8","#a5b4fc","#c7d2fe","#e0e7ff"],borderColor:"#4f46e5",borderWidth:1,borderRadius:6,tension:.4}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"top"},tooltip:{mode:"index",intersect:!1}},scales:B==="pie"?void 0:{y:{beginAtZero:!0,grid:{color:"#e5e7eb"}},x:{grid:{display:!1}}}}};Fi.current=new It(A,jt)},[F,P,B]);L.useEffect(()=>{if(M){const A=setTimeout(()=>{Vi()},100);return()=>clearTimeout(A)}},[M,Vi]);const La=L.useCallback(()=>{if(Ce.current&&g.length<4)try{const A=Ce.current.toDataURL("image/png");m(z=>[...z,A]),S(!1),X(null)}catch{X("Failed to generate chart image"),setTimeout(()=>X(null),3e3)}},[g.length]),Ia=L.useCallback(async()=>{if(o&&fe){X(`Character limit exceeded by ${Math.abs(o-de)} characters`),setTimeout(()=>X(null),3e3);return}if(!u.trim()&&g.length===0){X("Please add some content or media before posting"),setTimeout(()=>X(null),3e3);return}dt(!0),X(null);try{c&&t&&l?await t(u,g,b?w:null,l):i&&await i(u,g,b?w:null,r),c||(p(""),m([]),y(!1),k("")),X(null)}catch(A){X("Failed to post. Please try again."),console.error("Post error:",A)}finally{dt(!1),setTimeout(()=>X(null),3e3)}},[u,g,b,w,fe,de,o,i,t,r,c,l]),Na=L.useCallback(A=>{p(z=>z+A),x(!1),zt.current&&zt.current.focus()},[]);L.useEffect(()=>{const A=z=>{z.key==="Escape"&&(T(!1),S(!1),x(!1))};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[]),L.useEffect(()=>{const A=z=>{Wi.current&&Hi.current&&!Wi.current.contains(z.target)&&!Hi.current.contains(z.target)&&x(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]);const za=()=>{const A=g.length;return A===0?"":A===1?"media-grid-1":A===2?"media-grid-2":A===3?"media-grid-3":"media-grid-4"},ja=()=>o?fe?"text-red-500":Us?"text-orange-500":"text-slate-400":"text-slate-400",Ba=c?"Update":"Post",Fa=c?"Updating...":"Posting...";return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:`w-full bg-white border border-slate-200 rounded-3xl p-4 sm:p-6 shadow-xl transition-all ${a}`,children:[xt&&v.jsx("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-xl animate-fadeIn",children:v.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("path",{d:"M12 8v4M12 16h.01"})]}),v.jsx("span",{className:"text-sm",children:xt})]})}),b&&v.jsxs("div",{className:"flex items-stretch mb-4 overflow-hidden rounded-xl border border-slate-200 animate-slideDown",children:[v.jsx("div",{className:"hazard-stripes",style:{backgroundImage:"repeating-linear-gradient(45deg, #facc15, #facc15 10px, #27272a 10px, #27272a 20px)",width:"6px"}}),v.jsx("input",{type:"text",value:w,onChange:A=>k(A.target.value),placeholder:"Content warning (e.g., Spoilers, NSFW, Trigger Warning)",className:"w-full py-3 px-4 bg-indigo-50/30 focus:outline-none font-medium text-slate-700 placeholder:text-slate-400",maxLength:100}),v.jsx("button",{onClick:()=>y(!1),className:"px-3 text-slate-400 hover:text-slate-600 transition-colors",type:"button",children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:v.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})}),v.jsx("div",{className:"hazard-stripes",style:{backgroundImage:"repeating-linear-gradient(45deg, #facc15, #facc15 10px, #27272a 10px, #27272a 20px)",width:"6px"}})]}),f==="html"&&v.jsxs("div",{className:"mb-3 flex items-center justify-between bg-emerald-50/80 border border-emerald-200 text-emerald-800 px-3 py-1.5 rounded-xl text-xs font-semibold",children:[v.jsxs("span",{className:"flex items-center gap-1.5",children:[v.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("polyline",{points:"16 18 22 12 16 6"}),v.jsx("polyline",{points:"8 6 2 12 8 18"})]}),"HTML Code Mode â Full HTML documents, styles, iframes & embeds supp
27orted"]}),v.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 bg-emerald-100 rounded text-emerald-700",children:"HTML"})]}),f==="ezsheet"&&v.jsxs("div",{className:"mb-3 flex items-center justify-between bg-blue-50/80 border border-blue-200 text-blue-800 px-3 py-1.5 rounded-xl text-xs font-semibold",children:[v.jsxs("span",{className:"flex items-center gap-1.5",children:[v.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),v.jsx("line",{x1:"3",y1:"9",x2:"21",y2:"9"}),v.jsx("line",{x1:"9",y1:"21",x2:"9",y2:"9"})]}),"EzSheet Mode â Spreadsheet-like layouts & data grids supported"]}),v.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 bg-blue-100 rounded text-blue-700",children:"EZSHEET"})]}),v.jsxs("div",{className:"relative",children:[v.jsx("textarea",{ref:zt,value:u,onChange:A=>p(A.target.value),onKeyDown:A=>{if((f==="html"||f==="ezsheet")&&A.key==="Tab"){A.preventDefault();const z=zt.current;if(!z)return;const At=z.selectionStart,jt=z.selectionEnd,wt=u.substring(0,At)+" "+u.substring(jt);p(wt),setTimeout(()=>{z.selectionStart=z.selectionEnd=At+2},0)}},placeholder:f==="html"?"Write or paste HTML code here (e.g. <!DOCTYPE html>, <div>...</div>, <style>...</style>, <iframe>...</iframe>)...":f==="ezsheet"?"Build your EzSheet here... (Spreadsheet-like layout, use Tab to indent)":o?"What's on your mind?":"What's on your mind? (No character limit)",className:f==="html"||f==="ezsheet"?"w-full font-mono text-sm text-slate-900 placeholder-slate-400 focus:outline-none resize-y bg-slate-50 border border-slate-200 rounded-xl p-3 shadow-inner leading-relaxed":"w-full text-xl text-slate-800 placeholder-slate-400 focus:outline-none resize-none bg-transparent",rows:f==="html"||f==="ezsheet"?6:3,style:{minHeight:f==="html"||f==="ezsheet"?"180px":"100px",tabSize:2}}),g.length>0&&v.jsx("div",{className:`grid gap-1 mt-2 rounded-2xl overflow-hidden bg-slate-50 shadow-inner ${za()}`,children:g.map((A,z)=>v.jsxs("div",{className:`relative group bg-slate-200 overflow-hidden ${z===0&&g.length===3?"row-span-2":""}`,style:{aspectRatio:"1/1"},children:[v.jsx("img",{src:A,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",alt:`Media ${z+1}`}),v.jsxs("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-all duration-200 flex items-center justify-center gap-3",children:[v.jsx("button",{onClick:()=>Ra(z),className:"bg-white p-2.5 rounded-full text-indigo-600 shadow-xl hover:scale-110 transition-transform duration-200",type:"button",title:"Edit image",children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[v.jsx("path",{d:"M6 2v6h6"}),v.jsx("path",{d:"M18 22v-6h-6"}),v.jsx("path",{d:"M2 18h6v6"}),v.jsx("path",{d:"M22 6h-6V2"})]})}),v.jsx("button",{onClick:()=>Pa(z),className:"bg-white p-2.5 rounded-full text-red-600 shadow-xl hover:scale-110 transition-transform duration-200",type:"button",title:"Remove image",children:v.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:v.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),bt[`media_${z}`]&&bt[`media_${z}`]<100&&v.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-1 bg-indigo-500 transition-all",style:{width:`${bt[`media_${z}`]}%`}})]},z))})]}),v.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-4 mt-6 pt-4 border-t border-slate-100",children:[v.jsxs("div",{className:"flex items-center gap-3 sm:gap-6 text-slate-400",children:[v.jsx("input",{ref:ut,type:"file",className:"hidden",accept:"image/jpeg,image/png,image/gif,image/webp,image/bmp,image/svg+xml",multiple:!0,onChange:Aa}),v.jsx("button",{onClick:()=>{var A;return(A=ut.current)==null?void 0:A.click()},disabled:Gt,className:`hover:text-indigo-600 transition-all duration-200 transform hover:scale-110 ${Gt?"opacity-30 curs
27or-not-allowed":""}`,title:Gt?"Maximum 4 images reached":"Upload Images (Max 4)",type:"button",children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),v.jsx("circle",{cx:"9",cy:"9",r:"2"}),v.jsx("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})}),v.jsx("button",{onClick:()=>S(!0),disabled:Gt,className:`hover:text-indigo-600 transition-all duration-200 transform hover:scale-110 ${Gt?"opacity-30 cursor-not-allowed":""}`,title:Gt?"Maximum 4 images reached":"Generate Chart",type:"button",children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[v.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"10"}),v.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"4"}),v.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"16"})]})}),v.jsx("button",{onClick:()=>y(!b),className:`hover:text-amber-500 transition-all duration-200 transform hover:scale-110 ${b?"text-amber-500":""}`,title:"Add Content Warning",type:"button",children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),v.jsx("path",{d:"M12 9v4M12 17h.01"})]})}),v.jsxs("div",{className:"relative",children:[v.jsx("button",{ref:Hi,onClick:()=>x(!_),className:"hover:text-indigo-600 transition-all duration-200 transform hover:scale-110",type:"button",title:"Add Emoji",children:v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("path",{d:"M8 14s1.5 2 4 2 4-2 4-2"}),v.jsx("line",{x1:"9",y1:"9",x2:"9.01",y2:"9"}),v.jsx("line",{x1:"15",y1:"9",x2:"15.01",y2:"9"})]})}),_&&v.jsxs("div",{ref:Wi,className:"absolute bottom-12 left-0 w-[280px] sm:w-[320px] bg-white border border-slate-200 rounded-2xl shadow-2xl z-50 overflow-hidden animate-scaleIn",children:[v.jsx("div",{className:"p-2 border-b border-slate-100 bg-gradient-to-r from-indigo-50 to-purple-50",children:v.jsx("span",{className:"text-xs font-semibold text-indigo-600",children:"Pick an emoji"})}),v.jsx("div",{className:"p-3 h-64 overflow-y-auto grid grid-cols-8 gap-1 custom-scrollbar",children:Oa.map((A,z)=>v.jsx("button",{onClick:()=>Na(A),className:"text-2xl p-2 hover:bg-slate-100 rounded-lg transition-all duration-150 active:scale-90",type:"button",title:A,children:A},z))})]})]})]}),v.jsxs("div",{className:"flex items-center gap-3 sm:gap-6",children:[v.jsxs("div",{className:"text-right",children:[v.jsx("span",{className:`font-bold text-sm tracking-tight ${ja()}`,children:Ta()}),o&&Us&&!fe&&v.jsx("div",{className:"text-[10px] text-orange-500",children:"Near limit"}),o&&fe&&v.jsx("div",{className:"text-[10px] text-red-500",children:"Exceeded"}),!o&&v.jsx("div",{className:"text-[10px] text-slate-400",children:"No limit"})]}),v.jsx("button",{onClick:Ia,disabled:o&&fe||!u.trim()&&g.length===0||G,className:"bg-indigo-600 hover:bg-indigo-700 text-white px-6 sm:px-10 py-2.5 rounded-full font-bold shadow-lg shadow-indigo-100 transition-all duration-200 active:scale-95 disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-2",type:"button",children:G?v.jsxs(v.Fragment,{children:[v.jsxs("svg",{className:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[v.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),v.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),v.jsx("span",{children:Fa})]}):Ba})]})]}),Gt&&v.jsx("div",{className:"mt-3 text-xs text-amber-600 text-center",children:"Maximum 4 images reached"})]}),D&&v.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 modal-overlay",style:{backdropFilter:"blur(8px)",backgroundColor:"rgba(15, 23, 42, 0.8)"},children:v.jsxs("div",{className:"bg-white w-full max-w-2xl rounded-3xl overflow-hidden shadow-2xl animate-scaleIn",children:[v.jsxs("div",{className:"p-4 border-b flex justify-between items-center bg-gradient-to-r from-indigo-50 to-purple-50",children:[v.jsx("h3",{className:"font-bold text-slate-800",children:"Edit Media"}),v.jsx("button",{onClick:()=>T(!1),className:"text-slate-400 hover:text-slate-600 transition-colors p-1 hover:bg-slate-100 rounded-lg",type:"button",children:v.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:v.jsx("path",{d:"M18 6 6 18M6 6l12 12"})})})]}),v.jsx("div",{className:"h-[50vh] bg-slate-900 flex items-center justify-center p-4",children:v.jsx("img",{ref:De,src:"",className:"block max-w-full max-h-full",alt:"Crop preview"})}),v.jsxs("div",{className:"p-4 flex justify-end gap-3 bg-white",children:[v.jsx("button",{onClick:()=>T(!1),className:"px-6 py-2 font-bold text-slate-500 hover:text-slate-700 transition-colors",children:"Cancel"}),v.jsx("button",{onClick:Ea,className:"px-8 py-2 bg-indigo-600 text-white rounded-full font-bold shadow-md hover:bg-indigo-700 transition-all duration-200 transform hover:scale-105",children:"Apply Changes"})]})]})}),M&&v.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 modal-overlay",style:{backdropFilter:"blur(8px)",backgroundColor:"rgba(15, 23, 42, 0.8)"},children:v.jsxs("div",{className:"bg-white w-full max-w-4xl rounded-3xl overflow-hidden shadow-2xl flex flex-col md:flex-row animate-scaleIn",children:[v.jsxs("div",{className:"w-full md:w-80 p-6 border-r bg-gradient-to-b from-slate-50 to-white",children:[v.jsx("h3",{className:"font-bold text-lg mb-4 text-slate-800",children:"Chart Designer"}),v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-semibold text-slate-600 mb-1",children:"Labels"}),v.jsx("input",{type:"text",value:F,onChange:A=>Y(A.target.value),placeholder:"Labels (comma-separated)",className:"w-full p-2 border rounded-lg text-sm focus:ring-2 ring-indigo-200 outline-none transition-all"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-semibold text-slate-600 mb-1",children:"Data Values"}),v.jsx("input",{type:"text",value:P,onChange:A=>N(A.target.value),placeholder:"Data (comma-separated)",className:"w-full p-2 border rounded-lg text-sm focus:ring-2 ring-indigo-200 outline-none transition-all"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-xs font-semibold text-slate-600 mb-1",children:"Chart Type"}),v.jsxs("select",{value:B,onChange:A=>it(A.target.value),className:"w-full p-2 border rounded-lg text-sm outline-none focus:ring-2 ring-indigo-200 transition-all",children:[v.jsx("option",{value:"bar",children:"Bar Chart"}),v.jsx("option",{value:"line",children:"Line Chart"}),v.jsx("option",{value:"pie",children:"Pie Chart"})]})]}),v.jsx("button",{onClick:Vi,className:"w-full py-2 bg-indigo-50 border border-indigo-200 text-indigo-600 rounded-lg font-bold text-xs hover:bg-indigo-100 transition-all duration-200",children:"PREVIEW CHART"})]})]}),v.jsxs("div",{className:"flex-grow p-6 bg-white flex flex-col",children:[v.jsx("div",{className:"flex-grow flex items-center justify-center bg-slate-50 rounded-2xl p-4 min-h-[300px]",children:v.jsx("canvas",{ref:Ce,className:"max-w-full max-h-full"})}),v.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[v.jsx("button",{onClick:()=>S(!1),className:"px-6 py-2 text-slate-500 font-bold hover:text-slate-700 transition-colors",children:"Cancel"}),v.jsx("button",{onClick:La,disabled:g.length>=4,className:"px-10 py-3 bg-indigo-600 text-white rounded-full font-bold shadow-lg hover:bg-indigo-700 transition-all duration-200 transform hover:scale-105 disabled:opacity-40 disabled:cursor-not-allowed",children:"Attach Chart"})]})]})]})}),v.jsx("style",{children:` 28 .custom-scrollbar::-webkit-scrollbar {
29 width: 6px; 30 height: 6px; 31 } 32 .custom-scrollbar::-webkit-scrollbar-track { 33 background: #f1f1f1; 34 border-radius: 10px; 35 } 36 .custom-scrollbar::-webkit-scrollbar-thumb { 37 background: #cbd5e1; 38 border-radius: 10px; 39 } 40 .custom-scrollbar::-webkit-scrollbar-thumb:hover { 41 background: #94a3b8; 42 } 43 44 .media-grid-1 { 45 display: grid; 46 grid-template-columns: 1fr; 47 } 48 .media-grid-2 { 49 display: grid; 50 grid-template-columns: 1fr 1fr; 51 } 52 .media-grid-3 { 53 display: grid; 54 grid-template-columns: 1fr 1fr; 55 grid-template-rows: auto auto; 56 } 57 .media-grid-3 > div:first-child { 58 grid-row: span 2; 59 } 60 .media-grid-4 { 61 display: grid; 62 grid-template-columns: 1fr 1fr; 63 grid-template-rows: auto auto; 64 } 65 66 .modal-overlay { 67 animation: fadeIn 0.2s ease-out; 68 } 69 70 @keyframes fadeIn { 71 from { opacity: 0; } 72 to { opacity: 1; } 73 } 74 75 @keyframes slideDown { 76 from { 77 opacity: 0; 78 transform: translateY(-10px); 79 } 80 to { 81 opacity: 1; 82 transform: translateY(0); 83 } 84 } 85 86 @keyframes scaleIn { 87 from { 88 opacity: 0; 89 transform: scale(0.95); 90 } 91 to { 92 opacity: 1; 93 transform: scale(1); 94 } 95 } 96 97 .animate-slideDown { 98 animation: slideDown 0.2s ease-out; 99 } 100 101 .animate-scaleIn { 102 animation: scaleIn 0.2s ease-out; 103 } 104 105 .animate-fadeIn { 106 animation: fadeIn 0.2s ease-out; 107 } 108 `})]})};export{qd as S};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.