@odigos/ui-kit 0.0.257 → 0.0.258

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/lib/chunks/{connections-scope-RiHZnCRk.js → connections-scope-DgpFs9S1.js} +1 -1
  3. package/lib/chunks/{helpers-CUmUiA_l.js → helpers-BlFl20R2.js} +2 -2
  4. package/lib/chunks/index-BVL5-zQa.js +155 -0
  5. package/lib/chunks/{source-instrument-form-context-8HLrHGI9.js → source-instrument-form-context-o2ynNRPg.js} +1 -1
  6. package/lib/chunks/ui-components-BmIux5o5.js +1692 -0
  7. package/lib/chunks/{use-odigos-api-DnIoW4_W.js → use-odigos-api-hslZLdix.js} +2 -2
  8. package/lib/components/_v2/autocomplete/index.d.ts +4 -0
  9. package/lib/components/_v2/badge/index.d.ts +2 -2
  10. package/lib/components/_v2/cards/status-card/index.d.ts +2 -2
  11. package/lib/components/_v2/condition/index.d.ts +2 -2
  12. package/lib/components/_v2/drop-data/index.d.ts +2 -0
  13. package/lib/components/_v2/table/index.d.ts +4 -0
  14. package/lib/components/_v2/table/styled.d.ts +1 -0
  15. package/lib/components/_v2/table/table-rows/index.d.ts +6 -0
  16. package/lib/components/_v2/table/types.d.ts +6 -0
  17. package/lib/components/scroll-y/index.d.ts +4 -0
  18. package/lib/components/v2.js +1 -1
  19. package/lib/components.js +1 -1
  20. package/lib/constants.js +1 -1
  21. package/lib/containers/_v2/_drawers/edit-rule-drawer/helpers.d.ts +1 -1
  22. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/flame-graph-canvas.d.ts +6 -0
  23. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/flamebearer.d.ts +3 -1
  24. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/symbol-table/index.d.ts +34 -0
  25. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/symbol-table/modify-rules-modal.d.ts +10 -0
  26. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/symbol-table/symbol-instrumentation.d.ts +86 -0
  27. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/symbol-table/use-symbol-instrumentation.d.ts +69 -0
  28. package/lib/containers/service-map/react-flow/columns/active-node-info.d.ts +2 -0
  29. package/lib/containers/service-map/react-flow/columns/column-root.d.ts +4 -0
  30. package/lib/containers/service-map/react-flow/{search-and-select-nodes.d.ts → columns/search-and-select-nodes.d.ts} +0 -1
  31. package/lib/containers/service-map/service-map-context.d.ts +3 -3
  32. package/lib/containers/v2.js +158 -143
  33. package/lib/containers.js +30 -12
  34. package/lib/contexts/odigos-api.js +1 -1
  35. package/lib/contexts.js +1 -1
  36. package/lib/functions/get-health-badge-label/index.d.ts +2 -2
  37. package/lib/functions/get-status-color/index.d.ts +2 -2
  38. package/lib/functions/get-status-from-pod-status/index.d.ts +2 -2
  39. package/lib/functions/get-status-icon/index.d.ts +2 -2
  40. package/lib/functions/get-status-type-from-odigos-health/index.d.ts +2 -2
  41. package/lib/functions/map-desired-status-to-condition-status/index.d.ts +2 -2
  42. package/lib/functions.js +1 -1
  43. package/lib/hooks.js +1 -1
  44. package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +1 -1
  45. package/lib/snippets/v2.js +1 -1
  46. package/lib/snippets.js +1 -1
  47. package/lib/store/useProgressStore.d.ts +2 -2
  48. package/lib/store.js +1 -1
  49. package/lib/theme.js +1 -1
  50. package/lib/types/common/index.d.ts +5 -10
  51. package/lib/types/sampling.d.ts +2 -0
  52. package/lib/types.js +1 -1
  53. package/lib/visuals.js +1 -1
  54. package/package.json +1 -1
  55. package/lib/chunks/index-hiRPXsEi.js +0 -155
  56. package/lib/chunks/ui-components-B1TCLO_N.js +0 -1666
  57. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/symbol-table.d.ts +0 -21
package/lib/containers.js CHANGED
@@ -1,15 +1,15 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useTheme as r}from"styled-components";import{memo as a,useState as s,useCallback as n,useEffect as d,useMemo as l,createContext as c,useContext as p,useRef as u}from"react";import{U as m}from"./chunks/consts-D6GCMJ6c.js";import{MarkerType as g,useNodesState as h,useEdgesState as f,Handle as v,Position as y,getSmoothStepPath as N,BaseEdge as S,EdgeLabelRenderer as b,ReactFlowProvider as x,ReactFlow as w,Background as k,Controls as M,ControlButton as T,useReactFlow as C}from"@xyflow/react";import{N as I,o as $,p as E,q as K,r as V,v as _,w as z,b as A,c as L,x as R,y as X,B as j,z as D,L as P,M as q,O as G,Q as F,R as H}from"./chunks/ui-components-B1TCLO_N.js";import{UserIcon as O,ImageErrorIcon as B,RefreshIcon as U}from"./icons.js";import Y from"elkjs/lib/elk.bundled.js";import{d as W}from"./chunks/use-odigos-api-DnIoW4_W.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const Z=o.div`
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useTheme as r}from"styled-components";import{memo as n,useState as a,useCallback as s,useEffect as d,useMemo as l,createContext as c,useContext as p,useRef as u}from"react";import{U as h}from"./chunks/consts-D6GCMJ6c.js";import{MarkerType as g,useNodesState as m,useEdgesState as f,Handle as v,Position as y,getSmoothStepPath as b,BaseEdge as x,EdgeLabelRenderer as N,ReactFlowProvider as S,ReactFlow as I,Background as w,Controls as $,ControlButton as k,useReactFlow as M}from"@xyflow/react";import{N as C,o as T,p as A,q as E,r as z,v as X,w as K,b as R,c as V,x as O,y as _,B as q,z as L,L as j,M as H,O as D,Q as G,R as P,U as B,V as F,W as U,X as Y,Y as W}from"./chunks/ui-components-BmIux5o5.js";import{UserIcon as Z,ImageErrorIcon as Q,ArrowLeftIcon as J,InboundIcon as ee,OutboundIcon as te,RefreshIcon as ie}from"./icons.js";import oe from"elkjs/lib/elk.bundled.js";import{d as re}from"./chunks/use-odigos-api-hslZLdix.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const ne=o.div`
2
2
  padding: 12px;
3
3
  border-radius: 12px;
