@gearbox-protocol/permissionless-ui 1.15.5 → 1.17.0

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("class-variance-authority"),u=require("react"),b=require("../../utils/cn.cjs"),w=require("./graph.cjs");function N(s){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const t in s)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(s,t);Object.defineProperty(a,t,n.get?n:{enumerable:!0,get:()=>s[t]})}}return a.default=s,Object.freeze(a)}const k=N(u),j=g.cva("relative w-full overflow-hidden rounded-lg border-border border bg-card text-card-foreground",{variants:{variant:{default:"shadow",elevated:"shadow-lg",outlined:"border-2",ghost:"border-0 shadow-none"},size:{sm:"h-48 sm:h-64",default:"h-64 sm:h-96",lg:"h-96 sm:h-[32rem]",xl:"h-[32rem] sm:h-[48rem]",full:"h-full"},padding:{none:"p-0",sm:"p-2",default:"p-4 sm:p-6",lg:"p-6"}},defaultVariants:{variant:"default",size:"default",padding:"default"}}),p=k.forwardRef(({className:s,variant:a,size:t,padding:n,title:l,description:i,toolbar:r,loading:d=!1,emptyMessage:o,error:c,children:h,...f},x)=>{const m=l||i||r;return e.jsxs("div",{ref:x,className:b.cn("flex flex-col",j({variant:a,size:t,padding:n,className:s})),...f,children:[m&&e.jsxs("div",{className:"mb-4 flex items-start justify-between gap-4 flex-shrink-0",children:[(l||i)&&e.jsxs("div",{className:"flex-1",children:[l&&e.jsx("h3",{className:"text-base sm:text-lg font-semibold leading-none tracking-tight",children:l}),i&&e.jsx("p",{className:"mt-1 text-xs sm:text-sm text-muted-foreground",children:i})]}),r&&e.jsx("div",{className:"flex-shrink-0 w-full",children:r})]}),e.jsxs("div",{className:"relative flex-1 w-full min-h-0",children:[d&&e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-transparent backdrop-blur-sm",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:"Loading..."})]})}),c&&e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-destructive",children:[e.jsx("svg",{className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("span",{className:"text-xs sm:text-sm font-medium",children:c})]})}),!c&&!h&&o&&e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[e.jsx("svg",{className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),e.jsx("span",{className:"text-xs sm:text-sm",children:o})]})}),!c&&h]})]})});p.displayName="GraphView";function y({series:s,onUnselectSeries:a,loading:t,title:n,description:l,toolbar:i,emptyMessage:r="No data available",error:d,containerClassName:o,variant:c,size:h,padding:f,...x}){const m=s.length>0,v=!t&&!m;return e.jsx(p,{className:o,variant:c,size:h,padding:f,title:n,description:l,toolbar:i,loading:t,error:d,emptyMessage:v?r:void 0,children:m&&!v&&!t&&e.jsx(w.Graph,{series:s,...a?{onUnselectSeries:a}:{},...x})})}function V(s=0){const a=u.useRef(null),t=u.useRef(null),[n,l]=u.useState(null);return u.useEffect(()=>{const i=()=>{if(a.current&&t.current){const o=t.current.clientWidth,c=a.current.clientWidth;l(o-c-s)}},r=t.current,d=r?new ResizeObserver(i):null;return r&&d?.observe(r),()=>{r&&d?.unobserve(r)}},[s]),{graphWidth:n,parentRef:t,asideRef:a}}exports.GraphView=p;exports.GraphViewWithData=y;exports.graphViewVariants=j;exports.useGraphAside=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("class-variance-authority"),u=require("react"),g=require("../../utils/cn.cjs"),y=require("./graph.cjs");function V(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(a,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return a.default=t,Object.freeze(a)}const k=V(u),b=N.cva("relative w-full overflow-hidden rounded-lg border-border border bg-card text-card-foreground",{variants:{variant:{default:"shadow",elevated:"shadow-lg",outlined:"border-2",ghost:"border-0 shadow-none"},size:{sm:"h-48 sm:h-64",default:"h-64 sm:h-96",lg:"h-96 sm:h-[32rem]",xl:"h-[32rem] sm:h-[48rem]",full:"h-full"},padding:{none:"p-0",sm:"p-2",default:"p-4 sm:p-6",lg:"p-6"}},defaultVariants:{variant:"default",size:"default",padding:"default"}}),p=k.forwardRef(({className:t,variant:a,size:s,padding:n,title:l,description:i,toolbar:r,loading:c=!1,emptyMessage:o,error:d,children:h,...f},m)=>{const x=l||i||r;return e.jsxs("div",{ref:m,className:g.cn("flex flex-col",b({variant:a,size:s,padding:n,className:t})),...f,children:[x&&e.jsxs("div",{className:"mb-4 flex items-start justify-between gap-4 flex-shrink-0",children:[(l||i)&&e.jsxs("div",{className:"flex-1",children:[l&&e.jsx("h3",{className:"text-base sm:text-lg font-semibold leading-none tracking-tight",children:l}),i&&e.jsx("p",{className:"mt-1 text-xs sm:text-sm text-muted-foreground",children:i})]}),r&&e.jsx("div",{className:"flex-shrink-0 w-full",children:r})]}),e.jsxs("div",{className:"relative flex-1 w-full min-h-0",children:[c&&e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center opacity-0 animate-delayed-fade-in",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground",children:"Loading..."})]})}),d&&e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-destructive",children:[e.jsx("svg",{className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("span",{className:"text-xs sm:text-sm font-medium",children:d})]})}),!d&&!h&&o&&e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[e.jsx("svg",{className:"h-12 w-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),e.jsx("span",{className:"text-xs sm:text-sm",children:o})]})}),e.jsx("div",{className:g.cn("w-full h-full transition-[filter] duration-300 delay-300",c&&"blur-sm pointer-events-none"),children:!d&&h})]})]})});p.displayName="GraphView";function R({series:t,onUnselectSeries:a,loading:s,title:n,description:l,toolbar:i,emptyMessage:r="No data available",error:c,containerClassName:o,variant:d,size:h,padding:f,...m}){const x=!s&&t.length===0,v=u.useRef(t);t.length>0&&(v.current=t);const j=s&&t.length===0?v.current:t,w=j.length>0;return e.jsx(p,{className:o,variant:d,size:h,padding:f,title:n,description:l,toolbar:i,loading:s,error:c,emptyMessage:x?r:void 0,children:w&&!c&&e.jsx(y.Graph,{series:j,...a?{onUnselectSeries:a}:{},...m})})}function G(t=0){const a=u.useRef(null),s=u.useRef(null),[n,l]=u.useState(null);return u.useEffect(()=>{const i=()=>{if(a.current&&s.current){const o=s.current.clientWidth,d=a.current.clientWidth;l(o-d-t)}},r=s.current,c=r?new ResizeObserver(i):null;return r&&c?.observe(r),()=>{r&&c?.unobserve(r)}},[t]),{graphWidth:n,parentRef:s,asideRef:a}}exports.GraphView=p;exports.GraphViewWithData=R;exports.graphViewVariants=b;exports.useGraphAside=G;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),re=require("lightweight-charts"),g=require("react"),ne=require("../../hooks/use-media-query.cjs"),ae=require("../../utils/cn.cjs"),A=require("../../utils/colors.cjs"),I=require("./default-config.cjs"),Y=require("./formatters.cjs"),le=require("./graph-current-value.cjs"),ie=require("./graph-tooltip.cjs"),se=require("./plugins/vertical-line.cjs");function ce(e){const R=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const h in e)if(h!=="default"){const _=Object.getOwnPropertyDescriptor(e,h);Object.defineProperty(R,h,_.get?_:{enumerable:!0,get:()=>e[h]})}}return R.default=e,Object.freeze(R)}const Z=ce(g),D=[{line:"#02c39a",top:"rgba(2, 195, 154, 0.56)",bottom:"rgba(2, 195, 154, 0.04)"},{line:"#3b82f6",top:"rgba(59, 130, 246, 0.56)",bottom:"rgba(59, 130, 246, 0.04)"},{line:"#f59e0b",top:"rgba(245, 158, 11, 0.56)",bottom:"rgba(245, 158, 11, 0.04)"},{line:"#ef4444",top:"rgba(239, 68, 68, 0.56)",bottom:"rgba(239, 68, 68, 0.04)"},{line:"#8b5cf6",top:"rgba(139, 92, 246, 0.56)",bottom:"rgba(139, 92, 246, 0.04)"},{line:"#ec4899",top:"rgba(236, 72, 153, 0.56)",bottom:"rgba(236, 72, 153, 0.04)"},{line:"#10b981",top:"rgba(16, 185, 129, 0.56)",bottom:"rgba(16, 185, 129, 0.04)"},{line:"#06b6d4",top:"rgba(6, 182, 212, 0.56)",bottom:"rgba(6, 182, 212, 0.04)"}];function ue({series:e,className:R,showLegend:h=!1,onUnselectSeries:_,xMeasureUnit:w="time",yMeasureUnit:T="token",optionsOverrides:z,verticalLineOptions:B}){const x=g.useRef(null),y=g.useRef(new Map),G=g.useRef(!1),j=g.useRef(null),H=g.useRef(null),k=ne.useIsMobile(),E=Z.useMemo(()=>e.flatMap(o=>o.data),[e]),U=Z.useMemo(()=>{if(e.length>0){const o=e[e.length-1];if(o.data.length>0)return o.data[o.data.length-1]}},[e]),[Q,$]=g.useState(()=>{if(!U)return;const o=new Map;for(const n of e)n.data.length>0&&o.set(n.label,n.data[n.data.length-1]);return o}),[J,P]=g.useState(null);g.useEffect(()=>{const o=()=>{if(x.current&&j.current){const c=j.current.clientWidth,a=j.current.clientHeight;x.current.resize(c,a),x.current.timeScale().fitContent()}},n=j.current,l=n?new ResizeObserver(o):null;return n&&l?.observe(n),()=>{n&&l?.unobserve(n)}},[]),g.useEffect(()=>{if(!H.current||G.current)return;const o=I.getDefaultOptions(),n=A.resolveCSSColor("hsl(var(--foreground))","rgb(0, 0, 0)"),l=re.createChart(H.current,{...o,rightPriceScale:{...o.rightPriceScale||{},visible:!k,textColor:n},...z});return x.current=l,G.current=!0,()=>{l.remove(),x.current=null,G.current=!1,y.current.clear()}},[k,z]),g.useEffect(()=>{const o=x.current;if(!o||e.length===0)return;const n=w==="time"?Y.getXFormatter(w,E):Y.getXFormatter(w),l=Y.getYFormatter(T),c=I.getDefaultOptions();o.applyOptions({localization:{...c.localization||{},timeFormatter:n?(t=>n(parseFloat(t),void 0)):void 0},timeScale:{...c.timeScale||{},tickMarkFormatter:n?(t=>n(parseFloat(t),void 0)):void 0,minBarSpacing:0}});const f=(E.length>0?Math.min(...E.map(t=>t.value)):0)<0,b=E.some(t=>t.value===0),V=!f&&b,i=e.length>1,L=i||k,S=A.resolveCSSColor("hsl(var(--foreground))","rgb(0, 0, 0)");o.applyOptions({rightPriceScale:{...c.rightPriceScale||{},visible:!k,textColor:S,...V&&{scaleMargins:{top:.3,bottom:0}}}});const m=new Set(y.current.keys()),s=new Set(e.map(t=>t.label));for(const t of m)if(!s.has(t)){const r=y.current.get(t);r&&(o.removeSeries(r),y.current.delete(t))}const p=I.getDefaultSeries(),u=[];for(let t=0;t<e.length;t++){const r=e[t],q=D[t%D.length],M=r.color||q.line;let F,O;if(r.color)if(r.topColor&&r.bottomColor)F=r.topColor,O=r.bottomColor;else if(r.topColor){const C=A.generateColorsFromBase(M);F=r.topColor,O=C.bottomColor}else if(r.bottomColor)F=A.generateColorsFromBase(M).topColor,O=r.bottomColor;else{const C=A.generateColorsFromBase(M);F=C.topColor,O=C.bottomColor}else F=r.topColor||q.top,O=r.bottomColor||q.bottom;const ee=(r.data.length>0?Math.min(...r.data.map(C=>C.value)):0)<0,te=r.data.some(C=>C.value===0),oe=!ee&&te,W=i?t===0?void 0:`scale-${t}`:void 0;i&&u.push({priceScaleId:W||"right",shouldPreventNegativeAxis:oe,seriesIndex:t});let N=y.current.get(r.label);N?(N.applyOptions({lineColor:M,topColor:F,bottomColor:O,priceScaleId:W}),N.setData(r.data)):(N=o.addAreaSeries({...p,lineColor:M,topColor:F,bottomColor:O,priceScaleId:W,priceFormat:{type:"custom",formatter:C=>l(parseFloat(C.toString()),void 0,"short")}}),N.setData(r.data),y.current.set(r.label,N))}if(i&&u.length>0)for(const t of u)try{const r=o.priceScale(t.priceScaleId);r&&r.applyOptions({visible:!L,autoScale:!0,scaleMargins:{top:.1,bottom:.1,...t.shouldPreventNegativeAxis&&{top:.3,bottom:0}},alignLabels:!0,borderVisible:!0,borderColor:"rgba(224, 227, 235, 0.1)",entireTextOnly:!1,textColor:S})}catch(r){console.warn(`Failed to configure price scale ${t.priceScaleId} for series ${t.seriesIndex}:`,r)}o.timeScale().fitContent();const v=new Map;for(const t of e)t.data.length>0&&v.set(t.label,t.data[t.data.length-1]);$(v.size>0?v:void 0)},[e,E,w,T,k]),g.useEffect(()=>{const o=x.current;if(!o||e.length===0)return;const n=e.length===1;let l;for(const a of e)if(a.data.length>0){l=a.data[a.data.length-1].time;break}if(!l)return;const c=a=>{const{time:f=l,seriesData:b,point:V}=a||{},i=Array.from(y.current.values());if(!V||!f){const m=new Map;for(const s of e)s.data.length>0&&m.set(s.label,s.data[s.data.length-1]);if($(m.size>0?m:void 0),n)P(null);else if(i[0]&&l){const p=o.timeScale().timeToCoordinate(l),u=e[0];if(u.data.length>0){const v=u.data[u.data.length-1].value,t=i[0].priceToCoordinate(v);p!==null&&t!==null&&P({x:p,y:t})}}return}const L=new Map;let S;for(let m=0;m<e.length;m++){const s=e[m],p=i[m];if(!p)continue;const u=b?.get(p),v=u&&"value"in u?u.value:void 0,t=s.data[s.data.length-1],r=v!==void 0?v:t?.value??0;m===0&&(S=r),L.set(s.label,{value:r,time:f})}if($(L),S!==void 0&&i[0]){const s=o.timeScale().timeToCoordinate(f),p=i[0].priceToCoordinate(S);if(s!==null&&p!==null){const u=j.current;if(u){const v=u.querySelector(".LightweightChart");if(v){const t=v.getBoundingClientRect(),r=u.getBoundingClientRect(),q=s+(t.left-r.left),M=p+(t.top-r.top);P({x:q,y:M})}else P({x:s,y:p})}else P({x:s,y:p})}else P(null)}else P(null)};return o.subscribeCrosshairMove(c),n||requestAnimationFrame(()=>{const a=Array.from(y.current.values());if(a[0]&&l&&e[0]?.data.length>0){const b=o.timeScale().timeToCoordinate(l),V=e[0].data[e[0].data.length-1].value,i=a[0].priceToCoordinate(V);b!==null&&i!==null&&P({x:b,y:i})}}),()=>{o.unsubscribeCrosshairMove(c)}},[e]),g.useEffect(()=>{const o=x.current;if(!o||e.length===0)return;const n=o.timeScale(),l=Math.max(...e.map(a=>a.data.length)),c=()=>{if(l===0)return;const a=n.getVisibleLogicalRange();if(!a)return;const f={from:0,to:l-1},b=typeof a.from=="number"?a.from:0,V=typeof a.to=="number"?a.to:l-1,i=.01;let L=!1;const S={...a};b<f.from-i&&(S.from=f.from,L=!0),V>f.to+i&&(S.to=f.to,L=!0),L&&n.setVisibleLogicalRange(S)};return n.subscribeVisibleLogicalRangeChange(c),()=>{n.unsubscribeVisibleLogicalRangeChange(c)}},[e]),g.useEffect(()=>{const o=x.current,n=Array.from(y.current.values()),l=[];if(o&&n.length>0&&B){const c=I.getDefaultVerticalLine(),a=n[0];for(const f of B){const b=new se.VertLine(o,a,f.xCoordinate,{...c,...f.options||{}});a.attachPrimitive(b),l.push(b)}}return()=>{if(n.length>0){const c=n[0];for(const a of l)c.detachPrimitive(a)}}},[B]);const X=e.length===1,K=Z.useMemo(()=>{if(X&&e.length>0){const o=e[0];if(o.data.length>0)return o.data[o.data.length-1]}},[X,e]);return d.jsxs("div",{ref:j,className:ae.cn("relative z-[1] w-full h-full overflow-hidden p-0",R),children:[X&&K&&d.jsx(le.GraphCurrentValue,{point:K,xMeasureUnit:w,yMeasureUnit:T}),Q&&J&&d.jsx(ie.GraphTooltip,{points:Q,xMeasureUnit:w,yMeasureUnit:T,series:e,position:J,containerRef:j}),h&&d.jsx(fe,{series:e,onUnselect:_}),d.jsx("div",{ref:H,className:"LightweightChart w-full h-full overflow-hidden"})]})}function fe({series:e,onUnselect:R}){return d.jsx("div",{className:"absolute top-0 left-2 z-[10] flex flex-wrap gap-2",children:e.map((h,_)=>{const w=D[_%D.length],T=h.color||w.line;return d.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-background/80 backdrop-blur-sm rounded border border-border",children:[d.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:T}}),d.jsx("span",{className:"text-[10px] sm:text-xs font-medium text-foreground",children:h.label}),R&&d.jsx("button",{type:"button",onClick:z=>{z.stopPropagation(),R(h.label)},className:"ml-1 flex items-center justify-center w-4 h-4 rounded-sm hover:bg-muted transition-colors cursor-pointer","aria-label":`Remove ${h.label}`,children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground hover:text-foreground","aria-hidden":"true",children:[d.jsx("title",{children:"Close"}),d.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),d.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},h.label)})})}exports.DEFAULT_SERIES_COLORS=D;exports.Graph=ue;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),me=require("lightweight-charts"),i=require("react"),he=require("../../hooks/use-media-query.cjs"),se=require("../../utils/cn.cjs"),B=require("../../utils/colors.cjs"),$=require("./default-config.cjs"),ee=require("./formatters.cjs"),pe=require("./graph-current-value.cjs"),be=require("./graph-tooltip.cjs"),ve=require("./plugins/vertical-line.cjs");function Ce(e){const L=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const h in e)if(h!=="default"){const k=Object.getOwnPropertyDescriptor(e,h);Object.defineProperty(L,h,k.get?k:{enumerable:!0,get:()=>e[h]})}}return L.default=e,Object.freeze(L)}const te=Ce(i),G=[{line:"#02c39a",top:"rgba(2, 195, 154, 0.56)",bottom:"rgba(2, 195, 154, 0.04)"},{line:"#3b82f6",top:"rgba(59, 130, 246, 0.56)",bottom:"rgba(59, 130, 246, 0.04)"},{line:"#f59e0b",top:"rgba(245, 158, 11, 0.56)",bottom:"rgba(245, 158, 11, 0.04)"},{line:"#ef4444",top:"rgba(239, 68, 68, 0.56)",bottom:"rgba(239, 68, 68, 0.04)"},{line:"#8b5cf6",top:"rgba(139, 92, 246, 0.56)",bottom:"rgba(139, 92, 246, 0.04)"},{line:"#ec4899",top:"rgba(236, 72, 153, 0.56)",bottom:"rgba(236, 72, 153, 0.04)"},{line:"#10b981",top:"rgba(16, 185, 129, 0.56)",bottom:"rgba(16, 185, 129, 0.04)"},{line:"#06b6d4",top:"rgba(6, 182, 212, 0.56)",bottom:"rgba(6, 182, 212, 0.04)"}];function Se({series:e,className:L,showLegend:h=!1,onUnselectSeries:k,xMeasureUnit:P="time",yMeasureUnit:E="token",optionsOverrides:A,verticalLineOptions:D}){const S=i.useRef(null),x=i.useRef(new Map),X=i.useRef(!1),oe=i.useRef(new Set),re=i.useRef(null),ne=i.useRef(!0),V=i.useRef(null),W=i.useRef(null),z=he.useIsMobile(),T=te.useMemo(()=>e.flatMap(t=>t.data),[e]),ce=te.useMemo(()=>{if(e.length>0){const t=e[e.length-1];if(t.data.length>0)return t.data[t.data.length-1]}},[e]),[ae,Y]=i.useState(()=>{if(!ce)return;const t=new Map;for(const n of e)n.data.length>0&&t.set(n.label,n.data[n.data.length-1]);return t}),[le,M]=i.useState(null);i.useEffect(()=>{const t=()=>{if(S.current&&V.current){const u=V.current.clientWidth,a=V.current.clientHeight;S.current.resize(u,a),S.current.timeScale().fitContent()}},n=V.current,l=n?new ResizeObserver(t):null;return n&&l?.observe(n),()=>{n&&l?.unobserve(n)}},[]),i.useEffect(()=>{if(!W.current||X.current)return;const t=$.getDefaultOptions(),n=B.resolveCSSColor("hsl(var(--foreground))","rgb(0, 0, 0)"),l=me.createChart(W.current,{...t,rightPriceScale:{...t.rightPriceScale||{},visible:!z,textColor:n},...A});return S.current=l,X.current=!0,()=>{l.remove(),S.current=null,X.current=!1,x.current.clear()}},[z,A]),i.useEffect(()=>{const t=S.current;if(!t||e.length===0)return;const n=P==="time"?ee.getXFormatter(P,T):ee.getXFormatter(P),l=ee.getYFormatter(E),u=$.getDefaultOptions();t.applyOptions({localization:{...u.localization||{},timeFormatter:n?(o=>n(parseFloat(o),void 0)):void 0},timeScale:{...u.timeScale||{},tickMarkFormatter:n?(o=>n(parseFloat(o),void 0)):void 0,minBarSpacing:0}});const g=(T.length>0?Math.min(...T.map(o=>o.value)):0)<0,R=T.some(o=>o.value===0),N=!g&&R,s=e.length>1,j=s||z,y=B.resolveCSSColor("hsl(var(--foreground))","rgb(0, 0, 0)");t.applyOptions({rightPriceScale:{...u.rightPriceScale||{},visible:!z,textColor:y,...N&&{scaleMargins:{top:.3,bottom:0}}}});const b=new Set(x.current.keys()),c=new Set(e.map(o=>o.label));for(const o of b)if(!c.has(o)){const r=x.current.get(o);r&&(t.removeSeries(r),x.current.delete(o))}const v=$.getDefaultSeries(),f=[];let C=0;for(let o=0;o<e.length;o++){const r=e[o],K=G[o%G.length],I=r.color||K.line;let O,_;if(r.color)if(r.topColor&&r.bottomColor)O=r.topColor,_=r.bottomColor;else if(r.topColor){const d=B.generateColorsFromBase(I);O=r.topColor,_=d.bottomColor}else if(r.bottomColor)O=B.generateColorsFromBase(I).topColor,_=r.bottomColor;else{const d=B.generateColorsFromBase(I);O=d.topColor,_=d.bottomColor}else O=r.topColor||K.top,_=r.bottomColor||K.bottom;if(r.data.length===0){const d=x.current.get(r.label);d&&(t.removeSeries(d),x.current.delete(r.label));continue}const fe=(r.data.length>0?Math.min(...r.data.map(d=>d.value)):0)<0,ge=r.data.some(d=>d.value===0),de=!fe&&ge,U=s?C===0?void 0:`scale-${C}`:void 0;s&&f.push({priceScaleId:U||"right",shouldPreventNegativeAxis:de,seriesIndex:C});let q=x.current.get(r.label);q?(q.applyOptions({lineColor:I,topColor:O,bottomColor:_,priceScaleId:U}),q.setData(r.data)):(q=t.addAreaSeries({...v,lineColor:I,topColor:O,bottomColor:_,priceScaleId:U,priceFormat:{type:"custom",formatter:d=>l(parseFloat(d.toString()),void 0,"short")}}),q.setData(r.data),x.current.set(r.label,q)),C++}if(s&&f.length>0)for(const o of f)try{const r=t.priceScale(o.priceScaleId);r&&r.applyOptions({visible:!j,autoScale:!0,scaleMargins:{top:.1,bottom:.1,...o.shouldPreventNegativeAxis&&{top:.3,bottom:0}},alignLabels:!0,borderVisible:!0,borderColor:"rgba(224, 227, 235, 0.1)",entireTextOnly:!1,textColor:y})}catch(r){console.warn(`Failed to configure price scale ${o.priceScaleId} for series ${o.seriesIndex}:`,r)}let p=null;if(T.length>0){const o=T.map(r=>typeof r.time=="number"?r.time:Number(r.time));p={from:Math.min(...o),to:Math.max(...o)}}const w=new Set(e.map(o=>o.label)),H=oe.current,Q=w.size!==H.size||[...w].some(o=>!H.has(o)),F=re.current,ue=p&&F&&(Math.abs(p.from-F.from)>(F.to-F.from)*.1||Math.abs(p.to-F.to)>(F.to-F.from)*.1);(ne.current||Q||ue||!F)&&(requestAnimationFrame(()=>{S.current&&S.current.timeScale().fitContent()}),ne.current=!1),oe.current=w,re.current=p;const J=new Map;for(const o of e)o.data.length>0&&J.set(o.label,o.data[o.data.length-1]);Y(J.size>0?J:void 0)},[e,T,P,E,z]),i.useEffect(()=>{const t=S.current;if(!t||e.length===0)return;const n=e.length===1;let l;for(const a of e)if(a.data.length>0){l=a.data[a.data.length-1].time;break}if(!l)return;const u=a=>{const{time:g=l,seriesData:R,point:N}=a||{},s=Array.from(x.current.values());if(!N||!g){const b=new Map;for(const c of e)c.data.length>0&&b.set(c.label,c.data[c.data.length-1]);if(Y(b.size>0?b:void 0),n)M(null);else if(s[0]&&l){const v=t.timeScale().timeToCoordinate(l),f=e[0];if(f.data.length>0){const C=f.data[f.data.length-1].value,p=s[0].priceToCoordinate(C);v!==null&&p!==null&&M({x:v,y:p})}}return}const j=new Map;let y;for(let b=0;b<e.length;b++){const c=e[b],v=s[b];if(!v)continue;const f=R?.get(v),C=f&&"value"in f?f.value:void 0,p=c.data[c.data.length-1],w=C!==void 0?C:p?.value??0;b===0&&(y=w),j.set(c.label,{value:w,time:g})}if(Y(j),y!==void 0&&s[0]){const c=t.timeScale().timeToCoordinate(g),v=s[0].priceToCoordinate(y);if(c!==null&&v!==null){const f=V.current;if(f){const C=f.querySelector(".LightweightChart");if(C){const p=C.getBoundingClientRect(),w=f.getBoundingClientRect(),H=c+(p.left-w.left),Q=v+(p.top-w.top);M({x:H,y:Q})}else M({x:c,y:v})}else M({x:c,y:v})}else M(null)}else M(null)};return t.subscribeCrosshairMove(u),n||requestAnimationFrame(()=>{const a=Array.from(x.current.values());if(a[0]&&l&&e[0]?.data.length>0){const R=t.timeScale().timeToCoordinate(l),N=e[0].data[e[0].data.length-1].value,s=a[0].priceToCoordinate(N);R!==null&&s!==null&&M({x:R,y:s})}}),()=>{t.unsubscribeCrosshairMove(u)}},[e]),i.useEffect(()=>{const t=S.current;if(!t||e.length===0)return;const n=t.timeScale(),l=Math.max(...e.map(a=>a.data.length)),u=()=>{if(l===0)return;const a=n.getVisibleLogicalRange();if(!a)return;const g={from:0,to:l-1},R=typeof a.from=="number"?a.from:0,N=typeof a.to=="number"?a.to:l-1,s=.01;let j=!1;const y={...a};R<g.from-s&&(y.from=g.from,j=!0),N>g.to+s&&(y.to=g.to,j=!0),j&&n.setVisibleLogicalRange(y)};return n.subscribeVisibleLogicalRangeChange(u),()=>{n.unsubscribeVisibleLogicalRangeChange(u)}},[e]),i.useEffect(()=>{const t=S.current,n=Array.from(x.current.values()),l=[];if(t&&n.length>0&&D){const u=$.getDefaultVerticalLine(),a=n[0];for(const g of D){const R=new ve.VertLine(t,a,g.xCoordinate,{...u,...g.options||{}});a.attachPrimitive(R),l.push(R)}}return()=>{if(n.length>0){const u=n[0];for(const a of l)u.detachPrimitive(a)}}},[D]);const Z=e.length===1,ie=te.useMemo(()=>{if(Z&&e.length>0){const t=e[0];if(t.data.length>0)return t.data[t.data.length-1]}},[Z,e]);return m.jsxs("div",{ref:V,className:se.cn("relative z-[1] w-full h-full overflow-hidden p-0",L),children:[Z&&ie&&m.jsx(pe.GraphCurrentValue,{point:ie,xMeasureUnit:P,yMeasureUnit:E}),ae&&le&&m.jsx(be.GraphTooltip,{points:ae,xMeasureUnit:P,yMeasureUnit:E,series:e,position:le,containerRef:V}),h&&m.jsx(xe,{series:e,onUnselect:k}),m.jsx("div",{ref:W,className:"LightweightChart w-full h-full overflow-hidden"})]})}function xe({series:e,onUnselect:L}){return m.jsx("div",{className:"absolute top-0 left-2 z-[10] flex flex-wrap gap-2",children:e.map((h,k)=>{const P=G[k%G.length],E=h.color||P.line,A=h.data.length===0;return m.jsxs("div",{className:se.cn("flex items-center gap-1.5 px-2 py-1 bg-background/80 backdrop-blur-sm rounded border border-border",A&&"opacity-50"),children:[m.jsx("div",{className:"w-3 h-3 rounded-sm",style:{backgroundColor:E}}),m.jsxs("span",{className:"text-[10px] sm:text-xs font-medium text-foreground",children:[h.label,A&&" (no data)"]}),L&&m.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),L(h.label)},className:"ml-1 flex items-center justify-center w-4 h-4 rounded-sm hover:bg-muted transition-colors cursor-pointer","aria-label":`Remove ${h.label}`,children:m.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-muted-foreground hover:text-foreground","aria-hidden":"true",children:[m.jsx("title",{children:"Close"}),m.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},h.label)})})}exports.DEFAULT_SERIES_COLORS=G;exports.Graph=Se;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),b=require("react"),u=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk");function m(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const a=m(b);function x({className:e,children:r,...t}){const s=a.Children.toArray(r).length,i=a.Children.map(r,(o,f)=>{if(a.isValidElement(o)){const c=f===0,d=f===s-1;return a.cloneElement(o,{first:c,last:d})}return o});return n.jsx("div",{className:u.cn("m-0 p-0 w-full flex flex-wrap",e),...t,children:i})}function p({icon:e,title:r,subTitle:t,onClick:l,endingIcon:s,first:i=!1,last:o=!1,className:f}){const c=()=>i&&o?"before:rounded-lg":i?"before:rounded-t-lg":o?"before:rounded-b-lg":"";return n.jsxs("button",{type:"button",onClick:l,className:u.cn("relative z-0 pt-5 px-4 flex flex-row items-start gap-4 w-full cursor-pointer text-left","before:absolute before:-z-10 before:left-0 before:hidden before:w-full before:inset-y-0 before:content-[''] before:bg-foreground/10",c(),"hover:before:block",!o&&"after:absolute after:bottom-0 after:left-0 after:w-full after:h-px after:content-[''] after:bg-border",f),children:[e&&n.jsx("div",{className:"w-6 h-6 text-muted-foreground flex items-center justify-center",children:e}),n.jsx("div",{className:"pb-5 flex-1 flex flex-col gap-2",children:n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsx("div",{className:"text-base leading-[1.2] font-medium",children:r}),t&&n.jsx("div",{className:"text-sm text-muted-foreground",children:t})]})}),s&&n.jsx("div",{className:"ml-4 text-muted-foreground transition-colors",children:s})]})}exports.OptionsItem=p;exports.OptionsList=x;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),m=require("react"),c=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const a=b(m);function x({className:e,children:r,...t}){const l=a.Children.toArray(r).length,f=a.Children.map(r,(o,i)=>{if(a.isValidElement(o)){const u=i===0,d=i===l-1;return a.cloneElement(o,{first:u,last:d})}return o});return n.jsx("div",{className:c.cn("m-0 p-0 w-full flex flex-wrap",e),...t,children:f})}function p({icon:e,title:r,subTitle:t,onClick:s,endingIcon:l,first:f=!1,last:o=!1,className:i}){return n.jsxs("button",{type:"button",onClick:s,className:c.cn("relative z-0 pt-5 px-4 flex flex-row items-start gap-4 w-full cursor-pointer text-left","before:absolute before:-z-10 before:left-0 before:hidden before:w-full before:inset-y-0 before:content-[''] before:bg-foreground/10 before:rounded-lg","hover:before:block",!o&&"after:absolute after:bottom-0 after:left-0 after:w-full after:h-px after:content-[''] after:bg-border",i),children:[e&&n.jsx("div",{className:"w-6 h-6 text-muted-foreground flex items-center justify-center",children:e}),n.jsx("div",{className:"pb-5 flex-1 flex flex-col gap-2",children:n.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.jsx("div",{className:"text-base leading-[1.2] font-medium",children:r}),t&&n.jsx("div",{className:"text-sm text-muted-foreground",children:t})]})}),l&&n.jsx("div",{className:"ml-4 text-muted-foreground transition-colors",children:l})]})}exports.OptionsItem=p;exports.OptionsList=x;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),o=require("class-variance-authority"),C=require("react"),u=require("../layout/col/col.cjs"),m=require("../layout/grid/grid.cjs"),i=require("../../utils/cn.cjs");function V(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const l=V(C),T=o.cva("w-full",{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),p=l.forwardRef(({className:e,size:a,cols:t=12,gap:r=0,...s},n)=>d.jsx("div",{className:"relative w-full overflow-auto",children:d.jsx(m.Grid,{ref:n,cols:t,gap:r,className:i.cn(T({size:a,className:e})),...s})}));p.displayName="GridTable";const y=l.forwardRef(({className:e,...a},t)=>d.jsx("div",{ref:t,className:i.cn("contents [&>*]:border-b [&>*]:border-border",e),...a}));y.displayName="GridTableHeader";const g=l.forwardRef(({className:e,...a},t)=>d.jsx("div",{ref:t,className:i.cn("contents [&>*:last-child>*]:border-0",e),...a}));g.displayName="GridTableBody";const x=l.forwardRef(({className:e,...a},t)=>d.jsx("div",{ref:t,className:i.cn("contents [&>*]:border-t [&>*]:bg-muted/50 [&>*]:font-medium",e),...a}));x.displayName="GridTableFooter";const G=l.forwardRef(({className:e,cols:a,gap:t=0,last:r,height:s,hideValue:n,style:w,...R},h)=>{const f=typeof s=="number"?`${s}px`:s;return d.jsx(m.Grid,{ref:h,cols:a,gap:t,className:i.cn("contents md:[&>*]:border-b [&>*]:border-border [&>*]:transition-colors hover:[&>*]:bg-muted/50 data-[state=selected]:[&>*]:bg-muted",r&&"[&>*]:border-b-0",n&&"[&>*]:opacity-0",e),style:{...w,...f?{height:f}:{}},...R})});G.displayName="GridTableRow";const j=o.cva("flex items-center justify-startborder-b text-left align-middle font-medium text-muted-foreground !bg-transparent",{variants:{size:{sm:"min-h-8 px-1 py-2 text-xs",default:"min-h-10 px-2 py-2.5",lg:"min-h-12 px-4 py-3"},justify:{start:"justify-start",center:"justify-center",end:"justify-end"}},defaultVariants:{size:"default",justify:"start"}}),c=l.forwardRef(({className:e,size:a,span:t=1,justify:r="start",...s},n)=>d.jsx(u.Col,{ref:n,span:t,className:i.cn(j({size:a,justify:r,className:e})),...s}));c.displayName="GridTableHead";const N=o.cva("align-middle",{variants:{size:{sm:"p-2",default:"p-4",lg:"p-6"},textAlign:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{size:"default"}}),b=l.forwardRef(({className:e,size:a,span:t=1,textAlign:r,...s},n)=>d.jsx(u.Col,{ref:n,span:t,className:i.cn(N({size:a,textAlign:r,className:e})),...s}));b.displayName="GridTableCell";const v=l.forwardRef(({className:e,...a},t)=>d.jsx("div",{ref:t,className:i.cn("col-span-full mt-4 text-sm text-muted-foreground",e),...a}));v.displayName="GridTableCaption";const _=b,H=c;exports.GridTable=p;exports.GridTableBody=g;exports.GridTableCaption=v;exports.GridTableCell=b;exports.GridTableFooter=x;exports.GridTableHead=c;exports.GridTableHeader=y;exports.GridTableRow=G;exports.Td=_;exports.Th=H;exports.gridTableCellVariants=N;exports.gridTableHeadVariants=j;exports.gridTableVariants=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("class-variance-authority"),V=require("react"),u=require("../layout/col/col.cjs"),m=require("../layout/grid/grid.cjs"),l=require("../../utils/cn.cjs");function _(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const d=_(V),p=n.cva("w-full",{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),T=d.forwardRef(({className:e,size:a,cols:t=12,gap:r=0,...s},o)=>i.jsx("div",{className:"relative w-full overflow-auto",children:i.jsx(m.Grid,{ref:o,cols:t,gap:r,className:l.cn(p({size:a,className:e})),...s})}));T.displayName="GridTable";const y=d.forwardRef(({className:e,...a},t)=>i.jsx("div",{ref:t,className:l.cn("contents [&>*]:border-b [&>*]:border-border",e),...a}));y.displayName="GridTableHeader";const g=d.forwardRef(({className:e,...a},t)=>i.jsx("div",{ref:t,className:l.cn("contents [&>*:last-child>*]:border-0",e),...a}));g.displayName="GridTableBody";const x=d.forwardRef(({className:e,...a},t)=>i.jsx("div",{ref:t,className:l.cn("contents [&>*]:border-t [&>*]:bg-muted/50 [&>*]:font-medium",e),...a}));x.displayName="GridTableFooter";const G=d.forwardRef(({className:e,cols:a,gap:t=0,last:r,height:s,hideValue:o,noHover:w,style:R,...h},C)=>{const f=typeof s=="number"?`${s}px`:s;return i.jsx(m.Grid,{ref:C,cols:a,gap:t,className:l.cn("contents md:[&>*]:border-b [&>*]:border-border [&>*]:transition-colors data-[state=selected]:[&>*]:bg-muted",!w&&["[&>*]:relative [&>*]:z-0","[&>*]:before:absolute [&>*]:before:inset-0 [&>*]:before:-z-10 [&>*]:before:bg-muted/50 [&>*]:before:opacity-0 [&>*]:before:transition-opacity","hover:[&>*]:before:opacity-100","[&>*:first-child]:before:rounded-l-lg [&>*:last-child]:before:rounded-r-lg"],r&&"[&>*]:border-b-0",o&&"[&>*]:opacity-0",e),style:{...R,...f?{height:f}:{}},...h})});G.displayName="GridTableRow";const j=n.cva("flex items-center justify-startborder-b text-left align-middle font-medium text-muted-foreground !bg-transparent",{variants:{size:{sm:"min-h-8 px-1 py-2 text-xs",default:"min-h-10 px-2 py-2.5",lg:"min-h-12 px-4 py-3"},justify:{start:"justify-start",center:"justify-center",end:"justify-end"}},defaultVariants:{size:"default",justify:"start"}}),c=d.forwardRef(({className:e,size:a,span:t=1,justify:r="start",...s},o)=>i.jsx(u.Col,{ref:o,span:t,className:l.cn(j({size:a,justify:r,className:e})),...s}));c.displayName="GridTableHead";const N=n.cva("align-middle",{variants:{size:{sm:"p-2",default:"p-4",lg:"p-6"},textAlign:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{size:"default"}}),b=d.forwardRef(({className:e,size:a,span:t=1,textAlign:r,...s},o)=>i.jsx(u.Col,{ref:o,span:t,className:l.cn(N({size:a,textAlign:r,className:e})),...s}));b.displayName="GridTableCell";const v=d.forwardRef(({className:e,...a},t)=>i.jsx("div",{ref:t,className:l.cn("col-span-full mt-4 text-sm text-muted-foreground",e),...a}));v.displayName="GridTableCaption";const z=b,H=c;exports.GridTable=T;exports.GridTableBody=g;exports.GridTableCaption=v;exports.GridTableCell=b;exports.GridTableFooter=x;exports.GridTableHead=c;exports.GridTableHeader=y;exports.GridTableRow=G;exports.Td=z;exports.Th=H;exports.gridTableCellVariants=N;exports.gridTableHeadVariants=j;exports.gridTableVariants=p;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("class-variance-authority"),_=require("lucide-react"),C=require("react"),H=require("../buttons/button/button.cjs"),n=require("../tooltip/tooltip.cjs"),s=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk");function V(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const l=V(C),c=i.cva("w-full caption-bottom",{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),b=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("div",{className:"relative w-full overflow-auto rounded-lg border border-input bg-card",children:r.jsx("table",{ref:o,className:s.cn(c({size:a,className:e})),...t})}));b.displayName="Table";const u=l.forwardRef(({className:e,...a},t)=>r.jsx("thead",{ref:t,className:s.cn("[&_tr]:border-b border-input [&_tr]:hover:bg-transparent",e),...a}));u.displayName="TableHeader";const f=l.forwardRef(({className:e,...a},t)=>r.jsx("tbody",{ref:t,className:s.cn("[&_tr:last-child]:border-0",e),...a}));f.displayName="TableBody";const m=l.forwardRef(({className:e,...a},t)=>r.jsx("tfoot",{ref:t,className:s.cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...a}));m.displayName="TableFooter";const p=l.forwardRef(({className:e,...a},t)=>r.jsx("tr",{ref:t,className:s.cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted border-border",e),...a}));p.displayName="TableRow";const x=i.cva("border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground border-input",{variants:{size:{sm:"h-8 px-1 text-xs",default:"h-10 px-2",lg:"h-12 px-4"}},defaultVariants:{size:"default"}}),d=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("th",{ref:o,className:s.cn(x({size:a,className:e})),...t}));d.displayName="TableHead";const T=i.cva("align-middle",{variants:{size:{sm:"p-1",default:"p-2",lg:"p-4"}},defaultVariants:{size:"default"}}),g=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("td",{ref:o,className:s.cn(T({size:a,className:e})),...t}));g.displayName="TableCell";const j=l.forwardRef(({className:e,...a},t)=>r.jsx("caption",{ref:t,className:s.cn("mt-4 text-sm text-muted-foreground",e),...a}));j.displayName="TableCaption";const y=l.forwardRef(({title:e,isSorted:a,direction:t,setSort:o,placement:h="right",children:w,className:N,...v},R)=>r.jsx(d,{ref:R,className:N,...v,children:r.jsx(n.TooltipProvider,{children:r.jsxs(n.Tooltip,{delayDuration:200,children:[r.jsx(n.TooltipTrigger,{asChild:!0,children:r.jsxs("div",{className:s.cn("group flex items-center gap-1 w-fit cursor-pointer hover:text-foreground",h==="left"?"flex-row-reverse":"flex-row"),onClick:()=>o(t==="asc"?"desc":"asc"),children:[w,r.jsx(H.Button,{variant:"text",size:"auto",className:a?void 0:"opacity-0 group-hover:opacity-100",children:r.jsx(_.ArrowDown,{className:s.cn("h-4 w-4",t==="desc"?"rotate-180":"","transition-transform duration-200 ease-in-out")})})]})}),r.jsxs(n.TooltipContent,{side:"top",children:["Sort by ",e]})]})})}));y.displayName="SortingTableHead";exports.SortingTableHead=y;exports.Table=b;exports.TableBody=f;exports.TableCaption=j;exports.TableCell=g;exports.TableFooter=m;exports.TableHead=d;exports.TableHeader=u;exports.TableRow=p;exports.tableCellVariants=T;exports.tableHeadVariants=x;exports.tableVariants=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("class-variance-authority"),_=require("lucide-react"),C=require("react"),H=require("../buttons/button/button.cjs"),n=require("../tooltip/tooltip.cjs"),s=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk");function V(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const l=V(C),c=i.cva("w-full caption-bottom",{variants:{size:{sm:"text-xs",default:"text-sm",lg:"text-base"}},defaultVariants:{size:"default"}}),b=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("div",{className:"relative w-full overflow-auto rounded-lg border border-input bg-card",children:r.jsx("table",{ref:o,className:s.cn(c({size:a,className:e})),...t})}));b.displayName="Table";const u=l.forwardRef(({className:e,...a},t)=>r.jsx("thead",{ref:t,className:s.cn("[&_tr]:border-b border-input [&_tr]:hover:bg-transparent",e),...a}));u.displayName="TableHeader";const f=l.forwardRef(({className:e,...a},t)=>r.jsx("tbody",{ref:t,className:s.cn("[&_tr:last-child]:border-0",e),...a}));f.displayName="TableBody";const m=l.forwardRef(({className:e,...a},t)=>r.jsx("tfoot",{ref:t,className:s.cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...a}));m.displayName="TableFooter";const p=l.forwardRef(({className:e,...a},t)=>r.jsx("tr",{ref:t,className:s.cn("relative border-b transition-colors data-[state=selected]:bg-muted border-border","before:absolute before:inset-0 before:-z-10 before:rounded-lg before:bg-muted/50 before:opacity-0 before:transition-opacity","hover:before:opacity-100",e),...a}));p.displayName="TableRow";const x=i.cva("border-b bg-muted/50 text-left align-middle font-medium text-muted-foreground border-input",{variants:{size:{sm:"h-8 px-1 text-xs",default:"h-10 px-2",lg:"h-12 px-4"}},defaultVariants:{size:"default"}}),d=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("th",{ref:o,className:s.cn(x({size:a,className:e})),...t}));d.displayName="TableHead";const T=i.cva("align-middle",{variants:{size:{sm:"p-1",default:"p-2",lg:"p-4"}},defaultVariants:{size:"default"}}),g=l.forwardRef(({className:e,size:a,...t},o)=>r.jsx("td",{ref:o,className:s.cn(T({size:a,className:e})),...t}));g.displayName="TableCell";const y=l.forwardRef(({className:e,...a},t)=>r.jsx("caption",{ref:t,className:s.cn("mt-4 text-sm text-muted-foreground",e),...a}));y.displayName="TableCaption";const j=l.forwardRef(({title:e,isSorted:a,direction:t,setSort:o,placement:h="right",children:w,className:N,...v},R)=>r.jsx(d,{ref:R,className:N,...v,children:r.jsx(n.TooltipProvider,{children:r.jsxs(n.Tooltip,{delayDuration:200,children:[r.jsx(n.TooltipTrigger,{asChild:!0,children:r.jsxs("div",{className:s.cn("group flex items-center gap-1 w-fit cursor-pointer hover:text-foreground",h==="left"?"flex-row-reverse":"flex-row"),onClick:()=>o(t==="asc"?"desc":"asc"),children:[w,r.jsx(H.Button,{variant:"text",size:"auto",className:a?void 0:"opacity-0 group-hover:opacity-100",children:r.jsx(_.ArrowDown,{className:s.cn("h-4 w-4",t==="desc"?"rotate-180":"","transition-transform duration-200 ease-in-out")})})]})}),r.jsxs(n.TooltipContent,{side:"top",children:["Sort by ",e]})]})})}));j.displayName="SortingTableHead";exports.SortingTableHead=j;exports.Table=b;exports.TableBody=f;exports.TableCaption=y;exports.TableCell=g;exports.TableFooter=m;exports.TableHead=d;exports.TableHeader=u;exports.TableRow=p;exports.tableCellVariants=T;exports.tableHeadVariants=x;exports.tableVariants=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),F=require("sonner"),B=require("../../hooks/use-media-query.cjs"),W=require("../buttons/range-buttons/range-buttons.cjs"),a=require("../graph/graph.cjs"),z=require("../graph/graph-view.cjs"),H=require("./graph-dropdown.cjs"),P=({size:t=16})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Expand fullscreen",children:[e.jsx("title",{children:"Expand fullscreen"}),e.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})]}),$=({size:t=16})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Exit fullscreen",children:[e.jsx("title",{children:"Exit fullscreen"}),e.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})]});function Q({data:t,yMeasureUnit:n,height:x=306,defaultGraph:g,onGraphSelected:v,graphs:b,isMultipleSelect:y,range:A,rangeList:E,setRange:L,onGraphExpanded:w,isGraphExpanded:R,onUnselectSeries:C,graphsWithNoData:D,loadingGraphs:I,noDataMessage:j="No data available for this graph"}){const u=i.useMemo(()=>Array.isArray(t)?t:t?[t]:[],[t]),S=i.useMemo(()=>Array.isArray(t)&&t.length>1,[t]),k=B.useIsMobile(),O=i.useCallback((d,l)=>{F.toast.error(j)},[j]),N=i.useMemo(()=>{if(n)return Array.isArray(n)?n[0]:n},[n]),M=e.jsxs("div",{className:"z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2",children:[e.jsx("div",{children:v&&b&&g&&e.jsx(H.GraphDropdown,{onSelected:v,items:b,defaultItem:g,multiple:y,graphsWithNoData:D,loadingGraphs:I,onNoDataSelected:O})}),e.jsxs("div",{className:"flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1",children:[e.jsx(W.RangeButtons,{range:A,rangeList:E,setRange:L}),!k&&w&&e.jsx("button",{type:"button",className:"px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",onClick:w,children:R?e.jsx($,{size:16}):e.jsx(P,{size:16})})]})]}),c=i.useRef(new Map),f=i.useRef(0),T=i.useMemo(()=>{const d=Array.isArray(n)?n:void 0;return u.map((l,_)=>{const m=l?.title||`Series ${_+1}`;if(!c.current.has(m)){const r=new Set(Array.from(c.current.values()));let o=f.current;for(let s=0;s<a.DEFAULT_SERIES_COLORS.length;s++){const h=(f.current+s)%a.DEFAULT_SERIES_COLORS.length;if(!r.has(h)){o=h;break}}c.current.set(m,o),f.current=(o+1)%a.DEFAULT_SERIES_COLORS.length}const V=c.current.get(m)??0,p=a.DEFAULT_SERIES_COLORS[V%a.DEFAULT_SERIES_COLORS.length];return{data:[...l?.data||[]].sort((r,o)=>{const s=typeof r.time=="number"?r.time:Number(r.time),h=typeof o.time=="number"?o.time:Number(o.time);return s-h}).reduce((r,o)=>{const s=o.time;return r.length===0||r[r.length-1].time!==s?r.push({time:s,value:o.value}):r[r.length-1]={time:s,value:o.value},r},[]),label:m,yMeasureUnit:d?.[_]??(Array.isArray(n)?void 0:n),color:p.line,topColor:p.top,bottomColor:p.bottom}}).filter(l=>l.data.length>0)},[u,n]),q=S&&u.length>0?u.some(d=>!d):!t;return e.jsx("div",{style:{width:"100%",height:x?`${x}px`:void 0},className:"w-full",children:e.jsx(z.GraphViewWithData,{series:T,loading:q,toolbar:M,size:x?"full":"default",containerClassName:"h-full",showLegend:S,onUnselectSeries:C,yMeasureUnit:N})})}exports.TradingView=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),F=require("sonner"),B=require("../../hooks/use-media-query.cjs"),W=require("../buttons/range-buttons/range-buttons.cjs"),l=require("../graph/graph.cjs"),z=require("../graph/graph-view.cjs"),H=require("./graph-dropdown.cjs"),P=({size:t=16})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Expand fullscreen",children:[e.jsx("title",{children:"Expand fullscreen"}),e.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})]}),$=({size:t=16})=>e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Exit fullscreen",children:[e.jsx("title",{children:"Exit fullscreen"}),e.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})]});function Q({data:t,yMeasureUnit:n,height:h=306,defaultGraph:g,onGraphSelected:v,graphs:b,isMultipleSelect:y,range:A,rangeList:E,setRange:L,onGraphExpanded:w,isGraphExpanded:R,onUnselectSeries:C,graphsWithNoData:D,loadingGraphs:I,noDataMessage:j="No data available for this graph"}){const a=i.useMemo(()=>Array.isArray(t)?t:t?[t]:[],[t]),S=i.useMemo(()=>Array.isArray(t)&&t.length>1,[t]),k=B.useIsMobile(),O=i.useCallback((c,f)=>{F.toast.error(j)},[j]),N=i.useMemo(()=>{if(n)return Array.isArray(n)?n[0]:n},[n]),M=e.jsxs("div",{className:"z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2",children:[e.jsx("div",{children:v&&b&&g&&e.jsx(H.GraphDropdown,{onSelected:v,items:b,defaultItem:g,multiple:y,graphsWithNoData:D,loadingGraphs:I,onNoDataSelected:O})}),e.jsxs("div",{className:"flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1",children:[e.jsx(W.RangeButtons,{range:A,rangeList:E,setRange:L}),!k&&w&&e.jsx("button",{type:"button",className:"px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",onClick:w,children:R?e.jsx($,{size:16}):e.jsx(P,{size:16})})]})]}),u=i.useRef(new Map),x=i.useRef(0),T=i.useMemo(()=>{const c=Array.isArray(n)?n:void 0;return a.map((f,_)=>{const d=f?.title||`Series ${_+1}`;if(!u.current.has(d)){const r=new Set(Array.from(u.current.values()));let o=x.current;for(let s=0;s<l.DEFAULT_SERIES_COLORS.length;s++){const m=(x.current+s)%l.DEFAULT_SERIES_COLORS.length;if(!r.has(m)){o=m;break}}u.current.set(d,o),x.current=(o+1)%l.DEFAULT_SERIES_COLORS.length}const V=u.current.get(d)??0,p=l.DEFAULT_SERIES_COLORS[V%l.DEFAULT_SERIES_COLORS.length];return{data:[...f?.data||[]].sort((r,o)=>{const s=typeof r.time=="number"?r.time:Number(r.time),m=typeof o.time=="number"?o.time:Number(o.time);return s-m}).reduce((r,o)=>{const s=o.time;return r.length===0||r[r.length-1].time!==s?r.push({time:s,value:o.value}):r[r.length-1]={time:s,value:o.value},r},[]),label:d,yMeasureUnit:c?.[_]??(Array.isArray(n)?void 0:n),color:p.line,topColor:p.top,bottomColor:p.bottom}})},[a,n]),q=S&&a.length>0?a.some(c=>!c):!t;return e.jsx("div",{style:{width:"100%",height:h?`${h}px`:void 0},className:"w-full",children:e.jsx(z.GraphViewWithData,{series:T,loading:q,toolbar:M,size:h?"full":"default",containerClassName:"h-full",showLegend:S,onUnselectSeries:C,yMeasureUnit:N})})}exports.TradingView=Q;
@@ -1,10 +1,10 @@
1
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { cva as N } from "class-variance-authority";
3
- import * as b from "react";
4
- import { useRef as v, useState as w, useEffect as k } from "react";
5
- import { cn as j } from "../../utils/cn.js";
6
- import { Graph as W } from "./graph.js";
7
- const V = N(
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import { cva as k } from "class-variance-authority";
3
+ import * as y from "react";
4
+ import { useRef as p, useState as j, useEffect as R } from "react";
5
+ import { cn as N } from "../../utils/cn.js";
6
+ import { Graph as V } from "./graph.js";
7
+ const W = k(
8
8
  "relative w-full overflow-hidden rounded-lg border-border border bg-card text-card-foreground",
9
9
  {
10
10
  variants: {
@@ -34,45 +34,45 @@ const V = N(
34
34
  padding: "default"
35
35
  }
36
36
  }
37
- ), g = b.forwardRef(
37
+ ), w = y.forwardRef(
38
38
  ({
39
- className: i,
40
- variant: r,
41
- size: a,
39
+ className: t,
40
+ variant: s,
41
+ size: r,
42
42
  padding: m,
43
- title: s,
44
- description: n,
45
- toolbar: t,
46
- loading: c = !1,
43
+ title: n,
44
+ description: l,
45
+ toolbar: a,
46
+ loading: i = !1,
47
47
  emptyMessage: o,
48
- error: l,
48
+ error: d,
49
49
  children: h,
50
- ...u
51
- }, x) => {
52
- const f = s || n || t;
53
- return /* @__PURE__ */ d(
50
+ ...f
51
+ }, u) => {
52
+ const x = n || l || a;
53
+ return /* @__PURE__ */ c(
54
54
  "div",
55
55
  {
56
- ref: x,
57
- className: j(
56
+ ref: u,
57
+ className: N(
58
58
  "flex flex-col",
59
- V({ variant: r, size: a, padding: m, className: i })
59
+ W({ variant: s, size: r, padding: m, className: t })
60
60
  ),
61
- ...u,
61
+ ...f,
62
62
  children: [
63
- f && /* @__PURE__ */ d("div", { className: "mb-4 flex items-start justify-between gap-4 flex-shrink-0", children: [
64
- (s || n) && /* @__PURE__ */ d("div", { className: "flex-1", children: [
65
- s && /* @__PURE__ */ e("h3", { className: "text-base sm:text-lg font-semibold leading-none tracking-tight", children: s }),
66
- n && /* @__PURE__ */ e("p", { className: "mt-1 text-xs sm:text-sm text-muted-foreground", children: n })
63
+ x && /* @__PURE__ */ c("div", { className: "mb-4 flex items-start justify-between gap-4 flex-shrink-0", children: [
64
+ (n || l) && /* @__PURE__ */ c("div", { className: "flex-1", children: [
65
+ n && /* @__PURE__ */ e("h3", { className: "text-base sm:text-lg font-semibold leading-none tracking-tight", children: n }),
66
+ l && /* @__PURE__ */ e("p", { className: "mt-1 text-xs sm:text-sm text-muted-foreground", children: l })
67
67
  ] }),
68
- t && /* @__PURE__ */ e("div", { className: "flex-shrink-0 w-full", children: t })
68
+ a && /* @__PURE__ */ e("div", { className: "flex-shrink-0 w-full", children: a })
69
69
  ] }),
70
- /* @__PURE__ */ d("div", { className: "relative flex-1 w-full min-h-0", children: [
71
- c && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center bg-transparent backdrop-blur-sm", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-2", children: [
70
+ /* @__PURE__ */ c("div", { className: "relative flex-1 w-full min-h-0", children: [
71
+ i && /* @__PURE__ */ e("div", { className: "absolute inset-0 z-10 flex items-center justify-center opacity-0 animate-delayed-fade-in", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2", children: [
72
72
  /* @__PURE__ */ e("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" }),
73
73
  /* @__PURE__ */ e("span", { className: "text-xs sm:text-sm text-muted-foreground", children: "Loading..." })
74
74
  ] }) }),
75
- l && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-2 text-destructive", children: [
75
+ d && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2 text-destructive", children: [
76
76
  /* @__PURE__ */ e(
77
77
  "svg",
78
78
  {
@@ -92,9 +92,9 @@ const V = N(
92
92
  )
93
93
  }
94
94
  ),
95
- /* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: l })
95
+ /* @__PURE__ */ e("span", { className: "text-xs sm:text-sm font-medium", children: d })
96
96
  ] }) }),
97
- !l && !h && o && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ d("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
97
+ !d && !h && o && /* @__PURE__ */ e("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-2 text-muted-foreground", children: [
98
98
  /* @__PURE__ */ e(
99
99
  "svg",
100
100
  {
@@ -116,71 +116,82 @@ const V = N(
116
116
  ),
117
117
  /* @__PURE__ */ e("span", { className: "text-xs sm:text-sm", children: o })
118
118
  ] }) }),
119
- !l && h
119
+ /* @__PURE__ */ e(
120
+ "div",
121
+ {
122
+ className: N(
123
+ "w-full h-full transition-[filter] duration-300 delay-300",
124
+ i && "blur-sm pointer-events-none"
125
+ ),
126
+ children: !d && h
127
+ }
128
+ )
120
129
  ] })
121
130
  ]
122
131
  }
123
132
  );
124
133
  }
125
134
  );
126
- g.displayName = "GraphView";
127
- function H({
128
- series: i,
129
- onUnselectSeries: r,
130
- loading: a,
135
+ w.displayName = "GraphView";
136
+ function S({
137
+ series: t,
138
+ onUnselectSeries: s,
139
+ loading: r,
131
140
  title: m,
132
- description: s,
133
- toolbar: n,
134
- emptyMessage: t = "No data available",
135
- error: c,
141
+ description: n,
142
+ toolbar: l,
143
+ emptyMessage: a = "No data available",
144
+ error: i,
136
145
  containerClassName: o,
137
- variant: l,
146
+ variant: d,
138
147
  size: h,
139
- padding: u,
140
- ...x
148
+ padding: f,
149
+ ...u
141
150
  }) {
142
- const f = i.length > 0, p = !a && !f;
151
+ const x = !r && t.length === 0, v = p(t);
152
+ t.length > 0 && (v.current = t);
153
+ const g = r && t.length === 0 ? v.current : t, b = g.length > 0;
143
154
  return /* @__PURE__ */ e(
144
- g,
155
+ w,
145
156
  {
146
157
  className: o,
147
- variant: l,
158
+ variant: d,
148
159
  size: h,
149
- padding: u,
160
+ padding: f,
150
161
  title: m,
151
- description: s,
152
- toolbar: n,
153
- loading: a,
154
- error: c,
155
- emptyMessage: p ? t : void 0,
156
- children: f && !p && !a && /* @__PURE__ */ e(
157
- W,
162
+ description: n,
163
+ toolbar: l,
164
+ loading: r,
165
+ error: i,
166
+ emptyMessage: x ? a : void 0,
167
+ children: b && !i && /* @__PURE__ */ e(
168
+ V,
158
169
  {
159
- series: i,
160
- ...r ? { onUnselectSeries: r } : {},
161
- ...x
170
+ series: g,
171
+ ...s ? { onUnselectSeries: s } : {},
172
+ ...u
162
173
  }
163
174
  )
164
175
  }
165
176
  );
166
177
  }
167
- function D(i = 0) {
168
- const r = v(null), a = v(null), [m, s] = w(null);
169
- return k(() => {
170
- const n = () => {
171
- if (r.current && a.current) {
172
- const o = a.current.clientWidth, l = r.current.clientWidth;
173
- s(o - l - i);
178
+ function A(t = 0) {
179
+ const s = p(null), r = p(null), [m, n] = j(null);
180
+ return R(() => {
181
+ const l = () => {
182
+ if (s.current && r.current) {
183
+ const o = r.current.clientWidth, d = s.current.clientWidth;
184
+ n(o - d - t);
174
185
  }
175
- }, t = a.current, c = t ? new ResizeObserver(n) : null;
176
- return t && c?.observe(t), () => {
177
- t && c?.unobserve(t);
186
+ }, a = r.current, i = a ? new ResizeObserver(l) : null;
187
+ return a && i?.observe(a), () => {
188
+ a && i?.unobserve(a);
178
189
  };
179
- }, [i]), { graphWidth: m, parentRef: a, asideRef: r };
190
+ }, [t]), { graphWidth: m, parentRef: r, asideRef: s };
180
191
  }
181
192
  export {
182
- g as GraphView,
183
- H as GraphViewWithData,
184
- V as graphViewVariants,
185
- D as useGraphAside
193
+ w as GraphView,
194
+ S as GraphViewWithData,
195
+ W as graphViewVariants,
196
+ A as useGraphAside
186
197
  };