@odigos/ui-kit 0.0.245 → 0.0.246

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 (53) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/lib/chunks/helpers-BFZzc68M.js +19 -0
  3. package/lib/chunks/index-BrSebk-Z.js +155 -0
  4. package/lib/chunks/source-instrument-form-context-n8N3zC_-.js +1 -0
  5. package/lib/chunks/{ui-components-CFTFbtTq.js → ui-components-DNrEjxrR.js} +242 -221
  6. package/lib/components/_v2/cards/section-card/index.d.ts +3 -1
  7. package/lib/components/_v2/table/styled.d.ts +7 -1
  8. package/lib/components/_v2/table/table-columns/index.d.ts +2 -0
  9. package/lib/components/_v2/table/table-rows/index.d.ts +2 -0
  10. package/lib/components/_v2/typography/index.d.ts +0 -4
  11. package/lib/components/styled.d.ts +4 -1
  12. package/lib/components/v2.js +1 -1
  13. package/lib/components.js +1 -1
  14. package/lib/constants/sampling/index.d.ts +5 -0
  15. package/lib/constants.js +1 -1
  16. package/lib/containers/_v2/_drawers/edit-source-drawer/{yaml-files → debug}/index.d.ts +2 -2
  17. package/lib/containers/_v2/central-connections/index.d.ts +1 -2
  18. package/lib/containers/_v2/overview/columns/index.d.ts +1 -2
  19. package/lib/containers/_v2/overview/drawers/index.d.ts +4 -1
  20. package/lib/containers/_v2/overview/index.d.ts +0 -2
  21. package/lib/containers/_v2/pipeline-collectors/index.d.ts +3 -3
  22. package/lib/containers/_v2/pipeline-collectors/pods-info/index.d.ts +2 -2
  23. package/lib/containers/_v2/sampling-rules/helpers.d.ts +2 -1
  24. package/lib/containers/_v2/sampling-rules/rules-table/index.d.ts +1 -2
  25. package/lib/containers/_v2/sampling-rules/types.d.ts +0 -2
  26. package/lib/containers/_v2/settings/index.d.ts +0 -1
  27. package/lib/containers/service-map/index.d.ts +0 -1
  28. package/lib/containers/v2.js +152 -139
  29. package/lib/containers.js +7 -4
  30. package/lib/contexts/rule-form-context.d.ts +13 -4
  31. package/lib/contexts.js +1 -1
  32. package/lib/functions/index.d.ts +1 -0
  33. package/lib/functions/instrumentation-rule-source-scopes/index.d.ts +76 -0
  34. package/lib/functions.js +1 -1
  35. package/lib/hooks/useInstrumentationRuleFormData.d.ts +2 -2
  36. package/lib/hooks.js +1 -1
  37. package/lib/snippets/_v2/index.d.ts +1 -0
  38. package/lib/snippets/_v2/instrumentation-rule-form-sections/index.d.ts +1 -0
  39. package/lib/snippets/_v2/instrumentation-rule-form-sections/instrumentation-preview.d.ts +10 -0
  40. package/lib/snippets/_v2/rich-title/index.d.ts +5 -1
  41. package/lib/snippets/_v2/sampling-rule-form-sections/source-scope.d.ts +18 -8
  42. package/lib/snippets/v2.js +1 -1
  43. package/lib/snippets.js +2 -2
  44. package/lib/store.js +1 -1
  45. package/lib/theme.js +1 -1
  46. package/lib/types/actions/index.d.ts +5 -2
  47. package/lib/types/instrumentation-rules/index.d.ts +14 -0
  48. package/lib/types.js +1 -1
  49. package/lib/visuals.js +1 -1
  50. package/package.json +1 -1
  51. package/lib/chunks/helpers-D-CznSVG.js +0 -19
  52. package/lib/chunks/index-CA2MiIDy.js +0 -149
  53. package/lib/chunks/source-instrument-form-context-C002ZZ9a.js +0 -1
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as k,S as T,f as $,e as E,a as I,r as N,h as A,i as O,j as D,k as R,l as P,m as F,o as L,p as _,q as z,s as M,t as B}from"../chunks/helpers-D-CznSVG.js";import{q as X,R as V,U,V as H,W as j,X as G,Y as W,Z as K,_ as Y,$ as J,f as q,a0 as Z,b as Q,a1 as ee,c as te,F as oe,a2 as ne,a3 as ae,a4 as ie,a5 as le,a6 as re,a7 as se,a8 as ce,a9 as de,aa as ue,ab as pe,i as he,r as ge,ac as me,ad as fe,ae as be,af as ve,ag as ye,ah as Ce,n as Se,S as we,B as xe,G as ke,z as Te,ai as $e,aj as Ee,ak as Ie,J as Ne,al as Ae,L as Oe,M as De,K as Re,O as Pe,am as Fe,an as Le,ao as _e,ap as ze,D as Me,w as Be,aq as Xe,ar as Ve,as as Ue,at as He,au as je,av as Ge,aw as We,ax as Ke,ay as Ye,az as Je,aA as qe,A as Ze,aB as Qe,y as et,aC as tt,aD as ot,aE as nt,aF as at,aG as it,aH as lt,p as rt,C as st,j as ct,I as dt,E as ut,aI as pt,T as ht,aJ as gt,aK as mt,aL as ft,aM as bt,aN as vt,aO as yt,aP as Ct,aQ as St,aR as wt,aS as xt,aT as kt,aU as Tt,o as $t,aV as Et,H as It,aW as Nt,aX as At,aY as Ot,l as Dt,v as Rt,aZ as Pt,a_ as Ft,a$ as Lt,b0 as _t,b1 as zt,b2 as Mt,b3 as Bt,b4 as Xt,b5 as Vt,b6 as Ut,b7 as Ht,b8 as jt,b9 as Gt,ba as Wt,bb as Kt,bc as Yt,bd as Jt,be as qt,g as Zt,d as Qt,bf as eo,bg as to,bh as oo,bi as no,bj as ao,bk as io,bl as lo,bm as ro,bn as so,bo as co,Q as uo,bp as po,bq as ho,br as go,bs as mo,bt as fo,bu as bo,bv as vo,bw as yo,bx as Co,by as So,bz as wo,bA as xo,bB as ko,bC as To,bD as $o,bE as Eo,bF as Io,bG as No,bH as Ao,bI as Oo,bJ as Do,bK as Ro,bL as Po,bM as Fo,bN as Lo,bO as _o,bP as zo,bQ as Mo,bR as Bo,bS as Xo,bT as Vo,bU as Uo,bV as Ho,bW as jo,bX as Go,bY as Wo,bZ as Ko,b_ as Yo,b$ as Jo,c0 as qo,c1 as Zo,c2 as Qo,c3 as en,c4 as tn,c5 as on,c6 as nn,c7 as an,c8 as ln,c9 as rn,ca as sn,cb as cn,cc as dn,cd as un,ce as pn,cf as hn,cg as gn,ch as mn,ci as fn,cj as bn,ck as vn,cl as yn,cm as Cn,cn as Sn,co as wn,cp as xn,cq as kn,cr as Tn,cs as $n,ct as En,cu as In,cv as Nn,cw as An,cx as On,cy as Dn,cz as Rn,cA as Pn,cB as Fn,cC as Ln,cD as _n,cE as zn,cF as Mn,cG as Bn,cH as Xn,cI as Vn,cJ as Un,cK as Hn,cL as jn,cM as Gn,cN as Wn,cO as Kn,cP as Yn,cQ as Jn,cR as qn,cS as Zn,cT as Qn,cU as ea,cV as ta,cW as oa,cX as na,cY as aa,cZ as ia,c_ as la,c$ as ra,d0 as sa,d1 as ca,d2 as da,d3 as ua,d4 as pa,d5 as ha,d6 as ga,d7 as ma,d8 as fa,d9 as ba,da as va,db as ya,dc as Ca,dd as Sa,de as wa,df as xa,dg as ka,dh as Ta,e as $a,di as Ea,dj as Ia,dk as Na,dl as Aa,dm as Oa,dn as Da,dp as Ra,dq as Pa,dr as Fa,ds as La,dt as _a,du as za,dv as Ma,dw as Ba,dx as Xa,dy as Va,dz as Ua,dA as Ha,dB as ja,dC as Ga,dD as Wa,dE as Ka,dF as Ya,dG as Ja,dH as qa,dI as Za,dJ as Qa,dK as ei,dL as ti,dM as oi,dN as ni,dO as ai}from"../chunks/ui-components-CFTFbtTq.js";import{TrashIcon as ii,PlusIcon as li,ArrowRightIcon as ri,VSquareIcon as si,XSquareIcon as ci,BookIcon as di,DeleteIcon as ui,EditIcon as pi,GoLogo as hi,JavaLogo as gi,ChevronRightIcon as mi,ActionIcon as fi,DestinationIcon as bi,ChevronUpIcon as vi,ChevronDownIcon as yi,VIcon as Ci,XIcon as Si,InstrumentationRuleIcon as wi,SourceIcon as xi,NamespacesIcon as ki,SettingsIcon as Ti,PodIcon as $i,OdigosLogo as Ei,K8sLogo as Ii,RefreshIcon as Ni,ExclamationCircleIcon as Ai,QuestionCircleIcon as Oi,InboundIcon as Di,OutboundIcon as Ri,UserIcon as Pi,ExpandIcon as Fi,SearchIcon as Li,MinusIcon as _i,CopyIcon as zi,DotIcon as Mi,DownloadIcon as Bi,RefreshLeftArrowIcon as Xi,SamplingIcon as Vi,ExclamationTriangleIcon as Ui,KeyIcon as Hi,DiagnoseIcon as ji,TerminalIcon as Gi,StarIcon as Wi,ArrowIcon as Ki,ConnectionsIcon as Yi,FilterIcon as Ji,DataStreamIcon as qi,PipelineCollectorIcon as Zi,ArrowDownSquareIcon as Qi,ArrowUpSquareIcon as el,GatewayIcon as tl,YamlIcon as ol}from"../icons.js";import{S as nl,D as al,A as il,P as ll,a as rl,b as sl,R as cl,c as dl,O as ul,d as pl,e as hl,f as gl,W as ml,g as fl,C as bl,Y as vl,h as yl,i as Cl,U as Sl}from"../chunks/index-CA2MiIDy.js";import{u as wl,f as xl,g as kl,e as Tl,i as $l,h as El,S as Il,k as Nl,E as Al,l as Ol,m as Dl,j as Rl,b as Pl,d as Fl,a as Ll,A as _l,R as zl,c as Ml,D as Bl}from"../chunks/source-instrument-form-context-C002ZZ9a.js";import{createPortal as Xl}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Vl=[{id:"CREDIT_CARD",label:"Credit card"}],Ul=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],Hl=[{id:W.Pod,label:W.Pod},{id:W.Namespace,label:W.Namespace},{id:W.Node,label:W.Node}],jl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Hl}],Gl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Hl}],Wl=/^[a-zA-Z]$/,Kl=new Set(["*","+","?"]),Yl=new Set(["^","$"]),Jl={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},ql=m.div`
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as k,S as T,f as $,e as E,a as I,r as N,h as A,j as O,k as D,l as R,o as P,p as F,q as L,s as _,t as z,w as B,x as M}from"../chunks/helpers-BFZzc68M.js";import{q as X,R as V,U,V as H,W as G,X as j,Y as W,Z as K,_ as Y,$ as J,f as q,a0 as Z,b as Q,a1 as ee,c as te,F as oe,a2 as ne,a3 as ae,a4 as ie,a5 as le,a6 as re,a7 as se,a8 as ce,a9 as de,aa as ue,ab as pe,i as he,r as ge,ac as me,ad as fe,ae as be,af as ve,ag as ye,ah as Ce,n as Se,S as we,B as xe,G as ke,z as Te,ai as $e,aj as Ee,ak as Ie,J as Ne,al as Ae,L as Oe,M as De,K as Re,O as Pe,am as Fe,an as Le,ao as _e,ap as ze,D as Be,w as Me,aq as Xe,ar as Ve,as as Ue,at as He,au as Ge,av as je,aw as We,ax as Ke,ay as Ye,az as Je,aA as qe,A as Ze,aB as Qe,y as et,aC as tt,aD as ot,aE as nt,aF as at,aG as it,aH as lt,p as rt,C as st,j as ct,I as dt,E as ut,aI as pt,T as ht,aJ as gt,aK as mt,aL as ft,aM as bt,aN as vt,aO as yt,aP as Ct,aQ as St,aR as wt,aS as xt,aT as kt,aU as Tt,o as $t,aV as Et,H as It,aW as Nt,aX as At,aY as Ot,l as Dt,v as Rt,aZ as Pt,a_ as Ft,a$ as Lt,b0 as _t,b1 as zt,b2 as Bt,b3 as Mt,b4 as Xt,b5 as Vt,b6 as Ut,b7 as Ht,b8 as Gt,b9 as jt,ba as Wt,bb as Kt,bc as Yt,bd as Jt,be as qt,g as Zt,d as Qt,bf as eo,Q as to,bg as oo,bh as no,bi as ao,bj as io,bk as lo,bl as ro,bm as so,bn as co,bo as uo,bp as po,bq as ho,br as go,bs as mo,bt as fo,bu as bo,bv as vo,bw as yo,bx as Co,by as So,bz as wo,bA as xo,bB as ko,bC as To,bD as $o,bE as Eo,bF as Io,bG as No,bH as Ao,bI as Oo,bJ as Do,bK as Ro,bL as Po,bM as Fo,bN as Lo,bO as _o,bP as zo,bQ as Bo,bR as Mo,bS as Xo,bT as Vo,bU as Uo,bV as Ho,bW as Go,bX as jo,bY as Wo,bZ as Ko,b_ as Yo,b$ as Jo,c0 as qo,c1 as Zo,c2 as Qo,c3 as en,c4 as tn,c5 as on,c6 as nn,c7 as an,c8 as ln,c9 as rn,ca as sn,cb as cn,cc as dn,cd as un,ce as pn,cf as hn,cg as gn,ch as mn,ci as fn,cj as bn,ck as vn,cl as yn,cm as Cn,cn as Sn,co as wn,cp as xn,cq as kn,cr as Tn,cs as $n,ct as En,cu as In,cv as Nn,cw as An,cx as On,cy as Dn,cz as Rn,cA as Pn,cB as Fn,cC as Ln,cD as _n,cE as zn,cF as Bn,cG as Mn,cH as Xn,cI as Vn,cJ as Un,cK as Hn,cL as Gn,cM as jn,cN as Wn,cO as Kn,cP as Yn,cQ as Jn,cR as qn,cS as Zn,cT as Qn,cU as ea,cV as ta,cW as oa,cX as na,cY as aa,cZ as ia,c_ as la,c$ as ra,d0 as sa,d1 as ca,d2 as da,d3 as ua,d4 as pa,d5 as ha,d6 as ga,d7 as ma,d8 as fa,d9 as ba,da as va,db as ya,dc as Ca,dd as Sa,de as wa,df as xa,dg as ka,dh as Ta,e as $a,di as Ea,dj as Ia,dk as Na,dl as Aa,dm as Oa,dn as Da,dp as Ra,dq as Pa,dr as Fa,ds as La,dt as _a,du as za,dv as Ba,dw as Ma,dx as Xa,dy as Va,dz as Ua,dA as Ha,dB as Ga,dC as ja,dD as Wa,dE as Ka,dF as Ya,dG as Ja,dH as qa,dI as Za,dJ as Qa,dK as ei,dL as ti,dM as oi,dN as ni,dO as ai}from"../chunks/ui-components-DNrEjxrR.js";import{TrashIcon as ii,PlusIcon as li,ArrowRightIcon as ri,VSquareIcon as si,XSquareIcon as ci,BookIcon as di,DeleteIcon as ui,EditIcon as pi,GoLogo as hi,JavaLogo as gi,ChevronRightIcon as mi,ActionIcon as fi,DestinationIcon as bi,ChevronUpIcon as vi,ChevronDownIcon as yi,VIcon as Ci,XIcon as Si,InstrumentationRuleIcon as wi,SourceIcon as xi,NamespacesIcon as ki,SettingsIcon as Ti,PodIcon as $i,OdigosLogo as Ei,K8sLogo as Ii,RefreshIcon as Ni,ExclamationCircleIcon as Ai,QuestionCircleIcon as Oi,InboundIcon as Di,OutboundIcon as Ri,UserIcon as Pi,TerminalIcon as Fi,ExpandIcon as Li,SearchIcon as _i,MinusIcon as zi,CopyIcon as Bi,DotIcon as Mi,DownloadIcon as Xi,RefreshLeftArrowIcon as Vi,VmLogo as Ui,SamplingIcon as Hi,ExclamationTriangleIcon as Gi,KeyIcon as ji,DiagnoseIcon as Wi,StarIcon as Ki,ArrowIcon as Yi,ConnectionsIcon as Ji,FilterIcon as qi,DataStreamIcon as Zi,PipelineCollectorIcon as Qi,ArrowDownSquareIcon as el,ArrowUpSquareIcon as tl,GatewayIcon as ol,YamlIcon as nl}from"../icons.js";import{S as al,D as il,I as ll,a as rl,A as sl,P as cl,b as dl,c as ul,R as pl,O as hl,d as gl,e as ml,f as fl,W as bl,g as vl,C as yl,Y as Cl,h as Sl,i as wl,U as xl}from"../chunks/index-BrSebk-Z.js";import{u as kl,f as Tl,g as $l,e as El,i as Il,h as Nl,S as Al,k as Ol,E as Dl,l as Rl,m as Pl,j as Fl,b as Ll,d as _l,a as zl,A as Bl,R as Ml,c as Xl,D as Vl}from"../chunks/source-instrument-form-context-n8N3zC_-.js";import{createPortal as Ul}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Hl=[{id:"CREDIT_CARD",label:"Credit card"}],Gl=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],jl=[{id:W.Pod,label:W.Pod},{id:W.Namespace,label:W.Namespace},{id:W.Node,label:W.Node}],Wl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:jl}],Kl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:jl}],Yl=/^[a-zA-Z]$/,Jl=new Set(["*","+","?"]),ql=new Set(["^","$"]),Zl={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},Ql=m.div`
2
2
  padding: 8px 16px;
3
3
  border-radius: 6px;
4
4
  border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
@@ -18,9 +18,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
18
18
  box-decoration-break: clone;
19
19
  -webkit-box-decoration-break: clone;
20
20
  }
21
- `,Zl=m.span`
22
- background: ${({$kind:e})=>Jl[e]};
23
- `,Ql=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const a=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){a("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){a(e.slice(o,o+2),"class-content"),o+=2;continue}a(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}a(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Kl.has(t)||Yl.has(t))a(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){a(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];Wl.test(t)?a(e.slice(o,o+2),"anchor-quantifier"):a(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(a(t,"literal"),o++):(a("|","alternation"),o++)}else"^"===e[o+1]?(a("[^","class-bracket"),o+=2):(a("[","class-bracket"),o++),n=!0;else a(t,"group"),o++}}return t})(e),[e]);return t(ql,e?{"data-id":o,children:n.map((e,o)=>t(Zl,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},er="rgba(102, 191, 255, 0.5)",tr=b`
21
+ `,er=m.span`
22
+ background: ${({$kind:e})=>Zl[e]};
23
+ `,tr=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const a=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){a("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){a(e.slice(o,o+2),"class-content"),o+=2;continue}a(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}a(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Jl.has(t)||ql.has(t))a(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){a(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];Yl.test(t)?a(e.slice(o,o+2),"anchor-quantifier"):a(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(a(t,"literal"),o++):(a("|","alternation"),o++)}else"^"===e[o+1]?(a("[^","class-bracket"),o+=2):(a("[","class-bracket"),o++),n=!0;else a(t,"group"),o++}}return t})(e),[e]);return t(Ql,e?{"data-id":o,children:n.map((e,o)=>t(er,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},or="rgba(102, 191, 255, 0.5)",nr=b`
24
24
  font-family: ${({theme:e})=>e.font_family.code};
25
25
  font-size: 12px;
26
26
  line-height: 20px;
@@ -33,7 +33,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
33
33
  -moz-tab-size: 4;
34
34
  tab-size: 4;
35
35
  margin: 0;
36
- `,or=m.div`
36
+ `,ar=m.div`
37
37
  position: relative;
38
38
  width: 100%;
39
39
  min-height: ${({$minHeight:e})=>e}px;
@@ -45,8 +45,8 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
45
45
  &:focus-within {
46
46
  border-color: ${({theme:e})=>e.v2.colors.silver[300]};
47
47
  }
48
- `,nr=m.div`
49
- ${tr}
48
+ `,ir=m.div`
49
+ ${nr}
50
50
  position: absolute;
51
51
  inset: 0;
52
52
  padding: 12px;
@@ -59,8 +59,8 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
59
59
  box-decoration-break: clone;
60
60
  -webkit-box-decoration-break: clone;
61
61
  }
62
- `,ar=m.textarea`
63
- ${tr}
62
+ `,lr=m.textarea`
63
+ ${nr}
64
64
  position: relative;
65
65
  z-index: 1;
66
66
  display: block;
@@ -78,18 +78,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
78
78
  &::placeholder {
79
79
  color: ${({theme:e})=>e.v2.colors.silver[600]};
80
80
  }
81
- `,ir=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),lr=({regex:o,value:n,onChange:r,minHeight:s=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return ir(t);let o;try{o=new RegExp(e)}catch{return ir(t)}const n=o.exec(t);if(!n)return ir(t);const a=n.index,i=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=n[0].indexOf(n[1]),r=l>=0?a+l:a,s=r+n[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,r),capture:t.slice(r,s),matchPost:t.slice(s,i),after:t.slice(i)}})(o,n),[o,n]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(or,{$minHeight:s,children:[e(nr,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:er},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:er},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(ar,{ref:u,$minHeight:s,value:n,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},rr=m.div`
81
+ `,rr=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),sr=({regex:o,value:n,onChange:r,minHeight:s=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return rr(t);let o;try{o=new RegExp(e)}catch{return rr(t)}const n=o.exec(t);if(!n)return rr(t);const a=n.index,i=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=n[0].indexOf(n[1]),r=l>=0?a+l:a,s=r+n[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,r),capture:t.slice(r,s),matchPost:t.slice(s,i),after:t.slice(i)}})(o,n),[o,n]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(ar,{$minHeight:s,children:[e(ir,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:or},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:or},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(lr,{ref:u,$minHeight:s,value:n,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},cr=m.div`
82
82
  flex: 1;
83
83
  min-height: 0;
84
84
  overflow-y: auto;
85
- `,sr=m.div`
85
+ `,dr=m.div`
86
86
  background: ${({theme:e})=>e.v2.colors.silver[900]};
87
87
  border-radius: 8px;
88
88
  padding: 8px;
89
89
  display: flex;
90
90
  flex-direction: column;
91
91
  gap: 12px;
92
- `,cr=m.div`
92
+ `,ur=m.div`
93
93
  padding: 8px 16px;
94
94
  border-radius: 8px;
95
95
  background: ${({theme:e})=>e.v2.colors.silver[800]};
@@ -100,7 +100,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
100
100
  word-break: break-all;
101
101
  white-space: pre-wrap;
102
102
  user-select: text;
103
- `,dr=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[s,c]=r(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:Z.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:Z.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:Z.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:Z.RESULT_NO_MATCH}})(n,s),[n,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(q,{isOpen:o,header:{title:Z.TITLE,onClose:()=>{c(""),i()}},children:t(rr,{children:e(sr,{children:[e(V,{$gap:6,children:[t(U,{label:Z.REGEX_LABEL}),t(Ql,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(Q,{size:te.XXS,color:ee.Secondary,children:Z.REGEX_EMPTY_HINT})]}),e(V,{$gap:6,children:[e(oe,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:Z.TEST_STRING_LABEL}),t(ne,{"data-id":"regex-tester-unescape",label:Z.UNESCAPE_LABEL,tooltip:Z.UNESCAPE_TOOLTIP,variant:ie.Secondary,size:ae.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],a="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=a){t+=a,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=s,!/\\["'\\nrt]/.test(p))})]}),t(lr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:Z.TEST_STRING_PLACEHOLDER,regex:n,value:s,onChange:c,minHeight:240}),t(j,{helpMessage:Z.TEST_STRING_HELP})]}),e(V,{$gap:8,children:[t(U,{label:Z.RESULT_LABEL}),t(cr,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(Q,{size:te.XXS,color:ee.Secondary,children:Z.RESULT_CAPTURE_HINT})]})]})})});var p},ur=X.Extractions;var pr;!function(e){e.Preset="preset",e.Regex="regex"}(pr||(pr={}));const hr=[se.JSON,se.SQL,se.ResourcePath],gr=(e=se.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),mr=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,fr=m.div`
103
+ `,pr=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[s,c]=r(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:Z.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:Z.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:Z.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:Z.RESULT_NO_MATCH}})(n,s),[n,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(q,{isOpen:o,header:{title:Z.TITLE,onClose:()=>{c(""),i()}},children:t(cr,{children:e(dr,{children:[e(V,{$gap:6,children:[t(U,{label:Z.REGEX_LABEL}),t(tr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(Q,{size:te.XXS,color:ee.Secondary,children:Z.REGEX_EMPTY_HINT})]}),e(V,{$gap:6,children:[e(oe,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:Z.TEST_STRING_LABEL}),t(ne,{"data-id":"regex-tester-unescape",label:Z.UNESCAPE_LABEL,tooltip:Z.UNESCAPE_TOOLTIP,variant:ie.Secondary,size:ae.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],a="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=a){t+=a,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=s,!/\\["'\\nrt]/.test(p))})]}),t(sr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:Z.TEST_STRING_PLACEHOLDER,regex:n,value:s,onChange:c,minHeight:240}),t(G,{helpMessage:Z.TEST_STRING_HELP})]}),e(V,{$gap:8,children:[t(U,{label:Z.RESULT_LABEL}),t(ur,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(Q,{size:te.XXS,color:ee.Secondary,children:Z.RESULT_CAPTURE_HINT})]})]})})});var p},hr=X.ExtractAttribute;var gr;!function(e){e.Preset="preset",e.Regex="regex"}(gr||(gr={}));const mr=[se.JSON,se.SQL,se.ResourcePath],fr=(e=se.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),br=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,vr=m.div`
104
104
  width: calc(100% - 16px);
105
105
  background: ${({theme:e})=>e.v2.colors.silver[800]};
106
106
  border-radius: 8px;
@@ -108,13 +108,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
108
108
  display: flex;
109
109
  flex-direction: column;
110
110
  gap: 8px;
111
- `,br=m.div`
111
+ `,yr=m.div`
112
112
  flex: 1;
113
113
  min-width: 0;
114
- `,vr=m.div`
114
+ `,Cr=m.div`
115
115
  /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
116
116
  padding-top: 24px;
