@odigos/ui-kit 0.0.249 → 0.0.251

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 (140) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/docs/api-context.md +687 -0
  3. package/lib/chunks/connections-scope-CneIqjeg.js +1 -0
  4. package/lib/chunks/flow-CQi_KYfs.js +49 -0
  5. package/lib/chunks/helpers-K1tnyqhm.js +19 -0
  6. package/lib/chunks/{index-CRKgHzab.js → index-Dv0RvKAp.js} +8 -8
  7. package/lib/chunks/source-instrument-form-context-C79I_5cH.js +1 -0
  8. package/lib/chunks/{ui-components-DODwSdKu.js → ui-components-BKrLf2tx.js} +214 -214
  9. package/lib/chunks/use-odigos-api-CDHW7ekQ.js +5 -0
  10. package/lib/chunks/vendor-BFqT13Me.js +1 -0
  11. package/lib/components/_v2/segment/index.d.ts +4 -2
  12. package/lib/components/v2.js +1 -1
  13. package/lib/components.js +1 -1
  14. package/lib/constants/strings/index.d.ts +7 -0
  15. package/lib/constants.js +1 -1
  16. package/lib/containers/_v2/_drawers/add-action-drawer/index.d.ts +0 -2
  17. package/lib/containers/_v2/_drawers/add-destination-drawer/form-column/index.d.ts +1 -5
  18. package/lib/containers/_v2/_drawers/add-destination-drawer/index.d.ts +0 -6
  19. package/lib/containers/_v2/_drawers/add-destination-drawer/lists-filters/index.d.ts +2 -1
  20. package/lib/containers/_v2/_drawers/add-rule-drawer/index.d.ts +0 -2
  21. package/lib/containers/_v2/_drawers/add-source-drawer/index.d.ts +1 -4
  22. package/lib/containers/_v2/_drawers/edit-action-drawer/index.d.ts +0 -3
  23. package/lib/containers/_v2/_drawers/edit-config-drawer/index.d.ts +1 -3
  24. package/lib/containers/_v2/_drawers/edit-destination-drawer/index.d.ts +0 -5
  25. package/lib/containers/_v2/_drawers/edit-rule-drawer/index.d.ts +0 -3
  26. package/lib/containers/_v2/_drawers/edit-source-drawer/debug/index.d.ts +1 -2
  27. package/lib/containers/_v2/_drawers/edit-source-drawer/index.d.ts +3 -14
  28. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/containers-card/index.d.ts +1 -2
  29. package/lib/containers/_v2/_drawers/edit-source-drawer/overview/index.d.ts +0 -2
  30. package/lib/containers/_v2/_drawers/edit-source-drawer/peers/index.d.ts +1 -6
  31. package/lib/containers/_v2/_drawers/edit-source-drawer/profiling/index.d.ts +1 -15
  32. package/lib/containers/_v2/_drawers/edit-source-drawer/sampling/index.d.ts +8 -0
  33. package/lib/containers/_v2/_drawers/edit-source-drawer/sampling/rule-row.d.ts +8 -0
  34. package/lib/containers/_v2/_drawers/edit-source-drawer/tabs.d.ts +1 -0
  35. package/lib/containers/_v2/_drawers/system-drawer/describe/index.d.ts +1 -8
  36. package/lib/containers/_v2/_drawers/system-drawer/diagnose/index.d.ts +1 -4
  37. package/lib/containers/_v2/_drawers/system-drawer/index.d.ts +1 -4
  38. package/lib/containers/_v2/_drawers/system-drawer/tokens/index.d.ts +1 -2
  39. package/lib/containers/_v2/_forms/add-destination-form/index.d.ts +1 -2
  40. package/lib/containers/_v2/_modals/add-data-stream-modal/index.d.ts +0 -3
  41. package/lib/containers/_v2/_modals/edit-data-stream-modal/index.d.ts +0 -2
  42. package/lib/containers/_v2/_modals/sampling-onboarding-modal/types.d.ts +1 -4
  43. package/lib/containers/_v2/central-connections/index.d.ts +1 -12
  44. package/lib/containers/_v2/onboarding/index.d.ts +0 -8
  45. package/lib/containers/_v2/overview/columns/column/head.d.ts +1 -1
  46. package/lib/containers/_v2/overview/columns/column/index.d.ts +2 -1
  47. package/lib/containers/_v2/overview/columns/index.d.ts +1 -8
  48. package/lib/containers/_v2/overview/data-stream-select/index.d.ts +1 -10
  49. package/lib/containers/_v2/overview/drawers/index.d.ts +2 -29
  50. package/lib/containers/_v2/overview/index.d.ts +2 -8
  51. package/lib/containers/_v2/overview/multi-source-control/index.d.ts +1 -5
  52. package/lib/containers/_v2/pipeline-collectors/index.d.ts +0 -7
  53. package/lib/containers/_v2/pipeline-collectors/pods-info/index.d.ts +1 -2
  54. package/lib/containers/_v2/pipeline-collectors/pods-info/pod-drawer/index.d.ts +1 -2
  55. package/lib/containers/_v2/sampling-rules/helpers.d.ts +2 -0
  56. package/lib/containers/_v2/sampling-rules/types.d.ts +2 -16
  57. package/lib/containers/_v2/settings/index.d.ts +0 -9
  58. package/lib/containers/service-map/index.d.ts +4 -2
  59. package/lib/containers/v2.js +197 -166
  60. package/lib/containers.js +7 -7
  61. package/lib/contexts/index.d.ts +1 -0
  62. package/lib/contexts/odigos-api/capabilities.d.ts +38 -0
  63. package/lib/contexts/odigos-api/client.d.ts +22 -0
  64. package/lib/contexts/odigos-api/connections-scope.d.ts +18 -0
  65. package/lib/contexts/odigos-api/hooks/use-actions-api.d.ts +26 -0
  66. package/lib/contexts/odigos-api/hooks/use-collectors-api.d.ts +25 -0
  67. package/lib/contexts/odigos-api/hooks/use-config-api.d.ts +24 -0
  68. package/lib/contexts/odigos-api/hooks/use-data-streams-api.d.ts +26 -0
  69. package/lib/contexts/odigos-api/hooks/use-describe-api.d.ts +33 -0
  70. package/lib/contexts/odigos-api/hooks/use-destinations-api.d.ts +50 -0
  71. package/lib/contexts/odigos-api/hooks/use-instrumentation-rules-api.d.ts +35 -0
  72. package/lib/contexts/odigos-api/hooks/use-k8s-manifest-api.d.ts +14 -0
  73. package/lib/contexts/odigos-api/hooks/use-metrics-api.d.ts +13 -0
  74. package/lib/contexts/odigos-api/hooks/use-namespace-api.d.ts +30 -0
  75. package/lib/contexts/odigos-api/hooks/use-profiling-api.d.ts +17 -0
  76. package/lib/contexts/odigos-api/hooks/use-sampling-api.d.ts +39 -0
  77. package/lib/contexts/odigos-api/hooks/use-service-map-api.d.ts +13 -0
  78. package/lib/contexts/odigos-api/hooks/use-snapshots-api.d.ts +13 -0
  79. package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +75 -0
  80. package/lib/contexts/odigos-api/hooks/use-tokens-api.d.ts +12 -0
  81. package/lib/contexts/odigos-api/index.d.ts +37 -0
  82. package/lib/contexts/odigos-api/internal/notify.d.ts +49 -0
  83. package/lib/contexts/odigos-api/internal/source-payloads.d.ts +53 -0
  84. package/lib/contexts/odigos-api/platform-helpers.d.ts +98 -0
  85. package/lib/contexts/odigos-api/provider.d.ts +28 -0
  86. package/lib/contexts/odigos-api/runner.d.ts +32 -0
  87. package/lib/contexts/odigos-api/types.d.ts +831 -0
  88. package/lib/contexts/odigos-api/use-api-for-connections.d.ts +43 -0
  89. package/lib/contexts/odigos-api/use-api-query.d.ts +130 -0
  90. package/lib/contexts/odigos-api/use-odigos-api.d.ts +103 -0
  91. package/lib/contexts/odigos-api.js +1 -0
  92. package/lib/contexts/odigos-context.d.ts +2 -2
  93. package/lib/contexts/storybook-context.d.ts +2 -2
  94. package/lib/contexts.js +1 -1
  95. package/lib/functions.js +1 -1
  96. package/lib/hooks.js +1 -1
  97. package/lib/icons/destinations/open-telemetry-logo/index.d.ts +2 -1
  98. package/lib/snippets/_v2/sampling-rule-form-sections/preset-with-custom-input.d.ts +1 -1
  99. package/lib/snippets/v2.js +1 -1
  100. package/lib/snippets.js +1 -49
  101. package/lib/store/index.d.ts +0 -1
  102. package/lib/store/useDrawerStore.d.ts +6 -1
  103. package/lib/store.js +1 -1
  104. package/lib/theme.js +1 -1
  105. package/lib/types/actions/index.d.ts +0 -5
  106. package/lib/types/common/index.d.ts +29 -4
  107. package/lib/types/destinations/index.d.ts +0 -10
  108. package/lib/types/index.d.ts +0 -1
  109. package/lib/types/instrumentation-rules/index.d.ts +0 -5
  110. package/lib/types/namespaces/index.d.ts +0 -5
  111. package/lib/types/pipeline-collectors/index.d.ts +0 -5
  112. package/lib/types/snapshot/index.d.ts +0 -2
  113. package/lib/types/sources/index.d.ts +0 -30
  114. package/lib/types/tokens/index.d.ts +0 -6
  115. package/lib/types/workload/index.d.ts +46 -22
  116. package/lib/types.js +1 -1
  117. package/lib/visuals.js +1 -1
  118. package/package.json +31 -22
  119. package/lib/chunks/helpers-IEFhGXc7.js +0 -19
  120. package/lib/chunks/source-instrument-form-context-DjIHPYQJ.js +0 -1
  121. package/lib/chunks/vendor-Be0cOokr.js +0 -1
  122. package/lib/mock-data/actions/index.d.ts +0 -2
  123. package/lib/mock-data/config/index.d.ts +0 -3
  124. package/lib/mock-data/connections/index.d.ts +0 -2
  125. package/lib/mock-data/describe/index.d.ts +0 -3
  126. package/lib/mock-data/destinations/index.d.ts +0 -4
  127. package/lib/mock-data/index.d.ts +0 -15
  128. package/lib/mock-data/instrumentation-instances/index.d.ts +0 -2
  129. package/lib/mock-data/instrumentation-rules/index.d.ts +0 -2
  130. package/lib/mock-data/namespaces/index.d.ts +0 -2
  131. package/lib/mock-data/pipeline-collectors/index.d.ts +0 -6
  132. package/lib/mock-data/profiling/index.d.ts +0 -8
  133. package/lib/mock-data/service-map/index.d.ts +0 -4
  134. package/lib/mock-data/snapshot/index.d.ts +0 -5
  135. package/lib/mock-data/sources/index.d.ts +0 -4
  136. package/lib/mock-data/sources/yamls.d.ts +0 -22
  137. package/lib/mock-data/tokens/index.d.ts +0 -2
  138. package/lib/mock-data/traces/index.d.ts +0 -2
  139. package/lib/store/useEntityStore.d.ts +0 -24
  140. package/lib/types/k8s-manifest/index.d.ts +0 -2
@@ -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 T,S as k,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-IEFhGXc7.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 Te,z as ke,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 Tt,aU as kt,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 To,bC as ko,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 Tn,cr as kn,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 Ta,e as ka,dh 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}from"../chunks/ui-components-DODwSdKu.js";import{TrashIcon as ai,PlusIcon as ii,ArrowRightIcon as li,VSquareIcon as ri,XSquareIcon as si,BookIcon as ci,DeleteIcon as di,EditIcon as ui,GoLogo as pi,JavaLogo as hi,ChevronRightIcon as gi,ActionIcon as mi,DestinationIcon as fi,ChevronUpIcon as bi,ChevronDownIcon as vi,VIcon as yi,XIcon as Ci,InstrumentationRuleIcon as Si,SourceIcon as wi,NamespacesIcon as xi,SettingsIcon as Ti,PodIcon as ki,OdigosLogo as $i,K8sLogo as Ei,RefreshIcon as Ii,ExclamationCircleIcon as Ni,QuestionCircleIcon as Ai,InboundIcon as Oi,OutboundIcon as Di,UserIcon as Ri,TerminalIcon as Pi,SearchIcon as Fi,MinusIcon as Li,ExpandIcon as _i,CopyIcon as zi,DotIcon as Bi,DownloadIcon as Mi,RefreshLeftArrowIcon as Xi,VmLogo as Vi,SamplingIcon as Ui,ExclamationTriangleIcon as Hi,KeyIcon as Gi,DiagnoseIcon as ji,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,I as il,a as ll,A as rl,P as sl,b as cl,c as dl,R as ul,O as pl,d as hl,e as gl,f as ml,W as fl,g as bl,C as vl,Y as yl,h as Cl,i as Sl,U as wl}from"../chunks/index-CRKgHzab.js";import{u as xl,f as Tl,g as kl,e as $l,i as El,h as Il,S as Nl,k as Al,E as Ol,l as Dl,m as Rl,j as Pl,b as Fl,d as Ll,a as _l,A as zl,R as Bl,c as Ml,D as Xl}from"../chunks/source-instrument-form-context-DjIHPYQJ.js";import{createPortal as Vl}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 Ul=[{id:"CREDIT_CARD",label:"Credit card"}],Hl=[{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"}],Gl=[{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:Gl}],Wl=[{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:Gl}],Kl=/^[a-zA-Z]$/,Yl=new Set(["*","+","?"]),Jl=new Set(["^","$"]),ql={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"},Zl=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,e as w,f as T,h as x,d as k,b as E,c as I,S as $,j as A,R as N,k as O,l as R,a as D,r as F,o as P,p as _,q as L,s as z,t as M,w as B,x as X,y as V,z as U,A as G,B as H}from"../chunks/helpers-K1tnyqhm.js";import{v as j,F as W,a3 as K,a4 as Y,a5 as J,a6 as q,a7 as Z,a8 as Q,a9 as ee,aa as te,l as oe,ab as ne,f as ae,ac as ie,h as le,n as re,ad as se,ae as ce,af as de,ag as ue,ah as pe,ai as he,aj as ge,ak as me,al as fe,am as be,m as ve,w as ye,N as Ce,an as Se,ao as we,ap as Te,aq as xe,ar as ke,q as Ee,S as Ie,H as $e,K as Ae,G as Ne,as as Oe,at as Re,au as De,O as Fe,av as Pe,R as _e,U as Le,Q as ze,V as Me,aw as Be,ax as Xe,ay as Ve,az as Ue,D as Ge,z as He,aA as je,aB as We,aC as Ke,aD as Ye,aE as Je,aF as qe,aG as Ze,aH as Qe,aI as et,aJ as tt,aK as ot,A as nt,aL as at,C as it,aM as lt,aN as rt,aO as st,aP as ct,aQ as dt,aR as ut,s as pt,J as ht,M as gt,E as mt,aS as ft,c as bt,aT as vt,aU as yt,Z as Ct,aV as St,aW as wt,$ as Tt,aX as xt,aY as kt,aZ as Et,a_ as It,a$ as $t,b0 as At,r as Nt,b1 as Ot,L as Rt,b2 as Dt,b3 as Ft,b4 as Pt,o as _t,y as Lt,b5 as zt,b6 as Mt,b7 as Bt,b8 as Xt,b9 as Vt,ba as Ut,bb as Gt,bc as Ht,bd as jt,be as Wt,bf as Kt,bg as Yt,bh as Jt,bi as qt,bj as Zt,bk as Qt,bl as eo,bm as to,i as oo,j as no,bn as ao,W as io,bo as lo,bp as ro,bq as so,br as co,bs as uo,bt as po,bu as ho,bv as go,bw as mo,bx as fo,by as bo,bz as vo,bA as yo,bB as Co,bC as So,bD as wo,bE as To,bF as xo,bG as ko,bH as Eo,bI as Io,bJ as $o,bK as Ao,bL as No,bM as Oo,bN as Ro,bO as Do,bP as Fo,bQ as Po,bR as _o,bS as Lo,bT as zo,bU as Mo,bV as Bo,bW as Xo,bX as Vo,bY as Uo,bZ as Go,b_ as Ho,b$ as jo,c0 as Wo,c1 as Ko,c2 as Yo,c3 as Jo,c4 as qo,c5 as Zo,c6 as Qo,c7 as en,c8 as tn,c9 as on,ca as nn,cb as an,cc as ln,cd as rn,ce as sn,cf as cn,cg as dn,ch as un,ci as pn,cj as hn,ck as gn,cl as mn,cm as fn,cn as bn,co as vn,cp as yn,cq as Cn,cr as Sn,cs as wn,ct as Tn,cu as xn,cv as kn,cw as En,cx as In,cy as $n,cz as An,cA as Nn,cB as On,cC as Rn,cD as Dn,cE as Fn,cF as Pn,cG as _n,cH as Ln,cI as zn,cJ as Mn,cK as Bn,cL as Xn,cM as Vn,cN as Un,cO as Gn,cP as Hn,cQ as jn,cR as Wn,cS as Kn,cT as Yn,cU as Jn,cV as qn,cW as Zn,cX as Qn,cY as ea,cZ as ta,c_ as oa,c$ as na,d0 as aa,d1 as ia,d2 as la,d3 as ra,d4 as sa,d5 as ca,d6 as da,d7 as ua,d8 as pa,d9 as ha,da as ga,db as ma,dc as fa,dd as ba,de as va,df as ya,dg as Ca,dh as Sa,di as wa,dj as Ta,g as xa,dk as ka,k as Ea,dl as Ia,dm as $a,dn as Aa,dp as Na,dq as Oa,dr as Ra,ds as Da,u as Fa,_ as Pa,dt as _a,du as La,dv as za,dw as Ma,dx as Ba,dy as Xa,dz as Va,dA as Ua,dB as Ga,dC as Ha,dD as ja,dE as Wa,dF as Ka,dG as Ya,dH as Ja,dI as qa,dJ as Za,dK as Qa,dL as ei,dM as ti,dN as oi,dO as ni,dP as ai,dQ as ii,dR as li,dS as ri}from"../chunks/ui-components-BKrLf2tx.js";import{TrashIcon as si,PlusIcon as ci,ArrowRightIcon as di,VSquareIcon as ui,XSquareIcon as pi,BookIcon as hi,DeleteIcon as gi,EditIcon as mi,GoLogo as fi,JavaLogo as bi,ChevronRightIcon as vi,ActionIcon as yi,DestinationIcon as Ci,ChevronUpIcon as Si,ChevronDownIcon as wi,VIcon as Ti,XIcon as xi,InstrumentationRuleIcon as ki,SourceIcon as Ei,NamespacesIcon as Ii,SettingsIcon as $i,PodIcon as Ai,OdigosLogo as Ni,K8sLogo as Oi,RefreshIcon as Ri,ExclamationCircleIcon as Di,QuestionCircleIcon as Fi,InboundIcon as Pi,OutboundIcon as _i,UserIcon as Li,TerminalIcon as zi,SearchIcon as Mi,MinusIcon as Bi,ExpandIcon as Xi,CopyIcon as Vi,DotIcon as Ui,DownloadIcon as Gi,RefreshLeftArrowIcon as Hi,VmLogo as ji,SamplingIcon as Wi,ExclamationTriangleIcon as Ki,KeyIcon as Yi,DiagnoseIcon as Ji,StarIcon as qi,ArrowIcon as Zi,ConnectionsIcon as Qi,FilterIcon as el,DataStreamIcon as tl,PipelineCollectorIcon as ol,ArrowDownSquareIcon as nl,ArrowUpSquareIcon as al,GatewayIcon as il,YamlIcon as ll}from"../icons.js";import{d as rl,c as sl,b as cl}from"../chunks/use-odigos-api-CDHW7ekQ.js";import{S as dl,D as ul,I as pl,a as hl,A as gl,P as ml,b as fl,c as bl,R as vl,O as yl,d as Cl,e as Sl,f as wl,W as Tl,g as xl,C as kl,Y as El,h as Il,i as $l,U as Al}from"../chunks/index-Dv0RvKAp.js";import{O as Nl}from"../chunks/connections-scope-CneIqjeg.js";import{u as Ol,f as Rl,g as Dl,e as Fl,i as Pl,h as _l,S as Ll,k as zl,E as Ml,l as Bl,m as Xl,j as Vl,b as Ul,d as Gl,a as Hl,A as jl,R as Wl,c as Kl,D as Yl}from"../chunks/source-instrument-form-context-C79I_5cH.js";import{createPortal as Jl}from"react-dom";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"../chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const ql=[{id:"CREDIT_CARD",label:"Credit card"}],Zl=[{id:j.CollectContainerAttributes,label:"Collect container attributes"},{id:j.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:j.CollectWorkloadId,label:"Collect workload ID"},{id:j.CollectClusterId,label:"Collect cluster ID"}],Ql=[{id:Z.Pod,label:Z.Pod},{id:Z.Namespace,label:Z.Namespace},{id:Z.Node,label:Z.Node}],er=[{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:Ql}],tr=[{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:Ql}],or=/^[a-zA-Z]$/,nr=new Set(["*","+","?"]),ar=new Set(["^","$"]),ir={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"},lr=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
- `,Ql=m.span`
22
- background: ${({$kind:e})=>ql[e]};
23
- `,er=({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(Yl.has(t)||Jl.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];Kl.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(Zl,e?{"data-id":o,children:n.map((e,o)=>t(Ql,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},tr="rgba(102, 191, 255, 0.5)",or=b`
21
+ `,rr=m.span`
22
+ background: ${({$kind:e})=>ir[e]};
23
+ `,sr=({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(nr.has(t)||ar.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];or.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(lr,e?{"data-id":o,children:n.map((e,o)=>t(rr,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},cr="rgba(102, 191, 255, 0.5)",dr=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
- `,nr=m.div`
36
+ `,ur=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
- `,ar=m.div`
49
- ${or}
48
+ `,pr=m.div`
49
+ ${dr}
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
- `,ir=m.textarea`
63
- ${or}
62
+ `,hr=m.textarea`
63
+ ${dr}
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
- `,lr=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),rr=({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 lr(t);let o;try{o=new RegExp(e)}catch{return lr(t)}const n=o.exec(t);if(!n)return lr(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(nr,{$minHeight:s,children:[e(ar,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:tr},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:tr},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(ir,{ref:u,$minHeight:s,value:n,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},sr=m.div`
81
+ `,gr=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),mr=({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 gr(t);let o;try{o=new RegExp(e)}catch{return gr(t)}const n=o.exec(t);if(!n)return gr(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(ur,{$minHeight:s,children:[e(pr,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:cr},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:cr},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(hr,{ref:u,$minHeight:s,value:n,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},fr=m.div`
82
82
  flex: 1;
83
83
  min-height: 0;
84
84
  overflow-y: auto;
85
- `,cr=m.div`
85
+ `,br=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
- `,dr=m.div`
92
+ `,vr=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
- `,ur=({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(sr,{children:e(cr,{children:[e(V,{$gap:6,children:[t(U,{label:Z.REGEX_LABEL}),t(er,{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(rr,{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(dr,{$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},pr=X.ExtractAttribute;var hr;!function(e){e.Preset="preset",e.Regex="regex"}(hr||(hr={}));const gr=[se.JSON,se.SQL,se.ResourcePath],mr=(e=se.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),fr=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,br=m.div`
103
+ `,yr=({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:ne.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:ne.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:ne.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:ne.RESULT_NO_MATCH}})(n,s),[n,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(oe,{isOpen:o,header:{title:ne.TITLE,onClose:()=>{c(""),i()}},children:t(fr,{children:e(br,{children:[e(W,{$gap:6,children:[t(K,{label:ne.REGEX_LABEL}),t(sr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(ae,{size:le.XXS,color:ie.Secondary,children:ne.REGEX_EMPTY_HINT})]}),e(W,{$gap:6,children:[e(re,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:ne.TEST_STRING_LABEL}),t(se,{"data-id":"regex-tester-unescape",label:ne.UNESCAPE_LABEL,tooltip:ne.UNESCAPE_TOOLTIP,variant:de.Secondary,size:ce.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(mr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:ne.TEST_STRING_PLACEHOLDER,regex:n,value:s,onChange:c,minHeight:240}),t(J,{helpMessage:ne.TEST_STRING_HELP})]}),e(W,{$gap:8,children:[t(K,{label:ne.RESULT_LABEL}),t(vr,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(ae,{size:le.XXS,color:ie.Secondary,children:ne.RESULT_CAPTURE_HINT})]})]})})});var p},Cr=j.ExtractAttribute;var Sr;!function(e){e.Preset="preset",e.Regex="regex"}(Sr||(Sr={}));const wr=[he.JSON,he.SQL,he.ResourcePath],Tr=(e=he.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),xr=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,kr=m.div`
104
104
  width: 100%;
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
- `,vr=m.div`
111
+ `,Er=m.div`
112
112
  flex: 1;
113
113
  min-width: 0;
