oziko-ui-kit 0.0.136 → 0.0.137

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/index.mjs CHANGED
@@ -46,7 +46,7 @@ function(e,t){const n=ro(e,t);return"production"!==process.env.NODE_ENV?(...t)=>
46
46
  * https://www.chartjs.org
47
47
  * (c) 2024 Chart.js Contributors
48
48
  * Released under the MIT License
49
- */class Vu{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){const o=t.listeners[r],i=t.duration;o.forEach((r=>r({chart:e,initial:t.initial,numSteps:i,currentStep:Math.min(n-t.start,i)})))}_refresh(){this._request||(this._running=!0,this._request=tc.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(e=Date.now()){let t=0;this._charts.forEach(((n,r)=>{if(!n.running||!n.items.length)return;const o=n.items;let i,a=o.length-1,s=!1;for(;a>=0;--a)i=o[a],i._active?(i._total>n.duration&&(n.duration=i._total),i.tick(e),s=!0):(o[a]=o[o.length-1],o.pop());s&&(r.draw(),this._notify(r,n,e,"progress")),o.length||(n.running=!1,this._notify(r,n,e,"complete"),n.initial=!1),t+=o.length})),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce(((e,t)=>Math.max(e,t._duration)),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const n=t.items;let r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Yu=new Vu;const Xu="transparent",qu={boolean:(e,t,n)=>n>.5?t:e,color(e,t,n){const r=hc(e||Xu),o=r.valid&&hc(t||Xu);return o&&o.valid?o.mix(r,n).hexString():t},number:(e,t,n)=>e+(t-e)*n};class Uu{constructor(e,t,n,r){const o=t[n];r=Gc([e.to,r,o,e.from]);const i=Gc([e.from,o,r]);this._active=!0,this._fn=e.fn||qu[e.type||typeof i],this._easing=uc[e.easing]||uc.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const r=this._target[this._prop],o=n-this._start,i=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(i,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=Gc([e.to,t,r,e.from]),this._from=Gc([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,r=this._prop,o=this._from,i=this._loop,a=this._to;let s;if(this._active=o!==a&&(i||t<n),!this._active)return this._target[r]=a,void this._notify(!0);t<0?this._target[r]=o:(s=t/n%2,s=i&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(o,a,s))}wait(){const e=this._promises||(this._promises=[]);return new Promise(((t,n)=>{e.push({res:t,rej:n})}))}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}}class Zu{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!il(e))return;const t=Object.keys(Cc.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach((r=>{const o=e[r];if(!il(o))return;const i={};for(const e of t)i[e]=o[e];(ol(o.properties)&&o.properties||[r]).forEach((e=>{e!==r&&n.has(e)||n.set(e,i)}))}))}_animateOptions(e,t){const n=t.options,r=function(e,t){if(!t)return;let n=e.options;if(!n)return void(e.options=t);n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(e,n);if(!r)return[];const o=this._createAnimations(r,n);return n.$shared&&function(e,t){const n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){const o=e[r[t]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}(e.options.$animations,n).then((()=>{e.options=n}),(()=>{})),o}_createAnimations(e,t){const n=this._properties,r=[],o=e.$animations||(e.$animations={}),i=Object.keys(t),a=Date.now();let s;for(s=i.length-1;s>=0;--s){const l=i[s];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(e,t));continue}const c=t[l];let u=o[l];const d=n.get(l);if(u){if(d&&u.active()){u.update(d,c,a);continue}u.cancel()}d&&d.duration?(o[l]=u=new Uu(d,e,l,c),r.push(u)):e[l]=c}return r}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const n=this._createAnimations(e,t);return n.length?(Yu.add(this._chart,n),!0):void 0}}function Gu(e,t){const n=e&&e.options||{},r=n.reverse,o=void 0===n.min?t:0,i=void 0===n.max?t:0;return{start:r?i:o,end:r?o:i}}function Ku(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function Ju(e,t,n,r={}){const o=e.keys,i="single"===r.mode;let a,s,l,c;if(null===t)return;let u=!1;for(a=0,s=o.length;a<s;++a){if(l=+o[a],l===n){if(u=!0,r.all)continue;break}c=e.values[l],al(c)&&(i||0===t||Ll(t)===Ll(c))&&(t+=c)}return u||r.all?t:0}function Qu(e,t){const n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function ed(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function td(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const t=e[o.index];if(n&&t>0||!n&&t<0)return o.index}return null}function nd(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:a,index:s}=r,l=i.axis,c=a.axis,u=function(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}(i,a,r),d=t.length;let h;for(let e=0;e<d;++e){const n=t[e],{[l]:i,[c]:d}=n;h=(n._stacks||(n._stacks={}))[c]=ed(o,u,i),h[s]=d,h._top=td(h,a,!0,r.type),h._bottom=td(h,a,!1,r.type);(h._visualValues||(h._visualValues={}))[s]=d}}function rd(e,t){const n=e.scales;return Object.keys(n).filter((e=>n[e].axis===t)).shift()}function od(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[r]||void 0===t[r][n])return;delete t[r][n],void 0!==t[r]._visualValues&&void 0!==t[r]._visualValues[n]&&delete t[r]._visualValues[n]}}}const id=e=>"reset"===e||"none"===e,ad=(e,t)=>t?e:Object.assign({},e);class sd{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Qu(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&od(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>"x"===e?t:"r"===e?r:n,o=t.xAxisID=ll(n.xAxisID,rd(e,"x")),i=t.yAxisID=ll(n.yAxisID,rd(e,"y")),a=t.rAxisID=ll(n.rAxisID,rd(e,"r")),s=t.indexAxis,l=t.iAxisID=r(s,o,i,a),c=t.vAxisID=r(s,i,o,a);t.xScale=this.getScaleForId(o),t.yScale=this.getScaleForId(i),t.rScale=this.getScaleForId(a),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Ql(this._data,this),e._stacked&&od(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(il(t)){const e=this._cachedMeta;this._data=function(e,t){const{iScale:n,vScale:r}=t,o="x"===n.axis?"x":"y",i="x"===r.axis?"x":"y",a=Object.keys(e),s=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],s[l]={[o]:u,[i]:e[u]};return s}(t,e)}else if(n!==t){if(n){Ql(n,this);const e=this._cachedMeta;od(e),e._parsed=[]}t&&Object.isExtensible(t)&&function(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Jl.forEach((t=>{const n="_onData"+xl(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){const o=r.apply(this,t);return e._chartjs.listeners.forEach((e=>{"function"==typeof e[n]&&e[n](...t)})),o}})})))}(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,n=this.getDataset();let r=!1;this._dataCheck();const o=t._stacked;t._stacked=Qu(t.vScale,t),t.stack!==n.stack&&(r=!0,od(t),t.stack=n.stack),this._resyncElements(e),(r||o!==t._stacked)&&(nd(this,t._parsed),t._stacked=Qu(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:n,_data:r}=this,{iScale:o,_stacked:i}=n,a=o.axis;let s,l,c,u=0===e&&t===r.length||n._sorted,d=e>0&&n._parsed[e-1];if(!1===this._parsing)n._parsed=r,n._sorted=!0,c=r;else{c=ol(r[e])?this.parseArrayData(n,r,e,t):il(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);const o=()=>null===l[a]||d&&l[a]<d[a];for(s=0;s<t;++s)n._parsed[s+e]=l=c[s],u&&(o()&&(u=!1),d=l);n._sorted=u}i&&nd(this,c)}parsePrimitiveData(e,t,n,r){const{iScale:o,vScale:i}=e,a=o.axis,s=i.axis,l=o.getLabels(),c=o===i,u=new Array(r);let d,h,p;for(d=0,h=r;d<h;++d)p=d+n,u[d]={[a]:c||o.parse(l[p],p),[s]:i.parse(t[p],p)};return u}parseArrayData(e,t,n,r){const{xScale:o,yScale:i}=e,a=new Array(r);let s,l,c,u;for(s=0,l=r;s<l;++s)c=s+n,u=t[c],a[s]={x:o.parse(u[0],c),y:i.parse(u[1],c)};return a}parseObjectData(e,t,n,r){const{xScale:o,yScale:i}=e,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(r);let c,u,d,h;for(c=0,u=r;c<u;++c)d=c+n,h=t[d],l[c]={x:o.parse(_l(h,a),d),y:i.parse(_l(h,s),d)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){const r=this.chart,o=this._cachedMeta,i=t[e.axis];return Ju({keys:Ku(r,!0),values:t._stacks[e.axis]._visualValues},i,o.index,{mode:n})}updateRangeFromParsed(e,t,n,r){const o=n[t.axis];let i=null===o?NaN:o;const a=r&&n._stacks[t.axis];r&&a&&(r.values=a,i=Ju(r,o,this._cachedMeta.index)),e.min=Math.min(e.min,i),e.max=Math.max(e.max,i)}getMinMax(e,t){const n=this._cachedMeta,r=n._parsed,o=n._sorted&&e===n.iScale,i=r.length,a=this._getOtherScale(e),s=((e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Ku(n,!0),values:null})(t,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}(a);let d,h;function p(){h=r[d];const t=h[a.axis];return!al(h[e.axis])||c>t||u<t}for(d=0;d<i&&(p()||(this.updateRangeFromParsed(l,e,h,s),!o));++d);if(o)for(d=i-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(l,e,h,s);break}return l}getAllParsedValues(e){const t=this._cachedMeta._parsed,n=[];let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r][e.axis],al(i)&&n.push(i);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,n=t.iScale,r=t.vScale,o=this.getParsed(e);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:r?""+r.getLabelForValue(o[r.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=function(e){let t,n,r,o;return il(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:!1===e}}(ll(this.options.clip,function(e,t,n){if(!1===n)return!1;const r=Gu(e,n),o=Gu(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],o=t.chartArea,i=[],a=this._drawStart||0,s=this._drawCount||r.length-a,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(e,o,a,s),c=a;c<a+s;++c){const t=r[c];t.hidden||(t.active&&l?i.push(t):t.draw(e,o))}for(c=0;c<i.length;++c)i[c].draw(e,o)}getStyle(e,t){const n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){const r=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];o=t.$context||(t.$context=function(e,t,n){return Kc(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}(this.getContext(),e,t)),o.parsed=this.getParsed(e),o.raw=r.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=function(e,t){return Kc(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=r,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=n,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",n){const r="active"===t,o=this._cachedDataOpts,i=e+"-"+t,a=o[i],s=this.enableOptionSharing&&wl(n);if(a)return ad(a,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,"hover",e,""]:[e,""],d=l.getOptionScopes(this.getDataset(),c),h=Object.keys(Cc.elements[e]),p=l.resolveNamedOptions(d,h,(()=>this.getContext(n,r,t)),u);return p.$shared&&(p.$shared=s,o[i]=Object.freeze(ad(p,s))),p}_resolveAnimations(e,t,n){const r=this.chart,o=this._cachedDataOpts,i=`animation-${t}`,a=o[i];if(a)return a;let s;if(!1!==r.options.animation){const r=this.chart.config,o=r.datasetAnimationScopeKeys(this._type,t),i=r.getOptionScopes(this.getDataset(),o);s=r.createResolver(i,this.getContext(e,n,t))}const l=new Zu(r,s&&s.animations);return s&&s._cacheable&&(o[i]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||id(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,o=this.getSharedOptions(n),i=this.includeOptions(t,o)||o!==r;return this.updateSharedOptions(o,t,n),{sharedOptions:o,includeOptions:i}}updateElement(e,t,n,r){id(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!id(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;const o=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(o)||o})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,n=this._cachedMeta.data;for(const[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];const r=n.length,o=t.length,i=Math.min(o,r);i&&this.parse(0,i),o>r?this._insertElements(r,o-r,e):o<r&&this._removeElements(o,r-o)}_insertElements(e,t,n=!0){const r=this._cachedMeta,o=r.data,i=e+t;let a;const s=e=>{for(e.length+=t,a=e.length-1;a>=i;a--)e[a]=e[a-t]};for(s(o),a=e;a<i;++a)o[a]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(o,e,t,"reset")}updateElements(e,t,n,r){}_removeElements(e,t){const n=this._cachedMeta;if(this._parsing){const r=n._parsed.splice(e,t);n._stacked&&od(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function ld(e){const t=e.iScale,n=function(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let t=0,o=n.length;t<o;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=ec(r.sort(((e,t)=>e-t)))}return e._cache.$bar}(t,e.type);let r,o,i,a,s=t._length;const l=()=>{32767!==i&&-32768!==i&&(wl(a)&&(s=Math.min(s,Math.abs(i-a)||s)),a=i)};for(r=0,o=n.length;r<o;++r)i=t.getPixelForValue(n[r]),l();for(a=void 0,r=0,o=t.ticks.length;r<o;++r)i=t.getPixelForTick(r),l();return s}function cd(e,t,n,r){return ol(e)?function(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),a=Math.min(o,i),s=Math.max(o,i);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:a,max:s}}(e,t,n,r):t[n.axis]=n.parse(e,r),t}function ud(e,t,n,r){const o=e.iScale,i=e.vScale,a=o.getLabels(),s=o===i,l=[];let c,u,d,h;for(c=n,u=n+r;c<u;++c)h=t[c],d={},d[o.axis]=s||o.parse(a[c],c),l.push(cd(h,d,i,c));return l}function dd(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function hd(e,t,n,r){let o=t.borderSkipped;const i={};if(!o)return void(e.borderSkipped=i);if(!0===o)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:s,reverse:l,top:c,bottom:u}=function(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}(e);"middle"===o&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[pd(u,a,s,l)]=!0,o=c)),i[pd(o,a,s,l)]=!0,e.borderSkipped=i}function pd(e,t,n,r){var o,i,a;return r?(a=n,e=fd(e=(o=e)===(i=t)?a:o===a?i:o,n,t)):e=fd(e,t,n),e}function fd(e,t,n){return"start"===e?t:"end"===e?n:e}function md(e,{inflateAmount:t},n){e.inflateAmount="auto"===t?1===n?.33:0:t}class gd extends sd{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return ud(e,t,n,r)}parseArrayData(e,t,n,r){return ud(e,t,n,r)}parseObjectData(e,t,n,r){const{iScale:o,vScale:i}=e,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===o.axis?a:s,c="x"===i.axis?a:s,u=[];let d,h,p,f;for(d=n,h=n+r;d<h;++d)f=t[d],p={},p[o.axis]=o.parse(_l(f,l),d),u.push(cd(_l(f,c),p,i,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);const o=n._custom;o&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:n,vScale:r}=t,o=this.getParsed(e),i=o._custom,a=dd(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(o[r.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){const o="reset"===r,{index:i,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,r);for(let h=t;h<t+n;h++){const t=this.getParsed(h),n=o||rl(t[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(h),p=this._calculateBarIndexPixels(h,c),f=(t._stacks||{})[a.axis],m={horizontal:l,base:n.base,enableBorderRadius:!f||dd(t._custom)||i===f._top||i===f._bottom,x:l?n.head:p.center,y:l?p.center:n.head,height:l?p.size:Math.abs(n.size),width:l?Math.abs(n.size):p.size};d&&(m.options=u||this.resolveDataElementOptions(h,e[h].active?"active":r));const g=m.options||e[h].options;hd(m,g,f,i),md(m,g,c.ratio),this.updateElement(e[h],h,m,r)}}_getStacks(e,t){const{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter((e=>e.controller.options.grouped)),o=n.options.stacked,i=[],a=this._cachedMeta.controller.getParsed(t),s=a&&a[n.axis],l=e=>{const t=e._parsed.find((e=>e[n.axis]===s)),r=t&&t[e.vScale.axis];if(rl(r)||isNaN(r))return!0};for(const n of r)if((void 0===t||!l(n))&&((!1===o||-1===i.indexOf(n.stack)||void 0===o&&void 0===n.stack)&&i.push(n.stack),n.index===e))break;return i.length||i.push(void 0),i}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,n){const r=this._getStacks(e,n),o=void 0!==t?r.indexOf(t):-1;return-1===o?r.length-1:o}_getRuler(){const e=this.options,t=this._cachedMeta,n=t.iScale,r=[];let o,i;for(o=0,i=t.data.length;o<i;++o)r.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const a=e.barThickness;return{min:a||ld(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:o,minBarLength:i}}=this,a=o||0,s=this.getParsed(e),l=s._custom,c=dd(l);let u,d,h=s[t.axis],p=0,f=n?this.applyStack(t,s,n):h;f!==h&&(p=f-h,f=h),c&&(h=l.barStart,f=l.barEnd-l.barStart,0!==h&&Ll(h)!==Ll(l.barEnd)&&(p=0),p+=h);const m=rl(o)||c?p:o;let g=t.getPixelForValue(m);if(u=this.chart.getDataVisibility(e)?t.getPixelForValue(p+f):g,d=u-g,Math.abs(d)<i){d=function(e,t,n){return 0!==e?Ll(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}(d,t,a)*i,h===a&&(g-=d/2);const e=t.getPixelForDecimal(0),o=t.getPixelForDecimal(1),l=Math.min(e,o),p=Math.max(e,o);g=Math.max(Math.min(g,p),l),u=g+d,n&&!c&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(u)-t.getValueForPixel(g))}if(g===t.getPixelForValue(a)){const e=Ll(d)*t.getLineWidthForValue(a)/2;g+=e,d-=e}return{size:d,base:g,head:u,center:u+d/2}}_calculateBarIndexPixels(e,t){const n=t.scale,r=this.options,o=r.skipNull,i=ll(r.maxBarThickness,1/0);let a,s;if(t.grouped){const n=o?this._getStackCount(e):t.stackCount,l="flex"===r.barThickness?function(e,t,n,r){const o=t.pixels,i=o[e];let a=e>0?o[e-1]:null,s=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;null===a&&(a=i-(null===s?t.end-t.start:s-i)),null===s&&(s=i+i-a);const c=i-(i-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}(e,t,r,n):function(e,t,n,r){const o=n.barThickness;let i,a;return rl(o)?(i=t.min*n.categoryPercentage,a=n.barPercentage):(i=o*r,a=1),{chunk:i/r,ratio:a,start:t.pixels[e]-i/2}}(e,t,r,n),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);a=l.start+l.chunk*c+l.chunk/2,s=Math.min(i,l.chunk*l.ratio)}else a=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(i,t.min*t.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length;let o=0;for(;o<r;++o)null===this.getParsed(o)[t.axis]||n[o].hidden||n[o].draw(this._ctx)}}class vd extends sd{static id="doughnut";static 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"};static descriptors={_scriptable:e=>"spacing"!==e,_indexable:e=>"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n,color:r}}=e.legend.options;return t.labels.map(((t,o)=>{const i=e.getDatasetMeta(0).controller.getStyle(o);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:r,lineWidth:i.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}}))}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const n=this.getDataset().data,r=this._cachedMeta;if(!1===this._parsing)r._parsed=n;else{let o,i,a=e=>+n[e];if(il(n[e])){const{key:e="value"}=this._parsing;a=t=>+_l(n[t],e)}for(o=e,i=e+t;o<i;++o)r._parsed[o]=a(o)}}_getRotation(){return Fl(this.options.rotation-90)}_getCircumference(){return Fl(this.options.circumference)}_getRotationExtents(){let e=El,t=-El;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const r=this.chart.getDatasetMeta(n).controller,o=r._getRotation(),i=r._getCircumference();e=Math.min(e,o),t=Math.max(t,o+i)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:n}=t,r=this._cachedMeta,o=r.data,i=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-i)/2,0),s=Math.min((l=this.options.cutout,c=a,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const u=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:p,ratioY:f,offsetX:m,offsetY:g}=function(e,t,n){let r=1,o=1,i=0,a=0;if(t<El){const s=e,l=s+t,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),h=Math.sin(l),p=(e,t,r)=>Xl(e,s,l,!0)?1:Math.max(t,t*n,r,r*n),f=(e,t,r)=>Xl(e,s,l,!0)?-1:Math.min(t,t*n,r,r*n),m=p(0,c,d),g=p(Tl,u,h),v=f(Cl,c,d),y=f(Cl+Tl,u,h);r=(m-v)/2,o=(g-y)/2,i=-(m+v)/2,a=-(g+y)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:a}}(h,d,s),v=(n.width-i)/p,y=(n.height-i)/f,b=Math.max(Math.min(v,y)/2,0),_=cl(this.options.radius,b),x=(_-Math.max(_*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=g*_,r.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*u,0),this.updateElements(o,0,o.length,e)}_circumference(e,t){const n=this.options,r=this._cachedMeta,o=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||null===r._parsed[e]||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*o/El)}updateElements(e,t,n,r){const o="reset"===r,i=this.chart,a=i.chartArea,s=i.options.animation,l=(a.left+a.right)/2,c=(a.top+a.bottom)/2,u=o&&s.animateScale,d=u?0:this.innerRadius,h=u?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(t,r);let m,g=this._getRotation();for(m=0;m<t;++m)g+=this._circumference(m,o);for(m=t;m<t+n;++m){const t=this._circumference(m,o),n=e[m],i={x:l+this.offsetX,y:c+this.offsetY,startAngle:g,endAngle:g+t,circumference:t,outerRadius:h,innerRadius:d};f&&(i.options=p||this.resolveDataElementOptions(m,n.active?"active":r)),g+=t,this.updateElement(n,m,i,r)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let n,r=0;for(n=0;n<t.length;n++){const o=e._parsed[n];null===o||isNaN(o)||!this.chart.getDataVisibility(n)||t[n].hidden||(r+=Math.abs(o))}return r}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?El*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,r=n.data.labels||[],o=vc(t._parsed[e],n.options.locale);return{label:r[e]||"",value:o}}getMaxBorderWidth(e){let t=0;const n=this.chart;let r,o,i,a,s;if(!e)for(r=0,o=n.data.datasets.length;r<o;++r)if(n.isDatasetVisible(r)){i=n.getDatasetMeta(r),e=i.data,a=i.controller;break}if(!e)return 0;for(r=0,o=e.length;r<o;++r)s=a.resolveDataElementOptions(r),"inner"!==s.borderAlign&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){const e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(ll(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class yd extends sd{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n,color:r}}=e.legend.options;return t.labels.map(((t,o)=>{const i=e.getDatasetMeta(0).controller.getStyle(o);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:r,lineWidth:i.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}}))}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,r=n.data.labels||[],o=vc(t._parsed[e].r,n.options.locale);return{label:r[e]||"",value:o}}parseObjectData(e,t,n,r){return du.bind(this)(e,t,n,r)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach(((e,n)=>{const r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(r<t.min&&(t.min=r),r>t.max&&(t.max=r))})),t}_updateRadius(){const e=this.chart,t=e.chartArea,n=e.options,r=Math.min(t.right-t.left,t.bottom-t.top),o=Math.max(r/2,0),i=(o-Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=o-i*this.index,this.innerRadius=this.outerRadius-i}updateElements(e,t,n,r){const o="reset"===r,i=this.chart,a=i.options.animation,s=this._cachedMeta.rScale,l=s.xCenter,c=s.yCenter,u=s.getIndexAngle(0)-.5*Cl;let d,h=u;const p=360/this.countVisibleElements();for(d=0;d<t;++d)h+=this._computeAngle(d,r,p);for(d=t;d<t+n;d++){const t=e[d];let n=h,f=h+this._computeAngle(d,r,p),m=i.getDataVisibility(d)?s.getDistanceFromCenterForValue(this.getParsed(d).r):0;h=f,o&&(a.animateScale&&(m=0),a.animateRotate&&(n=f=u));const g={x:l,y:c,innerRadius:0,outerRadius:m,startAngle:n,endAngle:f,options:this.resolveDataElementOptions(d,t.active?"active":r)};this.updateElement(t,d,g,r)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach(((e,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++})),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?Fl(this.resolveDataElementOptions(e,t).angle||n):0}}var bd=Object.freeze({__proto__:null,BarController:gd,BubbleController:class extends sd{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,n,r){const o=super.parsePrimitiveData(e,t,n,r);for(let e=0;e<o.length;e++)o[e]._custom=this.resolveDataElementOptions(e+n).radius;return o}parseArrayData(e,t,n,r){const o=super.parseArrayData(e,t,n,r);for(let e=0;e<o.length;e++){const r=t[n+e];o[e]._custom=ll(r[2],this.resolveDataElementOptions(e+n).radius)}return o}parseObjectData(e,t,n,r){const o=super.parseObjectData(e,t,n,r);for(let e=0;e<o.length;e++){const r=t[n+e];o[e]._custom=ll(r&&r.r&&+r.r,this.resolveDataElementOptions(e+n).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:o}=t,i=this.getParsed(e),a=r.getLabelForValue(i.x),s=o.getLabelForValue(i.y),l=i._custom;return{label:n[e]||"",value:"("+a+", "+s+(l?", "+l:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,r){const o="reset"===r,{iScale:i,vScale:a}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(t,r),c=i.axis,u=a.axis;for(let d=t;d<t+n;d++){const t=e[d],n=!o&&this.getParsed(d),h={},p=h[c]=o?i.getPixelForDecimal(.5):i.getPixelForValue(n[c]),f=h[u]=o?a.getBasePixel():a.getPixelForValue(n[u]);h.skip=isNaN(p)||isNaN(f),l&&(h.options=s||this.resolveDataElementOptions(d,t.active?"active":r),o&&(h.options.radius=0)),this.updateElement(t,d,h,r)}}resolveDataElementOptions(e,t){const n=this.getParsed(e);let r=super.resolveDataElementOptions(e,t);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const o=r.radius;return"active"!==t&&(r.radius=0),r.radius+=ll(n&&n._custom,o),r}},DoughnutController:vd,LineController:class extends sd{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:n,data:r=[],_dataset:o}=t,i=this.chart._animationsDisabled;let{start:a,count:s}=ic(t,r,i);this._drawStart=a,this._drawCount=s,ac(t)&&(a=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=r;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!i,options:l},e),this.updateElements(r,a,s,e)}updateElements(e,t,n,r){const o="reset"===r,{iScale:i,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(t,r),d=i.axis,h=a.axis,{spanGaps:p,segment:f}=this.options,m=Rl(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||o||"none"===r,v=t+n,y=e.length;let b=t>0&&this.getParsed(t-1);for(let n=0;n<y;++n){const p=e[n],y=g?p:{};if(n<t||n>=v){y.skip=!0;continue}const _=this.getParsed(n),x=rl(_[h]),w=y[d]=i.getPixelForValue(_[d],n),S=y[h]=o||x?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,_,s):_[h],n);y.skip=isNaN(w)||isNaN(S)||x,y.stop=n>0&&Math.abs(_[d]-b[d])>m,f&&(y.parsed=_,y.raw=l.data[n]),u&&(y.options=c||this.resolveDataElementOptions(n,p.active?"active":r)),g||this.updateElement(p,n,y,r),b=_}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;const o=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,o,i)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},PieController:class extends vd{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:yd,RadarController:class extends sd{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(e){const t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,r){return du.bind(this)(e,t,n,r)}update(e){const t=this._cachedMeta,n=t.dataset,r=t.data||[],o=t.iScale.getLabels();if(n.points=r,"resize"!==e){const t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);const i={_loop:!0,_fullLoop:o.length===r.length,options:t};this.updateElement(n,void 0,i,e)}this.updateElements(r,0,r.length,e)}updateElements(e,t,n,r){const o=this._cachedMeta.rScale,i="reset"===r;for(let a=t;a<t+n;a++){const t=e[a],n=this.resolveDataElementOptions(a,t.active?"active":r),s=o.getPointPositionForValue(a,this.getParsed(a).r),l=i?o.xCenter:s.x,c=i?o.yCenter:s.y,u={x:l,y:c,angle:s.angle,skip:isNaN(l)||isNaN(c),options:n};this.updateElement(t,a,u,r)}}},ScatterController:class extends sd{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(e){const t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:o}=t,i=this.getParsed(e),a=r.getLabelForValue(i.x),s=o.getLabelForValue(i.y);return{label:n[e]||"",value:"("+a+", "+s+")"}}update(e){const t=this._cachedMeta,{data:n=[]}=t,r=this.chart._animationsDisabled;let{start:o,count:i}=ic(t,n,r);if(this._drawStart=o,this._drawCount=i,ac(t)&&(o=0,i=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:i}=t;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!i._decimated,o.points=n;const a=this.resolveDatasetElementOptions(e);a.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:a},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(n,o,i,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,n,r){const o="reset"===r,{iScale:i,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(t,r),u=this.getSharedOptions(c),d=this.includeOptions(r,u),h=i.axis,p=a.axis,{spanGaps:f,segment:m}=this.options,g=Rl(f)?f:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||o||"none"===r;let y=t>0&&this.getParsed(t-1);for(let c=t;c<t+n;++c){const t=e[c],n=this.getParsed(c),f=v?t:{},b=rl(n[p]),_=f[h]=i.getPixelForValue(n[h],c),x=f[p]=o||b?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,n,s):n[p],c);f.skip=isNaN(_)||isNaN(x)||b,f.stop=c>0&&Math.abs(n[h]-y[h])>g,m&&(f.parsed=n,f.raw=l.data[c]),d&&(f.options=u||this.resolveDataElementOptions(c,t.active?"active":r)),v||this.updateElement(t,c,f,r),y=n}this.updateSharedOptions(u,r,c)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}const n=e.dataset,r=n.options&&n.options.borderWidth||0;if(!t.length)return r;const o=t[0].size(this.resolveDataElementOptions(0)),i=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,o,i)/2}}});function _d(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class xd{static override(e){Object.assign(xd.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return _d()}parse(){return _d()}format(){return _d()}add(){return _d()}diff(){return _d()}startOf(){return _d()}endOf(){return _d()}}var wd={_date:xd};function Sd(e,t,n,r){const{controller:o,data:i,_sorted:a}=e,s=o._cachedMeta.iScale;if(s&&t===s.axis&&"r"!==t&&a&&i.length){const e=s._reversePixels?Kl:Gl;if(!r)return e(i,t,n);if(o._sharedOptions){const r=i[0],o="function"==typeof r.getRange&&r.getRange(t);if(o){const r=e(i,t,n-o),a=e(i,t,n+o);return{lo:r.lo,hi:a.hi}}}}return{lo:0,hi:i.length-1}}function kd(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),a=n[t];for(let e=0,n=i.length;e<n;++e){const{index:n,data:s}=i[e],{lo:l,hi:c}=Sd(i[e],t,a,o);for(let e=l;e<=c;++e){const t=s[e];t.skip||r(t,n,e)}}}function Cd(e,t,n,r,o){const i=[];if(!o&&!e.isPointInArea(t))return i;return kd(e,n,t,(function(n,a,s){(o||Dc(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&i.push({element:n,datasetIndex:a,index:s})}),!0),i}function Ed(e,t,n,r,o,i){let a=[];const s=function(e){const t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,r){const o=t?Math.abs(e.x-r.x):0,i=n?Math.abs(e.y-r.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}(n);let l=Number.POSITIVE_INFINITY;return kd(e,n,t,(function(n,c,u){const d=n.inRange(t.x,t.y,o);if(r&&!d)return;const h=n.getCenterPoint(o);if(!(!!i||e.isPointInArea(h))&&!d)return;const p=s(t,h);p<l?(a=[{element:n,datasetIndex:c,index:u}],l=p):p===l&&a.push({element:n,datasetIndex:c,index:u})})),a}function Md(e,t,n,r,o,i){return i||e.isPointInArea(t)?"r"!==n||r?Ed(e,t,n,r,o,i):function(e,t,n,r){let o=[];return kd(e,n,t,(function(e,n,i){const{startAngle:a,endAngle:s}=e.getProps(["startAngle","endAngle"],r),{angle:l}=Hl(e,{x:t.x,y:t.y});Xl(l,a,s)&&o.push({element:e,datasetIndex:n,index:i})})),o}(e,t,n,o):[]}function Pd(e,t,n,r,o){const i=[],a="x"===n?"inXRange":"inYRange";let s=!1;return kd(e,n,t,((e,r,l)=>{e[a]&&e[a](t[n],o)&&(i.push({element:e,datasetIndex:r,index:l}),s=s||e.inRange(t.x,t.y,o))})),r&&!s?[]:i}var Od={evaluateInteractionItems:kd,modes:{index(e,t,n,r){const o=Cu(t,e),i=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?Cd(e,o,i,r,a):Md(e,o,i,!1,r,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach((e=>{const t=s[0].index,n=e.data[t];n&&!n.skip&&l.push({element:n,datasetIndex:e.index,index:t})})),l):[]},dataset(e,t,n,r){const o=Cu(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?Cd(e,o,i,r,a):Md(e,o,i,!1,r,a);if(s.length>0){const t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point:(e,t,n,r)=>Cd(e,Cu(t,e),n.axis||"xy",r,n.includeInvisible||!1),nearest(e,t,n,r){const o=Cu(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;return Md(e,o,i,n.intersect,r,a)},x:(e,t,n,r)=>Pd(e,Cu(t,e),"x",n.intersect,r),y:(e,t,n,r)=>Pd(e,Cu(t,e),"y",n.intersect,r)}};const Td=["left","top","right","bottom"];function Nd(e,t){return e.filter((e=>e.pos===t))}function Dd(e,t){return e.filter((e=>-1===Td.indexOf(e.pos)&&e.box.axis===t))}function Ad(e,t){return e.sort(((e,n)=>{const r=t?n:e,o=t?e:n;return r.weight===o.weight?r.index-o.index:r.weight-o.weight}))}function Ld(e,t){const n=function(e){const t={};for(const n of e){const{stack:e,pos:r,stackWeight:o}=n;if(!e||!Td.includes(r))continue;const i=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return t}(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,a,s;for(i=0,a=e.length;i<a;++i){s=e[i];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*r:a&&t.availableWidth,s.height=o):(s.width=r,s.height=c?c*o:a&&t.availableHeight)}return n}function Id(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function zd(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Rd(e,t,n,r){const{pos:o,box:i}=n,a=e.maxPadding;if(!il(o)){n.size&&(e[o]-=n.size);const t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?i.height:i.width),n.size=t.size/t.count,e[o]+=n.size}i.getPadding&&zd(a,i.getPadding());const s=Math.max(0,t.outerWidth-Id(a,e,"left","right")),l=Math.max(0,t.outerHeight-Id(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function $d(e,t){const n=t.maxPadding;function r(e){const r={left:0,top:0,right:0,bottom:0};return e.forEach((e=>{r[e]=Math.max(t[e],n[e])})),r}return r(e?["left","right"]:["top","bottom"])}function Fd(e,t,n,r){const o=[];let i,a,s,l,c,u;for(i=0,a=e.length,c=0;i<a;++i){s=e[i],l=s.box,l.update(s.width||t.w,s.height||t.h,$d(s.horizontal,t));const{same:a,other:d}=Rd(t,n,s,r);c|=a&&o.length,u=u||d,l.fullSize||o.push(s)}return c&&Fd(o,t,n,r)||u}function jd(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function Bd(e,t,n,r){const o=n.padding;let{x:i,y:a}=t;for(const s of e){const e=s.box,l=r[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const r=t.w*c,i=l.size||e.height;wl(l.start)&&(a=l.start),e.fullSize?jd(e,o.left,a,n.outerWidth-o.right-o.left,i):jd(e,t.left+l.placed,a,r,i),l.start=a,l.placed+=r,a=e.bottom}else{const r=t.h*c,a=l.size||e.width;wl(l.start)&&(i=l.start),e.fullSize?jd(e,i,o.top,a,n.outerHeight-o.bottom-o.top):jd(e,i,t.top+l.placed,a,r),l.start=i,l.placed+=r,i=e.right}}t.x=i,t.y=a}var Hd={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const o=Uc(e.options.layout.padding),i=Math.max(t-o.width,0),a=Math.max(n-o.height,0),s=function(e){const t=function(e){const t=[];let n,r,o,i,a,s;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],({position:i,options:{stack:a,stackWeight:s=1}}=o),t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&i+a,stackWeight:s});return t}(e),n=Ad(t.filter((e=>e.box.fullSize)),!0),r=Ad(Nd(t,"left"),!0),o=Ad(Nd(t,"right")),i=Ad(Nd(t,"top"),!0),a=Ad(Nd(t,"bottom")),s=Dd(t,"x"),l=Dd(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(a).concat(s),chartArea:Nd(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(a).concat(s)}}(e.boxes),l=s.vertical,c=s.horizontal;dl(e.boxes,(e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()}));const u=l.reduce(((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1),0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:a,vBoxMaxWidth:i/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},o);zd(h,Uc(r));const p=Object.assign({maxPadding:h,w:i,h:a,x:o.left,y:o.top},o),f=Ld(l.concat(c),d);Fd(s.fullSize,p,d,f),Fd(l,p,d,f),Fd(c,p,d,f)&&Fd(l,p,d,f),function(e){const t=e.maxPadding;function n(n){const r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(p),Bd(s.leftAndTop,p,d,f),p.x+=p.w,p.y+=p.h,Bd(s.rightAndBottom,p,d,f),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},dl(s.chartArea,(t=>{const n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class Wd{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}}class Vd extends Wd{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Yd="$chartjs",Xd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},qd=e=>null===e||""===e;const Ud=!!Ou&&{passive:!0};function Zd(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Ud)}function Gd(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Kd(e,t,n){const r=e.canvas,o=new MutationObserver((e=>{let t=!1;for(const n of e)t=t||Gd(n.addedNodes,r),t=t&&!Gd(n.removedNodes,r);t&&n()}));return o.observe(document,{childList:!0,subtree:!0}),o}function Jd(e,t,n){const r=e.canvas,o=new MutationObserver((e=>{let t=!1;for(const n of e)t=t||Gd(n.removedNodes,r),t=t&&!Gd(n.addedNodes,r);t&&n()}));return o.observe(document,{childList:!0,subtree:!0}),o}const Qd=new Map;let eh=0;function th(){const e=window.devicePixelRatio;e!==eh&&(eh=e,Qd.forEach(((t,n)=>{n.currentDevicePixelRatio!==e&&t()})))}function nh(e,t,n){const r=e.canvas,o=r&&_u(r);if(!o)return;const i=nc(((e,t)=>{const r=o.clientWidth;n(e,t),r<o.clientWidth&&n()}),window),a=new ResizeObserver((e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;0===n&&0===r||i(n,r)}));return a.observe(o),function(e,t){Qd.size||window.addEventListener("resize",th),Qd.set(e,t)}(e,i),a}function rh(e,t,n){n&&n.disconnect(),"resize"===t&&function(e){Qd.delete(e),Qd.size||window.removeEventListener("resize",th)}(e)}function oh(e,t,n){const r=e.canvas,o=nc((t=>{null!==e.ctx&&n(function(e,t){const n=Xd[e.type]||e.type,{x:r,y:o}=Cu(e,t);return{type:n,chart:t,native:e,x:void 0!==r?r:null,y:void 0!==o?o:null}}(t,e))}),e);return function(e,t,n){e&&e.addEventListener(t,n,Ud)}(r,t,o),o}class ih extends Wd{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(function(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Yd]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",qd(o)){const t=Tu(e,"width");void 0!==t&&(e.width=t)}if(qd(r))if(""===e.style.height)e.height=e.width/(t||2);else{const t=Tu(e,"height");void 0!==t&&(e.height=t)}}(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t[Yd])return!1;const n=t[Yd].initial;["height","width"].forEach((e=>{const r=n[e];rl(r)?t.removeAttribute(e):t.setAttribute(e,r)}));const r=n.style||{};return Object.keys(r).forEach((e=>{t.style[e]=r[e]})),t.width=t.width,delete t[Yd],!0}addEventListener(e,t,n){this.removeEventListener(e,t);const r=e.$proxies||(e.$proxies={}),o={attach:Kd,detach:Jd,resize:nh}[t]||oh;r[t]=o(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),r=n[t];if(!r)return;({attach:rh,detach:rh,resize:rh}[t]||Zd)(e,t,r),n[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return Mu(e,t,n,r)}isAttached(e){const t=e&&_u(e);return!(!t||!t.isConnected)}}class ah{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return Rl(this.x)&&Rl(this.y)}getProps(e,t){const n=this.$animations;if(!t||!n)return this;const r={};return e.forEach((e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]})),r}}function sh(e,t){const n=e.options.ticks,r=function(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?function(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}(t):[],a=i.length,s=i[0],l=i[a-1],c=[];if(a>o)return function(e,t,n,r){let o,i=0,a=n[0];for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}(t,c,i,a/o),c;const u=function(e,t,n){const r=function(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}(e),o=t.length/n;if(!r)return Math.max(o,1);const i=function(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r==0&&(t.push(r),t.push(e/r));return n===(0|n)&&t.push(n),t.sort(((e,t)=>e-t)).pop(),t}(r);for(let e=0,t=i.length-1;e<t;e++){const t=i[e];if(t>o)return t}return Math.max(o,1)}(i,t,o);if(a>0){let e,n;const r=a>1?Math.round((l-s)/(a-1)):null;for(lh(t,c,u,rl(r)?0:s-r,s),e=0,n=a-1;e<n;e++)lh(t,c,u,i[e],i[e+1]);return lh(t,c,u,l,rl(r)?t.length:l+r),c}return lh(t,c,u),c}function lh(e,t,n,r,o){const i=ll(r,0),a=Math.min(ll(o,e.length),e.length);let s,l,c,u=0;for(n=Math.ceil(n),o&&(s=o-r,n=s/Math.floor(s/n)),c=i;c<0;)u++,c=Math.round(i+u*n);for(l=Math.max(i,0);l<a;l++)l===c&&(t.push(e[l]),u++,c=Math.round(i+u*n))}const ch=(e,t,n)=>"top"===t||"left"===t?e[t]+n:e[t]-n,uh=(e,t)=>Math.min(t||e,e);function dh(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function hh(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,a=e._endPixel,s=1e-6;let l,c=e.getPixelForTick(o);if(!(n&&(l=1===r?Math.max(c-i,a-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(o-1))/2,c+=o<t?l:-l,c<i-s||c>a+s)))return c}function ph(e){return e.drawTicks?e.tickLength:0}function fh(e,t){if(!e.display)return 0;const n=Zc(e.font,t),r=Uc(e.padding);return(ol(e.text)?e.text.length:1)*n.lineHeight+r.height}function mh(e,t,n){let r=rc(e);return(n&&"right"!==t||!n&&"right"===t)&&(r=(e=>"left"===e?"right":"right"===e?"left":e)(r)),r}class gh extends ah{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=sl(e,Number.POSITIVE_INFINITY),t=sl(t,Number.NEGATIVE_INFINITY),n=sl(n,Number.POSITIVE_INFINITY),r=sl(r,Number.NEGATIVE_INFINITY),{min:sl(e,n),max:sl(t,r),minDefined:al(e),maxDefined:al(t)}}getMinMax(e){let t,{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds();if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)t=a[s].controller.getMinMax(this,e),o||(n=Math.min(n,t.min)),i||(r=Math.max(r,t.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:sl(n,sl(r,n)),max:sl(r,sl(n,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 e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ul(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:r,grace:o,ticks:i}=this.options,a=i.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(e,t,n){const{min:r,max:o}=e,i=cl(t,(o-r)/2),a=(e,t)=>n&&0===e?0:e+t;return{min:a(r,-Math.abs(i)),max:a(o,i)}}(this,o,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?dh(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||"auto"===i.source)&&(this.ticks=sh(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ul(this.options.afterUpdate,[this])}beforeSetDimensions(){ul(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(){ul(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ul(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ul(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let n,r,o;for(n=0,r=e.length;n<r;n++)o=e[n],o.label=ul(t.callback,[o.value,n,e],this)}afterTickToLabelConversion(){ul(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ul(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,n=uh(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,o=t.maxRotation;let i,a,s,l=r;if(!this._isVisible()||!t.display||r>=o||n<=1||!this.isHorizontal())return void(this.labelRotation=r);const c=this._getLabelSizes(),u=c.widest.width,d=c.highest.height,h=ql(this.chart.width-u,0,this.maxWidth);i=e.offset?this.maxWidth/n:h/(n-1),u+6>i&&(i=h/(n-(e.offset?.5:1)),a=this.maxHeight-ph(e.grid)-t.padding-fh(e.title,this.chart.options.font),s=Math.sqrt(u*u+d*d),l=jl(Math.min(Math.asin(ql((c.highest.height+6)/i,-1,1)),Math.asin(ql(a/s,-1,1))-Math.asin(ql(d/s,-1,1)))),l=Math.max(r,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){ul(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ul(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const i=fh(r,t.options.font);if(a?(e.width=this.maxWidth,e.height=ph(o)+i):(e.height=this.maxHeight,e.width=ph(o)+i),n.display&&this.ticks.length){const{first:t,last:r,widest:o,highest:i}=this._getLabelSizes(),s=2*n.padding,l=Fl(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(a){const t=n.mirror?0:u*o.width+c*i.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{const t=n.mirror?0:c*o.width+u*i.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,c)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){const{ticks:{align:o,padding:i},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,d=0;s?l?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):"start"===o?d=t.width:"end"===o?u=e.width:"inner"!==o&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-a+i)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-c+i)*this.width/(this.width-c),0)}else{let n=t.height/2,r=e.height/2;"start"===o?(n=0,r=e.height):"end"===o&&(n=t.height,r=0),this.paddingTop=n+i,this.paddingBottom=r+i}}_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(){ul(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t<n;t++)rl(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let n=this.ticks;t<n.length&&(n=dh(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){const{ctx:r,_longestTextCache:o}=this,i=[],a=[],s=Math.floor(t/uh(t,n));let l,c,u,d,h,p,f,m,g,v,y,b=0,_=0;for(l=0;l<t;l+=s){if(d=e[l].label,h=this._resolveTickFontOptions(l),r.font=p=h.string,f=o[p]=o[p]||{data:{},gc:[]},m=h.lineHeight,g=v=0,rl(d)||ol(d)){if(ol(d))for(c=0,u=d.length;c<u;++c)y=d[c],rl(y)||ol(y)||(g=Ec(r,f.data,f.gc,g,y),v+=m)}else g=Ec(r,f.data,f.gc,g,d),v=m;i.push(g),a.push(v),b=Math.max(g,b),_=Math.max(v,_)}!function(e,t){dl(e,(e=>{const n=e.gc,r=n.length/2;let o;if(r>t){for(o=0;o<r;++o)delete e.data[n[o]];n.splice(0,r)}}))}(o,t);const x=i.indexOf(b),w=a.indexOf(_),S=e=>({width:i[e]||0,height:a[e]||0});return{first:S(0),last:S(t-1),widest:S(x),highest:S(w),widths:i,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return ql(this._alignToPixels?Pc(this.chart,t,0):t,-32768,32767)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const n=t[e];return n.$context||(n.$context=function(e,t,n){return Kc(e,{tick:n,index:t,type:"tick"})}(this.getContext(),e,n))}return this.$context||(this.$context=Kc(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const e=this.options.ticks,t=Fl(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),o=this._getLabelSizes(),i=e.autoSkipPadding||0,a=o?o.widest.width+i:0,s=o?o.highest.height+i:0;return this.isHorizontal()?s*n>a*r?a/n:s/r:s*r<a*n?s/n:a/r}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,n=this.chart,r=this.options,{grid:o,position:i,border:a}=r,s=o.offset,l=this.isHorizontal(),c=this.ticks.length+(s?1:0),u=ph(o),d=[],h=a.setContext(this.getContext()),p=h.display?h.width:0,f=p/2,m=function(e){return Pc(n,e,p)};let g,v,y,b,_,x,w,S,k,C,E,M;if("top"===i)g=m(this.bottom),x=this.bottom-u,S=g-f,C=m(e.top)+f,M=e.bottom;else if("bottom"===i)g=m(this.top),C=e.top,M=m(e.bottom)-f,x=g+f,S=this.top+u;else if("left"===i)g=m(this.right),_=this.right-u,w=g-f,k=m(e.left)+f,E=e.right;else if("right"===i)g=m(this.left),k=e.left,E=m(e.right)-f,_=g+f,w=this.left+u;else if("x"===t){if("center"===i)g=m((e.top+e.bottom)/2+.5);else if(il(i)){const e=Object.keys(i)[0],t=i[e];g=m(this.chart.scales[e].getPixelForValue(t))}C=e.top,M=e.bottom,x=g+f,S=x+u}else if("y"===t){if("center"===i)g=m((e.left+e.right)/2);else if(il(i)){const e=Object.keys(i)[0],t=i[e];g=m(this.chart.scales[e].getPixelForValue(t))}_=g-f,w=_-u,k=e.left,E=e.right}const P=ll(r.ticks.maxTicksLimit,c),O=Math.max(1,Math.ceil(c/P));for(v=0;v<c;v+=O){const e=this.getContext(v),t=o.setContext(e),r=a.setContext(e),i=t.lineWidth,c=t.color,u=r.dash||[],h=r.dashOffset,p=t.tickWidth,f=t.tickColor,m=t.tickBorderDash||[],g=t.tickBorderDashOffset;y=hh(this,v,s),void 0!==y&&(b=Pc(n,y,i),l?_=w=k=E=b:x=S=C=M=b,d.push({tx1:_,ty1:x,tx2:w,ty2:S,x1:k,y1:C,x2:E,y2:M,width:i,color:c,borderDash:u,borderDashOffset:h,tickWidth:p,tickColor:f,tickBorderDash:m,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,d}_computeLabelItems(e){const t=this.axis,n=this.options,{position:r,ticks:o}=n,i=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:c,mirror:u}=o,d=ph(n.grid),h=d+c,p=u?-c:h,f=-Fl(this.labelRotation),m=[];let g,v,y,b,_,x,w,S,k,C,E,M,P="middle";if("top"===r)x=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===r)x=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===r){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,_=e.x}else if("right"===r){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,_=e.x}else if("x"===t){if("center"===r)x=(e.top+e.bottom)/2+h;else if(il(r)){const e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+h}w=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===r)_=(e.left+e.right)/2-h;else if(il(r)){const e=Object.keys(r)[0],t=r[e];_=this.chart.scales[e].getPixelForValue(t)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===t&&("start"===s?P="top":"end"===s&&(P="bottom"));const O=this._getLabelSizes();for(g=0,v=a.length;g<v;++g){y=a[g],b=y.label;const e=o.setContext(this.getContext(g));S=this.getPixelForTick(g)+o.labelOffset,k=this._resolveTickFontOptions(g),C=k.lineHeight,E=ol(b)?b.length:1;const t=E/2,n=e.color,s=e.textStrokeColor,c=e.textStrokeWidth;let d,h=w;if(i?(_=S,"inner"===w&&(h=g===v-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),M="top"===r?"near"===l||0!==f?-E*C+C/2:"center"===l?-O.highest.height/2-t*C+C:-O.highest.height+C/2:"near"===l||0!==f?C/2:"center"===l?O.highest.height/2-t*C:O.highest.height-E*C,u&&(M*=-1),0===f||e.showLabelBackdrop||(_+=C/2*Math.sin(f))):(x=S,M=(1-E)*C/2),e.showLabelBackdrop){const t=Uc(e.backdropPadding),n=O.heights[g],r=O.widths[g];let o=M-t.top,i=0-t.left;switch(P){case"middle":o-=n/2;break;case"bottom":o-=n}switch(w){case"center":i-=r/2;break;case"right":i-=r;break;case"inner":g===v-1?i-=r:g>0&&(i-=r/2)}d={left:i,top:o,width:r+t.width,height:n+t.height,color:e.backdropColor}}m.push({label:b,font:k,textOffset:M,options:{rotation:f,color:n,strokeColor:s,strokeWidth:c,textAlign:h,textBaseline:P,translation:[_,x],backdrop:d}})}return m}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Fl(this.labelRotation))return"top"===e?"left":"right";let n="center";return"start"===t.align?n="left":"end"===t.align?n="right":"inner"===t.align&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:n,mirror:r,padding:o}}=this.options,i=e+o,a=this._getLabelSizes().widest.width;let s,l;return"left"===t?r?(l=this.right+o,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-i,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l=this.left)):"right"===t?r?(l=this.left+o,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+i,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:n,top:r,width:o,height:i}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,o,i),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const n=this.ticks.findIndex((t=>t.value===e));if(n>=0){return t.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(e){const t=this.options.grid,n=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,i;const a=(e,t,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(o=0,i=r.length;o<i;++o){const e=r[o];t.drawOnChartArea&&a({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&a({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:n,grid:r}}=this,o=n.setContext(this.getContext()),i=n.display?o.width:0;if(!i)return;const a=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let l,c,u,d;this.isHorizontal()?(l=Pc(e,this.left,i)-i/2,c=Pc(e,this.right,a)+a/2,u=d=s):(u=Pc(e,this.top,i)-i/2,d=Pc(e,this.bottom,a)+a/2,l=c=s),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(l,u),t.lineTo(c,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,n=this._computeLabelArea();n&&Ac(t,n);const r=this.getLabelItems(e);for(const e of r){const n=e.options,r=e.font;Fc(t,e.label,0,e.textOffset,r,n)}n&&Lc(t)}drawTitle(){const{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;const o=Zc(n.font),i=Uc(n.padding),a=n.align;let s=o.lineHeight/2;"bottom"===t||"center"===t||il(t)?(s+=i.bottom,ol(n.text)&&(s+=o.lineHeight*(n.text.length-1))):s+=i.top;const{titleX:l,titleY:c,maxWidth:u,rotation:d}=function(e,t,n,r){const{top:o,left:i,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d,h,p,f=0;const m=a-o,g=s-i;if(e.isHorizontal()){if(h=oc(r,i,s),il(n)){const e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)+m-t}else p="center"===n?(c.bottom+c.top)/2+m-t:ch(e,n,t);d=s-i}else{if(il(n)){const e=Object.keys(n)[0],r=n[e];h=u[e].getPixelForValue(r)-g+t}else h="center"===n?(c.left+c.right)/2-g+t:ch(e,n,t);p=oc(r,a,o),f="left"===n?-Tl:Tl}return{titleX:h,titleY:p,maxWidth:d,rotation:f}}(this,s,t,a);Fc(e,n.text,0,0,o,{color:n.color,maxWidth:u,rotation:d,textAlign:mh(a,t,r),textBaseline:"middle",translation:[l,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,n=ll(e.grid&&e.grid.z,-1),r=ll(e.border&&e.border.z,0);return this._isVisible()&&this.draw===gh.prototype.draw?[{z:n,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",r=[];let o,i;for(o=0,i=t.length;o<i;++o){const i=t[o];i[n]!==this.id||e&&i.type!==e||r.push(i)}return r}_resolveTickFontOptions(e){return Zc(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class vh{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let n;(function(e){return"id"in e&&"defaults"in e})(t)&&(n=this.register(t));const r=this.items,o=e.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in r||(r[o]=e,function(e,t,n){const r=gl(Object.create(null),[n?Cc.get(n):{},Cc.get(t),e.defaults]);Cc.set(t,r),e.defaultRoutes&&function(e,t){Object.keys(t).forEach((n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),a=t[n].split("."),s=a.pop(),l=a.join(".");Cc.route(i,o,l,s)}))}(t,e.defaultRoutes);e.descriptors&&Cc.describe(t,e.descriptors)}(e,i,n),this.override&&Cc.override(e.id,e.overrides)),i}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in Cc[r]&&(delete Cc[r][n],this.override&&delete _c[n])}}class yh{constructor(){this.controllers=new vh(sd,"datasets",!0),this.elements=new vh(ah,"elements"),this.plugins=new vh(Object,"plugins"),this.scales=new vh(gh,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,n){[...t].forEach((t=>{const r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):dl(t,(t=>{const r=n||this._getRegistryForType(t);this._exec(e,r,t)}))}))}_exec(e,t,n){const r=xl(e);ul(n["before"+r],[],n),t[e](n),ul(n["after"+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){const r=t.get(e);if(void 0===r)throw new Error('"'+e+'" is not a registered '+n+".");return r}}var bh=new yh;class _h{constructor(){this._init=[]}notify(e,t,n,r){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=r?this._descriptors(e).filter(r):this._descriptors(e),i=this._notify(o,e,t,n);return"afterDestroy"===t&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),i}_notify(e,t,n,r){r=r||{};for(const o of e){const e=o.plugin;if(!1===ul(e[n],[t,r,o.options],e)&&r.cancelable)return!1}return!0}invalidate(){rl(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,r=ll(n.options&&n.options.plugins,{}),o=function(e){const t={},n=[],r=Object.keys(bh.plugins.items);for(let e=0;e<r.length;e++)n.push(bh.getPlugin(r[e]));const o=e.plugins||[];for(let e=0;e<o.length;e++){const r=o[e];-1===n.indexOf(r)&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}(n);return!1!==r||t?function(e,{plugins:t,localIds:n},r,o){const i=[],a=e.getContext();for(const s of t){const t=s.id,l=xh(r[t],o);null!==l&&i.push({plugin:s,options:wh(e.config,{plugin:s,local:n[t]},l,a)})}return i}(e,o,r,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter((e=>!t.some((t=>e.plugin.id===t.plugin.id))));this._notify(r(t,n),e,"stop"),this._notify(r(n,t),e,"start")}}function xh(e,t){return t||!1!==e?!0===e?{}:e:null}function wh(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),a=e.getOptionScopes(r,i);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Sh(e,t){const n=Cc.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function kh(e){if("x"===e||"y"===e||"r"===e)return e}function Ch(e){return"top"===e||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0}function Eh(e,...t){if(kh(e))return e;for(const n of t){const t=n.axis||Ch(n.position)||e.length>1&&kh(e[0].toLowerCase());if(t)return t}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Mh(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ph(e,t){const n=_c[e.type]||{scales:{}},r=t.scales||{},o=Sh(e.type,t),i=Object.create(null);return Object.keys(r).forEach((t=>{const a=r[t];if(!il(a))return console.error(`Invalid scale configuration for scale: ${t}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const s=Eh(t,a,function(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter((t=>t.xAxisID===e||t.yAxisID===e));if(n.length)return Mh(e,"x",n[0])||Mh(e,"y",n[0])}return{}}(t,e),Cc.scales[a.type]),l=function(e,t){return e===t?"_index_":"_value_"}(s,o),c=n.scales||{};i[t]=vl(Object.create(null),[{axis:s},a,c[s],c[l]])})),e.data.datasets.forEach((n=>{const o=n.type||e.type,a=n.indexAxis||Sh(o,t),s=(_c[o]||{}).scales||{};Object.keys(s).forEach((e=>{const t=function(e,t){let n=e;return"_index_"===e?n=t:"_value_"===e&&(n="x"===t?"y":"x"),n}(e,a),o=n[t+"AxisID"]||t;i[o]=i[o]||Object.create(null),vl(i[o],[{axis:t},r[o],s[e]])}))})),Object.keys(i).forEach((e=>{const t=i[e];vl(t,[Cc.scales[t.type],Cc.scale])})),i}function Oh(e){const t=e.options||(e.options={});t.plugins=ll(t.plugins,{}),t.scales=Ph(e,t)}function Th(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}const Nh=new Map,Dh=new Set;function Ah(e,t){let n=Nh.get(e);return n||(n=t(),Nh.set(e,n),Dh.add(n)),n}const Lh=(e,t,n)=>{const r=_l(t,n);void 0!==r&&e.add(r)};class Ih{constructor(e){this._config=function(e){return(e=e||{}).data=Th(e.data),Oh(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Th(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Oh(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Ah(e,(()=>[[`datasets.${e}`,""]]))}datasetAnimationScopeKeys(e,t){return Ah(`${e}.transition.${t}`,(()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]]))}datasetElementScopeKeys(e,t){return Ah(`${e}-${t}`,(()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]]))}pluginScopeKeys(e){const t=e.id;return Ah(`${this.type}-plugin-${t}`,(()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]]))}_cachedScopes(e,t){const n=this._scopeCache;let r=n.get(e);return r&&!t||(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){const{options:r,type:o}=this,i=this._cachedScopes(e,n),a=i.get(t);if(a)return a;const s=new Set;t.forEach((t=>{e&&(s.add(e),t.forEach((t=>Lh(s,e,t)))),t.forEach((e=>Lh(s,r,e))),t.forEach((e=>Lh(s,_c[o]||{},e))),t.forEach((e=>Lh(s,Cc,e))),t.forEach((e=>Lh(s,xc,e)))}));const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),Dh.has(t)&&i.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,_c[t]||{},Cc.datasets[t]||{},{type:t},Cc,xc]}resolveNamedOptions(e,t,n,r=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=zh(this._resolverCache,e,r);let s=i;if(function(e,t){const{isScriptable:n,isIndexable:r}=eu(e);for(const o of t){const t=n(o),i=r(o),a=(i||t)&&e[o];if(t&&(Sl(a)||Rh(a))||i&&ol(a))return!0}return!1}(i,t)){o.$shared=!1;s=Qc(i,n=Sl(n)?n():n,this.createResolver(e,n,a))}for(const e of t)o[e]=s[e];return o}createResolver(e,t,n=[""],r){const{resolver:o}=zh(this._resolverCache,e,n);return il(t)?Qc(o,t,void 0,r):o}}function zh(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);if(!i){i={resolver:Jc(t,n),subPrefixes:n.filter((e=>!e.toLowerCase().includes("hover")))},r.set(o,i)}return i}const Rh=e=>il(e)&&Object.getOwnPropertyNames(e).some((t=>Sl(e[t])));const $h=["top","bottom","left","right","chartArea"];function Fh(e,t){return"top"===e||"bottom"===e||-1===$h.indexOf(e)&&"x"===t}function jh(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Bh(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),ul(n&&n.onComplete,[e],t)}function Hh(e){const t=e.chart,n=t.options.animation;ul(n&&n.onProgress,[e],t)}function Wh(e){return bu()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Vh={},Yh=e=>{const t=Wh(e);return Object.values(Vh).filter((e=>e.canvas===t)).pop()};function Xh(e,t,n){const r=Object.keys(e);for(const o of r){const r=+o;if(r>=t){const i=e[o];delete e[o],(n>0||r>t)&&(e[r+n]=i)}}}function qh(e,t,n){return e.options.clip?e[n]:t[n]}class Uh{static defaults=Cc;static instances=Vh;static overrides=_c;static registry=bh;static version="4.4.7";static getChart=Yh;static register(...e){bh.add(...e),Zh()}static unregister(...e){bh.remove(...e),Zh()}constructor(e,t){const n=this.config=new Ih(t),r=Wh(e),o=Yh(r);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 i=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(e){return!bu()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?Vd:ih}(r)),this.platform.updateConfig(n);const a=this.platform.acquireContext(r,i.aspectRatio),s=a&&a.canvas,l=s&&s.height,c=s&&s.width;this.id=nl(),this.ctx=a,this.canvas=s,this.width=c,this.height=l,this._options=i,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 _h,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}((e=>this.update(e)),i.resizeDelay||0),this._dataChanges=[],Vh[this.id]=this,a&&s?(Yu.listen(this,"complete",Bh),Yu.listen(this,"progress",Hh),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:o}=this;return rl(e)?t&&o?o:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return bh}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Pu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oc(this.canvas,this.ctx),this}stop(){return Yu.stop(this),this}resize(e,t){Yu.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,r=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,e,t,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Pu(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),ul(n.onResize,[this,i],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){dl(this.options.scales||{},((e,t)=>{e.id=t}))}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce(((e,t)=>(e[t]=!1,e)),{});let o=[];t&&(o=o.concat(Object.keys(t).map((e=>{const n=t[e],r=Eh(e,n),o="r"===r,i="x"===r;return{options:n,dposition:o?"chartArea":i?"bottom":"left",dtype:o?"radialLinear":i?"category":"linear"}})))),dl(o,(t=>{const o=t.options,i=o.id,a=Eh(i,o),s=ll(o.type,t.dtype);void 0!==o.position&&Fh(o.position,a)===Fh(t.dposition)||(o.position=t.dposition),r[i]=!0;let l=null;if(i in n&&n[i].type===s)l=n[i];else{l=new(bh.getScale(s))({id:i,type:s,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(o,e)})),dl(r,((e,t)=>{e||delete n[t]})),dl(n,(e=>{Hd.configure(this,e,e.options),Hd.addBox(this,e)}))}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort(((e,t)=>e.index-t.index)),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(jh("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach(((e,n)=>{0===t.filter((t=>t===e._dataset)).length&&this._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){const r=t[n];let o=this.getDatasetMeta(n);const i=r.type||this.config.type;if(o.type&&o.type!==i&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=i,o.indexAxis=r.indexAxis||Sh(i,this.options),o.order=r.order||0,o.index=n,o.label=""+r.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const t=bh.getController(i),{datasetElementType:r,dataElementType:a}=Cc.datasets[i];Object.assign(t,{dataElementType:bh.getElement(a),datasetElementType:r&&bh.getElement(r)}),o.controller=new t(this,n),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){dl(this.data.datasets,((e,t)=>{this.getDatasetMeta(t).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let e=0,t=this.data.datasets.length;e<t;e++){const{controller:t}=this.getDatasetMeta(e),n=!r&&-1===o.indexOf(t);t.buildOrUpdateElements(n),i=Math.max(+t.getMaxOverflow(),i)}i=this._minPadding=n.layout.autoPadding?i:0,this._updateLayout(i),r||dl(o,(e=>{e.reset()})),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(jh("z","_idx"));const{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){dl(this.scales,(e=>{Hd.removeBox(this,e)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);kl(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:r,count:o}of t){Xh(e,r,"_removeElements"===n?-o:o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=t=>new Set(e.filter((e=>e[0]===t)).map(((e,t)=>t+","+e.splice(1).join(",")))),r=n(0);for(let e=1;e<t;e++)if(!kl(r,n(e)))return;return Array.from(r).map((e=>e.split(","))).map((e=>({method:e[1],start:+e[2],count:+e[3]})))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Hd.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],dl(this.boxes,(e=>{n&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))}),this),this._layers.forEach(((e,t)=>{e._idx=t})),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Sl(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",r)&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Yu.has(this)?this.attached&&!Yu.running(this)&&Yu.start(this):(this.draw(),Bh({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,n=[];let r,o;for(r=0,o=t.length;r<o;++r){const o=t[r];e&&!o.visible||n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n=e._clip,r=!n.disabled,o=function(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:qh(n,t,"left"),right:qh(n,t,"right"),top:qh(r,t,"top"),bottom:qh(r,t,"bottom")}:t}(e,this.chartArea),i={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(r&&Ac(t,{left:!1===n.left?0:o.left-n.left,right:!1===n.right?this.width:o.right+n.right,top:!1===n.top?0:o.top-n.top,bottom:!1===n.bottom?this.height:o.bottom+n.bottom}),e.controller.draw(),r&&Lc(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(e){return Dc(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){const o=Od.modes[t];return"function"==typeof o?o(this,e,n,r):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let r=n.filter((e=>e&&e._dataset===t)).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||(this.$context=Kc(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const r=n?"show":"hide",o=this.getDatasetMeta(e),i=o.controller._resolveAnimations(void 0,r);wl(t)?(o.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),i.update(o,{visible:n}),this.update((t=>t.datasetIndex===e?r:void 0)))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Yu.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Oc(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Vh[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};dl(this.options.events,(e=>n(e,r)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},o=(e,t)=>{this.canvas&&this.resize(e,t)};let i;const a=()=>{r("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",i)};i=()=>{this.attached=!1,r("resize",o),this._stop(),this._resize(0,0),n("attach",a)},t.isAttached(this.canvas)?a():i()}unbindEvents(){dl(this._listeners,((e,t)=>{this.platform.removeEventListener(this,t,e)})),this._listeners={},dl(this._responsiveListeners,((e,t)=>{this.platform.removeEventListener(this,t,e)})),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const r=n?"set":"remove";let o,i,a,s;for("dataset"===t&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+r+"DatasetHoverStyle"]()),a=0,s=e.length;a<s;++a){i=e[a];const t=i&&this.getDatasetMeta(i.datasetIndex).controller;t&&t[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],n=e.map((({datasetIndex:e,index:t})=>{const n=this.getDatasetMeta(e);if(!n)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:n.data[t],index:t}}));!hl(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return 1===this._plugins._cache.filter((t=>t.plugin.id===e)).length}_updateHoverStyles(e,t,n){const r=this.options.hover,o=(e,t)=>e.filter((e=>!t.some((t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)))),i=o(t,e),a=n?e:o(e,t);i.length&&this.updateHoverStyle(i,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",n,r))return;const o=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(o||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:r=[],options:o}=this,i=t,a=this._getActiveElements(e,r,n,i),s=function(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}(e),l=function(e,t,n,r){return n&&"mouseout"!==e.type?r?t:e:null}(e,this._lastEvent,n,s);n&&(this._lastEvent=null,ul(o.onHover,[e,a,this],this),s&&ul(o.onClick,[e,a,this],this));const c=!hl(a,r);return(c||t)&&(this._active=a,this._updateHoverStyles(a,r,t)),this._lastEvent=l,c}_getActiveElements(e,t,n,r){if("mouseout"===e.type)return[];if(!n)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,r)}}function Zh(){return dl(Uh.instances,(e=>e._plugins.invalidate()))}function Gh(e,t,n,r){const o=Yc(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const i=(n-t)/2,a=Math.min(i,r*t/2),s=e=>{const t=(n-Math.min(i,e))*r/2;return ql(e,0,Math.min(i,t))};return{outerStart:s(o.outerStart),outerEnd:s(o.outerEnd),innerStart:ql(o.innerStart,0,a),innerEnd:ql(o.innerEnd,0,a)}}function Kh(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Jh(e,t,n,r,o,i){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),h=u>0?u+r+n+c:0;let p=0;const f=o-l;if(r){const e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(f-(0!==e?f*e/(e+r):f))/2}const m=(f-Math.max(.001,f*d-n/Cl)/d)/2,g=l+m+p,v=o-m-p,{outerStart:y,outerEnd:b,innerStart:_,innerEnd:x}=Gh(t,h,d,v-g),w=d-y,S=d-b,k=g+y/w,C=v-b/S,E=h+_,M=h+x,P=g+_/E,O=v-x/M;if(e.beginPath(),i){const t=(k+C)/2;if(e.arc(a,s,d,k,t),e.arc(a,s,d,t,C),b>0){const t=Kh(S,C,a,s);e.arc(t.x,t.y,b,C,v+Tl)}const n=Kh(M,v,a,s);if(e.lineTo(n.x,n.y),x>0){const t=Kh(M,O,a,s);e.arc(t.x,t.y,x,v+Tl,O+Math.PI)}const r=(v-x/h+(g+_/h))/2;if(e.arc(a,s,h,v-x/h,r,!0),e.arc(a,s,h,r,g+_/h,!0),_>0){const t=Kh(E,P,a,s);e.arc(t.x,t.y,_,P+Math.PI,g-Tl)}const o=Kh(w,g,a,s);if(e.lineTo(o.x,o.y),y>0){const t=Kh(w,k,a,s);e.arc(t.x,t.y,y,g-Tl,k)}}else{e.moveTo(a,s);const t=Math.cos(k)*d+a,n=Math.sin(k)*d+s;e.lineTo(t,n);const r=Math.cos(C)*d+a,o=Math.sin(C)*d+s;e.lineTo(r,o)}e.closePath()}function Qh(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,p="inner"===l.borderAlign;if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=h,p?(e.lineWidth=2*c,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let f=t.endAngle;if(i){Jh(e,t,n,r,f,o);for(let t=0;t<i;++t)e.stroke();isNaN(s)||(f=a+(s%El||El))}p&&function(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:a,outerRadius:s,innerRadius:l}=t;let c=o/s;e.beginPath(),e.arc(i,a,s,r-c,n+c),l>o?(c=o/l,e.arc(i,a,l,n+c,r-c,!0)):e.arc(i,a,o,n+Tl,r-Tl),e.closePath(),e.clip()}(e,t,f),i||(Jh(e,t,n,r,f,o),e.stroke())}function ep(e,t,n=t){e.lineCap=ll(n.borderCapStyle,t.borderCapStyle),e.setLineDash(ll(n.borderDash,t.borderDash)),e.lineDashOffset=ll(n.borderDashOffset,t.borderDashOffset),e.lineJoin=ll(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=ll(n.borderWidth,t.borderWidth),e.strokeStyle=ll(n.borderColor,t.borderColor)}function tp(e,t,n){e.lineTo(n.x,n.y)}function np(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:a,end:s}=t,l=Math.max(o,a),c=Math.min(i,s),u=o<a&&i<a||o>s&&i>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function rp(e,t,n,r){const{points:o,options:i}=t,{count:a,start:s,loop:l,ilen:c}=np(o,n,r),u=function(e){return e.stepped?Ic:e.tension||"monotone"===e.cubicInterpolationMode?zc:tp}(i);let d,h,p,{move:f=!0,reverse:m}=r||{};for(d=0;d<=c;++d)h=o[(s+(m?c-d:d))%a],h.skip||(f?(e.moveTo(h.x,h.y),f=!1):u(e,p,h,m,i.stepped),p=h);return l&&(h=o[(s+(m?c:0))%a],u(e,p,h,m,i.stepped)),!!l}function op(e,t,n,r){const o=t.points,{count:i,start:a,ilen:s}=np(o,n,r),{move:l=!0,reverse:c}=r||{};let u,d,h,p,f,m,g=0,v=0;const y=e=>(a+(c?s-e:e))%i,b=()=>{p!==f&&(e.lineTo(g,f),e.lineTo(g,p),e.lineTo(g,m))};for(l&&(d=o[y(0)],e.moveTo(d.x,d.y)),u=0;u<=s;++u){if(d=o[y(u)],d.skip)continue;const t=d.x,n=d.y,r=0|t;r===h?(n<p?p=n:n>f&&(f=n),g=(v*g+t)/++v):(b(),e.lineTo(t,n),h=r,v=0,p=f=n),m=n}b()}function ip(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!(e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n)?op:rp}const ap="function"==typeof Path2D;function sp(e,t,n,r){ap&&!t.options.segment?function(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),ep(e,t.options),e.stroke(o)}(e,t,n,r):function(e,t,n,r){const{segments:o,options:i}=t,a=ip(t);for(const s of o)ep(e,i,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}(e,t,n,r)}class lp extends ah{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const r=n.spanGaps?this._loop:this._fullLoop;yu(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:a,end:s}=function(e,t,n,r){let o=0,i=t-1;if(n&&!r)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(i+=o);i>o&&e[i%t].skip;)i--;return i%=t,{start:o,end:i}}(n,o,i,r);return Bu(e,!0===r?[{start:a,end:s,loop:i}]:function(e,t,n,r){const o=e.length,i=[];let a,s=t,l=e[t];for(a=t+1;a<=n;++a){const n=e[a%o];n.skip||n.stop?l.skip||(r=!1,i.push({start:t%o,end:(a-1)%o,loop:r}),t=s=n.stop?a:null):(s=a,l.skip&&(t=a)),l=n}return null!==s&&i.push({start:t%o,end:s%o,loop:r}),i}(n,a,s<a?s+o:s,!!e._fullLoop&&0===a&&s===o-1),n,t)}(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){const n=this.options,r=e[t],o=this.points,i=ju(this,{property:t,start:r,end:r});if(!i.length)return;const a=[],s=function(e){return e.stepped?Du:e.tension||"monotone"===e.cubicInterpolationMode?Au:Nu}(n);let l,c;for(l=0,c=i.length;l<c;++l){const{start:c,end:u}=i[l],d=o[c],h=o[u];if(d===h){a.push(d);continue}const p=s(d,h,Math.abs((r-d[t])/(h[t]-d[t])),n.stepped);p[t]=e[t],a.push(p)}return 1===a.length?a[0]:a}pathSegment(e,t,n){return ip(this)(e,this,t,n)}path(e,t,n){const r=this.segments,o=ip(this);let i=this._loop;t=t||0,n=n||this.points.length-t;for(const a of r)i&=o(e,this,a,{start:t,end:t+n-1});return!!i}draw(e,t,n,r){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),sp(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function cp(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}function up(e,t){const{x:n,y:r,base:o,width:i,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,s=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:s,top:c,right:l,bottom:u}}function dp(e,t,n,r){return e?0:ql(t,n,r)}function hp(e){const t=up(e),n=t.right-t.left,r=t.bottom-t.top,o=function(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=Xc(r);return{t:dp(o.top,i.top,0,n),r:dp(o.right,i.right,0,t),b:dp(o.bottom,i.bottom,0,n),l:dp(o.left,i.left,0,t)}}(e,n/2,r/2),i=function(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=qc(o),a=Math.min(t,n),s=e.borderSkipped,l=r||il(o);return{topLeft:dp(!l||s.top||s.left,i.topLeft,0,a),topRight:dp(!l||s.top||s.right,i.topRight,0,a),bottomLeft:dp(!l||s.bottom||s.left,i.bottomLeft,0,a),bottomRight:dp(!l||s.bottom||s.right,i.bottomRight,0,a)}}(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function pp(e,t,n,r){const o=null===t,i=null===n,a=e&&!(o&&i)&&up(e,r);return a&&(o||Ul(t,a.left,a.right))&&(i||Ul(n,a.top,a.bottom))}function fp(e,t){e.rect(t.x,t.y,t.w,t.h)}function mp(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+a,radius:e.radius}}class gp extends ah{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:o,outer:i}=hp(this),a=(s=i.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?jc:fp;var s;e.save(),i.w===o.w&&i.h===o.h||(e.beginPath(),a(e,mp(i,t,o)),e.clip(),a(e,mp(o,-t,i)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),a(e,mp(o,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return pp(this,e,t,n)}inXRange(e,t){return pp(this,e,null,t)}inYRange(e,t){return pp(this,null,e,t)}getCenterPoint(e){const{x:t,y:n,base:r,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+r)/2:t,y:o?n:(n+r)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}}var vp=Object.freeze({__proto__:null,ArcElement:class extends ah{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){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,e&&Object.assign(this,e)}inRange(e,t,n){const r=this.getProps(["x","y"],n),{angle:o,distance:i}=Hl(r,{x:e,y:t}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=(this.options.spacing+this.options.borderWidth)/2,h=ll(u,s-a),p=Xl(o,a,s)&&a!==s,f=h>=El||p,m=Ul(i,l+d,c+d);return f&&m}getCenterPoint(e){const{x:t,y:n,startAngle:r,endAngle:o,innerRadius:i,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:s,spacing:l}=this.options,c=(r+o)/2,u=(i+a+l+s)/2;return{x:t+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:n}=this,r=(t.offset||0)/4,o=(t.spacing||0)/2,i=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>El?Math.floor(n/El):0,0===n||this.innerRadius<0||this.outerRadius<0)return;e.save();const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*r,Math.sin(a)*r);const s=r*(1-Math.sin(Math.min(Cl,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s}=t;let l=t.endAngle;if(i){Jh(e,t,n,r,l,o);for(let t=0;t<i;++t)e.fill();isNaN(s)||(l=a+(s%El||El))}Jh(e,t,n,r,l,o),e.fill()}(e,this,s,o,i),Qh(e,this,s,o,i),e.restore()}},BarElement:gp,LineElement:lp,PointElement:class extends ah{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){const r=this.options,{x:o,y:i}=this.getProps(["x","y"],n);return Math.pow(e-o,2)+Math.pow(t-i,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,t){return cp(this,e,"x",t)}inYRange(e,t){return cp(this,e,"y",t)}getCenterPoint(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}size(e){let t=(e=e||this.options||{}).radius||0;t=Math.max(t,t&&e.hoverRadius||0);return 2*(t+(t&&e.borderWidth||0))}draw(e,t){const n=this.options;this.skip||n.radius<.1||!Dc(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Tc(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}});const yp=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],bp=yp.map((e=>e.replace("rgb(","rgba(").replace(")",", 0.5)")));function _p(e){return yp[e%yp.length]}function xp(e){return bp[e%bp.length]}function wp(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof vd?t=function(e,t){return e.backgroundColor=e.data.map((()=>_p(t++))),t}(n,t):o instanceof yd?t=function(e,t){return e.backgroundColor=e.data.map((()=>xp(t++))),t}(n,t):o&&(t=function(e,t){return e.borderColor=_p(t),e.backgroundColor=xp(t),++t}(n,t))}}function Sp(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}var kp={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o,a=Sp(r)||(s=o)&&(s.borderColor||s.backgroundColor)||i&&Sp(i)||"rgba(0,0,0,0.1)"!==Cc.borderColor||"rgba(0,0,0,0.1)"!==Cc.backgroundColor;var s;if(!n.forceOverride&&a)return;const l=wp(e);r.forEach(l)}};function Cp(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ep(e){e.data.datasets.forEach((e=>{Cp(e)}))}var Mp={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled)return void Ep(e);const r=e.width;e.data.datasets.forEach(((t,o)=>{const{_data:i,indexAxis:a}=t,s=e.getDatasetMeta(o),l=i||t.data;if("y"===Gc([a,e.options.indexAxis]))return;if(!s.controller.supportsDecimation)return;const c=e.scales[s.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(e.options.parsing)return;let{start:u,count:d}=function(e,t){const n=t.length;let r,o=0;const{iScale:i}=e,{min:a,max:s,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(o=ql(Gl(t,i.axis,a).lo,0,n-1)),r=c?ql(Gl(t,i.axis,s).hi+1,o,n)-o:n-o,{start:o,count:r}}(s,l);if(d<=(n.threshold||4*r))return void Cp(t);let h;switch(rl(i)&&(t._data=l,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}})),n.algorithm){case"lttb":h=function(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const a=[],s=(n-2)/(i-2);let l=0;const c=t+n-1;let u,d,h,p,f,m=t;for(a[l++]=e[m],u=0;u<i-2;u++){let r,o=0,i=0;const c=Math.floor((u+1)*s)+1+t,g=Math.min(Math.floor((u+2)*s)+1,n)+t,v=g-c;for(r=c;r<g;r++)o+=e[r].x,i+=e[r].y;o/=v,i/=v;const y=Math.floor(u*s)+1+t,b=Math.min(Math.floor((u+1)*s)+1,n)+t,{x:_,y:x}=e[m];for(h=p=-1,r=y;r<b;r++)p=.5*Math.abs((_-o)*(e[r].y-x)-(_-e[r].x)*(i-x)),p>h&&(h=p,d=e[r],f=r);a[l++]=d,m=f}return a[l++]=e[c],a}(l,u,d,r,n);break;case"min-max":h=function(e,t,n,r){let o,i,a,s,l,c,u,d,h,p,f=0,m=0;const g=[],v=t+n-1,y=e[t].x,b=e[v].x-y;for(o=t;o<t+n;++o){i=e[o],a=(i.x-y)/b*r,s=i.y;const t=0|a;if(t===l)s<h?(h=s,c=o):s>p&&(p=s,u=o),f=(m*f+i.x)/++m;else{const n=o-1;if(!rl(c)&&!rl(u)){const t=Math.min(c,u),r=Math.max(c,u);t!==d&&t!==n&&g.push({...e[t],x:f}),r!==d&&r!==n&&g.push({...e[r],x:f})}o>0&&n!==d&&g.push(e[n]),g.push(i),l=t,m=0,h=p=s,c=u=d=o}}return g}(l,u,d,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}t._decimated=h}))},destroy(e){Ep(e)}};function Pp(e,t,n,r){if(r)return;let o=t[e],i=n[e];return"angle"===e&&(o=Yl(o),i=Yl(i)),{property:e,start:o,end:i}}function Op(e,t,n){for(;t>e;t--){const e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function Tp(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Np(e,t){let n=[],r=!1;return ol(e)?(r=!0,n=e):n=function(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach((({start:e,end:t})=>{t=Op(e,t,o);const a=o[e],s=o[t];null!==r?(i.push({x:a.x,y:r}),i.push({x:s.x,y:r})):null!==n&&(i.push({x:n,y:a.y}),i.push({x:n,y:s.y}))})),i}(e,t),n.length?new lp({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Dp(e){return e&&!1!==e.fill}function Ap(e,t,n){let r=e[t].fill;const o=[t];let i;if(!n)return r;for(;!1!==r&&-1===o.indexOf(r);){if(!al(r))return r;if(i=e[r],!i)return!1;if(i.visible)return r;o.push(r),r=i.fill}return!1}function Lp(e,t,n){const r=function(e){const t=e.options,n=t.fill;let r=ll(n&&n.target,n);void 0===r&&(r=!!t.backgroundColor);if(!1===r||null===r)return!1;if(!0===r)return"origin";return r}(e);if(il(r))return!isNaN(r.value)&&r;let o=parseFloat(r);return al(o)&&Math.floor(o)===o?function(e,t,n,r){"-"!==e&&"+"!==e||(n=t+n);if(n===t||n<0||n>=r)return!1;return n}(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Ip(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:a,last:s,point:l}=zp(i,t,"x");if(!(!l||a&&s))if(a)r.unshift(l);else if(e.push(l),!s)break}e.push(...r)}function zp(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],i=e.segments,a=e.points;let s=!1,l=!1;for(let e=0;e<i.length;e++){const t=i[e],r=a[t.start][n],c=a[t.end][n];if(Ul(o,r,c)){s=o===r,l=o===c;break}}return{first:s,last:l,point:r}}class Rp{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){const{x:r,y:o,radius:i}=this;return t=t||{start:0,end:El},e.arc(r,o,i,t.end,t.start,!0),!n.bounds}interpolate(e){const{x:t,y:n,radius:r}=this,o=e.angle;return{x:t+Math.cos(o)*r,y:n+Math.sin(o)*r,angle:o}}}function $p(e){const{chart:t,fill:n,line:r}=e;if(al(n))return function(e,t){const n=e.getDatasetMeta(t),r=n&&e.isDatasetVisible(t);return r?n.dataset:null}(t,n);if("stack"===n)return function(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,a=r.points,s=function(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let e=0;e<r.length;e++){const o=r[e];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}(t,n);s.push(Np({x:null,y:t.bottom},r));for(let e=0;e<i.length;e++){const t=i[e];for(let e=t.start;e<=t.end;e++)Ip(o,a[e],s)}return new lp({points:o,options:{}})}(e);if("shape"===n)return!0;const o=function(e){const t=e.scale||{};if(t.getPointPositionForValue)return function(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,a=function(e,t,n){let r;return r="start"===e?n:"end"===e?t.options.reverse?t.min:t.max:il(e)?e.value:t.getBaseValue(),r}(n,t,i),s=[];if(r.grid.circular){const e=t.getPointPositionForValue(0,i);return new Rp({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(a)})}for(let e=0;e<o;++e)s.push(t.getPointPositionForValue(e,a));return s}(e);return function(e){const{scale:t={},fill:n}=e,r=function(e,t){let n=null;return"start"===e?n=t.bottom:"end"===e?n=t.top:il(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}(n,t);if(al(r)){const e=t.isHorizontal();return{x:e?r:null,y:e?null:r}}return null}(e)}(e);return o instanceof Rp?o:Np(o,r)}function Fp(e,t,n){const r=$p(t),{line:o,scale:i,axis:a}=t,s=o.options,l=s.fill,c=s.backgroundColor,{above:u=c,below:d=c}=l||{};r&&o.points.length&&(Ac(e,n),function(e,t){const{line:n,target:r,above:o,below:i,area:a,scale:s}=t,l=n._loop?"angle":t.axis;e.save(),"x"===l&&i!==o&&(jp(e,r,a.top),Bp(e,{line:n,target:r,color:o,scale:s,property:l}),e.restore(),e.save(),jp(e,r,a.bottom));Bp(e,{line:n,target:r,color:i,scale:s,property:l}),e.restore()}(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:a}),Lc(e))}function jp(e,t,n){const{segments:r,points:o}=t;let i=!0,a=!1;e.beginPath();for(const s of r){const{start:r,end:l}=s,c=o[r],u=o[Op(r,l,o)];i?(e.moveTo(c.x,c.y),i=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.y)),a=!!t.pathSegment(e,s,{move:a}),a?e.closePath():e.lineTo(u.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Bp(e,t){const{line:n,target:r,property:o,color:i,scale:a}=t,s=function(e,t,n){const r=e.segments,o=e.points,i=t.points,a=[];for(const e of r){let{start:r,end:s}=e;s=Op(r,s,o);const l=Pp(n,o[r],o[s],e.loop);if(!t.segments){a.push({source:e,target:l,start:o[r],end:o[s]});continue}const c=ju(t,l);for(const t of c){const r=Pp(n,i[t.start],i[t.end],t.loop),s=Fu(e,o,r);for(const e of s)a.push({source:e,target:t,start:{[n]:Tp(l,r,"start",Math.max)},end:{[n]:Tp(l,r,"end",Math.min)}})}}return a}(n,r,o);for(const{source:t,target:l,start:c,end:u}of s){const{style:{backgroundColor:s=i}={}}=t,d=!0!==r;e.save(),e.fillStyle=s,Hp(e,a,d&&Pp(o,c,u)),e.beginPath();const h=!!n.pathSegment(e,t);let p;if(d){h?e.closePath():Wp(e,r,u,o);const t=!!r.pathSegment(e,l,{move:h,reverse:!0});p=h&&t,p||Wp(e,r,c,o)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function Hp(e,t,n){const{top:r,bottom:o}=t.chart.chartArea,{property:i,start:a,end:s}=n||{};"x"===i&&(e.beginPath(),e.rect(a,r,s-a,o-r),e.clip())}function Wp(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var Vp={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,o=[];let i,a,s,l;for(a=0;a<r;++a)i=e.getDatasetMeta(a),s=i.dataset,l=null,s&&s.options&&s instanceof lp&&(l={visible:e.isDatasetVisible(a),index:a,fill:Lp(s,a,r),chart:e,axis:i.controller.options.indexAxis,scale:i.vScale,line:s}),i.$filler=l,o.push(l);for(a=0;a<r;++a)l=o[a],l&&!1!==l.fill&&(l.fill=Ap(o,a,n.propagate))},beforeDraw(e,t,n){const r="beforeDraw"===n.drawTime,o=e.getSortedVisibleDatasetMetas(),i=e.chartArea;for(let t=o.length-1;t>=0;--t){const n=o[t].$filler;n&&(n.line.updateControlPoints(i,n.axis),r&&n.fill&&Fp(e.ctx,n,i))}},beforeDatasetsDraw(e,t,n){if("beforeDatasetsDraw"!==n.drawTime)return;const r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){const n=r[t].$filler;Dp(n)&&Fp(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;Dp(r)&&"beforeDatasetDraw"===n.drawTime&&Fp(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Yp=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}};class Xp extends ah{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=ul(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter((t=>e.filter(t,this.chart.data)))),e.sort&&(t=t.sort(((t,n)=>e.sort(t,n,this.chart.data)))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const n=e.labels,r=Zc(n.font),o=r.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=Yp(n,o);let l,c;t.font=r.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(i,o,a,s)+10):(c=this.maxHeight,l=this._fitCols(i,r,a,s)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=r+a;let u=e;o.textAlign="left",o.textBaseline="middle";let d=-1,h=-c;return this.legendItems.forEach(((e,p)=>{const f=n+t/2+o.measureText(e.text).width;(0===p||l[l.length-1]+f+2*a>i)&&(u+=c,l[l.length-(p>0?0:1)]=0,h+=c,d++),s[p]={left:0,top:h,row:d,width:f,height:r},l[l.length-1]+=f+a})),u}_fitCols(e,t,n,r){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=i-e;let u=a,d=0,h=0,p=0,f=0;return this.legendItems.forEach(((e,i)=>{const{itemWidth:m,itemHeight:g}=function(e,t,n,r,o){const i=function(e,t,n,r){let o=e.text;o&&"string"!=typeof o&&(o=o.reduce(((e,t)=>e.length>t.length?e:t)));return t+n.size/2+r.measureText(o).width}(r,e,t,n),a=function(e,t,n){let r=e;"string"!=typeof t.text&&(r=qp(t,n));return r}(o,r,t.lineHeight);return{itemWidth:i,itemHeight:a}}(n,t,o,e,r);i>0&&h+g+2*a>c&&(u+=d+a,l.push({width:d,height:h}),p+=d+a,f++,d=h=0),s[i]={left:p,top:h,col:f,width:m,height:g},d=Math.max(d,m),h+=g+a})),u+=d,l.push({width:d,height:h}),u}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:o}}=this,i=Lu(o,this.left,this.width);if(this.isHorizontal()){let o=0,a=oc(n,this.left+r,this.right-this.lineWidths[o]);for(const s of t)o!==s.row&&(o=s.row,a=oc(n,this.left+r,this.right-this.lineWidths[o])),s.top+=this.top+e+r,s.left=i.leftForLtr(i.x(a),s.width),a+=s.width+r}else{let o=0,a=oc(n,this.top+e+r,this.bottom-this.columnSizes[o].height);for(const s of t)s.col!==o&&(o=s.col,a=oc(n,this.top+e+r,this.bottom-this.columnSizes[o].height)),s.top=a,s.left+=this.left+r,s.left=i.leftForLtr(i.x(s.left),s.width),a+=s.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;Ac(e,this),this._draw(),Lc(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:o,labels:i}=e,a=Cc.color,s=Lu(e.rtl,this.left,this.width),l=Zc(i.font),{padding:c}=i,u=l.size,d=u/2;let h;this.drawTitle(),r.textAlign=s.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:m}=Yp(i,u),g=this.isHorizontal(),v=this._computeTitleHeight();h=g?{x:oc(o,this.left+c,this.right-n[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:oc(o,this.top+v+c,this.bottom-t[0].height),line:0},Iu(this.ctx,e.textDirection);const y=m+c;this.legendItems.forEach(((b,_)=>{r.strokeStyle=b.fontColor,r.fillStyle=b.fontColor;const x=r.measureText(b.text).width,w=s.textAlign(b.textAlign||(b.textAlign=i.textAlign)),S=p+d+x;let k=h.x,C=h.y;s.setWidth(this.width),g?_>0&&k+S+c>this.right&&(C=h.y+=y,h.line++,k=h.x=oc(o,this.left+c,this.right-n[h.line])):_>0&&C+y>this.bottom&&(k=h.x=k+t[h.line].width+c,h.line++,C=h.y=oc(o,this.top+v+c,this.bottom-t[h.line].height));if(function(e,t,n){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;r.save();const o=ll(n.lineWidth,1);if(r.fillStyle=ll(n.fillStyle,a),r.lineCap=ll(n.lineCap,"butt"),r.lineDashOffset=ll(n.lineDashOffset,0),r.lineJoin=ll(n.lineJoin,"miter"),r.lineWidth=o,r.strokeStyle=ll(n.strokeStyle,a),r.setLineDash(ll(n.lineDash,[])),i.usePointStyle){const a={radius:f*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},l=s.xPlus(e,p/2);Nc(r,a,l,t+d,i.pointStyleWidth&&p)}else{const i=t+Math.max((u-f)/2,0),a=s.leftForLtr(e,p),l=qc(n.borderRadius);r.beginPath(),Object.values(l).some((e=>0!==e))?jc(r,{x:a,y:i,w:p,h:f,radius:l}):r.rect(a,i,p,f),r.fill(),0!==o&&r.stroke()}r.restore()}(s.x(k),C,b),k=((e,t,n,r)=>e===(r?"left":"right")?n:"center"===e?(t+n)/2:t)(w,k+p+d,g?k+S:this.right,e.rtl),function(e,t,n){Fc(r,n.text,e,t+m/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(k),C,b),g)h.x+=S+c;else if("string"!=typeof b.text){const e=l.lineHeight;h.y+=qp(b,e)+c}else h.y+=y})),zu(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,n=Zc(t.font),r=Uc(t.padding);if(!t.display)return;const o=Lu(e.rtl,this.left,this.width),i=this.ctx,a=t.position,s=n.size/2,l=r.top+s;let c,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,u=oc(e.align,u,this.right-d);else{const t=this.columnSizes.reduce(((e,t)=>Math.max(e,t.height)),0);c=l+oc(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const h=oc(a,u,u+d);i.textAlign=o.textAlign(rc(a)),i.textBaseline="middle",i.strokeStyle=t.color,i.fillStyle=t.color,i.font=n.string,Fc(i,t.text,h,c,n)}_computeTitleHeight(){const e=this.options.title,t=Zc(e.font),n=Uc(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,o;if(Ul(e,this.left,this.right)&&Ul(t,this.top,this.bottom))for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(r=o[n],Ul(e,r.left,r.left+r.width)&&Ul(t,r.top,r.top+r.height))return this.legendItems[n];return null}handleEvent(e){const t=this.options;if(!function(e,t){if(("mousemove"===e||"mouseout"===e)&&(t.onHover||t.onLeave))return!0;if(t.onClick&&("click"===e||"mouseup"===e))return!0;return!1}(e.type,t))return;const n=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const r=this._hoveredItem,o=((e,t)=>null!==e&&null!==t&&e.datasetIndex===t.datasetIndex&&e.index===t.index)(r,n);r&&!o&&ul(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!o&&ul(t.onHover,[e,n,this],this)}else n&&ul(t.onClick,[e,n,this],this)}}function qp(e,t){return t*(e.text?e.text.length:0)}var Up={id:"legend",_element:Xp,start(e,t,n){const r=e.legend=new Xp({ctx:e.ctx,options:n,chart:e});Hd.configure(e,r,n),Hd.addBox(e,r)},stop(e){Hd.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Hd.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map((e=>{const l=e.controller.getStyle(n?0:void 0),c=Uc(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:i,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:o||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:e.index}}),this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Zp extends ah{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const r=ol(n.text)?n.text.length:1;this._padding=Uc(n.padding);const o=r*Zc(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:n,bottom:r,right:o,options:i}=this,a=i.align;let s,l,c,u=0;return this.isHorizontal()?(l=oc(a,n,o),c=t+e,s=o-n):("left"===i.position?(l=n+e,c=oc(a,r,t),u=-.5*Cl):(l=o-e,c=oc(a,t,r),u=.5*Cl),s=r-t),{titleX:l,titleY:c,maxWidth:s,rotation:u}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=Zc(t.font),r=n.lineHeight/2+this._padding.top,{titleX:o,titleY:i,maxWidth:a,rotation:s}=this._drawArgs(r);Fc(e,t.text,0,0,n,{color:t.color,maxWidth:a,rotation:s,textAlign:rc(t.align),textBaseline:"middle",translation:[o,i]})}}var Gp={id:"title",_element:Zp,start(e,t,n){!function(e,t){const n=new Zp({ctx:e.ctx,options:t,chart:e});Hd.configure(e,n,t),Hd.addBox(e,n),e.titleBlock=n}(e,n)},stop(e){const t=e.titleBlock;Hd.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Hd.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Kp=new WeakMap;var Jp={id:"subtitle",start(e,t,n){const r=new Zp({ctx:e.ctx,options:n,chart:e});Hd.configure(e,r,n),Hd.addBox(e,r),Kp.set(e,r)},stop(e){Hd.removeBox(e,Kp.get(e)),Kp.delete(e)},beforeUpdate(e,t,n){const r=Kp.get(e);Hd.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qp={average(e){if(!e.length)return!1;let t,n,r=new Set,o=0,i=0;for(t=0,n=e.length;t<n;++t){const n=e[t].element;if(n&&n.hasValue()){const e=n.tooltipPosition();r.add(e.x),o+=e.y,++i}}if(0===i||0===r.size)return!1;const a=[...r].reduce(((e,t)=>e+t))/r.size;return{x:a,y:o/i}},nearest(e,t){if(!e.length)return!1;let n,r,o,i=t.x,a=t.y,s=Number.POSITIVE_INFINITY;for(n=0,r=e.length;n<r;++n){const r=e[n].element;if(r&&r.hasValue()){const e=Wl(t,r.getCenterPoint());e<s&&(s=e,o=r)}}if(o){const e=o.tooltipPosition();i=e.x,a=e.y}return{x:i,y:a}}};function ef(e,t){return t&&(ol(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function tf(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function nf(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:a,value:s}=i.getLabelAndValue(o);return{chart:e,label:a,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:s,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function rf(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:a,boxHeight:s}=t,l=Zc(t.bodyFont),c=Zc(t.titleFont),u=Zc(t.footerFont),d=i.length,h=o.length,p=r.length,f=Uc(t.padding);let m=f.height,g=0,v=r.reduce(((e,t)=>e+t.before.length+t.lines.length+t.after.length),0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){m+=p*(t.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(v-p)*l.lineHeight+(v-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let y=0;const b=function(e){g=Math.max(g,n.measureText(e).width+y)};return n.save(),n.font=c.string,dl(e.title,b),n.font=l.string,dl(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?a+2+t.boxPadding:0,dl(r,(e=>{dl(e.before,b),dl(e.lines,b),dl(e.after,b)})),y=0,n.font=u.string,dl(e.footer,b),n.restore(),g+=f.width,{width:g,height:m}}function of(e,t,n,r){const{x:o,width:i}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return"center"===r?c=o<=(s+l)/2?"left":"right":o<=i/2?c="left":o>=a-i/2&&(c="right"),function(e,t,n,r){const{x:o,width:i}=r,a=n.caretSize+n.caretPadding;return"left"===e&&o+i+a>t.width||"right"===e&&o-i-a<0||void 0}(c,e,t,n)&&(c="center"),c}function af(e,t,n){const r=n.yAlign||t.yAlign||function(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}(e,n);return{xAlign:n.xAlign||t.xAlign||of(e,t,n,r),yAlign:r}}function sf(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=qc(a);let f=function(e,t){let{x:n,width:r}=e;return"right"===t?n-=r:"center"===t&&(n-=r/2),n}(t,s);const m=function(e,t,n){let{y:r,height:o}=e;return"top"===t?r+=n:r-="bottom"===t?o+n:o/2,r}(t,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=Math.max(u,h)+o:"right"===s&&(f+=Math.max(d,p)+o),{x:ql(f,0,r.width-t.width),y:ql(m,0,r.height-t.height)}}function lf(e,t,n){const r=Uc(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function cf(e){return ef([],tf(e))}function uf(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const df={beforeTitle:tl,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:tl,beforeBody:tl,beforeLabel:tl,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return rl(n)||(t+=n),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:tl,afterBody:tl,beforeFooter:tl,footer:tl,afterFooter:tl};function hf(e,t,n,r){const o=e[t].call(n,r);return void 0===o?df[t].call(n,r):o}class pf extends ah{static positioners=Qp;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,o=new Zu(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=(e=this.chart.getContext(),t=this,n=this._tooltipItems,Kc(e,{tooltip:t,tooltipItems:n,type:"tooltip"})));var e,t,n}getTitle(e,t){const{callbacks:n}=t,r=hf(n,"beforeTitle",this,e),o=hf(n,"title",this,e),i=hf(n,"afterTitle",this,e);let a=[];return a=ef(a,tf(r)),a=ef(a,tf(o)),a=ef(a,tf(i)),a}getBeforeBody(e,t){return cf(hf(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:n}=t,r=[];return dl(e,(e=>{const t={before:[],lines:[],after:[]},o=uf(n,e);ef(t.before,tf(hf(o,"beforeLabel",this,e))),ef(t.lines,hf(o,"label",this,e)),ef(t.after,tf(hf(o,"afterLabel",this,e))),r.push(t)})),r}getAfterBody(e,t){return cf(hf(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:n}=t,r=hf(n,"beforeFooter",this,e),o=hf(n,"footer",this,e),i=hf(n,"afterFooter",this,e);let a=[];return a=ef(a,tf(r)),a=ef(a,tf(o)),a=ef(a,tf(i)),a}_createItems(e){const t=this._active,n=this.chart.data,r=[],o=[],i=[];let a,s,l=[];for(a=0,s=t.length;a<s;++a)l.push(nf(this.chart,t[a]));return e.filter&&(l=l.filter(((t,r,o)=>e.filter(t,r,o,n)))),e.itemSort&&(l=l.sort(((t,r)=>e.itemSort(t,r,n)))),dl(l,(t=>{const n=uf(e.callbacks,t);r.push(hf(n,"labelColor",this,t)),o.push(hf(n,"labelPointStyle",this,t)),i.push(hf(n,"labelTextColor",this,t))})),this.labelColors=r,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=l,l}update(e,t){const n=this.options.setContext(this.getContext()),r=this._active;let o,i=[];if(r.length){const e=Qp[n.position].call(this,r,this._eventPosition);i=this._createItems(n),this.title=this.getTitle(i,n),this.beforeBody=this.getBeforeBody(i,n),this.body=this.getBody(i,n),this.afterBody=this.getAfterBody(i,n),this.footer=this.getFooter(i,n);const t=this._size=rf(this,n),a=Object.assign({},e,t),s=af(this.chart,n,a),l=sf(n,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,o={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=i,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){const o=this.getCaretPosition(e,n,r);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,n){const{xAlign:r,yAlign:o}=this,{caretSize:i,cornerRadius:a}=n,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:u}=qc(a),{x:d,y:h}=e,{width:p,height:f}=t;let m,g,v,y,b,_;return"center"===o?(b=h+f/2,"left"===r?(m=d,g=m-i,y=b+i,_=b-i):(m=d+p,g=m+i,y=b-i,_=b+i),v=m):(g="left"===r?d+Math.max(s,c)+i:"right"===r?d+p-Math.max(l,u)-i:this.caretX,"top"===o?(y=h,b=y-i,m=g-i,v=g+i):(y=h+f,b=y+i,m=g+i,v=g-i),_=y),{x1:m,x2:g,x3:v,y1:y,y2:b,y3:_}}drawTitle(e,t,n){const r=this.title,o=r.length;let i,a,s;if(o){const l=Lu(n.rtl,this.x,this.width);for(e.x=lf(this,n.titleAlign,n),t.textAlign=l.textAlign(n.titleAlign),t.textBaseline="middle",i=Zc(n.titleFont),a=n.titleSpacing,t.fillStyle=n.titleColor,t.font=i.string,s=0;s<o;++s)t.fillText(r[s],l.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+a,s+1===o&&(e.y+=n.titleMarginBottom-a)}}_drawColorBox(e,t,n,r,o){const i=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:s,boxWidth:l}=o,c=Zc(o.bodyFont),u=lf(this,"left",o),d=r.x(u),h=s<c.lineHeight?(c.lineHeight-s)/2:0,p=t.y+h;if(o.usePointStyle){const t={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=r.leftForLtr(d,l)+l/2,c=p+s/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,Tc(e,t,n,c),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,Tc(e,t,n,c)}else{e.lineWidth=il(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,e.strokeStyle=i.borderColor,e.setLineDash(i.borderDash||[]),e.lineDashOffset=i.borderDashOffset||0;const t=r.leftForLtr(d,l),n=r.leftForLtr(r.xPlus(d,1),l-2),a=qc(i.borderRadius);Object.values(a).some((e=>0!==e))?(e.beginPath(),e.fillStyle=o.multiKeyBackground,jc(e,{x:t,y:p,w:l,h:s,radius:a}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),jc(e,{x:n,y:p+1,w:l-2,h:s-2,radius:a}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(t,p,l,s),e.strokeRect(t,p,l,s),e.fillStyle=i.backgroundColor,e.fillRect(n,p+1,l-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){const{body:r}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:c}=n,u=Zc(n.bodyFont);let d=u.lineHeight,h=0;const p=Lu(n.rtl,this.x,this.width),f=function(n){t.fillText(n,p.x(e.x+h),e.y+d/2),e.y+=d+o},m=p.textAlign(i);let g,v,y,b,_,x,w;for(t.textAlign=i,t.textBaseline="middle",t.font=u.string,e.x=lf(this,m,n),t.fillStyle=n.bodyColor,dl(this.beforeBody,f),h=a&&"right"!==m?"center"===i?l/2+c:l+2+c:0,b=0,x=r.length;b<x;++b){for(g=r[b],v=this.labelTextColors[b],t.fillStyle=v,dl(g.before,f),y=g.lines,a&&y.length&&(this._drawColorBox(t,e,b,p,n),d=Math.max(u.lineHeight,s)),_=0,w=y.length;_<w;++_)f(y[_]),d=u.lineHeight;dl(g.after,f)}h=0,d=u.lineHeight,dl(this.afterBody,f),e.y-=o}drawFooter(e,t,n){const r=this.footer,o=r.length;let i,a;if(o){const s=Lu(n.rtl,this.x,this.width);for(e.x=lf(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline="middle",i=Zc(n.footerFont),t.fillStyle=n.footerColor,t.font=i.string,a=0;a<o;++a)t.fillText(r[a],s.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){const{xAlign:o,yAlign:i}=this,{x:a,y:s}=e,{width:l,height:c}=n,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=qc(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(a+u,s),"top"===i&&this.drawCaret(e,t,n,r),t.lineTo(a+l-d,s),t.quadraticCurveTo(a+l,s,a+l,s+d),"center"===i&&"right"===o&&this.drawCaret(e,t,n,r),t.lineTo(a+l,s+c-p),t.quadraticCurveTo(a+l,s+c,a+l-p,s+c),"bottom"===i&&this.drawCaret(e,t,n,r),t.lineTo(a+h,s+c),t.quadraticCurveTo(a,s+c,a,s+c-h),"center"===i&&"left"===o&&this.drawCaret(e,t,n,r),t.lineTo(a,s+u),t.quadraticCurveTo(a,s,a+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,n=this.$animations,r=n&&n.x,o=n&&n.y;if(r||o){const n=Qp[e.position].call(this,this._active,this._eventPosition);if(!n)return;const i=this._size=rf(this,e),a=Object.assign({},n,this._size),s=af(t,e,a),l=sf(e,a,s,t);r._to===l.x&&o._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=i.width,this.height=i.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(t);const r={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const i=Uc(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=n,this.drawBackground(o,e,r,t),Iu(e,t.textDirection),o.y+=i.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),zu(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const n=this._active,r=e.map((({datasetIndex:e,index:t})=>{const n=this.chart.getDatasetMeta(e);if(!n)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:n.data[t],index:t}})),o=!hl(n,r),i=this._positionChanged(r,t);(o||i)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,o=this._active||[],i=this._getActiveElements(e,o,t,n),a=this._positionChanged(i,e),s=t||!hl(i,o)||a;return s&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){const o=this.options;if("mouseout"===e.type)return[];if(!r)return t.filter((e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)));const i=this.chart.getElementsAtEventForMode(e,o.mode,o,n);return o.reverse&&i.reverse(),i}_positionChanged(e,t){const{caretX:n,caretY:r,options:o}=this,i=Qp[o.position].call(this,e,t);return!1!==i&&(n!==i.x||r!==i.y)}}var ff={id:"tooltip",_element:pf,positioners:Qp,afterInit(e,t,n){n&&(e.tooltip=new pf({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:df},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},mf=Object.freeze({__proto__:null,Colors:kp,Decimation:Mp,Filler:Vp,Legend:Up,SubTitle:Jp,Title:Gp,Tooltip:ff});function gf(e,t,n,r){const o=e.indexOf(t);if(-1===o)return((e,t,n,r)=>("string"==typeof t?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n))(e,t,n,r);return o!==e.lastIndexOf(t)?n:o}function vf(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class yf extends gh{static id="category";static defaults={ticks:{callback:vf}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(rl(e))return null;const n=this.getLabels();return((e,t)=>null===e?null:ql(Math.round(e),0,t))(t=isFinite(t)&&n[t]===e?t:gf(n,e,ll(t,e),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:r}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,r=[];let o=this.getLabels();o=0===e&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){return vf.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function bf(e,t){const n=[],{bounds:r,step:o,min:i,max:a,precision:s,count:l,maxTicks:c,maxDigits:u,includeBounds:d}=e,h=o||1,p=c-1,{min:f,max:m}=t,g=!rl(i),v=!rl(a),y=!rl(l),b=(m-f)/(u+1);let _,x,w,S,k=zl((m-f)/p/h)*h;if(k<1e-14&&!g&&!v)return[{value:f},{value:m}];S=Math.ceil(m/k)-Math.floor(f/k),S>p&&(k=zl(S*k/p/h)*h),rl(s)||(_=Math.pow(10,s),k=Math.ceil(k*_)/_),"ticks"===r?(x=Math.floor(f/k)*k,w=Math.ceil(m/k)*k):(x=f,w=m),g&&v&&o&&function(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}((a-i)/o,k/1e3)?(S=Math.round(Math.min((a-i)/k,c)),k=(a-i)/S,x=i,w=a):y?(x=g?i:x,w=v?a:w,S=l-1,k=(w-x)/S):(S=(w-x)/k,S=Il(S,Math.round(S),k/1e3)?Math.round(S):Math.ceil(S));const C=Math.max(Bl(k),Bl(x));_=Math.pow(10,rl(s)?C:s),x=Math.round(x*_)/_,w=Math.round(w*_)/_;let E=0;for(g&&(d&&x!==i?(n.push({value:i}),x<i&&E++,Il(Math.round((x+E*k)*_)/_,i,_f(i,b,e))&&E++):x<i&&E++);E<S;++E){const e=Math.round((x+E*k)*_)/_;if(v&&e>a)break;n.push({value:e})}return v&&d&&w!==a?n.length&&Il(n[n.length-1].value,a,_f(a,b,e))?n[n.length-1].value=a:n.push({value:a}):v&&w!==a||n.push({value:w}),n}function _f(e,t,{horizontal:n,minRotation:r}){const o=Fl(r),i=(n?Math.sin(o):Math.cos(o))||.001,a=.75*t*(""+e).length;return Math.min(t/i,a)}class xf extends gh{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return rl(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this;const i=e=>r=t?r:e,a=e=>o=n?o:e;if(e){const e=Ll(r),t=Ll(o);e<0&&t<0?a(0):e>0&&t>0&&i(0)}if(r===o){let t=0===o?1:Math.abs(.05*o);a(o+t),e||i(r-t)}this.min=r,this.max=o}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:n,stepSize:r}=e;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(),n=n||11),n&&(t=Math.min(n,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const r=bf({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&$l(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return vc(e,this.chart.options.locale,this.options.ticks.format)}}class wf extends xf{static id="linear";static defaults={ticks:{callback:bc.formatters.numeric}};determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=al(e)?e:0,this.max=al(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,n=Fl(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/r))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const Sf=e=>Math.floor(Al(e)),kf=(e,t)=>Math.pow(10,Sf(e)+t);function Cf(e){return 1===e/Math.pow(10,Sf(e))}function Ef(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function Mf(e,{min:t,max:n}){t=sl(e.min,t);const r=[],o=Sf(t);let i=function(e,t){let n=Sf(t-e);for(;Ef(e,t,n)>10;)n++;for(;Ef(e,t,n)<10;)n--;return Math.min(n,Sf(e))}(t,n),a=i<0?Math.pow(10,Math.abs(i)):1;const s=Math.pow(10,i),l=o>i?Math.pow(10,o):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/s/10)*s*10;let d=Math.floor((c-u)/Math.pow(10,i)),h=sl(e.min,Math.round((l+u+d*Math.pow(10,i))*a)/a);for(;h<n;)r.push({value:h,major:Cf(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,a=i>=0?1:a),h=Math.round((l+u+d*Math.pow(10,i))*a)/a;const p=sl(e.max,h);return r.push({value:p,major:Cf(p),significand:d}),r}class Pf extends gh{static id="logarithmic";static defaults={ticks:{callback:bc.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const n=xf.prototype.parse.apply(this,[e,t]);if(0!==n)return al(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=al(e)?Math.max(0,e):null,this.max=al(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!al(this._userMin)&&(this.min=e===kf(this.min,0)?kf(this.min,-1):kf(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let n=this.min,r=this.max;const o=t=>n=e?n:t,i=e=>r=t?r:e;n===r&&(n<=0?(o(1),i(10)):(o(kf(n,-1)),i(kf(r,1)))),n<=0&&o(kf(r,-1)),r<=0&&i(kf(n,1)),this.min=n,this.max=r}buildTicks(){const e=this.options,t=Mf({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&$l(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return void 0===e?"0":vc(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Al(e),this._valueRange=Al(this.max)-Al(e)}getPixelForValue(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Al(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}function Of(e){const t=e.ticks;if(t.display&&e.display){const e=Uc(t.backdropPadding);return ll(t.font&&t.font.size,Cc.font.size)+e.height}return 0}function Tf(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function Nf(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],i=e._pointLabels.length,a=e.options.pointLabels,s=a.centerPointLabels?Cl/i:0;for(let d=0;d<i;d++){const i=a.setContext(e.getPointLabelContext(d));o[d]=i.padding;const h=e.getPointPosition(d,e.drawingArea+o[d],s),p=Zc(i.font),f=(l=e.ctx,c=p,u=ol(u=e._pointLabels[d])?u:[u],{w:Mc(l,c.string,u),h:u.length*c.lineHeight});r[d]=f;const m=Yl(e.getIndexAngle(d)+s),g=Math.round(jl(m));Df(n,t,m,Tf(g,h.x,f.w,0,180),Tf(g,h.y,f.h,90,270))}var l,c,u;e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=function(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:a,display:s}=i.pointLabels,l={extra:Of(i)/2,additionalAngle:a?Cl/o:0};let c;for(let i=0;i<o;i++){l.padding=n[i],l.size=t[i];const o=Af(e,i,l);r.push(o),"auto"===s&&(o.visible=Lf(o,c),o.visible&&(c=o))}return r}(e,r,o)}function Df(e,t,n,r,o){const i=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let s=0,l=0;r.start<t.l?(s=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+s)),o.start<t.t?(l=(t.t-o.start)/a,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/a,e.b=Math.max(e.b,t.b+l))}function Af(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:a,size:s}=n,l=e.getPointPosition(t,r+o+a,i),c=Math.round(jl(Yl(l.angle+Tl))),u=function(e,t,n){90===n||270===n?e-=t/2:(n>270||n<90)&&(e-=t);return e}(l.y,s.h,c),d=function(e){if(0===e||180===e)return"center";if(e<180)return"left";return"right"}(c),h=function(e,t,n){"right"===n?e-=t:"center"===n&&(e-=t/2);return e}(l.x,s.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+s.w,bottom:u+s.h}}function Lf(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Dc({x:n,y:r},t)||Dc({x:n,y:i},t)||Dc({x:o,y:r},t)||Dc({x:o,y:i},t))}function If(e,t,n){const{left:r,top:o,right:i,bottom:a}=n,{backdropColor:s}=t;if(!rl(s)){const n=qc(t.borderRadius),l=Uc(t.backdropPadding);e.fillStyle=s;const c=r-l.left,u=o-l.top,d=i-r+l.width,h=a-o+l.height;Object.values(n).some((e=>0!==e))?(e.beginPath(),jc(e,{x:c,y:u,w:d,h:h,radius:n}),e.fill()):e.fillRect(c,u,d,h)}}function zf(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,El);else{let n=e.getPointPosition(0,t);o.moveTo(n.x,n.y);for(let i=1;i<r;i++)n=e.getPointPosition(i,t),o.lineTo(n.x,n.y)}}class Rf extends xf{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:bc.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Uc(Of(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=al(e)&&!isNaN(e)?e:0,this.max=al(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Of(this.options))}generateTickLabels(e){xf.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map(((e,t)=>{const n=ul(this.options.pointLabels.callback,[e,t],this);return n||0===n?n:""})).filter(((e,t)=>this.chart.getDataVisibility(t)))}fit(){const e=this.options;e.display&&e.pointLabels.display?Nf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){return Yl(e*(El/(this._pointLabels.length||1))+Fl(this.options.startAngle||0))}getDistanceFromCenterForValue(e){if(rl(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(rl(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const n=t[e];return function(e,t,n){return Kc(e,{label:n,index:t,type:"pointLabel"})}(this.getContext(),e,n)}}getPointPosition(e,t,n=0){const r=this.getIndexAngle(e)-Tl+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:n,right:r,bottom:o}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const n=this.ctx;n.save(),n.beginPath(),zf(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:n,grid:r,border:o}=t,i=this._pointLabels.length;let a,s,l;if(t.pointLabels.display&&function(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const t=e._pointLabelItems[o];if(!t.visible)continue;const i=r.setContext(e.getPointLabelContext(o));If(n,i,t);const a=Zc(i.font),{x:s,y:l,textAlign:c}=t;Fc(n,e._pointLabels[o],s,l+a.lineHeight/2,a,{color:i.color,textAlign:c,textBaseline:"middle"})}}(this,i),r.display&&this.ticks.forEach(((e,t)=>{if(0!==t||0===t&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);const n=this.getContext(t),a=r.setContext(n),l=o.setContext(n);!function(e,t,n,r,o){const i=e.ctx,a=t.circular,{color:s,lineWidth:l}=t;!a&&!r||!s||!l||n<0||(i.save(),i.strokeStyle=s,i.lineWidth=l,i.setLineDash(o.dash||[]),i.lineDashOffset=o.dashOffset,i.beginPath(),zf(e,n,a,r),i.closePath(),i.stroke(),i.restore())}(this,a,s,i,l)}})),n.display){for(e.save(),a=i-1;a>=0;a--){const r=n.setContext(this.getPointLabelContext(a)),{color:o,lineWidth:i}=r;i&&o&&(e.lineWidth=i,e.strokeStyle=o,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),l=this.getPointPosition(a,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;const r=this.getIndexAngle(0);let o,i;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach(((r,a)=>{if(0===a&&this.min>=0&&!t.reverse)return;const s=n.setContext(this.getContext(a)),l=Zc(s.font);if(o=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){e.font=l.string,i=e.measureText(r.label).width,e.fillStyle=s.backdropColor;const t=Uc(s.backdropPadding);e.fillRect(-i/2-t.left,-o-l.size/2-t.top,i+t.width,l.size+t.height)}Fc(e,r.label,0,-o,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})})),e.restore()}drawTitle(){}}const $f={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}},Ff=Object.keys($f);function jf(e,t){return e-t}function Bf(e,t){if(rl(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let a=t;return"function"==typeof r&&(a=r(a)),al(a)||(a="string"==typeof r?n.parse(a,r):n.parse(a)),null===a?null:(o&&(a="week"!==o||!Rl(i)&&!0!==i?n.startOf(a,o):n.startOf(a,"isoWeek",i)),+a)}function Hf(e,t,n,r){const o=Ff.length;for(let i=Ff.indexOf(e);i<o-1;++i){const e=$f[Ff[i]],o=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((n-t)/(o*e.size))<=r)return Ff[i]}return Ff[o-1]}function Wf(e,t,n){if(n){if(n.length){const{lo:r,hi:o}=Zl(n,t);e[n[r]>=t?n[r]:n[o]]=!0}}else e[t]=!0}function Vf(e,t,n){const r=[],o={},i=t.length;let a,s;for(a=0;a<i;++a)s=t[a],o[s]=a,r.push({value:s,major:!1});return 0!==i&&n?function(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=i;s<=a;s=+o.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}(e,r,o,n):r}class Yf extends gh{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const n=e.time||(e.time={}),r=this._adapter=new wd._date(e.adapters.date);r.init(t),vl(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:Bf(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,n=e.time.unit||"day";let{min:r,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function s(e){i||isNaN(e.min)||(r=Math.min(r,e.min)),a||isNaN(e.max)||(o=Math.max(o,e.max))}i&&a||(s(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||s(this.getMinMax(!1))),r=al(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),o=al(o)&&!isNaN(o)?o:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,o-1),this.max=Math.max(r+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){const e=this.options,t=e.time,n=e.ticks,r="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const o=this.min,i=function(e,t,n){let r=0,o=e.length;for(;r<o&&e[r]<t;)r++;for(;o>r&&e[o-1]>n;)o--;return r>0||o<e.length?e.slice(r,o):e}(r,o,this.max);return this._unit=t.unit||(n.autoSkip?Hf(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(e,t,n,r,o){for(let i=Ff.length-1;i>=Ff.indexOf(n);i--){const n=Ff[i];if($f[n].common&&e._adapter.diff(o,r,n)>=t-1)return n}return Ff[n?Ff.indexOf(n):0]}(this,i.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(e){for(let t=Ff.indexOf(e)+1,n=Ff.length;t<n;++t)if($f[Ff[t]].common)return Ff[t]}(this._unit):void 0,this.initOffsets(r),e.reverse&&i.reverse(),Vf(this,i,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((e=>+e.value)))}initOffsets(e=[]){let t,n,r=0,o=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),r=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,n=this.getDecimalForValue(e[e.length-1]),o=1===e.length?n:(n-this.getDecimalForValue(e[e.length-2]))/2);const i=e.length<3?.5:.25;r=ql(r,0,i),o=ql(o,0,i),this._offsets={start:r,end:o,factor:1/(r+1+o)}}_generate(){const e=this._adapter,t=this.min,n=this.max,r=this.options,o=r.time,i=o.unit||Hf(o.minUnit,t,n,this._getLabelCapacity(t)),a=ll(r.ticks.stepSize,1),s="week"===i&&o.isoWeekday,l=Rl(s)||!0===s,c={};let u,d,h=t;if(l&&(h=+e.startOf(h,"isoWeek",s)),h=+e.startOf(h,l?"day":i),e.diff(n,t,i)>1e5*a)throw new Error(t+" and "+n+" are too far apart with stepSize of "+a+" "+i);const p="data"===r.ticks.source&&this.getDataTimestamps();for(u=h,d=0;u<n;u=+e.add(u,a,i),d++)Wf(c,u,p);return u!==n&&"ticks"!==r.bounds&&1!==d||Wf(c,u,p),Object.keys(c).sort(jf).map((e=>+e))}getLabelForValue(e){const t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){const n=this.options.time.displayFormats,r=this._unit,o=t||n[r];return this._adapter.format(e,o)}_tickFormatFunction(e,t,n,r){const o=this.options,i=o.ticks.callback;if(i)return ul(i,[e,t,n],this);const a=o.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],u=l&&a[l],d=n[t],h=l&&u&&d&&d.major;return this._adapter.format(e,r||(h?u:c))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,n=this.ctx.measureText(e).width,r=Fl(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(r),i=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*i,h:n*i+a*o}}_getLabelCapacity(e){const t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,o=this._tickFormatFunction(e,0,Vf(this,[e],this._majorUnit),r),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let e,t,n=this._cache.data||[];if(n.length)return n;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,t=r.length;e<t;++e)n=n.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const e=this._cache.labels||[];let t,n;if(e.length)return e;const r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(Bf(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return ec(e.sort(jf))}}function Xf(e,t,n){let r,o,i,a,s=0,l=e.length-1;n?(t>=e[s].pos&&t<=e[l].pos&&({lo:s,hi:l}=Gl(e,"pos",t)),({pos:r,time:i}=e[s]),({pos:o,time:a}=e[l])):(t>=e[s].time&&t<=e[l].time&&({lo:s,hi:l}=Gl(e,"time",t)),({time:r,pos:i}=e[s]),({time:o,pos:a}=e[l]));const c=o-r;return c?i+(a-i)*(t-r)/c:i}var qf=Object.freeze({__proto__:null,CategoryScale:yf,LinearScale:wf,LogarithmicScale:Pf,RadialLinearScale:Rf,TimeScale:Yf,TimeSeriesScale:class extends Yf{static id="timeseries";static defaults=Yf.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Xf(t,this.min),this._tableRange=Xf(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,r=[],o=[];let i,a,s,l,c;for(i=0,a=e.length;i<a;++i)l=e[i],l>=t&&l<=n&&r.push(l);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(i=0,a=r.length;i<a;++i)c=r[i+1],s=r[i-1],l=r[i],Math.round((c+s)/2)!==l&&o.push({time:l,pos:i/(a-1)});return o}_generate(){const e=this.min,t=this.max;let n=super.getDataTimestamps();return n.includes(e)&&n.length||n.splice(0,0,e),n.includes(t)&&1!==n.length||n.push(t),n.sort(((e,t)=>e-t))}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Xf(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Xf(this._table,n*this._tableRange+this._minPos,!0)}}});const Uf=[bd,vp,mf,qf];Uh.register(...Uf);const Zf=({type:t,data:n,options:r,className:o,style:i,plugins:a})=>{const c=s(null),u=s(null);return l((()=>{if(!c.current)return;const e=c.current.getContext("2d");return e?(u.current&&u.current.destroy(),u.current=new Uh(e,{type:t,data:n,options:r||{},plugins:a||[]}),()=>{u.current&&(u.current.destroy(),u.current=null)}):void 0}),[t,n,r,a]),e("canvas",{ref:c,className:o,style:i})};var Gf="Checkbox-module_container__v4ouY",Kf="Checkbox-module_disabled__PAavY",Jf="Checkbox-module_checkbox__tiPi8",Qf="Checkbox-module_indeterminate__GxPm3";var em=a((({checked:n=!1,disabled:r=!1,label:o,indeterminate:i=!1,labelProps:a,onChange:c,id:u,checkBoxClassName:d,...h})=>{const p=s(null),m=s(null),g=f();l((()=>{p.current&&(p.current.indeterminate=i)}),[i]),l((()=>{if(!n||i)return;const e=m.current;if(!e)return;e.style.transform="translateZ(0)";const t=requestAnimationFrame((()=>{e.style.transform=""}));return()=>{cancelAnimationFrame(t),e&&(e.style.transform="")}}),[n,i]);return e(H,{...h,onClick:e=>{r||c?.(e)},dimensionY:36,className:`${h.className} ${Gf} ${r&&Kf}`,prefix:{children:t("div",{className:`${Jf} ${i&&Qf} ${d}`,children:[e("input",{id:u??g,ref:p,type:"checkbox",checked:n,disabled:r,"aria-checked":i?"mixed":n,readOnly:!0}),e("label",{ref:m,htmlFor:u??g,onClick:e=>e.stopPropagation()})]}),...h.prefix},root:{children:e(V,{...a,children:o}),...h.root}})})),tm={chip:"Chip-module_chip__DLgqh",outlined:"Chip-module_outlined__1seXI",filled:"Chip-module_filled__iKdFt",noButton:"Chip-module_noButton__nEh--",closeButton:"Chip-module_closeButton__83TVb"};var nm=a((({label:t,variant:n="filled",icon:r,onDelete:o,suffixIcon:i,suffixOnClick:a,...s})=>e(H,{dimensionX:"hug",gap:8,prefix:{dimensionX:"hug",children:r?e(Ga,{name:r}):void 0,...s.prefix},root:{children:t,...s.root},suffix:(i||o)&&{dimensionX:"hug",alignment:"center",children:e(xs,{className:tm.closeButton,shape:"circle",color:"transparent",onClick:i?a:o,children:e(Ga,{name:i||"close"})}),...s.suffix},...s,className:`${s.className} ${tm.chip} ${tm[n]} ${o||i?"":tm.noButton}`}))),rm="Color-module_color__icl6l";var om=a((({value:t="#000000",prefixProps:n,rootProps:r,onChange:o,...i})=>e(H,{dimensionY:36,prefix:{children:e("input",{type:"color",value:t,onChange:e=>{o?.(e.target.value)}}),...n},root:{children:t&&e(V,{children:t}),...r},...i,className:`${i?.className} ${rm}`})));const im=(e,t,n)=>Math.min(Math.max(e,t),n),am=(e,t=0)=>{const n=Math.pow(10,t);return Math.round(e*n)/n},sm=(e,t,n)=>{e/=255,t/=255,n/=255;const r=Math.max(e,t,n),o=Math.min(e,t,n),i=r-o,a=r+o,s=a/2;if(0===i)return{h:0,s:0,l:am(100*s,1)};const l=s>.5?i/(2-a):i/a;let c;switch(r){case e:c=(t-n)/i+(t<n?6:0);break;case t:c=(n-e)/i+2;break;case n:c=(e-t)/i+4;break;default:c=0}return{h:am(60*c,1),s:am(100*l,1),l:am(100*s,1)}},lm=(e,t,n)=>{if(e/=360,n/=100,0===(t/=100)){const e=Math.round(255*n);return{r:e,g:e,b:e}}const r=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),o=n<.5?n*(1+t):n+t-n*t,i=2*n-o;return{r:Math.round(255*r(i,o,e+1/3)),g:Math.round(255*r(i,o,e)),b:Math.round(255*r(i,o,e-1/3))}},cm=(e,t,n)=>{e/=360;const r=(n/=100)*(t/=100),o=r*(1-Math.abs(6*e%2-1)),i=n-r;let a,s,l;return[a,s,l]=e<1/6?[r,o,0]:e<2/6?[o,r,0]:e<.5?[0,r,o]:e<4/6?[0,o,r]:e<5/6?[o,0,r]:[r,0,o],{r:Math.round(255*(a+i)),g:Math.round(255*(s+i)),b:Math.round(255*(l+i))}},um=({r:e,g:t,b:n,a:r})=>{const o=e=>{const t=Math.round(im(e,0,255)).toString(16);return 1===t.length?"0"+t:t},i=`#${o(e)}${o(t)}${o(n)}`.toUpperCase();if(r<1){return`${i}${o(255*r)}`}return i},dm=e=>{if(3===(e=e.replace("#","")).length&&(e=e.split("").map((e=>e+e)).join("")),6===e.length){return{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}}if(8===e.length){return{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:parseInt(e.substr(6,2),16)/255}}return null},hm=e=>{const t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);return t?{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3]),a:t[4]?parseFloat(t[4]):1}:null},pm=e=>{const t=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+))?\s*\)/);return t?{h:parseFloat(t[1]),s:parseFloat(t[2]),l:parseFloat(t[3]),a:t[4]?parseFloat(t[4]):1}:null},fm=e=>{const t=e.trim().toLowerCase();if(t.startsWith("#")){const e=dm(t);if(e){const t=sm(e.r,e.g,e.b);return{hex:um(e),rgb:e,hsl:{...t,a:e.a}}}}if(t.startsWith("rgb")){const e=hm(t);if(e){const t=sm(e.r,e.g,e.b);return{hex:um(e),rgb:e,hsl:{...t,a:e.a}}}}if(t.startsWith("hsl")){const e=pm(t);if(e){const t=lm(e.h,e.s,e.l);return{hex:um({...t,a:e.a}),rgb:{...t,a:e.a},hsl:e}}}return{hex:"#1677FF",rgb:{r:22,g:119,b:255,a:1},hsl:{h:220,s:100,l:54,a:1}}},mm=e=>{const t=((e,t,n)=>{e/=255,t/=255,n/=255;const r=Math.max(e,t,n),o=r-Math.min(e,t,n),i=r,a=0===r?0:o/r;let s;if(0===o)s=0;else{switch(r){case e:s=(t-n)/o+(t<n?6:0);break;case t:s=(n-e)/o+2;break;case n:s=(e-t)/o+4;break;default:s=0}s/=6}return{h:am(360*s,1),s:am(100*a,1),v:am(100*i,1)}})(e.rgb.r,e.rgb.g,e.rgb.b);return{...t,a:e.rgb.a}},gm=e=>{const t=cm(e.h,e.s,e.v),n=sm(t.r,t.g,t.b);return{hex:um({...t,a:e.a}),rgb:{...t,a:e.a},hsl:{...n,a:e.a}}},vm=(e={})=>{const{onDragStart:t,onDrag:n,onDragEnd:r,onKeyDown:o,preventSelection:i=!0}=e,[a,d]=u({isDragging:!1,startX:0,startY:0,currentX:0,currentY:0}),h=s(null),p=s({left:0,top:0,width:0,height:0}),f=s(void 0),m=s(0),g=c((()=>{if(h.current){const e=h.current.getBoundingClientRect();p.current={left:e.left,top:e.top,width:e.width,height:e.height}}}),[]),v=c((e=>{if("touches"in e){const t=e.touches[0]||e.changedTouches[0];return{x:t.clientX,y:t.clientY}}return{x:e.clientX,y:e.clientY}}),[]),y=c(((e,t)=>{const n=p.current,r=(e-n.left)/n.width,o=(t-n.top)/n.height;return{x:Math.max(0,Math.min(1,r)),y:Math.max(0,Math.min(1,o))}}),[]),b=c(((e,t)=>{const r=performance.now();f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame((()=>{if(r-m.current>=16){const{x:o,y:i}=y(e,t);n?.(o,i,p.current),m.current=r}}))}),[y,n]),_=c((e=>{e.preventDefault(),g();const{x:n,y:r}=v(e);d({isDragging:!0,startX:n,startY:r,currentX:n,currentY:r}),t?.(e),b(n,r),i&&(document.body.style.userSelect="none",document.body.style.webkitUserSelect="none")}),[v,b,t,i,g]),x=c((e=>{if(!a.isDragging)return;e.preventDefault();const{x:t,y:n}=v(e);d((e=>({...e,currentX:t,currentY:n}))),b(t,n)}),[a.isDragging,v,b]),w=c((()=>{a.isDragging&&(d((e=>({...e,isDragging:!1}))),r?.(),i&&(document.body.style.userSelect="",document.body.style.webkitUserSelect=""),f.current&&cancelAnimationFrame(f.current))}),[a.isDragging,r,i]),S=c((e=>{e.preventDefault(),g();const{x:n,y:r}=v(e);d({isDragging:!0,startX:n,startY:r,currentX:n,currentY:r}),t?.(e),b(n,r)}),[v,b,t,g]),k=c((e=>{if(!a.isDragging)return;e.preventDefault();const{x:t,y:n}=v(e);d((e=>({...e,currentX:t,currentY:n}))),b(t,n)}),[a.isDragging,v,b]),C=c((()=>{a.isDragging&&(d((e=>({...e,isDragging:!1}))),r?.(),f.current&&cancelAnimationFrame(f.current))}),[a.isDragging,r]),E=c((e=>{o?.(e)}),[o]),M=c((()=>{g()}),[g]);return l((()=>{const e=h.current;if(e)return e.addEventListener("mousedown",_),e.addEventListener("touchstart",S,{passive:!1}),e.addEventListener("keydown",E),()=>{e.removeEventListener("mousedown",_),e.removeEventListener("touchstart",S),e.removeEventListener("keydown",E)}}),[_,S,E]),l((()=>{if(a.isDragging)return document.addEventListener("mousemove",x),document.addEventListener("mouseup",w),document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("touchend",C),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",w),document.removeEventListener("touchmove",k),document.removeEventListener("touchend",C)}}),[a.isDragging,x,w,k,C]),l((()=>(window.addEventListener("resize",M),()=>window.removeEventListener("resize",M))),[M]),l((()=>()=>{f.current&&cancelAnimationFrame(f.current)}),[]),{elementRef:h,dragState:a,updateBounds:g}};var ym="ColorPicker-module_trigger__5Ukgm",bm="ColorPicker-module_triggerLabel__1qiCq",_m="ColorPicker-module_swatch__t-pF4",xm="ColorPicker-module_swatchColor__A-5J8",wm="ColorPicker-module_svPanel__Cr8Xb",Sm="ColorPicker-module_svBackground__VgABR",km="ColorPicker-module_svHandle__gPxoY",Cm="ColorPicker-module_slidersContainer__etZz6",Em="ColorPicker-module_sliders__Xpo3f",Mm="ColorPicker-module_slider__HmNSH",Pm="ColorPicker-module_hueSlider__smchE",Om="ColorPicker-module_alphaSlider__7bImL",Tm="ColorPicker-module_alphaGradient__pIdQ6",Nm="ColorPicker-module_sliderHandle__S-ghs",Dm="ColorPicker-module_formatSelect__5tLPh",Am="ColorPicker-module_colorInput__6ajlG",Lm="ColorPicker-module_error__tj3WS",Im="ColorPicker-module_alphaInputContainer__-RszK",zm="ColorPicker-module_alphaInput__IcWZ-",Rm="ColorPicker-module_preview__2wBPl",$m="ColorPicker-module_previewColor__7da0X",Fm="Select-module_container__txDHr",jm="Select-module_disabled__RJ71M",Bm="Select-module_displayer__gzmxI",Hm="Select-module_selectDropdown__HBmga",Wm="Portal-module_container__QcS9f";const Vm=m(null);function Ym(){let e=0;const t=[],n=e=>{if(!e.target)return;const n=e.target;for(let r=t.length-1;r>=0;r--){const o=t[r];if(o.refs.some((e=>e.current?.contains(n))))return;return void o.onClickOutside(e)}};return{register(e){t.push(e)},unregister(e){const n=t.findIndex((t=>t.id===e));-1!==n&&t.splice(n,1)},nextId:()=>++e,attach(){document.addEventListener("mousedown",n)},detach(){document.removeEventListener("mousedown",n)}}}let Xm=null;const qm=({children:t})=>{const n=s(null);n.current||(n.current=Ym());const r=n.current;l((()=>(r.attach(),()=>r.detach())),[r]);const o={register:r.register,unregister:r.unregister,nextId:r.nextId};return e(Vm.Provider,{value:o,children:t})};function Um(){const e=p(Vm);return e||(Xm||(Xm=Ym(),Xm.attach()),Xm)}function Zm(e,t,n=!0){const r=Um(),o=s(null),i=s(t);i.current=t;const a=c((e=>{i.current?.(e)}),[]);l((()=>{if(!n||!t)return void(null!==o.current&&(r.unregister(o.current),o.current=null));const i=r.nextId();return o.current=i,r.register({id:i,refs:e,onClickOutside:a}),()=>{r.unregister(i),o.current=null}}),[n,r,a,...e])}const Gm=({children:t,className:n,onClickOutside:r,additionalRefs:o=[]})=>{const i=s(null);return Zm([i,...o],r,!!r),l((()=>{const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}),[]),M.createPortal(e("div",{ref:i,className:`${Wm} ${n||""}`,children:t}),document.body)};var Km="SelectOption-module_option__wQb8V",Jm="SelectOption-module_disabled__m5fGS",Qm="SelectOption-module_selected__A6Rky",eg="SelectOption-module_displayer__lEn8X";var tg=a((({option:t,selected:n,multiple:r,disabled:o,onSelect:i,onClick:a,...s})=>{const{value:l,label:c}="object"==typeof t?{value:t.value,label:t.label}:{value:t,label:t};return e(H,{dimensionX:"fill",dimensionY:36,alignment:"leftCenter",onClick:a,root:{children:e(em,{disabled:o,dimensionX:"fill",checked:n,label:c,alignment:"leftCenter",prefix:r?void 0:{children:null},root:{className:`${s.root?.className} ${eg}`},labelProps:{className:eg}}),dimensionX:"fill"},...s,className:`${Km} ${n&&Qm} ${o&&Jm} ${s.className||""}`})}));var ng=a((({value:r,options:o,placeholder:i="Select an option",placement:a="bottom",multiple:c=!1,disabled:h=!1,maxCount:p,popupClassName:f="",optionProps:m,selectRef:v,disableClick:y,onChange:b,externalDropdownRef:_,...x})=>{const[w,S]=u(!1),[k,C]=u(r||(c?[]:null));l((()=>{(r||0===r||""===r)&&C(r)}),[r]);const E=s(null),M=s(null);g(_??{current:null},(()=>M.current));const{targetPosition:P,calculatePosition:O}=ee({containerRef:E,targetRef:M,initialPlacement:a});d((()=>{w&&E.current&&M.current&&O()}),[w,o,O]);g(v,(()=>({toggleDropdown:N,clear:T})));const T=()=>{C([]),b?.([]),S(!1)},N=e=>{S(void 0===e?e=>!e:e)},D=e=>"object"!=typeof o[0]?String(e):L(e),A=e=>e.length?"object"==typeof o[0]?e.map((e=>L(e))).join(", "):e.join(", "):i,L=e=>o.find((t=>t.value===e))?.label;return t(n,{children:[e(H,{ref:E,onClick:()=>{h||y||N()},dimensionX:"fill",dimensionY:36,...x,root:{children:e(V,{style:x.root?.style,className:`${x.root?.className} ${Bm}`,children:k?c?A(k):D(k):i}),dimensionX:"fill",alignment:"leftCenter"},suffix:{children:e(Ga,{name:"chevronDown"})},className:`${x.className} ${Fm} ${h&&jm}`}),w&&e(Gm,{onClickOutside:()=>{y||S(!1)},additionalRefs:[E],children:e(B,{ref:M,style:{...P},className:`${f} ${Hm}`,direction:"vertical",alignment:"leftTop",gap:0,children:o.map((t=>{const n="object"==typeof t?t.value:t,r=c?Array.isArray(k)&&k.includes(n):k===n,o=c&&!!p&&Array.isArray(k)&&k.length>=p&&!r;return e(tg,{disabled:o,dimensionX:E.current?.offsetWidth,multiple:c,option:t,selected:r,onClick:()=>(e=>{c?(()=>{if(!Array.isArray(k))return;const t=k.includes(e)?k.filter((t=>t!==e)):[...k,e];C(t),b?.(t)})():(C(e),b?.(e),S(!1))})(n),...m},n.toString())}))})})]})}));const rg=(e,t)=>{switch(t){case"hex":default:return e.hex;case"rgb":return((e,t,n,r)=>1===r?`rgb(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)})`:`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${am(r,2)})`)(e.rgb.r,e.rgb.g,e.rgb.b,e.rgb.a);case"hsl":return((e,t,n,r)=>1===r?`hsl(${Math.round(e)}, ${Math.round(t)}%, ${Math.round(n)}%)`:`hsla(${Math.round(e)}, ${Math.round(t)}%, ${Math.round(n)}%, ${am(r,2)})`)(e.hsl.h,e.hsl.s,e.hsl.l,e.hsl.a)}},og=({value:n,defaultValue:r="#1677FF",onChange:o,format:a="hex",placement:d="bottomStart",disabled:h=!1,id:p,triggerDisplay:f="complete",containerProps:m,contentProps:g,...v})=>{const[y,b]=u(!1),[_,x]=u(a),[w,S]=u(""),[k,C]=u(!1),[E,M]=u("100"),P=i((()=>fm(n??r)),[n,r]),[O,T]=u(P),[N,D]=u((()=>mm(P))),A=s(null),L=s(null),I=s(null),z=s(null);l((()=>{if(void 0!==n){const e=fm(n);T(e),D(mm(e))}}),[n]),l((()=>{S(rg(O,_)),M(Math.round(100*O.rgb.a).toString())}),[O,_]);const R=c((e=>{T(e),D(mm(e)),o?.(e)}),[o]),$=vm({onDrag:(e,t)=>{const n={...N,s:100*e,v:100*(1-t)};D(n),R(gm(n))},onKeyDown:e=>{const t=e.shiftKey?10:1;let n=N.s,r=N.v;switch(e.key){case"ArrowLeft":e.preventDefault(),n=im(N.s-t,0,100);break;case"ArrowRight":e.preventDefault(),n=im(N.s+t,0,100);break;case"ArrowUp":e.preventDefault(),r=im(N.v+t,0,100);break;case"ArrowDown":e.preventDefault(),r=im(N.v-t,0,100)}if(n!==N.s||r!==N.v){const e={...N,s:n,v:r};D(e),R(gm(e))}}}),F=vm({onDrag:e=>{const t={...N,h:360*e};D(t),R(gm(t))},onKeyDown:e=>{const t=e.shiftKey?10:1;let n=N.h;switch(e.key){case"ArrowLeft":e.preventDefault(),n=(N.h-t+360)%360;break;case"ArrowRight":e.preventDefault(),n=(N.h+t)%360}if(n!==N.h){const e={...N,h:n};D(e),R(gm(e))}}}),j=vm({onDrag:e=>{const t={...N,a:e};D(t),R(gm(t))},onKeyDown:e=>{const t=e.shiftKey?.1:.01;let n=N.a;switch(e.key){case"ArrowLeft":e.preventDefault(),n=im(N.a-t,0,1);break;case"ArrowRight":e.preventDefault(),n=im(N.a+t,0,1)}if(n!==N.a){const e={...N,a:n};D(e),R(gm(e))}}}),H=e=>{if(S(e),e.trim()){const t=(e=>{const t=e.trim().toLowerCase();if(t.startsWith("#")){const e=dm(t);if(e){const t=sm(e.r,e.g,e.b);return{hex:um(e),rgb:e,hsl:{...t,a:e.a}}}return null}if(t.startsWith("rgb")){const e=hm(t);if(e){const t=sm(e.r,e.g,e.b);return{hex:um(e),rgb:e,hsl:{...t,a:e.a}}}return null}if(t.startsWith("hsl")){const e=pm(t);if(e){const t=lm(e.h,e.s,e.l);return{hex:um({...t,a:e.a}),rgb:{...t,a:e.a},hsl:e}}return null}return null})(e);t?(T(t),D(mm(t)),o?.(t),C(!1)):C(!0)}else C(!1)},W=i((()=>{const e=cm(N.h,100,100);return{backgroundColor:`rgb(${e.r}, ${e.g}, ${e.b})`}}),[N.h]),V=i((()=>({left:`${N.s}%`,top:100-N.v+"%"})),[N.s,N.v]),Y=i((()=>({left:N.h/360*100+"%"})),[N.h]),X=i((()=>{const e=cm(N.h,N.s,N.v);return{background:`linear-gradient(to right, rgba(${e.r}, ${e.g}, ${e.b}, 0), rgba(${e.r}, ${e.g}, ${e.b}, 1))`}}),[N.h,N.s,N.v]),q=i((()=>({left:100*N.a+"%"})),[N.a]),U=i((()=>({backgroundColor:um(O.rgb)})),[O.rgb]),Z=()=>{h||b(!y)};l((()=>{const e=e=>{"Escape"===e.key&&y&&(b(!1),A.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[y]);const K="hex"===_?O.hex:w,J="only-code"!==f,Q="only-color"!==f;return e(jA,{content:t(B,{gap:5,direction:"vertical",children:[t("div",{ref:e=>{L.current=e,$.elementRef&&e&&($.elementRef.current=e)},className:wm,style:W,tabIndex:0,role:"application","aria-label":"Saturation and brightness color picker",children:[e("div",{className:Sm}),e("div",{className:km,style:V})]}),t("div",{className:Cm,children:[t("div",{className:Em,children:[e("div",{ref:e=>{I.current=e,F.elementRef&&e&&(F.elementRef.current=e)},className:`${Mm} ${Pm}`,tabIndex:0,role:"slider","aria-label":"Hue","aria-valuenow":Math.round(N.h),"aria-valuemin":0,"aria-valuemax":360,"aria-valuetext":`Hue ${Math.round(N.h)} degrees`,children:e("div",{className:Nm,style:Y})}),t("div",{ref:e=>{z.current=e,j.elementRef&&e&&(j.elementRef.current=e)},className:`${Mm} ${Om}`,tabIndex:0,role:"slider","aria-label":"Alpha","aria-valuenow":Math.round(100*N.a),"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":`Alpha ${Math.round(100*N.a)}%`,children:[e("div",{className:Tm,style:X}),e("div",{className:Nm,style:q})]})]}),e("div",{className:Rm,children:e("div",{className:$m,style:U})})]}),t(B,{gap:5,direction:"horizontal",children:[e(ng,{className:Dm,value:_,options:[{value:"hex",label:"HEX"},{value:"rgb",label:"RGB"},{value:"hsl",label:"HSL"}],onChange:e=>x(e),dimensionY:32}),e(G,{type:"text",className:`${Am} ${k?Lm:""}`,value:w,onChange:e=>H(e.target.value),onBlur:()=>{if(k||!w.trim())S(rg(O,_)),C(!1);else try{const e=fm(w);R(e),C(!1)}catch{C(!0),S(rg(O,_))}},"aria-label":"Color value","aria-invalid":k,dimensionY:32}),t(B,{className:Im,children:[e(G,{type:"text",className:zm,value:E,onChange:e=>(e=>{M(e);const t=Number.parseFloat(e);if(!Number.isNaN(t)&&t>=0&&t<=100){const e={...N,a:t/100};D(e),R(gm(e))}})(e.target.value),"aria-label":"Alpha percentage",dimensionY:32,dimensionX:30}),e("span",{children:"%"})]})]})]}),open:y,onClose:()=>b(!1),arrow:!0,placement:"bottom",containerProps:{alignment:"leftCenter",...m},contentProps:g,children:t(xs,{variant:"text",className:ym,onClick:Z,onKeyDown:e=>{"Enter"===e.key||" "===e.key?(e.preventDefault(),Z()):"Escape"===e.key&&y&&b(!1)},disabled:h,"aria-label":"Open color picker","aria-expanded":y,"aria-haspopup":"dialog",id:p,"data-display":f,fullWidth:!0,containerProps:{dimensionX:"fill"},children:[J&&e("div",{className:_m,children:e("div",{className:xm,style:U})}),Q&&e("span",{className:bm,children:K})]})})};var ig={container:"DashboardItem-module_container__Cu2fp",settingButton:"DashboardItem-module_settingButton__EVb24",header:"DashboardItem-module_header__1Ltls",chartContainer:"DashboardItem-module_chartContainer__xibFh",chart:"DashboardItem-module_chart__a5kGE"},ag="Section-module_sectionContainer__qECl2",sg="Section-module_header__1oDhY",lg="Section-module_content__3PfOv",cg="Section-module_footer__KPdum";const ug=a((({children:t,...n})=>e(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${sg} ${n.className}`,children:t}))),dg=a((({children:t,...n})=>e(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${lg} ${n.className}`,children:t}))),hg=a((({children:t,...n})=>e(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${cg} ${n.className}`,children:t}))),pg=a((({children:t,...n})=>e(B,{dimensionX:"fill",dimensionY:"fill",direction:"vertical",gap:0,...n,className:`${n.className} ${ag}`,children:t})));pg.Header=ug,pg.Content=dg,pg.Footer=hg;const fg=({headerProps:n,chartProps:r})=>t(pg,{className:ig.dashboardItem,children:[t(pg.Header,{children:[e(V,{children:n?.content}),n?.suffix||e(xs,{color:"transparent",shape:"circle",className:ig.settingButton,children:e(Ga,{name:"cog",className:ig.settingIcon,size:"xs"})})]}),e(pg.Content,{children:e(Zf,{type:r?.type,data:r?.data,options:r?.options,className:ig.chart})})]});var mg,gg={exports:{}};
49
+ */class Vu{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,n,r){const o=t.listeners[r],i=t.duration;o.forEach((r=>r({chart:e,initial:t.initial,numSteps:i,currentStep:Math.min(n-t.start,i)})))}_refresh(){this._request||(this._running=!0,this._request=tc.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(e=Date.now()){let t=0;this._charts.forEach(((n,r)=>{if(!n.running||!n.items.length)return;const o=n.items;let i,a=o.length-1,s=!1;for(;a>=0;--a)i=o[a],i._active?(i._total>n.duration&&(n.duration=i._total),i.tick(e),s=!0):(o[a]=o[o.length-1],o.pop());s&&(r.draw(),this._notify(r,n,e,"progress")),o.length||(n.running=!1,this._notify(r,n,e,"complete"),n.initial=!1),t+=o.length})),this._lastDate=e,0===t&&(this._running=!1)}_getAnims(e){const t=this._charts;let n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){t&&t.length&&this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce(((e,t)=>Math.max(e,t._duration)),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!!(t&&t.running&&t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const n=t.items;let r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Yu=new Vu;const Xu="transparent",qu={boolean:(e,t,n)=>n>.5?t:e,color(e,t,n){const r=hc(e||Xu),o=r.valid&&hc(t||Xu);return o&&o.valid?o.mix(r,n).hexString():t},number:(e,t,n)=>e+(t-e)*n};class Uu{constructor(e,t,n,r){const o=t[n];r=Gc([e.to,r,o,e.from]);const i=Gc([e.from,o,r]);this._active=!0,this._fn=e.fn||qu[e.type||typeof i],this._easing=uc[e.easing]||uc.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);const r=this._target[this._prop],o=n-this._start,i=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(i,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=Gc([e.to,t,r,e.from]),this._from=Gc([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,n=this._duration,r=this._prop,o=this._from,i=this._loop,a=this._to;let s;if(this._active=o!==a&&(i||t<n),!this._active)return this._target[r]=a,void this._notify(!0);t<0?this._target[r]=o:(s=t/n%2,s=i&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(o,a,s))}wait(){const e=this._promises||(this._promises=[]);return new Promise(((t,n)=>{e.push({res:t,rej:n})}))}_notify(e){const t=e?"res":"rej",n=this._promises||[];for(let e=0;e<n.length;e++)n[e][t]()}}class Zu{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!il(e))return;const t=Object.keys(Cc.animation),n=this._properties;Object.getOwnPropertyNames(e).forEach((r=>{const o=e[r];if(!il(o))return;const i={};for(const e of t)i[e]=o[e];(ol(o.properties)&&o.properties||[r]).forEach((e=>{e!==r&&n.has(e)||n.set(e,i)}))}))}_animateOptions(e,t){const n=t.options,r=function(e,t){if(!t)return;let n=e.options;if(!n)return void(e.options=t);n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(e,n);if(!r)return[];const o=this._createAnimations(r,n);return n.$shared&&function(e,t){const n=[],r=Object.keys(t);for(let t=0;t<r.length;t++){const o=e[r[t]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}(e.options.$animations,n).then((()=>{e.options=n}),(()=>{})),o}_createAnimations(e,t){const n=this._properties,r=[],o=e.$animations||(e.$animations={}),i=Object.keys(t),a=Date.now();let s;for(s=i.length-1;s>=0;--s){const l=i[s];if("$"===l.charAt(0))continue;if("options"===l){r.push(...this._animateOptions(e,t));continue}const c=t[l];let u=o[l];const d=n.get(l);if(u){if(d&&u.active()){u.update(d,c,a);continue}u.cancel()}d&&d.duration?(o[l]=u=new Uu(d,e,l,c),r.push(u)):e[l]=c}return r}update(e,t){if(0===this._properties.size)return void Object.assign(e,t);const n=this._createAnimations(e,t);return n.length?(Yu.add(this._chart,n),!0):void 0}}function Gu(e,t){const n=e&&e.options||{},r=n.reverse,o=void 0===n.min?t:0,i=void 0===n.max?t:0;return{start:r?i:o,end:r?o:i}}function Ku(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function Ju(e,t,n,r={}){const o=e.keys,i="single"===r.mode;let a,s,l,c;if(null===t)return;let u=!1;for(a=0,s=o.length;a<s;++a){if(l=+o[a],l===n){if(u=!0,r.all)continue;break}c=e.values[l],al(c)&&(i||0===t||Ll(t)===Ll(c))&&(t+=c)}return u||r.all?t:0}function Qu(e,t){const n=e&&e.options.stacked;return n||void 0===n&&void 0!==t.stack}function ed(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function td(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const t=e[o.index];if(n&&t>0||!n&&t<0)return o.index}return null}function nd(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:a,index:s}=r,l=i.axis,c=a.axis,u=function(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}(i,a,r),d=t.length;let h;for(let e=0;e<d;++e){const n=t[e],{[l]:i,[c]:d}=n;h=(n._stacks||(n._stacks={}))[c]=ed(o,u,i),h[s]=d,h._top=td(h,a,!0,r.type),h._bottom=td(h,a,!1,r.type);(h._visualValues||(h._visualValues={}))[s]=d}}function rd(e,t){const n=e.scales;return Object.keys(n).filter((e=>n[e].axis===t)).shift()}function od(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const e of t){const t=e._stacks;if(!t||void 0===t[r]||void 0===t[r][n])return;delete t[r][n],void 0!==t[r]._visualValues&&void 0!==t[r]._visualValues[n]&&delete t[r]._visualValues[n]}}}const id=e=>"reset"===e||"none"===e,ad=(e,t)=>t?e:Object.assign({},e);class sd{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Qu(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&od(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>"x"===e?t:"r"===e?r:n,o=t.xAxisID=ll(n.xAxisID,rd(e,"x")),i=t.yAxisID=ll(n.yAxisID,rd(e,"y")),a=t.rAxisID=ll(n.rAxisID,rd(e,"r")),s=t.indexAxis,l=t.iAxisID=r(s,o,i,a),c=t.vAxisID=r(s,i,o,a);t.xScale=this.getScaleForId(o),t.yScale=this.getScaleForId(i),t.rScale=this.getScaleForId(a),t.iScale=this.getScaleForId(l),t.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Ql(this._data,this),e._stacked&&od(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),n=this._data;if(il(t)){const e=this._cachedMeta;this._data=function(e,t){const{iScale:n,vScale:r}=t,o="x"===n.axis?"x":"y",i="x"===r.axis?"x":"y",a=Object.keys(e),s=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],s[l]={[o]:u,[i]:e[u]};return s}(t,e)}else if(n!==t){if(n){Ql(n,this);const e=this._cachedMeta;od(e),e._parsed=[]}t&&Object.isExtensible(t)&&function(e,t){e._chartjs?e._chartjs.listeners.push(t):(Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Jl.forEach((t=>{const n="_onData"+xl(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){const o=r.apply(this,t);return e._chartjs.listeners.forEach((e=>{"function"==typeof e[n]&&e[n](...t)})),o}})})))}(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,n=this.getDataset();let r=!1;this._dataCheck();const o=t._stacked;t._stacked=Qu(t.vScale,t),t.stack!==n.stack&&(r=!0,od(t),t.stack=n.stack),this._resyncElements(e),(r||o!==t._stacked)&&(nd(this,t._parsed),t._stacked=Qu(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:n,_data:r}=this,{iScale:o,_stacked:i}=n,a=o.axis;let s,l,c,u=0===e&&t===r.length||n._sorted,d=e>0&&n._parsed[e-1];if(!1===this._parsing)n._parsed=r,n._sorted=!0,c=r;else{c=ol(r[e])?this.parseArrayData(n,r,e,t):il(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);const o=()=>null===l[a]||d&&l[a]<d[a];for(s=0;s<t;++s)n._parsed[s+e]=l=c[s],u&&(o()&&(u=!1),d=l);n._sorted=u}i&&nd(this,c)}parsePrimitiveData(e,t,n,r){const{iScale:o,vScale:i}=e,a=o.axis,s=i.axis,l=o.getLabels(),c=o===i,u=new Array(r);let d,h,p;for(d=0,h=r;d<h;++d)p=d+n,u[d]={[a]:c||o.parse(l[p],p),[s]:i.parse(t[p],p)};return u}parseArrayData(e,t,n,r){const{xScale:o,yScale:i}=e,a=new Array(r);let s,l,c,u;for(s=0,l=r;s<l;++s)c=s+n,u=t[c],a[s]={x:o.parse(u[0],c),y:i.parse(u[1],c)};return a}parseObjectData(e,t,n,r){const{xScale:o,yScale:i}=e,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l=new Array(r);let c,u,d,h;for(c=0,u=r;c<u;++c)d=c+n,h=t[d],l[c]={x:o.parse(_l(h,a),d),y:i.parse(_l(h,s),d)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,n){const r=this.chart,o=this._cachedMeta,i=t[e.axis];return Ju({keys:Ku(r,!0),values:t._stacks[e.axis]._visualValues},i,o.index,{mode:n})}updateRangeFromParsed(e,t,n,r){const o=n[t.axis];let i=null===o?NaN:o;const a=r&&n._stacks[t.axis];r&&a&&(r.values=a,i=Ju(r,o,this._cachedMeta.index)),e.min=Math.min(e.min,i),e.max=Math.max(e.max,i)}getMinMax(e,t){const n=this._cachedMeta,r=n._parsed,o=n._sorted&&e===n.iScale,i=r.length,a=this._getOtherScale(e),s=((e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Ku(n,!0),values:null})(t,n,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:u}=function(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}(a);let d,h;function p(){h=r[d];const t=h[a.axis];return!al(h[e.axis])||c>t||u<t}for(d=0;d<i&&(p()||(this.updateRangeFromParsed(l,e,h,s),!o));++d);if(o)for(d=i-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(l,e,h,s);break}return l}getAllParsedValues(e){const t=this._cachedMeta._parsed,n=[];let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r][e.axis],al(i)&&n.push(i);return n}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,n=t.iScale,r=t.vScale,o=this.getParsed(e);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:r?""+r.getLabelForValue(o[r.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=function(e){let t,n,r,o;return il(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:!1===e}}(ll(this.options.clip,function(e,t,n){if(!1===n)return!1;const r=Gu(e,n),o=Gu(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,n=this._cachedMeta,r=n.data||[],o=t.chartArea,i=[],a=this._drawStart||0,s=this._drawCount||r.length-a,l=this.options.drawActiveElementsOnTop;let c;for(n.dataset&&n.dataset.draw(e,o,a,s),c=a;c<a+s;++c){const t=r[c];t.hidden||(t.active&&l?i.push(t):t.draw(e,o))}for(c=0;c<i.length;++c)i[c].draw(e,o)}getStyle(e,t){const n=t?"active":"default";return void 0===e&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(e||0,n)}getContext(e,t,n){const r=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const t=this._cachedMeta.data[e];o=t.$context||(t.$context=function(e,t,n){return Kc(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}(this.getContext(),e,t)),o.parsed=this.getParsed(e),o.raw=r.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=function(e,t){return Kc(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),o.dataset=r,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=n,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",n){const r="active"===t,o=this._cachedDataOpts,i=e+"-"+t,a=o[i],s=this.enableOptionSharing&&wl(n);if(a)return ad(a,s);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,e),u=r?[`${e}Hover`,"hover",e,""]:[e,""],d=l.getOptionScopes(this.getDataset(),c),h=Object.keys(Cc.elements[e]),p=l.resolveNamedOptions(d,h,(()=>this.getContext(n,r,t)),u);return p.$shared&&(p.$shared=s,o[i]=Object.freeze(ad(p,s))),p}_resolveAnimations(e,t,n){const r=this.chart,o=this._cachedDataOpts,i=`animation-${t}`,a=o[i];if(a)return a;let s;if(!1!==r.options.animation){const r=this.chart.config,o=r.datasetAnimationScopeKeys(this._type,t),i=r.getOptionScopes(this.getDataset(),o);s=r.createResolver(i,this.getContext(e,n,t))}const l=new Zu(r,s&&s.animations);return s&&s._cacheable&&(o[i]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||id(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,o=this.getSharedOptions(n),i=this.includeOptions(t,o)||o!==r;return this.updateSharedOptions(o,t,n),{sharedOptions:o,includeOptions:i}}updateElement(e,t,n,r){id(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!id(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;const o=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(o)||o})}removeHoverStyle(e,t,n){this._setStyle(e,n,"active",!1)}setHoverStyle(e,t,n){this._setStyle(e,n,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,n=this._cachedMeta.data;for(const[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];const r=n.length,o=t.length,i=Math.min(o,r);i&&this.parse(0,i),o>r?this._insertElements(r,o-r,e):o<r&&this._removeElements(o,r-o)}_insertElements(e,t,n=!0){const r=this._cachedMeta,o=r.data,i=e+t;let a;const s=e=>{for(e.length+=t,a=e.length-1;a>=i;a--)e[a]=e[a-t]};for(s(o),a=e;a<i;++a)o[a]=new this.dataElementType;this._parsing&&s(r._parsed),this.parse(e,t),n&&this.updateElements(o,e,t,"reset")}updateElements(e,t,n,r){}_removeElements(e,t){const n=this._cachedMeta;if(this._parsing){const r=n._parsed.splice(e,t);n._stacked&&od(n,r)}n.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,n,r]=e;this[t](n,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const n=arguments.length-2;n&&this._sync(["_insertElements",e,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function ld(e){const t=e.iScale,n=function(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let t=0,o=n.length;t<o;t++)r=r.concat(n[t].controller.getAllParsedValues(e));e._cache.$bar=ec(r.sort(((e,t)=>e-t)))}return e._cache.$bar}(t,e.type);let r,o,i,a,s=t._length;const l=()=>{32767!==i&&-32768!==i&&(wl(a)&&(s=Math.min(s,Math.abs(i-a)||s)),a=i)};for(r=0,o=n.length;r<o;++r)i=t.getPixelForValue(n[r]),l();for(a=void 0,r=0,o=t.ticks.length;r<o;++r)i=t.getPixelForTick(r),l();return s}function cd(e,t,n,r){return ol(e)?function(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),a=Math.min(o,i),s=Math.max(o,i);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:a,max:s}}(e,t,n,r):t[n.axis]=n.parse(e,r),t}function ud(e,t,n,r){const o=e.iScale,i=e.vScale,a=o.getLabels(),s=o===i,l=[];let c,u,d,h;for(c=n,u=n+r;c<u;++c)h=t[c],d={},d[o.axis]=s||o.parse(a[c],c),l.push(cd(h,d,i,c));return l}function dd(e){return e&&void 0!==e.barStart&&void 0!==e.barEnd}function hd(e,t,n,r){let o=t.borderSkipped;const i={};if(!o)return void(e.borderSkipped=i);if(!0===o)return void(e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:a,end:s,reverse:l,top:c,bottom:u}=function(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}(e);"middle"===o&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[pd(u,a,s,l)]=!0,o=c)),i[pd(o,a,s,l)]=!0,e.borderSkipped=i}function pd(e,t,n,r){var o,i,a;return r?(a=n,e=fd(e=(o=e)===(i=t)?a:o===a?i:o,n,t)):e=fd(e,t,n),e}function fd(e,t,n){return"start"===e?t:"end"===e?n:e}function md(e,{inflateAmount:t},n){e.inflateAmount="auto"===t?1===n?.33:0:t}class gd extends sd{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(e,t,n,r){return ud(e,t,n,r)}parseArrayData(e,t,n,r){return ud(e,t,n,r)}parseObjectData(e,t,n,r){const{iScale:o,vScale:i}=e,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,l="x"===o.axis?a:s,c="x"===i.axis?a:s,u=[];let d,h,p,f;for(d=n,h=n+r;d<h;++d)f=t[d],p={},p[o.axis]=o.parse(_l(f,l),d),u.push(cd(_l(f,c),p,i,d));return u}updateRangeFromParsed(e,t,n,r){super.updateRangeFromParsed(e,t,n,r);const o=n._custom;o&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:n,vScale:r}=t,o=this.getParsed(e),i=o._custom,a=dd(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(o[r.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,n,r){const o="reset"===r,{index:i,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),l=a.isHorizontal(),c=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(t,r);for(let h=t;h<t+n;h++){const t=this.getParsed(h),n=o||rl(t[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(h),p=this._calculateBarIndexPixels(h,c),f=(t._stacks||{})[a.axis],m={horizontal:l,base:n.base,enableBorderRadius:!f||dd(t._custom)||i===f._top||i===f._bottom,x:l?n.head:p.center,y:l?p.center:n.head,height:l?p.size:Math.abs(n.size),width:l?Math.abs(n.size):p.size};d&&(m.options=u||this.resolveDataElementOptions(h,e[h].active?"active":r));const g=m.options||e[h].options;hd(m,g,f,i),md(m,g,c.ratio),this.updateElement(e[h],h,m,r)}}_getStacks(e,t){const{iScale:n}=this._cachedMeta,r=n.getMatchingVisibleMetas(this._type).filter((e=>e.controller.options.grouped)),o=n.options.stacked,i=[],a=this._cachedMeta.controller.getParsed(t),s=a&&a[n.axis],l=e=>{const t=e._parsed.find((e=>e[n.axis]===s)),r=t&&t[e.vScale.axis];if(rl(r)||isNaN(r))return!0};for(const n of r)if((void 0===t||!l(n))&&((!1===o||-1===i.indexOf(n.stack)||void 0===o&&void 0===n.stack)&&i.push(n.stack),n.index===e))break;return i.length||i.push(void 0),i}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,n){const r=this._getStacks(e,n),o=void 0!==t?r.indexOf(t):-1;return-1===o?r.length-1:o}_getRuler(){const e=this.options,t=this._cachedMeta,n=t.iScale,r=[];let o,i;for(o=0,i=t.data.length;o<i;++o)r.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));const a=e.barThickness;return{min:a||ld(t),pixels:r,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:n,index:r},options:{base:o,minBarLength:i}}=this,a=o||0,s=this.getParsed(e),l=s._custom,c=dd(l);let u,d,h=s[t.axis],p=0,f=n?this.applyStack(t,s,n):h;f!==h&&(p=f-h,f=h),c&&(h=l.barStart,f=l.barEnd-l.barStart,0!==h&&Ll(h)!==Ll(l.barEnd)&&(p=0),p+=h);const m=rl(o)||c?p:o;let g=t.getPixelForValue(m);if(u=this.chart.getDataVisibility(e)?t.getPixelForValue(p+f):g,d=u-g,Math.abs(d)<i){d=function(e,t,n){return 0!==e?Ll(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}(d,t,a)*i,h===a&&(g-=d/2);const e=t.getPixelForDecimal(0),o=t.getPixelForDecimal(1),l=Math.min(e,o),p=Math.max(e,o);g=Math.max(Math.min(g,p),l),u=g+d,n&&!c&&(s._stacks[t.axis]._visualValues[r]=t.getValueForPixel(u)-t.getValueForPixel(g))}if(g===t.getPixelForValue(a)){const e=Ll(d)*t.getLineWidthForValue(a)/2;g+=e,d-=e}return{size:d,base:g,head:u,center:u+d/2}}_calculateBarIndexPixels(e,t){const n=t.scale,r=this.options,o=r.skipNull,i=ll(r.maxBarThickness,1/0);let a,s;if(t.grouped){const n=o?this._getStackCount(e):t.stackCount,l="flex"===r.barThickness?function(e,t,n,r){const o=t.pixels,i=o[e];let a=e>0?o[e-1]:null,s=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;null===a&&(a=i-(null===s?t.end-t.start:s-i)),null===s&&(s=i+i-a);const c=i-(i-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}(e,t,r,n):function(e,t,n,r){const o=n.barThickness;let i,a;return rl(o)?(i=t.min*n.categoryPercentage,a=n.barPercentage):(i=o*r,a=1),{chunk:i/r,ratio:a,start:t.pixels[e]-i/2}}(e,t,r,n),c=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);a=l.start+l.chunk*c+l.chunk/2,s=Math.min(i,l.chunk*l.ratio)}else a=n.getPixelForValue(this.getParsed(e)[n.axis],e),s=Math.min(i,t.min*t.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const e=this._cachedMeta,t=e.vScale,n=e.data,r=n.length;let o=0;for(;o<r;++o)null===this.getParsed(o)[t.axis]||n[o].hidden||n[o].draw(this._ctx)}}class vd extends sd{static id="doughnut";static 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"};static descriptors={_scriptable:e=>"spacing"!==e,_indexable:e=>"spacing"!==e&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n,color:r}}=e.legend.options;return t.labels.map(((t,o)=>{const i=e.getDatasetMeta(0).controller.getStyle(o);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:r,lineWidth:i.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}}))}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const n=this.getDataset().data,r=this._cachedMeta;if(!1===this._parsing)r._parsed=n;else{let o,i,a=e=>+n[e];if(il(n[e])){const{key:e="value"}=this._parsing;a=t=>+_l(n[t],e)}for(o=e,i=e+t;o<i;++o)r._parsed[o]=a(o)}}_getRotation(){return Fl(this.options.rotation-90)}_getCircumference(){return Fl(this.options.circumference)}_getRotationExtents(){let e=El,t=-El;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){const r=this.chart.getDatasetMeta(n).controller,o=r._getRotation(),i=r._getCircumference();e=Math.min(e,o),t=Math.max(t,o+i)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:n}=t,r=this._cachedMeta,o=r.data,i=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-i)/2,0),s=Math.min((l=this.options.cutout,c=a,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/c),1);var l,c;const u=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:p,ratioY:f,offsetX:m,offsetY:g}=function(e,t,n){let r=1,o=1,i=0,a=0;if(t<El){const s=e,l=s+t,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),h=Math.sin(l),p=(e,t,r)=>Xl(e,s,l,!0)?1:Math.max(t,t*n,r,r*n),f=(e,t,r)=>Xl(e,s,l,!0)?-1:Math.min(t,t*n,r,r*n),m=p(0,c,d),g=p(Tl,u,h),v=f(Cl,c,d),y=f(Cl+Tl,u,h);r=(m-v)/2,o=(g-y)/2,i=-(m+v)/2,a=-(g+y)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:a}}(h,d,s),v=(n.width-i)/p,y=(n.height-i)/f,b=Math.max(Math.min(v,y)/2,0),_=cl(this.options.radius,b),x=(_-Math.max(_*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=g*_,r.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*u,0),this.updateElements(o,0,o.length,e)}_circumference(e,t){const n=this.options,r=this._cachedMeta,o=this._getCircumference();return t&&n.animation.animateRotate||!this.chart.getDataVisibility(e)||null===r._parsed[e]||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*o/El)}updateElements(e,t,n,r){const o="reset"===r,i=this.chart,a=i.chartArea,s=i.options.animation,l=(a.left+a.right)/2,c=(a.top+a.bottom)/2,u=o&&s.animateScale,d=u?0:this.innerRadius,h=u?0:this.outerRadius,{sharedOptions:p,includeOptions:f}=this._getSharedOptions(t,r);let m,g=this._getRotation();for(m=0;m<t;++m)g+=this._circumference(m,o);for(m=t;m<t+n;++m){const t=this._circumference(m,o),n=e[m],i={x:l+this.offsetX,y:c+this.offsetY,startAngle:g,endAngle:g+t,circumference:t,outerRadius:h,innerRadius:d};f&&(i.options=p||this.resolveDataElementOptions(m,n.active?"active":r)),g+=t,this.updateElement(n,m,i,r)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let n,r=0;for(n=0;n<t.length;n++){const o=e._parsed[n];null===o||isNaN(o)||!this.chart.getDataVisibility(n)||t[n].hidden||(r+=Math.abs(o))}return r}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?El*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,r=n.data.labels||[],o=vc(t._parsed[e],n.options.locale);return{label:r[e]||"",value:o}}getMaxBorderWidth(e){let t=0;const n=this.chart;let r,o,i,a,s;if(!e)for(r=0,o=n.data.datasets.length;r<o;++r)if(n.isDatasetVisible(r)){i=n.getDatasetMeta(r),e=i.data,a=i.controller;break}if(!e)return 0;for(r=0,o=e.length;r<o;++r)s=a.resolveDataElementOptions(r),"inner"!==s.borderAlign&&(t=Math.max(t,s.borderWidth||0,s.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let n=0,r=e.length;n<r;++n){const e=this.resolveDataElementOptions(n);t=Math.max(t,e.offset||0,e.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let n=0;n<e;++n)this.chart.isDatasetVisible(n)&&(t+=this._getRingWeight(n));return t}_getRingWeight(e){return Math.max(ll(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class yd extends sd{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:n,color:r}}=e.legend.options;return t.labels.map(((t,o)=>{const i=e.getDatasetMeta(0).controller.getStyle(o);return{text:t,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,fontColor:r,lineWidth:i.borderWidth,pointStyle:n,hidden:!e.getDataVisibility(o),index:o}}))}return[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart,r=n.data.labels||[],o=vc(t._parsed[e].r,n.options.locale);return{label:r[e]||"",value:o}}parseObjectData(e,t,n,r){return du.bind(this)(e,t,n,r)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach(((e,n)=>{const r=this.getParsed(n).r;!isNaN(r)&&this.chart.getDataVisibility(n)&&(r<t.min&&(t.min=r),r>t.max&&(t.max=r))})),t}_updateRadius(){const e=this.chart,t=e.chartArea,n=e.options,r=Math.min(t.right-t.left,t.bottom-t.top),o=Math.max(r/2,0),i=(o-Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0))/e.getVisibleDatasetCount();this.outerRadius=o-i*this.index,this.innerRadius=this.outerRadius-i}updateElements(e,t,n,r){const o="reset"===r,i=this.chart,a=i.options.animation,s=this._cachedMeta.rScale,l=s.xCenter,c=s.yCenter,u=s.getIndexAngle(0)-.5*Cl;let d,h=u;const p=360/this.countVisibleElements();for(d=0;d<t;++d)h+=this._computeAngle(d,r,p);for(d=t;d<t+n;d++){const t=e[d];let n=h,f=h+this._computeAngle(d,r,p),m=i.getDataVisibility(d)?s.getDistanceFromCenterForValue(this.getParsed(d).r):0;h=f,o&&(a.animateScale&&(m=0),a.animateRotate&&(n=f=u));const g={x:l,y:c,innerRadius:0,outerRadius:m,startAngle:n,endAngle:f,options:this.resolveDataElementOptions(d,t.active?"active":r)};this.updateElement(t,d,g,r)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach(((e,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++})),t}_computeAngle(e,t,n){return this.chart.getDataVisibility(e)?Fl(this.resolveDataElementOptions(e,t).angle||n):0}}var bd=Object.freeze({__proto__:null,BarController:gd,BubbleController:class extends sd{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,n,r){const o=super.parsePrimitiveData(e,t,n,r);for(let e=0;e<o.length;e++)o[e]._custom=this.resolveDataElementOptions(e+n).radius;return o}parseArrayData(e,t,n,r){const o=super.parseArrayData(e,t,n,r);for(let e=0;e<o.length;e++){const r=t[n+e];o[e]._custom=ll(r[2],this.resolveDataElementOptions(e+n).radius)}return o}parseObjectData(e,t,n,r){const o=super.parseObjectData(e,t,n,r);for(let e=0;e<o.length;e++){const r=t[n+e];o[e]._custom=ll(r&&r.r&&+r.r,this.resolveDataElementOptions(e+n).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let n=e.length-1;n>=0;--n)t=Math.max(t,e[n].size(this.resolveDataElementOptions(n))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:o}=t,i=this.getParsed(e),a=r.getLabelForValue(i.x),s=o.getLabelForValue(i.y),l=i._custom;return{label:n[e]||"",value:"("+a+", "+s+(l?", "+l:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,n,r){const o="reset"===r,{iScale:i,vScale:a}=this._cachedMeta,{sharedOptions:s,includeOptions:l}=this._getSharedOptions(t,r),c=i.axis,u=a.axis;for(let d=t;d<t+n;d++){const t=e[d],n=!o&&this.getParsed(d),h={},p=h[c]=o?i.getPixelForDecimal(.5):i.getPixelForValue(n[c]),f=h[u]=o?a.getBasePixel():a.getPixelForValue(n[u]);h.skip=isNaN(p)||isNaN(f),l&&(h.options=s||this.resolveDataElementOptions(d,t.active?"active":r),o&&(h.options.radius=0)),this.updateElement(t,d,h,r)}}resolveDataElementOptions(e,t){const n=this.getParsed(e);let r=super.resolveDataElementOptions(e,t);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const o=r.radius;return"active"!==t&&(r.radius=0),r.radius+=ll(n&&n._custom,o),r}},DoughnutController:vd,LineController:class extends sd{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:n,data:r=[],_dataset:o}=t,i=this.chart._animationsDisabled;let{start:a,count:s}=ic(t,r,i);this._drawStart=a,this._drawCount=s,ac(t)&&(a=0,s=r.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=r;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(n,void 0,{animated:!i,options:l},e),this.updateElements(r,a,s,e)}updateElements(e,t,n,r){const o="reset"===r,{iScale:i,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(t,r),d=i.axis,h=a.axis,{spanGaps:p,segment:f}=this.options,m=Rl(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||o||"none"===r,v=t+n,y=e.length;let b=t>0&&this.getParsed(t-1);for(let n=0;n<y;++n){const p=e[n],y=g?p:{};if(n<t||n>=v){y.skip=!0;continue}const _=this.getParsed(n),x=rl(_[h]),w=y[d]=i.getPixelForValue(_[d],n),S=y[h]=o||x?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,_,s):_[h],n);y.skip=isNaN(w)||isNaN(S)||x,y.stop=n>0&&Math.abs(_[d]-b[d])>m,f&&(y.parsed=_,y.raw=l.data[n]),u&&(y.options=c||this.resolveDataElementOptions(n,p.active?"active":r)),g||this.updateElement(p,n,y,r),b=_}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;const o=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,o,i)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},PieController:class extends vd{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:yd,RadarController:class extends sd{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(e){const t=this._cachedMeta.vScale,n=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(n[t.axis])}}parseObjectData(e,t,n,r){return du.bind(this)(e,t,n,r)}update(e){const t=this._cachedMeta,n=t.dataset,r=t.data||[],o=t.iScale.getLabels();if(n.points=r,"resize"!==e){const t=this.resolveDatasetElementOptions(e);this.options.showLine||(t.borderWidth=0);const i={_loop:!0,_fullLoop:o.length===r.length,options:t};this.updateElement(n,void 0,i,e)}this.updateElements(r,0,r.length,e)}updateElements(e,t,n,r){const o=this._cachedMeta.rScale,i="reset"===r;for(let a=t;a<t+n;a++){const t=e[a],n=this.resolveDataElementOptions(a,t.active?"active":r),s=o.getPointPositionForValue(a,this.getParsed(a).r),l=i?o.xCenter:s.x,c=i?o.yCenter:s.y,u={x:l,y:c,angle:s.angle,skip:isNaN(l)||isNaN(c),options:n};this.updateElement(t,a,u,r)}}},ScatterController:class extends sd{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(e){const t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:o}=t,i=this.getParsed(e),a=r.getLabelForValue(i.x),s=o.getLabelForValue(i.y);return{label:n[e]||"",value:"("+a+", "+s+")"}}update(e){const t=this._cachedMeta,{data:n=[]}=t,r=this.chart._animationsDisabled;let{start:o,count:i}=ic(t,n,r);if(this._drawStart=o,this._drawCount=i,ac(t)&&(o=0,i=n.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:i}=t;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!i._decimated,o.points=n;const a=this.resolveDatasetElementOptions(e);a.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:a},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(n,o,i,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,n,r){const o="reset"===r,{iScale:i,vScale:a,_stacked:s,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(t,r),u=this.getSharedOptions(c),d=this.includeOptions(r,u),h=i.axis,p=a.axis,{spanGaps:f,segment:m}=this.options,g=Rl(f)?f:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||o||"none"===r;let y=t>0&&this.getParsed(t-1);for(let c=t;c<t+n;++c){const t=e[c],n=this.getParsed(c),f=v?t:{},b=rl(n[p]),_=f[h]=i.getPixelForValue(n[h],c),x=f[p]=o||b?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,n,s):n[p],c);f.skip=isNaN(_)||isNaN(x)||b,f.stop=c>0&&Math.abs(n[h]-y[h])>g,m&&(f.parsed=n,f.raw=l.data[c]),d&&(f.options=u||this.resolveDataElementOptions(c,t.active?"active":r)),v||this.updateElement(t,c,f,r),y=n}this.updateSharedOptions(u,r,c)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}const n=e.dataset,r=n.options&&n.options.borderWidth||0;if(!t.length)return r;const o=t[0].size(this.resolveDataElementOptions(0)),i=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,o,i)/2}}});function _d(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class xd{static override(e){Object.assign(xd.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return _d()}parse(){return _d()}format(){return _d()}add(){return _d()}diff(){return _d()}startOf(){return _d()}endOf(){return _d()}}var wd={_date:xd};function Sd(e,t,n,r){const{controller:o,data:i,_sorted:a}=e,s=o._cachedMeta.iScale;if(s&&t===s.axis&&"r"!==t&&a&&i.length){const e=s._reversePixels?Kl:Gl;if(!r)return e(i,t,n);if(o._sharedOptions){const r=i[0],o="function"==typeof r.getRange&&r.getRange(t);if(o){const r=e(i,t,n-o),a=e(i,t,n+o);return{lo:r.lo,hi:a.hi}}}}return{lo:0,hi:i.length-1}}function kd(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),a=n[t];for(let e=0,n=i.length;e<n;++e){const{index:n,data:s}=i[e],{lo:l,hi:c}=Sd(i[e],t,a,o);for(let e=l;e<=c;++e){const t=s[e];t.skip||r(t,n,e)}}}function Cd(e,t,n,r,o){const i=[];if(!o&&!e.isPointInArea(t))return i;return kd(e,n,t,(function(n,a,s){(o||Dc(n,e.chartArea,0))&&n.inRange(t.x,t.y,r)&&i.push({element:n,datasetIndex:a,index:s})}),!0),i}function Ed(e,t,n,r,o,i){let a=[];const s=function(e){const t=-1!==e.indexOf("x"),n=-1!==e.indexOf("y");return function(e,r){const o=t?Math.abs(e.x-r.x):0,i=n?Math.abs(e.y-r.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(i,2))}}(n);let l=Number.POSITIVE_INFINITY;return kd(e,n,t,(function(n,c,u){const d=n.inRange(t.x,t.y,o);if(r&&!d)return;const h=n.getCenterPoint(o);if(!(!!i||e.isPointInArea(h))&&!d)return;const p=s(t,h);p<l?(a=[{element:n,datasetIndex:c,index:u}],l=p):p===l&&a.push({element:n,datasetIndex:c,index:u})})),a}function Md(e,t,n,r,o,i){return i||e.isPointInArea(t)?"r"!==n||r?Ed(e,t,n,r,o,i):function(e,t,n,r){let o=[];return kd(e,n,t,(function(e,n,i){const{startAngle:a,endAngle:s}=e.getProps(["startAngle","endAngle"],r),{angle:l}=Hl(e,{x:t.x,y:t.y});Xl(l,a,s)&&o.push({element:e,datasetIndex:n,index:i})})),o}(e,t,n,o):[]}function Pd(e,t,n,r,o){const i=[],a="x"===n?"inXRange":"inYRange";let s=!1;return kd(e,n,t,((e,r,l)=>{e[a]&&e[a](t[n],o)&&(i.push({element:e,datasetIndex:r,index:l}),s=s||e.inRange(t.x,t.y,o))})),r&&!s?[]:i}var Od={evaluateInteractionItems:kd,modes:{index(e,t,n,r){const o=Cu(t,e),i=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?Cd(e,o,i,r,a):Md(e,o,i,!1,r,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach((e=>{const t=s[0].index,n=e.data[t];n&&!n.skip&&l.push({element:n,datasetIndex:e.index,index:t})})),l):[]},dataset(e,t,n,r){const o=Cu(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?Cd(e,o,i,r,a):Md(e,o,i,!1,r,a);if(s.length>0){const t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;e<n.length;++e)s.push({element:n[e],datasetIndex:t,index:e})}return s},point:(e,t,n,r)=>Cd(e,Cu(t,e),n.axis||"xy",r,n.includeInvisible||!1),nearest(e,t,n,r){const o=Cu(t,e),i=n.axis||"xy",a=n.includeInvisible||!1;return Md(e,o,i,n.intersect,r,a)},x:(e,t,n,r)=>Pd(e,Cu(t,e),"x",n.intersect,r),y:(e,t,n,r)=>Pd(e,Cu(t,e),"y",n.intersect,r)}};const Td=["left","top","right","bottom"];function Nd(e,t){return e.filter((e=>e.pos===t))}function Dd(e,t){return e.filter((e=>-1===Td.indexOf(e.pos)&&e.box.axis===t))}function Ad(e,t){return e.sort(((e,n)=>{const r=t?n:e,o=t?e:n;return r.weight===o.weight?r.index-o.index:r.weight-o.weight}))}function Ld(e,t){const n=function(e){const t={};for(const n of e){const{stack:e,pos:r,stackWeight:o}=n;if(!e||!Td.includes(r))continue;const i=t[e]||(t[e]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=o}return t}(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,a,s;for(i=0,a=e.length;i<a;++i){s=e[i];const{fullSize:a}=s.box,l=n[s.stack],c=l&&s.stackWeight/l.weight;s.horizontal?(s.width=c?c*r:a&&t.availableWidth,s.height=o):(s.width=r,s.height=c?c*o:a&&t.availableHeight)}return n}function Id(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function zd(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Rd(e,t,n,r){const{pos:o,box:i}=n,a=e.maxPadding;if(!il(o)){n.size&&(e[o]-=n.size);const t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?i.height:i.width),n.size=t.size/t.count,e[o]+=n.size}i.getPadding&&zd(a,i.getPadding());const s=Math.max(0,t.outerWidth-Id(a,e,"left","right")),l=Math.max(0,t.outerHeight-Id(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function $d(e,t){const n=t.maxPadding;function r(e){const r={left:0,top:0,right:0,bottom:0};return e.forEach((e=>{r[e]=Math.max(t[e],n[e])})),r}return r(e?["left","right"]:["top","bottom"])}function Fd(e,t,n,r){const o=[];let i,a,s,l,c,u;for(i=0,a=e.length,c=0;i<a;++i){s=e[i],l=s.box,l.update(s.width||t.w,s.height||t.h,$d(s.horizontal,t));const{same:a,other:d}=Rd(t,n,s,r);c|=a&&o.length,u=u||d,l.fullSize||o.push(s)}return c&&Fd(o,t,n,r)||u}function jd(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function Bd(e,t,n,r){const o=n.padding;let{x:i,y:a}=t;for(const s of e){const e=s.box,l=r[s.stack]||{count:1,placed:0,weight:1},c=s.stackWeight/l.weight||1;if(s.horizontal){const r=t.w*c,i=l.size||e.height;wl(l.start)&&(a=l.start),e.fullSize?jd(e,o.left,a,n.outerWidth-o.right-o.left,i):jd(e,t.left+l.placed,a,r,i),l.start=a,l.placed+=r,a=e.bottom}else{const r=t.h*c,a=l.size||e.width;wl(l.start)&&(i=l.start),e.fullSize?jd(e,i,o.top,a,n.outerHeight-o.bottom-o.top):jd(e,i,t.top+l.placed,a,r),l.start=i,l.placed+=r,i=e.right}}t.x=i,t.y=a}var Hd={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;-1!==n&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const o=Uc(e.options.layout.padding),i=Math.max(t-o.width,0),a=Math.max(n-o.height,0),s=function(e){const t=function(e){const t=[];let n,r,o,i,a,s;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],({position:i,options:{stack:a,stackWeight:s=1}}=o),t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&i+a,stackWeight:s});return t}(e),n=Ad(t.filter((e=>e.box.fullSize)),!0),r=Ad(Nd(t,"left"),!0),o=Ad(Nd(t,"right")),i=Ad(Nd(t,"top"),!0),a=Ad(Nd(t,"bottom")),s=Dd(t,"x"),l=Dd(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(a).concat(s),chartArea:Nd(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(a).concat(s)}}(e.boxes),l=s.vertical,c=s.horizontal;dl(e.boxes,(e=>{"function"==typeof e.beforeLayout&&e.beforeLayout()}));const u=l.reduce(((e,t)=>t.box.options&&!1===t.box.options.display?e:e+1),0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:a,vBoxMaxWidth:i/2/u,hBoxMaxHeight:a/2}),h=Object.assign({},o);zd(h,Uc(r));const p=Object.assign({maxPadding:h,w:i,h:a,x:o.left,y:o.top},o),f=Ld(l.concat(c),d);Fd(s.fullSize,p,d,f),Fd(l,p,d,f),Fd(c,p,d,f)&&Fd(l,p,d,f),function(e){const t=e.maxPadding;function n(n){const r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}(p),Bd(s.leftAndTop,p,d,f),p.x+=p.w,p.y+=p.h,Bd(s.rightAndBottom,p,d,f),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},dl(s.chartArea,(t=>{const n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})}))}};class Wd{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n=n||e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}}class Vd extends Wd{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Yd="$chartjs",Xd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},qd=e=>null===e||""===e;const Ud=!!Ou&&{passive:!0};function Zd(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Ud)}function Gd(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Kd(e,t,n){const r=e.canvas,o=new MutationObserver((e=>{let t=!1;for(const n of e)t=t||Gd(n.addedNodes,r),t=t&&!Gd(n.removedNodes,r);t&&n()}));return o.observe(document,{childList:!0,subtree:!0}),o}function Jd(e,t,n){const r=e.canvas,o=new MutationObserver((e=>{let t=!1;for(const n of e)t=t||Gd(n.removedNodes,r),t=t&&!Gd(n.addedNodes,r);t&&n()}));return o.observe(document,{childList:!0,subtree:!0}),o}const Qd=new Map;let eh=0;function th(){const e=window.devicePixelRatio;e!==eh&&(eh=e,Qd.forEach(((t,n)=>{n.currentDevicePixelRatio!==e&&t()})))}function nh(e,t,n){const r=e.canvas,o=r&&_u(r);if(!o)return;const i=nc(((e,t)=>{const r=o.clientWidth;n(e,t),r<o.clientWidth&&n()}),window),a=new ResizeObserver((e=>{const t=e[0],n=t.contentRect.width,r=t.contentRect.height;0===n&&0===r||i(n,r)}));return a.observe(o),function(e,t){Qd.size||window.addEventListener("resize",th),Qd.set(e,t)}(e,i),a}function rh(e,t,n){n&&n.disconnect(),"resize"===t&&function(e){Qd.delete(e),Qd.size||window.removeEventListener("resize",th)}(e)}function oh(e,t,n){const r=e.canvas,o=nc((t=>{null!==e.ctx&&n(function(e,t){const n=Xd[e.type]||e.type,{x:r,y:o}=Cu(e,t);return{type:n,chart:t,native:e,x:void 0!==r?r:null,y:void 0!==o?o:null}}(t,e))}),e);return function(e,t,n){e&&e.addEventListener(t,n,Ud)}(r,t,o),o}class ih extends Wd{acquireContext(e,t){const n=e&&e.getContext&&e.getContext("2d");return n&&n.canvas===e?(function(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Yd]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",qd(o)){const t=Tu(e,"width");void 0!==t&&(e.width=t)}if(qd(r))if(""===e.style.height)e.height=e.width/(t||2);else{const t=Tu(e,"height");void 0!==t&&(e.height=t)}}(e,t),n):null}releaseContext(e){const t=e.canvas;if(!t[Yd])return!1;const n=t[Yd].initial;["height","width"].forEach((e=>{const r=n[e];rl(r)?t.removeAttribute(e):t.setAttribute(e,r)}));const r=n.style||{};return Object.keys(r).forEach((e=>{t.style[e]=r[e]})),t.width=t.width,delete t[Yd],!0}addEventListener(e,t,n){this.removeEventListener(e,t);const r=e.$proxies||(e.$proxies={}),o={attach:Kd,detach:Jd,resize:nh}[t]||oh;r[t]=o(e,t,n)}removeEventListener(e,t){const n=e.$proxies||(e.$proxies={}),r=n[t];if(!r)return;({attach:rh,detach:rh,resize:rh}[t]||Zd)(e,t,r),n[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return Mu(e,t,n,r)}isAttached(e){const t=e&&_u(e);return!(!t||!t.isConnected)}}class ah{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}hasValue(){return Rl(this.x)&&Rl(this.y)}getProps(e,t){const n=this.$animations;if(!t||!n)return this;const r={};return e.forEach((e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]})),r}}function sh(e,t){const n=e.options.ticks,r=function(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?function(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}(t):[],a=i.length,s=i[0],l=i[a-1],c=[];if(a>o)return function(e,t,n,r){let o,i=0,a=n[0];for(r=Math.ceil(r),o=0;o<e.length;o++)o===a&&(t.push(e[o]),i++,a=n[i*r])}(t,c,i,a/o),c;const u=function(e,t,n){const r=function(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}(e),o=t.length/n;if(!r)return Math.max(o,1);const i=function(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r==0&&(t.push(r),t.push(e/r));return n===(0|n)&&t.push(n),t.sort(((e,t)=>e-t)).pop(),t}(r);for(let e=0,t=i.length-1;e<t;e++){const t=i[e];if(t>o)return t}return Math.max(o,1)}(i,t,o);if(a>0){let e,n;const r=a>1?Math.round((l-s)/(a-1)):null;for(lh(t,c,u,rl(r)?0:s-r,s),e=0,n=a-1;e<n;e++)lh(t,c,u,i[e],i[e+1]);return lh(t,c,u,l,rl(r)?t.length:l+r),c}return lh(t,c,u),c}function lh(e,t,n,r,o){const i=ll(r,0),a=Math.min(ll(o,e.length),e.length);let s,l,c,u=0;for(n=Math.ceil(n),o&&(s=o-r,n=s/Math.floor(s/n)),c=i;c<0;)u++,c=Math.round(i+u*n);for(l=Math.max(i,0);l<a;l++)l===c&&(t.push(e[l]),u++,c=Math.round(i+u*n))}const ch=(e,t,n)=>"top"===t||"left"===t?e[t]+n:e[t]-n,uh=(e,t)=>Math.min(t||e,e);function dh(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function hh(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,a=e._endPixel,s=1e-6;let l,c=e.getPixelForTick(o);if(!(n&&(l=1===r?Math.max(c-i,a-c):0===t?(e.getPixelForTick(1)-c)/2:(c-e.getPixelForTick(o-1))/2,c+=o<t?l:-l,c<i-s||c>a+s)))return c}function ph(e){return e.drawTicks?e.tickLength:0}function fh(e,t){if(!e.display)return 0;const n=Zc(e.font,t),r=Uc(e.padding);return(ol(e.text)?e.text.length:1)*n.lineHeight+r.height}function mh(e,t,n){let r=rc(e);return(n&&"right"!==t||!n&&"right"===t)&&(r=(e=>"left"===e?"right":"right"===e?"left":e)(r)),r}class gh extends ah{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:n,_suggestedMax:r}=this;return e=sl(e,Number.POSITIVE_INFINITY),t=sl(t,Number.NEGATIVE_INFINITY),n=sl(n,Number.POSITIVE_INFINITY),r=sl(r,Number.NEGATIVE_INFINITY),{min:sl(e,n),max:sl(t,r),minDefined:al(e),maxDefined:al(t)}}getMinMax(e){let t,{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds();if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let s=0,l=a.length;s<l;++s)t=a[s].controller.getMinMax(this,e),o||(n=Math.min(n,t.min)),i||(r=Math.max(r,t.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:sl(n,sl(r,n)),max:sl(r,sl(n,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 e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ul(this.options.beforeUpdate,[this])}update(e,t,n){const{beginAtZero:r,grace:o,ticks:i}=this.options,a=i.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(e,t,n){const{min:r,max:o}=e,i=cl(t,(o-r)/2),a=(e,t)=>n&&0===e?0:e+t;return{min:a(r,-Math.abs(i)),max:a(o,i)}}(this,o,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?dh(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||"auto"===i.source)&&(this.ticks=sh(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e,t,n=this.options.reverse;this.isHorizontal()?(e=this.left,t=this.right):(e=this.top,t=this.bottom,n=!n),this._startPixel=e,this._endPixel=t,this._reversePixels=n,this._length=t-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ul(this.options.afterUpdate,[this])}beforeSetDimensions(){ul(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(){ul(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ul(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ul(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let n,r,o;for(n=0,r=e.length;n<r;n++)o=e[n],o.label=ul(t.callback,[o.value,n,e],this)}afterTickToLabelConversion(){ul(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ul(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,n=uh(this.ticks.length,e.ticks.maxTicksLimit),r=t.minRotation||0,o=t.maxRotation;let i,a,s,l=r;if(!this._isVisible()||!t.display||r>=o||n<=1||!this.isHorizontal())return void(this.labelRotation=r);const c=this._getLabelSizes(),u=c.widest.width,d=c.highest.height,h=ql(this.chart.width-u,0,this.maxWidth);i=e.offset?this.maxWidth/n:h/(n-1),u+6>i&&(i=h/(n-(e.offset?.5:1)),a=this.maxHeight-ph(e.grid)-t.padding-fh(e.title,this.chart.options.font),s=Math.sqrt(u*u+d*d),l=jl(Math.min(Math.asin(ql((c.highest.height+6)/i,-1,1)),Math.asin(ql(a/s,-1,1))-Math.asin(ql(d/s,-1,1)))),l=Math.max(r,Math.min(o,l))),this.labelRotation=l}afterCalculateLabelRotation(){ul(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ul(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:o}}=this,i=this._isVisible(),a=this.isHorizontal();if(i){const i=fh(r,t.options.font);if(a?(e.width=this.maxWidth,e.height=ph(o)+i):(e.height=this.maxHeight,e.width=ph(o)+i),n.display&&this.ticks.length){const{first:t,last:r,widest:o,highest:i}=this._getLabelSizes(),s=2*n.padding,l=Fl(this.labelRotation),c=Math.cos(l),u=Math.sin(l);if(a){const t=n.mirror?0:u*o.width+c*i.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{const t=n.mirror?0:c*o.width+u*i.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,c)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){const{ticks:{align:o,padding:i},position:a}=this.options,s=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,d=0;s?l?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):"start"===o?d=t.width:"end"===o?u=e.width:"inner"!==o&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-a+i)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-c+i)*this.width/(this.width-c),0)}else{let n=t.height/2,r=e.height/2;"start"===o?(n=0,r=e.height):"end"===o&&(n=t.height,r=0),this.paddingTop=n+i,this.paddingBottom=r+i}}_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(){ul(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return"top"===t||"bottom"===t||"x"===e}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){let t,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(e),t=0,n=e.length;t<n;t++)rl(e[t].label)&&(e.splice(t,1),n--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let n=this.ticks;t<n.length&&(n=dh(n,t)),this._labelSizes=e=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,n){const{ctx:r,_longestTextCache:o}=this,i=[],a=[],s=Math.floor(t/uh(t,n));let l,c,u,d,h,p,f,m,g,v,y,b=0,_=0;for(l=0;l<t;l+=s){if(d=e[l].label,h=this._resolveTickFontOptions(l),r.font=p=h.string,f=o[p]=o[p]||{data:{},gc:[]},m=h.lineHeight,g=v=0,rl(d)||ol(d)){if(ol(d))for(c=0,u=d.length;c<u;++c)y=d[c],rl(y)||ol(y)||(g=Ec(r,f.data,f.gc,g,y),v+=m)}else g=Ec(r,f.data,f.gc,g,d),v=m;i.push(g),a.push(v),b=Math.max(g,b),_=Math.max(v,_)}!function(e,t){dl(e,(e=>{const n=e.gc,r=n.length/2;let o;if(r>t){for(o=0;o<r;++o)delete e.data[n[o]];n.splice(0,r)}}))}(o,t);const x=i.indexOf(b),w=a.indexOf(_),S=e=>({width:i[e]||0,height:a[e]||0});return{first:S(0),last:S(t-1),widest:S(x),highest:S(w),widths:i,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return ql(this._alignToPixels?Pc(this.chart,t,0):t,-32768,32767)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const n=t[e];return n.$context||(n.$context=function(e,t,n){return Kc(e,{tick:n,index:t,type:"tick"})}(this.getContext(),e,n))}return this.$context||(this.$context=Kc(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const e=this.options.ticks,t=Fl(this.labelRotation),n=Math.abs(Math.cos(t)),r=Math.abs(Math.sin(t)),o=this._getLabelSizes(),i=e.autoSkipPadding||0,a=o?o.widest.width+i:0,s=o?o.highest.height+i:0;return this.isHorizontal()?s*n>a*r?a/n:s/r:s*r<a*n?s/n:a/r}_isVisible(){const e=this.options.display;return"auto"!==e?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,n=this.chart,r=this.options,{grid:o,position:i,border:a}=r,s=o.offset,l=this.isHorizontal(),c=this.ticks.length+(s?1:0),u=ph(o),d=[],h=a.setContext(this.getContext()),p=h.display?h.width:0,f=p/2,m=function(e){return Pc(n,e,p)};let g,v,y,b,_,x,w,S,k,C,E,M;if("top"===i)g=m(this.bottom),x=this.bottom-u,S=g-f,C=m(e.top)+f,M=e.bottom;else if("bottom"===i)g=m(this.top),C=e.top,M=m(e.bottom)-f,x=g+f,S=this.top+u;else if("left"===i)g=m(this.right),_=this.right-u,w=g-f,k=m(e.left)+f,E=e.right;else if("right"===i)g=m(this.left),k=e.left,E=m(e.right)-f,_=g+f,w=this.left+u;else if("x"===t){if("center"===i)g=m((e.top+e.bottom)/2+.5);else if(il(i)){const e=Object.keys(i)[0],t=i[e];g=m(this.chart.scales[e].getPixelForValue(t))}C=e.top,M=e.bottom,x=g+f,S=x+u}else if("y"===t){if("center"===i)g=m((e.left+e.right)/2);else if(il(i)){const e=Object.keys(i)[0],t=i[e];g=m(this.chart.scales[e].getPixelForValue(t))}_=g-f,w=_-u,k=e.left,E=e.right}const P=ll(r.ticks.maxTicksLimit,c),O=Math.max(1,Math.ceil(c/P));for(v=0;v<c;v+=O){const e=this.getContext(v),t=o.setContext(e),r=a.setContext(e),i=t.lineWidth,c=t.color,u=r.dash||[],h=r.dashOffset,p=t.tickWidth,f=t.tickColor,m=t.tickBorderDash||[],g=t.tickBorderDashOffset;y=hh(this,v,s),void 0!==y&&(b=Pc(n,y,i),l?_=w=k=E=b:x=S=C=M=b,d.push({tx1:_,ty1:x,tx2:w,ty2:S,x1:k,y1:C,x2:E,y2:M,width:i,color:c,borderDash:u,borderDashOffset:h,tickWidth:p,tickColor:f,tickBorderDash:m,tickBorderDashOffset:g}))}return this._ticksLength=c,this._borderValue=g,d}_computeLabelItems(e){const t=this.axis,n=this.options,{position:r,ticks:o}=n,i=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:l,padding:c,mirror:u}=o,d=ph(n.grid),h=d+c,p=u?-c:h,f=-Fl(this.labelRotation),m=[];let g,v,y,b,_,x,w,S,k,C,E,M,P="middle";if("top"===r)x=this.bottom-p,w=this._getXAxisLabelAlignment();else if("bottom"===r)x=this.top+p,w=this._getXAxisLabelAlignment();else if("left"===r){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,_=e.x}else if("right"===r){const e=this._getYAxisLabelAlignment(d);w=e.textAlign,_=e.x}else if("x"===t){if("center"===r)x=(e.top+e.bottom)/2+h;else if(il(r)){const e=Object.keys(r)[0],t=r[e];x=this.chart.scales[e].getPixelForValue(t)+h}w=this._getXAxisLabelAlignment()}else if("y"===t){if("center"===r)_=(e.left+e.right)/2-h;else if(il(r)){const e=Object.keys(r)[0],t=r[e];_=this.chart.scales[e].getPixelForValue(t)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===t&&("start"===s?P="top":"end"===s&&(P="bottom"));const O=this._getLabelSizes();for(g=0,v=a.length;g<v;++g){y=a[g],b=y.label;const e=o.setContext(this.getContext(g));S=this.getPixelForTick(g)+o.labelOffset,k=this._resolveTickFontOptions(g),C=k.lineHeight,E=ol(b)?b.length:1;const t=E/2,n=e.color,s=e.textStrokeColor,c=e.textStrokeWidth;let d,h=w;if(i?(_=S,"inner"===w&&(h=g===v-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),M="top"===r?"near"===l||0!==f?-E*C+C/2:"center"===l?-O.highest.height/2-t*C+C:-O.highest.height+C/2:"near"===l||0!==f?C/2:"center"===l?O.highest.height/2-t*C:O.highest.height-E*C,u&&(M*=-1),0===f||e.showLabelBackdrop||(_+=C/2*Math.sin(f))):(x=S,M=(1-E)*C/2),e.showLabelBackdrop){const t=Uc(e.backdropPadding),n=O.heights[g],r=O.widths[g];let o=M-t.top,i=0-t.left;switch(P){case"middle":o-=n/2;break;case"bottom":o-=n}switch(w){case"center":i-=r/2;break;case"right":i-=r;break;case"inner":g===v-1?i-=r:g>0&&(i-=r/2)}d={left:i,top:o,width:r+t.width,height:n+t.height,color:e.backdropColor}}m.push({label:b,font:k,textOffset:M,options:{rotation:f,color:n,strokeColor:s,strokeWidth:c,textAlign:h,textBaseline:P,translation:[_,x],backdrop:d}})}return m}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Fl(this.labelRotation))return"top"===e?"left":"right";let n="center";return"start"===t.align?n="left":"end"===t.align?n="right":"inner"===t.align&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:n,mirror:r,padding:o}}=this.options,i=e+o,a=this._getLabelSizes().widest.width;let s,l;return"left"===t?r?(l=this.right+o,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l+=a)):(l=this.right-i,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l=this.left)):"right"===t?r?(l=this.left+o,"near"===n?s="right":"center"===n?(s="center",l-=a/2):(s="left",l-=a)):(l=this.left+i,"near"===n?s="left":"center"===n?(s="center",l+=a/2):(s="right",l=this.right)):s="right",{textAlign:s,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;return"left"===t||"right"===t?{top:0,left:this.left,bottom:e.height,right:this.right}:"top"===t||"bottom"===t?{top:this.top,left:0,bottom:this.bottom,right:e.width}:void 0}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:n,top:r,width:o,height:i}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,o,i),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const n=this.ticks.findIndex((t=>t.value===e));if(n>=0){return t.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(e){const t=this.options.grid,n=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,i;const a=(e,t,r)=>{r.width&&r.color&&(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(o=0,i=r.length;o<i;++o){const e=r[o];t.drawOnChartArea&&a({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},e),t.drawTicks&&a({x:e.tx1,y:e.ty1},{x:e.tx2,y:e.ty2},{color:e.tickColor,width:e.tickWidth,borderDash:e.tickBorderDash,borderDashOffset:e.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:n,grid:r}}=this,o=n.setContext(this.getContext()),i=n.display?o.width:0;if(!i)return;const a=r.setContext(this.getContext(0)).lineWidth,s=this._borderValue;let l,c,u,d;this.isHorizontal()?(l=Pc(e,this.left,i)-i/2,c=Pc(e,this.right,a)+a/2,u=d=s):(u=Pc(e,this.top,i)-i/2,d=Pc(e,this.bottom,a)+a/2,l=c=s),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(l,u),t.lineTo(c,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const t=this.ctx,n=this._computeLabelArea();n&&Ac(t,n);const r=this.getLabelItems(e);for(const e of r){const n=e.options,r=e.font;Fc(t,e.label,0,e.textOffset,r,n)}n&&Lc(t)}drawTitle(){const{ctx:e,options:{position:t,title:n,reverse:r}}=this;if(!n.display)return;const o=Zc(n.font),i=Uc(n.padding),a=n.align;let s=o.lineHeight/2;"bottom"===t||"center"===t||il(t)?(s+=i.bottom,ol(n.text)&&(s+=o.lineHeight*(n.text.length-1))):s+=i.top;const{titleX:l,titleY:c,maxWidth:u,rotation:d}=function(e,t,n,r){const{top:o,left:i,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d,h,p,f=0;const m=a-o,g=s-i;if(e.isHorizontal()){if(h=oc(r,i,s),il(n)){const e=Object.keys(n)[0],r=n[e];p=u[e].getPixelForValue(r)+m-t}else p="center"===n?(c.bottom+c.top)/2+m-t:ch(e,n,t);d=s-i}else{if(il(n)){const e=Object.keys(n)[0],r=n[e];h=u[e].getPixelForValue(r)-g+t}else h="center"===n?(c.left+c.right)/2-g+t:ch(e,n,t);p=oc(r,a,o),f="left"===n?-Tl:Tl}return{titleX:h,titleY:p,maxWidth:d,rotation:f}}(this,s,t,a);Fc(e,n.text,0,0,o,{color:n.color,maxWidth:u,rotation:d,textAlign:mh(a,t,r),textBaseline:"middle",translation:[l,c]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,n=ll(e.grid&&e.grid.z,-1),r=ll(e.border&&e.border.z,0);return this._isVisible()&&this.draw===gh.prototype.draw?[{z:n,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:t,draw:e=>{this.drawLabels(e)}}]:[{z:t,draw:e=>{this.draw(e)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",r=[];let o,i;for(o=0,i=t.length;o<i;++o){const i=t[o];i[n]!==this.id||e&&i.type!==e||r.push(i)}return r}_resolveTickFontOptions(e){return Zc(this.options.ticks.setContext(this.getContext(e)).font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class vh{constructor(e,t,n){this.type=e,this.scope=t,this.override=n,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let n;(function(e){return"id"in e&&"defaults"in e})(t)&&(n=this.register(t));const r=this.items,o=e.id,i=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in r||(r[o]=e,function(e,t,n){const r=gl(Object.create(null),[n?Cc.get(n):{},Cc.get(t),e.defaults]);Cc.set(t,r),e.defaultRoutes&&function(e,t){Object.keys(t).forEach((n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),a=t[n].split("."),s=a.pop(),l=a.join(".");Cc.route(i,o,l,s)}))}(t,e.defaultRoutes);e.descriptors&&Cc.describe(t,e.descriptors)}(e,i,n),this.override&&Cc.override(e.id,e.overrides)),i}get(e){return this.items[e]}unregister(e){const t=this.items,n=e.id,r=this.scope;n in t&&delete t[n],r&&n in Cc[r]&&(delete Cc[r][n],this.override&&delete _c[n])}}class yh{constructor(){this.controllers=new vh(sd,"datasets",!0),this.elements=new vh(ah,"elements"),this.plugins=new vh(Object,"plugins"),this.scales=new vh(gh,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,n){[...t].forEach((t=>{const r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):dl(t,(t=>{const r=n||this._getRegistryForType(t);this._exec(e,r,t)}))}))}_exec(e,t,n){const r=xl(e);ul(n["before"+r],[],n),t[e](n),ul(n["after"+r],[],n)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const n=this._typedRegistries[t];if(n.isForType(e))return n}return this.plugins}_get(e,t,n){const r=t.get(e);if(void 0===r)throw new Error('"'+e+'" is not a registered '+n+".");return r}}var bh=new yh;class _h{constructor(){this._init=[]}notify(e,t,n,r){"beforeInit"===t&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=r?this._descriptors(e).filter(r):this._descriptors(e),i=this._notify(o,e,t,n);return"afterDestroy"===t&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),i}_notify(e,t,n,r){r=r||{};for(const o of e){const e=o.plugin;if(!1===ul(e[n],[t,r,o.options],e)&&r.cancelable)return!1}return!0}invalidate(){rl(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const n=e&&e.config,r=ll(n.options&&n.options.plugins,{}),o=function(e){const t={},n=[],r=Object.keys(bh.plugins.items);for(let e=0;e<r.length;e++)n.push(bh.getPlugin(r[e]));const o=e.plugins||[];for(let e=0;e<o.length;e++){const r=o[e];-1===n.indexOf(r)&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}(n);return!1!==r||t?function(e,{plugins:t,localIds:n},r,o){const i=[],a=e.getContext();for(const s of t){const t=s.id,l=xh(r[t],o);null!==l&&i.push({plugin:s,options:wh(e.config,{plugin:s,local:n[t]},l,a)})}return i}(e,o,r,t):[]}_notifyStateChanges(e){const t=this._oldCache||[],n=this._cache,r=(e,t)=>e.filter((e=>!t.some((t=>e.plugin.id===t.plugin.id))));this._notify(r(t,n),e,"stop"),this._notify(r(n,t),e,"start")}}function xh(e,t){return t||!1!==e?!0===e?{}:e:null}function wh(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),a=e.getOptionScopes(r,i);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Sh(e,t){const n=Cc.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function kh(e){if("x"===e||"y"===e||"r"===e)return e}function Ch(e){return"top"===e||"bottom"===e?"x":"left"===e||"right"===e?"y":void 0}function Eh(e,...t){if(kh(e))return e;for(const n of t){const t=n.axis||Ch(n.position)||e.length>1&&kh(e[0].toLowerCase());if(t)return t}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Mh(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ph(e,t){const n=_c[e.type]||{scales:{}},r=t.scales||{},o=Sh(e.type,t),i=Object.create(null);return Object.keys(r).forEach((t=>{const a=r[t];if(!il(a))return console.error(`Invalid scale configuration for scale: ${t}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const s=Eh(t,a,function(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter((t=>t.xAxisID===e||t.yAxisID===e));if(n.length)return Mh(e,"x",n[0])||Mh(e,"y",n[0])}return{}}(t,e),Cc.scales[a.type]),l=function(e,t){return e===t?"_index_":"_value_"}(s,o),c=n.scales||{};i[t]=vl(Object.create(null),[{axis:s},a,c[s],c[l]])})),e.data.datasets.forEach((n=>{const o=n.type||e.type,a=n.indexAxis||Sh(o,t),s=(_c[o]||{}).scales||{};Object.keys(s).forEach((e=>{const t=function(e,t){let n=e;return"_index_"===e?n=t:"_value_"===e&&(n="x"===t?"y":"x"),n}(e,a),o=n[t+"AxisID"]||t;i[o]=i[o]||Object.create(null),vl(i[o],[{axis:t},r[o],s[e]])}))})),Object.keys(i).forEach((e=>{const t=i[e];vl(t,[Cc.scales[t.type],Cc.scale])})),i}function Oh(e){const t=e.options||(e.options={});t.plugins=ll(t.plugins,{}),t.scales=Ph(e,t)}function Th(e){return(e=e||{}).datasets=e.datasets||[],e.labels=e.labels||[],e}const Nh=new Map,Dh=new Set;function Ah(e,t){let n=Nh.get(e);return n||(n=t(),Nh.set(e,n),Dh.add(n)),n}const Lh=(e,t,n)=>{const r=_l(t,n);void 0!==r&&e.add(r)};class Ih{constructor(e){this._config=function(e){return(e=e||{}).data=Th(e.data),Oh(e),e}(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Th(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Oh(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Ah(e,(()=>[[`datasets.${e}`,""]]))}datasetAnimationScopeKeys(e,t){return Ah(`${e}.transition.${t}`,(()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]]))}datasetElementScopeKeys(e,t){return Ah(`${e}-${t}`,(()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]]))}pluginScopeKeys(e){const t=e.id;return Ah(`${this.type}-plugin-${t}`,(()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]]))}_cachedScopes(e,t){const n=this._scopeCache;let r=n.get(e);return r&&!t||(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){const{options:r,type:o}=this,i=this._cachedScopes(e,n),a=i.get(t);if(a)return a;const s=new Set;t.forEach((t=>{e&&(s.add(e),t.forEach((t=>Lh(s,e,t)))),t.forEach((e=>Lh(s,r,e))),t.forEach((e=>Lh(s,_c[o]||{},e))),t.forEach((e=>Lh(s,Cc,e))),t.forEach((e=>Lh(s,xc,e)))}));const l=Array.from(s);return 0===l.length&&l.push(Object.create(null)),Dh.has(t)&&i.set(t,l),l}chartOptionScopes(){const{options:e,type:t}=this;return[e,_c[t]||{},Cc.datasets[t]||{},{type:t},Cc,xc]}resolveNamedOptions(e,t,n,r=[""]){const o={$shared:!0},{resolver:i,subPrefixes:a}=zh(this._resolverCache,e,r);let s=i;if(function(e,t){const{isScriptable:n,isIndexable:r}=eu(e);for(const o of t){const t=n(o),i=r(o),a=(i||t)&&e[o];if(t&&(Sl(a)||Rh(a))||i&&ol(a))return!0}return!1}(i,t)){o.$shared=!1;s=Qc(i,n=Sl(n)?n():n,this.createResolver(e,n,a))}for(const e of t)o[e]=s[e];return o}createResolver(e,t,n=[""],r){const{resolver:o}=zh(this._resolverCache,e,n);return il(t)?Qc(o,t,void 0,r):o}}function zh(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);if(!i){i={resolver:Jc(t,n),subPrefixes:n.filter((e=>!e.toLowerCase().includes("hover")))},r.set(o,i)}return i}const Rh=e=>il(e)&&Object.getOwnPropertyNames(e).some((t=>Sl(e[t])));const $h=["top","bottom","left","right","chartArea"];function Fh(e,t){return"top"===e||"bottom"===e||-1===$h.indexOf(e)&&"x"===t}function jh(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Bh(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),ul(n&&n.onComplete,[e],t)}function Hh(e){const t=e.chart,n=t.options.animation;ul(n&&n.onProgress,[e],t)}function Wh(e){return bu()&&"string"==typeof e?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Vh={},Yh=e=>{const t=Wh(e);return Object.values(Vh).filter((e=>e.canvas===t)).pop()};function Xh(e,t,n){const r=Object.keys(e);for(const o of r){const r=+o;if(r>=t){const i=e[o];delete e[o],(n>0||r>t)&&(e[r+n]=i)}}}function qh(e,t,n){return e.options.clip?e[n]:t[n]}class Uh{static defaults=Cc;static instances=Vh;static overrides=_c;static registry=bh;static version="4.4.7";static getChart=Yh;static register(...e){bh.add(...e),Zh()}static unregister(...e){bh.remove(...e),Zh()}constructor(e,t){const n=this.config=new Ih(t),r=Wh(e),o=Yh(r);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 i=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(e){return!bu()||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?Vd:ih}(r)),this.platform.updateConfig(n);const a=this.platform.acquireContext(r,i.aspectRatio),s=a&&a.canvas,l=s&&s.height,c=s&&s.width;this.id=nl(),this.ctx=a,this.canvas=s,this.width=c,this.height=l,this._options=i,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 _h,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}((e=>this.update(e)),i.resizeDelay||0),this._dataChanges=[],Vh[this.id]=this,a&&s?(Yu.listen(this,"complete",Bh),Yu.listen(this,"progress",Hh),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:o}=this;return rl(e)?t&&o?o:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return bh}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Pu(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oc(this.canvas,this.ctx),this}stop(){return Yu.stop(this),this}resize(e,t){Yu.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const n=this.options,r=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,e,t,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Pu(this,a,!0)&&(this.notifyPlugins("resize",{size:i}),ul(n.onResize,[this,i],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){dl(this.options.scales||{},((e,t)=>{e.id=t}))}buildOrUpdateScales(){const e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce(((e,t)=>(e[t]=!1,e)),{});let o=[];t&&(o=o.concat(Object.keys(t).map((e=>{const n=t[e],r=Eh(e,n),o="r"===r,i="x"===r;return{options:n,dposition:o?"chartArea":i?"bottom":"left",dtype:o?"radialLinear":i?"category":"linear"}})))),dl(o,(t=>{const o=t.options,i=o.id,a=Eh(i,o),s=ll(o.type,t.dtype);void 0!==o.position&&Fh(o.position,a)===Fh(t.dposition)||(o.position=t.dposition),r[i]=!0;let l=null;if(i in n&&n[i].type===s)l=n[i];else{l=new(bh.getScale(s))({id:i,type:s,ctx:this.ctx,chart:this}),n[l.id]=l}l.init(o,e)})),dl(r,((e,t)=>{e||delete n[t]})),dl(n,(e=>{Hd.configure(this,e,e.options),Hd.addBox(this,e)}))}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort(((e,t)=>e.index-t.index)),n>t){for(let e=t;e<n;++e)this._destroyDatasetMeta(e);e.splice(t,n-t)}this._sortedMetasets=e.slice(0).sort(jh("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach(((e,n)=>{0===t.filter((t=>t===e._dataset)).length&&this._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n<r;n++){const r=t[n];let o=this.getDatasetMeta(n);const i=r.type||this.config.type;if(o.type&&o.type!==i&&(this._destroyDatasetMeta(n),o=this.getDatasetMeta(n)),o.type=i,o.indexAxis=r.indexAxis||Sh(i,this.options),o.order=r.order||0,o.index=n,o.label=""+r.label,o.visible=this.isDatasetVisible(n),o.controller)o.controller.updateIndex(n),o.controller.linkScales();else{const t=bh.getController(i),{datasetElementType:r,dataElementType:a}=Cc.datasets[i];Object.assign(t,{dataElementType:bh.getElement(a),datasetElementType:r&&bh.getElement(r)}),o.controller=new t(this,n),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){dl(this.data.datasets,((e,t)=>{this.getDatasetMeta(t).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let e=0,t=this.data.datasets.length;e<t;e++){const{controller:t}=this.getDatasetMeta(e),n=!r&&-1===o.indexOf(t);t.buildOrUpdateElements(n),i=Math.max(+t.getMaxOverflow(),i)}i=this._minPadding=n.layout.autoPadding?i:0,this._updateLayout(i),r||dl(o,(e=>{e.reset()})),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(jh("z","_idx"));const{_active:a,_lastEvent:s}=this;s?this._eventHandler(s,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){dl(this.scales,(e=>{Hd.removeBox(this,e)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),n=new Set(e.events);kl(t,n)&&!!this._responsiveListeners===e.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:n,start:r,count:o}of t){Xh(e,r,"_removeElements"===n?-o:o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,n=t=>new Set(e.filter((e=>e[0]===t)).map(((e,t)=>t+","+e.splice(1).join(",")))),r=n(0);for(let e=1;e<t;e++)if(!kl(r,n(e)))return;return Array.from(r).map((e=>e.split(","))).map((e=>({method:e[1],start:+e[2],count:+e[3]})))}_updateLayout(e){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Hd.update(this,this.width,this.height,e);const t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],dl(this.boxes,(e=>{n&&"chartArea"===e.position||(e.configure&&e.configure(),this._layers.push(...e._layers()))}),this),this._layers.forEach(((e,t)=>{e._idx=t})),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})){for(let e=0,t=this.data.datasets.length;e<t;++e)this.getDatasetMeta(e).controller.configure();for(let t=0,n=this.data.datasets.length;t<n;++t)this._updateDataset(t,Sl(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const n=this.getDatasetMeta(e),r={meta:n,index:e,mode:t,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",r)&&(n.controller._update(t),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Yu.has(this)?this.attached&&!Yu.running(this)&&Yu.start(this):(this.draw(),Bh({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:e,height:t}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(e,t)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,n=[];let r,o;for(r=0,o=t.length;r<o;++r){const o=t[r];e&&!o.visible||n.push(o)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,n=e._clip,r=!n.disabled,o=function(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:qh(n,t,"left"),right:qh(n,t,"right"),top:qh(r,t,"top"),bottom:qh(r,t,"bottom")}:t}(e,this.chartArea),i={meta:e,index:e.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(r&&Ac(t,{left:!1===n.left?0:o.left-n.left,right:!1===n.right?this.width:o.right+n.right,top:!1===n.top?0:o.top-n.top,bottom:!1===n.bottom?this.height:o.bottom+n.bottom}),e.controller.draw(),r&&Lc(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(e){return Dc(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){const o=Od.modes[t];return"function"==typeof o?o(this,e,n,r):[]}getDatasetMeta(e){const t=this.data.datasets[e],n=this._metasets;let r=n.filter((e=>e&&e._dataset===t)).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||(this.$context=Kc(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const n=this.getDatasetMeta(e);return"boolean"==typeof n.hidden?!n.hidden:!t.hidden}setDatasetVisibility(e,t){this.getDatasetMeta(e).hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){const r=n?"show":"hide",o=this.getDatasetMeta(e),i=o.controller._resolveAnimations(void 0,r);wl(t)?(o.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),i.update(o,{visible:n}),this.update((t=>t.datasetIndex===e?r:void 0)))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Yu.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Oc(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete Vh[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};dl(this.options.events,(e=>n(e,r)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},o=(e,t)=>{this.canvas&&this.resize(e,t)};let i;const a=()=>{r("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",i)};i=()=>{this.attached=!1,r("resize",o),this._stop(),this._resize(0,0),n("attach",a)},t.isAttached(this.canvas)?a():i()}unbindEvents(){dl(this._listeners,((e,t)=>{this.platform.removeEventListener(this,t,e)})),this._listeners={},dl(this._responsiveListeners,((e,t)=>{this.platform.removeEventListener(this,t,e)})),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){const r=n?"set":"remove";let o,i,a,s;for("dataset"===t&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+r+"DatasetHoverStyle"]()),a=0,s=e.length;a<s;++a){i=e[a];const t=i&&this.getDatasetMeta(i.datasetIndex).controller;t&&t[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],n=e.map((({datasetIndex:e,index:t})=>{const n=this.getDatasetMeta(e);if(!n)throw new Error("No dataset found at index "+e);return{datasetIndex:e,element:n.data[t],index:t}}));!hl(n,t)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return 1===this._plugins._cache.filter((t=>t.plugin.id===e)).length}_updateHoverStyles(e,t,n){const r=this.options.hover,o=(e,t)=>e.filter((e=>!t.some((t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)))),i=o(t,e),a=n?e:o(e,t);i.length&&this.updateHoverStyle(i,r.mode,!1),a.length&&r.mode&&this.updateHoverStyle(a,r.mode,!0)}_eventHandler(e,t){const n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(!1===this.notifyPlugins("beforeEvent",n,r))return;const o=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,r),(o||n.changed)&&this.render(),this}_handleEvent(e,t,n){const{_active:r=[],options:o}=this,i=t,a=this._getActiveElements(e,r,n,i),s=function(e){return"mouseup"===e.type||"click"===e.type||"contextmenu"===e.type}(e),l=function(e,t,n,r){return n&&"mouseout"!==e.type?r?t:e:null}(e,this._lastEvent,n,s);n&&(this._lastEvent=null,ul(o.onHover,[e,a,this],this),s&&ul(o.onClick,[e,a,this],this));const c=!hl(a,r);return(c||t)&&(this._active=a,this._updateHoverStyles(a,r,t)),this._lastEvent=l,c}_getActiveElements(e,t,n,r){if("mouseout"===e.type)return[];if(!n)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,r)}}function Zh(){return dl(Uh.instances,(e=>e._plugins.invalidate()))}function Gh(e,t,n,r){const o=Yc(e.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const i=(n-t)/2,a=Math.min(i,r*t/2),s=e=>{const t=(n-Math.min(i,e))*r/2;return ql(e,0,Math.min(i,t))};return{outerStart:s(o.outerStart),outerEnd:s(o.outerEnd),innerStart:ql(o.innerStart,0,a),innerEnd:ql(o.innerEnd,0,a)}}function Kh(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Jh(e,t,n,r,o,i){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),h=u>0?u+r+n+c:0;let p=0;const f=o-l;if(r){const e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(f-(0!==e?f*e/(e+r):f))/2}const m=(f-Math.max(.001,f*d-n/Cl)/d)/2,g=l+m+p,v=o-m-p,{outerStart:y,outerEnd:b,innerStart:_,innerEnd:x}=Gh(t,h,d,v-g),w=d-y,S=d-b,k=g+y/w,C=v-b/S,E=h+_,M=h+x,P=g+_/E,O=v-x/M;if(e.beginPath(),i){const t=(k+C)/2;if(e.arc(a,s,d,k,t),e.arc(a,s,d,t,C),b>0){const t=Kh(S,C,a,s);e.arc(t.x,t.y,b,C,v+Tl)}const n=Kh(M,v,a,s);if(e.lineTo(n.x,n.y),x>0){const t=Kh(M,O,a,s);e.arc(t.x,t.y,x,v+Tl,O+Math.PI)}const r=(v-x/h+(g+_/h))/2;if(e.arc(a,s,h,v-x/h,r,!0),e.arc(a,s,h,r,g+_/h,!0),_>0){const t=Kh(E,P,a,s);e.arc(t.x,t.y,_,P+Math.PI,g-Tl)}const o=Kh(w,g,a,s);if(e.lineTo(o.x,o.y),y>0){const t=Kh(w,k,a,s);e.arc(t.x,t.y,y,g-Tl,k)}}else{e.moveTo(a,s);const t=Math.cos(k)*d+a,n=Math.sin(k)*d+s;e.lineTo(t,n);const r=Math.cos(C)*d+a,o=Math.sin(C)*d+s;e.lineTo(r,o)}e.closePath()}function Qh(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,p="inner"===l.borderAlign;if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=h,p?(e.lineWidth=2*c,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let f=t.endAngle;if(i){Jh(e,t,n,r,f,o);for(let t=0;t<i;++t)e.stroke();isNaN(s)||(f=a+(s%El||El))}p&&function(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:a,outerRadius:s,innerRadius:l}=t;let c=o/s;e.beginPath(),e.arc(i,a,s,r-c,n+c),l>o?(c=o/l,e.arc(i,a,l,n+c,r-c,!0)):e.arc(i,a,o,n+Tl,r-Tl),e.closePath(),e.clip()}(e,t,f),i||(Jh(e,t,n,r,f,o),e.stroke())}function ep(e,t,n=t){e.lineCap=ll(n.borderCapStyle,t.borderCapStyle),e.setLineDash(ll(n.borderDash,t.borderDash)),e.lineDashOffset=ll(n.borderDashOffset,t.borderDashOffset),e.lineJoin=ll(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=ll(n.borderWidth,t.borderWidth),e.strokeStyle=ll(n.borderColor,t.borderColor)}function tp(e,t,n){e.lineTo(n.x,n.y)}function np(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:a,end:s}=t,l=Math.max(o,a),c=Math.min(i,s),u=o<a&&i<a||o>s&&i>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function rp(e,t,n,r){const{points:o,options:i}=t,{count:a,start:s,loop:l,ilen:c}=np(o,n,r),u=function(e){return e.stepped?Ic:e.tension||"monotone"===e.cubicInterpolationMode?zc:tp}(i);let d,h,p,{move:f=!0,reverse:m}=r||{};for(d=0;d<=c;++d)h=o[(s+(m?c-d:d))%a],h.skip||(f?(e.moveTo(h.x,h.y),f=!1):u(e,p,h,m,i.stepped),p=h);return l&&(h=o[(s+(m?c:0))%a],u(e,p,h,m,i.stepped)),!!l}function op(e,t,n,r){const o=t.points,{count:i,start:a,ilen:s}=np(o,n,r),{move:l=!0,reverse:c}=r||{};let u,d,h,p,f,m,g=0,v=0;const y=e=>(a+(c?s-e:e))%i,b=()=>{p!==f&&(e.lineTo(g,f),e.lineTo(g,p),e.lineTo(g,m))};for(l&&(d=o[y(0)],e.moveTo(d.x,d.y)),u=0;u<=s;++u){if(d=o[y(u)],d.skip)continue;const t=d.x,n=d.y,r=0|t;r===h?(n<p?p=n:n>f&&(f=n),g=(v*g+t)/++v):(b(),e.lineTo(t,n),h=r,v=0,p=f=n),m=n}b()}function ip(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!(e._decimated||e._loop||t.tension||"monotone"===t.cubicInterpolationMode||t.stepped||n)?op:rp}const ap="function"==typeof Path2D;function sp(e,t,n,r){ap&&!t.options.segment?function(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),ep(e,t.options),e.stroke(o)}(e,t,n,r):function(e,t,n,r){const{segments:o,options:i}=t,a=ip(t);for(const s of o)ep(e,i,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}(e,t,n,r)}class lp extends ah{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e&&"fill"!==e};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const r=n.spanGaps?this._loop:this._fullLoop;yu(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:a,end:s}=function(e,t,n,r){let o=0,i=t-1;if(n&&!r)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(i+=o);i>o&&e[i%t].skip;)i--;return i%=t,{start:o,end:i}}(n,o,i,r);return Bu(e,!0===r?[{start:a,end:s,loop:i}]:function(e,t,n,r){const o=e.length,i=[];let a,s=t,l=e[t];for(a=t+1;a<=n;++a){const n=e[a%o];n.skip||n.stop?l.skip||(r=!1,i.push({start:t%o,end:(a-1)%o,loop:r}),t=s=n.stop?a:null):(s=a,l.skip&&(t=a)),l=n}return null!==s&&i.push({start:t%o,end:s%o,loop:r}),i}(n,a,s<a?s+o:s,!!e._fullLoop&&0===a&&s===o-1),n,t)}(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){const n=this.options,r=e[t],o=this.points,i=ju(this,{property:t,start:r,end:r});if(!i.length)return;const a=[],s=function(e){return e.stepped?Du:e.tension||"monotone"===e.cubicInterpolationMode?Au:Nu}(n);let l,c;for(l=0,c=i.length;l<c;++l){const{start:c,end:u}=i[l],d=o[c],h=o[u];if(d===h){a.push(d);continue}const p=s(d,h,Math.abs((r-d[t])/(h[t]-d[t])),n.stepped);p[t]=e[t],a.push(p)}return 1===a.length?a[0]:a}pathSegment(e,t,n){return ip(this)(e,this,t,n)}path(e,t,n){const r=this.segments,o=ip(this);let i=this._loop;t=t||0,n=n||this.points.length-t;for(const a of r)i&=o(e,this,a,{start:t,end:t+n-1});return!!i}draw(e,t,n,r){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),sp(e,this,n,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function cp(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}function up(e,t){const{x:n,y:r,base:o,width:i,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,s=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:s,top:c,right:l,bottom:u}}function dp(e,t,n,r){return e?0:ql(t,n,r)}function hp(e){const t=up(e),n=t.right-t.left,r=t.bottom-t.top,o=function(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=Xc(r);return{t:dp(o.top,i.top,0,n),r:dp(o.right,i.right,0,t),b:dp(o.bottom,i.bottom,0,n),l:dp(o.left,i.left,0,t)}}(e,n/2,r/2),i=function(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=qc(o),a=Math.min(t,n),s=e.borderSkipped,l=r||il(o);return{topLeft:dp(!l||s.top||s.left,i.topLeft,0,a),topRight:dp(!l||s.top||s.right,i.topRight,0,a),bottomLeft:dp(!l||s.bottom||s.left,i.bottomLeft,0,a),bottomRight:dp(!l||s.bottom||s.right,i.bottomRight,0,a)}}(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function pp(e,t,n,r){const o=null===t,i=null===n,a=e&&!(o&&i)&&up(e,r);return a&&(o||Ul(t,a.left,a.right))&&(i||Ul(n,a.top,a.bottom))}function fp(e,t){e.rect(t.x,t.y,t.w,t.h)}function mp(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+a,radius:e.radius}}class gp extends ah{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:n,backgroundColor:r}}=this,{inner:o,outer:i}=hp(this),a=(s=i.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?jc:fp;var s;e.save(),i.w===o.w&&i.h===o.h||(e.beginPath(),a(e,mp(i,t,o)),e.clip(),a(e,mp(o,-t,i)),e.fillStyle=n,e.fill("evenodd")),e.beginPath(),a(e,mp(o,t)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,t,n){return pp(this,e,t,n)}inXRange(e,t){return pp(this,e,null,t)}inYRange(e,t){return pp(this,null,e,t)}getCenterPoint(e){const{x:t,y:n,base:r,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+r)/2:t,y:o?n:(n+r)/2}}getRange(e){return"x"===e?this.width/2:this.height/2}}var vp=Object.freeze({__proto__:null,ArcElement:class extends ah{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>"borderDash"!==e};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){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,e&&Object.assign(this,e)}inRange(e,t,n){const r=this.getProps(["x","y"],n),{angle:o,distance:i}=Hl(r,{x:e,y:t}),{startAngle:a,endAngle:s,innerRadius:l,outerRadius:c,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),d=(this.options.spacing+this.options.borderWidth)/2,h=ll(u,s-a),p=Xl(o,a,s)&&a!==s,f=h>=El||p,m=Ul(i,l+d,c+d);return f&&m}getCenterPoint(e){const{x:t,y:n,startAngle:r,endAngle:o,innerRadius:i,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:s,spacing:l}=this.options,c=(r+o)/2,u=(i+a+l+s)/2;return{x:t+Math.cos(c)*u,y:n+Math.sin(c)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:n}=this,r=(t.offset||0)/4,o=(t.spacing||0)/2,i=t.circular;if(this.pixelMargin="inner"===t.borderAlign?.33:0,this.fullCircles=n>El?Math.floor(n/El):0,0===n||this.innerRadius<0||this.outerRadius<0)return;e.save();const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*r,Math.sin(a)*r);const s=r*(1-Math.sin(Math.min(Cl,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,function(e,t,n,r,o){const{fullCircles:i,startAngle:a,circumference:s}=t;let l=t.endAngle;if(i){Jh(e,t,n,r,l,o);for(let t=0;t<i;++t)e.fill();isNaN(s)||(l=a+(s%El||El))}Jh(e,t,n,r,l,o),e.fill()}(e,this,s,o,i),Qh(e,this,s,o,i),e.restore()}},BarElement:gp,LineElement:lp,PointElement:class extends ah{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,n){const r=this.options,{x:o,y:i}=this.getProps(["x","y"],n);return Math.pow(e-o,2)+Math.pow(t-i,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,t){return cp(this,e,"x",t)}inYRange(e,t){return cp(this,e,"y",t)}getCenterPoint(e){const{x:t,y:n}=this.getProps(["x","y"],e);return{x:t,y:n}}size(e){let t=(e=e||this.options||{}).radius||0;t=Math.max(t,t&&e.hoverRadius||0);return 2*(t+(t&&e.borderWidth||0))}draw(e,t){const n=this.options;this.skip||n.radius<.1||!Dc(this,t,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Tc(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}});const yp=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],bp=yp.map((e=>e.replace("rgb(","rgba(").replace(")",", 0.5)")));function _p(e){return yp[e%yp.length]}function xp(e){return bp[e%bp.length]}function wp(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof vd?t=function(e,t){return e.backgroundColor=e.data.map((()=>_p(t++))),t}(n,t):o instanceof yd?t=function(e,t){return e.backgroundColor=e.data.map((()=>xp(t++))),t}(n,t):o&&(t=function(e,t){return e.borderColor=_p(t),e.backgroundColor=xp(t),++t}(n,t))}}function Sp(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}var kp={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o,a=Sp(r)||(s=o)&&(s.borderColor||s.backgroundColor)||i&&Sp(i)||"rgba(0,0,0,0.1)"!==Cc.borderColor||"rgba(0,0,0,0.1)"!==Cc.backgroundColor;var s;if(!n.forceOverride&&a)return;const l=wp(e);r.forEach(l)}};function Cp(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ep(e){e.data.datasets.forEach((e=>{Cp(e)}))}var Mp={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled)return void Ep(e);const r=e.width;e.data.datasets.forEach(((t,o)=>{const{_data:i,indexAxis:a}=t,s=e.getDatasetMeta(o),l=i||t.data;if("y"===Gc([a,e.options.indexAxis]))return;if(!s.controller.supportsDecimation)return;const c=e.scales[s.xAxisID];if("linear"!==c.type&&"time"!==c.type)return;if(e.options.parsing)return;let{start:u,count:d}=function(e,t){const n=t.length;let r,o=0;const{iScale:i}=e,{min:a,max:s,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(o=ql(Gl(t,i.axis,a).lo,0,n-1)),r=c?ql(Gl(t,i.axis,s).hi+1,o,n)-o:n-o,{start:o,count:r}}(s,l);if(d<=(n.threshold||4*r))return void Cp(t);let h;switch(rl(i)&&(t._data=l,delete t.data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(e){this._data=e}})),n.algorithm){case"lttb":h=function(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const a=[],s=(n-2)/(i-2);let l=0;const c=t+n-1;let u,d,h,p,f,m=t;for(a[l++]=e[m],u=0;u<i-2;u++){let r,o=0,i=0;const c=Math.floor((u+1)*s)+1+t,g=Math.min(Math.floor((u+2)*s)+1,n)+t,v=g-c;for(r=c;r<g;r++)o+=e[r].x,i+=e[r].y;o/=v,i/=v;const y=Math.floor(u*s)+1+t,b=Math.min(Math.floor((u+1)*s)+1,n)+t,{x:_,y:x}=e[m];for(h=p=-1,r=y;r<b;r++)p=.5*Math.abs((_-o)*(e[r].y-x)-(_-e[r].x)*(i-x)),p>h&&(h=p,d=e[r],f=r);a[l++]=d,m=f}return a[l++]=e[c],a}(l,u,d,r,n);break;case"min-max":h=function(e,t,n,r){let o,i,a,s,l,c,u,d,h,p,f=0,m=0;const g=[],v=t+n-1,y=e[t].x,b=e[v].x-y;for(o=t;o<t+n;++o){i=e[o],a=(i.x-y)/b*r,s=i.y;const t=0|a;if(t===l)s<h?(h=s,c=o):s>p&&(p=s,u=o),f=(m*f+i.x)/++m;else{const n=o-1;if(!rl(c)&&!rl(u)){const t=Math.min(c,u),r=Math.max(c,u);t!==d&&t!==n&&g.push({...e[t],x:f}),r!==d&&r!==n&&g.push({...e[r],x:f})}o>0&&n!==d&&g.push(e[n]),g.push(i),l=t,m=0,h=p=s,c=u=d=o}}return g}(l,u,d,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}t._decimated=h}))},destroy(e){Ep(e)}};function Pp(e,t,n,r){if(r)return;let o=t[e],i=n[e];return"angle"===e&&(o=Yl(o),i=Yl(i)),{property:e,start:o,end:i}}function Op(e,t,n){for(;t>e;t--){const e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function Tp(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Np(e,t){let n=[],r=!1;return ol(e)?(r=!0,n=e):n=function(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach((({start:e,end:t})=>{t=Op(e,t,o);const a=o[e],s=o[t];null!==r?(i.push({x:a.x,y:r}),i.push({x:s.x,y:r})):null!==n&&(i.push({x:n,y:a.y}),i.push({x:n,y:s.y}))})),i}(e,t),n.length?new lp({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Dp(e){return e&&!1!==e.fill}function Ap(e,t,n){let r=e[t].fill;const o=[t];let i;if(!n)return r;for(;!1!==r&&-1===o.indexOf(r);){if(!al(r))return r;if(i=e[r],!i)return!1;if(i.visible)return r;o.push(r),r=i.fill}return!1}function Lp(e,t,n){const r=function(e){const t=e.options,n=t.fill;let r=ll(n&&n.target,n);void 0===r&&(r=!!t.backgroundColor);if(!1===r||null===r)return!1;if(!0===r)return"origin";return r}(e);if(il(r))return!isNaN(r.value)&&r;let o=parseFloat(r);return al(o)&&Math.floor(o)===o?function(e,t,n,r){"-"!==e&&"+"!==e||(n=t+n);if(n===t||n<0||n>=r)return!1;return n}(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Ip(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:a,last:s,point:l}=zp(i,t,"x");if(!(!l||a&&s))if(a)r.unshift(l);else if(e.push(l),!s)break}e.push(...r)}function zp(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],i=e.segments,a=e.points;let s=!1,l=!1;for(let e=0;e<i.length;e++){const t=i[e],r=a[t.start][n],c=a[t.end][n];if(Ul(o,r,c)){s=o===r,l=o===c;break}}return{first:s,last:l,point:r}}class Rp{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,n){const{x:r,y:o,radius:i}=this;return t=t||{start:0,end:El},e.arc(r,o,i,t.end,t.start,!0),!n.bounds}interpolate(e){const{x:t,y:n,radius:r}=this,o=e.angle;return{x:t+Math.cos(o)*r,y:n+Math.sin(o)*r,angle:o}}}function $p(e){const{chart:t,fill:n,line:r}=e;if(al(n))return function(e,t){const n=e.getDatasetMeta(t),r=n&&e.isDatasetVisible(t);return r?n.dataset:null}(t,n);if("stack"===n)return function(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,a=r.points,s=function(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let e=0;e<r.length;e++){const o=r[e];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}(t,n);s.push(Np({x:null,y:t.bottom},r));for(let e=0;e<i.length;e++){const t=i[e];for(let e=t.start;e<=t.end;e++)Ip(o,a[e],s)}return new lp({points:o,options:{}})}(e);if("shape"===n)return!0;const o=function(e){const t=e.scale||{};if(t.getPointPositionForValue)return function(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,a=function(e,t,n){let r;return r="start"===e?n:"end"===e?t.options.reverse?t.min:t.max:il(e)?e.value:t.getBaseValue(),r}(n,t,i),s=[];if(r.grid.circular){const e=t.getPointPositionForValue(0,i);return new Rp({x:e.x,y:e.y,radius:t.getDistanceFromCenterForValue(a)})}for(let e=0;e<o;++e)s.push(t.getPointPositionForValue(e,a));return s}(e);return function(e){const{scale:t={},fill:n}=e,r=function(e,t){let n=null;return"start"===e?n=t.bottom:"end"===e?n=t.top:il(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}(n,t);if(al(r)){const e=t.isHorizontal();return{x:e?r:null,y:e?null:r}}return null}(e)}(e);return o instanceof Rp?o:Np(o,r)}function Fp(e,t,n){const r=$p(t),{line:o,scale:i,axis:a}=t,s=o.options,l=s.fill,c=s.backgroundColor,{above:u=c,below:d=c}=l||{};r&&o.points.length&&(Ac(e,n),function(e,t){const{line:n,target:r,above:o,below:i,area:a,scale:s}=t,l=n._loop?"angle":t.axis;e.save(),"x"===l&&i!==o&&(jp(e,r,a.top),Bp(e,{line:n,target:r,color:o,scale:s,property:l}),e.restore(),e.save(),jp(e,r,a.bottom));Bp(e,{line:n,target:r,color:i,scale:s,property:l}),e.restore()}(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:a}),Lc(e))}function jp(e,t,n){const{segments:r,points:o}=t;let i=!0,a=!1;e.beginPath();for(const s of r){const{start:r,end:l}=s,c=o[r],u=o[Op(r,l,o)];i?(e.moveTo(c.x,c.y),i=!1):(e.lineTo(c.x,n),e.lineTo(c.x,c.y)),a=!!t.pathSegment(e,s,{move:a}),a?e.closePath():e.lineTo(u.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Bp(e,t){const{line:n,target:r,property:o,color:i,scale:a}=t,s=function(e,t,n){const r=e.segments,o=e.points,i=t.points,a=[];for(const e of r){let{start:r,end:s}=e;s=Op(r,s,o);const l=Pp(n,o[r],o[s],e.loop);if(!t.segments){a.push({source:e,target:l,start:o[r],end:o[s]});continue}const c=ju(t,l);for(const t of c){const r=Pp(n,i[t.start],i[t.end],t.loop),s=Fu(e,o,r);for(const e of s)a.push({source:e,target:t,start:{[n]:Tp(l,r,"start",Math.max)},end:{[n]:Tp(l,r,"end",Math.min)}})}}return a}(n,r,o);for(const{source:t,target:l,start:c,end:u}of s){const{style:{backgroundColor:s=i}={}}=t,d=!0!==r;e.save(),e.fillStyle=s,Hp(e,a,d&&Pp(o,c,u)),e.beginPath();const h=!!n.pathSegment(e,t);let p;if(d){h?e.closePath():Wp(e,r,u,o);const t=!!r.pathSegment(e,l,{move:h,reverse:!0});p=h&&t,p||Wp(e,r,c,o)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function Hp(e,t,n){const{top:r,bottom:o}=t.chart.chartArea,{property:i,start:a,end:s}=n||{};"x"===i&&(e.beginPath(),e.rect(a,r,s-a,o-r),e.clip())}function Wp(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var Vp={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,o=[];let i,a,s,l;for(a=0;a<r;++a)i=e.getDatasetMeta(a),s=i.dataset,l=null,s&&s.options&&s instanceof lp&&(l={visible:e.isDatasetVisible(a),index:a,fill:Lp(s,a,r),chart:e,axis:i.controller.options.indexAxis,scale:i.vScale,line:s}),i.$filler=l,o.push(l);for(a=0;a<r;++a)l=o[a],l&&!1!==l.fill&&(l.fill=Ap(o,a,n.propagate))},beforeDraw(e,t,n){const r="beforeDraw"===n.drawTime,o=e.getSortedVisibleDatasetMetas(),i=e.chartArea;for(let t=o.length-1;t>=0;--t){const n=o[t].$filler;n&&(n.line.updateControlPoints(i,n.axis),r&&n.fill&&Fp(e.ctx,n,i))}},beforeDatasetsDraw(e,t,n){if("beforeDatasetsDraw"!==n.drawTime)return;const r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){const n=r[t].$filler;Dp(n)&&Fp(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;Dp(r)&&"beforeDatasetDraw"===n.drawTime&&Fp(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Yp=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}};class Xp extends ah{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=ul(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter((t=>e.filter(t,this.chart.data)))),e.sort&&(t=t.sort(((t,n)=>e.sort(t,n,this.chart.data)))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display)return void(this.width=this.height=0);const n=e.labels,r=Zc(n.font),o=r.size,i=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=Yp(n,o);let l,c;t.font=r.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(i,o,a,s)+10):(c=this.maxHeight,l=this._fitCols(i,r,a,s)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(c,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){const{ctx:o,maxWidth:i,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.lineWidths=[0],c=r+a;let u=e;o.textAlign="left",o.textBaseline="middle";let d=-1,h=-c;return this.legendItems.forEach(((e,p)=>{const f=n+t/2+o.measureText(e.text).width;(0===p||l[l.length-1]+f+2*a>i)&&(u+=c,l[l.length-(p>0?0:1)]=0,h+=c,d++),s[p]={left:0,top:h,row:d,width:f,height:r},l[l.length-1]+=f+a})),u}_fitCols(e,t,n,r){const{ctx:o,maxHeight:i,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],l=this.columnSizes=[],c=i-e;let u=a,d=0,h=0,p=0,f=0;return this.legendItems.forEach(((e,i)=>{const{itemWidth:m,itemHeight:g}=function(e,t,n,r,o){const i=function(e,t,n,r){let o=e.text;o&&"string"!=typeof o&&(o=o.reduce(((e,t)=>e.length>t.length?e:t)));return t+n.size/2+r.measureText(o).width}(r,e,t,n),a=function(e,t,n){let r=e;"string"!=typeof t.text&&(r=qp(t,n));return r}(o,r,t.lineHeight);return{itemWidth:i,itemHeight:a}}(n,t,o,e,r);i>0&&h+g+2*a>c&&(u+=d+a,l.push({width:d,height:h}),p+=d+a,f++,d=h=0),s[i]={left:p,top:h,col:f,width:m,height:g},d=Math.max(d,m),h+=g+a})),u+=d,l.push({width:d,height:h}),u}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:o}}=this,i=Lu(o,this.left,this.width);if(this.isHorizontal()){let o=0,a=oc(n,this.left+r,this.right-this.lineWidths[o]);for(const s of t)o!==s.row&&(o=s.row,a=oc(n,this.left+r,this.right-this.lineWidths[o])),s.top+=this.top+e+r,s.left=i.leftForLtr(i.x(a),s.width),a+=s.width+r}else{let o=0,a=oc(n,this.top+e+r,this.bottom-this.columnSizes[o].height);for(const s of t)s.col!==o&&(o=s.col,a=oc(n,this.top+e+r,this.bottom-this.columnSizes[o].height)),s.top=a,s.left+=this.left+r,s.left=i.leftForLtr(i.x(s.left),s.width),a+=s.height+r}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const e=this.ctx;Ac(e,this),this._draw(),Lc(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:o,labels:i}=e,a=Cc.color,s=Lu(e.rtl,this.left,this.width),l=Zc(i.font),{padding:c}=i,u=l.size,d=u/2;let h;this.drawTitle(),r.textAlign=s.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=l.string;const{boxWidth:p,boxHeight:f,itemHeight:m}=Yp(i,u),g=this.isHorizontal(),v=this._computeTitleHeight();h=g?{x:oc(o,this.left+c,this.right-n[0]),y:this.top+c+v,line:0}:{x:this.left+c,y:oc(o,this.top+v+c,this.bottom-t[0].height),line:0},Iu(this.ctx,e.textDirection);const y=m+c;this.legendItems.forEach(((b,_)=>{r.strokeStyle=b.fontColor,r.fillStyle=b.fontColor;const x=r.measureText(b.text).width,w=s.textAlign(b.textAlign||(b.textAlign=i.textAlign)),S=p+d+x;let k=h.x,C=h.y;s.setWidth(this.width),g?_>0&&k+S+c>this.right&&(C=h.y+=y,h.line++,k=h.x=oc(o,this.left+c,this.right-n[h.line])):_>0&&C+y>this.bottom&&(k=h.x=k+t[h.line].width+c,h.line++,C=h.y=oc(o,this.top+v+c,this.bottom-t[h.line].height));if(function(e,t,n){if(isNaN(p)||p<=0||isNaN(f)||f<0)return;r.save();const o=ll(n.lineWidth,1);if(r.fillStyle=ll(n.fillStyle,a),r.lineCap=ll(n.lineCap,"butt"),r.lineDashOffset=ll(n.lineDashOffset,0),r.lineJoin=ll(n.lineJoin,"miter"),r.lineWidth=o,r.strokeStyle=ll(n.strokeStyle,a),r.setLineDash(ll(n.lineDash,[])),i.usePointStyle){const a={radius:f*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:o},l=s.xPlus(e,p/2);Nc(r,a,l,t+d,i.pointStyleWidth&&p)}else{const i=t+Math.max((u-f)/2,0),a=s.leftForLtr(e,p),l=qc(n.borderRadius);r.beginPath(),Object.values(l).some((e=>0!==e))?jc(r,{x:a,y:i,w:p,h:f,radius:l}):r.rect(a,i,p,f),r.fill(),0!==o&&r.stroke()}r.restore()}(s.x(k),C,b),k=((e,t,n,r)=>e===(r?"left":"right")?n:"center"===e?(t+n)/2:t)(w,k+p+d,g?k+S:this.right,e.rtl),function(e,t,n){Fc(r,n.text,e,t+m/2,l,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(k),C,b),g)h.x+=S+c;else if("string"!=typeof b.text){const e=l.lineHeight;h.y+=qp(b,e)+c}else h.y+=y})),zu(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,n=Zc(t.font),r=Uc(t.padding);if(!t.display)return;const o=Lu(e.rtl,this.left,this.width),i=this.ctx,a=t.position,s=n.size/2,l=r.top+s;let c,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,u=oc(e.align,u,this.right-d);else{const t=this.columnSizes.reduce(((e,t)=>Math.max(e,t.height)),0);c=l+oc(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}const h=oc(a,u,u+d);i.textAlign=o.textAlign(rc(a)),i.textBaseline="middle",i.strokeStyle=t.color,i.fillStyle=t.color,i.font=n.string,Fc(i,t.text,h,c,n)}_computeTitleHeight(){const e=this.options.title,t=Zc(e.font),n=Uc(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,o;if(Ul(e,this.left,this.right)&&Ul(t,this.top,this.bottom))for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(r=o[n],Ul(e,r.left,r.left+r.width)&&Ul(t,r.top,r.top+r.height))return this.legendItems[n];return null}handleEvent(e){const t=this.options;if(!function(e,t){if(("mousemove"===e||"mouseout"===e)&&(t.onHover||t.onLeave))return!0;if(t.onClick&&("click"===e||"mouseup"===e))return!0;return!1}(e.type,t))return;const n=this._getLegendItemAt(e.x,e.y);if("mousemove"===e.type||"mouseout"===e.type){const r=this._hoveredItem,o=((e,t)=>null!==e&&null!==t&&e.datasetIndex===t.datasetIndex&&e.index===t.index)(r,n);r&&!o&&ul(t.onLeave,[e,r,this],this),this._hoveredItem=n,n&&!o&&ul(t.onHover,[e,n,this],this)}else n&&ul(t.onClick,[e,n,this],this)}}function qp(e,t){return t*(e.text?e.text.length:0)}var Up={id:"legend",_element:Xp,start(e,t,n){const r=e.legend=new Xp({ctx:e.ctx,options:n,chart:e});Hd.configure(e,r,n),Hd.addBox(e,r)},stop(e){Hd.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Hd.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map((e=>{const l=e.controller.getStyle(n?0:void 0),c=Uc(l.borderWidth);return{text:t[e.index].label,fillStyle:l.backgroundColor,fontColor:i,hidden:!e.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:o||l.textAlign,borderRadius:a&&(s||l.borderRadius),datasetIndex:e.index}}),this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Zp extends ah{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=e,this.height=this.bottom=t;const r=ol(n.text)?n.text.length:1;this._padding=Uc(n.padding);const o=r*Zc(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return"top"===e||"bottom"===e}_drawArgs(e){const{top:t,left:n,bottom:r,right:o,options:i}=this,a=i.align;let s,l,c,u=0;return this.isHorizontal()?(l=oc(a,n,o),c=t+e,s=o-n):("left"===i.position?(l=n+e,c=oc(a,r,t),u=-.5*Cl):(l=o-e,c=oc(a,t,r),u=.5*Cl),s=r-t),{titleX:l,titleY:c,maxWidth:s,rotation:u}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const n=Zc(t.font),r=n.lineHeight/2+this._padding.top,{titleX:o,titleY:i,maxWidth:a,rotation:s}=this._drawArgs(r);Fc(e,t.text,0,0,n,{color:t.color,maxWidth:a,rotation:s,textAlign:rc(t.align),textBaseline:"middle",translation:[o,i]})}}var Gp={id:"title",_element:Zp,start(e,t,n){!function(e,t){const n=new Zp({ctx:e.ctx,options:t,chart:e});Hd.configure(e,n,t),Hd.addBox(e,n),e.titleBlock=n}(e,n)},stop(e){const t=e.titleBlock;Hd.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Hd.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Kp=new WeakMap;var Jp={id:"subtitle",start(e,t,n){const r=new Zp({ctx:e.ctx,options:n,chart:e});Hd.configure(e,r,n),Hd.addBox(e,r),Kp.set(e,r)},stop(e){Hd.removeBox(e,Kp.get(e)),Kp.delete(e)},beforeUpdate(e,t,n){const r=Kp.get(e);Hd.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qp={average(e){if(!e.length)return!1;let t,n,r=new Set,o=0,i=0;for(t=0,n=e.length;t<n;++t){const n=e[t].element;if(n&&n.hasValue()){const e=n.tooltipPosition();r.add(e.x),o+=e.y,++i}}if(0===i||0===r.size)return!1;const a=[...r].reduce(((e,t)=>e+t))/r.size;return{x:a,y:o/i}},nearest(e,t){if(!e.length)return!1;let n,r,o,i=t.x,a=t.y,s=Number.POSITIVE_INFINITY;for(n=0,r=e.length;n<r;++n){const r=e[n].element;if(r&&r.hasValue()){const e=Wl(t,r.getCenterPoint());e<s&&(s=e,o=r)}}if(o){const e=o.tooltipPosition();i=e.x,a=e.y}return{x:i,y:a}}};function ef(e,t){return t&&(ol(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function tf(e){return("string"==typeof e||e instanceof String)&&e.indexOf("\n")>-1?e.split("\n"):e}function nf(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:a,value:s}=i.getLabelAndValue(o);return{chart:e,label:a,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:s,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function rf(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:a,boxHeight:s}=t,l=Zc(t.bodyFont),c=Zc(t.titleFont),u=Zc(t.footerFont),d=i.length,h=o.length,p=r.length,f=Uc(t.padding);let m=f.height,g=0,v=r.reduce(((e,t)=>e+t.before.length+t.lines.length+t.after.length),0);if(v+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),v){m+=p*(t.displayColors?Math.max(s,l.lineHeight):l.lineHeight)+(v-p)*l.lineHeight+(v-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let y=0;const b=function(e){g=Math.max(g,n.measureText(e).width+y)};return n.save(),n.font=c.string,dl(e.title,b),n.font=l.string,dl(e.beforeBody.concat(e.afterBody),b),y=t.displayColors?a+2+t.boxPadding:0,dl(r,(e=>{dl(e.before,b),dl(e.lines,b),dl(e.after,b)})),y=0,n.font=u.string,dl(e.footer,b),n.restore(),g+=f.width,{width:g,height:m}}function of(e,t,n,r){const{x:o,width:i}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return"center"===r?c=o<=(s+l)/2?"left":"right":o<=i/2?c="left":o>=a-i/2&&(c="right"),function(e,t,n,r){const{x:o,width:i}=r,a=n.caretSize+n.caretPadding;return"left"===e&&o+i+a>t.width||"right"===e&&o-i-a<0||void 0}(c,e,t,n)&&(c="center"),c}function af(e,t,n){const r=n.yAlign||t.yAlign||function(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}(e,n);return{xAlign:n.xAlign||t.xAlign||of(e,t,n,r),yAlign:r}}function sf(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=qc(a);let f=function(e,t){let{x:n,width:r}=e;return"right"===t?n-=r:"center"===t&&(n-=r/2),n}(t,s);const m=function(e,t,n){let{y:r,height:o}=e;return"top"===t?r+=n:r-="bottom"===t?o+n:o/2,r}(t,l,c);return"center"===l?"left"===s?f+=c:"right"===s&&(f-=c):"left"===s?f-=Math.max(u,h)+o:"right"===s&&(f+=Math.max(d,p)+o),{x:ql(f,0,r.width-t.width),y:ql(m,0,r.height-t.height)}}function lf(e,t,n){const r=Uc(n.padding);return"center"===t?e.x+e.width/2:"right"===t?e.x+e.width-r.right:e.x+r.left}function cf(e){return ef([],tf(e))}function uf(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const df={beforeTitle:tl,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:tl,beforeBody:tl,beforeLabel:tl,label(e){if(this&&this.options&&"dataset"===this.options.mode)return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return rl(n)||(t+=n),t},labelColor(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const t=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:tl,afterBody:tl,beforeFooter:tl,footer:tl,afterFooter:tl};function hf(e,t,n,r){const o=e[t].call(n,r);return void 0===o?df[t].call(n,r):o}class pf extends ah{static positioners=Qp;constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,n=this.options.setContext(this.getContext()),r=n.enabled&&t.options.animation&&n.animations,o=new Zu(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=(e=this.chart.getContext(),t=this,n=this._tooltipItems,Kc(e,{tooltip:t,tooltipItems:n,type:"tooltip"})));var e,t,n}getTitle(e,t){const{callbacks:n}=t,r=hf(n,"beforeTitle",this,e),o=hf(n,"title",this,e),i=hf(n,"afterTitle",this,e);let a=[];return a=ef(a,tf(r)),a=ef(a,tf(o)),a=ef(a,tf(i)),a}getBeforeBody(e,t){return cf(hf(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:n}=t,r=[];return dl(e,(e=>{const t={before:[],lines:[],after:[]},o=uf(n,e);ef(t.before,tf(hf(o,"beforeLabel",this,e))),ef(t.lines,hf(o,"label",this,e)),ef(t.after,tf(hf(o,"afterLabel",this,e))),r.push(t)})),r}getAfterBody(e,t){return cf(hf(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:n}=t,r=hf(n,"beforeFooter",this,e),o=hf(n,"footer",this,e),i=hf(n,"afterFooter",this,e);let a=[];return a=ef(a,tf(r)),a=ef(a,tf(o)),a=ef(a,tf(i)),a}_createItems(e){const t=this._active,n=this.chart.data,r=[],o=[],i=[];let a,s,l=[];for(a=0,s=t.length;a<s;++a)l.push(nf(this.chart,t[a]));return e.filter&&(l=l.filter(((t,r,o)=>e.filter(t,r,o,n)))),e.itemSort&&(l=l.sort(((t,r)=>e.itemSort(t,r,n)))),dl(l,(t=>{const n=uf(e.callbacks,t);r.push(hf(n,"labelColor",this,t)),o.push(hf(n,"labelPointStyle",this,t)),i.push(hf(n,"labelTextColor",this,t))})),this.labelColors=r,this.labelPointStyles=o,this.labelTextColors=i,this.dataPoints=l,l}update(e,t){const n=this.options.setContext(this.getContext()),r=this._active;let o,i=[];if(r.length){const e=Qp[n.position].call(this,r,this._eventPosition);i=this._createItems(n),this.title=this.getTitle(i,n),this.beforeBody=this.getBeforeBody(i,n),this.body=this.getBody(i,n),this.afterBody=this.getAfterBody(i,n),this.footer=this.getFooter(i,n);const t=this._size=rf(this,n),a=Object.assign({},e,t),s=af(this.chart,n,a),l=sf(n,a,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,o={opacity:1,x:l.x,y:l.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}else 0!==this.opacity&&(o={opacity:0});this._tooltipItems=i,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){const o=this.getCaretPosition(e,n,r);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,n){const{xAlign:r,yAlign:o}=this,{caretSize:i,cornerRadius:a}=n,{topLeft:s,topRight:l,bottomLeft:c,bottomRight:u}=qc(a),{x:d,y:h}=e,{width:p,height:f}=t;let m,g,v,y,b,_;return"center"===o?(b=h+f/2,"left"===r?(m=d,g=m-i,y=b+i,_=b-i):(m=d+p,g=m+i,y=b-i,_=b+i),v=m):(g="left"===r?d+Math.max(s,c)+i:"right"===r?d+p-Math.max(l,u)-i:this.caretX,"top"===o?(y=h,b=y-i,m=g-i,v=g+i):(y=h+f,b=y+i,m=g+i,v=g-i),_=y),{x1:m,x2:g,x3:v,y1:y,y2:b,y3:_}}drawTitle(e,t,n){const r=this.title,o=r.length;let i,a,s;if(o){const l=Lu(n.rtl,this.x,this.width);for(e.x=lf(this,n.titleAlign,n),t.textAlign=l.textAlign(n.titleAlign),t.textBaseline="middle",i=Zc(n.titleFont),a=n.titleSpacing,t.fillStyle=n.titleColor,t.font=i.string,s=0;s<o;++s)t.fillText(r[s],l.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+a,s+1===o&&(e.y+=n.titleMarginBottom-a)}}_drawColorBox(e,t,n,r,o){const i=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:s,boxWidth:l}=o,c=Zc(o.bodyFont),u=lf(this,"left",o),d=r.x(u),h=s<c.lineHeight?(c.lineHeight-s)/2:0,p=t.y+h;if(o.usePointStyle){const t={radius:Math.min(l,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=r.leftForLtr(d,l)+l/2,c=p+s/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,Tc(e,t,n,c),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,Tc(e,t,n,c)}else{e.lineWidth=il(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,e.strokeStyle=i.borderColor,e.setLineDash(i.borderDash||[]),e.lineDashOffset=i.borderDashOffset||0;const t=r.leftForLtr(d,l),n=r.leftForLtr(r.xPlus(d,1),l-2),a=qc(i.borderRadius);Object.values(a).some((e=>0!==e))?(e.beginPath(),e.fillStyle=o.multiKeyBackground,jc(e,{x:t,y:p,w:l,h:s,radius:a}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),jc(e,{x:n,y:p+1,w:l-2,h:s-2,radius:a}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(t,p,l,s),e.strokeRect(t,p,l,s),e.fillStyle=i.backgroundColor,e.fillRect(n,p+1,l-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){const{body:r}=this,{bodySpacing:o,bodyAlign:i,displayColors:a,boxHeight:s,boxWidth:l,boxPadding:c}=n,u=Zc(n.bodyFont);let d=u.lineHeight,h=0;const p=Lu(n.rtl,this.x,this.width),f=function(n){t.fillText(n,p.x(e.x+h),e.y+d/2),e.y+=d+o},m=p.textAlign(i);let g,v,y,b,_,x,w;for(t.textAlign=i,t.textBaseline="middle",t.font=u.string,e.x=lf(this,m,n),t.fillStyle=n.bodyColor,dl(this.beforeBody,f),h=a&&"right"!==m?"center"===i?l/2+c:l+2+c:0,b=0,x=r.length;b<x;++b){for(g=r[b],v=this.labelTextColors[b],t.fillStyle=v,dl(g.before,f),y=g.lines,a&&y.length&&(this._drawColorBox(t,e,b,p,n),d=Math.max(u.lineHeight,s)),_=0,w=y.length;_<w;++_)f(y[_]),d=u.lineHeight;dl(g.after,f)}h=0,d=u.lineHeight,dl(this.afterBody,f),e.y-=o}drawFooter(e,t,n){const r=this.footer,o=r.length;let i,a;if(o){const s=Lu(n.rtl,this.x,this.width);for(e.x=lf(this,n.footerAlign,n),e.y+=n.footerMarginTop,t.textAlign=s.textAlign(n.footerAlign),t.textBaseline="middle",i=Zc(n.footerFont),t.fillStyle=n.footerColor,t.font=i.string,a=0;a<o;++a)t.fillText(r[a],s.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+n.footerSpacing}}drawBackground(e,t,n,r){const{xAlign:o,yAlign:i}=this,{x:a,y:s}=e,{width:l,height:c}=n,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:p}=qc(r.cornerRadius);t.fillStyle=r.backgroundColor,t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.beginPath(),t.moveTo(a+u,s),"top"===i&&this.drawCaret(e,t,n,r),t.lineTo(a+l-d,s),t.quadraticCurveTo(a+l,s,a+l,s+d),"center"===i&&"right"===o&&this.drawCaret(e,t,n,r),t.lineTo(a+l,s+c-p),t.quadraticCurveTo(a+l,s+c,a+l-p,s+c),"bottom"===i&&this.drawCaret(e,t,n,r),t.lineTo(a+h,s+c),t.quadraticCurveTo(a,s+c,a,s+c-h),"center"===i&&"left"===o&&this.drawCaret(e,t,n,r),t.lineTo(a,s+u),t.quadraticCurveTo(a,s,a+u,s),t.closePath(),t.fill(),r.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,n=this.$animations,r=n&&n.x,o=n&&n.y;if(r||o){const n=Qp[e.position].call(this,this._active,this._eventPosition);if(!n)return;const i=this._size=rf(this,e),a=Object.assign({},n,this._size),s=af(t,e,a),l=sf(e,a,s,t);r._to===l.x&&o._to===l.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=i.width,this.height=i.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(t);const r={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const i=Uc(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=n,this.drawBackground(o,e,r,t),Iu(e,t.textDirection),o.y+=i.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),zu(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const n=this._active,r=e.map((({datasetIndex:e,index:t})=>{const n=this.chart.getDatasetMeta(e);if(!n)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:n.data[t],index:t}})),o=!hl(n,r),i=this._positionChanged(r,t);(o||i)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,o=this._active||[],i=this._getActiveElements(e,o,t,n),a=this._positionChanged(i,e),s=t||!hl(i,o)||a;return s&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){const o=this.options;if("mouseout"===e.type)return[];if(!r)return t.filter((e=>this.chart.data.datasets[e.datasetIndex]&&void 0!==this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)));const i=this.chart.getElementsAtEventForMode(e,o.mode,o,n);return o.reverse&&i.reverse(),i}_positionChanged(e,t){const{caretX:n,caretY:r,options:o}=this,i=Qp[o.position].call(this,e,t);return!1!==i&&(n!==i.x||r!==i.y)}}var ff={id:"tooltip",_element:pf,positioners:Qp,afterInit(e,t,n){n&&(e.tooltip=new pf({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(!1===e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0}))return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:df},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>"filter"!==e&&"itemSort"!==e&&"external"!==e,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},mf=Object.freeze({__proto__:null,Colors:kp,Decimation:Mp,Filler:Vp,Legend:Up,SubTitle:Jp,Title:Gp,Tooltip:ff});function gf(e,t,n,r){const o=e.indexOf(t);if(-1===o)return((e,t,n,r)=>("string"==typeof t?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n))(e,t,n,r);return o!==e.lastIndexOf(t)?n:o}function vf(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class yf extends gh{static id="category";static defaults={ticks:{callback:vf}};constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const e=this.getLabels();for(const{index:n,label:r}of t)e[n]===r&&e.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(rl(e))return null;const n=this.getLabels();return((e,t)=>null===e?null:ql(Math.round(e),0,t))(t=isFinite(t)&&n[t]===e?t:gf(n,e,ll(t,e),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:n,max:r}=this.getMinMax(!0);"ticks"===this.options.bounds&&(e||(n=0),t||(r=this.getLabels().length-1)),this.min=n,this.max=r}buildTicks(){const e=this.min,t=this.max,n=this.options.offset,r=[];let o=this.getLabels();o=0===e&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=e;n<=t;n++)r.push({value:n});return r}getLabelForValue(e){return vf.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return"number"!=typeof e&&(e=this.parse(e)),null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}function bf(e,t){const n=[],{bounds:r,step:o,min:i,max:a,precision:s,count:l,maxTicks:c,maxDigits:u,includeBounds:d}=e,h=o||1,p=c-1,{min:f,max:m}=t,g=!rl(i),v=!rl(a),y=!rl(l),b=(m-f)/(u+1);let _,x,w,S,k=zl((m-f)/p/h)*h;if(k<1e-14&&!g&&!v)return[{value:f},{value:m}];S=Math.ceil(m/k)-Math.floor(f/k),S>p&&(k=zl(S*k/p/h)*h),rl(s)||(_=Math.pow(10,s),k=Math.ceil(k*_)/_),"ticks"===r?(x=Math.floor(f/k)*k,w=Math.ceil(m/k)*k):(x=f,w=m),g&&v&&o&&function(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}((a-i)/o,k/1e3)?(S=Math.round(Math.min((a-i)/k,c)),k=(a-i)/S,x=i,w=a):y?(x=g?i:x,w=v?a:w,S=l-1,k=(w-x)/S):(S=(w-x)/k,S=Il(S,Math.round(S),k/1e3)?Math.round(S):Math.ceil(S));const C=Math.max(Bl(k),Bl(x));_=Math.pow(10,rl(s)?C:s),x=Math.round(x*_)/_,w=Math.round(w*_)/_;let E=0;for(g&&(d&&x!==i?(n.push({value:i}),x<i&&E++,Il(Math.round((x+E*k)*_)/_,i,_f(i,b,e))&&E++):x<i&&E++);E<S;++E){const e=Math.round((x+E*k)*_)/_;if(v&&e>a)break;n.push({value:e})}return v&&d&&w!==a?n.length&&Il(n[n.length-1].value,a,_f(a,b,e))?n[n.length-1].value=a:n.push({value:a}):v&&w!==a||n.push({value:w}),n}function _f(e,t,{horizontal:n,minRotation:r}){const o=Fl(r),i=(n?Math.sin(o):Math.cos(o))||.001,a=.75*t*(""+e).length;return Math.min(t/i,a)}class xf extends gh{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return rl(e)||("number"==typeof e||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this;const i=e=>r=t?r:e,a=e=>o=n?o:e;if(e){const e=Ll(r),t=Ll(o);e<0&&t<0?a(0):e>0&&t>0&&i(0)}if(r===o){let t=0===o?1:Math.abs(.05*o);a(o+t),e||i(r-t)}this.min=r,this.max=o}getTickLimit(){const e=this.options.ticks;let t,{maxTicksLimit:n,stepSize:r}=e;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(),n=n||11),n&&(t=Math.min(n,t)),t}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let n=this.getTickLimit();n=Math.max(2,n);const r=bf({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:!1!==t.includeBounds},this._range||this);return"ticks"===e.bounds&&$l(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){const r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return vc(e,this.chart.options.locale,this.options.ticks.format)}}class wf extends xf{static id="linear";static defaults={ticks:{callback:bc.formatters.numeric}};determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=al(e)?e:0,this.max=al(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,n=Fl(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/r))}getPixelForValue(e){return null===e?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}const Sf=e=>Math.floor(Al(e)),kf=(e,t)=>Math.pow(10,Sf(e)+t);function Cf(e){return 1===e/Math.pow(10,Sf(e))}function Ef(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function Mf(e,{min:t,max:n}){t=sl(e.min,t);const r=[],o=Sf(t);let i=function(e,t){let n=Sf(t-e);for(;Ef(e,t,n)>10;)n++;for(;Ef(e,t,n)<10;)n--;return Math.min(n,Sf(e))}(t,n),a=i<0?Math.pow(10,Math.abs(i)):1;const s=Math.pow(10,i),l=o>i?Math.pow(10,o):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/s/10)*s*10;let d=Math.floor((c-u)/Math.pow(10,i)),h=sl(e.min,Math.round((l+u+d*Math.pow(10,i))*a)/a);for(;h<n;)r.push({value:h,major:Cf(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,a=i>=0?1:a),h=Math.round((l+u+d*Math.pow(10,i))*a)/a;const p=sl(e.max,h);return r.push({value:p,major:Cf(p),significand:d}),r}class Pf extends gh{static id="logarithmic";static defaults={ticks:{callback:bc.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const n=xf.prototype.parse.apply(this,[e,t]);if(0!==n)return al(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=al(e)?Math.max(0,e):null,this.max=al(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!al(this._userMin)&&(this.min=e===kf(this.min,0)?kf(this.min,-1):kf(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let n=this.min,r=this.max;const o=t=>n=e?n:t,i=e=>r=t?r:e;n===r&&(n<=0?(o(1),i(10)):(o(kf(n,-1)),i(kf(r,1)))),n<=0&&o(kf(r,-1)),r<=0&&i(kf(n,1)),this.min=n,this.max=r}buildTicks(){const e=this.options,t=Mf({min:this._userMin,max:this._userMax},this);return"ticks"===e.bounds&&$l(t,this,"value"),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return void 0===e?"0":vc(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Al(e),this._valueRange=Al(this.max)-Al(e)}getPixelForValue(e){return void 0!==e&&0!==e||(e=this.min),null===e||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Al(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}function Of(e){const t=e.ticks;if(t.display&&e.display){const e=Uc(t.backdropPadding);return ll(t.font&&t.font.size,Cc.font.size)+e.height}return 0}function Tf(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function Nf(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],i=e._pointLabels.length,a=e.options.pointLabels,s=a.centerPointLabels?Cl/i:0;for(let d=0;d<i;d++){const i=a.setContext(e.getPointLabelContext(d));o[d]=i.padding;const h=e.getPointPosition(d,e.drawingArea+o[d],s),p=Zc(i.font),f=(l=e.ctx,c=p,u=ol(u=e._pointLabels[d])?u:[u],{w:Mc(l,c.string,u),h:u.length*c.lineHeight});r[d]=f;const m=Yl(e.getIndexAngle(d)+s),g=Math.round(jl(m));Df(n,t,m,Tf(g,h.x,f.w,0,180),Tf(g,h.y,f.h,90,270))}var l,c,u;e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=function(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:a,display:s}=i.pointLabels,l={extra:Of(i)/2,additionalAngle:a?Cl/o:0};let c;for(let i=0;i<o;i++){l.padding=n[i],l.size=t[i];const o=Af(e,i,l);r.push(o),"auto"===s&&(o.visible=Lf(o,c),o.visible&&(c=o))}return r}(e,r,o)}function Df(e,t,n,r,o){const i=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let s=0,l=0;r.start<t.l?(s=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-s)):r.end>t.r&&(s=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+s)),o.start<t.t?(l=(t.t-o.start)/a,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/a,e.b=Math.max(e.b,t.b+l))}function Af(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:a,size:s}=n,l=e.getPointPosition(t,r+o+a,i),c=Math.round(jl(Yl(l.angle+Tl))),u=function(e,t,n){90===n||270===n?e-=t/2:(n>270||n<90)&&(e-=t);return e}(l.y,s.h,c),d=function(e){if(0===e||180===e)return"center";if(e<180)return"left";return"right"}(c),h=function(e,t,n){"right"===n?e-=t:"center"===n&&(e-=t/2);return e}(l.x,s.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+s.w,bottom:u+s.h}}function Lf(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Dc({x:n,y:r},t)||Dc({x:n,y:i},t)||Dc({x:o,y:r},t)||Dc({x:o,y:i},t))}function If(e,t,n){const{left:r,top:o,right:i,bottom:a}=n,{backdropColor:s}=t;if(!rl(s)){const n=qc(t.borderRadius),l=Uc(t.backdropPadding);e.fillStyle=s;const c=r-l.left,u=o-l.top,d=i-r+l.width,h=a-o+l.height;Object.values(n).some((e=>0!==e))?(e.beginPath(),jc(e,{x:c,y:u,w:d,h:h,radius:n}),e.fill()):e.fillRect(c,u,d,h)}}function zf(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,El);else{let n=e.getPointPosition(0,t);o.moveTo(n.x,n.y);for(let i=1;i<r;i++)n=e.getPointPosition(i,t),o.lineTo(n.x,n.y)}}class Rf extends xf{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:bc.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:e=>e,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Uc(Of(this.options)/2),t=this.width=this.maxWidth-e.width,n=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+n/2+e.top),this.drawingArea=Math.floor(Math.min(t,n)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=al(e)&&!isNaN(e)?e:0,this.max=al(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Of(this.options))}generateTickLabels(e){xf.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map(((e,t)=>{const n=ul(this.options.pointLabels.callback,[e,t],this);return n||0===n?n:""})).filter(((e,t)=>this.chart.getDataVisibility(t)))}fit(){const e=this.options;e.display&&e.pointLabels.display?Nf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){return Yl(e*(El/(this._pointLabels.length||1))+Fl(this.options.startAngle||0))}getDistanceFromCenterForValue(e){if(rl(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(rl(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const n=t[e];return function(e,t,n){return Kc(e,{label:n,index:t,type:"pointLabel"})}(this.getContext(),e,n)}}getPointPosition(e,t,n=0){const r=this.getIndexAngle(e)-Tl+n;return{x:Math.cos(r)*t+this.xCenter,y:Math.sin(r)*t+this.yCenter,angle:r}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:n,right:r,bottom:o}=this._pointLabelItems[e];return{left:t,top:n,right:r,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const n=this.ctx;n.save(),n.beginPath(),zf(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),n.closePath(),n.fillStyle=e,n.fill(),n.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:n,grid:r,border:o}=t,i=this._pointLabels.length;let a,s,l;if(t.pointLabels.display&&function(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const t=e._pointLabelItems[o];if(!t.visible)continue;const i=r.setContext(e.getPointLabelContext(o));If(n,i,t);const a=Zc(i.font),{x:s,y:l,textAlign:c}=t;Fc(n,e._pointLabels[o],s,l+a.lineHeight/2,a,{color:i.color,textAlign:c,textBaseline:"middle"})}}(this,i),r.display&&this.ticks.forEach(((e,t)=>{if(0!==t||0===t&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);const n=this.getContext(t),a=r.setContext(n),l=o.setContext(n);!function(e,t,n,r,o){const i=e.ctx,a=t.circular,{color:s,lineWidth:l}=t;!a&&!r||!s||!l||n<0||(i.save(),i.strokeStyle=s,i.lineWidth=l,i.setLineDash(o.dash||[]),i.lineDashOffset=o.dashOffset,i.beginPath(),zf(e,n,a,r),i.closePath(),i.stroke(),i.restore())}(this,a,s,i,l)}})),n.display){for(e.save(),a=i-1;a>=0;a--){const r=n.setContext(this.getPointLabelContext(a)),{color:o,lineWidth:i}=r;i&&o&&(e.lineWidth=i,e.strokeStyle=o,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),l=this.getPointPosition(a,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;const r=this.getIndexAngle(0);let o,i;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach(((r,a)=>{if(0===a&&this.min>=0&&!t.reverse)return;const s=n.setContext(this.getContext(a)),l=Zc(s.font);if(o=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){e.font=l.string,i=e.measureText(r.label).width,e.fillStyle=s.backdropColor;const t=Uc(s.backdropPadding);e.fillRect(-i/2-t.left,-o-l.size/2-t.top,i+t.width,l.size+t.height)}Fc(e,r.label,0,-o,l,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})})),e.restore()}drawTitle(){}}const $f={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}},Ff=Object.keys($f);function jf(e,t){return e-t}function Bf(e,t){if(rl(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let a=t;return"function"==typeof r&&(a=r(a)),al(a)||(a="string"==typeof r?n.parse(a,r):n.parse(a)),null===a?null:(o&&(a="week"!==o||!Rl(i)&&!0!==i?n.startOf(a,o):n.startOf(a,"isoWeek",i)),+a)}function Hf(e,t,n,r){const o=Ff.length;for(let i=Ff.indexOf(e);i<o-1;++i){const e=$f[Ff[i]],o=e.steps?e.steps:Number.MAX_SAFE_INTEGER;if(e.common&&Math.ceil((n-t)/(o*e.size))<=r)return Ff[i]}return Ff[o-1]}function Wf(e,t,n){if(n){if(n.length){const{lo:r,hi:o}=Zl(n,t);e[n[r]>=t?n[r]:n[o]]=!0}}else e[t]=!0}function Vf(e,t,n){const r=[],o={},i=t.length;let a,s;for(a=0;a<i;++a)s=t[a],o[s]=a,r.push({value:s,major:!1});return 0!==i&&n?function(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=i;s<=a;s=+o.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}(e,r,o,n):r}class Yf extends gh{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const n=e.time||(e.time={}),r=this._adapter=new wd._date(e.adapters.date);r.init(t),vl(n.displayFormats,r.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return void 0===e?null:Bf(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,n=e.time.unit||"day";let{min:r,max:o,minDefined:i,maxDefined:a}=this.getUserBounds();function s(e){i||isNaN(e.min)||(r=Math.min(r,e.min)),a||isNaN(e.max)||(o=Math.max(o,e.max))}i&&a||(s(this._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||s(this.getMinMax(!1))),r=al(r)&&!isNaN(r)?r:+t.startOf(Date.now(),n),o=al(o)&&!isNaN(o)?o:+t.endOf(Date.now(),n)+1,this.min=Math.min(r,o-1),this.max=Math.max(r+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],n=e[e.length-1]),{min:t,max:n}}buildTicks(){const e=this.options,t=e.time,n=e.ticks,r="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===e.bounds&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const o=this.min,i=function(e,t,n){let r=0,o=e.length;for(;r<o&&e[r]<t;)r++;for(;o>r&&e[o-1]>n;)o--;return r>0||o<e.length?e.slice(r,o):e}(r,o,this.max);return this._unit=t.unit||(n.autoSkip?Hf(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(e,t,n,r,o){for(let i=Ff.length-1;i>=Ff.indexOf(n);i--){const n=Ff[i];if($f[n].common&&e._adapter.diff(o,r,n)>=t-1)return n}return Ff[n?Ff.indexOf(n):0]}(this,i.length,t.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(e){for(let t=Ff.indexOf(e)+1,n=Ff.length;t<n;++t)if($f[Ff[t]].common)return Ff[t]}(this._unit):void 0,this.initOffsets(r),e.reverse&&i.reverse(),Vf(this,i,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((e=>+e.value)))}initOffsets(e=[]){let t,n,r=0,o=0;this.options.offset&&e.length&&(t=this.getDecimalForValue(e[0]),r=1===e.length?1-t:(this.getDecimalForValue(e[1])-t)/2,n=this.getDecimalForValue(e[e.length-1]),o=1===e.length?n:(n-this.getDecimalForValue(e[e.length-2]))/2);const i=e.length<3?.5:.25;r=ql(r,0,i),o=ql(o,0,i),this._offsets={start:r,end:o,factor:1/(r+1+o)}}_generate(){const e=this._adapter,t=this.min,n=this.max,r=this.options,o=r.time,i=o.unit||Hf(o.minUnit,t,n,this._getLabelCapacity(t)),a=ll(r.ticks.stepSize,1),s="week"===i&&o.isoWeekday,l=Rl(s)||!0===s,c={};let u,d,h=t;if(l&&(h=+e.startOf(h,"isoWeek",s)),h=+e.startOf(h,l?"day":i),e.diff(n,t,i)>1e5*a)throw new Error(t+" and "+n+" are too far apart with stepSize of "+a+" "+i);const p="data"===r.ticks.source&&this.getDataTimestamps();for(u=h,d=0;u<n;u=+e.add(u,a,i),d++)Wf(c,u,p);return u!==n&&"ticks"!==r.bounds&&1!==d||Wf(c,u,p),Object.keys(c).sort(jf).map((e=>+e))}getLabelForValue(e){const t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){const n=this.options.time.displayFormats,r=this._unit,o=t||n[r];return this._adapter.format(e,o)}_tickFormatFunction(e,t,n,r){const o=this.options,i=o.ticks.callback;if(i)return ul(i,[e,t,n],this);const a=o.time.displayFormats,s=this._unit,l=this._majorUnit,c=s&&a[s],u=l&&a[l],d=n[t],h=l&&u&&d&&d.major;return this._adapter.format(e,r||(h?u:c))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t<n;++t)r=e[t],r.label=this._tickFormatFunction(r.value,t,e)}getDecimalForValue(e){return null===e?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,n=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+n)*t.factor)}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+n*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,n=this.ctx.measureText(e).width,r=Fl(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(r),i=Math.sin(r),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*i,h:n*i+a*o}}_getLabelCapacity(e){const t=this.options.time,n=t.displayFormats,r=n[t.unit]||n.millisecond,o=this._tickFormatFunction(e,0,Vf(this,[e],this._majorUnit),r),i=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return a>0?a:1}getDataTimestamps(){let e,t,n=this._cache.data||[];if(n.length)return n;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,t=r.length;e<t;++e)n=n.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const e=this._cache.labels||[];let t,n;if(e.length)return e;const r=this.getLabels();for(t=0,n=r.length;t<n;++t)e.push(Bf(this,r[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return ec(e.sort(jf))}}function Xf(e,t,n){let r,o,i,a,s=0,l=e.length-1;n?(t>=e[s].pos&&t<=e[l].pos&&({lo:s,hi:l}=Gl(e,"pos",t)),({pos:r,time:i}=e[s]),({pos:o,time:a}=e[l])):(t>=e[s].time&&t<=e[l].time&&({lo:s,hi:l}=Gl(e,"time",t)),({time:r,pos:i}=e[s]),({time:o,pos:a}=e[l]));const c=o-r;return c?i+(a-i)*(t-r)/c:i}var qf=Object.freeze({__proto__:null,CategoryScale:yf,LinearScale:wf,LogarithmicScale:Pf,RadialLinearScale:Rf,TimeScale:Yf,TimeSeriesScale:class extends Yf{static id="timeseries";static defaults=Yf.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=Xf(t,this.min),this._tableRange=Xf(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:n}=this,r=[],o=[];let i,a,s,l,c;for(i=0,a=e.length;i<a;++i)l=e[i],l>=t&&l<=n&&r.push(l);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(i=0,a=r.length;i<a;++i)c=r[i+1],s=r[i-1],l=r[i],Math.round((c+s)/2)!==l&&o.push({time:l,pos:i/(a-1)});return o}_generate(){const e=this.min,t=this.max;let n=super.getDataTimestamps();return n.includes(e)&&n.length||n.splice(0,0,e),n.includes(t)&&1!==n.length||n.push(t),n.sort(((e,t)=>e-t))}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(Xf(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return Xf(this._table,n*this._tableRange+this._minPos,!0)}}});const Uf=[bd,vp,mf,qf];Uh.register(...Uf);const Zf=({type:t,data:n,options:r,className:o,style:i,plugins:a})=>{const c=s(null),u=s(null);return l((()=>{if(!c.current)return;const e=c.current.getContext("2d");return e?(u.current&&u.current.destroy(),u.current=new Uh(e,{type:t,data:n,options:r||{},plugins:a||[]}),()=>{u.current&&(u.current.destroy(),u.current=null)}):void 0}),[t,n,r,a]),e("canvas",{ref:c,className:o,style:i})};var Gf="Checkbox-module_container__v4ouY",Kf="Checkbox-module_disabled__PAavY",Jf="Checkbox-module_checkbox__tiPi8",Qf="Checkbox-module_indeterminate__GxPm3";var em=a((({checked:n=!1,disabled:r=!1,label:o,indeterminate:i=!1,labelProps:a,onChange:c,id:u,checkBoxClassName:d,...h})=>{const p=s(null),m=s(null),g=f();l((()=>{p.current&&(p.current.indeterminate=i)}),[i]),l((()=>{if(!n||i)return;const e=m.current;if(!e)return;e.style.transform="translateZ(0)";const t=requestAnimationFrame((()=>{e.style.transform=""}));return()=>{cancelAnimationFrame(t),e&&(e.style.transform="")}}),[n,i]);return e(H,{...h,onClick:e=>{r||c?.(e)},dimensionY:36,className:`${h.className} ${Gf} ${r&&Kf}`,prefix:{children:t("div",{className:`${Jf} ${i&&Qf} ${d}`,children:[e("input",{id:u??g,ref:p,type:"checkbox",checked:n,disabled:r,"aria-checked":i?"mixed":n,readOnly:!0}),e("label",{ref:m,htmlFor:u??g,onClick:e=>e.stopPropagation()})]}),...h.prefix},root:{children:e(V,{...a,children:o}),...h.root}})})),tm={chip:"Chip-module_chip__DLgqh",outlined:"Chip-module_outlined__1seXI",filled:"Chip-module_filled__iKdFt",noButton:"Chip-module_noButton__nEh--",closeButton:"Chip-module_closeButton__83TVb"};var nm=a((({label:t,variant:n="filled",icon:r,onDelete:o,suffixIcon:i,suffixOnClick:a,...s})=>e(H,{dimensionX:"hug",gap:8,prefix:{dimensionX:"hug",children:r?e(Ga,{name:r}):void 0,...s.prefix},root:{children:t,...s.root},suffix:(i||o)&&{dimensionX:"hug",alignment:"center",children:e(xs,{className:tm.closeButton,shape:"circle",color:"transparent",onClick:i?a:o,children:e(Ga,{name:i||"close"})}),...s.suffix},...s,className:`${s.className} ${tm.chip} ${tm[n]} ${o||i?"":tm.noButton}`}))),rm="Color-module_color__icl6l";var om=a((({value:t="#000000",prefixProps:n,rootProps:r,onChange:o,...i})=>e(H,{dimensionY:36,prefix:{children:e("input",{type:"color",value:t,onChange:e=>{o?.(e.target.value)}}),...n},root:{children:t&&e(V,{children:t}),...r},...i,className:`${i?.className} ${rm}`})));const im=(e,t,n)=>Math.min(Math.max(e,t),n),am=(e,t=0)=>{const n=Math.pow(10,t);return Math.round(e*n)/n},sm=(e,t,n)=>{e/=255,t/=255,n/=255;const r=Math.max(e,t,n),o=Math.min(e,t,n),i=r-o,a=r+o,s=a/2;if(0===i)return{h:0,s:0,l:am(100*s,1)};const l=s>.5?i/(2-a):i/a;let c;switch(r){case e:c=(t-n)/i+(t<n?6:0);break;case t:c=(n-e)/i+2;break;case n:c=(e-t)/i+4;break;default:c=0}return{h:am(60*c,1),s:am(100*l,1),l:am(100*s,1)}},lm=(e,t,n)=>{if(e/=360,n/=100,0===(t/=100)){const e=Math.round(255*n);return{r:e,g:e,b:e}}const r=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),o=n<.5?n*(1+t):n+t-n*t,i=2*n-o;return{r:Math.round(255*r(i,o,e+1/3)),g:Math.round(255*r(i,o,e)),b:Math.round(255*r(i,o,e-1/3))}},cm=(e,t,n)=>{e/=360;const r=(n/=100)*(t/=100),o=r*(1-Math.abs(6*e%2-1)),i=n-r;let a,s,l;return[a,s,l]=e<1/6?[r,o,0]:e<2/6?[o,r,0]:e<.5?[0,r,o]:e<4/6?[0,o,r]:e<5/6?[o,0,r]:[r,0,o],{r:Math.round(255*(a+i)),g:Math.round(255*(s+i)),b:Math.round(255*(l+i))}},um=({r:e,g:t,b:n,a:r})=>{const o=e=>{const t=Math.round(im(e,0,255)).toString(16);return 1===t.length?"0"+t:t},i=`#${o(e)}${o(t)}${o(n)}`.toUpperCase();if(r<1){return`${i}${o(255*r)}`}return i},dm=e=>{if(3===(e=e.replace("#","")).length&&(e=e.split("").map((e=>e+e)).join("")),6===e.length){return{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}}if(8===e.length){return{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:parseInt(e.substr(6,2),16)/255}}return null},hm=e=>{const t=e.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);return t?{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3]),a:t[4]?parseFloat(t[4]):1}:null},pm=e=>{const t=e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+))?\s*\)/);return t?{h:parseFloat(t[1]),s:parseFloat(t[2]),l:parseFloat(t[3]),a:t[4]?parseFloat(t[4]):1}:null},fm=e=>{const t=e.trim().toLowerCase();if(t.startsWith("#")){const e=dm(t);if(e){const t=sm(e.r,e.g,e.b);return{hex:um(e),rgb:e,hsl:{...t,a:e.a}}}}if(t.startsWith("rgb")){const e=hm(t);if(e){const t=sm(e.r,e.g,e.b);return{hex:um(e),rgb:e,hsl:{...t,a:e.a}}}}if(t.startsWith("hsl")){const e=pm(t);if(e){const t=lm(e.h,e.s,e.l);return{hex:um({...t,a:e.a}),rgb:{...t,a:e.a},hsl:e}}}return{hex:"#1677FF",rgb:{r:22,g:119,b:255,a:1},hsl:{h:220,s:100,l:54,a:1}}},mm=e=>{const t=((e,t,n)=>{e/=255,t/=255,n/=255;const r=Math.max(e,t,n),o=r-Math.min(e,t,n),i=r,a=0===r?0:o/r;let s;if(0===o)s=0;else{switch(r){case e:s=(t-n)/o+(t<n?6:0);break;case t:s=(n-e)/o+2;break;case n:s=(e-t)/o+4;break;default:s=0}s/=6}return{h:am(360*s,1),s:am(100*a,1),v:am(100*i,1)}})(e.rgb.r,e.rgb.g,e.rgb.b);return{...t,a:e.rgb.a}},gm=e=>{const t=cm(e.h,e.s,e.v),n=sm(t.r,t.g,t.b);return{hex:um({...t,a:e.a}),rgb:{...t,a:e.a},hsl:{...n,a:e.a}}},vm=(e={})=>{const{onDragStart:t,onDrag:n,onDragEnd:r,onKeyDown:o,preventSelection:i=!0}=e,[a,d]=u({isDragging:!1,startX:0,startY:0,currentX:0,currentY:0}),h=s(null),p=s({left:0,top:0,width:0,height:0}),f=s(void 0),m=s(0),g=c((()=>{if(h.current){const e=h.current.getBoundingClientRect();p.current={left:e.left,top:e.top,width:e.width,height:e.height}}}),[]),v=c((e=>{if("touches"in e){const t=e.touches[0]||e.changedTouches[0];return{x:t.clientX,y:t.clientY}}return{x:e.clientX,y:e.clientY}}),[]),y=c(((e,t)=>{const n=p.current,r=(e-n.left)/n.width,o=(t-n.top)/n.height;return{x:Math.max(0,Math.min(1,r)),y:Math.max(0,Math.min(1,o))}}),[]),b=c(((e,t)=>{const r=performance.now();f.current&&cancelAnimationFrame(f.current),f.current=requestAnimationFrame((()=>{if(r-m.current>=16){const{x:o,y:i}=y(e,t);n?.(o,i,p.current),m.current=r}}))}),[y,n]),_=c((e=>{e.preventDefault(),g();const{x:n,y:r}=v(e);d({isDragging:!0,startX:n,startY:r,currentX:n,currentY:r}),t?.(e),b(n,r),i&&(document.body.style.userSelect="none",document.body.style.webkitUserSelect="none")}),[v,b,t,i,g]),x=c((e=>{if(!a.isDragging)return;e.preventDefault();const{x:t,y:n}=v(e);d((e=>({...e,currentX:t,currentY:n}))),b(t,n)}),[a.isDragging,v,b]),w=c((()=>{a.isDragging&&(d((e=>({...e,isDragging:!1}))),r?.(),i&&(document.body.style.userSelect="",document.body.style.webkitUserSelect=""),f.current&&cancelAnimationFrame(f.current))}),[a.isDragging,r,i]),S=c((e=>{e.preventDefault(),g();const{x:n,y:r}=v(e);d({isDragging:!0,startX:n,startY:r,currentX:n,currentY:r}),t?.(e),b(n,r)}),[v,b,t,g]),k=c((e=>{if(!a.isDragging)return;e.preventDefault();const{x:t,y:n}=v(e);d((e=>({...e,currentX:t,currentY:n}))),b(t,n)}),[a.isDragging,v,b]),C=c((()=>{a.isDragging&&(d((e=>({...e,isDragging:!1}))),r?.(),f.current&&cancelAnimationFrame(f.current))}),[a.isDragging,r]),E=c((e=>{o?.(e)}),[o]),M=c((()=>{g()}),[g]);return l((()=>{const e=h.current;if(e)return e.addEventListener("mousedown",_),e.addEventListener("touchstart",S,{passive:!1}),e.addEventListener("keydown",E),()=>{e.removeEventListener("mousedown",_),e.removeEventListener("touchstart",S),e.removeEventListener("keydown",E)}}),[_,S,E]),l((()=>{if(a.isDragging)return document.addEventListener("mousemove",x),document.addEventListener("mouseup",w),document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("touchend",C),()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",w),document.removeEventListener("touchmove",k),document.removeEventListener("touchend",C)}}),[a.isDragging,x,w,k,C]),l((()=>(window.addEventListener("resize",M),()=>window.removeEventListener("resize",M))),[M]),l((()=>()=>{f.current&&cancelAnimationFrame(f.current)}),[]),{elementRef:h,dragState:a,updateBounds:g}};var ym="ColorPicker-module_trigger__5Ukgm",bm="ColorPicker-module_triggerLabel__1qiCq",_m="ColorPicker-module_swatch__t-pF4",xm="ColorPicker-module_swatchColor__A-5J8",wm="ColorPicker-module_svPanel__Cr8Xb",Sm="ColorPicker-module_svBackground__VgABR",km="ColorPicker-module_svHandle__gPxoY",Cm="ColorPicker-module_slidersContainer__etZz6",Em="ColorPicker-module_sliders__Xpo3f",Mm="ColorPicker-module_slider__HmNSH",Pm="ColorPicker-module_hueSlider__smchE",Om="ColorPicker-module_alphaSlider__7bImL",Tm="ColorPicker-module_alphaGradient__pIdQ6",Nm="ColorPicker-module_sliderHandle__S-ghs",Dm="ColorPicker-module_formatSelect__5tLPh",Am="ColorPicker-module_colorInput__6ajlG",Lm="ColorPicker-module_error__tj3WS",Im="ColorPicker-module_alphaInputContainer__-RszK",zm="ColorPicker-module_alphaInput__IcWZ-",Rm="ColorPicker-module_preview__2wBPl",$m="ColorPicker-module_previewColor__7da0X",Fm="Select-module_container__txDHr",jm="Select-module_disabled__RJ71M",Bm="Select-module_displayer__gzmxI",Hm="Select-module_selectDropdown__HBmga",Wm="Portal-module_container__QcS9f";const Vm=m(null);function Ym(){let e=0;const t=[],n=e=>{if(!e.target)return;const n=e.target;for(let r=t.length-1;r>=0;r--){const o=t[r];if(o.refs.some((e=>e.current?.contains(n))))return;return void o.onClickOutside(e)}};return{register(e){t.push(e)},unregister(e){const n=t.findIndex((t=>t.id===e));-1!==n&&t.splice(n,1)},nextId:()=>++e,attach(){document.addEventListener("mousedown",n)},detach(){document.removeEventListener("mousedown",n)}}}let Xm=null;const qm=({children:t})=>{const n=s(null);n.current||(n.current=Ym());const r=n.current;l((()=>(r.attach(),()=>r.detach())),[r]);const o={register:r.register,unregister:r.unregister,nextId:r.nextId};return e(Vm.Provider,{value:o,children:t})};function Um(){const e=p(Vm);return e||(Xm||(Xm=Ym(),Xm.attach()),Xm)}function Zm(e,t,n=!0){const r=Um(),o=s(null),i=s(t);i.current=t;const a=c((e=>{i.current?.(e)}),[]);l((()=>{if(!n||!t)return void(null!==o.current&&(r.unregister(o.current),o.current=null));const i=r.nextId();return o.current=i,r.register({id:i,refs:e,onClickOutside:a}),()=>{r.unregister(i),o.current=null}}),[n,r,a,...e])}const Gm=({children:t,className:n,onClickOutside:r,additionalRefs:o=[]})=>{const i=s(null);return Zm(o,r,!!r),l((()=>{const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}}),[]),M.createPortal(e("div",{ref:i,className:`${Wm} ${n||""}`,children:t}),document.body)};var Km="SelectOption-module_option__wQb8V",Jm="SelectOption-module_disabled__m5fGS",Qm="SelectOption-module_selected__A6Rky",eg="SelectOption-module_displayer__lEn8X";var tg=a((({option:t,selected:n,multiple:r,disabled:o,onSelect:i,onClick:a,...s})=>{const{value:l,label:c}="object"==typeof t?{value:t.value,label:t.label}:{value:t,label:t};return e(H,{dimensionX:"fill",dimensionY:36,alignment:"leftCenter",onClick:a,root:{children:e(em,{disabled:o,dimensionX:"fill",checked:n,label:c,alignment:"leftCenter",prefix:r?void 0:{children:null},root:{className:`${s.root?.className} ${eg}`},labelProps:{className:eg}}),dimensionX:"fill"},...s,className:`${Km} ${n&&Qm} ${o&&Jm} ${s.className||""}`})}));var ng=a((({value:r,options:o,placeholder:i="Select an option",placement:a="bottom",multiple:c=!1,disabled:h=!1,maxCount:p,popupClassName:f="",optionProps:m,selectRef:v,disableClick:y,onChange:b,externalDropdownRef:_,...x})=>{const[w,S]=u(!1),[k,C]=u(r||(c?[]:null));l((()=>{(r||0===r||""===r)&&C(r)}),[r]);const E=s(null),M=s(null);g(_??{current:null},(()=>M.current));const{targetPosition:P,calculatePosition:O}=ee({containerRef:E,targetRef:M,initialPlacement:a});d((()=>{w&&E.current&&M.current&&O()}),[w,o,O]);g(v,(()=>({toggleDropdown:N,clear:T})));const T=()=>{C([]),b?.([]),S(!1)},N=e=>{S(void 0===e?e=>!e:e)},D=e=>"object"!=typeof o[0]?String(e):L(e),A=e=>e.length?"object"==typeof o[0]?e.map((e=>L(e))).join(", "):e.join(", "):i,L=e=>o.find((t=>t.value===e))?.label;return t(n,{children:[e(H,{ref:E,onClick:()=>{h||y||N()},dimensionX:"fill",dimensionY:36,...x,root:{children:e(V,{style:x.root?.style,className:`${x.root?.className} ${Bm}`,children:k?c?A(k):D(k):i}),dimensionX:"fill",alignment:"leftCenter"},suffix:{children:e(Ga,{name:"chevronDown"})},className:`${x.className} ${Fm} ${h&&jm}`}),w&&e(Gm,{onClickOutside:()=>{y||S(!1)},additionalRefs:[E,M],children:e(B,{ref:M,style:{...P},className:`${f} ${Hm}`,direction:"vertical",alignment:"leftTop",gap:0,children:o.map((t=>{const n="object"==typeof t?t.value:t,r=c?Array.isArray(k)&&k.includes(n):k===n,o=c&&!!p&&Array.isArray(k)&&k.length>=p&&!r;return e(tg,{disabled:o,dimensionX:E.current?.offsetWidth,multiple:c,option:t,selected:r,onClick:()=>(e=>{c?(()=>{if(!Array.isArray(k))return;const t=k.includes(e)?k.filter((t=>t!==e)):[...k,e];C(t),b?.(t)})():(C(e),b?.(e),S(!1))})(n),...m},n.toString())}))})})]})}));const rg=(e,t)=>{switch(t){case"hex":default:return e.hex;case"rgb":return((e,t,n,r)=>1===r?`rgb(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)})`:`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${am(r,2)})`)(e.rgb.r,e.rgb.g,e.rgb.b,e.rgb.a);case"hsl":return((e,t,n,r)=>1===r?`hsl(${Math.round(e)}, ${Math.round(t)}%, ${Math.round(n)}%)`:`hsla(${Math.round(e)}, ${Math.round(t)}%, ${Math.round(n)}%, ${am(r,2)})`)(e.hsl.h,e.hsl.s,e.hsl.l,e.hsl.a)}},og=({value:n,defaultValue:r="#1677FF",onChange:o,format:a="hex",placement:d="bottomStart",disabled:h=!1,id:p,triggerDisplay:f="complete",containerProps:m,contentProps:g,...v})=>{const[y,b]=u(!1),[_,x]=u(a),[w,S]=u(""),[k,C]=u(!1),[E,M]=u("100"),P=i((()=>fm(n??r)),[n,r]),[O,T]=u(P),[N,D]=u((()=>mm(P))),A=s(null),L=s(null),I=s(null),z=s(null);l((()=>{if(void 0!==n){const e=fm(n);T(e),D(mm(e))}}),[n]),l((()=>{S(rg(O,_)),M(Math.round(100*O.rgb.a).toString())}),[O,_]);const R=c((e=>{T(e),D(mm(e)),o?.(e)}),[o]),$=vm({onDrag:(e,t)=>{const n={...N,s:100*e,v:100*(1-t)};D(n),R(gm(n))},onKeyDown:e=>{const t=e.shiftKey?10:1;let n=N.s,r=N.v;switch(e.key){case"ArrowLeft":e.preventDefault(),n=im(N.s-t,0,100);break;case"ArrowRight":e.preventDefault(),n=im(N.s+t,0,100);break;case"ArrowUp":e.preventDefault(),r=im(N.v+t,0,100);break;case"ArrowDown":e.preventDefault(),r=im(N.v-t,0,100)}if(n!==N.s||r!==N.v){const e={...N,s:n,v:r};D(e),R(gm(e))}}}),F=vm({onDrag:e=>{const t={...N,h:360*e};D(t),R(gm(t))},onKeyDown:e=>{const t=e.shiftKey?10:1;let n=N.h;switch(e.key){case"ArrowLeft":e.preventDefault(),n=(N.h-t+360)%360;break;case"ArrowRight":e.preventDefault(),n=(N.h+t)%360}if(n!==N.h){const e={...N,h:n};D(e),R(gm(e))}}}),j=vm({onDrag:e=>{const t={...N,a:e};D(t),R(gm(t))},onKeyDown:e=>{const t=e.shiftKey?.1:.01;let n=N.a;switch(e.key){case"ArrowLeft":e.preventDefault(),n=im(N.a-t,0,1);break;case"ArrowRight":e.preventDefault(),n=im(N.a+t,0,1)}if(n!==N.a){const e={...N,a:n};D(e),R(gm(e))}}}),H=e=>{if(S(e),e.trim()){const t=(e=>{const t=e.trim().toLowerCase();if(t.startsWith("#")){const e=dm(t);if(e){const t=sm(e.r,e.g,e.b);return{hex:um(e),rgb:e,hsl:{...t,a:e.a}}}return null}if(t.startsWith("rgb")){const e=hm(t);if(e){const t=sm(e.r,e.g,e.b);return{hex:um(e),rgb:e,hsl:{...t,a:e.a}}}return null}if(t.startsWith("hsl")){const e=pm(t);if(e){const t=lm(e.h,e.s,e.l);return{hex:um({...t,a:e.a}),rgb:{...t,a:e.a},hsl:e}}return null}return null})(e);t?(T(t),D(mm(t)),o?.(t),C(!1)):C(!0)}else C(!1)},W=i((()=>{const e=cm(N.h,100,100);return{backgroundColor:`rgb(${e.r}, ${e.g}, ${e.b})`}}),[N.h]),V=i((()=>({left:`${N.s}%`,top:100-N.v+"%"})),[N.s,N.v]),Y=i((()=>({left:N.h/360*100+"%"})),[N.h]),X=i((()=>{const e=cm(N.h,N.s,N.v);return{background:`linear-gradient(to right, rgba(${e.r}, ${e.g}, ${e.b}, 0), rgba(${e.r}, ${e.g}, ${e.b}, 1))`}}),[N.h,N.s,N.v]),q=i((()=>({left:100*N.a+"%"})),[N.a]),U=i((()=>({backgroundColor:um(O.rgb)})),[O.rgb]),Z=()=>{h||b(!y)};l((()=>{const e=e=>{"Escape"===e.key&&y&&(b(!1),A.current?.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[y]);const K="hex"===_?O.hex:w,J="only-code"!==f,Q="only-color"!==f;return e(jA,{content:t(B,{gap:5,direction:"vertical",children:[t("div",{ref:e=>{L.current=e,$.elementRef&&e&&($.elementRef.current=e)},className:wm,style:W,tabIndex:0,role:"application","aria-label":"Saturation and brightness color picker",children:[e("div",{className:Sm}),e("div",{className:km,style:V})]}),t("div",{className:Cm,children:[t("div",{className:Em,children:[e("div",{ref:e=>{I.current=e,F.elementRef&&e&&(F.elementRef.current=e)},className:`${Mm} ${Pm}`,tabIndex:0,role:"slider","aria-label":"Hue","aria-valuenow":Math.round(N.h),"aria-valuemin":0,"aria-valuemax":360,"aria-valuetext":`Hue ${Math.round(N.h)} degrees`,children:e("div",{className:Nm,style:Y})}),t("div",{ref:e=>{z.current=e,j.elementRef&&e&&(j.elementRef.current=e)},className:`${Mm} ${Om}`,tabIndex:0,role:"slider","aria-label":"Alpha","aria-valuenow":Math.round(100*N.a),"aria-valuemin":0,"aria-valuemax":100,"aria-valuetext":`Alpha ${Math.round(100*N.a)}%`,children:[e("div",{className:Tm,style:X}),e("div",{className:Nm,style:q})]})]}),e("div",{className:Rm,children:e("div",{className:$m,style:U})})]}),t(B,{gap:5,direction:"horizontal",children:[e(ng,{className:Dm,value:_,options:[{value:"hex",label:"HEX"},{value:"rgb",label:"RGB"},{value:"hsl",label:"HSL"}],onChange:e=>x(e),dimensionY:32}),e(G,{type:"text",className:`${Am} ${k?Lm:""}`,value:w,onChange:e=>H(e.target.value),onBlur:()=>{if(k||!w.trim())S(rg(O,_)),C(!1);else try{const e=fm(w);R(e),C(!1)}catch{C(!0),S(rg(O,_))}},"aria-label":"Color value","aria-invalid":k,dimensionY:32}),t(B,{className:Im,children:[e(G,{type:"text",className:zm,value:E,onChange:e=>(e=>{M(e);const t=Number.parseFloat(e);if(!Number.isNaN(t)&&t>=0&&t<=100){const e={...N,a:t/100};D(e),R(gm(e))}})(e.target.value),"aria-label":"Alpha percentage",dimensionY:32,dimensionX:30}),e("span",{children:"%"})]})]})]}),open:y,onClose:()=>b(!1),arrow:!0,placement:"bottom",containerProps:{alignment:"leftCenter",...m},contentProps:g,children:t(xs,{variant:"text",className:ym,onClick:Z,onKeyDown:e=>{"Enter"===e.key||" "===e.key?(e.preventDefault(),Z()):"Escape"===e.key&&y&&b(!1)},disabled:h,"aria-label":"Open color picker","aria-expanded":y,"aria-haspopup":"dialog",id:p,"data-display":f,fullWidth:!0,containerProps:{dimensionX:"fill"},children:[J&&e("div",{className:_m,children:e("div",{className:xm,style:U})}),Q&&e("span",{className:bm,children:K})]})})};var ig={container:"DashboardItem-module_container__Cu2fp",settingButton:"DashboardItem-module_settingButton__EVb24",header:"DashboardItem-module_header__1Ltls",chartContainer:"DashboardItem-module_chartContainer__xibFh",chart:"DashboardItem-module_chart__a5kGE"},ag="Section-module_sectionContainer__qECl2",sg="Section-module_header__1oDhY",lg="Section-module_content__3PfOv",cg="Section-module_footer__KPdum";const ug=a((({children:t,...n})=>e(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${sg} ${n.className}`,children:t}))),dg=a((({children:t,...n})=>e(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${lg} ${n.className}`,children:t}))),hg=a((({children:t,...n})=>e(B,{dimensionX:"fill",alignment:"leftTop",...n,className:`${cg} ${n.className}`,children:t}))),pg=a((({children:t,...n})=>e(B,{dimensionX:"fill",dimensionY:"fill",direction:"vertical",gap:0,...n,className:`${n.className} ${ag}`,children:t})));pg.Header=ug,pg.Content=dg,pg.Footer=hg;const fg=({headerProps:n,chartProps:r})=>t(pg,{className:ig.dashboardItem,children:[t(pg.Header,{children:[e(V,{children:n?.content}),n?.suffix||e(xs,{color:"transparent",shape:"circle",className:ig.settingButton,children:e(Ga,{name:"cog",className:ig.settingIcon,size:"xs"})})]}),e(pg.Content,{children:e(Zf,{type:r?.type,data:r?.data,options:r?.options,className:ig.chart})})]});var mg,gg={exports:{}};
50
50
  /*!
51
51
  Copyright (c) 2018 Jed Watson.
52
52
  Licensed under the MIT License (MIT), see
@@ -96,5 +96,5 @@ const lF=e=>e&&e.enabled&&e.modifierKey,cF=(e,t)=>e&&t[e+"Key"],uF=(e,t)=>e&&!t[
96
96
  * @author Lea Verou <https://lea.verou.me>
97
97
  * @namespace
98
98
  * @public
99
- */e.exports&&(e.exports=t),void 0!==ye&&(ye.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(e,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:t.languages[n]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:o},t.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(e,n){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:t.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(void 0!==t&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},n="data-src-status",r="loading",o="loaded",i="pre[data-src]:not(["+n+'="'+o+'"]):not(['+n+'="'+r+'"])';t.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),t.hooks.add("before-sanity-check",(function(a){var s=a.element;if(s.matches(i)){a.code="",s.setAttribute(n,r);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),u=a.language;if("none"===u){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[d]||d}t.util.setLanguage(l,u),t.util.setLanguage(s,u);var h=t.plugins.autoloader;h&&h.loadLanguages(u),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n(function(e,t){return"✖ Error "+e+" while fetching file: "+t}(r.status,r.statusText)):n("✖ Error: File does not exist or is empty"))},r.send(null)}(c,(function(e){s.setAttribute(n,o);var r=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],o=t[3];return r?o?[n,Number(o)]:[n,void 0]:[n,n]}}(s.getAttribute("data-range"));if(r){var i=e.split(/\r\n?|\n/g),a=r[0],c=null==r[1]?i.length:r[1];a<0&&(a+=i.length),a=Math.max(0,Math.min(a-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(a,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(a+1))}l.textContent=e,t.highlightElement(l)}),(function(e){s.setAttribute(n,"failed"),l.textContent=e}))}})),t.plugins.fileHighlight={highlight:function(e){for(var n,r=(e||document).querySelectorAll(i),o=0;n=r[o++];)t.highlightElement(n)}};var a=!1;t.fileHighlight=function(){a||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),a=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}(b1)),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var o=t[n];if("code"===o.type){var i=o.content[1],a=o.content[3];if(i&&a&&"code-language"===i.type&&"code-block"===a.type&&"string"==typeof i.content){var s=i.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(s=(/[a-z][\w-]*/i.exec(s)||[""])[0].toLowerCase());a.alias?"string"==typeof a.alias?a.alias=[a.alias,l]:a.alias.push(l):a.alias=[l]}}else e(o.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,o=t.classes.length;r<o;r++){var i=t.classes[r],c=/language-(.+)/.exec(i);if(c){n=c[1];break}}var u,d,h=e.languages[n];if(h)t.content=e.highlight((u=t.content,d=(d=u.replace(a,"")).replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=s[t];return r||e})),d),h,n);else if(n&&"none"!==n&&e.plugins.autoloader){var p="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=p,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(p);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var a=RegExp(e.languages.markup.tag.pattern.source,"gi"),s={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism);var _1;_1||(_1=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python);var x1;x1||(x1=1,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism)),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift}));var w1;w1||(w1=1,function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism));var S1;S1||(S1=1,function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism));var k1;k1||(k1=1,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)),function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const C1=globalThis.Prism||window.Prism,E1=e=>{try{return!!e&&C1.languages.hasOwnProperty(e)}catch(e){return!1}};function M1(e,t){for(const n of e.childNodes){if(IK(n)&&n.tagName===t)return!0;M1(n,t)}return!1}const P1="data-language",O1="data-highlight-language";class T1 extends C0{static getType(){return"code"}static clone(e){return new T1(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=E1(e)}createDOM(e){const t=document.createElement("code");p1(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(P1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(O1,n)),t}updateDOM(e,t,n){const r=this.__language,o=e.__language;return r?r!==o&&(t.setAttribute(P1,r),this.__isSyntaxHighlightSupported&&t.setAttribute(O1,r)):o&&(t.removeAttribute(P1),e.__isSyntaxHighlightSupported&&t.removeAttribute(O1)),!1}exportDOM(e){const t=document.createElement("pre");p1(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(P1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(O1,n)),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||M1(e,"BR"))?{conversion:D1,priority:1}:null,div:()=>({conversion:A1,priority:1}),pre:()=>({conversion:D1,priority:0}),table:e=>R1(e)?{conversion:L1,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&R1(n)?{conversion:I1,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&R1(t)?{conversion:I1,priority:3}:null}}}static importJSON(e){return N1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage()}}insertNewAfter(e,t=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const e=F0();return this.insertAfter(e,t),e}const{anchor:o,focus:i}=e,a=(o.isBefore(i)?o:i).getNode();if(_Q(a)){let e=function(e){let t=e,n=e;for(;B1(n)||kQ(n);)t=n,n=n.getPreviousSibling();return t}(a);const t=[];for(;;)if(kQ(e))t.push(SQ()),e=e.getNextSibling();else{if(!B1(e))break;{let n=0;const r=e.getTextContent(),o=e.getTextContentSize();for(;n<o&&" "===r[n];)n++;if(0!==n&&t.push(j1(" ".repeat(n))),n!==o)break;e=e.getNextSibling()}}const n=a.splitText(o.offset)[0],r=0===o.offset?0:1,i=n.getIndexWithinParent()+r,s=a.getParentOrThrow(),l=[tQ(),...t];s.splice(i,0,l);const c=t[t.length-1];c?c.select():0===o.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(function(e){return e instanceof T1}(a)){const{offset:t}=e.anchor;a.splice(t,0,[tQ()]),a.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=F0();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t.__isSyntaxHighlightSupported=E1(e),t}getLanguage(){return this.getLatest().__language}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}}function N1(e){return OK(new T1(e))}function D1(e){return{node:N1(e.getAttribute(P1))}}function A1(e){const t=e,n=z1(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(z1(t))return!0;t=t.parentElement}return!1}(t)?{node:n?N1():null}:{node:null}}function L1(){return{node:N1()}}function I1(){return{node:null}}function z1(e){return null!==e.style.fontFamily.match("monospace")}function R1(e){return e.classList.contains("js-file-line-container")}class $1 extends uQ{constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new $1(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e);return p1(t,F1(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),o=F1(n.theme,e.__highlightType),i=F1(n.theme,this.__highlightType);return o!==i&&(o&&f1(t,o),i&&p1(t,i)),r}static importJSON(e){return j1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return N1()}}function F1(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function j1(e="",t){return OK(new $1(e,t))}function B1(e){return e instanceof $1}var H1=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function W1(e){return n2(e)&&c2(e.getFirstChild())}function V1(e){return t2().append(e)}function Y1(e,t){e.splice(e.getChildrenSize(),0,t)}function X1(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&W1(n)&&W1(r)&&(X1(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function q1(e){const t=new Set;if(W1(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(W1(r)&&W1(o)){const n=o.getFirstChild();if(c2(n)){n.append(e);const o=r.getFirstChild();c2(o)&&(Y1(n,o.getChildren()),r.remove(),t.add(r.getKey()))}}else if(W1(r)){const t=r.getFirstChild();if(c2(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(W1(o)){const t=o.getFirstChild();c2(t)&&t.append(e)}else if(c2(n)){const t=t2(),i=l2(n.getListType());t.append(i),i.append(e),o?o.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function U1(e){if(W1(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(c2(n?n.getParent():void 0)&&n2(n)&&c2(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=t.getListType(),o=t2(),i=l2(r);o.append(i),e.getPreviousSiblings().forEach((e=>i.append(e)));const a=t2(),s=l2(r);a.append(s),Y1(s,e.getNextSiblings()),n.insertBefore(o),n.insertAfter(a),n.replace(e)}}}function Z1(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}class G1 extends C0{static getType(){return"listitem"}static clone(e){return new G1(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return c2(n)&&"check"===n.getListType()&&J1(t,this,null),t.value=this.__value,K1(t,e.theme,this),t}updateDOM(e,t,n){const r=this.getParent();return c2(r)&&"check"===r.getListType()&&J1(t,this,e),t.value=this.__value,K1(t,n.theme,this),!1}static transform(){return e=>{if(n2(e)||H1(144),null==e.__checked)return;const t=e.getParent();c2(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:Q1,priority:0})}}static importJSON(e){return t2().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(E0(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(n2(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!c2(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=l2(n.getListType());let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&(E0(e)||H1(139),this.getChildren().forEach((t=>{e.append(t)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(c2(n)||H1(39),n2(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const o=l2(n.getListType());r.forEach((e=>o.append(e))),e.insertAfter(o,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&W1(t)&&W1(n)&&(X1(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=t2().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=F0();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),o=n2(r);if(1===n.getChildrenSize())if(o)n.remove(),r.select();else{n.insertBefore(t),n.remove();const r=e.anchor,o=e.focus,i=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(i,r.offset,"element"),"element"===o.type&&o.getNode().is(this)&&o.set(i,o.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return c2(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(null===e)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;n2(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&H1(117),(e=Math.floor(e))>=0||H1(199);let t=this.getIndent();for(;t!==e;)t<e?(q1(this),t++):(U1(this),t--);return this}canInsertAfter(e){return n2(e)}canReplaceWith(e){return n2(e)}canMergeWith(e){return n2(e)||j0(e)}extractWithChild(e,t){if(!NQ(t))return!1;const n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return l2("bullet")}canMergeWhenEmpty(){return!0}}function K1(e,t,n){const r=[],o=[],i=t.list,a=i?i.listitem:void 0;let s;if(i&&i.nested&&(s=i.nested.listitem),void 0!==a&&r.push(...Z1(a)),i){const e=n.getParent(),t=c2(e)&&"check"===e.getListType(),a=n.getChecked();t&&!a||o.push(i.listitemUnchecked),t&&a||o.push(i.listitemChecked),t&&r.push(a?i.listitemChecked:i.listitemUnchecked)}if(void 0!==s){const e=Z1(s);n.getChildren().some((e=>c2(e)))?r.push(...e):o.push(...e)}o.length>0&&f1(e,...o),r.length>0&&p1(e,...r)}function J1(e,t,n,r){c2(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function Q1(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return e2(t);const t=e.getAttribute("aria-checked");return{node:t2("true"===t||"false"!==t&&void 0)}}function e2(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:t2(e.hasAttribute("checked"))}}function t2(e){return OK(new G1(void 0,e))}function n2(e){return e instanceof G1}class r2 extends C0{static getType(){return"list"}static clone(e){const t=e.__listType||s2[e.__tag];return new r2(t,e.__start,e.__key)}constructor(e="number",t=1,n){super(n);const r=s2[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.__listType}getStart(){return this.__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,o2(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(o2(t,n.theme,this),!1)}static transform(){return e=>{c2(e)||H1(163),function(e){const t=e.getNextSibling();c2(t)&&e.getListType()===t.getListType()&&X1(e,t)}(e),function(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())n2(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),c2(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:()=>({conversion:a2,priority:0}),ul:()=>({conversion:a2,priority:0})}}static importJSON(e){return l2().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return IK(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(n2(n))super.append(n);else{const e=t2();if(c2(n))e.append(n);else if(E0(n))if(n.isInline())e.append(n);else{const t=bQ(n.getTextContent());e.append(t)}else e.append(n);super.append(e)}}return this}extractWithChild(e){return n2(e)}}function o2(e,t,n){const r=[],o=[],i=t.list;if(void 0!==i){const e=i[`${n.__tag}Depth`]||[],t=function(e){let t=1,n=e.getParent();for(;null!=n;){if(n2(n)){const e=n.getParent();if(c2(e)){t++,n=e.getParent();continue}H1(40)}return t}return t}(n)-1,a=t%e.length,s=e[a],l=i[n.__tag];let c;const u=i.nested,d=i.checklist;if(void 0!==u&&u.list&&(c=u.list),void 0!==l&&r.push(l),void 0!==d&&"check"===n.__listType&&r.push(d),void 0!==s){r.push(...Z1(s));for(let t=0;t<e.length;t++)t!==a&&o.push(n.__tag+t)}if(void 0!==c){const e=Z1(c);t>1?r.push(...e):o.push(...e)}}o.length>0&&f1(e,...o),r.length>0&&p1(e,...r)}function i2(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(n2(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach((e=>{c2(e)&&t.push(V1(e))}))}else t.push(V1(r))}return t}function a2(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=l2("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list"))return!0;for(const t of e.childNodes)if(IK(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?l2("check"):l2("bullet")),{after:i2,node:n}}const s2={ol:"number",ul:"bullet"};function l2(e="number",t=1){return OK(new r2(e,t))}function c2(e){return e instanceof r2}const u2={},d2={};function h2(e,t){const n=t.body?t.body.childNodes:[];let r=[];const o=[];for(let t=0;t<n.length;t++){const i=n[t];if(!m2.has(i.nodeName)){const t=g2(i,e,o,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof z0&&t.insertAfter(tQ());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(o),r}function p2(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=KG().getChildren();for(let o=0;o<r.length;o++)f2(e,r[o],n,t);return n.innerHTML}function f2(e,t,n,r=null){let o=null===r||t.isSelected(r);const i=E0(t)&&t.excludeFromCopy("html");let a=t;if(null!==r){let e=YK(t);e=_Q(e)&&null!==r?G0(r,e):e,a=e}const s=E0(a)?a.getChildren():[],l=e._nodes.get(a.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(e,a):a.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const h=document.createDocumentFragment();for(let n=0;n<s.length;n++){const i=s[n],a=f2(e,i,h,r);!o&&E0(t)&&a&&t.extractWithChild(i,r,"html")&&(o=!0)}if(o&&!i){if((IK(u)||RK(u))&&u.append(h),n.append(u),d){const e=d.call(a,u);e&&(RK(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(h);return o}const m2=new Set(["STYLE","SCRIPT"]);function g2(e,t,n,r,o=new Map,i){let a=[];if(m2.has(e.nodeName))return a;let s=null;const l=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let o=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===o||(o.priority||0)<=(n.priority||0))&&(o=n)}return null!==o?o.conversion:null}(e,t),c=l?l(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(s=Array.isArray(t)?t[t.length-1]:t,null!==s){for(const[,e]of o)if(s=e(s,i),!s)break;s&&a.push(...Array.isArray(t)?t:[s])}null!=c.forChild&&o.set(e.nodeName,c.forChild)}const d=e.childNodes;let h=[];const p=(null==s||!PK(s))&&(null!=s&&BQ(s)||r);for(let e=0;e<d.length;e++)h.push(...g2(d[e],t,n,p,new Map(o),s));return null!=u&&(h=u(h)),FK(e)&&(h=function(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let e=0;e<t.length;e++){const a=t[e];if(BQ(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),e===t.length-1||e<t.length-1&&BQ(t[e+1])){const e=n();e.setFormat(r),e.append(...i),o.push(e),i=[]}}return o}(e,h,p?()=>{const e=new z0;return n.push(e),e}:F0)),null==s?h.length>0?a=a.concat(h):FK(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&($K(e.nextSibling)&&$K(e.previousSibling))}(e)&&(a=a.concat(tQ())):E0(s)&&s.append(...h),a}var v2=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function y2(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return b2(n,function(e){const t=[];for(let n=0;n<e.length;n++){const r=f0(e[n]);_Q(r)&&J0(r),t.push(r)}return t}(e.nodes),t)}catch(e){}const o=e.getData("text/html");if(o)try{return b2(n,h2(n,(new DOMParser).parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(e):e}(o),"text/html")),t)}catch(e){}const i=e.getData("text/plain")||e.getData("text/uri-list");if(null!=i)if(NQ(t)){const e=i.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=YQ();if(NQ(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([SQ()]):n.insertText(r)}}}else t.insertRawText(i)}function b2(e,t,n){e.dispatchCommand(VU,{nodes:t,selection:n})||n.insertNodes(t)}function _2(e,t,n,r=[]){let o=null===t||n.isSelected(t);const i=E0(n)&&n.excludeFromCopy("html");let a=n;if(null!==t){let e=YK(n);e=_Q(e)&&null!==t?G0(t,e):e,a=e}const s=E0(a)?a.getChildren():[],l=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&v2(58,n.name),E0(e)){const e=t.children;Array.isArray(e)||v2(59,n.name)}return t}(a);if(_Q(a)){const e=a.__text;e.length>0?l.text=e:o=!1}for(let r=0;r<s.length;r++){const i=s[r],a=_2(e,t,i,l.children);!o&&E0(n)&&a&&n.extractWithChild(i,t,"clone")&&(o=!0)}if(o&&!i)r.push(l);else if(Array.isArray(l.children))for(let e=0;e<l.children.length;e++){const t=l.children[e];r.push(t)}return o}let x2=null;async function w2(e,t,n){if(null!==x2)return!1;if(null!==t)return new Promise(((r,o)=>{e.update((()=>{r(S2(e,t,n))}))}));const r=e.getRootElement(),o=null==e._window?window.document:e._window.document,i=AK(e._window);if(null===r||null===i)return!1;const a=o.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(o.createTextNode("#")),r.append(a);const s=new Range;return s.setStart(a,0),s.setEnd(a,1),i.removeAllRanges(),i.addRange(s),new Promise(((t,r)=>{const i=e.registerCommand(kZ,(r=>(g1(r,ClipboardEvent)&&(i(),null!==x2&&(window.clearTimeout(x2),x2=null),t(S2(e,r,n))),!0)),4);x2=window.setTimeout((()=>{i(),x2=null,t(!1)}),50),o.execCommand("copy"),a.remove()}))}function S2(e,t,n){if(void 0===n){const t=AK(e._window);if(!t)return!1;const r=t.anchorNode,o=t.focusNode;if(null!==r&&null!==o&&!AG(e,r,o))return!1;const i=YQ();if(null===i)return!1;n=function(e=YQ()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=c0();for(const[r,o]of k2){const i=o(n,e);null!==i&&(t[r]=i)}}return t}(i)}t.preventDefault();const r=t.clipboardData;return null!==r&&(function(e,t){for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}(r,n),!0)}const k2=[["text/html",function(e,t=YQ()){return null==t&&v2(166),NQ(t)&&t.isCollapsed()||0===t.getNodes().length?"":p2(e,t)}],["application/x-lexical-editor",function(e,t=YQ()){return null==t&&v2(166),NQ(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=KG().getChildren();for(let o=0;o<r.length;o++)_2(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}]];function C2(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const E2="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,M2=E2&&"documentMode"in document?document.documentMode:null,P2=!(!E2||!("InputEvent"in window)||M2)&&"getTargetRanges"in new window.InputEvent("input"),O2=E2&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T2=E2&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,N2=E2&&/^(?=.*Chrome).*/i.test(navigator.userAgent),D2=E2&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!N2,A2={};class L2 extends C0{static getType(){return"quote"}static clone(e){return new L2(e.__key)}createDOM(e){const t=document.createElement("blockquote");return p1(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:F2,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(IK(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return I2().updateFromJSON(e)}insertNewAfter(e,t){const n=F0(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=F0();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function I2(){return OK(new L2)}class z2 extends C0{static getType(){return"heading"}static clone(e){return new z2(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){p1(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:$2,priority:0}),h2:e=>({conversion:$2,priority:0}),h3:e=>({conversion:$2,priority:0}),h4:e=>({conversion:$2,priority:0}),h5:e=>({conversion:$2,priority:0}),h6:e=>({conversion:$2,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&R2(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>R2(e)?{conversion:e=>({node:j2("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(IK(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return j2(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=this.getLastDescendant(),o=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?F0():j2(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,t),0===n&&!this.isEmpty()&&e){const e=F0();e.select(),this.replace(e,!0)}return o}collapseAtStart(){const e=this.isEmpty()?F0():j2(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}}function R2(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function $2(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=j2(t),null!==e.style&&(XK(e,n),n.setFormat(e.style.textAlign))),{node:n}}function F2(e){const t=I2();return null!==e.style&&(t.setFormat(e.style.textAlign),XK(e,t)),{node:t}}function j2(e="h1"){return OK(new z2(e))}function B2(e){let t=null;if(g1(e,DragEvent)?t=e.dataTransfer:g1(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function H2(e){const t=YQ();if(!NQ(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const o=r[t],i=o.getKey();if(n.has(i))continue;const a=m1(o,(e=>E0(e)&&!e.isInline()));if(null===a)continue;const s=a.getKey();a.canIndent()&&!n.has(s)&&(n.add(s),e(a))}return n.size>0}function W2(e){return O0(UG(e))}function V2(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function Y2(e){return h1(e.registerCommand(YU,(e=>{const t=YQ();return!!AQ(t)&&(t.clear(),!0)}),0),e.registerCommand(XU,(e=>{const t=YQ();return!!NQ(t)&&(t.deleteCharacter(e),!0)}),0),e.registerCommand(JU,(e=>{const t=YQ();return!!NQ(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(QU,(e=>{const t=YQ();return!!NQ(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(ZU,(t=>{const n=YQ();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)y2(r,n,e);else if(NQ(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),0),e.registerCommand(KU,(()=>{const e=YQ();return!!NQ(e)&&(e.removeText(),!0)}),0),e.registerCommand(eZ,(e=>{const t=YQ();return!!NQ(t)&&(t.formatText(e),!0)}),0),e.registerCommand(_Z,(e=>{const t=YQ();if(!NQ(t)&&!AQ(t))return!1;const n=t.getNodes();for(const t of n){const n=m1(t,(e=>E0(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),0),e.registerCommand(qU,(e=>{const t=YQ();return!!NQ(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(UU,(()=>{const e=YQ();return!!NQ(e)&&(e.insertParagraph(),!0)}),0),e.registerCommand(gZ,(()=>(function(e){let t=YQ()||XQ();null===t&&(t=KG().selectEnd()),t.insertNodes(e)}([SQ()]),!0)),0),e.registerCommand(vZ,(()=>H2((e=>{const t=e.getIndent();e.setIndent(t+1)}))),0),e.registerCommand(yZ,(()=>H2((e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}))),0),e.registerCommand(lZ,(e=>{const t=YQ();if(AQ(t)&&!W2(e.target)){const e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(NQ(t)){const n=yK(t.focus,!0);if(!e.shiftKey&&O0(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),0),e.registerCommand(cZ,(e=>{const t=YQ();if(AQ(t)){const e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(NQ(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===KG().getChildrenSize()}(t))return e.preventDefault(),!0;const n=yK(t.focus,!1);if(!e.shiftKey&&O0(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),0),e.registerCommand(aZ,(e=>{const t=YQ();if(AQ(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!NQ(t))return!1;if(n1(t,!0)){const n=e.shiftKey;return e.preventDefault(),r1(t,n,!0),!0}return!1}),0),e.registerCommand(oZ,(e=>{const t=YQ();if(AQ(t)&&!W2(e.target)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!NQ(t))return!1;const n=e.shiftKey;return!!n1(t,!1)&&(e.preventDefault(),r1(t,n,!1),!0)}),0),e.registerCommand(hZ,(t=>{if(W2(t.target))return!1;const n=YQ();if(!NQ(n))return!1;const{anchor:r}=n,o=r.getNode();return n.isCollapsed()&&0===r.offset&&!N0(o)&&function(e){const t=m1(e,(e=>E0(e)&&!e.isInline()));return E0(t)||s1(4,e.__key),t}(o).getIndent()>0?(t.preventDefault(),e.dispatchCommand(yZ,void 0)):(!T2||"ko-KR"!==navigator.language)&&(t.preventDefault(),e.dispatchCommand(XU,!0))}),0),e.registerCommand(fZ,(t=>{if(W2(t.target))return!1;return!!NQ(YQ())&&(t.preventDefault(),e.dispatchCommand(XU,!1))}),0),e.registerCommand(uZ,(t=>{const n=YQ();if(!NQ(n))return!1;if(V2(n),null!==t){if((T2||O2||D2)&&P2)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(qU,!1)}return e.dispatchCommand(UU,void 0)}),0),e.registerCommand(pZ,(()=>!!NQ(YQ())&&(e.blur(),!0)),0),e.registerCommand(bZ,(t=>{const[,n]=B2(t);if(n.length>0){const r=C2(t.clientX,t.clientY);if(null!==r){const{offset:t,node:o}=r,i=UG(o);if(null!==i){const e=function(){const e=EQ("root",0,"element"),t=EQ("root",0,"element");return new DQ(e,t,0,"")}();if(_Q(i))e.anchor.set(i.getKey(),t,"text"),e.focus.set(i.getKey(),t,"text");else{const t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}QG(PG(e))}e.dispatchCommand(A2,n)}return t.preventDefault(),!0}return!!NQ(YQ())}),0),e.registerCommand(xZ,(e=>{const[t]=B2(e),n=YQ();return!(t&&!NQ(n))}),0),e.registerCommand(wZ,(e=>{const[t]=B2(e),n=YQ();if(t&&!NQ(n))return!1;const r=C2(e.clientX,e.clientY);if(null!==r){O0(UG(r.node))&&e.preventDefault()}return!0}),0),e.registerCommand(EZ,(()=>(function(e){const t=KG();if(NQ(e)){const t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),PG(e),e}{const e=t.select(0,t.getChildrenSize());QG(PG(e))}}(),!0)),0),e.registerCommand(kZ,(t=>(w2(e,g1(t,ClipboardEvent)?t:null),!0)),0),e.registerCommand(CZ,(t=>(async function(e,t){await w2(t,g1(e,ClipboardEvent)?e:null),t.update((()=>{const e=YQ();NQ(e)?e.removeText():AQ(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),0),e.registerCommand(GU,(t=>{const[,n,r]=B2(t);return n.length>0&&!r?(e.dispatchCommand(A2,n),!0):(!zK(t.target)||!DG(t.target))&&(null!==YQ()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=YQ(),r=g1(e,InputEvent)||g1(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&y2(r,n,t)}),{tag:"paste"})}(t,e),!0))}),0),e.registerCommand(dZ,(e=>{const t=YQ();return NQ(t)&&V2(t),!1}),0),e.registerCommand(mZ,(e=>{const t=YQ();return NQ(t)&&V2(t),!1}),0))}var X2=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const q2=m(null);function U2(){const e=p(q2);return null==e&&X2(8),e}const Z2="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,G2=Z2?d:l,K2={tag:"history-merge"};function J2({initialConfig:t,children:n}){const r=i((()=>{const{theme:e,namespace:n,nodes:r,onError:o,editorState:i,html:a}=t,s=function(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}(null,e),l=H0({editable:t.editable,html:a,namespace:n,nodes:r,onError:e=>o(e,l),theme:e});return function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=KG();if(t.isEmpty()){const n=F0();t.append(n);const r=Z2?document.activeElement:null;(null!==YQ()||null!==r&&r===e.getRootElement())&&n.select()}}),K2);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,K2);break}case"object":e.setEditorState(t,K2);break;case"function":e.update((()=>{KG().isEmpty()&&t(e)}),K2)}}(l,i),[l,s]}),[]);return G2((()=>{const e=t.editable,[n]=r;n.setEditable(void 0===e||e)}),[]),e(q2.Provider,{value:r,children:n})}var Q2="LexicalContent-module_editableContent__f69V7",e5="LexicalContent-module_placeholder__EMU-N",t5="LexicalContent-module_editorContainer__l2-r1";function n5({defaultSelection:e}){const[t]=U2();return l((()=>{t.focus((()=>{const e=document.activeElement,n=t.getRootElement();null===n||null!==e&&n.contains(e)||n.focus({preventScroll:!0})}),{defaultSelection:e})}),[e,t]),null}const r5="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;function o5(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function i5(e,t=!0){if(e)return!1;let n=KG().getTextContent();return t&&(n=n.trim()),""===n}function a5(e){return()=>function(e){if(!i5(e,!1))return!1;const t=KG().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){const n=t[e];if(O0(n))return!1;if(E0(n)){if(!j0(n))return!1;if(0!==n.__indent)return!1;const t=n.getChildren(),r=t.length;for(let n=0;n<r;n++)if(!_Q(t[e]))return!1}}return!0}(e)}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const s5="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;function l5(e){return e.getEditorState().read(a5(e.isComposing()))}function c5({contentEditable:r,placeholder:o=null,ErrorBoundary:a}){const[s]=U2(),c=function(t,n){const[r,o]=u((()=>t.getDecorators()));return s5((()=>t.registerDecoratorListener((e=>{T((()=>{o(e)}))}))),[t]),l((()=>{o(t.getDecorators())}),[t]),i((()=>{const o=[],i=Object.keys(r);for(let a=0;a<i.length;a++){const s=i[a],l=e(n,{onError:e=>t._onError(e),children:e(C,{fallback:null,children:r[s]})}),c=t.getElementByKey(s);null!==c&&o.push(P(l,c,s))}return o}),[n,r,t])}(s,a);return function(e){s5((()=>h1(Y2(e),function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,i,a,s,l]=t;e.update((()=>{const e=YQ();if(NQ(e)){const t=e.anchor;let l=t.getNode(),c=0,u=0;if(_Q(l)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(l,c,l,u)),c===u&&""===i||(e.insertRawText(i),l=t.getNode()),_Q(l)){c=a,u=a+s;const t=l.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(l,c,l,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(e))),[e])}(s),t(n,{children:[r,e(u5,{content:o}),c]})}function u5({content:e}){const[t]=U2(),n=function(e){const[t,n]=u((()=>l5(e)));return s5((()=>{function t(){const t=l5(e);n(t)}return t(),h1(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=function(e){const[t]=U2(),n=i((()=>e(t)),[t,e]),[r,o]=u((()=>n.initialValueFn())),a=s(r);return r5((()=>{const{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,o(r)),t((e=>{a.current=e,o(e)}))}),[n,e]),r}(o5);return n?"function"==typeof e?e(r):e:null}const d5="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;const h5=h((function({editor:t,ariaActiveDescendant:n,ariaAutoComplete:r,ariaControls:o,ariaDescribedBy:a,ariaErrorMessage:s,ariaExpanded:l,ariaInvalid:d,ariaLabel:h,ariaLabelledBy:p,ariaMultiline:f,ariaOwns:m,ariaRequired:g,autoCapitalize:v,className:y,id:b,role:_="textbox",spellCheck:x=!0,style:w,tabIndex:S,"data-testid":k,...C},E){const[M,P]=u(t.isEditable()),O=c((e=>{e&&e.ownerDocument&&e.ownerDocument.defaultView?t.setRootElement(e):t.setRootElement(null)}),[t]),T=i((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(E,O)),[O,E]);return d5((()=>(P(t.isEditable()),t.registerEditableListener((e=>{P(e)})))),[t]),e("div",{"aria-activedescendant":M?n:void 0,"aria-autocomplete":M?r:"none","aria-controls":M?o:void 0,"aria-describedby":a,...null!=s?{"aria-errormessage":s}:{},"aria-expanded":M&&"combobox"===_?!!l:void 0,...null!=d?{"aria-invalid":d}:{},"aria-label":h,"aria-labelledby":p,"aria-multiline":f,"aria-owns":M?m:void 0,"aria-readonly":!M||void 0,"aria-required":g,autoCapitalize:v,className:y,contentEditable:M,"data-testid":k,id:b,ref:T,role:M?_:void 0,spellCheck:x,style:w,tabIndex:S,...C})}));function p5(e){return e.getEditorState().read(a5(e.isComposing()))}const f5=h((function(r,o){const{placeholder:i,...a}=r,[s]=U2();return t(n,{children:[e(h5,{editor:s,...a,ref:o}),null!=i&&e(m5,{editor:s,content:i})]})}));function m5({content:t,editor:n}){const r=function(e){const[t,n]=u((()=>p5(e)));return d5((()=>{function t(){const t=p5(e);n(t)}return t(),h1(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(n),[o,i]=u(n.isEditable());if(d((()=>(i(n.isEditable()),n.registerEditableListener((e=>{i(e)})))),[n]),!r)return null;let a=null;return"function"==typeof t?a=t(o):null!==t&&(a=t),null===a?null:e("div",{"aria-hidden":!0,children:a})}function g5(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return 0;const i=t._selection,a=e._selection;if(o)return 1;if(!(NQ(i)&&NQ(a)&&a.isCollapsed()&&i.isCollapsed()))return 0;const s=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||N0(n)||o.push(n)}return o}(t,n,r);if(0===s.length)return 0;if(s.length>1){const n=t._nodeMap,r=n.get(i.anchor.key),o=n.get(a.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&_Q(r)&&1===r.__text.length&&1===i.anchor.offset?2:0}const l=s[0],c=e._nodeMap.get(l.__key);if(!_Q(c)||!_Q(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const h=i.anchor,p=a.anchor;if(h.key!==p.key||"text"!==h.type)return 0;const f=h.offset,m=p.offset,g=d.length-u.length;return 1===g&&m===f-1?2:-1===g&&m===f+1?3:-1===g&&m===f?4:0}function v5(e,t){let n=Date.now(),r=0;return(o,i,a,s,l,c)=>{const u=Date.now();if(c.has("historic"))return r=0,n=u,2;const d=g5(o,i,s,l,e.isComposing()),h=(()=>{const h=null===a||a.editor===e,p=c.has("history-push");if(!p&&h&&c.has("history-merge"))return 0;if(null===o)return 1;const f=i._selection;return s.size>0||l.size>0?!1===p&&0!==d&&d===r&&u<n+t&&h||1===s.size&&function(e,t,n){const r=t._nodeMap.get(e),o=n._nodeMap.get(e),i=t._selection,a=n._selection;return!(NQ(i)&&NQ(a)&&"element"===i.anchor.type&&"element"===i.focus.type&&"text"===a.anchor.type&&"text"===a.focus.type||!_Q(r)||!_Q(o)||r.__parent!==o.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(s)[0],o,i)?0:1:null!==f?0:2})();return n=u,r=d,h}}function y5(e){e.undoStack=[],e.redoStack=[],e.current=null}function b5({delay:e,externalHistoryState:t}){const[n]=U2();return function(e,t,n=1e3){const r=i((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);l((()=>function(e,t,n){const r=v5(e,n),o=h1(e.registerCommand(tZ,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,i=r.pop();null!==o&&(n.push(o),e.dispatchCommand(OZ,!0)),0===r.length&&e.dispatchCommand(TZ,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(nZ,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(TZ,!0));const i=n.pop();0===n.length&&e.dispatchCommand(OZ,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(MZ,(()=>(y5(t),!1)),0),e.registerCommand(PZ,(()=>(y5(t),e.dispatchCommand(OZ,!1),e.dispatchCommand(TZ,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:i,dirtyElements:a,tags:s})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const h=r(o,n,l,i,a,s);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(OZ,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(TZ,!0));else if(2===h)return;t.current={editor:e,editorState:n}})));return o}(e,r,n)),[n,e,r])}(n,t,e),null}function _5(e,t){return _5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_5(e,t)}var x5={error:null},w5=function(e){var t,n;function o(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=x5,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,_5(t,n),o.getDerivedStateFromError=function(e){return{error:e}};var i=o.prototype;return i.reset=function(){this.setState(x5)},i.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},i.componentDidUpdate=function(e,t){var n,r,o,i,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(i=s)&&(i=[]),o.length!==i.length||o.some((function(e,t){return!Object.is(e,i[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,s),this.reset())},i.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,o=t.FallbackComponent,i=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(i))return i;if("function"==typeof n)return n(a);if(o)return r.createElement(o,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},o}(r.Component);function S5({children:t,onError:n}){return e(w5,{fallback:e("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:n,children:t})}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const k5=new Set(["http:","https:","mailto:","sms:","tel:"]);class C5 extends C0{static getType(){return"link"}static clone(e){return new C5(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:o=null,title:i=null}=t;this.__url=e,this.__target=r,this.__rel=o,this.__title=i}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),null!==this.__target&&(t.target=this.__target),null!==this.__rel&&(t.rel=this.__rel),null!==this.__title&&(t.title=this.__title),p1(t,e.theme.link),t}updateDOM(e,t,n){if(LK(t)){const n=this.__url,r=this.__target,o=this.__rel,i=this.__title;n!==e.__url&&(t.href=n),r!==e.__target&&(r?t.target=r:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),i!==e.__title&&(i?t.title=i:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:E5,priority:1})}}static importJSON(e){return M5().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){try{const t=new URL(e);if(!k5.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=M5(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!NQ(t))return!1;const r=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function E5(e){let t=null;if(LK(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=M5(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function M5(e="",t){return OK(new C5(e,t))}function P5(e){return e instanceof C5}function O5({label:n,value:r,onChange:o,placeholder:i="","data-test-id":a,type:s="text"}){return t("div",{className:"Input__wrapper",children:[e("label",{className:"Input__label",children:n}),e("input",{type:s,className:"Input__input",placeholder:i,value:r,onChange:e=>{o(e.target.value)},"data-test-id":a})]})}let T5=!1;const N5=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000000","#4a4a4a","#9b9b9b","#ffffff"],D5=214;function A5({color:n,onChange:r}){const[o,a]=u(j5("hex",n)),[c,d]=u(n),h=s(null),p=i((()=>({x:o.hsv.s/100*D5,y:(100-o.hsv.v)/100*150})),[o.hsv.s,o.hsv.v]),f=i((()=>({x:o.hsv.h/360*D5})),[o.hsv]);return l((()=>{null!==h.current&&r&&(r(o.hex,T5),d(o.hex))}),[o,r]),l((()=>{if(void 0===n)return;const e=j5("hex",n);a(e),d(e.hex)}),[n]),t("div",{className:"color-picker-wrapper",style:{width:D5},ref:h,children:[e(O5,{label:"Hex",onChange:e=>{if(d(e),/^#[0-9A-Fa-f]{6}$/i.test(e)){const t=j5("hex",e);a(t)}},value:c}),e("div",{className:"color-picker-basic-color",children:N5.map((t=>e("button",{className:t===o.hex?" active":"",style:{backgroundColor:t},onClick:()=>{d(t),a(j5("hex",t))}},t)))}),e(L5,{className:"color-picker-saturation",style:{backgroundColor:`hsl(${o.hsv.h}, 100%, 50%)`},onChange:({x:e,y:t})=>{const n=j5("hsv",{...o.hsv,s:e/D5*100,v:100-t/150*100});a(n),d(n.hex)},children:e("div",{className:"color-picker-saturation_cursor",style:{backgroundColor:o.hex,left:p.x,top:p.y}})}),e(L5,{className:"color-picker-hue",onChange:({x:e})=>{const t=j5("hsv",{...o.hsv,h:e/D5*360});a(t),d(t.hex)},children:e("div",{className:"color-picker-hue_cursor",style:{backgroundColor:`hsl(${o.hsv.h}, 100%, 50%)`,left:f.x}})}),e("div",{className:"color-picker-color",style:{backgroundColor:o.hex}})]})}function L5({className:t,style:n,onChange:r,children:o}){const i=s(null),a=s(!1),l=e=>{if(i.current){const{current:t}=i,{width:n,height:o,left:a,top:s}=t.getBoundingClientRect(),l=function(e){let t=1;if(function(){if(void 0===v1){const e=document.createElement("div");e.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(e);const t=e.getBoundingClientRect();e.style.setProperty("zoom","2"),v1=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return v1}())for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t}(t),c=I5(e.clientX/l-a,n,0),u=I5(e.clientY/l-s,o,0);r({x:c,y:u})}};return e("div",{ref:i,className:t,style:n,onMouseDown:e=>{if(0!==e.button)return;l(e);const t=e=>{a.current=!0,T5=!0,l(e)},n=e=>{a.current&&(T5=!1),document.removeEventListener("mousemove",t,!1),document.removeEventListener("mouseup",n,!1),l(e),a.current=!1};document.addEventListener("mousemove",t,!1),document.addEventListener("mouseup",n,!1)},children:o})}function I5(e,t,n){return e>t?t:e<n?n:e}function z5(e){if(!e.startsWith("#")){const t=document.createElement("canvas").getContext("2d");if(!t)throw new Error("2d context not supported or canvas already initialized");return t.fillStyle=e,t.fillStyle}return 4===e.length||5===e.length?(e=e.split("").map(((e,t)=>t?e+e:"#")).join(""),e):7===e.length||9===e.length?e:"#000000"}function R5(e){const t=(e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((e,t,n,r)=>"#"+t+t+n+n+r+r)).substring(1).match(/.{2}/g)||[]).map((e=>parseInt(e,16)));return{b:t[2],g:t[1],r:t[0]}}function $5({r:e,g:t,b:n}){e/=255,t/=255,n/=255;const r=Math.max(e,t,n),o=r-Math.min(e,t,n);return{h:o?60*(r===e?(t-n)/o+(t<n?6:0):r===t?2+(n-e)/o:4+(e-t)/o):0,s:r?o/r*100:0,v:100*r}}function F5({b:e,g:t,r:n}){return"#"+[n,t,e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function j5(e,t){let n=z5("#121212"),r=R5(n),o=$5(r);if("hex"===e){n=z5(t),r=R5(n),o=$5(r)}else if("rgb"===e){r=t,n=F5(r),o=$5(r)}else if("hsv"===e){o=t,r=function({h:e,s:t,v:n}){const r=~~(e/60),o=e/60-r,i=(n/=100)*(1-(t/=100)),a=n*(1-t*o),s=n*(1-t*(1-o)),l=r%6,c=Math.round(255*[n,a,i,i,s,n][l]),u=Math.round(255*[s,n,n,a,i,i][l]);return{b:Math.round(255*[i,i,s,n,n,a][l]),g:u,r:c}}(o),n=F5(r)}return{hex:n,hsv:o,rgb:r}}const B5=r.createContext(null);function H5({children:t,className:n,onClick:o,title:i}){const a=s(null),c=r.useContext(B5);if(null===c)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:u}=c;return l((()=>{a&&a.current&&u(a)}),[a,u]),e("button",{className:`item ${n}`,onClick:o,ref:a,title:i,type:"button",children:t})}function W5({children:t,dropDownRef:n,onClose:r}){const[o,a]=u(),[s,d]=u(),h=c((e=>{a((t=>t?[...t,e]:[e]))}),[a]),p=i((()=>({registerItem:h})),[h]);return l((()=>{o&&!s&&d(o[0]),s&&s.current&&s.current.focus()}),[o,s]),e(B5.Provider,{value:p,children:e("div",{className:"dropdown",ref:n,onKeyDown:e=>{if(!o)return;const t=e.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(t)&&e.preventDefault(),"Escape"===t||"Tab"===t?r():"ArrowUp"===t?d((e=>{if(!e)return o[0];const t=o.indexOf(e)-1;return o[-1===t?o.length-1:t]})):"ArrowDown"===t&&d((e=>e?o[o.indexOf(e)+1]:o[0]))},children:t})})}function V5({colorPicker:r=!1,disabled:o=!1,buttonLabel:i,buttonAriaLabel:a,buttonClassName:c,buttonIconClassName:d,labelClassName:h,children:p,icon:f=e(Ga,{name:"chevronDown"}),stopCloseOnClickSelf:m,buttonOnClick:g}){const v=s(null),y=s(null),[b,_]=u(!1);return l((()=>{const e=y.current,t=v.current;if(b&&null!==e&&null!==t){const{top:n,left:r}=e.getBoundingClientRect();t.style.top=`${n+e.offsetHeight+4}px`,t.style.left=`${Math.min(r,window.innerWidth-t.offsetWidth-20)}px`}}),[v,y,b]),l((()=>{const e=y.current;if(null!==e&&b){const t=t=>{const n=t.target;m&&v.current&&v.current.contains(n)||e.contains(n)||_(!1)};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}}}),[v,y,b,m]),l((()=>{const e=()=>{if(b){const e=y.current,t=v.current;if(null!==e&&null!==t){const{top:n}=e.getBoundingClientRect(),r=n+e.offsetHeight+4;r!==t.getBoundingClientRect().top&&(t.style.top=`${r}px`)}}};return document.addEventListener("scroll",e),()=>{document.removeEventListener("scroll",e)}}),[y,v,b]),t(n,{children:[t("button",{type:"button",disabled:o,"aria-label":a||i,className:`toolbar-item ${!r&&"dropdownButton"} ${c}`,onClick:()=>{_(!b),g&&g()},ref:y,children:[i&&e("div",{className:h,children:i}),!r&&f]}),b&&P(e(W5,{dropDownRef:v,onClose:()=>{_(!1),y&&y.current&&y.current.focus()},children:p}),document.body)]})}function Y5({disabled:t=!1,stopCloseOnClickSelf:n=!0,color:r,onChange:o,...i}){return e(V5,{...i,colorPicker:!0,disabled:t,stopCloseOnClickSelf:n,children:e("div",{style:{position:"static",top:0,zIndex:99},children:e(A5,{color:r,onChange:o})})})}var X5;function q5({selectionFontSize:t,editor:n}){const[o,i]=r.useState(t),a=r.useCallback(((e,t)=>{const r=e=>(e||(e="15px"),`${e=e.slice(0,-2)}px`);n.update((()=>{if(n.isEditable()){const t=YQ();null!==t&&e1(t,{"font-size":e||r})}}))}),[n]);r.useEffect((()=>{i(t)}),[t]);return e(V5,{buttonOnClick:()=>{},buttonLabel:`${o}px`,children:[8,9,10,11,12,14,16,18,20,24,28,32,36,48,60,72].map((t=>e(H5,{onClick:()=>{a(String(t)+"px",null)},children:e("span",{className:"text",children:t})},t)))})}!function(e){e[e.increment=1]="increment",e[e.decrement=2]="decrement"}(X5||(X5={}));const U5={bullet:"Bulleted List",check:"Check List",code:"Code Block",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",number:"Numbered List",paragraph:"Normal",quote:"Quote"},Z5=[["Arial","Arial"],["Courier New","Courier New"],["Georgia","Georgia"],["Times New Roman","Times New Roman"],["Trebuchet MS","Trebuchet MS"],["Verdana","Verdana"],["Roboto","Roboto"]],G5=[["10px","10px"],["11px","11px"],["12px","12px"],["13px","13px"],["14px","14px"],["15px","15px"],["16px","16px"],["17px","17px"],["18px","18px"],["19px","19px"],["20px","20px"]];function K5(e){return e?"active dropdown-item-active":""}function J5({editor:n,blockType:r,disabled:o=!1}){const i=()=>{n.update((()=>{const e=YQ();NQ(e)&&t1(e,(()=>F0()))}))},a=e=>{r!==e&&n.update((()=>{t1(YQ(),(()=>j2(e)))}))};return t(V5,{disabled:o,buttonClassName:"toolbar-item block-controls",buttonIconClassName:"icon block-type "+r,buttonLabel:U5[r],buttonAriaLabel:"Formatting options for text style",children:[e(H5,{className:"item "+K5("paragraph"===r),onClick:i,children:e("span",{className:"text",children:"Normal"})}),e(H5,{className:"item "+K5("h1"===r),onClick:()=>a("h1"),children:e("span",{className:"text",children:"Heading 1"})}),e(H5,{className:"item "+K5("h2"===r),onClick:()=>a("h2"),children:e("span",{className:"text",children:"Heading 2"})}),e(H5,{className:"item "+K5("h3"===r),onClick:()=>a("h3"),children:e("span",{className:"text",children:"Heading 3"})}),e(H5,{className:"item "+K5("bullet"===r),onClick:()=>{"bullet"!==r?n.dispatchCommand(u2,void 0):i()},children:e("span",{className:"text",children:"Bullet List"})}),e(H5,{className:"item "+K5("number"===r),onClick:()=>{"number"!==r?n.dispatchCommand(d2,void 0):i()},children:e("span",{className:"text",children:"Numbered List"})}),e(H5,{className:"item "+K5("quote"===r),onClick:()=>{"quote"!==r&&n.update((()=>{t1(YQ(),(()=>I2()))}))},children:e("span",{className:"text",children:"Quote"})})]})}function Q5({editor:t,value:n,style:r}){const o=c((e=>{t.update((()=>{const t=YQ();null!==t&&e1(t,{[r]:e})}))}),[t,r]);return e(V5,{buttonOnClick:()=>{t.dispatchCommand(NZ,void 0)},buttonClassName:"toolbar-item "+r,buttonLabel:n,buttonIconClassName:"font-family"===r?"icon block-type font-family":"",buttonAriaLabel:"font-family"===r?"Formatting options for font family":"Formatting options for font size",children:("font-family"===r?Z5:G5).map((([t,i])=>e(H5,{className:`item ${K5(n===t)} ${"font-size"===r?"fontsize-item":""}`,onClick:()=>o(t),children:e("span",{className:"text",children:t})},t)))})}function e3(){return e("div",{className:"divider"})}const t3=a((({editor:n,toolbarRef:r})=>{const o=s(null),i=s(null),[a,d]=u("14px"),[h,p]=u("#000"),[f,m]=u("#fff"),[g,v]=u("Arial"),[y,b]=u("left"),[_,x]=u(!1),[w,S]=u(!1),[k,C]=u(!1),[E,M]=u(!1),[P,O]=u(!1),[T,N]=u(!1),[D,A]=u(!1),[L,I]=u(!1),[z,R]=u("paragraph"),[$,F]=u(null),j=c((()=>{const e=YQ();if(NQ(e)){const t=e.anchor.getNode();let r="root"===t.getKey()?t:m1(t,(e=>{const t=e.getParent();return null!==t&&PK(t)}));null===r&&(r=t.getTopLevelElementOrThrow());const o=r.getKey(),i=n.getElementByKey(o);C(e.hasFormat("code")),S(e.hasFormat("bold")),M(e.hasFormat("italic")),O(e.hasFormat("underline")),N(e.hasFormat("strikethrough"));const a=function(e){const t=e.anchor,n=e.focus,r=e.anchor.getNode(),o=e.focus.getNode();return r===o?r:e.isBackward()?K0(n)?r:o:K0(t)?r:o}(e),s=a.getParent();if(P5(s)||P5(a)?x(!0):x(!1),null!==i)if(F(o),c2(r)){const e=function(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}(t,r2),n=e?e.getListType():r.getListType();R(n)}else{const e=function(e){return e instanceof z2}(r)?r.getTag():r.getType();e in U5&&R(e)}let l;p(i1(e,"color","#000")),m(i1(e,"background-color","#fff")),v(i1(e,"font-family","Arial")),P5(s)&&(l=m1(a,(e=>E0(e)&&!e.isInline()))),b(E0(l)?l.getFormatType():E0(a)?a.getFormatType():s?.getFormatType()||"left")}NQ(e)&&d(i1(e,"font-size","14px"))}),[]);l((()=>h1(n.registerUpdateListener((({editorState:e})=>{e.read((()=>{j()}))})),n.registerCommand(WU,((e,t)=>(j(),!1)),1),n.registerCommand(TZ,(e=>(A(e),!1)),1),n.registerCommand(OZ,(e=>(I(e),!1)),1))),[n,j]);const B=c(((e,t)=>{n.update((()=>{const t=YQ();null!==t&&e1(t,e)}),t?{tag:"historic"}:{})}),[n]),H=c(((e,t)=>{V(e),B({color:e},t)}),[B]),W=c(((e,t)=>{Y(e),B({"background-color":e},t)}),[B]);l((()=>{V("white")}),[o]),l((()=>{Y("white")}),[i]);const V=e=>{if(!e||!o.current)return;const t=o.current.querySelectorAll("path");t[5]&&t[5].setAttribute("fill",e)},Y=e=>{if(!e||!i.current)return;const t=i.current.querySelectorAll("path");t[0]&&t[0].setAttribute("fill",e)},X=c(((e,t)=>{n.dispatchCommand(e,t)}),[]);return t("div",{className:"toolbar",ref:r,onClick:()=>{n.dispatchCommand(NZ,void 0)},children:[e("button",{disabled:!D,onClick:()=>{n.dispatchCommand(tZ,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:e(Ga,{name:"undo"})}),e("button",{disabled:!L,onClick:()=>{n.dispatchCommand(nZ,void 0)},className:"toolbar-item","aria-label":"Redo",children:e(Ga,{name:"redo"})}),e(e3,{}),e(J5,{blockType:z,editor:n}),e(e3,{}),e(Q5,{style:"font-family",value:g,editor:n}),e(e3,{}),e(q5,{selectionFontSize:a.slice(0,-2),editor:n}),e(e3,{}),e("button",{onClick:()=>{X(eZ,"bold")},className:"toolbar-item spaced "+(w?"active":""),"aria-label":"Format Bold",children:e(Ga,{name:"formatBold"})}),e("button",{onClick:()=>{X(eZ,"italic")},className:"toolbar-item spaced "+(E?"active":""),"aria-label":"Format Italics",children:e(Ga,{name:"formatItalic"})}),e("button",{onClick:()=>{X(eZ,"underline")},className:"toolbar-item spaced "+(P?"active":""),"aria-label":"Format Underline",children:e(Ga,{name:"formatUnderlined"})}),e("button",{onClick:()=>{X(eZ,"code")},className:"toolbar-item spaced "+(k?"active":""),"aria-label":"Format Underline",children:e(Ga,{name:"codeTags"})}),e("button",{onClick:()=>{X(eZ,"strikethrough")},className:"toolbar-item spaced "+(T?"active":""),"aria-label":"Format Strikethrough",children:e(Ga,{name:"strikethroughS"})}),e(e3,{}),e("button",{onClick:()=>{X(_Z,"left")},className:"toolbar-item spaced "+("left"==y?"active":""),"aria-label":"Left Align",children:e(Ga,{name:"formatAlignLeft"})}),e("button",{onClick:()=>{X(_Z,"center")},className:"toolbar-item spaced "+("center"==y?"active":""),"aria-label":"Center Align",children:e(Ga,{name:"formatAlignCenter"})}),e("button",{onClick:()=>{X(_Z,"right")},className:"toolbar-item spaced "+("right"==y?"active":""),"aria-label":"Right Align",children:e(Ga,{name:"formatAlignRight"})}),e("button",{onClick:()=>{X(_Z,"justify")},className:"toolbar-item spaced "+("justify"==y?"active":""),"aria-label":"Justify Align",children:e(Ga,{name:"formatAlignJustify"})}),e(e3,{}),e(Y5,{buttonClassName:"toolbar-item",buttonAriaLabel:"Formatting text color",buttonLabel:e(Ga,{name:"formatColorText"}),color:h,onChange:H,title:"text color"}),e(Y5,{buttonClassName:"toolbar-item",buttonAriaLabel:"Formatting background color",buttonLabel:e(Ga,{name:"formatColorFill"}),color:f,onChange:W,title:"bg color"})]})}));function n3({onChange:e}){const[t]=U2();return o.useEffect((()=>t.registerUpdateListener((({editorState:n})=>{e(n,t)}))),[t,e]),null}const r3=a((({onChange:n,placeHolder:r,...o})=>{const[i]=U2(),a=s(null),[c,d]=u(0);return l((()=>{a.current&&d(a.current.clientHeight)}),[a.current?.clientHeight,a.current?.offsetHeight]),e(B,{direction:"vertical",dimensionX:"fill",dimensionY:472,alignment:"leftTop",...o,children:t("div",{className:t5,children:[e(t3,{editor:i,toolbarRef:a}),e(c5,{contentEditable:e(f5,{className:Q2}),placeholder:r&&e("div",{className:e5,style:{top:c},children:r}),ErrorBoundary:S5}),e(n3,{onChange:n}),e(b5,{}),e(n5,{})]})})}));var o3=a((({className:n="",value:r="<p></p>",headerProps:o,description:i,onChange:a,contentProps:s,placeHolder:l})=>{const u=(e,t)=>(((e,t)=>{const n=KG(),r=h2(e,(new DOMParser).parseFromString(t,"text/html"));n.clear();try{n.append(...r)}catch{const e=F0();e.append(...r),n.append(e)}})(e,t),e),d={namespace:"RichTextInput",onError:e=>{console.error("Lexical Error:",e)},editorState:e=>u(e,r),nodes:[V0,{replace:uQ,with:e=>new V0(e.__text)},r2,G1,z2,L2,T1,$1]},h=c(((e,t)=>{e.read((()=>{const e=p2(t,null);a?.(e)}))}),[a]);return t(B,{className:`${BU} ${n}`,dimensionX:"fill",direction:"vertical",children:[o&&e(KA,{prefix:{children:o?.icon&&e(Ga,{name:o?.icon}),...o?.iconProps},root:{children:o?.label&&e(V,{children:o?.label}),...o?.labelProps},...o?.container}),e(J2,{initialConfig:d,children:e(r3,{...s,onChange:h,placeHolder:l})}),e(V,{size:"xsmall",className:`${HU}`,children:i})]})})),i3={container:"ObjectInput-module_container__JtW64",error:"ObjectInput-module_error__z1cTE",inputContainer:"ObjectInput-module_inputContainer__Kjm9k"};var a3=a((({value:n,properties:r,title:o,description:i,errorMessage:a,helperTextContainerProps:s,helperTextProps:l,onChange:c,errors:u,...d})=>{const h=_4({properties:r,value:n,onChange:c,error:u,errorClassName:i3.error,containerClassName:i3.inputContainer});return t(B,{gap:20,direction:"vertical",dimensionX:"fill",...d,className:`${d.className} ${i3.container}`,children:[o&&e(KA,{prefix:{children:e(Ga,{name:"dataObject",className:i3.icon})},root:{children:e(V,{variant:"secondary",children:o})}}),h,(a||i)&&e(se.HelperText,{alignment:"leftCenter",dimensionX:"fill",...s,className:`${i3.helperText} ${s?.className}`,children:e(V,{...l,size:"small",variant:a?"danger":"secondary",className:`${l?.className}`,children:a||i})})]})})),s3={container:"ArrayInput-module_container__pCN6T",header:"ArrayInput-module_header__v88Lg",inputHeader:"ArrayInput-module_inputHeader__YhlBU",emptyStateText:"ArrayInput-module_emptyStateText__ZHJbR"};var l3=a((({value:n,items:r,title:o,description:i,errorMessage:a,helperTextContainerProps:s,helperTextProps:l,maxItems:c,propertyKey:d,onChange:h,errors:p,minItems:f,...m})=>{const[g,v]=u(0),{inputFields:y,getDefaultValue:b}=S4({propertyKey:d,items:r,value:n,activeIndex:g,onChange:h,errors:p});return t(B,{gap:20,direction:"vertical",dimensionX:"fill",...m,className:`${m.className} ${s3.container}`,children:[t("div",{className:s3.header,children:[o&&e(KA,{className:s3.inputHeader,prefix:{children:e(Ga,{name:"ballot",className:s3.icon})},root:{children:e(V,{variant:"secondary",children:o})}}),e(ZA,{length:n?.length,active:g,maxItems:c,onChange:e=>{v(e)},onCreate:()=>{const e=[...n||[]];e?.push(n?.[g]||b()),h?.(e),v(e.length-1)},onDelete:e=>{const t=[...n||[]];t.splice(e,1),h?.(t),v(Math.max(0,e-1))}})]}),n?.length?y:e("span",{className:s3.emptyStateText,children:"Create an element to see the fields"}),e(se.HelperText,{alignment:"leftCenter",dimensionX:"fill",...s,className:`${s3.helperText} ${s?.className}`,children:e(V,{...l,size:"small",variant:a?"danger":"secondary",className:`${l?.className}`,children:a||i})})]})})),c3="ChipInput-module_chipInputContainer__wRY2y",u3="ChipInput-module_errorTextContainer__AQPXD",d3="ChipInput-module_errorText__Qw1NA";var h3,p3,f3,m3,g3,v3,y3,b3,_3,x3,w3,S3,k3,C3,E3,M3,P3,O3,T3,N3,D3,A3,L3,I3,z3,R3,$3,F3,j3=a((({label:n,placeholder:r="Enter a value than press enter",onChange:o,value:i,allowDuplicateValues:a=!1,valueType:s="string",...c})=>{const[d,h]=u(""),[p,f]=u();l((()=>{f(void 0)}),[d]),l((()=>{let e=[];"number"===s?e=i.filter((e=>!isNaN(Number(e)))).map((e=>Number(e))):(e=i.map((e=>String(e))),f(void 0)),o(e)}),[s]);return t(B,{dimensionX:"fill",direction:"wrap",alignment:"leftCenter",...c,className:`${c3} ${c.className}`,children:[i.map(((t,n)=>e(nm,{variant:"outlined",label:String(t),onDelete:()=>(e=>{const t=i.filter(((t,n)=>n!==e));o(t)})(n)},n))),e(G,{placeholder:r,value:d,onChange:e=>h(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&""!==d.trim()){e.preventDefault();const t="number"===s?Number(d.trim()):d.trim();if("number"==typeof t&&isNaN(t))return void f("Value must be a valid number");if(!a&&i.includes(t))return;const n=[...i,t];o(n),h("")}}}),e("div",{className:u3,children:p&&e(V,{className:d3,variant:"danger",children:p})})," "]})})),B3="RelationInput-module_icon__folVL",H3="RelationInput-module_text__h8Gq5",W3="RelationInput-module_select__H7bRO",V3="RelationInput-module_baseInput__9cDeK",Y3="RelationSelect-module_container__nwkcp",X3="RelationSelect-module_disabled__37hiQ",q3="RelationSelect-module_displayer__-ispL",U3="RelationSelect-module_displayerContainer__kCaoy",Z3="RelationSelect-module_selectDropdown__HAwgv",G3="RelationSelect-module_searchInputWrapper__2XT5T",K3="RelationSelect-module_searchIcon__Wpvzz",J3="RelationSelect-module_searchInput__Aihgm",Q3="RelationSelect-module_deleteIcon__l6plf",e4="RelationSelect-module_infiniteScroll__UQClb",t4="RelationSelect-module_deleteButton__9KhWk";function n4(){if(p3)return h3;return p3=1,h3=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},h3}function r4(){if(v3)return g3;v3=1;var e=function(){if(m3)return f3;m3=1;var e="object"==typeof ye&&ye&&ye.Object===Object&&ye;return f3=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return g3=n}function o4(){if(S3)return w3;S3=1;var e=function(){if(x3)return _3;x3=1;var e=/\s/;return _3=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},_3}(),t=/^\s+/;return w3=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n},w3}function i4(){if(C3)return k3;C3=1;var e=r4().Symbol;return k3=e}function a4(){if(N3)return T3;N3=1;var e=i4(),t=function(){if(M3)return E3;M3=1;var e=i4(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;return E3=function(e){var t=n.call(e,o),i=e[o];try{e[o]=void 0;var a=!0}catch(e){}var s=r.call(e);return a&&(t?e[o]=i:delete e[o]),s}}(),n=function(){if(O3)return P3;O3=1;var e=Object.prototype.toString;return P3=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return T3=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function s4(){if(I3)return L3;I3=1;var e=a4(),t=A3?D3:(A3=1,D3=function(e){return null!=e&&"object"==typeof e});return L3=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}var l4=function(){if(F3)return $3;F3=1;var e=n4(),t=function(){if(b3)return y3;b3=1;var e=r4();return y3=function(){return e.Date.now()}}(),n=function(){if(R3)return z3;R3=1;var e=o4(),t=n4(),n=s4(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt;return z3=function(s){if("number"==typeof s)return s;if(n(s))return NaN;if(t(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=t(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=e(s);var c=o.test(s);return c||i.test(s)?a(s.slice(2),c?2:8):r.test(s)?NaN:+s}}(),r=Math.max,o=Math.min;return $3=function(i,a,s){var l,c,u,d,h,p,f=0,m=!1,g=!1,v=!0;if("function"!=typeof i)throw new TypeError("Expected a function");function y(e){var t=l,n=c;return l=c=void 0,f=e,d=i.apply(n,t)}function b(e){var t=e-p;return void 0===p||t>=a||t<0||g&&e-f>=u}function _(){var e=t();if(b(e))return x(e);h=setTimeout(_,function(e){var t=a-(e-p);return g?o(t,u-(e-f)):t}(e))}function x(e){return h=void 0,v&&l?y(e):(l=c=void 0,d)}function w(){var e=t(),n=b(e);if(l=arguments,c=this,p=e,n){if(void 0===h)return function(e){return f=e,h=setTimeout(_,a),m?y(e):d}(p);if(g)return clearTimeout(h),h=setTimeout(_,a),y(p)}return void 0===h&&(h=setTimeout(_,a)),d}return a=n(a)||0,e(s)&&(m=!!s.leading,u=(g="maxWait"in s)?r(n(s.maxWait)||0,a):u,v="trailing"in s?!!s.trailing:v),w.cancel=function(){void 0!==h&&clearTimeout(h),f=0,l=p=c=h=void 0},w.flush=function(){return void 0===h?d:x(t())},w},$3}(),c4=be(l4),u4=function(e,t){return u4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},u4(e,t)};var d4=function(){return d4=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d4.apply(this,arguments)};var h4="Pixel",p4="Percent",f4={unit:p4,value:.8};function m4(e){return"number"==typeof e?{unit:p4,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:h4,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:p4,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),f4):(console.warn("scrollThreshold should be string or number"),f4)}var g4=function(e){function t(t){var n=e.call(this,t)||this;return n.lastScrollTop=0,n.actionTriggered=!1,n.startY=0,n.currentY=0,n.dragging=!1,n.maxPullDownDistance=0,n.getScrollableTarget=function(){return n.props.scrollableTarget instanceof HTMLElement?n.props.scrollableTarget:"string"==typeof n.props.scrollableTarget?document.getElementById(n.props.scrollableTarget):(null===n.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},n.onStart=function(e){n.lastScrollTop||(n.dragging=!0,e instanceof MouseEvent?n.startY=e.pageY:e instanceof TouchEvent&&(n.startY=e.touches[0].pageY),n.currentY=n.startY,n._infScroll&&(n._infScroll.style.willChange="transform",n._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},n.onMove=function(e){n.dragging&&(e instanceof MouseEvent?n.currentY=e.pageY:e instanceof TouchEvent&&(n.currentY=e.touches[0].pageY),n.currentY<n.startY||(n.currentY-n.startY>=Number(n.props.pullDownToRefreshThreshold)&&n.setState({pullToRefreshThresholdBreached:!0}),n.currentY-n.startY>1.5*n.maxPullDownDistance||n._infScroll&&(n._infScroll.style.overflow="visible",n._infScroll.style.transform="translate3d(0px, "+(n.currentY-n.startY)+"px, 0px)")))},n.onEnd=function(){n.startY=0,n.currentY=0,n.dragging=!1,n.state.pullToRefreshThresholdBreached&&(n.props.refreshFunction&&n.props.refreshFunction(),n.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame((function(){n._infScroll&&(n._infScroll.style.overflow="auto",n._infScroll.style.transform="none",n._infScroll.style.willChange="unset")}))},n.onScrollListener=function(e){"function"==typeof n.props.onScroll&&setTimeout((function(){return n.props.onScroll&&n.props.onScroll(e)}),0);var t=n.props.height||n._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;n.actionTriggered||((n.props.inverse?n.isElementAtTop(t,n.props.scrollThreshold):n.isElementAtBottom(t,n.props.scrollThreshold))&&n.props.hasMore&&(n.actionTriggered=!0,n.setState({showLoader:!0}),n.props.next&&n.props.next()),n.lastScrollTop=t.scrollTop)},n.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},n.throttledOnScrollListener=function(e,t,n,r){var o,i=!1,a=0;function s(){o&&clearTimeout(o)}function l(){var l=this,c=Date.now()-a,u=arguments;function d(){a=Date.now(),n.apply(l,u)}i||(r&&!o&&d(),s(),void 0===r&&c>e?d():!0!==t&&(o=setTimeout(r?function(){o=void 0}:d,void 0===r?e-c:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),l.cancel=function(){s(),i=!0},l}(150,n.onScrollListener).bind(n),n.onStart=n.onStart.bind(n),n.onMove=n.onMove.bind(n),n.onEnd=n.onEnd.bind(n),n}return function(e,t){function n(){this.constructor=e}u4(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(e){this.props.dataLength!==e.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(e,t){return e.dataLength!==t.prevDataLength?d4(d4({},t),{prevDataLength:e.dataLength}):null},t.prototype.isElementAtTop=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=m4(t);return r.unit===h4?e.scrollTop<=r.value+n-e.scrollHeight+1:e.scrollTop<=r.value/100+n-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=m4(t);return r.unit===h4?e.scrollTop+n>=e.scrollHeight-r.value:e.scrollTop+n>=r.value/100*e.scrollHeight},t.prototype.render=function(){var e=this,t=d4({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),r=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return o.createElement("div",{style:r,className:"infinite-scroll-component__outerdiv"},o.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&o.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},o.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(S);var v4=a((({options:r,placeholder:o="Select an option",placement:a="bottom",multiple:c=!1,disabled:h=!1,maxCount:p,popupClassName:m="",optionProps:v,selectRef:y,disableClick:b,onChange:_,loadMoreOptions:x,searchOptions:w,totalOptionsLength:S,selectedOption:k,setSelectedOption:C,dropDownRef:E,portalClassName:M="",...P})=>{const[O,T]=u(!1),[N,D]=u(""),A=i((()=>c4((e=>{w(e)}),1e3)),[w]);l((()=>()=>{A.cancel()}),[A]),l((()=>{A(N)}),[N]);const L=s(null),I=()=>{b||T(!1)};Q({targetElements:[L],onClickOutside:I});const{targetPosition:z,calculatePosition:R}=ee({containerRef:L,targetRef:E,initialPlacement:a});d((()=>{O&&L.current&&E?.current&&R()}),[O,r,R]);const $=e=>{c?(()=>{if(!Array.isArray(k))return;const t=Boolean(k.find((t=>t.value===e.value&&t.label===e.label)))?k.filter((t=>t.value!==e.value)):[...k,e];C(t),_?.(t)})():(C(e),_?.(e),T(!1))};g(y,(()=>({toggleDropdown:j,clear:F})));const F=()=>{C([]),_?.([]),T(!1)},j=e=>{T(void 0===e?e=>!e:e)},W=f(),Y=null===r;return t(n,{children:[e(H,{ref:L,onClick:()=>{h||b||j()},dimensionX:"fill",dimensionY:36,...P,root:{className:U3,children:e(V,{dimensionX:"fill",style:P.root?.style,className:`${P.root?.className} ${q3}`,children:(!c||Array.isArray(k)&&k.length)&&"object"==typeof r?.[0]?k?.map?.((t=>e(nm,{variant:"outlined",label:t.label,onDelete:()=>$(t)},`${t.value}${t.label}`)))??k?.label??o:o}),dimensionX:"fill",alignment:"leftCenter"},suffix:{className:t4,onClick:e=>{e.stopPropagation(),C(c?[]:null)},children:e(Ga,{className:Q3,name:"delete",size:"sm"})},className:`${P.className} ${Y3} ${h&&X3}`}),O&&e(Gm,{onClickOutside:I,className:M,children:e(B,{ref:E,style:{...z},className:`${m} ${Z3}`,direction:"vertical",alignment:"leftTop",gap:0,id:W,children:t(g4,{dataLength:r?.length||0,next:()=>{Y||x()},hasMore:S>(r?.length||0),loader:e(_s,{size:"small"}),scrollableTarget:W,className:e4,children:[e("div",{className:G3,children:e(K,{gap:10,dimensionX:"fill",prefix:{children:e(Ga,{name:"magnify",className:K3})},inputProps:{placeholder:"Search",value:N,onChange:e=>D(e.target.value)},suffix:{children:Y?e(_s,{size:"small"}):null},className:J3})}),r?.map((t=>{const n="object"==typeof t?t.value:t,r=c?Array.isArray(k)&&Boolean(k.find((e=>e.value===t.value&&e.label===t.label))):k===t,o=c&&!!p&&Array.isArray(k)&&k.length>=p&&!r;return e(tg,{disabled:o,dimensionX:L.current?.offsetWidth,multiple:c,option:t,selected:r,onClick:()=>$(t),...v},n.toString())}))]})})})]})}));var y4=a((({label:t,description:n,value:r,onChange:o,selectProps:i,inputContainerClassName:a,getOptions:c,loadMoreOptions:d,searchOptions:h,totalOptionsLength:p,multiple:f,externalDropdownRef:m,...v})=>{const y=s(null),b=s(null),[_,x]=u(null),[w,S]=u((()=>r||(f?[]:null)));l((()=>{(r||0===r||""===r)&&S(r)}),[r]);l((()=>{c().then((e=>x(e)))}),[]);return g(i?.selectRef??{current:null},(()=>y.current)),g(m??{current:null},(()=>b.current)),e(pe,{dimensionX:"fill",description:n,dropDownRef:b,onFocusChange:e=>{y?.current?.toggleDropdown(e)},labelProps:{dimensionX:"hug",divider:!0,prefix:{children:e(Ga,{className:B3,name:"callMerge"})},root:{dimensionX:"hug",children:e(V,{className:H3,size:"medium",children:t})}},inputContainerProps:{className:`${V3} ${a}`},...v,children:e(v4,{totalOptionsLength:p,disableClick:!0,options:_,placeholder:"",multiple:f,onChange:e=>{o?.(e)},...i,selectRef:y,className:`${W3} ${i?.className}`,loadMoreOptions:()=>{d().then((e=>x([..._??[],...e])))},searchOptions:e=>{h(e).then((e=>{x(e)}))},selectedOption:w,setSelectedOption:S,dropDownRef:b})})}));const b4={string:t=>e(nq,{label:t.title,description:t.description,inputContainerClassName:t.className,value:t.value,options:t.enum,onChange:e=>{t.onChange?.({key:t.key,value:e})}}),number:t=>e(lq,{label:t.title,description:t.description,inputContainerClassName:t.className,value:t.value,options:t.enum,onChange:e=>t.onChange?.({key:t.key,value:e})}),textarea:t=>e(fq,{title:t.title,containerProps:{className:t.className},value:t.value,onChange:e=>t.onChange?.({key:t.key,value:e.target.value}),icon:t.icon??"formatSize",placeholder:t.placeholder}),date:t=>e(xq,{label:t.title,description:t.description,inputContainerClassName:t.className,value:t.value,onChange:e=>t.onChange?.({key:t.key,value:e})}),boolean:t=>e(kq,{checked:t.value,label:t.title,description:t.description,containerProps:{dimensionX:"fill"},onChange:e=>t.onChange?.({key:t.key,value:e}),size:t.size,className:t.className}),color:t=>e(Eq,{label:t.title,description:t.description,inputContainerClassName:t.className,value:t.value,onChange:e=>t.onChange?.({key:t.key,value:e})}),storage:t=>e(TU,{onUpload:()=>{},label:t.title,containerProps:{className:t.className}}),multiselect:t=>e(IU,{label:t.title,description:t.description,inputContainerClassName:t.className,value:t.value,options:t.enum,onChange:e=>t.onChange?.({key:t.key,value:e})}),location:t=>{if(MV.api.isTypeLocation(t.value)){const e=t?.value.coordinates;t.value={lat:e[1],lng:e[0]}}return e(jU,{title:t.title,dimensionX:"fill",coordinates:t.value,onChange:e=>{let n=e;MV.api.isTypeLocation(t.value)&&(n={type:"Point",coordinates:[e.lng,e.lng]}),t.onChange?.({key:t.key,value:n})},className:t.className})},richtext:t=>e(o3,{headerProps:{label:t.title,icon:"formatAlignCenter"},value:t.value,onChange:e=>t.onChange?.({key:t.key,value:e}),className:t.className,placeHolder:t.placeholder}),object:t=>e(a3,{properties:t.properties,title:t.title,description:t.description,value:t.value,onChange:e=>{t.onChange?.({key:t.key,value:e})},errors:t.errors,className:t.className}),array:t=>e(l3,{title:t.title,description:t.description,value:t.value,onChange:e=>t.onChange?.({key:t.title,value:e}),minItems:t.minItems,maxItems:t.maxItems,items:t.items,propertyKey:t.key,errors:t.errors,className:t.className}),chip:t=>e(j3,{value:t.value??[],onChange:e=>{t.onChange?.({key:t.key,value:e})},valueType:t.valueType,className:t.className}),relation:t=>e(y4,{value:t.value,onChange:e=>t.onChange?.({key:t.key,value:e}),label:t.title,getOptions:t.getOptions,loadMoreOptions:t.loadMoreOptions,searchOptions:t.searchOptions,totalOptionsLength:t.totalOptionsLength,multiple:"onetomany"===t.relationType,selectProps:{popupClassName:t.popupClassName||""},className:t.className}),select:t=>e(ng,{options:t.enum,value:t.value,onChange:e=>{t.onChange?.({key:t.key,value:e})},className:t.className})},_4=({properties:n,value:r,error:o,onChange:i,containerClassName:a,errorClassName:s,typeOverrides:l})=>{const c=l?{...b4,...l}:b4,u=Boolean(a||s);return Object.entries(n).map((([n,l])=>{const d="object"==typeof r&&!Array.isArray(r);if(d&&l.renderCondition){const{field:e}=l.renderCondition,t=r[e],n=(e,n=!1)=>{if(!(e in l.renderCondition))return!1;const r=l.renderCondition[e],o=Array.isArray(r)?r.includes(t):t===r;return n?o:!o};if(n("notEquals",!0)||n("equals"))return null}const h=d?r[n]??r:r,p=o?.[n];return t("div",{style:u?void 0:{position:"relative",width:"100%"},className:a,id:l.id??void 0,children:[c[l.type]({key:n,title:l.title,description:l.description,value:h,className:l.className,properties:l.properties,enum:l.enum??l.items?.enum,minItems:l.minItems,maxItems:l.maxItems,items:l.items,onChange:e=>(e=>{const t=structuredClone(r);t[e.key]=e.value,i?.(t)})(e),getOptions:l.getOptions,loadMoreOptions:l.loadMoreOptions,searchOptions:l.searchOptions,totalOptionsLength:l.totalOptionsLength,size:l.size,valueType:l.valueType,errors:"string"==typeof p?void 0:p,icon:l.icon,placeholder:l.placeholder,relationType:l.relationType,popupClassName:l.popupClassName}),p&&"string"==typeof p&&e(V,{className:s,style:u?void 0:{position:"absolute",bottom:0,left:0,pointerEvents:"none",whiteSpace:"nowrap"},size:"xsmall",variant:"danger",children:p})]},n)}))},x4=(e,t)=>{switch(e){case"string":case"textarea":case"richtext":case"color":case"storage":case"select":case"date":default:return"";case"multiselect":case"chip":case"relation":case"array":return[];case"number":return 0;case"boolean":return!1;case"location":return{lat:0,lng:0};case"object":{if(!t)return{};const e={};return Object.entries(t).forEach((([t,n])=>{e[t]=n.default??x4(n.type,n.properties)})),e}}},w4=e=>e?x4(e.type,e.properties):"",S4=({propertyKey:e,items:t,value:n,activeIndex:r,onChange:o,errors:a})=>{const s=c((t=>{if(null===r){const r=t[e],i=[...n||[]];i.push(r),o?.(i)}else{const i=[...n||[]];r>=0&&r<i.length&&(i[r]=t[e],o?.(i))}}),[e,n,r,o]),l=i((()=>null!==r&&r>=0?n?.[r]:w4(t)),[r,n,t]);return{inputFields:_4({properties:{[e]:t},value:{[e]:l},onChange:s,error:a}),getDefaultValue:c((()=>w4(t)),[t])}},k4=({propertyKey:t,items:n,value:r,activeIndex:o,onChange:i,errors:a})=>{const{inputFields:s}=S4({propertyKey:t,items:n,value:r,activeIndex:o,onChange:i,errors:a});return e("div",{children:s})},C4=({propertyKey:n,value:r,items:o,popoverProps:i,buttonsContainerProps:a,errors:s,onChange:l})=>{const[c,d]=u(null),h=e=>{if(e>=0)d(e);else{const e=[...r||[]],t=w4(o);e.push(t);const n=e.length-1;l?.(e),d(n)}},{contentProps:p,containerProps:f,...m}=i??{},g=[GX.contentContainer,p?.className].filter(Boolean).join(" "),v=[GX.container,f?.className].filter(Boolean).join(" "),y=[GX.buttonsContainer,a?.className].filter(Boolean).join(" ");return e(jA,{contentProps:{...p,className:g},containerProps:{dimensionX:"hug",...f,className:v},...m,open:null!==c,onClose:()=>d(null),content:null===c?null:e(k4,{propertyKey:n,items:o,value:r,activeIndex:c,onChange:e=>{l?.(e)},errors:s}),children:t(B,{...a,className:y,onClick:e=>e.stopPropagation(),children:[r?.map(((n,o)=>t("div",{className:GX.itemButtonWrapper,children:[e(xs,{variant:"filled",className:GX.itemButton,onClick:()=>h(o),children:o+1}),e(xs,{variant:"filled",shape:"circle",className:GX.removeButton,onClick:e=>((e,t)=>{t.stopPropagation();const n=[...r||[]];n.splice(e,1),l?.(n),c===e?d(null):null!==c&&c>e&&d(c-1)})(o,e),children:e(Ga,{name:"close",size:"xs"})})]},JSON.stringify(n)+o))),e(xs,{variant:"filled",className:GX.itemButton,onClick:()=>h(-1),children:"+"})]})})};var E4=a((({checked:t,disabled:n=!1,containerProps:r,onChange:o})=>e(FL,{checked:t,disabled:n,...r,onChange:o}))),M4="ColorMinimized-module_colorMinimized__CnRpu",P4="ColorMinimized-module_closeIcon__SH3uo";const O4=({value:t="#000000",onClear:n,onChange:r,...o})=>{const[i,a]=u(t);return e(H,{alignment:"leftCenter",dimensionX:"fill",className:M4,...o,root:{dimensionX:"fill",alignment:"leftCenter",children:e(om,{value:i||"#000000",onChange:e=>{a(e),r?.(e)}}),...o.root},suffix:{dimensionX:"hug",alignment:"center",children:e(xs,{children:e(Ga,{name:"close"}),color:"transparent",onClick:e=>{e.preventDefault(),e.stopPropagation(),a(""),r?.(""),n?.()},className:P4}),...o.suffix}})};var T4="Date-module_minimizedDatePicker__ZIsQ7",N4="Date-module_clearButton__WMLse";const D4=({onChange:t,value:n,placeholder:r="",onClear:o,datePickerClassName:i,...a})=>e(H,{mode:"fill",dimensionX:"fill",gap:10,...a,className:`${T4} ${a.className}`,root:{alignment:"leftCenter",children:e(TA,{onChange:e=>{t?.(new Date(e))},value:n,placeholder:r,suffixIcon:null,allowClear:!1,className:i}),...a.root},suffix:{...a.suffix,children:e(xs,{variant:"text",className:N4,keepWidth:!1,onClick:o,children:e(Ga,{name:"close"})})}});var A4={container:"Location-module_container__SbKlF",iconContainer:"Location-module_iconContainer__ie0Rb",input:"Location-module_input__aoNPw",map:"Location-module_map__7pBAg"};const L4=({contentProps:t,mapProps:n,icon:r,childrenProps:o,containerProps:i,...a})=>{const s={lat:51.505,lng:-.09},c=()=>{const e=n?.coordinates;return void 0===e?.lat||void 0===e?.lng?"lat , lng":`${e.lat} , ${e.lng}`},[d,h]=u(c());l((()=>{h(c())}),[n?.coordinates]);l((()=>{const e=d.split(",");if(2===e.length){const t=Number.parseFloat(e[0].trim()),r=Number.parseFloat(e[1].trim());Number.isNaN(t)||Number.isNaN(r)||n?.onChange?.({lat:t,lng:r})}}),[d]);const p=(()=>{const e=n?.coordinates;return void 0===e?.lat||void 0===e?.lng?s:e})(),f=`${p.lat}-${p.lng}`;return e(jA,{content:e(_L,{...n,coordinates:p},f),contentProps:{dimensionX:500,dimensionY:500,...t},containerProps:{dimensionX:"fill",alignment:"leftCenter",...a},children:e(H,{dimensionX:"fill",dimensionY:"fill",...o,prefix:{children:o?.prefix?.children||r||e("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAStSURBVHgBNZXZblNXFIa/vc88+NiJDSEDbQCVAheFtmp7Gy6rSn2DCt4EeBLKG7TqZWmLVKnTRYWYKYiEEEicxLN9Jp+hK1HrC8vS2fv3Wv//rXUU/312Nx9uGOX0Bv7SlbmyW7b2QZdoDXmeQtylceI8tVLM0py86hIYJ+S5cW8WZ3fW1pa/PdLRR19v3nZvaEP/YoTLG4YVtOqqJi9SLMvCMCx6xiLa7ZDOC+bJmHI+J8JBGyazWm9MDPv2aDC4caSl9rf/ua6CpduHB29ZbjfI0plcblOWFVVV4jgO6XgHb/FDxsNXNO0BuXkRRSVnE6Iokg5y/EZAnGRXda7Da249YNHJMFVFXLnU6SF2+gZbxPKyxMgz4ne/49cz4omW50+xzJoojKAqjkV7ewcU2eCoUzbmuknlnqJyOijtYPonmCQlbtlDpT3Mk5cIVj6j4dr0sgbKWiGb9hjvP+Ggsnk2vkvXtuR8fkUXtke31JhOiJo+xCKlloY6731EYp2iNCrqKiOdxsTa4PTpBfG1RWNhjR3W8fM9DruXOa96cjdpaX/2F6eNXNT7TNOGpCfe1TCZTnDj54TBCvnoLWbyGNc9g22kFJNX9AcDLi7GmFLMpeaUF1NFXQ+PqOgwiAUDmkyjAwlkJh71cE3FVhxiJZuYhiJc/Zy0/4j9vRzHRAiwGcYllBkT3SF0FIV7BT1q+RSNV9jvDkjdEfs//UyjIW2l2zR1we4sIBTzi8Mn1NK+b045tN4nEYSWFlfpiWjW32IhOMVQyFDx+LB+Mv2R7laMvXyednOPTtLBitaxYxO7OGSSG6T+Kg1x94/9LT5ZXJaEHeQ+2bwWOiTsWjDKp+g98adSmtUPPLQK2f1tzNwLYWygLZ+tbJWWM6TtxMyLgqvtjNCV9mqDWe81kSN2yW872yEIIrEssvGtWgy1aHnPWPyiZC118X1P0jRZ05tgn4XZA3TRozaXUZl4rQyiwOegPwRTYLdOUo3fSBEJ7L8uhPIea/PzXDS/oT89IJ92mXc3qU4uSVtjDOsCDf0dOE10uI4pQ5taS2JCSDbSUrUWQhRq1N+p8/gxufqYTNKsy23aoSyB8XNs8bE/eSZXouMRHFVtPIF72uvRkJQzDEaNB0LFpzSLMVomSeeZhW+sYlYDOsU2C95ZOSZGuzvUkx9E6k9s3UfZDsXua8q8ZjP4ntL1sSUYZ3SBllHiWTliMdpTu8Ot+RC3tYIKOpTJSxw1ocjXwbNR5QYzfYZR4tE6u0JcxLjJ15LsRCDWMq4e+4WUIEi6koWudXg/8FpiiJibTlDmEv3cl5FzmeuvKKJz2FYkocnqqiMCqXSpesvr0V1I9jlhx6waM6Z5iXIX7mnZELeMapm/5y0m1iqW25Iqh7LzKvrDEVb2lJkcbmbPcPNNHFth2Gu0/S+Zy0zX6qjNNkoKGMTGHXW8rV/8elPbizfyiQhYEozhSJoRbVv+GZNhXdO0lmXBCsj9lwJ1QC5UmAJ4NRCULNmFur517v3LN9X/r4Cd7Z3rbmhfc73mxmzvEZl7lrDcoTQXZOUlx0h4ns8wS3D8JXQWY6hiWCSj+0Fr/dbCgnfvSOdfUypD2h2KlUYAAAAASUVORK5CYII=",alt:"location",className:A4.icon}),className:A4.iconContainer},root:{children:e(G,{value:d,onChange:e=>{const t=e.target.value;(""===t||/^-?\d*\.?\d*\s*,\s*-?\d*\.?\d*$/.test(t))&&h(t)},dimensionY:"fill",className:A4.input}),dimensionX:"fill",dimensionY:"fill",className:o?.root?.className},className:`${A4.container} ${o?.className}`})})};var I4="MultiSelection-module_multiSelectionContainer__tUi2u",z4="MultiSelection-module_multiSelect__SA5u-";const R4=({options:t,value:n,onChange:r,selectProps:o,...i})=>{const a=s(null);return e(H,{mode:"fill",dimensionX:"fill",root:{children:e(ng,{selectRef:a,prefix:{children:e(Ga,{name:"chevronDown"})},suffix:{children:Array.isArray(n)&&n.length>0&&e(xs,{variant:"text",keepWidth:!1,onClick:e=>{e.preventDefault(),e.stopPropagation(),a?.current?.clear()},children:e(Ga,{name:"close"})})},multiple:!0,options:t,value:n,onChange:e=>r?.(e),...o,className:z4})},...i,className:`${I4} ${i.className}`})};var $4="NumberMinimized-module_numberMinimized__o1ZAN",F4="NumberMinimized-module_select__yHQXe",j4="NumberMinimized-module_closeIcon__EgNTI";var B4=a((({onClear:t,value:n,options:r,inputProps:o,onChange:i,...a})=>{const l=s(null),c=s(null);return e(H,{alignment:"leftCenter",dimensionX:"fill",className:$4,...a,root:{dimensionX:"fill",alignment:"leftCenter",children:r?e(ng,{selectRef:l,className:F4,placeholder:void 0!==n?String(n):"",value:n,options:r||[],onChange:e=>i?.(e)}):e(G,{ref:c,value:n??"",type:"number",...o,onChange:e=>i?.(Number(e.target.value))}),...a.root},suffix:{dimensionX:"hug",alignment:"center",children:e(xs,{children:e(Ga,{name:"close"}),color:"transparent",onClick:e=>{e.preventDefault(),e.stopPropagation(),t?.(),l.current&&l.current.clear(),c.current&&(c.current.value="")},className:j4}),...a.suffix}})})),H4="Object-module_inputMinimized__JH1n-",W4="Object-module_contentContainer__y0Sfp",V4="Object-module_value__SJt70";const Y4=({value:t,popoverProps:n,objectInputProps:r,properties:o,onChange:a,...s})=>{const l=i((()=>((e,t)=>{const n=Object.keys(t);return Object.fromEntries(n.map((t=>[t,e?.[t]])))})(t,o)),[t,o]),{contentProps:c,containerProps:u,...d}=n??{};return e(jA,{contentProps:{className:W4,...c},containerProps:{dimensionX:"fill",...u},...d,content:e(a3,{properties:o,value:t,onChange:e=>a?.(e),...r}),children:e(B,{dimensionX:"fill",alignment:"leftCenter",dimensionY:36,...s,className:`${s.className} ${H4}`,children:e(V,{className:V4,children:JSON.stringify(l)})})})};var X4="RichText-module_richTextMinimized__LUAfH",q4="RichText-module_richTextContent__F9RzT",U4="RichText-module_placeholder__p7vgx";var Z4=a((({value:n,richTextProps:r,placeHolder:o,onChange:i,onCancel:a,onSave:s,...d})=>{const[h,p]=u(n??""),[f,m]=u(!1);l((()=>{f||p(n??"")}),[f,n]);const g=c((e=>{p(e)}),[]),v=c((()=>{p(n??""),m(!0)}),[n]),y=c((()=>{m(!1),p(n??"")}),[n]),b=c((()=>{y(),a?.()}),[y,a]),_=c((()=>{i?.(h),m(!1),s?.(h)}),[h,i,s]),x=n&&""!==n.trim()&&"<p></p>"!==n,{onClick:w,...S}=d,k=c((e=>{w?.(e),v()}),[v,w]);return e(jA,{content:t(B,{direction:"vertical",gap:10,children:[e(o3,{value:h,contentProps:r,placeHolder:o,onChange:g}),t(B,{dimensionX:"fill",alignment:"rightBottom",gap:10,children:[e(xs,{variant:"filled",onClick:b,children:"Cancel"}),e(xs,{variant:"solid",onClick:_,children:"Save"})]})]}),containerProps:{dimensionX:"fill"},open:f,onClose:y,children:e(B,{dimensionX:"fill",alignment:"leftCenter",className:X4,onClick:k,...S,children:e("div",x?{className:q4,dangerouslySetInnerHTML:{__html:n||""}}:{className:q4,children:"string"==typeof o?e("span",{className:U4,children:o}):o})})})})),G4="StringMinimized-module_stringMinimized__m53JQ",K4="StringMinimized-module_select__uPgy-",J4="StringMinimized-module_closeIcon__N2ycP";var Q4=a((({onClear:t,value:n,options:r,inputProps:o,enumOnChange:i,...a})=>e(H,{alignment:"leftCenter",dimensionX:"fill",className:G4,...a,root:{dimensionX:"fill",alignment:"leftCenter",children:r?e(ng,{className:K4,placeholder:n||" ",options:r||[],onChange:e=>i?.(String(e))}):e(G,{value:n,...o}),...a.root},suffix:{dimensionX:"hug",alignment:"center",children:e(xs,{children:e(Ga,{name:"close"}),color:"transparent",onClick:t,className:J4}),...a.suffix}}))),e6="TextArea-module_textArea__VbAA6";const t6=({value:t,onClear:n,onChange:r,focusedRows:o=3,onFocus:i,onBlur:a,rows:l=2,cols:c=1,...d})=>{const[h,p]=u(!1),f=s(null);return Q({targetElements:[f],onClickOutside:()=>{p(!1),a?.(!1)}}),e(H,{ref:f,mode:"fill",dimensionX:"fill",prefix:d.prefix,root:{children:e("textarea",{value:t,onChange:e=>r?.(e.target.value),onFocus:()=>{p(!0),i?.(!0)},rows:h?Math.max(o,l):l,cols:c}),...d.root},suffix:{children:e(xs,{variant:"icon",color:"transparent",onClick:n,children:e(Ga,{name:"close"})}),...d.suffix},className:`${e6} ${d.className}`})};var n6="StorageMinimized-module_storageMinimized__ghk8k",r6="StorageMinimized-module_storage__QZPz8",o6="StorageMinimized-module_text__kRTzX";const i6=({file:n,placeholder:r="Click or Drag & Drop",onUpload:o,onClickShowFileSelect:i,onDelete:a,...l})=>{const c=s(null);return e(H,{ref:c,alignment:"leftCenter",dimensionX:"fill",mode:"fill",root:{children:e(EU,{multiple:!1,onDrop:e=>{e.length&&o?.(e[0])},children:({getRootProps:o,getInputProps:a})=>t(B,{className:r6,alignment:"leftCenter",dimensionX:"fill",gap:10,...o(),onClick:()=>{i?.()},children:[e(Ga,{name:"storage",size:14}),e(V,{className:o6,children:n?n.name:r}),e("input",{...a()})]})})},suffix:{children:n&&e(xs,{variant:"icon",children:e(Ga,{name:"close"}),color:"transparent",onClick:a})},...l,className:`${l.className} ${n6}`})};var a6=a((({selectClassName:t="",label:n="",options:r=[],onChange:o,...i})=>e(B,{...i,dimensionX:"fill",alignment:"leftCenter",children:e(ng,{className:t,placeholder:n,options:r,onChange:o||(()=>{})})}))),s6={drawerContainer:"Drawer-module_drawerContainer__ygAhi",contentContainer:"Drawer-module_contentContainer__Bku-Q",closeButton:"Drawer-module_closeButton__dw57X",leftPosition:"Drawer-module_leftPosition__kS7SQ",scrollableContent:"Drawer-module_scrollableContent__gAaIU",top:"Drawer-module_top__YhWtK",bottom:"Drawer-module_bottom__5nFWz",xs:"Drawer-module_xs__jAtGZ",sm:"Drawer-module_sm__Up7LN",md:"Drawer-module_md__cJcNU",lg:"Drawer-module_lg__c7C-6",xl:"Drawer-module_xl__r6s2-",full:"Drawer-module_full__maAwS",hug:"Drawer-module_hug__JzEGJ",left:"Drawer-module_left__NCP-V",right:"Drawer-module_right__X1qUr",leftToMiddle:"Drawer-module_leftToMiddle__UwTtm",slideFromLeft:"Drawer-module_slideFromLeft__PD3iU",rightToMiddle:"Drawer-module_rightToMiddle__-1zTg",slideFromRight:"Drawer-module_slideFromRight__y-9Lp",topToBottom:"Drawer-module_topToBottom__DlPXA",slideFromTop:"Drawer-module_slideFromTop__-c93O",bottomToTop:"Drawer-module_bottomToTop__b0ULm",slideFromBottom:"Drawer-module_slideFromBottom__uSm8d",shake:"Drawer-module_shake__pBbnG"};const l6=["xs","sm","md","lg","xl","full","hug"],c6=({placement:n,size:r="hug",children:o,showBackdrop:i=!0,backdropType:a="default",backdropClassName:s,backdropProps:c,showCloseButton:d=!0,isOpen:h=!1,onClose:p,portalClassName:f,contentClassName:m,scrollableContentClassName:g})=>{const[v,y]=u(h),[b,_]=u(!1),[x,w]=u(!1);l((()=>{y(h)}),[h]);const S=()=>{y(!1),p&&p()};if(!v)return null;const k={top:"topToBottom",right:"rightToMiddle",bottom:"bottomToTop",left:"leftToMiddle"}[n],C="number"==typeof r||"string"==typeof r&&!l6.includes(r),E=C?"left"===n||"right"===n?{width:"number"==typeof r?`${r}px`:r}:{height:"number"==typeof r?`${r}px`:r}:{};return e(Gm,{className:f,children:t(B,{className:s6.drawerContainer,children:[e(FA,{showBackdrop:i,...c,className:s,onClick:()=>{"static"===a?(_(!0),w(!1),setTimeout((()=>{_(!1),w(!0)}),400)):S()}}),t("div",{className:`${s6.contentContainer} ${x?"":s6[k]} ${b?s6.shake:""} ${s6[n]} ${C?"":s6[r]} ${m||""}`,style:E,children:[d&&e(xs,{className:`${s6.closeButton} ${"right"===n?s6.leftPosition:s6.rightPosition}`,onClick:S,children:e(Ga,{name:"close"}),variant:"icon"}),e("div",{className:`${s6.scrollableContent} ${g||""}`,children:o})]})]})})};var u6={container:"Tab-module_container__e6CN6",indicator:"Tab-module_indicator__UNCf0",item:"Tab-module_item__jpQZh",default:"Tab-module_default__qy-23",active:"Tab-module_active__687wz",underline:"Tab-module_underline__1gKBc",window:"Tab-module_window__vPuG0",root:"Tab-module_root__gGJhw"};var d6=a((({type:n="default",items:r,indicatorClassName:o,indicatorMode:i="equal",value:a,onChange:c,...d})=>{const[h,p]=u(0),[f,m]=u([]),g=s(null),v=s([]);l((()=>{(a||0===a)&&p(a)}),[a]);l((()=>{const e=v.current.map((e=>(e?.offsetWidth||0)+("window"===n?5:20)));m(e)}),[r,i,n]);const y="fit"===i?f[h]||0:f[h]-2,b=f.slice(0,h).reduce(((e,t)=>e+t-5),0);return t(B,{ref:g,dimensionX:"fill",gap:"window"===n?0:20,...d,className:`${u6.container} ${u6[n]} ${d.className||""}`,children:["window"!==n&&e("div",{className:`${u6.indicator} ${o||""}`,style:{width:y,left:b}}),r.map(((t,r)=>e(H,{ref:e=>v.current[r]=e,dimensionX:"equal"===i?"fill":"hug",dimensionY:"fill",mode:"middle",prefix:{children:t.prefix?.children,...t.prefix,className:`${t.prefix?.className||""}`},root:{children:t.root?.children,...t.root,className:`${u6.root} ${t.root?.className||""}`},suffix:{children:t.suffix?.children,...t.suffix,className:`${t.suffix?.className||""}`},onClick:()=>(e=>{p(e),c?.(e)})(r),...t,className:`${u6.item} ${u6[n]} ${r===h?u6.active:""}`},r)))]})})),h6={container:"CircularProgress-module_container__S-38y",svg:"CircularProgress-module_svg__gon7t",backgroundCircle:"CircularProgress-module_backgroundCircle__MQZ2z",progressCircle:"CircularProgress-module_progressCircle__aya2S",normal:"CircularProgress-module_normal__asGeP",success:"CircularProgress-module_success__F6h9t",danger:"CircularProgress-module_danger__POA1X",centerText:"CircularProgress-module_centerText__SKGzM",xxs:"CircularProgress-module_xxs__EO7l5",xs:"CircularProgress-module_xs__WVADp",sm:"CircularProgress-module_sm__yLhUL",md:"CircularProgress-module_md__5RBcj",lg:"CircularProgress-module_lg__mzdQa",xl:"CircularProgress-module_xl__tuBt-"};const p6={xxs:25,xs:40,sm:60,md:80,lg:100,xl:120},f6={xxs:"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"},m6={success:"check",danger:"close",normal:void 0},g6=({percent:n=0,size:r="md",strokeWidth:o=6,showLabel:i=!0,status:a="normal",label:s})=>{const l=p6[r],c=(l-o)/2,u=2*Math.PI*c,d=Math.min(Math.max(n,0),100),h=u-d/100*u,p=m6[a],f=f6[r];return t("div",{className:h6.container,style:{width:l,height:l},children:[t("svg",{className:h6.svg,width:l,height:l,children:[e("circle",{className:h6.backgroundCircle,cx:l/2,cy:l/2,r:c,strokeWidth:o}),e("circle",{className:`${h6.progressCircle} ${h6[a]}`,cx:l/2,cy:l/2,r:c,strokeWidth:o,strokeDasharray:u,strokeDashoffset:h})]}),i&&e("div",{className:`${h6.centerText} ${h6[a]} ${h6[r]}`,children:void 0!==s?s:p?e(Ga,{name:p,size:f}):`${Math.round(d)}%`})]})};var v6;!function(e){e.camelToKebab=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e.deepCopy=e=>JSON.parse(JSON.stringify(e)),e.capitalize=e=>e.charAt(0).toUpperCase()+e.slice(1)}(v6||(v6={}));const y6={light:{primary:"#1976d2",primaryLight:"#63a4ff",primaryDark:"#004ba0",danger:"#d32f2f",dangerLight:"#ff6659",dangerDark:"#9a0007",success:"#388e3c",successLight:"#6abf69",successDark:"#00600f",soft:"#f5f5f5",softLight:"#ffffff",softDark:"#c2c2c2",background:"#ffffff",menuBackground:"#f0f0f0",zebra:"#f9f9f9",border:"#e0e0e0",boxShadow:"rgba(0, 0, 0, 0.1)",fontPrimary:"#212121",fontSecondary:"#757575",inputBackground:"#ffffff",inputPlaceholder:"#9e9e9e",tonalOffset:.2},dark:{primary:"#90caf9",primaryLight:"#e3f2fd",primaryDark:"#42a5f5",danger:"#ef5350",dangerLight:"#ff867c",dangerDark:"#b61827",success:"#66bb6a",successLight:"#98ee99",successDark:"#338a3e",soft:"#121212",softLight:"#1e1e1e",softDark:"#000000",background:"#121212",menuBackground:"#1e1e1e",zebra:"#181818",border:"#333333",boxShadow:"rgba(0, 0, 0, 0.5)",fontPrimary:"#ffffff",fontSecondary:"#bdbdbd",inputBackground:"#333333",inputPlaceholder:"#757575",tonalOffset:.3}},b6={PRIMARY:"#1c1c50",BACKGROUND:"#f5f5f5",MENU_BACKGROUND:"#ffffff",ZEBRA:"f6f6f9",SUCCESS:"#21f412",DANGER:"#f41212",SOFT:"#f5f5f5",BORDER:"#d4d0d0",BOX_SHADOW:"#0000000d",FONT_PRIMARY:"#525252",FONT_SECONDARY:"#525252",INPUT_BACKGROUND:"#fafafa",INPUT_PLACEHOLDER:"#9b9b9b",TONAL_OFFSET:.2},_6=5,x6=10,w6=10,S6=16,k6="Inter",C6=e=>{v6.deepCopy(e);const t=E6(e.palette?.primary||b6.PRIMARY,e.palette?.tonalOffset),n=E6(e.palette?.success||b6.SUCCESS,e.palette?.tonalOffset),r=E6(e.palette?.danger||b6.DANGER,e.palette?.tonalOffset),o=E6(e.palette?.soft||b6.SOFT,e.palette?.tonalOffset),i=e.borderRadius?.base??_6,a=e.padding?.base??x6,s=e.gap?.base??w6,l=e.palette?.mode,c=l?y6[l]:void 0,u=(t,n)=>e.palette?.[t]||c?.[t]||n,d=(t,n)=>e.borderRadius?.[t]??i*n,h=(t,n)=>e.padding?.[t]??s*n,p=(t,n)=>e.gap?.[t]??a*n,f={palette:{primary:u("primary",t.base),primaryLight:u("primaryLight",t.light),primaryDark:u("primaryDark",t.dark),danger:u("danger",r.base),dangerLight:u("dangerLight",r.light),dangerDark:u("dangerDark",r.dark),success:u("success",n.base),successLight:u("successLight",n.light),successDark:u("successDark",n.dark),soft:u("soft",o.base),softLight:u("softLight",o.light),softDark:u("softDark",o.dark),background:u("background",b6.BACKGROUND),menuBackground:u("menuBackground",b6.MENU_BACKGROUND),zebra:u("zebra",b6.ZEBRA),border:u("border",b6.BORDER),boxShadow:u("boxShadow",b6.BOX_SHADOW),fontPrimary:u("fontPrimary",b6.FONT_PRIMARY),fontSecondary:u("fontSecondary",b6.FONT_SECONDARY),inputBackground:u("inputBackground",b6.INPUT_BACKGROUND),inputPlaceholder:u("inputPlaceholder",b6.INPUT_PLACEHOLDER),tonalOffset:u("tonalOffset",b6.TONAL_OFFSET)},borderRadius:{sm:d("sm",.6),md:d("md",1),lg:d("lg",2)},padding:{xs:h("xs",.25),sm:h("sm",.5),md:h("md",1),lg:h("lg",1.5),xl:h("xl",2)},gap:{xs:p("xs",.25),sm:p("sm",.5),md:p("md",1),lg:p("lg",1.5),xl:p("xl",2)},fontSize:e.fontSize||S6,fontFamily:e.fontFamily||k6};return(e=>{const t=document.documentElement,n=(e,n)=>{Object.entries(e).forEach((([e,r])=>{const o=v6.camelToKebab(e);if("string"==typeof r&&r.startsWith("#")){const e=MV.color.hexToRgb(r);t.style.setProperty(`--${n}-${o}-rgb`,e)}t.style.setProperty(`--${n}-${o}`,r)}))};n(e.palette,"color"),n(e.borderRadius,"border-radius"),n(e.padding,"padding"),n(e.gap,"gap"),t.style.setProperty("--oziko-font-size-base",`${e.fontSize}px`),t.style.setProperty("--oziko-font-family-base",e.fontFamily)})(f),f},E6=(e,t=.2)=>{const{h:n,s:r,l:o}=MV.color.hexToHSL(e),i="number"==typeof t?t:t.light,a="number"==typeof t?t:t.dark;return{base:e,light:MV.color.hslToHex(n,r,Math.min(1,o+i)),dark:MV.color.hslToHex(n,r,Math.max(0,o-a))}},M6=m(void 0),P6=()=>{const e=p(M6);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};var O6,T6,N6;!function(e){e.isTypeLocation=e=>"object"==typeof e&&null!==e&&"string"==typeof e.type&&Array.isArray(e.coordinates)&&2===e.coordinates.length&&e.coordinates.every((e=>"number"==typeof e))}(O6||(O6={})),function(e){e.hexToHSL=e=>{let t=0,n=0,r=0;if(4===e.length)t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16);else{if(7!==e.length)throw new Error("Invalid HEX format");t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16)}t/=255,n/=255,r/=255;const o=Math.max(t,n,r),i=Math.min(t,n,r);let a=0,s=0,l=(o+i)/2;if(o!==i){const e=o-i;switch(s=l>.5?e/(2-o-i):e/(o+i),o){case t:a=(n-r)/e+(n<r?6:0);break;case n:a=(r-t)/e+2;break;case r:a=(t-n)/e+4}a/=6}return{h:a,s:s,l:l}},e.hslToHex=(e,t,n)=>{const r=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e);let o,i,a;if(0===t)o=i=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=r(l,s,e+1/3),i=r(l,s,e),a=r(l,s,e-1/3)}return`#${Math.round(255*o).toString(16).padStart(2,"0")}${Math.round(255*i).toString(16).padStart(2,"0")}${Math.round(255*a).toString(16).padStart(2,"0")}`}}(T6||(T6={})),function(e){e.timeUnitsInSeconds={second:1,minute:60,hour:3600,day:86400,week:604800,month:2592e3,quarter:7776e3,year:31536e3},e.unitMapper=e=>e<=10?"second":e<=120?"minute":e<=2160?"hour":e<=43200?"day":e<=50400?"week":e<=1296e3?"month":e<=9331200?"quarter":"year",e.getDiffInMinutes=(e,t)=>Math.abs(t.getTime()-e.getTime())/6e4,e.formatDateToEnUs=e=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}).format(e)}(N6||(N6={}));export{eI as Accordion,l3 as ArrayInput,C4 as ArrayMinimizedInput,te as Autocomplete,FA as Backdrop,pe as BaseInput,kq as BooleanInput,E4 as BooleanMinimizedInput,es as BucketFieldPopup,xs as Button,Zf as Chart,em as Checkbox,nm as Chip,j3 as ChipInput,g6 as CircularProgress,om as Color,Eq as ColorInput,O4 as ColorMinimizedInput,og as ColorPicker,kX as Dashboard,fg as DashboardItem,xq as DateInput,D4 as DateMinimizedInput,TA as DatePicker,BA as Directory,c6 as Drawer,ZA as DropList,a6 as EnumInput,B as FlexElement,H as FluidContainer,Ga as Icon,G as Input,KA as InputHeader,K as InputWithIcon,QA as Json,qm as LayerManagerProvider,Y as ListItem,nL as ListRow,jU as LocationInput,L4 as LocationMinimizedInput,_L as Map,OX as MenuGroup,PL as Modal,IU as MultipleSelectionInput,R4 as MultipleSelectionMinimizedInput,rI as NavigatorItem,UX as NotificationProvider,lq as NumberInput,B4 as NumberMinimizedInput,a3 as ObjectInput,Y4 as ObjectMinimizedInput,jA as Popover,Gm as Portal,y4 as RelationInput,o3 as RichTextInput,Z4 as RichTextMinimizedInput,pg as Section,ng as Select,tg as SelectOption,_s as Spinner,lI as SsoButton,LL as StorageFileCard,W$ as StorageFilter,TU as StorageInput,i6 as StorageMinimizedInput,nq as StringInput,Q4 as StringMinimizedInput,FL as Switch,d6 as Tab,jX as Table,V as Text,fq as TextAreaInput,t6 as TextAreaMinimizedInput,TV as Timeline,BL as Title,O6 as apiUtil,T6 as colorUtil,C6 as createTheme,J as handledClickOutsideEvents,v6 as helperUtils,N6 as timeUtil,ee as useAdaptivePosition,_4 as useInputRepresenter,zA as useKeyDown,Zm as useLayer,ZX as useNotification,Q as useOnClickOutside,P6 as useTheme};
99
+ */e.exports&&(e.exports=t),void 0!==ye&&(ye.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(e,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var o={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};o["language-"+n]={pattern:/[\s\S]+/,inside:t.languages[n]};var i={};i[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:o},t.languages.insertBefore("markup","cdata",i)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(e,n){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:t.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(void 0!==t&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var e={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},n="data-src-status",r="loading",o="loaded",i="pre[data-src]:not(["+n+'="'+o+'"]):not(['+n+'="'+r+'"])';t.hooks.add("before-highlightall",(function(e){e.selector+=", "+i})),t.hooks.add("before-sanity-check",(function(a){var s=a.element;if(s.matches(i)){a.code="",s.setAttribute(n,r);var l=s.appendChild(document.createElement("CODE"));l.textContent="Loading…";var c=s.getAttribute("data-src"),u=a.language;if("none"===u){var d=(/\.(\w+)$/.exec(c)||[,"none"])[1];u=e[d]||d}t.util.setLanguage(l,u),t.util.setLanguage(s,u);var h=t.plugins.autoloader;h&&h.loadLanguages(u),function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400&&r.responseText?t(r.responseText):r.status>=400?n(function(e,t){return"✖ Error "+e+" while fetching file: "+t}(r.status,r.statusText)):n("✖ Error: File does not exist or is empty"))},r.send(null)}(c,(function(e){s.setAttribute(n,o);var r=function(e){var t=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e||"");if(t){var n=Number(t[1]),r=t[2],o=t[3];return r?o?[n,Number(o)]:[n,void 0]:[n,n]}}(s.getAttribute("data-range"));if(r){var i=e.split(/\r\n?|\n/g),a=r[0],c=null==r[1]?i.length:r[1];a<0&&(a+=i.length),a=Math.max(0,Math.min(a-1,i.length)),c<0&&(c+=i.length),c=Math.max(0,Math.min(c,i.length)),e=i.slice(a,c).join("\n"),s.hasAttribute("data-start")||s.setAttribute("data-start",String(a+1))}l.textContent=e,t.highlightElement(l)}),(function(e){s.setAttribute(n,"failed"),l.textContent=e}))}})),t.plugins.fileHighlight={highlight:function(e){for(var n,r=(e||document).querySelectorAll(i),o=0;n=r[o++];)t.highlightElement(n)}};var a=!1;t.fileHighlight=function(){a||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),a=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}}()}(b1)),Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&amp;/,"&"))})),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(/<inner>/g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n<r;n++){var o=t[n];if("code"===o.type){var i=o.content[1],a=o.content[3];if(i&&a&&"code-language"===i.type&&"code-block"===a.type&&"string"==typeof i.content){var s=i.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),l="language-"+(s=(/[a-z][\w-]*/i.exec(s)||[""])[0].toLowerCase());a.alias?"string"==typeof a.alias?a.alias=[a.alias,l]:a.alias.push(l):a.alias=[l]}}else e(o.content)}}(e.tokens)})),e.hooks.add("wrap",(function(t){if("code-block"===t.type){for(var n="",r=0,o=t.classes.length;r<o;r++){var i=t.classes[r],c=/language-(.+)/.exec(i);if(c){n=c[1];break}}var u,d,h=e.languages[n];if(h)t.content=e.highlight((u=t.content,d=(d=u.replace(a,"")).replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,(function(e,t){var n;if("#"===(t=t.toLowerCase())[0])return n="x"===t[1]?parseInt(t.slice(2),16):Number(t.slice(1)),l(n);var r=s[t];return r||e})),d),h,n);else if(n&&"none"!==n&&e.plugins.autoloader){var p="md-"+(new Date).valueOf()+"-"+Math.floor(1e16*Math.random());t.attributes.id=p,e.plugins.autoloader.loadLanguages(n,(function(){var t=document.getElementById(p);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}}));var a=RegExp(e.languages.markup.tag.pattern.source,"gi"),s={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(Prism),Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism),Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};t.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:t},boolean:t.boolean,variable:t.variable}}(Prism);var _1;_1||(_1=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python);var x1;x1||(x1=1,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,(function(){return t}));t=t.replace(/<self>/g,(function(){return/[^\s\S]/.source})),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism)),Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ \t]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach((function(e){e.inside.interpolation.inside=Prism.languages.swift}));var w1;w1||(w1=1,function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism));var S1;S1||(S1=1,function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism));var k1;k1||(k1=1,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)),function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const C1=globalThis.Prism||window.Prism,E1=e=>{try{return!!e&&C1.languages.hasOwnProperty(e)}catch(e){return!1}};function M1(e,t){for(const n of e.childNodes){if(IK(n)&&n.tagName===t)return!0;M1(n,t)}return!1}const P1="data-language",O1="data-highlight-language";class T1 extends C0{static getType(){return"code"}static clone(e){return new T1(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=E1(e)}createDOM(e){const t=document.createElement("code");p1(t,e.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(P1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(O1,n)),t}updateDOM(e,t,n){const r=this.__language,o=e.__language;return r?r!==o&&(t.setAttribute(P1,r),this.__isSyntaxHighlightSupported&&t.setAttribute(O1,r)):o&&(t.removeAttribute(P1),e.__isSyntaxHighlightSupported&&t.removeAttribute(O1)),!1}exportDOM(e){const t=document.createElement("pre");p1(t,e._config.theme.code),t.setAttribute("spellcheck","false");const n=this.getLanguage();return n&&(t.setAttribute(P1,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(O1,n)),{element:t}}static importDOM(){return{code:e=>null!=e.textContent&&(/\r?\n/.test(e.textContent)||M1(e,"BR"))?{conversion:D1,priority:1}:null,div:()=>({conversion:A1,priority:1}),pre:()=>({conversion:D1,priority:0}),table:e=>R1(e)?{conversion:L1,priority:3}:null,td:e=>{const t=e,n=t.closest("table");return t.classList.contains("js-file-line")||n&&R1(n)?{conversion:I1,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&R1(t)?{conversion:I1,priority:3}:null}}}static importJSON(e){return N1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage()}}insertNewAfter(e,t=!0){const n=this.getChildren(),r=n.length;if(r>=2&&"\n"===n[r-1].getTextContent()&&"\n"===n[r-2].getTextContent()&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===r){n[r-1].remove(),n[r-2].remove();const e=F0();return this.insertAfter(e,t),e}const{anchor:o,focus:i}=e,a=(o.isBefore(i)?o:i).getNode();if(_Q(a)){let e=function(e){let t=e,n=e;for(;B1(n)||kQ(n);)t=n,n=n.getPreviousSibling();return t}(a);const t=[];for(;;)if(kQ(e))t.push(SQ()),e=e.getNextSibling();else{if(!B1(e))break;{let n=0;const r=e.getTextContent(),o=e.getTextContentSize();for(;n<o&&" "===r[n];)n++;if(0!==n&&t.push(j1(" ".repeat(n))),n!==o)break;e=e.getNextSibling()}}const n=a.splitText(o.offset)[0],r=0===o.offset?0:1,i=n.getIndexWithinParent()+r,s=a.getParentOrThrow(),l=[tQ(),...t];s.splice(i,0,l);const c=t[t.length-1];c?c.select():0===o.offset?n.selectPrevious():n.getNextSibling().selectNext(0,0)}if(function(e){return e instanceof T1}(a)){const{offset:t}=e.anchor;a.splice(t,0,[tQ()]),a.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){const e=F0();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t.__isSyntaxHighlightSupported=E1(e),t}getLanguage(){return this.getLatest().__language}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}}function N1(e){return OK(new T1(e))}function D1(e){return{node:N1(e.getAttribute(P1))}}function A1(e){const t=e,n=z1(t);return n||function(e){let t=e.parentElement;for(;null!==t;){if(z1(t))return!0;t=t.parentElement}return!1}(t)?{node:n?N1():null}:{node:null}}function L1(){return{node:N1()}}function I1(){return{node:null}}function z1(e){return null!==e.style.fontFamily.match("monospace")}function R1(e){return e.classList.contains("js-file-line-container")}class $1 extends uQ{constructor(e="",t,n){super(e,n),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new $1(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e);return p1(t,F1(e.theme,this.__highlightType)),t}updateDOM(e,t,n){const r=super.updateDOM(e,t,n),o=F1(n.theme,e.__highlightType),i=F1(n.theme,this.__highlightType);return o!==i&&(o&&f1(t,o),i&&p1(t,i)),r}static importJSON(e){return j1().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return N1()}}function F1(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function j1(e="",t){return OK(new $1(e,t))}function B1(e){return e instanceof $1}var H1=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function W1(e){return n2(e)&&c2(e.getFirstChild())}function V1(e){return t2().append(e)}function Y1(e,t){e.splice(e.getChildrenSize(),0,t)}function X1(e,t){const n=e.getLastChild(),r=t.getFirstChild();n&&r&&W1(n)&&W1(r)&&(X1(n.getFirstChild(),r.getFirstChild()),r.remove());const o=t.getChildren();o.length>0&&e.append(...o),t.remove()}function q1(e){const t=new Set;if(W1(e)||t.has(e.getKey()))return;const n=e.getParent(),r=e.getNextSibling(),o=e.getPreviousSibling();if(W1(r)&&W1(o)){const n=o.getFirstChild();if(c2(n)){n.append(e);const o=r.getFirstChild();c2(o)&&(Y1(n,o.getChildren()),r.remove(),t.add(r.getKey()))}}else if(W1(r)){const t=r.getFirstChild();if(c2(t)){const n=t.getFirstChild();null!==n&&n.insertBefore(e)}}else if(W1(o)){const t=o.getFirstChild();c2(t)&&t.append(e)}else if(c2(n)){const t=t2(),i=l2(n.getListType());t.append(i),i.append(e),o?o.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function U1(e){if(W1(e))return;const t=e.getParent(),n=t?t.getParent():void 0;if(c2(n?n.getParent():void 0)&&n2(n)&&c2(t)){const r=t?t.getFirstChild():void 0,o=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(o))n.insertAfter(e),t.isEmpty()&&n.remove();else{const r=t.getListType(),o=t2(),i=l2(r);o.append(i),e.getPreviousSiblings().forEach((e=>i.append(e)));const a=t2(),s=l2(r);a.append(s),Y1(s,e.getNextSiblings()),n.insertBefore(o),n.insertAfter(a),n.replace(e)}}}function Z1(...e){const t=[];for(const n of e)if(n&&"string"==typeof n)for(const[e]of n.matchAll(/\S+/g))t.push(e);return t}class G1 extends C0{static getType(){return"listitem"}static clone(e){return new G1(e.__value,e.__checked,e.__key)}constructor(e,t,n){super(n),this.__value=void 0===e?1:e,this.__checked=t}createDOM(e){const t=document.createElement("li"),n=this.getParent();return c2(n)&&"check"===n.getListType()&&J1(t,this,null),t.value=this.__value,K1(t,e.theme,this),t}updateDOM(e,t,n){const r=this.getParent();return c2(r)&&"check"===r.getListType()&&J1(t,this,e),t.value=this.__value,K1(t,n.theme,this),!1}static transform(){return e=>{if(n2(e)||H1(144),null==e.__checked)return;const t=e.getParent();c2(t)&&"check"!==t.getListType()&&null!=e.getChecked()&&e.setChecked(void 0)}}static importDOM(){return{li:()=>({conversion:Q1,priority:0})}}static importJSON(e){return t2().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config);return t.style.textAlign=this.getFormatType(),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(E0(n)&&this.canMergeWith(n)){const e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(n2(e))return super.replace(e);this.setIndent(0);const n=this.getParentOrThrow();if(!c2(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{const t=l2(n.getListType());let r=this.getNextSibling();for(;r;){const e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}return t&&(E0(e)||H1(139),this.getChildren().forEach((t=>{e.append(t)}))),this.remove(),0===n.getChildrenSize()&&n.remove(),e}insertAfter(e,t=!0){const n=this.getParentOrThrow();if(c2(n)||H1(39),n2(e))return super.insertAfter(e,t);const r=this.getNextSiblings();if(n.insertAfter(e,t),0!==r.length){const o=l2(n.getListType());r.forEach((e=>o.append(e))),e.insertAfter(o,t)}return e}remove(e){const t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&W1(t)&&W1(n)&&(X1(t.getFirstChild(),n.getFirstChild()),n.remove())}insertNewAfter(e,t=!0){const n=t2().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(n,t),n}collapseAtStart(e){const t=F0();this.getChildren().forEach((e=>t.append(e)));const n=this.getParentOrThrow(),r=n.getParentOrThrow(),o=n2(r);if(1===n.getChildrenSize())if(o)n.remove(),r.select();else{n.insertBefore(t),n.remove();const r=e.anchor,o=e.focus,i=t.getKey();"element"===r.type&&r.getNode().is(this)&&r.set(i,r.offset,"element"),"element"===o.type&&o.getNode().is(this)&&o.set(i,o.offset,"element")}else n.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const n=this.getParent();return c2(n)&&(t=n.getListType()),"check"===t?Boolean(e.__checked):void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(null===e)return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;n2(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){"number"!=typeof e&&H1(117),(e=Math.floor(e))>=0||H1(199);let t=this.getIndent();for(;t!==e;)t<e?(q1(this),t++):(U1(this),t--);return this}canInsertAfter(e){return n2(e)}canReplaceWith(e){return n2(e)}canMergeWith(e){return n2(e)||j0(e)}extractWithChild(e,t){if(!NQ(t))return!1;const n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return l2("bullet")}canMergeWhenEmpty(){return!0}}function K1(e,t,n){const r=[],o=[],i=t.list,a=i?i.listitem:void 0;let s;if(i&&i.nested&&(s=i.nested.listitem),void 0!==a&&r.push(...Z1(a)),i){const e=n.getParent(),t=c2(e)&&"check"===e.getListType(),a=n.getChecked();t&&!a||o.push(i.listitemUnchecked),t&&a||o.push(i.listitemChecked),t&&r.push(a?i.listitemChecked:i.listitemUnchecked)}if(void 0!==s){const e=Z1(s);n.getChildren().some((e=>c2(e)))?r.push(...e):o.push(...e)}o.length>0&&f1(e,...o),r.length>0&&p1(e,...r)}function J1(e,t,n,r){c2(t.getFirstChild())?(e.removeAttribute("role"),e.removeAttribute("tabIndex"),e.removeAttribute("aria-checked")):(e.setAttribute("role","checkbox"),e.setAttribute("tabIndex","-1"),n&&t.__checked===n.__checked||e.setAttribute("aria-checked",t.getChecked()?"true":"false"))}function Q1(e){if(e.classList.contains("task-list-item"))for(const t of e.children)if("INPUT"===t.tagName)return e2(t);const t=e.getAttribute("aria-checked");return{node:t2("true"===t||"false"!==t&&void 0)}}function e2(e){return"checkbox"!==e.getAttribute("type")?{node:null}:{node:t2(e.hasAttribute("checked"))}}function t2(e){return OK(new G1(void 0,e))}function n2(e){return e instanceof G1}class r2 extends C0{static getType(){return"list"}static clone(e){const t=e.__listType||s2[e.__tag];return new r2(t,e.__start,e.__key)}constructor(e="number",t=1,n){super(n);const r=s2[e]||e;this.__listType=r,this.__tag="number"===r?"ol":"ul",this.__start=t}getTag(){return this.__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag="number"===e?"ol":"ul",t}getListType(){return this.__listType}getStart(){return this.__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const n=this.__tag,r=document.createElement(n);return 1!==this.__start&&r.setAttribute("start",String(this.__start)),r.__lexicalListType=this.__listType,o2(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||(o2(t,n.theme,this),!1)}static transform(){return e=>{c2(e)||H1(163),function(e){const t=e.getNextSibling();c2(t)&&e.getListType()===t.getListType()&&X1(e,t)}(e),function(e){const t="check"!==e.getListType();let n=e.getStart();for(const r of e.getChildren())n2(r)&&(r.getValue()!==n&&r.setValue(n),t&&null!=r.getLatest().__checked&&r.setChecked(void 0),c2(r.getFirstChild())||n++)}(e)}}static importDOM(){return{ol:()=>({conversion:a2,priority:0}),ul:()=>({conversion:a2,priority:0})}}static importJSON(e){return l2().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return IK(t)&&(1!==this.__start&&t.setAttribute("start",String(this.__start)),"check"===this.__listType&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}append(...e){for(let t=0;t<e.length;t++){const n=e[t];if(n2(n))super.append(n);else{const e=t2();if(c2(n))e.append(n);else if(E0(n))if(n.isInline())e.append(n);else{const t=bQ(n.getTextContent());e.append(t)}else e.append(n);super.append(e)}}return this}extractWithChild(e){return n2(e)}}function o2(e,t,n){const r=[],o=[],i=t.list;if(void 0!==i){const e=i[`${n.__tag}Depth`]||[],t=function(e){let t=1,n=e.getParent();for(;null!=n;){if(n2(n)){const e=n.getParent();if(c2(e)){t++,n=e.getParent();continue}H1(40)}return t}return t}(n)-1,a=t%e.length,s=e[a],l=i[n.__tag];let c;const u=i.nested,d=i.checklist;if(void 0!==u&&u.list&&(c=u.list),void 0!==l&&r.push(l),void 0!==d&&"check"===n.__listType&&r.push(d),void 0!==s){r.push(...Z1(s));for(let t=0;t<e.length;t++)t!==a&&o.push(n.__tag+t)}if(void 0!==c){const e=Z1(c);t>1?r.push(...e):o.push(...e)}}o.length>0&&f1(e,...o),r.length>0&&p1(e,...r)}function i2(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(n2(r)){t.push(r);const e=r.getChildren();e.length>1&&e.forEach((e=>{c2(e)&&t.push(V1(e))}))}else t.push(V1(r))}return t}function a2(e){const t=e.nodeName.toLowerCase();let n=null;return"ol"===t?n=l2("number",e.start):"ul"===t&&(n=function(e){if("check"===e.getAttribute("__lexicallisttype")||e.classList.contains("contains-task-list"))return!0;for(const t of e.childNodes)if(IK(t)&&t.hasAttribute("aria-checked"))return!0;return!1}(e)?l2("check"):l2("bullet")),{after:i2,node:n}}const s2={ol:"number",ul:"bullet"};function l2(e="number",t=1){return OK(new r2(e,t))}function c2(e){return e instanceof r2}const u2={},d2={};function h2(e,t){const n=t.body?t.body.childNodes:[];let r=[];const o=[];for(let t=0;t<n.length;t++){const i=n[t];if(!m2.has(i.nodeName)){const t=g2(i,e,o,!1);null!==t&&(r=r.concat(t))}}return function(e){for(const t of e)t.getNextSibling()instanceof z0&&t.insertAfter(tQ());for(const t of e){const e=t.getChildren();for(const n of e)t.insertBefore(n);t.remove()}}(o),r}function p2(e,t){if("undefined"==typeof document||"undefined"==typeof window&&void 0===global.window)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const n=document.createElement("div"),r=KG().getChildren();for(let o=0;o<r.length;o++)f2(e,r[o],n,t);return n.innerHTML}function f2(e,t,n,r=null){let o=null===r||t.isSelected(r);const i=E0(t)&&t.excludeFromCopy("html");let a=t;if(null!==r){let e=YK(t);e=_Q(e)&&null!==r?G0(r,e):e,a=e}const s=E0(a)?a.getChildren():[],l=e._nodes.get(a.getType());let c;c=l&&void 0!==l.exportDOM?l.exportDOM(e,a):a.exportDOM(e);const{element:u,after:d}=c;if(!u)return!1;const h=document.createDocumentFragment();for(let n=0;n<s.length;n++){const i=s[n],a=f2(e,i,h,r);!o&&E0(t)&&a&&t.extractWithChild(i,r,"html")&&(o=!0)}if(o&&!i){if((IK(u)||RK(u))&&u.append(h),n.append(u),d){const e=d.call(a,u);e&&(RK(u)?u.replaceChildren(e):u.replaceWith(e))}}else n.append(h);return o}const m2=new Set(["STYLE","SCRIPT"]);function g2(e,t,n,r,o=new Map,i){let a=[];if(m2.has(e.nodeName))return a;let s=null;const l=function(e,t){const{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase());let o=null;if(void 0!==r)for(const t of r){const n=t(e);null!==n&&(null===o||(o.priority||0)<=(n.priority||0))&&(o=n)}return null!==o?o.conversion:null}(e,t),c=l?l(e):null;let u=null;if(null!==c){u=c.after;const t=c.node;if(s=Array.isArray(t)?t[t.length-1]:t,null!==s){for(const[,e]of o)if(s=e(s,i),!s)break;s&&a.push(...Array.isArray(t)?t:[s])}null!=c.forChild&&o.set(e.nodeName,c.forChild)}const d=e.childNodes;let h=[];const p=(null==s||!PK(s))&&(null!=s&&BQ(s)||r);for(let e=0;e<d.length;e++)h.push(...g2(d[e],t,n,p,new Map(o),s));return null!=u&&(h=u(h)),FK(e)&&(h=function(e,t,n){const r=e.style.textAlign,o=[];let i=[];for(let e=0;e<t.length;e++){const a=t[e];if(BQ(a))r&&!a.getFormat()&&a.setFormat(r),o.push(a);else if(i.push(a),e===t.length-1||e<t.length-1&&BQ(t[e+1])){const e=n();e.setFormat(r),e.append(...i),o.push(e),i=[]}}return o}(e,h,p?()=>{const e=new z0;return n.push(e),e}:F0)),null==s?h.length>0?a=a.concat(h):FK(e)&&function(e){return null!=e.nextSibling&&null!=e.previousSibling&&($K(e.nextSibling)&&$K(e.previousSibling))}(e)&&(a=a.concat(tQ())):E0(s)&&s.append(...h),a}var v2=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));function y2(e,t,n){const r=e.getData("application/x-lexical-editor");if(r)try{const e=JSON.parse(r);if(e.namespace===n._config.namespace&&Array.isArray(e.nodes))return b2(n,function(e){const t=[];for(let n=0;n<e.length;n++){const r=f0(e[n]);_Q(r)&&J0(r),t.push(r)}return t}(e.nodes),t)}catch(e){}const o=e.getData("text/html");if(o)try{return b2(n,h2(n,(new DOMParser).parseFromString(function(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:e=>e}).createHTML(e):e}(o),"text/html")),t)}catch(e){}const i=e.getData("text/plain")||e.getData("text/uri-list");if(null!=i)if(NQ(t)){const e=i.split(/(\r?\n|\t)/);""===e[e.length-1]&&e.pop();for(let t=0;t<e.length;t++){const n=YQ();if(NQ(n)){const r=e[t];"\n"===r||"\r\n"===r?n.insertParagraph():"\t"===r?n.insertNodes([SQ()]):n.insertText(r)}}}else t.insertRawText(i)}function b2(e,t,n){e.dispatchCommand(VU,{nodes:t,selection:n})||n.insertNodes(t)}function _2(e,t,n,r=[]){let o=null===t||n.isSelected(t);const i=E0(n)&&n.excludeFromCopy("html");let a=n;if(null!==t){let e=YK(n);e=_Q(e)&&null!==t?G0(t,e):e,a=e}const s=E0(a)?a.getChildren():[],l=function(e){const t=e.exportJSON(),n=e.constructor;if(t.type!==n.getType()&&v2(58,n.name),E0(e)){const e=t.children;Array.isArray(e)||v2(59,n.name)}return t}(a);if(_Q(a)){const e=a.__text;e.length>0?l.text=e:o=!1}for(let r=0;r<s.length;r++){const i=s[r],a=_2(e,t,i,l.children);!o&&E0(n)&&a&&n.extractWithChild(i,t,"clone")&&(o=!0)}if(o&&!i)r.push(l);else if(Array.isArray(l.children))for(let e=0;e<l.children.length;e++){const t=l.children[e];r.push(t)}return o}let x2=null;async function w2(e,t,n){if(null!==x2)return!1;if(null!==t)return new Promise(((r,o)=>{e.update((()=>{r(S2(e,t,n))}))}));const r=e.getRootElement(),o=null==e._window?window.document:e._window.document,i=AK(e._window);if(null===r||null===i)return!1;const a=o.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(o.createTextNode("#")),r.append(a);const s=new Range;return s.setStart(a,0),s.setEnd(a,1),i.removeAllRanges(),i.addRange(s),new Promise(((t,r)=>{const i=e.registerCommand(kZ,(r=>(g1(r,ClipboardEvent)&&(i(),null!==x2&&(window.clearTimeout(x2),x2=null),t(S2(e,r,n))),!0)),4);x2=window.setTimeout((()=>{i(),x2=null,t(!1)}),50),o.execCommand("copy"),a.remove()}))}function S2(e,t,n){if(void 0===n){const t=AK(e._window);if(!t)return!1;const r=t.anchorNode,o=t.focusNode;if(null!==r&&null!==o&&!AG(e,r,o))return!1;const i=YQ();if(null===i)return!1;n=function(e=YQ()){const t={"text/plain":e?e.getTextContent():""};if(e){const n=c0();for(const[r,o]of k2){const i=o(n,e);null!==i&&(t[r]=i)}}return t}(i)}t.preventDefault();const r=t.clipboardData;return null!==r&&(function(e,t){for(const n in t){const r=t[n];void 0!==r&&e.setData(n,r)}}(r,n),!0)}const k2=[["text/html",function(e,t=YQ()){return null==t&&v2(166),NQ(t)&&t.isCollapsed()||0===t.getNodes().length?"":p2(e,t)}],["application/x-lexical-editor",function(e,t=YQ()){return null==t&&v2(166),NQ(t)&&t.isCollapsed()||0===t.getNodes().length?null:JSON.stringify(function(e,t){const n=[],r=KG().getChildren();for(let o=0;o<r.length;o++)_2(e,t,r[o],n);return{namespace:e._config.namespace,nodes:n}}(e,t))}]];function C2(e,t){if(void 0!==document.caretRangeFromPoint){const n=document.caretRangeFromPoint(e,t);return null===n?null:{node:n.startContainer,offset:n.startOffset}}if("undefined"!==document.caretPositionFromPoint){const n=document.caretPositionFromPoint(e,t);return null===n?null:{node:n.offsetNode,offset:n.offset}}return null}const E2="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,M2=E2&&"documentMode"in document?document.documentMode:null,P2=!(!E2||!("InputEvent"in window)||M2)&&"getTargetRanges"in new window.InputEvent("input"),O2=E2&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T2=E2&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,N2=E2&&/^(?=.*Chrome).*/i.test(navigator.userAgent),D2=E2&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!N2,A2={};class L2 extends C0{static getType(){return"quote"}static clone(e){return new L2(e.__key)}createDOM(e){const t=document.createElement("blockquote");return p1(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:F2,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(IK(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return I2().updateFromJSON(e)}insertNewAfter(e,t){const n=F0(),r=this.getDirection();return n.setDirection(r),this.insertAfter(n,t),n}collapseAtStart(){const e=F0();return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}canMergeWhenEmpty(){return!0}}function I2(){return OK(new L2)}class z2 extends C0{static getType(){return"heading"}static clone(e){return new z2(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,n=document.createElement(t),r=e.theme.heading;if(void 0!==r){p1(n,r[t])}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:$2,priority:0}),h2:e=>({conversion:$2,priority:0}),h3:e=>({conversion:$2,priority:0}),h4:e=>({conversion:$2,priority:0}),h5:e=>({conversion:$2,priority:0}),h6:e=>({conversion:$2,priority:0}),p:e=>{const t=e.firstChild;return null!==t&&R2(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>R2(e)?{conversion:e=>({node:j2("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(IK(t)){this.isEmpty()&&t.append(document.createElement("br"));const e=this.getFormatType();t.style.textAlign=e;const n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return j2(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const n=e?e.anchor.offset:0,r=this.getLastDescendant(),o=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?F0():j2(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,t),0===n&&!this.isEmpty()&&e){const e=F0();e.select(),this.replace(e,!0)}return o}collapseAtStart(){const e=this.isEmpty()?F0():j2(this.getTag());return this.getChildren().forEach((t=>e.append(t))),this.replace(e),!0}extractWithChild(){return!0}}function R2(e){return"span"===e.nodeName.toLowerCase()&&"26pt"===e.style.fontSize}function $2(e){const t=e.nodeName.toLowerCase();let n=null;return"h1"!==t&&"h2"!==t&&"h3"!==t&&"h4"!==t&&"h5"!==t&&"h6"!==t||(n=j2(t),null!==e.style&&(XK(e,n),n.setFormat(e.style.textAlign))),{node:n}}function F2(e){const t=I2();return null!==e.style&&(t.setFormat(e.style.textAlign),XK(e,t)),{node:t}}function j2(e="h1"){return OK(new z2(e))}function B2(e){let t=null;if(g1(e,DragEvent)?t=e.dataTransfer:g1(e,ClipboardEvent)&&(t=e.clipboardData),null===t)return[!1,[],!1];const n=t.types,r=n.includes("Files"),o=n.includes("text/html")||n.includes("text/plain");return[r,Array.from(t.files),o]}function H2(e){const t=YQ();if(!NQ(t))return!1;const n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){const o=r[t],i=o.getKey();if(n.has(i))continue;const a=m1(o,(e=>E0(e)&&!e.isInline()));if(null===a)continue;const s=a.getKey();a.canIndent()&&!n.has(s)&&(n.add(s),e(a))}return n.size>0}function W2(e){return O0(UG(e))}function V2(e){for(const t of["lowercase","uppercase","capitalize"])e.hasFormat(t)&&e.toggleFormat(t)}function Y2(e){return h1(e.registerCommand(YU,(e=>{const t=YQ();return!!AQ(t)&&(t.clear(),!0)}),0),e.registerCommand(XU,(e=>{const t=YQ();return!!NQ(t)&&(t.deleteCharacter(e),!0)}),0),e.registerCommand(JU,(e=>{const t=YQ();return!!NQ(t)&&(t.deleteWord(e),!0)}),0),e.registerCommand(QU,(e=>{const t=YQ();return!!NQ(t)&&(t.deleteLine(e),!0)}),0),e.registerCommand(ZU,(t=>{const n=YQ();if("string"==typeof t)null!==n&&n.insertText(t);else{if(null===n)return!1;const r=t.dataTransfer;if(null!=r)y2(r,n,e);else if(NQ(n)){const e=t.data;return e&&n.insertText(e),!0}}return!0}),0),e.registerCommand(KU,(()=>{const e=YQ();return!!NQ(e)&&(e.removeText(),!0)}),0),e.registerCommand(eZ,(e=>{const t=YQ();return!!NQ(t)&&(t.formatText(e),!0)}),0),e.registerCommand(_Z,(e=>{const t=YQ();if(!NQ(t)&&!AQ(t))return!1;const n=t.getNodes();for(const t of n){const n=m1(t,(e=>E0(e)&&!e.isInline()));null!==n&&n.setFormat(e)}return!0}),0),e.registerCommand(qU,(e=>{const t=YQ();return!!NQ(t)&&(t.insertLineBreak(e),!0)}),0),e.registerCommand(UU,(()=>{const e=YQ();return!!NQ(e)&&(e.insertParagraph(),!0)}),0),e.registerCommand(gZ,(()=>(function(e){let t=YQ()||XQ();null===t&&(t=KG().selectEnd()),t.insertNodes(e)}([SQ()]),!0)),0),e.registerCommand(vZ,(()=>H2((e=>{const t=e.getIndent();e.setIndent(t+1)}))),0),e.registerCommand(yZ,(()=>H2((e=>{const t=e.getIndent();t>0&&e.setIndent(t-1)}))),0),e.registerCommand(lZ,(e=>{const t=YQ();if(AQ(t)&&!W2(e.target)){const e=t.getNodes();if(e.length>0)return e[0].selectPrevious(),!0}else if(NQ(t)){const n=yK(t.focus,!0);if(!e.shiftKey&&O0(n)&&!n.isIsolated()&&!n.isInline())return n.selectPrevious(),e.preventDefault(),!0}return!1}),0),e.registerCommand(cZ,(e=>{const t=YQ();if(AQ(t)){const e=t.getNodes();if(e.length>0)return e[0].selectNext(0,0),!0}else if(NQ(t)){if(function(e){const t=e.focus;return"root"===t.key&&t.offset===KG().getChildrenSize()}(t))return e.preventDefault(),!0;const n=yK(t.focus,!1);if(!e.shiftKey&&O0(n)&&!n.isIsolated()&&!n.isInline())return n.selectNext(),e.preventDefault(),!0}return!1}),0),e.registerCommand(aZ,(e=>{const t=YQ();if(AQ(t)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectPrevious(),!0}if(!NQ(t))return!1;if(n1(t,!0)){const n=e.shiftKey;return e.preventDefault(),r1(t,n,!0),!0}return!1}),0),e.registerCommand(oZ,(e=>{const t=YQ();if(AQ(t)&&!W2(e.target)){const n=t.getNodes();if(n.length>0)return e.preventDefault(),n[0].selectNext(0,0),!0}if(!NQ(t))return!1;const n=e.shiftKey;return!!n1(t,!1)&&(e.preventDefault(),r1(t,n,!1),!0)}),0),e.registerCommand(hZ,(t=>{if(W2(t.target))return!1;const n=YQ();if(!NQ(n))return!1;const{anchor:r}=n,o=r.getNode();return n.isCollapsed()&&0===r.offset&&!N0(o)&&function(e){const t=m1(e,(e=>E0(e)&&!e.isInline()));return E0(t)||s1(4,e.__key),t}(o).getIndent()>0?(t.preventDefault(),e.dispatchCommand(yZ,void 0)):(!T2||"ko-KR"!==navigator.language)&&(t.preventDefault(),e.dispatchCommand(XU,!0))}),0),e.registerCommand(fZ,(t=>{if(W2(t.target))return!1;return!!NQ(YQ())&&(t.preventDefault(),e.dispatchCommand(XU,!1))}),0),e.registerCommand(uZ,(t=>{const n=YQ();if(!NQ(n))return!1;if(V2(n),null!==t){if((T2||O2||D2)&&P2)return!1;if(t.preventDefault(),t.shiftKey)return e.dispatchCommand(qU,!1)}return e.dispatchCommand(UU,void 0)}),0),e.registerCommand(pZ,(()=>!!NQ(YQ())&&(e.blur(),!0)),0),e.registerCommand(bZ,(t=>{const[,n]=B2(t);if(n.length>0){const r=C2(t.clientX,t.clientY);if(null!==r){const{offset:t,node:o}=r,i=UG(o);if(null!==i){const e=function(){const e=EQ("root",0,"element"),t=EQ("root",0,"element");return new DQ(e,t,0,"")}();if(_Q(i))e.anchor.set(i.getKey(),t,"text"),e.focus.set(i.getKey(),t,"text");else{const t=i.getParentOrThrow().getKey(),n=i.getIndexWithinParent()+1;e.anchor.set(t,n,"element"),e.focus.set(t,n,"element")}QG(PG(e))}e.dispatchCommand(A2,n)}return t.preventDefault(),!0}return!!NQ(YQ())}),0),e.registerCommand(xZ,(e=>{const[t]=B2(e),n=YQ();return!(t&&!NQ(n))}),0),e.registerCommand(wZ,(e=>{const[t]=B2(e),n=YQ();if(t&&!NQ(n))return!1;const r=C2(e.clientX,e.clientY);if(null!==r){O0(UG(r.node))&&e.preventDefault()}return!0}),0),e.registerCommand(EZ,(()=>(function(e){const t=KG();if(NQ(e)){const t=e.anchor,n=e.focus,r=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(r.getKey(),0,"element"),n.set(r.getKey(),r.getChildrenSize(),"element"),PG(e),e}{const e=t.select(0,t.getChildrenSize());QG(PG(e))}}(),!0)),0),e.registerCommand(kZ,(t=>(w2(e,g1(t,ClipboardEvent)?t:null),!0)),0),e.registerCommand(CZ,(t=>(async function(e,t){await w2(t,g1(e,ClipboardEvent)?e:null),t.update((()=>{const e=YQ();NQ(e)?e.removeText():AQ(e)&&e.getNodes().forEach((e=>e.remove()))}))}(t,e),!0)),0),e.registerCommand(GU,(t=>{const[,n,r]=B2(t);return n.length>0&&!r?(e.dispatchCommand(A2,n),!0):(!zK(t.target)||!DG(t.target))&&(null!==YQ()&&(function(e,t){e.preventDefault(),t.update((()=>{const n=YQ(),r=g1(e,InputEvent)||g1(e,KeyboardEvent)?null:e.clipboardData;null!=r&&null!==n&&y2(r,n,t)}),{tag:"paste"})}(t,e),!0))}),0),e.registerCommand(dZ,(e=>{const t=YQ();return NQ(t)&&V2(t),!1}),0),e.registerCommand(mZ,(e=>{const t=YQ();return NQ(t)&&V2(t),!1}),0))}var X2=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const q2=m(null);function U2(){const e=p(q2);return null==e&&X2(8),e}const Z2="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,G2=Z2?d:l,K2={tag:"history-merge"};function J2({initialConfig:t,children:n}){const r=i((()=>{const{theme:e,namespace:n,nodes:r,onError:o,editorState:i,html:a}=t,s=function(e,t){let n=null;return null!=e&&(n=e[1]),{getTheme:function(){return null!=t?t:null!=n?n.getTheme():null}}}(null,e),l=H0({editable:t.editable,html:a,namespace:n,nodes:r,onError:e=>o(e,l),theme:e});return function(e,t){if(null!==t)if(void 0===t)e.update((()=>{const t=KG();if(t.isEmpty()){const n=F0();t.append(n);const r=Z2?document.activeElement:null;(null!==YQ()||null!==r&&r===e.getRootElement())&&n.select()}}),K2);else if(null!==t)switch(typeof t){case"string":{const n=e.parseEditorState(t);e.setEditorState(n,K2);break}case"object":e.setEditorState(t,K2);break;case"function":e.update((()=>{KG().isEmpty()&&t(e)}),K2)}}(l,i),[l,s]}),[]);return G2((()=>{const e=t.editable,[n]=r;n.setEditable(void 0===e||e)}),[]),e(q2.Provider,{value:r,children:n})}var Q2="LexicalContent-module_editableContent__f69V7",e5="LexicalContent-module_placeholder__EMU-N",t5="LexicalContent-module_editorContainer__l2-r1";function n5({defaultSelection:e}){const[t]=U2();return l((()=>{t.focus((()=>{const e=document.activeElement,n=t.getRootElement();null===n||null!==e&&n.contains(e)||n.focus({preventScroll:!0})}),{defaultSelection:e})}),[e,t]),null}const r5="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;function o5(e){return{initialValueFn:()=>e.isEditable(),subscribe:t=>e.registerEditableListener(t)}}function i5(e,t=!0){if(e)return!1;let n=KG().getTextContent();return t&&(n=n.trim()),""===n}function a5(e){return()=>function(e){if(!i5(e,!1))return!1;const t=KG().getChildren(),n=t.length;if(n>1)return!1;for(let e=0;e<n;e++){const n=t[e];if(O0(n))return!1;if(E0(n)){if(!j0(n))return!1;if(0!==n.__indent)return!1;const t=n.getChildren(),r=t.length;for(let n=0;n<r;n++)if(!_Q(t[e]))return!1}}return!0}(e)}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const s5="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;function l5(e){return e.getEditorState().read(a5(e.isComposing()))}function c5({contentEditable:r,placeholder:o=null,ErrorBoundary:a}){const[s]=U2(),c=function(t,n){const[r,o]=u((()=>t.getDecorators()));return s5((()=>t.registerDecoratorListener((e=>{T((()=>{o(e)}))}))),[t]),l((()=>{o(t.getDecorators())}),[t]),i((()=>{const o=[],i=Object.keys(r);for(let a=0;a<i.length;a++){const s=i[a],l=e(n,{onError:e=>t._onError(e),children:e(C,{fallback:null,children:r[s]})}),c=t.getElementByKey(s);null!==c&&o.push(P(l,c,s))}return o}),[n,r,t])}(s,a);return function(e){s5((()=>h1(Y2(e),function(e){const t=window.location.origin,n=n=>{if(n.origin!==t)return;const r=e.getRootElement();if(document.activeElement!==r)return;const o=n.data;if("string"==typeof o){let t;try{t=JSON.parse(o)}catch(e){return}if(t&&"nuanria_messaging"===t.protocol&&"request"===t.type){const r=t.payload;if(r&&"makeChanges"===r.functionId){const t=r.args;if(t){const[r,o,i,a,s,l]=t;e.update((()=>{const e=YQ();if(NQ(e)){const t=e.anchor;let l=t.getNode(),c=0,u=0;if(_Q(l)&&r>=0&&o>=0&&(c=r,u=r+o,e.setTextNodeRange(l,c,l,u)),c===u&&""===i||(e.insertRawText(i),l=t.getNode()),_Q(l)){c=a,u=a+s;const t=l.getTextContentSize();c=c>t?t:c,u=u>t?t:u,e.setTextNodeRange(l,c,l,u)}n.stopImmediatePropagation()}}))}}}}};return window.addEventListener("message",n,!0),()=>{window.removeEventListener("message",n,!0)}}(e))),[e])}(s),t(n,{children:[r,e(u5,{content:o}),c]})}function u5({content:e}){const[t]=U2(),n=function(e){const[t,n]=u((()=>l5(e)));return s5((()=>{function t(){const t=l5(e);n(t)}return t(),h1(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(t),r=function(e){const[t]=U2(),n=i((()=>e(t)),[t,e]),[r,o]=u((()=>n.initialValueFn())),a=s(r);return r5((()=>{const{initialValueFn:e,subscribe:t}=n,r=e();return a.current!==r&&(a.current=r,o(r)),t((e=>{a.current=e,o(e)}))}),[n,e]),r}(o5);return n?"function"==typeof e?e(r):e:null}const d5="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?d:l;const h5=h((function({editor:t,ariaActiveDescendant:n,ariaAutoComplete:r,ariaControls:o,ariaDescribedBy:a,ariaErrorMessage:s,ariaExpanded:l,ariaInvalid:d,ariaLabel:h,ariaLabelledBy:p,ariaMultiline:f,ariaOwns:m,ariaRequired:g,autoCapitalize:v,className:y,id:b,role:_="textbox",spellCheck:x=!0,style:w,tabIndex:S,"data-testid":k,...C},E){const[M,P]=u(t.isEditable()),O=c((e=>{e&&e.ownerDocument&&e.ownerDocument.defaultView?t.setRootElement(e):t.setRootElement(null)}),[t]),T=i((()=>function(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}(E,O)),[O,E]);return d5((()=>(P(t.isEditable()),t.registerEditableListener((e=>{P(e)})))),[t]),e("div",{"aria-activedescendant":M?n:void 0,"aria-autocomplete":M?r:"none","aria-controls":M?o:void 0,"aria-describedby":a,...null!=s?{"aria-errormessage":s}:{},"aria-expanded":M&&"combobox"===_?!!l:void 0,...null!=d?{"aria-invalid":d}:{},"aria-label":h,"aria-labelledby":p,"aria-multiline":f,"aria-owns":M?m:void 0,"aria-readonly":!M||void 0,"aria-required":g,autoCapitalize:v,className:y,contentEditable:M,"data-testid":k,id:b,ref:T,role:M?_:void 0,spellCheck:x,style:w,tabIndex:S,...C})}));function p5(e){return e.getEditorState().read(a5(e.isComposing()))}const f5=h((function(r,o){const{placeholder:i,...a}=r,[s]=U2();return t(n,{children:[e(h5,{editor:s,...a,ref:o}),null!=i&&e(m5,{editor:s,content:i})]})}));function m5({content:t,editor:n}){const r=function(e){const[t,n]=u((()=>p5(e)));return d5((()=>{function t(){const t=p5(e);n(t)}return t(),h1(e.registerUpdateListener((()=>{t()})),e.registerEditableListener((()=>{t()})))}),[e]),t}(n),[o,i]=u(n.isEditable());if(d((()=>(i(n.isEditable()),n.registerEditableListener((e=>{i(e)})))),[n]),!r)return null;let a=null;return"function"==typeof t?a=t(o):null!==t&&(a=t),null===a?null:e("div",{"aria-hidden":!0,children:a})}function g5(e,t,n,r,o){if(null===e||0===n.size&&0===r.size&&!o)return 0;const i=t._selection,a=e._selection;if(o)return 1;if(!(NQ(i)&&NQ(a)&&a.isCollapsed()&&i.isCollapsed()))return 0;const s=function(e,t,n){const r=e._nodeMap,o=[];for(const e of t){const t=r.get(e);void 0!==t&&o.push(t)}for(const[e,t]of n){if(!t)continue;const n=r.get(e);void 0===n||N0(n)||o.push(n)}return o}(t,n,r);if(0===s.length)return 0;if(s.length>1){const n=t._nodeMap,r=n.get(i.anchor.key),o=n.get(a.anchor.key);return r&&o&&!e._nodeMap.has(r.__key)&&_Q(r)&&1===r.__text.length&&1===i.anchor.offset?2:0}const l=s[0],c=e._nodeMap.get(l.__key);if(!_Q(c)||!_Q(l)||c.__mode!==l.__mode)return 0;const u=c.__text,d=l.__text;if(u===d)return 0;const h=i.anchor,p=a.anchor;if(h.key!==p.key||"text"!==h.type)return 0;const f=h.offset,m=p.offset,g=d.length-u.length;return 1===g&&m===f-1?2:-1===g&&m===f+1?3:-1===g&&m===f?4:0}function v5(e,t){let n=Date.now(),r=0;return(o,i,a,s,l,c)=>{const u=Date.now();if(c.has("historic"))return r=0,n=u,2;const d=g5(o,i,s,l,e.isComposing()),h=(()=>{const h=null===a||a.editor===e,p=c.has("history-push");if(!p&&h&&c.has("history-merge"))return 0;if(null===o)return 1;const f=i._selection;return s.size>0||l.size>0?!1===p&&0!==d&&d===r&&u<n+t&&h||1===s.size&&function(e,t,n){const r=t._nodeMap.get(e),o=n._nodeMap.get(e),i=t._selection,a=n._selection;return!(NQ(i)&&NQ(a)&&"element"===i.anchor.type&&"element"===i.focus.type&&"text"===a.anchor.type&&"text"===a.focus.type||!_Q(r)||!_Q(o)||r.__parent!==o.__parent)&&JSON.stringify(t.read((()=>r.exportJSON())))===JSON.stringify(n.read((()=>o.exportJSON())))}(Array.from(s)[0],o,i)?0:1:null!==f?0:2})();return n=u,r=d,h}}function y5(e){e.undoStack=[],e.redoStack=[],e.current=null}function b5({delay:e,externalHistoryState:t}){const[n]=U2();return function(e,t,n=1e3){const r=i((()=>t||{current:null,redoStack:[],undoStack:[]}),[t]);l((()=>function(e,t,n){const r=v5(e,n),o=h1(e.registerCommand(tZ,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==r.length){const o=t.current,i=r.pop();null!==o&&(n.push(o),e.dispatchCommand(OZ,!0)),0===r.length&&e.dispatchCommand(TZ,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(nZ,(()=>(function(e,t){const n=t.redoStack,r=t.undoStack;if(0!==n.length){const o=t.current;null!==o&&(r.push(o),e.dispatchCommand(TZ,!0));const i=n.pop();0===n.length&&e.dispatchCommand(OZ,!1),t.current=i||null,i&&i.editor.setEditorState(i.editorState,{tag:"historic"})}}(e,t),!0)),0),e.registerCommand(MZ,(()=>(y5(t),!1)),0),e.registerCommand(PZ,(()=>(y5(t),e.dispatchCommand(OZ,!1),e.dispatchCommand(TZ,!1),!0)),0),e.registerUpdateListener((({editorState:n,prevEditorState:o,dirtyLeaves:i,dirtyElements:a,tags:s})=>{const l=t.current,c=t.redoStack,u=t.undoStack,d=null===l?null:l.editorState;if(null!==l&&n===d)return;const h=r(o,n,l,i,a,s);if(1===h)0!==c.length&&(t.redoStack=[],e.dispatchCommand(OZ,!1)),null!==l&&(u.push({...l}),e.dispatchCommand(TZ,!0));else if(2===h)return;t.current={editor:e,editorState:n}})));return o}(e,r,n)),[n,e,r])}(n,t,e),null}function _5(e,t){return _5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_5(e,t)}var x5={error:null},w5=function(e){var t,n;function o(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=x5,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,_5(t,n),o.getDerivedStateFromError=function(e){return{error:e}};var i=o.prototype;return i.reset=function(){this.setState(x5)},i.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},i.componentDidUpdate=function(e,t){var n,r,o,i,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(i=s)&&(i=[]),o.length!==i.length||o.some((function(e,t){return!Object.is(e,i[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,s),this.reset())},i.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,o=t.FallbackComponent,i=t.fallback;if(null!==e){var a={error:e,resetErrorBoundary:this.resetErrorBoundary};if(r.isValidElement(i))return i;if("function"==typeof n)return n(a);if(o)return r.createElement(o,a);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},o}(r.Component);function S5({children:t,onError:n}){return e(w5,{fallback:e("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:n,children:t})}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function(e){const t=new URLSearchParams;t.append("code",e);for(let e=1;e<arguments.length;e++)t.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${t} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const k5=new Set(["http:","https:","mailto:","sms:","tel:"]);class C5 extends C0{static getType(){return"link"}static clone(e){return new C5(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},n){super(n);const{target:r=null,rel:o=null,title:i=null}=t;this.__url=e,this.__target=r,this.__rel=o,this.__title=i}createDOM(e){const t=document.createElement("a");return t.href=this.sanitizeUrl(this.__url),null!==this.__target&&(t.target=this.__target),null!==this.__rel&&(t.rel=this.__rel),null!==this.__title&&(t.title=this.__title),p1(t,e.theme.link),t}updateDOM(e,t,n){if(LK(t)){const n=this.__url,r=this.__target,o=this.__rel,i=this.__title;n!==e.__url&&(t.href=n),r!==e.__target&&(r?t.target=r:t.removeAttribute("target")),o!==e.__rel&&(o?t.rel=o:t.removeAttribute("rel")),i!==e.__title&&(i?t.title=i:t.removeAttribute("title"))}return!1}static importDOM(){return{a:e=>({conversion:E5,priority:1})}}static importJSON(e){return M5().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){try{const t=new URL(e);if(!k5.has(t.protocol))return"about:blank"}catch(t){return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const n=M5(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!NQ(t))return!1;const r=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function E5(e){let t=null;if(LK(e)){const n=e.textContent;(null!==n&&""!==n||e.children.length>0)&&(t=M5(e.getAttribute("href")||"",{rel:e.getAttribute("rel"),target:e.getAttribute("target"),title:e.getAttribute("title")}))}return{node:t}}function M5(e="",t){return OK(new C5(e,t))}function P5(e){return e instanceof C5}function O5({label:n,value:r,onChange:o,placeholder:i="","data-test-id":a,type:s="text"}){return t("div",{className:"Input__wrapper",children:[e("label",{className:"Input__label",children:n}),e("input",{type:s,className:"Input__input",placeholder:i,value:r,onChange:e=>{o(e.target.value)},"data-test-id":a})]})}let T5=!1;const N5=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000000","#4a4a4a","#9b9b9b","#ffffff"],D5=214;function A5({color:n,onChange:r}){const[o,a]=u(j5("hex",n)),[c,d]=u(n),h=s(null),p=i((()=>({x:o.hsv.s/100*D5,y:(100-o.hsv.v)/100*150})),[o.hsv.s,o.hsv.v]),f=i((()=>({x:o.hsv.h/360*D5})),[o.hsv]);return l((()=>{null!==h.current&&r&&(r(o.hex,T5),d(o.hex))}),[o,r]),l((()=>{if(void 0===n)return;const e=j5("hex",n);a(e),d(e.hex)}),[n]),t("div",{className:"color-picker-wrapper",style:{width:D5},ref:h,children:[e(O5,{label:"Hex",onChange:e=>{if(d(e),/^#[0-9A-Fa-f]{6}$/i.test(e)){const t=j5("hex",e);a(t)}},value:c}),e("div",{className:"color-picker-basic-color",children:N5.map((t=>e("button",{className:t===o.hex?" active":"",style:{backgroundColor:t},onClick:()=>{d(t),a(j5("hex",t))}},t)))}),e(L5,{className:"color-picker-saturation",style:{backgroundColor:`hsl(${o.hsv.h}, 100%, 50%)`},onChange:({x:e,y:t})=>{const n=j5("hsv",{...o.hsv,s:e/D5*100,v:100-t/150*100});a(n),d(n.hex)},children:e("div",{className:"color-picker-saturation_cursor",style:{backgroundColor:o.hex,left:p.x,top:p.y}})}),e(L5,{className:"color-picker-hue",onChange:({x:e})=>{const t=j5("hsv",{...o.hsv,h:e/D5*360});a(t),d(t.hex)},children:e("div",{className:"color-picker-hue_cursor",style:{backgroundColor:`hsl(${o.hsv.h}, 100%, 50%)`,left:f.x}})}),e("div",{className:"color-picker-color",style:{backgroundColor:o.hex}})]})}function L5({className:t,style:n,onChange:r,children:o}){const i=s(null),a=s(!1),l=e=>{if(i.current){const{current:t}=i,{width:n,height:o,left:a,top:s}=t.getBoundingClientRect(),l=function(e){let t=1;if(function(){if(void 0===v1){const e=document.createElement("div");e.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(e);const t=e.getBoundingClientRect();e.style.setProperty("zoom","2"),v1=e.getBoundingClientRect().width===t.width,document.body.removeChild(e)}return v1}())for(;e;)t*=Number(window.getComputedStyle(e).getPropertyValue("zoom")),e=e.parentElement;return t}(t),c=I5(e.clientX/l-a,n,0),u=I5(e.clientY/l-s,o,0);r({x:c,y:u})}};return e("div",{ref:i,className:t,style:n,onMouseDown:e=>{if(0!==e.button)return;l(e);const t=e=>{a.current=!0,T5=!0,l(e)},n=e=>{a.current&&(T5=!1),document.removeEventListener("mousemove",t,!1),document.removeEventListener("mouseup",n,!1),l(e),a.current=!1};document.addEventListener("mousemove",t,!1),document.addEventListener("mouseup",n,!1)},children:o})}function I5(e,t,n){return e>t?t:e<n?n:e}function z5(e){if(!e.startsWith("#")){const t=document.createElement("canvas").getContext("2d");if(!t)throw new Error("2d context not supported or canvas already initialized");return t.fillStyle=e,t.fillStyle}return 4===e.length||5===e.length?(e=e.split("").map(((e,t)=>t?e+e:"#")).join(""),e):7===e.length||9===e.length?e:"#000000"}function R5(e){const t=(e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((e,t,n,r)=>"#"+t+t+n+n+r+r)).substring(1).match(/.{2}/g)||[]).map((e=>parseInt(e,16)));return{b:t[2],g:t[1],r:t[0]}}function $5({r:e,g:t,b:n}){e/=255,t/=255,n/=255;const r=Math.max(e,t,n),o=r-Math.min(e,t,n);return{h:o?60*(r===e?(t-n)/o+(t<n?6:0):r===t?2+(n-e)/o:4+(e-t)/o):0,s:r?o/r*100:0,v:100*r}}function F5({b:e,g:t,r:n}){return"#"+[n,t,e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function j5(e,t){let n=z5("#121212"),r=R5(n),o=$5(r);if("hex"===e){n=z5(t),r=R5(n),o=$5(r)}else if("rgb"===e){r=t,n=F5(r),o=$5(r)}else if("hsv"===e){o=t,r=function({h:e,s:t,v:n}){const r=~~(e/60),o=e/60-r,i=(n/=100)*(1-(t/=100)),a=n*(1-t*o),s=n*(1-t*(1-o)),l=r%6,c=Math.round(255*[n,a,i,i,s,n][l]),u=Math.round(255*[s,n,n,a,i,i][l]);return{b:Math.round(255*[i,i,s,n,n,a][l]),g:u,r:c}}(o),n=F5(r)}return{hex:n,hsv:o,rgb:r}}const B5=r.createContext(null);function H5({children:t,className:n,onClick:o,title:i}){const a=s(null),c=r.useContext(B5);if(null===c)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:u}=c;return l((()=>{a&&a.current&&u(a)}),[a,u]),e("button",{className:`item ${n}`,onClick:o,ref:a,title:i,type:"button",children:t})}function W5({children:t,dropDownRef:n,onClose:r}){const[o,a]=u(),[s,d]=u(),h=c((e=>{a((t=>t?[...t,e]:[e]))}),[a]),p=i((()=>({registerItem:h})),[h]);return l((()=>{o&&!s&&d(o[0]),s&&s.current&&s.current.focus()}),[o,s]),e(B5.Provider,{value:p,children:e("div",{className:"dropdown",ref:n,onKeyDown:e=>{if(!o)return;const t=e.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(t)&&e.preventDefault(),"Escape"===t||"Tab"===t?r():"ArrowUp"===t?d((e=>{if(!e)return o[0];const t=o.indexOf(e)-1;return o[-1===t?o.length-1:t]})):"ArrowDown"===t&&d((e=>e?o[o.indexOf(e)+1]:o[0]))},children:t})})}function V5({colorPicker:r=!1,disabled:o=!1,buttonLabel:i,buttonAriaLabel:a,buttonClassName:c,buttonIconClassName:d,labelClassName:h,children:p,icon:f=e(Ga,{name:"chevronDown"}),stopCloseOnClickSelf:m,buttonOnClick:g}){const v=s(null),y=s(null),[b,_]=u(!1);return l((()=>{const e=y.current,t=v.current;if(b&&null!==e&&null!==t){const{top:n,left:r}=e.getBoundingClientRect();t.style.top=`${n+e.offsetHeight+4}px`,t.style.left=`${Math.min(r,window.innerWidth-t.offsetWidth-20)}px`}}),[v,y,b]),l((()=>{const e=y.current;if(null!==e&&b){const t=t=>{const n=t.target;m&&v.current&&v.current.contains(n)||e.contains(n)||_(!1)};return document.addEventListener("click",t),()=>{document.removeEventListener("click",t)}}}),[v,y,b,m]),l((()=>{const e=()=>{if(b){const e=y.current,t=v.current;if(null!==e&&null!==t){const{top:n}=e.getBoundingClientRect(),r=n+e.offsetHeight+4;r!==t.getBoundingClientRect().top&&(t.style.top=`${r}px`)}}};return document.addEventListener("scroll",e),()=>{document.removeEventListener("scroll",e)}}),[y,v,b]),t(n,{children:[t("button",{type:"button",disabled:o,"aria-label":a||i,className:`toolbar-item ${!r&&"dropdownButton"} ${c}`,onClick:()=>{_(!b),g&&g()},ref:y,children:[i&&e("div",{className:h,children:i}),!r&&f]}),b&&P(e(W5,{dropDownRef:v,onClose:()=>{_(!1),y&&y.current&&y.current.focus()},children:p}),document.body)]})}function Y5({disabled:t=!1,stopCloseOnClickSelf:n=!0,color:r,onChange:o,...i}){return e(V5,{...i,colorPicker:!0,disabled:t,stopCloseOnClickSelf:n,children:e("div",{style:{position:"static",top:0,zIndex:99},children:e(A5,{color:r,onChange:o})})})}var X5;function q5({selectionFontSize:t,editor:n}){const[o,i]=r.useState(t),a=r.useCallback(((e,t)=>{const r=e=>(e||(e="15px"),`${e=e.slice(0,-2)}px`);n.update((()=>{if(n.isEditable()){const t=YQ();null!==t&&e1(t,{"font-size":e||r})}}))}),[n]);r.useEffect((()=>{i(t)}),[t]);return e(V5,{buttonOnClick:()=>{},buttonLabel:`${o}px`,children:[8,9,10,11,12,14,16,18,20,24,28,32,36,48,60,72].map((t=>e(H5,{onClick:()=>{a(String(t)+"px",null)},children:e("span",{className:"text",children:t})},t)))})}!function(e){e[e.increment=1]="increment",e[e.decrement=2]="decrement"}(X5||(X5={}));const U5={bullet:"Bulleted List",check:"Check List",code:"Code Block",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",number:"Numbered List",paragraph:"Normal",quote:"Quote"},Z5=[["Arial","Arial"],["Courier New","Courier New"],["Georgia","Georgia"],["Times New Roman","Times New Roman"],["Trebuchet MS","Trebuchet MS"],["Verdana","Verdana"],["Roboto","Roboto"]],G5=[["10px","10px"],["11px","11px"],["12px","12px"],["13px","13px"],["14px","14px"],["15px","15px"],["16px","16px"],["17px","17px"],["18px","18px"],["19px","19px"],["20px","20px"]];function K5(e){return e?"active dropdown-item-active":""}function J5({editor:n,blockType:r,disabled:o=!1}){const i=()=>{n.update((()=>{const e=YQ();NQ(e)&&t1(e,(()=>F0()))}))},a=e=>{r!==e&&n.update((()=>{t1(YQ(),(()=>j2(e)))}))};return t(V5,{disabled:o,buttonClassName:"toolbar-item block-controls",buttonIconClassName:"icon block-type "+r,buttonLabel:U5[r],buttonAriaLabel:"Formatting options for text style",children:[e(H5,{className:"item "+K5("paragraph"===r),onClick:i,children:e("span",{className:"text",children:"Normal"})}),e(H5,{className:"item "+K5("h1"===r),onClick:()=>a("h1"),children:e("span",{className:"text",children:"Heading 1"})}),e(H5,{className:"item "+K5("h2"===r),onClick:()=>a("h2"),children:e("span",{className:"text",children:"Heading 2"})}),e(H5,{className:"item "+K5("h3"===r),onClick:()=>a("h3"),children:e("span",{className:"text",children:"Heading 3"})}),e(H5,{className:"item "+K5("bullet"===r),onClick:()=>{"bullet"!==r?n.dispatchCommand(u2,void 0):i()},children:e("span",{className:"text",children:"Bullet List"})}),e(H5,{className:"item "+K5("number"===r),onClick:()=>{"number"!==r?n.dispatchCommand(d2,void 0):i()},children:e("span",{className:"text",children:"Numbered List"})}),e(H5,{className:"item "+K5("quote"===r),onClick:()=>{"quote"!==r&&n.update((()=>{t1(YQ(),(()=>I2()))}))},children:e("span",{className:"text",children:"Quote"})})]})}function Q5({editor:t,value:n,style:r}){const o=c((e=>{t.update((()=>{const t=YQ();null!==t&&e1(t,{[r]:e})}))}),[t,r]);return e(V5,{buttonOnClick:()=>{t.dispatchCommand(NZ,void 0)},buttonClassName:"toolbar-item "+r,buttonLabel:n,buttonIconClassName:"font-family"===r?"icon block-type font-family":"",buttonAriaLabel:"font-family"===r?"Formatting options for font family":"Formatting options for font size",children:("font-family"===r?Z5:G5).map((([t,i])=>e(H5,{className:`item ${K5(n===t)} ${"font-size"===r?"fontsize-item":""}`,onClick:()=>o(t),children:e("span",{className:"text",children:t})},t)))})}function e3(){return e("div",{className:"divider"})}const t3=a((({editor:n,toolbarRef:r})=>{const o=s(null),i=s(null),[a,d]=u("14px"),[h,p]=u("#000"),[f,m]=u("#fff"),[g,v]=u("Arial"),[y,b]=u("left"),[_,x]=u(!1),[w,S]=u(!1),[k,C]=u(!1),[E,M]=u(!1),[P,O]=u(!1),[T,N]=u(!1),[D,A]=u(!1),[L,I]=u(!1),[z,R]=u("paragraph"),[$,F]=u(null),j=c((()=>{const e=YQ();if(NQ(e)){const t=e.anchor.getNode();let r="root"===t.getKey()?t:m1(t,(e=>{const t=e.getParent();return null!==t&&PK(t)}));null===r&&(r=t.getTopLevelElementOrThrow());const o=r.getKey(),i=n.getElementByKey(o);C(e.hasFormat("code")),S(e.hasFormat("bold")),M(e.hasFormat("italic")),O(e.hasFormat("underline")),N(e.hasFormat("strikethrough"));const a=function(e){const t=e.anchor,n=e.focus,r=e.anchor.getNode(),o=e.focus.getNode();return r===o?r:e.isBackward()?K0(n)?r:o:K0(t)?r:o}(e),s=a.getParent();if(P5(s)||P5(a)?x(!0):x(!1),null!==i)if(F(o),c2(r)){const e=function(e,t){let n=e;for(;null!=n;){if(n instanceof t)return n;n=n.getParent()}return null}(t,r2),n=e?e.getListType():r.getListType();R(n)}else{const e=function(e){return e instanceof z2}(r)?r.getTag():r.getType();e in U5&&R(e)}let l;p(i1(e,"color","#000")),m(i1(e,"background-color","#fff")),v(i1(e,"font-family","Arial")),P5(s)&&(l=m1(a,(e=>E0(e)&&!e.isInline()))),b(E0(l)?l.getFormatType():E0(a)?a.getFormatType():s?.getFormatType()||"left")}NQ(e)&&d(i1(e,"font-size","14px"))}),[]);l((()=>h1(n.registerUpdateListener((({editorState:e})=>{e.read((()=>{j()}))})),n.registerCommand(WU,((e,t)=>(j(),!1)),1),n.registerCommand(TZ,(e=>(A(e),!1)),1),n.registerCommand(OZ,(e=>(I(e),!1)),1))),[n,j]);const B=c(((e,t)=>{n.update((()=>{const t=YQ();null!==t&&e1(t,e)}),t?{tag:"historic"}:{})}),[n]),H=c(((e,t)=>{V(e),B({color:e},t)}),[B]),W=c(((e,t)=>{Y(e),B({"background-color":e},t)}),[B]);l((()=>{V("white")}),[o]),l((()=>{Y("white")}),[i]);const V=e=>{if(!e||!o.current)return;const t=o.current.querySelectorAll("path");t[5]&&t[5].setAttribute("fill",e)},Y=e=>{if(!e||!i.current)return;const t=i.current.querySelectorAll("path");t[0]&&t[0].setAttribute("fill",e)},X=c(((e,t)=>{n.dispatchCommand(e,t)}),[]);return t("div",{className:"toolbar",ref:r,onClick:()=>{n.dispatchCommand(NZ,void 0)},children:[e("button",{disabled:!D,onClick:()=>{n.dispatchCommand(tZ,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:e(Ga,{name:"undo"})}),e("button",{disabled:!L,onClick:()=>{n.dispatchCommand(nZ,void 0)},className:"toolbar-item","aria-label":"Redo",children:e(Ga,{name:"redo"})}),e(e3,{}),e(J5,{blockType:z,editor:n}),e(e3,{}),e(Q5,{style:"font-family",value:g,editor:n}),e(e3,{}),e(q5,{selectionFontSize:a.slice(0,-2),editor:n}),e(e3,{}),e("button",{onClick:()=>{X(eZ,"bold")},className:"toolbar-item spaced "+(w?"active":""),"aria-label":"Format Bold",children:e(Ga,{name:"formatBold"})}),e("button",{onClick:()=>{X(eZ,"italic")},className:"toolbar-item spaced "+(E?"active":""),"aria-label":"Format Italics",children:e(Ga,{name:"formatItalic"})}),e("button",{onClick:()=>{X(eZ,"underline")},className:"toolbar-item spaced "+(P?"active":""),"aria-label":"Format Underline",children:e(Ga,{name:"formatUnderlined"})}),e("button",{onClick:()=>{X(eZ,"code")},className:"toolbar-item spaced "+(k?"active":""),"aria-label":"Format Underline",children:e(Ga,{name:"codeTags"})}),e("button",{onClick:()=>{X(eZ,"strikethrough")},className:"toolbar-item spaced "+(T?"active":""),"aria-label":"Format Strikethrough",children:e(Ga,{name:"strikethroughS"})}),e(e3,{}),e("button",{onClick:()=>{X(_Z,"left")},className:"toolbar-item spaced "+("left"==y?"active":""),"aria-label":"Left Align",children:e(Ga,{name:"formatAlignLeft"})}),e("button",{onClick:()=>{X(_Z,"center")},className:"toolbar-item spaced "+("center"==y?"active":""),"aria-label":"Center Align",children:e(Ga,{name:"formatAlignCenter"})}),e("button",{onClick:()=>{X(_Z,"right")},className:"toolbar-item spaced "+("right"==y?"active":""),"aria-label":"Right Align",children:e(Ga,{name:"formatAlignRight"})}),e("button",{onClick:()=>{X(_Z,"justify")},className:"toolbar-item spaced "+("justify"==y?"active":""),"aria-label":"Justify Align",children:e(Ga,{name:"formatAlignJustify"})}),e(e3,{}),e(Y5,{buttonClassName:"toolbar-item",buttonAriaLabel:"Formatting text color",buttonLabel:e(Ga,{name:"formatColorText"}),color:h,onChange:H,title:"text color"}),e(Y5,{buttonClassName:"toolbar-item",buttonAriaLabel:"Formatting background color",buttonLabel:e(Ga,{name:"formatColorFill"}),color:f,onChange:W,title:"bg color"})]})}));function n3({onChange:e}){const[t]=U2();return o.useEffect((()=>t.registerUpdateListener((({editorState:n})=>{e(n,t)}))),[t,e]),null}const r3=a((({onChange:n,placeHolder:r,...o})=>{const[i]=U2(),a=s(null),[c,d]=u(0);return l((()=>{a.current&&d(a.current.clientHeight)}),[a.current?.clientHeight,a.current?.offsetHeight]),e(B,{direction:"vertical",dimensionX:"fill",dimensionY:472,alignment:"leftTop",...o,children:t("div",{className:t5,children:[e(t3,{editor:i,toolbarRef:a}),e(c5,{contentEditable:e(f5,{className:Q2}),placeholder:r&&e("div",{className:e5,style:{top:c},children:r}),ErrorBoundary:S5}),e(n3,{onChange:n}),e(b5,{}),e(n5,{})]})})}));var o3=a((({className:n="",value:r="<p></p>",headerProps:o,description:i,onChange:a,contentProps:s,placeHolder:l})=>{const u=(e,t)=>(((e,t)=>{const n=KG(),r=h2(e,(new DOMParser).parseFromString(t,"text/html"));n.clear();try{n.append(...r)}catch{const e=F0();e.append(...r),n.append(e)}})(e,t),e),d={namespace:"RichTextInput",onError:e=>{console.error("Lexical Error:",e)},editorState:e=>u(e,r),nodes:[V0,{replace:uQ,with:e=>new V0(e.__text)},r2,G1,z2,L2,T1,$1]},h=c(((e,t)=>{e.read((()=>{const e=p2(t,null);a?.(e)}))}),[a]);return t(B,{className:`${BU} ${n}`,dimensionX:"fill",direction:"vertical",children:[o&&e(KA,{prefix:{children:o?.icon&&e(Ga,{name:o?.icon}),...o?.iconProps},root:{children:o?.label&&e(V,{children:o?.label}),...o?.labelProps},...o?.container}),e(J2,{initialConfig:d,children:e(r3,{...s,onChange:h,placeHolder:l})}),e(V,{size:"xsmall",className:`${HU}`,children:i})]})})),i3={container:"ObjectInput-module_container__JtW64",error:"ObjectInput-module_error__z1cTE",inputContainer:"ObjectInput-module_inputContainer__Kjm9k"};var a3=a((({value:n,properties:r,title:o,description:i,errorMessage:a,helperTextContainerProps:s,helperTextProps:l,onChange:c,errors:u,...d})=>{const h=_4({properties:r,value:n,onChange:c,error:u,errorClassName:i3.error,containerClassName:i3.inputContainer});return t(B,{gap:20,direction:"vertical",dimensionX:"fill",...d,className:`${d.className} ${i3.container}`,children:[o&&e(KA,{prefix:{children:e(Ga,{name:"dataObject",className:i3.icon})},root:{children:e(V,{variant:"secondary",children:o})}}),h,(a||i)&&e(se.HelperText,{alignment:"leftCenter",dimensionX:"fill",...s,className:`${i3.helperText} ${s?.className}`,children:e(V,{...l,size:"small",variant:a?"danger":"secondary",className:`${l?.className}`,children:a||i})})]})})),s3={container:"ArrayInput-module_container__pCN6T",header:"ArrayInput-module_header__v88Lg",inputHeader:"ArrayInput-module_inputHeader__YhlBU",emptyStateText:"ArrayInput-module_emptyStateText__ZHJbR"};var l3=a((({value:n,items:r,title:o,description:i,errorMessage:a,helperTextContainerProps:s,helperTextProps:l,maxItems:c,propertyKey:d,onChange:h,errors:p,minItems:f,...m})=>{const[g,v]=u(0),{inputFields:y,getDefaultValue:b}=S4({propertyKey:d,items:r,value:n,activeIndex:g,onChange:h,errors:p});return t(B,{gap:20,direction:"vertical",dimensionX:"fill",...m,className:`${m.className} ${s3.container}`,children:[t("div",{className:s3.header,children:[o&&e(KA,{className:s3.inputHeader,prefix:{children:e(Ga,{name:"ballot",className:s3.icon})},root:{children:e(V,{variant:"secondary",children:o})}}),e(ZA,{length:n?.length,active:g,maxItems:c,onChange:e=>{v(e)},onCreate:()=>{const e=[...n||[]];e?.push(n?.[g]||b()),h?.(e),v(e.length-1)},onDelete:e=>{const t=[...n||[]];t.splice(e,1),h?.(t),v(Math.max(0,e-1))}})]}),n?.length?y:e("span",{className:s3.emptyStateText,children:"Create an element to see the fields"}),e(se.HelperText,{alignment:"leftCenter",dimensionX:"fill",...s,className:`${s3.helperText} ${s?.className}`,children:e(V,{...l,size:"small",variant:a?"danger":"secondary",className:`${l?.className}`,children:a||i})})]})})),c3="ChipInput-module_chipInputContainer__wRY2y",u3="ChipInput-module_errorTextContainer__AQPXD",d3="ChipInput-module_errorText__Qw1NA";var h3,p3,f3,m3,g3,v3,y3,b3,_3,x3,w3,S3,k3,C3,E3,M3,P3,O3,T3,N3,D3,A3,L3,I3,z3,R3,$3,F3,j3=a((({label:n,placeholder:r="Enter a value than press enter",onChange:o,value:i,allowDuplicateValues:a=!1,valueType:s="string",...c})=>{const[d,h]=u(""),[p,f]=u();l((()=>{f(void 0)}),[d]),l((()=>{let e=[];"number"===s?e=i.filter((e=>!isNaN(Number(e)))).map((e=>Number(e))):(e=i.map((e=>String(e))),f(void 0)),o(e)}),[s]);return t(B,{dimensionX:"fill",direction:"wrap",alignment:"leftCenter",...c,className:`${c3} ${c.className}`,children:[i.map(((t,n)=>e(nm,{variant:"outlined",label:String(t),onDelete:()=>(e=>{const t=i.filter(((t,n)=>n!==e));o(t)})(n)},n))),e(G,{placeholder:r,value:d,onChange:e=>h(e.target.value),onKeyDown:e=>{if("Enter"===e.key&&""!==d.trim()){e.preventDefault();const t="number"===s?Number(d.trim()):d.trim();if("number"==typeof t&&isNaN(t))return void f("Value must be a valid number");if(!a&&i.includes(t))return;const n=[...i,t];o(n),h("")}}}),e("div",{className:u3,children:p&&e(V,{className:d3,variant:"danger",children:p})})," "]})})),B3="RelationInput-module_icon__folVL",H3="RelationInput-module_text__h8Gq5",W3="RelationInput-module_select__H7bRO",V3="RelationInput-module_baseInput__9cDeK",Y3="RelationSelect-module_container__nwkcp",X3="RelationSelect-module_disabled__37hiQ",q3="RelationSelect-module_displayer__-ispL",U3="RelationSelect-module_displayerContainer__kCaoy",Z3="RelationSelect-module_selectDropdown__HAwgv",G3="RelationSelect-module_searchInputWrapper__2XT5T",K3="RelationSelect-module_searchIcon__Wpvzz",J3="RelationSelect-module_searchInput__Aihgm",Q3="RelationSelect-module_deleteIcon__l6plf",e4="RelationSelect-module_infiniteScroll__UQClb",t4="RelationSelect-module_deleteButton__9KhWk";function n4(){if(p3)return h3;return p3=1,h3=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},h3}function r4(){if(v3)return g3;v3=1;var e=function(){if(m3)return f3;m3=1;var e="object"==typeof ye&&ye&&ye.Object===Object&&ye;return f3=e}(),t="object"==typeof self&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return g3=n}function o4(){if(S3)return w3;S3=1;var e=function(){if(x3)return _3;x3=1;var e=/\s/;return _3=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n},_3}(),t=/^\s+/;return w3=function(n){return n?n.slice(0,e(n)+1).replace(t,""):n},w3}function i4(){if(C3)return k3;C3=1;var e=r4().Symbol;return k3=e}function a4(){if(N3)return T3;N3=1;var e=i4(),t=function(){if(M3)return E3;M3=1;var e=i4(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,o=e?e.toStringTag:void 0;return E3=function(e){var t=n.call(e,o),i=e[o];try{e[o]=void 0;var a=!0}catch(e){}var s=r.call(e);return a&&(t?e[o]=i:delete e[o]),s}}(),n=function(){if(O3)return P3;O3=1;var e=Object.prototype.toString;return P3=function(t){return e.call(t)}}(),r=e?e.toStringTag:void 0;return T3=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":r&&r in Object(e)?t(e):n(e)}}function s4(){if(I3)return L3;I3=1;var e=a4(),t=A3?D3:(A3=1,D3=function(e){return null!=e&&"object"==typeof e});return L3=function(n){return"symbol"==typeof n||t(n)&&"[object Symbol]"==e(n)}}var l4=function(){if(F3)return $3;F3=1;var e=n4(),t=function(){if(b3)return y3;b3=1;var e=r4();return y3=function(){return e.Date.now()}}(),n=function(){if(R3)return z3;R3=1;var e=o4(),t=n4(),n=s4(),r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt;return z3=function(s){if("number"==typeof s)return s;if(n(s))return NaN;if(t(s)){var l="function"==typeof s.valueOf?s.valueOf():s;s=t(l)?l+"":l}if("string"!=typeof s)return 0===s?s:+s;s=e(s);var c=o.test(s);return c||i.test(s)?a(s.slice(2),c?2:8):r.test(s)?NaN:+s}}(),r=Math.max,o=Math.min;return $3=function(i,a,s){var l,c,u,d,h,p,f=0,m=!1,g=!1,v=!0;if("function"!=typeof i)throw new TypeError("Expected a function");function y(e){var t=l,n=c;return l=c=void 0,f=e,d=i.apply(n,t)}function b(e){var t=e-p;return void 0===p||t>=a||t<0||g&&e-f>=u}function _(){var e=t();if(b(e))return x(e);h=setTimeout(_,function(e){var t=a-(e-p);return g?o(t,u-(e-f)):t}(e))}function x(e){return h=void 0,v&&l?y(e):(l=c=void 0,d)}function w(){var e=t(),n=b(e);if(l=arguments,c=this,p=e,n){if(void 0===h)return function(e){return f=e,h=setTimeout(_,a),m?y(e):d}(p);if(g)return clearTimeout(h),h=setTimeout(_,a),y(p)}return void 0===h&&(h=setTimeout(_,a)),d}return a=n(a)||0,e(s)&&(m=!!s.leading,u=(g="maxWait"in s)?r(n(s.maxWait)||0,a):u,v="trailing"in s?!!s.trailing:v),w.cancel=function(){void 0!==h&&clearTimeout(h),f=0,l=p=c=h=void 0},w.flush=function(){return void 0===h?d:x(t())},w},$3}(),c4=be(l4),u4=function(e,t){return u4=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},u4(e,t)};var d4=function(){return d4=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d4.apply(this,arguments)};var h4="Pixel",p4="Percent",f4={unit:p4,value:.8};function m4(e){return"number"==typeof e?{unit:p4,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:h4,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:p4,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),f4):(console.warn("scrollThreshold should be string or number"),f4)}var g4=function(e){function t(t){var n=e.call(this,t)||this;return n.lastScrollTop=0,n.actionTriggered=!1,n.startY=0,n.currentY=0,n.dragging=!1,n.maxPullDownDistance=0,n.getScrollableTarget=function(){return n.props.scrollableTarget instanceof HTMLElement?n.props.scrollableTarget:"string"==typeof n.props.scrollableTarget?document.getElementById(n.props.scrollableTarget):(null===n.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)},n.onStart=function(e){n.lastScrollTop||(n.dragging=!0,e instanceof MouseEvent?n.startY=e.pageY:e instanceof TouchEvent&&(n.startY=e.touches[0].pageY),n.currentY=n.startY,n._infScroll&&(n._infScroll.style.willChange="transform",n._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},n.onMove=function(e){n.dragging&&(e instanceof MouseEvent?n.currentY=e.pageY:e instanceof TouchEvent&&(n.currentY=e.touches[0].pageY),n.currentY<n.startY||(n.currentY-n.startY>=Number(n.props.pullDownToRefreshThreshold)&&n.setState({pullToRefreshThresholdBreached:!0}),n.currentY-n.startY>1.5*n.maxPullDownDistance||n._infScroll&&(n._infScroll.style.overflow="visible",n._infScroll.style.transform="translate3d(0px, "+(n.currentY-n.startY)+"px, 0px)")))},n.onEnd=function(){n.startY=0,n.currentY=0,n.dragging=!1,n.state.pullToRefreshThresholdBreached&&(n.props.refreshFunction&&n.props.refreshFunction(),n.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame((function(){n._infScroll&&(n._infScroll.style.overflow="auto",n._infScroll.style.transform="none",n._infScroll.style.willChange="unset")}))},n.onScrollListener=function(e){"function"==typeof n.props.onScroll&&setTimeout((function(){return n.props.onScroll&&n.props.onScroll(e)}),0);var t=n.props.height||n._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;n.actionTriggered||((n.props.inverse?n.isElementAtTop(t,n.props.scrollThreshold):n.isElementAtBottom(t,n.props.scrollThreshold))&&n.props.hasMore&&(n.actionTriggered=!0,n.setState({showLoader:!0}),n.props.next&&n.props.next()),n.lastScrollTop=t.scrollTop)},n.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},n.throttledOnScrollListener=function(e,t,n,r){var o,i=!1,a=0;function s(){o&&clearTimeout(o)}function l(){var l=this,c=Date.now()-a,u=arguments;function d(){a=Date.now(),n.apply(l,u)}i||(r&&!o&&d(),s(),void 0===r&&c>e?d():!0!==t&&(o=setTimeout(r?function(){o=void 0}:d,void 0===r?e-c:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),l.cancel=function(){s(),i=!0},l}(150,n.onScrollListener).bind(n),n.onStart=n.onStart.bind(n),n.onMove=n.onMove.bind(n),n.onEnd=n.onEnd.bind(n),n}return function(e,t){function n(){this.constructor=e}u4(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(e){this.props.dataLength!==e.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(e,t){return e.dataLength!==t.prevDataLength?d4(d4({},t),{prevDataLength:e.dataLength}):null},t.prototype.isElementAtTop=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=m4(t);return r.unit===h4?e.scrollTop<=r.value+n-e.scrollHeight+1:e.scrollTop<=r.value/100+n-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=m4(t);return r.unit===h4?e.scrollTop+n>=e.scrollHeight-r.value:e.scrollTop+n>=r.value/100*e.scrollHeight},t.prototype.render=function(){var e=this,t=d4({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),r=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return o.createElement("div",{style:r,className:"infinite-scroll-component__outerdiv"},o.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&o.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},o.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(S);var v4=a((({options:r,placeholder:o="Select an option",placement:a="bottom",multiple:c=!1,disabled:h=!1,maxCount:p,popupClassName:m="",optionProps:v,selectRef:y,disableClick:b,onChange:_,loadMoreOptions:x,searchOptions:w,totalOptionsLength:S,selectedOption:k,setSelectedOption:C,dropDownRef:E,portalClassName:M="",...P})=>{const[O,T]=u(!1),[N,D]=u(""),A=i((()=>c4((e=>{w(e)}),1e3)),[w]);l((()=>()=>{A.cancel()}),[A]),l((()=>{A(N)}),[N]);const L=s(null),I=s(null);g(E??{current:null},(()=>I.current));const{targetPosition:z,calculatePosition:R}=ee({containerRef:L,targetRef:I,initialPlacement:a});d((()=>{O&&L.current&&I.current&&R()}),[O,r,R]);const $=e=>{c?(()=>{if(!Array.isArray(k))return;const t=Boolean(k.find((t=>t.value===e.value&&t.label===e.label)))?k.filter((t=>t.value!==e.value)):[...k,e];C(t),_?.(t)})():(C(e),_?.(e),T(!1))};g(y,(()=>({toggleDropdown:j,clear:F})));const F=()=>{C([]),_?.([]),T(!1)},j=e=>{T(void 0===e?e=>!e:e)},W=f(),Y=null===r;return t(n,{children:[e(H,{ref:L,onClick:()=>{h||b||j()},dimensionX:"fill",dimensionY:36,...P,root:{className:U3,children:e(V,{dimensionX:"fill",style:P.root?.style,className:`${P.root?.className} ${q3}`,children:(!c||Array.isArray(k)&&k.length)&&"object"==typeof r?.[0]?k?.map?.((t=>e(nm,{variant:"outlined",label:t.label,onDelete:()=>$(t)},`${t.value}${t.label}`)))??k?.label??o:o}),dimensionX:"fill",alignment:"leftCenter"},suffix:{className:t4,onClick:e=>{e.stopPropagation(),C(c?[]:null)},children:e(Ga,{className:Q3,name:"delete",size:"sm"})},className:`${P.className} ${Y3} ${h&&X3}`}),O&&e(Gm,{onClickOutside:()=>{b||T(!1)},className:M,additionalRefs:[L,I],children:e(B,{ref:I,style:{...z},className:`${m} ${Z3}`,direction:"vertical",alignment:"leftTop",gap:0,id:W,children:t(g4,{dataLength:r?.length||0,next:()=>{Y||x()},hasMore:S>(r?.length||0),loader:e(_s,{size:"small"}),scrollableTarget:W,className:e4,children:[e("div",{className:G3,children:e(K,{gap:10,dimensionX:"fill",prefix:{children:e(Ga,{name:"magnify",className:K3})},inputProps:{placeholder:"Search",value:N,onChange:e=>D(e.target.value)},suffix:{children:Y?e(_s,{size:"small"}):null},className:J3})}),r?.map((t=>{const n="object"==typeof t?t.value:t,r=c?Array.isArray(k)&&Boolean(k.find((e=>e.value===t.value&&e.label===t.label))):k===t,o=c&&!!p&&Array.isArray(k)&&k.length>=p&&!r;return e(tg,{disabled:o,dimensionX:L.current?.offsetWidth,multiple:c,option:t,selected:r,onClick:()=>$(t),...v},n.toString())}))]})})})]})}));var y4=a((({label:t,description:n,value:r,onChange:o,selectProps:i,inputContainerClassName:a,getOptions:c,loadMoreOptions:d,searchOptions:h,totalOptionsLength:p,multiple:f,externalDropdownRef:m,...v})=>{const y=s(null),b=s(null),[_,x]=u(null),[w,S]=u((()=>r||(f?[]:null)));l((()=>{(r||0===r||""===r)&&S(r)}),[r]);l((()=>{c().then((e=>x(e)))}),[]);return g(i?.selectRef??{current:null},(()=>y.current)),g(m??{current:null},(()=>b.current)),e(pe,{dimensionX:"fill",description:n,dropDownRef:b,onFocusChange:e=>{y?.current?.toggleDropdown(e)},labelProps:{dimensionX:"hug",divider:!0,prefix:{children:e(Ga,{className:B3,name:"callMerge"})},root:{dimensionX:"hug",children:e(V,{className:H3,size:"medium",children:t})}},inputContainerProps:{className:`${V3} ${a}`},...v,children:e(v4,{totalOptionsLength:p,disableClick:!0,options:_,placeholder:"",multiple:f,onChange:e=>{o?.(e)},...i,selectRef:y,className:`${W3} ${i?.className}`,loadMoreOptions:()=>{d().then((e=>x([..._??[],...e])))},searchOptions:e=>{h(e).then((e=>{x(e)}))},selectedOption:w,setSelectedOption:S,dropDownRef:b})})}));const b4={string:t=>e(nq,{label:t.title,description:t.description,inputContainerClassName:t.className,value:t.value,options:t.enum,onChange:e=>{t.onChange?.({key:t.key,value:e})}}),number:t=>e(lq,{label:t.title,description:t.description,inputContainerClassName:t.className,value:t.value,options:t.enum,onChange:e=>t.onChange?.({key:t.key,value:e})}),textarea:t=>e(fq,{title:t.title,containerProps:{className:t.className},value:t.value,onChange:e=>t.onChange?.({key:t.key,value:e.target.value}),icon:t.icon??"formatSize",placeholder:t.placeholder}),date:t=>e(xq,{label:t.title,description:t.description,inputContainerClassName:t.className,value:t.value,onChange:e=>t.onChange?.({key:t.key,value:e})}),boolean:t=>e(kq,{checked:t.value,label:t.title,description:t.description,containerProps:{dimensionX:"fill"},onChange:e=>t.onChange?.({key:t.key,value:e}),size:t.size,className:t.className}),color:t=>e(Eq,{label:t.title,description:t.description,inputContainerClassName:t.className,value:t.value,onChange:e=>t.onChange?.({key:t.key,value:e})}),storage:t=>e(TU,{onUpload:()=>{},label:t.title,containerProps:{className:t.className}}),multiselect:t=>e(IU,{label:t.title,description:t.description,inputContainerClassName:t.className,value:t.value,options:t.enum,onChange:e=>t.onChange?.({key:t.key,value:e})}),location:t=>{if(MV.api.isTypeLocation(t.value)){const e=t?.value.coordinates;t.value={lat:e[1],lng:e[0]}}return e(jU,{title:t.title,dimensionX:"fill",coordinates:t.value,onChange:e=>{let n=e;MV.api.isTypeLocation(t.value)&&(n={type:"Point",coordinates:[e.lng,e.lng]}),t.onChange?.({key:t.key,value:n})},className:t.className})},richtext:t=>e(o3,{headerProps:{label:t.title,icon:"formatAlignCenter"},value:t.value,onChange:e=>t.onChange?.({key:t.key,value:e}),className:t.className,placeHolder:t.placeholder}),object:t=>e(a3,{properties:t.properties,title:t.title,description:t.description,value:t.value,onChange:e=>{t.onChange?.({key:t.key,value:e})},errors:t.errors,className:t.className}),array:t=>e(l3,{title:t.title,description:t.description,value:t.value,onChange:e=>t.onChange?.({key:t.title,value:e}),minItems:t.minItems,maxItems:t.maxItems,items:t.items,propertyKey:t.key,errors:t.errors,className:t.className}),chip:t=>e(j3,{value:t.value??[],onChange:e=>{t.onChange?.({key:t.key,value:e})},valueType:t.valueType,className:t.className}),relation:t=>e(y4,{value:t.value,onChange:e=>t.onChange?.({key:t.key,value:e}),label:t.title,getOptions:t.getOptions,loadMoreOptions:t.loadMoreOptions,searchOptions:t.searchOptions,totalOptionsLength:t.totalOptionsLength,multiple:"onetomany"===t.relationType,selectProps:{popupClassName:t.popupClassName||""},className:t.className}),select:t=>e(ng,{options:t.enum,value:t.value,onChange:e=>{t.onChange?.({key:t.key,value:e})},className:t.className})},_4=({properties:n,value:r,error:o,onChange:i,containerClassName:a,errorClassName:s,typeOverrides:l})=>{const c=l?{...b4,...l}:b4,u=Boolean(a||s);return Object.entries(n).map((([n,l])=>{const d="object"==typeof r&&!Array.isArray(r);if(d&&l.renderCondition){const{field:e}=l.renderCondition,t=r[e],n=(e,n=!1)=>{if(!(e in l.renderCondition))return!1;const r=l.renderCondition[e],o=Array.isArray(r)?r.includes(t):t===r;return n?o:!o};if(n("notEquals",!0)||n("equals"))return null}const h=d?r[n]??r:r,p=o?.[n];return t("div",{style:u?void 0:{position:"relative",width:"100%"},className:a,id:l.id??void 0,children:[c[l.type]({key:n,title:l.title,description:l.description,value:h,className:l.className,properties:l.properties,enum:l.enum??l.items?.enum,minItems:l.minItems,maxItems:l.maxItems,items:l.items,onChange:e=>(e=>{const t=structuredClone(r);t[e.key]=e.value,i?.(t)})(e),getOptions:l.getOptions,loadMoreOptions:l.loadMoreOptions,searchOptions:l.searchOptions,totalOptionsLength:l.totalOptionsLength,size:l.size,valueType:l.valueType,errors:"string"==typeof p?void 0:p,icon:l.icon,placeholder:l.placeholder,relationType:l.relationType,popupClassName:l.popupClassName}),p&&"string"==typeof p&&e(V,{className:s,style:u?void 0:{position:"absolute",bottom:0,left:0,pointerEvents:"none",whiteSpace:"nowrap"},size:"xsmall",variant:"danger",children:p})]},n)}))},x4=(e,t)=>{switch(e){case"string":case"textarea":case"richtext":case"color":case"storage":case"select":case"date":default:return"";case"multiselect":case"chip":case"relation":case"array":return[];case"number":return 0;case"boolean":return!1;case"location":return{lat:0,lng:0};case"object":{if(!t)return{};const e={};return Object.entries(t).forEach((([t,n])=>{e[t]=n.default??x4(n.type,n.properties)})),e}}},w4=e=>e?x4(e.type,e.properties):"",S4=({propertyKey:e,items:t,value:n,activeIndex:r,onChange:o,errors:a})=>{const s=c((t=>{if(null===r){const r=t[e],i=[...n||[]];i.push(r),o?.(i)}else{const i=[...n||[]];r>=0&&r<i.length&&(i[r]=t[e],o?.(i))}}),[e,n,r,o]),l=i((()=>null!==r&&r>=0?n?.[r]:w4(t)),[r,n,t]);return{inputFields:_4({properties:{[e]:t},value:{[e]:l},onChange:s,error:a}),getDefaultValue:c((()=>w4(t)),[t])}},k4=({propertyKey:t,items:n,value:r,activeIndex:o,onChange:i,errors:a})=>{const{inputFields:s}=S4({propertyKey:t,items:n,value:r,activeIndex:o,onChange:i,errors:a});return e("div",{children:s})},C4=({propertyKey:n,value:r,items:o,popoverProps:i,buttonsContainerProps:a,errors:s,onChange:l})=>{const[c,d]=u(null),h=e=>{if(e>=0)d(e);else{const e=[...r||[]],t=w4(o);e.push(t);const n=e.length-1;l?.(e),d(n)}},{contentProps:p,containerProps:f,...m}=i??{},g=[GX.contentContainer,p?.className].filter(Boolean).join(" "),v=[GX.container,f?.className].filter(Boolean).join(" "),y=[GX.buttonsContainer,a?.className].filter(Boolean).join(" ");return e(jA,{contentProps:{...p,className:g},containerProps:{dimensionX:"hug",...f,className:v},...m,open:null!==c,onClose:()=>d(null),content:null===c?null:e(k4,{propertyKey:n,items:o,value:r,activeIndex:c,onChange:e=>{l?.(e)},errors:s}),children:t(B,{...a,className:y,onClick:e=>e.stopPropagation(),children:[r?.map(((n,o)=>t("div",{className:GX.itemButtonWrapper,children:[e(xs,{variant:"filled",className:GX.itemButton,onClick:()=>h(o),children:o+1}),e(xs,{variant:"filled",shape:"circle",className:GX.removeButton,onClick:e=>((e,t)=>{t.stopPropagation();const n=[...r||[]];n.splice(e,1),l?.(n),c===e?d(null):null!==c&&c>e&&d(c-1)})(o,e),children:e(Ga,{name:"close",size:"xs"})})]},JSON.stringify(n)+o))),e(xs,{variant:"filled",className:GX.itemButton,onClick:()=>h(-1),children:"+"})]})})};var E4=a((({checked:t,disabled:n=!1,containerProps:r,onChange:o})=>e(FL,{checked:t,disabled:n,...r,onChange:o}))),M4="ColorMinimized-module_colorMinimized__CnRpu",P4="ColorMinimized-module_closeIcon__SH3uo";const O4=({value:t="#000000",onClear:n,onChange:r,...o})=>{const[i,a]=u(t);return e(H,{alignment:"leftCenter",dimensionX:"fill",className:M4,...o,root:{dimensionX:"fill",alignment:"leftCenter",children:e(om,{value:i||"#000000",onChange:e=>{a(e),r?.(e)}}),...o.root},suffix:{dimensionX:"hug",alignment:"center",children:e(xs,{children:e(Ga,{name:"close"}),color:"transparent",onClick:e=>{e.preventDefault(),e.stopPropagation(),a(""),r?.(""),n?.()},className:P4}),...o.suffix}})};var T4="Date-module_minimizedDatePicker__ZIsQ7",N4="Date-module_clearButton__WMLse";const D4=({onChange:t,value:n,placeholder:r="",onClear:o,datePickerClassName:i,...a})=>e(H,{mode:"fill",dimensionX:"fill",gap:10,...a,className:`${T4} ${a.className}`,root:{alignment:"leftCenter",children:e(TA,{onChange:e=>{t?.(new Date(e))},value:n,placeholder:r,suffixIcon:null,allowClear:!1,className:i}),...a.root},suffix:{...a.suffix,children:e(xs,{variant:"text",className:N4,keepWidth:!1,onClick:o,children:e(Ga,{name:"close"})})}});var A4={container:"Location-module_container__SbKlF",iconContainer:"Location-module_iconContainer__ie0Rb",input:"Location-module_input__aoNPw",map:"Location-module_map__7pBAg"};const L4=({contentProps:t,mapProps:n,icon:r,childrenProps:o,containerProps:i,...a})=>{const s={lat:51.505,lng:-.09},c=()=>{const e=n?.coordinates;return void 0===e?.lat||void 0===e?.lng?"lat , lng":`${e.lat} , ${e.lng}`},[d,h]=u(c());l((()=>{h(c())}),[n?.coordinates]);l((()=>{const e=d.split(",");if(2===e.length){const t=Number.parseFloat(e[0].trim()),r=Number.parseFloat(e[1].trim());Number.isNaN(t)||Number.isNaN(r)||n?.onChange?.({lat:t,lng:r})}}),[d]);const p=(()=>{const e=n?.coordinates;return void 0===e?.lat||void 0===e?.lng?s:e})(),f=`${p.lat}-${p.lng}`;return e(jA,{content:e(_L,{...n,coordinates:p},f),contentProps:{dimensionX:500,dimensionY:500,...t},containerProps:{dimensionX:"fill",alignment:"leftCenter",...a},children:e(H,{dimensionX:"fill",dimensionY:"fill",...o,prefix:{children:o?.prefix?.children||r||e("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAStSURBVHgBNZXZblNXFIa/vc88+NiJDSEDbQCVAheFtmp7Gy6rSn2DCt4EeBLKG7TqZWmLVKnTRYWYKYiEEEicxLN9Jp+hK1HrC8vS2fv3Wv//rXUU/312Nx9uGOX0Bv7SlbmyW7b2QZdoDXmeQtylceI8tVLM0py86hIYJ+S5cW8WZ3fW1pa/PdLRR19v3nZvaEP/YoTLG4YVtOqqJi9SLMvCMCx6xiLa7ZDOC+bJmHI+J8JBGyazWm9MDPv2aDC4caSl9rf/ua6CpduHB29ZbjfI0plcblOWFVVV4jgO6XgHb/FDxsNXNO0BuXkRRSVnE6Iokg5y/EZAnGRXda7Da249YNHJMFVFXLnU6SF2+gZbxPKyxMgz4ne/49cz4omW50+xzJoojKAqjkV7ewcU2eCoUzbmuknlnqJyOijtYPonmCQlbtlDpT3Mk5cIVj6j4dr0sgbKWiGb9hjvP+Ggsnk2vkvXtuR8fkUXtke31JhOiJo+xCKlloY6731EYp2iNCrqKiOdxsTa4PTpBfG1RWNhjR3W8fM9DruXOa96cjdpaX/2F6eNXNT7TNOGpCfe1TCZTnDj54TBCvnoLWbyGNc9g22kFJNX9AcDLi7GmFLMpeaUF1NFXQ+PqOgwiAUDmkyjAwlkJh71cE3FVhxiJZuYhiJc/Zy0/4j9vRzHRAiwGcYllBkT3SF0FIV7BT1q+RSNV9jvDkjdEfs//UyjIW2l2zR1we4sIBTzi8Mn1NK+b045tN4nEYSWFlfpiWjW32IhOMVQyFDx+LB+Mv2R7laMvXyednOPTtLBitaxYxO7OGSSG6T+Kg1x94/9LT5ZXJaEHeQ+2bwWOiTsWjDKp+g98adSmtUPPLQK2f1tzNwLYWygLZ+tbJWWM6TtxMyLgqvtjNCV9mqDWe81kSN2yW872yEIIrEssvGtWgy1aHnPWPyiZC118X1P0jRZ05tgn4XZA3TRozaXUZl4rQyiwOegPwRTYLdOUo3fSBEJ7L8uhPIea/PzXDS/oT89IJ92mXc3qU4uSVtjDOsCDf0dOE10uI4pQ5taS2JCSDbSUrUWQhRq1N+p8/gxufqYTNKsy23aoSyB8XNs8bE/eSZXouMRHFVtPIF72uvRkJQzDEaNB0LFpzSLMVomSeeZhW+sYlYDOsU2C95ZOSZGuzvUkx9E6k9s3UfZDsXua8q8ZjP4ntL1sSUYZ3SBllHiWTliMdpTu8Ot+RC3tYIKOpTJSxw1ocjXwbNR5QYzfYZR4tE6u0JcxLjJ15LsRCDWMq4e+4WUIEi6koWudXg/8FpiiJibTlDmEv3cl5FzmeuvKKJz2FYkocnqqiMCqXSpesvr0V1I9jlhx6waM6Z5iXIX7mnZELeMapm/5y0m1iqW25Iqh7LzKvrDEVb2lJkcbmbPcPNNHFth2Gu0/S+Zy0zX6qjNNkoKGMTGHXW8rV/8elPbizfyiQhYEozhSJoRbVv+GZNhXdO0lmXBCsj9lwJ1QC5UmAJ4NRCULNmFur517v3LN9X/r4Cd7Z3rbmhfc73mxmzvEZl7lrDcoTQXZOUlx0h4ns8wS3D8JXQWY6hiWCSj+0Fr/dbCgnfvSOdfUypD2h2KlUYAAAAASUVORK5CYII=",alt:"location",className:A4.icon}),className:A4.iconContainer},root:{children:e(G,{value:d,onChange:e=>{const t=e.target.value;(""===t||/^-?\d*\.?\d*\s*,\s*-?\d*\.?\d*$/.test(t))&&h(t)},dimensionY:"fill",className:A4.input}),dimensionX:"fill",dimensionY:"fill",className:o?.root?.className},className:`${A4.container} ${o?.className}`})})};var I4="MultiSelection-module_multiSelectionContainer__tUi2u",z4="MultiSelection-module_multiSelect__SA5u-";const R4=({options:t,value:n,onChange:r,selectProps:o,...i})=>{const a=s(null);return e(H,{mode:"fill",dimensionX:"fill",root:{children:e(ng,{selectRef:a,prefix:{children:e(Ga,{name:"chevronDown"})},suffix:{children:Array.isArray(n)&&n.length>0&&e(xs,{variant:"text",keepWidth:!1,onClick:e=>{e.preventDefault(),e.stopPropagation(),a?.current?.clear()},children:e(Ga,{name:"close"})})},multiple:!0,options:t,value:n,onChange:e=>r?.(e),...o,className:z4})},...i,className:`${I4} ${i.className}`})};var $4="NumberMinimized-module_numberMinimized__o1ZAN",F4="NumberMinimized-module_select__yHQXe",j4="NumberMinimized-module_closeIcon__EgNTI";var B4=a((({onClear:t,value:n,options:r,inputProps:o,onChange:i,...a})=>{const l=s(null),c=s(null);return e(H,{alignment:"leftCenter",dimensionX:"fill",className:$4,...a,root:{dimensionX:"fill",alignment:"leftCenter",children:r?e(ng,{selectRef:l,className:F4,placeholder:void 0!==n?String(n):"",value:n,options:r||[],onChange:e=>i?.(e)}):e(G,{ref:c,value:n??"",type:"number",...o,onChange:e=>i?.(Number(e.target.value))}),...a.root},suffix:{dimensionX:"hug",alignment:"center",children:e(xs,{children:e(Ga,{name:"close"}),color:"transparent",onClick:e=>{e.preventDefault(),e.stopPropagation(),t?.(),l.current&&l.current.clear(),c.current&&(c.current.value="")},className:j4}),...a.suffix}})})),H4="Object-module_inputMinimized__JH1n-",W4="Object-module_contentContainer__y0Sfp",V4="Object-module_value__SJt70";const Y4=({value:t,popoverProps:n,objectInputProps:r,properties:o,onChange:a,...s})=>{const l=i((()=>((e,t)=>{const n=Object.keys(t);return Object.fromEntries(n.map((t=>[t,e?.[t]])))})(t,o)),[t,o]),{contentProps:c,containerProps:u,...d}=n??{};return e(jA,{contentProps:{className:W4,...c},containerProps:{dimensionX:"fill",...u},...d,content:e(a3,{properties:o,value:t,onChange:e=>a?.(e),...r}),children:e(B,{dimensionX:"fill",alignment:"leftCenter",dimensionY:36,...s,className:`${s.className} ${H4}`,children:e(V,{className:V4,children:JSON.stringify(l)})})})};var X4="RichText-module_richTextMinimized__LUAfH",q4="RichText-module_richTextContent__F9RzT",U4="RichText-module_placeholder__p7vgx";var Z4=a((({value:n,richTextProps:r,placeHolder:o,onChange:i,onCancel:a,onSave:s,...d})=>{const[h,p]=u(n??""),[f,m]=u(!1);l((()=>{f||p(n??"")}),[f,n]);const g=c((e=>{p(e)}),[]),v=c((()=>{p(n??""),m(!0)}),[n]),y=c((()=>{m(!1),p(n??"")}),[n]),b=c((()=>{y(),a?.()}),[y,a]),_=c((()=>{i?.(h),m(!1),s?.(h)}),[h,i,s]),x=n&&""!==n.trim()&&"<p></p>"!==n,{onClick:w,...S}=d,k=c((e=>{w?.(e),v()}),[v,w]);return e(jA,{content:t(B,{direction:"vertical",gap:10,children:[e(o3,{value:h,contentProps:r,placeHolder:o,onChange:g}),t(B,{dimensionX:"fill",alignment:"rightBottom",gap:10,children:[e(xs,{variant:"filled",onClick:b,children:"Cancel"}),e(xs,{variant:"solid",onClick:_,children:"Save"})]})]}),containerProps:{dimensionX:"fill"},open:f,onClose:y,children:e(B,{dimensionX:"fill",alignment:"leftCenter",className:X4,onClick:k,...S,children:e("div",x?{className:q4,dangerouslySetInnerHTML:{__html:n||""}}:{className:q4,children:"string"==typeof o?e("span",{className:U4,children:o}):o})})})})),G4="StringMinimized-module_stringMinimized__m53JQ",K4="StringMinimized-module_select__uPgy-",J4="StringMinimized-module_closeIcon__N2ycP";var Q4=a((({onClear:t,value:n,options:r,inputProps:o,enumOnChange:i,...a})=>e(H,{alignment:"leftCenter",dimensionX:"fill",className:G4,...a,root:{dimensionX:"fill",alignment:"leftCenter",children:r?e(ng,{className:K4,placeholder:n||" ",options:r||[],onChange:e=>i?.(String(e))}):e(G,{value:n,...o}),...a.root},suffix:{dimensionX:"hug",alignment:"center",children:e(xs,{children:e(Ga,{name:"close"}),color:"transparent",onClick:t,className:J4}),...a.suffix}}))),e6="TextArea-module_textArea__VbAA6";const t6=({value:t,onClear:n,onChange:r,focusedRows:o=3,onFocus:i,onBlur:a,rows:l=2,cols:c=1,...d})=>{const[h,p]=u(!1),f=s(null);return Q({targetElements:[f],onClickOutside:()=>{p(!1),a?.(!1)}}),e(H,{ref:f,mode:"fill",dimensionX:"fill",prefix:d.prefix,root:{children:e("textarea",{value:t,onChange:e=>r?.(e.target.value),onFocus:()=>{p(!0),i?.(!0)},rows:h?Math.max(o,l):l,cols:c}),...d.root},suffix:{children:e(xs,{variant:"icon",color:"transparent",onClick:n,children:e(Ga,{name:"close"})}),...d.suffix},className:`${e6} ${d.className}`})};var n6="StorageMinimized-module_storageMinimized__ghk8k",r6="StorageMinimized-module_storage__QZPz8",o6="StorageMinimized-module_text__kRTzX";const i6=({file:n,placeholder:r="Click or Drag & Drop",onUpload:o,onClickShowFileSelect:i,onDelete:a,...l})=>{const c=s(null);return e(H,{ref:c,alignment:"leftCenter",dimensionX:"fill",mode:"fill",root:{children:e(EU,{multiple:!1,onDrop:e=>{e.length&&o?.(e[0])},children:({getRootProps:o,getInputProps:a})=>t(B,{className:r6,alignment:"leftCenter",dimensionX:"fill",gap:10,...o(),onClick:()=>{i?.()},children:[e(Ga,{name:"storage",size:14}),e(V,{className:o6,children:n?n.name:r}),e("input",{...a()})]})})},suffix:{children:n&&e(xs,{variant:"icon",children:e(Ga,{name:"close"}),color:"transparent",onClick:a})},...l,className:`${l.className} ${n6}`})};var a6=a((({selectClassName:t="",label:n="",options:r=[],onChange:o,...i})=>e(B,{...i,dimensionX:"fill",alignment:"leftCenter",children:e(ng,{className:t,placeholder:n,options:r,onChange:o||(()=>{})})}))),s6={drawerContainer:"Drawer-module_drawerContainer__ygAhi",contentContainer:"Drawer-module_contentContainer__Bku-Q",closeButton:"Drawer-module_closeButton__dw57X",leftPosition:"Drawer-module_leftPosition__kS7SQ",scrollableContent:"Drawer-module_scrollableContent__gAaIU",top:"Drawer-module_top__YhWtK",bottom:"Drawer-module_bottom__5nFWz",xs:"Drawer-module_xs__jAtGZ",sm:"Drawer-module_sm__Up7LN",md:"Drawer-module_md__cJcNU",lg:"Drawer-module_lg__c7C-6",xl:"Drawer-module_xl__r6s2-",full:"Drawer-module_full__maAwS",hug:"Drawer-module_hug__JzEGJ",left:"Drawer-module_left__NCP-V",right:"Drawer-module_right__X1qUr",leftToMiddle:"Drawer-module_leftToMiddle__UwTtm",slideFromLeft:"Drawer-module_slideFromLeft__PD3iU",rightToMiddle:"Drawer-module_rightToMiddle__-1zTg",slideFromRight:"Drawer-module_slideFromRight__y-9Lp",topToBottom:"Drawer-module_topToBottom__DlPXA",slideFromTop:"Drawer-module_slideFromTop__-c93O",bottomToTop:"Drawer-module_bottomToTop__b0ULm",slideFromBottom:"Drawer-module_slideFromBottom__uSm8d",shake:"Drawer-module_shake__pBbnG"};const l6=["xs","sm","md","lg","xl","full","hug"],c6=({placement:n,size:r="hug",children:o,showBackdrop:i=!0,backdropType:a="default",backdropClassName:s,backdropProps:c,showCloseButton:d=!0,isOpen:h=!1,onClose:p,portalClassName:f,contentClassName:m,scrollableContentClassName:g})=>{const[v,y]=u(h),[b,_]=u(!1),[x,w]=u(!1);l((()=>{y(h)}),[h]);const S=()=>{y(!1),p&&p()};if(!v)return null;const k={top:"topToBottom",right:"rightToMiddle",bottom:"bottomToTop",left:"leftToMiddle"}[n],C="number"==typeof r||"string"==typeof r&&!l6.includes(r),E=C?"left"===n||"right"===n?{width:"number"==typeof r?`${r}px`:r}:{height:"number"==typeof r?`${r}px`:r}:{};return e(Gm,{className:f,children:t(B,{className:s6.drawerContainer,children:[e(FA,{showBackdrop:i,...c,className:s,onClick:()=>{"static"===a?(_(!0),w(!1),setTimeout((()=>{_(!1),w(!0)}),400)):S()}}),t("div",{className:`${s6.contentContainer} ${x?"":s6[k]} ${b?s6.shake:""} ${s6[n]} ${C?"":s6[r]} ${m||""}`,style:E,children:[d&&e(xs,{className:`${s6.closeButton} ${"right"===n?s6.leftPosition:s6.rightPosition}`,onClick:S,children:e(Ga,{name:"close"}),variant:"icon"}),e("div",{className:`${s6.scrollableContent} ${g||""}`,children:o})]})]})})};var u6={container:"Tab-module_container__e6CN6",indicator:"Tab-module_indicator__UNCf0",item:"Tab-module_item__jpQZh",default:"Tab-module_default__qy-23",active:"Tab-module_active__687wz",underline:"Tab-module_underline__1gKBc",window:"Tab-module_window__vPuG0",root:"Tab-module_root__gGJhw"};var d6=a((({type:n="default",items:r,indicatorClassName:o,indicatorMode:i="equal",value:a,onChange:c,...d})=>{const[h,p]=u(0),[f,m]=u([]),g=s(null),v=s([]);l((()=>{(a||0===a)&&p(a)}),[a]);l((()=>{const e=v.current.map((e=>(e?.offsetWidth||0)+("window"===n?5:20)));m(e)}),[r,i,n]);const y="fit"===i?f[h]||0:f[h]-2,b=f.slice(0,h).reduce(((e,t)=>e+t-5),0);return t(B,{ref:g,dimensionX:"fill",gap:"window"===n?0:20,...d,className:`${u6.container} ${u6[n]} ${d.className||""}`,children:["window"!==n&&e("div",{className:`${u6.indicator} ${o||""}`,style:{width:y,left:b}}),r.map(((t,r)=>e(H,{ref:e=>v.current[r]=e,dimensionX:"equal"===i?"fill":"hug",dimensionY:"fill",mode:"middle",prefix:{children:t.prefix?.children,...t.prefix,className:`${t.prefix?.className||""}`},root:{children:t.root?.children,...t.root,className:`${u6.root} ${t.root?.className||""}`},suffix:{children:t.suffix?.children,...t.suffix,className:`${t.suffix?.className||""}`},onClick:()=>(e=>{p(e),c?.(e)})(r),...t,className:`${u6.item} ${u6[n]} ${r===h?u6.active:""}`},r)))]})})),h6={container:"CircularProgress-module_container__S-38y",svg:"CircularProgress-module_svg__gon7t",backgroundCircle:"CircularProgress-module_backgroundCircle__MQZ2z",progressCircle:"CircularProgress-module_progressCircle__aya2S",normal:"CircularProgress-module_normal__asGeP",success:"CircularProgress-module_success__F6h9t",danger:"CircularProgress-module_danger__POA1X",centerText:"CircularProgress-module_centerText__SKGzM",xxs:"CircularProgress-module_xxs__EO7l5",xs:"CircularProgress-module_xs__WVADp",sm:"CircularProgress-module_sm__yLhUL",md:"CircularProgress-module_md__5RBcj",lg:"CircularProgress-module_lg__mzdQa",xl:"CircularProgress-module_xl__tuBt-"};const p6={xxs:25,xs:40,sm:60,md:80,lg:100,xl:120},f6={xxs:"xs",xs:"xs",sm:"sm",md:"md",lg:"lg",xl:"lg"},m6={success:"check",danger:"close",normal:void 0},g6=({percent:n=0,size:r="md",strokeWidth:o=6,showLabel:i=!0,status:a="normal",label:s})=>{const l=p6[r],c=(l-o)/2,u=2*Math.PI*c,d=Math.min(Math.max(n,0),100),h=u-d/100*u,p=m6[a],f=f6[r];return t("div",{className:h6.container,style:{width:l,height:l},children:[t("svg",{className:h6.svg,width:l,height:l,children:[e("circle",{className:h6.backgroundCircle,cx:l/2,cy:l/2,r:c,strokeWidth:o}),e("circle",{className:`${h6.progressCircle} ${h6[a]}`,cx:l/2,cy:l/2,r:c,strokeWidth:o,strokeDasharray:u,strokeDashoffset:h})]}),i&&e("div",{className:`${h6.centerText} ${h6[a]} ${h6[r]}`,children:void 0!==s?s:p?e(Ga,{name:p,size:f}):`${Math.round(d)}%`})]})};var v6;!function(e){e.camelToKebab=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e.deepCopy=e=>JSON.parse(JSON.stringify(e)),e.capitalize=e=>e.charAt(0).toUpperCase()+e.slice(1)}(v6||(v6={}));const y6={light:{primary:"#1976d2",primaryLight:"#63a4ff",primaryDark:"#004ba0",danger:"#d32f2f",dangerLight:"#ff6659",dangerDark:"#9a0007",success:"#388e3c",successLight:"#6abf69",successDark:"#00600f",soft:"#f5f5f5",softLight:"#ffffff",softDark:"#c2c2c2",background:"#ffffff",menuBackground:"#f0f0f0",zebra:"#f9f9f9",border:"#e0e0e0",boxShadow:"rgba(0, 0, 0, 0.1)",fontPrimary:"#212121",fontSecondary:"#757575",inputBackground:"#ffffff",inputPlaceholder:"#9e9e9e",tonalOffset:.2},dark:{primary:"#90caf9",primaryLight:"#e3f2fd",primaryDark:"#42a5f5",danger:"#ef5350",dangerLight:"#ff867c",dangerDark:"#b61827",success:"#66bb6a",successLight:"#98ee99",successDark:"#338a3e",soft:"#121212",softLight:"#1e1e1e",softDark:"#000000",background:"#121212",menuBackground:"#1e1e1e",zebra:"#181818",border:"#333333",boxShadow:"rgba(0, 0, 0, 0.5)",fontPrimary:"#ffffff",fontSecondary:"#bdbdbd",inputBackground:"#333333",inputPlaceholder:"#757575",tonalOffset:.3}},b6={PRIMARY:"#1c1c50",BACKGROUND:"#f5f5f5",MENU_BACKGROUND:"#ffffff",ZEBRA:"f6f6f9",SUCCESS:"#21f412",DANGER:"#f41212",SOFT:"#f5f5f5",BORDER:"#d4d0d0",BOX_SHADOW:"#0000000d",FONT_PRIMARY:"#525252",FONT_SECONDARY:"#525252",INPUT_BACKGROUND:"#fafafa",INPUT_PLACEHOLDER:"#9b9b9b",TONAL_OFFSET:.2},_6=5,x6=10,w6=10,S6=16,k6="Inter",C6=e=>{v6.deepCopy(e);const t=E6(e.palette?.primary||b6.PRIMARY,e.palette?.tonalOffset),n=E6(e.palette?.success||b6.SUCCESS,e.palette?.tonalOffset),r=E6(e.palette?.danger||b6.DANGER,e.palette?.tonalOffset),o=E6(e.palette?.soft||b6.SOFT,e.palette?.tonalOffset),i=e.borderRadius?.base??_6,a=e.padding?.base??x6,s=e.gap?.base??w6,l=e.palette?.mode,c=l?y6[l]:void 0,u=(t,n)=>e.palette?.[t]||c?.[t]||n,d=(t,n)=>e.borderRadius?.[t]??i*n,h=(t,n)=>e.padding?.[t]??s*n,p=(t,n)=>e.gap?.[t]??a*n,f={palette:{primary:u("primary",t.base),primaryLight:u("primaryLight",t.light),primaryDark:u("primaryDark",t.dark),danger:u("danger",r.base),dangerLight:u("dangerLight",r.light),dangerDark:u("dangerDark",r.dark),success:u("success",n.base),successLight:u("successLight",n.light),successDark:u("successDark",n.dark),soft:u("soft",o.base),softLight:u("softLight",o.light),softDark:u("softDark",o.dark),background:u("background",b6.BACKGROUND),menuBackground:u("menuBackground",b6.MENU_BACKGROUND),zebra:u("zebra",b6.ZEBRA),border:u("border",b6.BORDER),boxShadow:u("boxShadow",b6.BOX_SHADOW),fontPrimary:u("fontPrimary",b6.FONT_PRIMARY),fontSecondary:u("fontSecondary",b6.FONT_SECONDARY),inputBackground:u("inputBackground",b6.INPUT_BACKGROUND),inputPlaceholder:u("inputPlaceholder",b6.INPUT_PLACEHOLDER),tonalOffset:u("tonalOffset",b6.TONAL_OFFSET)},borderRadius:{sm:d("sm",.6),md:d("md",1),lg:d("lg",2)},padding:{xs:h("xs",.25),sm:h("sm",.5),md:h("md",1),lg:h("lg",1.5),xl:h("xl",2)},gap:{xs:p("xs",.25),sm:p("sm",.5),md:p("md",1),lg:p("lg",1.5),xl:p("xl",2)},fontSize:e.fontSize||S6,fontFamily:e.fontFamily||k6};return(e=>{const t=document.documentElement,n=(e,n)=>{Object.entries(e).forEach((([e,r])=>{const o=v6.camelToKebab(e);if("string"==typeof r&&r.startsWith("#")){const e=MV.color.hexToRgb(r);t.style.setProperty(`--${n}-${o}-rgb`,e)}t.style.setProperty(`--${n}-${o}`,r)}))};n(e.palette,"color"),n(e.borderRadius,"border-radius"),n(e.padding,"padding"),n(e.gap,"gap"),t.style.setProperty("--oziko-font-size-base",`${e.fontSize}px`),t.style.setProperty("--oziko-font-family-base",e.fontFamily)})(f),f},E6=(e,t=.2)=>{const{h:n,s:r,l:o}=MV.color.hexToHSL(e),i="number"==typeof t?t:t.light,a="number"==typeof t?t:t.dark;return{base:e,light:MV.color.hslToHex(n,r,Math.min(1,o+i)),dark:MV.color.hslToHex(n,r,Math.max(0,o-a))}},M6=m(void 0),P6=()=>{const e=p(M6);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e};var O6,T6,N6;!function(e){e.isTypeLocation=e=>"object"==typeof e&&null!==e&&"string"==typeof e.type&&Array.isArray(e.coordinates)&&2===e.coordinates.length&&e.coordinates.every((e=>"number"==typeof e))}(O6||(O6={})),function(e){e.hexToHSL=e=>{let t=0,n=0,r=0;if(4===e.length)t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16);else{if(7!==e.length)throw new Error("Invalid HEX format");t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16)}t/=255,n/=255,r/=255;const o=Math.max(t,n,r),i=Math.min(t,n,r);let a=0,s=0,l=(o+i)/2;if(o!==i){const e=o-i;switch(s=l>.5?e/(2-o-i):e/(o+i),o){case t:a=(n-r)/e+(n<r?6:0);break;case n:a=(r-t)/e+2;break;case r:a=(t-n)/e+4}a/=6}return{h:a,s:s,l:l}},e.hslToHex=(e,t,n)=>{const r=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e);let o,i,a;if(0===t)o=i=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=r(l,s,e+1/3),i=r(l,s,e),a=r(l,s,e-1/3)}return`#${Math.round(255*o).toString(16).padStart(2,"0")}${Math.round(255*i).toString(16).padStart(2,"0")}${Math.round(255*a).toString(16).padStart(2,"0")}`}}(T6||(T6={})),function(e){e.timeUnitsInSeconds={second:1,minute:60,hour:3600,day:86400,week:604800,month:2592e3,quarter:7776e3,year:31536e3},e.unitMapper=e=>e<=10?"second":e<=120?"minute":e<=2160?"hour":e<=43200?"day":e<=50400?"week":e<=1296e3?"month":e<=9331200?"quarter":"year",e.getDiffInMinutes=(e,t)=>Math.abs(t.getTime()-e.getTime())/6e4,e.formatDateToEnUs=e=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}).format(e)}(N6||(N6={}));export{eI as Accordion,l3 as ArrayInput,C4 as ArrayMinimizedInput,te as Autocomplete,FA as Backdrop,pe as BaseInput,kq as BooleanInput,E4 as BooleanMinimizedInput,es as BucketFieldPopup,xs as Button,Zf as Chart,em as Checkbox,nm as Chip,j3 as ChipInput,g6 as CircularProgress,om as Color,Eq as ColorInput,O4 as ColorMinimizedInput,og as ColorPicker,kX as Dashboard,fg as DashboardItem,xq as DateInput,D4 as DateMinimizedInput,TA as DatePicker,BA as Directory,c6 as Drawer,ZA as DropList,a6 as EnumInput,B as FlexElement,H as FluidContainer,Ga as Icon,G as Input,KA as InputHeader,K as InputWithIcon,QA as Json,qm as LayerManagerProvider,Y as ListItem,nL as ListRow,jU as LocationInput,L4 as LocationMinimizedInput,_L as Map,OX as MenuGroup,PL as Modal,IU as MultipleSelectionInput,R4 as MultipleSelectionMinimizedInput,rI as NavigatorItem,UX as NotificationProvider,lq as NumberInput,B4 as NumberMinimizedInput,a3 as ObjectInput,Y4 as ObjectMinimizedInput,jA as Popover,Gm as Portal,y4 as RelationInput,o3 as RichTextInput,Z4 as RichTextMinimizedInput,pg as Section,ng as Select,tg as SelectOption,_s as Spinner,lI as SsoButton,LL as StorageFileCard,W$ as StorageFilter,TU as StorageInput,i6 as StorageMinimizedInput,nq as StringInput,Q4 as StringMinimizedInput,FL as Switch,d6 as Tab,jX as Table,V as Text,fq as TextAreaInput,t6 as TextAreaMinimizedInput,TV as Timeline,BL as Title,O6 as apiUtil,T6 as colorUtil,C6 as createTheme,J as handledClickOutsideEvents,v6 as helperUtils,N6 as timeUtil,ee as useAdaptivePosition,_4 as useInputRepresenter,zA as useKeyDown,Zm as useLayer,ZX as useNotification,Q as useOnClickOutside,P6 as useTheme};
100
100
  //# sourceMappingURL=index.mjs.map