@odigos/ui-kit 0.0.264 → 0.0.266

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 (72) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/lib/chunks/index-DUhfkGj1.js +155 -0
  3. package/lib/chunks/{odigos-context-_YAZF63s.js → odigos-context-DzuZq_D5.js} +2 -2
  4. package/lib/chunks/source-instrument-form-context-DnvGijkN.js +5 -0
  5. package/lib/chunks/ui-components-Dq_j4_BI.js +1591 -0
  6. package/lib/components/condition/index.d.ts +10 -1
  7. package/lib/components/index.d.ts +1 -0
  8. package/lib/components/radio-card/index.d.ts +16 -0
  9. package/lib/components/skeleton-loader/index.d.ts +2 -1
  10. package/lib/components.js +1 -1
  11. package/lib/constants/strings/index.d.ts +78 -1
  12. package/lib/constants.js +1 -1
  13. package/lib/containers/_drawers/add-source-drawer/strings.d.ts +8 -6
  14. package/lib/containers/_drawers/create-cloud-connector-drawer/index.d.ts +15 -0
  15. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/custom-resource-table.d.ts +9 -0
  16. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/helpers.d.ts +5 -0
  17. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/index.d.ts +2 -0
  18. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/permission-list.d.ts +12 -0
  19. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/permissions.d.ts +25 -0
  20. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/policy-preview.d.ts +5 -0
  21. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/select-provider/provider-list.d.ts +8 -0
  22. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/create-role-section.d.ts +6 -0
  23. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/enter-arn-section.d.ts +5 -0
  24. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/index.d.ts +5 -0
  25. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/methods.d.ts +30 -0
  26. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/setup-credentials/section.d.ts +9 -0
  27. package/lib/containers/_drawers/create-cloud-connector-drawer/steps/validate-connection/index.d.ts +8 -0
  28. package/lib/containers/_drawers/edit-source-drawer/helpers.d.ts +9 -5
  29. package/lib/containers/_drawers/edit-source-drawer/libraries/index.d.ts +6 -0
  30. package/lib/containers/_drawers/edit-source-drawer/overview/runtime-card.d.ts +14 -0
  31. package/lib/containers/_drawers/edit-source-drawer/overview/vm-processes.d.ts +10 -0
  32. package/lib/containers/_drawers/edit-source-drawer/pods/containers-card/process-card.d.ts +7 -1
  33. package/lib/containers/_drawers/edit-source-drawer/profiling/flamebearer.d.ts +18 -0
  34. package/lib/containers/_drawers/edit-source-drawer/tabs.d.ts +1 -0
  35. package/lib/containers/_drawers/index.d.ts +1 -0
  36. package/lib/containers/central-connections/helpers.d.ts +11 -1
  37. package/lib/containers/central-connections/index.d.ts +6 -1
  38. package/lib/containers.js +610 -170
  39. package/lib/contexts/cloud-connector-form-context.d.ts +35 -0
  40. package/lib/contexts/index.d.ts +1 -0
  41. package/lib/contexts/odigos-api/capabilities.d.ts +5 -1
  42. package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +1 -0
  43. package/lib/contexts/odigos-api/types.d.ts +1 -0
  44. package/lib/contexts/odigos-context.d.ts +2 -0
  45. package/lib/contexts.js +1 -1
  46. package/lib/functions/get-source-kind-label/index.d.ts +8 -0
  47. package/lib/functions/index.d.ts +1 -0
  48. package/lib/functions.js +1 -1
  49. package/lib/hooks.js +1 -1
  50. package/lib/icons/compute-platform/cloud-connector-icon/index.d.ts +2 -0
  51. package/lib/icons/compute-platform/cloud-connector-policy-icon/index.d.ts +2 -0
  52. package/lib/icons/compute-platform/index.d.ts +2 -0
  53. package/lib/icons.js +1 -1
  54. package/lib/snippets/connector-created-modal/index.d.ts +7 -0
  55. package/lib/snippets/index.d.ts +1 -0
  56. package/lib/snippets.js +1 -1
  57. package/lib/store.js +1 -1
  58. package/lib/theme/palettes/index.d.ts +1 -0
  59. package/lib/theme.js +1 -1
  60. package/lib/types/actions/index.d.ts +1 -4
  61. package/lib/types/cloud-connectors/index.d.ts +88 -0
  62. package/lib/types/common/index.d.ts +2 -1
  63. package/lib/types/index.d.ts +1 -0
  64. package/lib/types/snapshot/index.d.ts +1 -0
  65. package/lib/types/sources/index.d.ts +1 -0
  66. package/lib/types/workload/index.d.ts +68 -0
  67. package/lib/types.js +1 -1
  68. package/lib/visuals.js +1 -1
  69. package/package.json +1 -1
  70. package/lib/chunks/index-B-zICLj7.js +0 -155
  71. package/lib/chunks/source-instrument-form-context-CZQIaTUV.js +0 -5
  72. package/lib/chunks/ui-components-CAPnizLR.js +0 -1543
package/lib/containers.js CHANGED
@@ -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 i,useRef as a,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 m,memo as g}from"react";import f,{useTheme as b,css as v,keyframes as y}from"styled-components";import{u as C,n as S,C as w,f as x,e as k,d as T,q as $,g as I,h as E,j as N,p as A,l as O,c as R,r as D,S as P,s as F,R as L,t as M,w as _,o as z,x as B,y as X,z as V,A as U,B as G,D as H,E as j,F as W,G as K,H as Y,I as q,J}from"./chunks/odigos-context-_YAZF63s.js";import{bh as Z,u as Q,v as ee,C as te,aQ as oe,I as ne,br as ie,c as ae,d as le,h as re,aV as se,bs as ce,K as de,N as ue,O as pe,w as he,k as me,l as ge,B as fe,S as be,bt as ve,bu as ye,_ as Ce,bv as Se,bw as we,i as xe,bx as ke,F as Te,by as $e,s as Ie,T as Ee,bz as Ne,bi as Ae,aU as Oe,bA as Re,bB as De,g as Pe,aw as Fe,ay as Le,bC as Me,bn as _e,bo as ze,bm as Be,bD as Xe,q as Ve,H as Ue,p as Ge,G as He,J as je,o as We,n as Ke,bE as Ye,bF as qe,aG as Je,W as Ze,b1 as Qe,b5 as et,bG as tt,bH as ot,bI as nt,bJ as it,bK as at,bL as lt,bM as rt,bN as st,x as ct,bO as dt,bP as ut,bQ as pt,bR as ht,bS as mt,aT as gt,bl as ft,D as bt,bT as vt,bU as yt,aW as Ct,bV as St,bW as wt,aO as xt,bp as kt,b4 as Tt,b as $t,e as It,bX as Et,b6 as Nt,bY as At,bZ as Ot,b8 as Rt,bb as Dt,bg as Pt,b_ as Ft,av as Lt,b$ as Mt,c0 as _t,bf as zt,c1 as Bt,c2 as Xt,c3 as Vt,r as Ut,a$ as Gt,b0 as Ht,aA as jt,c4 as Wt,c5 as Kt,c6 as Yt,c7 as qt,c8 as Jt,c9 as Zt,ca as Qt,cb as eo,cc as to,cd as oo,ce as no,A as io,aX as ao,aS as lo,cf as ro,cg as so,ch as co,ci as uo,cj as po,ck as ho,bq as mo,cl as go,aY as fo,cm as bo,cn as vo,co as yo,cp as Co,cq as So,cr as wo,cs as xo,aF as ko,ct as To,cu as $o,cv as Io,cw as Eo,cx as No,cy as Ao,cz as Oo,cA as Ro,cB as Do,cC as Po,cD as Fo,cE as Lo,al as Mo,cF as _o,cG as zo,cH as Bo,cI as Xo,cJ as Vo,cK as Uo,cL as Go,cM as Ho,cN as jo,cO as Wo,cP as Ko,cQ as Yo,cR as qo,cS as Jo,cT as Zo,a4 as Qo,cU as en,cV as tn,aZ as on,cW as nn,cX as an,cY as ln,cZ as rn,c_ as sn,c$ as cn,d0 as dn,d1 as un,d2 as pn,d3 as hn,d4 as mn,d5 as gn,d6 as fn,d7 as bn,d8 as vn,d9 as yn,da as Cn,db as Sn,dc as wn,dd as xn,de as kn,df as Tn,dg as $n,dh as In,di as En,dj as Nn,dk as An,dl as On,dm as Rn,dn as Dn,dp as Pn,dq as Fn,dr as Ln,ds as Mn,dt as _n,du as zn,dv as Bn,dw as Xn,dx as Vn,dy as Un,dz as Gn,dA as Hn,dB as jn,dC as Wn,dD as Kn,dE as Yn,dF as qn,dG as Jn,dH as Zn,dI as Qn,dJ as ei,dK as ti,dL as oi,dM as ni,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as ui,dV as pi,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as wi,e4 as xi,e5 as ki,e6 as Ti,e7 as $i,P as Ii,e8 as Ei,e9 as Ni,ea as Ai,eb as Oi,ec as Ri,aP as Di,ed as Pi,aK as Fi,ee as Li,ef as Mi,eg as _i,eh as zi,ei as Bi,ej as Xi,ek as Vi,el as Ui,em as Gi,en as Hi,eo as ji,ep as Wi,b7 as Ki,eq as Yi,R as qi,a as Ji,er as Zi,es as Qi,et as ea,eu as ta,ev as oa,ew as na,ex as ia,ey as aa,ez as la,eA as ra,eB as sa,eC as ca,eD as da,eE as ua,eF as pa,eG as ha,eH as ma,eI as ga,eJ as fa,eK as ba,eL as va,eM as ya}from"./chunks/ui-components-CAPnizLR.js";import{TrashIcon as Ca,PlusIcon as Sa,ArrowRightIcon as wa,VSquareIcon as xa,XSquareIcon as ka,BookIcon as Ta,DeleteIcon as $a,EditIcon as Ia,GoLogo as Ea,JavaLogo as Na,ChevronRightIcon as Aa,ActionIcon as Oa,DestinationIcon as Ra,ChevronUpIcon as Da,ChevronDownIcon as Pa,VIcon as Fa,XIcon as La,InstrumentationRuleIcon as Ma,SourceIcon as _a,NamespacesIcon as za,SettingsIcon as Ba,PodIcon as Xa,OdigosLogo as Va,K8sLogo as Ua,RefreshIcon as Ga,ExclamationCircleIcon as Ha,QuestionCircleIcon as ja,InboundIcon as Wa,OutboundIcon as Ka,UserIcon as Ya,TerminalIcon as qa,MinusIcon as Ja,SearchIcon as Za,ExpandIcon as Qa,CopyIcon as el,DotIcon as tl,ArrowDownIcon as ol,DownloadIcon as nl,RefreshLeftArrowIcon as il,VmLogo as al,SamplingIcon as ll,ExclamationTriangleIcon as rl,KeyIcon as sl,DiagnoseIcon as cl,StarIcon as dl,ArrowIcon as ul,ConnectionsIcon as pl,FilterIcon as hl,DataStreamIcon as ml,PipelineCollectorIcon as gl,ArrowDownSquareIcon as fl,ArrowUpSquareIcon as bl,GatewayIcon as vl,YamlIcon as yl,ImageErrorIcon as Cl,ArrowLeftIcon as Sl,LockIcon as wl}from"./icons.js";import{h as xl,n as kl,m as Tl,o as $l,l as Il,s as El,q as Nl,S as Al,v as Ol,E as Rl,w as Dl,x as Pl,t as Fl,d as Ll,O as Ml,f as _l,b as zl,A as Bl,R as Xl,e as Vl,D as Ul}from"./chunks/source-instrument-form-context-CZQIaTUV.js";import{c as Gl,h as Hl,I as jl,i as Wl,A as Kl,f as Yl,P as ql,S as Jl,R as Zl,d as Ql,g as er,b as tr,e as or,j as nr,a as ir,C as ar,Y as lr,O as rr,W as sr,U as cr}from"./chunks/index-B-zICLj7.js";import{createPortal as dr}from"react-dom";import{MarkerType as ur,useNodesState as pr,useEdgesState as hr,Handle as mr,Position as gr,getSmoothStepPath as fr,BaseEdge as br,EdgeLabelRenderer as vr,ReactFlowProvider as yr,ReactFlow as Cr,Background as Sr,Controls as wr,ControlButton as xr,useReactFlow as kr}from"@xyflow/react";import Tr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const $r=[{id:"CREDIT_CARD",label:"Credit card"}],Ir=[{id:Z.CollectContainerAttributes,label:"Collect container attributes"},{id:Z.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:Z.CollectWorkloadId,label:"Collect workload ID"},{id:Z.CollectClusterId,label:"Collect cluster ID"}],Er=[{id:ie.Pod,label:ie.Pod},{id:ie.Namespace,label:ie.Namespace},{id:ie.Node,label:ie.Node}],Nr=[{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:Er}],Ar=[{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:Er}],Or=/^[a-zA-Z]$/,Rr=new Set(["*","+","?"]),Dr=new Set(["^","$"]),Pr={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"},Fr=f.div`
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import n,{useEffect as i,useMemo as a,useRef as l,useCallback as r,useState as s,Fragment as c,forwardRef as d,useImperativeHandle as p,Children as u,createContext as h,useContext as m,useLayoutEffect as g,memo as f}from"react";import b,{useTheme as v,css as y,keyframes as C}from"styled-components";import{u as S,n as x,C as w,f as T,e as k,d as E,q as I,g as N,h as $,j as O,p as A,l as R,c as D,r as _,S as P,s as L,R as F,t as M,w as z,o as B,x as X,y as U,z as V,A as H,B as j,D as G,E as W,F as K,G as Y,H as q,I as J,J as Z}from"./chunks/odigos-context-DzuZq_D5.js";import{bi as Q,w as ee,x as te,C as oe,aT as ne,I as ie,bs as ae,d as le,e as re,j as se,aX as ce,bt as de,N as pe,Q as ue,U as he,y as me,m as ge,n as fe,B as be,S as ve,bu as ye,bv as Ce,a1 as Se,bw as xe,bx as we,k as Te,by as ke,F as Ee,bz as Ie,s as Ne,T as $e,bA as Oe,bj as Ae,aW as Re,bB as De,bC as _e,i as Pe,az as Le,aB as Fe,bD as Me,bo as ze,bp as Be,bn as Xe,bE as Ue,u as Ve,H as He,r as je,G as Ge,J as We,q as Ke,p as Ye,bF as qe,bG as Je,aJ as Ze,W as Qe,D as et,b6 as tt,bH as ot,bI as nt,bJ as it,bK as at,bL as lt,bM as rt,bN as st,bO as ct,z as dt,bP as pt,bQ as ut,bR as ht,bS as mt,bT as gt,aV as ft,bm as bt,h as vt,bU as yt,bV as Ct,aY as St,bW as xt,bX as wt,aR as Tt,bq as kt,b5 as Et,b as It,f as Nt,bY as $t,b7 as Ot,bZ as At,b_ as Rt,b9 as Dt,b$ as _t,a_ as Pt,c0 as Lt,c as Ft,l as Mt,bc as zt,bh as Bt,ay as Xt,c1 as Ut,c2 as Vt,bg as Ht,c3 as jt,c4 as Gt,c5 as Wt,v as Kt,b1 as Yt,b2 as qt,aD as Jt,c6 as Zt,c7 as Qt,c8 as eo,c9 as to,ca as oo,cb as no,cc as io,cd as ao,ce as lo,cf as ro,cg as so,A as co,aZ as po,aU as uo,ch as ho,ci as mo,cj as go,ck as fo,cl as bo,cm as vo,br as yo,cn as Co,co as So,cp as xo,cq as wo,cr as To,cs as ko,ct as Eo,cu as Io,cv as No,aI as $o,cw as Oo,cx as Ao,cy as Ro,cz as Do,cA as _o,cB as Po,cC as Lo,cD as Fo,cE as Mo,cF as zo,cG as Bo,cH as Xo,cI as Uo,ao as Vo,cJ as Ho,cK as jo,cL as Go,cM as Wo,cN as Ko,cO as Yo,cP as qo,cQ as Jo,cR as Zo,cS as Qo,cT as en,cU as tn,cV as on,cW as nn,cX as an,a7 as ln,cY as rn,cZ as sn,a$ as cn,c_ as dn,c$ as pn,d0 as un,d1 as hn,d2 as mn,d3 as gn,d4 as fn,d5 as bn,d6 as vn,d7 as yn,d8 as Cn,d9 as Sn,da as xn,db as wn,dc as Tn,dd as kn,de as En,df as In,dg as Nn,dh as $n,di as On,dj as An,dk as Rn,dl as Dn,dm as _n,dn as Pn,dp as Ln,dq as Fn,dr as Mn,ds as zn,dt as Bn,du as Xn,dv as Un,dw as Vn,dx as Hn,dy as jn,dz as Gn,dA as Wn,dB as Kn,dC as Yn,dD as qn,dE as Jn,dF as Zn,dG as Qn,dH as ei,dI as ti,dJ as oi,dK as ni,dL as ii,dM as ai,dN as li,dO as ri,dP as si,dQ as ci,dR as di,dS as pi,dT as ui,dU as hi,dV as mi,dW as gi,dX as fi,dY as bi,dZ as vi,d_ as yi,d$ as Ci,e0 as Si,e1 as xi,e2 as wi,e3 as Ti,e4 as ki,e5 as Ei,e6 as Ii,e7 as Ni,e8 as $i,e9 as Oi,ea as Ai,eb as Ri,P as Di,ec as _i,ed as Pi,ee as Li,ef as Fi,eg as Mi,eh as zi,aS as Bi,ei as Xi,aN as Ui,ej as Vi,ek as Hi,el as ji,em as Gi,en as Wi,eo as Ki,ep as Yi,eq as qi,er as Ji,es as Zi,et as Qi,eu as ea,b8 as ta,ev as oa,R as na,a as ia,ew as aa,ex as la,ey as ra,ez as sa,eA as ca,eB as da,eC as pa,eD as ua,eE as ha,eF as ma,eG as ga,eH as fa,eI as ba,eJ as va,eK as ya,eL as Ca,eM as Sa,eN as xa,eO as wa,eP as Ta,eQ as ka,eR as Ea}from"./chunks/ui-components-Dq_j4_BI.js";import{TrashIcon as Ia,PlusIcon as Na,ArrowRightIcon as $a,VSquareIcon as Oa,XSquareIcon as Aa,BookIcon as Ra,DeleteIcon as Da,EditIcon as _a,GoLogo as Pa,JavaLogo as La,ChevronRightIcon as Fa,ActionIcon as Ma,DestinationIcon as za,ChevronUpIcon as Ba,ChevronDownIcon as Xa,VIcon as Ua,XIcon as Va,InstrumentationRuleIcon as Ha,SourceIcon as ja,NamespacesIcon as Ga,AwsLogo as Wa,CloudConnectorIcon as Ka,EyeOpenIcon as Ya,CloudConnectorPolicyIcon as qa,ArrowLeftIcon as Ja,ISquareIcon as Za,RefreshIcon as Qa,SettingsIcon as el,PodIcon as tl,OdigosLogo as ol,K8sLogo as nl,ExclamationCircleIcon as il,QuestionCircleIcon as al,InboundIcon as ll,OutboundIcon as rl,UserIcon as sl,TerminalIcon as cl,RefreshLeftArrowIcon as dl,MinusIcon as pl,SearchIcon as ul,ExpandIcon as hl,CopyIcon as ml,DotIcon as gl,ArrowDownIcon as fl,DownloadIcon as bl,VmLogo as vl,SamplingIcon as yl,ExclamationTriangleIcon as Cl,KeyIcon as Sl,DiagnoseIcon as xl,StarIcon as wl,ArrowIcon as Tl,ConnectionsIcon as kl,FilterIcon as El,DataStreamIcon as Il,PipelineCollectorIcon as Nl,ArrowDownSquareIcon as $l,ArrowUpSquareIcon as Ol,GatewayIcon as Al,YamlIcon as Rl,ImageErrorIcon as Dl,LockIcon as _l}from"./icons.js";import{h as Pl,o as Ll,n as Fl,q as Ml,m as zl,t as Bl,s as Xl,S as Ul,w as Vl,E as Hl,x as jl,y as Gl,v as Wl,l as Kl,d as Yl,O as ql,f as Jl,b as Zl,A as Ql,R as er,C as tr,e as or,D as nr}from"./chunks/source-instrument-form-context-DnvGijkN.js";import{d as ir,i as ar,I as lr,j as rr,A as sr,g as cr,P as dr,S as pr,R as ur,e as hr,h as mr,c as gr,f as fr,k as br,W as vr,C as yr,b as Cr,Y as Sr,O as xr,a as wr,U as Tr}from"./chunks/index-DUhfkGj1.js";import{createPortal as kr}from"react-dom";import{MarkerType as Er,useNodesState as Ir,useEdgesState as Nr,Handle as $r,Position as Or,getSmoothStepPath as Ar,BaseEdge as Rr,EdgeLabelRenderer as Dr,ReactFlowProvider as _r,ReactFlow as Pr,Background as Lr,Controls as Fr,ControlButton as Mr,useReactFlow as zr}from"@xyflow/react";import Br from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const Xr=[{id:"CREDIT_CARD",label:"Credit card"}],Ur=[{id:Q.CollectContainerAttributes,label:"Collect container attributes"},{id:Q.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:Q.CollectWorkloadId,label:"Collect workload ID"},{id:Q.CollectClusterId,label:"Collect cluster ID"}],Vr=[{id:ae.Pod,label:ae.Pod},{id:ae.Namespace,label:ae.Namespace},{id:ae.Node,label:ae.Node}],Hr=[{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:Vr}],jr=[{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:Vr}],Gr=/^[a-zA-Z]$/,Wr=new Set(["*","+","?"]),Kr=new Set(["^","$"]),Yr={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"},qr=b.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
- `,Lr=f.span`
22
- background: ${({$kind:e})=>Pr[e]};
23
- `,Mr=({pattern:e,"data-id":o})=>{const n=i(()=>(e=>{const t=[];let o=0,n=!1;const i=(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){i("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){i(e.slice(o,o+2),"class-content"),o+=2;continue}i(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)}}i(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Rr.has(t)||Dr.has(t))i(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){i(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)?i(e.slice(o,o+2),"anchor-quantifier"):i(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(i(t,"literal"),o++):(i("|","alternation"),o++)}else"^"===e[o+1]?(i("[^","class-bracket"),o+=2):(i("[","class-bracket"),o++),n=!0;else i(t,"group"),o++}}return t})(e),[e]);return t(Fr,e?{"data-id":o,children:n.map((e,o)=>t(Lr,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},_r="rgba(102, 191, 255, 0.5)",zr=v`
21
+ `,Jr=b.span`
22
+ background: ${({$kind:e})=>Yr[e]};
23
+ `,Zr=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const i=(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){i("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){i(e.slice(o,o+2),"class-content"),o+=2;continue}i(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)}}i(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Wr.has(t)||Kr.has(t))i(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){i(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];Gr.test(t)?i(e.slice(o,o+2),"anchor-quantifier"):i(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(i(t,"literal"),o++):(i("|","alternation"),o++)}else"^"===e[o+1]?(i("[^","class-bracket"),o+=2):(i("[","class-bracket"),o++),n=!0;else i(t,"group"),o++}}return t})(e),[e]);return t(qr,e?{"data-id":o,children:n.map((e,o)=>t(Jr,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},Qr="rgba(102, 191, 255, 0.5)",es=y`
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
- `,Br=f.div`
36
+ `,ts=b.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
- `,Xr=f.div`
49
- ${zr}
48
+ `,os=b.div`
49
+ ${es}
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
- `,Vr=f.textarea`
63
- ${zr}
62
+ `,ns=b.textarea`
63
+ ${es}
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
- `,Ur=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),Gr=({regex:o,value:n,onChange:r,minHeight:s=240,...c})=>{const d=a(null),u=a(null),p=i(()=>((e,t)=>{if(!e||!t)return Ur(t);let o;try{o=new RegExp(e)}catch{return Ur(t)}const n=o.exec(t);if(!n)return Ur(t);const i=n.index,a=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,i),matchPre:"",capture:t.slice(i,a),matchPost:"",after:t.slice(a)};const l=n[0].indexOf(n[1]),r=l>=0?i+l:i,s=r+n[1].length;return{before:t.slice(0,i),matchPre:t.slice(i,r),capture:t.slice(r,s),matchPost:t.slice(s,a),after:t.slice(a)}})(o,n),[o,n]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(Br,{$minHeight:s,children:[e(Xr,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:_r},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:_r},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(Vr,{ref:u,$minHeight:s,value:n,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},Hr=f.div`
81
+ `,is=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),as=({regex:o,value:n,onChange:i,minHeight:s=240,...c})=>{const d=l(null),p=l(null),u=a(()=>((e,t)=>{if(!e||!t)return is(t);let o;try{o=new RegExp(e)}catch{return is(t)}const n=o.exec(t);if(!n)return is(t);const i=n.index,a=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,i),matchPre:"",capture:t.slice(i,a),matchPost:"",after:t.slice(a)};const l=n[0].indexOf(n[1]),r=l>=0?i+l:i,s=r+n[1].length;return{before:t.slice(0,i),matchPre:t.slice(i,r),capture:t.slice(r,s),matchPost:t.slice(s,a),after:t.slice(a)}})(o,n),[o,n]),h=r(()=>{d.current&&p.current&&(d.current.scrollTop=p.current.scrollTop,d.current.scrollLeft=p.current.scrollLeft)},[]);return e(ts,{$minHeight:s,children:[e(os,{ref:d,"aria-hidden":!0,children:[u.before,t("span",{style:{background:Qr},children:u.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:u.capture}),t("span",{style:{background:Qr},children:u.matchPost}),u.after,n.endsWith("\n")?" ":""]}),t(ns,{ref:p,$minHeight:s,value:n,onChange:e=>i(e.target.value),onScroll:h,spellCheck:!1,...c})]})},ls=b.div`
82
82
  flex: 1;
83
83
  min-height: 0;
84
84
  overflow-y: auto;
85
- `,jr=f.div`
85
+ `,rs=b.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
- `,Wr=f.div`
92
+ `,ss=b.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
- `,Kr=({isOpen:o,regex:n,onClose:a,initialTestString:l=""})=>{const[s,c]=r(l),d=i(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:ce.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:ce.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:ce.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:ce.RESULT_NO_MATCH}})(n,s),[n,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(se,{isOpen:o,header:{title:ce.TITLE,onClose:()=>{c(""),a()}},children:t(Hr,{children:e(jr,{children:[e(Q,{$gap:6,children:[t(ee,{label:ce.REGEX_LABEL}),t(Mr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(de,{size:pe.XXS,color:ue.Secondary,children:ce.REGEX_EMPTY_HINT})]}),e(Q,{$gap:6,children:[e(he,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(ee,{label:ce.TEST_STRING_LABEL}),t(me,{"data-id":"regex-tester-unescape",label:ce.UNESCAPE_LABEL,tooltip:ce.UNESCAPE_TOOLTIP,variant:fe.Secondary,size:ge.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],i="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=i){t+=i,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=s,!/\\["'\\nrt]/.test(p))})]}),t(Gr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:ce.TEST_STRING_PLACEHOLDER,regex:n,value:s,onChange:c,minHeight:240}),t(oe,{helpMessage:ce.TEST_STRING_HELP})]}),e(Q,{$gap:8,children:[t(ee,{label:ce.RESULT_LABEL}),t(Wr,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(de,{size:pe.XXS,color:ue.Secondary,children:ce.RESULT_CAPTURE_HINT})]})]})})});var p},Yr=Z.ExtractAttribute;var qr;(e=>{e.Preset="preset",e.Regex="regex"})(qr||(qr={}));const Jr=[ye.JSON,ye.SQL,ye.ResourcePath],Zr=(e=ye.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),Qr=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,es=f.div`
103
+ `,cs=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[r,c]=s(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:de.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:de.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:de.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:de.RESULT_NO_MATCH}})(n,r),[n,r]),p=d.ok?d.isMatch?"match":"neutral":"error";return t(ce,{isOpen:o,header:{title:de.TITLE,onClose:()=>{c(""),i()}},children:t(ls,{children:e(rs,{children:[e(ee,{$gap:6,children:[t(te,{label:de.REGEX_LABEL}),t(Zr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(pe,{size:he.XXS,color:ue.Secondary,children:de.REGEX_EMPTY_HINT})]}),e(ee,{$gap:6,children:[e(me,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:de.TEST_STRING_LABEL}),t(ge,{"data-id":"regex-tester-unescape",label:de.UNESCAPE_LABEL,tooltip:de.UNESCAPE_TOOLTIP,variant:be.Secondary,size:fe.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],i="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=i){t+=i,o++;continue}}t+=e[o]}return t})(e)),disabled:(u=r,!/\\["'\\nrt]/.test(u))})]}),t(as,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:de.TEST_STRING_PLACEHOLDER,regex:n,value:r,onChange:c,minHeight:240}),t(ne,{helpMessage:de.TEST_STRING_HELP})]}),e(ee,{$gap:8,children:[t(te,{label:de.RESULT_LABEL}),t(ss,{$tone:p,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(pe,{size:he.XXS,color:ue.Secondary,children:de.RESULT_CAPTURE_HINT})]})]})})});var u},ds=Q.ExtractAttribute;var ps;(e=>{e.Preset="preset",e.Regex="regex"})(ps||(ps={}));const us=[Ce.JSON,Ce.SQL,Ce.ResourcePath],hs=(e=Ce.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),ms=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,gs=b.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
- `,ts=f.div`
111
+ `,fs=b.div`
112
112
  flex: 1;
113
113
  min-width: 0;
114
- `,os=f.div`
114
+ `,bs=b.div`
115
115
  /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
116
116
  padding-top: 24px;
117
- `,ns=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),is=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},as=Z.UrlTemplatizationRulesGroups,ls=[{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"}],rs=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},ss=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,o,n]=e;return e=>{const i=null==e?.[t]?"":String(e[t]);switch(o){case"=":case"==":case"===":return i===n;case"!=":case"!==":return i!==n;default:return!0}}},cs=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:rs(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:ss(t.renderCondition)}})},ds=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(us):void 0}})},us=e=>{const t="string"==typeof e.componentProperties?Ie(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:rs(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:cs(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:ds(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(us):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},ps=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),hs=e=>Array.isArray(e)?e:[],ms=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},gs=e=>ps(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],fs=({field:e,value:o,setValue:i,errorMessage:a,disabled:l})=>{const[s,c]=r(()=>gs(o));return n(()=>{const e=ps(o)?o:{};((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])})(ms(s),e)||c(gs(o))},[o]),t(ne,{name:e.name,label:e.title,tooltip:e.tooltip,helpMessage:e.helpMessage,required:e.required,disabled:l,limitFieldsPerRow:2,columns:[{keyName:"key",label:e.keyLabel||"Key",placeholder:e.keyLabel||"Key"},{keyName:"value",label:e.valueLabel||"Value",placeholder:e.valueLabel||"Value"}],values:s,setValues:e=>{c(e),i(ms(e))},errorMessage:a})},bs=({field:n,value:i,setValue:a,errorMessage:l,disabled:s})=>{const{name:c,componentType:d,inputType:u,title:p,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:v,itemWrapperKey:y,columns:C,limitFieldsPerRow:S,variant:w,wrapKey:x,checkboxOptions:k}=n,[T,$]=r({open:!1,value:""});if(d===Te.CheckboxList&&"array"===n.valueMode){const o=hs(i),n=(e,t)=>a(t?[...o.filter(t=>t!==e),e]:o.filter(t=>t!==e));return e(Q,{$gap:12,children:[p&&t(ee,{label:p,tooltip:h,required:f}),t(Q,{$gap:8,children:(k||[]).map(e=>{const i=t(te,{name:e.id,label:e.label,value:o.includes(e.id),disabled:s,onChange:t=>n(e.id,t)},e.id);return e.tooltip?t(Ee,{text:e.tooltip,withIcon:!0,children:i},e.id):i})}),t(oe,{errorMessage:l,helpMessage:g})]})}if(d===Te.CheckboxList){const o=ps(i)?i:{},r=(e=>"emptyObject"!==e.checkedValue||{})(n),d=e=>"emptyObject"===n.checkedValue?ps(e):!!e;return e(Q,{$gap:12,children:[p&&t(de,{size:pe.XS,color:ue.Secondary,nowrap:!0,children:p}),t(Q,{$gap:12,children:(k||[]).map(n=>{const i=o[n.id],l=d(i),u=ps(i)?i:{},p=t(te,{label:n.label,value:l,disabled:s,onChange:e=>a({...o,[n.id]:e?ps(i)?i:r:null})}),h=n.tooltip?t(Ee,{text:n.tooltip,withIcon:!0,children:p}):p,m=l&&n.fields?.length?t(Q,{$gap:12,$padding:"0 0 0 24px",children:n.fields.map(e=>t(bs,{field:e,value:u[e.name],setValue:t=>a({...o,[n.id]:{...u,[e.name]:t}}),disabled:s},`${c}-${n.id}-${e.name}`))}):null;return e(Q,{$gap:12,children:[h,m]},n.id)})}),t(oe,{errorMessage:l,helpMessage:g})]})}if(d===Te.MultiTabledInput){const n=hs(x?i?.[x]:i),r=e=>a(x?{...ps(i)?i:{},[x]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(o,{children:[t("cards"===w?Ne:ne,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,columns:C||[],limitFieldsPerRow:S,values:n,setValues:r,errorMessage:l,onTestRegex:d?e=>$({open:!0,value:e}):void 0}),d&&t(Kr,{isOpen:T.open,regex:T.value,onClose:()=>$({open:!1,value:""})})]})}if(d===Te.MultiInput&&x){const e=hs(i?.[x]);return t(re,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,placeholder:m,values:e,setValues:e=>a({...ps(i)?i:{},[x]:e}),errorMessage:l})}if(d===Te.MultiInput&&y){const e=hs(i).map(e=>String(e?.[y]??""));return t(re,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,placeholder:m,values:e,setValues:e=>a(e.map(e=>({[y]:e}))),errorMessage:l})}return d===Te.KeyValuePair?t(fs,{field:n,value:i,setValue:a,errorMessage:l,disabled:s}):t(Gl,{componentType:d,inputType:u,name:c,label:p,tooltip:h,helpMessage:g,disabled:s,required:f,placeholder:m,errorMessage:l,dropdownOptions:v,value:(null==i?b:i)??"",setValue:a})},vs=({field:n,value:i,setValue:a,disabled:l})=>{const r=b(),c=hs(i),d=c.length?c:[{}],u=n.fields||[],p=e=>a(e);return e(o,{children:[d.map((o,i)=>e(s,{children:[t(ke,{}),e(Q,{$gap:12,children:[e(he,{$justifyContent:"space-between",$alignItems:"center",children:[t(ee,{label:`${n.itemLabel||n.title||"Item"} ${i+1}`}),t(me,{leftIcon:()=>t(Ca,{fill:r.v2.colors.red[500]}),variant:fe.Secondary,size:ge.S,onClick:()=>(e=>{const t=d.filter((t,o)=>o!==e);p(t)})(i),disabled:l||1===d.length})]}),u.map(e=>t(bs,{field:e,value:o[e.name],setValue:t=>((e,t,o)=>p(d.map((n,i)=>i===e?{...n,[t]:o}:n)))(i,e.name,t),disabled:l},`${n.name}-group-${i}-${e.name}`))]})]},`${n.name}-group-${i}`)),t(me,{variant:fe.Secondary,label:n.addLabel||"Add",leftIcon:Sa,onClick:()=>p([...d,{}]),disabled:l}),t(ke,{})]})},ys=({field:o,value:n,setValue:i,errorMessage:a,disabled:l})=>e(Q,{$gap:12,children:[o.title&&t(ee,{label:o.title,tooltip:o.tooltip,required:o.required}),t(Q,{$gap:8,children:(o.checkboxOptions||[]).map(e=>{const o=t(te,{name:e.id,label:e.label,value:!0===n?.[e.id],disabled:l,onChange:t=>i(e.id,t)},e.id);return e.tooltip?t(Ee,{text:e.tooltip,withIcon:!0,children:o},e.id):o})}),t(oe,{errorMessage:a,helpMessage:o.helpMessage})]}),Cs=({signals:e,fields:i,value:a,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(i||[]).filter(e=>!!e).map(e=>us(e));return n(()=>{if(!c)return;const e=a||{},t={};d.forEach(o=>{const n=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===Te.CheckboxList?"array"===e.valueMode?Ie(t,[]):Ie(t,{}):e.componentType!==Te.MultiInput&&e.componentType!==Te.MultiTabledInput||!e.wrapKey?e.componentType===Te.MultiInput||e.componentType===Te.MultiTabledInput?Ie(t,[]):t:{[e.wrapKey]:Ie(t,[])}})(o);if(void 0===n)return;if(o.componentType===Te.CheckboxList&&"flatFields"===o.valueMode&&ps(n))return void Object.entries(n).forEach(([o,n])=>{void 0!==e[o]&&null!==e[o]||(t[o]=n)});null==e[o.name]&&(t[o.name]=ps(n)&&ps(t[o.name])?{...t[o.name],...n}:n)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(o,{children:d.map(o=>{const n=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(o.renderCondition&&!$e(o.renderCondition,e,n))return null;const i=a?.[o.name];if(o.componentType===Te.FieldGroup)return t(vs,{field:o,value:i,setValue:e=>l(o.name,e),disabled:s},o.name);if(o.componentType===Te.CheckboxList&&"flatFields"===o.valueMode){const e=o.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(ys,{field:o,value:a||{},setValue:l,errorMessage:e,disabled:s},o.name)}return t(bs,{field:o,value:i,setValue:e=>l(o.name,e),errorMessage:r[o.name],disabled:s},o.name)})})},Ss={[Ae.K8sAttributes]:({value:i,setValue:a,formErrors:l})=>(n(()=>{i[Z.CollectContainerAttributes]||i[Z.CollectReplicaSetAttributes]||i[Z.CollectWorkloadId]||i[Z.CollectClusterId]||i[Z.LabelsAttributes]?.length||i[Z.AnnotationsAttributes]?.length||(a(Z.CollectContainerAttributes,!0),a(Z.CollectReplicaSetAttributes,!0),a(Z.CollectWorkloadId,!0),a(Z.CollectClusterId,!0),a(Z.LabelsAttributes,[]),a(Z.AnnotationsAttributes,[]))},[]),e(o,{children:[t(Q,{$gap:6,children:Ir.map(({id:o,label:n})=>e(Q,{children:[t(te,{label:n,value:i[o]||!1,onChange:e=>a(o,e)}),t(oe,{errorMessage:l[o]})]},o))}),t(ne,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Nr,values:i[Z.LabelsAttributes]||[],setValues:e=>a(Z.LabelsAttributes,e),errorMessage:l[Z.LabelsAttributes]}),t(ne,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Ar,values:i[Z.AnnotationsAttributes]||[],setValues:e=>a(Z.AnnotationsAttributes,e),errorMessage:l[Z.AnnotationsAttributes]})]})),[Ae.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=b();return e(o,{children:[t(ae,{label:"Overwrite existing values",labelAlign:le.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[Z.OverwriteExistingValues]||!1,onChange:e=>i(Z.OverwriteExistingValues,e)}),t(ne,{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[Z.ClusterAttributes]||[],setValues:e=>i(Z.ClusterAttributes,e),errorMessage:a[Z.ClusterAttributes]})]})},[Ae.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(re,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Z.AttributeNamesToDelete]||[],setValues:e=>o(Z.AttributeNamesToDelete,e),errorMessage:n[Z.AttributeNamesToDelete]}),[Ae.RenameAttributes]:({value:e,setValue:o,formErrors:i})=>{const a=e[Z.Renames],[l,s]=r(()=>ns(a));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])})(is(l),a||{})||s(ns(a))},[a]),t(ne,{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(Z.Renames,is(t))},errorMessage:i[Z.Renames]})},[Ae.PiiMasking]:({value:o,setValue:i,formErrors:a})=>(n(()=>{o[Z.PiiCategories]?.length||i(Z.PiiCategories,$r.map(({id:e})=>e))},[]),e(Q,{$gap:12,children:[t(ee,{label:"Attributes to mask"}),t(Q,{$gap:6,children:$r.map(({id:e,label:n})=>t(te,{label:n,value:o[Z.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[Z.PiiCategories]||[],a=t?[...n,e]:n.filter(t=>t!==e);i(Z.PiiCategories,a)}},e))}),t(oe,{errorMessage:a[Z.PiiCategories]})]})),[Ae.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const l=b(),r=n[as]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(as,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(ke,{}),e(Q,{$gap:12,children:[e(he,{$justifyContent:"space-between",$alignItems:"center",children:[t(ee,{label:`Rule Group ${n+1}`}),t(me,{leftIcon:()=>t(Ca,{fill:l.v2.colors.red[500]}),variant:fe.Secondary,size:ge.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(xe,{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(ne,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ls,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(re,{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(oe,{errorMessage:a[as]})]},`url-templatization-group-${n}`)),t(me,{variant:fe.Secondary,label:"Add rule group",leftIcon:Sa,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ke,{})]})},[Ae.ExtractAttribute]:({value:o,setValue:i,formErrors:a})=>{const l=b(),s=a[Yr],c=o[Yr]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(Qr)?qr.Regex:qr.Preset)(c)),[p,h]=r(null),m=e=>i(Yr,{extractions:e});n(()=>{0===c.length&&m([d===qr.Preset?Zr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===qr.Preset?Zr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===qr.Preset,y=c.length?c:[v?Zr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(Q,{$gap:16,$width:"100%",children:[t(be,{options:[{value:qr.Preset,label:ve.SEGMENT_PRESET_LABEL,tooltip:ve.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:qr.Regex,label:ve.SEGMENT_REGEX_LABEL,tooltip:ve.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===qr.Preset?Zr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(Q,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||ye.JSON,r=Se[a];return e(es,{"data-id":`extract-row-${n}`,children:[e(he,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(Q,{$gap:10,children:[t(ee,{label:v?ve.PRESET_ROW_TITLE(n):ve.REGEX_ROW_TITLE(n)}),v&&t(he,{$gap:24,children:Jr.map(e=>t(Ce,{"data-id":`extract-row-${n}-fmt-${e}`,size:we.L,label:Se[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(he,{$gap:4,$alignItems:"center",children:[!v&&t(me,{"data-id":`extract-row-${n}-test-regex`,label:ve.TEST_REGEX_LABEL,variant:fe.Secondary,size:ge.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(me,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(Ca,{fill:l.v2.colors.red[500]}),variant:fe.Secondary,size:ge.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===qr.Preset?Zr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(me,{"data-id":`extract-row-${n}-add`,leftIcon:Sa,variant:fe.Secondary,size:ge.S,onClick:f})]})]}),v?e(he,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(ts,{children:t(xe,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(os,{children:t(wa,{size:24,fill:l.v2.colors.silver[200]})}),t(ts,{children:t(xe,{name:`extract-row-${n}-targetAttributeName`,label:ve.TARGET_LABEL,placeholder:ve.TARGET_PLACEHOLDER,helpMessage:ve.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(Q,{$gap:12,$width:"100%",children:[t(xe,{name:`extract-row-${n}-regex`,label:ve.REGEX_LABEL,placeholder:ve.REGEX_PLACEHOLDER,helpMessage:ve.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(xe,{name:`extract-row-${n}-targetAttributeName`,label:ve.TARGET_LABEL,placeholder:ve.TARGET_PLACEHOLDER,helpMessage:ve.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(oe,{errorMessage:s})]}),t(Kr,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},ws=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l})=>{if(!e)return null;if(a?.length)return t(Cs,{fields:a,value:o,setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0},e);const r=Ss[e];return r?t(r,{value:o,setValue:n,formErrors:i}):null},xs=()=>{const o=b(),{selectedOption:n,genericForm:i}=xl();if(!i||!n)return t(Oe,{title:"No active form"});const{formData:a,handleFormChange:l,formErrors:r}=i;return e(Q,{$gap:24,children:[e(he,{$gap:12,$justifyContent:"space-between",children:[t(Re,{size:pe.XXXS,maxLines:2,children:n.description}),e(he,{$gap:12,children:[t(be,{options:[{icon:xa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ka,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:De.S,selected:a.disabled,setSelected:e=>l("disabled",e)}),t(me,{leftIcon:Ta,variant:fe.Secondary,size:ge.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Hl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(xe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:a.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(ws,{actionType:n.type,dynamicFields:n.fields,signals:a.signals||[],value:a.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:a.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},ks=({signals:e,fields:o,disabled:n,formData:i,handleFormChange:a,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(o&&!$e(o,e,i.fields))return null;const f=c,b=i.fields.find(e=>e.key===f),v=b?b.value:h;return t(Gl,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>a(f,e)},f)}),Ts=f(he)`
117
+ `,vs=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),ys=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},Cs=Q.UrlTemplatizationRulesGroups,Ss=[{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"}],xs=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},ws=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,o,n]=e;return e=>{const i=null==e?.[t]?"":String(e[t]);switch(o){case"=":case"==":case"===":return i===n;case"!=":case"!==":return i!==n;default:return!0}}},Ts=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:xs(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:ws(t.renderCondition)}})},ks=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(Es):void 0}})},Es=e=>{const t="string"==typeof e.componentProperties?Ne(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:xs(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:Ts(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:ks(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(Es):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},Is=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Ns=e=>Array.isArray(e)?e:[],$s=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},Os=e=>Is(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],As=({field:e,value:o,setValue:n,errorMessage:a,disabled:l})=>{const[r,c]=s(()=>Os(o));return i(()=>{const e=Is(o)?o:{};((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])})($s(r),e)||c(Os(o))},[o]),t(ie,{name:e.name,label:e.title,tooltip:e.tooltip,helpMessage:e.helpMessage,required:e.required,disabled:l,limitFieldsPerRow:2,columns:[{keyName:"key",label:e.keyLabel||"Key",placeholder:e.keyLabel||"Key"},{keyName:"value",label:e.valueLabel||"Value",placeholder:e.valueLabel||"Value"}],values:r,setValues:e=>{c(e),n($s(e))},errorMessage:a})},Rs=({field:n,value:i,setValue:a,errorMessage:l,disabled:r})=>{const{name:c,componentType:d,inputType:p,title:u,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:v,itemWrapperKey:y,columns:C,limitFieldsPerRow:S,variant:x,wrapKey:w,checkboxOptions:T}=n,[k,E]=s({open:!1,value:""});if(d===Ee.CheckboxList&&"array"===n.valueMode){const o=Ns(i),n=(e,t)=>a(t?[...o.filter(t=>t!==e),e]:o.filter(t=>t!==e));return e(ee,{$gap:12,children:[u&&t(te,{label:u,tooltip:h,required:f}),t(ee,{$gap:8,children:(T||[]).map(e=>{const i=t(oe,{name:e.id,label:e.label,value:o.includes(e.id),disabled:r,onChange:t=>n(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:i},e.id):i})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ee.CheckboxList){const o=Is(i)?i:{},s=(e=>"emptyObject"!==e.checkedValue||{})(n),d=e=>"emptyObject"===n.checkedValue?Is(e):!!e;return e(ee,{$gap:12,children:[u&&t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:u}),t(ee,{$gap:12,children:(T||[]).map(n=>{const i=o[n.id],l=d(i),p=Is(i)?i:{},u=t(oe,{label:n.label,value:l,disabled:r,onChange:e=>a({...o,[n.id]:e?Is(i)?i:s:null})}),h=n.tooltip?t($e,{text:n.tooltip,withIcon:!0,children:u}):u,m=l&&n.fields?.length?t(ee,{$gap:12,$padding:"0 0 0 24px",children:n.fields.map(e=>t(Rs,{field:e,value:p[e.name],setValue:t=>a({...o,[n.id]:{...p,[e.name]:t}}),disabled:r},`${c}-${n.id}-${e.name}`))}):null;return e(ee,{$gap:12,children:[h,m]},n.id)})}),t(ne,{errorMessage:l,helpMessage:g})]})}if(d===Ee.MultiTabledInput){const n=Ns(w?i?.[w]:i),s=e=>a(w?{...Is(i)?i:{},[w]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(o,{children:[t("cards"===x?Oe:ie,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,columns:C||[],limitFieldsPerRow:S,values:n,setValues:s,errorMessage:l,onTestRegex:d?e=>E({open:!0,value:e}):void 0}),d&&t(cs,{isOpen:k.open,regex:k.value,onClose:()=>E({open:!1,value:""})})]})}if(d===Ee.MultiInput&&w){const e=Ns(i?.[w]);return t(se,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a({...Is(i)?i:{},[w]:e}),errorMessage:l})}if(d===Ee.MultiInput&&y){const e=Ns(i).map(e=>String(e?.[y]??""));return t(se,{name:c,label:u,tooltip:h,helpMessage:g,required:f,disabled:r,placeholder:m,values:e,setValues:e=>a(e.map(e=>({[y]:e}))),errorMessage:l})}return d===Ee.KeyValuePair?t(As,{field:n,value:i,setValue:a,errorMessage:l,disabled:r}):t(ir,{componentType:d,inputType:p,name:c,label:u,tooltip:h,helpMessage:g,disabled:r,required:f,placeholder:m,errorMessage:l,dropdownOptions:v,value:(null==i?b:i)??"",setValue:a})},Ds=({field:n,value:i,setValue:a,disabled:l})=>{const r=v(),s=Ns(i),d=s.length?s:[{}],p=n.fields||[],u=e=>a(e);return e(o,{children:[d.map((o,i)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`${n.itemLabel||n.title||"Item"} ${i+1}`}),t(ge,{leftIcon:()=>t(Ia,{fill:r.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=d.filter((t,o)=>o!==e);u(t)})(i),disabled:l||1===d.length})]}),p.map(e=>t(Rs,{field:e,value:o[e.name],setValue:t=>((e,t,o)=>u(d.map((n,i)=>i===e?{...n,[t]:o}:n)))(i,e.name,t),disabled:l},`${n.name}-group-${i}-${e.name}`))]})]},`${n.name}-group-${i}`)),t(ge,{variant:be.Secondary,label:n.addLabel||"Add",leftIcon:Na,onClick:()=>u([...d,{}]),disabled:l}),t(ke,{})]})},_s=({field:o,value:n,setValue:i,errorMessage:a,disabled:l})=>e(ee,{$gap:12,children:[o.title&&t(te,{label:o.title,tooltip:o.tooltip,required:o.required}),t(ee,{$gap:8,children:(o.checkboxOptions||[]).map(e=>{const o=t(oe,{name:e.id,label:e.label,value:!0===n?.[e.id],disabled:l,onChange:t=>i(e.id,t)},e.id);return e.tooltip?t($e,{text:e.tooltip,withIcon:!0,children:o},e.id):o})}),t(ne,{errorMessage:a,helpMessage:o.helpMessage})]}),Ps=({signals:e,fields:n,value:a,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(n||[]).filter(e=>!!e).map(e=>Es(e));return i(()=>{if(!c)return;const e=a||{},t={};d.forEach(o=>{const n=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===Ee.CheckboxList?"array"===e.valueMode?Ne(t,[]):Ne(t,{}):e.componentType!==Ee.MultiInput&&e.componentType!==Ee.MultiTabledInput||!e.wrapKey?e.componentType===Ee.MultiInput||e.componentType===Ee.MultiTabledInput?Ne(t,[]):t:{[e.wrapKey]:Ne(t,[])}})(o);if(void 0===n)return;if(o.componentType===Ee.CheckboxList&&"flatFields"===o.valueMode&&Is(n))return void Object.entries(n).forEach(([o,n])=>{void 0!==e[o]&&null!==e[o]||(t[o]=n)});null==e[o.name]&&(t[o.name]=Is(n)&&Is(t[o.name])?{...t[o.name],...n}:n)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(o,{children:d.map(o=>{const n=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(o.renderCondition&&!Ie(o.renderCondition,e,n))return null;const i=a?.[o.name];if(o.componentType===Ee.FieldGroup)return t(Ds,{field:o,value:i,setValue:e=>l(o.name,e),disabled:s},o.name);if(o.componentType===Ee.CheckboxList&&"flatFields"===o.valueMode){const e=o.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(_s,{field:o,value:a||{},setValue:l,errorMessage:e,disabled:s},o.name)}return t(Rs,{field:o,value:i,setValue:e=>l(o.name,e),errorMessage:r[o.name],disabled:s},o.name)})})},Ls={[Ae.K8sAttributes]:({value:n,setValue:a,formErrors:l})=>(i(()=>{n[Q.CollectContainerAttributes]||n[Q.CollectReplicaSetAttributes]||n[Q.CollectWorkloadId]||n[Q.CollectClusterId]||n[Q.LabelsAttributes]?.length||n[Q.AnnotationsAttributes]?.length||(a(Q.CollectContainerAttributes,!0),a(Q.CollectReplicaSetAttributes,!0),a(Q.CollectWorkloadId,!0),a(Q.CollectClusterId,!0),a(Q.LabelsAttributes,[]),a(Q.AnnotationsAttributes,[]))},[]),e(o,{children:[t(ee,{$gap:6,children:Ur.map(({id:o,label:i})=>e(ee,{children:[t(oe,{label:i,value:n[o]||!1,onChange:e=>a(o,e)}),t(ne,{errorMessage:l[o]})]},o))}),t(ie,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Hr,values:n[Q.LabelsAttributes]||[],setValues:e=>a(Q.LabelsAttributes,e),errorMessage:l[Q.LabelsAttributes]}),t(ie,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:jr,values:n[Q.AnnotationsAttributes]||[],setValues:e=>a(Q.AnnotationsAttributes,e),errorMessage:l[Q.AnnotationsAttributes]})]})),[Ae.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=v();return e(o,{children:[t(le,{label:"Overwrite existing values",labelAlign:re.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[Q.OverwriteExistingValues]||!1,onChange:e=>i(Q.OverwriteExistingValues,e)}),t(ie,{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[Q.ClusterAttributes]||[],setValues:e=>i(Q.ClusterAttributes,e),errorMessage:a[Q.ClusterAttributes]})]})},[Ae.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(se,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Q.AttributeNamesToDelete]||[],setValues:e=>o(Q.AttributeNamesToDelete,e),errorMessage:n[Q.AttributeNamesToDelete]}),[Ae.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>{const a=e[Q.Renames],[l,r]=s(()=>vs(a));return i(()=>{((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])})(ys(l),a||{})||r(vs(a))},[a]),t(ie,{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??"")}));r(t),o(Q.Renames,ys(t))},errorMessage:n[Q.Renames]})},[Ae.PiiMasking]:({value:o,setValue:n,formErrors:a})=>(i(()=>{o[Q.PiiCategories]?.length||n(Q.PiiCategories,Xr.map(({id:e})=>e))},[]),e(ee,{$gap:12,children:[t(te,{label:"Attributes to mask"}),t(ee,{$gap:6,children:Xr.map(({id:e,label:i})=>t(oe,{label:i,value:o[Q.PiiCategories]?.includes(e)||!1,onChange:t=>{const i=o[Q.PiiCategories]||[],a=t?[...i,e]:i.filter(t=>t!==e);n(Q.PiiCategories,a)}},e))}),t(ne,{errorMessage:a[Q.PiiCategories]})]})),[Ae.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const l=v(),r=n[Cs]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],s=e=>i(Cs,e),d=(e,t)=>s(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(c,{children:[t(ke,{}),e(ee,{$gap:12,children:[e(me,{$justifyContent:"space-between",$alignItems:"center",children:[t(te,{label:`Rule Group ${n+1}`}),t(ge,{leftIcon:()=>t(Ia,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>{return e=n,s(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(Te,{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(ie,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Ss,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(se,{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(ne,{errorMessage:a[Cs]})]},`url-templatization-group-${n}`)),t(ge,{variant:be.Secondary,label:"Add rule group",leftIcon:Na,onClick:()=>s([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ke,{})]})},[Ae.ExtractAttribute]:({value:o,setValue:n,formErrors:a})=>{const l=v(),r=a[ds],c=o[ds]?.extractions||[],[d,p]=s(()=>(e=>e.length&&e.some(ms)?ps.Regex:ps.Preset)(c)),[u,h]=s(null),m=e=>n(ds,{extractions:e});i(()=>{0===c.length&&m([d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===ps.Preset,y=c.length?c:[b?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=u&&y[u]?.regex||"";return e(ee,{$gap:16,$width:"100%",children:[t(ve,{options:[{value:ps.Preset,label:ye.SEGMENT_PRESET_LABEL,tooltip:ye.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:ps.Regex,label:ye.SEGMENT_REGEX_LABEL,tooltip:ye.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{p(e),m([e===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(ee,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||Ce.JSON,r=xe[a];return e(gs,{"data-id":`extract-row-${n}`,children:[e(me,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(ee,{$gap:10,children:[t(te,{label:b?ye.PRESET_ROW_TITLE(n):ye.REGEX_ROW_TITLE(n)}),b&&t(me,{$gap:24,children:us.map(e=>t(Se,{"data-id":`extract-row-${n}-fmt-${e}`,size:we.L,label:xe[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(me,{$gap:4,$alignItems:"center",children:[!b&&t(ge,{"data-id":`extract-row-${n}-test-regex`,label:ye.TEST_REGEX_LABEL,variant:be.Secondary,size:fe.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ge,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(Ia,{fill:l.v2.colors.red[500]}),variant:be.Secondary,size:fe.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===ps.Preset?hs():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(ge,{"data-id":`extract-row-${n}-add`,leftIcon:Na,variant:be.Secondary,size:fe.S,onClick:f})]})]}),b?e(me,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(fs,{children:t(Te,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(bs,{children:t($a,{size:24,fill:l.v2.colors.silver[200]})}),t(fs,{children:t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(ee,{$gap:12,$width:"100%",children:[t(Te,{name:`extract-row-${n}-regex`,label:ye.REGEX_LABEL,placeholder:ye.REGEX_PLACEHOLDER,helpMessage:ye.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(Te,{name:`extract-row-${n}-targetAttributeName`,label:ye.TARGET_LABEL,placeholder:ye.TARGET_PLACEHOLDER,helpMessage:ye.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(ne,{errorMessage:r})]}),t(cs,{isOpen:null!=u,regex:C,onClose:()=>h(null)})]})}},Fs=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l})=>{if(!e)return null;if(a?.length)return t(Ps,{fields:a,value:o,setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0},e);const r=Ls[e];return r?t(r,{value:o,setValue:n,formErrors:i}):null},Ms=()=>{const o=v(),{selectedOption:n,genericForm:i}=Pl();if(!i||!n)return t(Re,{title:"No active form"});const{formData:a,handleFormChange:l,formErrors:r}=i;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:n.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:a.disabled,setSelected:e=>l("disabled",e)}),t(ge,{leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(ar,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(Te,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:a.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(Fs,{actionType:n.type,dynamicFields:n.fields,signals:a.signals||[],value:a.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:a.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},zs=({signals:e,fields:o,disabled:n,formData:i,handleFormChange:a,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:p,placeholder:u,value:h,required:m,options:g})=>{if(o&&!Ie(o,e,i.fields))return null;const f=c,b=i.fields.find(e=>e.key===f),v=b?b.value:h;return t(ir,{componentType:r,inputType:s,name:f,label:d,tooltip:p,disabled:n,required:m,placeholder:u,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>a(f,e)},f)}),Bs=b(me)`
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
- `,$s=c(({isEdit:o},i)=>{const a=b(),{isVm:l}=C(),{destinationsApi:s}=kl(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Tl(),[v,y]=r(h?.testResult),[S,w]=r(!!h);n(()=>{h?(y(h.testResult),w(!0)):(y(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await s.testConnection(Xe(u.formData));return y(e),e};return d(i,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,s]),u&&c?e(Q,{$gap:24,style:{minHeight:"100%"},children:[e(he,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Fe,{status:Le.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Fe,{status:Le.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(he,{$gap:12,children:[!l&&t(be,{options:[{icon:xa,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:ka,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],size:De.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(me,{"data-id":"dest-form-docs",leftIcon:Ta,variant:fe.Secondary,size:ge.S,onClick:()=>window.open(`${Me}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Hl,{title:"This connection will monitor:",allowedSignals:Be(c.option.supportedSignals),selectedSignals:ze(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(xe,{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(ks,{signals:ze(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(Ts,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(me,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:$a,variant:fe.Secondary,textColor:a.v2.colors.red[500],onClick:()=>f(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(me,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:fe.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(me,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Ia,variant:fe.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(me,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:fe.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(me,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:fe.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(Oe,{title:"No active form"})});$s.displayName="AddDestinationForm";const Is=[{id:Ve.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ve.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ve.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Es=[{id:Ve.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ve.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ve.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ns=["*"],As=[{id:Ge.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ge.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ge.DbQuery,label:"Collect DB query",tooltip:""},{id:Ge.Messaging,label:"Collect messaging",tooltip:""}],Os={[We.Java]:[new je("","")],[We.Golang]:[new He("")]},Rs={[Ke.CodeAttributes]:({value:a,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=i(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]);n(()=>{if(!c.length&&!s){const e={[Ve.FilePath]:!0,[Ve.Function]:!0,[Ve.LineNumber]:!0,[Ve.Column]:null,[Ve.Namespace]:null,[Ve.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ve).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(Q,{$gap:12,children:[t(de,{size:pe.XS,color:ue.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(Q,{$gap:6,children:Is.map(({id:e,label:o,tooltip:n})=>t(Ee,{text:n,withIcon:!0,children:t(te,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(oe,{errorMessage:s})]}),e(Q,{$gap:12,children:[t(de,{size:pe.XS,color:ue.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(Q,{$gap:6,children:Es.map(({id:e,label:o,tooltip:n})=>t(Ee,{text:n,withIcon:!0,children:t(te,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(oe,{errorMessage:s})]})]})},[Ke.CustomInstrumentation]:({value:a,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=i(()=>(a?.customInstrumentations?.[We.Golang]||[]).map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[a]),d=i(()=>(a?.customInstrumentations?.[We.Java]||[]).map(e=>new je(e.className,e.methodName)),[a]);return n(()=>{a?.customInstrumentations||s||l("customInstrumentations",{[We.Golang]:Os[We.Golang],[We.Java]:Os[We.Java]})},[]),e(o,{children:[e(Q,{children:[e(he,{$gap:8,children:[t(Ea,{}),t(ee,{label:"Golang custom probes"})]}),t(ne,{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[We.Golang]=e.map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[We.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(Q,{children:[e(he,{$gap:8,children:[t(Na,{}),t(ee,{label:"Java custom probes"})]}),t(ne,{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[We.Golang]=c,t[We.Java]=e.map(e=>new je(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ke.HeadersCollection]:({value:e,setValue:o,formErrors:a})=>{const l=a.headersCollection,r=i(()=>e?.headersCollection?.[Ue.HeaderKeys]||[],[e]),s=e=>{const t={[Ue.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{r.length||l||s(Ns)},[]),t(re,{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})},[Ke.PayloadCollection]:({value:o,setValue:a,formErrors:l})=>{const r=l.payloadCollection,s=i(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);return n(()=>{if(!s.length&&!r){const e={[Ge.HttpRequest]:{},[Ge.HttpResponse]:{},[Ge.DbQuery]:{},[Ge.Messaging]:{}};a("payloadCollection",e)}},[]),e(Q,{$gap:12,children:[t(de,{size:pe.XS,color:ue.Secondary,nowrap:!0,children:"Type of data to collect"}),t(Q,{$gap:6,children:As.map(({id:e,label:o,tooltip:n})=>t(Ee,{text:n,withIcon:!0,children:t(te,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Ge.HttpRequest]:o.includes(Ge.HttpRequest)?{}:null,[Ge.HttpResponse]:o.includes(Ge.HttpResponse)?{}:null,[Ge.DbQuery]:o.includes(Ge.DbQuery)?{}:null,[Ge.Messaging]:o.includes(Ge.Messaging)?{}:null};a("payloadCollection",n)})(e,t)})},e))}),t(oe,{errorMessage:r})]})},[Ke.UnknownType]:null},Ds=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(Cs,{fields:a,value:o,setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0});const l=Rs[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Ps=()=>{const o=b(),{isVm:n}=C(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=$l();if(!a||!i)return t(Oe,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=a;return e(Q,{$gap:24,children:[e(he,{$gap:12,$justifyContent:"space-between",children:[t(Re,{size:pe.XXXS,maxLines:2,children:i.description}),e(he,{$gap:12,children:[t(be,{options:[{icon:xa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ka,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:De.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(me,{leftIcon:Ta,variant:fe.Secondary,size:ge.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(jl,{option:i,formState:s}),e(he,{$gap:12,children:[t(de,{size:pe.XS,color:ue.Secondary,nowrap:!0,children:"Supported Languages:"}),i.supportedLanguages.map(e=>t(Ye,{label:qe[e],leftIcon:Je(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(Wl,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:i.type===Ke.CustomInstrumentation?[]:i.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(xe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>c("ruleName",e),errorMessage:d.ruleName}),t(Ds,{ruleType:i.type,dynamicFields:i.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},Fs=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Il();if(!e)return null;const{existingName:i,editingName:a}=e;return t(Ze,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Qe.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:fe.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:fe.Secondary,onClick:n}})},Ls=({autoFocus:o})=>{const{dataStreams:n}=et(),{genericForm:a,excludeName:l,editingName:r}=Il(),{formData:s,formErrors:c,handleFormChange:d}=a,u=s.name,p=i(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(Q,{$width:"100%",$gap:12,children:[t(xe,{name:"data-stream-name",label:Qe.STREAM_NAME,placeholder:Qe.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Qe.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Fe,{status:Le.Warning,message:Qe.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Ms=()=>{const{selectedStreamName:e}=et(),{genericForm:o}=El();if(!o)return t(Oe,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(xe,{name:"sourceName",label:Qe.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}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},_s=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],zs=f.div`
128
+ `,Xs=d(({isEdit:o},n)=>{const a=v(),{isVm:l}=S(),{destinationsApi:r}=Ll(),{activeForm:c,genericForm:d,validateFormData:u,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Fl(),[b,y]=s(h?.testResult),[C,x]=s(!!h);i(()=>{h?(y(h.testResult),x(!0)):(y(void 0),x(!1))},[h]);const w=async()=>{if(!c?.option.testConnectionSupported||!d||l)return;const e=await r.testConnection(Ue(d.formData));return y(e),e};return p(n,()=>({testConnection:w,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,d,r]),d&&c?e(ee,{$gap:24,style:{minHeight:"100%"},children:[e(me,{$gap:12,$justifyContent:"space-between",children:[b?b.succeeded?t(Le,{status:Fe.Success,message:b.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Le,{status:Fe.Error,message:b.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(me,{$gap:12,children:[!l&&t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],size:_e.S,selected:d.formData.disabled,setSelected:e=>d.handleFormChange("disabled",e),disabled:C}),t(ge,{"data-id":"dest-form-docs",leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>window.open(`${Me}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(ar,{title:"This connection will monitor:",allowedSignals:Xe(c.option.supportedSignals),selectedSignals:Be(d.formData.exportedSignals),setSelectedSignals:e=>d.handleFormChange("exportedSignals",{logs:e.includes(ze.Logs),metrics:e.includes(ze.Metrics),traces:e.includes(ze.Traces),profiles:e.includes(ze.Profiles)}),disabled:C,errorMessage:d.formErrors.exportedSignals}),t(Te,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:d.formData.name,onChange:({target:{value:e}})=>d.handleFormChange("name",e),disabled:C,errorMessage:d.formErrors.name}),t(zs,{signals:Be(d.formData.exportedSignals),fields:c.dynamicFields,disabled:C,formData:d.formData,handleFormChange:(e,t)=>{d.handleFormChange("fields",d.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&d.formErrors[e]&&d.handleErrorChange(e,void 0)},formErrors:d.formErrors}),!o&&e(Bs,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:Da,variant:be.Secondary,textColor:a.v2.colors.red[500],onClick:()=>f(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!C)&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:be.Secondary,onClick:w})}),h&&t("div",C?{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:_a,variant:be.Secondary,onClick:()=>x(!1)})}:{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),o=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ge,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:be.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=u();if(!e){const e=await w(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(Re,{title:"No active form"})});Xs.displayName="AddDestinationForm";const Us=[{id:Ve.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ve.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ve.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Vs=[{id:Ve.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ve.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ve.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Hs=["*"],js=[{id:je.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:je.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:je.DbQuery,label:"Collect DB query",tooltip:""},{id:je.Messaging,label:"Collect messaging",tooltip:""}],Gs={[Ke.Java]:[new We("","")],[Ke.Golang]:[new Ge("")]},Ws={[Ye.CodeAttributes]:({value:n,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(n.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[n]);i(()=>{if(!c.length&&!s){const e={[Ve.FilePath]:!0,[Ve.Function]:!0,[Ve.LineNumber]:!0,[Ve.Column]:null,[Ve.Namespace]:null,[Ve.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ve).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(ee,{$gap:6,children:Us.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]}),e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(ee,{$gap:6,children:Vs.map(({id:e,label:o,tooltip:n})=>t($e,{text:n,withIcon:!0,children:t(oe,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(ne,{errorMessage:s})]})]})},[Ye.CustomInstrumentation]:({value:n,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(n?.customInstrumentations?.[Ke.Golang]||[]).map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[n]),d=a(()=>(n?.customInstrumentations?.[Ke.Java]||[]).map(e=>new We(e.className,e.methodName)),[n]);return i(()=>{n?.customInstrumentations||s||l("customInstrumentations",{[Ke.Golang]:Gs[Ke.Golang],[Ke.Java]:Gs[Ke.Java]})},[]),e(o,{children:[e(ee,{children:[e(me,{$gap:8,children:[t(Pa,{}),t(te,{label:"Golang custom probes"})]}),t(ie,{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[Ke.Golang]=e.map(e=>new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ke.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(ee,{children:[e(me,{$gap:8,children:[t(La,{}),t(te,{label:"Java custom probes"})]}),t(ie,{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[Ke.Golang]=c,t[Ke.Java]=e.map(e=>new We(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ye.HeadersCollection]:({value:e,setValue:o,formErrors:n})=>{const l=n.headersCollection,r=a(()=>e?.headersCollection?.[He.HeaderKeys]||[],[e]),s=e=>{const t={[He.HeaderKeys]:e};o("headersCollection",t)};return i(()=>{r.length||l||s(Hs)},[]),t(se,{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})},[Ye.PayloadCollection]:({value:o,setValue:n,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);return i(()=>{if(!s.length&&!r){const e={[je.HttpRequest]:{},[je.HttpResponse]:{},[je.DbQuery]:{},[je.Messaging]:{}};n("payloadCollection",e)}},[]),e(ee,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Type of data to collect"}),t(ee,{$gap:6,children:js.map(({id:e,label:o,tooltip:i})=>t($e,{text:i,withIcon:!0,children:t(oe,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),i={[je.HttpRequest]:o.includes(je.HttpRequest)?{}:null,[je.HttpResponse]:o.includes(je.HttpResponse)?{}:null,[je.DbQuery]:o.includes(je.DbQuery)?{}:null,[je.Messaging]:o.includes(je.Messaging)?{}:null};n("payloadCollection",i)})(e,t)})},e))}),t(ne,{errorMessage:r})]})},[Ye.UnknownType]:null},Ks=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(Ps,{fields:a,value:o,setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0});const l=Ws[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Ys=()=>{const o=v(),{isVm:n}=S(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=Ml();if(!a||!i)return t(Re,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=a;return e(ee,{$gap:24,children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(De,{size:he.XXXS,maxLines:2,children:i.description}),e(me,{$gap:12,children:[t(ve,{options:[{icon:Oa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:Aa,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:_e.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(ge,{leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(lr,{option:i,formState:s}),e(me,{$gap:12,children:[t(pe,{size:he.XS,color:ue.Secondary,nowrap:!0,children:"Supported Languages:"}),i.supportedLanguages.map(e=>t(qe,{label:Je[e],leftIcon:Ze(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(rr,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:i.type===Ye.CustomInstrumentation?[]:i.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(Te,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>c("ruleName",e),errorMessage:d.ruleName}),t(Ks,{ruleType:i.type,dynamicFields:i.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},qs=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=zl();if(!e)return null;const{existingName:i,editingName:a}=e;return t(Qe,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:et.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:be.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:be.Secondary,onClick:n}})},Js=({autoFocus:o})=>{const{dataStreams:n}=tt(),{genericForm:i,excludeName:l,editingName:r}=zl(),{formData:s,formErrors:c,handleFormChange:d}=i,p=s.name,u=a(()=>n.find(e=>e.name===p&&e.name!==l),[n,p,l]);return e(ee,{$width:"100%",$gap:12,children:[t(Te,{name:"data-stream-name",label:et.STREAM_NAME,placeholder:et.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:et.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:p,onChange:e=>d("name",e.target.value),errorMessage:c.name}),u&&t(Le,{status:Fe.Warning,message:et.DATA_STREAM_MERGE_WARNING(r,u.name),fullWidth:!0})]})},Zs=()=>{const{selectedStreamName:e}=tt(),{genericForm:o}=Bl();if(!o)return t(Re,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(Te,{name:"sourceName",label:et.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}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},Qs=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],ec=b.div`
129
129
  display: flex;
130
130
  flex-direction: column;
131
131
  gap: 24px;
132
- `,Bs=f.div`
132
+ `,tc=b.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
- `,Xs=({value:e})=>{const o=b();return t(Ye,e?{status:Le.Success,label:rt,leftIcon:xa}:{label:st,leftIcon:ka,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Vs=({value:e,onChange:o})=>{const n=b(),a=i(()=>[{icon:xa,label:rt,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:ka,label:st,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(be,{options:a,selected:e,setSelected:o??(()=>{}),disabled:!o})},Us=()=>{const e=Nl();switch(e.formType){case Al.Create:return t(Gs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Vs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Al.View:return e.data?e.isEditing?t(Gs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Vs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Hs,{data:e.data,renderAction:()=>t(Xs,{value:!e.data?.rule.disabled})}):null;case Al.EditAutoNoisy:return t(js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:lt,sectionTitle:nt,sectionSubTitle:at,presetLabel:ot,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(Vs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Al.EditAutoCostReduction:return t(js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:it,sectionTitle:nt,presetLabel:ot,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(Vs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Al.EditAutoHighlyRelevant:return t(zs,{children:t(Kl,{title:e.localEnabled?void 0:tt,summary:e.summary,renderAction:()=>t(Vs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Gs=({category:o,formData:n,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(zs,{children:[t(Jl,{category:o,formState:n,renderAction:r}),e(Bs,{$faded:!!n.disabled,children:[t(Zl,{category:o,formState:n,onChange:i}),t(Wl,{scopes:n.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Ql,{category:o,formState:n,onChange:i}),"highlyRelevant"===o&&t(er,{formState:n,onChange:i}),"highlyRelevant"===o&&t(tr,{ruleType:n.ruleType,formState:n,onChange:i}),t(or,{category:o,formState:n,onChange:i})]})]}),Hs=({data:o,renderAction:n})=>e(zs,{children:[t(Jl,{readOnly:!0,summary:o.summary,renderAction:n}),t(Zl,{readOnly:!0,data:o}),t(Wl,{readOnly:!0,scopes:S(o.rule.sourceScopes)}),t(Ql,{readOnly:!0,data:o}),t(or,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(tr,{readOnly:!0,rule:o.rule})]}),js=({enabled:o,summary:n,inactiveTitle:i,sectionTitle:a,sectionSubTitle:r,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>m(e),[m]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(zs,{children:[t(Kl,{title:o?void 0:i,summary:n,renderAction:b}),t(Bs,{$faded:!o,children:e(ct,{richTitle:{title:a,subTitle:r},children:[d&&t(Q,{$alignItems:"flex-start",children:t(be,{options:_s,selected:u,setSelected:v})}),S&&t(Yl,{description:s,options:ql,selected:h,onSelect:y,customName:c,customLabel:dt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Ws=f.div`
138
+ `,oc=({value:e})=>{const o=v();return t(qe,e?{status:Fe.Success,label:st,leftIcon:Oa}:{label:ct,leftIcon:Aa,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},nc=({value:e,onChange:o})=>{const n=v(),i=a(()=>[{icon:Oa,label:st,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:Aa,label:ct,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ve,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},ic=()=>{const e=Xl();switch(e.formType){case Ul.Create:return t(ac,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(nc,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Ul.View:return e.data?e.isEditing?t(ac,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(nc,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(lc,{data:e.data,renderAction:()=>t(oc,{value:!e.data?.rule.disabled})}):null;case Ul.EditAutoNoisy:return t(rc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:rt,sectionTitle:it,sectionSubTitle:lt,presetLabel:nt,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(nc,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ul.EditAutoCostReduction:return t(rc,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:at,sectionTitle:it,presetLabel:nt,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(nc,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Ul.EditAutoHighlyRelevant:return t(ec,{children:t(sr,{title:e.localEnabled?void 0:ot,summary:e.summary,renderAction:()=>t(nc,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},ac=({category:o,formData:n,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(ec,{children:[t(pr,{category:o,formState:n,renderAction:r}),e(tc,{$faded:!!n.disabled,children:[t(ur,{category:o,formState:n,onChange:i}),t(rr,{scopes:n.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(hr,{category:o,formState:n,onChange:i}),"highlyRelevant"===o&&t(mr,{formState:n,onChange:i}),"highlyRelevant"===o&&t(gr,{ruleType:n.ruleType,formState:n,onChange:i}),t(fr,{category:o,formState:n,onChange:i})]})]}),lc=({data:o,renderAction:n})=>e(ec,{children:[t(pr,{readOnly:!0,summary:o.summary,renderAction:n}),t(ur,{readOnly:!0,data:o}),t(rr,{readOnly:!0,scopes:x(o.rule.sourceScopes)}),t(hr,{readOnly:!0,data:o}),t(fr,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(gr,{readOnly:!0,rule:o.rule})]}),rc=({enabled:o,summary:n,inactiveTitle:i,sectionTitle:a,sectionSubTitle:l,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:p,setPercentageMode:u,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=r(e=>u(e),[u]),y=r(e=>m(e),[m]),C=r(e=>f(e.target.value),[f]),S=!d||"sample"===p;return e(ec,{children:[t(sr,{title:o?void 0:i,summary:n,renderAction:b}),t(tc,{$faded:!o,children:e(dt,{richTitle:{title:a,subTitle:l},children:[d&&t(ee,{$alignItems:"flex-start",children:t(ve,{options:Qs,selected:p,setSelected:v})}),S&&t(cr,{description:s,options:dr,selected:h,onSelect:y,customName:c,customLabel:pt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},sc=b.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
- `,Ks=f.div`
151
+ `,cc=b.div`
152
152
  display: flex;
153
153
  align-items: center;
154
154
  justify-content: center;
155
155
  padding: 8px;
156
156
  border-radius: 8px;
157
157
  background-color: ${({theme:e})=>e.v2.colors.white[500]+ut["004"]};
158
- `,Ys=({dataId:o,icon:n,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(Ws,{"data-id":o||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(Q,{$gap:4,children:[e(he,{$gap:12,children:[m&&t(te,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),n&&t(Ks,{children:t(n,{size:20})}),t(de,{size:pe.XS,children:i})]}),a&&t(de,{size:pe.XXXS,color:ue.Secondary,children:a})]}),(l||c)&&e(he,{$gap:8,children:[c,l&&t(Aa,{size:18})]})]}),qs=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{actionsApi:s}=kl(),{platformType:c,version:d}=C(),[u,p]=r(""),h=a(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=xl(),{options:v,loading:y}=s.useActionTypes(),S=i(()=>v.length?v:pt(c,d),[v,c,d]),w=i(()=>(u?S.filter(e=>e?.label?.toLowerCase().includes(u.toLowerCase())):S).filter(e=>!!e),[S,u]),x=i(()=>y?[t(ht,{$padding:"8px 12px",children:t(mt,{size:6})},"loading")]:w.map(e=>{const o=m?.type===e.type;return t(Ys,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)}),[y,m?.type,w,g]),k=i(()=>y?[t(ht,{$padding:"8px 12px",children:t(mt,{size:4})},"loading")]:m?[t(xs,{},m.type)]:[t(gt,{$height:"100%",children:t(Oe,{icon:Oa,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(nr,{ref:h,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await s.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:Qe.CREATING_ACTION,subTitle:Qe.CREATING_ACTION_SUBTITLE},header:{icon:Oa,title:Qe.ADD_ACTION,subTitle:Qe.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:u,onChange:p},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:k}})},Js=({destinationsByCategory:n,filters:a,setFilters:l})=>{const r=i(()=>Object.values(ft).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=i(()=>{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(bt,{placeholder:"Select category",options:r,values:a.categoryType?[a.categoryType]:[],setValues:e=>l({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(be,{options:s,selected:a.signalType,setSelected:e=>l({...a,signalType:e})})]})},Zs=f.div`
158
+ `,dc=({dataId:o,icon:n,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:p,isChecked:u,isPartiallyChecked:h,onCheckboxChange:m})=>e(sc,{"data-id":o||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&p(),children:[e(ee,{$gap:4,children:[e(me,{$gap:12,children:[m&&t(oe,{partiallyChecked:h||!1,value:u||!1,onChange:e=>m(e)}),n&&t(cc,{children:t(n,{size:20})}),t(pe,{size:he.XS,children:i})]}),a&&t(pe,{size:he.XXXS,color:ue.Secondary,children:a})]}),(l||c)&&e(me,{$gap:8,children:[c,l&&t(Fa,{size:18})]})]}),pc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{actionsApi:r}=Ll(),{platformType:c,version:d}=S(),[p,u]=s(""),h=l(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=Pl(),{options:v,loading:y}=r.useActionTypes(),C=a(()=>v.length?v:ht(c,d),[v,c,d]),x=a(()=>(p?C.filter(e=>e?.label?.toLowerCase().includes(p.toLowerCase())):C).filter(e=>!!e),[C,p]),w=a(()=>y?[t(mt,{$padding:"8px 12px",children:t(gt,{size:6})},"loading")]:x.map(e=>{const o=m?.type===e.type;return t(dc,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)}),[y,m?.type,x,g]),T=a(()=>y?[t(mt,{$padding:"8px 12px",children:t(gt,{size:4})},"loading")]:m?[t(Ms,{},m.type)]:[t(ft,{$height:"100%",children:t(Re,{icon:Ma,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(br,{ref:h,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await r.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:et.CREATING_ACTION,subTitle:et.CREATING_ACTION_SUBTITLE},header:{icon:Ma,title:et.ADD_ACTION,subTitle:et.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:p,onChange:u},leftColumn:{width:"40%",list:w},rightColumn:{width:"60%",list:T}})},uc=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(bt).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(ze).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(vt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(ve,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},hc=b.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
- `,Qs=f.div`
165
+ `,mc=b.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
- `,ec=({title:o,tooltip:n,list:i,noBgColor:a,purpleColors:l})=>{const[s,c]=r(!0);return e(Zs,{"data-id":`collapse-${o}`,$noBgColor:a,$purpleColors:l,children:[e(Qs,{$isOpen:s,children:[e(he,{$gap:10,children:[t(de,{size:pe.XS,children:o}),n&&t(Ee,{text:n,withIcon:!0}),t(Ye,{label:i.length,status:l?Le.Default:void 0})]}),t(vt,{icon:s?Da:Pa,size:yt.M,onClick:()=>c(e=>!e)})]}),s?t(Q,{children:i.length?u.toArray(i):t(gt,{$padding:"12px 0",children:t(Oe,{})})}):null]})},tc=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Be(e.supportedSignals).includes(o.signalType))):e,oc=({option:e,formData:o,testResult:n,isSelected:i,onSelect:a})=>t(Ys,{icon:wt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:i,onClick:()=>a(),children:n&&t(Ye,{status:n.succeeded?Le.Success:Le.Error,leftIcon:n.succeeded?Fa:La})}),nc=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:i,onChangeActiveForm:a}=Tl();return o?.length?t(ec,{title:St[e].TITLE,tooltip:St[e].DESCRIPTION,list:o.map((o,n)=>t(oc,{option:o,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=o.id&&""!==o.id?i?.option.id===o.id:i?.option.type===o.type),onSelect:()=>a({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(ec,{purpleColors:!0,title:St[e].TITLE,tooltip:St[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(oc,{option:o,formData:n,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ic;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(ic||(ic={}));const ac=(e,t)=>{const o=[],n=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ic.SELF_HOSTED?n.push(...e.items):e.name===ic.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=xt(n),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const n=Ie(t.fields,{});Object.keys(n).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[i]))}}}),{[ft.DETECTED]:o,[ft.SELF_HOSTED]:n,[ft.MANAGED]:i}},lc=({onClose:e,onBack:o,onNext:a,selectedConnectionIds:s,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=kl(),[m,g]=r(""),[f,b]=r({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:w}=h.usePotentialDestinations(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Tl();n(()=>{d&&$(d)},[d]);const I=C||w,E=i(()=>y?.destinationCategories?.categories??[],[y]),[N,A]=r({[ft.ALL]:[],[ft.UNSAVED]:[],[ft.EXISTS]:[],[ft.DETECTED]:[],[ft.SELF_HOSTED]:[],[ft.MANAGED]:[]});n(()=>{const e=v.map(e=>{let t;for(const o of E){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=Ie(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})):[]}});A(t=>({...t,[ft.EXISTS]:e}))},[v,E]),n(()=>{(y||S)&&A(e=>({...e,...ac(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of T){const o=Xe(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)}},[T,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:a})=>{const{unsavedDestinations:l}=Tl();return{width:"40%",list:i(()=>{const i=[];l.length&&i.push(t(nc,{listType:ft.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(ft)){if(a.categoryType&&a.categoryType!==e)continue;const l=tc(o[e],n,a);l.length&&i.push(t(nc,{listType:e,destinationOptions:l},e))}return e&&i.push(t(gt,{$height:"100%",children:t(Ct,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),i},[l,o,n,a,e])}})({isFetching:I,destinationsByCategory:N,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Tl();return{width:"60%",list:e?[t($s,{},e.option.type)]:[t(gt,{$height:"100%",children:t(Oe,{icon:Ra,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(nr,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:o?()=>o(T):void 0,onNext:a?()=>a(T):void 0,nextIsSkip:!T.length,onSave:O,disableSave:!x&&!T.length,isFetching:I,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Qe.CREATING_DESTINATION,subTitle:Qe.CREATING_DESTINATION_SUBTITLE},header:{icon:Ra,title:Qe.ADD_DESTINATIONS,subTitle:Qe.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(Js,{destinationsByCategory:N,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},rc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{instrumentationRulesApi:s}=kl(),[c,d]=r(""),u=a(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=$l(),{options:f,loading:b}=s.useRuleTypes(),v=i(()=>f.length?f:kt,[f]),y=i(()=>c?v.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):v,[v,c]),C=i(()=>b?[t(ht,{$padding:"8px 12px",children:t(mt,{size:4})},"loading")]:y.map(e=>{const o=p?.type===e.type;return t(Ys,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[b,p?.type,y,h]),S=i(()=>b?[t(ht,{$padding:"8px 12px",children:t(mt,{size:4})},"loading")]:p?[t(Ps,{},p.type)]:[t(gt,{$height:"100%",children:t(Oe,{icon:Ma,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,p]);return t(nr,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await s.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Qe.CREATING_INSTRUMENTATION_RULE,subTitle:Qe.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ma,title:Qe.ADD_INSTRUMENTATION_RULE,subTitle:Qe.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},sc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Qe.FETCHING_NAMESPACES,subTitle:Qe.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:Qe.SELECT_NAMESPACE,subTitle:Qe.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},cc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Tt.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"},dc=e=>e?cc:sc,uc="No matches",pc=e=>(e?"Unselect":"Select")+" all",hc="Selected",mc=f.div``,gc=f.div`
171
+ `,gc=({title:o,tooltip:n,list:i,noBgColor:a,purpleColors:l})=>{const[r,c]=s(!0);return e(hc,{"data-id":`collapse-${o}`,$noBgColor:a,$purpleColors:l,children:[e(mc,{$isOpen:r,children:[e(me,{$gap:10,children:[t(pe,{size:he.XS,children:o}),n&&t($e,{text:n,withIcon:!0}),t(qe,{label:i.length,status:l?Fe.Default:void 0})]}),t(yt,{icon:r?Ba:Xa,size:Ct.M,onClick:()=>c(e=>!e)})]}),r?t(ee,{children:i.length?u.toArray(i):t(ft,{$padding:"12px 0",children:t(Re,{})})}):null]})},fc=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Xe(e.supportedSignals).includes(o.signalType))):e,bc=({option:e,formData:o,testResult:n,isSelected:i,onSelect:a})=>t(dc,{icon:wt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:i,onClick:()=>a(),children:n&&t(qe,{status:n.succeeded?Fe.Success:Fe.Error,leftIcon:n.succeeded?Ua:Va})}),vc=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:i,onChangeActiveForm:a}=Fl();return o?.length?t(gc,{title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:o.map((o,n)=>t(bc,{option:o,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=o.id&&""!==o.id?i?.option.id===o.id:i?.option.type===o.type),onSelect:()=>a({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(gc,{purpleColors:!0,title:xt[e].TITLE,tooltip:xt[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(bc,{option:o,formData:n,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var yc;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(yc||(yc={}));const Cc=(e,t)=>{const o=[],n=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===yc.SELF_HOSTED?n.push(...e.items):e.name===yc.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=Tt(n),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const n=Ne(t.fields,{});Object.keys(n).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[i]))}}}),{[bt.DETECTED]:o,[bt.SELF_HOSTED]:n,[bt.MANAGED]:i}},Sc=({onClose:e,onBack:o,onNext:n,selectedConnectionIds:l,setSelectedConnectionIds:c,initialInputs:d,withOverlay:p,disableAnimation:u})=>{const{destinationsApi:h}=Ll(),[m,g]=s(""),[f,b]=s({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:x}=h.usePotentialDestinations(),{activeForm:w,genericForm:T,unsavedDestinations:k,setUnsavedDestinations:E}=Fl();i(()=>{d&&E(d)},[d]);const I=C||x,N=a(()=>y?.destinationCategories?.categories??[],[y]),[$,O]=s({[bt.ALL]:[],[bt.UNSAVED]:[],[bt.EXISTS]:[],[bt.DETECTED]:[],[bt.SELF_HOSTED]:[],[bt.MANAGED]:[]});i(()=>{const e=v.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=Ne(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})):[]}});O(t=>({...t,[bt.EXISTS]:e}))},[v,N]),i(()=>{(y||S)&&O(e=>({...e,...Cc(y,S)}))},[y,S]);const A=r(async()=>{for(const{option:e,formData:t}of k){const o=Ue(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}=Fl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(vc,{listType:bt.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(bt)){if(i.categoryType&&i.categoryType!==e)continue;const l=fc(o[e],n,i);l.length&&a.push(t(vc,{listType:e,destinationOptions:l},e))}return e&&a.push(t(ft,{$height:"100%",children:t(St,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:I,destinationsByCategory:$,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Fl();return{width:"60%",list:e?[t(Xs,{},e.option.type)]:[t(ft,{$height:"100%",children:t(Re,{icon:za,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(br,{isOpen:!0,withOverlay:p,disableAnimation:u,onClose:e,onBack:o?()=>o(k):void 0,onNext:n?()=>n(k):void 0,nextIsSkip:!k.length,onSave:A,disableSave:!w&&!k.length,isFetching:I,isFormDirty:k.length>0||T?.isFormDirty,hideDirtyNote:!0,progress:{title:et.CREATING_DESTINATION,subTitle:et.CREATING_DESTINATION_SUBTITLE},header:{icon:za,title:et.ADD_DESTINATIONS,subTitle:et.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:l&&c?{value:l,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(uc,{destinationsByCategory:$,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},xc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:i})=>{const{instrumentationRulesApi:r}=Ll(),[c,d]=s(""),p=l(null),{selectedOption:u,onSelectOption:h,genericForm:m,validateFormData:g}=Ml(),{options:f,loading:b}=r.useRuleTypes(),v=a(()=>f.length?f:kt,[f]),y=a(()=>c?v.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):v,[v,c]),C=a(()=>b?[t(mt,{$padding:"8px 12px",children:t(gt,{size:4})},"loading")]:y.map(e=>{const o=u?.type===e.type;return t(dc,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{p.current?.clearErrors(),h(e)}},e.type)}),[b,u?.type,y,h]),S=a(()=>b?[t(mt,{$padding:"8px 12px",children:t(gt,{size:4})},"loading")]:u?[t(Ys,{},u.type)]:[t(ft,{$height:"100%",children:t(Re,{icon:Ha,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,u]);return t(br,{ref:p,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await r.create(t,u?.type)},disableSave:!u||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:et.CREATING_INSTRUMENTATION_RULE,subTitle:et.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ha,title:et.ADD_INSTRUMENTATION_RULE,subTitle:et.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},wc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:et.FETCHING_NAMESPACES,subTitle:et.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:et.SELECT_NAMESPACE,subTitle:et.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},Tc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Et.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"},kc=e=>e?Tc:wc,Ec="No matches",Ic=e=>(e?"Unselect":"Select")+" all",Nc="Selected",$c=b.div``,Oc=b.div`
172
172
  visibility: hidden;
173
173
 
174
174
  transition: visibility 0s;
@@ -176,19 +176,433 @@ 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
- ${mc}:hover & {
179
+ ${$c}:hover & {
180
180
  visibility: visible;
181
181
  }
182
- `,fc=({workloadName:e,workloadKind:o,isChecked:n,onToggle:i,disabled:a})=>{const l=b(),r=()=>{};return t(mc,{children:t(Ys,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:n,onCheckboxChange:a?r:i,children:a?t(Ee,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(Ye,{label:"Enterprise only",status:Le.Default,textSize:pe.XXXS})}):t(gc,{children:t(Ye,{label:o,status:Le.Info,textSize:pe.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},bc=f.div``,vc=f.div`
182
+ `,Ac=({workloadName:e,workloadKind:o,isChecked:n,onToggle:i,disabled:a})=>{const l=v(),r=()=>{};return t($c,{children:t(dc,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:n,onCheckboxChange:a?r:i,children:a?t($e,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(qe,{label:"Enterprise only",status:Fe.Default,textSize:he.XXXS})}):t(Oc,{children:t(qe,{label:o,status:Fe.Info,textSize:he.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},Rc=b.div``,Dc=b.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
- ${bc}:hover & {
188
+ ${Rc}:hover & {
189
189
  visibility: visible;
190
190
  }
191
- `,yc=({clusterId:o,namespaceName:n,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=C(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(bc,{children:t(Ys,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(he,{$gap:12,children:[!d&&t(vc,{$visible:r||a,children:t(Ee,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ae,{label:"Auto",labelAlign:le.Left,size:It.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(he,{$gap:8,children:[t(de,{variant:Et.Span,size:pe.XXXS,color:ue.Secondary,align:"right",children:hc}),t(Ye,{label:`${l.sourced}/${l.total}`,status:r?Le.Default:Le.Unknown,minWidth:"42px"})]})]})})})},Cc=({withCollapse:e,clusterId:o,clusterName:n,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=i(()=>a.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(yc,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,a,l]);return e?t(ec,{title:n,list:c,noBgColor:!0}):c},Sc=({onClose:o,onBack:a,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=C(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=kl(),{data:f,loading:b,refetch:v}=m.useSnapshots(),{items:y,loading:S,refetch:w}=g.useNamespaces(),x=dc(p),{selectedStreamName:k}=et(),{progress:T,resetProgress:$}=Nt(),{isFetching:I,setIsFetching:E,setSnapshots:N,formData:A,handleSourceChange:O,handleSelectAll:R,formDiff:D,isFormDirty:P}=Fl();n(()=>{v(),w()},[]);const F=i(()=>{if(f)return f;const e=y;return e.length?{clusters:[{clusterId:Ot,clusterName:At,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),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(k)??!1)}))||[]}))}]}:null},[f,y,k]);n(()=>{E(b||S),F&&N(F)},[F,b,S,E,N]);const[L,M]=r(""),[_,z]=r(Tt.Namespace),[B,X]=r({showOnlySelected:!1}),[V,U]=r({clusterId:"",clusterName:"",namespaceName:""}),G=(({isFetching:o,formData:n,handleSourceChange:a,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=C(),h=dc(p),m=i(()=>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,...Pl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),g=i(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:y}=i(()=>{const e=m.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Cc,{withCollapse:m.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:a},e):null).filter(e=>null!==e),o=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),i=n.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:o!==i,filteredCount:o,totalCount:i}},[m,n,r]);return{width:"60%",header:e(he,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(he,{$gap:8,children:[t(de,{size:pe.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ee,{text:b?Qe.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ye,{label:`${b?`${v} / ${y}`:y}`,status:Le.Unknown})})]}),t(de,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:pe.XS,children:pc(g)})]}),list:f.length?f:o?[t(gt,{$height:"100%",children:t(Ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(gt,{$height:"100%",children:t(Oe,c?{icon:za,title:uc,subTitle:h.noGroupMatchedFilter(c)}:{icon:za,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:A,handleSourceChange:O,handleSelectAll:R,selectedArea:V,setSelectedArea:U,searchText:_===Tt.Namespace?L:"",searchBy:_,filters:B}),H=(({formData:o,handleSourceChange:n,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=C(),p=dc(u),h=d===$t.Onprem,m=i(()=>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]),g=i(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ol(e,r,c)):[],[m,r,c]),f=i(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=i(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:o}=m;return g.map(({name:i,selected:a,kind:l})=>{const r=!u&&!h&&Rl.has(l);return t(fc,{workloadName:i,workloadKind:l,isChecked:!r&&(a||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:i,kind:l}}),disabled:r},`${e}#${o}#${i}#${l}`)})},[g,m,l.value.clusterId]),{withFilterCount:v,filteredCount:y,totalCount:S}=i(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(he,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(he,{$gap:8,children:[t(de,{size:pe.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(Ee,{text:v?Qe.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ye,{label:`${v?`${y} / ${S}`:S}`,status:Le.Unknown})})]}),t(de,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:pe.XS,children:pc(f)})]}),list:b.length?b:[t(gt,{$height:"100%",children:t(Oe,m?r?{icon:_a,title:uc,subTitle:(w=r,`No sources matched the filter '${w}'`)}:{icon:_a,title:"No sources",subTitle:p.noItemsInGroupSubTitle}:{icon:_a,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]};var w})({formData:A,handleSourceChange:O,handleSelectAll:R,selectedArea:{value:V},searchText:_===Tt.Source?L:"",searchBy:_,filters:B});return t(nr,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{$(Rt.BulkInstrumenting),o()}:void 0,onBack:a?()=>a(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:_a,title:Qe.ADD_SOURCE,subTitle:Qe.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{M(e),_===Tt.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:x.searchPlaceholder(_),segment:{options:[{label:x.groupSegmentLabel,value:Tt.Namespace},{label:x.itemSegmentLabel,value:Tt.Source}],selected:_,setSelected:z}},filters:e(he,{$gap:8,children:[t(de,{size:pe.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(ae,{name:"filter-selected",size:It.S,label:hc,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:I,progress:{title:Qe.CREATING_SOURCES,subTitle:Qe.CREATING_SOURCES_SUBTITLE,percentage:T[Rt.BulkInstrumenting]?.percentage||0},leftColumn:G,rightColumn:H})},wc=(e,t)=>{const o=[{id:"type",title:Qe.TYPE,label:t.label},{id:"status",title:Qe.STATUS,badge:{status:e.disabled?Le.Unknown:Le.Success,label:e.disabled?Qe.DISABLED:Qe.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:Qe.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Qe.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Qe.NOTES,label:e.notes}),o},xc=({onClose:a,actionId:s})=>{const c=b(),{isVm:d}=C(),{actionsApi:u}=kl(),{items:p,refetch:h}=u.useActions(),{options:m}=u.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:v,genericForm:y}=xl();n(()=>{h()},[]);const[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(null),I=S&&!!y?.isFormDirty,E=i(()=>p?.find(e=>Dt(e)===s),[s,p]),N=i(()=>m.find(({type:e})=>e===E?.type)??Pt.find(({type:e})=>e===E?.type)??null,[m,E?.type]);n(()=>{E&&f(E,N)},[E,N]);const A=l(()=>{E&&w(!0)},[E]),O=l(()=>{E&&(f(E,N),w(!1))},[E,N,f]),R=l(()=>{I?$("close"):a()},[I,a]),D=l(()=>{I?$("cancel"):O()},[I,O]),P=l(()=>{const e=T;$(null),"close"===e?(O(),a()):O()},[T,O,a]),F=l(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=v();e||(await u.update(E.id,t),w(!1))}},[E,v,u]),L=l(()=>{E&&k(!0)},[E]),M=l(async()=>{E&&(await u.remove(E.id,E.type),a())},[E,u,a]);if(!E||!N)return null;const _=(e=>{const t=[],{type:o,fields:n}=e,i=e=>({status:e?Le.Success:Le.Unknown,label:e?"True":"False",invertColors:!0});if(o===Ae.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:i(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:i(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:i(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:i(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ie.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:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ie.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===Ae.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:i(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===Ae.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===Ae.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:i,regex:a},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}),i&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:i}),a&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:a})})}return o===Ae.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const i=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${i}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,a)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${a}`,title:`${i}Workload${(e.workloadFilters?.length??0)>1?` #${a+1}`:""}`,label:l})});const a=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");a&&t.push({id:`group-${o}-templates`,title:`${i}Templates`,label:a}),e.notes&&t.push({id:`group-${o}-notes`,title:`${i}Notes`,label:e.notes})}),t})(E);return e(o,{children:[t(se,{isOpen:!0,header:{icon:_t(E.type),title:N.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:Ia,active:S,onClick:A},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ca,color:c.v2.colors.red[500],active:x,onClick:L}]},footer:{actions:S?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:fe.Primary,onClick:F}]:[]},children:t(ht,{$padding:"4px 12px 12px",children:S&&g?t(xs,{}):t(Q,{$gap:16,children:e(Lt,{bgTint:"1000",children:[e(Lt,{bgTint:"900",children:[!d&&t(Mt,{conditions:E.conditions||[]}),t(Lt,{bgTint:"800",cellsPerRow:2,items:wc(E,N)})]}),!!_?.length&&t(Lt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Lt,{bgTint:"800",cellsPerRow:2,items:_})})]})})})}),t(ir,{target:"action",isOpen:x,onClose:()=>k(!1),onApprove:M}),t(ar,{isOpen:null!==T,onClose:()=>$(null),onApprove:P})]})},kc=({onClose:o,connections:l,selectedConnectionIds:s,setSelectedConnectionIds:c})=>{const{configApi:d}=kl(),[u,p]=r(""),[h,m]=r({showOnlySelected:!1}),g=i(()=>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}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=i(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=zt(C||{rollout:{automaticRolloutDisabled:!1}}),T=a(k);T.current=k,n(()=>{C&&T.current(C)},[C]);const $=i(()=>s.length>1||void 0!==C&&!x(C,S),[s.length,C,S]);return t(nr,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,s))??void 0,header:{icon:Ba,title:"Cluster Configuration"},connectionIds:{value:s,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(he,{$gap:8,children:[t(de,{size:pe.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(ae,{size:It.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:y,leftColumn:{width:"35%",header:e(he,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(he,{$gap:8,children:[t(de,{size:pe.XS,children:"Clusters"}),t(Ye,{label:g.length,status:Le.Unknown})]}),e(he,{$gap:8,children:[t(de,{size:pe.XXXS,color:ue.Secondary,align:"right",children:"Selected clusters"}),t(Ye,{label:`${s.length}/${g.length}`,status:Le.Unknown})]})]}),list:g.map(e=>t(Ys,{title:e.name,isChecked:s.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(de,{size:pe.XS,children:"Configurations"}),list:[t(ae,{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")]}})},Tc=e=>{const t=[{id:"type",title:Qe.TYPE,label:e.destinationType.displayName},{id:"status",title:Qe.STATUS,badge:{status:e.disabled?Le.Unknown:Le.Success,label:e.disabled?Qe.DISABLED:Qe.ENABLED}}],o=ze(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:Qe.MONITORS,label:o}),e.name&&t.push({id:"name",title:Qe.NAME,label:e.name}),t},$c=({onClose:s,destinationId:c})=>{const d=b(),{isVm:u}=C(),{destinationsApi:p}=kl(),{selectedStreamName:h}=et(),{items:m,refetch:g}=p.useDestinations(),{data:f,loading:v}=p.useDestinationCategories(),{activeForm:y,loadDestination:S,validateFormData:w,genericForm:x}=Tl();n(()=>{g()},[]);const k=a(null),[T,$]=r(!1),[I,E]=r(!1),[N,A]=r(null),O=T&&!!x?.isFormDirty,R=i(()=>Xt(m,h),[m,h]),D=i(()=>R?.find(e=>Dt(e)===c),[c,R]),P=f?.destinationCategories?.categories??null;n(()=>{D&&P&&S(D,P)},[D,P]);const F=i(()=>D&&P?Vt(P,D):[],[D,P]),L=l(()=>{D&&$(!0)},[D]),M=l(()=>{D&&P&&(S(D,P),$(!1))},[D,P,S]),_=l(()=>{O?A("close"):s()},[O,s]),z=l(()=>{O?A("cancel"):M()},[O,M]),B=l(()=>{const e=N;A(null),"close"===e?(M(),s()):M()},[N,M,s]),X=l(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=w();e||(await p.update(D.id,Xe(t)),$(!1))}},[D,w,p]),V=l(()=>{D&&E(!0)},[D]),U=l(async()=>{D&&(await p.remove(D.id),s())},[D,p,s]);if(!D)return null;const{icon:G,iconSrc:H}=wt(D.destinationType.type),j=((e,t)=>{const o=[],n=Bt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=ze(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:m}=c||{};if(h?.length&&$e(h,a,i))return;const{type:g}=Ie(p,{type:""}),f=d||"password"===g;if(m?.length)m.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===Te.MultiInput){const t=Ie(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===Te.KeyValuePair){const t=Ie(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})(D,F);return e(o,{children:[t(se,{isOpen:!0,header:{icon:G,iconSrc:H,title:D.name||D.destinationType.displayName,onClose:_,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:Ia,active:T,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ca,color:d.v2.colors.red[500],active:I,onClick:V}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:z},...y?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:fe.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:fe.Primary,onClick:X}]:[]},children:t(ht,{$padding:"4px 12px 12px",children:v?t(gt,{$height:"50vh",children:t(Ct,{withSpinner:!0})}):T&&y?t($s,{ref:k,isEdit:!0}):t(Q,{$gap:16,children:e(Lt,{bgTint:"1000",children:[e(Lt,{bgTint:"900",children:[!u&&t(Mt,{conditions:D.conditions||[]}),t(Lt,{bgTint:"800",cellsPerRow:2,items:Tc(D)})]}),!!j.length&&t(Lt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:j.map(e=>"cells"===e.kind?t(Lt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Lt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(ir,{target:"destination",isOpen:I,onClose:()=>E(!1),onApprove:U}),t(ar,{isOpen:null!==N,onClose:()=>A(null),onApprove:B})]})},Ic=(e,t)=>{const o=[{id:"type",title:Qe.TYPE,label:t.label},{id:"status",title:Qe.STATUS,badge:{status:e.disabled?Le.Unknown:Le.Success,label:e.disabled?Qe.DISABLED:Qe.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Qe.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Qe.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Qe.NOTES,label:e.notes}),o},Ec=({onClose:a,ruleId:s})=>{const c=b(),{addNotification:d}=Gt(),{isVm:u}=C(),{instrumentationRulesApi:p}=kl(),{items:h,refetch:m}=p.useRules(),{selectedOption:g,loadRule:f,validateFormData:v,genericForm:y}=$l();n(()=>{m()},[]);const[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(null),I=S&&!!y?.isFormDirty,E=i(()=>h?.find(e=>Dt(e)===s),[s,h]),N=i(()=>kt.find(({type:e})=>e===E?.type)??null,[E?.type]);n(()=>{E&&f(E)},[E]);const A=l(()=>{if(E){if(!E.mutable)return void d({type:Le.Warning,title:Ht.FORBIDDEN,message:Ht.CANNOT_EDIT_RULE,crdType:Tt.InstrumentationRule,target:E.ruleId,hideFromHistory:!0});w(!0)}},[E,d]),O=l(()=>{E&&(f(E),w(!1))},[E,f]),R=l(()=>{I?$("close"):a()},[I,a]),D=l(()=>{I?$("cancel"):O()},[I,O]),P=l(()=>{const e=T;$(null),"close"===e?(O(),a()):O()},[T,O,a]),F=l(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=v();e||(await p.update(E.ruleId,t,E.type),w(!1))}},[E,v,p]),L=l(()=>{if(E){if(!E.mutable)return void d({type:Le.Warning,title:Ht.FORBIDDEN,message:Ht.CANNOT_DELETE_RULE,crdType:Tt.InstrumentationRule,target:E.ruleId,hideFromHistory:!0});k(!0)}},[E,d]),M=l(async()=>{E&&(await p.remove(E.ruleId,E.type),a())},[E,p,a]);if(!E||!N)return null;const _=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(de,{size:pe.XS,children:`• ${Ut(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(de,{size:pe.XS,children:`• ${Ut(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Ue.HeaderKeys]?.length&&e.headersCollection[Ue.HeaderKeys].forEach((e,o)=>{e&&n.push(t(de,{size:pe.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[We.Java]?.forEach((e,i)=>{const a=new je(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(de,{size:pe.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(de,{size:pe.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[We.Golang]?.forEach((e,i)=>{const a=new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(de,{size:pe.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(de,{size:pe.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})(E,c);return e(o,{children:[t(se,{isOpen:!0,header:{icon:Wt(E.type),title:N.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:Ia,active:S,onClick:A},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ca,color:c.v2.colors.red[500],active:x,onClick:L}]},footer:{actions:S?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:fe.Primary,onClick:F}]:[]},children:t(ht,{$padding:"4px 12px 12px",children:S&&g?t(Ps,{}):t(Q,{$gap:16,children:e(Lt,{bgTint:"1000",children:[e(Lt,{bgTint:"900",children:[!u&&t(Mt,{conditions:E.conditions||[]}),t(Lt,{bgTint:"800",cellsPerRow:2,items:Ic(E,N)})]}),!u&&t(Wl,{readOnly:!0,scopes:E.sourceScopes??null}),!!_.length&&t(Lt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Lt,{bgTint:"800",children:_})}),!!N.supportedLanguages.length&&t(Lt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Lt,{bgTint:"800",children:t(he,{$gap:12,$wrap:"wrap",children:N.supportedLanguages.map(e=>t(jt,{label:qe[e],leftIcon:Je(e),flex:"0.5"},e))})})})]})})})}),t(ir,{target:"instrumentation rule",isOpen:x,onClose:()=>k(!1),onApprove:M}),t(ar,{isOpen:null!==T,onClose:()=>$(null),onApprove:P})]})};var Nc;(e=>{e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Nc||(Nc={}));const Ac=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Kt(),m=Yt(!!o),g=i(()=>({title:l,icon:Xa,withCopy:!0}),[l]),f=i(()=>{const e=[],t=qt(c);t&&e.push(t);const o=qt(d,Va,"health");o&&e.push(o);const n=qt(u,Ua,"health");return n&&e.push(n),e},[c,d,u]),b=i(()=>n?[{id:`restart-pod-${l}`,icon:Ga,label:Ft.RESTART_POD,onClick:()=>n(a,l)}]:void 0,[n,a,l]),v=i(()=>[{id:"nodeName",title:Qe.NODE,label:r,withCopy:!0},{id:"age",title:Qe.AGE,label:s?h(s,{style:"short"}):Qe.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Lt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Oc=f.div`
191
+ `,_c=({clusterId:o,namespaceName:n,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isK8s:d}=S(),p=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Rc,{children:t(dc,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>p({auto:e,all:e}),children:e(me,{$gap:12,children:[d&&t(Dc,{$visible:r||a,children:t($e,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(le,{label:"Auto",labelAlign:re.Left,size:Nt.S,value:a,onChange:e=>p({auto:e,all:e||void 0})})})}),e(me,{$gap:8,children:[t(pe,{variant:$t.Span,size:he.XXXS,color:ue.Secondary,align:"right",children:Nc}),t(qe,{label:`${l.sourced}/${l.total}`,status:r?Fe.Default:Fe.Unknown,minWidth:"42px"})]})]})})})},Pc=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:p})=>t(_c,{clusterId:o,namespaceName:e,isFutureApps:p,checkbox:{all:c||p,partial:d},selectedCounts:{sourced:a,total:i},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(gc,{title:n,list:c,noBgColor:!0}):c},Lc=({onClose:o,onBack:n,onNext:l,selectedConnectionIds:r,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:p})=>{const{isVm:u,isConnector:h}=S(),{sourcesApi:m,snapshotsApi:g,namespacesApi:f}=Ll(),{data:b,loading:v,refetch:y}=g.useSnapshots(),{items:C,loading:x,refetch:w}=f.useNamespaces(),T=kc(u||!!h),{selectedStreamName:k}=tt(),{progress:E,resetProgress:I}=Ot(),{isFetching:N,setIsFetching:$,setSnapshots:O,formData:A,handleSourceChange:R,handleSelectAll:D,formDiff:_,isFormDirty:P}=Wl();i(()=>{y(),w()},[]);const L=a(()=>{if(b)return b;const e=C;return e.length?{clusters:[{clusterId:Rt,clusterName:At,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,region:e.id.region,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[b,C,k]);i(()=>{$(v||x),L&&O(L)},[L,v,x,$,O]);const[F,M]=s(""),[z,B]=s(Et.Namespace),[X,U]=s({showOnlySelected:!1}),[V,H]=s({clusterId:"",clusterName:"",namespaceName:""}),j=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:p})=>{const{isVm:u,isConnector:h}=S(),m=kc(u||!!h),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>jl(e,c,p)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Gl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,p]),f=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:b,withFilterCount:v,filteredCount:y,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Pc,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null).filter(e=>null!==e),o=g.reduce((e,{visibleNamespaces:t})=>e+t.length,0),a=n.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:o!==a,filteredCount:o,totalCount:a}},[g,n,r]);return{width:"60%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,nowrap:!0,children:m.groupColumnHeader}),t($e,{text:v?et.FILTERED_COUNT_TOOLTIP:void 0,children:t(qe,{label:`${v?`${y} / ${C}`:C}`,status:Fe.Unknown})})]}),t(pe,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!f,searchText:c,searchBy:d,filters:p}),disabled:!b.length,size:he.XS,children:Ic(f)})]}),list:b.length?b:o?[t(ft,{$height:"100%",children:t(St,{title:m.fetchingGroups.title,subTitle:m.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(ft,{$height:"100%",children:t(Re,c?{icon:Ga,title:Ec,subTitle:m.noGroupMatchedFilter(c)}:{icon:Ga,title:m.noGroups.title,subTitle:m.noGroups.subTitle})},"no-data")]}})({isFetching:N,formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:V,setSelectedArea:H,searchText:z===Et.Namespace?F:"",searchBy:z,filters:X}),G=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:p,isConnector:u,isK8s:h}=S(),m=kc(p||!!u),g=d===It.Onprem,f=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]),b=a(()=>f?[...f.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Vl(e,r,c)):[],[f,r,c]),v=a(()=>!!b.length&&b.every(({selected:e})=>e),[b]),y=a(()=>{if(!f)return[];const{clusterId:e}=l.value,{name:o}=f;return b.map(({name:i,selected:a,kind:l,region:r})=>{const s=h&&!g&&Hl.has(l);return t(Ac,{workloadName:i,workloadKind:l,isChecked:!s&&(a||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:i,kind:l,region:r}}),disabled:s},`${e}#${o}#${i}#${l}#${r??""}`)})},[b,f,l.value.clusterId,n,h,g]),{withFilterCount:C,filteredCount:x,totalCount:w}=a(()=>{const e=f?.workloads.length??0;return{withFilterCount:b.length!==e,filteredCount:b.length,totalCount:e}},[b,f]);return{width:"40%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${m.itemColumnHeader}`:m.itemColumnHeader}),t($e,{text:C?et.FILTERED_COUNT_TOOLTIP:void 0,children:t(qe,{label:`${C?`${x} / ${w}`:w}`,status:Fe.Unknown})})]}),t(pe,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!v,searchText:r,searchBy:s,filters:c}),disabled:!y.length,size:he.XS,children:Ic(v)})]}),list:y.length?y:[t(ft,{$height:"100%",children:t(Re,f?r?{icon:ja,title:Ec,subTitle:(T=r,`No sources matched the filter '${T}'`)}:{icon:ja,title:"No sources",subTitle:m.noItemsInGroupSubTitle}:{icon:ja,title:m.selectGroupPrompt.title,subTitle:m.selectGroupPrompt.subTitle})},"no-data")]};var T})({formData:A,handleSourceChange:R,handleSelectAll:D,selectedArea:{value:V},searchText:z===Et.Source?F:"",searchBy:z,filters:X});return t(br,{isOpen:!0,withOverlay:d,disableAnimation:p,onClose:o?()=>{I(Dt.BulkInstrumenting),o()}:void 0,onBack:n?()=>n(_):void 0,onNext:l?()=>l(_):void 0,nextIsSkip:!P,onSave:()=>m.persistV2(_),header:{icon:ja,title:et.ADD_SOURCE,subTitle:et.ADD_SOURCES_DESCRIPTION},connectionIds:r&&c?{value:r,setValue:c}:void 0,search:{value:F,onChange:e=>{M(e),z===Et.Namespace&&H({clusterId:"",clusterName:"",namespaceName:""})},placeholder:T.searchPlaceholder(z),segment:{options:[{label:T.groupSegmentLabel,value:Et.Namespace},{label:T.itemSegmentLabel,value:Et.Source}],selected:z,setSelected:B}},filters:e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(le,{name:"filter-selected",size:Nt.S,label:Nc,value:X.showOnlySelected,onChange:e=>U(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:N,progress:{title:et.CREATING_SOURCES,subTitle:et.CREATING_SOURCES_SUBTITLE,percentage:E[Dt.BulkInstrumenting]?.percentage||0},leftColumn:j,rightColumn:G})},Fc={aws:Wa},Mc={lambda:"Lambda","fargate-task":"ECS","fargate-cluster":"ECS","ecs-cluster":"ECS",eks:"EKS",ec2:"EC2"},zc=e=>e.split(/[-_]/).map(e=>e?e[0].toUpperCase()+e.slice(1):e).join(" "),Bc=e=>e.provider.toUpperCase(),Xc=b.div`
192
+ display: flex;
193
+ flex-direction: column;
194
+ gap: 8px;
195
+ width: 100%;
196
+ padding: 8px 12px;
197
+ border-radius: 16px 0 0 16px;
198
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
199
+ `,Uc=b.button`
200
+ display: flex;
201
+ align-items: center;
202
+ gap: 12px;
203
+ width: 100%;
204
+ padding: 12px 8px 12px 4px;
205
+ border: none;
206
+ border-radius: 8px;
207
+ cursor: pointer;
208
+ text-align: left;
209
+ background-color: ${({theme:e,$selected:t})=>Boolean(t)?e.v2.colors.silver[800]:e.v2.colors.silver[900]};
210
+ transition: background-color 0.15s ease;
211
+
212
+ &:hover {
213
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
214
+ }
215
+ `,Vc=b.div`
216
+ display: flex;
217
+ align-items: center;
218
+ justify-content: center;
219
+ width: 36px;
220
+ height: 36px;
221
+ border-radius: 8px;
222
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
223
+ flex-shrink: 0;
224
+ `,Hc=b.div`
225
+ display: flex;
226
+ flex-direction: column;
227
+ gap: 2px;
228
+ flex: 1;
229
+ min-width: 0;
230
+ `,jc=({providers:o,selectedProvider:n,onSelect:i})=>{const a=v();return o.length?t(Xc,{children:o.map(o=>{const l=(e=>Fc[e.provider]??Ka)(o),r=o.provider===n,s=(e=>{const t=e.features.find(e=>e.key===_t.Discovery);if(!t)return"";const o=[],n=new Set;for(const e of t.types){const t=e.name.includes(".")?e.name.slice(e.name.indexOf(".")+1):e.name,i=Mc[t]??zc(t);n.has(i)||(n.add(i),o.push(i))}return o.join(", ")})(o);return e(Uc,{type:"button",$selected:r,onClick:()=>i(o.provider),"data-id":`cloud-connector-provider-${o.provider}`,children:[t(Vc,{children:t(l,{size:24})}),e(Hc,{children:[t(pe,{size:he.S,weight:400,lineHeight:"24px",color:ue.Primary,children:Bc(o)}),s&&t(pe,{size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:s})]}),t(Fa,{size:18,fill:a.v2.colors.silver[300]})]},o.provider)})}):t(pe,{size:he.XS,color:ue.Secondary,children:"No providers available."})},Gc=b.div`
231
+ display: flex;
232
+ flex-direction: column;
233
+ gap: 8px;
234
+ width: 100%;
235
+ padding: 8px;
236
+ border-radius: 12px;
237
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
238
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
239
+ cursor: default;
240
+ `,Wc=b.div`
241
+ display: flex;
242
+ align-items: center;
243
+ gap: 4px;
244
+ width: 100%;
245
+ `,Kc=b.div`
246
+ flex: 1;
247
+ min-width: 0;
248
+ `,Yc=b.div`
249
+ width: 100%;
250
+ max-height: 145px;
251
+ overflow: auto;
252
+ padding: 0 12px;
253
+
254
+ scrollbar-width: thin;
255
+ scrollbar-color: transparent transparent;
256
+
257
+ &::-webkit-scrollbar {
258
+ width: 10px;
259
+ height: 10px;
260
+ }
261
+
262
+ &::-webkit-scrollbar-thumb {
263
+ border: 2px solid transparent;
264
+ border-radius: 8px;
265
+ background-color: transparent;
266
+ background-clip: padding-box;
267
+ transition: background-color 0.2s ease;
268
+ }
269
+
270
+ ${Gc}:hover & {
271
+ scrollbar-color: ${({theme:e})=>e.v2.colors.silver[300]} transparent;
272
+ }
273
+
274
+ ${Gc}:hover &::-webkit-scrollbar-thumb {
275
+ background-color: ${({theme:e})=>e.v2.colors.silver[300]};
276
+ }
277
+ `,qc=b.pre`
278
+ margin: 0;
279
+ font-family: ${({theme:e})=>e.font_family.code};
280
+ font-size: 12px;
281
+ line-height: 20px;
282
+ color: ${({theme:e})=>e.v2.colors.green[400]};
283
+ white-space: pre;
284
+ `,Jc=({policy:o})=>{const n=v(),{CopyButton:i}=Pt();return e(Gc,{children:[e(Wc,{children:[t(Ya,{size:16,fill:n.v2.colors.silver[200]}),t(Kc,{children:t(pe,{size:he.XXS,color:ue.Primary,children:et.CLOUD_CONNECTOR_POLICY_PREVIEW})}),t(i,{value:o,size:Ct.XS})]}),t(Yc,{children:t(qc,{children:o})})]})};var Zc;(e=>{e.DiscoveryOnly="discovery-only",e.DiscoveryInstrumentation="discovery-instrumentation",e.Custom="custom"})(Zc||(Zc={}));const Qc=[{id:Zc.DiscoveryOnly,title:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_TITLE,description:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_ONLY_DESC,featureKeys:[_t.Discovery]},{id:Zc.DiscoveryInstrumentation,title:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_TITLE,description:et.CLOUD_CONNECTOR_PERMISSION_DISCOVERY_INSTRUMENTATION_DESC,featureKeys:[_t.Discovery,_t.Instrumentation]},{id:Zc.Custom,title:et.CLOUD_CONNECTOR_PERMISSION_CUSTOM_TITLE,description:et.CLOUD_CONNECTOR_PERMISSION_CUSTOM_DESC,featureKeys:[]}],ed=(e,t)=>e.features?.find(e=>e.key===t),td=e=>{if(!e)return[];const t=ed(e,_t.Discovery),o=ed(e,_t.Instrumentation);return t?t.types.map(e=>{const t=o?.types.find(t=>t.name===e.name);return{typeName:e.name,displayName:e.displayName||e.name,discoveryPermissions:e.permissions??[],instrumentationPermissions:t?t.permissions??[]:void 0}}):[]},od=()=>{const e=new Set,t=[];return{out:t,add:o=>o?.forEach(o=>{o&&!e.has(o)&&(e.add(o),t.push(o))})}},nd=(e,t,o)=>{const n=t===Zc.Custom?((e,t)=>{if(!e)return[];const o=td(e),n=ed(e,_t.Discovery),i=o.some(e=>t[e.typeName]?.discovery),{out:a,add:l}=od();return l(e.auth?.permissions),i&&l(n?.permissions),o.forEach(e=>{const o=t[e.typeName];o?.discovery&&l(e.discoveryPermissions),o?.instrumentation&&l(e.instrumentationPermissions)}),a})(e,o??{}):((e,t)=>{if(!e)return[];const o=Qc.find(e=>e.id===t)?.featureKeys??[],{out:n,add:i}=od();return i(e.auth?.permissions),e.features?.forEach(e=>{e.enabled&&o.includes(e.key)&&(i(e.permissions),e.types?.forEach(e=>{!1!==e.implemented&&i(e.permissions)}))}),n})(e,t),i={Version:"2012-10-17",Statement:[{Sid:"OdigosCloudConnector",Effect:"Allow",Action:n,Resource:"*"}]};return JSON.stringify(i,null,2)},id=b.div`
285
+ width: 100%;
286
+ padding: 12px 16px;
287
+ border-radius: 12px;
288
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
289
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
290
+ `,ad=b.div`
291
+ display: grid;
292
+ grid-template-columns: minmax(0, 1fr) 120px 150px;
293
+ align-items: center;
294
+ row-gap: 16px;
295
+ column-gap: 8px;
296
+ `,ld=b.div`
297
+ display: flex;
298
+ align-items: center;
299
+ min-width: 0;
300
+ `,rd=b(ld)`
301
+ justify-content: center;
302
+ `,sd={discovery:!1,instrumentation:!1},cd=({provider:o,capabilities:i,onCapabilitiesChange:a})=>{const l=td(o),r=(e,t)=>{a({...i,[e]:t})};return l.length?t(id,{children:e(ad,{children:[t(ld,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:et.CLOUD_CONNECTOR_CUSTOM_COL_TYPE})}),t(rd,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:et.CLOUD_CONNECTOR_CUSTOM_COL_DISCOVERY})}),t(rd,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:et.CLOUD_CONNECTOR_CUSTOM_COL_INSTRUMENTATION})}),l.map(o=>{const a=i[o.typeName]??sd,l=void 0!==o.instrumentationPermissions,s=a.instrumentation||a.discovery;return e(n.Fragment,{children:[t(ld,{children:t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Primary,children:o.displayName})}),t(rd,{children:t(le,{name:`cloud-connector-custom-${o.typeName}-discovery`,size:Nt.S,value:s,disabled:a.instrumentation,onChange:e=>r(o.typeName,{discovery:e,instrumentation:a.instrumentation})})}),t(rd,{children:t(le,{name:`cloud-connector-custom-${o.typeName}-instrumentation`,size:Nt.S,value:a.instrumentation,disabled:!l,onChange:e=>r(o.typeName,{discovery:!!e||a.discovery,instrumentation:e})})})]},o.typeName)})]})}):null},dd=b.div`
303
+ display: flex;
304
+ flex-direction: column;
305
+ gap: 8px;
306
+ flex: 1;
307
+ min-width: 0;
308
+ padding: 8px;
309
+ border-radius: 0 16px 16px 0;
310
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
311
+ `,pd=b.div`
312
+ display: flex;
313
+ flex-direction: column;
314
+ gap: 8px;
315
+ width: 100%;
316
+ `,ud=b.div`
317
+ display: flex;
318
+ align-items: center;
319
+ gap: 10px;
320
+ width: 100%;
321
+ padding: 4px 12px 4px 4px;
322
+ border-radius: 8px;
323
+ background-color: ${({theme:e})=>e.v2.colors.purple[900]};
324
+ `,hd=b.div`
325
+ display: flex;
326
+ align-items: center;
327
+ justify-content: center;
328
+ width: 36px;
329
+ height: 36px;
330
+ border-radius: 6px;
331
+ flex-shrink: 0;
332
+ background-color: ${({theme:e})=>e.v2.colors.purple[800]};
333
+ `,md=({message:o})=>{const n=v();return e(ud,{children:[t(hd,{children:t(qa,{size:24})}),t(pe,{size:he.XXS,color:n.v2.colors.purple[300],children:o})]})},gd=({provider:o,selectedPermission:n,onSelect:i,capabilities:a,onCapabilitiesChange:l})=>t(dd,{children:Qc.map(r=>{const s=r.id===n,c=r.id===Zc.Custom,d=s?e(pd,{children:[c&&t(cd,{provider:o,capabilities:a,onCapabilitiesChange:l}),t(Jc,{policy:nd(o,r.id,a)})]}):void 0,p=s?t(md,{message:c?et.CLOUD_CONNECTOR_POLICY_NOTE_CUSTOM:et.CLOUD_CONNECTOR_POLICY_NOTE}):void 0;return t(Lt,{"data-id":`cloud-connector-permission-${r.id}`,title:r.title,description:r.description,checked:s,onChange:()=>i(r.id),body:d,footerNote:p},r.id)})}),fd=b.div`
334
+ display: flex;
335
+ flex-direction: column;
336
+ padding: 16px;
337
+ `,bd=b.div`
338
+ display: flex;
339
+ flex-direction: column;
340
+ gap: 16px;
341
+ padding: 16px;
342
+ border-radius: 16px;
343
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
344
+ `,vd=b.div`
345
+ display: flex;
346
+ flex-direction: column;
347
+ gap: 4px;
348
+ `,yd=b.div`
349
+ display: flex;
350
+ align-items: stretch;
351
+ width: 100%;
352
+ `,Cd=b.div`
353
+ display: flex;
354
+ flex: 0 0 40%;
355
+ min-width: 0;
356
+ `,Sd=()=>{const{providers:o,genericForm:n}=Kl(),[l,r]=s(!0),c=a(()=>o.find(e=>e.provider===n.formData.provider),[o,n.formData.provider]);return i(()=>{!n.formData.provider&&o.length>0&&n.handleFormChange("provider",o[0].provider)},[o,n.formData.provider,n]),i(()=>{n.formData.permission||n.handleFormChange("permission",Zc.DiscoveryInstrumentation)},[n.formData.permission,n]),t(fd,{children:e(bd,{children:[e(vd,{children:[t(pe,{size:he.S,weight:500,lineHeight:"24px",color:ue.Primary,children:et.CLOUD_CONNECTOR_SELECT_PROVIDER_TITLE}),t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:et.CLOUD_CONNECTOR_SELECT_PROVIDER_SUBTITLE})]}),l&&t(Le,{fullWidth:!0,smallIcon:!0,status:Fe.Info,message:et.CLOUD_CONNECTOR_PERMISSIONS_NOTE,action:{"data-id":"cloud-connector-permissions-note-close",label:Ft.CLOSE,onClick:()=>r(!1)}}),e(yd,{children:[t(Cd,{children:t(jc,{providers:o,selectedProvider:n.formData.provider,onSelect:e=>n.handleFormChange("provider",e)})}),t(gd,{provider:c,selectedPermission:n.formData.permission,onSelect:e=>n.handleFormChange("permission",e),capabilities:n.formData.customCapabilities,onCapabilitiesChange:e=>n.handleFormChange("customCapabilities",e)})]})]})})},xd=b.div`
357
+ display: flex;
358
+ flex-direction: column;
359
+ gap: 16px;
360
+ width: 100%;
361
+ padding: 12px;
362
+ border-radius: 8px;
363
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
364
+ `,wd=b.div`
365
+ display: flex;
366
+ align-items: center;
367
+ gap: 12px;
368
+ width: 100%;
369
+ `,Td=b.div`
370
+ display: flex;
371
+ align-items: center;
372
+ justify-content: center;
373
+ flex-shrink: 0;
374
+ width: 24px;
375
+ height: 24px;
376
+ border-radius: 16px;
377
+ background-color: ${({theme:e})=>e.v2.colors.purple[500]};
378
+ `,kd=b.div`
379
+ display: flex;
380
+ flex: 1;
381
+ flex-direction: column;
382
+ gap: 2px;
383
+ min-width: 0;
384
+ `,Ed=b.div`
385
+ display: flex;
386
+ flex-direction: column;
387
+ gap: 10px;
388
+ width: 100%;
389
+ padding-left: 32px;
390
+ `,Id=({"data-id":o,step:n,title:i,description:a,children:l})=>e(xd,{"data-id":o,children:[e(wd,{children:[t(Td,{children:t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:ue.Primary,children:n})}),e(kd,{children:[t(pe,{size:he.S,weight:400,lineHeight:"24px",color:ue.Primary,children:i}),t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:a})]})]}),l&&t(Ed,{children:l})]});var Nd,$d;(e=>{e.AssumeRole="assume-role",e.StaticKeys="static-keys"})(Nd||(Nd={})),(e=>{e.CloudFormation="cloudformation",e.Terraform="terraform",e.AwsCli="aws-cli",e.Manual="manual"})($d||($d={}));const Od=[{id:Nd.AssumeRole,label:et.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE,note:et.CLOUD_CONNECTOR_AUTH_ASSUME_ROLE_NOTE},{id:Nd.StaticKeys,label:et.CLOUD_CONNECTOR_AUTH_STATIC_KEYS,note:et.CLOUD_CONNECTOR_AUTH_STATIC_KEYS_NOTE}],Ad=[{id:$d.CloudFormation,label:et.CLOUD_CONNECTOR_SETUP_METHOD_CLOUDFORMATION},{id:$d.Terraform,label:et.CLOUD_CONNECTOR_SETUP_METHOD_TERRAFORM},{id:$d.AwsCli,label:et.CLOUD_CONNECTOR_SETUP_METHOD_AWS_CLI},{id:$d.Manual,label:et.CLOUD_CONNECTOR_SETUP_METHOD_MANUAL}],Rd={[$d.CloudFormation]:{description:"Launch the stack in your AWS account. It creates the IAM role with the policy above and returns the Role ARN.",steps:["Open the AWS CloudFormation console.","Choose Create stack → With new resources.","Upload the template below as the stack template.","Review the permissions, then deploy the stack.","Open the stack's Outputs tab.","Copy the RoleArn value and paste it below."],code:["aws cloudformation deploy \\"," --stack-name odigos-connector \\"," --template-file odigos-connector.yaml \\"," --capabilities CAPABILITY_NAMED_IAM"].join("\n")},[$d.Terraform]:{description:"Run the Odigos connector module to provision the IAM role as code and expose the Role ARN as an output.",steps:["Add the odigos-connector module to your configuration.","Run terraform init to download the module.","Run terraform apply and confirm the plan.","Read the role_arn value from the apply output.","Copy the Role ARN and paste it below."],code:["terraform init","terraform apply","terraform output -raw role_arn"].join("\n")},[$d.AwsCli]:{description:"Create the IAM role from your terminal using the AWS CLI, then return the Role ARN.",steps:["Make sure the AWS CLI is configured (aws configure).","Create the role with the trust policy.","Attach the permissions policy to the role.","Copy the ARN from the create-role output and paste it below."],code:["aws iam get-role \\"," --role-name OdigosConnectorRole \\"," --query 'Role.Arn' \\"," --output text"].join("\n")},[$d.Manual]:{description:"Create the IAM role by hand in the AWS Console using the trust policy below, then return the Role ARN.",steps:["Open the AWS Console → IAM → Roles → Create role.","Select Custom trust policy.","Paste the trust policy below.","Attach the permissions policy from the previous step.","Name the role and create it.","Open the role summary and copy the Role ARN below."],code:["{",' "Version": "2012-10-17",',' "Statement": ['," {",' "Effect": "Allow",',' "Principal": { "AWS": "arn:aws:iam::657451249928:root" },',' "Action": "sts:AssumeRole",',' "Condition": {',' "StringEquals": { "sts:ExternalId": "odigos-connector" }'," }"," }"," ]","}"].join("\n")}},Dd=b.div`
391
+ display: flex;
392
+ align-items: stretch;
393
+ gap: 10px;
394
+ width: 100%;
395
+ `,_d=b.div`
396
+ display: flex;
397
+ flex: 2 1 0;
398
+ flex-direction: column;
399
+ gap: 12px;
400
+ min-width: 0;
401
+ padding: 12px 0;
402
+ `,Pd=b.div`
403
+ display: flex;
404
+ flex-direction: column;
405
+ gap: 8px;
406
+ width: 100%;
407
+ `,Ld=b.div`
408
+ display: flex;
409
+ align-items: center;
410
+ gap: 12px;
411
+ width: 100%;
412
+ `,Fd=b.div`
413
+ display: flex;
414
+ align-items: center;
415
+ justify-content: center;
416
+ flex-shrink: 0;
417
+ width: 24px;
418
+ height: 24px;
419
+ border-radius: 16px;
420
+ background-color: ${({theme:e})=>e.v2.colors.purple[700]};
421
+ `,Md=b.div`
422
+ display: flex;
423
+ flex: 3 1 0;
424
+ flex-direction: column;
425
+ min-width: 0;
426
+ padding: 8px;
427
+ border-radius: 12px;
428
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
429
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
430
+ `,zd=b.div`
431
+ display: flex;
432
+ align-items: center;
433
+ justify-content: flex-end;
434
+ width: 100%;
435
+ `,Bd=b.div`
436
+ flex: 1;
437
+ width: 100%;
438
+ min-height: 200px;
439
+ max-height: 260px;
440
+ overflow: auto;
441
+ padding: 0 12px 12px;
442
+ `,Xd=b.pre`
443
+ margin: 0;
444
+ font-family: ${({theme:e})=>e.font_family.code};
445
+ font-size: 12px;
446
+ line-height: 20px;
447
+ color: ${({theme:e})=>e.v2.colors.green[400]};
448
+ white-space: pre;
449
+ `,Ud=({step:o,setupMethod:n})=>{const i=v(),{CopyButton:a}=Pt(),{description:l,steps:r,code:s}=(e=>Rd[e]??Rd[$d.CloudFormation])(n);return t(Id,{"data-id":"cloud-connector-create-role",step:o,title:et.CLOUD_CONNECTOR_CREATE_ROLE_TITLE,description:l,children:e(Dd,{children:[e(_d,{children:[t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:ue.Primary,children:et.CLOUD_CONNECTOR_CREATE_ROLE_STEPS_HEADING}),t(Pd,{children:r.map((o,a)=>e(Ld,{children:[t(Fd,{children:t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:i.v2.colors.purple[200],children:a+1})}),t(pe,{size:he.XXS,weight:400,lineHeight:"20px",color:ue.Primary,children:o})]},`${n}-step-${a}`))})]}),e(Md,{children:[t(zd,{children:t(a,{value:s,size:Ct.XS})}),t(Bd,{children:t(Xd,{children:s})})]})]})})},Vd=b.div`
450
+ display: flex;
451
+ flex-direction: column;
452
+ gap: 16px;
453
+ width: 100%;
454
+ `,Hd=b.div`
455
+ display: flex;
456
+ flex-wrap: wrap;
457
+ gap: 24px;
458
+ width: 100%;
459
+ `,jd=b.div`
460
+ display: flex;
461
+ flex: 1 1 calc(50% - 12px);
462
+ min-width: 0;
463
+ `,Gd=b.div`
464
+ display: flex;
465
+ width: 100%;
466
+ max-width: 479px;
467
+ `,Wd=({step:o})=>{const{genericForm:n,providers:i}=Kl(),{provider:l,authMethod:r,awsAccountId:s,credentials:c}=n.formData,d=a(()=>i.find(e=>e.provider===l),[i,l]),p=a(()=>((e,t)=>{const o=e?.auth?.methods?.find(e=>e.id===t);if(!o)return[];const n=new Map(e?.auth?.methods?.map(e=>[e.id,e])),i=new Set,a=[],l=e=>e?.forEach(e=>{e.name&&!i.has(e.name)&&(i.add(e.name),a.push(e))});return o.baseMethods?.forEach(e=>l(n.get(e)?.fields)),l(o.fields),a})(d,r),[d,r]);return t(Id,{"data-id":"cloud-connector-enter-arn",step:o,title:et.CLOUD_CONNECTOR_ENTER_ARN_TITLE,description:et.CLOUD_CONNECTOR_ENTER_ARN_SUBTITLE,children:e(Vd,{children:[t(Gd,{children:t(Te,{name:"cloud-connector-aws-account-id",width:"100%",label:et.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_LABEL,placeholder:et.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_PLACEHOLDER,helpMessage:et.CLOUD_CONNECTOR_FIELD_ACCOUNT_ID_HELP,value:s,onChange:e=>n.handleFormChange("awsAccountId",e.target.value)})}),p.length>0&&t(Hd,{children:p.map(e=>t(jd,{children:t(Te,{name:`cloud-connector-credential-${e.name}`,width:"100%",type:e.secret?Mt.Password:Mt.Text,label:e.displayName||e.name,required:e.required,tooltip:e.tooltip||void 0,helpMessage:e.tooltip||void 0,placeholder:e.displayName||e.name,value:c[e.name]??"",onChange:t=>{return o=e.name,i=t.target.value,void n.handleFormChange("credentials",{...c,[o]:i});var o,i}})},e.name))})]})})},Kd=b.div`
468
+ display: flex;
469
+ flex-direction: column;
470
+ padding: 16px;
471
+ `,Yd=b.div`
472
+ display: flex;
473
+ flex-direction: column;
474
+ gap: 12px;
475
+ padding: 16px 16px 12px;
476
+ border-radius: 16px;
477
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
478
+ `,qd=b.div`
479
+ display: flex;
480
+ align-items: center;
481
+ gap: 8px;
482
+ width: 100%;
483
+ `,Jd=b.button`
484
+ display: flex;
485
+ align-items: center;
486
+ justify-content: center;
487
+ flex-shrink: 0;
488
+ width: 36px;
489
+ height: 36px;
490
+ padding: 0 8px;
491
+ border: none;
492
+ border-radius: 8px;
493
+ background-color: transparent;
494
+ cursor: pointer;
495
+ transition: background-color 0.15s ease;
496
+
497
+ &:hover {
498
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
499
+ }
500
+ `,Zd=b.div`
501
+ display: flex;
502
+ flex: 1;
503
+ flex-direction: column;
504
+ gap: 4px;
505
+ min-width: 0;
506
+ `,Qd=b.div`
507
+ display: flex;
508
+ align-items: center;
509
+ gap: 4px;
510
+ padding: 8px 0 8px 2px;
511
+ `,ep=({onBack:o})=>{const n=v(),{genericForm:a}=Kl(),l=a.formData.authMethod,r=a.formData.setupMethod;i(()=>{l||a.handleFormChange("authMethod",Nd.AssumeRole)},[l,a]),i(()=>{r||a.handleFormChange("setupMethod",$d.CloudFormation)},[r,a]);const s=Od.find(e=>e.id===l)?.note;return t(Kd,{children:e(Yd,{children:[e(qd,{children:[t(Jd,{"data-id":"cloud-connector-setup-back",type:"button",onClick:o,"aria-label":et.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE,children:t(Ja,{size:24})}),e(Zd,{children:[t(pe,{size:he.S,weight:500,lineHeight:"24px",color:ue.Primary,children:et.CLOUD_CONNECTOR_SETUP_CREDENTIALS_TITLE}),t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:et.CLOUD_CONNECTOR_SETUP_CREDENTIALS_SUBTITLE})]})]}),e(Id,{"data-id":"cloud-connector-auth-method",step:1,title:et.CLOUD_CONNECTOR_AUTH_TITLE,description:et.CLOUD_CONNECTOR_AUTH_SUBTITLE,children:[t(ve,{"data-id":"cloud-connector-auth-method-segment",size:_e.S,selected:l,setSelected:e=>a.handleFormChange("authMethod",e),options:Od.map(e=>({value:e.id,label:e.label}))}),s&&e(Qd,{children:[t(Za,{size:16,fill:n.v2.colors.silver[200]}),t(pe,{size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:s})]})]}),t(Id,{"data-id":"cloud-connector-setup-method",step:2,title:et.CLOUD_CONNECTOR_SETUP_METHOD_TITLE,description:et.CLOUD_CONNECTOR_SETUP_METHOD_SUBTITLE,children:t(ve,{"data-id":"cloud-connector-setup-method-segment",size:_e.S,selected:r,setSelected:e=>a.handleFormChange("setupMethod",e),options:Ad.map(e=>({value:e.id,label:e.label}))})}),t(Ud,{step:3,setupMethod:r}),t(Wd,{step:4})]})})},tp=b.div`
512
+ display: flex;
513
+ flex-direction: column;
514
+ flex: 1;
515
+ min-height: 0;
516
+ padding: 16px;
517
+ `,op=b.div`
518
+ display: flex;
519
+ flex-direction: column;
520
+ flex: 1;
521
+ min-height: 0;
522
+ padding: 16px;
523
+ border-radius: 16px;
524
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
525
+ `,np=b.div`
526
+ display: flex;
527
+ flex: 1;
528
+ align-items: center;
529
+ justify-content: center;
530
+ width: 100%;
531
+ `,ip=b.div`
532
+ display: flex;
533
+ flex-direction: column;
534
+ align-items: center;
535
+ justify-content: center;
536
+ gap: 12px;
537
+ width: 294px;
538
+ padding: 24px 8px;
539
+ border-radius: 8px;
540
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
541
+ `,ap=b.div`
542
+ display: flex;
543
+ flex-direction: column;
544
+ align-items: center;
545
+ gap: 12px;
546
+ width: 409px;
547
+ padding: 16px;
548
+ border-radius: 12px;
549
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
550
+ `,lp=b.div`
551
+ display: flex;
552
+ align-items: center;
553
+ justify-content: center;
554
+ flex-shrink: 0;
555
+ width: 39px;
556
+ height: 39px;
557
+ border-radius: 20px;
558
+ background-color: ${({theme:e})=>e.v2.colors.red[500]};
559
+ `,rp=b.div`
560
+ display: flex;
561
+ align-items: flex-start;
562
+ gap: 8px;
563
+ width: 100%;
564
+ max-height: 112px;
565
+ overflow: auto;
566
+ padding: 12px;
567
+ border-radius: 8px;
568
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
569
+ `,sp=b.pre`
570
+ flex: 1;
571
+ min-width: 0;
572
+ margin: 0;
573
+ font-family: ${({theme:e})=>e.font_family.code};
574
+ font-size: 10px;
575
+ line-height: 14px;
576
+ color: ${({theme:e})=>e.v2.colors.silver[200]};
577
+ white-space: pre-wrap;
578
+ word-break: break-word;
579
+ `,cp=b.div`
580
+ display: flex;
581
+ flex-direction: column;
582
+ gap: 12px;
583
+ width: 100%;
584
+ `,dp=b.div`
585
+ display: flex;
586
+ flex-wrap: wrap;
587
+ gap: 24px;
588
+ padding: 0 2px;
589
+ `,pp=b.div`
590
+ display: flex;
591
+ gap: 6px;
592
+ min-width: 0;
593
+ `,up=b.div`
594
+ display: flex;
595
+ flex-direction: column;
596
+ gap: 8px;
597
+ `,hp=b.div`
598
+ display: flex;
599
+ flex-direction: column;
600
+ gap: 6px;
601
+ padding: 12px;
602
+ border-radius: 12px;
603
+ border: 1px solid ${({theme:e,$passed:t})=>t?e.v2.colors.silver[700]:e.v2.colors.red[800]};
604
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
605
+ `,mp=({isTesting:o,error:n,result:i})=>{const l=v(),{CopyButton:r}=Pt(),s=a(()=>i?.checks.filter(e=>!e.passed)??[],[i]),c=!(o||!n&&(!i||i.success)),d=n?et.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT:s[0]?.remediation||s[0]?.message||et.CLOUD_CONNECTOR_CONNECTION_FAILED_DEFAULT,p=n||s.map(e=>e.message).filter(Boolean).join("\n");return t(tp,{children:t(op,{children:o?t(np,{children:t(ip,{children:t(St,{withVisual:!0,withGradient:!0,title:et.CLOUD_CONNECTOR_TESTING_TITLE,titleSize:he.XS})})}):c?t(np,{children:e(ap,{children:[t(lp,{children:t(Va,{size:20,fill:l.v2.colors.black[500]})}),t(pe,{size:he.XS,weight:400,lineHeight:"20px",color:ue.Primary,children:et.CLOUD_CONNECTOR_CONNECTION_FAILED_TITLE}),t(pe,{align:"center",size:he.XXXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:d}),p&&e(rp,{children:[t(sp,{children:p}),t(r,{value:p,size:Ct.XS})]})]})}):i?e(cp,{children:[t(qe,{status:Fe.Success,label:et.CLOUD_CONNECTOR_VALIDATE_SUCCESS,leftIcon:Ua,fullWidth:!0}),(i.accountId||i.identity)&&e(dp,{children:[i.accountId&&e(pp,{children:[e(pe,{size:he.XXS,weight:500,color:ue.Secondary,children:[et.CLOUD_CONNECTOR_VALIDATE_ACCOUNT,":"]}),t(pe,{size:he.XXS,weight:400,color:ue.Primary,children:i.accountId})]}),i.identity&&e(pp,{children:[e(pe,{size:he.XXS,weight:500,color:ue.Secondary,children:[et.CLOUD_CONNECTOR_VALIDATE_IDENTITY,":"]}),t(pe,{size:he.XXS,weight:400,color:ue.Primary,children:i.identity})]})]}),i.checks.length>0&&t(up,{children:i.checks.map(o=>e(hp,{$passed:o.passed,children:[t(qe,{status:o.passed?Fe.Success:Fe.Error,label:o.displayName,leftIcon:o.passed?Ua:Va}),o.message&&t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Secondary,children:o.message}),!o.passed&&o.remediation&&t(pe,{size:he.XXS,weight:400,lineHeight:"normal",color:ue.Primary,children:o.remediation})]},o.name))})]}):t(np,{children:t(pe,{size:he.XXS,weight:400,color:ue.Secondary,children:et.CLOUD_CONNECTOR_VALIDATE_EMPTY})})})})};var gp;(e=>{e[e.SelectProvider=1]="SelectProvider",e[e.Config=2]="Config",e[e.Validate=3]="Validate"})(gp||(gp={}));const fp=gp.SelectProvider,bp=gp.Validate,vp=({onClose:o,withOverlay:n,onCreateCloudConnector:i,onCreated:l})=>{const{providers:c,genericForm:d}=Kl(),[p,u]=s(fp),[h,m]=s(!1),[g,f]=s(!1),[b,v]=s(void 0),[y,C]=s(void 0),[S,x]=s(void 0),w=d.isFormDirty,T=p===fp,k=p===bp,E=r(()=>{w&&!h?m(!0):(m(!1),o?.())},[w,h,o]),I=r(()=>{x(void 0),C(void 0),v(void 0),u(e=>e>fp?e-1:e)},[]),N=r(()=>{if(x(void 0),p===gp.SelectProvider){if(!d.formData.provider)return void x("Please select a cloud provider");if(!d.formData.permission)return void x("Please select a permission level")}u(e=>e<bp?e+1:e)},[p,d.formData.provider,d.formData.permission]),$=r(async()=>{if(x(void 0),C(void 0),v(void 0),u(gp.Validate),!i)return;const{provider:e,permission:t,customCapabilities:o,awsAccountId:n,credentials:a,name:r}=d.formData,s=((e,t,o)=>{const n=td(e),i=[];return n.forEach(e=>{const n=void 0!==e.instrumentationPermissions;let a=!1,l=!1;switch(t){case Zc.DiscoveryOnly:a=!0;break;case Zc.DiscoveryInstrumentation:a=!0,l=n;break;case Zc.Custom:{const t=o[e.typeName];a=!!t?.discovery,l=!!t?.instrumentation;break}}(a||l)&&i.push({type:e.typeName,discovery:a,instrumentation:l,computePlatforms:!1})}),i})(c.find(t=>t.provider===e),t,o);f(!0);try{const t=await i({provider:e,displayName:r,credentials:a,expectedAccountId:n,capabilities:s});if(t.created)return void l?.(t.connectorId);v(t.test)}catch(e){C(e instanceof Error?e.message:"Failed to create connector")}finally{f(!1)}},[i,l,d.formData,c]),O=g,A=k&&!g&&(!!y||!!b&&!b.success),R=a(()=>S?{status:Fe.Error,message:S}:void 0,[S]),D=a(()=>T?{"data-id":"cloud-connector-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:E,disabled:O}:{"data-id":"cloud-connector-back",label:Ft.BACK,variant:be.Text,leftIcon:Ja,onClick:I,disabled:O},[T,E,I,O]),_=a(()=>{if(k){if(g)return;return A?{"data-id":"cloud-connector-retry",label:Ft.RETRY,variant:be.Primary,rightIcon:Qa,onClick:$}:void 0}return p===gp.Config?{"data-id":"cloud-connector-verify",label:Ft.VERIFY_AND_CREATE_CONNECTOR,variant:be.Primary,onClick:$,disabled:O}:{"data-id":"cloud-connector-next",label:Ft.NEXT,variant:be.Primary,onClick:N,disabled:O}},[k,g,A,p,$,N,O]),P=a(()=>[D,_].filter(Boolean),[D,_]);return e(ce,{width:vr,isOpen:!0,hideOverlay:!O&&!n,header:{icon:Ka,title:et.CREATE_CLOUD_CONNECTOR,onClose:o?E:void 0,onCloseDisabled:O},footer:{note:R,actions:P},children:[p===gp.SelectProvider&&t(Sd,{}),p===gp.Config&&t(ep,{onBack:I}),p===gp.Validate&&t(mp,{isTesting:g,error:y,result:b}),t(yr,{isOpen:h,onClose:()=>m(!1),onApprove:()=>o?.()})]})},yp=(e,t)=>{const o=[{id:"type",title:et.TYPE,label:t.label},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.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:et.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:et.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:et.NOTES,label:e.notes}),o},Cp=({onClose:n,actionId:l})=>{const c=v(),{isVm:d}=S(),{actionsApi:p}=Ll(),{items:u,refetch:h}=p.useActions(),{options:m}=p.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:b,genericForm:y}=Pl();i(()=>{h()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=C&&!!y?.isFormDirty,N=a(()=>u?.find(e=>zt(e)===l),[l,u]),$=a(()=>m.find(({type:e})=>e===N?.type)??Bt.find(({type:e})=>e===N?.type)??null,[m,N?.type]);i(()=>{N&&f(N,$)},[N,$]);const O=r(()=>{N&&x(!0)},[N]),A=r(()=>{N&&(f(N,$),x(!1))},[N,$,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await p.update(N.id,t),x(!1))}},[N,b,p]),L=r(()=>{N&&T(!0)},[N]),F=r(async()=>{N&&(await p.remove(N.id,N.type),n())},[N,p,n]);if(!N||!$)return null;const M=(e=>{const t=[],{type:o,fields:n}=e,i=e=>({status:e?Fe.Success:Fe.Unknown,label:e?"True":"False",invertColors:!0});if(o===Ae.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:i(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:i(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:i(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:i(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.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:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ae.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===Ae.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:i(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===Ae.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===Ae.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:i,regex:a},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}),i&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:i}),a&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:a})})}return o===Ae.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const i=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${i}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,a)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${a}`,title:`${i}Workload${(e.workloadFilters?.length??0)>1?` #${a+1}`:""}`,label:l})});const a=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");a&&t.push({id:`group-${o}-templates`,title:`${i}Templates`,label:a}),e.notes&&t.push({id:`group-${o}-notes`,title:`${i}Notes`,label:e.notes})}),t})(N);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:Vt(N.type),title:$.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:_a,active:C,onClick:O},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ia,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:C&&g?t(Ms,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!d&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:yp(N,$)})]}),!!M?.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",cellsPerRow:2,items:M})})]})})})}),t(Cr,{target:"action",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(yr,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})},Sp=({onClose:o,connections:n,selectedConnectionIds:r,setSelectedConnectionIds:c})=>{const{configApi:d}=Ll(),[p,u]=s(""),[h,m]=s({showOnlySelected:!1}),g=a(()=>n.filter(e=>{const t=!p||e.name.toLowerCase().includes(p.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&r.includes(e.id);return t&&o}),[n.length,r.length,p,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===r.length?r[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=a(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:x,areFormValuesEqual:w,resetFormData:T}=Ht(C||{rollout:{automaticRolloutDisabled:!1}}),k=l(T);k.current=T,i(()=>{C&&k.current(C)},[C]);const E=a(()=>r.length>1||void 0!==C&&!w(C,S),[r.length,C,S]);return t(br,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,r))??void 0,header:{icon:el,title:"Cluster Configuration"},connectionIds:{value:r,setValue:c},search:{placeholder:"Search by cluster name",value:p,onChange:u},filters:e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(le,{size:Nt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:E,isFetching:y,leftColumn:{width:"35%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(pe,{size:he.XS,children:"Clusters"}),t(qe,{label:g.length,status:Fe.Unknown})]}),e(me,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,align:"right",children:"Selected clusters"}),t(qe,{label:`${r.length}/${g.length}`,status:Fe.Unknown})]})]}),list:g.map(e=>t(dc,{title:e.name,isChecked:r.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(pe,{size:he.XS,children:"Configurations"}),list:[t(le,{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=>x("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},xp=e=>{const t=[{id:"type",title:et.TYPE,label:e.destinationType.displayName},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}],o=Be(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:et.MONITORS,label:o}),e.name&&t.push({id:"name",title:et.NAME,label:e.name}),t},wp=({onClose:n,destinationId:c})=>{const d=v(),{isVm:p}=S(),{destinationsApi:u}=Ll(),{selectedStreamName:h}=tt(),{items:m,refetch:g}=u.useDestinations(),{data:f,loading:b}=u.useDestinationCategories(),{activeForm:y,loadDestination:C,validateFormData:x,genericForm:w}=Fl();i(()=>{g()},[]);const T=l(null),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(null),A=k&&!!w?.isFormDirty,R=a(()=>Gt(m,h),[m,h]),D=a(()=>R?.find(e=>zt(e)===c),[c,R]),_=f?.destinationCategories?.categories??null;i(()=>{D&&_&&C(D,_)},[D,_]);const P=a(()=>D&&_?Wt(_,D):[],[D,_]),L=r(()=>{D&&E(!0)},[D]),F=r(()=>{D&&_&&(C(D,_),E(!1))},[D,_,C]),M=r(()=>{A?O("close"):n()},[A,n]),z=r(()=>{A?O("cancel"):F()},[A,F]),B=r(()=>{const e=$;O(null),"close"===e?(F(),n()):F()},[$,F,n]),X=r(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=x();e||(await u.update(D.id,Ue(t)),E(!1))}},[D,x,u]),U=r(()=>{D&&N(!0)},[D]),V=r(async()=>{D&&(await u.remove(D.id),n())},[D,u,n]);if(!D)return null;const{icon:H,iconSrc:j}=wt(D.destinationType.type),G=((e,t)=>{const o=[],n=jt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=Be(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:p,componentProperties:u,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&Ie(h,a,i))return;const{type:g}=Ne(u,{type:""}),f=d||"password"===g;if(m?.length)m.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(p===Ee.MultiInput){const t=Ne(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(p===Ee.KeyValuePair){const t=Ne(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})(D,P);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:H,iconSrc:j,title:D.name||D.destinationType.displayName,onClose:M,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:_a,active:k,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ia,color:d.v2.colors.red[500],active:I,onClick:U}]},footer:{actions:k?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:z},...y?.option.testConnectionSupported&&!p?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:be.Secondary,onClick:()=>T.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:X}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:b?t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})}):k&&y?t(Xs,{ref:T,isEdit:!0}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!p&&t(Ut,{conditions:D.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:xp(D)})]}),!!G.length&&t(Xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:G.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(Cr,{target:"destination",isOpen:I,onClose:()=>N(!1),onApprove:V}),t(yr,{isOpen:null!==$,onClose:()=>O(null),onApprove:B})]})},Tp=(e,t)=>{const o=[{id:"type",title:et.TYPE,label:t.label},{id:"status",title:et.STATUS,badge:{status:e.disabled?Fe.Unknown:Fe.Success,label:e.disabled?et.DISABLED:et.ENABLED}}];return e.ruleName&&o.push({id:"name",title:et.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:et.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:et.NOTES,label:e.notes}),o},kp=({onClose:n,ruleId:l})=>{const c=v(),{addNotification:d}=Yt(),{isVm:p}=S(),{instrumentationRulesApi:u}=Ll(),{items:h,refetch:m}=u.useRules(),{selectedOption:g,loadRule:f,validateFormData:b,genericForm:y}=Ml();i(()=>{m()},[]);const[C,x]=s(!1),[w,T]=s(!1),[k,E]=s(null),I=C&&!!y?.isFormDirty,N=a(()=>h?.find(e=>zt(e)===l),[l,h]),$=a(()=>kt.find(({type:e})=>e===N?.type)??null,[N?.type]);i(()=>{N&&f(N)},[N]);const O=r(()=>{if(N){if(!N.mutable)return void d({type:Fe.Warning,title:qt.FORBIDDEN,message:qt.CANNOT_EDIT_RULE,crdType:Et.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});x(!0)}},[N,d]),A=r(()=>{N&&(f(N),x(!1))},[N,f]),R=r(()=>{I?E("close"):n()},[I,n]),D=r(()=>{I?E("cancel"):A()},[I,A]),_=r(()=>{const e=k;E(null),"close"===e?(A(),n()):A()},[k,A,n]),P=r(async()=>{if(N){const{errorMessage:e,preparedFormData:t}=b();e||(await u.update(N.ruleId,t,N.type),x(!1))}},[N,b,u]),L=r(()=>{if(N){if(!N.mutable)return void d({type:Fe.Warning,title:qt.FORBIDDEN,message:qt.CANNOT_DELETE_RULE,crdType:Et.InstrumentationRule,target:N.ruleId,hideFromHistory:!0});T(!0)}},[N,d]),F=r(async()=>{N&&(await u.remove(N.ruleId,N.type),n())},[N,u,n]);if(!N||!$)return null;const M=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(pe,{size:he.XS,children:`• ${Kt(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(pe,{size:he.XS,children:`• ${Kt(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[He.HeaderKeys]?.length&&e.headersCollection[He.HeaderKeys].forEach((e,o)=>{e&&n.push(t(pe,{size:he.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[Ke.Java]?.forEach((e,i)=>{const a=new We(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(pe,{size:he.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(pe,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[Ke.Golang]?.forEach((e,i)=>{const a=new Ge(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(pe,{size:he.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(pe,{size:he.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})(N,c);return e(o,{children:[t(ce,{isOpen:!0,header:{icon:Zt(N.type),title:$.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:_a,active:C,onClick:O},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ia,color:c.v2.colors.red[500],active:w,onClick:L}]},footer:{actions:C?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:P}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:C&&g?t(Ys,{}):t(ee,{$gap:16,children:e(Xt,{bgTint:"1000",children:[e(Xt,{bgTint:"900",children:[!p&&t(Ut,{conditions:N.conditions||[]}),t(Xt,{bgTint:"800",cellsPerRow:2,items:Tp(N,$)})]}),!p&&t(rr,{readOnly:!0,scopes:N.sourceScopes??null}),!!M.length&&t(Xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:M})}),!!$.supportedLanguages.length&&t(Xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Xt,{bgTint:"800",children:t(me,{$gap:12,$wrap:"wrap",children:$.supportedLanguages.map(e=>t(Jt,{label:Je[e],leftIcon:Ze(e),flex:"0.5"},e))})})})]})})})}),t(Cr,{target:"instrumentation rule",isOpen:w,onClose:()=>T(!1),onApprove:F}),t(yr,{isOpen:null!==k,onClose:()=>E(null),onApprove:_})]})};var Ep;(e=>{e.Overview="overview",e.Pods="pods",e.Libraries="libraries",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Ep||(Ep={}));const Ip=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:p,children:u})=>{const{formatDurationAgo:h}=Qt(),m=eo(!!o),g=a(()=>({title:l,icon:tl,withCopy:!0}),[l]),f=a(()=>{const e=[],t=to(c);t&&e.push(t);const o=to(d,ol,"health");o&&e.push(o);const n=to(p,nl,"health");return n&&e.push(n),e},[c,d,p]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Qa,label:Ft.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:et.NODE,label:r,withCopy:!0},{id:"age",title:et.AGE,label:s?h(s,{style:"short"}):et.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Xt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:u})})},Np=b.div`
192
606
  display: flex;
193
607
  align-items: center;
194
608
  justify-content: space-between;
@@ -196,7 +610,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
196
610
  padding: ${({$noPadding:e})=>e?"0":"12px"};
197
611
  border-radius: 12px;
198
612
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
199
- `,Rc=({podsOdigosHealthStatus:o,pods:n,noPadding:a})=>{const l=Qt(o?.status),r=Ut(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=i(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Jt.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Jt.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Jt.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Oc,{$noPadding:a,children:[t(Zt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(he,{$gap:8,children:[t(Pc,{label:Qe.PODS,count:c}),t(Pc,{label:Qe.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Pc,{label:Qe.ODIGOS_HEALTHY,icon:Va,count:u,total:c}),t(Pc,{label:Qe.KUBERNETES_HEALTHY,icon:Ua,count:p,total:c})]})]}):null},Dc=f.div`
613
+ `,$p=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=io(o?.status),r=Kt(o?.name),s=o?.message,{totalPodsCount:c,odigosHealthyPodsCount:d,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===oo.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===oo.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Np,{$noPadding:i,children:[t(no,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(me,{$gap:8,children:[t(Ap,{label:et.PODS,count:c}),t(Ap,{label:et.ODIGOS_HEALTHY,icon:ol,count:d,total:c}),t(Ap,{label:et.KUBERNETES_HEALTHY,icon:nl,count:p,total:c})]})]}):null},Op=b.div`
200
614
  display: flex;
201
615
  flex-direction: column;
202
616
  justify-content: center;
@@ -207,32 +621,32 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
207
621
  width: fit-content;
208
622
  border-radius: 8px;
209
623
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
210
- `,Pc=({count:o,total:n,label:i,icon:a})=>{const l=b(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Dc,{children:[e(he,{$gap:0,$alignItems:"flex-end",children:[t(de,{size:pe.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(de,{size:pe.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(he,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(de,{size:pe.XXXS,nowrap:!0,children:i})]})]})},Fc=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===eo.PID)??e.identifyingAttributes?.find(({name:e})=>e===eo.VPID);return t?.value??null};var Lc;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Lc||(Lc={}));const Mc=({overrideProcessNum:o,healthy:a,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=b(),[p,h]=r(Lc.IdentifyingAttributes),m=Yt(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:v}=i(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Lc.IdentifyingAttributes,label:Qe.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Lc.InstrumentationLibraries,label:Qe.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Ha,{...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(()=>{f&&h(f)},[f]);const y=i(()=>{switch(p){case Lc.IdentifyingAttributes:return t(Q,{children:s?.map((e,o)=>t(Vc,{label:e.name,value:e.value},`attr-${o}-${e.name}`))});case Lc.InstrumentationLibraries:return t(Q,{children:c?.map((e,o)=>t(Vc,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))});default:return null}},[p,s,c]),C=i(()=>Fc({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return t("div",{ref:m,children:e(Lt,{bgTint:"800",richTitle:{title:C?`${Qe.PROCESS} ${Qe.PID(C)}`:Qe.PROCESS_FALLBACK_NAME},renderOnRightSide:t(de,{color:a?ue.Success:ue.Error,size:pe.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:a?Le.Success:Le.Error,leftIcon:Va,label:a?Qe.HEALTHY:Qe.NOT_HEALTHY,textSize:pe.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(be,{options:g,selected:p,setSelected:h}),!v&&y]})})},_c=f.div`
624
+ `,Ap=({count:o,total:n,label:i,icon:a})=>{const l=v(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Op,{children:[e(me,{$gap:0,$alignItems:"flex-end",children:[t(pe,{size:he.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(pe,{size:he.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(me,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(pe,{size:he.XXXS,nowrap:!0,children:i})]})]})},Rp=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===ao.PID)??e.identifyingAttributes?.find(({name:e})=>e===ao.VPID);return t?.value??null};var Dp;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Dp||(Dp={}));const _p=({overrideProcessNum:o,healthy:n,healthStatus:l,identifyingAttributes:r,instrumentations:c,isJumpToTarget:d})=>{const p=v(),[u,h]=s(Dp.IdentifyingAttributes),m=eo(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:b}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Dp.IdentifyingAttributes,label:et.IDENTIFYING_ATTRIBUTES,disabled:!r?.length,selectedBgColor:p.v2.colors.purple[500]},{value:Dp.InstrumentationLibraries,label:et.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(il,{...e,fill:p.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:p.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[r,c]);i(()=>{f&&h(f)},[f]);const y=a(()=>{switch(u){case Dp.IdentifyingAttributes:return t(ee,{children:r?.map((e,o)=>t(zp,{label:e.name,value:e.value},`attr-${o}-${e.name}`))});case Dp.InstrumentationLibraries:return t(ee,{children:c?.map((e,o)=>t(zp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))});default:return null}},[u,r,c]),C=a(()=>Rp({overrideProcessNum:o,identifyingAttributes:r}),[o,r]);return t("div",{ref:m,children:e(Xt,{bgTint:"800",richTitle:{title:C?`${et.PROCESS} ${et.PID(C)}`:et.PROCESS_FALLBACK_NAME},renderOnRightSide:t(pe,{color:n?ue.Success:ue.Error,size:he.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:n?Fe.Success:Fe.Error,leftIcon:ol,label:n?et.HEALTHY:et.NOT_HEALTHY,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!b,collapseIsDefaultOpen:d,children:[!b&&t(ve,{options:g,selected:u,setSelected:h}),!b&&y]})})},Pp=b.div`
211
625
  display: flex;
212
- align-items: flex-start;
626
+ align-items: ${({$withHealthBadge:e})=>e?"center":"flex-start"};
213
627
  gap: 8px;
214
628
  padding: 8px;
215
629
  border-radius: 4px;
216
630
  &:hover {
217
631
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
218
632
  }
219
- `,zc=f(de)`
220
- flex: 0 0 30%;
221
- `,Bc=f(de)`
633
+ `,Lp=b(pe)`
634
+ flex: 0 0 ${({$withHealthBadge:e})=>e?"auto":"30%"};
635
+ `,Fp=b(pe)`
222
636
  flex: 1 1 auto;
223
637
  min-width: 0;
224
- `,Xc=f(he)`
638
+ `,Mp=b(me)`
225
639
  flex: 1 1 auto;
226
640
  justify-content: flex-end;
227
641
  min-width: 0;
228
- `,Vc=({label:o,value:n,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(_c,{children:[t(zc,{size:pe.XXS,color:ue.Secondary,children:o}),n&&t(Bc,{size:pe.XXS,color:ue.Primary,align:"right",children:n}),(r||i)&&e(Xc,{children:[i&&t(Ye,{status:Le.Info,label:Qe.STANDARD,textSize:pe.XXXS,invertColors:!0}),r&&t(Ye,{status:a?Le.Success:Le.Error,label:a?Qe.HEALTHY:Qe.NOT_HEALTHY,textSize:pe.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Uc=p(null),Gc=({value:e,children:o})=>t(Uc.Provider,{value:e,children:o}),Hc=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const a=e??[],l=i(()=>({title:Qe.CONTAINERS,titleSize:pe.XS,badge:{label:a.length}}),[a.length]),r=i(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(Lt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Q,{$gap:8,children:a.map(e=>{const o=n?.containerName===e.containerName;return t(Wc,{...e,language:to(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},jc=f.div`
642
+ `,zp=({label:o,value:n,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(Pp,{$withHealthBadge:r,children:[t(Lp,{size:he.XXS,color:ue.Secondary,$withHealthBadge:r,children:o}),n&&t(Fp,{size:he.XXS,color:ue.Primary,align:"right",children:n}),(i||r)&&e(Mp,{children:[i&&t(qe,{status:Fe.Info,label:et.STANDARD,textSize:he.XXXS,invertColors:!0}),r&&e(me,{$gap:4,children:[l&&t(Fp,{size:he.XXXS,color:ue.Error,align:"right",children:l}),t(qe,{status:a?Fe.Success:Fe.Error,label:a?et.HEALTHY:et.NOT_HEALTHY,leftIcon:ol,textSize:he.XXXS,invertColors:!0,tooltip:l??void 0})]})]})]})},Bp=h(null),Xp=({value:e,children:o})=>t(Bp.Provider,{value:e,children:o}),Up=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:et.CONTAINERS,titleSize:he.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(ee,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(Hp,{...e,language:lo(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},Vp=b.div`
229
643
  display: flex;
230
644
  flex-direction: column;
231
645
  gap: 12px;
232
646
  padding: 8px 12px;
233
647
  border-radius: 8px;
234
648
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
235
- `,Wc=({language:o,containerName:n,otelDistroName:a,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Kt(),C=Yt(v),S=i(()=>({title:n,icon:o?Je(o):ja,iconWithWrapper:!0}),[n,o]),w=i(()=>{const e=[],t=qt({status:a?Jt.Success:Jt.Disabled,reasonEnum:a?Qe.INSTRUMENTED_WITH_DISTRO(a):Qe.UNINSTRUMENTED,message:""});t&&e.push(t);const o=qt(h,Va,"health");o&&e.push(o);const n=qt(m,Ua,"health");return n&&e.push(n),e},[m,h,a]),x=i(()=>[{id:"runningTime",title:Qe.RUNNING_TIME,label:l?y(l,{style:"short"}):Qe.NOT_RUNNING,labelTooltip:`${Qe.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Le.Success:Le.Disabled,leftIcon:r?xa:ka,label:r?Qe.STARTED:Qe.NOT_STARTED,textSize:pe.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Le.Success:Le.Disabled,leftIcon:s?xa:ka,label:s?Qe.READY:Qe.NOT_READY,textSize:pe.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Le.Error:Le.Success,leftIcon:d?ka:xa,label:d?Qe.CRASHLOOP:Qe.NO_CRASHLOOP,textSize:pe.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Qe.RESTARTS,badge:{status:c?Le.Error:void 0,label:c||0,textSize:pe.XXXS}}],[l,y,r,s,d,c]),k=i(()=>p?Ut(u):"",[p,u]);return t("div",{ref:C,children:e(Lt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(jc,{children:e(he,{$gap:10,$alignItems:"center",children:[t(jt,{variant:oo.Pink,leftIcon:Ua,label:k}),t(de,{size:pe.XXXS,color:ue.Error,children:p})]})}),(g??[]).map((e,o)=>{const i=o+1,a=b&&(l=f,r=e,!!l?.processPid&&Fc({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Mc,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${n}-process-${i}`)})]})})},Kc=({podName:e,namespace:o,hasRestarted:n})=>{const a=i(()=>({title:Qe.DEBUG_COMMANDS,titleSize:pe.XS}),[]),l=i(()=>[{label:Qe.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Qe.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Qe.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(Lt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:o})=>t(no,{bgTint:"700",label:e,value:o},e))})},Yc=({source:n,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=h(Uc);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===Nc.Pods?l:null,s=n?.pods??[],c=s.length>0,d=i(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=i(()=>({title:Qe.PODS,badge:{label:s.length}}),[s.length]);return t(Q,{$gap:12,children:c?e(o,{children:[t(Rc,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(Lt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const i=r?.podName===o.podName,l=i&&!r?.containerName;return e(Ac,{...o,namespace:n.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:i,isJumpToTarget:l,children:[t(Kc,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(Hc,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:i?r:null})]},`pod-${o.podName}`)})})]}):t(gt,{$height:"70vh",children:t(Oe,{title:Qe.NO_RUNNING_PODS,subTitle:Qe.NO_RUNNING_PODS_SUBTITLE})})})},qc="user",Jc=({source:o})=>{const n=i(()=>o.serviceName||o.id.name,[o]),{sourcesApi:a}=kl(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(gt,r?{$height:"70vh",children:t(Ct,{withSpinner:!0})}:{$height:"70vh",children:t(Oe,{subTitle:Qe.COULD_NOT_FETCH_PEER_SOURCES})}):e(he,{$gap:16,$alignItems:"flex-start",children:[t(Zc,{icon:Wa,title:Qe.INBOUND,subTitle:Qe.INBOUND_DESCRIPTION(n),onRefresh:s,items:c?.inbound??[]}),t(Zc,{icon:Ka,title:Qe.OUTBOUND,subTitle:Qe.OUTBOUND_DESCRIPTION(n),onRefresh:s,items:c?.outbound??[]})]})},Zc=({icon:o,title:n,subTitle:a,onRefresh:l,items:s})=>{const[c,d]=r(""),u=i(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Lt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:pe.XS,subTitle:a,subTitleSize:pe.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:io.Button,buttonProps:{variant:fe.Secondary,size:ge.S,leftIcon:Ga,onClick:l}}],children:[t(ao,{value:c,onChange:d,width:"100%"}),t(lo,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(gt,{$height:"50vh",children:t(Oe,{icon:o,title:Qe.NO_RESULTS,subTitle:Qe.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(ed,{...e},`${n}-${e.serviceName}`)):[t(gt,{$height:"50vh",children:t(Oe,{icon:o,title:`No ${n} connections yet`,subTitle:n===Qe.INBOUND?Qe.NO_INBOUND_CONNECTIONS_DESCRIPTION:Qe.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Qc=f.div`
649
+ `,Hp=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:p,waitingMessage:u,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Qt(),C=eo(v),S=a(()=>({title:n,icon:o?Ze(o):al,iconWithWrapper:!0}),[n,o]),x=a(()=>{const e=[],t=to({status:i?oo.Success:oo.Disabled,reasonEnum:i?et.INSTRUMENTED_WITH_DISTRO(i):et.UNINSTRUMENTED,message:""});t&&e.push(t);const o=to(h,ol,"health");o&&e.push(o);const n=to(m,nl,"health");return n&&e.push(n),e},[m,h,i]),w=a(()=>[{id:"runningTime",title:et.RUNNING_TIME,label:l?y(l,{style:"short"}):et.NOT_RUNNING,labelTooltip:`${et.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Fe.Success:Fe.Disabled,leftIcon:r?Oa:Aa,label:r?et.STARTED:et.NOT_STARTED,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Fe.Success:Fe.Disabled,leftIcon:s?Oa:Aa,label:s?et.READY:et.NOT_READY,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Fe.Error:Fe.Success,leftIcon:d?Aa:Oa,label:d?et.CRASHLOOP:et.NO_CRASHLOOP,textSize:he.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:et.RESTARTS,badge:{status:c?Fe.Error:void 0,label:c||0,textSize:he.XXXS}}],[l,y,r,s,d,c]),T=a(()=>u?Kt(p):"",[u,p]);return t("div",{ref:C,children:e(Xt,{bgTint:"750",richTitle:S,badges:x,items:w,withCollapse:!0,collapseIsDefaultOpen:b,children:[u&&t(Vp,{children:e(me,{$gap:10,$alignItems:"center",children:[t(Jt,{variant:ro.Pink,leftIcon:nl,label:T}),t(pe,{size:he.XXXS,color:ue.Error,children:u})]})}),(g??[]).map((e,o)=>{const i=o+1,a=b&&(l=f,r=e,!!l?.processPid&&Rp({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(_p,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${n}-process-${i}`)})]})})},jp=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:et.DEBUG_COMMANDS,titleSize:he.XS}),[]),l=a(()=>[{label:et.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:et.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:et.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(so,{bgTint:"700",label:e,value:o},e))})},Gp=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=(()=>{const e=m(Bp);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===Ep.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]),p=a(()=>({title:et.PODS,badge:{label:s.length}}),[s.length]);return t(ee,{$gap:12,children:c?e(o,{children:[t($p,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(Xt,{bgTint:"1000",richTitle:p,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(Ip,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(jp,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(Up,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(ft,{$height:"70vh",children:t(Re,{title:et.NO_RUNNING_PODS,subTitle:et.NO_RUNNING_PODS_SUBTITLE})})})},Wp="user",Kp=({source:o})=>{const n=a(()=>o.serviceName||o.id.name,[o]),{sourcesApi:i}=Ll(),{data:l,loading:r,refetch:s}=i.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(ft,r?{$height:"70vh",children:t(St,{withSpinner:!0})}:{$height:"70vh",children:t(Re,{subTitle:et.COULD_NOT_FETCH_PEER_SOURCES})}):e(me,{$gap:16,$alignItems:"flex-start",children:[t(Yp,{icon:ll,title:et.INBOUND,subTitle:et.INBOUND_DESCRIPTION(n),onRefresh:s,items:c?.inbound??[]}),t(Yp,{icon:rl,title:et.OUTBOUND,subTitle:et.OUTBOUND_DESCRIPTION(n),onRefresh:s,items:c?.outbound??[]})]})},Yp=({icon:o,title:n,subTitle:i,onRefresh:l,items:r})=>{const[c,d]=s(""),p=a(()=>r.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[r,c]);return e(Xt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:he.XS,subTitle:i,subTitleSize:he.XXXS,badge:{label:r.length}},actions:[{id:"refresh",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,leftIcon:Qa,onClick:l}}],children:[t(po,{value:c,onChange:d,width:"100%"}),t(uo,{height:"calc(100vh - 284px)",gap:4,elements:p.length||c?!p.length&&c?[t(ft,{$height:"50vh",children:t(Re,{icon:o,title:et.NO_RESULTS,subTitle:et.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:p.map(e=>t(Jp,{...e},`${n}-${e.serviceName}`)):[t(ft,{$height:"50vh",children:t(Re,{icon:o,title:`No ${n} connections yet`,subTitle:n===et.INBOUND?et.NO_INBOUND_CONNECTIONS_DESCRIPTION:et.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},qp=b.div`
236
650
  display: flex;
237
651
  align-items: center;
238
652
  justify-content: space-between;
@@ -240,15 +654,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
240
654
  padding: 8px;
241
655
  border-radius: 8px;
242
656
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
243
- ${({$withClick:e})=>e&&v`
657
+ ${({$withClick:e})=>e&&y`
244
658
  cursor: pointer;
245
659
  &:hover {
246
660
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
247
661
  }
248
662
  `}
249
- `,ed=({serviceName:o,isVirtual:n,nodeAttributes:a})=>{const l=ro(e=>e.drawerEntityId),{items:r}=kl().sourcesApi.useSources(),s=i(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=i(()=>s&&JSON.stringify(so(s))!==JSON.stringify(so(l)),[s,l]),d=i(()=>{if(n){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[co({serviceName:o,attributes:e})]}if(o?.toLowerCase()===qc)return[Ya];const e=s?uo(s):void 0;return e?.length?e:[ja]},[n,a,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=ro.getState();e(ho(Tt.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Qc,{onClick:u,$withClick:!!u,children:[e(he,{$gap:8,children:[t(po,{icons:d}),t(de,{size:pe.XXS,children:o})]}),n&&t(Ye,{status:Le.Info,label:Qe.VIRTUAL,textSize:pe.XXXS,invertColors:!0,tooltip:Qe.VIRTUAL_TOOLTIP})]})},td=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}},od=({source:o})=>{const a=b(),{k8sManifestApi:l}=kl(),[s,c]=r(!0),[d,u]=r(void 0),[p,h]=r(!0),[m,g]=r(void 0);n(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>u(td(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:mo.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>g(td(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const f=i(()=>[{label:Qe.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:Qe.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:Qe.GET_POD_YAML,value:`kubectl get ${mo.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(Lt,{bgTint:"1000",children:[t(Lt,{bgTint:"900",richTitle:{icon:qa,title:Qe.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:f.map(({label:e,value:o},n)=>t(no,{label:e,value:o},`debug-cmd-${n}-${e}`))}),s?t(mt,{size:1}):t(lr,{bgTint:"800",codeBgColor:a.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(mt,{size:1}):t(lr,{bgTint:"800",codeBgColor:a.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},nd=({title:o,children:n})=>e(Q,{$gap:8,children:[t(de,{size:pe.XXXS,color:ue.Secondary,children:o}),n]}),id=({source:o})=>{const n=i(()=>{const[e,t]=go(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(nd,{title:Qe.THROUGHPUT_LAST_10_SECONDS,children:e(he,{$alignItems:"flex-end",$gap:4,children:[t(de,{size:pe.L,children:n.value}),t(de,{size:pe.XS,variant:Et.Span,children:n.units})]})})},ad=({source:o})=>{const{CopyButton:n}=fo();return t(nd,{title:Qe.NAMESPACE,children:e(he,{children:[t(jt,{variant:oo.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:yt.XS})]})})},ld=({source:e})=>t(nd,{title:Qe.KIND,children:t(he,{children:t(jt,{variant:oo.Blue,label:e.id.kind})})}),rd=({source:o})=>{const{CopyButton:n}=fo();return t(nd,{title:Qe.NAME,children:e(he,{children:[t(jt,{variant:oo.Blue,label:o.id.name}),t(n,{value:o.id.name,size:yt.XS})]})})},sd=({source:o})=>{const{isVm:n}=C();return t(Lt,{children:e(he,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!n&&t(id,{source:o}),!n&&t(ad,{source:o}),t(ld,{source:o}),t(rd,{source:o})]})})},cd=({source:e})=>e.pods?.length?t(Lt,{bgTint:"900",children:t(Rc,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,dd=({source:e})=>{const o=i(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?bo(e.workloadOdigosHealthStatus.status):Le.Unknown,title:Ut(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Zt,{...o,width:"100%"}):null},ud="calc(50% - 6px)",pd=({source:o,onClickRollout:n,onClickRollback:a})=>{const l=i(()=>{const{status:e,reasonEnum:t,message:i}=o.conditions?.rollout||{},a=Qt(e);return a?{status:a,title:t?.toLowerCase().includes("rollout")?Ut(t):`${Qe.ROLLOUT} ${Ut(t)}`,subTitle:i,action:a!==Le.Success?{icon:Ga,tooltip:Qe.ROLLOUT_RESTART,onClick:n}:void 0}:null},[o]),r=i(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},i=Qt(e);return i?{status:i,title:t?.toLowerCase().includes("rollback")?Ut(t):`${Qe.ROLLBACK} ${Ut(t)}`,subTitle:n,action:i!==Le.Success?{icon:Ga,tooltip:Qe.ROLLBACK_RECOVER,onClick:a}:void 0}:null},[o]);return l||r?e(he,{$gap:12,$alignItems:"stretch",children:[l&&t(Zt,{invertColors:!0,slim:!0,width:r?ud:"100%",...l}),r&&t(Zt,{invertColors:!0,slim:!0,width:ud,...r})]}):null},hd=p(null),md=f.div`
663
+ `,Jp=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=ho(e=>e.drawerEntityId),{items:r}=Ll().sourcesApi.useSources(),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(mo(s))!==JSON.stringify(mo(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[go({serviceName:o,attributes:e})]}if(o?.toLowerCase()===Wp)return[sl];const e=s?fo(s):void 0;return e?.length?e:[al]},[n,i,o,s]),p=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=ho.getState();e(vo(Et.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??"",region:s?.id.region??""})}:void 0;return e(qp,{onClick:p,$withClick:!!p,children:[e(me,{$gap:8,children:[t(bo,{icons:d}),t(pe,{size:he.XXS,children:o})]}),n&&t(qe,{status:Fe.Info,label:et.VIRTUAL,textSize:he.XXXS,invertColors:!0,tooltip:et.VIRTUAL_TOOLTIP})]})},Zp=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}},Qp=({source:o})=>{const n=v(),{k8sManifestApi:l}=Ll(),[r,c]=s(!0),[d,p]=s(void 0),[u,h]=s(!0),[m,g]=s(void 0);i(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>p(Zp(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:yo.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>g(Zp(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const f=a(()=>[{label:et.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:et.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:et.GET_POD_YAML,value:`kubectl get ${yo.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(Xt,{bgTint:"1000",children:[t(Xt,{bgTint:"900",richTitle:{icon:cl,title:et.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:f.map(({label:e,value:o},n)=>t(so,{label:e,value:o},`debug-cmd-${n}-${e}`))}),r?t(gt,{size:1}):t(Sr,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),u?t(gt,{size:1}):t(Sr,{bgTint:"800",codeBgColor:n.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},eu=({title:o,children:n})=>e(ee,{$gap:8,children:[t(pe,{size:he.XXXS,color:ue.Secondary,children:o}),n]}),tu=({source:o})=>{const n=a(()=>{const[e,t]=So(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(eu,{title:et.THROUGHPUT_LAST_10_SECONDS,children:e(me,{$alignItems:"flex-end",$gap:4,children:[t(pe,{size:he.L,children:n.value}),t(pe,{size:he.XS,variant:$t.Span,children:n.units})]})})},ou=({source:o})=>{const{CopyButton:n}=Pt();return t(eu,{title:et.NAMESPACE,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:Ct.XS})]})})},nu=({source:o})=>{const{CopyButton:n}=Pt(),i=o.id.region;return i?t(eu,{title:et.REGION,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:i}),t(n,{value:i,size:Ct.XS})]})}):null},iu=({source:e})=>{const o=e.markedForInstrumentation?.markedForInstrumentation??!1;return t(eu,{title:et.ENABLED,children:t(me,{children:t(Jt,{variant:o?ro.Green:ro.Default,label:o?et.ENABLED:et.DISABLED})})})},au=({source:e,label:o})=>t(eu,{title:et.KIND,children:t(me,{children:t(Jt,{variant:ro.Blue,label:o||e.id.kind})})}),lu=({source:o})=>{const{CopyButton:n}=Pt();return t(eu,{title:et.NAME,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:o.id.name}),t(n,{value:o.id.name,size:Ct.XS})]})})},ru=({source:o})=>{const{CopyButton:n}=Pt(),i=o.serviceName||o.id.name;return t(eu,{title:et.SERVICE_NAME,children:e(me,{children:[t(Jt,{variant:ro.Blue,label:i}),t(n,{value:i,size:Ct.XS})]})})},su=({source:o})=>{const{isVm:n,isConnector:i,isK8s:l}=S(),r=a(()=>Co(o.id.kind),[o.id.kind]);return t(Xt,{children:e(me,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[l&&t(tu,{source:o}),l&&t(ou,{source:o}),i&&t(nu,{source:o}),i&&t(iu,{source:o}),t(au,{source:o,label:r}),t(lu,{source:o}),(i||n)&&t(ru,{source:o})]})})},cu=({source:e})=>e.pods?.length&&e.podsOdigosHealthStatus?t(Xt,{bgTint:"900",children:t($p,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,du=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?xo(e.workloadOdigosHealthStatus.status):Fe.Unknown,title:Kt(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(no,{...o,width:"100%"}):null},pu="calc(50% - 6px)",uu=(e,t)=>{if(!e)return t;const o=e.toLowerCase();return o.includes("rollout")||o.includes("inject")||o.includes("restart")||o.includes("pod")?Kt(e):`${t} ${Kt(e)}`},hu=({source:o,onClickRollout:n,onClickRollback:l})=>{const r=o.rollout?.podsManifestInjectionStatus??o.conditions?.rollout,c=`${r?.status??""}:${r?.reasonEnum??""}`,[d,p]=s(()=>new Set);i(()=>{p(new Set)},[c]);const u=a(()=>{const{status:e,reasonEnum:t,message:o,actionItems:i}=r||{},a=io(e);if(!a)return null;const l=uu(t,et.ROLLOUT),s=o,c=(i??[]).flatMap(e=>e.type!==wo.RolloutWorkload?[]:[{"data-id":`rollout-action-${e.type}`,label:et.ROLLOUT,tooltip:e.userFacingText||void 0,leftIcon:dl,disabled:d.has(e.type),onClick:t=>{t.stopPropagation(),d.has(e.type)||(p(t=>new Set(t).add(e.type)),n())}}]);return{status:a,title:l,subTitle:s,action:c.length||a===Fe.Success?void 0:{icon:Qa,tooltip:et.ROLLOUT_RESTART,onClick:n},actionButtons:c.length?c:void 0}},[r,d,n]),h=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},i=io(e);return i?{status:i,title:uu(t,et.ROLLBACK),subTitle:n,action:i!==Fe.Success?{icon:Qa,tooltip:et.ROLLBACK_RECOVER,onClick:l}:void 0}:null},[o,l]);return u||h?e(me,{$gap:12,$alignItems:"stretch",children:[u&&t(no,{invertColors:!0,slim:!0,width:h?pu:"100%",...u}),h&&t(no,{invertColors:!0,slim:!0,width:pu,...h})]}):null},mu=h(null),gu=b.div`
250
664
  position: relative;
251
- `,gd=({children:e})=>{const o=a(null);return t(md,{ref:o,children:t(hd.Provider,{value:o,children:e})})},fd=f.div`
665
+ `,fu=({children:e})=>{const o=l(null);return t(gu,{ref:o,children:t(mu.Provider,{value:o,children:e})})},bu=b.div`
252
666
  position: fixed;
253
667
  top: ${({$coords:e})=>e.top}px;
254
668
  right: ${({$coords:e})=>e.right}px;
@@ -262,14 +676,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
262
676
  padding: 12px 16px;
263
677
  border-radius: 12px;
264
678
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
265
- `,bd=f.div`
679
+ `,vu=b.div`
266
680
  display: flex;
267
681
  align-items: flex-end;
268
682
  justify-content: space-between;
269
683
  gap: 8px;
270
- `,vd=f.div`
684
+ `,yu=b.div`
271
685
  flex: 1;
272
- `,yd=({width:o,onClose:n,onSave:i,saveTooltip:a,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:g})=>{const f=b(),v=h(hd),[y,C]=r(null);return vo(v??{current:null},n),m(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?dr(e(fd,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(Q,{$gap:4,children:[t(de,{size:pe.XXS,children:c}),t(de,{size:pe.XXXS,color:ue.Secondary,children:d})]}),e(bd,{children:[t(vd,{children:p}),e(he,{$gap:8,$width:"fit-content",$margin:`0 0 ${g||0} 0`,children:[t(me,{variant:fe.Secondary,onClick:l,leftIcon:Ca,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ge.S,textColor:f.v2.colors.red[500]}),t(me,{variant:fe.Primary,onClick:i,leftIcon:Fa,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ge.S})]})]}),t("div",{children:t(Fe,{status:Le.Warning,message:u})})]}),document.body):null},Cd=({language:o,overridden:n,onOverride:a,defaultValues:l})=>{const{tier:s}=C(),{formData:c,handleFormChange:d,resetFormData:u}=zt(l),p=i(()=>{if(!o)return[];const e=yo[o].community,t=s===$t.Onprem?yo[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,m]=r(!1),[g,f]=r(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(he,{$gap:4,$alignItems:"center",children:[n?t(Ye,{status:Le.Info,invertColors:!0,label:Qe.OVERIDDEN}):null,e(gd,{children:[t(Ee,{text:Qe.OVERRIDE_OTEL_DISTRO_NAME,children:t(vt,{icon:Ia,onClick:b})}),g&&t(yd,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:Qe.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:Qe.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Qe.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Qe.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Qe.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(bt,{label:Qe.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Sd=({overridden:o,onOverride:n,defaultValues:a,originalValues:l})=>{const{addNotification:s}=Gt(),{formData:c,handleFormChange:d,resetFormData:u}=zt(a),p=i(()=>Co.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=r(!1),[g,f]=r(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(he,{children:[o?t(Ye,{status:Le.Info,invertColors:!0,label:Qe.OVERIDDEN}):null,e(gd,{children:[t(Ee,{text:Qe.OVERRIDE_RUNTIME_DETAILS,children:t(vt,{icon:Ia,onClick:b})}),g&&t(yd,{width:"500px",onClose:b,onSave:async()=>{!c.version||So(c.version)?(m(!0),await n(c),m(!1),b()):s({type:Le.Warning,message:Ht.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Qe.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:Qe.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Qe.OVERRIDE_RUNTIME_DETAILS,subTitle:Qe.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Qe.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(he,{$gap:8,children:[t(bt,{label:Qe.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(xe,{label:Qe.RUNTIME_VERSION,placeholder:Qe.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},wd=({source:e})=>{const{isVm:o}=C(),{containers:n,containersRichTitle:a}=i(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?Qe.DETECTED_PROCESSES:`${e.id.kind} ${Qe.CONTAINERS}`,tooltip:t?.message||(o?Qe.DETECTED_PROCESSES_DESCRIPTION:Qe.DETECTED_CONTAINERS_DESCRIPTION),badge:Qt(t?.status)===Le.Loading?{status:Le.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(Lt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Q,{$gap:8,children:n.map(o=>o&&t($d,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},xd=f.div`
686
+ `,Cu=({width:o,onClose:n,onSave:i,saveTooltip:a,onDelete:l,deleteTooltip:r,title:c,subTitle:d,warning:p,children:u,pushButtonsWith:h})=>{const f=v(),b=m(mu),[y,C]=s(null);return To(b??{current:null},n),g(()=>{const e=b?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[b]),y?kr(e(bu,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(ee,{$gap:4,children:[t(pe,{size:he.XXS,children:c}),t(pe,{size:he.XXXS,color:ue.Secondary,children:d})]}),e(vu,{children:[t(yu,{children:u}),e(me,{$gap:8,$width:"fit-content",$margin:`0 0 ${h||0} 0`,children:[t(ge,{variant:be.Secondary,onClick:l,leftIcon:Ia,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:fe.S,textColor:f.v2.colors.red[500]}),t(ge,{variant:be.Primary,onClick:i,leftIcon:Ua,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:fe.S})]})]}),t("div",{children:t(Le,{status:Fe.Warning,message:p})})]}),document.body):null},Su=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:r}=S(),{formData:c,handleFormChange:d,resetFormData:p}=Ht(l),u=a(()=>{if(!o)return[];const e=ko[o].community,t=r===It.Onprem?ko[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,r]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(me,{$gap:4,$alignItems:"center",children:[n?t(qe,{status:Fe.Info,invertColors:!0,label:et.OVERIDDEN}):null,e(fu,{children:[t($e,{text:et.OVERRIDE_OTEL_DISTRO_NAME,children:t(yt,{icon:_a,onClick:b})}),g&&t(Cu,{width:"500px",onClose:b,onSave:async()=>{m(!0),await i(c),m(!1),b()},saveTooltip:et.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await i({otelDistroName:null}),m(!1),b()},deleteTooltip:et.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:et.OVERRIDE_OTEL_DISTRO_NAME,subTitle:et.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:et.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(vt,{label:et.OTEL_DISTRO_NAME,options:u,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},xu=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:r}=Yt(),{formData:c,handleFormChange:d,resetFormData:p}=Ht(i),u=a(()=>Eo.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=s(!1),[g,f]=s(!1),b=()=>{h||(g&&p(),f(e=>!e))};return e(me,{children:[o?t(qe,{status:Fe.Info,invertColors:!0,label:et.OVERIDDEN}):null,e(fu,{children:[t($e,{text:et.OVERRIDE_RUNTIME_DETAILS,children:t(yt,{icon:_a,onClick:b})}),g&&t(Cu,{width:"500px",onClose:b,onSave:async()=>{!c.version||Io(c.version)?(m(!0),await n(c),m(!1),b()):r({type:Fe.Warning,message:qt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:et.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:et.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:et.OVERRIDE_RUNTIME_DETAILS,subTitle:et.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:et.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(me,{$gap:8,children:[t(vt,{label:et.LANGUAGE,options:u,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(Te,{label:et.RUNTIME_VERSION,placeholder:et.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},wu=({source:e})=>{const{isVm:o}=S(),{containers:n,containersRichTitle:i}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?et.DETECTED_PROCESSES:`${e.id.kind} ${et.CONTAINERS}`,tooltip:t?.message||(o?et.DETECTED_PROCESSES_DESCRIPTION:et.DETECTED_CONTAINERS_DESCRIPTION),badge:io(t?.status)===Fe.Loading?{status:Fe.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(Xt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:n.map(o=>o&&t(Iu,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},Tu=b.div`
273
687
  display: flex;
274
688
  flex-direction: column;
275
689
  align-self: stretch;
@@ -277,26 +691,52 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
277
691
  padding: 8px 12px;
278
692
  border-radius: 8px;
279
693
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
280
- `,kd=f.div`
694
+ `,ku=b.div`
281
695
  display: flex;
282
696
  align-items: center;
283
697
  justify-content: center;
284
698
  padding: 8px;
285
699
  border-radius: 10px;
286
700
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
287
- `,Td=f.div`
701
+ `,Eu=b.div`
288
702
  display: flex;
289
703
  flex-direction: column;
290
704
  gap: 12px;
291
705
  padding: 8px 12px;
292
706
  border-radius: 8px;
293
707
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
294
- `,$d=({sourceId:o,...n})=>{const{containerName:a,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=b(),{sourcesApi:d}=kl(),u=i(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=i(()=>({language:to(n),version:wo(n)||void 0}),[n]),h=i(()=>!!s?.otelDistroName,[s]),m=i(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=i(()=>!l&&!u,[l,u]),f=i(()=>g?ja:Je(p.language),[g,p]),v=i(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),y=i(()=>g?{status:Le.Loading,label:Qe.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Le.Success:Le.Disabled,leftIcon:r?.otelDistroName?xa:ka,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(o,{containerName:a,...h?m:{},...u?p:{},...e}),S=i(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Qe.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Qe.TAIL_SAMPLING),e},[n]);return e(xd,{children:[e(he,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(he,{$gap:8,$alignItems:"center",children:[t(kd,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(de,{children:a}),t(jt,v?{variant:oo.Blue,label:v}:{variant:oo.Loader,label:Qe.DETECTING_RUNTIME_INFO}),t(Sd,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(he,{$gap:8,$alignItems:"center",children:[t(Ye,{...y,textSize:pe.XXXS}),t(Cd,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Td,{children:e(he,{$gap:10,$alignItems:"center",children:[t(jt,{variant:oo.Pink,label:Ut(r.agentEnabledStatus?.reasonEnum)||Qe.NO_AVAILABLE_AGENT}),t(de,{size:pe.XXXS,color:ue.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Td,{children:t(he,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(Ye,{label:e,leftIcon:xa,status:Le.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${o}`))})})]})},Id=({source:o,onClickRollout:n,onClickRollback:i})=>{const{isVm:a}=C();return e(Q,{$gap:12,children:[t(sd,{source:o}),t(dd,{source:o}),!a&&t(pd,{source:o,onClickRollout:n,onClickRollback:i}),!a&&t(wd,{source:o}),!a&&t(cd,{source:o})]})},Ed=f(Q)`
708
+ `,Iu=({sourceId:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=v(),{sourcesApi:d}=Ll(),p=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=a(()=>({language:lo(n),version:No(n)||void 0}),[n]),h=a(()=>!!s?.otelDistroName,[s]),m=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!p,[l,p]),f=a(()=>g?al:Ze(u.language),[g,u]),b=a(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),y=a(()=>g?{status:Fe.Loading,label:et.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Fe.Success:Fe.Disabled,leftIcon:r?.otelDistroName?Oa:Aa,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(o,{containerName:i,...h?m:{},...p?u:{},...e}),S=a(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(et.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(et.TAIL_SAMPLING),e},[n]);return e(Tu,{children:[e(me,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(me,{$gap:8,$alignItems:"center",children:[t(ku,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(pe,{children:i}),t(Jt,b?{variant:ro.Blue,label:b}:{variant:ro.Loader,label:et.DETECTING_RUNTIME_INFO}),t(xu,{overridden:p,onOverride:C,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(me,{$gap:8,$alignItems:"center",children:[t(qe,{...y,textSize:he.XXXS}),t(Su,{language:u.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Eu,{children:e(me,{$gap:10,$alignItems:"center",children:[t(Jt,{variant:ro.Pink,label:Kt(r.agentEnabledStatus?.reasonEnum)||et.NO_AVAILABLE_AGENT}),t(pe,{size:he.XXXS,color:ue.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Eu,{children:t(me,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(qe,{label:e,leftIcon:Oa,status:Fe.Success,invertColors:!0,useSecondaryTone:!0},`${i}-rule-${o}`))})})]})},Nu=b.div`
709
+ display: flex;
710
+ flex-direction: column;
711
+ gap: 10px;
712
+ padding: 10px 12px 10px 20px;
713
+ border-radius: 8px;
714
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
715
+ `,$u=b.div`
716
+ display: flex;
717
+ flex-wrap: wrap;
718
+ gap: 12px 24px;
719
+ `,Ou=({title:o,children:n})=>e(ee,{$gap:4,children:[t(pe,{size:he.XXXS,color:ue.Secondary,children:o}),n]}),Au=({processes:o})=>{const n=a(()=>[...o].sort((e,t)=>e.pid-t.pid),[o]);return n.length?e(ee,{$gap:6,children:[t(pe,{size:he.XXXS,color:ue.Secondary,children:`${et.PROCESSES} (${n.length})`}),n.map(o=>{const n=o.exe?.trim()||null,i=o.cmdline?.trim()||null;return e(Nu,{children:[t($u,{children:t(Ou,{title:et.PROCESS_PID,children:t(pe,{size:he.XS,children:String(o.pid)})})}),n?t(so,{label:et.EXECUTABLE,value:n,bgTint:"900"}):null,i&&i!==n?t(so,{label:et.COMMAND,value:i,bgTint:"900"}):null]},o.pid)})]}):null},Ru=b.div`
720
+ display: flex;
721
+ flex-direction: column;
722
+ align-self: stretch;
723
+ gap: 12px;
724
+ padding: 8px 12px;
725
+ border-radius: 8px;
726
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
727
+ `,Du=b.div`
728
+ display: flex;
729
+ align-items: center;
730
+ justify-content: center;
731
+ padding: 8px;
732
+ border-radius: 10px;
733
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
734
+ `,_u=e=>{if(!e)return $o.Unknown;const t=e.trim().toLowerCase();return{go:$o.Go,golang:$o.Go,javascript:$o.JavaScript,js:$o.JavaScript,node:$o.JavaScript,nodejs:$o.JavaScript,typescript:$o.JavaScript,python:$o.Python,java:$o.Java,dotnet:$o.DotNet,csharp:$o.CSharp,php:$o.Php,ruby:$o.Ruby,rust:$o.Rust,swift:$o.Swift,elixir:$o.Elixir}[t]??$o.Unknown},Pu=({source:o})=>{const n=v(),{isConnector:i,isVm:l}=S(),{sourcesApi:r}=Ll(),s=o.instrumentationReport,c=o.sourceConfig,d=l?s?.processes:null,p=a(()=>!(!c?.runtimeOverride?.language&&!c?.runtimeOverride?.version),[c]),u=a(()=>{const e=_u(s?.runtimeLanguage);return e!==$o.Unknown?e:o.runtimeInfo?.detectedLanguages?.[0]??$o.Unknown},[s?.runtimeLanguage,o.runtimeInfo?.detectedLanguages]),h=s?.runtimeVersion?.trim()||"",m=a(()=>{const e=_u(c?.runtimeOverride?.language);return{language:e!==$o.Unknown?e:u,version:c?.runtimeOverride?.version?.trim()||h||void 0}},[c,u,h]),g=a(()=>!!c?.distroOverride?.otelDistroName,[c]),f=a(()=>({otelDistroName:c?.distroOverride?.otelDistroName||void 0}),[c]),b=a(()=>{const{language:e,version:t}=m;return e!==$o.Unknown||t?e!==$o.Unknown&&t?`${e} • ${t}`:e!==$o.Unknown?e:t||null:null},[m]),y=!b&&!p&&"Instrumenting"===s?.state,C=a(()=>y||m.language===$o.Unknown?al:Ze(m.language),[y,m.language]),x=a(()=>{const e=s?.state??"",t=s?.instrumented||"Instrumented"===e,o=c?.distroOverride?.otelDistroName?.trim()||s?.sdkType?.trim();return"Instrumenting"===e?{status:Fe.Loading,label:Kt(s?.progressStage||e)||e}:"NotImplemented"===e||"Unsupported"===e?{status:Fe.Disabled,leftIcon:Aa,label:Kt(e)||e}:"Error"===e?{status:Fe.Error,leftIcon:Aa,label:"Error"}:t?{status:Fe.Success,leftIcon:Oa,label:o?`Instrumented | ${o}`:"Instrumented"}:{status:Fe.Disabled,leftIcon:Aa,label:et.UNINSTRUMENTED}},[s,c]),w=e=>r.update(o.id,{...g?f:{},...p?{language:m.language!==$o.Unknown?m.language:void 0,version:m.version}:{},...e});return(i||l)&&s?t(Xt,{bgTint:"1000",richTitle:{title:et.INSTRUMENTATION,tooltip:et.INSTRUMENTATION_DESCRIPTION,badge:{label:1}},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(ee,{$gap:8,children:e(Ru,{children:[e(me,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(me,{$gap:8,$alignItems:"center",children:[t(Du,{children:t(C,{size:24,fill:y||m.language===$o.Unknown?n.v2.colors.grey[400]:void 0})}),t(pe,{children:o.id.name}),y?t(Jt,{variant:ro.Loader,label:et.DETECTING_RUNTIME_INFO}):b?t(Jt,{variant:ro.Blue,label:b}):null,t(xu,{overridden:p,onOverride:w,defaultValues:{language:m.language!==$o.Unknown?m.language:void 0,version:m.version||""},originalValues:{language:u!==$o.Unknown?u:void 0,version:h}})]}),e(me,{$gap:8,$alignItems:"center",children:[t(qe,{...x,textSize:he.XXXS}),t(Su,{language:m.language!==$o.Unknown?m.language:null,overridden:g,onOverride:w,defaultValues:f})]})]}),d?.length?t(Au,{processes:d}):null]})})}):null},Lu=({source:o,onClickRollout:n,onClickRollback:i})=>{const{isK8s:a,isConnector:l,isVm:r}=S();return e(ee,{$gap:12,children:[t(su,{source:o}),t(du,{source:o}),a&&t(hu,{source:o,onClickRollout:n,onClickRollback:i}),a&&t(wu,{source:o}),(l||r)&&t(Pu,{source:o}),a&&t(cu,{source:o})]})},Fu=({source:e})=>{const o=e.containers||[];return t(Xt,{bgTint:"1000",richTitle:{title:et.INSTRUMENTED_LIBRARIES},children:o.length?o.map(e=>{const o=e.instrumentations||[];return t(Xt,{bgTint:"800",richTitle:{title:e.containerName,badge:{label:o.length}},withCollapse:!0,collapseIsDefaultOpen:!!o?.length,children:o?.length?t(ee,{children:o.map((e,o)=>t(zp,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))}):t(Re,{title:"No libraries found"})},e.containerName)}):t(Re,{title:"No containers found"})})},Mu=b(ee)`
295
735
  width: 100%;
296
736
  max-height: 320px;
297
737
  overflow-y: auto;
298
738
  gap: 8px;
299
- `,Nd=f(he)`
739
+ `,zu=b(me)`
300
740
  width: 100%;
301
741
  align-items: center;
302
742
  gap: 8px;
@@ -306,14 +746,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
306
746
  & > * {
307
747
  font-family: monospace !important;
308
748
  }
309
- `,Ad=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=b();return t(Ze,{isOpen:!!o,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:n,denyButton:{variant:fe.Secondary,label:"Cancel",onClick:n},approveButton:{variant:fe.Primary,label:"Confirm",onClick:i},children:o&&e(Ed,{children:[o.add.map(o=>e(Nd,{children:[t(Ye,{leftIcon:Sa,status:Le.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:pe.XXS}),t(de,{size:pe.XS,color:ue.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(Nd,{children:[t(Ye,{leftIcon:Ja,status:Le.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:pe.XXS}),t(de,{size:pe.XS,color:ue.Primary,children:o})]},`remove-${o}`))]})})};function Od(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 Rd(e){const t=Math.abs(e);return t>=1e9?`${Dd(e/1e9)}s`:t>=1e6?`${Dd(e/1e6)}ms`:t>=1e3?`${Dd(e/1e3)}μs`:String(Math.round(e))}function Dd(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Pd(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let i=0;for(let e=0;e+3<n.length;e+=4){const a=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=i+a;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Fd(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Ld(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 i=[t];for(let e=t.level+1;e<=o;e++){const t=i.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){i.push(e);break}}return i}function Md(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function _d(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],i=[{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 i[o%i.length]}var zd,Bd;function Xd(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Vd(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function Ud(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(zd||(zd={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Bd||(Bd={}));const Gd=({flamebearer:o,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:f,onResetZoom:v})=>{const y=b(),C=a(null),S=a(null),w=a({x:0,y:0}),x=a(o.numTicks),[k,T]=r({w:0,h:0}),[$,I]=r(""),[E,N]=r(null),[A,O]=r([]),[R,D]=r(!1),[P,F]=r(zd.Fit),[L,M]=r(Bd.Fit),[_,z]=r(!1),B=Math.max(1,Math.min(Math.floor(k.w*P),8192)),X=Math.max(1,Math.min(Math.floor(k.h*L),8192)),V=A.length>0?A[A.length-1]:null,U=V?.size??o.numTicks,G=i(()=>Pd(o),[o]);n(()=>{x.current!==o.numTicks&&(x.current=o.numTicks,O([]))},[o.numTicks]),n(()=>{if(!f)return;if(!V)return void f(null);const e=Ld(G,V),t=new Set;for(const n of e){const e=Od(o,n.nameIndex);e&&t.add(e)}f([...t])},[V,o,G,f]),m(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),n(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const H=i(()=>function(e,t,o,n,i,a={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Pd(e);let u=l?Ld(d,l):d;if(0===u.length)return null;if(r&&(u=u.filter(t=>r(Od(e,t.nameIndex))),0===u.length))return null;if(s&&(u=((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 i=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const a=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Od(e,l.nameIndex)===Od(e,t.nameIndex)&&i.add(Fd(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(Fd(e)))continue;let t=0;for(let o=0;o<e.level;o++){const a=n.get(o);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Fd(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=n??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(o/g,f)),v=i.trim(),y=b>8?1:0;return u.map(o=>{const n=o.level-p,i=(o.offset-h)/m*t,a=Math.max(o.size/m*t,1),l=n*b,r=Math.max(b-y,1),s=Od(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:Md(s,v)}})}(o,B,X,s,c,{zoomRoot:V,shouldKeepName:d,collapseRecursive:_,allRects:G}),[o,s,c,X,B,V,d,_,G]),j=i(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(H?.length?c.trim()?H.filter(e=>e.matchesSearch):H:[]),[H,c]),W=l(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Vd((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,j);if(n){const e=Fd(n);N(e);const t=U>0?(100*n.size/U).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";I(`${n.name}\ntotal ${Rd(n.size)} (${t}% of view, ${i}% of profile) · self ${Rd(n.self)}`)}else N(null),I("")},[j,o.numTicks,X,B,U]),K=l(e=>{W(e)},[W]),Y=l(()=>{N(null),I("")},[]),q=l(e=>{w.current={x:e.clientX,y:e.clientY}},[]),J=l(e=>{const{x:t,y:o}=w.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(B<2||X<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=Vd((e.clientX-n.left)/n.width*B,(e.clientY-n.top)/n.height*X,j);if(!i)return;g?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&((e,t)=>e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex)(a,t)?e.slice(0,-1):[...e,a]})},[j,X,B,g]);m(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(B,X),i=Math.min(t,16384/n);e.width=Math.floor(B*i),e.height=Math.floor(X*i),e.style.width=`${B}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,B,X),H?.length?((e,t,o,n,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:i,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=_d(s,a);e.fillStyle=p,e.fillRect(o,n,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Xd(d,r),g=`${s} (${Rd(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-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(Fd(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,B,X,H,c,y,E,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,B,X)))},[H,o.numTicks,E,c,X,B,y]);const Z=l(()=>D(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(U/o.numTicks*100))):100,ee=i(()=>((e,t,o)=>{const n=o??Pd(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(o,V,G),[o,V,G]),te=null!==ee,oe=A.length>0,ne=V?Od(o,V.nameIndex):"",ie=l(()=>{O([]),v?.()},[v]),re=l(()=>O(e=>e.slice(0,-1)),[]),se=l(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(he,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ae,{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:le.Left,size:It.S,value:_,onChange:z}),e(he,{$gap:8,children:[e(he,{children:[t(me,{variant:fe.Secondary,size:ge.S,label:"Reset zoom",leftIcon:Za,onClick:ie,disabled:!A.length}),t(me,{variant:fe.Secondary,size:ge.S,iconSize:20,leftIcon:Ja,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:re}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(de,{size:pe.XXS,color:ue.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(me,{variant:fe.Secondary,size:ge.S,iconSize:20,leftIcon:Sa,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(he,{children:[t(Ee,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(be,{variant:xo.Filled,options:[{value:zd.Fit,label:"W: Fit"},{value:zd.X10,label:"10x"}],selected:P,setSelected:F})}),t(Ee,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(be,{variant:xo.Filled,options:[{value:Bd.Fit,label:"H: Fit"},{value:Bd.X10,label:"10x"}],selected:L,setSelected:M})})]}),t(me,{variant:fe.Secondary,size:ge.S,iconSize:24,leftIcon:R?La:Qa,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ee,{fullWidth:!0,keepAlive:!0,text:$,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:P>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:q,onPointerMove:K,onPointerLeave:Y,onClick:J})})})})}),e(he,{$justifyContent:"space-between",children:[t(de,V?{size:pe.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${Rd(U)} samples in view`}:{size:pe.XXXS,color:y.v2.colors.silver[300],children:g?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(de,{size:pe.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Ud(h.totalBytesUsed)} / ${Ud(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Hd=[ko.Go,ko.Java],jd="Profiling Symbols";function Wd(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?ko.Go:e.includes(" ")||e.includes("(")?ko.Java:ko.Go)(e);if(o===ko.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const o=t.lastIndexOf("/"),n=t.indexOf(".",o+1);if(-1===n)return null;const i=t.slice(0,n),a=t.slice(n+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new He(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new He(i,a);return r.Verify()?r:null})(e);return t?{language:o,golang:t}:null}if(o===ko.Java){const t=(e=>{let t=e.trim();if(!t)return null;const o=t.indexOf("(");-1!==o&&(t=t.slice(0,o).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new je(a,l);return r.Verify()?r:null})(e);return t?{language:o,java:t}:null}return null}function Kd(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function Yd(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>Kd(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function qd(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Jd(e,t){return e.className===t.className&&e.methodName===t.methodName}function Zd(e,t,o,n){const i=Wd(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!Yd(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[We.Golang]?.some(e=>qd(e,i.golang)),l=!!i.java&&!!o[We.Java]?.some(e=>Jd(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}var Qd,eu,tu;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(Qd||(Qd={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(eu||(eu={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(tu||(tu={}));const ou=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function nu(e,t){const o=(e=>e.split(" ")[0]??"")(e);return(!t.includes(tu.FilterOutVoid)||"void"!==o)&&!!(!t.includes(tu.OnlyWithReturnValues)||e.includes(" ")&&"void"!==o&&ou.test(o))}const iu=({rows:e,languages:o,instrumentation:n,searchQuery:a,filters:r,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!o?.includes(ko.Java),h=i(()=>{const t=c?new Set(c):null,o=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!o||e.name.toLowerCase().includes(o)))},[e,a,c]),m=i(()=>{const e=[];if(n.selectionEnabled&&e.push({id:eu.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:tu.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:tu.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const o=e.cells.find(e=>e.key===Qd.Symbol)?.rawValue?.toString()??"";return!(t.includes(eu.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&nu(o,t)}}},[n,p]),g=i(()=>[{key:Qd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Qd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Qd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=i(()=>h.map(e=>{const t=n.getSymbolState(e.name),o=t.showCheckbox;return{id:e.name,cells:[{key:Qd.Symbol,rawValue:e.name},{key:Qd.Self,rawValue:Rd(e.self)},{key:Qd.Total,rawValue:Rd(e.total)}],isSelected:o?n.isSelected(e.name):void 0,onSelect:o?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:o?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!o,checkboxDisabled:o?t.checkboxDisabled:void 0,checkboxTooltip:o?t.checkboxTooltip:void 0}}),[h,n]),b=l(e=>{const t=e.cells[0].rawValue,o=n.getSymbolState(t),i=[];return o.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ca,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Sa,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:el,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(To,{variant:$o.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:r,onFiltersChange:s,activeRowId:d,scrollSignal:u,getRowActions:b})};var au;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(au||(au={}));const lu=f(Q)`
749
+ `,Bu=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=v();return t(Qe,{isOpen:!!o,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:n,denyButton:{variant:be.Secondary,label:"Cancel",onClick:n},approveButton:{variant:be.Primary,label:"Confirm",onClick:i},children:o&&e(Mu,{children:[o.add.map(o=>e(zu,{children:[t(qe,{leftIcon:Na,status:Fe.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(pe,{size:he.XS,color:ue.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(zu,{children:[t(qe,{leftIcon:pl,status:Fe.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:he.XXS}),t(pe,{size:he.XS,color:ue.Primary,children:o})]},`remove-${o}`))]})})};function Xu(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 Uu(e){const t=Math.abs(e);return t>=1e9?`${Vu(e/1e9)}s`:t>=1e6?`${Vu(e/1e6)}ms`:t>=1e3?`${Vu(e/1e3)}μs`:String(Math.round(e))}function Vu(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Hu(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let i=0;for(let e=0;e+3<n.length;e+=4){const a=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=i+a;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function ju(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Gu(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}function Wu(e,t,o){return((e,t)=>{const o=[];for(let n=0;n<=t.level;n++){let i;for(const o of e)if(o.level===n&&t.offset>=o.offset&&t.offset+t.size<=o.offset+o.size){i=o;break}if(!i)return o;o.push(i)}return o})(t,o).map(t=>Xu(e,t.nameIndex))}function Ku(e,t,o){if(0===o.length)return null;let n=null,i=null;for(let a=0;a<o.length;a++){const l=o[a];let r=null;for(const o of t)o.level===a&&Xu(e,o.nameIndex)===l&&(n&&(o.offset<n.offset||o.offset+o.size>n.offset+n.size)||(!r||o.size>r.size)&&(r=o));if(!r)return null;n=r,i=r}return i}function Yu(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 i=[t];for(let e=t.level+1;e<=o;e++){const t=i.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){i.push(e);break}}return i}function qu(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function Ju(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],i=[{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 i[o%i.length]}var Zu,Qu;function eh(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function th(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 oh(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`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Zu||(Zu={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Qu||(Qu={}));const nh=({flamebearer:o,maxRowPx:n,searchQuery:c="",shouldKeepName:d,minHostHeight:p=200,onFullscreenChange:u,profilingSlots:h,onFrameClick:m,onZoomedSymbolsChange:f,onResetZoom:b})=>{const y=v(),C=l(null),S=l(null),x=l({x:0,y:0}),[w,T]=s({w:0,h:0}),[k,E]=s(""),[I,N]=s(null),[$,O]=s([]),[A,R]=s(!1),[D,_]=s(Zu.Fit),[P,L]=s(Qu.Fit),[F,M]=s(!1),z=Math.max(1,Math.min(Math.floor(w.w*D),8192)),B=Math.max(1,Math.min(Math.floor(w.h*P),8192)),X=$.length>0?$[$.length-1]:null,U=X?.size??o.numTicks,V=a(()=>Hu(o),[o]),H=l({fb:o,rects:V});i(()=>{const e=H.current;e.fb!==o&&(H.current={fb:o,rects:V},O(t=>{if(0===t.length)return t;const n=((e,t,o,n,i)=>{const a=[];for(const l of i){const i=Wu(e,t,l);if(0===i.length)break;const r=Ku(o,n,i);if(!r)break;a.push(r)}return a})(e.fb,e.rects,o,V,t);return n.length===t.length&&n.every((e,o)=>Gu(e,t[o]))?t:n}))},[o,V]),i(()=>{if(!f)return;if(!X)return void f(null);const e=Yu(V,X),t=new Set;for(const n of e){const e=Xu(o,n.nameIndex);e&&t.add(e)}f([...t])},[X,o,V,f]),g(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),i(()=>{if(!A)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[A]),i(()=>(u?.(A),()=>{A&&u?.(!1)}),[A,u]);const j=a(()=>function(e,t,o,n,i,a={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Hu(e);let p=l?Yu(d,l):d;if(0===p.length)return null;if(r&&(p=p.filter(t=>r(Xu(e,t.nameIndex))),0===p.length))return null;if(s&&(p=((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 i=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const a=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Xu(e,l.nameIndex)===Xu(e,t.nameIndex)&&i.add(ju(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(ju(e)))continue;let t=0;for(let o=0;o<e.level;o++){const a=n.get(o);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(ju(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,p),0===p.length))return null;const u=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=p.reduce((e,t)=>Math.max(e,t.level-u),0)+1,f=n??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(o/g,f)),v=i.trim(),y=b>8?1:0;return p.map(o=>{const n=o.level-u,i=(o.offset-h)/m*t,a=Math.max(o.size/m*t,1),l=n*b,r=Math.max(b-y,1),s=Xu(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:qu(s,v)}})}(o,z,B,n,c,{zoomRoot:X,shouldKeepName:d,collapseRecursive:F,allRects:V}),[o,n,c,B,z,X,d,F,V]),G=a(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(j?.length?c.trim()?j.filter(e=>e.matchesSearch):j:[]),[j,c]),W=r(e=>{if(z<2||B<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=th((e.clientX-t.left)/t.width*z,(e.clientY-t.top)/t.height*B,G);if(n){const e=ju(n);N(e);const t=U>0?(100*n.size/U).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";E(`${n.name}\ntotal ${Uu(n.size)} (${t}% of view, ${i}% of profile) · self ${Uu(n.self)}`)}else N(null),E("")},[G,o.numTicks,B,z,U]),K=r(e=>{W(e)},[W]),Y=r(()=>{N(null),E("")},[]),q=r(e=>{x.current={x:e.clientX,y:e.clientY}},[]),J=r(e=>{const{x:t,y:o}=x.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(z<2||B<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=th((e.clientX-n.left)/n.width*z,(e.clientY-n.top)/n.height*B,G);if(!i)return;m?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&Gu(a,t)?e.slice(0,-1):[...e,a]})},[G,B,z,m]);g(()=>{const e=S.current;if(!e||z<2||B<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(z,B),i=Math.min(t,16384/n);e.width=Math.floor(z*i),e.height=Math.floor(B*i),e.style.width=`${z}px`,e.style.height=`${B}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,z,B),j?.length?((e,t,o,n,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:i,h:l,name:s,size:d,matchesSearch:p}=t;if(c&&!p)continue;const{fill:u,text:h}=Ju(s,a);e.fillStyle=u,e.fillRect(o,n,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(i-1,0),Math.max(l-1,0));const m=eh(d,r),g=`${s} (${Uu(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-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(ju(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,z,B,j,c,y,I,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,z,B)))},[j,o.numTicks,I,c,B,z,y]);const Z=r(()=>R(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(U/o.numTicks*100))):100,ee=a(()=>((e,t,o)=>{const n=o??Hu(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(o,X,V),[o,X,V]),te=null!==ee,oe=$.length>0,ne=X?Xu(o,X.nameIndex):"",ie=r(()=>{O([]),b?.()},[b]),ae=r(()=>O(e=>e.slice(0,-1)),[]),se=r(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:A?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:p,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(me,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(le,{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:re.Left,size:Nt.S,value:F,onChange:M}),e(me,{$gap:8,children:[e(me,{children:[t(ge,{variant:be.Secondary,size:fe.S,label:"Reset zoom",leftIcon:ul,onClick:ie,disabled:!$.length}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:pl,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:ae}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(pe,{size:he.XXS,color:ue.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:20,leftIcon:Na,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(me,{children:[t($e,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ve,{variant:Oo.Filled,options:[{value:Zu.Fit,label:"W: Fit"},{value:Zu.X10,label:"10x"}],selected:D,setSelected:_})}),t($e,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ve,{variant:Oo.Filled,options:[{value:Qu.Fit,label:"H: Fit"},{value:Qu.X10,label:"10x"}],selected:P,setSelected:L})})]}),t(ge,{variant:be.Secondary,size:fe.S,iconSize:24,leftIcon:A?Va:hl,tooltip:A?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t($e,{fullWidth:!0,keepAlive:!0,text:k,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:A?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:D>1?"auto":"hidden",overflowY:P>1?"auto":"hidden"},children:t("div",{style:{width:z||"100%",height:B||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:I?"pointer":"default"},onPointerDown:q,onPointerMove:K,onPointerLeave:Y,onClick:J})})})})}),e(me,{$justifyContent:"space-between",children:[t(pe,X?{size:he.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${Uu(U)} samples in view`}:{size:he.XXXS,color:y.v2.colors.silver[300],children:m?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(pe,{size:he.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${oh(h.totalBytesUsed)} / ${oh(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},ih=[$o.Go,$o.Java],ah="Profiling Symbols";function lh(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?$o.Go:e.includes(" ")||e.includes("(")?$o.Java:$o.Go)(e);if(o===$o.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const o=t.lastIndexOf("/"),n=t.indexOf(".",o+1);if(-1===n)return null;const i=t.slice(0,n),a=t.slice(n+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new Ge(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new Ge(i,a);return r.Verify()?r:null})(e);return t?{language:o,golang:t}:null}if(o===$o.Java){const t=(e=>{let t=e.trim();if(!t)return null;const o=t.indexOf("(");-1!==o&&(t=t.slice(0,o).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new We(a,l);return r.Verify()?r:null})(e);return t?{language:o,java:t}:null}return null}function rh(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function sh(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>rh(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function ch(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function dh(e,t){return e.className===t.className&&e.methodName===t.methodName}function ph(e,t,o,n){const i=lh(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!sh(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[Ke.Golang]?.some(e=>ch(e,i.golang)),l=!!i.java&&!!o[Ke.Java]?.some(e=>dh(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}var uh,hh,mh;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(uh||(uh={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(hh||(hh={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(mh||(mh={}));const gh=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function fh(e,t){const o=(e=>e.split(" ")[0]??"")(e);return(!t.includes(mh.FilterOutVoid)||"void"!==o)&&!!(!t.includes(mh.OnlyWithReturnValues)||e.includes(" ")&&"void"!==o&&gh.test(o))}const bh=({rows:e,languages:o,instrumentation:n,searchQuery:i,filters:l,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:p})=>{const u=!!o?.includes($o.Java),h=a(()=>{const t=c?new Set(c):null,o=i?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!o||e.name.toLowerCase().includes(o)))},[e,i,c]),m=a(()=>{const e=[];if(n.selectionEnabled&&e.push({id:hh.OnlyInstrumentable,label:"Only show instrumentable symbols"}),u&&(e.push({id:mh.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:mh.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const o=e.cells.find(e=>e.key===uh.Symbol)?.rawValue?.toString()??"";return!(t.includes(hh.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&fh(o,t)}}},[n,u]),g=a(()=>[{key:uh.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:uh.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:uh.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=a(()=>h.map(e=>{const t=n.getSymbolState(e.name),o=t.showCheckbox;return{id:e.name,cells:[{key:uh.Symbol,rawValue:e.name},{key:uh.Self,rawValue:Uu(e.self)},{key:uh.Total,rawValue:Uu(e.total)}],isSelected:o?n.isSelected(e.name):void 0,onSelect:o?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:o?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!o,checkboxDisabled:o?t.checkboxDisabled:void 0,checkboxTooltip:o?t.checkboxTooltip:void 0}}),[h,n]),b=r(e=>{const t=e.cells[0].rawValue,o=n.getSymbolState(t),i=[];return o.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ia,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Na,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:ml,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(Ao,{variant:Ro.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:l,onFiltersChange:s,activeRowId:d,scrollSignal:p,getRowActions:b})};var vh;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(vh||(vh={}));const yh=b(ee)`
310
750
  width: 100%;
311
751
  flex: 1;
312
752
  border-radius: 16px;
313
753
  overflow: hidden;
314
754
  background: ${({theme:e})=>e.v2.colors.silver[800]};
315
755
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
316
- `,ru=f.div`
756
+ `,Ch=b.div`
317
757
  display: flex;
318
758
  align-items: center;
319
759
  gap: 10px;
@@ -321,11 +761,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
321
761
  padding: 12px 12px 8px;
322
762
  background: ${({theme:e})=>e.v2.colors.silver[800]};
323
763
  border-radius: 16px 16px 0 0;
324
- `,su=f(he)`
764
+ `,Sh=b(me)`
325
765
  flex-shrink: 0;
326
766
  align-items: center;
327
767
  gap: 4px;
328
- `,cu=f.div`
768
+ `,xh=b.div`
329
769
  flex: 1;
330
770
  display: flex;
331
771
  align-items: stretch;
@@ -333,20 +773,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
333
773
  padding: 16px;
334
774
  background: ${({theme:e})=>e.v2.colors.silver[800]};
335
775
  border-radius: 0 0 16px 16px;
336
- `,du=f(Q)`
776
+ `,wh=b(ee)`
337
777
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
338
778
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
339
779
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
340
780
  gap: 10px;
341
- `,uu=f(Q)`
781
+ `,Th=b(ee)`
342
782
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
343
783
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
344
784
  gap: 10px;
345
- `,pu=f(he)`
785
+ `,kh=b(me)`
346
786
  width: 100%;
347
787
  min-height: 32px;
348
788
  flex-shrink: 0;
349
- `,hu=({source:o,onFlameFullscreenChange:c})=>{const d=b(),u=o.id,{profilingApi:p}=kl(),[h,m]=r(!0),[g,f]=r(au.Both),[v,y]=r(""),[C,S]=r({}),[w,x]=r(!1),k=a(!1);n(()=>{k.current||(k.current=!0,p.enableProfiling?.(u),x(!0))},[p,u]);const{data:T}=p.useSlots({skip:!w,pollInterval:3e3,fetchPolicy:"network-only"}),{data:$,loading:I,refetch:E}=p.useSourceProfiling(u,{skip:!w,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),N=$?.profileJson??null,A=i(()=>(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),[N]),O=i(()=>A?(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 i=n[o+1],a=n[o+2],l=Od(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})(A.flamebearer):[],[A]),R=g===au.Table||g===au.Both,D=g===au.Flame||g===au.Both,P=R&&D,F=i(()=>o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),[o]),L=i(()=>((e,t)=>{if(!t?.includes(ko.Java))return;const o=(e?.[Qd.Symbol]?.filter(Boolean)??[]).filter(e=>e===tu.FilterOutVoid||e===tu.OnlyWithReturnValues);return 0!==o.length?e=>nu(e,o):void 0})(C,F),[C,F]),{instrumentation:M,pendingCount:_,pendingModify:z,closeModify:B,openBulkModify:X,resetSelection:V,confirmModify:U}=function({source:e,languages:t,rows:o}){const{instrumentationRulesApi:n,capabilities:a}=kl(),{items:s}=n.useRules(),[c,d]=r(new Set),[u,p]=r(new Set),[h,m]=r(null),g=i(()=>(e=>{const t=new Set(e??[]);return Hd.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=i(()=>((e,t)=>{const o=e.filter(e=>e.type===Ke.CustomInstrumentation&&e.ruleName===jd&&Yd(e.sourceScopes,t));return o.find(e=>e.sourceScopes?.sources?.some(e=>Kd(e,t.id)))??o[0]??null})(s,e),[s,e]),v=f&&g.length>0,y=i(()=>{const t=new Map;for(const n of o){const o=!!Wd(n.name,g),i=Zd(n.name,e,g,s),a=!!b&&i.some(e=>e.rule.ruleId===b.ruleId),l=i.filter(e=>e.rule.ruleId!==b?.ruleId),r=!a&&l.length>0,c=v&&o,d=r;let u;if(r){const e=[...new Set(l.map(e=>e.rule.ruleName))];u=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let p=!1,h="Add this symbol to the “Profiling Symbols” rule";r?h=u??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?o?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(n.name,{parsable:o,inManagedRule:a,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[o,s,e,g,f,v,b]),C=i(()=>{const e=new Set;return y.forEach((t,o)=>{t.inManagedRule&&e.add(o)}),e},[y]),S=i(()=>[...c].filter(e=>y.get(e)?.addEnabled&&!C.has(e)),[c,y,C]),w=i(()=>[...u].filter(e=>C.has(e)),[u,C]),x=S.length+w.length,k=l(e=>{const t=y.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[y,u,c]),T=l((e,t)=>{const o=y.get(e);o&&!o.checkboxDisabled&&(o.inManagedRule?p(o=>{const n=new Set(o);return t?n.delete(e):n.add(e),n}):d(o=>{const n=new Set(o);return t?n.add(e):n.delete(e),n}))},[y]),$=l(()=>{d(new Set),p(new Set)},[]),I=l(t=>{(async()=>{const o=t.add.map(e=>Wd(e,g)).filter(e=>!!e),i=t.remove.map(e=>Wd(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=((e,t,o)=>{const n=e.customInstrumentations??{};let i=[...n[We.Golang]??[]],a=[...n[We.Java]??[]];for(const e of o)e.golang&&(i=i.filter(t=>!qd(t,e.golang))),e.java&&(a=a.filter(t=>!Jd(t,e.java)));for(const e of t)e.golang&&!i.some(t=>qd(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>Jd(t,e.java))&&a.push(e.java);return{customInstrumentations:{[We.Golang]:i,[We.Java]:a},isEmpty:0===i.length&&0===a.length}})(b,o,i);t?await n.remove(b.ruleId,Ke.CustomInstrumentation):await n.update(b.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(b,e),Ke.CustomInstrumentation)}else o.length>0&&await n.create(((e,t)=>{const o=e.map(e=>e.golang).filter(e=>!!e),n=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:jd,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[We.Golang]:o,[We.Java]:n}}})(o,e),Ke.CustomInstrumentation)})()},[b,g,e,n]),E=l(()=>{x&&m({add:S,remove:w})},[x,S,w]),N=l(e=>m({add:[e],remove:[]}),[]),A=l(e=>m({add:[],remove:[e]}),[]),O=l(()=>m(null),[]),R=l(()=>{h&&(I(h),m(null),$())},[h,I,$]),D=l(e=>y.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[y]);return{instrumentation:i(()=>({getSymbolState:D,onAdd:N,onRemove:A,selectionEnabled:v,isSelected:k,onToggleSymbol:T}),[D,N,A,v,k,T]),pendingCount:x,pendingModify:h,closeModify:O,openBulkModify:E,resetSelection:$,confirmModify:R}}({source:o,languages:F,rows:O}),[G,H]=r(null),[j,W]=r(0),[K,Y]=r(null),q=l(e=>{H(e),W(e=>e+1),f(e=>e===au.Flame?au.Both:e)},[]);return!N&&I?t(gt,{$height:"70vh",children:t(Ct,{withSpinner:!0})}):e(lu,{$gap:0,$width:"100%",children:[e(ru,{children:[t(Ee,{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(su,{children:t(de,{size:pe.S,weight:500,color:ue.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(he,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(ao,{value:v,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(be,{variant:xo.Filled,options:[{value:au.Table,label:"Top table"},{value:au.Flame,label:"Flame graph"},{value:au.Both,label:"Both"}],selected:g,setSelected:f}),t(me,h?{variant:fe.Secondary,size:ge.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(tl,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:fe.Secondary,size:ge.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(tl,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(cu,{$gap:R&&D?16:0,children:A?e(s,{children:[R&&e(du,{$splitWithFlame:P,children:[e(pu,{$justifyContent:"space-between",children:[e(Q,{$margin:"0 0 0 20px",children:[t(de,{size:pe.XXXS,nowrap:!0,children:"Please select symbols to"}),e(he,{$gap:8,children:[e(he,{children:[t(ol,{size:24}),t(de,{size:pe.S,color:ue.Success,nowrap:!0,children:"Custom Instrument"})]}),t(me,{leftIcon:Ta,variant:fe.Secondary,size:ge.S,onClick:()=>window.open(`${Me}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(he,{$gap:8,children:[K&&t(Ee,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(Ye,{label:`Zoomed: ${K.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:pe.XXS})}),t(me,{variant:fe.Secondary,size:ge.S,label:"Download snapshot",rightIcon:nl,onClick:()=>{if(!N)return;const e=new Blob([N],{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:!N})]})]}),t(iu,{rows:O,languages:F,instrumentation:M,searchQuery:v,filters:C,onFiltersChange:S,zoomedSymbols:K,highlightSymbol:G,scrollSignal:j})]}),D&&e(uu,{$splitWithTable:P,children:[e(pu,{$justifyContent:"space-between",children:[t(Ye,{label:A?`Total in view ${Rd(A.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:pe.XXS}),e(he,{$gap:12,children:[!h&&t(me,{variant:fe.Secondary,size:ge.S,label:"Refresh",leftIcon:Ga,onClick:E}),t(ae,{label:"Auto refresh",labelAlign:le.Left,size:It.S,value:h,onChange:m})]})]}),t(Gd,{flamebearer:A.flamebearer,maxRowPx:24,searchQuery:v,shouldKeepName:L,minHostHeight:280,onFullscreenChange:c,profilingSlots:T??null,onFrameClick:q,onZoomedSymbolsChange:Y,onResetZoom:()=>H(null)},g)]})]}):t(gt,{children:t(Oe,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Ad,{pendingModify:z,onClose:B,onConfirm:U}),t(Io,{isOpen:_>0,richTitle:{icon:Ma,title:"Profiling Symbols",badge:{label:_}},actions:[{id:"profiling-bulk-cancel",type:io.Button,buttonProps:{variant:fe.Secondary,size:ge.S,label:"Cancel",onClick:V}},{id:"profiling-bulk-apply",type:io.Button,buttonProps:{variant:fe.Primary,size:ge.S,label:"Modify Rule",leftIcon:Ia,onClick:X}}]})]})},mu=f.div`
789
+ `,Eh=({source:o,onFlameFullscreenChange:n})=>{const d=v(),p=o.id,{profilingApi:u}=Ll(),[h,m]=s(!0),[g,f]=s(vh.Both),[b,y]=s(""),[C,S]=s({}),[x,w]=s(!1),T=l(!1);i(()=>{T.current||(T.current=!0,u.enableProfiling?.(p),w(!0))},[u,p]);const{data:k}=u.useSlots({skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),{data:E,loading:I,refetch:N}=u.useSourceProfiling(p,{skip:!x,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),$=E?.profileJson??null,O=a(()=>(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}})($),[$]),A=a(()=>O?(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 i=n[o+1],a=n[o+2],l=Xu(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})(O.flamebearer):[],[O]),R=g===vh.Table||g===vh.Both,D=g===vh.Flame||g===vh.Both,_=R&&D,P=o.runtimeInfo?.detectedLanguages?.join("\0")??"",L=o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??"").join("\0")??"",F=a(()=>P?P.split("\0"):L?L.split("\0"):void 0,[P,L]),M=a(()=>((e,t)=>{if(!t?.includes($o.Java))return;const o=(e?.[uh.Symbol]?.filter(Boolean)??[]).filter(e=>e===mh.FilterOutVoid||e===mh.OnlyWithReturnValues);return 0!==o.length?e=>fh(e,o):void 0})(C,F),[C,F]),{instrumentation:z,pendingCount:B,pendingModify:X,closeModify:U,openBulkModify:V,resetSelection:H,confirmModify:j}=function({source:e,languages:t,rows:o}){const{instrumentationRulesApi:n,capabilities:i}=Ll(),{items:l}=n.useRules(),[c,d]=s(new Set),[p,u]=s(new Set),[h,m]=s(null),g=a(()=>(e=>{const t=new Set(e??[]);return ih.filter(e=>t.has(e))})(t),[t]),f=i.canCreateInstrumentationRule,b=`${e.id.namespace}\0${e.id.kind}\0${e.id.name}`,v=a(()=>((e,t)=>{const o=e.filter(e=>e.type===Ye.CustomInstrumentation&&e.ruleName===ah&&sh(e.sourceScopes,t));return o.find(e=>e.sourceScopes?.sources?.some(e=>rh(e,t.id)))??o[0]??null})(l,e),[l,b]),y=f&&g.length>0,C=a(()=>{const t=new Map;for(const n of o){const o=!!lh(n.name,g),i=ph(n.name,e,g,l),a=!!v&&i.some(e=>e.rule.ruleId===v.ruleId),r=i.filter(e=>e.rule.ruleId!==v?.ruleId),s=!a&&r.length>0,c=y&&o,d=s;let p;if(s){const e=[...new Set(r.map(e=>e.rule.ruleName))];p=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let u=!1,h="Add this symbol to the “Profiling Symbols” rule";s?h=p??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?o?u=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(n.name,{parsable:o,inManagedRule:a,otherRules:r,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:p,addEnabled:u,addTooltip:h})}return t},[o,l,b,g,f,y,v]),S=a(()=>{const e=new Set;return C.forEach((t,o)=>{t.inManagedRule&&e.add(o)}),e},[C]),x=a(()=>[...c].filter(e=>C.get(e)?.addEnabled&&!S.has(e)),[c,C,S]),w=a(()=>[...p].filter(e=>S.has(e)),[p,S]),T=x.length+w.length,k=r(e=>{const t=C.get(e);return t?.inManagedRule?!p.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[C,p,c]),E=r((e,t)=>{const o=C.get(e);o&&!o.checkboxDisabled&&(o.inManagedRule?u(o=>{const n=new Set(o);return t?n.delete(e):n.add(e),n}):d(o=>{const n=new Set(o);return t?n.add(e):n.delete(e),n}))},[C]),I=r(()=>{d(new Set),u(new Set)},[]),N=r(t=>{(async()=>{const o=t.add.map(e=>lh(e,g)).filter(e=>!!e),i=t.remove.map(e=>lh(e,g)).filter(e=>!!e);if(v){const{customInstrumentations:e,isEmpty:t}=((e,t,o)=>{const n=e.customInstrumentations??{};let i=[...n[Ke.Golang]??[]],a=[...n[Ke.Java]??[]];for(const e of o)e.golang&&(i=i.filter(t=>!ch(t,e.golang))),e.java&&(a=a.filter(t=>!dh(t,e.java)));for(const e of t)e.golang&&!i.some(t=>ch(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>dh(t,e.java))&&a.push(e.java);return{customInstrumentations:{[Ke.Golang]:i,[Ke.Java]:a},isEmpty:0===i.length&&0===a.length}})(v,o,i);t?await n.remove(v.ruleId,Ye.CustomInstrumentation):await n.update(v.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(v,e),Ye.CustomInstrumentation)}else o.length>0&&await n.create(((e,t)=>{const o=e.map(e=>e.golang).filter(e=>!!e),n=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:ah,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[Ke.Golang]:o,[Ke.Java]:n}}})(o,e),Ye.CustomInstrumentation)})()},[v,g,e,n]),$=r(()=>{T&&m({add:x,remove:w})},[T,x,w]),O=r(e=>m({add:[e],remove:[]}),[]),A=r(e=>m({add:[],remove:[e]}),[]),R=r(()=>m(null),[]),D=r(()=>{h&&(N(h),m(null),I())},[h,N,I]),_=r(e=>C.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[C]);return{instrumentation:a(()=>({getSymbolState:_,onAdd:O,onRemove:A,selectionEnabled:y,isSelected:k,onToggleSymbol:E}),[_,O,A,y,k,E]),pendingCount:T,pendingModify:h,closeModify:R,openBulkModify:$,resetSelection:I,confirmModify:D}}({source:o,languages:F,rows:A}),[G,W]=s(null),[K,Y]=s(0),[q,J]=s(null),Z=r(e=>{W(e),Y(e=>e+1),f(e=>e===vh.Flame?vh.Both:e)},[]),Q=r(e=>{J(t=>{if(null===e)return null===t?t:null;if(t&&t.length===e.length){const o=new Set(t);if(e.every(e=>o.has(e)))return t}return e})},[]),te=r(()=>W(null),[]);return!$&&I?t(ft,{$height:"70vh",children:t(St,{withSpinner:!0})}):e(yh,{$gap:0,$width:"100%",children:[e(Ch,{children:[t($e,{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(Sh,{children:t(pe,{size:he.S,weight:500,color:ue.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(me,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(po,{value:b,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(ve,{variant:Oo.Filled,options:[{value:vh.Table,label:"Top table"},{value:vh.Flame,label:"Flame graph"},{value:vh.Both,label:"Both"}],selected:g,setSelected:f}),t(ge,h?{variant:be.Secondary,size:fe.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(gl,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:be.Secondary,size:fe.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(gl,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(xh,{$gap:R&&D?16:0,children:O?e(c,{children:[R&&e(wh,{$splitWithFlame:_,children:[e(kh,{$justifyContent:"space-between",children:[e(ee,{$margin:"0 0 0 20px",children:[t(pe,{size:he.XXXS,nowrap:!0,children:"Please select symbols to"}),e(me,{$gap:8,children:[e(me,{children:[t(fl,{size:24}),t(pe,{size:he.S,color:ue.Success,nowrap:!0,children:"Custom Instrument"})]}),t(ge,{leftIcon:Ra,variant:be.Secondary,size:fe.S,onClick:()=>window.open(`${Me}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(me,{$gap:8,children:[q&&t($e,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(qe,{label:`Zoomed: ${q.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:he.XXS})}),t(ge,{variant:be.Secondary,size:fe.S,label:"Download snapshot",rightIcon:bl,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(bh,{rows:A,languages:F,instrumentation:z,searchQuery:b,filters:C,onFiltersChange:S,zoomedSymbols:q,highlightSymbol:G,scrollSignal:K})]}),D&&e(Th,{$splitWithTable:_,children:[e(kh,{$justifyContent:"space-between",children:[t(qe,{label:O?`Total in view ${Uu(O.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:he.XXS}),e(me,{$gap:12,children:[!h&&t(ge,{variant:be.Secondary,size:fe.S,label:"Refresh",leftIcon:Qa,onClick:N}),t(le,{label:"Auto refresh",labelAlign:re.Left,size:Nt.S,value:h,onChange:m})]})]}),t(nh,{flamebearer:O.flamebearer,maxRowPx:24,searchQuery:b,shouldKeepName:M,minHostHeight:280,onFullscreenChange:n,profilingSlots:k??null,onFrameClick:Z,onZoomedSymbolsChange:Q,onResetZoom:te})]})]}):t(ft,{children:t(Re,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Bu,{pendingModify:X,onClose:U,onConfirm:j}),t(Do,{isOpen:B>0,richTitle:{icon:Ha,title:"Profiling Symbols",badge:{label:B}},actions:[{id:"profiling-bulk-cancel",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,label:"Cancel",onClick:H}},{id:"profiling-bulk-apply",type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Modify Rule",leftIcon:_a,onClick:V}}]})]})},Ih=b.div`
350
790
  position: relative;
351
791
  display: flex;
352
792
  align-items: center;
@@ -354,23 +794,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
354
794
  padding: 8px 16px;
355
795
  border-radius: 12px;
356
796
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
357
- `,gu=f.div`
797
+ `,Nh=b.div`
358
798
  display: flex;
359
799
  flex-direction: column;
360
800
  gap: 4px;
361
801
  flex: 1;
362
802
  min-width: 0;
363
803
  opacity: ${({$disabled:e})=>e?.4:1};
364
- `,fu=f.div`
804
+ `,$h=b.div`
365
805
  flex-shrink: 0;
366
806
  display: flex;
367
807
  align-items: center;
368
808
  margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
369
- `,bu=f.div`
809
+ `,Oh=b.div`
370
810
  min-width: 0;
371
811
  white-space: pre;
372
812
  overflow-x: auto;
373
- `,vu=f.div`
813
+ `,Ah=b.div`
374
814
  position: absolute;
375
815
  top: 50%;
376
816
  right: 8px;
@@ -379,24 +819,24 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
379
819
  pointer-events: none;
380
820
  transition: opacity 0.15s ease;
381
821
 
382
- ${mu}:hover & {
822
+ ${Ih}:hover & {
383
823
  opacity: 1;
384
824
  pointer-events: auto;
385
825
  }
386
- `,yu=({name:o,summary:n,disabled:i=!1,onJumpToRule:a})=>{const l=b();return e(mu,{children:[e(gu,{$disabled:i,children:[o&&t(de,{size:pe.XXXS,color:ue.Secondary,nowrap:!0,children:o}),t(bu,{children:t(w,{parts:n})})]}),i&&t(fu,{$reserveJumpSpace:!!a,children:t(Ye,{label:Eo,textSize:pe.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(vu,{children:t(Ee,{text:Qe.OPEN_IN_SAMPLING_PAGE,children:t(me,{"data-id":"sampling-rule-jump",variant:fe.Primary,size:ge.S,leftIcon:Qa,onClick:a})})})]})},Cu=f.div`
826
+ `,Rh=({name:o,summary:n,disabled:i=!1,onJumpToRule:a})=>{const l=v();return e(Ih,{children:[e(Nh,{$disabled:i,children:[o&&t(pe,{size:he.XXXS,color:ue.Secondary,nowrap:!0,children:o}),t(Oh,{children:t(w,{parts:n})})]}),i&&t($h,{$reserveJumpSpace:!!a,children:t(qe,{label:_o,textSize:he.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(Ah,{children:t($e,{text:et.OPEN_IN_SAMPLING_PAGE,children:t(ge,{"data-id":"sampling-rule-jump",variant:be.Primary,size:fe.S,leftIcon:hl,onClick:a})})})]})},Dh=b.div`
387
827
  opacity: 0;
388
828
  pointer-events: none;
389
829
  transition: opacity 0.15s ease;
390
- `,Su=f.div`
391
- &:hover ${Cu} {
830
+ `,_h=b.div`
831
+ &:hover ${Dh} {
392
832
  opacity: 1;
393
833
  pointer-events: auto;
394
834
  }
395
- `,wu=f.div`
835
+ `,Ph=b.div`
396
836
  display: flex;
397
837
  align-items: center;
398
838
  padding: 4px 12px;
399
- `,xu=({source:e,onRedirectToSampling:o})=>t(Lt,{bgTint:"1000",richTitle:{title:Qe.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t($u,{container:e,onRedirectToSampling:o},e.containerName))});var ku;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(ku||(ku={}));const Tu=e=>"noisy"===e.type?x(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?T(e.rule,"source"):[],$u=({container:o,onRedirectToSampling:n})=>{const[a,l]=r(ku.All),s=ro(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=i(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),u=i(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=i(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=i(()=>a===ku.Noisy?d:a===ku.HighlyRelevant?u:a===ku.CostReduction?p:[...d,...u,...p],[a,u,p]),m=d.length+u.length+p.length,g=i(()=>(e,t)=>{s({ruleId:e,category:t}),n()},[n,s]),f=t(Cu,{children:t(me,{"data-id":"sampling-container-create-rule",variant:fe.Secondary,size:ge.S,label:No,rightIcon:Sa,onClick:e=>{e.stopPropagation(),n()}})});return t(Su,{children:e(Lt,{bgTint:"900",richTitle:{title:o.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Lt,{bgTint:"800",richTitle:{title:Qe.HEAD_SAMPLING,badge:{label:c.length}},children:[t(de,{size:pe.XXS,children:Qe.NOISY_OPERATIONS}),t(Q,{$gap:4,children:c.map(e=>t(yu,{name:e.name,summary:x(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(wu,{children:t(de,{size:pe.XS,color:ue.Secondary,children:Qe.HEAD_SAMPLING})}),m?e(Lt,{bgTint:"800",richTitle:{title:Qe.TAIL_SAMPLING,badge:{label:m}},children:[t(be,{options:(b=d.length,v=u.length,y=p.length,[{value:ku.All,label:"All",badge:{label:b+v+y,textSize:pe.XXXS}},{value:ku.Noisy,label:Qe.NOISY_OPERATIONS,badge:{label:b,textSize:pe.XXXS}},{value:ku.HighlyRelevant,label:Qe.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:pe.XXXS}},{value:ku.CostReduction,label:Qe.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:pe.XXXS}}]),selected:a,setSelected:l}),t(Q,{$gap:4,children:h.length?h.map(e=>t(yu,{name:e.rule.name,summary:Tu(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Oe,{title:`No ${a===ku.All?`${ku.Noisy}, ${ku.HighlyRelevant} and ${ku.CostReduction}`:a} operations`})})]}):t(wu,{children:t(de,{size:pe.XS,color:ue.Secondary,children:Qe.TAIL_SAMPLING})})]})});var b,v,y},Iu=[mo.Deployment,mo.StatefulSet,mo.DaemonSet,mo.DeploymentConfig,mo.Rollout,mo.Pod];var Eu;(e=>{e.Workload="Workload",e.Pod="Pod"})(Eu||(Eu={}));const Nu=e=>!!e&&Qt(e.status)===Le.Error,Au=e=>Nu(e.healthStatus),Ou=e=>Nu(e.odigosHealthStatus)||(e.processes??[]).some(Au),Ru=e=>Nu(e.agentInjectedStatus)||Nu(e.odigosHealthStatus)||(e.containers??[]).some(Ou),Du=({onClose:o,sourceId:s,onRedirectToSampling:c})=>{const d=b(),{isVm:u}=C(),{sourcesApi:p,configApi:h}=kl(),{selectedStreamName:m}=et(),{genericForm:g,loadSource:f,validateFormData:v}=El(),{data:y}=h.useEffectiveConfig(),[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(!1),[I,E]=r(Nc.Overview),[N,A]=r(null),[O,R]=r({openFor:null}),D=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:Nc.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:Nc.Pods,podName:e.podName,containerName:o.containerName})},[]),a=l((e,o,n)=>{const i=Fc({identifyingAttributes:n.identifyingAttributes});t({tab:Nc.Pods,podName:e.podName,containerName:o.containerName,processPid:i})},[]),s=l(()=>t(null),[]);return i(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:a,clearJumpToTarget:s}),[e,o,n,a,s])})();n(()=>{D.jumpToTarget&&E(D.jumpToTarget.tab)},[D.jumpToTarget]),n(()=>{N&&JSON.stringify(so(s))!==JSON.stringify(so(N))&&A(null)},[s,N]);const P=a(!1),F=l(async()=>A(await p.fetchById(s)||null),[s,p]);n(()=>{if(P.current||(F(),P.current=!0),!S){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,S]),n(()=>{N&&f(N)},[N]);const L=N&&Iu.includes(N.id.kind),M=i(()=>{const e=[],o=(N?.pods??[]).some(Ru);return e.push({value:Nc.Overview,label:Qe.OVERVIEW}),u||(e.push({value:Nc.Pods,label:Qe.PODS,icon:o?e=>t(Ha,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:Nc.PeerSources,label:Qe.PEER_SOURCES}),y?.profiling?.enabled&&e.push({value:Nc.Profiling,label:Qe.PROFILING}),e.push({value:Nc.Sampling,label:Qe.SAMPLING}),e.push({value:Nc.Debug,label:Qe.DEBUG})),e},[u,y,N?.pods]),_=l(()=>w(!0),[]),z=i(()=>()=>{o(),c()},[o,c]),B=l(()=>{N&&f(N),w(!1)},[N]),X=l(async()=>{if(!N||!g)return;const{errorMessage:e,preparedFormData:t}=v();if(e)return;const o=t.otelServiceName!==N.id.name?t.otelServiceName:"";await p.update(s,{...t,otelServiceName:o}),w(!1)},[N,g,v,s,p]),V=l(()=>k(!0),[]),U=l(async()=>{N&&(await p.persistV2({[Ot]:[{namespace:N.id.namespace,name:N.id.name,kind:N.id.kind,selected:!1,currentStreamName:m}]}),k(!1),o())},[N,p,m,o]),G=l(()=>{R({openFor:Eu.Workload})},[]),H=l(e=>{E(e),D.clearJumpToTarget()},[D]),j=l(async()=>{await p.recoverFromRollback(s)},[p,s]),W=l(()=>R({openFor:null}),[]),K=l(async()=>{O.openFor===Eu.Workload?await p.restartWorkloads([s]):O.openFor===Eu.Pod&&O.podNamespace&&O.podName&&await p.restartPod(O.podNamespace,O.podName),W()},[O,p,s,W]),Y=i(()=>{const{kind:e,name:t}=s;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[s]),q=i(()=>{const e=[];return S||I===Nc.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:Ia,active:S,onClick:_}),!u&&L&&e.push({id:"edit-source-btn-restart",label:Qe.ROLLOUT,icon:il,onClick:G}),e.push({id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Ca,color:d.v2.colors.red[500],active:x,onClick:V})),e},[I,S,x,u,L,_,G,V,d]),J=i(()=>{if(!N)return[];const e=[],t={backgroundColor:"transparent",textSize:pe.S};return e.push({...t,label:N.id.name,leftIcon:u?void 0:Ua}),N.serviceName&&N.serviceName!==N.id.name&&e.push({...t,label:N.serviceName,leftIcon:Va,textColor:d.v2.colors.silver[200]}),e},[N,d,u]);if(!N)return t(se,{isOpen:!0,children:t(gt,{$height:"80vh",children:t(Ct,{withSpinner:!0})})});const Z=I===Nc.Profiling?T?"95vw":"fit-content":S?void 0:"60vw";return e(Gc,{value:D,children:[t(se,{isOpen:!0,width:Z,minWidth:"777px",header:{icon:u?al:Ao(N.containers)[0],titleBadges:J,onClose:()=>{H(Nc.Overview),A(null),$(!1),o()},actions:q},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:fe.Primary,onClick:X}]:[]},children:t(ht,{$padding:"4px 12px 12px",children:e(Q,{$gap:16,children:[!S&&M.length>1&&t(be,{options:M,selected:I,setSelected:H}),(()=>{switch(I){case Nc.Overview:return S?t(Ms,{}):t(Id,{source:N,onClickRollout:G,onClickRollback:j});case Nc.Pods:return t(Yc,{source:N,onClickRestartPod:L?(e,t)=>R({openFor:Eu.Pod,podNamespace:e,podName:t}):void 0});case Nc.PeerSources:return t(Jc,{source:N});case Nc.Profiling:return t(hu,{source:N,onFlameFullscreenChange:$});case Nc.Sampling:return t(xu,{source:N,onRedirectToSampling:z});case Nc.Debug:return t(od,{source:N});default:return null}})()]})})}),t(ir,{target:"source",action:"uninstrument",isOpen:x,onClose:()=>k(!1),onApprove:U}),t(Ze,{isOpen:O.openFor===Eu.Workload,title:Y.title,description:Y.description,onClose:W,denyButton:{label:"Go back",variant:fe.Secondary,onClick:W},approveButton:{label:Ft.CONFIRM,variant:fe.Primary,onClick:K}}),t(ir,{target:"pod",action:"restart",description:Qe.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:O.openFor===Eu.Pod,onClose:W,onApprove:K,overrideApproveButtonLabel:Qe.DELETE_POD_TO_RESTART})]})},Pu=f.div`
839
+ `,Lh=({source:e,onRedirectToSampling:o})=>t(Xt,{bgTint:"1000",richTitle:{title:et.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t(zh,{container:e,onRedirectToSampling:o},e.containerName))});var Fh;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(Fh||(Fh={}));const Mh=e=>"noisy"===e.type?T(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?E(e.rule,"source"):[],zh=({container:o,onRedirectToSampling:n})=>{const[i,l]=s(Fh.All),r=ho(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]),p=a(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),u=a(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=a(()=>i===Fh.Noisy?d:i===Fh.HighlyRelevant?p:i===Fh.CostReduction?u:[...d,...p,...u],[i,p,u]),m=d.length+p.length+u.length,g=a(()=>(e,t)=>{r({ruleId:e,category:t}),n()},[n,r]),f=t(Dh,{children:t(ge,{"data-id":"sampling-container-create-rule",variant:be.Secondary,size:fe.S,label:Po,rightIcon:Na,onClick:e=>{e.stopPropagation(),n()}})});return t(_h,{children:e(Xt,{bgTint:"900",richTitle:{title:o.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Xt,{bgTint:"800",richTitle:{title:et.HEAD_SAMPLING,badge:{label:c.length}},children:[t(pe,{size:he.XXS,children:et.NOISY_OPERATIONS}),t(ee,{$gap:4,children:c.map(e=>t(Rh,{name:e.name,summary:T(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(Ph,{children:t(pe,{size:he.XS,color:ue.Secondary,children:et.HEAD_SAMPLING})}),m?e(Xt,{bgTint:"800",richTitle:{title:et.TAIL_SAMPLING,badge:{label:m}},children:[t(ve,{options:(b=d.length,v=p.length,y=u.length,[{value:Fh.All,label:"All",badge:{label:b+v+y,textSize:he.XXXS}},{value:Fh.Noisy,label:et.NOISY_OPERATIONS,badge:{label:b,textSize:he.XXXS}},{value:Fh.HighlyRelevant,label:et.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:he.XXXS}},{value:Fh.CostReduction,label:et.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:he.XXXS}}]),selected:i,setSelected:l}),t(ee,{$gap:4,children:h.length?h.map(e=>t(Rh,{name:e.rule.name,summary:Mh(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Re,{title:`No ${i===Fh.All?`${Fh.Noisy}, ${Fh.HighlyRelevant} and ${Fh.CostReduction}`:i} operations`})})]}):t(Ph,{children:t(pe,{size:he.XS,color:ue.Secondary,children:et.TAIL_SAMPLING})})]})});var b,v,y},Bh=[yo.Deployment,yo.StatefulSet,yo.DaemonSet,yo.DeploymentConfig,yo.Rollout,yo.Pod];var Xh;(e=>{e.Workload="Workload",e.Pod="Pod"})(Xh||(Xh={}));const Uh=e=>!!e&&io(e.status)===Fe.Error,Vh=e=>Uh(e.healthStatus),Hh=e=>Uh(e.odigosHealthStatus)||(e.processes??[]).some(Vh),jh=e=>Uh(e.agentInjectedStatus)||Uh(e.odigosHealthStatus)||(e.containers??[]).some(Hh),Gh=({onClose:o,sourceId:n,onRedirectToSampling:c})=>{const d=v(),{isVm:p,isConnector:u,isK8s:h}=S(),{sourcesApi:m,configApi:g}=Ll(),{selectedStreamName:f}=tt(),{genericForm:b,loadSource:y,validateFormData:C}=Bl(),{data:x}=g.useEffectiveConfig(),[w,T]=s(!1),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(Ep.Overview),[A,R]=s(null),[D,_]=s({openFor:null}),P=(()=>{const[e,t]=s(null),o=r(e=>{t({tab:Ep.Pods,podName:e.podName})},[]),n=r((e,o)=>{t({tab:Ep.Pods,podName:e.podName,containerName:o.containerName})},[]),i=r((e,o,n)=>{const i=Rp({identifyingAttributes:n.identifyingAttributes});t({tab:Ep.Pods,podName:e.podName,containerName:o.containerName,processPid:i})},[]),l=r(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:l}),[e,o,n,i,l])})();i(()=>{P.jumpToTarget&&O(P.jumpToTarget.tab)},[P.jumpToTarget]),i(()=>{A&&JSON.stringify(mo(n))!==JSON.stringify(mo(A))&&R(null)},[n,A]);const L=l(!1),F=r(async()=>R(await m.fetchById(n)||null),[n,m]);i(()=>{if(L.current||(F(),L.current=!0),!w){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,w]),i(()=>{A&&y(A)},[A]);const M=A&&Bh.includes(A.id.kind),z=a(()=>{const e=[],o=(A?.pods??[]).some(jh),n=(i=A,(i?.containers??[]).some(e=>(e.instrumentations??[]).some(e=>!1===e.healthy)));var i;const a=e=>t(il,{...e,fill:d.v2.colors.red[500]});return e.push({value:Ep.Overview,label:et.OVERVIEW}),h?(e.push({value:Ep.Pods,label:et.PODS,icon:o?a:void 0}),e.push({value:Ep.Libraries,label:et.LIBRARIES,icon:n?a:void 0}),e.push({value:Ep.PeerSources,label:et.PEER_SOURCES}),x?.profiling?.enabled&&e.push({value:Ep.Profiling,label:et.PROFILING}),e.push({value:Ep.Sampling,label:et.SAMPLING}),e.push({value:Ep.Debug,label:et.DEBUG}),e):e},[h,x,A?.pods,d]),B=r(()=>T(!0),[]),X=a(()=>()=>{o(),c()},[o,c]),U=r(()=>{A&&y(A),T(!1)},[A]),V=r(async()=>{if(!A||!b)return;const{errorMessage:e,preparedFormData:t}=C();if(e)return;const o=t.otelServiceName!==A.id.name?t.otelServiceName:"";await m.update(n,{...t,otelServiceName:o}),T(!1)},[A,b,C,n,m]),H=r(()=>E(!0),[]),j=r(async()=>{A&&(await m.persistV2({[Rt]:[{namespace:A.id.namespace,name:A.id.name,kind:A.id.kind,region:A.id.region??"",selected:!1,currentStreamName:f}]}),E(!1),o())},[A,m,f,o]),G=r(()=>{_({openFor:Xh.Workload})},[]),W=r(e=>{O(e),P.clearJumpToTarget()},[P]),K=r(async()=>{await m.recoverFromRollback(n)},[m,n]),Y=r(()=>_({openFor:null}),[]),q=r(async()=>{D.openFor===Xh.Workload?await m.restartWorkloads([n]):D.openFor===Xh.Pod&&D.podNamespace&&D.podName&&await m.restartPod(D.podNamespace,D.podName),Y()},[D,m,n,Y]),J=a(()=>{const{kind:e,name:t}=n;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[n]),Z=a(()=>{const e=[];return w||$===Ep.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:_a,active:w,onClick:B}),h&&M&&e.push({id:"edit-source-btn-restart",label:et.ROLLOUT,icon:dl,onClick:G}),e.push({id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Ia,color:d.v2.colors.red[500],active:k,onClick:H})),e},[$,w,k,h,M,B,G,H,d]),Q=a(()=>{if(!A)return[];const e=[],t={backgroundColor:"transparent",textSize:he.S};return e.push({...t,label:A.id.name,leftIcon:h?nl:void 0}),A.serviceName&&A.serviceName!==A.id.name&&e.push({...t,label:A.serviceName,leftIcon:ol,textColor:d.v2.colors.silver[200]}),e},[A,d,h]);if(!A)return t(ce,{isOpen:!0,children:t(ft,{$height:"80vh",children:t(St,{withSpinner:!0})})});const te=$===Ep.Profiling?I?"95vw":"fit-content":w?void 0:"60vw",oe=p?vl:u?Ka:Lo(A.containers)[0];return e(Xp,{value:P,children:[t(ce,{isOpen:!0,width:te,minWidth:"777px",header:{icon:oe,titleBadges:Q,onClose:()=>{W(Ep.Overview),R(null),N(!1),o()},actions:Z},footer:{actions:w?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:U},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:V}]:[]},children:t(mt,{$padding:"4px 12px 12px",children:e(ee,{$gap:16,children:[!w&&z.length>1&&t(ve,{options:z,selected:$,setSelected:W}),(()=>{switch($){case Ep.Overview:return w?t(Zs,{}):t(Lu,{source:A,onClickRollout:G,onClickRollback:K});case Ep.Pods:return t(Gp,{source:A,onClickRestartPod:M?(e,t)=>_({openFor:Xh.Pod,podNamespace:e,podName:t}):void 0});case Ep.Libraries:return t(Fu,{source:A});case Ep.PeerSources:return t(Kp,{source:A});case Ep.Profiling:return t(Eh,{source:A,onFlameFullscreenChange:N});case Ep.Sampling:return t(Lh,{source:A,onRedirectToSampling:X});case Ep.Debug:return t(Qp,{source:A});default:return null}})()]})})}),t(Cr,{target:"source",action:"uninstrument",isOpen:k,onClose:()=>E(!1),onApprove:j}),t(Qe,{isOpen:D.openFor===Xh.Workload,title:J.title,description:J.description,onClose:Y,denyButton:{label:"Go back",variant:be.Secondary,onClick:Y},approveButton:{label:Ft.CONFIRM,variant:be.Primary,onClick:q}}),t(Cr,{target:"pod",action:"restart",description:et.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:D.openFor===Xh.Pod,onClose:Y,onApprove:q,overrideApproveButtonLabel:et.DELETE_POD_TO_RESTART})]})},Wh=b.div`
400
840
  display: flex;
401
841
  align-items: center;
402
842
  gap: 8px;
@@ -406,9 +846,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
406
846
  &:hover {
407
847
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
408
848
  }
409
- `,Fu=f.div`
849
+ `,Kh=b.div`
410
850
  flex: 1;
411
- `,Lu=({onClick:o})=>{const n=b().v2.colors.red[500];return e(Pu,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(de,{size:pe.XS,weight:500,color:n,children:Po}),t(Ca,{size:16,fill:n})]})};const Mu={[Al.EditAutoNoisy]:{title:Ko,subTitle:Wo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Al.EditAutoCostReduction]:{title:jo,subTitle:Ho,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Al.EditAutoHighlyRelevant]:{title:Go,subTitle:Uo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},_u=({isOpen:e,title:o,subTitle:n,onClose:i,footer:a,renderBody:l})=>t(se,{isOpen:e,width:qo,header:{icon:ll,title:o,subTitle:n,onClose:i},footer:a,children:l?l():t(ht,{$padding:"12px",children:t(Us,{})})}),zu=({isOpen:a,onClose:s,onSubmit:c,validateForm:d,onNavigateToDuplicate:u})=>{const{category:p,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Nl(Al.Create),[b,v]=r(!1);n(()=>{a&&(m(),v(!1))},[a]);const y=l(()=>{v(!1),c(h)},[h,c]),C=l(()=>{if(d){const e=d(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify($(t)))(h,p)?v(!0):y()},[h,p,d,f,y]),S=i(()=>b?((e,t)=>{switch(e){case"noisy":return x(N(t));case"highlyRelevant":return k(E(t));case"costReduction":return T(I(t))}})(p,h):[],[b,p,h]),w={note:g?{status:Le.Warning,message:g.message,action:u?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>u(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Oo,variant:fe.Secondary,size:ge.S,onClick:s},{"data-id":"sampling-create-btn-submit",label:No,variant:fe.Primary,size:ge.S,onClick:C,disabled:!!g}]};return e(o,{children:[t(_u,{isOpen:a,title:_o[p],subTitle:Fo[p],onClose:s,footer:w}),t(Ze,{isOpen:b,title:Xo,description:Bo,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:zo,variant:fe.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:No,variant:fe.Primary,onClick:y},children:e(Q,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(de,{size:pe.XS,weight:500,color:ue.Secondary,children:Vo}),t("div",{style:{width:"100%"},children:t(Kl,{summary:S})})]})})]})},Bu=({onClose:n,onDelete:a,onSaveEdit:r,validateForm:s,onNavigateToDuplicate:c})=>{const{data:d,isEditing:u,formData:p,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Nl(Al.View),b=d?.rule.name||Mo,v=u&&d?Lo[d.category]:`${b} preview`,y=l(()=>{if(d&&u){if(s){const e=s(p);if(e)return void f(e)}r(p,d.rule.ruleId,d.samplingId),m()}},[d,u,p,r,s,f,m]),C=l(()=>{d&&a(d.rule.ruleId,d.samplingId)},[d,a]),S=i(()=>{if(!d)return;const i=g?{message:g.message,onViewRule:c?()=>c(g.ruleId):void 0}:null;return function(n){if(n.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Lu,{onClick:l}),r&&t(Fe,{status:Le.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Fu,{}),t(me,{"data-id":"sampling-view-edit-btn-cancel",label:Oo,variant:fe.Secondary,size:ge.S,onClick:i}),t(me,{"data-id":"sampling-view-edit-btn-save",label:Ro,variant:fe.Primary,size:ge.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=n;return{children:e(o,{children:[t(Lu,{onClick:i}),t(Fu,{}),t(me,{"data-id":"sampling-view-btn-cancel",label:Oo,variant:fe.Secondary,size:ge.S,onClick:a}),t(me,{"data-id":"sampling-view-btn-edit",label:Do,variant:fe.Primary,size:ge.S,onClick:l})]})}}(u?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:n,onEdit:h})},[d,u,g,m,y,C,h,n,c]);return t(_u,{isOpen:!!d,title:v,subTitle:d?Fo[d.category]:"",onClose:n,footer:S})},Xu=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Nl(Al.EditAutoNoisy),r=l(()=>n(i,a),[n,i,a]);return t(Gu,{formType:Al.EditAutoNoisy,isOpen:e,onClose:o,onSave:r})},Vu=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Nl(Al.EditAutoCostReduction),r=l(()=>n(i,a),[n,i,a]);return t(Gu,{formType:Al.EditAutoCostReduction,isOpen:e,onClose:o,onSave:r})},Uu=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i}=Nl(Al.EditAutoHighlyRelevant),a=l(()=>n(i),[n,i]);return t(Gu,{formType:Al.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:a})},Gu=({formType:e,isOpen:o,onClose:n,onSave:i})=>{const a=Mu[e];return t(_u,{isOpen:o,title:a.title,subTitle:a.subTitle,onClose:n,footer:{actions:[{"data-id":a.cancelId,label:Oo,variant:fe.Secondary,size:ge.S,onClick:n},{"data-id":a.saveId,label:Yo,variant:fe.Primary,size:ge.S,onClick:i}]}})},Hu=e=>{switch(e.formType){case Al.Create:return t(Ll,{formType:Al.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(zu,{...e})});case Al.View:return t(Ll,{formType:Al.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Bu,{...e})});case Al.EditAutoNoisy:return t(Ll,{formType:Al.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Xu,{...e})});case Al.EditAutoCostReduction:return t(Ll,{formType:Al.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Vu,{...e})});case Al.EditAutoHighlyRelevant:return t(Ll,{formType:Al.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Uu,{...e})})}},ju=({token:n,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=fo(),m=!a||i||!c.newToken;return Jo({key:"Enter",active:!m},s),e(he,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(xe,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(he,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(Ct,{title:"Saving...",withGradient:!0}):e(o,{children:[t(me,{variant:fe.Secondary,size:ge.S,leftIcon:La,onClick:r,disabled:i}),t(me,{variant:fe.Primary,size:ge.S,leftIcon:Fa,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(de,{size:pe.XS,children:new Array(55).fill("•").join("")}),e(he,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(vt,{icon:Ia,onClick:l})]})]})},Wu=({expiresAt:e,callbackValid:o,callbackExpired:a})=>{const{formatTimeAgo:l}=Kt(),r=i(()=>l(e),[e,l]),s=i(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=i(()=>Zo(e,0)?Le.Error:Zo(e,2592e6)?Le.Warning:Le.Success,[e]),d=i(()=>c===Le.Success?Fa:c===Le.Warning?rl:Ha,[c]);return n(()=>{c===Le.Success?o():c===Le.Error&&a()},[c]),t(Ee,{text:s,children:t(Ye,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},Ku=f.div`
851
+ `,Yh=({onClick:o})=>{const n=v().v2.colors.red[500];return e(Wh,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(pe,{size:he.XS,weight:500,color:n,children:Bo}),t(Ia,{size:16,fill:n})]})};const qh={[Ul.EditAutoNoisy]:{title:en,subTitle:Qo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Ul.EditAutoCostReduction]:{title:Zo,subTitle:Jo,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Ul.EditAutoHighlyRelevant]:{title:qo,subTitle:Yo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Jh=({isOpen:e,title:o,subTitle:n,onClose:i,footer:a,renderBody:l})=>t(ce,{isOpen:e,width:on,header:{icon:yl,title:o,subTitle:n,onClose:i},footer:a,children:l?l():t(mt,{$padding:"12px",children:t(ic,{})})}),Zh=({isOpen:n,onClose:l,onSubmit:c,validateForm:d,onNavigateToDuplicate:p})=>{const{category:u,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Xl(Ul.Create),[b,v]=s(!1);i(()=>{n&&(m(),v(!1))},[n]);const y=r(()=>{v(!1),c(h)},[h,c]),C=r(()=>{if(d){const e=d(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify(I(t)))(h,u)?v(!0):y()},[h,u,d,f,y]),S=a(()=>b?((e,t)=>{switch(e){case"noisy":return T(O(t));case"highlyRelevant":return k($(t));case"costReduction":return E(N(t))}})(u,h):[],[b,u,h]),x={note:g?{status:Fe.Warning,message:g.message,action:p?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>p(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Fo,variant:be.Secondary,size:fe.S,onClick:l},{"data-id":"sampling-create-btn-submit",label:Po,variant:be.Primary,size:fe.S,onClick:C,disabled:!!g}]};return e(o,{children:[t(Jh,{isOpen:n,title:Ho[u],subTitle:Xo[u],onClose:l,footer:x}),t(Qe,{isOpen:b,title:Wo,description:Go,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:jo,variant:be.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:Po,variant:be.Primary,onClick:y},children:e(ee,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(pe,{size:he.XS,weight:500,color:ue.Secondary,children:Ko}),t("div",{style:{width:"100%"},children:t(sr,{summary:S})})]})})]})},Qh=({onClose:n,onDelete:i,onSaveEdit:l,validateForm:s,onNavigateToDuplicate:c})=>{const{data:d,isEditing:p,formData:u,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Xl(Ul.View),b=d?.rule.name||Vo,v=p&&d?Uo[d.category]:`${b} preview`,y=r(()=>{if(d&&p){if(s){const e=s(u);if(e)return void f(e)}l(u,d.rule.ruleId,d.samplingId),m()}},[d,p,u,l,s,f,m]),C=r(()=>{d&&i(d.rule.ruleId,d.samplingId)},[d,i]),S=a(()=>{if(!d)return;const i=g?{message:g.message,onViewRule:c?()=>c(g.ruleId):void 0}:null;return function(n){if(n.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Yh,{onClick:l}),r&&t(Le,{status:Fe.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Kh,{}),t(ge,{"data-id":"sampling-view-edit-btn-cancel",label:Fo,variant:be.Secondary,size:fe.S,onClick:i}),t(ge,{"data-id":"sampling-view-edit-btn-save",label:Mo,variant:be.Primary,size:fe.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=n;return{children:e(o,{children:[t(Yh,{onClick:i}),t(Kh,{}),t(ge,{"data-id":"sampling-view-btn-cancel",label:Fo,variant:be.Secondary,size:fe.S,onClick:a}),t(ge,{"data-id":"sampling-view-btn-edit",label:zo,variant:be.Primary,size:fe.S,onClick:l})]})}}(p?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:n,onEdit:h})},[d,p,g,m,y,C,h,n,c]);return t(Jh,{isOpen:!!d,title:v,subTitle:d?Xo[d.category]:"",onClose:n,footer:S})},em=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Xl(Ul.EditAutoNoisy),l=r(()=>n(i,a),[n,i,a]);return t(nm,{formType:Ul.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},tm=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Xl(Ul.EditAutoCostReduction),l=r(()=>n(i,a),[n,i,a]);return t(nm,{formType:Ul.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},om=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i}=Xl(Ul.EditAutoHighlyRelevant),a=r(()=>n(i),[n,i]);return t(nm,{formType:Ul.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:a})},nm=({formType:e,isOpen:o,onClose:n,onSave:i})=>{const a=qh[e];return t(Jh,{isOpen:o,title:a.title,subTitle:a.subTitle,onClose:n,footer:{actions:[{"data-id":a.cancelId,label:Fo,variant:be.Secondary,size:fe.S,onClick:n},{"data-id":a.saveId,label:tn,variant:be.Primary,size:fe.S,onClick:i}]}})},im=e=>{switch(e.formType){case Ul.Create:return t(Yl,{formType:Ul.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Zh,{...e})});case Ul.View:return t(Yl,{formType:Ul.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Qh,{...e})});case Ul.EditAutoNoisy:return t(Yl,{formType:Ul.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(em,{...e})});case Ul.EditAutoCostReduction:return t(Yl,{formType:Ul.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(tm,{...e})});case Ul.EditAutoHighlyRelevant:return t(Yl,{formType:Ul.EditAutoHighlyRelevant,enabled:e.enabled,children:t(om,{...e})})}},am=({token:n,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:p,formErrors:u})=>{const{CopyButton:h}=Pt(),m=!a||i||!c.newToken;return nn({key:"Enter",active:!m},s),e(me,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(Te,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),p("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:u.newToken}),t(me,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(St,{title:"Saving...",withGradient:!0}):e(o,{children:[t(ge,{variant:be.Secondary,size:fe.S,leftIcon:Va,onClick:r,disabled:i}),t(ge,{variant:be.Primary,size:fe.S,leftIcon:Ua,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(pe,{size:he.XS,children:new Array(55).fill("•").join("")}),e(me,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(yt,{icon:_a,onClick:l})]})]})},lm=({expiresAt:e,callbackValid:o,callbackExpired:n})=>{const{formatTimeAgo:l}=Qt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>an(e,0)?Fe.Error:an(e,2592e6)?Fe.Warning:Fe.Success,[e]),d=a(()=>c===Fe.Success?Ua:c===Fe.Warning?Cl:il,[c]);return i(()=>{c===Fe.Success?o():c===Fe.Error&&n()},[c]),t($e,{text:s,children:t(qe,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},rm=b.div`
412
852
  display: flex;
413
853
  flex-direction: column;
414
854
  gap: 12px;
@@ -416,7 +856,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
416
856
  border-radius: 12px;
417
857
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
418
858
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
419
- `,Yu=({children:e})=>{const o=b();return t(de,{size:pe.XXXS,color:o.v2.colors.grey[150],children:e})},qu=({token:o})=>{const{tokensApi:n}=kl(),[i,a]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=zt({newToken:""});return t(ct,{richTitle:{icon:sl,title:"Odigos Pro Token"},children:e(Ku,{$isExpired:c,children:[e(he,{$justifyContent:"space-between",children:[e(Q,{$gap:4,children:[t(Yu,{children:"Issued for"}),t(de,{size:pe.XS,children:o.name||"N/A"})]}),e(Q,{$gap:4,children:[t(Yu,{children:"Expiration"}),t(Wu,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(Q,{})]}),t(he,{children:e(Q,{children:[t(Yu,{children:"Token"}),t(ju,{token:o.token,newToken:u.newToken,isLoading:i,isEditing:l,onEdit:()=>s(!0),onCancel:()=>(s(!1),void p("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;a(!0);const e=await n.updateToken(u.newToken.trim());a(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},Ju=f.div`
859
+ `,sm=({children:e})=>{const o=v();return t(pe,{size:he.XXXS,color:o.v2.colors.grey[150],children:e})},cm=({token:o})=>{const{tokensApi:n}=Ll(),[i,a]=s(!1),[l,r]=s(!1),[c,d]=s(!1),{formData:p,handleFormChange:u,formErrors:h,handleErrorChange:m,resetFormData:g}=Ht({newToken:""});return t(dt,{richTitle:{icon:Sl,title:"Odigos Pro Token"},children:e(rm,{$isExpired:c,children:[e(me,{$justifyContent:"space-between",children:[e(ee,{$gap:4,children:[t(sm,{children:"Issued for"}),t(pe,{size:he.XS,children:o.name||"N/A"})]}),e(ee,{$gap:4,children:[t(sm,{children:"Expiration"}),t(lm,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(ee,{})]}),t(me,{children:e(ee,{children:[t(sm,{children:"Token"}),t(am,{token:o.token,newToken:p.newToken,isLoading:i,isEditing:l,onEdit:()=>r(!0),onCancel:()=>(r(!1),void u("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;a(!0);const e=await n.updateToken(p.newToken.trim());a(!1),e?.error?m("newToken",e.error):(r(!1),g())})(),formData:p,handleFormChange:u,handleErrorChange:m,formErrors:h})]})})]})})},dm=b.div`
420
860
  display: flex;
421
861
  flex-direction: column;
422
862
  align-items: center;
@@ -425,23 +865,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
425
865
  padding: 12px 24px;
426
866
  border-radius: 8px;
427
867
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
428
- `,Zu=()=>{const{progress:o}=Nt(),{describeApi:n,namespacesApi:i}=kl(),{items:a}=i.useNamespaces(),[l,s]=r(null),{formData:c,handleFormChange:d,resetFormData:u}=zt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ct,{richTitle:{icon:cl,title:"Diagnose"},children:l?e(Ju,{children:[t(Ct,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[Rt.DownloadingDiagnose]?.percentage,percentage:o[Rt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[Rt.DownloadingDiagnose]?.percentage,visualIcon:nl,startedAt:l}),o[Rt.DownloadingDiagnose]?.list?.length&&t(Q,{$width:"100%",children:o[Rt.DownloadingDiagnose].list.map((o,n)=>e(he,{$gap:4,$alignItems:"center",children:[o.status===Le.Success?t(Fa,{size:16}):o.status===Le.Error?t(La,{size:16}):t(Ct,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(de,{size:pe.XXXS,color:ue.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(Q,{$gap:24,children:[t(de,{size:pe.XXS,color:ue.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(Q,{$gap:16,children:[e(he,{$gap:8,children:[t(te,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(de,{size:pe.XXXS,color:ue.Secondary,children:"Include pprof profiles"})]}),e(he,{$gap:8,children:[t(te,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(de,{size:pe.XXXS,color:ue.Secondary,children:"Include Prometheus metrics"})]}),e(he,{$gap:8,children:[t(te,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(de,{size:pe.XXXS,color:ue.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Qo,{alignX:tn.Left,alignY:en.Bottom,items:a.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:fe.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Ye,{label:c.sourceWorkloadNamespaces.length,status:Le.Default}):void 0}}),t(he,{$justifyContent:"flex-end",children:t(me,{label:"Download Diagnose",rightIcon:nl,variant:fe.Primary,onClick:async()=>{n.downloadDiagnose&&(s(Date.now()),await n.downloadDiagnose(c),s(null),u())},disabled:null!==l})})]})})},Qu=()=>{const{platformType:e,version:o,tier:i}=C(),{describeApi:a}=kl(),[l,s]=r(null);return n(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ct,{richTitle:{icon:qa,title:"General Information"},children:t(Lt,{cellsPerRow:2,items:[{id:on(),title:"Odigos Version",label:o},{id:on(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:on(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:on(),title:"Tier",label:i}]})})},ep=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=kl(),l=a.useTokens().items[0];return e(se,{isOpen:o,header:{icon:qa,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(Qu,{}),a.updateToken&&l&&t(qu,{token:l}),i.downloadDiagnose&&t(Zu,{})]})},tp=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:r,setSelectedStreamName:s}=et(),{dataStreamsApi:c}=kl(),{requestSubmit:d}=Il(),u=l(async e=>{c.create?await c.create(e):(r([e]),s(e.name)),i()},[c,r,s,i]),p=l(()=>d(u),[d,u]);return Jo({key:"Enter",active:n},p),e(o,{children:[t(Ze,{isOpen:n,onClose:i,onCloseEnd:a,title:Qe.NAME_YOUR_STREAM,description:Qe.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:fe.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:i},children:t(Ls,{autoFocus:!0})}),t(Fs,{})]})},op=({isOpen:i,onClose:a,onCloseEnd:r,dataStreamName:s})=>{const{dataStreamsApi:c}=kl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Il();n(()=>{i&&s&&u(s)},[i,s]);const h=!!d?.isFormDirty,m=l(async e=>{await c.update(s,e),a()},[c,s,a]),g=l(()=>p(m),[p,m]);return Jo({key:"Enter",active:i},g),e(o,{children:[t(Ze,{isOpen:i,onClose:a,onCloseEnd:r,title:Qe.RENAME_STREAM(s),description:Qe.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:fe.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:a},children:t(Ls,{autoFocus:!0})}),t(Fs,{})]})},np=({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)"})})]})]}),ip=f.div`
868
+ `,pm=()=>{const{progress:o}=Ot(),{describeApi:n,namespacesApi:i}=Ll(),{items:a}=i.useNamespaces(),[l,r]=s(null),{formData:c,handleFormChange:d,resetFormData:p}=Ht({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(dt,{richTitle:{icon:xl,title:"Diagnose"},children:l?e(dm,{children:[t(St,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[Dt.DownloadingDiagnose]?.percentage,percentage:o[Dt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[Dt.DownloadingDiagnose]?.percentage,visualIcon:bl,startedAt:l}),o[Dt.DownloadingDiagnose]?.list?.length&&t(ee,{$width:"100%",children:o[Dt.DownloadingDiagnose].list.map((o,n)=>e(me,{$gap:4,$alignItems:"center",children:[o.status===Fe.Success?t(Ua,{size:16}):o.status===Fe.Error?t(Va,{size:16}):t(St,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(pe,{size:he.XXXS,color:ue.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(ee,{$gap:24,children:[t(pe,{size:he.XXS,color:ue.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(ee,{$gap:16,children:[e(me,{$gap:8,children:[t(oe,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include pprof profiles"})]}),e(me,{$gap:8,children:[t(oe,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include Prometheus metrics"})]}),e(me,{$gap:8,children:[t(oe,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(pe,{size:he.XXXS,color:ue.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(ln,{alignX:sn.Left,alignY:rn.Bottom,items:a.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:be.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(qe,{label:c.sourceWorkloadNamespaces.length,status:Fe.Default}):void 0}}),t(me,{$justifyContent:"flex-end",children:t(ge,{label:"Download Diagnose",rightIcon:bl,variant:be.Primary,onClick:async()=>{n.downloadDiagnose&&(r(Date.now()),await n.downloadDiagnose(c),r(null),p())},disabled:null!==l})})]})})},um=()=>{const{platformType:e,version:o,tier:n}=S(),{describeApi:a}=Ll(),[l,r]=s(null);return i(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>r(e?.describeOdigos??null))},[]),t(dt,{richTitle:{icon:cl,title:"General Information"},children:t(Xt,{cellsPerRow:2,items:[{id:cn(),title:"Odigos Version",label:o},{id:cn(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:cn(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:cn(),title:"Tier",label:n}]})})},hm=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=Ll(),l=a.useTokens().items[0];return e(ce,{isOpen:o,header:{icon:cl,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(um,{}),a.updateToken&&l&&t(cm,{token:l}),i.downloadDiagnose&&t(pm,{})]})},mm=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:l,setSelectedStreamName:s}=tt(),{dataStreamsApi:c}=Ll(),{requestSubmit:d}=zl(),p=r(async e=>{c.create?await c.create(e):(l([e]),s(e.name)),i()},[c,l,s,i]),u=r(()=>d(p),[d,p]);return nn({key:"Enter",active:n},u),e(o,{children:[t(Qe,{isOpen:n,onClose:i,onCloseEnd:a,title:et.NAME_YOUR_STREAM,description:et.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:be.Primary,onClick:u},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:i},children:t(Js,{autoFocus:!0})}),t(qs,{})]})},gm=({isOpen:n,onClose:a,onCloseEnd:l,dataStreamName:s})=>{const{dataStreamsApi:c}=Ll(),{genericForm:d,loadDataStream:p,requestSubmit:u}=zl();i(()=>{n&&s&&p(s)},[n,s]);const h=!!d?.isFormDirty,m=r(async e=>{await c.update(s,e),a()},[c,s,a]),g=r(()=>u(m),[u,m]);return nn({key:"Enter",active:n},g),e(o,{children:[t(Qe,{isOpen:n,onClose:a,onCloseEnd:l,title:et.RENAME_STREAM(s),description:et.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:be.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:be.Secondary,onClick:a},children:t(Js,{autoFocus:!0})}),t(qs,{})]})},fm=({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)"})})]})]}),bm=b.div`
429
869
  position: absolute;
430
870
  top: 50%;
431
871
  left: 50%;
432
872
  transform: translate(-50%, -50%);
433
873
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
434
- `,ap=()=>{const{drawerType:o,setDrawerType:n}=ro(),i=o===an.OnboardingDone,a=()=>n(null);return e(nn,{isOpen:i,onClose:a,children:[t(np,{}),t(ip,{children:e(Q,{$gap:32,$alignItems:"center",children:[e(Q,{$gap:24,$alignItems:"center",children:[t(de,{size:pe.L,weight:500,children:"Welcome to"}),t(rr,{size:260}),t(de,{size:pe.S,weight:400,children:"Your observability control plane is ready."})]}),t(me,{label:"Get Started",rightIcon:wa,onClick:a})]})})]})},lp=f.div`
874
+ `,vm=()=>{const{drawerType:o,setDrawerType:n}=ho(),i=o===pn.OnboardingDone,a=()=>n(null);return e(dn,{isOpen:i,onClose:a,children:[t(fm,{}),t(bm,{children:e(ee,{$gap:32,$alignItems:"center",children:[e(ee,{$gap:24,$alignItems:"center",children:[t(pe,{size:he.L,weight:500,children:"Welcome to"}),t(xr,{size:260}),t(pe,{size:he.S,weight:400,children:"Your observability control plane is ready."})]}),t(ge,{label:"Get Started",rightIcon:$a,onClick:a})]})})]})},ym=b.div`
435
875
  display: flex;
436
876
  flex-direction: column;
437
877
  gap: 8px;
438
878
  padding: 4px 8px;
439
879
  border-radius: 8px;
440
880
  width: 100%;
441
- `,rp=f.div`
881
+ `,Cm=b.div`
442
882
  white-space: pre;
443
883
  overflow-x: auto;
444
- `,sp=({name:o,recommended:n,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=b();return e(lp,{children:[e(he,{$gap:8,$justifyContent:"space-between",children:[e(he,{$gap:4,children:[t(de,{size:pe.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Ye,{label:ln,leftIcon:dl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:pe.XXXS})]}),t(ae,{name:s??`sampling-onboarding-toggle-${o}`,label:i,labelAlign:le.Left,value:a,onChange:l,size:It.S})]}),t(rp,{children:t(w,{parts:r})})]})},cp=f.div`
884
+ `,Sm=({name:o,recommended:n,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=v();return e(ym,{children:[e(me,{$gap:8,$justifyContent:"space-between",children:[e(me,{$gap:4,children:[t(pe,{size:he.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(qe,{label:un,leftIcon:wl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:he.XXXS})]}),t(le,{name:s??`sampling-onboarding-toggle-${o}`,label:i,labelAlign:re.Left,value:a,onChange:l,size:Nt.S})]}),t(Cm,{children:t(w,{parts:r})})]})},xm=b.div`
445
885
  position: relative;
446
886
  display: flex;
447
887
  align-items: center;
@@ -451,18 +891,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
451
891
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
452
892
  border-top-left-radius: 18px;
453
893
  border-top-right-radius: 18px;
454
- `,dp=f.div`
894
+ `,wm=b.div`
455
895
  position: absolute;
456
896
  left: 16px;
457
897
  top: 50%;
458
898
  transform: translateY(-50%);
459
- `,up=f.div`
899
+ `,Tm=b.div`
460
900
  height: 16px;
461
901
  width: 100%;
462
902
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
463
903
  border-top-left-radius: 18px;
464
904
  border-top-right-radius: 18px;
465
- `,pp=f.div`
905
+ `,km=b.div`
466
906
  width: ${({$width:e})=>e}px;
467
907
  display: flex;
468
908
  flex-direction: column;
@@ -470,10 +910,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
470
910
  gap: 22px;
471
911
  padding: 8px 32px 32px 32px;
472
912
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
473
- `,hp=e=>t(ul,{rotate:90,...e}),mp=({children:o,center:n,onNext:i,nextLabel:a=rn,nextLoading:l})=>e(he,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,i&&t(me,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:hp,variant:fe.Primary,size:ge.M,onClick:i,loading:l})]}),gp=e=>t(ul,{rotate:-90,...e}),fp=({title:o,onBack:n})=>{const i=b();return e(cp,{$hasBack:!!n,children:[n&&t(dp,{children:t(vt,{"data-id":"sampling-onboarding-back",icon:gp,size:yt.M,onClick:n})}),t(de,{size:pe.M,weight:500,color:i.v2.colors.white[500],align:"center",children:o})]})},bp=f.div`
913
+ `,Em=e=>t(Tl,{rotate:90,...e}),Im=({children:o,center:n,onNext:i,nextLabel:a=hn,nextLoading:l})=>e(me,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,i&&t(ge,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:Em,variant:be.Primary,size:fe.M,onClick:i,loading:l})]}),Nm=e=>t(Tl,{rotate:-90,...e}),$m=({title:o,onBack:n})=>{const i=v();return e(xm,{$hasBack:!!n,children:[n&&t(wm,{children:t(yt,{"data-id":"sampling-onboarding-back",icon:Nm,size:Ct.M,onClick:n})}),t(pe,{size:he.M,weight:500,color:i.v2.colors.white[500],align:"center",children:o})]})},Om=b.div`
474
914
  box-sizing: border-box;
475
915
  width: ${({$width:e})=>e??"100%"};
476
- ${({$fillHeight:e})=>e&&v`
916
+ ${({$fillHeight:e})=>e&&y`
477
917
  align-self: stretch;
478
918
  height: auto;
479
919
  `}
@@ -483,16 +923,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
483
923
  padding: 16px;
484
924
  border-radius: 16px;
485
925
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
486
- `,vp=({children:e,fillHeight:o,width:n})=>t(bp,{$fillHeight:o,$width:n,children:e}),yp=f.ul`
926
+ `,Am=({children:e,fillHeight:o,width:n})=>t(Om,{$fillHeight:o,$width:n,children:e}),Rm=b.ul`
487
927
  margin: 0;
488
928
  padding: 0;
489
929
  list-style: disc;
490
- `,Cp=f.li`
930
+ `,Dm=b.li`
491
931
  margin-left: 18px;
492
932
  & + & {
493
933
  margin-top: 6px;
494
934
  }
495
- `,Sp=({items:e,color:o})=>{const n=b(),i=o||n.v2.colors.silver[200];return t(yp,{children:e.map((e,o)=>t(Cp,{style:{color:i},children:t(de,{size:pe.XXS,color:i,children:e})},o))})},wp=({items:o})=>{const n=b();return t(Q,{$gap:16,children:o.map((o,i)=>e(he,{$gap:8,$alignItems:"flex-start",children:[e(de,{size:pe.XS,color:n.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(Q,{$gap:2,children:[t(de,{size:pe.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(de,{size:pe.XS,color:n.v2.colors.silver[200],children:o.description})]})]},i))})},xp=({message:e})=>t(Fe,{status:Le.Default,message:e,fullWidth:!0,smallIcon:!0}),kp=f.div`
935
+ `,_m=({items:e,color:o})=>{const n=v(),i=o||n.v2.colors.silver[200];return t(Rm,{children:e.map((e,o)=>t(Dm,{style:{color:i},children:t(pe,{size:he.XXS,color:i,children:e})},o))})},Pm=({items:o})=>{const n=v();return t(ee,{$gap:16,children:o.map((o,i)=>e(me,{$gap:8,$alignItems:"flex-start",children:[e(pe,{size:he.XS,color:n.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(ee,{$gap:2,children:[t(pe,{size:he.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(pe,{size:he.XS,color:n.v2.colors.silver[200],children:o.description})]})]},i))})},Lm=({message:e})=>t(Le,{status:Fe.Default,message:e,fullWidth:!0,smallIcon:!0}),Fm=b.div`
496
936
  width: 100%;
497
937
  padding: 8px;
498
938
  display: flex;
@@ -500,12 +940,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
500
940
  gap: 4px;
501
941
  border-radius: 16px;
502
942
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
503
- `,Tp=f.div`
943
+ `,Mm=b.div`
504
944
  display: flex;
505
945
  align-items: center;
506
946
  gap: 8px;
507
947
  padding: 4px 8px 12px 8px;
508
- `,$p=f.div`
948
+ `,zm=b.div`
509
949
  width: 100%;
510
950
  display: flex;
511
951
  flex-direction: column;
@@ -513,20 +953,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
513
953
  padding: 8px;
514
954
  border-radius: 12px;
515
955
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
516
- `,Ip=({children:e})=>{const o=b();return t(de,{size:pe.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Ep=f.div`
956
+ `,Bm=({children:e})=>{const o=v();return t(pe,{size:he.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Xm=b.div`
517
957
  white-space: pre-line;
518
- `,Np=({enabled:n,onEnabledChange:a,onBack:l,onNext:r})=>{const s=b(),c=i(()=>A({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(fp,{title:sn,onBack:l}),e(pp,{$width:854,children:[t(Ip,{children:cn}),e(Q,{$gap:8,$width:"100%",children:[t(vp,{children:t(Ep,{children:t(de,{size:pe.XXS,color:s.v2.colors.silver[200],children:dn})})}),e(Q,{$gap:8,$width:"100%",children:[e(kp,{children:[t(Tp,{children:t(de,{size:pe.S,weight:500,color:s.v2.colors.white[500],children:un})}),t($p,{children:t(sp,{name:hn,recommended:!0,toggleLabel:pn,enabled:n,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(xp,{message:mn})]})]})]}),t(mp,{onNext:r})]})},Ap=e=>t(ul,{rotate:90,...e}),Op=({onClose:n})=>{const i=b();return e(o,{children:[t(up,{}),e(pp,{$width:732,children:[t(gn,{icon:ll}),e(Q,{$gap:16,$alignItems:"center",$width:"100%",children:[t(de,{size:pe.M,weight:500,color:i.v2.colors.white[500],children:fn}),bn.split("\n").map((e,o)=>t(Ip,{children:e},`subtitle-${o}-${e}`)),e(vp,{children:[t(de,{size:pe.XS,color:i.v2.colors.silver[200],children:vn}),t(Sp,{color:i.v2.colors.white[500],items:[yn,Cn,Sn]})]})]})]}),t(mp,{center:!0,children:t(me,{"data-id":"sampling-onboarding-btn-go-to",label:wn,rightIcon:Ap,variant:fe.Primary,size:ge.M,onClick:n})})]})},Rp=e=>t(ul,{rotate:90,...e}),Dp=f.div`
958
+ `,Um=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=v(),c=a(()=>A({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t($m,{title:mn,onBack:l}),e(km,{$width:854,children:[t(Bm,{children:gn}),e(ee,{$gap:8,$width:"100%",children:[t(Am,{children:t(Xm,{children:t(pe,{size:he.XXS,color:s.v2.colors.silver[200],children:fn})})}),e(ee,{$gap:8,$width:"100%",children:[e(Fm,{children:[t(Mm,{children:t(pe,{size:he.S,weight:500,color:s.v2.colors.white[500],children:bn})}),t(zm,{children:t(Sm,{name:yn,recommended:!0,toggleLabel:vn,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Lm,{message:Cn})]})]})]}),t(Im,{onNext:r})]})},Vm=e=>t(Tl,{rotate:90,...e}),Hm=({onClose:n})=>{const i=v();return e(o,{children:[t(Tm,{}),e(km,{$width:732,children:[t(Sn,{icon:yl}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[t(pe,{size:he.M,weight:500,color:i.v2.colors.white[500],children:xn}),wn.split("\n").map((e,o)=>t(Bm,{children:e},`subtitle-${o}-${e}`)),e(Am,{children:[t(pe,{size:he.XS,color:i.v2.colors.silver[200],children:Tn}),t(_m,{color:i.v2.colors.white[500],items:[kn,En,In]})]})]})]}),t(Im,{center:!0,children:t(ge,{"data-id":"sampling-onboarding-btn-go-to",label:Nn,rightIcon:Vm,variant:be.Primary,size:fe.M,onClick:n})})]})},jm=e=>t(Tl,{rotate:90,...e}),Gm=b.div`
519
959
  display: flex;
520
960
  flex-direction: column;
521
961
  align-items: center;
522
962
  gap: 8px;
523
963
  width: 100%;
524
- `,Pp=({onSkip:n,onNext:i})=>{const a=b();return e(o,{children:[t(up,{}),e(pp,{$width:732,children:[t(gn,{icon:ll}),e(Q,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Dp,{children:[t(de,{size:pe.M,weight:500,color:a.v2.colors.white[500],children:xn}),t(Ip,{children:kn})]}),e(vp,{children:[t(de,{size:pe.XS,color:a.v2.colors.silver[200],children:Tn}),t(wp,{items:[{title:In,description:$n},{title:Nn,description:En},{title:On,description:An}]}),t(xp,{message:Rn})]})]})]}),e(mp,{center:!0,children:[t(me,{"data-id":"sampling-onboarding-btn-skip",label:Dn,variant:fe.Secondary,onClick:n}),t(me,{"data-id":"sampling-onboarding-btn-start",label:Pn,rightIcon:Rp,variant:fe.Primary,onClick:i})]})]})},Fp=f.div`
964
+ `,Wm=({onSkip:n,onNext:i})=>{const a=v();return e(o,{children:[t(Tm,{}),e(km,{$width:732,children:[t(Sn,{icon:yl}),e(ee,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Gm,{children:[t(pe,{size:he.M,weight:500,color:a.v2.colors.white[500],children:$n}),t(Bm,{children:On})]}),e(Am,{children:[t(pe,{size:he.XS,color:a.v2.colors.silver[200],children:An}),t(Pm,{items:[{title:Dn,description:Rn},{title:Pn,description:_n},{title:Fn,description:Ln}]}),t(Lm,{message:Mn})]})]})]}),e(Im,{center:!0,children:[t(ge,{"data-id":"sampling-onboarding-btn-skip",label:zn,variant:be.Secondary,onClick:n}),t(ge,{"data-id":"sampling-onboarding-btn-start",label:Bn,rightIcon:jm,variant:be.Primary,onClick:i})]})]})},Km=b.div`
525
965
  display: flex;
526
966
  align-items: stretch;
527
967
  gap: 16px;
528
968
  width: 100%;
529
- `,Lp=f.div`
969
+ `,Ym=b.div`
530
970
  flex: 1;
531
971
  display: flex;
532
972
  flex-direction: column;
@@ -538,26 +978,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
538
978
  background-color 0.15s ease,
539
979
  border-color 0.15s ease;
540
980
 
541
- ${({$selected:e,theme:t})=>e?v`
981
+ ${({$selected:e,theme:t})=>e?y`
542
982
  background-color: ${t.v2.colors.purple[900]};
543
983
  border-color: ${t.v2.colors.purple[400]};
544
- `:v`
984
+ `:y`
545
985
  &:hover {
546
986
  background-color: ${t.v2.colors.silver[700]};
547
987
  }
548
988
  `}
549
- `,Mp=f.div`
989
+ `,qm=b.div`
550
990
  display: flex;
551
991
  align-items: center;
552
992
  gap: 8px;
553
993
  padding: 12px 16px;
554
- `,_p=f.div`
994
+ `,Jm=b.div`
555
995
  flex: 1;
556
996
  padding: 8px;
557
997
  display: flex;
558
998
  flex-direction: column;
559
999
  gap: 8px;
560
- `,zp=f.div`
1000
+ `,Zm=b.div`
561
1001
  flex: 1;
562
1002
  display: flex;
563
1003
  flex-direction: column;
@@ -565,17 +1005,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
565
1005
  padding: 12px;
566
1006
  border-radius: 12px;
567
1007
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
568
- `,Bp=f.div`
1008
+ `,Qm=b.div`
569
1009
  display: flex;
570
1010
  justify-content: flex-end;
571
- `,Xp=f.div`
1011
+ `,eg=b.div`
572
1012
  display: flex;
573
1013
  align-items: center;
574
1014
  gap: 8px;
575
1015
  padding: 4px 12px 4px 4px;
576
1016
  border-radius: 8px;
577
1017
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
578
- `,Vp=f.div`
1018
+ `,tg=b.div`
579
1019
  display: flex;
580
1020
  align-items: center;
581
1021
  justify-content: center;
@@ -583,13 +1023,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
583
1023
  height: 24px;
584
1024
  border-radius: 6px;
585
1025
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
586
- `,Up=({selected:o,onSelect:n,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=b(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Lp,{$selected:o,onClick:n,children:[e(Mp,{children:[t(Ce,{"data-id":`sampling-onboarding-radio-${i}`,value:o,onChange:n,size:we.L}),t(ll,{size:24,fill:d.v2.colors.white[500]}),t(de,{size:pe.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(_p,{children:[e(zp,{$selected:o,children:[e(Q,{$gap:8,children:[t(Ye,{...l,textSize:pe.XXXS}),t(de,{size:pe.XXS,color:u,children:a})]}),r&&r.length>0&&t(Sp,{color:u,items:r}),s&&e(Xp,{children:[t(Vp,{children:t(rl,{size:18,fill:d.v2.colors.yellow[500]})}),t(de,{size:pe.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Bp,{children:t(me,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:Jn,rightIcon:Ta,variant:fe.Text,size:ge.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Gp=({strategy:n,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=b(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(fp,{title:Fn,onBack:a}),e(pp,{$width:854,children:[t(Ip,{children:Ln}),e(Fp,{children:[t(Up,{selected:"keep-list"===n,onSelect:()=>i("keep-list"),name:Vn,description:Xn,badgeProps:{label:Bn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[_n,zn],warning:Mn,onReadMore:c}),t(Up,{selected:"drop-list"===n,onSelect:()=>i("drop-list"),name:Wn,description:jn,badgeProps:{label:Hn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Un,Gn],onReadMore:c}),t(Up,{selected:"advanced"===n,onSelect:()=>i("advanced"),name:qn,description:Yn,badgeProps:{label:Kn,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(mp,{onNext:l})]})},Hp=({onBack:n,onNext:a,submitting:l})=>{const r=b(),s=i(()=>[{title:ti,bullets:[Zn,Qn,ei]},{title:ri,bullets:[oi,ni,ii,ai,li]}],[]);return e(o,{children:[t(fp,{title:si,onBack:n}),e(pp,{$width:854,children:[t(Ip,{children:ci}),t(he,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(vp,{fillHeight:!0,width:"50%",children:[t(de,{size:pe.XS,color:r.v2.colors.white[500],children:o.title}),t(Sp,{items:o.bullets})]},n))}),t(xp,{message:di})]}),t(mp,{onNext:a,nextLoading:l})]})},jp=f.div`
1026
+ `,og=({selected:o,onSelect:n,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=v(),p=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Ym,{$selected:o,onClick:n,children:[e(qm,{children:[t(Se,{"data-id":`sampling-onboarding-radio-${i}`,value:o,onChange:n,size:we.L}),t(yl,{size:24,fill:d.v2.colors.white[500]}),t(pe,{size:he.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(Jm,{children:[e(Zm,{$selected:o,children:[e(ee,{$gap:8,children:[t(qe,{...l,textSize:he.XXXS}),t(pe,{size:he.XXS,color:p,children:a})]}),r&&r.length>0&&t(_m,{color:p,items:r}),s&&e(eg,{children:[t(tg,{children:t(Cl,{size:18,fill:d.v2.colors.yellow[500]})}),t(pe,{size:he.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Qm,{children:t(ge,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:ni,rightIcon:Ra,variant:be.Text,size:fe.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},ng=({strategy:n,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=v(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t($m,{title:Xn,onBack:a}),e(km,{$width:854,children:[t(Bm,{children:Un}),e(Km,{children:[t(og,{selected:"keep-list"===n,onSelect:()=>i("keep-list"),name:Kn,description:Wn,badgeProps:{label:Gn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[Hn,jn],warning:Vn,onReadMore:c}),t(og,{selected:"drop-list"===n,onSelect:()=>i("drop-list"),name:Qn,description:Zn,badgeProps:{label:Jn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Yn,qn],onReadMore:c}),t(og,{selected:"advanced"===n,onSelect:()=>i("advanced"),name:oi,description:ti,badgeProps:{label:ei,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(Im,{onNext:l})]})},ig=({onBack:n,onNext:i,submitting:l})=>{const r=v(),s=a(()=>[{title:ri,bullets:[ii,ai,li]},{title:hi,bullets:[si,ci,di,pi,ui]}],[]);return e(o,{children:[t($m,{title:mi,onBack:n}),e(km,{$width:854,children:[t(Bm,{children:gi}),t(me,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Am,{fillHeight:!0,width:"50%",children:[t(pe,{size:he.XS,color:r.v2.colors.white[500],children:o.title}),t(_m,{items:o.bullets})]},n))}),t(Lm,{message:fi})]}),t(Im,{onNext:i,nextLoading:l})]})},ag=b.div`
587
1027
  white-space: pre-line;
588
- `,Wp=({errorPresetEnabled:n,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=b(),d=i(()=>O(n?{disabled:!1}:null),[n]);return e(o,{children:[t(fp,{title:ui,onBack:l}),e(pp,{$width:854,children:[t(Ip,{children:pi}),e(Q,{$gap:8,$width:"100%",children:[e(vp,{children:[t(jp,{children:t(de,{size:pe.XXS,color:c.v2.colors.silver[200],children:hi})}),t(xp,{message:di})]}),e(kp,{children:[e(Tp,{children:[t(de,{size:pe.S,weight:500,color:c.v2.colors.white[500],children:mi}),t(ja,{size:16,fill:c.v2.colors.silver[200]})]}),t($p,{children:t(sp,{name:fi,recommended:!0,toggleLabel:gi,enabled:n,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(mp,{onNext:r,nextLoading:s})]})},Kp=f.div`
1028
+ `,lg=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=v(),d=a(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t($m,{title:bi,onBack:l}),e(km,{$width:854,children:[t(Bm,{children:vi}),e(ee,{$gap:8,$width:"100%",children:[e(Am,{children:[t(ag,{children:t(pe,{size:he.XXS,color:c.v2.colors.silver[200],children:yi})}),t(Lm,{message:fi})]}),e(Fm,{children:[e(Mm,{children:[t(pe,{size:he.S,weight:500,color:c.v2.colors.white[500],children:Ci}),t(al,{size:16,fill:c.v2.colors.silver[200]})]}),t(zm,{children:t(Sm,{name:xi,recommended:!0,toggleLabel:Si,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Im,{onNext:r,nextLoading:s})]})},rg=b.div`
589
1029
  white-space: pre-line;
590
- `,Yp=f.div`
1030
+ `,sg=b.div`
591
1031
  width: fit-content;
592
- `,qp=["50","25","10","1","0.1"],Jp=({value:o,onChange:n,label:a})=>{const l=b(),r=i(()=>qp.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(Q,{$gap:8,children:[t(de,{size:pe.XS,color:l.v2.colors.white[500],children:a}),t(Yp,{children:t(be,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},Zp=({errorPresetEnabled:n,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=b(),p=i(()=>O(n?{disabled:!1}:null),[n]);return e(o,{children:[t(fp,{title:bi,onBack:s}),e(pp,{$width:854,children:[t(Ip,{children:vi}),e(Q,{$gap:8,$width:"100%",children:[e(vp,{children:[t(Kp,{children:t(de,{size:pe.XXS,color:u.v2.colors.silver[200],children:yi})}),t(Sp,{items:[Ci,Si,wi,xi,ki]}),t(xp,{message:di})]}),e(kp,{children:[e(Tp,{children:[t(de,{size:pe.S,weight:500,color:u.v2.colors.white[500],children:Ti}),t(ja,{size:16,fill:u.v2.colors.silver[200]})]}),t($p,{children:t(sp,{name:fi,recommended:!0,toggleLabel:gi,enabled:n,onEnabledChange:a,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t($p,{children:t(Jp,{value:l,onChange:r,label:$i})})]})]})]}),t(mp,{onNext:c,nextLoading:d})]})},Qp=({isOpen:e,onClose:o,k8sHealthProbesConfig:i,samplingId:a,docsUrl:s})=>{const{samplingApi:c}=kl(),[d,u]=r("welcome"),[p,h]=r(!0),[m,g]=r("keep-list"),[f,b]=r(!0),[v,y]=r("25"),[C,S]=r(!1);n(()=>{e&&(u("welcome"),h(i?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,i?.enabled]);const w=l(async()=>{const e=a??"default",t=[];if(p!==(i?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:i?.keepPercentage??0}))}if("advanced"!==m&&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"===m){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)}},[a,c,p,i?.enabled,i?.keepPercentage,m,f,v]);let x=null;switch(d){case"welcome":x=t(Pp,{onSkip:o,onNext:()=>u("noisy")});break;case"noisy":x=t(Np,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(Gp,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":x=t(Zp,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t(Wp,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(Hp,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(Op,{onClose:o})}return t(nn,{isOpen:e,onClose:o,children:x})};var eh,th;(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"})(eh||(eh={})),(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(th||(th={}));const oh=[{key:th.Name,label:"Name"},{key:th.Type,label:"Type"},{key:th.Status,label:"Status"},{key:th.OdigosVersion,label:"Odigos Version"},{key:th.ConnectedSince,label:"Connected Since"},{key:th.LastActivity,label:"Last Activity"}],nh=(e,t)=>{const o=e.find(e=>e.key===th.Id)?.rawValue;return t(o?.toString()||"")},ih=({connections:o,getConnections:a,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=b(),{formatTimeAgo:h}=Kt(),{capabilities:m}=kl(),[g,f]=r(!1),[v,y]=r(o||[]),C=l(async()=>{try{f(!0),y(await a()??[])}catch(e){}finally{f(!1)}},[]);n(()=>{v.length||C()},[]);const[S,w]=r(""),[x,k]=r(null),[T,$]=r([]),I=i(()=>x===eh.BulkConfig?d:x===eh.BulkSource?u:0,[x,d,u]),{supportedConnections:E,supportedConnectionIds:N}=i(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Le.Success,n=R(e.odigosVersion,t,e.type);return o&&n}))(v,I);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,I]);n(()=>{if(!x||x===eh.Delete)return;const e=T.filter(e=>!N.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,T.length,N.length]);const A=i(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:th.Id,rawValue:e.id},{key:th.Name,rawValue:e.name},{key:th.Type,rawValue:e.type},{key:th.Status,rawValue:e.status,component:()=>(e=>{const o=e===Le.Success?"Connection live":"Connection lost",n=e===Le.Success?Fa:La;return t(Ye,{status:e,label:o,leftIcon:n})})(e.status)},{key:th.OdigosVersion,rawValue:e.odigosVersion},{key:th.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:th.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Le.Success||x?void 0:()=>s(e),isSelected:T.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Le.Success||x===eh.BulkConfig&&!R(e.odigosVersion,d,e.type)||x===eh.BulkSource&&!R(e.odigosVersion,u,e.type)})),[v,T,S,x,d,u,h,s]),O=i(()=>v.length>0&&v.every(e=>e.type===Ii.K8s),[v]),P=i(()=>{const e=(e,t)=>{$([e]),k(t)};return(e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===th.Status)?.rawValue===Le.Success)(e))return[{id:on(),label:"Delete Connection",rightIcon:$a,onClick:()=>nh(e,i)}];const d=nh(e,e=>t.find(t=>t.id===e));if(d?.type!==Ii.K8s)return[];const u=!!d&&R(d.odigosVersion,o,d.type),p=!!d&&R(d.odigosVersion,n,d.type),h=D(o,d?.type),m=D(n,d?.type),g=[];return a&&g.push({id:on(),tooltip:p?Qe.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:_a,disabled:!p,onClick:()=>nh(e,a)}),l&&g.push({id:on(),tooltip:Qe.ADD_DESTINATION,rightIcon:Ra,onClick:()=>nh(e,l)}),r&&g.push({id:on(),tooltip:Qe.ADD_ACTION,rightIcon:Oa,onClick:()=>nh(e,r)}),s&&g.push({id:on(),tooltip:Qe.ADD_INSTRUMENTATION_RULE,rightIcon:Ma,onClick:()=>nh(e,s)}),c&&g.push({id:on(),tooltip:u?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:Ba,disabled:!u,onClick:()=>nh(e,c)}),g}})({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,eh.Delete),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?t=>e(t,eh.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?t=>e(t,eh.BulkDestination):void 0,onAddAction:m.canCreateAction?t=>e(t,eh.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?t=>e(t,eh.BulkInstrumentationRule):void 0,onEditConfiguration:m.canApplyEffectiveConfig?t=>e(t,eh.BulkConfig):void 0})},[v,d,u,m]),F=i(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:on(),type:io.Button,buttonProps:{variant:fe.Primary,size:ge.S,label:"Add Sources",rightIcon:_a,onClick:o}});const s=[n?{id:eh.BulkDestination,label:Qe.ADD_DESTINATION,icon:Ra}:null,i?{id:eh.BulkAction,label:Qe.ADD_ACTION,icon:Oa}:null,a?{id:eh.BulkInstrumentationRule,label:Qe.ADD_INSTRUMENTATION_RULE,icon:Ma}:null,l?{id:eh.BulkConfig,label:"Manage Configurations",icon:Ba}:null];return s.some(Boolean)&&r.push({id:on(),type:io.ButtonDropData,buttonProps:{variant:fe.Secondary,size:ge.S,label:"Bulk Operations",onClick:e=>{e===eh.BulkSource?o?.():e===eh.BulkDestination?n?.():e===eh.BulkAction?i?.():e===eh.BulkInstrumentationRule?a?.():e===eh.BulkConfig&&l?.()}},dropDataProps:{alignX:tn.Left,items:s}}),r.push({id:on(),type:io.Button,buttonProps:{variant:fe.Text,size:ge.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?()=>k(eh.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?()=>k(eh.BulkDestination):void 0,onAddAction:m.canCreateAction?()=>k(eh.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?()=>k(eh.BulkInstrumentationRule):void 0,onManageConfigurations:m.canApplyEffectiveConfig?()=>k(eh.BulkConfig):void 0}),[m]);return t(Ei,{children:e(ct,{fullHeight:!0,richTitle:{icon:pl,title:Qe.CONNECTIONS,badge:{label:v.length.toString(),status:Le.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:on(),type:io.Button,buttonProps:{variant:fe.Secondary,size:ge.S,leftIcon:Ga,onClick:C,disabled:g}}],children:[t(To,{variant:$o.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:g,withCheckboxes:O,columns:oh,rows:A,rowActionsPushRightPosition:x?`calc(${sr} - 24px)`:void 0,getRowActions:P}),x===eh.BulkConfig&&m.canApplyEffectiveConfig&&t(Ml,{connectionIds:T,children:t(kc,{onClose:()=>k(null),connections:E,selectedConnectionIds:T,setSelectedConnectionIds:$})}),x===eh.BulkSource&&m.canFetchSnapshots&&m.canBulkPersistSources&&t(Ml,{connectionIds:T,children:t(_l,{selectedConnectionIds:T,children:t(Sc,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===eh.BulkDestination&&m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canTestConnection&&m.canCreateDestination&&t(Ml,{connectionIds:T,children:t(zl,{children:t(lc,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===eh.BulkAction&&m.canCreateAction&&t(Ml,{connectionIds:T,children:t(Bl,{children:t(qs,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===eh.BulkInstrumentationRule&&m.canCreateInstrumentationRule&&t(Ml,{connectionIds:T,children:t(Xl,{children:t(rc,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),t(ir,{target:"connection",isOpen:x===eh.Delete,onClose:()=>{$([]),k(null)},onApprove:async()=>{const e=T[0];e&&(await c(e),await C())}}),t(Io,{isOpen:!!T.length&&!x,richTitle:{icon:xa,title:"Selected Clusters",badge:{label:T.length}},actions:F})]})})},ah=f.div`
1032
+ `,cg=["50","25","10","1","0.1"],dg=({value:o,onChange:n,label:i})=>{const l=v(),r=a(()=>cg.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(ee,{$gap:8,children:[t(pe,{size:he.XS,color:l.v2.colors.white[500],children:i}),t(sg,{children:t(ve,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},pg=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const p=v(),u=a(()=>R(n?{disabled:!1}:null),[n]);return e(o,{children:[t($m,{title:wi,onBack:s}),e(km,{$width:854,children:[t(Bm,{children:Ti}),e(ee,{$gap:8,$width:"100%",children:[e(Am,{children:[t(rg,{children:t(pe,{size:he.XXS,color:p.v2.colors.silver[200],children:ki})}),t(_m,{items:[Ei,Ii,Ni,$i,Oi]}),t(Lm,{message:fi})]}),e(Fm,{children:[e(Mm,{children:[t(pe,{size:he.S,weight:500,color:p.v2.colors.white[500],children:Ai}),t(al,{size:16,fill:p.v2.colors.silver[200]})]}),t(zm,{children:t(Sm,{name:xi,recommended:!0,toggleLabel:Si,enabled:n,onEnabledChange:i,summary:u,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(zm,{children:t(dg,{value:l,onChange:r,label:Ri})})]})]})]}),t(Im,{onNext:c,nextLoading:d})]})},ug=({isOpen:e,onClose:o,k8sHealthProbesConfig:n,samplingId:a,docsUrl:l})=>{const{samplingApi:c}=Ll(),[d,p]=s("welcome"),[u,h]=s(!0),[m,g]=s("keep-list"),[f,b]=s(!0),[v,y]=s("25"),[C,S]=s(!1);i(()=>{e&&(p("welcome"),h(n?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,n?.enabled]);const x=r(async()=>{const e=a??"default",t=[];if(u!==(n?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:u,keepPercentage:n?.keepPercentage??0}))}if("advanced"!==m&&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"===m){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),p("success")}catch{}finally{S(!1)}},[a,c,u,n?.enabled,n?.keepPercentage,m,f,v]);let w=null;switch(d){case"welcome":w=t(Wm,{onSkip:o,onNext:()=>p("noisy")});break;case"noisy":w=t(Um,{enabled:u,onEnabledChange:h,onBack:()=>p("welcome"),onNext:()=>p("strategy")});break;case"strategy":w=t(ng,{strategy:m,onStrategyChange:g,onBack:()=>p("noisy"),onNext:()=>{p("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:l});break;case"keep-list":w=t(pg,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"drop-list":w=t(lg,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"advanced":w=t(ig,{onBack:()=>p("strategy"),onNext:x,submitting:C});break;case"success":w=t(Hm,{onClose:o})}return t(dn,{isOpen:e,onClose:o,children:w})};var hg,mg;(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"})(hg||(hg={})),(e=>{e.K8s="k8s",e.VmAgent="vm-agent",e.CloudConnector="cloud-connector"})(mg||(mg={}));const gg=[{id:mg.CloudConnector,label:"Cloud Connector"}];var fg;(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(fg||(fg={}));const bg=[{key:fg.Name,label:"Name"},{key:fg.Type,label:"Type"},{key:fg.Status,label:"Status"},{key:fg.OdigosVersion,label:"Odigos Version"},{key:fg.ConnectedSince,label:"Connected Since"},{key:fg.LastActivity,label:"Last Activity"}],vg=(e,t)=>{const o=e.find(e=>e.key===fg.Id)?.rawValue;return t(o?.toString()||"")},yg={[Fe.Success]:"Connected",[Fe.Warning]:"Degraded",[Fe.Error]:"Error",[Fe.Disabled]:"Disabled",[Fe.Info]:"Pending"},Cg={[Di.K8s]:ro.Purple,[Di.Vm]:ro.Blue,[Di.Connector]:ro.Green},Sg=({connections:o,getConnections:n,onClickConnection:l,deleteConnection:c,onCreateNew:d,cloudConnectorProviders:p,onCreateCloudConnector:u,configMinSupportedVersion:h=0,snapshotMinSupportedVersion:m=0})=>{const g=v(),{formatTimeAgo:f}=Qt(),{capabilities:b}=Ll(),[y,C]=s(!1),[S,x]=s(o||[]),w=r(async()=>{try{C(!0),x(await n()??[])}catch(e){}finally{C(!1)}},[]);i(()=>{S.length||w()},[]);const[T,k]=s(""),[E,I]=s(null),[N,$]=s([]),[O,A]=s(!1),[R,P]=s(!1),L=r(()=>{A(!1),P(!0),w()},[w]),F=r(e=>{e===mg.CloudConnector?A(!0):d?.(e)},[d]),M=a(()=>E===hg.BulkConfig?h:E===hg.BulkSource?m:0,[E,h,m]),{supportedConnections:z,supportedConnectionIds:B}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Fe.Success,n=D(e.odigosVersion,t,e.type);return o&&n}))(S,M);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[S,M]);i(()=>{if(!E||E===hg.Delete)return;const e=N.filter(e=>!B.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[E,N.length,B.length]);const X=a(()=>S.filter(e=>!T||e.name.toLowerCase().includes(T.toLowerCase())).map(e=>({cells:[{key:fg.Id,rawValue:e.id},{key:fg.Name,rawValue:e.name},{key:fg.Type,rawValue:e.type,component:()=>t(Jt,{variant:Cg[e.type]??ro.Default,label:_i(e.type)})},{key:fg.Status,rawValue:e.status,component:()=>(e=>{if(e.type===Di.Connector){const o=yg[e.status]??"Pending",n=e.status===Fe.Success?Ua:e.status===Fe.Error?Va:void 0;return t(qe,{status:e.status,label:o,leftIcon:n})}const o=e.status===Fe.Success?"Connection live":"Connection lost",n=e.status===Fe.Success?Ua:Va;return t(qe,{status:e.status,label:o,leftIcon:n})})(e)},{key:fg.OdigosVersion,rawValue:e.odigosVersion},{key:fg.ConnectedSince,rawValue:e.connectedAt?f(e.connectedAt):"-"},{key:fg.LastActivity,rawValue:e.lastSeenAt?f(e.lastSeenAt):"-"}],onClick:e.status!==Fe.Success||E?void 0:()=>l(e),isSelected:N.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Fe.Success||E===hg.BulkConfig&&!D(e.odigosVersion,h,e.type)||E===hg.BulkSource&&!D(e.odigosVersion,m,e.type)})),[S,N,T,E,h,m,f,l]),U=a(()=>S.length>0&&S.every(e=>e.type===Di.K8s),[S]),V=a(()=>{const e=(e,t)=>{$([e]),I(t)};return(e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===fg.Status)?.rawValue===Fe.Success)(e))return[{id:cn(),label:"Delete Connection",rightIcon:Da,onClick:()=>vg(e,i)}];const d=vg(e,e=>t.find(t=>t.id===e));if(d?.type!==Di.K8s)return[];const p=!!d&&D(d.odigosVersion,o,d.type),u=!!d&&D(d.odigosVersion,n,d.type),h=_(o,d?.type),m=_(n,d?.type),g=[];return a&&g.push({id:cn(),tooltip:u?et.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:ja,disabled:!u,onClick:()=>vg(e,a)}),l&&g.push({id:cn(),tooltip:et.ADD_DESTINATION,rightIcon:za,onClick:()=>vg(e,l)}),r&&g.push({id:cn(),tooltip:et.ADD_ACTION,rightIcon:Ma,onClick:()=>vg(e,r)}),s&&g.push({id:cn(),tooltip:et.ADD_INSTRUMENTATION_RULE,rightIcon:Ha,onClick:()=>vg(e,s)}),c&&g.push({id:cn(),tooltip:p?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:el,disabled:!p,onClick:()=>vg(e,c)}),g}})({connections:S,configMinSupportedVersion:h,snapshotMinSupportedVersion:m,onDelete:t=>e(t,hg.Delete),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?t=>e(t,hg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?t=>e(t,hg.BulkDestination):void 0,onAddAction:b.canCreateAction?t=>e(t,hg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?t=>e(t,hg.BulkInstrumentationRule):void 0,onEditConfiguration:b.canApplyEffectiveConfig?t=>e(t,hg.BulkConfig):void 0})},[S,h,m,b]),H=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:cn(),type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Add Sources",rightIcon:ja,onClick:o}});const s=[n?{id:hg.BulkDestination,label:et.ADD_DESTINATION,icon:za}:null,i?{id:hg.BulkAction,label:et.ADD_ACTION,icon:Ma}:null,a?{id:hg.BulkInstrumentationRule,label:et.ADD_INSTRUMENTATION_RULE,icon:Ha}:null,l?{id:hg.BulkConfig,label:"Manage Configurations",icon:el}:null];return s.some(Boolean)&&r.push({id:cn(),type:co.ButtonDropData,buttonProps:{variant:be.Secondary,size:fe.S,label:"Bulk Operations",onClick:e=>{e===hg.BulkSource?o?.():e===hg.BulkDestination?n?.():e===hg.BulkAction?i?.():e===hg.BulkInstrumentationRule?a?.():e===hg.BulkConfig&&l?.()}},dropDataProps:{alignX:sn.Left,items:s}}),r.push({id:cn(),type:co.Button,buttonProps:{variant:be.Text,size:fe.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:b.canFetchSnapshots&&b.canBulkPersistSources?()=>I(hg.BulkSource):void 0,onAddDestination:b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canCreateDestination?()=>I(hg.BulkDestination):void 0,onAddAction:b.canCreateAction?()=>I(hg.BulkAction):void 0,onAddInstrumentationRule:b.canCreateInstrumentationRule?()=>I(hg.BulkInstrumentationRule):void 0,onManageConfigurations:b.canApplyEffectiveConfig?()=>I(hg.BulkConfig):void 0}),[b]);return t(Pi,{children:e(dt,{fullHeight:!0,richTitle:{icon:kl,title:et.CONNECTIONS,badge:{label:S.length.toString(),status:Fe.Unknown}},search:{placeholder:"Search by cluster name",value:T,onChange:e=>k(e),width:"300px"},actions:[{id:"connections-refresh",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,leftIcon:Qa,onClick:w,disabled:y}},{id:"connections-create-new",type:co.ButtonDropData,buttonProps:{variant:be.Primary,size:fe.S,label:Ft.CREATE_NEW,onClick:e=>F(e)},dropDataProps:{alignX:sn.Right,items:gg}}],children:[t(Ao,{variant:Ro.Pretty,headerBackgroundColor:g.v2.colors.silver[1e3],isLoading:y,withCheckboxes:U,columns:bg,rows:X,rowActionsPushRightPosition:E?`calc(${vr} - 24px)`:void 0,getRowActions:V}),E===hg.BulkConfig&&b.canApplyEffectiveConfig&&t(ql,{connectionIds:N,children:t(Sp,{onClose:()=>I(null),connections:z,selectedConnectionIds:N,setSelectedConnectionIds:$})}),E===hg.BulkSource&&b.canFetchSnapshots&&b.canBulkPersistSources&&t(ql,{connectionIds:N,children:t(Jl,{selectedConnectionIds:N,children:t(Lc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkDestination&&b.canFetchDestinationCategories&&b.canFetchPotentialDestinations&&b.canTestConnection&&b.canCreateDestination&&t(ql,{connectionIds:N,children:t(Zl,{children:t(Sc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkAction&&b.canCreateAction&&t(ql,{connectionIds:N,children:t(Ql,{children:t(pc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),E===hg.BulkInstrumentationRule&&b.canCreateInstrumentationRule&&t(ql,{connectionIds:N,children:t(er,{children:t(xc,{onClose:()=>I(null),selectedConnectionIds:N,setSelectedConnectionIds:$})})}),O&&t(tr,{providers:p,children:t(vp,{onClose:()=>A(!1),withOverlay:!0,onCreateCloudConnector:u,onCreated:L})}),t(wr,{isOpen:R,onClose:()=>P(!1)}),t(Cr,{target:"connection",isOpen:E===hg.Delete,onClose:()=>{$([]),I(null)},onApprove:async()=>{const e=N[0];e&&(await c(e),await w())}}),t(Do,{isOpen:!!N.length&&!E,richTitle:{icon:Oa,title:"Selected Clusters",badge:{label:N.length}},actions:H})]})})},xg=b.div`
593
1033
  display: flex;
594
1034
  align-items: center;
595
1035
  justify-content: space-between;
@@ -598,26 +1038,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
598
1038
  width: 100%;
599
1039
  border-radius: 16px;
600
1040
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
601
- `,lh=f.div`
1041
+ `,wg=b.div`
602
1042
  display: flex;
603
1043
  align-items: center;
604
1044
  justify-content: center;
605
1045
  padding: 8px;
606
1046
  border-radius: 8px;
607
1047
  background-color: ${({theme:e})=>e.v2.colors.white[500]+ut["004"]};
608
- `,rh=({setStep:o,onSave:n,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=b(),c=()=>o(2),d=()=>o(3),u=i(()=>Object.values(a||{}).flatMap((o,n)=>o.map((o,i)=>{if(!o.selected)return null;const a=o.kind||Tt.Namespace,l=a===Tt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(ah,{children:[t(de,{nowrap:!0,children:l}),t(Ye,{label:a,status:Le.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${i}`)})).filter(Boolean),[a]),p=i(()=>l?.map((o,n)=>{const i=wt(o.option.type).icon;return e(ah,{children:[e(he,{$gap:8,children:[i&&t(lh,{children:t(i,{size:24})}),t(de,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Ye,{status:o.testResult.succeeded?Le.Success:Le.Error,leftIcon:o.testResult.succeeded?Fa:La})]},`destination-${n}`)})||[],[l]);return t(nr,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:Va,title:Qe.SUMMARY,subTitle:Qe.REVIEW_SETUP},leftColumn:{width:"50%",header:e(he,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(he,{$gap:8,children:[t(_a,{size:24}),t(de,{nowrap:!0,children:Qe.SELECTED_SOURCES}),t(Ye,{label:u.length})]}),t(me,{"data-id":"summary-edit-sources",leftIcon:Ia,variant:fe.Secondary,size:ge.S,onClick:c})]}),list:u.length?u:[t(gt,{$height:"100%",children:t(Oe,{icon:_a,title:Qe.NO_SOURCES_SELECTED,subTitle:Qe.ADD_SOURCE_PROMPT,button:{leftIcon:Sa,label:Qe.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(he,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(he,{$gap:8,children:[t(Ra,{size:24}),t(de,{nowrap:!0,children:Qe.SELECTED_DESTINATIONS}),t(Ye,{label:p.length})]}),t(me,{"data-id":"summary-edit-destinations",leftIcon:Ia,variant:fe.Secondary,size:ge.S,onClick:d})]}),list:p.length?p:[t(gt,{"data-id":"summary-no-destinations",$height:"100%",children:t(Oe,{icon:Ra,title:Qe.NO_DESTINATIONS_SELECTED,subTitle:Qe.ADD_DESTINATION_PROMPT,button:{leftIcon:Sa,label:Qe.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},sh=f.div`
1048
+ `,Tg=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=v(),c=()=>o(2),d=()=>o(3),p=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,i)=>{if(!o.selected)return null;const a=o.kind||Et.Namespace,l=a===Et.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(xg,{children:[t(pe,{nowrap:!0,children:l}),t(qe,{label:a,status:Fe.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${i}`)})).filter(Boolean),[i]),u=a(()=>l?.map((o,n)=>{const i=wt(o.option.type).icon;return e(xg,{children:[e(me,{$gap:8,children:[i&&t(wg,{children:t(i,{size:24})}),t(pe,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(qe,{status:o.testResult.succeeded?Fe.Success:Fe.Error,leftIcon:o.testResult.succeeded?Ua:Va})]},`destination-${n}`)})||[],[l]);return t(br,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:ol,title:et.SUMMARY,subTitle:et.REVIEW_SETUP},leftColumn:{width:"50%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(ja,{size:24}),t(pe,{nowrap:!0,children:et.SELECTED_SOURCES}),t(qe,{label:p.length})]}),t(ge,{"data-id":"summary-edit-sources",leftIcon:_a,variant:be.Secondary,size:fe.S,onClick:c})]}),list:p.length?p:[t(ft,{$height:"100%",children:t(Re,{icon:ja,title:et.NO_SOURCES_SELECTED,subTitle:et.ADD_SOURCE_PROMPT,button:{leftIcon:Na,label:et.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(me,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(me,{$gap:8,children:[t(za,{size:24}),t(pe,{nowrap:!0,children:et.SELECTED_DESTINATIONS}),t(qe,{label:u.length})]}),t(ge,{"data-id":"summary-edit-destinations",leftIcon:_a,variant:be.Secondary,size:fe.S,onClick:d})]}),list:u.length?u:[t(ft,{"data-id":"summary-no-destinations",$height:"100%",children:t(Re,{icon:za,title:et.NO_DESTINATIONS_SELECTED,subTitle:et.ADD_DESTINATION_PROMPT,button:{leftIcon:Na,label:et.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},kg=b.div`
609
1049
  position: relative;
610
1050
  overflow: hidden;
611
1051
  width: 100vw;
612
1052
  height: 100vh;
613
1053
  box-sizing: border-box;
614
- `,ch=f.svg`
1054
+ `,Eg=b.svg`
615
1055
  position: absolute;
616
1056
  top: 50%;
617
1057
  left: 50%;
618
1058
  transform: translate(-50%, -50%);
619
1059
  z-index: -1;
620
- `,dh=[{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"}],uh=[{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:dh},{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:dh},{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:dh}],ph=({paddingXAxis:o="0px",paddingYAxis:a="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=i(()=>s/uh[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(sh,{$paddingXAxis:o,$paddingYAxis:a,children:[uh.map(({width:o,height:n,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(ch,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:i,d:a,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]})},hh=f.div`
1060
+ `,Ig=[{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"}],Ng=[{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:Ig},{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:Ig},{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:Ig}],$g=({paddingXAxis:o="0px",paddingYAxis:n="0px",children:l})=>{const[r,c]=s(window.innerWidth),d=a(()=>r/Ng[0].width,[r]);return i(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(kg,{$paddingXAxis:o,$paddingYAxis:n,children:[Ng.map(({width:o,height:n,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(Eg,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:i,d:a,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]})},Og=b.div`
621
1061
  display: flex;
622
1062
  flex-direction: column;
623
1063
  align-items: center;
@@ -628,7 +1068,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
628
1068
  width: 50vw;
629
1069
  border-radius: 16px;
630
1070
  background: ${({theme:e})=>e.v2.colors.silver[900]};
631
- `,mh=f.div`
1071
+ `,Ag=b.div`
632
1072
  display: flex;
633
1073
  flex-direction: column;
634
1074
  align-items: center;
@@ -638,15 +1078,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
638
1078
  & * {
639
1079
  text-align: center;
640
1080
  }
641
- `,gh=({onStart:o})=>t(se,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(gt,{$height:"100%",children:e(hh,{children:[e(mh,{children:[t(de,{size:pe.L,weight:500,children:Qe.GET_STARTED_WITH}),t(rr,{size:260}),t(de,{size:pe.S,weight:400,children:Qe.GET_STARTED_DESCRIPTION})]}),t(me,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:wa,size:ge.L,onClick:o})]})})}),fh=[{step:1,label:Qe.INSTALLATION,forceDoneBadge:!0},{step:2,label:Qe.SOURCES_SETUP},{step:3,label:Qe.DESTINATIONS_SETUP},{step:4,label:Qe.SUMMARY}],bh=f.div`
1081
+ `,Rg=({onStart:o})=>t(ce,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(ft,{$height:"100%",children:e(Og,{children:[e(Ag,{children:[t(pe,{size:he.L,weight:500,children:et.GET_STARTED_WITH}),t(xr,{size:260}),t(pe,{size:he.S,weight:400,children:et.GET_STARTED_DESCRIPTION})]}),t(ge,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:$a,size:fe.L,onClick:o})]})})}),Dg=[{step:1,label:et.INSTALLATION,forceDoneBadge:!0},{step:2,label:et.SOURCES_SETUP},{step:3,label:et.DESTINATIONS_SETUP},{step:4,label:et.SUMMARY}],_g=b.div`
642
1082
  display: flex;
643
1083
  flex-direction: column;
644
1084
  gap: 32px;
645
1085
  padding: 64px;
646
- `,vh=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:i})=>{const{setDrawerType:a}=ro(),{sourcesApi:l,destinationsApi:s}=kl(),[c,d]=r(1),[u,p]=r(!1),[h,m]=r(null),[g,f]=r(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(ph,{paddingXAxis:o,paddingYAxis:n,children:[e(bh,{children:[t(rr,{useInline:!0}),t(Ni,{currentStep:c,data:fh,gap:32})]}),t(_l,{initialInputs:h,children:e(zl,{children:[1===c&&t(gh,{onStart:b}),2===c&&t(Sc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(lc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(rh,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.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")};a(an.OnboardingDone),i()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},yh=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Ch=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Sh=f.div`
1086
+ `,Pg=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:i})=>{const{setDrawerType:a}=ho(),{sourcesApi:l,destinationsApi:r}=Ll(),[c,d]=s(1),[p,u]=s(!1),[h,m]=s(null),[g,f]=s(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e($g,{paddingXAxis:o,paddingYAxis:n,children:[e(_g,{children:[t(xr,{useInline:!0}),t(Li,{currentStep:c,data:Dg,gap:32})]}),t(Jl,{initialInputs:h,children:e(Zl,{children:[1===c&&t(Rg,{onStart:b}),2===c&&t(Lc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(Sc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(Tg,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!p){u(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>r.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")};a(pn.OnboardingDone),i()}catch(e){return u(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},Lg=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Fg=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Mg=b.div`
647
1087
  position: relative;
648
1088
  display: inline-flex;
649
- `,wh=f.button`
1089
+ `,zg=b.button`
650
1090
  display: inline-flex;
651
1091
  align-items: center;
652
1092
  gap: 8px;
@@ -659,7 +1099,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
659
1099
  &:hover {
660
1100
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
661
1101
  }
662
- `,xh=f.div`
1102
+ `,Bg=b.div`
663
1103
  position: absolute;
664
1104
  top: calc(100% + 8px);
665
1105
  right: 0;
@@ -672,25 +1112,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
672
1112
  border-radius: 12px;
673
1113
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
674
1114
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
675
- `,kh=f.div`
1115
+ `,Xg=b.div`
676
1116
  display: flex;
677
1117
  flex-direction: column;
678
1118
  gap: 12px;
679
1119
  padding: 16px;
680
1120
  max-height: 60vh;
681
1121
  overflow-y: auto;
682
- `,Th=f.div`
1122
+ `,Ug=b.div`
683
1123
  display: flex;
684
1124
  align-items: center;
685
1125
  gap: 8px;
686
1126
  padding: 12px 16px;
687
1127
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
688
- `,$h=f.div`
1128
+ `,Vg=b.div`
689
1129
  display: flex;
690
1130
  align-items: center;
691
1131
  gap: 8px;
692
1132
  margin-left: auto;
693
- `,Ih=()=>{const o=b(),{sourcesApi:l,namespacesApi:s}=kl(),c=l.useSources().items,d=s.useNamespaces().items,{selectedStreamName:u}=et(),{getItemSS:p,setItemSS:h,removeItemSS:m}=Pi(),{namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:w,clearAll:x,getEmptyState:k}=Ai(),T=i(()=>Oi(c,u),[c,u]);n(()=>{const e=p(Ri.OVERVIEW_FILTERS,k());w(e)},[]);const[$,I]=r({namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[E,N]=r(Ch($)),[A,O]=r(!1);n(()=>{if(!A){const e={namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),N(Ch(e))}},[A,g,f,v,y,C,S]);const R=a(null);vo(R,()=>O(!1)),Jo({key:"Escape",active:A},()=>O(!1));const D=i(()=>{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]),P=i(()=>{const e=new Set,t=[];return T.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[T]),F=i(()=>{const e=new Set,t=[];return T.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:qe[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[T]),L=i(()=>Di.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),M=i(()=>{const e=new Set,t=[];return T.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:i}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Ut(n)})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[T]),_=(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})},z=A?Da:Pa,B=i(()=>yh($.languages),[$.languages]);return e(Sh,{ref:R,children:[e(wh,{"data-id":"filters-trigger",$isOpen:A,type:"button",onClick:()=>O(e=>!e),children:[t(hl,{size:16,fill:o.v2.colors.white[500]}),t(de,{size:pe.XS,weight:500,nowrap:!0,children:"Filters"}),E>0&&t(Ye,{label:E,status:Le.Unknown,textSize:pe.XXXS}),t(z,{size:16,fill:o.v2.colors.silver[200]})]}),A&&e(xh,{children:[e(kh,{children:[t(bt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:yh($.namespaces),setValues:e=>_("namespaces",D,e)}),t(bt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:yh($.kinds),setValues:e=>_("kinds",P,e)}),t(bt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:B,setValues:e=>_("languages",F,e)}),t(bt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:yh($.monitors),setValues:e=>_("monitors",L,e)}),t(bt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!M.length,options:M,values:yh($.podsAgentInjectionStatus),setValues:e=>_("podsAgentInjectionStatus",M,e)}),t(ae,{label:"Show only sources with errors",size:It.L,value:!!$.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(Th,{children:[t(me,{"data-id":"filters-reset",size:ge.S,variant:fe.Text,label:"Reset",onClick:()=>{m(Ri.OVERVIEW_FILTERS),x(),I(k()),N(0),O(!1)},textColor:o.v2.colors.red[500]}),e($h,{children:[t(me,{"data-id":"filters-cancel",size:ge.S,variant:fe.Secondary,label:"Cancel",onClick:()=>O(!1)}),t(me,{"data-id":"filters-apply",size:ge.S,variant:fe.Primary,label:"Apply",onClick:()=>{h(Ri.OVERVIEW_FILTERS,$),w($),N(Ch($)),O(!1)}})]})]})]})]})},Eh=f.div`
1133
+ `,Hg=()=>{const o=v(),{sourcesApi:n,namespacesApi:r}=Ll(),c=n.useSources().items,d=r.useNamespaces().items,{selectedStreamName:p}=tt(),{getItemSS:u,setItemSS:h,removeItemSS:m}=Xi(),{namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:x,clearAll:w,getEmptyState:T}=Fi(),k=a(()=>Mi(c,p),[c,p]);i(()=>{const e=u(zi.OVERVIEW_FILTERS,T());x(e)},[]);const[E,I]=s({namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[N,$]=s(Fg(E)),[O,A]=s(!1);i(()=>{if(!O){const e={namespaces:g,kinds:f,monitors:b,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),$(Fg(e))}},[O,g,f,b,y,C,S]);const R=l(null);To(R,()=>A(!1)),nn({key:"Escape",active:O},()=>A(!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]),_=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:Je[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[k]),L=a(()=>Bi.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return k.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:i}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Kt(n)})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[k]),M=(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})},z=O?Ba:Xa,B=a(()=>Lg(E.languages),[E.languages]);return e(Mg,{ref:R,children:[e(zg,{"data-id":"filters-trigger",$isOpen:O,type:"button",onClick:()=>A(e=>!e),children:[t(El,{size:16,fill:o.v2.colors.white[500]}),t(pe,{size:he.XS,weight:500,nowrap:!0,children:"Filters"}),N>0&&t(qe,{label:N,status:Fe.Unknown,textSize:he.XXXS}),t(z,{size:16,fill:o.v2.colors.silver[200]})]}),O&&e(Bg,{children:[e(Xg,{children:[t(vt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Lg(E.namespaces),setValues:e=>M("namespaces",D,e)}),t(vt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!_.length,options:_,values:Lg(E.kinds),setValues:e=>M("kinds",_,e)}),t(vt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:B,setValues:e=>M("languages",P,e)}),t(vt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:Lg(E.monitors),setValues:e=>M("monitors",L,e)}),t(vt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:Lg(E.podsAgentInjectionStatus),setValues:e=>M("podsAgentInjectionStatus",F,e)}),t(le,{label:"Show only sources with errors",size:Nt.L,value:!!E.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(Ug,{children:[t(ge,{"data-id":"filters-reset",size:fe.S,variant:be.Text,label:"Reset",onClick:()=>{m(zi.OVERVIEW_FILTERS),w(),I(T()),$(0),A(!1)},textColor:o.v2.colors.red[500]}),e(Vg,{children:[t(ge,{"data-id":"filters-cancel",size:fe.S,variant:be.Secondary,label:"Cancel",onClick:()=>A(!1)}),t(ge,{"data-id":"filters-apply",size:fe.S,variant:be.Primary,label:"Apply",onClick:()=>{h(zi.OVERVIEW_FILTERS,E),x(E),$(Fg(E)),A(!1)}})]})]})]})]})},jg=b.div`
694
1134
  position: relative;
695
1135
  display: flex;
696
1136
  align-items: center;
@@ -701,7 +1141,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
701
1141
  box-sizing: border-box;
702
1142
  border-radius: 16px 16px 0 0;
703
1143
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
704
- `,Nh=f.div`
1144
+ `,Gg=b.div`
705
1145
  position: absolute;
706
1146
  bottom: 0;
707
1147
  left: 0;
@@ -710,7 +1150,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
710
1150
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
711
1151
  border-radius: 32px;
712
1152
  transition: width 0.3s;
713
- `,Ah=({entityType:o,badge:n,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:u}=ro();return e(Eh,{children:[e(he,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(te,{size:Fi.S,partiallyChecked:r,value:!!s,onChange:c}),t(de,{size:pe.S,nowrap:!0,children:`${Ut(o)}s`}),t(Ye,{label:n,tooltip:i,status:Le.Unknown,textSize:pe.XXXS})]}),e(he,{children:[t(vt,{"data-id":`add-${o}`,icon:Sa,onClick:()=>u(Li(o))}),t(vt,{"data-id":`refresh-${o}`,icon:Ga,onClick:l,disabled:a})]}),"number"==typeof d&&t(Nh,{$percent:d})]})},Oh=f(Q)`
1153
+ `,Wg=({entityType:o,badge:n,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:p}=ho();return e(jg,{children:[e(me,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(oe,{size:Ui.S,partiallyChecked:r,value:!!s,onChange:c}),t(pe,{size:he.S,nowrap:!0,children:`${Kt(o)}s`}),t(qe,{label:n,tooltip:i,status:Fe.Unknown,textSize:he.XXXS})]}),e(me,{children:[t(yt,{"data-id":`add-${o}`,icon:Na,onClick:()=>p(Vi(o))}),t(yt,{"data-id":`refresh-${o}`,icon:Qa,onClick:l,disabled:a})]}),"number"==typeof d&&t(Gg,{$percent:d})]})},Kg=b(ee)`
714
1154
  align-items: center !important;
715
1155
  justify-content: center !important;
716
1156
  align-self: stretch;
@@ -725,7 +1165,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
725
1165
  &:hover {
726
1166
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
727
1167
  }
728
- `,Rh=({entityType:o,description:n})=>{const{setDrawerType:i}=ro();return e(Oh,{onClick:()=>i(Li(o)),children:[e(he,{$gap:4,children:[t(Sa,{size:16}),t(de,{size:pe.S,children:`Add ${Ut(o)}`})]}),t(de,{size:pe.XXS,align:"center",children:n})]})},Dh=f.div`
1168
+ `,Yg=({entityType:o,description:n})=>{const{setDrawerType:i}=ho();return e(Kg,{onClick:()=>i(Vi(o)),children:[e(me,{$gap:4,children:[t(Na,{size:16}),t(pe,{size:he.S,children:`Add ${Kt(o)}`})]}),t(pe,{size:he.XXS,align:"center",children:n})]})},qg=b.div`
729
1169
  display: flex;
730
1170
  align-items: center;
731
1171
  gap: 12px;
@@ -740,10 +1180,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
740
1180
  &:hover {
741
1181
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
742
1182
  }
743
- `,Ph=f(he)`
1183
+ `,Jg=b(me)`
744
1184
  flex: 1;
745
1185
  min-width: 0;
746
- `,Fh=({entityId:o,entityType:n,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=b(),f=n===Tt.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=ro(),{selectedSources:w,setSelectedSources:x}=Mi(),k=m,T=f?k.id.namespace:"",$=i(()=>{if(!f)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[f,w,T,k.id]),I=v&&!h?_i(Le.Info,g):l?_i(l,g):void 0,E=f&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Dh,{"data-id":E,$faded:y,onClick:()=>{C(ho(n)),S(o)},children:[f&&t(te,{size:Fi.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(po,{icons:u,icon:d,iconSrc:p}),e(Ph,{$gap:4,children:[t(Re,{size:pe.XS,nowrap:!0,children:a}),t(he,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(Ee,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ye,{label:c,status:l&&[Le.Error,Le.Warning].includes(l)?l:Le.Unknown,leftIcon:I,textSize:pe.XXXS})})})]})]})};function Lh(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Le.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Jt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Mh(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Le.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const _h=f.div`
1186
+ `,Zg=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:p,iconSrc:u,isActive:h,raw:m})=>{const g=v(),f=n===Et.Source,b="boolean"==typeof h,y=r||b&&!h,{setDrawerType:C,setDrawerEntityId:S}=ho(),{selectedSources:x,setSelectedSources:w}=Hi(),T=m,k=f?T.id.namespace:"",E=a(()=>{if(!f)return-1;const e=x[k];return e?.length?e.findIndex(e=>e.id.name===T.id.name&&e.id.kind===T.id.kind&&(e.id.region??"")===(T.id.region??"")):-1},[f,x,k,T.id]),I=b&&!h?ji(Fe.Info,g):l?ji(l,g):void 0,N=f&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}${o.region?`-${o.region}`:""}`:o;return e(qg,{"data-id":N,$faded:y,onClick:()=>{C(vo(n)),S(o)},children:[f&&t(oe,{size:Ui.S,value:-1!==E,onChange:()=>{const e={...x};e[k]||(e[k]=[]),-1===E?e[k].push(T):e[k].splice(E,1),w(e)}}),t(bo,{icons:p,icon:d,iconSrc:u}),e(Jg,{$gap:4,children:[t(De,{size:he.XS,nowrap:!0,children:i}),t(me,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t($e,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(qe,{label:c,status:l&&[Fe.Error,Fe.Warning].includes(l)?l:Fe.Unknown,leftIcon:I,textSize:he.XXXS})})})]})]})};function Qg(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Fe.Loading)?e:{...e,workloadOdigosHealthStatus:{status:oo.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function ef(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Fe.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const tf=b.div`
747
1187
  position: absolute;
748
1188
  top: 0;
749
1189
  left: 0;
@@ -754,21 +1194,21 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
754
1194
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
755
1195
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
756
1196
  pointer-events: none;
757
- `,zh=f.div`
1197
+ `,of=b.div`
758
1198
  display: flex;
759
1199
  align-items: center;
760
1200
  gap: 8px;
761
1201
  padding: 4px 8px 0;
762
- `,Bh=f.div`
1202
+ `,nf=b.div`
763
1203
  flex: 1;
764
1204
  height: 1px;
765
1205
  background: ${({theme:e})=>e.v2.colors.silver[700]};
766
- `,Xh=({namespace:e})=>{const o=b();return t(_h,{children:t(de,{size:pe.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Vh=({namespace:o})=>{const n=b();return e(zh,{children:[t(Bh,{}),t(de,{size:pe.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Bh,{})]})},Uh={[Tt.InstrumentationRule]:Qe.NO_DATA_INSTRUMENTATION_RULES,[Tt.Source]:Qe.NO_DATA_SOURCES,[Tt.Action]:Qe.NO_DATA_ACTIONS,[Tt.Destination]:Qe.NO_DATA_DESTINATIONS},Gh=f.div`
1206
+ `,af=({namespace:e})=>{const o=v();return t(tf,{children:t(pe,{size:he.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},lf=({namespace:o})=>{const n=v();return e(of,{children:[t(nf,{}),t(pe,{size:he.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(nf,{})]})},rf={[Et.InstrumentationRule]:et.NO_DATA_INSTRUMENTATION_RULES,[Et.Source]:et.NO_DATA_SOURCES,[Et.Action]:et.NO_DATA_ACTIONS,[Et.Destination]:et.NO_DATA_DESTINATIONS},sf=b.div`
767
1207
  display: flex;
768
1208
  flex-direction: column;
769
1209
  flex: 1 0 0;
770
1210
  min-width: 0;
771
- `,Hh=f.div`
1211
+ `,cf=b.div`
772
1212
  display: flex;
773
1213
  flex-direction: column;
774
1214
  align-items: stretch;
@@ -778,7 +1218,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
778
1218
  border-radius: 0 0 16px 16px;
779
1219
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
780
1220
  overflow: hidden;
781
- `,jh=f.div`
1221
+ `,df=b.div`
782
1222
  position: relative;
783
1223
  display: flex;
784
1224
  flex-direction: column;
@@ -790,7 +1230,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
790
1230
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
791
1231
  height: ${({$height:e})=>e}px;
792
1232
  overflow: hidden;
793
- `,Wh=({entityType:o,entities:a,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const h=o===Tt.Source,m=a.length!==s,g=Nt(e=>h?e.progress[Rt.Instrumenting]?.percentage:void 0),f=Nt(e=>h?e.progress[Rt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Mi(),C=i(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=i(()=>{if(!c)return;const e=new Map,t=o===Tt.Source?c.sources:o===Tt.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(zi(o),o.throughput);return e},[c,o]),w=i(()=>a.map(e=>((e,t,o)=>{const n=Dt(e);if(!n)return null;const i=t===Tt.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case Jt.Failure:return{status:Le.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Jt.Notice:return{status:Le.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Jt.Pending:case Jt.Waiting:return{status:void 0,faded:!1,displaySource:Lh(e)};case Jt.Unsupported:case Jt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Mh(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Bi(e.conditions);a=t,r=o}const c=Xi(e,t,{extended:i,prioritizeDisplayName:!i});let d,u,p,h,m;switch(t){case Tt.Source:{d=uo(e),u=Ui(Tt.Source);const t=o?.get(Vi(n));h=go(t);break}case Tt.Destination:{const t=wt(e.destinationType.type);u=t.icon,p=t.iconSrc;const i=o?.get(Vi(n));h=go(i),m=!e.disabled;break}case Tt.Action:u=_t(e.type),m=!e.disabled;break;case Tt.InstrumentationRule:u=Wt(e.type),m=!e.disabled}return{key:Vi(n),entityId:n,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:m,raw:s}}})(e,o,S)).filter(Boolean),[a,o,S]),[x,k]=r(""),{elements:T,indexToNamespace:$,multipleNs:I,dividerCount:E}=i(()=>{const e=[],o=[],n=new Set(w.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const n of w)h&&n.namespace&&n.namespace!==a&&(""!==a&&(o.push(n.namespace),e.push(t(Vh,{namespace:n.namespace},`ns-divider-${n.namespace}`)),i+=1),a=n.namespace),o.push(n.namespace||""),e.push(t(Fh,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:i}},[w,h]);n(()=>{if(h&&$.length&&!x){const e=$.find(Boolean);e&&k(e)}},[h,$]);const N=l(e=>{if(!$.length)return;const t=$[Math.min(e,$.length-1)];t&&t!==x&&k(t)},[$,x]),A=58*w.length+(I?28:0)+32*E,O=Math.max(0,u-52-16),R=Math.min(O,A)+8,D="number"==typeof b?`${b}%`:m?`${a.length}/${s}`:s;return e(Gh,{children:[t(Ah,{entityType:o,badge:D,badgeTooltip:m?Qe.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:C>0&&a?.length!==C,allSelected:C>0&&a?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};a?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(Hh,{children:a.length?e(jh,{$height:R,children:[I&&x&&t(Xh,{namespace:x}),t(lo,{gap:4,elements:T,onTopIndexChange:I?N:void 0})]}):d?t(mt,{size:3}):t(Rh,{entityType:o,description:Uh[o]??Qe.TO_COLLECT_OTEL_DATA})})]})},Kh=f.div`
1233
+ `,pf=({entityType:o,entities:n,unfilteredCount:l,metrics:c,loading:d,maxHeight:p,refetch:u})=>{const h=o===Et.Source,m=n.length!==l,g=Ot(e=>h?e.progress[Dt.Instrumenting]?.percentage:void 0),f=Ot(e=>h?e.progress[Dt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Hi(),C=a(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=a(()=>{if(!c)return;const e=new Map,t=o===Et.Source?c.sources:o===Et.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(Gi(o),o.throughput);return e},[c,o]),x=a(()=>n.map(e=>((e,t,o)=>{const n=zt(e);if(!n)return null;const i=t===Et.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case oo.Failure:return{status:Fe.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case oo.Notice:return{status:Fe.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case oo.Pending:case oo.Waiting:return{status:void 0,faded:!1,displaySource:Qg(e)};case oo.Unsupported:case oo.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:ef(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Wi(e.conditions);a=t,r=o}const c=Ki(e,t,{extended:i,prioritizeDisplayName:!i});let d,p,u,h,m;switch(t){case Et.Source:{d=fo(e),p=qi(Et.Source);const t=o?.get(Yi(n));h=So(t);break}case Et.Destination:{const t=wt(e.destinationType.type);p=t.icon,u=t.iconSrc;const i=o?.get(Yi(n));h=So(i),m=!e.disabled;break}case Et.Action:p=Vt(e.type),m=!e.disabled;break;case Et.InstrumentationRule:p=Zt(e.type),m=!e.disabled}return{key:Yi(n),entityId:n,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:p,icons:d,iconSrc:u,isActive:m,raw:s}}})(e,o,S)).filter(Boolean),[n,o,S]),[w,T]=s(""),{elements:k,indexToNamespace:E,multipleNs:I,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 i=0,a="";for(const n of x)h&&n.namespace&&n.namespace!==a&&(""!==a&&(o.push(n.namespace),e.push(t(lf,{namespace:n.namespace},`ns-divider-${n.namespace}`)),i+=1),a=n.namespace),o.push(n.namespace||""),e.push(t(Zg,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:i}},[x,h]);i(()=>{if(h&&E.length&&!w){const e=E.find(Boolean);e&&T(e)}},[h,E]);const $=r(e=>{if(!E.length)return;const t=E[Math.min(e,E.length-1)];t&&t!==w&&T(t)},[E,w]),O=58*x.length+(I?28:0)+32*N,A=Math.max(0,p-52-16),R=Math.min(A,O)+8,D="number"==typeof b?`${b}%`:m?`${n.length}/${l}`:l;return e(sf,{children:[t(Wg,{entityType:o,badge:D,badgeTooltip:m?et.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:u,partiallySelected:C>0&&n?.length!==C,allSelected:C>0&&n?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};n?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(cf,{children:n.length?e(df,{$height:R,children:[I&&w&&t(af,{namespace:w}),t(uo,{gap:4,elements:k,onTopIndexChange:I?$:void 0})]}):d?t(gt,{size:3}):t(Yg,{entityType:o,description:rf[o]??et.TO_COLLECT_OTEL_DATA})})]})},uf=b.div`
794
1234
  width: 100%;
795
1235
  flex: 1;
796
1236
  min-height: 0;
@@ -798,10 +1238,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
798
1238
  display: flex;
799
1239
  align-items: stretch;
800
1240
  gap: 16px;
801
- `,Yh={sources:[],destinations:[]},qh=()=>{const o=Ai(),{selectedStreamName:n}=et(),{containerRef:a,containerHeight:l}=Gi(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=kl(),{items:p,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=ro(e=>e.drawerType),{data:S}=u.useMetrics({skip:!p.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),w=S?.getOverviewMetrics??Yh,x=i(()=>Oi(p,n),[p,n]),k=i(()=>Xt(m,n),[m,n]),T=i(()=>Hi(x,o),[x,o]),$=i(()=>ji(k,o),[k,o]),I=i(()=>Wi(f,o),[f,o]);return e(Kh,{ref:a,children:[t(Wh,{entityType:Tt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(Wh,{entityType:Tt.Source,entities:T,unfilteredCount:x.length,metrics:w,loading:h,maxHeight:l,refetch:r.fetchAll}),t(Wh,{entityType:Tt.Action,entities:I,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(Wh,{entityType:Tt.Destination,entities:$,unfilteredCount:k.length,metrics:w,loading:g,maxHeight:l,refetch:s.fetchAll})]})},Jh="40vw",Zh=f.div`
1241
+ `,hf={sources:[],destinations:[]},mf=()=>{const o=Fi(),{selectedStreamName:n}=tt(),{containerRef:i,containerHeight:l}=Ji(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:p}=Ll(),{items:u,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=ho(e=>e.drawerType),{data:S}=p.useMetrics({skip:!u.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),x=S?.getOverviewMetrics??hf,w=a(()=>Mi(u,n),[u,n]),T=a(()=>Gt(m,n),[m,n]),k=a(()=>Zi(w,o),[w,o]),E=a(()=>Qi(T,o),[T,o]),I=a(()=>ea(f,o),[f,o]);return e(uf,{ref:i,children:[t(pf,{entityType:Et.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(pf,{entityType:Et.Source,entities:k,unfilteredCount:w.length,metrics:x,loading:h,maxHeight:l,refetch:r.fetchAll}),t(pf,{entityType:Et.Action,entities:I,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(pf,{entityType:Et.Destination,entities:E,unfilteredCount:T.length,metrics:x,loading:g,maxHeight:l,refetch:s.fetchAll})]})},gf="40vw",ff=b.div`
802
1242
  position: relative;
803
- width: ${Jh};
804
- `,Qh=f.div`
1243
+ width: ${gf};
1244
+ `,bf=b.div`
805
1245
  position: absolute;
806
1246
  top: calc(100% + 8px);
807
1247
  left: 0;
@@ -810,23 +1250,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
810
1250
  flex-direction: column;
811
1251
  gap: 8px;
812
1252
  padding: 8px;
813
- width: calc(${Jh} - 16px);
1253
+ width: calc(${gf} - 16px);
814
1254
  border-radius: 12px;
815
1255
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
816
1256
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
817
- `,em=f.div`
1257
+ `,vf=b.div`
818
1258
  display: flex;
819
1259
  align-items: center;
820
1260
  overflow-x: auto;
821
- `,tm=f.div`
1261
+ `,yf=b.div`
822
1262
  display: flex;
823
1263
  flex-direction: column;
824
1264
  gap: 0;
825
1265
  max-height: 60vh;
826
1266
  overflow-y: auto;
827
- `,om=f.div`
1267
+ `,Cf=b.div`
828
1268
  padding: 8px 12px 4px 12px;
829
- `,nm=f.div`
1269
+ `,Sf=b.div`
830
1270
  display: flex;
831
1271
  align-items: center;
832
1272
  gap: 8px;
@@ -836,12 +1276,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
836
1276
  &:hover {
837
1277
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
838
1278
  }
839
- `,im=f.div`
1279
+ `,xf=b.div`
840
1280
  padding: 16px 8px;
841
- `,am=({preventPopup:o=!1})=>{const n=b(),{selectedStreamName:l}=et(),{searchText:c,setSearchText:d}=Ai(),{setDrawerType:u,setDrawerEntityId:p}=ro(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=kl(),v=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,w=a(null),[x,k]=r(!1),[T,$]=r("all"),I=!o&&(!!c||x),E=()=>{d(""),k(!1),$("all")};vo(w,()=>E()),Jo({key:"Escape",active:I},E);const{categories:N,searchResults:A}=i(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?o.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,c=i?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,d=[{category:Tt.Source,label:"Sources",count:r.length,entities:[]},{category:Tt.Action,label:"Actions",count:s.length,entities:[]},{category:Tt.Destination,label:"Destinations",count:c.length,entities:[]},{category:Tt.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(a)).map(e=>({...e,entities:e.category===Tt.InstrumentationRule?l:e.category===Tt.Source?r:e.category===Tt.Action?s:e.category===Tt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:S,sources:Oi(v,l),actions:C,destinations:Xt(y,l),searchText:c,selectedCategory:T}),[S,v,C,y,l,c,T]),O=i(()=>N.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[N]),R=A.some(({entities:e})=>e.length>0);return e(Zh,{ref:w,children:[t(ao,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>k(!0),width:Jh}),I&&e(Qh,{children:[O.length>1&&t(em,{children:t(be,{options:O,selected:T,setSelected:$})}),R?t(tm,{children:A.map(({category:o,label:i,entities:a},l)=>{if(!a.length)return null;const r=Ui(o);return e(s,{children:[t(om,{children:t(de,{size:pe.XXS,color:ue.Secondary,children:i})}),a.map((i,a)=>e(nm,{onClick:()=>{const e=Dt(i);e&&(u(ho(o)),p(e),E())},children:[r&&t(r,{size:16,fill:n.v2.colors.white[500]}),t(de,{size:pe.XS,nowrap:!0,children:Xi(i,o,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${o}`)})}):t(im,{children:t(Oe,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},lm=({onRedirectToSampling:n})=>{const{sourcesApi:a}=kl(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=ro(),u=()=>{c(null),d(null)},p=i(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=i(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(o,{children:[t(ap,{}),r===an.AddSource&&t(_l,{children:t(Sc,{onClose:u,withOverlay:!0})}),r===an.AddDestination&&t(zl,{children:t(lc,{onClose:u,withOverlay:!0})}),r===an.AddInstrumentationRule&&t(Xl,{sourceOptions:p,namespaceOptions:h,children:t(rc,{onClose:u,withOverlay:!0})}),r===an.AddAction&&t(Bl,{children:t(qs,{onClose:u,withOverlay:!0})}),r===an.EditSource&&t(Vl,{children:t(Du,{onClose:u,sourceId:s,onRedirectToSampling:n})}),r===an.EditDestination&&t(zl,{children:t($c,{onClose:u,destinationId:s})}),r===an.EditInstrumentationRule&&t(Xl,{sourceOptions:p,namespaceOptions:h,children:t(Ec,{onClose:u,ruleId:s})}),r===an.EditAction&&t(Bl,{children:t(xc,{onClose:u,actionId:s})})]})},rm=f.div`
1281
+ `,wf=({preventPopup:o=!1})=>{const n=v(),{selectedStreamName:i}=tt(),{searchText:r,setSearchText:d}=Fi(),{setDrawerType:p,setDrawerEntityId:u}=ho(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=Ll(),b=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,x=l(null),[w,T]=s(!1),[k,E]=s("all"),I=!o&&(!!r||w),N=()=>{d(""),T(!1),E("all")};To(x,()=>N()),nn({key:"Escape",active:I},N);const{categories:$,searchResults:O}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?o.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,c=i?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,d=[{category:Et.Source,label:"Sources",count:r.length,entities:[]},{category:Et.Action,label:"Actions",count:s.length,entities:[]},{category:Et.Destination,label:"Destinations",count:c.length,entities:[]},{category:Et.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 p=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Et.InstrumentationRule?l:e.category===Et.Source?r:e.category===Et.Action?s:e.category===Et.Destination?c:[]}));return{categories:d,searchResults:p}})({instrumentationRules:S,sources:Mi(b,i),actions:C,destinations:Gt(y,i),searchText:r,selectedCategory:k}),[S,b,C,y,i,r,k]),A=a(()=>$.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[$]),R=O.some(({entities:e})=>e.length>0);return e(ff,{ref:x,children:[t(po,{value:r,onChange:e=>d(e.toLowerCase()),onFocus:()=>T(!0),width:gf}),I&&e(bf,{children:[A.length>1&&t(vf,{children:t(ve,{options:A,selected:k,setSelected:E})}),R?t(yf,{children:O.map(({category:o,label:i,entities:a},l)=>{if(!a.length)return null;const r=qi(o);return e(c,{children:[t(Cf,{children:t(pe,{size:he.XXS,color:ue.Secondary,children:i})}),a.map((i,a)=>e(Sf,{onClick:()=>{const e=zt(i);e&&(p(vo(o)),u(e),N())},children:[r&&t(r,{size:16,fill:n.v2.colors.white[500]}),t(pe,{size:he.XS,nowrap:!0,children:Ki(i,o,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${o}`)})}):t(xf,{children:t(Re,{hideIcon:!0,title:"No results",subTitle:r?`No matches for "${r}"`:"Start typing to search"})})]})]})},Tf=({onRedirectToSampling:n})=>{const{sourcesApi:i}=Ll(),{items:l}=i.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=ho(),p=()=>{c(null),d(null)},u=a(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=a(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(o,{children:[t(vm,{}),r===pn.AddSource&&t(Jl,{children:t(Lc,{onClose:p,withOverlay:!0})}),r===pn.AddDestination&&t(Zl,{children:t(Sc,{onClose:p,withOverlay:!0})}),r===pn.AddInstrumentationRule&&t(er,{sourceOptions:u,namespaceOptions:h,children:t(xc,{onClose:p,withOverlay:!0})}),r===pn.AddAction&&t(Ql,{children:t(pc,{onClose:p,withOverlay:!0})}),r===pn.EditSource&&t(or,{children:t(Gh,{onClose:p,sourceId:s,onRedirectToSampling:n})}),r===pn.EditDestination&&t(Zl,{children:t(wp,{onClose:p,destinationId:s})}),r===pn.EditInstrumentationRule&&t(er,{sourceOptions:u,namespaceOptions:h,children:t(kp,{onClose:p,ruleId:s})}),r===pn.EditAction&&t(Ql,{children:t(Cp,{onClose:p,actionId:s})})]})},kf=b.div`
842
1282
  position: relative;
843
1283
  display: inline-flex;
844
- `,sm=f.div`
1284
+ `,Ef=b.div`
845
1285
  display: inline-flex;
846
1286
  align-items: center;
847
1287
  gap: 6px;
@@ -852,7 +1292,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
852
1292
  &:hover {
853
1293
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
854
1294
  }
855
- `,cm=f.div`
1295
+ `,If=b.div`
856
1296
  position: absolute;
857
1297
  top: calc(100% + 8px);
858
1298
  left: 0;
@@ -866,18 +1306,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
866
1306
  border-radius: 12px;
867
1307
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
868
1308
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
869
- `,dm=f.div`
1309
+ `,Nf=b.div`
870
1310
  display: flex;
871
1311
  align-items: center;
872
1312
  gap: 8px;
873
1313
  width: 100%;
874
- `,um=f.div`
1314
+ `,$f=b.div`
875
1315
  display: flex;
876
1316
  flex-direction: column;
877
1317
  gap: 0;
878
1318
  max-height: 240px;
879
1319
  overflow-y: auto;
880
- `,pm=f.div`
1320
+ `,Of=b.div`
881
1321
  display: flex;
882
1322
  align-items: center;
883
1323
  gap: 8px;
@@ -888,29 +1328,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
888
1328
  &:hover {
889
1329
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
890
1330
  }
891
- `,hm=f.div`
1331
+ `,Af=b.div`
892
1332
  flex: 1;
893
1333
  min-width: 0;
894
1334
  overflow: hidden;
895
1335
  text-overflow: ellipsis;
896
1336
  white-space: nowrap;
897
- `,mm=f.div`
1337
+ `,Rf=b.div`
898
1338
  display: flex;
899
1339
  align-items: center;
900
1340
  gap: 2px;
901
1341
  flex-shrink: 0;
902
- `,gm=f.div`
1342
+ `,Df=b.div`
903
1343
  display: flex;
904
1344
  padding-top: 4px;
905
1345
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
906
- `,fm=()=>{const l=b(),{isVm:s}=C(),{clearStore:c}=Ki(),{dataStreamsApi:d}=kl();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=et(),m=a(null),[g,f]=r(!1),[v,y]=r(""),[S,w]=r(""),[x,k]=r(!1),[T,$]=r(!1),[I,E]=r(!1),[N,A]=r(""),[O,R]=r(!1);vo(m,()=>f(!1)),n(()=>{g||y("")},[g]);const D=i(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),P=g?Da:Pa;return s?null:e(o,{children:[e(rm,{ref:m,children:[e(sm,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(ml,{size:24}),t(de,{size:pe.S,weight:500,nowrap:!0,children:(F=p,`Data Stream: ${F}`)}),t(Ye,{label:u.length,status:Le.Unknown,textSize:pe.XXXS}),t(P,{size:20,fill:l.v2.colors.silver[200]})]}),g&&e(cm,{children:[t(dm,{children:t(ao,{value:v,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(um,{children:0===D.length?t(pm,{children:t(de,{size:pe.XS,color:ue.Secondary,children:"No streams match"})}):D.map(({name:o})=>{const n=o===Yi;return e(pm,{"data-id":`stream-row-${o}`,$selected:o===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),f(!1)})(o),children:[t(hm,{children:t(de,{size:pe.XS,nowrap:!0,children:o})}),e(mm,{children:[t(vt,{"data-id":`stream-edit-${o}`,icon:Ia,size:yt.XS,onClick:e=>{e.stopPropagation(),f(!1),w(o),k(!0)}}),!n&&t(vt,{"data-id":`stream-delete-${o}`,icon:Ca,size:yt.XS,onClick:e=>{e.stopPropagation(),f(!1),A(o),R(!0)}})]})]},`stream-${o}`)})}),t(gm,{children:t(me,{"data-id":"add-stream-trigger",variant:fe.Secondary,size:ge.S,leftIcon:Sa,label:`${Ft.NEW} ${Qe.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),c(),E(!0),$(!0)}})})]})]}),I&&t(Ul,{defaultExcludeName:p,children:t(tp,{isOpen:T,onClose:()=>$(!1),onCloseEnd:()=>E(!1)})}),S&&t(Ul,{children:t(op,{isOpen:x,dataStreamName:S,onClose:()=>k(!1),onCloseEnd:()=>w("")})}),t(ir,{target:`${Qe.STREAM_NAME.toLowerCase()} "${N}"`,isOpen:O,onClose:()=>R(!1),onApprove:async()=>{N&&await d.remove(N)}})]});var F},bm=()=>{const{selectedStreamName:a}=et(),{selectedSources:s,setSelectedSources:c}=Mi(),{sourcesApi:d}=kl(),[u,p]=r(!1),[h,m]=r(!1),g=i(()=>Object.values(s).reduce((e,t)=>e+t.length,0),[s]),f=l(()=>{c({})},[c]),b=l(()=>p(!1),[]),v=l(()=>m(!1),[]);n(()=>{f()},[a,f]);const y=l(()=>{d.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==mo.StaticPod).map(so)),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:a}))]))),f()},[d,s,a,f]),S=i(()=>[{id:"multi-source-deselect",type:io.Button,buttonProps:{variant:fe.Text,size:ge.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:io.Button,buttonProps:{variant:fe.Secondary,size:ge.S,label:"Restart",leftIcon:il,onClick:()=>p(!0)}},{id:"multi-source-uninstrument",type:io.Button,buttonProps:{variant:fe.Primary,size:ge.S,label:"Uninstrument",leftIcon:Ca,onClick:()=>m(!0)}}],[f]);return e(o,{children:[t(Io,{isOpen:g>0,richTitle:{icon:_a,title:"Selected sources",badge:{label:g}},actions:S}),t(Ze,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:fe.Secondary,onClick:b},approveButton:{label:"Confirm",variant:fe.Primary,onClick:()=>{y(),b()}}}),t(ir,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},vm=y`
1346
+ `,_f=()=>{const n=v(),{isVm:r}=S(),{clearStore:c}=ta(),{dataStreamsApi:d}=Ll();d.useDataStreams();const{dataStreams:p,selectedStreamName:u,setSelectedStreamName:h}=tt(),m=l(null),[g,f]=s(!1),[b,y]=s(""),[C,x]=s(""),[w,T]=s(!1),[k,E]=s(!1),[I,N]=s(!1),[$,O]=s(""),[A,R]=s(!1);To(m,()=>f(!1)),i(()=>{g||y("")},[g]);const D=a(()=>{if(!b)return p;const e=b.toLowerCase();return p.filter(({name:t})=>t.toLowerCase().includes(e))},[p,b]),_=g?Ba:Xa;return r?null:e(o,{children:[e(kf,{ref:m,children:[e(Ef,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(Il,{size:24}),t(pe,{size:he.S,weight:500,nowrap:!0,children:(P=u,`Data Stream: ${P}`)}),t(qe,{label:p.length,status:Fe.Unknown,textSize:he.XXXS}),t(_,{size:20,fill:n.v2.colors.silver[200]})]}),g&&e(If,{children:[t(Nf,{children:t(po,{value:b,onChange:y,placeholder:"Search streams...",width:"100%"})}),t($f,{children:0===D.length?t(Of,{children:t(pe,{size:he.XS,color:ue.Secondary,children:"No streams match"})}):D.map(({name:o})=>{const n=o===oa;return e(Of,{"data-id":`stream-row-${o}`,$selected:o===u,onClick:()=>(e=>{e!==u&&(c(),h(e)),f(!1)})(o),children:[t(Af,{children:t(pe,{size:he.XS,nowrap:!0,children:o})}),e(Rf,{children:[t(yt,{"data-id":`stream-edit-${o}`,icon:_a,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),x(o),T(!0)}}),!n&&t(yt,{"data-id":`stream-delete-${o}`,icon:Ia,size:Ct.XS,onClick:e=>{e.stopPropagation(),f(!1),O(o),R(!0)}})]})]},`stream-${o}`)})}),t(Df,{children:t(ge,{"data-id":"add-stream-trigger",variant:be.Secondary,size:fe.S,leftIcon:Na,label:`${Ft.NEW} ${et.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),c(),N(!0),E(!0)}})})]})]}),I&&t(nr,{defaultExcludeName:u,children:t(mm,{isOpen:k,onClose:()=>E(!1),onCloseEnd:()=>N(!1)})}),C&&t(nr,{children:t(gm,{isOpen:w,dataStreamName:C,onClose:()=>T(!1),onCloseEnd:()=>x("")})}),t(Cr,{target:`${et.STREAM_NAME.toLowerCase()} "${$}"`,isOpen:A,onClose:()=>R(!1),onApprove:async()=>{$&&await d.remove($)}})]});var P},Pf=()=>{const{selectedStreamName:n}=tt(),{selectedSources:l,setSelectedSources:c}=Hi(),{sourcesApi:d}=Ll(),[p,u]=s(!1),[h,m]=s(!1),g=a(()=>Object.values(l).reduce((e,t)=>e+t.length,0),[l]),f=r(()=>{c({})},[c]),b=r(()=>u(!1),[]),v=r(()=>m(!1),[]);i(()=>{f()},[n,f]);const y=r(()=>{d.restartWorkloads(Object.values(l).flat().filter(e=>e.id.kind!==yo.StaticPod).map(mo)),f()},[d,l,f]),C=r(()=>{d.persistV2(Object.fromEntries(Object.entries(l).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,region:e.region,selected:!1,currentStreamName:n}))]))),f()},[d,l,n,f]),S=a(()=>[{id:"multi-source-deselect",type:co.Button,buttonProps:{variant:be.Text,size:fe.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:co.Button,buttonProps:{variant:be.Secondary,size:fe.S,label:"Restart",leftIcon:dl,onClick:()=>u(!0)}},{id:"multi-source-uninstrument",type:co.Button,buttonProps:{variant:be.Primary,size:fe.S,label:"Uninstrument",leftIcon:Ia,onClick:()=>m(!0)}}],[f]);return e(o,{children:[t(Do,{isOpen:g>0,richTitle:{icon:ja,title:"Selected sources",badge:{label:g}},actions:S}),t(Qe,{isOpen:p,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:be.Secondary,onClick:b},approveButton:{label:"Confirm",variant:be.Primary,onClick:()=>{y(),b()}}}),t(Cr,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},Lf=C`
907
1347
  0% {
908
1348
  background-position: 200% 50%;
909
1349
  }
910
1350
  100% {
911
1351
  background-position: 0% 50%;
912
1352
  }
913
- `,ym=f.div`
1353
+ `,Ff=b.div`
914
1354
  display: flex;
915
1355
  align-items: center;
916
1356
  justify-content: space-evenly;
@@ -921,43 +1361,43 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
921
1361
 
922
1362
  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%)`};
923
1363
  background-size: 200% 100%;
924
- animation: ${vm} 15s linear infinite;
925
- `,Cm=[Ma,_a,Oa,Ra],Sm=({onRedirectToSampling:o})=>{const n=b();return e(Ei,{children:[e(ct,{fullHeight:!0,customTitle:t(fm,{}),customSearch:t(am,{}),filters:t(Ih,{}),children:[t(ym,{children:Cm.map((o,i)=>e(s,{children:[t(o,{size:24}),i<Cm.length-1&&t(Aa,{fill:n.v2.colors.white[500]+ut["020"],size:24})]},o.name))}),t(qh,{})]}),t(lm,{onRedirectToSampling:o}),t(bm,{})]})};var wm;(e=>{e.Gateway="gateway",e.Node="node"})(wm||(wm={}));const xm=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:a,disabled:l})=>{const r=i(()=>{const e=[];return o&&e.push({id:on(),type:io.Button,buttonProps:{label:"Download Diagnose",leftIcon:nl,size:ge.S,variant:fe.Text,onClick:o,disabled:l}}),n&&e.push({id:on(),type:io.Button,buttonProps:{label:"Refresh",leftIcon:Ga,size:ge.S,variant:fe.Text,onClick:n,disabled:l,loading:a}}),e},[o,n,l,a]);return e(he,{$alignItems:"center",$justifyContent:"space-between",children:[t(qi,{icon:gl,title:"Collectors Pipeline"}),t(Ji,{actions:r})]})},km=({pod:o,onClose:n})=>{const{formatTimeAgo:a}=Kt(),{collectorsApi:l}=kl(),{data:r}=l.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),s=i(()=>[{id:on(),title:"Node",label:r?.node??"-",withCopy:!0},{id:on(),title:"Status",badge:{status:Zi(r?.status),label:r?.status??"-"}}],[r]),c=i(()=>r?.containers?.map(e=>({id:on(),items:[{id:on(),title:"Container",label:e.name??"-"},{id:on(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:on(),title:"Ready",badge:{status:e.ready?Le.Success:Le.Error,leftIcon:e.ready?xa:ka,label:e.ready?"True":"False",invertColors:!0}},{id:on(),title:"Started",badge:{status:e.started?Le.Success:Le.Error,leftIcon:e.started?xa:ka,label:e.started?"True":"False",invertColors:!0}},{id:on(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:on(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:on(),title:Qe.RESTARTS,label:e.restarts.toString()},{id:on(),title:"State Reason",label:e.stateReason??"-"},{id:on(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:on(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(se,{isOpen:!!o,header:{icon:Xa,title:"Pod Information",onClose:n},children:r?e(Lt,{bgTint:"1000",richTitle:{icon:Xa,title:r.name,withCopy:!0},children:[t(Lt,{bgTint:"900",cellsPerRow:2,items:s}),e(Lt,{bgTint:"900",richTitle:{icon:qa,title:Qe.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(no,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(no,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(no,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Lt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:o})=>t(Lt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(Oe,{title:"No containers",subTitle:"Pod has no containers"})}),t(lr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(gt,{$height:"50vh",children:t(Ct,{withSpinner:!0})})})};var Tm;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Tm||(Tm={}));const $m=e=>{const t=[{key:Tm.PodName,label:"Pod Name"},{key:Tm.Status,label:"Status"},{key:Tm.Restarts,label:Qe.RESTARTS},{key:Tm.NodeName,label:"Node Name"},{key:Tm.Age,label:"Age"},{key:Tm.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Tm.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Im=({isLoading:o,pods:n,withSpanDropRate:a})=>{const l=b(),{formatTimeAgo:s}=Kt(),[c,d]=r(null),u=i(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:Tm.PodName,rawValue:o.name},{key:Tm.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ye,{status:Zi(e),label:e});var e}},{key:Tm.Restarts,rawValue:o.restartsCount.toString()},{key:Tm.NodeName,rawValue:o.nodeName},{key:Tm.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(de,{children:"-"});const i=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),a=i>0?Math.round((n?.metricsDroppedRps??0)/i*100):0,l=a>0?Le.Error:Le.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?Le.Error:Le.Success;return e(he,{$gap:4,children:[t(Ee,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Ye,{status:l,label:`Receiver ${a}%`,leftIcon:l===Le.Error?fl:bl,useSecondaryTone:!0,invertColors:!0})}),t(Ee,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Ye,{status:c,label:`Exporter ${s}%`,leftIcon:c===Le.Error?fl:bl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Tm.Age,rawValue:s(o.creationTimestamp)},{key:Tm.DockerImage,rawValue:o.image}]})),[n,l]);return e(Lt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Xa,title:"Pods"},children:[t(To,{variant:$o.Data,isLoading:o,columns:$m(a),rows:u}),t(km,{pod:c,onClose:()=>d(null)})]})},Em=({isOpen:e,onClose:o,title:n,yaml:i})=>t(se,{isOpen:e,header:{icon:vl,title:n,onClose:o},children:t(lr,{yaml:i,defaultOpen:!0})}),Nm=e=>{switch(e){case Qi.Healthy:return"All desired replicas are updated, available, and ready";case Qi.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Qi.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Qi.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Qi.Down:return"No available replicas";case Qi.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Am;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Am||(Am={}));const Om=f.div`
1364
+ animation: ${Lf} 15s linear infinite;
1365
+ `,Mf=[Ha,ja,Ma,za],zf=({onRedirectToSampling:o})=>{const n=v();return e(Pi,{children:[e(dt,{fullHeight:!0,customTitle:t(_f,{}),customSearch:t(wf,{}),filters:t(Hg,{}),children:[t(Ff,{children:Mf.map((o,i)=>e(c,{children:[t(o,{size:24}),i<Mf.length-1&&t(Fa,{fill:n.v2.colors.white[500]+ut["020"],size:24})]},o.name))}),t(mf,{})]}),t(Tf,{onRedirectToSampling:o}),t(Pf,{})]})};var Bf;(e=>{e.Gateway="gateway",e.Node="node"})(Bf||(Bf={}));const Xf=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:cn(),type:co.Button,buttonProps:{label:"Download Diagnose",leftIcon:bl,size:fe.S,variant:be.Text,onClick:o,disabled:l}}),n&&e.push({id:cn(),type:co.Button,buttonProps:{label:"Refresh",leftIcon:Qa,size:fe.S,variant:be.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(me,{$alignItems:"center",$justifyContent:"space-between",children:[t(na,{icon:Nl,title:"Collectors Pipeline"}),t(ia,{actions:r})]})},Uf=({pod:o,onClose:n})=>{const{formatTimeAgo:i}=Qt(),{collectorsApi:l}=Ll(),{data:r}=l.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),s=a(()=>[{id:cn(),title:"Node",label:r?.node??"-",withCopy:!0},{id:cn(),title:"Status",badge:{status:aa(r?.status),label:r?.status??"-"}}],[r]),c=a(()=>r?.containers?.map(e=>({id:cn(),items:[{id:cn(),title:"Container",label:e.name??"-"},{id:cn(),title:"Status",label:e.startedAt?`${e.status} (since ${i(e.startedAt)})`:e.status},{id:cn(),title:"Ready",badge:{status:e.ready?Fe.Success:Fe.Error,leftIcon:e.ready?Oa:Aa,label:e.ready?"True":"False",invertColors:!0}},{id:cn(),title:"Started",badge:{status:e.started?Fe.Success:Fe.Error,leftIcon:e.started?Oa:Aa,label:e.started?"True":"False",invertColors:!0}},{id:cn(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:cn(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:cn(),title:et.RESTARTS,label:e.restarts.toString()},{id:cn(),title:"State Reason",label:e.stateReason??"-"},{id:cn(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:cn(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(ce,{isOpen:!!o,header:{icon:tl,title:"Pod Information",onClose:n},children:r?e(Xt,{bgTint:"1000",richTitle:{icon:tl,title:r.name,withCopy:!0},children:[t(Xt,{bgTint:"900",cellsPerRow:2,items:s}),e(Xt,{bgTint:"900",richTitle:{icon:cl,title:et.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(so,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(so,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(so,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Xt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:o})=>t(Xt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(Re,{title:"No containers",subTitle:"Pod has no containers"})}),t(Sr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(ft,{$height:"50vh",children:t(St,{withSpinner:!0})})})};var Vf;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Vf||(Vf={}));const Hf=e=>{const t=[{key:Vf.PodName,label:"Pod Name"},{key:Vf.Status,label:"Status"},{key:Vf.Restarts,label:et.RESTARTS},{key:Vf.NodeName,label:"Node Name"},{key:Vf.Age,label:"Age"},{key:Vf.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Vf.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},jf=({isLoading:o,pods:n,withSpanDropRate:i})=>{const l=v(),{formatTimeAgo:r}=Qt(),[c,d]=s(null),p=a(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:Vf.PodName,rawValue:o.name},{key:Vf.Status,rawValue:o.status,component:()=>{return e=o.status,t(qe,{status:aa(e),label:e});var e}},{key:Vf.Restarts,rawValue:o.restartsCount.toString()},{key:Vf.NodeName,rawValue:o.nodeName},{key:Vf.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(pe,{children:"-"});const i=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),a=i>0?Math.round((n?.metricsDroppedRps??0)/i*100):0,l=a>0?Fe.Error:Fe.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?Fe.Error:Fe.Success;return e(me,{$gap:4,children:[t($e,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(qe,{status:l,label:`Receiver ${a}%`,leftIcon:l===Fe.Error?$l:Ol,useSecondaryTone:!0,invertColors:!0})}),t($e,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(qe,{status:c,label:`Exporter ${s}%`,leftIcon:c===Fe.Error?$l:Ol,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Vf.Age,rawValue:r(o.creationTimestamp)},{key:Vf.DockerImage,rawValue:o.image}]})),[n,l]);return e(Xt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:tl,title:"Pods"},children:[t(Ao,{variant:Ro.Data,isLoading:o,columns:Hf(i),rows:p}),t(Uf,{pod:c,onClose:()=>d(null)})]})},Gf=({isOpen:e,onClose:o,title:n,yaml:i})=>t(ce,{isOpen:e,header:{icon:Al,title:n,onClose:o},children:t(Sr,{yaml:i,defaultOpen:!0})}),Wf=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 Kf;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Kf||(Kf={}));const Yf=b.div`
926
1366
  flex: 0.5;
927
1367
  padding: 12px;
928
1368
  border-radius: 12px;
929
1369
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
930
- `,Rm=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:a,isLoading:l})=>{const{formatTimeAgo:s}=Kt(),[c,d]=r(null),u=i(()=>(e=>{switch(e){case wm.Gateway:return"Deployment";case wm.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=i(()=>((e,t,o,n)=>{const i={status:Le.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case wm.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case wm.Node:a=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return i}return a?{status:Le.Info,label:"Rollout in progress",rightIcon:Ga,useSecondaryTone:!0}:l?{status:Le.Disabled,label:`Last Rollout: ${n(l)}`}:i})(o,n,a,s),[n,a,o,s]),h=i(()=>((e,t,o,n)=>{let i=n?Le.Info:Le.Unknown,a=n?"Loading":Qi.Unknown,l=n?"Fetching data...":Nm(Qi.Unknown);switch(e){case wm.Gateway:i=t?.status?Zi(t?.status):i,a=t?.status??a,l=t?.status?Nm(t.status):l;break;case wm.Node:i=o?.status?Zi(o?.status):i,a=o?.status??a,l=o?.status?Nm(o.status):l}return{status:i,title:a,description:l}})(o,n,a,l),[n,a,o,l]),m=i(()=>((e,t,o)=>{switch(e){case wm.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 wm.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,a),[n,a,o]),g=i(()=>((e,t,o,n)=>{switch(e){case wm.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 wm.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,a,l),[n,a,o,l]),f=i(()=>(o===wm.Gateway?n?.manifestYAML:a?.manifestYAML)??"",[n,a,o]),b=i(()=>(o===wm.Gateway?n?.configMapYAML:a?.configMapYAML)??"",[n,a,o]);return e(Lt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:vl,title:u,badge:p},actions:[{id:on(),type:io.ButtonDropData,buttonProps:{variant:fe.Secondary,size:ge.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Am.ManifestYaml,label:u,icon:yl},{id:Am.ConfigMapYaml,label:"ConfigMap",icon:yl}]}}],children:[e(he,{$gap:16,children:[t("div",{children:t(ea,{...h})}),m.map(e=>t(Om,{children:t("div",{children:t(ta,{...e})})},e.title)),g.map(e=>t(oa,{...e},e.title))]}),t(Em,{isOpen:c===Am.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(Em,{isOpen:c===Am.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Dm=[{value:wm.Gateway,label:"Gateway"},{value:wm.Node,label:"Node Collector"}],Pm=({minSupportedVersion:o})=>{const{isVersionSupported:n,version:a,minSupportedVersion:s}=C(o),[c,d]=r(wm.Gateway),u=c===wm.Gateway,p=c===wm.Node,{collectorsApi:h,configApi:m}=kl(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!u}),{data:y=[],loading:S,refetch:w}=h.useGatewayPods({skip:!u}),{data:x,loading:k,refetch:T}=h.useNodeCollectorInfo({skip:!p}),{data:$=[],loading:I,refetch:E}=h.useNodeCollectorPods({skip:!p}),N=u&&(b||S)||p&&(k||I),A=l(()=>{u?(v(),w()):p&&(T(),E())},[u,p,v,w,T,E]),O=i(()=>u?y:$,[y,$,u]);return e(Ei,{children:[t(xm,{disabled:!n,loading:N,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(na,{children:[e(Q,{children:[t(be,{variant:xo.Underline,size:De.L,options:Dm,selected:c,setSelected:d}),t(Rm,{selectedTab:c,gatewayInfo:f??null,nodeCollectorInfo:x??null,isLoading:N})]}),t(Im,{isLoading:N,pods:O,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(cr,{minSupportedVersion:s,currentVersion:a||""})]})]})},Fm=f.div`
1370
+ `,qf=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:r}=Qt(),[c,d]=s(null),p=a(()=>(e=>{switch(e){case Bf.Gateway:return"Deployment";case Bf.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),u=a(()=>((e,t,o,n)=>{const i={status:Fe.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case Bf.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Bf.Node:a=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return i}return a?{status:Fe.Info,label:"Rollout in progress",rightIcon:Qa,useSecondaryTone:!0}:l?{status:Fe.Disabled,label:`Last Rollout: ${n(l)}`}:i})(o,n,i,r),[n,i,o,r]),h=a(()=>((e,t,o,n)=>{let i=n?Fe.Info:Fe.Unknown,a=n?"Loading":la.Unknown,l=n?"Fetching data...":Wf(la.Unknown);switch(e){case Bf.Gateway:i=t?.status?aa(t?.status):i,a=t?.status??a,l=t?.status?Wf(t.status):l;break;case Bf.Node:i=o?.status?aa(o?.status):i,a=o?.status??a,l=o?.status?Wf(o.status):l}return{status:i,title:a,description:l}})(o,n,i,l),[n,i,o,l]),m=a(()=>((e,t,o)=>{switch(e){case Bf.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 Bf.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]),g=a(()=>((e,t,o,n)=>{switch(e){case Bf.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 Bf.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===Bf.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Bf.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(Xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:Al,title:p,badge:u},actions:[{id:cn(),type:co.ButtonDropData,buttonProps:{variant:be.Secondary,size:fe.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Kf.ManifestYaml,label:p,icon:Rl},{id:Kf.ConfigMapYaml,label:"ConfigMap",icon:Rl}]}}],children:[e(me,{$gap:16,children:[t("div",{children:t(ra,{...h})}),m.map(e=>t(Yf,{children:t("div",{children:t(sa,{...e})})},e.title)),g.map(e=>t(ca,{...e},e.title))]}),t(Gf,{isOpen:c===Kf.ManifestYaml,onClose:()=>d(null),title:p,yaml:f}),t(Gf,{isOpen:c===Kf.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Jf=[{value:Bf.Gateway,label:"Gateway"},{value:Bf.Node,label:"Node Collector"}],Zf=({minSupportedVersion:o})=>{const{isVersionSupported:n,version:i,minSupportedVersion:l}=S(o),[c,d]=s(Bf.Gateway),p=c===Bf.Gateway,u=c===Bf.Node,{collectorsApi:h,configApi:m}=Ll(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!p}),{data:y=[],loading:C,refetch:x}=h.useGatewayPods({skip:!p}),{data:w,loading:T,refetch:k}=h.useNodeCollectorInfo({skip:!u}),{data:E=[],loading:I,refetch:N}=h.useNodeCollectorPods({skip:!u}),$=p&&(b||C)||u&&(T||I),O=r(()=>{p?(v(),x()):u&&(k(),N())},[p,u,v,x,k,N]),A=a(()=>p?y:E,[y,E,p]);return e(Pi,{children:[t(Xf,{disabled:!n,loading:$,onClickDownloadDiagnose:void 0,onClickRefresh:O}),e(da,{children:[e(ee,{children:[t(ve,{variant:Oo.Underline,size:_e.L,options:Jf,selected:c,setSelected:d}),t(qf,{selectedTab:c,gatewayInfo:f??null,nodeCollectorInfo:w??null,isLoading:$})]}),t(jf,{isLoading:$,pods:A,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(Tr,{minSupportedVersion:l,currentVersion:i||""})]})]})},Qf=b.div`
931
1371
  display: inline-flex;
932
1372
  align-items: center;
933
1373
  min-width: 0;
934
1374
  overflow: hidden;
935
1375
  white-space: pre;
936
1376
  text-overflow: ellipsis;
937
- `,Lm=f.div`
1377
+ `,eb=b.div`
938
1378
  display: flex;
939
1379
  flex-direction: column;
940
1380
  gap: 4px;
941
1381
  min-width: 0;
942
1382
  flex: 1;
943
1383
  opacity: ${({$disabled:e})=>e?.4:1};
944
- `,Mm=f(he)`
1384
+ `,tb=b(me)`
945
1385
  flex-shrink: 0;
946
1386
  gap: 6px;
947
1387
  align-items: center;
948
1388
  min-height: 22px;
949
- `,_m=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],zm=[{value:"all",label:ia},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Bm=({title:o,items:n,isLoading:a,showTypeFilter:s,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=b(),[m,g]=r(""),[f,v]=r("all"),y=i(()=>{let e=((e,t,o)=>o&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(n,f,s);return e=((e,t)=>{if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})})(e,m),e},[n,f,s,m]),C=i(()=>y.map(o=>{const n=o.typeBadge?((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(Lm,{$disabled:o.disabled,children:[t(Fm,{children:t(w,{parts:o.summary})}),o.name&&t(de,{size:pe.XXS,color:ue.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(Mm,{children:[o.disabled&&t(Ye,{label:Eo,textSize:pe.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ye,{label:o.typeBadge,textSize:pe.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),S=i(()=>{const e=e=>t($a,{...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:Do,leftIcon:Ia,onClick:()=>u(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>p(o.ruleId,o.samplingId)}]:[]},[C,y,u,p,S]);return t(ct,{fullHeight:!0,richTitle:{icon:ll,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:m,onChange:g,placeholder:"Search..",width:"500px",...s?{segment:{"data-id":"sampling-segment-type-filter",options:zm,selected:f,setSelected:v}}:{}},children:t(To,{variant:$o.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:aa,subTitle:sa(m)}:{hideIcon:!0,title:ra,button:{label:la,onClick:d}},columns:_m,rows:C,getRowActions:x})})},Xm=({docsUrl:o})=>{const{samplingApi:s,sourcesApi:c}=kl(),{items:d}=c.useSources(),u=i(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=s.useSamplingRules(),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]),x=l((e,t)=>s.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[s]),k=i(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[u]),T=i(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[$,I]=r(P.Noisy),[E,N]=r(null),[R,D]=r(!1),[Z,ee]=r(!1),[te,oe]=r(null),[ne,ie]=r(!1),[ae,le]=r(!1),[re,se]=r(!1),[ce,de]=r(!1);a(!1),n(()=>{},[h,p]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:pe}=ro();n(()=>{if(!ue)return;if(h||0===p.length)return;pe(null);const e=F(p,ue.ruleId,ue.category);e&&(I(L[ue.category]),D(!1),N(e))},[h,p,ue,pe]);const ve=i(()=>A(m),[m]),ye=i(()=>M(p),[p]),Ce=i(()=>O(ye?.rule??null),[ye]),Se=i(()=>_(p),[p]),we=i(()=>z(Se?.rule??null),[Se]),xe=a(E);xe.current=E,n(()=>{const e=xe.current;if(!e)return;const t=B(p,e);t?N(t):(N(null),D(!1))},[p]);const ke=i(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Te=i(()=>X(p,$,ke),[p,$,ke]),$e=l(()=>ee(!0),[]),Ie=l(()=>ee(!1),[]);l(()=>de(!1),[]);const Ee=l(async e=>{const t=p[0]?.id??"default";switch(W[$]){case"noisy":await f(t,G(e));break;case"highlyRelevant":await v(t,U(e));break;case"costReduction":await C(t,V(e))}ee(!1)},[p,$,f,v,C]),Ne=l(e=>{const t=H(p,e);t&&(D(!1),N(t))},[p]),Ae=l(()=>{N(null),D(!1)},[]),Oe=l((e,t)=>{const o=E;if(o&&o.rule.ruleId===e&&o.samplingId===t)D(!0),N({...o});else for(const o of p){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 D(!0),void N({category:n.category,rule:n.rule,samplingId:t,summary:j(n.category,n.rule)})}},[E,p]),Re=l(async(e,t,o)=>{const n=E?.category;if(n){switch(n){case"noisy":await b(o,t,G(e));break;case"highlyRelevant":await y(o,t,U(e));break;case"costReduction":await S(o,t,V(e))}D(!1)}},[E,b,y,S]),Pe=l((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Me=l(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=E?.category||W[$];await w(t,e,o),N(null),D(!1),oe(null)},[te,E,$,w]),_e=l(()=>oe(null),[]),ze=l(async(e,t)=>{await x(e,t),ie(!1)},[x]),Be=l(async e=>{const t=p[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)},[p,ye,v,y]),Xe=l(async(e,t)=>{const o=p[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}),se(!1)},[p,Se,C,S]),Ve=l(e=>{const t=W[$];let o=null;switch(t){case"noisy":{const n=G(e);o=K(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=U(e);o=K(p,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=V(e);o=K(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:ca,ruleId:o}:null},[p,$]),Ue=l(e=>{const t=E?.category,o=E?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=G(e);n=K(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=U(e);n=K(p,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=V(e);n=K(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:ca,ruleId:n}:null},[p,E]),Ge=l(e=>{ee(!1);for(const t of p){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 D(!0),void N({category:o.category,rule:o.rule,samplingId:t.id,summary:j(o.category,o.rule)})}},[p]),He=i(()=>{const e=[];return o&&e.push({id:on(),type:io.Button,buttonProps:{"data-id":"sampling-btn-docs",label:da,leftIcon:Ta,size:ge.S,variant:fe.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:on(),type:io.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:ua,leftIcon:Ga,size:ge.S,variant:fe.Text,onClick:g,loading:h}}),e.push({id:on(),type:io.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:pa,rightIcon:Sa,size:ge.S,variant:fe.Primary,onClick:$e}}),e},[o,g,h,$e]);return e(Ei,{children:[e(he,{$gap:12,$justifyContent:"space-between",children:[t(qi,{icon:ll,title:ma,subTitle:ha}),t(Ji,{actions:He})]}),e(Q,{$gap:12,$fullHeight:!0,children:[t(be,{variant:xo.Underline,size:De.L,options:Y,selected:$,setSelected:I}),e(he,{$justifyContent:"space-between",children:[t(Fe,{status:Le.Default,message:q[$]}),o&&t(me,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ta,size:ge.S,variant:fe.Text,onClick:()=>window.open(o,"_blank")})]}),$===P.Noisy?t(Kl,{title:lt,summary:ve,onEdit:()=>ie(!0)}):$===P.HighlyRelevant?t(Kl,{title:tt,summary:Ce,onEdit:()=>le(!0)}):$===P.CostReduction?t(Kl,{title:it,summary:we,onEdit:()=>se(!0)}):null,t(Bm,{title:J[$],items:Te,isLoading:h,showTypeFilter:$===P.HighlyRelevant,onRuleClick:Ne,onCreateRule:$e,onEditRule:Oe,onDeleteRule:Pe})]}),t(Hu,{formType:Al.View,data:E,defaultEditMode:R,onClose:Ae,onDelete:Pe,onSaveEdit:Re,sourceOptions:k,namespaceOptions:T,validateForm:Ue,onNavigateToDuplicate:Ge}),t(Hu,{formType:Al.Create,isOpen:Z,category:W[$],onClose:Ie,onSubmit:Ee,sourceOptions:k,namespaceOptions:T,validateForm:Ve,onNavigateToDuplicate:Ge}),t(Hu,{formType:Al.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(Hu,{formType:Al.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(Hu,{formType:Al.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(Ze,{title:va,description:ba,isOpen:!!te,onClose:_e,denyButton:{label:fa,variant:fe.Secondary,onClick:_e},approveButton:{label:ga,variant:fe.Primary,onClick:()=>{Me(),_e()}}}),!1]})},Vm=f.div`
1389
+ `,ob=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],nb=[{value:"all",label:pa},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],ib=({title:o,items:n,isLoading:i,showTypeFilter:l,onRuleClick:c,onCreateRule:d,onEditRule:p,onDeleteRule:u})=>{const h=v(),[m,g]=s(""),[f,b]=s("all"),y=a(()=>{let e=((e,t,o)=>o&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(n,f,l);return e=((e,t)=>{if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})})(e,m),e},[n,f,l,m]),C=a(()=>y.map(o=>{const n=o.typeBadge?((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(eb,{$disabled:o.disabled,children:[t(Qf,{children:t(w,{parts:o.summary})}),o.name&&t(pe,{size:he.XXS,color:ue.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(tb,{children:[o.disabled&&t(qe,{label:_o,textSize:he.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(qe,{label:o.typeBadge,textSize:he.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),S=a(()=>{const e=e=>t(Da,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=r(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:zo,leftIcon:_a,onClick:()=>p(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>u(o.ruleId,o.samplingId)}]:[]},[C,y,p,u,S]);return t(dt,{fullHeight:!0,richTitle:{icon:yl,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:m,onChange:g,placeholder:"Search..",width:"500px",...l?{segment:{"data-id":"sampling-segment-type-filter",options:nb,selected:f,setSelected:b}}:{}},children:t(Ao,{variant:Ro.Pretty,hideHeader:!0,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:ua,subTitle:ga(m)}:{hideIcon:!0,title:ma,button:{label:ha,onClick:d}},columns:ob,rows:C,getRowActions:x})})},ab=({docsUrl:o})=>{const{samplingApi:n,sourcesApi:c}=Ll(),{items:d}=c.useSources(),p=a(()=>d.map(e=>({id:e.id})),[d]),{items:u,loading:h,k8sHealthProbesConfig:m,refetch:g}=n.useSamplingRules(),f=r((e,t)=>n.createNoisy?.({samplingId:e,rule:t}),[n]),b=r((e,t,o)=>n.updateNoisy?.(t,{samplingId:e,rule:o}),[n]),v=r((e,t)=>n.createHighlyRelevant?.({samplingId:e,rule:t}),[n]),y=r((e,t,o)=>n.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[n]),C=r((e,t)=>n.createCostReduction?.({samplingId:e,rule:t}),[n]),S=r((e,t,o)=>n.updateCostReduction?.(t,{samplingId:e,rule:o}),[n]),x=r((e,t,o)=>"noisy"===o?n.deleteNoisy?.(t,e):"highlyRelevant"===o?n.deleteHighlyRelevant?.(t,e):"costReduction"===o?n.deleteCostReduction?.(t,e):void 0,[n]),w=r((e,t)=>n.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[n]),T=a(()=>p.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[p]),k=a(()=>Array.from(new Set(p.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[p]),[E,I]=s(P.Noisy),[N,$]=s(null),[O,D]=s(!1),[_,Q]=s(!1),[te,oe]=s(null),[ne,ie]=s(!1),[ae,le]=s(!1),[re,se]=s(!1),[ce,de]=s(!1);l(!1),i(()=>{},[h,u]);const{pendingViewSamplingRule:pe,setPendingViewSamplingRule:ue}=ho();i(()=>{if(!pe)return;if(h||0===u.length)return;ue(null);const e=L(u,pe.ruleId,pe.category);e&&(I(F[pe.category]),D(!1),$(e))},[h,u,pe,ue]);const he=a(()=>A(m),[m]),ye=a(()=>M(u),[u]),Ce=a(()=>R(ye?.rule??null),[ye]),Se=a(()=>z(u),[u]),xe=a(()=>B(Se?.rule??null),[Se]),we=l(N);we.current=N,i(()=>{const e=we.current;if(!e)return;const t=X(u,e);t?$(t):($(null),D(!1))},[u]);const Te=a(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),ke=a(()=>U(u,E,Te),[u,E,Te]),Ee=r(()=>Q(!0),[]),Ie=r(()=>Q(!1),[]);r(()=>de(!1),[]);const Ne=r(async e=>{const t=u[0]?.id??"default";switch(K[E]){case"noisy":await f(t,j(e));break;case"highlyRelevant":await v(t,H(e));break;case"costReduction":await C(t,V(e))}Q(!1)},[u,E,f,v,C]),$e=r(e=>{const t=G(u,e);t&&(D(!1),$(t))},[u]),Oe=r(()=>{$(null),D(!1)},[]),Ae=r((e,t)=>{const o=N;if(o&&o.rule.ruleId===e&&o.samplingId===t)D(!0),$({...o});else for(const o of u){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 D(!0),void $({category:n.category,rule:n.rule,samplingId:t,summary:W(n.category,n.rule)})}},[N,u]),Re=r(async(e,t,o)=>{const n=N?.category;if(n){switch(n){case"noisy":await b(o,t,j(e));break;case"highlyRelevant":await y(o,t,H(e));break;case"costReduction":await S(o,t,V(e))}D(!1)}},[N,b,y,S]),De=r((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Pe=r(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=N?.category||K[E];await x(t,e,o),$(null),D(!1),oe(null)},[te,N,E,x]),Me=r(()=>oe(null),[]),ze=r(async(e,t)=>{await w(e,t),ie(!1)},[w]),Be=r(async e=>{const t=u[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)},[u,ye,v,y]),Xe=r(async(e,t)=>{const o=u[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}),se(!1)},[u,Se,C,S]),Ue=r(e=>{const t=K[E];let o=null;switch(t){case"noisy":{const n=j(e);o=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=H(e);o=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=V(e);o=Y(u,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:fa,ruleId:o}:null},[u,E]),Ve=r(e=>{const t=N?.category,o=N?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=j(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=H(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=V(e);n=Y(u,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:fa,ruleId:n}:null},[u,N]),He=r(e=>{Q(!1);for(const t of u){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 D(!0),void $({category:o.category,rule:o.rule,samplingId:t.id,summary:W(o.category,o.rule)})}},[u]),je=a(()=>{const e=[];return o&&e.push({id:cn(),type:co.Button,buttonProps:{"data-id":"sampling-btn-docs",label:ba,leftIcon:Ra,size:fe.S,variant:be.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:cn(),type:co.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:va,leftIcon:Qa,size:fe.S,variant:be.Text,onClick:g,loading:h}}),e.push({id:cn(),type:co.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:ya,rightIcon:Na,size:fe.S,variant:be.Primary,onClick:Ee}}),e},[o,g,h,Ee]);return e(Pi,{children:[e(me,{$gap:12,$justifyContent:"space-between",children:[t(na,{icon:yl,title:Sa,subTitle:Ca}),t(ia,{actions:je})]}),e(ee,{$gap:12,$fullHeight:!0,children:[t(ve,{variant:Oo.Underline,size:_e.L,options:q,selected:E,setSelected:I}),e(me,{$justifyContent:"space-between",children:[t(Le,{status:Fe.Default,message:J[E]}),o&&t(ge,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ra,size:fe.S,variant:be.Text,onClick:()=>window.open(o,"_blank")})]}),E===P.Noisy?t(sr,{title:rt,summary:he,onEdit:()=>ie(!0)}):E===P.HighlyRelevant?t(sr,{title:ot,summary:Ce,onEdit:()=>le(!0)}):E===P.CostReduction?t(sr,{title:at,summary:xe,onEdit:()=>se(!0)}):null,t(ib,{title:Z[E],items:ke,isLoading:h,showTypeFilter:E===P.HighlyRelevant,onRuleClick:$e,onCreateRule:Ee,onEditRule:Ae,onDeleteRule:De})]}),t(im,{formType:Ul.View,data:N,defaultEditMode:O,onClose:Oe,onDelete:De,onSaveEdit:Re,sourceOptions:T,namespaceOptions:k,validateForm:Ve,onNavigateToDuplicate:He}),t(im,{formType:Ul.Create,isOpen:_,category:K[E],onClose:Ie,onSubmit:Ne,sourceOptions:T,namespaceOptions:k,validateForm:Ue,onNavigateToDuplicate:He}),t(im,{formType:Ul.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(im,{formType:Ul.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(im,{formType:Ul.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(Qe,{title:ka,description:Ta,isOpen:!!te,onClose:Me,denyButton:{label:wa,variant:be.Secondary,onClick:Me},approveButton:{label:xa,variant:be.Primary,onClick:()=>{Pe(),Me()}}}),!1]})},lb=b.div`
950
1390
  padding: 12px;
951
1391
  border-radius: 12px;
952
1392
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
953
- `,Um=g(({id:e,data:o})=>t(Vm,{"data-id":e,children:t(Oe,{...o})}));var Gm,Hm;Um.displayName=Um.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(Gm||(Gm={})),(e=>{e.AnimatedTraffic="animated-traffic"})(Hm||(Hm={}));const jm=(e,t,o)=>{if(o)return{icons:[Ya],aggService:e,selected:!0};const n=e.isVirtual,i=n?[co(e)]:t?uo(t):[Cl],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:Bi(t?.conditions||[]);return{icons:i,status:a,isVirtual:n,aggService:e,selected:!0}},Wm=e=>!(!e||e.serviceName!==qc||e.id.namespace||e.id.name||e.id.kind),Km=new Tr,Ym={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},qm=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},Jm={id:{namespace:"",name:"",kind:""},serviceName:qc,markedForInstrumentation:{markedForInstrumentation:!0}},Zm=p(null),Qm=()=>{const e=h(Zm);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},eg=({serviceMap:e,children:o})=>{const a=b(),{sourcesApi:s}=kl(),{items:c}=s.useSources(),[d,u,p]=pr([]),[h,m,g]=hr([]),[f,v]=r(0),y=l(()=>v(e=>e+1),[]),[C,S]=r(""),[w,x]=r(null),[k,T]=r(null),$=l(e=>T(t=>t===e?null:e),[]),I=l(()=>T(null),[]),E=l((e,t)=>{const o=new Set(e);u(e=>e.map(e=>e.type===Gm.MapItem&&o.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[u]);n(()=>{let t=!1;const o=(e=>{const t=new Map,o=new Set,n=(e,o,n=!1)=>{let i=t.get(e);return i||(i={serviceName:o,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:o,value:n}of t)o in e||(e[o]=n)};for(const t of e){const{graphKey:e}=qm(t.nodeId),a=n(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=qm(e?.nodeId??"");e.isVirtual&&(o.add(t),i(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||n(i,a.targetServiceName,o.has(i));const l=[];for(const[e,{serviceName:o,isVirtual:n,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:o,isVirtual:n,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),n=(({sources:e,aggregatedServiceMap:t})=>{const o=[],n={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=Wm(t);o.push({id:i.graphKey,type:Gm.MapItem,position:n,data:jm(i,t,a),measured:{width:80,height:80}})}else o.push({id:Gm.NoData,type:Gm.NoData,position:n,data:{subTitle:Qe.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return o})({aggregatedServiceMap:o,sources:[Jm].concat(c)});if(1===n.length&&n[0].id===Gm.NoData)return u(n),m([]),S(""),void y();const i=(({theme:e,nodes:t,aggregatedServiceMap:o})=>{const n=[],i=new Map(t.map(e=>[e.id,e]));for(const t of o){const o=t.graphKey,a=i.get(o);if(!a)continue;const l=a.data?.status===Le.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&n.push({id:`${o}-to-${r}`,type:"smoothstep",source:o,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:ur.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return n})({theme:a,nodes:n,aggregatedServiceMap:o});m(i);const l=n.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,o={})=>{const n={id:"root",layoutOptions:{...Ym,...o},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===qc?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await Km.layout(n),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(n,i).then(({nodes:e})=>{t||(u(e),S(l),y())}),()=>{t=!0};u(e=>{const t=new Map(e.map(e=>[e.id,e]));return n.map(e=>{const o=t.get(e.id);return o?e.type===Gm.MapItem&&o.type===Gm.MapItem?{...e,position:o.position,data:{...e.data,selected:o.data.selected}}:{...e,position:o.position}:e})})},[a,e,c,C]);const N=i(()=>w||k?h.map(e=>{if(e.source===w||e.target===w||e.source===k||e.target===k)return{...e,type:Hm.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,w,k]),A=i(()=>({nodes:d,edges:N,onNodesChange:p,onEdgesChange:g,setNodesSelected:E,fitViewTrigger:f,hoveredNodeId:w,setHoveredNodeId:x,activeNodeId:k,toggleActiveNode:$,resetActiveNode:I}),[d,N,p,g,E,f,w,k,$,I]);return t(Zm.Provider,{value:A,children:o})},tg=f.div`
1393
+ `,rb=f(({id:e,data:o})=>t(lb,{"data-id":e,children:t(Re,{...o})}));var sb,cb;rb.displayName=rb.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(sb||(sb={})),(e=>{e.AnimatedTraffic="animated-traffic"})(cb||(cb={}));const db=(e,t,o)=>{if(o)return{icons:[sl],aggService:e,selected:!0};const n=e.isVirtual,i=n?[go(e)]:t?fo(t):[Dl],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:Wi(t?.conditions||[]);return{icons:i,status:a,isVirtual:n,aggService:e,selected:!0}},pb=e=>!(!e||e.serviceName!==Wp||e.id.namespace||e.id.name||e.id.kind),ub=new Br,hb={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},mb=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},gb={id:{namespace:"",name:"",kind:""},serviceName:Wp,markedForInstrumentation:{markedForInstrumentation:!0}},fb=h(null),bb=()=>{const e=m(fb);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},vb=({serviceMap:e,children:o})=>{const n=v(),{sourcesApi:l}=Ll(),{items:c}=l.useSources(),[d,p,u]=Ir([]),[h,m,g]=Nr([]),[f,b]=s(0),y=r(()=>b(e=>e+1),[]),[C,S]=s(""),[x,w]=s(null),[T,k]=s(null),E=r(e=>k(t=>t===e?null:e),[]),I=r(()=>k(null),[]),N=r((e,t)=>{const o=new Set(e);p(e=>e.map(e=>e.type===sb.MapItem&&o.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[p]);i(()=>{let t=!1;const o=(e=>{const t=new Map,o=new Set,n=(e,o,n=!1)=>{let i=t.get(e);return i||(i={serviceName:o,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:o,value:n}of t)o in e||(e[o]=n)};for(const t of e){const{graphKey:e}=mb(t.nodeId),a=n(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=mb(e?.nodeId??"");e.isVirtual&&(o.add(t),i(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||n(i,a.targetServiceName,o.has(i));const l=[];for(const[e,{serviceName:o,isVirtual:n,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:o,isVirtual:n,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),i=(({sources:e,aggregatedServiceMap:t})=>{const o=[],n={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=pb(t);o.push({id:i.graphKey,type:sb.MapItem,position:n,data:db(i,t,a),measured:{width:80,height:80}})}else o.push({id:sb.NoData,type:sb.NoData,position:n,data:{subTitle:et.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return o})({aggregatedServiceMap:o,sources:[gb].concat(c)});if(1===i.length&&i[0].id===sb.NoData)return p(i),m([]),S(""),void y();const a=(({theme:e,nodes:t,aggregatedServiceMap:o})=>{const n=[],i=new Map(t.map(e=>[e.id,e]));for(const t of o){const o=t.graphKey,a=i.get(o);if(!a)continue;const l=a.data?.status===Fe.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&n.push({id:`${o}-to-${r}`,type:"smoothstep",source:o,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:Er.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return n})({theme:n,nodes:i,aggregatedServiceMap:o});m(a);const l=i.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,o={})=>{const n={id:"root",layoutOptions:{...hb,...o},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===Wp?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await ub.layout(n),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(i,a).then(({nodes:e})=>{t||(p(e),S(l),y())}),()=>{t=!0};p(e=>{const t=new Map(e.map(e=>[e.id,e]));return i.map(e=>{const o=t.get(e.id);return o?e.type===sb.MapItem&&o.type===sb.MapItem?{...e,position:o.position,data:{...e.data,selected:o.data.selected}}:{...e,position:o.position}:e})})},[n,e,c,C]);const $=a(()=>x||T?h.map(e=>{if(e.source===x||e.target===x||e.source===T||e.target===T)return{...e,type:cb.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,x,T]),O=a(()=>({nodes:d,edges:$,onNodesChange:u,onEdgesChange:g,setNodesSelected:N,fitViewTrigger:f,hoveredNodeId:x,setHoveredNodeId:w,activeNodeId:T,toggleActiveNode:E,resetActiveNode:I}),[d,$,u,g,N,f,x,T,E,I]);return t(fb.Provider,{value:O,children:o})},yb=b.div`
954
1394
  border: 1px ${({theme:e,$isSelected:t,$isVirtual:o})=>t?`solid ${e.v2.colors.blue[300]}`:o?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
955
1395
  border-radius: 8px;
956
1396
  cursor: pointer;
957
1397
  opacity: ${({$isVirtual:e})=>e?.8:1};
958
- `,og=f.div`
1398
+ `,Cb=b.div`
959
1399
  position: relative;
960
- `,ng=f.div`
1400
+ `,Sb=b.div`
961
1401
  position: absolute;
962
1402
  top: 100%;
963
1403
  left: 50%;
@@ -966,7 +1406,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
966
1406
  align-items: center;
967
1407
  gap: 4px;
968
1408
  margin-top: 4px;
969
- `,ig=g(({id:n,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=b(),{activeNodeId:d,hoveredNodeId:u}=Qm(),{isUserSource:p,isNodeSelected:h,isHovered:m}=i(()=>({isUserSource:n===qc,isNodeSelected:d===n,isHovered:u===n}),[n,d,u,n]),{isSelected:g,isHighlighted:f}=i(()=>({isSelected:h||p,isHighlighted:h||m||p}),[h,m,p]),v=r?_i(r,c):null;return e(o,{children:[t(mr,{type:"source",position:gr.Right,style:{visibility:"hidden"}}),t(mr,{type:"target",position:gr.Left,style:{visibility:"hidden"}}),e(og,{"data-id":n,children:[t(tg,{$isSelected:g,$isVirtual:s,children:t(po,{padding:12,icons:l,status:f?Le.Info:r})}),e(ng,{children:[v&&t(v,{}),t(de,{size:pe.XXS,nowrap:!0,children:n})]})]})]})});ig.displayName=ig.name;const ag=f.div`
1409
+ `,xb=f(({id:n,data:i})=>{const{icons:l,status:r,isVirtual:s}=i,c=v(),{activeNodeId:d,hoveredNodeId:p}=bb(),{isUserSource:u,isNodeSelected:h,isHovered:m}=a(()=>({isUserSource:n===Wp,isNodeSelected:d===n,isHovered:p===n}),[n,d,p,n]),{isSelected:g,isHighlighted:f}=a(()=>({isSelected:h||u,isHighlighted:h||m||u}),[h,m,u]),b=r?ji(r,c):null;return e(o,{children:[t($r,{type:"source",position:Or.Right,style:{visibility:"hidden"}}),t($r,{type:"target",position:Or.Left,style:{visibility:"hidden"}}),e(Cb,{"data-id":n,children:[t(yb,{$isSelected:g,$isVirtual:s,children:t(bo,{padding:12,icons:l,status:f?Fe.Info:r})}),e(Sb,{children:[b&&t(b,{}),t(pe,{size:he.XXS,nowrap:!0,children:n})]})]})]})});xb.displayName=xb.name;const wb=b.div`
970
1410
  display: flex;
971
1411
  flex-direction: column;
972
1412
  gap: 12px;
@@ -979,10 +1419,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
979
1419
  top: 16px;
980
1420
  left: 8px;
981
1421
  z-index: ${({theme:e})=>e.v2.zIndex.drawer};
982
- `,lg=({children:e})=>t(ag,{children:e});var rg,sg;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(rg||(rg={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(sg||(sg={}));const cg=f.div`
1422
+ `,Tb=({children:e})=>t(wb,{children:e});var kb,Eb;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(kb||(kb={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(Eb||(Eb={}));const Ib=b.div`
983
1423
  flex: 1 1 auto;
984
1424
  min-height: 0;
985
- `,dg=()=>{const{nodes:o,activeNodeId:n,resetActiveNode:a}=Qm(),[l,s]=r(rg.All),c=i(()=>{const e=new Map;for(const t of o)t.type===Gm.MapItem&&e.set(t.id,t);return e},[o]),d=i(()=>c.get(n??""),[c,n]),{inbound:u,outbound:p}=i(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:sg.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const o of t.data.aggService?.connections??[])o.targetGraphKey===d.id&&e.push({peerId:t.id,direction:sg.Inbound,totalRequests:o.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[rg.All,rg.Inbound].includes(l)&&u.length>0,m=[rg.All,rg.Outbound].includes(l)&&p.length>0;return e(lg,{children:[e(he,{$width:"100%",$gap:8,children:[t(me,{variant:fe.Text,size:ge.S,leftIcon:Sl,onClick:a}),t(po,{icons:d.data.icons}),t(de,{size:pe.XS,children:d.id})]}),t(be,{fullWidth:!0,options:[{label:`${rg.All}`,value:rg.All,badge:{label:`${u.length+p.length}`}},{label:`${rg.Inbound}`,value:rg.Inbound,badge:{label:`${u.length}`}},{label:`${rg.Outbound}`,value:rg.Outbound,badge:{label:`${p.length}`}}],selected:l,setSelected:s}),h&&t(pg,{halfHeight:m,title:"Inbound",icon:Wa,connections:u,mapNodesById:c}),m&&t(pg,{halfHeight:h,title:"Outbound",icon:Ka,connections:p,mapNodesById:c})]})},ug=f.div`
1425
+ `,Nb=()=>{const{nodes:o,activeNodeId:n,resetActiveNode:i}=bb(),[l,r]=s(kb.All),c=a(()=>{const e=new Map;for(const t of o)t.type===sb.MapItem&&e.set(t.id,t);return e},[o]),d=a(()=>c.get(n??""),[c,n]),{inbound:p,outbound:u}=a(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:Eb.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const o of t.data.aggService?.connections??[])o.targetGraphKey===d.id&&e.push({peerId:t.id,direction:Eb.Inbound,totalRequests:o.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[kb.All,kb.Inbound].includes(l)&&p.length>0,m=[kb.All,kb.Outbound].includes(l)&&u.length>0;return e(Tb,{children:[e(me,{$width:"100%",$gap:8,children:[t(ge,{variant:be.Text,size:fe.S,leftIcon:Ja,onClick:i}),t(bo,{icons:d.data.icons}),t(pe,{size:he.XS,children:d.id})]}),t(ve,{fullWidth:!0,options:[{label:`${kb.All}`,value:kb.All,badge:{label:`${p.length+u.length}`}},{label:`${kb.Inbound}`,value:kb.Inbound,badge:{label:`${p.length}`}},{label:`${kb.Outbound}`,value:kb.Outbound,badge:{label:`${u.length}`}}],selected:l,setSelected:r}),h&&t(Ob,{halfHeight:m,title:"Inbound",icon:ll,connections:p,mapNodesById:c}),m&&t(Ob,{halfHeight:h,title:"Outbound",icon:rl,connections:u,mapNodesById:c})]})},$b=b.div`
986
1426
  display: flex;
987
1427
  flex-direction: column;
988
1428
  gap: 8px;
@@ -990,17 +1430,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
990
1430
  border-radius: 12px;
991
1431
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
992
1432
  height: ${({$halfHeight:e})=>e?"48%":"100%"};
993
- `,pg=({halfHeight:o,title:n,icon:i,connections:a,mapNodesById:l})=>{const r=b();return e(ug,{$halfHeight:o,children:[e(he,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(de,{size:pe.XXS,color:ue.Secondary,children:n})]}),t(cg,{children:t(lo,{gap:4,elements:a.map(e=>t(mg,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},hg=f.div`
1433
+ `,Ob=({halfHeight:o,title:n,icon:i,connections:a,mapNodesById:l})=>{const r=v();return e($b,{$halfHeight:o,children:[e(me,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(pe,{size:he.XXS,color:ue.Secondary,children:n})]}),t(Ib,{children:t(uo,{gap:4,elements:a.map(e=>t(Rb,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},Ab=b.div`
994
1434
  display: flex;
995
1435
  align-items: center;
996
1436
  gap: 8px;
997
1437
  padding: 8px;
998
1438
  border-radius: 8px;
999
1439
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1000
- `,mg=({connection:o,peerNode:n})=>e(hg,{children:[n&&t(po,{icons:n.data.icons}),e(he,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(de,{size:pe.XXS,children:o.peerId}),t(Ye,{label:o.totalRequests,tooltip:"Total requests"})]})]}),gg="0;0.5;1",fg=g(({id:n,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const u=b(),[p]=fr({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${n}__animated-traffic-motion`,m=u.v2.colors.blue[700],g=u.v2.colors.blue[900],f=u.v2.colors.blue[500],v="4s";return e(o,{children:[t(br,{id:n,path:p,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(vr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:p,fill:"none",stroke:"none"}),Array.from({length:5}).map((o,n)=>{const i=`-${(.8*n).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:v,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:v,begin:i,repeatCount:"indefinite",keyTimes:gg,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:v,begin:i,repeatCount:"indefinite",keyTimes:gg,values:`${g};${f};${f}`})]},n)})]})})]})});fg.displayName=fg.name;const bg=f.div`
1440
+ `,Rb=({connection:o,peerNode:n})=>e(Ab,{children:[n&&t(bo,{icons:n.data.icons}),e(me,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(pe,{size:he.XXS,children:o.peerId}),t(qe,{label:o.totalRequests,tooltip:"Total requests"})]})]}),Db="0;0.5;1",_b=f(({id:n,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const p=v(),[u]=Ar({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${n}__animated-traffic-motion`,m=p.v2.colors.blue[700],g=p.v2.colors.blue[900],f=p.v2.colors.blue[500],b="4s";return e(o,{children:[t(Rr,{id:n,path:u,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(Dr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:u,fill:"none",stroke:"none"}),Array.from({length:5}).map((o,n)=>{const i=`-${(.8*n).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:b,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Db,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:b,begin:i,repeatCount:"indefinite",keyTimes:Db,values:`${g};${f};${f}`})]},n)})]})})]})});_b.displayName=_b.name;const Pb=b.div`
1001
1441
  flex: 1 1 auto;
1002
1442
  min-height: 0;
1003
- `,vg=({})=>{const{nodes:o,setNodesSelected:n,resetActiveNode:a}=Qm(),[s,c]=r(""),d=i(()=>o.filter(e=>e.type===Gm.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[o]),u=i(()=>d.filter(e=>e.data.selected),[d]),p=i(()=>d.filter(e=>e.id.toLowerCase().includes(s.toLowerCase())),[d,s]),h=i(()=>p.every(e=>e.data.selected),[p]),m=l(()=>{const e=!h;n(p.map(e=>e.id),e),e||a()},[p,h,n,a]);return d.length?e(lg,{children:[e(he,{$width:"100%",$gap:8,children:[t(de,{size:pe.XS,children:"Services"}),t(Ye,{label:d.length})]}),t(ao,{width:"100%",value:s,onChange:c}),e(he,{$width:"100%",$justifyContent:"space-between",children:[t(de,{size:pe.XXXS,children:`Showing ${u.length} out of ${d.length}`}),t(de,{"data-id":"namespaces-select-all",onClick:m,disabled:!p.length,size:pe.XS,children:h?Qe.UNSELECT_ALL:Qe.SELECT_ALL})]}),t(bg,{children:t(lo,{gap:4,elements:p.map(e=>t(Cg,{node:e},e.id))})})]}):null},yg=f.div`
1443
+ `,Lb=({})=>{const{nodes:o,setNodesSelected:n,resetActiveNode:i}=bb(),[l,c]=s(""),d=a(()=>o.filter(e=>e.type===sb.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[o]),p=a(()=>d.filter(e=>e.data.selected),[d]),u=a(()=>d.filter(e=>e.id.toLowerCase().includes(l.toLowerCase())),[d,l]),h=a(()=>u.every(e=>e.data.selected),[u]),m=r(()=>{const e=!h;n(u.map(e=>e.id),e),e||i()},[u,h,n,i]);return d.length?e(Tb,{children:[e(me,{$width:"100%",$gap:8,children:[t(pe,{size:he.XS,children:"Services"}),t(qe,{label:d.length})]}),t(po,{width:"100%",value:l,onChange:c}),e(me,{$width:"100%",$justifyContent:"space-between",children:[t(pe,{size:he.XXXS,children:`Showing ${p.length} out of ${d.length}`}),t(pe,{"data-id":"namespaces-select-all",onClick:m,disabled:!u.length,size:he.XS,children:h?et.UNSELECT_ALL:et.SELECT_ALL})]}),t(Pb,{children:t(uo,{gap:4,elements:u.map(e=>t(Mb,{node:e},e.id))})})]}):null},Fb=b.div`
1004
1444
  display: flex;
1005
1445
  align-items: center;
1006
1446
  gap: 8px;
@@ -1008,7 +1448,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
1008
1448
  border-radius: 8px;
1009
1449
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
1010
1450
  cursor: pointer;
1011
- `,Cg=({node:o})=>{const{setNodesSelected:n,activeNodeId:i,resetActiveNode:a}=Qm(),r=l(()=>{const e=!o.data.selected,t=i===o.id;n([o.id],e),!e&&t&&a()},[o,i,n,a]);return e(yg,{onClick:r,children:[t(te,{value:o.data.selected||!1,onChange:r}),t(po,{icons:o.data.icons}),t(de,{size:pe.XXS,children:o.id})]},o.id)},Sg=f.div`
1451
+ `,Mb=({node:o})=>{const{setNodesSelected:n,activeNodeId:i,resetActiveNode:a}=bb(),l=r(()=>{const e=!o.data.selected,t=i===o.id;n([o.id],e),!e&&t&&a()},[o,i,n,a]);return e(Fb,{onClick:l,children:[t(oe,{value:o.data.selected||!1,onChange:l}),t(bo,{icons:o.data.icons}),t(pe,{size:he.XXS,children:o.id})]},o.id)},zb=b.div`
1012
1452
  position: relative;
1013
1453
  height: 100%;
1014
1454
  .react-flow__attribution {
@@ -1017,7 +1457,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
1017
1457
  * {
1018
1458
  transition: none;
1019
1459
  }
1020
- `,wg=f.div`
1460
+ `,Bb=b.div`
1021
1461
  .react-flow__controls {
1022
1462
  display: flex;
1023
1463
  align-items: center;
@@ -1043,33 +1483,33 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
1043
1483
  }
1044
1484
  }
1045
1485
  }
1046
- `,xg={[Gm.MapItem]:ig,[Gm.NoData]:Um},kg={[Hm.AnimatedTraffic]:fg},Tg={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},$g=({trigger:e})=>{const{fitView:t}=kr(),o=a(!0);return n(()=>{o.current?o.current=!1:e>0&&requestAnimationFrame(()=>t(Tg))},[e,t]),null},Ig=({onRefresh:o})=>{const{nodes:n,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=Qm(),u=i(()=>{const e=new Set(n.filter(e=>e.type===Gm.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const o of a)e.has(o.source)&&t.add(o.target),e.has(o.target)&&t.add(o.source);return n.filter(e=>e.type!==Gm.MapItem||e.data.selected||t.has(e.id))},[n,a]);return e(Cr,{zoomOnScroll:!0,nodes:u,nodeTypes:xg,edges:a,edgeTypes:kg,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Sr,{}),t($g,{trigger:l}),t(wg,{children:t(wr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Tg,children:t(xr,{onClick:o,children:t(Ga,{})})})})]})},Eg=o=>t(yr,{children:e(Sg,{children:[t(Ig,{...o}),t(vg,{}),t(dg,{})]})}),Ng=f.div`
1486
+ `,Xb={[sb.MapItem]:xb,[sb.NoData]:rb},Ub={[cb.AnimatedTraffic]:_b},Vb={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},Hb=({trigger:e})=>{const{fitView:t}=zr(),o=l(!0);return i(()=>{o.current?o.current=!1:e>0&&requestAnimationFrame(()=>t(Vb))},[e,t]),null},jb=({onRefresh:o})=>{const{nodes:n,edges:i,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=bb(),p=a(()=>{const e=new Set(n.filter(e=>e.type===sb.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const o of i)e.has(o.source)&&t.add(o.target),e.has(o.target)&&t.add(o.source);return n.filter(e=>e.type!==sb.MapItem||e.data.selected||t.has(e.id))},[n,i]);return e(Pr,{zoomOnScroll:!0,nodes:p,nodeTypes:Xb,edges:i,edgeTypes:Ub,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Lr,{}),t(Hb,{trigger:l}),t(Bb,{children:t(Fr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Vb,children:t(Mr,{onClick:o,children:t(Qa,{})})})})]})},Gb=o=>t(_r,{children:e(zb,{children:[t(jb,{...o}),t(Lb,{}),t(Nb,{})]})}),Wb=b.div`
1047
1487
  width: 100%;
1048
1488
  flex: 1;
1049
1489
  align-self: stretch;
1050
1490
  min-height: 0;
1051
1491
  height: 100%;
1052
1492
  position: relative;
1053
- `,Ag=()=>{const{serviceMapApi:e}=kl(),{data:o,refetch:n}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(eg,{serviceMap:o?.serviceMap??[],children:t(Ng,{children:t(Eg,{onRefresh:n})})})},Og=f.div`
1493
+ `,Kb=()=>{const{serviceMapApi:e}=Ll(),{data:o,refetch:n}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(vb,{serviceMap:o?.serviceMap??[],children:t(Wb,{children:t(Gb,{onRefresh:n})})})},Yb=b.div`
1054
1494
  display: flex;
1055
1495
  align-items: center;
1056
1496
  justify-content: space-between;
1057
1497
  padding: 0 12px;
1058
- `,Rg=f.div`
1498
+ `,qb=b.div`
1059
1499
  display: flex;
1060
1500
  align-items: center;
1061
1501
  gap: 8px;
1062
- `,Dg=f.div`
1502
+ `,Jb=b.div`
1063
1503
  width: 1px;
1064
1504
  height: 20px;
1065
1505
  background-color: ${({theme:e})=>e.v2.colors.silver[500]};
1066
- `,Pg=({disabled:o,loading:n,onClickShowYaml:a,onClickReset:l,onClickRefresh:s})=>{const c=b(),[d,u]=r(!1),p=i(()=>a?[{id:on(),type:io.Button,buttonProps:{label:"Show Config YAML",leftIcon:yl,size:ge.S,variant:fe.Secondary,onClick:a,disabled:o}}]:[],[a,o]),h=i(()=>{const e=[];return s&&e.push({id:on(),type:io.Button,buttonProps:{leftIcon:Ga,tooltip:"Refresh",hideTooltipIcon:!0,size:ge.S,variant:fe.Text,onClick:s,disabled:o,loading:n}}),l&&e.push({id:on(),type:io.Button,buttonProps:{leftIcon:Ca,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:ge.S,variant:fe.Text,textColor:c.v2.colors.red[500],onClick:()=>u(!0),disabled:o}}),e},[o,n,l,s,c]),m=p.length>0,g=h.length>0;return e(Og,{children:[t(qi,{icon:Ba,title:"Odigos Settings"}),e(Rg,{children:[m&&t(Ji,{actions:p}),m&&g&&t(Dg,{}),g&&t(Ji,{actions:h})]}),t(Ze,{isOpen:d,onClose:()=>u(!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:fe.Secondary,onClick:()=>u(!1)},approveButton:{label:"Approve",variant:fe.Primary,onClick:()=>{l?.(),u(!1)}}})]})},Fg=f(Q)`
1506
+ `,Zb=({disabled:o,loading:n,onClickShowYaml:i,onClickReset:l,onClickRefresh:r})=>{const c=v(),[d,p]=s(!1),u=a(()=>i?[{id:cn(),type:co.Button,buttonProps:{label:"Show Config YAML",leftIcon:Rl,size:fe.S,variant:be.Secondary,onClick:i,disabled:o}}]:[],[i,o]),h=a(()=>{const e=[];return r&&e.push({id:cn(),type:co.Button,buttonProps:{leftIcon:Qa,tooltip:"Refresh",hideTooltipIcon:!0,size:fe.S,variant:be.Text,onClick:r,disabled:o,loading:n}}),l&&e.push({id:cn(),type:co.Button,buttonProps:{leftIcon:Ia,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:fe.S,variant:be.Text,textColor:c.v2.colors.red[500],onClick:()=>p(!0),disabled:o}}),e},[o,n,l,r,c]),m=u.length>0,g=h.length>0;return e(Yb,{children:[t(na,{icon:el,title:"Odigos Settings"}),e(qb,{children:[m&&t(ia,{actions:u}),m&&g&&t(Jb,{}),g&&t(ia,{actions:h})]}),t(Qe,{isOpen:d,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:be.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:be.Primary,onClick:()=>{l?.(),p(!1)}}})]})},Qb=b(ee)`
1067
1507
  width: 220px;
1068
1508
  flex-shrink: 0;
1069
1509
  height: 100%;
1070
1510
  gap: 4px;
1071
1511
  overflow-y: auto;
1072
- `,Lg=({options:e,selected:o,setSelected:n,disabled:i})=>t(Fg,{children:e.map(e=>t(Ys,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:o===e.id,disabled:i,onClick:()=>n(e.id)},e.id))}),Mg=f(Q)`
1512
+ `,ev=({options:e,selected:o,setSelected:n,disabled:i})=>t(Qb,{children:e.map(e=>t(dc,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:o===e.id,disabled:i,onClick:()=>n(e.id)},e.id))}),tv=b(ee)`
1073
1513
  width: 100%;
1074
1514
  /* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
1075
1515
  max-width: 844px;
@@ -1079,25 +1519,25 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
1079
1519
  gap: 24px;
1080
1520
  flex: 1;
1081
1521
  min-height: 0;
1082
- `,_g=f(he)`
1522
+ `,ov=b(me)`
1083
1523
  flex: 1;
1084
1524
  min-height: 0;
1085
1525
  width: 100%;
1086
1526
  align-self: stretch;
1087
- `,zg=f(Q)`
1527
+ `,nv=b(ee)`
1088
1528
  flex: 1;
1089
1529
  min-height: 0;
1090
1530
  height: 100%;
1091
1531
  max-width: 600px;
1092
1532
  overflow-y: auto;
1093
- `,Bg=f(he)`
1533
+ `,iv=b(me)`
1094
1534
  gap: 8px;
1095
1535
  width: 100%;
1096
1536
  align-items: center;
1097
- `,Xg=f.div`
1537
+ `,av=b.div`
1098
1538
  flex: 1;
1099
1539
  min-width: 0;
1100
- `,Vg=e=>"general"===e.name?0:"advanced"===e.name?2:1,Ug=({minSupportedVersion:a})=>{const{isVersionSupported:l,version:s,isEnterprise:c,minSupportedVersion:d}=C(a),{configApi:u}=kl(),{data:p,loading:h}=u.useConfigYamls(),{data:m,loading:g,refetch:f}=u.useEffectiveConfig(),b=p?.configYamls??[],[v,y]=r(!1),S=i(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...o}=m;return o},[m]),{formData:w,handleFormChange:x,getNestedValue:k,getFormDiff:T,isFormDirty:$}=zt(S);n(()=>{"{}"!==JSON.stringify(S)&&"{}"===JSON.stringify(w)&&x(void 0,void 0,S)},[S,w]);const I=i(()=>[...b].sort((e,t)=>Vg(e)-Vg(t)),[b]),E=i(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(m?.provenance),[m?.provenance]),N=i(()=>{const e=new Set;for(const t of b)for(const o of t.fields)o.componentType===Te.Dropdown&&e.add(o.helmValuePath);return e},[b]),A=i(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:k("formData",e.helmValuePath)}))),[b,w,k]),[O,R]=r(!1),[D,P]=r(!1),F=i(()=>[{id:on(),type:io.Button,buttonProps:{"data-id":"settings-save",variant:fe.Primary,size:ge.S,label:"Save Changes",leftIcon:Fa,loading:v,onClick:()=>R(!0)}},{id:on(),type:io.Button,buttonProps:{"data-id":"settings-cancel",variant:fe.Secondary,size:ge.S,label:"Cancel",leftIcon:La,onClick:()=>x(void 0,void 0,S)}}],[v,T,S,w,x]),L=i(()=>I.map(e=>({id:e.name,label:e.displayName})),[I]),M=i(()=>I.map(e=>e.name),[I]),{selectedSection:_,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=ya({sectionNames:M});return t(Ei,{$gap:24,children:e(Mg,{children:[t(Pg,{disabled:!l,loading:h||g,onClickShowYaml:()=>P(!0),onClickReset:async()=>{await(async()=>{u.resetLocalUiConfigToDefaults&&await u.resetLocalUiConfigToDefaults()})(),await(f?.()),x(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(na,{children:[!l&&t(cr,{minSupportedVersion:d,currentVersion:s||""}),t(Io,{isOpen:$,richTitle:{icon:Ba,title:"Config Settings"},actions:F}),t(Ze,{isOpen:O,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:()=>R(!1),denyButton:{label:"Keep editing",variant:fe.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:fe.Primary,onClick:()=>{(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 i=n;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&o(n,t,i.replaceAll("-","_"))}return n})(T(S,w),N);await(async e=>{u.updateLocalUiConfig&&(y(!0),await u.updateLocalUiConfig(e),y(!1),await f())})(e),x(void 0,void 0,{})})(),R(!1)}}}),e(_g,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(Lg,{options:L,selected:_,setSelected:z,disabled:!l}),t(zg,{ref:X,$gap:24,$width:"100%",children:b.length?I.map(n=>t(ct,{id:n.name,bordered:!0,ref:e=>B(n.name,e),customTitle:t(de,{size:pe.M,weight:500,color:ue.Primary,children:n.displayName}),children:t(Q,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!c)return null;if(n.renderCondition&&!$e(n.renderCondition,[],A))return null;const i=Ie(n.componentProps||"{}",{}),a=E[n.helmValuePath],l=n.componentType===Te.Toggle,r=t(de,{size:pe.XS,weight:500,color:ue.Primary,children:n.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Le.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Le.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Le.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(Ye,{...s}):null,u=n.description?t(de,{size:pe.XXS,color:ue.Secondary,children:n.description}):null,p=e(Q,{$gap:4,children:[e(he,{$gap:8,$alignItems:"center",children:[r,d]}),u]}),h=t(Gl,{componentType:n.componentType,inputType:i.type,name:n.helmValuePath,disabled:n.isHelmOnly||v,value:k("formData",n.helmValuePath),setValue:e=>x(n.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:It.S},n.helmValuePath),m=n.isHelmOnly?t(Ee,{text:"This field can only be updated via the Helm values.yaml file",children:t(wl,{})}):null;return t(Q,{$gap:8,children:l?e(he,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[p,e(he,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(o,{children:[p,e(Bg,{children:[t(Xg,{children:h}),m]})]})},n.helmValuePath)})})},n.name)):h?t(gt,{$height:"30vh",children:t(Ct,{withSpinner:!0})}):t(ct,{richTitle:{icon:Ba,title:"Config Settings"},children:t(Oe,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(se,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:yl,title:"Effective Config YAML",onClose:()=>P(!1)},children:g&&!m?.manifestYAML?t(gt,{$height:"30vh",children:t(Ct,{withSpinner:!0})}):t(lr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},Gg=f.div`
1540
+ `,lv=e=>"general"===e.name?0:"advanced"===e.name?2:1,rv=({minSupportedVersion:n})=>{const{isVersionSupported:l,version:r,isEnterprise:c,minSupportedVersion:d}=S(n),{configApi:p}=Ll(),{data:u,loading:h}=p.useConfigYamls(),{data:m,loading:g,refetch:f}=p.useEffectiveConfig(),b=u?.configYamls??[],[v,y]=s(!1),C=a(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...o}=m;return o},[m]),{formData:x,handleFormChange:w,getNestedValue:T,getFormDiff:k,isFormDirty:E}=Ht(C);i(()=>{"{}"!==JSON.stringify(C)&&"{}"===JSON.stringify(x)&&w(void 0,void 0,C)},[C,x]);const I=a(()=>[...b].sort((e,t)=>lv(e)-lv(t)),[b]),N=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(m?.provenance),[m?.provenance]),$=a(()=>{const e=new Set;for(const t of b)for(const o of t.fields)o.componentType===Ee.Dropdown&&e.add(o.helmValuePath);return e},[b]),O=a(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:T("formData",e.helmValuePath)}))),[b,x,T]),[A,R]=s(!1),[D,_]=s(!1),P=a(()=>[{id:cn(),type:co.Button,buttonProps:{"data-id":"settings-save",variant:be.Primary,size:fe.S,label:"Save Changes",leftIcon:Ua,loading:v,onClick:()=>R(!0)}},{id:cn(),type:co.Button,buttonProps:{"data-id":"settings-cancel",variant:be.Secondary,size:fe.S,label:"Cancel",leftIcon:Va,onClick:()=>w(void 0,void 0,C)}}],[v,k,C,x,w]),L=a(()=>I.map(e=>({id:e.name,label:e.displayName})),[I]),F=a(()=>I.map(e=>e.name),[I]),{selectedSection:M,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=Ea({sectionNames:F});return t(Pi,{$gap:24,children:e(tv,{children:[t(Zb,{disabled:!l,loading:h||g,onClickShowYaml:()=>_(!0),onClickReset:async()=>{await(async()=>{p.resetLocalUiConfigToDefaults&&await p.resetLocalUiConfigToDefaults()})(),await(f?.()),w(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(da,{children:[!l&&t(Tr,{minSupportedVersion:d,currentVersion:r||""}),t(Do,{isOpen:E,richTitle:{icon:el,title:"Config Settings"},actions:P}),t(Qe,{isOpen:A,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:()=>R(!1),denyButton:{label:"Keep editing",variant:be.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:be.Primary,onClick:()=>{(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 i=n;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&o(n,t,i.replaceAll("-","_"))}return n})(k(C,x),$);await(async e=>{p.updateLocalUiConfig&&(y(!0),await p.updateLocalUiConfig(e),y(!1),await f())})(e),w(void 0,void 0,{})})(),R(!1)}}}),e(ov,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(ev,{options:L,selected:M,setSelected:z,disabled:!l}),t(nv,{ref:X,$gap:24,$width:"100%",children:b.length?I.map(n=>t(dt,{id:n.name,bordered:!0,ref:e=>B(n.name,e),customTitle:t(pe,{size:he.M,weight:500,color:ue.Primary,children:n.displayName}),children:t(ee,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!c)return null;if(n.renderCondition&&!Ie(n.renderCondition,[],O))return null;const i=Ne(n.componentProps||"{}",{}),a=N[n.helmValuePath],l=n.componentType===Ee.Toggle,r=t(pe,{size:he.XS,weight:500,color:ue.Primary,children:n.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Fe.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Fe.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Fe.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(qe,{...s}):null,p=n.description?t(pe,{size:he.XXS,color:ue.Secondary,children:n.description}):null,u=e(ee,{$gap:4,children:[e(me,{$gap:8,$alignItems:"center",children:[r,d]}),p]}),h=t(ir,{componentType:n.componentType,inputType:i.type,name:n.helmValuePath,disabled:n.isHelmOnly||v,value:T("formData",n.helmValuePath),setValue:e=>w(n.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:Nt.S},n.helmValuePath),m=n.isHelmOnly?t($e,{text:"This field can only be updated via the Helm values.yaml file",children:t(_l,{})}):null;return t(ee,{$gap:8,children:l?e(me,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[u,e(me,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(o,{children:[u,e(iv,{children:[t(av,{children:h}),m]})]})},n.helmValuePath)})})},n.name)):h?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(dt,{richTitle:{icon:el,title:"Config Settings"},children:t(Re,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(ce,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:Rl,title:"Effective Config YAML",onClose:()=>_(!1)},children:g&&!m?.manifestYAML?t(ft,{$height:"30vh",children:t(St,{withSpinner:!0})}):t(Sr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},sv=b.div`
1101
1541
  position: fixed;
1102
1542
  bottom: 12px;
1103
1543
  left: 12px;
@@ -1106,4 +1546,4 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
1106
1546
  flex-direction: column-reverse;
1107
1547
  gap: 6px;
1108
1548
  max-width: 600px;
1109
- `,Hg=()=>{const{notifications:e,markAsDismissed:o,markAsSeen:n}=Gt(),i=e.filter(({dismissed:e})=>!e);return t(Gg,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(Fe,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{o(e),t&&n(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{qs as AddActionDrawer,xs as AddActionForm,tp as AddDataStreamModal,lc as AddDestinationDrawer,$s as AddDestinationForm,rc as AddRuleDrawer,Ps as AddRuleForm,Sc as AddSourceDrawer,ih as CentralConnections,Ls as DataStreamForm,Fs as DataStreamMergeWarning,xc as EditActionDrawer,kc as EditConfigDrawer,op as EditDataStreamModal,$c as EditDestinationDrawer,Ec as EditRuleDrawer,Du as EditSourceDrawer,Ms as EditSourceForm,vh as Onboarding,ap as OnboardingDone,Sm as Overview,Pm as PipelineCollectors,Kr as RegexTesterDrawer,Qp as SamplingOnboardingModal,Hu as SamplingRuleDrawer,Us as SamplingRuleForm,Xm as SamplingRules,Ag as ServiceMap,Ug as Settings,ep as SystemDrawer,Dm as TABS,Hg as ToastList};
1549
+ `,cv=()=>{const{notifications:e,markAsDismissed:o,markAsSeen:n}=Yt(),i=e.filter(({dismissed:e})=>!e);return t(sv,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(Le,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{o(e),t&&n(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{pc as AddActionDrawer,Ms as AddActionForm,mm as AddDataStreamModal,Sc as AddDestinationDrawer,Xs as AddDestinationForm,xc as AddRuleDrawer,Ys as AddRuleForm,Lc as AddSourceDrawer,Sg as CentralConnections,gp as CloudConnectorStep,vp as CreateCloudConnectorDrawer,mg as CreateNewType,Js as DataStreamForm,qs as DataStreamMergeWarning,Cp as EditActionDrawer,Sp as EditConfigDrawer,gm as EditDataStreamModal,wp as EditDestinationDrawer,kp as EditRuleDrawer,Gh as EditSourceDrawer,Zs as EditSourceForm,Pg as Onboarding,vm as OnboardingDone,zf as Overview,Zf as PipelineCollectors,cs as RegexTesterDrawer,ug as SamplingOnboardingModal,im as SamplingRuleDrawer,ic as SamplingRuleForm,ab as SamplingRules,Kb as ServiceMap,rv as Settings,hm as SystemDrawer,Jf as TABS,cv as ToastList};