@odigos/ui-kit 0.0.243 → 0.0.245

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 (45) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/lib/chunks/{helpers-DlRedD4d.js → helpers-D-CznSVG.js} +1 -1
  3. package/lib/chunks/{index-Cl1o9W_f.js → index-CA2MiIDy.js} +15 -15
  4. package/lib/chunks/source-instrument-form-context-C002ZZ9a.js +1 -0
  5. package/lib/chunks/ui-components-CFTFbtTq.js +1614 -0
  6. package/lib/components/_v2/input-table/dynamic-field/index.d.ts +1 -0
  7. package/lib/components/_v2/input-table/types.d.ts +2 -1
  8. package/lib/components/_v2/note/index.d.ts +6 -0
  9. package/lib/components/_v2/typography/index.d.ts +8 -0
  10. package/lib/components/_v2/typography-truncatable/index.d.ts +18 -10
  11. package/lib/components/v2.js +1 -1
  12. package/lib/components.js +1 -1
  13. package/lib/constants/actions/index.d.ts +0 -2
  14. package/lib/constants/index.d.ts +1 -0
  15. package/lib/constants/regex.d.ts +40 -0
  16. package/lib/constants.js +1 -1
  17. package/lib/containers/_v2/_drawers/index.d.ts +1 -0
  18. package/lib/containers/_v2/_drawers/regex-tester-drawer/highlighter.d.ts +20 -0
  19. package/lib/containers/_v2/_drawers/regex-tester-drawer/index.d.ts +13 -0
  20. package/lib/containers/_v2/_forms/add-action-form/custom-fields/extract-attribute/index.d.ts +5 -0
  21. package/lib/containers/index.d.ts +0 -1
  22. package/lib/containers/v2.js +237 -126
  23. package/lib/containers.js +7 -62
  24. package/lib/contexts.js +1 -1
  25. package/lib/functions/get-action-icon/index.d.ts +2 -2
  26. package/lib/functions.js +1 -1
  27. package/lib/hooks/index.d.ts +1 -0
  28. package/lib/hooks/useOverflow.d.ts +26 -0
  29. package/lib/hooks.js +1 -1
  30. package/lib/snippets/v2.js +1 -1
  31. package/lib/snippets.js +6 -6
  32. package/lib/store.js +1 -1
  33. package/lib/theme.js +1 -1
  34. package/lib/types/actions/index.d.ts +16 -21
  35. package/lib/types.js +1 -1
  36. package/lib/visuals.js +1 -1
  37. package/package.json +1 -1
  38. package/lib/chunks/source-instrument-form-context-0FWO95UV.js +0 -1
  39. package/lib/chunks/ui-components-D8ipj0yK.js +0 -1570
  40. package/lib/containers/_v2/_forms/add-action-form/custom-fields/error-sampler/index.d.ts +0 -5
  41. package/lib/containers/_v2/_forms/add-action-form/custom-fields/latency-sampler/index.d.ts +0 -5
  42. package/lib/containers/_v2/_forms/add-action-form/custom-fields/probabilistic-sampler/index.d.ts +0 -5
  43. package/lib/containers/_v2/_forms/add-action-form/custom-fields/service-name-sampler/index.d.ts +0 -5
  44. package/lib/containers/_v2/_forms/add-action-form/custom-fields/span-attribute-sampler/index.d.ts +0 -5
  45. package/lib/containers/notification-manager/index.d.ts +0 -4
@@ -1,4 +1,120 @@
1
- import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,Fragment as a,forwardRef as i,useState as l,useImperativeHandle as s,useMemo as r,useCallback as c,useRef as d,Children as u,createContext as p,useContext as h,useLayoutEffect as m}from"react";import g,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as k,S as T,f as $,e as N,a as I,r as E,h as O,i as A,j as D,k as R,l as F,m as P,o as L,p as _,q as M,s as B,t as z}from"../chunks/helpers-DlRedD4d.js";import{y as X,F as V,$ as U,a0 as H,a1 as j,a2 as W,a3 as G,G as K,a4 as Y,a5 as J,a6 as q,a7 as Z,a8 as Q,p as ee,h as te,a9 as oe,aa as ne,ab as ae,R as ie,z as le,N as se,b as re,c as ce,ac as de,ad as ue,ae as pe,af as he,ag as me,S as ge,M as fe,Q as be,L as ve,ah as ye,ai as Ce,aj as Se,ak as we,V as xe,al as ke,X as Te,Y as $e,W as Ne,Z as Ie,am as Ee,an as Oe,ao as Ae,ap as De,D as Re,H as Fe,aq as Pe,ar as Le,as as _e,at as Me,au as Be,av as ze,aw as Xe,ax as Ve,ay as Ue,az as He,i as je,A as We,x as Ge,aA as Ke,K as Ye,aB as Je,aC as qe,aD as Ze,aE as Qe,aF as et,aG as tt,w as ot,O as nt,q as at,U as it,E as lt,aH as st,T as rt,aI as ct,aJ as dt,aK as ut,aL as pt,aM as ht,aN as mt,aO as gt,o as ft,aP as bt,aQ as vt,aR as yt,aS as Ct,aT as St,v as wt,aU as xt,aV as kt,aW as Tt,aX as $t,d as Nt,B as It,aY as Et,aZ as Ot,f as At,a_ as Dt,a$ as Rt,b0 as Ft,b1 as Pt,b2 as Lt,b3 as _t,b4 as Mt,b5 as Bt,b6 as zt,b7 as Xt,b8 as Vt,b9 as Ut,ba as Ht,bb as jt,bc as Wt,l as Gt,m as Kt,bd as Yt,be as Jt,bf as qt,bg as Zt,bh as Qt,bi as eo,bj as to,bk as oo,bl as no,bm as ao,_ as io,bn as lo,bo as so,bp as ro,bq as co,br as uo,bs as po,bt as ho,bu as mo,bv as go,bw as fo,bx as bo,by as vo,bz as yo,bA as Co,bB as So,bC as wo,bD as xo,bE as ko,bF as To,bG as $o,bH as No,bI as Io,bJ as Eo,bK as Oo,bL as Ao,bM as Do,bN as Ro,bO as Fo,bP as Po,bQ as Lo,bR as _o,bS as Mo,bT as Bo,bU as zo,bV as Xo,bW as Vo,bX as Uo,bY as Ho,bZ as jo,b_ as Wo,b$ as Go,c0 as Ko,c1 as Yo,c2 as Jo,c3 as qo,c4 as Zo,c5 as Qo,c6 as en,c7 as tn,c8 as on,c9 as nn,ca as an,cb as ln,cc as sn,cd as rn,ce as cn,cf as dn,cg as un,ch as pn,ci as hn,cj as mn,ck as gn,cl as fn,cm as bn,cn as vn,co as yn,cp as Cn,cq as Sn,cr as wn,cs as xn,ct as kn,cu as Tn,cv as $n,cw as Nn,cx as In,cy as En,cz as On,cA as An,cB as Dn,cC as Rn,cD as Fn,cE as Pn,cF as Ln,cG as _n,cH as Mn,cI as Bn,cJ as zn,cK as Xn,cL as Vn,cM as Un,cN as Hn,cO as jn,cP as Wn,cQ as Gn,cR as Kn,cS as Yn,cT as Jn,cU as qn,cV as Zn,cW as Qn,cX as ea,cY as ta,cZ as oa,c_ as na,c$ as aa,d0 as ia,d1 as la,d2 as sa,d3 as ra,d4 as ca,d5 as da,d6 as ua,d7 as pa,d8 as ha,d9 as ma,da as ga,db as fa,dc as ba,dd as va,de as ya,df as Ca,dg as Sa,j as wa,dh as xa,n as ka,di as Ta,dj as $a,dk as Na,dl as Ia,dm as Ea,dn as Oa,dp as Aa,dq as Da,dr as Ra,ds as Fa,dt as Pa,du as La,dv as _a,dw as Ma,dx as Ba,dy as za,dz as Xa,dA as Va,dB as Ua,dC as Ha,dD as ja,dE as Wa,dF as Ga,dG as Ka,dH as Ya,dI as Ja,dJ as qa,dK as Za,dL as Qa,dM as ei,dN as ti,dO as oi,dP as ni}from"../chunks/ui-components-D8ipj0yK.js";import{TrashIcon as ai,PlusIcon as ii,BookIcon as li,VSquareIcon as si,XSquareIcon as ri,DeleteIcon as ci,EditIcon as di,GoLogo as ui,JavaLogo as pi,ChevronRightIcon as hi,ActionIcon as mi,DestinationIcon as gi,ChevronUpIcon as fi,ChevronDownIcon as bi,VIcon as vi,XIcon as yi,InstrumentationRuleIcon as Ci,SourceIcon as Si,NamespacesIcon as wi,SettingsIcon as xi,PodIcon as ki,OdigosLogo as Ti,K8sLogo as $i,RefreshIcon as Ni,ExclamationCircleIcon as Ii,QuestionCircleIcon as Ei,InboundIcon as Oi,OutboundIcon as Ai,UserIcon as Di,ExpandIcon as Ri,SearchIcon as Fi,MinusIcon as Pi,CopyIcon as Li,DotIcon as _i,DownloadIcon as Mi,RefreshLeftArrowIcon as Bi,SamplingIcon as zi,ExclamationTriangleIcon as Xi,KeyIcon as Vi,DiagnoseIcon as Ui,TerminalIcon as Hi,ArrowRightIcon as ji,StarIcon as Wi,ArrowIcon as Gi,ConnectionsIcon as Ki,FilterIcon as Yi,DataStreamIcon as Ji,PipelineCollectorIcon as qi,ArrowDownSquareIcon as Zi,ArrowUpSquareIcon as Qi,GatewayIcon as el,YamlIcon as tl}from"../icons.js";import{S as ol,D as nl,A as al,P as il,a as ll,b as sl,R as rl,c as cl,O as dl,d as ul,e as pl,f as hl,W as ml,g as gl,C as fl,Y as bl,h as vl,i as yl,U as Cl}from"../chunks/index-Cl1o9W_f.js";import{u as Sl,f as wl,g as xl,e as kl,i as Tl,h as $l,S as Nl,k as Il,E as El,l as Ol,m as Al,j as Dl,b as Rl,d as Fl,a as Pl,A as Ll,R as _l,c as Ml,D as Bl}from"../chunks/source-instrument-form-context-0FWO95UV.js";import{createPortal as zl}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Xl=[{id:"CREDIT_CARD",label:"Credit card"}],Vl=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],Ul=[{id:J.Pod,label:J.Pod},{id:J.Namespace,label:J.Namespace},{id:J.Node,label:J.Node}],Hl=[{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:Ul}],jl=[{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:Ul}],Wl=[{label:"Service",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Service name: The rule applies to a specific service name. Only traces originating from this service’s root span will be considered."},{label:"HTTP route",keyName:"httpRoute",placeholder:"e.g. /api/v1/users",tooltip:"HTTP route: The specific HTTP route prefix to match for sampling. Only traces with routes beginning with this prefix will be considered. For instance, configuring /buy will also match /buy/product."},{label:"Threshold",keyName:"minimumLatencyThreshold",placeholder:"e.g. 1000",tooltip:"Minimum latency threshold (ms): Specifies the minimum latency in milliseconds; traces with latency below this threshold are ignored.",inputType:G.Number,min:0},{label:"Fallback",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Fallback sampling ratio: Specifies the percentage of traces that meet the service/http_route filter but fall below the threshold that you still want to retain. For example, if a rule is set for service A and http_route B with a minimum latency threshold of 1 second, you might still want to keep some traces below this threshold. Setting the ratio to 20% ensures that 20% of these traces will be retained.",inputType:G.Number,min:0,max:100}],Gl=X.UrlTemplatizationRulesGroups,Kl=[{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"}],Yl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (Across all available spans)."},{label:"Sampling ratio",keyName:"samplingRatio",placeholder:"e.g. 10",tooltip:"Specifies the sample rate for all traces.",inputType:G.Number,min:0,max:100},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:G.Number,min:0,max:100}],Jl=[{label:"Service name",keyName:"serviceName",placeholder:"e.g. my-service",tooltip:"Specifies the service name to search within the trace (across all available spans)."},{label:"Attribute key",keyName:"attributeKey",placeholder:"e.g. http.request.method",tooltip:"Specifies the attribute key inside of the span."},{label:"Fallback sampling ratio",keyName:"fallbackSamplingRatio",placeholder:"e.g. 100",tooltip:"Specifies the percentage of traces that don’t meet the service name filter and that you still like to retain.",inputType:G.Number,min:0,max:100},{label:"Condition",keyName:"condition",tooltip:"An object representing the filters for span attributes filters.",componentType:ie.Dropdown,options:[{id:"stringCondition",label:"String condition"},{id:"numberCondition",label:"Number condition"},{id:"booleanCondition",label:"Boolean condition"},{id:"jsonCondition",label:"JSON condition"}]},{label:"Operation",keyName:"operation",tooltip:"Specifies the operation to run against the attribute.",componentType:ie.Dropdown,options:[{id:"exists",label:"Exists"},{id:"equals",label:"Equals"},{id:"not_equals",label:"Not equals"},{id:"contains",label:"Contains"},{id:"not_contains",label:"Not contains"},{id:"regex",label:"Regex"},{id:"greater_than",label:"Greater than"},{id:"less_than",label:"Less than"},{id:"greater_than_or_equal",label:"Greater than or equal"},{id:"less_than_or_equal",label:"Less than or equal"},{id:"is_valid_json",label:"Is valid JSON"},{id:"is_invalid_json",label:"Is invalid JSON"},{id:"jsonpath_exists",label:"JSON path exists"},{id:"key_equals",label:"Key equals"},{id:"key_not_equals",label:"Key not equals"}]},{label:"Expected value",keyName:"expectedValue",placeholder:"e.g. GET",tooltip:"The values to test the attribute against."},{label:"JSON path",keyName:"jsonPath",placeholder:"e.g. $.user.role",tooltip:"An expression used to navigate the JSON structure.",renderCondition:e=>"jsonCondition"===e.condition}],ql={[le.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Vl.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(j,{errorMessage:l[o]})]},o))}),t(Y,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Hl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(Y,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:jl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[le.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(q,{label:"Overwrite existing values",labelAlign:Z.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(Y,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[le.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(Q,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[le.RenameAttributes]:({value:e,setValue:o,formErrors:n})=>t(Y,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key"},{keyName:"newKey",label:"New key"}],values:Object.entries(e[X.Renames]||{}).map(([e,t])=>({oldKey:e,newKey:t})),setValues:e=>{const t={};e.forEach(e=>t[e.oldKey]=e.newKey),o(X.Renames,t)},errorMessage:n[X.Renames]}),[le.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Xl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Xl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(j,{errorMessage:i[X.PiiCategories]})]})),[le.ErrorSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.FallbackSamplingRatio],i=K(e[X.FallbackSamplingRatio])?"":String(e[X.FallbackSamplingRatio]);return t(W,{name:"fallbackSamplingRatio",label:"Fallback sampling ratio",type:G.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,o(X.FallbackSamplingRatio,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[le.ProbabilisticSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.SamplingPercentage],i=K(e[X.SamplingPercentage])?"":String(e[X.SamplingPercentage]);return t(W,{name:"samplingPercentage",label:"Sampling percentage",type:G.Number,min:0,max:100,value:i,placeholder:"0-100",onChange:e=>{return t=e.target.value,o(X.SamplingPercentage,Math.max(0,Math.min(Number(t),100))||0);var t},errorMessage:a})},[le.LatencySampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.EndpointsFilters],i=e[X.EndpointsFilters]||[];return t(Y,{name:"endpointsFilters",limitFieldsPerRow:2,columns:Wl,values:i,setValues:e=>{o(X.EndpointsFilters,e.map(({serviceName:e,httpRoute:t,minimumLatencyThreshold:o,fallbackSamplingRatio:n})=>({serviceName:e,httpRoute:t,minimumLatencyThreshold:Number(o),fallbackSamplingRatio:Number(n)})))},errorMessage:a})},[le.ServiceNameSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.ServicesNameFilters],i=e[X.ServicesNameFilters]||[];return t(Y,{name:"servicesNameFilters",limitFieldsPerRow:2,columns:Yl,values:i,setValues:e=>{o(X.ServicesNameFilters,e.map(({serviceName:e,samplingRatio:t,fallbackSamplingRatio:o})=>({serviceName:e,samplingRatio:Number(t),fallbackSamplingRatio:Number(o)})))},errorMessage:a})},[le.SpanAttributeSampler]:({value:e,setValue:o,formErrors:n})=>{const a=n[X.AttributeFilters],i=(e[X.AttributeFilters]||[]).map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n})=>{const a=Object.entries(n).filter(([e,t])=>t)[0][0];return{serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:a,operation:n[a]?.operation,expectedValue:n[a]?.expectedValue,jsonPath:n[a]?.jsonPath}});return t(Y,{name:"attributeFilters",limitFieldsPerRow:2,columns:Jl,values:i,setValues:e=>{o(X.AttributeFilters,e.map(({serviceName:e,attributeKey:t,fallbackSamplingRatio:o,condition:n,operation:a,expectedValue:i,jsonPath:l})=>{const s={serviceName:e,attributeKey:t,fallbackSamplingRatio:Number(o),condition:{[n]:{operation:a,expectedValue:i}}};return l&&(s.condition[n].jsonPath=l),s}))},errorMessage:a})},[le.URLTemplatization]:({value:n,setValue:i,formErrors:l})=>{const s=f(),r=n[Gl]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(Gl,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(a,{children:[t(ee,{}),e(V,{$gap:12,children:[e(te,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(oe,{leftIcon:()=>t(ai,{fill:s.v2.colors.red[500]}),variant:ae.Secondary,size:ne.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(W,{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(Y,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:Kl,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(Q,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(j,{errorMessage:l[Gl]})]},`url-templatization-group-${n}`)),t(oe,{variant:ae.Secondary,label:"Add rule group",leftIcon:ii,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ee,{})]})}},Zl=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=ql[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Ql=()=>{const o=f(),{selectedOption:n,genericForm:a}=Sl();if(!a||!n)return t(se,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(re,{size:ce.XXS,children:n.docsDescription}),t(oe,{label:"Docs",leftIcon:li,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),t(ue,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ri,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ol,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:s.signals}),t(W,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:s.name}),t(Zl,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:s}),t(pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},es=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:s,type:r,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(!(!o||he(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(nl,{componentType:s,inputType:r,name:f,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>i(f,e)},f)}),ts=g(te)`
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as a,useRef as i,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as g}from"react";import m,{useTheme as f,css as b,keyframes as v}from"styled-components";import{u as y,n as C,C as S,d as w,b as x,c as k,S as T,f as $,e as E,a as I,r as N,h as A,i as O,j as D,k as R,l as P,m as F,o as L,p as _,q as z,s as M,t as B}from"../chunks/helpers-D-CznSVG.js";import{q as X,R as V,U,V as H,W as j,X as G,Y as W,Z as K,_ as Y,$ as J,f as q,a0 as Z,b as Q,a1 as ee,c as te,F as oe,a2 as ne,a3 as ae,a4 as ie,a5 as le,a6 as re,a7 as se,a8 as ce,a9 as de,aa as ue,ab as pe,i as he,r as ge,ac as me,ad as fe,ae as be,af as ve,ag as ye,ah as Ce,n as Se,S as we,B as xe,G as ke,z as Te,ai as $e,aj as Ee,ak as Ie,J as Ne,al as Ae,L as Oe,M as De,K as Re,O as Pe,am as Fe,an as Le,ao as _e,ap as ze,D as Me,w as Be,aq as Xe,ar as Ve,as as Ue,at as He,au as je,av as Ge,aw as We,ax as Ke,ay as Ye,az as Je,aA as qe,A as Ze,aB as Qe,y as et,aC as tt,aD as ot,aE as nt,aF as at,aG as it,aH as lt,p as rt,C as st,j as ct,I as dt,E as ut,aI as pt,T as ht,aJ as gt,aK as mt,aL as ft,aM as bt,aN as vt,aO as yt,aP as Ct,aQ as St,aR as wt,aS as xt,aT as kt,aU as Tt,o as $t,aV as Et,H as It,aW as Nt,aX as At,aY as Ot,l as Dt,v as Rt,aZ as Pt,a_ as Ft,a$ as Lt,b0 as _t,b1 as zt,b2 as Mt,b3 as Bt,b4 as Xt,b5 as Vt,b6 as Ut,b7 as Ht,b8 as jt,b9 as Gt,ba as Wt,bb as Kt,bc as Yt,bd as Jt,be as qt,g as Zt,d as Qt,bf as eo,bg as to,bh as oo,bi as no,bj as ao,bk as io,bl as lo,bm as ro,bn as so,bo as co,Q as uo,bp as po,bq as ho,br as go,bs as mo,bt as fo,bu as bo,bv as vo,bw as yo,bx as Co,by as So,bz as wo,bA as xo,bB as ko,bC as To,bD as $o,bE as Eo,bF as Io,bG as No,bH as Ao,bI as Oo,bJ as Do,bK as Ro,bL as Po,bM as Fo,bN as Lo,bO as _o,bP as zo,bQ as Mo,bR as Bo,bS as Xo,bT as Vo,bU as Uo,bV as Ho,bW as jo,bX as Go,bY as Wo,bZ as Ko,b_ as Yo,b$ as Jo,c0 as qo,c1 as Zo,c2 as Qo,c3 as en,c4 as tn,c5 as on,c6 as nn,c7 as an,c8 as ln,c9 as rn,ca as sn,cb as cn,cc as dn,cd as un,ce as pn,cf as hn,cg as gn,ch as mn,ci as fn,cj as bn,ck as vn,cl as yn,cm as Cn,cn as Sn,co as wn,cp as xn,cq as kn,cr as Tn,cs as $n,ct as En,cu as In,cv as Nn,cw as An,cx as On,cy as Dn,cz as Rn,cA as Pn,cB as Fn,cC as Ln,cD as _n,cE as zn,cF as Mn,cG as Bn,cH as Xn,cI as Vn,cJ as Un,cK as Hn,cL as jn,cM as Gn,cN as Wn,cO as Kn,cP as Yn,cQ as Jn,cR as qn,cS as Zn,cT as Qn,cU as ea,cV as ta,cW as oa,cX as na,cY as aa,cZ as ia,c_ as la,c$ as ra,d0 as sa,d1 as ca,d2 as da,d3 as ua,d4 as pa,d5 as ha,d6 as ga,d7 as ma,d8 as fa,d9 as ba,da as va,db as ya,dc as Ca,dd as Sa,de as wa,df as xa,dg as ka,dh as Ta,e as $a,di as Ea,dj as Ia,dk as Na,dl as Aa,dm as Oa,dn as Da,dp as Ra,dq as Pa,dr as Fa,ds as La,dt as _a,du as za,dv as Ma,dw as Ba,dx as Xa,dy as Va,dz as Ua,dA as Ha,dB as ja,dC as Ga,dD as Wa,dE as Ka,dF as Ya,dG as Ja,dH as qa,dI as Za,dJ as Qa,dK as ei,dL as ti,dM as oi,dN as ni,dO as ai}from"../chunks/ui-components-CFTFbtTq.js";import{TrashIcon as ii,PlusIcon as li,ArrowRightIcon as ri,VSquareIcon as si,XSquareIcon as ci,BookIcon as di,DeleteIcon as ui,EditIcon as pi,GoLogo as hi,JavaLogo as gi,ChevronRightIcon as mi,ActionIcon as fi,DestinationIcon as bi,ChevronUpIcon as vi,ChevronDownIcon as yi,VIcon as Ci,XIcon as Si,InstrumentationRuleIcon as wi,SourceIcon as xi,NamespacesIcon as ki,SettingsIcon as Ti,PodIcon as $i,OdigosLogo as Ei,K8sLogo as Ii,RefreshIcon as Ni,ExclamationCircleIcon as Ai,QuestionCircleIcon as Oi,InboundIcon as Di,OutboundIcon as Ri,UserIcon as Pi,ExpandIcon as Fi,SearchIcon as Li,MinusIcon as _i,CopyIcon as zi,DotIcon as Mi,DownloadIcon as Bi,RefreshLeftArrowIcon as Xi,SamplingIcon as Vi,ExclamationTriangleIcon as Ui,KeyIcon as Hi,DiagnoseIcon as ji,TerminalIcon as Gi,StarIcon as Wi,ArrowIcon as Ki,ConnectionsIcon as Yi,FilterIcon as Ji,DataStreamIcon as qi,PipelineCollectorIcon as Zi,ArrowDownSquareIcon as Qi,ArrowUpSquareIcon as el,GatewayIcon as tl,YamlIcon as ol}from"../icons.js";import{S as nl,D as al,A as il,P as ll,a as rl,b as sl,R as cl,c as dl,O as ul,d as pl,e as hl,f as gl,W as ml,g as fl,C as bl,Y as vl,h as yl,i as Cl,U as Sl}from"../chunks/index-CA2MiIDy.js";import{u as wl,f as xl,g as kl,e as Tl,i as $l,h as El,S as Il,k as Nl,E as Al,l as Ol,m as Dl,j as Rl,b as Pl,d as Fl,a as Ll,A as _l,R as zl,c as Ml,D as Bl}from"../chunks/source-instrument-form-context-C002ZZ9a.js";import{createPortal as Xl}from"react-dom";import"zustand";import"javascript-time-ago";import"../chunks/vendor-Be0cOokr.js";import"prism-react-renderer";import"react-error-boundary";import"virtua";const Vl=[{id:"CREDIT_CARD",label:"Credit card"}],Ul=[{id:X.CollectContainerAttributes,label:"Collect container attributes"},{id:X.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:X.CollectWorkloadId,label:"Collect workload ID"},{id:X.CollectClusterId,label:"Collect cluster ID"}],Hl=[{id:W.Pod,label:W.Pod},{id:W.Namespace,label:W.Namespace},{id:W.Node,label:W.Node}],jl=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Hl}],Gl=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Hl}],Wl=/^[a-zA-Z]$/,Kl=new Set(["*","+","?"]),Yl=new Set(["^","$"]),Jl={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},ql=m.div`
2
+ padding: 8px 16px;
3
+ border-radius: 6px;
4
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
5
+ background: ${({theme:e})=>e.v2.colors.black[500]};
6
+ font-family: ${({theme:e})=>e.font_family.code};
7
+ font-size: 12px;
8
+ line-height: 20px;
9
+ color: ${({theme:e})=>e.v2.colors.white[500]};
10
+ word-break: break-all;
11
+ white-space: pre-wrap;
12
+ user-select: text;
13
+
14
+ /* Wraps the background tightly to each visual fragment when a colored
15
+ token gets split across two visual lines. Without this the highlight
16
+ stretches all the way to the right edge of the container. */
17
+ & > span {
18
+ box-decoration-break: clone;
19
+ -webkit-box-decoration-break: clone;
20
+ }
21
+ `,Zl=m.span`
22
+ background: ${({$kind:e})=>Jl[e]};
23
+ `,Ql=({pattern:e,"data-id":o})=>{const n=a(()=>(e=>{const t=[];let o=0,n=!1;const a=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){a("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){a(e.slice(o,o+2),"class-content"),o+=2;continue}a(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}a(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Kl.has(t)||Yl.has(t))a(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){a(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];Wl.test(t)?a(e.slice(o,o+2),"anchor-quantifier"):a(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(a(t,"literal"),o++):(a("|","alternation"),o++)}else"^"===e[o+1]?(a("[^","class-bracket"),o+=2):(a("[","class-bracket"),o++),n=!0;else a(t,"group"),o++}}return t})(e),[e]);return t(ql,e?{"data-id":o,children:n.map((e,o)=>t(Zl,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},er="rgba(102, 191, 255, 0.5)",tr=b`
24
+ font-family: ${({theme:e})=>e.font_family.code};
25
+ font-size: 12px;
26
+ line-height: 20px;
27
+ letter-spacing: 0;
28
+ white-space: pre-wrap;
29
+ word-wrap: break-word;
30
+ overflow-wrap: break-word;
31
+ /* tab-size keeps tabs visually consistent across the two layers — some
32
+ browsers default to 8 on a textarea but 4 on a div. */
33
+ -moz-tab-size: 4;
34
+ tab-size: 4;
35
+ margin: 0;
36
+ `,or=m.div`
37
+ position: relative;
38
+ width: 100%;
39
+ min-height: ${({$minHeight:e})=>e}px;
40
+ border-radius: 6px;
41
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
42
+ background: ${({theme:e})=>e.v2.colors.black[500]};
43
+
44
+ &:hover,
45
+ &:focus-within {
46
+ border-color: ${({theme:e})=>e.v2.colors.silver[300]};
47
+ }
48
+ `,nr=m.div`
49
+ ${tr}
50
+ position: absolute;
51
+ inset: 0;
52
+ padding: 12px;
53
+ pointer-events: none;
54
+ color: transparent;
55
+ overflow: hidden;
56
+
57
+ /* Mandatory for backgrounds that wrap across visual lines. */
58
+ & > span {
59
+ box-decoration-break: clone;
60
+ -webkit-box-decoration-break: clone;
61
+ }
62
+ `,ar=m.textarea`
63
+ ${tr}
64
+ position: relative;
65
+ z-index: 1;
66
+ display: block;
67
+ width: 100%;
68
+ min-height: ${({$minHeight:e})=>e}px;
69
+ padding: 12px;
70
+ border: 0;
71
+ background: transparent;
72
+ outline: none;
73
+ resize: vertical;
74
+ color: ${({theme:e})=>e.v2.colors.white[500]};
75
+ caret-color: ${({theme:e})=>e.v2.colors.white[500]};
76
+ box-sizing: border-box;
77
+
78
+ &::placeholder {
79
+ color: ${({theme:e})=>e.v2.colors.silver[600]};
80
+ }
81
+ `,ir=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),lr=({regex:o,value:n,onChange:r,minHeight:s=240,...c})=>{const d=i(null),u=i(null),p=a(()=>((e,t)=>{if(!e||!t)return ir(t);let o;try{o=new RegExp(e)}catch{return ir(t)}const n=o.exec(t);if(!n)return ir(t);const a=n.index,i=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,a),matchPre:"",capture:t.slice(a,i),matchPost:"",after:t.slice(i)};const l=n[0].indexOf(n[1]),r=l>=0?a+l:a,s=r+n[1].length;return{before:t.slice(0,a),matchPre:t.slice(a,r),capture:t.slice(r,s),matchPost:t.slice(s,i),after:t.slice(i)}})(o,n),[o,n]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(or,{$minHeight:s,children:[e(nr,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:er},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:er},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(ar,{ref:u,$minHeight:s,value:n,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},rr=m.div`
82
+ flex: 1;
83
+ min-height: 0;
84
+ overflow-y: auto;
85
+ `,sr=m.div`
86
+ background: ${({theme:e})=>e.v2.colors.silver[900]};
87
+ border-radius: 8px;
88
+ padding: 8px;
89
+ display: flex;
90
+ flex-direction: column;
91
+ gap: 12px;
92
+ `,cr=m.div`
93
+ padding: 8px 16px;
94
+ border-radius: 8px;
95
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
96
+ font-family: ${({theme:e})=>e.font_family.code};
97
+ font-size: 12px;
98
+ line-height: 20px;
99
+ color: ${({theme:e,$tone:t})=>"error"===t?e.v2.colors.red[500]:"match"===t?e.v2.colors.white[500]:e.v2.colors.silver[200]};
100
+ word-break: break-all;
101
+ white-space: pre-wrap;
102
+ user-select: text;
103
+ `,dr=({isOpen:o,regex:n,onClose:i,initialTestString:l=""})=>{const[s,c]=r(l),d=a(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:Z.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:Z.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:Z.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:Z.RESULT_NO_MATCH}})(n,s),[n,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(q,{isOpen:o,header:{title:Z.TITLE,onClose:()=>{c(""),i()}},children:t(rr,{children:e(sr,{children:[e(V,{$gap:6,children:[t(U,{label:Z.REGEX_LABEL}),t(Ql,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(Q,{size:te.XXS,color:ee.Secondary,children:Z.REGEX_EMPTY_HINT})]}),e(V,{$gap:6,children:[e(oe,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:Z.TEST_STRING_LABEL}),t(ne,{"data-id":"regex-tester-unescape",label:Z.UNESCAPE_LABEL,tooltip:Z.UNESCAPE_TOOLTIP,variant:ie.Secondary,size:ae.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],a="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=a){t+=a,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=s,!/\\["'\\nrt]/.test(p))})]}),t(lr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:Z.TEST_STRING_PLACEHOLDER,regex:n,value:s,onChange:c,minHeight:240}),t(j,{helpMessage:Z.TEST_STRING_HELP})]}),e(V,{$gap:8,children:[t(U,{label:Z.RESULT_LABEL}),t(cr,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(Q,{size:te.XXS,color:ee.Secondary,children:Z.RESULT_CAPTURE_HINT})]})]})})});var p},ur=X.Extractions;var pr;!function(e){e.Preset="preset",e.Regex="regex"}(pr||(pr={}));const hr=[se.JSON,se.SQL,se.ResourcePath],gr=(e=se.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),mr=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,fr=m.div`
104
+ width: calc(100% - 16px);
105
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
106
+ border-radius: 8px;
107
+ padding: 8px;
108
+ display: flex;
109
+ flex-direction: column;
110
+ gap: 8px;
111
+ `,br=m.div`
112
+ flex: 1;
113
+ min-width: 0;
114
+ `,vr=m.div`
115
+ /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
116
+ padding-top: 24px;
117
+ `,yr=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),Cr=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},Sr=X.UrlTemplatizationRulesGroups,wr=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],xr={[ge.K8sAttributes]:({value:a,setValue:i,formErrors:l})=>(n(()=>{a[X.CollectContainerAttributes]||a[X.CollectReplicaSetAttributes]||a[X.CollectWorkloadId]||a[X.CollectClusterId]||a[X.LabelsAttributes]?.length||a[X.AnnotationsAttributes]?.length||(i(X.CollectContainerAttributes,!0),i(X.CollectReplicaSetAttributes,!0),i(X.CollectWorkloadId,!0),i(X.CollectClusterId,!0),i(X.LabelsAttributes,[]),i(X.AnnotationsAttributes,[]))},[]),e(o,{children:[t(V,{$gap:6,children:Ul.map(({id:o,label:n})=>e(V,{children:[t(H,{label:n,value:a[o]||!1,onChange:e=>i(o,e)}),t(j,{errorMessage:l[o]})]},o))}),t(G,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:jl,values:a[X.LabelsAttributes]||[],setValues:e=>i(X.LabelsAttributes,e),errorMessage:l[X.LabelsAttributes]}),t(G,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Gl,values:a[X.AnnotationsAttributes]||[],setValues:e=>i(X.AnnotationsAttributes,e),errorMessage:l[X.AnnotationsAttributes]})]})),[ge.AddClusterInfo]:({value:n,setValue:a,formErrors:i})=>{const l=f();return e(o,{children:[t(K,{label:"Overwrite existing values",labelAlign:Y.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[X.OverwriteExistingValues]||!1,onChange:e=>a(X.OverwriteExistingValues,e)}),t(G,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[X.ClusterAttributes]||[],setValues:e=>a(X.ClusterAttributes,e),errorMessage:i[X.ClusterAttributes]})]})},[ge.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(J,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[X.AttributeNamesToDelete]||[],setValues:e=>o(X.AttributeNamesToDelete,e),errorMessage:n[X.AttributeNamesToDelete]}),[ge.RenameAttributes]:({value:e,setValue:o,formErrors:a})=>{const i=e[X.Renames],[l,s]=r(()=>yr(i));return n(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(Cr(l),i||{})||s(yr(i))},[i]),t(G,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),o(X.Renames,Cr(t))},errorMessage:a[X.Renames]})},[ge.PiiMasking]:({value:o,setValue:a,formErrors:i})=>(n(()=>{o[X.PiiCategories]?.length||a(X.PiiCategories,Vl.map(({id:e})=>e))},[]),e(V,{$gap:12,children:[t(U,{label:"Attributes to mask"}),t(V,{$gap:6,children:Vl.map(({id:e,label:n})=>t(H,{label:n,value:o[X.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[X.PiiCategories]||[],i=t?[...n,e]:n.filter(t=>t!==e);a(X.PiiCategories,i)}},e))}),t(j,{errorMessage:i[X.PiiCategories]})]})),[ge.URLTemplatization]:({value:n,setValue:a,formErrors:i})=>{const l=f(),r=n[Sr]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>a(Sr,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(s,{children:[t(he,{}),e(V,{$gap:12,children:[e(oe,{$justifyContent:"space-between",$alignItems:"center",children:[t(U,{label:`Rule Group ${n+1}`}),t(ne,{leftIcon:()=>t(ii,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(pe,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(G,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:wr,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(J,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(j,{errorMessage:i[Sr]})]},`url-templatization-group-${n}`)),t(ne,{variant:ie.Secondary,label:"Add rule group",leftIcon:li,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(he,{})]})},[ge.ExtractAttribute]:({value:o,setValue:a,formErrors:i})=>{const l=f(),s=i[ur],c=o[ur]||[],[d,u]=r(()=>(e=>e.length&&e.some(mr)?pr.Regex:pr.Preset)(c)),[p,h]=r(null);n(()=>{0===c.length&&a(ur,[d===pr.Preset?gr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{a(ur,c.map((o,n)=>n===e?{...o,...t}:o))},m=()=>{a(ur,[...c,d===pr.Preset?gr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},b=d===pr.Preset,v=c.length?c:[b?gr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],y=null!=p&&v[p]?.regex||"";return e(V,{$gap:16,$width:"100%",children:[t(le,{options:[{value:pr.Preset,label:re.SEGMENT_PRESET_LABEL,tooltip:re.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:pr.Regex,label:re.SEGMENT_REGEX_LABEL,tooltip:re.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),a(ur,[e===pr.Preset?gr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(V,{$gap:8,$width:"100%",children:[v.map((o,n)=>{const i=n===v.length-1,r=o.dataFormat||se.JSON,s=de[r];return e(fr,{"data-id":`extract-row-${n}`,children:[e(oe,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(V,{$gap:10,children:[t(U,{label:b?re.PRESET_ROW_TITLE(n):re.REGEX_ROW_TITLE(n)}),b&&t(oe,{$gap:24,children:hr.map(e=>t(ce,{"data-id":`extract-row-${n}-fmt-${e}`,size:ue.L,label:de[e].label,value:r===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(oe,{$gap:4,$alignItems:"center",children:[!b&&t(ne,{"data-id":`extract-row-${n}-test-regex`,label:re.TEST_REGEX_LABEL,variant:ie.Secondary,size:ae.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(ne,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(ii,{fill:l.v2.colors.red[500]}),variant:ie.Secondary,size:ae.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);a(ur,t.length?t:[d===pr.Preset?gr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(ne,{"data-id":`extract-row-${n}-add`,leftIcon:li,variant:ie.Secondary,size:ae.S,onClick:m})]})]}),b?e(oe,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(br,{children:t(pe,{name:`extract-row-${n}-lookupKey`,label:s.keyLabel,placeholder:s.placeholder,helpMessage:s.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(vr,{children:t(ri,{size:24,fill:l.v2.colors.silver[200]})}),t(br,{children:t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(V,{$gap:12,$width:"100%",children:[t(pe,{name:`extract-row-${n}-regex`,label:re.REGEX_LABEL,placeholder:re.REGEX_PLACEHOLDER,helpMessage:re.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(pe,{name:`extract-row-${n}-targetAttributeName`,label:re.TARGET_LABEL,placeholder:re.TARGET_PLACEHOLDER,helpMessage:re.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(j,{errorMessage:s})]}),t(dr,{isOpen:null!=p,regex:y,onClose:()=>h(null)})]})}},kr=({actionType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=xr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Tr=()=>{const o=f(),{selectedOption:n,genericForm:a}=wl();if(!a||!n)return t(me,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ne,{leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),t(nl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:i.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(pe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:i.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(kr,{actionType:n.type,value:i.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},$r=({signals:e,fields:o,disabled:n,formData:a,handleFormChange:i,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:g,options:m})=>{if(!(!o||Ce(o,e,a.fields)))return null;const f=c,b=a.fields.find(e=>e.key===f),v=b?b.value:h;return t(al,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:g,placeholder:p,errorMessage:l[f],dropdownOptions:m,value:v||"",setValue:e=>i(f,e)},f)}),Er=m(oe)`
2
118
  position: sticky;
3
119
  bottom: 4px;
4
120
  align-self: center;
@@ -9,17 +125,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
9
125
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
10
126
  box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
11
127
  z-index: 1;
12
- `,os=i(({testConnection:o,isEdit:a},i)=>{const r=f(),{isVm:c}=y(),{activeForm:d,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:b}=wl(),[v,C]=l(h?.testResult),[S,w]=l(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!d?.option.testConnectionSupported||!u||c)return;const e=await o(ye(u.formData));return C(e),e};return s(i,()=>({testConnection:x,testConnectionSupported:!!d?.option.testConnectionSupported}),[d?.option.testConnectionSupported,u,o]),u&&d?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(te,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(me,{status:ge.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(me,{status:ge.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),t(oe,{"data-id":"dest-form-docs",label:"Docs",leftIcon:li,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}/backends/${d.option.type}`,"_blank","noopener noreferrer")})]}),!c&&t(ue,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:r.v2.colors.green[800]},{icon:ri,label:"Disabled",value:!0,selectedBgColor:r.v2.colors.red[800]}],selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(ol,{title:"This connection will monitor:",allowedSignals:ve(d.option.supportedSignals),selectedSignals:be(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(fe.Logs),metrics:e.includes(fe.Metrics),traces:e.includes(fe.Traces),profiles:e.includes(fe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(W,{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(es,{signals:be(u.formData.exportedSignals),fields:d.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(ts,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:ci,variant:ae.Secondary,textColor:r.v2.colors.red[500],onClick:()=>b(d.unsavedIdx)})}),!c&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ae.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:di,variant:ae.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ae.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g(d.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(oe,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ae.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(se,{title:"No active form"})});os.displayName="AddDestinationForm";const ns=[{id:Se.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Se.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Se.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],as=[{id:Se.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Se.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Se.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],is=["*"],ls=[{id:ke.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:ke.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:ke.DbQuery,label:"Collect DB query",tooltip:""},{id:ke.Messaging,label:"Collect messaging",tooltip:""}],ss={[Ne.Java]:[new $e("","")],[Ne.Golang]:[new Te("")]},rs={[Ie.CodeAttributes]:({value:a,setValue:i,formErrors:l})=>{const s=l.codeAttributes,c=r(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]);n(()=>{if(!c.length&&!s){const e={[Se.FilePath]:!0,[Se.Function]:!0,[Se.LineNumber]:!0,[Se.Column]:null,[Se.Namespace]:null,[Se.StackTrace]:null};i("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Se).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});i("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:ns.map(({id:e,label:o,tooltip:n})=>t(we,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]}),e(V,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:as.map(({id:e,label:o,tooltip:n})=>t(we,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]})]})},[Ie.CustomInstrumentation]:({value:a,setValue:i,formErrors:l})=>{const s=l.customInstrumentations,c=r(()=>(a?.customInstrumentations?.[Ne.Golang]||[]).map(e=>new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[a]),d=r(()=>(a?.customInstrumentations?.[Ne.Java]||[]).map(e=>new $e(e.className,e.methodName)),[a]);return n(()=>{a?.customInstrumentations||s||i("customInstrumentations",{[Ne.Golang]:ss[Ne.Golang],[Ne.Java]:ss[Ne.Java]})},[]),e(o,{children:[e(V,{children:[e(te,{$gap:8,children:[t(ui,{}),t(U,{label:"Golang custom probes"})]}),t(Y,{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[Ne.Golang]=e.map(e=>new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Ne.Java]=d,i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(te,{$gap:8,children:[t(pi,{}),t(U,{label:"Java custom probes"})]}),t(Y,{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[Ne.Golang]=c,t[Ne.Java]=e.map(e=>new $e(e.className,e.methodName)),i("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ie.HeadersCollection]:({value:e,setValue:o,formErrors:a})=>{const i=a.headersCollection,l=r(()=>e?.headersCollection?.[xe.HeaderKeys]||[],[e]),s=e=>{const t={[xe.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{l.length||i||s(is)},[]),t(Q,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:l,setValues:s,errorMessage:i})},[Ie.PayloadCollection]:({value:o,setValue:a,formErrors:i})=>{const l=i.payloadCollection,s=r(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!l){const e={[ke.HttpRequest]:{},[ke.HttpResponse]:{},[ke.DbQuery]:{},[ke.Messaging]:{}};a("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:ls.map(({id:e,label:o,tooltip:n})=>t(we,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[ke.HttpRequest]:o.includes(ke.HttpRequest)?{}:null,[ke.HttpResponse]:o.includes(ke.HttpResponse)?{}:null,[ke.DbQuery]:o.includes(ke.DbQuery)?{}:null,[ke.Messaging]:o.includes(ke.Messaging)?{}:null};a("payloadCollection",n)})(e,t)})},e))}),t(j,{errorMessage:l})]})},[Ie.UnknownType]:null},cs=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=rs[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},ds=()=>{const o=f(),{selectedOption:n,genericForm:a}=xl();if(!a||!n)return t(se,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:s}=a;return e(V,{$gap:24,children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(re,{size:ce.XXS,children:n.docsDescription}),t(oe,{label:"Docs",leftIcon:li,variant:ae.Text,size:ne.S,onClick:()=>window.open(`${de}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]}),e(te,{$gap:12,children:[t(re,{size:ce.XS,color:Ce.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Ee,{label:Oe[e],leftIcon:Ae(e),status:ge.Default,useSecondaryTone:!0},e))]}),t(ue,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ri,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],selected:i.disabled,setSelected:e=>l("disabled",e)}),t(W,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:i.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:s.ruleName}),t(cs,{ruleType:n.type,value:i,setValue:(e,t)=>l(e,t),formErrors:s}),t(pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:s.notes})]})},us=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=kl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(De,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Re.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ae.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ae.Secondary,onClick:n}})},ps=({autoFocus:o})=>{const{dataStreams:n}=Fe(),{genericForm:a,excludeName:i,editingName:l}=kl(),{formData:s,formErrors:c,handleFormChange:d}=a,u=s.name,p=r(()=>n.find(e=>e.name===u&&e.name!==i),[n,u,i]);return e(V,{$width:"100%",$gap:12,children:[t(W,{name:"data-stream-name",label:Re.STREAM_NAME,placeholder:Re.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Re.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(me,{status:ge.Warning,message:Re.DATA_STREAM_MERGE_WARNING(l,p.name),fullWidth:!0})]})},hs=()=>{const{selectedStreamName:e}=Fe(),{genericForm:o}=Tl();if(!o)return t(se,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(W,{name:"sourceName",label:Re.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},ms=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],gs=g.div`
128
+ `,Ir=c(({testConnection:o,isEdit:a},i)=>{const l=f(),{isVm:s}=y(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:g,updateUnsavedDestination:m,deleteUnsavedDestination:b}=xl(),[v,C]=r(h?.testResult),[S,w]=r(!!h);n(()=>{h?(C(h.testResult),w(!0)):(C(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||s)return;const e=await o($e(u.formData));return C(e),e};return d(i,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,o]),u&&c?e(V,{$gap:24,style:{minHeight:"100%"},children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Se,{status:we.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Se,{status:we.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(oe,{$gap:12,children:[!s&&t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:l.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:l.v2.colors.red[800]}],size:be.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(ne,{"data-id":"dest-form-docs",leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(nl,{title:"This connection will monitor:",allowedSignals:Te(c.option.supportedSignals),selectedSignals:ke(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(xe.Logs),metrics:e.includes(xe.Metrics),traces:e.includes(xe.Traces),profiles:e.includes(xe.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(pe,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t($r,{signals:ke(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!a&&e(Er,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:ui,variant:ie.Secondary,textColor:l.v2.colors.red[500],onClick:()=>b(c.unsavedIdx)})}),!s&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:ie.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:pi,variant:ie.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(ne,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:ie.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g({formData:t,testResult:e},o)}}})})]})]}):t(me,{title:"No active form"})});Ir.displayName="AddDestinationForm";const Nr=[{id:Ee.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ee.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ee.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Ar=[{id:Ee.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ee.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ee.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Or=["*"],Dr=[{id:Ae.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ae.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ae.DbQuery,label:"Collect DB query",tooltip:""},{id:Ae.Messaging,label:"Collect messaging",tooltip:""}],Rr={[Re.Java]:[new De("","")],[Re.Golang]:[new Oe("")]},Pr={[Pe.CodeAttributes]:({value:i,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=a(()=>Object.entries(i.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[i]);n(()=>{if(!c.length&&!s){const e={[Ee.FilePath]:!0,[Ee.Function]:!0,[Ee.LineNumber]:!0,[Ee.Column]:null,[Ee.Namespace]:null,[Ee.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ee).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(V,{$gap:6,children:Nr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]}),e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(V,{$gap:6,children:Ar.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(j,{errorMessage:s})]})]})},[Pe.CustomInstrumentation]:({value:i,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=a(()=>(i?.customInstrumentations?.[Re.Golang]||[]).map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[i]),d=a(()=>(i?.customInstrumentations?.[Re.Java]||[]).map(e=>new De(e.className,e.methodName)),[i]);return n(()=>{i?.customInstrumentations||s||l("customInstrumentations",{[Re.Golang]:Rr[Re.Golang],[Re.Java]:Rr[Re.Java]})},[]),e(o,{children:[e(V,{children:[e(oe,{$gap:8,children:[t(hi,{}),t(U,{label:"Golang custom probes"})]}),t(G,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[Re.Golang]=e.map(e=>new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[Re.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(V,{children:[e(oe,{$gap:8,children:[t(gi,{}),t(U,{label:"Java custom probes"})]}),t(G,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[Re.Golang]=c,t[Re.Java]=e.map(e=>new De(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Pe.HeadersCollection]:({value:e,setValue:o,formErrors:i})=>{const l=i.headersCollection,r=a(()=>e?.headersCollection?.[Ne.HeaderKeys]||[],[e]),s=e=>{const t={[Ne.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{r.length||l||s(Or)},[]),t(J,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[Pe.PayloadCollection]:({value:o,setValue:i,formErrors:l})=>{const r=l.payloadCollection,s=a(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);n(()=>{if(!s.length&&!r){const e={[Ae.HttpRequest]:{},[Ae.HttpResponse]:{},[Ae.DbQuery]:{},[Ae.Messaging]:{}};i("payloadCollection",e)}},[]);return e(V,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Type of data to collect"}),t(V,{$gap:6,children:Dr.map(({id:e,label:o,tooltip:n})=>t(Ie,{text:n,withIcon:!0,children:t(H,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Ae.HttpRequest]:o.includes(Ae.HttpRequest)?{}:null,[Ae.HttpResponse]:o.includes(Ae.HttpResponse)?{}:null,[Ae.DbQuery]:o.includes(Ae.DbQuery)?{}:null,[Ae.Messaging]:o.includes(Ae.Messaging)?{}:null};i("payloadCollection",n)})(e,t)})},e))}),t(j,{errorMessage:r})]})},[Pe.UnknownType]:null},Fr=({ruleType:e,value:o,setValue:n,formErrors:a})=>{if(!e)return null;const i=Pr[e];return i?t(i,{value:o,setValue:n,formErrors:a}):null},Lr=()=>{const o=f(),{selectedOption:n,genericForm:a}=kl();if(!a||!n)return t(me,{title:"No active form"});const{formData:i,handleFormChange:l,formErrors:r}=a;return e(V,{$gap:24,children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(fe,{size:te.XXXS,maxLines:2,children:n.docsDescription}),e(oe,{$gap:12,children:[t(le,{options:[{icon:si,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ci,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:be.S,selected:i.disabled,setSelected:e=>l("disabled",e)}),t(ne,{leftIcon:di,variant:ie.Secondary,size:ae.S,onClick:()=>window.open(`${ve}${n.docsEndpoint}`,"_blank","noopener noreferrer")})]})]}),e(oe,{$gap:12,children:[t(Q,{size:te.XS,color:ee.Secondary,nowrap:!0,children:"Supported Languages:"}),n.supportedLanguages.map(e=>t(Fe,{label:Le[e],leftIcon:_e(e),status:we.Default,useSecondaryTone:!0},e))]}),t(pe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:i.ruleName,onChange:({target:{value:e}})=>l("ruleName",e),errorMessage:r.ruleName}),t(Fr,{ruleType:n.type,value:i,setValue:(e,t)=>l(e,t),formErrors:r}),t(ye,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:i.notes,onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},_r=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Tl();if(!e)return null;const{existingName:a,editingName:i}=e;return t(ze,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Me.DATA_STREAM_MERGE_WARNING(i,a),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:ie.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:ie.Secondary,onClick:n}})},zr=({autoFocus:o})=>{const{dataStreams:n}=Be(),{genericForm:i,excludeName:l,editingName:r}=Tl(),{formData:s,formErrors:c,handleFormChange:d}=i,u=s.name,p=a(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(V,{$width:"100%",$gap:12,children:[t(pe,{name:"data-stream-name",label:Me.STREAM_NAME,placeholder:Me.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Me.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Se,{status:we.Warning,message:Me.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Mr=()=>{const{selectedStreamName:e}=Be(),{genericForm:o}=$l();if(!o)return t(me,{title:"No active form"});const{formData:n,handleFormChange:a,formErrors:i}=o;return t(pe,{name:"sourceName",label:Me.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{a("otelServiceName",t),a("currentStreamName",e)},errorMessage:i.otelServiceName})},Br=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Xr=m.div`
13
129
  display: flex;
14
130
  flex-direction: column;
15
131
  gap: 24px;
16
- `,fs=g.div`
132
+ `,Vr=m.div`
17
133
  display: contents;
18
134
  & > * {
19
135
  opacity: ${({$faded:e})=>e?.4:1};
20
136
  transition: opacity 0.2s ease;
21
137
  }
22
- `,bs=({value:e})=>{const o=f();return t(Ee,e?{status:ge.Success,label:Xe,leftIcon:si}:{label:Ve,leftIcon:ri,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},vs=({value:e,onChange:o})=>{const n=f(),a=r(()=>[{icon:si,label:Xe,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:ri,label:Ve,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(ue,{options:a,selected:e,setSelected:o??(()=>{}),disabled:!o})},ys=()=>{const e=$l();switch(e.formType){case Nl.Create:return t(Cs,{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 Nl.View:return e.data?e.isEditing?t(Cs,{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(Ss,{data:e.data,renderAction:()=>t(bs,{value:!e.data?.rule.disabled})}):null;case Nl.EditAutoNoisy:return t(ws,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:ze,sectionTitle:_e,sectionSubTitle:Be,presetLabel:Le,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 Nl.EditAutoCostReduction:return t(ws,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Me,sectionTitle:_e,presetLabel:Le,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 Nl.EditAutoHighlyRelevant:return t(gs,{children:t(al,{title:e.localEnabled?void 0:Pe,summary:e.summary,renderAction:()=>t(vs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Cs=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:s})=>e(gs,{children:[t(sl,{category:o,formState:n,renderAction:s}),e(fs,{$faded:!!n.disabled,children:[t(rl,{category:o,formState:n,onChange:a}),t(cl,{formState:n,onChange:a,sourceOptions:i,namespaceOptions:l}),t(dl,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(ul,{formState:n,onChange:a}),"highlyRelevant"===o&&t(pl,{ruleType:n.ruleType,formState:n,onChange:a}),t(hl,{category:o,formState:n,onChange:a})]})]}),Ss=({data:o,renderAction:n})=>e(gs,{children:[t(sl,{readOnly:!0,summary:o.summary,renderAction:n}),t(rl,{readOnly:!0,data:o}),t(cl,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(dl,{readOnly:!0,data:o}),t(hl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(pl,{readOnly:!0,rule:o.rule})]}),ws=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:l,presetLabel:s,customInputName:r,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=c(e=>p(e),[p]),y=c(e=>m(e),[m]),C=c(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(gs,{children:[t(al,{title:o?void 0:a,summary:n,renderAction:b}),t(fs,{$faded:!o,children:e(Ue,{richTitle:{title:i,subTitle:l},children:[d&&t(V,{$alignItems:"flex-start",children:t(ue,{options:ms,selected:u,setSelected:v})}),S&&t(il,{description:s,options:ll,selected:h,onSelect:y,customName:r,customLabel:He,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},xs=g.div`
138
+ `,Ur=({value:e})=>{const o=f();return t(Fe,e?{status:we.Success,label:We,leftIcon:si}:{label:Ke,leftIcon:ci,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Hr=({value:e,onChange:o})=>{const n=f(),i=a(()=>[{icon:si,label:We,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:ci,label:Ke,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(le,{options:i,selected:e,setSelected:o??(()=>{}),disabled:!o})},jr=()=>{const e=El();switch(e.formType){case Il.Create:return t(Gr,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Hr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Il.View:return e.data?e.isEditing?t(Gr,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Hr,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Wr,{data:e.data,renderAction:()=>t(Ur,{value:!e.data?.rule.disabled})}):null;case Il.EditAutoNoisy:return t(Kr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:Ge,sectionTitle:Ue,sectionSubTitle:je,presetLabel:Ve,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Hr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Il.EditAutoCostReduction:return t(Kr,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:He,sectionTitle:Ue,presetLabel:Ve,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Hr,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Il.EditAutoHighlyRelevant:return t(Xr,{children:t(il,{title:e.localEnabled?void 0:Xe,summary:e.summary,renderAction:()=>t(Hr,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Gr=({category:o,formData:n,onChange:a,sourceOptions:i,namespaceOptions:l,renderAction:r})=>e(Xr,{children:[t(sl,{category:o,formState:n,renderAction:r}),e(Vr,{$faded:!!n.disabled,children:[t(cl,{category:o,formState:n,onChange:a}),t(dl,{formState:n,onChange:a,sourceOptions:i,namespaceOptions:l}),t(ul,{category:o,formState:n,onChange:a}),"highlyRelevant"===o&&t(pl,{formState:n,onChange:a}),"highlyRelevant"===o&&t(hl,{ruleType:n.ruleType,formState:n,onChange:a}),t(gl,{category:o,formState:n,onChange:a})]})]}),Wr=({data:o,renderAction:n})=>e(Xr,{children:[t(sl,{readOnly:!0,summary:o.summary,renderAction:n}),t(cl,{readOnly:!0,data:o}),t(dl,{readOnly:!0,scopes:C(o.rule.sourceScopes)}),t(ul,{readOnly:!0,data:o}),t(gl,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(hl,{readOnly:!0,rule:o.rule})]}),Kr=({enabled:o,summary:n,inactiveTitle:a,sectionTitle:i,sectionSubTitle:r,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:g,customPercentage:m,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>g(e),[g]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(Xr,{children:[t(il,{title:o?void 0:a,summary:n,renderAction:b}),t(Vr,{$faded:!o,children:e(Ye,{richTitle:{title:i,subTitle:r},children:[d&&t(V,{$alignItems:"flex-start",children:t(le,{options:Br,selected:u,setSelected:v})}),S&&t(ll,{description:s,options:rl,selected:h,onSelect:y,customName:c,customLabel:Je,customPlaceholder:"5%",customValue:m,onCustomChange:C})]})})]})},Yr=m.div`
23
139
  display: flex;
24
140
  align-items: center;
25
141
  justify-content: space-between;
@@ -32,32 +148,27 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
32
148
  &:hover {
33
149
  background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>e?t?o.v2.colors.purple[700]:o.v2.colors.silver[600]:t?o.v2.colors.purple[800]:o.v2.colors.silver[700]};
34
150
  }
35
- `,ks=g.div`
151
+ `,Jr=m.div`
36
152
  display: flex;
37
153
  align-items: center;
38
154
  justify-content: center;
39
155
  padding: 8px;
40
156
  border-radius: 8px;
41
- background-color: ${({theme:e})=>e.v2.colors.white[500]+je["004"]};
42
- `,Ts=({dataId:o,icon:n,title:a,description:i,withCarret:l,purpleColors:s,disabled:r,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(xs,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:s,$disabled:r,onClick:()=>!d&&!r&&u(),children:[e(V,{$gap:4,children:[e(te,{$gap:12,children:[m&&t(H,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),n&&t(ks,{children:t(n,{size:20})}),t(re,{size:ce.XS,children:a})]}),i&&t(re,{size:ce.XXXS,color:Ce.Secondary,children:i})]}),(l||c)&&e(te,{$gap:8,children:[c,l&&t(hi,{size:18})]})]}),$s=g.div`
43
- display: flex;
44
- align-items: center;
45
- gap: 8px;
46
- padding: 8px;
47
- `,Ns=({onClose:o,selectedConnectionIds:n,setSelectedConnectionIds:a,createAction:i,withOverlay:s})=>{const[c,u]=l(""),p=d(null),{selectedOption:h,onSelectOption:m,genericForm:g,validateFormData:f}=Sl(),b=r(()=>(c?We.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):We).filter(e=>!!e),[c]),v=r(()=>(c?Ge.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):Ge).filter(e=>!!e),[c]),y=r(()=>{const o=(o,n)=>e($s,{children:[t(re,{size:ce.XS,color:Ce.Secondary,children:o}),t(Ee,{label:n.toString()})]},o),n=e=>{const o=h?.type===e.type;return t(Ts,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{p.current?.clearErrors(),m(e)}},e.type)};return[o("Attributes",b.length),...b.map(n),o("Samplers",v.length),...v.map(n)]},[h?.type,b.length,v.length,m]),C=r(()=>h?[t(Ql,{},h.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:mi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[h]);return t(ml,{ref:p,isOpen:!0,withOverlay:s,onClose:o,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=f();return!e&&await i(t)},disableSave:!h||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_ACTION,subTitle:Re.CREATING_ACTION_SUBTITLE},header:{icon:mi,title:Re.ADD_ACTION,subTitle:Re.ADD_ACTION_DESCRIPTION},connectionIds:n&&a?{value:n,setValue:a}:void 0,search:{value:c,onChange:u},leftColumn:{width:"40%",list:y},rightColumn:{width:"60%",list:C}})},Is=({destinationsByCategory:n,filters:a,setFilters:i})=>{const l=r(()=>Object.values(Ye).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=r(()=>{const e=Object.values(fe).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(Je,{placeholder:"Select category",options:l,values:a.categoryType?[a.categoryType]:[],setValues:e=>i({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(ue,{options:s,selected:a.signalType,setSelected:e=>i({...a,signalType:e})})]})},Es=g.div`
157
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+qe["004"]};
158
+ `,qr=({dataId:o,icon:n,title:a,description:i,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:g})=>e(Yr,{"data-id":o||`list-item-${a}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(V,{$gap:4,children:[e(oe,{$gap:12,children:[g&&t(H,{partiallyChecked:h||!1,value:p||!1,onChange:e=>g(e)}),n&&t(Jr,{children:t(n,{size:20})}),t(Q,{size:te.XS,children:a})]}),i&&t(Q,{size:te.XXXS,color:ee.Secondary,children:i})]}),(l||c)&&e(oe,{$gap:8,children:[c,l&&t(mi,{size:18})]})]}),Zr=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createAction:l,withOverlay:s})=>{const[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=wl(),f=a(()=>(c?Ze.filter(e=>e?.label?.toLowerCase().includes(c.toLowerCase())):Ze).filter(e=>!!e),[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(qr,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p?.type,f.length,h]),v=a(()=>p?[t(Tr,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:fi,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[p]);return t(ml,{ref:u,isOpen:!0,withOverlay:s,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await l(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Me.CREATING_ACTION,subTitle:Me.CREATING_ACTION_SUBTITLE},header:{icon:fi,title:Me.ADD_ACTION,subTitle:Me.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Qr=({destinationsByCategory:n,filters:i,setFilters:l})=>{const r=a(()=>Object.values(et).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=a(()=>{const e=Object.values(xe).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(tt,{placeholder:"Select category",options:r,values:i.categoryType?[i.categoryType]:[],setValues:e=>l({...i,categoryType:i.categoryType===e[0]?null:e[0]})}),t(le,{options:s,selected:i.signalType,setSelected:e=>l({...i,signalType:e})})]})},es=m.div`
48
159
  display: flex;
49
160
  flex-direction: column;
50
161
  padding: 8px;
51
162
  border-radius: 16px;
52
163
  border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
53
164
  background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
54
- `,Os=g.div`
165
+ `,ts=m.div`
55
166
  display: flex;
56
167
  align-items: center;
57
168
  justify-content: space-between;
58
169
  gap: 12px;
59
170
  padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
60
- `,As=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:s})=>{const[r,c]=l(!0);return e(Es,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:s,children:[e(Os,{$isOpen:r,children:[e(te,{$gap:10,children:[t(re,{size:ce.XS,children:o}),n&&t(we,{text:n,withIcon:!0}),t(Ee,{label:a.length,status:s?ge.Default:void 0})]}),t(qe,{icon:r?fi:bi,size:Ze.M,onClick:()=>c(e=>!e)})]}),r?t(V,{children:a.length?u.toArray(a):t(Ke,{$padding:"12px 0",children:t(se,{})})}):null]})},Ds=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||ve(e.supportedSignals).includes(o.signalType))):e,Rs=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(Ts,{icon:tt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Ee,{status:n.succeeded?ge.Success:ge.Error,leftIcon:n.succeeded?vi:yi})}),Fs=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=wl();return o?.length?t(As,{title:et[e].TITLE,tooltip:et[e].DESCRIPTION,list:o.map((o,n)=>t(Rs,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(As,{purpleColors:!0,title:et[e].TITLE,tooltip:et[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},s)=>t(Rs,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===s&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:s})},`${e}-${s}`))},e):void 0};var Ps;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(Ps||(Ps={}));const Ls=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===Ps.SELF_HOSTED?n.push(...e.items):e.name===Ps.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=ot(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=nt(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[Ye.DETECTED]:o,[Ye.SELF_HOSTED]:n,[Ye.MANAGED]:a}},_s=({onClose:e,onBack:o,onNext:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getDestinationCategories:d,getPotentialDestinations:u,initialInputs:p,testConnection:h,createDestination:m,updateDestination:g,withOverlay:f,disableAnimation:b})=>{const[v,y]=l(""),[C,S]=l({categoryType:null,signalType:null}),{destinations:w}=at(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=wl();n(()=>{p&&$(p)},[p]);const[N,I]=l(!0),[E,O]=l([]),[A,D]=l({[Ye.ALL]:[],[Ye.UNSAVED]:[],[Ye.EXISTS]:[],[Ye.DETECTED]:[],[Ye.SELF_HOSTED]:[],[Ye.MANAGED]:[]});n(()=>{const e=w.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=nt(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});D(t=>({...t,[Ye.EXISTS]:e}))},[w,E]);const R=c(async()=>{try{I(!0);const[e,t]=await Promise.all([d(),u()]);e&&O(e.destinationCategories.categories),D(o=>({...o,...Ls(e,t)}))}catch(e){}finally{I(!1)}},[]);n(()=>{R()},[]);const F=c(async()=>{const e=(await Promise.all(T.map(({option:e,formData:t})=>{const o=ye(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e]))return g(e.id,o,i)}return m(o,i)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[T,i,m,g]),P=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:a})=>{const{unsavedDestinations:i}=wl();return{width:"40%",list:r(()=>{const l=[];i.length&&l.push(t(Fs,{listType:Ye.UNSAVED,unsavedDestinations:i},"unsaved"));for(const e of Object.values(Ye)){if(a.categoryType&&a.categoryType!==e)continue;const i=Ds(o[e],n,a);i.length&&l.push(t(Fs,{listType:e,destinationOptions:i},e))}return e&&l.push(t(Ke,{$height:"100%",children:t(Qe,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),l},[i,o,n,a,e])}})({isFetching:N,destinationsByCategory:A,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:o}=wl();return{width:"60%",list:o?[t(os,{testConnection:e},o.option.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:gi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(ml,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(T):void 0,onNext:a?()=>a(T):void 0,nextIsSkip:!T.length,onSave:F,disableSave:!x&&!T.length,isFetching:N,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_DESTINATION,subTitle:Re.CREATING_DESTINATION_SUBTITLE},header:{icon:gi,title:Re.ADD_DESTINATIONS,subTitle:Re.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:i&&s?{value:i,setValue:s}:void 0,search:{value:v,onChange:y},filters:t(Is,{destinationsByCategory:A,filters:C,setFilters:S}),leftColumn:P,rightColumn:L})},Ms=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createInstrumentationRule:a,withOverlay:i})=>{const[s,c]=l(""),u=d(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=xl(),f=r(()=>s?it.filter(e=>e.label.toLowerCase().includes(s.toLowerCase())):it,[s]),b=r(()=>f.map(e=>{const o=p?.type===e.type;return t(Ts,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=r(()=>p?[t(ds,{},p.type)]:[t(Ke,{$height:"100%",children:t(se,{icon:Ci,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(ml,{ref:u,isOpen:!0,withOverlay:i,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();return!e&&await a(t)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Re.CREATING_INSTRUMENTATION_RULE,subTitle:Re.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ci,title:Re.ADD_INSTRUMENTATION_RULE,subTitle:Re.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:s,onChange:c},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},Bs={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Re.FETCHING_NAMESPACES,subTitle:Re.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:Re.SELECT_NAMESPACE,subTitle:Re.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},zs={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===lt.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"},Xs=e=>e?zs:Bs,Vs="No matches",Us="No sources",Hs=e=>`No sources matched the filter '${e}'`,js=e=>(e?"Unselect":"Select")+" all",Ws="Show only:",Gs="Selected",Ks="Auto",Ys="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Js="Enterprise only",qs=g.div``,Zs=g.div`
171
+ `,os=({title:o,tooltip:n,list:a,noBgColor:i,purpleColors:l})=>{const[s,c]=r(!0);return e(es,{"data-id":`collapse-${o}`,$noBgColor:i,$purpleColors:l,children:[e(ts,{$isOpen:s,children:[e(oe,{$gap:10,children:[t(Q,{size:te.XS,children:o}),n&&t(Ie,{text:n,withIcon:!0}),t(Fe,{label:a.length,status:l?we.Default:void 0})]}),t(ot,{icon:s?vi:yi,size:nt.M,onClick:()=>c(e=>!e)})]}),s?t(V,{children:a.length?u.toArray(a):t(Qe,{$padding:"12px 0",children:t(me,{})})}):null]})},ns=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Te(e.supportedSignals).includes(o.signalType))):e,as=({option:e,formData:o,testResult:n,isSelected:a,onSelect:i})=>t(qr,{icon:lt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:a,onClick:()=>i(),children:n&&t(Fe,{status:n.succeeded?we.Success:we.Error,leftIcon:n.succeeded?Ci:Si})}),is=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:a,onChangeActiveForm:i}=xl();return o?.length?t(os,{title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:o.map((o,n)=>t(as,{option:o,isSelected:a?.listType===e&&"number"!=typeof a?.unsavedIdx&&(null!=o.id&&""!==o.id?a?.option.id===o.id:a?.option.type===o.type),onSelect:()=>i({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(os,{purpleColors:!0,title:it[e].TITLE,tooltip:it[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(as,{option:o,formData:n,testResult:l,isSelected:a?.unsavedIdx===r&&a?.listType===e,onSelect:()=>i({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ls;!function(e){e.SELF_HOSTED="self hosted",e.MANAGED="managed"}(ls||(ls={}));const rs=(e,t)=>{const o=[],n=[],a=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ls.SELF_HOSTED?n.push(...e.items):e.name===ls.MANAGED&&a.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=rt(n),a=e.items.findIndex(e=>e.type===t.type);if(-1!==a){const n=st(t.fields,{});Object.keys(n).length&&(e.items[a].fields=e.items[a].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[a]))}}}),{[et.DETECTED]:o,[et.SELF_HOSTED]:n,[et.MANAGED]:a}},ss=({onClose:e,onBack:o,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,getDestinationCategories:d,getPotentialDestinations:u,initialInputs:p,testConnection:h,createDestination:g,updateDestination:m,withOverlay:f,disableAnimation:b})=>{const[v,y]=r(""),[C,S]=r({categoryType:null,signalType:null}),{destinations:w}=ct(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=xl();n(()=>{p&&$(p)},[p]);const[E,I]=r(!0),[N,A]=r([]),[O,D]=r({[et.ALL]:[],[et.UNSAVED]:[],[et.EXISTS]:[],[et.DETECTED]:[],[et.SELF_HOSTED]:[],[et.MANAGED]:[]});n(()=>{const e=w.map(e=>{let t;for(const o of N){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=st(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});D(t=>({...t,[et.EXISTS]:e}))},[w,N]);const R=l(async()=>{try{I(!0);const[e,t]=await Promise.all([d(),u()]);e&&A(e.destinationCategories.categories),D(o=>({...o,...rs(e,t)}))}catch(e){}finally{I(!1)}},[]);n(()=>{R()},[]);const P=l(async()=>{const e=(await Promise.all(T.map(({option:e,formData:t})=>{const o=$e(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e]))return m(e.id,o,s)}return g(o,s)}))).filter(e=>e?.error);if(e.length)return{error:e.map(e=>e?.error).join("\n")}},[T,s,g,m]),F=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:i})=>{const{unsavedDestinations:l}=xl();return{width:"40%",list:a(()=>{const a=[];l.length&&a.push(t(is,{listType:et.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(et)){if(i.categoryType&&i.categoryType!==e)continue;const l=ns(o[e],n,i);l.length&&a.push(t(is,{listType:e,destinationOptions:l},e))}return e&&a.push(t(Qe,{$height:"100%",children:t(at,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),a},[l,o,n,i,e])}})({isFetching:E,destinationsByCategory:O,searchText:v,filters:C}),L=(({testConnection:e})=>{const{activeForm:o}=xl();return{width:"60%",list:o?[t(Ir,{testConnection:e},o.option.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:bi,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})({testConnection:h});return t(ml,{isOpen:!0,withOverlay:f,disableAnimation:b,onClose:e,onBack:o?()=>o(T):void 0,onNext:i?()=>i(T):void 0,nextIsSkip:!T.length,onSave:P,disableSave:!x&&!T.length,isFetching:E,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Me.CREATING_DESTINATION,subTitle:Me.CREATING_DESTINATION_SUBTITLE},header:{icon:bi,title:Me.ADD_DESTINATIONS,subTitle:Me.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:v,onChange:y},filters:t(Qr,{destinationsByCategory:O,filters:C,setFilters:S}),leftColumn:F,rightColumn:L})},cs=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,createInstrumentationRule:l,withOverlay:s})=>{const[c,d]=r(""),u=i(null),{selectedOption:p,onSelectOption:h,genericForm:g,validateFormData:m}=kl(),f=a(()=>c?dt.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):dt,[c]),b=a(()=>f.map(e=>{const o=p?.type===e.type;return t(qr,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[p,f.length,h]),v=a(()=>p?[t(Lr,{},p.type)]:[t(Qe,{$height:"100%",children:t(me,{icon:wi,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[p]);return t(ml,{ref:u,isOpen:!0,withOverlay:s,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=m();return!e&&await l(t)},disableSave:!p||!g?.isFormDirty,isFormDirty:g?.isFormDirty,hideDirtyNote:!0,progress:{title:Me.CREATING_INSTRUMENTATION_RULE,subTitle:Me.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:wi,title:Me.ADD_INSTRUMENTATION_RULE,subTitle:Me.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:b},rightColumn:{width:"60%",list:v}})},ds={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Me.FETCHING_NAMESPACES,subTitle:Me.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Me.SELECT_NAMESPACE,subTitle:Me.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},us={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===ut.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},ps=e=>e?us:ds,hs="No matches",gs="No sources",ms=e=>`No sources matched the filter '${e}'`,fs=e=>(e?"Unselect":"Select")+" all",bs="Show only:",vs="Selected",ys="Auto",Cs="Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",Ss="Enterprise only",ws=m.div``,xs=m.div`
61
172
  visibility: hidden;
62
173
 
63
174
  transition: visibility 0s;
@@ -65,19 +176,19 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
65
176
  transition-duration: 0s;
66
177
  }
67
178
 
68
- ${qs}:hover & {
179
+ ${ws}:hover & {
69
180
  visibility: visible;
70
181
  }
71
- `,Qs=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const s=f(),r=()=>{};return t(qs,{children:t(Ts,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?r:a,isChecked:n,onCheckboxChange:i?r:a,children:i&&l?t(Ee,{label:l,status:ge.Default,textSize:ce.XXXS}):t(Zs,{children:t(Ee,{label:o,status:ge.Info,textSize:ce.XXXS,backgroundColor:s.v2.colors.blue[900]})})})})},er=g.div``,tr=g.div`
182
+ `,ks=({workloadName:e,workloadKind:o,isChecked:n,onToggle:a,disabled:i,disabledReason:l})=>{const r=f(),s=()=>{};return t(ws,{children:t(qr,{dataId:`source-${e}`,title:e,disabled:i,onClick:i?s:a,isChecked:n,onCheckboxChange:i?s:a,children:i&&l?t(Fe,{label:l,status:we.Default,textSize:te.XXXS}):t(xs,{children:t(Fe,{label:o,status:we.Info,textSize:te.XXXS,backgroundColor:r.v2.colors.blue[900]})})})})},Ts=m.div``,$s=m.div`
72
183
  visibility: ${({$visible:e})=>e?"visible":"hidden"};
73
184
 
74
185
  transition: visibility 0s;
75
186
  ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
76
187
 
77
- ${er}:hover & {
188
+ ${Ts}:hover & {
78
189
  visibility: visible;
79
190
  }
80
- `,or=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:s,onActive:r,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{r(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(er,{children:t(Ts,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:s,onClick:r,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(te,{$gap:12,children:[!d&&t(tr,{$visible:s||i,children:t(we,{text:Ys,children:t(q,{label:Ks,labelAlign:Z.Left,size:ct.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(te,{$gap:8,children:[t(re,{variant:dt.Span,size:ce.XXXS,color:Ce.Secondary,align:"right",children:Gs}),t(Ee,{label:`${l.sourced}/${l.total}`,status:s?ge.Default:st.Unknown,minWidth:"42px"})]})]})})})},nr=({withCollapse:e,clusterId:o,clusterName:n,namespaces:a,selectedArea:i,setSelectedArea:l,handleSourceChange:s})=>{const c=r(()=>a.map(({name:e,totalWorkloads:a,selectedCount:r,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(or,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:r,total:a},isActive:i.clusterId===o&&i.namespaceName===e,onActive:()=>l({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,a,i]);return e?t(As,{title:n,list:c,noBgColor:!0}):c},ar=({onClose:o,onBack:a,onNext:i,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:m})=>{const{isVm:g}=y(),f=Xs(g),{selectedStreamName:b}=Fe(),{progress:v,resetProgress:C}=ut(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:k,handleSourceChange:T,handleSelectAll:$,formDiff:N,isFormDirty:I}=Dl();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:mt,clusterName:ht,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[E,O]=l(""),[A,D]=l(lt.Namespace),[R,F]=l({showOnlySelected:!1}),[P,L]=l({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:a,handleSelectAll:i,selectedArea:l,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=Xs(p),m=r(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ol(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Al(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),g=r(()=>{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:C}=r(()=>{const e=m.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(nr,{withCollapse:m.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:l,setSelectedArea:s,handleSourceChange:a},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[m,l]);return{width:"60%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,nowrap:!0,children:h.groupColumnHeader}),t(we,{text:b?Re.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ee,{label:`${b?`${v} / ${C}`:C}`,status:st.Unknown})})]}),t(re,{"data-id":"namespaces-select-all",onClick:()=>i({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:ce.XS,children:js(g)})]}),list:f.length?f:o?[t(Ke,{$height:"100%",children:t(Qe,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Ke,{$height:"100%",children:t(se,c?{icon:wi,title:Vs,subTitle:h.noGroupMatchedFilter(c)}:{icon:wi,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:P,setSelectedArea:L,searchText:A===lt.Namespace?E:"",searchBy:A,filters:R}),M=(({formData:o,handleSourceChange:n,handleSelectAll:a,selectedArea:i,searchText:l,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=Xs(u),h=d===rt.Onprem,m=r(()=>i.value.namespaceName?o.find(({clusterId:e})=>e===i.value.clusterId)?.namespaces.find(({name:e})=>e===i.value.namespaceName):void 0,[o,i.value.clusterId,i.value.namespaceName]),g=r(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Il(e,l,c)):[],[m,l,c]),f=r(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=r(()=>{if(!m)return[];const{clusterId:e}=i.value,{name:o}=m;return g.map(({name:a,selected:i,kind:l})=>{const s=!u&&!h&&El.has(l);return t(Qs,{workloadName:a,workloadKind:l,isChecked:!s&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:s,disabledReason:Js},`${e}#${o}#${a}#${l}`)})},[g,m,i.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=r(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,nowrap:!0,children:i.value.namespaceName?`${i.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(we,{text:v?Re.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ee,{label:`${v?`${C} / ${S}`:S}`,status:st.Unknown})})]}),t(re,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:i.value.clusterId,namespaceName:i.value.namespaceName,boolean:!f,searchText:l,searchBy:s,filters:c}),disabled:!b.length,size:ce.XS,children:js(f)})]}),list:b.length?b:[t(Ke,{$height:"100%",children:t(se,m?l?{icon:Si,title:Vs,subTitle:Hs(l)}:{icon:Si,title:Us,subTitle:p.noItemsInGroupSubTitle}:{icon:Si,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:{value:P},searchText:A===lt.Source?E:"",searchBy:A,filters:R});return t(ml,{isOpen:!0,withOverlay:h,disableAnimation:m,onClose:o?()=>{C(pt.BulkInstrumenting),o()}:void 0,onBack:a?()=>a(N):void 0,onNext:i?()=>i(N):void 0,nextIsSkip:!I,onSave:()=>d(N),header:{icon:Si,title:Re.ADD_SOURCE,subTitle:Re.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:E,onChange:e=>{O(e),A===lt.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(A),segment:{options:[{label:f.groupSegmentLabel,value:lt.Namespace},{label:f.itemSegmentLabel,value:lt.Source}],selected:A,setSelected:D}},filters:e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:Ws}),t(q,{name:"filter-selected",size:ct.S,label:Gs,value:R.showOnlySelected,onChange:e=>F(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:S,progress:{title:Re.CREATING_SOURCES,subTitle:Re.CREATING_SOURCES_SUBTITLE,percentage:v[pt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:M})},ir=({onClose:a,actionId:i,updateAction:s,deleteAction:d})=>{const u=f(),{actions:p}=at(),{selectedOption:h,loadAction:m,validateFormData:g,genericForm:b}=Sl(),[v,y]=l(!1),[C,S]=l(!1),[w,x]=l(null),k=v&&!!b?.isFormDirty,T=r(()=>p?.find(e=>gt(e)===i),[i,p]),$=r(()=>We.find(({type:e})=>e===T?.type)??Ge.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&m(T)},[T]);const N=c(()=>{T&&y(!0)},[T]),I=c(()=>{T&&(m(T),y(!1))},[T,m]),E=c(()=>{k?x("close"):a()},[k,a]),O=c(()=>{k?x("cancel"):I()},[k,I]),A=c(()=>{const e=w;x(null),"close"===e?(I(),a()):I()},[w,I,a]),D=c(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=g();e||(await s(T.id,t),y(!1))}},[T,g,s]),R=c(()=>{T&&S(!0)},[T]),F=c(async()=>{T&&(await d(T.id,T.type),a())},[T,d,a]);if(!T||!$)return null;const P=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?ge.Success:st.Unknown,label:e?"True":"False",invertColors:!0});return o===le.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||J.Pod,r=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${r}From`,label:s})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const s=i?.length?i.join(", "):a||J.Pod,r=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${r}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${r}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${r}From`,label:s})})),o===le.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===le.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===le.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===le.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===le.ErrorSampler&&t.push({id:"fallbackSamplingRatio",title:"Sampling Ratio",label:String(n.fallbackSamplingRatio??"-")}),o===le.ProbabilisticSampler&&t.push({id:"samplingPercentage",title:"Sampling Percentage",label:String(n.samplingPercentage??"-")}),o===le.LatencySampler&&n.endpointsFilters?.forEach(({serviceName:e,httpRoute:o,minimumLatencyThreshold:a,fallbackSamplingRatio:i},l)=>{const s=(n.endpointsFilters?.length??0)>1?`Endpoint #${l+1} `:"Endpoint ";t.push({id:`endpoint-${l}-service`,title:`${s}Service Name`,label:e}),t.push({id:`endpoint-${l}-route`,title:`${s}HTTP Route`,label:o}),t.push({id:`endpoint-${l}-latency`,title:`${s}Min. Latency`,label:String(a)}),t.push({id:`endpoint-${l}-fallback`,title:`${s}Fallback Sampling Ratio`,label:String(i)})}),o===le.ServiceNameSampler&&n.servicesNameFilters?.forEach(({serviceName:e,samplingRatio:o,fallbackSamplingRatio:a},i)=>{const l=(n.servicesNameFilters?.length??0)>1?`Filter #${i+1} `:"Filter ";t.push({id:`service-${i}-name`,title:`${l}Service Name`,label:e}),t.push({id:`service-${i}-ratio`,title:`${l}Sampling Ratio`,label:String(o)}),t.push({id:`service-${i}-fallback`,title:`${l}Fallback Sampling Ratio`,label:String(a)})}),o===le.SpanAttributeSampler&&n.attributeFilters?.forEach(({serviceName:e,attributeKey:o,fallbackSamplingRatio:a,condition:i},l)=>{const s=Object.keys(i)[0],r=i[s],c=(n.attributeFilters?.length??0)>1?`Filter #${l+1} `:"Filter ";t.push({id:`attr-${l}-service`,title:`${c}Service Name`,label:e}),t.push({id:`attr-${l}-key`,title:`${c}Attribute Key`,label:o}),t.push({id:`attr-${l}-fallback`,title:`${c}Fallback Sampling Ratio`,label:String(a)}),t.push({id:`attr-${l}-condition`,title:`${c}Condition`,label:s}),t.push({id:`attr-${l}-operation`,title:`${c}Operation`,label:r?.operation??"-"}),t.push({id:`attr-${l}-expected`,title:`${c}Expected Value`,label:String(r?.expectedValue??"-")}),"jsonCondition"===s&&t.push({id:`attr-${l}-jsonpath`,title:`${c}JSON Path`,label:r?.jsonPath??"-"})}),o===le.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:St(T.type),title:$.label,onClose:E,actions:[{id:"edit-action-btn-edit",label:bt.EDIT,icon:di,active:v,onClick:N},{id:"edit-action-btn-delete",label:bt.DELETE,icon:ai,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:O},{"data-id":"edit-action-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:D}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:v&&h?t(Ql,{}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[t(Ct,{conditions:T.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(L=T,_=$,[{id:"type",title:Re.TYPE,label:_.label},{id:"status",title:Re.STATUS,badge:{status:L.disabled?st.Unknown:ge.Success,label:L.disabled?Re.DISABLED:Re.ENABLED}},{id:"signals",title:Re.SIGNALS_FOR_PROCESSING,label:L.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:Re.NAME,label:L.name||"-"},{id:"notes",title:Re.NOTES,label:L.notes||"-"}])})]}),!!P?.length&&t(yt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",cellsPerRow:2,items:P})})]})})})}),t(gl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:F}),t(fl,{isOpen:null!==w,onClose:()=>x(null),onApprove:A})]});var L,_},lr=({onClose:o,connections:a,selectedConnectionIds:i,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=l(""),[h,m]=l({showOnlySelected:!1}),g=r(()=>a.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&i.includes(e.id);return t&&o}),[a.length,i.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=l(!1),[y,C]=l(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=wt(y||{rollout:{automaticRolloutDisabled:!1}}),T=r(()=>i.length>1||void 0!==y&&!x(y,S),[i.length,y,S]);return n(()=>{1===i.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),k(e)}v(!1)})(i[0]):C(void 0)},[i.length]),t(ml,{isOpen:!0,onClose:o,onSave:()=>d(S,i),header:{icon:xi,title:"Cluster Configuration"},connectionIds:{value:i,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:"Show only:"}),t(q,{size:ct.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:b,leftColumn:{width:"35%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(re,{size:ce.XS,children:"Clusters"}),t(Ee,{label:g.length,status:st.Unknown})]}),e(te,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,align:"right",children:"Selected clusters"}),t(Ee,{label:`${i.length}/${g.length}`,status:st.Unknown})]})]}),list:g.map(e=>t(Ts,{title:e.name,isChecked:i.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(re,{size:ce.XS,children:"Configurations"}),list:[t(q,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},sr=({onClose:a,destinationId:i,getDestinationCategories:s,testConnection:u,updateDestination:p,deleteDestination:h})=>{const m=f(),{isVm:g}=y(),{destinations:b}=at(),{selectedStreamName:v}=Fe(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=wl(),k=d(null),[T,$]=l(!1),[N,I]=l(!1),[E,O]=l(null),[A,D]=l(!0),[R,F]=l(null),P=T&&!!x?.isFormDirty,L=r(()=>kt(b,v),[b,v]),_=r(()=>L?.find(e=>gt(e)===i),[i,L]);n(()=>{let e=!1;return D(!0),s().then(t=>{e||O(t?.destinationCategories.categories??[])}).catch(t=>{e||O([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&E&&S(_,E)},[_,E]);const M=r(()=>_&&E?Tt(E,_):[],[_,E]),B=c(()=>{_&&$(!0)},[_]),z=c(()=>{_&&E&&(S(_,E),$(!1))},[_,E,S]),X=c(()=>{P?F("close"):a()},[P,a]),U=c(()=>{P?F("cancel"):z()},[P,z]),H=c(()=>{const e=R;F(null),"close"===e?(z(),a()):z()},[R,z,a]),j=c(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,ye(t)),$(!1))}},[_,w,p]),W=c(()=>{_&&I(!0)},[_]),G=c(async()=>{_&&(await h(_.id),a())},[_,h,a]);if(!_)return null;const{icon:K,iconSrc:Y}=tt(_.destinationType.type),J=((e,t)=>{const o=[],n=xt(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=be(e.exportedSignals);let l=[];const s=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:r})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&he(h,i,a))return;const{type:g}=nt(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==r&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(r)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===ie.MultiInput){const t=nt(r,null);if(Array.isArray(t)&&t.length)return s(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===ie.KeyValuePair){const t=nt(r,null);if(Array.isArray(t)&&t.length)return s(),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:r})}else l.push({id:e,title:n,label:"-"})}),s(),o})(_,M);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:bt.EDIT,icon:di,active:T,onClick:B},{id:"edit-destination-btn-delete",label:bt.DELETE,icon:ai,color:m.v2.colors.red[500],active:N,onClick:W}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:U},...C?.option.testConnectionSupported&&!g?[{"data-id":"edit-destination-btn-test-connection",label:bt.TEST_CONNECTION,variant:ae.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:j}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:A?t(Ke,{$height:"50vh",children:t(Qe,{withSpinner:!0})}):T&&C?t(os,{ref:k,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[!g&&t(Ct,{conditions:_.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(q=_,[{id:"type",title:Re.TYPE,label:q.destinationType.displayName},{id:"status",title:Re.STATUS,badge:{status:q.disabled?st.Unknown:ge.Success,label:q.disabled?Re.DISABLED:Re.ENABLED}},{id:"monitors",title:Re.MONITORS,label:be(q.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ")||"-"},{id:"name",title:Re.NAME,label:q.name||"-"}])})]}),!!J.length&&t(yt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(yt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(yt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(gl,{target:"destination",isOpen:N,onClose:()=>I(!1),onApprove:G}),t(fl,{isOpen:null!==R,onClose:()=>F(null),onApprove:H})]});var q},rr=({onClose:a,ruleId:i,updateInstrumentationRule:s,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=at(),{addNotification:h}=Nt(),{selectedOption:m,loadRule:g,validateFormData:b,genericForm:v}=xl(),[y,C]=l(!1),[S,w]=l(!1),[x,k]=l(null),T=y&&!!v?.isFormDirty,$=r(()=>p?.find(e=>gt(e)===i),[i,p]),N=r(()=>it.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&g($)},[$]);const I=c(()=>{if($){if(!$.mutable)return void h({type:ge.Warning,title:It.FORBIDDEN,message:It.CANNOT_EDIT_RULE,crdType:lt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),E=c(()=>{$&&(g($),C(!1))},[$,g]),O=c(()=>{T?k("close"):a()},[T,a]),A=c(()=>{T?k("cancel"):E()},[T,E]),D=c(()=>{const e=x;k(null),"close"===e?(E(),a()):E()},[x,E,a]),R=c(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await s($.ruleId,t),C(!1))}},[$,b,s]),F=c(()=>{if($){if(!$.mutable)return void h({type:ge.Warning,title:It.FORBIDDEN,message:It.CANNOT_DELETE_RULE,crdType:lt.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),P=c(async()=>{$&&(await d($.ruleId),a())},[$,d,a]);if(!$||!N)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(re,{size:ce.XS,children:`• ${$t(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(re,{size:ce.XS,children:`• ${$t(e).toLowerCase()}`},e))}),e.headersCollection?.[xe.HeaderKeys]?.length&&e.headersCollection[xe.HeaderKeys].forEach(e=>{e&&n.push(t(re,{size:ce.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Ne.Java]?.forEach((e,a)=>{const i=new $e(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(re,{size:ce.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(re,{size:ce.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Ne.Golang]?.forEach((e,a)=>{const i=new Te(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(re,{size:ce.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(re,{size:ce.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(ft,{isOpen:!0,header:{icon:Ot($.type),title:N.label,onClose:O,actions:[{id:"edit-rule-btn-edit",label:bt.EDIT,icon:di,active:y,onClick:I},{id:"edit-rule-btn-delete",label:bt.DELETE,icon:ai,color:u.v2.colors.red[500],active:S,onClick:F}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:A},{"data-id":"edit-rule-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:R}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:y&&m?t(ds,{}):t(V,{$gap:16,children:e(yt,{bgTint:"1000",children:[e(yt,{bgTint:"900",children:[t(Ct,{conditions:$.conditions||[]}),t(yt,{bgTint:"800",cellsPerRow:2,items:(_=$,M=N,[{id:"type",title:Re.TYPE,label:M.label},{id:"status",title:Re.STATUS,badge:{status:_.disabled?st.Unknown:ge.Success,label:_.disabled?Re.DISABLED:Re.ENABLED}},{id:"name",title:Re.NAME,label:_.ruleName||"-"},{id:"profile",title:Re.MANAGED_BY_PROFILE,label:_.profileName||"-"},{id:"notes",title:Re.NOTES,label:_.notes||"-"}])})]}),!!L.length&&t(yt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",children:L})}),!!N.supportedLanguages.length&&t(yt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(yt,{bgTint:"800",children:t(te,{$gap:12,$wrap:"wrap",children:N.supportedLanguages.map(e=>t(Et,{label:Oe[e],leftIcon:Ae(e),flex:"0.5"},e))})})})]})})})}),t(gl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:P}),t(fl,{isOpen:null!==x,onClose:()=>k(null),onApprove:D})]});var _,M};var cr;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(cr||(cr={}));const dr=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:a,podName:i,nodeName:l,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=At(),m=Dt(!!o),g=r(()=>({title:i,icon:ki,withCopy:!0}),[i]),f=r(()=>{const e=[],t=Rt(c);t&&e.push(t);const o=Rt(d,Ti,"health");o&&e.push(o);const n=Rt(u,$i,"health");return n&&e.push(n),e},[c,d,u]),b=r(()=>n?[{id:`restart-pod-${i}`,icon:Ni,label:bt.RESTART_POD,onClick:()=>n(a,i)}]:void 0,[n,a,i]),v=r(()=>[{id:"nodeName",title:Re.NODE,label:l,withCopy:!0},{id:"age",title:Re.AGE,label:s?h(s,{style:"short"}):Re.NOT_RUNNING,labelTooltip:s}],[l,s,h]);return t("div",{ref:m,children:t(yt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},ur=g.div`
191
+ `,Es=({clusterId:o,namespaceName:n,checkbox:a,isFutureApps:i,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=y(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(Ts,{children:t(qr,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:a.partial,isChecked:a.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(oe,{$gap:12,children:[!d&&t($s,{$visible:r||i,children:t(Ie,{text:Cs,children:t(K,{label:ys,labelAlign:Y.Left,size:gt.S,value:i,onChange:e=>u({auto:e,all:e||void 0})})})}),e(oe,{$gap:8,children:[t(Q,{variant:mt.Span,size:te.XXXS,color:ee.Secondary,align:"right",children:vs}),t(Fe,{label:`${l.sourced}/${l.total}`,status:r?we.Default:pt.Unknown,minWidth:"42px"})]})]})})})},Is=({withCollapse:e,clusterId:o,clusterName:n,namespaces:i,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=a(()=>i.map(({name:e,totalWorkloads:a,selectedCount:i,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(Es,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:i,total:a},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,i,l]);return e?t(os,{title:n,list:c,noBgColor:!0}):c},Ns=({onClose:o,onBack:i,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,persistSources:d,getAllClusterSnapshots:u,fetchNamespacesWithWorkloads:p,withOverlay:h,disableAnimation:g})=>{const{isVm:m}=y(),f=ps(m),{selectedStreamName:b}=Be(),{progress:v,resetProgress:C}=ft(),{isFetching:S,setIsFetching:w,setSnapshots:x,formData:k,handleSourceChange:T,handleSelectAll:$,formDiff:E,isFormDirty:I}=Rl();n(()=>{let e=!1;w(!0);return(async()=>{try{if(u){const t=await u();!e&&t&&x(t)}else if(p){const t=await p();if(!e&&t.data?.length){const e={clusters:[{clusterId:yt,clusterName:vt,namespaces:t.data.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(b),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:e.markedForInstrumentation?.markedForInstrumentation??!1}))||[]}))}]};x(e)}}}catch(e){}finally{e||w(!1)}})(),()=>{e=!0}},[b]);const[N,A]=r(""),[O,D]=r(ut.Namespace),[R,P]=r({showOnlySelected:!1}),[F,L]=r({clusterId:"",clusterName:"",namespaceName:""}),_=(({isFetching:o,formData:n,handleSourceChange:i,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=y(),h=ps(p),g=a(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ol(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Dl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),m=a(()=>{let e=!1;for(const{visibleNamespaces:t}of g)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[g]),{list:f,withFilterCount:b,filteredCount:v,totalCount:C}=a(()=>{const e=g.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Is,{withCollapse:g.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:i},e):null),o=e.filter(e=>null!==e);return{list:o,withFilterCount:o.length!==e.length,filteredCount:o.length,totalCount:e.length}},[g,r]);return{width:"60%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ie,{text:b?Me.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${b?`${v} / ${C}`:C}`,status:pt.Unknown})})]}),t(Q,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!m,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:te.XS,children:fs(m)})]}),list:f.length?f:o?[t(Qe,{$height:"100%",children:t(at,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(Qe,{$height:"100%",children:t(me,c?{icon:ki,title:hs,subTitle:h.noGroupMatchedFilter(c)}:{icon:ki,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:S,formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:F,setSelectedArea:L,searchText:O===ut.Namespace?N:"",searchBy:O,filters:R}),z=(({formData:o,handleSourceChange:n,handleSelectAll:i,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=y(),p=ps(u),h=d===ht.Onprem,g=a(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),m=a(()=>g?[...g.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Nl(e,r,c)):[],[g,r,c]),f=a(()=>!!m.length&&m.every(({selected:e})=>e),[m]),b=a(()=>{if(!g)return[];const{clusterId:e}=l.value,{name:o}=g;return m.map(({name:a,selected:i,kind:l})=>{const r=!u&&!h&&Al.has(l);return t(ks,{workloadName:a,workloadKind:l,isChecked:!r&&(i||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:a,kind:l}}),disabled:r,disabledReason:Ss},`${e}#${o}#${a}#${l}`)})},[m,g,l.value.clusterId]),{withFilterCount:v,filteredCount:C,totalCount:S}=a(()=>{const e=g?.workloads.length??0;return{withFilterCount:m.length!==e,filteredCount:m.length,totalCount:e}},[m,g]);return{width:"40%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(Ie,{text:v?Me.FILTERED_COUNT_TOOLTIP:void 0,children:t(Fe,{label:`${v?`${C} / ${S}`:S}`,status:pt.Unknown})})]}),t(Q,{"data-id":"workloads-select-all",onClick:()=>i({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:te.XS,children:fs(f)})]}),list:b.length?b:[t(Qe,{$height:"100%",children:t(me,g?r?{icon:xi,title:hs,subTitle:ms(r)}:{icon:xi,title:gs,subTitle:p.noItemsInGroupSubTitle}:{icon:xi,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]}})({formData:k,handleSourceChange:T,handleSelectAll:$,selectedArea:{value:F},searchText:O===ut.Source?N:"",searchBy:O,filters:R});return t(ml,{isOpen:!0,withOverlay:h,disableAnimation:g,onClose:o?()=>{C(bt.BulkInstrumenting),o()}:void 0,onBack:i?()=>i(E):void 0,onNext:l?()=>l(E):void 0,nextIsSkip:!I,onSave:()=>d(E),header:{icon:xi,title:Me.ADD_SOURCE,subTitle:Me.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:N,onChange:e=>{A(e),O===ut.Namespace&&L({clusterId:"",clusterName:"",namespaceName:""})},placeholder:f.searchPlaceholder(O),segment:{options:[{label:f.groupSegmentLabel,value:ut.Namespace},{label:f.itemSegmentLabel,value:ut.Source}],selected:O,setSelected:D}},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:bs}),t(K,{name:"filter-selected",size:gt.S,label:vs,value:R.showOnlySelected,onChange:e=>P(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:I,isFetching:S,progress:{title:Me.CREATING_SOURCES,subTitle:Me.CREATING_SOURCES_SUBTITLE,percentage:v[bt.BulkInstrumenting]?.percentage||0},leftColumn:_,rightColumn:z})},As=(e,t)=>{const o=[{id:"type",title:Me.TYPE,label:t.label},{id:"status",title:Me.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Me.DISABLED:Me.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Me.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Me.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Me.NOTES,label:e.notes}),o},Os=({onClose:i,actionId:s,updateAction:c,deleteAction:d})=>{const u=f(),{actions:p}=ct(),{selectedOption:h,loadAction:g,validateFormData:m,genericForm:b}=wl(),[v,y]=r(!1),[C,S]=r(!1),[w,x]=r(null),k=v&&!!b?.isFormDirty,T=a(()=>p?.find(e=>Ct(e)===s),[s,p]),$=a(()=>Ze.find(({type:e})=>e===T?.type)??null,[T?.type]);n(()=>{T&&g(T)},[T]);const E=l(()=>{T&&y(!0)},[T]),I=l(()=>{T&&(g(T),y(!1))},[T,g]),N=l(()=>{k?x("close"):i()},[k,i]),A=l(()=>{k?x("cancel"):I()},[k,I]),O=l(()=>{const e=w;x(null),"close"===e?(I(),i()):I()},[w,I,i]),D=l(async()=>{if(T){const{errorMessage:e,preparedFormData:t}=m();e||(await c(T.id,t),y(!1))}},[T,m,c]),R=l(()=>{T&&S(!0)},[T]),P=l(async()=>{T&&(await d(T.id,T.type),i())},[T,d,i]);if(!T||!$)return null;const F=(e=>{const t=[],{type:o,fields:n}=e,a=e=>({status:e?we.Success:pt.Unknown,label:e?"True":"False",invertColors:!0});return o===ge.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:a(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:a(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:a(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:a(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:a,fromSources:i},l)=>{const r=i?.length?i.join(", "):a||W.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===ge.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:a(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===ge.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===ge.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===ge.ExtractAttribute&&n.extractions?.forEach(({targetAttributeName:e,lookupKey:o,dataFormat:a,regex:i},l)=>{const r=(n.extractions?.length??0)>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:e||"-"}),o&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:o}),a&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:a}),i&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:i})}),o===ge.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const a=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${a}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,i)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${i}`,title:`${a}Workload${(e.workloadFilters?.length??0)>1?` #${i+1}`:""}`,label:l})});const i=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");i&&t.push({id:`group-${o}-templates`,title:`${a}Templates`,label:i}),e.notes&&t.push({id:`group-${o}-notes`,title:`${a}Notes`,label:e.notes})}),t})(T);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Tt(T.type),title:$.label,onClose:N,actions:[{id:"edit-action-btn-edit",label:St.EDIT,icon:pi,active:v,onClick:E},{id:"edit-action-btn-delete",label:St.DELETE,icon:ii,color:u.v2.colors.red[500],active:C,onClick:R}]},footer:{actions:v?[{"data-id":"edit-action-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:A},{"data-id":"edit-action-btn-save",label:St.SAVE,variant:ie.Primary,onClick:D}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:v&&h?t(Tr,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(kt,{conditions:T.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:As(T,$)})]}),!!F?.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",cellsPerRow:2,items:F})})]})})})}),t(fl,{target:"action",isOpen:C,onClose:()=>S(!1),onApprove:P}),t(bl,{isOpen:null!==w,onClose:()=>x(null),onApprove:O})]})},Ds=({onClose:o,connections:i,selectedConnectionIds:l,setSelectedConnectionIds:s,getEffectiveConfig:c,onApply:d})=>{const[u,p]=r(""),[h,g]=r({showOnlySelected:!1}),m=a(()=>i.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&l.includes(e.id);return t&&o}),[i.length,l.length,u,h]),f=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[b,v]=r(!1),[y,C]=r(void 0),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=$t(y||{rollout:{automaticRolloutDisabled:!1}}),T=a(()=>l.length>1||void 0!==y&&!x(y,S),[l.length,y,S]);return n(()=>{1===l.length?(async e=>{if(b)return;v(!0);const t=await c(e);if(t){const e={rollout:{automaticRolloutDisabled:t.rollout?.automaticRolloutDisabled??!1}};C(e),k(e)}v(!1)})(l[0]):C(void 0)},[l.length]),t(ml,{isOpen:!0,onClose:o,onSave:()=>d(S,l),header:{icon:Ti,title:"Cluster Configuration"},connectionIds:{value:l,setValue:s},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:"Show only:"}),t(K,{size:gt.S,label:"Selected",value:h.showOnlySelected,onChange:e=>g(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:T,isFetching:b,leftColumn:{width:"35%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(Q,{size:te.XS,children:"Clusters"}),t(Fe,{label:m.length,status:pt.Unknown})]}),e(oe,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,align:"right",children:"Selected clusters"}),t(Fe,{label:`${l.length}/${m.length}`,status:pt.Unknown})]})]}),list:m.map(e=>t(qr,{title:e.name,isChecked:l.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(Q,{size:te.XS,children:"Configurations"}),list:[t(K,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Rs=e=>{const t=[{id:"type",title:Me.TYPE,label:e.destinationType.displayName},{id:"status",title:Me.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Me.DISABLED:Me.ENABLED}}],o=ke(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Me.MONITORS,label:o}),e.name&&t.push({id:"name",title:Me.NAME,label:e.name}),t},Ps=({onClose:s,destinationId:c,getDestinationCategories:d,testConnection:u,updateDestination:p,deleteDestination:h})=>{const g=f(),{isVm:m}=y(),{destinations:b}=ct(),{selectedStreamName:v}=Be(),{activeForm:C,loadDestination:S,validateFormData:w,genericForm:x}=xl(),k=i(null),[T,$]=r(!1),[E,I]=r(!1),[N,A]=r(null),[O,D]=r(!0),[R,P]=r(null),F=T&&!!x?.isFormDirty,L=a(()=>Nt(b,v),[b,v]),_=a(()=>L?.find(e=>Ct(e)===c),[c,L]);n(()=>{let e=!1;return D(!0),d().then(t=>{e||A(t?.destinationCategories.categories??[])}).catch(t=>{e||A([])}).finally(()=>{e||D(!1)}),()=>{e=!0}},[]),n(()=>{_&&N&&S(_,N)},[_,N]);const z=a(()=>_&&N?At(N,_):[],[_,N]),M=l(()=>{_&&$(!0)},[_]),B=l(()=>{_&&N&&(S(_,N),$(!1))},[_,N,S]),X=l(()=>{F?P("close"):s()},[F,s]),U=l(()=>{F?P("cancel"):B()},[F,B]),H=l(()=>{const e=R;P(null),"close"===e?(B(),s()):B()},[R,B,s]),j=l(async()=>{if(_){const{errorMessage:e,preparedFormData:t}=w();e||(await p(_.id,$e(t)),$(!1))}},[_,w,p]),G=l(()=>{_&&I(!0)},[_]),W=l(async()=>{_&&(await h(_.id),s())},[_,h,s]);if(!_)return null;const{icon:K,iconSrc:Y}=lt(_.destinationType.type),J=((e,t)=>{const o=[],n=Et(e,t),a=n.map(e=>({name:e.key,value:e.value})),i=ke(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:g}=c||{};if(h?.length&&Ce(h,i,a))return;const{type:m}=st(p,{type:""}),f=d||"password"===m;if(g?.length)g.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===It.MultiInput){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===It.KeyValuePair){const t=st(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(_,z);return e(o,{children:[t(q,{isOpen:!0,header:{icon:K,iconSrc:Y,title:_.name||_.destinationType.displayName,onClose:X,actions:[{id:"edit-destination-btn-edit",label:St.EDIT,icon:pi,active:T,onClick:M},{id:"edit-destination-btn-delete",label:St.DELETE,icon:ii,color:g.v2.colors.red[500],active:E,onClick:G}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:U},...C?.option.testConnectionSupported&&!m?[{"data-id":"edit-destination-btn-test-connection",label:St.TEST_CONNECTION,variant:ie.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:St.SAVE,variant:ie.Primary,onClick:j}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:O?t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})}):T&&C?t(Ir,{ref:k,isEdit:!0,testConnection:u}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[!m&&t(kt,{conditions:_.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Rs(_)})]}),!!J.length&&t(xt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:J.map(e=>"cells"===e.kind?t(xt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(xt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(fl,{target:"destination",isOpen:E,onClose:()=>I(!1),onApprove:W}),t(bl,{isOpen:null!==R,onClose:()=>P(null),onApprove:H})]})},Fs=(e,t)=>{const o=[{id:"type",title:Me.TYPE,label:t.label},{id:"status",title:Me.STATUS,badge:{status:e.disabled?pt.Unknown:we.Success,label:e.disabled?Me.DISABLED:Me.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Me.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Me.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Me.NOTES,label:e.notes}),o},Ls=({onClose:i,ruleId:s,updateInstrumentationRule:c,deleteInstrumentationRule:d})=>{const u=f(),{instrumentationRules:p}=ct(),{addNotification:h}=Dt(),{selectedOption:g,loadRule:m,validateFormData:b,genericForm:v}=kl(),[y,C]=r(!1),[S,w]=r(!1),[x,k]=r(null),T=y&&!!v?.isFormDirty,$=a(()=>p?.find(e=>Ct(e)===s),[s,p]),E=a(()=>dt.find(({type:e})=>e===$?.type)??null,[$?.type]);n(()=>{$&&m($)},[$]);const I=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_EDIT_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});C(!0)}},[$,h]),N=l(()=>{$&&(m($),C(!1))},[$,m]),A=l(()=>{T?k("close"):i()},[T,i]),O=l(()=>{T?k("cancel"):N()},[T,N]),D=l(()=>{const e=x;k(null),"close"===e?(N(),i()):N()},[x,N,i]),R=l(async()=>{if($){const{errorMessage:e,preparedFormData:t}=b();e||(await c($.ruleId,t),C(!1))}},[$,b,c]),P=l(()=>{if($){if(!$.mutable)return void h({type:we.Warning,title:Rt.FORBIDDEN,message:Rt.CANNOT_DELETE_RULE,crdType:ut.InstrumentationRule,target:$.ruleId,hideFromHistory:!0});w(!0)}},[$,h]),F=l(async()=>{$&&(await d($.ruleId),i())},[$,d,i]);if(!$||!E)return null;const L=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(Q,{size:te.XS,children:`• ${Ot(e).toLowerCase()}`},e))}),e.headersCollection?.[Ne.HeaderKeys]?.length&&e.headersCollection[Ne.HeaderKeys].forEach(e=>{e&&n.push(t(Q,{size:te.XS,children:e},e))}),e.customInstrumentations&&(e.customInstrumentations[Re.Java]?.forEach((e,a)=>{const i=new De(e.className,e.methodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}}),e.customInstrumentations[Re.Golang]?.forEach((e,a)=>{const i=new Oe(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(i.Verify()){0===a&&n.push(t(Q,{size:te.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=i.toString();n.push(t(Q,{size:te.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},e))}})),n})($,u);return e(o,{children:[t(q,{isOpen:!0,header:{icon:Ft($.type),title:E.label,onClose:A,actions:[{id:"edit-rule-btn-edit",label:St.EDIT,icon:pi,active:y,onClick:I},{id:"edit-rule-btn-delete",label:St.DELETE,icon:ii,color:u.v2.colors.red[500],active:S,onClick:P}]},footer:{actions:y?[{"data-id":"edit-rule-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:O},{"data-id":"edit-rule-btn-save",label:St.SAVE,variant:ie.Primary,onClick:R}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:y&&g?t(Lr,{}):t(V,{$gap:16,children:e(xt,{bgTint:"1000",children:[e(xt,{bgTint:"900",children:[t(kt,{conditions:$.conditions||[]}),t(xt,{bgTint:"800",cellsPerRow:2,items:Fs($,E)})]}),!!L.length&&t(xt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:L})}),!!E.supportedLanguages.length&&t(xt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(xt,{bgTint:"800",children:t(oe,{$gap:12,$wrap:"wrap",children:E.supportedLanguages.map(e=>t(Pt,{label:Le[e],leftIcon:_e(e),flex:"0.5"},e))})})})]})})})}),t(fl,{target:"instrumentation rule",isOpen:S,onClose:()=>w(!1),onApprove:F}),t(bl,{isOpen:null!==x,onClose:()=>k(null),onApprove:D})]})};var _s;!function(e){e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Debug="debug"}(_s||(_s={}));const zs=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:i,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Lt(),g=_t(!!o),m=a(()=>({title:l,icon:$i,withCopy:!0}),[l]),f=a(()=>{const e=[],t=zt(c);t&&e.push(t);const o=zt(d,Ei,"health");o&&e.push(o);const n=zt(u,Ii,"health");return n&&e.push(n),e},[c,d,u]),b=a(()=>n?[{id:`restart-pod-${l}`,icon:Ni,label:St.RESTART_POD,onClick:()=>n(i,l)}]:void 0,[n,i,l]),v=a(()=>[{id:"nodeName",title:Me.NODE,label:r,withCopy:!0},{id:"age",title:Me.AGE,label:s?h(s,{style:"short"}):Me.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:g,children:t(xt,{bgTint:"900",richTitle:m,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Ms=m.div`
81
192
  display: flex;
82
193
  align-items: center;
83
194
  justify-content: space-between;
@@ -85,7 +196,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
85
196
  padding: ${({$noPadding:e})=>e?"0":"12px"};
86
197
  border-radius: 12px;
87
198
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
88
- `,pr=({podsOdigosHealthStatus:o,pods:n,noPadding:a})=>{const i=Lt(o?.status),l=$t(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=r(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Ft.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Ft.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Ft.Success?1:0),0)||0}),[n]);return n?.length&&o&&i?e(ur,{$noPadding:a,children:[t(Pt,{invertColors:!0,hideBackground:!0,status:i,title:l,subTitle:s}),e(te,{$gap:8,children:[t(mr,{label:Re.PODS,count:c}),t(mr,{label:Re.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(mr,{label:Re.ODIGOS_HEALTHY,icon:Ti,count:u,total:c}),t(mr,{label:Re.KUBERNETES_HEALTHY,icon:$i,count:p,total:c})]})]}):null},hr=g.div`
199
+ `,Bs=({podsOdigosHealthStatus:o,pods:n,noPadding:i})=>{const l=Xt(o?.status),r=Ot(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=a(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Mt.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Mt.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Mt.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Ms,{$noPadding:i,children:[t(Bt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(oe,{$gap:8,children:[t(Vs,{label:Me.PODS,count:c}),t(Vs,{label:Me.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Vs,{label:Me.ODIGOS_HEALTHY,icon:Ei,count:u,total:c}),t(Vs,{label:Me.KUBERNETES_HEALTHY,icon:Ii,count:p,total:c})]})]}):null},Xs=m.div`
89
200
  display: flex;
90
201
  flex-direction: column;
91
202
  justify-content: center;
@@ -96,7 +207,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
96
207
  width: fit-content;
97
208
  border-radius: 8px;
98
209
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
99
- `,mr=({count:o,total:n,label:a,icon:i})=>{const l=f(),s=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(hr,{children:[e(te,{$gap:0,$alignItems:"flex-end",children:[t(re,{size:ce.L,color:s,weight:500,nowrap:!0,children:o}),void 0!==n&&t(re,{size:ce.S,color:s,weight:500,nowrap:!0,children:`/${n}`})]}),e(te,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(re,{size:ce.XXXS,nowrap:!0,children:a})]})]})},gr=12,fr=24,br=12,vr=24,yr=40,Cr=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===_t.PID)??e.identifyingAttributes?.find(({name:e})=>e===_t.VPID);return t?.value??null};var Sr;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(Sr||(Sr={}));const wr=({overrideProcessNum:o,healthy:a,healthStatus:i,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=l(Sr.IdentifyingAttributes),m=Dt(!!d),{tabOptions:g,firstTabValue:b,bothTabsDisabled:v}=r(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Sr.IdentifyingAttributes,label:Re.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Sr.InstrumentationLibraries,label:Re.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Ii,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[s,c]);n(()=>{b&&h(b)},[b]);const y=r(()=>{switch(p){case Sr.IdentifyingAttributes:return t(V,{children:s?.map(e=>t(kr,{label:e.name,value:e.value},e.name))});case Sr.InstrumentationLibraries:return t(V,{children:c?.map(e=>t(kr,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[p,s,c]),C=r(()=>Cr({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return t("div",{ref:m,children:e(yt,{bgTint:"800",richTitle:{title:C?`${Re.PROCESS} ${Re.PID(C)}`:Re.PROCESS_FALLBACK_NAME},renderOnRightSide:t(re,{color:a?Ce.Success:Ce.Error,size:ce.XXXS,children:i?.message}),badges:[{key:"odigos-healthy",status:a?ge.Success:ge.Error,leftIcon:Ti,label:a?Re.HEALTHY:Re.NOT_HEALTHY,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(ue,{options:g,selected:p,setSelected:h}),!v&&y]})})},xr=g.div`
210
+ `,Vs=({count:o,total:n,label:a,icon:i})=>{const l=f(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Xs,{children:[e(oe,{$gap:0,$alignItems:"flex-end",children:[t(Q,{size:te.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(Q,{size:te.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(oe,{$alignItems:"center",$gap:4,children:[i&&t(i,{size:16}),t(Q,{size:te.XXXS,nowrap:!0,children:a})]})]})},Us=12,Hs=24,js=12,Gs=24,Ws=40,Ks=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===Vt.PID)??e.identifyingAttributes?.find(({name:e})=>e===Vt.VPID);return t?.value??null};var Ys;!function(e){e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"}(Ys||(Ys={}));const Js=({overrideProcessNum:o,healthy:i,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=f(),[p,h]=r(Ys.IdentifyingAttributes),g=_t(!!d),{tabOptions:m,firstTabValue:b,bothTabsDisabled:v}=a(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Ys.IdentifyingAttributes,label:Me.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Ys.InstrumentationLibraries,label:Me.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Ai,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[s,c]);n(()=>{b&&h(b)},[b]);const y=a(()=>{switch(p){case Ys.IdentifyingAttributes:return t(V,{children:s?.map(e=>t(Zs,{label:e.name,value:e.value},e.name))});case Ys.InstrumentationLibraries:return t(V,{children:c?.map(e=>t(Zs,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},e.name))});default:return null}},[p,s,c]),C=a(()=>Ks({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return t("div",{ref:g,children:e(xt,{bgTint:"800",richTitle:{title:C?`${Me.PROCESS} ${Me.PID(C)}`:Me.PROCESS_FALLBACK_NAME},renderOnRightSide:t(Q,{color:i?ee.Success:ee.Error,size:te.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:i?we.Success:we.Error,leftIcon:Ei,label:i?Me.HEALTHY:Me.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(le,{options:m,selected:p,setSelected:h}),!v&&y]})})},qs=m.div`
100
211
  display: flex;
101
212
  align-items: center;
102
213
  justify-content: space-between;
@@ -105,14 +216,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
105
216
  &:hover {
106
217
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
107
218
  }
108
- `,kr=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const s="boolean"==typeof i;return e(xr,{children:[t(re,{size:ce.XXS,color:Ce.Secondary,children:o}),n&&t(re,{size:ce.XXS,color:Ce.Primary,children:n}),(s||a)&&e(te,{children:[a&&t(Ee,{status:ge.Info,label:Re.STANDARD,textSize:ce.XXXS,invertColors:!0}),s&&t(Ee,{status:i?ge.Success:ge.Error,label:i?Re.HEALTHY:Re.NOT_HEALTHY,textSize:ce.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Tr=p(null),$r=({value:e,children:o})=>t(Tr.Provider,{value:e,children:o}),Nr=()=>{const e=h(Tr);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e},Ir=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const a=e??[],i=r(()=>({title:Re.CONTAINERS,titleSize:ce.XS,badge:{label:a.length}}),[a.length]),l=r(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(yt,{bgTint:"800",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:a.map(e=>{const o=n?.containerName===e.containerName;return t(Or,{...e,language:Mt(l.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},Er=g.div`
219
+ `,Zs=({label:o,value:n,isStandardLibrary:a,healthy:i,message:l})=>{const r="boolean"==typeof i;return e(qs,{children:[t(Q,{size:te.XXS,color:ee.Secondary,children:o}),n&&t(Q,{size:te.XXS,color:ee.Primary,children:n}),(r||a)&&e(oe,{children:[a&&t(Fe,{status:we.Info,label:Me.STANDARD,textSize:te.XXXS,invertColors:!0}),r&&t(Fe,{status:i?we.Success:we.Error,label:i?Me.HEALTHY:Me.NOT_HEALTHY,textSize:te.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Qs=p(null),ec=({value:e,children:o})=>t(Qs.Provider,{value:e,children:o}),tc=()=>{const e=h(Qs);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e},oc=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const i=e??[],l=a(()=>({title:Me.CONTAINERS,titleSize:te.XS,badge:{label:i.length}}),[i.length]),r=a(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(xt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:i.map(e=>{const o=n?.containerName===e.containerName;return t(ac,{...e,language:Ut(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},nc=m.div`
109
220
  display: flex;
110
221
  flex-direction: column;
111
222
  gap: 12px;
112
223
  padding: 8px 12px;
113
224
  border-radius: 8px;
114
225
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
115
- `,Or=({language:o,containerName:n,otelDistroName:a,runningStartedTime:i,started:l,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}=At(),C=Dt(v),S=r(()=>({title:n,icon:o?Ae(o):Ei,iconWithWrapper:!0}),[n,o]),w=r(()=>{const e=[],t=Rt({status:a?Ft.Success:Ft.Disabled,reasonEnum:a?Re.INSTRUMENTED_WITH_DISTRO(a):Re.UNINSTRUMENTED,message:""});t&&e.push(t);const o=Rt(h,Ti,"health");o&&e.push(o);const n=Rt(m,$i,"health");return n&&e.push(n),e},[m,h,a]),x=r(()=>[{id:"runningTime",title:Re.RUNNING_TIME,label:i?y(i,{style:"short"}):Re.NOT_RUNNING,labelTooltip:`${Re.RUNNING_TIME_TOOLTIP}. (${i})`},{id:"blank",spacer:!0},{id:"started",badge:{status:l?ge.Success:Bt.Disabled,leftIcon:l?si:ri,label:l?Re.STARTED:Re.NOT_STARTED,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?ge.Success:Bt.Disabled,leftIcon:s?si:ri,label:s?Re.READY:Re.NOT_READY,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?ge.Error:ge.Success,leftIcon:d?ri:si,label:d?Re.CRASHLOOP:Re.NO_CRASHLOOP,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Re.RESTARTS,badge:{status:c?ge.Error:void 0,label:c||0,textSize:ce.XXXS}}],[i,y,l,s,d,c]),k=r(()=>p?$t(u):"",[p,u]);return t("div",{ref:C,children:e(yt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(Er,{children:e(te,{$gap:10,$alignItems:"center",children:[t(Et,{variant:zt.Pink,leftIcon:$i,label:k}),t(re,{size:ce.XXXS,color:Ce.Error,children:p})]})}),(g??[]).map((e,o)=>{const a=o+1,i=b&&(l=f,s=e,!!l?.processPid&&Cr({identifyingAttributes:s.identifyingAttributes})===l.processPid);var l,s;return t(wr,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},Ar=({podName:e,namespace:o,hasRestarted:n})=>{const a=r(()=>({title:Re.DEBUG_COMMANDS,titleSize:ce.XS}),[]),i=r(()=>[{label:Re.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Re.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Re.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(yt,{bgTint:"800",richTitle:a,withCollapse:!0,children:i.map(({label:e,value:o})=>t(Xt,{bgTint:"700",label:e,value:o},e))})},Dr=({source:n,onClickRestartPod:a})=>{const{jumpToTarget:i}=Nr(),l=i?.tab===cr.Pods?i:null,s=n?.pods??[],c=s.length>0,d=r(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=r(()=>({title:Re.PODS,badge:{label:s.length}}),[s.length]);return t(V,{$gap:12,children:c?e(o,{children:[t(pr,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(yt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const i=l?.podName===o.podName,s=i&&!l?.containerName;return e(dr,{...o,namespace:n.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:i,isJumpToTarget:s,children:[t(Ar,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(Ir,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:i?l:null})]},`pod-${o.podName}`)})})]}):t(Ke,{$height:"70vh",children:t(se,{title:Re.NO_RUNNING_PODS,subTitle:Re.NO_RUNNING_PODS_SUBTITLE})})})},Rr=({source:o,fetchPeerSources:a})=>{const i=r(()=>o.serviceName||o.id.name,[o]),[s,d]=l(!1),[u,p]=l(null),h=c(()=>{d(!0),a(i).then(({data:e})=>p(e?.peerSources??null)).finally(()=>d(!1))},[i]);return n(()=>{h()},[h]),!u||s?t(Ke,s?{$height:"70vh",children:t(Qe,{withSpinner:!0})}:{$height:"70vh",children:t(se,{subTitle:Re.COULD_NOT_FETCH_PEER_SOURCES})}):e(te,{$gap:16,$alignItems:"flex-start",children:[t(Fr,{icon:Oi,title:Re.INBOUND,subTitle:Re.INBOUND_DESCRIPTION(i),onRefresh:h,items:u?.inbound??[]}),t(Fr,{icon:Ai,title:Re.OUTBOUND,subTitle:Re.OUTBOUND_DESCRIPTION(i),onRefresh:h,items:u?.outbound??[]})]})},Fr=({icon:o,title:n,subTitle:a,onRefresh:i,items:s})=>{const[c,d]=l(""),u=r(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(yt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:ce.XS,subTitle:a,subTitleSize:ce.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:Vt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,leftIcon:Ni,onClick:i}}],children:[t(Ut,{value:c,onChange:d,width:"100%"}),t(Ht,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(Ke,{$height:"50vh",children:t(se,{icon:o,title:Re.NO_RESULTS,subTitle:Re.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(Lr,{...e},`${n}-${e.serviceName}`)):[t(Ke,{$height:"50vh",children:t(se,{icon:o,title:`No ${n} connections yet`,subTitle:n===Re.INBOUND?Re.NO_INBOUND_CONNECTIONS_DESCRIPTION:Re.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Pr=g.div`
226
+ `,ac=({language:o,containerName:n,otelDistroName:i,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:g,processes:m,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Lt(),C=_t(v),S=a(()=>({title:n,icon:o?_e(o):Oi,iconWithWrapper:!0}),[n,o]),w=a(()=>{const e=[],t=zt({status:i?Mt.Success:Mt.Disabled,reasonEnum:i?Me.INSTRUMENTED_WITH_DISTRO(i):Me.UNINSTRUMENTED,message:""});t&&e.push(t);const o=zt(h,Ei,"health");o&&e.push(o);const n=zt(g,Ii,"health");return n&&e.push(n),e},[g,h,i]),x=a(()=>[{id:"runningTime",title:Me.RUNNING_TIME,label:l?y(l,{style:"short"}):Me.NOT_RUNNING,labelTooltip:`${Me.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?we.Success:Ht.Disabled,leftIcon:r?si:ci,label:r?Me.STARTED:Me.NOT_STARTED,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?we.Success:Ht.Disabled,leftIcon:s?si:ci,label:s?Me.READY:Me.NOT_READY,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?we.Error:we.Success,leftIcon:d?ci:si,label:d?Me.CRASHLOOP:Me.NO_CRASHLOOP,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Me.RESTARTS,badge:{status:c?we.Error:void 0,label:c||0,textSize:te.XXXS}}],[l,y,r,s,d,c]),k=a(()=>p?Ot(u):"",[p,u]);return t("div",{ref:C,children:e(xt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(nc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:jt.Pink,leftIcon:Ii,label:k}),t(Q,{size:te.XXXS,color:ee.Error,children:p})]})}),(m??[]).map((e,o)=>{const a=o+1,i=b&&(l=f,r=e,!!l?.processPid&&Ks({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Js,{...e,overrideProcessNum:a,isJumpToTarget:i},`pod-container-${n}-process-${a}`)})]})})},ic=({podName:e,namespace:o,hasRestarted:n})=>{const i=a(()=>({title:Me.DEBUG_COMMANDS,titleSize:te.XS}),[]),l=a(()=>[{label:Me.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Me.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Me.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(xt,{bgTint:"800",richTitle:i,withCollapse:!0,children:l.map(({label:e,value:o})=>t(Gt,{bgTint:"700",label:e,value:o},e))})},lc=({source:n,onClickRestartPod:i})=>{const{jumpToTarget:l}=tc(),r=l?.tab===_s.Pods?l:null,s=n?.pods??[],c=s.length>0,d=a(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=a(()=>({title:Me.PODS,badge:{label:s.length}}),[s.length]);return t(V,{$gap:12,children:c?e(o,{children:[t(Bs,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(xt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const a=r?.podName===o.podName,l=a&&!r?.containerName;return e(zs,{...o,namespace:n.id.namespace,onClickRestartPod:i,collapseIsDefaultOpen:a,isJumpToTarget:l,children:[t(ic,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(oc,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:a?r:null})]},`pod-${o.podName}`)})})]}):t(Qe,{$height:"70vh",children:t(me,{title:Me.NO_RUNNING_PODS,subTitle:Me.NO_RUNNING_PODS_SUBTITLE})})})},rc=({source:o,fetchPeerSources:i})=>{const s=a(()=>o.serviceName||o.id.name,[o]),[c,d]=r(!1),[u,p]=r(null),h=l(()=>{d(!0),i(s).then(({data:e})=>p(e?.peerSources??null)).finally(()=>d(!1))},[s]);return n(()=>{h()},[h]),!u||c?t(Qe,c?{$height:"70vh",children:t(at,{withSpinner:!0})}:{$height:"70vh",children:t(me,{subTitle:Me.COULD_NOT_FETCH_PEER_SOURCES})}):e(oe,{$gap:16,$alignItems:"flex-start",children:[t(sc,{icon:Di,title:Me.INBOUND,subTitle:Me.INBOUND_DESCRIPTION(s),onRefresh:h,items:u?.inbound??[]}),t(sc,{icon:Ri,title:Me.OUTBOUND,subTitle:Me.OUTBOUND_DESCRIPTION(s),onRefresh:h,items:u?.outbound??[]})]})},sc=({icon:o,title:n,subTitle:i,onRefresh:l,items:s})=>{const[c,d]=r(""),u=a(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(xt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:te.XS,subTitle:i,subTitleSize:te.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ni,onClick:l}}],children:[t(Kt,{value:c,onChange:d,width:"100%"}),t(Yt,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(Qe,{$height:"50vh",children:t(me,{icon:o,title:Me.NO_RESULTS,subTitle:Me.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(dc,{...e},`${n}-${e.serviceName}`)):[t(Qe,{$height:"50vh",children:t(me,{icon:o,title:`No ${n} connections yet`,subTitle:n===Me.INBOUND?Me.NO_INBOUND_CONNECTIONS_DESCRIPTION:Me.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},cc=m.div`
116
227
  display: flex;
117
228
  align-items: center;
118
229
  justify-content: space-between;
@@ -126,7 +237,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
126
237
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
127
238
  }
128
239
  `}
129
- `,Lr=({serviceName:o,isVirtual:n,nodeAttributes:a})=>{const i=jt(e=>e.drawerEntityId),l=at(e=>e.sources),s=r(()=>l.find(e=>e.id.name===o||e.serviceName===o),[l,o]),c=r(()=>s&&JSON.stringify(Wt(s))!==JSON.stringify(Wt(i)),[s,i]),d=r(()=>{if(n){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[Gt({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[Di];const e=s?Kt(s):void 0;return e?.length?e:[Ei]},[n,a,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=jt.getState();e(lt.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Pr,{onClick:u,$withClick:!!u,children:[e(te,{$gap:8,children:[t(Yt,{icons:d}),t(re,{size:ce.XXS,children:o})]}),n&&t(Ee,{status:ge.Info,label:Re.VIRTUAL,textSize:ce.XXXS,invertColors:!0,tooltip:Re.VIRTUAL_TOOLTIP})]})},_r=({title:o,children:n})=>e(V,{$gap:8,children:[t(re,{size:ce.XXXS,color:Ce.Secondary,children:o}),n]}),Mr=({source:o})=>{const n=r(()=>{const[e,t]=Jt(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(_r,{title:Re.THROUGHPUT_LAST_10_SECONDS,children:e(te,{$alignItems:"flex-end",$gap:4,children:[t(re,{size:ce.L,children:n.value}),t(re,{size:ce.XS,variant:dt.Span,children:n.units})]})})},Br=({source:o})=>{const{CopyButton:n}=qt();return t(_r,{title:Re.NAMESPACE,children:e(te,{children:[t(Et,{variant:zt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:Ze.XS})]})})},zr=({source:e})=>t(_r,{title:Re.KIND,children:t(te,{children:t(Et,{variant:zt.Blue,label:e.id.kind})})}),Xr=({source:o})=>{const{CopyButton:n}=qt();return t(_r,{title:Re.NAME,children:e(te,{children:[t(Et,{variant:zt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:Ze.XS})]})})},Vr=({source:o})=>t(yt,{children:e(te,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[t(Mr,{source:o}),t(Br,{source:o}),t(zr,{source:o}),t(Xr,{source:o})]})}),Ur=g.div`
240
+ `,dc=({serviceName:o,isVirtual:n,nodeAttributes:i})=>{const l=Jt(e=>e.drawerEntityId),r=ct(e=>e.sources),s=a(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=a(()=>s&&JSON.stringify(qt(s))!==JSON.stringify(qt(l)),[s,l]),d=a(()=>{if(n){const e=Object.fromEntries((i??[]).map(({key:e,value:t})=>[e,t]));return[Zt({serviceName:o,attributes:e})]}if("user"===o?.toLowerCase())return[Pi];const e=s?Qt(s):void 0;return e?.length?e:[Oi]},[n,i,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=Jt.getState();e(ut.Source),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(cc,{onClick:u,$withClick:!!u,children:[e(oe,{$gap:8,children:[t(eo,{icons:d}),t(Q,{size:te.XXS,children:o})]}),n&&t(Fe,{status:we.Info,label:Me.VIRTUAL,textSize:te.XXXS,invertColors:!0,tooltip:Me.VIRTUAL_TOOLTIP})]})},uc=({title:o,children:n})=>e(V,{$gap:8,children:[t(Q,{size:te.XXXS,color:ee.Secondary,children:o}),n]}),pc=({source:o})=>{const n=a(()=>{const[e,t]=to(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(uc,{title:Me.THROUGHPUT_LAST_10_SECONDS,children:e(oe,{$alignItems:"flex-end",$gap:4,children:[t(Q,{size:te.L,children:n.value}),t(Q,{size:te.XS,variant:mt.Span,children:n.units})]})})},hc=({source:o})=>{const{CopyButton:n}=oo();return t(uc,{title:Me.NAMESPACE,children:e(oe,{children:[t(Pt,{variant:jt.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:nt.XS})]})})},gc=({source:e})=>t(uc,{title:Me.KIND,children:t(oe,{children:t(Pt,{variant:jt.Blue,label:e.id.kind})})}),mc=({source:o})=>{const{CopyButton:n}=oo();return t(uc,{title:Me.NAME,children:e(oe,{children:[t(Pt,{variant:jt.Blue,label:o.id.name}),t(n,{value:o.id.name,size:nt.XS})]})})},fc=({source:o})=>t(xt,{children:e(oe,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[t(pc,{source:o}),t(hc,{source:o}),t(gc,{source:o}),t(mc,{source:o})]})}),bc=m.div`
130
241
  display: flex;
131
242
  align-items: center;
132
243
  gap: 6px;
@@ -135,33 +246,33 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
135
246
  cursor: ${({$clickable:e})=>e?"pointer":"default"};
136
247
  transition: background-color 0.15s ease;
137
248
  ${({$clickable:e,theme:t})=>e&&`\n &:hover {\n background-color: ${t.v2.colors.silver[700]};\n }\n `}
138
- `,Hr=g.div`
249
+ `,vc=m.div`
139
250
  display: flex;
140
251
  align-items: center;
141
252
  justify-content: center;
142
253
  flex-shrink: 0;
143
254
  width: 18px;
144
255
  height: 18px;
145
- `,jr=g.div`
256
+ `,yc=m.div`
146
257
  flex: 1;
147
258
  min-width: 0;
148
259
  display: flex;
149
- `,Wr=({chevron:o,onClick:n,label:a,name:i,badges:l,action:s,paddingLeft:r})=>{const c=f();return e(Ur,{$clickable:!!n,$paddingLeft:r,onClick:n,children:[o&&t(Hr,{children:t(o,{size:18,fill:c.v2.colors.silver[200]})}),t(re,{size:ce.XXXS,color:Ce.Secondary,nowrap:!0,children:a}),t(jr,{children:t(re,{size:ce.XS,nowrap:!0,children:i})}),s&&t(we,{text:s.tooltip,children:t(qe,{icon:s.icon,size:Ze.XS,onClick:s.onClick})}),l.map(({key:e,...o})=>t(Gr,{...o},e))]})},Gr=({status:e,leftIcon:o,label:n,tooltip:a})=>{const i=o||(e===ge.Success?si:ri);return t(Ee,{status:e,leftIcon:i,label:n,tooltip:a,textSize:ce.XXXS,invertColors:!0,useSecondaryTone:!0})},Kr=({overrideProcessNum:e,pod:o,container:n,process:a})=>{const{jumpToProcess:i}=Nr(),l=r(()=>Cr({overrideProcessNum:e,identifyingAttributes:a.identifyingAttributes}),[e,a.identifyingAttributes]),s=r(()=>{const e=[],t=Rt(a.healthStatus,Ti,"health");return t&&e.push(t),e},[]);return t(Wr,{label:Re.PROCESS,name:l?Re.PID(l):Re.PROCESS_FALLBACK_NAME,paddingLeft:yr,action:{icon:Ri,onClick:()=>i(o,n,a),tooltip:Re.OPEN_IN_POD_TAB},badges:s})},Yr=g.div`
260
+ `,Cc=({chevron:o,onClick:n,label:a,name:i,badges:l,action:r,paddingLeft:s})=>{const c=f();return e(bc,{$clickable:!!n,$paddingLeft:s,onClick:n,children:[o&&t(vc,{children:t(o,{size:18,fill:c.v2.colors.silver[200]})}),t(Q,{size:te.XXXS,color:ee.Secondary,nowrap:!0,children:a}),t(yc,{children:t(Q,{size:te.XS,nowrap:!0,children:i})}),r&&t(Ie,{text:r.tooltip,children:t(ot,{icon:r.icon,size:nt.XS,onClick:r.onClick})}),l.map(({key:e,...o})=>t(Sc,{...o},e))]})},Sc=({status:e,leftIcon:o,label:n,tooltip:a})=>{const i=o||(e===we.Success?si:ci);return t(Fe,{status:e,leftIcon:i,label:n,tooltip:a,textSize:te.XXXS,invertColors:!0,useSecondaryTone:!0})},wc=({overrideProcessNum:e,pod:o,container:n,process:i})=>{const{jumpToProcess:l}=tc(),r=a(()=>Ks({overrideProcessNum:e,identifyingAttributes:i.identifyingAttributes}),[e,i.identifyingAttributes]),s=a(()=>{const e=[],t=zt(i.healthStatus,Ei,"health");return t&&e.push(t),e},[]);return t(Cc,{label:Me.PROCESS,name:r?Me.PID(r):Me.PROCESS_FALLBACK_NAME,paddingLeft:Ws,action:{icon:Fi,onClick:()=>l(o,n,i),tooltip:Me.OPEN_IN_POD_TAB},badges:s})},xc=m.div`
150
261
  display: flex;
151
262
  flex-direction: column;
152
263
  align-self: stretch;
153
264
  border-radius: 8px;
154
265
  background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[750]:"transparent"};
155
- `,Jr=({pod:o,container:n})=>{const[a,i]=l(!1),{jumpToContainer:s}=Nr(),c=r(()=>{const e=[],t=Lt(n.odigosHealthStatus?.status);t&&e.push({key:"odigos-health",status:t,leftIcon:Ti,label:Zt(t,n.odigosHealthStatus?.reasonEnum),tooltip:n.odigosHealthStatus?.message});const o=Lt(n.k8sHealthStatus?.status);return o&&e.push({key:"k8s-health",status:o,leftIcon:$i,label:Zt(o,n.k8sHealthStatus?.reasonEnum),tooltip:n.k8sHealthStatus?.message}),e},[]),d=n.processes??[],u=d.length>0;return e(Yr,{$isExpanded:a,children:[t(Wr,{chevron:u?a?bi:hi:void 0,onClick:u?()=>i(e=>!e):void 0,label:Re.CONTAINER,name:n.containerName,paddingLeft:vr+(u?0:24),action:{icon:Ri,onClick:()=>s(o,n),tooltip:Re.OPEN_IN_POD_TAB},badges:c}),u&&a&&t(V,{$gap:0,$padding:`0 ${fr}px`,children:d.map((e,a)=>{const i=a+1;return t(Kr,{overrideProcessNum:i,pod:o,container:n,process:e},`pod-${o.podName}-container-${n.containerName}-process-${i}`)})})]})},qr=g.div`
266
+ `,kc=({pod:o,container:n})=>{const[i,l]=r(!1),{jumpToContainer:s}=tc(),c=a(()=>{const e=[],t=Xt(n.odigosHealthStatus?.status);t&&e.push({key:"odigos-health",status:t,leftIcon:Ei,label:no(t,n.odigosHealthStatus?.reasonEnum),tooltip:n.odigosHealthStatus?.message});const o=Xt(n.k8sHealthStatus?.status);return o&&e.push({key:"k8s-health",status:o,leftIcon:Ii,label:no(o,n.k8sHealthStatus?.reasonEnum),tooltip:n.k8sHealthStatus?.message}),e},[]),d=n.processes??[],u=d.length>0;return e(xc,{$isExpanded:i,children:[t(Cc,{chevron:u?i?yi:mi:void 0,onClick:u?()=>l(e=>!e):void 0,label:Me.CONTAINER,name:n.containerName,paddingLeft:Gs+(u?0:24),action:{icon:Fi,onClick:()=>s(o,n),tooltip:Me.OPEN_IN_POD_TAB},badges:c}),u&&i&&t(V,{$gap:0,$padding:`0 ${Hs}px`,children:d.map((e,a)=>{const i=a+1;return t(wc,{overrideProcessNum:i,pod:o,container:n,process:e},`pod-${o.podName}-container-${n.containerName}-process-${i}`)})})]})},Tc=m.div`
156
267
  display: flex;
157
268
  flex-direction: column;
158
269
  align-self: stretch;
159
270
  border-radius: 8px;
160
271
  background-color: ${({theme:e,$isExpanded:t})=>t?e.v2.colors.silver[800]:"transparent"};
161
272
  padding-bottom: ${({$isExpanded:e})=>e?"12px":"0"};
162
- `,Zr=({pod:o})=>{const[n,a]=l(!1),{jumpToPod:i}=Nr(),s=o.containers??[],c=s.length>0,d=r(()=>{const e=[],t=Rt(o.agentInjectedStatus);t&&e.push(t);const n=Rt(o.odigosHealthStatus,Ti,"health");n&&e.push(n);const a=Rt(o.k8sHealthStatus,$i,"health");return a&&e.push(a),e},[o.k8sHealthStatus,o.odigosHealthStatus,o.agentInjectedStatus]);return e(qr,{$isExpanded:n,children:[t(Wr,{chevron:c?n?bi:hi:void 0,onClick:c?()=>a(e=>!e):void 0,label:Re.POD,name:o.podName,paddingLeft:br+(c?0:24),action:{icon:Ri,onClick:()=>i(o),tooltip:Re.OPEN_IN_POD_TAB},badges:d}),n&&c&&t(V,{$gap:0,$padding:`0 ${gr}px`,children:s.map(e=>t(Jr,{pod:o,container:e},`pod-${o.podName}-container-${e.containerName}`))})]})},Qr=({pods:e})=>e?.length?t(V,{$gap:4,children:e.map(e=>t(Zr,{pod:e},`pod-${e.podName}`))}):t(Ke,{children:t(se,{title:Re.NO_RUNNING_PODS,subTitle:Re.NO_RUNNING_PODS_SUBTITLE})}),ec=({source:o})=>t(yt,{bgTint:"1000",richTitle:{title:Re.PODS,badge:{label:o.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(yt,{bgTint:"900",children:[t(pr,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:o.pods,noPadding:!0}),t(Qr,{pods:o.pods})]})}),tc=({source:e})=>{const o=r(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?Qt(e.workloadOdigosHealthStatus.status):st.Unknown,title:$t(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Pt,{...o,width:"calc(100% - 32px)"}):null},oc="calc(50% - 6px)",nc=({source:o,onClickRollout:n,onClickRollback:a})=>{const i=r(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Lt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?$t(t):`${Re.ROLLOUT} ${$t(t)}`,subTitle:a,action:i!==ge.Success?{icon:Ni,tooltip:Re.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),l=r(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},i=Lt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollback")?$t(t):`${Re.ROLLBACK} ${$t(t)}`,subTitle:n,action:i!==ge.Success?{icon:Ni,tooltip:Re.ROLLBACK_RECOVER,onClick:a}:void 0}},[o]);return i||l?t(yt,{bgTint:"1000",children:e(te,{$gap:12,$alignItems:"stretch",children:[i&&t(Pt,{invertColors:!0,slim:!0,width:l?oc:"100%",...i}),l&&t(Pt,{invertColors:!0,slim:!0,width:oc,...l})]})}):null},ac=p(null),ic=g.div`
273
+ `,$c=({pod:o})=>{const[n,i]=r(!1),{jumpToPod:l}=tc(),s=o.containers??[],c=s.length>0,d=a(()=>{const e=[],t=zt(o.agentInjectedStatus);t&&e.push(t);const n=zt(o.odigosHealthStatus,Ei,"health");n&&e.push(n);const a=zt(o.k8sHealthStatus,Ii,"health");return a&&e.push(a),e},[o.k8sHealthStatus,o.odigosHealthStatus,o.agentInjectedStatus]);return e(Tc,{$isExpanded:n,children:[t(Cc,{chevron:c?n?yi:mi:void 0,onClick:c?()=>i(e=>!e):void 0,label:Me.POD,name:o.podName,paddingLeft:js+(c?0:24),action:{icon:Fi,onClick:()=>l(o),tooltip:Me.OPEN_IN_POD_TAB},badges:d}),n&&c&&t(V,{$gap:0,$padding:`0 ${Us}px`,children:s.map(e=>t(kc,{pod:o,container:e},`pod-${o.podName}-container-${e.containerName}`))})]})},Ec=({pods:e})=>e?.length?t(V,{$gap:4,children:e.map(e=>t($c,{pod:e},`pod-${e.podName}`))}):t(Qe,{children:t(me,{title:Me.NO_RUNNING_PODS,subTitle:Me.NO_RUNNING_PODS_SUBTITLE})}),Ic=({source:o})=>t(xt,{bgTint:"1000",richTitle:{title:Me.PODS,badge:{label:o.pods?.length||0}},withCollapse:!0,collapseIsDefaultOpen:!0,children:e(xt,{bgTint:"900",children:[t(Bs,{podsOdigosHealthStatus:o.podsOdigosHealthStatus,pods:o.pods,noPadding:!0}),t(Ec,{pods:o.pods})]})}),Nc=({source:e})=>{const o=a(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?ao(e.workloadOdigosHealthStatus.status):pt.Unknown,title:Ot(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Bt,{...o,width:"calc(100% - 32px)"}):null},Ac="calc(50% - 6px)",Oc=({source:o,onClickRollout:n,onClickRollback:i})=>{const l=a(()=>{const{status:e,reasonEnum:t,message:a}=o.conditions?.rollout||{},i=Xt(e);if(!i)return null;return{status:i,title:t?.toLowerCase().includes("rollout")?Ot(t):`${Me.ROLLOUT} ${Ot(t)}`,subTitle:a,action:i!==we.Success?{icon:Ni,tooltip:Me.ROLLOUT_RESTART,onClick:n}:void 0}},[o]),r=a(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},a=Xt(e);if(!a)return null;return{status:a,title:t?.toLowerCase().includes("rollback")?Ot(t):`${Me.ROLLBACK} ${Ot(t)}`,subTitle:n,action:a!==we.Success?{icon:Ni,tooltip:Me.ROLLBACK_RECOVER,onClick:i}:void 0}},[o]);return l||r?t(xt,{bgTint:"1000",children:e(oe,{$gap:12,$alignItems:"stretch",children:[l&&t(Bt,{invertColors:!0,slim:!0,width:r?Ac:"100%",...l}),r&&t(Bt,{invertColors:!0,slim:!0,width:Ac,...r})]})}):null},Dc=p(null),Rc=m.div`
163
274
  position: relative;
164
- `,lc=({children:e})=>{const o=d(null);return t(ic,{ref:o,children:t(ac.Provider,{value:o,children:e})})},sc=g.div`
275
+ `,Pc=({children:e})=>{const o=i(null);return t(Rc,{ref:o,children:t(Dc.Provider,{value:o,children:e})})},Fc=m.div`
165
276
  position: fixed;
166
277
  top: ${({$coords:e})=>e.top}px;
167
278
  right: ${({$coords:e})=>e.right}px;
@@ -175,14 +286,14 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
175
286
  padding: 12px 16px;
176
287
  border-radius: 12px;
177
288
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
178
- `,rc=g.div`
289
+ `,Lc=m.div`
179
290
  display: flex;
180
291
  align-items: flex-end;
181
292
  justify-content: space-between;
182
293
  gap: 8px;
183
- `,cc=g.div`
294
+ `,_c=m.div`
184
295
  flex: 1;
185
- `,dc=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:s,deleteTooltip:r,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:g})=>{const b=f(),v=h(ac),[y,C]=l(null);return eo(v??{current:null},n),m(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?zl(e(sc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(V,{$gap:4,children:[t(re,{size:ce.XXS,children:c}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:d})]}),e(rc,{children:[t(cc,{children:p}),e(te,{$gap:8,$width:"fit-content",$margin:`0 0 ${g||0} 0`,children:[t(oe,{variant:ae.Secondary,onClick:s,leftIcon:ai,tooltip:r,hideTooltipIcon:!0,iconSize:16,size:ne.S,textColor:b.v2.colors.red[500]}),t(oe,{variant:ae.Primary,onClick:a,leftIcon:vi,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ne.S})]})]}),t("div",{children:t(me,{status:ge.Warning,message:u})})]}),document.body):null},uc=({language:o,overridden:n,onOverride:a,defaultValues:i})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=wt(i),p=r(()=>{if(!o)return[];const e=to[o].community,t=s===rt.Onprem?to[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]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(te,{$gap:4,$alignItems:"center",children:[n?t(Ee,{status:ge.Info,invertColors:!0,label:Re.OVERIDDEN}):null,e(lc,{children:[t(we,{text:Re.OVERRIDE_OTEL_DISTRO_NAME,children:t(qe,{icon:di,onClick:b})}),g&&t(dc,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:Re.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:Re.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Re.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Re.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Re.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(Je,{label:Re.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},pc=({overridden:o,onOverride:n,defaultValues:a,originalValues:i})=>{const{addNotification:s}=Nt(),{formData:c,handleFormChange:d,resetFormData:u}=wt(a),p=r(()=>oo.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=l(!1),[g,f]=l(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(te,{children:[o?t(Ee,{status:ge.Info,invertColors:!0,label:Re.OVERIDDEN}):null,e(lc,{children:[t(we,{text:Re.OVERRIDE_RUNTIME_DETAILS,children:t(qe,{icon:di,onClick:b})}),g&&t(dc,{width:"500px",onClose:b,onSave:async()=>{!c.version||no(c.version)?(m(!0),await n(c),m(!1),b()):s({type:ge.Warning,message:It.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Re.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:Re.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Re.OVERRIDE_RUNTIME_DETAILS,subTitle:Re.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Re.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(te,{$gap:8,children:[t(Je,{label:Re.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${i.language||"none"}`}),t(W,{label:Re.RUNTIME_VERSION,placeholder:Re.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${i.version||"none"}`})]})})]})]})},hc=({source:e,onOverride:o})=>{const{isVm:n}=y(),{containers:a,containersRichTitle:i}=r(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Re.DETECTED_PROCESSES:`${e.id.kind} ${Re.CONTAINERS}`,tooltip:t?.message||(n?Re.DETECTED_PROCESSES_DESCRIPTION:Re.DETECTED_CONTAINERS_DESCRIPTION),badge:Lt(t?.status)===Bt.Loading?{status:Bt.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(yt,{bgTint:"1000",richTitle:i,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:a.map(e=>e&&t(bc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},mc=g.div`
296
+ `,zc=({width:o,onClose:n,onSave:a,saveTooltip:i,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:m})=>{const b=f(),v=h(Dc),[y,C]=r(null);return io(v??{current:null},n),g(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?Xl(e(Fc,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(V,{$gap:4,children:[t(Q,{size:te.XXS,children:c}),t(Q,{size:te.XXXS,color:ee.Secondary,children:d})]}),e(Lc,{children:[t(_c,{children:p}),e(oe,{$gap:8,$width:"fit-content",$margin:`0 0 ${m||0} 0`,children:[t(ne,{variant:ie.Secondary,onClick:l,leftIcon:ii,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ae.S,textColor:b.v2.colors.red[500]}),t(ne,{variant:ie.Primary,onClick:a,leftIcon:Ci,tooltip:i,hideTooltipIcon:!0,iconSize:16,size:ae.S})]})]}),t("div",{children:t(Se,{status:we.Warning,message:u})})]}),document.body):null},Mc=({language:o,overridden:n,onOverride:i,defaultValues:l})=>{const{tier:s}=y(),{formData:c,handleFormChange:d,resetFormData:u}=$t(l),p=a(()=>{if(!o)return[];const e=lo[o].community,t=s===ht.Onprem?lo[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,s]),[h,g]=r(!1),[m,f]=r(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(oe,{$gap:4,$alignItems:"center",children:[n?t(Fe,{status:we.Info,invertColors:!0,label:Me.OVERIDDEN}):null,e(Pc,{children:[t(Ie,{text:Me.OVERRIDE_OTEL_DISTRO_NAME,children:t(ot,{icon:pi,onClick:b})}),m&&t(zc,{width:"500px",onClose:b,onSave:async()=>{g(!0),await i(c),g(!1),b()},saveTooltip:Me.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await i({otelDistroName:null}),g(!1),b()},deleteTooltip:Me.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Me.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Me.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Me.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(tt,{label:Me.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Bc=({overridden:o,onOverride:n,defaultValues:i,originalValues:l})=>{const{addNotification:s}=Dt(),{formData:c,handleFormChange:d,resetFormData:u}=$t(i),p=a(()=>ro.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,g]=r(!1),[m,f]=r(!1),b=()=>{h||(m&&u(),f(e=>!e))};return e(oe,{children:[o?t(Fe,{status:we.Info,invertColors:!0,label:Me.OVERIDDEN}):null,e(Pc,{children:[t(Ie,{text:Me.OVERRIDE_RUNTIME_DETAILS,children:t(ot,{icon:pi,onClick:b})}),m&&t(zc,{width:"500px",onClose:b,onSave:async()=>{!c.version||so(c.version)?(g(!0),await n(c),g(!1),b()):s({type:we.Warning,message:Rt.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Me.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{g(!0),await n({language:null,version:""}),g(!1),b()},deleteTooltip:Me.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Me.OVERRIDE_RUNTIME_DETAILS,subTitle:Me.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Me.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(oe,{$gap:8,children:[t(tt,{label:Me.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(pe,{label:Me.RUNTIME_VERSION,placeholder:Me.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},Xc=({source:e,onOverride:o})=>{const{isVm:n}=y(),{containers:i,containersRichTitle:l}=a(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:n?Me.DETECTED_PROCESSES:`${e.id.kind} ${Me.CONTAINERS}`,tooltip:t?.message||(n?Me.DETECTED_PROCESSES_DESCRIPTION:Me.DETECTED_CONTAINERS_DESCRIPTION),badge:Xt(t?.status)===Ht.Loading?{status:Ht.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,n]);return t(xt,{bgTint:"1000",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(V,{$gap:8,children:i.map(e=>e&&t(jc,{...e,onOverride:o},`source-container-${e.containerName}`))})})},Vc=m.div`
186
297
  display: flex;
187
298
  flex-direction: column;
188
299
  align-self: stretch;
@@ -190,28 +301,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
190
301
  padding: 8px 12px;
191
302
  border-radius: 8px;
192
303
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
193
- `,gc=g.div`
304
+ `,Uc=m.div`
194
305
  display: flex;
195
306
  align-items: center;
196
307
  justify-content: center;
197
308
  padding: 8px;
198
309
  border-radius: 10px;
199
310
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
200
- `,fc=g.div`
311
+ `,Hc=m.div`
201
312
  display: flex;
202
313
  flex-direction: column;
203
314
  gap: 12px;
204
315
  padding: 8px 12px;
205
316
  border-radius: 8px;
206
317
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
207
- `,bc=({onOverride:o,...n})=>{const{containerName:a,runtimeInfo:i,agentEnabled:l,overrides:s}=n,c=f(),d=r(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=r(()=>({language:Mt(n),version:ao(n)||void 0}),[n]),p=r(()=>!!s?.otelDistroName,[s]),h=r(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),m=r(()=>!i&&!d,[i,d]),g=r(()=>m?Ei:Ae(u.language),[m,u]),b=r(()=>{if(m)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[m,u]),v=r(()=>m?{status:Bt.Loading,label:Re.WAITING_FOR_RUNTIME_DETECTION}:{status:l?.otelDistroName?ge.Success:Bt.Disabled,leftIcon:l?.otelDistroName?si:ri,label:l?.otelDistroName?`Instrumented | ${l.otelDistroName}`:"Uninstrumented",tooltip:l?.agentEnabledStatus?.message},[m,l]),y=e=>o({containerName:a,...p?h:{},...d?u:{},...e});return e(mc,{children:[e(te,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(te,{$gap:8,$alignItems:"center",children:[t(gc,{children:t(g,{size:24,fill:i?void 0:c.v2.colors.grey[400]})}),t(re,{children:a}),t(Et,b?{variant:zt.Blue,label:b}:{variant:zt.Loader,label:Re.DETECTING_RUNTIME_INFO}),t(pc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(te,{$gap:8,$alignItems:"center",children:[t(Ee,{...v,textSize:ce.XXXS}),t(uc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!l||l.agentEnabled||m?null:t(fc,{children:e(te,{$gap:10,$alignItems:"center",children:[t(Et,{variant:zt.Pink,label:$t(l.agentEnabledStatus?.reasonEnum)||Re.NO_AVAILABLE_AGENT}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:l?.agentEnabledStatus?.message})]})})]})},vc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>e(V,{$gap:12,children:[t(Vr,{source:o}),t(tc,{source:o}),t(nc,{source:o,onClickRollout:n,onClickRollback:a}),t(hc,{source:o,onOverride:i}),t(ec,{source:o})]}),yc=({source:o,fetchK8sManifest:a})=>{const i=f(),[s,r]=l(!0),[c,d]=l(void 0),[u,p]=l(!0),[h,m]=l(void 0);return n(()=>{a(o.id.namespace,o.id.kind,o.id.name).then(d).finally(()=>r(!1)),a(o.id.namespace,io.InstrumentationConfig,`${o.id.kind}-${o.id.name}`.toLowerCase()).then(m).finally(()=>p(!1))},[a,o.id.namespace,o.id.kind,o.id.name]),e(yt,{bgTint:"1000",children:[s?t(lo,{size:1}):t(bl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:c}),u?t(lo,{size:1}):t(bl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:h})]})};function Cc(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 Sc(e){const t=Math.abs(e);return t>=1e9?`${wc(e/1e9)}s`:t>=1e6?`${wc(e/1e6)}ms`:t>=1e3?`${wc(e/1e3)}μs`:String(Math.round(e))}function wc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function xc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],s=n[e+2],r=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:s,nameIndex:r}),a=c+l}}return t}function kc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Tc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function $c(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:s,collapseRecursive:r=!1}=i,c=xc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(s&&(d=d.filter(t=>s(Cc(e,t.nameIndex))),0===d.length))return null;if(r&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Cc(e,l.nameIndex)===Cc(e,t.nameIndex)&&a.add(kc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(kc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(kc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const m=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,g=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/m,g)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,s=Math.max(f-v,1),r=Cc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:s,name:r,matchesSearch:Tc(r,b)}})}function Nc(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var Ic,Ec;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Ic||(Ic={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(Ec||(Ec={}));function Oc(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Ac(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 Dc(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const Rc=({flamebearer:o,maxRowPx:a,searchQuery:i="",shouldKeepName:s,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const g=f(),b=d(null),v=d(null),y=d({x:0,y:0}),C=d(o.numTicks),[S,w]=l({w:0,h:0}),[x,k]=l(""),[T,$]=l(null),[N,I]=l([]),[E,O]=l(!1),[A,D]=l(Ic.Fit),[R,F]=l(Ec.Fit),[P,L]=l(!1),_=Math.max(1,Math.min(Math.floor(S.w*A),8192)),M=Math.max(1,Math.min(Math.floor(S.h*R),8192)),B=N.length>0?N[N.length-1]:null,z=B?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,I([]))},[o.numTicks]),m(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!E)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[E]),n(()=>(p?.(E),()=>{E&&p?.(!1)}),[E,p]);const X=r(()=>$c(o,_,M,a,i,{zoomRoot:B,shouldKeepName:s,collapseRecursive:P}),[o,a,i,M,_,B,s,P]),V=r(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?i.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,i]),U=c(e=>{if(_<2||M<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Ac((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*M,V);if(n){const e=kc(n);$(e);const t=z>0?(100*n.size/z).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";k(`${n.name}\ntotal ${Sc(n.size)} (${t}% of view, ${a}% of profile) · self ${Sc(n.self)}`)}else $(null),k("")},[V,o.numTicks,M,_,z]),H=c(e=>{U(e)},[U]),j=c(()=>{$(null),k("")},[]),W=c(e=>{y.current={x:e.clientX,y:e.clientY}},[]),G=c(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||M<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=Ac((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*M,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);I(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,M,_]);m(()=>{const e=v.current;if(!e||_<2||M<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,M),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(M*a),e.style.width=`${_}px`,e.style.height=`${M}px`;const l=e.getContext("2d");l&&(l.setTransform(a,0,0,a,0,0),l.clearRect(0,0,_,M),X?.length?function(e,t,o,n,a,i,l,s){const r=i.v2.colors.silver[900];e.fillStyle=r,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:r,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=Nc(r,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const m=Oc(d,s),g=`${r} (${Sc(d)}, ${m}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(kc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(l,_,M,X,i,g,T,o.numTicks):(l.fillStyle=g.v2.colors.silver[900],l.fillRect(0,0,_,M)))},[X,o.numTicks,T,i,M,_,g]);const K=c(()=>O(e=>!e),[]),Y=o.numTicks>0?Math.max(0,Math.min(100,Math.round(z/o.numTicks*100))):100,J=r(()=>function(e,t){const o=xc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let s=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s}(o,B),[o,B]),Q=null!==J,ee=N.length>0,ie=B?Cc(o,B.nameIndex):"",le=c(()=>I([]),[]),se=c(()=>I(e=>e.slice(0,-1)),[]),de=c(()=>{J&&I(e=>[...e,J])},[J]);return e("div",{style:E?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:g.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(te,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(q,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Z.Left,size:ct.S,value:P,onChange:L}),e(te,{$gap:8,children:[e(te,{children:[t(oe,{variant:ae.Secondary,size:ne.S,label:"Reset zoom",leftIcon:Fi,onClick:le,disabled:!N.length}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:20,leftIcon:Pi,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!ee,onClick:se}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(re,{size:ce.XXS,color:Ce.Secondary,nowrap:!0,align:"center",children:`${Y}%`})}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:20,leftIcon:ii,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!Q,onClick:de})]}),e(te,{children:[t(we,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(ue,{variant:so.Filled,options:[{value:Ic.Fit,label:"W: Fit"},{value:Ic.X10,label:"10x"}],selected:A,setSelected:D})}),t(we,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(ue,{variant:so.Filled,options:[{value:Ec.Fit,label:"H: Fit"},{value:Ec.X10,label:"10x"}],selected:R,setSelected:F})})]}),t(oe,{variant:ae.Secondary,size:ne.S,iconSize:24,leftIcon:E?yi:Ri,tooltip:E?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:K})]})]}),t(we,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:E?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:A>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:M||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:W,onPointerMove:H,onPointerLeave:j,onClick:G})})})}),e(te,{$justifyContent:"space-between",children:[t(re,B?{size:ce.XXXS,color:g.v2.colors.silver[300],children:`Zoomed: ${ie} • ${Sc(z)} samples in view`}:{size:ce.XXXS,color:g.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(re,{size:ce.XXXS,color:g.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Dc(h.totalBytesUsed)} / ${Dc(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var Fc,Pc;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(Fc||(Fc={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(Pc||(Pc={}));const Lc=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function _c(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(Pc.FilterOutVoid)&&"void"===o)return!1;if(t.includes(Pc.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&Lc.test(o)))return!1}return!0}const Mc={options:[{id:Pc.FilterOutVoid,label:"Filter out void symbols"},{id:Pc.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>_c(e.cells.find(e=>e.key===Fc.Symbol)?.rawValue?.toString()??"",t)},Bc=({rows:e,languages:o,filters:n,onFiltersChange:a})=>{const i=r(()=>[{key:Fc.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(ro.Java)?Mc:void 0,noFilter:!o?.includes(ro.Java)},{key:Fc.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Fc.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),l=r(()=>e.map(e=>({cells:[{key:Fc.Symbol,rawValue:e.name},{key:Fc.Self,rawValue:Sc(e.self)},{key:Fc.Total,rawValue:Sc(e.total)}]})),[e]);return t(co,{variant:uo.Data,maxHeight:"calc(100vh - 306px)",columns:i,rows:l,filters:n,onFiltersChange:a,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:Li,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var zc;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(zc||(zc={}));const Xc=g(V)`
318
+ `,jc=({onOverride:o,...n})=>{const{containerName:i,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=f(),d=a(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),u=a(()=>({language:Ut(n),version:co(n)||void 0}),[n]),p=a(()=>!!s?.otelDistroName,[s]),h=a(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=a(()=>!l&&!d,[l,d]),m=a(()=>g?Oi:_e(u.language),[g,u]),b=a(()=>{if(g)return"";const{language:e,version:t}=u;return`${e}${t?` • ${t}`:""}`},[g,u]),v=a(()=>g?{status:Ht.Loading,label:Me.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?we.Success:Ht.Disabled,leftIcon:r?.otelDistroName?si:ci,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),y=e=>o({containerName:i,...p?h:{},...d?u:{},...e});return e(Vc,{children:[e(oe,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(oe,{$gap:8,$alignItems:"center",children:[t(Uc,{children:t(m,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(Q,{children:i}),t(Pt,b?{variant:jt.Blue,label:b}:{variant:jt.Loader,label:Me.DETECTING_RUNTIME_INFO}),t(Bc,{overridden:d,onOverride:y,defaultValues:u,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(oe,{$gap:8,$alignItems:"center",children:[t(Fe,{...v,textSize:te.XXXS}),t(Mc,{language:u.language,overridden:p,onOverride:y,defaultValues:h})]})]}),!r||r.agentEnabled||g?null:t(Hc,{children:e(oe,{$gap:10,$alignItems:"center",children:[t(Pt,{variant:jt.Pink,label:Ot(r.agentEnabledStatus?.reasonEnum)||Me.NO_AVAILABLE_AGENT}),t(Q,{size:te.XXXS,color:ee.Secondary,children:r?.agentEnabledStatus?.message})]})})]})},Gc=({source:o,onClickRollout:n,onClickRollback:a,onOverride:i})=>e(V,{$gap:12,children:[t(fc,{source:o}),t(Nc,{source:o}),t(Oc,{source:o,onClickRollout:n,onClickRollback:a}),t(Xc,{source:o,onOverride:i}),t(Ic,{source:o})]}),Wc=({source:o,fetchK8sManifest:a})=>{const i=f(),[l,s]=r(!0),[c,d]=r(void 0),[u,p]=r(!0),[h,g]=r(void 0);return n(()=>{a(o.id.namespace,o.id.kind,o.id.name).then(d).finally(()=>s(!1)),a(o.id.namespace,uo.InstrumentationConfig,`${o.id.kind}-${o.id.name}`.toLowerCase()).then(g).finally(()=>p(!1))},[a,o.id.namespace,o.id.kind,o.id.name]),e(xt,{bgTint:"1000",children:[l?t(po,{size:1}):t(vl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:c}),u?t(po,{size:1}):t(vl,{bgTint:"800",codeBgColor:i.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:h})]})};function Kc(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function Yc(e){const t=Math.abs(e);return t>=1e9?`${Jc(e/1e9)}s`:t>=1e6?`${Jc(e/1e6)}ms`:t>=1e3?`${Jc(e/1e3)}μs`:String(Math.round(e))}function Jc(e){return e.toFixed(2).replace(/\.?0+$/,"")}function qc(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let a=0;for(let e=0;e+3<n.length;e+=4){const i=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=a+i;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),a=c+l}}return t}function Zc(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Qc(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function ed(e,t,o,n,a,i={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1}=i,c=qc(e);let d=l?function(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const a=[t];for(let e=t.level+1;e<=o;e++){const t=a.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){a.push(e);break}}return a}(c,l):c;if(0===d.length)return null;if(r&&(d=d.filter(t=>r(Kc(e,t.nameIndex))),0===d.length))return null;if(s&&(d=function(e,t){if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const a=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const i=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==i.length)continue;const l=i[0];l.size===t.size&&Kc(e,l.nameIndex)===Kc(e,t.nameIndex)&&a.add(Zc(l))}if(0===a.size)return o;const i=[];for(const e of o){if(a.has(Zc(e)))continue;let t=0;for(let o=0;o<e.level;o++){const i=n.get(o);if(!i)continue;const l=i.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&a.has(Zc(l))&&t++}i.push({...e,level:e.level-t})}return i}(e,d),0===d.length))return null;const u=l?.level??0,p=l?.offset??0,h=l?.size??e.numTicks;if(h<=0)return null;const g=d.reduce((e,t)=>Math.max(e,t.level-u),0)+1,m=n??Number.POSITIVE_INFINITY,f=Math.max(1,Math.min(o/g,m)),b=a.trim(),v=f>8?1:0;return d.map(o=>{const n=o.level-u,a=(o.offset-p)/h*t,i=Math.max(o.size/h*t,1),l=n*f,r=Math.max(f-v,1),s=Kc(e,o.nameIndex);return{...o,x:a,y:l,w:i,h:r,name:s,matchesSearch:Qc(s,b)}})}function td(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],a=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return a[o%a.length]}var od,nd;!function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(od||(od={})),function(e){e[e.Fit=1]="Fit",e[e.X10=10]="X10"}(nd||(nd={}));function ad(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function id(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function ld(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}const rd=({flamebearer:o,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h})=>{const m=f(),b=i(null),v=i(null),y=i({x:0,y:0}),C=i(o.numTicks),[S,w]=r({w:0,h:0}),[x,k]=r(""),[T,$]=r(null),[E,I]=r([]),[N,A]=r(!1),[O,D]=r(od.Fit),[R,P]=r(nd.Fit),[F,L]=r(!1),_=Math.max(1,Math.min(Math.floor(S.w*O),8192)),z=Math.max(1,Math.min(Math.floor(S.h*R),8192)),M=E.length>0?E[E.length-1]:null,B=M?.size??o.numTicks;n(()=>{C.current!==o.numTicks&&(C.current=o.numTicks,I([]))},[o.numTicks]),g(()=>{const e=b.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();w({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!N)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[N]),n(()=>(p?.(N),()=>{N&&p?.(!1)}),[N,p]);const X=a(()=>ed(o,_,z,s,c,{zoomRoot:M,shouldKeepName:d,collapseRecursive:F}),[o,s,c,z,_,M,d,F]),V=a(()=>function(e){return[...e].sort((e,t)=>t.level-e.level)}(X?.length?c.trim()?X.filter(e=>e.matchesSearch):X:[]),[X,c]),U=l(e=>{if(_<2||z<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=id((e.clientX-t.left)/t.width*_,(e.clientY-t.top)/t.height*z,V);if(n){const e=Zc(n);$(e);const t=B>0?(100*n.size/B).toFixed(1):"0",a=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";k(`${n.name}\ntotal ${Yc(n.size)} (${t}% of view, ${a}% of profile) · self ${Yc(n.self)}`)}else $(null),k("")},[V,o.numTicks,z,_,B]),H=l(e=>{U(e)},[U]),j=l(()=>{$(null),k("")},[]),G=l(e=>{y.current={x:e.clientX,y:e.clientY}},[]),W=l(e=>{const{x:t,y:o}=y.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(_<2||z<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const a=id((e.clientX-n.left)/n.width*_,(e.clientY-n.top)/n.height*z,V);if(!a)return;const i=function(e){return{level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}}(a);I(e=>{const t=e.length>0?e[e.length-1]:null;return t&&function(e,t){return e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex}(i,t)?e.slice(0,-1):[...e,i]})},[V,z,_]);g(()=>{const e=v.current;if(!e||_<2||z<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(_,z),a=Math.min(t,16384/n);e.width=Math.floor(_*a),e.height=Math.floor(z*a),e.style.width=`${_}px`,e.style.height=`${z}px`;const i=e.getContext("2d");i&&(i.setTransform(a,0,0,a,0,0),i.clearRect(0,0,_,z),X?.length?function(e,t,o,n,a,i,l,r){const s=i.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=a.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:a,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=td(s,i);e.fillStyle=p,e.fillRect(o,n,a,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+a-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(a-1,0),Math.max(l-1,0));const g=ad(d,r),m=`${s} (${Yc(d)}, ${g}%)`,f=i.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(a>=y&&C>=b){e.font=`${C}px ${i.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=m;for(;t.length>2&&e.measureText(t).width>a-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=a-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(Zc(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:a,h:i}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(a-2,0),Math.max(i-2,0));break}}(i,_,z,X,c,m,T,o.numTicks):(i.fillStyle=m.v2.colors.silver[900],i.fillRect(0,0,_,z)))},[X,o.numTicks,T,c,z,_,m]);const J=l(()=>A(e=>!e),[]),q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(B/o.numTicks*100))):100,Z=a(()=>function(e,t){const o=qc(e),n=t?.offset??0,a=n+(t?.size??e.numTicks),i=(t?.level??-1)+1,l=t?.size??e.numTicks;let r=null;for(const e of o)e.level<i||e.offset<n||e.offset+e.size>a||e.size>=l||(!r||e.size>r.size||e.size===r.size&&e.level<r.level)&&(r=e);return r}(o,M),[o,M]),re=null!==Z,se=E.length>0,ce=M?Kc(o,M.nameIndex):"",de=l(()=>I([]),[]),ue=l(()=>I(e=>e.slice(0,-1)),[]),pe=l(()=>{Z&&I(e=>[...e,Z])},[Z]);return e("div",{style:N?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:m.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(oe,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(K,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:Y.Left,size:gt.S,value:F,onChange:L}),e(oe,{$gap:8,children:[e(oe,{children:[t(ne,{variant:ie.Secondary,size:ae.S,label:"Reset zoom",leftIcon:Li,onClick:de,disabled:!E.length}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:_i,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!se,onClick:ue}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,align:"center",children:`${q}%`})}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:20,leftIcon:li,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!re,onClick:pe})]}),e(oe,{children:[t(Ie,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(le,{variant:ho.Filled,options:[{value:od.Fit,label:"W: Fit"},{value:od.X10,label:"10x"}],selected:O,setSelected:D})}),t(Ie,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(le,{variant:ho.Filled,options:[{value:nd.Fit,label:"H: Fit"},{value:nd.X10,label:"10x"}],selected:R,setSelected:P})})]}),t(ne,{variant:ie.Secondary,size:ae.S,iconSize:24,leftIcon:N?Si:Fi,tooltip:N?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:J})]})]}),t(Ie,{fullWidth:!0,keepAlive:!0,text:x,children:t("div",{ref:b,style:{flex:1,minWidth:0,width:"100%",height:N?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflowX:O>1?"auto":"hidden",overflowY:R>1?"auto":"hidden"},children:t("div",{style:{width:_||"100%",height:z||"100%",position:"relative"},children:t("canvas",{ref:v,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:T?"pointer":"default"},onPointerDown:G,onPointerMove:H,onPointerLeave:j,onClick:W})})})}),e(oe,{$justifyContent:"space-between",children:[t(Q,M?{size:te.XXXS,color:m.v2.colors.silver[300],children:`Zoomed: ${ce} • ${Yc(B)} samples in view`}:{size:te.XXXS,color:m.v2.colors.silver[300],children:"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(Q,{size:te.XXXS,color:m.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${ld(h.totalBytesUsed)} / ${ld(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})};var sd,cd;!function(e){e.Symbol="symbol",e.Self="self",e.Total="total"}(sd||(sd={})),function(e){e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"}(cd||(cd={}));const dd=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function ud(e,t){const o=function(e){return e.split(" ")[0]??""}(e);if(t.includes(cd.FilterOutVoid)&&"void"===o)return!1;if(t.includes(cd.OnlyWithReturnValues)){if(!(e.includes(" ")&&"void"!==o&&dd.test(o)))return!1}return!0}const pd={options:[{id:cd.FilterOutVoid,label:"Filter out void symbols"},{id:cd.OnlyWithReturnValues,label:"Only show functions with return values"}],filterRow:(e,t)=>ud(e.cells.find(e=>e.key===sd.Symbol)?.rawValue?.toString()??"",t)},hd=({rows:e,languages:o,filters:n,onFiltersChange:i})=>{const l=a(()=>[{key:sd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:o?.includes(go.Java)?pd:void 0,noFilter:!o?.includes(go.Java)},{key:sd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:sd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[o]),r=a(()=>e.map(e=>({cells:[{key:sd.Symbol,rawValue:e.name},{key:sd.Self,rawValue:Yc(e.self)},{key:sd.Total,rawValue:Yc(e.total)}]})),[e]);return t(mo,{variant:fo.Data,maxHeight:"calc(100vh - 306px)",columns:l,rows:r,filters:n,onFiltersChange:i,rowActionsPushLeftPosition:"12px",getRowActions:e=>[{id:`copy-${e.cells[0].rawValue}`,label:"",rightIcon:zi,onClick:()=>{navigator.clipboard.writeText(e.cells[0].rawValue)}}]})};var gd;!function(e){e.Table="table",e.Flame="flame",e.Both="both"}(gd||(gd={}));const md=m(V)`
208
319
  width: 100%;
209
320
  flex: 1;
210
321
  border-radius: 16px;
211
322
  overflow: hidden;
212
323
  background: ${({theme:e})=>e.v2.colors.silver[800]};
213
324
  box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
214
- `,Vc=g.div`
325
+ `,fd=m.div`
215
326
  display: flex;
216
327
  align-items: center;
217
328
  gap: 10px;
@@ -219,11 +330,11 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
219
330
  padding: 12px 12px 8px;
220
331
  background: ${({theme:e})=>e.v2.colors.silver[800]};
221
332
  border-radius: 16px 16px 0 0;
222
- `,Uc=g(te)`
333
+ `,bd=m(oe)`
223
334
  flex-shrink: 0;
224
335
  align-items: center;
225
336
  gap: 4px;
226
- `,Hc=g.div`
337
+ `,vd=m.div`
227
338
  flex: 1;
228
339
  display: flex;
229
340
  align-items: stretch;
@@ -231,20 +342,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
231
342
  padding: 16px;
232
343
  background: ${({theme:e})=>e.v2.colors.silver[800]};
233
344
  border-radius: 0 0 16px 16px;
234
- `,jc=g(V)`
345
+ `,yd=m(V)`
235
346
  flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
236
347
  width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
237
348
  max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
238
349
  gap: 10px;
239
- `,Wc=g(V)`
350
+ `,Cd=m(V)`
240
351
  flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
241
352
  width: ${({$splitWithTable:e})=>e?"auto":"100%"};
242
353
  gap: 10px;
243
- `,Gc=g(te)`
354
+ `,Sd=m(oe)`
244
355
  width: 100%;
245
356
  min-height: 32px;
246
357
  flex-shrink: 0;
247
- `,Kc=({source:o,fetchProfilingSlots:i,enableProfiling:s,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=f(),m=o.id,[g,b]=l(!0),[v,y]=l(null),[C,S]=l(null),[w,x]=l(0),[k,T]=l(zc.Both),[$,N]=l(""),[I,E]=l({}),O=d(null),A=c(async()=>{try{const e=[i()];g&&e.push(u(m));const[t,o]=await Promise.all(e);t&&y(t),o?.profileJson&&S(o.profileJson)}finally{x(e=>e+1)}},[i,u,m]);n(()=>{let e=!1;return(async()=>{await s(m),e||(await A(),e||(O.current=setInterval(A,3e3)))})(),()=>{e=!0,O.current&&clearInterval(O.current)}},[s,A,m]);const D=r(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(C),[C]),R=r(()=>D?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=Cc(e,n[o+3]);if(!l)continue;const s=t.get(l);(!s||a>s.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(D.flamebearer):[],[D]),F=r(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),P=k===zc.Table||k===zc.Both,L=k===zc.Flame||k===zc.Both,_=P&&L,M=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),B=r(()=>function(e,t){if(!t?.includes(ro.Java))return;const o=e?.[Fc.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>_c(e,o):void 0}(I,M),[I,M]);return!C&&w<2?t(Ke,{$height:"70vh",children:t(Qe,{withSpinner:!0})}):e(Xc,{$gap:0,$width:"100%",children:[e(Vc,{children:[t(we,{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(Uc,{children:t(re,{size:ce.S,weight:500,color:Ce.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(te,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Ut,{value:$,onChange:N,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(ue,{variant:so.Filled,options:[{value:zc.Table,label:"Top table"},{value:zc.Flame,label:"Flame graph"},{value:zc.Both,label:"Both"}],selected:k,setSelected:T}),t(oe,g?{variant:ae.Secondary,size:ne.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(_i,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:ae.Secondary,size:ne.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(_i,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(Hc,{$gap:P&&L?16:0,children:D?e(a,{children:[P&&e(jc,{$splitWithFlame:_,children:[t(Gc,{$justifyContent:"flex-end",children:t(oe,{variant:ae.Secondary,size:ne.S,label:"Download snapshot",rightIcon:Mi,onClick:()=>{if(!C)return;const e=new Blob([C],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!C})}),t(Bc,{rows:F,languages:M,filters:I,onFiltersChange:E})]}),L&&e(Wc,{$splitWithTable:_,children:[e(Gc,{$justifyContent:"space-between",children:[t(Ee,{label:D?`Total in view ${Sc(D.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:ce.XXS}),e(te,{$gap:12,children:[!g&&t(oe,{variant:ae.Secondary,size:ne.S,label:"Refresh",leftIcon:Ni,onClick:A}),t(q,{label:"Auto refresh",labelAlign:Z.Left,size:ct.S,value:g,onChange:b})]})]}),t(Rc,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:$,shouldKeepName:B,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},k)]})]}):t(Ke,{children:t(se,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},Yc=[io.Deployment,io.StatefulSet,io.DaemonSet,io.DeploymentConfig,io.Rollout,io.Pod];var Jc;!function(e){e.Workload="Workload",e.Pod="Pod"}(Jc||(Jc={}));const qc=e=>!!e&&Lt(e.status)===ge.Error,Zc=e=>qc(e.healthStatus),Qc=e=>qc(e.odigosHealthStatus)||(e.processes??[]).some(Zc),ed=e=>qc(e.agentInjectedStatus)||qc(e.odigosHealthStatus)||(e.containers??[]).some(Qc),td=({onClose:o,effectiveConfig:a,sourceId:i,fetchSourceById:s,persistSources:u,updateSource:p,restartWorkloads:h,restartPod:m,recoverFromRollback:g,fetchPeerSources:b,enableProfiling:v,fetchProfilingSlots:C,fetchSourceProfiling:S,fetchK8sManifest:w})=>{const x=f(),{isVm:k}=y(),{selectedStreamName:T}=Fe(),{genericForm:$,loadSource:N,validateFormData:I}=Tl(),[E,O]=l(!1),[A,D]=l(!1),[R,F]=l(!1),[P,L]=l(cr.Overview),[_,M]=l(null),[B,z]=l({openFor:null}),X=(()=>{const[e,t]=l(null),o=c(e=>{t({tab:cr.Pods,podName:e.podName})},[]),n=c((e,o)=>{t({tab:cr.Pods,podName:e.podName,containerName:o.containerName})},[]),a=c((e,o,n)=>{const a=Cr({identifyingAttributes:n.identifyingAttributes});t({tab:cr.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),i=c(()=>t(null),[]);return r(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:a,clearJumpToTarget:i}),[e,o,n,a,i])})();n(()=>{X.jumpToTarget&&L(X.jumpToTarget.tab)},[X.jumpToTarget]),n(()=>{_&&JSON.stringify(Wt(i))!==JSON.stringify(Wt(_))&&M(null)},[i,_]);const U=d(!1),H=c(async()=>M(await s(i)||null),[i]);n(()=>{if(U.current||(H(),U.current=!0),!E){const e=setInterval(()=>H(),3e3);return()=>clearInterval(e)}},[H,E]),n(()=>{_&&N(_)},[_]);const j=_&&Yc.includes(_.id.kind),W=r(()=>{const e=[],o=(_?.pods??[]).some(ed);return e.push({value:cr.Overview,label:Re.OVERVIEW}),e.push({value:cr.Pods,label:Re.PODS,icon:o?e=>t(Ii,{...e,fill:x.v2.colors.red[500]}):void 0}),k||e.push({value:cr.PeerSources,label:Re.PEER_SOURCES}),a?.profiling?.enabled&&e.push({value:cr.Profiling,label:Re.PROFILING}),k||e.push({value:cr.Debug,label:Re.DEBUG}),e},[k,a,_?.pods]),G=c(()=>O(!0),[]),K=c(()=>{_&&N(_),O(!1)},[_]),Y=c(async()=>{if(!_||!$)return;const{errorMessage:e,preparedFormData:t}=I();if(e)return;const o=t.otelServiceName!==_.id.name?t.otelServiceName:"";await p(i,{...t,otelServiceName:o}),O(!1)},[_,$,I,i,p]),J=c(()=>D(!0),[]),q=c(async()=>{_&&(await u({[mt]:[{namespace:_.id.namespace,name:_.id.name,kind:_.id.kind,selected:!1,currentStreamName:T}]}),D(!1),o())},[_,u,T,o]),Z=c(()=>{z({openFor:Jc.Workload})},[]),Q=c(e=>{L(e),X.clearJumpToTarget()},[X]),ee=c(async()=>{await g(i)},[g,i]),te=c(async()=>{B.openFor===Jc.Workload?await h([i]):B.openFor===Jc.Pod&&B.podNamespace&&B.podName&&await m(B.podNamespace,B.podName),z({openFor:null})},[B,h,m,i]),oe=r(()=>{const e=[];return E||P===cr.Overview&&(e.push({id:"edit-source-btn-edit",label:bt.EDIT,icon:di,active:E,onClick:G}),!k&&j&&e.push({id:"edit-source-btn-restart",label:bt.RESTART,icon:Bi,onClick:Z}),e.push({id:"edit-source-btn-delete",label:bt.DELETE,icon:ai,color:x.v2.colors.red[500],active:A,onClick:J})),e},[P,E,A,k,j,G,Z,J,x]),ne=r(()=>{if(!_)return[];const e=[],t={backgroundColor:"transparent",textSize:ce.S};return e.push({...t,label:_.id.name,leftIcon:$i}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:Ti,textColor:x.v2.colors.silver[200]}),e},[_,x]);if(!_)return t(ft,{isOpen:!0,children:t(Ke,{$height:"80vh",children:t(Qe,{withSpinner:!0})})});const ie=P===cr.Profiling?R?"95vw":"80vw":E?void 0:"60vw";return e($r,{value:X,children:[t(ft,{isOpen:!0,width:ie,header:{icon:po(_.containers)[0],titleBadges:ne,onClose:()=>{Q(cr.Overview),M(null),F(!1),o()},actions:oe},footer:{actions:E?[{"data-id":"edit-source-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:K},{"data-id":"edit-source-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:Y}]:[]},children:t(vt,{$padding:"4px 12px 12px",children:e(V,{$gap:16,children:[!E&&W.length>1&&t(ue,{options:W,selected:P,setSelected:Q}),(()=>{switch(P){case cr.Overview:return E?t(hs,{}):t(vc,{source:_,onClickRollout:Z,onClickRollback:ee,onOverride:e=>p(i,e)});case cr.Pods:return t(Dr,{source:_,onClickRestartPod:j?(e,t)=>z({openFor:Jc.Pod,podNamespace:e,podName:t}):void 0});case cr.PeerSources:return t(Rr,{source:_,fetchPeerSources:b});case cr.Profiling:return t(Kc,{source:_,fetchProfilingSlots:C,enableProfiling:v,fetchSourceProfiling:S,onFlameFullscreenChange:F});case cr.Debug:return t(yc,{source:_,fetchK8sManifest:w});default:return null}})()]})})}),t(gl,{target:"source",action:"uninstrument",isOpen:A,onClose:()=>D(!1),onApprove:q}),t(gl,{target:`${B.openFor?.toLowerCase()??""}`,action:"restart",description:Re.RESTART_POD_DESCRIPTION,isOpen:!!B.openFor,onClose:()=>z({openFor:null}),onApprove:te,overrideApproveButtonLabel:Re.DELETE_POD_TO_RESTART})]})},od=g.div`
358
+ `,wd=({source:o,fetchProfilingSlots:c,enableProfiling:d,fetchSourceProfiling:u,onFlameFullscreenChange:p})=>{const h=f(),g=o.id,[m,b]=r(!0),[v,y]=r(null),[C,S]=r(null),[w,x]=r(0),[k,T]=r(gd.Both),[$,E]=r(""),[I,N]=r({}),A=i(null),O=l(async()=>{try{const e=[c()];m&&e.push(u(g));const[t,o]=await Promise.all(e);t&&y(t),o?.profileJson&&S(o.profileJson)}finally{x(e=>e+1)}},[c,u,g]);n(()=>{let e=!1;return(async()=>{await d(g),e||(await O(),e||(A.current=setInterval(O,3e3)))})(),()=>{e=!0,A.current&&clearInterval(A.current)}},[d,O,g]);const D=a(()=>function(e){if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}}(C),[C]),R=a(()=>D?function(e){const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const a=n[o+1],i=n[o+2],l=Kc(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||a>r.total)&&t.set(l,{self:i,total:a})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)}(D.flamebearer):[],[D]),P=a(()=>{const e=$.trim().toLowerCase();return e?R.filter(t=>t.name.toLowerCase().includes(e)):R},[R,$]),F=k===gd.Table||k===gd.Both,L=k===gd.Flame||k===gd.Both,_=F&&L,z=o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),M=a(()=>function(e,t){if(!t?.includes(go.Java))return;const o=e?.[sd.Symbol]?.filter(Boolean)??[];return 0!==o.length?e=>ud(e,o):void 0}(I,z),[I,z]);return!C&&w<2?t(Qe,{$height:"70vh",children:t(at,{withSpinner:!0})}):e(md,{$gap:0,$width:"100%",children:[e(fd,{children:[t(Ie,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(bd,{children:t(Q,{size:te.S,weight:500,color:ee.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(oe,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(Kt,{value:$,onChange:E,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:h.v2.colors.silver[900],emphasizeBackgroundColor:h.v2.colors.silver[800]})}),t(le,{variant:ho.Filled,options:[{value:gd.Table,label:"Top table"},{value:gd.Flame,label:"Flame graph"},{value:gd.Both,label:"Both"}],selected:k,setSelected:T}),t(ne,m?{variant:ie.Secondary,size:ae.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(Mi,{...e,size:8,fill:h.v2.colors.green[500]})}:{variant:ie.Secondary,size:ae.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(Mi,{...e,size:8,fill:h.v2.colors.red[500]})})]})]}),t(vd,{$gap:F&&L?16:0,children:D?e(s,{children:[F&&e(yd,{$splitWithFlame:_,children:[t(Sd,{$justifyContent:"flex-end",children:t(ne,{variant:ie.Secondary,size:ae.S,label:"Download snapshot",rightIcon:Bi,onClick:()=>{if(!C)return;const e=new Blob([C],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!C})}),t(hd,{rows:P,languages:z,filters:I,onFiltersChange:N})]}),L&&e(Cd,{$splitWithTable:_,children:[e(Sd,{$justifyContent:"space-between",children:[t(Fe,{label:D?`Total in view ${Yc(D.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:h.v2.colors.silver[750],textColor:h.v2.colors.silver[200],textSize:te.XXS}),e(oe,{$gap:12,children:[!m&&t(ne,{variant:ie.Secondary,size:ae.S,label:"Refresh",leftIcon:Ni,onClick:O}),t(K,{label:"Auto refresh",labelAlign:Y.Left,size:gt.S,value:m,onChange:b})]})]}),t(rd,{flamebearer:D.flamebearer,maxRowPx:24,searchQuery:$,shouldKeepName:M,minHostHeight:280,onFullscreenChange:p,profilingSlots:v},k)]})]}):t(Qe,{children:t(me,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})})]})},xd=[uo.Deployment,uo.StatefulSet,uo.DaemonSet,uo.DeploymentConfig,uo.Rollout,uo.Pod];var kd;!function(e){e.Workload="Workload",e.Pod="Pod"}(kd||(kd={}));const Td=e=>!!e&&Xt(e.status)===we.Error,$d=e=>Td(e.healthStatus),Ed=e=>Td(e.odigosHealthStatus)||(e.processes??[]).some($d),Id=e=>Td(e.agentInjectedStatus)||Td(e.odigosHealthStatus)||(e.containers??[]).some(Ed),Nd=({onClose:o,effectiveConfig:s,sourceId:c,fetchSourceById:d,persistSources:u,updateSource:p,restartWorkloads:h,restartPod:g,recoverFromRollback:m,fetchPeerSources:b,enableProfiling:v,fetchProfilingSlots:C,fetchSourceProfiling:S,fetchK8sManifest:w})=>{const x=f(),{isVm:k}=y(),{selectedStreamName:T}=Be(),{genericForm:$,loadSource:E,validateFormData:I}=$l(),[N,A]=r(!1),[O,D]=r(!1),[R,P]=r(!1),[F,L]=r(_s.Overview),[_,z]=r(null),[M,B]=r({openFor:null}),X=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:_s.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:_s.Pods,podName:e.podName,containerName:o.containerName})},[]),i=l((e,o,n)=>{const a=Ks({identifyingAttributes:n.identifyingAttributes});t({tab:_s.Pods,podName:e.podName,containerName:o.containerName,processPid:a})},[]),s=l(()=>t(null),[]);return a(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:i,clearJumpToTarget:s}),[e,o,n,i,s])})();n(()=>{X.jumpToTarget&&L(X.jumpToTarget.tab)},[X.jumpToTarget]),n(()=>{_&&JSON.stringify(qt(c))!==JSON.stringify(qt(_))&&z(null)},[c,_]);const U=i(!1),H=l(async()=>z(await d(c)||null),[c]);n(()=>{if(U.current||(H(),U.current=!0),!N){const e=setInterval(()=>H(),3e3);return()=>clearInterval(e)}},[H,N]),n(()=>{_&&E(_)},[_]);const j=_&&xd.includes(_.id.kind),G=a(()=>{const e=[],o=(_?.pods??[]).some(Id);return e.push({value:_s.Overview,label:Me.OVERVIEW}),e.push({value:_s.Pods,label:Me.PODS,icon:o?e=>t(Ai,{...e,fill:x.v2.colors.red[500]}):void 0}),k||e.push({value:_s.PeerSources,label:Me.PEER_SOURCES}),s?.profiling?.enabled&&e.push({value:_s.Profiling,label:Me.PROFILING}),k||e.push({value:_s.Debug,label:Me.DEBUG}),e},[k,s,_?.pods]),W=l(()=>A(!0),[]),K=l(()=>{_&&E(_),A(!1)},[_]),Y=l(async()=>{if(!_||!$)return;const{errorMessage:e,preparedFormData:t}=I();if(e)return;const o=t.otelServiceName!==_.id.name?t.otelServiceName:"";await p(c,{...t,otelServiceName:o}),A(!1)},[_,$,I,c,p]),J=l(()=>D(!0),[]),Z=l(async()=>{_&&(await u({[yt]:[{namespace:_.id.namespace,name:_.id.name,kind:_.id.kind,selected:!1,currentStreamName:T}]}),D(!1),o())},[_,u,T,o]),Q=l(()=>{B({openFor:kd.Workload})},[]),ee=l(e=>{L(e),X.clearJumpToTarget()},[X]),oe=l(async()=>{await m(c)},[m,c]),ne=l(async()=>{M.openFor===kd.Workload?await h([c]):M.openFor===kd.Pod&&M.podNamespace&&M.podName&&await g(M.podNamespace,M.podName),B({openFor:null})},[M,h,g,c]),ae=a(()=>{const e=[];return N||F===_s.Overview&&(e.push({id:"edit-source-btn-edit",label:St.EDIT,icon:pi,active:N,onClick:W}),!k&&j&&e.push({id:"edit-source-btn-restart",label:St.RESTART,icon:Xi,onClick:Q}),e.push({id:"edit-source-btn-delete",label:St.DELETE,icon:ii,color:x.v2.colors.red[500],active:O,onClick:J})),e},[F,N,O,k,j,W,Q,J,x]),re=a(()=>{if(!_)return[];const e=[],t={backgroundColor:"transparent",textSize:te.S};return e.push({...t,label:_.id.name,leftIcon:Ii}),_.serviceName&&_.serviceName!==_.id.name&&e.push({...t,label:_.serviceName,leftIcon:Ei,textColor:x.v2.colors.silver[200]}),e},[_,x]);if(!_)return t(q,{isOpen:!0,children:t(Qe,{$height:"80vh",children:t(at,{withSpinner:!0})})});const se=F===_s.Profiling?R?"95vw":"80vw":N?void 0:"60vw";return e(ec,{value:X,children:[t(q,{isOpen:!0,width:se,header:{icon:bo(_.containers)[0],titleBadges:re,onClose:()=>{ee(_s.Overview),z(null),P(!1),o()},actions:ae},footer:{actions:N?[{"data-id":"edit-source-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:K},{"data-id":"edit-source-btn-save",label:St.SAVE,variant:ie.Primary,onClick:Y}]:[]},children:t(wt,{$padding:"4px 12px 12px",children:e(V,{$gap:16,children:[!N&&G.length>1&&t(le,{options:G,selected:F,setSelected:ee}),(()=>{switch(F){case _s.Overview:return N?t(Mr,{}):t(Gc,{source:_,onClickRollout:Q,onClickRollback:oe,onOverride:e=>p(c,e)});case _s.Pods:return t(lc,{source:_,onClickRestartPod:j?(e,t)=>B({openFor:kd.Pod,podNamespace:e,podName:t}):void 0});case _s.PeerSources:return t(rc,{source:_,fetchPeerSources:b});case _s.Profiling:return t(wd,{source:_,fetchProfilingSlots:C,enableProfiling:v,fetchSourceProfiling:S,onFlameFullscreenChange:P});case _s.Debug:return t(Wc,{source:_,fetchK8sManifest:w});default:return null}})()]})})}),t(fl,{target:"source",action:"uninstrument",isOpen:O,onClose:()=>D(!1),onApprove:Z}),t(fl,{target:`${M.openFor?.toLowerCase()??""}`,action:"restart",description:Me.RESTART_POD_DESCRIPTION,isOpen:!!M.openFor,onClose:()=>B({openFor:null}),onApprove:ne,overrideApproveButtonLabel:Me.DELETE_POD_TO_RESTART})]})},Ad=m.div`
248
359
  display: flex;
249
360
  align-items: center;
250
361
  gap: 8px;
@@ -254,9 +365,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
254
365
  &:hover {
255
366
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
256
367
  }
257
- `,nd=g.div`
368
+ `,Od=m.div`
258
369
  flex: 1;
259
- `,ad=({onClick:o})=>{const n=f().v2.colors.red[500];return e(od,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(re,{size:ce.XS,weight:500,color:n,children:fo}),t(ai,{size:16,fill:n})]})};function id(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:s}=n;return{children:e(o,{children:[t(ad,{onClick:l}),s&&t(me,{status:ge.Warning,message:s.message,action:s.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:s.onViewRule}:void 0}),t(nd,{}),t(oe,{"data-id":"sampling-view-edit-btn-cancel",label:ho,variant:ae.Secondary,size:ne.S,onClick:a}),t(oe,{"data-id":"sampling-view-edit-btn-save",label:mo,variant:ae.Primary,size:ne.S,onClick:i,disabled:!!s})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(ad,{onClick:a}),t(nd,{}),t(oe,{"data-id":"sampling-view-btn-cancel",label:ho,variant:ae.Secondary,size:ne.S,onClick:i}),t(oe,{"data-id":"sampling-view-btn-edit",label:go,variant:ae.Primary,size:ne.S,onClick:l})]})}}const ld={[Nl.EditAutoNoisy]:{title:No,subTitle:$o,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Nl.EditAutoCostReduction]:{title:To,subTitle:ko,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Nl.EditAutoHighlyRelevant]:{title:xo,subTitle:wo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},sd=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(ft,{isOpen:e,width:Eo,header:{icon:zi,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(vt,{$padding:"12px",children:t(ys,{})})}),rd=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:l})=>{const{category:s,formData:r,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=$l(Nl.Create);n(()=>{e&&d()},[e]);const h=c(()=>{if(i){const e=i(r);if(e)return void p(e)}a(r)},[r,a,i,p]),m={note:u?{status:ge.Warning,message:u.message,action:l?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>l(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:ho,variant:ae.Secondary,size:ne.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:Co,variant:ae.Primary,size:ne.S,onClick:h,disabled:!!u}]};return t(sd,{isOpen:e,title:So[s],subTitle:bo[s],onClose:o,footer:m})},cd=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:a,onNavigateToDuplicate:i})=>{const{data:l,isEditing:s,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:m}=$l(Nl.View),g=l?.rule.name||yo,f=s&&l?vo[l.category]:`${g} preview`,b=c(()=>{if(l&&s){if(a){const e=a(d);if(e)return void m(e)}n(d,l.rule.ruleId,l.samplingId)}},[l,s,d,n,a,m]),v=c(()=>{l&&o(l.rule.ruleId,l.samplingId)},[l,o]),y=r(()=>{if(!l)return;const t=h?{message:h.message,onViewRule:i?()=>i(h.ruleId):void 0}:null;return id(s?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[l,s,h,p,b,v,u,e,i]);return t(sd,{isOpen:!!l,title:f,subTitle:l?bo[l.category]:"",onClose:e,footer:y})},dd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=$l(Nl.EditAutoNoisy),l=c(()=>n(a,i),[n,a,i]);return t(hd,{formType:Nl.EditAutoNoisy,isOpen:e,onClose:o,onSave:l})},ud=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=$l(Nl.EditAutoCostReduction),l=c(()=>n(a,i),[n,a,i]);return t(hd,{formType:Nl.EditAutoCostReduction,isOpen:e,onClose:o,onSave:l})},pd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=$l(Nl.EditAutoHighlyRelevant),i=c(()=>n(a),[n,a]);return t(hd,{formType:Nl.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},hd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=ld[e];return t(sd,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:ho,variant:ae.Secondary,size:ne.S,onClick:n},{"data-id":i.saveId,label:Io,variant:ae.Primary,size:ne.S,onClick:a}]}})},md=e=>{switch(e.formType){case Nl.Create:return t(Rl,{formType:Nl.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(rd,{...e})});case Nl.View:return t(Rl,{formType:Nl.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(cd,{...e})});case Nl.EditAutoNoisy:return t(Rl,{formType:Nl.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(dd,{...e})});case Nl.EditAutoCostReduction:return t(Rl,{formType:Nl.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(ud,{...e})});case Nl.EditAutoHighlyRelevant:return t(Rl,{formType:Nl.EditAutoHighlyRelevant,enabled:e.enabled,children:t(pd,{...e})})}},gd=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:s,onSave:r,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=qt(),m=!i||a||!c.newToken;return Oo({key:"Enter",active:!m},r),e(te,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(W,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(te,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(Qe,{title:"Saving...",withGradient:!0}):e(o,{children:[t(oe,{variant:ae.Secondary,size:ne.S,leftIcon:yi,onClick:s,disabled:a}),t(oe,{variant:ae.Primary,size:ne.S,leftIcon:vi,onClick:r,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(re,{size:ce.XS,children:new Array(55).fill("•").join("")}),e(te,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(qe,{icon:di,onClick:l})]})]})},fd=({expiresAt:e,callbackValid:o,callbackExpired:a})=>{const{formatTimeAgo:i}=At(),l=r(()=>i(e),[e,i]),s=r(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=r(()=>Ao(e,0)?ge.Error:Ao(e,2592e6)?ge.Warning:ge.Success,[e]),d=r(()=>c===ge.Success?vi:c===ge.Warning?Xi:Ii,[c]);return n(()=>{c===ge.Success?o():c===ge.Error&&a()},[c]),t(we,{text:s,children:t(Ee,{leftIcon:d,label:l,status:c,invertColors:!0,useSecondaryTone:!0})})},bd=g.div`
370
+ `,Dd=({onClick:o})=>{const n=f().v2.colors.red[500];return e(Ad,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(Q,{size:te.XS,weight:500,color:n,children:So}),t(ii,{size:16,fill:n})]})};function Rd(n){if(n.isEditing){const{onCancelEdit:a,onSave:i,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Dd,{onClick:l}),r&&t(Se,{status:we.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Od,{}),t(ne,{"data-id":"sampling-view-edit-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:a}),t(ne,{"data-id":"sampling-view-edit-btn-save",label:yo,variant:ie.Primary,size:ae.S,onClick:i,disabled:!!r})]})}}const{onDelete:a,onCancel:i,onEdit:l}=n;return{children:e(o,{children:[t(Dd,{onClick:a}),t(Od,{}),t(ne,{"data-id":"sampling-view-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:i}),t(ne,{"data-id":"sampling-view-btn-edit",label:Co,variant:ie.Primary,size:ae.S,onClick:l})]})}}const Pd={[Il.EditAutoNoisy]:{title:Do,subTitle:Oo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Il.EditAutoCostReduction]:{title:Ao,subTitle:No,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Il.EditAutoHighlyRelevant]:{title:Io,subTitle:Eo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},Fd=({isOpen:e,title:o,subTitle:n,onClose:a,footer:i,renderBody:l})=>t(q,{isOpen:e,width:Po,header:{icon:Vi,title:o,subTitle:n,onClose:a},footer:i,children:l?l():t(wt,{$padding:"12px",children:t(jr,{})})}),Ld=({isOpen:e,onClose:o,onSubmit:a,validateForm:i,onNavigateToDuplicate:r})=>{const{category:s,formData:c,resetForm:d,duplicateWarning:u,setDuplicateWarning:p}=El(Il.Create);n(()=>{e&&d()},[e]);const h=l(()=>{if(i){const e=i(c);if(e)return void p(e)}a(c)},[c,a,i,p]),g={note:u?{status:we.Warning,message:u.message,action:r?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>r(u.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:vo,variant:ie.Secondary,size:ae.S,onClick:o},{"data-id":"sampling-create-btn-submit",label:To,variant:ie.Primary,size:ae.S,onClick:h,disabled:!!u}]};return t(Fd,{isOpen:e,title:$o[s],subTitle:wo[s],onClose:o,footer:g})},_d=({onClose:e,onDelete:o,onSaveEdit:n,validateForm:i,onNavigateToDuplicate:r})=>{const{data:s,isEditing:c,formData:d,handleEdit:u,handleCancelEdit:p,duplicateWarning:h,setDuplicateWarning:g}=El(Il.View),m=s?.rule.name||ko,f=c&&s?xo[s.category]:`${m} preview`,b=l(()=>{if(s&&c){if(i){const e=i(d);if(e)return void g(e)}n(d,s.rule.ruleId,s.samplingId)}},[s,c,d,n,i,g]),v=l(()=>{s&&o(s.rule.ruleId,s.samplingId)},[s,o]),y=a(()=>{if(!s)return;const t=h?{message:h.message,onViewRule:r?()=>r(h.ruleId):void 0}:null;return Rd(c?{isEditing:!0,onCancelEdit:p,onSave:b,onDelete:v,duplicateWarning:t}:{isEditing:!1,onDelete:v,onCancel:e,onEdit:u})},[s,c,h,p,b,v,u,e,r]);return t(Fd,{isOpen:!!s,title:f,subTitle:s?wo[s.category]:"",onClose:e,footer:y})},zd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=El(Il.EditAutoNoisy),r=l(()=>n(a,i),[n,a,i]);return t(Xd,{formType:Il.EditAutoNoisy,isOpen:e,onClose:o,onSave:r})},Md=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a,resolvedPercentage:i}=El(Il.EditAutoCostReduction),r=l(()=>n(a,i),[n,a,i]);return t(Xd,{formType:Il.EditAutoCostReduction,isOpen:e,onClose:o,onSave:r})},Bd=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:a}=El(Il.EditAutoHighlyRelevant),i=l(()=>n(a),[n,a]);return t(Xd,{formType:Il.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:i})},Xd=({formType:e,isOpen:o,onClose:n,onSave:a})=>{const i=Pd[e];return t(Fd,{isOpen:o,title:i.title,subTitle:i.subTitle,onClose:n,footer:{actions:[{"data-id":i.cancelId,label:vo,variant:ie.Secondary,size:ae.S,onClick:n},{"data-id":i.saveId,label:Ro,variant:ie.Primary,size:ae.S,onClick:a}]}})},Vd=e=>{switch(e.formType){case Il.Create:return t(Pl,{formType:Il.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Ld,{...e})});case Il.View:return t(Pl,{formType:Il.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(_d,{...e})});case Il.EditAutoNoisy:return t(Pl,{formType:Il.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(zd,{...e})});case Il.EditAutoCostReduction:return t(Pl,{formType:Il.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Md,{...e})});case Il.EditAutoHighlyRelevant:return t(Pl,{formType:Il.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Bd,{...e})})}},Ud=({token:n,isLoading:a,isEditing:i,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=oo(),g=!i||a||!c.newToken;return Fo({key:"Enter",active:!g},s),e(oe,i?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(pe,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(oe,{$margin:a?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:a?t(at,{title:"Saving...",withGradient:!0}):e(o,{children:[t(ne,{variant:ie.Secondary,size:ae.S,leftIcon:Si,onClick:r,disabled:a}),t(ne,{variant:ie.Primary,size:ae.S,leftIcon:Ci,onClick:s,disabled:g})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(Q,{size:te.XS,children:new Array(55).fill("•").join("")}),e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(ot,{icon:pi,onClick:l})]})]})},Hd=({expiresAt:e,callbackValid:o,callbackExpired:i})=>{const{formatTimeAgo:l}=Lt(),r=a(()=>l(e),[e,l]),s=a(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=a(()=>Lo(e,0)?we.Error:Lo(e,2592e6)?we.Warning:we.Success,[e]),d=a(()=>c===we.Success?Ci:c===we.Warning?Ui:Ai,[c]);return n(()=>{c===we.Success?o():c===we.Error&&i()},[c]),t(Ie,{text:s,children:t(Fe,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},jd=m.div`
260
371
  display: flex;
261
372
  flex-direction: column;
262
373
  gap: 12px;
@@ -264,7 +375,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
264
375
  border-radius: 12px;
265
376
  border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
266
377
  background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
267
- `,vd=({children:e})=>{const o=f();return t(re,{size:ce.XXXS,color:o.v2.colors.grey[150],children:e})},yd=({token:o,updateToken:n})=>{const[a,i]=l(!1),[s,r]=l(!1),[c,d]=l(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=wt({newToken:""});return t(Ue,{richTitle:{icon:Vi,title:"Odigos Pro Token"},children:e(bd,{$isExpired:c,children:[e(te,{$justifyContent:"space-between",children:[e(V,{$gap:4,children:[t(vd,{children:"Issued for"}),t(re,{size:ce.XS,children:o.name||"N/A"})]}),e(V,{$gap:4,children:[t(vd,{children:"Expiration"}),t(fd,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(V,{})]}),t(te,{children:e(V,{children:[t(vd,{children:"Token"}),t(gd,{token:o.token,newToken:u.newToken,isLoading:s,isEditing:a,onEdit:()=>i(!0),onCancel:()=>(i(!1),r(!1),void p("newToken","")),onSave:()=>(async()=>{r(!0);const e=await n(u.newToken.trim());r(!1),e?.error?m("newToken",e.error):(i(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},Cd=g.div`
378
+ `,Gd=({children:e})=>{const o=f();return t(Q,{size:te.XXXS,color:o.v2.colors.grey[150],children:e})},Wd=({token:o,updateToken:n})=>{const[a,i]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:g,resetFormData:m}=$t({newToken:""});return t(Ye,{richTitle:{icon:Hi,title:"Odigos Pro Token"},children:e(jd,{$isExpired:c,children:[e(oe,{$justifyContent:"space-between",children:[e(V,{$gap:4,children:[t(Gd,{children:"Issued for"}),t(Q,{size:te.XS,children:o.name||"N/A"})]}),e(V,{$gap:4,children:[t(Gd,{children:"Expiration"}),t(Hd,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(V,{})]}),t(oe,{children:e(V,{children:[t(Gd,{children:"Token"}),t(Ud,{token:o.token,newToken:u.newToken,isLoading:l,isEditing:a,onEdit:()=>i(!0),onCancel:()=>(i(!1),s(!1),void p("newToken","")),onSave:()=>(async()=>{s(!0);const e=await n(u.newToken.trim());s(!1),e?.error?g("newToken",e.error):(i(!1),m())})(),formData:u,handleFormChange:p,handleErrorChange:g,formErrors:h})]})})]})})},Kd=m.div`
268
379
  display: flex;
269
380
  flex-direction: column;
270
381
  align-items: center;
@@ -273,23 +384,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
273
384
  padding: 12px 24px;
274
385
  border-radius: 8px;
275
386
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
276
- `,Sd=({downloadDiagnose:o})=>{const{progress:n}=ut(),{namespaces:a}=at(),[i,s]=l(null),{formData:r,handleFormChange:c,resetFormData:d}=wt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ue,{richTitle:{icon:Ui,title:"Diagnose"},children:i?e(Cd,{children:[t(Qe,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[pt.DownloadingDiagnose]?.percentage,percentage:n[pt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[pt.DownloadingDiagnose]?.percentage,visualIcon:Mi,startedAt:i}),n[pt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[pt.DownloadingDiagnose].list.map(o=>e(te,{$gap:4,$alignItems:"center",children:[o.status===ge.Success?t(vi,{size:16}):o.status===ge.Error?t(yi,{size:16}):t(Qe,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(re,{size:ce.XXS,color:Ce.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(V,{$gap:16,children:[e(te,{$gap:8,children:[t(H,{label:"Profiles",value:r.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:"Include pprof profiles"})]}),e(te,{$gap:8,children:[t(H,{label:"Metrics",value:r.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:"Include Prometheus metrics"})]}),e(te,{$gap:8,children:[t(H,{label:"Source Workloads",value:r.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(re,{size:ce.XXXS,color:Ce.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Do,{alignX:Fo.Left,alignY:Ro.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:r.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(r.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:ae.Secondary,disabled:r.includeSourceWorkloads,leftIcon:r.sourceWorkloadNamespaces.length?()=>t(Ee,{label:r.sourceWorkloadNamespaces.length,status:ge.Default}):void 0}}),t(te,{$justifyContent:"flex-end",children:t(oe,{label:"Download Diagnose",rightIcon:Mi,variant:ae.Primary,onClick:async()=>{s(Date.now()),await o(r),s(null),d()},disabled:null!==i})})]})})},wd=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[s,r]=l(null);return n(()=>{e().then(({data:e})=>r(e?.describeOdigos||null))},[]),t(Ue,{richTitle:{icon:Hi,title:"General Information"},children:t(yt,{cellsPerRow:2,items:[{id:Po(),title:"Odigos Version",label:a},{id:Po(),title:`${o.toUpperCase()} Version`,label:s?.kubernetesVersion?.value||"-"},{id:Po(),title:"Installation Method",label:s?.installationMethod?.value||"-"},{id:Po(),title:"Tier",label:i}]})})},xd=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:s})=>e(ft,{isOpen:o,header:{icon:Hi,title:"System Overview",onClose:n},children:[l&&t(wd,{fetchDescribeOdigos:l}),i&&a&&t(yd,{token:a,updateToken:i}),s&&t(Sd,{downloadDiagnose:s})]}),kd=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:l})=>{const{addDataStreams:s,setSelectedStreamName:r}=Fe(),{requestSubmit:d}=kl(),u=c(async e=>{l?await l(e):(s([e]),r(e.name)),a()},[l,s,r,a]),p=c(()=>d(u),[d,u]);return Oo({key:"Enter",active:n},p),e(o,{children:[t(De,{isOpen:n,onClose:a,onCloseEnd:i,title:Re.NAME_YOUR_STREAM,description:Re.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:bt.DONE,variant:ae.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:a},children:t(ps,{autoFocus:!0})}),t(us,{})]})},Td=({isOpen:a,onClose:i,onCloseEnd:l,dataStreamName:s,updateDataStream:r})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=kl();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,m=c(async e=>{await r(s,e),i()},[r,s,i]),g=c(()=>p(m),[p,m]);return Oo({key:"Enter",active:a},g),e(o,{children:[t(De,{isOpen:a,onClose:i,onCloseEnd:l,title:Re.RENAME_STREAM(s),description:Re.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:bt.SAVE,variant:ae.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:bt.CANCEL,variant:ae.Secondary,onClick:i},children:t(ps,{autoFocus:!0})}),t(us,{})]})},$d=({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)"})})]})]}),Nd=g.div`
387
+ `,Yd=({downloadDiagnose:o})=>{const{progress:n}=ft(),{namespaces:a}=ct(),[i,l]=r(null),{formData:s,handleFormChange:c,resetFormData:d}=$t({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(Ye,{richTitle:{icon:ji,title:"Diagnose"},children:i?e(Kd,{children:[t(at,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof n[bt.DownloadingDiagnose]?.percentage,percentage:n[bt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof n[bt.DownloadingDiagnose]?.percentage,visualIcon:Bi,startedAt:i}),n[bt.DownloadingDiagnose]?.list?.length&&t(V,{$width:"100%",children:n[bt.DownloadingDiagnose].list.map(o=>e(oe,{$gap:4,$alignItems:"center",children:[o.status===we.Success?t(Ci,{size:16}):o.status===we.Error?t(Si,{size:16}):t(at,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(Q,{size:te.XXXS,color:ee.Secondary,children:o.label})]},o.label))})]}):e(V,{$gap:24,children:[t(Q,{size:te.XXS,color:ee.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(V,{$gap:16,children:[e(oe,{$gap:8,children:[t(H,{label:"Profiles",value:s.includeProfiles,onChange:e=>c("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include pprof profiles"})]}),e(oe,{$gap:8,children:[t(H,{label:"Metrics",value:s.includeMetrics,onChange:e=>c("includeMetrics",e)}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include Prometheus metrics"})]}),e(oe,{$gap:8,children:[t(H,{label:"Source Workloads",value:s.includeSourceWorkloads,onChange:e=>{c("includeSourceWorkloads",e),e&&c("sourceWorkloadNamespaces",[])}}),t(Q,{size:te.XXXS,color:ee.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(_o,{alignX:Mo.Left,alignY:zo.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:s.sourceWorkloadNamespaces,setSelectedIds:e=>c("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(s.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:ie.Secondary,disabled:s.includeSourceWorkloads,leftIcon:s.sourceWorkloadNamespaces.length?()=>t(Fe,{label:s.sourceWorkloadNamespaces.length,status:we.Default}):void 0}}),t(oe,{$justifyContent:"flex-end",children:t(ne,{label:"Download Diagnose",rightIcon:Bi,variant:ie.Primary,onClick:async()=>{l(Date.now()),await o(s),l(null),d()},disabled:null!==i})})]})})},Jd=({fetchDescribeOdigos:e})=>{const{platformType:o,version:a,tier:i}=y(),[l,s]=r(null);return n(()=>{e().then(({data:e})=>s(e?.describeOdigos||null))},[]),t(Ye,{richTitle:{icon:Gi,title:"General Information"},children:t(xt,{cellsPerRow:2,items:[{id:Bo(),title:"Odigos Version",label:a},{id:Bo(),title:`${o.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:Bo(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:Bo(),title:"Tier",label:i}]})})},qd=({isOpen:o,onClose:n,token:a,updateToken:i,fetchDescribeOdigos:l,downloadDiagnose:r})=>e(q,{isOpen:o,header:{icon:Gi,title:"System Overview",onClose:n},children:[l&&t(Jd,{fetchDescribeOdigos:l}),i&&a&&t(Wd,{token:a,updateToken:i}),r&&t(Yd,{downloadDiagnose:r})]}),Zd=({isOpen:n,onClose:a,onCloseEnd:i,createDataStream:r})=>{const{addDataStreams:s,setSelectedStreamName:c}=Be(),{requestSubmit:d}=Tl(),u=l(async e=>{r?await r(e):(s([e]),c(e.name)),a()},[r,s,c,a]),p=l(()=>d(u),[d,u]);return Fo({key:"Enter",active:n},p),e(o,{children:[t(ze,{isOpen:n,onClose:a,onCloseEnd:i,title:Me.NAME_YOUR_STREAM,description:Me.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:St.DONE,variant:ie.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:a},children:t(zr,{autoFocus:!0})}),t(_r,{})]})},Qd=({isOpen:a,onClose:i,onCloseEnd:r,dataStreamName:s,updateDataStream:c})=>{const{genericForm:d,loadDataStream:u,requestSubmit:p}=Tl();n(()=>{a&&s&&u(s)},[a,s]);const h=!!d?.isFormDirty,g=l(async e=>{await c(s,e),i()},[c,s,i]),m=l(()=>p(g),[p,g]);return Fo({key:"Enter",active:a},m),e(o,{children:[t(ze,{isOpen:a,onClose:i,onCloseEnd:r,title:Me.RENAME_STREAM(s),description:Me.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:St.SAVE,variant:ie.Primary,onClick:m,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:St.CANCEL,variant:ie.Secondary,onClick:i},children:t(zr,{autoFocus:!0})}),t(_r,{})]})},eu=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),tu=m.div`
277
388
  position: absolute;
278
389
  top: 50%;
279
390
  left: 50%;
280
391
  transform: translate(-50%, -50%);
281
392
  z-index: ${({theme:e})=>e.v2.zIndex.modal};
282
- `,Id="onboarding-done",Ed=()=>{const{currentModal:o,setCurrentModal:n}=Lo(),a=()=>n("");return e(_o,{isOpen:o===Id,onClose:a,children:[t($d,{}),t(Nd,{children:e(V,{$gap:32,$alignItems:"center",children:[e(V,{$gap:24,$alignItems:"center",children:[t(re,{size:ce.L,weight:500,children:"Welcome to"}),t(vl,{size:260}),t(re,{size:ce.S,weight:400,children:"Your observability control plane is ready."})]}),t(oe,{label:"Get Started",rightIcon:ji,onClick:a})]})})]})},Od=g.div`
393
+ `,ou="onboarding-done",nu=()=>{const{currentModal:o,setCurrentModal:n}=Xo(),a=()=>n("");return e(Vo,{isOpen:o===ou,onClose:a,children:[t(eu,{}),t(tu,{children:e(V,{$gap:32,$alignItems:"center",children:[e(V,{$gap:24,$alignItems:"center",children:[t(Q,{size:te.L,weight:500,children:"Welcome to"}),t(yl,{size:260}),t(Q,{size:te.S,weight:400,children:"Your observability control plane is ready."})]}),t(ne,{label:"Get Started",rightIcon:ri,onClick:a})]})})]})},au=m.div`
283
394
  display: flex;
284
395
  flex-direction: column;
285
396
  gap: 8px;
286
397
  padding: 4px 8px;
287
398
  border-radius: 8px;
288
399
  width: calc(100% - 16px);
289
- `,Ad=g.div`
400
+ `,iu=m.div`
290
401
  white-space: pre;
291
402
  overflow-x: auto;
292
- `,Dd=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:s,toggleName:r})=>{const c=f();return e(Od,{children:[e(te,{$gap:8,$justifyContent:"space-between",children:[e(te,{$gap:4,children:[t(re,{size:ce.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Ee,{label:Mo,leftIcon:Wi,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:ce.XXXS})]}),t(q,{name:r??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:Z.Left,value:i,onChange:l,size:ct.S})]}),t(Ad,{children:t(S,{parts:s})})]})},Rd=g.div`
403
+ `,lu=({name:o,recommended:n,toggleLabel:a,enabled:i,onEnabledChange:l,summary:r,toggleName:s})=>{const c=f();return e(au,{children:[e(oe,{$gap:8,$justifyContent:"space-between",children:[e(oe,{$gap:4,children:[t(Q,{size:te.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Fe,{label:Uo,leftIcon:Wi,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:te.XXXS})]}),t(K,{name:s??`sampling-onboarding-toggle-${o}`,label:a,labelAlign:Y.Left,value:i,onChange:l,size:gt.S})]}),t(iu,{children:t(S,{parts:r})})]})},ru=m.div`
293
404
  position: relative;
294
405
  display: flex;
295
406
  align-items: center;
@@ -299,18 +410,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
299
410
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
300
411
  border-top-left-radius: 18px;
301
412
  border-top-right-radius: 18px;
302
- `,Fd=g.div`
413
+ `,su=m.div`
303
414
  position: absolute;
304
415
  left: 16px;
305
416
  top: 50%;
306
417
  transform: translateY(-50%);
307
- `,Pd=g.div`
418
+ `,cu=m.div`
308
419
  height: 16px;
309
420
  width: 100%;
310
421
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
311
422
  border-top-left-radius: 18px;
312
423
  border-top-right-radius: 18px;
313
- `,Ld=g.div`
424
+ `,du=m.div`
314
425
  width: ${({$width:e})=>e}px;
315
426
  display: flex;
316
427
  flex-direction: column;
@@ -318,7 +429,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
318
429
  gap: 22px;
319
430
  padding: 8px 32px 32px 32px;
320
431
  background-color: ${({theme:e})=>e.v2.colors.black[500]};
321
- `,_d=e=>t(Gi,{rotate:90,...e}),Md=({children:o,center:n,onNext:a,nextLabel:i=Bo,nextLoading:l})=>e(te,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(oe,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:_d,variant:ae.Primary,size:ne.M,onClick:a,loading:l})]}),Bd=e=>t(Gi,{rotate:-90,...e}),zd=({title:o,onBack:n})=>{const a=f();return e(Rd,{$hasBack:!!n,children:[n&&t(Fd,{children:t(qe,{"data-id":"sampling-onboarding-back",icon:Bd,size:Ze.M,onClick:n})}),t(re,{size:ce.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},Xd=g.div`
432
+ `,uu=e=>t(Ki,{rotate:90,...e}),pu=({children:o,center:n,onNext:a,nextLabel:i=Ho,nextLoading:l})=>e(oe,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,a&&t(ne,{"data-id":"sampling-onboarding-btn-next",label:i,rightIcon:uu,variant:ie.Primary,size:ae.M,onClick:a,loading:l})]}),hu=e=>t(Ki,{rotate:-90,...e}),gu=({title:o,onBack:n})=>{const a=f();return e(ru,{$hasBack:!!n,children:[n&&t(su,{children:t(ot,{"data-id":"sampling-onboarding-back",icon:hu,size:nt.M,onClick:n})}),t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],align:"center",children:o})]})},mu=m.div`
322
433
  box-sizing: border-box;
323
434
  width: ${({$width:e})=>e??"100%"};
324
435
  ${({$fillHeight:e})=>e&&b`
@@ -331,16 +442,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
331
442
  padding: 16px;
332
443
  border-radius: 16px;
333
444
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
334
- `,Vd=({children:e,fillHeight:o,width:n})=>t(Xd,{$fillHeight:o,$width:n,children:e}),Ud=g.ul`
445
+ `,fu=({children:e,fillHeight:o,width:n})=>t(mu,{$fillHeight:o,$width:n,children:e}),bu=m.ul`
335
446
  margin: 0;
336
447
  padding: 0;
337
448
  list-style: disc;
338
- `,Hd=g.li`
449
+ `,vu=m.li`
339
450
  margin-left: 18px;
340
451
  & + & {
341
452
  margin-top: 6px;
342
453
  }
343
- `,jd=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(Ud,{children:e.map((e,o)=>t(Hd,{style:{color:a},children:t(re,{size:ce.XXS,color:a,children:e})},o))})},Wd=({items:o})=>{const n=f();return t(V,{$gap:16,children:o.map((o,a)=>e(te,{$gap:8,$alignItems:"flex-start",children:[e(re,{size:ce.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(V,{$gap:2,children:[t(re,{size:ce.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(re,{size:ce.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},Gd=({message:e})=>t(me,{status:ge.Default,message:e,fullWidth:!0,smallIcon:!0}),Kd=g.div`
454
+ `,yu=({items:e,color:o})=>{const n=f(),a=o||n.v2.colors.silver[200];return t(bu,{children:e.map((e,o)=>t(vu,{style:{color:a},children:t(Q,{size:te.XXS,color:a,children:e})},o))})},Cu=({items:o})=>{const n=f();return t(V,{$gap:16,children:o.map((o,a)=>e(oe,{$gap:8,$alignItems:"flex-start",children:[e(Q,{size:te.XS,color:n.v2.colors.silver[200],weight:400,children:[a+1,"."]}),e(V,{$gap:2,children:[t(Q,{size:te.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(Q,{size:te.XS,color:n.v2.colors.silver[200],children:o.description})]})]},a))})},Su=({message:e})=>t(Se,{status:we.Default,message:e,fullWidth:!0,smallIcon:!0}),wu=m.div`
344
455
  width: calc(100% - 16px);
345
456
  padding: 8px;
346
457
  display: flex;
@@ -348,12 +459,12 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
348
459
  gap: 4px;
349
460
  border-radius: 16px;
350
461
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
351
- `,Yd=g.div`
462
+ `,xu=m.div`
352
463
  display: flex;
353
464
  align-items: center;
354
465
  gap: 8px;
355
466
  padding: 4px 8px 12px 8px;
356
- `,Jd=g.div`
467
+ `,ku=m.div`
357
468
  width: calc(100% - 16px);
358
469
  display: flex;
359
470
  flex-direction: column;
@@ -361,20 +472,20 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
361
472
  padding: 8px;
362
473
  border-radius: 12px;
363
474
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
364
- `,qd=({children:e})=>{const o=f();return t(re,{size:ce.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Zd=g.div`
475
+ `,Tu=({children:e})=>{const o=f();return t(Q,{size:te.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},$u=m.div`
365
476
  white-space: pre-line;
366
- `,Qd=({enabled:n,onEnabledChange:a,onBack:i,onNext:l})=>{const s=f(),c=r(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(zd,{title:zo,onBack:i}),e(Ld,{$width:854,children:[t(qd,{children:Xo}),e(V,{$gap:8,$width:"100%",children:[t(Vd,{children:t(Zd,{children:t(re,{size:ce.XXS,color:s.v2.colors.silver[200],children:Vo})})}),e(V,{$gap:8,$width:"100%",children:[e(Kd,{children:[t(Yd,{children:t(re,{size:ce.S,weight:500,color:s.v2.colors.white[500],children:Uo})}),t(Jd,{children:t(Dd,{name:jo,recommended:!0,toggleLabel:Ho,enabled:n,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Gd,{message:Wo})]})]})]}),t(Md,{onNext:l})]})},eu=e=>t(Gi,{rotate:90,...e}),tu=({onClose:n})=>{const a=f();return e(o,{children:[t(Pd,{}),e(Ld,{$width:732,children:[t(Go,{icon:zi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(re,{size:ce.M,weight:500,color:a.v2.colors.white[500],children:Ko}),Yo.split("\n").map(e=>t(qd,{children:e},e)),e(Vd,{children:[t(re,{size:ce.XS,color:a.v2.colors.silver[200],children:Jo}),t(jd,{color:a.v2.colors.white[500],items:[qo,Zo,Qo]})]})]})]}),t(Md,{center:!0,children:t(oe,{"data-id":"sampling-onboarding-btn-go-to",label:en,rightIcon:eu,variant:ae.Primary,size:ne.M,onClick:n})})]})},ou=e=>t(Gi,{rotate:90,...e}),nu=g.div`
477
+ `,Eu=({enabled:n,onEnabledChange:i,onBack:l,onNext:r})=>{const s=f(),c=a(()=>w({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(gu,{title:jo,onBack:l}),e(du,{$width:854,children:[t(Tu,{children:Go}),e(V,{$gap:8,$width:"100%",children:[t(fu,{children:t($u,{children:t(Q,{size:te.XXS,color:s.v2.colors.silver[200],children:Wo})})}),e(V,{$gap:8,$width:"100%",children:[e(wu,{children:[t(xu,{children:t(Q,{size:te.S,weight:500,color:s.v2.colors.white[500],children:Ko})}),t(ku,{children:t(lu,{name:Jo,recommended:!0,toggleLabel:Yo,enabled:n,onEnabledChange:i,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(Su,{message:qo})]})]})]}),t(pu,{onNext:r})]})},Iu=e=>t(Ki,{rotate:90,...e}),Nu=({onClose:n})=>{const a=f();return e(o,{children:[t(cu,{}),e(du,{$width:732,children:[t(Zo,{icon:Vi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[t(Q,{size:te.M,weight:500,color:a.v2.colors.white[500],children:Qo}),en.split("\n").map(e=>t(Tu,{children:e},e)),e(fu,{children:[t(Q,{size:te.XS,color:a.v2.colors.silver[200],children:tn}),t(yu,{color:a.v2.colors.white[500],items:[on,nn,an]})]})]})]}),t(pu,{center:!0,children:t(ne,{"data-id":"sampling-onboarding-btn-go-to",label:ln,rightIcon:Iu,variant:ie.Primary,size:ae.M,onClick:n})})]})},Au=e=>t(Ki,{rotate:90,...e}),Ou=m.div`
367
478
  display: flex;
368
479
  flex-direction: column;
369
480
  align-items: center;
370
481
  gap: 8px;
371
482
  width: 100%;
372
- `,au=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(Pd,{}),e(Ld,{$width:732,children:[t(Go,{icon:zi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(nu,{children:[t(re,{size:ce.M,weight:500,color:i.v2.colors.white[500],children:tn}),t(qd,{children:on})]}),e(Vd,{children:[t(re,{size:ce.XS,color:i.v2.colors.silver[200],children:nn}),t(Wd,{items:[{title:ln,description:an},{title:rn,description:sn},{title:dn,description:cn}]}),t(Gd,{message:un})]})]})]}),e(Md,{center:!0,children:[t(oe,{"data-id":"sampling-onboarding-btn-skip",label:pn,variant:ae.Secondary,onClick:n}),t(oe,{"data-id":"sampling-onboarding-btn-start",label:hn,rightIcon:ou,variant:ae.Primary,onClick:a})]})]})},iu=g.div`
483
+ `,Du=({onSkip:n,onNext:a})=>{const i=f();return e(o,{children:[t(cu,{}),e(du,{$width:732,children:[t(Zo,{icon:Vi}),e(V,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Ou,{children:[t(Q,{size:te.M,weight:500,color:i.v2.colors.white[500],children:rn}),t(Tu,{children:sn})]}),e(fu,{children:[t(Q,{size:te.XS,color:i.v2.colors.silver[200],children:cn}),t(Cu,{items:[{title:un,description:dn},{title:hn,description:pn},{title:mn,description:gn}]}),t(Su,{message:fn})]})]})]}),e(pu,{center:!0,children:[t(ne,{"data-id":"sampling-onboarding-btn-skip",label:bn,variant:ie.Secondary,onClick:n}),t(ne,{"data-id":"sampling-onboarding-btn-start",label:vn,rightIcon:Au,variant:ie.Primary,onClick:a})]})]})},Ru=m.div`
373
484
  display: flex;
374
485
  align-items: stretch;
375
486
  gap: 16px;
376
487
  width: 100%;
377
- `,lu=g.div`
488
+ `,Pu=m.div`
378
489
  flex: 1;
379
490
  display: flex;
380
491
  flex-direction: column;
@@ -394,18 +505,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
394
505
  background-color: ${t.v2.colors.silver[700]};
395
506
  }
396
507
  `}
397
- `,su=g.div`
508
+ `,Fu=m.div`
398
509
  display: flex;
399
510
  align-items: center;
400
511
  gap: 8px;
401
512
  padding: 12px 16px;
402
- `,ru=g.div`
513
+ `,Lu=m.div`
403
514
  flex: 1;
404
515
  padding: 8px;
405
516
  display: flex;
406
517
  flex-direction: column;
407
518
  gap: 8px;
408
- `,cu=g.div`
519
+ `,_u=m.div`
409
520
  flex: 1;
410
521
  display: flex;
411
522
  flex-direction: column;
@@ -413,17 +524,17 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
413
524
  padding: 12px;
414
525
  border-radius: 12px;
415
526
  background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
416
- `,du=g.div`
527
+ `,zu=m.div`
417
528
  display: flex;
418
529
  justify-content: flex-end;
419
- `,uu=g.div`
530
+ `,Mu=m.div`
420
531
  display: flex;
421
532
  align-items: center;
422
533
  gap: 8px;
423
534
  padding: 4px 12px 4px 4px;
424
535
  border-radius: 8px;
425
536
  background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
426
- `,pu=g.div`
537
+ `,Bu=m.div`
427
538
  display: flex;
428
539
  align-items: center;
429
540
  justify-content: center;
@@ -431,13 +542,13 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
431
542
  height: 24px;
432
543
  border-radius: 6px;
433
544
  background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
434
- `,hu=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:s,warning:r,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(lu,{$selected:o,onClick:n,children:[e(su,{children:[t(On,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:An.L}),t(zi,{size:24,fill:d.v2.colors.white[500]}),t(re,{size:ce.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(ru,{children:[e(cu,{$selected:o,children:[e(V,{$gap:8,children:[t(Ee,{...l,textSize:ce.XXXS}),t(re,{size:ce.XXS,color:u,children:i})]}),s&&s.length>0&&t(jd,{color:u,items:s}),r&&e(uu,{children:[t(pu,{children:t(Xi,{size:18,fill:d.v2.colors.yellow[500]})}),t(re,{size:ce.XXXS,color:d.v2.colors.yellow[500],children:r})]})]}),c&&t(du,{children:t(oe,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:Dn,rightIcon:li,variant:ae.Text,size:ne.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},mu=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:s})=>{const r=f(),c=s?()=>window.open(s,"_blank"):void 0;return e(o,{children:[t(zd,{title:mn,onBack:i}),e(Ld,{$width:854,children:[t(qd,{children:gn}),e(iu,{children:[t(hu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:Sn,description:Cn,badgeProps:{label:yn,backgroundColor:r.v2.colors.purple[500],textColor:r.v2.colors.white[500]},bullets:[bn,vn],warning:fn,onReadMore:c}),t(hu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:$n,description:Tn,badgeProps:{label:kn,backgroundColor:r.v2.colors.green[500],textColor:r.v2.colors.black[500]},bullets:[wn,xn],onReadMore:c}),t(hu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:En,description:In,badgeProps:{label:Nn,backgroundColor:r.v2.colors.blue[700],textColor:r.v2.colors.white[500]},onReadMore:c})]})]}),t(Md,{onNext:l})]})},gu=({onBack:n,onNext:a,submitting:i})=>{const l=f(),s=r(()=>[{title:Ln,bullets:[Rn,Fn,Pn]},{title:Vn,bullets:[_n,Mn,Bn,zn,Xn]}],[]);return e(o,{children:[t(zd,{title:Un,onBack:n}),e(Ld,{$width:854,children:[t(qd,{children:Hn}),t(te,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(Vd,{fillHeight:!0,width:"50%",children:[t(re,{size:ce.XS,color:l.v2.colors.white[500],children:o.title}),t(jd,{items:o.bullets})]},n))}),t(Gd,{message:jn})]}),t(Md,{onNext:a,nextLoading:i})]})},fu=g.div`
545
+ `,Xu=({selected:o,onSelect:n,name:a,description:i,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=f(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Pu,{$selected:o,onClick:n,children:[e(Fu,{children:[t(ce,{"data-id":`sampling-onboarding-radio-${a}`,value:o,onChange:n,size:ue.L}),t(Vi,{size:24,fill:d.v2.colors.white[500]}),t(Q,{size:te.S,weight:500,color:d.v2.colors.white[500],children:a})]}),e(Lu,{children:[e(_u,{$selected:o,children:[e(V,{$gap:8,children:[t(Fe,{...l,textSize:te.XXXS}),t(Q,{size:te.XXS,color:u,children:i})]}),r&&r.length>0&&t(yu,{color:u,items:r}),s&&e(Mu,{children:[t(Bu,{children:t(Ui,{size:18,fill:d.v2.colors.yellow[500]})}),t(Q,{size:te.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(zu,{children:t(ne,{"data-id":`sampling-onboarding-btn-read-more-${a}`,label:Fn,rightIcon:di,variant:ie.Text,size:ae.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Vu=({strategy:n,onStrategyChange:a,onBack:i,onNext:l,docsUrl:r})=>{const s=f(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(gu,{title:yn,onBack:i}),e(du,{$width:854,children:[t(Tu,{children:Cn}),e(Ru,{children:[t(Xu,{selected:"keep-list"===n,onSelect:()=>a("keep-list"),name:$n,description:Tn,badgeProps:{label:kn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[wn,xn],warning:Sn,onReadMore:c}),t(Xu,{selected:"drop-list"===n,onSelect:()=>a("drop-list"),name:On,description:An,badgeProps:{label:Nn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[En,In],onReadMore:c}),t(Xu,{selected:"advanced"===n,onSelect:()=>a("advanced"),name:Pn,description:Rn,badgeProps:{label:Dn,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(pu,{onNext:l})]})},Uu=({onBack:n,onNext:i,submitting:l})=>{const r=f(),s=a(()=>[{title:Mn,bullets:[Ln,_n,zn]},{title:jn,bullets:[Bn,Xn,Vn,Un,Hn]}],[]);return e(o,{children:[t(gu,{title:Gn,onBack:n}),e(du,{$width:854,children:[t(Tu,{children:Wn}),t(oe,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(fu,{fillHeight:!0,width:"50%",children:[t(Q,{size:te.XS,color:r.v2.colors.white[500],children:o.title}),t(yu,{items:o.bullets})]},n))}),t(Su,{message:Kn})]}),t(pu,{onNext:i,nextLoading:l})]})},Hu=m.div`
435
546
  white-space: pre-line;
436
- `,bu=({errorPresetEnabled:n,onErrorPresetChange:a,onBack:i,onNext:l,submitting:s})=>{const c=f(),d=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(zd,{title:Wn,onBack:i}),e(Ld,{$width:854,children:[t(qd,{children:Gn}),e(V,{$gap:8,$width:"100%",children:[e(Vd,{children:[t(fu,{children:t(re,{size:ce.XXS,color:c.v2.colors.silver[200],children:Kn})}),t(Gd,{message:jn})]}),e(Kd,{children:[e(Yd,{children:[t(re,{size:ce.S,weight:500,color:c.v2.colors.white[500],children:Yn}),t(Ei,{size:16,fill:c.v2.colors.silver[200]})]}),t(Jd,{children:t(Dd,{name:qn,recommended:!0,toggleLabel:Jn,enabled:n,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(Md,{onNext:l,nextLoading:s})]})},vu=g.div`
547
+ `,ju=({errorPresetEnabled:n,onErrorPresetChange:i,onBack:l,onNext:r,submitting:s})=>{const c=f(),d=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(gu,{title:Yn,onBack:l}),e(du,{$width:854,children:[t(Tu,{children:Jn}),e(V,{$gap:8,$width:"100%",children:[e(fu,{children:[t(Hu,{children:t(Q,{size:te.XXS,color:c.v2.colors.silver[200],children:qn})}),t(Su,{message:Kn})]}),e(wu,{children:[e(xu,{children:[t(Q,{size:te.S,weight:500,color:c.v2.colors.white[500],children:Zn}),t(Oi,{size:16,fill:c.v2.colors.silver[200]})]}),t(ku,{children:t(lu,{name:ea,recommended:!0,toggleLabel:Qn,enabled:n,onEnabledChange:i,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(pu,{onNext:r,nextLoading:s})]})},Gu=m.div`
437
548
  white-space: pre-line;
438
- `,yu=g.div`
549
+ `,Wu=m.div`
439
550
  width: fit-content;
440
- `,Cu=["50","25","10","1","0.1"],Su=({value:o,onChange:n,label:a})=>{const i=f(),l=r(()=>Cu.map(e=>({value:e,label:`${e}%`,selectedBgColor:i.v2.colors.purple[900],selectedBorderColor:i.v2.colors.purple[400]})),[i]);return e(V,{$gap:8,children:[t(re,{size:ce.XS,color:i.v2.colors.white[500],children:a}),t(yu,{children:t(ue,{"data-id":"sampling-onboarding-ambient",options:l,selected:o,setSelected:n})})]})},wu=({errorPresetEnabled:n,onErrorPresetChange:a,ambientPercentage:i,onAmbientPercentageChange:l,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=r(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(zd,{title:Zn,onBack:s}),e(Ld,{$width:854,children:[t(qd,{children:Qn}),e(V,{$gap:8,$width:"100%",children:[e(Vd,{children:[t(vu,{children:t(re,{size:ce.XXS,color:u.v2.colors.silver[200],children:ea})}),t(jd,{items:[ta,oa,na,aa,ia]}),t(Gd,{message:jn})]}),e(Kd,{children:[e(Yd,{children:[t(re,{size:ce.S,weight:500,color:u.v2.colors.white[500],children:la}),t(Ei,{size:16,fill:u.v2.colors.silver[200]})]}),t(Jd,{children:t(Dd,{name:qn,recommended:!0,toggleLabel:Jn,enabled:n,onEnabledChange:a,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(Jd,{children:t(Su,{value:i,onChange:l,label:sa})})]})]})]}),t(Md,{onNext:c,nextLoading:d})]})},xu=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:r,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=l("welcome"),[m,g]=l(!0),[f,b]=l("keep-list"),[v,y]=l(!0),[C,S]=l("25"),[w,x]=l(!1);n(()=>{e&&(h("welcome"),g(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const k=c(async()=>{const e=i??"default",t=[];m!==(a?.enabled??!1)&&t.push(r(m,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,r,m,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let T=null;switch(p){case"welcome":T=t(au,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":T=t(Qd,{enabled:m,onEnabledChange:g,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(mu,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(wu,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"drop-list":T=t(bu,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"advanced":T=t(gu,{onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"success":T=t(tu,{onClose:o})}return t(_o,{isOpen:e,onClose:o,children:T})};var ku,Tu;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(ku||(ku={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Tu||(Tu={}));const $u=[{key:Tu.Name,label:"Name"},{key:Tu.Type,label:"Type",textAlign:"right"},{key:Tu.Status,label:"Status"},{key:Tu.OdigosVersion,label:"Odigos Version"},{key:Tu.ConnectedSince,label:"Connected Since"},{key:Tu.LastActivity,label:"Last Activity"}],Nu=(e,t)=>{const o=e.find(e=>e.key===Tu.Id)?.rawValue;return t(o?.toString()||"")},Iu=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:s,onAddInstrumentationRule:r,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Tu.Status)?.rawValue===ge.Success)(e))return[{id:Po(),label:"Delete Connection",rightIcon:ci,onClick:()=>Nu(e,a)}];const d=Nu(e,e=>{const n=t.find(t=>t.id===e);return!!n&&k(n.odigosVersion,o)}),u=Nu(e,e=>{const o=t.find(t=>t.id===e);return!!o&&k(o.odigosVersion,n)}),p=[];return i&&p.push({id:Po(),tooltip:u?Re.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:Si,disabled:!u,onClick:()=>Nu(e,i)}),l&&p.push({id:Po(),tooltip:Re.ADD_DESTINATION,rightIcon:gi,onClick:()=>Nu(e,l)}),s&&p.push({id:Po(),tooltip:Re.ADD_ACTION,rightIcon:mi,onClick:()=>Nu(e,s)}),r&&p.push({id:Po(),tooltip:Re.ADD_INSTRUMENTATION_RULE,rightIcon:Ci,onClick:()=>Nu(e,r)}),c&&p.push({id:Po(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:xi,disabled:!d,onClick:()=>Nu(e,c)}),p}},Eu=({tableRowsMaxHeight:o,connections:a,getConnections:i,onClickConnection:s,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:h,snapshotMinSupportedVersion:m=0,getAllClusterSnapshots:g,persistSources:b,getDestinationCategories:v,getPotentialDestinations:C,testConnection:S,createDestination:w,updateDestination:x,createAction:T,createInstrumentationRule:$})=>{const N=f(),{isVm:I}=y(),{formatTimeAgo:E}=At(),[O,A]=l(!1),[D,R]=l(a||[]),F=c(async()=>{try{A(!0),R(await i()??[])}catch(e){}finally{A(!1)}},[]);n(()=>{D.length||F()},[]);const[P,L]=l(""),[_,M]=l(null),[B,z]=l([]),X=r(()=>_===ku.BulkConfig?u:_===ku.BulkSource?m:0,[_,u,m]),{supportedConnections:V,supportedConnectionIds:U}=r(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===ge.Success,n=k(e.odigosVersion,t);return o&&n}))(D,X);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[D.length,X]);n(()=>{if(!_||_===ku.Delete)return;const e=B.filter(e=>!U.includes(e));e.length&&z(t=>t.filter(t=>!e.includes(t)))},[_,B.length,U.length]);const H=r(()=>D.filter(e=>!P||e.name.toLowerCase().includes(P.toLowerCase())).map(e=>({cells:[{key:Tu.Id,rawValue:e.id},{key:Tu.Name,rawValue:e.name},{key:Tu.Type,rawValue:e.type},{key:Tu.Status,rawValue:e.status,component:()=>(e=>{const o=e===ge.Success?"Connection live":"Connection lost",n=e===ge.Success?vi:yi;return t(Ee,{status:e,label:o,leftIcon:n})})(e.status)},{key:Tu.OdigosVersion,rawValue:e.odigosVersion},{key:Tu.ConnectedSince,rawValue:e.connectedAt?E(e.connectedAt):"-"},{key:Tu.LastActivity,rawValue:e.lastSeenAt?E(e.lastSeenAt):"-"}],onClick:e.status!==ge.Success||_?void 0:()=>s(e),isSelected:B.includes(e.id),onSelect:()=>z(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>z(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==ge.Success||_===ku.BulkConfig&&!k(e.odigosVersion,u)||_===ku.BulkSource&&!k(e.odigosVersion,m)})),[D,B,P,_,u,m]),j=r(()=>{const e=(e,t)=>{z([e]),M(t)};return Iu({connections:D,configMinSupportedVersion:u,snapshotMinSupportedVersion:m,onDelete:t=>e(t,ku.Delete),onAddSource:!I&&g&&b?t=>e(t,ku.BulkSource):void 0,onAddDestination:!I&&v&&C&&w?t=>e(t,ku.BulkDestination):void 0,onAddAction:!I&&T?t=>e(t,ku.BulkAction):void 0,onAddInstrumentationRule:!I&&$?t=>e(t,ku.BulkInstrumentationRule):void 0,onEditConfiguration:!I&&p&&h?t=>e(t,ku.BulkConfig):void 0})},[I,D,u,p,h,m,g,b,v,C,w,T,$]),W=r(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,s=[];o&&s.push({id:Po(),type:Vt.Button,buttonProps:{variant:ae.Primary,size:ne.S,label:"Add Sources",rightIcon:Si,onClick:o}});const r=[n?{id:ku.BulkDestination,label:Re.ADD_DESTINATION,icon:gi}:null,a?{id:ku.BulkAction,label:Re.ADD_ACTION,icon:mi}:null,i?{id:ku.BulkInstrumentationRule,label:Re.ADD_INSTRUMENTATION_RULE,icon:Ci}:null,l?{id:ku.BulkConfig,label:"Manage Configurations",icon:xi}:null];return r.some(Boolean)&&s.push({id:Po(),type:Vt.ButtonDropData,buttonProps:{variant:ae.Secondary,size:ne.S,label:"Bulk Operations",onClick:e=>{e===ku.BulkSource?o?.():e===ku.BulkDestination?n?.():e===ku.BulkAction?a?.():e===ku.BulkInstrumentationRule?i?.():e===ku.BulkConfig&&l?.()}},dropDataProps:{alignX:Fo.Left,items:r}}),s.push({id:Po(),type:Vt.Button,buttonProps:{variant:ae.Text,size:ne.S,label:bt.CANCEL,onClick:t}}),s})({onCancel:()=>z([]),onAddSource:!I&&g&&b?()=>M(ku.BulkSource):void 0,onAddDestination:!I&&v&&C&&w?()=>M(ku.BulkDestination):void 0,onAddAction:!I&&T?()=>M(ku.BulkAction):void 0,onAddInstrumentationRule:!I&&$?()=>M(ku.BulkInstrumentationRule):void 0,onManageConfigurations:!I&&p&&h?()=>M(ku.BulkConfig):void 0}),[I,p,h,g,b,v,C,w,T,$]);return t(ra,{children:e(Ue,{richTitle:{icon:Ki,title:Re.CONNECTIONS,badge:{label:D.length.toString(),status:st.Unknown}},search:{placeholder:"Search by cluster name",value:P,onChange:e=>L(e),width:"300px"},actions:[{id:Po(),type:Vt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,leftIcon:Ni,onClick:F,disabled:O}}],children:[t(co,{variant:uo.Pretty,maxHeight:o,headerBackgroundColor:N.v2.colors.silver[1e3],isLoading:O,withCheckboxes:!0,columns:$u,rows:H,rowActionsPushRightPosition:_?`calc(${yl} - 24px)`:void 0,getRowActions:j}),_===ku.BulkConfig&&p&&h&&t(lr,{onClose:()=>M(null),connections:V,selectedConnectionIds:B,setSelectedConnectionIds:z,getEffectiveConfig:p,onApply:h}),_===ku.BulkSource&&g&&b&&t(Fl,{selectedConnectionIds:B,children:t(ar,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,getAllClusterSnapshots:g,persistSources:async e=>await(b?.(e))})}),_===ku.BulkDestination&&v&&C&&S&&w&&x&&t(Pl,{children:t(_s,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,getDestinationCategories:v,getPotentialDestinations:C,testConnection:e=>S(e,B),createDestination:e=>w(e,B),updateDestination:(e,t)=>x(e,t,B)})}),_===ku.BulkAction&&T&&t(Ll,{children:t(Ns,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,createAction:e=>T(e,B)})}),_===ku.BulkInstrumentationRule&&$&&t(_l,{children:t(Ms,{onClose:()=>M(null),selectedConnectionIds:B,setSelectedConnectionIds:z,createInstrumentationRule:e=>$(e,B)})}),t(gl,{target:"connection",isOpen:_===ku.Delete,onClose:()=>{z([]),M(null)},onApprove:async()=>{const e=B[0];e&&(await d(e),await F())}}),t(ca,{isOpen:!!B.length&&!_,richTitle:{icon:si,title:"Selected Clusters",badge:{label:B.length}},actions:W})]})})},Ou=g.div`
551
+ `,Ku=["50","25","10","1","0.1"],Yu=({value:o,onChange:n,label:i})=>{const l=f(),r=a(()=>Ku.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(V,{$gap:8,children:[t(Q,{size:te.XS,color:l.v2.colors.white[500],children:i}),t(Wu,{children:t(le,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},Ju=({errorPresetEnabled:n,onErrorPresetChange:i,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=f(),p=a(()=>x(n?{disabled:!1}:null),[n]);return e(o,{children:[t(gu,{title:ta,onBack:s}),e(du,{$width:854,children:[t(Tu,{children:oa}),e(V,{$gap:8,$width:"100%",children:[e(fu,{children:[t(Gu,{children:t(Q,{size:te.XXS,color:u.v2.colors.silver[200],children:na})}),t(yu,{items:[aa,ia,la,ra,sa]}),t(Su,{message:Kn})]}),e(wu,{children:[e(xu,{children:[t(Q,{size:te.S,weight:500,color:u.v2.colors.white[500],children:ca}),t(Oi,{size:16,fill:u.v2.colors.silver[200]})]}),t(ku,{children:t(lu,{name:ea,recommended:!0,toggleLabel:Qn,enabled:n,onEnabledChange:i,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t(ku,{children:t(Yu,{value:l,onChange:r,label:da})})]})]})]}),t(pu,{onNext:c,nextLoading:d})]})},qu=({isOpen:e,onClose:o,k8sHealthProbesConfig:a,samplingId:i,docsUrl:s,updateK8sHealthProbesConfig:c,createHighlyRelevantOperationRule:d,createCostReductionRule:u})=>{const[p,h]=r("welcome"),[g,m]=r(!0),[f,b]=r("keep-list"),[v,y]=r(!0),[C,S]=r("25"),[w,x]=r(!1);n(()=>{e&&(h("welcome"),m(a?.enabled??!0),b("keep-list"),y(!0),S("25"),x(!1))},[e,a?.enabled]);const k=l(async()=>{const e=i??"default",t=[];g!==(a?.enabled??!1)&&t.push(c(g,a?.keepPercentage??0)),"advanced"!==f&&v&&t.push(d(e,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null})),"keep-list"===f&&t.push(u(e,{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(C)})),x(!0);try{await Promise.all(t),h("success")}catch{}finally{x(!1)}},[i,c,g,a?.enabled,a?.keepPercentage,f,v,C,d,u]);let T=null;switch(p){case"welcome":T=t(Du,{onSkip:o,onNext:()=>h("noisy")});break;case"noisy":T=t(Eu,{enabled:g,onEnabledChange:m,onBack:()=>h("welcome"),onNext:()=>h("strategy")});break;case"strategy":T=t(Vu,{strategy:f,onStrategyChange:b,onBack:()=>h("noisy"),onNext:()=>{h("keep-list"===f?"keep-list":"drop-list"===f?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":T=t(Ju,{errorPresetEnabled:v,onErrorPresetChange:y,ambientPercentage:C,onAmbientPercentageChange:S,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"drop-list":T=t(ju,{errorPresetEnabled:v,onErrorPresetChange:y,onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"advanced":T=t(Uu,{onBack:()=>h("strategy"),onNext:k,submitting:w});break;case"success":T=t(Nu,{onClose:o})}return t(Vo,{isOpen:e,onClose:o,children:T})};var Zu,Qu;!function(e){e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"}(Zu||(Zu={})),function(e){e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"}(Qu||(Qu={}));const ep=[{key:Qu.Name,label:"Name"},{key:Qu.Type,label:"Type",textAlign:"right"},{key:Qu.Status,label:"Status"},{key:Qu.OdigosVersion,label:"Odigos Version"},{key:Qu.ConnectedSince,label:"Connected Since"},{key:Qu.LastActivity,label:"Last Activity"}],tp=(e,t)=>{const o=e.find(e=>e.key===Qu.Id)?.rawValue;return t(o?.toString()||"")},op=e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:a,onAddSource:i,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===Qu.Status)?.rawValue===we.Success)(e))return[{id:Bo(),label:"Delete Connection",rightIcon:ui,onClick:()=>tp(e,a)}];const d=tp(e,e=>{const n=t.find(t=>t.id===e);return!!n&&k(n.odigosVersion,o)}),u=tp(e,e=>{const o=t.find(t=>t.id===e);return!!o&&k(o.odigosVersion,n)}),p=[];return i&&p.push({id:Bo(),tooltip:u?Me.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${n} or later.`,rightIcon:xi,disabled:!u,onClick:()=>tp(e,i)}),l&&p.push({id:Bo(),tooltip:Me.ADD_DESTINATION,rightIcon:bi,onClick:()=>tp(e,l)}),r&&p.push({id:Bo(),tooltip:Me.ADD_ACTION,rightIcon:fi,onClick:()=>tp(e,r)}),s&&p.push({id:Bo(),tooltip:Me.ADD_INSTRUMENTATION_RULE,rightIcon:wi,onClick:()=>tp(e,s)}),c&&p.push({id:Bo(),tooltip:d?"Edit Configuration":`To use this feature, please upgrade to Odigos v${o} or later.`,rightIcon:Ti,disabled:!d,onClick:()=>tp(e,c)}),p}},np=({tableRowsMaxHeight:o,connections:i,getConnections:s,onClickConnection:c,deleteConnection:d,configMinSupportedVersion:u=0,getEffectiveConfig:p,applyConfigurations:h,snapshotMinSupportedVersion:g=0,getAllClusterSnapshots:m,persistSources:b,getDestinationCategories:v,getPotentialDestinations:C,testConnection:S,createDestination:w,updateDestination:x,createAction:T,createInstrumentationRule:$})=>{const E=f(),{isVm:I}=y(),{formatTimeAgo:N}=Lt(),[A,O]=r(!1),[D,R]=r(i||[]),P=l(async()=>{try{O(!0),R(await s()??[])}catch(e){}finally{O(!1)}},[]);n(()=>{D.length||P()},[]);const[F,L]=r(""),[_,z]=r(null),[M,B]=r([]),X=a(()=>_===Zu.BulkConfig?u:_===Zu.BulkSource?g:0,[_,u,g]),{supportedConnections:V,supportedConnectionIds:U}=a(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===we.Success,n=k(e.odigosVersion,t);return o&&n}))(D,X);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[D.length,X]);n(()=>{if(!_||_===Zu.Delete)return;const e=M.filter(e=>!U.includes(e));e.length&&B(t=>t.filter(t=>!e.includes(t)))},[_,M.length,U.length]);const H=a(()=>D.filter(e=>!F||e.name.toLowerCase().includes(F.toLowerCase())).map(e=>({cells:[{key:Qu.Id,rawValue:e.id},{key:Qu.Name,rawValue:e.name},{key:Qu.Type,rawValue:e.type},{key:Qu.Status,rawValue:e.status,component:()=>(e=>{const o=e===we.Success?"Connection live":"Connection lost",n=e===we.Success?Ci:Si;return t(Fe,{status:e,label:o,leftIcon:n})})(e.status)},{key:Qu.OdigosVersion,rawValue:e.odigosVersion},{key:Qu.ConnectedSince,rawValue:e.connectedAt?N(e.connectedAt):"-"},{key:Qu.LastActivity,rawValue:e.lastSeenAt?N(e.lastSeenAt):"-"}],onClick:e.status!==we.Success||_?void 0:()=>c(e),isSelected:M.includes(e.id),onSelect:()=>B(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>B(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==we.Success||_===Zu.BulkConfig&&!k(e.odigosVersion,u)||_===Zu.BulkSource&&!k(e.odigosVersion,g)})),[D,M,F,_,u,g]),j=a(()=>{const e=(e,t)=>{B([e]),z(t)};return op({connections:D,configMinSupportedVersion:u,snapshotMinSupportedVersion:g,onDelete:t=>e(t,Zu.Delete),onAddSource:!I&&m&&b?t=>e(t,Zu.BulkSource):void 0,onAddDestination:!I&&v&&C&&w?t=>e(t,Zu.BulkDestination):void 0,onAddAction:!I&&T?t=>e(t,Zu.BulkAction):void 0,onAddInstrumentationRule:!I&&$?t=>e(t,Zu.BulkInstrumentationRule):void 0,onEditConfiguration:!I&&p&&h?t=>e(t,Zu.BulkConfig):void 0})},[I,D,u,p,h,g,m,b,v,C,w,T,$]),G=a(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:a,onAddInstrumentationRule:i,onManageConfigurations:l}=e,r=[];o&&r.push({id:Bo(),type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:"Add Sources",rightIcon:xi,onClick:o}});const s=[n?{id:Zu.BulkDestination,label:Me.ADD_DESTINATION,icon:bi}:null,a?{id:Zu.BulkAction,label:Me.ADD_ACTION,icon:fi}:null,i?{id:Zu.BulkInstrumentationRule,label:Me.ADD_INSTRUMENTATION_RULE,icon:wi}:null,l?{id:Zu.BulkConfig,label:"Manage Configurations",icon:Ti}:null];return s.some(Boolean)&&r.push({id:Bo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"Bulk Operations",onClick:e=>{e===Zu.BulkSource?o?.():e===Zu.BulkDestination?n?.():e===Zu.BulkAction?a?.():e===Zu.BulkInstrumentationRule?i?.():e===Zu.BulkConfig&&l?.()}},dropDataProps:{alignX:Mo.Left,items:s}}),r.push({id:Bo(),type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:St.CANCEL,onClick:t}}),r})({onCancel:()=>B([]),onAddSource:!I&&m&&b?()=>z(Zu.BulkSource):void 0,onAddDestination:!I&&v&&C&&w?()=>z(Zu.BulkDestination):void 0,onAddAction:!I&&T?()=>z(Zu.BulkAction):void 0,onAddInstrumentationRule:!I&&$?()=>z(Zu.BulkInstrumentationRule):void 0,onManageConfigurations:!I&&p&&h?()=>z(Zu.BulkConfig):void 0}),[I,p,h,m,b,v,C,w,T,$]);return t(ua,{children:e(Ye,{richTitle:{icon:Yi,title:Me.CONNECTIONS,badge:{label:D.length.toString(),status:pt.Unknown}},search:{placeholder:"Search by cluster name",value:F,onChange:e=>L(e),width:"300px"},actions:[{id:Bo(),type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,leftIcon:Ni,onClick:P,disabled:A}}],children:[t(mo,{variant:fo.Pretty,maxHeight:o,headerBackgroundColor:E.v2.colors.silver[1e3],isLoading:A,withCheckboxes:!0,columns:ep,rows:H,rowActionsPushRightPosition:_?`calc(${Cl} - 24px)`:void 0,getRowActions:j}),_===Zu.BulkConfig&&p&&h&&t(Ds,{onClose:()=>z(null),connections:V,selectedConnectionIds:M,setSelectedConnectionIds:B,getEffectiveConfig:p,onApply:h}),_===Zu.BulkSource&&m&&b&&t(Fl,{selectedConnectionIds:M,children:t(Ns,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,getAllClusterSnapshots:m,persistSources:async e=>await(b?.(e))})}),_===Zu.BulkDestination&&v&&C&&S&&w&&x&&t(Ll,{children:t(ss,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,getDestinationCategories:v,getPotentialDestinations:C,testConnection:e=>S(e,M),createDestination:e=>w(e,M),updateDestination:(e,t)=>x(e,t,M)})}),_===Zu.BulkAction&&T&&t(_l,{children:t(Zr,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,createAction:e=>T(e,M)})}),_===Zu.BulkInstrumentationRule&&$&&t(zl,{children:t(cs,{onClose:()=>z(null),selectedConnectionIds:M,setSelectedConnectionIds:B,createInstrumentationRule:e=>$(e,M)})}),t(fl,{target:"connection",isOpen:_===Zu.Delete,onClose:()=>{B([]),z(null)},onApprove:async()=>{const e=M[0];e&&(await d(e),await P())}}),t(pa,{isOpen:!!M.length&&!_,richTitle:{icon:si,title:"Selected Clusters",badge:{label:M.length}},actions:G})]})})},ap=m.div`
441
552
  display: flex;
442
553
  align-items: center;
443
554
  justify-content: space-between;
@@ -446,26 +557,26 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
446
557
  width: calc(100% - 32px);
447
558
  border-radius: 16px;
448
559
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
449
- `,Au=g.div`
560
+ `,ip=m.div`
450
561
  display: flex;
451
562
  align-items: center;
452
563
  justify-content: center;
453
564
  padding: 8px;
454
565
  border-radius: 8px;
455
- background-color: ${({theme:e})=>e.v2.colors.white[500]+je["004"]};
456
- `,Du=({setStep:o,onSave:n,sourcesPayload:a,destinationsPayload:i,disableAnimation:l})=>{const s=f(),c=()=>o(2),d=()=>o(3),u=r(()=>Object.values(a||{}).flatMap((o,n)=>o.map((o,a)=>{if(!o.selected)return null;const i=o.kind||lt.Namespace,l=i===lt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(Ou,{children:[t(re,{nowrap:!0,children:l}),t(Ee,{label:i,status:ge.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[a]),p=r(()=>i?.map((o,n)=>{const a=tt(o.option.type).icon;return e(Ou,{children:[e(te,{$gap:8,children:[a&&t(Au,{children:t(a,{size:24})}),t(re,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Ee,{status:o.testResult.succeeded?ge.Success:ge.Error,leftIcon:o.testResult.succeeded?vi:yi})]},`destination-${n}`)})||[],[i]);return t(ml,{isOpen:!0,disableAnimation:l,onBack:()=>o(3),onSave:n,header:{icon:Ti,title:Re.SUMMARY,subTitle:Re.REVIEW_SETUP},leftColumn:{width:"50%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(Si,{size:24}),t(re,{nowrap:!0,children:Re.SELECTED_SOURCES}),t(Ee,{label:u.length})]}),t(oe,{"data-id":"summary-edit-sources",leftIcon:di,variant:ae.Secondary,size:ne.S,onClick:c})]}),list:u.length?u:[t(Ke,{$height:"100%",children:t(se,{icon:Si,title:Re.NO_SOURCES_SELECTED,subTitle:Re.ADD_SOURCE_PROMPT,button:{leftIcon:ii,label:Re.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(te,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(te,{$gap:8,children:[t(gi,{size:24}),t(re,{nowrap:!0,children:Re.SELECTED_DESTINATIONS}),t(Ee,{label:p.length})]}),t(oe,{"data-id":"summary-edit-destinations",leftIcon:di,variant:ae.Secondary,size:ne.S,onClick:d})]}),list:p.length?p:[t(Ke,{"data-id":"summary-no-destinations",$height:"100%",children:t(se,{icon:gi,title:Re.NO_DESTINATIONS_SELECTED,subTitle:Re.ADD_DESTINATION_PROMPT,button:{leftIcon:ii,label:Re.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},Ru=g.div`
566
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+qe["004"]};
567
+ `,lp=({setStep:o,onSave:n,sourcesPayload:i,destinationsPayload:l,disableAnimation:r})=>{const s=f(),c=()=>o(2),d=()=>o(3),u=a(()=>Object.values(i||{}).flatMap((o,n)=>o.map((o,a)=>{if(!o.selected)return null;const i=o.kind||ut.Namespace,l=i===ut.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(ap,{children:[t(Q,{nowrap:!0,children:l}),t(Fe,{label:i,status:we.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${a}`)})).filter(Boolean),[i]),p=a(()=>l?.map((o,n)=>{const a=lt(o.option.type).icon;return e(ap,{children:[e(oe,{$gap:8,children:[a&&t(ip,{children:t(a,{size:24})}),t(Q,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Fe,{status:o.testResult.succeeded?we.Success:we.Error,leftIcon:o.testResult.succeeded?Ci:Si})]},`destination-${n}`)})||[],[l]);return t(ml,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:Ei,title:Me.SUMMARY,subTitle:Me.REVIEW_SETUP},leftColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(xi,{size:24}),t(Q,{nowrap:!0,children:Me.SELECTED_SOURCES}),t(Fe,{label:u.length})]}),t(ne,{"data-id":"summary-edit-sources",leftIcon:pi,variant:ie.Secondary,size:ae.S,onClick:c})]}),list:u.length?u:[t(Qe,{$height:"100%",children:t(me,{icon:xi,title:Me.NO_SOURCES_SELECTED,subTitle:Me.ADD_SOURCE_PROMPT,button:{leftIcon:li,label:Me.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(oe,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(oe,{$gap:8,children:[t(bi,{size:24}),t(Q,{nowrap:!0,children:Me.SELECTED_DESTINATIONS}),t(Fe,{label:p.length})]}),t(ne,{"data-id":"summary-edit-destinations",leftIcon:pi,variant:ie.Secondary,size:ae.S,onClick:d})]}),list:p.length?p:[t(Qe,{"data-id":"summary-no-destinations",$height:"100%",children:t(me,{icon:bi,title:Me.NO_DESTINATIONS_SELECTED,subTitle:Me.ADD_DESTINATION_PROMPT,button:{leftIcon:li,label:Me.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},rp=m.div`
457
568
  position: relative;
458
569
  overflow: hidden;
459
570
  width: calc(100vw - ${({$paddingXAxis:e})=>e});
460
571
  height: calc(100vh - ${({$paddingYAxis:e})=>e});
461
572
  box-sizing: border-box;
462
- `,Fu=g.svg`
573
+ `,sp=m.svg`
463
574
  position: absolute;
464
575
  top: 50%;
465
576
  left: 50%;
466
577
  transform: translate(-50%, -50%);
467
578
  z-index: -1;
468
- `,Pu=[{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"}],Lu=[{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:Pu},{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:Pu},{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:Pu}],_u=({paddingXAxis:o="0px",paddingYAxis:a="0px",children:i})=>{const[s,c]=l(window.innerWidth),d=r(()=>s/Lu[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(Ru,{$paddingXAxis:o,$paddingYAxis:a,children:[Lu.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:s},r)=>{const c=`purple-ring-${r}`;return e(Fu,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:s.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),i]})},Mu=g.div`
579
+ `,cp=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],dp=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:cp},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:cp},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:cp}],up=({paddingXAxis:o="0px",paddingYAxis:i="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=a(()=>s/dp[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(rp,{$paddingXAxis:o,$paddingYAxis:i,children:[dp.map(({width:o,height:n,pathOpacity:a,path:i,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(sp,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:a,d:i,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},pp=m.div`
469
580
  display: flex;
470
581
  flex-direction: column;
471
582
  align-items: center;
@@ -476,7 +587,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
476
587
  width: 50vw;
477
588
  border-radius: 16px;
478
589
  background: ${({theme:e})=>e.v2.colors.silver[900]};
479
- `,Bu=g.div`
590
+ `,hp=m.div`
480
591
  display: flex;
481
592
  flex-direction: column;
482
593
  align-items: center;
@@ -486,15 +597,15 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
486
597
  & * {
487
598
  text-align: center;
488
599
  }
489
- `,zu=({onStart:o})=>t(ft,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(Ke,{$height:"100%",children:e(Mu,{children:[e(Bu,{children:[t(re,{size:ce.L,weight:500,children:Re.GET_STARTED_WITH}),t(vl,{size:260}),t(re,{size:ce.S,weight:400,children:Re.GET_STARTED_DESCRIPTION})]}),t(oe,{"data-id":"onboarding-get-started",label:bt.GET_STARTED,rightIcon:ji,size:ne.L,onClick:o})]})})}),Xu=[{step:1,label:Re.INSTALLATION,forceDoneBadge:!0},{step:2,label:Re.SOURCES_SETUP},{step:3,label:Re.DESTINATIONS_SETUP},{step:4,label:Re.SUMMARY}],Vu=g.div`
600
+ `,gp=({onStart:o})=>t(q,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(Qe,{$height:"100%",children:e(pp,{children:[e(hp,{children:[t(Q,{size:te.L,weight:500,children:Me.GET_STARTED_WITH}),t(yl,{size:260}),t(Q,{size:te.S,weight:400,children:Me.GET_STARTED_DESCRIPTION})]}),t(ne,{"data-id":"onboarding-get-started",label:St.GET_STARTED,rightIcon:ri,size:ae.L,onClick:o})]})})}),mp=[{step:1,label:Me.INSTALLATION,forceDoneBadge:!0},{step:2,label:Me.SOURCES_SETUP},{step:3,label:Me.DESTINATIONS_SETUP},{step:4,label:Me.SUMMARY}],fp=m.div`
490
601
  display: flex;
491
602
  flex-direction: column;
492
603
  gap: 32px;
493
604
  padding: 64px;
494
- `,Uu=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:s,getPotentialDestinations:r,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Lo(),[m,g]=l(1),[f,b]=l(!1),[v,y]=l(null),[C,S]=l(null),w=()=>g(e=>e+1),x=()=>g(e=>e-1);return e(_u,{paddingXAxis:o,paddingYAxis:n,children:[e(Vu,{children:[t(vl,{useInline:!0}),t(da,{currentStep:m,data:Xu,gap:32})]}),t(Fl,{initialInputs:v,children:e(Pl,{children:[1===m&&t(zu,{onStart:w}),2===m&&t(ar,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===m&&t(_s,{disableAnimation:!0,onBack:e=>{S(e),x()},onNext:e=>{S(e),w()},getDestinationCategories:s,getPotentialDestinations:r,initialInputs:C,testConnection:c,createDestination:d,updateDestination:u}),4===m&&t(Du,{disableAnimation:!0,setStep:g,onSave:async()=>{if(!f){b(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value?.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};h(Id),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},Hu=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),ju=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Wu=g.div`
605
+ `,bp=({pagePaddingXAxis:o,pagePaddingYAxis:n,fetchNamespacesWithWorkloads:a,persistSources:i,getDestinationCategories:l,getPotentialDestinations:s,testConnection:c,createDestination:d,updateDestination:u,onDone:p})=>{const{setCurrentModal:h}=Xo(),[g,m]=r(1),[f,b]=r(!1),[v,y]=r(null),[C,S]=r(null),w=()=>m(e=>e+1),x=()=>m(e=>e-1);return e(up,{paddingXAxis:o,paddingYAxis:n,children:[e(fp,{children:[t(yl,{useInline:!0}),t(ha,{currentStep:g,data:mp,gap:32})]}),t(Fl,{initialInputs:v,children:e(Ll,{children:[1===g&&t(gp,{onStart:w}),2===g&&t(Ns,{disableAnimation:!0,onBack:e=>{y(e),x()},onNext:e=>{y(e),w()},fetchNamespacesWithWorkloads:a,persistSources:i}),3===g&&t(ss,{disableAnimation:!0,onBack:e=>{S(e),x()},onNext:e=>{S(e),w()},getDestinationCategories:l,getPotentialDestinations:s,initialInputs:C,testConnection:c,createDestination:d,updateDestination:u}),4===g&&t(lp,{disableAnimation:!0,setStep:m,onSave:async()=>{if(!f){b(!0);try{const e=[];v&&e.push(i(v)),C&&e.push(...C.map(e=>d(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value?.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};h(ou),p()}catch(e){return b(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:v,destinationsPayload:C})]})})]})},vp=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),yp=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Cp=m.div`
495
606
  position: relative;
496
607
  display: inline-flex;
497
- `,Gu=g.button`
608
+ `,Sp=m.button`
498
609
  display: inline-flex;
499
610
  align-items: center;
500
611
  gap: 8px;
@@ -507,7 +618,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
507
618
  &:hover {
508
619
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
509
620
  }
510
- `,Ku=g.div`
621
+ `,wp=m.div`
511
622
  position: absolute;
512
623
  top: calc(100% + 8px);
513
624
  right: 0;
@@ -520,28 +631,28 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
520
631
  border-radius: 12px;
521
632
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
522
633
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
523
- `,Yu=g.div`
634
+ `,xp=m.div`
524
635
  display: flex;
525
636
  flex-direction: column;
526
637
  gap: 12px;
527
638
  padding: 16px;
528
639
  max-height: 60vh;
529
640
  overflow-y: auto;
530
- `,Ju=g.div`
641
+ `,kp=m.div`
531
642
  display: flex;
532
643
  align-items: center;
533
644
  gap: 8px;
534
645
  padding: 12px 16px;
535
646
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
536
- `,qu=g.div`
647
+ `,Tp=m.div`
537
648
  display: flex;
538
649
  align-items: center;
539
650
  gap: 8px;
540
651
  margin-left: auto;
541
- `,Zu=()=>{const o=f(),a=at(e=>e.sources),i=at(e=>e.namespaces),{selectedStreamName:s}=Fe(),{getItemSS:c,setItemSS:u,removeItemSS:p}=ga(),{namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=ua(),x=r(()=>pa(a,s),[a,s]);n(()=>{const e=c(ha.OVERVIEW_FILTERS,w());C(e)},[]);const[k,T]=l({namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[$,N]=l(ju(k)),[I,E]=l(!1);n(()=>{if(!I){const e={namespaces:h,kinds:m,monitors:g,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};T(e),N(ju(e))}},[I,h,m,g,b,v,y]);const O=d(null);eo(O,()=>E(!1)),Oo({key:"Escape",active:I},()=>E(!1));const A=r(()=>{const e=new Set,t=[];return i.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[i]),D=r(()=>{const e=new Set,t=[];return x.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[x]),R=r(()=>{const e=new Set,t=[];return x.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Oe[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[x]),F=r(()=>ma.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),P=r(()=>{const e=new Set,t=[];return x.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:$t(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[x]),L=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));T(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=I?fi:bi,M=r(()=>Hu(k.languages),[k.languages]);return e(Wu,{ref:O,children:[e(Gu,{"data-id":"filters-trigger",$isOpen:I,type:"button",onClick:()=>E(e=>!e),children:[t(Yi,{size:16,fill:o.v2.colors.white[500]}),t(re,{size:ce.XS,weight:500,nowrap:!0,children:"Filters"}),$>0&&t(Ee,{label:$,status:st.Unknown,textSize:ce.XXXS}),t(_,{size:16,fill:o.v2.colors.silver[200]})]}),I&&e(Ku,{children:[e(Yu,{children:[t(Je,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!A.length,options:A,values:Hu(k.namespaces),setValues:e=>L("namespaces",A,e)}),t(Je,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:Hu(k.kinds),setValues:e=>L("kinds",D,e)}),t(Je,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:M,setValues:e=>L("languages",R,e)}),t(Je,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:Hu(k.monitors),setValues:e=>L("monitors",F,e)}),t(Je,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:Hu(k.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",P,e)}),t(q,{label:"Show only sources with errors",size:ct.L,value:!!k.onlyErrors,onChange:e=>T(t=>({...t,onlyErrors:e}))})]}),e(Ju,{children:[t(oe,{"data-id":"filters-reset",size:ne.S,variant:ae.Text,label:"Reset",onClick:()=>{p(ha.OVERVIEW_FILTERS),S(),T(w()),N(0),E(!1)},textColor:o.v2.colors.red[500]}),e(qu,{children:[t(oe,{"data-id":"filters-cancel",size:ne.S,variant:ae.Secondary,label:"Cancel",onClick:()=>E(!1)}),t(oe,{"data-id":"filters-apply",size:ne.S,variant:ae.Primary,label:"Apply",onClick:()=>{u(ha.OVERVIEW_FILTERS,k),C(k),N(ju(k)),E(!1)}})]})]})]})]})},Qu="40vw",ep=g.div`
652
+ `,$p=()=>{const o=f(),l=ct(e=>e.sources),s=ct(e=>e.namespaces),{selectedStreamName:c}=Be(),{getItemSS:d,setItemSS:u,removeItemSS:p}=va(),{namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y,setAll:C,clearAll:S,getEmptyState:w}=ga(),x=a(()=>ma(l,c),[l,c]);n(()=>{const e=d(fa.OVERVIEW_FILTERS,w());C(e)},[]);const[k,T]=r({namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y}),[$,E]=r(yp(k)),[I,N]=r(!1);n(()=>{if(!I){const e={namespaces:h,kinds:g,monitors:m,languages:b,onlyErrors:v,podsAgentInjectionStatus:y};T(e),E(yp(e))}},[I,h,g,m,b,v,y]);const A=i(null);io(A,()=>N(!1)),Fo({key:"Escape",active:I},()=>N(!1));const O=a(()=>{const e=new Set,t=[];return s.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[s]),D=a(()=>{const e=new Set,t=[];return x.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[x]),R=a(()=>{const e=new Set,t=[];return x.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:Le[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[x]),P=a(()=>ba.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),F=a(()=>{const e=new Set,t=[];return x.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:a}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Ot(n)})}else if(a){if(e.has(a))return;e.add(a),t.push({id:a,label:a,withCheckbox:!0})}}),t},[x]),L=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));T(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},_=I?vi:yi,z=a(()=>vp(k.languages),[k.languages]);return e(Cp,{ref:A,children:[e(Sp,{"data-id":"filters-trigger",$isOpen:I,type:"button",onClick:()=>N(e=>!e),children:[t(Ji,{size:16,fill:o.v2.colors.white[500]}),t(Q,{size:te.XS,weight:500,nowrap:!0,children:"Filters"}),$>0&&t(Fe,{label:$,status:pt.Unknown,textSize:te.XXXS}),t(_,{size:16,fill:o.v2.colors.silver[200]})]}),I&&e(wp,{children:[e(xp,{children:[t(tt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!O.length,options:O,values:vp(k.namespaces),setValues:e=>L("namespaces",O,e)}),t(tt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:vp(k.kinds),setValues:e=>L("kinds",D,e)}),t(tt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!R.length,options:R,values:z,setValues:e=>L("languages",R,e)}),t(tt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:vp(k.monitors),setValues:e=>L("monitors",P,e)}),t(tt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:vp(k.podsAgentInjectionStatus),setValues:e=>L("podsAgentInjectionStatus",F,e)}),t(K,{label:"Show only sources with errors",size:gt.L,value:!!k.onlyErrors,onChange:e=>T(t=>({...t,onlyErrors:e}))})]}),e(kp,{children:[t(ne,{"data-id":"filters-reset",size:ae.S,variant:ie.Text,label:"Reset",onClick:()=>{p(fa.OVERVIEW_FILTERS),S(),T(w()),E(0),N(!1)},textColor:o.v2.colors.red[500]}),e(Tp,{children:[t(ne,{"data-id":"filters-cancel",size:ae.S,variant:ie.Secondary,label:"Cancel",onClick:()=>N(!1)}),t(ne,{"data-id":"filters-apply",size:ae.S,variant:ie.Primary,label:"Apply",onClick:()=>{u(fa.OVERVIEW_FILTERS,k),C(k),E(yp(k)),N(!1)}})]})]})]})]})},Ep="40vw",Ip=m.div`
542
653
  position: relative;
543
- width: ${Qu};
544
- `,tp=g.div`
654
+ width: ${Ep};
655
+ `,Np=m.div`
545
656
  position: absolute;
546
657
  top: calc(100% + 8px);
547
658
  left: 0;
@@ -550,23 +661,23 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
550
661
  flex-direction: column;
551
662
  gap: 8px;
552
663
  padding: 8px;
553
- width: calc(${Qu} - 16px);
664
+ width: calc(${Ep} - 16px);
554
665
  border-radius: 12px;
555
666
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
556
667
  box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
557
- `,op=g.div`
668
+ `,Ap=m.div`
558
669
  display: flex;
559
670
  align-items: center;
560
671
  overflow-x: auto;
561
- `,np=g.div`
672
+ `,Op=m.div`
562
673
  display: flex;
563
674
  flex-direction: column;
564
675
  gap: 0;
565
676
  max-height: 60vh;
566
677
  overflow-y: auto;
567
- `,ap=g.div`
678
+ `,Dp=m.div`
568
679
  padding: 8px 12px 4px 12px;
569
- `,ip=g.div`
680
+ `,Rp=m.div`
570
681
  display: flex;
571
682
  align-items: center;
572
683
  gap: 8px;
@@ -576,9 +687,9 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
576
687
  &:hover {
577
688
  background-color: ${({theme:e})=>e.v2.colors.silver[700]};
578
689
  }
579
- `,lp=g.div`
690
+ `,Pp=m.div`
580
691
  padding: 16px 8px;
581
- `,sp=({preventPopup:o=!1})=>{const n=f(),{onClickNode:i}=fa(),{searchText:s,setSearchText:c}=ua(),{selectedStreamName:u}=Fe(),p=at(e=>e.sources),h=at(e=>e.destinations),m=at(e=>e.actions),g=at(e=>e.instrumentationRules),b=d(null),[v,y]=l(!1),[C,S]=l("all"),w=!o&&(!!s||v),x=()=>{c(""),y(!1),S("all")};eo(b,()=>x()),Oo({key:"Escape",active:w},x);const{categories:k,searchResults:T}=r(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,s=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,r=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:lt.Source,label:"Sources",count:s.length,entities:[]},{category:lt.Action,label:"Actions",count:r.length,entities:[]},{category:lt.Destination,label:"Destinations",count:c.length,entities:[]},{category:lt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+s.length+r.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===lt.InstrumentationRule?l:e.category===lt.Source?s:e.category===lt.Action?r:e.category===lt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:g,sources:pa(p,u),actions:m,destinations:kt(h,u),searchText:s,selectedCategory:C}),[g,p,m,h,u,s,C]),$=r(()=>k.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[k]),N=T.some(({entities:e})=>e.length>0);return e(ep,{ref:b,children:[t(Ut,{value:s,onChange:e=>c(e.toLowerCase()),onFocus:()=>y(!0),width:Qu}),w&&e(tp,{children:[$.length>1&&t(op,{children:t(ue,{options:$,selected:C,setSelected:S})}),N?t(np,{children:T.map(({category:o,label:l,entities:s},r)=>{if(!s.length)return null;const c=va(o);return e(a,{children:[t(ap,{children:t(re,{size:ce.XXS,color:Ce.Secondary,children:l})}),s.map((a,l)=>e(ip,{onClick:()=>{const e=gt(a);i(null,{data:{type:o,id:e}}),x()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(re,{size:ce.XS,nowrap:!0,children:ba(a,o,{extended:!0})})]},`entity-${r}-${l}`))]},`category-list-${o}`)})}):t(lp,{children:t(se,{hideIcon:!0,title:"No results",subTitle:s?`No matches for "${s}"`:"Start typing to search"})})]})]})},rp=g.div`
692
+ `,Fp=({preventPopup:o=!1})=>{const n=f(),{onClickNode:l}=ya(),{searchText:c,setSearchText:d}=ga(),{selectedStreamName:u}=Be(),p=ct(e=>e.sources),h=ct(e=>e.destinations),g=ct(e=>e.actions),m=ct(e=>e.instrumentationRules),b=i(null),[v,y]=r(!1),[C,S]=r("all"),w=!o&&(!!c||v),x=()=>{d(""),y(!1),S("all")};io(b,()=>x()),Fo({key:"Escape",active:w},x);const{categories:k,searchResults:T}=a(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:a,selectedCategory:i})=>{const l=a?e.filter(e=>e.type?.toLowerCase().includes(a)||e.ruleName?.toLowerCase().includes(a)):e,r=a?t.filter(e=>e.id.name?.toLowerCase().includes(a)||e.serviceName?.toLowerCase().includes(a)||e.id.namespace?.toLowerCase().includes(a)):t,s=a?o.filter(e=>e.type?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):o,c=a?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(a)||e.name?.toLowerCase().includes(a)):n,d=[{category:ut.Source,label:"Sources",count:r.length,entities:[]},{category:ut.Action,label:"Actions",count:s.length,entities:[]},{category:ut.Destination,label:"Destinations",count:c.length,entities:[]},{category:ut.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(i)).map(e=>({...e,entities:e.category===ut.InstrumentationRule?l:e.category===ut.Source?r:e.category===ut.Action?s:e.category===ut.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:m,sources:ma(p,u),actions:g,destinations:Nt(h,u),searchText:c,selectedCategory:C}),[m,p,g,h,u,c,C]),$=a(()=>k.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[k]),E=T.some(({entities:e})=>e.length>0);return e(Ip,{ref:b,children:[t(Kt,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>y(!0),width:Ep}),w&&e(Np,{children:[$.length>1&&t(Ap,{children:t(le,{options:$,selected:C,setSelected:S})}),E?t(Op,{children:T.map(({category:o,label:a,entities:i},r)=>{if(!i.length)return null;const c=Sa(o);return e(s,{children:[t(Dp,{children:t(Q,{size:te.XXS,color:ee.Secondary,children:a})}),i.map((a,i)=>e(Rp,{onClick:()=>{const e=Ct(a);l(null,{data:{type:o,id:e}}),x()},children:[c&&t(c,{size:16,fill:n.v2.colors.white[500]}),t(Q,{size:te.XS,nowrap:!0,children:Ca(a,o,{extended:!0})})]},`entity-${r}-${i}`))]},`category-list-${o}`)})}):t(Pp,{children:t(me,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},Lp=m.div`
582
693
  position: relative;
583
694
  display: flex;
584
695
  align-items: center;
@@ -589,7 +700,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
589
700
  box-sizing: border-box;
590
701
  border-radius: 16px 16px 0 0;
591
702
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
592
- `,cp=g.div`
703
+ `,_p=m.div`
593
704
  position: absolute;
594
705
  bottom: 0;
595
706
  left: 0;
@@ -598,7 +709,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
598
709
  background-color: ${({theme:e})=>e.v2.colors.purple[500]};
599
710
  border-radius: 32px;
600
711
  transition: width 0.3s;
601
- `,dp=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:s,allSelected:r,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Lo();return e(rp,{children:[e(te,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(H,{size:ya.S,partiallyChecked:s,value:!!r,onChange:c}),t(re,{size:ce.S,nowrap:!0,children:`${$t(o)}s`}),t(Ee,{label:n,tooltip:a,status:st.Unknown,textSize:ce.XXXS})]}),e(te,{children:[t(qe,{"data-id":`add-${o}`,icon:ii,onClick:()=>u(o)}),t(qe,{"data-id":`refresh-${o}`,icon:Ni,onClick:l,disabled:i})]}),"number"==typeof d&&t(cp,{$percent:d})]})},up=g(V)`
712
+ `,zp=({entityType:o,badge:n,badgeTooltip:a,isLoading:i,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setCurrentModal:u}=Xo();return e(Lp,{children:[e(oe,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(H,{size:wa.S,partiallyChecked:r,value:!!s,onChange:c}),t(Q,{size:te.S,nowrap:!0,children:`${Ot(o)}s`}),t(Fe,{label:n,tooltip:a,status:pt.Unknown,textSize:te.XXXS})]}),e(oe,{children:[t(ot,{"data-id":`add-${o}`,icon:li,onClick:()=>u(o)}),t(ot,{"data-id":`refresh-${o}`,icon:Ni,onClick:l,disabled:i})]}),"number"==typeof d&&t(_p,{$percent:d})]})},Mp=m(V)`
602
713
  align-items: center !important;
603
714
  justify-content: center !important;
604
715
  align-self: stretch;
@@ -613,7 +724,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
613
724
  &:hover {
614
725
  background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
615
726
  }
616
- `,pp=({entityType:o,description:n})=>{const{setCurrentModal:a}=Lo();return e(up,{onClick:()=>a(o),children:[e(te,{$gap:4,children:[t(ii,{size:16}),t(re,{size:ce.S,children:`Add ${$t(o)}`})]}),t(re,{size:ce.XXS,align:"center",children:n})]})},hp=g.div`
727
+ `,Bp=({entityType:o,description:n})=>{const{setCurrentModal:a}=Xo();return e(Mp,{onClick:()=>a(o),children:[e(oe,{$gap:4,children:[t(li,{size:16}),t(Q,{size:te.S,children:`Add ${Ot(o)}`})]}),t(Q,{size:te.XXS,align:"center",children:n})]})},Xp=m.div`
617
728
  display: flex;
618
729
  align-items: center;
619
730
  gap: 12px;
@@ -628,10 +739,10 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
628
739
  &:hover {
629
740
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
630
741
  }
631
- `,mp=g(te)`
742
+ `,Vp=m(oe)`
632
743
  flex: 1;
633
744
  min-width: 0;
634
- `,gp=({entityId:o,entityType:n,title:a,status:i,faded:l,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=f(),b=n===lt.Source,v="boolean"==typeof h,y=l||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=jt(),{selectedSources:w,setSelectedSources:x}=Ca(),k=m,T=b?k.id.namespace:"",$=r(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),N=v&&!h?wa(ge.Info,g):i?wa(i,g):void 0,I=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(hp,{"data-id":I,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(H,{size:ya.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(Yt,{icons:u,icon:d,iconSrc:p}),e(mp,{$gap:4,children:[t(Sa,{size:ce.XS,nowrap:!0,children:a}),t(te,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(we,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ee,{label:c,status:i&&[ge.Error,ge.Warning].includes(i)?i:st.Unknown,leftIcon:N,textSize:ce.XXXS})})})]})]})};function fp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Bt.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Ft.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function bp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Bt.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const vp=g.div`
745
+ `,Up=({entityId:o,entityType:n,title:i,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:g})=>{const m=f(),b=n===ut.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=Jt(),{selectedSources:w,setSelectedSources:x}=xa(),k=g,T=b?k.id.namespace:"",$=a(()=>{if(!b)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[b,w,T,k.id]),E=v&&!h?ka(we.Info,m):l?ka(l,m):void 0,I=b&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Xp,{"data-id":I,$faded:y,onClick:()=>{C(n),S(o)},children:[b&&t(H,{size:wa.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(eo,{icons:u,icon:d,iconSrc:p}),e(Vp,{$gap:4,children:[t(fe,{size:te.XS,nowrap:!0,children:i}),t(oe,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(Ie,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Fe,{label:c,status:l&&[we.Error,we.Warning].includes(l)?l:pt.Unknown,leftIcon:E,textSize:te.XXXS})})})]})]})};function Hp(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Ht.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Mt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function jp(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Ht.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const Gp=m.div`
635
746
  position: absolute;
636
747
  top: 0;
637
748
  left: 0;
@@ -642,22 +753,22 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
642
753
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
643
754
  border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
644
755
  pointer-events: none;
645
- `,yp=g.div`
756
+ `,Wp=m.div`
646
757
  display: flex;
647
758
  align-items: center;
648
759
  gap: 8px;
649
760
  padding: 4px 8px 0;
650
- `,Cp=g.div`
761
+ `,Kp=m.div`
651
762
  flex: 1;
652
763
  height: 1px;
653
764
  background: ${({theme:e})=>e.v2.colors.silver[700]};
654
- `,Sp=({namespace:e})=>{const o=f();return t(vp,{children:t(re,{size:ce.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},wp=({namespace:o})=>{const n=f();return e(yp,{children:[t(Cp,{}),t(re,{size:ce.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Cp,{})]})},xp={[lt.InstrumentationRule]:Re.NO_DATA_INSTRUMENTATION_RULES,[lt.Source]:Re.NO_DATA_SOURCES,[lt.Action]:Re.NO_DATA_ACTIONS,[lt.Destination]:Re.NO_DATA_DESTINATIONS},kp=g.div`
765
+ `,Yp=({namespace:e})=>{const o=f();return t(Gp,{children:t(Q,{size:te.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Jp=({namespace:o})=>{const n=f();return e(Wp,{children:[t(Kp,{}),t(Q,{size:te.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Kp,{})]})},qp={[ut.InstrumentationRule]:Me.NO_DATA_INSTRUMENTATION_RULES,[ut.Source]:Me.NO_DATA_SOURCES,[ut.Action]:Me.NO_DATA_ACTIONS,[ut.Destination]:Me.NO_DATA_DESTINATIONS},Zp=m.div`
655
766
  display: flex;
656
767
  flex-direction: column;
657
768
  flex: 1 0 0;
658
769
  min-width: 0;
659
770
  ${({$isVm:e})=>e?"width: 45vw;":""}
660
- `,Tp=g.div`
771
+ `,Qp=m.div`
661
772
  display: flex;
662
773
  flex-direction: column;
663
774
  align-items: stretch;
@@ -667,7 +778,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
667
778
  border-radius: 0 0 16px 16px;
668
779
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
669
780
  overflow: hidden;
670
- `,$p=g.div`
781
+ `,eh=m.div`
671
782
  position: relative;
672
783
  display: flex;
673
784
  flex-direction: column;
@@ -679,16 +790,16 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
679
790
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
680
791
  height: ${({$height:e})=>e}px;
681
792
  overflow: hidden;
682
- `,Np=(e,t,o,n)=>{const a=gt(e);if(!a)return null;const i=t===lt.Source;let l,s,r=!1,c=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Ft.Failure:return{status:ge.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Ft.Notice:return{status:ge.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Ft.Pending:case Ft.Waiting:return{status:void 0,faded:!1,displaySource:fp(e)};case Ft.Unsupported:case Ft.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:bp(e)}}}(e);l=t.status,r=t.faded,s=t.tooltip,c=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=ka(e.conditions);l=t,r=o}const d=ba(e,t,{extended:i,prioritizeDisplayName:!i});let u,p,h,m,g;switch(t){case lt.Source:{u=Kt(e),p=va(lt.Source);const t=n?.get(Ta(a));m=Jt(t);break}case lt.Destination:{const t=tt(e.destinationType.type);p=t.icon,h=t.iconSrc;const o=n?.get(Ta(a));m=Jt(o),g=!e.disabled;break}case lt.Action:p=St(e.type),g=!e.disabled;break;case lt.InstrumentationRule:p=Ot(e.type),g=!e.disabled}return{key:Ta(a),entityId:a,namespace:i?e.id.namespace:void 0,raw:c,itemProps:{entityId:a,entityType:t,title:d,status:l,faded:r,tooltip:s,throughput:m,icon:p,icons:u,iconSrc:h,isActive:g,raw:c}}},Ip=({entityType:o,entities:a,unfilteredCount:i,metrics:s,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),m=o===lt.Source,g=a.length!==i,f=ut(e=>m?e.progress[pt.Instrumenting]?.percentage:void 0),b=ut(e=>m?e.progress[pt.Uninstrumenting]?.percentage:void 0),v=!m||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=Ca(),w=r(()=>m?Object.values(C).reduce((e,t)=>e+t.length,0):0,[m,C]),x=r(()=>{if(!s)return;const e=new Map,t=o===lt.Source?s.sources:o===lt.Destination?s.destinations:void 0;if(t)for(const o of t)e.set(xa(o),o.throughput);return e},[s,o]),k=r(()=>a.map(e=>Np(e,o,0,x)).filter(Boolean),[a,o,x,h]),[T,$]=l(""),{elements:N,indexToNamespace:I,multipleNs:E,dividerCount:O}=r(()=>{const e=[],o=[],n=new Set(k.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const n of k)m&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(wp,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(gp,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[k,m]);n(()=>{if(m&&I.length&&!T){const e=I.find(Boolean);e&&$(e)}},[m,I]);const A=c(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==T&&$(t)},[I,T]);if(h&&[lt.InstrumentationRule,lt.Action].includes(o))return null;const D=58*k.length+(E?28:0)+32*O,R=Math.max(0,u-52-16),F=Math.min(R,D)+8,P="number"==typeof v?`${v}%`:g?`${a.length}/${i}`:i;return e(kp,{$isVm:h,children:[t(dp,{entityType:o,badge:P,badgeTooltip:g?Re.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&a?.length!==w,allSelected:w>0&&a?.length===w,onSelectAll:m?e=>{if(m)if(e){const e={};a?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(Tp,{children:a.length?e($p,{$height:F,children:[E&&T&&t(Sp,{namespace:T}),t(Ht,{gap:4,elements:N,onTopIndexChange:E?A:void 0})]}):d?t(lo,{size:3}):t(pp,{entityType:o,description:xp[o]??Re.TO_COLLECT_OTEL_DATA})})]})},Ep=g.div`
793
+ `,th=(e,t,o,n)=>{const a=Ct(e);if(!a)return null;const i=t===ut.Source;let l,r,s=!1,c=e;if(i){const t=function(e){const t=e.workloadOdigosHealthStatus?.status;switch(t){case Mt.Failure:return{status:we.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Mt.Notice:return{status:we.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Mt.Pending:case Mt.Waiting:return{status:void 0,faded:!1,displaySource:Hp(e)};case Mt.Unsupported:case Mt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:jp(e)}}}(e);l=t.status,s=t.faded,r=t.tooltip,c=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=$a(e.conditions);l=t,s=o}const d=Ca(e,t,{extended:i,prioritizeDisplayName:!i});let u,p,h,g,m;switch(t){case ut.Source:{u=Qt(e),p=Sa(ut.Source);const t=n?.get(Ea(a));g=to(t);break}case ut.Destination:{const t=lt(e.destinationType.type);p=t.icon,h=t.iconSrc;const o=n?.get(Ea(a));g=to(o),m=!e.disabled;break}case ut.Action:p=Tt(e.type),m=!e.disabled;break;case ut.InstrumentationRule:p=Ft(e.type),m=!e.disabled}return{key:Ea(a),entityId:a,namespace:i?e.id.namespace:void 0,raw:c,itemProps:{entityId:a,entityType:t,title:d,status:l,faded:s,tooltip:r,throughput:g,icon:p,icons:u,iconSrc:h,isActive:m,raw:c}}},oh=({entityType:o,entities:i,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const{isVm:h}=y(),g=o===ut.Source,m=i.length!==s,f=ft(e=>g?e.progress[bt.Instrumenting]?.percentage:void 0),b=ft(e=>g?e.progress[bt.Uninstrumenting]?.percentage:void 0),v=!g||void 0===f&&void 0===b?void 0:f||b||0,{selectedSources:C,setSelectedSources:S}=xa(),w=a(()=>g?Object.values(C).reduce((e,t)=>e+t.length,0):0,[g,C]),x=a(()=>{if(!c)return;const e=new Map,t=o===ut.Source?c.sources:o===ut.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(Ta(o),o.throughput);return e},[c,o]),k=a(()=>i.map(e=>th(e,o,0,x)).filter(Boolean),[i,o,x,h]),[T,$]=r(""),{elements:E,indexToNamespace:I,multipleNs:N,dividerCount:A}=a(()=>{const e=[],o=[],n=new Set(k.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let a=0,i="";for(const n of k)g&&n.namespace&&n.namespace!==i&&(""!==i&&(o.push(n.namespace),e.push(t(Jp,{namespace:n.namespace},`ns-divider-${n.namespace}`)),a+=1),i=n.namespace),o.push(n.namespace||""),e.push(t(Up,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:a}},[k,g]);n(()=>{if(g&&I.length&&!T){const e=I.find(Boolean);e&&$(e)}},[g,I]);const O=l(e=>{if(!I.length)return;const t=I[Math.min(e,I.length-1)];t&&t!==T&&$(t)},[I,T]);if(h&&[ut.InstrumentationRule,ut.Action].includes(o))return null;const D=58*k.length+(N?28:0)+32*A,R=Math.max(0,u-52-16),P=Math.min(R,D)+8,F="number"==typeof v?`${v}%`:m?`${i.length}/${s}`:s;return e(Zp,{$isVm:h,children:[t(zp,{entityType:o,badge:F,badgeTooltip:m?Me.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:w>0&&i?.length!==w,allSelected:w>0&&i?.length===w,onSelectAll:g?e=>{if(g)if(e){const e={};i?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),S(e)}else S({})}:void 0,progressPercent:v}),t(Qp,{children:i.length?e(eh,{$height:P,children:[N&&T&&t(Yp,{namespace:T}),t(Yt,{gap:4,elements:E,onTopIndexChange:N?O:void 0})]}):d?t(po,{size:3}):t(Bp,{entityType:o,description:qp[o]??Me.TO_COLLECT_OTEL_DATA})})]})},nh=m.div`
683
794
  width: 100%;
684
795
  height: ${({$height:e})=>e||"auto"};
685
796
  display: flex;
686
797
  align-items: stretch;
687
798
  gap: 16px;
688
- `,Op=({height:o,metrics:n,refetchSources:a,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:s})=>{const c=ua(),{selectedStreamName:d}=Fe(),{containerRef:u,containerHeight:p}=$a(),h=at(e=>e.sources),m=at(e=>e.sourcesLoading),g=at(e=>e.destinations),f=at(e=>e.destinationsLoading),b=at(e=>e.actions),v=at(e=>e.actionsLoading),y=at(e=>e.instrumentationRules),C=at(e=>e.instrumentationRulesLoading),S=r(()=>pa(h,d),[h,d]),w=r(()=>kt(g,d),[g,d]),x=r(()=>Na(S,c),[S,c]),k=r(()=>Ia(w,c),[w,c]),T=r(()=>Ea(b,c),[b,c]);return e(Ep,{ref:u,$height:o,children:[t(Ip,{entityType:lt.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:C,maxHeight:p,refetch:s}),t(Ip,{entityType:lt.Source,entities:x,unfilteredCount:S.length,metrics:n,loading:m,maxHeight:p,refetch:a}),t(Ip,{entityType:lt.Action,entities:T,unfilteredCount:b.length,loading:v,maxHeight:p,refetch:l}),t(Ip,{entityType:lt.Destination,entities:k,unfilteredCount:w.length,metrics:n,loading:f,maxHeight:p,refetch:i})]})},Ap=({effectiveConfig:n,fetchNamespacesWithWorkloads:a,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchProfilingSlots:h,fetchSourceProfiling:m,fetchK8sManifest:g,getDestinationCategories:f,getPotentialDestinations:b,testConnection:v,createDestination:y,updateDestination:C,deleteDestination:S,createInstrumentationRule:w,updateInstrumentationRule:x,deleteInstrumentationRule:k,createAction:T,updateAction:$,deleteAction:N})=>{const{currentModal:I,setCurrentModal:E}=Lo(),{drawerType:O,drawerEntityId:A,setDrawerType:D,setDrawerEntityId:R}=jt(),F=()=>{E(""),D(null),R(null)};return e(o,{children:[t(Ed,{}),I===lt.Source&&t(Fl,{children:t(ar,{onClose:F,fetchNamespacesWithWorkloads:a,persistSources:i,withOverlay:!0})}),I===lt.Destination&&t(Pl,{children:t(_s,{onClose:F,getDestinationCategories:f,getPotentialDestinations:b,testConnection:v,createDestination:y,updateDestination:C,withOverlay:!0})}),I===lt.InstrumentationRule&&t(_l,{children:t(Ms,{onClose:F,createInstrumentationRule:w,withOverlay:!0})}),I===lt.Action&&t(Ll,{children:t(Ns,{onClose:F,createAction:T,withOverlay:!0})}),O===lt.Source&&A&&t(Ml,{children:t(td,{onClose:F,effectiveConfig:n,sourceId:A,persistSources:i,restartWorkloads:l,restartPod:s,recoverFromRollback:r,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchSourceProfiling:m,fetchProfilingSlots:h,fetchK8sManifest:g})}),O===lt.Destination&&A&&t(Pl,{children:t(sr,{onClose:F,destinationId:A,getDestinationCategories:f,testConnection:v,updateDestination:C,deleteDestination:S})}),O===lt.InstrumentationRule&&A&&t(_l,{children:t(rr,{onClose:F,ruleId:A,updateInstrumentationRule:x,deleteInstrumentationRule:k})}),O===lt.Action&&A&&t(Ll,{children:t(ir,{onClose:F,actionId:A,updateAction:$,deleteAction:N})})]})},Dp="multi-source-deselect",Rp="multi-source-restart",Fp="multi-source-uninstrument",Pp="Selected sources",Lp="Deselect",_p="Restart",Mp="Uninstrument",Bp="Rollout Restart Workloads",zp="Are you sure you want to rollout restart these workloads?",Xp="Go Back",Vp="Confirm",Up=({restartWorkloads:a,persistSources:i})=>{const{selectedStreamName:s}=Fe(),{selectedSources:d,setSelectedSources:u}=Ca(),[p,h]=l(!1),[m,g]=l(!1),f=r(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),b=c(()=>{u({})},[u]),v=c(()=>h(!1),[]),y=c(()=>g(!1),[]);n(()=>{b()},[s,b]);const C=c(()=>{a(Object.values(d).flat().filter(e=>e.id.kind!==io.StaticPod).map(Wt)),b()},[a,d,b]),S=c(()=>{i(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:s}))]))),b()},[i,d,s,b]),w=r(()=>[{id:Dp,type:Vt.Button,buttonProps:{variant:ae.Text,size:ne.S,label:Lp,onClick:b}},{id:Rp,type:Vt.Button,buttonProps:{variant:ae.Secondary,size:ne.S,label:_p,leftIcon:Bi,onClick:()=>h(!0)}},{id:Fp,type:Vt.Button,buttonProps:{variant:ae.Primary,size:ne.S,label:Mp,leftIcon:ai,onClick:()=>g(!0)}}],[b]);return e(o,{children:[t(ca,{isOpen:f>0,richTitle:{icon:Si,title:Pp,badge:{label:f}},actions:w}),t(De,{isOpen:p,title:Bp,description:zp,onClose:v,denyButton:{label:Xp,variant:ae.Secondary,onClick:v},approveButton:{label:Vp,variant:ae.Primary,onClick:()=>{C(),v()}}}),t(gl,{isOpen:m,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},Hp=e=>`Data Stream: ${e}`,jp="Search streams...",Wp="No streams match",Gp=g.div`
799
+ `,ah=({height:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:r,refetchInstrumentationRules:s})=>{const c=ga(),{selectedStreamName:d}=Be(),{containerRef:u,containerHeight:p}=Ia(),h=ct(e=>e.sources),g=ct(e=>e.sourcesLoading),m=ct(e=>e.destinations),f=ct(e=>e.destinationsLoading),b=ct(e=>e.actions),v=ct(e=>e.actionsLoading),y=ct(e=>e.instrumentationRules),C=ct(e=>e.instrumentationRulesLoading),S=a(()=>ma(h,d),[h,d]),w=a(()=>Nt(m,d),[m,d]),x=a(()=>Na(S,c),[S,c]),k=a(()=>Aa(w,c),[w,c]),T=a(()=>Oa(b,c),[b,c]);return e(nh,{ref:u,$height:o,children:[t(oh,{entityType:ut.InstrumentationRule,entities:y,unfilteredCount:y.length,loading:C,maxHeight:p,refetch:s}),t(oh,{entityType:ut.Source,entities:x,unfilteredCount:S.length,metrics:n,loading:g,maxHeight:p,refetch:i}),t(oh,{entityType:ut.Action,entities:T,unfilteredCount:b.length,loading:v,maxHeight:p,refetch:r}),t(oh,{entityType:ut.Destination,entities:k,unfilteredCount:w.length,metrics:n,loading:f,maxHeight:p,refetch:l})]})},ih=({effectiveConfig:n,fetchNamespacesWithWorkloads:a,persistSources:i,restartWorkloads:l,restartPod:r,recoverFromRollback:s,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchProfilingSlots:h,fetchSourceProfiling:g,fetchK8sManifest:m,getDestinationCategories:f,getPotentialDestinations:b,testConnection:v,createDestination:y,updateDestination:C,deleteDestination:S,createInstrumentationRule:w,updateInstrumentationRule:x,deleteInstrumentationRule:k,createAction:T,updateAction:$,deleteAction:E})=>{const{currentModal:I,setCurrentModal:N}=Xo(),{drawerType:A,drawerEntityId:O,setDrawerType:D,setDrawerEntityId:R}=Jt(),P=()=>{N(""),D(null),R(null)};return e(o,{children:[t(nu,{}),I===ut.Source&&t(Fl,{children:t(Ns,{onClose:P,fetchNamespacesWithWorkloads:a,persistSources:i,withOverlay:!0})}),I===ut.Destination&&t(Ll,{children:t(ss,{onClose:P,getDestinationCategories:f,getPotentialDestinations:b,testConnection:v,createDestination:y,updateDestination:C,withOverlay:!0})}),I===ut.InstrumentationRule&&t(zl,{children:t(cs,{onClose:P,createInstrumentationRule:w,withOverlay:!0})}),I===ut.Action&&t(_l,{children:t(Zr,{onClose:P,createAction:T,withOverlay:!0})}),A===ut.Source&&O&&t(Ml,{children:t(Nd,{onClose:P,effectiveConfig:n,sourceId:O,persistSources:i,restartWorkloads:l,restartPod:r,recoverFromRollback:s,updateSource:c,fetchSourceById:d,fetchPeerSources:u,enableProfiling:p,fetchSourceProfiling:g,fetchProfilingSlots:h,fetchK8sManifest:m})}),A===ut.Destination&&O&&t(Ll,{children:t(Ps,{onClose:P,destinationId:O,getDestinationCategories:f,testConnection:v,updateDestination:C,deleteDestination:S})}),A===ut.InstrumentationRule&&O&&t(zl,{children:t(Ls,{onClose:P,ruleId:O,updateInstrumentationRule:x,deleteInstrumentationRule:k})}),A===ut.Action&&O&&t(_l,{children:t(Os,{onClose:P,actionId:O,updateAction:$,deleteAction:E})})]})},lh="multi-source-deselect",rh="multi-source-restart",sh="multi-source-uninstrument",ch="Selected sources",dh="Deselect",uh="Restart",ph="Uninstrument",hh="Rollout Restart Workloads",gh="Are you sure you want to rollout restart these workloads?",mh="Go Back",fh="Confirm",bh=({restartWorkloads:i,persistSources:s})=>{const{selectedStreamName:c}=Be(),{selectedSources:d,setSelectedSources:u}=xa(),[p,h]=r(!1),[g,m]=r(!1),f=a(()=>Object.values(d).reduce((e,t)=>e+t.length,0),[d]),b=l(()=>{u({})},[u]),v=l(()=>h(!1),[]),y=l(()=>m(!1),[]);n(()=>{b()},[c,b]);const C=l(()=>{i(Object.values(d).flat().filter(e=>e.id.kind!==uo.StaticPod).map(qt)),b()},[i,d,b]),S=l(()=>{s(Object.fromEntries(Object.entries(d).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:c}))]))),b()},[s,d,c,b]),w=a(()=>[{id:lh,type:Wt.Button,buttonProps:{variant:ie.Text,size:ae.S,label:dh,onClick:b}},{id:rh,type:Wt.Button,buttonProps:{variant:ie.Secondary,size:ae.S,label:uh,leftIcon:Xi,onClick:()=>h(!0)}},{id:sh,type:Wt.Button,buttonProps:{variant:ie.Primary,size:ae.S,label:ph,leftIcon:ii,onClick:()=>m(!0)}}],[b]);return e(o,{children:[t(pa,{isOpen:f>0,richTitle:{icon:xi,title:ch,badge:{label:f}},actions:w}),t(ze,{isOpen:p,title:hh,description:gh,onClose:v,denyButton:{label:mh,variant:ie.Secondary,onClick:v},approveButton:{label:fh,variant:ie.Primary,onClick:()=>{C(),v()}}}),t(fl,{isOpen:g,action:"uninstrument",target:`${f} source${1===f?"":"s"}`,onClose:y,onDeny:y,onApprove:S})]})},vh=e=>`Data Stream: ${e}`,yh="Search streams...",Ch="No streams match",Sh=m.div`
689
800
  position: relative;
690
801
  display: inline-flex;
691
- `,Kp=g.div`
802
+ `,wh=m.div`
692
803
  display: inline-flex;
693
804
  align-items: center;
694
805
  gap: 6px;
@@ -699,7 +810,7 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
699
810
  &:hover {
700
811
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
701
812
  }
702
- `,Yp=g.div`
813
+ `,xh=m.div`
703
814
  position: absolute;
704
815
  top: calc(100% + 8px);
705
816
  left: 0;
@@ -713,18 +824,18 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
713
824
  border-radius: 12px;
714
825
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
715
826
  box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
716
- `,Jp=g.div`
827
+ `,kh=m.div`
717
828
  display: flex;
718
829
  align-items: center;
719
830
  gap: 8px;
720
831
  width: 100%;
721
- `,qp=g.div`
832
+ `,Th=m.div`
722
833
  display: flex;
723
834
  flex-direction: column;
724
835
  gap: 0;
725
836
  max-height: 240px;
726
837
  overflow-y: auto;
727
- `,Zp=g.div`
838
+ `,$h=m.div`
728
839
  display: flex;
729
840
  align-items: center;
730
841
  gap: 8px;
@@ -735,29 +846,29 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
735
846
  &:hover {
736
847
  background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
737
848
  }
738
- `,Qp=g.div`
849
+ `,Eh=m.div`
739
850
  flex: 1;
740
851
  min-width: 0;
741
852
  overflow: hidden;
742
853
  text-overflow: ellipsis;
743
854
  white-space: nowrap;
744
- `,eh=g.div`
855
+ `,Ih=m.div`
745
856
  display: flex;
746
857
  align-items: center;
747
858
  gap: 2px;
748
859
  flex-shrink: 0;
749
- `,th=g.div`
860
+ `,Nh=m.div`
750
861
  display: flex;
751
862
  padding-top: 4px;
752
863
  border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
753
- `,oh=({updateDataStream:a,deleteDataStream:i,createDataStream:s})=>{const c=f(),{isVm:u}=y(),{clearStore:p}=Oa(),{dataStreams:h,selectedStreamName:m,setSelectedStreamName:g}=Fe(),b=d(null),[v,C]=l(!1),[S,w]=l(""),[x,k]=l(""),[T,$]=l(!1),[N,I]=l(!1),[E,O]=l(!1),[A,D]=l(""),[R,F]=l(!1);eo(b,()=>C(!1)),n(()=>{v||w("")},[v]);const P=r(()=>{if(!S)return h;const e=S.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,S]),L=v?fi:bi;return u?null:e(o,{children:[e(Gp,{ref:b,children:[e(Kp,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>C(e=>!e),children:[t(Ji,{size:24}),t(re,{size:ce.S,weight:500,nowrap:!0,children:Hp(m)}),t(Ee,{label:h.length,status:st.Unknown,textSize:ce.XXXS}),t(L,{size:20,fill:c.v2.colors.silver[200]})]}),v&&e(Yp,{children:[t(Jp,{children:t(Ut,{value:S,onChange:w,placeholder:jp,width:"100%"})}),t(qp,{children:0===P.length?t(Zp,{children:t(re,{size:ce.XS,color:Ce.Secondary,children:Wp})}):P.map(({name:o})=>{const n=o===Aa;return e(Zp,{"data-id":`stream-row-${o}`,$selected:o===m,onClick:()=>(e=>{e!==m&&(p(),g(e)),C(!1)})(o),children:[t(Qp,{children:t(re,{size:ce.XS,nowrap:!0,children:o})}),e(eh,{children:[t(qe,{"data-id":`stream-edit-${o}`,icon:di,size:Ze.XS,onClick:e=>{e.stopPropagation(),C(!1),k(o),$(!0)}}),!n&&t(qe,{"data-id":`stream-delete-${o}`,icon:ai,size:Ze.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),F(!0)}})]})]},`stream-${o}`)})}),t(th,{children:t(oe,{"data-id":"add-stream-trigger",variant:ae.Secondary,size:ne.S,leftIcon:ii,label:`${bt.NEW} ${Re.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),O(!0),I(!0)}})})]})]}),E&&t(Bl,{defaultExcludeName:m,children:t(kd,{isOpen:N,onClose:()=>I(!1),onCloseEnd:()=>O(!1),createDataStream:s})}),x&&t(Bl,{children:t(Td,{isOpen:T,dataStreamName:x,onClose:()=>$(!1),onCloseEnd:()=>k(""),updateDataStream:a})}),t(gl,{target:`${Re.STREAM_NAME.toLowerCase()} "${A}"`,isOpen:R,onClose:()=>F(!1),onApprove:async()=>{A&&await i(A)}})]})},nh=v`
864
+ `,Ah=({updateDataStream:l,deleteDataStream:s,createDataStream:c})=>{const d=f(),{isVm:u}=y(),{clearStore:p}=Da(),{dataStreams:h,selectedStreamName:g,setSelectedStreamName:m}=Be(),b=i(null),[v,C]=r(!1),[S,w]=r(""),[x,k]=r(""),[T,$]=r(!1),[E,I]=r(!1),[N,A]=r(!1),[O,D]=r(""),[R,P]=r(!1);io(b,()=>C(!1)),n(()=>{v||w("")},[v]);const F=a(()=>{if(!S)return h;const e=S.toLowerCase();return h.filter(({name:t})=>t.toLowerCase().includes(e))},[h,S]),L=v?vi:yi;return u?null:e(o,{children:[e(Sh,{ref:b,children:[e(wh,{"data-id":"data-stream-select",$isOpen:v,onClick:()=>C(e=>!e),children:[t(qi,{size:24}),t(Q,{size:te.S,weight:500,nowrap:!0,children:vh(g)}),t(Fe,{label:h.length,status:pt.Unknown,textSize:te.XXXS}),t(L,{size:20,fill:d.v2.colors.silver[200]})]}),v&&e(xh,{children:[t(kh,{children:t(Kt,{value:S,onChange:w,placeholder:yh,width:"100%"})}),t(Th,{children:0===F.length?t($h,{children:t(Q,{size:te.XS,color:ee.Secondary,children:Ch})}):F.map(({name:o})=>{const n=o===Ra;return e($h,{"data-id":`stream-row-${o}`,$selected:o===g,onClick:()=>(e=>{e!==g&&(p(),m(e)),C(!1)})(o),children:[t(Eh,{children:t(Q,{size:te.XS,nowrap:!0,children:o})}),e(Ih,{children:[t(ot,{"data-id":`stream-edit-${o}`,icon:pi,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),k(o),$(!0)}}),!n&&t(ot,{"data-id":`stream-delete-${o}`,icon:ii,size:nt.XS,onClick:e=>{e.stopPropagation(),C(!1),D(o),P(!0)}})]})]},`stream-${o}`)})}),t(Nh,{children:t(ne,{"data-id":"add-stream-trigger",variant:ie.Secondary,size:ae.S,leftIcon:li,label:`${St.NEW} ${Me.STREAM_NAME}`,fullWidth:!0,onClick:()=>{C(!1),p(),A(!0),I(!0)}})})]})]}),N&&t(Bl,{defaultExcludeName:g,children:t(Zd,{isOpen:E,onClose:()=>I(!1),onCloseEnd:()=>A(!1),createDataStream:c})}),x&&t(Bl,{children:t(Qd,{isOpen:T,dataStreamName:x,onClose:()=>$(!1),onCloseEnd:()=>k(""),updateDataStream:l})}),t(fl,{target:`${Me.STREAM_NAME.toLowerCase()} "${O}"`,isOpen:R,onClose:()=>P(!1),onApprove:async()=>{O&&await s(O)}})]})},Oh=v`
754
865
  0% {
755
866
  background-position: 200% 50%;
756
867
  }
757
868
  100% {
758
869
  background-position: 0% 50%;
759
870
  }
760
- `,ah=g.div`
871
+ `,Dh=m.div`
761
872
  display: flex;
762
873
  align-items: center;
763
874
  justify-content: space-evenly;
@@ -768,44 +879,44 @@ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect
768
879
 
769
880
  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%)`};
770
881
  background-size: 200% 100%;
771
- animation: ${nh} 15s linear infinite;
772
- `,ih=[Ci,Si,mi,gi],lh=({columnsMaxHeight:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r,updateDataStream:c,deleteDataStream:d,createDataStream:u,...p})=>{const h=f();return e(ra,{children:[e(Ue,{customTitle:t(oh,{updateDataStream:c,deleteDataStream:d,createDataStream:u}),customSearch:t(sp,{}),filters:t(Zu,{}),children:[t(ah,{children:ih.map((o,n)=>e(a,{children:[t(o,{size:24}),n<ih.length-1&&t(hi,{fill:h.v2.colors.white[500]+je["020"],size:24})]},o.name))}),t(Op,{height:o,metrics:n,refetchSources:i,refetchDestinations:l,refetchActions:s,refetchInstrumentationRules:r})]}),t(Ap,{...p}),t(Up,{restartWorkloads:p.restartWorkloads,persistSources:p.persistSources})]})};var sh;!function(e){e.Gateway="gateway",e.Node="node"}(sh||(sh={}));const rh=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:a,disabled:i})=>{const l=r(()=>{const e=[];return o&&e.push({id:Po(),type:Vt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Mi,size:ne.S,variant:ae.Text,onClick:o,disabled:i}}),n&&e.push({id:Po(),type:Vt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ne.S,variant:ae.Text,onClick:n,disabled:i,loading:a}}),e},[o,n,i,a]);return e(te,{$alignItems:"center",$justifyContent:"space-between",children:[t(Da,{icon:qi,title:"Collectors Pipeline"}),t(Ra,{actions:l})]})},ch=({pod:o,getExtendedPodInfo:a,onClose:i})=>{const{formatTimeAgo:s}=At(),[c,d]=l(null);n(()=>{o?a(o.namespace,o.name).then(e=>d(e??null)):d(null)},[o]);const u=r(()=>[{id:Po(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Po(),title:"Status",badge:{status:Fa(c?.status),label:c?.status??"-"}}],[c]),p=r(()=>c?.containers?.map(e=>({id:Po(),items:[{id:Po(),title:"Container",label:e.name??"-"},{id:Po(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Po(),title:"Ready",badge:{status:e.ready?ge.Success:ge.Error,leftIcon:e.ready?si:ri,label:e.ready?"True":"False",invertColors:!0}},{id:Po(),title:"Started",badge:{status:e.started?ge.Success:ge.Error,leftIcon:e.started?si:ri,label:e.started?"True":"False",invertColors:!0}},{id:Po(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Po(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Po(),title:Re.RESTARTS,label:e.restarts.toString()},{id:Po(),title:"State Reason",label:e.stateReason??"-"},{id:Po(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Po(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(ft,{isOpen:!!o,header:{icon:ki,title:"Pod Information",onClose:i},children:c?e(yt,{bgTint:"1000",richTitle:{icon:ki,title:c.name,withCopy:!0},children:[t(yt,{bgTint:"900",cellsPerRow:2,items:u}),e(yt,{bgTint:"900",richTitle:{icon:Hi,title:"Kubectl Commands"},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Xt,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(Xt,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(Xt,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(yt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:p.length?p.map(({id:e,items:o})=>t(yt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(se,{title:"No containers",subTitle:"Pod has no containers"})}),t(bl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Ke,{$height:"50vh",children:t(Qe,{withSpinner:!0})})})};var dh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(dh||(dh={}));const uh=[{key:dh.PodName,label:"Pod Name"},{key:dh.Status,label:"Status"},{key:dh.Restarts,label:Re.RESTARTS},{key:dh.NodeName,label:"Node Name"},{key:dh.Age,label:"Age"},{key:dh.DockerImage,label:"Collector Version"}],ph=({isLoading:o,tableRowsMaxHeight:n,pods:a,getExtendedPodInfo:i})=>{const s=f(),{formatTimeAgo:c}=At(),[d,u]=l(null),p=r(()=>a.map(o=>({onClick:()=>u(o),cells:[{key:dh.PodName,rawValue:o.name},{key:dh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ee,{status:Fa(e),label:e});var e}},{key:dh.Restarts,rawValue:o.restartsCount.toString()},{key:dh.NodeName,rawValue:o.nodeName},{key:dh.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(re,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?ge.Error:ge.Success,s=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),r=s>0?Math.round((n?.exporterFailedRps??0)/s*100):0,c=r>0?ge.Error:ge.Success;return e(te,{$gap:4,children:[t(we,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()}, Dropped: ${n.metricsDroppedRps.toLocaleString()}`,children:t(Ee,{status:l,label:`Receiver ${i}%`,leftIcon:l===ge.Error?Zi:Qi,useSecondaryTone:!0,invertColors:!0})}),t(we,{text:`Success: ${n.exporterSuccessRps.toLocaleString()}, Failed: ${n.exporterFailedRps.toLocaleString()}`,children:t(Ee,{status:c,label:`Exporter ${r}%`,leftIcon:c===ge.Error?Zi:Qi,useSecondaryTone:!0,invertColors:!0})})]})}},{key:dh.Age,rawValue:c(o.creationTimestamp)},{key:dh.DockerImage,rawValue:o.image}]})),[a,s]);return e(yt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:ki,title:"Pods"},children:[t(co,{variant:uo.Data,maxHeight:n,isLoading:o,columns:uh,rows:p}),t(ch,{pod:d,getExtendedPodInfo:i,onClose:()=>u(null)})]})},hh=({isOpen:e,onClose:o,title:n,yaml:a})=>t(ft,{isOpen:e,header:{icon:el,title:n,onClose:o},children:t(bl,{yaml:a,defaultOpen:!0})}),mh=e=>{switch(e){case Pa.Healthy:return"All desired replicas are updated, available, and ready";case Pa.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Pa.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Pa.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Pa.Down:return"No available replicas";case Pa.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var gh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(gh||(gh={}));const fh=g.div`
882
+ animation: ${Oh} 15s linear infinite;
883
+ `,Rh=[wi,xi,fi,bi],Ph=({columnsMaxHeight:o,metrics:n,refetchSources:a,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:r,updateDataStream:c,deleteDataStream:d,createDataStream:u,...p})=>{const h=f();return e(ua,{children:[e(Ye,{customTitle:t(Ah,{updateDataStream:c,deleteDataStream:d,createDataStream:u}),customSearch:t(Fp,{}),filters:t($p,{}),children:[t(Dh,{children:Rh.map((o,n)=>e(s,{children:[t(o,{size:24}),n<Rh.length-1&&t(mi,{fill:h.v2.colors.white[500]+qe["020"],size:24})]},o.name))}),t(ah,{height:o,metrics:n,refetchSources:a,refetchDestinations:i,refetchActions:l,refetchInstrumentationRules:r})]}),t(ih,{...p}),t(bh,{restartWorkloads:p.restartWorkloads,persistSources:p.persistSources})]})};var Fh;!function(e){e.Gateway="gateway",e.Node="node"}(Fh||(Fh={}));const Lh=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:i,disabled:l})=>{const r=a(()=>{const e=[];return o&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Download Diagnose",leftIcon:Bi,size:ae.S,variant:ie.Text,onClick:o,disabled:l}}),n&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:n,disabled:l,loading:i}}),e},[o,n,l,i]);return e(oe,{$alignItems:"center",$justifyContent:"space-between",children:[t(Pa,{icon:Zi,title:"Collectors Pipeline"}),t(Fa,{actions:r})]})},_h=({pod:o,getExtendedPodInfo:i,onClose:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null);n(()=>{o?i(o.namespace,o.name).then(e=>d(e??null)):d(null)},[o]);const u=a(()=>[{id:Bo(),title:"Node",label:c?.node??"-",withCopy:!0},{id:Bo(),title:"Status",badge:{status:La(c?.status),label:c?.status??"-"}}],[c]),p=a(()=>c?.containers?.map(e=>({id:Bo(),items:[{id:Bo(),title:"Container",label:e.name??"-"},{id:Bo(),title:"Status",label:e.startedAt?`${e.status} (since ${s(e.startedAt)})`:e.status},{id:Bo(),title:"Ready",badge:{status:e.ready?we.Success:we.Error,leftIcon:e.ready?si:ci,label:e.ready?"True":"False",invertColors:!0}},{id:Bo(),title:"Started",badge:{status:e.started?we.Success:we.Error,leftIcon:e.started?si:ci,label:e.started?"True":"False",invertColors:!0}},{id:Bo(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:Bo(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:Bo(),title:Me.RESTARTS,label:e.restarts.toString()},{id:Bo(),title:"State Reason",label:e.stateReason??"-"},{id:Bo(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:Bo(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[c]);return t(q,{isOpen:!!o,header:{icon:$i,title:"Pod Information",onClose:l},children:c?e(xt,{bgTint:"1000",richTitle:{icon:$i,title:c.name,withCopy:!0},children:[t(xt,{bgTint:"900",cellsPerRow:2,items:u}),e(xt,{bgTint:"900",richTitle:{icon:Gi,title:"Kubectl Commands"},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(Gt,{value:`kubectl get pod ${c.name} -n ${c.namespace} -o yaml`}),t(Gt,{value:`kubectl describe pod ${c.name} -n ${c.namespace}`}),t(Gt,{value:`kubectl logs ${c.name} -n ${c.namespace}`})]}),t(xt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:p.length?p.map(({id:e,items:o})=>t(xt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(me,{title:"No containers",subTitle:"Pod has no containers"})}),t(vl,{bgTint:"900",yaml:c.manifestYAML,defaultOpen:!0})]}):t(Qe,{$height:"50vh",children:t(at,{withSpinner:!0})})})};var zh;!function(e){e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropDrate="spanDropDrate",e.Age="age",e.DockerImage="dockerImage"}(zh||(zh={}));const Mh=[{key:zh.PodName,label:"Pod Name"},{key:zh.Status,label:"Status"},{key:zh.Restarts,label:Me.RESTARTS},{key:zh.NodeName,label:"Node Name"},{key:zh.Age,label:"Age"},{key:zh.DockerImage,label:"Collector Version"}],Bh=({isLoading:o,tableRowsMaxHeight:n,pods:i,getExtendedPodInfo:l})=>{const s=f(),{formatTimeAgo:c}=Lt(),[d,u]=r(null),p=a(()=>i.map(o=>({onClick:()=>u(o),cells:[{key:zh.PodName,rawValue:o.name},{key:zh.Status,rawValue:o.status,component:()=>{return e=o.status,t(Fe,{status:La(e),label:e});var e}},{key:zh.Restarts,rawValue:o.restartsCount.toString()},{key:zh.NodeName,rawValue:o.nodeName},{key:zh.SpanDropDrate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(Q,{children:"-"});const a=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),i=a>0?Math.round((n?.metricsDroppedRps??0)/a*100):0,l=i>0?we.Error:we.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?we.Error:we.Success;return e(oe,{$gap:4,children:[t(Ie,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()}, Dropped: ${n.metricsDroppedRps.toLocaleString()}`,children:t(Fe,{status:l,label:`Receiver ${i}%`,leftIcon:l===we.Error?Qi:el,useSecondaryTone:!0,invertColors:!0})}),t(Ie,{text:`Success: ${n.exporterSuccessRps.toLocaleString()}, Failed: ${n.exporterFailedRps.toLocaleString()}`,children:t(Fe,{status:c,label:`Exporter ${s}%`,leftIcon:c===we.Error?Qi:el,useSecondaryTone:!0,invertColors:!0})})]})}},{key:zh.Age,rawValue:c(o.creationTimestamp)},{key:zh.DockerImage,rawValue:o.image}]})),[i,s]);return e(xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:$i,title:"Pods"},children:[t(mo,{variant:fo.Data,maxHeight:n,isLoading:o,columns:Mh,rows:p}),t(_h,{pod:d,getExtendedPodInfo:l,onClose:()=>u(null)})]})},Xh=({isOpen:e,onClose:o,title:n,yaml:a})=>t(q,{isOpen:e,header:{icon:tl,title:n,onClose:o},children:t(vl,{yaml:a,defaultOpen:!0})}),Vh=e=>{switch(e){case _a.Healthy:return"All desired replicas are updated, available, and ready";case _a.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case _a.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case _a.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case _a.Down:return"No available replicas";case _a.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Uh;!function(e){e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"}(Uh||(Uh={}));const Hh=m.div`
773
884
  flex: 0.5;
774
885
  padding: 12px;
775
886
  border-radius: 12px;
776
887
  background-color: ${({theme:e})=>e.v2.colors.silver[800]};
777
- `,bh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:a,isLoading:i})=>{const{formatTimeAgo:s}=At(),[c,d]=l(null),u=r(()=>(e=>{switch(e){case sh.Gateway:return"Deployment";case sh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=r(()=>((e,t,o,n)=>{const a={status:st.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case sh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case sh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:ge.Info,label:"Rollout in progress",rightIcon:Ni,useSecondaryTone:!0}:l?{status:st.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,a,s),[n,a,o,s]),h=r(()=>((e,t,o,n)=>{let a=n?ge.Info:st.Unknown,i=n?"Loading":Pa.Unknown,l=n?"Fetching data...":mh(Pa.Unknown);switch(e){case sh.Gateway:a=t?.status?Fa(t?.status):a,i=t?.status??i,l=t?.status?mh(t.status):l;break;case sh.Node:a=o?.status?Fa(o?.status):a,i=o?.status??i,l=o?.status?mh(o.status):l}return{status:a,title:i,description:l}})(o,n,a,i),[n,a,o,i]),m=r(()=>((e,t,o)=>{switch(e){case sh.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 sh.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=r(()=>((e,t,o,n)=>{switch(e){case sh.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 sh.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,i),[n,a,o,i]),f=r(()=>(o===sh.Gateway?n?.manifestYAML:a?.manifestYAML)??"",[n,a,o]),b=r(()=>(o===sh.Gateway?n?.configMapYAML:a?.configMapYAML)??"",[n,a,o]);return e(yt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:el,title:u,badge:p},actions:[{id:Po(),type:Vt.ButtonDropData,buttonProps:{variant:ae.Secondary,size:ne.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:gh.ManifestYaml,label:u,icon:tl},{id:gh.ConfigMapYaml,label:"ConfigMap",icon:tl}]}}],children:[e(te,{$gap:16,children:[t("div",{children:t(La,{...h})}),m.map(e=>t(fh,{children:t("div",{children:t(_a,{...e})})},e.title)),g.map(e=>t(Ma,{...e},e.title))]}),t(hh,{isOpen:c===gh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(hh,{isOpen:c===gh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},vh=[{value:sh.Gateway,label:"Gateway"},{value:sh.Node,label:"Node Collector"}],yh=({minSupportedVersion:o=0,tableRowsMaxHeight:a,getGatewayInfo:i,getGatewayPods:s,getNodeCollectorInfo:d,getNodeCollectorPods:u,getExtendedPodInfo:p})=>{const{isVersionSupported:h,version:m}=y(o),[g,f]=l(!1),[b,v]=l(sh.Gateway),[C,S]=l(null),[w,x]=l([]),[k,T]=l(null),[$,N]=l([]),I=c(async()=>{f(!0);try{switch(b){case sh.Gateway:S(await i()??null),x(await s()??[]);break;case sh.Node:T(await d()??null),N(await u()??[])}}catch(e){}f(!1)},[b]);n(()=>{I()},[I]);const E=r(()=>b===sh.Gateway?w:$,[w,$,b]);return e(ra,{children:[t(rh,{disabled:!h,loading:g,onClickDownloadDiagnose:void 0,onClickRefresh:I}),e(Ba,{children:[e(V,{children:[t(ue,{variant:so.Underline,size:za.L,options:vh,selected:b,setSelected:v}),t(bh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:k,isLoading:g})]}),t(ph,{isLoading:g,tableRowsMaxHeight:a,pods:E,getExtendedPodInfo:p}),!h&&t(Cl,{minSupportedVersion:o,currentVersion:m||""})]})]})},Ch=g.div`
888
+ `,jh=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:i,isLoading:l})=>{const{formatTimeAgo:s}=Lt(),[c,d]=r(null),u=a(()=>(e=>{switch(e){case Fh.Gateway:return"Deployment";case Fh.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=a(()=>((e,t,o,n)=>{const a={status:pt.Disabled,label:"No rollouts yet"};let i=!1,l=null;switch(e){case Fh.Gateway:i=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case Fh.Node:i=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return a}return i?{status:we.Info,label:"Rollout in progress",rightIcon:Ni,useSecondaryTone:!0}:l?{status:pt.Disabled,label:`Last Rollout: ${n(l)}`}:a})(o,n,i,s),[n,i,o,s]),h=a(()=>((e,t,o,n)=>{let a=n?we.Info:pt.Unknown,i=n?"Loading":_a.Unknown,l=n?"Fetching data...":Vh(_a.Unknown);switch(e){case Fh.Gateway:a=t?.status?La(t?.status):a,i=t?.status??i,l=t?.status?Vh(t.status):l;break;case Fh.Node:a=o?.status?La(o?.status):a,i=o?.status??i,l=o?.status?Vh(o.status):l}return{status:a,title:i,description:l}})(o,n,i,l),[n,i,o,l]),g=a(()=>((e,t,o)=>{switch(e){case Fh.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case Fh.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,i),[n,i,o]),m=a(()=>((e,t,o,n)=>{switch(e){case Fh.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case Fh.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,i,l),[n,i,o,l]),f=a(()=>(o===Fh.Gateway?n?.manifestYAML:i?.manifestYAML)??"",[n,i,o]),b=a(()=>(o===Fh.Gateway?n?.configMapYAML:i?.configMapYAML)??"",[n,i,o]);return e(xt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:tl,title:u,badge:p},actions:[{id:Bo(),type:Wt.ButtonDropData,buttonProps:{variant:ie.Secondary,size:ae.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Uh.ManifestYaml,label:u,icon:ol},{id:Uh.ConfigMapYaml,label:"ConfigMap",icon:ol}]}}],children:[e(oe,{$gap:16,children:[t("div",{children:t(za,{...h})}),g.map(e=>t(Hh,{children:t("div",{children:t(Ma,{...e})})},e.title)),m.map(e=>t(Ba,{...e},e.title))]}),t(Xh,{isOpen:c===Uh.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(Xh,{isOpen:c===Uh.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Gh=[{value:Fh.Gateway,label:"Gateway"},{value:Fh.Node,label:"Node Collector"}],Wh=({minSupportedVersion:o=0,tableRowsMaxHeight:i,getGatewayInfo:s,getGatewayPods:c,getNodeCollectorInfo:d,getNodeCollectorPods:u,getExtendedPodInfo:p})=>{const{isVersionSupported:h,version:g}=y(o),[m,f]=r(!1),[b,v]=r(Fh.Gateway),[C,S]=r(null),[w,x]=r([]),[k,T]=r(null),[$,E]=r([]),I=l(async()=>{f(!0);try{switch(b){case Fh.Gateway:S(await s()??null),x(await c()??[]);break;case Fh.Node:T(await d()??null),E(await u()??[])}}catch(e){}f(!1)},[b]);n(()=>{I()},[I]);const N=a(()=>b===Fh.Gateway?w:$,[w,$,b]);return e(ua,{children:[t(Lh,{disabled:!h,loading:m,onClickDownloadDiagnose:void 0,onClickRefresh:I}),e(Xa,{children:[e(V,{children:[t(le,{variant:ho.Underline,size:be.L,options:Gh,selected:b,setSelected:v}),t(jh,{selectedTab:b,gatewayInfo:C,nodeCollectorInfo:k,isLoading:m})]}),t(Bh,{isLoading:m,tableRowsMaxHeight:i,pods:N,getExtendedPodInfo:p}),!h&&t(Sl,{minSupportedVersion:o,currentVersion:g||""})]})]})},Kh=m.div`
778
889
  display: inline-flex;
779
890
  align-items: center;
780
891
  min-width: 0;
781
892
  overflow: hidden;
782
893
  white-space: pre;
783
894
  text-overflow: ellipsis;
784
- `,Sh=g.div`
895
+ `,Yh=m.div`
785
896
  display: flex;
786
897
  flex-direction: column;
787
898
  gap: 4px;
788
899
  min-width: 0;
789
900
  flex: 1;
790
901
  opacity: ${({$disabled:e})=>e?.4:1};
791
- `,wh=g(te)`
902
+ `,Jh=m(oe)`
792
903
  flex-shrink: 0;
793
904
  gap: 6px;
794
905
  align-items: center;
795
906
  min-height: 22px;
796
- `;const xh=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],kh=[{value:"all",label:Va},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Th=({title:o,items:n,isLoading:a,showTypeFilter:i,tableRowsMaxHeight:s,onRuleClick:d,onCreateRule:u,onEditRule:p,onDeleteRule:h})=>{const m=f(),[g,b]=l(""),[v,y]=l("all"),C=r(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,v,i);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,g),e},[n,v,i,g]),w=r(()=>C.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(m,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(Sh,{$disabled:o.disabled,children:[t(Ch,{children:t(S,{parts:o.summary})}),o.name&&t(re,{size:ce.XXS,color:Ce.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(wh,{children:[o.disabled&&t(Ee,{label:Xa,textSize:ce.XXXS,backgroundColor:m.v2.colors.grey[700],textColor:m.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ee,{label:o.typeBadge,textSize:ce.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>d(o)}}),[C,m,d]),x=r(()=>{const e=e=>t(ci,{...e,fill:m.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[m]),k=c(e=>{const t=w.indexOf(e);if(t<0)return[];const o=C[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:go,leftIcon:di,onClick:()=>p(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:x,onClick:()=>h(o.ruleId,o.samplingId)}]:[]},[w,C,p,h,x]);return t(Ue,{fullHeight:!0,richTitle:{icon:zi,title:o,badge:{label:n.length,backgroundColor:m.v2.colors.silver[600],textColor:m.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:g,onChange:b,placeholder:"Search..",width:"500px",...i?{segment:{"data-id":"sampling-segment-type-filter",options:kh,selected:v,setSelected:y}}:{}},children:t(co,{variant:uo.Pretty,hideHeader:!0,maxHeight:s,isLoading:a,noDataProps:g.trim()?{hideIcon:!0,title:Ua,subTitle:Wa(g)}:{hideIcon:!0,title:ja,button:{label:Ha,onClick:u}},columns:xh,rows:w,getRowActions:k})})},$h=({workloads:o,samplingRules:a,k8sHealthProbesConfig:i,loading:s,docsUrl:u,tableRowsMaxHeight:p,fetchSamplingRules:h,createNoisyOperationRule:m,updateNoisyOperationRule:g,createHighlyRelevantOperationRule:f,updateHighlyRelevantOperationRule:b,createCostReductionRule:v,updateCostReductionRule:y,deleteSamplingRule:C,updateK8sHealthProbesConfig:S})=>{const k=r(()=>o.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[o]),X=r(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[U,H]=l(T.Noisy),[j,W]=l(null),[G,K]=l(!1),[Y,J]=l(!1),[q,Z]=l(null),[Q,ee]=l(!1),[ie,le]=l(!1),[se,re]=l(!1),[ce,de]=l(!1),pe=d(!1);n(()=>{pe.current||s||(pe.current=!0,0===a.length&&de(!0))},[s,a]);const he=r(()=>w(i),[i]),fe=r(()=>$(a),[a]),be=r(()=>x(fe?.rule??null),[fe]),ve=r(()=>N(a),[a]),ye=r(()=>I(ve?.rule??null),[ve]),Ce=d(j);Ce.current=j,n(()=>{const e=Ce.current;if(!e)return;const t=E(a,e);t?W(t):(W(null),K(!1))},[a]);const Se=r(()=>{const e=new Set;return fe&&e.add(fe.rule.ruleId),ve&&e.add(ve.rule.ruleId),e},[fe,ve]),we=r(()=>O(a,U,Se),[a,U,Se]),xe=c(()=>J(!0),[]),ke=c(()=>J(!1),[]),Te=c(()=>de(!1),[]),$e=c(async e=>{const t=a[0]?.id??"default";switch(L[U]){case"noisy":await m(t,R(e));break;case"highlyRelevant":await f(t,D(e));break;case"costReduction":await v(t,A(e))}J(!1)},[a,U,m,f,v]),Ne=c(e=>{const t=F(a,e);t&&(K(!1),W(t))},[a]),Ie=c(()=>{W(null),K(!1)},[]),Ee=c((e,t)=>{const o=j;if(o&&o.rule.ruleId===e&&o.samplingId===t)K(!0),W({...o});else for(const o of a){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return K(!0),void W({category:n.category,rule:n.rule,samplingId:t,summary:P(n.category,n.rule)})}},[j,a]),Oe=c(async(e,t,o)=>{const n=j?.category;if(n){switch(n){case"noisy":await g(o,t,R(e));break;case"highlyRelevant":await b(o,t,D(e));break;case"costReduction":await y(o,t,A(e))}K(!1)}},[j,g,b,y]),Ae=c((e,t)=>{Z({ruleId:e,samplingId:t})},[]),Re=c(async()=>{if(!q)return;const{ruleId:e,samplingId:t}=q,o=j?.category||L[U];await C(t,e,o),W(null),K(!1),Z(null)},[q,j,U,C]),Fe=c(()=>Z(null),[]),Le=c(async(e,t)=>{await S(e,t),ee(!1)},[S]),_e=c(async e=>{const t=a[0]?.id??"default",o=fe;o?await b(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await f(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[a,fe,f,b]),Be=c(async(e,t)=>{const o=a[0]?.id??"default",n=ve;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await v(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),re(!1)},[a,ve,v,y]),Xe=c(e=>{const t=L[U];let o=null;switch(t){case"noisy":{const n=R(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=D(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=A(e);o=_(a,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Ga,ruleId:o}:null},[a,U]),Ve=c(e=>{const t=j?.category,o=j?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=R(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=D(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=A(e);n=_(a,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:Ga,ruleId:n}:null},[a,j]),Ue=c(e=>{J(!1);for(const t of a){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return K(!0),void W({category:o.category,rule:o.rule,samplingId:t.id,summary:P(o.category,o.rule)})}},[a]),He=r(()=>{const e=[];return u&&e.push({id:Po(),type:Vt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ka,leftIcon:li,size:ne.S,variant:ae.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Po(),type:Vt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ya,leftIcon:Ni,size:ne.S,variant:ae.Text,onClick:h,loading:s}}),e.push({id:Po(),type:Vt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:Ja,rightIcon:ii,size:ne.S,variant:ae.Primary,onClick:xe}}),e},[u,h,s,xe]);return e(ra,{children:[e(te,{$gap:12,$justifyContent:"space-between",children:[t(Da,{icon:zi,title:Za,subTitle:qa}),t(Ra,{actions:He})]}),e(V,{$gap:12,children:[t(ue,{variant:so.Underline,size:za.L,options:M,selected:U,setSelected:H}),e(te,{$justifyContent:"space-between",children:[t(me,{status:ge.Default,message:B[U]}),u&&t(oe,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:li,size:ne.S,variant:ae.Text,onClick:()=>window.open(u,"_blank")})]}),U===T.Noisy?t(al,{title:ze,summary:he,onEdit:()=>ee(!0)}):U===T.HighlyRelevant?t(al,{title:Pe,summary:be,onEdit:()=>le(!0)}):U===T.CostReduction?t(al,{title:Me,summary:ye,onEdit:()=>re(!0)}):null,t(Th,{title:z[U],items:we,isLoading:s,showTypeFilter:U===T.HighlyRelevant,tableRowsMaxHeight:p,onRuleClick:Ne,onCreateRule:xe,onEditRule:Ee,onDeleteRule:Ae})]}),t(md,{formType:Nl.View,data:j,defaultEditMode:G,onClose:Ie,onDelete:Ae,onSaveEdit:Oe,sourceOptions:k,namespaceOptions:X,validateForm:Ve,onNavigateToDuplicate:Ue}),t(md,{formType:Nl.Create,isOpen:Y,category:L[U],onClose:ke,onSubmit:$e,sourceOptions:k,namespaceOptions:X,validateForm:Xe,onNavigateToDuplicate:Ue}),t(md,{formType:Nl.EditAutoNoisy,isOpen:Q,enabled:i?.enabled??!1,keepPercentage:i?.keepPercentage??0,onClose:()=>ee(!1),onSave:Le}),t(md,{formType:Nl.EditAutoHighlyRelevant,isOpen:ie,enabled:!!fe&&!fe.rule.disabled,onClose:()=>le(!1),onSave:_e}),t(md,{formType:Nl.EditAutoCostReduction,isOpen:se,enabled:!!ve&&!ve.rule.disabled,dropPercentage:ve?.rule.percentageAtMost??25,onClose:()=>re(!1),onSave:Be}),t(De,{title:oi,description:ti,isOpen:!!q,onClose:Fe,denyButton:{label:ei,variant:ae.Secondary,onClick:Fe},approveButton:{label:Qa,variant:ae.Primary,onClick:()=>{Re(),Fe()}}}),t(xu,{isOpen:ce,onClose:Te,k8sHealthProbesConfig:i,samplingId:a[0]?.id,docsUrl:u,updateK8sHealthProbesConfig:S,createHighlyRelevantOperationRule:f,createCostReductionRule:v})]})},Nh=g.div`
907
+ `;const qh=[{key:"content",label:"Content",noSort:!0,noFilter:!0},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],Zh=[{value:"all",label:Ua},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Qh=({title:o,items:n,isLoading:i,showTypeFilter:s,tableRowsMaxHeight:c,onRuleClick:d,onCreateRule:u,onEditRule:p,onDeleteRule:h})=>{const g=f(),[m,b]=r(""),[v,y]=r("all"),C=a(()=>{let e=function(e,t,o){return o&&"all"!==t?e.filter(e=>e.typeBadge===t):e}(n,v,s);return e=function(e,t){if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})}(e,m),e},[n,v,s,m]),w=a(()=>C.map(o=>{const n=o.typeBadge?function(e,t){const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}}(g,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(Yh,{$disabled:o.disabled,children:[t(Kh,{children:t(S,{parts:o.summary})}),o.name&&t(Q,{size:te.XXS,color:ee.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(Jh,{children:[o.disabled&&t(Fe,{label:Va,textSize:te.XXXS,backgroundColor:g.v2.colors.grey[700],textColor:g.v2.colors.grey[300]}),o.typeBadge&&n&&t(Fe,{label:o.typeBadge,textSize:te.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>d(o)}}),[C,g,d]),x=a(()=>{const e=e=>t(ui,{...e,fill:g.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[g]),k=l(e=>{const t=w.indexOf(e);if(t<0)return[];const o=C[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:Co,leftIcon:pi,onClick:()=>p(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:x,onClick:()=>h(o.ruleId,o.samplingId)}]:[]},[w,C,p,h,x]);return t(Ye,{fullHeight:!0,richTitle:{icon:Vi,title:o,badge:{label:n.length,backgroundColor:g.v2.colors.silver[600],textColor:g.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:b,placeholder:"Search..",width:"500px",...s?{segment:{"data-id":"sampling-segment-type-filter",options:Zh,selected:v,setSelected:y}}:{}},children:t(mo,{variant:fo.Pretty,hideHeader:!0,maxHeight:c,isLoading:i,noDataProps:m.trim()?{hideIcon:!0,title:Ha,subTitle:Wa(m)}:{hideIcon:!0,title:Ga,button:{label:ja,onClick:u}},columns:qh,rows:w,getRowActions:k})})},eg=({workloads:o,samplingRules:s,k8sHealthProbesConfig:c,loading:d,docsUrl:u,tableRowsMaxHeight:p,fetchSamplingRules:h,createNoisyOperationRule:g,updateNoisyOperationRule:m,createHighlyRelevantOperationRule:f,updateHighlyRelevantOperationRule:b,createCostReductionRule:v,updateCostReductionRule:y,deleteSamplingRule:C,updateK8sHealthProbesConfig:S})=>{const k=a(()=>o.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:`${e.namespace} / ${e.kind} / ${e.name}`})),[o]),X=a(()=>Array.from(new Set(o.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[o]),[U,H]=r(T.Noisy),[j,G]=r(null),[W,K]=r(!1),[Y,J]=r(!1),[q,Z]=r(null),[Q,ee]=r(!1),[te,re]=r(!1),[se,ce]=r(!1),[de,ue]=r(!1),pe=i(!1);n(()=>{pe.current||d||(pe.current=!0,0===s.length&&ue(!0))},[d,s]);const he=a(()=>w(c),[c]),ge=a(()=>$(s),[s]),me=a(()=>x(ge?.rule??null),[ge]),fe=a(()=>E(s),[s]),ve=a(()=>I(fe?.rule??null),[fe]),ye=i(j);ye.current=j,n(()=>{const e=ye.current;if(!e)return;const t=N(s,e);t?G(t):(G(null),K(!1))},[s]);const Ce=a(()=>{const e=new Set;return ge&&e.add(ge.rule.ruleId),fe&&e.add(fe.rule.ruleId),e},[ge,fe]),xe=a(()=>A(s,U,Ce),[s,U,Ce]),ke=l(()=>J(!0),[]),Te=l(()=>J(!1),[]),$e=l(()=>ue(!1),[]),Ee=l(async e=>{const t=s[0]?.id??"default";switch(L[U]){case"noisy":await g(t,R(e));break;case"highlyRelevant":await f(t,D(e));break;case"costReduction":await v(t,O(e))}J(!1)},[s,U,g,f,v]),Ie=l(e=>{const t=P(s,e);t&&(K(!1),G(t))},[s]),Ne=l(()=>{G(null),K(!1)},[]),Ae=l((e,t)=>{const o=j;if(o&&o.rule.ruleId===e&&o.samplingId===t)K(!0),G({...o});else for(const o of s){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return K(!0),void G({category:n.category,rule:n.rule,samplingId:t,summary:F(n.category,n.rule)})}},[j,s]),Oe=l(async(e,t,o)=>{const n=j?.category;if(n){switch(n){case"noisy":await m(o,t,R(e));break;case"highlyRelevant":await b(o,t,D(e));break;case"costReduction":await y(o,t,O(e))}K(!1)}},[j,m,b,y]),De=l((e,t)=>{Z({ruleId:e,samplingId:t})},[]),Re=l(async()=>{if(!q)return;const{ruleId:e,samplingId:t}=q,o=j?.category||L[U];await C(t,e,o),G(null),K(!1),Z(null)},[q,j,U,C]),Pe=l(()=>Z(null),[]),Fe=l(async(e,t)=>{await S(e,t),ee(!1)},[S]),Le=l(async e=>{const t=s[0]?.id??"default",o=ge;o?await b(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await f(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),re(!1)},[s,ge,f,b]),_e=l(async(e,t)=>{const o=s[0]?.id??"default",n=fe;n?await y(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await v(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),ce(!1)},[s,fe,v,y]),Me=l(e=>{const t=L[U];let o=null;switch(t){case"noisy":{const n=R(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=D(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=O(e);o=_(s,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:Ka,ruleId:o}:null},[s,U]),Be=l(e=>{const t=j?.category,o=j?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const a=R(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}case"highlyRelevant":{const a=D(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation,error:a.error??!1,durationAtLeastMs:a.durationAtLeastMs},o);break}case"costReduction":{const a=O(e);n=_(s,t,{sourceScopes:a.sourceScopes,operation:a.operation},o);break}}return n?{message:Ka,ruleId:n}:null},[s,j]),Ve=l(e=>{J(!1);for(const t of s){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return K(!0),void G({category:o.category,rule:o.rule,samplingId:t.id,summary:F(o.category,o.rule)})}},[s]),Ue=a(()=>{const e=[];return u&&e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-docs",label:Ya,leftIcon:di,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")}}),e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:Ja,leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:h,loading:d}}),e.push({id:Bo(),type:Wt.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:qa,rightIcon:li,size:ae.S,variant:ie.Primary,onClick:ke}}),e},[u,h,d,ke]);return e(ua,{children:[e(oe,{$gap:12,$justifyContent:"space-between",children:[t(Pa,{icon:Vi,title:Qa,subTitle:Za}),t(Fa,{actions:Ue})]}),e(V,{$gap:12,children:[t(le,{variant:ho.Underline,size:be.L,options:z,selected:U,setSelected:H}),e(oe,{$justifyContent:"space-between",children:[t(Se,{status:we.Default,message:M[U]}),u&&t(ne,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:di,size:ae.S,variant:ie.Text,onClick:()=>window.open(u,"_blank")})]}),U===T.Noisy?t(il,{title:Ge,summary:he,onEdit:()=>ee(!0)}):U===T.HighlyRelevant?t(il,{title:Xe,summary:me,onEdit:()=>re(!0)}):U===T.CostReduction?t(il,{title:He,summary:ve,onEdit:()=>ce(!0)}):null,t(Qh,{title:B[U],items:xe,isLoading:d,showTypeFilter:U===T.HighlyRelevant,tableRowsMaxHeight:p,onRuleClick:Ie,onCreateRule:ke,onEditRule:Ae,onDeleteRule:De})]}),t(Vd,{formType:Il.View,data:j,defaultEditMode:W,onClose:Ne,onDelete:De,onSaveEdit:Oe,sourceOptions:k,namespaceOptions:X,validateForm:Be,onNavigateToDuplicate:Ve}),t(Vd,{formType:Il.Create,isOpen:Y,category:L[U],onClose:Te,onSubmit:Ee,sourceOptions:k,namespaceOptions:X,validateForm:Me,onNavigateToDuplicate:Ve}),t(Vd,{formType:Il.EditAutoNoisy,isOpen:Q,enabled:c?.enabled??!1,keepPercentage:c?.keepPercentage??0,onClose:()=>ee(!1),onSave:Fe}),t(Vd,{formType:Il.EditAutoHighlyRelevant,isOpen:te,enabled:!!ge&&!ge.rule.disabled,onClose:()=>re(!1),onSave:Le}),t(Vd,{formType:Il.EditAutoCostReduction,isOpen:se,enabled:!!fe&&!fe.rule.disabled,dropPercentage:fe?.rule.percentageAtMost??25,onClose:()=>ce(!1),onSave:_e}),t(ze,{title:ni,description:oi,isOpen:!!q,onClose:Pe,denyButton:{label:ti,variant:ie.Secondary,onClick:Pe},approveButton:{label:ei,variant:ie.Primary,onClick:()=>{Re(),Pe()}}}),t(qu,{isOpen:de,onClose:$e,k8sHealthProbesConfig:c,samplingId:s[0]?.id,docsUrl:u,updateK8sHealthProbesConfig:S,createHighlyRelevantOperationRule:f,createCostReductionRule:v})]})},tg=m.div`
797
908
  display: flex;
798
909
  align-items: center;
799
910
  justify-content: space-between;
800
911
  padding: 0 12px;
801
- `,Ih=({disabled:o,loading:n,tabs:a,selectedTab:i,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=l(!1),h=r(()=>{const e=[];return c&&e.push({id:Po(),type:Vt.Button,buttonProps:{label:"Reset",leftIcon:ai,size:ne.S,variant:ae.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Po(),type:Vt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ne.S,variant:ae.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(Nh,{children:[e(te,{$gap:12,$alignItems:"center",children:[t(Da,{icon:xi,title:"Odigos Settings"}),t(Je,{width:"350px",options:a,values:[i],setValues:e=>s(e[0]),disabled:o})]}),t(Ra,{actions:h}),t(De,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:ae.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:ae.Primary,onClick:()=>{c?.(),p(!1)}}})]})},Eh=g(te)`
912
+ `,og=({disabled:o,loading:n,tabs:i,selectedTab:l,setSelectedTab:s,onClickReset:c,onClickRefresh:d})=>{const[u,p]=r(!1),h=a(()=>{const e=[];return c&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Reset",leftIcon:ii,size:ae.S,variant:ie.Text,onClick:()=>p(!0),disabled:o}}),d&&e.push({id:Bo(),type:Wt.Button,buttonProps:{label:"Refresh",leftIcon:Ni,size:ae.S,variant:ie.Text,onClick:d,disabled:o,loading:n}}),e},[o,n,d]);return e(tg,{children:[e(oe,{$gap:12,$alignItems:"center",children:[t(Pa,{icon:Ti,title:"Odigos Settings"}),t(tt,{width:"350px",options:i,values:[l],setValues:e=>s(e[0]),disabled:o})]}),t(Fa,{actions:h}),t(ze,{isOpen:u,onClose:()=>p(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:ie.Secondary,onClick:()=>p(!1)},approveButton:{label:"Approve",variant:ie.Primary,onClick:()=>{c?.(),p(!1)}}})]})},ng=m(oe)`
802
913
  flex: 1;
803
914
  min-height: 0;
804
915
  width: 100%;
805
916
  align-self: stretch;
806
- `,Oh=g(V)`
917
+ `,ag=m(V)`
807
918
  flex: 1;
808
919
  min-height: 0;
809
920
  height: 100%;
810
921
  overflow-y: auto;
811
- `,Ah=e=>"general"===e.name?0:"advanced"===e.name?2:1,Dh=({minSupportedVersion:o=0,pageHeightOffset:a=0,configYamls:i,configYamlsLoading:s,effectiveConfig:c,effectiveConfigLoading:d,refetch:u,factoryReset:p,onSave:h,saveLoading:m})=>{const{isVersionSupported:g,version:f,isEnterprise:b}=y(o),v=r(()=>{if(!c)return{};const{manifestYAML:e,provenance:t,...o}=c;return o},[c]),{formData:C,handleFormChange:S,getNestedValue:w,getFormDiff:x,isFormDirty:k}=wt(v);n(()=>{"{}"!==JSON.stringify(v)&&"{}"===JSON.stringify(C)&&S(void 0,void 0,v)},[v,C]);const T=r(()=>[...i].sort((e,t)=>Ah(e)-Ah(t)),[i]),$=r(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(c?.provenance),[c?.provenance]),N=r(()=>{const e=new Set;for(const t of i)for(const o of t.fields)o.componentType===ie.Dropdown&&e.add(o.helmValuePath);return e},[i]),I=r(()=>i.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:w("formData",e.helmValuePath)}))),[i,C,w]),[E,O]=l(!1),A=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(x(v,C),N);await(h?.(e)),S(void 0,void 0,{})},D=r(()=>[{id:Po(),type:Vt.Button,buttonProps:{"data-id":"settings-save",variant:ae.Primary,size:ne.S,label:"Save Changes",leftIcon:vi,loading:m,onClick:()=>O(!0)}},{id:Po(),type:Vt.Button,buttonProps:{"data-id":"settings-cancel",variant:ae.Secondary,size:ne.S,label:"Cancel",leftIcon:yi,onClick:()=>S(void 0,void 0,v)}}],[m,x,v,C,S]),R=r(()=>T.map(e=>({id:e.name,label:e.displayName})),[T]),F=r(()=>T.map(e=>e.name),[T]),{selectedSection:P,setSelectedSection:L,setSectionRef:_,setScrollContainerRef:M}=ni({sectionNames:F});return e(ra,{$heightOffset:a,$gap:12,children:[t(Ih,{disabled:!g,loading:s||d,tabs:R,selectedTab:P,setSelectedTab:L,onClickReset:p?()=>p().then(()=>u?.()):void 0,onClickRefresh:u?()=>u():void 0}),e(Ba,{children:[!g&&t(Cl,{minSupportedVersion:o,currentVersion:f||""}),t(ca,{isOpen:k,richTitle:{icon:xi,title:"Config Settings"},actions:D}),t(De,{isOpen:E,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>O(!1),denyButton:{label:"Keep editing",variant:ae.Secondary,onClick:()=>O(!1)},approveButton:{label:"Save changes",variant:ae.Primary,onClick:()=>{A(),O(!1)}}}),e(Eh,{$gap:24,$alignItems:"stretch",children:[t(Oh,{ref:M,$gap:24,$width:"100%",children:i.length?T.map(o=>t(Ue,{id:o.name,ref:e=>_(o.name,e),richTitle:{icon:xi,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!b)return null;if(o.renderCondition&&!he(o.renderCondition,[],I))return null;const n=nt(o.componentProps||"{}",{}),a=$[o.helmValuePath];return e(V,{$gap:4,children:[t(nl,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?ge.Warning:st.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||m,value:w("formData",o.helmValuePath),setValue:e=>S(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(me,{status:ge.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):s?t(Ke,{$height:"30vh",children:t(Qe,{withSpinner:!0})}):t(Ue,{richTitle:{icon:xi,title:"Config Settings"},children:t(se,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(Oh,{children:d&&!c?.manifestYAML?t(Ke,{$height:"30vh",children:t(Qe,{withSpinner:!0})}):t(bl,{title:"Effective Config YAML",yaml:c?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})]})};export{Ns as AddActionDrawer,Ql as AddActionForm,kd as AddDataStreamModal,_s as AddDestinationDrawer,os as AddDestinationForm,Ms as AddRuleDrawer,ds as AddRuleForm,ar as AddSourceDrawer,Eu as CentralConnections,ps as DataStreamForm,us as DataStreamMergeWarning,ir as EditActionDrawer,lr as EditConfigDrawer,Td as EditDataStreamModal,sr as EditDestinationDrawer,rr as EditRuleDrawer,td as EditSourceDrawer,hs as EditSourceForm,Id as ONBOARDING_DONE_MODAL_ID,Uu as Onboarding,Ed as OnboardingDone,lh as Overview,yh as PipelineCollectors,xu as SamplingOnboardingModal,md as SamplingRuleDrawer,ys as SamplingRuleForm,$h as SamplingRules,Dh as Settings,xd as SystemDrawer,vh as TABS};
922
+ `,ig=e=>"general"===e.name?0:"advanced"===e.name?2:1,lg=({minSupportedVersion:o=0,pageHeightOffset:i=0,configYamls:l,configYamlsLoading:s,effectiveConfig:c,effectiveConfigLoading:d,refetch:u,factoryReset:p,onSave:h,saveLoading:g})=>{const{isVersionSupported:m,version:f,isEnterprise:b}=y(o),v=a(()=>{if(!c)return{};const{manifestYAML:e,provenance:t,...o}=c;return o},[c]),{formData:C,handleFormChange:S,getNestedValue:w,getFormDiff:x,isFormDirty:k}=$t(v);n(()=>{"{}"!==JSON.stringify(v)&&"{}"===JSON.stringify(C)&&S(void 0,void 0,v)},[v,C]);const T=a(()=>[...l].sort((e,t)=>ig(e)-ig(t)),[l]),$=a(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(c?.provenance),[c?.provenance]),E=a(()=>{const e=new Set;for(const t of l)for(const o of t.fields)o.componentType===It.Dropdown&&e.add(o.helmValuePath);return e},[l]),I=a(()=>l.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:w("formData",e.helmValuePath)}))),[l,C,w]),[N,A]=r(!1),O=async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let a=n;for(const e of t){if(null==a||"object"!=typeof a){a=void 0;break}a=a[e]}"string"==typeof a&&o(n,t,a.replaceAll("-","_"))}return n})(x(v,C),E);await(h?.(e)),S(void 0,void 0,{})},D=a(()=>[{id:Bo(),type:Wt.Button,buttonProps:{"data-id":"settings-save",variant:ie.Primary,size:ae.S,label:"Save Changes",leftIcon:Ci,loading:g,onClick:()=>A(!0)}},{id:Bo(),type:Wt.Button,buttonProps:{"data-id":"settings-cancel",variant:ie.Secondary,size:ae.S,label:"Cancel",leftIcon:Si,onClick:()=>S(void 0,void 0,v)}}],[g,x,v,C,S]),R=a(()=>T.map(e=>({id:e.name,label:e.displayName})),[T]),P=a(()=>T.map(e=>e.name),[T]),{selectedSection:F,setSelectedSection:L,setSectionRef:_,setScrollContainerRef:z}=ai({sectionNames:P});return e(ua,{$heightOffset:i,$gap:12,children:[t(og,{disabled:!m,loading:s||d,tabs:R,selectedTab:F,setSelectedTab:L,onClickReset:p?()=>p().then(()=>u?.()):void 0,onClickRefresh:u?()=>u():void 0}),e(Xa,{children:[!m&&t(Sl,{minSupportedVersion:o,currentVersion:f||""}),t(pa,{isOpen:k,richTitle:{icon:Ti,title:"Config Settings"},actions:D}),t(ze,{isOpen:N,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>A(!1),denyButton:{label:"Keep editing",variant:ie.Secondary,onClick:()=>A(!1)},approveButton:{label:"Save changes",variant:ie.Primary,onClick:()=>{O(),A(!1)}}}),e(ng,{$gap:24,$alignItems:"stretch",children:[t(ag,{ref:z,$gap:24,$width:"100%",children:l.length?T.map(o=>t(Ye,{id:o.name,ref:e=>_(o.name,e),richTitle:{icon:Ti,title:o.displayName},children:o.fields.map(o=>{if(o.isEnterpriseOnly&&!b)return null;if(o.renderCondition&&!Ce(o.renderCondition,[],I))return null;const n=st(o.componentProps||"{}",{}),a=$[o.helmValuePath];return e(V,{$gap:4,children:[t(al,{componentType:o.componentType,inputType:n.type,name:o.helmValuePath,label:o.displayName,tooltip:o.description,badge:a?{status:"odigos-local-ui-config"===a?we.Warning:pt.Unknown,label:a,tooltip:`This field is reconciled from the following resource: ${a}`}:void 0,disabled:o.isHelmOnly||g,value:w("formData",o.helmValuePath),setValue:e=>S(o.helmValuePath,e),dropdownOptions:n.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0},o.helmValuePath),o.isHelmOnly?t(Se,{status:we.Info,smallIcon:!0,message:"This field can only be updated via Helm values.yaml file"}):null]},o.helmValuePath)})},o.name)):s?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(Ye,{richTitle:{icon:Ti,title:"Config Settings"},children:t(me,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})}),t(ag,{children:d&&!c?.manifestYAML?t(Qe,{$height:"30vh",children:t(at,{withSpinner:!0})}):t(vl,{title:"Effective Config YAML",yaml:c?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})]})};export{Zr as AddActionDrawer,Tr as AddActionForm,Zd as AddDataStreamModal,ss as AddDestinationDrawer,Ir as AddDestinationForm,cs as AddRuleDrawer,Lr as AddRuleForm,Ns as AddSourceDrawer,np as CentralConnections,zr as DataStreamForm,_r as DataStreamMergeWarning,Os as EditActionDrawer,Ds as EditConfigDrawer,Qd as EditDataStreamModal,Ps as EditDestinationDrawer,Ls as EditRuleDrawer,Nd as EditSourceDrawer,Mr as EditSourceForm,ou as ONBOARDING_DONE_MODAL_ID,bp as Onboarding,nu as OnboardingDone,Ph as Overview,Wh as PipelineCollectors,dr as RegexTesterDrawer,qu as SamplingOnboardingModal,Vd as SamplingRuleDrawer,jr as SamplingRuleForm,eg as SamplingRules,lg as Settings,qd as SystemDrawer,Gh as TABS};