@oliasoft-open-source/charts-library 5.1.3 → 5.1.4-beta-2
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/assets/{Color-YHDXOIA2-C13o5BEK.js → Color-YHDXOIA2-CVL3yqvq.js} +1 -1
- package/dist/assets/{DocsRenderer-CFRXHY34-C8MDfQlB.js → DocsRenderer-CFRXHY34-BVHN4IgT.js} +3 -3
- package/dist/assets/{bar-chart.stories-5CuN6VFG.js → bar-chart.stories-DquA7ACv.js} +1 -1
- package/dist/assets/{entry-preview-Bg8Fv40s.js → entry-preview-DZ_R6dYr.js} +1 -1
- package/dist/assets/{get-draggableData-eD2Xdq-6.js → get-draggableData-B6vSKEXH.js} +1 -1
- package/dist/assets/{iframe-D3u0vI49.js → iframe-C_yRnxwh.js} +2 -2
- package/dist/assets/{legend-Cgq98xea.js → legend-DOA3L9eH.js} +88 -88
- package/dist/assets/{legend-context-PSa8HhGj.js → legend-context-Ck5tFDGN.js} +12 -12
- package/dist/assets/line-chart-CpA-Dt9p.js +6 -0
- package/dist/assets/{line-chart.stories-BM8uf3sT.js → line-chart.stories-CcH00UaJ.js} +1 -1
- package/dist/assets/{line-chart.test-case.stories-Cy5EhpJz.js → line-chart.test-case.stories-D7ekx7KO.js} +1 -1
- package/dist/assets/{pie-chart.stories-C3l9VGYJ.js → pie-chart.stories-BxRNBusg.js} +1 -1
- package/dist/assets/{preview-Cq-c5HAX.js → preview-DY34liza.js} +1 -1
- package/dist/assets/{preview-FuT2SsKI.js → preview-Da3Tuoe0.js} +2 -2
- package/dist/assets/{scatter-chart.stories-U-tLziOZ.js → scatter-chart.stories-DVIcv9-6.js} +1 -1
- package/dist/common/common.interface.d.ts +1 -0
- package/dist/common/legend-component/state/legend-context.d.ts +3 -1
- package/dist/common/legend-component/state/legend-state-reducer.d.ts +2 -1
- package/dist/iframe.html +1 -1
- package/dist/index.js +10 -0
- package/dist/line-chart/utils/line-chart-utils.d.ts +1 -2
- package/dist/pie-chart/use-pie-chart-config.d.ts +3 -2
- package/dist/project.json +1 -1
- package/package.json +1 -1
- package/dist/assets/line-chart-Bgiqk66s.js +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{j as F}from"./jsx-runtime-W3oueGCa.js";import{r as G,g as ct}from"./index-YTOF1_EJ.js";import{$ as dt,a0 as bn,a1 as we,B as fe,a2 as gt,v as Y,A as ie,P as Ce,C as _e,a3 as an,a4 as ht,g as Ke,y as pt,S as mt,E as bt,F as yt,a5 as Se,a6 as Pe,H as Ee,a7 as Ne,G as Je,I as wt,T as _t,L as yn,a as Et,J as Be,K as Tt,M as be,d as Lt,r as vt,N as wn,a8 as At,f as xt,a9 as Ct,U as St,aa as le,ab as fn,ac as xe,D as Pt,ad as ye,b as It,s as Ot,Q as Nt,ae as Mt,h as Dt,i as Bt,V as jt,W as Ft,j as kt,k as Ut,p as Rt,m as Gt,n as Yt,o as zt,q as Vt,t as Xt}from"./legend-context-Ck5tFDGN.js";import{r as He,M as cn,k as je,B as ce,s as Ht,v as qt,w as _n,x as Wt,y as $t,z as Zt,A as Kt,E as Jt,N as En,G as Qt,S as er,g as nr,e as tr,F as rr,T as Un,J as or,K as sr,D as ir,O as lr,Q as ur,o as ar,q as fr,U as cr,j as dr,u as gr,Z as hr,t as pr,R as mr,l as br,H as yr,L as wr,m as _r,n as Er}from"./legend-DOA3L9eH.js";import{c as Tr,C as Lr,f as Tn,a as vr,b as Ar}from"./get-draggableData-B6vSKEXH.js";import{e as xr}from"./index-CgYGpm1H.js";const Cr=(e,n,t)=>{const[o,r]=e.major,[d,c]=e.minor,p=(o.x+r.x+d.x+c.x)/4,w=(o.y+r.y+d.y+c.y)/4,C=r.x-o.x,E=r.y-o.y,P=Math.atan2(t.getPixelForValue(w+E/2)-t.getPixelForValue(w-E/2),n.getPixelForValue(p+C/2)-n.getPixelForValue(p-C/2)),M=Math.hypot(n.getPixelForValue(o.x)-n.getPixelForValue(r.x),t.getPixelForValue(o.y)-t.getPixelForValue(r.y))/2,N=Math.hypot(n.getPixelForValue(d.x)-n.getPixelForValue(c.x),t.getPixelForValue(d.y)-t.getPixelForValue(c.y))/2,v=n.getPixelForValue(p),x=t.getPixelForValue(w);return{cx:v,cy:x,radiusX:M,radiusY:N,angle:P}},Sr=e=>e.data.datasets.some(n=>n.data.some(t=>!!t.ellipsePoints)),Pr={id:"ellipsisAnnotationPlugin",afterDatasetsDraw(e){var d,c,p,w,C,E,P,M,N;if(!Sr(e))return;const n=e==null?void 0:e.ctx,t=(d=e==null?void 0:e.scales)==null?void 0:d.x,o=(c=e==null?void 0:e.scales)==null?void 0:c.y,r=e==null?void 0:e.chartArea;!t||!o||!r||((p=n==null?void 0:n.save)==null||p.call(n),(w=n==null?void 0:n.beginPath)==null||w.call(n),(C=n==null?void 0:n.rect)==null||C.call(n,r.left,r.top,r.right-r.left,r.bottom-r.top),(E=n==null?void 0:n.clip)==null||E.call(n),(M=(P=e==null?void 0:e.data)==null?void 0:P.datasets)==null||M.forEach(v=>{var h;const x=v;(h=x==null?void 0:x.data)==null||h.forEach(A=>{var l,u,i,_,T;const{ellipsePoints:b}=A??{};if(!b)return;const{cx:L,cy:y,radiusX:S,radiusY:f,angle:g}=Cr(b,t,o);(l=n==null?void 0:n.save)==null||l.call(n),(u=n==null?void 0:n.beginPath)==null||u.call(n),(i=n==null?void 0:n.ellipse)==null||i.call(n,L,y,S,f,g,0,2*Math.PI),n.strokeStyle=x.borderColor||dt,n.lineWidth=x.borderWidth||1,(_=n==null?void 0:n.stroke)==null||_.call(n),(T=n==null?void 0:n.restore)==null||T.call(n)})}),(N=n==null?void 0:n.restore)==null||N.call(n))}},Ir="_chart_e3qdd_1",Or="_canvas_e3qdd_11",Nr="_fixedHeight_e3qdd_20",Mr="_stretchHeight_e3qdd_26",Dr="_squareAspectRatio_e3qdd_32",Br="_table_e3qdd_62",qe={chart:Ir,canvas:Or,fixedHeight:Nr,stretchHeight:Mr,squareAspectRatio:Dr,table:Br};var Rn=Symbol.for("immer-nothing"),Ln=Symbol.for("immer-draftable"),ne=Symbol.for("immer-state");function oe(e,...n){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Te=Object.getPrototypeOf;function Le(e){return!!e&&!!e[ne]}function he(e){var n;return e?Gn(e)||Array.isArray(e)||!!e[Ln]||!!((n=e.constructor)!=null&&n[Ln])||ze(e)||Ve(e):!1}var jr=Object.prototype.constructor.toString();function Gn(e){if(!e||typeof e!="object")return!1;const n=Te(e);if(n===null)return!0;const t=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return t===Object?!0:typeof t=="function"&&Function.toString.call(t)===jr}function Fe(e,n){Ye(e)===0?Reflect.ownKeys(e).forEach(t=>{n(t,e[t],e)}):e.forEach((t,o)=>n(o,t,e))}function Ye(e){const n=e[ne];return n?n.type_:Array.isArray(e)?1:ze(e)?2:Ve(e)?3:0}function Qe(e,n){return Ye(e)===2?e.has(n):Object.prototype.hasOwnProperty.call(e,n)}function Yn(e,n,t){const o=Ye(e);o===2?e.set(n,t):o===3?e.add(t):e[n]=t}function Fr(e,n){return e===n?e!==0||1/e===1/n:e!==e&&n!==n}function ze(e){return e instanceof Map}function Ve(e){return e instanceof Set}function ge(e){return e.copy_||e.base_}function en(e,n){if(ze(e))return new Map(e);if(Ve(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const t=Gn(e);if(n===!0||n==="class_only"&&!t){const o=Object.getOwnPropertyDescriptors(e);delete o[ne];let r=Reflect.ownKeys(o);for(let d=0;d<r.length;d++){const c=r[d],p=o[c];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(o[c]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[c]})}return Object.create(Te(e),o)}else{const o=Te(e);if(o!==null&&t)return{...e};const r=Object.create(o);return Object.assign(r,e)}}function dn(e,n=!1){return Xe(e)||Le(e)||!he(e)||(Ye(e)>1&&(e.set=e.add=e.clear=e.delete=kr),Object.freeze(e),n&&Object.entries(e).forEach(([t,o])=>dn(o,!0))),e}function kr(){oe(2)}function Xe(e){return Object.isFrozen(e)}var Ur={};function pe(e){const n=Ur[e];return n||oe(0,e),n}var Ie;function zn(){return Ie}function Rr(e,n){return{drafts_:[],parent_:e,immer_:n,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function vn(e,n){n&&(pe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=n)}function nn(e){tn(e),e.drafts_.forEach(Gr),e.drafts_=null}function tn(e){e===Ie&&(Ie=e.parent_)}function An(e){return Ie=Rr(Ie,e)}function Gr(e){const n=e[ne];n.type_===0||n.type_===1?n.revoke_():n.revoked_=!0}function xn(e,n){n.unfinalizedDrafts_=n.drafts_.length;const t=n.drafts_[0];return e!==void 0&&e!==t?(t[ne].modified_&&(nn(n),oe(4)),he(e)&&(e=ke(n,e),n.parent_||Ue(n,e)),n.patches_&&pe("Patches").generateReplacementPatches_(t[ne].base_,e,n.patches_,n.inversePatches_)):e=ke(n,t,[]),nn(n),n.patches_&&n.patchListener_(n.patches_,n.inversePatches_),e!==Rn?e:void 0}function ke(e,n,t){if(Xe(n))return n;const o=n[ne];if(!o)return Fe(n,(r,d)=>Cn(e,o,n,r,d,t)),n;if(o.scope_!==e)return n;if(!o.modified_)return Ue(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const r=o.copy_;let d=r,c=!1;o.type_===3&&(d=new Set(r),r.clear(),c=!0),Fe(d,(p,w)=>Cn(e,o,r,p,w,t,c)),Ue(e,r,!1),t&&e.patches_&&pe("Patches").generatePatches_(o,t,e.patches_,e.inversePatches_)}return o.copy_}function Cn(e,n,t,o,r,d,c){if(Le(r)){const p=d&&n&&n.type_!==3&&!Qe(n.assigned_,o)?d.concat(o):void 0,w=ke(e,r,p);if(Yn(t,o,w),Le(w))e.canAutoFreeze_=!1;else return}else c&&t.add(r);if(he(r)&&!Xe(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;ke(e,r),(!n||!n.scope_.parent_)&&typeof o!="symbol"&&Object.prototype.propertyIsEnumerable.call(t,o)&&Ue(e,r)}}function Ue(e,n,t=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dn(n,t)}function Yr(e,n){const t=Array.isArray(e),o={type_:t?1:0,scope_:n?n.scope_:zn(),modified_:!1,finalized_:!1,assigned_:{},parent_:n,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,d=gn;t&&(r=[o],d=Oe);const{revoke:c,proxy:p}=Proxy.revocable(r,d);return o.draft_=p,o.revoke_=c,p}var gn={get(e,n){if(n===ne)return e;const t=ge(e);if(!Qe(t,n))return zr(e,t,n);const o=t[n];return e.finalized_||!he(o)?o:o===We(e.base_,n)?($e(e),e.copy_[n]=on(o,e)):o},has(e,n){return n in ge(e)},ownKeys(e){return Reflect.ownKeys(ge(e))},set(e,n,t){const o=Vn(ge(e),n);if(o!=null&&o.set)return o.set.call(e.draft_,t),!0;if(!e.modified_){const r=We(ge(e),n),d=r==null?void 0:r[ne];if(d&&d.base_===t)return e.copy_[n]=t,e.assigned_[n]=!1,!0;if(Fr(t,r)&&(t!==void 0||Qe(e.base_,n)))return!0;$e(e),rn(e)}return e.copy_[n]===t&&(t!==void 0||n in e.copy_)||Number.isNaN(t)&&Number.isNaN(e.copy_[n])||(e.copy_[n]=t,e.assigned_[n]=!0),!0},deleteProperty(e,n){return We(e.base_,n)!==void 0||n in e.base_?(e.assigned_[n]=!1,$e(e),rn(e)):delete e.assigned_[n],e.copy_&&delete e.copy_[n],!0},getOwnPropertyDescriptor(e,n){const t=ge(e),o=Reflect.getOwnPropertyDescriptor(t,n);return o&&{writable:!0,configurable:e.type_!==1||n!=="length",enumerable:o.enumerable,value:t[n]}},defineProperty(){oe(11)},getPrototypeOf(e){return Te(e.base_)},setPrototypeOf(){oe(12)}},Oe={};Fe(gn,(e,n)=>{Oe[e]=function(){return arguments[0]=arguments[0][0],n.apply(this,arguments)}});Oe.deleteProperty=function(e,n){return Oe.set.call(this,e,n,void 0)};Oe.set=function(e,n,t){return gn.set.call(this,e[0],n,t,e[0])};function We(e,n){const t=e[ne];return(t?ge(t):e)[n]}function zr(e,n,t){var r;const o=Vn(n,t);return o?"value"in o?o.value:(r=o.get)==null?void 0:r.call(e.draft_):void 0}function Vn(e,n){if(!(n in e))return;let t=Te(e);for(;t;){const o=Object.getOwnPropertyDescriptor(t,n);if(o)return o;t=Te(t)}}function rn(e){e.modified_||(e.modified_=!0,e.parent_&&rn(e.parent_))}function $e(e){e.copy_||(e.copy_=en(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Vr=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(n,t,o)=>{if(typeof n=="function"&&typeof t!="function"){const d=t;t=n;const c=this;return function(w=d,...C){return c.produce(w,E=>t.call(this,E,...C))}}typeof t!="function"&&oe(6),o!==void 0&&typeof o!="function"&&oe(7);let r;if(he(n)){const d=An(this),c=on(n,void 0);let p=!0;try{r=t(c),p=!1}finally{p?nn(d):tn(d)}return vn(d,o),xn(r,d)}else if(!n||typeof n!="object"){if(r=t(n),r===void 0&&(r=n),r===Rn&&(r=void 0),this.autoFreeze_&&dn(r,!0),o){const d=[],c=[];pe("Patches").generateReplacementPatches_(n,r,d,c),o(d,c)}return r}else oe(1,n)},this.produceWithPatches=(n,t)=>{if(typeof n=="function")return(c,...p)=>this.produceWithPatches(c,w=>n(w,...p));let o,r;return[this.produce(n,t,(c,p)=>{o=c,r=p}),o,r]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){he(e)||oe(8),Le(e)&&(e=Xr(e));const n=An(this),t=on(e,void 0);return t[ne].isManual_=!0,tn(n),t}finishDraft(e,n){const t=e&&e[ne];(!t||!t.isManual_)&&oe(9);const{scope_:o}=t;return vn(o,n),xn(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,n){let t;for(t=n.length-1;t>=0;t--){const r=n[t];if(r.path.length===0&&r.op==="replace"){e=r.value;break}}t>-1&&(n=n.slice(t+1));const o=pe("Patches").applyPatches_;return Le(e)?o(e,n):this.produce(e,r=>o(r,n))}};function on(e,n){const t=ze(e)?pe("MapSet").proxyMap_(e,n):Ve(e)?pe("MapSet").proxySet_(e,n):Yr(e,n);return(n?n.scope_:zn()).drafts_.push(t),t}function Xr(e){return Le(e)||oe(10,e),Xn(e)}function Xn(e){if(!he(e)||Xe(e))return e;const n=e[ne];let t;if(n){if(!n.modified_)return n.base_;n.finalized_=!0,t=en(e,n.scope_.immer_.useStrictShallowCopy_)}else t=en(e,!0);return Fe(t,(o,r)=>{Yn(t,o,Xn(r))}),n&&(n.finalized_=!1),t}var te=new Vr,Hr=te.produce;te.produceWithPatches.bind(te);te.setAutoFreeze.bind(te);te.setUseStrictShallowCopy.bind(te);te.applyPatches.bind(te);te.createDraft.bind(te);te.finishDraft.bind(te);const Hn="TOGGLE_ZOOM",qn="TOGGLE_PAN",Wn="TOGGLE_POINTS",$n="TOGGLE_LINE",Zn="TOGGLE_LEGEND",Kn="TOGGLE_TABLE",sn="RESET_AXES_RANGES",ln="UPDATE_AXES_RANGES",Jn="TOGGLE_DRAG_POINTS",Qn="TOGGLE_DRAG_ANNOTATION",et="DISABLE_DRAG_OPTIONS",De="UPDATE_EDITED",qr=(e,n)=>Hr(e,t=>{switch(n.type){case Hn:{t.zoomEnabled=!t.zoomEnabled,t.panEnabled&&(t.panEnabled=!1),t.enableDragPoints&&(t.enableDragPoints=!1),t.enableDragAnnotation&&(t.enableDragAnnotation=!1);break}case qn:{t.panEnabled=!t.panEnabled,t.zoomEnabled&&(t.zoomEnabled=!1),t.enableDragPoints&&(t.enableDragPoints=!1),t.enableDragAnnotation&&(t.enableDragAnnotation=!1);break}case Wn:{t.pointsEnabled=!t.pointsEnabled;break}case $n:{t.lineEnabled=!t.lineEnabled;break}case Zn:{t.legendEnabled=!t.legendEnabled;break}case Kn:{t.showTable=!t.showTable;break}case ln:{const{axes:o}=n.payload;t.axes=o;break}case sn:{const{axes:o}=n.payload;t.axes=o;break}case Jn:{t.enableDragPoints=!t.enableDragPoints,t.panEnabled&&(t.panEnabled=!1),t.zoomEnabled&&(t.zoomEnabled=!1),t.enableDragAnnotation&&(t.enableDragAnnotation=!1);break}case Qn:{t.enableDragAnnotation=!t.enableDragAnnotation,t.panEnabled&&(t.panEnabled=!1),t.zoomEnabled&&(t.zoomEnabled=!1);break}case et:{(t.enableDragAnnotation||t.enableDragPoints||t.panEnabled||t.zoomEnabled)&&(t.enableDragAnnotation=!1,t.enableDragPoints=!1,t.panEnabled=!1,t.zoomEnabled=!1);break}case De:{t.edited=n.payload;break}}}),Wr=e=>{if(!e)return null;const n=`line-chart-state-${e}`,t=localStorage.getItem(n);return t?JSON.parse(t).state:null},$r=(e=72)=>{const n=new Date().getTime(),t=e*60*60*1e3;for(let o=0;o<localStorage.length;o++){const r=localStorage.key(o);if(r!=null&&r.includes("line-chart-state-")){const d=localStorage.getItem(r);if(d){const p=JSON.parse(d).timestamp;p&&n-p>t&&localStorage.removeItem(r)}}}},Zr=(e,n)=>{if(!n)return;const t=new Date().getTime(),o=`line-chart-state-${n}`,r={state:e,timestamp:t};localStorage.setItem(o,JSON.stringify(r)),$r()},Kr=({options:e,persistenceId:n})=>{const{chartOptions:{enableZoom:t,enablePan:o,showPoints:r,showLine:d,enableDragAnnotation:c},legend:{display:p},dragData:w}=e,{zoomEnabled:C,panEnabled:E,pointsEnabled:P,lineEnabled:M,legendEnabled:N,enableDragPoints:v,enableDragAnnotation:x}=Wr(n)||{};return{zoomEnabled:c??x?!1:C??t,panEnabled:E??o,pointsEnabled:P??r,lineEnabled:M??d,legendEnabled:N??p,axes:[],showTable:!1,enableDragPoints:(w==null?void 0:w.enableDragData)&&v,enableDragAnnotation:c??x,edited:!1}},Jr=e=>G.createElement("svg",{fill:"currentColor",height:"1em",viewBox:"0 0 12 12",width:"1em",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},G.createElement("clipPath",{id:"a"},G.createElement("path",{d:"m0 0h12v12h-12z"})),G.createElement("g",{clipPath:"url(#a)"},G.createElement("path",{d:"m.5 6.5v-1h11v1c-4.16104 0-6.63549 0-11 0z"}))),Qr=e=>G.createElement("svg",{fill:"currentColor",height:"1em",viewBox:"0 0 12 12",width:"1em",xmlns:"http://www.w3.org/2000/svg",...e},G.createElement("circle",{cx:6,cy:6,r:2})),eo=e=>G.createElement("svg",{fill:"currentColor",height:"1em",viewBox:"0 0 12 12",width:"1em",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},G.createElement("clipPath",{id:"a"},G.createElement("path",{d:"m0 0h12v12h-12z"})),G.createElement("g",{clipPath:"url(#a)"},G.createElement("path",{d:"m7.937 6.5c-.11122.42912-.36179.80916-.71237 1.08047-.35058.2713-.78133.4185-1.22463.4185s-.87405-.1472-1.22463-.4185c-.35058-.27131-.60115-.65135-.71237-1.08047h-3.563v-1h3.563c.11122-.42912.36179-.80916.71237-1.08046s.78133-.41851 1.22463-.41851.87405.14721 1.22463.41851.60115.65134.71237 1.08046h3.563v1z"})));function no({lineEnabled:e,onToggleLine:n,onTogglePoints:t,pointsEnabled:o,translations:r}){return[{type:"Option",label:r.pointsLines,icon:F.jsx(He,{icon:F.jsx(eo,{})}),selected:o&&e,onClick:()=>{o||t(),e||n()}},{type:"Option",label:r.linesOnly,icon:F.jsx(He,{icon:F.jsx(Jr,{})}),selected:!o&&e,onClick:()=>{o&&t(),e||n()}},{type:"Option",label:r.pointsOnly,icon:F.jsx(He,{icon:F.jsx(Qr,{})}),selected:o&&!e,onClick:()=>{o||t(),e&&n()}}]}const nt=({options:e})=>{const[n,t]=G.useState(!1),o=e.find(r=>r.selected);return F.jsx(cn,{open:n,setOpen:t,menu:{sections:e,trigger:"Component",component:F.jsx(je,{display:"inline-flex",text:o==null?void 0:o.label,placement:"bottom-start",enabled:!n,children:F.jsx(ce,{colored:"muted",basic:!0,small:!0,round:!0,icon:o==null?void 0:o.icon})})}})};nt.__docgenInfo={description:"",methods:[],displayName:"LineOptions",props:{options:{required:!0,tsType:{name:"Array",elements:[{name:"IMenuSection"}],raw:"IMenuSection[]"},description:""}}};function to({onTogglePan:e,onToggleZoom:n,panEnabled:t,zoomEnabled:o,enableDragPoints:r,enableDragAnnotation:d,isDragDataAllowed:c,isDragAnnotationAllowed:p,onToggleDragAnnotation:w,onToggleDragPoints:C,onDisableDragOptions:E,translations:{dragToZoom:P,doubleClickToReset:M,dragToPan:N,dragToMovePoints:v,dragDisabled:x,dragToMoveAnnotation:h}}){return[{label:P,description:M,icon:F.jsx(Ht,{}),selected:o,type:"Option",onClick:()=>{o||n()}},{label:N,description:M,icon:F.jsx(qt,{}),selected:t,type:"Option",onClick:()=>{t||e()}},...c?[{label:v,icon:F.jsx(_n,{}),selected:r,type:"Option",onClick:()=>{r||C()}}]:[],...p?[{label:h,icon:F.jsx(_n,{}),selected:d,type:"Option",onClick:()=>{d||w()}}]:[],{label:x,icon:F.jsx(Wt,{}),selected:!o&&!t&&!r&&!d,type:"Option",onClick:E}]}const tt=({options:e})=>{const n=e.find(t=>t.selected);return F.jsx(cn,{menu:{sections:e,trigger:"Component",component:F.jsx(ce,{colored:"muted",basic:!0,small:!0,label:n==null?void 0:n.label,icon:n==null?void 0:n.icon})}})};tt.__docgenInfo={description:"@param {import('./drag-options-interfaces').IDragOptions} obj",methods:[],displayName:"DragOptions",props:{options:{required:!0,tsType:{name:"Array",elements:[{name:"IMenuSection"}],raw:"IMenuSection[]"},description:""}}};const ro="_controls_1edjs_1",oo="_buttons_1edjs_6",Sn={controls:ro,buttons:oo},so=e=>{const n=G.useCallback(t=>()=>{e({type:t})},[e]);return{onToggleLegend:n(Zn),onToggleLine:n($n),onTogglePan:n(qn),onTogglePoints:n(Wn),onToggleTable:n(Kn),onToggleZoom:n(Hn),onToggleDragPoints:n(Jn),onToggleDragAnnotation:n(Qn),onDisableDragOptions:n(et)}};function Me(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ze={exports:{}},Pn;function io(){return Pn||(Pn=1,function(e,n){(function(t){e.exports=t()})(function(){return function t(o,r,d){function c(C,E){if(!r[C]){if(!o[C]){var P=typeof Me=="function"&&Me;if(!E&&P)return P(C,!0);if(p)return p(C,!0);throw new Error("Cannot find module '"+C+"'")}E=r[C]={exports:{}},o[C][0].call(E.exports,function(M){var N=o[C][1][M];return c(N||M)},E,E.exports,t,o,r,d)}return r[C].exports}for(var p=typeof Me=="function"&&Me,w=0;w<d.length;w++)c(d[w]);return c}({1:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){var v=t("crypto");function x(f,g){g=b(f,g);var l;return(l=g.algorithm!=="passthrough"?v.createHash(g.algorithm):new S).write===void 0&&(l.write=l.update,l.end=l.update),y(g,l).dispatch(f),l.update||l.end(""),l.digest?l.digest(g.encoding==="buffer"?void 0:g.encoding):(f=l.read(),g.encoding!=="buffer"?f.toString(g.encoding):f)}(r=o.exports=x).sha1=function(f){return x(f)},r.keys=function(f){return x(f,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},r.MD5=function(f){return x(f,{algorithm:"md5",encoding:"hex"})},r.keysMD5=function(f){return x(f,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var h=v.getHashes?v.getHashes().slice():["sha1","md5"],A=(h.push("passthrough"),["buffer","hex","binary","base64"]);function b(f,g){var l={};if(l.algorithm=(g=g||{}).algorithm||"sha1",l.encoding=g.encoding||"hex",l.excludeValues=!!g.excludeValues,l.algorithm=l.algorithm.toLowerCase(),l.encoding=l.encoding.toLowerCase(),l.ignoreUnknown=g.ignoreUnknown===!0,l.respectType=g.respectType!==!1,l.respectFunctionNames=g.respectFunctionNames!==!1,l.respectFunctionProperties=g.respectFunctionProperties!==!1,l.unorderedArrays=g.unorderedArrays===!0,l.unorderedSets=g.unorderedSets!==!1,l.unorderedObjects=g.unorderedObjects!==!1,l.replacer=g.replacer||void 0,l.excludeKeys=g.excludeKeys||void 0,f===void 0)throw new Error("Object argument required.");for(var u=0;u<h.length;++u)h[u].toLowerCase()===l.algorithm.toLowerCase()&&(l.algorithm=h[u]);if(h.indexOf(l.algorithm)===-1)throw new Error('Algorithm "'+l.algorithm+'" not supported. supported values: '+h.join(", "));if(A.indexOf(l.encoding)===-1&&l.algorithm!=="passthrough")throw new Error('Encoding "'+l.encoding+'" not supported. supported values: '+A.join(", "));return l}function L(f){if(typeof f=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(f))!=null}function y(f,g,l){l=l||[];function u(i){return g.update?g.update(i,"utf8"):g.write(i,"utf8")}return{dispatch:function(i){return this["_"+((i=f.replacer?f.replacer(i):i)===null?"null":typeof i)](i)},_object:function(i){var _,T=Object.prototype.toString.call(i),U=/\[object (.*)\]/i.exec(T);if(U=(U=U?U[1]:"unknown:["+T+"]").toLowerCase(),0<=(T=l.indexOf(i)))return this.dispatch("[CIRCULAR:"+T+"]");if(l.push(i),p!==void 0&&p.isBuffer&&p.isBuffer(i))return u("buffer:"),u(i);if(U==="object"||U==="function"||U==="asyncfunction")return T=Object.keys(i),f.unorderedObjects&&(T=T.sort()),f.respectType===!1||L(i)||T.splice(0,0,"prototype","__proto__","constructor"),f.excludeKeys&&(T=T.filter(function(k){return!f.excludeKeys(k)})),u("object:"+T.length+":"),_=this,T.forEach(function(k){_.dispatch(k),u(":"),f.excludeValues||_.dispatch(i[k]),u(",")});if(!this["_"+U]){if(f.ignoreUnknown)return u("["+U+"]");throw new Error('Unknown object type "'+U+'"')}this["_"+U](i)},_array:function(i,k){k=k!==void 0?k:f.unorderedArrays!==!1;var T=this;if(u("array:"+i.length+":"),!k||i.length<=1)return i.forEach(function(R){return T.dispatch(R)});var U=[],k=i.map(function(R){var D=new S,z=l.slice();return y(f,D,z).dispatch(R),U=U.concat(z.slice(l.length)),D.read().toString()});return l=l.concat(U),k.sort(),this._array(k,!1)},_date:function(i){return u("date:"+i.toJSON())},_symbol:function(i){return u("symbol:"+i.toString())},_error:function(i){return u("error:"+i.toString())},_boolean:function(i){return u("bool:"+i.toString())},_string:function(i){u("string:"+i.length+":"),u(i.toString())},_function:function(i){u("fn:"),L(i)?this.dispatch("[native]"):this.dispatch(i.toString()),f.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(i.name)),f.respectFunctionProperties&&this._object(i)},_number:function(i){return u("number:"+i.toString())},_xml:function(i){return u("xml:"+i.toString())},_null:function(){return u("Null")},_undefined:function(){return u("Undefined")},_regexp:function(i){return u("regex:"+i.toString())},_uint8array:function(i){return u("uint8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint8clampedarray:function(i){return u("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(i))},_int8array:function(i){return u("int8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint16array:function(i){return u("uint16array:"),this.dispatch(Array.prototype.slice.call(i))},_int16array:function(i){return u("int16array:"),this.dispatch(Array.prototype.slice.call(i))},_uint32array:function(i){return u("uint32array:"),this.dispatch(Array.prototype.slice.call(i))},_int32array:function(i){return u("int32array:"),this.dispatch(Array.prototype.slice.call(i))},_float32array:function(i){return u("float32array:"),this.dispatch(Array.prototype.slice.call(i))},_float64array:function(i){return u("float64array:"),this.dispatch(Array.prototype.slice.call(i))},_arraybuffer:function(i){return u("arraybuffer:"),this.dispatch(new Uint8Array(i))},_url:function(i){return u("url:"+i.toString())},_map:function(i){return u("map:"),i=Array.from(i),this._array(i,f.unorderedSets!==!1)},_set:function(i){return u("set:"),i=Array.from(i),this._array(i,f.unorderedSets!==!1)},_file:function(i){return u("file:"),this.dispatch([i.name,i.size,i.type,i.lastModfied])},_blob:function(){if(f.ignoreUnknown)return u("[blob]");throw Error(`Hashing Blob objects is currently not supported
|
|
2
|
+
(see https://github.com/puleos/object-hash/issues/26)
|
|
3
|
+
Use "options.replacer" or "options.ignoreUnknown"
|
|
4
|
+
`)},_domwindow:function(){return u("domwindow")},_bigint:function(i){return u("bigint:"+i.toString())},_process:function(){return u("process")},_timer:function(){return u("timer")},_pipe:function(){return u("pipe")},_tcp:function(){return u("tcp")},_udp:function(){return u("udp")},_tty:function(){return u("tty")},_statwatcher:function(){return u("statwatcher")},_securecontext:function(){return u("securecontext")},_connection:function(){return u("connection")},_zlib:function(){return u("zlib")},_context:function(){return u("context")},_nodescript:function(){return u("nodescript")},_httpparser:function(){return u("httpparser")},_dataview:function(){return u("dataview")},_signal:function(){return u("signal")},_fsevent:function(){return u("fsevent")},_tlswrap:function(){return u("tlswrap")}}}function S(){return{buf:"",write:function(f){this.buf+=f},end:function(f){this.buf+=f},read:function(){return this.buf}}}r.writeToStream=function(f,g,l){return l===void 0&&(l=g,g={}),y(g=b(f,g),l).dispatch(f)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){(function(v){var x=typeof Uint8Array<"u"?Uint8Array:Array,h=43,A=47,b=48,L=97,y=65,S=45,f=95;function g(l){return l=l.charCodeAt(0),l===h||l===S?62:l===A||l===f?63:l<b?-1:l<b+10?l-b+26+26:l<y+26?l-y:l<L+26?l-L+26:void 0}v.toByteArray=function(l){var u,i;if(0<l.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var _=l.length,_=l.charAt(_-2)==="="?2:l.charAt(_-1)==="="?1:0,T=new x(3*l.length/4-_),U=0<_?l.length-4:l.length,k=0;function R(D){T[k++]=D}for(u=0;u<U;u+=4,0)R((16711680&(i=g(l.charAt(u))<<18|g(l.charAt(u+1))<<12|g(l.charAt(u+2))<<6|g(l.charAt(u+3))))>>16),R((65280&i)>>8),R(255&i);return _==2?R(255&(i=g(l.charAt(u))<<2|g(l.charAt(u+1))>>4)):_==1&&(R((i=g(l.charAt(u))<<10|g(l.charAt(u+1))<<4|g(l.charAt(u+2))>>2)>>8&255),R(255&i)),T},v.fromByteArray=function(l){var u,i,_,T,U=l.length%3,k="";function R(D){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(D)}for(u=0,_=l.length-U;u<_;u+=3)i=(l[u]<<16)+(l[u+1]<<8)+l[u+2],k+=R((T=i)>>18&63)+R(T>>12&63)+R(T>>6&63)+R(63&T);switch(U){case 1:k=(k+=R((i=l[l.length-1])>>2))+R(i<<4&63)+"==";break;case 2:k=(k=(k+=R((i=(l[l.length-2]<<8)+l[l.length-1])>>10))+R(i>>4&63))+R(i<<2&63)+"="}return k}})(r===void 0?this.base64js={}:r)}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(t,o,r){(function(d,c,h,w,C,E,P,M,N){var v=t("base64-js"),x=t("ieee754");function h(s,a,m){if(!(this instanceof h))return new h(s,a,m);var O,I,j,V,W=typeof s;if(a==="base64"&&W=="string")for(s=(V=s).trim?V.trim():V.replace(/^\s+|\s+$/g,"");s.length%4!=0;)s+="=";if(W=="number")O=q(s);else if(W=="string")O=h.byteLength(s,a);else{if(W!="object")throw new Error("First argument needs to be a number, array or string.");O=q(s.length)}if(h._useTypedArrays?I=h._augment(new Uint8Array(O)):((I=this).length=O,I._isBuffer=!0),h._useTypedArrays&&typeof s.byteLength=="number")I._set(s);else if(H(V=s)||h.isBuffer(V)||V&&typeof V=="object"&&typeof V.length=="number")for(j=0;j<O;j++)h.isBuffer(s)?I[j]=s.readUInt8(j):I[j]=s[j];else if(W=="string")I.write(s,0,a);else if(W=="number"&&!h._useTypedArrays&&!m)for(j=0;j<O;j++)I[j]=0;return I}function A(s,a,m,O){return h._charsWritten=de(function(I){for(var j=[],V=0;V<I.length;V++)j.push(255&I.charCodeAt(V));return j}(a),s,m,O)}function b(s,a,m,O){return h._charsWritten=de(function(I){for(var j,V,W=[],K=0;K<I.length;K++)V=I.charCodeAt(K),j=V>>8,V=V%256,W.push(V),W.push(j);return W}(a),s,m,O)}function L(s,a,m){var O="";m=Math.min(s.length,m);for(var I=a;I<m;I++)O+=String.fromCharCode(s[I]);return O}function y(s,a,m,j){j||(B(typeof m=="boolean","missing or invalid endian"),B(a!=null,"missing offset"),B(a+1<s.length,"Trying to read beyond buffer length"));var I,j=s.length;if(!(j<=a))return m?(I=s[a],a+1<j&&(I|=s[a+1]<<8)):(I=s[a]<<8,a+1<j&&(I|=s[a+1])),I}function S(s,a,m,j){j||(B(typeof m=="boolean","missing or invalid endian"),B(a!=null,"missing offset"),B(a+3<s.length,"Trying to read beyond buffer length"));var I,j=s.length;if(!(j<=a))return m?(a+2<j&&(I=s[a+2]<<16),a+1<j&&(I|=s[a+1]<<8),I|=s[a],a+3<j&&(I+=s[a+3]<<24>>>0)):(a+1<j&&(I=s[a+1]<<16),a+2<j&&(I|=s[a+2]<<8),a+3<j&&(I|=s[a+3]),I+=s[a]<<24>>>0),I}function f(s,a,m,O){if(O||(B(typeof m=="boolean","missing or invalid endian"),B(a!=null,"missing offset"),B(a+1<s.length,"Trying to read beyond buffer length")),!(s.length<=a))return O=y(s,a,m,!0),32768&O?-1*(65535-O+1):O}function g(s,a,m,O){if(O||(B(typeof m=="boolean","missing or invalid endian"),B(a!=null,"missing offset"),B(a+3<s.length,"Trying to read beyond buffer length")),!(s.length<=a))return O=S(s,a,m,!0),2147483648&O?-1*(4294967295-O+1):O}function l(s,a,m,O){return O||(B(typeof m=="boolean","missing or invalid endian"),B(a+3<s.length,"Trying to read beyond buffer length")),x.read(s,a,m,23,4)}function u(s,a,m,O){return O||(B(typeof m=="boolean","missing or invalid endian"),B(a+7<s.length,"Trying to read beyond buffer length")),x.read(s,a,m,52,8)}function i(s,a,m,O,I){if(I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+1<s.length,"trying to write beyond buffer length"),ue(a,65535)),I=s.length,!(I<=m))for(var j=0,V=Math.min(I-m,2);j<V;j++)s[m+j]=(a&255<<8*(O?j:1-j))>>>8*(O?j:1-j)}function _(s,a,m,O,I){if(I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+3<s.length,"trying to write beyond buffer length"),ue(a,4294967295)),I=s.length,!(I<=m))for(var j=0,V=Math.min(I-m,4);j<V;j++)s[m+j]=a>>>8*(O?j:3-j)&255}function T(s,a,m,O,I){I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+1<s.length,"Trying to write beyond buffer length"),ae(a,32767,-32768)),s.length<=m||i(s,0<=a?a:65535+a+1,m,O,I)}function U(s,a,m,O,I){I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+3<s.length,"Trying to write beyond buffer length"),ae(a,2147483647,-2147483648)),s.length<=m||_(s,0<=a?a:4294967295+a+1,m,O,I)}function k(s,a,m,O,I){I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+3<s.length,"Trying to write beyond buffer length"),pn(a,34028234663852886e22,-34028234663852886e22)),s.length<=m||x.write(s,a,m,O,23,4)}function R(s,a,m,O,I){I||(B(a!=null,"missing value"),B(typeof O=="boolean","missing or invalid endian"),B(m!=null,"missing offset"),B(m+7<s.length,"Trying to write beyond buffer length"),pn(a,17976931348623157e292,-17976931348623157e292)),s.length<=m||x.write(s,a,m,O,52,8)}r.Buffer=h,r.SlowBuffer=h,r.INSPECT_MAX_BYTES=50,h.poolSize=8192,h._useTypedArrays=function(){try{var s=new ArrayBuffer(0),a=new Uint8Array(s);return a.foo=function(){return 42},a.foo()===42&&typeof a.subarray=="function"}catch{return!1}}(),h.isEncoding=function(s){switch(String(s).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.isBuffer=function(s){return!(s==null||!s._isBuffer)},h.byteLength=function(s,a){var m;switch(s+="",a||"utf8"){case"hex":m=s.length/2;break;case"utf8":case"utf-8":m=Z(s).length;break;case"ascii":case"binary":case"raw":m=s.length;break;case"base64":m=ve(s).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":m=2*s.length;break;default:throw new Error("Unknown encoding")}return m},h.concat=function(s,a){if(B(H(s),`Usage: Buffer.concat(list, [totalLength])
|
|
5
|
+
list should be an Array.`),s.length===0)return new h(0);if(s.length===1)return s[0];if(typeof a!="number")for(I=a=0;I<s.length;I++)a+=s[I].length;for(var m=new h(a),O=0,I=0;I<s.length;I++){var j=s[I];j.copy(m,O),O+=j.length}return m},h.prototype.write=function(s,a,m,O){isFinite(a)?isFinite(m)||(O=m,m=void 0):(K=O,O=a,a=m,m=K),a=Number(a)||0;var I,j,V,W,K=this.length-a;switch((!m||K<(m=Number(m)))&&(m=K),O=String(O||"utf8").toLowerCase()){case"hex":I=function(re,Q,ee,J){ee=Number(ee)||0;var $=re.length-ee;(!J||$<(J=Number(J)))&&(J=$),B(($=Q.length)%2==0,"Invalid hex string"),$/2<J&&(J=$/2);for(var me=0;me<J;me++){var mn=parseInt(Q.substr(2*me,2),16);B(!isNaN(mn),"Invalid hex string"),re[ee+me]=mn}return h._charsWritten=2*me,me}(this,s,a,m);break;case"utf8":case"utf-8":j=this,V=a,W=m,I=h._charsWritten=de(Z(s),j,V,W);break;case"ascii":case"binary":I=A(this,s,a,m);break;case"base64":j=this,V=a,W=m,I=h._charsWritten=de(ve(s),j,V,W);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":I=b(this,s,a,m);break;default:throw new Error("Unknown encoding")}return I},h.prototype.toString=function(s,a,m){var O,I,j,V,W=this;if(s=String(s||"utf8").toLowerCase(),a=Number(a)||0,(m=m!==void 0?Number(m):W.length)===a)return"";switch(s){case"hex":O=function(K,re,Q){var ee=K.length;(!re||re<0)&&(re=0),(!Q||Q<0||ee<Q)&&(Q=ee);for(var J="",$=re;$<Q;$++)J+=X(K[$]);return J}(W,a,m);break;case"utf8":case"utf-8":O=function(K,re,Q){var ee="",J="";Q=Math.min(K.length,Q);for(var $=re;$<Q;$++)K[$]<=127?(ee+=Ae(J)+String.fromCharCode(K[$]),J=""):J+="%"+K[$].toString(16);return ee+Ae(J)}(W,a,m);break;case"ascii":case"binary":O=L(W,a,m);break;case"base64":I=W,V=m,O=(j=a)===0&&V===I.length?v.fromByteArray(I):v.fromByteArray(I.slice(j,V));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":O=function(K,re,Q){for(var ee=K.slice(re,Q),J="",$=0;$<ee.length;$+=2)J+=String.fromCharCode(ee[$]+256*ee[$+1]);return J}(W,a,m);break;default:throw new Error("Unknown encoding")}return O},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},h.prototype.copy=function(s,a,m,O){if(a=a||0,(O=O||O===0?O:this.length)!==(m=m||0)&&s.length!==0&&this.length!==0){B(m<=O,"sourceEnd < sourceStart"),B(0<=a&&a<s.length,"targetStart out of bounds"),B(0<=m&&m<this.length,"sourceStart out of bounds"),B(0<=O&&O<=this.length,"sourceEnd out of bounds"),O>this.length&&(O=this.length);var I=(O=s.length-a<O-m?s.length-a+m:O)-m;if(I<100||!h._useTypedArrays)for(var j=0;j<I;j++)s[j+a]=this[j+m];else s._set(this.subarray(m,m+I),a)}},h.prototype.slice=function(s,a){var m=this.length;if(s=z(s,m,0),a=z(a,m,m),h._useTypedArrays)return h._augment(this.subarray(s,a));for(var O=a-s,I=new h(O,void 0,!0),j=0;j<O;j++)I[j]=this[j+s];return I},h.prototype.get=function(s){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(s)},h.prototype.set=function(s,a){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(s,a)},h.prototype.readUInt8=function(s,a){if(a||(B(s!=null,"missing offset"),B(s<this.length,"Trying to read beyond buffer length")),!(s>=this.length))return this[s]},h.prototype.readUInt16LE=function(s,a){return y(this,s,!0,a)},h.prototype.readUInt16BE=function(s,a){return y(this,s,!1,a)},h.prototype.readUInt32LE=function(s,a){return S(this,s,!0,a)},h.prototype.readUInt32BE=function(s,a){return S(this,s,!1,a)},h.prototype.readInt8=function(s,a){if(a||(B(s!=null,"missing offset"),B(s<this.length,"Trying to read beyond buffer length")),!(s>=this.length))return 128&this[s]?-1*(255-this[s]+1):this[s]},h.prototype.readInt16LE=function(s,a){return f(this,s,!0,a)},h.prototype.readInt16BE=function(s,a){return f(this,s,!1,a)},h.prototype.readInt32LE=function(s,a){return g(this,s,!0,a)},h.prototype.readInt32BE=function(s,a){return g(this,s,!1,a)},h.prototype.readFloatLE=function(s,a){return l(this,s,!0,a)},h.prototype.readFloatBE=function(s,a){return l(this,s,!1,a)},h.prototype.readDoubleLE=function(s,a){return u(this,s,!0,a)},h.prototype.readDoubleBE=function(s,a){return u(this,s,!1,a)},h.prototype.writeUInt8=function(s,a,m){m||(B(s!=null,"missing value"),B(a!=null,"missing offset"),B(a<this.length,"trying to write beyond buffer length"),ue(s,255)),a>=this.length||(this[a]=s)},h.prototype.writeUInt16LE=function(s,a,m){i(this,s,a,!0,m)},h.prototype.writeUInt16BE=function(s,a,m){i(this,s,a,!1,m)},h.prototype.writeUInt32LE=function(s,a,m){_(this,s,a,!0,m)},h.prototype.writeUInt32BE=function(s,a,m){_(this,s,a,!1,m)},h.prototype.writeInt8=function(s,a,m){m||(B(s!=null,"missing value"),B(a!=null,"missing offset"),B(a<this.length,"Trying to write beyond buffer length"),ae(s,127,-128)),a>=this.length||(0<=s?this.writeUInt8(s,a,m):this.writeUInt8(255+s+1,a,m))},h.prototype.writeInt16LE=function(s,a,m){T(this,s,a,!0,m)},h.prototype.writeInt16BE=function(s,a,m){T(this,s,a,!1,m)},h.prototype.writeInt32LE=function(s,a,m){U(this,s,a,!0,m)},h.prototype.writeInt32BE=function(s,a,m){U(this,s,a,!1,m)},h.prototype.writeFloatLE=function(s,a,m){k(this,s,a,!0,m)},h.prototype.writeFloatBE=function(s,a,m){k(this,s,a,!1,m)},h.prototype.writeDoubleLE=function(s,a,m){R(this,s,a,!0,m)},h.prototype.writeDoubleBE=function(s,a,m){R(this,s,a,!1,m)},h.prototype.fill=function(s,a,m){if(a=a||0,m=m||this.length,B(typeof(s=typeof(s=s||0)=="string"?s.charCodeAt(0):s)=="number"&&!isNaN(s),"value is not a number"),B(a<=m,"end < start"),m!==a&&this.length!==0){B(0<=a&&a<this.length,"start out of bounds"),B(0<=m&&m<=this.length,"end out of bounds");for(var O=a;O<m;O++)this[O]=s}},h.prototype.inspect=function(){for(var s=[],a=this.length,m=0;m<a;m++)if(s[m]=X(this[m]),m===r.INSPECT_MAX_BYTES){s[m+1]="...";break}return"<Buffer "+s.join(" ")+">"},h.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(h._useTypedArrays)return new h(this).buffer;for(var s=new Uint8Array(this.length),a=0,m=s.length;a<m;a+=1)s[a]=this[a];return s.buffer};var D=h.prototype;function z(s,a,m){return typeof s!="number"?m:a<=(s=~~s)?a:0<=s||0<=(s+=a)?s:0}function q(s){return(s=~~Math.ceil(+s))<0?0:s}function H(s){return(Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"})(s)}function X(s){return s<16?"0"+s.toString(16):s.toString(16)}function Z(s){for(var a=[],m=0;m<s.length;m++){var O=s.charCodeAt(m);if(O<=127)a.push(s.charCodeAt(m));else for(var I=m,j=(55296<=O&&O<=57343&&m++,encodeURIComponent(s.slice(I,m+1)).substr(1).split("%")),V=0;V<j.length;V++)a.push(parseInt(j[V],16))}return a}function ve(s){return v.toByteArray(s)}function de(s,a,m,O){for(var I=0;I<O&&!(I+m>=a.length||I>=s.length);I++)a[I+m]=s[I];return I}function Ae(s){try{return decodeURIComponent(s)}catch{return"�"}}function ue(s,a){B(typeof s=="number","cannot write a non-number as a number"),B(0<=s,"specified a negative value for writing an unsigned value"),B(s<=a,"value is larger than maximum value for type"),B(Math.floor(s)===s,"value has a fractional component")}function ae(s,a,m){B(typeof s=="number","cannot write a non-number as a number"),B(s<=a,"value larger than maximum allowed value"),B(m<=s,"value smaller than minimum allowed value"),B(Math.floor(s)===s,"value has a fractional component")}function pn(s,a,m){B(typeof s=="number","cannot write a non-number as a number"),B(s<=a,"value larger than maximum allowed value"),B(m<=s,"value smaller than minimum allowed value")}function B(s,a){if(!s)throw new Error(a||"Failed assertion")}h._augment=function(s){return s._isBuffer=!0,s._get=s.get,s._set=s.set,s.get=D.get,s.set=D.set,s.write=D.write,s.toString=D.toString,s.toLocaleString=D.toString,s.toJSON=D.toJSON,s.copy=D.copy,s.slice=D.slice,s.readUInt8=D.readUInt8,s.readUInt16LE=D.readUInt16LE,s.readUInt16BE=D.readUInt16BE,s.readUInt32LE=D.readUInt32LE,s.readUInt32BE=D.readUInt32BE,s.readInt8=D.readInt8,s.readInt16LE=D.readInt16LE,s.readInt16BE=D.readInt16BE,s.readInt32LE=D.readInt32LE,s.readInt32BE=D.readInt32BE,s.readFloatLE=D.readFloatLE,s.readFloatBE=D.readFloatBE,s.readDoubleLE=D.readDoubleLE,s.readDoubleBE=D.readDoubleBE,s.writeUInt8=D.writeUInt8,s.writeUInt16LE=D.writeUInt16LE,s.writeUInt16BE=D.writeUInt16BE,s.writeUInt32LE=D.writeUInt32LE,s.writeUInt32BE=D.writeUInt32BE,s.writeInt8=D.writeInt8,s.writeInt16LE=D.writeInt16LE,s.writeInt16BE=D.writeInt16BE,s.writeInt32LE=D.writeInt32LE,s.writeInt32BE=D.writeInt32BE,s.writeFloatLE=D.writeFloatLE,s.writeFloatBE=D.writeFloatBE,s.writeDoubleLE=D.writeDoubleLE,s.writeDoubleBE=D.writeDoubleBE,s.fill=D.fill,s.inspect=D.inspect,s.toArrayBuffer=D.toArrayBuffer,s}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(t,o,r){(function(d,c,v,w,C,E,P,M,N){var v=t("buffer").Buffer,x=4,h=new v(x);h.fill(0),o.exports={hash:function(A,b,L,y){for(var S=b(function(i,_){i.length%x!=0&&(T=i.length+(x-i.length%x),i=v.concat([i,h],T));for(var T,U=[],k=_?i.readInt32BE:i.readInt32LE,R=0;R<i.length;R+=x)U.push(k.call(i,R));return U}(A=v.isBuffer(A)?A:new v(A),y),8*A.length),b=y,f=new v(L),g=b?f.writeInt32BE:f.writeInt32LE,l=0;l<S.length;l++)g.call(f,S[l],4*l,!0);return f}}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(t,o,r){(function(d,c,v,w,C,E,P,M,N){var v=t("buffer").Buffer,x=t("./sha"),h=t("./sha256"),A=t("./rng"),b={sha1:x,sha256:h,md5:t("./md5")},L=64,y=new v(L);function S(i,_){var T=b[i=i||"sha1"],U=[];return T||f("algorithm:",i,"is not yet supported"),{update:function(k){return v.isBuffer(k)||(k=new v(k)),U.push(k),k.length,this},digest:function(k){var R=v.concat(U),R=_?function(D,z,q){v.isBuffer(z)||(z=new v(z)),v.isBuffer(q)||(q=new v(q)),z.length>L?z=D(z):z.length<L&&(z=v.concat([z,y],L));for(var H=new v(L),X=new v(L),Z=0;Z<L;Z++)H[Z]=54^z[Z],X[Z]=92^z[Z];return q=D(v.concat([H,q])),D(v.concat([X,q]))}(T,_,R):T(R);return U=null,k?R.toString(k):R}}}function f(){var i=[].slice.call(arguments).join(" ");throw new Error([i,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
6
|
+
`))}y.fill(0),r.createHash=function(i){return S(i)},r.createHmac=S,r.randomBytes=function(i,_){if(!_||!_.call)return new v(A(i));try{_.call(this,void 0,new v(A(i)))}catch(T){_(T)}};var g,l=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],u=function(i){r[i]=function(){f("sorry,",i,"is not implemented yet")}};for(g in l)u(l[g])}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){var v=t("./helpers");function x(f,g){f[g>>5]|=128<<g%32,f[14+(g+64>>>9<<4)]=g;for(var l=1732584193,u=-271733879,i=-1732584194,_=271733878,T=0;T<f.length;T+=16){var U=l,k=u,R=i,D=_,l=A(l,u,i,_,f[T+0],7,-680876936),_=A(_,l,u,i,f[T+1],12,-389564586),i=A(i,_,l,u,f[T+2],17,606105819),u=A(u,i,_,l,f[T+3],22,-1044525330);l=A(l,u,i,_,f[T+4],7,-176418897),_=A(_,l,u,i,f[T+5],12,1200080426),i=A(i,_,l,u,f[T+6],17,-1473231341),u=A(u,i,_,l,f[T+7],22,-45705983),l=A(l,u,i,_,f[T+8],7,1770035416),_=A(_,l,u,i,f[T+9],12,-1958414417),i=A(i,_,l,u,f[T+10],17,-42063),u=A(u,i,_,l,f[T+11],22,-1990404162),l=A(l,u,i,_,f[T+12],7,1804603682),_=A(_,l,u,i,f[T+13],12,-40341101),i=A(i,_,l,u,f[T+14],17,-1502002290),l=b(l,u=A(u,i,_,l,f[T+15],22,1236535329),i,_,f[T+1],5,-165796510),_=b(_,l,u,i,f[T+6],9,-1069501632),i=b(i,_,l,u,f[T+11],14,643717713),u=b(u,i,_,l,f[T+0],20,-373897302),l=b(l,u,i,_,f[T+5],5,-701558691),_=b(_,l,u,i,f[T+10],9,38016083),i=b(i,_,l,u,f[T+15],14,-660478335),u=b(u,i,_,l,f[T+4],20,-405537848),l=b(l,u,i,_,f[T+9],5,568446438),_=b(_,l,u,i,f[T+14],9,-1019803690),i=b(i,_,l,u,f[T+3],14,-187363961),u=b(u,i,_,l,f[T+8],20,1163531501),l=b(l,u,i,_,f[T+13],5,-1444681467),_=b(_,l,u,i,f[T+2],9,-51403784),i=b(i,_,l,u,f[T+7],14,1735328473),l=L(l,u=b(u,i,_,l,f[T+12],20,-1926607734),i,_,f[T+5],4,-378558),_=L(_,l,u,i,f[T+8],11,-2022574463),i=L(i,_,l,u,f[T+11],16,1839030562),u=L(u,i,_,l,f[T+14],23,-35309556),l=L(l,u,i,_,f[T+1],4,-1530992060),_=L(_,l,u,i,f[T+4],11,1272893353),i=L(i,_,l,u,f[T+7],16,-155497632),u=L(u,i,_,l,f[T+10],23,-1094730640),l=L(l,u,i,_,f[T+13],4,681279174),_=L(_,l,u,i,f[T+0],11,-358537222),i=L(i,_,l,u,f[T+3],16,-722521979),u=L(u,i,_,l,f[T+6],23,76029189),l=L(l,u,i,_,f[T+9],4,-640364487),_=L(_,l,u,i,f[T+12],11,-421815835),i=L(i,_,l,u,f[T+15],16,530742520),l=y(l,u=L(u,i,_,l,f[T+2],23,-995338651),i,_,f[T+0],6,-198630844),_=y(_,l,u,i,f[T+7],10,1126891415),i=y(i,_,l,u,f[T+14],15,-1416354905),u=y(u,i,_,l,f[T+5],21,-57434055),l=y(l,u,i,_,f[T+12],6,1700485571),_=y(_,l,u,i,f[T+3],10,-1894986606),i=y(i,_,l,u,f[T+10],15,-1051523),u=y(u,i,_,l,f[T+1],21,-2054922799),l=y(l,u,i,_,f[T+8],6,1873313359),_=y(_,l,u,i,f[T+15],10,-30611744),i=y(i,_,l,u,f[T+6],15,-1560198380),u=y(u,i,_,l,f[T+13],21,1309151649),l=y(l,u,i,_,f[T+4],6,-145523070),_=y(_,l,u,i,f[T+11],10,-1120210379),i=y(i,_,l,u,f[T+2],15,718787259),u=y(u,i,_,l,f[T+9],21,-343485551),l=S(l,U),u=S(u,k),i=S(i,R),_=S(_,D)}return Array(l,u,i,_)}function h(f,g,l,u,i,_){return S((g=S(S(g,f),S(u,_)))<<i|g>>>32-i,l)}function A(f,g,l,u,i,_,T){return h(g&l|~g&u,f,g,i,_,T)}function b(f,g,l,u,i,_,T){return h(g&u|l&~u,f,g,i,_,T)}function L(f,g,l,u,i,_,T){return h(g^l^u,f,g,i,_,T)}function y(f,g,l,u,i,_,T){return h(l^(g|~u),f,g,i,_,T)}function S(f,g){var l=(65535&f)+(65535&g);return(f>>16)+(g>>16)+(l>>16)<<16|65535&l}o.exports=function(f){return v.hash(f,x,16)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){o.exports=function(v){for(var x,h=new Array(v),A=0;A<v;A++)(3&A)==0&&(x=4294967296*Math.random()),h[A]=x>>>((3&A)<<3)&255;return h}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){var v=t("./helpers");function x(b,L){b[L>>5]|=128<<24-L%32,b[15+(L+64>>9<<4)]=L;for(var y,S,f,g=Array(80),l=1732584193,u=-271733879,i=-1732584194,_=271733878,T=-1009589776,U=0;U<b.length;U+=16){for(var k=l,R=u,D=i,z=_,q=T,H=0;H<80;H++){g[H]=H<16?b[U+H]:A(g[H-3]^g[H-8]^g[H-14]^g[H-16],1);var X=h(h(A(l,5),(X=u,S=i,f=_,(y=H)<20?X&S|~X&f:!(y<40)&&y<60?X&S|X&f|S&f:X^S^f)),h(h(T,g[H]),(y=H)<20?1518500249:y<40?1859775393:y<60?-1894007588:-899497514)),T=_,_=i,i=A(u,30),u=l,l=X}l=h(l,k),u=h(u,R),i=h(i,D),_=h(_,z),T=h(T,q)}return Array(l,u,i,_,T)}function h(b,L){var y=(65535&b)+(65535&L);return(b>>16)+(L>>16)+(y>>16)<<16|65535&y}function A(b,L){return b<<L|b>>>32-L}o.exports=function(b){return v.hash(b,x,20,!0)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){function v(L,y){var S=(65535&L)+(65535&y);return(L>>16)+(y>>16)+(S>>16)<<16|65535&S}function x(L,y){var S,f=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),g=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),l=new Array(64);L[y>>5]|=128<<24-y%32,L[15+(y+64>>9<<4)]=y;for(var u,i,_=0;_<L.length;_+=16){for(var T=g[0],U=g[1],k=g[2],R=g[3],D=g[4],z=g[5],q=g[6],H=g[7],X=0;X<64;X++)l[X]=X<16?L[X+_]:v(v(v((i=l[X-2],A(i,17)^A(i,19)^b(i,10)),l[X-7]),(i=l[X-15],A(i,7)^A(i,18)^b(i,3))),l[X-16]),S=v(v(v(v(H,A(i=D,6)^A(i,11)^A(i,25)),D&z^~D&q),f[X]),l[X]),u=v(A(u=T,2)^A(u,13)^A(u,22),T&U^T&k^U&k),H=q,q=z,z=D,D=v(R,S),R=k,k=U,U=T,T=v(S,u);g[0]=v(T,g[0]),g[1]=v(U,g[1]),g[2]=v(k,g[2]),g[3]=v(R,g[3]),g[4]=v(D,g[4]),g[5]=v(z,g[5]),g[6]=v(q,g[6]),g[7]=v(H,g[7])}return g}var h=t("./helpers"),A=function(L,y){return L>>>y|L<<32-y},b=function(L,y){return L>>>y};o.exports=function(L){return h.hash(L,x,32,!0)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){r.read=function(v,x,h,A,_){var L,y,S=8*_-A-1,f=(1<<S)-1,g=f>>1,l=-7,u=h?_-1:0,i=h?-1:1,_=v[x+u];for(u+=i,L=_&(1<<-l)-1,_>>=-l,l+=S;0<l;L=256*L+v[x+u],u+=i,l-=8);for(y=L&(1<<-l)-1,L>>=-l,l+=A;0<l;y=256*y+v[x+u],u+=i,l-=8);if(L===0)L=1-g;else{if(L===f)return y?NaN:1/0*(_?-1:1);y+=Math.pow(2,A),L-=g}return(_?-1:1)*y*Math.pow(2,L-A)},r.write=function(v,x,h,A,b,T){var y,S,f=8*T-b-1,g=(1<<f)-1,l=g>>1,u=b===23?Math.pow(2,-24)-Math.pow(2,-77):0,i=A?0:T-1,_=A?1:-1,T=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(S=isNaN(x)?1:0,y=g):(y=Math.floor(Math.log(x)/Math.LN2),x*(A=Math.pow(2,-y))<1&&(y--,A*=2),2<=(x+=1<=y+l?u/A:u*Math.pow(2,1-l))*A&&(y++,A/=2),g<=y+l?(S=0,y=g):1<=y+l?(S=(x*A-1)*Math.pow(2,b),y+=l):(S=x*Math.pow(2,l-1)*Math.pow(2,b),y=0));8<=b;v[h+i]=255&S,i+=_,S/=256,b-=8);for(y=y<<b|S,f+=b;0<f;v[h+i]=255&y,i+=_,y/=256,f-=8);v[h+i-_]|=128*T}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(t,o,r){(function(d,c,p,w,C,E,P,M,N){var v,x,h;function A(){}(d=o.exports={}).nextTick=(x=typeof window<"u"&&window.setImmediate,h=typeof window<"u"&&window.postMessage&&window.addEventListener,x?function(b){return window.setImmediate(b)}:h?(v=[],window.addEventListener("message",function(b){var L=b.source;L!==window&&L!==null||b.data!=="process-tick"||(b.stopPropagation(),0<v.length&&v.shift()())},!0),function(b){v.push(b),window.postMessage("process-tick","*")}):function(b){setTimeout(b,0)}),d.title="browser",d.browser=!0,d.env={},d.argv=[],d.on=A,d.addListener=A,d.once=A,d.off=A,d.removeListener=A,d.removeAllListeners=A,d.emit=A,d.binding=function(b){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(b){throw new Error("process.chdir is not supported")}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})}(Ze)),Ze.exports}var lo=io();const uo=ct(lo),ao=(e,n)=>e===void 0||n===void 0||Number(e)<Number(n),fo=(e,n)=>e===void 0||n===void 0||Number(e)>Number(n),rt=(e,n=0,t=!1)=>{const o=t&&n!==0?n+1:"";return`${e}${o}`},co=e=>{var n;return((n=e==null?void 0:e.match(/[^0-9/]+/gi))==null?void 0:n[0])??""},bs=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null,go=(e,n)=>uo({state:e,languageKey:n},{unorderedObjects:!0}),hn=({chartRef:e,state:n,options:t,dispatch:o,generatedDatasets:r})=>{const{interactions:{onHover:d,onUnhover:c},axes:p}=t,w=G.useCallback(()=>{var L,y;const b=e==null?void 0:e.current;b&&(n!=null&&n.edited)&&((L=b==null?void 0:b.resetZoom)==null||L.call(b),(y=b==null?void 0:b.reset)==null||y.call(b),o({type:sn,payload:{axes:[]}}),o({type:De,payload:!1}))},[e==null?void 0:e.current,o,n]),C=G.useCallback((b,L,y)=>(S,f)=>{if(!(f!=null&&f.length)&&c&&b&&(L(null),c(S)),f!=null&&f.length&&d){const{index:g,datasetIndex:l}=f[0],u=y[l],i=u==null?void 0:u.data[g];i&&!xr(b,i)&&(L(i),d(S,l,g,y))}},[d,c,r]),E=G.useCallback(()=>Tr(e),[e==null?void 0:e.current]),P=G.useCallback(b=>{var L,y,S,f,g;if(b.key===bn.Shift){const l=e.current,u=(S=(y=(L=l==null?void 0:l.config)==null?void 0:L.options)==null?void 0:y.plugins)==null?void 0:S.zoom;(f=u==null?void 0:u.zoom)!=null&&f.mode&&((g=u==null?void 0:u.pan)!=null&&g.mode)&&(u.zoom.mode=we.Y,u.pan.mode=we.Y,l==null||l.update())}},[e==null?void 0:e.current]),M=G.useCallback(b=>{var L,y,S,f,g;if(b.key===bn.Shift){const l=e.current,u=(S=(y=(L=l==null?void 0:l.config)==null?void 0:L.options)==null?void 0:y.plugins)==null?void 0:S.zoom;(f=u==null?void 0:u.zoom)!=null&&f.mode&&((g=u==null?void 0:u.pan)!=null&&g.mode)&&(u.zoom.mode=we.XY,u.pan.mode=we.XY,l==null||l.update())}},[e==null?void 0:e.current]),N=G.useCallback(b=>{var y;if(!((y=Object.keys(b))!=null&&y.length))return[];const L=(S,f)=>{var g;return!S[f]||!((g=S[f])!=null&&g.length)?[]:S[f].map((l,u)=>({id:rt(f,u,S[f].length>1),label:(l==null?void 0:l.label)||""}))};return[...L(b,fe.X),...L(b,fe.Y)]},[p]),v=G.useCallback(()=>{var y;const{scales:b={}}=(e==null?void 0:e.current)||{},L=(y=Object.entries(b))==null?void 0:y.map(([S,{min:f,max:g}])=>({id:S,min:f??0,max:g??0}));o({type:ln,payload:{axes:L}})},[p]),x=G.useCallback(()=>{var L,y;const b=e==null?void 0:e.current;b&&n.edited&&((L=b==null?void 0:b.resetZoom)==null||L.call(b),(y=b==null?void 0:b.reset)==null||y.call(b),o({type:sn,payload:{axes:[]}}),o({type:De,payload:!1}))},[e==null?void 0:e.current]),h=G.useCallback(({axes:b})=>{o({type:ln,payload:{axes:b}})},[]),A=G.useCallback(b=>{o({type:De,payload:b})},[n]);return{resetZoom:w,onHover:C,handleDownload:E,handleKeyDown:P,handleKeyUp:M,controlsAxesLabels:N(p),updateAxesRangesFromChart:v,onResetAxes:x,onUpdateAxes:h,onUpdateEdited:A}},In=(e,n,t)=>{const o=[];return gt(e)&&o.push("mustHaveAValue"),t==="min"&&!ao(e,n)?o.push("mustBeLessThanMax"):t==="max"&&!fo(e,n)&&o.push("mustBeGreaterThanMin"),o},ho=e=>{const n=e.map(({id:o,min:r,max:d})=>({id:o,min:In(String(r),String(d),"min"),max:In(String(d),String(r),"max")})),t=n.every(o=>o.min.length===0&&o.max.length===0);return{errors:n,valid:t}},On=1,Nn=({chartRef:e,state:n})=>{const t=e==null?void 0:e.current;if(!t)return[];const o=(t==null?void 0:t.getInitialScaleBounds())??{};return Object.entries(o).map(([r,{min:d="",max:c=""}])=>{var E;let p=Number(d),w=Number(c);isNaN(p)&&(p=0),isNaN(w)&&(w=p+On),p===w&&(w+=On);const{unit:C}=((E=n==null?void 0:n.axes)==null?void 0:E.find(P=>P.id===r))??{};return{id:r,min:p,max:w,unit:C}})},po=e=>{var L;const{state:n,controlsAxesLabels:t,onUpdateAxes:o,onResetAxes:r,onUpdateEdited:d,depthType:c,translations:p,close:w,chartRef:C}=e??{},[E,P]=G.useState({localAxes:Nn({chartRef:C,state:n}),depthType:c==null?void 0:c.selectedDepthType,edited:n.edited}),{errors:M,valid:N}=ho(E.localAxes),v=({name:y,value:S,id:f})=>{P(g=>({...g,localAxes:g.localAxes.map(l=>l.id===f?{...l,[y]:S}:l),edited:!0}))},x=({name:y,value:S,id:f})=>{P(g=>({...g,localAxes:g.localAxes.map(l=>l.id===f&&typeof l.unit=="object"?{...l,unit:{...l.unit,[y]:S}}:l),edited:!0}))},h=y=>{y.preventDefault(),N&&(o({axes:E.localAxes}),w==null||w()),c&&(c!=null&&c.setSelectedDepthType)&&(c==null||c.setSelectedDepthType(E.depthType)),d(E.edited)},A=()=>{P({localAxes:Nn({chartRef:C,state:n}),depthType:c==null?void 0:c.selectedDepthType,edited:!1}),r(),d(!1),w==null||w()},b=y=>y.target.select();return F.jsxs("form",{onSubmit:h,children:[E.localAxes.map(y=>{var l,u;const S=t.find(i=>i.id===y.id),f=(S==null?void 0:S.label)||Y.startCase(y.id),g=M.find(i=>i.id===y.id);return F.jsx(Kt,{label:f,children:F.jsxs(Jt,{small:!0,width:"300px",children:[F.jsx(En,{name:"min",value:y.min,error:(l=g==null?void 0:g.min)!=null&&l[0]?p[g.min[0]]:null,width:"100%",onChange:i=>v({name:i.target.name,value:i.target.value,id:y.id}),onFocus:b}),F.jsx(Qt,{children:"to"}),F.jsx(En,{name:"max",value:y.max,error:(u=g==null?void 0:g.max)!=null&&u[0]?p[g.max[0]]:null,width:"100%",onChange:i=>v({name:i.target.name,value:i.target.value,id:y.id}),onFocus:b}),y.unit?F.jsx(er,{name:"selectedUnit",options:typeof y.unit!="string"?y.unit.options:[],value:typeof y.unit!="string"?y.unit.selectedUnit:void 0,onChange:i=>x({name:i.target.name,value:i.target.value,id:y.id}),autoLayerWidth:!0,width:"15%"}):null]})},y.id)}),((L=c==null?void 0:c.options)==null?void 0:L.length)>0&&F.jsxs(F.Fragment,{children:[F.jsx(nr,{items:c.options.map((y,S)=>({key:S,label:y})),onSelected:y=>{P(S=>({...S,depthType:c.options[y],edited:!0}))},small:!0,value:c.options.indexOf(E.depthType)}),F.jsx(tr,{})]}),F.jsxs(rr,{gap:"8px",alignItems:"center",children:[F.jsx(ce,{type:"submit",small:!0,colored:!0,label:p.done,disabled:!N||!E.edited}),F.jsx(ce,{small:!0,name:"resetAxes",label:p.resetAxes,onClick:A}),F.jsx(Un,{small:!0,muted:!0,children:p.orDoubleClickToCanvas})]})]})},ot=e=>F.jsx($t,{placement:"bottom-start",overflowContainer:!0,content:F.jsx(po,{...e}),children:F.jsx(je,{text:e.translations.axesOptions,placement:"bottom-start",display:"inline-flex",children:F.jsx(ce,{small:!0,basic:!0,colored:"muted",round:!0,icon:F.jsx(Zt,{})})})});ot.__docgenInfo={description:"",methods:[],displayName:"AxesOptions",props:{chartRef:{required:!0,tsType:{name:"RefObject",elements:[{name:"Chart"}],raw:"RefObject<Chart>"},description:""},state:{required:!0,tsType:{name:"IState"},description:""},controlsAxesLabels:{required:!0,tsType:{name:"Array",elements:[{name:"IAxisControlLabel"}],raw:"IAxisControlLabel[]"},description:""},onUpdateAxes:{required:!0,tsType:{name:"signature",type:"function",raw:"({ axes }: { axes: IAxisState }) => void",signature:{arguments:[{type:{name:"signature",type:"object",raw:"{ axes: IAxisState }",signature:{properties:[{key:"axes",value:{name:"IAxisState",required:!0}}]}},name:""}],return:{name:"void"}}},description:""},onResetAxes:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},onUpdateEdited:{required:!0,tsType:{name:"signature",type:"function",raw:"(edited: boolean) => void",signature:{arguments:[{type:{name:"boolean"},name:"edited"}],return:{name:"void"}}},description:""},depthType:{required:!1,tsType:{name:"union",raw:"IDepthType | object",elements:[{name:"IDepthType"},{name:"object"}]},description:""},close:{required:!1,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:""},translations:{required:!0,tsType:{name:"Record",elements:[{name:"string"},{name:"string"}],raw:"Record<string, string>"},description:""}}};const st=({table:e,headerComponent:n,subheaderComponent:t,chartRef:o,state:r,options:d,dispatch:c,generatedDatasets:p,translations:w,controlsPortalId:C})=>{const{enableDragPoints:E,lineEnabled:P,panEnabled:M,pointsEnabled:N,showTable:v,zoomEnabled:x,enableDragAnnotation:h}=r,{dragData:A,depthType:b,annotations:L}=d,{onToggleLine:y,onTogglePan:S,onTogglePoints:f,onToggleTable:g,onToggleZoom:l,onToggleDragPoints:u,onToggleDragAnnotation:i,onDisableDragOptions:_}=so(c),{handleDownload:T,controlsAxesLabels:U,onResetAxes:k,onUpdateAxes:R,onUpdateEdited:D}=hn({chartRef:o,state:r,options:d,dispatch:c,generatedDatasets:p}),[z,{width:q}]=or(),H=q<200,X=G.useMemo(()=>no({lineEnabled:P,onToggleLine:y,onTogglePoints:f,pointsEnabled:N,translations:w}),[P,N]),Z=G.useMemo(()=>to({onTogglePan:S,onToggleZoom:l,panEnabled:M,zoomEnabled:x,enableDragPoints:E,enableDragAnnotation:h,isDragDataAllowed:A==null?void 0:A.enableDragData,isDragAnnotationAllowed:L==null?void 0:L.enableDragAnnotation,onToggleDragAnnotation:i,onToggleDragPoints:u,onDisableDragOptions:_,translations:w}),[x,M,E,A==null?void 0:A.enableDragData,L==null?void 0:L.enableDragAnnotation]);return F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:Sn.controls,children:[!!d.title&&F.jsx(Un,{bold:!0,children:d.title}),n,F.jsx(Lr,{controlsPortalId:C??"",children:F.jsxs("div",{className:Sn.buttons,ref:z,children:[!v&&F.jsxs(F.Fragment,{children:[F.jsx(ot,{chartRef:o,state:r,controlsAxesLabels:U,onUpdateAxes:R,onResetAxes:k,onUpdateEdited:D,depthType:b,translations:w}),H?F.jsx(cn,{menu:{placement:"bottom-end",sections:[...X,{type:"Divider"},...Z,{type:"Divider"},{icon:"download",label:w.downloadAsPNG,type:"Option",onClick:T}],trigger:"Component",component:F.jsx(ce,{colored:"muted",basic:!0,small:!0,round:!0,icon:"menu"})}}):F.jsxs(F.Fragment,{children:[F.jsx(nt,{options:X}),F.jsx(je,{display:"inline-flex",text:w.downloadAsPNG,placement:"bottom-end",children:F.jsx(ce,{small:!0,basic:!0,colored:"muted",round:!0,icon:"download",onClick:T})}),F.jsx(tt,{options:Z})]})]}),e?F.jsx(je,{display:"inline-flex",text:v?w.showChart:w.showTable,placement:"bottom-end",children:F.jsx(ce,{small:!0,basic:!0,colored:"muted",round:!0,icon:v?"chart":"table",onClick:g})}):null]})})]}),t]})};st.__docgenInfo={description:"",methods:[],displayName:"Controls",props:{headerComponent:{required:!1,tsType:{name:"ReactNode"},description:""},subheaderComponent:{required:!1,tsType:{name:"ReactNode"},description:""},table:{required:!1,tsType:{name:"ReactNode"},description:""},chartRef:{required:!0,tsType:{name:"RefObject",elements:[{name:"Chart"}],raw:"RefObject<Chart>"},description:""},state:{required:!0,tsType:{name:"IState"},description:""},options:{required:!0,tsType:{name:"ILineChartOptions"},description:""},dispatch:{required:!0,tsType:{name:"Dispatch",elements:[{name:"any"}],raw:"Dispatch<any>"},description:""},generatedDatasets:{required:!0,tsType:{name:"Array",elements:[{name:"IGeneratedLineChartDataset"}],raw:"IGeneratedLineChartDataset[]"},description:""},translations:{required:!0,tsType:{name:"Record",elements:[{name:"string"},{name:"string"}],raw:"Record<string, string>"},description:""},controlsPortalId:{required:!1,tsType:{name:"string"},description:""}}};const se={TOP_LEFT:"top-left",TOP_CENTER:"top-center",TOP_RIGHT:"top-right",MIDDLE_LEFT:"middle-left",MIDDLE_CENTER:"middle-center",MIDDLE_RIGHT:"middle-right",BOTTOM_LEFT:"bottom-left",BOTTOM_CENTER:"bottom-center",BOTTOM_RIGHT:"bottom-right"},Mn=e=>({label:"",position:e,color:"",unit:{options:[],selectedUnit:"",setSelectedUnit:()=>{}}}),mo=e=>({x:(e==null?void 0:e.x)||[Mn("bottom")],y:(e==null?void 0:e.y)||[Mn("left")]}),bo=e=>({chartScaleType:(e==null?void 0:e.chartScaleType)||"linear",reverse:(e==null?void 0:e.reverse)||!1,beginAtZero:(e==null?void 0:e.beginAtZero)??!1,stepSize:e==null?void 0:e.stepSize,suggestedMin:e==null?void 0:e.suggestedMin,suggestedMax:e==null?void 0:e.suggestedMax,range:e==null?void 0:e.range,autoAxisPadding:(e==null?void 0:e.autoAxisPadding)??!1}),yo=e=>({width:e==null?void 0:e.width,height:e==null?void 0:e.height,maintainAspectRatio:(e==null?void 0:e.maintainAspectRatio)??!1,staticChartHeight:(e==null?void 0:e.staticChartHeight)??!1,performanceMode:(e==null?void 0:e.performanceMode)??!0,squareAspectRatio:(e==null?void 0:e.squareAspectRatio)??!1,layoutPadding:(e==null?void 0:e.layoutPadding)||{top:0,bottom:20,left:0,right:0}}),wo=e=>({tooltips:(e==null?void 0:e.tooltips)??!0,showLabelsInTooltips:(e==null?void 0:e.showLabelsInTooltips)??!1,hideSimulationName:(e==null?void 0:e.hideSimulationName)??!1,scientificNotation:(e==null?void 0:e.scientificNotation)??!0}),_o=e=>({lineTension:(e==null?void 0:e.lineTension)??.01,spanGaps:(e==null?void 0:e.spanGaps)??!1,showDataLabels:(e==null?void 0:e.showDataLabels)??!1,showMinorGridlines:(e==null?void 0:e.showMinorGridlines)??!1}),Eo=e=>e?e.map(n=>({...n,display:(n==null?void 0:n.display)??!0})):[],To=e=>{var n,t,o,r,d,c,p,w;return{labelAnnotation:{showLabel:((n=e==null?void 0:e.labelAnnotation)==null?void 0:n.showLabel)??!1,text:((t=e==null?void 0:e.labelAnnotation)==null?void 0:t.text)??"",position:((o=e==null?void 0:e.labelAnnotation)==null?void 0:o.position)??se.BOTTOM_RIGHT,fontSize:((r=e==null?void 0:e.labelAnnotation)==null?void 0:r.fontSize)??12,xOffset:((d=e==null?void 0:e.labelAnnotation)==null?void 0:d.xOffset)??5,yOffset:((c=e==null?void 0:e.labelAnnotation)==null?void 0:c.yOffset)??5,maxWidth:((p=e==null?void 0:e.labelAnnotation)==null?void 0:p.maxWidth)??300,lineHeight:((w=e==null?void 0:e.labelAnnotation)==null?void 0:w.lineHeight)??12},showAnnotations:(e==null?void 0:e.showAnnotations)??!1,controlAnnotation:(e==null?void 0:e.controlAnnotation)??!1,enableDragAnnotation:(e==null?void 0:e.enableDragAnnotation)??!1,annotationsData:Eo(e==null?void 0:e.annotationsData)}},Lo=e=>({display:(e==null?void 0:e.display)??!0,position:(e==null?void 0:e.position)??Ce.BottomLeft,align:(e==null?void 0:e.align)??ie.Center,customLegend:(e==null?void 0:e.customLegend)??{customLegendPlugin:null,customLegendContainerID:""},usePointStyle:(e==null?void 0:e.usePointStyle)??!0}),vo=e=>({showPoints:(e==null?void 0:e.showPoints)??!0,showLine:(e==null?void 0:e.showLine)??!0,enableZoom:(e==null?void 0:e.enableZoom)??!0,enablePan:(e==null?void 0:e.enablePan)??!1,enableDragAnnotation:(e==null?void 0:e.enableDragAnnotation)??!1,closeOnOutsideClick:(e==null?void 0:e.closeOnOutsideClick)??!1}),Ao=e=>({onLegendClick:e==null?void 0:e.onLegendClick,onHover:e==null?void 0:e.onHover,onUnhover:e==null?void 0:e.onUnhover,onAnimationComplete:e==null?void 0:e.onAnimationComplete}),xo=e=>({enableDragData:(e==null?void 0:e.enableDragData)??!1,showTooltip:(e==null?void 0:e.showTooltip)??!0,roundPoints:(e==null?void 0:e.roundPoints)??!0,dragX:(e==null?void 0:e.dragX)??!0,dragY:(e==null?void 0:e.dragY)??!0,onDragStart:e==null?void 0:e.onDragStart,onDrag:e==null?void 0:e.onDrag,onDragEnd:e==null?void 0:e.onDragEnd}),it=e=>{const n=(e==null?void 0:e.chart)||{},t=(n==null?void 0:n.options)||{};return{persistenceId:(n==null?void 0:n.persistenceId)??"",controlsPortalId:(n==null?void 0:n.controlsPortalId)??"",testId:(n==null?void 0:n.testId)??void 0,data:(n==null?void 0:n.data)??{datasets:[]},options:{title:(t==null?void 0:t.title)??"",scales:(t==null?void 0:t.scales)??{},axes:mo(t==null?void 0:t.axes),additionalAxesOptions:bo(t==null?void 0:t.additionalAxesOptions),chartStyling:yo(t==null?void 0:t.chartStyling),tooltip:wo(t==null?void 0:t.tooltip),graph:_o(t==null?void 0:t.graph),annotations:To(t==null?void 0:t.annotations),legend:Lo(t==null?void 0:t.legend),chartOptions:vo(t==null?void 0:t.chartOptions),interactions:Ao(t==null?void 0:t.interactions),dragData:xo(t==null?void 0:t.dragData),depthType:(t==null?void 0:t.depthType)??{}}}},Co=(e,n)=>{if(Y.isEmpty(e)||Y.isEmpty(n))return!1;const t=o=>typeof n=="string"?o&&Y.has(o,n):Y.isArray(n)?o&&Y.some(n,r=>o&&Y.has(o,r)):o&&Y.some(Object.values(n),r=>o&&Y.has(o,r));return Y.isArray(e)?Y.some(e,t):t(e)};var lt=(e=>(e.showLine="showLine",e.showPoints="showPoints",e))(lt||{});const So=(e,n,t,{label:o})=>{const r=[...e??[]],{annotations:d,graph:c}=t??{},{controlAnnotation:p,showAnnotations:w,annotationsData:C=[]}=d??{};if(p&&w){const E=C.map((P,M)=>{const{type:N,...v}=P,x=v.color??_e[M],h=ht,A=an.INITIAL;return{...v,isAnnotation:!0,annotationType:N,label:v.label,annotationIndex:M,backgroundColor:x,pointBackgroundColor:x,borderColor:x,borderDash:h,borderWidth:A,data:[{}]}});r.push(...E)}return r==null?void 0:r.map((E,P)=>{var Z,ve;const{formation:M,data:N=[],pointRadius:v,pointHoverRadius:x,borderWidth:h,borderColor:A,backgroundColor:b,pointBackgroundColor:L,borderDash:y,showPoints:S,showLine:f}=E??{},{lineEnabled:g,pointsEnabled:l,axes:u=[]}=n??{},{lineTension:i,spanGaps:_}=c??{},T=Array.isArray(N)?N:[];if(M&&(T!=null&&T.length)){const de=Number((Z=u[0])==null?void 0:Z.min),Ae=Number((ve=u[0])==null?void 0:ve.max),[ue,ae]=T;de&&(ue!=null&&ue.x)&&(T[0].x=Math.max(de,ue.x)),Ae&&(ae!=null&&ae.x)&&(T[2].x=Math.min(Ae,ae.x))}const U=Co(E,lt),k=(T==null?void 0:T.filter(Boolean))||[],R=(k==null?void 0:k.length)===1;let D,z;S!==void 0?D=S:f===!1?D=!0:D=l||R,f!==void 0?z=f:S===!1?z=!0:z=g;const q=parseFloat(v)||ir,H=parseFloat(x)||sr,X=_e[P];return{...E,label:(E==null?void 0:E.label)??`${o} ${P+1}`,data:k,showLine:z,lineTension:(E==null?void 0:E.lineTension)??i,spanGaps:_,borderWidth:parseFloat(h)||ar,borderDash:y||[],borderJoinStyle:ur,borderColor:A??X??Ke(_e),backgroundColor:b??lr,pointBackgroundColor:L??X??Ke(_e),pointRadius:D?q:0,pointHoverRadius:H,pointHitRadius:(E==null?void 0:E.pointHitRadius)??H,...U?{hasCustomOpt:U}:{}}})},un=(e,n,t,o,r=0)=>{var E,P,M,N,v,x,h;const d=o||e.axes[n][0]||{},c=t==null?void 0:t.axes.filter(A=>{var b;return(b=A==null?void 0:A.id)==null?void 0:b.startsWith(n)})[r],p=(P=(E=e==null?void 0:e.scales)==null?void 0:E[`${r===0?n:n+r}`])==null?void 0:P.ticks,{additionalAxesOptions:w}=e,C=()=>{const A=(w==null?void 0:w.chartScaleType)===mt.Logarithmic,b=(S,f,g)=>A?yt.includes(S)?Tn(S,g):"":Tn(S,g);return{...A?{}:{stepSize:d.stepSize??(n===fe.Y?w.stepSize:null)},callback:b,includeBounds:!1,...p,font:{size:bt}}};return{display:!0,type:w.chartScaleType,position:d.position,beginAtZero:w.beginAtZero,reverse:n===fe.Y?w.reverse:!1,suggestedMax:w.suggestedMax,suggestedMin:w.suggestedMin,min:(c==null?void 0:c.min)??((N=(M=w==null?void 0:w.range)==null?void 0:M[n])==null?void 0:N.min),max:(c==null?void 0:c.max)??((x=(v=w==null?void 0:w.range)==null?void 0:v[n])==null?void 0:x.max),title:{display:(h=d.label)==null?void 0:h.length,text:d.label,padding:0},ticks:C(),grid:{...d.gridLines}}},Dn=(e,n,t)=>e.axes[n].reduce((d,c,p)=>{const w=c;w.color=c.color||_e[p]||Ke(_e),w.position=c.position||pt(n,p);const C=un(e,n,t,w,p),E=rt(n,p,!0);return{...d,[E]:C}},{}),Po=(e,n)=>{var c,p;const t=((c=e.axes.x)==null?void 0:c.length)>1,o=((p=e.axes.y)==null?void 0:p.length)>1,r=t?Dn(e,fe.X,n):{x:un(e,fe.X,n)},d=o?Dn(e,fe.Y,n):{y:un(e,fe.Y,n)};return{...r,...d}},Io=e=>{var t;if(!Array.isArray(e)||!(e!=null&&e.length))return!1;const n=e==null?void 0:e.reduce((o,r)=>{var w,C,E,P;const d=(r==null?void 0:r.xAxisID)??"x",c=(r==null?void 0:r.yAxisID)??"y",p=(r==null?void 0:r.data)??[];if(p&&(p!=null&&p.length)){const{x:M,y:N}=(p==null?void 0:p[0])??{},{x:v=0,y:x=0}=(p==null?void 0:p.at(-1))??{},h=((w=o==null?void 0:o[d])==null?void 0:w.xFirst)??M,A=((C=o==null?void 0:o[d])==null?void 0:C.xLast)??v,b=((E=o==null?void 0:o[c])==null?void 0:E.yFirst)??N,L=((P=o==null?void 0:o[c])==null?void 0:P.yLast)??x,y=Math.min(M,h),S=Math.max(v,A),f=Math.min(N,b),g=Math.max(x,L);o={...o,[d]:{...o[d],xFirst:y,xLast:S},[c]:{yFirst:f,yLast:g}}}return o},{});return(t=Object.values(n))==null?void 0:t.some(({xFirst:o,xLast:r,yFirst:d,yLast:c})=>Se(o,r,{absoluteDiff:Pe})||Se(d,c,{absoluteDiff:Pe}))},Bn=.05,Oo={min:-1,max:1},No=({data:e,beginAtZero:n=!1,autoAxisPadding:t=!1})=>{const o=Math.min(...e.filter(N=>N!=null&&!isNaN(N))),r=Math.max(...e.filter(N=>N!=null&&!isNaN(N))),d=Math.sign(o)===-1||Math.sign(r)===-1,c=Se(o,0,{absoluteDiff:Pe})&&Se(r,0,{absoluteDiff:Pe});if(!(e!=null&&e.length)||c)return Oo;if(Se(o,r,{absoluteDiff:Pe})){const N=r,v=N*Bn,x=n&&!d?0:N-v,h=n&&d?0:N+v,A=Ee(h,Ne),b=Ee(x,Ne);return{min:A<0?A:b,max:b<0?b:A}}if(!t)return{min:void 0,max:void 0};const p=o===0||r===0||n,w=Math.sign(o)===-1&&Math.sign(r)===1,C=Math.abs(r-o),E=t?C*Bn:0,P=!w&&p&&n&&!d?0:o-E,M=!w&&p&&n&&d?0:r+E;return{min:Ee(P,Ne),max:Ee(M,Ne)}},Mo=e=>e==null?void 0:e.reduce((n,t)=>({...n,[t.annotationAxis]:[...n[t.annotationAxis]||[],+t.value]}),{}),Do=(e,n,t)=>{if(!Array.isArray(e)||!Array.isArray(n))return{};const o=Mo(t);return n.reduce((r,d)=>{const c=co(d),p=e.filter(C=>(C[`${c}AxisID`]??c)===d).flatMap(C=>((C==null?void 0:C.data)??[]).map(P=>P[c])),w=(o==null?void 0:o[d])??[];return r[d]=[...new Set([...p,...w])],r},{})},jn=(e,n)=>!Y.isNil(e)||!Y.isNil(n),Bo=(e,n,t)=>{const{additionalAxesOptions:o,annotations:{annotationsData:r=[],controlAnnotation:d=!1}={}}=e||{},c=Po(e,n)||{},p=d?t.filter(({isAnnotation:P})=>!P):t;if(!(o!=null&&o.autoAxisPadding)&&!Io(p))return c;const w=Object.keys(c)??[],C=Do(t,w,r);return(C&&(w==null?void 0:w.reduce((P,M)=>{const N=c[M],{min:v=void 0,max:x=void 0}=N,{min:h,max:A}=No({data:C[M],beginAtZero:o==null?void 0:o.beginAtZero,autoAxisPadding:o==null?void 0:o.autoAxisPadding}),b={[M]:{...N,min:v??(jn(v,x)?void 0:h),max:x??(jn(v,x)?void 0:A)}};return{...P,...b}},{})))??c},jo=(e,n,t,o,r)=>{const c=e??0,p=n??0,w=t??0,C=o??0,E=r??0,P=c-100<=w,M=c+100>=C,N=c+100>=w&&c+100<C&&p+100>=E;return{overLeftSide:P,overRightSide:M,overBottomSide:N}},Fo=e=>{var M,N;const n=e==null?void 0:e.chart,t=(e==null?void 0:e.dataIndex)??0,o=(e==null?void 0:e.datasetIndex)??0,r=(n==null?void 0:n.chartArea)??{},{left:d=null,right:c=null,bottom:p=null}=r,w=(M=n==null?void 0:n.getDatasetMeta)==null?void 0:M.call(n,o),C=(N=w==null?void 0:w.data)==null?void 0:N[t],E=(C==null?void 0:C.x)??null,P=(C==null?void 0:C.y)??null;return{x:E,y:P,left:d,right:c,bottom:p}},ko=()=>e=>{const{x:n,y:t,left:o,right:r,bottom:d}=Fo(e),{overLeftSide:c=!1,overRightSide:p=!1,overBottomSide:w=!1}=jo(n,t,o,r,d);return c&&ie.Right||p&&ie.Left||w&&ie.End||ie.Start},Uo=e=>{var n;return(n=e==null?void 0:e.graph)!=null&&n.showDataLabels?{display:Je,align:ko(),formatter:(t,o)=>{var d,c;const r=(c=(d=o==null?void 0:o.dataset)==null?void 0:d.data)==null?void 0:c[o.dataIndex];return!r||r.label==null?"":typeof r.label=="string"?r.label:Array.isArray(r.label)?r.label.map(String):String(r.label)}}:{display:!1}},Ro=e=>{const n=e==null?void 0:e.match(/\[(.*)\]/g);return n&&(n==null?void 0:n.length)>0?n==null?void 0:n[0]:""},Fn=(e,n)=>{let t={};return n?(Math.abs(e)<fr||Math.abs(e)>cr)&&(t={roundScientificCoefficient:3}):t={scientific:!1},Lt(vt(e),t)},Go=e=>{var d,c,p,w,C;if(!((c=(d=e==null?void 0:e.axes)==null?void 0:d.x)!=null&&c.length)||!((w=(p=e==null?void 0:e.axes)==null?void 0:p.y)!=null&&w.length))return console.warn("Tooltip config fallback: missing axes",e),{enabled:!1,callbacks:{}};const{scientificNotation:n}=(e==null?void 0:e.tooltip)??{},t=({xAxisID:E="",yAxisID:P=""})=>{var h,A,b,L,y,S,f;const M=(E==null?void 0:E.length)>1?Number(E==null?void 0:E[1])-1:0,N=(P==null?void 0:P.length)>1?Number(P==null?void 0:P[1])-1:0,v=(A=(h=e==null?void 0:e.axes)==null?void 0:h.x)==null?void 0:A[M],x=(L=(b=e==null?void 0:e.axes)==null?void 0:b.y)==null?void 0:L[N];return((f=(S=(y=e==null?void 0:e.axes)==null?void 0:y.x)==null?void 0:S[0])==null?void 0:f.position)===Ce.Top?{titleAxisLabel:(x==null?void 0:x.label)||"",valueAxisLabel:(v==null?void 0:v.label)||"",titleLabel:be.Y,valueLabel:be.X}:{titleAxisLabel:(v==null?void 0:v.label)||"",valueAxisLabel:(x==null?void 0:x.label)||"",titleLabel:be.X,valueLabel:be.Y}},o=E=>{var h,A,b,L;if(!(E!=null&&E[0]))return"";const P=t(E[0].dataset),{titleLabel:M="",titleAxisLabel:N=""}=P??{},v=M===be.Y?(A=(h=E==null?void 0:E[0])==null?void 0:h.parsed)==null?void 0:A.y:(L=(b=E==null?void 0:E[0])==null?void 0:b.parsed)==null?void 0:L.x;return`${Fn(v,n)} ${N}`},r=E=>{var y;const{showLabelsInTooltips:P}=(e==null?void 0:e.tooltip)??{};let M=((y=E==null?void 0:E.dataset)==null?void 0:y.label)||"";const N=t(E==null?void 0:E.dataset),{valueLabel:v="",valueAxisLabel:x=""}=N??{},A=(()=>{var f,g;const S=v===be.X?(f=E==null?void 0:E.parsed)==null?void 0:f.x:(g=E==null?void 0:E.parsed)==null?void 0:g.y;return Fn(S,n)})(),b=Ro(x),L=Tt(E,P);return`${M}: ${A} ${b} ${L}`};return{enabled:(C=e==null?void 0:e.tooltip)==null?void 0:C.tooltips,mode:Be.Nearest,intersect:!0,padding:Et,usePointStyle:!0,boxWidth:yn,boxHeight:yn,boxPadding:_t,callbacks:{title:o,label:r,afterLabel:wt}}},Yo=({chartRef:e,state:n,options:t,dispatch:o,generatedDatasets:r})=>{const{interactions:{onAnimationComplete:d},annotations:{labelAnnotation:{showLabel:c,text:p,position:w,fontSize:C,xOffset:E,yOffset:P,maxWidth:M,lineHeight:N}={}},chartStyling:{layoutPadding:v}}=t,{enableDragPoints:x,zoomEnabled:h,panEnabled:A,lineEnabled:b}=n,[L,y]=G.useState(null),{updateAxesRangesFromChart:S,onHover:f,onUpdateEdited:g}=hn({chartRef:e,state:n,options:t,dispatch:o,generatedDatasets:r}),{legend:l,customLegendPlugin:u}=dr({chartRef:e,options:t})??{},{state:i}=gr()??{},{annotation:_}=i??{},T=Uo(t)??{},U=Go(t)??{},k=G.useMemo(()=>Bo(t,n,r),[t,n,r,e]),R=G.useMemo(()=>x&&vr(t),[x,t]),D=G.useMemo(()=>({enabled:A,mode:we.XY,onPanComplete(){S(),g(!0)}}),[A]),z=G.useMemo(()=>({mode:we.XY,drag:{enabled:h,threshold:3,backgroundColor:hr,borderColor:wn,borderWidth:1},onZoomComplete(){S(),g(!0)}}),[h]),q={datalabels:T,annotationDraggerPlugin:{enabled:n==null?void 0:n.enableDragAnnotation},annotation:pr(_),zoom:{pan:D,zoom:z},tooltip:U,legend:{...l,display:!1,events:[]},customLegendPlugin:u,chartAreaBorder:{borderColor:wn},chartAreaText:{showLabel:c,text:p,position:w,fontSize:C,xOffset:E,yOffset:P,maxWidth:M,lineHeight:N},...R};return G.useMemo(()=>{var H,X,Z;return{layout:{padding:v},onHover:f(L,y,r),maintainAspectRatio:(H=t==null?void 0:t.chartStyling)==null?void 0:H.maintainAspectRatio,aspectRatio:(X=t==null?void 0:t.chartStyling)!=null&&X.squareAspectRatio?1:0,animation:(Z=t==null?void 0:t.chartStyling)!=null&&Z.performanceMode?!1:{duration:xt.FAST,onComplete:d},hover:{mode:Be.Nearest,intersect:!0},elements:{line:{pointStyle:At.Circle,showLine:b,tension:0}},scales:k,plugins:q,events:Object.values(Ct)}},[n,t,e,r])},zo=({options:e,resetZoom:n})=>{const{graph:t,legend:o}=e,r=G.useCallback((d,c)=>{const{event:p}=c;return p.type===mr?(n(),!1):!0},[n]);return G.useMemo(()=>[...St(t,o),{id:"customEventCatcher",beforeEvent:r}],[r])},Vo=(e,n)=>{var t,o;G.useEffect(()=>{var r,d;if((d=(r=n==null?void 0:n.legend)==null?void 0:r.customLegend)!=null&&d.customLegendPlugin){const c=document.getElementById(n.legend.customLegend.customLegendContainerID);c!==null&&(c.style.visibility=e.legendEnabled?"visible":"hidden")}},[(o=(t=n==null?void 0:n.legend)==null?void 0:t.customLegend)==null?void 0:o.customLegendPlugin,e.legendEnabled])},Xo=(e,n)=>{G.useEffect(()=>{Zr(e,n)},[e.panEnabled,e.lineEnabled,e.pointsEnabled,e.legendEnabled,e.enableDragPoints,e.zoomEnabled])},Ho=({options:e,state:n,persistenceId:t})=>{const o=G.useMemo(()=>n,[n]),r=G.useMemo(()=>e,[e]);Xo(o,t),Vo(o,r)},Re=" ",qo="rgba(0, 0, 0, 0.5)",Wo=e=>{var n;return(n=Array.isArray(e)?e.join(Re):e)==null?void 0:n.split(Re)},$o=({ctx:e,lines:n,lineHeight:t,x:o,y:r,position:d})=>{n==null||n.forEach((c,p)=>{const w=d!=null&&d.includes("top")?r+t*(p+1)-5:r-(n.length-1-p)*t;e==null||e.fillText(c,o,w)})},Zo=(e,n)=>{const r=n<500?.5:n<700?.7:1;return e*r},Ko=e=>{var r,d,c,p,w,C,E;const{legend:n}=e??{},t=n&&(n!=null&&n.display)&&((r=n==null?void 0:n.options)==null?void 0:r.position)==="left"?(n==null?void 0:n.width)+((c=(d=n==null?void 0:n.options)==null?void 0:d.labels)==null?void 0:c.padding)*2:0,o=n&&n.display&&(((p=n==null?void 0:n.options)==null?void 0:p.position)==="top"||((w=n==null?void 0:n.options)==null?void 0:w.position)==="bottom")?(n==null?void 0:n.height)+((E=(C=n==null?void 0:n.options)==null?void 0:C.labels)==null?void 0:E.padding)*2:0;return{legendWidth:t,legendHeight:o}},Jo=(e,n,t,o)=>{const{chartArea:r,width:d}=n??{},c=d-8,{legendWidth:p,legendHeight:w}=Ko(n)??{};switch(e){case se.TOP_LEFT:return[(r==null?void 0:r.left)+t+p,(r==null?void 0:r.top)+o+w];case se.TOP_CENTER:return[(r==null?void 0:r.left)+(r==null?void 0:r.width)/2,(r==null?void 0:r.top)+o+w];case se.TOP_RIGHT:return[c-t,(r==null?void 0:r.top)+o+w];case se.MIDDLE_LEFT:return[(r==null?void 0:r.left)+t+p,(r==null?void 0:r.top)+(r==null?void 0:r.height)/2];case se.MIDDLE_CENTER:return[(r==null?void 0:r.left)+(r==null?void 0:r.width)/2,(r==null?void 0:r.top)+(r==null?void 0:r.height)/2];case se.MIDDLE_RIGHT:return[c-t-p,(r==null?void 0:r.top)+(r==null?void 0:r.height)/2];case se.BOTTOM_LEFT:return[(r==null?void 0:r.left)+t+p,(r==null?void 0:r.bottom)-o-w];case se.BOTTOM_CENTER:return[(r==null?void 0:r.left)+(r==null?void 0:r.width)/2,(r==null?void 0:r.bottom)-o-w];case se.BOTTOM_RIGHT:default:return[c-t-p,(r==null?void 0:r.bottom)-o-w]}},Qo=e=>e!=null&&e.includes(ie.Center)?ie.Center:e!=null&&e.includes(ie.Left)?ie.Left:ie.Right,es=(e,n,t)=>{let o="",r=[];for(let d=0;d<e.length;d++){const c=`${o}${e==null?void 0:e[d]}${Re}`,{width:p}=(t==null?void 0:t.measureText(c))??{};p>n?(r.push(o==null?void 0:o.trim()),o=`${e==null?void 0:e[d]}${Re}`):o=c}return r.push(o.trim()),r},ns=(e,n)=>{var P,M;if(!e)return;const{text:t,maxWidth:o,fontSize:r,lineHeight:d,x:c,y:p,position:w}=n??{},C=Wo(t),E=es(C,o,e);(P=e==null?void 0:e.save)==null||P.call(e),e.font=`${r}px Arial`,e.fillStyle=qo,e.textAlign=Qo(w),$o({ctx:e,lines:E,lineHeight:d,x:c,y:p,position:w}),(M=e==null?void 0:e.restore)==null||M.call(e)},ts={id:"chartAreaText",beforeDraw:(e,n,t)=>{const{showLabel:o,text:r,fontSize:d,xOffset:c,yOffset:p,lineHeight:w,maxWidth:C,position:E}=t??{};if(!o||!r)return;const{ctx:P,chartArea:M}=e??{};if(!P||!M)return;const N=Zo(C,M.width),[v,x]=Jo(E,e,c,p);ns(P,{text:r,maxWidth:N,fontSize:d,lineHeight:w,x:v,y:x,position:E})}},ut=(e,n,t,o,r)=>{const d=n.getBoundingClientRect(),c=e.clientX-d.left,p=e.clientY-d.top,w=t==null?void 0:t[o],C=t==null?void 0:t[r],E=(w==null?void 0:w.getValueForPixel(c))??-1,P=(C==null?void 0:C.getValueForPixel(p))??-1;return{x:E,y:P}},Ge=e=>{const{xMin:n,xMax:t,yMin:o,yMax:r,xValue:d,yValue:c,type:p}=e??{};let w,C,E,P;return!Y.isNil(n)&&!Y.isNil(t)&&!Y.isNil(o)&&!Y.isNil(r)&&p===le.BOX?(w=(n+t)/2,C=(o+r)/2,E=t-n,P=r-o):!Y.isNil(d)&&!Y.isNil(c)&&p===le.POINT&&(w=d,C=c,E=0,P=0),{centerX:w,centerY:C,width:E,height:P}},at=(e,n,t,o)=>{const{xMin:r,xMax:d,yMin:c,yMax:p,xValue:w,yValue:C,type:E}=e??{};let P,M,N,v;const x=n==null?void 0:n[t],h=n==null?void 0:n[o];if(!x||!h)return{centerX:-1,centerY:-1,width:0,height:0};if(!Y.isNil(r)&&!Y.isNil(d)&&!Y.isNil(c)&&!Y.isNil(p)&&E===le.BOX){const A=(r+d)/2,b=(c+p)/2,L=(x==null?void 0:x.getPixelForValue(r))??0,y=(x==null?void 0:x.getPixelForValue(d))??0,S=(h==null?void 0:h.getPixelForValue(c))??0,f=(h==null?void 0:h.getPixelForValue(p))??0;N=L-y,v=S-f,P=(x==null?void 0:x.getPixelForValue(A))??-1,M=(h==null?void 0:h.getPixelForValue(b))??-1}else!Y.isNil(w)&&!Y.isNil(C)&&E===le.POINT&&(N=0,v=0,P=(x==null?void 0:x.getPixelForValue(w))??-1,M=(h==null?void 0:h.getPixelForValue(C))??-1);return{centerX:P,centerY:M,width:N,height:v}},rs=({x:e,y:n,chartArea:t,scales:o,metrics:r,resizable:d=!1,dragRange:c,annotationType:p,xScaleID:w,yScaleID:C})=>{if(d&&!c)return!0;if(c){const h=e!==void 0&&c.x?e>=c.x[0]&&e<=c.x[1]:!0,A=n!==void 0&&c.y?n>=c.y[0]&&n<=c.y[1]:!0;return h&&A}const E=o==null?void 0:o[w],P=o==null?void 0:o[C];if(!(o!=null&&o[w])||!(o!=null&&o[C]))return!1;const M=(E==null?void 0:E.getValueForPixel(t.left))??Number.NEGATIVE_INFINITY,N=(E==null?void 0:E.getValueForPixel(t.right))??Number.POSITIVE_INFINITY,v=(P==null?void 0:P.getValueForPixel(t.bottom))??Number.NEGATIVE_INFINITY,x=(P==null?void 0:P.getValueForPixel(t.top))??Number.POSITIVE_INFINITY;if(p===le.POINT){const h=e!==void 0?e>=M&&e<=N:!0,A=n!==void 0?n>=v&&n<=x:!0;return h&&A}if(p===le.BOX&&r.width!==void 0&&r.height!==void 0){const h=e!==void 0?e-r.width/2:void 0,A=e!==void 0?e+r.width/2:void 0,b=n!==void 0?n-r.height/2:void 0,L=n!==void 0?n+r.height/2:void 0,y=h!==void 0&&A!==void 0?h>=M&&A<=N:!0,S=b!==void 0&&L!==void 0?b>=v&&L<=x:!0;return y&&S}return!0},kn=(e,n,t,o,r,d,c,p)=>{if(!(o!=null&&o.chartArea))return;const{resizable:w,dragRange:C=null}=t??{};rs({[e]:n,chartArea:o.chartArea,scales:r,resizable:w,dragRange:C,metrics:p||{},annotationType:t.type,xScaleID:d,yScaleID:c})&&(t.type===le.POINT?e==="x"?t.xValue=n:e==="y"&&(t.yValue=n):t.type===le.BOX&&p&&(e==="x"&&p.width&&(t.xMin=n-p.width/2,t.xMax=n+p.width/2),e==="y"&&p.height&&(t.yMin=n-p.height/2,t.yMax=n+p.height/2)))},ft=(e,n,t)=>{var r,d,c;if(!n)return;const o=(c=(d=(r=e==null?void 0:e.options)==null?void 0:r.plugins)==null?void 0:d.annotation)==null?void 0:c.annotations;o&&n&&o[n]&&(o[n].borderWidth=t)},os=(e,n,t,o,r,d)=>{const c=d?o==null?void 0:o[d]:null;if(!c)return;const{xScaleID:p="x",yScaleID:w="y"}=c,{x:C,y:E}=ut(e,n,t,p,w),P=Ge(c);if(c&&c.enableDrag&&!Y.isNil(P.centerY)&&!Y.isNil(P.centerX)){!Y.isNil(n)&&!Y.isNil(n.style)&&(n.style.cursor=fn.Move);const M=C-P.centerX,N=E-P.centerY;r(!0,c,M,N),c!=null&&c.onDragStart&&c.onDragStart({x:C,y:E},c)}},ss=(e,n,t,o,r,d,c,p)=>{var w,C,E,P,M,N;if(o&&r){!Y.isNil(n)&&!Y.isNil(n.style)&&(n.style.cursor=fn.Move);const v=r==null?void 0:r.id;ft(p,v,an.HOVERED);const x=(r==null?void 0:r.dragAxis)??xe.Both,{xScaleID:h="x",yScaleID:A="y"}=r,{x:b,y:L}=ut(e,n,t,h,A),y=Ge(r);let S=b-d,f=L-c;x!==xe.Y&&kn(xe.X,S,r,p,t,h,A,y),x!==xe.X&&kn(xe.Y,f,r,p,t,h,A,y),(w=p==null?void 0:p.update)==null||w.call(p),r!=null&&r.onDrag&&r.onDrag({x:b,y:L},r);const{ctx:g,width:l,height:u}=p,{centerX:i,centerY:_}=Ge(r)??{},{centerX:T,centerY:U}=at(r,t,h,A);if(!Y.isNil(i)&&!Y.isNil(_)&&!Y.isNil(T)&&!Y.isNil(U)&&((C=g==null?void 0:g.save)==null||C.call(g),(E=g==null?void 0:g.clearRect)==null||E.call(g,0,0,l,u),(P=p==null?void 0:p.draw)==null||P.call(p),g.font=Pt,g.fillStyle="black",r!=null&&r.displayDragCoordinates)){let k=T-45,R=U-20;const D=`X: ${Ee(i,2)}, Y: ${Ee(_,2)}`,z=14;R-z<0&&(R=U+z+15),R>u&&(R=u-7),(M=g==null?void 0:g.fillText)==null||M.call(g,D,k,R),(N=g==null?void 0:g.restore)==null||N.call(g)}}},is=(e,n,t,o,r)=>{if(e&&n){const d=n==null?void 0:n.id;ft(t,d,an.ZERO);const{centerX:c=-1,centerY:p=-1}=Ge(n)??{};Y.isNil(n==null?void 0:n.onDragEnd)||n==null||n.onDragEnd({x:c,y:p},n),!Y.isNil(o)&&!Y.isNil(o.style)&&(o.style.cursor=fn.Pointer),r(!1,null)}},ls=(e,n,t)=>{!e||!n||Object.values(n).forEach(o=>{var r,d,c,p;if(o.type===le.POINT&&!Y.isNil(o==null?void 0:o.label)&&((r=o==null?void 0:o.label)!=null&&r.display)){const{content:w,font:C,color:E,position:P,padding:M}=(o==null?void 0:o.label)??{},{xScaleID:N="x",yScaleID:v="y"}=o;(d=e==null?void 0:e.save)==null||d.call(e),e.font=C,e.fillStyle=E;const{centerX:x=-1,centerY:h=-1}=at(o,t,N,v),A=e.measureText(w).width;let b=x-A/2,L=h+20;switch(P){case Ce.Top:L=h-20;break;case Ce.Left:b=x-A-M,L=h;break;case Ce.Right:b=x+M,L=h;break}(c=e==null?void 0:e.fillText)==null||c.call(e,w,b,L),(p=e==null?void 0:e.restore)==null||p.call(e)}})},us={id:"annotationDraggerPlugin",beforeDraw(e){var r,d,c,p,w,C,E,P;const n=e==null?void 0:e.ctx;let t=((d=(r=e.options.plugins)==null?void 0:r.annotation)==null?void 0:d.annotations)??{};if(!t||!n||!t)return;ls(e.ctx,t,e.scales),(((p=(c=e==null?void 0:e.options)==null?void 0:c.plugins)==null?void 0:p.annotationDraggerPlugin)||{enabled:!1}).enabled?((C=(w=e==null?void 0:e.options)==null?void 0:w.plugins)!=null&&C.tooltip&&(e.options.plugins.tooltip.enabled=!1),e.options.hover={mode:void 0,intersect:!1}):((P=(E=e==null?void 0:e.options)==null?void 0:E.plugins)!=null&&P.tooltip&&(e.options.plugins.tooltip.enabled=!0),e.options.hover={mode:Be.Nearest,intersect:!0})},afterUpdate(e){var M,N,v,x,h,A,b,L;const{canvas:n,scales:t,hoveredAnnotationId:o}=e??{},r=((N=(M=e==null?void 0:e.options)==null?void 0:M.plugins)==null?void 0:N.annotationDraggerPlugin)||{enabled:!1};if(!n||!t||!r)return;const d={...t,x:t.x,y:t.y};let c=((x=(v=e.options.plugins)==null?void 0:v.annotation)==null?void 0:x.annotations)??{};if(!e&&!c)return;r.enabled?((A=(h=e==null?void 0:e.options)==null?void 0:h.plugins)!=null&&A.tooltip&&(e.options.plugins.tooltip.enabled=!1),e.options.hover={mode:void 0,intersect:!1}):((L=(b=e==null?void 0:e.options)==null?void 0:b.plugins)!=null&&L.tooltip&&(e.options.plugins.tooltip.enabled=!0),e.options.hover={mode:Be.Nearest,intersect:!0});let p=!1,w,C,E=null;const P=(y,S,f,g)=>{p=y,E=S,f!==void 0&&g!==void 0&&(w=f,C=g)};!n.dataset.annotationDraggerInitialized&&r.enabled&&o&&(n.addEventListener(ye.MOUSEDOWN,y=>{var S,f,g;os(y,n,d,(g=(f=(S=e==null?void 0:e.options)==null?void 0:S.plugins)==null?void 0:f.annotation)==null?void 0:g.annotations,P,e.hoveredAnnotationId)}),n.addEventListener(ye.MOUSEMOVE,y=>{Y.debounce(()=>ss(y,n,d,p,E,w,C,e),5)()}),n.addEventListener(ye.MOUSEUP,y=>{const S=y.currentTarget;is(p,E,e,S,P)}),n.dataset.annotationDraggerInitialized="true"),r.enabled||(n.removeEventListener(ye.MOUSEDOWN,()=>{}),n.removeEventListener(ye.MOUSEMOVE,()=>{}),n.removeEventListener(ye.MOUSEUP,()=>{}),n.dataset.annotationDraggerInitialized="")}};Dt.register(Bt,jt,Ft,kt,Ut,Rt,Gt,Yt,zt,Vt,Xt,Er,ts,us,Pr);const as=e=>{var i,_;Ot();const n=G.useRef(null),{table:t,headerComponent:o,subheaderComponent:r}=e??{},{translations:d,languageKey:c}=Ar(),p=it(e),{data:{datasets:w}={datasets:[]},options:C,testId:E,persistenceId:P,controlsPortalId:M}=p,{annotations:N,axes:v,chartStyling:x,graph:h}=C??{},A=!((_=(i=C==null?void 0:C.legend)==null?void 0:i.customLegend)!=null&&_.customLegendContainerID),[b,L]=G.useReducer(qr,{options:C,persistenceId:P},Kr),y=G.useMemo(()=>So(w,b,C,d),[b.lineEnabled,b.pointsEnabled,w,v,N,h]);Ho({options:C,state:b,persistenceId:P});const{resetZoom:S,handleKeyDown:f,handleKeyUp:g}=hn({chartRef:n,state:b,options:C,dispatch:L,generatedDatasets:y}),l=Yo({chartRef:n,state:b,options:C,dispatch:L,generatedDatasets:y}),u=zo({options:C,resetZoom:S});return F.jsxs("div",{className:Nt(x,qe),style:{width:x.width||Je,height:x.height||Je},tabIndex:0,onKeyDown:f,onKeyUp:g,"data-testid":E,children:[F.jsx(st,{table:t,headerComponent:o,subheaderComponent:r,chartRef:n,state:b,options:C,dispatch:L,generatedDatasets:y,translations:d,controlsPortalId:M}),t&&b.showTable?F.jsx("div",{className:qe.table,children:t}):F.jsx(br,{backend:yr,context:window,children:F.jsxs("div",{className:qe.canvas,id:"canvas",children:[F.jsx(Mt,{ref:n,data:{datasets:y},options:l,plugins:u}),A&&!!y.length&&F.jsx(wr,{chartRef:n,legendConfig:{options:C,generatedDatasets:y,chartType:_r.LINE}})]})})]},go(b,c))},fs=e=>{const{options:n,data:{datasets:t=[]}={}}=it(e);return F.jsx(It,{options:n,datasets:t,children:F.jsx(as,{...e})})};fs.__docgenInfo={description:"",methods:[],displayName:"LineChartWithLegend",props:{chart:{required:!0,tsType:{name:"ILineChartData"},description:""},table:{required:!1,tsType:{name:"ReactNode"},description:""},headerComponent:{required:!1,tsType:{name:"ReactNode"},description:""},subheaderComponent:{required:!1,tsType:{name:"ReactNode"},description:""}}};export{fs as L,bs as i};
|