4
4
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
5
- `,Q=a(({id:t,data:i})=>e(Z,{"data-id":t,children:e(I,{...i})}));Q.displayName=Q.name;var J,ee;!function(e){e.MapItem="map-item",e.NoData="no-data"}(J||(J={})),function(e){e.AnimatedTraffic="animated-traffic"}(ee||(ee={}));const te=(e,t,i)=>{if(i)return{icons:[O],selected:!0};const o=e.isVirtual,r=o?[K(e)]:t?V(t):[B],{priorotizedStatus:a}=o?{priorotizedStatus:void 0}:_(t?.conditions||[]);return{icons:r,status:a,isVirtual:o,aggService:e,selected:!0}},ie=e=>!(!e||e.serviceName!==m||e.id.namespace||e.id.name||e.id.kind),oe=new Y,re={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},ae=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},se={id:{namespace:"",name:"",kind:""},serviceName:m,markedForInstrumentation:{markedForInstrumentation:!0}},ne=c(null),de=()=>{const e=p(ne);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},le=({serviceMap:t,children:i})=>{const o=r(),{sourcesApi:a}=W(),{items:c}=a.useSources(),[p,u,v]=h([]),[y,N,S]=f([]),[b,x]=s(0),w=n(()=>x(e=>e+1),[]),[k,M]=s(""),[T,C]=s(null),[I,K]=s(null),V=n(e=>{K(t=>t===e?null:e)},[]),_=n((e,t)=>{const i=new Set(e);u(e=>e.map(e=>e.type===J.MapItem&&i.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[u]),z=n(()=>{K(null)},[]);d(()=>{let e=!1;const i=(e=>{const t=new Map,i=new Set,o=(e,i,o=!1)=>{let r=t.get(e);return r||(r={serviceName:i,isVirtual:o,attributes:{},connectionMap:new Map},t.set(e,r)),r},r=(e,t)=>{if(t)for(const{key:i,value:o}of t)i in e||(e[i]=o)};for(const t of e){const{graphKey:e}=ae(t.nodeId),a=o(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:s}=ae(e?.nodeId??"");e.isVirtual&&(i.add(t),r(o(t,e.serviceName,!0).attributes,e.nodeAttributes));let n=a.connectionMap.get(t);if(n||(n={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,n)),n.totalRequests+=e.requests,e.dateTime>n.lastDateTime&&(n.lastDateTime=e.dateTime),s){const t=n.details.find(e=>e.value===s);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):n.details.push({value:s,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[r,a]of e)t.has(r)||o(r,a.targetServiceName,i.has(r));const s=[];for(const[e,{serviceName:i,isVirtual:o,attributes:r,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),s.push({graphKey:e,serviceName:i,isVirtual:o,connections:t,attributes:r})}return s.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),s})(t),r=(({sources:e,aggregatedServiceMap:t})=>{const i=[],o={x:0,y:0};if(t.length&&e.length)for(const r of t){const t=e.find(e=>r.serviceName===e.serviceName||r.serviceName===e.id.name),a=ie(t);i.push({id:r.graphKey,type:J.MapItem,position:o,data:te(r,t,a),measured:{width:80,height:80}})}else i.push({id:J.NoData,type:J.NoData,position:o,data:{subTitle:E.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return i})({aggregatedServiceMap:i,sources:[se].concat(c)});if(1===r.length&&r[0].id===J.NoData)return u(r),N([]),M(""),void w();const a=(({theme:e,nodes:t,aggregatedServiceMap:i})=>{const o=[],r=new Map(t.map(e=>[e.id,e]));for(const t of i){const i=t.graphKey,a=r.get(i);if(!a)continue;const s=a.data?.status===$.Error;for(const a of t.connections){const n=a.targetGraphKey;r.has(n)&&o.push({id:`${i}-to-${n}`,type:"smoothstep",source:i,target:n,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:g.ArrowClosed},style:{stroke:s?e?.colors.dark_red:e?.colors.border}})}}return o})({theme:o,nodes:r,aggregatedServiceMap:i});N(a);const s=r.map(e=>e.id).sort().join("|");if(s!==k)return(async(e,t,i={})=>{const o={id:"root",layoutOptions:{...re,...i},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===m?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},r=await oe.layout(o),a=new Map;return r.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(r,a).then(({nodes:t})=>{e||(u(t),M(s),w())}),()=>{e=!0};u(e=>{const t=new Map(e.map(e=>[e.id,e]));return r.map(e=>{const i=t.get(e.id);return i?e.type===J.MapItem&&i.type===J.MapItem?{...e,position:i.position,data:{...e.data,selected:i.data.selected}}:{...e,position:i.position}:e})})},[o,t,c,k]);const A=l(()=>T||I?y.map(e=>{if(e.source===T||e.target===T||e.source===I||e.target===I)return{...e,type:ee.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):y,[y,T,I]),L=l(()=>({nodes:p,edges:A,onNodesChange:v,onEdgesChange:S,setNodesSelected:_,fitViewTrigger:b,hoveredNodeId:T,setHoveredNodeId:C,selectedNodeId:I,toggleSelectedNode:V,resetSelectedNode:z}),[p,A,v,S,_,b,T,I,V,z]);return e(ne.Provider,{value:L,children:i})},ce=o.div`
5
+ `,ae=n(({id:t,data:i})=>e(ne,{"data-id":t,children:e(C,{...i})}));ae.displayName=ae.name;var se,de;!function(e){e.MapItem="map-item",e.NoData="no-data"}(se||(se={})),function(e){e.AnimatedTraffic="animated-traffic"}(de||(de={}));const le=(e,t,i)=>{if(i)return{icons:[Z],aggService:e,selected:!0};const o=e.isVirtual,r=o?[E(e)]:t?z(t):[Q],{priorotizedStatus:n}=o?{priorotizedStatus:void 0}:X(t?.conditions||[]);return{icons:r,status:n,isVirtual:o,aggService:e,selected:!0}},ce=e=>!(!e||e.serviceName!==h||e.id.namespace||e.id.name||e.id.kind),pe=new oe,ue={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},he=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},ge={id:{namespace:"",name:"",kind:""},serviceName:h,markedForInstrumentation:{markedForInstrumentation:!0}},me=c(null),fe=()=>{const e=p(me);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},ve=({serviceMap:t,children:i})=>{const o=r(),{sourcesApi:n}=re(),{items:c}=n.useSources(),[p,u,v]=m([]),[y,b,x]=f([]),[N,S]=a(0),I=s(()=>S(e=>e+1),[]),[w,$]=a(""),[k,M]=a(null),[C,E]=a(null),z=s(e=>E(t=>t===e?null:e),[]),X=s(()=>E(null),[]),K=s((e,t)=>{const i=new Set(e);u(e=>e.map(e=>e.type===se.MapItem&&i.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[u]);d(()=>{let e=!1;const i=(e=>{const t=new Map,i=new Set,o=(e,i,o=!1)=>{let r=t.get(e);return r||(r={serviceName:i,isVirtual:o,attributes:{},connectionMap:new Map},t.set(e,r)),r},r=(e,t)=>{if(t)for(const{key:i,value:o}of t)i in e||(e[i]=o)};for(const t of e){const{graphKey:e}=he(t.nodeId),n=o(e,t.serviceName);n.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:a}=he(e?.nodeId??"");e.isVirtual&&(i.add(t),r(o(t,e.serviceName,!0).attributes,e.nodeAttributes));let s=n.connectionMap.get(t);if(s||(s={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},n.connectionMap.set(t,s)),s.totalRequests+=e.requests,e.dateTime>s.lastDateTime&&(s.lastDateTime=e.dateTime),a){const t=s.details.find(e=>e.value===a);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):s.details.push({value:a,requests:e.requests,dateTime:e.dateTime})}}}const n=[...t.entries()];for(const[,{connectionMap:e}]of n)for(const[r,n]of e)t.has(r)||o(r,n.targetServiceName,i.has(r));const a=[];for(const[e,{serviceName:i,isVirtual:o,attributes:r,connectionMap:n}]of t){const t=[...n.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),a.push({graphKey:e,serviceName:i,isVirtual:o,connections:t,attributes:r})}return a.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),a})(t),r=(({sources:e,aggregatedServiceMap:t})=>{const i=[],o={x:0,y:0};if(t.length&&e.length)for(const r of t){const t=e.find(e=>r.serviceName===e.serviceName||r.serviceName===e.id.name),n=ce(t);i.push({id:r.graphKey,type:se.MapItem,position:o,data:le(r,t,n),measured:{width:80,height:80}})}else i.push({id:se.NoData,type:se.NoData,position:o,data:{subTitle:A.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return i})({aggregatedServiceMap:i,sources:[ge].concat(c)});if(1===r.length&&r[0].id===se.NoData)return u(r),b([]),$(""),void I();const n=(({theme:e,nodes:t,aggregatedServiceMap:i})=>{const o=[],r=new Map(t.map(e=>[e.id,e]));for(const t of i){const i=t.graphKey,n=r.get(i);if(!n)continue;const a=n.data?.status===T.Error;for(const n of t.connections){const s=n.targetGraphKey;r.has(s)&&o.push({id:`${i}-to-${s}`,type:"smoothstep",source:i,target:s,data:{sourceGraphKey:t.graphKey,targetGraphKey:n.targetGraphKey},markerEnd:{type:g.ArrowClosed},style:{stroke:a?e?.colors.dark_red:e?.colors.border}})}}return o})({theme:o,nodes:r,aggregatedServiceMap:i});b(n);const a=r.map(e=>e.id).sort().join("|");if(a!==w)return(async(e,t,i={})=>{const o={id:"root",layoutOptions:{...ue,...i},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===h?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},r=await pe.layout(o),n=new Map;return r.children?.forEach(e=>{n.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:n.get(e.id)??e.position})),edges:t}})(r,n).then(({nodes:t})=>{e||(u(t),$(a),I())}),()=>{e=!0};u(e=>{const t=new Map(e.map(e=>[e.id,e]));return r.map(e=>{const i=t.get(e.id);return i?e.type===se.MapItem&&i.type===se.MapItem?{...e,position:i.position,data:{...e.data,selected:i.data.selected}}:{...e,position:i.position}:e})})},[o,t,c,w]);const R=l(()=>k||C?y.map(e=>{if(e.source===k||e.target===k||e.source===C||e.target===C)return{...e,type:de.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):y,[y,k,C]),V=l(()=>({nodes:p,edges:R,onNodesChange:v,onEdgesChange:x,setNodesSelected:K,fitViewTrigger:N,hoveredNodeId:k,setHoveredNodeId:M,activeNodeId:C,toggleActiveNode:z,resetActiveNode:X}),[p,R,v,x,K,N,k,C,z,X]);return e(me.Provider,{value:V,children:i})},ye=o.div`
6
6
  border: 1px ${({theme:e,$isSelected:t,$isVirtual:i})=>t?`solid ${e.v2.colors.blue[300]}`:i?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
7
7
  border-radius: 8px;
8
8
  cursor: pointer;
9
9
  opacity: ${({$isVirtual:e})=>e?.8:1};
10
- `,pe=o.div`
10
+ `,be=o.div`
11
11
  position: relative;
12
- `,ue=o.div`
12
+ `,xe=o.div`
13
13
  position: absolute;
14
14
  top: 100%;
15
15
  left: 50%;
@@ -18,7 +18,7 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
18
18
  align-items: center;
19
19
  gap: 4px;
20
20
  margin-top: 4px;
21
- `,me=a(({id:o,data:a})=>{const{icons:s,status:n,isVirtual:d}=a,c=r(),{selectedNodeId:p,hoveredNodeId:u}=de(),{isUserSource:g,isNodeSelected:h,isHovered:f}=l(()=>({isUserSource:o===m,isNodeSelected:p===o,isHovered:u===o}),[o,p,u,o]),{isSelected:N,isHighlighted:S}=l(()=>({isSelected:h||g,isHighlighted:h||f||g}),[h,f,g]),b=n?R(n,c):null;return t(i,{children:[e(v,{type:"source",position:y.Right,style:{visibility:"hidden"}}),e(v,{type:"target",position:y.Left,style:{visibility:"hidden"}}),t(pe,{"data-id":o,children:[e(ce,{$isSelected:N,$isVirtual:d,children:e(z,{padding:12,icons:s,status:S?$.Info:n})}),t(ue,{children:[b&&e(b,{}),e(A,{size:L.XXS,nowrap:!0,children:o})]})]})]})});me.displayName=me.name;const ge=o.div`
21
+ `,Ne=n(({id:o,data:n})=>{const{icons:a,status:s,isVirtual:d}=n,c=r(),{activeNodeId:p,hoveredNodeId:u}=fe(),{isUserSource:g,isNodeSelected:m,isHovered:f}=l(()=>({isUserSource:o===h,isNodeSelected:p===o,isHovered:u===o}),[o,p,u,o]),{isSelected:b,isHighlighted:x}=l(()=>({isSelected:m||g,isHighlighted:m||f||g}),[m,f,g]),N=s?O(s,c):null;return t(i,{children:[e(v,{type:"source",position:y.Right,style:{visibility:"hidden"}}),e(v,{type:"target",position:y.Left,style:{visibility:"hidden"}}),t(be,{"data-id":o,children:[e(ye,{$isSelected:b,$isVirtual:d,children:e(K,{padding:12,icons:a,status:x?T.Info:s})}),t(xe,{children:[N&&e(N,{}),e(R,{size:V.XXS,nowrap:!0,children:o})]})]})]})});Ne.displayName=Ne.name;const Se=o.div`
22
22
  display: flex;
23
23
  flex-direction: column;
24
24
  gap: 12px;
@@ -31,10 +31,28 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
31
31
  top: 16px;
32
32
  left: 8px;
33
33
  z-index: ${({theme:e})=>e.v2.zIndex.drawer};
34
- `,he=o.div`
34
+ `,Ie=({children:t})=>e(Se,{children:t});var we,$e;!function(e){e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"}(we||(we={})),function(e){e.Inbound="Inbound",e.Outbound="Outbound"}($e||($e={}));const ke=o.div`
35
35
  flex: 1 1 auto;
36
36
  min-height: 0;
37
- `,fe=({})=>{const{nodes:i,setNodesSelected:o,resetSelectedNode:r}=de(),[a,d]=s(""),c=l(()=>i.filter(e=>e.type===J.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[i]),p=l(()=>c.filter(e=>e.data.selected),[c]),u=l(()=>c.filter(e=>e.id.toLowerCase().includes(a.toLowerCase())),[c,a]),m=l(()=>u.every(e=>e.data.selected),[u]),g=n(()=>{const e=!m;o(u.map(e=>e.id),e),e||r()},[u,m,o,r]);return c.length?t(ge,{children:[t(X,{$width:"100%",$gap:8,children:[e(A,{size:L.XS,children:"Services"}),e(j,{label:c.length})]}),e(D,{width:"100%",value:a,onChange:d}),t(X,{$width:"100%",$justifyContent:"space-between",children:[e(A,{size:L.XXXS,children:`Showing ${p.length} out of ${c.length}`}),e(A,{"data-id":"namespaces-select-all",onClick:g,disabled:!u.length,size:L.XS,children:m?E.UNSELECT_ALL:E.SELECT_ALL})]}),e(he,{children:e(P,{gap:4,elements:u.map(t=>e(ye,{node:t},t.id))})})]}):null},ve=o.div`
37
+ `,Me=()=>{const{nodes:i,activeNodeId:o,resetActiveNode:r}=fe(),[n,s]=a(we.All),d=l(()=>{const e=new Map;for(const t of i)t.type===se.MapItem&&e.set(t.id,t);return e},[i]),c=l(()=>d.get(o??""),[d,o]),{inbound:p,outbound:u}=l(()=>{const e=[],t=[];if(!c)return{inbound:e,outbound:t};for(const e of c.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:$e.Outbound,totalRequests:e.totalRequests});for(const t of d.values())if(t.id!==c.id)for(const i of t.data.aggService?.connections??[])i.targetGraphKey===c.id&&e.push({peerId:t.id,direction:$e.Inbound,totalRequests:i.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[c,d]);if(!c)return null;const h=[we.All,we.Inbound].includes(n)&&p.length>0,g=[we.All,we.Outbound].includes(n)&&u.length>0;return t(Ie,{children:[t(_,{$width:"100%",$gap:8,children:[e(q,{variant:j.Text,size:L.S,leftIcon:J,onClick:r}),e(K,{icons:c.data.icons}),e(R,{size:V.XS,children:c.id})]}),e(H,{fullWidth:!0,options:[{label:`${we.All}`,value:we.All,badge:{label:`${p.length+u.length}`}},{label:`${we.Inbound}`,value:we.Inbound,badge:{label:`${p.length}`}},{label:`${we.Outbound}`,value:we.Outbound,badge:{label:`${u.length}`}}],selected:n,setSelected:s}),h&&e(Te,{halfHeight:g,title:"Inbound",icon:ee,connections:p,mapNodesById:d}),g&&e(Te,{halfHeight:h,title:"Outbound",icon:te,connections:u,mapNodesById:d})]})},Ce=o.div`
38
+ display: flex;
39
+ flex-direction: column;
40
+ gap: 8px;
41
+ padding: 12px 8px;
42
+ border-radius: 12px;
43
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
44
+ height: ${({$halfHeight:e})=>e?"48%":"100%"};
45
+ `,Te=({halfHeight:i,title:o,icon:n,connections:a,mapNodesById:s})=>{const d=r();return t(Ce,{$halfHeight:i,children:[t(_,{children:[e(n,{size:16,fill:d.v2.colors.grey[300]}),e(R,{size:V.XXS,color:D.Secondary,children:o})]}),e(ke,{children:e(G,{gap:4,elements:a.map(t=>e(Ee,{connection:t,peerNode:s.get(t.peerId)},`${t.direction}-${t.peerId}`))})})]})},Ae=o.div`
46
+ display: flex;
47
+ align-items: center;
48
+ gap: 8px;
49
+ padding: 8px;
50
+ border-radius: 8px;
51
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
52
+ `,Ee=({connection:i,peerNode:o})=>t(Ae,{children:[o&&e(K,{icons:o.data.icons}),t(_,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[e(R,{size:V.XXS,children:i.peerId}),e(P,{label:i.totalRequests,tooltip:"Total requests"})]})]}),ze="0;0.5;1",Xe=n(({id:o,sourceX:n,sourceY:a,targetX:s,targetY:d,sourcePosition:l,targetPosition:c,markerEnd:p})=>{const u=r(),[h]=b({sourceX:n,sourceY:a,targetX:s,targetY:d,sourcePosition:l,targetPosition:c}),g=`${o}__animated-traffic-motion`,m=u.v2.colors.blue[700],f=u.v2.colors.blue[900],v=u.v2.colors.blue[500],y="4s";return t(i,{children:[e(x,{id:o,path:h,markerEnd:p,style:{stroke:m,strokeWidth:1}}),e(N,{children:t("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[e("path",{id:g,d:h,fill:"none",stroke:"none"}),Array.from({length:5}).map((i,o)=>{const r=`-${(.8*o).toFixed(3)}s`;return t("circle",{r:0,fill:f,children:[e("animateMotion",{dur:y,begin:r,repeatCount:"indefinite",children:e("mpath",{href:`#${g}`})}),e("animate",{attributeName:"r",dur:y,begin:r,repeatCount:"indefinite",keyTimes:ze,values:"0;3.5;3.5"}),e("animate",{attributeName:"fill",dur:y,begin:r,repeatCount:"indefinite",keyTimes:ze,values:`${f};${v};${v}`})]},o)})]})})]})});Xe.displayName=Xe.name;const Ke=o.div`
53
+ flex: 1 1 auto;
54
+ min-height: 0;
55
+ `,Re=({})=>{const{nodes:i,setNodesSelected:o,resetActiveNode:r}=fe(),[n,d]=a(""),c=l(()=>i.filter(e=>e.type===se.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[i]),p=l(()=>c.filter(e=>e.data.selected),[c]),u=l(()=>c.filter(e=>e.id.toLowerCase().includes(n.toLowerCase())),[c,n]),h=l(()=>u.every(e=>e.data.selected),[u]),g=s(()=>{const e=!h;o(u.map(e=>e.id),e),e||r()},[u,h,o,r]);return c.length?t(Ie,{children:[t(_,{$width:"100%",$gap:8,children:[e(R,{size:V.XS,children:"Services"}),e(P,{label:c.length})]}),e(B,{width:"100%",value:n,onChange:d}),t(_,{$width:"100%",$justifyContent:"space-between",children:[e(R,{size:V.XXXS,children:`Showing ${p.length} out of ${c.length}`}),e(R,{"data-id":"namespaces-select-all",onClick:g,disabled:!u.length,size:V.XS,children:h?A.UNSELECT_ALL:A.SELECT_ALL})]}),e(Ke,{children:e(G,{gap:4,elements:u.map(t=>e(Oe,{node:t},t.id))})})]}):null},Ve=o.div`
38
56
  display: flex;
39
57
  align-items: center;
40
58
  gap: 8px;
@@ -42,7 +60,7 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
42
60
  border-radius: 8px;
43
61
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
44
62
  cursor: pointer;
45
- `,ye=({node:i})=>{const{setNodesSelected:o,selectedNodeId:r,resetSelectedNode:a}=de(),s=n(()=>{const e=!i.data.selected,t=r===i.id;o([i.id],e),!e&&t&&a()},[i,r,o,a]);return t(ve,{onClick:s,children:[e(q,{value:i.data.selected||!1,onChange:s}),e(z,{icons:i.data.icons}),e(A,{size:L.XXS,children:i.id})]},i.id)},Ne="0;0.5;1",Se=a(({id:o,sourceX:a,sourceY:s,targetX:n,targetY:d,sourcePosition:l,targetPosition:c,markerEnd:p})=>{const u=r(),[m]=N({sourceX:a,sourceY:s,targetX:n,targetY:d,sourcePosition:l,targetPosition:c}),g=`${o}__animated-traffic-motion`,h=u.v2.colors.blue[700],f=u.v2.colors.blue[900],v=u.v2.colors.blue[500],y="4s";return t(i,{children:[e(S,{id:o,path:m,markerEnd:p,style:{stroke:h,strokeWidth:1}}),e(b,{children:t("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[e("path",{id:g,d:m,fill:"none",stroke:"none"}),Array.from({length:5}).map((i,o)=>{const r=`-${(.8*o).toFixed(3)}s`;return t("circle",{r:0,fill:f,children:[e("animateMotion",{dur:y,begin:r,repeatCount:"indefinite",children:e("mpath",{href:`#${g}`})}),e("animate",{attributeName:"r",dur:y,begin:r,repeatCount:"indefinite",keyTimes:Ne,values:"0;3.5;3.5"}),e("animate",{attributeName:"fill",dur:y,begin:r,repeatCount:"indefinite",keyTimes:Ne,values:`${f};${v};${v}`})]},o)})]})})]})});Se.displayName=Se.name;const be=o.div`
63
+ `,Oe=({node:i})=>{const{setNodesSelected:o,activeNodeId:r,resetActiveNode:n}=fe(),a=s(()=>{const e=!i.data.selected,t=r===i.id;o([i.id],e),!e&&t&&n()},[i,r,o,n]);return t(Ve,{onClick:a,children:[e(F,{value:i.data.selected||!1,onChange:a}),e(K,{icons:i.data.icons}),e(R,{size:V.XXS,children:i.id})]},i.id)},_e=o.div`
46
64
  position: relative;
47
65
  height: 100%;
48
66
  .react-flow__attribution {
@@ -51,7 +69,7 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
51
69
  * {
52
70
  transition: none;
53
71
  }
54
- `,xe=o.div`
72
+ `,qe=o.div`
55
73
  .react-flow__controls {
56
74
  display: flex;
57
75
  align-items: center;
@@ -77,14 +95,14 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
77
95
  }
78
96
  }
79
97
  }
