@deskhero/dh_ui 2.6.4 → 2.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AdvancedFilter.vue.d.ts +55 -0
- package/dist/dh_ui.es.js +17 -4
- package/dist/dh_ui.umd.js +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/tools/editorCode.d.ts +21 -0
- package/package.json +1 -1
package/dist/dh_ui.umd.js
CHANGED
|
@@ -16,7 +16,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
16
16
|
* Released under the MIT License
|
|
17
17
|
*/class _x{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,e,r,t){const o=e.listeners[t],a=e.duration;o.forEach(s=>s({chart:n,initial:e.initial,numSteps:a,currentStep:Math.min(r-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Ad.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let e=0;this._charts.forEach((r,t)=>{if(!r.running||!r.items.length)return;const o=r.items;let a=o.length-1,s=!1,u;for(;a>=0;--a)u=o[a],u._active?(u._total>r.duration&&(r.duration=u._total),u.tick(n),s=!0):(o[a]=o[o.length-1],o.pop());s&&(t.draw(),this._notify(t,r,n,"progress")),o.length||(r.running=!1,this._notify(t,r,n,"complete"),r.initial=!1),e+=o.length}),this._lastDate=n,e===0&&(this._running=!1)}_getAnims(n){const e=this._charts;let r=e.get(n);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(n,r)),r}listen(n,e,r){this._getAnims(n).listeners[e].push(r)}add(n,e){!e||!e.length||this._getAnims(n).items.push(...e)}has(n){return this._getAnims(n).items.length>0}start(n){const e=this._charts.get(n);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((r,t)=>Math.max(r,t._duration),0),this._refresh())}running(n){if(!this._running)return!1;const e=this._charts.get(n);return!(!e||!e.running||!e.items.length)}stop(n){const e=this._charts.get(n);if(!e||!e.items.length)return;const r=e.items;let t=r.length-1;for(;t>=0;--t)r[t].cancel();e.items=[],this._notify(n,e,Date.now(),"complete")}remove(n){return this._charts.delete(n)}}var Nn=new _x;const ug="transparent",Bx={boolean(i,n,e){return e>.5?n:i},color(i,n,e){const r=Pd(i||ug),t=r.valid&&Pd(n||ug);return t&&t.valid?t.mix(r,e).hexString():n},number(i,n,e){return i+(n-i)*e}};class Px{constructor(n,e,r,t){const o=e[r];t=oa([n.to,t,o,n.from]);const a=oa([n.from,o,t]);this._active=!0,this._fn=n.fn||Bx[n.type||typeof a],this._easing=_i[n.easing]||_i.linear,this._start=Math.floor(Date.now()+(n.delay||0)),this._duration=this._total=Math.floor(n.duration),this._loop=!!n.loop,this._target=e,this._prop=r,this._from=a,this._to=t,this._promises=void 0}active(){return this._active}update(n,e,r){if(this._active){this._notify(!1);const t=this._target[this._prop],o=r-this._start,a=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(a,n.duration)),this._total+=o,this._loop=!!n.loop,this._to=oa([n.to,e,t,n.from]),this._from=oa([n.from,t,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){const e=n-this._start,r=this._duration,t=this._prop,o=this._from,a=this._loop,s=this._to;let u;if(this._active=o!==s&&(a||e<r),!this._active){this._target[t]=s,this._notify(!0);return}if(e<0){this._target[t]=o;return}u=e/r%2,u=a&&u>1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[t]=this._fn(o,s,u)}wait(){const n=this._promises||(this._promises=[]);return new Promise((e,r)=>{n.push({res:e,rej:r})})}_notify(n){const e=n?"res":"rej",r=this._promises||[];for(let t=0;t<r.length;t++)r[t][e]()}}const Rx=["x","y","borderWidth","radius","tension"],Zx=["color","borderColor","backgroundColor"];ke.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Vx=Object.keys(ke.animation);ke.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:i=>i!=="onProgress"&&i!=="onComplete"&&i!=="fn"}),ke.set("animations",{colors:{type:"color",properties:Zx},numbers:{type:"number",properties:Rx}}),ke.describe("animations",{_fallback:"animation"}),ke.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:i=>i|0}}}});class lg{constructor(n,e){this._chart=n,this._properties=new Map,this.configure(e)}configure(n){if(!be(n))return;const e=this._properties;Object.getOwnPropertyNames(n).forEach(r=>{const t=n[r];if(!be(t))return;const o={};for(const a of Vx)o[a]=t[a];(Ge(t.properties)&&t.properties||[r]).forEach(a=>{(a===r||!e.has(a))&&e.set(a,o)})})}_animateOptions(n,e){const r=e.options,t=Wx(n,r);if(!t)return[];const o=this._createAnimations(t,r);return r.$shared&&Gx(n.options.$animations,r).then(()=>{n.options=r},()=>{}),o}_createAnimations(n,e){const r=this._properties,t=[],o=n.$animations||(n.$animations={}),a=Object.keys(e),s=Date.now();let u;for(u=a.length-1;u>=0;--u){const c=a[u];if(c.charAt(0)==="$")continue;if(c==="options"){t.push(...this._animateOptions(n,e));continue}const M=e[c];let d=o[c];const g=r.get(c);if(d)if(g&&d.active()){d.update(g,M,s);continue}else d.cancel();if(!g||!g.duration){n[c]=M;continue}o[c]=d=new Px(g,n,c,M),t.push(d)}return t}update(n,e){if(this._properties.size===0){Object.assign(n,e);return}const r=this._createAnimations(n,e);if(r.length)return Nn.add(this._chart,r),!0}}function Gx(i,n){const e=[],r=Object.keys(n);for(let t=0;t<r.length;t++){const o=i[r[t]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Wx(i,n){if(!n)return;let e=i.options;if(!e){i.options=n;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function cg(i,n){const e=i&&i.options||{},r=e.reverse,t=e.min===void 0?n:0,o=e.max===void 0?n:0;return{start:r?o:t,end:r?t:o}}function Hx(i,n,e){if(e===!1)return!1;const r=cg(i,e),t=cg(n,e);return{top:t.end,right:r.end,bottom:t.start,left:r.start}}function Fx(i){let n,e,r,t;return be(i)?(n=i.top,e=i.right,r=i.bottom,t=i.left):n=e=r=t=i,{top:n,right:e,bottom:r,left:t,disabled:i===!1}}function Mg(i,n){const e=[],r=i._getSortedDatasetMetas(n);let t,o;for(t=0,o=r.length;t<o;++t)e.push(r[t].index);return e}function dg(i,n,e,r={}){const t=i.keys,o=r.mode==="single";let a,s,u,c;if(n!==null){for(a=0,s=t.length;a<s;++a){if(u=+t[a],u===e){if(r.all)continue;break}c=i.values[u],ct(c)&&(o||n===0||tn(n)===tn(c))&&(n+=c)}return n}}function $x(i){const n=Object.keys(i),e=new Array(n.length);let r,t,o;for(r=0,t=n.length;r<t;++r)o=n[r],e[r]={x:o,y:i[o]};return e}function gg(i,n){const e=i&&i.options.stacked;return e||e===void 0&&n.stack!==void 0}function Jx(i,n,e){return`${i.id}.${n.id}.${e.stack||e.type}`}function Xx(i){const{min:n,max:e,minDefined:r,maxDefined:t}=i.getUserBounds();return{min:r?n:Number.NEGATIVE_INFINITY,max:t?e:Number.POSITIVE_INFINITY}}function Kx(i,n,e){const r=i[n]||(i[n]={});return r[e]||(r[e]={})}function fg(i,n,e,r){for(const t of n.getMatchingVisibleMetas(r).reverse()){const o=i[t.index];if(e&&o>0||!e&&o<0)return t.index}return null}function yg(i,n){const{chart:e,_cachedMeta:r}=i,t=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:s}=r,u=o.axis,c=a.axis,M=Jx(o,a,r),d=n.length;let g;for(let f=0;f<d;++f){const j=n[f],{[u]:p,[c]:x}=j,N=j._stacks||(j._stacks={});g=N[c]=Kx(t,M,p),g[s]=x,g._top=fg(g,a,!0,r.type),g._bottom=fg(g,a,!1,r.type)}}function qu(i,n){const e=i.scales;return Object.keys(e).filter(r=>e[r].axis===n).shift()}function qx(i,n){return En(i,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function eA(i,n,e){return En(i,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:e,index:n,mode:"default",type:"data"})}function Gi(i,n){const e=i.controller.index,r=i.vScale&&i.vScale.axis;if(r){n=n||i._parsed;for(const t of n){const o=t._stacks;if(!o||o[r]===void 0||o[r][e]===void 0)return;delete o[r][e]}}}const el=i=>i==="reset"||i==="none",Ng=(i,n)=>n?i:Object.assign({},i),tA=(i,n,e)=>i&&!n.hidden&&n._stacked&&{keys:Mg(e,!0),values:null};class Vt{constructor(n,e){this.chart=n,this._ctx=n.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.initialize()}initialize(){const n=this._cachedMeta;this.configure(),this.linkScales(),n._stacked=gg(n.vScale,n),this.addElements()}updateIndex(n){this.index!==n&&Gi(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,e=this._cachedMeta,r=this.getDataset(),t=(d,g,f,j)=>d==="x"?g:d==="r"?j:f,o=e.xAxisID=we(r.xAxisID,qu(n,"x")),a=e.yAxisID=we(r.yAxisID,qu(n,"y")),s=e.rAxisID=we(r.rAxisID,qu(n,"r")),u=e.indexAxis,c=e.iAxisID=t(u,o,a,s),M=e.vAxisID=t(u,a,o,s);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(s),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(M)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(n){return this.chart.scales[n]}_getOtherScale(n){const e=this._cachedMeta;return n===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const n=this._cachedMeta;this._data&&zd(this._data,this),n._stacked&&Gi(n)}_dataCheck(){const n=this.getDataset(),e=n.data||(n.data=[]),r=this._data;if(be(e))this._data=$x(e);else if(r!==e){if(r){zd(r,this);const t=this._cachedMeta;Gi(t),t._parsed=[]}e&&Object.isExtensible(e)&&jz(e,this),this._syncList=[],this._data=e}}addElements(){const n=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(n.dataset=new this.datasetElementType)}buildOrUpdateElements(n){const e=this._cachedMeta,r=this.getDataset();let t=!1;this._dataCheck();const o=e._stacked;e._stacked=gg(e.vScale,e),e.stack!==r.stack&&(t=!0,Gi(e),e.stack=r.stack),this._resyncElements(n),(t||o!==e._stacked)&&yg(this,e._parsed)}configure(){const n=this.chart.config,e=n.datasetScopeKeys(this._type),r=n.getOptionScopes(this.getDataset(),e,!0);this.options=n.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(n,e){const{_cachedMeta:r,_data:t}=this,{iScale:o,_stacked:a}=r,s=o.axis;let u=n===0&&e===t.length?!0:r._sorted,c=n>0&&r._parsed[n-1],M,d,g;if(this._parsing===!1)r._parsed=t,r._sorted=!0,g=t;else{Ge(t[n])?g=this.parseArrayData(r,t,n,e):be(t[n])?g=this.parseObjectData(r,t,n,e):g=this.parsePrimitiveData(r,t,n,e);const f=()=>d[s]===null||c&&d[s]<c[s];for(M=0;M<e;++M)r._parsed[M+n]=d=g[M],u&&(f()&&(u=!1),c=d);r._sorted=u}a&&yg(this,g)}parsePrimitiveData(n,e,r,t){const{iScale:o,vScale:a}=n,s=o.axis,u=a.axis,c=o.getLabels(),M=o===a,d=new Array(t);let g,f,j;for(g=0,f=t;g<f;++g)j=g+r,d[g]={[s]:M||o.parse(c[j],j),[u]:a.parse(e[j],j)};return d}parseArrayData(n,e,r,t){const{xScale:o,yScale:a}=n,s=new Array(t);let u,c,M,d;for(u=0,c=t;u<c;++u)M=u+r,d=e[M],s[u]={x:o.parse(d[0],M),y:a.parse(d[1],M)};return s}parseObjectData(n,e,r,t){const{xScale:o,yScale:a}=n,{xAxisKey:s="x",yAxisKey:u="y"}=this._parsing,c=new Array(t);let M,d,g,f;for(M=0,d=t;M<d;++M)g=M+r,f=e[g],c[M]={x:o.parse(kn(f,s),g),y:a.parse(kn(f,u),g)};return c}getParsed(n){return this._cachedMeta._parsed[n]}getDataElement(n){return this._cachedMeta.data[n]}applyStack(n,e,r){const t=this.chart,o=this._cachedMeta,a=e[n.axis],s={keys:Mg(t,!0),values:e._stacks[n.axis]};return dg(s,a,o.index,{mode:r})}updateRangeFromParsed(n,e,r,t){const o=r[e.axis];let a=o===null?NaN:o;const s=t&&r._stacks[e.axis];t&&s&&(t.values=s,a=dg(t,o,this._cachedMeta.index)),n.min=Math.min(n.min,a),n.max=Math.max(n.max,a)}getMinMax(n,e){const r=this._cachedMeta,t=r._parsed,o=r._sorted&&n===r.iScale,a=t.length,s=this._getOtherScale(n),u=tA(e,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:M,max:d}=Xx(s);let g,f;function j(){f=t[g];const p=f[s.axis];return!ct(f[n.axis])||M>p||d<p}for(g=0;g<a&&!(!j()&&(this.updateRangeFromParsed(c,n,f,u),o));++g);if(o){for(g=a-1;g>=0;--g)if(!j()){this.updateRangeFromParsed(c,n,f,u);break}}return c}getAllParsedValues(n){const e=this._cachedMeta._parsed,r=[];let t,o,a;for(t=0,o=e.length;t<o;++t)a=e[t][n.axis],ct(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(n){const e=this._cachedMeta,r=e.iScale,t=e.vScale,o=this.getParsed(n);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:t?""+t.getLabelForValue(o[t.axis]):""}}_update(n){const e=this._cachedMeta;this.update(n||"default"),e._clip=Fx(we(this.options.clip,Hx(e.xScale,e.yScale,this.getMaxOverflow())))}update(n){}draw(){const n=this._ctx,e=this.chart,r=this._cachedMeta,t=r.data||[],o=e.chartArea,a=[],s=this._drawStart||0,u=this._drawCount||t.length-s,c=this.options.drawActiveElementsOnTop;let M;for(r.dataset&&r.dataset.draw(n,o,s,u),M=s;M<s+u;++M){const d=t[M];d.hidden||(d.active&&c?a.push(d):d.draw(n,o))}for(M=0;M<a.length;++M)a[M].draw(n,o)}getStyle(n,e){const r=e?"active":"default";return n===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(n||0,r)}getContext(n,e,r){const t=this.getDataset();let o;if(n>=0&&n<this._cachedMeta.data.length){const a=this._cachedMeta.data[n];o=a.$context||(a.$context=eA(this.getContext(),n,a)),o.parsed=this.getParsed(n),o.raw=t.data[n],o.index=o.dataIndex=n}else o=this.$context||(this.$context=qx(this.chart.getContext(),this.index)),o.dataset=t,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=r,o}resolveDatasetElementOptions(n){return this._resolveElementOptions(this.datasetElementType.id,n)}resolveDataElementOptions(n,e){return this._resolveElementOptions(this.dataElementType.id,e,n)}_resolveElementOptions(n,e="default",r){const t=e==="active",o=this._cachedDataOpts,a=n+"-"+e,s=o[a],u=this.enableOptionSharing&&kt(r);if(s)return Ng(s,u);const c=this.chart.config,M=c.datasetElementScopeKeys(this._type,n),d=t?[`${n}Hover`,"hover",n,""]:[n,""],g=c.getOptionScopes(this.getDataset(),M),f=Object.keys(ke.elements[n]),j=()=>this.getContext(r,t),p=c.resolveNamedOptions(g,f,j,d);return p.$shared&&(p.$shared=u,o[a]=Object.freeze(Ng(p,u))),p}_resolveAnimations(n,e,r){const t=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,s=o[a];if(s)return s;let u;if(t.options.animation!==!1){const M=this.chart.config,d=M.datasetAnimationScopeKeys(this._type,e),g=M.getOptionScopes(this.getDataset(),d);u=M.createResolver(g,this.getContext(n,r,e))}const c=new lg(t,u&&u.animations);return u&&u._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(n){if(n.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},n))}includeOptions(n,e){return!e||el(n)||this.chart._animationsDisabled}_getSharedOptions(n,e){const r=this.resolveDataElementOptions(n,e),t=this._sharedOptions,o=this.getSharedOptions(r),a=this.includeOptions(e,o)||o!==t;return this.updateSharedOptions(o,e,r),{sharedOptions:o,includeOptions:a}}updateElement(n,e,r,t){el(t)?Object.assign(n,r):this._resolveAnimations(e,t).update(n,r)}updateSharedOptions(n,e,r){n&&!el(e)&&this._resolveAnimations(void 0,e).update(n,r)}_setStyle(n,e,r,t){n.active=t;const o=this.getStyle(e,t);this._resolveAnimations(e,r,t).update(n,{options:!t&&this.getSharedOptions(o)||o})}removeHoverStyle(n,e,r){this._setStyle(n,r,"active",!1)}setHoverStyle(n,e,r){this._setStyle(n,r,"active",!0)}_removeDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!1)}_setDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!0)}_resyncElements(n){const e=this._data,r=this._cachedMeta.data;for(const[s,u,c]of this._syncList)this[s](u,c);this._syncList=[];const t=r.length,o=e.length,a=Math.min(o,t);a&&this.parse(0,a),o>t?this._insertElements(t,o-t,n):o<t&&this._removeElements(o,t-o)}_insertElements(n,e,r=!0){const t=this._cachedMeta,o=t.data,a=n+e;let s;const u=c=>{for(c.length+=e,s=c.length-1;s>=a;s--)c[s]=c[s-e]};for(u(o),s=n;s<a;++s)o[s]=new this.dataElementType;this._parsing&&u(t._parsed),this.parse(n,e),r&&this.updateElements(o,n,e,"reset")}updateElements(n,e,r,t){}_removeElements(n,e){const r=this._cachedMeta;if(this._parsing){const t=r._parsed.splice(n,e);r._stacked&&Gi(r,t)}r.data.splice(n,e)}_sync(n){if(this._parsing)this._syncList.push(n);else{const[e,r,t]=n;this[e](r,t)}this.chart._dataChanges.push([this.index,...n])}_onDataPush(){const n=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-n,n])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(n,e){e&&this._sync(["_removeElements",n,e]);const r=arguments.length-2;r&&this._sync(["_insertElements",n,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Vt.defaults={},Vt.prototype.datasetElementType=null,Vt.prototype.dataElementType=null;function nA(i,n){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(n);let r=[];for(let t=0,o=e.length;t<o;t++)r=r.concat(e[t].controller.getAllParsedValues(i));i._cache.$bar=xd(r.sort((t,o)=>t-o))}return i._cache.$bar}function iA(i){const n=i.iScale,e=nA(n,i.type);let r=n._length,t,o,a,s;const u=()=>{a===32767||a===-32768||(kt(s)&&(r=Math.min(r,Math.abs(a-s)||r)),s=a)};for(t=0,o=e.length;t<o;++t)a=n.getPixelForValue(e[t]),u();for(s=void 0,t=0,o=n.ticks.length;t<o;++t)a=n.getPixelForTick(t),u();return r}function rA(i,n,e,r){const t=e.barThickness;let o,a;return Se(t)?(o=n.min*e.categoryPercentage,a=e.barPercentage):(o=t*r,a=1),{chunk:o/r,ratio:a,start:n.pixels[i]-o/2}}function oA(i,n,e,r){const t=n.pixels,o=t[i];let a=i>0?t[i-1]:null,s=i<t.length-1?t[i+1]:null;const u=e.categoryPercentage;a===null&&(a=o-(s===null?n.end-n.start:s-o)),s===null&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*u;return{chunk:Math.abs(s-a)/2*u/r,ratio:e.barPercentage,start:c}}function aA(i,n,e,r){const t=e.parse(i[0],r),o=e.parse(i[1],r),a=Math.min(t,o),s=Math.max(t,o);let u=a,c=s;Math.abs(a)>Math.abs(s)&&(u=s,c=a),n[e.axis]=c,n._custom={barStart:u,barEnd:c,start:t,end:o,min:a,max:s}}function jg(i,n,e,r){return Ge(i)?aA(i,n,e,r):n[e.axis]=e.parse(i,r),n}function hg(i,n,e,r){const t=i.iScale,o=i.vScale,a=t.getLabels(),s=t===o,u=[];let c,M,d,g;for(c=e,M=e+r;c<M;++c)g=n[c],d={},d[t.axis]=s||t.parse(a[c],c),u.push(jg(g,d,o,c));return u}function tl(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function sA(i,n,e){return i!==0?tn(i):(n.isHorizontal()?1:-1)*(n.min>=e?1:-1)}function uA(i){let n,e,r,t,o;return i.horizontal?(n=i.base>i.x,e="left",r="right"):(n=i.base<i.y,e="bottom",r="top"),n?(t="end",o="start"):(t="start",o="end"),{start:e,end:r,reverse:n,top:t,bottom:o}}function lA(i,n,e,r){let t=n.borderSkipped;const o={};if(!t){i.borderSkipped=o;return}if(t===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:s,reverse:u,top:c,bottom:M}=uA(i);t==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===r?t=c:(e._bottom||0)===r?t=M:(o[Ig(M,a,s,u)]=!0,t=c)),o[Ig(t,a,s,u)]=!0,i.borderSkipped=o}function Ig(i,n,e,r){return r?(i=cA(i,n,e),i=pg(i,e,n)):i=pg(i,n,e),i}function cA(i,n,e){return i===n?e:i===e?n:i}function pg(i,n,e){return i==="start"?n:i==="end"?e:i}function MA(i,{inflateAmount:n},e){i.inflateAmount=n==="auto"?e===1?.33:0:n}class la extends Vt{parsePrimitiveData(n,e,r,t){return hg(n,e,r,t)}parseArrayData(n,e,r,t){return hg(n,e,r,t)}parseObjectData(n,e,r,t){const{iScale:o,vScale:a}=n,{xAxisKey:s="x",yAxisKey:u="y"}=this._parsing,c=o.axis==="x"?s:u,M=a.axis==="x"?s:u,d=[];let g,f,j,p;for(g=r,f=r+t;g<f;++g)p=e[g],j={},j[o.axis]=o.parse(kn(p,c),g),d.push(jg(kn(p,M),j,a,g));return d}updateRangeFromParsed(n,e,r,t){super.updateRangeFromParsed(n,e,r,t);const o=r._custom;o&&e===this._cachedMeta.vScale&&(n.min=Math.min(n.min,o.min),n.max=Math.max(n.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(n){const e=this._cachedMeta,{iScale:r,vScale:t}=e,o=this.getParsed(n),a=o._custom,s=tl(a)?"["+a.start+", "+a.end+"]":""+t.getLabelForValue(o[t.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const n=this._cachedMeta;n.stack=this.getDataset().stack}update(n){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,n)}updateElements(n,e,r,t){const o=t==="reset",{index:a,_cachedMeta:{vScale:s}}=this,u=s.getBasePixel(),c=s.isHorizontal(),M=this._getRuler(),{sharedOptions:d,includeOptions:g}=this._getSharedOptions(e,t);for(let f=e;f<e+r;f++){const j=this.getParsed(f),p=o||Se(j[s.axis])?{base:u,head:u}:this._calculateBarValuePixels(f),x=this._calculateBarIndexPixels(f,M),N=(j._stacks||{})[s.axis],h={horizontal:c,base:p.base,enableBorderRadius:!N||tl(j._custom)||a===N._top||a===N._bottom,x:c?p.head:x.center,y:c?x.center:p.head,height:c?x.size:Math.abs(p.size),width:c?Math.abs(p.size):x.size};g&&(h.options=d||this.resolveDataElementOptions(f,n[f].active?"active":t));const z=h.options||n[f].options;lA(h,z,N,a),MA(h,z,M.ratio),this.updateElement(n[f],f,h,t)}}_getStacks(n,e){const{iScale:r}=this._cachedMeta,t=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,a=[],s=u=>{const c=u.controller.getParsed(e),M=c&&c[u.vScale.axis];if(Se(M)||isNaN(M))return!0};for(const u of t)if(!(e!==void 0&&s(u))&&((o===!1||a.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===n))break;return a.length||a.push(void 0),a}_getStackCount(n){return this._getStacks(void 0,n).length}_getStackIndex(n,e,r){const t=this._getStacks(n,r),o=e!==void 0?t.indexOf(e):-1;return o===-1?t.length-1:o}_getRuler(){const n=this.options,e=this._cachedMeta,r=e.iScale,t=[];let o,a;for(o=0,a=e.data.length;o<a;++o)t.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const s=n.barThickness;return{min:s||iA(e),pixels:t,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:n.grouped,ratio:s?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(n){const{_cachedMeta:{vScale:e,_stacked:r},options:{base:t,minBarLength:o}}=this,a=t||0,s=this.getParsed(n),u=s._custom,c=tl(u);let M=s[e.axis],d=0,g=r?this.applyStack(e,s,r):M,f,j;g!==M&&(d=g-M,g=M),c&&(M=u.barStart,g=u.barEnd-u.barStart,M!==0&&tn(M)!==tn(u.barEnd)&&(d=0),d+=M);const p=!Se(t)&&!c?t:d;let x=e.getPixelForValue(p);if(this.chart.getDataVisibility(n)?f=e.getPixelForValue(d+g):f=x,j=f-x,Math.abs(j)<o){j=sA(j,e,a)*o,M===a&&(x-=j/2);const N=e.getPixelForDecimal(0),h=e.getPixelForDecimal(1),z=Math.min(N,h),m=Math.max(N,h);x=Math.max(Math.min(x,m),z),f=x+j}if(x===e.getPixelForValue(a)){const N=tn(j)*e.getLineWidthForValue(a)/2;x+=N,j-=N}return{size:j,base:x,head:f,center:f+j/2}}_calculateBarIndexPixels(n,e){const r=e.scale,t=this.options,o=t.skipNull,a=we(t.maxBarThickness,1/0);let s,u;if(e.grouped){const c=o?this._getStackCount(n):e.stackCount,M=t.barThickness==="flex"?oA(n,e,t,c):rA(n,e,t,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,o?n:void 0);s=M.start+M.chunk*d+M.chunk/2,u=Math.min(a,M.chunk*M.ratio)}else s=r.getPixelForValue(this.getParsed(n)[r.axis],n),u=Math.min(a,e.min*e.ratio);return{base:s-u/2,head:s+u/2,center:s,size:u}}draw(){const n=this._cachedMeta,e=n.vScale,r=n.data,t=r.length;let o=0;for(;o<t;++o)this.getParsed(o)[e.axis]!==null&&r[o].draw(this._ctx)}}la.id="bar",la.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},la.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class nl extends Vt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(n,e,r,t){const o=super.parsePrimitiveData(n,e,r,t);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+r).radius;return o}parseArrayData(n,e,r,t){const o=super.parseArrayData(n,e,r,t);for(let a=0;a<o.length;a++){const s=e[r+a];o[a]._custom=we(s[2],this.resolveDataElementOptions(a+r).radius)}return o}parseObjectData(n,e,r,t){const o=super.parseObjectData(n,e,r,t);for(let a=0;a<o.length;a++){const s=e[r+a];o[a]._custom=we(s&&s.r&&+s.r,this.resolveDataElementOptions(a+r).radius)}return o}getMaxOverflow(){const n=this._cachedMeta.data;let e=0;for(let r=n.length-1;r>=0;--r)e=Math.max(e,n[r].size(this.resolveDataElementOptions(r))/2);return e>0&&e}getLabelAndValue(n){const e=this._cachedMeta,{xScale:r,yScale:t}=e,o=this.getParsed(n),a=r.getLabelForValue(o.x),s=t.getLabelForValue(o.y),u=o._custom;return{label:e.label,value:"("+a+", "+s+(u?", "+u:"")+")"}}update(n){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,n)}updateElements(n,e,r,t){const o=t==="reset",{iScale:a,vScale:s}=this._cachedMeta,{sharedOptions:u,includeOptions:c}=this._getSharedOptions(e,t),M=a.axis,d=s.axis;for(let g=e;g<e+r;g++){const f=n[g],j=!o&&this.getParsed(g),p={},x=p[M]=o?a.getPixelForDecimal(.5):a.getPixelForValue(j[M]),N=p[d]=o?s.getBasePixel():s.getPixelForValue(j[d]);p.skip=isNaN(x)||isNaN(N),c&&(p.options=u||this.resolveDataElementOptions(g,f.active?"active":t),o&&(p.options.radius=0)),this.updateElement(f,g,p,t)}}resolveDataElementOptions(n,e){const r=this.getParsed(n);let t=super.resolveDataElementOptions(n,e);t.$shared&&(t=Object.assign({},t,{$shared:!1}));const o=t.radius;return e!=="active"&&(t.radius=0),t.radius+=we(r&&r._custom,o),t}}nl.id="bubble",nl.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},nl.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function dA(i,n,e){let r=1,t=1,o=0,a=0;if(n<Pe){const s=i,u=s+n,c=Math.cos(s),M=Math.sin(s),d=Math.cos(u),g=Math.sin(u),f=(z,m,I)=>Ui(z,s,u,!0)?1:Math.max(m,m*e,I,I*e),j=(z,m,I)=>Ui(z,s,u,!0)?-1:Math.min(m,m*e,I,I*e),p=f(0,c,d),x=f(et,M,g),N=j(qe,c,d),h=j(qe+et,M,g);r=(p-N)/2,t=(x-h)/2,o=-(p+N)/2,a=-(x+h)/2}return{ratioX:r,ratioY:t,offsetX:o,offsetY:a}}class Wi extends Vt{constructor(n,e){super(n,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(n,e){const r=this.getDataset().data,t=this._cachedMeta;if(this._parsing===!1)t._parsed=r;else{let o=u=>+r[u];if(be(r[n])){const{key:u="value"}=this._parsing;o=c=>+kn(r[c],u)}let a,s;for(a=n,s=n+e;a<s;++a)t._parsed[a]=o(a)}}_getRotation(){return Rt(this.options.rotation-90)}_getCircumference(){return Rt(this.options.circumference)}_getRotationExtents(){let n=Pe,e=-Pe;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)){const t=this.chart.getDatasetMeta(r).controller,o=t._getRotation(),a=t._getCircumference();n=Math.min(n,o),e=Math.max(e,o+a)}return{rotation:n,circumference:e-n}}update(n){const e=this.chart,{chartArea:r}=e,t=this._cachedMeta,o=t.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-a)/2,0),u=Math.min(iz(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:M,rotation:d}=this._getRotationExtents(),{ratioX:g,ratioY:f,offsetX:j,offsetY:p}=dA(d,M,u),x=(r.width-a)/g,N=(r.height-a)/f,h=Math.max(Math.min(x,N)/2,0),z=gd(this.options.radius,h),m=Math.max(z*u,0),I=(z-m)/this._getVisibleDatasetWeightTotal();this.offsetX=j*z,this.offsetY=p*z,t.total=this.calculateTotal(),this.outerRadius=z-I*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-I*c,0),this.updateElements(o,0,o.length,n)}_circumference(n,e){const r=this.options,t=this._cachedMeta,o=this._getCircumference();return e&&r.animation.animateRotate||!this.chart.getDataVisibility(n)||t._parsed[n]===null||t.data[n].hidden?0:this.calculateCircumference(t._parsed[n]*o/Pe)}updateElements(n,e,r,t){const o=t==="reset",a=this.chart,s=a.chartArea,c=a.options.animation,M=(s.left+s.right)/2,d=(s.top+s.bottom)/2,g=o&&c.animateScale,f=g?0:this.innerRadius,j=g?0:this.outerRadius,{sharedOptions:p,includeOptions:x}=this._getSharedOptions(e,t);let N=this._getRotation(),h;for(h=0;h<e;++h)N+=this._circumference(h,o);for(h=e;h<e+r;++h){const z=this._circumference(h,o),m=n[h],I={x:M+this.offsetX,y:d+this.offsetY,startAngle:N,endAngle:N+z,circumference:z,outerRadius:j,innerRadius:f};x&&(I.options=p||this.resolveDataElementOptions(h,m.active?"active":t)),N+=z,this.updateElement(m,h,I,t)}}calculateTotal(){const n=this._cachedMeta,e=n.data;let r=0,t;for(t=0;t<e.length;t++){const o=n._parsed[t];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(t)&&!e[t].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(n){const e=this._cachedMeta.total;return e>0&&!isNaN(n)?Pe*(Math.abs(n)/e):0}getLabelAndValue(n){const e=this._cachedMeta,r=this.chart,t=r.data.labels||[],o=Vi(e._parsed[n],r.options.locale);return{label:t[n]||"",value:o}}getMaxBorderWidth(n){let e=0;const r=this.chart;let t,o,a,s,u;if(!n){for(t=0,o=r.data.datasets.length;t<o;++t)if(r.isDatasetVisible(t)){a=r.getDatasetMeta(t),n=a.data,s=a.controller;break}}if(!n)return 0;for(t=0,o=n.length;t<o;++t)u=s.resolveDataElementOptions(t),u.borderAlign!=="inner"&&(e=Math.max(e,u.borderWidth||0,u.hoverBorderWidth||0));return e}getMaxOffset(n){let e=0;for(let r=0,t=n.length;r<t;++r){const o=this.resolveDataElementOptions(r);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(n){let e=0;for(let r=0;r<n;++r)this.chart.isDatasetVisible(r)&&(e+=this._getRingWeight(r));return e}_getRingWeight(n){return Math.max(we(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Wi.id="doughnut",Wi.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"},Wi.descriptors={_scriptable:i=>i!=="spacing",_indexable:i=>i!=="spacing"},Wi.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const n=i.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return n.labels.map((r,t)=>{const a=i.getDatasetMeta(0).controller.getStyle(t);return{text:r,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(t),index:t}})}return[]}},onClick(i,n,e){e.chart.toggleDataVisibility(n.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let n=i.label;const e=": "+i.formattedValue;return Ge(n)?(n=n.slice(),n[0]+=e):n+=e,n}}}}};class il extends Vt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(n){const e=this._cachedMeta,{dataset:r,data:t=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:s,count:u}=vd(e,t,a);this._drawStart=s,this._drawCount=u,kd(e)&&(s=0,u=t.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=t;const c=this.resolveDatasetElementOptions(n);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:c},n),this.updateElements(t,s,u,n)}updateElements(n,e,r,t){const o=t==="reset",{iScale:a,vScale:s,_stacked:u,_dataset:c}=this._cachedMeta,{sharedOptions:M,includeOptions:d}=this._getSharedOptions(e,t),g=a.axis,f=s.axis,{spanGaps:j,segment:p}=this.options,x=fi(j)?j:Number.POSITIVE_INFINITY,N=this.chart._animationsDisabled||o||t==="none";let h=e>0&&this.getParsed(e-1);for(let z=e;z<e+r;++z){const m=n[z],I=this.getParsed(z),D=N?m:{},v=Se(I[f]),L=D[g]=a.getPixelForValue(I[g],z),w=D[f]=o||v?s.getBasePixel():s.getPixelForValue(u?this.applyStack(s,I,u):I[f],z);D.skip=isNaN(L)||isNaN(w)||v,D.stop=z>0&&Math.abs(I[g]-h[g])>x,p&&(D.parsed=I,D.raw=c.data[z]),d&&(D.options=M||this.resolveDataElementOptions(z,m.active?"active":t)),N||this.updateElement(m,z,D,t),h=I}}getMaxOverflow(){const n=this._cachedMeta,e=n.dataset,r=e.options&&e.options.borderWidth||0,t=n.data||[];if(!t.length)return r;const o=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,o,a)/2}draw(){const n=this._cachedMeta;n.dataset.updateControlPoints(this.chart.chartArea,n.iScale.axis),super.draw()}}il.id="line",il.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},il.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class rl extends Vt{constructor(n,e){super(n,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(n){const e=this._cachedMeta,r=this.chart,t=r.data.labels||[],o=Vi(e._parsed[n].r,r.options.locale);return{label:t[n]||"",value:o}}parseObjectData(n,e,r,t){return Kd.bind(this)(n,e,r,t)}update(n){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,n)}getMinMax(){const n=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return n.data.forEach((r,t)=>{const o=this.getParsed(t).r;!isNaN(o)&&this.chart.getDataVisibility(t)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const n=this.chart,e=n.chartArea,r=n.options,t=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(t/2,0),a=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),s=(o-a)/n.getVisibleDatasetCount();this.outerRadius=o-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(n,e,r,t){const o=t==="reset",a=this.chart,u=a.options.animation,c=this._cachedMeta.rScale,M=c.xCenter,d=c.yCenter,g=c.getIndexAngle(0)-.5*qe;let f=g,j;const p=360/this.countVisibleElements();for(j=0;j<e;++j)f+=this._computeAngle(j,t,p);for(j=e;j<e+r;j++){const x=n[j];let N=f,h=f+this._computeAngle(j,t,p),z=a.getDataVisibility(j)?c.getDistanceFromCenterForValue(this.getParsed(j).r):0;f=h,o&&(u.animateScale&&(z=0),u.animateRotate&&(N=h=g));const m={x:M,y:d,innerRadius:0,outerRadius:z,startAngle:N,endAngle:h,options:this.resolveDataElementOptions(j,x.active?"active":t)};this.updateElement(x,j,m,t)}}countVisibleElements(){const n=this._cachedMeta;let e=0;return n.data.forEach((r,t)=>{!isNaN(this.getParsed(t).r)&&this.chart.getDataVisibility(t)&&e++}),e}_computeAngle(n,e,r){return this.chart.getDataVisibility(n)?Rt(this.resolveDataElementOptions(n,e).angle||r):0}}rl.id="polarArea",rl.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},rl.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const n=i.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return n.labels.map((r,t)=>{const a=i.getDatasetMeta(0).controller.getStyle(t);return{text:r,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(t),index:t}})}return[]}},onClick(i,n,e){e.chart.toggleDataVisibility(n.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Dg extends Wi{}Dg.id="pie",Dg.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class ol extends Vt{getLabelAndValue(n){const e=this._cachedMeta.vScale,r=this.getParsed(n);return{label:e.getLabels()[n],value:""+e.getLabelForValue(r[e.axis])}}parseObjectData(n,e,r,t){return Kd.bind(this)(n,e,r,t)}update(n){const e=this._cachedMeta,r=e.dataset,t=e.data||[],o=e.iScale.getLabels();if(r.points=t,n!=="resize"){const a=this.resolveDatasetElementOptions(n);this.options.showLine||(a.borderWidth=0);const s={_loop:!0,_fullLoop:o.length===t.length,options:a};this.updateElement(r,void 0,s,n)}this.updateElements(t,0,t.length,n)}updateElements(n,e,r,t){const o=this._cachedMeta.rScale,a=t==="reset";for(let s=e;s<e+r;s++){const u=n[s],c=this.resolveDataElementOptions(s,u.active?"active":t),M=o.getPointPositionForValue(s,this.getParsed(s).r),d=a?o.xCenter:M.x,g=a?o.yCenter:M.y,f={x:d,y:g,angle:M.angle,skip:isNaN(d)||isNaN(g),options:c};this.updateElement(u,s,f,t)}}}ol.id="radar",ol.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},ol.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};let jn=class{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(n){const{x:e,y:r}=this.getProps(["x","y"],n);return{x:e,y:r}}hasValue(){return fi(this.x)&&fi(this.y)}getProps(n,e){const r=this.$animations;if(!e||!r)return this;const t={};return n.forEach(o=>{t[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),t}};jn.defaults={},jn.defaultRoutes=void 0;const mg={values(i){return Ge(i)?i:""+i},numeric(i,n,e){if(i===0)return"0";const r=this.chart.options.locale;let t,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)&&(t="scientific"),o=gA(i,e)}const a=bt(Math.abs(o)),s=Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:t,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(u,this.options.ticks.format),Vi(i,r,u)},logarithmic(i,n,e){if(i===0)return"0";const r=i/Math.pow(10,Math.floor(bt(i)));return r===1||r===2||r===5?mg.numeric.call(this,i,n,e):""}};function gA(i,n){let e=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var ca={formatters:mg};ke.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,n)=>n.lineWidth,tickColor:(i,n)=>n.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:ca.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ke.route("scale.ticks","color","","color"),ke.route("scale.grid","color","","borderColor"),ke.route("scale.grid","borderColor","","borderColor"),ke.route("scale.title","color","","color"),ke.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"}),ke.describe("scales",{_fallback:"scale"}),ke.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function fA(i,n){const e=i.options.ticks,r=e.maxTicksLimit||yA(i),t=e.major.enabled?jA(n):[],o=t.length,a=t[0],s=t[o-1],u=[];if(o>r)return hA(n,u,t,o/r),u;const c=NA(t,n,r);if(o>0){let M,d;const g=o>1?Math.round((s-a)/(o-1)):null;for(Ma(n,u,c,Se(g)?0:a-g,a),M=0,d=o-1;M<d;M++)Ma(n,u,c,t[M],t[M+1]);return Ma(n,u,c,s,Se(g)?n.length:s+g),u}return Ma(n,u,c),u}function yA(i){const n=i.options.offset,e=i._tickSize(),r=i._length/e+(n?0:1),t=i._maxLength/e;return Math.floor(Math.min(r,t))}function NA(i,n,e){const r=IA(i),t=n.length/e;if(!r)return Math.max(t,1);const o=Mz(r);for(let a=0,s=o.length-1;a<s;a++){const u=o[a];if(u>t)return u}return Math.max(t,1)}function jA(i){const n=[];let e,r;for(e=0,r=i.length;e<r;e++)i[e].major&&n.push(e);return n}function hA(i,n,e,r){let t=0,o=e[0],a;for(r=Math.ceil(r),a=0;a<i.length;a++)a===o&&(n.push(i[a]),t++,o=e[t*r])}function Ma(i,n,e,r,t){const o=we(r,0),a=Math.min(we(t,i.length),i.length);let s=0,u,c,M;for(e=Math.ceil(e),t&&(u=t-r,e=u/Math.floor(u/e)),M=o;M<0;)s++,M=Math.round(o+s*e);for(c=Math.max(o,0);c<a;c++)c===M&&(n.push(i[c]),s++,M=Math.round(o+s*e))}function IA(i){const n=i.length;let e,r;if(n<2)return!1;for(r=i[0],e=1;e<n;++e)if(i[e]-i[e-1]!==r)return!1;return r}const pA=i=>i==="left"?"right":i==="right"?"left":i,zg=(i,n,e)=>n==="top"||n==="left"?i[n]+e:i[n]-e;function xg(i,n){const e=[],r=i.length/n,t=i.length;let o=0;for(;o<t;o+=r)e.push(i[Math.floor(o)]);return e}function DA(i,n,e){const r=i.ticks.length,t=Math.min(n,r-1),o=i._startPixel,a=i._endPixel,s=1e-6;let u=i.getPixelForTick(t),c;if(!(e&&(r===1?c=Math.max(u-o,a-u):n===0?c=(i.getPixelForTick(1)-u)/2:c=(u-i.getPixelForTick(t-1))/2,u+=t<n?c:-c,u<o-s||u>a+s)))return u}function mA(i,n){Ye(i,e=>{const r=e.gc,t=r.length/2;let o;if(t>n){for(o=0;o<t;++o)delete e.data[r[o]];r.splice(0,t)}})}function Hi(i){return i.drawTicks?i.tickLength:0}function Ag(i,n){if(!i.display)return 0;const e=xt(i.font,n),r=Ot(i.padding);return(Ge(i.text)?i.text.length:1)*e.lineHeight+r.height}function zA(i,n){return En(i,{scale:n,type:"scale"})}function xA(i,n,e){return En(i,{tick:e,index:n,type:"tick"})}function AA(i,n,e){let r=Iz(i);return(e&&n!=="right"||!e&&n==="right")&&(r=pA(r)),r}function TA(i,n,e,r){const{top:t,left:o,bottom:a,right:s,chart:u}=i,{chartArea:c,scales:M}=u;let d=0,g,f,j;const p=a-t,x=s-o;if(i.isHorizontal()){if(f=Ld(r,o,s),be(e)){const N=Object.keys(e)[0],h=e[N];j=M[N].getPixelForValue(h)+p-n}else e==="center"?j=(c.bottom+c.top)/2+p-n:j=zg(i,e,n);g=s-o}else{if(be(e)){const N=Object.keys(e)[0],h=e[N];f=M[N].getPixelForValue(h)-x+n}else e==="center"?f=(c.left+c.right)/2-x+n:f=zg(i,e,n);j=Ld(r,a,t),d=e==="left"?-et:et}return{titleX:f,titleY:j,maxWidth:g,rotation:d}}class ti extends jn{constructor(n){super(),this.id=n.id,this.type=n.type,this.options=void 0,this.ctx=n.ctx,this.chart=n.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(n){this.options=n.setContext(this.getContext()),this.axis=n.axis,this._userMin=this.parse(n.min),this._userMax=this.parse(n.max),this._suggestedMin=this.parse(n.suggestedMin),this._suggestedMax=this.parse(n.suggestedMax)}parse(n,e){return n}getUserBounds(){let{_userMin:n,_userMax:e,_suggestedMin:r,_suggestedMax:t}=this;return n=vt(n,Number.POSITIVE_INFINITY),e=vt(e,Number.NEGATIVE_INFINITY),r=vt(r,Number.POSITIVE_INFINITY),t=vt(t,Number.NEGATIVE_INFINITY),{min:vt(n,r),max:vt(e,t),minDefined:ct(n),maxDefined:ct(e)}}getMinMax(n){let{min:e,max:r,minDefined:t,maxDefined:o}=this.getUserBounds(),a;if(t&&o)return{min:e,max:r};const s=this.getMatchingVisibleMetas();for(let u=0,c=s.length;u<c;++u)a=s[u].controller.getMinMax(this,n),t||(e=Math.min(e,a.min)),o||(r=Math.max(r,a.max));return e=o&&e>r?r:e,r=t&&e>r?e:r,{min:vt(e,vt(r,e)),max:vt(r,vt(e,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const n=this.chart.data;return this.options.labels||(this.isHorizontal()?n.xLabels:n.yLabels)||n.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ke(this.options.beforeUpdate,[this])}update(n,e,r){const{beginAtZero:t,grace:o,ticks:a}=this.options,s=a.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=e,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ex(this,o,t),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=s<this.ticks.length;this._convertTicksToLabels(u?xg(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=fA(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),u&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let n=this.options.reverse,e,r;this.isHorizontal()?(e=this.left,r=this.right):(e=this.top,r=this.bottom,n=!n),this._startPixel=e,this._endPixel=r,this._reversePixels=n,this._length=r-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ke(this.options.afterUpdate,[this])}beforeSetDimensions(){Ke(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Ke(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),Ke(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ke(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){const e=this.options.ticks;let r,t,o;for(r=0,t=n.length;r<t;r++)o=n[r],o.label=Ke(e.callback,[o.value,r,n],this)}afterTickToLabelConversion(){Ke(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ke(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,e=n.ticks,r=this.ticks.length,t=e.minRotation||0,o=e.maxRotation;let a=t,s,u,c;if(!this._isVisible()||!e.display||t>=o||r<=1||!this.isHorizontal()){this.labelRotation=t;return}const M=this._getLabelSizes(),d=M.widest.width,g=M.highest.height,f=gt(this.chart.width-d,0,this.maxWidth);s=n.offset?this.maxWidth/r:f/(r-1),d+6>s&&(s=f/(r-(n.offset?.5:1)),u=this.maxHeight-Hi(n.grid)-e.padding-Ag(n.title,this.chart.options.font),c=Math.sqrt(d*d+g*g),a=Cu(Math.min(Math.asin(gt((M.highest.height+6)/s,-1,1)),Math.asin(gt(u/c,-1,1))-Math.asin(gt(g/c,-1,1)))),a=Math.max(t,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){Ke(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ke(this.options.beforeFit,[this])}fit(){const n={width:0,height:0},{chart:e,options:{ticks:r,title:t,grid:o}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){const u=Ag(t,e.options.font);if(s?(n.width=this.maxWidth,n.height=Hi(o)+u):(n.height=this.maxHeight,n.width=Hi(o)+u),r.display&&this.ticks.length){const{first:c,last:M,widest:d,highest:g}=this._getLabelSizes(),f=r.padding*2,j=Rt(this.labelRotation),p=Math.cos(j),x=Math.sin(j);if(s){const N=r.mirror?0:x*d.width+p*g.height;n.height=Math.min(this.maxHeight,n.height+N+f)}else{const N=r.mirror?0:p*d.width+x*g.height;n.width=Math.min(this.maxWidth,n.width+N+f)}this._calculatePadding(c,M,x,p)}}this._handleMargins(),s?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=n.height):(this.width=n.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(n,e,r,t){const{ticks:{align:o,padding:a},position:s}=this.options,u=this.labelRotation!==0,c=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const M=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,f=0;u?c?(g=t*n.width,f=r*e.height):(g=r*n.height,f=t*e.width):o==="start"?f=e.width:o==="end"?g=n.width:o!=="inner"&&(g=n.width/2,f=e.width/2),this.paddingLeft=Math.max((g-M+a)*this.width/(this.width-M),0),this.paddingRight=Math.max((f-d+a)*this.width/(this.width-d),0)}else{let M=e.height/2,d=n.height/2;o==="start"?(M=0,d=n.height):o==="end"&&(M=e.height,d=0),this.paddingTop=M+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(){Ke(this.options.afterFit,[this])}isHorizontal(){const{axis:n,position:e}=this.options;return e==="top"||e==="bottom"||n==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(n){this.beforeTickToLabelConversion(),this.generateTickLabels(n);let e,r;for(e=0,r=n.length;e<r;e++)Se(n[e].label)&&(n.splice(e,1),r--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){const e=this.options.ticks.sampleSize;let r=this.ticks;e<r.length&&(r=xg(r,e)),this._labelSizes=n=this._computeLabelSizes(r,r.length)}return n}_computeLabelSizes(n,e){const{ctx:r,_longestTextCache:t}=this,o=[],a=[];let s=0,u=0,c,M,d,g,f,j,p,x,N,h,z;for(c=0;c<e;++c){if(g=n[c].label,f=this._resolveTickFontOptions(c),r.font=j=f.string,p=t[j]=t[j]||{data:{},gc:[]},x=f.lineHeight,N=h=0,!Se(g)&&!Ge(g))N=na(r,p.data,p.gc,N,g),h=x;else if(Ge(g))for(M=0,d=g.length;M<d;++M)z=g[M],!Se(z)&&!Ge(z)&&(N=na(r,p.data,p.gc,N,z),h+=x);o.push(N),a.push(h),s=Math.max(N,s),u=Math.max(h,u)}mA(t,e);const m=o.indexOf(s),I=a.indexOf(u),D=v=>({width:o[v]||0,height:a[v]||0});return{first:D(0),last:D(e-1),widest:D(m),highest:D(I),widths:o,heights:a}}getLabelForValue(n){return n}getPixelForValue(n,e){return NaN}getValueForPixel(n){}getPixelForTick(n){const e=this.ticks;return n<0||n>e.length-1?null:this.getPixelForValue(e[n].value)}getPixelForDecimal(n){this._reversePixels&&(n=1-n);const e=this._startPixel+n*this._length;return fz(this._alignToPixels?Xn(this.chart,e,0):e)}getDecimalForPixel(n){const e=(n-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:n,max:e}=this;return n<0&&e<0?e:n>0&&e>0?n:0}getContext(n){const e=this.ticks||[];if(n>=0&&n<e.length){const r=e[n];return r.$context||(r.$context=xA(this.getContext(),n,r))}return this.$context||(this.$context=zA(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,e=Rt(this.labelRotation),r=Math.abs(Math.cos(e)),t=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=n.autoSkipPadding||0,s=o?o.widest.width+a:0,u=o?o.highest.height+a:0;return this.isHorizontal()?u*r>s*t?s/r:u/t:u*t<s*r?u/r:s/t}_isVisible(){const n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){const e=this.axis,r=this.chart,t=this.options,{grid:o,position:a}=t,s=o.offset,u=this.isHorizontal(),M=this.ticks.length+(s?1:0),d=Hi(o),g=[],f=o.setContext(this.getContext()),j=f.drawBorder?f.borderWidth:0,p=j/2,x=function(b){return Xn(r,b,j)};let N,h,z,m,I,D,v,L,w,E,T,y;if(a==="top")N=x(this.bottom),D=this.bottom-d,L=N-p,E=x(n.top)+p,y=n.bottom;else if(a==="bottom")N=x(this.top),E=n.top,y=x(n.bottom)-p,D=N+p,L=this.top+d;else if(a==="left")N=x(this.right),I=this.right-d,v=N-p,w=x(n.left)+p,T=n.right;else if(a==="right")N=x(this.left),w=n.left,T=x(n.right)-p,I=N+p,v=this.left+d;else if(e==="x"){if(a==="center")N=x((n.top+n.bottom)/2+.5);else if(be(a)){const b=Object.keys(a)[0],C=a[b];N=x(this.chart.scales[b].getPixelForValue(C))}E=n.top,y=n.bottom,D=N+p,L=D+d}else if(e==="y"){if(a==="center")N=x((n.left+n.right)/2);else if(be(a)){const b=Object.keys(a)[0],C=a[b];N=x(this.chart.scales[b].getPixelForValue(C))}I=N-p,v=I-d,w=n.left,T=n.right}const A=we(t.ticks.maxTicksLimit,M),k=Math.max(1,Math.ceil(M/A));for(h=0;h<M;h+=k){const b=o.setContext(this.getContext(h)),C=b.lineWidth,S=b.color,O=b.borderDash||[],Q=b.borderDashOffset,_=b.tickWidth,U=b.tickColor,Y=b.tickBorderDash||[],B=b.tickBorderDashOffset;z=DA(this,h,s),z!==void 0&&(m=Xn(r,z,C),u?I=v=w=T=m:D=L=E=y=m,g.push({tx1:I,ty1:D,tx2:v,ty2:L,x1:w,y1:E,x2:T,y2:y,width:C,color:S,borderDash:O,borderDashOffset:Q,tickWidth:_,tickColor:U,tickBorderDash:Y,tickBorderDashOffset:B}))}return this._ticksLength=M,this._borderValue=N,g}_computeLabelItems(n){const e=this.axis,r=this.options,{position:t,ticks:o}=r,a=this.isHorizontal(),s=this.ticks,{align:u,crossAlign:c,padding:M,mirror:d}=o,g=Hi(r.grid),f=g+M,j=d?-M:f,p=-Rt(this.labelRotation),x=[];let N,h,z,m,I,D,v,L,w,E,T,y,A="middle";if(t==="top")D=this.bottom-j,v=this._getXAxisLabelAlignment();else if(t==="bottom")D=this.top+j,v=this._getXAxisLabelAlignment();else if(t==="left"){const b=this._getYAxisLabelAlignment(g);v=b.textAlign,I=b.x}else if(t==="right"){const b=this._getYAxisLabelAlignment(g);v=b.textAlign,I=b.x}else if(e==="x"){if(t==="center")D=(n.top+n.bottom)/2+f;else if(be(t)){const b=Object.keys(t)[0],C=t[b];D=this.chart.scales[b].getPixelForValue(C)+f}v=this._getXAxisLabelAlignment()}else if(e==="y"){if(t==="center")I=(n.left+n.right)/2-f;else if(be(t)){const b=Object.keys(t)[0],C=t[b];I=this.chart.scales[b].getPixelForValue(C)}v=this._getYAxisLabelAlignment(g).textAlign}e==="y"&&(u==="start"?A="top":u==="end"&&(A="bottom"));const k=this._getLabelSizes();for(N=0,h=s.length;N<h;++N){z=s[N],m=z.label;const b=o.setContext(this.getContext(N));L=this.getPixelForTick(N)+o.labelOffset,w=this._resolveTickFontOptions(N),E=w.lineHeight,T=Ge(m)?m.length:1;const C=T/2,S=b.color,O=b.textStrokeColor,Q=b.textStrokeWidth;let _=v;a?(I=L,v==="inner"&&(N===h-1?_=this.options.reverse?"left":"right":N===0?_=this.options.reverse?"right":"left":_="center"),t==="top"?c==="near"||p!==0?y=-T*E+E/2:c==="center"?y=-k.highest.height/2-C*E+E:y=-k.highest.height+E/2:c==="near"||p!==0?y=E/2:c==="center"?y=k.highest.height/2-C*E:y=k.highest.height-T*E,d&&(y*=-1)):(D=L,y=(1-T)*E/2);let U;if(b.showLabelBackdrop){const Y=Ot(b.backdropPadding),B=k.heights[N],Z=k.widths[N];let P=D+y-Y.top,R=I-Y.left;switch(A){case"middle":P-=B/2;break;case"bottom":P-=B;break}switch(v){case"center":R-=Z/2;break;case"right":R-=Z;break}U={left:R,top:P,width:Z+Y.width,height:B+Y.height,color:b.backdropColor}}x.push({rotation:p,label:m,font:w,color:S,strokeColor:O,strokeWidth:Q,textOffset:y,textAlign:_,textBaseline:A,translation:[I,D],backdrop:U})}return x}_getXAxisLabelAlignment(){const{position:n,ticks:e}=this.options;if(-Rt(this.labelRotation))return n==="top"?"left":"right";let t="center";return e.align==="start"?t="left":e.align==="end"?t="right":e.align==="inner"&&(t="inner"),t}_getYAxisLabelAlignment(n){const{position:e,ticks:{crossAlign:r,mirror:t,padding:o}}=this.options,a=this._getLabelSizes(),s=n+o,u=a.widest.width;let c,M;return e==="left"?t?(M=this.right+o,r==="near"?c="left":r==="center"?(c="center",M+=u/2):(c="right",M+=u)):(M=this.right-s,r==="near"?c="right":r==="center"?(c="center",M-=u/2):(c="left",M=this.left)):e==="right"?t?(M=this.left+o,r==="near"?c="right":r==="center"?(c="center",M-=u/2):(c="left",M-=u)):(M=this.left+s,r==="near"?c="left":r==="center"?(c="center",M+=u/2):(c="right",M=this.right)):c="right",{textAlign:c,x:M}}_computeLabelArea(){if(this.options.ticks.mirror)return;const n=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:n.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:n.width}}drawBackground(){const{ctx:n,options:{backgroundColor:e},left:r,top:t,width:o,height:a}=this;e&&(n.save(),n.fillStyle=e,n.fillRect(r,t,o,a),n.restore())}getLineWidthForValue(n){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const t=this.ticks.findIndex(o=>o.value===n);return t>=0?e.setContext(this.getContext(t)).lineWidth:0}drawGrid(n){const e=this.options.grid,r=this.ctx,t=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n));let o,a;const s=(u,c,M)=>{!M.width||!M.color||(r.save(),r.lineWidth=M.width,r.strokeStyle=M.color,r.setLineDash(M.borderDash||[]),r.lineDashOffset=M.borderDashOffset,r.beginPath(),r.moveTo(u.x,u.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(e.display)for(o=0,a=t.length;o<a;++o){const u=t[o];e.drawOnChartArea&&s({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),e.drawTicks&&s({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}drawBorder(){const{chart:n,ctx:e,options:{grid:r}}=this,t=r.setContext(this.getContext()),o=r.drawBorder?t.borderWidth:0;if(!o)return;const a=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let u,c,M,d;this.isHorizontal()?(u=Xn(n,this.left,o)-o/2,c=Xn(n,this.right,a)+a/2,M=d=s):(M=Xn(n,this.top,o)-o/2,d=Xn(n,this.bottom,a)+a/2,u=c=s),e.save(),e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,e.beginPath(),e.moveTo(u,M),e.lineTo(c,d),e.stroke(),e.restore()}drawLabels(n){if(!this.options.ticks.display)return;const r=this.ctx,t=this._computeLabelArea();t&&Zd(r,t);const o=this._labelItems||(this._labelItems=this._computeLabelItems(n));let a,s;for(a=0,s=o.length;a<s;++a){const u=o[a],c=u.font,M=u.label;u.backdrop&&(r.fillStyle=u.backdrop.color,r.fillRect(u.backdrop.left,u.backdrop.top,u.backdrop.width,u.backdrop.height));let d=u.textOffset;ia(r,M,0,d,c,u)}t&&Vd(r)}drawTitle(){const{ctx:n,options:{position:e,title:r,reverse:t}}=this;if(!r.display)return;const o=xt(r.font),a=Ot(r.padding),s=r.align;let u=o.lineHeight/2;e==="bottom"||e==="center"||be(e)?(u+=a.bottom,Ge(r.text)&&(u+=o.lineHeight*(r.text.length-1))):u+=a.top;const{titleX:c,titleY:M,maxWidth:d,rotation:g}=TA(this,u,e,s);ia(n,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:g,textAlign:AA(s,e,t),textBaseline:"middle",translation:[c,M]})}draw(n){this._isVisible()&&(this.drawBackground(),this.drawGrid(n),this.drawBorder(),this.drawTitle(),this.drawLabels(n))}_layers(){const n=this.options,e=n.ticks&&n.ticks.z||0,r=we(n.grid&&n.grid.z,-1);return!this._isVisible()||this.draw!==ti.prototype.draw?[{z:e,draw:t=>{this.draw(t)}}]:[{z:r,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:r+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]}getMatchingVisibleMetas(n){const e=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",t=[];let o,a;for(o=0,a=e.length;o<a;++o){const s=e[o];s[r]===this.id&&(!n||s.type===n)&&t.push(s)}return t}_resolveTickFontOptions(n){const e=this.options.ticks.setContext(this.getContext(n));return xt(e.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class da{constructor(n,e,r){this.type=n,this.scope=e,this.override=r,this.items=Object.create(null)}isForType(n){return Object.prototype.isPrototypeOf.call(this.type.prototype,n.prototype)}register(n){const e=Object.getPrototypeOf(n);let r;kA(e)&&(r=this.register(e));const t=this.items,o=n.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+n);return o in t||(t[o]=n,LA(n,a,r),this.override&&ke.override(n.id,n.overrides)),a}get(n){return this.items[n]}unregister(n){const e=this.items,r=n.id,t=this.scope;r in e&&delete e[r],t&&r in ke[t]&&(delete ke[t][r],this.override&&delete Jn[r])}}function LA(i,n,e){const r=Ci(Object.create(null),[e?ke.get(e):{},ke.get(n),i.defaults]);ke.set(n,r),i.defaultRoutes&&vA(n,i.defaultRoutes),i.descriptors&&ke.describe(n,i.descriptors)}function vA(i,n){Object.keys(n).forEach(e=>{const r=e.split("."),t=r.pop(),o=[i].concat(r).join("."),a=n[e].split("."),s=a.pop(),u=a.join(".");ke.route(o,t,u,s)})}function kA(i){return"id"in i&&"defaults"in i}class bA{constructor(){this.controllers=new da(Vt,"datasets",!0),this.elements=new da(jn,"elements"),this.plugins=new da(Object,"plugins"),this.scales=new da(ti,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...n){this._each("register",n)}remove(...n){this._each("unregister",n)}addControllers(...n){this._each("register",n,this.controllers)}addElements(...n){this._each("register",n,this.elements)}addPlugins(...n){this._each("register",n,this.plugins)}addScales(...n){this._each("register",n,this.scales)}getController(n){return this._get(n,this.controllers,"controller")}getElement(n){return this._get(n,this.elements,"element")}getPlugin(n){return this._get(n,this.plugins,"plugin")}getScale(n){return this._get(n,this.scales,"scale")}removeControllers(...n){this._each("unregister",n,this.controllers)}removeElements(...n){this._each("unregister",n,this.elements)}removePlugins(...n){this._each("unregister",n,this.plugins)}removeScales(...n){this._each("unregister",n,this.scales)}_each(n,e,r){[...e].forEach(t=>{const o=r||this._getRegistryForType(t);r||o.isForType(t)||o===this.plugins&&t.id?this._exec(n,o,t):Ye(t,a=>{const s=r||this._getRegistryForType(a);this._exec(n,s,a)})})}_exec(n,e,r){const t=Eu(n);Ke(r["before"+t],[],r),e[n](r),Ke(r["after"+t],[],r)}_getRegistryForType(n){for(let e=0;e<this._typedRegistries.length;e++){const r=this._typedRegistries[e];if(r.isForType(n))return r}return this.plugins}_get(n,e,r){const t=e.get(n);if(t===void 0)throw new Error('"'+n+'" is not a registered '+r+".");return t}}var nn=new bA;class al extends Vt{update(n){const e=this._cachedMeta,{data:r=[]}=e,t=this.chart._animationsDisabled;let{start:o,count:a}=vd(e,r,t);if(this._drawStart=o,this._drawCount=a,kd(e)&&(o=0,a=r.length),this.options.showLine){const{dataset:s,_dataset:u}=e;s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!u._decimated,s.points=r;const c=this.resolveDatasetElementOptions(n);c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!t,options:c},n)}this.updateElements(r,o,a,n)}addElements(){const{showLine:n}=this.options;!this.datasetElementType&&n&&(this.datasetElementType=nn.getElement("line")),super.addElements()}updateElements(n,e,r,t){const o=t==="reset",{iScale:a,vScale:s,_stacked:u,_dataset:c}=this._cachedMeta,M=this.resolveDataElementOptions(e,t),d=this.getSharedOptions(M),g=this.includeOptions(t,d),f=a.axis,j=s.axis,{spanGaps:p,segment:x}=this.options,N=fi(p)?p:Number.POSITIVE_INFINITY,h=this.chart._animationsDisabled||o||t==="none";let z=e>0&&this.getParsed(e-1);for(let m=e;m<e+r;++m){const I=n[m],D=this.getParsed(m),v=h?I:{},L=Se(D[j]),w=v[f]=a.getPixelForValue(D[f],m),E=v[j]=o||L?s.getBasePixel():s.getPixelForValue(u?this.applyStack(s,D,u):D[j],m);v.skip=isNaN(w)||isNaN(E)||L,v.stop=m>0&&Math.abs(D[f]-z[f])>N,x&&(v.parsed=D,v.raw=c.data[m]),g&&(v.options=d||this.resolveDataElementOptions(m,I.active?"active":t)),h||this.updateElement(I,m,v,t),z=D}this.updateSharedOptions(d,t,M)}getMaxOverflow(){const n=this._cachedMeta,e=n.data||[];if(!this.options.showLine){let s=0;for(let u=e.length-1;u>=0;--u)s=Math.max(s,e[u].size(this.resolveDataElementOptions(u))/2);return s>0&&s}const r=n.dataset,t=r.options&&r.options.borderWidth||0;if(!e.length)return t;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(t,o,a)/2}}al.id="scatter",al.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1},al.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(i){return"("+i.label+", "+i.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function ni(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class sl{constructor(n){this.options=n||{}}init(n){}formats(){return ni()}parse(n,e){return ni()}format(n,e){return ni()}add(n,e,r){return ni()}diff(n,e,r){return ni()}startOf(n,e,r){return ni()}endOf(n,e){return ni()}}sl.override=function(i){Object.assign(sl.prototype,i)};var wA={_date:sl};function OA(i,n,e,r){const{controller:t,data:o,_sorted:a}=i,s=t._cachedMeta.iScale;if(s&&n===s.axis&&n!=="r"&&a&&o.length){const u=s._reversePixels?yz:$n;if(r){if(t._sharedOptions){const c=o[0],M=typeof c.getRange=="function"&&c.getRange(n);if(M){const d=u(o,n,e-M),g=u(o,n,e+M);return{lo:d.lo,hi:g.hi}}}}else return u(o,n,e)}return{lo:0,hi:o.length-1}}function Fi(i,n,e,r,t){const o=i.getSortedVisibleDatasetMetas(),a=e[n];for(let s=0,u=o.length;s<u;++s){const{index:c,data:M}=o[s],{lo:d,hi:g}=OA(o[s],n,a,t);for(let f=d;f<=g;++f){const j=M[f];j.skip||r(j,c,f)}}}function EA(i){const n=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(r,t){const o=n?Math.abs(r.x-t.x):0,a=e?Math.abs(r.y-t.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function ul(i,n,e,r,t){const o=[];return!t&&!i.isPointInArea(n)||Fi(i,e,n,function(s,u,c){!t&&!Zi(s,i.chartArea,0)||s.inRange(n.x,n.y,r)&&o.push({element:s,datasetIndex:u,index:c})},!0),o}function CA(i,n,e,r){let t=[];function o(a,s,u){const{startAngle:c,endAngle:M}=a.getProps(["startAngle","endAngle"],r),{angle:d}=Dd(a,{x:n.x,y:n.y});Ui(d,c,M)&&t.push({element:a,datasetIndex:s,index:u})}return Fi(i,e,n,o),t}function SA(i,n,e,r,t,o){let a=[];const s=EA(e);let u=Number.POSITIVE_INFINITY;function c(M,d,g){const f=M.inRange(n.x,n.y,t);if(r&&!f)return;const j=M.getCenterPoint(t);if(!(!!o||i.isPointInArea(j))&&!f)return;const x=s(n,j);x<u?(a=[{element:M,datasetIndex:d,index:g}],u=x):x===u&&a.push({element:M,datasetIndex:d,index:g})}return Fi(i,e,n,c),a}function ll(i,n,e,r,t,o){return!o&&!i.isPointInArea(n)?[]:e==="r"&&!r?CA(i,n,e,t):SA(i,n,e,r,t,o)}function Tg(i,n,e,r,t){const o=[],a=e==="x"?"inXRange":"inYRange";let s=!1;return Fi(i,e,n,(u,c,M)=>{u[a](n[e],t)&&(o.push({element:u,datasetIndex:c,index:M}),s=s||u.inRange(n.x,n.y,t))}),r&&!s?[]:o}var QA={evaluateInteractionItems:Fi,modes:{index(i,n,e,r){const t=qn(n,i),o=e.axis||"x",a=e.includeInvisible||!1,s=e.intersect?ul(i,t,o,r,a):ll(i,t,o,!1,r,a),u=[];return s.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const M=s[0].index,d=c.data[M];d&&!d.skip&&u.push({element:d,datasetIndex:c.index,index:M})}),u):[]},dataset(i,n,e,r){const t=qn(n,i),o=e.axis||"xy",a=e.includeInvisible||!1;let s=e.intersect?ul(i,t,o,r,a):ll(i,t,o,!1,r,a);if(s.length>0){const u=s[0].datasetIndex,c=i.getDatasetMeta(u).data;s=[];for(let M=0;M<c.length;++M)s.push({element:c[M],datasetIndex:u,index:M})}return s},point(i,n,e,r){const t=qn(n,i),o=e.axis||"xy",a=e.includeInvisible||!1;return ul(i,t,o,r,a)},nearest(i,n,e,r){const t=qn(n,i),o=e.axis||"xy",a=e.includeInvisible||!1;return ll(i,t,o,e.intersect,r,a)},x(i,n,e,r){const t=qn(n,i);return Tg(i,t,"x",e.intersect,r)},y(i,n,e,r){const t=qn(n,i);return Tg(i,t,"y",e.intersect,r)}}};const Lg=["left","top","right","bottom"];function $i(i,n){return i.filter(e=>e.pos===n)}function vg(i,n){return i.filter(e=>Lg.indexOf(e.pos)===-1&&e.box.axis===n)}function Ji(i,n){return i.sort((e,r)=>{const t=n?r:e,o=n?e:r;return t.weight===o.weight?t.index-o.index:t.weight-o.weight})}function YA(i){const n=[];let e,r,t,o,a,s;for(e=0,r=(i||[]).length;e<r;++e)t=i[e],{position:o,options:{stack:a,stackWeight:s=1}}=t,n.push({index:e,box:t,pos:o,horizontal:t.isHorizontal(),weight:t.weight,stack:a&&o+a,stackWeight:s});return n}function UA(i){const n={};for(const e of i){const{stack:r,pos:t,stackWeight:o}=e;if(!r||!Lg.includes(t))continue;const a=n[r]||(n[r]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return n}function _A(i,n){const e=UA(i),{vBoxMaxWidth:r,hBoxMaxHeight:t}=n;let o,a,s;for(o=0,a=i.length;o<a;++o){s=i[o];const{fullSize:u}=s.box,c=e[s.stack],M=c&&s.stackWeight/c.weight;s.horizontal?(s.width=M?M*r:u&&n.availableWidth,s.height=t):(s.width=r,s.height=M?M*t:u&&n.availableHeight)}return e}function BA(i){const n=YA(i),e=Ji(n.filter(c=>c.box.fullSize),!0),r=Ji($i(n,"left"),!0),t=Ji($i(n,"right")),o=Ji($i(n,"top"),!0),a=Ji($i(n,"bottom")),s=vg(n,"x"),u=vg(n,"y");return{fullSize:e,leftAndTop:r.concat(o),rightAndBottom:t.concat(u).concat(a).concat(s),chartArea:$i(n,"chartArea"),vertical:r.concat(t).concat(u),horizontal:o.concat(a).concat(s)}}function kg(i,n,e,r){return Math.max(i[e],n[e])+Math.max(i[r],n[r])}function bg(i,n){i.top=Math.max(i.top,n.top),i.left=Math.max(i.left,n.left),i.bottom=Math.max(i.bottom,n.bottom),i.right=Math.max(i.right,n.right)}function PA(i,n,e,r){const{pos:t,box:o}=e,a=i.maxPadding;if(!be(t)){e.size&&(i[t]-=e.size);const d=r[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[t]+=e.size}o.getPadding&&bg(a,o.getPadding());const s=Math.max(0,n.outerWidth-kg(a,i,"left","right")),u=Math.max(0,n.outerHeight-kg(a,i,"top","bottom")),c=s!==i.w,M=u!==i.h;return i.w=s,i.h=u,e.horizontal?{same:c,other:M}:{same:M,other:c}}function RA(i){const n=i.maxPadding;function e(r){const t=Math.max(n[r]-i[r],0);return i[r]+=t,t}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function ZA(i,n){const e=n.maxPadding;function r(t){const o={left:0,top:0,right:0,bottom:0};return t.forEach(a=>{o[a]=Math.max(n[a],e[a])}),o}return r(i?["left","right"]:["top","bottom"])}function Xi(i,n,e,r){const t=[];let o,a,s,u,c,M;for(o=0,a=i.length,c=0;o<a;++o){s=i[o],u=s.box,u.update(s.width||n.w,s.height||n.h,ZA(s.horizontal,n));const{same:d,other:g}=PA(n,e,s,r);c|=d&&t.length,M=M||g,u.fullSize||t.push(s)}return c&&Xi(t,n,e,r)||M}function ga(i,n,e,r,t){i.top=e,i.left=n,i.right=n+r,i.bottom=e+t,i.width=r,i.height=t}function wg(i,n,e,r){const t=e.padding;let{x:o,y:a}=n;for(const s of i){const u=s.box,c=r[s.stack]||{count:1,placed:0,weight:1},M=s.stackWeight/c.weight||1;if(s.horizontal){const d=n.w*M,g=c.size||u.height;kt(c.start)&&(a=c.start),u.fullSize?ga(u,t.left,a,e.outerWidth-t.right-t.left,g):ga(u,n.left+c.placed,a,d,g),c.start=a,c.placed+=d,a=u.bottom}else{const d=n.h*M,g=c.size||u.width;kt(c.start)&&(o=c.start),u.fullSize?ga(u,o,t.top,g,e.outerHeight-t.bottom-t.top):ga(u,o,n.top+c.placed,g,d),c.start=o,c.placed+=d,o=u.right}}n.x=o,n.y=a}ke.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var fa={addBox(i,n){i.boxes||(i.boxes=[]),n.fullSize=n.fullSize||!1,n.position=n.position||"top",n.weight=n.weight||0,n._layers=n._layers||function(){return[{z:0,draw(e){n.draw(e)}}]},i.boxes.push(n)},removeBox(i,n){const e=i.boxes?i.boxes.indexOf(n):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,n,e){n.fullSize=e.fullSize,n.position=e.position,n.weight=e.weight},update(i,n,e,r){if(!i)return;const t=Ot(i.options.layout.padding),o=Math.max(n-t.width,0),a=Math.max(e-t.height,0),s=BA(i.boxes),u=s.vertical,c=s.horizontal;Ye(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const M=u.reduce((p,x)=>x.box.options&&x.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:n,outerHeight:e,padding:t,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/M,hBoxMaxHeight:a/2}),g=Object.assign({},t);bg(g,Ot(r));const f=Object.assign({maxPadding:g,w:o,h:a,x:t.left,y:t.top},t),j=_A(u.concat(c),d);Xi(s.fullSize,f,d,j),Xi(u,f,d,j),Xi(c,f,d,j)&&Xi(u,f,d,j),RA(f),wg(s.leftAndTop,f,d,j),f.x+=f.w,f.y+=f.h,wg(s.rightAndBottom,f,d,j),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Ye(s.chartArea,p=>{const x=p.box;Object.assign(x,i.chartArea),x.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Og{acquireContext(n,e){}releaseContext(n){return!1}addEventListener(n,e,r){}removeEventListener(n,e,r){}getDevicePixelRatio(){return 1}getMaximumSize(n,e,r,t){return e=Math.max(0,e||n.width),r=r||n.height,{width:e,height:Math.max(0,t?Math.floor(e/t):r)}}isAttached(n){return!0}updateConfig(n){}}class VA extends Og{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const ya="$chartjs",GA={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Eg=i=>i===null||i==="";function WA(i,n){const e=i.style,r=i.getAttribute("height"),t=i.getAttribute("width");if(i[ya]={initial:{height:r,width:t,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Eg(t)){const o=ng(i,"width");o!==void 0&&(i.width=o)}if(Eg(r))if(i.style.height==="")i.height=i.width/(n||2);else{const o=ng(i,"height");o!==void 0&&(i.height=o)}return i}const Cg=zx?{passive:!0}:!1;function HA(i,n,e){i.addEventListener(n,e,Cg)}function FA(i,n,e){i.canvas.removeEventListener(n,e,Cg)}function $A(i,n){const e=GA[i.type]||i.type,{x:r,y:t}=qn(i,n);return{type:e,chart:n,native:i,x:r!==void 0?r:null,y:t!==void 0?t:null}}function Na(i,n){for(const e of i)if(e===n||e.contains(n))return!0}function JA(i,n,e){const r=i.canvas,t=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||Na(s.addedNodes,r),a=a&&!Na(s.removedNodes,r);a&&e()});return t.observe(document,{childList:!0,subtree:!0}),t}function XA(i,n,e){const r=i.canvas,t=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||Na(s.removedNodes,r),a=a&&!Na(s.addedNodes,r);a&&e()});return t.observe(document,{childList:!0,subtree:!0}),t}const Ki=new Map;let Sg=0;function Qg(){const i=window.devicePixelRatio;i!==Sg&&(Sg=i,Ki.forEach((n,e)=>{e.currentDevicePixelRatio!==i&&n()}))}function KA(i,n){Ki.size||window.addEventListener("resize",Qg),Ki.set(i,n)}function qA(i){Ki.delete(i),Ki.size||window.removeEventListener("resize",Qg)}function eT(i,n,e){const r=i.canvas,t=r&&Ju(r);if(!t)return;const o=Td((s,u)=>{const c=t.clientWidth;e(s,u),c<t.clientWidth&&e()},window),a=new ResizeObserver(s=>{const u=s[0],c=u.contentRect.width,M=u.contentRect.height;c===0&&M===0||o(c,M)});return a.observe(t),KA(i,o),a}function cl(i,n,e){e&&e.disconnect(),n==="resize"&&qA(i)}function tT(i,n,e){const r=i.canvas,t=Td(o=>{i.ctx!==null&&e($A(o,i))},i,o=>{const a=o[0];return[a,a.offsetX,a.offsetY]});return HA(r,n,t),t}class nT extends Og{acquireContext(n,e){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(WA(n,e),r):null}releaseContext(n){const e=n.canvas;if(!e[ya])return!1;const r=e[ya].initial;["height","width"].forEach(o=>{const a=r[o];Se(a)?e.removeAttribute(o):e.setAttribute(o,a)});const t=r.style||{};return Object.keys(t).forEach(o=>{e.style[o]=t[o]}),e.width=e.width,delete e[ya],!0}addEventListener(n,e,r){this.removeEventListener(n,e);const t=n.$proxies||(n.$proxies={}),a={attach:JA,detach:XA,resize:eT}[e]||tT;t[e]=a(n,e,r)}removeEventListener(n,e){const r=n.$proxies||(n.$proxies={}),t=r[e];if(!t)return;({attach:cl,detach:cl,resize:cl}[e]||FA)(n,e,t),r[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,e,r,t){return mx(n,e,r,t)}isAttached(n){const e=Ju(n);return!!(e&&e.isConnected)}}function iT(i){return!eg()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?VA:nT}class rT{constructor(){this._init=[]}notify(n,e,r,t){e==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install"));const o=t?this._descriptors(n).filter(t):this._descriptors(n),a=this._notify(o,n,e,r);return e==="afterDestroy"&&(this._notify(o,n,"stop"),this._notify(this._init,n,"uninstall")),a}_notify(n,e,r,t){t=t||{};for(const o of n){const a=o.plugin,s=a[r],u=[e,t,o.options];if(Ke(s,u,a)===!1&&t.cancelable)return!1}return!0}invalidate(){Se(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(n){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(n);return this._notifyStateChanges(n),e}_createDescriptors(n,e){const r=n&&n.config,t=we(r.options&&r.options.plugins,{}),o=oT(r);return t===!1&&!e?[]:sT(n,o,t,e)}_notifyStateChanges(n){const e=this._oldCache||[],r=this._cache,t=(o,a)=>o.filter(s=>!a.some(u=>s.plugin.id===u.plugin.id));this._notify(t(e,r),n,"stop"),this._notify(t(r,e),n,"start")}}function oT(i){const n={},e=[],r=Object.keys(nn.plugins.items);for(let o=0;o<r.length;o++)e.push(nn.getPlugin(r[o]));const t=i.plugins||[];for(let o=0;o<t.length;o++){const a=t[o];e.indexOf(a)===-1&&(e.push(a),n[a.id]=!0)}return{plugins:e,localIds:n}}function aT(i,n){return!n&&i===!1?null:i===!0?{}:i}function sT(i,{plugins:n,localIds:e},r,t){const o=[],a=i.getContext();for(const s of n){const u=s.id,c=aT(r[u],t);c!==null&&o.push({plugin:s,options:uT(i.config,{plugin:s,local:e[u]},c,a)})}return o}function uT(i,{plugin:n,local:e},r,t){const o=i.pluginScopeKeys(n),a=i.getOptionScopes(r,o);return e&&n.defaults&&a.push(n.defaults),i.createResolver(a,t,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ml(i,n){const e=ke.datasets[i]||{};return((n.datasets||{})[i]||{}).indexAxis||n.indexAxis||e.indexAxis||"x"}function lT(i,n){let e=i;return i==="_index_"?e=n:i==="_value_"&&(e=n==="x"?"y":"x"),e}function cT(i,n){return i===n?"_index_":"_value_"}function MT(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function dl(i,n){return i==="x"||i==="y"?i:n.axis||MT(n.position)||i.charAt(0).toLowerCase()}function dT(i,n){const e=Jn[i.type]||{scales:{}},r=n.scales||{},t=Ml(i.type,n),o=Object.create(null),a=Object.create(null);return Object.keys(r).forEach(s=>{const u=r[s];if(!be(u))return console.error(`Invalid scale configuration for scale: ${s}`);if(u._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const c=dl(s,u),M=cT(c,t),d=e.scales||{};o[c]=o[c]||s,a[s]=Si(Object.create(null),[{axis:c},u,d[c],d[M]])}),i.data.datasets.forEach(s=>{const u=s.type||i.type,c=s.indexAxis||Ml(u,n),d=(Jn[u]||{}).scales||{};Object.keys(d).forEach(g=>{const f=lT(g,c),j=s[f+"AxisID"]||o[f]||f;a[j]=a[j]||Object.create(null),Si(a[j],[{axis:f},r[j],d[g]])})}),Object.keys(a).forEach(s=>{const u=a[s];Si(u,[ke.scales[u.type],ke.scale])}),a}function Yg(i){const n=i.options||(i.options={});n.plugins=we(n.plugins,{}),n.scales=dT(i,n)}function Ug(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function gT(i){return i=i||{},i.data=Ug(i.data),Yg(i),i}const _g=new Map,Bg=new Set;function ja(i,n){let e=_g.get(i);return e||(e=n(),_g.set(i,e),Bg.add(e)),e}const qi=(i,n,e)=>{const r=kn(n,e);r!==void 0&&i.add(r)};class fT{constructor(n){this._config=gT(n),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(n){this._config.type=n}get data(){return this._config.data}set data(n){this._config.data=Ug(n)}get options(){return this._config.options}set options(n){this._config.options=n}get plugins(){return this._config.plugins}update(){const n=this._config;this.clearCache(),Yg(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return ja(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,e){return ja(`${n}.transition.${e}`,()=>[[`datasets.${n}.transitions.${e}`,`transitions.${e}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,e){return ja(`${n}-${e}`,()=>[[`datasets.${n}.elements.${e}`,`datasets.${n}`,`elements.${e}`,""]])}pluginScopeKeys(n){const e=n.id,r=this.type;return ja(`${r}-plugin-${e}`,()=>[[`plugins.${e}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,e){const r=this._scopeCache;let t=r.get(n);return(!t||e)&&(t=new Map,r.set(n,t)),t}getOptionScopes(n,e,r){const{options:t,type:o}=this,a=this._cachedScopes(n,r),s=a.get(e);if(s)return s;const u=new Set;e.forEach(M=>{n&&(u.add(n),M.forEach(d=>qi(u,n,d))),M.forEach(d=>qi(u,t,d)),M.forEach(d=>qi(u,Jn[o]||{},d)),M.forEach(d=>qi(u,ke,d)),M.forEach(d=>qi(u,Zu,d))});const c=Array.from(u);return c.length===0&&c.push(Object.create(null)),Bg.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:n,type:e}=this;return[n,Jn[e]||{},ke.datasets[e]||{},{type:e},ke,Zu]}resolveNamedOptions(n,e,r,t=[""]){const o={$shared:!0},{resolver:a,subPrefixes:s}=Pg(this._resolverCache,n,t);let u=a;if(NT(a,e)){o.$shared=!1,r=bn(r)?r():r;const c=this.createResolver(n,r,s);u=ji(a,r,c)}for(const c of e)o[c]=u[c];return o}createResolver(n,e,r=[""],t){const{resolver:o}=Pg(this._resolverCache,n,r);return be(e)?ji(o,e,void 0,t):o}}function Pg(i,n,e){let r=i.get(n);r||(r=new Map,i.set(n,r));const t=e.join();let o=r.get(t);return o||(o={resolver:Hu(n,e),subPrefixes:e.filter(s=>!s.toLowerCase().includes("hover"))},r.set(t,o)),o}const yT=i=>be(i)&&Object.getOwnPropertyNames(i).reduce((n,e)=>n||bn(i[e]),!1);function NT(i,n){const{isScriptable:e,isIndexable:r}=Wd(i);for(const t of n){const o=e(t),a=r(t),s=(a||o)&&i[t];if(o&&(bn(s)||yT(s))||a&&Ge(s))return!0}return!1}var jT="3.9.1";const hT=["top","bottom","left","right","chartArea"];function Rg(i,n){return i==="top"||i==="bottom"||hT.indexOf(i)===-1&&n==="x"}function Zg(i,n){return function(e,r){return e[i]===r[i]?e[n]-r[n]:e[i]-r[i]}}function Vg(i){const n=i.chart,e=n.options.animation;n.notifyPlugins("afterRender"),Ke(e&&e.onComplete,[i],n)}function IT(i){const n=i.chart,e=n.options.animation;Ke(e&&e.onProgress,[i],n)}function Gg(i){return eg()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const ha={},Wg=i=>{const n=Gg(i);return Object.values(ha).filter(e=>e.canvas===n).pop()};function pT(i,n,e){const r=Object.keys(i);for(const t of r){const o=+t;if(o>=n){const a=i[t];delete i[t],(e>0||o>n)&&(i[o+e]=a)}}}function DT(i,n,e,r){return!e||i.type==="mouseout"?null:r?n:i}class er{constructor(n,e){const r=this.config=new fT(e),t=Gg(n),o=Wg(t);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=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||iT(t)),this.platform.updateConfig(r);const s=this.platform.acquireContext(t,a.aspectRatio),u=s&&s.canvas,c=u&&u.height,M=u&&u.width;if(this.id=nz(),this.ctx=s,this.canvas=u,this.width=M,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 rT,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=hz(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],ha[this.id]=this,!s||!u){console.error("Failed to create chart: can't acquire context from the given item");return}Nn.listen(this,"complete",Vg),Nn.listen(this,"progress",IT),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:e},width:r,height:t,_aspectRatio:o}=this;return Se(n)?e&&o?o:t?r/t:null:n}get data(){return this.config.data}set data(n){this.config.data=n}get options(){return this._options}set options(n){this.config.options=n}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tg(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Rd(this.canvas,this.ctx),this}stop(){return Nn.stop(this),this}resize(n,e){Nn.running(this)?this._resizeBeforeDraw={width:n,height:e}:this._resize(n,e)}_resize(n,e){const r=this.options,t=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(t,n,e,o),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,tg(this,s,!0)&&(this.notifyPlugins("resize",{size:a}),Ke(r.onResize,[this,a],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Ye(e,(r,t)=>{r.id=t})}buildOrUpdateScales(){const n=this.options,e=n.scales,r=this.scales,t=Object.keys(r).reduce((a,s)=>(a[s]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const s=e[a],u=dl(a,s),c=u==="r",M=u==="x";return{options:s,dposition:c?"chartArea":M?"bottom":"left",dtype:c?"radialLinear":M?"category":"linear"}}))),Ye(o,a=>{const s=a.options,u=s.id,c=dl(u,s),M=we(s.type,a.dtype);(s.position===void 0||Rg(s.position,c)!==Rg(a.dposition))&&(s.position=a.dposition),t[u]=!0;let d=null;if(u in r&&r[u].type===M)d=r[u];else{const g=nn.getScale(M);d=new g({id:u,type:M,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,n)}),Ye(t,(a,s)=>{a||delete r[s]}),Ye(r,a=>{fa.configure(this,a,a.options),fa.addBox(this,a)})}_updateMetasets(){const n=this._metasets,e=this.data.datasets.length,r=n.length;if(n.sort((t,o)=>t.index-o.index),r>e){for(let t=e;t<r;++t)this._destroyDatasetMeta(t);n.splice(e,r-e)}this._sortedMetasets=n.slice(0).sort(Zg("order","index"))}_removeUnreferencedMetasets(){const{_metasets:n,data:{datasets:e}}=this;n.length>e.length&&delete this._stacks,n.forEach((r,t)=>{e.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(t)})}buildOrUpdateControllers(){const n=[],e=this.data.datasets;let r,t;for(this._removeUnreferencedMetasets(),r=0,t=e.length;r<t;r++){const o=e[r];let a=this.getDatasetMeta(r);const s=o.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=s,a.indexAxis=o.indexAxis||Ml(s,this.options),a.order=o.order||0,a.index=r,a.label=""+o.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{const u=nn.getController(s),{datasetElementType:c,dataElementType:M}=ke.datasets[s];Object.assign(u.prototype,{dataElementType:nn.getElement(M),datasetElementType:c&&nn.getElement(c)}),a.controller=new u(this,r),n.push(a.controller)}}return this._updateMetasets(),n}_resetElements(){Ye(this.data.datasets,(n,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(n){const e=this.config;e.update();const r=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),t=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:n,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,M=this.data.datasets.length;c<M;c++){const{controller:d}=this.getDatasetMeta(c),g=!t&&o.indexOf(d)===-1;d.buildOrUpdateElements(g),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),t||Ye(o,c=>{c.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Zg("z","_idx"));const{_active:s,_lastEvent:u}=this;u?this._eventHandler(u,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){Ye(this.scales,n=>{fa.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,e=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!Nd(e,r)||!!this._responsiveListeners!==n.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:n}=this,e=this._getUniformDataChanges()||[];for(const{method:r,start:t,count:o}of e){const a=r==="_removeElements"?-o:o;pT(n,t,a)}}_getUniformDataChanges(){const n=this._dataChanges;if(!n||!n.length)return;this._dataChanges=[];const e=this.data.datasets.length,r=o=>new Set(n.filter(a=>a[0]===o).map((a,s)=>s+","+a.splice(1).join(","))),t=r(0);for(let o=1;o<e;o++)if(!Nd(t,r(o)))return;return Array.from(t).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(n){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;fa.update(this,this.width,this.height,n);const e=this.chartArea,r=e.width<=0||e.height<=0;this._layers=[],Ye(this.boxes,t=>{r&&t.position==="chartArea"||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,o)=>{t._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(n){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:n,cancelable:!0})!==!1){for(let e=0,r=this.data.datasets.length;e<r;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,r=this.data.datasets.length;e<r;++e)this._updateDataset(e,bn(n)?n({datasetIndex:e}):n);this.notifyPlugins("afterDatasetsUpdate",{mode:n})}}_updateDataset(n,e){const r=this.getDatasetMeta(n),t={meta:r,index:n,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",t)!==!1&&(r.controller._update(e),t.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",t))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Nn.has(this)?this.attached&&!Nn.running(this)&&Nn.start(this):(this.draw(),Vg({chart:this})))}draw(){let n;if(this._resizeBeforeDraw){const{width:r,height:t}=this._resizeBeforeDraw;this._resize(r,t),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(n=0;n<e.length&&e[n].z<=0;++n)e[n].draw(this.chartArea);for(this._drawDatasets();n<e.length;++n)e[n].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(n){const e=this._sortedMetasets,r=[];let t,o;for(t=0,o=e.length;t<o;++t){const a=e[t];(!n||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const n=this.getSortedVisibleDatasetMetas();for(let e=n.length-1;e>=0;--e)this._drawDataset(n[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(n){const e=this.ctx,r=n._clip,t=!r.disabled,o=this.chartArea,a={meta:n,index:n.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(t&&Zd(e,{left:r.left===!1?0:o.left-r.left,right:r.right===!1?this.width:o.right+r.right,top:r.top===!1?0:o.top-r.top,bottom:r.bottom===!1?this.height:o.bottom+r.bottom}),n.controller.draw(),t&&Vd(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(n){return Zi(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,e,r,t){const o=QA.modes[e];return typeof o=="function"?o(this,n,r,t):[]}getDatasetMeta(n){const e=this.data.datasets[n],r=this._metasets;let t=r.filter(o=>o&&o._dataset===e).pop();return t||(t={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:n,_dataset:e,_parsed:[],_sorted:!1},r.push(t)),t}getContext(){return this.$context||(this.$context=En(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(n){const e=this.data.datasets[n];if(!e)return!1;const r=this.getDatasetMeta(n);return typeof r.hidden=="boolean"?!r.hidden:!e.hidden}setDatasetVisibility(n,e){const r=this.getDatasetMeta(n);r.hidden=!e}toggleDataVisibility(n){this._hiddenIndices[n]=!this._hiddenIndices[n]}getDataVisibility(n){return!this._hiddenIndices[n]}_updateVisibility(n,e,r){const t=r?"show":"hide",o=this.getDatasetMeta(n),a=o.controller._resolveAnimations(void 0,t);kt(e)?(o.data[e].hidden=!r,this.update()):(this.setDatasetVisibility(n,r),a.update(o,{visible:r}),this.update(s=>s.datasetIndex===n?t:void 0))}hide(n,e){this._updateVisibility(n,e,!1)}show(n,e){this._updateVisibility(n,e,!0)}_destroyDatasetMeta(n){const e=this._metasets[n];e&&e.controller&&e.controller._destroy(),delete this._metasets[n]}_stop(){let n,e;for(this.stop(),Nn.remove(this),n=0,e=this.data.datasets.length;n<e;++n)this._destroyDatasetMeta(n)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:n,ctx:e}=this;this._stop(),this.config.clearCache(),n&&(this.unbindEvents(),Rd(n,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete ha[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...n){return this.canvas.toDataURL(...n)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const n=this._listeners,e=this.platform,r=(o,a)=>{e.addEventListener(this,o,a),n[o]=a},t=(o,a,s)=>{o.offsetX=a,o.offsetY=s,this._eventHandler(o)};Ye(this.options.events,o=>r(o,t))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const n=this._responsiveListeners,e=this.platform,r=(u,c)=>{e.addEventListener(this,u,c),n[u]=c},t=(u,c)=>{n[u]&&(e.removeEventListener(this,u,c),delete n[u])},o=(u,c)=>{this.canvas&&this.resize(u,c)};let a;const s=()=>{t("attach",s),this.attached=!0,this.resize(),r("resize",o),r("detach",a)};a=()=>{this.attached=!1,t("resize",o),this._stop(),this._resize(0,0),r("attach",s)},e.isAttached(this.canvas)?s():a()}unbindEvents(){Ye(this._listeners,(n,e)=>{this.platform.removeEventListener(this,e,n)}),this._listeners={},Ye(this._responsiveListeners,(n,e)=>{this.platform.removeEventListener(this,e,n)}),this._responsiveListeners=void 0}updateHoverStyle(n,e,r){const t=r?"set":"remove";let o,a,s,u;for(e==="dataset"&&(o=this.getDatasetMeta(n[0].datasetIndex),o.controller["_"+t+"DatasetHoverStyle"]()),s=0,u=n.length;s<u;++s){a=n[s];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[t+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(n){const e=this._active||[],r=n.map(({datasetIndex:o,index:a})=>{const s=this.getDatasetMeta(o);if(!s)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:s.data[a],index:a}});!Ho(r,e)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,e))}notifyPlugins(n,e,r){return this._plugins.notify(this,n,e,r)}_updateHoverStyles(n,e,r){const t=this.options.hover,o=(u,c)=>u.filter(M=>!c.some(d=>M.datasetIndex===d.datasetIndex&&M.index===d.index)),a=o(e,n),s=r?n:o(n,e);a.length&&this.updateHoverStyle(a,t.mode,!1),s.length&&t.mode&&this.updateHoverStyle(s,t.mode,!0)}_eventHandler(n,e){const r={event:n,replay:e,cancelable:!0,inChartArea:this.isPointInArea(n)},t=a=>(a.options.events||this.options.events).includes(n.native.type);if(this.notifyPlugins("beforeEvent",r,t)===!1)return;const o=this._handleEvent(n,e,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,t),(o||r.changed)&&this.render(),this}_handleEvent(n,e,r){const{_active:t=[],options:o}=this,a=e,s=this._getActiveElements(n,t,r,a),u=uz(n),c=DT(n,this._lastEvent,r,u);r&&(this._lastEvent=null,Ke(o.onHover,[n,s,this],this),u&&Ke(o.onClick,[n,s,this],this));const M=!Ho(s,t);return(M||e)&&(this._active=s,this._updateHoverStyles(s,t,e)),this._lastEvent=c,M}_getActiveElements(n,e,r,t){if(n.type==="mouseout")return[];if(!r)return e;const o=this.options.hover;return this.getElementsAtEventForMode(n,o.mode,o,t)}}const Hg=()=>Ye(er.instances,i=>i._plugins.invalidate()),Cn=!0;Object.defineProperties(er,{defaults:{enumerable:Cn,value:ke},instances:{enumerable:Cn,value:ha},overrides:{enumerable:Cn,value:Jn},registry:{enumerable:Cn,value:nn},version:{enumerable:Cn,value:jT},getChart:{enumerable:Cn,value:Wg},register:{enumerable:Cn,value:(...i)=>{nn.add(...i),Hg()}},unregister:{enumerable:Cn,value:(...i)=>{nn.remove(...i),Hg()}}});function Fg(i,n,e){const{startAngle:r,pixelMargin:t,x:o,y:a,outerRadius:s,innerRadius:u}=n;let c=t/s;i.beginPath(),i.arc(o,a,s,r-c,e+c),u>t?(c=t/u,i.arc(o,a,u,e+c,r-c,!0)):i.arc(o,a,t,e+et,r-et),i.closePath(),i.clip()}function mT(i){return Wu(i,["outerStart","outerEnd","innerStart","innerEnd"])}function zT(i,n,e,r){const t=mT(i.options.borderRadius),o=(e-n)/2,a=Math.min(o,r*n/2),s=u=>{const c=(e-Math.min(o,u))*r/2;return gt(u,0,Math.min(o,c))};return{outerStart:s(t.outerStart),outerEnd:s(t.outerEnd),innerStart:gt(t.innerStart,0,a),innerEnd:gt(t.innerEnd,0,a)}}function Ii(i,n,e,r){return{x:e+i*Math.cos(n),y:r+i*Math.sin(n)}}function gl(i,n,e,r,t,o){const{x:a,y:s,startAngle:u,pixelMargin:c,innerRadius:M}=n,d=Math.max(n.outerRadius+r+e-c,0),g=M>0?M+r+e+c:0;let f=0;const j=t-u;if(r){const b=M>0?M-r:0,C=d>0?d-r:0,S=(b+C)/2,O=S!==0?j*S/(S+r):j;f=(j-O)/2}const p=Math.max(.001,j*d-e/qe)/d,x=(j-p)/2,N=u+x+f,h=t-x-f,{outerStart:z,outerEnd:m,innerStart:I,innerEnd:D}=zT(n,g,d,h-N),v=d-z,L=d-m,w=N+z/v,E=h-m/L,T=g+I,y=g+D,A=N+I/T,k=h-D/y;if(i.beginPath(),o){if(i.arc(a,s,d,w,E),m>0){const S=Ii(L,E,a,s);i.arc(S.x,S.y,m,E,h+et)}const b=Ii(y,h,a,s);if(i.lineTo(b.x,b.y),D>0){const S=Ii(y,k,a,s);i.arc(S.x,S.y,D,h+et,k+Math.PI)}if(i.arc(a,s,g,h-D/g,N+I/g,!0),I>0){const S=Ii(T,A,a,s);i.arc(S.x,S.y,I,A+Math.PI,N-et)}const C=Ii(v,N,a,s);if(i.lineTo(C.x,C.y),z>0){const S=Ii(v,w,a,s);i.arc(S.x,S.y,z,N-et,w)}}else{i.moveTo(a,s);const b=Math.cos(w)*d+a,C=Math.sin(w)*d+s;i.lineTo(b,C);const S=Math.cos(E)*d+a,O=Math.sin(E)*d+s;i.lineTo(S,O)}i.closePath()}function xT(i,n,e,r,t){const{fullCircles:o,startAngle:a,circumference:s}=n;let u=n.endAngle;if(o){gl(i,n,e,r,a+Pe,t);for(let c=0;c<o;++c)i.fill();isNaN(s)||(u=a+s%Pe,s%Pe===0&&(u+=Pe))}return gl(i,n,e,r,u,t),i.fill(),u}function AT(i,n,e){const{x:r,y:t,startAngle:o,pixelMargin:a,fullCircles:s}=n,u=Math.max(n.outerRadius-a,0),c=n.innerRadius+a;let M;for(e&&Fg(i,n,o+Pe),i.beginPath(),i.arc(r,t,c,o+Pe,o,!0),M=0;M<s;++M)i.stroke();for(i.beginPath(),i.arc(r,t,u,o,o+Pe),M=0;M<s;++M)i.stroke()}function TT(i,n,e,r,t,o){const{options:a}=n,{borderWidth:s,borderJoinStyle:u}=a,c=a.borderAlign==="inner";s&&(c?(i.lineWidth=s*2,i.lineJoin=u||"round"):(i.lineWidth=s,i.lineJoin=u||"bevel"),n.fullCircles&&AT(i,n,c),c&&Fg(i,n,t),gl(i,n,e,r,t,o),i.stroke())}class fl extends jn{constructor(n){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,e,r){const t=this.getProps(["x","y"],r),{angle:o,distance:a}=Dd(t,{x:n,y:e}),{startAngle:s,endAngle:u,innerRadius:c,outerRadius:M,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),g=this.options.spacing/2,j=we(d,u-s)>=Pe||Ui(o,s,u),p=Jo(a,c+g,M+g);return j&&p}getCenterPoint(n){const{x:e,y:r,startAngle:t,endAngle:o,innerRadius:a,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],n),{offset:u,spacing:c}=this.options,M=(t+o)/2,d=(a+s+c+u)/2;return{x:e+Math.cos(M)*d,y:r+Math.sin(M)*d}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:e,circumference:r}=this,t=(e.offset||0)/2,o=(e.spacing||0)/2,a=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=r>Pe?Math.floor(r/Pe):0,r===0||this.innerRadius<0||this.outerRadius<0)return;n.save();let s=0;if(t){s=t/2;const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*s,Math.sin(c)*s),this.circumference>=qe&&(s=t)}n.fillStyle=e.backgroundColor,n.strokeStyle=e.borderColor;const u=xT(n,this,s,o,a);TT(n,this,s,o,u,a),n.restore()}}fl.id="arc",fl.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0},fl.defaultRoutes={backgroundColor:"backgroundColor"};function $g(i,n,e=n){i.lineCap=we(e.borderCapStyle,n.borderCapStyle),i.setLineDash(we(e.borderDash,n.borderDash)),i.lineDashOffset=we(e.borderDashOffset,n.borderDashOffset),i.lineJoin=we(e.borderJoinStyle,n.borderJoinStyle),i.lineWidth=we(e.borderWidth,n.borderWidth),i.strokeStyle=we(e.borderColor,n.borderColor)}function LT(i,n,e){i.lineTo(e.x,e.y)}function vT(i){return i.stepped?Wz:i.tension||i.cubicInterpolationMode==="monotone"?Hz:LT}function Jg(i,n,e={}){const r=i.length,{start:t=0,end:o=r-1}=e,{start:a,end:s}=n,u=Math.max(t,a),c=Math.min(o,s),M=t<a&&o<a||t>s&&o>s;return{count:r,start:u,loop:n.loop,ilen:c<u&&!M?r+c-u:c-u}}function kT(i,n,e,r){const{points:t,options:o}=n,{count:a,start:s,loop:u,ilen:c}=Jg(t,e,r),M=vT(o);let{move:d=!0,reverse:g}=r||{},f,j,p;for(f=0;f<=c;++f)j=t[(s+(g?c-f:f))%a],!j.skip&&(d?(i.moveTo(j.x,j.y),d=!1):M(i,p,j,g,o.stepped),p=j);return u&&(j=t[(s+(g?c:0))%a],M(i,p,j,g,o.stepped)),!!u}function bT(i,n,e,r){const t=n.points,{count:o,start:a,ilen:s}=Jg(t,e,r),{move:u=!0,reverse:c}=r||{};let M=0,d=0,g,f,j,p,x,N;const h=m=>(a+(c?s-m:m))%o,z=()=>{p!==x&&(i.lineTo(M,x),i.lineTo(M,p),i.lineTo(M,N))};for(u&&(f=t[h(0)],i.moveTo(f.x,f.y)),g=0;g<=s;++g){if(f=t[h(g)],f.skip)continue;const m=f.x,I=f.y,D=m|0;D===j?(I<p?p=I:I>x&&(x=I),M=(d*M+m)/++d):(z(),i.lineTo(m,I),j=D,d=0,p=x=I),N=I}z()}function yl(i){const n=i.options,e=n.borderDash&&n.borderDash.length;return!i._decimated&&!i._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!e?bT:kT}function wT(i){return i.stepped?xx:i.tension||i.cubicInterpolationMode==="monotone"?Ax:ei}function OT(i,n,e,r){let t=n._path;t||(t=n._path=new Path2D,n.path(t,e,r)&&t.closePath()),$g(i,n.options),i.stroke(t)}function ET(i,n,e,r){const{segments:t,options:o}=n,a=yl(n);for(const s of t)$g(i,o,s.style),i.beginPath(),a(i,n,s,{start:e,end:e+r-1})&&i.closePath(),i.stroke()}const CT=typeof Path2D=="function";function ST(i,n,e,r){CT&&!n.options.segment?OT(i,n,e,r):ET(i,n,e,r)}class Ia extends jn{constructor(n){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,n&&Object.assign(this,n)}updateControlPoints(n,e){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const t=r.spanGaps?this._loop:this._fullLoop;Nx(this._points,r,n,t,e),this._pointsUpdated=!0}}set points(n){this._points=n,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Qx(this,this.options.segment))}first(){const n=this.segments,e=this.points;return n.length&&e[n[0].start]}last(){const n=this.segments,e=this.points,r=n.length;return r&&e[n[r-1].end]}interpolate(n,e){const r=this.options,t=n[e],o=this.points,a=Ex(this,{property:e,start:t,end:t});if(!a.length)return;const s=[],u=wT(r);let c,M;for(c=0,M=a.length;c<M;++c){const{start:d,end:g}=a[c],f=o[d],j=o[g];if(f===j){s.push(f);continue}const p=Math.abs((t-f[e])/(j[e]-f[e])),x=u(f,j,p,r.stepped);x[e]=n[e],s.push(x)}return s.length===1?s[0]:s}pathSegment(n,e,r){return yl(this)(n,this,e,r)}path(n,e,r){const t=this.segments,o=yl(this);let a=this._loop;e=e||0,r=r||this.points.length-e;for(const s of t)a&=o(n,this,s,{start:e,end:e+r-1});return!!a}draw(n,e,r,t){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(n.save(),ST(n,this,r,t),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ia.id="line",Ia.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Ia.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Ia.descriptors={_scriptable:!0,_indexable:i=>i!=="borderDash"&&i!=="fill"};function Xg(i,n,e,r){const t=i.options,{[e]:o}=i.getProps([e],r);return Math.abs(n-o)<t.radius+t.hitRadius}class Nl extends jn{constructor(n){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,e,r){const t=this.options,{x:o,y:a}=this.getProps(["x","y"],r);return Math.pow(n-o,2)+Math.pow(e-a,2)<Math.pow(t.hitRadius+t.radius,2)}inXRange(n,e){return Xg(this,n,"x",e)}inYRange(n,e){return Xg(this,n,"y",e)}getCenterPoint(n){const{x:e,y:r}=this.getProps(["x","y"],n);return{x:e,y:r}}size(n){n=n||this.options||{};let e=n.radius||0;e=Math.max(e,e&&n.hoverRadius||0);const r=e&&n.borderWidth||0;return(e+r)*2}draw(n,e){const r=this.options;this.skip||r.radius<.1||!Zi(this,e,this.size(r)/2)||(n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.fillStyle=r.backgroundColor,Gu(n,r,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Nl.id="point",Nl.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Nl.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function Kg(i,n){const{x:e,y:r,base:t,width:o,height:a}=i.getProps(["x","y","base","width","height"],n);let s,u,c,M,d;return i.horizontal?(d=a/2,s=Math.min(e,t),u=Math.max(e,t),c=r-d,M=r+d):(d=o/2,s=e-d,u=e+d,c=Math.min(r,t),M=Math.max(r,t)),{left:s,top:c,right:u,bottom:M}}function Sn(i,n,e,r){return i?0:gt(n,e,r)}function QT(i,n,e){const r=i.options.borderWidth,t=i.borderSkipped,o=Gd(r);return{t:Sn(t.top,o.top,0,e),r:Sn(t.right,o.right,0,n),b:Sn(t.bottom,o.bottom,0,e),l:Sn(t.left,o.left,0,n)}}function YT(i,n,e){const{enableBorderRadius:r}=i.getProps(["enableBorderRadius"]),t=i.options.borderRadius,o=Ni(t),a=Math.min(n,e),s=i.borderSkipped,u=r||be(t);return{topLeft:Sn(!u||s.top||s.left,o.topLeft,0,a),topRight:Sn(!u||s.top||s.right,o.topRight,0,a),bottomLeft:Sn(!u||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:Sn(!u||s.bottom||s.right,o.bottomRight,0,a)}}function UT(i){const n=Kg(i),e=n.right-n.left,r=n.bottom-n.top,t=QT(i,e/2,r/2),o=YT(i,e/2,r/2);return{outer:{x:n.left,y:n.top,w:e,h:r,radius:o},inner:{x:n.left+t.l,y:n.top+t.t,w:e-t.l-t.r,h:r-t.t-t.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(t.t,t.l)),topRight:Math.max(0,o.topRight-Math.max(t.t,t.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(t.b,t.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(t.b,t.r))}}}}function jl(i,n,e,r){const t=n===null,o=e===null,s=i&&!(t&&o)&&Kg(i,r);return s&&(t||Jo(n,s.left,s.right))&&(o||Jo(e,s.top,s.bottom))}function _T(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function BT(i,n){i.rect(n.x,n.y,n.w,n.h)}function hl(i,n,e={}){const r=i.x!==e.x?-n:0,t=i.y!==e.y?-n:0,o=(i.x+i.w!==e.x+e.w?n:0)-r,a=(i.y+i.h!==e.y+e.h?n:0)-t;return{x:i.x+r,y:i.y+t,w:i.w+o,h:i.h+a,radius:i.radius}}class pa extends jn{constructor(n){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,n&&Object.assign(this,n)}draw(n){const{inflateAmount:e,options:{borderColor:r,backgroundColor:t}}=this,{inner:o,outer:a}=UT(this),s=_T(a.radius)?ra:BT;n.save(),(a.w!==o.w||a.h!==o.h)&&(n.beginPath(),s(n,hl(a,e,o)),n.clip(),s(n,hl(o,-e,a)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),s(n,hl(o,e)),n.fillStyle=t,n.fill(),n.restore()}inRange(n,e,r){return jl(this,n,e,r)}inXRange(n,e){return jl(this,n,null,e)}inYRange(n,e){return jl(this,null,n,e)}getCenterPoint(n){const{x:e,y:r,base:t,horizontal:o}=this.getProps(["x","y","base","horizontal"],n);return{x:o?(e+t)/2:e,y:o?r:(r+t)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}}pa.id="bar",pa.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},pa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};const tr={average(i){if(!i.length)return!1;let n,e,r=0,t=0,o=0;for(n=0,e=i.length;n<e;++n){const a=i[n].element;if(a&&a.hasValue()){const s=a.tooltipPosition();r+=s.x,t+=s.y,++o}}return{x:r/o,y:t/o}},nearest(i,n){if(!i.length)return!1;let e=n.x,r=n.y,t=Number.POSITIVE_INFINITY,o,a,s;for(o=0,a=i.length;o<a;++o){const u=i[o].element;if(u&&u.hasValue()){const c=u.getCenterPoint(),M=Su(n,c);M<t&&(t=M,s=u)}}if(s){const u=s.tooltipPosition();e=u.x,r=u.y}return{x:e,y:r}}};function rn(i,n){return n&&(Ge(n)?Array.prototype.push.apply(i,n):i.push(n)),i}function hn(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
18
18
|
`)>-1?i.split(`
|
|
19
|
-
`):i}function PT(i,n){const{element:e,datasetIndex:r,index:t}=n,o=i.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(t);return{chart:i,label:a,parsed:o.getParsed(t),raw:i.data.datasets[r].data[t],formattedValue:s,dataset:o.getDataset(),dataIndex:t,datasetIndex:r,element:e}}function qg(i,n){const e=i.chart.ctx,{body:r,footer:t,title:o}=i,{boxWidth:a,boxHeight:s}=n,u=xt(n.bodyFont),c=xt(n.titleFont),M=xt(n.footerFont),d=o.length,g=t.length,f=r.length,j=Ot(n.padding);let p=j.height,x=0,N=r.reduce((m,I)=>m+I.before.length+I.lines.length+I.after.length,0);if(N+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*n.titleSpacing+n.titleMarginBottom),N){const m=n.displayColors?Math.max(s,u.lineHeight):u.lineHeight;p+=f*m+(N-f)*u.lineHeight+(N-1)*n.bodySpacing}g&&(p+=n.footerMarginTop+g*M.lineHeight+(g-1)*n.footerSpacing);let h=0;const z=function(m){x=Math.max(x,e.measureText(m).width+h)};return e.save(),e.font=c.string,Ye(i.title,z),e.font=u.string,Ye(i.beforeBody.concat(i.afterBody),z),h=n.displayColors?a+2+n.boxPadding:0,Ye(r,m=>{Ye(m.before,z),Ye(m.lines,z),Ye(m.after,z)}),h=0,e.font=M.string,Ye(i.footer,z),e.restore(),x+=j.width,{width:x,height:p}}function RT(i,n){const{y:e,height:r}=n;return e<r/2?"top":e>i.height-r/2?"bottom":"center"}function ZT(i,n,e,r){const{x:t,width:o}=r,a=e.caretSize+e.caretPadding;if(i==="left"&&t+o+a>n.width||i==="right"&&t-o-a<0)return!0}function VT(i,n,e,r){const{x:t,width:o}=e,{width:a,chartArea:{left:s,right:u}}=i;let c="center";return r==="center"?c=t<=(s+u)/2?"left":"right":t<=o/2?c="left":t>=a-o/2&&(c="right"),ZT(c,i,n,e)&&(c="center"),c}function ef(i,n,e){const r=e.yAlign||n.yAlign||RT(i,e);return{xAlign:e.xAlign||n.xAlign||VT(i,n,e,r),yAlign:r}}function GT(i,n){let{x:e,width:r}=i;return n==="right"?e-=r:n==="center"&&(e-=r/2),e}function WT(i,n,e){let{y:r,height:t}=i;return n==="top"?r+=e:n==="bottom"?r-=t+e:r-=t/2,r}function tf(i,n,e,r){const{caretSize:t,caretPadding:o,cornerRadius:a}=i,{xAlign:s,yAlign:u}=e,c=t+o,{topLeft:M,topRight:d,bottomLeft:g,bottomRight:f}=Ni(a);let j=GT(n,s);const p=WT(n,u,c);return u==="center"?s==="left"?j+=c:s==="right"&&(j-=c):s==="left"?j-=Math.max(M,g)+t:s==="right"&&(j+=Math.max(d,f)+t),{x:gt(j,0,r.width-n.width),y:gt(p,0,r.height-n.height)}}function Da(i,n,e){const r=Ot(e.padding);return n==="center"?i.x+i.width/2:n==="right"?i.x+i.width-r.right:i.x+r.left}function nf(i){return rn([],hn(i))}function HT(i,n,e){return En(i,{tooltip:n,tooltipItems:e,type:"tooltip"})}function rf(i,n){const e=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return e?i.override(e):i}let Il=class extends jn{constructor(n){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=n.chart||n._chart,this._chart=this.chart,this.options=n.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(n){this.options=n,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const n=this._cachedAnimations;if(n)return n;const e=this.chart,r=this.options.setContext(this.getContext()),t=r.enabled&&e.options.animation&&r.animations,o=new lg(this.chart,t);return t._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=HT(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,e){const{callbacks:r}=e,t=r.beforeTitle.apply(this,[n]),o=r.title.apply(this,[n]),a=r.afterTitle.apply(this,[n]);let s=[];return s=rn(s,hn(t)),s=rn(s,hn(o)),s=rn(s,hn(a)),s}getBeforeBody(n,e){return nf(e.callbacks.beforeBody.apply(this,[n]))}getBody(n,e){const{callbacks:r}=e,t=[];return Ye(n,o=>{const a={before:[],lines:[],after:[]},s=rf(r,o);rn(a.before,hn(s.beforeLabel.call(this,o))),rn(a.lines,s.label.call(this,o)),rn(a.after,hn(s.afterLabel.call(this,o))),t.push(a)}),t}getAfterBody(n,e){return nf(e.callbacks.afterBody.apply(this,[n]))}getFooter(n,e){const{callbacks:r}=e,t=r.beforeFooter.apply(this,[n]),o=r.footer.apply(this,[n]),a=r.afterFooter.apply(this,[n]);let s=[];return s=rn(s,hn(t)),s=rn(s,hn(o)),s=rn(s,hn(a)),s}_createItems(n){const e=this._active,r=this.chart.data,t=[],o=[],a=[];let s=[],u,c;for(u=0,c=e.length;u<c;++u)s.push(PT(this.chart,e[u]));return n.filter&&(s=s.filter((M,d,g)=>n.filter(M,d,g,r))),n.itemSort&&(s=s.sort((M,d)=>n.itemSort(M,d,r))),Ye(s,M=>{const d=rf(n.callbacks,M);t.push(d.labelColor.call(this,M)),o.push(d.labelPointStyle.call(this,M)),a.push(d.labelTextColor.call(this,M))}),this.labelColors=t,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(n,e){const r=this.options.setContext(this.getContext()),t=this._active;let o,a=[];if(!t.length)this.opacity!==0&&(o={opacity:0});else{const s=tr[r.position].call(this,t,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const u=this._size=qg(this,r),c=Object.assign({},s,u),M=ef(this.chart,r,c),d=tf(r,c,M,this.chart);this.xAlign=M.xAlign,this.yAlign=M.yAlign,o={opacity:1,x:d.x,y:d.y,width:u.width,height:u.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),n&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(n,e,r,t){const o=this.getCaretPosition(n,r,t);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(n,e,r){const{xAlign:t,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:u,topRight:c,bottomLeft:M,bottomRight:d}=Ni(s),{x:g,y:f}=n,{width:j,height:p}=e;let x,N,h,z,m,I;return o==="center"?(m=f+p/2,t==="left"?(x=g,N=x-a,z=m+a,I=m-a):(x=g+j,N=x+a,z=m-a,I=m+a),h=x):(t==="left"?N=g+Math.max(u,M)+a:t==="right"?N=g+j-Math.max(c,d)-a:N=this.caretX,o==="top"?(z=f,m=z-a,x=N-a,h=N+a):(z=f+p,m=z+a,x=N+a,h=N-a),I=z),{x1:x,x2:N,x3:h,y1:z,y2:m,y3:I}}drawTitle(n,e,r){const t=this.title,o=t.length;let a,s,u;if(o){const c=Ku(r.rtl,this.x,this.width);for(n.x=Da(this,r.titleAlign,r),e.textAlign=c.textAlign(r.titleAlign),e.textBaseline="middle",a=xt(r.titleFont),s=r.titleSpacing,e.fillStyle=r.titleColor,e.font=a.string,u=0;u<o;++u)e.fillText(t[u],c.x(n.x),n.y+a.lineHeight/2),n.y+=a.lineHeight+s,u+1===o&&(n.y+=r.titleMarginBottom-s)}}_drawColorBox(n,e,r,t,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:u,boxWidth:c,boxPadding:M}=o,d=xt(o.bodyFont),g=Da(this,"left",o),f=t.x(g),j=u<d.lineHeight?(d.lineHeight-u)/2:0,p=e.y+j;if(o.usePointStyle){const x={radius:Math.min(c,u)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},N=t.leftForLtr(f,c)+c/2,h=p+u/2;n.strokeStyle=o.multiKeyBackground,n.fillStyle=o.multiKeyBackground,Gu(n,x,N,h),n.strokeStyle=a.borderColor,n.fillStyle=a.backgroundColor,Gu(n,x,N,h)}else{n.lineWidth=be(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,n.strokeStyle=a.borderColor,n.setLineDash(a.borderDash||[]),n.lineDashOffset=a.borderDashOffset||0;const x=t.leftForLtr(f,c-M),N=t.leftForLtr(t.xPlus(f,1),c-M-2),h=Ni(a.borderRadius);Object.values(h).some(z=>z!==0)?(n.beginPath(),n.fillStyle=o.multiKeyBackground,ra(n,{x,y:p,w:c,h:u,radius:h}),n.fill(),n.stroke(),n.fillStyle=a.backgroundColor,n.beginPath(),ra(n,{x:N,y:p+1,w:c-2,h:u-2,radius:h}),n.fill()):(n.fillStyle=o.multiKeyBackground,n.fillRect(x,p,c,u),n.strokeRect(x,p,c,u),n.fillStyle=a.backgroundColor,n.fillRect(N,p+1,c-2,u-2))}n.fillStyle=this.labelTextColors[r]}drawBody(n,e,r){const{body:t}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:u,boxWidth:c,boxPadding:M}=r,d=xt(r.bodyFont);let g=d.lineHeight,f=0;const j=Ku(r.rtl,this.x,this.width),p=function(L){e.fillText(L,j.x(n.x+f),n.y+g/2),n.y+=g+o},x=j.textAlign(a);let N,h,z,m,I,D,v;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,n.x=Da(this,x,r),e.fillStyle=r.bodyColor,Ye(this.beforeBody,p),f=s&&x!=="right"?a==="center"?c/2+M:c+2+M:0,m=0,D=t.length;m<D;++m){for(N=t[m],h=this.labelTextColors[m],e.fillStyle=h,Ye(N.before,p),z=N.lines,s&&z.length&&(this._drawColorBox(e,n,m,j,r),g=Math.max(d.lineHeight,u)),I=0,v=z.length;I<v;++I)p(z[I]),g=d.lineHeight;Ye(N.after,p)}f=0,g=d.lineHeight,Ye(this.afterBody,p),n.y-=o}drawFooter(n,e,r){const t=this.footer,o=t.length;let a,s;if(o){const u=Ku(r.rtl,this.x,this.width);for(n.x=Da(this,r.footerAlign,r),n.y+=r.footerMarginTop,e.textAlign=u.textAlign(r.footerAlign),e.textBaseline="middle",a=xt(r.footerFont),e.fillStyle=r.footerColor,e.font=a.string,s=0;s<o;++s)e.fillText(t[s],u.x(n.x),n.y+a.lineHeight/2),n.y+=a.lineHeight+r.footerSpacing}}drawBackground(n,e,r,t){const{xAlign:o,yAlign:a}=this,{x:s,y:u}=n,{width:c,height:M}=r,{topLeft:d,topRight:g,bottomLeft:f,bottomRight:j}=Ni(t.cornerRadius);e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,e.lineWidth=t.borderWidth,e.beginPath(),e.moveTo(s+d,u),a==="top"&&this.drawCaret(n,e,r,t),e.lineTo(s+c-g,u),e.quadraticCurveTo(s+c,u,s+c,u+g),a==="center"&&o==="right"&&this.drawCaret(n,e,r,t),e.lineTo(s+c,u+M-j),e.quadraticCurveTo(s+c,u+M,s+c-j,u+M),a==="bottom"&&this.drawCaret(n,e,r,t),e.lineTo(s+f,u+M),e.quadraticCurveTo(s,u+M,s,u+M-f),a==="center"&&o==="left"&&this.drawCaret(n,e,r,t),e.lineTo(s,u+d),e.quadraticCurveTo(s,u,s+d,u),e.closePath(),e.fill(),t.borderWidth>0&&e.stroke()}_updateAnimationTarget(n){const e=this.chart,r=this.$animations,t=r&&r.x,o=r&&r.y;if(t||o){const a=tr[n.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=qg(this,n),u=Object.assign({},a,this._size),c=ef(e,n,u),M=tf(n,u,c,e);(t._to!==M.x||o._to!==M.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,M))}}_willRender(){return!!this.opacity}draw(n){const e=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(e);const t={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=Ot(e.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&s&&(n.save(),n.globalAlpha=r,this.drawBackground(o,n,t,e),kx(n,e.textDirection),o.y+=a.top,this.drawTitle(o,n,e),this.drawBody(o,n,e),this.drawFooter(o,n,e),bx(n,e.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,e){const r=this._active,t=n.map(({datasetIndex:s,index:u})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[u],index:u}}),o=!Ho(r,t),a=this._positionChanged(t,e);(o||a)&&(this._active=t,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,e,r=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const t=this.options,o=this._active||[],a=this._getActiveElements(n,o,e,r),s=this._positionChanged(a,n),u=e||!Ho(a,o)||s;return u&&(this._active=a,(t.enabled||t.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,e))),u}_getActiveElements(n,e,r,t){const o=this.options;if(n.type==="mouseout")return[];if(!t)return e;const a=this.chart.getElementsAtEventForMode(n,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(n,e){const{caretX:r,caretY:t,options:o}=this,a=tr[o.position].call(this,n,e);return a!==!1&&(r!==a.x||t!==a.y)}};Il.positioners=tr;var FT={id:"tooltip",_element:Il,positioners:tr,afterInit(i,n,e){e&&(i.tooltip=new Il({chart:i,options:e}))},beforeUpdate(i,n,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,n,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const n=i.tooltip;if(n&&n._willRender()){const e={tooltip:n};if(i.notifyPlugins("beforeTooltipDraw",e)===!1)return;n.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,n){if(i.tooltip){const e=n.replay;i.tooltip.handleEvent(n.event,e,n.inChartArea)&&(n.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,n)=>n.bodyFont.size,boxWidth:(i,n)=>n.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:{beforeTitle:fn,title(i){if(i.length>0){const n=i[0],e=n.chart.data.labels,r=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(r>0&&n.dataIndex<r)return e[n.dataIndex]}return""},afterTitle:fn,beforeBody:fn,beforeLabel:fn,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let n=i.dataset.label||"";n&&(n+=": ");const e=i.formattedValue;return Se(e)||(n+=e),n},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:fn,afterBody:fn,beforeFooter:fn,footer:fn,afterFooter:fn}},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 $T=(i,n,e,r)=>(typeof n=="string"?(e=i.push(n)-1,r.unshift({index:e,label:n})):isNaN(n)&&(e=null),e);function JT(i,n,e,r){const t=i.indexOf(n);if(t===-1)return $T(i,n,e,r);const o=i.lastIndexOf(n);return t!==o?e:t}const XT=(i,n)=>i===null?null:gt(Math.round(i),0,n);class ma extends ti{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const e=this._addedLabels;if(e.length){const r=this.getLabels();for(const{index:t,label:o}of e)r[t]===o&&r.splice(t,1);this._addedLabels=[]}super.init(n)}parse(n,e){if(Se(n))return null;const r=this.getLabels();return e=isFinite(e)&&r[e]===n?e:JT(r,n,we(e,n),this._addedLabels),XT(e,r.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:e}=this.getUserBounds();let{min:r,max:t}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(r=0),e||(t=this.getLabels().length-1)),this.min=r,this.max=t}buildTicks(){const n=this.min,e=this.max,r=this.options.offset,t=[];let o=this.getLabels();o=n===0&&e===o.length-1?o:o.slice(n,e+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=n;a<=e;a++)t.push({value:a});return t}getLabelForValue(n){const e=this.getLabels();return n>=0&&n<e.length?e[n]:n}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(n){return typeof n!="number"&&(n=this.parse(n)),n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getPixelForTick(n){const e=this.ticks;return n<0||n>e.length-1?null:this.getPixelForValue(e[n].value)}getValueForPixel(n){return Math.round(this._startValue+this.getDecimalForPixel(n)*this._valueRange)}getBasePixel(){return this.bottom}}ma.id="category",ma.defaults={ticks:{callback:ma.prototype.getLabelForValue}};function KT(i,n){const e=[],{bounds:t,step:o,min:a,max:s,precision:u,count:c,maxTicks:M,maxDigits:d,includeBounds:g}=i,f=o||1,j=M-1,{min:p,max:x}=n,N=!Se(a),h=!Se(s),z=!Se(c),m=(x-p)/(d+1);let I=hd((x-p)/j/f)*f,D,v,L,w;if(I<1e-14&&!N&&!h)return[{value:p},{value:x}];w=Math.ceil(x/I)-Math.floor(p/I),w>j&&(I=hd(w*I/j/f)*f),Se(u)||(D=Math.pow(10,u),I=Math.ceil(I*D)/D),t==="ticks"?(v=Math.floor(p/I)*I,L=Math.ceil(x/I)*I):(v=p,L=x),N&&h&&o&&dz((s-a)/o,I/1e3)?(w=Math.round(Math.min((s-a)/I,M)),I=(s-a)/w,v=a,L=s):z?(v=N?a:v,L=h?s:L,w=c-1,I=(L-v)/w):(w=(L-v)/I,Yi(w,Math.round(w),I/1e3)?w=Math.round(w):w=Math.ceil(w));const E=Math.max(pd(I),pd(v));D=Math.pow(10,Se(u)?E:u),v=Math.round(v*D)/D,L=Math.round(L*D)/D;let T=0;for(N&&(g&&v!==a?(e.push({value:a}),v<a&&T++,Yi(Math.round((v+T*I)*D)/D,a,of(a,m,i))&&T++):v<a&&T++);T<w;++T)e.push({value:Math.round((v+T*I)*D)/D});return h&&g&&L!==s?e.length&&Yi(e[e.length-1].value,s,of(s,m,i))?e[e.length-1].value=s:e.push({value:s}):(!h||L===s)&&e.push({value:L}),e}function of(i,n,{horizontal:e,minRotation:r}){const t=Rt(r),o=(e?Math.sin(t):Math.cos(t))||.001,a=.75*n*(""+i).length;return Math.min(n/o,a)}class za extends ti{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(n,e){return Se(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:e,maxDefined:r}=this.getUserBounds();let{min:t,max:o}=this;const a=u=>t=e?t:u,s=u=>o=r?o:u;if(n){const u=tn(t),c=tn(o);u<0&&c<0?s(0):u>0&&c>0&&a(0)}if(t===o){let u=1;(o>=Number.MAX_SAFE_INTEGER||t<=Number.MIN_SAFE_INTEGER)&&(u=Math.abs(o*.05)),s(o+u),n||a(t-u)}this.min=t,this.max=o}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:e,stepSize:r}=n,t;return r?(t=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),e=e||11),e&&(t=Math.min(e,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,e=n.ticks;let r=this.getTickLimit();r=Math.max(2,r);const t={maxTicks:r,bounds:n.bounds,min:n.min,max:n.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=KT(t,o);return n.bounds==="ticks"&&Id(a,this,"value"),n.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const n=this.ticks;let e=this.min,r=this.max;if(super.configure(),this.options.offset&&n.length){const t=(r-e)/Math.max(n.length-1,1)/2;e-=t,r+=t}this._startValue=e,this._endValue=r,this._valueRange=r-e}getLabelForValue(n){return Vi(n,this.chart.options.locale,this.options.ticks.format)}}class pl extends za{determineDataLimits(){const{min:n,max:e}=this.getMinMax(!0);this.min=ct(n)?n:0,this.max=ct(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),e=n?this.width:this.height,r=Rt(this.options.ticks.minRotation),t=(n?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/t))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}pl.id="linear",pl.defaults={ticks:{callback:ca.formatters.numeric}};function af(i){return i/Math.pow(10,Math.floor(bt(i)))===1}function qT(i,n){const e=Math.floor(bt(n.max)),r=Math.ceil(n.max/Math.pow(10,e)),t=[];let o=vt(i.min,Math.pow(10,Math.floor(bt(n.min)))),a=Math.floor(bt(o)),s=Math.floor(o/Math.pow(10,a)),u=a<0?Math.pow(10,Math.abs(a)):1;do t.push({value:o,major:af(o)}),++s,s===10&&(s=1,++a,u=a>=0?1:u),o=Math.round(s*Math.pow(10,a)*u)/u;while(a<e||a===e&&s<r);const c=vt(i.max,o);return t.push({value:c,major:af(o)}),t}class sf extends ti{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(n,e){const r=za.prototype.parse.apply(this,[n,e]);if(r===0){this._zero=!0;return}return ct(r)&&r>0?r:null}determineDataLimits(){const{min:n,max:e}=this.getMinMax(!0);this.min=ct(n)?Math.max(0,n):null,this.max=ct(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:n,maxDefined:e}=this.getUserBounds();let r=this.min,t=this.max;const o=u=>r=n?r:u,a=u=>t=e?t:u,s=(u,c)=>Math.pow(10,Math.floor(bt(u))+c);r===t&&(r<=0?(o(1),a(10)):(o(s(r,-1)),a(s(t,1)))),r<=0&&o(s(t,-1)),t<=0&&a(s(r,1)),this._zero&&this.min!==this._suggestedMin&&r===s(this.min,0)&&o(s(r,-1)),this.min=r,this.max=t}buildTicks(){const n=this.options,e={min:this._userMin,max:this._userMax},r=qT(e,this);return n.bounds==="ticks"&&Id(r,this,"value"),n.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(n){return n===void 0?"0":Vi(n,this.chart.options.locale,this.options.ticks.format)}configure(){const n=this.min;super.configure(),this._startValue=bt(n),this._valueRange=bt(this.max)-bt(n)}getPixelForValue(n){return(n===void 0||n===0)&&(n=this.min),n===null||isNaN(n)?NaN:this.getPixelForDecimal(n===this.min?0:(bt(n)-this._startValue)/this._valueRange)}getValueForPixel(n){const e=this.getDecimalForPixel(n);return Math.pow(10,this._startValue+e*this._valueRange)}}sf.id="logarithmic",sf.defaults={ticks:{callback:ca.formatters.logarithmic,major:{enabled:!0}}};function Dl(i){const n=i.ticks;if(n.display&&i.display){const e=Ot(n.backdropPadding);return we(n.font&&n.font.size,ke.font.size)+e.height}return 0}function eL(i,n,e){return e=Ge(e)?e:[e],{w:Vz(i,n.string,e),h:e.length*n.lineHeight}}function uf(i,n,e,r,t){return i===r||i===t?{start:n-e/2,end:n+e/2}:i<r||i>t?{start:n-e,end:n}:{start:n,end:n+e}}function tL(i){const n={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},n),r=[],t=[],o=i._pointLabels.length,a=i.options.pointLabels,s=a.centerPointLabels?qe/o:0;for(let u=0;u<o;u++){const c=a.setContext(i.getPointLabelContext(u));t[u]=c.padding;const M=i.getPointPosition(u,i.drawingArea+t[u],s),d=xt(c.font),g=eL(i.ctx,d,i._pointLabels[u]);r[u]=g;const f=Zt(i.getIndexAngle(u)+s),j=Math.round(Cu(f)),p=uf(j,M.x,g.w,0,180),x=uf(j,M.y,g.h,90,270);nL(e,n,f,p,x)}i.setCenterPoint(n.l-e.l,e.r-n.r,n.t-e.t,e.b-n.b),i._pointLabelItems=iL(i,r,t)}function nL(i,n,e,r,t){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let s=0,u=0;r.start<n.l?(s=(n.l-r.start)/o,i.l=Math.min(i.l,n.l-s)):r.end>n.r&&(s=(r.end-n.r)/o,i.r=Math.max(i.r,n.r+s)),t.start<n.t?(u=(n.t-t.start)/a,i.t=Math.min(i.t,n.t-u)):t.end>n.b&&(u=(t.end-n.b)/a,i.b=Math.max(i.b,n.b+u))}function iL(i,n,e){const r=[],t=i._pointLabels.length,o=i.options,a=Dl(o)/2,s=i.drawingArea,u=o.pointLabels.centerPointLabels?qe/t:0;for(let c=0;c<t;c++){const M=i.getPointPosition(c,s+a+e[c],u),d=Math.round(Cu(Zt(M.angle+et))),g=n[c],f=aL(M.y,g.h,d),j=rL(d),p=oL(M.x,g.w,j);r.push({x:M.x,y:f,textAlign:j,left:p,top:f,right:p+g.w,bottom:f+g.h})}return r}function rL(i){return i===0||i===180?"center":i<180?"left":"right"}function oL(i,n,e){return e==="right"?i-=n:e==="center"&&(i-=n/2),i}function aL(i,n,e){return e===90||e===270?i-=n/2:(e>270||e<90)&&(i-=n),i}function sL(i,n){const{ctx:e,options:{pointLabels:r}}=i;for(let t=n-1;t>=0;t--){const o=r.setContext(i.getPointLabelContext(t)),a=xt(o.font),{x:s,y:u,textAlign:c,left:M,top:d,right:g,bottom:f}=i._pointLabelItems[t],{backdropColor:j}=o;if(!Se(j)){const p=Ni(o.borderRadius),x=Ot(o.backdropPadding);e.fillStyle=j;const N=M-x.left,h=d-x.top,z=g-M+x.width,m=f-d+x.height;Object.values(p).some(I=>I!==0)?(e.beginPath(),ra(e,{x:N,y:h,w:z,h:m,radius:p}),e.fill()):e.fillRect(N,h,z,m)}ia(e,i._pointLabels[t],s,u+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}function lf(i,n,e,r){const{ctx:t}=i;if(e)t.arc(i.xCenter,i.yCenter,n,0,Pe);else{let o=i.getPointPosition(0,n);t.moveTo(o.x,o.y);for(let a=1;a<r;a++)o=i.getPointPosition(a,n),t.lineTo(o.x,o.y)}}function uL(i,n,e,r){const t=i.ctx,o=n.circular,{color:a,lineWidth:s}=n;!o&&!r||!a||!s||e<0||(t.save(),t.strokeStyle=a,t.lineWidth=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,t.beginPath(),lf(i,e,o,r),t.closePath(),t.stroke(),t.restore())}function lL(i,n,e){return En(i,{label:e,index:n,type:"pointLabel"})}class xa extends za{constructor(n){super(n),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const n=this._padding=Ot(Dl(this.options)/2),e=this.width=this.maxWidth-n.width,r=this.height=this.maxHeight-n.height;this.xCenter=Math.floor(this.left+e/2+n.left),this.yCenter=Math.floor(this.top+r/2+n.top),this.drawingArea=Math.floor(Math.min(e,r)/2)}determineDataLimits(){const{min:n,max:e}=this.getMinMax(!1);this.min=ct(n)&&!isNaN(n)?n:0,this.max=ct(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Dl(this.options))}generateTickLabels(n){za.prototype.generateTickLabels.call(this,n),this._pointLabels=this.getLabels().map((e,r)=>{const t=Ke(this.options.pointLabels.callback,[e,r],this);return t||t===0?t:""}).filter((e,r)=>this.chart.getDataVisibility(r))}fit(){const n=this.options;n.display&&n.pointLabels.display?tL(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(n,e,r,t){this.xCenter+=Math.floor((n-e)/2),this.yCenter+=Math.floor((r-t)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(n,e,r,t))}getIndexAngle(n){const e=Pe/(this._pointLabels.length||1),r=this.options.startAngle||0;return Zt(n*e+Rt(r))}getDistanceFromCenterForValue(n){if(Se(n))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-n)*e:(n-this.min)*e}getValueForDistanceFromCenter(n){if(Se(n))return NaN;const e=n/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(n){const e=this._pointLabels||[];if(n>=0&&n<e.length){const r=e[n];return lL(this.getContext(),n,r)}}getPointPosition(n,e,r=0){const t=this.getIndexAngle(n)-et+r;return{x:Math.cos(t)*e+this.xCenter,y:Math.sin(t)*e+this.yCenter,angle:t}}getPointPositionForValue(n,e){return this.getPointPosition(n,this.getDistanceFromCenterForValue(e))}getBasePosition(n){return this.getPointPositionForValue(n||0,this.getBaseValue())}getPointLabelPosition(n){const{left:e,top:r,right:t,bottom:o}=this._pointLabelItems[n];return{left:e,top:r,right:t,bottom:o}}drawBackground(){const{backgroundColor:n,grid:{circular:e}}=this.options;if(n){const r=this.ctx;r.save(),r.beginPath(),lf(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),r.closePath(),r.fillStyle=n,r.fill(),r.restore()}}drawGrid(){const n=this.ctx,e=this.options,{angleLines:r,grid:t}=e,o=this._pointLabels.length;let a,s,u;if(e.pointLabels.display&&sL(this,o),t.display&&this.ticks.forEach((c,M)=>{if(M!==0){s=this.getDistanceFromCenterForValue(c.value);const d=t.setContext(this.getContext(M-1));uL(this,d,s,o)}}),r.display){for(n.save(),a=o-1;a>=0;a--){const c=r.setContext(this.getPointLabelContext(a)),{color:M,lineWidth:d}=c;!d||!M||(n.lineWidth=d,n.strokeStyle=M,n.setLineDash(c.borderDash),n.lineDashOffset=c.borderDashOffset,s=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),u=this.getPointPosition(a,s),n.beginPath(),n.moveTo(this.xCenter,this.yCenter),n.lineTo(u.x,u.y),n.stroke())}n.restore()}}drawBorder(){}drawLabels(){const n=this.ctx,e=this.options,r=e.ticks;if(!r.display)return;const t=this.getIndexAngle(0);let o,a;n.save(),n.translate(this.xCenter,this.yCenter),n.rotate(t),n.textAlign="center",n.textBaseline="middle",this.ticks.forEach((s,u)=>{if(u===0&&!e.reverse)return;const c=r.setContext(this.getContext(u)),M=xt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[u].value),c.showLabelBackdrop){n.font=M.string,a=n.measureText(s.label).width,n.fillStyle=c.backdropColor;const d=Ot(c.backdropPadding);n.fillRect(-a/2-d.left,-o-M.size/2-d.top,a+d.width,M.size+d.height)}ia(n,s.label,0,-o,M,{color:c.color})}),n.restore()}drawTitle(){}}xa.id="radialLinear",xa.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ca.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}},xa.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},xa.descriptors={angleLines:{_fallback:"grid"}};const Aa={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}},Dt=Object.keys(Aa);function cL(i,n){return i-n}function cf(i,n){if(Se(n))return null;const e=i._adapter,{parser:r,round:t,isoWeekday:o}=i._parseOpts;let a=n;return typeof r=="function"&&(a=r(a)),ct(a)||(a=typeof r=="string"?e.parse(a,r):e.parse(a)),a===null?null:(t&&(a=t==="week"&&(fi(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,t)),+a)}function Mf(i,n,e,r){const t=Dt.length;for(let o=Dt.indexOf(i);o<t-1;++o){const a=Aa[Dt[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-n)/(s*a.size))<=r)return Dt[o]}return Dt[t-1]}function ML(i,n,e,r,t){for(let o=Dt.length-1;o>=Dt.indexOf(e);o--){const a=Dt[o];if(Aa[a].common&&i._adapter.diff(t,r,a)>=n-1)return a}return Dt[e?Dt.indexOf(e):0]}function dL(i){for(let n=Dt.indexOf(i)+1,e=Dt.length;n<e;++n)if(Aa[Dt[n]].common)return Dt[n]}function df(i,n,e){if(!e)i[n]=!0;else if(e.length){const{lo:r,hi:t}=Qu(e,n),o=e[r]>=n?e[r]:e[t];i[o]=!0}}function gL(i,n,e,r){const t=i._adapter,o=+t.startOf(n[0].value,r),a=n[n.length-1].value;let s,u;for(s=o;s<=a;s=+t.add(s,1,r))u=e[s],u>=0&&(n[u].major=!0);return n}function gf(i,n,e){const r=[],t={},o=n.length;let a,s;for(a=0;a<o;++a)s=n[a],t[s]=a,r.push({value:s,major:!1});return o===0||!e?r:gL(i,r,t,e)}class Ta extends ti{constructor(n){super(n),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(n,e){const r=n.time||(n.time={}),t=this._adapter=new wA._date(n.adapters.date);t.init(e),Si(r.displayFormats,t.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(n),this._normalized=e.normalized}parse(n,e){return n===void 0?null:cf(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,e=this._adapter,r=n.time.unit||"day";let{min:t,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function u(c){!a&&!isNaN(c.min)&&(t=Math.min(t,c.min)),!s&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!s)&&(u(this._getLabelBounds()),(n.bounds!=="ticks"||n.ticks.source!=="labels")&&u(this.getMinMax(!1))),t=ct(t)&&!isNaN(t)?t:+e.startOf(Date.now(),r),o=ct(o)&&!isNaN(o)?o:+e.endOf(Date.now(),r)+1,this.min=Math.min(t,o-1),this.max=Math.max(t+1,o)}_getLabelBounds(){const n=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return n.length&&(e=n[0],r=n[n.length-1]),{min:e,max:r}}buildTicks(){const n=this.options,e=n.time,r=n.ticks,t=r.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&t.length&&(this.min=this._userMin||t[0],this.max=this._userMax||t[t.length-1]);const o=this.min,a=this.max,s=Nz(t,o,a);return this._unit=e.unit||(r.autoSkip?Mf(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):ML(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:dL(this._unit),this.initOffsets(t),n.reverse&&s.reverse(),gf(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n){let e=0,r=0,t,o;this.options.offset&&n.length&&(t=this.getDecimalForValue(n[0]),n.length===1?e=1-t:e=(this.getDecimalForValue(n[1])-t)/2,o=this.getDecimalForValue(n[n.length-1]),n.length===1?r=o:r=(o-this.getDecimalForValue(n[n.length-2]))/2);const a=n.length<3?.5:.25;e=gt(e,0,a),r=gt(r,0,a),this._offsets={start:e,end:r,factor:1/(e+1+r)}}_generate(){const n=this._adapter,e=this.min,r=this.max,t=this.options,o=t.time,a=o.unit||Mf(o.minUnit,e,r,this._getLabelCapacity(e)),s=we(o.stepSize,1),u=a==="week"?o.isoWeekday:!1,c=fi(u)||u===!0,M={};let d=e,g,f;if(c&&(d=+n.startOf(d,"isoWeek",u)),d=+n.startOf(d,c?"day":a),n.diff(r,e,a)>1e5*s)throw new Error(e+" and "+r+" are too far apart with stepSize of "+s+" "+a);const j=t.ticks.source==="data"&&this.getDataTimestamps();for(g=d,f=0;g<r;g=+n.add(g,s,a),f++)df(M,g,j);return(g===r||t.bounds==="ticks"||f===1)&&df(M,g,j),Object.keys(M).sort((p,x)=>p-x).map(p=>+p)}getLabelForValue(n){const e=this._adapter,r=this.options.time;return r.tooltipFormat?e.format(n,r.tooltipFormat):e.format(n,r.displayFormats.datetime)}_tickFormatFunction(n,e,r,t){const o=this.options,a=o.time.displayFormats,s=this._unit,u=this._majorUnit,c=s&&a[s],M=u&&a[u],d=r[e],g=u&&M&&d&&d.major,f=this._adapter.format(n,t||(g?M:c)),j=o.ticks.callback;return j?Ke(j,[f,e,r],this):f}generateTickLabels(n){let e,r,t;for(e=0,r=n.length;e<r;++e)t=n[e],t.label=this._tickFormatFunction(t.value,e,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const e=this._offsets,r=this.getDecimalForValue(n);return this.getPixelForDecimal((e.start+r)*e.factor)}getValueForPixel(n){const e=this._offsets,r=this.getDecimalForPixel(n)/e.factor-e.end;return this.min+r*(this.max-this.min)}_getLabelSize(n){const e=this.options.ticks,r=this.ctx.measureText(n).width,t=Rt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(t),a=Math.sin(t),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(n){const e=this.options.time,r=e.displayFormats,t=r[e.unit]||r.millisecond,o=this._tickFormatFunction(n,0,gf(this,[n],this._majorUnit),t),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let n=this._cache.data||[],e,r;if(n.length)return n;const t=this.getMatchingVisibleMetas();if(this._normalized&&t.length)return this._cache.data=t[0].controller.getAllParsedValues(this);for(e=0,r=t.length;e<r;++e)n=n.concat(t[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let e,r;if(n.length)return n;const t=this.getLabels();for(e=0,r=t.length;e<r;++e)n.push(cf(this,t[e]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return xd(n.sort(cL))}}Ta.id="time",Ta.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function La(i,n,e){let r=0,t=i.length-1,o,a,s,u;e?(n>=i[r].pos&&n<=i[t].pos&&({lo:r,hi:t}=$n(i,"pos",n)),{pos:o,time:s}=i[r],{pos:a,time:u}=i[t]):(n>=i[r].time&&n<=i[t].time&&({lo:r,hi:t}=$n(i,"time",n)),{time:o,pos:s}=i[r],{time:a,pos:u}=i[t]);const c=a-o;return c?s+(u-s)*(n-o)/c:s}class ff extends Ta{constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const n=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(n);this._minPos=La(e,this.min),this._tableRange=La(e,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:e,max:r}=this,t=[],o=[];let a,s,u,c,M;for(a=0,s=n.length;a<s;++a)c=n[a],c>=e&&c<=r&&t.push(c);if(t.length<2)return[{time:e,pos:0},{time:r,pos:1}];for(a=0,s=t.length;a<s;++a)M=t[a+1],u=t[a-1],c=t[a],Math.round((M+u)/2)!==c&&o.push({time:c,pos:a/(s-1)});return o}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const e=this.getDataTimestamps(),r=this.getLabelTimestamps();return e.length&&r.length?n=this.normalize(e.concat(r)):n=e.length?e:r,n=this._cache.all=n,n}getDecimalForValue(n){return(La(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const e=this._offsets,r=this.getDecimalForPixel(n)/e.factor-e.end;return La(this._table,r*this._tableRange+this._minPos,!0)}}ff.id="timeseries",ff.defaults=Ta.defaults;var pi;(function(i){i.ChartRendered="chart:rendered",i.ChartUpdated="chart:updated",i.ChartDestroyed="chart:destroyed",i.LabelsUpdated="labels:updated"})(pi||(pi={}));function va(i,n,e,r){i(n,e),r!==void 0&&r.emit(pi.ChartRendered)}function fL(i,n){i.update(),n!==void 0&&n.emit(pi.ChartUpdated)}function ka(i,n){i.destroy(),n!==void 0&&n.emit(pi.ChartDestroyed)}function yL(i,n){const e={labels:typeof i.labels>"u"?[]:[...i.labels],datasets:[]};return yf(e,{...i},n),e}function yf(i,n,e){const r=[];i.datasets=n.datasets.map(t=>{const o=i.datasets.find(a=>a[e]===t[e]);return!o||!t.data||r.includes(o)?{...t}:(r.push(o),Object.assign(o,t),o)})}function NL(i,n,e){i.data.labels=n,e!==void 0&&e.emit(pi.LabelsUpdated)}function jL(i,n){i.options={...n}}function hL(i,n){const e=i.datasets.map(t=>t.label),r=n.datasets.map(t=>t.label);return n.datasets.length===i.datasets.length&&e.every((t,o)=>t===r[o])}const IL="Please remove the <template></template> tags from your chart component. See https://vue-chartjs.org/guide/#vue-single-file-components",pL="Update ERROR: chart instance not found",DL=((i,n,e)=>l.defineComponent({props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,default:()=>{}},datasetIdKey:{type:String,default:"label"},chartId:{type:String,default:i},width:{type:Number,default:400},height:{type:Number,default:400},cssClasses:{type:String,default:""},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(r,t){er.register(e);const o=l.shallowRef(null),a=l.ref(null);function s(d,g){if(o.value!==null&&ka(l.toRaw(o.value),t),a.value===null)throw new Error(IL);{const f=yL(d,r.datasetIdKey),j=a.value.getContext("2d");j!==null&&(o.value=new er(j,{type:n,data:l.isProxy(d)?new Proxy(f,{}):f,options:g,plugins:r.plugins}))}}function u(d,g){const f=l.isProxy(d)?l.toRaw(d):{...d},j=l.isProxy(g)?l.toRaw(g):{...g};if(Object.keys(j).length>0){const p=l.toRaw(o.value);hL(f,j)&&p!==null?(yf(p==null?void 0:p.data,f,r.datasetIdKey),f.labels!==void 0&&NL(p,f.labels,t),M()):(p!==null&&ka(p,t),va(s,r.chartData,r.chartOptions,t))}else o.value!==null&&ka(l.toRaw(o.value),t),va(s,r.chartData,r.chartOptions,t)}function c(d){const g=l.toRaw(o.value);g!==null?(jL(g,d),M()):va(s,r.chartData,r.chartOptions,t)}function M(){const d=l.toRaw(o.value);d!==null?fL(d,t):console.error(pL)}return l.watch(()=>r.chartData,(d,g)=>u(d,g),{deep:!0}),l.watch(()=>r.chartOptions,d=>c(d),{deep:!0}),l.onMounted(()=>{"datasets"in r.chartData&&r.chartData.datasets.length>0&&va(s,r.chartData,r.chartOptions,t)}),l.onBeforeUnmount(()=>{o.value!==null&&ka(l.toRaw(o.value),t)}),t.expose({chart:o,updateChart:M}),()=>l.h("div",{style:r.styles,class:r.cssClasses},[l.h("canvas",{id:r.chartId,width:r.width,height:r.height,ref:a})])}}))("bar-chart","bar",la),Vw="",mL={name:"MultiRangeSlider",props:{baseClassName:{type:String,default:"multi-range-slider"},min:{type:Number},max:{type:Number},minValue:{type:Number},maxValue:{type:Number},step:{type:Number,default:1},preventWheel:{type:Boolean,default:!1},ruler:{type:Boolean,default:!0},label:{type:Boolean,default:!0},labels:{type:Array},minCaption:{type:String},maxCaption:{type:String},rangeMargin:{type:Number}},data(){let i=this.labels||[],n=this.min===void 0?0:this.min,e=i.length?i.length-1:100,r=this.max===void 0?e:this.max,t=this.minValue===void 0?25:this.minValue;i.length&&this.minValue===void 0&&(t=1);let o=this.maxValue||75;if(i.length&&this.maxValue===void 0&&(o=i.length-2),r<=n)throw new Error("Invalid props min or max");if(t>o)throw new Error("Invalid props minValue or maxValue");let a=this.rangeMargin===void 0?this.step:this.rangeMargin,s=a%this.step;return s&&(a=a+this.step-s),{valueMin:t<n?n:t,valueMax:o>r?r:o,interVal:null,startX:null,mouseMoveCounter:null,barBox:null,barValue:0,rangeMarginValue:a}},methods:{onBarLeftClick(){this.valueMin-this.step>=this.minimum?this.valueMin-=this.step:this.valueMin=this.minimum},onInnerBarLeftClick(){this.valueMin+this.rangeMarginValue<this.valueMax&&(this.valueMin+=this.step)},onBarRightClick(){this.valueMax+this.step<=this.maximum?this.valueMax+=this.step:this.valueMax=this.maximum},onInnerBarRightClick(){this.valueMax-this.rangeMarginValue>this.valueMin&&(this.valueMax-=this.step)},onInputMinChange(i){let n=parseFloat(i.target.value);n<=this.valueMax-this.rangeMarginValue&&n>=this.minimum?this.valueMin=n:i.target.value=this.valueMin},onInputMaxChange(i){let n=parseFloat(i.target.value);n>=this.valueMin+this.rangeMarginValue&&n<=this.maximum?this.valueMax=n:i.target.value=this.valueMax},onLeftThumbMousedown(i){if(i.preventDefault(),this.startX=i.clientX,i.type==="touchstart")if(i.touches.length===1)this.startX=i.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMin,this.barBox=i.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onLeftThumbMousemove),document.addEventListener("mouseup",this.onLeftThumbMouseup),document.addEventListener("touchmove",this.onLeftThumbMousemove),document.addEventListener("touchend",this.onLeftThumbMouseup)},onLeftThumbMousemove(i){this.mouseMoveCounter++;let n=i.clientX;i.type==="touchmove"&&(n=i.touches[0].clientX);let r=(n-this.startX)/this.barBox.width,t=this.barValue+(this.maximum-this.minimum)*r,o=t%this.step;t-=o,t<this.minimum?t=this.minimum:t>this.valueMax-this.rangeMarginValue&&(t=this.valueMax-this.rangeMarginValue),this.valueMin=t},onLeftThumbMouseup(){document.removeEventListener("mousemove",this.onLeftThumbMousemove),document.removeEventListener("mouseup",this.onLeftThumbMouseup),document.removeEventListener("touchmove",this.onLeftThumbMousemove),document.removeEventListener("touchend",this.onLeftThumbMouseup)},onRightThumbMousedown(i){if(i.preventDefault(),this.startX=i.clientX,i.type==="touchstart")if(i.touches.length===1)this.startX=i.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMax,this.barBox=i.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onRightThumbMousemove),document.addEventListener("mouseup",this.onRightThumbMouseup),document.addEventListener("touchmove",this.onRightThumbMousemove),document.addEventListener("touchend",this.onRightThumbMouseup)},onRightThumbMousemove(i){this.mouseMoveCounter++;let n=i.clientX;i.type==="touchmove"&&(n=i.touches[0].clientX);let r=(n-this.startX)/this.barBox.width,t=this.barValue+(this.maximum-this.minimum)*r,o=t%this.step;t-=o,t<this.valueMin+this.rangeMarginValue?t=this.valueMin+this.rangeMarginValue:t>this.maximum&&(t=this.maximum),this.valueMax=t},onRightThumbMouseup(){document.removeEventListener("mousemove",this.onRightThumbMousemove),document.removeEventListener("mouseup",this.onRightThumbMouseup),document.removeEventListener("touchmove",this.onRightThumbMousemove),document.removeEventListener("touchend",this.onRightThumbMouseup)},onMouseWheel(i){if(this.preventWheel===!0||!i.shiftKey&&!i.ctrlKey)return;let n=this.step;i.deltaY<0&&(n=-n),i.shiftKey&&i.ctrlKey?this.valueMin+n>=this.minimum&&this.valueMax+n<=this.maximum&&(this.valueMin=this.valueMin+n,this.valueMax=this.valueMax+n):i.ctrlKey?(n=this.valueMax+n,n<this.valueMin+this.rangeMarginValue?n=this.valueMin+this.rangeMarginValue:n>this.maximum&&(n=this.maximum),this.valueMax=n):i.shiftKey&&(n=this.valueMin+n,n<this.minimum?n=this.minimum:n>this.valueMax-this.rangeMarginValue&&(n=this.valueMax-this.rangeMarginValue),this.valueMin=n)},triggerInput(){let i=0;this.step.toString().includes(".")&&(i=2);let n={min:this.minimum,max:this.maximum,minValue:parseFloat(this.valueMin.toFixed(i)),maxValue:parseFloat(this.valueMax.toFixed(i))};this.$emit("input",n)}},computed:{minimum(){return this.min===void 0?0:this.min},maximum(){let i=this.labels||[],n=i.length?i.length-1:100;return this.max===void 0?n:this.max},stepCount(){let i=this.labels||[];return i.length?i.length-1:Math.floor((this.maximum-this.minimum)/this.step)},subStepCount(){return(this.labels||[]).length&&this.step>1?(this.maximum-this.minimum)/this.step:0},barMin(){return(this.valueMin-this.minimum)/(this.maximum-this.minimum)*100},barMax(){return 100-(this.valueMax-this.minimum)/(this.maximum-this.minimum)*100},barMinVal(){let i=0;return this.step.toString().includes(".")&&(i=2),(this.valueMin||0).toFixed(i)},barMaxVal(){let i=0;return this.step.toString().includes(".")&&(i=2),(this.valueMax||100).toFixed(i)},scaleLabels(){let i=this.labels||[];return i.length===0&&(i=[],i.push(this.minimum),i.push(this.maximum)),i}},watch:{valueMin(){this.triggerInput()},valueMax(){this.triggerInput()},minValue(i){this.valueMin=i<this.minimum?this.minimum:i},maxValue(i){this.valueMax=i>this.maximum?this.maximum:i}},mounted(){}},zL={class:"bar"},xL=["min","max","step","value"],AL={class:"caption"},TL={class:"min-caption"},LL={class:"bar-inner"},vL=["min","max","step","value"],kL={class:"caption"},bL={class:"max-caption"},wL={key:0,class:"ruler"},OL={key:1,class:"sub-ruler"},EL={key:2,class:"labels"};function CL(i,n,e,r,t,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass([e.baseClassName,t.rangeMarginValue===0?"zero-ranage-margin":""]),onMousewheel:n[10]||(n[10]=l.withModifiers((...a)=>o.onMouseWheel&&o.onMouseWheel(...a),["prevent","stop"]))},[l.createElementVNode("div",zL,[l.createElementVNode("div",{class:"bar-left",style:l.normalizeStyle({width:o.barMin+"%"}),onClick:n[0]||(n[0]=(...a)=>o.onBarLeftClick&&o.onBarLeftClick(...a))},null,4),l.createElementVNode("input",{class:"input-type-range input-type-range-min",type:"range",min:o.minimum,max:o.maximum,step:e.step,value:t.valueMin,onInput:n[1]||(n[1]=l.withModifiers((...a)=>o.onInputMinChange&&o.onInputMinChange(...a),["stop","prevent"]))},null,40,xL),l.createElementVNode("div",{class:"thumb thumb-left",onMousedown:n[2]||(n[2]=(...a)=>o.onLeftThumbMousedown&&o.onLeftThumbMousedown(...a)),onTouchstart:n[3]||(n[3]=(...a)=>o.onLeftThumbMousedown&&o.onLeftThumbMousedown(...a))},[l.createElementVNode("div",AL,[l.createElementVNode("span",TL,l.toDisplayString(e.minCaption||o.barMinVal),1)])],32),l.createElementVNode("div",LL,[l.createElementVNode("div",{class:"bar-inner-left",onClick:n[4]||(n[4]=(...a)=>o.onInnerBarLeftClick&&o.onInnerBarLeftClick(...a))}),l.createElementVNode("div",{class:"bar-inner-right",onClick:n[5]||(n[5]=(...a)=>o.onInnerBarRightClick&&o.onInnerBarRightClick(...a))})]),l.createElementVNode("input",{class:"input-type-range input-type-range-max",type:"range",min:o.minimum,max:o.maximum,step:e.step,value:t.valueMax,onInput:n[6]||(n[6]=l.withModifiers((...a)=>o.onInputMaxChange&&o.onInputMaxChange(...a),["stop","prevent"]))},null,40,vL),l.createElementVNode("div",{class:"thumb thumb-right",onMousedown:n[7]||(n[7]=(...a)=>o.onRightThumbMousedown&&o.onRightThumbMousedown(...a)),onTouchstart:n[8]||(n[8]=(...a)=>o.onRightThumbMousedown&&o.onRightThumbMousedown(...a))},[l.createElementVNode("div",kL,[l.createElementVNode("span",bL,l.toDisplayString(e.maxCaption||o.barMaxVal),1)])],32),l.createElementVNode("div",{class:"bar-right",style:l.normalizeStyle({width:o.barMax+"%"}),onClick:n[9]||(n[9]=(...a)=>o.onBarRightClick&&o.onBarRightClick(...a))},null,4)]),e.ruler?(l.openBlock(),l.createElementBlock("div",wL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.stepCount,a=>(l.openBlock(),l.createElementBlock("div",{key:a,class:"ruler-rule"}))),128))])):l.createCommentVNode("",!0),o.subStepCount?(l.openBlock(),l.createElementBlock("div",OL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.subStepCount,a=>(l.openBlock(),l.createElementBlock("div",{key:a,class:"ruler-sub-rule"}))),128))])):l.createCommentVNode("",!0),e.label?(l.openBlock(),l.createElementBlock("div",EL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.scaleLabels,a=>(l.openBlock(),l.createElementBlock("div",{class:"label",key:a},l.toDisplayString(a),1))),128))])):l.createCommentVNode("",!0)],34)}const SL=at(mL,[["render",CL]]),Gw="";er.register(FT,pa,ma,pl);const QL=l.defineComponent({components:{Bar:DL,MultiRangeSlider:SL},emits:["update","update:model-value"],props:{numberRange:{type:Array,default:()=>[{key:0,count:10}]},width:{type:Number,default:200},height:{type:Number,default:50},chartId:{type:String,default:"bar-chart"},datasetIdKey:{type:String,default:"label"},includeForm:{type:Boolean,default:!1},isMatch:{type:Boolean,default:!0},isExclude:{type:Boolean,default:!1},isDisable:{type:Boolean,default:!1},modelValue:{type:Object,required:!1,default:null}},data(){return{chartData:{labels:[],datasets:[{labels:"",data:[],backgroundColor:["#5ea9e5"],borderRadius:1,hoverBackgroundColor:"#e0e0e0"}]},chartOptions:{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{display:!1,grid:{display:!1},ticks:{display:!0}},y:{display:!1,grid:{display:!1},ticks:{display:!1}}}},min:0,max:this.numberRange.length-1,validated:!1,activeColor:"#5ea9e5",inactiveColor:"#e0e0e0"}},computed:{getRangeLength(){return this.numberRange.length},getFirstKey(){return this.numberRange[0].key},getLastKey(){return this.numberRange[this.getRangeLength-1].key},getMinKey(){return this.numberRange[this.min].key},getMinCaption(){return`${this.getMinKey}`},getMaxCaption(){return`${this.getMaxKey}`},getMaxKey(){return this.numberRange[this.max].key},getLastIndex(){return this.numberRange.length-1}},watch:{modelValue(i){this.max=this.numberRange.findIndex(n=>n.key==i.maxKey),this.min=this.numberRange.findIndex(n=>n.key==i.minKey)}},mounted(){this.setChartData(this.numberRange),this.isDisable&&this.missingFilter(),this.$props.modelValue&&(this.max=this.numberRange.findIndex(i=>i.key===this.$props.modelValue.maxKey),this.min=this.numberRange.findIndex(i=>i.key===this.$props.modelValue.minKey))},methods:{updateRange(){const i=this.getMinKey,n=this.getMaxKey;this.$props.modelValue&&this.$emit("update:model-value",{minKey:i,maxKey:n}),this.$emit("update",{minKey:i,maxKey:n})},updateBarChart(i){const{minValue:n,maxValue:e}=i;this.min=n,this.max=e,this.isDisable||(this.isExclude?this.excludeFilter():this.matchFilter())},matchFilter(){if(!this.isDisable){var i=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let n=0;n<=i.length;n++)n>=this.min&&n<=this.max?this.chartData.datasets[0].backgroundColor.push(this.activeColor):this.chartData.datasets[0].backgroundColor.push(this.inactiveColor)}},excludeFilter(){if(!this.isDisable){var i=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let n=0;n<i.length;n++)n>=this.min&&n<=this.max?this.chartData.datasets[0].backgroundColor.push(this.inactiveColor):this.chartData.datasets[0].backgroundColor.push(this.activeColor)}},missingFilter(){this.validated=!this.validated;var i=this.chartData.datasets[0].data;if(this.chartData.datasets[0].backgroundColor=[],this.validated)for(let n=1;n<=i.length;n++)this.chartData.datasets[0].backgroundColor.push(this.inactiveColor);else this.isMatch&&this.matchFilter(),this.isExclude&&this.excludeFilter()},changeMin(i){let n=parseInt(i.target.value);this.min=n||0,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},changeMax(i){let n=parseInt(i.target.value);this.max=n,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},setChartData(i){let n=this.chartData.labels,e=[];for(let r=0;r<i.length;r++)n.push(i[r].key),e.push(i[r].count);this.chartData.datasets[0].data=e}}}),Ww="",YL={class:"dh-range-container"},UL={class:"bar-chart"},_L={key:0,class:"input-group-section"},BL={class:"input-group sb-input"},PL=["disabled","max","value"],RL={class:"input-group sb-input"},ZL=["disabled","max","min","value"];function VL(i,n,e,r,t,o){const a=l.resolveComponent("Bar"),s=l.resolveComponent("MultiRangeSlider");return l.openBlock(),l.createElementBlock("div",YL,[l.createElementVNode("div",UL,[l.createVNode(a,{"chart-data":i.chartData,"chart-id":i.chartId,"chart-options":i.chartOptions,"dataset-id-key":i.datasetIdKey,height:i.height,width:i.width},null,8,["chart-data","chart-id","chart-options","dataset-id-key","height","width"]),l.createVNode(s,{"base-class-name":`multi-range-slider range-slider ${i.isDisable}`,label:!1,max:i.getLastIndex,"max-caption":i.getMaxCaption,"max-value":i.max,min:0,"min-caption":i.getMinCaption,"min-value":i.min,"range-margin":0,ruler:!1,step:1,onInput:i.updateBarChart},null,8,["base-class-name","max","max-caption","max-value","min-caption","min-value","onInput"])]),i.includeForm?(l.openBlock(),l.createElementBlock("div",_L,[l.createElementVNode("div",BL,[l.createElementVNode("label",{class:l.normalizeClass(`dh-body-2 input-to ${i.validated?"disable":""}`)}," From ",2),l.createElementVNode("input",{class:"form-input text",disabled:i.validated,max:i.max,min:"1",placeholder:"From",type:"number",value:i.getMinKey,onInput:n[0]||(n[0]=u=>i.changeMin(u))},null,40,PL)]),l.createElementVNode("div",RL,[l.createElementVNode("label",{class:l.normalizeClass(`dh-body-2 input-to ${i.validated?"disable":""}`)}," To ",2),l.createElementVNode("input",{class:"form-input text",disabled:i.validated,max:i.max,min:i.min,placeholder:"To",type:"number",value:i.getMaxKey,onInput:n[1]||(n[1]=u=>i.changeMax(u))},null,40,ZL)])])):l.createCommentVNode("",!0),l.renderSlot(i.$slots,"input",{},void 0,!0),l.createElementVNode("button",{class:"btn",onClick:n[2]||(n[2]=u=>i.updateRange())},"Apply")])}const Nf=at(QL,[["render",VL],["__scopeId","data-v-24631dd5"]]),Hw="",Fw="",jf=i=>(l.pushScopeId("data-v-3dba4cb5"),i=i(),l.popScopeId(),i),GL={id:"dp-container"},WL=jf(()=>l.createElementVNode("div",{class:"dp__calendar_range"},[l.createElementVNode("p",null,"From"),l.createElementVNode("p",null,"To")],-1)),HL={class:"dp__multi"},FL=["value"],$L=["value"],JL=l.createTextVNode(" Back "),XL=["onClick"],KL=["onClick"],qL=["onClick"],e2=["onClick"],t2=["onClick"],n2=["onClick"],i2=["onClick"],r2=["onClick"],o2=jf(()=>l.createElementVNode("div",{id:"tags",class:"dp__calendar_tags"},null,-1)),a2=at({__name:"AdvancedDatePicker",props:{numberRange:{type:Array,required:!0}},emits:["update"],setup(i,{emit:n}){const e=l.ref(["",""]),r=l.ref(null),t=l.ref(null),o=l.ref(null),a=l.ref(!1),s=l.ref([{label:"Today",range:[new Date,new Date],slot:"today"},{label:"Previous week",range:[wM(bM(new Date)),bM(new Date)],slot:"previousWeek"},{label:"This week",range:[wM(new Date),iD(new Date)],slot:"week"},{label:"Next week",range:[oD(new Date),rD(new Date().setDate(new Date().getDate()+7))],slot:"nextWeek"},{label:"This month",range:[Nr(new Date),yr(new Date)],slot:"currentMonth"},{label:"Previous month",range:[Nr(Lt(new Date,1)),yr(Lt(new Date,1))],slot:"previousMonth"},{label:"Last 3 months",range:[Nr(Lt(new Date,3)),yr(Lt(new Date,1))],slot:"threeMonths"},{label:"Last 6 months",range:[Nr(Lt(new Date,6)),yr(Lt(new Date,1))],slot:"sixMonths"},{label:"Last year",range:[Ly(new Date),Ty(new Date)],slot:"yearly"}]),u=g=>{e.value=g,console.log(e.value),n("update",e.value)};function c(g){t.value=g.target.value,e.value=[g.target.value,r.value]}function M(g){r.value=g.target.value,e.value=[t.value,g.target.value]}l.onMounted(()=>{o.value.openMenu()});function d(){o.value.openMenu()}return(g,f)=>(l.openBlock(),l.createElementBlock("div",GL,[WL,l.createVNode(l.unref(Wo),{ref_key:"datePicker",ref:o,modelValue:e.value,"onUpdate:modelValue":[f[2]||(f[2]=j=>e.value=j),u],"auto-apply":"","day-names":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"enable-time-picker":!1,"model-type":"dd/MM/yyyy","multi-calendars":"","multi-calendars-solo":"","multi-static":!1,offset:12,position:"left","preset-ranges":s.value,range:"","select-text":"Apply","text-input":"",uid:"advanced",onClosed:d},{"dp-input":l.withCtx(()=>[l.createElementVNode("div",HL,[l.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:t.value?t.value:e.value[0],onInput:f[0]||(f[0]=j=>c(j))},null,40,FL),l.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:r.value?r.value:e.value[1],onInput:f[1]||(f[1]=j=>M(j))},null,40,$L)])]),"arrow-left":l.withCtx(()=>[l.createVNode(me,{"icon-name":"previous",size:20})]),"arrow-right":l.withCtx(()=>[l.createVNode(me,{"icon-name":"next",size:20})]),"calendar-icon":l.withCtx(()=>[JL]),"clear-icon":l.withCtx(()=>[]),"action-preview":l.withCtx(()=>[]),"action-select":l.withCtx(()=>[]),previousWeek:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,XL)]))]),week:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,KL)]))]),nextWeek:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,qL)]))]),currentMonth:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,e2)]))]),previousMonth:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,t2)]))]),threeMonths:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,n2)]))]),sixMonths:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,i2)]))]),yearly:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,r2)]))]),_:1},8,["modelValue","preset-ranges"]),l.createVNode(Nf,{class:"dp__calendar_range_number","number-range":i.numberRange,steps:1},{input:l.withCtx(()=>[o2]),filter:l.withCtx(()=>[l.createVNode(dd,{data:a.value,label:"Include time",onChange:f[3]||(f[3]=j=>a.value=j)},null,8,["data"])]),_:1},8,["number-range"])]))}},[["__scopeId","data-v-3dba4cb5"]]),s2=l.defineComponent({components:{DhIcon:me},props:{mainText:{type:String,default:"Advanced"},filterMissingText:{type:String,default:"Filter Missing"},matchText:{type:String,default:"Match"},excludeText:{type:String,default:"Exclude"}},data(){return{activeFilter:!1,isFilterMissing:!1,isMatch:!1,isExclude:!1}},emits:["match","exclude","filter_missing"],mounted(){this.isMatch=!0},methods:{toggleFilter(){this.activeFilter=!this.activeFilter},matchFilter(){this.isMatch=!0,this.isExclude=!1,this.$emit("match",this.isMatch)},excludeFilter(){this.isMatch=!1,this.isExclude=!0,this.$emit("exclude",this.isExclude)},missingFilter(){this.isFilterMissing=!this.isFilterMissing,this.$emit("filter_missing",this.isFilterMissing),this.isFilterMissing&&this.isMatch?this.matchFilter():this.isFilterMissing&&this.isExclude&&this.excludeFilter()}}}),u2={class:"dh-advanced-filter-container"},l2={class:"advance_section"},c2={key:0},M2={class:"list-none"},d2=["checked"],g2=["checked"],f2=["checked"];function y2(i,n,e,r,t,o){const a=l.resolveComponent("dh-icon");return l.openBlock(),l.createElementBlock("div",u2,[l.createElementVNode("div",l2,[l.createElementVNode("span",{class:"toggle-icon",onClick:n[0]||(n[0]=s=>i.toggleFilter())},[l.createTextVNode(l.toDisplayString(i.mainText)+" ",1),l.createVNode(a,{"icon-name":i.activeFilter?"arrow-up":"arrow-down",size:20},null,8,["icon-name"])]),i.activeFilter?(l.openBlock(),l.createElementBlock("div",c2,[l.renderSlot(i.$slots,"default"),l.createElementVNode("ul",M2,[l.createElementVNode("li",null,[l.createElementVNode("label",null,[l.createElementVNode("input",{checked:i.isFilterMissing,name:"number_filter",type:"checkbox",onChange:n[1]||(n[1]=s=>i.missingFilter())},null,40,d2),l.createTextVNode(" "+l.toDisplayString(i.filterMissingText),1)])]),l.createElementVNode("li",null,[l.createElementVNode("label",null,[l.createElementVNode("input",{checked:i.isMatch,name:"number_filter",type:"radio",onChange:n[2]||(n[2]=s=>i.matchFilter())},null,40,g2),l.createTextVNode(" "+l.toDisplayString(i.matchText),1)]),l.createElementVNode("label",null,[l.createElementVNode("input",{checked:i.isExclude,name:"number_filter",type:"radio",onChange:n[3]||(n[3]=s=>i.excludeFilter())},null,40,f2),l.createTextVNode(" "+l.toDisplayString(i.excludeText),1)])])])])):l.createCommentVNode("",!0)])])}const N2=at(s2,[["render",y2]]),j2=["disabled"],h2={key:1,class:"prepend-icon"},I2={class:"append-icon"},p2=l.defineComponent({__name:"Button",props:{size:{type:String,required:!1,default:""},color:{type:String,required:!1,default:""},disabled:{type:Boolean,required:!1,default:!1},loading:{type:Boolean,required:!1,default:!1},icon:{type:String,required:!1,default:""}},setup(i){const n=i,e=l.computed(()=>n.size==="large"),r=l.computed(()=>n.size==="small"),t=l.computed(()=>n.color==="primary"),o=l.computed(()=>n.color==="secondary"),a=l.computed(()=>n.color==="danger"),s=l.computed(()=>n.color==="success"),u=l.computed(()=>n.color==="ghost");return(c,M)=>(l.openBlock(),l.createElementBlock("button",{class:l.normalizeClass({"dh-btn":!0,"dh-btn-primary":l.unref(t),"dh-btn-secondary":l.unref(o),"dh-btn-danger":l.unref(a),"dh-btn-success":l.unref(s),"dh-btn-ghost":l.unref(u),"dh-btn-large":l.unref(e),"dh-btn-small":l.unref(r),"dh-btn-icon":i.icon,disabled:i.disabled}),disabled:i.disabled||i.loading},[i.loading?(l.openBlock(),l.createBlock(me,{key:0,class:l.normalizeClass({"loading-spinner":!0,"loading-spinner-danger":l.unref(a),"loading-spinner-success":l.unref(s),"loading-spinner-secondary":l.unref(o)||l.unref(u)}),"icon-name":"loader"},null,8,["class"])):l.createCommentVNode("",!0),i.loading?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",h2,[l.renderSlot(c.$slots,"prepend-icon",{},void 0,!0)])),i.icon?l.createCommentVNode("",!0):l.renderSlot(c.$slots,"default",{key:2},void 0,!0),i.icon&&!i.loading?(l.openBlock(),l.createBlock(me,{key:3,"icon-name":i.icon,size:24},null,8,["icon-name"])):l.createCommentVNode("",!0),l.createElementVNode("div",I2,[l.renderSlot(c.$slots,"append-icon",{},void 0,!0)])],10,j2))}}),Jw="",ml=at(p2,[["__scopeId","data-v-faa3cf97"]]),D2=l.defineComponent({props:{target:{type:String,required:!0},trigger:{type:String,required:!0},placement:{type:String,default:()=>"bottom",required:!1},tooltipText:{type:String,required:!0}},data(){return{show:!1}},methods:{showTooltip(){this.show=!this.show},tooltip(){let i=this.$refs.main,n=this.$refs[this.target];["right","left"].includes(this.placement)&&(n.style.top=-(((n==null?void 0:n.offsetHeight)-(i==null?void 0:i.offsetHeight))/2)+"px")}}}),m2=["placement","target","tooltipText","trigger"],z2=["id"],x2={class:"text"};function A2(i,n,e,r,t,o){return l.openBlock(),l.createElementBlock("div",{id:"main-contain",ref:"main",class:"dh-tooltip-container tooltip",placement:i.placement,target:i.target,tooltipText:i.tooltipText,trigger:i.trigger,onClick:n[0]||(n[0]=a=>i.trigger=="click"?i.showTooltip():null),onMouseover:n[1]||(n[1]=a=>i.tooltip())},[l.renderSlot(i.$slots,"default"),l.createElementVNode("div",{id:i.target,ref:i.target,class:l.normalizeClass(`tooltiptext ${i.show}`)},[l.createElementVNode("span",x2,l.toDisplayString(i.tooltipText),1)],10,z2)],40,m2)}const hf=at(D2,[["render",A2]]),Xw="",T2={class:"copy__text"},L2=["readonly"],v2={__name:"Copiable",props:{text:{type:String,required:!0},placement:{type:String,default:"bottom"},readonly:{type:Boolean,default:!0}},setup(i){const n=i,e=l.ref(""),r=l.ref("copy text");function t(a){navigator.clipboard.writeText(a),r.value="copied !"}function o(){r.value="copy text"}return l.onMounted(()=>{e.value=n.text}),(a,s)=>(l.openBlock(),l.createElementBlock("span",T2,[l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=u=>e.value=u),readonly:i.readonly,type:"text",onInput:o},null,40,L2),[[l.vModelText,e.value]]),l.createVNode(hf,{placement:i.placement,target:"tooltiptext","tooltip-text":r.value,trigger:"hover",onClick:s[1]||(s[1]=u=>t(e.value))},{default:l.withCtx(()=>[l.createVNode(me,{class:"copy__text_icon","icon-name":"copy",size:18})]),_:1},8,["placement","tooltip-text"])]))}},Kw="",k2=l.createTextVNode(" Back "),b2=l.createElementVNode("div",null,"today",-1),w2={__name:"DatePicker",props:{inline:{type:Boolean,default:!0},multiCalendars:{type:Boolean,default:!1},multiCalendarsSolo:{type:Boolean,default:!1},range:{type:Boolean,default:!1},enableTimePicker:{type:Boolean,default:!1}},emits:["update"],setup(i,{emit:n}){const e=l.ref(),r=l.ref(null),t=a=>{e.value=a,n("update",e.value)},o=l.ref([{date:dn(new Date,0),type:"dot",tooltip:[{text:"Dot with tooltip",color:"blue"}]}]);return(a,s)=>(l.openBlock(),l.createElementBlock("div",null,[l.createVNode(l.unref(Wo),{ref_key:"datePicker",ref:r,modelValue:e.value,"onUpdate:modelValue":[s[0]||(s[0]=u=>e.value=u),t],"day-names":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"enable-time-picker":i.enableTimePicker,format:"MM/dd/yyyy",inline:i.inline,markers:o.value,"month-name-format":"short","multi-calendars":i.multiCalendars,"multi-calendars-solo":i.multiCalendars&i.multiCalendarsSolo,offset:12,placeholder:"MM/DD/YYYY",range:i.range||i.multiCalendars,"select-text":"Apply","text-input":"",uid:"base"},{"arrow-left":l.withCtx(()=>[l.createVNode(me,{"icon-name":"previous",size:20})]),"arrow-right":l.withCtx(()=>[l.createVNode(me,{"icon-name":"next",size:20})]),"calendar-icon":l.withCtx(()=>[k2]),"clear-icon":l.withCtx(()=>[]),"action-preview":l.withCtx(()=>[]),"marker-tooltip":l.withCtx(()=>[b2]),_:1},8,["modelValue","enable-time-picker","inline","markers","multi-calendars","multi-calendars-solo","range"])]))}},O2=["src"],E2={key:3,class:"menu-item-text-wrapper"},C2=l.defineComponent({__name:"DropdownMenuItem",props:{item:{type:Object,required:!0},textEllipsisStyle:{type:String,required:!1,default:"none",validator:i=>["none","ellipsis","fit-content"].includes(i)},iconSize:{type:Number,required:!1,default:24},maxWidth:{type:String,required:!1,default:"15rem"}},setup(i){const n=i;return l.useCssVars(e=>({"4eed85df":i.maxWidth})),(e,r)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[i.item.iconUrl?(l.openBlock(),l.createElementBlock("img",{key:0,alt:"icon image",class:"icon icon-url",src:i.item.iconUrl},null,8,O2)):l.createCommentVNode("",!0),i.item.iconUrl?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(me,l.mergeProps({key:1,class:"icon"},{...i.item,size:n.iconSize}),null,16)),i.item.subText?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass(["dh-body-2",i.textEllipsisStyle])},l.toDisplayString(i.item.text),3)),i.item.subText?(l.openBlock(),l.createElementBlock("div",E2,[l.createElementVNode("span",{class:l.normalizeClass(["dh-body-1",i.textEllipsisStyle])},l.toDisplayString(i.item.text),3),l.createElementVNode("span",{class:l.normalizeClass(["dh-body-4-medium",i.textEllipsisStyle])},l.toDisplayString(i.item.subText),3)])):l.createCommentVNode("",!0),i.item.isSelected?(l.openBlock(),l.createBlock(me,{key:4,class:"icon-blue icon-accept","icon-name":"accept",size:16})):l.createCommentVNode("",!0)],64))}}),qw="",If=at(C2,[["__scopeId","data-v-3eb62ad6"]]),S2=["data-e2e","onClick"],Q2=l.defineComponent({__name:"DropdownMenu",props:{items:{type:Object,required:!0},textEllipsisStyle:{type:String,required:!1,default:"none",validator:i=>["none","ellipsis","fit-content"].includes(i)},iconSize:{type:Number,required:!1,default:24},closeOnClickOutside:{type:Boolean,required:!1,default:!0},zIndex:{type:Number,required:!1,default:100},closeOnItemSelected:{type:Boolean,required:!1,default:!0},width:{type:String,required:!1,default:"100%"},minWidth:{type:String,required:!1,default:"10rem"},maxWidth:{type:String,required:!1,default:"15rem"}},emits:["itemSelected","close"],setup(i,{emit:n}){const e=i;l.useCssVars(o=>({"20988fa6":i.minWidth,"5040c1f4":i.width})),l.onMounted(()=>{document.addEventListener("click",o=>{r(o)})});function r(o){const a=o.target,s=document.querySelector("[data-id='dropdown-menu']");s&&!s.contains(o.target)&&!a.classList.contains("dropdown-toggle")&&e.closeOnClickOutside&&n("close")}function t(o){n("itemSelected",o),e.closeOnItemSelected&&n("close")}return(o,a)=>{const s=l.resolveComponent("router-link");return l.openBlock(),l.createElementBlock("div",{class:"dropdown-menu","data-id":"dropdown-menu",style:l.normalizeStyle({"z-index":e.zIndex})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.items,u=>(l.openBlock(),l.createElementBlock("div",{key:u.iconName,class:"menu-item","data-e2e":u.dataE2eTag,onClick:c=>t(u)},[u.url?(l.openBlock(),l.createBlock(s,{key:0,class:l.normalizeClass({"center-vertical":!0,disabled:u.disabled}),to:{path:u.url}},{default:l.withCtx(()=>[l.createVNode(If,{"icon-size":i.iconSize,item:u,"max-width":i.maxWidth,"text-ellipsis-style":i.textEllipsisStyle},null,8,["icon-size","item","max-width","text-ellipsis-style"])]),_:2},1032,["class","to"])):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass({"center-vertical":!0,disabled:u.disabled})},[l.createVNode(If,{"icon-size":i.iconSize,item:u,"max-width":i.maxWidth,"text-ellipsis-style":i.textEllipsisStyle},null,8,["icon-size","item","max-width","text-ellipsis-style"])],2))],8,S2))),128))],4)}}}),eO="",Y2=at(Q2,[["__scopeId","data-v-34e5ce8a"]]),U2={key:0,class:"invalid-feedback"},_2=l.defineComponent({__name:"Error",props:{errors:{type:Object,required:!1,default:void 0}},setup(i){const n=i;return(e,r)=>{var t;return l.unref(n).errors&&((t=l.unref(n).errors)==null?void 0:t.length)>0?(l.openBlock(),l.createElementBlock("div",U2,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.errors,o=>(l.openBlock(),l.createElementBlock("span",{key:o},l.toDisplayString(o),1))),128))])):l.createCommentVNode("",!0)}}}),tO="",B2={class:"dh-body-1-medium"},P2=l.createTextVNode(" Content "),R2={key:1,class:"wrapper"},Z2={class:"dh-body-1-medium"},V2={class:"panel-icon-wrapper"},G2=l.defineComponent({__name:"ExpansionPanel",props:{title:{type:String,default:"Advanced"},isAdvancedSettingsOpen:{type:Boolean,default:!1},type:{type:String,default:"mini"}},setup(i){const n=i,e=l.ref(!1),r=l.ref(null),t=l.ref(0);l.watch(()=>n.isAdvancedSettingsOpen,s=>{e.value!==s&&o()});function o(){if(n.type==="regular"){a();return}e.value=!e.value}function a(){e.value?(t.value=0,setTimeout(()=>{e.value=!1},300)):(e.value=!0,l.nextTick(()=>{r.value&&(t.value=r.value.scrollHeight)}))}return l.onMounted(()=>{e.value!==n.isAdvancedSettingsOpen&&o()}),(s,u)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[n.type==="mini"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",{class:l.normalizeClass(["advanced-panel-header clickable",{opened:e.value,closed:!e.value}]),"data-e2e":"expansion-panel-button",onClick:u[0]||(u[0]=c=>o())},[l.createElementVNode("h4",B2,l.toDisplayString(i.title),1),l.createVNode(me,{class:"icon","icon-name":e.value?"arrow-up":"arrow-down",size:24},null,8,["icon-name"])],2),e.value?l.renderSlot(s.$slots,"content",{key:0},()=>[P2],!0):l.createCommentVNode("",!0)],64)):l.createCommentVNode("",!0),n.type==="regular"?(l.openBlock(),l.createElementBlock("div",R2,[l.createElementVNode("button",{class:"panel-button",onClick:u[1]||(u[1]=c=>o())},[l.createElementVNode("h4",Z2,l.toDisplayString(i.title),1),l.createElementVNode("div",V2,[l.createVNode(me,{class:"panel-icon","icon-name":e.value?"minus":"plus",size:24},null,8,["icon-name"])])]),e.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"contentRef",ref:r,class:"panel",style:l.normalizeStyle({height:t.value>0?t.value+"px":0})},[l.renderSlot(s.$slots,"content",{},void 0,!0)],4)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],64))}}),nO="",W2=at(G2,[["__scopeId","data-v-7319184b"]]),iO="",H2=l.createElementVNode("label",{for:"upload_pdf"},[l.createTextVNode(" Drag and drop file or "),l.createElementVNode("span",{id:"upload"},"browse")],-1),F2={key:0,class:"file__upload_items"},$2={class:"file__upload_list_item"},J2={class:"file__upload_list_item_label"},X2=["title"],K2=l.createElementVNode("br",null,null,-1),q2=["href"],ev={key:1,class:"file__upload_items"},tv={class:"file__upload_list_item"},nv={class:"file__upload_list_item_label"},iv=["title"],rv={key:0,class:"label__antivirus"},ov={key:1,class:"label__antivirus label__antivirus--failed"},av={key:2,class:"label__antivirus label__antivirus--detected"},sv=l.createElementVNode("br",null,null,-1),uv={key:3},lv={key:4},cv={key:0},Mv=["value"],dv=["href"],gv={key:2,class:"file__upload_placeholder"},fv={key:3,class:"file__upload_action"},yv=l.createElementVNode("button",{class:"file__upload_action_cancel"},"Cancel",-1),Nv={__name:"FileUpload",props:{fileList:{type:Array,required:!1,default:()=>[]},fileFormats:{type:Array,required:!1,default:()=>[".pdf",".csv",".doc",".jpeg",".jpg",".mp4",".png",".txt",".xls"]},uploadProgress:{type:Array,required:!0},errorOccurred:{type:Array,required:!0},virusCheck:{type:Array,required:!0},modelValue:{type:FileList,required:!1,default:void 0},inline:{type:Boolean,required:!1,default:!1},large:{type:Boolean,required:!1,default:!1},errorMessage:{type:String,required:!1,default:"an error occurred while uploading"},fileSaved:{type:Boolean,required:!1,default:!1},virusCheckText:{type:String,required:!1,default:"Antivirus check ..."},virusCheckFailedText:{type:String,required:!1,default:"Antivirus check failed"},virusDetectedText:{type:String,required:!1,default:"Virus detected"},deleteConfirmationText:{type:String,required:!1,default:"Are you sure you want to delete it permanently? this action will be irreversible"},zIndex:{type:Number,required:!1,default:99},fieldIndex:{type:Number,required:!1,default:0}},emits:["update:modelValue","reload"],setup(i,{emit:n}){const e=i;l.watch(e.uploadProgress,async D=>{if(e.inline){const v=o.value.length;D.slice(0,v).every(L=>L==100)&&n("update:modelValue",o.value,a.value)}});const r=l.ref(null),t=l.ref(!1),o=l.ref([]),a=l.ref([]),s=l.ref([".pdf",".csv",".doc",".jpeg",".jpg",".mp4",".png",".txt",".xls"]);function u(D,v=2){if(!+D)return"0 Bytes";const L=1024,w=v<0?0:v,E=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],T=Math.floor(Math.log(D)/Math.log(L));return`${parseFloat((D/Math.pow(L,T)).toFixed(w))} ${E[T]}`}function c(D,v=2){if(!+D)return"0 KB";const L=1024,w=v<0?0:v,E=["KB","MB","GB","TB","PB","EB","ZB","YB"],T=Math.floor(Math.log(D)/Math.log(L));return`${parseFloat((D/Math.pow(L,T)).toFixed(w))} ${E[T]}`}function M(D){return s.value.includes(g(D))?g(D).slice(1):"unknown"}function d(D){const v=D.lastIndexOf(".");let L=D.slice(0,v);return L.length<=19?L:L.slice(0,20)+"... "}function g(D){return D.replace(/.*(?=\.)/g,"")}function f(D){D.stopPropagation();for(let v=0;v<r.value.files.length;v++){const L=r.value.files[v];o.value.push(L)}o.value&&(t.value=!0),n("update:modelValue",o.value,a.value,e.fieldIndex)}function j(D){D.stopPropagation(),D.dataTransfer.dropEffect="copy"}function p(D){D.stopPropagation(),t.value=!0;for(let v=0;v<D.dataTransfer.files.length;v++){const L=D.dataTransfer.files[v];o.value.push(L)}n("update:modelValue",o.value,a.value,e.fieldIndex)}function x(D){window.confirm(e.deleteConfirmationText)&&z(D)}function N(D){window.confirm(e.deleteConfirmationText)&&h(D)}function h(D){a.value.push(D),n("update:modelValue",o.value,a.value,e.fieldIndex)}function z(D){const v=new DataTransfer;for(let L=0;L<o.value.length;L++){const w=o.value[L];D!==L&&v.items.add(w)}o.value=v.files,o.value.length==0&&(t.value=!1)}function m(D){return URL.createObjectURL(D)}function I(D){D.preventDefault(),n("reload")}return(D,v)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["file__upload",{file__upload_box:!i.inline,file__upload_large:i.large&&i.inline}])},[l.createElementVNode("div",{class:"file__upload_btn",onDragover:v[1]||(v[1]=l.withModifiers(L=>j(L),["prevent"])),onDrop:v[2]||(v[2]=l.withModifiers(L=>p(L),["prevent"]))},[l.createVNode(me,{class:"file__upload_btn_icon","icon-name":"upload",size:24}),H2,l.createElementVNode("input",{id:"upload_pdf",ref_key:"upload",ref:r,enctype:"multipart/form-data",multiple:"",name:"file",type:"file",onInput:v[0]||(v[0]=L=>f(L))},null,544)],32),i.fileList.length?(l.openBlock(),l.createElementBlock("div",F2,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.fileList,L=>(l.openBlock(),l.createElementBlock("div",{key:L.id,class:l.normalizeClass(["file__upload_list",i.inline?"":"file__upload_list_box"])},[l.createVNode(me,{"icon-name":"file-"+M(L.label),size:40},null,8,["icon-name"]),l.createElementVNode("div",$2,[l.createElementVNode("div",J2,[l.createElementVNode("div",null,[l.createElementVNode("span",{title:L.label},l.toDisplayString(d(L.label))+l.toDisplayString(g(L.label)),9,X2),K2,l.createElementVNode("span",null,l.toDisplayString(c(L.size_kb)),1)])])]),l.createElementVNode("a",{class:"file__upload_list_download",href:L.download_url,target:"_blank"},[l.createVNode(me,{class:"file__upload_list_download_icon","icon-name":"download",size:24})],8,q2),l.createVNode(me,{class:"file__upload_list_delete","icon-name":"delete",size:24,onClick:w=>N(L.id)},null,8,["onClick"])],2))),128))])):l.createCommentVNode("",!0),t.value?(l.openBlock(),l.createElementBlock("div",ev,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(L,w)=>(l.openBlock(),l.createElementBlock("div",{key:w,class:l.normalizeClass(["file__upload_list",i.inline?"":"file__upload_list_box"])},[l.createVNode(me,{class:l.normalizeClass(i.errorOccurred[w]?"file__upload_list_icon":""),"icon-name":"file-"+M(L.name),size:40},null,8,["class","icon-name"]),e.uploadProgress[w]==100&&i.fileSaved&&!i.errorOccurred[w]&&i.virusCheck[w]=="loading"?(l.openBlock(),l.createBlock(me,{key:0,class:"file__upload_list_icon_sub file__upload_list_icon_sub--loading","icon-name":"states",size:20,style:l.normalizeStyle({"z-index":e.zIndex})},null,8,["style"])):l.createCommentVNode("",!0),e.uploadProgress[w]==100&&i.fileSaved&&i.virusCheck[w]=="failed"?(l.openBlock(),l.createBlock(me,{key:1,class:"file__upload_list_icon_sub","icon-name":"warning",size:20,style:l.normalizeStyle({"z-index":e.zIndex})},null,8,["style"])):l.createCommentVNode("",!0),e.uploadProgress[w]==100&&i.fileSaved&&i.virusCheck[w]=="detected"?(l.openBlock(),l.createBlock(me,{key:2,class:"file__upload_list_icon_sub","icon-name":"danger",size:20,style:l.normalizeStyle({"z-index":e.zIndex})},null,8,["style"])):l.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[w]?(l.openBlock(),l.createBlock(me,{key:3,class:"file__upload_list_icon_sub","icon-name":"error",size:20,style:l.normalizeStyle({"z-index":e.zIndex})},null,8,["style"])):l.createCommentVNode("",!0),l.createElementVNode("div",tv,[l.createElementVNode("div",nv,[l.createElementVNode("div",null,[l.createElementVNode("span",{title:L.name},l.toDisplayString(d(L.name))+l.toDisplayString(g(L.name)),9,iv),e.uploadProgress[w]==100&&i.fileSaved&&!i.errorOccurred[w]&&i.virusCheck[w]=="loading"?(l.openBlock(),l.createElementBlock("span",rv,[l.createTextVNode(l.toDisplayString(i.virusCheckText)+" ",1),l.createVNode(me,{class:"file__upload_list_icon_sub--loading","icon-name":"processing",size:18})])):l.createCommentVNode("",!0),e.uploadProgress[w]==100&&i.fileSaved&&i.virusCheck[w]=="failed"?(l.openBlock(),l.createElementBlock("span",ov,l.toDisplayString(i.virusCheckFailedText),1)):l.createCommentVNode("",!0),e.uploadProgress[w]==100&&i.fileSaved&&i.virusCheck[w]=="detected"?(l.openBlock(),l.createElementBlock("span",av,l.toDisplayString(i.virusDetectedText),1)):l.createCommentVNode("",!0),sv,i.fileSaved&&!i.errorOccurred[w]||!i.errorOccurred[w]&&i.virusCheck[w]?(l.openBlock(),l.createElementBlock("span",uv,l.toDisplayString(u(L.size)),1)):l.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[w]?(l.openBlock(),l.createElementBlock("span",lv,l.toDisplayString(i.errorMessage),1)):l.createCommentVNode("",!0)]),i.fileSaved?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",cv,l.toDisplayString(e.uploadProgress[w])+"%",1))]),i.fileSaved?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("progress",{key:0,id:"file",max:"100",value:e.uploadProgress[w]},l.toDisplayString(e.uploadProgress[w])+"% ",9,Mv))]),i.fileSaved&&!i.virusCheck[w]&&!i.errorOccurred[w]?(l.openBlock(),l.createElementBlock("a",{key:4,class:"file__upload_list_download",href:m(L),target:"_blank"},[l.createVNode(me,{class:"file__upload_list_download_icon","icon-name":"download",size:24})],8,dv)):l.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[w]?(l.openBlock(),l.createElementBlock("a",{key:5,class:"file__upload_list_retry",onClick:v[3]||(v[3]=E=>I(E))},[l.createVNode(me,{class:"file__upload_list_retry_icon","icon-name":"retry",size:24})])):l.createCommentVNode("",!0),e.uploadProgress[w]!==100?(l.openBlock(),l.createBlock(me,{key:6,class:"file__upload_list_delete","icon-name":"close",size:24,onClick:E=>z(w)},null,8,["onClick"])):(l.openBlock(),l.createBlock(me,{key:7,class:"file__upload_list_delete","icon-name":"delete",size:24,onClick:E=>x(w)},null,8,["onClick"]))],2))),128))])):l.createCommentVNode("",!0),!t.value&&!i.inline&&!i.fileList.length?(l.openBlock(),l.createElementBlock("div",gv," No file selected ")):l.createCommentVNode("",!0),!i.inline&&!i.fileSaved?(l.openBlock(),l.createElementBlock("div",fv,[yv,l.createElementVNode("button",{class:l.normalizeClass(["file__upload_action_done",t.value&&!i.fileSaved?"file__upload_action_done--active":""]),onClick:v[4]||(v[4]=(...L)=>D.saveFile&&D.saveFile(...L))}," Done ",2)])):l.createCommentVNode("",!0)],2))}},jv=l.defineComponent({components:{DhIcon:me},props:{iconName:{type:String,required:!1,default:"default"},iconUrl:{type:String,required:!1,default:""},text:{type:String,required:!0},textPosition:{type:String,default:"right",validator:i=>["right","left"].includes(i)},labelKlass:{type:String,required:!1,default:"dh-body-2"},size:{type:Number,required:!1,default:18},hideText:{type:Boolean,required:!1,default:!1},hasBackground:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1,default:!1},activeOnHover:{type:Boolean,required:!1,default:!1},textEllipsis:{type:Boolean,required:!1,default:!1},isDanger:{type:Boolean,required:!1,default:!1}}}),rO="",hv=["src"];function Iv(i,n,e,r,t,o){const a=l.resolveComponent("DhIcon");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["icon-with-text",{"active-hover":i.activeOnHover,active:i.active,danger:i.isDanger,"no-background":!i.hasBackground,reverse:i.textPosition==="left"}])},[i.iconUrl?(l.openBlock(),l.createElementBlock("img",{key:0,alt:"icon image",class:"icon-with-text-icon icon-url",src:i.iconUrl},null,8,hv)):l.createCommentVNode("",!0),i.iconUrl?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(a,l.mergeProps({key:1,class:"icon-with-text-icon icon-3"},{iconName:i.iconName,size:i.size}),null,16)),i.hideText?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass(["",`icon-with-text-label ${i.labelKlass} ${i.textEllipsis?"text-ellipsis":""}`])},l.toDisplayString(i.text),3))],2)}const pf=at(jv,[["render",Iv],["__scopeId","data-v-3366203b"]]),oO="",pv={class:"input__dropdown"},Dv=["placeholder","value"],mv={class:"input__dropdown_second"},zv=["tabindex"],xv=["onClick"],Av=["onClick"],Tv={key:2,class:"button__clear"},Df={__name:"InputDropdown",props:{options:{type:Array,required:!0},labelProp:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"id"},icon:{type:String,required:!0},placeholderInput:{type:String,required:!1,default:"Enter value"},tabindex:{type:Number,required:!1,default:0},inputValue:{type:String,required:!1,default:""},inputWidth:{type:String,required:!1,default:"75%"},selectedOption:{type:Object,required:!1,default:null},isClearable:{type:Boolean,required:!1,default:!1}},emits:["update","clear"],setup(i,{emit:n}){const e=i,r=l.ref(0),t=l.ref(""),o=l.ref(!1),a=l.ref(""),s=l.computed(()=>t.value.length>20?t.value.substring(0,17)+"...":t.value);l.onMounted(()=>{e.inputValue&&(a.value.value=e.inputValue),e.selectedOption&&(r.value=d(e.selectedOption)),M()}),l.watch(()=>e.selectedOption,g=>{g?r.value=d(g):r.value=0,M()},{deep:!0});function u(){n("update",a.value.value,e.options[r.value])}function c(){n("clear")}function M(){t.value=e.options[r.value][e.labelProp]}function d(g){return e.options.findIndex(f=>f[e.valueProp]===g[e.valueProp])}return(g,f)=>(l.openBlock(),l.createElementBlock("div",pv,[l.createElementVNode("input",{ref_key:"name",ref:a,class:"input__dropdown_text",placeholder:i.placeholderInput,style:l.normalizeStyle({width:i.inputWidth}),type:"text",value:i.inputValue,onInput:u},null,44,Dv),l.createElementVNode("div",mv,[l.createVNode(me,{"icon-name":i.icon,size:18},null,8,["icon-name"]),l.createElementVNode("div",{class:"custom__select",tabindex:i.tabindex,onBlur:f[1]||(f[1]=j=>o.value=!1)},[l.createElementVNode("div",{class:l.normalizeClass(["custom__select_selected",{"custom__select--open":o.value}]),onClick:f[0]||(f[0]=j=>o.value=!o.value)},l.toDisplayString(l.unref(s)),3),typeof i.options[0]=="object"?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["custom__select_items",{"custom__select--hide":!o.value}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.options,(j,p)=>(l.openBlock(),l.createElementBlock("div",{key:p,onClick:x=>{t.value=j[i.labelProp],r.value=p,o.value=!1,u()}},l.toDisplayString(j[i.labelProp]),9,xv))),128))],2)):l.createCommentVNode("",!0),typeof i.options[0]=="string"?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["custom__select_items",{"custom__select--hide":!o.value}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.options,(j,p)=>(l.openBlock(),l.createElementBlock("div",{key:p,onClick:x=>{t.value=j,r.value=p,o.value=!1,u()}},l.toDisplayString(j),9,Av))),128))],2)):l.createCommentVNode("",!0),e.isClearable?(l.openBlock(),l.createElementBlock("div",Tv,[l.createVNode(ml,{color:"ghost",icon:"close",onClick:c})])):l.createCommentVNode("",!0)],40,zv)])]))}},aO="",Lv={class:"input-group-multiple"},vv={class:"input-label"},kv={__name:"InputDropdownMultiple",props:{title:{type:String,required:!1,default:"label"},labelProp:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"id"},icon:{type:String,required:!0},placeholderInput:{type:String,required:!1,default:"Enter value"},tabindex:{type:Number,required:!1,default:0},inputWidth:{type:String,required:!1,default:"75%"},value:{type:Array,required:!0},options:{type:Array,required:!0}},emits:["update"],setup(i,{emit:n}){const e=i,r=l.reactive(e.value);function t(s,u,c){r&&(r[s].input=u,r[s].selectedOption=c,n("update",r))}function o(s){r.length>1&&(r.splice(s,1),n("update",r))}function a(){r&&r.push({input:null,selectedOption:null})}return(s,u)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",Lv,[l.createElementVNode("label",vv,l.toDisplayString(i.title),1),l.createElementVNode("button",{class:"btn btn-secondary btn-multiple",onClick:a},[l.createVNode(me,{"icon-name":"plus",size:24})])]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r,(c,M)=>(l.openBlock(),l.createBlock(Df,{key:M,icon:e.icon,"input-value":c.input,"input-width":e.inputWidth,"is-clearable":"","label-prop":e.labelProp,options:e.options,"placeholder-input":e.placeholderInput,"selected-option":c.selectedOption,tabindex:e.tabindex,"value-prop":e.valueProp,onClear:d=>o(M),onUpdate:(d,g,f)=>t(M,d,g)},null,8,["icon","input-value","input-width","label-prop","options","placeholder-input","selected-option","tabindex","value-prop","onClear","onUpdate"]))),128))],64))}},sO="",bv=["data-e2e","placeholder","value"],wv={key:1,class:"input__group_content"},Ov=["data-e2e","placeholder","value"],Ev={key:2,class:"input__group"},Cv=["data-e2e","placeholder","type","value"],Sv={__name:"InputGroup",props:{modelValue:{type:[String,Number],default:""},inputType:{type:String,default:"text",required:!0},iconName:{type:String,required:!1,default:""},sideContent:{type:String,required:!1,default:""},widthProp:{type:String,default:"200px",required:!1},heightProp:{type:String,default:"30px",required:!1},direction:{type:String,default:"right",required:!1},placeholder:{type:String,default:"type here",required:!1},e2e:{type:String,default:"",required:!1}},emits:["update:modelValue"],setup(i){const n=i;l.useCssVars(r=>({"52c3921b":e.value,"1745b0d0":i.widthProp,ec9c60fa:i.heightProp}));const e=l.ref("row");return l.onMounted(()=>{n.direction=="left"&&(e.value="row-reverse")}),(r,t)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[i.inputType=="multi-line"?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["text__area",i.direction=="left"?"text__area--left":"text__area--right"])},[l.createElementVNode("textarea",{class:"text__area_field",cols:"30","data-e2e":i.e2e,placeholder:i.placeholder,rows:"10",value:i.modelValue,onInput:t[0]||(t[0]=o=>r.$emit("update:modelValue",o.target.value))},null,40,bv),i.direction=="left"&&i.iconName?(l.openBlock(),l.createBlock(me,{key:0,class:"text__area_icon text__area_icon--left","icon-name":i.iconName},null,8,["icon-name"])):l.createCommentVNode("",!0),i.direction=="right"&&i.iconName?(l.openBlock(),l.createBlock(me,{key:1,class:"text__area_icon text__area_icon--right","icon-name":i.iconName},null,8,["icon-name"])):l.createCommentVNode("",!0)],2)):l.createCommentVNode("",!0),i.inputType=="text"&&i.sideContent?(l.openBlock(),l.createElementBlock("div",wv,[l.createElementVNode("input",{class:l.normalizeClass(["form-input",i.direction=="left"?"form-input--left":"form-input--right"]),"data-e2e":i.e2e,placeholder:i.placeholder,value:i.modelValue,onInput:t[1]||(t[1]=o=>r.$emit("update:modelValue",o.target.value))},null,42,Ov),l.createElementVNode("span",{class:l.normalizeClass(["form-span",i.direction=="left"?"form-span--left":"form-span--right"])},l.toDisplayString(i.sideContent),3)])):i.inputType!=="multi-line"?(l.openBlock(),l.createElementBlock("div",Ev,[l.createElementVNode("input",{class:"input__group_field","data-e2e":i.e2e,placeholder:i.placeholder,type:i.inputType,value:i.modelValue,onInput:t[2]||(t[2]=o=>r.$emit("update:modelValue",o.target.value))},null,40,Cv),i.iconName?(l.openBlock(),l.createBlock(me,{key:0,class:"input__group_icon","icon-name":i.iconName},null,8,["icon-name"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],64))}},Qv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAR2SURBVHgBlVVdaFtlGH6+LydJ89OYtHVbf+YyhoPK5uK2G3/oIlTYhRctKApebAiCXowtDLzxIi3sUqnBiiBerF6osGl7J0idqWyD4WSZF3PzZ4tt7Y/NmnRN0yYn5/t8z9e0Ne35Wnwg5Jzzvt/7vO/7vT8MO6BnYDEuPP4TXMi4kIgyxqOrElEAZEZKZLhVHhpJBDPb2WE6wcsDZtwwXEkJGd9G7T9WRJqZ+f6RxONprUp9BDIs3CLJJM7tSLAJkg5xIT6EVSTCSEFLdPKT5ai36hqWzBVj8v+R1IFVM8y0ekcSvuwWop6BfFgaoR8kY0RSf04qRUriSh6l/AzcDY3wRtpgmWUSUhSewFYuITMFwV9MJ5iKzFgTCHfITtcWEhvW/H38NfYpViZ+UZ7Jmn920B3dZxDuPLnljOQsFmYiSY8J+53Xook734nE4v1r+P2rBMoTt1VUqzRC/ThFU85P2m7CCYKxc3bVrhNZRjDpdPHmoxnMXBmErFbgDIncza+RuzGE1QTXQ1k0fElF9OpAJcaZK+5kZuHuKCqlAraDbWzmxmWUJm5pXEH89Y8W49w0cNrBGYWlqTvbFvjTna1oigQoLQKP/ryq0eIooSFOxcCP6AxJaWkkDAEfw/uJ52GaJt658D1yhSmdGdJmJ+iOZEyrQaFeOPss9u3xKXUVHlXN8UO78U2qFx0tbuxv9eOzZDepCr0ZGlsGdUFYR3L04C50H4ugt2s/HkwXsVgqoyXUgLbdQeITtgFFEPK58VR7iFKk81dEuU7m5yWkXmtEo98Ao0jeS12FWeVo3+WnZhT48edJvNl3RTkU8nN8fKoJAWNJE5HdsJJl6SG6WVZhbsyZfuxVlSLwwbtd2NMcUM/2wReOP4Enoy2rVuhbQTRhpep25pGiwBmvZJ2EVcuD8/fewGwloIy1NftUdUlqUkn7glPKWpsblO7flTDO330FFjyORKSd4bBcY9CCYboUXFe3S9UmYmuvNeTJGRrEziTM1q/eJieLaWhAnuDbiQO12cZgLa0Ay1UI+7eyUfqjMwehWymMHHNXqxc57Y003W5aR3YrfwCXsp3KkCvgAfd7wX3073PRLAOGxztxbWqfrudtpC/R9uWrrGa/1KjS6MSXfxzFFxNdsJhXxUmOQbj8+Py35zB07xilh2kyAoom328/K6KRM740mUxtHoz2fRTmBKYfMMxXaP+wCMzcAsyHCyQLomRElayQs+y1tAVUAKnLtdW+3ke8avSRILNGZpPMjlsozlMBUI6u36Ebaz8M+OjiPUHwvc9g9KeyWkqLD13ITdpkG9OBPmcQNPrW3uti7hlYjkq3Z5iSH8vPEslCfSV1Ha7g1EucSt/Exe8krv/qrzMQeMxCUyu3d1WGutt5lW+QyXDZLPf9M26cldAODkfY99zSUU4FvL6+kdoK1xKt4dDbc3G3EUmSQhw7EDLqFSFZmvZtf2bQvm8HHeyA2FvFGPd6TlN0R0iZJj0Lq2NSZiWsLGNsjKOYvjlIbbIN/gUK8Nn86IrnuAAAAABJRU5ErkJggg==";function on(i){return[null,void 0].indexOf(i)!==-1}function Yv(i,n,e){const{object:r,valueProp:t,mode:o}=l.toRefs(i),a=l.getCurrentInstance().proxy,s=e.iv,u=d=>{s.value=M(d);const g=c(d);n.emit("change",g,a),n.emit("input",g),n.emit("update:modelValue",g)},c=d=>r.value||on(d)?d:Array.isArray(d)?d.map(g=>g[t.value]):d[t.value],M=d=>on(d)?o.value==="single"?{}:[]:d;return{update:u}}function Uv(i,n){const{value:e,modelValue:r,mode:t,valueProp:o}=l.toRefs(i),a=l.ref(t.value!=="single"?[]:{}),s=r&&r.value!==void 0?r:e,u=l.computed(()=>t.value==="single"?a.value[o.value]:a.value.map(M=>M[o.value])),c=l.computed(()=>t.value!=="single"?a.value.map(M=>M[o.value]).join(","):a.value[o.value]);return{iv:a,internalValue:a,ev:s,externalValue:s,textValue:c,plainValue:u}}function _v(i,n,e){const{regex:r}=l.toRefs(i),t=l.getCurrentInstance().proxy,o=e.isOpen,a=e.open,s=l.ref(null),u=l.ref(null),c=()=>{s.value=""},M=f=>{s.value=f.target.value},d=f=>{if(r&&r.value){let j=r.value;typeof j=="string"&&(j=new RegExp(j)),f.key.match(j)||f.preventDefault()}},g=f=>{if(r&&r.value){let p=(f.clipboardData||window.clipboardData).getData("Text"),x=r.value;typeof x=="string"&&(x=new RegExp(x)),p.split("").every(N=>!!N.match(x))||f.preventDefault()}n.emit("paste",f,t)};return l.watch(s,f=>{!o.value&&f&&a(),n.emit("search-change",f,t)}),{search:s,input:u,clearSearch:c,handleSearchInput:M,handleKeypress:d,handlePaste:g}}function Bv(i,n,e){const{groupSelect:r,mode:t,groups:o,disabledProp:a}=l.toRefs(i),s=l.ref(null),u=M=>{M===void 0||M!==null&&M[a.value]||o.value&&M&&M.group&&(t.value==="single"||!r.value)||(s.value=M)};return{pointer:s,setPointer:u,clearPointer:()=>{u(null)}}}function ba(i,n=!0){return n?String(i).toLowerCase().trim():String(i).normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase().trim()}function Pv(i){return Object.prototype.toString.call(i)==="[object Object]"}function Rv(i,n){const e=n.slice().sort();return i.length===n.length&&i.slice().sort().every(function(r,t){return r===e[t]})}function Zv(i,n,e){const{options:r,mode:t,trackBy:o,limit:a,hideSelected:s,createTag:u,createOption:c,label:M,appendNewTag:d,appendNewOption:g,multipleLabel:f,object:j,loading:p,delay:x,resolveOnLoad:N,minChars:h,filterResults:z,clearOnSearch:m,clearOnSelect:I,valueProp:D,canDeselect:v,max:L,strict:w,closeOnSelect:E,groups:T,reverse:y,infinite:A,groupOptions:k,groupHideEmpty:b,groupSelect:C,onCreate:S,disabledProp:O,searchStart:Q}=l.toRefs(i),_=l.getCurrentInstance().proxy,U=e.iv,Y=e.ev,B=e.search,Z=e.clearSearch,P=e.update,R=e.pointer,G=e.clearPointer,W=e.focus,F=e.deactivate,X=e.close,oe=l.ref([]),ee=l.ref([]),ae=l.ref(!1),ge=l.ref(null),V=l.ref(A.value&&a.value===-1?10:a.value),q=l.computed(()=>u.value||c.value||!1),ce=l.computed(()=>d.value!==void 0?d.value:g.value!==void 0?g.value:!0),le=l.computed(()=>{if(T.value){let $=ee.value||[],se=[];return $.forEach(pe=>{At(pe[k.value]).forEach(ne=>{se.push(Object.assign({},ne,pe[O.value]?{[O.value]:!0}:{}))})}),se}else{let $=At(ee.value||[]);return oe.value.length&&($=$.concat(oe.value)),$}}),he=l.computed(()=>T.value?ze((ee.value||[]).map(($,se)=>{const pe=At($[k.value]);return{...$,index:se,group:!0,[k.value]:$t(pe,!1).map(ne=>Object.assign({},ne,$[O.value]?{[O.value]:!0}:{})),__VISIBLE__:$t(pe).map(ne=>Object.assign({},ne,$[O.value]?{[O.value]:!0}:{}))}})):[]),Ee=l.computed(()=>{let $=le.value;return y.value&&($=$.reverse()),te.value.length&&($=te.value.concat($)),$t($)}),Le=l.computed(()=>{let $=Ee.value;return V.value>0&&($=$.slice(0,V.value)),$}),H=l.computed(()=>{switch(t.value){case"single":return!on(U.value[D.value]);case"multiple":case"tags":return!on(U.value)&&U.value.length>0}}),K=l.computed(()=>f!==void 0&&f.value!==void 0?f.value(U.value,_):U.value&&U.value.length>1?`${U.value.length} options selected`:"1 option selected"),ie=l.computed(()=>!le.value.length&&!ae.value&&!te.value.length),ue=l.computed(()=>le.value.length>0&&Le.value.length==0&&(B.value&&T.value||!T.value)),te=l.computed(()=>q.value===!1||!B.value?[]:Ne(B.value)!==-1?[]:[{[D.value]:B.value,[M.value]:B.value,[re.value]:B.value,__CREATE__:!0}]),re=l.computed(()=>o.value||M.value),De=l.computed(()=>{switch(t.value){case"single":return null;case"multiple":case"tags":return[]}}),Ue=l.computed(()=>p.value||ae.value),Ce=$=>{switch(typeof $!="object"&&($=J($)),t.value){case"single":P($);break;case"multiple":case"tags":P(U.value.concat($));break}n.emit("select",Mt($),$,_)},ot=$=>{switch(typeof $!="object"&&($=J($)),t.value){case"single":Ht();break;case"tags":case"multiple":P(Array.isArray($)?U.value.filter(se=>$.map(pe=>pe[D.value]).indexOf(se[D.value])===-1):U.value.filter(se=>se[D.value]!=$[D.value]));break}n.emit("deselect",Mt($),$,_)},Mt=$=>j.value?$:$[D.value],un=$=>{ot($)},In=($,se)=>{if(se.button!==0){se.preventDefault();return}un($)},Ht=()=>{n.emit("clear",_),P(De.value)},It=$=>{if($.group!==void 0)return t.value==="single"?!1:_e($[k.value])&&$[k.value].length;switch(t.value){case"single":return!on(U.value)&&U.value[D.value]==$[D.value];case"tags":case"multiple":return!on(U.value)&&U.value.map(se=>se[D.value]).indexOf($[D.value])!==-1}},ft=$=>$[O.value]===!0,ln=()=>L===void 0||L.value===-1||!H.value&&L.value>0?!1:U.value.length>=L.value,Ct=$=>{if(!ft($)){if(S&&S.value&&!It($)&&$.__CREATE__&&($={...$},delete $.__CREATE__,$=S.value($,_),$ instanceof Promise)){ae.value=!0,$.then(se=>{ae.value=!1,_n(se)});return}_n($)}},_n=$=>{switch($.__CREATE__&&($={...$},delete $.__CREATE__),t.value){case"single":if($&&It($)){v.value&&ot($);return}$&&St($),I.value&&Z(),E.value&&(G(),X()),$&&Ce($);break;case"multiple":if($&&It($)){ot($);return}if(ln())return;$&&(St($),Ce($)),I.value&&Z(),s.value&&G(),E.value&&X();break;case"tags":if($&&It($)){ot($);return}if(ln())return;$&&St($),I.value&&Z(),$&&Ce($),s.value&&G(),E.value&&X();break}E.value||W()},ai=$=>{if(!(ft($)||t.value==="single"||!C.value)){switch(t.value){case"multiple":case"tags":Ft($[k.value])?ot($[k.value]):Ce($[k.value].filter(se=>U.value.map(pe=>pe[D.value]).indexOf(se[D.value])===-1).filter(se=>!se[O.value]).filter((se,pe)=>U.value.length+1+pe<=L.value||L.value===-1));break}E.value&&F()}},St=$=>{J($[D.value])===void 0&&q.value&&(n.emit("tag",$[D.value],_),n.emit("option",$[D.value],_),ce.value&&Ie($),Z())},Bn=()=>{t.value!=="single"&&Ce(Le.value)},Ft=$=>$.find(se=>!It(se)&&!se[O.value])===void 0,_e=$=>$.find(se=>!It(se))===void 0,J=$=>le.value[le.value.map(se=>String(se[D.value])).indexOf(String($))],Ne=($,se=!0)=>le.value.map(pe=>parseInt(pe[re.value])==pe[re.value]?parseInt(pe[re.value]):pe[re.value]).indexOf(parseInt($)==$?parseInt($):$),fe=$=>["tags","multiple"].indexOf(t.value)!==-1&&s.value&&It($),Ie=$=>{oe.value.push($)},ze=$=>b.value?$.filter(se=>B.value?se.__VISIBLE__.length:se[k.value].length):$.filter(se=>B.value?se.__VISIBLE__.length:!0),$t=($,se=!0)=>{let pe=$;return B.value&&z.value&&(pe=pe.filter(ne=>Q.value?ba(ne[re.value],w.value).startsWith(ba(B.value,w.value)):ba(ne[re.value],w.value).indexOf(ba(B.value,w.value))!==-1)),s.value&&se&&(pe=pe.filter(ne=>!fe(ne))),pe},At=$=>{let se=$;return Pv(se)&&(se=Object.keys(se).map(pe=>{let ne=se[pe];return{[D.value]:pe,[re.value]:ne,[M.value]:ne}})),se=se.map(pe=>typeof pe=="object"?pe:{[D.value]:pe,[re.value]:pe,[M.value]:pe}),se},cn=()=>{on(Y.value)||(U.value=Dn(Y.value))},Mn=$=>(ae.value=!0,new Promise((se,pe)=>{r.value(B.value,_).then(ne=>{ee.value=ne||[],typeof $=="function"&&$(ne),ae.value=!1}).catch(ne=>{console.error(ne),ee.value=[],ae.value=!1}).finally(()=>{se()})})),pn=()=>{if(H.value)if(t.value==="single"){let $=J(U.value[D.value]);if($!==void 0){let se=$[M.value];U.value[M.value]=se,j.value&&(Y.value[M.value]=se)}}else U.value.forEach(($,se)=>{let pe=J(U.value[se][D.value]);if(pe!==void 0){let ne=pe[M.value];U.value[se][M.value]=ne,j.value&&(Y.value[se][M.value]=ne)}})},si=$=>{Mn($)},Dn=$=>on($)?t.value==="single"?{}:[]:j.value?$:t.value==="single"?J($)||{}:$.filter(se=>!!J(se)).map(se=>J(se)),lr=()=>{ge.value=l.watch(B,$=>{$.length<h.value||!$&&h.value!==0||(ae.value=!0,m.value&&(ee.value=[]),setTimeout(()=>{$==B.value&&r.value(B.value,_).then(se=>{($==B.value||!B.value)&&(ee.value=se,R.value=Le.value.filter(pe=>pe[O.value]!==!0)[0]||null,ae.value=!1)}).catch(se=>{console.error(se)})},x.value))},{flush:"sync"})};if(t.value!=="single"&&!on(Y.value)&&!Array.isArray(Y.value))throw new Error(`v-model must be an array when using "${t.value}" mode`);return r&&typeof r.value=="function"?N.value?Mn(cn):j.value==!0&&cn():(ee.value=r.value,cn()),x.value>-1&&lr(),l.watch(x,($,se)=>{ge.value&&ge.value(),$>=0&&lr()}),l.watch(Y,$=>{if(on($)){U.value=Dn($);return}switch(t.value){case"single":(j.value?$[D.value]!=U.value[D.value]:$!=U.value[D.value])&&(U.value=Dn($));break;case"multiple":case"tags":Rv(j.value?$.map(se=>se[D.value]):$,U.value.map(se=>se[D.value]))||(U.value=Dn($));break}},{deep:!0}),l.watch(r,($,se)=>{typeof i.options=="function"?N.value&&(!se||$&&$.toString()!==se.toString())&&Mn():(ee.value=i.options,Object.keys(U.value).length||cn(),pn())}),l.watch(M,pn),{pfo:Ee,fo:Le,filteredOptions:Le,hasSelected:H,multipleLabelText:K,eo:le,extendedOptions:le,fg:he,filteredGroups:he,noOptions:ie,noResults:ue,resolving:ae,busy:Ue,offset:V,select:Ce,deselect:ot,remove:un,selectAll:Bn,clear:Ht,isSelected:It,isDisabled:ft,isMax:ln,getOption:J,handleOptionClick:Ct,handleGroupClick:ai,handleTagRemove:In,refreshOptions:si,resolveOptions:Mn,refreshLabels:pn}}function Vv(i,n,e){const{valueProp:r,showOptions:t,searchable:o,groupLabel:a,groups:s,mode:u,groupSelect:c,disabledProp:M}=l.toRefs(i),d=e.fo,g=e.fg,f=e.handleOptionClick,j=e.handleGroupClick,p=e.search,x=e.pointer,N=e.setPointer,h=e.clearPointer,z=e.multiselect,m=e.isOpen,I=l.computed(()=>d.value.filter(P=>!P[M.value])),D=l.computed(()=>g.value.filter(P=>!P[M.value])),v=l.computed(()=>u.value!=="single"&&c.value),L=l.computed(()=>x.value&&x.value.group),w=l.computed(()=>B(x.value)),E=l.computed(()=>{const P=L.value?x.value:B(x.value),R=D.value.map(W=>W[a.value]).indexOf(P[a.value]);let G=D.value[R-1];return G===void 0&&(G=y.value),G}),T=l.computed(()=>{let P=D.value.map(R=>R.label).indexOf(L.value?x.value[a.value]:B(x.value)[a.value])+1;return D.value.length<=P&&(P=0),D.value[P]}),y=l.computed(()=>[...D.value].slice(-1)[0]),A=l.computed(()=>x.value.__VISIBLE__.filter(P=>!P[M.value])[0]),k=l.computed(()=>{const P=w.value.__VISIBLE__.filter(R=>!R[M.value]);return P[P.map(R=>R[r.value]).indexOf(x.value[r.value])-1]}),b=l.computed(()=>{const P=B(x.value).__VISIBLE__.filter(R=>!R[M.value]);return P[P.map(R=>R[r.value]).indexOf(x.value[r.value])+1]}),C=l.computed(()=>[...E.value.__VISIBLE__.filter(P=>!P[M.value])].slice(-1)[0]),S=l.computed(()=>[...y.value.__VISIBLE__.filter(P=>!P[M.value])].slice(-1)[0]),O=P=>x.value&&(!P.group&&x.value[r.value]==P[r.value]||P.group!==void 0&&x.value[a.value]==P[a.value])?!0:void 0,Q=()=>{N(I.value[0]||null)},_=()=>{!x.value||x.value[M.value]===!0||(L.value?j(x.value):f(x.value))},U=()=>{if(x.value===null)N((s.value&&v.value?D.value[0]:I.value[0])||null);else if(s.value&&v.value){let P=L.value?A.value:b.value;P===void 0&&(P=T.value),N(P||null)}else{let P=I.value.map(R=>R[r.value]).indexOf(x.value[r.value])+1;I.value.length<=P&&(P=0),N(I.value[P]||null)}l.nextTick(()=>{Z()})},Y=()=>{if(x.value===null){let P=I.value[I.value.length-1];s.value&&v.value&&(P=S.value,P===void 0&&(P=y.value)),N(P||null)}else if(s.value&&v.value){let P=L.value?C.value:k.value;P===void 0&&(P=L.value?E.value:w.value),N(P||null)}else{let P=I.value.map(R=>R[r.value]).indexOf(x.value[r.value])-1;P<0&&(P=I.value.length-1),N(I.value[P]||null)}l.nextTick(()=>{Z()})},B=P=>D.value.find(R=>R.__VISIBLE__.map(G=>G[r.value]).indexOf(P[r.value])!==-1),Z=()=>{let P=z.value.querySelector("[data-pointed]");if(!P)return;let R=P.parentElement.parentElement;s.value&&(R=L.value?P.parentElement.parentElement.parentElement:P.parentElement.parentElement.parentElement.parentElement),P.offsetTop+P.offsetHeight>R.clientHeight+R.scrollTop&&(R.scrollTop=P.offsetTop+P.offsetHeight-R.clientHeight),P.offsetTop<R.scrollTop&&(R.scrollTop=P.offsetTop)};return l.watch(p,P=>{o.value&&(P.length&&t.value?Q():h())}),l.watch(m,P=>{if(P){let R=z.value.querySelectorAll("[data-selected]")[0];if(!R)return;let G=R.parentElement.parentElement;l.nextTick(()=>{G.scrollTop>0||(G.scrollTop=R.offsetTop)})}}),{pointer:x,canPointGroups:v,isPointed:O,setPointerFirst:Q,selectPointer:_,forwardPointer:U,backwardPointer:Y}}function Gv(i,n,e){const{disabled:r}=l.toRefs(i),t=l.getCurrentInstance().proxy,o=l.ref(!1);return{isOpen:o,open:()=>{o.value||r.value||(o.value=!0,n.emit("open",t))},close:()=>{o.value&&(o.value=!1,n.emit("close",t))}}}function Wv(i,n,e){const{searchable:r,disabled:t}=l.toRefs(i),o=e.input,a=e.open,s=e.close,u=e.clearSearch,c=e.isOpen,M=l.ref(null),d=l.ref(null),g=l.ref(null),f=l.ref(!1),j=l.ref(!1),p=l.computed(()=>r.value||t.value?-1:0),x=()=>{r.value&&o.value.blur(),d.value.blur()},N=()=>{r.value&&!t.value&&o.value.focus()},h=(L=!0)=>{t.value||(f.value=!0,L&&a())},z=()=>{f.value=!1,setTimeout(()=>{f.value||(s(),u())},1)};return{multiselect:M,wrapper:d,tags:g,tabindex:p,isActive:f,mouseClicked:j,blur:x,focus:N,activate:h,deactivate:z,handleFocusIn:L=>{L.target.closest("[data-tags]")||L.target.closest("[data-clear]")||h(j.value)},handleFocusOut:()=>{z()},handleCaretClick:()=>{z(),x()},handleMousedown:L=>{j.value=!0,c.value&&(L.target.isEqualNode(d.value)||L.target.isEqualNode(g.value))?setTimeout(()=>{z()},0):document.activeElement.isEqualNode(d.value)&&!c.value&&(console.log(L.target.closest("[data-tags]")),h()),setTimeout(()=>{j.value=!1},0)}}}function Hv(i,n,e){const{mode:r,addTagOn:t,openDirection:o,searchable:a,showOptions:s,valueProp:u,groups:c,addOptionOn:M,createTag:d,createOption:g,reverse:f}=l.toRefs(i),j=l.getCurrentInstance().proxy,p=e.iv,x=e.update,N=e.search,h=e.setPointer,z=e.selectPointer,m=e.backwardPointer,I=e.forwardPointer,D=e.multiselect,v=e.wrapper,L=e.tags,w=e.isOpen,E=e.open,T=e.blur,y=e.fo,A=l.computed(()=>d.value||g.value||!1),k=l.computed(()=>t.value!==void 0?t.value:M.value!==void 0?M.value:["enter"]),b=()=>{r.value==="tags"&&!s.value&&A.value&&a.value&&!c.value&&h(y.value[y.value.map(O=>O[u.value]).indexOf(N.value)])};return{handleKeydown:O=>{n.emit("keydown",O,j);let Q,_;switch(["ArrowLeft","ArrowRight","Enter"].indexOf(O.key)!==-1&&r.value==="tags"&&(Q=[...D.value.querySelectorAll("[data-tags] > *")].filter(U=>U!==L.value),_=Q.findIndex(U=>U===document.activeElement)),O.key){case"Backspace":if(r.value==="single"||a.value&&[null,""].indexOf(N.value)===-1||p.value.length===0)return;x([...p.value].slice(0,-1));break;case"Enter":if(O.preventDefault(),O.keyCode===229)return;if(_!==-1&&_!==void 0){x([...p.value].filter((U,Y)=>Y!==_)),_===Q.length-1&&(Q.length-1?Q[Q.length-2].focus():a.value?L.value.querySelector("input").focus():v.value.focus());return}if(k.value.indexOf("enter")===-1&&A.value)return;b(),z();break;case" ":if(!A.value&&!a.value){O.preventDefault(),b(),z();return}if(!A.value)return!1;if(k.value.indexOf("space")===-1&&A.value)return;O.preventDefault(),b(),z();break;case"Tab":case";":case",":if(k.value.indexOf(O.key.toLowerCase())===-1||!A.value)return;b(),z(),O.preventDefault();break;case"Escape":T();break;case"ArrowUp":if(O.preventDefault(),!s.value)return;w.value||E(),m();break;case"ArrowDown":if(O.preventDefault(),!s.value)return;w.value||E(),I();break;case"ArrowLeft":if(a.value&&L.value&&L.value.querySelector("input").selectionStart||O.shiftKey||r.value!=="tags"||!p.value||!p.value.length)return;O.preventDefault(),_===-1?Q[Q.length-1].focus():_>0&&Q[_-1].focus();break;case"ArrowRight":if(_===-1||O.shiftKey||r.value!=="tags"||!p.value||!p.value.length)return;O.preventDefault(),Q.length>_+1?Q[_+1].focus():a.value?L.value.querySelector("input").focus():a.value||v.value.focus();break}},handleKeyup:O=>{n.emit("keyup",O,j)},preparePointer:b}}function Fv(i,n,e){const{classes:r,disabled:t,openDirection:o,showOptions:a}=l.toRefs(i),s=e.isOpen,u=e.isPointed,c=e.isSelected,M=e.isDisabled,d=e.isActive,g=e.canPointGroups,f=e.resolving,j=e.fo,p=l.computed(()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value})),x=l.computed(()=>!!(s.value&&a.value&&(!f.value||f.value&&j.value.length)));return{classList:l.computed(()=>{const h=p.value;return{container:[h.container].concat(t.value?h.containerDisabled:[]).concat(x.value&&o.value==="top"?h.containerOpenTop:[]).concat(x.value&&o.value!=="top"?h.containerOpen:[]).concat(d.value?h.containerActive:[]),wrapper:h.wrapper,spacer:h.spacer,singleLabel:h.singleLabel,singleLabelText:h.singleLabelText,multipleLabel:h.multipleLabel,search:h.search,tags:h.tags,tag:[h.tag].concat(t.value?h.tagDisabled:[]),tagRemove:h.tagRemove,tagRemoveIcon:h.tagRemoveIcon,tagsSearchWrapper:h.tagsSearchWrapper,tagsSearch:h.tagsSearch,tagsSearchCopy:h.tagsSearchCopy,placeholder:h.placeholder,caret:[h.caret].concat(s.value?h.caretOpen:[]),clear:h.clear,clearIcon:h.clearIcon,spinner:h.spinner,inifinite:h.inifinite,inifiniteSpinner:h.inifiniteSpinner,dropdown:[h.dropdown].concat(o.value==="top"?h.dropdownTop:[]).concat(!s.value||!a.value||!x.value?h.dropdownHidden:[]),options:[h.options].concat(o.value==="top"?h.optionsTop:[]),group:h.group,groupLabel:z=>{let m=[h.groupLabel];return u(z)?m.push(c(z)?h.groupLabelSelectedPointed:h.groupLabelPointed):c(z)&&g.value?m.push(M(z)?h.groupLabelSelectedDisabled:h.groupLabelSelected):M(z)&&m.push(h.groupLabelDisabled),g.value&&m.push(h.groupLabelPointable),m},groupOptions:h.groupOptions,option:(z,m)=>{let I=[h.option];return u(z)?I.push(c(z)?h.optionSelectedPointed:h.optionPointed):c(z)?I.push(M(z)?h.optionSelectedDisabled:h.optionSelected):(M(z)||m&&M(m))&&I.push(h.optionDisabled),I},noOptions:h.noOptions,noResults:h.noResults,assist:h.assist,fakeInput:h.fakeInput}}),showDropdown:x}}function $v(i,n,e){const{limit:r,infinite:t}=l.toRefs(i),o=e.isOpen,a=e.offset,s=e.search,u=e.pfo,c=e.eo,M=l.ref(null),d=l.ref(null),g=l.computed(()=>a.value<u.value.length),f=p=>{const{isIntersecting:x,target:N}=p[0];if(x){const h=N.offsetParent,z=h.scrollTop;a.value+=r.value==-1?10:r.value,l.nextTick(()=>{h.scrollTop=z})}},j=()=>{o.value&&a.value<u.value.length?M.value.observe(d.value):!o.value&&M.value&&M.value.disconnect()};return l.watch(o,()=>{t.value&&j()}),l.watch(s,()=>{t.value&&(a.value=r.value,j())},{flush:"post"}),l.watch(c,()=>{t.value&&j()},{immediate:!1,flush:"post"}),l.onMounted(()=>{window&&window.IntersectionObserver&&(M.value=new IntersectionObserver(f))}),{hasMore:g,infiniteLoader:d}}function Jv(i,n,e){const{placeholder:r,id:t,valueProp:o,label:a,mode:s,groupLabel:u,aria:c,searchable:M}=l.toRefs(i),d=e.pointer,g=e.iv,f=e.hasSelected,j=e.multipleLabelText,p=l.ref(null),x=l.computed(()=>{let y=[];return t&&t.value&&y.push(t.value),y.push("assist"),y.join("-")}),N=l.computed(()=>{let y=[];return t&&t.value&&y.push(t.value),y.push("multiselect-options"),y.join("-")}),h=l.computed(()=>{let y=[];if(t&&t.value&&y.push(t.value),d.value)return y.push(d.value.group?"multiselect-group":"multiselect-option"),y.push(d.value.group?d.value.index:d.value[o.value]),y.join("-")}),z=l.computed(()=>r.value),m=l.computed(()=>s.value!=="single"),I=l.computed(()=>{let y="";return s.value==="single"&&f.value&&(y+=g.value[a.value]),s.value==="multiple"&&f.value&&(y+=j.value),s.value==="tags"&&f.value&&(y+=g.value.map(A=>A[a.value]).join(", ")),y}),D=l.computed(()=>{let y={...c.value};return M.value&&(y["aria-labelledby"]=y["aria-labelledby"]?`${x.value} ${y["aria-labelledby"]}`:x.value,I.value&&y["aria-label"]&&(y["aria-label"]=`${I.value}, ${y["aria-label"]}`)),y}),v=y=>{let A=[];return t&&t.value&&A.push(t.value),A.push("multiselect-option"),A.push(y[o.value]),A.join("-")},L=y=>{let A=[];return t&&t.value&&A.push(t.value),A.push("multiselect-group"),A.push(y.index),A.join("-")},w=y=>{let A=[];return A.push(y[a.value]),A.join(" ")},E=y=>{let A=[];return A.push(y[u.value]),A.join(" ")},T=y=>`${y} ❎`;return l.onMounted(()=>{if(t&&t.value&&document&&document.querySelector){let y=document.querySelector(`[for="${t.value}"]`);p.value=y?y.innerText:null}}),{arias:D,ariaLabel:I,ariaAssist:x,ariaControls:N,ariaPlaceholder:z,ariaMultiselectable:m,ariaActiveDescendant:h,ariaOptionId:v,ariaOptionLabel:w,ariaGroupId:L,ariaGroupLabel:E,ariaTagLabel:T}}function Xv(i,n,e,r={}){return e.forEach(t=>{t&&(r={...r,...t(i,n,r)})}),r}var zl={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})}},setup(i,n){return Xv(i,n,[Uv,Bv,Gv,_v,Yv,Wv,Zv,$v,Vv,Hv,Fv,Jv])}};const Kv=["id","dir"],qv=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],ek=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],tk=["onKeyup","aria-label"],nk=["onClick"],ik=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],rk=["innerHTML"],ok=["id"],ak=["id","aria-label","aria-selected"],sk=["data-pointed","onMouseenter","onClick"],uk=["innerHTML"],lk=["aria-label"],ck=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],Mk=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],dk=["innerHTML"],gk=["innerHTML"],fk=["value"],yk=["name","value"],Nk=["name","value"],jk=["id"];function hk(i,n,e,r,t,o){return l.openBlock(),l.createElementBlock("div",{ref:"multiselect",class:l.normalizeClass(i.classList.container),id:e.searchable?void 0:e.id,dir:e.rtl?"rtl":void 0,onFocusin:n[10]||(n[10]=(...a)=>i.handleFocusIn&&i.handleFocusIn(...a)),onFocusout:n[11]||(n[11]=(...a)=>i.handleFocusOut&&i.handleFocusOut(...a)),onKeyup:n[12]||(n[12]=(...a)=>i.handleKeyup&&i.handleKeyup(...a)),onKeydown:n[13]||(n[13]=(...a)=>i.handleKeydown&&i.handleKeydown(...a))},[l.createElementVNode("div",l.mergeProps({class:i.classList.wrapper,onMousedown:n[9]||(n[9]=(...a)=>i.handleMousedown&&i.handleMousedown(...a)),ref:"wrapper",tabindex:i.tabindex,"aria-controls":e.searchable?void 0:i.ariaControls,"aria-placeholder":e.searchable?void 0:i.ariaPlaceholder,"aria-expanded":e.searchable?void 0:i.isOpen,"aria-activedescendant":e.searchable?void 0:i.ariaActiveDescendant,"aria-multiselectable":e.searchable?void 0:i.ariaMultiselectable,role:e.searchable?void 0:"combobox"},e.searchable?{}:i.arias),[l.createCommentVNode(" Search "),e.mode!=="tags"&&e.searchable&&!e.disabled?(l.openBlock(),l.createElementBlock("input",l.mergeProps({key:0,type:e.inputType,modelValue:i.search,value:i.search,class:i.classList.search,autocomplete:e.autocomplete,id:e.searchable?e.id:void 0,onInput:n[0]||(n[0]=(...a)=>i.handleSearchInput&&i.handleSearchInput(...a)),onKeypress:n[1]||(n[1]=(...a)=>i.handleKeypress&&i.handleKeypress(...a)),onPaste:n[2]||(n[2]=l.withModifiers((...a)=>i.handlePaste&&i.handlePaste(...a),["stop"])),ref:"input","aria-controls":i.ariaControls,"aria-placeholder":i.ariaPlaceholder,"aria-expanded":i.isOpen,"aria-activedescendant":i.ariaActiveDescendant,"aria-multiselectable":i.ariaMultiselectable,role:"combobox"},{...e.attrs,...i.arias}),null,16,ek)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Tags (with search) "),e.mode=="tags"?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(i.classList.tags),"data-tags":""},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.iv,(a,s,u)=>l.renderSlot(i.$slots,"tag",{option:a,handleTagRemove:i.handleTagRemove,disabled:e.disabled},()=>[(l.openBlock(),l.createElementBlock("span",{class:l.normalizeClass(i.classList.tag),tabindex:"-1",onKeyup:l.withKeys(c=>i.handleTagRemove(a,c),["enter"]),key:u,"aria-label":i.ariaTagLabel(a[e.label])},[l.createTextVNode(l.toDisplayString(a[e.label])+" ",1),e.disabled?l.createCommentVNode("v-if",!0):(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(i.classList.tagRemove),onClick:c=>i.handleTagRemove(a,c)},[l.createElementVNode("span",{class:l.normalizeClass(i.classList.tagRemoveIcon)},null,2)],10,nk))],42,tk))])),256)),l.createElementVNode("div",{class:l.normalizeClass(i.classList.tagsSearchWrapper),ref:"tags"},[l.createCommentVNode(" Used for measuring search width "),l.createElementVNode("span",{class:l.normalizeClass(i.classList.tagsSearchCopy)},l.toDisplayString(i.search),3),l.createCommentVNode(" Actual search input "),e.searchable&&!e.disabled?(l.openBlock(),l.createElementBlock("input",l.mergeProps({key:0,type:e.inputType,modelValue:i.search,value:i.search,class:i.classList.tagsSearch,id:e.searchable?e.id:void 0,autocomplete:e.autocomplete,onInput:n[3]||(n[3]=(...a)=>i.handleSearchInput&&i.handleSearchInput(...a)),onKeypress:n[4]||(n[4]=(...a)=>i.handleKeypress&&i.handleKeypress(...a)),onPaste:n[5]||(n[5]=l.withModifiers((...a)=>i.handlePaste&&i.handlePaste(...a),["stop"])),ref:"input","aria-controls":i.ariaControls,"aria-placeholder":i.ariaPlaceholder,"aria-expanded":i.isOpen,"aria-activedescendant":i.ariaActiveDescendant,"aria-multiselectable":i.ariaMultiselectable,role:"combobox"},{...e.attrs,...i.arias}),null,16,ik)):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Single label "),e.mode=="single"&&i.hasSelected&&!i.search&&i.iv?l.renderSlot(i.$slots,"singlelabel",{key:2,value:i.iv},()=>[l.createElementVNode("div",{class:l.normalizeClass(i.classList.singleLabel)},[l.createElementVNode("span",{class:l.normalizeClass(i.classList.singleLabelText)},l.toDisplayString(i.iv[e.label]),3)],2)]):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Multiple label "),e.mode=="multiple"&&i.hasSelected&&!i.search?l.renderSlot(i.$slots,"multiplelabel",{key:3,values:i.iv},()=>[l.createElementVNode("div",{class:l.normalizeClass(i.classList.multipleLabel),innerHTML:i.multipleLabelText},null,10,rk)]):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Placeholder "),e.placeholder&&!i.hasSelected&&!i.search?l.renderSlot(i.$slots,"placeholder",{key:4},()=>[l.createElementVNode("div",{class:l.normalizeClass(i.classList.placeholder),"aria-hidden":"true"},l.toDisplayString(e.placeholder),3)]):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Spinner "),e.loading||i.resolving?l.renderSlot(i.$slots,"spinner",{key:5},()=>[l.createElementVNode("span",{class:l.normalizeClass(i.classList.spinner),"aria-hidden":"true"},null,2)]):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Clear "),i.hasSelected&&!e.disabled&&e.canClear&&!i.busy?l.renderSlot(i.$slots,"clear",{key:6,clear:i.clear},()=>[l.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:l.normalizeClass(i.classList.clear),onClick:n[6]||(n[6]=(...a)=>i.clear&&i.clear(...a)),onKeyup:n[7]||(n[7]=l.withKeys((...a)=>i.clear&&i.clear(...a),["enter"]))},[l.createElementVNode("span",{class:l.normalizeClass(i.classList.clearIcon)},null,2)],34)]):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Caret "),e.caret&&e.showOptions?l.renderSlot(i.$slots,"caret",{key:7},()=>[l.createElementVNode("span",{class:l.normalizeClass(i.classList.caret),onClick:n[8]||(n[8]=(...a)=>i.handleCaretClick&&i.handleCaretClick(...a)),"aria-hidden":"true"},null,2)]):l.createCommentVNode("v-if",!0)],16,qv),l.createCommentVNode(" Options "),l.createElementVNode("div",{class:l.normalizeClass(i.classList.dropdown),tabindex:"-1"},[l.renderSlot(i.$slots,"beforelist",{options:i.fo}),l.createElementVNode("ul",{class:l.normalizeClass(i.classList.options),id:i.ariaControls,role:"listbox"},[e.groups?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(i.fg,(a,s,u)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(i.classList.group),key:u,id:i.ariaGroupId(a),"aria-label":i.ariaGroupLabel(a),"aria-selected":i.isSelected(a),role:"option"},[l.createElementVNode("div",{class:l.normalizeClass(i.classList.groupLabel(a)),"data-pointed":i.isPointed(a),onMouseenter:c=>i.setPointer(a,s),onClick:c=>i.handleGroupClick(a)},[l.renderSlot(i.$slots,"grouplabel",{group:a,isSelected:i.isSelected,isPointed:i.isPointed},()=>[l.createElementVNode("span",{innerHTML:a[e.groupLabel]},null,8,uk)])],42,sk),l.createElementVNode("ul",{class:l.normalizeClass(i.classList.groupOptions),"aria-label":i.ariaGroupLabel(a),role:"group"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.__VISIBLE__,(c,M,d)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(i.classList.option(c,a)),"data-pointed":i.isPointed(c),"data-selected":i.isSelected(c)||void 0,key:d,onMouseenter:g=>i.setPointer(c),onClick:g=>i.handleOptionClick(c),id:i.ariaOptionId(c),"aria-selected":i.isSelected(c),"aria-label":i.ariaOptionLabel(c),role:"option"},[l.renderSlot(i.$slots,"option",{option:c,isSelected:i.isSelected,isPointed:i.isPointed,search:i.search},()=>[l.createElementVNode("span",null,l.toDisplayString(c[e.label]),1)])],42,ck))),128))],10,lk)],10,ak))),128)):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(i.fo,(a,s,u)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(i.classList.option(a)),"data-pointed":i.isPointed(a),"data-selected":i.isSelected(a)||void 0,key:u,onMouseenter:c=>i.setPointer(a),onClick:c=>i.handleOptionClick(a),id:i.ariaOptionId(a),"aria-selected":i.isSelected(a),"aria-label":i.ariaOptionLabel(a),role:"option"},[l.renderSlot(i.$slots,"option",{option:a,isSelected:i.isSelected,isPointed:i.isPointed,search:i.search},()=>[l.createElementVNode("span",null,l.toDisplayString(a[e.label]),1)])],42,Mk))),128))],10,ok),i.noOptions?l.renderSlot(i.$slots,"nooptions",{key:0},()=>[l.createElementVNode("div",{class:l.normalizeClass(i.classList.noOptions),innerHTML:e.noOptionsText},null,10,dk)]):l.createCommentVNode("v-if",!0),i.noResults?l.renderSlot(i.$slots,"noresults",{key:1},()=>[l.createElementVNode("div",{class:l.normalizeClass(i.classList.noResults),innerHTML:e.noResultsText},null,10,gk)]):l.createCommentVNode("v-if",!0),e.infinite&&i.hasMore?(l.openBlock(),l.createElementBlock("div",{key:2,class:l.normalizeClass(i.classList.inifinite),ref:"infiniteLoader"},[l.renderSlot(i.$slots,"infinite",{},()=>[l.createElementVNode("span",{class:l.normalizeClass(i.classList.inifiniteSpinner)},null,2)])],2)):l.createCommentVNode("v-if",!0),l.renderSlot(i.$slots,"afterlist",{options:i.fo})],2),l.createCommentVNode(" Hacky input element to show HTML5 required warning "),e.required?(l.openBlock(),l.createElementBlock("input",{key:0,class:l.normalizeClass(i.classList.fakeInput),tabindex:"-1",value:i.textValue,required:""},null,10,fk)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Native input support "),e.nativeSupport?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[e.mode=="single"?(l.openBlock(),l.createElementBlock("input",{key:0,type:"hidden",name:e.name,value:i.plainValue!==void 0?i.plainValue:""},null,8,yk)):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(i.plainValue,(a,s)=>(l.openBlock(),l.createElementBlock("input",{type:"hidden",name:`${e.name}[]`,value:a,key:s},null,8,Nk))),128))],64)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Screen reader assistive text "),e.searchable&&i.hasSelected?(l.openBlock(),l.createElementBlock("div",{key:2,class:l.normalizeClass(i.classList.assist),id:i.ariaAssist,"aria-hidden":"true"},l.toDisplayString(i.ariaLabel),11,jk)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Create height for empty input "),l.createElementVNode("div",{class:l.normalizeClass(i.classList.spacer)},null,2)],42,Kv)}zl.render=hk,zl.__file="src/Multiselect.vue";const uO="",lO="",Ik=l.createElementVNode("img",{alt:"",class:"list__item_thumb",src:Qv},null,-1),pk={class:"list__item_text"},Dk={__name:"InputList",props:{list:{type:Array,required:!0},maxHeight:{type:String,default:"200px"},labelProp:{type:String,default:"label"},valueProp:{type:String,default:"id"},canClear:{type:Boolean,required:!1,default:!0},placeholder:{type:String,required:!1,default:"Start typing..."},modelValue:{type:[Object,Array],required:!1,default:null}},emits:["update","select","deselect","clear"],setup(i,{emit:n}){const e=i;l.useCssVars(u=>({"0e8a9c62":i.maxHeight}));const r=l.computed({get(){return e.modelValue},set(){}});function t(u){n("select",u)}function o(u){n("deselect",u)}function a(u){n("update",u)}function s(){n("clear")}return(u,c)=>(l.openBlock(),l.createBlock(l.unref(zl),{modelValue:l.unref(r),"onUpdate:modelValue":c[0]||(c[0]=M=>l.isRef(r)?r.value=M:null),"can-clear":e.canClear,label:i.labelProp,mode:"tags",native:!1,object:!0,options:i.list,placeholder:e.placeholder,searchable:!0,"value-prop":i.valueProp,onChange:c[1]||(c[1]=M=>a(M)),onClear:c[2]||(c[2]=M=>s()),onDeselect:c[3]||(c[3]=M=>o(M)),onSelect:c[4]||(c[4]=M=>t(M))},{tag:l.withCtx(({option:M,handleTagRemove:d,disabled:g})=>[l.createElementVNode("div",{class:l.normalizeClass(["list__item",{"is-disabled":g}])},[Ik,l.createElementVNode("p",pk,l.toDisplayString(M[i.labelProp]),1),l.createVNode(me,{class:"list__item_icon","icon-name":"delete",size:24,onMousedown:l.withModifiers(f=>d(M,f),["prevent"])},null,8,["onMousedown"]),l.renderSlot(u.$slots,"default")],2)]),_:3},8,["modelValue","can-clear","label","options","placeholder","value-prop"]))}},mk=l.defineComponent({components:{DhIcon:me},props:{hasCloseButton:{type:Boolean,default:!0},hasSideBar:{type:Boolean,default:!0},hasSideBarButtonBottom:{type:Boolean,default:!0},hasHeader:{type:Boolean,default:!0},hasFooter:{type:Boolean,default:!0},hasFooterButtonRight:{type:Boolean,default:!0},hasBodyScrolling:{type:Boolean,default:!0},sideBarPosition:{type:String,default:"left"},hasCloseConfirmation:{type:Boolean,default:!1},bodyClass:{type:String,default:""},fitContent:{type:Boolean,default:!1}},emits:["close"],mounted(){document.body.classList.add("modal-open")},unmounted(){document.body.classList.remove("modal-open")},methods:{closed(){this.$emit("close",this.hasCloseConfirmation),document.body.classList.remove("modal-open")}}}),zk={class:"modal-content"},xk={key:0,id:"modal-sidebar",class:"modal-sidebar"},Ak={key:0,id:"modalTitle",class:"modal-header"},Tk={class:"modal-footer"};function Lk(i,n,e,r,t,o){const a=l.resolveComponent("dh-icon");return l.openBlock(),l.createBlock(l.Transition,{name:"modal-fade"},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"modal-backdrop",onMousedown:n[2]||(n[2]=(...s)=>i.closed&&i.closed(...s))},[l.createElementVNode("div",{"aria-describedby":"modalDescription","aria-labelledby":"modalTitle",class:l.normalizeClass(`
|
|
19
|
+
`):i}function PT(i,n){const{element:e,datasetIndex:r,index:t}=n,o=i.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(t);return{chart:i,label:a,parsed:o.getParsed(t),raw:i.data.datasets[r].data[t],formattedValue:s,dataset:o.getDataset(),dataIndex:t,datasetIndex:r,element:e}}function qg(i,n){const e=i.chart.ctx,{body:r,footer:t,title:o}=i,{boxWidth:a,boxHeight:s}=n,u=xt(n.bodyFont),c=xt(n.titleFont),M=xt(n.footerFont),d=o.length,g=t.length,f=r.length,j=Ot(n.padding);let p=j.height,x=0,N=r.reduce((m,I)=>m+I.before.length+I.lines.length+I.after.length,0);if(N+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*n.titleSpacing+n.titleMarginBottom),N){const m=n.displayColors?Math.max(s,u.lineHeight):u.lineHeight;p+=f*m+(N-f)*u.lineHeight+(N-1)*n.bodySpacing}g&&(p+=n.footerMarginTop+g*M.lineHeight+(g-1)*n.footerSpacing);let h=0;const z=function(m){x=Math.max(x,e.measureText(m).width+h)};return e.save(),e.font=c.string,Ye(i.title,z),e.font=u.string,Ye(i.beforeBody.concat(i.afterBody),z),h=n.displayColors?a+2+n.boxPadding:0,Ye(r,m=>{Ye(m.before,z),Ye(m.lines,z),Ye(m.after,z)}),h=0,e.font=M.string,Ye(i.footer,z),e.restore(),x+=j.width,{width:x,height:p}}function RT(i,n){const{y:e,height:r}=n;return e<r/2?"top":e>i.height-r/2?"bottom":"center"}function ZT(i,n,e,r){const{x:t,width:o}=r,a=e.caretSize+e.caretPadding;if(i==="left"&&t+o+a>n.width||i==="right"&&t-o-a<0)return!0}function VT(i,n,e,r){const{x:t,width:o}=e,{width:a,chartArea:{left:s,right:u}}=i;let c="center";return r==="center"?c=t<=(s+u)/2?"left":"right":t<=o/2?c="left":t>=a-o/2&&(c="right"),ZT(c,i,n,e)&&(c="center"),c}function ef(i,n,e){const r=e.yAlign||n.yAlign||RT(i,e);return{xAlign:e.xAlign||n.xAlign||VT(i,n,e,r),yAlign:r}}function GT(i,n){let{x:e,width:r}=i;return n==="right"?e-=r:n==="center"&&(e-=r/2),e}function WT(i,n,e){let{y:r,height:t}=i;return n==="top"?r+=e:n==="bottom"?r-=t+e:r-=t/2,r}function tf(i,n,e,r){const{caretSize:t,caretPadding:o,cornerRadius:a}=i,{xAlign:s,yAlign:u}=e,c=t+o,{topLeft:M,topRight:d,bottomLeft:g,bottomRight:f}=Ni(a);let j=GT(n,s);const p=WT(n,u,c);return u==="center"?s==="left"?j+=c:s==="right"&&(j-=c):s==="left"?j-=Math.max(M,g)+t:s==="right"&&(j+=Math.max(d,f)+t),{x:gt(j,0,r.width-n.width),y:gt(p,0,r.height-n.height)}}function Da(i,n,e){const r=Ot(e.padding);return n==="center"?i.x+i.width/2:n==="right"?i.x+i.width-r.right:i.x+r.left}function nf(i){return rn([],hn(i))}function HT(i,n,e){return En(i,{tooltip:n,tooltipItems:e,type:"tooltip"})}function rf(i,n){const e=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return e?i.override(e):i}let Il=class extends jn{constructor(n){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=n.chart||n._chart,this._chart=this.chart,this.options=n.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(n){this.options=n,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const n=this._cachedAnimations;if(n)return n;const e=this.chart,r=this.options.setContext(this.getContext()),t=r.enabled&&e.options.animation&&r.animations,o=new lg(this.chart,t);return t._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=HT(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,e){const{callbacks:r}=e,t=r.beforeTitle.apply(this,[n]),o=r.title.apply(this,[n]),a=r.afterTitle.apply(this,[n]);let s=[];return s=rn(s,hn(t)),s=rn(s,hn(o)),s=rn(s,hn(a)),s}getBeforeBody(n,e){return nf(e.callbacks.beforeBody.apply(this,[n]))}getBody(n,e){const{callbacks:r}=e,t=[];return Ye(n,o=>{const a={before:[],lines:[],after:[]},s=rf(r,o);rn(a.before,hn(s.beforeLabel.call(this,o))),rn(a.lines,s.label.call(this,o)),rn(a.after,hn(s.afterLabel.call(this,o))),t.push(a)}),t}getAfterBody(n,e){return nf(e.callbacks.afterBody.apply(this,[n]))}getFooter(n,e){const{callbacks:r}=e,t=r.beforeFooter.apply(this,[n]),o=r.footer.apply(this,[n]),a=r.afterFooter.apply(this,[n]);let s=[];return s=rn(s,hn(t)),s=rn(s,hn(o)),s=rn(s,hn(a)),s}_createItems(n){const e=this._active,r=this.chart.data,t=[],o=[],a=[];let s=[],u,c;for(u=0,c=e.length;u<c;++u)s.push(PT(this.chart,e[u]));return n.filter&&(s=s.filter((M,d,g)=>n.filter(M,d,g,r))),n.itemSort&&(s=s.sort((M,d)=>n.itemSort(M,d,r))),Ye(s,M=>{const d=rf(n.callbacks,M);t.push(d.labelColor.call(this,M)),o.push(d.labelPointStyle.call(this,M)),a.push(d.labelTextColor.call(this,M))}),this.labelColors=t,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(n,e){const r=this.options.setContext(this.getContext()),t=this._active;let o,a=[];if(!t.length)this.opacity!==0&&(o={opacity:0});else{const s=tr[r.position].call(this,t,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const u=this._size=qg(this,r),c=Object.assign({},s,u),M=ef(this.chart,r,c),d=tf(r,c,M,this.chart);this.xAlign=M.xAlign,this.yAlign=M.yAlign,o={opacity:1,x:d.x,y:d.y,width:u.width,height:u.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),n&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(n,e,r,t){const o=this.getCaretPosition(n,r,t);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(n,e,r){const{xAlign:t,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:u,topRight:c,bottomLeft:M,bottomRight:d}=Ni(s),{x:g,y:f}=n,{width:j,height:p}=e;let x,N,h,z,m,I;return o==="center"?(m=f+p/2,t==="left"?(x=g,N=x-a,z=m+a,I=m-a):(x=g+j,N=x+a,z=m-a,I=m+a),h=x):(t==="left"?N=g+Math.max(u,M)+a:t==="right"?N=g+j-Math.max(c,d)-a:N=this.caretX,o==="top"?(z=f,m=z-a,x=N-a,h=N+a):(z=f+p,m=z+a,x=N+a,h=N-a),I=z),{x1:x,x2:N,x3:h,y1:z,y2:m,y3:I}}drawTitle(n,e,r){const t=this.title,o=t.length;let a,s,u;if(o){const c=Ku(r.rtl,this.x,this.width);for(n.x=Da(this,r.titleAlign,r),e.textAlign=c.textAlign(r.titleAlign),e.textBaseline="middle",a=xt(r.titleFont),s=r.titleSpacing,e.fillStyle=r.titleColor,e.font=a.string,u=0;u<o;++u)e.fillText(t[u],c.x(n.x),n.y+a.lineHeight/2),n.y+=a.lineHeight+s,u+1===o&&(n.y+=r.titleMarginBottom-s)}}_drawColorBox(n,e,r,t,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:u,boxWidth:c,boxPadding:M}=o,d=xt(o.bodyFont),g=Da(this,"left",o),f=t.x(g),j=u<d.lineHeight?(d.lineHeight-u)/2:0,p=e.y+j;if(o.usePointStyle){const x={radius:Math.min(c,u)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},N=t.leftForLtr(f,c)+c/2,h=p+u/2;n.strokeStyle=o.multiKeyBackground,n.fillStyle=o.multiKeyBackground,Gu(n,x,N,h),n.strokeStyle=a.borderColor,n.fillStyle=a.backgroundColor,Gu(n,x,N,h)}else{n.lineWidth=be(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,n.strokeStyle=a.borderColor,n.setLineDash(a.borderDash||[]),n.lineDashOffset=a.borderDashOffset||0;const x=t.leftForLtr(f,c-M),N=t.leftForLtr(t.xPlus(f,1),c-M-2),h=Ni(a.borderRadius);Object.values(h).some(z=>z!==0)?(n.beginPath(),n.fillStyle=o.multiKeyBackground,ra(n,{x,y:p,w:c,h:u,radius:h}),n.fill(),n.stroke(),n.fillStyle=a.backgroundColor,n.beginPath(),ra(n,{x:N,y:p+1,w:c-2,h:u-2,radius:h}),n.fill()):(n.fillStyle=o.multiKeyBackground,n.fillRect(x,p,c,u),n.strokeRect(x,p,c,u),n.fillStyle=a.backgroundColor,n.fillRect(N,p+1,c-2,u-2))}n.fillStyle=this.labelTextColors[r]}drawBody(n,e,r){const{body:t}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:u,boxWidth:c,boxPadding:M}=r,d=xt(r.bodyFont);let g=d.lineHeight,f=0;const j=Ku(r.rtl,this.x,this.width),p=function(L){e.fillText(L,j.x(n.x+f),n.y+g/2),n.y+=g+o},x=j.textAlign(a);let N,h,z,m,I,D,v;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,n.x=Da(this,x,r),e.fillStyle=r.bodyColor,Ye(this.beforeBody,p),f=s&&x!=="right"?a==="center"?c/2+M:c+2+M:0,m=0,D=t.length;m<D;++m){for(N=t[m],h=this.labelTextColors[m],e.fillStyle=h,Ye(N.before,p),z=N.lines,s&&z.length&&(this._drawColorBox(e,n,m,j,r),g=Math.max(d.lineHeight,u)),I=0,v=z.length;I<v;++I)p(z[I]),g=d.lineHeight;Ye(N.after,p)}f=0,g=d.lineHeight,Ye(this.afterBody,p),n.y-=o}drawFooter(n,e,r){const t=this.footer,o=t.length;let a,s;if(o){const u=Ku(r.rtl,this.x,this.width);for(n.x=Da(this,r.footerAlign,r),n.y+=r.footerMarginTop,e.textAlign=u.textAlign(r.footerAlign),e.textBaseline="middle",a=xt(r.footerFont),e.fillStyle=r.footerColor,e.font=a.string,s=0;s<o;++s)e.fillText(t[s],u.x(n.x),n.y+a.lineHeight/2),n.y+=a.lineHeight+r.footerSpacing}}drawBackground(n,e,r,t){const{xAlign:o,yAlign:a}=this,{x:s,y:u}=n,{width:c,height:M}=r,{topLeft:d,topRight:g,bottomLeft:f,bottomRight:j}=Ni(t.cornerRadius);e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,e.lineWidth=t.borderWidth,e.beginPath(),e.moveTo(s+d,u),a==="top"&&this.drawCaret(n,e,r,t),e.lineTo(s+c-g,u),e.quadraticCurveTo(s+c,u,s+c,u+g),a==="center"&&o==="right"&&this.drawCaret(n,e,r,t),e.lineTo(s+c,u+M-j),e.quadraticCurveTo(s+c,u+M,s+c-j,u+M),a==="bottom"&&this.drawCaret(n,e,r,t),e.lineTo(s+f,u+M),e.quadraticCurveTo(s,u+M,s,u+M-f),a==="center"&&o==="left"&&this.drawCaret(n,e,r,t),e.lineTo(s,u+d),e.quadraticCurveTo(s,u,s+d,u),e.closePath(),e.fill(),t.borderWidth>0&&e.stroke()}_updateAnimationTarget(n){const e=this.chart,r=this.$animations,t=r&&r.x,o=r&&r.y;if(t||o){const a=tr[n.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=qg(this,n),u=Object.assign({},a,this._size),c=ef(e,n,u),M=tf(n,u,c,e);(t._to!==M.x||o._to!==M.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,M))}}_willRender(){return!!this.opacity}draw(n){const e=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(e);const t={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=Ot(e.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&s&&(n.save(),n.globalAlpha=r,this.drawBackground(o,n,t,e),kx(n,e.textDirection),o.y+=a.top,this.drawTitle(o,n,e),this.drawBody(o,n,e),this.drawFooter(o,n,e),bx(n,e.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,e){const r=this._active,t=n.map(({datasetIndex:s,index:u})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[u],index:u}}),o=!Ho(r,t),a=this._positionChanged(t,e);(o||a)&&(this._active=t,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,e,r=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const t=this.options,o=this._active||[],a=this._getActiveElements(n,o,e,r),s=this._positionChanged(a,n),u=e||!Ho(a,o)||s;return u&&(this._active=a,(t.enabled||t.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,e))),u}_getActiveElements(n,e,r,t){const o=this.options;if(n.type==="mouseout")return[];if(!t)return e;const a=this.chart.getElementsAtEventForMode(n,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(n,e){const{caretX:r,caretY:t,options:o}=this,a=tr[o.position].call(this,n,e);return a!==!1&&(r!==a.x||t!==a.y)}};Il.positioners=tr;var FT={id:"tooltip",_element:Il,positioners:tr,afterInit(i,n,e){e&&(i.tooltip=new Il({chart:i,options:e}))},beforeUpdate(i,n,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,n,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const n=i.tooltip;if(n&&n._willRender()){const e={tooltip:n};if(i.notifyPlugins("beforeTooltipDraw",e)===!1)return;n.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,n){if(i.tooltip){const e=n.replay;i.tooltip.handleEvent(n.event,e,n.inChartArea)&&(n.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,n)=>n.bodyFont.size,boxWidth:(i,n)=>n.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:{beforeTitle:fn,title(i){if(i.length>0){const n=i[0],e=n.chart.data.labels,r=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(r>0&&n.dataIndex<r)return e[n.dataIndex]}return""},afterTitle:fn,beforeBody:fn,beforeLabel:fn,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let n=i.dataset.label||"";n&&(n+=": ");const e=i.formattedValue;return Se(e)||(n+=e),n},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:fn,afterBody:fn,beforeFooter:fn,footer:fn,afterFooter:fn}},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 $T=(i,n,e,r)=>(typeof n=="string"?(e=i.push(n)-1,r.unshift({index:e,label:n})):isNaN(n)&&(e=null),e);function JT(i,n,e,r){const t=i.indexOf(n);if(t===-1)return $T(i,n,e,r);const o=i.lastIndexOf(n);return t!==o?e:t}const XT=(i,n)=>i===null?null:gt(Math.round(i),0,n);class ma extends ti{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const e=this._addedLabels;if(e.length){const r=this.getLabels();for(const{index:t,label:o}of e)r[t]===o&&r.splice(t,1);this._addedLabels=[]}super.init(n)}parse(n,e){if(Se(n))return null;const r=this.getLabels();return e=isFinite(e)&&r[e]===n?e:JT(r,n,we(e,n),this._addedLabels),XT(e,r.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:e}=this.getUserBounds();let{min:r,max:t}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(r=0),e||(t=this.getLabels().length-1)),this.min=r,this.max=t}buildTicks(){const n=this.min,e=this.max,r=this.options.offset,t=[];let o=this.getLabels();o=n===0&&e===o.length-1?o:o.slice(n,e+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=n;a<=e;a++)t.push({value:a});return t}getLabelForValue(n){const e=this.getLabels();return n>=0&&n<e.length?e[n]:n}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(n){return typeof n!="number"&&(n=this.parse(n)),n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getPixelForTick(n){const e=this.ticks;return n<0||n>e.length-1?null:this.getPixelForValue(e[n].value)}getValueForPixel(n){return Math.round(this._startValue+this.getDecimalForPixel(n)*this._valueRange)}getBasePixel(){return this.bottom}}ma.id="category",ma.defaults={ticks:{callback:ma.prototype.getLabelForValue}};function KT(i,n){const e=[],{bounds:t,step:o,min:a,max:s,precision:u,count:c,maxTicks:M,maxDigits:d,includeBounds:g}=i,f=o||1,j=M-1,{min:p,max:x}=n,N=!Se(a),h=!Se(s),z=!Se(c),m=(x-p)/(d+1);let I=hd((x-p)/j/f)*f,D,v,L,w;if(I<1e-14&&!N&&!h)return[{value:p},{value:x}];w=Math.ceil(x/I)-Math.floor(p/I),w>j&&(I=hd(w*I/j/f)*f),Se(u)||(D=Math.pow(10,u),I=Math.ceil(I*D)/D),t==="ticks"?(v=Math.floor(p/I)*I,L=Math.ceil(x/I)*I):(v=p,L=x),N&&h&&o&&dz((s-a)/o,I/1e3)?(w=Math.round(Math.min((s-a)/I,M)),I=(s-a)/w,v=a,L=s):z?(v=N?a:v,L=h?s:L,w=c-1,I=(L-v)/w):(w=(L-v)/I,Yi(w,Math.round(w),I/1e3)?w=Math.round(w):w=Math.ceil(w));const E=Math.max(pd(I),pd(v));D=Math.pow(10,Se(u)?E:u),v=Math.round(v*D)/D,L=Math.round(L*D)/D;let T=0;for(N&&(g&&v!==a?(e.push({value:a}),v<a&&T++,Yi(Math.round((v+T*I)*D)/D,a,of(a,m,i))&&T++):v<a&&T++);T<w;++T)e.push({value:Math.round((v+T*I)*D)/D});return h&&g&&L!==s?e.length&&Yi(e[e.length-1].value,s,of(s,m,i))?e[e.length-1].value=s:e.push({value:s}):(!h||L===s)&&e.push({value:L}),e}function of(i,n,{horizontal:e,minRotation:r}){const t=Rt(r),o=(e?Math.sin(t):Math.cos(t))||.001,a=.75*n*(""+i).length;return Math.min(n/o,a)}class za extends ti{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(n,e){return Se(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:e,maxDefined:r}=this.getUserBounds();let{min:t,max:o}=this;const a=u=>t=e?t:u,s=u=>o=r?o:u;if(n){const u=tn(t),c=tn(o);u<0&&c<0?s(0):u>0&&c>0&&a(0)}if(t===o){let u=1;(o>=Number.MAX_SAFE_INTEGER||t<=Number.MIN_SAFE_INTEGER)&&(u=Math.abs(o*.05)),s(o+u),n||a(t-u)}this.min=t,this.max=o}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:e,stepSize:r}=n,t;return r?(t=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,t>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${t} ticks. Limiting to 1000.`),t=1e3)):(t=this.computeTickLimit(),e=e||11),e&&(t=Math.min(e,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,e=n.ticks;let r=this.getTickLimit();r=Math.max(2,r);const t={maxTicks:r,bounds:n.bounds,min:n.min,max:n.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=KT(t,o);return n.bounds==="ticks"&&Id(a,this,"value"),n.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const n=this.ticks;let e=this.min,r=this.max;if(super.configure(),this.options.offset&&n.length){const t=(r-e)/Math.max(n.length-1,1)/2;e-=t,r+=t}this._startValue=e,this._endValue=r,this._valueRange=r-e}getLabelForValue(n){return Vi(n,this.chart.options.locale,this.options.ticks.format)}}class pl extends za{determineDataLimits(){const{min:n,max:e}=this.getMinMax(!0);this.min=ct(n)?n:0,this.max=ct(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),e=n?this.width:this.height,r=Rt(this.options.ticks.minRotation),t=(n?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/t))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}pl.id="linear",pl.defaults={ticks:{callback:ca.formatters.numeric}};function af(i){return i/Math.pow(10,Math.floor(bt(i)))===1}function qT(i,n){const e=Math.floor(bt(n.max)),r=Math.ceil(n.max/Math.pow(10,e)),t=[];let o=vt(i.min,Math.pow(10,Math.floor(bt(n.min)))),a=Math.floor(bt(o)),s=Math.floor(o/Math.pow(10,a)),u=a<0?Math.pow(10,Math.abs(a)):1;do t.push({value:o,major:af(o)}),++s,s===10&&(s=1,++a,u=a>=0?1:u),o=Math.round(s*Math.pow(10,a)*u)/u;while(a<e||a===e&&s<r);const c=vt(i.max,o);return t.push({value:c,major:af(o)}),t}class sf extends ti{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(n,e){const r=za.prototype.parse.apply(this,[n,e]);if(r===0){this._zero=!0;return}return ct(r)&&r>0?r:null}determineDataLimits(){const{min:n,max:e}=this.getMinMax(!0);this.min=ct(n)?Math.max(0,n):null,this.max=ct(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:n,maxDefined:e}=this.getUserBounds();let r=this.min,t=this.max;const o=u=>r=n?r:u,a=u=>t=e?t:u,s=(u,c)=>Math.pow(10,Math.floor(bt(u))+c);r===t&&(r<=0?(o(1),a(10)):(o(s(r,-1)),a(s(t,1)))),r<=0&&o(s(t,-1)),t<=0&&a(s(r,1)),this._zero&&this.min!==this._suggestedMin&&r===s(this.min,0)&&o(s(r,-1)),this.min=r,this.max=t}buildTicks(){const n=this.options,e={min:this._userMin,max:this._userMax},r=qT(e,this);return n.bounds==="ticks"&&Id(r,this,"value"),n.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(n){return n===void 0?"0":Vi(n,this.chart.options.locale,this.options.ticks.format)}configure(){const n=this.min;super.configure(),this._startValue=bt(n),this._valueRange=bt(this.max)-bt(n)}getPixelForValue(n){return(n===void 0||n===0)&&(n=this.min),n===null||isNaN(n)?NaN:this.getPixelForDecimal(n===this.min?0:(bt(n)-this._startValue)/this._valueRange)}getValueForPixel(n){const e=this.getDecimalForPixel(n);return Math.pow(10,this._startValue+e*this._valueRange)}}sf.id="logarithmic",sf.defaults={ticks:{callback:ca.formatters.logarithmic,major:{enabled:!0}}};function Dl(i){const n=i.ticks;if(n.display&&i.display){const e=Ot(n.backdropPadding);return we(n.font&&n.font.size,ke.font.size)+e.height}return 0}function eL(i,n,e){return e=Ge(e)?e:[e],{w:Vz(i,n.string,e),h:e.length*n.lineHeight}}function uf(i,n,e,r,t){return i===r||i===t?{start:n-e/2,end:n+e/2}:i<r||i>t?{start:n-e,end:n}:{start:n,end:n+e}}function tL(i){const n={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},n),r=[],t=[],o=i._pointLabels.length,a=i.options.pointLabels,s=a.centerPointLabels?qe/o:0;for(let u=0;u<o;u++){const c=a.setContext(i.getPointLabelContext(u));t[u]=c.padding;const M=i.getPointPosition(u,i.drawingArea+t[u],s),d=xt(c.font),g=eL(i.ctx,d,i._pointLabels[u]);r[u]=g;const f=Zt(i.getIndexAngle(u)+s),j=Math.round(Cu(f)),p=uf(j,M.x,g.w,0,180),x=uf(j,M.y,g.h,90,270);nL(e,n,f,p,x)}i.setCenterPoint(n.l-e.l,e.r-n.r,n.t-e.t,e.b-n.b),i._pointLabelItems=iL(i,r,t)}function nL(i,n,e,r,t){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let s=0,u=0;r.start<n.l?(s=(n.l-r.start)/o,i.l=Math.min(i.l,n.l-s)):r.end>n.r&&(s=(r.end-n.r)/o,i.r=Math.max(i.r,n.r+s)),t.start<n.t?(u=(n.t-t.start)/a,i.t=Math.min(i.t,n.t-u)):t.end>n.b&&(u=(t.end-n.b)/a,i.b=Math.max(i.b,n.b+u))}function iL(i,n,e){const r=[],t=i._pointLabels.length,o=i.options,a=Dl(o)/2,s=i.drawingArea,u=o.pointLabels.centerPointLabels?qe/t:0;for(let c=0;c<t;c++){const M=i.getPointPosition(c,s+a+e[c],u),d=Math.round(Cu(Zt(M.angle+et))),g=n[c],f=aL(M.y,g.h,d),j=rL(d),p=oL(M.x,g.w,j);r.push({x:M.x,y:f,textAlign:j,left:p,top:f,right:p+g.w,bottom:f+g.h})}return r}function rL(i){return i===0||i===180?"center":i<180?"left":"right"}function oL(i,n,e){return e==="right"?i-=n:e==="center"&&(i-=n/2),i}function aL(i,n,e){return e===90||e===270?i-=n/2:(e>270||e<90)&&(i-=n),i}function sL(i,n){const{ctx:e,options:{pointLabels:r}}=i;for(let t=n-1;t>=0;t--){const o=r.setContext(i.getPointLabelContext(t)),a=xt(o.font),{x:s,y:u,textAlign:c,left:M,top:d,right:g,bottom:f}=i._pointLabelItems[t],{backdropColor:j}=o;if(!Se(j)){const p=Ni(o.borderRadius),x=Ot(o.backdropPadding);e.fillStyle=j;const N=M-x.left,h=d-x.top,z=g-M+x.width,m=f-d+x.height;Object.values(p).some(I=>I!==0)?(e.beginPath(),ra(e,{x:N,y:h,w:z,h:m,radius:p}),e.fill()):e.fillRect(N,h,z,m)}ia(e,i._pointLabels[t],s,u+a.lineHeight/2,a,{color:o.color,textAlign:c,textBaseline:"middle"})}}function lf(i,n,e,r){const{ctx:t}=i;if(e)t.arc(i.xCenter,i.yCenter,n,0,Pe);else{let o=i.getPointPosition(0,n);t.moveTo(o.x,o.y);for(let a=1;a<r;a++)o=i.getPointPosition(a,n),t.lineTo(o.x,o.y)}}function uL(i,n,e,r){const t=i.ctx,o=n.circular,{color:a,lineWidth:s}=n;!o&&!r||!a||!s||e<0||(t.save(),t.strokeStyle=a,t.lineWidth=s,t.setLineDash(n.borderDash),t.lineDashOffset=n.borderDashOffset,t.beginPath(),lf(i,e,o,r),t.closePath(),t.stroke(),t.restore())}function lL(i,n,e){return En(i,{label:e,index:n,type:"pointLabel"})}class xa extends za{constructor(n){super(n),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const n=this._padding=Ot(Dl(this.options)/2),e=this.width=this.maxWidth-n.width,r=this.height=this.maxHeight-n.height;this.xCenter=Math.floor(this.left+e/2+n.left),this.yCenter=Math.floor(this.top+r/2+n.top),this.drawingArea=Math.floor(Math.min(e,r)/2)}determineDataLimits(){const{min:n,max:e}=this.getMinMax(!1);this.min=ct(n)&&!isNaN(n)?n:0,this.max=ct(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Dl(this.options))}generateTickLabels(n){za.prototype.generateTickLabels.call(this,n),this._pointLabels=this.getLabels().map((e,r)=>{const t=Ke(this.options.pointLabels.callback,[e,r],this);return t||t===0?t:""}).filter((e,r)=>this.chart.getDataVisibility(r))}fit(){const n=this.options;n.display&&n.pointLabels.display?tL(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(n,e,r,t){this.xCenter+=Math.floor((n-e)/2),this.yCenter+=Math.floor((r-t)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(n,e,r,t))}getIndexAngle(n){const e=Pe/(this._pointLabels.length||1),r=this.options.startAngle||0;return Zt(n*e+Rt(r))}getDistanceFromCenterForValue(n){if(Se(n))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-n)*e:(n-this.min)*e}getValueForDistanceFromCenter(n){if(Se(n))return NaN;const e=n/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(n){const e=this._pointLabels||[];if(n>=0&&n<e.length){const r=e[n];return lL(this.getContext(),n,r)}}getPointPosition(n,e,r=0){const t=this.getIndexAngle(n)-et+r;return{x:Math.cos(t)*e+this.xCenter,y:Math.sin(t)*e+this.yCenter,angle:t}}getPointPositionForValue(n,e){return this.getPointPosition(n,this.getDistanceFromCenterForValue(e))}getBasePosition(n){return this.getPointPositionForValue(n||0,this.getBaseValue())}getPointLabelPosition(n){const{left:e,top:r,right:t,bottom:o}=this._pointLabelItems[n];return{left:e,top:r,right:t,bottom:o}}drawBackground(){const{backgroundColor:n,grid:{circular:e}}=this.options;if(n){const r=this.ctx;r.save(),r.beginPath(),lf(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),r.closePath(),r.fillStyle=n,r.fill(),r.restore()}}drawGrid(){const n=this.ctx,e=this.options,{angleLines:r,grid:t}=e,o=this._pointLabels.length;let a,s,u;if(e.pointLabels.display&&sL(this,o),t.display&&this.ticks.forEach((c,M)=>{if(M!==0){s=this.getDistanceFromCenterForValue(c.value);const d=t.setContext(this.getContext(M-1));uL(this,d,s,o)}}),r.display){for(n.save(),a=o-1;a>=0;a--){const c=r.setContext(this.getPointLabelContext(a)),{color:M,lineWidth:d}=c;!d||!M||(n.lineWidth=d,n.strokeStyle=M,n.setLineDash(c.borderDash),n.lineDashOffset=c.borderDashOffset,s=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),u=this.getPointPosition(a,s),n.beginPath(),n.moveTo(this.xCenter,this.yCenter),n.lineTo(u.x,u.y),n.stroke())}n.restore()}}drawBorder(){}drawLabels(){const n=this.ctx,e=this.options,r=e.ticks;if(!r.display)return;const t=this.getIndexAngle(0);let o,a;n.save(),n.translate(this.xCenter,this.yCenter),n.rotate(t),n.textAlign="center",n.textBaseline="middle",this.ticks.forEach((s,u)=>{if(u===0&&!e.reverse)return;const c=r.setContext(this.getContext(u)),M=xt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[u].value),c.showLabelBackdrop){n.font=M.string,a=n.measureText(s.label).width,n.fillStyle=c.backdropColor;const d=Ot(c.backdropPadding);n.fillRect(-a/2-d.left,-o-M.size/2-d.top,a+d.width,M.size+d.height)}ia(n,s.label,0,-o,M,{color:c.color})}),n.restore()}drawTitle(){}}xa.id="radialLinear",xa.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ca.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}},xa.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},xa.descriptors={angleLines:{_fallback:"grid"}};const Aa={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}},Dt=Object.keys(Aa);function cL(i,n){return i-n}function cf(i,n){if(Se(n))return null;const e=i._adapter,{parser:r,round:t,isoWeekday:o}=i._parseOpts;let a=n;return typeof r=="function"&&(a=r(a)),ct(a)||(a=typeof r=="string"?e.parse(a,r):e.parse(a)),a===null?null:(t&&(a=t==="week"&&(fi(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,t)),+a)}function Mf(i,n,e,r){const t=Dt.length;for(let o=Dt.indexOf(i);o<t-1;++o){const a=Aa[Dt[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-n)/(s*a.size))<=r)return Dt[o]}return Dt[t-1]}function ML(i,n,e,r,t){for(let o=Dt.length-1;o>=Dt.indexOf(e);o--){const a=Dt[o];if(Aa[a].common&&i._adapter.diff(t,r,a)>=n-1)return a}return Dt[e?Dt.indexOf(e):0]}function dL(i){for(let n=Dt.indexOf(i)+1,e=Dt.length;n<e;++n)if(Aa[Dt[n]].common)return Dt[n]}function df(i,n,e){if(!e)i[n]=!0;else if(e.length){const{lo:r,hi:t}=Qu(e,n),o=e[r]>=n?e[r]:e[t];i[o]=!0}}function gL(i,n,e,r){const t=i._adapter,o=+t.startOf(n[0].value,r),a=n[n.length-1].value;let s,u;for(s=o;s<=a;s=+t.add(s,1,r))u=e[s],u>=0&&(n[u].major=!0);return n}function gf(i,n,e){const r=[],t={},o=n.length;let a,s;for(a=0;a<o;++a)s=n[a],t[s]=a,r.push({value:s,major:!1});return o===0||!e?r:gL(i,r,t,e)}class Ta extends ti{constructor(n){super(n),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(n,e){const r=n.time||(n.time={}),t=this._adapter=new wA._date(n.adapters.date);t.init(e),Si(r.displayFormats,t.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(n),this._normalized=e.normalized}parse(n,e){return n===void 0?null:cf(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,e=this._adapter,r=n.time.unit||"day";let{min:t,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function u(c){!a&&!isNaN(c.min)&&(t=Math.min(t,c.min)),!s&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!s)&&(u(this._getLabelBounds()),(n.bounds!=="ticks"||n.ticks.source!=="labels")&&u(this.getMinMax(!1))),t=ct(t)&&!isNaN(t)?t:+e.startOf(Date.now(),r),o=ct(o)&&!isNaN(o)?o:+e.endOf(Date.now(),r)+1,this.min=Math.min(t,o-1),this.max=Math.max(t+1,o)}_getLabelBounds(){const n=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return n.length&&(e=n[0],r=n[n.length-1]),{min:e,max:r}}buildTicks(){const n=this.options,e=n.time,r=n.ticks,t=r.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&t.length&&(this.min=this._userMin||t[0],this.max=this._userMax||t[t.length-1]);const o=this.min,a=this.max,s=Nz(t,o,a);return this._unit=e.unit||(r.autoSkip?Mf(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):ML(this,s.length,e.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:dL(this._unit),this.initOffsets(t),n.reverse&&s.reverse(),gf(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n){let e=0,r=0,t,o;this.options.offset&&n.length&&(t=this.getDecimalForValue(n[0]),n.length===1?e=1-t:e=(this.getDecimalForValue(n[1])-t)/2,o=this.getDecimalForValue(n[n.length-1]),n.length===1?r=o:r=(o-this.getDecimalForValue(n[n.length-2]))/2);const a=n.length<3?.5:.25;e=gt(e,0,a),r=gt(r,0,a),this._offsets={start:e,end:r,factor:1/(e+1+r)}}_generate(){const n=this._adapter,e=this.min,r=this.max,t=this.options,o=t.time,a=o.unit||Mf(o.minUnit,e,r,this._getLabelCapacity(e)),s=we(o.stepSize,1),u=a==="week"?o.isoWeekday:!1,c=fi(u)||u===!0,M={};let d=e,g,f;if(c&&(d=+n.startOf(d,"isoWeek",u)),d=+n.startOf(d,c?"day":a),n.diff(r,e,a)>1e5*s)throw new Error(e+" and "+r+" are too far apart with stepSize of "+s+" "+a);const j=t.ticks.source==="data"&&this.getDataTimestamps();for(g=d,f=0;g<r;g=+n.add(g,s,a),f++)df(M,g,j);return(g===r||t.bounds==="ticks"||f===1)&&df(M,g,j),Object.keys(M).sort((p,x)=>p-x).map(p=>+p)}getLabelForValue(n){const e=this._adapter,r=this.options.time;return r.tooltipFormat?e.format(n,r.tooltipFormat):e.format(n,r.displayFormats.datetime)}_tickFormatFunction(n,e,r,t){const o=this.options,a=o.time.displayFormats,s=this._unit,u=this._majorUnit,c=s&&a[s],M=u&&a[u],d=r[e],g=u&&M&&d&&d.major,f=this._adapter.format(n,t||(g?M:c)),j=o.ticks.callback;return j?Ke(j,[f,e,r],this):f}generateTickLabels(n){let e,r,t;for(e=0,r=n.length;e<r;++e)t=n[e],t.label=this._tickFormatFunction(t.value,e,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const e=this._offsets,r=this.getDecimalForValue(n);return this.getPixelForDecimal((e.start+r)*e.factor)}getValueForPixel(n){const e=this._offsets,r=this.getDecimalForPixel(n)/e.factor-e.end;return this.min+r*(this.max-this.min)}_getLabelSize(n){const e=this.options.ticks,r=this.ctx.measureText(n).width,t=Rt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(t),a=Math.sin(t),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(n){const e=this.options.time,r=e.displayFormats,t=r[e.unit]||r.millisecond,o=this._tickFormatFunction(n,0,gf(this,[n],this._majorUnit),t),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let n=this._cache.data||[],e,r;if(n.length)return n;const t=this.getMatchingVisibleMetas();if(this._normalized&&t.length)return this._cache.data=t[0].controller.getAllParsedValues(this);for(e=0,r=t.length;e<r;++e)n=n.concat(t[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let e,r;if(n.length)return n;const t=this.getLabels();for(e=0,r=t.length;e<r;++e)n.push(cf(this,t[e]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return xd(n.sort(cL))}}Ta.id="time",Ta.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function La(i,n,e){let r=0,t=i.length-1,o,a,s,u;e?(n>=i[r].pos&&n<=i[t].pos&&({lo:r,hi:t}=$n(i,"pos",n)),{pos:o,time:s}=i[r],{pos:a,time:u}=i[t]):(n>=i[r].time&&n<=i[t].time&&({lo:r,hi:t}=$n(i,"time",n)),{time:o,pos:s}=i[r],{time:a,pos:u}=i[t]);const c=a-o;return c?s+(u-s)*(n-o)/c:s}class ff extends Ta{constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const n=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(n);this._minPos=La(e,this.min),this._tableRange=La(e,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:e,max:r}=this,t=[],o=[];let a,s,u,c,M;for(a=0,s=n.length;a<s;++a)c=n[a],c>=e&&c<=r&&t.push(c);if(t.length<2)return[{time:e,pos:0},{time:r,pos:1}];for(a=0,s=t.length;a<s;++a)M=t[a+1],u=t[a-1],c=t[a],Math.round((M+u)/2)!==c&&o.push({time:c,pos:a/(s-1)});return o}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const e=this.getDataTimestamps(),r=this.getLabelTimestamps();return e.length&&r.length?n=this.normalize(e.concat(r)):n=e.length?e:r,n=this._cache.all=n,n}getDecimalForValue(n){return(La(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const e=this._offsets,r=this.getDecimalForPixel(n)/e.factor-e.end;return La(this._table,r*this._tableRange+this._minPos,!0)}}ff.id="timeseries",ff.defaults=Ta.defaults;var pi;(function(i){i.ChartRendered="chart:rendered",i.ChartUpdated="chart:updated",i.ChartDestroyed="chart:destroyed",i.LabelsUpdated="labels:updated"})(pi||(pi={}));function va(i,n,e,r){i(n,e),r!==void 0&&r.emit(pi.ChartRendered)}function fL(i,n){i.update(),n!==void 0&&n.emit(pi.ChartUpdated)}function ka(i,n){i.destroy(),n!==void 0&&n.emit(pi.ChartDestroyed)}function yL(i,n){const e={labels:typeof i.labels>"u"?[]:[...i.labels],datasets:[]};return yf(e,{...i},n),e}function yf(i,n,e){const r=[];i.datasets=n.datasets.map(t=>{const o=i.datasets.find(a=>a[e]===t[e]);return!o||!t.data||r.includes(o)?{...t}:(r.push(o),Object.assign(o,t),o)})}function NL(i,n,e){i.data.labels=n,e!==void 0&&e.emit(pi.LabelsUpdated)}function jL(i,n){i.options={...n}}function hL(i,n){const e=i.datasets.map(t=>t.label),r=n.datasets.map(t=>t.label);return n.datasets.length===i.datasets.length&&e.every((t,o)=>t===r[o])}const IL="Please remove the <template></template> tags from your chart component. See https://vue-chartjs.org/guide/#vue-single-file-components",pL="Update ERROR: chart instance not found",DL=((i,n,e)=>l.defineComponent({props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,default:()=>{}},datasetIdKey:{type:String,default:"label"},chartId:{type:String,default:i},width:{type:Number,default:400},height:{type:Number,default:400},cssClasses:{type:String,default:""},styles:{type:Object,default:()=>{}},plugins:{type:Array,default:()=>[]}},setup(r,t){er.register(e);const o=l.shallowRef(null),a=l.ref(null);function s(d,g){if(o.value!==null&&ka(l.toRaw(o.value),t),a.value===null)throw new Error(IL);{const f=yL(d,r.datasetIdKey),j=a.value.getContext("2d");j!==null&&(o.value=new er(j,{type:n,data:l.isProxy(d)?new Proxy(f,{}):f,options:g,plugins:r.plugins}))}}function u(d,g){const f=l.isProxy(d)?l.toRaw(d):{...d},j=l.isProxy(g)?l.toRaw(g):{...g};if(Object.keys(j).length>0){const p=l.toRaw(o.value);hL(f,j)&&p!==null?(yf(p==null?void 0:p.data,f,r.datasetIdKey),f.labels!==void 0&&NL(p,f.labels,t),M()):(p!==null&&ka(p,t),va(s,r.chartData,r.chartOptions,t))}else o.value!==null&&ka(l.toRaw(o.value),t),va(s,r.chartData,r.chartOptions,t)}function c(d){const g=l.toRaw(o.value);g!==null?(jL(g,d),M()):va(s,r.chartData,r.chartOptions,t)}function M(){const d=l.toRaw(o.value);d!==null?fL(d,t):console.error(pL)}return l.watch(()=>r.chartData,(d,g)=>u(d,g),{deep:!0}),l.watch(()=>r.chartOptions,d=>c(d),{deep:!0}),l.onMounted(()=>{"datasets"in r.chartData&&r.chartData.datasets.length>0&&va(s,r.chartData,r.chartOptions,t)}),l.onBeforeUnmount(()=>{o.value!==null&&ka(l.toRaw(o.value),t)}),t.expose({chart:o,updateChart:M}),()=>l.h("div",{style:r.styles,class:r.cssClasses},[l.h("canvas",{id:r.chartId,width:r.width,height:r.height,ref:a})])}}))("bar-chart","bar",la),Vw="",mL={name:"MultiRangeSlider",props:{baseClassName:{type:String,default:"multi-range-slider"},min:{type:Number},max:{type:Number},minValue:{type:Number},maxValue:{type:Number},step:{type:Number,default:1},preventWheel:{type:Boolean,default:!1},ruler:{type:Boolean,default:!0},label:{type:Boolean,default:!0},labels:{type:Array},minCaption:{type:String},maxCaption:{type:String},rangeMargin:{type:Number}},data(){let i=this.labels||[],n=this.min===void 0?0:this.min,e=i.length?i.length-1:100,r=this.max===void 0?e:this.max,t=this.minValue===void 0?25:this.minValue;i.length&&this.minValue===void 0&&(t=1);let o=this.maxValue||75;if(i.length&&this.maxValue===void 0&&(o=i.length-2),r<=n)throw new Error("Invalid props min or max");if(t>o)throw new Error("Invalid props minValue or maxValue");let a=this.rangeMargin===void 0?this.step:this.rangeMargin,s=a%this.step;return s&&(a=a+this.step-s),{valueMin:t<n?n:t,valueMax:o>r?r:o,interVal:null,startX:null,mouseMoveCounter:null,barBox:null,barValue:0,rangeMarginValue:a}},methods:{onBarLeftClick(){this.valueMin-this.step>=this.minimum?this.valueMin-=this.step:this.valueMin=this.minimum},onInnerBarLeftClick(){this.valueMin+this.rangeMarginValue<this.valueMax&&(this.valueMin+=this.step)},onBarRightClick(){this.valueMax+this.step<=this.maximum?this.valueMax+=this.step:this.valueMax=this.maximum},onInnerBarRightClick(){this.valueMax-this.rangeMarginValue>this.valueMin&&(this.valueMax-=this.step)},onInputMinChange(i){let n=parseFloat(i.target.value);n<=this.valueMax-this.rangeMarginValue&&n>=this.minimum?this.valueMin=n:i.target.value=this.valueMin},onInputMaxChange(i){let n=parseFloat(i.target.value);n>=this.valueMin+this.rangeMarginValue&&n<=this.maximum?this.valueMax=n:i.target.value=this.valueMax},onLeftThumbMousedown(i){if(i.preventDefault(),this.startX=i.clientX,i.type==="touchstart")if(i.touches.length===1)this.startX=i.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMin,this.barBox=i.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onLeftThumbMousemove),document.addEventListener("mouseup",this.onLeftThumbMouseup),document.addEventListener("touchmove",this.onLeftThumbMousemove),document.addEventListener("touchend",this.onLeftThumbMouseup)},onLeftThumbMousemove(i){this.mouseMoveCounter++;let n=i.clientX;i.type==="touchmove"&&(n=i.touches[0].clientX);let r=(n-this.startX)/this.barBox.width,t=this.barValue+(this.maximum-this.minimum)*r,o=t%this.step;t-=o,t<this.minimum?t=this.minimum:t>this.valueMax-this.rangeMarginValue&&(t=this.valueMax-this.rangeMarginValue),this.valueMin=t},onLeftThumbMouseup(){document.removeEventListener("mousemove",this.onLeftThumbMousemove),document.removeEventListener("mouseup",this.onLeftThumbMouseup),document.removeEventListener("touchmove",this.onLeftThumbMousemove),document.removeEventListener("touchend",this.onLeftThumbMouseup)},onRightThumbMousedown(i){if(i.preventDefault(),this.startX=i.clientX,i.type==="touchstart")if(i.touches.length===1)this.startX=i.touches[0].clientX;else return;this.mouseMoveCounter=0,this.barValue=this.valueMax,this.barBox=i.target.parentNode.getBoundingClientRect(),document.addEventListener("mousemove",this.onRightThumbMousemove),document.addEventListener("mouseup",this.onRightThumbMouseup),document.addEventListener("touchmove",this.onRightThumbMousemove),document.addEventListener("touchend",this.onRightThumbMouseup)},onRightThumbMousemove(i){this.mouseMoveCounter++;let n=i.clientX;i.type==="touchmove"&&(n=i.touches[0].clientX);let r=(n-this.startX)/this.barBox.width,t=this.barValue+(this.maximum-this.minimum)*r,o=t%this.step;t-=o,t<this.valueMin+this.rangeMarginValue?t=this.valueMin+this.rangeMarginValue:t>this.maximum&&(t=this.maximum),this.valueMax=t},onRightThumbMouseup(){document.removeEventListener("mousemove",this.onRightThumbMousemove),document.removeEventListener("mouseup",this.onRightThumbMouseup),document.removeEventListener("touchmove",this.onRightThumbMousemove),document.removeEventListener("touchend",this.onRightThumbMouseup)},onMouseWheel(i){if(this.preventWheel===!0||!i.shiftKey&&!i.ctrlKey)return;let n=this.step;i.deltaY<0&&(n=-n),i.shiftKey&&i.ctrlKey?this.valueMin+n>=this.minimum&&this.valueMax+n<=this.maximum&&(this.valueMin=this.valueMin+n,this.valueMax=this.valueMax+n):i.ctrlKey?(n=this.valueMax+n,n<this.valueMin+this.rangeMarginValue?n=this.valueMin+this.rangeMarginValue:n>this.maximum&&(n=this.maximum),this.valueMax=n):i.shiftKey&&(n=this.valueMin+n,n<this.minimum?n=this.minimum:n>this.valueMax-this.rangeMarginValue&&(n=this.valueMax-this.rangeMarginValue),this.valueMin=n)},triggerInput(){let i=0;this.step.toString().includes(".")&&(i=2);let n={min:this.minimum,max:this.maximum,minValue:parseFloat(this.valueMin.toFixed(i)),maxValue:parseFloat(this.valueMax.toFixed(i))};this.$emit("input",n)}},computed:{minimum(){return this.min===void 0?0:this.min},maximum(){let i=this.labels||[],n=i.length?i.length-1:100;return this.max===void 0?n:this.max},stepCount(){let i=this.labels||[];return i.length?i.length-1:Math.floor((this.maximum-this.minimum)/this.step)},subStepCount(){return(this.labels||[]).length&&this.step>1?(this.maximum-this.minimum)/this.step:0},barMin(){return(this.valueMin-this.minimum)/(this.maximum-this.minimum)*100},barMax(){return 100-(this.valueMax-this.minimum)/(this.maximum-this.minimum)*100},barMinVal(){let i=0;return this.step.toString().includes(".")&&(i=2),(this.valueMin||0).toFixed(i)},barMaxVal(){let i=0;return this.step.toString().includes(".")&&(i=2),(this.valueMax||100).toFixed(i)},scaleLabels(){let i=this.labels||[];return i.length===0&&(i=[],i.push(this.minimum),i.push(this.maximum)),i}},watch:{valueMin(){this.triggerInput()},valueMax(){this.triggerInput()},minValue(i){this.valueMin=i<this.minimum?this.minimum:i},maxValue(i){this.valueMax=i>this.maximum?this.maximum:i}},mounted(){}},zL={class:"bar"},xL=["min","max","step","value"],AL={class:"caption"},TL={class:"min-caption"},LL={class:"bar-inner"},vL=["min","max","step","value"],kL={class:"caption"},bL={class:"max-caption"},wL={key:0,class:"ruler"},OL={key:1,class:"sub-ruler"},EL={key:2,class:"labels"};function CL(i,n,e,r,t,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass([e.baseClassName,t.rangeMarginValue===0?"zero-ranage-margin":""]),onMousewheel:n[10]||(n[10]=l.withModifiers((...a)=>o.onMouseWheel&&o.onMouseWheel(...a),["prevent","stop"]))},[l.createElementVNode("div",zL,[l.createElementVNode("div",{class:"bar-left",style:l.normalizeStyle({width:o.barMin+"%"}),onClick:n[0]||(n[0]=(...a)=>o.onBarLeftClick&&o.onBarLeftClick(...a))},null,4),l.createElementVNode("input",{class:"input-type-range input-type-range-min",type:"range",min:o.minimum,max:o.maximum,step:e.step,value:t.valueMin,onInput:n[1]||(n[1]=l.withModifiers((...a)=>o.onInputMinChange&&o.onInputMinChange(...a),["stop","prevent"]))},null,40,xL),l.createElementVNode("div",{class:"thumb thumb-left",onMousedown:n[2]||(n[2]=(...a)=>o.onLeftThumbMousedown&&o.onLeftThumbMousedown(...a)),onTouchstart:n[3]||(n[3]=(...a)=>o.onLeftThumbMousedown&&o.onLeftThumbMousedown(...a))},[l.createElementVNode("div",AL,[l.createElementVNode("span",TL,l.toDisplayString(e.minCaption||o.barMinVal),1)])],32),l.createElementVNode("div",LL,[l.createElementVNode("div",{class:"bar-inner-left",onClick:n[4]||(n[4]=(...a)=>o.onInnerBarLeftClick&&o.onInnerBarLeftClick(...a))}),l.createElementVNode("div",{class:"bar-inner-right",onClick:n[5]||(n[5]=(...a)=>o.onInnerBarRightClick&&o.onInnerBarRightClick(...a))})]),l.createElementVNode("input",{class:"input-type-range input-type-range-max",type:"range",min:o.minimum,max:o.maximum,step:e.step,value:t.valueMax,onInput:n[6]||(n[6]=l.withModifiers((...a)=>o.onInputMaxChange&&o.onInputMaxChange(...a),["stop","prevent"]))},null,40,vL),l.createElementVNode("div",{class:"thumb thumb-right",onMousedown:n[7]||(n[7]=(...a)=>o.onRightThumbMousedown&&o.onRightThumbMousedown(...a)),onTouchstart:n[8]||(n[8]=(...a)=>o.onRightThumbMousedown&&o.onRightThumbMousedown(...a))},[l.createElementVNode("div",kL,[l.createElementVNode("span",bL,l.toDisplayString(e.maxCaption||o.barMaxVal),1)])],32),l.createElementVNode("div",{class:"bar-right",style:l.normalizeStyle({width:o.barMax+"%"}),onClick:n[9]||(n[9]=(...a)=>o.onBarRightClick&&o.onBarRightClick(...a))},null,4)]),e.ruler?(l.openBlock(),l.createElementBlock("div",wL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.stepCount,a=>(l.openBlock(),l.createElementBlock("div",{key:a,class:"ruler-rule"}))),128))])):l.createCommentVNode("",!0),o.subStepCount?(l.openBlock(),l.createElementBlock("div",OL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.subStepCount,a=>(l.openBlock(),l.createElementBlock("div",{key:a,class:"ruler-sub-rule"}))),128))])):l.createCommentVNode("",!0),e.label?(l.openBlock(),l.createElementBlock("div",EL,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.scaleLabels,a=>(l.openBlock(),l.createElementBlock("div",{class:"label",key:a},l.toDisplayString(a),1))),128))])):l.createCommentVNode("",!0)],34)}const SL=at(mL,[["render",CL]]),Gw="";er.register(FT,pa,ma,pl);const QL=l.defineComponent({components:{Bar:DL,MultiRangeSlider:SL},emits:["update","update:model-value"],props:{numberRange:{type:Array,default:()=>[{key:0,count:10}]},width:{type:Number,default:200},height:{type:Number,default:50},chartId:{type:String,default:"bar-chart"},datasetIdKey:{type:String,default:"label"},includeForm:{type:Boolean,default:!1},isMatch:{type:Boolean,default:!0},isExclude:{type:Boolean,default:!1},isDisable:{type:Boolean,default:!1},modelValue:{type:Object,required:!1,default:null}},data(){return{chartData:{labels:[],datasets:[{labels:"",data:[],backgroundColor:["#5ea9e5"],borderRadius:1,hoverBackgroundColor:"#e0e0e0"}]},chartOptions:{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{display:!1,grid:{display:!1},ticks:{display:!0}},y:{display:!1,grid:{display:!1},ticks:{display:!1}}}},min:0,max:this.numberRange.length-1,validated:!1,activeColor:"#5ea9e5",inactiveColor:"#e0e0e0"}},computed:{getRangeLength(){return this.numberRange.length},getFirstKey(){return this.numberRange[0].key},getLastKey(){return this.numberRange[this.getRangeLength-1].key},getMinKey(){return this.numberRange[this.min].key},getMinCaption(){return`${this.getMinKey}`},getMaxCaption(){return`${this.getMaxKey}`},getMaxKey(){return this.numberRange[this.max].key},getLastIndex(){return this.numberRange.length-1}},watch:{modelValue(i){this.max=this.numberRange.findIndex(n=>n.key==i.maxKey),this.min=this.numberRange.findIndex(n=>n.key==i.minKey)}},mounted(){this.setChartData(this.numberRange),this.isDisable&&this.missingFilter(),this.$props.modelValue&&(this.max=this.numberRange.findIndex(i=>i.key===this.$props.modelValue.maxKey),this.min=this.numberRange.findIndex(i=>i.key===this.$props.modelValue.minKey))},methods:{updateRange(){const i=this.getMinKey,n=this.getMaxKey;this.$props.modelValue&&this.$emit("update:model-value",{minKey:i,maxKey:n}),this.$emit("update",{minKey:i,maxKey:n})},updateBarChart(i){const{minValue:n,maxValue:e}=i;this.min=n,this.max=e,this.isDisable||(this.isExclude?this.excludeFilter():this.matchFilter())},matchFilter(){if(!this.isDisable){var i=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let n=0;n<=i.length;n++)n>=this.min&&n<=this.max?this.chartData.datasets[0].backgroundColor.push(this.activeColor):this.chartData.datasets[0].backgroundColor.push(this.inactiveColor)}},excludeFilter(){if(!this.isDisable){var i=this.chartData.datasets[0].data;this.chartData.datasets[0].backgroundColor=[];for(let n=0;n<i.length;n++)n>=this.min&&n<=this.max?this.chartData.datasets[0].backgroundColor.push(this.inactiveColor):this.chartData.datasets[0].backgroundColor.push(this.activeColor)}},missingFilter(){this.validated=!this.validated;var i=this.chartData.datasets[0].data;if(this.chartData.datasets[0].backgroundColor=[],this.validated)for(let n=1;n<=i.length;n++)this.chartData.datasets[0].backgroundColor.push(this.inactiveColor);else this.isMatch&&this.matchFilter(),this.isExclude&&this.excludeFilter()},changeMin(i){let n=parseInt(i.target.value);this.min=n||0,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},changeMax(i){let n=parseInt(i.target.value);this.max=n,this.isMatch&&!this.isDisable&&this.matchFilter(),this.isExclude&&!this.isDisable&&this.excludeFilter()},setChartData(i){let n=this.chartData.labels,e=[];for(let r=0;r<i.length;r++)n.push(i[r].key),e.push(i[r].count);this.chartData.datasets[0].data=e}}}),Ww="",YL={class:"dh-range-container"},UL={class:"bar-chart"},_L={key:0,class:"input-group-section"},BL={class:"input-group sb-input"},PL=["disabled","max","value"],RL={class:"input-group sb-input"},ZL=["disabled","max","min","value"];function VL(i,n,e,r,t,o){const a=l.resolveComponent("Bar"),s=l.resolveComponent("MultiRangeSlider");return l.openBlock(),l.createElementBlock("div",YL,[l.createElementVNode("div",UL,[l.createVNode(a,{"chart-data":i.chartData,"chart-id":i.chartId,"chart-options":i.chartOptions,"dataset-id-key":i.datasetIdKey,height:i.height,width:i.width},null,8,["chart-data","chart-id","chart-options","dataset-id-key","height","width"]),l.createVNode(s,{"base-class-name":`multi-range-slider range-slider ${i.isDisable}`,label:!1,max:i.getLastIndex,"max-caption":i.getMaxCaption,"max-value":i.max,min:0,"min-caption":i.getMinCaption,"min-value":i.min,"range-margin":0,ruler:!1,step:1,onInput:i.updateBarChart},null,8,["base-class-name","max","max-caption","max-value","min-caption","min-value","onInput"])]),i.includeForm?(l.openBlock(),l.createElementBlock("div",_L,[l.createElementVNode("div",BL,[l.createElementVNode("label",{class:l.normalizeClass(`dh-body-2 input-to ${i.validated?"disable":""}`)}," From ",2),l.createElementVNode("input",{class:"form-input text",disabled:i.validated,max:i.max,min:"1",placeholder:"From",type:"number",value:i.getMinKey,onInput:n[0]||(n[0]=u=>i.changeMin(u))},null,40,PL)]),l.createElementVNode("div",RL,[l.createElementVNode("label",{class:l.normalizeClass(`dh-body-2 input-to ${i.validated?"disable":""}`)}," To ",2),l.createElementVNode("input",{class:"form-input text",disabled:i.validated,max:i.max,min:i.min,placeholder:"To",type:"number",value:i.getMaxKey,onInput:n[1]||(n[1]=u=>i.changeMax(u))},null,40,ZL)])])):l.createCommentVNode("",!0),l.renderSlot(i.$slots,"input",{},void 0,!0),l.createElementVNode("button",{class:"btn",onClick:n[2]||(n[2]=u=>i.updateRange())},"Apply")])}const Nf=at(QL,[["render",VL],["__scopeId","data-v-24631dd5"]]),Hw="",Fw="",jf=i=>(l.pushScopeId("data-v-3dba4cb5"),i=i(),l.popScopeId(),i),GL={id:"dp-container"},WL=jf(()=>l.createElementVNode("div",{class:"dp__calendar_range"},[l.createElementVNode("p",null,"From"),l.createElementVNode("p",null,"To")],-1)),HL={class:"dp__multi"},FL=["value"],$L=["value"],JL=l.createTextVNode(" Back "),XL=["onClick"],KL=["onClick"],qL=["onClick"],e2=["onClick"],t2=["onClick"],n2=["onClick"],i2=["onClick"],r2=["onClick"],o2=jf(()=>l.createElementVNode("div",{id:"tags",class:"dp__calendar_tags"},null,-1)),a2=at({__name:"AdvancedDatePicker",props:{numberRange:{type:Array,required:!0}},emits:["update"],setup(i,{emit:n}){const e=l.ref(["",""]),r=l.ref(null),t=l.ref(null),o=l.ref(null),a=l.ref(!1),s=l.ref([{label:"Today",range:[new Date,new Date],slot:"today"},{label:"Previous week",range:[wM(bM(new Date)),bM(new Date)],slot:"previousWeek"},{label:"This week",range:[wM(new Date),iD(new Date)],slot:"week"},{label:"Next week",range:[oD(new Date),rD(new Date().setDate(new Date().getDate()+7))],slot:"nextWeek"},{label:"This month",range:[Nr(new Date),yr(new Date)],slot:"currentMonth"},{label:"Previous month",range:[Nr(Lt(new Date,1)),yr(Lt(new Date,1))],slot:"previousMonth"},{label:"Last 3 months",range:[Nr(Lt(new Date,3)),yr(Lt(new Date,1))],slot:"threeMonths"},{label:"Last 6 months",range:[Nr(Lt(new Date,6)),yr(Lt(new Date,1))],slot:"sixMonths"},{label:"Last year",range:[Ly(new Date),Ty(new Date)],slot:"yearly"}]),u=g=>{e.value=g,console.log(e.value),n("update",e.value)};function c(g){t.value=g.target.value,e.value=[g.target.value,r.value]}function M(g){r.value=g.target.value,e.value=[t.value,g.target.value]}l.onMounted(()=>{o.value.openMenu()});function d(){o.value.openMenu()}return(g,f)=>(l.openBlock(),l.createElementBlock("div",GL,[WL,l.createVNode(l.unref(Wo),{ref_key:"datePicker",ref:o,modelValue:e.value,"onUpdate:modelValue":[f[2]||(f[2]=j=>e.value=j),u],"auto-apply":"","day-names":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"enable-time-picker":!1,"model-type":"dd/MM/yyyy","multi-calendars":"","multi-calendars-solo":"","multi-static":!1,offset:12,position:"left","preset-ranges":s.value,range:"","select-text":"Apply","text-input":"",uid:"advanced",onClosed:d},{"dp-input":l.withCtx(()=>[l.createElementVNode("div",HL,[l.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:t.value?t.value:e.value[0],onInput:f[0]||(f[0]=j=>c(j))},null,40,FL),l.createElementVNode("input",{class:"dp__input dp__multi_input",placeholder:"MM/DD/YYYY",type:"text",value:r.value?r.value:e.value[1],onInput:f[1]||(f[1]=j=>M(j))},null,40,$L)])]),"arrow-left":l.withCtx(()=>[l.createVNode(me,{"icon-name":"previous",size:20})]),"arrow-right":l.withCtx(()=>[l.createVNode(me,{"icon-name":"next",size:20})]),"calendar-icon":l.withCtx(()=>[JL]),"clear-icon":l.withCtx(()=>[]),"action-preview":l.withCtx(()=>[]),"action-select":l.withCtx(()=>[]),previousWeek:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,XL)]))]),week:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,KL)]))]),nextWeek:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,qL)]))]),currentMonth:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,e2)]))]),previousMonth:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,t2)]))]),threeMonths:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,n2)]))]),sixMonths:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,i2)]))]),yearly:l.withCtx(({label:j,range:p,presetDateRange:x})=>[(l.openBlock(),l.createBlock(l.Teleport,{to:"#tags"},[l.createElementVNode("span",{onClick:N=>x(p)},l.toDisplayString(j),9,r2)]))]),_:1},8,["modelValue","preset-ranges"]),l.createVNode(Nf,{class:"dp__calendar_range_number","number-range":i.numberRange,steps:1},{input:l.withCtx(()=>[o2]),filter:l.withCtx(()=>[l.createVNode(dd,{data:a.value,label:"Include time",onChange:f[3]||(f[3]=j=>a.value=j)},null,8,["data"])]),_:1},8,["number-range"])]))}},[["__scopeId","data-v-3dba4cb5"]]),s2=l.defineComponent({components:{DhIcon:me},props:{mainText:{type:String,default:"Advanced"},filterMissingText:{type:String,default:"Filter Missing"},matchText:{type:String,default:"Match"},excludeText:{type:String,default:"Exclude"}},data(){return{activeFilter:!1,isFilterMissing:!1,isMatch:!1,isExclude:!1}},emits:["match","exclude","filter_missing"],mounted(){this.isMatch=!0},methods:{toggleFilter(){this.activeFilter=!this.activeFilter},matchFilter(){this.isMatch=!0,this.isExclude=!1,this.$emit("match",this.isMatch)},excludeFilter(){this.isMatch=!1,this.isExclude=!0,this.$emit("exclude",this.isExclude)},missingFilter(){this.isFilterMissing=!this.isFilterMissing,this.$emit("filter_missing",this.isFilterMissing),this.isFilterMissing&&this.isMatch?this.matchFilter():this.isFilterMissing&&this.isExclude&&this.excludeFilter()}}}),u2={class:"dh-advanced-filter-container"},l2={class:"advance_section"},c2={key:0},M2={class:"list-none"},d2=["checked"],g2=["checked"],f2=["checked"];function y2(i,n,e,r,t,o){const a=l.resolveComponent("dh-icon");return l.openBlock(),l.createElementBlock("div",u2,[l.createElementVNode("div",l2,[l.createElementVNode("span",{class:"toggle-icon",onClick:n[0]||(n[0]=s=>i.toggleFilter())},[l.createTextVNode(l.toDisplayString(i.mainText)+" ",1),l.createVNode(a,{"icon-name":i.activeFilter?"arrow-up":"arrow-down",size:20},null,8,["icon-name"])]),i.activeFilter?(l.openBlock(),l.createElementBlock("div",c2,[l.renderSlot(i.$slots,"default"),l.createElementVNode("ul",M2,[l.createElementVNode("li",null,[l.createElementVNode("label",null,[l.createElementVNode("input",{checked:i.isFilterMissing,name:"number_filter",type:"checkbox",onChange:n[1]||(n[1]=s=>i.missingFilter())},null,40,d2),l.createTextVNode(" "+l.toDisplayString(i.filterMissingText),1)])]),l.createElementVNode("li",null,[l.createElementVNode("label",null,[l.createElementVNode("input",{checked:i.isMatch,name:"number_filter",type:"radio",onChange:n[2]||(n[2]=s=>i.matchFilter())},null,40,g2),l.createTextVNode(" "+l.toDisplayString(i.matchText),1)]),l.createElementVNode("label",null,[l.createElementVNode("input",{checked:i.isExclude,name:"number_filter",type:"radio",onChange:n[3]||(n[3]=s=>i.excludeFilter())},null,40,f2),l.createTextVNode(" "+l.toDisplayString(i.excludeText),1)])])])])):l.createCommentVNode("",!0)])])}const N2=at(s2,[["render",y2]]),j2=["disabled"],h2={key:1,class:"prepend-icon"},I2={class:"append-icon"},p2=l.defineComponent({__name:"Button",props:{size:{type:String,required:!1,default:""},color:{type:String,required:!1,default:""},disabled:{type:Boolean,required:!1,default:!1},loading:{type:Boolean,required:!1,default:!1},icon:{type:String,required:!1,default:""}},setup(i){const n=i,e=l.computed(()=>n.size==="large"),r=l.computed(()=>n.size==="small"),t=l.computed(()=>n.color==="primary"),o=l.computed(()=>n.color==="secondary"),a=l.computed(()=>n.color==="danger"),s=l.computed(()=>n.color==="success"),u=l.computed(()=>n.color==="ghost");return(c,M)=>(l.openBlock(),l.createElementBlock("button",{class:l.normalizeClass({"dh-btn":!0,"dh-btn-primary":l.unref(t),"dh-btn-secondary":l.unref(o),"dh-btn-danger":l.unref(a),"dh-btn-success":l.unref(s),"dh-btn-ghost":l.unref(u),"dh-btn-large":l.unref(e),"dh-btn-small":l.unref(r),"dh-btn-icon":i.icon,disabled:i.disabled}),disabled:i.disabled||i.loading},[i.loading?(l.openBlock(),l.createBlock(me,{key:0,class:l.normalizeClass({"loading-spinner":!0,"loading-spinner-danger":l.unref(a),"loading-spinner-success":l.unref(s),"loading-spinner-secondary":l.unref(o)||l.unref(u)}),"icon-name":"loader"},null,8,["class"])):l.createCommentVNode("",!0),i.loading?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",h2,[l.renderSlot(c.$slots,"prepend-icon",{},void 0,!0)])),i.icon?l.createCommentVNode("",!0):l.renderSlot(c.$slots,"default",{key:2},void 0,!0),i.icon&&!i.loading?(l.openBlock(),l.createBlock(me,{key:3,"icon-name":i.icon,size:24},null,8,["icon-name"])):l.createCommentVNode("",!0),l.createElementVNode("div",I2,[l.renderSlot(c.$slots,"append-icon",{},void 0,!0)])],10,j2))}}),Jw="",ml=at(p2,[["__scopeId","data-v-faa3cf97"]]),D2=l.defineComponent({props:{target:{type:String,required:!0},trigger:{type:String,required:!0},placement:{type:String,default:()=>"bottom",required:!1},tooltipText:{type:String,required:!0}},data(){return{show:!1}},methods:{showTooltip(){this.show=!this.show},tooltip(){let i=this.$refs.main,n=this.$refs[this.target];["right","left"].includes(this.placement)&&(n.style.top=-(((n==null?void 0:n.offsetHeight)-(i==null?void 0:i.offsetHeight))/2)+"px")}}}),m2=["placement","target","tooltipText","trigger"],z2=["id"],x2={class:"text"};function A2(i,n,e,r,t,o){return l.openBlock(),l.createElementBlock("div",{id:"main-contain",ref:"main",class:"dh-tooltip-container tooltip",placement:i.placement,target:i.target,tooltipText:i.tooltipText,trigger:i.trigger,onClick:n[0]||(n[0]=a=>i.trigger=="click"?i.showTooltip():null),onMouseover:n[1]||(n[1]=a=>i.tooltip())},[l.renderSlot(i.$slots,"default"),l.createElementVNode("div",{id:i.target,ref:i.target,class:l.normalizeClass(`tooltiptext ${i.show}`)},[l.createElementVNode("span",x2,l.toDisplayString(i.tooltipText),1)],10,z2)],40,m2)}const hf=at(D2,[["render",A2]]),Xw="",T2={class:"copy__text"},L2=["readonly"],v2={__name:"Copiable",props:{text:{type:String,required:!0},placement:{type:String,default:"bottom"},readonly:{type:Boolean,default:!0}},setup(i){const n=i,e=l.ref(""),r=l.ref("copy text");function t(a){navigator.clipboard.writeText(a),r.value="copied !"}function o(){r.value="copy text"}return l.onMounted(()=>{e.value=n.text}),(a,s)=>(l.openBlock(),l.createElementBlock("span",T2,[l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=u=>e.value=u),readonly:i.readonly,type:"text",onInput:o},null,40,L2),[[l.vModelText,e.value]]),l.createVNode(hf,{placement:i.placement,target:"tooltiptext","tooltip-text":r.value,trigger:"hover",onClick:s[1]||(s[1]=u=>t(e.value))},{default:l.withCtx(()=>[l.createVNode(me,{class:"copy__text_icon","icon-name":"copy",size:18})]),_:1},8,["placement","tooltip-text"])]))}},Kw="",k2=l.createTextVNode(" Back "),b2=l.createElementVNode("div",null,"today",-1),w2={__name:"DatePicker",props:{inline:{type:Boolean,default:!0},multiCalendars:{type:Boolean,default:!1},multiCalendarsSolo:{type:Boolean,default:!1},range:{type:Boolean,default:!1},enableTimePicker:{type:Boolean,default:!1}},emits:["update"],setup(i,{emit:n}){const e=l.ref(),r=l.ref(null),t=a=>{e.value=a,n("update",e.value)},o=l.ref([{date:dn(new Date,0),type:"dot",tooltip:[{text:"Dot with tooltip",color:"blue"}]}]);return(a,s)=>(l.openBlock(),l.createElementBlock("div",null,[l.createVNode(l.unref(Wo),{ref_key:"datePicker",ref:r,modelValue:e.value,"onUpdate:modelValue":[s[0]||(s[0]=u=>e.value=u),t],"day-names":["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],"enable-time-picker":i.enableTimePicker,format:"MM/dd/yyyy",inline:i.inline,markers:o.value,"month-name-format":"short","multi-calendars":i.multiCalendars,"multi-calendars-solo":i.multiCalendars&i.multiCalendarsSolo,offset:12,placeholder:"MM/DD/YYYY",range:i.range||i.multiCalendars,"select-text":"Apply","text-input":"",uid:"base"},{"arrow-left":l.withCtx(()=>[l.createVNode(me,{"icon-name":"previous",size:20})]),"arrow-right":l.withCtx(()=>[l.createVNode(me,{"icon-name":"next",size:20})]),"calendar-icon":l.withCtx(()=>[k2]),"clear-icon":l.withCtx(()=>[]),"action-preview":l.withCtx(()=>[]),"marker-tooltip":l.withCtx(()=>[b2]),_:1},8,["modelValue","enable-time-picker","inline","markers","multi-calendars","multi-calendars-solo","range"])]))}},O2=["src"],E2={key:3,class:"menu-item-text-wrapper"},C2=l.defineComponent({__name:"DropdownMenuItem",props:{item:{type:Object,required:!0},textEllipsisStyle:{type:String,required:!1,default:"none",validator:i=>["none","ellipsis","fit-content"].includes(i)},iconSize:{type:Number,required:!1,default:24},maxWidth:{type:String,required:!1,default:"15rem"}},setup(i){const n=i;return l.useCssVars(e=>({"4eed85df":i.maxWidth})),(e,r)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[i.item.iconUrl?(l.openBlock(),l.createElementBlock("img",{key:0,alt:"icon image",class:"icon icon-url",src:i.item.iconUrl},null,8,O2)):l.createCommentVNode("",!0),i.item.iconUrl?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(me,l.mergeProps({key:1,class:"icon"},{...i.item,size:n.iconSize}),null,16)),i.item.subText?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass(["dh-body-2",i.textEllipsisStyle])},l.toDisplayString(i.item.text),3)),i.item.subText?(l.openBlock(),l.createElementBlock("div",E2,[l.createElementVNode("span",{class:l.normalizeClass(["dh-body-1",i.textEllipsisStyle])},l.toDisplayString(i.item.text),3),l.createElementVNode("span",{class:l.normalizeClass(["dh-body-4-medium",i.textEllipsisStyle])},l.toDisplayString(i.item.subText),3)])):l.createCommentVNode("",!0),i.item.isSelected?(l.openBlock(),l.createBlock(me,{key:4,class:"icon-blue icon-accept","icon-name":"accept",size:16})):l.createCommentVNode("",!0)],64))}}),qw="",If=at(C2,[["__scopeId","data-v-3eb62ad6"]]),S2=["data-e2e","onClick"],Q2=l.defineComponent({__name:"DropdownMenu",props:{items:{type:Object,required:!0},textEllipsisStyle:{type:String,required:!1,default:"none",validator:i=>["none","ellipsis","fit-content"].includes(i)},iconSize:{type:Number,required:!1,default:24},closeOnClickOutside:{type:Boolean,required:!1,default:!0},zIndex:{type:Number,required:!1,default:100},closeOnItemSelected:{type:Boolean,required:!1,default:!0},width:{type:String,required:!1,default:"100%"},minWidth:{type:String,required:!1,default:"10rem"},maxWidth:{type:String,required:!1,default:"15rem"}},emits:["itemSelected","close"],setup(i,{emit:n}){const e=i;l.useCssVars(o=>({"20988fa6":i.minWidth,"5040c1f4":i.width})),l.onMounted(()=>{document.addEventListener("click",o=>{r(o)})});function r(o){const a=o.target,s=document.querySelector("[data-id='dropdown-menu']");s&&!s.contains(o.target)&&!a.classList.contains("dropdown-toggle")&&e.closeOnClickOutside&&n("close")}function t(o){n("itemSelected",o),e.closeOnItemSelected&&n("close")}return(o,a)=>{const s=l.resolveComponent("router-link");return l.openBlock(),l.createElementBlock("div",{class:"dropdown-menu","data-id":"dropdown-menu",style:l.normalizeStyle({"z-index":e.zIndex})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.items,u=>(l.openBlock(),l.createElementBlock("div",{key:u.iconName,class:"menu-item","data-e2e":u.dataE2eTag,onClick:c=>t(u)},[u.url?(l.openBlock(),l.createBlock(s,{key:0,class:l.normalizeClass({"center-vertical":!0,disabled:u.disabled}),to:{path:u.url}},{default:l.withCtx(()=>[l.createVNode(If,{"icon-size":i.iconSize,item:u,"max-width":i.maxWidth,"text-ellipsis-style":i.textEllipsisStyle},null,8,["icon-size","item","max-width","text-ellipsis-style"])]),_:2},1032,["class","to"])):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass({"center-vertical":!0,disabled:u.disabled})},[l.createVNode(If,{"icon-size":i.iconSize,item:u,"max-width":i.maxWidth,"text-ellipsis-style":i.textEllipsisStyle},null,8,["icon-size","item","max-width","text-ellipsis-style"])],2))],8,S2))),128))],4)}}}),eO="",Y2=at(Q2,[["__scopeId","data-v-34e5ce8a"]]),U2={key:0,class:"invalid-feedback"},_2=l.defineComponent({__name:"Error",props:{errors:{type:Object,required:!1,default:void 0}},setup(i){const n=i;return(e,r)=>{var t;return l.unref(n).errors&&((t=l.unref(n).errors)==null?void 0:t.length)>0?(l.openBlock(),l.createElementBlock("div",U2,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.errors,o=>(l.openBlock(),l.createElementBlock("span",{key:o},l.toDisplayString(o),1))),128))])):l.createCommentVNode("",!0)}}}),tO="",B2={class:"dh-body-1-medium"},P2=l.createTextVNode(" Content "),R2={key:1,class:"wrapper"},Z2={class:"dh-body-1-medium"},V2={class:"panel-icon-wrapper"},G2=l.defineComponent({__name:"ExpansionPanel",props:{title:{type:String,default:"Advanced"},isAdvancedSettingsOpen:{type:Boolean,default:!1},type:{type:String,default:"mini"}},setup(i){const n=i,e=l.ref(!1),r=l.ref(null),t=l.ref(0);l.watch(()=>n.isAdvancedSettingsOpen,s=>{e.value!==s&&o()});function o(){if(n.type==="regular"){a();return}e.value=!e.value}function a(){e.value?(t.value=0,setTimeout(()=>{e.value=!1},300)):(e.value=!0,l.nextTick(()=>{r.value&&(t.value=r.value.scrollHeight)}))}return l.onMounted(()=>{e.value!==n.isAdvancedSettingsOpen&&o()}),(s,u)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[n.type==="mini"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",{class:l.normalizeClass(["advanced-panel-header clickable",{opened:e.value,closed:!e.value}]),"data-e2e":"expansion-panel-button",onClick:u[0]||(u[0]=c=>o())},[l.createElementVNode("h4",B2,l.toDisplayString(i.title),1),l.createVNode(me,{class:"icon","icon-name":e.value?"arrow-up":"arrow-down",size:24},null,8,["icon-name"])],2),e.value?l.renderSlot(s.$slots,"content",{key:0},()=>[P2],!0):l.createCommentVNode("",!0)],64)):l.createCommentVNode("",!0),n.type==="regular"?(l.openBlock(),l.createElementBlock("div",R2,[l.createElementVNode("button",{class:"panel-button",onClick:u[1]||(u[1]=c=>o())},[l.createElementVNode("h4",Z2,l.toDisplayString(i.title),1),l.createElementVNode("div",V2,[l.createVNode(me,{class:"panel-icon","icon-name":e.value?"minus":"plus",size:24},null,8,["icon-name"])])]),e.value?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"contentRef",ref:r,class:"panel",style:l.normalizeStyle({height:t.value>0?t.value+"px":0})},[l.renderSlot(s.$slots,"content",{},void 0,!0)],4)):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],64))}}),nO="",W2=at(G2,[["__scopeId","data-v-7319184b"]]),iO="",H2=l.createElementVNode("label",{for:"upload_pdf"},[l.createTextVNode(" Drag and drop file or "),l.createElementVNode("span",{id:"upload"},"browse")],-1),F2={key:0,class:"file__upload_items"},$2={class:"file__upload_list_item"},J2={class:"file__upload_list_item_label"},X2=["title"],K2=l.createElementVNode("br",null,null,-1),q2=["href"],ev={key:1,class:"file__upload_items"},tv={class:"file__upload_list_item"},nv={class:"file__upload_list_item_label"},iv=["title"],rv={key:0,class:"label__antivirus"},ov={key:1,class:"label__antivirus label__antivirus--failed"},av={key:2,class:"label__antivirus label__antivirus--detected"},sv=l.createElementVNode("br",null,null,-1),uv={key:3},lv={key:4},cv={key:0},Mv=["value"],dv=["href"],gv={key:2,class:"file__upload_placeholder"},fv={key:3,class:"file__upload_action"},yv=l.createElementVNode("button",{class:"file__upload_action_cancel"},"Cancel",-1),Nv={__name:"FileUpload",props:{fileList:{type:Array,required:!1,default:()=>[]},fileFormats:{type:Array,required:!1,default:()=>[".pdf",".csv",".doc",".jpeg",".jpg",".mp4",".png",".txt",".xls"]},uploadProgress:{type:Array,required:!0},errorOccurred:{type:Array,required:!0},virusCheck:{type:Array,required:!0},modelValue:{type:FileList,required:!1,default:void 0},inline:{type:Boolean,required:!1,default:!1},large:{type:Boolean,required:!1,default:!1},errorMessage:{type:String,required:!1,default:"an error occurred while uploading"},fileSaved:{type:Boolean,required:!1,default:!1},virusCheckText:{type:String,required:!1,default:"Antivirus check ..."},virusCheckFailedText:{type:String,required:!1,default:"Antivirus check failed"},virusDetectedText:{type:String,required:!1,default:"Virus detected"},deleteConfirmationText:{type:String,required:!1,default:"Are you sure you want to delete it permanently? this action will be irreversible"},zIndex:{type:Number,required:!1,default:99},fieldIndex:{type:Number,required:!1,default:0}},emits:["update:modelValue","reload"],setup(i,{emit:n}){const e=i;l.watch(e.uploadProgress,async D=>{if(e.inline){const v=o.value.length;D.slice(0,v).every(L=>L==100)&&n("update:modelValue",o.value,a.value)}});const r=l.ref(null),t=l.ref(!1),o=l.ref([]),a=l.ref([]),s=l.ref([".pdf",".csv",".doc",".jpeg",".jpg",".mp4",".png",".txt",".xls"]);function u(D,v=2){if(!+D)return"0 Bytes";const L=1024,w=v<0?0:v,E=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],T=Math.floor(Math.log(D)/Math.log(L));return`${parseFloat((D/Math.pow(L,T)).toFixed(w))} ${E[T]}`}function c(D,v=2){if(!+D)return"0 KB";const L=1024,w=v<0?0:v,E=["KB","MB","GB","TB","PB","EB","ZB","YB"],T=Math.floor(Math.log(D)/Math.log(L));return`${parseFloat((D/Math.pow(L,T)).toFixed(w))} ${E[T]}`}function M(D){return s.value.includes(g(D))?g(D).slice(1):"unknown"}function d(D){const v=D.lastIndexOf(".");let L=D.slice(0,v);return L.length<=19?L:L.slice(0,20)+"... "}function g(D){return D.replace(/.*(?=\.)/g,"")}function f(D){D.stopPropagation();for(let v=0;v<r.value.files.length;v++){const L=r.value.files[v];o.value.push(L)}o.value&&(t.value=!0),n("update:modelValue",o.value,a.value,e.fieldIndex)}function j(D){D.stopPropagation(),D.dataTransfer.dropEffect="copy"}function p(D){D.stopPropagation(),t.value=!0;for(let v=0;v<D.dataTransfer.files.length;v++){const L=D.dataTransfer.files[v];o.value.push(L)}n("update:modelValue",o.value,a.value,e.fieldIndex)}function x(D){window.confirm(e.deleteConfirmationText)&&z(D)}function N(D){window.confirm(e.deleteConfirmationText)&&h(D)}function h(D){a.value.push(D),n("update:modelValue",o.value,a.value,e.fieldIndex)}function z(D){const v=new DataTransfer;for(let L=0;L<o.value.length;L++){const w=o.value[L];D!==L&&v.items.add(w)}o.value=v.files,o.value.length==0&&(t.value=!1)}function m(D){return URL.createObjectURL(D)}function I(D){D.preventDefault(),n("reload")}return(D,v)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["file__upload",{file__upload_box:!i.inline,file__upload_large:i.large&&i.inline}])},[l.createElementVNode("div",{class:"file__upload_btn",onDragover:v[1]||(v[1]=l.withModifiers(L=>j(L),["prevent"])),onDrop:v[2]||(v[2]=l.withModifiers(L=>p(L),["prevent"]))},[l.createVNode(me,{class:"file__upload_btn_icon","icon-name":"upload",size:24}),H2,l.createElementVNode("input",{id:"upload_pdf",ref_key:"upload",ref:r,enctype:"multipart/form-data",multiple:"",name:"file",type:"file",onInput:v[0]||(v[0]=L=>f(L))},null,544)],32),i.fileList.length?(l.openBlock(),l.createElementBlock("div",F2,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.fileList,L=>(l.openBlock(),l.createElementBlock("div",{key:L.id,class:l.normalizeClass(["file__upload_list",i.inline?"":"file__upload_list_box"])},[l.createVNode(me,{"icon-name":"file-"+M(L.label),size:40},null,8,["icon-name"]),l.createElementVNode("div",$2,[l.createElementVNode("div",J2,[l.createElementVNode("div",null,[l.createElementVNode("span",{title:L.label},l.toDisplayString(d(L.label))+l.toDisplayString(g(L.label)),9,X2),K2,l.createElementVNode("span",null,l.toDisplayString(c(L.size_kb)),1)])])]),l.createElementVNode("a",{class:"file__upload_list_download",href:L.download_url,target:"_blank"},[l.createVNode(me,{class:"file__upload_list_download_icon","icon-name":"download",size:24})],8,q2),l.createVNode(me,{class:"file__upload_list_delete","icon-name":"delete",size:24,onClick:w=>N(L.id)},null,8,["onClick"])],2))),128))])):l.createCommentVNode("",!0),t.value?(l.openBlock(),l.createElementBlock("div",ev,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(L,w)=>(l.openBlock(),l.createElementBlock("div",{key:w,class:l.normalizeClass(["file__upload_list",i.inline?"":"file__upload_list_box"])},[l.createVNode(me,{class:l.normalizeClass(i.errorOccurred[w]?"file__upload_list_icon":""),"icon-name":"file-"+M(L.name),size:40},null,8,["class","icon-name"]),e.uploadProgress[w]==100&&i.fileSaved&&!i.errorOccurred[w]&&i.virusCheck[w]=="loading"?(l.openBlock(),l.createBlock(me,{key:0,class:"file__upload_list_icon_sub file__upload_list_icon_sub--loading","icon-name":"states",size:20,style:l.normalizeStyle({"z-index":e.zIndex})},null,8,["style"])):l.createCommentVNode("",!0),e.uploadProgress[w]==100&&i.fileSaved&&i.virusCheck[w]=="failed"?(l.openBlock(),l.createBlock(me,{key:1,class:"file__upload_list_icon_sub","icon-name":"warning",size:20,style:l.normalizeStyle({"z-index":e.zIndex})},null,8,["style"])):l.createCommentVNode("",!0),e.uploadProgress[w]==100&&i.fileSaved&&i.virusCheck[w]=="detected"?(l.openBlock(),l.createBlock(me,{key:2,class:"file__upload_list_icon_sub","icon-name":"danger",size:20,style:l.normalizeStyle({"z-index":e.zIndex})},null,8,["style"])):l.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[w]?(l.openBlock(),l.createBlock(me,{key:3,class:"file__upload_list_icon_sub","icon-name":"error",size:20,style:l.normalizeStyle({"z-index":e.zIndex})},null,8,["style"])):l.createCommentVNode("",!0),l.createElementVNode("div",tv,[l.createElementVNode("div",nv,[l.createElementVNode("div",null,[l.createElementVNode("span",{title:L.name},l.toDisplayString(d(L.name))+l.toDisplayString(g(L.name)),9,iv),e.uploadProgress[w]==100&&i.fileSaved&&!i.errorOccurred[w]&&i.virusCheck[w]=="loading"?(l.openBlock(),l.createElementBlock("span",rv,[l.createTextVNode(l.toDisplayString(i.virusCheckText)+" ",1),l.createVNode(me,{class:"file__upload_list_icon_sub--loading","icon-name":"processing",size:18})])):l.createCommentVNode("",!0),e.uploadProgress[w]==100&&i.fileSaved&&i.virusCheck[w]=="failed"?(l.openBlock(),l.createElementBlock("span",ov,l.toDisplayString(i.virusCheckFailedText),1)):l.createCommentVNode("",!0),e.uploadProgress[w]==100&&i.fileSaved&&i.virusCheck[w]=="detected"?(l.openBlock(),l.createElementBlock("span",av,l.toDisplayString(i.virusDetectedText),1)):l.createCommentVNode("",!0),sv,i.fileSaved&&!i.errorOccurred[w]||!i.errorOccurred[w]&&i.virusCheck[w]?(l.openBlock(),l.createElementBlock("span",uv,l.toDisplayString(u(L.size)),1)):l.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[w]?(l.openBlock(),l.createElementBlock("span",lv,l.toDisplayString(i.errorMessage),1)):l.createCommentVNode("",!0)]),i.fileSaved?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",cv,l.toDisplayString(e.uploadProgress[w])+"%",1))]),i.fileSaved?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("progress",{key:0,id:"file",max:"100",value:e.uploadProgress[w]},l.toDisplayString(e.uploadProgress[w])+"% ",9,Mv))]),i.fileSaved&&!i.virusCheck[w]&&!i.errorOccurred[w]?(l.openBlock(),l.createElementBlock("a",{key:4,class:"file__upload_list_download",href:m(L),target:"_blank"},[l.createVNode(me,{class:"file__upload_list_download_icon","icon-name":"download",size:24})],8,dv)):l.createCommentVNode("",!0),i.fileSaved&&i.errorOccurred[w]?(l.openBlock(),l.createElementBlock("a",{key:5,class:"file__upload_list_retry",onClick:v[3]||(v[3]=E=>I(E))},[l.createVNode(me,{class:"file__upload_list_retry_icon","icon-name":"retry",size:24})])):l.createCommentVNode("",!0),e.uploadProgress[w]!==100?(l.openBlock(),l.createBlock(me,{key:6,class:"file__upload_list_delete","icon-name":"close",size:24,onClick:E=>z(w)},null,8,["onClick"])):(l.openBlock(),l.createBlock(me,{key:7,class:"file__upload_list_delete","icon-name":"delete",size:24,onClick:E=>x(w)},null,8,["onClick"]))],2))),128))])):l.createCommentVNode("",!0),!t.value&&!i.inline&&!i.fileList.length?(l.openBlock(),l.createElementBlock("div",gv," No file selected ")):l.createCommentVNode("",!0),!i.inline&&!i.fileSaved?(l.openBlock(),l.createElementBlock("div",fv,[yv,l.createElementVNode("button",{class:l.normalizeClass(["file__upload_action_done",t.value&&!i.fileSaved?"file__upload_action_done--active":""]),onClick:v[4]||(v[4]=(...L)=>D.saveFile&&D.saveFile(...L))}," Done ",2)])):l.createCommentVNode("",!0)],2))}},jv=l.defineComponent({components:{DhIcon:me},props:{title:{type:String,required:!1,default:""},iconName:{type:String,required:!1,default:"default"},iconUrl:{type:String,required:!1,default:""},text:{type:String,required:!0},textPosition:{type:String,default:"right",validator:i=>["right","left"].includes(i)},labelKlass:{type:String,required:!1,default:"dh-body-2"},size:{type:Number,required:!1,default:18},hideText:{type:Boolean,required:!1,default:!1},hasBackground:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1,default:!1},activeOnHover:{type:Boolean,required:!1,default:!1},textEllipsis:{type:Boolean,required:!1,default:!1},isDanger:{type:Boolean,required:!1,default:!1}},emits:["error"],methods:{emitError(){this.$emit("error")}}}),rO="",hv=["src","title"];function Iv(i,n,e,r,t,o){const a=l.resolveComponent("DhIcon");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["icon-with-text",{"active-hover":i.activeOnHover,active:i.active,danger:i.isDanger,"no-background":!i.hasBackground,reverse:i.textPosition==="left"}])},[i.iconUrl?(l.openBlock(),l.createElementBlock("img",{key:0,alt:"icon image",class:"icon-with-text-icon icon-url",src:i.iconUrl,title:i.title,onError:n[0]||(n[0]=s=>i.emitError())},null,40,hv)):l.createCommentVNode("",!0),i.iconUrl?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(a,l.mergeProps({key:1,class:"icon-with-text-icon icon-3"},{iconName:i.iconName,size:i.size}),null,16)),i.hideText?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass(["",`icon-with-text-label ${i.labelKlass} ${i.textEllipsis?"text-ellipsis":""}`])},l.toDisplayString(i.text),3))],2)}const pf=at(jv,[["render",Iv],["__scopeId","data-v-6e7a9b18"]]),oO="",pv={class:"input__dropdown"},Dv=["placeholder","value"],mv={class:"input__dropdown_second"},zv=["tabindex"],xv=["onClick"],Av=["onClick"],Tv={key:2,class:"button__clear"},Df={__name:"InputDropdown",props:{options:{type:Array,required:!0},labelProp:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"id"},icon:{type:String,required:!0},placeholderInput:{type:String,required:!1,default:"Enter value"},tabindex:{type:Number,required:!1,default:0},inputValue:{type:String,required:!1,default:""},inputWidth:{type:String,required:!1,default:"75%"},selectedOption:{type:Object,required:!1,default:null},isClearable:{type:Boolean,required:!1,default:!1}},emits:["update","clear"],setup(i,{emit:n}){const e=i,r=l.ref(0),t=l.ref(""),o=l.ref(!1),a=l.ref(""),s=l.computed(()=>t.value.length>20?t.value.substring(0,17)+"...":t.value);l.onMounted(()=>{e.inputValue&&(a.value.value=e.inputValue),e.selectedOption&&(r.value=d(e.selectedOption)),M()}),l.watch(()=>e.selectedOption,g=>{g?r.value=d(g):r.value=0,M()},{deep:!0});function u(){n("update",a.value.value,e.options[r.value])}function c(){n("clear")}function M(){t.value=e.options[r.value][e.labelProp]}function d(g){return e.options.findIndex(f=>f[e.valueProp]===g[e.valueProp])}return(g,f)=>(l.openBlock(),l.createElementBlock("div",pv,[l.createElementVNode("input",{ref_key:"name",ref:a,class:"input__dropdown_text",placeholder:i.placeholderInput,style:l.normalizeStyle({width:i.inputWidth}),type:"text",value:i.inputValue,onInput:u},null,44,Dv),l.createElementVNode("div",mv,[l.createVNode(me,{"icon-name":i.icon,size:18},null,8,["icon-name"]),l.createElementVNode("div",{class:"custom__select",tabindex:i.tabindex,onBlur:f[1]||(f[1]=j=>o.value=!1)},[l.createElementVNode("div",{class:l.normalizeClass(["custom__select_selected",{"custom__select--open":o.value}]),onClick:f[0]||(f[0]=j=>o.value=!o.value)},l.toDisplayString(l.unref(s)),3),typeof i.options[0]=="object"?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["custom__select_items",{"custom__select--hide":!o.value}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.options,(j,p)=>(l.openBlock(),l.createElementBlock("div",{key:p,onClick:x=>{t.value=j[i.labelProp],r.value=p,o.value=!1,u()}},l.toDisplayString(j[i.labelProp]),9,xv))),128))],2)):l.createCommentVNode("",!0),typeof i.options[0]=="string"?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(["custom__select_items",{"custom__select--hide":!o.value}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.options,(j,p)=>(l.openBlock(),l.createElementBlock("div",{key:p,onClick:x=>{t.value=j,r.value=p,o.value=!1,u()}},l.toDisplayString(j),9,Av))),128))],2)):l.createCommentVNode("",!0),e.isClearable?(l.openBlock(),l.createElementBlock("div",Tv,[l.createVNode(ml,{color:"ghost",icon:"close",onClick:c})])):l.createCommentVNode("",!0)],40,zv)])]))}},aO="",Lv={class:"input-group-multiple"},vv={class:"input-label"},kv={__name:"InputDropdownMultiple",props:{title:{type:String,required:!1,default:"label"},labelProp:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"id"},icon:{type:String,required:!0},placeholderInput:{type:String,required:!1,default:"Enter value"},tabindex:{type:Number,required:!1,default:0},inputWidth:{type:String,required:!1,default:"75%"},value:{type:Array,required:!0},options:{type:Array,required:!0}},emits:["update"],setup(i,{emit:n}){const e=i,r=l.reactive(e.value);function t(s,u,c){r&&(r[s].input=u,r[s].selectedOption=c,n("update",r))}function o(s){r.length>1&&(r.splice(s,1),n("update",r))}function a(){r&&r.push({input:null,selectedOption:null})}return(s,u)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",Lv,[l.createElementVNode("label",vv,l.toDisplayString(i.title),1),l.createElementVNode("button",{class:"btn btn-secondary btn-multiple",onClick:a},[l.createVNode(me,{"icon-name":"plus",size:24})])]),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r,(c,M)=>(l.openBlock(),l.createBlock(Df,{key:M,icon:e.icon,"input-value":c.input,"input-width":e.inputWidth,"is-clearable":"","label-prop":e.labelProp,options:e.options,"placeholder-input":e.placeholderInput,"selected-option":c.selectedOption,tabindex:e.tabindex,"value-prop":e.valueProp,onClear:d=>o(M),onUpdate:(d,g,f)=>t(M,d,g)},null,8,["icon","input-value","input-width","label-prop","options","placeholder-input","selected-option","tabindex","value-prop","onClear","onUpdate"]))),128))],64))}},sO="",bv=["data-e2e","placeholder","value"],wv={key:1,class:"input__group_content"},Ov=["data-e2e","placeholder","value"],Ev={key:2,class:"input__group"},Cv=["data-e2e","placeholder","type","value"],Sv={__name:"InputGroup",props:{modelValue:{type:[String,Number],default:""},inputType:{type:String,default:"text",required:!0},iconName:{type:String,required:!1,default:""},sideContent:{type:String,required:!1,default:""},widthProp:{type:String,default:"200px",required:!1},heightProp:{type:String,default:"30px",required:!1},direction:{type:String,default:"right",required:!1},placeholder:{type:String,default:"type here",required:!1},e2e:{type:String,default:"",required:!1}},emits:["update:modelValue"],setup(i){const n=i;l.useCssVars(r=>({"52c3921b":e.value,"1745b0d0":i.widthProp,ec9c60fa:i.heightProp}));const e=l.ref("row");return l.onMounted(()=>{n.direction=="left"&&(e.value="row-reverse")}),(r,t)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[i.inputType=="multi-line"?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["text__area",i.direction=="left"?"text__area--left":"text__area--right"])},[l.createElementVNode("textarea",{class:"text__area_field",cols:"30","data-e2e":i.e2e,placeholder:i.placeholder,rows:"10",value:i.modelValue,onInput:t[0]||(t[0]=o=>r.$emit("update:modelValue",o.target.value))},null,40,bv),i.direction=="left"&&i.iconName?(l.openBlock(),l.createBlock(me,{key:0,class:"text__area_icon text__area_icon--left","icon-name":i.iconName},null,8,["icon-name"])):l.createCommentVNode("",!0),i.direction=="right"&&i.iconName?(l.openBlock(),l.createBlock(me,{key:1,class:"text__area_icon text__area_icon--right","icon-name":i.iconName},null,8,["icon-name"])):l.createCommentVNode("",!0)],2)):l.createCommentVNode("",!0),i.inputType=="text"&&i.sideContent?(l.openBlock(),l.createElementBlock("div",wv,[l.createElementVNode("input",{class:l.normalizeClass(["form-input",i.direction=="left"?"form-input--left":"form-input--right"]),"data-e2e":i.e2e,placeholder:i.placeholder,value:i.modelValue,onInput:t[1]||(t[1]=o=>r.$emit("update:modelValue",o.target.value))},null,42,Ov),l.createElementVNode("span",{class:l.normalizeClass(["form-span",i.direction=="left"?"form-span--left":"form-span--right"])},l.toDisplayString(i.sideContent),3)])):i.inputType!=="multi-line"?(l.openBlock(),l.createElementBlock("div",Ev,[l.createElementVNode("input",{class:"input__group_field","data-e2e":i.e2e,placeholder:i.placeholder,type:i.inputType,value:i.modelValue,onInput:t[2]||(t[2]=o=>r.$emit("update:modelValue",o.target.value))},null,40,Cv),i.iconName?(l.openBlock(),l.createBlock(me,{key:0,class:"input__group_icon","icon-name":i.iconName},null,8,["icon-name"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],64))}},Qv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAR2SURBVHgBlVVdaFtlGH6+LydJ89OYtHVbf+YyhoPK5uK2G3/oIlTYhRctKApebAiCXowtDLzxIi3sUqnBiiBerF6osGl7J0idqWyD4WSZF3PzZ4tt7Y/NmnRN0yYn5/t8z9e0Ne35Wnwg5Jzzvt/7vO/7vT8MO6BnYDEuPP4TXMi4kIgyxqOrElEAZEZKZLhVHhpJBDPb2WE6wcsDZtwwXEkJGd9G7T9WRJqZ+f6RxONprUp9BDIs3CLJJM7tSLAJkg5xIT6EVSTCSEFLdPKT5ai36hqWzBVj8v+R1IFVM8y0ekcSvuwWop6BfFgaoR8kY0RSf04qRUriSh6l/AzcDY3wRtpgmWUSUhSewFYuITMFwV9MJ5iKzFgTCHfITtcWEhvW/H38NfYpViZ+UZ7Jmn920B3dZxDuPLnljOQsFmYiSY8J+53Xook734nE4v1r+P2rBMoTt1VUqzRC/ThFU85P2m7CCYKxc3bVrhNZRjDpdPHmoxnMXBmErFbgDIncza+RuzGE1QTXQ1k0fElF9OpAJcaZK+5kZuHuKCqlAraDbWzmxmWUJm5pXEH89Y8W49w0cNrBGYWlqTvbFvjTna1oigQoLQKP/ryq0eIooSFOxcCP6AxJaWkkDAEfw/uJ52GaJt658D1yhSmdGdJmJ+iOZEyrQaFeOPss9u3xKXUVHlXN8UO78U2qFx0tbuxv9eOzZDepCr0ZGlsGdUFYR3L04C50H4ugt2s/HkwXsVgqoyXUgLbdQeITtgFFEPK58VR7iFKk81dEuU7m5yWkXmtEo98Ao0jeS12FWeVo3+WnZhT48edJvNl3RTkU8nN8fKoJAWNJE5HdsJJl6SG6WVZhbsyZfuxVlSLwwbtd2NMcUM/2wReOP4Enoy2rVuhbQTRhpep25pGiwBmvZJ2EVcuD8/fewGwloIy1NftUdUlqUkn7glPKWpsblO7flTDO330FFjyORKSd4bBcY9CCYboUXFe3S9UmYmuvNeTJGRrEziTM1q/eJieLaWhAnuDbiQO12cZgLa0Ay1UI+7eyUfqjMwehWymMHHNXqxc57Y003W5aR3YrfwCXsp3KkCvgAfd7wX3073PRLAOGxztxbWqfrudtpC/R9uWrrGa/1KjS6MSXfxzFFxNdsJhXxUmOQbj8+Py35zB07xilh2kyAoom328/K6KRM740mUxtHoz2fRTmBKYfMMxXaP+wCMzcAsyHCyQLomRElayQs+y1tAVUAKnLtdW+3ke8avSRILNGZpPMjlsozlMBUI6u36Ebaz8M+OjiPUHwvc9g9KeyWkqLD13ITdpkG9OBPmcQNPrW3uti7hlYjkq3Z5iSH8vPEslCfSV1Ha7g1EucSt/Exe8krv/qrzMQeMxCUyu3d1WGutt5lW+QyXDZLPf9M26cldAODkfY99zSUU4FvL6+kdoK1xKt4dDbc3G3EUmSQhw7EDLqFSFZmvZtf2bQvm8HHeyA2FvFGPd6TlN0R0iZJj0Lq2NSZiWsLGNsjKOYvjlIbbIN/gUK8Nn86IrnuAAAAABJRU5ErkJggg==";function on(i){return[null,void 0].indexOf(i)!==-1}function Yv(i,n,e){const{object:r,valueProp:t,mode:o}=l.toRefs(i),a=l.getCurrentInstance().proxy,s=e.iv,u=d=>{s.value=M(d);const g=c(d);n.emit("change",g,a),n.emit("input",g),n.emit("update:modelValue",g)},c=d=>r.value||on(d)?d:Array.isArray(d)?d.map(g=>g[t.value]):d[t.value],M=d=>on(d)?o.value==="single"?{}:[]:d;return{update:u}}function Uv(i,n){const{value:e,modelValue:r,mode:t,valueProp:o}=l.toRefs(i),a=l.ref(t.value!=="single"?[]:{}),s=r&&r.value!==void 0?r:e,u=l.computed(()=>t.value==="single"?a.value[o.value]:a.value.map(M=>M[o.value])),c=l.computed(()=>t.value!=="single"?a.value.map(M=>M[o.value]).join(","):a.value[o.value]);return{iv:a,internalValue:a,ev:s,externalValue:s,textValue:c,plainValue:u}}function _v(i,n,e){const{regex:r}=l.toRefs(i),t=l.getCurrentInstance().proxy,o=e.isOpen,a=e.open,s=l.ref(null),u=l.ref(null),c=()=>{s.value=""},M=f=>{s.value=f.target.value},d=f=>{if(r&&r.value){let j=r.value;typeof j=="string"&&(j=new RegExp(j)),f.key.match(j)||f.preventDefault()}},g=f=>{if(r&&r.value){let p=(f.clipboardData||window.clipboardData).getData("Text"),x=r.value;typeof x=="string"&&(x=new RegExp(x)),p.split("").every(N=>!!N.match(x))||f.preventDefault()}n.emit("paste",f,t)};return l.watch(s,f=>{!o.value&&f&&a(),n.emit("search-change",f,t)}),{search:s,input:u,clearSearch:c,handleSearchInput:M,handleKeypress:d,handlePaste:g}}function Bv(i,n,e){const{groupSelect:r,mode:t,groups:o,disabledProp:a}=l.toRefs(i),s=l.ref(null),u=M=>{M===void 0||M!==null&&M[a.value]||o.value&&M&&M.group&&(t.value==="single"||!r.value)||(s.value=M)};return{pointer:s,setPointer:u,clearPointer:()=>{u(null)}}}function ba(i,n=!0){return n?String(i).toLowerCase().trim():String(i).normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase().trim()}function Pv(i){return Object.prototype.toString.call(i)==="[object Object]"}function Rv(i,n){const e=n.slice().sort();return i.length===n.length&&i.slice().sort().every(function(r,t){return r===e[t]})}function Zv(i,n,e){const{options:r,mode:t,trackBy:o,limit:a,hideSelected:s,createTag:u,createOption:c,label:M,appendNewTag:d,appendNewOption:g,multipleLabel:f,object:j,loading:p,delay:x,resolveOnLoad:N,minChars:h,filterResults:z,clearOnSearch:m,clearOnSelect:I,valueProp:D,canDeselect:v,max:L,strict:w,closeOnSelect:E,groups:T,reverse:y,infinite:A,groupOptions:k,groupHideEmpty:b,groupSelect:C,onCreate:S,disabledProp:O,searchStart:Q}=l.toRefs(i),_=l.getCurrentInstance().proxy,U=e.iv,Y=e.ev,B=e.search,Z=e.clearSearch,P=e.update,R=e.pointer,G=e.clearPointer,W=e.focus,F=e.deactivate,X=e.close,oe=l.ref([]),ee=l.ref([]),ae=l.ref(!1),ge=l.ref(null),V=l.ref(A.value&&a.value===-1?10:a.value),q=l.computed(()=>u.value||c.value||!1),ce=l.computed(()=>d.value!==void 0?d.value:g.value!==void 0?g.value:!0),le=l.computed(()=>{if(T.value){let $=ee.value||[],se=[];return $.forEach(pe=>{At(pe[k.value]).forEach(ne=>{se.push(Object.assign({},ne,pe[O.value]?{[O.value]:!0}:{}))})}),se}else{let $=At(ee.value||[]);return oe.value.length&&($=$.concat(oe.value)),$}}),he=l.computed(()=>T.value?ze((ee.value||[]).map(($,se)=>{const pe=At($[k.value]);return{...$,index:se,group:!0,[k.value]:$t(pe,!1).map(ne=>Object.assign({},ne,$[O.value]?{[O.value]:!0}:{})),__VISIBLE__:$t(pe).map(ne=>Object.assign({},ne,$[O.value]?{[O.value]:!0}:{}))}})):[]),Ee=l.computed(()=>{let $=le.value;return y.value&&($=$.reverse()),te.value.length&&($=te.value.concat($)),$t($)}),Le=l.computed(()=>{let $=Ee.value;return V.value>0&&($=$.slice(0,V.value)),$}),H=l.computed(()=>{switch(t.value){case"single":return!on(U.value[D.value]);case"multiple":case"tags":return!on(U.value)&&U.value.length>0}}),K=l.computed(()=>f!==void 0&&f.value!==void 0?f.value(U.value,_):U.value&&U.value.length>1?`${U.value.length} options selected`:"1 option selected"),ie=l.computed(()=>!le.value.length&&!ae.value&&!te.value.length),ue=l.computed(()=>le.value.length>0&&Le.value.length==0&&(B.value&&T.value||!T.value)),te=l.computed(()=>q.value===!1||!B.value?[]:Ne(B.value)!==-1?[]:[{[D.value]:B.value,[M.value]:B.value,[re.value]:B.value,__CREATE__:!0}]),re=l.computed(()=>o.value||M.value),De=l.computed(()=>{switch(t.value){case"single":return null;case"multiple":case"tags":return[]}}),Ue=l.computed(()=>p.value||ae.value),Ce=$=>{switch(typeof $!="object"&&($=J($)),t.value){case"single":P($);break;case"multiple":case"tags":P(U.value.concat($));break}n.emit("select",Mt($),$,_)},ot=$=>{switch(typeof $!="object"&&($=J($)),t.value){case"single":Ht();break;case"tags":case"multiple":P(Array.isArray($)?U.value.filter(se=>$.map(pe=>pe[D.value]).indexOf(se[D.value])===-1):U.value.filter(se=>se[D.value]!=$[D.value]));break}n.emit("deselect",Mt($),$,_)},Mt=$=>j.value?$:$[D.value],un=$=>{ot($)},In=($,se)=>{if(se.button!==0){se.preventDefault();return}un($)},Ht=()=>{n.emit("clear",_),P(De.value)},It=$=>{if($.group!==void 0)return t.value==="single"?!1:_e($[k.value])&&$[k.value].length;switch(t.value){case"single":return!on(U.value)&&U.value[D.value]==$[D.value];case"tags":case"multiple":return!on(U.value)&&U.value.map(se=>se[D.value]).indexOf($[D.value])!==-1}},ft=$=>$[O.value]===!0,ln=()=>L===void 0||L.value===-1||!H.value&&L.value>0?!1:U.value.length>=L.value,Ct=$=>{if(!ft($)){if(S&&S.value&&!It($)&&$.__CREATE__&&($={...$},delete $.__CREATE__,$=S.value($,_),$ instanceof Promise)){ae.value=!0,$.then(se=>{ae.value=!1,_n(se)});return}_n($)}},_n=$=>{switch($.__CREATE__&&($={...$},delete $.__CREATE__),t.value){case"single":if($&&It($)){v.value&&ot($);return}$&&St($),I.value&&Z(),E.value&&(G(),X()),$&&Ce($);break;case"multiple":if($&&It($)){ot($);return}if(ln())return;$&&(St($),Ce($)),I.value&&Z(),s.value&&G(),E.value&&X();break;case"tags":if($&&It($)){ot($);return}if(ln())return;$&&St($),I.value&&Z(),$&&Ce($),s.value&&G(),E.value&&X();break}E.value||W()},ai=$=>{if(!(ft($)||t.value==="single"||!C.value)){switch(t.value){case"multiple":case"tags":Ft($[k.value])?ot($[k.value]):Ce($[k.value].filter(se=>U.value.map(pe=>pe[D.value]).indexOf(se[D.value])===-1).filter(se=>!se[O.value]).filter((se,pe)=>U.value.length+1+pe<=L.value||L.value===-1));break}E.value&&F()}},St=$=>{J($[D.value])===void 0&&q.value&&(n.emit("tag",$[D.value],_),n.emit("option",$[D.value],_),ce.value&&Ie($),Z())},Bn=()=>{t.value!=="single"&&Ce(Le.value)},Ft=$=>$.find(se=>!It(se)&&!se[O.value])===void 0,_e=$=>$.find(se=>!It(se))===void 0,J=$=>le.value[le.value.map(se=>String(se[D.value])).indexOf(String($))],Ne=($,se=!0)=>le.value.map(pe=>parseInt(pe[re.value])==pe[re.value]?parseInt(pe[re.value]):pe[re.value]).indexOf(parseInt($)==$?parseInt($):$),fe=$=>["tags","multiple"].indexOf(t.value)!==-1&&s.value&&It($),Ie=$=>{oe.value.push($)},ze=$=>b.value?$.filter(se=>B.value?se.__VISIBLE__.length:se[k.value].length):$.filter(se=>B.value?se.__VISIBLE__.length:!0),$t=($,se=!0)=>{let pe=$;return B.value&&z.value&&(pe=pe.filter(ne=>Q.value?ba(ne[re.value],w.value).startsWith(ba(B.value,w.value)):ba(ne[re.value],w.value).indexOf(ba(B.value,w.value))!==-1)),s.value&&se&&(pe=pe.filter(ne=>!fe(ne))),pe},At=$=>{let se=$;return Pv(se)&&(se=Object.keys(se).map(pe=>{let ne=se[pe];return{[D.value]:pe,[re.value]:ne,[M.value]:ne}})),se=se.map(pe=>typeof pe=="object"?pe:{[D.value]:pe,[re.value]:pe,[M.value]:pe}),se},cn=()=>{on(Y.value)||(U.value=Dn(Y.value))},Mn=$=>(ae.value=!0,new Promise((se,pe)=>{r.value(B.value,_).then(ne=>{ee.value=ne||[],typeof $=="function"&&$(ne),ae.value=!1}).catch(ne=>{console.error(ne),ee.value=[],ae.value=!1}).finally(()=>{se()})})),pn=()=>{if(H.value)if(t.value==="single"){let $=J(U.value[D.value]);if($!==void 0){let se=$[M.value];U.value[M.value]=se,j.value&&(Y.value[M.value]=se)}}else U.value.forEach(($,se)=>{let pe=J(U.value[se][D.value]);if(pe!==void 0){let ne=pe[M.value];U.value[se][M.value]=ne,j.value&&(Y.value[se][M.value]=ne)}})},si=$=>{Mn($)},Dn=$=>on($)?t.value==="single"?{}:[]:j.value?$:t.value==="single"?J($)||{}:$.filter(se=>!!J(se)).map(se=>J(se)),lr=()=>{ge.value=l.watch(B,$=>{$.length<h.value||!$&&h.value!==0||(ae.value=!0,m.value&&(ee.value=[]),setTimeout(()=>{$==B.value&&r.value(B.value,_).then(se=>{($==B.value||!B.value)&&(ee.value=se,R.value=Le.value.filter(pe=>pe[O.value]!==!0)[0]||null,ae.value=!1)}).catch(se=>{console.error(se)})},x.value))},{flush:"sync"})};if(t.value!=="single"&&!on(Y.value)&&!Array.isArray(Y.value))throw new Error(`v-model must be an array when using "${t.value}" mode`);return r&&typeof r.value=="function"?N.value?Mn(cn):j.value==!0&&cn():(ee.value=r.value,cn()),x.value>-1&&lr(),l.watch(x,($,se)=>{ge.value&&ge.value(),$>=0&&lr()}),l.watch(Y,$=>{if(on($)){U.value=Dn($);return}switch(t.value){case"single":(j.value?$[D.value]!=U.value[D.value]:$!=U.value[D.value])&&(U.value=Dn($));break;case"multiple":case"tags":Rv(j.value?$.map(se=>se[D.value]):$,U.value.map(se=>se[D.value]))||(U.value=Dn($));break}},{deep:!0}),l.watch(r,($,se)=>{typeof i.options=="function"?N.value&&(!se||$&&$.toString()!==se.toString())&&Mn():(ee.value=i.options,Object.keys(U.value).length||cn(),pn())}),l.watch(M,pn),{pfo:Ee,fo:Le,filteredOptions:Le,hasSelected:H,multipleLabelText:K,eo:le,extendedOptions:le,fg:he,filteredGroups:he,noOptions:ie,noResults:ue,resolving:ae,busy:Ue,offset:V,select:Ce,deselect:ot,remove:un,selectAll:Bn,clear:Ht,isSelected:It,isDisabled:ft,isMax:ln,getOption:J,handleOptionClick:Ct,handleGroupClick:ai,handleTagRemove:In,refreshOptions:si,resolveOptions:Mn,refreshLabels:pn}}function Vv(i,n,e){const{valueProp:r,showOptions:t,searchable:o,groupLabel:a,groups:s,mode:u,groupSelect:c,disabledProp:M}=l.toRefs(i),d=e.fo,g=e.fg,f=e.handleOptionClick,j=e.handleGroupClick,p=e.search,x=e.pointer,N=e.setPointer,h=e.clearPointer,z=e.multiselect,m=e.isOpen,I=l.computed(()=>d.value.filter(P=>!P[M.value])),D=l.computed(()=>g.value.filter(P=>!P[M.value])),v=l.computed(()=>u.value!=="single"&&c.value),L=l.computed(()=>x.value&&x.value.group),w=l.computed(()=>B(x.value)),E=l.computed(()=>{const P=L.value?x.value:B(x.value),R=D.value.map(W=>W[a.value]).indexOf(P[a.value]);let G=D.value[R-1];return G===void 0&&(G=y.value),G}),T=l.computed(()=>{let P=D.value.map(R=>R.label).indexOf(L.value?x.value[a.value]:B(x.value)[a.value])+1;return D.value.length<=P&&(P=0),D.value[P]}),y=l.computed(()=>[...D.value].slice(-1)[0]),A=l.computed(()=>x.value.__VISIBLE__.filter(P=>!P[M.value])[0]),k=l.computed(()=>{const P=w.value.__VISIBLE__.filter(R=>!R[M.value]);return P[P.map(R=>R[r.value]).indexOf(x.value[r.value])-1]}),b=l.computed(()=>{const P=B(x.value).__VISIBLE__.filter(R=>!R[M.value]);return P[P.map(R=>R[r.value]).indexOf(x.value[r.value])+1]}),C=l.computed(()=>[...E.value.__VISIBLE__.filter(P=>!P[M.value])].slice(-1)[0]),S=l.computed(()=>[...y.value.__VISIBLE__.filter(P=>!P[M.value])].slice(-1)[0]),O=P=>x.value&&(!P.group&&x.value[r.value]==P[r.value]||P.group!==void 0&&x.value[a.value]==P[a.value])?!0:void 0,Q=()=>{N(I.value[0]||null)},_=()=>{!x.value||x.value[M.value]===!0||(L.value?j(x.value):f(x.value))},U=()=>{if(x.value===null)N((s.value&&v.value?D.value[0]:I.value[0])||null);else if(s.value&&v.value){let P=L.value?A.value:b.value;P===void 0&&(P=T.value),N(P||null)}else{let P=I.value.map(R=>R[r.value]).indexOf(x.value[r.value])+1;I.value.length<=P&&(P=0),N(I.value[P]||null)}l.nextTick(()=>{Z()})},Y=()=>{if(x.value===null){let P=I.value[I.value.length-1];s.value&&v.value&&(P=S.value,P===void 0&&(P=y.value)),N(P||null)}else if(s.value&&v.value){let P=L.value?C.value:k.value;P===void 0&&(P=L.value?E.value:w.value),N(P||null)}else{let P=I.value.map(R=>R[r.value]).indexOf(x.value[r.value])-1;P<0&&(P=I.value.length-1),N(I.value[P]||null)}l.nextTick(()=>{Z()})},B=P=>D.value.find(R=>R.__VISIBLE__.map(G=>G[r.value]).indexOf(P[r.value])!==-1),Z=()=>{let P=z.value.querySelector("[data-pointed]");if(!P)return;let R=P.parentElement.parentElement;s.value&&(R=L.value?P.parentElement.parentElement.parentElement:P.parentElement.parentElement.parentElement.parentElement),P.offsetTop+P.offsetHeight>R.clientHeight+R.scrollTop&&(R.scrollTop=P.offsetTop+P.offsetHeight-R.clientHeight),P.offsetTop<R.scrollTop&&(R.scrollTop=P.offsetTop)};return l.watch(p,P=>{o.value&&(P.length&&t.value?Q():h())}),l.watch(m,P=>{if(P){let R=z.value.querySelectorAll("[data-selected]")[0];if(!R)return;let G=R.parentElement.parentElement;l.nextTick(()=>{G.scrollTop>0||(G.scrollTop=R.offsetTop)})}}),{pointer:x,canPointGroups:v,isPointed:O,setPointerFirst:Q,selectPointer:_,forwardPointer:U,backwardPointer:Y}}function Gv(i,n,e){const{disabled:r}=l.toRefs(i),t=l.getCurrentInstance().proxy,o=l.ref(!1);return{isOpen:o,open:()=>{o.value||r.value||(o.value=!0,n.emit("open",t))},close:()=>{o.value&&(o.value=!1,n.emit("close",t))}}}function Wv(i,n,e){const{searchable:r,disabled:t}=l.toRefs(i),o=e.input,a=e.open,s=e.close,u=e.clearSearch,c=e.isOpen,M=l.ref(null),d=l.ref(null),g=l.ref(null),f=l.ref(!1),j=l.ref(!1),p=l.computed(()=>r.value||t.value?-1:0),x=()=>{r.value&&o.value.blur(),d.value.blur()},N=()=>{r.value&&!t.value&&o.value.focus()},h=(L=!0)=>{t.value||(f.value=!0,L&&a())},z=()=>{f.value=!1,setTimeout(()=>{f.value||(s(),u())},1)};return{multiselect:M,wrapper:d,tags:g,tabindex:p,isActive:f,mouseClicked:j,blur:x,focus:N,activate:h,deactivate:z,handleFocusIn:L=>{L.target.closest("[data-tags]")||L.target.closest("[data-clear]")||h(j.value)},handleFocusOut:()=>{z()},handleCaretClick:()=>{z(),x()},handleMousedown:L=>{j.value=!0,c.value&&(L.target.isEqualNode(d.value)||L.target.isEqualNode(g.value))?setTimeout(()=>{z()},0):document.activeElement.isEqualNode(d.value)&&!c.value&&(console.log(L.target.closest("[data-tags]")),h()),setTimeout(()=>{j.value=!1},0)}}}function Hv(i,n,e){const{mode:r,addTagOn:t,openDirection:o,searchable:a,showOptions:s,valueProp:u,groups:c,addOptionOn:M,createTag:d,createOption:g,reverse:f}=l.toRefs(i),j=l.getCurrentInstance().proxy,p=e.iv,x=e.update,N=e.search,h=e.setPointer,z=e.selectPointer,m=e.backwardPointer,I=e.forwardPointer,D=e.multiselect,v=e.wrapper,L=e.tags,w=e.isOpen,E=e.open,T=e.blur,y=e.fo,A=l.computed(()=>d.value||g.value||!1),k=l.computed(()=>t.value!==void 0?t.value:M.value!==void 0?M.value:["enter"]),b=()=>{r.value==="tags"&&!s.value&&A.value&&a.value&&!c.value&&h(y.value[y.value.map(O=>O[u.value]).indexOf(N.value)])};return{handleKeydown:O=>{n.emit("keydown",O,j);let Q,_;switch(["ArrowLeft","ArrowRight","Enter"].indexOf(O.key)!==-1&&r.value==="tags"&&(Q=[...D.value.querySelectorAll("[data-tags] > *")].filter(U=>U!==L.value),_=Q.findIndex(U=>U===document.activeElement)),O.key){case"Backspace":if(r.value==="single"||a.value&&[null,""].indexOf(N.value)===-1||p.value.length===0)return;x([...p.value].slice(0,-1));break;case"Enter":if(O.preventDefault(),O.keyCode===229)return;if(_!==-1&&_!==void 0){x([...p.value].filter((U,Y)=>Y!==_)),_===Q.length-1&&(Q.length-1?Q[Q.length-2].focus():a.value?L.value.querySelector("input").focus():v.value.focus());return}if(k.value.indexOf("enter")===-1&&A.value)return;b(),z();break;case" ":if(!A.value&&!a.value){O.preventDefault(),b(),z();return}if(!A.value)return!1;if(k.value.indexOf("space")===-1&&A.value)return;O.preventDefault(),b(),z();break;case"Tab":case";":case",":if(k.value.indexOf(O.key.toLowerCase())===-1||!A.value)return;b(),z(),O.preventDefault();break;case"Escape":T();break;case"ArrowUp":if(O.preventDefault(),!s.value)return;w.value||E(),m();break;case"ArrowDown":if(O.preventDefault(),!s.value)return;w.value||E(),I();break;case"ArrowLeft":if(a.value&&L.value&&L.value.querySelector("input").selectionStart||O.shiftKey||r.value!=="tags"||!p.value||!p.value.length)return;O.preventDefault(),_===-1?Q[Q.length-1].focus():_>0&&Q[_-1].focus();break;case"ArrowRight":if(_===-1||O.shiftKey||r.value!=="tags"||!p.value||!p.value.length)return;O.preventDefault(),Q.length>_+1?Q[_+1].focus():a.value?L.value.querySelector("input").focus():a.value||v.value.focus();break}},handleKeyup:O=>{n.emit("keyup",O,j)},preparePointer:b}}function Fv(i,n,e){const{classes:r,disabled:t,openDirection:o,showOptions:a}=l.toRefs(i),s=e.isOpen,u=e.isPointed,c=e.isSelected,M=e.isDisabled,d=e.isActive,g=e.canPointGroups,f=e.resolving,j=e.fo,p=l.computed(()=>({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",wrapper:"multiselect-wrapper",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",inifinite:"multiselect-inifite",inifiniteSpinner:"multiselect-inifite-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",assist:"multiselect-assistive-text",spacer:"multiselect-spacer",...r.value})),x=l.computed(()=>!!(s.value&&a.value&&(!f.value||f.value&&j.value.length)));return{classList:l.computed(()=>{const h=p.value;return{container:[h.container].concat(t.value?h.containerDisabled:[]).concat(x.value&&o.value==="top"?h.containerOpenTop:[]).concat(x.value&&o.value!=="top"?h.containerOpen:[]).concat(d.value?h.containerActive:[]),wrapper:h.wrapper,spacer:h.spacer,singleLabel:h.singleLabel,singleLabelText:h.singleLabelText,multipleLabel:h.multipleLabel,search:h.search,tags:h.tags,tag:[h.tag].concat(t.value?h.tagDisabled:[]),tagRemove:h.tagRemove,tagRemoveIcon:h.tagRemoveIcon,tagsSearchWrapper:h.tagsSearchWrapper,tagsSearch:h.tagsSearch,tagsSearchCopy:h.tagsSearchCopy,placeholder:h.placeholder,caret:[h.caret].concat(s.value?h.caretOpen:[]),clear:h.clear,clearIcon:h.clearIcon,spinner:h.spinner,inifinite:h.inifinite,inifiniteSpinner:h.inifiniteSpinner,dropdown:[h.dropdown].concat(o.value==="top"?h.dropdownTop:[]).concat(!s.value||!a.value||!x.value?h.dropdownHidden:[]),options:[h.options].concat(o.value==="top"?h.optionsTop:[]),group:h.group,groupLabel:z=>{let m=[h.groupLabel];return u(z)?m.push(c(z)?h.groupLabelSelectedPointed:h.groupLabelPointed):c(z)&&g.value?m.push(M(z)?h.groupLabelSelectedDisabled:h.groupLabelSelected):M(z)&&m.push(h.groupLabelDisabled),g.value&&m.push(h.groupLabelPointable),m},groupOptions:h.groupOptions,option:(z,m)=>{let I=[h.option];return u(z)?I.push(c(z)?h.optionSelectedPointed:h.optionPointed):c(z)?I.push(M(z)?h.optionSelectedDisabled:h.optionSelected):(M(z)||m&&M(m))&&I.push(h.optionDisabled),I},noOptions:h.noOptions,noResults:h.noResults,assist:h.assist,fakeInput:h.fakeInput}}),showDropdown:x}}function $v(i,n,e){const{limit:r,infinite:t}=l.toRefs(i),o=e.isOpen,a=e.offset,s=e.search,u=e.pfo,c=e.eo,M=l.ref(null),d=l.ref(null),g=l.computed(()=>a.value<u.value.length),f=p=>{const{isIntersecting:x,target:N}=p[0];if(x){const h=N.offsetParent,z=h.scrollTop;a.value+=r.value==-1?10:r.value,l.nextTick(()=>{h.scrollTop=z})}},j=()=>{o.value&&a.value<u.value.length?M.value.observe(d.value):!o.value&&M.value&&M.value.disconnect()};return l.watch(o,()=>{t.value&&j()}),l.watch(s,()=>{t.value&&(a.value=r.value,j())},{flush:"post"}),l.watch(c,()=>{t.value&&j()},{immediate:!1,flush:"post"}),l.onMounted(()=>{window&&window.IntersectionObserver&&(M.value=new IntersectionObserver(f))}),{hasMore:g,infiniteLoader:d}}function Jv(i,n,e){const{placeholder:r,id:t,valueProp:o,label:a,mode:s,groupLabel:u,aria:c,searchable:M}=l.toRefs(i),d=e.pointer,g=e.iv,f=e.hasSelected,j=e.multipleLabelText,p=l.ref(null),x=l.computed(()=>{let y=[];return t&&t.value&&y.push(t.value),y.push("assist"),y.join("-")}),N=l.computed(()=>{let y=[];return t&&t.value&&y.push(t.value),y.push("multiselect-options"),y.join("-")}),h=l.computed(()=>{let y=[];if(t&&t.value&&y.push(t.value),d.value)return y.push(d.value.group?"multiselect-group":"multiselect-option"),y.push(d.value.group?d.value.index:d.value[o.value]),y.join("-")}),z=l.computed(()=>r.value),m=l.computed(()=>s.value!=="single"),I=l.computed(()=>{let y="";return s.value==="single"&&f.value&&(y+=g.value[a.value]),s.value==="multiple"&&f.value&&(y+=j.value),s.value==="tags"&&f.value&&(y+=g.value.map(A=>A[a.value]).join(", ")),y}),D=l.computed(()=>{let y={...c.value};return M.value&&(y["aria-labelledby"]=y["aria-labelledby"]?`${x.value} ${y["aria-labelledby"]}`:x.value,I.value&&y["aria-label"]&&(y["aria-label"]=`${I.value}, ${y["aria-label"]}`)),y}),v=y=>{let A=[];return t&&t.value&&A.push(t.value),A.push("multiselect-option"),A.push(y[o.value]),A.join("-")},L=y=>{let A=[];return t&&t.value&&A.push(t.value),A.push("multiselect-group"),A.push(y.index),A.join("-")},w=y=>{let A=[];return A.push(y[a.value]),A.join(" ")},E=y=>{let A=[];return A.push(y[u.value]),A.join(" ")},T=y=>`${y} ❎`;return l.onMounted(()=>{if(t&&t.value&&document&&document.querySelector){let y=document.querySelector(`[for="${t.value}"]`);p.value=y?y.innerText:null}}),{arias:D,ariaLabel:I,ariaAssist:x,ariaControls:N,ariaPlaceholder:z,ariaMultiselectable:m,ariaActiveDescendant:h,ariaOptionId:v,ariaOptionLabel:w,ariaGroupId:L,ariaGroupLabel:E,ariaTagLabel:T}}function Xv(i,n,e,r={}){return e.forEach(t=>{t&&(r={...r,...t(i,n,r)})}),r}var zl={name:"Multiselect",emits:["paste","open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear","keydown","keyup"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:void 0},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:Object,default:()=>({})},onCreate:{required:!1,type:Function},disabledProp:{type:String,required:!1,default:"disabled"},searchStart:{type:Boolean,required:!1,default:!1},reverse:{type:Boolean,required:!1,default:!1},regex:{type:[Object,String,RegExp],required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},infinite:{type:Boolean,required:!1,default:!1},aria:{required:!1,type:Object,default:()=>({})}},setup(i,n){return Xv(i,n,[Uv,Bv,Gv,_v,Yv,Wv,Zv,$v,Vv,Hv,Fv,Jv])}};const Kv=["id","dir"],qv=["tabindex","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable","role"],ek=["type","modelValue","value","autocomplete","id","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],tk=["onKeyup","aria-label"],nk=["onClick"],ik=["type","modelValue","value","id","autocomplete","aria-controls","aria-placeholder","aria-expanded","aria-activedescendant","aria-multiselectable"],rk=["innerHTML"],ok=["id"],ak=["id","aria-label","aria-selected"],sk=["data-pointed","onMouseenter","onClick"],uk=["innerHTML"],lk=["aria-label"],ck=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],Mk=["data-pointed","data-selected","onMouseenter","onClick","id","aria-selected","aria-label"],dk=["innerHTML"],gk=["innerHTML"],fk=["value"],yk=["name","value"],Nk=["name","value"],jk=["id"];function hk(i,n,e,r,t,o){return l.openBlock(),l.createElementBlock("div",{ref:"multiselect",class:l.normalizeClass(i.classList.container),id:e.searchable?void 0:e.id,dir:e.rtl?"rtl":void 0,onFocusin:n[10]||(n[10]=(...a)=>i.handleFocusIn&&i.handleFocusIn(...a)),onFocusout:n[11]||(n[11]=(...a)=>i.handleFocusOut&&i.handleFocusOut(...a)),onKeyup:n[12]||(n[12]=(...a)=>i.handleKeyup&&i.handleKeyup(...a)),onKeydown:n[13]||(n[13]=(...a)=>i.handleKeydown&&i.handleKeydown(...a))},[l.createElementVNode("div",l.mergeProps({class:i.classList.wrapper,onMousedown:n[9]||(n[9]=(...a)=>i.handleMousedown&&i.handleMousedown(...a)),ref:"wrapper",tabindex:i.tabindex,"aria-controls":e.searchable?void 0:i.ariaControls,"aria-placeholder":e.searchable?void 0:i.ariaPlaceholder,"aria-expanded":e.searchable?void 0:i.isOpen,"aria-activedescendant":e.searchable?void 0:i.ariaActiveDescendant,"aria-multiselectable":e.searchable?void 0:i.ariaMultiselectable,role:e.searchable?void 0:"combobox"},e.searchable?{}:i.arias),[l.createCommentVNode(" Search "),e.mode!=="tags"&&e.searchable&&!e.disabled?(l.openBlock(),l.createElementBlock("input",l.mergeProps({key:0,type:e.inputType,modelValue:i.search,value:i.search,class:i.classList.search,autocomplete:e.autocomplete,id:e.searchable?e.id:void 0,onInput:n[0]||(n[0]=(...a)=>i.handleSearchInput&&i.handleSearchInput(...a)),onKeypress:n[1]||(n[1]=(...a)=>i.handleKeypress&&i.handleKeypress(...a)),onPaste:n[2]||(n[2]=l.withModifiers((...a)=>i.handlePaste&&i.handlePaste(...a),["stop"])),ref:"input","aria-controls":i.ariaControls,"aria-placeholder":i.ariaPlaceholder,"aria-expanded":i.isOpen,"aria-activedescendant":i.ariaActiveDescendant,"aria-multiselectable":i.ariaMultiselectable,role:"combobox"},{...e.attrs,...i.arias}),null,16,ek)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Tags (with search) "),e.mode=="tags"?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(i.classList.tags),"data-tags":""},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.iv,(a,s,u)=>l.renderSlot(i.$slots,"tag",{option:a,handleTagRemove:i.handleTagRemove,disabled:e.disabled},()=>[(l.openBlock(),l.createElementBlock("span",{class:l.normalizeClass(i.classList.tag),tabindex:"-1",onKeyup:l.withKeys(c=>i.handleTagRemove(a,c),["enter"]),key:u,"aria-label":i.ariaTagLabel(a[e.label])},[l.createTextVNode(l.toDisplayString(a[e.label])+" ",1),e.disabled?l.createCommentVNode("v-if",!0):(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(i.classList.tagRemove),onClick:c=>i.handleTagRemove(a,c)},[l.createElementVNode("span",{class:l.normalizeClass(i.classList.tagRemoveIcon)},null,2)],10,nk))],42,tk))])),256)),l.createElementVNode("div",{class:l.normalizeClass(i.classList.tagsSearchWrapper),ref:"tags"},[l.createCommentVNode(" Used for measuring search width "),l.createElementVNode("span",{class:l.normalizeClass(i.classList.tagsSearchCopy)},l.toDisplayString(i.search),3),l.createCommentVNode(" Actual search input "),e.searchable&&!e.disabled?(l.openBlock(),l.createElementBlock("input",l.mergeProps({key:0,type:e.inputType,modelValue:i.search,value:i.search,class:i.classList.tagsSearch,id:e.searchable?e.id:void 0,autocomplete:e.autocomplete,onInput:n[3]||(n[3]=(...a)=>i.handleSearchInput&&i.handleSearchInput(...a)),onKeypress:n[4]||(n[4]=(...a)=>i.handleKeypress&&i.handleKeypress(...a)),onPaste:n[5]||(n[5]=l.withModifiers((...a)=>i.handlePaste&&i.handlePaste(...a),["stop"])),ref:"input","aria-controls":i.ariaControls,"aria-placeholder":i.ariaPlaceholder,"aria-expanded":i.isOpen,"aria-activedescendant":i.ariaActiveDescendant,"aria-multiselectable":i.ariaMultiselectable,role:"combobox"},{...e.attrs,...i.arias}),null,16,ik)):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Single label "),e.mode=="single"&&i.hasSelected&&!i.search&&i.iv?l.renderSlot(i.$slots,"singlelabel",{key:2,value:i.iv},()=>[l.createElementVNode("div",{class:l.normalizeClass(i.classList.singleLabel)},[l.createElementVNode("span",{class:l.normalizeClass(i.classList.singleLabelText)},l.toDisplayString(i.iv[e.label]),3)],2)]):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Multiple label "),e.mode=="multiple"&&i.hasSelected&&!i.search?l.renderSlot(i.$slots,"multiplelabel",{key:3,values:i.iv},()=>[l.createElementVNode("div",{class:l.normalizeClass(i.classList.multipleLabel),innerHTML:i.multipleLabelText},null,10,rk)]):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Placeholder "),e.placeholder&&!i.hasSelected&&!i.search?l.renderSlot(i.$slots,"placeholder",{key:4},()=>[l.createElementVNode("div",{class:l.normalizeClass(i.classList.placeholder),"aria-hidden":"true"},l.toDisplayString(e.placeholder),3)]):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Spinner "),e.loading||i.resolving?l.renderSlot(i.$slots,"spinner",{key:5},()=>[l.createElementVNode("span",{class:l.normalizeClass(i.classList.spinner),"aria-hidden":"true"},null,2)]):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Clear "),i.hasSelected&&!e.disabled&&e.canClear&&!i.busy?l.renderSlot(i.$slots,"clear",{key:6,clear:i.clear},()=>[l.createElementVNode("span",{"aria-hidden":"true",tabindex:"0",role:"button","data-clear":"","aria-roledescription":"❎",class:l.normalizeClass(i.classList.clear),onClick:n[6]||(n[6]=(...a)=>i.clear&&i.clear(...a)),onKeyup:n[7]||(n[7]=l.withKeys((...a)=>i.clear&&i.clear(...a),["enter"]))},[l.createElementVNode("span",{class:l.normalizeClass(i.classList.clearIcon)},null,2)],34)]):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Caret "),e.caret&&e.showOptions?l.renderSlot(i.$slots,"caret",{key:7},()=>[l.createElementVNode("span",{class:l.normalizeClass(i.classList.caret),onClick:n[8]||(n[8]=(...a)=>i.handleCaretClick&&i.handleCaretClick(...a)),"aria-hidden":"true"},null,2)]):l.createCommentVNode("v-if",!0)],16,qv),l.createCommentVNode(" Options "),l.createElementVNode("div",{class:l.normalizeClass(i.classList.dropdown),tabindex:"-1"},[l.renderSlot(i.$slots,"beforelist",{options:i.fo}),l.createElementVNode("ul",{class:l.normalizeClass(i.classList.options),id:i.ariaControls,role:"listbox"},[e.groups?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(i.fg,(a,s,u)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(i.classList.group),key:u,id:i.ariaGroupId(a),"aria-label":i.ariaGroupLabel(a),"aria-selected":i.isSelected(a),role:"option"},[l.createElementVNode("div",{class:l.normalizeClass(i.classList.groupLabel(a)),"data-pointed":i.isPointed(a),onMouseenter:c=>i.setPointer(a,s),onClick:c=>i.handleGroupClick(a)},[l.renderSlot(i.$slots,"grouplabel",{group:a,isSelected:i.isSelected,isPointed:i.isPointed},()=>[l.createElementVNode("span",{innerHTML:a[e.groupLabel]},null,8,uk)])],42,sk),l.createElementVNode("ul",{class:l.normalizeClass(i.classList.groupOptions),"aria-label":i.ariaGroupLabel(a),role:"group"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(a.__VISIBLE__,(c,M,d)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(i.classList.option(c,a)),"data-pointed":i.isPointed(c),"data-selected":i.isSelected(c)||void 0,key:d,onMouseenter:g=>i.setPointer(c),onClick:g=>i.handleOptionClick(c),id:i.ariaOptionId(c),"aria-selected":i.isSelected(c),"aria-label":i.ariaOptionLabel(c),role:"option"},[l.renderSlot(i.$slots,"option",{option:c,isSelected:i.isSelected,isPointed:i.isPointed,search:i.search},()=>[l.createElementVNode("span",null,l.toDisplayString(c[e.label]),1)])],42,ck))),128))],10,lk)],10,ak))),128)):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(i.fo,(a,s,u)=>(l.openBlock(),l.createElementBlock("li",{class:l.normalizeClass(i.classList.option(a)),"data-pointed":i.isPointed(a),"data-selected":i.isSelected(a)||void 0,key:u,onMouseenter:c=>i.setPointer(a),onClick:c=>i.handleOptionClick(a),id:i.ariaOptionId(a),"aria-selected":i.isSelected(a),"aria-label":i.ariaOptionLabel(a),role:"option"},[l.renderSlot(i.$slots,"option",{option:a,isSelected:i.isSelected,isPointed:i.isPointed,search:i.search},()=>[l.createElementVNode("span",null,l.toDisplayString(a[e.label]),1)])],42,Mk))),128))],10,ok),i.noOptions?l.renderSlot(i.$slots,"nooptions",{key:0},()=>[l.createElementVNode("div",{class:l.normalizeClass(i.classList.noOptions),innerHTML:e.noOptionsText},null,10,dk)]):l.createCommentVNode("v-if",!0),i.noResults?l.renderSlot(i.$slots,"noresults",{key:1},()=>[l.createElementVNode("div",{class:l.normalizeClass(i.classList.noResults),innerHTML:e.noResultsText},null,10,gk)]):l.createCommentVNode("v-if",!0),e.infinite&&i.hasMore?(l.openBlock(),l.createElementBlock("div",{key:2,class:l.normalizeClass(i.classList.inifinite),ref:"infiniteLoader"},[l.renderSlot(i.$slots,"infinite",{},()=>[l.createElementVNode("span",{class:l.normalizeClass(i.classList.inifiniteSpinner)},null,2)])],2)):l.createCommentVNode("v-if",!0),l.renderSlot(i.$slots,"afterlist",{options:i.fo})],2),l.createCommentVNode(" Hacky input element to show HTML5 required warning "),e.required?(l.openBlock(),l.createElementBlock("input",{key:0,class:l.normalizeClass(i.classList.fakeInput),tabindex:"-1",value:i.textValue,required:""},null,10,fk)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Native input support "),e.nativeSupport?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[e.mode=="single"?(l.openBlock(),l.createElementBlock("input",{key:0,type:"hidden",name:e.name,value:i.plainValue!==void 0?i.plainValue:""},null,8,yk)):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(i.plainValue,(a,s)=>(l.openBlock(),l.createElementBlock("input",{type:"hidden",name:`${e.name}[]`,value:a,key:s},null,8,Nk))),128))],64)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Screen reader assistive text "),e.searchable&&i.hasSelected?(l.openBlock(),l.createElementBlock("div",{key:2,class:l.normalizeClass(i.classList.assist),id:i.ariaAssist,"aria-hidden":"true"},l.toDisplayString(i.ariaLabel),11,jk)):l.createCommentVNode("v-if",!0),l.createCommentVNode(" Create height for empty input "),l.createElementVNode("div",{class:l.normalizeClass(i.classList.spacer)},null,2)],42,Kv)}zl.render=hk,zl.__file="src/Multiselect.vue";const uO="",lO="",Ik=l.createElementVNode("img",{alt:"",class:"list__item_thumb",src:Qv},null,-1),pk={class:"list__item_text"},Dk={__name:"InputList",props:{list:{type:Array,required:!0},maxHeight:{type:String,default:"200px"},labelProp:{type:String,default:"label"},valueProp:{type:String,default:"id"},canClear:{type:Boolean,required:!1,default:!0},placeholder:{type:String,required:!1,default:"Start typing..."},modelValue:{type:[Object,Array],required:!1,default:null}},emits:["update","select","deselect","clear"],setup(i,{emit:n}){const e=i;l.useCssVars(u=>({"0e8a9c62":i.maxHeight}));const r=l.computed({get(){return e.modelValue},set(){}});function t(u){n("select",u)}function o(u){n("deselect",u)}function a(u){n("update",u)}function s(){n("clear")}return(u,c)=>(l.openBlock(),l.createBlock(l.unref(zl),{modelValue:l.unref(r),"onUpdate:modelValue":c[0]||(c[0]=M=>l.isRef(r)?r.value=M:null),"can-clear":e.canClear,label:i.labelProp,mode:"tags",native:!1,object:!0,options:i.list,placeholder:e.placeholder,searchable:!0,"value-prop":i.valueProp,onChange:c[1]||(c[1]=M=>a(M)),onClear:c[2]||(c[2]=M=>s()),onDeselect:c[3]||(c[3]=M=>o(M)),onSelect:c[4]||(c[4]=M=>t(M))},{tag:l.withCtx(({option:M,handleTagRemove:d,disabled:g})=>[l.createElementVNode("div",{class:l.normalizeClass(["list__item",{"is-disabled":g}])},[Ik,l.createElementVNode("p",pk,l.toDisplayString(M[i.labelProp]),1),l.createVNode(me,{class:"list__item_icon","icon-name":"delete",size:24,onMousedown:l.withModifiers(f=>d(M,f),["prevent"])},null,8,["onMousedown"]),l.renderSlot(u.$slots,"default")],2)]),_:3},8,["modelValue","can-clear","label","options","placeholder","value-prop"]))}},mk=l.defineComponent({components:{DhIcon:me},props:{hasCloseButton:{type:Boolean,default:!0},hasSideBar:{type:Boolean,default:!0},hasSideBarButtonBottom:{type:Boolean,default:!0},hasHeader:{type:Boolean,default:!0},hasFooter:{type:Boolean,default:!0},hasFooterButtonRight:{type:Boolean,default:!0},hasBodyScrolling:{type:Boolean,default:!0},sideBarPosition:{type:String,default:"left"},hasCloseConfirmation:{type:Boolean,default:!1},bodyClass:{type:String,default:""},fitContent:{type:Boolean,default:!1}},emits:["close"],mounted(){document.body.classList.add("modal-open")},unmounted(){document.body.classList.remove("modal-open")},methods:{closed(){this.$emit("close",this.hasCloseConfirmation),document.body.classList.remove("modal-open")}}}),zk={class:"modal-content"},xk={key:0,id:"modal-sidebar",class:"modal-sidebar"},Ak={key:0,id:"modalTitle",class:"modal-header"},Tk={class:"modal-footer"};function Lk(i,n,e,r,t,o){const a=l.resolveComponent("dh-icon");return l.openBlock(),l.createBlock(l.Transition,{name:"modal-fade"},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"modal-backdrop",onMousedown:n[2]||(n[2]=(...s)=>i.closed&&i.closed(...s))},[l.createElementVNode("div",{"aria-describedby":"modalDescription","aria-labelledby":"modalTitle",class:l.normalizeClass(`
|
|
20
20
|
${i.hasSideBar?i.sideBarPosition:""}
|
|
21
21
|
${i.hasBodyScrolling?"":"modal-auto-height"}
|
|
22
22
|
${i.fitContent?"modal modal-fit-content":"modal"}
|