117
- `,yr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Cr=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},Sr=X.UrlTemplatizationRulesGroups,wr=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],xr={[ge.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Ul.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(j,{errorMessage:l[o]})]},o))}),t(G,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:jl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(G,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Gl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[ge.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(K,{label:"Overwrite existing values",labelAlign:Y.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(G,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[ge.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(J,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[ge.RenameAttributes]:({value:e,setValue:o,formErrors:a})=>{const i=e[X.Renames],[l,s]=r(()=>yr(i));return n(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(Cr(l),i||{})||s(yr(i))},[i]),t(G,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),o(X.Renames,Cr(t))},errorMessage:a[X.Renames]})},[ge.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Vl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Vl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(j,{errorMessage:i[X.PiiCategories]})]})),[ge.URLTemplatization]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=n[Sr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(Sr,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(s,{children:[t(he,{}),e(V,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(ne,{leftIcon:()=>t(ii,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(pe,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(G,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:wr,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(J,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(j,{errorMessage:i[Sr]})]},`url-templatization-group-${n}`)),t(ne,{variant:ie.Secondary,label:"Add rule group",leftIcon:li,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(he,{})]})},[ge.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=i[ur],c=o[ur]||[],[d,u]=r(()=>(e=>e.length&&e.some(mr)?pr.Regex:pr.Preset)(c)),[p,h]=r(null);n(()=>{0===c.length&&a(ur,[d===pr.Preset?gr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{a(ur,c.map((o,n)=>n===e?{...o,...t}:o))},m=()=>{a(ur,[...c,d===pr.Preset?gr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===pr.Preset,v=c.length?c:[b?gr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],y=null!=p&&v[p]?.regex||"";return e(V,{$gap:16,$width:"100%",children:[t(le,{options:[{value:pr.Preset,label:re.SEGMENT_PRESET_LABEL,tooltip:re.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:pr.Regex,label:re.SEGMENT_REGEX_LABEL,tooltip:re.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),a(ur,[e===pr.Preset?gr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(V,{$gap:8,$width:"100%",children:[v.map((o,n)=>{const i=n===v.length-1,r=o.dataFormat||se.JSON,s=de[r];return e(fr,{"data-id":`extract-row-${n}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(V,{$gap:10,children:[t(U,{label:b?re.PRESET_ROW_TITLE(n):re.REGEX_ROW_TITLE(n)}),b&&t(oe,{$gap:24,children:hr.map(e=>t(ce,{"data-id":`extract-row-${n}-fmt-${e}`,size:ue.L,label:de[e].label,value:r===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!b&&t(ne,{"data-id":`extract-row-${n}-test-regex`,label:re.TEST_REGEX_LABEL,variant:ie.Secondary,size:ae.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ne,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(ii,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);a(ur,t.length?t:[d===pr.Preset?gr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(ne,{"data-id":`extract-row-${n}-add`,leftIcon:li,variant:ie.Secondary,size:ae.S,onClick:m})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(br,{children:t(pe,{name:`extract-row-${n}-lookupKey`,label:s.keyLabel,placeholder:s.placeholder,helpMessage:s.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(vr,{children:t(ri,{size:24,fill:l.v2.colors.silver[200]})}),t(br,{children:t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(V,{$gap:12,$width:"100%",children:[t(pe,{name:`extract-row-${n}-regex`,label:re.REGEX_LABEL,placeholder:re.REGEX_PLACEHOLDER,helpMessage:re.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(j,{errorMessage:s})]}),t(dr,{isOpen:null!=p,regex:y,onClose:()=>h(null)})]})}},kr=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=xr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Tr=()=>{const o=f(),{selectedOption:n,genericForm:a}=wl();if(!a||!n)return t(me,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ne,{leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(nl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(pe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(kr,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},$r=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||Ce(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(al,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),Er=m(oe)`
117
+ `,Sr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),wr=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},xr=X.UrlTemplatizationRulesGroups,kr=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],Tr={[ge.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Gl.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(G,{errorMessage:l[o]})]},o))}),t(j,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Wl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(j,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Kl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[ge.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(K,{label:"Overwrite existing values",labelAlign:Y.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(j,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[ge.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(J,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[ge.RenameAttributes]:({value:e,setValue:o,formErrors:a})=>{const i=e[X.Renames],[l,s]=r(()=>Sr(i));return n(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(wr(l),i||{})||s(Sr(i))},[i]),t(j,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),o(X.Renames,wr(t))},errorMessage:a[X.Renames]})},[ge.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Hl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Hl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(G,{errorMessage:i[X.PiiCategories]})]})),[ge.URLTemplatization]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=n[xr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(xr,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(s,{children:[t(he,{}),e(V,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(ne,{leftIcon:()=>t(ii,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(pe,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(j,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:kr,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(J,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(G,{errorMessage:i[xr]})]},`url-templatization-group-${n}`)),t(ne,{variant:ie.Secondary,label:"Add rule group",leftIcon:li,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(he,{})]})},[ge.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=i[hr],c=o[hr]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(br)?gr.Regex:gr.Preset)(c)),[p,h]=r(null),g=e=>a(hr,{extractions:e});n(()=>{0===c.length&&g([d===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((o,n)=>n===e?{...o,...t}:o))},b=()=>{g([...c,d===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===gr.Preset,y=c.length?c:[v?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(V,{$gap:16,$width:"100%",children:[t(le,{options:[{value:gr.Preset,label:re.SEGMENT_PRESET_LABEL,tooltip:re.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:gr.Regex,label:re.SEGMENT_REGEX_LABEL,tooltip:re.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),g([e===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(V,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const a=n===y.length-1,i=o.dataFormat||se.JSON,r=de[i];return e(vr,{"data-id":`extract-row-${n}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(V,{$gap:10,children:[t(U,{label:v?re.PRESET_ROW_TITLE(n):re.REGEX_ROW_TITLE(n)}),v&&t(oe,{$gap:24,children:mr.map(e=>t(ce,{"data-id":`extract-row-${n}-fmt-${e}`,size:ue.L,label:de[e].label,value:i===e,onChange:t=>t&&m(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!v&&t(ne,{"data-id":`extract-row-${n}-test-regex`,label:re.TEST_REGEX_LABEL,variant:ie.Secondary,size:ae.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ne,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(ii,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);g(t.length?t:[d===gr.Preset?fr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(ne,{"data-id":`extract-row-${n}-add`,leftIcon:li,variant:ie.Secondary,size:ae.S,onClick:b})]})]}),v?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(yr,{children:t(pe,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>m(n,{lookupKey:e.target.value})})}),t(Cr,{children:t(ri,{size:24,fill:l.v2.colors.silver[200]})}),t(yr,{children:t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})})]}):e(V,{$gap:12,$width:"100%",children:[t(pe,{name:`extract-row-${n}-regex`,label:re.REGEX_LABEL,placeholder:re.REGEX_PLACEHOLDER,helpMessage:re.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>m(n,{regex:e.target.value})}),t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(G,{errorMessage:s})]}),t(pr,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},$r=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Tr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Er=()=>{const o=f(),{selectedOption:n,genericForm:a}=kl();if(!a||!n)return t(me,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ne,{leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(al,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(pe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t($r,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Ir=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||Ce(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(il,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),Nr=m(oe)`
118
118
  position: sticky;
119
119
  bottom: 4px;
120
120
  align-self: center;
@@ -125,17 +125,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
125
125
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
126
126
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
127
127
  z-index: 1;
128
- `,Ir=c(({testConnection:o,isEdit:a},i)=>{const l=f(),{isVm:s}=y(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=xl(),[v,C]=r(h?.testResult),[S,w]=r(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||s)return;const e=await o($e(u.formData));return C(e),e};return d(i,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,o]),u&&c?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Se,{status:we.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Se,{status:we.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[!s&&t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:l.v2.colors.red[800]}],size:be.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(ne,{"data-id":"dest-form-docs",leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(nl,{title:"This connection will monitor:",allowedSignals:Te(c.option.supportedSignals),selectedSignals:ke(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(xe.Logs),metrics:e.includes(xe.Metrics),traces:e.includes(xe.Traces),profiles:e.includes(xe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(pe,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t($r,{signals:ke(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(Er,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:ui,variant:ie.Secondary,textColor:l.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!s&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ie.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:pi,variant:ie.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(me,{title:"No active form"})});Ir.displayName="AddDestinationForm";const Nr=[{id:Ee.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ee.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ee.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ar=[{id:Ee.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ee.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ee.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Or=["*"],Dr=[{id:Ae.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ae.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ae.DbQuery,label:"Collect DB query",tooltip:""},{id:Ae.Messaging,label:"Collect messaging",tooltip:""}],Rr={[Re.Java]:[new De("","")],[Re.Golang]:[new Oe("")]},Pr={[Pe.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);n(()=>{if(!c.length&&!s){const e={[Ee.FilePath]:!0,[Ee.Function]:!0,[Ee.LineNumber]:!0,[Ee.Column]:null,[Ee.Namespace]:null,[Ee.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ee).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:Nr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]}),e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:Ar.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]})]})},[Pe.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Re.Golang]||[]).map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Re.Java]||[]).map(e=>new De(e.className,e.methodName)),[i]);return n(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[Re.Golang]:Rr[Re.Golang],[Re.Java]:Rr[Re.Java]})},[]),e(o,{children:[e(V,{children:[e(oe,{$gap:8,children:[t(hi,{}),t(U,{label:"Golang custom probes"})]}),t(G,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Re.Golang]=e.map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Re.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(oe,{$gap:8,children:[t(gi,{}),t(U,{label:"Java custom probes"})]}),t(G,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Re.Golang]=c,t[Re.Java]=e.map(e=>new De(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Pe.HeadersCollection]:({value:e,setValue:o,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Ne.HeaderKeys]||[],[e]),s=e=>{const t={[Ne.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{r.length||l||s(Or)},[]),t(J,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[Pe.PayloadCollection]:({value:o,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!r){const e={[Ae.HttpRequest]:{},[Ae.HttpResponse]:{},[Ae.DbQuery]:{},[Ae.Messaging]:{}};i("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:Dr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Ae.HttpRequest]:o.includes(Ae.HttpRequest)?{}:null,[Ae.HttpResponse]:o.includes(Ae.HttpResponse)?{}:null,[Ae.DbQuery]:o.includes(Ae.DbQuery)?{}:null,[Ae.Messaging]:o.includes(Ae.Messaging)?{}:null};i("payloadCollection",n)})(e,t)})},e))}),t(j,{errorMessage:r})]})},[Pe.UnknownType]:null},Fr=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Pr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Lr=()=>{const o=f(),{selectedOption:n,genericForm:a}=kl();if(!a||!n)return t(me,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ne,{leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),e(oe,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Fe,{label:Le[e],leftIcon:_e(e),status:we.Default,useSecondaryTone:!0},e))]}),t(pe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:i.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName}),t(Fr,{ruleType:n.type,value:i,setValue:(e,t)=>l(e,t),formErrors:r}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},_r=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Tl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(ze,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Me.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ie.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ie.Secondary,onClick:n}})},zr=({autoFocus:o})=>{const{dataStreams:n}=Be(),{genericForm:i,excludeName:l,editingName:r}=Tl(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(V,{$width:"100%",$gap:12,children:[t(pe,{name:"data-stream-name",label:Me.STREAM_NAME,placeholder:Me.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Me.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Se,{status:we.Warning,message:Me.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Mr=()=>{const{selectedStreamName:e}=Be(),{genericForm:o}=$l();if(!o)return t(me,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(pe,{name:"sourceName",label:Me.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Br=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Xr=m.div`
128
+ `,Ar=c(({testConnection:o,isEdit:a},i)=>{const l=f(),{isVm:s}=y(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=Tl(),[v,C]=r(h?.testResult),[S,w]=r(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||s)return;const e=await o($e(u.formData));return C(e),e};return d(i,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,o]),u&&c?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Se,{status:we.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Se,{status:we.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[!s&&t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:l.v2.colors.red[800]}],size:be.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(ne,{"data-id":"dest-form-docs",leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(al,{title:"This connection will monitor:",allowedSignals:Te(c.option.supportedSignals),selectedSignals:ke(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(xe.Logs),metrics:e.includes(xe.Metrics),traces:e.includes(xe.Traces),profiles:e.includes(xe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(pe,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(Ir,{signals:ke(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(Nr,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:ui,variant:ie.Secondary,textColor:l.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!s&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ie.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:pi,variant:ie.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(me,{title:"No active form"})});Ar.displayName="AddDestinationForm";const Or=[{id:Ee.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ee.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ee.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Dr=[{id:Ee.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ee.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ee.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Rr=["*"],Pr=[{id:Ae.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ae.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ae.DbQuery,label:"Collect DB query",tooltip:""},{id:Ae.Messaging,label:"Collect messaging",tooltip:""}],Fr={[Re.Java]:[new De("","")],[Re.Golang]:[new Oe("")]},Lr={[Pe.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);n(()=>{if(!c.length&&!s){const e={[Ee.FilePath]:!0,[Ee.Function]:!0,[Ee.LineNumber]:!0,[Ee.Column]:null,[Ee.Namespace]:null,[Ee.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ee).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:Or.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(G,{errorMessage:s})]}),e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:Dr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(G,{errorMessage:s})]})]})},[Pe.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Re.Golang]||[]).map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Re.Java]||[]).map(e=>new De(e.className,e.methodName)),[i]);return n(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[Re.Golang]:Fr[Re.Golang],[Re.Java]:Fr[Re.Java]})},[]),e(o,{children:[e(V,{children:[e(oe,{$gap:8,children:[t(hi,{}),t(U,{label:"Golang custom probes"})]}),t(j,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Re.Golang]=e.map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Re.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(oe,{$gap:8,children:[t(gi,{}),t(U,{label:"Java custom probes"})]}),t(j,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Re.Golang]=c,t[Re.Java]=e.map(e=>new De(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Pe.HeadersCollection]:({value:e,setValue:o,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Ne.HeaderKeys]||[],[e]),s=e=>{const t={[Ne.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{r.length||l||s(Rr)},[]),t(J,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[Pe.PayloadCollection]:({value:o,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!r){const e={[Ae.HttpRequest]:{},[Ae.HttpResponse]:{},[Ae.DbQuery]:{},[Ae.Messaging]:{}};i("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:Pr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Ae.HttpRequest]:o.includes(Ae.HttpRequest)?{}:null,[Ae.HttpResponse]:o.includes(Ae.HttpResponse)?{}:null,[Ae.DbQuery]:o.includes(Ae.DbQuery)?{}:null,[Ae.Messaging]:o.includes(Ae.Messaging)?{}:null};i("payloadCollection",n)})(e,t)})},e))}),t(G,{errorMessage:r})]})},[Pe.UnknownType]:null},_r=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Lr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},zr=()=>{const o=f(),{selectedOption:n,genericForm:a,sourceOptions:i,namespaceOptions:l}=$l();if(!a||!n)return t(me,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(ne,{leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(ll,{option:n,formState:r}),e(oe,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Fe,{label:Le[e],leftIcon:_e(e),backgroundColor:o.v2.colors.purple[900]},e))]}),t(rl,{scopes:r.sourceScopes,onChange:e=>s("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:n.type===Pe.CustomInstrumentation?[]:n.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(pe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:r.ruleName,onChange:({target:{value:e}})=>s("ruleName",e),errorMessage:c.ruleName}),t(_r,{ruleType:n.type,value:r,setValue:(e,t)=>s(e,t),formErrors:c}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},Br=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=El();if(!e)return null;const{existingName:a,editingName:i}=e;return t(ze,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Be.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ie.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ie.Secondary,onClick:n}})},Mr=({autoFocus:o})=>{const{dataStreams:n}=Me(),{genericForm:i,excludeName:l,editingName:r}=El(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(V,{$width:"100%",$gap:12,children:[t(pe,{name:"data-stream-name",label:Be.STREAM_NAME,placeholder:Be.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Be.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Se,{status:we.Warning,message:Be.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Xr=()=>{const{selectedStreamName:e}=Me(),{genericForm:o}=Il();if(!o)return t(me,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(pe,{name:"sourceName",label:Be.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Vr=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ur=m.div`
129
129
  display: flex;
130
130
  flex-direction: column;
131
131
  gap: 24px;
132
- `,Vr=m.div`
132
+ `,Hr=m.div`
133
133
  display: contents;
134
134
  & > * {
135
135
  opacity: ${({$faded:e})=>e?.4:1};
136
136
  transition: opacity 0.2s ease;
137
137
  }
138
- `,Ur=({value:e})=>{const o=f();return t(Fe,e?{status:we.Success,label:We,leftIcon:si}:{label:Ke,leftIcon:ci,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Hr=({value:e,onChange:o})=>{const n=f(),i=a(()=>[{icon:si,label:We,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:ci,label:Ke,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(le,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},jr=()=>{const e=El();switch(e.formType){case Il.Create:return t(Gr,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Hr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Il.View:return e.data?e.isEditing?t(Gr,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Hr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Wr,{data:e.data,renderAction:()=>t(Ur,{value:!e.data?.rule.disabled})}):null;case Il.EditAutoNoisy:return t(Kr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ge,sectionTitle:Ue,sectionSubTitle:je,presetLabel:Ve,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Hr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Il.EditAutoCostReduction:return t(Kr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:He,sectionTitle:Ue,presetLabel:Ve,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Hr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Il.EditAutoHighlyRelevant:return t(Xr,{children:t(il,{title:e.localEnabled?void 0:Xe,summary:e.summary,renderAction:()=>t(Hr,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Gr=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:r})=>e(Xr,{children:[t(sl,{category:o,formState:n,renderAction:r}),e(Vr,{$faded:!!n.disabled,children:[t(cl,{category:o,formState:n,onChange:a}),t(dl,{formState:n,onChange:a,sourceOptions:i,namespaceOptions:l}),t(ul,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(pl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(hl,{ruleType:n.ruleType,formState:n,onChange:a}),t(gl,{category:o,formState:n,onChange:a})]})]}),Wr=({data:o,renderAction:n})=>e(Xr,{children:[t(sl,{readOnly:!0,summary:o.summary,renderAction:n}),t(cl,{readOnly:!0,data:o}),t(dl,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(ul,{readOnly:!0,data:o}),t(gl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(hl,{readOnly:!0,rule:o.rule})]}),Kr=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:r,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>g(e),[g]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(Xr,{children:[t(il,{title:o?void 0:a,summary:n,renderAction:b}),t(Vr,{$faded:!o,children:e(Ye,{richTitle:{title:i,subTitle:r},children:[d&&t(V,{$alignItems:"flex-start",children:t(le,{options:Br,selected:u,setSelected:v})}),S&&t(ll,{description:s,options:rl,selected:h,onSelect:y,customName:c,customLabel:Je,customPlaceholder:"5%",customValue:m,onCustomChange:C})]})})]})},Yr=m.div`
138
+ `,Gr=({value:e})=>{const o=f();return t(Fe,e?{status:we.Success,label:We,leftIcon:si}:{label:Ke,leftIcon:ci,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},jr=({value:e,onChange:o})=>{const n=f(),i=a(()=>[{icon:si,label:We,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:ci,label:Ke,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(le,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},Wr=()=>{const e=Nl();switch(e.formType){case Al.Create:return t(Kr,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(jr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Al.View:return e.data?e.isEditing?t(Kr,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(jr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Yr,{data:e.data,renderAction:()=>t(Gr,{value:!e.data?.rule.disabled})}):null;case Al.EditAutoNoisy:return t(Jr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:je,sectionTitle:Ue,sectionSubTitle:Ge,presetLabel:Ve,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(jr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Al.EditAutoCostReduction:return t(Jr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:He,sectionTitle:Ue,presetLabel:Ve,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(jr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Al.EditAutoHighlyRelevant:return t(Ur,{children:t(sl,{title:e.localEnabled?void 0:Xe,summary:e.summary,renderAction:()=>t(jr,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Kr=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:r})=>e(Ur,{children:[t(ul,{category:o,formState:n,renderAction:r}),e(Hr,{$faded:!!n.disabled,children:[t(pl,{category:o,formState:n,onChange:a}),t(rl,{scopes:n.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(hl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(gl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(ml,{ruleType:n.ruleType,formState:n,onChange:a}),t(fl,{category:o,formState:n,onChange:a})]})]}),Yr=({data:o,renderAction:n})=>e(Ur,{children:[t(ul,{readOnly:!0,summary:o.summary,renderAction:n}),t(pl,{readOnly:!0,data:o}),t(rl,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(hl,{readOnly:!0,data:o}),t(fl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(ml,{readOnly:!0,rule:o.rule})]}),Jr=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:r,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>g(e),[g]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(Ur,{children:[t(sl,{title:o?void 0:a,summary:n,renderAction:b}),t(Hr,{$faded:!o,children:e(Ye,{richTitle:{title:i,subTitle:r},children:[d&&t(V,{$alignItems:"flex-start",children:t(le,{options:Vr,selected:u,setSelected:v})}),S&&t(cl,{description:s,options:dl,selected:h,onSelect:y,customName:c,customLabel:Je,customPlaceholder:"5%",customValue:m,onCustomChange:C})]})})]})},qr=m.div`
139
139
  display: flex;
140
140
  align-items: center;
141
141
  justify-content: space-between;
@@ -146,29 +146,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
146
146
  cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
147
147
  opacity: ${({$disabled:e})=>e?.5:1};
148
148
  &:hover {
149
- background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>e?t?o.v2.colors.purple[700]:o.v2.colors.silver[600]:t?o.v2.colors.purple[800]:o.v2.colors.silver[700]};
149
+ background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
150
150
  }
151
- `,Jr=m.div`
151
+ `,Zr=m.div`
152
152
  display: flex;
153
153
  align-items: center;
154
154
  justify-content: center;
155
155
  padding: 8px;
156
156
  border-radius: 8px;
157
157
  background-color: ${({theme:e})=>e.v2.colors.white[500]+qe["004"]};
158
- `,qr=({dataId:o,icon:n,title:a,description:i,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:g})=>e(Yr,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(V,{$gap:4,children:[e(oe,{$gap:12,children:[g&&t(H,{partiallyChecked:h||!1,value:p||!1,onChange:e=>g(e)}),n&&t(Jr,{children:t(n,{size:20})}),t(Q,{size:te.XS,children:a})]}),i&&t(Q,{size:te.XXXS,color:ee.Secondary,children:i})]}),(l||c)&&e(oe,{$gap:8,children:[c,l&&t(mi,{size:18})]})]}),Zr=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createAction:l,withOverlay:s})=>{const[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=wl(),f=a(()=>(c?Ze.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):Ze).filter(e=>!!e),[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(qr,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p?.type,f.length,h]),v=a(()=>p?[t(Tr,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:fi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(ml,{ref:u,isOpen:!0,withOverlay:s,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await l(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Me.CREATING_ACTION,subTitle:Me.CREATING_ACTION_SUBTITLE},header:{icon:fi,title:Me.ADD_ACTION,subTitle:Me.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Qr=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(et).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=a(()=>{const e=Object.values(xe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(tt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(le,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},es=m.div`
158
+ `,Qr=({dataId:o,icon:n,title:a,description:i,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:g})=>e(qr,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(V,{$gap:4,children:[e(oe,{$gap:12,children:[g&&t(H,{partiallyChecked:h||!1,value:p||!1,onChange:e=>g(e)}),n&&t(Zr,{children:t(n,{size:20})}),t(Q,{size:te.XS,children:a})]}),i&&t(Q,{size:te.XXXS,color:ee.Secondary,children:i})]}),(l||c)&&e(oe,{$gap:8,children:[c,l&&t(mi,{size:18})]})]}),es=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createAction:l,withOverlay:s})=>{const[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=kl(),f=a(()=>(c?Ze.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):Ze).filter(e=>!!e),[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(Qr,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p?.type,f.length,h]),v=a(()=>p?[t(Er,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:fi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(bl,{ref:u,isOpen:!0,withOverlay:s,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await l(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Be.CREATING_ACTION,subTitle:Be.CREATING_ACTION_SUBTITLE},header:{icon:fi,title:Be.ADD_ACTION,subTitle:Be.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},ts=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(et).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=a(()=>{const e=Object.values(xe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(tt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(le,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},os=m.div`
159
159
  display: flex;
160
160
  flex-direction: column;
161
161
  padding: 8px;
162
162
  border-radius: 16px;
163
163
  border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
164
164
  background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
165
- `,ts=m.div`
165
+ `,ns=m.div`
166
166
  display: flex;
167
167
  align-items: center;
168
168
  justify-content: space-between;
169
169
  gap: 12px;
170
170
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
171
- `,os=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(es,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(ts,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(Q,{size:te.XS,children:o}),n&&t(Ie,{text:n,withIcon:!0}),t(Fe,{label:a.length,status:l?we.Default:void 0})]}),t(ot,{icon:s?vi:yi,size:nt.M,onClick:()=>c(e=>!e)})]}),s?t(V,{children:a.length?u.toArray(a):t(Qe,{$padding:"12px 0",children:t(me,{})})}):null]})},ns=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Te(e.supportedSignals).includes(o.signalType))):e,as=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(qr,{icon:lt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Fe,{status:n.succeeded?we.Success:we.Error,leftIcon:n.succeeded?Ci:Si})}),is=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=xl();return o?.length?t(os,{title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:o.map((o,n)=>t(as,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(os,{purpleColors:!0,title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(as,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ls;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(ls||(ls={}));const rs=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ls.SELF_HOSTED?n.push(...e.items):e.name===ls.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=rt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=st(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[et.DETECTED]:o,[et.SELF_HOSTED]:n,[et.MANAGED]:a}},ss=({onClose:e,onBack:o,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,getDestinationCategories:d,getPotentialDestinations:u,initialInputs:p,testConnection:h,createDestination:g,updateDestination:m,withOverlay:f,disableAnimation:b})=>{const[v,y]=r(""),[C,S]=r({categoryType:null,signalType:null}),{destinations:w}=ct(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=xl();n(()=>{p&&$(p)},[p]);const[E,I]=r(!0),[N,A]=r([]),[O,D]=r({[et.ALL]:[],[et.UNSAVED]:[],[et.EXISTS]:[],[et.DETECTED]:[],[et.SELF_HOSTED]:[],[et.MANAGED]:[]});n(()=>{const e=w.map(e=>{let t;for(const o of N){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=st(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});D(t=>({...t,[et.EXISTS]:e}))},[w,N]);const R=l(async()=>{try{I(!0);const[e,t]=await Promise.all([d(),u()]);e&&A(e.destinationCategories.categories),D(o=>({...o,...rs(e,t)}))}catch(e){}finally{I(!1)}},[]);n(()=>{R()},[]);const P=l(async()=>{const e=(await Promise.all(T.map(({option:e,formData:t})=>{const o=$e(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e]))return m(e.id,o,s)}return g(o,s)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[T,s,g,m]),F=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=xl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(is,{listType:et.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(et)){if(i.categoryType&&i.categoryType!==e)continue;const l=ns(o[e],n,i);l.length&&a.push(t(is,{listType:e,destinationOptions:l},e))}return e&&a.push(t(Qe,{$height:"100%",children:t(at,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:E,destinationsByCategory:O,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:o}=xl();return{width:"60%",list:o?[t(Ir,{testConnection:e},o.option.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:bi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(ml,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(T):void 0,onNext:i?()=>i(T):void 0,nextIsSkip:!T.length,onSave:P,disableSave:!x&&!T.length,isFetching:E,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Me.CREATING_DESTINATION,subTitle:Me.CREATING_DESTINATION_SUBTITLE},header:{icon:bi,title:Me.ADD_DESTINATIONS,subTitle:Me.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:v,onChange:y},filters:t(Qr,{destinationsByCategory:O,filters:C,setFilters:S}),leftColumn:F,rightColumn:L})},cs=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createInstrumentationRule:l,withOverlay:s})=>{const[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=kl(),f=a(()=>c?dt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):dt,[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(qr,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(Lr,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:wi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(ml,{ref:u,isOpen:!0,withOverlay:s,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await l(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Me.CREATING_INSTRUMENTATION_RULE,subTitle:Me.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:wi,title:Me.ADD_INSTRUMENTATION_RULE,subTitle:Me.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},ds={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Me.FETCHING_NAMESPACES,subTitle:Me.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Me.SELECT_NAMESPACE,subTitle:Me.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},us={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===ut.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},ps=e=>e?us:ds,hs="No matches",gs="No sources",ms=e=>`No sources matched the filter '${e}'`,fs=e=>(e?"Unselect":"Select")+" all",bs="Show only:",vs="Selected",ys="Auto",Cs="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Ss="Enterprise only",ws=m.div``,xs=m.div`
171
+ `,as=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(os,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(ns,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(Q,{size:te.XS,children:o}),n&&t(Ie,{text:n,withIcon:!0}),t(Fe,{label:a.length,status:l?we.Default:void 0})]}),t(ot,{icon:s?vi:yi,size:nt.M,onClick:()=>c(e=>!e)})]}),s?t(V,{children:a.length?u.toArray(a):t(Qe,{$padding:"12px 0",children:t(me,{})})}):null]})},is=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Te(e.supportedSignals).includes(o.signalType))):e,ls=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(Qr,{icon:lt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Fe,{status:n.succeeded?we.Success:we.Error,leftIcon:n.succeeded?Ci:Si})}),rs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Tl();return o?.length?t(as,{title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:o.map((o,n)=>t(ls,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(as,{purpleColors:!0,title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(ls,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ss;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(ss||(ss={}));const cs=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ss.SELF_HOSTED?n.push(...e.items):e.name===ss.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=rt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=st(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[et.DETECTED]:o,[et.SELF_HOSTED]:n,[et.MANAGED]:a}},ds=({onClose:e,onBack:o,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,getDestinationCategories:d,getPotentialDestinations:u,initialInputs:p,testConnection:h,createDestination:g,updateDestination:m,withOverlay:f,disableAnimation:b})=>{const[v,y]=r(""),[C,S]=r({categoryType:null,signalType:null}),{destinations:w}=ct(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Tl();n(()=>{p&&$(p)},[p]);const[E,I]=r(!0),[N,A]=r([]),[O,D]=r({[et.ALL]:[],[et.UNSAVED]:[],[et.EXISTS]:[],[et.DETECTED]:[],[et.SELF_HOSTED]:[],[et.MANAGED]:[]});n(()=>{const e=w.map(e=>{let t;for(const o of N){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=st(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});D(t=>({...t,[et.EXISTS]:e}))},[w,N]);const R=l(async()=>{try{I(!0);const[e,t]=await Promise.all([d(),u()]);e&&A(e.destinationCategories.categories),D(o=>({...o,...cs(e,t)}))}catch(e){}finally{I(!1)}},[]);n(()=>{R()},[]);const P=l(async()=>{const e=(await Promise.all(T.map(({option:e,formData:t})=>{const o=$e(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e]))return m(e.id,o,s)}return g(o,s)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[T,s,g,m]),F=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Tl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(rs,{listType:et.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(et)){if(i.categoryType&&i.categoryType!==e)continue;const l=is(o[e],n,i);l.length&&a.push(t(rs,{listType:e,destinationOptions:l},e))}return e&&a.push(t(Qe,{$height:"100%",children:t(at,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:E,destinationsByCategory:O,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:o}=Tl();return{width:"60%",list:o?[t(Ar,{testConnection:e},o.option.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:bi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(bl,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(T):void 0,onNext:i?()=>i(T):void 0,nextIsSkip:!T.length,onSave:P,disableSave:!x&&!T.length,isFetching:E,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Be.CREATING_DESTINATION,subTitle:Be.CREATING_DESTINATION_SUBTITLE},header:{icon:bi,title:Be.ADD_DESTINATIONS,subTitle:Be.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:v,onChange:y},filters:t(ts,{destinationsByCategory:O,filters:C,setFilters:S}),leftColumn:F,rightColumn:L})},us=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createInstrumentationRule:l,withOverlay:s})=>{const[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=$l(),f=a(()=>c?dt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):dt,[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(Qr,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(zr,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:wi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(bl,{ref:u,isOpen:!0,withOverlay:s,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await l(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Be.CREATING_INSTRUMENTATION_RULE,subTitle:Be.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:wi,title:Be.ADD_INSTRUMENTATION_RULE,subTitle:Be.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},ps={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Be.FETCHING_NAMESPACES,subTitle:Be.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Be.SELECT_NAMESPACE,subTitle:Be.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},hs={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===ut.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},gs=e=>e?hs:ps,ms="No matches",fs="No sources",bs=e=>`No sources matched the filter '${e}'`,vs=e=>(e?"Unselect":"Select")+" all",ys="Show only:",Cs="Selected",Ss="Auto",ws="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",xs="Enterprise only",ks=m.div``,Ts=m.div`
172
172
  visibility: hidden;
173
173
 
174
174
  transition: visibility 0s;
@@ -176,19 +176,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
176
176
  transition-duration: 0s;
177
177
  }
178
178
 
179
- ${ws}:hover & {
179
+ ${ks}:hover & {
180
180
  visibility: visible;
181
181
  }
182
- `,ks=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const r=f(),s=()=>{};return t(ws,{children:t(qr,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?s:a,isChecked:n,onCheckboxChange:i?s:a,children:i&&l?t(Fe,{label:l,status:we.Default,textSize:te.XXXS}):t(xs,{children:t(Fe,{label:o,status:we.Info,textSize:te.XXXS,backgroundColor:r.v2.colors.blue[900]})})})})},Ts=m.div``,$s=m.div`
182
+ `,$s=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const r=f(),s=()=>{};return t(ks,{children:t(Qr,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?s:a,isChecked:n,onCheckboxChange:i?s:a,children:i&&l?t(Fe,{label:l,status:we.Default,textSize:te.XXXS}):t(Ts,{children:t(Fe,{label:o,status:we.Info,textSize:te.XXXS,backgroundColor:r.v2.colors.blue[900]})})})})},Es=m.div``,Is=m.div`
183
183
  visibility: ${({$visible:e})=>e?"visible":"hidden"};
184
184
 
185
185
  transition: visibility 0s;
186
186
  ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
187
187
 
188
- ${Ts}:hover & {
188
+ ${Es}:hover & {
189
189
  visibility: visible;
190
190
  }
191
- `,Es=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Ts,{children:t(qr,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(oe,{$gap:12,children:[!d&&t($s,{$visible:r||i,children:t(Ie,{text:Cs,children:t(K,{label:ys,labelAlign:Y.Left,size:gt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(oe,{$gap:8,children:[t(Q,{variant:mt.Span,size:te.XXXS,color:ee.Secondary,align:"right",children:vs}),t(Fe,{label:`${l.sourced}/${l.total}`,status:r?we.Default:pt.Unknown,minWidth:"42px"})]})]})})})},Is=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Es,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(os,{title:n,list:c,noBgColor:!0}):c},Ns=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:g})=>{const{isVm:m}=y(),f=ps(m),{selectedStreamName:b}=Be(),{progress:v,resetProgress:C}=ft(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:k,handleSourceChange:T,handleSelectAll:$,formDiff:E,isFormDirty:I}=Rl();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:yt,clusterName:vt,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[N,A]=r(""),[O,D]=r(ut.Namespace),[R,P]=r({showOnlySelected:!1}),[F,L]=r({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=ps(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ol(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Dl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Is,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ie,{text:b?Me.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${b?`${v} / ${C}`:C}`,status:pt.Unknown})})]}),t(Q,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:te.XS,children:fs(m)})]}),list:f.length?f:o?[t(Qe,{$height:"100%",children:t(at,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Qe,{$height:"100%",children:t(me,c?{icon:ki,title:hs,subTitle:h.noGroupMatchedFilter(c)}:{icon:ki,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:F,setSelectedArea:L,searchText:O===ut.Namespace?N:"",searchBy:O,filters:R}),z=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=ps(u),h=d===ht.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Nl(e,r,c)):[],[g,r,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Al.has(l);return t(ks,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:r,disabledReason:Ss},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(Ie,{text:v?Me.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${v?`${C} / ${S}`:S}`,status:pt.Unknown})})]}),t(Q,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:te.XS,children:fs(f)})]}),list:b.length?b:[t(Qe,{$height:"100%",children:t(me,g?r?{icon:xi,title:hs,subTitle:ms(r)}:{icon:xi,title:gs,subTitle:p.noItemsInGroupSubTitle}:{icon:xi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:{value:F},searchText:O===ut.Source?N:"",searchBy:O,filters:R});return t(ml,{isOpen:!0,withOverlay:h,disableAnimation:g,onClose:o?()=>{C(bt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(E):void 0,onNext:l?()=>l(E):void 0,nextIsSkip:!I,onSave:()=>d(E),header:{icon:xi,title:Me.ADD_SOURCE,subTitle:Me.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:N,onChange:e=>{A(e),O===ut.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(O),segment:{options:[{label:f.groupSegmentLabel,value:ut.Namespace},{label:f.itemSegmentLabel,value:ut.Source}],selected:O,setSelected:D}},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:bs}),t(K,{name:"filter-selected",size:gt.S,label:vs,value:R.showOnlySelected,onChange:e=>P(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:S,progress:{title:Me.CREATING_SOURCES,subTitle:Me.CREATING_SOURCES_SUBTITLE,percentage:v[bt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:z})},As=(e,t)=>{const o=[{id:"type",title:Me.TYPE,label:t.label},{id:"status",title:Me.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Me.DISABLED:Me.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Me.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Me.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Me.NOTES,label:e.notes}),o},Os=({onClose:i,actionId:s,updateAction:c,deleteAction:d})=>{const u=f(),{actions:p}=ct(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:b}=wl(),[v,y]=r(!1),[C,S]=r(!1),[w,x]=r(null),k=v&&!!b?.isFormDirty,T=a(()=>p?.find(e=>Ct(e)===s),[s,p]),$=a(()=>Ze.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&g(T)},[T]);const E=l(()=>{T&&y(!0)},[T]),I=l(()=>{T&&(g(T),y(!1))},[T,g]),N=l(()=>{k?x("close"):i()},[k,i]),A=l(()=>{k?x("cancel"):I()},[k,I]),O=l(()=>{const e=w;x(null),"close"===e?(I(),i()):I()},[w,I,i]),D=l(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=m();e||(await c(T.id,t),y(!1))}},[T,m,c]),R=l(()=>{T&&S(!0)},[T]),P=l(async()=>{T&&(await d(T.id,T.type),i())},[T,d,i]);if(!T||!$)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?we.Success:pt.Unknown,label:e?"True":"False",invertColors:!0});return o===ge.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===ge.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ge.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ge.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.ExtractAttribute&&n.extractions?.forEach(({targetAttributeName:e,lookupKey:o,dataFormat:a,regex:i},l)=>{const r=(n.extractions?.length??0)>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:e||"-"}),o&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:o}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})}),o===ge.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Tt(T.type),title:$.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:St.EDIT,icon:pi,active:v,onClick:E},{id:"edit-action-btn-delete",label:St.DELETE,icon:ii,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:St.SAVE,variant:ie.Primary,onClick:D}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:v&&h?t(Tr,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(kt,{conditions:T.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:As(T,$)})]}),!!F?.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(fl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(bl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},Ds=({onClose:o,connections:i,selectedConnectionIds:l,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=r(""),[h,g]=r({showOnlySelected:!1}),m=a(()=>i.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&l.includes(e.id);return t&&o}),[i.length,l.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=r(!1),[y,C]=r(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=$t(y||{rollout:{automaticRolloutDisabled:!1}}),T=a(()=>l.length>1||void 0!==y&&!x(y,S),[l.length,y,S]);return n(()=>{1===l.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),k(e)}v(!1)})(l[0]):C(void 0)},[l.length]),t(ml,{isOpen:!0,onClose:o,onSave:()=>d(S,l),header:{icon:Ti,title:"Cluster Configuration"},connectionIds:{value:l,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:"Show only:"}),t(K,{size:gt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:b,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,children:"Clusters"}),t(Fe,{label:m.length,status:pt.Unknown})]}),e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,align:"right",children:"Selected clusters"}),t(Fe,{label:`${l.length}/${m.length}`,status:pt.Unknown})]})]}),list:m.map(e=>t(qr,{title:e.name,isChecked:l.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(Q,{size:te.XS,children:"Configurations"}),list:[t(K,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Rs=e=>{const t=[{id:"type",title:Me.TYPE,label:e.destinationType.displayName},{id:"status",title:Me.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Me.DISABLED:Me.ENABLED}}],o=ke(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Me.MONITORS,label:o}),e.name&&t.push({id:"name",title:Me.NAME,label:e.name}),t},Ps=({onClose:s,destinationId:c,getDestinationCategories:d,testConnection:u,updateDestination:p,deleteDestination:h})=>{const g=f(),{isVm:m}=y(),{destinations:b}=ct(),{selectedStreamName:v}=Be(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=xl(),k=i(null),[T,$]=r(!1),[E,I]=r(!1),[N,A]=r(null),[O,D]=r(!0),[R,P]=r(null),F=T&&!!x?.isFormDirty,L=a(()=>Nt(b,v),[b,v]),_=a(()=>L?.find(e=>Ct(e)===c),[c,L]);n(()=>{let e=!1;return D(!0),d().then(t=>{e||A(t?.destinationCategories.categories??[])}).catch(t=>{e||A([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&N&&S(_,N)},[_,N]);const z=a(()=>_&&N?At(N,_):[],[_,N]),M=l(()=>{_&&$(!0)},[_]),B=l(()=>{_&&N&&(S(_,N),$(!1))},[_,N,S]),X=l(()=>{F?P("close"):s()},[F,s]),U=l(()=>{F?P("cancel"):B()},[F,B]),H=l(()=>{const e=R;P(null),"close"===e?(B(),s()):B()},[R,B,s]),j=l(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,$e(t)),$(!1))}},[_,w,p]),G=l(()=>{_&&I(!0)},[_]),W=l(async()=>{_&&(await h(_.id),s())},[_,h,s]);if(!_)return null;const{icon:K,iconSrc:Y}=lt(_.destinationType.type),J=((e,t)=>{const o=[],n=Et(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=ke(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&Ce(h,i,a))return;const{type:m}=st(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===It.MultiInput){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===It.KeyValuePair){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(_,z);return e(o,{children:[t(q,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:St.EDIT,icon:pi,active:T,onClick:M},{id:"edit-destination-btn-delete",label:St.DELETE,icon:ii,color:g.v2.colors.red[500],active:E,onClick:G}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:U},...C?.option.testConnectionSupported&&!m?[{"data-id":"edit-destination-btn-test-connection",label:St.TEST_CONNECTION,variant:ie.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:St.SAVE,variant:ie.Primary,onClick:j}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:O?t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})}):T&&C?t(Ir,{ref:k,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[!m&&t(kt,{conditions:_.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Rs(_)})]}),!!J.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(xt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(xt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(fl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:W}),t(bl,{isOpen:null!==R,onClose:()=>P(null),onApprove:H})]})},Fs=(e,t)=>{const o=[{id:"type",title:Me.TYPE,label:t.label},{id:"status",title:Me.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Me.DISABLED:Me.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Me.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Me.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Me.NOTES,label:e.notes}),o},Ls=({onClose:i,ruleId:s,updateInstrumentationRule:c,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=ct(),{addNotification:h}=Dt(),{selectedOption:g,loadRule:m,validateFormData:b,genericForm:v}=kl(),[y,C]=r(!1),[S,w]=r(!1),[x,k]=r(null),T=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>Ct(e)===s),[s,p]),E=a(()=>dt.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&m($)},[$]);const I=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_EDIT_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),N=l(()=>{$&&(m($),C(!1))},[$,m]),A=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):N()},[T,N]),D=l(()=>{const e=x;k(null),"close"===e?(N(),i()):N()},[x,N,i]),R=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await c($.ruleId,t),C(!1))}},[$,b,c]),P=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_DELETE_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),F=l(async()=>{$&&(await d($.ruleId),i())},[$,d,i]);if(!$||!E)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.headersCollection?.[Ne.HeaderKeys]?.length&&e.headersCollection[Ne.HeaderKeys].forEach(e=>{e&&n.push(t(Q,{size:te.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Re.Java]?.forEach((e,a)=>{const i=new De(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Re.Golang]?.forEach((e,a)=>{const i=new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Ft($.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:St.EDIT,icon:pi,active:y,onClick:I},{id:"edit-rule-btn-delete",label:St.DELETE,icon:ii,color:u.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:St.SAVE,variant:ie.Primary,onClick:R}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:y&&g?t(Lr,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(kt,{conditions:$.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Fs($,E)})]}),!!L.length&&t(xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:L})}),!!E.supportedLanguages.length&&t(xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(Pt,{label:Le[e],leftIcon:_e(e),flex:"0.5"},e))})})})]})})})}),t(fl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(bl,{isOpen:null!==x,onClose:()=>k(null),onApprove:D})]})};var _s;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(_s||(_s={}));const zs=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Lt(),g=_t(!!o),m=a(()=>({title:l,icon:$i,withCopy:!0}),[l]),f=a(()=>{const e=[],t=zt(c);t&&e.push(t);const o=zt(d,Ei,"health");o&&e.push(o);const n=zt(u,Ii,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ni,label:St.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Me.NODE,label:r,withCopy:!0},{id:"age",title:Me.AGE,label:s?h(s,{style:"short"}):Me.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:g,children:t(xt,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Ms=m.div`
191
+ `,Ns=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Es,{children:t(Qr,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(oe,{$gap:12,children:[!d&&t(Is,{$visible:r||i,children:t(Ie,{text:ws,children:t(K,{label:Ss,labelAlign:Y.Left,size:gt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(oe,{$gap:8,children:[t(Q,{variant:mt.Span,size:te.XXXS,color:ee.Secondary,align:"right",children:Cs}),t(Fe,{label:`${l.sourced}/${l.total}`,status:r?we.Default:pt.Unknown,minWidth:"42px"})]})]})})})},As=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Ns,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(as,{title:n,list:c,noBgColor:!0}):c},Os=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:g})=>{const{isVm:m}=y(),f=gs(m),{selectedStreamName:b}=Me(),{progress:v,resetProgress:C}=ft(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:k,handleSourceChange:T,handleSelectAll:$,formDiff:E,isFormDirty:I}=Fl();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:yt,clusterName:vt,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[N,A]=r(""),[O,D]=r(ut.Namespace),[R,P]=r({showOnlySelected:!1}),[F,L]=r({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=gs(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Rl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Pl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(As,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ie,{text:b?Be.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${b?`${v} / ${C}`:C}`,status:pt.Unknown})})]}),t(Q,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:te.XS,children:vs(m)})]}),list:f.length?f:o?[t(Qe,{$height:"100%",children:t(at,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Qe,{$height:"100%",children:t(me,c?{icon:ki,title:ms,subTitle:h.noGroupMatchedFilter(c)}:{icon:ki,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:F,setSelectedArea:L,searchText:O===ut.Namespace?N:"",searchBy:O,filters:R}),z=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=gs(u),h=d===ht.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ol(e,r,c)):[],[g,r,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Dl.has(l);return t($s,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:r,disabledReason:xs},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(Ie,{text:v?Be.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${v?`${C} / ${S}`:S}`,status:pt.Unknown})})]}),t(Q,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:te.XS,children:vs(f)})]}),list:b.length?b:[t(Qe,{$height:"100%",children:t(me,g?r?{icon:xi,title:ms,subTitle:bs(r)}:{icon:xi,title:fs,subTitle:p.noItemsInGroupSubTitle}:{icon:xi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:{value:F},searchText:O===ut.Source?N:"",searchBy:O,filters:R});return t(bl,{isOpen:!0,withOverlay:h,disableAnimation:g,onClose:o?()=>{C(bt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(E):void 0,onNext:l?()=>l(E):void 0,nextIsSkip:!I,onSave:()=>d(E),header:{icon:xi,title:Be.ADD_SOURCE,subTitle:Be.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:N,onChange:e=>{A(e),O===ut.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(O),segment:{options:[{label:f.groupSegmentLabel,value:ut.Namespace},{label:f.itemSegmentLabel,value:ut.Source}],selected:O,setSelected:D}},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:ys}),t(K,{name:"filter-selected",size:gt.S,label:Cs,value:R.showOnlySelected,onChange:e=>P(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:S,progress:{title:Be.CREATING_SOURCES,subTitle:Be.CREATING_SOURCES_SUBTITLE,percentage:v[bt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:z})},Ds=(e,t)=>{const o=[{id:"type",title:Be.TYPE,label:t.label},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Be.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Be.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Be.NOTES,label:e.notes}),o},Rs=({onClose:i,actionId:s,updateAction:c,deleteAction:d})=>{const u=f(),{actions:p}=ct(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:b}=kl(),[v,y]=r(!1),[C,S]=r(!1),[w,x]=r(null),k=v&&!!b?.isFormDirty,T=a(()=>p?.find(e=>Ct(e)===s),[s,p]),$=a(()=>Ze.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&g(T)},[T]);const E=l(()=>{T&&y(!0)},[T]),I=l(()=>{T&&(g(T),y(!1))},[T,g]),N=l(()=>{k?x("close"):i()},[k,i]),A=l(()=>{k?x("cancel"):I()},[k,I]),O=l(()=>{const e=w;x(null),"close"===e?(I(),i()):I()},[w,I,i]),D=l(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=m();e||(await c(T.id,t),y(!1))}},[T,m,c]),R=l(()=>{T&&S(!0)},[T]),P=l(async()=>{T&&(await d(T.id,T.type),i())},[T,d,i]);if(!T||!$)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?we.Success:pt.Unknown,label:e?"True":"False",invertColors:!0});if(o===ge.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===ge.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ge.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ge.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:a,regex:i},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})})}return o===ge.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Tt(T.type),title:$.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:St.EDIT,icon:pi,active:v,onClick:E},{id:"edit-action-btn-delete",label:St.DELETE,icon:ii,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:St.SAVE,variant:ie.Primary,onClick:D}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:v&&h?t(Er,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(kt,{conditions:T.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Ds(T,$)})]}),!!F?.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(vl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(yl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},Ps=({onClose:o,connections:i,selectedConnectionIds:l,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=r(""),[h,g]=r({showOnlySelected:!1}),m=a(()=>i.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&l.includes(e.id);return t&&o}),[i.length,l.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=r(!1),[y,C]=r(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=$t(y||{rollout:{automaticRolloutDisabled:!1}}),T=a(()=>l.length>1||void 0!==y&&!x(y,S),[l.length,y,S]);return n(()=>{1===l.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),k(e)}v(!1)})(l[0]):C(void 0)},[l.length]),t(bl,{isOpen:!0,onClose:o,onSave:()=>d(S,l),header:{icon:Ti,title:"Cluster Configuration"},connectionIds:{value:l,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:"Show only:"}),t(K,{size:gt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:b,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,children:"Clusters"}),t(Fe,{label:m.length,status:pt.Unknown})]}),e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,align:"right",children:"Selected clusters"}),t(Fe,{label:`${l.length}/${m.length}`,status:pt.Unknown})]})]}),list:m.map(e=>t(Qr,{title:e.name,isChecked:l.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(Q,{size:te.XS,children:"Configurations"}),list:[t(K,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Fs=e=>{const t=[{id:"type",title:Be.TYPE,label:e.destinationType.displayName},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}],o=ke(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Be.MONITORS,label:o}),e.name&&t.push({id:"name",title:Be.NAME,label:e.name}),t},Ls=({onClose:s,destinationId:c,getDestinationCategories:d,testConnection:u,updateDestination:p,deleteDestination:h})=>{const g=f(),{isVm:m}=y(),{destinations:b}=ct(),{selectedStreamName:v}=Me(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=Tl(),k=i(null),[T,$]=r(!1),[E,I]=r(!1),[N,A]=r(null),[O,D]=r(!0),[R,P]=r(null),F=T&&!!x?.isFormDirty,L=a(()=>Nt(b,v),[b,v]),_=a(()=>L?.find(e=>Ct(e)===c),[c,L]);n(()=>{let e=!1;return D(!0),d().then(t=>{e||A(t?.destinationCategories.categories??[])}).catch(t=>{e||A([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&N&&S(_,N)},[_,N]);const z=a(()=>_&&N?At(N,_):[],[_,N]),B=l(()=>{_&&$(!0)},[_]),M=l(()=>{_&&N&&(S(_,N),$(!1))},[_,N,S]),X=l(()=>{F?P("close"):s()},[F,s]),U=l(()=>{F?P("cancel"):M()},[F,M]),H=l(()=>{const e=R;P(null),"close"===e?(M(),s()):M()},[R,M,s]),G=l(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,$e(t)),$(!1))}},[_,w,p]),j=l(()=>{_&&I(!0)},[_]),W=l(async()=>{_&&(await h(_.id),s())},[_,h,s]);if(!_)return null;const{icon:K,iconSrc:Y}=lt(_.destinationType.type),J=((e,t)=>{const o=[],n=Et(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=ke(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&Ce(h,i,a))return;const{type:m}=st(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===It.MultiInput){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===It.KeyValuePair){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(_,z);return e(o,{children:[t(q,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:St.EDIT,icon:pi,active:T,onClick:B},{id:"edit-destination-btn-delete",label:St.DELETE,icon:ii,color:g.v2.colors.red[500],active:E,onClick:j}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:U},...C?.option.testConnectionSupported&&!m?[{"data-id":"edit-destination-btn-test-connection",label:St.TEST_CONNECTION,variant:ie.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:St.SAVE,variant:ie.Primary,onClick:G}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:O?t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})}):T&&C?t(Ar,{ref:k,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[!m&&t(kt,{conditions:_.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Fs(_)})]}),!!J.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(xt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(xt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(vl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:W}),t(yl,{isOpen:null!==R,onClose:()=>P(null),onApprove:H})]})},_s=(e,t)=>{const o=[{id:"type",title:Be.TYPE,label:t.label},{id:"status",title:Be.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Be.DISABLED:Be.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Be.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Be.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Be.NOTES,label:e.notes}),o},zs=({onClose:i,ruleId:s,updateInstrumentationRule:c,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=ct(),{addNotification:h}=Dt(),{selectedOption:g,loadRule:m,validateFormData:b,genericForm:v}=$l(),[y,C]=r(!1),[S,w]=r(!1),[x,k]=r(null),T=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>Ct(e)===s),[s,p]),E=a(()=>dt.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&m($)},[$]);const I=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_EDIT_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),N=l(()=>{$&&(m($),C(!1))},[$,m]),A=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):N()},[T,N]),D=l(()=>{const e=x;k(null),"close"===e?(N(),i()):N()},[x,N,i]),R=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await c($.ruleId,t),C(!1))}},[$,b,c]),P=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_DELETE_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),F=l(async()=>{$&&(await d($.ruleId),i())},[$,d,i]);if(!$||!E)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.headersCollection?.[Ne.HeaderKeys]?.length&&e.headersCollection[Ne.HeaderKeys].forEach(e=>{e&&n.push(t(Q,{size:te.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Re.Java]?.forEach((e,a)=>{const i=new De(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Re.Golang]?.forEach((e,a)=>{const i=new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Ft($.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:St.EDIT,icon:pi,active:y,onClick:I},{id:"edit-rule-btn-delete",label:St.DELETE,icon:ii,color:u.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:St.SAVE,variant:ie.Primary,onClick:R}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:y&&g?t(zr,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(kt,{conditions:$.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:_s($,E)})]}),t(rl,{readOnly:!0,scopes:$.sourceScopes??null}),!!L.length&&t(xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:L})}),!!E.supportedLanguages.length&&t(xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(Pt,{label:Le[e],leftIcon:_e(e),flex:"0.5"},e))})})})]})})})}),t(vl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(yl,{isOpen:null!==x,onClose:()=>k(null),onApprove:D})]})};var Bs;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(Bs||(Bs={}));const Ms=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Lt(),g=_t(!!o),m=a(()=>({title:l,icon:$i,withCopy:!0}),[l]),f=a(()=>{const e=[],t=zt(c);t&&e.push(t);const o=zt(d,Ei,"health");o&&e.push(o);const n=zt(u,Ii,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ni,label:St.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Be.NODE,label:r,withCopy:!0},{id:"age",title:Be.AGE,label:s?h(s,{style:"short"}):Be.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:g,children:t(xt,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Xs=m.div`
192
192
  display: flex;
193
193
  align-items: center;
194
194
  justify-content: space-between;
@@ -196,7 +196,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
196
196
  padding: ${({$noPadding:e})=>e?"0":"12px"};
197
197
  border-radius: 12px;
198
198
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
199
- `,Bs=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=Xt(o?.status),r=Ot(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Mt.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Mt.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Mt.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Ms,{$noPadding:i,children:[t(Bt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t(Vs,{label:Me.PODS,count:c}),t(Vs,{label:Me.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Vs,{label:Me.ODIGOS_HEALTHY,icon:Ei,count:u,total:c}),t(Vs,{label:Me.KUBERNETES_HEALTHY,icon:Ii,count:p,total:c})]})]}):null},Xs=m.div`
199
+ `,Vs=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=Xt(o?.status),r=Ot(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Bt.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Bt.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Bt.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Xs,{$noPadding:i,children:[t(Mt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t(Hs,{label:Be.PODS,count:c}),t(Hs,{label:Be.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Hs,{label:Be.ODIGOS_HEALTHY,icon:Ei,count:u,total:c}),t(Hs,{label:Be.KUBERNETES_HEALTHY,icon:Ii,count:p,total:c})]})]}):null},Us=m.div`
200
200
  display: flex;
201
201
  flex-direction: column;
202
202
  justify-content: center;
@@ -207,23 +207,32 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
207
207
  width: fit-content;
208
208
  border-radius: 8px;
209
209
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
210
- `,Vs=({count:o,total:n,label:a,icon:i})=>{const l=f(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Xs,{children:[e(oe,{$gap:0,$alignItems:"flex-end",children:[t(Q,{size:te.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(Q,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(oe,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(Q,{size:te.XXXS,nowrap:!0,children:a})]})]})},Us=12,Hs=24,js=12,Gs=24,Ws=40,Ks=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===Vt.PID)??e.identifyingAttributes?.find(({name:e})=>e===Vt.VPID);return t?.value??null};var Ys;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(Ys||(Ys={}));const Js=({overrideProcessNum:o,healthy:i,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=r(Ys.IdentifyingAttributes),g=_t(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Ys.IdentifyingAttributes,label:Me.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Ys.InstrumentationLibraries,label:Me.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Ai,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[s,c]);n(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case Ys.IdentifyingAttributes:return t(V,{children:s?.map(e=>t(Zs,{label:e.name,value:e.value},e.name))});case Ys.InstrumentationLibraries:return t(V,{children:c?.map(e=>t(Zs,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[p,s,c]),C=a(()=>Ks({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return t("div",{ref:g,children:e(xt,{bgTint:"800",richTitle:{title:C?`${Me.PROCESS} ${Me.PID(C)}`:Me.PROCESS_FALLBACK_NAME},renderOnRightSide:t(Q,{color:i?ee.Success:ee.Error,size:te.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?we.Success:we.Error,leftIcon:Ei,label:i?Me.HEALTHY:Me.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(le,{options:m,selected:p,setSelected:h}),!v&&y]})})},qs=m.div`
210
+ `,Hs=({count:o,total:n,label:a,icon:i})=>{const l=f(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Us,{children:[e(oe,{$gap:0,$alignItems:"flex-end",children:[t(Q,{size:te.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(Q,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(oe,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(Q,{size:te.XXXS,nowrap:!0,children:a})]})]})},Gs=12,js=24,Ws=12,Ks=24,Ys=40,Js=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===Vt.PID)??e.identifyingAttributes?.find(({name:e})=>e===Vt.VPID);return t?.value??null};var qs;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(qs||(qs={}));const Zs=({overrideProcessNum:o,healthy:i,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=r(qs.IdentifyingAttributes),g=_t(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:qs.IdentifyingAttributes,label:Be.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:qs.InstrumentationLibraries,label:Be.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Ai,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[s,c]);n(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case qs.IdentifyingAttributes:return t(V,{children:s?.map(e=>t(nc,{label:e.name,value:e.value},e.name))});case qs.InstrumentationLibraries:return t(V,{children:c?.map(e=>t(nc,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[p,s,c]),C=a(()=>Js({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return t("div",{ref:g,children:e(xt,{bgTint:"800",richTitle:{title:C?`${Be.PROCESS} ${Be.PID(C)}`:Be.PROCESS_FALLBACK_NAME},renderOnRightSide:t(Q,{color:i?ee.Success:ee.Error,size:te.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?we.Success:we.Error,leftIcon:Ei,label:i?Be.HEALTHY:Be.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(le,{options:m,selected:p,setSelected:h}),!v&&y]})})},Qs=m.div`
211
211
  display: flex;
212
- align-items: center;
213
- justify-content: space-between;
212
+ align-items: flex-start;
213
+ gap: 8px;
214
214
  padding: 8px;
215
215
  border-radius: 4px;
216
216
  &:hover {
217
217
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
218
218
  }
219
- `,Zs=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const r="boolean"==typeof i;return e(qs,{children:[t(Q,{size:te.XXS,color:ee.Secondary,children:o}),n&&t(Q,{size:te.XXS,color:ee.Primary,children:n}),(r||a)&&e(oe,{children:[a&&t(Fe,{status:we.Info,label:Me.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&t(Fe,{status:i?we.Success:we.Error,label:i?Me.HEALTHY:Me.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Qs=p(null),ec=({value:e,children:o})=>t(Qs.Provider,{value:e,children:o}),tc=()=>{const e=h(Qs);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e},oc=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:Me.CONTAINERS,titleSize:te.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(xt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(ac,{...e,language:Ut(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},nc=m.div`
219
+ `,ec=m(Q)`
220
+ flex: 0 0 30%;
221
+ `,tc=m(Q)`
222
+ flex: 1 1 auto;
223
+ min-width: 0;
224
+ `,oc=m(oe)`
225
+ flex: 1 1 auto;
226
+ justify-content: flex-end;
227
+ min-width: 0;
228
+ `,nc=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const r="boolean"==typeof i;return e(Qs,{children:[t(ec,{size:te.XXS,color:ee.Secondary,children:o}),n&&t(tc,{size:te.XXS,color:ee.Primary,align:"right",children:n}),(r||a)&&e(oc,{children:[a&&t(Fe,{status:we.Info,label:Be.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&t(Fe,{status:i?we.Success:we.Error,label:i?Be.HEALTHY:Be.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},ac=p(null),ic=({value:e,children:o})=>t(ac.Provider,{value:e,children:o}),lc=()=>{const e=h(ac);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e},rc=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:Be.CONTAINERS,titleSize:te.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(xt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(cc,{...e,language:Ut(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},sc=m.div`
220
229
  display: flex;
221
230
  flex-direction: column;
222
231
  gap: 12px;
223
232
  padding: 8px 12px;
224
233
  border-radius: 8px;
225
234
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
226
- `,ac=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:g,processes:m,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Lt(),C=_t(v),S=a(()=>({title:n,icon:o?_e(o):Oi,iconWithWrapper:!0}),[n,o]),w=a(()=>{const e=[],t=zt({status:i?Mt.Success:Mt.Disabled,reasonEnum:i?Me.INSTRUMENTED_WITH_DISTRO(i):Me.UNINSTRUMENTED,message:""});t&&e.push(t);const o=zt(h,Ei,"health");o&&e.push(o);const n=zt(g,Ii,"health");return n&&e.push(n),e},[g,h,i]),x=a(()=>[{id:"runningTime",title:Me.RUNNING_TIME,label:l?y(l,{style:"short"}):Me.NOT_RUNNING,labelTooltip:`${Me.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?we.Success:Ht.Disabled,leftIcon:r?si:ci,label:r?Me.STARTED:Me.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?we.Success:Ht.Disabled,leftIcon:s?si:ci,label:s?Me.READY:Me.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?we.Error:we.Success,leftIcon:d?ci:si,label:d?Me.CRASHLOOP:Me.NO_CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Me.RESTARTS,badge:{status:c?we.Error:void 0,label:c||0,textSize:te.XXXS}}],[l,y,r,s,d,c]),k=a(()=>p?Ot(u):"",[p,u]);return t("div",{ref:C,children:e(xt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(nc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:jt.Pink,leftIcon:Ii,label:k}),t(Q,{size:te.XXXS,color:ee.Error,children:p})]})}),(m??[]).map((e,o)=>{const a=o+1,i=b&&(l=f,r=e,!!l?.processPid&&Ks({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Js,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},ic=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:Me.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=a(()=>[{label:Me.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Me.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Me.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(xt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(Gt,{bgTint:"700",label:e,value:o},e))})},lc=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=tc(),r=l?.tab===_s.Pods?l:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:Me.PODS,badge:{label:s.length}}),[s.length]);return t(V,{$gap:12,children:c?e(o,{children:[t(Bs,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(xt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(zs,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(ic,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(oc,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(Qe,{$height:"70vh",children:t(me,{title:Me.NO_RUNNING_PODS,subTitle:Me.NO_RUNNING_PODS_SUBTITLE})})})},rc=({source:o,fetchPeerSources:i})=>{const s=a(()=>o.serviceName||o.id.name,[o]),[c,d]=r(!1),[u,p]=r(null),h=l(()=>{d(!0),i(s).then(({data:e})=>p(e?.peerSources??null)).finally(()=>d(!1))},[s]);return n(()=>{h()},[h]),!u||c?t(Qe,c?{$height:"70vh",children:t(at,{withSpinner:!0})}:{$height:"70vh",children:t(me,{subTitle:Me.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(sc,{icon:Di,title:Me.INBOUND,subTitle:Me.INBOUND_DESCRIPTION(s),onRefresh:h,items:u?.inbound??[]}),t(sc,{icon:Ri,title:Me.OUTBOUND,subTitle:Me.OUTBOUND_DESCRIPTION(s),onRefresh:h,items:u?.outbound??[]})]})},sc=({icon:o,title:n,subTitle:i,onRefresh:l,items:s})=>{const[c,d]=r(""),u=a(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(xt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:te.XS,subTitle:i,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ni,onClick:l}}],children:[t(Kt,{value:c,onChange:d,width:"100%"}),t(Yt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(Qe,{$height:"50vh",children:t(me,{icon:o,title:Me.NO_RESULTS,subTitle:Me.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(dc,{...e},`${n}-${e.serviceName}`)):[t(Qe,{$height:"50vh",children:t(me,{icon:o,title:`No ${n} connections yet`,subTitle:n===Me.INBOUND?Me.NO_INBOUND_CONNECTIONS_DESCRIPTION:Me.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},cc=m.div`
235
+ `,cc=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:g,processes:m,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Lt(),C=_t(v),S=a(()=>({title:n,icon:o?_e(o):Oi,iconWithWrapper:!0}),[n,o]),w=a(()=>{const e=[],t=zt({status:i?Bt.Success:Bt.Disabled,reasonEnum:i?Be.INSTRUMENTED_WITH_DISTRO(i):Be.UNINSTRUMENTED,message:""});t&&e.push(t);const o=zt(h,Ei,"health");o&&e.push(o);const n=zt(g,Ii,"health");return n&&e.push(n),e},[g,h,i]),x=a(()=>[{id:"runningTime",title:Be.RUNNING_TIME,label:l?y(l,{style:"short"}):Be.NOT_RUNNING,labelTooltip:`${Be.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?we.Success:Ht.Disabled,leftIcon:r?si:ci,label:r?Be.STARTED:Be.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?we.Success:Ht.Disabled,leftIcon:s?si:ci,label:s?Be.READY:Be.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?we.Error:we.Success,leftIcon:d?ci:si,label:d?Be.CRASHLOOP:Be.NO_CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Be.RESTARTS,badge:{status:c?we.Error:void 0,label:c||0,textSize:te.XXXS}}],[l,y,r,s,d,c]),k=a(()=>p?Ot(u):"",[p,u]);return t("div",{ref:C,children:e(xt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(sc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:Gt.Pink,leftIcon:Ii,label:k}),t(Q,{size:te.XXXS,color:ee.Error,children:p})]})}),(m??[]).map((e,o)=>{const a=o+1,i=b&&(l=f,r=e,!!l?.processPid&&Js({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Zs,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},dc=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:Be.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=a(()=>[{label:Be.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Be.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Be.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(xt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(jt,{bgTint:"700",label:e,value:o},e))})},uc=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=lc(),r=l?.tab===Bs.Pods?l:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:Be.PODS,badge:{label:s.length}}),[s.length]);return t(V,{$gap:12,children:c?e(o,{children:[t(Vs,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(xt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(Ms,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(dc,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(rc,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(Qe,{$height:"70vh",children:t(me,{title:Be.NO_RUNNING_PODS,subTitle:Be.NO_RUNNING_PODS_SUBTITLE})})})},pc=({source:o,fetchPeerSources:i})=>{const s=a(()=>o.serviceName||o.id.name,[o]),[c,d]=r(!1),[u,p]=r(null),h=l(()=>{d(!0),i(s).then(({data:e})=>p(e?.peerSources??null)).finally(()=>d(!1))},[s]);return n(()=>{h()},[h]),!u||c?t(Qe,c?{$height:"70vh",children:t(at,{withSpinner:!0})}:{$height:"70vh",children:t(me,{subTitle:Be.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(hc,{icon:Di,title:Be.INBOUND,subTitle:Be.INBOUND_DESCRIPTION(s),onRefresh:h,items:u?.inbound??[]}),t(hc,{icon:Ri,title:Be.OUTBOUND,subTitle:Be.OUTBOUND_DESCRIPTION(s),onRefresh:h,items:u?.outbound??[]})]})},hc=({icon:o,title:n,subTitle:i,onRefresh:l,items:s})=>{const[c,d]=r(""),u=a(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(xt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:te.XS,subTitle:i,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ni,onClick:l}}],children:[t(Kt,{value:c,onChange:d,width:"100%"}),t(Yt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(Qe,{$height:"50vh",children:t(me,{icon:o,title:Be.NO_RESULTS,subTitle:Be.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(mc,{...e},`${n}-${e.serviceName}`)):[t(Qe,{$height:"50vh",children:t(me,{icon:o,title:`No ${n} connections yet`,subTitle:n===Be.INBOUND?Be.NO_INBOUND_CONNECTIONS_DESCRIPTION:Be.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},gc=m.div`
227
236
  display: flex;
228
237
  align-items: center;
229
238
  justify-content: space-between;
@@ -237,7 +246,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
237
246
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
238
247
  }
239
248
  `}
240
- `,dc=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=Jt(e=>e.drawerEntityId),r=ct(e=>e.sources),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(qt(s))!==JSON.stringify(qt(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[Zt({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[Pi];const e=s?Qt(s):void 0;return e?.length?e:[Oi]},[n,i,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Jt.getState();e(ut.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(cc,{onClick:u,$withClick:!!u,children:[e(oe,{$gap:8,children:[t(eo,{icons:d}),t(Q,{size:te.XXS,children:o})]}),n&&t(Fe,{status:we.Info,label:Me.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:Me.VIRTUAL_TOOLTIP})]})},uc=({title:o,children:n})=>e(V,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,children:o}),n]}),pc=({source:o})=>{const n=a(()=>{const[e,t]=to(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(uc,{title:Me.THROUGHPUT_LAST_10_SECONDS,children:e(oe,{$alignItems:"flex-end",$gap:4,children:[t(Q,{size:te.L,children:n.value}),t(Q,{size:te.XS,variant:mt.Span,children:n.units})]})})},hc=({source:o})=>{const{CopyButton:n}=oo();return t(uc,{title:Me.NAMESPACE,children:e(oe,{children:[t(Pt,{variant:jt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:nt.XS})]})})},gc=({source:e})=>t(uc,{title:Me.KIND,children:t(oe,{children:t(Pt,{variant:jt.Blue,label:e.id.kind})})}),mc=({source:o})=>{const{CopyButton:n}=oo();return t(uc,{title:Me.NAME,children:e(oe,{children:[t(Pt,{variant:jt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:nt.XS})]})})},fc=({source:o})=>t(xt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[t(pc,{source:o}),t(hc,{source:o}),t(gc,{source:o}),t(mc,{source:o})]})}),bc=m.div`
249
+ `,mc=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=Jt(e=>e.drawerEntityId),r=ct(e=>e.sources),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(qt(s))!==JSON.stringify(qt(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[Zt({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[Pi];const e=s?Qt(s):void 0;return e?.length?e:[Oi]},[n,i,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Jt.getState();e(ut.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(gc,{onClick:u,$withClick:!!u,children:[e(oe,{$gap:8,children:[t(eo,{icons:d}),t(Q,{size:te.XXS,children:o})]}),n&&t(Fe,{status:we.Info,label:Be.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:Be.VIRTUAL_TOOLTIP})]})},fc=({source:o,fetchK8sManifest:i})=>{const l=f(),[s,c]=r(!0),[d,u]=r(void 0),[p,h]=r(!0),[g,m]=r(void 0);n(()=>{i(o.id.namespace,o.id.kind,o.id.name).then(u).finally(()=>c(!1)),i(o.id.namespace,to.InstrumentationConfig,`${o.id.kind}-${o.id.name}`.toLowerCase()).then(m).finally(()=>h(!1))},[i,o.id.namespace,o.id.kind,o.id.name]);const b=a(()=>[{label:Be.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:Be.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:Be.GET_POD_YAML,value:`kubectl get ${to.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.name,o.id.namespace]);return e(xt,{bgTint:"1000",children:[t(xt,{bgTint:"900",richTitle:{icon:Fi,title:Be.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:o})=>t(jt,{label:e,value:o},e))}),s?t(oo,{size:1}):t(Cl,{bgTint:"800",codeBgColor:l.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(oo,{size:1}):t(Cl,{bgTint:"800",codeBgColor:l.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g})]})},bc=({title:o,children:n})=>e(V,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,children:o}),n]}),vc=({source:o})=>{const n=a(()=>{const[e,t]=no(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(bc,{title:Be.THROUGHPUT_LAST_10_SECONDS,children:e(oe,{$alignItems:"flex-end",$gap:4,children:[t(Q,{size:te.L,children:n.value}),t(Q,{size:te.XS,variant:mt.Span,children:n.units})]})})},yc=({source:o})=>{const{CopyButton:n}=ao();return t(bc,{title:Be.NAMESPACE,children:e(oe,{children:[t(Pt,{variant:Gt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:nt.XS})]})})},Cc=({source:e})=>t(bc,{title:Be.KIND,children:t(oe,{children:t(Pt,{variant:Gt.Blue,label:e.id.kind})})}),Sc=({source:o})=>{const{CopyButton:n}=ao();return t(bc,{title:Be.NAME,children:e(oe,{children:[t(Pt,{variant:Gt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:nt.XS})]})})},wc=({source:o})=>{const{isVm:n}=y();return t(xt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!n&&t(vc,{source:o}),!n&&t(yc,{source:o}),t(Cc,{source:o}),t(Sc,{source:o})]})})},xc=m.div`
241
250
  display: flex;
242
251
  align-items: center;
243
252
  gap: 6px;
@@ -245,34 +254,36 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
245
254
  border-radius: 8px;
246
255
  cursor: ${({$clickable:e})=>e?"pointer":"default"};
247
256
  transition: background-color 0.15s ease;
248
- ${({$clickable:e,theme:t})=>e&&`\n &:hover {\n background-color: ${t.v2.colors.silver[700]};\n }\n `}
249
- `,vc=m.div`
257
+ &:hover {
258
+ background-color: ${({theme:e})=>e.v2.colors.silver[700]};
259
+ }
260
+ `,kc=m.div`
250
261
  display: flex;
251
262
  align-items: center;
252
263
  justify-content: center;
253
264
  flex-shrink: 0;
254
265
  width: 18px;
255
266
  height: 18px;
256
- `,yc=m.div`
267
+ `,Tc=m.div`
257
268
  flex: 1;
258
269
  min-width: 0;
259
270
  display: flex;
260
- `,Cc=({chevron:o,onClick:n,label:a,name:i,badges:l,action:r,paddingLeft:s})=>{const c=f();return e(bc,{$clickable:!!n,$paddingLeft:s,onClick:n,children:[o&&t(vc,{children:t(o,{size:18,fill:c.v2.colors.silver[200]})}),t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:a}),t(yc,{children:t(Q,{size:te.XS,nowrap:!0,children:i})}),r&&t(Ie,{text:r.tooltip,children:t(ot,{icon:r.icon,size:nt.XS,onClick:r.onClick})}),l.map(({key:e,...o})=>t(Sc,{...o},e))]})},Sc=({status:e,leftIcon:o,label:n,tooltip:a})=>{const i=o||(e===we.Success?si:ci);return t(Fe,{status:e,leftIcon:i,label:n,tooltip:a,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0})},wc=({overrideProcessNum:e,pod:o,container:n,process:i})=>{const{jumpToProcess:l}=tc(),r=a(()=>Ks({overrideProcessNum:e,identifyingAttributes:i.identifyingAttributes}),[e,i.identifyingAttributes]),s=a(()=>{const e=[],t=zt(i.healthStatus,Ei,"health");return t&&e.push(t),e},[]);return t(Cc,{label:Me.PROCESS,name:r?Me.PID(r):Me.PROCESS_FALLBACK_NAME,paddingLeft:Ws,action:{icon:Fi,onClick:()=>l(o,n,i),tooltip:Me.OPEN_IN_POD_TAB},badges:s})},xc=m.div`
271
+ `,$c=({chevron:o,onClick:n,label:a,name:i,badges:l,action:r,paddingLeft:s})=>{const c=f();return e(xc,{$clickable:!!n,$paddingLeft:s,onClick:n,children:[o&&t(kc,{children:t(o,{size:18,fill:c.v2.colors.silver[200]})}),t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:a}),t(Tc,{children:t(Q,{size:te.XS,nowrap:!0,children:i})}),r&&t(Ie,{text:r.tooltip,children:t(ot,{icon:r.icon,size:nt.XS,onClick:r.onClick})}),l.map(({key:e,...o})=>t(Ec,{...o},e))]})},Ec=({status:e,leftIcon:o,label:n,tooltip:a})=>{const i=o||(e===we.Success?si:ci);return t(Fe,{status:e,leftIcon:i,label:n,tooltip:a,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0})},Ic=({overrideProcessNum:e,pod:o,container:n,process:i})=>{const{jumpToProcess:l}=lc(),r=a(()=>Js({overrideProcessNum:e,identifyingAttributes:i.identifyingAttributes}),[e,i.identifyingAttributes]),s=a(()=>{const e=[],t=zt(i.healthStatus,Ei,"health");return t&&e.push(t),e},[]);return t($c,{label:Be.PROCESS,name:r?Be.PID(r):Be.PROCESS_FALLBACK_NAME,paddingLeft:Ys,action:{icon:Li,onClick:()=>l(o,n,i),tooltip:Be.OPEN_IN_POD_TAB},badges:s})},Nc=m.div`
261
272
  display: flex;
262
273
  flex-direction: column;
263
274
  align-self: stretch;
264
275
  border-radius: 8px;
265
276
  background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[750]:"transparent"};
266
- `,kc=({pod:o,container:n})=>{const[i,l]=r(!1),{jumpToContainer:s}=tc(),c=a(()=>{const e=[],t=Xt(n.odigosHealthStatus?.status);t&&e.push({key:"odigos-health",status:t,leftIcon:Ei,label:no(t,n.odigosHealthStatus?.reasonEnum),tooltip:n.odigosHealthStatus?.message});const o=Xt(n.k8sHealthStatus?.status);return o&&e.push({key:"k8s-health",status:o,leftIcon:Ii,label:no(o,n.k8sHealthStatus?.reasonEnum),tooltip:n.k8sHealthStatus?.message}),e},[]),d=n.processes??[],u=d.length>0;return e(xc,{$isExpanded:i,children:[t(Cc,{chevron:u?i?yi:mi:void 0,onClick:u?()=>l(e=>!e):void 0,label:Me.CONTAINER,name:n.containerName,paddingLeft:Gs+(u?0:24),action:{icon:Fi,onClick:()=>s(o,n),tooltip:Me.OPEN_IN_POD_TAB},badges:c}),u&&i&&t(V,{$gap:0,$padding:`0 ${Hs}px`,children:d.map((e,a)=>{const i=a+1;return t(wc,{overrideProcessNum:i,pod:o,container:n,process:e},`pod-${o.podName}-container-${n.containerName}-process-${i}`)})})]})},Tc=m.div`
277
+ `,Ac=({pod:o,container:n})=>{const[i,l]=r(!1),{jumpToContainer:s}=lc(),c=a(()=>{const e=[],t=Xt(n.odigosHealthStatus?.status);t&&e.push({key:"odigos-health",status:t,leftIcon:Ei,label:io(t,n.odigosHealthStatus?.reasonEnum),tooltip:n.odigosHealthStatus?.message});const o=Xt(n.k8sHealthStatus?.status);return o&&e.push({key:"k8s-health",status:o,leftIcon:Ii,label:io(o,n.k8sHealthStatus?.reasonEnum),tooltip:n.k8sHealthStatus?.message}),e},[]),d=n.processes??[],u=d.length>0;return e(Nc,{$isExpanded:i,children:[t($c,{chevron:u?i?yi:mi:void 0,onClick:u?()=>l(e=>!e):void 0,label:Be.CONTAINER,name:n.containerName,paddingLeft:Ks+(u?0:24),action:{icon:Li,onClick:()=>s(o,n),tooltip:Be.OPEN_IN_POD_TAB},badges:c}),u&&i&&t(V,{$gap:0,$padding:`0 ${js}px`,children:d.map((e,a)=>{const i=a+1;return t(Ic,{overrideProcessNum:i,pod:o,container:n,process:e},`pod-${o.podName}-container-${n.containerName}-process-${i}`)})})]})},Oc=m.div`
267
278
  display: flex;
268
279
  flex-direction: column;
269
280
  align-self: stretch;
270
281
  border-radius: 8px;
271
282
  background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[800]:"transparent"};
272
283
  padding-bottom: ${({$isExpanded:e})=>e?"12px":"0"};
273
- `,$c=({pod:o})=>{const[n,i]=r(!1),{jumpToPod:l}=tc(),s=o.containers??[],c=s.length>0,d=a(()=>{const e=[],t=zt(o.agentInjectedStatus);t&&e.push(t);const n=zt(o.odigosHealthStatus,Ei,"health");n&&e.push(n);const a=zt(o.k8sHealthStatus,Ii,"health");return a&&e.push(a),e},[o.k8sHealthStatus,o.odigosHealthStatus,o.agentInjectedStatus]);return e(Tc,{$isExpanded:n,children:[t(Cc,{chevron:c?n?yi:mi:void 0,onClick:c?()=>i(e=>!e):void 0,label:Me.POD,name:o.podName,paddingLeft:js+(c?0:24),action:{icon:Fi,onClick:()=>l(o),tooltip:Me.OPEN_IN_POD_TAB},badges:d}),n&&c&&t(V,{$gap:0,$padding:`0 ${Us}px`,children:s.map(e=>t(kc,{pod:o,container:e},`pod-${o.podName}-container-${e.containerName}`))})]})},Ec=({pods:e})=>e?.length?t(V,{$gap:4,children:e.map(e=>t($c,{pod:e},`pod-${e.podName}`))}):t(Qe,{children:t(me,{title:Me.NO_RUNNING_PODS,subTitle:Me.NO_RUNNING_PODS_SUBTITLE})}),Ic=({source:o})=>t(xt,{bgTint:"1000",richTitle:{title:Me.PODS,badge:{label:o.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(xt,{bgTint:"900",children:[t(Bs,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:o.pods,noPadding:!0}),t(Ec,{pods:o.pods})]})}),Nc=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?ao(e.workloadOdigosHealthStatus.status):pt.Unknown,title:Ot(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Bt,{...o,width:"calc(100% - 32px)"}):null},Ac="calc(50% - 6px)",Oc=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Xt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Ot(t):`${Me.ROLLOUT} ${Ot(t)}`,subTitle:a,action:i!==we.Success?{icon:Ni,tooltip:Me.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),r=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=Xt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Ot(t):`${Me.ROLLBACK} ${Ot(t)}`,subTitle:n,action:a!==we.Success?{icon:Ni,tooltip:Me.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||r?t(xt,{bgTint:"1000",children:e(oe,{$gap:12,$alignItems:"stretch",children:[l&&t(Bt,{invertColors:!0,slim:!0,width:r?Ac:"100%",...l}),r&&t(Bt,{invertColors:!0,slim:!0,width:Ac,...r})]})}):null},Dc=p(null),Rc=m.div`
284
+ `,Dc=({pod:o})=>{const[n,i]=r(!1),{jumpToPod:l}=lc(),s=o.containers??[],c=s.length>0,d=a(()=>{const e=[],t=zt(o.agentInjectedStatus);t&&e.push(t);const n=zt(o.odigosHealthStatus,Ei,"health");n&&e.push(n);const a=zt(o.k8sHealthStatus,Ii,"health");return a&&e.push(a),e},[o.k8sHealthStatus,o.odigosHealthStatus,o.agentInjectedStatus]);return e(Oc,{$isExpanded:n,children:[t($c,{chevron:c?n?yi:mi:void 0,onClick:c?()=>i(e=>!e):void 0,label:Be.POD,name:o.podName,paddingLeft:Ws+(c?0:24),action:{icon:Li,onClick:()=>l(o),tooltip:Be.OPEN_IN_POD_TAB},badges:d}),n&&c&&t(V,{$gap:0,$padding:`0 ${Gs}px`,children:s.map(e=>t(Ac,{pod:o,container:e},`pod-${o.podName}-container-${e.containerName}`))})]})},Rc=({pods:e})=>e?.length?t(V,{$gap:4,children:e.map(e=>t(Dc,{pod:e},`pod-${e.podName}`))}):t(Qe,{children:t(me,{title:Be.NO_RUNNING_PODS,subTitle:Be.NO_RUNNING_PODS_SUBTITLE})}),Pc=({source:o})=>t(xt,{bgTint:"1000",richTitle:{title:Be.PODS,badge:{label:o.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(xt,{bgTint:"900",children:[t(Vs,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:o.pods,noPadding:!0}),t(Rc,{pods:o.pods})]})}),Fc=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?lo(e.workloadOdigosHealthStatus.status):pt.Unknown,title:Ot(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Mt,{...o,width:"calc(100% - 32px)"}):null},Lc="calc(50% - 6px)",_c=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Xt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Ot(t):`${Be.ROLLOUT} ${Ot(t)}`,subTitle:a,action:i!==we.Success?{icon:Ni,tooltip:Be.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),r=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=Xt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Ot(t):`${Be.ROLLBACK} ${Ot(t)}`,subTitle:n,action:a!==we.Success?{icon:Ni,tooltip:Be.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||r?t(xt,{bgTint:"1000",children:e(oe,{$gap:12,$alignItems:"stretch",children:[l&&t(Mt,{invertColors:!0,slim:!0,width:r?Lc:"100%",...l}),r&&t(Mt,{invertColors:!0,slim:!0,width:Lc,...r})]})}):null},zc=p(null),Bc=m.div`
274
285
  position: relative;
275
- `,Pc=({children:e})=>{const o=i(null);return t(Rc,{ref:o,children:t(Dc.Provider,{value:o,children:e})})},Fc=m.div`
286
+ `,Mc=({children:e})=>{const o=i(null);return t(Bc,{ref:o,children:t(zc.Provider,{value:o,children:e})})},Xc=m.div`
276
287
  position: fixed;
277
288
  top: ${({$coords:e})=>e.top}px;
278
289
  right: ${({$coords:e})=>e.right}px;
@@ -286,14 +297,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
286
297
  padding: 12px 16px;
287
298
  border-radius: 12px;
288
299
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
289
- `,Lc=m.div`
300
+ `,Vc=m.div`
290
301
  display: flex;
291
302
  align-items: flex-end;
292
303
  justify-content: space-between;
293
304
  gap: 8px;
294
- `,_c=m.div`
305
+ `,Uc=m.div`
295
306
  flex: 1;
296
- `,zc=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:m})=>{const b=f(),v=h(Dc),[y,C]=r(null);return io(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Xl(e(Fc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(V,{$gap:4,children:[t(Q,{size:te.XXS,children:c}),t(Q,{size:te.XXXS,color:ee.Secondary,children:d})]}),e(Lc,{children:[t(_c,{children:p}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${m||0} 0`,children:[t(ne,{variant:ie.Secondary,onClick:l,leftIcon:ii,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ae.S,textColor:b.v2.colors.red[500]}),t(ne,{variant:ie.Primary,onClick:a,leftIcon:Ci,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ae.S})]})]}),t("div",{children:t(Se,{status:we.Warning,message:u})})]}),document.body):null},Mc=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=$t(l),p=a(()=>{if(!o)return[];const e=lo[o].community,t=s===ht.Onprem?lo[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,s]),[h,g]=r(!1),[m,f]=r(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(oe,{$gap:4,$alignItems:"center",children:[n?t(Fe,{status:we.Info,invertColors:!0,label:Me.OVERIDDEN}):null,e(Pc,{children:[t(Ie,{text:Me.OVERRIDE_OTEL_DISTRO_NAME,children:t(ot,{icon:pi,onClick:b})}),m&&t(zc,{width:"500px",onClose:b,onSave:async()=>{g(!0),await i(c),g(!1),b()},saveTooltip:Me.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await i({otelDistroName:null}),g(!1),b()},deleteTooltip:Me.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Me.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Me.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Me.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(tt,{label:Me.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Bc=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:s}=Dt(),{formData:c,handleFormChange:d,resetFormData:u}=$t(i),p=a(()=>ro.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,g]=r(!1),[m,f]=r(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(oe,{children:[o?t(Fe,{status:we.Info,invertColors:!0,label:Me.OVERIDDEN}):null,e(Pc,{children:[t(Ie,{text:Me.OVERRIDE_RUNTIME_DETAILS,children:t(ot,{icon:pi,onClick:b})}),m&&t(zc,{width:"500px",onClose:b,onSave:async()=>{!c.version||so(c.version)?(g(!0),await n(c),g(!1),b()):s({type:we.Warning,message:Rt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Me.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),b()},deleteTooltip:Me.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Me.OVERRIDE_RUNTIME_DETAILS,subTitle:Me.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Me.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(oe,{$gap:8,children:[t(tt,{label:Me.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(pe,{label:Me.RUNTIME_VERSION,placeholder:Me.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Xc=({source:e,onOverride:o})=>{const{isVm:n}=y(),{containers:i,containersRichTitle:l}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Me.DETECTED_PROCESSES:`${e.id.kind} ${Me.CONTAINERS}`,tooltip:t?.message||(n?Me.DETECTED_PROCESSES_DESCRIPTION:Me.DETECTED_CONTAINERS_DESCRIPTION),badge:Xt(t?.status)===Ht.Loading?{status:Ht.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(xt,{bgTint:"1000",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:i.map(e=>e&&t(jc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},Vc=m.div`
307
+ `,Hc=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:m})=>{const b=f(),v=h(zc),[y,C]=r(null);return ro(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Ul(e(Xc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(V,{$gap:4,children:[t(Q,{size:te.XXS,children:c}),t(Q,{size:te.XXXS,color:ee.Secondary,children:d})]}),e(Vc,{children:[t(Uc,{children:p}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${m||0} 0`,children:[t(ne,{variant:ie.Secondary,onClick:l,leftIcon:ii,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ae.S,textColor:b.v2.colors.red[500]}),t(ne,{variant:ie.Primary,onClick:a,leftIcon:Ci,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ae.S})]})]}),t("div",{children:t(Se,{status:we.Warning,message:u})})]}),document.body):null},Gc=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=$t(l),p=a(()=>{if(!o)return[];const e=so[o].community,t=s===ht.Onprem?so[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,s]),[h,g]=r(!1),[m,f]=r(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(oe,{$gap:4,$alignItems:"center",children:[n?t(Fe,{status:we.Info,invertColors:!0,label:Be.OVERIDDEN}):null,e(Mc,{children:[t(Ie,{text:Be.OVERRIDE_OTEL_DISTRO_NAME,children:t(ot,{icon:pi,onClick:b})}),m&&t(Hc,{width:"500px",onClose:b,onSave:async()=>{g(!0),await i(c),g(!1),b()},saveTooltip:Be.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await i({otelDistroName:null}),g(!1),b()},deleteTooltip:Be.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Be.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Be.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Be.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(tt,{label:Be.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},jc=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:s}=Dt(),{formData:c,handleFormChange:d,resetFormData:u}=$t(i),p=a(()=>co.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,g]=r(!1),[m,f]=r(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(oe,{children:[o?t(Fe,{status:we.Info,invertColors:!0,label:Be.OVERIDDEN}):null,e(Mc,{children:[t(Ie,{text:Be.OVERRIDE_RUNTIME_DETAILS,children:t(ot,{icon:pi,onClick:b})}),m&&t(Hc,{width:"500px",onClose:b,onSave:async()=>{!c.version||uo(c.version)?(g(!0),await n(c),g(!1),b()):s({type:we.Warning,message:Rt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Be.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),b()},deleteTooltip:Be.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Be.OVERRIDE_RUNTIME_DETAILS,subTitle:Be.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Be.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(oe,{$gap:8,children:[t(tt,{label:Be.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(pe,{label:Be.RUNTIME_VERSION,placeholder:Be.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Wc=({source:e,onOverride:o})=>{const{isVm:n}=y(),{containers:i,containersRichTitle:l}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Be.DETECTED_PROCESSES:`${e.id.kind} ${Be.CONTAINERS}`,tooltip:t?.message||(n?Be.DETECTED_PROCESSES_DESCRIPTION:Be.DETECTED_CONTAINERS_DESCRIPTION),badge:Xt(t?.status)===Ht.Loading?{status:Ht.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(xt,{bgTint:"1000",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:i.map(e=>e&&t(qc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},Kc=m.div`
297
308
  display: flex;
298
309
  flex-direction: column;
299
310
  align-self: stretch;
@@ -301,28 +312,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
301
312
  padding: 8px 12px;
302
313
  border-radius: 8px;
303
314
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
304
- `,Uc=m.div`
315
+ `,Yc=m.div`
305
316
  display: flex;
306
317
  align-items: center;
307
318
  justify-content: center;
308
319
  padding: 8px;
309
320
  border-radius: 10px;
310
321
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
311
- `,Hc=m.div`
322
+ `,Jc=m.div`
312
323
  display: flex;
313
324
  flex-direction: column;
314
325
  gap: 12px;
315
326
  padding: 8px 12px;
316
327
  border-radius: 8px;
317
328
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
318
- `,jc=({onOverride:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=f(),d=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=a(()=>({language:Ut(n),version:co(n)||void 0}),[n]),p=a(()=>!!s?.otelDistroName,[s]),h=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!d,[l,d]),m=a(()=>g?Oi:_e(u.language),[g,u]),b=a(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),v=a(()=>g?{status:Ht.Loading,label:Me.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?we.Success:Ht.Disabled,leftIcon:r?.otelDistroName?si:ci,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),y=e=>o({containerName:i,...p?h:{},...d?u:{},...e});return e(Vc,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Uc,{children:t(m,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(Q,{children:i}),t(Pt,b?{variant:jt.Blue,label:b}:{variant:jt.Loader,label:Me.DETECTING_RUNTIME_INFO}),t(Bc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(Fe,{...v,textSize:te.XXXS}),t(Mc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!r||r.agentEnabled||g?null:t(Hc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:jt.Pink,label:Ot(r.agentEnabledStatus?.reasonEnum)||Me.NO_AVAILABLE_AGENT}),t(Q,{size:te.XXXS,color:ee.Secondary,children:r?.agentEnabledStatus?.message})]})})]})},Gc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>e(V,{$gap:12,children:[t(fc,{source:o}),t(Nc,{source:o}),t(Oc,{source:o,onClickRollout:n,onClickRollback:a}),t(Xc,{source:o,onOverride:i}),t(Ic,{source:o})]}),Wc=({source:o,fetchK8sManifest:a})=>{const i=f(),[l,s]=r(!0),[c,d]=r(void 0),[u,p]=r(!0),[h,g]=r(void 0);return n(()=>{a(o.id.namespace,o.id.kind,o.id.name).then(d).finally(()=>s(!1)),a(o.id.namespace,uo.InstrumentationConfig,`${o.id.kind}-${o.id.name}`.toLowerCase()).then(g).finally(()=>p(!1))},[a,o.id.namespace,o.id.kind,o.id.name]),e(xt,{bgTint:"1000",children:[l?t(po,{size:1}):t(vl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:c}),u?t(po,{size:1}):t(vl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:h})]})};function Kc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function Yc(e){const t=Math.abs(e);return t>=1e9?`${Jc(e/1e9)}s`:t>=1e6?`${Jc(e/1e6)}ms`:t>=1e3?`${Jc(e/1e3)}μs`:String(Math.round(e))}function Jc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function qc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function Zc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Qc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function ed(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1}=i,c=qc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(r&&(d=d.filter(t=>r(Kc(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Kc(e,l.nameIndex)===Kc(e,t.nameIndex)&&a.add(Zc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(Zc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Zc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,r=Math.max(f-v,1),s=Kc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:r,name:s,matchesSearch:Qc(s,b)}})}function td(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var od,nd;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(od||(od={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(nd||(nd={}));function ad(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function id(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function ld(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const rd=({flamebearer:o,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=i(null),v=i(null),y=i({x:0,y:0}),C=i(o.numTicks),[S,w]=r({w:0,h:0}),[x,k]=r(""),[T,$]=r(null),[E,I]=r([]),[N,A]=r(!1),[O,D]=r(od.Fit),[R,P]=r(nd.Fit),[F,L]=r(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*R),8192)),M=E.length>0?E[E.length-1]:null,B=M?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,I([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!N)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[N]),n(()=>(p?.(N),()=>{N&&p?.(!1)}),[N,p]);const X=a(()=>ed(o,_,z,s,c,{zoomRoot:M,shouldKeepName:d,collapseRecursive:F}),[o,s,c,z,_,M,d,F]),V=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?c.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,c]),U=l(e=>{if(_<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=id((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,V);if(n){const e=Zc(n);$(e);const t=B>0?(100*n.size/B).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";k(`${n.name}\ntotal ${Yc(n.size)} (${t}% of view, ${a}% of profile) · self ${Yc(n.self)}`)}else $(null),k("")},[V,o.numTicks,z,_,B]),H=l(e=>{U(e)},[U]),j=l(()=>{$(null),k("")},[]),G=l(e=>{y.current={x:e.clientX,y:e.clientY}},[]),W=l(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=id((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*z,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);I(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,z,_]);g(()=>{const e=v.current;if(!e||_<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,z),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(z*a),e.style.width=`${_}px`,e.style.height=`${z}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,_,z),X?.length?function(e,t,o,n,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=td(s,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=ad(d,r),m=`${s} (${Yc(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(Zc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,_,z,X,c,m,T,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,_,z)))},[X,o.numTicks,T,c,z,_,m]);const J=l(()=>A(e=>!e),[]),q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(B/o.numTicks*100))):100,Z=a(()=>function(e,t){const o=qc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let r=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!r||e.size>r.size||e.size===r.size&&e.level<r.level)&&(r=e);return r}(o,M),[o,M]),re=null!==Z,se=E.length>0,ce=M?Kc(o,M.nameIndex):"",de=l(()=>I([]),[]),ue=l(()=>I(e=>e.slice(0,-1)),[]),pe=l(()=>{Z&&I(e=>[...e,Z])},[Z]);return e("div",{style:N?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(K,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Y.Left,size:gt.S,value:F,onChange:L}),e(oe,{$gap:8,children:[e(oe,{children:[t(ne,{variant:ie.Secondary,size:ae.S,label:"Reset zoom",leftIcon:Li,onClick:de,disabled:!E.length}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:_i,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!se,onClick:ue}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,align:"center",children:`${q}%`})}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:li,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!re,onClick:pe})]}),e(oe,{children:[t(Ie,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(le,{variant:ho.Filled,options:[{value:od.Fit,label:"W: Fit"},{value:od.X10,label:"10x"}],selected:O,setSelected:D})}),t(Ie,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(le,{variant:ho.Filled,options:[{value:nd.Fit,label:"H: Fit"},{value:nd.X10,label:"10x"}],selected:R,setSelected:P})})]}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:24,leftIcon:N?Si:Fi,tooltip:N?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:J})]})]}),t(Ie,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:N?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:G,onPointerMove:H,onPointerLeave:j,onClick:W})})})}),e(oe,{$justifyContent:"space-between",children:[t(Q,M?{size:te.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${ce} • ${Yc(B)} samples in view`}:{size:te.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(Q,{size:te.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ld(h.totalBytesUsed)} / ${ld(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var sd,cd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(sd||(sd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(cd||(cd={}));const dd=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function ud(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(cd.FilterOutVoid)&&"void"===o)return!1;if(t.includes(cd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&dd.test(o)))return!1}return!0}const pd={options:[{id:cd.FilterOutVoid,label:"Filter out void symbols"},{id:cd.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>ud(e.cells.find(e=>e.key===sd.Symbol)?.rawValue?.toString()??"",t)},hd=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:sd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(go.Java)?pd:void 0,noFilter:!o?.includes(go.Java)},{key:sd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:sd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),r=a(()=>e.map(e=>({cells:[{key:sd.Symbol,rawValue:e.name},{key:sd.Self,rawValue:Yc(e.self)},{key:sd.Total,rawValue:Yc(e.total)}]})),[e]);return t(mo,{variant:fo.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:n,onFiltersChange:i,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:zi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var gd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(gd||(gd={}));const md=m(V)`
329
+ `,qc=({onOverride:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=f(),d=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=a(()=>({language:Ut(n),version:po(n)||void 0}),[n]),p=a(()=>!!s?.otelDistroName,[s]),h=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!d,[l,d]),m=a(()=>g?Oi:_e(u.language),[g,u]),b=a(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),v=a(()=>g?{status:Ht.Loading,label:Be.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?we.Success:Ht.Disabled,leftIcon:r?.otelDistroName?si:ci,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),y=e=>o({containerName:i,...p?h:{},...d?u:{},...e});return e(Kc,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Yc,{children:t(m,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(Q,{children:i}),t(Pt,b?{variant:Gt.Blue,label:b}:{variant:Gt.Loader,label:Be.DETECTING_RUNTIME_INFO}),t(jc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(Fe,{...v,textSize:te.XXXS}),t(Gc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!r||r.agentEnabled||g?null:t(Jc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:Gt.Pink,label:Ot(r.agentEnabledStatus?.reasonEnum)||Be.NO_AVAILABLE_AGENT}),t(Q,{size:te.XXXS,color:ee.Secondary,children:r?.agentEnabledStatus?.message})]})})]})},Zc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>{const{isVm:l}=y();return e(V,{$gap:12,children:[t(wc,{source:o}),t(Fc,{source:o}),!l&&t(_c,{source:o,onClickRollout:n,onClickRollback:a}),!l&&t(Wc,{source:o,onOverride:i}),!l&&t(Pc,{source:o})]})};function Qc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function ed(e){const t=Math.abs(e);return t>=1e9?`${td(e/1e9)}s`:t>=1e6?`${td(e/1e6)}ms`:t>=1e3?`${td(e/1e3)}μs`:String(Math.round(e))}function td(e){return e.toFixed(2).replace(/\.?0+$/,"")}function od(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function nd(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function ad(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function id(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1}=i,c=od(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(r&&(d=d.filter(t=>r(Qc(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Qc(e,l.nameIndex)===Qc(e,t.nameIndex)&&a.add(nd(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(nd(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(nd(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,r=Math.max(f-v,1),s=Qc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:r,name:s,matchesSearch:ad(s,b)}})}function ld(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var rd,sd;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(rd||(rd={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(sd||(sd={}));function cd(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function dd(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function ud(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const pd=({flamebearer:o,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=i(null),v=i(null),y=i({x:0,y:0}),C=i(o.numTicks),[S,w]=r({w:0,h:0}),[x,k]=r(""),[T,$]=r(null),[E,I]=r([]),[N,A]=r(!1),[O,D]=r(rd.Fit),[R,P]=r(sd.Fit),[F,L]=r(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*R),8192)),B=E.length>0?E[E.length-1]:null,M=B?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,I([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!N)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[N]),n(()=>(p?.(N),()=>{N&&p?.(!1)}),[N,p]);const X=a(()=>id(o,_,z,s,c,{zoomRoot:B,shouldKeepName:d,collapseRecursive:F}),[o,s,c,z,_,B,d,F]),V=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?c.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,c]),U=l(e=>{if(_<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=dd((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,V);if(n){const e=nd(n);$(e);const t=M>0?(100*n.size/M).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";k(`${n.name}\ntotal ${ed(n.size)} (${t}% of view, ${a}% of profile) · self ${ed(n.self)}`)}else $(null),k("")},[V,o.numTicks,z,_,M]),H=l(e=>{U(e)},[U]),G=l(()=>{$(null),k("")},[]),j=l(e=>{y.current={x:e.clientX,y:e.clientY}},[]),W=l(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=dd((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*z,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);I(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,z,_]);g(()=>{const e=v.current;if(!e||_<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,z),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(z*a),e.style.width=`${_}px`,e.style.height=`${z}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,_,z),X?.length?function(e,t,o,n,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=ld(s,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=cd(d,r),m=`${s} (${ed(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(nd(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,_,z,X,c,m,T,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,_,z)))},[X,o.numTicks,T,c,z,_,m]);const J=l(()=>A(e=>!e),[]),q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(M/o.numTicks*100))):100,Z=a(()=>function(e,t){const o=od(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let r=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!r||e.size>r.size||e.size===r.size&&e.level<r.level)&&(r=e);return r}(o,B),[o,B]),re=null!==Z,se=E.length>0,ce=B?Qc(o,B.nameIndex):"",de=l(()=>I([]),[]),ue=l(()=>I(e=>e.slice(0,-1)),[]),pe=l(()=>{Z&&I(e=>[...e,Z])},[Z]);return e("div",{style:N?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(K,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Y.Left,size:gt.S,value:F,onChange:L}),e(oe,{$gap:8,children:[e(oe,{children:[t(ne,{variant:ie.Secondary,size:ae.S,label:"Reset zoom",leftIcon:_i,onClick:de,disabled:!E.length}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:zi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!se,onClick:ue}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,align:"center",children:`${q}%`})}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:li,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!re,onClick:pe})]}),e(oe,{children:[t(Ie,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(le,{variant:ho.Filled,options:[{value:rd.Fit,label:"W: Fit"},{value:rd.X10,label:"10x"}],selected:O,setSelected:D})}),t(Ie,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(le,{variant:ho.Filled,options:[{value:sd.Fit,label:"H: Fit"},{value:sd.X10,label:"10x"}],selected:R,setSelected:P})})]}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:24,leftIcon:N?Si:Li,tooltip:N?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:J})]})]}),t(Ie,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:N?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:j,onPointerMove:H,onPointerLeave:G,onClick:W})})})}),e(oe,{$justifyContent:"space-between",children:[t(Q,B?{size:te.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${ce} • ${ed(M)} samples in view`}:{size:te.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(Q,{size:te.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ud(h.totalBytesUsed)} / ${ud(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var hd,gd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(hd||(hd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(gd||(gd={}));const md=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function fd(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(gd.FilterOutVoid)&&"void"===o)return!1;if(t.includes(gd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&md.test(o)))return!1}return!0}const bd={options:[{id:gd.FilterOutVoid,label:"Filter out void symbols"},{id:gd.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>fd(e.cells.find(e=>e.key===hd.Symbol)?.rawValue?.toString()??"",t)},vd=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:hd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(go.Java)?bd:void 0,noFilter:!o?.includes(go.Java)},{key:hd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:hd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),r=a(()=>e.map(e=>({cells:[{key:hd.Symbol,rawValue:e.name},{key:hd.Self,rawValue:ed(e.self)},{key:hd.Total,rawValue:ed(e.total)}]})),[e]);return t(mo,{variant:fo.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:n,onFiltersChange:i,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Bi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var yd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(yd||(yd={}));const Cd=m(V)`
319
330
  width: 100%;
320
331
  flex: 1;
321
332
  border-radius: 16px;
322
333
  overflow: hidden;
323
334
  background: ${({theme:e})=>e.v2.colors.silver[800]};
324
335
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
325
- `,fd=m.div`
336
+ `,Sd=m.div`
326
337
  display: flex;
327
338
  align-items: center;
328
339
  gap: 10px;
@@ -330,11 +341,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
330
341
  padding: 12px 12px 8px;
331
342
  background: ${({theme:e})=>e.v2.colors.silver[800]};
332
343
  border-radius: 16px 16px 0 0;
333
- `,bd=m(oe)`
344
+ `,wd=m(oe)`
334
345
  flex-shrink: 0;
335
346
  align-items: center;
336
347
  gap: 4px;
337
- `,vd=m.div`
348
+ `,xd=m.div`
338
349
  flex: 1;
339
350
  display: flex;
340
351
  align-items: stretch;
@@ -342,20 +353,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
342
353
  padding: 16px;
343
354
  background: ${({theme:e})=>e.v2.colors.silver[800]};
344
355
  border-radius: 0 0 16px 16px;
345
- `,yd=m(V)`
356
+ `,kd=m(V)`
346
357
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
347
358
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
348
359
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
349
360
  gap: 10px;
350
- `,Cd=m(V)`
361
+ `,Td=m(V)`
351
362
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
352
363
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
353
364
  gap: 10px;
354
- `,Sd=m(oe)`
365
+ `,$d=m(oe)`
355
366
  width: 100%;
356
367
  min-height: 32px;
357
368
  flex-shrink: 0;
358
- `,wd=({source:o,fetchProfilingSlots:c,enableProfiling:d,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=f(),g=o.id,[m,b]=r(!0),[v,y]=r(null),[C,S]=r(null),[w,x]=r(0),[k,T]=r(gd.Both),[$,E]=r(""),[I,N]=r({}),A=i(null),O=l(async()=>{try{const e=[c()];m&&e.push(u(g));const[t,o]=await Promise.all(e);t&&y(t),o?.profileJson&&S(o.profileJson)}finally{x(e=>e+1)}},[c,u,g]);n(()=>{let e=!1;return(async()=>{await d(g),e||(await O(),e||(A.current=setInterval(O,3e3)))})(),()=>{e=!0,A.current&&clearInterval(A.current)}},[d,O,g]);const D=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(C),[C]),R=a(()=>D?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=Kc(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||a>r.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(D.flamebearer):[],[D]),P=a(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),F=k===gd.Table||k===gd.Both,L=k===gd.Flame||k===gd.Both,_=F&&L,z=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),M=a(()=>function(e,t){if(!t?.includes(go.Java))return;const o=e?.[sd.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>ud(e,o):void 0}(I,z),[I,z]);return!C&&w<2?t(Qe,{$height:"70vh",children:t(at,{withSpinner:!0})}):e(md,{$gap:0,$width:"100%",children:[e(fd,{children:[t(Ie,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(bd,{children:t(Q,{size:te.S,weight:500,color:ee.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(oe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Kt,{value:$,onChange:E,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(le,{variant:ho.Filled,options:[{value:gd.Table,label:"Top table"},{value:gd.Flame,label:"Flame graph"},{value:gd.Both,label:"Both"}],selected:k,setSelected:T}),t(ne,m?{variant:ie.Secondary,size:ae.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Mi,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:ie.Secondary,size:ae.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Mi,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(vd,{$gap:F&&L?16:0,children:D?e(s,{children:[F&&e(yd,{$splitWithFlame:_,children:[t(Sd,{$justifyContent:"flex-end",children:t(ne,{variant:ie.Secondary,size:ae.S,label:"Download snapshot",rightIcon:Bi,onClick:()=>{if(!C)return;const e=new Blob([C],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!C})}),t(hd,{rows:P,languages:z,filters:I,onFiltersChange:N})]}),L&&e(Cd,{$splitWithTable:_,children:[e(Sd,{$justifyContent:"space-between",children:[t(Fe,{label:D?`Total in view ${Yc(D.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:te.XXS}),e(oe,{$gap:12,children:[!m&&t(ne,{variant:ie.Secondary,size:ae.S,label:"Refresh",leftIcon:Ni,onClick:O}),t(K,{label:"Auto refresh",labelAlign:Y.Left,size:gt.S,value:m,onChange:b})]})]}),t(rd,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:$,shouldKeepName:M,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},k)]})]}):t(Qe,{children:t(me,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},xd=[uo.Deployment,uo.StatefulSet,uo.DaemonSet,uo.DeploymentConfig,uo.Rollout,uo.Pod];var kd;!function(e){e.Workload="Workload",e.Pod="Pod"}(kd||(kd={}));const Td=e=>!!e&&Xt(e.status)===we.Error,$d=e=>Td(e.healthStatus),Ed=e=>Td(e.odigosHealthStatus)||(e.processes??[]).some($d),Id=e=>Td(e.agentInjectedStatus)||Td(e.odigosHealthStatus)||(e.containers??[]).some(Ed),Nd=({onClose:o,effectiveConfig:s,sourceId:c,fetchSourceById:d,persistSources:u,updateSource:p,restartWorkloads:h,restartPod:g,recoverFromRollback:m,fetchPeerSources:b,enableProfiling:v,fetchProfilingSlots:C,fetchSourceProfiling:S,fetchK8sManifest:w})=>{const x=f(),{isVm:k}=y(),{selectedStreamName:T}=Be(),{genericForm:$,loadSource:E,validateFormData:I}=$l(),[N,A]=r(!1),[O,D]=r(!1),[R,P]=r(!1),[F,L]=r(_s.Overview),[_,z]=r(null),[M,B]=r({openFor:null}),X=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:_s.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:_s.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=Ks({identifyingAttributes:n.identifyingAttributes});t({tab:_s.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),s=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:s}),[e,o,n,i,s])})();n(()=>{X.jumpToTarget&&L(X.jumpToTarget.tab)},[X.jumpToTarget]),n(()=>{_&&JSON.stringify(qt(c))!==JSON.stringify(qt(_))&&z(null)},[c,_]);const U=i(!1),H=l(async()=>z(await d(c)||null),[c]);n(()=>{if(U.current||(H(),U.current=!0),!N){const e=setInterval(()=>H(),3e3);return()=>clearInterval(e)}},[H,N]),n(()=>{_&&E(_)},[_]);const j=_&&xd.includes(_.id.kind),G=a(()=>{const e=[],o=(_?.pods??[]).some(Id);return e.push({value:_s.Overview,label:Me.OVERVIEW}),e.push({value:_s.Pods,label:Me.PODS,icon:o?e=>t(Ai,{...e,fill:x.v2.colors.red[500]}):void 0}),k||e.push({value:_s.PeerSources,label:Me.PEER_SOURCES}),s?.profiling?.enabled&&e.push({value:_s.Profiling,label:Me.PROFILING}),k||e.push({value:_s.Debug,label:Me.DEBUG}),e},[k,s,_?.pods]),W=l(()=>A(!0),[]),K=l(()=>{_&&E(_),A(!1)},[_]),Y=l(async()=>{if(!_||!$)return;const{errorMessage:e,preparedFormData:t}=I();if(e)return;const o=t.otelServiceName!==_.id.name?t.otelServiceName:"";await p(c,{...t,otelServiceName:o}),A(!1)},[_,$,I,c,p]),J=l(()=>D(!0),[]),Z=l(async()=>{_&&(await u({[yt]:[{namespace:_.id.namespace,name:_.id.name,kind:_.id.kind,selected:!1,currentStreamName:T}]}),D(!1),o())},[_,u,T,o]),Q=l(()=>{B({openFor:kd.Workload})},[]),ee=l(e=>{L(e),X.clearJumpToTarget()},[X]),oe=l(async()=>{await m(c)},[m,c]),ne=l(async()=>{M.openFor===kd.Workload?await h([c]):M.openFor===kd.Pod&&M.podNamespace&&M.podName&&await g(M.podNamespace,M.podName),B({openFor:null})},[M,h,g,c]),ae=a(()=>{const e=[];return N||F===_s.Overview&&(e.push({id:"edit-source-btn-edit",label:St.EDIT,icon:pi,active:N,onClick:W}),!k&&j&&e.push({id:"edit-source-btn-restart",label:St.RESTART,icon:Xi,onClick:Q}),e.push({id:"edit-source-btn-delete",label:St.DELETE,icon:ii,color:x.v2.colors.red[500],active:O,onClick:J})),e},[F,N,O,k,j,W,Q,J,x]),re=a(()=>{if(!_)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:_.id.name,leftIcon:Ii}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:Ei,textColor:x.v2.colors.silver[200]}),e},[_,x]);if(!_)return t(q,{isOpen:!0,children:t(Qe,{$height:"80vh",children:t(at,{withSpinner:!0})})});const se=F===_s.Profiling?R?"95vw":"80vw":N?void 0:"60vw";return e(ec,{value:X,children:[t(q,{isOpen:!0,width:se,header:{icon:bo(_.containers)[0],titleBadges:re,onClose:()=>{ee(_s.Overview),z(null),P(!1),o()},actions:ae},footer:{actions:N?[{"data-id":"edit-source-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:K},{"data-id":"edit-source-btn-save",label:St.SAVE,variant:ie.Primary,onClick:Y}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:e(V,{$gap:16,children:[!N&&G.length>1&&t(le,{options:G,selected:F,setSelected:ee}),(()=>{switch(F){case _s.Overview:return N?t(Mr,{}):t(Gc,{source:_,onClickRollout:Q,onClickRollback:oe,onOverride:e=>p(c,e)});case _s.Pods:return t(lc,{source:_,onClickRestartPod:j?(e,t)=>B({openFor:kd.Pod,podNamespace:e,podName:t}):void 0});case _s.PeerSources:return t(rc,{source:_,fetchPeerSources:b});case _s.Profiling:return t(wd,{source:_,fetchProfilingSlots:C,enableProfiling:v,fetchSourceProfiling:S,onFlameFullscreenChange:P});case _s.Debug:return t(Wc,{source:_,fetchK8sManifest:w});default:return null}})()]})})}),t(fl,{target:"source",action:"uninstrument",isOpen:O,onClose:()=>D(!1),onApprove:Z}),t(fl,{target:`${M.openFor?.toLowerCase()??""}`,action:"restart",description:Me.RESTART_POD_DESCRIPTION,isOpen:!!M.openFor,onClose:()=>B({openFor:null}),onApprove:ne,overrideApproveButtonLabel:Me.DELETE_POD_TO_RESTART})]})},Ad=m.div`
369
+ `,Ed=({source:o,fetchProfilingSlots:c,enableProfiling:d,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=f(),g=o.id,[m,b]=r(!0),[v,y]=r(null),[C,S]=r(null),[w,x]=r(0),[k,T]=r(yd.Both),[$,E]=r(""),[I,N]=r({}),A=i(null),O=l(async()=>{try{const e=[c()];m&&e.push(u(g));const[t,o]=await Promise.all(e);t&&y(t),o?.profileJson&&S(o.profileJson)}finally{x(e=>e+1)}},[c,u,g]);n(()=>{let e=!1;return(async()=>{await d(g),e||(await O(),e||(A.current=setInterval(O,3e3)))})(),()=>{e=!0,A.current&&clearInterval(A.current)}},[d,O,g]);const D=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(C),[C]),R=a(()=>D?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=Qc(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||a>r.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(D.flamebearer):[],[D]),P=a(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),F=k===yd.Table||k===yd.Both,L=k===yd.Flame||k===yd.Both,_=F&&L,z=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),B=a(()=>function(e,t){if(!t?.includes(go.Java))return;const o=e?.[hd.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>fd(e,o):void 0}(I,z),[I,z]);return!C&&w<2?t(Qe,{$height:"70vh",children:t(at,{withSpinner:!0})}):e(Cd,{$gap:0,$width:"100%",children:[e(Sd,{children:[t(Ie,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(wd,{children:t(Q,{size:te.S,weight:500,color:ee.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(oe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Kt,{value:$,onChange:E,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(le,{variant:ho.Filled,options:[{value:yd.Table,label:"Top table"},{value:yd.Flame,label:"Flame graph"},{value:yd.Both,label:"Both"}],selected:k,setSelected:T}),t(ne,m?{variant:ie.Secondary,size:ae.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Mi,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:ie.Secondary,size:ae.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Mi,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(xd,{$gap:F&&L?16:0,children:D?e(s,{children:[F&&e(kd,{$splitWithFlame:_,children:[t($d,{$justifyContent:"flex-end",children:t(ne,{variant:ie.Secondary,size:ae.S,label:"Download snapshot",rightIcon:Xi,onClick:()=>{if(!C)return;const e=new Blob([C],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!C})}),t(vd,{rows:P,languages:z,filters:I,onFiltersChange:N})]}),L&&e(Td,{$splitWithTable:_,children:[e($d,{$justifyContent:"space-between",children:[t(Fe,{label:D?`Total in view ${ed(D.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:te.XXS}),e(oe,{$gap:12,children:[!m&&t(ne,{variant:ie.Secondary,size:ae.S,label:"Refresh",leftIcon:Ni,onClick:O}),t(K,{label:"Auto refresh",labelAlign:Y.Left,size:gt.S,value:m,onChange:b})]})]}),t(pd,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:$,shouldKeepName:B,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},k)]})]}):t(Qe,{children:t(me,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},Id=[to.Deployment,to.StatefulSet,to.DaemonSet,to.DeploymentConfig,to.Rollout,to.Pod];var Nd;!function(e){e.Workload="Workload",e.Pod="Pod"}(Nd||(Nd={}));const Ad=e=>!!e&&Xt(e.status)===we.Error,Od=e=>Ad(e.healthStatus),Dd=e=>Ad(e.odigosHealthStatus)||(e.processes??[]).some(Od),Rd=e=>Ad(e.agentInjectedStatus)||Ad(e.odigosHealthStatus)||(e.containers??[]).some(Dd),Pd=({onClose:o,effectiveConfig:s,sourceId:c,fetchSourceById:d,persistSources:u,updateSource:p,restartWorkloads:h,restartPod:g,recoverFromRollback:m,fetchPeerSources:b,enableProfiling:v,fetchProfilingSlots:C,fetchSourceProfiling:S,fetchK8sManifest:w})=>{const x=f(),{isVm:k}=y(),{selectedStreamName:T}=Me(),{genericForm:$,loadSource:E,validateFormData:I}=Il(),[N,A]=r(!1),[O,D]=r(!1),[R,P]=r(!1),[F,L]=r(Bs.Overview),[_,z]=r(null),[B,M]=r({openFor:null}),X=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:Bs.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:Bs.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=Js({identifyingAttributes:n.identifyingAttributes});t({tab:Bs.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),s=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:s}),[e,o,n,i,s])})();n(()=>{X.jumpToTarget&&L(X.jumpToTarget.tab)},[X.jumpToTarget]),n(()=>{_&&JSON.stringify(qt(c))!==JSON.stringify(qt(_))&&z(null)},[c,_]);const U=i(!1),H=l(async()=>z(await d(c)||null),[c]);n(()=>{if(U.current||(H(),U.current=!0),!N){const e=setInterval(()=>H(),3e3);return()=>clearInterval(e)}},[H,N]),n(()=>{_&&E(_)},[_]);const G=_&&Id.includes(_.id.kind),j=a(()=>{const e=[],o=(_?.pods??[]).some(Rd);return e.push({value:Bs.Overview,label:Be.OVERVIEW}),k||(e.push({value:Bs.Pods,label:Be.PODS,icon:o?e=>t(Ai,{...e,fill:x.v2.colors.red[500]}):void 0}),e.push({value:Bs.PeerSources,label:Be.PEER_SOURCES}),s?.profiling?.enabled&&e.push({value:Bs.Profiling,label:Be.PROFILING}),e.push({value:Bs.Debug,label:Be.DEBUG})),e},[k,s,_?.pods]),W=l(()=>A(!0),[]),K=l(()=>{_&&E(_),A(!1)},[_]),Y=l(async()=>{if(!_||!$)return;const{errorMessage:e,preparedFormData:t}=I();if(e)return;const o=t.otelServiceName!==_.id.name?t.otelServiceName:"";await p(c,{...t,otelServiceName:o}),A(!1)},[_,$,I,c,p]),J=l(()=>D(!0),[]),Z=l(async()=>{_&&(await u({[yt]:[{namespace:_.id.namespace,name:_.id.name,kind:_.id.kind,selected:!1,currentStreamName:T}]}),D(!1),o())},[_,u,T,o]),Q=l(()=>{M({openFor:Nd.Workload})},[]),ee=l(e=>{L(e),X.clearJumpToTarget()},[X]),oe=l(async()=>{await m(c)},[m,c]),ne=l(async()=>{B.openFor===Nd.Workload?await h([c]):B.openFor===Nd.Pod&&B.podNamespace&&B.podName&&await g(B.podNamespace,B.podName),M({openFor:null})},[B,h,g,c]),ae=a(()=>{const e=[];return N||F===Bs.Overview&&(e.push({id:"edit-source-btn-edit",label:St.EDIT,icon:pi,active:N,onClick:W}),!k&&G&&e.push({id:"edit-source-btn-restart",label:St.RESTART,icon:Vi,onClick:Q}),e.push({id:"edit-source-btn-delete",label:St.DELETE,icon:ii,color:x.v2.colors.red[500],active:O,onClick:J})),e},[F,N,O,k,G,W,Q,J,x]),re=a(()=>{if(!_)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:_.id.name,leftIcon:k?void 0:Ii}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:Ei,textColor:x.v2.colors.silver[200]}),e},[_,x,k]);if(!_)return t(q,{isOpen:!0,children:t(Qe,{$height:"80vh",children:t(at,{withSpinner:!0})})});const se=F===Bs.Profiling?R?"95vw":"80vw":N?void 0:"60vw";return e(ic,{value:X,children:[t(q,{isOpen:!0,width:se,header:{icon:k?Ui:bo(_.containers)[0],titleBadges:re,onClose:()=>{ee(Bs.Overview),z(null),P(!1),o()},actions:ae},footer:{actions:N?[{"data-id":"edit-source-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:K},{"data-id":"edit-source-btn-save",label:St.SAVE,variant:ie.Primary,onClick:Y}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:e(V,{$gap:16,children:[!N&&j.length>1&&t(le,{options:j,selected:F,setSelected:ee}),(()=>{switch(F){case Bs.Overview:return N?t(Xr,{}):t(Zc,{source:_,onClickRollout:Q,onClickRollback:oe,onOverride:e=>p(c,e)});case Bs.Pods:return t(uc,{source:_,onClickRestartPod:G?(e,t)=>M({openFor:Nd.Pod,podNamespace:e,podName:t}):void 0});case Bs.PeerSources:return t(pc,{source:_,fetchPeerSources:b});case Bs.Profiling:return t(Ed,{source:_,fetchProfilingSlots:C,enableProfiling:v,fetchSourceProfiling:S,onFlameFullscreenChange:P});case Bs.Debug:return t(fc,{source:_,fetchK8sManifest:w});default:return null}})()]})})}),t(vl,{target:"source",action:"uninstrument",isOpen:O,onClose:()=>D(!1),onApprove:Z}),t(vl,{target:`${B.openFor?.toLowerCase()??""}`,action:"restart",description:Be.RESTART_POD_DESCRIPTION,isOpen:!!B.openFor,onClose:()=>M({openFor:null}),onApprove:ne,overrideApproveButtonLabel:Be.DELETE_POD_TO_RESTART})]})},Fd=m.div`
359
370
  display: flex;
360
371
  align-items: center;
361
372
  gap: 8px;
@@ -365,9 +376,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
365
376
  &:hover {
366
377
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
367
378
  }
368
- `,Od=m.div`
379
+ `,Ld=m.div`
369
380
  flex: 1;
370
- `,Dd=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Ad,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(Q,{size:te.XS,weight:500,color:n,children:So}),t(ii,{size:16,fill:n})]})};function Rd(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Dd,{onClick:l}),r&&t(Se,{status:we.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Od,{}),t(ne,{"data-id":"sampling-view-edit-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:a}),t(ne,{"data-id":"sampling-view-edit-btn-save",label:yo,variant:ie.Primary,size:ae.S,onClick:i,disabled:!!r})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(Dd,{onClick:a}),t(Od,{}),t(ne,{"data-id":"sampling-view-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:i}),t(ne,{"data-id":"sampling-view-btn-edit",label:Co,variant:ie.Primary,size:ae.S,onClick:l})]})}}const Pd={[Il.EditAutoNoisy]:{title:Do,subTitle:Oo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Il.EditAutoCostReduction]:{title:Ao,subTitle:No,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Il.EditAutoHighlyRelevant]:{title:Io,subTitle:Eo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Fd=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(q,{isOpen:e,width:Po,header:{icon:Vi,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(wt,{$padding:"12px",children:t(jr,{})})}),Ld=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:r})=>{const{category:s,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=El(Il.Create);n(()=>{e&&d()},[e]);const h=l(()=>{if(i){const e=i(c);if(e)return void p(e)}a(c)},[c,a,i,p]),g={note:u?{status:we.Warning,message:u.message,action:r?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>r(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:To,variant:ie.Primary,size:ae.S,onClick:h,disabled:!!u}]};return t(Fd,{isOpen:e,title:$o[s],subTitle:wo[s],onClose:o,footer:g})},_d=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:i,onNavigateToDuplicate:r})=>{const{data:s,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:g}=El(Il.View),m=s?.rule.name||ko,f=c&&s?xo[s.category]:`${m} preview`,b=l(()=>{if(s&&c){if(i){const e=i(d);if(e)return void g(e)}n(d,s.rule.ruleId,s.samplingId)}},[s,c,d,n,i,g]),v=l(()=>{s&&o(s.rule.ruleId,s.samplingId)},[s,o]),y=a(()=>{if(!s)return;const t=h?{message:h.message,onViewRule:r?()=>r(h.ruleId):void 0}:null;return Rd(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[s,c,h,p,b,v,u,e,r]);return t(Fd,{isOpen:!!s,title:f,subTitle:s?wo[s.category]:"",onClose:e,footer:y})},zd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=El(Il.EditAutoNoisy),r=l(()=>n(a,i),[n,a,i]);return t(Xd,{formType:Il.EditAutoNoisy,isOpen:e,onClose:o,onSave:r})},Md=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=El(Il.EditAutoCostReduction),r=l(()=>n(a,i),[n,a,i]);return t(Xd,{formType:Il.EditAutoCostReduction,isOpen:e,onClose:o,onSave:r})},Bd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=El(Il.EditAutoHighlyRelevant),i=l(()=>n(a),[n,a]);return t(Xd,{formType:Il.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},Xd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=Pd[e];return t(Fd,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:vo,variant:ie.Secondary,size:ae.S,onClick:n},{"data-id":i.saveId,label:Ro,variant:ie.Primary,size:ae.S,onClick:a}]}})},Vd=e=>{switch(e.formType){case Il.Create:return t(Pl,{formType:Il.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Ld,{...e})});case Il.View:return t(Pl,{formType:Il.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(_d,{...e})});case Il.EditAutoNoisy:return t(Pl,{formType:Il.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(zd,{...e})});case Il.EditAutoCostReduction:return t(Pl,{formType:Il.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Md,{...e})});case Il.EditAutoHighlyRelevant:return t(Pl,{formType:Il.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Bd,{...e})})}},Ud=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=oo(),g=!i||a||!c.newToken;return Fo({key:"Enter",active:!g},s),e(oe,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(pe,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(oe,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(at,{title:"Saving...",withGradient:!0}):e(o,{children:[t(ne,{variant:ie.Secondary,size:ae.S,leftIcon:Si,onClick:r,disabled:a}),t(ne,{variant:ie.Primary,size:ae.S,leftIcon:Ci,onClick:s,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(Q,{size:te.XS,children:new Array(55).fill("•").join("")}),e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(ot,{icon:pi,onClick:l})]})]})},Hd=({expiresAt:e,callbackValid:o,callbackExpired:i})=>{const{formatTimeAgo:l}=Lt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Lo(e,0)?we.Error:Lo(e,2592e6)?we.Warning:we.Success,[e]),d=a(()=>c===we.Success?Ci:c===we.Warning?Ui:Ai,[c]);return n(()=>{c===we.Success?o():c===we.Error&&i()},[c]),t(Ie,{text:s,children:t(Fe,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},jd=m.div`
381
+ `,_d=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Fd,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(Q,{size:te.XS,weight:500,color:n,children:So}),t(ii,{size:16,fill:n})]})};function zd(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(_d,{onClick:l}),r&&t(Se,{status:we.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Ld,{}),t(ne,{"data-id":"sampling-view-edit-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:a}),t(ne,{"data-id":"sampling-view-edit-btn-save",label:yo,variant:ie.Primary,size:ae.S,onClick:i,disabled:!!r})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(_d,{onClick:a}),t(Ld,{}),t(ne,{"data-id":"sampling-view-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:i}),t(ne,{"data-id":"sampling-view-btn-edit",label:Co,variant:ie.Primary,size:ae.S,onClick:l})]})}}const Bd={[Al.EditAutoNoisy]:{title:Do,subTitle:Oo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Al.EditAutoCostReduction]:{title:Ao,subTitle:No,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Al.EditAutoHighlyRelevant]:{title:Io,subTitle:Eo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Md=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(q,{isOpen:e,width:Po,header:{icon:Hi,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(wt,{$padding:"12px",children:t(Wr,{})})}),Xd=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:r})=>{const{category:s,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=Nl(Al.Create);n(()=>{e&&d()},[e]);const h=l(()=>{if(i){const e=i(c);if(e)return void p(e)}a(c)},[c,a,i,p]),g={note:u?{status:we.Warning,message:u.message,action:r?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>r(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:To,variant:ie.Primary,size:ae.S,onClick:h,disabled:!!u}]};return t(Md,{isOpen:e,title:$o[s],subTitle:wo[s],onClose:o,footer:g})},Vd=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:i,onNavigateToDuplicate:r})=>{const{data:s,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:g}=Nl(Al.View),m=s?.rule.name||ko,f=c&&s?xo[s.category]:`${m} preview`,b=l(()=>{if(s&&c){if(i){const e=i(d);if(e)return void g(e)}n(d,s.rule.ruleId,s.samplingId)}},[s,c,d,n,i,g]),v=l(()=>{s&&o(s.rule.ruleId,s.samplingId)},[s,o]),y=a(()=>{if(!s)return;const t=h?{message:h.message,onViewRule:r?()=>r(h.ruleId):void 0}:null;return zd(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[s,c,h,p,b,v,u,e,r]);return t(Md,{isOpen:!!s,title:f,subTitle:s?wo[s.category]:"",onClose:e,footer:y})},Ud=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Nl(Al.EditAutoNoisy),r=l(()=>n(a,i),[n,a,i]);return t(jd,{formType:Al.EditAutoNoisy,isOpen:e,onClose:o,onSave:r})},Hd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Nl(Al.EditAutoCostReduction),r=l(()=>n(a,i),[n,a,i]);return t(jd,{formType:Al.EditAutoCostReduction,isOpen:e,onClose:o,onSave:r})},Gd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=Nl(Al.EditAutoHighlyRelevant),i=l(()=>n(a),[n,a]);return t(jd,{formType:Al.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},jd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=Bd[e];return t(Md,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:vo,variant:ie.Secondary,size:ae.S,onClick:n},{"data-id":i.saveId,label:Ro,variant:ie.Primary,size:ae.S,onClick:a}]}})},Wd=e=>{switch(e.formType){case Al.Create:return t(Ll,{formType:Al.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Xd,{...e})});case Al.View:return t(Ll,{formType:Al.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Vd,{...e})});case Al.EditAutoNoisy:return t(Ll,{formType:Al.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Ud,{...e})});case Al.EditAutoCostReduction:return t(Ll,{formType:Al.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Hd,{...e})});case Al.EditAutoHighlyRelevant:return t(Ll,{formType:Al.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Gd,{...e})})}},Kd=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=ao(),g=!i||a||!c.newToken;return Fo({key:"Enter",active:!g},s),e(oe,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(pe,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(oe,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(at,{title:"Saving...",withGradient:!0}):e(o,{children:[t(ne,{variant:ie.Secondary,size:ae.S,leftIcon:Si,onClick:r,disabled:a}),t(ne,{variant:ie.Primary,size:ae.S,leftIcon:Ci,onClick:s,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(Q,{size:te.XS,children:new Array(55).fill("•").join("")}),e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(ot,{icon:pi,onClick:l})]})]})},Yd=({expiresAt:e,callbackValid:o,callbackExpired:i})=>{const{formatTimeAgo:l}=Lt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Lo(e,0)?we.Error:Lo(e,2592e6)?we.Warning:we.Success,[e]),d=a(()=>c===we.Success?Ci:c===we.Warning?Gi:Ai,[c]);return n(()=>{c===we.Success?o():c===we.Error&&i()},[c]),t(Ie,{text:s,children:t(Fe,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},Jd=m.div`
371
382
  display: flex;
372
383
  flex-direction: column;
373
384
  gap: 12px;
@@ -375,7 +386,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
375
386
  border-radius: 12px;
376
387
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
377
388
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
378
- `,Gd=({children:e})=>{const o=f();return t(Q,{size:te.XXXS,color:o.v2.colors.grey[150],children:e})},Wd=({token:o,updateToken:n})=>{const[a,i]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:g,resetFormData:m}=$t({newToken:""});return t(Ye,{richTitle:{icon:Hi,title:"Odigos Pro Token"},children:e(jd,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(V,{$gap:4,children:[t(Gd,{children:"Issued for"}),t(Q,{size:te.XS,children:o.name||"N/A"})]}),e(V,{$gap:4,children:[t(Gd,{children:"Expiration"}),t(Hd,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(V,{})]}),t(oe,{children:e(V,{children:[t(Gd,{children:"Token"}),t(Ud,{token:o.token,newToken:u.newToken,isLoading:l,isEditing:a,onEdit:()=>i(!0),onCancel:()=>(i(!1),s(!1),void p("newToken","")),onSave:()=>(async()=>{s(!0);const e=await n(u.newToken.trim());s(!1),e?.error?g("newToken",e.error):(i(!1),m())})(),formData:u,handleFormChange:p,handleErrorChange:g,formErrors:h})]})})]})})},Kd=m.div`
389
+ `,qd=({children:e})=>{const o=f();return t(Q,{size:te.XXXS,color:o.v2.colors.grey[150],children:e})},Zd=({token:o,updateToken:n})=>{const[a,i]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:g,resetFormData:m}=$t({newToken:""});return t(Ye,{richTitle:{icon:ji,title:"Odigos Pro Token"},children:e(Jd,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(V,{$gap:4,children:[t(qd,{children:"Issued for"}),t(Q,{size:te.XS,children:o.name||"N/A"})]}),e(V,{$gap:4,children:[t(qd,{children:"Expiration"}),t(Yd,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(V,{})]}),t(oe,{children:e(V,{children:[t(qd,{children:"Token"}),t(Kd,{token:o.token,newToken:u.newToken,isLoading:l,isEditing:a,onEdit:()=>i(!0),onCancel:()=>(i(!1),s(!1),void p("newToken","")),onSave:()=>(async()=>{s(!0);const e=await n(u.newToken.trim());s(!1),e?.error?g("newToken",e.error):(i(!1),m())})(),formData:u,handleFormChange:p,handleErrorChange:g,formErrors:h})]})})]})})},Qd=m.div`
379
390
  display: flex;
380
391
  flex-direction: column;
381
392
  align-items: center;
@@ -384,23 +395,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
384
395
  padding: 12px 24px;
385
396
  border-radius: 8px;
386
397
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
387
- `,Yd=({downloadDiagnose:o})=>{const{progress:n}=ft(),{namespaces:a}=ct(),[i,l]=r(null),{formData:s,handleFormChange:c,resetFormData:d}=$t({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ye,{richTitle:{icon:ji,title:"Diagnose"},children:i?e(Kd,{children:[t(at,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[bt.DownloadingDiagnose]?.percentage,percentage:n[bt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[bt.DownloadingDiagnose]?.percentage,visualIcon:Bi,startedAt:i}),n[bt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[bt.DownloadingDiagnose].list.map(o=>e(oe,{$gap:4,$alignItems:"center",children:[o.status===we.Success?t(Ci,{size:16}):o.status===we.Error?t(Si,{size:16}):t(at,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(Q,{size:te.XXXS,color:ee.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(Q,{size:te.XXS,color:ee.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(V,{$gap:16,children:[e(oe,{$gap:8,children:[t(H,{label:"Profiles",value:s.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(H,{label:"Metrics",value:s.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(H,{label:"Source Workloads",value:s.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(_o,{alignX:Mo.Left,alignY:zo.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:s.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(s.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:ie.Secondary,disabled:s.includeSourceWorkloads,leftIcon:s.sourceWorkloadNamespaces.length?()=>t(Fe,{label:s.sourceWorkloadNamespaces.length,status:we.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(ne,{label:"Download Diagnose",rightIcon:Bi,variant:ie.Primary,onClick:async()=>{l(Date.now()),await o(s),l(null),d()},disabled:null!==i})})]})})},Jd=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[l,s]=r(null);return n(()=>{e().then(({data:e})=>s(e?.describeOdigos||null))},[]),t(Ye,{richTitle:{icon:Gi,title:"General Information"},children:t(xt,{cellsPerRow:2,items:[{id:Bo(),title:"Odigos Version",label:a},{id:Bo(),title:`${o.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Bo(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Bo(),title:"Tier",label:i}]})})},qd=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:r})=>e(q,{isOpen:o,header:{icon:Gi,title:"System Overview",onClose:n},children:[l&&t(Jd,{fetchDescribeOdigos:l}),i&&a&&t(Wd,{token:a,updateToken:i}),r&&t(Yd,{downloadDiagnose:r})]}),Zd=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:r})=>{const{addDataStreams:s,setSelectedStreamName:c}=Be(),{requestSubmit:d}=Tl(),u=l(async e=>{r?await r(e):(s([e]),c(e.name)),a()},[r,s,c,a]),p=l(()=>d(u),[d,u]);return Fo({key:"Enter",active:n},p),e(o,{children:[t(ze,{isOpen:n,onClose:a,onCloseEnd:i,title:Me.NAME_YOUR_STREAM,description:Me.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:St.DONE,variant:ie.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:a},children:t(zr,{autoFocus:!0})}),t(_r,{})]})},Qd=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s,updateDataStream:c})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=Tl();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,g=l(async e=>{await c(s,e),i()},[c,s,i]),m=l(()=>p(g),[p,g]);return Fo({key:"Enter",active:a},m),e(o,{children:[t(ze,{isOpen:a,onClose:i,onCloseEnd:r,title:Me.RENAME_STREAM(s),description:Me.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:St.SAVE,variant:ie.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:i},children:t(zr,{autoFocus:!0})}),t(_r,{})]})},eu=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),tu=m.div`
398
+ `,eu=({downloadDiagnose:o})=>{const{progress:n}=ft(),{namespaces:a}=ct(),[i,l]=r(null),{formData:s,handleFormChange:c,resetFormData:d}=$t({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ye,{richTitle:{icon:Wi,title:"Diagnose"},children:i?e(Qd,{children:[t(at,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[bt.DownloadingDiagnose]?.percentage,percentage:n[bt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[bt.DownloadingDiagnose]?.percentage,visualIcon:Xi,startedAt:i}),n[bt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[bt.DownloadingDiagnose].list.map(o=>e(oe,{$gap:4,$alignItems:"center",children:[o.status===we.Success?t(Ci,{size:16}):o.status===we.Error?t(Si,{size:16}):t(at,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(Q,{size:te.XXXS,color:ee.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(Q,{size:te.XXS,color:ee.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(V,{$gap:16,children:[e(oe,{$gap:8,children:[t(H,{label:"Profiles",value:s.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(H,{label:"Metrics",value:s.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(H,{label:"Source Workloads",value:s.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(_o,{alignX:Bo.Left,alignY:zo.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:s.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(s.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:ie.Secondary,disabled:s.includeSourceWorkloads,leftIcon:s.sourceWorkloadNamespaces.length?()=>t(Fe,{label:s.sourceWorkloadNamespaces.length,status:we.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(ne,{label:"Download Diagnose",rightIcon:Xi,variant:ie.Primary,onClick:async()=>{l(Date.now()),await o(s),l(null),d()},disabled:null!==i})})]})})},tu=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[l,s]=r(null);return n(()=>{e().then(({data:e})=>s(e?.describeOdigos||null))},[]),t(Ye,{richTitle:{icon:Fi,title:"General Information"},children:t(xt,{cellsPerRow:2,items:[{id:Mo(),title:"Odigos Version",label:a},{id:Mo(),title:`${o.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Mo(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Mo(),title:"Tier",label:i}]})})},ou=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:r})=>e(q,{isOpen:o,header:{icon:Fi,title:"System Overview",onClose:n},children:[l&&t(tu,{fetchDescribeOdigos:l}),i&&a&&t(Zd,{token:a,updateToken:i}),r&&t(eu,{downloadDiagnose:r})]}),nu=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:r})=>{const{addDataStreams:s,setSelectedStreamName:c}=Me(),{requestSubmit:d}=El(),u=l(async e=>{r?await r(e):(s([e]),c(e.name)),a()},[r,s,c,a]),p=l(()=>d(u),[d,u]);return Fo({key:"Enter",active:n},p),e(o,{children:[t(ze,{isOpen:n,onClose:a,onCloseEnd:i,title:Be.NAME_YOUR_STREAM,description:Be.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:St.DONE,variant:ie.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:a},children:t(Mr,{autoFocus:!0})}),t(Br,{})]})},au=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s,updateDataStream:c})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=El();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,g=l(async e=>{await c(s,e),i()},[c,s,i]),m=l(()=>p(g),[p,g]);return Fo({key:"Enter",active:a},m),e(o,{children:[t(ze,{isOpen:a,onClose:i,onCloseEnd:r,title:Be.RENAME_STREAM(s),description:Be.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:St.SAVE,variant:ie.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:i},children:t(Mr,{autoFocus:!0})}),t(Br,{})]})},iu=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),lu=m.div`
388
399
  position: absolute;
389
400
  top: 50%;
390
401
  left: 50%;
391
402
  transform: translate(-50%, -50%);
392
403
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
393
- `,ou="onboarding-done",nu=()=>{const{currentModal:o,setCurrentModal:n}=Xo(),a=()=>n("");return e(Vo,{isOpen:o===ou,onClose:a,children:[t(eu,{}),t(tu,{children:e(V,{$gap:32,$alignItems:"center",children:[e(V,{$gap:24,$alignItems:"center",children:[t(Q,{size:te.L,weight:500,children:"Welcome to"}),t(yl,{size:260}),t(Q,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(ne,{label:"Get Started",rightIcon:ri,onClick:a})]})})]})},au=m.div`
404
+ `,ru="onboarding-done",su=()=>{const{currentModal:o,setCurrentModal:n}=Xo(),a=()=>n("");return e(Vo,{isOpen:o===ru,onClose:a,children:[t(iu,{}),t(lu,{children:e(V,{$gap:32,$alignItems:"center",children:[e(V,{$gap:24,$alignItems:"center",children:[t(Q,{size:te.L,weight:500,children:"Welcome to"}),t(Sl,{size:260}),t(Q,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(ne,{label:"Get Started",rightIcon:ri,onClick:a})]})})]})},cu=m.div`
394
405
  display: flex;
395
406
  flex-direction: column;
396
407
  gap: 8px;
397
408
  padding: 4px 8px;
398
409
  border-radius: 8px;
399
410
  width: calc(100% - 16px);
400
- `,iu=m.div`
411
+ `,du=m.div`
401
412
  white-space: pre;
402
413
  overflow-x: auto;
403
- `,lu=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:r,toggleName:s})=>{const c=f();return e(au,{children:[e(oe,{$gap:8,$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(Q,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Fe,{label:Uo,leftIcon:Wi,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(K,{name:s??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:Y.Left,value:i,onChange:l,size:gt.S})]}),t(iu,{children:t(S,{parts:r})})]})},ru=m.div`
414
+ `,uu=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:r,toggleName:s})=>{const c=f();return e(cu,{children:[e(oe,{$gap:8,$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(Q,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Fe,{label:Uo,leftIcon:Ki,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(K,{name:s??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:Y.Left,value:i,onChange:l,size:gt.S})]}),t(du,{children:t(S,{parts:r})})]})},pu=m.div`
404
415
  position: relative;
405
416
  display: flex;
406
417
  align-items: center;
@@ -410,18 +421,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
410
421
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
411
422
  border-top-left-radius: 18px;
412
423
  border-top-right-radius: 18px;
413
- `,su=m.div`
424
+ `,hu=m.div`
414
425
  position: absolute;
415
426
  left: 16px;
416
427
  top: 50%;
417
428
  transform: translateY(-50%);
418
- `,cu=m.div`
429
+ `,gu=m.div`
419
430
  height: 16px;
420
431
  width: 100%;
421
432
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
422
433
  border-top-left-radius: 18px;
423
434
  border-top-right-radius: 18px;
424
- `,du=m.div`
435
+ `,mu=m.div`
425
436
  width: ${({$width:e})=>e}px;
426
437
  display: flex;
427
438
  flex-direction: column;
@@ -429,7 +440,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
429
440
  gap: 22px;
430
441
  padding: 8px 32px 32px 32px;
431
442
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
432
- `,uu=e=>t(Ki,{rotate:90,...e}),pu=({children:o,center:n,onNext:a,nextLabel:i=Ho,nextLoading:l})=>e(oe,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(ne,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:uu,variant:ie.Primary,size:ae.M,onClick:a,loading:l})]}),hu=e=>t(Ki,{rotate:-90,...e}),gu=({title:o,onBack:n})=>{const a=f();return e(ru,{$hasBack:!!n,children:[n&&t(su,{children:t(ot,{"data-id":"sampling-onboarding-back",icon:hu,size:nt.M,onClick:n})}),t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},mu=m.div`
443
+ `,fu=e=>t(Yi,{rotate:90,...e}),bu=({children:o,center:n,onNext:a,nextLabel:i=Ho,nextLoading:l})=>e(oe,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(ne,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:fu,variant:ie.Primary,size:ae.M,onClick:a,loading:l})]}),vu=e=>t(Yi,{rotate:-90,...e}),yu=({title:o,onBack:n})=>{const a=f();return e(pu,{$hasBack:!!n,children:[n&&t(hu,{children:t(ot,{"data-id":"sampling-onboarding-back",icon:vu,size:nt.M,onClick:n})}),t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},Cu=m.div`
433
444
  box-sizing: border-box;
434
445
  width: ${({$width:e})=>e??"100%"};
435
446
  ${({$fillHeight:e})=>e&&b`
@@ -442,16 +453,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
442
453
  padding: 16px;
443
454
  border-radius: 16px;
444
455
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
445
- `,fu=({children:e,fillHeight:o,width:n})=>t(mu,{$fillHeight:o,$width:n,children:e}),bu=m.ul`
456
+ `,Su=({children:e,fillHeight:o,width:n})=>t(Cu,{$fillHeight:o,$width:n,children:e}),wu=m.ul`
446
457
  margin: 0;
447
458
  padding: 0;
448
459
  list-style: disc;
449
- `,vu=m.li`
460
+ `,xu=m.li`
450
461
  margin-left: 18px;
451
462
  & + & {
452
463
  margin-top: 6px;
453
464
  }
454
- `,yu=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(bu,{children:e.map((e,o)=>t(vu,{style:{color:a},children:t(Q,{size:te.XXS,color:a,children:e})},o))})},Cu=({items:o})=>{const n=f();return t(V,{$gap:16,children:o.map((o,a)=>e(oe,{$gap:8,$alignItems:"flex-start",children:[e(Q,{size:te.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(V,{$gap:2,children:[t(Q,{size:te.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(Q,{size:te.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},Su=({message:e})=>t(Se,{status:we.Default,message:e,fullWidth:!0,smallIcon:!0}),wu=m.div`
465
+ `,ku=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(wu,{children:e.map((e,o)=>t(xu,{style:{color:a},children:t(Q,{size:te.XXS,color:a,children:e})},o))})},Tu=({items:o})=>{const n=f();return t(V,{$gap:16,children:o.map((o,a)=>e(oe,{$gap:8,$alignItems:"flex-start",children:[e(Q,{size:te.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(V,{$gap:2,children:[t(Q,{size:te.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(Q,{size:te.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},$u=({message:e})=>t(Se,{status:we.Default,message:e,fullWidth:!0,smallIcon:!0}),Eu=m.div`
455
466
  width: calc(100% - 16px);
456
467
  padding: 8px;
457
468
  display: flex;
@@ -459,12 +470,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
459
470
  gap: 4px;
460
471
  border-radius: 16px;
461
472
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
462
- `,xu=m.div`
473
+ `,Iu=m.div`
463
474
  display: flex;
464
475
  align-items: center;
465
476
  gap: 8px;
466
477
  padding: 4px 8px 12px 8px;
467
- `,ku=m.div`
478
+ `,Nu=m.div`
468
479
  width: calc(100% - 16px);
469
480
  display: flex;
470
481
  flex-direction: column;
@@ -472,20 +483,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
472
483
  padding: 8px;
473
484
  border-radius: 12px;
474
485
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
475
- `,Tu=({children:e})=>{const o=f();return t(Q,{size:te.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},$u=m.div`
486
+ `,Au=({children:e})=>{const o=f();return t(Q,{size:te.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Ou=m.div`
476
487
  white-space: pre-line;
477
- `,Eu=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=f(),c=a(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(gu,{title:jo,onBack:l}),e(du,{$width:854,children:[t(Tu,{children:Go}),e(V,{$gap:8,$width:"100%",children:[t(fu,{children:t($u,{children:t(Q,{size:te.XXS,color:s.v2.colors.silver[200],children:Wo})})}),e(V,{$gap:8,$width:"100%",children:[e(wu,{children:[t(xu,{children:t(Q,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Ko})}),t(ku,{children:t(lu,{name:Jo,recommended:!0,toggleLabel:Yo,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Su,{message:qo})]})]})]}),t(pu,{onNext:r})]})},Iu=e=>t(Ki,{rotate:90,...e}),Nu=({onClose:n})=>{const a=f();return e(o,{children:[t(cu,{}),e(du,{$width:732,children:[t(Zo,{icon:Vi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Qo}),en.split("\n").map(e=>t(Tu,{children:e},e)),e(fu,{children:[t(Q,{size:te.XS,color:a.v2.colors.silver[200],children:tn}),t(yu,{color:a.v2.colors.white[500],items:[on,nn,an]})]})]})]}),t(pu,{center:!0,children:t(ne,{"data-id":"sampling-onboarding-btn-go-to",label:ln,rightIcon:Iu,variant:ie.Primary,size:ae.M,onClick:n})})]})},Au=e=>t(Ki,{rotate:90,...e}),Ou=m.div`
488
+ `,Du=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=f(),c=a(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(yu,{title:Go,onBack:l}),e(mu,{$width:854,children:[t(Au,{children:jo}),e(V,{$gap:8,$width:"100%",children:[t(Su,{children:t(Ou,{children:t(Q,{size:te.XXS,color:s.v2.colors.silver[200],children:Wo})})}),e(V,{$gap:8,$width:"100%",children:[e(Eu,{children:[t(Iu,{children:t(Q,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Ko})}),t(Nu,{children:t(uu,{name:Jo,recommended:!0,toggleLabel:Yo,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t($u,{message:qo})]})]})]}),t(bu,{onNext:r})]})},Ru=e=>t(Yi,{rotate:90,...e}),Pu=({onClose:n})=>{const a=f();return e(o,{children:[t(gu,{}),e(mu,{$width:732,children:[t(Zo,{icon:Hi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Qo}),en.split("\n").map(e=>t(Au,{children:e},e)),e(Su,{children:[t(Q,{size:te.XS,color:a.v2.colors.silver[200],children:tn}),t(ku,{color:a.v2.colors.white[500],items:[on,nn,an]})]})]})]}),t(bu,{center:!0,children:t(ne,{"data-id":"sampling-onboarding-btn-go-to",label:ln,rightIcon:Ru,variant:ie.Primary,size:ae.M,onClick:n})})]})},Fu=e=>t(Yi,{rotate:90,...e}),Lu=m.div`
478
489
  display: flex;
479
490
  flex-direction: column;
480
491
  align-items: center;
481
492
  gap: 8px;
482
493
  width: 100%;
483
- `,Du=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(cu,{}),e(du,{$width:732,children:[t(Zo,{icon:Vi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Ou,{children:[t(Q,{size:te.M,weight:500,color:i.v2.colors.white[500],children:rn}),t(Tu,{children:sn})]}),e(fu,{children:[t(Q,{size:te.XS,color:i.v2.colors.silver[200],children:cn}),t(Cu,{items:[{title:un,description:dn},{title:hn,description:pn},{title:mn,description:gn}]}),t(Su,{message:fn})]})]})]}),e(pu,{center:!0,children:[t(ne,{"data-id":"sampling-onboarding-btn-skip",label:bn,variant:ie.Secondary,onClick:n}),t(ne,{"data-id":"sampling-onboarding-btn-start",label:vn,rightIcon:Au,variant:ie.Primary,onClick:a})]})]})},Ru=m.div`
494
+ `,_u=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(gu,{}),e(mu,{$width:732,children:[t(Zo,{icon:Hi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Lu,{children:[t(Q,{size:te.M,weight:500,color:i.v2.colors.white[500],children:rn}),t(Au,{children:sn})]}),e(Su,{children:[t(Q,{size:te.XS,color:i.v2.colors.silver[200],children:cn}),t(Tu,{items:[{title:un,description:dn},{title:hn,description:pn},{title:mn,description:gn}]}),t($u,{message:fn})]})]})]}),e(bu,{center:!0,children:[t(ne,{"data-id":"sampling-onboarding-btn-skip",label:bn,variant:ie.Secondary,onClick:n}),t(ne,{"data-id":"sampling-onboarding-btn-start",label:vn,rightIcon:Fu,variant:ie.Primary,onClick:a})]})]})},zu=m.div`
484
495
  display: flex;
485
496
  align-items: stretch;
486
497
  gap: 16px;
487
498
  width: 100%;
488
- `,Pu=m.div`
499
+ `,Bu=m.div`
489
500
  flex: 1;
490
501
  display: flex;
491
502
  flex-direction: column;
@@ -505,18 +516,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
505
516
  background-color: ${t.v2.colors.silver[700]};
506
517
  }
507
518
  `}
508
- `,Fu=m.div`
519
+ `,Mu=m.div`
509
520
  display: flex;
510
521
  align-items: center;
511
522
  gap: 8px;
512
523
  padding: 12px 16px;
513
- `,Lu=m.div`
524
+ `,Xu=m.div`
514
525
  flex: 1;
515
526
  padding: 8px;
516
527
  display: flex;
517
528
  flex-direction: column;
518
529
  gap: 8px;
519
- `,_u=m.div`
530
+ `,Vu=m.div`
520
531
  flex: 1;
521
532
  display: flex;
522
533
  flex-direction: column;
@@ -524,17 +535,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
524
535
  padding: 12px;
525
536
  border-radius: 12px;
526
537
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
527
- `,zu=m.div`
538
+ `,Uu=m.div`
528
539
  display: flex;
529
540
  justify-content: flex-end;
530
- `,Mu=m.div`
541
+ `,Hu=m.div`
531
542
  display: flex;
532
543
  align-items: center;
533
544
  gap: 8px;
534
545
  padding: 4px 12px 4px 4px;
535
546
  border-radius: 8px;
536
547
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
537
- `,Bu=m.div`
548
+ `,Gu=m.div`
538
549
  display: flex;
539
550
  align-items: center;
540
551
  justify-content: center;
@@ -542,13 +553,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
542
553
  height: 24px;
543
554
  border-radius: 6px;
544
555
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
545
- `,Xu=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Pu,{$selected:o,onClick:n,children:[e(Fu,{children:[t(ce,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:ue.L}),t(Vi,{size:24,fill:d.v2.colors.white[500]}),t(Q,{size:te.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Lu,{children:[e(_u,{$selected:o,children:[e(V,{$gap:8,children:[t(Fe,{...l,textSize:te.XXXS}),t(Q,{size:te.XXS,color:u,children:i})]}),r&&r.length>0&&t(yu,{color:u,items:r}),s&&e(Mu,{children:[t(Bu,{children:t(Ui,{size:18,fill:d.v2.colors.yellow[500]})}),t(Q,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(zu,{children:t(ne,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:Fn,rightIcon:di,variant:ie.Text,size:ae.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Vu=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:r})=>{const s=f(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(gu,{title:yn,onBack:i}),e(du,{$width:854,children:[t(Tu,{children:Cn}),e(Ru,{children:[t(Xu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:$n,description:Tn,badgeProps:{label:kn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[wn,xn],warning:Sn,onReadMore:c}),t(Xu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:On,description:An,badgeProps:{label:Nn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[En,In],onReadMore:c}),t(Xu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:Pn,description:Rn,badgeProps:{label:Dn,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(pu,{onNext:l})]})},Uu=({onBack:n,onNext:i,submitting:l})=>{const r=f(),s=a(()=>[{title:Mn,bullets:[Ln,_n,zn]},{title:jn,bullets:[Bn,Xn,Vn,Un,Hn]}],[]);return e(o,{children:[t(gu,{title:Gn,onBack:n}),e(du,{$width:854,children:[t(Tu,{children:Wn}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(fu,{fillHeight:!0,width:"50%",children:[t(Q,{size:te.XS,color:r.v2.colors.white[500],children:o.title}),t(yu,{items:o.bullets})]},n))}),t(Su,{message:Kn})]}),t(pu,{onNext:i,nextLoading:l})]})},Hu=m.div`
556
+ `,ju=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Bu,{$selected:o,onClick:n,children:[e(Mu,{children:[t(ce,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:ue.L}),t(Hi,{size:24,fill:d.v2.colors.white[500]}),t(Q,{size:te.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Xu,{children:[e(Vu,{$selected:o,children:[e(V,{$gap:8,children:[t(Fe,{...l,textSize:te.XXXS}),t(Q,{size:te.XXS,color:u,children:i})]}),r&&r.length>0&&t(ku,{color:u,items:r}),s&&e(Hu,{children:[t(Gu,{children:t(Gi,{size:18,fill:d.v2.colors.yellow[500]})}),t(Q,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Uu,{children:t(ne,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:Fn,rightIcon:di,variant:ie.Text,size:ae.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Wu=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:r})=>{const s=f(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(yu,{title:yn,onBack:i}),e(mu,{$width:854,children:[t(Au,{children:Cn}),e(zu,{children:[t(ju,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:$n,description:Tn,badgeProps:{label:kn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[wn,xn],warning:Sn,onReadMore:c}),t(ju,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:On,description:An,badgeProps:{label:Nn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[En,In],onReadMore:c}),t(ju,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:Pn,description:Rn,badgeProps:{label:Dn,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(bu,{onNext:l})]})},Ku=({onBack:n,onNext:i,submitting:l})=>{const r=f(),s=a(()=>[{title:Bn,bullets:[Ln,_n,zn]},{title:Gn,bullets:[Mn,Xn,Vn,Un,Hn]}],[]);return e(o,{children:[t(yu,{title:jn,onBack:n}),e(mu,{$width:854,children:[t(Au,{children:Wn}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Su,{fillHeight:!0,width:"50%",children:[t(Q,{size:te.XS,color:r.v2.colors.white[500],children:o.title}),t(ku,{items:o.bullets})]},n))}),t($u,{message:Kn})]}),t(bu,{onNext:i,nextLoading:l})]})},Yu=m.div`
546
557
  white-space: pre-line;
547
- `,ju=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=f(),d=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(gu,{title:Yn,onBack:l}),e(du,{$width:854,children:[t(Tu,{children:Jn}),e(V,{$gap:8,$width:"100%",children:[e(fu,{children:[t(Hu,{children:t(Q,{size:te.XXS,color:c.v2.colors.silver[200],children:qn})}),t(Su,{message:Kn})]}),e(wu,{children:[e(xu,{children:[t(Q,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Zn}),t(Oi,{size:16,fill:c.v2.colors.silver[200]})]}),t(ku,{children:t(lu,{name:ea,recommended:!0,toggleLabel:Qn,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(pu,{onNext:r,nextLoading:s})]})},Gu=m.div`
558
+ `,Ju=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=f(),d=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(yu,{title:Yn,onBack:l}),e(mu,{$width:854,children:[t(Au,{children:Jn}),e(V,{$gap:8,$width:"100%",children:[e(Su,{children:[t(Yu,{children:t(Q,{size:te.XXS,color:c.v2.colors.silver[200],children:qn})}),t($u,{message:Kn})]}),e(Eu,{children:[e(Iu,{children:[t(Q,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Zn}),t(Oi,{size:16,fill:c.v2.colors.silver[200]})]}),t(Nu,{children:t(uu,{name:ea,recommended:!0,toggleLabel:Qn,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(bu,{onNext:r,nextLoading:s})]})},qu=m.div`
548
559
  white-space: pre-line;
549
- `,Wu=m.div`
560
+ `,Zu=m.div`
550
561
  width: fit-content;
551
- `,Ku=["50","25","10","1","0.1"],Yu=({value:o,onChange:n,label:i})=>{const l=f(),r=a(()=>Ku.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(V,{$gap:8,children:[t(Q,{size:te.XS,color:l.v2.colors.white[500],children:i}),t(Wu,{children:t(le,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},Ju=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(gu,{title:ta,onBack:s}),e(du,{$width:854,children:[t(Tu,{children:oa}),e(V,{$gap:8,$width:"100%",children:[e(fu,{children:[t(Gu,{children:t(Q,{size:te.XXS,color:u.v2.colors.silver[200],children:na})}),t(yu,{items:[aa,ia,la,ra,sa]}),t(Su,{message:Kn})]}),e(wu,{children:[e(xu,{children:[t(Q,{size:te.S,weight:500,color:u.v2.colors.white[500],children:ca}),t(Oi,{size:16,fill:u.v2.colors.silver[200]})]}),t(ku,{children:t(lu,{name:ea,recommended:!0,toggleLabel:Qn,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(ku,{children:t(Yu,{value:l,onChange:r,label:da})})]})]})]}),t(pu,{onNext:c,nextLoading:d})]})},qu=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:c,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=r("welcome"),[g,m]=r(!0),[f,b]=r("keep-list"),[v,y]=r(!0),[C,S]=r("25"),[w,x]=r(!1);n(()=>{e&&(h("welcome"),m(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const k=l(async()=>{const e=i??"default",t=[];g!==(a?.enabled??!1)&&t.push(c(g,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,c,g,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let T=null;switch(p){case"welcome":T=t(Du,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":T=t(Eu,{enabled:g,onEnabledChange:m,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(Vu,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(Ju,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"drop-list":T=t(ju,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"advanced":T=t(Uu,{onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"success":T=t(Nu,{onClose:o})}return t(Vo,{isOpen:e,onClose:o,children:T})};var Zu,Qu;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Zu||(Zu={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Qu||(Qu={}));const ep=[{key:Qu.Name,label:"Name"},{key:Qu.Type,label:"Type",textAlign:"right"},{key:Qu.Status,label:"Status"},{key:Qu.OdigosVersion,label:"Odigos Version"},{key:Qu.ConnectedSince,label:"Connected Since"},{key:Qu.LastActivity,label:"Last Activity"}],tp=(e,t)=>{const o=e.find(e=>e.key===Qu.Id)?.rawValue;return t(o?.toString()||"")},op=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Qu.Status)?.rawValue===we.Success)(e))return[{id:Bo(),label:"Delete Connection",rightIcon:ui,onClick:()=>tp(e,a)}];const d=tp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&k(n.odigosVersion,o)}),u=tp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&k(o.odigosVersion,n)}),p=[];return i&&p.push({id:Bo(),tooltip:u?Me.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:xi,disabled:!u,onClick:()=>tp(e,i)}),l&&p.push({id:Bo(),tooltip:Me.ADD_DESTINATION,rightIcon:bi,onClick:()=>tp(e,l)}),r&&p.push({id:Bo(),tooltip:Me.ADD_ACTION,rightIcon:fi,onClick:()=>tp(e,r)}),s&&p.push({id:Bo(),tooltip:Me.ADD_INSTRUMENTATION_RULE,rightIcon:wi,onClick:()=>tp(e,s)}),c&&p.push({id:Bo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ti,disabled:!d,onClick:()=>tp(e,c)}),p}},np=({tableRowsMaxHeight:o,connections:i,getConnections:s,onClickConnection:c,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:h,snapshotMinSupportedVersion:g=0,getAllClusterSnapshots:m,persistSources:b,getDestinationCategories:v,getPotentialDestinations:C,testConnection:S,createDestination:w,updateDestination:x,createAction:T,createInstrumentationRule:$})=>{const E=f(),{isVm:I}=y(),{formatTimeAgo:N}=Lt(),[A,O]=r(!1),[D,R]=r(i||[]),P=l(async()=>{try{O(!0),R(await s()??[])}catch(e){}finally{O(!1)}},[]);n(()=>{D.length||P()},[]);const[F,L]=r(""),[_,z]=r(null),[M,B]=r([]),X=a(()=>_===Zu.BulkConfig?u:_===Zu.BulkSource?g:0,[_,u,g]),{supportedConnections:V,supportedConnectionIds:U}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===we.Success,n=k(e.odigosVersion,t);return o&&n}))(D,X);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[D.length,X]);n(()=>{if(!_||_===Zu.Delete)return;const e=M.filter(e=>!U.includes(e));e.length&&B(t=>t.filter(t=>!e.includes(t)))},[_,M.length,U.length]);const H=a(()=>D.filter(e=>!F||e.name.toLowerCase().includes(F.toLowerCase())).map(e=>({cells:[{key:Qu.Id,rawValue:e.id},{key:Qu.Name,rawValue:e.name},{key:Qu.Type,rawValue:e.type},{key:Qu.Status,rawValue:e.status,component:()=>(e=>{const o=e===we.Success?"Connection live":"Connection lost",n=e===we.Success?Ci:Si;return t(Fe,{status:e,label:o,leftIcon:n})})(e.status)},{key:Qu.OdigosVersion,rawValue:e.odigosVersion},{key:Qu.ConnectedSince,rawValue:e.connectedAt?N(e.connectedAt):"-"},{key:Qu.LastActivity,rawValue:e.lastSeenAt?N(e.lastSeenAt):"-"}],onClick:e.status!==we.Success||_?void 0:()=>c(e),isSelected:M.includes(e.id),onSelect:()=>B(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>B(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==we.Success||_===Zu.BulkConfig&&!k(e.odigosVersion,u)||_===Zu.BulkSource&&!k(e.odigosVersion,g)})),[D,M,F,_,u,g]),j=a(()=>{const e=(e,t)=>{B([e]),z(t)};return op({connections:D,configMinSupportedVersion:u,snapshotMinSupportedVersion:g,onDelete:t=>e(t,Zu.Delete),onAddSource:!I&&m&&b?t=>e(t,Zu.BulkSource):void 0,onAddDestination:!I&&v&&C&&w?t=>e(t,Zu.BulkDestination):void 0,onAddAction:!I&&T?t=>e(t,Zu.BulkAction):void 0,onAddInstrumentationRule:!I&&$?t=>e(t,Zu.BulkInstrumentationRule):void 0,onEditConfiguration:!I&&p&&h?t=>e(t,Zu.BulkConfig):void 0})},[I,D,u,p,h,g,m,b,v,C,w,T,$]),G=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];o&&r.push({id:Bo(),type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:"Add Sources",rightIcon:xi,onClick:o}});const s=[n?{id:Zu.BulkDestination,label:Me.ADD_DESTINATION,icon:bi}:null,a?{id:Zu.BulkAction,label:Me.ADD_ACTION,icon:fi}:null,i?{id:Zu.BulkInstrumentationRule,label:Me.ADD_INSTRUMENTATION_RULE,icon:wi}:null,l?{id:Zu.BulkConfig,label:"Manage Configurations",icon:Ti}:null];return s.some(Boolean)&&r.push({id:Bo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"Bulk Operations",onClick:e=>{e===Zu.BulkSource?o?.():e===Zu.BulkDestination?n?.():e===Zu.BulkAction?a?.():e===Zu.BulkInstrumentationRule?i?.():e===Zu.BulkConfig&&l?.()}},dropDataProps:{alignX:Mo.Left,items:s}}),r.push({id:Bo(),type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:St.CANCEL,onClick:t}}),r})({onCancel:()=>B([]),onAddSource:!I&&m&&b?()=>z(Zu.BulkSource):void 0,onAddDestination:!I&&v&&C&&w?()=>z(Zu.BulkDestination):void 0,onAddAction:!I&&T?()=>z(Zu.BulkAction):void 0,onAddInstrumentationRule:!I&&$?()=>z(Zu.BulkInstrumentationRule):void 0,onManageConfigurations:!I&&p&&h?()=>z(Zu.BulkConfig):void 0}),[I,p,h,m,b,v,C,w,T,$]);return t(ua,{children:e(Ye,{richTitle:{icon:Yi,title:Me.CONNECTIONS,badge:{label:D.length.toString(),status:pt.Unknown}},search:{placeholder:"Search by cluster name",value:F,onChange:e=>L(e),width:"300px"},actions:[{id:Bo(),type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ni,onClick:P,disabled:A}}],children:[t(mo,{variant:fo.Pretty,maxHeight:o,headerBackgroundColor:E.v2.colors.silver[1e3],isLoading:A,withCheckboxes:!0,columns:ep,rows:H,rowActionsPushRightPosition:_?`calc(${Cl} - 24px)`:void 0,getRowActions:j}),_===Zu.BulkConfig&&p&&h&&t(Ds,{onClose:()=>z(null),connections:V,selectedConnectionIds:M,setSelectedConnectionIds:B,getEffectiveConfig:p,onApply:h}),_===Zu.BulkSource&&m&&b&&t(Fl,{selectedConnectionIds:M,children:t(Ns,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,getAllClusterSnapshots:m,persistSources:async e=>await(b?.(e))})}),_===Zu.BulkDestination&&v&&C&&S&&w&&x&&t(Ll,{children:t(ss,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,getDestinationCategories:v,getPotentialDestinations:C,testConnection:e=>S(e,M),createDestination:e=>w(e,M),updateDestination:(e,t)=>x(e,t,M)})}),_===Zu.BulkAction&&T&&t(_l,{children:t(Zr,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,createAction:e=>T(e,M)})}),_===Zu.BulkInstrumentationRule&&$&&t(zl,{children:t(cs,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,createInstrumentationRule:e=>$(e,M)})}),t(fl,{target:"connection",isOpen:_===Zu.Delete,onClose:()=>{B([]),z(null)},onApprove:async()=>{const e=M[0];e&&(await d(e),await P())}}),t(pa,{isOpen:!!M.length&&!_,richTitle:{icon:si,title:"Selected Clusters",badge:{label:M.length}},actions:G})]})})},ap=m.div`
562
+ `,Qu=["50","25","10","1","0.1"],ep=({value:o,onChange:n,label:i})=>{const l=f(),r=a(()=>Qu.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(V,{$gap:8,children:[t(Q,{size:te.XS,color:l.v2.colors.white[500],children:i}),t(Zu,{children:t(le,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},tp=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(yu,{title:ta,onBack:s}),e(mu,{$width:854,children:[t(Au,{children:oa}),e(V,{$gap:8,$width:"100%",children:[e(Su,{children:[t(qu,{children:t(Q,{size:te.XXS,color:u.v2.colors.silver[200],children:na})}),t(ku,{items:[aa,ia,la,ra,sa]}),t($u,{message:Kn})]}),e(Eu,{children:[e(Iu,{children:[t(Q,{size:te.S,weight:500,color:u.v2.colors.white[500],children:ca}),t(Oi,{size:16,fill:u.v2.colors.silver[200]})]}),t(Nu,{children:t(uu,{name:ea,recommended:!0,toggleLabel:Qn,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Nu,{children:t(ep,{value:l,onChange:r,label:da})})]})]})]}),t(bu,{onNext:c,nextLoading:d})]})},op=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:c,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=r("welcome"),[g,m]=r(!0),[f,b]=r("keep-list"),[v,y]=r(!0),[C,S]=r("25"),[w,x]=r(!1);n(()=>{e&&(h("welcome"),m(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const k=l(async()=>{const e=i??"default",t=[];g!==(a?.enabled??!1)&&t.push(c(g,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,c,g,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let T=null;switch(p){case"welcome":T=t(_u,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":T=t(Du,{enabled:g,onEnabledChange:m,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(Wu,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(tp,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"drop-list":T=t(Ju,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"advanced":T=t(Ku,{onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"success":T=t(Pu,{onClose:o})}return t(Vo,{isOpen:e,onClose:o,children:T})};var np,ap;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(np||(np={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(ap||(ap={}));const ip=[{key:ap.Name,label:"Name"},{key:ap.Type,label:"Type",textAlign:"right"},{key:ap.Status,label:"Status"},{key:ap.OdigosVersion,label:"Odigos Version"},{key:ap.ConnectedSince,label:"Connected Since"},{key:ap.LastActivity,label:"Last Activity"}],lp=(e,t)=>{const o=e.find(e=>e.key===ap.Id)?.rawValue;return t(o?.toString()||"")},rp=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===ap.Status)?.rawValue===we.Success)(e))return[{id:Mo(),label:"Delete Connection",rightIcon:ui,onClick:()=>lp(e,a)}];const d=lp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&k(n.odigosVersion,o)}),u=lp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&k(o.odigosVersion,n)}),p=[];return i&&p.push({id:Mo(),tooltip:u?Be.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:xi,disabled:!u,onClick:()=>lp(e,i)}),l&&p.push({id:Mo(),tooltip:Be.ADD_DESTINATION,rightIcon:bi,onClick:()=>lp(e,l)}),r&&p.push({id:Mo(),tooltip:Be.ADD_ACTION,rightIcon:fi,onClick:()=>lp(e,r)}),s&&p.push({id:Mo(),tooltip:Be.ADD_INSTRUMENTATION_RULE,rightIcon:wi,onClick:()=>lp(e,s)}),c&&p.push({id:Mo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ti,disabled:!d,onClick:()=>lp(e,c)}),p}},sp=({connections:o,getConnections:i,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,getEffectiveConfig:u,applyConfigurations:p,snapshotMinSupportedVersion:h=0,getAllClusterSnapshots:g,persistSources:m,getDestinationCategories:b,getPotentialDestinations:v,testConnection:C,createDestination:S,updateDestination:w,createAction:x,createInstrumentationRule:T})=>{const $=f(),{isVm:E}=y(),{formatTimeAgo:I}=Lt(),[N,A]=r(!1),[O,D]=r(o||[]),R=l(async()=>{try{A(!0),D(await i()??[])}catch(e){}finally{A(!1)}},[]);n(()=>{O.length||R()},[]);const[P,F]=r(""),[L,_]=r(null),[z,B]=r([]),M=a(()=>L===np.BulkConfig?d:L===np.BulkSource?h:0,[L,d,h]),{supportedConnections:X,supportedConnectionIds:V}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===we.Success,n=k(e.odigosVersion,t);return o&&n}))(O,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[O.length,M]);n(()=>{if(!L||L===np.Delete)return;const e=z.filter(e=>!V.includes(e));e.length&&B(t=>t.filter(t=>!e.includes(t)))},[L,z.length,V.length]);const U=a(()=>O.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())).map(e=>({cells:[{key:ap.Id,rawValue:e.id},{key:ap.Name,rawValue:e.name},{key:ap.Type,rawValue:e.type},{key:ap.Status,rawValue:e.status,component:()=>(e=>{const o=e===we.Success?"Connection live":"Connection lost",n=e===we.Success?Ci:Si;return t(Fe,{status:e,label:o,leftIcon:n})})(e.status)},{key:ap.OdigosVersion,rawValue:e.odigosVersion},{key:ap.ConnectedSince,rawValue:e.connectedAt?I(e.connectedAt):"-"},{key:ap.LastActivity,rawValue:e.lastSeenAt?I(e.lastSeenAt):"-"}],onClick:e.status!==we.Success||L?void 0:()=>s(e),isSelected:z.includes(e.id),onSelect:()=>B(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>B(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==we.Success||L===np.BulkConfig&&!k(e.odigosVersion,d)||L===np.BulkSource&&!k(e.odigosVersion,h)})),[O,z,P,L,d,h]),H=a(()=>{const e=(e,t)=>{B([e]),_(t)};return rp({connections:O,configMinSupportedVersion:d,snapshotMinSupportedVersion:h,onDelete:t=>e(t,np.Delete),onAddSource:!E&&g&&m?t=>e(t,np.BulkSource):void 0,onAddDestination:!E&&b&&v&&S?t=>e(t,np.BulkDestination):void 0,onAddAction:!E&&x?t=>e(t,np.BulkAction):void 0,onAddInstrumentationRule:!E&&T?t=>e(t,np.BulkInstrumentationRule):void 0,onEditConfiguration:!E&&u&&p?t=>e(t,np.BulkConfig):void 0})},[E,O,d,u,p,h,g,m,b,v,S,x,T]),G=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];o&&r.push({id:Mo(),type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:"Add Sources",rightIcon:xi,onClick:o}});const s=[n?{id:np.BulkDestination,label:Be.ADD_DESTINATION,icon:bi}:null,a?{id:np.BulkAction,label:Be.ADD_ACTION,icon:fi}:null,i?{id:np.BulkInstrumentationRule,label:Be.ADD_INSTRUMENTATION_RULE,icon:wi}:null,l?{id:np.BulkConfig,label:"Manage Configurations",icon:Ti}:null];return s.some(Boolean)&&r.push({id:Mo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"Bulk Operations",onClick:e=>{e===np.BulkSource?o?.():e===np.BulkDestination?n?.():e===np.BulkAction?a?.():e===np.BulkInstrumentationRule?i?.():e===np.BulkConfig&&l?.()}},dropDataProps:{alignX:Bo.Left,items:s}}),r.push({id:Mo(),type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:St.CANCEL,onClick:t}}),r})({onCancel:()=>B([]),onAddSource:!E&&g&&m?()=>_(np.BulkSource):void 0,onAddDestination:!E&&b&&v&&S?()=>_(np.BulkDestination):void 0,onAddAction:!E&&x?()=>_(np.BulkAction):void 0,onAddInstrumentationRule:!E&&T?()=>_(np.BulkInstrumentationRule):void 0,onManageConfigurations:!E&&u&&p?()=>_(np.BulkConfig):void 0}),[E,u,p,g,m,b,v,S,x,T]);return t(ua,{children:e(Ye,{fullHeight:!0,richTitle:{icon:Ji,title:Be.CONNECTIONS,badge:{label:O.length.toString(),status:pt.Unknown}},search:{placeholder:"Search by cluster name",value:P,onChange:e=>F(e),width:"300px"},actions:[{id:Mo(),type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ni,onClick:R,disabled:N}}],children:[t(mo,{variant:fo.Pretty,headerBackgroundColor:$.v2.colors.silver[1e3],isLoading:N,withCheckboxes:!0,columns:ip,rows:U,rowActionsPushRightPosition:L?`calc(${wl} - 24px)`:void 0,getRowActions:H}),L===np.BulkConfig&&u&&p&&t(Ps,{onClose:()=>_(null),connections:X,selectedConnectionIds:z,setSelectedConnectionIds:B,getEffectiveConfig:u,onApply:p}),L===np.BulkSource&&g&&m&&t(_l,{selectedConnectionIds:z,children:t(Os,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getAllClusterSnapshots:g,persistSources:async e=>await(m?.(e))})}),L===np.BulkDestination&&b&&v&&C&&S&&w&&t(zl,{children:t(ds,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getDestinationCategories:b,getPotentialDestinations:v,testConnection:e=>C(e,z),createDestination:e=>S(e,z),updateDestination:(e,t)=>w(e,t,z)})}),L===np.BulkAction&&x&&t(Bl,{children:t(es,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createAction:e=>x(e,z)})}),L===np.BulkInstrumentationRule&&T&&t(Ml,{children:t(us,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createInstrumentationRule:e=>T(e,z)})}),t(vl,{target:"connection",isOpen:L===np.Delete,onClose:()=>{B([]),_(null)},onApprove:async()=>{const e=z[0];e&&(await c(e),await R())}}),t(pa,{isOpen:!!z.length&&!L,richTitle:{icon:si,title:"Selected Clusters",badge:{label:z.length}},actions:G})]})})},cp=m.div`
552
563
  display: flex;
553
564
  align-items: center;
554
565
  justify-content: space-between;
@@ -557,26 +568,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
557
568
  width: calc(100% - 32px);
558
569
  border-radius: 16px;
559
570
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
560
- `,ip=m.div`
571
+ `,dp=m.div`
561
572
  display: flex;
562
573
  align-items: center;
563
574
  justify-content: center;
564
575
  padding: 8px;
565
576
  border-radius: 8px;
566
577
  background-color: ${({theme:e})=>e.v2.colors.white[500]+qe["004"]};
567
- `,lp=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=f(),c=()=>o(2),d=()=>o(3),u=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,a)=>{if(!o.selected)return null;const i=o.kind||ut.Namespace,l=i===ut.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(ap,{children:[t(Q,{nowrap:!0,children:l}),t(Fe,{label:i,status:we.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const a=lt(o.option.type).icon;return e(ap,{children:[e(oe,{$gap:8,children:[a&&t(ip,{children:t(a,{size:24})}),t(Q,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Fe,{status:o.testResult.succeeded?we.Success:we.Error,leftIcon:o.testResult.succeeded?Ci:Si})]},`destination-${n}`)})||[],[l]);return t(ml,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:Ei,title:Me.SUMMARY,subTitle:Me.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(xi,{size:24}),t(Q,{nowrap:!0,children:Me.SELECTED_SOURCES}),t(Fe,{label:u.length})]}),t(ne,{"data-id":"summary-edit-sources",leftIcon:pi,variant:ie.Secondary,size:ae.S,onClick:c})]}),list:u.length?u:[t(Qe,{$height:"100%",children:t(me,{icon:xi,title:Me.NO_SOURCES_SELECTED,subTitle:Me.ADD_SOURCE_PROMPT,button:{leftIcon:li,label:Me.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(bi,{size:24}),t(Q,{nowrap:!0,children:Me.SELECTED_DESTINATIONS}),t(Fe,{label:p.length})]}),t(ne,{"data-id":"summary-edit-destinations",leftIcon:pi,variant:ie.Secondary,size:ae.S,onClick:d})]}),list:p.length?p:[t(Qe,{"data-id":"summary-no-destinations",$height:"100%",children:t(me,{icon:bi,title:Me.NO_DESTINATIONS_SELECTED,subTitle:Me.ADD_DESTINATION_PROMPT,button:{leftIcon:li,label:Me.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},rp=m.div`
578
+ `,up=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=f(),c=()=>o(2),d=()=>o(3),u=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,a)=>{if(!o.selected)return null;const i=o.kind||ut.Namespace,l=i===ut.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(cp,{children:[t(Q,{nowrap:!0,children:l}),t(Fe,{label:i,status:we.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const a=lt(o.option.type).icon;return e(cp,{children:[e(oe,{$gap:8,children:[a&&t(dp,{children:t(a,{size:24})}),t(Q,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Fe,{status:o.testResult.succeeded?we.Success:we.Error,leftIcon:o.testResult.succeeded?Ci:Si})]},`destination-${n}`)})||[],[l]);return t(bl,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:Ei,title:Be.SUMMARY,subTitle:Be.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(xi,{size:24}),t(Q,{nowrap:!0,children:Be.SELECTED_SOURCES}),t(Fe,{label:u.length})]}),t(ne,{"data-id":"summary-edit-sources",leftIcon:pi,variant:ie.Secondary,size:ae.S,onClick:c})]}),list:u.length?u:[t(Qe,{$height:"100%",children:t(me,{icon:xi,title:Be.NO_SOURCES_SELECTED,subTitle:Be.ADD_SOURCE_PROMPT,button:{leftIcon:li,label:Be.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(bi,{size:24}),t(Q,{nowrap:!0,children:Be.SELECTED_DESTINATIONS}),t(Fe,{label:p.length})]}),t(ne,{"data-id":"summary-edit-destinations",leftIcon:pi,variant:ie.Secondary,size:ae.S,onClick:d})]}),list:p.length?p:[t(Qe,{"data-id":"summary-no-destinations",$height:"100%",children:t(me,{icon:bi,title:Be.NO_DESTINATIONS_SELECTED,subTitle:Be.ADD_DESTINATION_PROMPT,button:{leftIcon:li,label:Be.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},pp=m.div`
568
579
  position: relative;
569
580
  overflow: hidden;
570
581
  width: calc(100vw - ${({$paddingXAxis:e})=>e});
571
582
  height: calc(100vh - ${({$paddingYAxis:e})=>e});
572
583
  box-sizing: border-box;
573
- `,sp=m.svg`
584
+ `,hp=m.svg`
574
585
  position: absolute;
575
586
  top: 50%;
576
587
  left: 50%;
577
588
  transform: translate(-50%, -50%);
578
589
  z-index: -1;
579
- `,cp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],dp=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:cp},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:cp},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:cp}],up=({paddingXAxis:o="0px",paddingYAxis:i="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/dp[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(rp,{$paddingXAxis:o,$paddingYAxis:i,children:[dp.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(sp,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},pp=m.div`
590
+ `,gp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],mp=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:gp},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:gp},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:gp}],fp=({paddingXAxis:o="0px",paddingYAxis:i="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/mp[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(pp,{$paddingXAxis:o,$paddingYAxis:i,children:[mp.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(hp,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},bp=m.div`
580
591
  display: flex;
581
592
  flex-direction: column;
582
593
  align-items: center;
@@ -587,7 +598,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
587
598
  width: 50vw;
588
599
  border-radius: 16px;
589
600
  background: ${({theme:e})=>e.v2.colors.silver[900]};
590
- `,hp=m.div`
601
+ `,vp=m.div`
591
602
  display: flex;
592
603
  flex-direction: column;
593
604
  align-items: center;
@@ -597,15 +608,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
597
608
  & * {
598
609
  text-align: center;
599
610
  }
600
- `,gp=({onStart:o})=>t(q,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(Qe,{$height:"100%",children:e(pp,{children:[e(hp,{children:[t(Q,{size:te.L,weight:500,children:Me.GET_STARTED_WITH}),t(yl,{size:260}),t(Q,{size:te.S,weight:400,children:Me.GET_STARTED_DESCRIPTION})]}),t(ne,{"data-id":"onboarding-get-started",label:St.GET_STARTED,rightIcon:ri,size:ae.L,onClick:o})]})})}),mp=[{step:1,label:Me.INSTALLATION,forceDoneBadge:!0},{step:2,label:Me.SOURCES_SETUP},{step:3,label:Me.DESTINATIONS_SETUP},{step:4,label:Me.SUMMARY}],fp=m.div`
611
+ `,yp=({onStart:o})=>t(q,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(Qe,{$height:"100%",children:e(bp,{children:[e(vp,{children:[t(Q,{size:te.L,weight:500,children:Be.GET_STARTED_WITH}),t(Sl,{size:260}),t(Q,{size:te.S,weight:400,children:Be.GET_STARTED_DESCRIPTION})]}),t(ne,{"data-id":"onboarding-get-started",label:St.GET_STARTED,rightIcon:ri,size:ae.L,onClick:o})]})})}),Cp=[{step:1,label:Be.INSTALLATION,forceDoneBadge:!0},{step:2,label:Be.SOURCES_SETUP},{step:3,label:Be.DESTINATIONS_SETUP},{step:4,label:Be.SUMMARY}],Sp=m.div`
601
612
  display: flex;
602
613
  flex-direction: column;
603
614
  gap: 32px;
604
615
  padding: 64px;
605
- `,bp=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:l,getPotentialDestinations:s,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Xo(),[g,m]=r(1),[f,b]=r(!1),[v,y]=r(null),[C,S]=r(null),w=()=>m(e=>e+1),x=()=>m(e=>e-1);return e(up,{paddingXAxis:o,paddingYAxis:n,children:[e(fp,{children:[t(yl,{useInline:!0}),t(ha,{currentStep:g,data:mp,gap:32})]}),t(Fl,{initialInputs:v,children:e(Ll,{children:[1===g&&t(gp,{onStart:w}),2===g&&t(Ns,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===g&&t(ss,{disableAnimation:!0,onBack:e=>{S(e),x()},onNext:e=>{S(e),w()},getDestinationCategories:l,getPotentialDestinations:s,initialInputs:C,testConnection:c,createDestination:d,updateDestination:u}),4===g&&t(lp,{disableAnimation:!0,setStep:m,onSave:async()=>{if(!f){b(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value?.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};h(ou),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},vp=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),yp=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Cp=m.div`
616
+ `,wp=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:l,getPotentialDestinations:s,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Xo(),[g,m]=r(1),[f,b]=r(!1),[v,y]=r(null),[C,S]=r(null),w=()=>m(e=>e+1),x=()=>m(e=>e-1);return e(fp,{paddingXAxis:o,paddingYAxis:n,children:[e(Sp,{children:[t(Sl,{useInline:!0}),t(ha,{currentStep:g,data:Cp,gap:32})]}),t(_l,{initialInputs:v,children:e(zl,{children:[1===g&&t(yp,{onStart:w}),2===g&&t(Os,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===g&&t(ds,{disableAnimation:!0,onBack:e=>{S(e),x()},onNext:e=>{S(e),w()},getDestinationCategories:l,getPotentialDestinations:s,initialInputs:C,testConnection:c,createDestination:d,updateDestination:u}),4===g&&t(up,{disableAnimation:!0,setStep:m,onSave:async()=>{if(!f){b(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value?.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};h(ru),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},xp=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),kp=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Tp=m.div`
606
617
  position: relative;
607
618
  display: inline-flex;
608
- `,Sp=m.button`
619
+ `,$p=m.button`
609
620
  display: inline-flex;
610
621
  align-items: center;
611
622
  gap: 8px;
@@ -618,7 +629,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
618
629
  &:hover {
619
630
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
620
631
  }
621
- `,wp=m.div`
632
+ `,Ep=m.div`
622
633
  position: absolute;
623
634
  top: calc(100% + 8px);
624
635
  right: 0;
@@ -631,28 +642,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
631
642
  border-radius: 12px;
632
643
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
633
644
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
634
- `,xp=m.div`
645
+ `,Ip=m.div`
635
646
  display: flex;
636
647
  flex-direction: column;
637
648
  gap: 12px;
638
649
  padding: 16px;
639
650
  max-height: 60vh;
640
651
  overflow-y: auto;
641
- `,kp=m.div`
652
+ `,Np=m.div`
642
653
  display: flex;
643
654
  align-items: center;
644
655
  gap: 8px;
645
656
  padding: 12px 16px;
646
657
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
647
- `,Tp=m.div`
658
+ `,Ap=m.div`
648
659
  display: flex;
649
660
  align-items: center;
650
661
  gap: 8px;
651
662
  margin-left: auto;
652
- `,$p=()=>{const o=f(),l=ct(e=>e.sources),s=ct(e=>e.namespaces),{selectedStreamName:c}=Be(),{getItemSS:d,setItemSS:u,removeItemSS:p}=va(),{namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=ga(),x=a(()=>ma(l,c),[l,c]);n(()=>{const e=d(fa.OVERVIEW_FILTERS,w());C(e)},[]);const[k,T]=r({namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[$,E]=r(yp(k)),[I,N]=r(!1);n(()=>{if(!I){const e={namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};T(e),E(yp(e))}},[I,h,g,m,b,v,y]);const A=i(null);io(A,()=>N(!1)),Fo({key:"Escape",active:I},()=>N(!1));const O=a(()=>{const e=new Set,t=[];return s.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[s]),D=a(()=>{const e=new Set,t=[];return x.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[x]),R=a(()=>{const e=new Set,t=[];return x.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Le[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[x]),P=a(()=>ba.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return x.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Ot(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[x]),L=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));T(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=I?vi:yi,z=a(()=>vp(k.languages),[k.languages]);return e(Cp,{ref:A,children:[e(Sp,{"data-id":"filters-trigger",$isOpen:I,type:"button",onClick:()=>N(e=>!e),children:[t(Ji,{size:16,fill:o.v2.colors.white[500]}),t(Q,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),$>0&&t(Fe,{label:$,status:pt.Unknown,textSize:te.XXXS}),t(_,{size:16,fill:o.v2.colors.silver[200]})]}),I&&e(wp,{children:[e(xp,{children:[t(tt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!O.length,options:O,values:vp(k.namespaces),setValues:e=>L("namespaces",O,e)}),t(tt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:vp(k.kinds),setValues:e=>L("kinds",D,e)}),t(tt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:z,setValues:e=>L("languages",R,e)}),t(tt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:vp(k.monitors),setValues:e=>L("monitors",P,e)}),t(tt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:vp(k.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",F,e)}),t(K,{label:"Show only sources with errors",size:gt.L,value:!!k.onlyErrors,onChange:e=>T(t=>({...t,onlyErrors:e}))})]}),e(kp,{children:[t(ne,{"data-id":"filters-reset",size:ae.S,variant:ie.Text,label:"Reset",onClick:()=>{p(fa.OVERVIEW_FILTERS),S(),T(w()),E(0),N(!1)},textColor:o.v2.colors.red[500]}),e(Tp,{children:[t(ne,{"data-id":"filters-cancel",size:ae.S,variant:ie.Secondary,label:"Cancel",onClick:()=>N(!1)}),t(ne,{"data-id":"filters-apply",size:ae.S,variant:ie.Primary,label:"Apply",onClick:()=>{u(fa.OVERVIEW_FILTERS,k),C(k),E(yp(k)),N(!1)}})]})]})]})]})},Ep="40vw",Ip=m.div`
663
+ `,Op=()=>{const o=f(),l=ct(e=>e.sources),s=ct(e=>e.namespaces),{selectedStreamName:c}=Me(),{getItemSS:d,setItemSS:u,removeItemSS:p}=va(),{namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=ga(),x=a(()=>ma(l,c),[l,c]);n(()=>{const e=d(fa.OVERVIEW_FILTERS,w());C(e)},[]);const[k,T]=r({namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[$,E]=r(kp(k)),[I,N]=r(!1);n(()=>{if(!I){const e={namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};T(e),E(kp(e))}},[I,h,g,m,b,v,y]);const A=i(null);ro(A,()=>N(!1)),Fo({key:"Escape",active:I},()=>N(!1));const O=a(()=>{const e=new Set,t=[];return s.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[s]),D=a(()=>{const e=new Set,t=[];return x.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[x]),R=a(()=>{const e=new Set,t=[];return x.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Le[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[x]),P=a(()=>ba.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return x.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Ot(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[x]),L=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));T(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=I?vi:yi,z=a(()=>xp(k.languages),[k.languages]);return e(Tp,{ref:A,children:[e($p,{"data-id":"filters-trigger",$isOpen:I,type:"button",onClick:()=>N(e=>!e),children:[t(qi,{size:16,fill:o.v2.colors.white[500]}),t(Q,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),$>0&&t(Fe,{label:$,status:pt.Unknown,textSize:te.XXXS}),t(_,{size:16,fill:o.v2.colors.silver[200]})]}),I&&e(Ep,{children:[e(Ip,{children:[t(tt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!O.length,options:O,values:xp(k.namespaces),setValues:e=>L("namespaces",O,e)}),t(tt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:xp(k.kinds),setValues:e=>L("kinds",D,e)}),t(tt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:z,setValues:e=>L("languages",R,e)}),t(tt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:xp(k.monitors),setValues:e=>L("monitors",P,e)}),t(tt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:xp(k.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",F,e)}),t(K,{label:"Show only sources with errors",size:gt.L,value:!!k.onlyErrors,onChange:e=>T(t=>({...t,onlyErrors:e}))})]}),e(Np,{children:[t(ne,{"data-id":"filters-reset",size:ae.S,variant:ie.Text,label:"Reset",onClick:()=>{p(fa.OVERVIEW_FILTERS),S(),T(w()),E(0),N(!1)},textColor:o.v2.colors.red[500]}),e(Ap,{children:[t(ne,{"data-id":"filters-cancel",size:ae.S,variant:ie.Secondary,label:"Cancel",onClick:()=>N(!1)}),t(ne,{"data-id":"filters-apply",size:ae.S,variant:ie.Primary,label:"Apply",onClick:()=>{u(fa.OVERVIEW_FILTERS,k),C(k),E(kp(k)),N(!1)}})]})]})]})]})},Dp="40vw",Rp=m.div`
653
664
  position: relative;
654
- width: ${Ep};
655
- `,Np=m.div`
665
+ width: ${Dp};
666
+ `,Pp=m.div`
656
667
  position: absolute;
657
668
  top: calc(100% + 8px);
658
669
  left: 0;
@@ -661,23 +672,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
661
672
  flex-direction: column;
662
673
  gap: 8px;
663
674
  padding: 8px;
664
- width: calc(${Ep} - 16px);
675
+ width: calc(${Dp} - 16px);
665
676
  border-radius: 12px;
666
677
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
667
678
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
668
- `,Ap=m.div`
679
+ `,Fp=m.div`
669
680
  display: flex;
670
681
  align-items: center;
671
682
  overflow-x: auto;
672
- `,Op=m.div`
683
+ `,Lp=m.div`
673
684
  display: flex;
674
685
  flex-direction: column;
675
686
  gap: 0;
676
687
  max-height: 60vh;
677
688
  overflow-y: auto;
678
- `,Dp=m.div`
689
+ `,_p=m.div`
679
690
  padding: 8px 12px 4px 12px;
680
- `,Rp=m.div`
691
+ `,zp=m.div`
681
692
  display: flex;
682
693
  align-items: center;
683
694
  gap: 8px;
@@ -687,9 +698,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
687
698
  &:hover {
688
699
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
689
700
  }
690
- `,Pp=m.div`
701
+ `,Bp=m.div`
691
702
  padding: 16px 8px;
692
- `,Fp=({preventPopup:o=!1})=>{const n=f(),{onClickNode:l}=ya(),{searchText:c,setSearchText:d}=ga(),{selectedStreamName:u}=Be(),p=ct(e=>e.sources),h=ct(e=>e.destinations),g=ct(e=>e.actions),m=ct(e=>e.instrumentationRules),b=i(null),[v,y]=r(!1),[C,S]=r("all"),w=!o&&(!!c||v),x=()=>{d(""),y(!1),S("all")};io(b,()=>x()),Fo({key:"Escape",active:w},x);const{categories:k,searchResults:T}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,s=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:ut.Source,label:"Sources",count:r.length,entities:[]},{category:ut.Action,label:"Actions",count:s.length,entities:[]},{category:ut.Destination,label:"Destinations",count:c.length,entities:[]},{category:ut.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===ut.InstrumentationRule?l:e.category===ut.Source?r:e.category===ut.Action?s:e.category===ut.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:m,sources:ma(p,u),actions:g,destinations:Nt(h,u),searchText:c,selectedCategory:C}),[m,p,g,h,u,c,C]),$=a(()=>k.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[k]),E=T.some(({entities:e})=>e.length>0);return e(Ip,{ref:b,children:[t(Kt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>y(!0),width:Ep}),w&&e(Np,{children:[$.length>1&&t(Ap,{children:t(le,{options:$,selected:C,setSelected:S})}),E?t(Op,{children:T.map(({category:o,label:a,entities:i},r)=>{if(!i.length)return null;const c=Sa(o);return e(s,{children:[t(Dp,{children:t(Q,{size:te.XXS,color:ee.Secondary,children:a})}),i.map((a,i)=>e(Rp,{onClick:()=>{const e=Ct(a);l(null,{data:{type:o,id:e}}),x()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(Q,{size:te.XS,nowrap:!0,children:Ca(a,o,{extended:!0})})]},`entity-${r}-${i}`))]},`category-list-${o}`)})}):t(Pp,{children:t(me,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},Lp=m.div`
703
+ `,Mp=({preventPopup:o=!1})=>{const n=f(),{onClickNode:l}=ya(),{searchText:c,setSearchText:d}=ga(),{selectedStreamName:u}=Me(),p=ct(e=>e.sources),h=ct(e=>e.destinations),g=ct(e=>e.actions),m=ct(e=>e.instrumentationRules),b=i(null),[v,y]=r(!1),[C,S]=r("all"),w=!o&&(!!c||v),x=()=>{d(""),y(!1),S("all")};ro(b,()=>x()),Fo({key:"Escape",active:w},x);const{categories:k,searchResults:T}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,s=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:ut.Source,label:"Sources",count:r.length,entities:[]},{category:ut.Action,label:"Actions",count:s.length,entities:[]},{category:ut.Destination,label:"Destinations",count:c.length,entities:[]},{category:ut.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===ut.InstrumentationRule?l:e.category===ut.Source?r:e.category===ut.Action?s:e.category===ut.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:m,sources:ma(p,u),actions:g,destinations:Nt(h,u),searchText:c,selectedCategory:C}),[m,p,g,h,u,c,C]),$=a(()=>k.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[k]),E=T.some(({entities:e})=>e.length>0);return e(Rp,{ref:b,children:[t(Kt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>y(!0),width:Dp}),w&&e(Pp,{children:[$.length>1&&t(Fp,{children:t(le,{options:$,selected:C,setSelected:S})}),E?t(Lp,{children:T.map(({category:o,label:a,entities:i},r)=>{if(!i.length)return null;const c=Sa(o);return e(s,{children:[t(_p,{children:t(Q,{size:te.XXS,color:ee.Secondary,children:a})}),i.map((a,i)=>e(zp,{onClick:()=>{const e=Ct(a);l(null,{data:{type:o,id:e}}),x()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(Q,{size:te.XS,nowrap:!0,children:Ca(a,o,{extended:!0})})]},`entity-${r}-${i}`))]},`category-list-${o}`)})}):t(Bp,{children:t(me,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},Xp=m.div`
693
704
  position: relative;
694
705
  display: flex;
695
706
  align-items: center;
@@ -700,7 +711,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
700
711
  box-sizing: border-box;
701
712
  border-radius: 16px 16px 0 0;
702
713
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
703
- `,_p=m.div`
714
+ `,Vp=m.div`
704
715
  position: absolute;
705
716
  bottom: 0;
706
717
  left: 0;
@@ -709,7 +720,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
709
720
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
710
721
  border-radius: 32px;
711
722
  transition: width 0.3s;
712
- `,zp=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Xo();return e(Lp,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(H,{size:wa.S,partiallyChecked:r,value:!!s,onChange:c}),t(Q,{size:te.S,nowrap:!0,children:`${Ot(o)}s`}),t(Fe,{label:n,tooltip:a,status:pt.Unknown,textSize:te.XXXS})]}),e(oe,{children:[t(ot,{"data-id":`add-${o}`,icon:li,onClick:()=>u(o)}),t(ot,{"data-id":`refresh-${o}`,icon:Ni,onClick:l,disabled:i})]}),"number"==typeof d&&t(_p,{$percent:d})]})},Mp=m(V)`
723
+ `,Up=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Xo();return e(Xp,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(H,{size:wa.S,partiallyChecked:r,value:!!s,onChange:c}),t(Q,{size:te.S,nowrap:!0,children:`${Ot(o)}s`}),t(Fe,{label:n,tooltip:a,status:pt.Unknown,textSize:te.XXXS})]}),e(oe,{children:[t(ot,{"data-id":`add-${o}`,icon:li,onClick:()=>u(o)}),t(ot,{"data-id":`refresh-${o}`,icon:Ni,onClick:l,disabled:i})]}),"number"==typeof d&&t(Vp,{$percent:d})]})},Hp=m(V)`
713
724
  align-items: center !important;
714
725
  justify-content: center !important;
715
726
  align-self: stretch;
@@ -724,7 +735,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
724
735
  &:hover {
725
736
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
726
737
  }
727
- `,Bp=({entityType:o,description:n})=>{const{setCurrentModal:a}=Xo();return e(Mp,{onClick:()=>a(o),children:[e(oe,{$gap:4,children:[t(li,{size:16}),t(Q,{size:te.S,children:`Add ${Ot(o)}`})]}),t(Q,{size:te.XXS,align:"center",children:n})]})},Xp=m.div`
738
+ `,Gp=({entityType:o,description:n})=>{const{setCurrentModal:a}=Xo();return e(Hp,{onClick:()=>a(o),children:[e(oe,{$gap:4,children:[t(li,{size:16}),t(Q,{size:te.S,children:`Add ${Ot(o)}`})]}),t(Q,{size:te.XXS,align:"center",children:n})]})},jp=m.div`
728
739
  display: flex;
729
740
  align-items: center;
730
741
  gap: 12px;
@@ -739,10 +750,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
739
750
  &:hover {
740
751
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
741
752
  }
742
- `,Vp=m(oe)`
753
+ `,Wp=m(oe)`
743
754
  flex: 1;
744
755
  min-width: 0;
745
- `,Up=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:g})=>{const m=f(),b=n===ut.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=Jt(),{selectedSources:w,setSelectedSources:x}=xa(),k=g,T=b?k.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),E=v&&!h?ka(we.Info,m):l?ka(l,m):void 0,I=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Xp,{"data-id":I,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(H,{size:wa.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(eo,{icons:u,icon:d,iconSrc:p}),e(Vp,{$gap:4,children:[t(fe,{size:te.XS,nowrap:!0,children:i}),t(oe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(Ie,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Fe,{label:c,status:l&&[we.Error,we.Warning].includes(l)?l:pt.Unknown,leftIcon:E,textSize:te.XXXS})})})]})]})};function Hp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ht.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Mt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function jp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Ht.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Gp=m.div`
756
+ `,Kp=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:g})=>{const m=f(),b=n===ut.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=Jt(),{selectedSources:w,setSelectedSources:x}=xa(),k=g,T=b?k.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),E=v&&!h?ka(we.Info,m):l?ka(l,m):void 0,I=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(jp,{"data-id":I,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(H,{size:wa.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(eo,{icons:u,icon:d,iconSrc:p}),e(Wp,{$gap:4,children:[t(fe,{size:te.XS,nowrap:!0,children:i}),t(oe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(Ie,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Fe,{label:c,status:l&&[we.Error,we.Warning].includes(l)?l:pt.Unknown,leftIcon:E,textSize:te.XXXS})})})]})]})};function Yp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ht.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Bt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Jp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Ht.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const qp=m.div`
746
757
  position: absolute;
747
758
  top: 0;
748
759
  left: 0;
@@ -753,22 +764,22 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
753
764
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
754
765
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
755
766
  pointer-events: none;
756
- `,Wp=m.div`
767
+ `,Zp=m.div`
757
768
  display: flex;
758
769
  align-items: center;
759
770
  gap: 8px;
760
771
  padding: 4px 8px 0;
761
- `,Kp=m.div`
772
+ `,Qp=m.div`
762
773
  flex: 1;
763
774
  height: 1px;
764
775
  background: ${({theme:e})=>e.v2.colors.silver[700]};
765
- `,Yp=({namespace:e})=>{const o=f();return t(Gp,{children:t(Q,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Jp=({namespace:o})=>{const n=f();return e(Wp,{children:[t(Kp,{}),t(Q,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Kp,{})]})},qp={[ut.InstrumentationRule]:Me.NO_DATA_INSTRUMENTATION_RULES,[ut.Source]:Me.NO_DATA_SOURCES,[ut.Action]:Me.NO_DATA_ACTIONS,[ut.Destination]:Me.NO_DATA_DESTINATIONS},Zp=m.div`
776
+ `,eh=({namespace:e})=>{const o=f();return t(qp,{children:t(Q,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},th=({namespace:o})=>{const n=f();return e(Zp,{children:[t(Qp,{}),t(Q,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Qp,{})]})},oh={[ut.InstrumentationRule]:Be.NO_DATA_INSTRUMENTATION_RULES,[ut.Source]:Be.NO_DATA_SOURCES,[ut.Action]:Be.NO_DATA_ACTIONS,[ut.Destination]:Be.NO_DATA_DESTINATIONS},nh=m.div`
766
777
  display: flex;
767
778
  flex-direction: column;
768
779
  flex: 1 0 0;
769
780
  min-width: 0;
770
781
  ${({$isVm:e})=>e?"width: 45vw;":""}
771
- `,Qp=m.div`
782
+ `,ah=m.div`
772
783
  display: flex;
773
784
  flex-direction: column;
774
785
  align-items: stretch;
@@ -778,7 +789,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
778
789
  border-radius: 0 0 16px 16px;
779
790
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
780
791
  overflow: hidden;
781
- `,eh=m.div`
792
+ `,ih=m.div`
782
793
  position: relative;
783
794
  display: flex;
784
795
  flex-direction: column;
@@ -790,16 +801,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
790
801
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
791
802
  height: ${({$height:e})=>e}px;
792
803
  overflow: hidden;
793
- `,th=(e,t,o,n)=>{const a=Ct(e);if(!a)return null;const i=t===ut.Source;let l,r,s=!1,c=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Mt.Failure:return{status:we.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Mt.Notice:return{status:we.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Mt.Pending:case Mt.Waiting:return{status:void 0,faded:!1,displaySource:Hp(e)};case Mt.Unsupported:case Mt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:jp(e)}}}(e);l=t.status,s=t.faded,r=t.tooltip,c=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=$a(e.conditions);l=t,s=o}const d=Ca(e,t,{extended:i,prioritizeDisplayName:!i});let u,p,h,g,m;switch(t){case ut.Source:{u=Qt(e),p=Sa(ut.Source);const t=n?.get(Ea(a));g=to(t);break}case ut.Destination:{const t=lt(e.destinationType.type);p=t.icon,h=t.iconSrc;const o=n?.get(Ea(a));g=to(o),m=!e.disabled;break}case ut.Action:p=Tt(e.type),m=!e.disabled;break;case ut.InstrumentationRule:p=Ft(e.type),m=!e.disabled}return{key:Ea(a),entityId:a,namespace:i?e.id.namespace:void 0,raw:c,itemProps:{entityId:a,entityType:t,title:d,status:l,faded:s,tooltip:r,throughput:g,icon:p,icons:u,iconSrc:h,isActive:m,raw:c}}},oh=({entityType:o,entities:i,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),g=o===ut.Source,m=i.length!==s,f=ft(e=>g?e.progress[bt.Instrumenting]?.percentage:void 0),b=ft(e=>g?e.progress[bt.Uninstrumenting]?.percentage:void 0),v=!g||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=xa(),w=a(()=>g?Object.values(C).reduce((e,t)=>e+t.length,0):0,[g,C]),x=a(()=>{if(!c)return;const e=new Map,t=o===ut.Source?c.sources:o===ut.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(Ta(o),o.throughput);return e},[c,o]),k=a(()=>i.map(e=>th(e,o,0,x)).filter(Boolean),[i,o,x,h]),[T,$]=r(""),{elements:E,indexToNamespace:I,multipleNs:N,dividerCount:A}=a(()=>{const e=[],o=[],n=new Set(k.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const n of k)g&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(Jp,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(Up,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[k,g]);n(()=>{if(g&&I.length&&!T){const e=I.find(Boolean);e&&$(e)}},[g,I]);const O=l(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==T&&$(t)},[I,T]);if(h&&[ut.InstrumentationRule,ut.Action].includes(o))return null;const D=58*k.length+(N?28:0)+32*A,R=Math.max(0,u-52-16),P=Math.min(R,D)+8,F="number"==typeof v?`${v}%`:m?`${i.length}/${s}`:s;return e(Zp,{$isVm:h,children:[t(zp,{entityType:o,badge:F,badgeTooltip:m?Me.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&i?.length!==w,allSelected:w>0&&i?.length===w,onSelectAll:g?e=>{if(g)if(e){const e={};i?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(Qp,{children:i.length?e(eh,{$height:P,children:[N&&T&&t(Yp,{namespace:T}),t(Yt,{gap:4,elements:E,onTopIndexChange:N?O:void 0})]}):d?t(po,{size:3}):t(Bp,{entityType:o,description:qp[o]??Me.TO_COLLECT_OTEL_DATA})})]})},nh=m.div`
804
+ `,lh=(e,t,o,n)=>{const a=Ct(e);if(!a)return null;const i=t===ut.Source;let l,r,s=!1,c=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Bt.Failure:return{status:we.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Bt.Notice:return{status:we.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Bt.Pending:case Bt.Waiting:return{status:void 0,faded:!1,displaySource:Yp(e)};case Bt.Unsupported:case Bt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Jp(e)}}}(e);l=t.status,s=t.faded,r=t.tooltip,c=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=$a(e.conditions);l=t,s=o}const d=Ca(e,t,{extended:i,prioritizeDisplayName:!i});let u,p,h,g,m;switch(t){case ut.Source:{u=Qt(e),p=Sa(ut.Source);const t=n?.get(Ea(a));g=no(t);break}case ut.Destination:{const t=lt(e.destinationType.type);p=t.icon,h=t.iconSrc;const o=n?.get(Ea(a));g=no(o),m=!e.disabled;break}case ut.Action:p=Tt(e.type),m=!e.disabled;break;case ut.InstrumentationRule:p=Ft(e.type),m=!e.disabled}return{key:Ea(a),entityId:a,namespace:i?e.id.namespace:void 0,raw:c,itemProps:{entityId:a,entityType:t,title:d,status:l,faded:s,tooltip:r,throughput:g,icon:p,icons:u,iconSrc:h,isActive:m,raw:c}}},rh=({entityType:o,entities:i,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),g=o===ut.Source,m=i.length!==s,f=ft(e=>g?e.progress[bt.Instrumenting]?.percentage:void 0),b=ft(e=>g?e.progress[bt.Uninstrumenting]?.percentage:void 0),v=!g||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=xa(),w=a(()=>g?Object.values(C).reduce((e,t)=>e+t.length,0):0,[g,C]),x=a(()=>{if(!c)return;const e=new Map,t=o===ut.Source?c.sources:o===ut.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(Ta(o),o.throughput);return e},[c,o]),k=a(()=>i.map(e=>lh(e,o,0,x)).filter(Boolean),[i,o,x,h]),[T,$]=r(""),{elements:E,indexToNamespace:I,multipleNs:N,dividerCount:A}=a(()=>{const e=[],o=[],n=new Set(k.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const n of k)g&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(th,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(Kp,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[k,g]);n(()=>{if(g&&I.length&&!T){const e=I.find(Boolean);e&&$(e)}},[g,I]);const O=l(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==T&&$(t)},[I,T]);if(h&&[ut.InstrumentationRule,ut.Action].includes(o))return null;const D=58*k.length+(N?28:0)+32*A,R=Math.max(0,u-52-16),P=Math.min(R,D)+8,F="number"==typeof v?`${v}%`:m?`${i.length}/${s}`:s;return e(nh,{$isVm:h,children:[t(Up,{entityType:o,badge:F,badgeTooltip:m?Be.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&i?.length!==w,allSelected:w>0&&i?.length===w,onSelectAll:g?e=>{if(g)if(e){const e={};i?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(ah,{children:i.length?e(ih,{$height:P,children:[N&&T&&t(eh,{namespace:T}),t(Yt,{gap:4,elements:E,onTopIndexChange:N?O:void 0})]}):d?t(oo,{size:3}):t(Gp,{entityType:o,description:oh[o]??Be.TO_COLLECT_OTEL_DATA})})]})},sh=m.div`
794
805
  width: 100%;
795
- height: ${({$height:e})=>e||"auto"};
806
+ flex: 1;
807
+ min-height: 0;
808
+ height: 100%;
796
809
  display: flex;
797
810
  align-items: stretch;
798
811
  gap: 16px;
799
- `,ah=({height:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:r,refetchInstrumentationRules:s})=>{const c=ga(),{selectedStreamName:d}=Be(),{containerRef:u,containerHeight:p}=Ia(),h=ct(e=>e.sources),g=ct(e=>e.sourcesLoading),m=ct(e=>e.destinations),f=ct(e=>e.destinationsLoading),b=ct(e=>e.actions),v=ct(e=>e.actionsLoading),y=ct(e=>e.instrumentationRules),C=ct(e=>e.instrumentationRulesLoading),S=a(()=>ma(h,d),[h,d]),w=a(()=>Nt(m,d),[m,d]),x=a(()=>Na(S,c),[S,c]),k=a(()=>Aa(w,c),[w,c]),T=a(()=>Oa(b,c),[b,c]);return e(nh,{ref:u,$height:o,children:[t(oh,{entityType:ut.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:C,maxHeight:p,refetch:s}),t(oh,{entityType:ut.Source,entities:x,unfilteredCount:S.length,metrics:n,loading:g,maxHeight:p,refetch:i}),t(oh,{entityType:ut.Action,entities:T,unfilteredCount:b.length,loading:v,maxHeight:p,refetch:r}),t(oh,{entityType:ut.Destination,entities:k,unfilteredCount:w.length,metrics:n,loading:f,maxHeight:p,refetch:l})]})},ih=({effectiveConfig:n,fetchNamespacesWithWorkloads:a,persistSources:i,restartWorkloads:l,restartPod:r,recoverFromRollback:s,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchProfilingSlots:h,fetchSourceProfiling:g,fetchK8sManifest:m,getDestinationCategories:f,getPotentialDestinations:b,testConnection:v,createDestination:y,updateDestination:C,deleteDestination:S,createInstrumentationRule:w,updateInstrumentationRule:x,deleteInstrumentationRule:k,createAction:T,updateAction:$,deleteAction:E})=>{const{currentModal:I,setCurrentModal:N}=Xo(),{drawerType:A,drawerEntityId:O,setDrawerType:D,setDrawerEntityId:R}=Jt(),P=()=>{N(""),D(null),R(null)};return e(o,{children:[t(nu,{}),I===ut.Source&&t(Fl,{children:t(Ns,{onClose:P,fetchNamespacesWithWorkloads:a,persistSources:i,withOverlay:!0})}),I===ut.Destination&&t(Ll,{children:t(ss,{onClose:P,getDestinationCategories:f,getPotentialDestinations:b,testConnection:v,createDestination:y,updateDestination:C,withOverlay:!0})}),I===ut.InstrumentationRule&&t(zl,{children:t(cs,{onClose:P,createInstrumentationRule:w,withOverlay:!0})}),I===ut.Action&&t(_l,{children:t(Zr,{onClose:P,createAction:T,withOverlay:!0})}),A===ut.Source&&O&&t(Ml,{children:t(Nd,{onClose:P,effectiveConfig:n,sourceId:O,persistSources:i,restartWorkloads:l,restartPod:r,recoverFromRollback:s,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchSourceProfiling:g,fetchProfilingSlots:h,fetchK8sManifest:m})}),A===ut.Destination&&O&&t(Ll,{children:t(Ps,{onClose:P,destinationId:O,getDestinationCategories:f,testConnection:v,updateDestination:C,deleteDestination:S})}),A===ut.InstrumentationRule&&O&&t(zl,{children:t(Ls,{onClose:P,ruleId:O,updateInstrumentationRule:x,deleteInstrumentationRule:k})}),A===ut.Action&&O&&t(_l,{children:t(Os,{onClose:P,actionId:O,updateAction:$,deleteAction:E})})]})},lh="multi-source-deselect",rh="multi-source-restart",sh="multi-source-uninstrument",ch="Selected sources",dh="Deselect",uh="Restart",ph="Uninstrument",hh="Rollout Restart Workloads",gh="Are you sure you want to rollout restart these workloads?",mh="Go Back",fh="Confirm",bh=({restartWorkloads:i,persistSources:s})=>{const{selectedStreamName:c}=Be(),{selectedSources:d,setSelectedSources:u}=xa(),[p,h]=r(!1),[g,m]=r(!1),f=a(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),b=l(()=>{u({})},[u]),v=l(()=>h(!1),[]),y=l(()=>m(!1),[]);n(()=>{b()},[c,b]);const C=l(()=>{i(Object.values(d).flat().filter(e=>e.id.kind!==uo.StaticPod).map(qt)),b()},[i,d,b]),S=l(()=>{s(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:c}))]))),b()},[s,d,c,b]),w=a(()=>[{id:lh,type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:dh,onClick:b}},{id:rh,type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,label:uh,leftIcon:Xi,onClick:()=>h(!0)}},{id:sh,type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:ph,leftIcon:ii,onClick:()=>m(!0)}}],[b]);return e(o,{children:[t(pa,{isOpen:f>0,richTitle:{icon:xi,title:ch,badge:{label:f}},actions:w}),t(ze,{isOpen:p,title:hh,description:gh,onClose:v,denyButton:{label:mh,variant:ie.Secondary,onClick:v},approveButton:{label:fh,variant:ie.Primary,onClick:()=>{C(),v()}}}),t(fl,{isOpen:g,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},vh=e=>`Data Stream: ${e}`,yh="Search streams...",Ch="No streams match",Sh=m.div`
812
+ `,ch=({metrics:o,refetchSources:n,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:r})=>{const s=ga(),{selectedStreamName:c}=Me(),{containerRef:d,containerHeight:u}=Ia(),p=ct(e=>e.sources),h=ct(e=>e.sourcesLoading),g=ct(e=>e.destinations),m=ct(e=>e.destinationsLoading),f=ct(e=>e.actions),b=ct(e=>e.actionsLoading),v=ct(e=>e.instrumentationRules),y=ct(e=>e.instrumentationRulesLoading),C=a(()=>ma(p,c),[p,c]),S=a(()=>Nt(g,c),[g,c]),w=a(()=>Na(C,s),[C,s]),x=a(()=>Aa(S,s),[S,s]),k=a(()=>Oa(f,s),[f,s]);return e(sh,{ref:d,children:[t(rh,{entityType:ut.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:u,refetch:r}),t(rh,{entityType:ut.Source,entities:w,unfilteredCount:C.length,metrics:o,loading:h,maxHeight:u,refetch:n}),t(rh,{entityType:ut.Action,entities:k,unfilteredCount:f.length,loading:b,maxHeight:u,refetch:l}),t(rh,{entityType:ut.Destination,entities:x,unfilteredCount:S.length,metrics:o,loading:m,maxHeight:u,refetch:i})]})},dh=({effectiveConfig:n,fetchNamespacesWithWorkloads:i,persistSources:l,restartWorkloads:r,restartPod:s,recoverFromRollback:c,updateSource:d,fetchSourceById:u,fetchPeerSources:p,enableProfiling:h,fetchProfilingSlots:g,fetchSourceProfiling:m,fetchK8sManifest:f,getDestinationCategories:b,getPotentialDestinations:v,testConnection:y,createDestination:C,updateDestination:S,deleteDestination:w,createInstrumentationRule:x,updateInstrumentationRule:k,deleteInstrumentationRule:T,createAction:$,updateAction:E,deleteAction:I,workloads:N})=>{const{currentModal:A,setCurrentModal:O}=Xo(),{drawerType:D,drawerEntityId:R,setDrawerType:P,setDrawerEntityId:F}=Jt(),L=()=>{O(""),P(null),F(null)},_=a(()=>(N??[]).map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[N]),z=a(()=>Array.from(new Set((N??[]).map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[N]);return e(o,{children:[t(su,{}),A===ut.Source&&t(_l,{children:t(Os,{onClose:L,fetchNamespacesWithWorkloads:i,persistSources:l,withOverlay:!0})}),A===ut.Destination&&t(zl,{children:t(ds,{onClose:L,getDestinationCategories:b,getPotentialDestinations:v,testConnection:y,createDestination:C,updateDestination:S,withOverlay:!0})}),A===ut.InstrumentationRule&&t(Ml,{sourceOptions:_,namespaceOptions:z,children:t(us,{onClose:L,createInstrumentationRule:x,withOverlay:!0})}),A===ut.Action&&t(Bl,{children:t(es,{onClose:L,createAction:$,withOverlay:!0})}),D===ut.Source&&R&&t(Xl,{children:t(Pd,{onClose:L,effectiveConfig:n,sourceId:R,persistSources:l,restartWorkloads:r,restartPod:s,recoverFromRollback:c,updateSource:d,fetchSourceById:u,fetchPeerSources:p,enableProfiling:h,fetchSourceProfiling:m,fetchProfilingSlots:g,fetchK8sManifest:f})}),D===ut.Destination&&R&&t(zl,{children:t(Ls,{onClose:L,destinationId:R,getDestinationCategories:b,testConnection:y,updateDestination:S,deleteDestination:w})}),D===ut.InstrumentationRule&&R&&t(Ml,{sourceOptions:_,namespaceOptions:z,children:t(zs,{onClose:L,ruleId:R,updateInstrumentationRule:k,deleteInstrumentationRule:T})}),D===ut.Action&&R&&t(Bl,{children:t(Rs,{onClose:L,actionId:R,updateAction:E,deleteAction:I})})]})},uh="multi-source-deselect",ph="multi-source-restart",hh="multi-source-uninstrument",gh="Selected sources",mh="Deselect",fh="Restart",bh="Uninstrument",vh="Rollout Restart Workloads",yh="Are you sure you want to rollout restart these workloads?",Ch="Go Back",Sh="Confirm",wh=({restartWorkloads:i,persistSources:s})=>{const{selectedStreamName:c}=Me(),{selectedSources:d,setSelectedSources:u}=xa(),[p,h]=r(!1),[g,m]=r(!1),f=a(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),b=l(()=>{u({})},[u]),v=l(()=>h(!1),[]),y=l(()=>m(!1),[]);n(()=>{b()},[c,b]);const C=l(()=>{i(Object.values(d).flat().filter(e=>e.id.kind!==to.StaticPod).map(qt)),b()},[i,d,b]),S=l(()=>{s(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:c}))]))),b()},[s,d,c,b]),w=a(()=>[{id:uh,type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:mh,onClick:b}},{id:ph,type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,label:fh,leftIcon:Vi,onClick:()=>h(!0)}},{id:hh,type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:bh,leftIcon:ii,onClick:()=>m(!0)}}],[b]);return e(o,{children:[t(pa,{isOpen:f>0,richTitle:{icon:xi,title:gh,badge:{label:f}},actions:w}),t(ze,{isOpen:p,title:vh,description:yh,onClose:v,denyButton:{label:Ch,variant:ie.Secondary,onClick:v},approveButton:{label:Sh,variant:ie.Primary,onClick:()=>{C(),v()}}}),t(vl,{isOpen:g,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},xh=e=>`Data Stream: ${e}`,kh="Search streams...",Th="No streams match",$h=m.div`
800
813
  position: relative;
801
814
  display: inline-flex;
802
- `,wh=m.div`
815
+ `,Eh=m.div`
803
816
  display: inline-flex;
804
817
  align-items: center;
805
818
  gap: 6px;
@@ -810,7 +823,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
810
823
  &:hover {
811
824
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
812
825
  }
813
- `,xh=m.div`
826
+ `,Ih=m.div`
814
827
  position: absolute;
815
828
  top: calc(100% + 8px);
816
829
  left: 0;
@@ -824,18 +837,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
824
837
  border-radius: 12px;
825
838
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
826
839
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
827
- `,kh=m.div`
840
+ `,Nh=m.div`
828
841
  display: flex;
829
842
  align-items: center;
830
843
  gap: 8px;
831
844
  width: 100%;
832
- `,Th=m.div`
845
+ `,Ah=m.div`
833
846
  display: flex;
834
847
  flex-direction: column;
835
848
  gap: 0;
836
849
  max-height: 240px;
837
850
  overflow-y: auto;
838
- `,$h=m.div`
851
+ `,Oh=m.div`
839
852
  display: flex;
840
853
  align-items: center;
841
854
  gap: 8px;
@@ -846,29 +859,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
846
859
  &:hover {
847
860
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
848
861
  }
849
- `,Eh=m.div`
862
+ `,Dh=m.div`
850
863
  flex: 1;
851
864
  min-width: 0;
852
865
  overflow: hidden;
853
866
  text-overflow: ellipsis;
854
867
  white-space: nowrap;
855
- `,Ih=m.div`
868
+ `,Rh=m.div`
856
869
  display: flex;
857
870
  align-items: center;
858
871
  gap: 2px;
859
872
  flex-shrink: 0;
860
- `,Nh=m.div`
873
+ `,Ph=m.div`
861
874
  display: flex;
862
875
  padding-top: 4px;
863
876
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
864
- `,Ah=({updateDataStream:l,deleteDataStream:s,createDataStream:c})=>{const d=f(),{isVm:u}=y(),{clearStore:p}=Da(),{dataStreams:h,selectedStreamName:g,setSelectedStreamName:m}=Be(),b=i(null),[v,C]=r(!1),[S,w]=r(""),[x,k]=r(""),[T,$]=r(!1),[E,I]=r(!1),[N,A]=r(!1),[O,D]=r(""),[R,P]=r(!1);io(b,()=>C(!1)),n(()=>{v||w("")},[v]);const F=a(()=>{if(!S)return h;const e=S.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,S]),L=v?vi:yi;return u?null:e(o,{children:[e(Sh,{ref:b,children:[e(wh,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>C(e=>!e),children:[t(qi,{size:24}),t(Q,{size:te.S,weight:500,nowrap:!0,children:vh(g)}),t(Fe,{label:h.length,status:pt.Unknown,textSize:te.XXXS}),t(L,{size:20,fill:d.v2.colors.silver[200]})]}),v&&e(xh,{children:[t(kh,{children:t(Kt,{value:S,onChange:w,placeholder:yh,width:"100%"})}),t(Th,{children:0===F.length?t($h,{children:t(Q,{size:te.XS,color:ee.Secondary,children:Ch})}):F.map(({name:o})=>{const n=o===Ra;return e($h,{"data-id":`stream-row-${o}`,$selected:o===g,onClick:()=>(e=>{e!==g&&(p(),m(e)),C(!1)})(o),children:[t(Eh,{children:t(Q,{size:te.XS,nowrap:!0,children:o})}),e(Ih,{children:[t(ot,{"data-id":`stream-edit-${o}`,icon:pi,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),k(o),$(!0)}}),!n&&t(ot,{"data-id":`stream-delete-${o}`,icon:ii,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),P(!0)}})]})]},`stream-${o}`)})}),t(Nh,{children:t(ne,{"data-id":"add-stream-trigger",variant:ie.Secondary,size:ae.S,leftIcon:li,label:`${St.NEW} ${Me.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),A(!0),I(!0)}})})]})]}),N&&t(Bl,{defaultExcludeName:g,children:t(Zd,{isOpen:E,onClose:()=>I(!1),onCloseEnd:()=>A(!1),createDataStream:c})}),x&&t(Bl,{children:t(Qd,{isOpen:T,dataStreamName:x,onClose:()=>$(!1),onCloseEnd:()=>k(""),updateDataStream:l})}),t(fl,{target:`${Me.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:R,onClose:()=>P(!1),onApprove:async()=>{O&&await s(O)}})]})},Oh=v`
877
+ `,Fh=({updateDataStream:l,deleteDataStream:s,createDataStream:c})=>{const d=f(),{isVm:u}=y(),{clearStore:p}=Da(),{dataStreams:h,selectedStreamName:g,setSelectedStreamName:m}=Me(),b=i(null),[v,C]=r(!1),[S,w]=r(""),[x,k]=r(""),[T,$]=r(!1),[E,I]=r(!1),[N,A]=r(!1),[O,D]=r(""),[R,P]=r(!1);ro(b,()=>C(!1)),n(()=>{v||w("")},[v]);const F=a(()=>{if(!S)return h;const e=S.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,S]),L=v?vi:yi;return u?null:e(o,{children:[e($h,{ref:b,children:[e(Eh,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>C(e=>!e),children:[t(Zi,{size:24}),t(Q,{size:te.S,weight:500,nowrap:!0,children:xh(g)}),t(Fe,{label:h.length,status:pt.Unknown,textSize:te.XXXS}),t(L,{size:20,fill:d.v2.colors.silver[200]})]}),v&&e(Ih,{children:[t(Nh,{children:t(Kt,{value:S,onChange:w,placeholder:kh,width:"100%"})}),t(Ah,{children:0===F.length?t(Oh,{children:t(Q,{size:te.XS,color:ee.Secondary,children:Th})}):F.map(({name:o})=>{const n=o===Ra;return e(Oh,{"data-id":`stream-row-${o}`,$selected:o===g,onClick:()=>(e=>{e!==g&&(p(),m(e)),C(!1)})(o),children:[t(Dh,{children:t(Q,{size:te.XS,nowrap:!0,children:o})}),e(Rh,{children:[t(ot,{"data-id":`stream-edit-${o}`,icon:pi,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),k(o),$(!0)}}),!n&&t(ot,{"data-id":`stream-delete-${o}`,icon:ii,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),P(!0)}})]})]},`stream-${o}`)})}),t(Ph,{children:t(ne,{"data-id":"add-stream-trigger",variant:ie.Secondary,size:ae.S,leftIcon:li,label:`${St.NEW} ${Be.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),A(!0),I(!0)}})})]})]}),N&&t(Vl,{defaultExcludeName:g,children:t(nu,{isOpen:E,onClose:()=>I(!1),onCloseEnd:()=>A(!1),createDataStream:c})}),x&&t(Vl,{children:t(au,{isOpen:T,dataStreamName:x,onClose:()=>$(!1),onCloseEnd:()=>k(""),updateDataStream:l})}),t(vl,{target:`${Be.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:R,onClose:()=>P(!1),onApprove:async()=>{O&&await s(O)}})]})},Lh=v`
865
878
  0% {
866
879
  background-position: 200% 50%;
867
880
  }
868
881
  100% {
869
882
  background-position: 0% 50%;
870
883
  }
871
- `,Dh=m.div`
884
+ `,_h=m.div`
872
885
  display: flex;
873
886
  align-items: center;
874
887
  justify-content: space-evenly;
@@ -879,44 +892,44 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
879
892
 
880
893
  background: ${({theme:e})=>`linear-gradient(90deg, ${e.v2.colors.pink[500]} 0%, ${e.v2.colors.purple[400]} 25%, ${e.v2.colors.green[500]} 50%, ${e.v2.colors.purple[400]} 75%, ${e.v2.colors.pink[500]} 100%)`};
881
894
  background-size: 200% 100%;
882
- animation: ${Oh} 15s linear infinite;
883
- `,Rh=[wi,xi,fi,bi],Ph=({columnsMaxHeight:o,metrics:n,refetchSources:a,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:r,updateDataStream:c,deleteDataStream:d,createDataStream:u,...p})=>{const h=f();return e(ua,{children:[e(Ye,{customTitle:t(Ah,{updateDataStream:c,deleteDataStream:d,createDataStream:u}),customSearch:t(Fp,{}),filters:t($p,{}),children:[t(Dh,{children:Rh.map((o,n)=>e(s,{children:[t(o,{size:24}),n<Rh.length-1&&t(mi,{fill:h.v2.colors.white[500]+qe["020"],size:24})]},o.name))}),t(ah,{height:o,metrics:n,refetchSources:a,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:r})]}),t(ih,{...p}),t(bh,{restartWorkloads:p.restartWorkloads,persistSources:p.persistSources})]})};var Fh;!function(e){e.Gateway="gateway",e.Node="node"}(Fh||(Fh={}));const Lh=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Bi,size:ae.S,variant:ie.Text,onClick:o,disabled:l}}),n&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(Pa,{icon:Zi,title:"Collectors Pipeline"}),t(Fa,{actions:r})]})},_h=({pod:o,getExtendedPodInfo:i,onClose:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null);n(()=>{o?i(o.namespace,o.name).then(e=>d(e??null)):d(null)},[o]);const u=a(()=>[{id:Bo(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Bo(),title:"Status",badge:{status:La(c?.status),label:c?.status??"-"}}],[c]),p=a(()=>c?.containers?.map(e=>({id:Bo(),items:[{id:Bo(),title:"Container",label:e.name??"-"},{id:Bo(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Bo(),title:"Ready",badge:{status:e.ready?we.Success:we.Error,leftIcon:e.ready?si:ci,label:e.ready?"True":"False",invertColors:!0}},{id:Bo(),title:"Started",badge:{status:e.started?we.Success:we.Error,leftIcon:e.started?si:ci,label:e.started?"True":"False",invertColors:!0}},{id:Bo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Bo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Bo(),title:Me.RESTARTS,label:e.restarts.toString()},{id:Bo(),title:"State Reason",label:e.stateReason??"-"},{id:Bo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Bo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(q,{isOpen:!!o,header:{icon:$i,title:"Pod Information",onClose:l},children:c?e(xt,{bgTint:"1000",richTitle:{icon:$i,title:c.name,withCopy:!0},children:[t(xt,{bgTint:"900",cellsPerRow:2,items:u}),e(xt,{bgTint:"900",richTitle:{icon:Gi,title:"Kubectl Commands"},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Gt,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(Gt,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(Gt,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(xt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:p.length?p.map(({id:e,items:o})=>t(xt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(me,{title:"No containers",subTitle:"Pod has no containers"})}),t(vl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})})})};var zh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(zh||(zh={}));const Mh=[{key:zh.PodName,label:"Pod Name"},{key:zh.Status,label:"Status"},{key:zh.Restarts,label:Me.RESTARTS},{key:zh.NodeName,label:"Node Name"},{key:zh.Age,label:"Age"},{key:zh.DockerImage,label:"Collector Version"}],Bh=({isLoading:o,tableRowsMaxHeight:n,pods:i,getExtendedPodInfo:l})=>{const s=f(),{formatTimeAgo:c}=Lt(),[d,u]=r(null),p=a(()=>i.map(o=>({onClick:()=>u(o),cells:[{key:zh.PodName,rawValue:o.name},{key:zh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Fe,{status:La(e),label:e});var e}},{key:zh.Restarts,rawValue:o.restartsCount.toString()},{key:zh.NodeName,rawValue:o.nodeName},{key:zh.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(Q,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?we.Error:we.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?we.Error:we.Success;return e(oe,{$gap:4,children:[t(Ie,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()}, Dropped: ${n.metricsDroppedRps.toLocaleString()}`,children:t(Fe,{status:l,label:`Receiver ${i}%`,leftIcon:l===we.Error?Qi:el,useSecondaryTone:!0,invertColors:!0})}),t(Ie,{text:`Success: ${n.exporterSuccessRps.toLocaleString()}, Failed: ${n.exporterFailedRps.toLocaleString()}`,children:t(Fe,{status:c,label:`Exporter ${s}%`,leftIcon:c===we.Error?Qi:el,useSecondaryTone:!0,invertColors:!0})})]})}},{key:zh.Age,rawValue:c(o.creationTimestamp)},{key:zh.DockerImage,rawValue:o.image}]})),[i,s]);return e(xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:$i,title:"Pods"},children:[t(mo,{variant:fo.Data,maxHeight:n,isLoading:o,columns:Mh,rows:p}),t(_h,{pod:d,getExtendedPodInfo:l,onClose:()=>u(null)})]})},Xh=({isOpen:e,onClose:o,title:n,yaml:a})=>t(q,{isOpen:e,header:{icon:tl,title:n,onClose:o},children:t(vl,{yaml:a,defaultOpen:!0})}),Vh=e=>{switch(e){case _a.Healthy:return"All desired replicas are updated, available, and ready";case _a.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case _a.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case _a.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case _a.Down:return"No available replicas";case _a.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Uh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Uh||(Uh={}));const Hh=m.div`
895
+ animation: ${Lh} 15s linear infinite;
896
+ `,zh=[wi,xi,fi,bi],Bh=({metrics:o,refetchSources:n,refetchDestinations:a,refetchActions:i,refetchInstrumentationRules:l,updateDataStream:r,deleteDataStream:c,createDataStream:d,...u})=>{const p=f();return e(ua,{children:[e(Ye,{fullHeight:!0,customTitle:t(Fh,{updateDataStream:r,deleteDataStream:c,createDataStream:d}),customSearch:t(Mp,{}),filters:t(Op,{}),children:[t(_h,{children:zh.map((o,n)=>e(s,{children:[t(o,{size:24}),n<zh.length-1&&t(mi,{fill:p.v2.colors.white[500]+qe["020"],size:24})]},o.name))}),t(ch,{metrics:o,refetchSources:n,refetchDestinations:a,refetchActions:i,refetchInstrumentationRules:l})]}),t(dh,{...u}),t(wh,{restartWorkloads:u.restartWorkloads,persistSources:u.persistSources})]})};var Mh;!function(e){e.Gateway="gateway",e.Node="node"}(Mh||(Mh={}));const Xh=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:Mo(),type:Wt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Xi,size:ae.S,variant:ie.Text,onClick:o,disabled:l}}),n&&e.push({id:Mo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(Pa,{icon:Qi,title:"Collectors Pipeline"}),t(Fa,{actions:r})]})},Vh=({pod:o,getExtendedPodInfo:i,onClose:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null);n(()=>{o?i(o.namespace,o.name).then(e=>d(e??null)):d(null)},[o]);const u=a(()=>[{id:Mo(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Mo(),title:"Status",badge:{status:La(c?.status),label:c?.status??"-"}}],[c]),p=a(()=>c?.containers?.map(e=>({id:Mo(),items:[{id:Mo(),title:"Container",label:e.name??"-"},{id:Mo(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Mo(),title:"Ready",badge:{status:e.ready?we.Success:we.Error,leftIcon:e.ready?si:ci,label:e.ready?"True":"False",invertColors:!0}},{id:Mo(),title:"Started",badge:{status:e.started?we.Success:we.Error,leftIcon:e.started?si:ci,label:e.started?"True":"False",invertColors:!0}},{id:Mo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Mo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Mo(),title:Be.RESTARTS,label:e.restarts.toString()},{id:Mo(),title:"State Reason",label:e.stateReason??"-"},{id:Mo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Mo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(q,{isOpen:!!o,header:{icon:$i,title:"Pod Information",onClose:l},children:c?e(xt,{bgTint:"1000",richTitle:{icon:$i,title:c.name,withCopy:!0},children:[t(xt,{bgTint:"900",cellsPerRow:2,items:u}),e(xt,{bgTint:"900",richTitle:{icon:Fi,title:Be.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(jt,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(jt,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(jt,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(xt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:p.length?p.map(({id:e,items:o})=>t(xt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(me,{title:"No containers",subTitle:"Pod has no containers"})}),t(Cl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})})})};var Uh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(Uh||(Uh={}));const Hh=e=>{const t=[{key:Uh.PodName,label:"Pod Name"},{key:Uh.Status,label:"Status"},{key:Uh.Restarts,label:Be.RESTARTS},{key:Uh.NodeName,label:"Node Name"},{key:Uh.Age,label:"Age"},{key:Uh.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Uh.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Gh=({isLoading:o,pods:n,getExtendedPodInfo:i,withSpanDropRate:l})=>{const s=f(),{formatTimeAgo:c}=Lt(),[d,u]=r(null),p=a(()=>n.map(o=>({onClick:()=>u(o),cells:[{key:Uh.PodName,rawValue:o.name},{key:Uh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Fe,{status:La(e),label:e});var e}},{key:Uh.Restarts,rawValue:o.restartsCount.toString()},{key:Uh.NodeName,rawValue:o.nodeName},{key:Uh.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(Q,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?we.Error:we.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?we.Error:we.Success;return e(oe,{$gap:4,children:[t(Ie,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Fe,{status:l,label:`Receiver ${i}%`,leftIcon:l===we.Error?el:tl,useSecondaryTone:!0,invertColors:!0})}),t(Ie,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Fe,{status:c,label:`Exporter ${s}%`,leftIcon:c===we.Error?el:tl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Uh.Age,rawValue:c(o.creationTimestamp)},{key:Uh.DockerImage,rawValue:o.image}]})),[n,s]);return e(xt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:$i,title:"Pods"},children:[t(mo,{variant:fo.Data,isLoading:o,columns:Hh(l),rows:p}),t(Vh,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)})]})},jh=({isOpen:e,onClose:o,title:n,yaml:a})=>t(q,{isOpen:e,header:{icon:ol,title:n,onClose:o},children:t(Cl,{yaml:a,defaultOpen:!0})}),Wh=e=>{switch(e){case _a.Healthy:return"All desired replicas are updated, available, and ready";case _a.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case _a.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case _a.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case _a.Down:return"No available replicas";case _a.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Kh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Kh||(Kh={}));const Yh=m.div`
884
897
  flex: 0.5;
885
898
  padding: 12px;
886
899
  border-radius: 12px;
887
900
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
888
- `,jh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null),u=a(()=>(e=>{switch(e){case Fh.Gateway:return"Deployment";case Fh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const a={status:pt.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case Fh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Fh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:we.Info,label:"Rollout in progress",rightIcon:Ni,useSecondaryTone:!0}:l?{status:pt.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,i,s),[n,i,o,s]),h=a(()=>((e,t,o,n)=>{let a=n?we.Info:pt.Unknown,i=n?"Loading":_a.Unknown,l=n?"Fetching data...":Vh(_a.Unknown);switch(e){case Fh.Gateway:a=t?.status?La(t?.status):a,i=t?.status??i,l=t?.status?Vh(t.status):l;break;case Fh.Node:a=o?.status?La(o?.status):a,i=o?.status??i,l=o?.status?Vh(o.status):l}return{status:a,title:i,description:l}})(o,n,i,l),[n,i,o,l]),g=a(()=>((e,t,o)=>{switch(e){case Fh.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Fh.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),m=a(()=>((e,t,o,n)=>{switch(e){case Fh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case Fh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,i,l),[n,i,o,l]),f=a(()=>(o===Fh.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Fh.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:tl,title:u,badge:p},actions:[{id:Bo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Uh.ManifestYaml,label:u,icon:ol},{id:Uh.ConfigMapYaml,label:"ConfigMap",icon:ol}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(za,{...h})}),g.map(e=>t(Hh,{children:t("div",{children:t(Ma,{...e})})},e.title)),m.map(e=>t(Ba,{...e},e.title))]}),t(Xh,{isOpen:c===Uh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(Xh,{isOpen:c===Uh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Gh=[{value:Fh.Gateway,label:"Gateway"},{value:Fh.Node,label:"Node Collector"}],Wh=({minSupportedVersion:o=0,tableRowsMaxHeight:i,getGatewayInfo:s,getGatewayPods:c,getNodeCollectorInfo:d,getNodeCollectorPods:u,getExtendedPodInfo:p})=>{const{isVersionSupported:h,version:g}=y(o),[m,f]=r(!1),[b,v]=r(Fh.Gateway),[C,S]=r(null),[w,x]=r([]),[k,T]=r(null),[$,E]=r([]),I=l(async()=>{f(!0);try{switch(b){case Fh.Gateway:S(await s()??null),x(await c()??[]);break;case Fh.Node:T(await d()??null),E(await u()??[])}}catch(e){}f(!1)},[b]);n(()=>{I()},[I]);const N=a(()=>b===Fh.Gateway?w:$,[w,$,b]);return e(ua,{children:[t(Lh,{disabled:!h,loading:m,onClickDownloadDiagnose:void 0,onClickRefresh:I}),e(Xa,{children:[e(V,{children:[t(le,{variant:ho.Underline,size:be.L,options:Gh,selected:b,setSelected:v}),t(jh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:k,isLoading:m})]}),t(Bh,{isLoading:m,tableRowsMaxHeight:i,pods:N,getExtendedPodInfo:p}),!h&&t(Sl,{minSupportedVersion:o,currentVersion:g||""})]})]})},Kh=m.div`
901
+ `,Jh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null),u=a(()=>(e=>{switch(e){case Mh.Gateway:return"Deployment";case Mh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const a={status:pt.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case Mh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Mh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:we.Info,label:"Rollout in progress",rightIcon:Ni,useSecondaryTone:!0}:l?{status:pt.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,i,s),[n,i,o,s]),h=a(()=>((e,t,o,n)=>{let a=n?we.Info:pt.Unknown,i=n?"Loading":_a.Unknown,l=n?"Fetching data...":Wh(_a.Unknown);switch(e){case Mh.Gateway:a=t?.status?La(t?.status):a,i=t?.status??i,l=t?.status?Wh(t.status):l;break;case Mh.Node:a=o?.status?La(o?.status):a,i=o?.status??i,l=o?.status?Wh(o.status):l}return{status:a,title:i,description:l}})(o,n,i,l),[n,i,o,l]),g=a(()=>((e,t,o)=>{switch(e){case Mh.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Mh.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),m=a(()=>((e,t,o,n)=>{switch(e){case Mh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case Mh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,i,l),[n,i,o,l]),f=a(()=>(o===Mh.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Mh.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:ol,title:u,badge:p},actions:[{id:Mo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Kh.ManifestYaml,label:u,icon:nl},{id:Kh.ConfigMapYaml,label:"ConfigMap",icon:nl}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(za,{...h})}),g.map(e=>t(Yh,{children:t("div",{children:t(Ba,{...e})})},e.title)),m.map(e=>t(Ma,{...e},e.title))]}),t(jh,{isOpen:c===Kh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(jh,{isOpen:c===Kh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},qh=[{value:Mh.Gateway,label:"Gateway"},{value:Mh.Node,label:"Node Collector"}],Zh=({minSupportedVersion:o=0,effectiveConfig:i,getGatewayInfo:s,getGatewayPods:c,getNodeCollectorInfo:d,getNodeCollectorPods:u,getExtendedPodInfo:p})=>{const{isVersionSupported:h,version:g}=y(o),[m,f]=r(!1),[b,v]=r(Mh.Gateway),[C,S]=r(null),[w,x]=r([]),[k,T]=r(null),[$,E]=r([]),I=l(async e=>{e?.silent||f(!0);try{switch(b){case Mh.Gateway:S(await s()??null),x(await c()??[]);break;case Mh.Node:T(await d()??null),E(await u()??[])}}catch(e){}e?.silent||f(!1)},[b]),N=l(()=>I(),[I]);n(()=>{I();const e=setInterval(()=>I({silent:!0}),3e3);return()=>clearInterval(e)},[I]);const A=a(()=>b===Mh.Gateway?w:$,[w,$,b]);return e(ua,{children:[t(Xh,{disabled:!h,loading:m,onClickDownloadDiagnose:void 0,onClickRefresh:N}),e(Xa,{children:[e(V,{children:[t(le,{variant:ho.Underline,size:be.L,options:qh,selected:b,setSelected:v}),t(Jh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:k,isLoading:m})]}),t(Gh,{isLoading:m,pods:A,getExtendedPodInfo:p,withSpanDropRate:!1===i?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!h&&t(xl,{minSupportedVersion:o,currentVersion:g||""})]})]})},Qh=m.div`
889
902
  display: inline-flex;
890
903
  align-items: center;
891
904
  min-width: 0;
892
905
  overflow: hidden;
893
906
  white-space: pre;
894
907
  text-overflow: ellipsis;
895
- `,Yh=m.div`
908
+ `,eg=m.div`
896
909
  display: flex;
897
910
  flex-direction: column;
898
911
  gap: 4px;
899
912
  min-width: 0;
900
913
  flex: 1;
901
914
  opacity: ${({$disabled:e})=>e?.4:1};
902
- `,Jh=m(oe)`
915
+ `,tg=m(oe)`
903
916
  flex-shrink: 0;
904
917
  gap: 6px;
905
918
  align-items: center;
906
919
  min-height: 22px;
907
- `;const qh=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Zh=[{value:"all",label:Ua},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Qh=({title:o,items:n,isLoading:i,showTypeFilter:s,tableRowsMaxHeight:c,onRuleClick:d,onCreateRule:u,onEditRule:p,onDeleteRule:h})=>{const g=f(),[m,b]=r(""),[v,y]=r("all"),C=a(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,v,s);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,m),e},[n,v,s,m]),w=a(()=>C.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(g,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(Yh,{$disabled:o.disabled,children:[t(Kh,{children:t(S,{parts:o.summary})}),o.name&&t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(Jh,{children:[o.disabled&&t(Fe,{label:Va,textSize:te.XXXS,backgroundColor:g.v2.colors.grey[700],textColor:g.v2.colors.grey[300]}),o.typeBadge&&n&&t(Fe,{label:o.typeBadge,textSize:te.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>d(o)}}),[C,g,d]),x=a(()=>{const e=e=>t(ui,{...e,fill:g.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[g]),k=l(e=>{const t=w.indexOf(e);if(t<0)return[];const o=C[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:Co,leftIcon:pi,onClick:()=>p(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:x,onClick:()=>h(o.ruleId,o.samplingId)}]:[]},[w,C,p,h,x]);return t(Ye,{fullHeight:!0,richTitle:{icon:Vi,title:o,badge:{label:n.length,backgroundColor:g.v2.colors.silver[600],textColor:g.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:b,placeholder:"Search..",width:"500px",...s?{segment:{"data-id":"sampling-segment-type-filter",options:Zh,selected:v,setSelected:y}}:{}},children:t(mo,{variant:fo.Pretty,hideHeader:!0,maxHeight:c,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:Ha,subTitle:Wa(m)}:{hideIcon:!0,title:Ga,button:{label:ja,onClick:u}},columns:qh,rows:w,getRowActions:k})})},eg=({workloads:o,samplingRules:s,k8sHealthProbesConfig:c,loading:d,docsUrl:u,tableRowsMaxHeight:p,fetchSamplingRules:h,createNoisyOperationRule:g,updateNoisyOperationRule:m,createHighlyRelevantOperationRule:f,updateHighlyRelevantOperationRule:b,createCostReductionRule:v,updateCostReductionRule:y,deleteSamplingRule:C,updateK8sHealthProbesConfig:S})=>{const k=a(()=>o.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[o]),X=a(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[U,H]=r(T.Noisy),[j,G]=r(null),[W,K]=r(!1),[Y,J]=r(!1),[q,Z]=r(null),[Q,ee]=r(!1),[te,re]=r(!1),[se,ce]=r(!1),[de,ue]=r(!1),pe=i(!1);n(()=>{pe.current||d||(pe.current=!0,0===s.length&&ue(!0))},[d,s]);const he=a(()=>w(c),[c]),ge=a(()=>$(s),[s]),me=a(()=>x(ge?.rule??null),[ge]),fe=a(()=>E(s),[s]),ve=a(()=>I(fe?.rule??null),[fe]),ye=i(j);ye.current=j,n(()=>{const e=ye.current;if(!e)return;const t=N(s,e);t?G(t):(G(null),K(!1))},[s]);const Ce=a(()=>{const e=new Set;return ge&&e.add(ge.rule.ruleId),fe&&e.add(fe.rule.ruleId),e},[ge,fe]),xe=a(()=>A(s,U,Ce),[s,U,Ce]),ke=l(()=>J(!0),[]),Te=l(()=>J(!1),[]),$e=l(()=>ue(!1),[]),Ee=l(async e=>{const t=s[0]?.id??"default";switch(L[U]){case"noisy":await g(t,R(e));break;case"highlyRelevant":await f(t,D(e));break;case"costReduction":await v(t,O(e))}J(!1)},[s,U,g,f,v]),Ie=l(e=>{const t=P(s,e);t&&(K(!1),G(t))},[s]),Ne=l(()=>{G(null),K(!1)},[]),Ae=l((e,t)=>{const o=j;if(o&&o.rule.ruleId===e&&o.samplingId===t)K(!0),G({...o});else for(const o of s){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return K(!0),void G({category:n.category,rule:n.rule,samplingId:t,summary:F(n.category,n.rule)})}},[j,s]),Oe=l(async(e,t,o)=>{const n=j?.category;if(n){switch(n){case"noisy":await m(o,t,R(e));break;case"highlyRelevant":await b(o,t,D(e));break;case"costReduction":await y(o,t,O(e))}K(!1)}},[j,m,b,y]),De=l((e,t)=>{Z({ruleId:e,samplingId:t})},[]),Re=l(async()=>{if(!q)return;const{ruleId:e,samplingId:t}=q,o=j?.category||L[U];await C(t,e,o),G(null),K(!1),Z(null)},[q,j,U,C]),Pe=l(()=>Z(null),[]),Fe=l(async(e,t)=>{await S(e,t),ee(!1)},[S]),Le=l(async e=>{const t=s[0]?.id??"default",o=ge;o?await b(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await f(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),re(!1)},[s,ge,f,b]),_e=l(async(e,t)=>{const o=s[0]?.id??"default",n=fe;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await v(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),ce(!1)},[s,fe,v,y]),Me=l(e=>{const t=L[U];let o=null;switch(t){case"noisy":{const n=R(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=D(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=O(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Ka,ruleId:o}:null},[s,U]),Be=l(e=>{const t=j?.category,o=j?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const a=R(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}case"highlyRelevant":{const a=D(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},o);break}case"costReduction":{const a=O(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}}return n?{message:Ka,ruleId:n}:null},[s,j]),Ve=l(e=>{J(!1);for(const t of s){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return K(!0),void G({category:o.category,rule:o.rule,samplingId:t.id,summary:F(o.category,o.rule)})}},[s]),Ue=a(()=>{const e=[];return u&&e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ya,leftIcon:di,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ja,leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:h,loading:d}}),e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:qa,rightIcon:li,size:ae.S,variant:ie.Primary,onClick:ke}}),e},[u,h,d,ke]);return e(ua,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Pa,{icon:Vi,title:Qa,subTitle:Za}),t(Fa,{actions:Ue})]}),e(V,{$gap:12,children:[t(le,{variant:ho.Underline,size:be.L,options:z,selected:U,setSelected:H}),e(oe,{$justifyContent:"space-between",children:[t(Se,{status:we.Default,message:M[U]}),u&&t(ne,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:di,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")})]}),U===T.Noisy?t(il,{title:Ge,summary:he,onEdit:()=>ee(!0)}):U===T.HighlyRelevant?t(il,{title:Xe,summary:me,onEdit:()=>re(!0)}):U===T.CostReduction?t(il,{title:He,summary:ve,onEdit:()=>ce(!0)}):null,t(Qh,{title:B[U],items:xe,isLoading:d,showTypeFilter:U===T.HighlyRelevant,tableRowsMaxHeight:p,onRuleClick:Ie,onCreateRule:ke,onEditRule:Ae,onDeleteRule:De})]}),t(Vd,{formType:Il.View,data:j,defaultEditMode:W,onClose:Ne,onDelete:De,onSaveEdit:Oe,sourceOptions:k,namespaceOptions:X,validateForm:Be,onNavigateToDuplicate:Ve}),t(Vd,{formType:Il.Create,isOpen:Y,category:L[U],onClose:Te,onSubmit:Ee,sourceOptions:k,namespaceOptions:X,validateForm:Me,onNavigateToDuplicate:Ve}),t(Vd,{formType:Il.EditAutoNoisy,isOpen:Q,enabled:c?.enabled??!1,keepPercentage:c?.keepPercentage??0,onClose:()=>ee(!1),onSave:Fe}),t(Vd,{formType:Il.EditAutoHighlyRelevant,isOpen:te,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:Le}),t(Vd,{formType:Il.EditAutoCostReduction,isOpen:se,enabled:!!fe&&!fe.rule.disabled,dropPercentage:fe?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:_e}),t(ze,{title:ni,description:oi,isOpen:!!q,onClose:Pe,denyButton:{label:ti,variant:ie.Secondary,onClick:Pe},approveButton:{label:ei,variant:ie.Primary,onClick:()=>{Re(),Pe()}}}),t(qu,{isOpen:de,onClose:$e,k8sHealthProbesConfig:c,samplingId:s[0]?.id,docsUrl:u,updateK8sHealthProbesConfig:S,createHighlyRelevantOperationRule:f,createCostReductionRule:v})]})},tg=m.div`
920
+ `;const og=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],ng=[{value:"all",label:Ua},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],ag=({title:o,items:n,isLoading:i,showTypeFilter:s,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=f(),[g,m]=r(""),[b,v]=r("all"),y=a(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,b,s);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,g),e},[n,b,s,g]),C=a(()=>y.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(eg,{$disabled:o.disabled,children:[t(Qh,{children:t(S,{parts:o.summary})}),o.name&&t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(tg,{children:[o.disabled&&t(Fe,{label:Va,textSize:te.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Fe,{label:o.typeBadge,textSize:te.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),w=a(()=>{const e=e=>t(ui,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:Co,leftIcon:pi,onClick:()=>u(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:w,onClick:()=>p(o.ruleId,o.samplingId)}]:[]},[C,y,u,p,w]);return t(Ye,{fullHeight:!0,richTitle:{icon:Hi,title:o,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:m,placeholder:"Search..",width:"500px",...s?{segment:{"data-id":"sampling-segment-type-filter",options:ng,selected:b,setSelected:v}}:{}},children:t(mo,{variant:fo.Pretty,hideHeader:!0,isLoading:i,noDataProps:g.trim()?{hideIcon:!0,title:Ha,subTitle:Wa(g)}:{hideIcon:!0,title:ja,button:{label:Ga,onClick:d}},columns:og,rows:C,getRowActions:x})})},ig=({workloads:o,samplingRules:s,k8sHealthProbesConfig:c,loading:d,docsUrl:u,fetchSamplingRules:p,createNoisyOperationRule:h,updateNoisyOperationRule:g,createHighlyRelevantOperationRule:m,updateHighlyRelevantOperationRule:f,createCostReductionRule:b,updateCostReductionRule:v,deleteSamplingRule:y,updateK8sHealthProbesConfig:C})=>{const S=a(()=>o.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[o]),k=a(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[X,U]=r(T.Noisy),[H,G]=r(null),[j,W]=r(!1),[K,Y]=r(!1),[J,q]=r(null),[Z,Q]=r(!1),[ee,te]=r(!1),[re,se]=r(!1),[ce,de]=r(!1),ue=i(!1);n(()=>{ue.current||d||(ue.current=!0,0===s.length&&de(!0))},[d,s]);const pe=a(()=>w(c),[c]),he=a(()=>$(s),[s]),ge=a(()=>x(he?.rule??null),[he]),me=a(()=>E(s),[s]),fe=a(()=>I(me?.rule??null),[me]),ve=i(H);ve.current=H,n(()=>{const e=ve.current;if(!e)return;const t=N(s,e);t?G(t):(G(null),W(!1))},[s]);const ye=a(()=>{const e=new Set;return he&&e.add(he.rule.ruleId),me&&e.add(me.rule.ruleId),e},[he,me]),Ce=a(()=>A(s,X,ye),[s,X,ye]),xe=l(()=>Y(!0),[]),ke=l(()=>Y(!1),[]),Te=l(()=>de(!1),[]),$e=l(async e=>{const t=s[0]?.id??"default";switch(L[X]){case"noisy":await h(t,R(e));break;case"highlyRelevant":await m(t,D(e));break;case"costReduction":await b(t,O(e))}Y(!1)},[s,X,h,m,b]),Ee=l(e=>{const t=P(s,e);t&&(W(!1),G(t))},[s]),Ie=l(()=>{G(null),W(!1)},[]),Ne=l((e,t)=>{const o=H;if(o&&o.rule.ruleId===e&&o.samplingId===t)W(!0),G({...o});else for(const o of s){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return W(!0),void G({category:n.category,rule:n.rule,samplingId:t,summary:F(n.category,n.rule)})}},[H,s]),Ae=l(async(e,t,o)=>{const n=H?.category;if(n){switch(n){case"noisy":await g(o,t,R(e));break;case"highlyRelevant":await f(o,t,D(e));break;case"costReduction":await v(o,t,O(e))}W(!1)}},[H,g,f,v]),Oe=l((e,t)=>{q({ruleId:e,samplingId:t})},[]),De=l(async()=>{if(!J)return;const{ruleId:e,samplingId:t}=J,o=H?.category||L[X];await y(t,e,o),G(null),W(!1),q(null)},[J,H,X,y]),Re=l(()=>q(null),[]),Pe=l(async(e,t)=>{await C(e,t),Q(!1)},[C]),Fe=l(async e=>{const t=s[0]?.id??"default",o=he;o?await f(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await m(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),te(!1)},[s,he,m,f]),Le=l(async(e,t)=>{const o=s[0]?.id??"default",n=me;n?await v(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await b(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[s,me,b,v]),_e=l(e=>{const t=L[X];let o=null;switch(t){case"noisy":{const n=R(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=D(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=O(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Ka,ruleId:o}:null},[s,X]),Be=l(e=>{const t=H?.category,o=H?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const a=R(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}case"highlyRelevant":{const a=D(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},o);break}case"costReduction":{const a=O(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}}return n?{message:Ka,ruleId:n}:null},[s,H]),Me=l(e=>{Y(!1);for(const t of s){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return W(!0),void G({category:o.category,rule:o.rule,samplingId:t.id,summary:F(o.category,o.rule)})}},[s]),Ve=a(()=>{const e=[];return u&&e.push({id:Mo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ya,leftIcon:di,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Mo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ja,leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:p,loading:d}}),e.push({id:Mo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:qa,rightIcon:li,size:ae.S,variant:ie.Primary,onClick:xe}}),e},[u,p,d,xe]);return e(ua,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Pa,{icon:Hi,title:Qa,subTitle:Za}),t(Fa,{actions:Ve})]}),e(V,{$gap:12,$fullHeight:!0,children:[t(le,{variant:ho.Underline,size:be.L,options:z,selected:X,setSelected:U}),e(oe,{$justifyContent:"space-between",children:[t(Se,{status:we.Default,message:B[X]}),u&&t(ne,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:di,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")})]}),X===T.Noisy?t(sl,{title:je,summary:pe,onEdit:()=>Q(!0)}):X===T.HighlyRelevant?t(sl,{title:Xe,summary:ge,onEdit:()=>te(!0)}):X===T.CostReduction?t(sl,{title:He,summary:fe,onEdit:()=>se(!0)}):null,t(ag,{title:M[X],items:Ce,isLoading:d,showTypeFilter:X===T.HighlyRelevant,onRuleClick:Ee,onCreateRule:xe,onEditRule:Ne,onDeleteRule:Oe})]}),t(Wd,{formType:Al.View,data:H,defaultEditMode:j,onClose:Ie,onDelete:Oe,onSaveEdit:Ae,sourceOptions:S,namespaceOptions:k,validateForm:Be,onNavigateToDuplicate:Me}),t(Wd,{formType:Al.Create,isOpen:K,category:L[X],onClose:ke,onSubmit:$e,sourceOptions:S,namespaceOptions:k,validateForm:_e,onNavigateToDuplicate:Me}),t(Wd,{formType:Al.EditAutoNoisy,isOpen:Z,enabled:c?.enabled??!1,keepPercentage:c?.keepPercentage??0,onClose:()=>Q(!1),onSave:Pe}),t(Wd,{formType:Al.EditAutoHighlyRelevant,isOpen:ee,enabled:!!he&&!he.rule.disabled,onClose:()=>te(!1),onSave:Fe}),t(Wd,{formType:Al.EditAutoCostReduction,isOpen:re,enabled:!!me&&!me.rule.disabled,dropPercentage:me?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Le}),t(ze,{title:ni,description:oi,isOpen:!!J,onClose:Re,denyButton:{label:ti,variant:ie.Secondary,onClick:Re},approveButton:{label:ei,variant:ie.Primary,onClick:()=>{De(),Re()}}}),t(op,{isOpen:ce,onClose:Te,k8sHealthProbesConfig:c,samplingId:s[0]?.id,docsUrl:u,updateK8sHealthProbesConfig:C,createHighlyRelevantOperationRule:m,createCostReductionRule:b})]})},lg=m.div`
908
921
  display: flex;
909
922
  align-items: center;
910
923
  justify-content: space-between;
911
924
  padding: 0 12px;
912
- `,og=({disabled:o,loading:n,tabs:i,selectedTab:l,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=r(!1),h=a(()=>{const e=[];return c&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Reset",leftIcon:ii,size:ae.S,variant:ie.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(tg,{children:[e(oe,{$gap:12,$alignItems:"center",children:[t(Pa,{icon:Ti,title:"Odigos Settings"}),t(tt,{width:"350px",options:i,values:[l],setValues:e=>s(e[0]),disabled:o})]}),t(Fa,{actions:h}),t(ze,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:ie.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:ie.Primary,onClick:()=>{c?.(),p(!1)}}})]})},ng=m(oe)`
925
+ `,rg=({disabled:o,loading:n,tabs:i,selectedTab:l,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=r(!1),h=a(()=>{const e=[];return c&&e.push({id:Mo(),type:Wt.Button,buttonProps:{label:"Reset",leftIcon:ii,size:ae.S,variant:ie.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Mo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(lg,{children:[e(oe,{$gap:12,$alignItems:"center",children:[t(Pa,{icon:Ti,title:"Odigos Settings"}),t(tt,{width:"350px",options:i,values:[l],setValues:e=>s(e[0]),disabled:o})]}),t(Fa,{actions:h}),t(ze,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:ie.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:ie.Primary,onClick:()=>{c?.(),p(!1)}}})]})},sg=m(oe)`
913
926
  flex: 1;
914
927
  min-height: 0;
915
928
  width: 100%;
916
929
  align-self: stretch;
917
- `,ag=m(V)`
930
+ `,cg=m(V)`
918
931
  flex: 1;
919
932
  min-height: 0;
920
933
  height: 100%;
921
934
  overflow-y: auto;
922
- `,ig=e=>"general"===e.name?0:"advanced"===e.name?2:1,lg=({minSupportedVersion:o=0,pageHeightOffset:i=0,configYamls:l,configYamlsLoading:s,effectiveConfig:c,effectiveConfigLoading:d,refetch:u,factoryReset:p,onSave:h,saveLoading:g})=>{const{isVersionSupported:m,version:f,isEnterprise:b}=y(o),v=a(()=>{if(!c)return{};const{manifestYAML:e,provenance:t,...o}=c;return o},[c]),{formData:C,handleFormChange:S,getNestedValue:w,getFormDiff:x,isFormDirty:k}=$t(v);n(()=>{"{}"!==JSON.stringify(v)&&"{}"===JSON.stringify(C)&&S(void 0,void 0,v)},[v,C]);const T=a(()=>[...l].sort((e,t)=>ig(e)-ig(t)),[l]),$=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(c?.provenance),[c?.provenance]),E=a(()=>{const e=new Set;for(const t of l)for(const o of t.fields)o.componentType===It.Dropdown&&e.add(o.helmValuePath);return e},[l]),I=a(()=>l.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:w("formData",e.helmValuePath)}))),[l,C,w]),[N,A]=r(!1),O=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(x(v,C),E);await(h?.(e)),S(void 0,void 0,{})},D=a(()=>[{id:Bo(),type:Wt.Button,buttonProps:{"data-id":"settings-save",variant:ie.Primary,size:ae.S,label:"Save Changes",leftIcon:Ci,loading:g,onClick:()=>A(!0)}},{id:Bo(),type:Wt.Button,buttonProps:{"data-id":"settings-cancel",variant:ie.Secondary,size:ae.S,label:"Cancel",leftIcon:Si,onClick:()=>S(void 0,void 0,v)}}],[g,x,v,C,S]),R=a(()=>T.map(e=>({id:e.name,label:e.displayName})),[T]),P=a(()=>T.map(e=>e.name),[T]),{selectedSection:F,setSelectedSection:L,setSectionRef:_,setScrollContainerRef:z}=ai({sectionNames:P});return e(ua,{$heightOffset:i,$gap:12,children:[t(og,{disabled:!m,loading:s||d,tabs:R,selectedTab:F,setSelectedTab:L,onClickReset:p?()=>p().then(()=>u?.()):void 0,onClickRefresh:u?()=>u():void 0}),e(Xa,{children:[!m&&t(Sl,{minSupportedVersion:o,currentVersion:f||""}),t(pa,{isOpen:k,richTitle:{icon:Ti,title:"Config Settings"},actions:D}),t(ze,{isOpen:N,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>A(!1),denyButton:{label:"Keep editing",variant:ie.Secondary,onClick:()=>A(!1)},approveButton:{label:"Save changes",variant:ie.Primary,onClick:()=>{O(),A(!1)}}}),e(ng,{$gap:24,$alignItems:"stretch",children:[t(ag,{ref:z,$gap:24,$width:"100%",children:l.length?T.map(o=>t(Ye,{id:o.name,ref:e=>_(o.name,e),richTitle:{icon:Ti,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!b)return null;if(o.renderCondition&&!Ce(o.renderCondition,[],I))return null;const n=st(o.componentProps||"{}",{}),a=$[o.helmValuePath];return e(V,{$gap:4,children:[t(al,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?we.Warning:pt.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||g,value:w("formData",o.helmValuePath),setValue:e=>S(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(Se,{status:we.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):s?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(Ye,{richTitle:{icon:Ti,title:"Config Settings"},children:t(me,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(ag,{children:d&&!c?.manifestYAML?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(vl,{title:"Effective Config YAML",yaml:c?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})]})};export{Zr as AddActionDrawer,Tr as AddActionForm,Zd as AddDataStreamModal,ss as AddDestinationDrawer,Ir as AddDestinationForm,cs as AddRuleDrawer,Lr as AddRuleForm,Ns as AddSourceDrawer,np as CentralConnections,zr as DataStreamForm,_r as DataStreamMergeWarning,Os as EditActionDrawer,Ds as EditConfigDrawer,Qd as EditDataStreamModal,Ps as EditDestinationDrawer,Ls as EditRuleDrawer,Nd as EditSourceDrawer,Mr as EditSourceForm,ou as ONBOARDING_DONE_MODAL_ID,bp as Onboarding,nu as OnboardingDone,Ph as Overview,Wh as PipelineCollectors,dr as RegexTesterDrawer,qu as SamplingOnboardingModal,Vd as SamplingRuleDrawer,jr as SamplingRuleForm,eg as SamplingRules,lg as Settings,qd as SystemDrawer,Gh as TABS};
935
+ `,dg=e=>"general"===e.name?0:"advanced"===e.name?2:1,ug=({minSupportedVersion:o=0,configYamls:i,configYamlsLoading:l,effectiveConfig:s,effectiveConfigLoading:c,refetch:d,factoryReset:u,onSave:p,saveLoading:h})=>{const{isVersionSupported:g,version:m,isEnterprise:f}=y(o),b=a(()=>{if(!s)return{};const{manifestYAML:e,provenance:t,...o}=s;return o},[s]),{formData:v,handleFormChange:C,getNestedValue:S,getFormDiff:w,isFormDirty:x}=$t(b);n(()=>{"{}"!==JSON.stringify(b)&&"{}"===JSON.stringify(v)&&C(void 0,void 0,b)},[b,v]);const k=a(()=>[...i].sort((e,t)=>dg(e)-dg(t)),[i]),T=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(s?.provenance),[s?.provenance]),$=a(()=>{const e=new Set;for(const t of i)for(const o of t.fields)o.componentType===It.Dropdown&&e.add(o.helmValuePath);return e},[i]),E=a(()=>i.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:S("formData",e.helmValuePath)}))),[i,v,S]),[I,N]=r(!1),A=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(w(b,v),$);await(p?.(e)),C(void 0,void 0,{})},O=a(()=>[{id:Mo(),type:Wt.Button,buttonProps:{"data-id":"settings-save",variant:ie.Primary,size:ae.S,label:"Save Changes",leftIcon:Ci,loading:h,onClick:()=>N(!0)}},{id:Mo(),type:Wt.Button,buttonProps:{"data-id":"settings-cancel",variant:ie.Secondary,size:ae.S,label:"Cancel",leftIcon:Si,onClick:()=>C(void 0,void 0,b)}}],[h,w,b,v,C]),D=a(()=>k.map(e=>({id:e.name,label:e.displayName})),[k]),R=a(()=>k.map(e=>e.name),[k]),{selectedSection:P,setSelectedSection:F,setSectionRef:L,setScrollContainerRef:_}=ai({sectionNames:R});return e(ua,{$gap:12,children:[t(rg,{disabled:!g,loading:l||c,tabs:D,selectedTab:P,setSelectedTab:F,onClickReset:u?()=>u().then(()=>d?.()):void 0,onClickRefresh:d?()=>d():void 0}),e(Xa,{children:[!g&&t(xl,{minSupportedVersion:o,currentVersion:m||""}),t(pa,{isOpen:x,richTitle:{icon:Ti,title:"Config Settings"},actions:O}),t(ze,{isOpen:I,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>N(!1),denyButton:{label:"Keep editing",variant:ie.Secondary,onClick:()=>N(!1)},approveButton:{label:"Save changes",variant:ie.Primary,onClick:()=>{A(),N(!1)}}}),e(sg,{$gap:24,$alignItems:"stretch",children:[t(cg,{ref:_,$gap:24,$width:"100%",children:i.length?k.map(o=>t(Ye,{id:o.name,ref:e=>L(o.name,e),richTitle:{icon:Ti,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!f)return null;if(o.renderCondition&&!Ce(o.renderCondition,[],E))return null;const n=st(o.componentProps||"{}",{}),a=T[o.helmValuePath];return e(V,{$gap:4,children:[t(il,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?we.Warning:pt.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||h,value:S("formData",o.helmValuePath),setValue:e=>C(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(Se,{status:we.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):l?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(Ye,{richTitle:{icon:Ti,title:"Config Settings"},children:t(me,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(cg,{children:c&&!s?.manifestYAML?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(Cl,{title:"Effective Config YAML",yaml:s?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})]})};export{es as AddActionDrawer,Er as AddActionForm,nu as AddDataStreamModal,ds as AddDestinationDrawer,Ar as AddDestinationForm,us as AddRuleDrawer,zr as AddRuleForm,Os as AddSourceDrawer,sp as CentralConnections,Mr as DataStreamForm,Br as DataStreamMergeWarning,Rs as EditActionDrawer,Ps as EditConfigDrawer,au as EditDataStreamModal,Ls as EditDestinationDrawer,zs as EditRuleDrawer,Pd as EditSourceDrawer,Xr as EditSourceForm,ru as ONBOARDING_DONE_MODAL_ID,wp as Onboarding,su as OnboardingDone,Bh as Overview,Zh as PipelineCollectors,pr as RegexTesterDrawer,op as SamplingOnboardingModal,Wd as SamplingRuleDrawer,Wr as SamplingRuleForm,ig as SamplingRules,ug as Settings,ou as SystemDrawer,qh as TABS};