gf-components 0.1.134 → 0.1.135
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -565,7 +565,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
565
565
|
color: var(--gf-color-text-secondary);
|
|
566
566
|
font-size: 10px;
|
|
567
567
|
line-height: ${zh}px;
|
|
568
|
-
`,c_=(e,t=12)=>{const r=document.createElement("canvas").getContext("2d");return r.font=`${t}px Roboto, sans-serif`,r.measureText(e)},p5e=(e,t,n=12)=>{const r=e.split(" "),i=[];let o=r[0];for(let a=1;a<r.length;a++){const s=`${o} ${r[a]}`;c_(s,n).width>t?(i.push(o),o=r[a]):o=s}return i.push(o),i},b5e=({data:e=[],height:t=600,margin:n={},padding:r=.5,keys:i=null,indexBy:o=null,tooltip:a=null,enableLabel:s=!1,label:l=null,keyLabelWidth:c=120,keyLabelPadding:u=20,axisBottom:d={},layers:f=["grid","axes"],zeroMarker:h=!1,defs:m=[],fill:g=[]})=>{const v=({bar:E})=>{var L;const _=S.useRef(null),[O,T]=S.useState(0),j=((L=E==null?void 0:E.data)==null?void 0:L.indexValue)||"label",H=p5e(j,c,X4);S.useEffect(()=>{if(_.current){const R=_.current.getBoundingClientRect();T(R.height)}},[]);const k=c+u,I=E.y+E.height/2-O/2;return p.jsx("g",{ref:_,transform:`translate(-${k}, ${I})`,children:p.jsx("text",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignmentBaseline:"middle"},children:H.map((R,A)=>p.jsx(_p,{x:0,dy:A>0?zh:X4,children:R},A))})})};let b=null;const y=({bars:E})=>E.map((_,O)=>{var T;if(name=(T=_==null?void 0:_.data)==null?void 0:T.id,!(name!==b&&b!==null))return b=name,p.jsx(v,{bar:_},`bar-label-${O}`)}),x=({bar:E})=>{const O=l==null?void 0:l(E.data),T=c_(O,10),j=T.actualBoundingBoxRight+T.actualBoundingBoxLeft,H=T.actualBoundingBoxAscent+T.actualBoundingBoxDescent;if(j>=E.width)return p.jsx(p.Fragment,{});const k=E.x+E.width/2-j/2,I=E.y+E.height/2+H/2;return p.jsx("g",{transform:`translate(${k}, ${I})`,children:p.jsx("text",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignmentBaseline:"middle"},children:p.jsx(_p,{style:{fontSize:10},children:O||"label"})})})},$=({bars:E})=>E.map((_,O)=>p.jsx(x,{bar:_},`bar-inner-label-${O}`)),w=({data:E,keys:_})=>{m.reduce((T,j)=>(T[j.id]={...j},delete T[j.id].id,T),{}),g.reduce((T,j)=>(j.match&&j.match.id&&(T[j.match.id]=j.id),T),{});const O=_==null?void 0:_.map(T=>{var j;return{name:T,color:(j=E[0])==null?void 0:j[`${T}Color`],defs:m}});return p.jsx(mn,{gap:16,className:"gf-full",justify:"center",wrap:!0,children:O.map((T,j)=>p.jsxs(mn,{gap:8,align:"center",children:[p.jsx("div",{style:{minWidth:16,minHeight:16,backgroundColor:T.color}}),p.jsx(m5e,{children:T.name})]},`legend-${j}`))})},M=E=>{var T;let _=null,O=0;return(T=E==null?void 0:E.bars)==null||T.forEach(j=>{var H,k;((H=j==null?void 0:j.data)==null?void 0:H.id)!==_&&_!==null||(_=(k=j==null?void 0:j.data)==null?void 0:k.id,j.x>O&&(O=j.x))}),p.jsx("g",{children:p.jsx("line",{x1:O,y1:0,x2:O,y2:(E==null?void 0:E.height)-40+5,stroke:"red",strokeWidth:3})})},V=e.slice().reverse();return f.push("bars"),s&&f.push($),h&&f.push(M),p.jsxs(p.Fragment,{children:[p.jsx(yn,{}),p.jsxs(mn,{vertical:!0,gap:8,style:{width:"100%"},children:[p.jsx("div",{style:{height:t},children:p.jsx(H1,{data:V,colors:({id:E,data:_})=>String(_[`${E}Color`]),defs:m,fill:g,keys:i,indexBy:o,margin:{top:-10,right:0,bottom:50,left:140,...n},layout:"horizontal",enableGridY:!1,enableGridX:!1,padding:r,enableLabel:!1,axisBottom:{tickSize:5,legendPosition:"middle",legendOffset:40,...d},axisLeft:null,layers:[...f,y],tooltip:E=>p.jsx(er,{body:(a==null?void 0:a(E))||p.jsx("span",{children:"Tooltip"})})})}),p.jsx(w,{data:e,keys:i})]})]})};function Ta(){return Ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ta.apply(this,arguments)}var y5e={pointerEvents:"none",position:"absolute",zIndex:10,top:0,left:0},Ep=function(e,t){return"translate("+e+"px, "+t+"px)"},u_=S.memo(function(e){var t,n=e.position,r=e.anchor,i=e.children,o=Dn(),a=di(),s=a.animate,l=a.config,c=v_(),u=c[0],d=c[1],f=S.useRef(!1),h=void 0,m=!1,g=d.width>0&&d.height>0,v=Math.round(n[0]),b=Math.round(n[1]);g&&(r==="top"?(v-=d.width/2,b-=d.height+14):r==="right"?(v+=14,b-=d.height/2):r==="bottom"?(v-=d.width/2,b+=14):r==="left"?(v-=d.width+14,b-=d.height/2):r==="center"&&(v-=d.width/2,b-=d.height/2),h={transform:Ep(v,b)},f.current||(m=!0),f.current=[v,b]);var y=Kt({to:h,config:l,immediate:!s||m}),x=Ta({},y5e,o.tooltip.wrapper,{transform:(t=y.transform)!=null?t:Ep(v,b),opacity:y.transform?1:0});return p.jsx(et.div,{ref:u,style:x,children:i})});u_.displayName="TooltipWrapper";var C5e=S.memo(function(e){var t=e.size,n=t===void 0?12:t,r=e.color,i=e.style;return p.jsx("span",{style:Ta({display:"block",width:n,height:n,background:r},i===void 0?{}:i)})}),x5e=S.memo(function(e){var t,n=e.id,r=e.value,i=e.format,o=e.enableChip,a=o!==void 0&&o,s=e.color,l=e.renderContent,c=Dn(),u=p_(i);if(typeof l=="function")t=l();else{var d=r;u!==void 0&&d!==void 0&&(d=u(d)),t=p.jsxs("div",{style:c.tooltip.basic,children:[a&&p.jsx(C5e,{color:s,style:c.tooltip.chip}),d!==void 0?p.jsxs("span",{children:[n,": ",p.jsx("strong",{children:""+d})]}):n]})}return p.jsx("div",{style:c.tooltip.container,children:t})}),w5e={width:"100%",borderCollapse:"collapse"},S5e=S.memo(function(e){var t,n=e.title,r=e.rows,i=r===void 0?[]:r,o=e.renderContent,a=Dn();return i.length?(t=typeof o=="function"?o():p.jsxs("div",{children:[n&&n,p.jsx("table",{style:Ta({},w5e,a.tooltip.table),children:p.jsx("tbody",{children:i.map(function(s,l){return p.jsx("tr",{children:s.map(function(c,u){return p.jsx("td",{style:a.tooltip.tableCell,children:c},u)})},l)})})})]}),p.jsx("div",{style:a.tooltip.container,children:t})):null});S5e.displayName="TableTooltip";var K4=S.memo(function(e){var t=e.x0,n=e.x1,r=e.y0,i=e.y1,o=Dn(),a=di(),s=a.animate,l=a.config,c=S.useMemo(function(){return Ta({},o.crosshair.line,{pointerEvents:"none"})},[o.crosshair.line]),u=Kt({x1:t,x2:n,y1:r,y2:i,config:l,immediate:!s});return p.jsx(et.line,Ta({},u,{fill:"none",style:c}))});K4.displayName="CrosshairLine";var $5e=S.memo(function(e){var t,n,r=e.width,i=e.height,o=e.type,a=e.x,s=e.y;return o==="cross"?(t={x0:a,x1:a,y0:0,y1:i},n={x0:0,x1:r,y0:s,y1:s}):o==="top-left"?(t={x0:a,x1:a,y0:0,y1:s},n={x0:0,x1:a,y0:s,y1:s}):o==="top"?t={x0:a,x1:a,y0:0,y1:s}:o==="top-right"?(t={x0:a,x1:a,y0:0,y1:s},n={x0:a,x1:r,y0:s,y1:s}):o==="right"?n={x0:a,x1:r,y0:s,y1:s}:o==="bottom-right"?(t={x0:a,x1:a,y0:s,y1:i},n={x0:a,x1:r,y0:s,y1:s}):o==="bottom"?t={x0:a,x1:a,y0:s,y1:i}:o==="bottom-left"?(t={x0:a,x1:a,y0:s,y1:i},n={x0:0,x1:a,y0:s,y1:s}):o==="left"?n={x0:0,x1:a,y0:s,y1:s}:o==="x"?t={x0:a,x1:a,y0:0,y1:i}:o==="y"&&(n={x0:0,x1:r,y0:s,y1:s}),p.jsxs(p.Fragment,{children:[t&&p.jsx(K4,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}),n&&p.jsx(K4,{x0:n.x0,x1:n.x1,y0:n.y0,y1:n.y1})]})});$5e.displayName="Crosshair";var d_=S.createContext({showTooltipAt:function(){},showTooltipFromEvent:function(){},hideTooltip:function(){}}),Q4={isVisible:!1,position:[null,null],content:null,anchor:null},f_=S.createContext(Q4),M5e=function(e){var t=S.useState(Q4),n=t[0],r=t[1],i=S.useCallback(function(s,l,c){var u=l[0],d=l[1];c===void 0&&(c="top"),r({isVisible:!0,position:[u,d],anchor:c,content:s})},[r]),o=S.useCallback(function(s,l,c){c===void 0&&(c="top");var u=e.current.getBoundingClientRect(),d=e.current.offsetWidth,f=d===u.width?1:d/u.width,h="touches"in l?l.touches[0]:l,m=h.clientX,g=h.clientY,v=(m-u.left)*f,b=(g-u.top)*f;c!=="left"&&c!=="right"||(c=v<u.width/2?"right":"left"),r({isVisible:!0,position:[v,b],anchor:c,content:s})},[e,r]),a=S.useCallback(function(){r(Q4)},[r]);return{actions:S.useMemo(function(){return{showTooltipAt:i,showTooltipFromEvent:o,hideTooltip:a}},[i,o,a]),state:n}},_5e=function(){var e=S.useContext(d_);if(e===void 0)throw new Error("useTooltip must be used within a TooltipProvider");return e},E5e=function(){var e=S.useContext(f_);if(e===void 0)throw new Error("useTooltipState must be used within a TooltipProvider");return e},O5e=function(e){return e.isVisible},H5e=function(){var e=E5e();return O5e(e)?p.jsx(u_,{position:e.position,anchor:e.anchor,children:e.content}):null},V5e=function(e){var t=e.container,n=e.children,r=M5e(t),i=r.actions,o=r.state;return p.jsx(d_.Provider,{value:i,children:p.jsx(f_.Provider,{value:o,children:n})})},T5e={background:"transparent",text:{fontFamily:"sans-serif",fontSize:11,fill:"#333333",outlineWidth:0,outlineColor:"transparent",outlineOpacity:1},axis:{domain:{line:{stroke:"transparent",strokeWidth:1}},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{}},legend:{text:{fontSize:12}}},grid:{line:{stroke:"#dddddd",strokeWidth:1}},legends:{hidden:{symbol:{fill:"#333333",opacity:.6},text:{fill:"#333333",opacity:.6}},text:{},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{fontSize:10}},title:{text:{}}},labels:{text:{}},markers:{lineColor:"#000000",lineStrokeWidth:1,text:{}},dots:{text:{}},tooltip:{container:{background:"white",color:"inherit",fontSize:"inherit",borderRadius:"2px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.25)",padding:"5px 9px"},basic:{whiteSpace:"pre",display:"flex",alignItems:"center"},chip:{marginRight:7},table:{},tableCell:{padding:"3px 5px"},tableCellValue:{fontWeight:"bold"}},crosshair:{line:{stroke:"#000000",strokeWidth:1,strokeOpacity:.75,strokeDasharray:"6 6"}},annotations:{text:{fontSize:13,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},link:{stroke:"#000000",strokeWidth:1,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},outline:{fill:"none",stroke:"#000000",strokeWidth:2,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},symbol:{fill:"#000000",outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1}}};function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ao.apply(this,arguments)}function Bh(e,t){if(e==null)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var R5e=["axis.ticks.text","axis.legend.text","legends.title.text","legends.text","legends.ticks.text","legends.title.text","labels.text","dots.text","markers.text","annotations.text"],k5e=function(e,t){return Ao({},t,e)},L5e=function(e,t){var n=P6({},e,t);return R5e.forEach(function(r){ni(n,r,k5e(bn(n,r),n.text))}),n},h_=S.createContext(),g_=function(e){var t=e.children,n=e.animate,r=n===void 0||n,i=e.config,o=i===void 0?"default":i,a=S.useMemo(function(){var s=xf(o)?Aa[o]:o;return{animate:r,config:s}},[r,o]);return p.jsx(h_.Provider,{value:a,children:t})},$d={animate:D.bool,motionConfig:D.oneOfType([D.oneOf(Object.keys(Aa)),D.shape({mass:D.number,tension:D.number,friction:D.number,clamp:D.bool,precision:D.number,velocity:D.number,duration:D.number,easing:D.func})])};g_.propTypes={children:D.node.isRequired,animate:$d.animate,config:$d.motionConfig};var di=function(){return S.useContext(h_)},j5e=function(e){var t=di(),n=t.animate,r=t.config,i=function(s){var l=S.useRef();return S.useEffect(function(){l.current=s},[s]),l.current}(e),o=S.useMemo(function(){return Cf(i,e)},[i,e]),a=Kt({from:{value:0},to:{value:1},reset:!0,config:r,immediate:!n}).value;return Vn(a,o)},P5e={nivo:["#d76445","#f47560","#e8c1a0","#97e3d5","#61cdbb","#00b0a7"],BrBG:ue(_i),PRGn:ue(Ei),PiYG:ue(Oi),PuOr:ue(Hi),RdBu:ue(Vi),RdGy:ue(Ti),RdYlBu:ue(Ri),RdYlGn:ue(ki),spectral:ue(Li),blues:ue(qi),greens:ue(Gi),greys:ue(Yi),oranges:ue(Qi),purples:ue(Xi),reds:ue(Ki),BuGn:ue(ji),BuPu:ue(Pi),GnBu:ue(Ii),OrRd:ue(Ai),PuBuGn:ue(Ni),PuBu:ue(Fi),PuRd:ue(Di),RdPu:ue(zi),YlGnBu:ue(Bi),YlGn:ue(Wi),YlOrBr:ue(Zi),YlOrRd:ue(Ui)},I5e=Object.keys(P5e);ue(_i),ue(Ei),ue(Oi),ue(Hi),ue(Vi),ue(Ti),ue(Ri),ue(ki),ue(Li),ue(qi),ue(Gi),ue(Yi),ue(Qi),ue(Xi),ue(Ki),ue(ji),ue(Pi),ue(Ii),ue(Ai),ue(Ni),ue(Fi),ue(Di),ue(zi),ue(Bi),ue(Wi),ue(Zi),ue(Ui);D.oneOfType([D.oneOf(I5e),D.func,D.arrayOf(D.string)]);var A5e={basis:W7,basisClosed:Z7,basisOpen:U7,bundle:q7,cardinal:Y7,cardinalClosed:K7,cardinalOpen:J7,catmullRom:th,catmullRomClosed:nh,catmullRomOpen:rh,linear:x1,linearClosed:ih,monotoneX:w1,monotoneY:Hf,natural:oh,step:ah,stepAfter:lh,stepBefore:sh},Wh=Object.keys(A5e);Wh.filter(function(e){return e.endsWith("Closed")});xl(Wh,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");xl(Wh,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");D.shape({top:D.number,right:D.number,bottom:D.number,left:D.number}).isRequired;var N5e=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"];D.oneOf(N5e);Mr(bo);var F5e={top:0,right:0,bottom:0,left:0},D5e=function(e,t,n){return n===void 0&&(n={}),S.useMemo(function(){var r=Ao({},F5e,n);return{margin:r,innerWidth:e-r.left-r.right,innerHeight:t-r.top-r.bottom,outerWidth:e,outerHeight:t}},[e,t,n.top,n.right,n.bottom,n.left])},v_=function(){var e=S.useRef(null),t=S.useState({left:0,top:0,width:0,height:0}),n=t[0],r=t[1],i=S.useState(function(){return typeof ResizeObserver>"u"?null:new ResizeObserver(function(o){var a=o[0];return r(a.contentRect)})})[0];return S.useEffect(function(){return e.current&&i!==null&&i.observe(e.current),function(){i!==null&&i.disconnect()}},[]),[e,n]},z5e=function(e){return S.useMemo(function(){return L5e(T5e,e)},[e])},m_=function(e){return typeof e=="function"?e:typeof e=="string"?e.indexOf("time:")===0?Wa(e.slice("5")):Da(e):function(t){return""+t}},p_=function(e){return S.useMemo(function(){return m_(e)},[e])},b_=S.createContext(),B5e={},y_=function(e){var t=e.theme,n=t===void 0?B5e:t,r=e.children,i=z5e(n);return p.jsx(b_.Provider,{value:i,children:r})};y_.propTypes={children:D.node.isRequired,theme:D.object};var Dn=function(){return S.useContext(b_)},W5e=["outlineWidth","outlineColor","outlineOpacity"],C_=function(e){return e.outlineWidth,e.outlineColor,e.outlineOpacity,Bh(e,W5e)},x_=function(e){var t=e.children,n=e.condition,r=e.wrapper;return n?S.cloneElement(r,{},t):t};x_.propTypes={children:D.node.isRequired,condition:D.bool.isRequired,wrapper:D.element.isRequired};var Z5e={position:"relative"},w_=function(e){var t=e.children,n=e.theme,r=e.renderWrapper,i=r===void 0||r,o=e.isInteractive,a=o===void 0||o,s=e.animate,l=e.motionConfig,c=S.useRef(null);return p.jsx(y_,{theme:n,children:p.jsx(g_,{animate:s,config:l,children:p.jsx(V5e,{container:c,children:p.jsxs(x_,{condition:i,wrapper:p.jsx("div",{style:Z5e,ref:c}),children:[t,a&&p.jsx(H5e,{})]})})})})};w_.propTypes={children:D.element.isRequired,isInteractive:D.bool,renderWrapper:D.bool,theme:D.object,animate:D.bool,motionConfig:D.oneOfType([D.string,$d.motionConfig])};D.func.isRequired,D.bool,D.bool,D.object.isRequired,D.bool.isRequired,D.oneOfType([D.string,$d.motionConfig]);var S_=function(e){var t=e.children,n=v_(),r=n[0],i=n[1],o=i.width>0&&i.height>0;return p.jsx("div",{ref:r,style:{width:"100%",height:"100%"},children:o&&t({width:i.width,height:i.height})})};S_.propTypes={children:D.func.isRequired};var U5e=["id","colors"],$_=function(e){var t=e.id,n=e.colors,r=Bh(e,U5e);return p.jsx("linearGradient",Ao({id:t,x1:0,x2:0,y1:0,y2:1},r,{children:n.map(function(i){var o=i.offset,a=i.color,s=i.opacity;return p.jsx("stop",{offset:o+"%",stopColor:a,stopOpacity:s!==void 0?s:1},o)})}))};$_.propTypes={id:D.string.isRequired,colors:D.arrayOf(D.shape({offset:D.number.isRequired,color:D.string.isRequired,opacity:D.number})).isRequired,gradientTransform:D.string};var q5e={linearGradient:$_},ec={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},J4=S.memo(function(e){var t=e.id,n=e.background,r=n===void 0?ec.background:n,i=e.color,o=i===void 0?ec.color:i,a=e.size,s=a===void 0?ec.size:a,l=e.padding,c=l===void 0?ec.padding:l,u=e.stagger,d=u===void 0?ec.stagger:u,f=s+c,h=s/2,m=c/2;return d===!0&&(f=2*s+2*c),p.jsxs("pattern",{id:t,width:f,height:f,patternUnits:"userSpaceOnUse",children:[p.jsx("rect",{width:f,height:f,fill:r}),p.jsx("circle",{cx:m+h,cy:m+h,r:h,fill:o}),d&&p.jsx("circle",{cx:1.5*c+s+h,cy:1.5*c+s+h,r:h,fill:o})]})});J4.displayName="PatternDots",J4.propTypes={id:D.string.isRequired,color:D.string.isRequired,background:D.string.isRequired,size:D.number.isRequired,padding:D.number.isRequired,stagger:D.bool.isRequired};var e5=function(e){return e*Math.PI/180},G5e=function(e){return 180*e/Math.PI},Y5e=function(e,t){return{x:Math.cos(e)*t,y:Math.sin(e)*t}},X5e=function(e){var t=e%360;return t<0&&(t+=360),t},K5e={svg:{align:{left:"start",center:"middle",right:"end",start:"start",middle:"middle",end:"end"},baseline:{top:"text-before-edge",center:"central",bottom:"alphabetic"}},canvas:{align:{left:"left",center:"center",right:"right",start:"left",middle:"center",end:"right"},baseline:{top:"top",center:"middle",bottom:"bottom"}}},tc={spacing:5,rotation:0,background:"#000000",color:"#ffffff",lineWidth:2},t5=S.memo(function(e){var t=e.id,n=e.spacing,r=n===void 0?tc.spacing:n,i=e.rotation,o=i===void 0?tc.rotation:i,a=e.background,s=a===void 0?tc.background:a,l=e.color,c=l===void 0?tc.color:l,u=e.lineWidth,d=u===void 0?tc.lineWidth:u,f=Math.round(o)%360,h=Math.abs(r);f>180?f-=360:f>90?f-=180:f<-180?f+=360:f<-90&&(f+=180);var m,g=h,v=h;return f===0?m=`
|
|
568
|
+
`,c_=(e,t=12)=>{const r=document.createElement("canvas").getContext("2d");return r.font=`${t}px Roboto, sans-serif`,r.measureText(e)},p5e=(e,t,n=12)=>{const r=e.split(" "),i=[];let o=r[0];for(let a=1;a<r.length;a++){const s=`${o} ${r[a]}`;c_(s,n).width>t?(i.push(o),o=r[a]):o=s}return i.push(o),i},b5e=({data:e=[],height:t=600,margin:n={},padding:r=.5,keys:i=null,indexBy:o=null,tooltip:a=null,enableLabel:s=!1,label:l=null,keyLabelWidth:c=120,keyLabelPadding:u=20,axisBottom:d={},layers:f=["grid","axes"],zeroMarker:h=!1,defs:m=[],fill:g=[]})=>{const v=({bar:E})=>{var L;const _=S.useRef(null),[O,T]=S.useState(0),j=((L=E==null?void 0:E.data)==null?void 0:L.indexValue)||"label",H=p5e(j,c,X4);S.useEffect(()=>{if(_.current){const R=_.current.getBoundingClientRect();T(R.height)}},[]);const k=c+u,I=E.y+E.height/2-O/2;return p.jsx("g",{ref:_,transform:`translate(-${k}, ${I})`,children:p.jsx("text",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignmentBaseline:"middle"},children:H.map((R,A)=>p.jsx(_p,{x:0,dy:A>0?zh:X4,children:R},A))})})};let b=null;const y=({bars:E})=>E.map((_,O)=>{var T;if(name=(T=_==null?void 0:_.data)==null?void 0:T.id,!(name!==b&&b!==null))return b=name,p.jsx(v,{bar:_},`bar-label-${O}`)}),x=({bar:E})=>{const O=l==null?void 0:l(E.data),T=c_(O,10),j=T.actualBoundingBoxRight+T.actualBoundingBoxLeft,H=T.actualBoundingBoxAscent+T.actualBoundingBoxDescent;if(j>=E.width)return p.jsx(p.Fragment,{});const k=E.x+E.width/2-j/2,I=E.y+E.height/2+H/2;return p.jsx("g",{transform:`translate(${k}, ${I})`,children:p.jsx("text",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignmentBaseline:"middle"},children:p.jsx(_p,{style:{fontSize:10},children:O||"label"})})})},$=({bars:E})=>E.map((_,O)=>p.jsx(x,{bar:_},`bar-inner-label-${O}`)),w=({data:E,keys:_})=>{m.reduce((T,j)=>(T[j.id]={...j},delete T[j.id].id,T),{}),g.reduce((T,j)=>(j.match&&j.match.id&&(T[j.match.id]=j.id),T),{});const O=_==null?void 0:_.map(T=>{var j;return{name:T,color:(j=E[0])==null?void 0:j[`${T}Color`],defs:m}});return p.jsx(mn,{gap:16,className:"gf-full",justify:"center",wrap:!0,children:O.map((T,j)=>p.jsxs(mn,{gap:8,align:"center",children:[p.jsx("div",{style:{minWidth:16,minHeight:16,backgroundColor:T.color}}),p.jsx(m5e,{children:T.name})]},`legend-${j}`))})},M=E=>{var T;let _=null,O=0;return(T=E==null?void 0:E.bars)==null||T.forEach(j=>{var H,k;((H=j==null?void 0:j.data)==null?void 0:H.id)!==_&&_!==null||(_=(k=j==null?void 0:j.data)==null?void 0:k.id,j.x>O&&(O=j.x))}),p.jsx("g",{children:p.jsx("line",{x1:O,y1:0,x2:O,y2:(E==null?void 0:E.height)-40+5,stroke:"black",strokeWidth:3})})},V=e.slice().reverse();return f.push("bars"),s&&f.push($),h&&f.push(M),p.jsxs(p.Fragment,{children:[p.jsx(yn,{}),p.jsxs(mn,{vertical:!0,gap:8,style:{width:"100%"},children:[p.jsx("div",{style:{height:t},children:p.jsx(H1,{data:V,colors:({id:E,data:_})=>String(_[`${E}Color`]),defs:m,fill:g,keys:i,indexBy:o,margin:{top:-10,right:0,bottom:50,left:140,...n},layout:"horizontal",enableGridY:!1,enableGridX:!1,padding:r,enableLabel:!1,axisBottom:{tickSize:5,legendPosition:"middle",legendOffset:40,...d},axisLeft:null,layers:[...f,y],tooltip:E=>p.jsx(er,{body:(a==null?void 0:a(E))||p.jsx("span",{children:"Tooltip"})})})}),p.jsx(w,{data:e,keys:i})]})]})};function Ta(){return Ta=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ta.apply(this,arguments)}var y5e={pointerEvents:"none",position:"absolute",zIndex:10,top:0,left:0},Ep=function(e,t){return"translate("+e+"px, "+t+"px)"},u_=S.memo(function(e){var t,n=e.position,r=e.anchor,i=e.children,o=Dn(),a=di(),s=a.animate,l=a.config,c=v_(),u=c[0],d=c[1],f=S.useRef(!1),h=void 0,m=!1,g=d.width>0&&d.height>0,v=Math.round(n[0]),b=Math.round(n[1]);g&&(r==="top"?(v-=d.width/2,b-=d.height+14):r==="right"?(v+=14,b-=d.height/2):r==="bottom"?(v-=d.width/2,b+=14):r==="left"?(v-=d.width+14,b-=d.height/2):r==="center"&&(v-=d.width/2,b-=d.height/2),h={transform:Ep(v,b)},f.current||(m=!0),f.current=[v,b]);var y=Kt({to:h,config:l,immediate:!s||m}),x=Ta({},y5e,o.tooltip.wrapper,{transform:(t=y.transform)!=null?t:Ep(v,b),opacity:y.transform?1:0});return p.jsx(et.div,{ref:u,style:x,children:i})});u_.displayName="TooltipWrapper";var C5e=S.memo(function(e){var t=e.size,n=t===void 0?12:t,r=e.color,i=e.style;return p.jsx("span",{style:Ta({display:"block",width:n,height:n,background:r},i===void 0?{}:i)})}),x5e=S.memo(function(e){var t,n=e.id,r=e.value,i=e.format,o=e.enableChip,a=o!==void 0&&o,s=e.color,l=e.renderContent,c=Dn(),u=p_(i);if(typeof l=="function")t=l();else{var d=r;u!==void 0&&d!==void 0&&(d=u(d)),t=p.jsxs("div",{style:c.tooltip.basic,children:[a&&p.jsx(C5e,{color:s,style:c.tooltip.chip}),d!==void 0?p.jsxs("span",{children:[n,": ",p.jsx("strong",{children:""+d})]}):n]})}return p.jsx("div",{style:c.tooltip.container,children:t})}),w5e={width:"100%",borderCollapse:"collapse"},S5e=S.memo(function(e){var t,n=e.title,r=e.rows,i=r===void 0?[]:r,o=e.renderContent,a=Dn();return i.length?(t=typeof o=="function"?o():p.jsxs("div",{children:[n&&n,p.jsx("table",{style:Ta({},w5e,a.tooltip.table),children:p.jsx("tbody",{children:i.map(function(s,l){return p.jsx("tr",{children:s.map(function(c,u){return p.jsx("td",{style:a.tooltip.tableCell,children:c},u)})},l)})})})]}),p.jsx("div",{style:a.tooltip.container,children:t})):null});S5e.displayName="TableTooltip";var K4=S.memo(function(e){var t=e.x0,n=e.x1,r=e.y0,i=e.y1,o=Dn(),a=di(),s=a.animate,l=a.config,c=S.useMemo(function(){return Ta({},o.crosshair.line,{pointerEvents:"none"})},[o.crosshair.line]),u=Kt({x1:t,x2:n,y1:r,y2:i,config:l,immediate:!s});return p.jsx(et.line,Ta({},u,{fill:"none",style:c}))});K4.displayName="CrosshairLine";var $5e=S.memo(function(e){var t,n,r=e.width,i=e.height,o=e.type,a=e.x,s=e.y;return o==="cross"?(t={x0:a,x1:a,y0:0,y1:i},n={x0:0,x1:r,y0:s,y1:s}):o==="top-left"?(t={x0:a,x1:a,y0:0,y1:s},n={x0:0,x1:a,y0:s,y1:s}):o==="top"?t={x0:a,x1:a,y0:0,y1:s}:o==="top-right"?(t={x0:a,x1:a,y0:0,y1:s},n={x0:a,x1:r,y0:s,y1:s}):o==="right"?n={x0:a,x1:r,y0:s,y1:s}:o==="bottom-right"?(t={x0:a,x1:a,y0:s,y1:i},n={x0:a,x1:r,y0:s,y1:s}):o==="bottom"?t={x0:a,x1:a,y0:s,y1:i}:o==="bottom-left"?(t={x0:a,x1:a,y0:s,y1:i},n={x0:0,x1:a,y0:s,y1:s}):o==="left"?n={x0:0,x1:a,y0:s,y1:s}:o==="x"?t={x0:a,x1:a,y0:0,y1:i}:o==="y"&&(n={x0:0,x1:r,y0:s,y1:s}),p.jsxs(p.Fragment,{children:[t&&p.jsx(K4,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}),n&&p.jsx(K4,{x0:n.x0,x1:n.x1,y0:n.y0,y1:n.y1})]})});$5e.displayName="Crosshair";var d_=S.createContext({showTooltipAt:function(){},showTooltipFromEvent:function(){},hideTooltip:function(){}}),Q4={isVisible:!1,position:[null,null],content:null,anchor:null},f_=S.createContext(Q4),M5e=function(e){var t=S.useState(Q4),n=t[0],r=t[1],i=S.useCallback(function(s,l,c){var u=l[0],d=l[1];c===void 0&&(c="top"),r({isVisible:!0,position:[u,d],anchor:c,content:s})},[r]),o=S.useCallback(function(s,l,c){c===void 0&&(c="top");var u=e.current.getBoundingClientRect(),d=e.current.offsetWidth,f=d===u.width?1:d/u.width,h="touches"in l?l.touches[0]:l,m=h.clientX,g=h.clientY,v=(m-u.left)*f,b=(g-u.top)*f;c!=="left"&&c!=="right"||(c=v<u.width/2?"right":"left"),r({isVisible:!0,position:[v,b],anchor:c,content:s})},[e,r]),a=S.useCallback(function(){r(Q4)},[r]);return{actions:S.useMemo(function(){return{showTooltipAt:i,showTooltipFromEvent:o,hideTooltip:a}},[i,o,a]),state:n}},_5e=function(){var e=S.useContext(d_);if(e===void 0)throw new Error("useTooltip must be used within a TooltipProvider");return e},E5e=function(){var e=S.useContext(f_);if(e===void 0)throw new Error("useTooltipState must be used within a TooltipProvider");return e},O5e=function(e){return e.isVisible},H5e=function(){var e=E5e();return O5e(e)?p.jsx(u_,{position:e.position,anchor:e.anchor,children:e.content}):null},V5e=function(e){var t=e.container,n=e.children,r=M5e(t),i=r.actions,o=r.state;return p.jsx(d_.Provider,{value:i,children:p.jsx(f_.Provider,{value:o,children:n})})},T5e={background:"transparent",text:{fontFamily:"sans-serif",fontSize:11,fill:"#333333",outlineWidth:0,outlineColor:"transparent",outlineOpacity:1},axis:{domain:{line:{stroke:"transparent",strokeWidth:1}},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{}},legend:{text:{fontSize:12}}},grid:{line:{stroke:"#dddddd",strokeWidth:1}},legends:{hidden:{symbol:{fill:"#333333",opacity:.6},text:{fill:"#333333",opacity:.6}},text:{},ticks:{line:{stroke:"#777777",strokeWidth:1},text:{fontSize:10}},title:{text:{}}},labels:{text:{}},markers:{lineColor:"#000000",lineStrokeWidth:1,text:{}},dots:{text:{}},tooltip:{container:{background:"white",color:"inherit",fontSize:"inherit",borderRadius:"2px",boxShadow:"0 1px 2px rgba(0, 0, 0, 0.25)",padding:"5px 9px"},basic:{whiteSpace:"pre",display:"flex",alignItems:"center"},chip:{marginRight:7},table:{},tableCell:{padding:"3px 5px"},tableCellValue:{fontWeight:"bold"}},crosshair:{line:{stroke:"#000000",strokeWidth:1,strokeOpacity:.75,strokeDasharray:"6 6"}},annotations:{text:{fontSize:13,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},link:{stroke:"#000000",strokeWidth:1,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},outline:{fill:"none",stroke:"#000000",strokeWidth:2,outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1},symbol:{fill:"#000000",outlineWidth:2,outlineColor:"#ffffff",outlineOpacity:1}}};function Ao(){return Ao=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ao.apply(this,arguments)}function Bh(e,t){if(e==null)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var R5e=["axis.ticks.text","axis.legend.text","legends.title.text","legends.text","legends.ticks.text","legends.title.text","labels.text","dots.text","markers.text","annotations.text"],k5e=function(e,t){return Ao({},t,e)},L5e=function(e,t){var n=P6({},e,t);return R5e.forEach(function(r){ni(n,r,k5e(bn(n,r),n.text))}),n},h_=S.createContext(),g_=function(e){var t=e.children,n=e.animate,r=n===void 0||n,i=e.config,o=i===void 0?"default":i,a=S.useMemo(function(){var s=xf(o)?Aa[o]:o;return{animate:r,config:s}},[r,o]);return p.jsx(h_.Provider,{value:a,children:t})},$d={animate:D.bool,motionConfig:D.oneOfType([D.oneOf(Object.keys(Aa)),D.shape({mass:D.number,tension:D.number,friction:D.number,clamp:D.bool,precision:D.number,velocity:D.number,duration:D.number,easing:D.func})])};g_.propTypes={children:D.node.isRequired,animate:$d.animate,config:$d.motionConfig};var di=function(){return S.useContext(h_)},j5e=function(e){var t=di(),n=t.animate,r=t.config,i=function(s){var l=S.useRef();return S.useEffect(function(){l.current=s},[s]),l.current}(e),o=S.useMemo(function(){return Cf(i,e)},[i,e]),a=Kt({from:{value:0},to:{value:1},reset:!0,config:r,immediate:!n}).value;return Vn(a,o)},P5e={nivo:["#d76445","#f47560","#e8c1a0","#97e3d5","#61cdbb","#00b0a7"],BrBG:ue(_i),PRGn:ue(Ei),PiYG:ue(Oi),PuOr:ue(Hi),RdBu:ue(Vi),RdGy:ue(Ti),RdYlBu:ue(Ri),RdYlGn:ue(ki),spectral:ue(Li),blues:ue(qi),greens:ue(Gi),greys:ue(Yi),oranges:ue(Qi),purples:ue(Xi),reds:ue(Ki),BuGn:ue(ji),BuPu:ue(Pi),GnBu:ue(Ii),OrRd:ue(Ai),PuBuGn:ue(Ni),PuBu:ue(Fi),PuRd:ue(Di),RdPu:ue(zi),YlGnBu:ue(Bi),YlGn:ue(Wi),YlOrBr:ue(Zi),YlOrRd:ue(Ui)},I5e=Object.keys(P5e);ue(_i),ue(Ei),ue(Oi),ue(Hi),ue(Vi),ue(Ti),ue(Ri),ue(ki),ue(Li),ue(qi),ue(Gi),ue(Yi),ue(Qi),ue(Xi),ue(Ki),ue(ji),ue(Pi),ue(Ii),ue(Ai),ue(Ni),ue(Fi),ue(Di),ue(zi),ue(Bi),ue(Wi),ue(Zi),ue(Ui);D.oneOfType([D.oneOf(I5e),D.func,D.arrayOf(D.string)]);var A5e={basis:W7,basisClosed:Z7,basisOpen:U7,bundle:q7,cardinal:Y7,cardinalClosed:K7,cardinalOpen:J7,catmullRom:th,catmullRomClosed:nh,catmullRomOpen:rh,linear:x1,linearClosed:ih,monotoneX:w1,monotoneY:Hf,natural:oh,step:ah,stepAfter:lh,stepBefore:sh},Wh=Object.keys(A5e);Wh.filter(function(e){return e.endsWith("Closed")});xl(Wh,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");xl(Wh,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");D.shape({top:D.number,right:D.number,bottom:D.number,left:D.number}).isRequired;var N5e=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"];D.oneOf(N5e);Mr(bo);var F5e={top:0,right:0,bottom:0,left:0},D5e=function(e,t,n){return n===void 0&&(n={}),S.useMemo(function(){var r=Ao({},F5e,n);return{margin:r,innerWidth:e-r.left-r.right,innerHeight:t-r.top-r.bottom,outerWidth:e,outerHeight:t}},[e,t,n.top,n.right,n.bottom,n.left])},v_=function(){var e=S.useRef(null),t=S.useState({left:0,top:0,width:0,height:0}),n=t[0],r=t[1],i=S.useState(function(){return typeof ResizeObserver>"u"?null:new ResizeObserver(function(o){var a=o[0];return r(a.contentRect)})})[0];return S.useEffect(function(){return e.current&&i!==null&&i.observe(e.current),function(){i!==null&&i.disconnect()}},[]),[e,n]},z5e=function(e){return S.useMemo(function(){return L5e(T5e,e)},[e])},m_=function(e){return typeof e=="function"?e:typeof e=="string"?e.indexOf("time:")===0?Wa(e.slice("5")):Da(e):function(t){return""+t}},p_=function(e){return S.useMemo(function(){return m_(e)},[e])},b_=S.createContext(),B5e={},y_=function(e){var t=e.theme,n=t===void 0?B5e:t,r=e.children,i=z5e(n);return p.jsx(b_.Provider,{value:i,children:r})};y_.propTypes={children:D.node.isRequired,theme:D.object};var Dn=function(){return S.useContext(b_)},W5e=["outlineWidth","outlineColor","outlineOpacity"],C_=function(e){return e.outlineWidth,e.outlineColor,e.outlineOpacity,Bh(e,W5e)},x_=function(e){var t=e.children,n=e.condition,r=e.wrapper;return n?S.cloneElement(r,{},t):t};x_.propTypes={children:D.node.isRequired,condition:D.bool.isRequired,wrapper:D.element.isRequired};var Z5e={position:"relative"},w_=function(e){var t=e.children,n=e.theme,r=e.renderWrapper,i=r===void 0||r,o=e.isInteractive,a=o===void 0||o,s=e.animate,l=e.motionConfig,c=S.useRef(null);return p.jsx(y_,{theme:n,children:p.jsx(g_,{animate:s,config:l,children:p.jsx(V5e,{container:c,children:p.jsxs(x_,{condition:i,wrapper:p.jsx("div",{style:Z5e,ref:c}),children:[t,a&&p.jsx(H5e,{})]})})})})};w_.propTypes={children:D.element.isRequired,isInteractive:D.bool,renderWrapper:D.bool,theme:D.object,animate:D.bool,motionConfig:D.oneOfType([D.string,$d.motionConfig])};D.func.isRequired,D.bool,D.bool,D.object.isRequired,D.bool.isRequired,D.oneOfType([D.string,$d.motionConfig]);var S_=function(e){var t=e.children,n=v_(),r=n[0],i=n[1],o=i.width>0&&i.height>0;return p.jsx("div",{ref:r,style:{width:"100%",height:"100%"},children:o&&t({width:i.width,height:i.height})})};S_.propTypes={children:D.func.isRequired};var U5e=["id","colors"],$_=function(e){var t=e.id,n=e.colors,r=Bh(e,U5e);return p.jsx("linearGradient",Ao({id:t,x1:0,x2:0,y1:0,y2:1},r,{children:n.map(function(i){var o=i.offset,a=i.color,s=i.opacity;return p.jsx("stop",{offset:o+"%",stopColor:a,stopOpacity:s!==void 0?s:1},o)})}))};$_.propTypes={id:D.string.isRequired,colors:D.arrayOf(D.shape({offset:D.number.isRequired,color:D.string.isRequired,opacity:D.number})).isRequired,gradientTransform:D.string};var q5e={linearGradient:$_},ec={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},J4=S.memo(function(e){var t=e.id,n=e.background,r=n===void 0?ec.background:n,i=e.color,o=i===void 0?ec.color:i,a=e.size,s=a===void 0?ec.size:a,l=e.padding,c=l===void 0?ec.padding:l,u=e.stagger,d=u===void 0?ec.stagger:u,f=s+c,h=s/2,m=c/2;return d===!0&&(f=2*s+2*c),p.jsxs("pattern",{id:t,width:f,height:f,patternUnits:"userSpaceOnUse",children:[p.jsx("rect",{width:f,height:f,fill:r}),p.jsx("circle",{cx:m+h,cy:m+h,r:h,fill:o}),d&&p.jsx("circle",{cx:1.5*c+s+h,cy:1.5*c+s+h,r:h,fill:o})]})});J4.displayName="PatternDots",J4.propTypes={id:D.string.isRequired,color:D.string.isRequired,background:D.string.isRequired,size:D.number.isRequired,padding:D.number.isRequired,stagger:D.bool.isRequired};var e5=function(e){return e*Math.PI/180},G5e=function(e){return 180*e/Math.PI},Y5e=function(e,t){return{x:Math.cos(e)*t,y:Math.sin(e)*t}},X5e=function(e){var t=e%360;return t<0&&(t+=360),t},K5e={svg:{align:{left:"start",center:"middle",right:"end",start:"start",middle:"middle",end:"end"},baseline:{top:"text-before-edge",center:"central",bottom:"alphabetic"}},canvas:{align:{left:"left",center:"center",right:"right",start:"left",middle:"center",end:"right"},baseline:{top:"top",center:"middle",bottom:"bottom"}}},tc={spacing:5,rotation:0,background:"#000000",color:"#ffffff",lineWidth:2},t5=S.memo(function(e){var t=e.id,n=e.spacing,r=n===void 0?tc.spacing:n,i=e.rotation,o=i===void 0?tc.rotation:i,a=e.background,s=a===void 0?tc.background:a,l=e.color,c=l===void 0?tc.color:l,u=e.lineWidth,d=u===void 0?tc.lineWidth:u,f=Math.round(o)%360,h=Math.abs(r);f>180?f-=360:f>90?f-=180:f<-180?f+=360:f<-90&&(f+=180);var m,g=h,v=h;return f===0?m=`
|
|
569
569
|
M 0 0 L `+g+` 0
|
|
570
570
|
M 0 `+v+" L "+g+" "+v+`
|
|
571
571
|
`:f===90?m=`
|