80
- `,we={[J.MapItem]:me,[J.NoData]:Q},ke={[ee.AnimatedTraffic]:Se},Me={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Te=({trigger:e})=>{const{fitView:t}=C(),i=u(!0);return d(()=>{i.current?i.current=!1:e>0&&requestAnimationFrame(()=>t(Me))},[e,t]),null},Ce=({onRefresh:i})=>{const{nodes:o,edges:r,fitViewTrigger:a,onNodesChange:s,onEdgesChange:n,setHoveredNodeId:d,toggleSelectedNode:c}=de(),p=l(()=>{const e=new Set(o.filter(e=>e.type===J.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const i of r)e.has(i.source)&&t.add(i.target),e.has(i.target)&&t.add(i.source);return o.filter(e=>e.type!==J.MapItem||e.data.selected||t.has(e.id))},[o,r]);return t(w,{zoomOnScroll:!0,nodes:p,nodeTypes:we,edges:r,edgeTypes:ke,onNodeClick:(e,t)=>c(t.id),onNodeMouseEnter:(e,t)=>d(t.id),onNodeMouseLeave:()=>d(null),onNodesChange:s,onEdgesChange:n,children:[e(k,{}),e(Te,{trigger:a}),e(xe,{children:e(M,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Me,children:e(T,{onClick:i,children:e(U,{})})})})]})},Ie=i=>e(x,{children:t(be,{children:[e(fe,{}),e(Ce,{...i})]})}),$e=o.div`
98
+ `,Le={[se.MapItem]:Ne,[se.NoData]:ae},je={[de.AnimatedTraffic]:Xe},He={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},De=({trigger:e})=>{const{fitView:t}=M(),i=u(!0);return d(()=>{i.current?i.current=!1:e>0&&requestAnimationFrame(()=>t(He))},[e,t]),null},Ge=({onRefresh:i})=>{const{nodes:o,edges:r,fitViewTrigger:n,onNodesChange:a,onEdgesChange:s,setHoveredNodeId:d,toggleActiveNode:c}=fe(),p=l(()=>{const e=new Set(o.filter(e=>e.type===se.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const i of r)e.has(i.source)&&t.add(i.target),e.has(i.target)&&t.add(i.source);return o.filter(e=>e.type!==se.MapItem||e.data.selected||t.has(e.id))},[o,r]);return t(I,{zoomOnScroll:!0,nodes:p,nodeTypes:Le,edges:r,edgeTypes:je,onNodeClick:(e,t)=>c(t.id),onNodeMouseEnter:(e,t)=>d(t.id),onNodeMouseLeave:()=>d(null),onNodesChange:a,onEdgesChange:s,children:[e(w,{}),e(De,{trigger:n}),e(qe,{children:e($,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:He,children:e(k,{onClick:i,children:e(ie,{})})})})]})},Pe=i=>e(S,{children:t(_e,{children:[e(Ge,{...i}),e(Re,{}),e(Me,{})]})}),Be=o.div`
81
99
  width: 100%;
82
100
  flex: 1;
83
101
  align-self: stretch;
84
102
  min-height: 0;
85
103
  height: 100%;
86
104
  position: relative;
87
- `,Ee=()=>{const{serviceMapApi:t}=W(),{data:i,refetch:o}=t.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return e(le,{serviceMap:i?.serviceMap??[],children:e($e,{children:e(Ie,{onRefresh:o})})})},Ke=o.div`
105
+ `,Fe=()=>{const{serviceMapApi:t}=re(),{data:i,refetch:o}=t.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return e(ve,{serviceMap:i?.serviceMap??[],children:e(Be,{children:e(Pe,{onRefresh:o})})})},Ue=o.div`
88
106
  position: fixed;
89
107
  bottom: 12px;
90
108
  left: 12px;
@@ -93,4 +111,4 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
93
111
  flex-direction: column-reverse;
94
112
  gap: 6px;
95
113
  max-width: 600px;