114
- `,yr=m.div`
114
+ `,Ir=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
- `,Cr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Sr=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},wr=X.UrlTemplatizationRulesGroups,xr=[{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:Hl.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:jl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(j,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Wl,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(()=>Cr(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])})(Sr(l),i||{})||s(Cr(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,Sr(t))},errorMessage:a[X.Renames]})},[ge.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Ul.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Ul.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[wr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(wr,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(ai,{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:xr,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[wr]})]},`url-templatization-group-${n}`)),t(ne,{variant:ie.Secondary,label:"Add rule group",leftIcon:ii,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(he,{})]})},[ge.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=i[pr],c=o[pr]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(fr)?hr.Regex:hr.Preset)(c)),[p,h]=r(null),g=e=>a(pr,{extractions:e});n(()=>{0===c.length&&g([d===hr.Preset?mr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((o,n)=>n===e?{...o,...t}:o))},b=()=>{g([...c,d===hr.Preset?mr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===hr.Preset,y=c.length?c:[v?mr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(V,{$gap:16,$width:"100%",children:[t(le,{options:[{value:hr.Preset,label:re.SEGMENT_PRESET_LABEL,tooltip:re.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:hr.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===hr.Preset?mr():{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(br,{"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:gr.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(ai,{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===hr.Preset?mr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(ne,{"data-id":`extract-row-${n}-add`,leftIcon:ii,variant:ie.Secondary,size:ae.S,onClick:b})]})]}),v?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(vr,{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(yr,{children:t(li,{size:24,fill:l.v2.colors.silver[200]})}),t(vr,{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(ur,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},kr=({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},$r=()=>{const o=f(),{selectedOption:n,genericForm:a}=xl();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:ri,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:si,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ne,{leftIcon:ci,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})]})},Er=({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)}),Ir=m(oe)`
117
+ `,$r=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Ar=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},Nr=j.UrlTemplatizationRulesGroups,Or=[{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"}],Rr={[ye.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[j.CollectContainerAttributes]||a[j.CollectReplicaSetAttributes]||a[j.CollectWorkloadId]||a[j.CollectClusterId]||a[j.LabelsAttributes]?.length||a[j.AnnotationsAttributes]?.length||(i(j.CollectContainerAttributes,!0),i(j.CollectReplicaSetAttributes,!0),i(j.CollectWorkloadId,!0),i(j.CollectClusterId,!0),i(j.LabelsAttributes,[]),i(j.AnnotationsAttributes,[]))},[]),e(o,{children:[t(W,{$gap:6,children:Zl.map(({id:o,label:n})=>e(W,{children:[t(Y,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(J,{errorMessage:l[o]})]},o))}),t(q,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:er,values:a[j.LabelsAttributes]||[],setValues:e=>i(j.LabelsAttributes,e),errorMessage:l[j.LabelsAttributes]}),t(q,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:tr,values:a[j.AnnotationsAttributes]||[],setValues:e=>i(j.AnnotationsAttributes,e),errorMessage:l[j.AnnotationsAttributes]})]})),[ye.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(Q,{label:"Overwrite existing values",labelAlign:ee.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[j.OverwriteExistingValues]||!1,onChange:e=>a(j.OverwriteExistingValues,e)}),t(q,{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[j.ClusterAttributes]||[],setValues:e=>a(j.ClusterAttributes,e),errorMessage:i[j.ClusterAttributes]})]})},[ye.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(te,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[j.AttributeNamesToDelete]||[],setValues:e=>o(j.AttributeNamesToDelete,e),errorMessage:n[j.AttributeNamesToDelete]}),[ye.RenameAttributes]:({value:e,setValue:o,formErrors:a})=>{const i=e[j.Renames],[l,s]=r(()=>$r(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])})(Ar(l),i||{})||s($r(i))},[i]),t(q,{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(j.Renames,Ar(t))},errorMessage:a[j.Renames]})},[ye.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[j.PiiCategories]?.length||a(j.PiiCategories,ql.map(({id:e})=>e))},[]),e(W,{$gap:12,children:[t(K,{label:"Attributes to mask"}),t(W,{$gap:6,children:ql.map(({id:e,label:n})=>t(Y,{label:n,value:o[j.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[j.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(j.PiiCategories,i)}},e))}),t(J,{errorMessage:i[j.PiiCategories]})]})),[ye.URLTemplatization]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=n[Nr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(Nr,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(ve,{}),e(W,{$gap:12,children:[e(re,{$justifyContent:"space-between",$alignItems:"center",children:[t(K,{label:`Rule Group ${n+1}`}),t(se,{leftIcon:()=>t(si,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(be,{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(q,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Or,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(te,{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[Nr]})]},`url-templatization-group-${n}`)),t(se,{variant:de.Secondary,label:"Add rule group",leftIcon:ci,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ve,{})]})},[ye.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=i[Cr],c=o[Cr]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(xr)?Sr.Regex:Sr.Preset)(c)),[p,h]=r(null),g=e=>a(Cr,{extractions:e});n(()=>{0===c.length&&g([d===Sr.Preset?Tr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const m=(e,t)=>{g(c.map((o,n)=>n===e?{...o,...t}:o))},b=()=>{g([...c,d===Sr.Preset?Tr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===Sr.Preset,y=c.length?c:[v?Tr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(W,{$gap:16,$width:"100%",children:[t(ue,{options:[{value:Sr.Preset,label:pe.SEGMENT_PRESET_LABEL,tooltip:pe.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:Sr.Regex,label:pe.SEGMENT_REGEX_LABEL,tooltip:pe.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),g([e===Sr.Preset?Tr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(W,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const a=n===y.length-1,i=o.dataFormat||he.JSON,r=me[i];return e(kr,{"data-id":`extract-row-${n}`,children:[e(re,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(W,{$gap:10,children:[t(K,{label:v?pe.PRESET_ROW_TITLE(n):pe.REGEX_ROW_TITLE(n)}),v&&t(re,{$gap:24,children:wr.map(e=>t(ge,{"data-id":`extract-row-${n}-fmt-${e}`,size:fe.L,label:me[e].label,value:i===e,onChange:t=>t&&m(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(re,{$gap:4,$alignItems:"center",children:[!v&&t(se,{"data-id":`extract-row-${n}-test-regex`,label:pe.TEST_REGEX_LABEL,variant:de.Secondary,size:ce.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(se,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(si,{fill:l.v2.colors.red[500]}),variant:de.Secondary,size:ce.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);g(t.length?t:[d===Sr.Preset?Tr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),a&&t(se,{"data-id":`extract-row-${n}-add`,leftIcon:ci,variant:de.Secondary,size:ce.S,onClick:b})]})]}),v?e(re,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(Er,{children:t(be,{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(Ir,{children:t(di,{size:24,fill:l.v2.colors.silver[200]})}),t(Er,{children:t(be,{name:`extract-row-${n}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})})]}):e(W,{$gap:12,$width:"100%",children:[t(be,{name:`extract-row-${n}-regex`,label:pe.REGEX_LABEL,placeholder:pe.REGEX_PLACEHOLDER,helpMessage:pe.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>m(n,{regex:e.target.value})}),t(be,{name:`extract-row-${n}-targetAttributeName`,label:pe.TARGET_LABEL,placeholder:pe.TARGET_PLACEHOLDER,helpMessage:pe.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>m(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(J,{errorMessage:s})]}),t(yr,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},Dr=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Rr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Fr=()=>{const o=f(),{selectedOption:n,genericForm:a}=Ol();if(!a||!n)return t(Ce,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(W,{$gap:24,children:[e(re,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:n.docsDescription}),e(re,{$gap:12,children:[t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:we.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(se,{leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${Te}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(dl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(be,{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(Dr,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(xe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},Pr=({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||ke(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(ul,{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)}),_r=m(re)`
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
- `,Nr=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:ri,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:si,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:ci,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:ke(c.option.supportedSignals),selectedSignals:Te(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(Er,{signals:Te(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(Ir,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:di,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:ui,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"})});Nr.displayName="AddDestinationForm";const Ar=[{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."}],Or=[{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."}],Dr=["*"],Rr=[{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:""}],Pr={[Re.Java]:[new De("","")],[Re.Golang]:[new Oe("")]},Fr={[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: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(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: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})]})]})},[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]:Pr[Re.Golang],[Re.Java]:Pr[Re.Java]})},[]),e(o,{children:[e(V,{children:[e(oe,{$gap:8,children:[t(pi,{}),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(hi,{}),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(Dr)},[]),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:Rr.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},Lr=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Fr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},_r=()=>{const o=f(),{selectedOption:n,genericForm:a,sourceOptions:i,namespaceOptions:l}=kl();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:ri,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:si,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(ne,{leftIcon:ci,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(il,{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(ll,{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(Lr,{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})]})},zr=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=$l();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}})},Br=({autoFocus:o})=>{const{dataStreams:n}=Me(),{genericForm:i,excludeName:l,editingName:r}=$l(),{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})]})},Mr=()=>{const{selectedStreamName:e}=Me(),{genericForm:o}=El();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})},Xr=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Vr=m.div`
128
+ `,Lr=c(({isEdit:o},a)=>{const i=f(),{isVm:l}=y(),{destinationsApi:s}=rl(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=Rl(),[v,C]=r(h?.testResult),[S,w]=r(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const T=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await s.testConnection(Oe(u.formData));return C(e),e};return d(a,()=>({testConnection:T,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,s]),u&&c?e(W,{$gap:24,style:{minHeight:"100%"},children:[e(re,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Ee,{status:Ie.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Ee,{status:Ie.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(re,{$gap:12,children:[!l&&t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:i.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:i.v2.colors.red[800]}],size:we.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(se,{"data-id":"dest-form-docs",leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${Te}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(dl,{title:"This connection will monitor:",allowedSignals:Ne(c.option.supportedSignals),selectedSignals:Ae(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes($e.Logs),metrics:e.includes($e.Metrics),traces:e.includes($e.Traces),profiles:e.includes($e.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(be,{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(Pr,{signals:Ae(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}),!o&&e(_r,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(se,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:gi,variant:de.Secondary,textColor:i.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(se,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:de.Secondary,onClick:T})}),h&&t("div",S?{style:{width:"150px"},children:t(se,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:mi,variant:de.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(se,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await T(),o=!!e&&!e.succeeded;m(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(se,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:de.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await T(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(Ce,{title:"No active form"})});Lr.displayName="AddDestinationForm";const zr=[{id:Re.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Re.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Re.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Mr=[{id:Re.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Re.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Re.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Br=["*"],Xr=[{id:Pe.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Pe.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Pe.DbQuery,label:"Collect DB query",tooltip:""},{id:Pe.Messaging,label:"Collect messaging",tooltip:""}],Vr={[ze.Java]:[new Le("","")],[ze.Golang]:[new _e("")]},Ur={[Me.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={[Re.FilePath]:!0,[Re.Function]:!0,[Re.LineNumber]:!0,[Re.Column]:null,[Re.Namespace]:null,[Re.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Re).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(W,{$gap:6,children:zr.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:s})]}),e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(W,{$gap:6,children:Mr.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(J,{errorMessage:s})]})]})},[Me.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[ze.Golang]||[]).map(e=>new _e(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[ze.Java]||[]).map(e=>new Le(e.className,e.methodName)),[i]);return n(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[ze.Golang]:Vr[ze.Golang],[ze.Java]:Vr[ze.Java]})},[]),e(o,{children:[e(W,{children:[e(re,{$gap:8,children:[t(fi,{}),t(K,{label:"Golang custom probes"})]}),t(q,{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[ze.Golang]=e.map(e=>new _e(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[ze.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(W,{children:[e(re,{$gap:8,children:[t(bi,{}),t(K,{label:"Java custom probes"})]}),t(q,{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[ze.Golang]=c,t[ze.Java]=e.map(e=>new Le(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Me.HeadersCollection]:({value:e,setValue:o,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Fe.HeaderKeys]||[],[e]),s=e=>{const t={[Fe.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{r.length||l||s(Br)},[]),t(te,{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})},[Me.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={[Pe.HttpRequest]:{},[Pe.HttpResponse]:{},[Pe.DbQuery]:{},[Pe.Messaging]:{}};i("payloadCollection",e)}},[]);return e(W,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Type of data to collect"}),t(W,{$gap:6,children:Xr.map(({id:e,label:o,tooltip:n})=>t(De,{text:n,withIcon:!0,children:t(Y,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Pe.HttpRequest]:o.includes(Pe.HttpRequest)?{}:null,[Pe.HttpResponse]:o.includes(Pe.HttpResponse)?{}:null,[Pe.DbQuery]:o.includes(Pe.DbQuery)?{}:null,[Pe.Messaging]:o.includes(Pe.Messaging)?{}:null};i("payloadCollection",n)})(e,t)})},e))}),t(J,{errorMessage:r})]})},[Me.UnknownType]:null},Gr=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Ur[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Hr=()=>{const o=f(),{selectedOption:n,genericForm:a,sourceOptions:i,namespaceOptions:l}=Dl();if(!a||!n)return t(Ce,{title:"No active form"});const{formData:r,handleFormChange:s,formErrors:c}=a;return e(W,{$gap:24,children:[e(re,{$gap:12,$justifyContent:"space-between",children:[t(Se,{size:le.XXXS,maxLines:2,children:n.docsDescription}),e(re,{$gap:12,children:[t(ue,{options:[{icon:ui,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:pi,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:we.S,selected:r.disabled,setSelected:e=>s("disabled",e)}),t(se,{leftIcon:hi,variant:de.Secondary,size:ce.S,onClick:()=>window.open(`${Te}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(pl,{option:n,formState:r}),e(re,{$gap:12,children:[t(ae,{size:le.XS,color:ie.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Be,{label:Xe[e],leftIcon:Ve(e),backgroundColor:o.v2.colors.purple[900]},e))]}),t(hl,{scopes:r.sourceScopes,onChange:e=>s("sourceScopes",e),sourceOptions:i,namespaceOptions:l,supportedLanguages:n.type===Me.CustomInstrumentation?[]:n.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(be,{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(Gr,{ruleType:n.type,value:r,setValue:(e,t)=>s(e,t),formErrors:c}),t(xe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:r.notes,onChange:({target:{value:e}})=>s("notes",e),errorMessage:c.notes})]})},jr=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Fl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(Ue,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Ge.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:de.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:de.Secondary,onClick:n}})},Wr=({autoFocus:o})=>{const{dataStreams:n}=He(),{genericForm:i,excludeName:l,editingName:r}=Fl(),{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(W,{$width:"100%",$gap:12,children:[t(be,{name:"data-stream-name",label:Ge.STREAM_NAME,placeholder:Ge.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Ge.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Ee,{status:Ie.Warning,message:Ge.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Kr=()=>{const{selectedStreamName:e}=He(),{genericForm:o}=Pl();if(!o)return t(Ce,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(be,{name:"sourceName",label:Ge.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})},Yr=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Jr=m.div`
129
129
  display: flex;
130
130
  flex-direction: column;
131
131
  gap: 24px;
132
- `,Ur=m.div`
132
+ `,qr=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
- `,Hr=({value:e})=>{const o=f();return t(Fe,e?{status:we.Success,label:We,leftIcon:ri}:{label:Ke,leftIcon:si,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Gr=({value:e,onChange:o})=>{const n=f(),i=a(()=>[{icon:ri,label:We,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:si,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=Il();switch(e.formType){case Nl.Create:return t(Wr,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Nl.View:return e.data?e.isEditing?t(Wr,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Gr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Kr,{data:e.data,renderAction:()=>t(Hr,{value:!e.data?.rule.disabled})}):null;case Nl.EditAutoNoisy:return t(Yr,{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(Gr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Nl.EditAutoCostReduction:return t(Yr,{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(Gr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Nl.EditAutoHighlyRelevant:return t(Vr,{children:t(rl,{title:e.localEnabled?void 0:Xe,summary:e.summary,renderAction:()=>t(Gr,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Wr=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:r})=>e(Vr,{children:[t(dl,{category:o,formState:n,renderAction:r}),e(Ur,{$faded:!!n.disabled,children:[t(ul,{category:o,formState:n,onChange:a}),t(ll,{scopes:n.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(pl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(hl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(gl,{ruleType:n.ruleType,formState:n,onChange:a}),t(ml,{category:o,formState:n,onChange:a})]})]}),Kr=({data:o,renderAction:n})=>e(Vr,{children:[t(dl,{readOnly:!0,summary:o.summary,renderAction:n}),t(ul,{readOnly:!0,data:o}),t(ll,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(pl,{readOnly:!0,data:o}),t(ml,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(gl,{readOnly:!0,rule:o.rule})]}),Yr=({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(Vr,{children:[t(rl,{title:o?void 0:a,summary:n,renderAction:b}),t(Ur,{$faded:!o,children:e(Ye,{richTitle:{title:i,subTitle:r},children:[d&&t(V,{$alignItems:"flex-start",children:t(le,{options:Xr,selected:u,setSelected:v})}),S&&t(sl,{description:s,options:cl,selected:h,onSelect:y,customName:c,customLabel:Je,customPlaceholder:"5%",customValue:m,onCustomChange:C})]})})]})},Jr=m.div`
138
+ `,Zr=({value:e})=>{const o=f();return t(Be,e?{status:Ie.Success,label:Ze,leftIcon:ui}:{label:Qe,leftIcon:pi,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Qr=({value:e,onChange:o})=>{const n=f(),i=a(()=>[{icon:ui,label:Ze,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:pi,label:Qe,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ue,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},es=()=>{const e=_l();switch(e.formType){case Ll.Create:return t(ts,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Qr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Ll.View:return e.data?e.isEditing?t(ts,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Qr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(os,{data:e.data,renderAction:()=>t(Zr,{value:!e.data?.rule.disabled})}):null;case Ll.EditAutoNoisy:return t(ns,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:qe,sectionTitle:Ke,sectionSubTitle:Je,presetLabel:We,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(Qr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ll.EditAutoCostReduction:return t(ns,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ye,sectionTitle:Ke,presetLabel:We,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(Qr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ll.EditAutoHighlyRelevant:return t(Jr,{children:t(gl,{title:e.localEnabled?void 0:je,summary:e.summary,renderAction:()=>t(Qr,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},ts=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:r})=>e(Jr,{children:[t(bl,{category:o,formState:n,renderAction:r}),e(qr,{$faded:!!n.disabled,children:[t(vl,{category:o,formState:n,onChange:a}),t(hl,{scopes:n.sourceScopes,onChange:e=>a({sourceScopes:e}),sourceOptions:i,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(yl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(Cl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(Sl,{ruleType:n.ruleType,formState:n,onChange:a}),t(wl,{category:o,formState:n,onChange:a})]})]}),os=({data:o,renderAction:n})=>e(Jr,{children:[t(bl,{readOnly:!0,summary:o.summary,renderAction:n}),t(vl,{readOnly:!0,data:o}),t(hl,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(yl,{readOnly:!0,data:o}),t(wl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(Sl,{readOnly:!0,rule:o.rule})]}),ns=({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(Jr,{children:[t(gl,{title:o?void 0:a,summary:n,renderAction:b}),t(qr,{$faded:!o,children:e(et,{richTitle:{title:i,subTitle:r},children:[d&&t(W,{$alignItems:"flex-start",children:t(ue,{options:Yr,selected:u,setSelected:v})}),S&&t(ml,{description:s,options:fl,selected:h,onSelect:y,customName:c,customLabel:tt,customPlaceholder:"5%",customValue:m,onCustomChange:C})]})})]})},as=m.div`
139
139
  display: flex;
140
140
  align-items: center;
141
141
  justify-content: space-between;
@@ -148,27 +148,27 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
148
148
  &:hover {
149
149
  background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
150
150
  }
151
- `,qr=m.div`
151
+ `,is=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
- background-color: ${({theme:e})=>e.v2.colors.white[500]+qe["004"]};
158
- `,Zr=({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(Jr,{"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(qr,{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(gi,{size:18})]})]}),Qr=({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}=xl(),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(Zr,{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($r,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:mi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(fl,{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:mi,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}})},es=({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})})]})},ts=m.div`
157
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+ot["004"]};
158
+ `,ls=({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(as,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(W,{$gap:4,children:[e(re,{$gap:12,children:[g&&t(Y,{partiallyChecked:h||!1,value:p||!1,onChange:e=>g(e)}),n&&t(is,{children:t(n,{size:20})}),t(ae,{size:le.XS,children:a})]}),i&&t(ae,{size:le.XXXS,color:ie.Secondary,children:i})]}),(l||c)&&e(re,{$gap:8,children:[c,l&&t(vi,{size:18})]})]}),rs=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{actionsApi:s}=rl(),[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=Ol(),f=a(()=>(c?nt.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):nt).filter(e=>!!e),[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(ls,{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(Fr,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:yi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(Tl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();if(e)return!1;await s.create(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_ACTION,subTitle:Ge.CREATING_ACTION_SUBTITLE},header:{icon:yi,title:Ge.ADD_ACTION,subTitle:Ge.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}})},ss=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(it).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($e).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(lt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ue,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},cs=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
- `,os=m.div`
165
+ `,ds=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
- `,ns=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(ts,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(os,{$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?bi:vi,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]})},as=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||ke(e.supportedSignals).includes(o.signalType))):e,is=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(Zr,{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?yi:Ci})}),ls=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Tl();return o?.length?t(ns,{title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:o.map((o,n)=>t(is,{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(ns,{purpleColors:!0,title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(is,{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 rs;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(rs||(rs={}));const ss=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===rs.SELF_HOSTED?n.push(...e.items):e.name===rs.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}},cs=({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:T,unsavedDestinations:k,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,...ss(e,t)}))}catch(e){}finally{I(!1)}},[]);n(()=>{R()},[]);const P=l(async()=>{const e=(await Promise.all(k.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")}},[k,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(ls,{listType:et.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(et)){if(i.categoryType&&i.categoryType!==e)continue;const l=as(o[e],n,i);l.length&&a.push(t(ls,{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(Nr,{testConnection:e},o.option.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:fi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(fl,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!k.length,onSave:P,disableSave:!x&&!k.length,isFetching:E,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:Be.CREATING_DESTINATION,subTitle:Be.CREATING_DESTINATION_SUBTITLE},header:{icon:fi,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(es,{destinationsByCategory:O,filters:C,setFilters:S}),leftColumn:F,rightColumn:L})},ds=({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(Zr,{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(_r,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:Si,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(fl,{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:Si,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}})},us={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"},ps={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"},hs=e=>e?ps:us,gs="No matches",ms="No sources",fs=e=>`No sources matched the filter '${e}'`,bs=e=>(e?"Unselect":"Select")+" all",vs="Show only:",ys="Selected",Cs="Auto",Ss="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",ws="Enterprise only",xs=m.div``,Ts=m.div`
171
+ `,us=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(cs,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(ds,{$isOpen:s,children:[e(re,{$gap:10,children:[t(ae,{size:le.XS,children:o}),n&&t(De,{text:n,withIcon:!0}),t(Be,{label:a.length,status:l?Ie.Default:void 0})]}),t(rt,{icon:s?Si:wi,size:st.M,onClick:()=>c(e=>!e)})]}),s?t(W,{children:a.length?u.toArray(a):t(at,{$padding:"12px 0",children:t(Ce,{})})}):null]})},ps=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Ne(e.supportedSignals).includes(o.signalType))):e,hs=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(ls,{icon:ut(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Be,{status:n.succeeded?Ie.Success:Ie.Error,leftIcon:n.succeeded?Ti:xi})}),gs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=Rl();return o?.length?t(us,{title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:o.map((o,n)=>t(hs,{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(us,{purpleColors:!0,title:dt[e].TITLE,tooltip:dt[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(hs,{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 ms;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(ms||(ms={}));const fs=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ms.SELF_HOSTED?n.push(...e.items):e.name===ms.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=pt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=ht(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]))}}}),{[it.DETECTED]:o,[it.SELF_HOSTED]:n,[it.MANAGED]:a}},bs=["destinations","destinationCategories","potentialDestinations"],vs=({onClose:e,onBack:o,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=rl({subscribe:bs}),[g,m]=r(""),[f,b]=r({categoryType:null,signalType:null}),{items:v,categoriesResult:y,categoriesLoading:C,potentialResult:S,potentialLoading:w}=h,{activeForm:T,genericForm:x,unsavedDestinations:k,setUnsavedDestinations:E}=Rl();n(()=>{d&&E(d)},[d]);const I=C||w,$=a(()=>y?.destinationCategories?.categories??[],[y]),[A,N]=r({[it.ALL]:[],[it.UNSAVED]:[],[it.EXISTS]:[],[it.DETECTED]:[],[it.SELF_HOSTED]:[],[it.MANAGED]:[]});n(()=>{const e=v.map(e=>{let t;for(const o of $){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=ht(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})):[]}});N(t=>({...t,[it.EXISTS]:e}))},[v,$]),n(()=>{(y||S)&&N(e=>({...e,...fs(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of k){const o=Oe(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])){await h.update(e.id,o);continue}}await h.create(o)}},[k,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=Rl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(gs,{listType:it.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(it)){if(i.categoryType&&i.categoryType!==e)continue;const l=ps(o[e],n,i);l.length&&a.push(t(gs,{listType:e,destinationOptions:l},e))}return e&&a.push(t(at,{$height:"100%",children:t(ct,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:I,destinationsByCategory:A,searchText:g,filters:f}),D=(()=>{const{activeForm:e}=Rl();return{width:"60%",list:e?[t(Lr,{},e.option.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:Ci,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(Tl,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:o?()=>o(k):void 0,onNext:i?()=>i(k):void 0,nextIsSkip:!k.length,onSave:O,disableSave:!T&&!k.length,isFetching:I,isFormDirty:k.length>0||x?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_DESTINATION,subTitle:Ge.CREATING_DESTINATION_SUBTITLE},header:{icon:Ci,title:Ge.ADD_DESTINATIONS,subTitle:Ge.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:g,onChange:m},filters:t(ss,{destinationsByCategory:A,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},ys=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{instrumentationRulesApi:s}=rl(),[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=Dl(),f=a(()=>c?gt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):gt,[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(ls,{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(Hr,{},p.type)]:[t(at,{$height:"100%",children:t(Ce,{icon:ki,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(Tl,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();if(e)return!1;await s.create(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Ge.CREATING_INSTRUMENTATION_RULE,subTitle:Ge.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:ki,title:Ge.ADD_INSTRUMENTATION_RULE,subTitle:Ge.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}})},Cs={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Ge.FETCHING_NAMESPACES,subTitle:Ge.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:Ge.SELECT_NAMESPACE,subTitle:Ge.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Ss={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===mt.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"},ws=e=>e?Ss:Cs,Ts="No matches",xs="No sources",ks=e=>`No sources matched the filter '${e}'`,Es=e=>(e?"Unselect":"Select")+" all",Is="Show only:",$s="Selected",As="Auto",Ns="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Os="Enterprise only",Rs=m.div``,Ds=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
- ${xs}:hover & {
179
+ ${Rs}: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(xs,{children:t(Zr,{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]})})})})},$s=m.div``,Es=m.div`
182
+ `,Fs=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const r=f(),s=()=>{};return t(Rs,{children:t(ls,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?s:a,isChecked:n,onCheckboxChange:i?s:a,children:i&&l?t(Be,{label:l,status:Ie.Default,textSize:le.XXXS}):t(Ds,{children:t(Be,{label:o,status:Ie.Info,textSize:le.XXXS,backgroundColor:r.v2.colors.blue[900]})})})})},Ps=m.div``,_s=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
- ${$s}:hover & {
188
+ ${Ps}:hover & {
189
189
  visibility: visible;
190
190
  }
191
- `,Is=({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($s,{children:t(Zr,{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(Es,{$visible:r||i,children:t(Ie,{text:Ss,children:t(K,{label:Cs,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:ys}),t(Fe,{label:`${l.sourced}/${l.total}`,status:r?we.Default:pt.Unknown,minWidth:"42px"})]})]})})})},Ns=({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(Is,{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(ns,{title:n,list:c,noBgColor:!0}):c},As=({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=hs(m),{selectedStreamName:b}=Me(),{progress:v,resetProgress:C}=ft(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:T,handleSourceChange:k,handleSelectAll:$,formDiff:E,isFormDirty:I}=Pl();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)&&(e.dataStreamNames?.includes(b)??!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=hs(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Dl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Rl(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(Ns,{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:bs(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:xi,title:gs,subTitle:h.noGroupMatchedFilter(c)}:{icon:xi,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:T,handleSourceChange:k,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=hs(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=>Al(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&&Ol.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:ws},`${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:bs(f)})]}),list:b.length?b:[t(Qe,{$height:"100%",children:t(me,g?r?{icon:wi,title:gs,subTitle:fs(r)}:{icon:wi,title:ms,subTitle:p.noItemsInGroupSubTitle}:{icon:wi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:T,handleSourceChange:k,handleSelectAll:$,selectedArea:{value:F},searchText:O===ut.Source?N:"",searchBy:O,filters:R});return t(fl,{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:wi,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:vs}),t(K,{name:"filter-selected",size:gt.S,label:ys,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})},Os=(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},Ds=({onClose:i,actionId:s,updateAction:c,deleteAction:d})=>{const u=f(),{actions:p}=ct(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:b}=xl(),[v,y]=r(!1),[C,S]=r(!1),[w,x]=r(null),T=v&&!!b?.isFormDirty,k=a(()=>p?.find(e=>Ct(e)===s),[s,p]),$=a(()=>Ze.find(({type:e})=>e===k?.type)??null,[k?.type]);n(()=>{k&&g(k)},[k]);const E=l(()=>{k&&y(!0)},[k]),I=l(()=>{k&&(g(k),y(!1))},[k,g]),N=l(()=>{T?x("close"):i()},[T,i]),A=l(()=>{T?x("cancel"):I()},[T,I]),O=l(()=>{const e=w;x(null),"close"===e?(I(),i()):I()},[w,I,i]),D=l(async()=>{if(k){const{errorMessage:e,preparedFormData:t}=m();e||(await c(k.id,t),y(!1))}},[k,m,c]),R=l(()=>{k&&S(!0)},[k]),P=l(async()=>{k&&(await d(k.id,k.type),i())},[k,d,i]);if(!k||!$)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})(k);return e(o,{children:[t(q,{isOpen:!0,header:{icon:kt(k.type),title:$.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:St.EDIT,icon:ui,active:v,onClick:E},{id:"edit-action-btn-delete",label:St.DELETE,icon:ai,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($r,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(Tt,{conditions:k.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Os(k,$)})]}),!!F?.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(bl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(vl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},Rs=({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:T}=$t(y||{rollout:{automaticRolloutDisabled:!1}}),k=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),T(e)}v(!1)})(l[0]):C(void 0)},[l.length]),t(fl,{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:k,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(Zr,{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")]}})},Ps=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=Te(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},Fs=({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(),T=i(null),[k,$]=r(!1),[E,I]=r(!1),[N,A]=r(null),[O,D]=r(!0),[R,P]=r(null),F=k&&!!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=Te(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:ui,active:k,onClick:B},{id:"edit-destination-btn-delete",label:St.DELETE,icon:ai,color:g.v2.colors.red[500],active:E,onClick:j}]},footer:{actions:k?[{"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:()=>T.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})}):k&&C?t(Nr,{ref:T,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[!m&&t(Tt,{conditions:_.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Ps(_)})]}),!!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(bl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:W}),t(vl,{isOpen:null!==R,onClose:()=>P(null),onApprove:H})]})},Ls=(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},_s=({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,T]=r(null),k=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(()=>{k?T("close"):i()},[k,i]),O=l(()=>{k?T("cancel"):N()},[k,N]),D=l(()=>{const e=x;T(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:ui,active:y,onClick:I},{id:"edit-rule-btn-delete",label:St.DELETE,icon:ai,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(_r,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(Tt,{conditions:$.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Ls($,E)})]}),t(ll,{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(bl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(vl,{isOpen:null!==x,onClose:()=>T(null),onApprove:D})]})};var zs;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(zs||(zs={}));const Bs=({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:ki,withCopy:!0}),[l]),f=a(()=>{const e=[],t=zt(c);t&&e.push(t);const o=zt(d,$i,"health");o&&e.push(o);const n=zt(u,Ei,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ii,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})})},Ms=m.div`
191
+ `,Ls=({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(Ps,{children:t(ls,{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(re,{$gap:12,children:[!d&&t(_s,{$visible:r||i,children:t(De,{text:Ns,children:t(Q,{label:As,labelAlign:ee.Left,size:vt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(re,{$gap:8,children:[t(ae,{variant:yt.Span,size:le.XXXS,color:ie.Secondary,align:"right",children:$s}),t(Be,{label:`${l.sourced}/${l.total}`,status:r?Ie.Default:ft.Unknown,minWidth:"42px"})]})]})})})},zs=({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(Ls,{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(us,{title:n,list:c,noBgColor:!0}):c},Ms=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=y(),{sourcesApi:h,capabilities:g}=rl(),m=ws(p),{selectedStreamName:f}=He(),{progress:b,resetProgress:v}=Ct(),{isFetching:C,setIsFetching:S,setSnapshots:w,formData:T,handleSourceChange:x,handleSelectAll:k,formDiff:E,isFormDirty:I}=Vl(),$=g.canFetchSnapshots,{data:A,loading:N}=sl("GET_ALL_CLUSTER_SNAPSHOTS",void 0,{skip:!$}),{data:O,loading:R}=sl("GET_NAMESPACES_WITH_WORKLOADS",void 0,{skip:$}),D=a(()=>{if($)return A??null;const e=O?.namespaces;return e?.length?{clusters:[{clusterId:wt,clusterName:St,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(f),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(f)??!1)}))||[]}))}]}:null},[$,A,O,f]);n(()=>{S(N||R),D&&w(D)},[D,N,R,S,w]);const[F,P]=r(""),[_,L]=r(mt.Namespace),[z,M]=r({showOnlySelected:!1}),[B,X]=r({clusterId:"",clusterName:"",namespaceName:""}),V=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=ws(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Bl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Xl(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(zs,{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(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:h.groupColumnHeader}),t(De,{text:b?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${b?`${v} / ${C}`:C}`,status:ft.Unknown})})]}),t(ae,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:le.XS,children:Es(m)})]}),list:f.length?f:o?[t(at,{$height:"100%",children:t(ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(at,{$height:"100%",children:t(Ce,c?{icon:Ii,title:Ts,subTitle:h.noGroupMatchedFilter(c)}:{icon:Ii,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:C,formData:T,handleSourceChange:x,handleSelectAll:k,selectedArea:B,setSelectedArea:X,searchText:_===mt.Namespace?F:"",searchBy:_,filters:z}),U=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=ws(u),h=d===bt.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=>zl(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&&Ml.has(l);return t(Fs,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:r,disabledReason:Os},`${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(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(De,{text:v?Ge.FILTERED_COUNT_TOOLTIP:void 0,children:t(Be,{label:`${v?`${C} / ${S}`:S}`,status:ft.Unknown})})]}),t(ae,{"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:le.XS,children:Es(f)})]}),list:b.length?b:[t(at,{$height:"100%",children:t(Ce,g?r?{icon:Ei,title:Ts,subTitle:ks(r)}:{icon:Ei,title:xs,subTitle:p.noItemsInGroupSubTitle}:{icon:Ei,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:T,handleSourceChange:x,handleSelectAll:k,selectedArea:{value:B},searchText:_===mt.Source?F:"",searchBy:_,filters:z});return t(Tl,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{v(Tt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(E):void 0,onNext:l?()=>l(E):void 0,nextIsSkip:!I,onSave:()=>h.persistV2(E),header:{icon:Ei,title:Ge.ADD_SOURCE,subTitle:Ge.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:F,onChange:e=>{P(e),_===mt.Namespace&&X({clusterId:"",clusterName:"",namespaceName:""})},placeholder:m.searchPlaceholder(_),segment:{options:[{label:m.groupSegmentLabel,value:mt.Namespace},{label:m.itemSegmentLabel,value:mt.Source}],selected:_,setSelected:L}},filters:e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:Is}),t(Q,{name:"filter-selected",size:vt.S,label:$s,value:z.showOnlySelected,onChange:e=>M(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:C,progress:{title:Ge.CREATING_SOURCES,subTitle:Ge.CREATING_SOURCES_SUBTITLE,percentage:b[Tt.BulkInstrumenting]?.percentage||0},leftColumn:V,rightColumn:U})},Bs=(e,t)=>{const o=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.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:Ge.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Ge.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Ge.NOTES,label:e.notes}),o},Xs=["actions"],Vs=({onClose:i,actionId:s})=>{const c=f(),{actionsApi:d}=rl({subscribe:Xs}),{items:u}=d,{selectedOption:p,loadAction:h,validateFormData:g,genericForm:m}=Ol(),[b,v]=r(!1),[y,C]=r(!1),[S,w]=r(null),T=b&&!!m?.isFormDirty,x=a(()=>u?.find(e=>xt(e)===s),[s,u]),k=a(()=>nt.find(({type:e})=>e===x?.type)??null,[x?.type]);n(()=>{x&&h(x)},[x]);const E=l(()=>{x&&v(!0)},[x]),I=l(()=>{x&&(h(x),v(!1))},[x,h]),$=l(()=>{T?w("close"):i()},[T,i]),A=l(()=>{T?w("cancel"):I()},[T,I]),N=l(()=>{const e=S;w(null),"close"===e?(I(),i()):I()},[S,I,i]),O=l(async()=>{if(x){const{errorMessage:e,preparedFormData:t}=g();e||(await d.update(x.id,t),v(!1))}},[x,g,d]),R=l(()=>{x&&C(!0)},[x]),D=l(async()=>{x&&(await d.remove(x.id,x.type),i())},[x,d,i]);if(!x||!k)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?Ie.Success:ft.Unknown,label:e?"True":"False",invertColors:!0});if(o===ye.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||Z.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||Z.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===ye.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===ye.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ye.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ye.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===ye.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})(x);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:At(x.type),title:k.label,onClose:$,actions:[{id:"edit-action-btn-edit",label:kt.EDIT,icon:mi,active:b,onClick:E},{id:"edit-action-btn-delete",label:kt.DELETE,icon:si,color:c.v2.colors.red[500],active:y,onClick:R}]},footer:{actions:b?[{"data-id":"edit-action-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:kt.SAVE,variant:de.Primary,onClick:O}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:b&&p?t(Fr,{}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[t($t,{conditions:x.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Bs(x,k)})]}),!!F?.length&&t(It,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(xl,{target:"action",isOpen:y,onClose:()=>C(!1),onApprove:D}),t(kl,{isOpen:null!==S,onClose:()=>w(null),onApprove:N})]})},Us=({onClose:o,connections:l,selectedConnectionIds:s,setSelectedConnectionIds:c})=>{const{configApi:d}=rl(),[u,p]=r(""),[h,g]=r({showOnlySelected:!1}),m=a(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&s.includes(e.id);return t&&o}),[l.length,s.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===s.length?s[0]:void 0,{data:v,loading:y}=sl("GET_EFFECTIVE_CONFIG",b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:T,resetFormData:x}=Nt(C||{rollout:{automaticRolloutDisabled:!1}}),k=i(x);k.current=x,n(()=>{C&&k.current(C)},[C]);const E=a(()=>s.length>1||void 0!==C&&!T(C,S),[s.length,C,S]);return t(Tl,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,s))??void 0,header:{icon:$i,title:"Cluster Configuration"},connectionIds:{value:s,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:"Show only:"}),t(Q,{size:vt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(ae,{size:le.XS,children:"Clusters"}),t(Be,{label:m.length,status:ft.Unknown})]}),e(re,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,align:"right",children:"Selected clusters"}),t(Be,{label:`${s.length}/${m.length}`,status:ft.Unknown})]})]}),list:m.map(e=>t(ls,{title:e.name,isChecked:s.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(ae,{size:le.XS,children:"Configurations"}),list:[t(Q,{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")]}})},Gs=e=>{const t=[{id:"type",title:Ge.TYPE,label:e.destinationType.displayName},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}],o=Ae(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:Ge.MONITORS,label:o}),e.name&&t.push({id:"name",title:Ge.NAME,label:e.name}),t},Hs=["destinations","destinationCategories"],js=({onClose:s,destinationId:c})=>{const d=f(),{isVm:u}=y(),{destinationsApi:p}=rl({subscribe:Hs}),{items:h,categoriesResult:g,categoriesLoading:m}=p,{selectedStreamName:b}=He(),{activeForm:v,loadDestination:C,validateFormData:S,genericForm:w}=Rl(),T=i(null),[x,k]=r(!1),[E,I]=r(!1),[$,A]=r(null),N=x&&!!w?.isFormDirty,O=a(()=>Dt(h,b),[h,b]),R=a(()=>O?.find(e=>xt(e)===c),[c,O]),D=g?.destinationCategories?.categories??null;n(()=>{R&&D&&C(R,D)},[R,D]);const F=a(()=>R&&D?Ft(D,R):[],[R,D]),P=l(()=>{R&&k(!0)},[R]),_=l(()=>{R&&D&&(C(R,D),k(!1))},[R,D,C]),L=l(()=>{N?A("close"):s()},[N,s]),z=l(()=>{N?A("cancel"):_()},[N,_]),M=l(()=>{const e=$;A(null),"close"===e?(_(),s()):_()},[$,_,s]),B=l(async()=>{if(R){const{errorMessage:e,preparedFormData:t}=S();e||(await p.update(R.id,Oe(t)),k(!1))}},[R,S,p]),X=l(()=>{R&&I(!0)},[R]),V=l(async()=>{R&&(await p.remove(R.id),s())},[R,p,s]);if(!R)return null;const{icon:U,iconSrc:G}=ut(R.destinationType.type),H=((e,t)=>{const o=[],n=Ot(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=Ae(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&&ke(h,i,a))return;const{type:m}=ht(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===Rt.MultiInput){const t=ht(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===Rt.KeyValuePair){const t=ht(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})(R,F);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:U,iconSrc:G,title:R.name||R.destinationType.displayName,onClose:L,actions:[{id:"edit-destination-btn-edit",label:kt.EDIT,icon:mi,active:x,onClick:P},{id:"edit-destination-btn-delete",label:kt.DELETE,icon:si,color:d.v2.colors.red[500],active:E,onClick:X}]},footer:{actions:x?[{"data-id":"edit-destination-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:z},...v?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:kt.TEST_CONNECTION,variant:de.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:kt.SAVE,variant:de.Primary,onClick:B}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:m?t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})}):x&&v?t(Lr,{ref:T,isEdit:!0}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[!u&&t($t,{conditions:R.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Gs(R)})]}),!!H.length&&t(It,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:H.map(e=>"cells"===e.kind?t(It,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(It,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(xl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:V}),t(kl,{isOpen:null!==$,onClose:()=>A(null),onApprove:M})]})},Ws=(e,t)=>{const o=[{id:"type",title:Ge.TYPE,label:t.label},{id:"status",title:Ge.STATUS,badge:{status:e.disabled?ft.Unknown:Ie.Success,label:e.disabled?Ge.DISABLED:Ge.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Ge.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Ge.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Ge.NOTES,label:e.notes}),o},Ks=["rules"],Ys=({onClose:i,ruleId:s})=>{const c=f(),{instrumentationRulesApi:d}=rl({subscribe:Ks}),{items:u}=d,{addNotification:p}=_t(),{selectedOption:h,loadRule:g,validateFormData:m,genericForm:b}=Dl(),[v,y]=r(!1),[C,S]=r(!1),[w,T]=r(null),x=v&&!!b?.isFormDirty,k=a(()=>u?.find(e=>xt(e)===s),[s,u]),E=a(()=>gt.find(({type:e})=>e===k?.type)??null,[k?.type]);n(()=>{k&&g(k)},[k]);const I=l(()=>{if(k){if(!k.mutable)return void p({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_EDIT_RULE,crdType:mt.InstrumentationRule,target:k.ruleId,hideFromHistory:!0});y(!0)}},[k,p]),$=l(()=>{k&&(g(k),y(!1))},[k,g]),A=l(()=>{x?T("close"):i()},[x,i]),N=l(()=>{x?T("cancel"):$()},[x,$]),O=l(()=>{const e=w;T(null),"close"===e?($(),i()):$()},[w,$,i]),R=l(async()=>{if(k){const{errorMessage:e,preparedFormData:t}=m();e||(await d.update(k.ruleId,t),y(!1))}},[k,m,d]),D=l(()=>{if(k){if(!k.mutable)return void p({type:Ie.Warning,title:Lt.FORBIDDEN,message:Lt.CANNOT_DELETE_RULE,crdType:mt.InstrumentationRule,target:k.ruleId,hideFromHistory:!0});S(!0)}},[k,p]),F=l(async()=>{k&&(await d.remove(k.ruleId),i())},[k,d,i]);if(!k||!E)return null;const P=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(ae,{size:le.XS,children:`• ${Pt(e).toLowerCase()}`},e))}),e.headersCollection?.[Fe.HeaderKeys]?.length&&e.headersCollection[Fe.HeaderKeys].forEach(e=>{e&&n.push(t(ae,{size:le.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[ze.Java]?.forEach((e,a)=>{const i=new Le(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[ze.Golang]?.forEach((e,a)=>{const i=new _e(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(ae,{size:le.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(ae,{size:le.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})(k,c);return e(o,{children:[t(oe,{isOpen:!0,header:{icon:Mt(k.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:kt.EDIT,icon:mi,active:v,onClick:I},{id:"edit-rule-btn-delete",label:kt.DELETE,icon:si,color:c.v2.colors.red[500],active:C,onClick:D}]},footer:{actions:v?[{"data-id":"edit-rule-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:N},{"data-id":"edit-rule-btn-save",label:kt.SAVE,variant:de.Primary,onClick:R}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:v&&h?t(Hr,{}):t(W,{$gap:16,children:e(It,{bgTint:"1000",children:[e(It,{bgTint:"900",children:[t($t,{conditions:k.conditions||[]}),t(It,{bgTint:"800",cellsPerRow:2,items:Ws(k,E)})]}),t(hl,{readOnly:!0,scopes:k.sourceScopes??null}),!!P.length&&t(It,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",children:P})}),!!E.supportedLanguages.length&&t(It,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(It,{bgTint:"800",children:t(re,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(zt,{label:Xe[e],leftIcon:Ve(e),flex:"0.5"},e))})})})]})})})}),t(xl,{target:"instrumentation rule",isOpen:C,onClose:()=>S(!1),onApprove:F}),t(kl,{isOpen:null!==w,onClose:()=>T(null),onApprove:O})]})};var Js;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"}(Js||(Js={}));const qs=({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}=Bt(),g=Xt(!!o),m=a(()=>({title:l,icon:Ai,withCopy:!0}),[l]),f=a(()=>{const e=[],t=Vt(c);t&&e.push(t);const o=Vt(d,Ni,"health");o&&e.push(o);const n=Vt(u,Oi,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ri,label:kt.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Ge.NODE,label:r,withCopy:!0},{id:"age",title:Ge.AGE,label:s?h(s,{style:"short"}):Ge.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:g,children:t(It,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Zs=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
- `,Xs=({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(Ms,{$noPadding:i,children:[t(Mt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t(Us,{label:Be.PODS,count:c}),t(Us,{label:Be.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Us,{label:Be.ODIGOS_HEALTHY,icon:$i,count:u,total:c}),t(Us,{label:Be.KUBERNETES_HEALTHY,icon:Ei,count:p,total:c})]})]}):null},Vs=m.div`
199
+ `,Qs=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=Ht(o?.status),r=Pt(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===Ut.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Ut.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Ut.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Zs,{$noPadding:i,children:[t(Gt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(re,{$gap:8,children:[t(tc,{label:Ge.PODS,count:c}),t(tc,{label:Ge.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(tc,{label:Ge.ODIGOS_HEALTHY,icon:Ni,count:u,total:c}),t(tc,{label:Ge.KUBERNETES_HEALTHY,icon:Oi,count:p,total:c})]})]}):null},ec=m.div`
200
200
  display: flex;
201
201
  flex-direction: column;
202
202
  justify-content: center;
@@ -207,7 +207,7 @@ 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
- `,Us=({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(Vs,{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})]})]})},Hs=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 Gs;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(Gs||(Gs={}));const js=({overrideProcessNum:o,healthy:i,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=r(Gs.IdentifyingAttributes),g=_t(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Gs.IdentifyingAttributes,label:Be.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Gs.InstrumentationLibraries,label:Be.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Ni,{...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 Gs.IdentifyingAttributes:return t(V,{children:s?.map(e=>t(qs,{label:e.name,value:e.value},e.name))});case Gs.InstrumentationLibraries:return t(V,{children:c?.map(e=>t(qs,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[p,s,c]),C=a(()=>Hs({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:$i,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]})})},Ws=m.div`
210
+ `,tc=({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(ec,{children:[e(re,{$gap:0,$alignItems:"flex-end",children:[t(ae,{size:le.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(ae,{size:le.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(re,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(ae,{size:le.XXXS,nowrap:!0,children:a})]})]})},oc=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===jt.PID)??e.identifyingAttributes?.find(({name:e})=>e===jt.VPID);return t?.value??null};var nc;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(nc||(nc={}));const ac=({overrideProcessNum:o,healthy:i,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=r(nc.IdentifyingAttributes),g=Xt(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:nc.IdentifyingAttributes,label:Ge.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:nc.InstrumentationLibraries,label:Ge.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Di,{...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 nc.IdentifyingAttributes:return t(W,{children:s?.map(e=>t(cc,{label:e.name,value:e.value},e.name))});case nc.InstrumentationLibraries:return t(W,{children:c?.map(e=>t(cc,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[p,s,c]),C=a(()=>oc({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return t("div",{ref:g,children:e(It,{bgTint:"800",richTitle:{title:C?`${Ge.PROCESS} ${Ge.PID(C)}`:Ge.PROCESS_FALLBACK_NAME},renderOnRightSide:t(ae,{color:i?ie.Success:ie.Error,size:le.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?Ie.Success:Ie.Error,leftIcon:Ni,label:i?Ge.HEALTHY:Ge.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(ue,{options:m,selected:p,setSelected:h}),!v&&y]})})},ic=m.div`
211
211
  display: flex;
212
212
  align-items: flex-start;
213
213
  gap: 8px;
@@ -216,23 +216,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
216
216
  &:hover {
217
217
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
218
218
  }
219
- `,Ks=m(Q)`
219
+ `,lc=m(ae)`
220
220
  flex: 0 0 30%;
221
- `,Ys=m(Q)`
221
+ `,rc=m(ae)`
222
222
  flex: 1 1 auto;
223
223
  min-width: 0;
224
- `,Js=m(oe)`
224
+ `,sc=m(re)`
225
225
  flex: 1 1 auto;
226
226
  justify-content: flex-end;
227
227
  min-width: 0;
228
- `,qs=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const r="boolean"==typeof i;return e(Ws,{children:[t(Ks,{size:te.XXS,color:ee.Secondary,children:o}),n&&t(Ys,{size:te.XXS,color:ee.Primary,align:"right",children:n}),(r||a)&&e(Js,{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})]})]})},Zs=p(null),Qs=({value:e,children:o})=>t(Zs.Provider,{value:e,children:o}),ec=({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(oc,{...e,language:Ut(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},tc=m.div`
228
+ `,cc=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const r="boolean"==typeof i;return e(ic,{children:[t(lc,{size:le.XXS,color:ie.Secondary,children:o}),n&&t(rc,{size:le.XXS,color:ie.Primary,align:"right",children:n}),(r||a)&&e(sc,{children:[a&&t(Be,{status:Ie.Info,label:Ge.STANDARD,textSize:le.XXXS,invertColors:!0}),r&&t(Be,{status:i?Ie.Success:Ie.Error,label:i?Ge.HEALTHY:Ge.NOT_HEALTHY,textSize:le.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},dc=p(null),uc=({value:e,children:o})=>t(dc.Provider,{value:e,children:o}),pc=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:Ge.CONTAINERS,titleSize:le.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(It,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(W,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(gc,{...e,language:Wt(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},hc=m.div`
229
229
  display: flex;
230
230
  flex-direction: column;
231
231
  gap: 12px;
232
232
  padding: 8px 12px;
233
233
  border-radius: 8px;
234
234
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
235
- `,oc=({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):Ai,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,$i,"health");o&&e.push(o);const n=zt(g,Ei,"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?ri:si,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?ri:si,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?si:ri,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]),T=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(tc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:Gt.Pink,leftIcon:Ei,label:T}),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&&Hs({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(js,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},nc=({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))})},ac=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=h(Zs);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===zs.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(Xs,{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(Bs,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(nc,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(ec,{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})})})},ic=({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(lc,{icon:Oi,title:Be.INBOUND,subTitle:Be.INBOUND_DESCRIPTION(s),onRefresh:h,items:u?.inbound??[]}),t(lc,{icon:Di,title:Be.OUTBOUND,subTitle:Be.OUTBOUND_DESCRIPTION(s),onRefresh:h,items:u?.outbound??[]})]})},lc=({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:Ii,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(sc,{...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")]})]})},rc=m.div`
235
+ `,gc=({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}=Bt(),C=Xt(v),S=a(()=>({title:n,icon:o?Ve(o):Fi,iconWithWrapper:!0}),[n,o]),w=a(()=>{const e=[],t=Vt({status:i?Ut.Success:Ut.Disabled,reasonEnum:i?Ge.INSTRUMENTED_WITH_DISTRO(i):Ge.UNINSTRUMENTED,message:""});t&&e.push(t);const o=Vt(h,Ni,"health");o&&e.push(o);const n=Vt(g,Oi,"health");return n&&e.push(n),e},[g,h,i]),T=a(()=>[{id:"runningTime",title:Ge.RUNNING_TIME,label:l?y(l,{style:"short"}):Ge.NOT_RUNNING,labelTooltip:`${Ge.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Ie.Success:Kt.Disabled,leftIcon:r?ui:pi,label:r?Ge.STARTED:Ge.NOT_STARTED,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Ie.Success:Kt.Disabled,leftIcon:s?ui:pi,label:s?Ge.READY:Ge.NOT_READY,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Ie.Error:Ie.Success,leftIcon:d?pi:ui,label:d?Ge.CRASHLOOP:Ge.NO_CRASHLOOP,textSize:le.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Ge.RESTARTS,badge:{status:c?Ie.Error:void 0,label:c||0,textSize:le.XXXS}}],[l,y,r,s,d,c]),x=a(()=>p?Pt(u):"",[p,u]);return t("div",{ref:C,children:e(It,{bgTint:"750",richTitle:S,badges:w,items:T,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(hc,{children:e(re,{$gap:10,$alignItems:"center",children:[t(zt,{variant:Yt.Pink,leftIcon:Oi,label:x}),t(ae,{size:le.XXXS,color:ie.Error,children:p})]})}),(m??[]).map((e,o)=>{const a=o+1,i=b&&(l=f,r=e,!!l?.processPid&&oc({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(ac,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},mc=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:Ge.DEBUG_COMMANDS,titleSize:le.XS}),[]),l=a(()=>[{label:Ge.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Ge.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Ge.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(It,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(Jt,{bgTint:"700",label:e,value:o},e))})},fc=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=h(dc);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===Js.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:Ge.PODS,badge:{label:s.length}}),[s.length]);return t(W,{$gap:12,children:c?e(o,{children:[t(Qs,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(It,{bgTint:"1000",richTitle:u,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(qs,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(mc,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(pc,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(at,{$height:"70vh",children:t(Ce,{title:Ge.NO_RUNNING_PODS,subTitle:Ge.NO_RUNNING_PODS_SUBTITLE})})})},bc=["sources"],vc=({source:o})=>{const n=a(()=>o.serviceName||o.id.name,[o]),{data:i,loading:l,refetch:r}=sl("GET_PEER_SOURCES",{serviceName:n},{fetchPolicy:"network-only"}),s=i?.peerSources??null;return!s||l?t(at,l?{$height:"70vh",children:t(ct,{withSpinner:!0})}:{$height:"70vh",children:t(Ce,{subTitle:Ge.COULD_NOT_FETCH_PEER_SOURCES})}):e(re,{$gap:16,$alignItems:"flex-start",children:[t(yc,{icon:Pi,title:Ge.INBOUND,subTitle:Ge.INBOUND_DESCRIPTION(n),onRefresh:r,items:s?.inbound??[]}),t(yc,{icon:_i,title:Ge.OUTBOUND,subTitle:Ge.OUTBOUND_DESCRIPTION(n),onRefresh:r,items:s?.outbound??[]})]})},yc=({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(It,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:le.XS,subTitle:i,subTitleSize:le.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:qt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ri,onClick:l}}],children:[t(Zt,{value:c,onChange:d,width:"100%"}),t(Qt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(at,{$height:"50vh",children:t(Ce,{icon:o,title:Ge.NO_RESULTS,subTitle:Ge.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(Sc,{...e},`${n}-${e.serviceName}`)):[t(at,{$height:"50vh",children:t(Ce,{icon:o,title:`No ${n} connections yet`,subTitle:n===Ge.INBOUND?Ge.NO_INBOUND_CONNECTIONS_DESCRIPTION:Ge.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Cc=m.div`
236
236
  display: flex;
237
237
  align-items: center;
238
238
  justify-content: space-between;
@@ -246,9 +246,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
246
246
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
247
247
  }
248
248
  `}
249
- `,sc=({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[Ri];const e=s?Qt(s):void 0;return e?.length?e:[Ai]},[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(rc,{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})]})},cc=({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:Pi,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(yl,{bgTint:"800",codeBgColor:l.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(oo,{size:1}):t(yl,{bgTint:"800",codeBgColor:l.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g})]})},dc=({title:o,children:n})=>e(V,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,children:o}),n]}),uc=({source:o})=>{const n=a(()=>{const[e,t]=no(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(dc,{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})]})})},pc=({source:o})=>{const{CopyButton:n}=ao();return t(dc,{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})]})})},hc=({source:e})=>t(dc,{title:Be.KIND,children:t(oe,{children:t(Pt,{variant:Gt.Blue,label:e.id.kind})})}),gc=({source:o})=>{const{CopyButton:n}=ao();return t(dc,{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})]})})},mc=({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(uc,{source:o}),!n&&t(pc,{source:o}),t(hc,{source:o}),t(gc,{source:o})]})})},fc=({source:e})=>t(xt,{bgTint:"900",children:t(Xs,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}),bc=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?io(e.workloadOdigosHealthStatus.status):pt.Unknown,title:Ot(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Mt,{...o,width:"100%"}):null},vc="calc(50% - 6px)",yc=({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:Ii,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:Ii,tooltip:Be.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||r?e(oe,{$gap:12,$alignItems:"stretch",children:[l&&t(Mt,{invertColors:!0,slim:!0,width:r?vc:"100%",...l}),r&&t(Mt,{invertColors:!0,slim:!0,width:vc,...r})]}):null},Cc=p(null),Sc=m.div`
249
+ `,Sc=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=eo(e=>e.drawerEntityId),{items:r}=rl({subscribe:bc}).sourcesApi,s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(to(s))!==JSON.stringify(to(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[oo({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[Li];const e=s?no(s):void 0;return e?.length?e:[Fi]},[n,i,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=eo.getState();e(mt.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(re,{$gap:8,children:[t(ao,{icons:d}),t(ae,{size:le.XXS,children:o})]}),n&&t(Be,{status:Ie.Info,label:Ge.VIRTUAL,textSize:le.XXXS,invertColors:!0,tooltip:Ge.VIRTUAL_TOOLTIP})]})},wc=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},Tc=({source:o})=>{const i=f(),{k8sManifestApi:l}=rl(),[s,c]=r(!0),[d,u]=r(void 0),[p,h]=r(!0),[g,m]=r(void 0);n(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>u(wc(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:io.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>m(wc(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const b=a(()=>[{label:Ge.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:Ge.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:Ge.GET_POD_YAML,value:`kubectl get ${io.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(It,{bgTint:"1000",children:[t(It,{bgTint:"900",richTitle:{icon:zi,title:Ge.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:b.map(({label:e,value:o})=>t(Jt,{label:e,value:o},e))}),s?t(lo,{size:1}):t(El,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(lo,{size:1}):t(El,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:g})]})},xc=({title:o,children:n})=>e(W,{$gap:8,children:[t(ae,{size:le.XXXS,color:ie.Secondary,children:o}),n]}),kc=({source:o})=>{const n=a(()=>{const[e,t]=ro(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(xc,{title:Ge.THROUGHPUT_LAST_10_SECONDS,children:e(re,{$alignItems:"flex-end",$gap:4,children:[t(ae,{size:le.L,children:n.value}),t(ae,{size:le.XS,variant:yt.Span,children:n.units})]})})},Ec=({source:o})=>{const{CopyButton:n}=so();return t(xc,{title:Ge.NAMESPACE,children:e(re,{children:[t(zt,{variant:Yt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:st.XS})]})})},Ic=({source:e})=>t(xc,{title:Ge.KIND,children:t(re,{children:t(zt,{variant:Yt.Blue,label:e.id.kind})})}),$c=({source:o})=>{const{CopyButton:n}=so();return t(xc,{title:Ge.NAME,children:e(re,{children:[t(zt,{variant:Yt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:st.XS})]})})},Ac=({source:o})=>{const{isVm:n}=y();return t(It,{children:e(re,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!n&&t(kc,{source:o}),!n&&t(Ec,{source:o}),t(Ic,{source:o}),t($c,{source:o})]})})},Nc=({source:e})=>t(It,{bgTint:"900",children:t(Qs,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}),Oc=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?co(e.workloadOdigosHealthStatus.status):ft.Unknown,title:Pt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Gt,{...o,width:"100%"}):null},Rc="calc(50% - 6px)",Dc=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Ht(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Pt(t):`${Ge.ROLLOUT} ${Pt(t)}`,subTitle:a,action:i!==Ie.Success?{icon:Ri,tooltip:Ge.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),r=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=Ht(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Pt(t):`${Ge.ROLLBACK} ${Pt(t)}`,subTitle:n,action:a!==Ie.Success?{icon:Ri,tooltip:Ge.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||r?e(re,{$gap:12,$alignItems:"stretch",children:[l&&t(Gt,{invertColors:!0,slim:!0,width:r?Rc:"100%",...l}),r&&t(Gt,{invertColors:!0,slim:!0,width:Rc,...r})]}):null},Fc=p(null),Pc=m.div`
250
250
  position: relative;
251
- `,wc=({children:e})=>{const o=i(null);return t(Sc,{ref:o,children:t(Cc.Provider,{value:o,children:e})})},xc=m.div`
251
+ `,_c=({children:e})=>{const o=i(null);return t(Pc,{ref:o,children:t(Fc.Provider,{value:o,children:e})})},Lc=m.div`
252
252
  position: fixed;
253
253
  top: ${({$coords:e})=>e.top}px;
254
254
  right: ${({$coords:e})=>e.right}px;
@@ -262,14 +262,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
262
262
  padding: 12px 16px;
263
263
  border-radius: 12px;
264
264
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
265
- `,Tc=m.div`
265
+ `,zc=m.div`
266
266
  display: flex;
267
267
  align-items: flex-end;
268
268
  justify-content: space-between;
269
269
  gap: 8px;
270
- `,kc=m.div`
270
+ `,Mc=m.div`
271
271
  flex: 1;
272
- `,$c=({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(Cc),[y,C]=r(null);return lo(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Vl(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(Tc,{children:[t(kc,{children:p}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${m||0} 0`,children:[t(ne,{variant:ie.Secondary,onClick:l,leftIcon:ai,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ae.S,textColor:b.v2.colors.red[500]}),t(ne,{variant:ie.Primary,onClick:a,leftIcon:yi,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ae.S})]})]}),t("div",{children:t(Se,{status:we.Warning,message:u})})]}),document.body):null},Ec=({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=ro[o].community,t=s===ht.Onprem?ro[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(wc,{children:[t(Ie,{text:Be.OVERRIDE_OTEL_DISTRO_NAME,children:t(ot,{icon:ui,onClick:b})}),m&&t($c,{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])})})]})]})},Ic=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:s}=Dt(),{formData:c,handleFormChange:d,resetFormData:u}=$t(i),p=a(()=>so.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(wc,{children:[t(Ie,{text:Be.OVERRIDE_RUNTIME_DETAILS,children:t(ot,{icon:ui,onClick:b})}),m&&t($c,{width:"500px",onClose:b,onSave:async()=>{!c.version||co(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"}`})]})})]})]})},Nc=({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(Rc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},Ac=m.div`
272
+ `,Bc=({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(Fc),[y,C]=r(null);return uo(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Jl(e(Lc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(W,{$gap:4,children:[t(ae,{size:le.XXS,children:c}),t(ae,{size:le.XXXS,color:ie.Secondary,children:d})]}),e(zc,{children:[t(Mc,{children:p}),e(re,{$gap:8,$width:"fit-content",$margin:`0 0 ${m||0} 0`,children:[t(se,{variant:de.Secondary,onClick:l,leftIcon:si,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ce.S,textColor:b.v2.colors.red[500]}),t(se,{variant:de.Primary,onClick:a,leftIcon:Ti,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ce.S})]})]}),t("div",{children:t(Ee,{status:Ie.Warning,message:u})})]}),document.body):null},Xc=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=Nt(l),p=a(()=>{if(!o)return[];const e=po[o].community,t=s===bt.Onprem?po[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(re,{$gap:4,$alignItems:"center",children:[n?t(Be,{status:Ie.Info,invertColors:!0,label:Ge.OVERIDDEN}):null,e(_c,{children:[t(De,{text:Ge.OVERRIDE_OTEL_DISTRO_NAME,children:t(rt,{icon:mi,onClick:b})}),m&&t(Bc,{width:"500px",onClose:b,onSave:async()=>{g(!0),await i(c),g(!1),b()},saveTooltip:Ge.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await i({otelDistroName:null}),g(!1),b()},deleteTooltip:Ge.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Ge.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Ge.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Ge.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(lt,{label:Ge.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Vc=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:s}=_t(),{formData:c,handleFormChange:d,resetFormData:u}=Nt(i),p=a(()=>ho.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(re,{children:[o?t(Be,{status:Ie.Info,invertColors:!0,label:Ge.OVERIDDEN}):null,e(_c,{children:[t(De,{text:Ge.OVERRIDE_RUNTIME_DETAILS,children:t(rt,{icon:mi,onClick:b})}),m&&t(Bc,{width:"500px",onClose:b,onSave:async()=>{!c.version||go(c.version)?(g(!0),await n(c),g(!1),b()):s({type:Ie.Warning,message:Lt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Ge.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),b()},deleteTooltip:Ge.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Ge.OVERRIDE_RUNTIME_DETAILS,subTitle:Ge.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Ge.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(re,{$gap:8,children:[t(lt,{label:Ge.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(be,{label:Ge.RUNTIME_VERSION,placeholder:Ge.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Uc=({source:e})=>{const{isVm:o}=y(),{containers:n,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?Ge.DETECTED_PROCESSES:`${e.id.kind} ${Ge.CONTAINERS}`,tooltip:t?.message||(o?Ge.DETECTED_PROCESSES_DESCRIPTION:Ge.DETECTED_CONTAINERS_DESCRIPTION),badge:Ht(t?.status)===Kt.Loading?{status:Kt.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(It,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(W,{$gap:8,children:n.map(o=>o&&t(Wc,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},Gc=m.div`
273
273
  display: flex;
274
274
  flex-direction: column;
275
275
  align-self: stretch;
@@ -277,28 +277,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
277
277
  padding: 8px 12px;
278
278
  border-radius: 8px;
279
279
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
280
- `,Oc=m.div`
280
+ `,Hc=m.div`
281
281
  display: flex;
282
282
  align-items: center;
283
283
  justify-content: center;
284
284
  padding: 8px;
285
285
  border-radius: 10px;
286
286
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
287
- `,Dc=m.div`
287
+ `,jc=m.div`
288
288
  display: flex;
289
289
  flex-direction: column;
290
290
  gap: 12px;
291
291
  padding: 8px 12px;
292
292
  border-radius: 8px;
293
293
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
294
- `,Rc=({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:uo(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?Ai:_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?ri:si,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(Ac,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Oc,{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(Ic,{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(Ec,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!r||r.agentEnabled||g?null:t(Dc,{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})]})})]})},Pc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>{const{isVm:l}=y();return e(V,{$gap:12,children:[t(mc,{source:o}),t(bc,{source:o}),!l&&t(yc,{source:o,onClickRollout:n,onClickRollback:a}),!l&&t(Nc,{source:o,onOverride:i}),!l&&t(fc,{source:o})]})};function Fc(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 Lc(e){const t=Math.abs(e);return t>=1e9?`${_c(e/1e9)}s`:t>=1e6?`${_c(e/1e6)}ms`:t>=1e3?`${_c(e/1e3)}μs`:String(Math.round(e))}function _c(e){return e.toFixed(2).replace(/\.?0+$/,"")}function zc(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 Bc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Mc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Xc(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=zc(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(Fc(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&&Fc(e,l.nameIndex)===Fc(e,t.nameIndex)&&a.add(Bc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(Bc(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(Bc(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=Fc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:r,name:s,matchesSearch:Mc(s,b)}})}function Vc(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 Uc,Hc;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Uc||(Uc={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Hc||(Hc={}));function Gc(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function jc(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 Wc(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 Kc=({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,T]=r(""),[k,$]=r(null),[E,I]=r([]),[N,A]=r(!1),[O,D]=r(Uc.Fit),[R,P]=r(Hc.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(()=>Xc(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=jc((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,V);if(n){const e=Bc(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";T(`${n.name}\ntotal ${Lc(n.size)} (${t}% of view, ${a}% of profile) · self ${Lc(n.self)}`)}else $(null),T("")},[V,o.numTicks,z,_,M]),H=l(e=>{U(e)},[U]),G=l(()=>{$(null),T("")},[]),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=jc((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}=Vc(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=Gc(d,r),m=`${s} (${Lc(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(Bc(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,k,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,_,z)))},[X,o.numTicks,k,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=zc(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?Fc(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:Fi,onClick:de,disabled:!E.length}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:Li,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:ii,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:po.Filled,options:[{value:Uc.Fit,label:"W: Fit"},{value:Uc.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:po.Filled,options:[{value:Hc.Fit,label:"H: Fit"},{value:Hc.X10,label:"10x"}],selected:R,setSelected:P})})]}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:24,leftIcon:N?Ci:_i,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:k?"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} • ${Lc(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 · ${Wc(h.totalBytesUsed)} / ${Wc(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var Yc,Jc;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Yc||(Yc={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Jc||(Jc={}));const qc=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function Zc(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Jc.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Jc.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&qc.test(o)))return!1}return!0}const Qc={options:[{id:Jc.FilterOutVoid,label:"Filter out void symbols"},{id:Jc.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>Zc(e.cells.find(e=>e.key===Yc.Symbol)?.rawValue?.toString()??"",t)},ed=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:Yc.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(ho.Java)?Qc:void 0,noFilter:!o?.includes(ho.Java)},{key:Yc.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Yc.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:Yc.Symbol,rawValue:e.name},{key:Yc.Self,rawValue:Lc(e.self)},{key:Yc.Total,rawValue:Lc(e.total)}]})),[e]);return t(go,{variant:mo.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 td;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(td||(td={}));const od=m(V)`
294
+ `,Wc=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=f(),{sourcesApi:d}=rl(),u=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=a(()=>({language:Wt(n),version:mo(n)||void 0}),[n]),h=a(()=>!!s?.otelDistroName,[s]),g=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),m=a(()=>!l&&!u,[l,u]),b=a(()=>m?Fi:Ve(p.language),[m,p]),v=a(()=>{if(m)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[m,p]),y=a(()=>m?{status:Kt.Loading,label:Ge.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Ie.Success:Kt.Disabled,leftIcon:r?.otelDistroName?ui:pi,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[m,r]),C=e=>d.update(o,{containerName:i,...h?g:{},...u?p:{},...e}),S=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Ge.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Ge.TAIL_SAMPLING),e},[n]);return e(Gc,{children:[e(re,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(re,{$gap:8,$alignItems:"center",children:[t(Hc,{children:t(b,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(ae,{children:i}),t(zt,v?{variant:Yt.Blue,label:v}:{variant:Yt.Loader,label:Ge.DETECTING_RUNTIME_INFO}),t(Vc,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(re,{$gap:8,$alignItems:"center",children:[t(Be,{...y,textSize:le.XXXS}),t(Xc,{language:p.language,overridden:h,onOverride:C,defaultValues:g})]})]}),!r||r.agentEnabled||m?null:t(jc,{children:e(re,{$gap:10,$alignItems:"center",children:[t(zt,{variant:Yt.Pink,label:Pt(r.agentEnabledStatus?.reasonEnum)||Ge.NO_AVAILABLE_AGENT}),t(ae,{size:le.XXXS,color:ie.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(jc,{children:t(re,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(Be,{label:e,leftIcon:ui,status:Ie.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},Kc=({source:o,onClickRollout:n,onClickRollback:a})=>{const{isVm:i}=y();return e(W,{$gap:12,children:[t(Ac,{source:o}),t(Oc,{source:o}),!i&&t(Dc,{source:o,onClickRollout:n,onClickRollback:a}),!i&&t(Uc,{source:o}),!i&&t(Nc,{source:o})]})};function Yc(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 Jc(e){const t=Math.abs(e);return t>=1e9?`${qc(e/1e9)}s`:t>=1e6?`${qc(e/1e6)}ms`:t>=1e3?`${qc(e/1e3)}μs`:String(Math.round(e))}function qc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Zc(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 Qc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function ed(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function td(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=Zc(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(Yc(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&&Yc(e,l.nameIndex)===Yc(e,t.nameIndex)&&a.add(Qc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(Qc(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(Qc(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=Yc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:r,name:s,matchesSearch:ed(s,b)}})}function od(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 nd,ad;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(nd||(nd={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(ad||(ad={}));function id(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function ld(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 rd(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 sd=({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}),[T,x]=r(""),[k,E]=r(null),[I,$]=r([]),[A,N]=r(!1),[O,R]=r(nd.Fit),[D,F]=r(ad.Fit),[P,_]=r(!1),L=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*D),8192)),M=I.length>0?I[I.length-1]:null,B=M?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,$([]))},[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(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),n(()=>(p?.(A),()=>{A&&p?.(!1)}),[A,p]);const X=a(()=>td(o,L,z,s,c,{zoomRoot:M,shouldKeepName:d,collapseRecursive:P}),[o,s,c,z,L,M,d,P]),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(L<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=ld((e.clientX-t.left)/t.width*L,(e.clientY-t.top)/t.height*z,V);if(n){const e=Qc(n);E(e);const t=B>0?(100*n.size/B).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";x(`${n.name}\ntotal ${Jc(n.size)} (${t}% of view, ${a}% of profile) · self ${Jc(n.self)}`)}else E(null),x("")},[V,o.numTicks,z,L,B]),G=l(e=>{U(e)},[U]),H=l(()=>{E(null),x("")},[]),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(L<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=ld((e.clientX-n.left)/n.width*L,(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);$(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,L]);g(()=>{const e=v.current;if(!e||L<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(L,z),a=Math.min(t,16384/n);e.width=Math.floor(L*a),e.height=Math.floor(z*a),e.style.width=`${L}px`,e.style.height=`${z}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,L,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}=od(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=id(d,r),m=`${s} (${Jc(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(Qc(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,L,z,X,c,m,k,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,L,z)))},[X,o.numTicks,k,c,z,L,m]);const K=l(()=>N(e=>!e),[]),Y=o.numTicks>0?Math.max(0,Math.min(100,Math.round(B/o.numTicks*100))):100,J=a(()=>function(e,t){const o=Zc(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]),q=null!==J,Z=I.length>0,te=M?Yc(o,M.nameIndex):"",oe=l(()=>$([]),[]),ne=l(()=>$(e=>e.slice(0,-1)),[]),pe=l(()=>{J&&$(e=>[...e,J])},[J]);return e("div",{style:A?{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(re,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(Q,{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:ee.Left,size:vt.S,value:P,onChange:_}),e(re,{$gap:8,children:[e(re,{children:[t(se,{variant:de.Secondary,size:ce.S,label:"Reset zoom",leftIcon:Mi,onClick:oe,disabled:!I.length}),t(se,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:Bi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!Z,onClick:ne}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,align:"center",children:`${Y}%`})}),t(se,{variant:de.Secondary,size:ce.S,iconSize:20,leftIcon:ci,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!q,onClick:pe})]}),e(re,{children:[t(De,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:fo.Filled,options:[{value:nd.Fit,label:"W: Fit"},{value:nd.X10,label:"10x"}],selected:O,setSelected:R})}),t(De,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:fo.Filled,options:[{value:ad.Fit,label:"H: Fit"},{value:ad.X10,label:"10x"}],selected:D,setSelected:F})})]}),t(se,{variant:de.Secondary,size:ce.S,iconSize:24,leftIcon:A?xi:Xi,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:K})]})]}),t(De,{fullWidth:!0,keepAlive:!0,text:T,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:D>1?"auto":"hidden"},children:t("div",{style:{width:L||"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:k?"pointer":"default"},onPointerDown:j,onPointerMove:G,onPointerLeave:H,onClick:W})})})}),e(re,{$justifyContent:"space-between",children:[t(ae,M?{size:le.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${te} • ${Jc(B)} samples in view`}:{size:le.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(ae,{size:le.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${rd(h.totalBytesUsed)} / ${rd(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var cd,dd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(cd||(cd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(dd||(dd={}));const ud=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function pd(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(dd.FilterOutVoid)&&"void"===o)return!1;if(t.includes(dd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&ud.test(o)))return!1}return!0}const hd={options:[{id:dd.FilterOutVoid,label:"Filter out void symbols"},{id:dd.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>pd(e.cells.find(e=>e.key===cd.Symbol)?.rawValue?.toString()??"",t)},gd=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:cd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(bo.Java)?hd:void 0,noFilter:!o?.includes(bo.Java)},{key:cd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:cd.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:cd.Symbol,rawValue:e.name},{key:cd.Self,rawValue:Jc(e.self)},{key:cd.Total,rawValue:Jc(e.total)}]})),[e]);return t(vo,{variant:yo.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:Vi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var md;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(md||(md={}));const fd=m(W)`
295
295
  width: 100%;
296
296
  flex: 1;
297
297
  border-radius: 16px;
298
298
  overflow: hidden;
299
299
  background: ${({theme:e})=>e.v2.colors.silver[800]};
300
300
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
301
- `,nd=m.div`
301
+ `,bd=m.div`
302
302
  display: flex;
303
303
  align-items: center;
304
304
  gap: 10px;
@@ -306,11 +306,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
306
306
  padding: 12px 12px 8px;
307
307
  background: ${({theme:e})=>e.v2.colors.silver[800]};
308
308
  border-radius: 16px 16px 0 0;
309
- `,ad=m(oe)`
309
+ `,vd=m(re)`
310
310
  flex-shrink: 0;
311
311
  align-items: center;
312
312
  gap: 4px;
313
- `,id=m.div`
313
+ `,yd=m.div`
314
314
  flex: 1;
315
315
  display: flex;
316
316
  align-items: stretch;
@@ -318,20 +318,51 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
318
318
  padding: 16px;
319
319
  background: ${({theme:e})=>e.v2.colors.silver[800]};
320
320
  border-radius: 0 0 16px 16px;
321
- `,ld=m(V)`
321
+ `,Cd=m(W)`
322
322
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
323
323
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
324
324
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
325
325
  gap: 10px;
326
- `,rd=m(V)`
326
+ `,Sd=m(W)`
327
327
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
328
328
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
329
329
  gap: 10px;
330
- `,sd=m(oe)`
330
+ `,wd=m(re)`
331
331
  width: 100%;
332
332
  min-height: 32px;
333
333
  flex-shrink: 0;
334
- `,cd=({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),[T,k]=r(td.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=Fc(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=T===td.Table||T===td.Both,L=T===td.Flame||T===td.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(ho.Java))return;const o=e?.[Yc.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>Zc(e,o):void 0}(I,z),[I,z]);return!C&&w<2?t(Qe,{$height:"70vh",children:t(at,{withSpinner:!0})}):e(od,{$gap:0,$width:"100%",children:[e(nd,{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(ad,{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:po.Filled,options:[{value:td.Table,label:"Top table"},{value:td.Flame,label:"Flame graph"},{value:td.Both,label:"Both"}],selected:T,setSelected:k}),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(Bi,{...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(Bi,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(id,{$gap:F&&L?16:0,children:D?e(s,{children:[F&&e(ld,{$splitWithFlame:_,children:[t(sd,{$justifyContent:"flex-end",children:t(ne,{variant:ie.Secondary,size:ae.S,label:"Download snapshot",rightIcon:Mi,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(ed,{rows:P,languages:z,filters:I,onFiltersChange:N})]}),L&&e(rd,{$splitWithTable:_,children:[e(sd,{$justifyContent:"space-between",children:[t(Fe,{label:D?`Total in view ${Lc(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:Ii,onClick:O}),t(K,{label:"Auto refresh",labelAlign:Y.Left,size:gt.S,value:m,onChange:b})]})]}),t(Kc,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:$,shouldKeepName:B,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},T)]})]}):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."})})})]})},dd=[to.Deployment,to.StatefulSet,to.DaemonSet,to.DeploymentConfig,to.Rollout,to.Pod];var ud;!function(e){e.Workload="Workload",e.Pod="Pod"}(ud||(ud={}));const pd=e=>!!e&&Xt(e.status)===we.Error,hd=e=>pd(e.healthStatus),gd=e=>pd(e.odigosHealthStatus)||(e.processes??[]).some(hd),md=e=>pd(e.agentInjectedStatus)||pd(e.odigosHealthStatus)||(e.containers??[]).some(gd),fd=({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:T}=y(),{selectedStreamName:k}=Me(),{genericForm:$,loadSource:E,validateFormData:I}=El(),[N,A]=r(!1),[O,D]=r(!1),[R,P]=r(!1),[F,L]=r(zs.Overview),[_,z]=r(null),[B,M]=r({openFor:null}),X=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:zs.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:zs.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=Hs({identifyingAttributes:n.identifyingAttributes});t({tab:zs.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=_&&dd.includes(_.id.kind),j=a(()=>{const e=[],o=(_?.pods??[]).some(md);return e.push({value:zs.Overview,label:Be.OVERVIEW}),T||(e.push({value:zs.Pods,label:Be.PODS,icon:o?e=>t(Ni,{...e,fill:x.v2.colors.red[500]}):void 0}),e.push({value:zs.PeerSources,label:Be.PEER_SOURCES}),s?.profiling?.enabled&&e.push({value:zs.Profiling,label:Be.PROFILING}),e.push({value:zs.Debug,label:Be.DEBUG})),e},[T,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:k}]}),D(!1),o())},[_,u,k,o]),Q=l(()=>{M({openFor:ud.Workload})},[]),ee=l(e=>{L(e),X.clearJumpToTarget()},[X]),oe=l(async()=>{await m(c)},[m,c]),ne=l(async()=>{B.openFor===ud.Workload?await h([c]):B.openFor===ud.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===zs.Overview&&(e.push({id:"edit-source-btn-edit",label:St.EDIT,icon:ui,active:N,onClick:W}),!T&&G&&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:ai,color:x.v2.colors.red[500],active:O,onClick:J})),e},[F,N,O,T,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:T?void 0:Ei}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:$i,textColor:x.v2.colors.silver[200]}),e},[_,x,T]);if(!_)return t(q,{isOpen:!0,children:t(Qe,{$height:"80vh",children:t(at,{withSpinner:!0})})});const se=F===zs.Profiling?R?"95vw":"80vw":N?void 0:"60vw";return e(Qs,{value:X,children:[t(q,{isOpen:!0,width:se,header:{icon:T?Vi:fo(_.containers)[0],titleBadges:re,onClose:()=>{ee(zs.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 zs.Overview:return N?t(Mr,{}):t(Pc,{source:_,onClickRollout:Q,onClickRollback:oe,onOverride:e=>p(c,e)});case zs.Pods:return t(ac,{source:_,onClickRestartPod:G?(e,t)=>M({openFor:ud.Pod,podNamespace:e,podName:t}):void 0});case zs.PeerSources:return t(ic,{source:_,fetchPeerSources:b});case zs.Profiling:return t(cd,{source:_,fetchProfilingSlots:C,enableProfiling:v,fetchSourceProfiling:S,onFlameFullscreenChange:P});case zs.Debug:return t(cc,{source:_,fetchK8sManifest:w});default:return null}})()]})})}),t(bl,{target:"source",action:"uninstrument",isOpen:O,onClose:()=>D(!1),onApprove:Z}),t(bl,{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})]})},bd=m.div`
334
+ `,Td=({source:o,onFlameFullscreenChange:l})=>{const c=f(),d=o.id,[u,p]=r(!0),[h,g]=r(md.Both),[m,b]=r(""),[v,y]=r({}),[C,{called:S}]=cl("ENABLE_SOURCE_PROFILING"),w=i(!1);n(()=>{w.current||(w.current=!0,C(d))},[C,d]);const{data:T}=sl("GET_PROFILING_SLOTS",void 0,{skip:!S,pollInterval:3e3,fetchPolicy:"network-only"}),[x,k]=r(0),{data:E,refetch:I}=sl("GET_SOURCE_PROFILING",d,{skip:!S||!u,pollInterval:3e3,fetchPolicy:"network-only",onCompleted:()=>k(e=>e+1)}),$=E?.profileJson??null,A=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}}($),[$]),N=a(()=>A?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=Yc(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)}(A.flamebearer):[],[A]),O=a(()=>{const e=m.trim().toLowerCase();return e?N.filter(t=>t.name.toLowerCase().includes(e)):N},[N,m]),R=h===md.Table||h===md.Both,D=h===md.Flame||h===md.Both,F=R&&D,P=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),_=a(()=>function(e,t){if(!t?.includes(bo.Java))return;const o=e?.[cd.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>pd(e,o):void 0}(v,P),[v,P]);return!$&&x<2?t(at,{$height:"70vh",children:t(ct,{withSpinner:!0})}):e(fd,{$gap:0,$width:"100%",children:[e(bd,{children:[t(De,{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(vd,{children:t(ae,{size:le.S,weight:500,color:ie.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(re,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Zt,{value:m,onChange:b,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:c.v2.colors.silver[900],emphasizeBackgroundColor:c.v2.colors.silver[800]})}),t(ue,{variant:fo.Filled,options:[{value:md.Table,label:"Top table"},{value:md.Flame,label:"Flame graph"},{value:md.Both,label:"Both"}],selected:h,setSelected:g}),t(se,u?{variant:de.Secondary,size:ce.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(Ui,{...e,size:8,fill:c.v2.colors.green[500]})}:{variant:de.Secondary,size:ce.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Ui,{...e,size:8,fill:c.v2.colors.red[500]})})]})]}),t(yd,{$gap:R&&D?16:0,children:A?e(s,{children:[R&&e(Cd,{$splitWithFlame:F,children:[t(wd,{$justifyContent:"flex-end",children:t(se,{variant:de.Secondary,size:ce.S,label:"Download snapshot",rightIcon:Gi,onClick:()=>{if(!$)return;const e=new Blob([$],{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:!$})}),t(gd,{rows:O,languages:P,filters:v,onFiltersChange:y})]}),D&&e(Sd,{$splitWithTable:F,children:[e(wd,{$justifyContent:"space-between",children:[t(Be,{label:A?`Total in view ${Jc(A.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:c.v2.colors.silver[750],textColor:c.v2.colors.silver[200],textSize:le.XXS}),e(re,{$gap:12,children:[!u&&t(se,{variant:de.Secondary,size:ce.S,label:"Refresh",leftIcon:Ri,onClick:I}),t(Q,{label:"Auto refresh",labelAlign:ee.Left,size:vt.S,value:u,onChange:p})]})]}),t(sd,{flamebearer:A.flamebearer,maxRowPx:24,searchQuery:m,shouldKeepName:_,minHostHeight:280,onFullscreenChange:l,profilingSlots:T??null},h)]})]}):t(at,{children:t(Ce,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},xd=m.div`
335
+ position: relative;
336
+ display: flex;
337
+ align-items: center;
338
+ gap: 8px;
339
+ padding: 8px 16px;
340
+ border-radius: 12px;
341
+ background-color: ${({theme:e})=>e.v2.colors.silver[700]};
342
+ `,kd=m.div`
343
+ display: flex;
344
+ flex-direction: column;
345
+ gap: 4px;
346
+ flex: 1;
347
+ min-width: 0;
348
+ `,Ed=m.div`
349
+ min-width: 0;
350
+ white-space: pre;
351
+ overflow-x: auto;
352
+ `,Id=m.div`
353
+ position: absolute;
354
+ top: 50%;
355
+ right: 8px;
356
+ transform: translateY(-50%);
357
+ opacity: 0;
358
+ pointer-events: none;
359
+ transition: opacity 0.15s ease;
360
+
361
+ ${xd}:hover & {
362
+ opacity: 1;
363
+ pointer-events: auto;
364
+ }
365
+ `,$d=({name:o,summary:n,onJumpToRule:a})=>e(xd,{children:[e(kd,{children:[o&&t(ae,{size:le.XXXS,color:ie.Secondary,nowrap:!0,children:o}),t(Ed,{children:t(S,{parts:n})})]}),a&&t(Id,{children:t(De,{text:Ge.OPEN_IN_SAMPLING_PAGE,children:t(se,{"data-id":"sampling-rule-jump",variant:de.Primary,size:ce.S,leftIcon:Xi,onClick:a})})})]}),Ad=({source:e,onRedirectToSampling:o})=>t(It,{bgTint:"1000",richTitle:{title:Ge.SAMPLING},children:e.containers?.map(e=>t(Rd,{container:e,onRedirectToSampling:o},e.containerName))});var Nd;!function(e){e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"}(Nd||(Nd={}));const Od=e=>"noisy"===e.type?w(e.rule):"highlyRelevant"===e.type?T(e.rule):"costReduction"===e.type?x(e.rule):[],Rd=({container:o,onRedirectToSampling:n})=>{const[i,l]=r(Nd.All),s=eo(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=a(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),u=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===Nd.Noisy?d:i===Nd.HighlyRelevant?u:i===Nd.CostReduction?p:[...d,...u,...p],[i,u,p]),g=a(()=>(e,t)=>{s({ruleId:e,category:t}),n()},[n,s]);return e(It,{bgTint:"900",richTitle:{title:o.containerName},withCollapse:!0,collapseIsDefaultOpen:!0,children:[e(It,{bgTint:"800",richTitle:{title:Ge.HEAD_SAMPLING,badge:{label:c.length}},withCollapse:!0,collapseIsDefaultOpen:!!c.length,children:[t(ae,{size:le.XXS,children:Ge.NOISY_OPERATIONS}),t(W,{$gap:4,children:c.length?c.map(e=>t($d,{name:e.name,summary:w(e),onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId)):t(Ce,{title:"No noisy operations"})})]}),e(It,{bgTint:"800",richTitle:{title:Ge.TAIL_SAMPLING,badge:{label:d.length+u.length+p.length}},withCollapse:!0,collapseIsDefaultOpen:!!h.length,children:[t(ue,{options:(m=d.length,f=u.length,b=p.length,[{value:Nd.All,label:"All",badge:{label:m+f+b,textSize:le.XXXS}},{value:Nd.Noisy,label:Ge.NOISY_OPERATIONS,badge:{label:m,textSize:le.XXXS}},{value:Nd.HighlyRelevant,label:Ge.HIGHLY_RELEVANT_OPERATIONS,badge:{label:f,textSize:le.XXXS}},{value:Nd.CostReduction,label:Ge.COST_REDUCTION_OPERATIONS,badge:{label:b,textSize:le.XXXS}}]),selected:i,setSelected:l}),t(W,{$gap:4,children:h.length?h.map(e=>t($d,{name:e.rule.name,summary:Od(e),onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Ce,{title:`No ${i===Nd.All?`${Nd.Noisy}, ${Nd.HighlyRelevant} and ${Nd.CostReduction}`:i} operations`})})]})]});var m,f,b},Dd=[io.Deployment,io.StatefulSet,io.DaemonSet,io.DeploymentConfig,io.Rollout,io.Pod];var Fd;!function(e){e.Workload="Workload",e.Pod="Pod"}(Fd||(Fd={}));const Pd=e=>!!e&&Ht(e.status)===Ie.Error,_d=e=>Pd(e.healthStatus),Ld=e=>Pd(e.odigosHealthStatus)||(e.processes??[]).some(_d),zd=e=>Pd(e.agentInjectedStatus)||Pd(e.odigosHealthStatus)||(e.containers??[]).some(Ld),Md=({onClose:o,sourceId:s,onRedirectToSampling:c})=>{const d=f(),{isVm:u}=y(),{sourcesApi:p}=rl(),{selectedStreamName:h}=He(),{genericForm:g,loadSource:m,validateFormData:b}=Pl(),{data:v}=sl("GET_EFFECTIVE_CONFIG"),[C,S]=r(!1),[w,T]=r(!1),[x,k]=r(!1),[E,I]=r(Js.Overview),[$,A]=r(null),[N,O]=r({openFor:null}),R=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:Js.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:Js.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=oc({identifyingAttributes:n.identifyingAttributes});t({tab:Js.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(()=>{R.jumpToTarget&&I(R.jumpToTarget.tab)},[R.jumpToTarget]),n(()=>{$&&JSON.stringify(to(s))!==JSON.stringify(to($))&&A(null)},[s,$]);const D=i(!1),F=l(async()=>A(await p.fetchById(s)||null),[s,p]);n(()=>{if(D.current||(F(),D.current=!0),!C){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,C]),n(()=>{$&&m($)},[$]);const P=$&&Dd.includes($.id.kind),_=a(()=>{const e=[],o=($?.pods??[]).some(zd);return e.push({value:Js.Overview,label:Ge.OVERVIEW}),u||(e.push({value:Js.Pods,label:Ge.PODS,icon:o?e=>t(Di,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:Js.PeerSources,label:Ge.PEER_SOURCES}),v?.profiling?.enabled&&e.push({value:Js.Profiling,label:Ge.PROFILING}),e.push({value:Js.Sampling,label:Ge.SAMPLING}),e.push({value:Js.Debug,label:Ge.DEBUG})),e},[u,v,$?.pods]),L=l(()=>S(!0),[]),z=a(()=>()=>{o(),c()},[o,c]),M=l(()=>{$&&m($),S(!1)},[$]),B=l(async()=>{if(!$||!g)return;const{errorMessage:e,preparedFormData:t}=b();if(e)return;const o=t.otelServiceName!==$.id.name?t.otelServiceName:"";await p.update(s,{...t,otelServiceName:o}),S(!1)},[$,g,b,s,p]),X=l(()=>T(!0),[]),V=l(async()=>{$&&(await p.persistV2({[wt]:[{namespace:$.id.namespace,name:$.id.name,kind:$.id.kind,selected:!1,currentStreamName:h}]}),T(!1),o())},[$,p,h,o]),U=l(()=>{O({openFor:Fd.Workload})},[]),G=l(e=>{I(e),R.clearJumpToTarget()},[R]),H=l(async()=>{await p.recoverFromRollback(s)},[p,s]),j=l(async()=>{N.openFor===Fd.Workload?await p.restartWorkloads([s]):N.openFor===Fd.Pod&&N.podNamespace&&N.podName&&await p.restartPod(N.podNamespace,N.podName),O({openFor:null})},[N,p,s]),K=a(()=>{const e=[];return C||E===Js.Overview&&(e.push({id:"edit-source-btn-edit",label:kt.EDIT,icon:mi,active:C,onClick:L}),!u&&P&&e.push({id:"edit-source-btn-restart",label:kt.RESTART,icon:Hi,onClick:U}),e.push({id:"edit-source-btn-delete",label:kt.DELETE,icon:si,color:d.v2.colors.red[500],active:w,onClick:X})),e},[E,C,w,u,P,L,U,X,d]),Y=a(()=>{if(!$)return[];const e=[],t={backgroundColor:"transparent",textSize:le.S};return e.push({...t,label:$.id.name,leftIcon:u?void 0:Oi}),$.serviceName&&$.serviceName!==$.id.name&&e.push({...t,label:$.serviceName,leftIcon:Ni,textColor:d.v2.colors.silver[200]}),e},[$,d,u]);if(!$)return t(oe,{isOpen:!0,children:t(at,{$height:"80vh",children:t(ct,{withSpinner:!0})})});const J=E===Js.Profiling?x?"95vw":"80vw":C?void 0:"60vw";return e(uc,{value:R,children:[t(oe,{isOpen:!0,width:J,header:{icon:u?ji:Co($.containers)[0],titleBadges:Y,onClose:()=>{G(Js.Overview),A(null),k(!1),o()},actions:K},footer:{actions:C?[{"data-id":"edit-source-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:M},{"data-id":"edit-source-btn-save",label:kt.SAVE,variant:de.Primary,onClick:B}]:[]},children:t(Et,{$padding:"4px 12px 12px",children:e(W,{$gap:16,children:[!C&&_.length>1&&t(ue,{options:_,selected:E,setSelected:G}),(()=>{switch(E){case Js.Overview:return C?t(Kr,{}):t(Kc,{source:$,onClickRollout:U,onClickRollback:H});case Js.Pods:return t(fc,{source:$,onClickRestartPod:P?(e,t)=>O({openFor:Fd.Pod,podNamespace:e,podName:t}):void 0});case Js.PeerSources:return t(vc,{source:$});case Js.Profiling:return t(Td,{source:$,onFlameFullscreenChange:k});case Js.Sampling:return t(Ad,{source:$,onRedirectToSampling:z});case Js.Debug:return t(Tc,{source:$});default:return null}})()]})})}),t(xl,{target:"source",action:"uninstrument",isOpen:w,onClose:()=>T(!1),onApprove:V}),t(xl,{target:`${N.openFor?.toLowerCase()??""}`,action:"restart",description:Ge.RESTART_POD_DESCRIPTION,isOpen:!!N.openFor,onClose:()=>O({openFor:null}),onApprove:j,overrideApproveButtonLabel:Ge.DELETE_POD_TO_RESTART})]})},Bd=m.div`
335
366
  display: flex;
336
367
  align-items: center;
337
368
  gap: 8px;
@@ -341,9 +372,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
341
372
  &:hover {
342
373
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
343
374
  }
344
- `,vd=m.div`
375
+ `,Xd=m.div`
345
376
  flex: 1;
346
- `,yd=({onClick:o})=>{const n=f().v2.colors.red[500];return e(bd,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(Q,{size:te.XS,weight:500,color:n,children:Co}),t(ai,{size:16,fill:n})]})};function Cd(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(yd,{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(vd,{}),t(ne,{"data-id":"sampling-view-edit-btn-cancel",label:bo,variant:ie.Secondary,size:ae.S,onClick:a}),t(ne,{"data-id":"sampling-view-edit-btn-save",label:vo,variant:ie.Primary,size:ae.S,onClick:i,disabled:!!r})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(yd,{onClick:a}),t(vd,{}),t(ne,{"data-id":"sampling-view-btn-cancel",label:bo,variant:ie.Secondary,size:ae.S,onClick:i}),t(ne,{"data-id":"sampling-view-btn-edit",label:yo,variant:ie.Primary,size:ae.S,onClick:l})]})}}const Sd={[Nl.EditAutoNoisy]:{title:Oo,subTitle:Ao,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Nl.EditAutoCostReduction]:{title:No,subTitle:Io,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Nl.EditAutoHighlyRelevant]:{title:Eo,subTitle:$o,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},wd=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(q,{isOpen:e,width:Ro,header:{icon:Ui,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(wt,{$padding:"12px",children:t(jr,{})})}),xd=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:r})=>{const{category:s,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=Il(Nl.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:bo,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(wd,{isOpen:e,title:ko[s],subTitle:So[s],onClose:o,footer:g})},Td=({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}=Il(Nl.View),m=s?.rule.name||xo,f=c&&s?wo[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 Cd(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(wd,{isOpen:!!s,title:f,subTitle:s?So[s.category]:"",onClose:e,footer:y})},kd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Il(Nl.EditAutoNoisy),r=l(()=>n(a,i),[n,a,i]);return t(Id,{formType:Nl.EditAutoNoisy,isOpen:e,onClose:o,onSave:r})},$d=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=Il(Nl.EditAutoCostReduction),r=l(()=>n(a,i),[n,a,i]);return t(Id,{formType:Nl.EditAutoCostReduction,isOpen:e,onClose:o,onSave:r})},Ed=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=Il(Nl.EditAutoHighlyRelevant),i=l(()=>n(a),[n,a]);return t(Id,{formType:Nl.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},Id=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=Sd[e];return t(wd,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:bo,variant:ie.Secondary,size:ae.S,onClick:n},{"data-id":i.saveId,label:Do,variant:ie.Primary,size:ae.S,onClick:a}]}})},Nd=e=>{switch(e.formType){case Nl.Create:return t(Fl,{formType:Nl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(xd,{...e})});case Nl.View:return t(Fl,{formType:Nl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Td,{...e})});case Nl.EditAutoNoisy:return t(Fl,{formType:Nl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(kd,{...e})});case Nl.EditAutoCostReduction:return t(Fl,{formType:Nl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t($d,{...e})});case Nl.EditAutoHighlyRelevant:return t(Fl,{formType:Nl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Ed,{...e})})}},Ad=({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 Po({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:Ci,onClick:r,disabled:a}),t(ne,{variant:ie.Primary,size:ae.S,leftIcon:yi,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:ui,onClick:l})]})]})},Od=({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(()=>Fo(e,0)?we.Error:Fo(e,2592e6)?we.Warning:we.Success,[e]),d=a(()=>c===we.Success?yi:c===we.Warning?Hi:Ni,[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})})},Dd=m.div`
377
+ `,Vd=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Bd,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(ae,{size:le.XS,weight:500,color:n,children:xo}),t(si,{size:16,fill:n})]})};function Ud(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Vd,{onClick:l}),r&&t(Ee,{status:Ie.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Xd,{}),t(se,{"data-id":"sampling-view-edit-btn-cancel",label:So,variant:de.Secondary,size:ce.S,onClick:a}),t(se,{"data-id":"sampling-view-edit-btn-save",label:wo,variant:de.Primary,size:ce.S,onClick:i,disabled:!!r})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(Vd,{onClick:a}),t(Xd,{}),t(se,{"data-id":"sampling-view-btn-cancel",label:So,variant:de.Secondary,size:ce.S,onClick:i}),t(se,{"data-id":"sampling-view-btn-edit",label:To,variant:de.Primary,size:ce.S,onClick:l})]})}}const Gd={[Ll.EditAutoNoisy]:{title:Po,subTitle:Fo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Ll.EditAutoCostReduction]:{title:Do,subTitle:Ro,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Ll.EditAutoHighlyRelevant]:{title:Oo,subTitle:No,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Hd=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(oe,{isOpen:e,width:Lo,header:{icon:Wi,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(Et,{$padding:"12px",children:t(es,{})})}),jd=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:r})=>{const{category:s,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=_l(Ll.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:Ie.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:So,variant:de.Secondary,size:ce.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:$o,variant:de.Primary,size:ce.S,onClick:h,disabled:!!u}]};return t(Hd,{isOpen:e,title:Ao[s],subTitle:ko[s],onClose:o,footer:g})},Wd=({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}=_l(Ll.View),m=s?.rule.name||Io,f=c&&s?Eo[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 Ud(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(Hd,{isOpen:!!s,title:f,subTitle:s?ko[s.category]:"",onClose:e,footer:y})},Kd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=_l(Ll.EditAutoNoisy),r=l(()=>n(a,i),[n,a,i]);return t(qd,{formType:Ll.EditAutoNoisy,isOpen:e,onClose:o,onSave:r})},Yd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=_l(Ll.EditAutoCostReduction),r=l(()=>n(a,i),[n,a,i]);return t(qd,{formType:Ll.EditAutoCostReduction,isOpen:e,onClose:o,onSave:r})},Jd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=_l(Ll.EditAutoHighlyRelevant),i=l(()=>n(a),[n,a]);return t(qd,{formType:Ll.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},qd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=Gd[e];return t(Hd,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:So,variant:de.Secondary,size:ce.S,onClick:n},{"data-id":i.saveId,label:_o,variant:de.Primary,size:ce.S,onClick:a}]}})},Zd=e=>{switch(e.formType){case Ll.Create:return t(Ul,{formType:Ll.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(jd,{...e})});case Ll.View:return t(Ul,{formType:Ll.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Wd,{...e})});case Ll.EditAutoNoisy:return t(Ul,{formType:Ll.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Kd,{...e})});case Ll.EditAutoCostReduction:return t(Ul,{formType:Ll.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Yd,{...e})});case Ll.EditAutoHighlyRelevant:return t(Ul,{formType:Ll.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Jd,{...e})})}},Qd=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=so(),g=!i||a||!c.newToken;return zo({key:"Enter",active:!g},s),e(re,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(be,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(re,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(ct,{title:"Saving...",withGradient:!0}):e(o,{children:[t(se,{variant:de.Secondary,size:ce.S,leftIcon:xi,onClick:r,disabled:a}),t(se,{variant:de.Primary,size:ce.S,leftIcon:Ti,onClick:s,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(ae,{size:le.XS,children:new Array(55).fill("•").join("")}),e(re,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(rt,{icon:mi,onClick:l})]})]})},eu=({expiresAt:e,callbackValid:o,callbackExpired:i})=>{const{formatTimeAgo:l}=Bt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Mo(e,0)?Ie.Error:Mo(e,2592e6)?Ie.Warning:Ie.Success,[e]),d=a(()=>c===Ie.Success?Ti:c===Ie.Warning?Ki:Di,[c]);return n(()=>{c===Ie.Success?o():c===Ie.Error&&i()},[c]),t(De,{text:s,children:t(Be,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},tu=m.div`
347
378
  display: flex;
348
379
  flex-direction: column;
349
380
  gap: 12px;
@@ -351,7 +382,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
351
382
  border-radius: 12px;
352
383
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
353
384
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
354
- `,Rd=({children:e})=>{const o=f();return t(Q,{size:te.XXXS,color:o.v2.colors.grey[150],children:e})},Pd=({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:Gi,title:"Odigos Pro Token"},children:e(Dd,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(V,{$gap:4,children:[t(Rd,{children:"Issued for"}),t(Q,{size:te.XS,children:o.name||"N/A"})]}),e(V,{$gap:4,children:[t(Rd,{children:"Expiration"}),t(Od,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(V,{})]}),t(oe,{children:e(V,{children:[t(Rd,{children:"Token"}),t(Ad,{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})]})})]})})},Fd=m.div`
385
+ `,ou=({children:e})=>{const o=f();return t(ae,{size:le.XXXS,color:o.v2.colors.grey[150],children:e})},nu=({token:o})=>{const[n,{loading:a,unsupported:i}]=cl("UPDATE_TOKEN"),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:g,resetFormData:m}=Nt({newToken:""});return t(et,{richTitle:{icon:Yi,title:"Odigos Pro Token"},children:e(tu,{$isExpired:c,children:[e(re,{$justifyContent:"space-between",children:[e(W,{$gap:4,children:[t(ou,{children:"Issued for"}),t(ae,{size:le.XS,children:o.name||"N/A"})]}),e(W,{$gap:4,children:[t(ou,{children:"Expiration"}),t(eu,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(W,{})]}),t(re,{children:e(W,{children:[t(ou,{children:"Token"}),t(Qd,{token:o.token,newToken:u.newToken,isLoading:a,isEditing:l,onEdit:()=>s(!0),onCancel:()=>(s(!1),void p("newToken","")),onSave:()=>(async()=>{if(i)return;const{error:e}=await n({token:u.newToken.trim()});e?g("newToken",e.message):(s(!1),m())})(),formData:u,handleFormChange:p,handleErrorChange:g,formErrors:h})]})})]})})},au=["namespaces"],iu=m.div`
355
386
  display: flex;
356
387
  flex-direction: column;
357
388
  align-items: center;
@@ -360,23 +391,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
360
391
  padding: 12px 24px;
361
392
  border-radius: 8px;
362
393
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
363
- `,Ld=({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(Fd,{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:Mi,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(yi,{size:16}):o.status===we.Error?t(Ci,{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(Lo,{alignX:zo.Left,alignY:_o.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:Mi,variant:ie.Primary,onClick:async()=>{l(Date.now()),await o(s),l(null),d()},disabled:null!==i})})]})})},_d=({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:Pi,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}]})})},zd=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:r})=>e(q,{isOpen:o,header:{icon:Pi,title:"System Overview",onClose:n},children:[l&&t(_d,{fetchDescribeOdigos:l}),i&&a&&t(Pd,{token:a,updateToken:i}),r&&t(Ld,{downloadDiagnose:r})]}),Bd=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:r})=>{const{addDataStreams:s,setSelectedStreamName:c}=Me(),{requestSubmit:d}=$l(),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 Po({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(Br,{autoFocus:!0})}),t(zr,{})]})},Md=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s,updateDataStream:c})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=$l();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 Po({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(Br,{autoFocus:!0})}),t(zr,{})]})},Xd=({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)"})})]})]}),Vd=m.div`
394
+ `,lu=()=>{const{progress:o}=Ct(),{describeApi:n,namespacesApi:a}=rl({subscribe:au}),{items:i}=a,[l,s]=r(null),{formData:c,handleFormChange:d,resetFormData:u}=Nt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(et,{richTitle:{icon:Ji,title:"Diagnose"},children:l?e(iu,{children:[t(ct,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[Tt.DownloadingDiagnose]?.percentage,percentage:o[Tt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[Tt.DownloadingDiagnose]?.percentage,visualIcon:Gi,startedAt:l}),o[Tt.DownloadingDiagnose]?.list?.length&&t(W,{$width:"100%",children:o[Tt.DownloadingDiagnose].list.map(o=>e(re,{$gap:4,$alignItems:"center",children:[o.status===Ie.Success?t(Ti,{size:16}):o.status===Ie.Error?t(xi,{size:16}):t(ct,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(ae,{size:le.XXXS,color:ie.Secondary,children:o.label})]},o.label))})]}):e(W,{$gap:24,children:[t(ae,{size:le.XXS,color:ie.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(W,{$gap:16,children:[e(re,{$gap:8,children:[t(Y,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include pprof profiles"})]}),e(re,{$gap:8,children:[t(Y,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include Prometheus metrics"})]}),e(re,{$gap:8,children:[t(Y,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(ae,{size:le.XXXS,color:ie.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Bo,{alignX:Vo.Left,alignY:Xo.Bottom,items:i.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:de.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Be,{label:c.sourceWorkloadNamespaces.length,status:Ie.Default}):void 0}}),t(re,{$justifyContent:"flex-end",children:t(se,{label:"Download Diagnose",rightIcon:Gi,variant:de.Primary,onClick:async()=>{n.downloadDiagnose&&(s(Date.now()),await n.downloadDiagnose(c),s(null),u())},disabled:null!==l})})]})})},ru=()=>{const{platformType:e,version:o,tier:a}=y(),{describeApi:i}=rl(),[l,s]=r(null);return n(()=>{i.fetchDescribeOdigos&&i.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(et,{richTitle:{icon:zi,title:"General Information"},children:t(It,{cellsPerRow:2,items:[{id:Uo(),title:"Odigos Version",label:o},{id:Uo(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Uo(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Uo(),title:"Tier",label:a}]})})},su=({isOpen:o,onClose:n})=>{const{describeApi:a,tokensApi:i}=rl(),{data:l}=sl("GET_TOKENS"),r=l?.[0];return e(oe,{isOpen:o,header:{icon:zi,title:"System Overview",onClose:n},children:[a.fetchDescribeOdigos&&t(ru,{}),i.updateToken&&r&&t(nu,{token:r}),a.downloadDiagnose&&t(lu,{})]})},cu=({isOpen:n,onClose:a,onCloseEnd:i})=>{const{addDataStreams:r,setSelectedStreamName:s}=He(),{dataStreamsApi:c}=rl(),{requestSubmit:d}=Fl(),u=l(async e=>{c.create?await c.create(e):(r([e]),s(e.name)),a()},[c,r,s,a]),p=l(()=>d(u),[d,u]);return zo({key:"Enter",active:n},p),e(o,{children:[t(Ue,{isOpen:n,onClose:a,onCloseEnd:i,title:Ge.NAME_YOUR_STREAM,description:Ge.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:kt.DONE,variant:de.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:a},children:t(Wr,{autoFocus:!0})}),t(jr,{})]})},du=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s})=>{const{dataStreamsApi:c}=rl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Fl();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,g=l(async e=>{await c.update(s,e),i()},[c,s,i]),m=l(()=>p(g),[p,g]);return zo({key:"Enter",active:a},m),e(o,{children:[t(Ue,{isOpen:a,onClose:i,onCloseEnd:r,title:Ge.RENAME_STREAM(s),description:Ge.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:kt.SAVE,variant:de.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:kt.CANCEL,variant:de.Secondary,onClick:i},children:t(Wr,{autoFocus:!0})}),t(jr,{})]})},uu=({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)"})})]})]}),pu=m.div`
364
395
  position: absolute;
365
396
  top: 50%;
366
397
  left: 50%;
367
398
  transform: translate(-50%, -50%);
368
399
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
369
- `,Ud="onboarding-done",Hd=()=>{const{currentModal:o,setCurrentModal:n}=Mo(),a=()=>n("");return e(Xo,{isOpen:o===Ud,onClose:a,children:[t(Xd,{}),t(Vd,{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(Cl,{size:260}),t(Q,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(ne,{label:"Get Started",rightIcon:li,onClick:a})]})})]})},Gd=m.div`
400
+ `,hu="onboarding-done",gu=()=>{const{currentModal:o,setCurrentModal:n}=Go(),a=()=>n("");return e(Ho,{isOpen:o===hu,onClose:a,children:[t(uu,{}),t(pu,{children:e(W,{$gap:32,$alignItems:"center",children:[e(W,{$gap:24,$alignItems:"center",children:[t(ae,{size:le.L,weight:500,children:"Welcome to"}),t(Il,{size:260}),t(ae,{size:le.S,weight:400,children:"Your observability control plane is ready."})]}),t(se,{label:"Get Started",rightIcon:di,onClick:a})]})})]})},mu=m.div`
370
401
  display: flex;
371
402
  flex-direction: column;
372
403
  gap: 8px;
373
404
  padding: 4px 8px;
374
405
  border-radius: 8px;
375
406
  width: 100%;
376
- `,jd=m.div`
407
+ `,fu=m.div`
377
408
  white-space: pre;
378
409
  overflow-x: auto;
379
- `,Wd=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:r,toggleName:s})=>{const c=f();return e(Gd,{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:Vo,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(jd,{children:t(S,{parts:r})})]})},Kd=m.div`
410
+ `,bu=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:r,toggleName:s})=>{const c=f();return e(mu,{children:[e(re,{$gap:8,$justifyContent:"space-between",children:[e(re,{$gap:4,children:[t(ae,{size:le.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Be,{label:jo,leftIcon:qi,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:le.XXXS})]}),t(Q,{name:s??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:ee.Left,value:i,onChange:l,size:vt.S})]}),t(fu,{children:t(S,{parts:r})})]})},vu=m.div`
380
411
  position: relative;
381
412
  display: flex;
382
413
  align-items: center;
@@ -386,18 +417,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
386
417
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
387
418
  border-top-left-radius: 18px;
388
419
  border-top-right-radius: 18px;
389
- `,Yd=m.div`
420
+ `,yu=m.div`
390
421
  position: absolute;
391
422
  left: 16px;
392
423
  top: 50%;
393
424
  transform: translateY(-50%);
394
- `,Jd=m.div`
425
+ `,Cu=m.div`
395
426
  height: 16px;
396
427
  width: 100%;
397
428
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
398
429
  border-top-left-radius: 18px;
399
430
  border-top-right-radius: 18px;
400
- `,qd=m.div`
431
+ `,Su=m.div`
401
432
  width: ${({$width:e})=>e}px;
402
433
  display: flex;
403
434
  flex-direction: column;
@@ -405,7 +436,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
405
436
  gap: 22px;
406
437
  padding: 8px 32px 32px 32px;
407
438
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
408
- `,Zd=e=>t(Ki,{rotate:90,...e}),Qd=({children:o,center:n,onNext:a,nextLabel:i=Uo,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:Zd,variant:ie.Primary,size:ae.M,onClick:a,loading:l})]}),eu=e=>t(Ki,{rotate:-90,...e}),tu=({title:o,onBack:n})=>{const a=f();return e(Kd,{$hasBack:!!n,children:[n&&t(Yd,{children:t(ot,{"data-id":"sampling-onboarding-back",icon:eu,size:nt.M,onClick:n})}),t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},ou=m.div`
439
+ `,wu=e=>t(Zi,{rotate:90,...e}),Tu=({children:o,center:n,onNext:a,nextLabel:i=Wo,nextLoading:l})=>e(re,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(se,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:wu,variant:de.Primary,size:ce.M,onClick:a,loading:l})]}),xu=e=>t(Zi,{rotate:-90,...e}),ku=({title:o,onBack:n})=>{const a=f();return e(vu,{$hasBack:!!n,children:[n&&t(yu,{children:t(rt,{"data-id":"sampling-onboarding-back",icon:xu,size:st.M,onClick:n})}),t(ae,{size:le.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},Eu=m.div`
409
440
  box-sizing: border-box;
410
441
  width: ${({$width:e})=>e??"100%"};
411
442
  ${({$fillHeight:e})=>e&&b`
@@ -418,16 +449,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
418
449
  padding: 16px;
419
450
  border-radius: 16px;
420
451
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
421
- `,nu=({children:e,fillHeight:o,width:n})=>t(ou,{$fillHeight:o,$width:n,children:e}),au=m.ul`
452
+ `,Iu=({children:e,fillHeight:o,width:n})=>t(Eu,{$fillHeight:o,$width:n,children:e}),$u=m.ul`
422
453
  margin: 0;
423
454
  padding: 0;
424
455
  list-style: disc;
425
- `,iu=m.li`
456
+ `,Au=m.li`
426
457
  margin-left: 18px;
427
458
  & + & {
428
459
  margin-top: 6px;
429
460
  }
430
- `,lu=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(au,{children:e.map((e,o)=>t(iu,{style:{color:a},children:t(Q,{size:te.XXS,color:a,children:e})},o))})},ru=({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}),cu=m.div`
461
+ `,Nu=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t($u,{children:e.map((e,o)=>t(Au,{style:{color:a},children:t(ae,{size:le.XXS,color:a,children:e})},o))})},Ou=({items:o})=>{const n=f();return t(W,{$gap:16,children:o.map((o,a)=>e(re,{$gap:8,$alignItems:"flex-start",children:[e(ae,{size:le.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(W,{$gap:2,children:[t(ae,{size:le.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(ae,{size:le.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},Ru=({message:e})=>t(Ee,{status:Ie.Default,message:e,fullWidth:!0,smallIcon:!0}),Du=m.div`
431
462
  width: 100%;
432
463
  padding: 8px;
433
464
  display: flex;
@@ -435,12 +466,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
435
466
  gap: 4px;
436
467
  border-radius: 16px;
437
468
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
438
- `,du=m.div`
469
+ `,Fu=m.div`
439
470
  display: flex;
440
471
  align-items: center;
441
472
  gap: 8px;
442
473
  padding: 4px 8px 12px 8px;
443
- `,uu=m.div`
474
+ `,Pu=m.div`
444
475
  width: 100%;
445
476
  display: flex;
446
477
  flex-direction: column;
@@ -448,20 +479,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
448
479
  padding: 8px;
449
480
  border-radius: 12px;
450
481
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
451
- `,pu=({children:e})=>{const o=f();return t(Q,{size:te.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},hu=m.div`
482
+ `,_u=({children:e})=>{const o=f();return t(ae,{size:le.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Lu=m.div`
452
483
  white-space: pre-line;
453
- `,gu=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=f(),c=a(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(tu,{title:Ho,onBack:l}),e(qd,{$width:854,children:[t(pu,{children:Go}),e(V,{$gap:8,$width:"100%",children:[t(nu,{children:t(hu,{children:t(Q,{size:te.XXS,color:s.v2.colors.silver[200],children:jo})})}),e(V,{$gap:8,$width:"100%",children:[e(cu,{children:[t(du,{children:t(Q,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Wo})}),t(uu,{children:t(Wd,{name:Yo,recommended:!0,toggleLabel:Ko,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(su,{message:Jo})]})]})]}),t(Qd,{onNext:r})]})},mu=e=>t(Ki,{rotate:90,...e}),fu=({onClose:n})=>{const a=f();return e(o,{children:[t(Jd,{}),e(qd,{$width:732,children:[t(qo,{icon:Ui}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Zo}),Qo.split("\n").map(e=>t(pu,{children:e},e)),e(nu,{children:[t(Q,{size:te.XS,color:a.v2.colors.silver[200],children:en}),t(lu,{color:a.v2.colors.white[500],items:[tn,on,nn]})]})]})]}),t(Qd,{center:!0,children:t(ne,{"data-id":"sampling-onboarding-btn-go-to",label:an,rightIcon:mu,variant:ie.Primary,size:ae.M,onClick:n})})]})},bu=e=>t(Ki,{rotate:90,...e}),vu=m.div`
484
+ `,zu=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=f(),c=a(()=>k({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(ku,{title:Ko,onBack:l}),e(Su,{$width:854,children:[t(_u,{children:Yo}),e(W,{$gap:8,$width:"100%",children:[t(Iu,{children:t(Lu,{children:t(ae,{size:le.XXS,color:s.v2.colors.silver[200],children:Jo})})}),e(W,{$gap:8,$width:"100%",children:[e(Du,{children:[t(Fu,{children:t(ae,{size:le.S,weight:500,color:s.v2.colors.white[500],children:qo})}),t(Pu,{children:t(bu,{name:Qo,recommended:!0,toggleLabel:Zo,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Ru,{message:en})]})]})]}),t(Tu,{onNext:r})]})},Mu=e=>t(Zi,{rotate:90,...e}),Bu=({onClose:n})=>{const a=f();return e(o,{children:[t(Cu,{}),e(Su,{$width:732,children:[t(tn,{icon:Wi}),e(W,{$gap:16,$alignItems:"center",$width:"100%",children:[t(ae,{size:le.M,weight:500,color:a.v2.colors.white[500],children:on}),nn.split("\n").map(e=>t(_u,{children:e},e)),e(Iu,{children:[t(ae,{size:le.XS,color:a.v2.colors.silver[200],children:an}),t(Nu,{color:a.v2.colors.white[500],items:[ln,rn,sn]})]})]})]}),t(Tu,{center:!0,children:t(se,{"data-id":"sampling-onboarding-btn-go-to",label:cn,rightIcon:Mu,variant:de.Primary,size:ce.M,onClick:n})})]})},Xu=e=>t(Zi,{rotate:90,...e}),Vu=m.div`
454
485
  display: flex;
455
486
  flex-direction: column;
456
487
  align-items: center;
457
488
  gap: 8px;
458
489
  width: 100%;
459
- `,yu=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(Jd,{}),e(qd,{$width:732,children:[t(qo,{icon:Ui}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(vu,{children:[t(Q,{size:te.M,weight:500,color:i.v2.colors.white[500],children:ln}),t(pu,{children:rn})]}),e(nu,{children:[t(Q,{size:te.XS,color:i.v2.colors.silver[200],children:sn}),t(ru,{items:[{title:dn,description:cn},{title:pn,description:un},{title:gn,description:hn}]}),t(su,{message:mn})]})]})]}),e(Qd,{center:!0,children:[t(ne,{"data-id":"sampling-onboarding-btn-skip",label:fn,variant:ie.Secondary,onClick:n}),t(ne,{"data-id":"sampling-onboarding-btn-start",label:bn,rightIcon:bu,variant:ie.Primary,onClick:a})]})]})},Cu=m.div`
490
+ `,Uu=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(Cu,{}),e(Su,{$width:732,children:[t(tn,{icon:Wi}),e(W,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Vu,{children:[t(ae,{size:le.M,weight:500,color:i.v2.colors.white[500],children:dn}),t(_u,{children:un})]}),e(Iu,{children:[t(ae,{size:le.XS,color:i.v2.colors.silver[200],children:pn}),t(Ou,{items:[{title:gn,description:hn},{title:fn,description:mn},{title:vn,description:bn}]}),t(Ru,{message:yn})]})]})]}),e(Tu,{center:!0,children:[t(se,{"data-id":"sampling-onboarding-btn-skip",label:Cn,variant:de.Secondary,onClick:n}),t(se,{"data-id":"sampling-onboarding-btn-start",label:Sn,rightIcon:Xu,variant:de.Primary,onClick:a})]})]})},Gu=m.div`
460
491
  display: flex;
461
492
  align-items: stretch;
462
493
  gap: 16px;
463
494
  width: 100%;
464
- `,Su=m.div`
495
+ `,Hu=m.div`
465
496
  flex: 1;
466
497
  display: flex;
467
498
  flex-direction: column;
@@ -481,18 +512,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
481
512
  background-color: ${t.v2.colors.silver[700]};
482
513
  }
483
514
  `}
484
- `,wu=m.div`
515
+ `,ju=m.div`
485
516
  display: flex;
486
517
  align-items: center;
487
518
  gap: 8px;
488
519
  padding: 12px 16px;
489
- `,xu=m.div`
520
+ `,Wu=m.div`
490
521
  flex: 1;
491
522
  padding: 8px;
492
523
  display: flex;
493
524
  flex-direction: column;
494
525
  gap: 8px;
495
- `,Tu=m.div`
526
+ `,Ku=m.div`
496
527
  flex: 1;
497
528
  display: flex;
498
529
  flex-direction: column;
@@ -500,17 +531,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
500
531
  padding: 12px;
501
532
  border-radius: 12px;
502
533
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
503
- `,ku=m.div`
534
+ `,Yu=m.div`
504
535
  display: flex;
505
536
  justify-content: flex-end;
506
- `,$u=m.div`
537
+ `,Ju=m.div`
507
538
  display: flex;
508
539
  align-items: center;
509
540
  gap: 8px;
510
541
  padding: 4px 12px 4px 4px;
511
542
  border-radius: 8px;
512
543
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
513
- `,Eu=m.div`
544
+ `,qu=m.div`
514
545
  display: flex;
515
546
  align-items: center;
516
547
  justify-content: center;
@@ -518,13 +549,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
518
549
  height: 24px;
519
550
  border-radius: 6px;
520
551
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
521
- `,Iu=({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(Su,{$selected:o,onClick:n,children:[e(wu,{children:[t(ce,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:ue.L}),t(Ui,{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(Tu,{$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(lu,{color:u,items:r}),s&&e($u,{children:[t(Eu,{children:t(Hi,{size:18,fill:d.v2.colors.yellow[500]})}),t(Q,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(ku,{children:t(ne,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:Pn,rightIcon:ci,variant:ie.Text,size:ae.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Nu=({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(tu,{title:vn,onBack:i}),e(qd,{$width:854,children:[t(pu,{children:yn}),e(Cu,{children:[t(Iu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:kn,description:Tn,badgeProps:{label:xn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Sn,wn],warning:Cn,onReadMore:c}),t(Iu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:An,description:Nn,badgeProps:{label:In,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[$n,En],onReadMore:c}),t(Iu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:Rn,description:Dn,badgeProps:{label:On,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Qd,{onNext:l})]})},Au=({onBack:n,onNext:i,submitting:l})=>{const r=f(),s=a(()=>[{title:zn,bullets:[Fn,Ln,_n]},{title:Hn,bullets:[Bn,Mn,Xn,Vn,Un]}],[]);return e(o,{children:[t(tu,{title:Gn,onBack:n}),e(qd,{$width:854,children:[t(pu,{children:jn}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(nu,{fillHeight:!0,width:"50%",children:[t(Q,{size:te.XS,color:r.v2.colors.white[500],children:o.title}),t(lu,{items:o.bullets})]},n))}),t(su,{message:Wn})]}),t(Qd,{onNext:i,nextLoading:l})]})},Ou=m.div`
552
+ `,Zu=({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(Hu,{$selected:o,onClick:n,children:[e(ju,{children:[t(ge,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:fe.L}),t(Wi,{size:24,fill:d.v2.colors.white[500]}),t(ae,{size:le.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Wu,{children:[e(Ku,{$selected:o,children:[e(W,{$gap:8,children:[t(Be,{...l,textSize:le.XXXS}),t(ae,{size:le.XXS,color:u,children:i})]}),r&&r.length>0&&t(Nu,{color:u,items:r}),s&&e(Ju,{children:[t(qu,{children:t(Ki,{size:18,fill:d.v2.colors.yellow[500]})}),t(ae,{size:le.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Yu,{children:t(se,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:zn,rightIcon:hi,variant:de.Text,size:ce.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Qu=({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(ku,{title:wn,onBack:i}),e(Su,{$width:854,children:[t(_u,{children:Tn}),e(Gu,{children:[t(Zu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:An,description:$n,badgeProps:{label:In,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[kn,En],warning:xn,onReadMore:c}),t(Zu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:Fn,description:Dn,badgeProps:{label:Rn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Nn,On],onReadMore:c}),t(Zu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:Ln,description:_n,badgeProps:{label:Pn,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Tu,{onNext:l})]})},ep=({onBack:n,onNext:i,submitting:l})=>{const r=f(),s=a(()=>[{title:Vn,bullets:[Mn,Bn,Xn]},{title:Kn,bullets:[Un,Gn,Hn,jn,Wn]}],[]);return e(o,{children:[t(ku,{title:Yn,onBack:n}),e(Su,{$width:854,children:[t(_u,{children:Jn}),t(re,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Iu,{fillHeight:!0,width:"50%",children:[t(ae,{size:le.XS,color:r.v2.colors.white[500],children:o.title}),t(Nu,{items:o.bullets})]},n))}),t(Ru,{message:qn})]}),t(Tu,{onNext:i,nextLoading:l})]})},tp=m.div`
522
553
  white-space: pre-line;
523
- `,Du=({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(tu,{title:Kn,onBack:l}),e(qd,{$width:854,children:[t(pu,{children:Yn}),e(V,{$gap:8,$width:"100%",children:[e(nu,{children:[t(Ou,{children:t(Q,{size:te.XXS,color:c.v2.colors.silver[200],children:Jn})}),t(su,{message:Wn})]}),e(cu,{children:[e(du,{children:[t(Q,{size:te.S,weight:500,color:c.v2.colors.white[500],children:qn}),t(Ai,{size:16,fill:c.v2.colors.silver[200]})]}),t(uu,{children:t(Wd,{name:Qn,recommended:!0,toggleLabel:Zn,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Qd,{onNext:r,nextLoading:s})]})},Ru=m.div`
554
+ `,op=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=f(),d=a(()=>E(n?{disabled:!1}:null),[n]);return e(o,{children:[t(ku,{title:Zn,onBack:l}),e(Su,{$width:854,children:[t(_u,{children:Qn}),e(W,{$gap:8,$width:"100%",children:[e(Iu,{children:[t(tp,{children:t(ae,{size:le.XXS,color:c.v2.colors.silver[200],children:ea})}),t(Ru,{message:qn})]}),e(Du,{children:[e(Fu,{children:[t(ae,{size:le.S,weight:500,color:c.v2.colors.white[500],children:ta}),t(Fi,{size:16,fill:c.v2.colors.silver[200]})]}),t(Pu,{children:t(bu,{name:na,recommended:!0,toggleLabel:oa,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Tu,{onNext:r,nextLoading:s})]})},np=m.div`
524
555
  white-space: pre-line;
525
- `,Pu=m.div`
556
+ `,ap=m.div`
526
557
  width: fit-content;
527
- `,Fu=["50","25","10","1","0.1"],Lu=({value:o,onChange:n,label:i})=>{const l=f(),r=a(()=>Fu.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(Pu,{children:t(le,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},_u=({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(tu,{title:ea,onBack:s}),e(qd,{$width:854,children:[t(pu,{children:ta}),e(V,{$gap:8,$width:"100%",children:[e(nu,{children:[t(Ru,{children:t(Q,{size:te.XXS,color:u.v2.colors.silver[200],children:oa})}),t(lu,{items:[na,aa,ia,la,ra]}),t(su,{message:Wn})]}),e(cu,{children:[e(du,{children:[t(Q,{size:te.S,weight:500,color:u.v2.colors.white[500],children:sa}),t(Ai,{size:16,fill:u.v2.colors.silver[200]})]}),t(uu,{children:t(Wd,{name:Qn,recommended:!0,toggleLabel:Zn,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(uu,{children:t(Lu,{value:l,onChange:r,label:ca})})]})]})]}),t(Qd,{onNext:c,nextLoading:d})]})},zu=({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 T=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 k=null;switch(p){case"welcome":k=t(yu,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":k=t(gu,{enabled:g,onEnabledChange:m,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":k=t(Nu,{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":k=t(_u,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"drop-list":k=t(Du,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"advanced":k=t(Au,{onBack:()=>h("strategy"),onNext:T,submitting:w});break;case"success":k=t(fu,{onClose:o})}return t(Xo,{isOpen:e,onClose:o,children:k})};var Bu,Mu;!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"}(Bu||(Bu={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Mu||(Mu={}));const Xu=[{key:Mu.Name,label:"Name"},{key:Mu.Type,label:"Type",textAlign:"right"},{key:Mu.Status,label:"Status"},{key:Mu.OdigosVersion,label:"Odigos Version"},{key:Mu.ConnectedSince,label:"Connected Since"},{key:Mu.LastActivity,label:"Last Activity"}],Vu=(e,t)=>{const o=e.find(e=>e.key===Mu.Id)?.rawValue;return t(o?.toString()||"")},Uu=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===Mu.Status)?.rawValue===we.Success)(e))return[{id:Bo(),label:"Delete Connection",rightIcon:di,onClick:()=>Vu(e,a)}];const d=Vu(e,e=>{const n=t.find(t=>t.id===e);return!!n&&T(n.odigosVersion,o)}),u=Vu(e,e=>{const o=t.find(t=>t.id===e);return!!o&&T(o.odigosVersion,n)}),p=[];return i&&p.push({id:Bo(),tooltip:u?Be.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:wi,disabled:!u,onClick:()=>Vu(e,i)}),l&&p.push({id:Bo(),tooltip:Be.ADD_DESTINATION,rightIcon:fi,onClick:()=>Vu(e,l)}),r&&p.push({id:Bo(),tooltip:Be.ADD_ACTION,rightIcon:mi,onClick:()=>Vu(e,r)}),s&&p.push({id:Bo(),tooltip:Be.ADD_INSTRUMENTATION_RULE,rightIcon:Si,onClick:()=>Vu(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:()=>Vu(e,c)}),p}},Hu=({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:k})=>{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===Bu.BulkConfig?d:L===Bu.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=T(e.odigosVersion,t);return o&&n}))(O,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[O.length,M]);n(()=>{if(!L||L===Bu.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:Mu.Id,rawValue:e.id},{key:Mu.Name,rawValue:e.name},{key:Mu.Type,rawValue:e.type},{key:Mu.Status,rawValue:e.status,component:()=>(e=>{const o=e===we.Success?"Connection live":"Connection lost",n=e===we.Success?yi:Ci;return t(Fe,{status:e,label:o,leftIcon:n})})(e.status)},{key:Mu.OdigosVersion,rawValue:e.odigosVersion},{key:Mu.ConnectedSince,rawValue:e.connectedAt?I(e.connectedAt):"-"},{key:Mu.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===Bu.BulkConfig&&!T(e.odigosVersion,d)||L===Bu.BulkSource&&!T(e.odigosVersion,h)})),[O,z,P,L,d,h]),H=a(()=>{const e=(e,t)=>{B([e]),_(t)};return Uu({connections:O,configMinSupportedVersion:d,snapshotMinSupportedVersion:h,onDelete:t=>e(t,Bu.Delete),onAddSource:!E&&g&&m?t=>e(t,Bu.BulkSource):void 0,onAddDestination:!E&&b&&v&&S?t=>e(t,Bu.BulkDestination):void 0,onAddAction:!E&&x?t=>e(t,Bu.BulkAction):void 0,onAddInstrumentationRule:!E&&k?t=>e(t,Bu.BulkInstrumentationRule):void 0,onEditConfiguration:!E&&u&&p?t=>e(t,Bu.BulkConfig):void 0})},[E,O,d,u,p,h,g,m,b,v,S,x,k]),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:wi,onClick:o}});const s=[n?{id:Bu.BulkDestination,label:Be.ADD_DESTINATION,icon:fi}:null,a?{id:Bu.BulkAction,label:Be.ADD_ACTION,icon:mi}:null,i?{id:Bu.BulkInstrumentationRule,label:Be.ADD_INSTRUMENTATION_RULE,icon:Si}:null,l?{id:Bu.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===Bu.BulkSource?o?.():e===Bu.BulkDestination?n?.():e===Bu.BulkAction?a?.():e===Bu.BulkInstrumentationRule?i?.():e===Bu.BulkConfig&&l?.()}},dropDataProps:{alignX:zo.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:!E&&g&&m?()=>_(Bu.BulkSource):void 0,onAddDestination:!E&&b&&v&&S?()=>_(Bu.BulkDestination):void 0,onAddAction:!E&&x?()=>_(Bu.BulkAction):void 0,onAddInstrumentationRule:!E&&k?()=>_(Bu.BulkInstrumentationRule):void 0,onManageConfigurations:!E&&u&&p?()=>_(Bu.BulkConfig):void 0}),[E,u,p,g,m,b,v,S,x,k]);return t(da,{children:e(Ye,{fullHeight:!0,richTitle:{icon:Yi,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:Bo(),type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ii,onClick:R,disabled:N}}],children:[t(go,{variant:mo.Pretty,headerBackgroundColor:$.v2.colors.silver[1e3],isLoading:N,withCheckboxes:!0,columns:Xu,rows:U,rowActionsPushRightPosition:L?`calc(${Sl} - 24px)`:void 0,getRowActions:H}),L===Bu.BulkConfig&&u&&p&&t(Rs,{onClose:()=>_(null),connections:X,selectedConnectionIds:z,setSelectedConnectionIds:B,getEffectiveConfig:u,onApply:p}),L===Bu.BulkSource&&g&&m&&t(Ll,{selectedConnectionIds:z,children:t(As,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,getAllClusterSnapshots:g,persistSources:async e=>await(m?.(e))})}),L===Bu.BulkDestination&&b&&v&&C&&S&&w&&t(_l,{children:t(cs,{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===Bu.BulkAction&&x&&t(zl,{children:t(Qr,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createAction:e=>x(e,z)})}),L===Bu.BulkInstrumentationRule&&k&&t(Bl,{children:t(ds,{onClose:()=>_(null),selectedConnectionIds:z,setSelectedConnectionIds:B,createInstrumentationRule:e=>k(e,z)})}),t(bl,{target:"connection",isOpen:L===Bu.Delete,onClose:()=>{B([]),_(null)},onApprove:async()=>{const e=z[0];e&&(await c(e),await R())}}),t(ua,{isOpen:!!z.length&&!L,richTitle:{icon:ri,title:"Selected Clusters",badge:{label:z.length}},actions:G})]})})},Gu=m.div`
558
+ `,ip=["50","25","10","1","0.1"],lp=({value:o,onChange:n,label:i})=>{const l=f(),r=a(()=>ip.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(W,{$gap:8,children:[t(ae,{size:le.XS,color:l.v2.colors.white[500],children:i}),t(ap,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},rp=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>E(n?{disabled:!1}:null),[n]);return e(o,{children:[t(ku,{title:aa,onBack:s}),e(Su,{$width:854,children:[t(_u,{children:ia}),e(W,{$gap:8,$width:"100%",children:[e(Iu,{children:[t(np,{children:t(ae,{size:le.XXS,color:u.v2.colors.silver[200],children:la})}),t(Nu,{items:[ra,sa,ca,da,ua]}),t(Ru,{message:qn})]}),e(Du,{children:[e(Fu,{children:[t(ae,{size:le.S,weight:500,color:u.v2.colors.white[500],children:pa}),t(Fi,{size:16,fill:u.v2.colors.silver[200]})]}),t(Pu,{children:t(bu,{name:na,recommended:!0,toggleLabel:oa,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Pu,{children:t(lp,{value:l,onChange:r,label:ha})})]})]})]}),t(Tu,{onNext:c,nextLoading:d})]})},sp=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s})=>{const{samplingApi:c}=rl(),[d,u]=r("welcome"),[p,h]=r(!0),[g,m]=r("keep-list"),[f,b]=r(!0),[v,y]=r("25"),[C,S]=r(!1);n(()=>{e&&(u("welcome"),h(a?.enabled??!0),m("keep-list"),b(!0),y("25"),S(!1))},[e,a?.enabled]);const w=l(async()=>{const e=i??"default",t=[];if(p!==(a?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:a?.keepPercentage??0}))}if("advanced"!==g&&f){const o=c.createHighlyRelevant;o&&t.push(o({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===g){const o=c.createCostReduction;o&&t.push(o({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),u("success")}catch{}finally{S(!1)}},[i,c,p,a?.enabled,a?.keepPercentage,g,f,v]);let T=null;switch(d){case"welcome":T=t(Uu,{onSkip:o,onNext:()=>u("noisy")});break;case"noisy":T=t(zu,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":T=t(Qu,{strategy:g,onStrategyChange:m,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===g?"keep-list":"drop-list"===g?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(rp,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":T=t(op,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":T=t(ep,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":T=t(Bu,{onClose:o})}return t(Ho,{isOpen:e,onClose:o,children:T})};var cp,dp;!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"}(cp||(cp={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(dp||(dp={}));const up=[{key:dp.Name,label:"Name"},{key:dp.Type,label:"Type",textAlign:"right"},{key:dp.Status,label:"Status"},{key:dp.OdigosVersion,label:"Odigos Version"},{key:dp.ConnectedSince,label:"Connected Since"},{key:dp.LastActivity,label:"Last Activity"}],pp=(e,t)=>{const o=e.find(e=>e.key===dp.Id)?.rawValue;return t(o?.toString()||"")},hp=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===dp.Status)?.rawValue===Ie.Success)(e))return[{id:Uo(),label:"Delete Connection",rightIcon:gi,onClick:()=>pp(e,a)}];const d=pp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&I(n.odigosVersion,o)}),u=pp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&I(o.odigosVersion,n)}),p=[];return i&&p.push({id:Uo(),tooltip:u?Ge.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Ei,disabled:!u,onClick:()=>pp(e,i)}),l&&p.push({id:Uo(),tooltip:Ge.ADD_DESTINATION,rightIcon:Ci,onClick:()=>pp(e,l)}),r&&p.push({id:Uo(),tooltip:Ge.ADD_ACTION,rightIcon:yi,onClick:()=>pp(e,r)}),s&&p.push({id:Uo(),tooltip:Ge.ADD_INSTRUMENTATION_RULE,rightIcon:ki,onClick:()=>pp(e,s)}),c&&p.push({id:Uo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:$i,disabled:!d,onClick:()=>pp(e,c)}),p}},gp=({connections:o,getConnections:i,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=f(),{formatTimeAgo:h}=Bt(),{capabilities:g}=rl(),[m,b]=r(!1),[v,y]=r(o||[]),C=l(async()=>{try{b(!0),y(await i()??[])}catch(e){}finally{b(!1)}},[]);n(()=>{v.length||C()},[]);const[S,w]=r(""),[T,x]=r(null),[k,E]=r([]),$=a(()=>T===cp.BulkConfig?d:T===cp.BulkSource?u:0,[T,d,u]),{supportedConnections:A,supportedConnectionIds:N}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Ie.Success,n=I(e.odigosVersion,t);return o&&n}))(v,$);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,$]);n(()=>{if(!T||T===cp.Delete)return;const e=k.filter(e=>!N.includes(e));e.length&&E(t=>t.filter(t=>!e.includes(t)))},[T,k.length,N.length]);const O=a(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:dp.Id,rawValue:e.id},{key:dp.Name,rawValue:e.name},{key:dp.Type,rawValue:e.type},{key:dp.Status,rawValue:e.status,component:()=>(e=>{const o=e===Ie.Success?"Connection live":"Connection lost",n=e===Ie.Success?Ti:xi;return t(Be,{status:e,label:o,leftIcon:n})})(e.status)},{key:dp.OdigosVersion,rawValue:e.odigosVersion},{key:dp.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:dp.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Ie.Success||T?void 0:()=>s(e),isSelected:k.includes(e.id),onSelect:()=>E(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>E(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Ie.Success||T===cp.BulkConfig&&!I(e.odigosVersion,d)||T===cp.BulkSource&&!I(e.odigosVersion,u)})),[v,k,S,T,d,u,h,s]),R=a(()=>{const e=(e,t)=>{E([e]),x(t)};return hp({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,cp.Delete),onAddSource:g.canFetchSnapshots&&g.canBulkPersistSources?t=>e(t,cp.BulkSource):void 0,onAddDestination:g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canCreateDestination?t=>e(t,cp.BulkDestination):void 0,onAddAction:g.canCreateAction?t=>e(t,cp.BulkAction):void 0,onAddInstrumentationRule:g.canCreateInstrumentationRule?t=>e(t,cp.BulkInstrumentationRule):void 0,onEditConfiguration:g.canApplyEffectiveConfig?t=>e(t,cp.BulkConfig):void 0})},[v,d,u,g]),D=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];o&&r.push({id:Uo(),type:qt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:"Add Sources",rightIcon:Ei,onClick:o}});const s=[n?{id:cp.BulkDestination,label:Ge.ADD_DESTINATION,icon:Ci}:null,a?{id:cp.BulkAction,label:Ge.ADD_ACTION,icon:yi}:null,i?{id:cp.BulkInstrumentationRule,label:Ge.ADD_INSTRUMENTATION_RULE,icon:ki}:null,l?{id:cp.BulkConfig,label:"Manage Configurations",icon:$i}:null];return s.some(Boolean)&&r.push({id:Uo(),type:qt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"Bulk Operations",onClick:e=>{e===cp.BulkSource?o?.():e===cp.BulkDestination?n?.():e===cp.BulkAction?a?.():e===cp.BulkInstrumentationRule?i?.():e===cp.BulkConfig&&l?.()}},dropDataProps:{alignX:Vo.Left,items:s}}),r.push({id:Uo(),type:qt.Button,buttonProps:{variant:de.Text,size:ce.S,label:kt.CANCEL,onClick:t}}),r})({onCancel:()=>E([]),onAddSource:g.canFetchSnapshots&&g.canBulkPersistSources?()=>x(cp.BulkSource):void 0,onAddDestination:g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canCreateDestination?()=>x(cp.BulkDestination):void 0,onAddAction:g.canCreateAction?()=>x(cp.BulkAction):void 0,onAddInstrumentationRule:g.canCreateInstrumentationRule?()=>x(cp.BulkInstrumentationRule):void 0,onManageConfigurations:g.canApplyEffectiveConfig?()=>x(cp.BulkConfig):void 0}),[g]);return t(ga,{children:e(et,{fullHeight:!0,richTitle:{icon:Qi,title:Ge.CONNECTIONS,badge:{label:v.length.toString(),status:ft.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:Uo(),type:qt.Button,buttonProps:{variant:de.Secondary,size:ce.S,leftIcon:Ri,onClick:C,disabled:m}}],children:[t(vo,{variant:yo.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:m,withCheckboxes:!0,columns:up,rows:O,rowActionsPushRightPosition:T?`calc(${$l} - 24px)`:void 0,getRowActions:R}),T===cp.BulkConfig&&g.canApplyEffectiveConfig&&t(Nl,{connectionIds:k,children:t(Us,{onClose:()=>x(null),connections:A,selectedConnectionIds:k,setSelectedConnectionIds:E})}),T===cp.BulkSource&&g.canFetchSnapshots&&g.canBulkPersistSources&&t(Nl,{connectionIds:k,children:t(Gl,{selectedConnectionIds:k,children:t(Ms,{onClose:()=>x(null),selectedConnectionIds:k,setSelectedConnectionIds:E})})}),T===cp.BulkDestination&&g.canFetchDestinationCategories&&g.canFetchPotentialDestinations&&g.canTestConnection&&g.canCreateDestination&&t(Nl,{connectionIds:k,children:t(Hl,{children:t(vs,{onClose:()=>x(null),selectedConnectionIds:k,setSelectedConnectionIds:E})})}),T===cp.BulkAction&&g.canCreateAction&&t(Nl,{connectionIds:k,children:t(jl,{children:t(rs,{onClose:()=>x(null),selectedConnectionIds:k,setSelectedConnectionIds:E})})}),T===cp.BulkInstrumentationRule&&g.canCreateInstrumentationRule&&t(Nl,{connectionIds:k,children:t(Wl,{children:t(ys,{onClose:()=>x(null),selectedConnectionIds:k,setSelectedConnectionIds:E})})}),t(xl,{target:"connection",isOpen:T===cp.Delete,onClose:()=>{E([]),x(null)},onApprove:async()=>{const e=k[0];e&&(await c(e),await C())}}),t(ma,{isOpen:!!k.length&&!T,richTitle:{icon:ui,title:"Selected Clusters",badge:{label:k.length}},actions:D})]})})},mp=m.div`
528
559
  display: flex;
529
560
  align-items: center;
530
561
  justify-content: space-between;
@@ -533,26 +564,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
533
564
  width: 100%;
534
565
  border-radius: 16px;
535
566
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
536
- `,ju=m.div`
567
+ `,fp=m.div`
537
568
  display: flex;
538
569
  align-items: center;
539
570
  justify-content: center;
540
571
  padding: 8px;
541
572
  border-radius: 8px;
542
- background-color: ${({theme:e})=>e.v2.colors.white[500]+qe["004"]};
543
- `,Wu=({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(Gu,{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(Gu,{children:[e(oe,{$gap:8,children:[a&&t(ju,{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?yi:Ci})]},`destination-${n}`)})||[],[l]);return t(fl,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:$i,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(wi,{size:24}),t(Q,{nowrap:!0,children:Be.SELECTED_SOURCES}),t(Fe,{label:u.length})]}),t(ne,{"data-id":"summary-edit-sources",leftIcon:ui,variant:ie.Secondary,size:ae.S,onClick:c})]}),list:u.length?u:[t(Qe,{$height:"100%",children:t(me,{icon:wi,title:Be.NO_SOURCES_SELECTED,subTitle:Be.ADD_SOURCE_PROMPT,button:{leftIcon:ii,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(fi,{size:24}),t(Q,{nowrap:!0,children:Be.SELECTED_DESTINATIONS}),t(Fe,{label:p.length})]}),t(ne,{"data-id":"summary-edit-destinations",leftIcon:ui,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:fi,title:Be.NO_DESTINATIONS_SELECTED,subTitle:Be.ADD_DESTINATION_PROMPT,button:{leftIcon:ii,label:Be.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Ku=m.div`
573
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+ot["004"]};
574
+ `,bp=({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||mt.Namespace,l=i===mt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(mp,{children:[t(ae,{nowrap:!0,children:l}),t(Be,{label:i,status:Ie.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const a=ut(o.option.type).icon;return e(mp,{children:[e(re,{$gap:8,children:[a&&t(fp,{children:t(a,{size:24})}),t(ae,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Be,{status:o.testResult.succeeded?Ie.Success:Ie.Error,leftIcon:o.testResult.succeeded?Ti:xi})]},`destination-${n}`)})||[],[l]);return t(Tl,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:Ni,title:Ge.SUMMARY,subTitle:Ge.REVIEW_SETUP},leftColumn:{width:"50%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(Ei,{size:24}),t(ae,{nowrap:!0,children:Ge.SELECTED_SOURCES}),t(Be,{label:u.length})]}),t(se,{"data-id":"summary-edit-sources",leftIcon:mi,variant:de.Secondary,size:ce.S,onClick:c})]}),list:u.length?u:[t(at,{$height:"100%",children:t(Ce,{icon:Ei,title:Ge.NO_SOURCES_SELECTED,subTitle:Ge.ADD_SOURCE_PROMPT,button:{leftIcon:ci,label:Ge.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(re,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(re,{$gap:8,children:[t(Ci,{size:24}),t(ae,{nowrap:!0,children:Ge.SELECTED_DESTINATIONS}),t(Be,{label:p.length})]}),t(se,{"data-id":"summary-edit-destinations",leftIcon:mi,variant:de.Secondary,size:ce.S,onClick:d})]}),list:p.length?p:[t(at,{"data-id":"summary-no-destinations",$height:"100%",children:t(Ce,{icon:Ci,title:Ge.NO_DESTINATIONS_SELECTED,subTitle:Ge.ADD_DESTINATION_PROMPT,button:{leftIcon:ci,label:Ge.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},vp=m.div`
544
575
  position: relative;
545
576
  overflow: hidden;
546
577
  width: 100vw;
547
578
  height: 100vh;
548
579
  box-sizing: border-box;
549
- `,Yu=m.svg`
580
+ `,yp=m.svg`
550
581
  position: absolute;
551
582
  top: 50%;
552
583
  left: 50%;
553
584
  transform: translate(-50%, -50%);
554
585
  z-index: -1;
555
- `,Ju=[{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"}],qu=[{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:Ju},{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:Ju},{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:Ju}],Zu=({paddingXAxis:o="0px",paddingYAxis:i="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/qu[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Ku,{$paddingXAxis:o,$paddingYAxis:i,children:[qu.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Yu,{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]})},Qu=m.div`
586
+ `,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"}],Sp=[{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}],wp=({paddingXAxis:o="0px",paddingYAxis:i="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/Sp[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(vp,{$paddingXAxis:o,$paddingYAxis:i,children:[Sp.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(yp,{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]})},Tp=m.div`
556
587
  display: flex;
557
588
  flex-direction: column;
558
589
  align-items: center;
@@ -563,7 +594,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
563
594
  width: 50vw;
564
595
  border-radius: 16px;
565
596
  background: ${({theme:e})=>e.v2.colors.silver[900]};
566
- `,ep=m.div`
597
+ `,xp=m.div`
567
598
  display: flex;
568
599
  flex-direction: column;
569
600
  align-items: center;
@@ -573,15 +604,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
573
604
  & * {
574
605
  text-align: center;
575
606
  }
576
- `,tp=({onStart:o})=>t(q,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(Qe,{$height:"100%",children:e(Qu,{children:[e(ep,{children:[t(Q,{size:te.L,weight:500,children:Be.GET_STARTED_WITH}),t(Cl,{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:li,size:ae.L,onClick:o})]})})}),op=[{step:1,label:Be.INSTALLATION,forceDoneBadge:!0},{step:2,label:Be.SOURCES_SETUP},{step:3,label:Be.DESTINATIONS_SETUP},{step:4,label:Be.SUMMARY}],np=m.div`
607
+ `,kp=({onStart:o})=>t(oe,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(at,{$height:"100%",children:e(Tp,{children:[e(xp,{children:[t(ae,{size:le.L,weight:500,children:Ge.GET_STARTED_WITH}),t(Il,{size:260}),t(ae,{size:le.S,weight:400,children:Ge.GET_STARTED_DESCRIPTION})]}),t(se,{"data-id":"onboarding-get-started",label:kt.GET_STARTED,rightIcon:di,size:ce.L,onClick:o})]})})}),Ep=[{step:1,label:Ge.INSTALLATION,forceDoneBadge:!0},{step:2,label:Ge.SOURCES_SETUP},{step:3,label:Ge.DESTINATIONS_SETUP},{step:4,label:Ge.SUMMARY}],Ip=m.div`
577
608
  display: flex;
578
609
  flex-direction: column;
579
610
  gap: 32px;
580
611
  padding: 64px;
581
- `,ap=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:l,getPotentialDestinations:s,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Mo(),[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(Zu,{paddingXAxis:o,paddingYAxis:n,children:[e(np,{children:[t(Cl,{useInline:!0}),t(pa,{currentStep:g,data:op,gap:32})]}),t(Ll,{initialInputs:v,children:e(_l,{children:[1===g&&t(tp,{onStart:w}),2===g&&t(As,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===g&&t(cs,{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(Wu,{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(Ud),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},ip=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),lp=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},rp=m.div`
612
+ `,$p=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:a})=>{const{setCurrentModal:i}=Go(),{sourcesApi:l,destinationsApi:s}=rl(),[c,d]=r(1),[u,p]=r(!1),[h,g]=r(null),[m,f]=r(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(wp,{paddingXAxis:o,paddingYAxis:n,children:[e(Ip,{children:[t(Il,{useInline:!0}),t(fa,{currentStep:c,data:Ep,gap:32})]}),t(Gl,{initialInputs:h,children:e(Hl,{children:[1===c&&t(kp,{onStart:b}),2===c&&t(Ms,{disableAnimation:!0,onBack:e=>{g(e),v()},onNext:e=>{g(e),b()}}),3===c&&t(vs,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:m}),4===c&&t(bp,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),m&&e.push(...m.map(e=>s.create(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&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};i(hu),a()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:m})]})})]})},Ap=["sources","namespaces"],Np=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Op=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Rp=m.div`
582
613
  position: relative;
583
614
  display: inline-flex;
584
- `,sp=m.button`
615
+ `,Dp=m.button`
585
616
  display: inline-flex;
586
617
  align-items: center;
587
618
  gap: 8px;
@@ -594,7 +625,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
594
625
  &:hover {
595
626
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
596
627
  }
597
- `,cp=m.div`
628
+ `,Fp=m.div`
598
629
  position: absolute;
599
630
  top: calc(100% + 8px);
600
631
  right: 0;
@@ -607,65 +638,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
607
638
  border-radius: 12px;
608
639
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
609
640
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
610
- `,dp=m.div`
641
+ `,Pp=m.div`
611
642
  display: flex;
612
643
  flex-direction: column;
613
644
  gap: 12px;
614
645
  padding: 16px;
615
646
  max-height: 60vh;
616
647
  overflow-y: auto;
617
- `,up=m.div`
648
+ `,_p=m.div`
618
649
  display: flex;
619
650
  align-items: center;
620
651
  gap: 8px;
621
652
  padding: 12px 16px;
622
653
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
623
- `,pp=m.div`
654
+ `,Lp=m.div`
624
655
  display: flex;
625
656
  align-items: center;
626
657
  gap: 8px;
627
658
  margin-left: auto;
628
- `,hp=()=>{const o=f(),l=ct(e=>e.sources),s=ct(e=>e.namespaces),{selectedStreamName:c}=Me(),{getItemSS:d,setItemSS:u,removeItemSS:p}=ba(),{namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=ha(),x=a(()=>ga(l,c),[l,c]);n(()=>{const e=d(ma.OVERVIEW_FILTERS,w());C(e)},[]);const[T,k]=r({namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[$,E]=r(lp(T)),[I,N]=r(!1);n(()=>{if(!I){const e={namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};k(e),E(lp(e))}},[I,h,g,m,b,v,y]);const A=i(null);lo(A,()=>N(!1)),Po({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(()=>fa.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));k(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=I?bi:vi,z=a(()=>ip(T.languages),[T.languages]);return e(rp,{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(cp,{children:[e(dp,{children:[t(tt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!O.length,options:O,values:ip(T.namespaces),setValues:e=>L("namespaces",O,e)}),t(tt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:ip(T.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:ip(T.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:ip(T.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",F,e)}),t(K,{label:"Show only sources with errors",size:gt.L,value:!!T.onlyErrors,onChange:e=>k(t=>({...t,onlyErrors:e}))})]}),e(up,{children:[t(ne,{"data-id":"filters-reset",size:ae.S,variant:ie.Text,label:"Reset",onClick:()=>{p(ma.OVERVIEW_FILTERS),S(),k(w()),E(0),N(!1)},textColor:o.v2.colors.red[500]}),e(pp,{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(ma.OVERVIEW_FILTERS,T),C(T),E(lp(T)),N(!1)}})]})]})]})]})},gp="40vw",mp=m.div`
629
- position: relative;
630
- width: ${gp};
631
- `,fp=m.div`
632
- position: absolute;
633
- top: calc(100% + 8px);
634
- left: 0;
635
- z-index: ${({theme:e})=>e.v2.zIndex.popover};
636
- display: flex;
637
- flex-direction: column;
638
- gap: 8px;
639
- padding: 8px;
640
- width: calc(${gp} - 16px);
641
- border-radius: 12px;
642
- background-color: ${({theme:e})=>e.v2.colors.silver[900]};
643
- box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
644
- `,bp=m.div`
645
- display: flex;
646
- align-items: center;
647
- overflow-x: auto;
648
- `,vp=m.div`
649
- display: flex;
650
- flex-direction: column;
651
- gap: 0;
652
- max-height: 60vh;
653
- overflow-y: auto;
654
- `,yp=m.div`
655
- padding: 8px 12px 4px 12px;
656
- `,Cp=m.div`
657
- display: flex;
658
- align-items: center;
659
- gap: 8px;
660
- padding: 8px 12px;
661
- border-radius: 6px;
662
- cursor: pointer;
663
- &:hover {
664
- background-color: ${({theme:e})=>e.v2.colors.silver[700]};
665
- }
666
- `,Sp=m.div`
667
- padding: 16px 8px;
668
- `,wp=({preventPopup:o=!1})=>{const n=f(),{onClickNode:l}=va(),{searchText:c,setSearchText:d}=ha(),{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")};lo(b,()=>x()),Po({key:"Escape",active:w},x);const{categories:T,searchResults:k}=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:ga(p,u),actions:g,destinations:Nt(h,u),searchText:c,selectedCategory:C}),[m,p,g,h,u,c,C]),$=a(()=>T.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[T]),E=k.some(({entities:e})=>e.length>0);return e(mp,{ref:b,children:[t(Kt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>y(!0),width:gp}),w&&e(fp,{children:[$.length>1&&t(bp,{children:t(le,{options:$,selected:C,setSelected:S})}),E?t(vp,{children:k.map(({category:o,label:a,entities:i},r)=>{if(!i.length)return null;const c=Ca(o);return e(s,{children:[t(yp,{children:t(Q,{size:te.XXS,color:ee.Secondary,children:a})}),i.map((a,i)=>e(Cp,{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:ya(a,o,{extended:!0})})]},`entity-${r}-${i}`))]},`category-list-${o}`)})}):t(Sp,{children:t(me,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},xp=m.div`
659
+ `,zp=()=>{const o=f(),{sourcesApi:l,namespacesApi:s}=rl({subscribe:Ap}),c=l.items,d=s.items,{selectedStreamName:u}=He(),{getItemSS:p,setItemSS:h,removeItemSS:g}=Sa(),{namespaces:m,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:w,clearAll:T,getEmptyState:x}=ba(),k=a(()=>va(c,u),[c,u]);n(()=>{const e=p(ya.OVERVIEW_FILTERS,x());w(e)},[]);const[E,I]=r({namespaces:m,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[$,A]=r(Op(E)),[N,O]=r(!1);n(()=>{if(!N){const e={namespaces:m,kinds:b,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),A(Op(e))}},[N,m,b,v,y,C,S]);const R=i(null);uo(R,()=>O(!1)),zo({key:"Escape",active:N},()=>O(!1));const D=a(()=>{const e=new Set,t=[];return d.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[d]),F=a(()=>{const e=new Set,t=[];return k.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[k]),P=a(()=>{const e=new Set,t=[];return k.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Xe[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[k]),_=a(()=>Ca.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),L=a(()=>{const e=new Set,t=[];return k.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Pt(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[k]),z=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));I(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},M=N?Si:wi,B=a(()=>Np(E.languages),[E.languages]);return e(Rp,{ref:R,children:[e(Dp,{"data-id":"filters-trigger",$isOpen:N,type:"button",onClick:()=>O(e=>!e),children:[t(el,{size:16,fill:o.v2.colors.white[500]}),t(ae,{size:le.XS,weight:500,nowrap:!0,children:"Filters"}),$>0&&t(Be,{label:$,status:ft.Unknown,textSize:le.XXXS}),t(M,{size:16,fill:o.v2.colors.silver[200]})]}),N&&e(Fp,{children:[e(Pp,{children:[t(lt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Np(E.namespaces),setValues:e=>z("namespaces",D,e)}),t(lt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:Np(E.kinds),setValues:e=>z("kinds",F,e)}),t(lt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:B,setValues:e=>z("languages",P,e)}),t(lt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:Np(E.monitors),setValues:e=>z("monitors",_,e)}),t(lt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:Np(E.podsAgentInjectionStatus),setValues:e=>z("podsAgentInjectionStatus",L,e)}),t(Q,{label:"Show only sources with errors",size:vt.L,value:!!E.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(_p,{children:[t(se,{"data-id":"filters-reset",size:ce.S,variant:de.Text,label:"Reset",onClick:()=>{g(ya.OVERVIEW_FILTERS),T(),I(x()),A(0),O(!1)},textColor:o.v2.colors.red[500]}),e(Lp,{children:[t(se,{"data-id":"filters-cancel",size:ce.S,variant:de.Secondary,label:"Cancel",onClick:()=>O(!1)}),t(se,{"data-id":"filters-apply",size:ce.S,variant:de.Primary,label:"Apply",onClick:()=>{h(ya.OVERVIEW_FILTERS,E),w(E),A(Op(E)),O(!1)}})]})]})]})]})},Mp=m.div`
669
660
  position: relative;
670
661
  display: flex;
671
662
  align-items: center;
@@ -676,7 +667,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
676
667
  box-sizing: border-box;
677
668
  border-radius: 16px 16px 0 0;
678
669
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
679
- `,Tp=m.div`
670
+ `,Bp=m.div`
680
671
  position: absolute;
681
672
  bottom: 0;
682
673
  left: 0;
@@ -685,7 +676,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
685
676
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
686
677
  border-radius: 32px;
687
678
  transition: width 0.3s;
688
- `,kp=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Mo();return e(xp,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(H,{size:Sa.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:ii,onClick:()=>u(o)}),t(ot,{"data-id":`refresh-${o}`,icon:Ii,onClick:l,disabled:i})]}),"number"==typeof d&&t(Tp,{$percent:d})]})},$p=m(V)`
679
+ `,Xp=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Go();return e(Mp,{children:[e(re,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(Y,{size:wa.S,partiallyChecked:r,value:!!s,onChange:c}),t(ae,{size:le.S,nowrap:!0,children:`${Pt(o)}s`}),t(Be,{label:n,tooltip:a,status:ft.Unknown,textSize:le.XXXS})]}),e(re,{children:[t(rt,{"data-id":`add-${o}`,icon:ci,onClick:()=>u(o)}),t(rt,{"data-id":`refresh-${o}`,icon:Ri,onClick:l,disabled:i})]}),"number"==typeof d&&t(Bp,{$percent:d})]})},Vp=m(W)`
689
680
  align-items: center !important;
690
681
  justify-content: center !important;
691
682
  align-self: stretch;
@@ -700,7 +691,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
700
691
  &:hover {
701
692
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
702
693
  }
703
- `,Ep=({entityType:o,description:n})=>{const{setCurrentModal:a}=Mo();return e($p,{onClick:()=>a(o),children:[e(oe,{$gap:4,children:[t(ii,{size:16}),t(Q,{size:te.S,children:`Add ${Ot(o)}`})]}),t(Q,{size:te.XXS,align:"center",children:n})]})},Ip=m.div`
694
+ `,Up=({entityType:o,description:n})=>{const{setCurrentModal:a}=Go();return e(Vp,{onClick:()=>a(o),children:[e(re,{$gap:4,children:[t(ci,{size:16}),t(ae,{size:le.S,children:`Add ${Pt(o)}`})]}),t(ae,{size:le.XXS,align:"center",children:n})]})},Gp=m.div`
704
695
  display: flex;
705
696
  align-items: center;
706
697
  gap: 12px;
@@ -715,10 +706,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
715
706
  &:hover {
716
707
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
717
708
  }
718
- `,Np=m(oe)`
709
+ `,Hp=m(re)`
719
710
  flex: 1;
720
711
  min-width: 0;
721
- `,Ap=({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}=wa(),T=g,k=b?T.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind):-1},[b,w,k,T.id]),E=v&&!h?xa(we.Info,m):l?xa(l,m):void 0,I=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Ip,{"data-id":I,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(H,{size:Sa.S,value:-1!==$,onChange:()=>{const e={...w};e[k]||(e[k]=[]),-1===$?e[k].push(T):e[k].splice($,1),x(e)}}),t(eo,{icons:u,icon:d,iconSrc:p}),e(Np,{$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 Op(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 Dp(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 Rp=m.div`
712
+ `,jp=({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===mt.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=eo(),{selectedSources:w,setSelectedSources:T}=Ta(),x=g,k=b?x.id.namespace:"",E=a(()=>{if(!b)return-1;const e=w[k];return e?.length?e.findIndex(e=>e.id.name===x.id.name&&e.id.kind===x.id.kind):-1},[b,w,k,x.id]),I=v&&!h?xa(Ie.Info,m):l?xa(l,m):void 0,$=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Gp,{"data-id":$,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(Y,{size:wa.S,value:-1!==E,onChange:()=>{const e={...w};e[k]||(e[k]=[]),-1===E?e[k].push(x):e[k].splice(E,1),T(e)}}),t(ao,{icons:u,icon:d,iconSrc:p}),e(Hp,{$gap:4,children:[t(Se,{size:le.XS,nowrap:!0,children:i}),t(re,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(De,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Be,{label:c,status:l&&[Ie.Error,Ie.Warning].includes(l)?l:ft.Unknown,leftIcon:I,textSize:le.XXXS})})})]})]})};function Wp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Kt.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Ut.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Kp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Kt.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Yp=m.div`
722
713
  position: absolute;
723
714
  top: 0;
724
715
  left: 0;
@@ -729,22 +720,22 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
729
720
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
730
721
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
731
722
  pointer-events: none;
732
- `,Pp=m.div`
723
+ `,Jp=m.div`
733
724
  display: flex;
734
725
  align-items: center;
735
726
  gap: 8px;
736
727
  padding: 4px 8px 0;
737
- `,Fp=m.div`
728
+ `,qp=m.div`
738
729
  flex: 1;
739
730
  height: 1px;
740
731
  background: ${({theme:e})=>e.v2.colors.silver[700]};
741
- `,Lp=({namespace:e})=>{const o=f();return t(Rp,{children:t(Q,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},_p=({namespace:o})=>{const n=f();return e(Pp,{children:[t(Fp,{}),t(Q,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Fp,{})]})},zp={[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},Bp=m.div`
732
+ `,Zp=({namespace:e})=>{const o=f();return t(Yp,{children:t(ae,{size:le.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Qp=({namespace:o})=>{const n=f();return e(Jp,{children:[t(qp,{}),t(ae,{size:le.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(qp,{})]})},eh={[mt.InstrumentationRule]:Ge.NO_DATA_INSTRUMENTATION_RULES,[mt.Source]:Ge.NO_DATA_SOURCES,[mt.Action]:Ge.NO_DATA_ACTIONS,[mt.Destination]:Ge.NO_DATA_DESTINATIONS},th=m.div`
742
733
  display: flex;
743
734
  flex-direction: column;
744
735
  flex: 1 0 0;
745
736
  min-width: 0;
746
737
  ${({$isVm:e})=>e?"width: 45vw;":""}
747
- `,Mp=m.div`
738
+ `,oh=m.div`
748
739
  display: flex;
749
740
  flex-direction: column;
750
741
  align-items: stretch;
@@ -754,7 +745,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
754
745
  border-radius: 0 0 16px 16px;
755
746
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
756
747
  overflow: hidden;
757
- `,Xp=m.div`
748
+ `,nh=m.div`
758
749
  position: relative;
759
750
  display: flex;
760
751
  flex-direction: column;
@@ -766,7 +757,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
766
757
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
767
758
  height: ${({$height:e})=>e}px;
768
759
  overflow: hidden;
769
- `,Vp=(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:Op(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:Dp(e)}}}(e);l=t.status,s=t.faded,r=t.tooltip,c=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=ka(e.conditions);l=t,s=o}const d=ya(e,t,{extended:i,prioritizeDisplayName:!i});let u,p,h,g,m;switch(t){case ut.Source:{u=Qt(e),p=Ca(ut.Source);const t=n?.get($a(a));g=no(t);break}case ut.Destination:{const t=lt(e.destinationType.type);p=t.icon,h=t.iconSrc;const o=n?.get($a(a));g=no(o),m=!e.disabled;break}case ut.Action:p=kt(e.type),m=!e.disabled;break;case ut.InstrumentationRule:p=Ft(e.type),m=!e.disabled}return{key:$a(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}}},Up=({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}=wa(),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]),T=a(()=>i.map(e=>Vp(e,o,0,x)).filter(Boolean),[i,o,x,h]),[k,$]=r(""),{elements:E,indexToNamespace:I,multipleNs:N,dividerCount:A}=a(()=>{const e=[],o=[],n=new Set(T.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 T)g&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(_p,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(Ap,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[T,g]);n(()=>{if(g&&I.length&&!k){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!==k&&$(t)},[I,k]);if(h&&[ut.InstrumentationRule,ut.Action].includes(o))return null;const D=58*T.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(Bp,{$isVm:h,children:[t(kp,{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(Mp,{children:i.length?e(Xp,{$height:P,children:[N&&k&&t(Lp,{namespace:k}),t(Yt,{gap:4,elements:E,onTopIndexChange:N?O:void 0})]}):d?t(oo,{size:3}):t(Ep,{entityType:o,description:zp[o]??Be.TO_COLLECT_OTEL_DATA})})]})},Hp=m.div`
760
+ `,ah=(e,t,o)=>{const n=xt(e);if(!n)return null;const a=t===mt.Source;let i,l,r=!1,s=e;if(a){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Ut.Failure:return{status:Ie.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Ut.Notice:return{status:Ie.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Ut.Pending:case Ut.Waiting:return{status:void 0,faded:!1,displaySource:Wp(e)};case Ut.Unsupported:case Ut.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Kp(e)}}}(e);i=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Ea(e.conditions);i=t,r=o}const c=Ia(e,t,{extended:a,prioritizeDisplayName:!a});let d,u,p,h,g;switch(t){case mt.Source:{d=no(e),u=Aa(mt.Source);const t=o?.get($a(n));h=ro(t);break}case mt.Destination:{const t=ut(e.destinationType.type);u=t.icon,p=t.iconSrc;const a=o?.get($a(n));h=ro(a),g=!e.disabled;break}case mt.Action:u=At(e.type),g=!e.disabled;break;case mt.InstrumentationRule:u=Mt(e.type),g=!e.disabled}return{key:$a(n),entityId:n,namespace:a?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:i,faded:r,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:g,raw:s}}},ih=({entityType:o,entities:i,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),g=o===mt.Source,m=i.length!==s,f=Ct(e=>g?e.progress[Tt.Instrumenting]?.percentage:void 0),b=Ct(e=>g?e.progress[Tt.Uninstrumenting]?.percentage:void 0),v=!g||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=Ta(),w=a(()=>g?Object.values(C).reduce((e,t)=>e+t.length,0):0,[g,C]),T=a(()=>{if(!c)return;const e=new Map,t=o===mt.Source?c.sources:o===mt.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(ka(o),o.throughput);return e},[c,o]),x=a(()=>i.map(e=>ah(e,o,T)).filter(Boolean),[i,o,T]),[k,E]=r(""),{elements:I,indexToNamespace:$,multipleNs:A,dividerCount:N}=a(()=>{const e=[],o=[],n=new Set(x.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 x)g&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(Qp,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(jp,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[x,g]);n(()=>{if(g&&$.length&&!k){const e=$.find(Boolean);e&&E(e)}},[g,$]);const O=l(e=>{if(!$.length)return;const t=$[Math.min(e,$.length-1)];t&&t!==k&&E(t)},[$,k]);if(h&&[mt.InstrumentationRule,mt.Action].includes(o))return null;const R=58*x.length+(A?28:0)+32*N,D=Math.max(0,u-52-16),F=Math.min(D,R)+8,P="number"==typeof v?`${v}%`:m?`${i.length}/${s}`:s;return e(th,{$isVm:h,children:[t(Xp,{entityType:o,badge:P,badgeTooltip:m?Ge.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(oh,{children:i.length?e(nh,{$height:F,children:[A&&k&&t(Zp,{namespace:k}),t(Qt,{gap:4,elements:I,onTopIndexChange:A?O:void 0})]}):d?t(lo,{size:3}):t(Up,{entityType:o,description:eh[o]??Ge.TO_COLLECT_OTEL_DATA})})]})},lh=["sources","destinations","actions","rules"],rh=m.div`
770
761
  width: 100%;
771
762
  flex: 1;
772
763
  min-height: 0;
@@ -774,10 +765,50 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
774
765
  display: flex;
775
766
  align-items: stretch;
776
767
  gap: 16px;
777
- `,Gp=({metrics:o,refetchSources:n,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:r})=>{const s=ha(),{selectedStreamName:c}=Me(),{containerRef:d,containerHeight:u}=Ea(),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(()=>ga(p,c),[p,c]),S=a(()=>Nt(g,c),[g,c]),w=a(()=>Ia(C,s),[C,s]),x=a(()=>Na(S,s),[S,s]),T=a(()=>Aa(f,s),[f,s]);return e(Hp,{ref:d,children:[t(Up,{entityType:ut.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:u,refetch:r}),t(Up,{entityType:ut.Source,entities:w,unfilteredCount:C.length,metrics:o,loading:h,maxHeight:u,refetch:n}),t(Up,{entityType:ut.Action,entities:T,unfilteredCount:f.length,loading:b,maxHeight:u,refetch:l}),t(Up,{entityType:ut.Destination,entities:x,unfilteredCount:S.length,metrics:o,loading:m,maxHeight:u,refetch:i})]})},jp=({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:T,deleteInstrumentationRule:k,createAction:$,updateAction:E,deleteAction:I,workloads:N})=>{const{currentModal:A,setCurrentModal:O}=Mo(),{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(Hd,{}),A===ut.Source&&t(Ll,{children:t(As,{onClose:L,fetchNamespacesWithWorkloads:i,persistSources:l,withOverlay:!0})}),A===ut.Destination&&t(_l,{children:t(cs,{onClose:L,getDestinationCategories:b,getPotentialDestinations:v,testConnection:y,createDestination:C,updateDestination:S,withOverlay:!0})}),A===ut.InstrumentationRule&&t(Bl,{sourceOptions:_,namespaceOptions:z,children:t(ds,{onClose:L,createInstrumentationRule:x,withOverlay:!0})}),A===ut.Action&&t(zl,{children:t(Qr,{onClose:L,createAction:$,withOverlay:!0})}),D===ut.Source&&R&&t(Ml,{children:t(fd,{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(_l,{children:t(Fs,{onClose:L,destinationId:R,getDestinationCategories:b,testConnection:y,updateDestination:S,deleteDestination:w})}),D===ut.InstrumentationRule&&R&&t(Bl,{sourceOptions:_,namespaceOptions:z,children:t(_s,{onClose:L,ruleId:R,updateInstrumentationRule:T,deleteInstrumentationRule:k})}),D===ut.Action&&R&&t(zl,{children:t(Ds,{onClose:L,actionId:R,updateAction:E,deleteAction:I})})]})},Wp="multi-source-deselect",Kp="multi-source-restart",Yp="multi-source-uninstrument",Jp="Selected sources",qp="Deselect",Zp="Restart",Qp="Uninstrument",eh="Rollout Restart Workloads",th="Are you sure you want to rollout restart these workloads?",oh="Go Back",nh="Confirm",ah=({restartWorkloads:i,persistSources:s})=>{const{selectedStreamName:c}=Me(),{selectedSources:d,setSelectedSources:u}=wa(),[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:Wp,type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:qp,onClick:b}},{id:Kp,type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,label:Zp,leftIcon:Xi,onClick:()=>h(!0)}},{id:Yp,type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:Qp,leftIcon:ai,onClick:()=>m(!0)}}],[b]);return e(o,{children:[t(ua,{isOpen:f>0,richTitle:{icon:wi,title:Jp,badge:{label:f}},actions:w}),t(ze,{isOpen:p,title:eh,description:th,onClose:v,denyButton:{label:oh,variant:ie.Secondary,onClick:v},approveButton:{label:nh,variant:ie.Primary,onClick:()=>{C(),v()}}}),t(bl,{isOpen:g,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},ih=e=>`Data Stream: ${e}`,lh="Search streams...",rh="No streams match",sh=m.div`
768
+ `,sh={sources:[],destinations:[]},ch=()=>{const o=ba(),{selectedStreamName:n}=He(),{containerRef:i,containerHeight:l}=Na(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d}=rl({subscribe:lh}),{items:u,loading:p}=r,{items:h,loading:g}=s,{items:m,loading:f}=c,{items:b,loading:v}=d,y=eo(e=>e.drawerType),C=Go(e=>e.currentModal),{data:S}=sl("GET_METRICS",void 0,{skip:!(u.length&&h.length&&!y&&!C),pollInterval:1e4,fetchPolicy:"network-only"}),w=S?.getOverviewMetrics??sh,T=a(()=>va(u,n),[u,n]),x=a(()=>Dt(h,n),[h,n]),k=a(()=>Oa(T,o),[T,o]),E=a(()=>Ra(x,o),[x,o]),I=a(()=>Da(m,o),[m,o]);return e(rh,{ref:i,children:[t(ih,{entityType:mt.InstrumentationRule,entities:b,unfilteredCount:b.length,loading:v,maxHeight:l,refetch:d.fetchAll}),t(ih,{entityType:mt.Source,entities:k,unfilteredCount:T.length,metrics:w,loading:p,maxHeight:l,refetch:r.fetchAll}),t(ih,{entityType:mt.Action,entities:I,unfilteredCount:m.length,loading:f,maxHeight:l,refetch:c.fetchAll}),t(ih,{entityType:mt.Destination,entities:E,unfilteredCount:x.length,metrics:w,loading:g,maxHeight:l,refetch:s.fetchAll})]})},dh=["sources","destinations","actions","rules"],uh="40vw",ph=m.div`
769
+ position: relative;
770
+ width: ${uh};
771
+ `,hh=m.div`
772
+ position: absolute;
773
+ top: calc(100% + 8px);
774
+ left: 0;
775
+ z-index: ${({theme:e})=>e.v2.zIndex.popover};
776
+ display: flex;
777
+ flex-direction: column;
778
+ gap: 8px;
779
+ padding: 8px;
780
+ width: calc(${uh} - 16px);
781
+ border-radius: 12px;
782
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
783
+ box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
784
+ `,gh=m.div`
785
+ display: flex;
786
+ align-items: center;
787
+ overflow-x: auto;
788
+ `,mh=m.div`
789
+ display: flex;
790
+ flex-direction: column;
791
+ gap: 0;
792
+ max-height: 60vh;
793
+ overflow-y: auto;
794
+ `,fh=m.div`
795
+ padding: 8px 12px 4px 12px;
796
+ `,bh=m.div`
797
+ display: flex;
798
+ align-items: center;
799
+ gap: 8px;
800
+ padding: 8px 12px;
801
+ border-radius: 6px;
802
+ cursor: pointer;
803
+ &:hover {
804
+ background-color: ${({theme:e})=>e.v2.colors.silver[700]};
805
+ }
806
+ `,vh=m.div`
807
+ padding: 16px 8px;
808
+ `,yh=({preventPopup:o=!1})=>{const n=f(),{onClickNode:l}=Fa(),{searchText:c,setSearchText:d}=ba(),{selectedStreamName:u}=He(),{sourcesApi:p,destinationsApi:h,actionsApi:g,instrumentationRulesApi:m}=rl({subscribe:dh}),b=p.items,v=h.items,y=g.items,C=m.items,S=i(null),[w,T]=r(!1),[x,k]=r("all"),E=!o&&(!!c||w),I=()=>{d(""),T(!1),k("all")};uo(S,()=>I()),zo({key:"Escape",active:E},I);const{categories:$,searchResults:A}=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:mt.Source,label:"Sources",count:r.length,entities:[]},{category:mt.Action,label:"Actions",count:s.length,entities:[]},{category:mt.Destination,label:"Destinations",count:c.length,entities:[]},{category:mt.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===mt.InstrumentationRule?l:e.category===mt.Source?r:e.category===mt.Action?s:e.category===mt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:C,sources:va(b,u),actions:y,destinations:Dt(v,u),searchText:c,selectedCategory:x}),[C,b,y,v,u,c,x]),N=a(()=>$.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[$]),O=A.some(({entities:e})=>e.length>0);return e(ph,{ref:S,children:[t(Zt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>T(!0),width:uh}),E&&e(hh,{children:[N.length>1&&t(gh,{children:t(ue,{options:N,selected:x,setSelected:k})}),O?t(mh,{children:A.map(({category:o,label:a,entities:i},r)=>{if(!i.length)return null;const c=Aa(o);return e(s,{children:[t(fh,{children:t(ae,{size:le.XXS,color:ie.Secondary,children:a})}),i.map((a,i)=>e(bh,{onClick:()=>{const e=xt(a);l(null,{data:{type:o,id:e}}),I()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(ae,{size:le.XS,nowrap:!0,children:Ia(a,o,{extended:!0})})]},`entity-${r}-${i}`))]},`category-list-${o}`)})}):t(vh,{children:t(Ce,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},Ch=["sources"],Sh=({onRedirectToSampling:n})=>{const{currentModal:i,setCurrentModal:l}=Go(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=eo(),{sourcesApi:u}=rl({subscribe:Ch}),p=()=>{l(""),c(null),d(null)},h=a(()=>u.items.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[u.items]),g=a(()=>Array.from(new Set(u.items.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u.items]);return e(o,{children:[t(gu,{}),i===mt.Source&&t(Gl,{children:t(Ms,{onClose:p,withOverlay:!0})}),i===mt.Destination&&t(Hl,{children:t(vs,{onClose:p,withOverlay:!0})}),i===mt.InstrumentationRule&&t(Wl,{sourceOptions:h,namespaceOptions:g,children:t(ys,{onClose:p,withOverlay:!0})}),i===mt.Action&&t(jl,{children:t(rs,{onClose:p,withOverlay:!0})}),r===mt.Source&&s&&t(Kl,{children:t(Md,{onClose:p,sourceId:s,onRedirectToSampling:n})}),r===mt.Destination&&s&&t(Hl,{children:t(js,{onClose:p,destinationId:s})}),r===mt.InstrumentationRule&&s&&t(Wl,{sourceOptions:h,namespaceOptions:g,children:t(Ys,{onClose:p,ruleId:s})}),r===mt.Action&&s&&t(jl,{children:t(Vs,{onClose:p,actionId:s})})]})},wh=["dataStreams"],Th=e=>`Data Stream: ${e}`,xh="Search streams...",kh="No streams match",Eh=m.div`
778
809
  position: relative;
779
810
  display: inline-flex;
780
- `,ch=m.div`
811
+ `,Ih=m.div`
781
812
  display: inline-flex;
782
813
  align-items: center;
783
814
  gap: 6px;
@@ -788,7 +819,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
788
819
  &:hover {
789
820
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
790
821
  }
791
- `,dh=m.div`
822
+ `,$h=m.div`
792
823
  position: absolute;
793
824
  top: calc(100% + 8px);
794
825
  left: 0;
@@ -802,18 +833,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
802
833
  border-radius: 12px;
803
834
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
804
835
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
805
- `,uh=m.div`
836
+ `,Ah=m.div`
806
837
  display: flex;
807
838
  align-items: center;
808
839
  gap: 8px;
809
840
  width: 100%;
810
- `,ph=m.div`
841
+ `,Nh=m.div`
811
842
  display: flex;
812
843
  flex-direction: column;
813
844
  gap: 0;
814
845
  max-height: 240px;
815
846
  overflow-y: auto;
816
- `,hh=m.div`
847
+ `,Oh=m.div`
817
848
  display: flex;
818
849
  align-items: center;
819
850
  gap: 8px;
@@ -824,29 +855,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
824
855
  &:hover {
825
856
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
826
857
  }
827
- `,gh=m.div`
858
+ `,Rh=m.div`
828
859
  flex: 1;
829
860
  min-width: 0;
830
861
  overflow: hidden;
831
862
  text-overflow: ellipsis;
832
863
  white-space: nowrap;
833
- `,mh=m.div`
864
+ `,Dh=m.div`
834
865
  display: flex;
835
866
  align-items: center;
836
867
  gap: 2px;
837
868
  flex-shrink: 0;
838
- `,fh=m.div`
869
+ `,Fh=m.div`
839
870
  display: flex;
840
871
  padding-top: 4px;
841
872
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
842
- `,bh=({updateDataStream:l,deleteDataStream:s,createDataStream:c})=>{const d=f(),{isVm:u}=y(),{clearStore:p}=Oa(),{dataStreams:h,selectedStreamName:g,setSelectedStreamName:m}=Me(),b=i(null),[v,C]=r(!1),[S,w]=r(""),[x,T]=r(""),[k,$]=r(!1),[E,I]=r(!1),[N,A]=r(!1),[O,D]=r(""),[R,P]=r(!1);lo(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?bi:vi;return u?null:e(o,{children:[e(sh,{ref:b,children:[e(ch,{"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:ih(g)}),t(Fe,{label:h.length,status:pt.Unknown,textSize:te.XXXS}),t(L,{size:20,fill:d.v2.colors.silver[200]})]}),v&&e(dh,{children:[t(uh,{children:t(Kt,{value:S,onChange:w,placeholder:lh,width:"100%"})}),t(ph,{children:0===F.length?t(hh,{children:t(Q,{size:te.XS,color:ee.Secondary,children:rh})}):F.map(({name:o})=>{const n=o===Da;return e(hh,{"data-id":`stream-row-${o}`,$selected:o===g,onClick:()=>(e=>{e!==g&&(p(),m(e)),C(!1)})(o),children:[t(gh,{children:t(Q,{size:te.XS,nowrap:!0,children:o})}),e(mh,{children:[t(ot,{"data-id":`stream-edit-${o}`,icon:ui,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),T(o),$(!0)}}),!n&&t(ot,{"data-id":`stream-delete-${o}`,icon:ai,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),P(!0)}})]})]},`stream-${o}`)})}),t(fh,{children:t(ne,{"data-id":"add-stream-trigger",variant:ie.Secondary,size:ae.S,leftIcon:ii,label:`${St.NEW} ${Be.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),A(!0),I(!0)}})})]})]}),N&&t(Xl,{defaultExcludeName:g,children:t(Bd,{isOpen:E,onClose:()=>I(!1),onCloseEnd:()=>A(!1),createDataStream:c})}),x&&t(Xl,{children:t(Md,{isOpen:k,dataStreamName:x,onClose:()=>$(!1),onCloseEnd:()=>T(""),updateDataStream:l})}),t(bl,{target:`${Be.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:R,onClose:()=>P(!1),onApprove:async()=>{O&&await s(O)}})]})},vh=v`
873
+ `,Ph=()=>{const l=f(),{isVm:s}=y(),{clearStore:c}=Pa(),{dataStreamsApi:d}=rl({subscribe:wh}),{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=He(),g=i(null),[m,b]=r(!1),[v,C]=r(""),[S,w]=r(""),[T,x]=r(!1),[k,E]=r(!1),[I,$]=r(!1),[A,N]=r(""),[O,R]=r(!1);uo(g,()=>b(!1)),n(()=>{m||C("")},[m]);const D=a(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),F=m?Si:wi;return s?null:e(o,{children:[e(Eh,{ref:g,children:[e(Ih,{"data-id":"data-stream-select",$isOpen:m,onClick:()=>b(e=>!e),children:[t(tl,{size:24}),t(ae,{size:le.S,weight:500,nowrap:!0,children:Th(p)}),t(Be,{label:u.length,status:ft.Unknown,textSize:le.XXXS}),t(F,{size:20,fill:l.v2.colors.silver[200]})]}),m&&e($h,{children:[t(Ah,{children:t(Zt,{value:v,onChange:C,placeholder:xh,width:"100%"})}),t(Nh,{children:0===D.length?t(Oh,{children:t(ae,{size:le.XS,color:ie.Secondary,children:kh})}):D.map(({name:o})=>{const n=o===_a;return e(Oh,{"data-id":`stream-row-${o}`,$selected:o===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),b(!1)})(o),children:[t(Rh,{children:t(ae,{size:le.XS,nowrap:!0,children:o})}),e(Dh,{children:[t(rt,{"data-id":`stream-edit-${o}`,icon:mi,size:st.XS,onClick:e=>{e.stopPropagation(),b(!1),w(o),x(!0)}}),!n&&t(rt,{"data-id":`stream-delete-${o}`,icon:si,size:st.XS,onClick:e=>{e.stopPropagation(),b(!1),N(o),R(!0)}})]})]},`stream-${o}`)})}),t(Fh,{children:t(se,{"data-id":"add-stream-trigger",variant:de.Secondary,size:ce.S,leftIcon:ci,label:`${kt.NEW} ${Ge.STREAM_NAME}`,fullWidth:!0,onClick:()=>{b(!1),c(),$(!0),E(!0)}})})]})]}),I&&t(Yl,{defaultExcludeName:p,children:t(cu,{isOpen:k,onClose:()=>E(!1),onCloseEnd:()=>$(!1)})}),S&&t(Yl,{children:t(du,{isOpen:T,dataStreamName:S,onClose:()=>x(!1),onCloseEnd:()=>w("")})}),t(xl,{target:`${Ge.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:O,onClose:()=>R(!1),onApprove:async()=>{A&&await d.remove(A)}})]})},_h="multi-source-deselect",Lh="multi-source-restart",zh="multi-source-uninstrument",Mh="Selected sources",Bh="Deselect",Xh="Restart",Vh="Uninstrument",Uh="Rollout Restart Workloads",Gh="Are you sure you want to rollout restart these workloads?",Hh="Go Back",jh="Confirm",Wh=()=>{const{selectedStreamName:i}=He(),{selectedSources:s,setSelectedSources:c}=Ta(),{sourcesApi:d}=rl(),[u,p]=r(!1),[h,g]=r(!1),m=a(()=>Object.values(s).reduce((e,t)=>e+t.length,0),[s]),f=l(()=>{c({})},[c]),b=l(()=>p(!1),[]),v=l(()=>g(!1),[]);n(()=>{f()},[i,f]);const y=l(()=>{d.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==io.StaticPod).map(to)),f()},[d,s,f]),C=l(()=>{d.persistV2(Object.fromEntries(Object.entries(s).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:i}))]))),f()},[d,s,i,f]),S=a(()=>[{id:_h,type:qt.Button,buttonProps:{variant:de.Text,size:ce.S,label:Bh,onClick:f}},{id:Lh,type:qt.Button,buttonProps:{variant:de.Secondary,size:ce.S,label:Xh,leftIcon:Hi,onClick:()=>p(!0)}},{id:zh,type:qt.Button,buttonProps:{variant:de.Primary,size:ce.S,label:Vh,leftIcon:si,onClick:()=>g(!0)}}],[f]);return e(o,{children:[t(ma,{isOpen:m>0,richTitle:{icon:Ei,title:Mh,badge:{label:m}},actions:S}),t(Ue,{isOpen:u,title:Uh,description:Gh,onClose:b,denyButton:{label:Hh,variant:de.Secondary,onClick:b},approveButton:{label:jh,variant:de.Primary,onClick:()=>{y(),b()}}}),t(xl,{isOpen:h,action:"uninstrument",target:`${m} source${1===m?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},Kh=v`
843
874
  0% {
844
875
  background-position: 200% 50%;
845
876
  }
846
877
  100% {
847
878
  background-position: 0% 50%;
848
879
  }
849
- `,yh=m.div`
880
+ `,Yh=m.div`
850
881
  display: flex;
851
882
  align-items: center;
852
883
  justify-content: space-evenly;
@@ -857,50 +888,50 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
857
888
 
858
889
  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%)`};
859
890
  background-size: 200% 100%;
860
- animation: ${vh} 15s linear infinite;
861
- `,Ch=[Si,wi,mi,fi],Sh=({metrics:o,refetchSources:n,refetchDestinations:a,refetchActions:i,refetchInstrumentationRules:l,updateDataStream:r,deleteDataStream:c,createDataStream:d,...u})=>{const p=f();return e(da,{children:[e(Ye,{fullHeight:!0,customTitle:t(bh,{updateDataStream:r,deleteDataStream:c,createDataStream:d}),customSearch:t(wp,{}),filters:t(hp,{}),children:[t(yh,{children:Ch.map((o,n)=>e(s,{children:[t(o,{size:24}),n<Ch.length-1&&t(gi,{fill:p.v2.colors.white[500]+qe["020"],size:24})]},o.name))}),t(Gp,{metrics:o,refetchSources:n,refetchDestinations:a,refetchActions:i,refetchInstrumentationRules:l})]}),t(jp,{...u}),t(ah,{restartWorkloads:u.restartWorkloads,persistSources:u.persistSources})]})};var wh;!function(e){e.Gateway="gateway",e.Node="node"}(wh||(wh={}));const xh=({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:Mi,size:ae.S,variant:ie.Text,onClick:o,disabled:l}}),n&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ii,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(Ra,{icon:Zi,title:"Collectors Pipeline"}),t(Pa,{actions:r})]})},Th=({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:Fa(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?ri:si,label:e.ready?"True":"False",invertColors:!0}},{id:Bo(),title:"Started",badge:{status:e.started?we.Success:we.Error,leftIcon:e.started?ri:si,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:Be.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:ki,title:"Pod Information",onClose:l},children:c?e(xt,{bgTint:"1000",richTitle:{icon:ki,title:c.name,withCopy:!0},children:[t(xt,{bgTint:"900",cellsPerRow:2,items:u}),e(xt,{bgTint:"900",richTitle:{icon:Pi,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(yl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})})})};var kh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(kh||(kh={}));const $h=e=>{const t=[{key:kh.PodName,label:"Pod Name"},{key:kh.Status,label:"Status"},{key:kh.Restarts,label:Be.RESTARTS},{key:kh.NodeName,label:"Node Name"},{key:kh.Age,label:"Age"},{key:kh.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:kh.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Eh=({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:kh.PodName,rawValue:o.name},{key:kh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Fe,{status:Fa(e),label:e});var e}},{key:kh.Restarts,rawValue:o.restartsCount.toString()},{key:kh.NodeName,rawValue:o.nodeName},{key:kh.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?Qi:el,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?Qi:el,useSecondaryTone:!0,invertColors:!0})})]})}},{key:kh.Age,rawValue:c(o.creationTimestamp)},{key:kh.DockerImage,rawValue:o.image}]})),[n,s]);return e(xt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:ki,title:"Pods"},children:[t(go,{variant:mo.Data,isLoading:o,columns:$h(l),rows:p}),t(Th,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)})]})},Ih=({isOpen:e,onClose:o,title:n,yaml:a})=>t(q,{isOpen:e,header:{icon:tl,title:n,onClose:o},children:t(yl,{yaml:a,defaultOpen:!0})}),Nh=e=>{switch(e){case La.Healthy:return"All desired replicas are updated, available, and ready";case La.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case La.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case La.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case La.Down:return"No available replicas";case La.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Ah;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Ah||(Ah={}));const Oh=m.div`
891
+ animation: ${Kh} 15s linear infinite;
892
+ `,Jh=[ki,Ei,yi,Ci],qh=({onRedirectToSampling:o})=>{const n=f();return e(ga,{children:[e(et,{fullHeight:!0,customTitle:t(Ph,{}),customSearch:t(yh,{}),filters:t(zp,{}),children:[t(Yh,{children:Jh.map((o,a)=>e(s,{children:[t(o,{size:24}),a<Jh.length-1&&t(vi,{fill:n.v2.colors.white[500]+ot["020"],size:24})]},o.name))}),t(ch,{})]}),t(Sh,{onRedirectToSampling:o}),t(Wh,{})]})};var Zh;!function(e){e.Gateway="gateway",e.Node="node"}(Zh||(Zh={}));const Qh=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Gi,size:ce.S,variant:de.Text,onClick:o,disabled:l}}),n&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Refresh",leftIcon:Ri,size:ce.S,variant:de.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(re,{$alignItems:"center",$justifyContent:"space-between",children:[t(La,{icon:ol,title:"Collectors Pipeline"}),t(za,{actions:r})]})},eg=({pod:o,onClose:n})=>{const{formatTimeAgo:i}=Bt(),{data:l}=sl("GET_COLLECTOR_POD_INFO",o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),r=a(()=>[{id:Uo(),title:"Node",label:l?.node??"-",withCopy:!0},{id:Uo(),title:"Status",badge:{status:Ma(l?.status),label:l?.status??"-"}}],[l]),s=a(()=>l?.containers?.map(e=>({id:Uo(),items:[{id:Uo(),title:"Container",label:e.name??"-"},{id:Uo(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:Uo(),title:"Ready",badge:{status:e.ready?Ie.Success:Ie.Error,leftIcon:e.ready?ui:pi,label:e.ready?"True":"False",invertColors:!0}},{id:Uo(),title:"Started",badge:{status:e.started?Ie.Success:Ie.Error,leftIcon:e.started?ui:pi,label:e.started?"True":"False",invertColors:!0}},{id:Uo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Uo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Uo(),title:Ge.RESTARTS,label:e.restarts.toString()},{id:Uo(),title:"State Reason",label:e.stateReason??"-"},{id:Uo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Uo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[l]);return t(oe,{isOpen:!!o,header:{icon:Ai,title:"Pod Information",onClose:n},children:l?e(It,{bgTint:"1000",richTitle:{icon:Ai,title:l.name,withCopy:!0},children:[t(It,{bgTint:"900",cellsPerRow:2,items:r}),e(It,{bgTint:"900",richTitle:{icon:zi,title:Ge.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Jt,{value:`kubectl get pod ${l.name} -n ${l.namespace} -o yaml`}),t(Jt,{value:`kubectl describe pod ${l.name} -n ${l.namespace}`}),t(Jt,{value:`kubectl logs ${l.name} -n ${l.namespace}`})]}),t(It,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:s.length?s.map(({id:e,items:o})=>t(It,{bgTint:"800",cellsPerRow:2,items:o},e)):t(Ce,{title:"No containers",subTitle:"Pod has no containers"})}),t(El,{bgTint:"900",yaml:l.manifestYAML,defaultOpen:!0})]}):t(at,{$height:"50vh",children:t(ct,{withSpinner:!0})})})};var tg;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"}(tg||(tg={}));const og=e=>{const t=[{key:tg.PodName,label:"Pod Name"},{key:tg.Status,label:"Status"},{key:tg.Restarts,label:Ge.RESTARTS},{key:tg.NodeName,label:"Node Name"},{key:tg.Age,label:"Age"},{key:tg.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:tg.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},ng=({isLoading:o,pods:n,withSpanDropRate:i})=>{const l=f(),{formatTimeAgo:s}=Bt(),[c,d]=r(null),u=a(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:tg.PodName,rawValue:o.name},{key:tg.Status,rawValue:o.status,component:()=>{return e=o.status,t(Be,{status:Ma(e),label:e});var e}},{key:tg.Restarts,rawValue:o.restartsCount.toString()},{key:tg.NodeName,rawValue:o.nodeName},{key:tg.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(ae,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?Ie.Error:Ie.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?Ie.Error:Ie.Success;return e(re,{$gap:4,children:[t(De,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Be,{status:l,label:`Receiver ${i}%`,leftIcon:l===Ie.Error?nl:al,useSecondaryTone:!0,invertColors:!0})}),t(De,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Be,{status:c,label:`Exporter ${s}%`,leftIcon:c===Ie.Error?nl:al,useSecondaryTone:!0,invertColors:!0})})]})}},{key:tg.Age,rawValue:s(o.creationTimestamp)},{key:tg.DockerImage,rawValue:o.image}]})),[n,l]);return e(It,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Ai,title:"Pods"},children:[t(vo,{variant:yo.Data,isLoading:o,columns:og(i),rows:u}),t(eg,{pod:c,onClose:()=>d(null)})]})},ag=({isOpen:e,onClose:o,title:n,yaml:a})=>t(oe,{isOpen:e,header:{icon:il,title:n,onClose:o},children:t(El,{yaml:a,defaultOpen:!0})}),ig=e=>{switch(e){case Ba.Healthy:return"All desired replicas are updated, available, and ready";case Ba.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Ba.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Ba.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Ba.Down:return"No available replicas";case Ba.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var lg;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(lg||(lg={}));const rg=m.div`
862
893
  flex: 0.5;
863
894
  padding: 12px;
864
895
  border-radius: 12px;
865
896
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
866
- `,Dh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null),u=a(()=>(e=>{switch(e){case wh.Gateway:return"Deployment";case wh.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 wh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case wh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:we.Info,label:"Rollout in progress",rightIcon:Ii,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":La.Unknown,l=n?"Fetching data...":Nh(La.Unknown);switch(e){case wh.Gateway:a=t?.status?Fa(t?.status):a,i=t?.status??i,l=t?.status?Nh(t.status):l;break;case wh.Node:a=o?.status?Fa(o?.status):a,i=o?.status??i,l=o?.status?Nh(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 wh.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 wh.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 wh.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 wh.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===wh.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===wh.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:Ah.ManifestYaml,label:u,icon:ol},{id:Ah.ConfigMapYaml,label:"ConfigMap",icon:ol}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(_a,{...h})}),g.map(e=>t(Oh,{children:t("div",{children:t(za,{...e})})},e.title)),m.map(e=>t(Ba,{...e},e.title))]}),t(Ih,{isOpen:c===Ah.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(Ih,{isOpen:c===Ah.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Rh=[{value:wh.Gateway,label:"Gateway"},{value:wh.Node,label:"Node Collector"}],Ph=({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(wh.Gateway),[C,S]=r(null),[w,x]=r([]),[T,k]=r(null),[$,E]=r([]),I=l(async e=>{e?.silent||f(!0);try{switch(b){case wh.Gateway:S(await s()??null),x(await c()??[]);break;case wh.Node:k(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===wh.Gateway?w:$,[w,$,b]);return e(da,{children:[t(xh,{disabled:!h,loading:m,onClickDownloadDiagnose:void 0,onClickRefresh:N}),e(Ma,{children:[e(V,{children:[t(le,{variant:po.Underline,size:be.L,options:Rh,selected:b,setSelected:v}),t(Dh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:T,isLoading:m})]}),t(Eh,{isLoading:m,pods:A,getExtendedPodInfo:p,withSpanDropRate:!1===i?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!h&&t(wl,{minSupportedVersion:o,currentVersion:g||""})]})]})},Fh=m.div`
897
+ `,sg=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:s}=Bt(),[c,d]=r(null),u=a(()=>(e=>{switch(e){case Zh.Gateway:return"Deployment";case Zh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const a={status:ft.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case Zh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Zh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:Ie.Info,label:"Rollout in progress",rightIcon:Ri,useSecondaryTone:!0}:l?{status:ft.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,i,s),[n,i,o,s]),h=a(()=>((e,t,o,n)=>{let a=n?Ie.Info:ft.Unknown,i=n?"Loading":Ba.Unknown,l=n?"Fetching data...":ig(Ba.Unknown);switch(e){case Zh.Gateway:a=t?.status?Ma(t?.status):a,i=t?.status??i,l=t?.status?ig(t.status):l;break;case Zh.Node:a=o?.status?Ma(o?.status):a,i=o?.status??i,l=o?.status?ig(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 Zh.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 Zh.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 Zh.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 Zh.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===Zh.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Zh.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(It,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:il,title:u,badge:p},actions:[{id:Uo(),type:qt.ButtonDropData,buttonProps:{variant:de.Secondary,size:ce.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:lg.ManifestYaml,label:u,icon:ll},{id:lg.ConfigMapYaml,label:"ConfigMap",icon:ll}]}}],children:[e(re,{$gap:16,children:[t("div",{children:t(Xa,{...h})}),g.map(e=>t(rg,{children:t("div",{children:t(Va,{...e})})},e.title)),m.map(e=>t(Ua,{...e},e.title))]}),t(ag,{isOpen:c===lg.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(ag,{isOpen:c===lg.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},cg=[{value:Zh.Gateway,label:"Gateway"},{value:Zh.Node,label:"Node Collector"}],dg=({minSupportedVersion:o=0})=>{const{isVersionSupported:n,version:i}=y(o),[s,c]=r(Zh.Gateway),d=s===Zh.Gateway,u=s===Zh.Node,{data:p}=sl("GET_EFFECTIVE_CONFIG"),{data:h,loading:g,refetch:m}=sl("GET_GATEWAY_INFO",void 0,{skip:!d}),{data:f=[],loading:b,refetch:v}=sl("GET_GATEWAY_PODS",void 0,{skip:!d}),{data:C,loading:S,refetch:w}=sl("GET_NODE_COLLECTOR_INFO",void 0,{skip:!u}),{data:T=[],loading:x,refetch:k}=sl("GET_NODE_COLLECTOR_PODS",void 0,{skip:!u}),E=d&&(g||b)||u&&(S||x),I=l(()=>{d?(m(),v()):u&&(w(),k())},[d,u,m,v,w,k]),$=a(()=>d?f:T,[f,T,d]);return e(ga,{children:[t(Qh,{disabled:!n,loading:E,onClickDownloadDiagnose:void 0,onClickRefresh:I}),e(Ga,{children:[e(W,{children:[t(ue,{variant:fo.Underline,size:we.L,options:cg,selected:s,setSelected:c}),t(sg,{selectedTab:s,gatewayInfo:h??null,nodeCollectorInfo:C??null,isLoading:E})]}),t(ng,{isLoading:E,pods:$,withSpanDropRate:!1===p?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(Al,{minSupportedVersion:o,currentVersion:i||""})]})]})},ug=m.div`
867
898
  display: inline-flex;
868
899
  align-items: center;
869
900
  min-width: 0;
870
901
  overflow: hidden;
871
902
  white-space: pre;
872
903
  text-overflow: ellipsis;
873
- `,Lh=m.div`
904
+ `,pg=m.div`
874
905
  display: flex;
875
906
  flex-direction: column;
876
907
  gap: 4px;
877
908
  min-width: 0;
878
909
  flex: 1;
879
910
  opacity: ${({$disabled:e})=>e?.4:1};
880
- `,_h=m(oe)`
911
+ `,hg=m(re)`
881
912
  flex-shrink: 0;
882
913
  gap: 6px;
883
914
  align-items: center;
884
915
  min-height: 22px;
885
- `;const zh=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Bh=[{value:"all",label:Va},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Mh=({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(Lh,{$disabled:o.disabled,children:[t(Fh,{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(_h,{children:[o.disabled&&t(Fe,{label:Xa,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(di,{...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:yo,leftIcon:ui,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:Ui,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:Bh,selected:b,setSelected:v}}:{}},children:t(go,{variant:mo.Pretty,hideHeader:!0,isLoading:i,noDataProps:g.trim()?{hideIcon:!0,title:Ua,subTitle:ja(g)}:{hideIcon:!0,title:Ga,button:{label:Ha,onClick:d}},columns:zh,rows:C,getRowActions:x})})},Xh=({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]),T=a(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[X,U]=r(k.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);i(!1),n(()=>{},[d,s]);const ue=a(()=>w(c),[c]),pe=a(()=>$(s),[s]),he=a(()=>x(pe?.rule??null),[pe]),ge=a(()=>E(s),[s]),me=a(()=>I(ge?.rule??null),[ge]),fe=i(H);fe.current=H,n(()=>{const e=fe.current;if(!e)return;const t=N(s,e);t?G(t):(G(null),W(!1))},[s]);const ve=a(()=>{const e=new Set;return pe&&e.add(pe.rule.ruleId),ge&&e.add(ge.rule.ruleId),e},[pe,ge]),ye=a(()=>A(s,X,ve),[s,X,ve]),Ce=l(()=>Y(!0),[]),xe=l(()=>Y(!1),[]);l(()=>de(!1),[]);const Te=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]),ke=l(e=>{const t=P(s,e);t&&(W(!1),G(t))},[s]),$e=l(()=>{G(null),W(!1)},[]),Ee=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]),Ie=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]),Ne=l((e,t)=>{q({ruleId:e,samplingId:t})},[]),Ae=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]),Oe=l(()=>q(null),[]),De=l(async(e,t)=>{await C(e,t),Q(!1)},[C]),Re=l(async e=>{const t=s[0]?.id??"default",o=pe;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,pe,m,f]),Pe=l(async(e,t)=>{const o=s[0]?.id??"default",n=ge;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,ge,b,v]),Fe=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:Wa,ruleId:o}:null},[s,X]),Le=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:Wa,ruleId:n}:null},[s,H]),_e=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]),Be=a(()=>{const e=[];return u&&e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ka,leftIcon:ci,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:Ya,leftIcon:Ii,size:ae.S,variant:ie.Text,onClick:p,loading:d}}),e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Ja,rightIcon:ii,size:ae.S,variant:ie.Primary,onClick:Ce}}),e},[u,p,d,Ce]);return e(da,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Ra,{icon:Ui,title:Za,subTitle:qa}),t(Pa,{actions:Be})]}),e(V,{$gap:12,$fullHeight:!0,children:[t(le,{variant:po.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:ci,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")})]}),X===k.Noisy?t(rl,{title:je,summary:ue,onEdit:()=>Q(!0)}):X===k.HighlyRelevant?t(rl,{title:Xe,summary:he,onEdit:()=>te(!0)}):X===k.CostReduction?t(rl,{title:He,summary:me,onEdit:()=>se(!0)}):null,t(Mh,{title:M[X],items:ye,isLoading:d,showTypeFilter:X===k.HighlyRelevant,onRuleClick:ke,onCreateRule:Ce,onEditRule:Ee,onDeleteRule:Ne})]}),t(Nd,{formType:Nl.View,data:H,defaultEditMode:j,onClose:$e,onDelete:Ne,onSaveEdit:Ie,sourceOptions:S,namespaceOptions:T,validateForm:Le,onNavigateToDuplicate:_e}),t(Nd,{formType:Nl.Create,isOpen:K,category:L[X],onClose:xe,onSubmit:Te,sourceOptions:S,namespaceOptions:T,validateForm:Fe,onNavigateToDuplicate:_e}),t(Nd,{formType:Nl.EditAutoNoisy,isOpen:Z,enabled:c?.enabled??!1,keepPercentage:c?.keepPercentage??0,onClose:()=>Q(!1),onSave:De}),t(Nd,{formType:Nl.EditAutoHighlyRelevant,isOpen:ee,enabled:!!pe&&!pe.rule.disabled,onClose:()=>te(!1),onSave:Re}),t(Nd,{formType:Nl.EditAutoCostReduction,isOpen:re,enabled:!!ge&&!ge.rule.disabled,dropPercentage:ge?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Pe}),t(ze,{title:oi,description:ti,isOpen:!!J,onClose:Oe,denyButton:{label:ei,variant:ie.Secondary,onClick:Oe},approveButton:{label:Qa,variant:ie.Primary,onClick:()=>{Ae(),Oe()}}}),false]})},Vh=m.div`
916
+ `;const gg=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],mg=[{value:"all",label:ja},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],fg=({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(pg,{$disabled:o.disabled,children:[t(ug,{children:t(S,{parts:o.summary})}),o.name&&t(ae,{size:le.XXS,color:ie.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(hg,{children:[o.disabled&&t(Be,{label:Ha,textSize:le.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Be,{label:o.typeBadge,textSize:le.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),w=a(()=>{const e=e=>t(gi,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),T=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:To,leftIcon:mi,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(et,{fullHeight:!0,richTitle:{icon:Wi,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:mg,selected:b,setSelected:v}}:{}},children:t(vo,{variant:yo.Pretty,hideHeader:!0,isLoading:i,noDataProps:g.trim()?{hideIcon:!0,title:Wa,subTitle:Ja(g)}:{hideIcon:!0,title:Ya,button:{label:Ka,onClick:d}},columns:gg,rows:C,getRowActions:T})})},bg=["sources"],vg=({docsUrl:o})=>{const{samplingApi:s,sourcesApi:c}=rl({subscribe:bg}),d=a(()=>c.items.map(e=>({id:e.id})),[c.items]),{data:u,loading:p,refetch:h}=sl("GET_SAMPLING_RULES"),g=u?.computePlatform?.samplingRules??u?.samplingRules??[],m=u?.computePlatform?.k8sHealthProbesConfig??u?.k8sHealthProbesConfig??null,f=l((e,t)=>s.createNoisy?.({samplingId:e,rule:t}),[s]),b=l((e,t,o)=>s.updateNoisy?.(t,{samplingId:e,rule:o}),[s]),v=l((e,t)=>s.createHighlyRelevant?.({samplingId:e,rule:t}),[s]),y=l((e,t,o)=>s.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[s]),C=l((e,t)=>s.createCostReduction?.({samplingId:e,rule:t}),[s]),S=l((e,t,o)=>s.updateCostReduction?.(t,{samplingId:e,rule:o}),[s]),w=l((e,t,o)=>"noisy"===o?s.deleteNoisy?.(t,e):"highlyRelevant"===o?s.deleteHighlyRelevant?.(t,e):"costReduction"===o?s.deleteCostReduction?.(t,e):void 0,[s]),T=l((e,t)=>s.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[s]),x=a(()=>d.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[d]),I=a(()=>Array.from(new Set(d.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[d]),[j,K]=r($.Noisy),[Y,J]=r(null),[q,Z]=r(!1),[Q,ee]=r(!1),[te,oe]=r(null),[ne,ae]=r(!1),[ie,le]=r(!1),[pe,he]=r(!1),[ge,me]=r(!1);i(!1),n(()=>{},[p,g]);const{pendingViewSamplingRule:fe,setPendingViewSamplingRule:be}=eo();n(()=>{if(!fe)return;if(p||0===g.length)return;be(null);const e=A(g,fe.ruleId,fe.category);e&&(K(N[fe.category]),Z(!1),J(e))},[p,g,fe,be]);const ve=a(()=>k(m),[m]),ye=a(()=>O(g),[g]),Ce=a(()=>E(ye?.rule??null),[ye]),Se=a(()=>R(g),[g]),Te=a(()=>D(Se?.rule??null),[Se]),xe=i(Y);xe.current=Y,n(()=>{const e=xe.current;if(!e)return;const t=F(g,e);t?J(t):(J(null),Z(!1))},[g]);const ke=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),$e=a(()=>P(g,j,ke),[g,j,ke]),Ae=l(()=>ee(!0),[]),Ne=l(()=>ee(!1),[]);l(()=>me(!1),[]);const Oe=l(async e=>{const t=g[0]?.id??"default";switch(X[j]){case"noisy":await f(t,z(e));break;case"highlyRelevant":await v(t,L(e));break;case"costReduction":await C(t,_(e))}ee(!1)},[g,j,f,v,C]),Re=l(e=>{const t=M(g,e);t&&(Z(!1),J(t))},[g]),De=l(()=>{J(null),Z(!1)},[]),Fe=l((e,t)=>{const o=Y;if(o&&o.rule.ruleId===e&&o.samplingId===t)Z(!0),J({...o});else for(const o of g){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 Z(!0),void J({category:n.category,rule:n.rule,samplingId:t,summary:B(n.category,n.rule)})}},[Y,g]),Pe=l(async(e,t,o)=>{const n=Y?.category;if(n){switch(n){case"noisy":await b(o,t,z(e));break;case"highlyRelevant":await y(o,t,L(e));break;case"costReduction":await S(o,t,_(e))}Z(!1)}},[Y,b,y,S]),_e=l((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Le=l(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=Y?.category||X[j];await w(t,e,o),J(null),Z(!1),oe(null)},[te,Y,j,w]),ze=l(()=>oe(null),[]),Me=l(async(e,t)=>{await T(e,t),ae(!1)},[T]),Be=l(async e=>{const t=g[0]?.id??"default",o=ye;o?await y(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 v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[g,ye,v,y]),Xe=l(async(e,t)=>{const o=g[0]?.id??"default",n=Se;n?await S(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await C(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),he(!1)},[g,Se,C,S]),Ve=l(e=>{const t=X[j];let o=null;switch(t){case"noisy":{const n=z(e);o=V(g,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=L(e);o=V(g,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=_(e);o=V(g,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:qa,ruleId:o}:null},[g,j]),Ge=l(e=>{const t=Y?.category,o=Y?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const a=z(e);n=V(g,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}case"highlyRelevant":{const a=L(e);n=V(g,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},o);break}case"costReduction":{const a=_(e);n=V(g,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}}return n?{message:qa,ruleId:n}:null},[g,Y]),He=l(e=>{ee(!1);for(const t of g){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 Z(!0),void J({category:o.category,rule:o.rule,samplingId:t.id,summary:B(o.category,o.rule)})}},[g]),We=a(()=>{const e=[];return o&&e.push({id:Uo(),type:qt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Za,leftIcon:hi,size:ce.S,variant:de.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:Uo(),type:qt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Qa,leftIcon:Ri,size:ce.S,variant:de.Text,onClick:h,loading:p}}),e.push({id:Uo(),type:qt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ei,rightIcon:ci,size:ce.S,variant:de.Primary,onClick:Ae}}),e},[o,h,p,Ae]);return e(ga,{children:[e(re,{$gap:12,$justifyContent:"space-between",children:[t(La,{icon:Wi,title:oi,subTitle:ti}),t(za,{actions:We})]}),e(W,{$gap:12,$fullHeight:!0,children:[t(ue,{variant:fo.Underline,size:we.L,options:U,selected:j,setSelected:K}),e(re,{$justifyContent:"space-between",children:[t(Ee,{status:Ie.Default,message:G[j]}),o&&t(se,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:hi,size:ce.S,variant:de.Text,onClick:()=>window.open(o,"_blank")})]}),j===$.Noisy?t(gl,{title:qe,summary:ve,onEdit:()=>ae(!0)}):j===$.HighlyRelevant?t(gl,{title:je,summary:Ce,onEdit:()=>le(!0)}):j===$.CostReduction?t(gl,{title:Ye,summary:Te,onEdit:()=>he(!0)}):null,t(fg,{title:H[j],items:$e,isLoading:p,showTypeFilter:j===$.HighlyRelevant,onRuleClick:Re,onCreateRule:Ae,onEditRule:Fe,onDeleteRule:_e})]}),t(Zd,{formType:Ll.View,data:Y,defaultEditMode:q,onClose:De,onDelete:_e,onSaveEdit:Pe,sourceOptions:x,namespaceOptions:I,validateForm:Ge,onNavigateToDuplicate:He}),t(Zd,{formType:Ll.Create,isOpen:Q,category:X[j],onClose:Ne,onSubmit:Oe,sourceOptions:x,namespaceOptions:I,validateForm:Ve,onNavigateToDuplicate:He}),t(Zd,{formType:Ll.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ae(!1),onSave:Me}),t(Zd,{formType:Ll.EditAutoHighlyRelevant,isOpen:ie,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(Zd,{formType:Ll.EditAutoCostReduction,isOpen:pe,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>he(!1),onSave:Xe}),t(Ue,{title:li,description:ii,isOpen:!!te,onClose:ze,denyButton:{label:ai,variant:de.Secondary,onClick:ze},approveButton:{label:ni,variant:de.Primary,onClick:()=>{Le(),ze()}}}),false]})},yg=m.div`
886
917
  display: flex;
887
918
  align-items: center;
888
919
  justify-content: space-between;
889
920
  padding: 0 12px;
890
- `,Uh=({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:ai,size:ae.S,variant:ie.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ii,size:ae.S,variant:ie.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(Vh,{children:[e(oe,{$gap:12,$alignItems:"center",children:[t(Ra,{icon:Ti,title:"Odigos Settings"}),t(tt,{width:"350px",options:i,values:[l],setValues:e=>s(e[0]),disabled:o})]}),t(Pa,{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)}}})]})},Hh=m(oe)`
921
+ `,Cg=({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:Uo(),type:qt.Button,buttonProps:{label:"Reset",leftIcon:si,size:ce.S,variant:de.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Uo(),type:qt.Button,buttonProps:{label:"Refresh",leftIcon:Ri,size:ce.S,variant:de.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(yg,{children:[e(re,{$gap:12,$alignItems:"center",children:[t(La,{icon:$i,title:"Odigos Settings"}),t(lt,{width:"350px",options:i,values:[l],setValues:e=>s(e[0]),disabled:o})]}),t(za,{actions:h}),t(Ue,{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:de.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:de.Primary,onClick:()=>{c?.(),p(!1)}}})]})},Sg=m(re)`
891
922
  flex: 1;
892
923
  min-height: 0;
893
924
  width: 100%;
894
925
  align-self: stretch;
895
- `,Gh=m(V)`
926
+ `,wg=m(W)`
896
927
  flex: 1;
897
928
  min-height: 0;
898
929
  height: 100%;
899
930
  overflow-y: auto;
900
- `,jh=m(Gh)`
931
+ `,Tg=m(wg)`
901
932
  > section {
902
933
  min-height: 100%;
903
934
  box-sizing: border-box;
904
935
  flex-shrink: 0;
905
936
  }
906
- `,Wh=e=>"general"===e.name?0:"advanced"===e.name?2:1,Kh=({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 T=a(()=>[...i].sort((e,t)=>Wh(e)-Wh(t)),[i]),k=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:Bo(),type:Wt.Button,buttonProps:{"data-id":"settings-save",variant:ie.Primary,size:ae.S,label:"Save Changes",leftIcon:yi,loading:h,onClick:()=>N(!0)}},{id:Bo(),type:Wt.Button,buttonProps:{"data-id":"settings-cancel",variant:ie.Secondary,size:ae.S,label:"Cancel",leftIcon:Ci,onClick:()=>C(void 0,void 0,b)}}],[h,w,b,v,C]),D=a(()=>T.map(e=>({id:e.name,label:e.displayName})),[T]),R=a(()=>T.map(e=>e.name),[T]),{selectedSection:P,setSelectedSection:F,setSectionRef:L,setScrollContainerRef:_}=ni({sectionNames:R});return e(da,{$gap:12,children:[t(Uh,{disabled:!g,loading:l||c,tabs:D,selectedTab:P,setSelectedTab:F,onClickReset:u?()=>u().then(()=>d?.()):void 0,onClickRefresh:d?()=>d():void 0}),e(Ma,{children:[!g&&t(wl,{minSupportedVersion:o,currentVersion:m||""}),t(ua,{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(Hh,{$gap:24,$alignItems:"stretch",children:[t(Gh,{ref:_,$gap:24,$width:"100%",children:i.length?T.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=k[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||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(jh,{children:c&&!s?.manifestYAML?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(yl,{title:"Effective Config YAML",yaml:s?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0})})]})]})]})};export{Qr as AddActionDrawer,$r as AddActionForm,Bd as AddDataStreamModal,cs as AddDestinationDrawer,Nr as AddDestinationForm,ds as AddRuleDrawer,_r as AddRuleForm,As as AddSourceDrawer,Hu as CentralConnections,Br as DataStreamForm,zr as DataStreamMergeWarning,Ds as EditActionDrawer,Rs as EditConfigDrawer,Md as EditDataStreamModal,Fs as EditDestinationDrawer,_s as EditRuleDrawer,fd as EditSourceDrawer,Mr as EditSourceForm,Ud as ONBOARDING_DONE_MODAL_ID,ap as Onboarding,Hd as OnboardingDone,Sh as Overview,Ph as PipelineCollectors,ur as RegexTesterDrawer,zu as SamplingOnboardingModal,Nd as SamplingRuleDrawer,jr as SamplingRuleForm,Xh as SamplingRules,Kh as Settings,zd as SystemDrawer,Rh as TABS};
937
+ `,xg=e=>"general"===e.name?0:"advanced"===e.name?2:1,kg=({minSupportedVersion:o=0})=>{const{isVersionSupported:i,version:l,isEnterprise:s}=y(o),{configApi:c}=rl(),{data:d,loading:u}=sl("GET_CONFIG_YAMLS"),{data:p,loading:h,refetch:g}=sl("GET_EFFECTIVE_CONFIG"),m=d?.configYamls??[],[f,{loading:b}]=cl("UPDATE_LOCAL_UI_CONFIG"),v=async()=>{c.resetLocalUiConfigToDefaults&&await c.resetLocalUiConfigToDefaults()},C=a(()=>{if(!p)return{};const{manifestYAML:e,provenance:t,...o}=p;return o},[p]),{formData:S,handleFormChange:w,getNestedValue:T,getFormDiff:x,isFormDirty:k}=Nt(C);n(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(S)&&w(void 0,void 0,C)},[C,S]);const E=a(()=>[...m].sort((e,t)=>xg(e)-xg(t)),[m]),I=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(p?.provenance),[p?.provenance]),$=a(()=>{const e=new Set;for(const t of m)for(const o of t.fields)o.componentType===Rt.Dropdown&&e.add(o.helmValuePath);return e},[m]),A=a(()=>m.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[m,S,T]),[N,O]=r(!1),R=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(C,S),$);await(async e=>{await f({config:e}),await g()})(e),w(void 0,void 0,{})},D=a(()=>[{id:Uo(),type:qt.Button,buttonProps:{"data-id":"settings-save",variant:de.Primary,size:ce.S,label:"Save Changes",leftIcon:Ti,loading:b,onClick:()=>O(!0)}},{id:Uo(),type:qt.Button,buttonProps:{"data-id":"settings-cancel",variant:de.Secondary,size:ce.S,label:"Cancel",leftIcon:xi,onClick:()=>w(void 0,void 0,C)}}],[b,x,C,S,w]),F=a(()=>E.map(e=>({id:e.name,label:e.displayName})),[E]),P=a(()=>E.map(e=>e.name),[E]),{selectedSection:_,setSelectedSection:L,setSectionRef:z,setScrollContainerRef:M}=ri({sectionNames:P});return e(ga,{$gap:12,children:[t(Cg,{disabled:!i,loading:u||h,tabs:F,selectedTab:_,setSelectedTab:L,onClickReset:v?()=>v().then(()=>g?.()):void 0,onClickRefresh:g?()=>g():void 0}),e(Ga,{children:[!i&&t(Al,{minSupportedVersion:o,currentVersion:l||""}),t(ma,{isOpen:k,richTitle:{icon:$i,title:"Config Settings"},actions:D}),t(Ue,{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:()=>O(!1),denyButton:{label:"Keep editing",variant:de.Secondary,onClick:()=>O(!1)},approveButton:{label:"Save changes",variant:de.Primary,onClick:()=>{R(),O(!1)}}}),e(Sg,{$gap:24,$alignItems:"stretch",children:[t(wg,{ref:M,$gap:24,$width:"100%",children:m.length?E.map(o=>t(et,{id:o.name,ref:e=>z(o.name,e),richTitle:{icon:$i,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!s)return null;if(o.renderCondition&&!ke(o.renderCondition,[],A))return null;const n=ht(o.componentProps||"{}",{}),a=I[o.helmValuePath];return e(W,{$gap:4,children:[t(ul,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?Ie.Warning:ft.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||b,value:T("formData",o.helmValuePath),setValue:e=>w(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(Ee,{status:Ie.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):u?t(at,{$height:"30vh",children:t(ct,{withSpinner:!0})}):t(et,{richTitle:{icon:$i,title:"Config Settings"},children:t(Ce,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(Tg,{children:h&&!p?.manifestYAML?t(at,{$height:"30vh",children:t(ct,{withSpinner:!0})}):t(El,{title:"Effective Config YAML",yaml:p?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0})})]})]})]})};export{rs as AddActionDrawer,Fr as AddActionForm,cu as AddDataStreamModal,vs as AddDestinationDrawer,Lr as AddDestinationForm,ys as AddRuleDrawer,Hr as AddRuleForm,Ms as AddSourceDrawer,gp as CentralConnections,Wr as DataStreamForm,jr as DataStreamMergeWarning,Vs as EditActionDrawer,Us as EditConfigDrawer,du as EditDataStreamModal,js as EditDestinationDrawer,Ys as EditRuleDrawer,Md as EditSourceDrawer,Kr as EditSourceForm,hu as ONBOARDING_DONE_MODAL_ID,$p as Onboarding,gu as OnboardingDone,qh as Overview,dg as PipelineCollectors,yr as RegexTesterDrawer,sp as SamplingOnboardingModal,Zd as SamplingRuleDrawer,es as SamplingRuleForm,vg as SamplingRules,kg as Settings,su as SystemDrawer,cg as TABS};