96
- `,Ve=()=>{const{notifications:t,markAsDismissed:i,markAsSeen:o}=G(),{onClickNotification:r}=F(),a=t.filter(({dismissed:e})=>!e);return e(Ke,{children:a.map(({id:t,type:s,title:n,message:d,crdType:l,target:c},p)=>{const u=d||n;if(!u)return null;const m=a.length-p;return e(H,{status:s,message:u,action:l&&c?{label:"go to details",onClick:()=>r({id:t,crdType:l,target:c},{dismissToast:!0})}:void 0,onClose:({asSeen:e})=>(({id:e,asSeen:t})=>{i(e),t&&o(e)})({id:t,asSeen:e}),zIndex:m},`toast-${t}`)})})};export{Ee as ServiceMap,Ve as ToastList};
114
+ `,Ye=()=>{const{notifications:t,markAsDismissed:i,markAsSeen:o}=U(),{onClickNotification:r}=Y(),n=t.filter(({dismissed:e})=>!e);return e(Ue,{children:n.map(({id:t,type:a,title:s,message:d,crdType:l,target:c},p)=>{const u=d||s;if(!u)return null;const h=n.length-p;return e(W,{status:a,message:u,action:l&&c?{label:"go to details",onClick:()=>r({id:t,crdType:l,target:c},{dismissToast:!0})}:void 0,onClose:({asSeen:e})=>(({id:e,asSeen:t})=>{i(e),t&&o(e)})({id:t,asSeen:e}),zIndex:h},`toast-${t}`)})})};export{Fe as ServiceMap,Ye as ToastList};
@@ -1 +1 @@
1
- import{e as o,r,f as t}from"../chunks/use-odigos-api-DnIoW4_W.js";export{O as OdigosApiProvider,p as prepareNamespacePayloads,a as prepareSourcePayloads,u as useApiLazyQuery,b as useApiMutation,c as useApiQuery,d as useOdigosApi}from"../chunks/use-odigos-api-DnIoW4_W.js";export{O as OdigosApiConnectionsScope}from"../chunks/connections-scope-RiHZnCRk.js";import{useApolloClient as e}from"@apollo/client";import{P as s,t as i}from"../chunks/ui-components-B1TCLO_N.js";import"react";import"react/jsx-runtime";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"styled-components";import"../icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";const n=()=>{const s=e(),{operations:i,context:n}=o();return{multiFetch:async(o,r,e)=>{const a=i[o];return a?t(s,a,r,e,n):{results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:r.length,error:`Operation ${String(o)} not configured`}},bulkPersistSources:async(o,t)=>{const e=[];for(const a of o){const o={...n,proxyID:a},{error:c}=await r(s,i.PERSIST_SOURCES,t,o);c&&e.push(`${a}: ${c}`)}return e.length?{error:e.join(", ")}:void 0},applyConfigurations:async(o,t)=>{if(!i.UPDATE_REMOTE_CONFIG)return{error:"UPDATE_REMOTE_CONFIG not configured"};const{error:e}=await r(s,i.UPDATE_REMOTE_CONFIG,{formData:t,connectionIds:o},n);return e?{error:e}:void 0}}},m=(o,r)=>o.platformType===s.K8s?r.K8s:o.platformType===s.Vm?r.Vm:void 0,l=o=>r=>{const t=o[r.platformType];if(!t)return;const e=Object.keys(t);if(0===e.length)return;const s=i(r.schemaVersion??r.version),n=[...e].sort((o,r)=>i(r)-i(o)).find(o=>s>=i(o));return n?t[n]:void 0},f=(o,r)=>{const t={};for(const e of Object.keys(o))t[e]=r(o[e]);return t};export{m as pickByPlatform,n as useApiForConnections,l as versionedDocument,f as vmDialectMap};
1
+ import{e as o,r,f as t}from"../chunks/use-odigos-api-hslZLdix.js";export{O as OdigosApiProvider,p as prepareNamespacePayloads,a as prepareSourcePayloads,u as useApiLazyQuery,b as useApiMutation,c as useApiQuery,d as useOdigosApi}from"../chunks/use-odigos-api-hslZLdix.js";export{O as OdigosApiConnectionsScope}from"../chunks/connections-scope-DgpFs9S1.js";import{useApolloClient as e}from"@apollo/client";import{P as s,t as i}from"../chunks/ui-components-BmIux5o5.js";import"react";import"react/jsx-runtime";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"styled-components";import"../icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";const n=()=>{const s=e(),{operations:i,context:n}=o();return{multiFetch:async(o,r,e)=>{const a=i[o];return a?t(s,a,r,e,n):{results:[],allSucceeded:!1,anySucceeded:!1,successCount:0,failureCount:r.length,error:`Operation ${String(o)} not configured`}},bulkPersistSources:async(o,t)=>{const e=[];for(const a of o){const o={...n,proxyID:a},{error:c}=await r(s,i.PERSIST_SOURCES,t,o);c&&e.push(`${a}: ${c}`)}return e.length?{error:e.join(", ")}:void 0},applyConfigurations:async(o,t)=>{if(!i.UPDATE_REMOTE_CONFIG)return{error:"UPDATE_REMOTE_CONFIG not configured"};const{error:e}=await r(s,i.UPDATE_REMOTE_CONFIG,{formData:t,connectionIds:o},n);return e?{error:e}:void 0}}},m=(o,r)=>o.platformType===s.K8s?r.K8s:o.platformType===s.Vm?r.Vm:void 0,l=o=>r=>{const t=o[r.platformType];if(!t)return;const e=Object.keys(t);if(0===e.length)return;const s=i(r.schemaVersion??r.version),n=[...e].sort((o,r)=>i(r)-i(o)).find(o=>s>=i(o));return n?t[n]:void 0},f=(o,r)=>{const t={};for(const e of Object.keys(o))t[e]=r(o[e]);return t};export{m as pickByPlatform,n as useApiForConnections,l as versionedDocument,f as vmDialectMap};
package/lib/contexts.js CHANGED
@@ -1 +1 @@
1
- export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-8HLrHGI9.js";export{O as OdigosProvider,c as checkVersionSupport,u as useOdigos}from"./chunks/helpers-CUmUiA_l.js";import{jsx as o}from"react/jsx-runtime";import{useMemo as r,useContext as t,createContext as s}from"react";export{O as OdigosApiConnectionsScope}from"./chunks/connections-scope-RiHZnCRk.js";export{O as OdigosApiProvider,p as prepareNamespacePayloads,a as prepareSourcePayloads,u as useApiLazyQuery,b as useApiMutation,c as useApiQuery,d as useOdigosApi}from"./chunks/use-odigos-api-DnIoW4_W.js";export{pickByPlatform,useApiForConnections,versionedDocument,vmDialectMap}from"./contexts/odigos-api.js";import"./chunks/ui-components-B1TCLO_N.js";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const n=s({formType:void 0}),m=({children:e,formType:t})=>{const s=r(()=>({formType:t}),[t]);return o(n.Provider,{value:s,children:e})},l=()=>t(n);export{m as StorybookProvider,l as useStorybook};
1
+ export{A as ActionFormContextProvider,D as DataStreamFormContextProvider,a as DestinationFormContextProvider,R as RuleFormContextProvider,S as SamplingRuleFormType,b as SamplingRulesFormProvider,c as SourceEditFormContextProvider,d as SourceInstrumentFormContextProvider,u as useActionFormContext,e as useDataStreamFormContext,f as useDestinationFormContext,g as useRuleFormContext,h as useSamplingRulesFormContext,i as useSourceEditFormContext,j as useSourceInstrumentFormContext}from"./chunks/source-instrument-form-context-o2ynNRPg.js";export{O as OdigosProvider,c as checkVersionSupport,u as useOdigos}from"./chunks/helpers-BlFl20R2.js";import{jsx as o}from"react/jsx-runtime";import{useMemo as r,useContext as t,createContext as s}from"react";export{O as OdigosApiConnectionsScope}from"./chunks/connections-scope-DgpFs9S1.js";export{O as OdigosApiProvider,p as prepareNamespacePayloads,a as prepareSourcePayloads,u as useApiLazyQuery,b as useApiMutation,c as useApiQuery,d as useOdigosApi}from"./chunks/use-odigos-api-hslZLdix.js";export{pickByPlatform,useApiForConnections,versionedDocument,vmDialectMap}from"./contexts/odigos-api.js";import"./chunks/ui-components-BmIux5o5.js";import"styled-components";import"./icons.js";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const n=s({formType:void 0}),m=({children:e,formType:t})=>{const s=r(()=>({formType:t}),[t]);return o(n.Provider,{value:s,children:e})},l=()=>t(n);export{m as StorybookProvider,l as useStorybook};
@@ -1,2 +1,2 @@
1
- import { OtherStatus, OtherStatusType, StatusType } from '@/types';
2
- export declare const getHealthBadgeLabel: (status: StatusType | OtherStatus | OtherStatusType, reasonEnum?: string | null) => string;
1
+ import { StatusType } from '@/types';
2
+ export declare const getHealthBadgeLabel: (status: StatusType, reasonEnum?: string | null) => string;
@@ -1,3 +1,3 @@
1
1
  import { DefaultTheme } from 'styled-components';
2
- import { OtherStatus, OtherStatusType, StatusType } from '@/types';
3
- export declare const getStatusColor: (theme: DefaultTheme, status: StatusType | OtherStatus | OtherStatusType, weight: keyof typeof theme.v2.colors.purple | keyof typeof theme.v2.colors.red | keyof typeof theme.v2.colors.yellow | keyof typeof theme.v2.colors.green | keyof typeof theme.v2.colors.silver) => string;
2
+ import { StatusType } from '@/types';
3
+ export declare const getStatusColor: (theme: DefaultTheme, status: StatusType, weight?: keyof typeof theme.v2.colors.purple | keyof typeof theme.v2.colors.red | keyof typeof theme.v2.colors.yellow | keyof typeof theme.v2.colors.green | keyof typeof theme.v2.colors.silver) => string;
@@ -1,3 +1,3 @@
1
- import { OtherStatusType, PodContainerLifecycleStatus, PodContainerStatus, PodPhase, StatusType, WorkloadRolloutStatus } from '@/types';
1
+ import { PodContainerLifecycleStatus, PodContainerStatus, PodPhase, StatusType, WorkloadRolloutStatus } from '@/types';
2
2
  export type PodStatus = WorkloadRolloutStatus | PodPhase | PodContainerStatus | PodContainerLifecycleStatus;
3
- export declare const getStatusFromPodStatus: (status?: PodStatus) => StatusType | OtherStatusType;
3
+ export declare const getStatusFromPodStatus: (status?: PodStatus) => StatusType;
@@ -1,3 +1,3 @@
1
+ import { StatusType, type SVG } from '@/types';
1
2
  import type { DefaultTheme } from 'styled-components';
2
- import { OtherStatus, OtherStatusType, StatusType, type SVG } from '@/types';
3
- export declare const getStatusIcon: (status: StatusType | OtherStatus | OtherStatusType, theme: DefaultTheme) => SVG;
3
+ export declare const getStatusIcon: (status: StatusType, theme: DefaultTheme) => SVG;
@@ -1,2 +1,2 @@
1
- import { DesiredStateProgress, OtherStatus, StatusType } from '@/types';
2
- export declare const getStatusTypeFromOdigosHealth: (status: DesiredStateProgress) => StatusType | OtherStatus;
1
+ import { DesiredStateProgress, StatusType } from '@/types';
2
+ export declare const getStatusTypeFromOdigosHealth: (status: DesiredStateProgress) => StatusType;
@@ -1,2 +1,2 @@
1
- import { DesiredStateProgress, OtherStatus, StatusType } from '@/types';
2
- export declare const mapDesiredStatusToConditionStatus: (status?: DesiredStateProgress | null) => StatusType | OtherStatus | null;
1
+ import { DesiredStateProgress, StatusType } from '@/types';
2
+ export declare const mapDesiredStatusToConditionStatus: (status?: DesiredStateProgress | null) => StatusType | null;
package/lib/functions.js CHANGED
@@ -1 +1 @@
1
- export{a0 as adaptInstrumentationRuleFromWire,$ as adaptInstrumentationRuleInputForWire,b7 as buildBadgeForDesiredStatus,f8 as capitalizeFirstLetter,f9 as cleanObjectEmptyStringsValues,ar as compareCondition,fa as decimalsOnly,e as deepClone,dh as entityIdKey,dm as filterActions,dl as filterDestinations,b0 as filterDestinationsByStream,dk as filterSources,d9 as filterSourcesByStream,fb as flattenObjectKeys,bk as formatBytes,fc as formatDuration,bT as generateId,a_ as getActionIcon,v as getConditionsBooleans,bw as getContainersIcons,fd as getContainersInstrumentedCount,fe as getDeepValue,aQ as getDestinationIcon,ff as getDetectedLanguageIcons,bc as getEffectiveLanguage,br as getEffectiveRuntimeVersion,di as getEntityIcon,_ as getEntityId,df as getEntityIdKey,dg as getEntityLabel,fg as getHealthBadgeLabel,Z as getIdFromSseTarget,b4 as getInstrumentationRuleIcon,fh as getMainContainerLanguage,fi as getMetricForEntity,fj as getMonitorIcon,fk as getNearestTypographySize,fl as getPlatformIcon,fm as getPlatformLabel,ax as getProgrammingLanguageIcon,fn as getRecursiveValues,r as getSourceLanguageIcons,U as getSseTargetFromId,fo as getStatusColor,ds as getStatusFromPodStatus,x as getStatusIcon,bm as getStatusTypeFromOdigosHealth,fp as getValueForRange,q as getVirtualServiceIcon,bi as getWorkloadId,b1 as getYamlFieldsForDestination,fq as hasUnhealthyInstances,fr as instrumentationRuleSourceScopesFromWire,fs as instrumentationRuleSourceScopesToWire,i as isEmpty,j as isLegalK8sLabel,bP as isOverTime,ft as isStringABoolean,fu as isTimeElapsed,bq as isValidVersion,fv as mapConditions,ba as mapDesiredStatusToConditionStatus,a$ as mapDestinationFieldsForDisplay,k as mapExportedSignals,m as mapSupportedSignals,fw as numbersOnly,fx as parseBooleanFromString,fy as parseJsonStringToPrettyString,as as prepareDestinationFormData,fz as removeEmptyValuesFromObject,s as safeJsonParse,fA as safeJsonStringify,fB as setDeepValue,fC as sleep,b2 as splitCamelString,fD as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-B1TCLO_N.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{a5 as adaptInstrumentationRuleFromWire,a4 as adaptInstrumentationRuleInputForWire,b6 as buildBadgeForDesiredStatus,f6 as capitalizeFirstLetter,f7 as cleanObjectEmptyStringsValues,ar as compareCondition,f8 as decimalsOnly,e as deepClone,df as entityIdKey,dk as filterActions,dj as filterDestinations,a$ as filterDestinationsByStream,di as filterSources,d7 as filterSourcesByStream,f9 as flattenObjectKeys,bi as formatBytes,fa as formatDuration,bS as generateId,aZ as getActionIcon,v as getConditionsBooleans,bv as getContainersIcons,fb as getContainersInstrumentedCount,fc as getDeepValue,aQ as getDestinationIcon,fd as getDetectedLanguageIcons,bb as getEffectiveLanguage,bp as getEffectiveRuntimeVersion,dg as getEntityIcon,a3 as getEntityId,dd as getEntityIdKey,de as getEntityLabel,fe as getHealthBadgeLabel,a2 as getIdFromSseTarget,b3 as getInstrumentationRuleIcon,ff as getMainContainerLanguage,fg as getMetricForEntity,fh as getMonitorIcon,fi as getNearestTypographySize,fj as getPlatformIcon,fk as getPlatformLabel,ax as getProgrammingLanguageIcon,fl as getRecursiveValues,r as getSourceLanguageIcons,Z as getSseTargetFromId,fm as getStatusColor,dq as getStatusFromPodStatus,x as getStatusIcon,bk as getStatusTypeFromOdigosHealth,fn as getValueForRange,q as getVirtualServiceIcon,bg as getWorkloadId,b0 as getYamlFieldsForDestination,fo as hasUnhealthyInstances,fp as instrumentationRuleSourceScopesFromWire,fq as instrumentationRuleSourceScopesToWire,i as isEmpty,j as isLegalK8sLabel,bO as isOverTime,fr as isStringABoolean,fs as isTimeElapsed,bo as isValidVersion,ft as mapConditions,b9 as mapDesiredStatusToConditionStatus,a_ as mapDestinationFieldsForDisplay,k as mapExportedSignals,m as mapSupportedSignals,fu as numbersOnly,fv as parseBooleanFromString,fw as parseJsonStringToPrettyString,as as prepareDestinationFormData,fx as removeEmptyValuesFromObject,s as safeJsonParse,fy as safeJsonStringify,fz as setDeepValue,fA as sleep,b1 as splitCamelString,fB as stringifyNonStringValues,t as trimVersion}from"./chunks/ui-components-BmIux5o5.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
package/lib/hooks.js CHANGED
@@ -1 +1 @@
1
- export{fO as IGNORE_OUTSIDE_CLICK_ATTR,fP as useActionFormData,fQ as useBodyScroll,dn as useClickNode,Q as useClickNotification,dj as useContainerSize,bl as useCopy,fR as useDataStreamFormData,fS as useDestinationFormData,d as useGenericForm,fT as useInstrumentationRuleFormData,bO as useKeyDown,bn as useOnClickOutside,fU as useOverflow,u as usePopup,b6 as useScrollIntoViewWhen,dO as useScrollTo,dc as useSessionStorage,fV as useSourceFormData,b5 as useTimeAgo}from"./chunks/ui-components-B1TCLO_N.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{fM as IGNORE_OUTSIDE_CLICK_ATTR,fN as useActionFormData,fO as useBodyScroll,dl as useClickNode,X as useClickNotification,dh as useContainerSize,bj as useCopy,fP as useDataStreamFormData,fQ as useDestinationFormData,d as useGenericForm,fR as useInstrumentationRuleFormData,bN as useKeyDown,bl as useOnClickOutside,fS as useOverflow,u as usePopup,b5 as useScrollIntoViewWhen,dM as useScrollTo,da as useSessionStorage,fT as useSourceFormData,b4 as useTimeAgo}from"./chunks/ui-components-BmIux5o5.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
@@ -21,7 +21,7 @@ export interface PresetWithCustomInputProps<T extends string = string> {
21
21
  selected: T;
22
22
  onSelect: (value: T) => void;
23
23
  customName: string;
24
- customLabel: string;
24
+ customLabel?: string;
25
25
  customPlaceholder: string;
26
26
  customValue: string;
27
27
  onCustomChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
@@ -1 +1 @@
1
- export{bg as ActionType,dr as Actions,dq as RichTitle}from"../chunks/ui-components-B1TCLO_N.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,b as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,c as SamplingPreviewSection,S as SignalsCheckboxList,a as SourceScopeSection,U as UpgradeModal,i as WIDE_DRAWER_WIDTH,W as WideDrawer,Y as YamlSectionCard}from"../chunks/index-hiRPXsEi.js";export{C as ColoredSpan,D as ColoredSpanVariant}from"../chunks/helpers-CUmUiA_l.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{be as ActionType,dp as Actions,dn as RichTitle}from"../chunks/ui-components-BmIux5o5.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,b as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,c as SamplingPreviewSection,S as SignalsCheckboxList,a as SourceScopeSection,U as UpgradeModal,i as WIDE_DRAWER_WIDTH,W as WideDrawer,Y as YamlSectionCard}from"../chunks/index-BVL5-zQa.js";export{C as ColoredSpan,D as ColoredSpanVariant}from"../chunks/helpers-BlFl20R2.js";import"react/jsx-runtime";import"styled-components";import"../icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
package/lib/snippets.js CHANGED
@@ -1 +1 @@
1
- export{bg as ActionType,dr as Actions,dq as RichTitle}from"./chunks/ui-components-B1TCLO_N.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,b as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,c as SamplingPreviewSection,S as SignalsCheckboxList,a as SourceScopeSection,U as UpgradeModal,i as WIDE_DRAWER_WIDTH,W as WideDrawer,Y as YamlSectionCard}from"./chunks/index-hiRPXsEi.js";export{C as ColoredSpan,D as ColoredSpanVariant}from"./chunks/helpers-CUmUiA_l.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{be as ActionType,dp as Actions,dn as RichTitle}from"./chunks/ui-components-BmIux5o5.js";export{C as CancelModal,j as DURATION_OPTIONS,g as DeleteModal,e as DurationErrorsSection,D as DynamicField,I as InstrumentationPreviewSection,N as NOISY_PERCENTAGE_OPTIONS,h as OdigosLogoTextByTier,O as OperationSection,b as PERCENTAGE_OPTIONS,f as PercentageSection,P as PresetWithCustomInput,R as RuleInfoSection,d as RuleTypeSection,c as SamplingPreviewSection,S as SignalsCheckboxList,a as SourceScopeSection,U as UpgradeModal,i as WIDE_DRAWER_WIDTH,W as WideDrawer,Y as YamlSectionCard}from"./chunks/index-BVL5-zQa.js";export{C as ColoredSpan,D as ColoredSpanVariant}from"./chunks/helpers-BlFl20R2.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
@@ -1,4 +1,4 @@
1
- import { OtherStatusType, StatusType } from '@/types';
1
+ import { StatusType } from '@/types';
2
2
  export declare enum ProgressKeys {
3
3
  Instrumenting = "instrumenting",
4
4
  Uninstrumenting = "uninstrumenting",
@@ -9,7 +9,7 @@ export declare enum ProgressKeys {
9
9
  type ProgressKey = ProgressKeys | string;
10
10
  interface ProgressListItem {
11
11
  label: string;
12
- status: StatusType | OtherStatusType;
12
+ status: StatusType;
13
13
  }
14
14
  interface ProgressValues {
15
15
  total: number;
package/lib/store.js CHANGED
@@ -1 +1 @@
1
- export{Y as ProgressKeys,fN as useDarkMode,h as useDataStreamStore,bh as useDrawerStore,d8 as useFilterStore,bU as useModalStore,O as useNotificationStore,W as useProgressStore,de as useSelectedStore,X as useSetupStore}from"./chunks/ui-components-B1TCLO_N.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{a1 as ProgressKeys,fL as useDarkMode,h as useDataStreamStore,bf as useDrawerStore,d6 as useFilterStore,bT as useModalStore,W as useNotificationStore,$ as useProgressStore,dc as useSelectedStore,a0 as useSetupStore}from"./chunks/ui-components-BmIux5o5.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
package/lib/theme.js CHANGED
@@ -1 +1 @@
1
- export{fW as Provider,fX as animations,fY as opacity,fZ as palettes}from"./chunks/ui-components-B1TCLO_N.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{fU as Provider,fV as animations,fW as opacity,fX as palettes}from"./chunks/ui-components-BmIux5o5.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
@@ -139,7 +139,10 @@ export declare enum StatusType {
139
139
  Error = "error",
140
140
  Success = "success",
141
141
  Info = "info",
142
- Default = "default"
142
+ Default = "default",
143
+ Loading = "loading",
144
+ Disabled = "disabled",
145
+ Unknown = "unknown"
143
146
  }
144
147
  export declare enum IntrumentationStatus {
145
148
  INSTRUMENTED = "Instrumented",
@@ -147,16 +150,8 @@ export declare enum IntrumentationStatus {
147
150
  UNINSTRUMENTED = "Uninstrumented",
148
151
  NOT_INSTRUMENTED = "Not Instrumented"
149
152
  }
150
- export declare enum OtherStatus {
151
- Loading = "loading",
152
- Disabled = "disabled"
153
- }
154
- export declare enum OtherStatusType {
155
- Disabled = "disabled",
156
- Unknown = "unknown"
157
- }
158
153
  export interface Condition {
159
- status: StatusType | OtherStatus;
154
+ status: StatusType;
160
155
  type: string;
161
156
  name?: string;
162
157
  reason?: string | null;
@@ -141,6 +141,8 @@ export type ViewRuleData = ViewNoisyRule | ViewHighlyRelevantRule | ViewCostRedu
141
141
  export interface SamplingRulesSelectOption {
142
142
  id: string;
143
143
  label: string;
144
+ badge?: string;
145
+ secondaryLabel?: string;
144
146
  }
145
147
  /** Matches effective k8s health-probes sampling config from the API. */
146
148
  export interface SamplingRulesK8sHealthConfig {
package/lib/types.js CHANGED
@@ -1 +1 @@
1
- export{f as ActionKeyTypes,g as ActionType,eK as AgentInjectedReason,eL as BooleanOperation,at as CodeAttributesKeyTypes,eM as ConditionType,V as Crud,C as CustomInstrumentationsKeyTypes,b8 as DesiredStateProgress,eN as DestinationTypes,E as EntityTypes,ah as ExtractionDataFormat,l as FieldTypes,G as GolangCustomProbe,H as HeadersCollectionKeyTypes,dQ as InputTypes,eO as InstallationMethod,eP as InstallationStatus,n as InstrumentationRuleType,eQ as IntrumentationStatus,J as JavaCustomProbe,eR as JsonOperation,a5 as K8sAttributesFrom,K as K8sResourceKind,eS as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,eT as ListDirection,eU as NumberOperation,eV as OtelDistroName,eW as OtherEntityTypes,bd as OtherStatus,aR as OtherStatusType,av as PayloadCollectionKeyTypes,P as PlatformType,eX as PodContainerLifecycleStatus,eY as PodContainerStatus,eZ as PodPhase,e_ as Profile,bt as ProgrammingLanguages,e$ as SIGNAL_KEY_TO_TYPE,f0 as SIGNAL_TYPE_TO_KEY,f1 as SignalKey,S as SignalType,f2 as SortDirection,o as StatusType,f3 as StringOperation,T as Tier,f4 as WorkloadRolloutReason,dt as WorkloadRolloutStatus}from"./chunks/ui-components-B1TCLO_N.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{f as ActionKeyTypes,g as ActionType,eI as AgentInjectedReason,eJ as BooleanOperation,at as CodeAttributesKeyTypes,eK as ConditionType,_ as Crud,C as CustomInstrumentationsKeyTypes,b7 as DesiredStateProgress,eL as DestinationTypes,E as EntityTypes,ah as ExtractionDataFormat,l as FieldTypes,G as GolangCustomProbe,H as HeadersCollectionKeyTypes,dO as InputTypes,eM as InstallationMethod,eN as InstallationStatus,n as InstrumentationRuleType,eO as IntrumentationStatus,J as JavaCustomProbe,eP as JsonOperation,aa as K8sAttributesFrom,K as K8sResourceKind,eQ as K8sWorkloadContainerAgentConfigTracesHeadSamplingSpanMetricsMode,eR as ListDirection,eS as NumberOperation,eT as OtelDistroName,eU as OtherEntityTypes,av as PayloadCollectionKeyTypes,P as PlatformType,eV as PodContainerLifecycleStatus,eW as PodContainerStatus,eX as PodPhase,eY as Profile,br as ProgrammingLanguages,eZ as SIGNAL_KEY_TO_TYPE,e_ as SIGNAL_TYPE_TO_KEY,e$ as SignalKey,S as SignalType,f0 as SortDirection,o as StatusType,f1 as StringOperation,T as Tier,f2 as WorkloadRolloutReason,dr as WorkloadRolloutStatus}from"./chunks/ui-components-BmIux5o5.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
package/lib/visuals.js CHANGED
@@ -1 +1 @@
1
- export{f5 as VISUAL_ODIGOS_LOGO_HEIGHT,f6 as VISUAL_ODIGOS_LOGO_WIDTH,eI as VisualGreenRings,f7 as VisualOdigosLogo,c3 as VisualPurpleRings}from"./chunks/ui-components-B1TCLO_N.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
1
+ export{f3 as VISUAL_ODIGOS_LOGO_HEIGHT,f4 as VISUAL_ODIGOS_LOGO_WIDTH,eG as VisualGreenRings,f5 as VisualOdigosLogo,c2 as VisualPurpleRings}from"./chunks/ui-components-BmIux5o5.js";import"react/jsx-runtime";import"styled-components";import"./icons.js";import"zustand";import"react";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.257",
3
+ "version": "0.0.258",
4
4
  "author": "Odigos",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,155 +0,0 @@
1
- import{ay as e,ae as a,l as t,a6 as l,a7 as r,dP as n,M as i,aL as s,aq as o,a4 as d,s as c,a8 as u,al as p,dQ as h,ac as g,ad as m,dR as v,dS as f,n as b,C as y,J as x,G as C,H as S,av as $,at as T,b2 as k,T as w,y as A,a1 as P,a2 as M,af as L,aH as I,dT as O,dU as D,aS as z,dV as X,b as N,dW as R,ab as H,c as E,dX as B,dY as V,dZ as q,d_ as G,d$ as j,e0 as J,e1 as U,ai as K,e2 as W,e3 as F,e4 as Y,e5 as Q,e6 as Z,bQ as _,e7 as ee,e8 as ae,e9 as te,ea as le,eb as re,ec as ne,ed as ie,ee as se,ef as oe,eg as de,eh as ce,aI as ue,ei as pe,ej as he,ek as ge,el as me,em as ve,bD as fe,en as be,eo as ye,ep as xe,eq as Ce,er as Se,es as $e,et as Te,eu as ke,ev as we,aY as Ae,R as Pe,ew as Me,o as Le,ex as Ie,b3 as Oe,ey as De,ez as ze,eA as Xe,eB as Ne,bt as Re,ax as He,eC as Ee,eD as Be,eE as Ve,dd as qe,eF as Ge,eG as je,eH as Je,e as Ue,db as Ke,a3 as We,eI as Fe,L as Ye,aK as Qe,N as Ze,a9 as _e,aO as ea,dq as aa,z as ta,bl as la,bg as ra,bT as na,eJ as ia}from"./ui-components-B1TCLO_N.js";import{D as sa,C as oa,E as da,u as ca,F as ua,h as pa,f as ha,e as ga,G as ma,H as va,I as fa,i as ba,m as ya}from"./helpers-CUmUiA_l.js";import{jsx as xa,jsxs as Ca,Fragment as Sa}from"react/jsx-runtime";import $a,{useMemo as Ta,useCallback as ka,useState as wa,useRef as Aa,useEffect as Pa,forwardRef as Ma,useImperativeHandle as La}from"react";import Ia,{useTheme as Oa}from"styled-components";import{EditIcon as Da,OdigosLogoTextCentral as za,OdigosLogoTextEnterprise as Xa,OdigosLogoTextCommunity as Na,OdigosLogoTextColoredCentral as Ra,OdigosLogoTextColoredEnterprise as Ha,OdigosLogoTextColoredCommunity as Ea,ArrowLeftIcon as Ba,ArrowRightIcon as Va,VSquareIcon as qa,VIcon as Ga,CopyIcon as ja,YamlIcon as Ja}from"../icons.js";const Ua=({isOpen:t,onClose:l,onDeny:r,onApprove:n})=>xa(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:t,onClose:l,denyButton:{label:"Keep editing",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:"Discard changes",variant:a.Primary,onClick:()=>{n?.(),l()}}}),Ka=({isOpen:t,onClose:l,onDeny:r,onApprove:n,action:i="delete",target:s,description:o,overrideApproveButtonLabel:d,overrideDenyButtonLabel:c})=>{const u=i.charAt(0).toUpperCase()+i.substring(1),p=s?.endsWith("s")?"these":"this";return xa(e,{title:`${u}${s?` ${s}`:""}?`,description:o??`Are you sure you want to ${i}${s?` ${p} ${s}`:""}?`,isOpen:t,onClose:l,denyButton:{label:c??"Go back",variant:a.Secondary,onClick:()=>{r?.(),l()}},approveButton:{label:d??u,variant:a.Primary,onClick:()=>{n?.(),l()}}})},Wa=({componentType:e,inputType:a,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:C,setValue:S,errorMessage:$,warnMessage:T,helpMessage:k,dropdownOptions:w,dropdownNoSearch:A,dropdownNoCheckbox:P,timeUnits:M,timeDefaultUnit:L})=>{switch(e){case t.Input:return xa(p,{name:g,type:a,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:C??"",onChange:e=>{const t=e.target.value;S(a===h.Number?""===t?null:Number(t):t)},errorMessage:$,warnMessage:T,helpMessage:k},g);case t.MultiInput:return xa(u,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,values:Array.isArray(C)?C:c(C,[]),setValues:e=>S(e),errorMessage:$,warnMessage:T,helpMessage:k},g);case t.KeyValuePair:return xa(d,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key",placeholder:"Key"},{keyName:"value",label:"Value",placeholder:"Value"}],values:Array.isArray(C)?C:c(C,[]),setValues:e=>S(e),errorMessage:$,warnMessage:T,helpMessage:k},g);case t.TextArea:return xa(o,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,placeholder:b,value:C??"",onChange:e=>S(e.target.value),errorMessage:$,warnMessage:T,helpMessage:k},g);case t.Dropdown:return xa(s,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,withSearch:!A,options:w?.map(e=>({id:e.id||"",label:e.label||"",withCheckbox:!P}))||[],values:C?[String(C)]:[],setValues:e=>S(e[0]),errorMessage:$,warnMessage:T,helpMessage:k},g);case t.Checkbox:return xa(i,{name:g,label:m,tooltip:v,badge:f,value:!0===C||"true"===C,onChange:e=>S(e),disabled:x,errorMessage:$,warnMessage:T,helpMessage:k},g);case t.Time:return xa(n,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:C??"",setValue:e=>S(e),units:M,defaultUnit:L,errorMessage:$,warnMessage:T,helpMessage:k},g);case t.Toggle:return xa(l,{name:g,labelAlign:r.Right,label:m,tooltip:v,badge:f,value:!0===C||"true"===C,onChange:e=>S(e),disabled:x,errorMessage:$,warnMessage:T,helpMessage:k},g);default:return null}},Fa=Ia.div`
2
- display: flex;
3
- align-items: center;
4
- gap: 24px;
5
- padding: 8px 16px;
6
- border-radius: 12px;
7
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
8
- `,Ya=Ia.div`
9
- flex: 1;
10
- min-width: 0;
11
- white-space: pre;
12
- overflow-x: auto;
13
- `,Qa=({title:e,summary:t,onEdit:l,renderAction:r})=>{const n=Ta(()=>{const a=[];return e&&(a.push({text:e,variant:sa.Default}),a.push({text:" - ",variant:sa.Default})),a.push(...t),a},[e,t]);return Ca(Fa,{children:[xa(Ya,{children:xa(oa,{parts:n})}),r&&r(),l&&xa(g,{"data-id":"sampling-btn-edit-auto-rule",label:v,rightIcon:Da,variant:a.Text,size:m.S,onClick:l})]})},Za={[$.HttpRequest]:"HTTP request",[$.HttpResponse]:"HTTP response",[$.DbQuery]:"DB query",[$.Messaging]:"messaging"};function _a(e,a,t){return 1===e?a:t??`${a}s`}function et(e,a){const t=[],l=e.slice(0,3),r=e.slice(3);return l.forEach((e,l)=>{l>0&&t.push({text:", ",variant:sa.Default}),t.push({text:e,variant:a})}),r.length>0&&t.push({text:` + ${r.length} more`,variant:sa.Default,tooltipItems:r}),t}function at(e,a){switch(e){case b.CodeAttributes:return function(e){const a=Object.values(T).filter(a=>!!e.codeAttributes?.[a]).map(e=>k(e).toLowerCase());return a.length?[{text:"Collect",variant:sa.Action},{text:" ",variant:sa.Default},...et(a,sa.Endpoint)]:null}(a);case b.PayloadCollection:return function(e){const a=Object.values($).filter(a=>null!=e.payloadCollection?.[a]).map(e=>Za[e]);return a.length?[{text:"Collect",variant:sa.Action},{text:" ",variant:sa.Default},...et(a,sa.Endpoint)]:null}(a);case b.HeadersCollection:return function(e){const a=(e.headersCollection?.[S.HeaderKeys]??[]).map(e=>e.trim()).filter(e=>e.length>0);if(!a.length)return null;const t=_a(a.length,"HTTP header");return[{text:`Collect ${a.length} ${t}`,variant:sa.Action},{text:"",variant:sa.Default,tooltipItems:a}]}(a);case b.CustomInstrumentation:return function(e){const a=(e.customInstrumentations?.[y.Java]??[]).map(e=>new x(e.className,e.methodName)).filter(e=>e.Verify()),t=(e.customInstrumentations?.[y.Golang]??[]).map(e=>new C(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)).filter(e=>e.Verify());if(!(a.length+t.length))return null;const l=[];a.length&&l.push(`${a.length} Java ${_a(a.length,"probe")}`),t.length&&l.push(`${t.length} Go ${_a(t.length,"probe")}`);const r=[...a.map(e=>`Java: ${e.toString()}`),...t.map(e=>`Go: ${e.toString()}`)];return[{text:`Apply ${l.join(" + ")}`,variant:sa.Action},{text:"",variant:sa.Default,tooltipItems:r}]}(a);default:return null}}const tt=({option:e,formState:a,renderAction:t})=>{const l=Ta(()=>{const t=at(e?.type,a);return t?[...t,...da(a.sourceScopes)]:[]},[e?.type,a]),r=0===l.length;return xa(Qa,{title:r?f:"Instrumentation Rule Preview",summary:l,renderAction:t})},lt=({size:e=200,central:a=!1,useInline:t=!1})=>{const{tier:l}=ca();if(t){if(a)return xa(za,{size:e});switch(l){case w.Community:return xa(Na,{size:e});case w.Onprem:return xa(Xa,{size:e});default:return null}}if(a)return xa(Ra,{size:e});switch(l){case w.Community:return xa(Ea,{size:e});case w.Onprem:return xa(Ha,{size:e});default:return null}},rt=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],nt=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],it=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],st=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:n,customPlaceholder:i,customValue:s,onCustomChange:o,customInputType:d=h.Number,customMin:c,customMax:u})=>Ca(A,{$gap:16,$alignItems:"flex-end",children:[Ca(P,{$gap:6,children:[xa(M,{label:e}),xa(L,{options:a,selected:t,setSelected:l})]}),"custom"===t&&xa(p,{name:r,label:n,placeholder:i,type:d,value:s,onChange:o,width:160,min:c,max:u})]}),ot=()=>{},dt=e=>e.readOnly?xa(ct,{rule:e.rule}):xa(ut,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),ct=({rule:e})=>{const a=null!=e.durationAtLeastMs;return e.error?xa(I,{richTitle:{title:O},children:xa(l,{name:"sampling-view-toggle-keep-errors",onChange:ot,value:!0,size:z.S,label:D,labelAlign:r.Right})}):a?xa(I,{richTitle:{title:X},children:Ca("div",{children:[xa(N,{size:E.XXXS,color:H.Secondary,children:R}),xa(N,{size:E.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},ut=({ruleType:e,formState:a,onChange:t})=>{const n=ka(e=>t({durationPreset:e}),[t]),i=ka(e=>t({customDurationMs:e.target.value}),[t]);return"Error"===e?xa(I,{richTitle:{title:O,subTitle:B},children:xa(l,{name:"sampling-toggle-keep-errors",value:!0,onChange:ot,size:z.S,label:D,labelAlign:r.Right})}):"Duration"===e?xa(I,{richTitle:{title:X,subTitle:V},children:xa(st,{description:R,options:it,selected:a.durationPreset,onSelect:n,customName:"sampling-input-custom-duration",customLabel:q,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:i})}):null},pt=Ia.div`
14
- display: flex;
15
- gap: 32px;
16
- `,ht=Ia.div`
17
- display: flex;
18
- flex-direction: column;
19
- gap: 4px;
20
- `,gt=Ia.div`
21
- display: flex;
22
- flex-wrap: wrap;
23
- align-items: flex-end;
24
- gap: 16px;
25
- `,mt=Ia.div`
26
- display: flex;
27
- align-items: flex-end;
28
- gap: 16px;
29
- padding: 12px 16px;
30
- border-radius: 8px;
31
- background-color: ${({theme:e})=>e.v2.colors.black[500]};
32
- `,vt=Ia.div`
33
- display: flex;
34
- align-items: flex-end;
35
- gap: 10px;
36
- flex: 1;
37
- `,ft=Ia.div`
38
- display: flex;
39
- align-items: center;
40
- height: 32px;
41
- `,bt=Ia.div`
42
- display: flex;
43
- align-items: flex-end;
44
- gap: 16px;
45
- margin-bottom: 12px;
46
- `,yt="Any",xt="Kafka topic",Ct=()=>xa("div",{style:{marginBottom:"8px"},children:xa(N,{size:E.XS,weight:500,children:"And"})}),St=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],$t=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Tt=[{id:"",label:yt},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const kt=e=>e.readOnly?xa(wt,{data:e.data}):xa(At,{category:e.category,formState:e.formState,onChange:e.onChange}),wt=({data:e})=>{const a=Ta(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:le,value:te},{id:"route",title:Y,value:a.httpServer.route||a.httpServer.routePrefix||re},{id:"method",title:ee,value:a.httpServer.method||yt}];if(a?.httpClient){const e=[{id:"type",title:le,value:ne}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:Y,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||re}),e.push({id:"method",title:ee,value:a.httpClient.method||yt}),e}return[{id:"type",title:le,value:ie}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:le,value:te},{id:"route",title:Y,value:a.httpServer.route||a.httpServer.routePrefix||re},{id:"method",title:ee,value:a.httpServer.method||yt}]:a?.kafkaConsumer?[{id:"type",title:le,value:se},{id:"topic",title:xt,value:a.kafkaConsumer.kafkaTopic||re}]:a?.kafkaProducer?[{id:"type",title:le,value:oe},{id:"topic",title:xt,value:a.kafkaProducer.kafkaTopic||re}]:[{id:"type",title:le,value:ie}]}(e),[e]);return xa(I,{richTitle:{title:G},children:xa(pt,{children:a.map(({id:e,title:a,value:t})=>Ca(ht,{children:[xa(N,{size:E.XXXS,color:H.Secondary,nowrap:!0,children:a}),xa(N,{size:E.XS,nowrap:!0,children:t})]},e))})})},At=({category:e,formState:t,onChange:l})=>{const r=Ta(()=>"noisy"===e?St:$t,[e]),n=ka(e=>l({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[l]),i=ka(e=>a=>{a&&l({routeType:e,route:""})},[l]),s=ka(e=>l({route:e.target.value}),[l]),o=ka(e=>l({serverAddress:e.target.value}),[l]),d=ka(e=>l({method:e[0]||""}),[l]),c=ka(e=>l({kafkaTopic:e.target.value}),[l]),u="httpServer"===t.operationType||"httpClient"===t.operationType,h="kafkaConsumer"===t.operationType||"kafkaProducer"===t.operationType,g="httpClient"===t.operationType?F:Y,v="httpClient"===t.operationType?Q:Z;return Ca(I,{richTitle:{title:`2. ${G}`,subTitle:j},children:[xa(P,{$alignItems:"flex-start",children:xa(L,{options:r,selected:t.operationType,setSelected:n})}),u&&Ca(gt,{children:["httpClient"===t.operationType&&Ca(bt,{children:[xa(p,{name:"sampling-input-server-address",label:U,placeholder:J,value:t.serverAddress,onChange:o}),xa(Ct,{})]}),Ca(mt,{children:[Ca(vt,{children:[xa(ft,{children:xa(K,{"data-id":"sampling-radio-route",value:"route"===t.routeType,onChange:i("route")})}),xa(p,{name:"sampling-input-route",label:g,placeholder:W,value:"route"===t.routeType?t.route:"",onChange:s,disabled:"route"!==t.routeType})]}),Ca(vt,{children:[xa(ft,{children:xa(K,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===t.routeType,onChange:i("routePrefix")})}),xa(p,{name:"sampling-input-route-prefix",label:v,placeholder:W,value:"routePrefix"===t.routeType?t.route:"",onChange:s,disabled:"routePrefix"!==t.routeType})]})]}),Ca(bt,{children:[xa(Ct,{}),xa(_,{label:ee,items:Tt,selectedIds:[t.method||""],setSelectedIds:e=>d(e),buttonProps:{"data-id":"sampling-btn-method",label:Tt.find(e=>e.id===t.method)?.label||yt,size:m.S,variant:a.Secondary}})]})]}),h&&xa(p,{name:"sampling-input-kafka-topic",label:ae,placeholder:"Type kafka topic",value:t.kafkaTopic,onChange:c,width:"320px"})]})},Pt=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Mt=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Lt=e=>e.readOnly?xa(It,{data:e.data}):xa(Ot,{category:e.category,formState:e.formState,onChange:e.onChange}),It=({data:e})=>{const a=Ta(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:ce,method:ge,description:pe,value:`${e.rule.percentageAtLeast}%`}:{title:ce,method:ve,description:null,value:null};case"noisy":return ua(e.rule.percentageAtMost)?{title:ce,method:me,description:null,value:null}:{title:ce,method:ge,description:he,value:`${e.rule.percentageAtMost}%`};case"costReduction":return{title:ce,method:ge,description:he,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),t=[{id:"method",title:ee,value:a.method},...null!=a.description?[{id:"value",title:a.description,value:a.value}]:[]];return xa(I,{richTitle:{title:a.title},children:xa(pt,{children:t.map(({id:e,title:a,value:t})=>Ca(ht,{children:[xa(N,{size:E.XXXS,color:H.Secondary,nowrap:!0,children:a}),xa(N,{size:E.XS,nowrap:!0,children:t})]},e))})})},Ot=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?Mt:Pt,n=`${l?4:3}. ${ce}`,i=de[e],s=l?pe:he,o="noisy"===e?nt:rt,d=ka(e=>t({percentageMode:e}),[t]),c=ka(e=>t({percentagePreset:e}),[t]),u=ka(e=>t({customPercentage:e.target.value}),[t]);return Ca(I,{richTitle:{title:n,subTitle:i},children:["costReduction"!==e&&xa(P,{$alignItems:"flex-start",children:xa(L,{options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&xa(st,{description:s,options:o,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:ue,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:u,customInputType:h.Decimal,customMin:0,customMax:100})]})},Dt=Ia.div`
47
- display: flex;
48
- align-items: flex-end;
49
- gap: 16px;
50
- `,zt=Ia.div`
51
- width: 280px;
52
- flex-shrink: 0;
53
- `,Xt=Ia.div`
54
- flex: 1;
55
- min-width: 0;
56
- `;function Nt(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":Te[e.category]}const Rt=e=>e.readOnly?xa(Ht,{data:e.data}):xa(Et,{formState:e.formState,onChange:e.onChange}),Ht=({data:e})=>{const a=Ta(()=>[{id:"name",title:be,value:e.rule.name||fe},{id:"type",title:ye,value:Nt(e)}],[e]),t=e.rule.notes||re;return Ca(I,{children:[xa(pt,{children:a.map(({id:e,title:a,value:t})=>Ca(ht,{children:[xa(N,{size:E.XXXS,color:H.Secondary,nowrap:!0,children:a}),xa(N,{size:E.XS,nowrap:!0,children:t})]},e))}),Ca(ht,{children:[xa(N,{size:E.XXXS,color:H.Secondary,children:xe}),xa(N,{size:E.XS,children:t})]})]})},Et=({formState:e,onChange:a})=>{const t=ka(e=>a({name:e.target.value}),[a]),l=ka(e=>a({notes:e.target.value}),[a]);return xa(I,{children:Ca(Dt,{children:[xa(zt,{children:xa(p,{name:"sampling-input-rule-name",label:be,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:Ce,value:e.name,onChange:t})}),xa(Xt,{children:xa(p,{name:"sampling-input-note",label:xe,tooltip:$e,placeholder:Se,value:e.notes,onChange:l})})]})})},Bt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],Vt=({formState:e,onChange:a})=>{const t=ka(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return xa(I,{richTitle:{title:`3. ${ye}`,subTitle:ke},children:xa(P,{$alignItems:"flex-start",children:xa(L,{options:Bt,selected:e.ruleType,setSelected:t})})})},qt=e=>{const a=Ta(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return ga(fa(e.formState));case"highlyRelevant":return ha(va(e.formState));case"costReduction":return pa(ma(e.formState))}},[e]);if(e.readOnly)return xa(Qa,{title:we,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return xa(Qa,{title:t?f:we,summary:t?[]:a,renderAction:e.renderAction})},Gt=Ia.div`
57
- display: flex;
58
- flex-wrap: wrap;
59
- gap: 8px;
60
- `,jt=Ia.div`
61
- display: flex;
62
- align-items: center;
63
- gap: 8px;
64
- padding: 8px 12px;
65
- border-radius: 8px;
66
- cursor: pointer;
67
- background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[800]};
68
- border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[750]};
69
-
70
- &:hover {
71
- background: ${({theme:e})=>e.v2.colors.silver[700]};
72
- }
73
- `,Jt=Ia.div`
74
- display: flex;
75
- width: 32px;
76
- height: 32px;
77
- justify-content: center;
78
- align-items: center;
79
- flex-shrink: 0;
80
- `,Ut=Ia.div`
81
- display: flex;
82
- flex-direction: column;
83
- gap: 12px;
84
- `,Kt=Ia.div`
85
- display: flex;
86
- flex-wrap: wrap;
87
- gap: 6px;
88
- `,Wt=Ia.div`
89
- display: flex;
90
- align-items: center;
91
- gap: 8px;
92
- &::before,
93
- &::after {
94
- content: '';
95
- flex: 1;
96
- height: 1px;
97
- background-color: ${({theme:e})=>e.v2.colors.silver[700]};
98
- }
99
- `,Ft=Ia.div`
100
- padding: 2px 10px;
101
- border-radius: 999px;
102
- background-color: ${({theme:e})=>e.v2.colors.silver[700]};
103
- border: 1px solid ${({theme:e})=>e.v2.colors.silver[600]};
104
- `,Yt={[Re.JavaScript]:"Node.js",[Re.DotNet]:".NET",[Re.Php]:"PHP",[Re.Java]:"Java",[Re.Go]:"Go",[Re.Python]:"Python",[Re.Ruby]:"Ruby",[Re.Rust]:"Rust"},Qt=[Re.Python,Re.Java,Re.JavaScript,Re.DotNet,Re.Php,Re.Ruby,Re.Go],Zt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function _t(e){const a=Yt[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}function el(e){return null!=e?`${e}. ${Je}`:Je}const al=({readOnly:e,...a})=>xa(e?rl:nl,{...a}),tl=({title:e,count:a,children:t})=>Ca(P,{$gap:6,children:[Ca(A,{$gap:8,$alignItems:"center",children:[xa(N,{size:E.XS,color:H.Primary,nowrap:!0,children:e}),a>1&&Ca(N,{size:E.XXS,color:H.Secondary,nowrap:!0,children:["(",Ge,")"]})]}),xa(Kt,{children:t})]}),ll=()=>{const e=Oa();return xa(Wt,{children:xa(Ft,{children:xa(N,{size:E.XXS,color:e.v2.colors.white[500],nowrap:!0,children:je})})})},rl=({scopes:e,titleNumber:a})=>{const t=el(a);if(ba(e))return xa(Ae,{bgTint:"900",richTitle:{title:t},withCollapse:!0,collapseIsDefaultOpen:!0,children:xa(Pe,{status:Le.Default,message:Me,fullWidth:!0})});const l=e.sources??[],r=e.namespaces??[],n=e.languages??[],i=[];return l.length&&i.push({kind:"sources",node:xa(tl,{title:Ie,count:l.length,children:l.map((e,a)=>{const t=[e.namespace,e.kind,e.name].filter(Boolean),l=t.length?t.join(" / "):De;return xa(Oe,{label:l},`src-${a}-${l}`)})})}),r.length&&i.push({kind:"namespaces",node:xa(tl,{title:ze,count:r.length,children:r.map((e,a)=>xa(Oe,{label:e},`ns-${a}-${e}`))})}),n.length&&i.push({kind:"languages",node:xa(tl,{title:Xe,count:n.length,children:n.map((e,a)=>{const t=He(e);return xa(Oe,{label:_t(e),leftIcon:t},`lang-${a}-${e}`)})})}),xa(Ae,{bgTint:"900",richTitle:{title:t,subTitle:i.length>1?Ne:void 0},withCollapse:!0,collapseIsDefaultOpen:!0,children:xa(Ae,{bgTint:"800",children:xa(Ut,{children:i.map((e,a)=>Ca($a.Fragment,{children:[a>0&&xa(ll,{}),e.node]},e.kind))})})})},nl=({scopes:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[],supportedLanguages:r,titleNumber:n,dataIdPrefix:s="source-scope",slim:o})=>{const d=e??ya(),[c,u]=wa(()=>(e=>e.sources.length>0?"source":e.namespaces.length>0?"namespace":e.languages.length>0?"language":"all")(d)),{sources:p,namespaces:h,languages:g}=d,m=p.length>0||h.length>0||g.length>0,v=Ta(()=>Zt.map(e=>"language"===e.value&&0===r?.length?null:{...e,disabled:"all"===e.value&&m}).filter(Boolean),[m]),f=Ta(()=>p.map(e=>{return a=e.namespace,t=e.kind,l=e.name,`${a}/${t}/${l}`;var a,t,l}),[p]),b=Ta(()=>[...h],[h]),y=Ta(()=>new Set(g),[g]),x=ka(e=>{u(e)},[]),C=ka(e=>{const t=e.map(e=>function(e){const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}}(e)).filter(e=>null!=e).map(e=>({namespace:e.namespace,kind:e.kind,name:e.name}));a({...d,sources:t})},[d,a]),S=ka(e=>{a({...d,namespaces:e})},[d,a]),$=ka(e=>{const t=d.languages,l=t.includes(e)?t.filter(a=>a!==e):[...t,e];a({...d,languages:l})},[d,a]),T=!m&&"all"===c,k=(r||Qt).map(e=>({id:e,label:Yt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:He(e)}));return Ca(I,{richTitle:o?{title:el(n),titleSize:E.XS,titleColor:H.Secondary,tooltip:Ee}:{title:el(n),subTitle:Ee,subTitleWrap:!0},backgroundColor:o?"transparent":void 0,padding:o?0:void 0,children:[xa(Pe,T?{status:Le.Default,message:Me,fullWidth:!0,smallIcon:!0}:{status:Le.Info,message:Ne,fullWidth:!0,smallIcon:!0}),xa(P,{$alignItems:"flex-start",children:xa(L,{options:v,selected:c,setSelected:x})}),"source"===c&&xa(Be,{multiple:!0,"data-id":`${s}-autocomplete-source`,options:t,value:f,onSelect:C,placeholder:Ve}),"namespace"===c&&xa(Be,{multiple:!0,"data-id":`${s}-autocomplete-namespace`,options:l,value:b,onSelect:S,placeholder:"Search namespace"}),"language"===c&&k.length>0&&xa(Gt,{children:k.map(({id:e,label:a,Icon:t})=>{const l=y.has(e);return Ca(jt,{$selected:l,onClick:()=>$(e),children:[xa(i,{name:`${s}-lang-${e}`,size:qe.S,value:l,onChange:()=>$(e)}),xa(Jt,{children:xa(t,{size:20})}),xa(N,{size:E.XS,nowrap:!0,children:a})]},e)})})]})},il=(e,a)=>!a?.length||!!a?.find(a=>a===e),sl=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:n,disabled:s})=>{const[o,d]=wa(1===r.length),c=Aa(JSON.stringify(r));Pa(()=>{let e=Ue(r).filter(e=>il(e,l));e.length||(e=Ke.filter(({id:e})=>il(e,l)).map(({id:e})=>e));const a=JSON.stringify(e);c.current!==a&&(c.current=a,n(e),d(1===e.length))},[l,r]);return Ca(P,{$gap:12,children:[xa(M,{label:e,required:a}),xa(A,{$gap:12,children:Ke.map(e=>{const a=il(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?xa(i,{label:e.value,disabled:s||!a||o&&t,value:t,onChange:a=>((e,a)=>{const t=e,l=a?[...r,t]:r.filter(e=>e!==t);n(l),d(1===l.length)})(e.id,a)},e.id):null})}),xa(We,{errorMessage:t})]})},ol=({minSupportedVersion:a,currentVersion:t})=>xa(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>xa(Fe,{scale:2.4,icon:()=>xa("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:xa("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${t}.`}),dl=Ia.div`
105
- display: flex;
106
- flex-direction: column;
107
- justify-content: flex-end;
108
- width: ${({$width:e})=>e};
109
- gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
110
- `,cl=Ia.div`
111
- display: flex;
112
- align-items: center;
113
- min-height: 24px;
114
- padding: 12px;
115
- border-radius: 16px 16px 0 0;
116
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
117
- `,ul=Ia.div`
118
- display: flex;
119
- flex-direction: column;
120
- gap: ${({$gap:e})=>e}px;
121
- padding: 12px 12px 0 12px;
122
- width: 100%;
123
- height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
124
- border-radius: ${({$columnHasHeader:e,$isLeft:a,$isRight:t})=>e?a?"0 0 0 16px":t?"0 16px 0 0":"0":a?"16px 0 0 16px":t?"0 16px 16px 0":"16px"};
125
- background-color: ${({theme:e})=>e.v2.colors.silver[900]};
126
- overflow-y: auto;
127
- overflow-x: hidden;
128
- `,pl=({isLeft:e,isRight:a,heightOffset:t=0,width:l,header:r,list:n})=>Ca(dl,{$width:l,$columnHasHeader:!!r,children:[r&&xa(cl,{children:r}),xa(ul,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:t,$columnHasHeader:!!r,children:n.length?n.length>1?xa(Ye,{gap:8,elements:n}):xa(Sa,{children:n[0]}):xa(Qe,{$height:"100%",children:xa(Ze,{})})})]}),hl="75vw",gl=Ia.div`
129
- display: flex;
130
- flex-direction: column;
131
- border-radius: 16px;
132
- background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
133
- overflow: hidden;
134
- `,ml=Ia.div`
135
- display: flex;
136
- gap: 12px;
137
- padding: 16px 16px 0 16px;
138
- background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
139
- position: sticky;
140
- top: 0;
141
- `,vl=Ia.div`
142
- padding: 12px 12px 0 12px;
143
- `,fl=Ia.div`
144
- display: flex;
145
- gap: 12px;
146
- padding: 16px;
147
- `,bl=Ia.div`
148
- padding: 5vh 10vw;
149
- border-radius: 12px;
150
- background-color: ${({theme:e})=>e.v2.colors.silver[800]};
151
- `,yl=Ma(({isOpen:t,withOverlay:l,disableAnimation:r,onClose:n,onBack:i,onNext:s,nextIsSkip:o,onSave:d,disableSave:c,connectionIds:u,header:p,subHeader:h,leftColumn:g,rightColumn:m,search:v,filters:f,errorMessage:b,isFormDirty:y,hideDirtyNote:x,isFetching:C,progress:S},$)=>{const[T,k]=wa(!1),[w,A]=wa(!1),[P,M]=wa(void 0);La($,()=>({clearErrors:()=>M(void 0)}));const L=w,I=ka(()=>{y&&!T?k(!0):(k(!1),n?.())},[y,T,n]),O=c||w||"boolean"==typeof y&&!y,D=ka(async()=>{A(!0);const e=await d();A(!1),!1!==e&&(e?.error?M(e.error):(u?.setValue([]),n?.()))},[d,u,n]),z=!!v||!!u||!!f,X=!!h,N=(z?48:0)+(X?50:0),R=Ta(()=>C?{status:Le.Info,message:"Fetching Data..."}:w&&!S?{status:Le.Info,message:"Saving Changes..."}:P||b?{status:Le.Error,message:P||b}:"boolean"==typeof y&&y&&!x?{status:Le.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof y||y||x?void 0:{status:Le.Success,message:"The values reflect the current configuration of the selected cluster."},[C,w,S,P,b,y,x]),H=Ta(()=>i?{label:"Back",leftIcon:Ba,variant:a.Secondary,onClick:i}:{label:"Cancel",variant:a.Secondary,onClick:I,disabled:L},[i,I,L]),[B,V]=wa(!1),q=Ta(()=>s?o?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:Va,variant:a.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:Va,variant:a.Primary,onClick:s}:{"data-id":"wide-drawer-save",label:"Save",variant:a.Primary,onClick:D,disabled:O},[s,o,D,O]);return Ca(_e,{width:hl,isOpen:t,disableAnimation:r,hideOverlay:!w&&!l,header:{...p,onClose:n?I:void 0,onCloseDisabled:L},footer:{note:R,actions:[H,q]},children:[w?xa(Qe,{$height:"calc(100vh - 136px)",children:xa(bl,{children:xa(ea,{titleSize:E.S,subTitleSize:E.XXXS,withGradient:!0,withSpinner:!0,...S})})}):Ca(gl,{children:[z&&Ca(ml,{children:[u&&xa(aa,{icon:qa,title:"Selected Clusters",badge:{label:u.value.length}}),v&&xa(ta,{width:"100%",...v}),f]}),X&&xa(vl,{children:xa(aa,{icon:h.icon,title:h.title,subTitle:h.description,badge:h.badge})}),Ca(fl,{children:[xa(pl,{isLeft:!0,heightOffset:N,...g}),xa(pl,{isRight:!0,heightOffset:N,...m})]})]}),xa(Ua,{isOpen:T,onClose:()=>k(!1),onApprove:I}),xa(e,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:B,onClose:()=>V(!1),denyButton:{label:"Go Back",variant:a.Secondary,onClick:()=>V(!1)},approveButton:{label:"Skip",variant:a.Primary,onClick:()=>{s?.(),V(!1)}}})]})});yl.displayName=yl.name;const xl=Ia.div`
152
- padding: 0 24px;
153
- border-radius: 12px;
154
- background-color: ${({$codeBgColor:e})=>e||"transparent"};
155
- `,Cl=({title:e="YAML",yaml:t,defaultOpen:l,fullHeight:r,bgTint:n="1000",codeBgColor:i})=>{const{clickCopy:s,isCopied:o}=la(),d=Ta(()=>t?[{id:na(),type:ra.Button,buttonProps:{variant:a.Text,size:m.S,leftIcon:o?Ga:ja,onClick:()=>s(t||""),disabled:o}}]:[],[t,o]);return xa(Ae,{bgTint:n,richTitle:{icon:Ja,title:e},actions:d,withCollapse:!0,collapseIsDefaultOpen:l,fullHeight:r,children:xa(xl,{$codeBgColor:i,children:t?xa(ia,{code:t,language:"yaml",theme:"duotoneDark"}):xa(Qe,{children:xa(Ze,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{Qa as A,Ua as C,Wa as D,tt as I,nt as N,kt as O,st as P,Rt as R,sl as S,ol as U,yl as W,Cl as Y,al as a,rt as b,qt as c,Vt as d,dt as e,Lt as f,Ka as g,lt as h,hl as i,it as j};